@stenajs-webui/panels 17.6.0 → 17.7.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 (57) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/components/action-menu-button/ActionMenuButton.d.ts +19 -19
  3. package/dist/components/action-menu-button/ActionMenuFlatButton.d.ts +5 -5
  4. package/dist/components/action-menu-button/ActionMenuPrimaryButton.d.ts +6 -6
  5. package/dist/components/action-menu-button/ActionMenuSecondaryButton.d.ts +5 -5
  6. package/dist/components/checkbox-menu/CheckboxMenu.d.ts +7 -7
  7. package/dist/components/collapsible/Collapsible.d.ts +18 -18
  8. package/dist/components/collapsible/CollapsibleClickableContent.d.ts +6 -6
  9. package/dist/components/collapsible/CollapsibleContent.d.ts +7 -7
  10. package/dist/components/collapsible/CollapsibleEmptyContent.d.ts +5 -5
  11. package/dist/components/collapsible/CollapsibleGroupHeading.d.ts +6 -6
  12. package/dist/components/collapsible/CollapsibleWithCheckbox.d.ts +6 -6
  13. package/dist/components/error-panel/ErrorPanel.d.ts +5 -5
  14. package/dist/components/error-panel/ErrorScreen.d.ts +3 -3
  15. package/dist/components/loading-panel/LoadingPanel.d.ts +5 -5
  16. package/dist/components/loading-panel/LoadingScreen.d.ts +3 -3
  17. package/dist/components/nav-bar/NavBar.d.ts +16 -16
  18. package/dist/components/nav-bar/NavBarButton.d.ts +6 -6
  19. package/dist/components/nav-bar/NavBarHeading.d.ts +6 -6
  20. package/dist/components/nav-bar/NavBarNotificationButton.d.ts +9 -9
  21. package/dist/components/nav-bar/NavBarPopoverButton.d.ts +12 -12
  22. package/dist/components/nav-bar/NavBarSearchField.d.ts +6 -6
  23. package/dist/components/nav-bar/NavBarSideMenuButton.d.ts +6 -6
  24. package/dist/components/nav-bar/NavBarUserButton.d.ts +9 -9
  25. package/dist/components/nav-bar/NavbarHeightStyleUtil.d.ts +2 -2
  26. package/dist/components/notifications/Notification.d.ts +16 -16
  27. package/dist/components/notifications/NotificationTheme.d.ts +7 -7
  28. package/dist/components/page-header/PageHeader.d.ts +9 -9
  29. package/dist/components/page-header/PageHeaderRow.d.ts +5 -5
  30. package/dist/components/page-header/PageHeading.d.ts +11 -11
  31. package/dist/components/selected-items-actions-panel/SelectedItemsActionsPanel.d.ts +10 -10
  32. package/dist/components/sidebar-menu/SidebarMenu.d.ts +12 -12
  33. package/dist/components/sidebar-menu/SidebarMenuCloseButton.d.ts +5 -5
  34. package/dist/components/sidebar-menu/SidebarMenuCollapsible.d.ts +10 -10
  35. package/dist/components/sidebar-menu/SidebarMenuHeading.d.ts +7 -7
  36. package/dist/components/sidebar-menu/SidebarMenuLink.d.ts +16 -16
  37. package/dist/components/sidebar-menu/SidebarMenuSeparator.d.ts +5 -5
  38. package/dist/components/sidebar-menu/rail/SidebarRailMenu.d.ts +10 -10
  39. package/dist/components/sidebar-menu/rail/renderer/RailRenderer.d.ts +8 -8
  40. package/dist/components/sidebar-menu/rail/renderer/types.d.ts +19 -19
  41. package/dist/index.d.ts +35 -35
  42. package/dist/index.es.js +1098 -584
  43. package/dist/index.es.js.map +1 -1
  44. package/dist/index.js +1 -653
  45. package/dist/index.js.map +1 -1
  46. package/package.json +10 -11
  47. package/dist/components/action-menu-button/ActionMenuButton.stories.d.ts +0 -15
  48. package/dist/components/checkbox-menu/CheckboxMenu.stories.d.ts +0 -7
  49. package/dist/components/collapsible/Collapsible.stories.d.ts +0 -21
  50. package/dist/components/error-panel/ErrorPanel.stories.d.ts +0 -8
  51. package/dist/components/error-panel/ErrorScreen.stories.d.ts +0 -8
  52. package/dist/components/loading-panel/LoadingPanel.stories.d.ts +0 -8
  53. package/dist/components/loading-panel/LoadingScreen.stories.d.ts +0 -8
  54. package/dist/components/nav-bar/NavBar.stories.d.ts +0 -27
  55. package/dist/components/notifications/Notification.stories.d.ts +0 -7
  56. package/dist/components/page-header/PageHeader.stories.d.ts +0 -15
  57. package/dist/components/sidebar-menu/SidebarMenu.stories.d.ts +0 -14
