scorer-ui-kit 3.0.2 → 3.0.4

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.
@@ -1,7 +1,7 @@
1
1
  import { a as Icon, c as animation, d as dimensions, f as fontFamily, i as Spinner, l as deviceMediaQuery, n as LineSet, o as IconSVGs, r as LineSetContext, s as IconWrapper$4, t as LineUIVideoBase, u as deviceSize } from "./LineUIVideoBase-CJ61ZqPJ.mjs";
2
2
  import styled, { createGlobalStyle, css, keyframes } from "styled-components";
3
- import React, { Fragment, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
3
+ import React, { Children, Fragment, cloneElement, createContext, isValidElement, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
4
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
5
5
  import ReactDom from "react-dom";
6
6
  import { add, addMonths, eachDayOfInterval, eachWeekOfInterval, endOfDay, endOfMonth, endOfWeek, format, intervalToDuration, isAfter, isEqual, isSameDay, isSameMonth, isToday, isWithinInterval, min, set, startOfDay, startOfMonth } from "date-fns";
7
7
  import { Link, useLocation, useNavigate } from "react-router-dom";
@@ -2202,6 +2202,9 @@ var ThemeVariables = createGlobalStyle`
2202
2202
  --global-menu-width-closed: 80px;
2203
2203
  --global-menu-width-open: 280px;
2204
2204
 
2205
+ --top-bar-height: 56px;
2206
+ --top-bar-divider-width: 1px;
2207
+
2205
2208
  --input-height: 40px;
2206
2209
  --input-compact-height: 32px;
2207
2210
  --input-required-dot-display: inline-block;
@@ -2403,7 +2406,7 @@ var Arrow$1 = styled.div`
2403
2406
  &.l { left: 24px; }
2404
2407
  &.r { right: 24px; }
2405
2408
  `;
2406
- var Container$71 = styled.div`
2409
+ var Container$72 = styled.div`
2407
2410
  display: flex;
2408
2411
  position: relative;
2409
2412
  flex: 1;
@@ -2418,7 +2421,7 @@ var Container$71 = styled.div`
2418
2421
  color: var(--grey-10);
2419
2422
  `;
2420
2423
  var FlexContentPlaceholder = ({ title = "Placeholder" }) => {
2421
- return /* @__PURE__ */ jsxs(Container$71, { children: [
2424
+ return /* @__PURE__ */ jsxs(Container$72, { children: [
2422
2425
  title,
2423
2426
  /* @__PURE__ */ jsx(Arrow$1, {
2424
2427
  className: "t l",
@@ -2555,7 +2558,7 @@ var AlertBar = ({ type = "info", message, hideCloseButton = false }) => {
2555
2558
  };
2556
2559
  //#endregion
2557
2560
  //#region src/Alerts/atom/Notification.tsx
2558
- var Container$70 = styled.div`
2561
+ var Container$71 = styled.div`
2559
2562
  min-height: 50px;
2560
2563
  border-bottom-left-radius: 3px;
2561
2564
  border-bottom-right-radius: 3px;
@@ -2723,7 +2726,7 @@ var Notification = ({ id, type = "info", message, icon = "", isPinned = false, a
2723
2726
  }
2724
2727
  };
2725
2728
  }, []);
2726
- return message && !dismiss ? ReactDom.createPortal(/* @__PURE__ */ jsxs(Container$70, {
2729
+ return message && !dismiss ? ReactDom.createPortal(/* @__PURE__ */ jsxs(Container$71, {
2727
2730
  $type: type,
2728
2731
  $isClosing: slideUp,
2729
2732
  $isVisible: isVisible,
@@ -3125,7 +3128,7 @@ var Button = ({ design = "primary", size = "normal", shadow = false, noPadding =
3125
3128
  };
3126
3129
  //#endregion
3127
3130
  //#region src/Form/atoms/ButtonWithIcon.tsx
3128
- var Container$69 = styled.div`
3131
+ var Container$70 = styled.div`
3129
3132
  display: inline;
3130
3133
  `;
3131
3134
  var TextContainer$3 = styled.div`
@@ -3241,7 +3244,7 @@ var InnerContainer$3 = styled.div`
3241
3244
  `};
3242
3245
  `;
3243
3246
  var ButtonWithIcon = ({ design = "primary", size = "normal", loading = false, shadow = false, onClick, disabled, position, icon, weight = "regular", children, ...props }) => {
3244
- return /* @__PURE__ */ jsx(Container$69, { children: /* @__PURE__ */ jsx(Button, {
3247
+ return /* @__PURE__ */ jsx(Container$70, { children: /* @__PURE__ */ jsx(Button, {
3245
3248
  noPadding: true,
3246
3249
  disabled: disabled || loading,
3247
3250
  design,
@@ -3273,7 +3276,7 @@ var ButtonWithIcon = ({ design = "primary", size = "normal", loading = false, sh
3273
3276
  };
3274
3277
  //#endregion
3275
3278
  //#region src/Form/atoms/ButtonWithLoading.tsx
3276
- var Container$68 = styled.div`
3279
+ var Container$69 = styled.div`
3277
3280
  display: inline;
3278
3281
  `;
3279
3282
  var TextContainer$2 = styled.div`
@@ -3333,7 +3336,7 @@ var InnerContainer$2 = styled.div`
3333
3336
  `}
3334
3337
  `;
3335
3338
  var ButtonWithLoading = ({ design = "primary", size = "normal", shadow = false, onClick, disabled, position, loading = false, children, ...rest }) => {
3336
- return /* @__PURE__ */ jsx(Container$68, { children: /* @__PURE__ */ jsx(Button, {
3339
+ return /* @__PURE__ */ jsx(Container$69, { children: /* @__PURE__ */ jsx(Button, {
3337
3340
  noPadding: true,
3338
3341
  disabled: disabled || loading,
3339
3342
  design,
@@ -3535,7 +3538,7 @@ var IconWrapper$3 = styled.div`
3535
3538
  }
3536
3539
  }
3537
3540
  `;
3538
- var Container$67 = styled.label`
3541
+ var Container$68 = styled.label`
3539
3542
  display: inline-block;
3540
3543
  user-select: none;
3541
3544
  ${CheckboxOuter}{
@@ -3633,7 +3636,7 @@ var Checkbox = ({ indeterminate: _indeterminate = false, disabled, checked = fal
3633
3636
  setIsChecked(checked);
3634
3637
  }, [checked]);
3635
3638
  const iconWeight = dimensions.icons.weights.regular;
3636
- return /* @__PURE__ */ jsxs(Container$67, {
3639
+ return /* @__PURE__ */ jsxs(Container$68, {
3637
3640
  onChange: customOnChange,
3638
3641
  $disabled: disabled,
3639
3642
  $visualState: visualState,
@@ -3655,7 +3658,7 @@ var Checkbox = ({ indeterminate: _indeterminate = false, disabled, checked = fal
3655
3658
  };
3656
3659
  //#endregion
3657
3660
  //#region src/Form/atoms/DropArea.tsx
3658
- var Container$66 = styled.div`
3661
+ var Container$67 = styled.div`
3659
3662
  ${({ $height }) => $height ? `height: ${$height}` : null};
3660
3663
  position: relative;
3661
3664
  `;
@@ -3704,7 +3707,7 @@ var DropArea = ({ height, text, dropCallback, ...props }) => {
3704
3707
  window.removeEventListener("drop", handleWindowDragAndDrop);
3705
3708
  };
3706
3709
  }, [handleWindowDragAndDrop]);
3707
- return /* @__PURE__ */ jsx(Container$66, {
3710
+ return /* @__PURE__ */ jsx(Container$67, {
3708
3711
  $height: height,
3709
3712
  ...props,
3710
3713
  children: /* @__PURE__ */ jsx(DragAndDrop, {
@@ -3847,7 +3850,7 @@ var InputContainer$2 = styled.div`
3847
3850
  `}
3848
3851
 
3849
3852
  `;
3850
- var Container$65 = styled.div`
3853
+ var Container$66 = styled.div`
3851
3854
  ${({ $fieldState, $showFeedback }) => css`
3852
3855
 
3853
3856
  display: flex;
@@ -3906,7 +3909,7 @@ var Input = ({ type = "text", placeholder = "", defaultValue, fieldState = "defa
3906
3909
  });
3907
3910
  }
3908
3911
  };
3909
- return /* @__PURE__ */ jsxs(Container$65, {
3912
+ return /* @__PURE__ */ jsxs(Container$66, {
3910
3913
  $fieldState: fieldState || "default",
3911
3914
  $showFeedback: showFeedback,
3912
3915
  children: [/* @__PURE__ */ jsxs(InputContainer$2, {
@@ -3930,7 +3933,7 @@ var Input = ({ type = "text", placeholder = "", defaultValue, fieldState = "defa
3930
3933
  };
3931
3934
  //#endregion
3932
3935
  //#region src/Form/atoms/InputFileButton.tsx
3933
- var Container$64 = styled.div``;
3936
+ var Container$65 = styled.div``;
3934
3937
  var HiddenInput$2 = styled.input`
3935
3938
  display: none;
3936
3939
  `;
@@ -3945,7 +3948,7 @@ var InputFileButton = ({ text, buttonDesign, buttonSize, inputCallback, children
3945
3948
  const forwardClick = useCallback(() => {
3946
3949
  if (fileInputRef.current) fileInputRef.current.click();
3947
3950
  }, []);
3948
- return /* @__PURE__ */ jsxs(Container$64, { children: [/* @__PURE__ */ jsx(HiddenInput$2, {
3951
+ return /* @__PURE__ */ jsxs(Container$65, { children: [/* @__PURE__ */ jsx(HiddenInput$2, {
3949
3952
  ...props,
3950
3953
  ref: fileInputRef,
3951
3954
  type: "file",
@@ -4083,7 +4086,7 @@ var HiddenInput$1 = styled.input`
4083
4086
  padding:0;
4084
4087
  opacity: 0;
4085
4088
  `;
4086
- var Container$63 = styled.div`
4089
+ var Container$64 = styled.div`
4087
4090
  position: relative;
4088
4091
  display: inline-block;
4089
4092
  width: 18px;
@@ -4097,7 +4100,7 @@ var RadioButton = ({ id, value, name, currentChecked, disabled = false, required
4097
4100
  onChangeCallback(checkedValue);
4098
4101
  }, [onChangeCallback]);
4099
4102
  const isChecked = currentChecked !== void 0 ? currentChecked === value : false;
4100
- return /* @__PURE__ */ jsxs(Container$63, { children: [/* @__PURE__ */ jsx(HiddenInput$1, {
4103
+ return /* @__PURE__ */ jsxs(Container$64, { children: [/* @__PURE__ */ jsx(HiddenInput$1, {
4101
4104
  type: "radio",
4102
4105
  id,
4103
4106
  name,
@@ -4186,7 +4189,7 @@ var StyledSelect = styled.select`
4186
4189
  display: none;
4187
4190
  }
4188
4191
  `;
4189
- var Container$62 = styled.div`
4192
+ var Container$63 = styled.div`
4190
4193
 
4191
4194
  ${({ $activePlaceholder }) => $activePlaceholder && css`
4192
4195
  ${StyledSelect} {
@@ -4251,7 +4254,7 @@ var SelectField = ({ fieldState = "default", placeholder, label, icon, isCompact
4251
4254
  })
4252
4255
  })
4253
4256
  ] });
4254
- return /* @__PURE__ */ jsx(Container$62, {
4257
+ return /* @__PURE__ */ jsx(Container$63, {
4255
4258
  $isCompact: isCompact,
4256
4259
  $activePlaceholder: activePlaceholder,
4257
4260
  children: label ? /* @__PURE__ */ jsx(Label, {
@@ -4609,7 +4612,7 @@ var UnitKey = styled.div`
4609
4612
  margin-top: 1px;
4610
4613
  white-space: nowrap;
4611
4614
  `;
4612
- var Container$61 = styled.div`
4615
+ var Container$62 = styled.div`
4613
4616
  position: relative;
4614
4617
 
4615
4618
  ${({ $fieldState }) => $fieldState && css`
@@ -4620,7 +4623,7 @@ var Container$61 = styled.div`
4620
4623
  `};
4621
4624
  `;
4622
4625
  var SmallInput = ({ unit, label, name, type = "text", placeholder = "", defaultValue, fieldState = "default", required = false, className, children, formAction, ...props }) => {
4623
- return /* @__PURE__ */ jsx(Container$61, {
4626
+ return /* @__PURE__ */ jsx(Container$62, {
4624
4627
  className,
4625
4628
  $fieldState: fieldState || "default",
4626
4629
  children: /* @__PURE__ */ jsx(Label, {
@@ -4717,7 +4720,7 @@ var IconWrapper$2 = styled.div`
4717
4720
  }
4718
4721
  `;
4719
4722
  var SpinnerWrapper = styled.div``;
4720
- var Container$60 = styled(StyledLabel)`
4723
+ var Container$61 = styled(StyledLabel)`
4721
4724
  user-select: none;
4722
4725
  display: inline-flex;
4723
4726
  gap: 8px;
@@ -4883,7 +4886,7 @@ var Switch = ({ state = "default", leftTheme = "off", rightTheme = "on", labelTe
4883
4886
  useEffect(() => {
4884
4887
  if (innerRef.current) setInnerSize(parseInt(getComputedStyle(innerRef.current).getPropertyValue("--switch-inner-size"), 10));
4885
4888
  }, []);
4886
- return /* @__PURE__ */ jsxs(Container$60, {
4889
+ return /* @__PURE__ */ jsxs(Container$61, {
4887
4890
  onChange: customOnChange,
4888
4891
  onMouseLeave: () => setJustUpdated(false),
4889
4892
  $activeTheming: activeTheming,
@@ -4998,7 +5001,7 @@ var FeedbackMessage = styled.div`
4998
5001
  font-weight: 500;
4999
5002
  color: var(--white-1);
5000
5003
  `;
5001
- var Container$59 = styled.div`
5004
+ var Container$60 = styled.div`
5002
5005
  ${({ $fieldState, $showFeedback }) => css`
5003
5006
  display: flex;
5004
5007
  position: relative;
@@ -5060,7 +5063,7 @@ var TextArea = ({ placeholder = "", fieldState = "default", showFeedback = false
5060
5063
  });
5061
5064
  }
5062
5065
  };
5063
- return /* @__PURE__ */ jsxs(Container$59, {
5066
+ return /* @__PURE__ */ jsxs(Container$60, {
5064
5067
  $fieldState: fieldState || "default",
5065
5068
  $showFeedback: showFeedback,
5066
5069
  children: [/* @__PURE__ */ jsx(StyledTextArea, {
@@ -5092,7 +5095,7 @@ var Form = ({ children, spacing = "45px;", action, ...props }) => {
5092
5095
  //#endregion
5093
5096
  //#region src/Form/molecules/ActionButtons.tsx
5094
5097
  var StyledIconButton$1 = styled(IconButton)``;
5095
- var Container$58 = styled.div`
5098
+ var Container$59 = styled.div`
5096
5099
  display: flex;
5097
5100
  ${StyledIconButton$1} {
5098
5101
  margin-left: 15px;
@@ -5114,7 +5117,7 @@ var Container$58 = styled.div`
5114
5117
  `};
5115
5118
  `;
5116
5119
  var ActionButtons = ({ buttonsConfig, alignment = "right" }) => {
5117
- return /* @__PURE__ */ jsx(Container$58, {
5120
+ return /* @__PURE__ */ jsx(Container$59, {
5118
5121
  $alignment: alignment,
5119
5122
  children: buttonsConfig.map((btn) => {
5120
5123
  const { icon, size, weight, color, hoverColor, onClick } = btn;
@@ -5131,7 +5134,7 @@ var ActionButtons = ({ buttonsConfig, alignment = "right" }) => {
5131
5134
  };
5132
5135
  //#endregion
5133
5136
  //#region src/Form/molecules/ButtonsStack.tsx
5134
- var Container$57 = styled.div`
5137
+ var Container$58 = styled.div`
5135
5138
  display: flex;
5136
5139
  flex-direction: column;
5137
5140
  gap: 8px;
@@ -5140,7 +5143,7 @@ var Container$57 = styled.div`
5140
5143
  }
5141
5144
  `;
5142
5145
  var ButtonsStack = ({ buttons }) => {
5143
- return /* @__PURE__ */ jsx(Container$57, { children: buttons.map(({ id, buttonType, icon, text, iconPosition, size, ...buttonProps }) => {
5146
+ return /* @__PURE__ */ jsx(Container$58, { children: buttons.map(({ id, buttonType, icon, text, iconPosition, size, ...buttonProps }) => {
5144
5147
  if (buttonType === "icon-button") return /* @__PURE__ */ jsx(ButtonWithIcon, {
5145
5148
  size: size || "small",
5146
5149
  icon: icon || "",
@@ -5513,7 +5516,7 @@ var CropArea = ({ isResizable, hasAspectRatio }) => {
5513
5516
  };
5514
5517
  //#endregion
5515
5518
  //#region src/Form/molecules/CropTool.tsx
5516
- var Container$56 = styled.div`
5519
+ var Container$57 = styled.div`
5517
5520
  position: fixed;
5518
5521
  top: 0;
5519
5522
  left: 0;
@@ -5721,7 +5724,7 @@ var CropTool = ({ title = "Crop Image", cancelBtnTxt = "Cancel", cropBtnTxt = "C
5721
5724
  if (!viewDimensions.isResizing) return;
5722
5725
  viewDimensions.isResizing = false;
5723
5726
  }, []);
5724
- return ReactDom.createPortal(/* @__PURE__ */ jsx(Container$56, { children: /* @__PURE__ */ jsxs(InnerContainer$1, { children: [/* @__PURE__ */ jsxs(ToolHeader, { children: [/* @__PURE__ */ jsxs(TextGroup$1, { children: [/* @__PURE__ */ jsx(Icon, {
5727
+ return ReactDom.createPortal(/* @__PURE__ */ jsx(Container$57, { children: /* @__PURE__ */ jsxs(InnerContainer$1, { children: [/* @__PURE__ */ jsxs(ToolHeader, { children: [/* @__PURE__ */ jsxs(TextGroup$1, { children: [/* @__PURE__ */ jsx(Icon, {
5725
5728
  icon: "Crop",
5726
5729
  size: 20,
5727
5730
  color: "mono"
@@ -5781,7 +5784,7 @@ var CropTool = ({ title = "Crop Image", cancelBtnTxt = "Cancel", cropBtnTxt = "C
5781
5784
  * Marks could also be handle by it.
5782
5785
  * Providing quantity of marks and generating the marks array based with unit
5783
5786
  */
5784
- var Container$55 = styled.div``;
5787
+ var Container$56 = styled.div``;
5785
5788
  var Headers$1 = styled.div`
5786
5789
  font-size: 14px;
5787
5790
  color: var(--grey-10);
@@ -5864,7 +5867,7 @@ var DurationSlider = ({ max, min, defaultValue = 0, title = "", timeUnit, contro
5864
5867
  if (inputCallback) inputCallback(value);
5865
5868
  setSelectedValue(value);
5866
5869
  }, [inputCallback]);
5867
- return /* @__PURE__ */ jsxs(Container$55, { children: [/* @__PURE__ */ jsxs(Headers$1, { children: [/* @__PURE__ */ jsx(Label, {
5870
+ return /* @__PURE__ */ jsxs(Container$56, { children: [/* @__PURE__ */ jsxs(Headers$1, { children: [/* @__PURE__ */ jsx(Label, {
5868
5871
  htmlFor: "duration-slider",
5869
5872
  labelText: title
5870
5873
  }), getValueTitle(controlledValue ? controlledValue : selectedValue, timeUnit, timeFormat)] }), /* @__PURE__ */ jsx(SliderInput, {
@@ -5877,83 +5880,6 @@ var DurationSlider = ({ max, min, defaultValue = 0, title = "", timeUnit, contro
5877
5880
  })] });
5878
5881
  };
5879
5882
  //#endregion
5880
- //#region src/Form/molecules/PasswordField.tsx
5881
- var PasswordField = ({ name, label, fieldState, feedbackMessage, required, children, formAction, ...props }) => {
5882
- const [showValue, setShowValue] = useState(false);
5883
- const [actionIcon, setActionIcon] = useState("PasswordHide");
5884
- const actionCallback = () => {
5885
- const newValue = !showValue;
5886
- setShowValue(newValue);
5887
- setActionIcon(newValue ? "PasswordShow" : "PasswordHide");
5888
- };
5889
- return /* @__PURE__ */ jsx(Label, {
5890
- htmlFor: name,
5891
- labelText: label,
5892
- required,
5893
- children: /* @__PURE__ */ jsx(Input, {
5894
- type: showValue ? "text" : "password",
5895
- actionCallback,
5896
- actionIcon,
5897
- name,
5898
- fieldState,
5899
- feedbackMessage,
5900
- required,
5901
- ...props
5902
- })
5903
- });
5904
- };
5905
- //#endregion
5906
- //#region src/Form/molecules/PercentageSlider.tsx
5907
- var Container$54 = styled.div``;
5908
- var Headers = styled.div`
5909
- font-size: 14px;
5910
- color: var(--grey-10);
5911
- display: flex;
5912
- justify-content: space-between;
5913
- margin-bottom: 20px;
5914
- ${({ $allMarkCentered }) => $allMarkCentered ? `padding: 0;` : `padding: 0 6px;`};
5915
- `;
5916
- var ValueTitle = styled(Label)`
5917
- font-family: ${({ theme }) => theme.fontFamily.data};
5918
- `;
5919
- var getThumbColor = (value) => {
5920
- if (value <= 10) return "error";
5921
- if (value > 10 && value <= 30) return "warning";
5922
- return "success";
5923
- };
5924
- var getTitleLevel = (value) => {
5925
- if (value <= 10) return "Critical Level";
5926
- if (value > 10 && value <= 30) return "Warning Level";
5927
- return "Safe Level";
5928
- };
5929
- var PercentageSlider = ({ defaultValue = 0, inputCallback, updateThumbColor, updateTitle, showValue, allMarkCentered, ...props }) => {
5930
- const [selectedValue, setSelectedValue] = useState(defaultValue);
5931
- const handleSelectedValue = useCallback((value) => {
5932
- if (inputCallback) inputCallback(value);
5933
- setSelectedValue(value);
5934
- }, [inputCallback]);
5935
- return /* @__PURE__ */ jsxs(Container$54, { children: [/* @__PURE__ */ jsxs(Headers, {
5936
- $allMarkCentered: allMarkCentered,
5937
- children: [/* @__PURE__ */ jsx(Label, {
5938
- htmlFor: "percentage-slider",
5939
- labelText: updateTitle ? updateTitle(selectedValue) : getTitleLevel(selectedValue)
5940
- }), showValue && /* @__PURE__ */ jsx(ValueTitle, {
5941
- htmlFor: "percentage-slider",
5942
- labelText: `${selectedValue}%`
5943
- })]
5944
- }), /* @__PURE__ */ jsx(SliderInput, {
5945
- ...props,
5946
- id: "percentage-slider",
5947
- max: 100,
5948
- min: 0,
5949
- defaultValue,
5950
- showValue,
5951
- onChangeCallback: handleSelectedValue,
5952
- thumbColor: updateThumbColor ? updateThumbColor(selectedValue) : getThumbColor(selectedValue),
5953
- allMarkCentered
5954
- })] });
5955
- };
5956
- //#endregion
5957
5883
  //#region src/hooks/useMediaQuery.ts
5958
5884
  /**
5959
5885
  * Custom hook that tells you whether a given media query is active.
@@ -6207,7 +6133,7 @@ var MediaBox = ({ src: incomingSrc, alt, videoOptions = {}, mediaType, hasModalL
6207
6133
  };
6208
6134
  //#endregion
6209
6135
  //#region src/Modals/Modal.tsx
6210
- var Container$53 = styled.div`
6136
+ var Container$55 = styled.div`
6211
6137
  position: fixed;
6212
6138
  top: 0;
6213
6139
  left: 0;
@@ -6282,7 +6208,7 @@ var Modal = ({ isOpen = false, isCloseEnable = true, closeText = "", width = "",
6282
6208
  if (dismissCallback) dismissCallback();
6283
6209
  onDismiss();
6284
6210
  }, [onDismiss, dismissCallback]);
6285
- return isOpen ? ReactDom.createPortal(/* @__PURE__ */ jsx(Container$53, { children: /* @__PURE__ */ jsxs(LightBox, {
6211
+ return isOpen ? ReactDom.createPortal(/* @__PURE__ */ jsx(Container$55, { children: /* @__PURE__ */ jsxs(LightBox, {
6286
6212
  ref: lightBoxRef,
6287
6213
  $width: width,
6288
6214
  $padding: padding,
@@ -6614,6 +6540,325 @@ var useTo = () => {
6614
6540
  return useCallback((url) => () => navigate(url), [navigate]);
6615
6541
  };
6616
6542
  //#endregion
6543
+ //#region src/Form/molecules/EditableText.tsx
6544
+ var IconSlot = styled.span`
6545
+ display: flex;
6546
+ flex-shrink: 0;
6547
+ `;
6548
+ var Text = styled.span`
6549
+ overflow: hidden;
6550
+ white-space: nowrap;
6551
+ text-overflow: ellipsis;
6552
+ `;
6553
+ var Container$54 = styled.div`
6554
+ display: inline-flex;
6555
+ align-items: center;
6556
+ gap: 8px;
6557
+ min-width: 0;
6558
+ height: 100%;
6559
+ font-family: var(--font-ui);
6560
+ font-size: 14px;
6561
+ font-weight: 500;
6562
+ line-height: 20px;
6563
+ color: var(--grey-12);
6564
+ `;
6565
+ var Trigger$1 = styled.button`
6566
+ display: inline-flex;
6567
+ align-items: center;
6568
+ gap: 8px;
6569
+ min-width: 0;
6570
+ padding: 0;
6571
+ border: none;
6572
+ background: transparent;
6573
+ cursor: pointer;
6574
+ outline: none;
6575
+ font: inherit;
6576
+ color: inherit;
6577
+ text-align: left;
6578
+
6579
+ & svg [stroke] { stroke: currentColor; }
6580
+
6581
+ ${IconSlot} {
6582
+ opacity: 0;
6583
+ transition: opacity var(--speed-normal) var(--easing-primary-in-out);
6584
+ }
6585
+
6586
+ &:hover ${IconSlot},
6587
+ &:focus-visible ${IconSlot} {
6588
+ opacity: 1;
6589
+ }
6590
+
6591
+ &:focus-visible {
6592
+ outline: 2px solid var(--primary-9);
6593
+ outline-offset: 2px;
6594
+ }
6595
+
6596
+ ${({ $alwaysShowIcon }) => $alwaysShowIcon && css`
6597
+ ${IconSlot} { opacity: 1; }
6598
+ `}
6599
+ `;
6600
+ var Field = styled.input`
6601
+ box-sizing: border-box;
6602
+ height: 24px;
6603
+ width: ${({ $fieldWidth }) => $fieldWidth};
6604
+ max-width: 100%;
6605
+ min-width: 0;
6606
+ padding: 0 8px;
6607
+ border: 1px solid var(--input-default-border-color);
6608
+ border-radius: 3px;
6609
+ background: var(--input-default-background-color);
6610
+ color: var(--input-color-default);
6611
+ font: inherit;
6612
+ outline: none;
6613
+
6614
+ &:focus {
6615
+ border-color: var(--input-default-focused-border-color);
6616
+ box-shadow: 0 3px 3px var(--input-default-focused-shadow-color);
6617
+ }
6618
+
6619
+ &::placeholder {
6620
+ color: var(--input-color-placeholder);
6621
+ font-style: italic;
6622
+ }
6623
+
6624
+ &:lang(ja)::placeholder {
6625
+ font-style: normal;
6626
+ }
6627
+
6628
+ &[readonly] {
6629
+ color: var(--input-color-disabled);
6630
+ }
6631
+ `;
6632
+ var Actions = styled.div`
6633
+ display: flex;
6634
+ flex-shrink: 0;
6635
+ align-items: center;
6636
+ gap: 8px;
6637
+ `;
6638
+ var EditableText = ({ value, defaultValue, label, onSave, onCancel, onEditingChange, saveOnClickOutside = false, allowEmpty = false, fieldWidth = "240px", editIcon = "Edit", alwaysShowEditIcon = false, editText = "Edit", saveText = "Save", savingText = "Saving", cancelText = "Cancel", disabled = false, type = "text", onKeyDown, ...props }) => {
6639
+ const [isEditing, setIsEditing] = useState(false);
6640
+ const [isSaving, setIsSaving] = useState(false);
6641
+ const [ownText, setOwnText] = useState(defaultValue ?? "");
6642
+ const isControlled = value !== void 0;
6643
+ const text = isControlled ? value : ownText;
6644
+ const [draft, setDraft] = useState(text);
6645
+ const containerRef = useRef(null);
6646
+ const fieldRef = useRef(null);
6647
+ const triggerRef = useRef(null);
6648
+ const restoreFocus = useRef(false);
6649
+ const setEditing = useCallback((next) => {
6650
+ setIsEditing(next);
6651
+ onEditingChange?.(next);
6652
+ }, [onEditingChange]);
6653
+ const open = useCallback(() => {
6654
+ setDraft(text);
6655
+ setEditing(true);
6656
+ }, [text, setEditing]);
6657
+ const close = useCallback((withFocus) => {
6658
+ restoreFocus.current = withFocus;
6659
+ setEditing(false);
6660
+ }, [setEditing]);
6661
+ useEffect(() => {
6662
+ if (!isEditing) return;
6663
+ fieldRef.current?.focus();
6664
+ fieldRef.current?.select();
6665
+ }, [isEditing]);
6666
+ useEffect(() => {
6667
+ if (isEditing || !restoreFocus.current) return;
6668
+ restoreFocus.current = false;
6669
+ triggerRef.current?.focus();
6670
+ }, [isEditing]);
6671
+ useEffect(() => {
6672
+ if (disabled && isEditing) close(false);
6673
+ }, [
6674
+ disabled,
6675
+ isEditing,
6676
+ close
6677
+ ]);
6678
+ const cancel = useCallback((withFocus) => {
6679
+ close(withFocus);
6680
+ onCancel?.();
6681
+ }, [close, onCancel]);
6682
+ const commit = useCallback(async (withFocus) => {
6683
+ if (isSaving) return;
6684
+ const next = draft.trim();
6685
+ if (!next && !allowEmpty) return;
6686
+ if (next === text) {
6687
+ close(withFocus);
6688
+ return;
6689
+ }
6690
+ setIsSaving(true);
6691
+ try {
6692
+ await onSave?.(next);
6693
+ if (!isControlled) setOwnText(next);
6694
+ close(withFocus);
6695
+ } catch {} finally {
6696
+ setIsSaving(false);
6697
+ }
6698
+ }, [
6699
+ isSaving,
6700
+ draft,
6701
+ allowEmpty,
6702
+ text,
6703
+ isControlled,
6704
+ onSave,
6705
+ close
6706
+ ]);
6707
+ useClickOutside(containerRef, useCallback(() => {
6708
+ if (!isEditing || isSaving) return;
6709
+ if (saveOnClickOutside) {
6710
+ commit(false);
6711
+ return;
6712
+ }
6713
+ cancel(false);
6714
+ }, [
6715
+ isEditing,
6716
+ isSaving,
6717
+ saveOnClickOutside,
6718
+ commit,
6719
+ cancel
6720
+ ]));
6721
+ const handleKeyDown = useCallback((e) => {
6722
+ onKeyDown?.(e);
6723
+ if (e.nativeEvent.isComposing) return;
6724
+ if (e.key === "Enter") {
6725
+ e.preventDefault();
6726
+ commit(true);
6727
+ return;
6728
+ }
6729
+ if (e.key === "Escape") cancel(true);
6730
+ }, [
6731
+ onKeyDown,
6732
+ commit,
6733
+ cancel
6734
+ ]);
6735
+ const canSave = allowEmpty || draft.trim().length > 0;
6736
+ if (isEditing) return /* @__PURE__ */ jsxs(Container$54, {
6737
+ ref: containerRef,
6738
+ children: [/* @__PURE__ */ jsx(Field, {
6739
+ ...props,
6740
+ ref: fieldRef,
6741
+ type,
6742
+ $fieldWidth: fieldWidth,
6743
+ "aria-label": label,
6744
+ "aria-busy": isSaving,
6745
+ readOnly: isSaving,
6746
+ value: draft,
6747
+ onChange: (e) => setDraft(e.target.value),
6748
+ onKeyDown: handleKeyDown
6749
+ }), /* @__PURE__ */ jsxs(Actions, { children: [/* @__PURE__ */ jsx(ButtonWithLoading, {
6750
+ size: "small",
6751
+ loading: isSaving,
6752
+ disabled: !canSave,
6753
+ "aria-label": isSaving ? savingText : saveText,
6754
+ onClick: () => {
6755
+ commit(true);
6756
+ },
6757
+ children: isSaving ? savingText : saveText
6758
+ }), /* @__PURE__ */ jsx(Button, {
6759
+ design: "secondary",
6760
+ size: "small",
6761
+ disabled: isSaving,
6762
+ onClick: () => cancel(true),
6763
+ children: cancelText
6764
+ })] })]
6765
+ });
6766
+ return /* @__PURE__ */ jsx(Container$54, {
6767
+ ref: containerRef,
6768
+ children: disabled ? /* @__PURE__ */ jsx(Text, { children: text }) : /* @__PURE__ */ jsxs(Trigger$1, {
6769
+ ref: triggerRef,
6770
+ type: "button",
6771
+ $alwaysShowIcon: alwaysShowEditIcon || text === "",
6772
+ "aria-label": `${text}, ${editText}`,
6773
+ onClick: open,
6774
+ children: [/* @__PURE__ */ jsx(Text, { children: text }), /* @__PURE__ */ jsx(IconSlot, {
6775
+ "aria-hidden": "true",
6776
+ children: /* @__PURE__ */ jsx(Icon, {
6777
+ icon: editIcon,
6778
+ size: 12
6779
+ })
6780
+ })]
6781
+ })
6782
+ });
6783
+ };
6784
+ //#endregion
6785
+ //#region src/Form/molecules/PasswordField.tsx
6786
+ var PasswordField = ({ name, label, fieldState, feedbackMessage, required, children, formAction, ...props }) => {
6787
+ const [showValue, setShowValue] = useState(false);
6788
+ const [actionIcon, setActionIcon] = useState("PasswordHide");
6789
+ const actionCallback = () => {
6790
+ const newValue = !showValue;
6791
+ setShowValue(newValue);
6792
+ setActionIcon(newValue ? "PasswordShow" : "PasswordHide");
6793
+ };
6794
+ return /* @__PURE__ */ jsx(Label, {
6795
+ htmlFor: name,
6796
+ labelText: label,
6797
+ required,
6798
+ children: /* @__PURE__ */ jsx(Input, {
6799
+ type: showValue ? "text" : "password",
6800
+ actionCallback,
6801
+ actionIcon,
6802
+ name,
6803
+ fieldState,
6804
+ feedbackMessage,
6805
+ required,
6806
+ ...props
6807
+ })
6808
+ });
6809
+ };
6810
+ //#endregion
6811
+ //#region src/Form/molecules/PercentageSlider.tsx
6812
+ var Container$53 = styled.div``;
6813
+ var Headers = styled.div`
6814
+ font-size: 14px;
6815
+ color: var(--grey-10);
6816
+ display: flex;
6817
+ justify-content: space-between;
6818
+ margin-bottom: 20px;
6819
+ ${({ $allMarkCentered }) => $allMarkCentered ? `padding: 0;` : `padding: 0 6px;`};
6820
+ `;
6821
+ var ValueTitle = styled(Label)`
6822
+ font-family: ${({ theme }) => theme.fontFamily.data};
6823
+ `;
6824
+ var getThumbColor = (value) => {
6825
+ if (value <= 10) return "error";
6826
+ if (value > 10 && value <= 30) return "warning";
6827
+ return "success";
6828
+ };
6829
+ var getTitleLevel = (value) => {
6830
+ if (value <= 10) return "Critical Level";
6831
+ if (value > 10 && value <= 30) return "Warning Level";
6832
+ return "Safe Level";
6833
+ };
6834
+ var PercentageSlider = ({ defaultValue = 0, inputCallback, updateThumbColor, updateTitle, showValue, allMarkCentered, ...props }) => {
6835
+ const [selectedValue, setSelectedValue] = useState(defaultValue);
6836
+ const handleSelectedValue = useCallback((value) => {
6837
+ if (inputCallback) inputCallback(value);
6838
+ setSelectedValue(value);
6839
+ }, [inputCallback]);
6840
+ return /* @__PURE__ */ jsxs(Container$53, { children: [/* @__PURE__ */ jsxs(Headers, {
6841
+ $allMarkCentered: allMarkCentered,
6842
+ children: [/* @__PURE__ */ jsx(Label, {
6843
+ htmlFor: "percentage-slider",
6844
+ labelText: updateTitle ? updateTitle(selectedValue) : getTitleLevel(selectedValue)
6845
+ }), showValue && /* @__PURE__ */ jsx(ValueTitle, {
6846
+ htmlFor: "percentage-slider",
6847
+ labelText: `${selectedValue}%`
6848
+ })]
6849
+ }), /* @__PURE__ */ jsx(SliderInput, {
6850
+ ...props,
6851
+ id: "percentage-slider",
6852
+ max: 100,
6853
+ min: 0,
6854
+ defaultValue,
6855
+ showValue,
6856
+ onChangeCallback: handleSelectedValue,
6857
+ thumbColor: updateThumbColor ? updateThumbColor(selectedValue) : getThumbColor(selectedValue),
6858
+ allMarkCentered
6859
+ })] });
6860
+ };
6861
+ //#endregion
6617
6862
  //#region src/Form/atoms/SplitButtonOption.tsx
6618
6863
  var StyledButton$5 = styled.button`
6619
6864
  ${resetButtonStyles}
@@ -12392,6 +12637,407 @@ var TagList = ({ tagsConfig }) => {
12392
12637
  }) });
12393
12638
  };
12394
12639
  //#endregion
12640
+ //#region src/Chips/ChipCompactContext.tsx
12641
+ var ChipCompactContext = createContext(false);
12642
+ //#endregion
12643
+ //#region src/Chips/atoms/ChipButton.tsx
12644
+ var collapse = keyframes`
12645
+ to {
12646
+ width: 0;
12647
+ padding-left: 0;
12648
+ padding-right: 0;
12649
+ opacity: 0;
12650
+ border-left-width: 0;
12651
+ }
12652
+ `;
12653
+ var StyledChip = styled.button`
12654
+ position: relative;
12655
+ display: flex;
12656
+ align-items: center;
12657
+ justify-content: center;
12658
+ gap: 8px;
12659
+ width: 56px;
12660
+ height: 56px;
12661
+ padding: 0;
12662
+ border: none;
12663
+ background: transparent;
12664
+ cursor: pointer;
12665
+ outline: none;
12666
+ box-sizing: border-box;
12667
+ font-family: var(--font-ui);
12668
+ font-size: 14px;
12669
+ font-weight: 500;
12670
+ line-height: 20px;
12671
+ color: var(--grey-12);
12672
+ transition:
12673
+ color var(--speed-normal) var(--easing-primary-in-out),
12674
+ background-color var(--speed-normal) var(--easing-primary-in-out);
12675
+
12676
+ ${({ $showDivider }) => $showDivider && css`border-left: 1px solid var(--grey-4);`}
12677
+
12678
+ & svg [stroke] { stroke: var(--grey-12); }
12679
+
12680
+ &::after {
12681
+ content: '';
12682
+ position: absolute;
12683
+ bottom: 0;
12684
+ left: -1px;
12685
+ right: -1px;
12686
+ height: 4px;
12687
+ background-color: transparent;
12688
+ transition: background-color var(--speed-normal) var(--easing-primary-in-out);
12689
+ }
12690
+ &:hover:enabled::after { background-color: var(--primary-6); }
12691
+
12692
+ &:focus-visible {
12693
+ outline: 2px solid var(--primary-9);
12694
+ outline-offset: -2px;
12695
+ }
12696
+
12697
+ ${({ $isCompact }) => $isCompact && css`
12698
+ width: auto;
12699
+ height: 100%;
12700
+ min-height: 32px;
12701
+ padding: 0 12px;
12702
+ justify-content: flex-start;
12703
+ white-space: nowrap;
12704
+
12705
+ &::after { height: 2px; }
12706
+ `}
12707
+
12708
+ ${({ $selected, $barOnly }) => $selected && css`
12709
+ ${!$barOnly && css`
12710
+ background-color: var(--primary-a3);
12711
+ color: var(--primary-11);
12712
+ & svg [stroke] { stroke: var(--primary-11); }
12713
+ `}
12714
+ &::after { background-color: var(--primary-9); }
12715
+ &:hover:enabled::after { background-color: var(--primary-9); }
12716
+ `}
12717
+
12718
+ &:disabled { cursor: not-allowed; opacity: 0.5; }
12719
+
12720
+ ${({ $leaving }) => $leaving && css`
12721
+ overflow: hidden;
12722
+ min-width: 0;
12723
+ pointer-events: none;
12724
+ animation: ${collapse} var(--speed-fast) var(--easing-primary-in-out) forwards;
12725
+
12726
+ @media (prefers-reduced-motion: reduce) { animation: none; }
12727
+ `}
12728
+ `;
12729
+ var ChipButton = ({ variant = "text", isCompact, barOnly = false, icon, label, selected = false, noDivider = false, leaving = false, onLeaveEnd, onAnimationEnd, children, ...props }) => {
12730
+ const showDivider = !noDivider;
12731
+ const barIsCompact = useContext(ChipCompactContext);
12732
+ const compact = isCompact ?? barIsCompact;
12733
+ const showIcon = variant !== "text" && !!icon;
12734
+ const showText = variant !== "icon" || !icon;
12735
+ const isMenuButton = props["aria-haspopup"] !== void 0;
12736
+ const chipRef = useRef(null);
12737
+ useLayoutEffect(() => {
12738
+ const chip = chipRef.current;
12739
+ if (!chip) return;
12740
+ chip.style.width = leaving && compact ? `${chip.offsetWidth}px` : "";
12741
+ }, [leaving, compact]);
12742
+ const hasFired = useRef(false);
12743
+ const fireLeaveEnd = useCallback(() => {
12744
+ if (hasFired.current) return;
12745
+ hasFired.current = true;
12746
+ onLeaveEnd?.();
12747
+ }, [onLeaveEnd]);
12748
+ useEffect(() => {
12749
+ if (!leaving) {
12750
+ hasFired.current = false;
12751
+ return;
12752
+ }
12753
+ if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) fireLeaveEnd();
12754
+ }, [leaving, fireLeaveEnd]);
12755
+ const handleAnimationEnd = useCallback((e) => {
12756
+ onAnimationEnd?.(e);
12757
+ if (leaving && e.target === e.currentTarget) fireLeaveEnd();
12758
+ }, [
12759
+ leaving,
12760
+ fireLeaveEnd,
12761
+ onAnimationEnd
12762
+ ]);
12763
+ return /* @__PURE__ */ jsxs(StyledChip, {
12764
+ ref: chipRef,
12765
+ type: "button",
12766
+ "aria-pressed": isMenuButton ? void 0 : selected,
12767
+ $selected: selected,
12768
+ $showDivider: showDivider,
12769
+ $leaving: leaving,
12770
+ $isCompact: compact,
12771
+ $barOnly: barOnly,
12772
+ ...props,
12773
+ onAnimationEnd: handleAnimationEnd,
12774
+ children: [showIcon ? /* @__PURE__ */ jsx(Icon, {
12775
+ icon,
12776
+ size: 16
12777
+ }) : null, showText ? label ?? children : null]
12778
+ });
12779
+ };
12780
+ //#endregion
12781
+ //#region src/Chips/atoms/ChipZoneBreak.tsx
12782
+ var Break = styled.div`
12783
+ box-sizing: border-box;
12784
+ flex-shrink: 0;
12785
+ width: 12px;
12786
+ height: 56px;
12787
+ background-color: var(--grey-3);
12788
+ border-left: 1px solid var(--grey-4);
12789
+ border-right: 1px solid var(--grey-4);
12790
+ `;
12791
+ var ChipZoneBreak = (props) => /* @__PURE__ */ jsx(Break, {
12792
+ "aria-hidden": "true",
12793
+ ...props
12794
+ });
12795
+ //#endregion
12796
+ //#region src/Chips/molecules/ChipDropdown.tsx
12797
+ var Wrapper = styled.div`
12798
+ position: relative;
12799
+ display: inline-flex;
12800
+ `;
12801
+ var Trigger = styled(ChipButton)`
12802
+ && {
12803
+ background-color: transparent;
12804
+
12805
+ ${({ $labelled }) => $labelled && css`
12806
+ width: auto;
12807
+ padding: 0 16px 0 14px;
12808
+ gap: 8px;
12809
+ justify-content: flex-start;
12810
+ white-space: nowrap;
12811
+ color: var(--grey-12);
12812
+ & svg [stroke] { stroke: var(--grey-12); }
12813
+ `}
12814
+ }
12815
+ `;
12816
+ var Menu = styled.div`
12817
+ position: absolute;
12818
+ top: calc(100% + 8px);
12819
+ left: -1px;
12820
+ z-index: 100;
12821
+ display: flex;
12822
+ flex-direction: column;
12823
+ align-items: stretch;
12824
+ min-width: 216px;
12825
+ padding: 4px 0;
12826
+ background: var(--grey-1);
12827
+ border: 1px solid var(--grey-4);
12828
+ border-radius: 4px;
12829
+ box-shadow: 0px 5px 25px 0px var(--filter-button-shadow-color);
12830
+ `;
12831
+ var MenuItem = styled.button`
12832
+ display: flex;
12833
+ align-items: center;
12834
+ gap: 4px;
12835
+ width: 100%;
12836
+ height: var(--button-height, 32px);
12837
+ padding: 3px 8px;
12838
+ border: none;
12839
+ border-bottom: 1px solid var(--grey-7);
12840
+ background: transparent;
12841
+ cursor: pointer;
12842
+ font-family: var(--font-ui);
12843
+ font-size: 14px;
12844
+ font-weight: 500;
12845
+ line-height: 20px;
12846
+ color: var(--grey-12);
12847
+ text-align: left;
12848
+ transition: background-color var(--speed-fast) var(--easing-primary-in-out);
12849
+
12850
+ & svg [stroke] { stroke: var(--grey-12); }
12851
+
12852
+ &:last-child { border-bottom: none; }
12853
+ &:hover:enabled { background-color: var(--grey-3); }
12854
+ &:disabled { cursor: not-allowed; opacity: 0.5; }
12855
+
12856
+ ${({ $current }) => $current && css`
12857
+ background-color: var(--grey-4);
12858
+ &:hover:enabled { background-color: var(--grey-5); }
12859
+ `}
12860
+ `;
12861
+ var CheckSlot = styled.span`
12862
+ display: flex;
12863
+ margin-left: auto;
12864
+ `;
12865
+ var ChipDropdown = ({ items, icon = "FilterEllipsis", label, selectedId, checkIcon = "Success", triggerLabel, noDivider = false, disabled = false, onOpenChange, onKeyDown, ...props }) => {
12866
+ const [isOpen, setIsOpen] = useState(false);
12867
+ const wrapperRef = useRef(null);
12868
+ const isLabelled = Boolean(label);
12869
+ const marksCurrent = selectedId !== void 0;
12870
+ const ariaLabel = triggerLabel ?? (isLabelled ? void 0 : "Space actions");
12871
+ const setOpen = useCallback((next) => {
12872
+ setIsOpen(next);
12873
+ onOpenChange?.(next);
12874
+ }, [onOpenChange]);
12875
+ const close = useCallback(() => setOpen(false), [setOpen]);
12876
+ const toggle = useCallback(() => setOpen(!isOpen), [isOpen, setOpen]);
12877
+ useClickOutside(wrapperRef, useCallback(() => {
12878
+ if (isOpen) close();
12879
+ }, [isOpen, close]));
12880
+ useEffect(() => {
12881
+ if (disabled && isOpen) close();
12882
+ }, [
12883
+ disabled,
12884
+ isOpen,
12885
+ close
12886
+ ]);
12887
+ const handleKeyDown = useCallback((e) => {
12888
+ onKeyDown?.(e);
12889
+ if (e.key === "Escape" && isOpen) close();
12890
+ }, [
12891
+ isOpen,
12892
+ close,
12893
+ onKeyDown
12894
+ ]);
12895
+ return /* @__PURE__ */ jsxs(Wrapper, {
12896
+ ref: wrapperRef,
12897
+ ...props,
12898
+ onKeyDown: handleKeyDown,
12899
+ children: [/* @__PURE__ */ jsx(Trigger, {
12900
+ $labelled: isLabelled,
12901
+ variant: isLabelled ? void 0 : "icon",
12902
+ icon: isLabelled ? void 0 : icon,
12903
+ selected: isOpen,
12904
+ noDivider,
12905
+ disabled,
12906
+ "aria-label": ariaLabel,
12907
+ "aria-haspopup": "menu",
12908
+ "aria-expanded": isOpen,
12909
+ onClick: toggle,
12910
+ children: isLabelled ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
12911
+ icon ? /* @__PURE__ */ jsx(Icon, {
12912
+ icon,
12913
+ size: 18
12914
+ }) : null,
12915
+ label,
12916
+ /* @__PURE__ */ jsx(Icon, {
12917
+ icon: "Down",
12918
+ size: 12
12919
+ })
12920
+ ] }) : null
12921
+ }), isOpen && !disabled ? /* @__PURE__ */ jsx(Menu, {
12922
+ role: "menu",
12923
+ children: items.map((item) => {
12924
+ const isCurrent = marksCurrent && item.id === selectedId;
12925
+ return /* @__PURE__ */ jsxs(MenuItem, {
12926
+ type: "button",
12927
+ role: marksCurrent ? "menuitemradio" : "menuitem",
12928
+ "aria-checked": marksCurrent ? isCurrent : void 0,
12929
+ $current: isCurrent,
12930
+ disabled: item.disabled,
12931
+ onClick: () => {
12932
+ item.onClick?.();
12933
+ close();
12934
+ },
12935
+ children: [
12936
+ item.icon ? /* @__PURE__ */ jsx(Icon, {
12937
+ icon: item.icon,
12938
+ size: 14
12939
+ }) : null,
12940
+ item.label,
12941
+ isCurrent ? /* @__PURE__ */ jsx(CheckSlot, {
12942
+ "aria-hidden": "true",
12943
+ children: /* @__PURE__ */ jsx(Icon, {
12944
+ icon: checkIcon,
12945
+ size: 14,
12946
+ weight: "light"
12947
+ })
12948
+ }) : null
12949
+ ]
12950
+ }, item.id);
12951
+ })
12952
+ }) : null]
12953
+ });
12954
+ };
12955
+ //#endregion
12956
+ //#region src/Chips/organisms/ChipBar.tsx
12957
+ var Bar = styled.div`
12958
+ display: flex;
12959
+ align-items: center;
12960
+ height: 56px;
12961
+
12962
+ & > * {
12963
+ flex-shrink: 0;
12964
+ }
12965
+
12966
+ ${({ $isCompact }) => $isCompact && css`
12967
+ height: 100%;
12968
+ min-height: 32px;
12969
+ `}
12970
+ `;
12971
+ var NAV_KEYS = [
12972
+ "ArrowLeft",
12973
+ "ArrowRight",
12974
+ "Home",
12975
+ "End"
12976
+ ];
12977
+ var ChipBar = ({ children, isCompact = false, leadingDivider = false, onKeyDown, onFocus, ...props }) => {
12978
+ const barRef = useRef(null);
12979
+ const [activeIndex, setActiveIndex] = useState(0);
12980
+ const getCells = useCallback(() => {
12981
+ const root = barRef.current;
12982
+ if (!root) return [];
12983
+ return Array.from(root.querySelectorAll("button:not(:disabled)")).filter((el) => !el.closest("[role=\"menu\"]"));
12984
+ }, []);
12985
+ useEffect(() => {
12986
+ const root = barRef.current;
12987
+ if (!root) return;
12988
+ const sync = () => {
12989
+ const focusables = getCells();
12990
+ const index = Math.min(activeIndex, focusables.length - 1);
12991
+ focusables.forEach((cell, i) => {
12992
+ cell.tabIndex = i === index ? 0 : -1;
12993
+ });
12994
+ };
12995
+ sync();
12996
+ const observer = new MutationObserver(sync);
12997
+ observer.observe(root, {
12998
+ childList: true,
12999
+ subtree: true,
13000
+ attributes: true,
13001
+ attributeFilter: ["disabled"]
13002
+ });
13003
+ return () => observer.disconnect();
13004
+ }, [activeIndex, getCells]);
13005
+ const cells = Children.toArray(children).filter(isValidElement);
13006
+ const handleFocus = useCallback((e) => {
13007
+ onFocus?.(e);
13008
+ const index = getCells().indexOf(e.target);
13009
+ if (index >= 0) setActiveIndex(index);
13010
+ }, [getCells, onFocus]);
13011
+ const handleKeyDown = useCallback((e) => {
13012
+ onKeyDown?.(e);
13013
+ if (!NAV_KEYS.includes(e.key)) return;
13014
+ if (barRef.current?.querySelector("[role=\"menu\"]")) return;
13015
+ const focusables = getCells();
13016
+ const current = focusables.indexOf(document.activeElement);
13017
+ if (focusables.length === 0 || current < 0) return;
13018
+ e.preventDefault();
13019
+ let next = current;
13020
+ if (e.key === "ArrowLeft") next = (current - 1 + focusables.length) % focusables.length;
13021
+ if (e.key === "ArrowRight") next = (current + 1) % focusables.length;
13022
+ if (e.key === "Home") next = 0;
13023
+ if (e.key === "End") next = focusables.length - 1;
13024
+ focusables[next]?.focus();
13025
+ }, [getCells, onKeyDown]);
13026
+ return /* @__PURE__ */ jsx(ChipCompactContext.Provider, {
13027
+ value: isCompact,
13028
+ children: /* @__PURE__ */ jsx(Bar, {
13029
+ ref: barRef,
13030
+ role: "toolbar",
13031
+ "aria-label": "Chip bar",
13032
+ $isCompact: isCompact,
13033
+ ...props,
13034
+ onFocus: handleFocus,
13035
+ onKeyDown: handleKeyDown,
13036
+ children: cells.map((child, i) => i === 0 && !leadingDivider && typeof child.type !== "string" ? cloneElement(child, { noDivider: true }) : child)
13037
+ })
13038
+ });
13039
+ };
13040
+ //#endregion
12395
13041
  //#region src/Modals/ConfirmationModal.tsx
12396
13042
  var Container$20 = styled.div``;
12397
13043
  var Title$3 = styled.div`
@@ -13203,7 +13849,7 @@ var Container$17 = styled.div`
13203
13849
  width: 100%;
13204
13850
  display: flex;
13205
13851
  `;
13206
- var LeftArea = styled.div`
13852
+ var LeftArea$1 = styled.div`
13207
13853
  display: flex;
13208
13854
  align-items: center;
13209
13855
  gap: var(--columnPadding, 16px);
@@ -13288,7 +13934,7 @@ var UtilityHeader = ({ showBreadcrumbs = true, breadcrumbs = [], showHomeIcon =
13288
13934
  const { isLarge } = useBreakpoints();
13289
13935
  const iconInGutter = $iconInGutter !== void 0 ? $iconInGutter : isLarge;
13290
13936
  const hasBreadcrumbs = showBreadcrumbs && breadcrumbs.length > 0;
13291
- return /* @__PURE__ */ jsxs(Container$17, { children: [/* @__PURE__ */ jsxs(LeftArea, { children: [back && /* @__PURE__ */ jsx(UtilityHeaderBack, {
13937
+ return /* @__PURE__ */ jsxs(Container$17, { children: [/* @__PURE__ */ jsxs(LeftArea$1, { children: [back && /* @__PURE__ */ jsx(UtilityHeaderBack, {
13292
13938
  $showDivider: hasBreadcrumbs,
13293
13939
  $iconInGutter: iconInGutter,
13294
13940
  ...back
@@ -14083,26 +14729,63 @@ var NotificationsHistory = ({ read, unread, noNotificationsText = "No new notifi
14083
14729
  };
14084
14730
  //#endregion
14085
14731
  //#region src/Global/molecules/TopBar.tsx
14732
+ var RESERVED_DRAWER_IDS = [
14733
+ "user",
14734
+ "notifications",
14735
+ "custom"
14736
+ ];
14737
+ var TopBarHeightVars = createGlobalStyle`
14738
+ :root {
14739
+ --top-bar-bottom-height: ${({ $bottomHeight }) => $bottomHeight};
14740
+ --top-bar-total-height: calc(var(--top-bar-height, 56px) + var(--top-bar-bottom-height, 0px));
14741
+ }
14742
+ `;
14086
14743
  var Container$10 = styled.div`
14087
14744
  z-index: 9;
14088
14745
  position: sticky;
14089
14746
  top: 0;
14090
- height: 56px;
14091
- padding: 0 16px 0 24px;
14092
14747
  width: 100%;
14093
14748
  display: flex;
14094
- justify-content: space-between;
14749
+ flex-direction: column;
14095
14750
  align-self: flex-start;
14096
- border-bottom: 1px solid var(--dividing-line);
14751
+ border-bottom: var(--top-bar-divider-width, 1px) solid var(--dividing-line);
14097
14752
  background: var(--grey-2);
14098
14753
  box-shadow: 5px 0px 10px 0px var(--primary-a2);
14099
14754
  `;
14755
+ var BarRow = styled.div`
14756
+ height: calc(var(--top-bar-height, 56px) - var(--top-bar-divider-width, 1px));
14757
+ padding: 0 16px 0 24px;
14758
+ display: flex;
14759
+ justify-content: space-between;
14760
+ `;
14761
+ var BottomArea = styled.div`
14762
+ position: relative;
14763
+ box-sizing: border-box;
14764
+ height: var(--top-bar-bottom-height, 32px);
14765
+ display: flex;
14766
+ align-items: center;
14767
+ background: var(--global-element-background);
14768
+
14769
+ &::before {
14770
+ content: '';
14771
+ position: absolute;
14772
+ top: 0;
14773
+ left: 0;
14774
+ right: 0;
14775
+ height: 1px;
14776
+ background: var(--dividing-line);
14777
+ }
14778
+ `;
14100
14779
  var RightArea = styled.div`
14101
14780
  display: flex;
14102
14781
  align-items: center;
14103
14782
  gap: 24px;
14104
14783
  height: 100%;
14105
14784
  `;
14785
+ var LeftArea = styled.div`
14786
+ display: flex;
14787
+ height: 100%;
14788
+ `;
14106
14789
  var SearchBar = styled.div`
14107
14790
  flex: 0 1 500px;
14108
14791
  display: flex;
@@ -14217,7 +14900,7 @@ var Drawer = styled.div`
14217
14900
 
14218
14901
  position: fixed;
14219
14902
  right: -10px;
14220
- top: 56px;
14903
+ top: var(--top-bar-total-height, 56px);
14221
14904
  bottom: 0;
14222
14905
  background: var(--global-element-background);
14223
14906
  border-left: var(--dividing-line) 1px solid;
@@ -14248,21 +14931,46 @@ var NotificationsContainer = styled.div`
14248
14931
  overflow-y: scroll;
14249
14932
  margin-right: -17px;
14250
14933
  `;
14251
- var TopBar = ({ hasNotifications = false, hasLanguage = false, selectedLanguageText = "", languageOptionsText, selectedLangAttribute, hasLogout = true, logoutLink = "/logout", logoutText = "Logout", hasSearch = false, hasCurrentUser = true, currentUserText = "Current User", accountOptionText = "Account Options", searchPlaceholder = "Search for devices, analysis tasks, etc.", userSubmenu = [], userDrawerBespoke, loggedInUser, notificationsHistory, customDrawer, hasSwitchTheme = false, isLightMode = true, switchThemeText = "SWITCH THEME", selectedThemeText = "", onLogout = () => {}, onLanguageToggle = () => {}, onThemeToggle = () => {}, userDrawerFooter, userDrawerMeta, onUserDrawerMetaClick = () => {}, hasUserDrawerMeta, copySuccessMessage, includeCopyTitle, hasUserDrawerFooter, badge }) => {
14252
- const [openDrawer, setOpenDrawer] = useState(null);
14934
+ var TopBar = ({ hasNotifications = false, hasLanguage = false, selectedLanguageText = "", languageOptionsText, selectedLangAttribute, hasLogout = true, logoutLink = "/logout", logoutText = "Logout", hasSearch = false, hasCurrentUser = true, currentUserText = "Current User", accountOptionText = "Account Options", searchPlaceholder = "Search for devices, analysis tasks, etc.", userSubmenu = [], userDrawerBespoke, loggedInUser, notificationsHistory, customDrawer, hasSwitchTheme = false, isLightMode = true, switchThemeText = "SWITCH THEME", selectedThemeText = "", onLogout = () => {}, onLanguageToggle = () => {}, onThemeToggle = () => {}, userDrawerFooter, userDrawerMeta, onUserDrawerMetaClick = () => {}, hasUserDrawerMeta, copySuccessMessage, includeCopyTitle, hasUserDrawerFooter, badge, leftAreaElement, bottomAreaElement, bottomAreaHeight = "32px", sideDrawers, activeDrawer, onActiveDrawerChange }) => {
14935
+ const [internalDrawer, setInternalDrawer] = useState(null);
14936
+ const isControlled = activeDrawer !== void 0;
14937
+ const openDrawer = isControlled ? activeDrawer : internalDrawer;
14253
14938
  const toggleDrawers = (drawerKey) => {
14254
- setOpenDrawer((prevDrawer) => {
14255
- if (prevDrawer === drawerKey) return null;
14256
- return drawerKey;
14257
- });
14939
+ const nextDrawer = openDrawer === drawerKey ? null : drawerKey;
14940
+ if (!isControlled) setInternalDrawer(nextDrawer);
14941
+ onActiveDrawerChange?.(nextDrawer);
14258
14942
  };
14943
+ const { sideDrawersToRender, sideDrawerWarnings } = useMemo(() => {
14944
+ const toRender = [];
14945
+ const warnings = [];
14946
+ const acceptedIds = /* @__PURE__ */ new Set();
14947
+ for (const drawer of sideDrawers ?? []) {
14948
+ if (RESERVED_DRAWER_IDS.includes(drawer.id)) {
14949
+ warnings.push(`the side drawer with id "${drawer.id}" uses a reserved id (${RESERVED_DRAWER_IDS.join(", ")}), so it will not open when its trigger is clicked. Please use a different id.`);
14950
+ continue;
14951
+ }
14952
+ if (acceptedIds.has(drawer.id)) {
14953
+ warnings.push(`a side drawer with id "${drawer.id}" already exists; the duplicate will not open when its trigger is clicked. Please use a unique id.`);
14954
+ continue;
14955
+ }
14956
+ acceptedIds.add(drawer.id);
14957
+ toRender.push(drawer);
14958
+ }
14959
+ return {
14960
+ sideDrawersToRender: toRender,
14961
+ sideDrawerWarnings: warnings
14962
+ };
14963
+ }, [sideDrawers]);
14964
+ useEffect(() => {
14965
+ for (const warning of sideDrawerWarnings) console.warn(`TopBar: ${warning}`);
14966
+ }, []);
14259
14967
  return /* @__PURE__ */ jsxs(Container$10, { children: [
14260
- hasSearch ? /* @__PURE__ */ jsxs(SearchBar, { children: [/* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(Icon, {
14968
+ /* @__PURE__ */ jsx(TopBarHeightVars, { $bottomHeight: bottomAreaElement ? bottomAreaHeight : "0px" }),
14969
+ /* @__PURE__ */ jsxs(BarRow, { children: [hasSearch ? /* @__PURE__ */ jsxs(SearchBar, { children: [/* @__PURE__ */ jsx(IconWrapper, { children: /* @__PURE__ */ jsx(Icon, {
14261
14970
  icon: "Search",
14262
14971
  size: 16,
14263
14972
  color: "grey-6"
14264
- }) }), /* @__PURE__ */ jsx(SearchInput, { placeholder: searchPlaceholder })] }) : /* @__PURE__ */ jsx("div", {}),
14265
- /* @__PURE__ */ jsxs(RightArea, { children: [badge && /* @__PURE__ */ jsx(TopBarBadge, { ...badge }), /* @__PURE__ */ jsxs(ButtonArea, { children: [
14973
+ }) }), /* @__PURE__ */ jsx(SearchInput, { placeholder: searchPlaceholder })] }) : leftAreaElement ? /* @__PURE__ */ jsx(LeftArea, { children: leftAreaElement }) : /* @__PURE__ */ jsx("div", {}), /* @__PURE__ */ jsxs(RightArea, { children: [badge && /* @__PURE__ */ jsx(TopBarBadge, { ...badge }), /* @__PURE__ */ jsxs(ButtonArea, { children: [
14266
14974
  customDrawer && /* @__PURE__ */ jsx(DrawerToggle, {
14267
14975
  $isActive: openDrawer === "custom",
14268
14976
  onClick: () => toggleDrawers("custom"),
@@ -14286,7 +14994,8 @@ var TopBar = ({ hasNotifications = false, hasLanguage = false, selectedLanguageT
14286
14994
  color: "dimmed"
14287
14995
  })
14288
14996
  })
14289
- ] })] }),
14997
+ ] })] })] }),
14998
+ bottomAreaElement ? /* @__PURE__ */ jsx(BottomArea, { children: bottomAreaElement }) : null,
14290
14999
  ReactDom.createPortal(/* @__PURE__ */ jsxs(DrawerPortalWrapper, { children: [
14291
15000
  /* @__PURE__ */ jsx(Drawer, {
14292
15001
  $isOpen: openDrawer === "user",
@@ -14329,7 +15038,12 @@ var TopBar = ({ hasNotifications = false, hasLanguage = false, selectedLanguageT
14329
15038
  $isOpen: openDrawer === "custom",
14330
15039
  $baseWidth: customDrawer.width ? customDrawer.width : "200px",
14331
15040
  children: customDrawer.customComponent
14332
- })
15041
+ }),
15042
+ sideDrawersToRender.map((drawer) => /* @__PURE__ */ jsx(Drawer, {
15043
+ $isOpen: openDrawer === drawer.id,
15044
+ $baseWidth: drawer.width ? drawer.width : "200px",
15045
+ children: drawer.content
15046
+ }, drawer.id))
14333
15047
  ] }), document.body)
14334
15048
  ] });
14335
15049
  };
@@ -15420,7 +16134,11 @@ var HeaderContainer = styled.div`
15420
16134
  flex-grow: 3;
15421
16135
  }
15422
16136
  `;
15423
- var MobileNavbar = ({ content, home, logoMark, supportUrl, defaultMenuOpen = true, closeText, hasLanguage, hasLogout, logoutLink, hasCurrentUser, hasNotifications, userSubmenu, userDrawerBespoke, loggedInUser, notificationsHistory, customDrawer, supportText, onLogout, onLanguageToggle, ...props }) => {
16137
+ var MobileNavbar = ({ content, home, logoMark, supportUrl, defaultMenuOpen = true, closeText, hasLanguage, hasLogout, logoutLink, hasCurrentUser, hasNotifications, userSubmenu, userDrawerBespoke, loggedInUser, notificationsHistory, customDrawer, sideDrawers, bottomAreaElement, supportText, onLogout, onLanguageToggle, ...props }) => {
16138
+ useEffect(() => {
16139
+ if (sideDrawers?.length) console.warn("MobileNavbar: `sideDrawers` are not supported on mobile and will not open. Use `customDrawer` for a drawer that works across breakpoints.");
16140
+ if (bottomAreaElement) console.warn("MobileNavbar: `bottomAreaElement` is not supported on mobile and will not render.");
16141
+ }, []);
15424
16142
  return /* @__PURE__ */ jsx(Container$1, { children: /* @__PURE__ */ jsxs(Tabs, { children: [/* @__PURE__ */ jsxs(HeaderContainer, { children: [/* @__PURE__ */ jsx(MobileLogoLink, {
15425
16143
  home,
15426
16144
  logoMark,
@@ -15622,6 +16340,6 @@ var Sidebar = ({ children, ...props }) => {
15622
16340
  });
15623
16341
  };
15624
16342
  //#endregion
15625
- export { ActionButtons, ActionsBar, AlertBar, AlertWrapper, AreaUploadManager, AvatarUploader, BackLink, BaseStyles, BasicSearchInput, Button, ButtonWithIcon, ButtonWithLoading, ButtonsStack, CameraPanelWrapper, CameraPanels, Checkbox, ConfirmationModal, Content, ContentLayout, CropTool, DatePicker, DebouncedSearcher, DropArea, DurationSlider, EditCell, FilterBar, FilterButton, FilterDropdown, FilterDropdownContainer, FilterInputs, FilterLayout, FiltersResults, FlexContentPlaceholder, Form, FullWidthContentBlock, GlobalUI, Icon, IconButton, IconSVGs, Input, InputFileButton, IntroductionText, Label, Layout, LineReducer_default as LineReducer, LineSetContext, LineUI, LineUI$1 as LineUIRTC, LineUIVideo, Logo, MainContainer, MainMenu, MediaBox, ModalContext, ModalProvider, MultilineContent, Notification, NotificationProvider, PageHeader, PageTitle, Pagination, PasswordField, PercentageSlider, RadioButton, SelectField, SelectWrapper, Sidebar, SidebarBox, SidebarHeading, SidebarLink, SidebarLinkHeading, SliderInput, SmallInput, SortDropdown, Spinner, SplitButton, SplitLayout, StatusIcon, Switch, Tab, TabContent, TabContext, TabList, TabWithIcon, TableHeaderTitle, TableRowThumbnail, Tabs, TabsWithIconBar, Tag, TagList, TagListWrapper, TextArea, TextAreaField, TextField, ThemeVariables, ToggleButton, Tooltip, TopBar, TypeTable, UtilityHeader, WebRTCPlayer as WebRTCClient, theme_default as defaultTheme, isDateInterval, isFilterItem, resetButtonStyles, useClickOutside, useCopyToClipboard, useInterval, useMediaModal, useModal, useNotification, usePoll, useThemeToggle, useTitle, useTo };
16343
+ export { ActionButtons, ActionsBar, AlertBar, AlertWrapper, AreaUploadManager, AvatarUploader, BackLink, BaseStyles, BasicSearchInput, Button, ButtonWithIcon, ButtonWithLoading, ButtonsStack, CameraPanelWrapper, CameraPanels, Checkbox, ChipBar, ChipButton, ChipDropdown, ChipZoneBreak, ConfirmationModal, Content, ContentLayout, CropTool, DatePicker, DebouncedSearcher, DropArea, DurationSlider, EditCell, EditableText, FilterBar, FilterButton, FilterDropdown, FilterDropdownContainer, FilterInputs, FilterLayout, FiltersResults, FlexContentPlaceholder, Form, FullWidthContentBlock, GlobalUI, Icon, IconButton, IconSVGs, Input, InputFileButton, IntroductionText, Label, Layout, LineReducer_default as LineReducer, LineSetContext, LineUI, LineUI$1 as LineUIRTC, LineUIVideo, Logo, MainContainer, MainMenu, MediaBox, ModalContext, ModalProvider, MultilineContent, Notification, NotificationProvider, PageHeader, PageTitle, Pagination, PasswordField, PercentageSlider, RadioButton, SelectField, SelectWrapper, Sidebar, SidebarBox, SidebarHeading, SidebarLink, SidebarLinkHeading, SliderInput, SmallInput, SortDropdown, Spinner, SplitButton, SplitLayout, StatusIcon, Switch, Tab, TabContent, TabContext, TabList, TabWithIcon, TableHeaderTitle, TableRowThumbnail, Tabs, TabsWithIconBar, Tag, TagList, TagListWrapper, TextArea, TextAreaField, TextField, ThemeVariables, ToggleButton, Tooltip, TopBar, TypeTable, UtilityHeader, WebRTCPlayer as WebRTCClient, theme_default as defaultTheme, isDateInterval, isFilterItem, resetButtonStyles, useClickOutside, useCopyToClipboard, useInterval, useMediaModal, useModal, useNotification, usePoll, useThemeToggle, useTitle, useTo };
15626
16344
 
15627
16345
  //# sourceMappingURL=index.modern.js.map