package/dist/index.es.js CHANGED
@@ -1,592 +1,1106 @@
1
- import * as React from 'react';
2
- import { useRef, useMemo, forwardRef, useState } from 'react';
3
- import { ActionMenu, ActionMenuContext, stenaAngleDown, PrimaryButton, SecondaryButton, FlatButton, stenaBell, Icon, stenaSearch, stenaUser, Banner, Spinner, ButtonContent } from '@stenajs-webui/elements';
4
- import { useBoolean, Column, Box, Row, Indent, Heading, Clickable, Text, Space, SeparatorLine, exhaustSwitchCaseElseThrow } from '@stenajs-webui/core';
5
- import { Popover } from '@stenajs-webui/tooltip';
6
- import { Checkbox, TextInput } from '@stenajs-webui/forms';
7
- import cx from 'classnames';
8
- import { cssColor } from '@stenajs-webui/theme';
9
- import { formatDistance } from 'date-fns';
10
- import { faChevronDown } from '@fortawesome/free-solid-svg-icons';
11
- import { faChevronUp } from '@fortawesome/free-solid-svg-icons/faChevronUp';
12
- import { CSSTransition } from 'react-transition-group';
13
- import { faInbox } from '@fortawesome/free-solid-svg-icons/faInbox';
14
-
15
- /*! *****************************************************************************
16
- Copyright (c) Microsoft Corporation.
17
-
18
- Permission to use, copy, modify, and/or distribute this software for any
19
- purpose with or without fee is hereby granted.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
22
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
23
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
24
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
25
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27
- PERFORMANCE OF THIS SOFTWARE.
28
- ***************************************************************************** */
29
-
30
- var __assign = function() {
31
- __assign = Object.assign || function __assign(t) {
32
- for (var s, i = 1, n = arguments.length; i < n; i++) {
33
- s = arguments[i];
34
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
35
- }
36
- return t;
37
- };
38
- return __assign.apply(this, arguments);
39
- };
40
-
41
- function __rest(s, e) {
42
- var t = {};
43
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
44
- t[p] = s[p];
45
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
46
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
47
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
48
- t[p[i]] = s[p[i]];
49
- }
50
- return t;
51
- }
52
-
53
- var ActionMenuButton = function (_a) {
54
- var renderItems = _a.renderItems, _b = _a.placement, placement = _b === void 0 ? "bottom" : _b, Button = _a.buttonComponent, _c = _a.rightIcon, rightIcon = _c === void 0 ? stenaAngleDown : _c, _d = _a.portalTarget, portalTarget = _d === void 0 ? "parent" : _d, zIndex = _a.zIndex, menuWidth = _a.menuWidth, menuTop = _a.menuTop, onClick = _a.onClick, _e = _a.disableArrow, disableArrow = _e === void 0 ? false : _e, buttonProps = __rest(_a, ["renderItems", "placement", "buttonComponent", "rightIcon", "portalTarget", "zIndex", "menuWidth", "menuTop", "onClick", "disableArrow"]);
55
- var _f = useBoolean(false), isOpen = _f[0], open = _f[1], close = _f[2], toggle = _f[3];
56
- var buttonRef = useRef(null);
57
- var focusManager = {
58
- name: "focusManager",
59
- defaultValue: true,
60
- fn: function (_a) {
61
- var popper = _a.popper;
62
- var restoreFocus = false;
63
- var closeOnEscape = function (event) {
64
- if (event.key === "Escape") {
65
- restoreFocus = true;
66
- close();
67
- }
68
- if (event.key === "Enter" || event.key === " ") {
69
- restoreFocus = true;
70
- }
71
- };
72
- return {
73
- onCreate: function () {
74
- popper.addEventListener("keydown", closeOnEscape);
75
- },
76
- onDestroy: function () {
77
- popper.removeEventListener("keydown", closeOnEscape);
78
- },
79
- onMount: function () {
80
- var _a;
81
- restoreFocus = false;
82
- (_a = popper
83
- .querySelector("button:not([disabled]), a[href]")) === null || _a === void 0 ? void 0 : _a.focus();
84
- },
85
- onHide: function () {
86
- if (buttonRef.current && restoreFocus) {
87
- buttonRef.current.focus();
88
- }
89
- },
90
- };
91
- },
92
- };
93
- var contextValue = useMemo(function () { return ({ open: open, close: close }); }, [open, close]);
94
- var handleClick = function (event) {
95
- onClick === null || onClick === void 0 ? void 0 : onClick(event);
96
- toggle();
97
- };
98
- return (React.createElement(Popover, { disablePadding: true, visible: isOpen, onClickOutside: close, placement: placement, content: isOpen && (React.createElement(ActionMenu, { variant: "outlined", width: menuWidth, top: menuTop, trapFocus: true },
99
- React.createElement(ActionMenuContext.Provider, { value: contextValue }, renderItems(close)))), arrow: false, appendTo: portalTarget, zIndex: zIndex, plugins: [focusManager], lazy: true },
100
- React.createElement(Button, __assign({ rightIcon: disableArrow ? undefined : rightIcon }, buttonProps, { ref: buttonRef, onClick: handleClick }))));
101
- };
102
-
103
- var ActionMenuPrimaryButton = function (props) {
104
- return React.createElement(ActionMenuButton, __assign({ buttonComponent: PrimaryButton }, props));
105
- };
106
-
107
- var ActionMenuSecondaryButton = function (props) {
108
- return React.createElement(ActionMenuButton, __assign({ buttonComponent: SecondaryButton }, props));
109
- };
110
-
111
- var ActionMenuFlatButton = function (props) {
112
- return React.createElement(ActionMenuButton, __assign({ buttonComponent: FlatButton }, props));
113
- };
114
-
115
- var border = "1px solid var(--lhds-color-ui-300)";
116
- var CheckboxMenu = function (_a) {
117
- var renderMenu = _a.renderMenu, checkboxProps = __rest(_a, ["renderMenu"]);
118
- var _b = useBoolean(false), isOpen = _b[0], open = _b[1], close = _b[2];
119
- return (React.createElement(Popover, { onClickOutside: close, arrow: false, visible: isOpen, disablePadding: true, content: renderMenu ? (React.createElement(Column, null,
120
- React.createElement(ActionMenu, null, renderMenu(close)))) : undefined, placement: "bottom-start", variant: "outlined" },
121
- React.createElement(Box, { display: "inline-block" },
122
- React.createElement(Row, { spacing: 0.5, indent: true, alignItems: "center", border: border, borderRadius: "4px" },
123
- React.createElement(Checkbox, __assign({}, checkboxProps)),
124
- React.createElement(Indent, { num: 0.5 }),
125
- React.createElement(FlatButton, { size: "small", onClick: open, leftIcon: stenaAngleDown })))));
126
- };
127
-
128
- function styleInject(css, ref) {
129
- if ( ref === void 0 ) ref = {};
130
- var insertAt = ref.insertAt;
131
-
132
- if (!css || typeof document === 'undefined') { return; }
133
-
134
- var head = document.head || document.getElementsByTagName('head')[0];
135
- var style = document.createElement('style');
136
- style.type = 'text/css';
137
-
138
- if (insertAt === 'top') {
139
- if (head.firstChild) {
140
- head.insertBefore(style, head.firstChild);
141
- } else {
142
- head.appendChild(style);
1
+ (function(){ try {var elementStyle = document.createElement('style'); elementStyle.appendChild(document.createTextNode("._navBar_1qp30_1{--swui-navbar-background-color: var(--lhds-color-blue-500);--swui-navbar-item-background-color-hover: var(--lhds-color-blue-700);--swui-navbar-item-background-color-selected: var(--lhds-color-blue-600);--swui-navbar-item-background-color-selected-hover: var( --lhds-color-blue-700 );background-color:var(--swui-navbar-background-color)}._sidebarMenuButton_1x4z8_1{--swui-nav-bar-side-menu-button-text-color: var(--lhds-color-ui-50);--swui-nav-bar-side-menu-button-background-color: var(--lhds-color-blue-500);--swui-nav-bar-side-menu-button-background-color-hover: var( --lhds-color-blue-600 );--swui-nav-bar-side-menu-button-background-color-focus: var( --lhds-color-blue-600 );--swui-nav-bar-side-menu-button-background-color-active: var( --lhds-color-blue-700 );--current-background-color: var( --swui-nav-bar-side-menu-button-background-color );display:flex;align-items:center;justify-content:center;line-height:10px;background-color:var(--current-background-color);color:var(--swui-nav-bar-side-menu-button-text-color);cursor:pointer;height:var(--swui-nav-bar-height);width:var(--swui-nav-bar-height);padding:0;margin:0;box-sizing:border-box;border-radius:0;outline:none;border:none}._sidebarMenuButton_1x4z8_1:hover{--current-background-color: var( --swui-nav-bar-side-menu-button-background-color-hover )}._sidebarMenuButton_1x4z8_1:focus-visible{--current-background-color: var( --swui-nav-bar-side-menu-button-background-color-focus )}._sidebarMenuButton_1x4z8_1:active{--current-background-color: var( --swui-nav-bar-side-menu-button-background-color-active )}._sidebarMenuButton_1x4z8_1 ._icon_1x4z8_55{color:var(--swui-nav-bar-side-menu-button-text-color)}._navBarButton_1xy53_1{--swui-nav-bar-button-text-color: var(--lhds-color-ui-50);--swui-nav-bar-button-background-color: transparent;--swui-nav-bar-button-background-color-hover: var(--lhds-color-blue-900);--swui-nav-bar-button-background-color-focus: var(--lhds-color-blue-700);--swui-nav-bar-button-background-color-active: var(--lhds-color-blue-800);--swui-nav-bar-button-background-color-selected: var(--lhds-color-blue-600);--swui-nav-bar-button-background-color-selected-hover: var( --lhds-color-blue-700 );--swui-nav-bar-button-background-color-selected-focus: var( --lhds-color-blue-700 );--swui-nav-bar-button-background-color-selected-active: var( --lhds-color-blue-800 );--swui-flat-button-text-color: var(--swui-nav-bar-button-text-color);--swui-flat-button-icon-color: var(--swui-nav-bar-button-text-color);--swui-flat-button-text-color-active: var(--swui-nav-bar-button-text-color);--swui-flat-button-background-color: var( --swui-nav-bar-button-background-color );--swui-flat-button-background-color-hover: var( --swui-nav-bar-button-background-color-hover );--swui-flat-button-background-color-focus: var( --swui-nav-bar-button-background-color-focus );--swui-flat-button-background-color-active: var( --swui-nav-bar-button-background-color-active )}._navBarButton_1xy53_1._selected_1xy53_36{--swui-flat-button-background-color: var( --swui-nav-bar-button-background-color-selected );--swui-flat-button-background-color-hover: var( --swui-nav-bar-button-background-color-selected-hover );--swui-flat-button-background-color-focus: var( --swui-nav-bar-button-background-color-selected-focus );--swui-flat-button-background-color-active: var( --swui-nav-bar-button-background-color-selected-active )}._navBarNotificationButton_1wchp_1{--swui-nav-bar-notification-button-text-color: var(--lhds-color-ui-50);--swui-nav-bar-notification-button-background-color: var( --lhds-color-blue-700 );--swui-nav-bar-notification-button-background-color-hover: var( --lhds-color-blue-900 );--swui-nav-bar-notification-button-background-color-focus: var( --lhds-color-blue-700 );--swui-nav-bar-notification-button-background-color-active: var( --lhds-color-blue-800 );--swui-nav-bar-notification-button-background-color-unread: var( --lhds-color-red-500 );--swui-nav-bar-notification-button-background-color-unread-hover: var( --lhds-color-red-700 );--swui-nav-bar-notification-button-background-color-unread-focus: var( --lhds-color-red-700 );--swui-nav-bar-notification-button-background-color-unread-active: var( --lhds-color-red-800 );--swui-flat-button-text-color: var( --swui-nav-bar-notification-button-text-color );--swui-flat-button-icon-color: var( --swui-nav-bar-notification-button-text-color );--swui-flat-button-text-color-active: var( --swui-nav-bar-notification-button-text-color );--swui-flat-button-background-color: var( --swui-nav-bar-notification-button-background-color );--swui-flat-button-background-color-hover: var( --swui-nav-bar-notification-button-background-color-hover );--swui-flat-button-background-color-focus: var( --swui-nav-bar-notification-button-background-color-focus );--swui-flat-button-background-color-active: var( --swui-nav-bar-notification-button-background-color-active );--swui-button-border-radius: 16px;--swui-button-border-radius-icon-only: 16px;--swui-nav-bar-notification-shake-count: 3;transition:.5s width;width:32px}._navBarNotificationButton_1wchp_1._hasCount_1wchp_60{width:56px}._navBarNotificationButton_1wchp_1._unread_1wchp_64{--swui-flat-button-background-color: var( --swui-nav-bar-notification-button-background-color-unread );--swui-flat-button-background-color-hover: var( --swui-nav-bar-notification-button-background-color-unread-hover );--swui-flat-button-background-color-focus: var( --swui-nav-bar-notification-button-background-color-unread-focus );--swui-flat-button-background-color-active: var( --swui-nav-bar-notification-button-background-color-unread-active )}._navBarNotificationButton_1wchp_1._unread_1wchp_64._hasCount_1wchp_60 ._icon_1wchp_79{-webkit-transform-origin:top center;transform-origin:top center;-webkit-animation:_shake_1wchp_1 1.5s ease-in-out var(--swui-nav-bar-notification-shake-count);animation:_shake_1wchp_1 1.5s ease-in-out var(--swui-nav-bar-notification-shake-count)}@-webkit-keyframes _shake_1wchp_1{0%{-webkit-transform:rotate(0);transform:rotate(0)}7%{-webkit-transform:rotate(20deg);transform:rotate(20deg)}15%{-webkit-transform:rotate(-20deg);transform:rotate(-20deg)}22%{-webkit-transform:rotate(16deg);transform:rotate(16deg)}30%{-webkit-transform:rotate(-16deg);transform:rotate(-16deg)}38%{-webkit-transform:rotate(6deg);transform:rotate(6deg)}42%{-webkit-transform:rotate(-6deg);transform:rotate(-6deg)}46%{-webkit-transform:rotate(2deg);transform:rotate(2deg)}to{-webkit-transform:rotate(0);transform:rotate(0)}}@keyframes _shake_1wchp_1{0%{-webkit-transform:rotate(0);transform:rotate(0)}7%{-webkit-transform:rotate(20deg);transform:rotate(20deg)}15%{-webkit-transform:rotate(-20deg);transform:rotate(-20deg)}22%{-webkit-transform:rotate(16deg);transform:rotate(16deg)}30%{-webkit-transform:rotate(-16deg);transform:rotate(-16deg)}38%{-webkit-transform:rotate(6deg);transform:rotate(6deg)}42%{-webkit-transform:rotate(-6deg);transform:rotate(-6deg)}46%{-webkit-transform:rotate(2deg);transform:rotate(2deg)}to{-webkit-transform:rotate(0);transform:rotate(0)}}._navBarSearchFieldInput_4knxd_1{--swui-textinput-line-height: 2.7rem;--swui-textinput-text-color: var(--lhds-color-ui-50)}._navBarSearchFieldInput_4knxd_1:focus{--swui-textinput-text-color: var(--lhds-color-ui-800)}._navBarSearchField_4knxd_1{--swui-textinput-animation-time: var(--swui-animation-time-fast);--swui-textinput-placeholder-color: var(--lhds-color-ui-500);--swui-textinput-bg-color: var(--lhds-color-blue-600);--swui-textinput-border-color: transparent;--swui-textinput-border-color-hover: transparent}._navBarSearchField_4knxd_1:focus-within{--swui-textinput-text-color: var(--lhds-color-ui-800);--swui-field-text-color: var(--swui-field-text-color);--swui-textinput-icon-color: var(--lhds-color-ui-500);--swui-textinput-bg-color: var(--lhds-color-ui-50)}._navBarUserButton_1gxfr_1{--swui-nav-bar-user-button-text-color: var(--lhds-color-ui-50);--swui-nav-bar-user-button-background-color: var(--lhds-color-blue-700);--swui-nav-bar-user-button-background-color-hover: var(--lhds-color-blue-900);--swui-nav-bar-user-button-background-color-focus: var(--lhds-color-blue-700);--swui-nav-bar-user-button-background-color-active: var( --lhds-color-blue-800 );--swui-flat-button-text-color: var(--swui-nav-bar-user-button-text-color);--swui-flat-button-icon-color: var(--swui-nav-bar-user-button-text-color);--swui-flat-button-text-color-active: var( --swui-nav-bar-user-button-text-color );--swui-flat-button-background-color: var( --swui-nav-bar-user-button-background-color );--swui-flat-button-background-color-hover: var( --swui-nav-bar-user-button-background-color-hover );--swui-flat-button-background-color-focus: var( --swui-nav-bar-user-button-background-color-focus );--swui-flat-button-background-color-active: var( --swui-nav-bar-user-button-background-color-active );--swui-button-border-radius: 16px;--swui-button-border-radius-icon-only: 16px}._navBarUserButton_1gxfr_1._initials_1gxfr_33{width:32px}._collapsible_1nroa_1{--swui-collapsible-animation-time: var(--swui-animation-time-fast);--swui-collapsible-expanded-line-background-color: var( --swui-primary-action-color );--swui-collapsible-header-text-color: var(--lhds-color-ui-900);--swui-collapsible-header-background-color: var(--swui-white);--swui-collapsible-header-background-color-hover: var(--lhds-color-blue-100);--swui-collapsible-header-background-color-active: var(--lhds-color-blue-100);--swui-collapsible-header-border-color: var(--lhds-color-ui-300);--swui-collapsible-header-border-color-focus: var( --swui-primary-action-color );--swui-collapsible-header-focus-shadow: var(--swui-field-focus-shadow);--swui-collapsible-header-content-margin: calc( var(--swui-metrics-indent) * 2 );--swui-collapsible-header-font-weight: var(--swui-font-weight-text-bold);--swui-collapsible-header-indicator-color: var(--swui-primary-action-color);--swui-collapsible-header-indicator-color-collapsed: var(--lhds-color-ui-500);--swui-collapsible-header-indicator-color-hover: var( --swui-primary-action-color );--swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0;--swui-collapsible-content-background-color: var(--lhds-color-ui-100);--swui-collapsible-content-border-color: var(--lhds-color-ui-300);--swui-collapsible-content-padding: var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 2);--swui-collapsible-groupheading-font-size: var(--swui-font-size-smaller);--swui-collapsible-groupheading-text-color: var(--lhds-color-ui-600);--swui-collapsible-min-height: 40px}._collapsible_1nroa_1 ._header_1nroa_46{background-color:var(--swui-collapsible-header-background-color);width:100%;text-align:left;min-height:var(--swui-collapsible-min-height);box-sizing:border-box;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--swui-collapsible-header-border-color);padding:var(--swui-collapsible-header-padding)}._collapsible_1nroa_1 ._header_1nroa_46 ._indicator_1nroa_59{transition:all var(--swui-collapsible-animation-time) ease-in-out;margin-left:var(--swui-collapsible-header-content-margin);color:var(--swui-collapsible-header-indicator-color)}._collapsible_1nroa_1 ._header_1nroa_46:not(:disabled):hover:not(:active){background-color:var(--swui-collapsible-header-background-color-hover)}._collapsible_1nroa_1 ._header_1nroa_46:not(:disabled):hover:not(:active) ._indicator_1nroa_59{color:var(--swui-collapsible-header-indicator-color-hover)}._collapsible_1nroa_1 ._header_1nroa_46:focus-visible{outline:1px solid var(--swui-collapsible-header-border-color-focus);outline-offset:-1px;box-shadow:var(--swui-collapsible-header-focus-shadow)}._collapsible_1nroa_1 ._header_1nroa_46:active{background:var(--swui-collapsible-header-background-color-active)}._collapsible_1nroa_1 ._header_1nroa_46:disabled{cursor:not-allowed}._collapsible_1nroa_1{position:relative}._collapsible_1nroa_1:before{content:\"\";position:absolute;width:2px;background:var(--swui-collapsible-expanded-line-background-color);top:0;bottom:0;left:0;z-index:1}._collapsible_1nroa_1 ._headerText_1nroa_103{font-weight:var(--swui-collapsible-header-font-weight)}._collapsible_1nroa_1[aria-expanded=false]{--swui-collapsible-expanded-line-background-color: transparent}._collapsible_1nroa_1[aria-expanded=false] ._indicator_1nroa_59{color:var(--swui-collapsible-header-indicator-color-collapsed)}._collapsible_1nroa_1 ._label_1nroa_114{margin-right:auto}._collapsible_1nroa_1 ._label_1nroa_114 span{--current-line-height: 1;font-weight:var(--swui-collapsible-header-font-weight)}._collapsible_1nroa_1 ._contentLeft_1nroa_123,._collapsible_1nroa_1 ._contentRight_1nroa_124{display:flex}._collapsible_1nroa_1 ._contentLeft_1nroa_123 button,._collapsible_1nroa_1 ._contentRight_1nroa_124 button{cursor:pointer}._collapsible_1nroa_1 ._contentLeft_1nroa_123{margin-right:var(--swui-collapsible-header-content-margin)}._collapsible_1nroa_1 ._contentRight_1nroa_124{margin-left:auto}._collapsible_1nroa_1 ._content_1nroa_123{display:flex;align-items:center;justify-content:stretch;background:var(--swui-collapsible-content-background-color);padding:var(--swui-collapsible-content-padding);min-height:var(--swui-collapsible-min-height);box-sizing:border-box}._collapsible_1nroa_1 ._content_1nroa_123:last-child{border-bottom:1px solid var(--swui-collapsible-content-border-color)}._collapsible_1nroa_1 ._content_1nroa_123._groupHeading_1nroa_155{border:none;font-size:var(--swui-collapsible-groupheading-font-size);font-family:var(--swui-font-primary);color:var(--swui-collapsible-groupheading-text-color);text-transform:uppercase;font-weight:var(--swui-font-weight-text-bold);letter-spacing:.1rem}._collapsible_1nroa_1 ._content_1nroa_123 [data-hidden=true]{display:none}._collapsible_1nroa_1 ._content_1nroa_123:hover [data-hidden=true]{display:inherit}._collapsible_1nroa_1 ._content_1nroa_123:hover [data-hover=true]{color:var(--swui-collapsible-header-indicator-color-hover)}._collapsible_1nroa_1 ._contentEnter_1nroa_180{opacity:0}._collapsible_1nroa_1 ._contentEnterActive_1nroa_184{opacity:1;transition:opacity var(--swui-collapsible-animation-time) ease-in-out}._collapsible_1nroa_1 ._contentExitDone_1nroa_189{display:none}._collapsible_1nroa_1 button._content_1nroa_123{font-family:var(--swui-font-primary);font-size:inherit;width:100%;text-align:left}._collapsible_1nroa_1 button._content_1nroa_123:focus-visible{outline:1px solid var(--swui-collapsible-header-border-color-focus);outline-offset:-1px;box-shadow:var(--swui-collapsible-header-focus-shadow)}._collapsible_1nroa_1 button._content_1nroa_123:not(:disabled):hover{background-color:var(--swui-collapsible-header-background-color-hover)}._collapsible_1nroa_1 button._content_1nroa_123:disabled{cursor:not-allowed}._collapsible_1nroa_1 button._content_1nroa_123:focus-within [data-hidden=true]{display:inherit}._collapsible_1nroa_1 ._collapsible_1nroa_1{--swui-collapsible-header-background-color: var( --swui-collapsible-content-background-color );--swui-collapsible-header-font-weight: normal}._collapsible_1nroa_1 ._collapsible_1nroa_1{--swui-collapsible-content-padding: var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 2) var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 4)}._collapsible_1nroa_1 ._collapsible_1nroa_1 ._collapsible_1nroa_1{--swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0 calc(var(--swui-metrics-indent) * 4);--swui-collapsible-content-padding: var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 2) var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 6)}._collapsible_1nroa_1 ._collapsible_1nroa_1 ._collapsible_1nroa_1 ._collapsible_1nroa_1{--swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0 calc(var(--swui-metrics-indent) * 6);--swui-collapsible-content-padding: var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 2) var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 8)}._collapsible_1nroa_1 ._collapsible_1nroa_1 ._collapsible_1nroa_1 ._collapsible_1nroa_1 ._collapsible_1nroa_1{--swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0 calc(var(--swui-metrics-indent) * 8);--swui-collapsible-content-padding: var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 2) var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 10)}._sidebarMenu_hch18_1{--swui-sidebar-menu-separator-color: var(--lhds-color-blue-700);--swui-sidebar-menu-text-color: var(--swui-white);--swui-sidebar-menu-icon-color: var(--swui-white);--swui-sidebar-menu-background-color: var(--lhds-color-blue-500);--swui-sidebar-menu-background-color-hover: var(--lhds-color-blue-700);--swui-sidebar-menu-background-color-focus: var(--lhds-color-blue-700);--swui-sidebar-menu-background-color-active: var(--lhds-color-blue-600);--swui-sidebar-menu-item-selected: var(--lhds-color-blue-800);--swui-sidebar-menu-content-padding: var(--swui-metrics-indent) var(--swui-metrics-indent) var(--swui-metrics-indent) 0;--current-separator-color: var(--swui-sidebar-menu-separator-color);--current-text-color: var(--swui-sidebar-menu-text-color);--current-icon-color: var(--swui-sidebar-menu-icon-color);--current-background-color: var(--swui-sidebar-menu-background-color);--current-background-color-hover: var( --swui-sidebar-menu-background-color-hover );--current-background-color-focus: var( --swui-sidebar-menu-background-color-focus );--current-background-color-active: var( --swui-sidebar-menu-background-color-active );--current-item-selected: var(--swui-sidebar-menu-item-selected);--current-content-padding: var(--swui-sidebar-menu-content-padding);background-color:var(--current-background-color);height:100vh}._sidebarMenu_hch18_1[data-collapsed]{width:var(--swui-sidebar-menu-item-height)}._sidebarMenu_hch18_1 button{--swui-button-text-color: var(--swui-white);--swui-button-background-color-hover: var( --swui-sidebar-menu-background-color-hover )}._sidebarMenuCloseButton_1j21u_1{--swui-sidebar-menu-close-button-text-color: var(--lhds-color-ui-50);--swui-sidebar-menu-close-button-background-color: var(--lhds-color-blue-500);--swui-sidebar-menu-close-button-background-color-hover: var( --lhds-color-blue-600 );--swui-sidebar-menu-close-button-background-color-focus: var( --lhds-color-blue-600 );--swui-sidebar-menu-close-button-background-color-active: var( --lhds-color-blue-500 );--current-background-color: var( --swui-sidebar-menu-close-button-background-color );display:flex;align-items:center;justify-content:flex-start;line-height:10px;background-color:var(--current-background-color);color:var(--swui-sidebar-menu-close-button-text-color);cursor:pointer;height:var(--swui-sidebar-menu-item-height);padding:0;margin:0;box-sizing:border-box;border-radius:0;outline:none;border:none}._sidebarMenuCloseButton_1j21u_1:hover{--current-background-color: var( --swui-sidebar-menu-close-button-background-color-hover )}._sidebarMenuCloseButton_1j21u_1:focus{--current-background-color: var( --swui-sidebar-menu-close-button-background-color-focus )}._sidebarMenuCloseButton_1j21u_1:active{--current-background-color: var( --swui-sidebar-menu-close-button-background-color-active )}._sidebarMenuCloseButton_1j21u_1 ._iconWrapper_1j21u_55{justify-content:center;align-items:center;width:var(--swui-sidebar-menu-item-height);height:var(--swui-sidebar-menu-item-height)}._sidebarMenuCloseButton_1j21u_1 ._icon_1j21u_55{color:var(--swui-sidebar-menu-close-button-text-color)}._label_mnp0f_1{font-size:var(--current-text-size, var(--swui-font-size-medium));line-height:var(--current-line-height, var(--swui-line-height-medium));font-weight:var(--swui-button-font-weight);font-family:var(--swui-font-buttons);color:var(--current-text-color)}._icon_mnp0f_9{color:var(--current-text-color);font-size:1.6rem}._spinner_mnp0f_14{color:var(--current-text-color)}._leftWrapper_mnp0f_18._leftWrapper_mnp0f_18._leftWrapper_mnp0f_18._leftWrapper_mnp0f_18{width:var(--swui-sidebar-menu-item-height);margin-right:0}._button_mnp0f_23{border:0;padding:0;background:var(--current-background-color)}[data-collapsed] [aria-expanded=true] ._button_mnp0f_23,._button_mnp0f_23:hover{background:var(--current-background-color-hover)}._button_mnp0f_23:focus{outline:none}._button_mnp0f_23:focus-visible{background:var(--current-background-color-active)}._button_mnp0f_23:active{background:var(--current-background-color-active)}._button_mnp0f_23._selected_mnp0f_45{background:var(--current-item-selected)}._sidebarMenuHeading_kvpq5_1{--swui-sidebar-menu-heading-text-color: var(--lhds-color-ui-300);text-transform:uppercase}._sidebarMenuCollapsible_1jwhs_1{--swui-collapsible-header-text-color: var(--current-text-color);--swui-collapsible-header-background-color: var(--current-background-color);--swui-collapsible-header-background-color-hover: var( --current-background-color-hover );--swui-collapsible-header-background-color-active: var( --current-background-color-active );--swui-collapsible-header-indicator-color: var(--current-text-color);--swui-collapsible-header-indicator-color-collapsed: var( --current-text-color );--swui-collapsible-header-indicator-color-hover: var(--current-text-color);--swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0 0;--swui-collapsible-header-content-margin: 0;--swui-collapsible-collapsible-link-padding: var(--swui-metrics-indent) var(--swui-metrics-indent) var(--swui-metrics-indent) calc(var(--swui-metrics-indent) * 4);--swui-collapsible-header-border-color: transparent;--swui-collapsible-min-height: var(--swui-sidebar-menu-item-height)}")); document.head.appendChild(elementStyle);} catch(e) {console.error('vite-plugin-css-injected-by-js', e);} })();import { ActionMenu, ActionMenuContext, stenaAngleDown, PrimaryButton, SecondaryButton, FlatButton, stenaBell, Icon, stenaSearch, stenaUser, Banner, Spinner, ButtonContent } from "@stenajs-webui/elements";
2
+ import * as React from "react";
3
+ import { useRef, useMemo, forwardRef, useState } from "react";
4
+ import { useBoolean, Column, Box, Row, Indent, Heading, Clickable, Text, Space, SeparatorLine, exhaustSwitchCaseElseThrow } from "@stenajs-webui/core";
5
+ import { Popover } from "@stenajs-webui/tooltip";
6
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
7
+ import { Checkbox, TextInput } from "@stenajs-webui/forms";
8
+ import cx from "classnames";
9
+ import { cssColor } from "@stenajs-webui/theme";
10
+ import { formatDistance } from "date-fns";
11
+ import { faChevronDown } from "@fortawesome/free-solid-svg-icons";
12
+ import { faChevronUp } from "@fortawesome/free-solid-svg-icons/faChevronUp";
13
+ import { CSSTransition } from "react-transition-group";
14
+ import { faInbox } from "@fortawesome/free-solid-svg-icons/faInbox";
15
+ const ActionMenuButton = ({
16
+ renderItems,
17
+ placement = "bottom",
18
+ buttonComponent: Button,
19
+ rightIcon = stenaAngleDown,
20
+ portalTarget = "parent",
21
+ zIndex,
22
+ menuWidth,
23
+ menuTop,
24
+ onClick,
25
+ disableArrow = false,
26
+ ...buttonProps
27
+ }) => {
28
+ const [isOpen, open, close, toggle] = useBoolean(false);
29
+ const buttonRef = useRef(null);
30
+ const focusManager = {
31
+ name: "focusManager",
32
+ defaultValue: true,
33
+ fn({
34
+ popper
35
+ }) {
36
+ let restoreFocus = false;
37
+ const closeOnEscape = (event) => {
38
+ if (event.key === "Escape") {
39
+ restoreFocus = true;
40
+ close();
41
+ }
42
+ if (event.key === "Enter" || event.key === " ") {
43
+ restoreFocus = true;
44
+ }
45
+ };
46
+ return {
47
+ onCreate() {
48
+ popper.addEventListener("keydown", closeOnEscape);
49
+ },
50
+ onDestroy() {
51
+ popper.removeEventListener("keydown", closeOnEscape);
52
+ },
53
+ onMount() {
54
+ var _a;
55
+ restoreFocus = false;
56
+ (_a = popper.querySelector("button:not([disabled]), a[href]")) == null ? void 0 : _a.focus();
57
+ },
58
+ onHide() {
59
+ if (buttonRef.current && restoreFocus) {
60
+ buttonRef.current.focus();
61
+ }
62
+ }
63
+ };
143
64
  }
144
- } else {
145
- head.appendChild(style);
146
- }
147
-
148
- if (style.styleSheet) {
149
- style.styleSheet.cssText = css;
150
- } else {
151
- style.appendChild(document.createTextNode(css));
152
- }
153
- }
154
-
155
- var css_248z$b = ".NavBar-module_navBar__HOrS3 {\n /* Theme vars */\n --swui-navbar-background-color: var(--lhds-color-blue-500);\n --swui-navbar-item-background-color-hover: var(--lhds-color-blue-700);\n --swui-navbar-item-background-color-selected: var(--lhds-color-blue-600);\n --swui-navbar-item-background-color-selected-hover: var(\n --lhds-color-blue-700\n );\n\n /* Styling */\n background-color: var(--swui-navbar-background-color);\n}\n";
156
- var styles$a = {"navBar":"NavBar-module_navBar__HOrS3"};
157
- styleInject(css_248z$b);
158
-
159
- var css_248z$a = ".NavBarSideMenuButton-module_sidebarMenuButton__SlbsU {\n /* Theme vars */\n --swui-nav-bar-side-menu-button-text-color: var(--lhds-color-ui-50);\n --swui-nav-bar-side-menu-button-background-color: var(--lhds-color-blue-500);\n --swui-nav-bar-side-menu-button-background-color-hover: var(\n --lhds-color-blue-600\n );\n --swui-nav-bar-side-menu-button-background-color-focus: var(\n --lhds-color-blue-600\n );\n --swui-nav-bar-side-menu-button-background-color-active: var(\n --lhds-color-blue-700\n );\n\n /* State vars */\n --current-background-color: var(\n --swui-nav-bar-side-menu-button-background-color\n );\n\n /* Styling */\n display: flex;\n align-items: center;\n justify-content: center;\n line-height: 10px;\n background-color: var(--current-background-color);\n color: var(--swui-nav-bar-side-menu-button-text-color);\n cursor: pointer;\n height: var(--swui-nav-bar-height);\n width: var(--swui-nav-bar-height);\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n border-radius: 0;\n outline: none;\n border: none;\n}\n\n .NavBarSideMenuButton-module_sidebarMenuButton__SlbsU:hover {\n --current-background-color: var(\n --swui-nav-bar-side-menu-button-background-color-hover\n );\n }\n\n .NavBarSideMenuButton-module_sidebarMenuButton__SlbsU:focus-visible {\n --current-background-color: var(\n --swui-nav-bar-side-menu-button-background-color-focus\n );\n }\n\n .NavBarSideMenuButton-module_sidebarMenuButton__SlbsU:active {\n --current-background-color: var(\n --swui-nav-bar-side-menu-button-background-color-active\n );\n }\n\n .NavBarSideMenuButton-module_sidebarMenuButton__SlbsU .NavBarSideMenuButton-module_icon__Art-L {\n color: var(--swui-nav-bar-side-menu-button-text-color);\n }\n";
160
- var styles$9 = {"sidebarMenuButton":"NavBarSideMenuButton-module_sidebarMenuButton__SlbsU","icon":"NavBarSideMenuButton-module_icon__Art-L"};
161
- styleInject(css_248z$a);
162
-
163
- function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
164
-
165
- var _ref$1 = /*#__PURE__*/React.createElement("path", {
65
+ };
66
+ const contextValue = useMemo(() => ({
67
+ open,
68
+ close
69
+ }), [open, close]);
70
+ const handleClick = (event) => {
71
+ onClick == null ? void 0 : onClick(event);
72
+ toggle();
73
+ };
74
+ return /* @__PURE__ */ jsx(Popover, {
75
+ disablePadding: true,
76
+ visible: isOpen,
77
+ onClickOutside: close,
78
+ placement,
79
+ content: isOpen && /* @__PURE__ */ jsx(ActionMenu, {
80
+ variant: "outlined",
81
+ width: menuWidth,
82
+ top: menuTop,
83
+ trapFocus: true,
84
+ children: /* @__PURE__ */ jsx(ActionMenuContext.Provider, {
85
+ value: contextValue,
86
+ children: renderItems(close)
87
+ })
88
+ }),
89
+ arrow: false,
90
+ appendTo: portalTarget,
91
+ zIndex,
92
+ plugins: [focusManager],
93
+ lazy: true,
94
+ children: /* @__PURE__ */ jsx(Button, {
95
+ rightIcon: disableArrow ? void 0 : rightIcon,
96
+ ...buttonProps,
97
+ ref: buttonRef,
98
+ onClick: handleClick
99
+ })
100
+ });
101
+ };
102
+ const ActionMenuPrimaryButton = (props) => {
103
+ return /* @__PURE__ */ jsx(ActionMenuButton, {
104
+ buttonComponent: PrimaryButton,
105
+ ...props
106
+ });
107
+ };
108
+ const ActionMenuSecondaryButton = (props) => {
109
+ return /* @__PURE__ */ jsx(ActionMenuButton, {
110
+ buttonComponent: SecondaryButton,
111
+ ...props
112
+ });
113
+ };
114
+ const ActionMenuFlatButton = (props) => {
115
+ return /* @__PURE__ */ jsx(ActionMenuButton, {
116
+ buttonComponent: FlatButton,
117
+ ...props
118
+ });
119
+ };
120
+ const border = `1px solid var(--lhds-color-ui-300)`;
121
+ const CheckboxMenu = ({
122
+ renderMenu,
123
+ ...checkboxProps
124
+ }) => {
125
+ const [isOpen, open, close] = useBoolean(false);
126
+ return /* @__PURE__ */ jsx(Popover, {
127
+ onClickOutside: close,
128
+ arrow: false,
129
+ visible: isOpen,
130
+ disablePadding: true,
131
+ content: renderMenu ? /* @__PURE__ */ jsx(Column, {
132
+ children: /* @__PURE__ */ jsx(ActionMenu, {
133
+ children: renderMenu(close)
134
+ })
135
+ }) : void 0,
136
+ placement: "bottom-start",
137
+ variant: "outlined",
138
+ children: /* @__PURE__ */ jsx(Box, {
139
+ display: "inline-block",
140
+ children: /* @__PURE__ */ jsxs(Row, {
141
+ spacing: 0.5,
142
+ indent: true,
143
+ alignItems: "center",
144
+ border,
145
+ borderRadius: "4px",
146
+ children: [/* @__PURE__ */ jsx(Checkbox, {
147
+ ...checkboxProps
148
+ }), /* @__PURE__ */ jsx(Indent, {
149
+ num: 0.5
150
+ }), /* @__PURE__ */ jsx(FlatButton, {
151
+ size: "small",
152
+ onClick: open,
153
+ leftIcon: stenaAngleDown
154
+ })]
155
+ })
156
+ })
157
+ });
158
+ };
159
+ const navBar = "_navBar_1qp30_1";
160
+ var styles$a = {
161
+ navBar
162
+ };
163
+ const sidebarMenuButton = "_sidebarMenuButton_1x4z8_1";
164
+ const icon$3 = "_icon_1x4z8_55";
165
+ var styles$9 = {
166
+ sidebarMenuButton,
167
+ icon: icon$3
168
+ };
169
+ const SvgBars = (props) => /* @__PURE__ */ React.createElement("svg", {
170
+ xmlns: "http://www.w3.org/2000/svg",
171
+ width: 16,
172
+ height: 16,
173
+ viewBox: "0 0 24 24",
174
+ ...props
175
+ }, /* @__PURE__ */ React.createElement("path", {
166
176
  fill: "#FFF",
167
177
  fillRule: "evenodd",
168
- d: "M22 5H2c.12 0 0-.15 0 0V3c0 .15.12 0 0 0h20c-.12 0 0 .15 0 0v2c0-.15-.12 0 0 0zm0 8H2c.12 0 0-.15 0 0v-2c0 .15.12 0 0 0h20c-.12 0 0 .15 0 0v2c0-.15-.12 0 0 0zm0 8H2c.12 0 0-.15 0 0v-2c0 .15.12 0 0 0h20c-.12 0 0 .15 0 0v2c0-.15-.12 0 0 0z"
178
+ d: "M22,5 L2,5 C2.11992373,5 2,4.85076158 2,5 L2,3 C2,3.14923842 2.11992373,3 2,3 L22,3 C21.8800763,3 22,3.14923842 22,3 L22,5 C22,4.85076158 21.8800763,5 22,5 Z M22,13 L2,13 C2.11992373,13 2,12.8507616 2,13 L2,11 C2,11.1492384 2.11992373,11 2,11 L22,11 C21.8800763,11 22,11.1492384 22,11 L22,13 C22,12.8507616 21.8800763,13 22,13 Z M22,21 L2,21 C2.11992373,21 2,20.8507616 2,21 L2,19 C2,19.1492384 2.11992373,19 2,19 L22,19 C21.8800763,19 22,19.1492384 22,19 L22,21 C22,20.8507616 21.8800763,21 22,21 Z"
179
+ }));
180
+ const NavBarSideMenuButton = ({
181
+ className,
182
+ onClick
183
+ }) => {
184
+ return /* @__PURE__ */ jsx("button", {
185
+ onClick,
186
+ className: cx(styles$9.sidebarMenuButton, className),
187
+ children: /* @__PURE__ */ jsx(SvgBars, {
188
+ className: styles$9.icon
189
+ })
190
+ });
191
+ };
192
+ const variantToHeight = {
193
+ compact: 40,
194
+ standard: 48,
195
+ relaxed: 64
196
+ };
197
+ const getNavbarHeight = (variant) => variantToHeight[variant] + "px";
198
+ const NavBar = ({
199
+ left,
200
+ className,
201
+ showMenuButton = false,
202
+ menuButtonVisibility = "visible",
203
+ children,
204
+ right,
205
+ center,
206
+ variant = "standard",
207
+ onClickMenuButton
208
+ }) => {
209
+ const currentFlex = center ? 1 : void 0;
210
+ const height = getNavbarHeight(variant);
211
+ return /* @__PURE__ */ jsxs(Row, {
212
+ height,
213
+ minHeight: height,
214
+ justifyContent: "space-between",
215
+ style: {
216
+ ["--swui-nav-bar-height"]: height
217
+ },
218
+ className: cx(styles$a.navBar, className),
219
+ children: [/* @__PURE__ */ jsxs(Row, {
220
+ flex: currentFlex,
221
+ justifyContent: "flex-start",
222
+ alignItems: "center",
223
+ children: [showMenuButton ? /* @__PURE__ */ jsxs(Fragment, {
224
+ children: [menuButtonVisibility === "hidden" ? /* @__PURE__ */ jsx(Box, {
225
+ width: "var(--swui-nav-bar-height)"
226
+ }) : /* @__PURE__ */ jsx(NavBarSideMenuButton, {
227
+ onClick: onClickMenuButton
228
+ }), /* @__PURE__ */ jsx(Indent, {})]
229
+ }) : /* @__PURE__ */ jsx(Indent, {
230
+ num: 2
231
+ }), left ? /* @__PURE__ */ jsxs(Fragment, {
232
+ children: [left, /* @__PURE__ */ jsx(Indent, {
233
+ num: 2
234
+ })]
235
+ }) : /* @__PURE__ */ jsx(Indent, {
236
+ num: 2
237
+ }), children && /* @__PURE__ */ jsx(Fragment, {
238
+ children: /* @__PURE__ */ jsx(Row, {
239
+ justifyContent: "center",
240
+ alignItems: "center",
241
+ children: React.Children.map(children, (child, index) => /* @__PURE__ */ jsxs(Fragment, {
242
+ children: [index > 0 && /* @__PURE__ */ jsx(Indent, {}), child]
243
+ }))
244
+ })
245
+ })]
246
+ }), center && /* @__PURE__ */ jsx(Row, {
247
+ justifyContent: "center",
248
+ alignItems: "center",
249
+ children: center
250
+ }), /* @__PURE__ */ jsxs(Row, {
251
+ justifyContent: "flex-end",
252
+ alignItems: "center",
253
+ flex: currentFlex,
254
+ children: [right, /* @__PURE__ */ jsx(Indent, {
255
+ num: 2
256
+ })]
257
+ })]
258
+ });
259
+ };
260
+ const navBarButton = "_navBarButton_1xy53_1";
261
+ const selected$1 = "_selected_1xy53_36";
262
+ var styles$8 = {
263
+ navBarButton,
264
+ selected: selected$1
265
+ };
266
+ const NavBarButton = ({
267
+ selected: selected2,
268
+ className,
269
+ ...buttonProps
270
+ }) => {
271
+ return /* @__PURE__ */ jsx(FlatButton, {
272
+ ...buttonProps,
273
+ className: cx(styles$8.navBarButton, selected2 && styles$8.selected, className)
274
+ });
275
+ };
276
+ const NavBarHeading = (headingProps) => {
277
+ return /* @__PURE__ */ jsx(Heading, {
278
+ whiteSpace: "nowrap",
279
+ color: "#fff",
280
+ ...headingProps
281
+ });
282
+ };
283
+ const NavBarPopoverButton = ({
284
+ content: content2,
285
+ children,
286
+ ...navBarButtonProps
287
+ }) => {
288
+ const [isOpen, open, close] = useBoolean(false);
289
+ return /* @__PURE__ */ jsx(Popover, {
290
+ onClickOutside: close,
291
+ triggerTarget: document.body,
292
+ visible: isOpen,
293
+ content: /* @__PURE__ */ jsxs(Fragment, {
294
+ children: [content2 && content2({
295
+ close
296
+ }), children]
297
+ }),
298
+ children: /* @__PURE__ */ jsx(NavBarButton, {
299
+ ...navBarButtonProps,
300
+ onClick: open
301
+ })
302
+ });
303
+ };
304
+ const navBarNotificationButton = "_navBarNotificationButton_1wchp_1";
305
+ const hasCount = "_hasCount_1wchp_60";
306
+ const unread = "_unread_1wchp_64";
307
+ const icon$2 = "_icon_1wchp_79";
308
+ const shake = "_shake_1wchp_1";
309
+ var styles$7 = {
310
+ navBarNotificationButton,
311
+ hasCount,
312
+ unread,
313
+ icon: icon$2,
314
+ shake
315
+ };
316
+ const NavBarNotificationButton = ({
317
+ count,
318
+ unread: unread2 = false,
319
+ className,
320
+ labelClassName,
321
+ iconClassName,
322
+ icon: icon2 = stenaBell,
323
+ ...buttonProps
324
+ }) => {
325
+ const hasCount2 = count > 0;
326
+ return /* @__PURE__ */ jsx(FlatButton, {
327
+ ...buttonProps,
328
+ leftIcon: icon2,
329
+ className: cx({
330
+ [styles$7.unread]: unread2
331
+ }, {
332
+ [styles$7.hasCount]: hasCount2
333
+ }, styles$7.navBarNotificationButton, className),
334
+ label: hasCount2 ? String(count) : void 0,
335
+ labelClassName: cx(labelClassName, styles$7.label),
336
+ iconClassName: cx(iconClassName, styles$7.icon)
337
+ });
338
+ };
339
+ const navBarSearchFieldInput = "_navBarSearchFieldInput_4knxd_1";
340
+ const navBarSearchField = "_navBarSearchField_4knxd_1";
341
+ var styles$6 = {
342
+ navBarSearchFieldInput,
343
+ navBarSearchField
344
+ };
345
+ const NavBarSearchField = ({
346
+ placeholder = "Search...",
347
+ className,
348
+ wrapperClassName,
349
+ ...textInputProps
350
+ }) => {
351
+ return /* @__PURE__ */ jsx(TextInput, {
352
+ wrapperClassName: cx(styles$6.navBarSearchField, wrapperClassName),
353
+ className: cx(styles$6.navBarSearchFieldInput, className),
354
+ placeholder,
355
+ contentRight: /* @__PURE__ */ jsx(Clickable, {
356
+ children: /* @__PURE__ */ jsx(Icon, {
357
+ icon: stenaSearch
358
+ })
359
+ }),
360
+ ...textInputProps
361
+ });
362
+ };
363
+ const navBarUserButton = "_navBarUserButton_1gxfr_1";
364
+ const initials = "_initials_1gxfr_33";
365
+ var styles$5 = {
366
+ navBarUserButton,
367
+ initials
368
+ };
369
+ const NavBarUserButton = ({
370
+ className,
371
+ username,
372
+ initials: initials2,
373
+ icon: icon2 = stenaUser,
374
+ iconClassName,
375
+ ...buttonProps
376
+ }) => {
377
+ return /* @__PURE__ */ jsx(ActionMenuFlatButton, {
378
+ ...buttonProps,
379
+ className: cx({
380
+ [styles$5.initials]: initials2 != null
381
+ }, styles$5.navBarUserButton, className),
382
+ leftIcon: username != null ? stenaUser : void 0,
383
+ label: initials2 != null ? initials2 : username,
384
+ disableArrow: true
385
+ });
386
+ };
387
+ const defaultNotificationTheme = {
388
+ notificationBg: "#eaeaea",
389
+ notificationHoverBg: "#eeeeee",
390
+ notificationDismissedBg: "#ffffff",
391
+ notificationDismissedHoverBg: "#f4f4f4"
392
+ };
393
+ const Notification = ({
394
+ onClick,
395
+ icon: icon2,
396
+ iconColor,
397
+ title,
398
+ text,
399
+ content: content2,
400
+ date,
401
+ dismissed,
402
+ theme = defaultNotificationTheme
403
+ }) => {
404
+ const agoLabel = useMemo(() => {
405
+ if (date) {
406
+ return `${formatDistance(date, new Date())} ago`;
407
+ }
408
+ return void 0;
409
+ }, [date]);
410
+ return /* @__PURE__ */ jsx(Clickable, {
411
+ onClick,
412
+ style: {
413
+ textAlign: "left"
414
+ },
415
+ children: /* @__PURE__ */ jsx(Box, {
416
+ background: dismissed ? theme.notificationDismissedBg : theme.notificationBg,
417
+ hoverBackground: dismissed ? theme.notificationDismissedHoverBg : theme.notificationHoverBg,
418
+ spacing: true,
419
+ indent: true,
420
+ children: /* @__PURE__ */ jsxs(Row, {
421
+ width: "250px",
422
+ children: [icon2 && /* @__PURE__ */ jsx(Row, {
423
+ width: "34px",
424
+ alignItems: "center",
425
+ children: /* @__PURE__ */ jsx(Icon, {
426
+ icon: icon2,
427
+ color: iconColor
428
+ })
429
+ }), /* @__PURE__ */ jsxs(Column, {
430
+ flex: 1,
431
+ children: [title && /* @__PURE__ */ jsxs(Fragment, {
432
+ children: [/* @__PURE__ */ jsx(Text, {
433
+ children: title
434
+ }), /* @__PURE__ */ jsx(Space, {
435
+ half: true
436
+ })]
437
+ }), text && /* @__PURE__ */ jsxs(Fragment, {
438
+ children: [/* @__PURE__ */ jsx(Text, {
439
+ size: "small",
440
+ children: text
441
+ }), /* @__PURE__ */ jsx(Space, {
442
+ half: true
443
+ })]
444
+ }), content2 && /* @__PURE__ */ jsxs(Fragment, {
445
+ children: [content2, /* @__PURE__ */ jsx(Space, {
446
+ half: true
447
+ })]
448
+ }), /* @__PURE__ */ jsx(Text, {
449
+ size: "small",
450
+ color: cssColor("--swui-text-disabled-color"),
451
+ children: agoLabel
452
+ })]
453
+ })]
454
+ })
455
+ })
456
+ });
457
+ };
458
+ const collapsible = "_collapsible_1nroa_1";
459
+ const header = "_header_1nroa_46";
460
+ const indicator = "_indicator_1nroa_59";
461
+ const headerText = "_headerText_1nroa_103";
462
+ const label$1 = "_label_1nroa_114";
463
+ const contentLeft = "_contentLeft_1nroa_123";
464
+ const contentRight = "_contentRight_1nroa_124";
465
+ const content = "_content_1nroa_123";
466
+ const groupHeading = "_groupHeading_1nroa_155";
467
+ const contentEnter = "_contentEnter_1nroa_180";
468
+ const contentEnterActive = "_contentEnterActive_1nroa_184";
469
+ const contentExitDone = "_contentExitDone_1nroa_189";
470
+ var styles$4 = {
471
+ collapsible,
472
+ header,
473
+ indicator,
474
+ headerText,
475
+ label: label$1,
476
+ contentLeft,
477
+ contentRight,
478
+ content,
479
+ groupHeading,
480
+ contentEnter,
481
+ contentEnterActive,
482
+ contentExitDone
483
+ };
484
+ const CollapsibleEmptyContent = () => {
485
+ return /* @__PURE__ */ jsxs(Column, {
486
+ indent: true,
487
+ spacing: true,
488
+ flex: 1,
489
+ alignItems: "center",
490
+ children: [/* @__PURE__ */ jsx(Icon, {
491
+ icon: faInbox,
492
+ color: cssColor("--lhds-color-ui-500")
493
+ }), /* @__PURE__ */ jsx(Space, {}), /* @__PURE__ */ jsx(Text, {
494
+ size: "small",
495
+ color: cssColor("--lhds-color-ui-500"),
496
+ children: "No content"
497
+ })]
498
+ });
499
+ };
500
+ const CollapsibleContent = ({
501
+ contentLeft: contentLeft2,
502
+ contentRight: contentRight2,
503
+ className,
504
+ children,
505
+ ...props
506
+ }) => {
507
+ return /* @__PURE__ */ jsxs("div", {
508
+ className: cx(styles$4.content, className),
509
+ ...props,
510
+ children: [contentLeft2 && /* @__PURE__ */ jsx("div", {
511
+ className: styles$4.contentLeft,
512
+ children: contentLeft2
513
+ }), children != null ? children : /* @__PURE__ */ jsx(CollapsibleEmptyContent, {}), contentRight2 && /* @__PURE__ */ jsx("div", {
514
+ className: styles$4.contentRight,
515
+ children: contentRight2
516
+ })]
517
+ });
518
+ };
519
+ const mapCSSTime = (value) => {
520
+ const num = parseFloat(value);
521
+ const match = value.match(/m?s/);
522
+ switch (match == null ? void 0 : match[0]) {
523
+ case "s":
524
+ return num * 1e3;
525
+ case "ms":
526
+ return num;
527
+ default:
528
+ return 0;
529
+ }
530
+ };
531
+ const Collapsible = forwardRef(function Collapsible2({
532
+ label: label2,
533
+ contentLeft: contentLeft2,
534
+ contentRight: contentRight2,
535
+ collapsed = false,
536
+ onClick,
537
+ className,
538
+ disabled = false,
539
+ unmountOnCollapse = false,
540
+ mountOnEnter = true,
541
+ icon: icon2 = faChevronUp,
542
+ iconCollapsed = faChevronDown,
543
+ iconSize = 8,
544
+ children,
545
+ autoFocus = false,
546
+ ...divProps
547
+ }, ref) {
548
+ const divRef = React.useRef(null);
549
+ const timeout = divRef.current ? mapCSSTime(getComputedStyle(divRef.current).getPropertyValue("--swui-collapsible-animation-time")) : void 0;
550
+ return /* @__PURE__ */ jsxs("div", {
551
+ className: cx(styles$4.collapsible, className),
552
+ "aria-expanded": !collapsed,
553
+ ref: divRef,
554
+ ...divProps,
555
+ children: [/* @__PURE__ */ jsxs(Clickable, {
556
+ disableFocusHighlight: true,
557
+ disableOpacityOnClick: true,
558
+ className: styles$4.header,
559
+ onClick,
560
+ disabled,
561
+ autoFocus,
562
+ ref,
563
+ children: [contentLeft2 && /* @__PURE__ */ jsx("div", {
564
+ className: styles$4.contentLeft,
565
+ children: contentLeft2
566
+ }), /* @__PURE__ */ jsx("div", {
567
+ className: styles$4.label,
568
+ children: /* @__PURE__ */ jsx(Text, {
569
+ color: "var(--swui-collapsible-header-text-color)",
570
+ className: styles$4.headerText,
571
+ children: label2
572
+ })
573
+ }), contentRight2 && /* @__PURE__ */ jsx("div", {
574
+ className: styles$4.contentRight,
575
+ children: contentRight2
576
+ }), /* @__PURE__ */ jsx(Icon, {
577
+ icon: collapsed ? iconCollapsed : icon2,
578
+ className: styles$4.indicator,
579
+ size: iconSize,
580
+ fixedWidth: true
581
+ })]
582
+ }), /* @__PURE__ */ jsx(CSSTransition, {
583
+ in: !collapsed,
584
+ timeout: {
585
+ enter: timeout
586
+ },
587
+ classNames: {
588
+ enter: styles$4.contentEnter,
589
+ enterActive: styles$4.contentEnterActive,
590
+ exit: styles$4.contentExit,
591
+ exitActive: styles$4.contentExitActive,
592
+ exitDone: styles$4.contentExitDone
593
+ },
594
+ mountOnEnter,
595
+ unmountOnExit: unmountOnCollapse,
596
+ children: /* @__PURE__ */ jsx("div", {
597
+ role: "region",
598
+ children: children != null ? children : /* @__PURE__ */ jsx(CollapsibleContent, {
599
+ children: /* @__PURE__ */ jsx(CollapsibleEmptyContent, {})
600
+ })
601
+ })
602
+ })]
603
+ });
604
+ });
605
+ const CollapsibleWithCheckbox = ({
606
+ value,
607
+ onValueChange,
608
+ onChange,
609
+ indeterminate,
610
+ ...collapsibleProps
611
+ }) => {
612
+ return /* @__PURE__ */ jsx(Collapsible, {
613
+ contentLeft: /* @__PURE__ */ jsx(Checkbox, {
614
+ value,
615
+ indeterminate,
616
+ onValueChange,
617
+ onChange,
618
+ onClick: (ev) => ev.stopPropagation()
619
+ }),
620
+ ...collapsibleProps
621
+ });
622
+ };
623
+ const CollapsibleClickableContent = ({
624
+ contentLeft: contentLeft2,
625
+ contentRight: contentRight2,
626
+ className,
627
+ onClick,
628
+ children,
629
+ ...props
630
+ }) => {
631
+ return /* @__PURE__ */ jsxs(Clickable, {
632
+ disableFocusHighlight: true,
633
+ disableOpacityOnClick: true,
634
+ className: cx(styles$4.content, className),
635
+ onClick,
636
+ ...props,
637
+ children: [contentLeft2 && /* @__PURE__ */ jsx("div", {
638
+ className: styles$4.contentLeft,
639
+ children: contentLeft2
640
+ }), children != null ? children : /* @__PURE__ */ jsx(CollapsibleEmptyContent, {}), contentRight2 && /* @__PURE__ */ jsx("div", {
641
+ className: styles$4.contentRight,
642
+ children: contentRight2
643
+ })]
644
+ });
645
+ };
646
+ const CollapsibleGroupHeading = ({
647
+ className,
648
+ ...props
649
+ }) => /* @__PURE__ */ jsx(CollapsibleContent, {
650
+ className: cx(styles$4.groupHeading, className),
651
+ ...props
652
+ });
653
+ const ErrorPanel = ({
654
+ text = "Something unexpected happened."
655
+ }) => {
656
+ return /* @__PURE__ */ jsx(Box, {
657
+ justifyContent: "center",
658
+ alignItems: "center",
659
+ children: /* @__PURE__ */ jsx(Banner, {
660
+ variant: "error",
661
+ headerText: text
662
+ })
663
+ });
664
+ };
665
+ const ErrorScreen = (props) => {
666
+ return /* @__PURE__ */ jsx(Box, {
667
+ width: "100%",
668
+ height: "100%",
669
+ justifyContent: "center",
670
+ alignItems: "center",
671
+ children: /* @__PURE__ */ jsx(ErrorPanel, {
672
+ ...props
673
+ })
674
+ });
675
+ };
676
+ const LoadingPanel = ({
677
+ text = "Loading..."
678
+ }) => {
679
+ return /* @__PURE__ */ jsxs(Box, {
680
+ alignItems: "center",
681
+ children: [/* @__PURE__ */ jsx(Spinner, {
682
+ size: "small"
683
+ }), /* @__PURE__ */ jsx(Space, {
684
+ num: 4
685
+ }), /* @__PURE__ */ jsx(Heading, {
686
+ variant: "h4",
687
+ children: text
688
+ })]
689
+ });
690
+ };
691
+ const LoadingScreen = (props) => {
692
+ return /* @__PURE__ */ jsx(Box, {
693
+ width: "100%",
694
+ height: "100%",
695
+ justifyContent: "center",
696
+ alignItems: "center",
697
+ children: /* @__PURE__ */ jsx(LoadingPanel, {
698
+ ...props
699
+ })
700
+ });
701
+ };
702
+ const PageHeader = ({
703
+ renderBreadCrumbs,
704
+ renderPageHeading,
705
+ renderTabs,
706
+ children
707
+ }) => {
708
+ return /* @__PURE__ */ jsxs(Box, {
709
+ shadow: "box",
710
+ background: cssColor("--lhds-color-ui-50"),
711
+ children: [/* @__PURE__ */ jsxs(Box, {
712
+ indent: 3,
713
+ children: [renderBreadCrumbs && /* @__PURE__ */ jsx(Row, {
714
+ spacing: 1.25,
715
+ children: renderBreadCrumbs()
716
+ }), renderPageHeading == null ? void 0 : renderPageHeading(), renderTabs == null ? void 0 : renderTabs()]
717
+ }), children && /* @__PURE__ */ jsxs(Fragment, {
718
+ children: [!renderTabs && /* @__PURE__ */ jsx(Space, {}), /* @__PURE__ */ jsx(SeparatorLine, {}), children]
719
+ })]
720
+ });
721
+ };
722
+ const PageHeaderRow = (props) => /* @__PURE__ */ jsx(Row, {
723
+ indent: 3,
724
+ spacing: true,
725
+ ...props
169
726
  });
170
-
171
- function SvgBars(props) {
172
- return /*#__PURE__*/React.createElement("svg", _extends$1({
173
- xmlns: "http://www.w3.org/2000/svg",
174
- width: 16,
175
- height: 16,
176
- viewBox: "0 0 24 24"
177
- }, props), _ref$1);
178
- }
179
-
180
- var NavBarSideMenuButton = function (_a) {
181
- var className = _a.className, onClick = _a.onClick;
182
- return (React.createElement("button", { onClick: onClick, className: cx(styles$9.sidebarMenuButton, className) },
183
- React.createElement(SvgBars, { className: styles$9.icon })));
184
- };
185
-
186
- var variantToHeight = {
187
- compact: 40,
188
- standard: 48,
189
- relaxed: 64,
190
- };
191
- var getNavbarHeight = function (variant) {
192
- return variantToHeight[variant] + "px";
193
- };
194
-
195
- var NavBar = function (_a) {
196
- var _b;
197
- var left = _a.left, className = _a.className, _c = _a.showMenuButton, showMenuButton = _c === void 0 ? false : _c, _d = _a.menuButtonVisibility, menuButtonVisibility = _d === void 0 ? "visible" : _d, children = _a.children, right = _a.right, center = _a.center, _e = _a.variant, variant = _e === void 0 ? "standard" : _e, onClickMenuButton = _a.onClickMenuButton;
198
- var currentFlex = center ? 1 : undefined;
199
- var height = getNavbarHeight(variant);
200
- return (React.createElement(Row, { height: height, minHeight: height, justifyContent: "space-between", style: (_b = {}, _b["--swui-nav-bar-height"] = height, _b), className: cx(styles$a.navBar, className) },
201
- React.createElement(Row, { flex: currentFlex, justifyContent: "flex-start", alignItems: "center" },
202
- showMenuButton ? (React.createElement(React.Fragment, null,
203
- menuButtonVisibility === "hidden" ? (React.createElement(Box, { width: "var(--swui-nav-bar-height)" })) : (React.createElement(NavBarSideMenuButton, { onClick: onClickMenuButton })),
204
- React.createElement(Indent, null))) : (React.createElement(Indent, { num: 2 })),
205
- left ? (React.createElement(React.Fragment, null,
206
- left,
207
- React.createElement(Indent, { num: 2 }))) : (React.createElement(Indent, { num: 2 })),
208
- children && (React.createElement(React.Fragment, null,
209
- React.createElement(Row, { justifyContent: "center", alignItems: "center" }, React.Children.map(children, function (child, index) { return (React.createElement(React.Fragment, null,
210
- index > 0 && React.createElement(Indent, null),
211
- child)); }))))),
212
- center && (React.createElement(Row, { justifyContent: "center", alignItems: "center" }, center)),
213
- React.createElement(Row, { justifyContent: "flex-end", alignItems: "center", flex: currentFlex },
214
- right,
215
- React.createElement(Indent, { num: 2 }))));
216
- };
217
-
218
- var css_248z$9 = ".NavBarButton-module_navBarButton__3XKjB {\n /* Theme vars */\n --swui-nav-bar-button-text-color: var(--lhds-color-ui-50);\n --swui-nav-bar-button-background-color: transparent;\n --swui-nav-bar-button-background-color-hover: var(--lhds-color-blue-900);\n --swui-nav-bar-button-background-color-focus: var(--lhds-color-blue-700);\n --swui-nav-bar-button-background-color-active: var(--lhds-color-blue-800);\n --swui-nav-bar-button-background-color-selected: var(--lhds-color-blue-600);\n --swui-nav-bar-button-background-color-selected-hover: var(\n --lhds-color-blue-700\n );\n --swui-nav-bar-button-background-color-selected-focus: var(\n --lhds-color-blue-700\n );\n --swui-nav-bar-button-background-color-selected-active: var(\n --lhds-color-blue-800\n );\n\n /* Flatbutton overrrides */\n --swui-flat-button-text-color: var(--swui-nav-bar-button-text-color);\n --swui-flat-button-icon-color: var(--swui-nav-bar-button-text-color);\n --swui-flat-button-text-color-active: var(--swui-nav-bar-button-text-color);\n --swui-flat-button-background-color: var(\n --swui-nav-bar-button-background-color\n );\n --swui-flat-button-background-color-hover: var(\n --swui-nav-bar-button-background-color-hover\n );\n --swui-flat-button-background-color-focus: var(\n --swui-nav-bar-button-background-color-focus\n );\n --swui-flat-button-background-color-active: var(\n --swui-nav-bar-button-background-color-active\n );\n}\n\n .NavBarButton-module_navBarButton__3XKjB.NavBarButton-module_selected__1ReDE {\n --swui-flat-button-background-color: var(\n --swui-nav-bar-button-background-color-selected\n );\n --swui-flat-button-background-color-hover: var(\n --swui-nav-bar-button-background-color-selected-hover\n );\n --swui-flat-button-background-color-focus: var(\n --swui-nav-bar-button-background-color-selected-focus\n );\n --swui-flat-button-background-color-active: var(\n --swui-nav-bar-button-background-color-selected-active\n );\n }\n";
219
- var styles$8 = {"navBarButton":"NavBarButton-module_navBarButton__3XKjB","selected":"NavBarButton-module_selected__1ReDE"};
220
- styleInject(css_248z$9);
221
-
222
- var NavBarButton = function (_a) {
223
- var selected = _a.selected, className = _a.className, buttonProps = __rest(_a, ["selected", "className"]);
224
- return (React.createElement(FlatButton, __assign({}, buttonProps, { className: cx(styles$8.navBarButton, selected && styles$8.selected, className) })));
225
- };
226
-
227
- var NavBarHeading = function (headingProps) {
228
- return React.createElement(Heading, __assign({ whiteSpace: "nowrap", color: "#fff" }, headingProps));
229
- };
230
-
231
- var NavBarPopoverButton = function (_a) {
232
- var content = _a.content, children = _a.children, navBarButtonProps = __rest(_a, ["content", "children"]);
233
- var _b = useBoolean(false), isOpen = _b[0], open = _b[1], close = _b[2];
234
- return (React.createElement(Popover, { onClickOutside: close, triggerTarget: document.body, visible: isOpen, content: React.createElement(React.Fragment, null,
235
- content && content({ close: close }),
236
- children) },
237
- React.createElement(NavBarButton, __assign({}, navBarButtonProps, { onClick: open }))));
238
- };
239
-
240
- var css_248z$8 = ".NavBarNotificationButton-module_navBarNotificationButton__20Q0f {\n /* Theme vars */\n --swui-nav-bar-notification-button-text-color: var(--lhds-color-ui-50);\n --swui-nav-bar-notification-button-background-color: var(\n --lhds-color-blue-700\n );\n --swui-nav-bar-notification-button-background-color-hover: var(\n --lhds-color-blue-900\n );\n --swui-nav-bar-notification-button-background-color-focus: var(\n --lhds-color-blue-700\n );\n --swui-nav-bar-notification-button-background-color-active: var(\n --lhds-color-blue-800\n );\n --swui-nav-bar-notification-button-background-color-unread: var(\n --lhds-color-red-500\n );\n --swui-nav-bar-notification-button-background-color-unread-hover: var(\n --lhds-color-red-700\n );\n --swui-nav-bar-notification-button-background-color-unread-focus: var(\n --lhds-color-red-700\n );\n --swui-nav-bar-notification-button-background-color-unread-active: var(\n --lhds-color-red-800\n );\n\n /* FlatButton overrides */\n --swui-flat-button-text-color: var(\n --swui-nav-bar-notification-button-text-color\n );\n --swui-flat-button-icon-color: var(\n --swui-nav-bar-notification-button-text-color\n );\n --swui-flat-button-text-color-active: var(\n --swui-nav-bar-notification-button-text-color\n );\n --swui-flat-button-background-color: var(\n --swui-nav-bar-notification-button-background-color\n );\n --swui-flat-button-background-color-hover: var(\n --swui-nav-bar-notification-button-background-color-hover\n );\n --swui-flat-button-background-color-focus: var(\n --swui-nav-bar-notification-button-background-color-focus\n );\n --swui-flat-button-background-color-active: var(\n --swui-nav-bar-notification-button-background-color-active\n );\n\n --swui-button-border-radius: 16px;\n --swui-button-border-radius-icon-only: 16px;\n --swui-nav-bar-notification-shake-count: 3;\n\n transition: 0.5s width;\n\n width: 32px;\n}\n\n .NavBarNotificationButton-module_navBarNotificationButton__20Q0f.NavBarNotificationButton-module_hasCount__1ecR2 {\n width: 56px;\n }\n\n .NavBarNotificationButton-module_navBarNotificationButton__20Q0f.NavBarNotificationButton-module_unread__2AREp {\n --swui-flat-button-background-color: var(\n --swui-nav-bar-notification-button-background-color-unread\n );\n --swui-flat-button-background-color-hover: var(\n --swui-nav-bar-notification-button-background-color-unread-hover\n );\n --swui-flat-button-background-color-focus: var(\n --swui-nav-bar-notification-button-background-color-unread-focus\n );\n --swui-flat-button-background-color-active: var(\n --swui-nav-bar-notification-button-background-color-unread-active\n );\n }\n\n .NavBarNotificationButton-module_navBarNotificationButton__20Q0f.NavBarNotificationButton-module_unread__2AREp.NavBarNotificationButton-module_hasCount__1ecR2 .NavBarNotificationButton-module_icon__2hfJP {\n -webkit-transform-origin: top center;\n transform-origin: top center;\n -webkit-animation: NavBarNotificationButton-module_shake__3vEP0 1.5s ease-in-out\n var(--swui-nav-bar-notification-shake-count);\n animation: NavBarNotificationButton-module_shake__3vEP0 1.5s ease-in-out\n var(--swui-nav-bar-notification-shake-count);\n }\n\n @-webkit-keyframes NavBarNotificationButton-module_shake__3vEP0 {\n 0% {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n }\n 7% {\n -webkit-transform: rotate(20deg);\n transform: rotate(20deg);\n }\n 15% {\n -webkit-transform: rotate(-20deg);\n transform: rotate(-20deg);\n }\n 22% {\n -webkit-transform: rotate(16deg);\n transform: rotate(16deg);\n }\n 30% {\n -webkit-transform: rotate(-16deg);\n transform: rotate(-16deg);\n }\n 38% {\n -webkit-transform: rotate(6deg);\n transform: rotate(6deg);\n }\n 42% {\n -webkit-transform: rotate(-6deg);\n transform: rotate(-6deg);\n }\n 46% {\n -webkit-transform: rotate(2deg);\n transform: rotate(2deg);\n }\n 100% {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n }\n }\n\n @keyframes NavBarNotificationButton-module_shake__3vEP0 {\n 0% {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n }\n 7% {\n -webkit-transform: rotate(20deg);\n transform: rotate(20deg);\n }\n 15% {\n -webkit-transform: rotate(-20deg);\n transform: rotate(-20deg);\n }\n 22% {\n -webkit-transform: rotate(16deg);\n transform: rotate(16deg);\n }\n 30% {\n -webkit-transform: rotate(-16deg);\n transform: rotate(-16deg);\n }\n 38% {\n -webkit-transform: rotate(6deg);\n transform: rotate(6deg);\n }\n 42% {\n -webkit-transform: rotate(-6deg);\n transform: rotate(-6deg);\n }\n 46% {\n -webkit-transform: rotate(2deg);\n transform: rotate(2deg);\n }\n 100% {\n -webkit-transform: rotate(0);\n transform: rotate(0);\n }\n }\n";
241
- var styles$7 = {"navBarNotificationButton":"NavBarNotificationButton-module_navBarNotificationButton__20Q0f","hasCount":"NavBarNotificationButton-module_hasCount__1ecR2","unread":"NavBarNotificationButton-module_unread__2AREp","icon":"NavBarNotificationButton-module_icon__2hfJP","shake":"NavBarNotificationButton-module_shake__3vEP0"};
242
- styleInject(css_248z$8);
243
-
244
- var NavBarNotificationButton = function (_a) {
245
- var _b, _c;
246
- var count = _a.count, _d = _a.unread, unread = _d === void 0 ? false : _d, className = _a.className, labelClassName = _a.labelClassName, iconClassName = _a.iconClassName, _e = _a.icon, icon = _e === void 0 ? stenaBell : _e, buttonProps = __rest(_a, ["count", "unread", "className", "labelClassName", "iconClassName", "icon"]);
247
- var hasCount = count > 0;
248
- return (React.createElement(FlatButton, __assign({}, buttonProps, { leftIcon: icon, className: cx((_b = {}, _b[styles$7.unread] = unread, _b), (_c = {}, _c[styles$7.hasCount] = hasCount, _c), styles$7.navBarNotificationButton, className), label: hasCount ? String(count) : undefined, labelClassName: cx(labelClassName, styles$7.label), iconClassName: cx(iconClassName, styles$7.icon) })));
249
- };
250
-
251
- var css_248z$7 = ".NavBarSearchField-module_navBarSearchFieldInput__2kThv {\n --swui-textinput-line-height: 2.7rem;\n --swui-textinput-text-color: var(--lhds-color-ui-50);\n}\n\n .NavBarSearchField-module_navBarSearchFieldInput__2kThv:focus {\n --swui-textinput-text-color: var(--lhds-color-ui-800);\n }\n\n.NavBarSearchField-module_navBarSearchField__kIe66 {\n --swui-textinput-animation-time: var(--swui-animation-time-fast);\n\n --swui-textinput-placeholder-color: var(--lhds-color-ui-500);\n --swui-textinput-bg-color: var(--lhds-color-blue-600);\n --swui-textinput-border-color: transparent;\n --swui-textinput-border-color-hover: transparent;\n}\n\n.NavBarSearchField-module_navBarSearchField__kIe66:focus-within {\n --swui-textinput-text-color: var(--lhds-color-ui-800);\n --swui-field-text-color: var(--swui-field-text-color);\n --swui-textinput-icon-color: var(--lhds-color-ui-500);\n --swui-textinput-bg-color: var(--lhds-color-ui-50);\n }\n";
252
- var styles$6 = {"navBarSearchFieldInput":"NavBarSearchField-module_navBarSearchFieldInput__2kThv","navBarSearchField":"NavBarSearchField-module_navBarSearchField__kIe66"};
253
- styleInject(css_248z$7);
254
-
255
- var NavBarSearchField = function (_a) {
256
- var _b = _a.placeholder, placeholder = _b === void 0 ? "Search..." : _b, className = _a.className, wrapperClassName = _a.wrapperClassName, textInputProps = __rest(_a, ["placeholder", "className", "wrapperClassName"]);
257
- return (React.createElement(TextInput, __assign({ wrapperClassName: cx(styles$6.navBarSearchField, wrapperClassName), className: cx(styles$6.navBarSearchFieldInput, className), placeholder: placeholder, contentRight: React.createElement(Clickable, null,
258
- React.createElement(Icon, { icon: stenaSearch })) }, textInputProps)));
259
- };
260
-
261
- var css_248z$6 = ".NavBarUserButton-module_navBarUserButton__2iY95 {\n /* Theme vars */\n --swui-nav-bar-user-button-text-color: var(--lhds-color-ui-50);\n --swui-nav-bar-user-button-background-color: var(--lhds-color-blue-700);\n --swui-nav-bar-user-button-background-color-hover: var(--lhds-color-blue-900);\n --swui-nav-bar-user-button-background-color-focus: var(--lhds-color-blue-700);\n --swui-nav-bar-user-button-background-color-active: var(\n --lhds-color-blue-800\n );\n\n /* FlatButton overrides */\n --swui-flat-button-text-color: var(--swui-nav-bar-user-button-text-color);\n --swui-flat-button-icon-color: var(--swui-nav-bar-user-button-text-color);\n --swui-flat-button-text-color-active: var(\n --swui-nav-bar-user-button-text-color\n );\n --swui-flat-button-background-color: var(\n --swui-nav-bar-user-button-background-color\n );\n --swui-flat-button-background-color-hover: var(\n --swui-nav-bar-user-button-background-color-hover\n );\n --swui-flat-button-background-color-focus: var(\n --swui-nav-bar-user-button-background-color-focus\n );\n --swui-flat-button-background-color-active: var(\n --swui-nav-bar-user-button-background-color-active\n );\n\n --swui-button-border-radius: 16px;\n --swui-button-border-radius-icon-only: 16px;\n}\n\n .NavBarUserButton-module_navBarUserButton__2iY95.NavBarUserButton-module_initials__1J9z5 {\n width: 32px;\n }\n";
262
- var styles$5 = {"navBarUserButton":"NavBarUserButton-module_navBarUserButton__2iY95","initials":"NavBarUserButton-module_initials__1J9z5"};
263
- styleInject(css_248z$6);
264
-
265
- var NavBarUserButton = function (_a) {
266
- var _b;
267
- var className = _a.className, username = _a.username, initials = _a.initials; _a.icon; _a.iconClassName; var buttonProps = __rest(_a, ["className", "username", "initials", "icon", "iconClassName"]);
268
- return (React.createElement(ActionMenuFlatButton, __assign({}, buttonProps, { className: cx((_b = {}, _b[styles$5.initials] = initials != null, _b), styles$5.navBarUserButton, className), leftIcon: username != null ? stenaUser : undefined, label: initials !== null && initials !== void 0 ? initials : username, disableArrow: true })));
269
- };
270
-
271
- var defaultNotificationTheme = {
272
- notificationBg: "#eaeaea",
273
- notificationHoverBg: "#eeeeee",
274
- notificationDismissedBg: "#ffffff",
275
- notificationDismissedHoverBg: "#f4f4f4",
276
- };
277
-
278
- var Notification = function (_a) {
279
- var onClick = _a.onClick, icon = _a.icon, iconColor = _a.iconColor, title = _a.title, text = _a.text, content = _a.content, date = _a.date, dismissed = _a.dismissed, _b = _a.theme, theme = _b === void 0 ? defaultNotificationTheme : _b;
280
- var agoLabel = useMemo(function () {
281
- if (date) {
282
- return "".concat(formatDistance(date, new Date()), " ago");
283
- }
284
- return undefined;
285
- }, [date]);
286
- return (React.createElement(Clickable, { onClick: onClick, style: { textAlign: "left" } },
287
- React.createElement(Box, { background: dismissed ? theme.notificationDismissedBg : theme.notificationBg, hoverBackground: dismissed
288
- ? theme.notificationDismissedHoverBg
289
- : theme.notificationHoverBg, spacing: true, indent: true },
290
- React.createElement(Row, { width: "250px" },
291
- icon && (React.createElement(Row, { width: "34px", alignItems: "center" },
292
- React.createElement(Icon, { icon: icon, color: iconColor }))),
293
- React.createElement(Column, { flex: 1 },
294
- title && (React.createElement(React.Fragment, null,
295
- React.createElement(Text, null, title),
296
- React.createElement(Space, { half: true }))),
297
- text && (React.createElement(React.Fragment, null,
298
- React.createElement(Text, { size: "small" }, text),
299
- React.createElement(Space, { half: true }))),
300
- content && (React.createElement(React.Fragment, null,
301
- content,
302
- React.createElement(Space, { half: true }))),
303
- React.createElement(Text, { size: "small", color: cssColor("--swui-text-disabled-color") }, agoLabel))))));
304
- };
305
-
306
- var css_248z$5 = ".Collapsible-module_collapsible__2Nn8K {\n --swui-collapsible-animation-time: var(--swui-animation-time-fast);\n\n --swui-collapsible-expanded-line-background-color: var(\n --swui-primary-action-color\n );\n\n /*\n * Header\n */\n --swui-collapsible-header-text-color: var(--lhds-color-ui-900);\n --swui-collapsible-header-background-color: var(--swui-white);\n --swui-collapsible-header-background-color-hover: var(--lhds-color-blue-100);\n --swui-collapsible-header-background-color-active: var(--lhds-color-blue-100);\n --swui-collapsible-header-border-color: var(--lhds-color-ui-300);\n --swui-collapsible-header-border-color-focus: var(\n --swui-primary-action-color\n );\n --swui-collapsible-header-focus-shadow: var(--swui-field-focus-shadow);\n --swui-collapsible-header-content-margin: calc(\n var(--swui-metrics-indent) * 2\n );\n --swui-collapsible-header-font-weight: var(--swui-font-weight-text-bold);\n --swui-collapsible-header-indicator-color: var(--swui-primary-action-color);\n --swui-collapsible-header-indicator-color-collapsed: var(--lhds-color-ui-500);\n --swui-collapsible-header-indicator-color-hover: var(\n --swui-primary-action-color\n );\n --swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0;\n\n /*\n * Content\n */\n --swui-collapsible-content-background-color: var(--lhds-color-ui-100);\n --swui-collapsible-content-border-color: var(--lhds-color-ui-300);\n --swui-collapsible-content-padding: var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 2);\n\n --swui-collapsible-groupheading-font-size: var(--swui-font-size-smaller);\n --swui-collapsible-groupheading-text-color: var(--lhds-color-ui-600);\n\n --swui-collapsible-min-height: 40px;\n}\n\n /* Header */\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_header__IZx0y {\n background-color: var(--swui-collapsible-header-background-color);\n width: 100%;\n text-align: left;\n\n min-height: var(--swui-collapsible-min-height);\n box-sizing: border-box;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid var(--swui-collapsible-header-border-color);\n padding: var(--swui-collapsible-header-padding);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_header__IZx0y .Collapsible-module_indicator__3YBhK {\n transition: all var(--swui-collapsible-animation-time) ease-in-out;\n margin-left: var(--swui-collapsible-header-content-margin);\n color: var(--swui-collapsible-header-indicator-color);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_header__IZx0y:not(:disabled):hover:not(:active) {\n background-color: var(--swui-collapsible-header-background-color-hover);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_header__IZx0y:not(:disabled):hover:not(:active) .Collapsible-module_indicator__3YBhK {\n color: var(--swui-collapsible-header-indicator-color-hover);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_header__IZx0y:focus-visible {\n outline: 1px solid var(--swui-collapsible-header-border-color-focus);\n outline-offset: -1px;\n box-shadow: var(--swui-collapsible-header-focus-shadow);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_header__IZx0y:active {\n background: var(--swui-collapsible-header-background-color-active);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_header__IZx0y:disabled {\n cursor: not-allowed;\n }\n\n .Collapsible-module_collapsible__2Nn8K {\n\n position: relative;\n}\n\n .Collapsible-module_collapsible__2Nn8K::before {\n content: \"\";\n position: absolute;\n width: 2px;\n background: var(--swui-collapsible-expanded-line-background-color);\n top: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_headerText__2qjzx {\n font-weight: var(--swui-collapsible-header-font-weight);\n }\n\n .Collapsible-module_collapsible__2Nn8K[aria-expanded=\"false\"] {\n --swui-collapsible-expanded-line-background-color: transparent;\n }\n\n .Collapsible-module_collapsible__2Nn8K[aria-expanded=\"false\"] .Collapsible-module_indicator__3YBhK {\n color: var(--swui-collapsible-header-indicator-color-collapsed);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_label__Hpp-R {\n margin-right: auto;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_label__Hpp-R span {\n --current-line-height: 1;\n font-weight: var(--swui-collapsible-header-font-weight);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentLeft__2gPpu,\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentRight__bTr59 {\n display: flex;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentLeft__2gPpu button, .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentRight__bTr59 button {\n cursor: pointer;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentLeft__2gPpu {\n margin-right: var(--swui-collapsible-header-content-margin);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentRight__bTr59 {\n margin-left: auto;\n }\n\n /* Content */\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_content__1e1C8 {\n display: flex;\n align-items: center;\n justify-content: stretch;\n background: var(--swui-collapsible-content-background-color);\n padding: var(--swui-collapsible-content-padding);\n min-height: var(--swui-collapsible-min-height);\n box-sizing: border-box;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_content__1e1C8:last-child {\n border-bottom: 1px solid var(--swui-collapsible-content-border-color);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_content__1e1C8.Collapsible-module_groupHeading__3BK-5 {\n border: none;\n font-size: var(--swui-collapsible-groupheading-font-size);\n font-family: var(--swui-font-primary);\n color: var(--swui-collapsible-groupheading-text-color);\n text-transform: uppercase;\n font-weight: var(--swui-font-weight-text-bold);\n letter-spacing: 0.1rem;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_content__1e1C8 [data-hidden=\"true\"] {\n display: none;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_content__1e1C8:hover [data-hidden=\"true\"] {\n display: inherit;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_content__1e1C8:hover [data-hover=\"true\"] {\n color: var(--swui-collapsible-header-indicator-color-hover);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentEnter__GWHoW {\n opacity: 0;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentEnterActive__1YdNi {\n opacity: 1;\n transition: opacity var(--swui-collapsible-animation-time) ease-in-out;\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_contentExitDone__35Iht {\n display: none;\n }\n\n /** Clickable content */\n\n .Collapsible-module_collapsible__2Nn8K button.Collapsible-module_content__1e1C8 {\n font-family: var(--swui-font-primary);\n font-size: inherit;\n width: 100%;\n text-align: left;\n }\n\n .Collapsible-module_collapsible__2Nn8K button.Collapsible-module_content__1e1C8:focus-visible {\n outline: 1px solid var(--swui-collapsible-header-border-color-focus);\n outline-offset: -1px;\n box-shadow: var(--swui-collapsible-header-focus-shadow);\n }\n\n .Collapsible-module_collapsible__2Nn8K button.Collapsible-module_content__1e1C8:not(:disabled):hover {\n background-color: var(--swui-collapsible-header-background-color-hover);\n }\n\n .Collapsible-module_collapsible__2Nn8K button.Collapsible-module_content__1e1C8:disabled {\n cursor: not-allowed;\n }\n\n .Collapsible-module_collapsible__2Nn8K button.Collapsible-module_content__1e1C8:focus-within [data-hidden=\"true\"] {\n display: inherit;\n }\n\n /* Remove header background color if not at the highest level */\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K {\n --swui-collapsible-header-background-color: var(\n --swui-collapsible-content-background-color\n );\n --swui-collapsible-header-font-weight: normal;\n }\n\n /* Increase padding with depth */\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K {\n --swui-collapsible-content-padding: var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 2) var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 4);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K {\n --swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0\n calc(var(--swui-metrics-indent) * 4);\n --swui-collapsible-content-padding: var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 2) var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 6);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K {\n --swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0\n calc(var(--swui-metrics-indent) * 6);\n --swui-collapsible-content-padding: var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 2) var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 8);\n }\n\n .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K .Collapsible-module_collapsible__2Nn8K {\n --swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0\n calc(var(--swui-metrics-indent) * 8);\n --swui-collapsible-content-padding: var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 2) var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 10);\n }\n";
307
- var styles$4 = {"collapsible":"Collapsible-module_collapsible__2Nn8K","header":"Collapsible-module_header__IZx0y","indicator":"Collapsible-module_indicator__3YBhK","headerText":"Collapsible-module_headerText__2qjzx","label":"Collapsible-module_label__Hpp-R","contentLeft":"Collapsible-module_contentLeft__2gPpu","contentRight":"Collapsible-module_contentRight__bTr59","content":"Collapsible-module_content__1e1C8","groupHeading":"Collapsible-module_groupHeading__3BK-5","contentEnter":"Collapsible-module_contentEnter__GWHoW","contentEnterActive":"Collapsible-module_contentEnterActive__1YdNi","contentExitDone":"Collapsible-module_contentExitDone__35Iht"};
308
- styleInject(css_248z$5);
309
-
310
- var CollapsibleEmptyContent = function () {
311
- return (React.createElement(Column, { indent: true, spacing: true, flex: 1, alignItems: "center" },
312
- React.createElement(Icon, { icon: faInbox, color: cssColor("--lhds-color-ui-500") }),
313
- React.createElement(Space, null),
314
- React.createElement(Text, { size: "small", color: cssColor("--lhds-color-ui-500") }, "No content")));
315
- };
316
-
317
- var CollapsibleContent = function (_a) {
318
- var contentLeft = _a.contentLeft, contentRight = _a.contentRight, className = _a.className, children = _a.children, props = __rest(_a, ["contentLeft", "contentRight", "className", "children"]);
319
- return (React.createElement("div", __assign({ className: cx(styles$4.content, className) }, props),
320
- contentLeft && React.createElement("div", { className: styles$4.contentLeft }, contentLeft), children !== null && children !== void 0 ? children : React.createElement(CollapsibleEmptyContent, null),
321
- contentRight && (React.createElement("div", { className: styles$4.contentRight }, contentRight))));
322
- };
323
-
324
- var mapCSSTime = function (value) {
325
- var num = parseFloat(value);
326
- var match = value.match(/m?s/);
327
- switch (match === null || match === void 0 ? void 0 : match[0]) {
328
- case "s":
329
- return num * 1000;
330
- case "ms":
331
- return num;
332
- default:
333
- return 0;
334
- }
335
- };
336
- var Collapsible = forwardRef(function Collapsible(_a, ref) {
337
- var label = _a.label, contentLeft = _a.contentLeft, contentRight = _a.contentRight, _b = _a.collapsed, collapsed = _b === void 0 ? false : _b, onClick = _a.onClick, className = _a.className, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.unmountOnCollapse, unmountOnCollapse = _d === void 0 ? false : _d, _e = _a.mountOnEnter, mountOnEnter = _e === void 0 ? true : _e, _f = _a.icon, icon = _f === void 0 ? faChevronUp : _f, _g = _a.iconCollapsed, iconCollapsed = _g === void 0 ? faChevronDown : _g, _h = _a.iconSize, iconSize = _h === void 0 ? 8 : _h, children = _a.children, _j = _a.autoFocus, autoFocus = _j === void 0 ? false : _j, divProps = __rest(_a, ["label", "contentLeft", "contentRight", "collapsed", "onClick", "className", "disabled", "unmountOnCollapse", "mountOnEnter", "icon", "iconCollapsed", "iconSize", "children", "autoFocus"]);
338
- var divRef = React.useRef(null);
339
- var timeout = divRef.current
340
- ? mapCSSTime(getComputedStyle(divRef.current).getPropertyValue("--swui-collapsible-animation-time"))
341
- : undefined;
342
- return (React.createElement("div", __assign({ className: cx(styles$4.collapsible, className), "aria-expanded": !collapsed, ref: divRef }, divProps),
343
- React.createElement(Clickable, { disableFocusHighlight: true, disableOpacityOnClick: true, className: styles$4.header, onClick: onClick, disabled: disabled, autoFocus: autoFocus, ref: ref },
344
- contentLeft && (React.createElement("div", { className: styles$4.contentLeft }, contentLeft)),
345
- React.createElement("div", { className: styles$4.label },
346
- React.createElement(Text, { color: "var(--swui-collapsible-header-text-color)", className: styles$4.headerText }, label)),
347
- contentRight && (React.createElement("div", { className: styles$4.contentRight }, contentRight)),
348
- React.createElement(Icon, { icon: collapsed ? iconCollapsed : icon, className: styles$4.indicator, size: iconSize, fixedWidth: true })),
349
- React.createElement(CSSTransition, { in: !collapsed, timeout: {
350
- enter: timeout,
351
- }, classNames: {
352
- enter: styles$4.contentEnter,
353
- enterActive: styles$4.contentEnterActive,
354
- exit: styles$4.contentExit,
355
- exitActive: styles$4.contentExitActive,
356
- exitDone: styles$4.contentExitDone,
357
- }, mountOnEnter: mountOnEnter, unmountOnExit: unmountOnCollapse },
358
- React.createElement("div", { role: "region" }, children !== null && children !== void 0 ? children : (React.createElement(CollapsibleContent, null,
359
- React.createElement(CollapsibleEmptyContent, null)))))));
727
+ const variantToSpacing = {
728
+ compact: 1,
729
+ standard: 1.5,
730
+ relaxed: 2
731
+ };
732
+ const PageHeading = ({
733
+ heading,
734
+ variant = "standard",
735
+ contentLeft: contentLeft2,
736
+ contentRight: contentRight2
737
+ }) => /* @__PURE__ */ jsxs(Row, {
738
+ spacing: variantToSpacing[variant],
739
+ alignItems: "center",
740
+ gap: 2,
741
+ children: [/* @__PURE__ */ jsx(Heading, {
742
+ variant: "h3",
743
+ children: heading
744
+ }), /* @__PURE__ */ jsx(Row, {
745
+ alignItems: "center",
746
+ children: contentLeft2
747
+ }), /* @__PURE__ */ jsx(Row, {
748
+ style: {
749
+ marginLeft: "auto"
750
+ },
751
+ alignItems: "center",
752
+ children: contentRight2
753
+ })]
754
+ });
755
+ const sidebarMenu = "_sidebarMenu_hch18_1";
756
+ var styles$3 = {
757
+ sidebarMenu
758
+ };
759
+ const sidebarMenuCloseButton = "_sidebarMenuCloseButton_1j21u_1";
760
+ const iconWrapper = "_iconWrapper_1j21u_55";
761
+ const icon$1 = "_icon_1j21u_55";
762
+ var styles$2 = {
763
+ sidebarMenuCloseButton,
764
+ iconWrapper,
765
+ icon: icon$1
766
+ };
767
+ const SvgClose = (props) => /* @__PURE__ */ React.createElement("svg", {
768
+ width: "16px",
769
+ height: "16px",
770
+ viewBox: "0 0 16 16",
771
+ xmlns: "http://www.w3.org/2000/svg",
772
+ ...props
773
+ }, /* @__PURE__ */ React.createElement("path", {
774
+ d: "M0.928932188,0.928932188 C1.31945648,0.538407896 1.95262146,0.538407896 2.34314575,0.928932188 L2.34314575,0.928932188 L8.00003897,6.58503897 L13.6568542,0.928932188 C14.0473785,0.538407896 14.6805435,0.538407896 15.0710678,0.928932188 C15.4615921,1.31945648 15.4615921,1.95262146 15.0710678,2.34314575 L9.41503897,8.00003897 L15.0710678,13.6568542 C15.4315518,14.0173382 15.4592813,14.5845693 15.1542564,14.9768605 L15.0710678,15.0710678 C14.6805435,15.4615921 14.0473785,15.4615921 13.6568542,15.0710678 L13.6568542,15.0710678 L8.00003897,9.41503897 L2.34314575,15.0710678 C1.95262146,15.4615921 1.31945648,15.4615921 0.928932188,15.0710678 C0.538407896,14.6805435 0.538407896,14.0473785 0.928932188,13.6568542 L6.58503897,8.00003897 L0.928932188,2.34314575 C0.568448227,1.98266179 0.540718691,1.41543073 0.845743582,1.02313953 Z",
775
+ id: "Combined-Shape",
776
+ fill: "#FFFFFF"
777
+ }));
778
+ const SidebarMenuCloseButton = ({
779
+ className,
780
+ onClick
781
+ }) => {
782
+ return /* @__PURE__ */ jsx("button", {
783
+ onClick,
784
+ className: cx(styles$2.sidebarMenuCloseButton, className),
785
+ children: /* @__PURE__ */ jsx(Box, {
786
+ className: styles$2.iconWrapper,
787
+ children: /* @__PURE__ */ jsx(SvgClose, {
788
+ className: styles$2.icon
789
+ })
790
+ })
791
+ });
792
+ };
793
+ const SidebarMenuSeparator = (separatorLineProps) => /* @__PURE__ */ jsx(SeparatorLine, {
794
+ color: cssColor("--lhds-color-blue-600"),
795
+ ...separatorLineProps
360
796
  });
361
-
362
- var CollapsibleWithCheckbox = function (_a) {
363
- var value = _a.value, onValueChange = _a.onValueChange, onChange = _a.onChange, indeterminate = _a.indeterminate, collapsibleProps = __rest(_a, ["value", "onValueChange", "onChange", "indeterminate"]);
364
- return (React.createElement(Collapsible, __assign({ contentLeft: React.createElement(Checkbox, { value: value, indeterminate: indeterminate, onValueChange: onValueChange, onChange: onChange, onClick: function (ev) { return ev.stopPropagation(); } }) }, collapsibleProps)));
365
- };
366
-
367
- var CollapsibleClickableContent = function (_a) {
368
- var contentLeft = _a.contentLeft, contentRight = _a.contentRight, className = _a.className, onClick = _a.onClick, children = _a.children, props = __rest(_a, ["contentLeft", "contentRight", "className", "onClick", "children"]);
369
- return (React.createElement(Clickable, __assign({ disableFocusHighlight: true, disableOpacityOnClick: true, className: cx(styles$4.content, className), onClick: onClick }, props),
370
- contentLeft && React.createElement("div", { className: styles$4.contentLeft }, contentLeft), children !== null && children !== void 0 ? children : React.createElement(CollapsibleEmptyContent, null),
371
- contentRight && (React.createElement("div", { className: styles$4.contentRight }, contentRight))));
372
- };
373
-
374
- var CollapsibleGroupHeading = function (_a) {
375
- var className = _a.className, props = __rest(_a, ["className"]);
376
- return (React.createElement(CollapsibleContent, __assign({ className: cx(styles$4.groupHeading, className) }, props)));
377
- };
378
-
379
- var ErrorPanel = function (_a) {
380
- var _b = _a.text, text = _b === void 0 ? "Something unexpected happened." : _b;
381
- return (React.createElement(Box, { justifyContent: "center", alignItems: "center" },
382
- React.createElement(Banner, { variant: "error", headerText: text })));
383
- };
384
-
385
- var ErrorScreen = function (props) {
386
- return (React.createElement(Box, { width: "100%", height: "100%", justifyContent: "center", alignItems: "center" },
387
- React.createElement(ErrorPanel, __assign({}, props))));
388
- };
389
-
390
- var LoadingPanel = function (_a) {
391
- var _b = _a.text, text = _b === void 0 ? "Loading..." : _b;
392
- return (React.createElement(Box, { alignItems: "center" },
393
- React.createElement(Spinner, { size: "small" }),
394
- React.createElement(Space, { num: 4 }),
395
- React.createElement(Heading, { variant: "h4" }, text)));
396
- };
397
-
398
- var LoadingScreen = function (props) {
399
- return (React.createElement(Box, { width: "100%", height: "100%", justifyContent: "center", alignItems: "center" },
400
- React.createElement(LoadingPanel, __assign({}, props))));
401
- };
402
-
403
- var PageHeader = function (_a) {
404
- var renderBreadCrumbs = _a.renderBreadCrumbs, renderPageHeading = _a.renderPageHeading, renderTabs = _a.renderTabs, children = _a.children;
405
- return (React.createElement(Box, { shadow: "box", background: cssColor("--lhds-color-ui-50") },
406
- React.createElement(Box, { indent: 3 },
407
- renderBreadCrumbs && React.createElement(Row, { spacing: 1.25 }, renderBreadCrumbs()), renderPageHeading === null || renderPageHeading === void 0 ? void 0 :
408
- renderPageHeading(), renderTabs === null || renderTabs === void 0 ? void 0 :
409
- renderTabs()),
410
- children && (React.createElement(React.Fragment, null,
411
- !renderTabs && React.createElement(Space, null),
412
- React.createElement(SeparatorLine, null),
413
- children))));
414
- };
415
-
416
- var PageHeaderRow = function (props) { return (React.createElement(Row, __assign({ indent: 3, spacing: true }, props))); };
417
-
418
- var variantToSpacing = {
419
- compact: 1,
420
- standard: 1.5,
421
- relaxed: 2,
422
- };
423
- var PageHeading = function (_a) {
424
- var heading = _a.heading, _b = _a.variant, variant = _b === void 0 ? "standard" : _b, contentLeft = _a.contentLeft, contentRight = _a.contentRight;
425
- return (React.createElement(Row, { spacing: variantToSpacing[variant], alignItems: "center", gap: 2 },
426
- React.createElement(Heading, { variant: "h3" }, heading),
427
- React.createElement(Row, { alignItems: "center" }, contentLeft),
428
- React.createElement(Row, { style: { marginLeft: "auto" }, alignItems: "center" }, contentRight)));
429
- };
430
-
431
- var css_248z$4 = ".SidebarMenu-module_sidebarMenu__3IOkS {\n /* Theme vars */\n --swui-sidebar-menu-separator-color: var(--lhds-color-blue-700);\n --swui-sidebar-menu-text-color: var(--swui-white);\n --swui-sidebar-menu-icon-color: var(--swui-white);\n --swui-sidebar-menu-background-color: var(--lhds-color-blue-500);\n --swui-sidebar-menu-background-color-hover: var(--lhds-color-blue-700);\n --swui-sidebar-menu-background-color-focus: var(--lhds-color-blue-700);\n --swui-sidebar-menu-background-color-active: var(--lhds-color-blue-600);\n --swui-sidebar-menu-item-selected: var(--lhds-color-blue-800);\n --swui-sidebar-menu-content-padding: var(--swui-metrics-indent)\n var(--swui-metrics-indent) var(--swui-metrics-indent) 0;\n\n /* State vars */\n --current-separator-color: var(--swui-sidebar-menu-separator-color);\n --current-text-color: var(--swui-sidebar-menu-text-color);\n --current-icon-color: var(--swui-sidebar-menu-icon-color);\n --current-background-color: var(--swui-sidebar-menu-background-color);\n --current-background-color-hover: var(\n --swui-sidebar-menu-background-color-hover\n );\n --current-background-color-focus: var(\n --swui-sidebar-menu-background-color-focus\n );\n --current-background-color-active: var(\n --swui-sidebar-menu-background-color-active\n );\n --current-item-selected: var(--swui-sidebar-menu-item-selected);\n --current-content-padding: var(--swui-sidebar-menu-content-padding);\n\n /* Styling */\n\n background-color: var(--current-background-color);\n height: 100vh;\n}\n\n .SidebarMenu-module_sidebarMenu__3IOkS[data-collapsed] {\n width: var(--swui-sidebar-menu-item-height);\n }\n\n .SidebarMenu-module_sidebarMenu__3IOkS button {\n --swui-button-text-color: var(--swui-white);\n --swui-button-background-color-hover: var(\n --swui-sidebar-menu-background-color-hover\n );\n }\n";
432
- var styles$3 = {"sidebarMenu":"SidebarMenu-module_sidebarMenu__3IOkS"};
433
- styleInject(css_248z$4);
434
-
435
- var css_248z$3 = ".SidebarMenuCloseButton-module_sidebarMenuCloseButton__1h_pt {\n /* Theme vars */\n --swui-sidebar-menu-close-button-text-color: var(--lhds-color-ui-50);\n --swui-sidebar-menu-close-button-background-color: var(--lhds-color-blue-500);\n --swui-sidebar-menu-close-button-background-color-hover: var(\n --lhds-color-blue-600\n );\n --swui-sidebar-menu-close-button-background-color-focus: var(\n --lhds-color-blue-600\n );\n --swui-sidebar-menu-close-button-background-color-active: var(\n --lhds-color-blue-500\n );\n\n /* Current */\n --current-background-color: var(\n --swui-sidebar-menu-close-button-background-color\n );\n\n /* Styling */\n\n display: flex;\n align-items: center;\n justify-content: flex-start;\n line-height: 10px;\n background-color: var(--current-background-color);\n color: var(--swui-sidebar-menu-close-button-text-color);\n cursor: pointer;\n height: var(--swui-sidebar-menu-item-height);\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n border-radius: 0;\n outline: none;\n border: none;\n}\n\n .SidebarMenuCloseButton-module_sidebarMenuCloseButton__1h_pt:hover {\n --current-background-color: var(\n --swui-sidebar-menu-close-button-background-color-hover\n );\n }\n\n .SidebarMenuCloseButton-module_sidebarMenuCloseButton__1h_pt:focus {\n --current-background-color: var(\n --swui-sidebar-menu-close-button-background-color-focus\n );\n }\n\n .SidebarMenuCloseButton-module_sidebarMenuCloseButton__1h_pt:active {\n --current-background-color: var(\n --swui-sidebar-menu-close-button-background-color-active\n );\n }\n\n .SidebarMenuCloseButton-module_sidebarMenuCloseButton__1h_pt .SidebarMenuCloseButton-module_iconWrapper__2nLkY {\n justify-content: center;\n align-items: center;\n width: var(--swui-sidebar-menu-item-height);\n height: var(--swui-sidebar-menu-item-height);\n }\n\n .SidebarMenuCloseButton-module_sidebarMenuCloseButton__1h_pt .SidebarMenuCloseButton-module_icon__1lPJE {\n color: var(--swui-sidebar-menu-close-button-text-color);\n }\n";
436
- var styles$2 = {"sidebarMenuCloseButton":"SidebarMenuCloseButton-module_sidebarMenuCloseButton__1h_pt","iconWrapper":"SidebarMenuCloseButton-module_iconWrapper__2nLkY","icon":"SidebarMenuCloseButton-module_icon__1lPJE"};
437
- styleInject(css_248z$3);
438
-
439
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
440
-
441
- var _ref = /*#__PURE__*/React.createElement("path", {
442
- d: "M.929.929a1 1 0 011.414 0L8 6.585 13.657.929a1 1 0 011.414 1.414L9.415 8l5.656 5.657a1 1 0 01.083 1.32l-.083.094a1 1 0 01-1.414 0L8 9.415l-5.657 5.656A1 1 0 11.93 13.657L6.585 8 .929 2.343a1 1 0 01-.083-1.32z",
443
- fill: "#FFF"
797
+ const SidebarMenu = ({
798
+ className,
799
+ children,
800
+ onCloseClick,
801
+ collapsed = false,
802
+ hideCloseButton = false,
803
+ variant = "standard",
804
+ ...boxProps
805
+ }) => {
806
+ const height = getNavbarHeight(variant);
807
+ return /* @__PURE__ */ jsxs(Box, {
808
+ className: cx(styles$3.sidebarMenu, collapsed ? styles$3.collapsed : null, className),
809
+ style: {
810
+ ["--swui-sidebar-menu-item-height"]: height,
811
+ ["--swui-nav-bar-height"]: height
812
+ },
813
+ "data-collapsed": collapsed || void 0,
814
+ ...boxProps,
815
+ children: [!hideCloseButton && /* @__PURE__ */ jsxs(Fragment, {
816
+ children: [/* @__PURE__ */ jsx(SidebarMenuCloseButton, {
817
+ onClick: onCloseClick
818
+ }), /* @__PURE__ */ jsx(SidebarMenuSeparator, {}), /* @__PURE__ */ jsx(Space, {})]
819
+ }), /* @__PURE__ */ jsx(Box, {
820
+ className: styles$3.sidebarMenuContent,
821
+ height: "100%",
822
+ background: "var(--current-background-color)",
823
+ children: /* @__PURE__ */ jsx(Column, {
824
+ flex: 1,
825
+ children
826
+ })
827
+ })]
828
+ });
829
+ };
830
+ const SidebarRailMenu = ({
831
+ variant,
832
+ onClickMenuButton,
833
+ children
834
+ }) => {
835
+ return /* @__PURE__ */ jsxs(SidebarMenu, {
836
+ collapsed: true,
837
+ position: "fixed",
838
+ left: 0,
839
+ top: 0,
840
+ hideCloseButton: true,
841
+ variant,
842
+ children: [/* @__PURE__ */ jsx(NavBarSideMenuButton, {
843
+ onClick: onClickMenuButton
844
+ }), children]
845
+ });
846
+ };
847
+ const label = "_label_mnp0f_1";
848
+ const icon = "_icon_mnp0f_9";
849
+ const spinner = "_spinner_mnp0f_14";
850
+ const leftWrapper = "_leftWrapper_mnp0f_18";
851
+ const button = "_button_mnp0f_23";
852
+ const selected = "_selected_mnp0f_45";
853
+ var contentStyles = {
854
+ label,
855
+ icon,
856
+ spinner,
857
+ leftWrapper,
858
+ button,
859
+ selected
860
+ };
861
+ const defaultRenderLink = ({
862
+ activeClassName,
863
+ ...props
864
+ }) => {
865
+ return /* @__PURE__ */ jsx("button", {
866
+ ...props
867
+ });
868
+ };
869
+ const SidebarMenuLink = ({
870
+ className,
871
+ children,
872
+ selected: selected2,
873
+ indent,
874
+ label: label2,
875
+ loading,
876
+ left,
877
+ leftIcon,
878
+ right,
879
+ rightIcon,
880
+ success,
881
+ width,
882
+ renderLink = defaultRenderLink,
883
+ style,
884
+ ...buttonProps
885
+ }) => {
886
+ const hasContentLeft = left || leftIcon || loading || success;
887
+ const innerClassName = cx(contentStyles.button, selected2 ? contentStyles.selected : void 0, className);
888
+ const innerStyle = {
889
+ ...style,
890
+ width,
891
+ height: "var(--swui-sidebar-menu-item-height)"
892
+ };
893
+ const innerChildren = /* @__PURE__ */ jsxs(Row, {
894
+ spacing: 1,
895
+ flex: 1,
896
+ alignItems: "center",
897
+ children: [!hasContentLeft && /* @__PURE__ */ jsx(Indent, {}), indent && /* @__PURE__ */ jsx(Indent, {
898
+ num: 3.5
899
+ }), /* @__PURE__ */ jsx(ButtonContent, {
900
+ label: label2,
901
+ loading,
902
+ left,
903
+ leftIcon,
904
+ right,
905
+ rightIcon,
906
+ success,
907
+ labelClassName: contentStyles.label,
908
+ spinnerClassName: contentStyles.spinner,
909
+ iconClassName: cx(contentStyles.icon),
910
+ leftWrapperClassName: contentStyles.leftWrapper
911
+ })]
912
+ });
913
+ return /* @__PURE__ */ jsx(Fragment, {
914
+ children: renderLink({
915
+ ...buttonProps,
916
+ activeClassName: contentStyles.selected,
917
+ className: innerClassName,
918
+ children: innerChildren,
919
+ style: innerStyle
920
+ })
921
+ });
922
+ };
923
+ const sidebarMenuHeading = "_sidebarMenuHeading_kvpq5_1";
924
+ var styles$1 = {
925
+ sidebarMenuHeading
926
+ };
927
+ const SidebarMenuHeading = ({
928
+ className,
929
+ label: label2,
930
+ contentLeft: contentLeft2,
931
+ contentRight: contentRight2,
932
+ ...textProps
933
+ }) => {
934
+ return /* @__PURE__ */ jsx(Box, {
935
+ spacing: 2,
936
+ indent: 2,
937
+ children: /* @__PURE__ */ jsx(CollapsibleContent, {
938
+ className: styles$1.sidebarMenuHeading,
939
+ contentLeft: contentLeft2,
940
+ contentRight: contentRight2,
941
+ children: /* @__PURE__ */ jsx(Text, {
942
+ variant: "overline",
943
+ color: "var(--swui-sidebar-menu-heading-text-color)",
944
+ ...textProps,
945
+ children: label2
946
+ })
947
+ })
948
+ });
949
+ };
950
+ const sidebarMenuCollapsible = "_sidebarMenuCollapsible_1jwhs_1";
951
+ var styles = {
952
+ sidebarMenuCollapsible
953
+ };
954
+ const SidebarMenuCollapsible = ({
955
+ children,
956
+ label: label2,
957
+ leftIcon
958
+ }) => {
959
+ const [collapsed, setCollapsed] = useState(false);
960
+ return /* @__PURE__ */ jsx(Box, {
961
+ background: "var(--current-background-color)",
962
+ children: /* @__PURE__ */ jsx(Collapsible, {
963
+ className: styles.sidebarMenuCollapsible,
964
+ label: label2,
965
+ collapsed,
966
+ onClick: () => setCollapsed(!collapsed),
967
+ contentLeft: leftIcon ? /* @__PURE__ */ jsx(Box, {
968
+ width: "var(--swui-sidebar-menu-item-height)",
969
+ alignItems: "center",
970
+ justifyContent: "center",
971
+ children: /* @__PURE__ */ jsx(Icon, {
972
+ icon: leftIcon,
973
+ size: 16,
974
+ color: "var(--current-text-color)",
975
+ "data-hover": true
976
+ })
977
+ }) : /* @__PURE__ */ jsx(Indent, {
978
+ num: 1
979
+ }),
980
+ children: /* @__PURE__ */ jsx(Column, {
981
+ flex: 1,
982
+ children
983
+ })
984
+ })
985
+ });
986
+ };
987
+ const renderItemsExpanded = (items, indent = false) => {
988
+ return items.map((item, index) => {
989
+ switch (item.type) {
990
+ case "heading":
991
+ return /* @__PURE__ */ jsx(SidebarMenuHeading, {
992
+ label: item.label
993
+ }, index);
994
+ case "separator":
995
+ return /* @__PURE__ */ jsx(SidebarMenuSeparator, {}, index);
996
+ case "link": {
997
+ const {
998
+ type,
999
+ ...linkProps
1000
+ } = item;
1001
+ return /* @__PURE__ */ jsx(SidebarMenuLink, {
1002
+ indent,
1003
+ ...linkProps
1004
+ }, index);
1005
+ }
1006
+ case "grouped":
1007
+ return /* @__PURE__ */ jsx(SidebarMenuCollapsible, {
1008
+ leftIcon: item.leftIcon,
1009
+ label: item.label,
1010
+ children: renderItemsExpanded(item.items, true)
1011
+ }, index);
1012
+ default:
1013
+ return exhaustSwitchCaseElseThrow(item);
1014
+ }
1015
+ });
1016
+ };
1017
+ const renderItemsInRail = (items, {
1018
+ popupMinWidth
1019
+ }) => {
1020
+ return items.map((item, index) => {
1021
+ switch (item.type) {
1022
+ case "heading":
1023
+ return null;
1024
+ case "separator":
1025
+ return /* @__PURE__ */ jsx(SidebarMenuSeparator, {}, index);
1026
+ case "link": {
1027
+ const {
1028
+ type,
1029
+ label: label2,
1030
+ ...linkProps
1031
+ } = item;
1032
+ return /* @__PURE__ */ jsx(SidebarMenuLink, {
1033
+ title: label2,
1034
+ width: "var(--swui-sidebar-menu-item-height)",
1035
+ ...linkProps
1036
+ }, index);
1037
+ }
1038
+ case "grouped":
1039
+ return /* @__PURE__ */ jsx("div", {
1040
+ children: /* @__PURE__ */ jsx(Popover, {
1041
+ appendTo: "parent",
1042
+ arrow: false,
1043
+ offset: [0, 0],
1044
+ placement: "right-start",
1045
+ trigger: "focusin mouseenter click",
1046
+ disablePadding: true,
1047
+ lazy: true,
1048
+ content: /* @__PURE__ */ jsxs(Box, {
1049
+ minWidth: popupMinWidth,
1050
+ background: "var(--lhds-color-blue-500)",
1051
+ children: [/* @__PURE__ */ jsx(SidebarMenuHeading, {
1052
+ label: item.label
1053
+ }), renderItemsExpanded(item.items)]
1054
+ }),
1055
+ children: /* @__PURE__ */ jsx(SidebarMenuLink, {
1056
+ title: item.label,
1057
+ width: "var(--swui-sidebar-menu-item-height)",
1058
+ leftIcon: item.leftIcon
1059
+ })
1060
+ })
1061
+ }, index);
1062
+ default:
1063
+ return exhaustSwitchCaseElseThrow(item);
1064
+ }
1065
+ });
1066
+ };
1067
+ const borderTop = `1px solid ${cssColor("--lhds-color-orange-400")}`;
1068
+ const SelectedItemsActionsPanel = ({
1069
+ numItemsSelected,
1070
+ label: label2,
1071
+ afterLabelContent,
1072
+ rightContent
1073
+ }) => /* @__PURE__ */ jsxs(Row, {
1074
+ indent: 3,
1075
+ spacing: true,
1076
+ minHeight: "56px",
1077
+ justifyContent: "space-between",
1078
+ alignItems: "center",
1079
+ borderTop,
1080
+ background: cssColor("--lhds-color-orange-50"),
1081
+ children: [/* @__PURE__ */ jsxs(Row, {
1082
+ alignItems: "center",
1083
+ children: [numItemsSelected != null || label2 != null ? /* @__PURE__ */ jsx(Fragment, {
1084
+ children: numItemsSelected != null ? /* @__PURE__ */ jsxs(Fragment, {
1085
+ children: [/* @__PURE__ */ jsx(Text, {
1086
+ variant: "bold",
1087
+ children: numItemsSelected
1088
+ }), /* @__PURE__ */ jsx(Space, {}), /* @__PURE__ */ jsxs(Text, {
1089
+ children: ["item", numItemsSelected === 1 ? "" : "s", " selected"]
1090
+ })]
1091
+ }) : label2 != null ? /* @__PURE__ */ jsx(Fragment, {
1092
+ children: typeof label2 === "string" ? /* @__PURE__ */ jsx(Text, {
1093
+ children: label2
1094
+ }) : label2
1095
+ }) : null
1096
+ }) : null, afterLabelContent ? /* @__PURE__ */ jsxs(Fragment, {
1097
+ children: [/* @__PURE__ */ jsx(Indent, {}), /* @__PURE__ */ jsx(Box, {
1098
+ children: afterLabelContent
1099
+ })]
1100
+ }) : null]
1101
+ }), /* @__PURE__ */ jsx(Box, {
1102
+ children: rightContent
1103
+ })]
444
1104
  });
445
-
446
- function SvgClose(props) {
447
- return /*#__PURE__*/React.createElement("svg", _extends({
448
- width: 16,
449
- height: 16,
450
- xmlns: "http://www.w3.org/2000/svg"
451
- }, props), _ref);
452
- }
453
-
454
- var SidebarMenuCloseButton = function (_a) {
455
- var className = _a.className, onClick = _a.onClick;
456
- return (React.createElement("button", { onClick: onClick, className: cx(styles$2.sidebarMenuCloseButton, className) },
457
- React.createElement(Box, { className: styles$2.iconWrapper },
458
- React.createElement(SvgClose, { className: styles$2.icon }))));
459
- };
460
-
461
- var SidebarMenuSeparator = function (separatorLineProps) { return (React.createElement(SeparatorLine, __assign({ color: cssColor("--lhds-color-blue-600") }, separatorLineProps))); };
462
-
463
- var SidebarMenu = function (_a) {
464
- var _b;
465
- var className = _a.className, children = _a.children, onCloseClick = _a.onCloseClick, _c = _a.collapsed, collapsed = _c === void 0 ? false : _c, _d = _a.hideCloseButton, hideCloseButton = _d === void 0 ? false : _d, _e = _a.variant, variant = _e === void 0 ? "standard" : _e, boxProps = __rest(_a, ["className", "children", "onCloseClick", "collapsed", "hideCloseButton", "variant"]);
466
- var height = getNavbarHeight(variant);
467
- return (React.createElement(Box, __assign({ className: cx(styles$3.sidebarMenu, collapsed ? styles$3.collapsed : null, className), style: (_b = {},
468
- _b["--swui-sidebar-menu-item-height"] = height,
469
- _b["--swui-nav-bar-height"] = height,
470
- _b), "data-collapsed": collapsed || undefined }, boxProps),
471
- !hideCloseButton && (React.createElement(React.Fragment, null,
472
- React.createElement(SidebarMenuCloseButton, { onClick: onCloseClick }),
473
- React.createElement(SidebarMenuSeparator, null),
474
- React.createElement(Space, null))),
475
- React.createElement(Box, { className: styles$3.sidebarMenuContent, height: "100%", background: "var(--current-background-color)" },
476
- React.createElement(Column, { flex: 1 }, children))));
477
- };
478
-
479
- var SidebarRailMenu = function (_a) {
480
- var variant = _a.variant, onClickMenuButton = _a.onClickMenuButton, children = _a.children;
481
- return (React.createElement(SidebarMenu, { collapsed: true, position: "fixed", left: 0, top: 0, hideCloseButton: true, variant: variant },
482
- React.createElement(NavBarSideMenuButton, { onClick: onClickMenuButton }),
483
- children));
484
- };
485
-
486
- var css_248z$2 = ".SidebarMenuContent-module_label__3NyDU {\n font-size: var(--current-text-size, var(--swui-font-size-medium));\n line-height: var(--current-line-height, var(--swui-line-height-medium));\n font-weight: var(--swui-button-font-weight);\n font-family: var(--swui-font-buttons);\n color: var(--current-text-color);\n}\n\n.SidebarMenuContent-module_icon__1kQOa {\n color: var(--current-text-color);\n font-size: 1.6rem;\n}\n\n.SidebarMenuContent-module_spinner__K0lsy {\n color: var(--current-text-color);\n}\n\n.SidebarMenuContent-module_leftWrapper__2sA9a.SidebarMenuContent-module_leftWrapper__2sA9a.SidebarMenuContent-module_leftWrapper__2sA9a.SidebarMenuContent-module_leftWrapper__2sA9a {\n width: var(--swui-sidebar-menu-item-height);\n margin-right: 0;\n}\n\n.SidebarMenuContent-module_button__3x5IE {\n border: 0;\n padding: 0;\n background: var(--current-background-color);\n}\n\n[data-collapsed] [aria-expanded=\"true\"] .SidebarMenuContent-module_button__3x5IE,\n .SidebarMenuContent-module_button__3x5IE:hover {\n background: var(--current-background-color-hover);\n }\n\n.SidebarMenuContent-module_button__3x5IE:focus {\n outline: none;\n }\n\n.SidebarMenuContent-module_button__3x5IE:focus-visible {\n background: var(--current-background-color-active);\n }\n\n.SidebarMenuContent-module_button__3x5IE:active {\n background: var(--current-background-color-active);\n }\n\n.SidebarMenuContent-module_button__3x5IE.SidebarMenuContent-module_selected__aeI_K {\n background: var(--current-item-selected);\n }\n";
487
- var contentStyles = {"label":"SidebarMenuContent-module_label__3NyDU","icon":"SidebarMenuContent-module_icon__1kQOa","spinner":"SidebarMenuContent-module_spinner__K0lsy","leftWrapper":"SidebarMenuContent-module_leftWrapper__2sA9a","button":"SidebarMenuContent-module_button__3x5IE","selected":"SidebarMenuContent-module_selected__aeI_K"};
488
- styleInject(css_248z$2);
489
-
490
- var defaultRenderLink = function (_a) {
491
- _a.activeClassName; var props = __rest(_a, ["activeClassName"]);
492
- return React.createElement("button", __assign({}, props));
493
- };
494
- var SidebarMenuLink = function (_a) {
495
- var className = _a.className; _a.children; var selected = _a.selected, indent = _a.indent, label = _a.label, loading = _a.loading, left = _a.left, leftIcon = _a.leftIcon, right = _a.right, rightIcon = _a.rightIcon, success = _a.success, width = _a.width, _b = _a.renderLink, renderLink = _b === void 0 ? defaultRenderLink : _b, style = _a.style, buttonProps = __rest(_a, ["className", "children", "selected", "indent", "label", "loading", "left", "leftIcon", "right", "rightIcon", "success", "width", "renderLink", "style"]);
496
- var hasContentLeft = left || leftIcon || loading || success;
497
- var innerClassName = cx(contentStyles.button, selected ? contentStyles.selected : undefined, className);
498
- var innerStyle = __assign(__assign({}, style), { width: width, height: "var(--swui-sidebar-menu-item-height)" });
499
- var innerChildren = (React.createElement(Row, { spacing: 1, flex: 1, alignItems: "center" },
500
- !hasContentLeft && React.createElement(Indent, null),
501
- indent && React.createElement(Indent, { num: 3.5 }),
502
- React.createElement(ButtonContent, { label: label, loading: loading, left: left, leftIcon: leftIcon, right: right, rightIcon: rightIcon, success: success, labelClassName: contentStyles.label, spinnerClassName: contentStyles.spinner, iconClassName: cx(contentStyles.icon), leftWrapperClassName: contentStyles.leftWrapper })));
503
- return (React.createElement(React.Fragment, null, renderLink(__assign(__assign({}, buttonProps), { activeClassName: contentStyles.selected, className: innerClassName, children: innerChildren, style: innerStyle }))));
504
- };
505
-
506
- var css_248z$1 = ".SidebarMenuHeading-module_sidebarMenuHeading__2Z8R_ {\n --swui-sidebar-menu-heading-text-color: var(--lhds-color-ui-300);\n\n /* Styling */\n\n text-transform: uppercase;\n}\n";
507
- var styles$1 = {"sidebarMenuHeading":"SidebarMenuHeading-module_sidebarMenuHeading__2Z8R_"};
508
- styleInject(css_248z$1);
509
-
510
- var SidebarMenuHeading = function (_a) {
511
- _a.className; var label = _a.label, contentLeft = _a.contentLeft, contentRight = _a.contentRight, textProps = __rest(_a, ["className", "label", "contentLeft", "contentRight"]);
512
- return (React.createElement(Box, { spacing: 2, indent: 2 },
513
- React.createElement(CollapsibleContent, { className: styles$1.sidebarMenuHeading, contentLeft: contentLeft, contentRight: contentRight },
514
- React.createElement(Text, __assign({ variant: "overline", color: "var(--swui-sidebar-menu-heading-text-color)" }, textProps), label))));
515
- };
516
-
517
- var css_248z = ".SidebarMenuCollapsible-module_sidebarMenuCollapsible__3g5N3 {\n --swui-collapsible-header-text-color: var(--current-text-color);\n --swui-collapsible-header-background-color: var(--current-background-color);\n --swui-collapsible-header-background-color-hover: var(\n --current-background-color-hover\n );\n --swui-collapsible-header-background-color-active: var(\n --current-background-color-active\n );\n --swui-collapsible-header-indicator-color: var(--current-text-color);\n --swui-collapsible-header-indicator-color-collapsed: var(\n --current-text-color\n );\n --swui-collapsible-header-indicator-color-hover: var(--current-text-color);\n --swui-collapsible-header-padding: 0 calc(var(--swui-metrics-indent) * 2) 0 0;\n --swui-collapsible-header-content-margin: 0;\n --swui-collapsible-collapsible-link-padding: var(--swui-metrics-indent)\n var(--swui-metrics-indent) var(--swui-metrics-indent)\n calc(var(--swui-metrics-indent) * 4);\n --swui-collapsible-header-border-color: transparent;\n\n --swui-collapsible-min-height: var(--swui-sidebar-menu-item-height);\n}\n";
518
- var styles = {"sidebarMenuCollapsible":"SidebarMenuCollapsible-module_sidebarMenuCollapsible__3g5N3"};
519
- styleInject(css_248z);
520
-
521
- var SidebarMenuCollapsible = function (_a) {
522
- var children = _a.children, label = _a.label, leftIcon = _a.leftIcon;
523
- var _b = useState(false), collapsed = _b[0], setCollapsed = _b[1];
524
- return (React.createElement(Box, { background: "var(--current-background-color)" },
525
- React.createElement(Collapsible, { className: styles.sidebarMenuCollapsible, label: label, collapsed: collapsed, onClick: function () { return setCollapsed(!collapsed); }, contentLeft: leftIcon ? (React.createElement(Box, { width: "var(--swui-sidebar-menu-item-height)", alignItems: "center", justifyContent: "center" },
526
- React.createElement(Icon, { icon: leftIcon, size: 16, color: "var(--current-text-color)", "data-hover": true }))) : (React.createElement(Indent, { num: 1 })) },
527
- React.createElement(Column, { flex: 1 }, children))));
528
- };
529
-
530
- var renderItemsExpanded = function (items, indent) {
531
- if (indent === void 0) { indent = false; }
532
- return items.map(function (item, index) {
533
- switch (item.type) {
534
- case "heading":
535
- return React.createElement(SidebarMenuHeading, { key: index, label: item.label });
536
- case "separator":
537
- return React.createElement(SidebarMenuSeparator, { key: index });
538
- case "link": {
539
- item.type; var linkProps = __rest(item, ["type"]);
540
- return React.createElement(SidebarMenuLink, __assign({ key: index, indent: indent }, linkProps));
541
- }
542
- case "grouped":
543
- return (React.createElement(SidebarMenuCollapsible, { key: index, leftIcon: item.leftIcon, label: item.label }, renderItemsExpanded(item.items, true)));
544
- default:
545
- return exhaustSwitchCaseElseThrow(item);
546
- }
547
- });
548
- };
549
- var renderItemsInRail = function (items, _a) {
550
- var popupMinWidth = _a.popupMinWidth;
551
- return items.map(function (item, index) {
552
- switch (item.type) {
553
- case "heading":
554
- return null;
555
- case "separator":
556
- return React.createElement(SidebarMenuSeparator, { key: index });
557
- case "link": {
558
- item.type; var label = item.label, linkProps = __rest(item, ["type", "label"]);
559
- return (React.createElement(SidebarMenuLink, __assign({ key: index, title: label, width: "var(--swui-sidebar-menu-item-height)" }, linkProps)));
560
- }
561
- case "grouped":
562
- return (React.createElement("div", { key: index },
563
- React.createElement(Popover, { appendTo: "parent", arrow: false, offset: [0, 0], placement: "right-start", trigger: "focusin mouseenter click", disablePadding: true, lazy: true, content: React.createElement(Box, { minWidth: popupMinWidth, background: "var(--lhds-color-blue-500)" },
564
- React.createElement(SidebarMenuHeading, { label: item.label }),
565
- renderItemsExpanded(item.items)) },
566
- React.createElement(SidebarMenuLink, { title: item.label, width: "var(--swui-sidebar-menu-item-height)", leftIcon: item.leftIcon }))));
567
- default:
568
- return exhaustSwitchCaseElseThrow(item);
569
- }
570
- });
571
- };
572
-
573
- var borderTop = "1px solid ".concat(cssColor("--lhds-color-orange-400"));
574
- var SelectedItemsActionsPanel = function (_a) {
575
- var numItemsSelected = _a.numItemsSelected, label = _a.label, afterLabelContent = _a.afterLabelContent, rightContent = _a.rightContent;
576
- return (React.createElement(Row, { indent: 3, spacing: true, minHeight: "56px", justifyContent: "space-between", alignItems: "center", borderTop: borderTop, background: cssColor("--lhds-color-orange-50") },
577
- React.createElement(Row, { alignItems: "center" },
578
- numItemsSelected != null || label != null ? (React.createElement(React.Fragment, null, numItemsSelected != null ? (React.createElement(React.Fragment, null,
579
- React.createElement(Text, { variant: "bold" }, numItemsSelected),
580
- React.createElement(Space, null),
581
- React.createElement(Text, null,
582
- "item",
583
- numItemsSelected === 1 ? "" : "s",
584
- " selected"))) : label != null ? (React.createElement(React.Fragment, null, typeof label === "string" ? React.createElement(Text, null, label) : label)) : null)) : null,
585
- afterLabelContent ? (React.createElement(React.Fragment, null,
586
- React.createElement(Indent, null),
587
- React.createElement(Box, null, afterLabelContent))) : null),
588
- React.createElement(Box, null, rightContent)));
589
- };
590
-
591
1105
  export { ActionMenuFlatButton, ActionMenuPrimaryButton, ActionMenuSecondaryButton, CheckboxMenu, Collapsible, CollapsibleClickableContent, CollapsibleContent, CollapsibleEmptyContent, CollapsibleGroupHeading, CollapsibleWithCheckbox, ErrorPanel, ErrorScreen, LoadingPanel, LoadingScreen, NavBar, NavBarButton, NavBarHeading, NavBarNotificationButton, NavBarPopoverButton, NavBarSearchField, NavBarUserButton, Notification, PageHeader, PageHeaderRow, PageHeading, SelectedItemsActionsPanel, SidebarMenu, SidebarMenuCollapsible, SidebarMenuHeading, SidebarMenuLink, SidebarMenuSeparator, SidebarRailMenu, defaultNotificationTheme, defaultRenderLink, mapCSSTime, renderItemsExpanded, renderItemsInRail };
592
1106
  //# sourceMappingURL=index.es.js.map