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.
- package/dist/Chips/ChipCompactContext.d.ts +2 -0
- package/dist/Chips/ChipCompactContext.d.ts.map +1 -0
- package/dist/Chips/atoms/ChipButton.d.ts +27 -0
- package/dist/Chips/atoms/ChipButton.d.ts.map +1 -0
- package/dist/Chips/atoms/ChipZoneBreak.d.ts +5 -0
- package/dist/Chips/atoms/ChipZoneBreak.d.ts.map +1 -0
- package/dist/Chips/index.d.ts +7 -0
- package/dist/Chips/index.d.ts.map +1 -0
- package/dist/Chips/molecules/ChipDropdown.d.ts +31 -0
- package/dist/Chips/molecules/ChipDropdown.d.ts.map +1 -0
- package/dist/Chips/organisms/ChipBar.d.ts +13 -0
- package/dist/Chips/organisms/ChipBar.d.ts.map +1 -0
- package/dist/Form/index.d.ts +3 -2
- package/dist/Form/index.d.ts.map +1 -1
- package/dist/Form/molecules/EditableText.d.ts +40 -0
- package/dist/Form/molecules/EditableText.d.ts.map +1 -0
- package/dist/Global/index.d.ts +57 -0
- package/dist/Global/index.d.ts.map +1 -1
- package/dist/Global/molecules/TopBar.d.ts.map +1 -1
- package/dist/Global/organisms/MobileNavbar.d.ts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +855 -132
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +853 -135
- package/dist/index.modern.js.map +1 -1
- package/dist/theme/ThemeVariables.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2219,6 +2219,9 @@ var ThemeVariables = styled_components.createGlobalStyle`
|
|
|
2219
2219
|
--global-menu-width-closed: 80px;
|
|
2220
2220
|
--global-menu-width-open: 280px;
|
|
2221
2221
|
|
|
2222
|
+
--top-bar-height: 56px;
|
|
2223
|
+
--top-bar-divider-width: 1px;
|
|
2224
|
+
|
|
2222
2225
|
--input-height: 40px;
|
|
2223
2226
|
--input-compact-height: 32px;
|
|
2224
2227
|
--input-required-dot-display: inline-block;
|
|
@@ -2420,7 +2423,7 @@ var Arrow$1 = styled_components.default.div`
|
|
|
2420
2423
|
&.l { left: 24px; }
|
|
2421
2424
|
&.r { right: 24px; }
|
|
2422
2425
|
`;
|
|
2423
|
-
var Container$
|
|
2426
|
+
var Container$72 = styled_components.default.div`
|
|
2424
2427
|
display: flex;
|
|
2425
2428
|
position: relative;
|
|
2426
2429
|
flex: 1;
|
|
@@ -2435,7 +2438,7 @@ var Container$71 = styled_components.default.div`
|
|
|
2435
2438
|
color: var(--grey-10);
|
|
2436
2439
|
`;
|
|
2437
2440
|
var FlexContentPlaceholder = ({ title = "Placeholder" }) => {
|
|
2438
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
2441
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$72, { children: [
|
|
2439
2442
|
title,
|
|
2440
2443
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Arrow$1, {
|
|
2441
2444
|
className: "t l",
|
|
@@ -2572,7 +2575,7 @@ var AlertBar = ({ type = "info", message, hideCloseButton = false }) => {
|
|
|
2572
2575
|
};
|
|
2573
2576
|
//#endregion
|
|
2574
2577
|
//#region src/Alerts/atom/Notification.tsx
|
|
2575
|
-
var Container$
|
|
2578
|
+
var Container$71 = styled_components.default.div`
|
|
2576
2579
|
min-height: 50px;
|
|
2577
2580
|
border-bottom-left-radius: 3px;
|
|
2578
2581
|
border-bottom-right-radius: 3px;
|
|
@@ -2740,7 +2743,7 @@ var Notification = ({ id, type = "info", message, icon = "", isPinned = false, a
|
|
|
2740
2743
|
}
|
|
2741
2744
|
};
|
|
2742
2745
|
}, []);
|
|
2743
|
-
return message && !dismiss ? react_dom.default.createPortal(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
2746
|
+
return message && !dismiss ? react_dom.default.createPortal(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$71, {
|
|
2744
2747
|
$type: type,
|
|
2745
2748
|
$isClosing: slideUp,
|
|
2746
2749
|
$isVisible: isVisible,
|
|
@@ -3142,7 +3145,7 @@ var Button = ({ design = "primary", size = "normal", shadow = false, noPadding =
|
|
|
3142
3145
|
};
|
|
3143
3146
|
//#endregion
|
|
3144
3147
|
//#region src/Form/atoms/ButtonWithIcon.tsx
|
|
3145
|
-
var Container$
|
|
3148
|
+
var Container$70 = styled_components.default.div`
|
|
3146
3149
|
display: inline;
|
|
3147
3150
|
`;
|
|
3148
3151
|
var TextContainer$3 = styled_components.default.div`
|
|
@@ -3258,7 +3261,7 @@ var InnerContainer$3 = styled_components.default.div`
|
|
|
3258
3261
|
`};
|
|
3259
3262
|
`;
|
|
3260
3263
|
var ButtonWithIcon = ({ design = "primary", size = "normal", loading = false, shadow = false, onClick, disabled, position, icon, weight = "regular", children, ...props }) => {
|
|
3261
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
3264
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$70, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
3262
3265
|
noPadding: true,
|
|
3263
3266
|
disabled: disabled || loading,
|
|
3264
3267
|
design,
|
|
@@ -3290,7 +3293,7 @@ var ButtonWithIcon = ({ design = "primary", size = "normal", loading = false, sh
|
|
|
3290
3293
|
};
|
|
3291
3294
|
//#endregion
|
|
3292
3295
|
//#region src/Form/atoms/ButtonWithLoading.tsx
|
|
3293
|
-
var Container$
|
|
3296
|
+
var Container$69 = styled_components.default.div`
|
|
3294
3297
|
display: inline;
|
|
3295
3298
|
`;
|
|
3296
3299
|
var TextContainer$2 = styled_components.default.div`
|
|
@@ -3350,7 +3353,7 @@ var InnerContainer$2 = styled_components.default.div`
|
|
|
3350
3353
|
`}
|
|
3351
3354
|
`;
|
|
3352
3355
|
var ButtonWithLoading = ({ design = "primary", size = "normal", shadow = false, onClick, disabled, position, loading = false, children, ...rest }) => {
|
|
3353
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
3356
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$69, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
3354
3357
|
noPadding: true,
|
|
3355
3358
|
disabled: disabled || loading,
|
|
3356
3359
|
design,
|
|
@@ -3552,7 +3555,7 @@ var IconWrapper$3 = styled_components.default.div`
|
|
|
3552
3555
|
}
|
|
3553
3556
|
}
|
|
3554
3557
|
`;
|
|
3555
|
-
var Container$
|
|
3558
|
+
var Container$68 = styled_components.default.label`
|
|
3556
3559
|
display: inline-block;
|
|
3557
3560
|
user-select: none;
|
|
3558
3561
|
${CheckboxOuter}{
|
|
@@ -3650,7 +3653,7 @@ var Checkbox = ({ indeterminate: _indeterminate = false, disabled, checked = fal
|
|
|
3650
3653
|
setIsChecked(checked);
|
|
3651
3654
|
}, [checked]);
|
|
3652
3655
|
const iconWeight = require_LineUIVideoBase.dimensions.icons.weights.regular;
|
|
3653
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
3656
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$68, {
|
|
3654
3657
|
onChange: customOnChange,
|
|
3655
3658
|
$disabled: disabled,
|
|
3656
3659
|
$visualState: visualState,
|
|
@@ -3672,7 +3675,7 @@ var Checkbox = ({ indeterminate: _indeterminate = false, disabled, checked = fal
|
|
|
3672
3675
|
};
|
|
3673
3676
|
//#endregion
|
|
3674
3677
|
//#region src/Form/atoms/DropArea.tsx
|
|
3675
|
-
var Container$
|
|
3678
|
+
var Container$67 = styled_components.default.div`
|
|
3676
3679
|
${({ $height }) => $height ? `height: ${$height}` : null};
|
|
3677
3680
|
position: relative;
|
|
3678
3681
|
`;
|
|
@@ -3721,7 +3724,7 @@ var DropArea = ({ height, text, dropCallback, ...props }) => {
|
|
|
3721
3724
|
window.removeEventListener("drop", handleWindowDragAndDrop);
|
|
3722
3725
|
};
|
|
3723
3726
|
}, [handleWindowDragAndDrop]);
|
|
3724
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
3727
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$67, {
|
|
3725
3728
|
$height: height,
|
|
3726
3729
|
...props,
|
|
3727
3730
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DragAndDrop, {
|
|
@@ -3864,7 +3867,7 @@ var InputContainer$2 = styled_components.default.div`
|
|
|
3864
3867
|
`}
|
|
3865
3868
|
|
|
3866
3869
|
`;
|
|
3867
|
-
var Container$
|
|
3870
|
+
var Container$66 = styled_components.default.div`
|
|
3868
3871
|
${({ $fieldState, $showFeedback }) => styled_components.css`
|
|
3869
3872
|
|
|
3870
3873
|
display: flex;
|
|
@@ -3923,7 +3926,7 @@ var Input = ({ type = "text", placeholder = "", defaultValue, fieldState = "defa
|
|
|
3923
3926
|
});
|
|
3924
3927
|
}
|
|
3925
3928
|
};
|
|
3926
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
3929
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$66, {
|
|
3927
3930
|
$fieldState: fieldState || "default",
|
|
3928
3931
|
$showFeedback: showFeedback,
|
|
3929
3932
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(InputContainer$2, {
|
|
@@ -3947,7 +3950,7 @@ var Input = ({ type = "text", placeholder = "", defaultValue, fieldState = "defa
|
|
|
3947
3950
|
};
|
|
3948
3951
|
//#endregion
|
|
3949
3952
|
//#region src/Form/atoms/InputFileButton.tsx
|
|
3950
|
-
var Container$
|
|
3953
|
+
var Container$65 = styled_components.default.div``;
|
|
3951
3954
|
var HiddenInput$2 = styled_components.default.input`
|
|
3952
3955
|
display: none;
|
|
3953
3956
|
`;
|
|
@@ -3962,7 +3965,7 @@ var InputFileButton = ({ text, buttonDesign, buttonSize, inputCallback, children
|
|
|
3962
3965
|
const forwardClick = (0, react.useCallback)(() => {
|
|
3963
3966
|
if (fileInputRef.current) fileInputRef.current.click();
|
|
3964
3967
|
}, []);
|
|
3965
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
3968
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$65, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HiddenInput$2, {
|
|
3966
3969
|
...props,
|
|
3967
3970
|
ref: fileInputRef,
|
|
3968
3971
|
type: "file",
|
|
@@ -4100,7 +4103,7 @@ var HiddenInput$1 = styled_components.default.input`
|
|
|
4100
4103
|
padding:0;
|
|
4101
4104
|
opacity: 0;
|
|
4102
4105
|
`;
|
|
4103
|
-
var Container$
|
|
4106
|
+
var Container$64 = styled_components.default.div`
|
|
4104
4107
|
position: relative;
|
|
4105
4108
|
display: inline-block;
|
|
4106
4109
|
width: 18px;
|
|
@@ -4114,7 +4117,7 @@ var RadioButton = ({ id, value, name, currentChecked, disabled = false, required
|
|
|
4114
4117
|
onChangeCallback(checkedValue);
|
|
4115
4118
|
}, [onChangeCallback]);
|
|
4116
4119
|
const isChecked = currentChecked !== void 0 ? currentChecked === value : false;
|
|
4117
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
4120
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$64, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(HiddenInput$1, {
|
|
4118
4121
|
type: "radio",
|
|
4119
4122
|
id,
|
|
4120
4123
|
name,
|
|
@@ -4203,7 +4206,7 @@ var StyledSelect = styled_components.default.select`
|
|
|
4203
4206
|
display: none;
|
|
4204
4207
|
}
|
|
4205
4208
|
`;
|
|
4206
|
-
var Container$
|
|
4209
|
+
var Container$63 = styled_components.default.div`
|
|
4207
4210
|
|
|
4208
4211
|
${({ $activePlaceholder }) => $activePlaceholder && styled_components.css`
|
|
4209
4212
|
${StyledSelect} {
|
|
@@ -4268,7 +4271,7 @@ var SelectField = ({ fieldState = "default", placeholder, label, icon, isCompact
|
|
|
4268
4271
|
})
|
|
4269
4272
|
})
|
|
4270
4273
|
] });
|
|
4271
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
4274
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$63, {
|
|
4272
4275
|
$isCompact: isCompact,
|
|
4273
4276
|
$activePlaceholder: activePlaceholder,
|
|
4274
4277
|
children: label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
@@ -4626,7 +4629,7 @@ var UnitKey = styled_components.default.div`
|
|
|
4626
4629
|
margin-top: 1px;
|
|
4627
4630
|
white-space: nowrap;
|
|
4628
4631
|
`;
|
|
4629
|
-
var Container$
|
|
4632
|
+
var Container$62 = styled_components.default.div`
|
|
4630
4633
|
position: relative;
|
|
4631
4634
|
|
|
4632
4635
|
${({ $fieldState }) => $fieldState && styled_components.css`
|
|
@@ -4637,7 +4640,7 @@ var Container$61 = styled_components.default.div`
|
|
|
4637
4640
|
`};
|
|
4638
4641
|
`;
|
|
4639
4642
|
var SmallInput = ({ unit, label, name, type = "text", placeholder = "", defaultValue, fieldState = "default", required = false, className, children, formAction, ...props }) => {
|
|
4640
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
4643
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$62, {
|
|
4641
4644
|
className,
|
|
4642
4645
|
$fieldState: fieldState || "default",
|
|
4643
4646
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
@@ -4734,7 +4737,7 @@ var IconWrapper$2 = styled_components.default.div`
|
|
|
4734
4737
|
}
|
|
4735
4738
|
`;
|
|
4736
4739
|
var SpinnerWrapper = styled_components.default.div``;
|
|
4737
|
-
var Container$
|
|
4740
|
+
var Container$61 = (0, styled_components.default)(StyledLabel)`
|
|
4738
4741
|
user-select: none;
|
|
4739
4742
|
display: inline-flex;
|
|
4740
4743
|
gap: 8px;
|
|
@@ -4900,7 +4903,7 @@ var Switch = ({ state = "default", leftTheme = "off", rightTheme = "on", labelTe
|
|
|
4900
4903
|
(0, react.useEffect)(() => {
|
|
4901
4904
|
if (innerRef.current) setInnerSize(parseInt(getComputedStyle(innerRef.current).getPropertyValue("--switch-inner-size"), 10));
|
|
4902
4905
|
}, []);
|
|
4903
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
4906
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$61, {
|
|
4904
4907
|
onChange: customOnChange,
|
|
4905
4908
|
onMouseLeave: () => setJustUpdated(false),
|
|
4906
4909
|
$activeTheming: activeTheming,
|
|
@@ -5015,7 +5018,7 @@ var FeedbackMessage = styled_components.default.div`
|
|
|
5015
5018
|
font-weight: 500;
|
|
5016
5019
|
color: var(--white-1);
|
|
5017
5020
|
`;
|
|
5018
|
-
var Container$
|
|
5021
|
+
var Container$60 = styled_components.default.div`
|
|
5019
5022
|
${({ $fieldState, $showFeedback }) => styled_components.css`
|
|
5020
5023
|
display: flex;
|
|
5021
5024
|
position: relative;
|
|
@@ -5077,7 +5080,7 @@ var TextArea = ({ placeholder = "", fieldState = "default", showFeedback = false
|
|
|
5077
5080
|
});
|
|
5078
5081
|
}
|
|
5079
5082
|
};
|
|
5080
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
5083
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$60, {
|
|
5081
5084
|
$fieldState: fieldState || "default",
|
|
5082
5085
|
$showFeedback: showFeedback,
|
|
5083
5086
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledTextArea, {
|
|
@@ -5109,7 +5112,7 @@ var Form = ({ children, spacing = "45px;", action, ...props }) => {
|
|
|
5109
5112
|
//#endregion
|
|
5110
5113
|
//#region src/Form/molecules/ActionButtons.tsx
|
|
5111
5114
|
var StyledIconButton$1 = (0, styled_components.default)(IconButton)``;
|
|
5112
|
-
var Container$
|
|
5115
|
+
var Container$59 = styled_components.default.div`
|
|
5113
5116
|
display: flex;
|
|
5114
5117
|
${StyledIconButton$1} {
|
|
5115
5118
|
margin-left: 15px;
|
|
@@ -5131,7 +5134,7 @@ var Container$58 = styled_components.default.div`
|
|
|
5131
5134
|
`};
|
|
5132
5135
|
`;
|
|
5133
5136
|
var ActionButtons = ({ buttonsConfig, alignment = "right" }) => {
|
|
5134
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
5137
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$59, {
|
|
5135
5138
|
$alignment: alignment,
|
|
5136
5139
|
children: buttonsConfig.map((btn) => {
|
|
5137
5140
|
const { icon, size, weight, color, hoverColor, onClick } = btn;
|
|
@@ -5148,7 +5151,7 @@ var ActionButtons = ({ buttonsConfig, alignment = "right" }) => {
|
|
|
5148
5151
|
};
|
|
5149
5152
|
//#endregion
|
|
5150
5153
|
//#region src/Form/molecules/ButtonsStack.tsx
|
|
5151
|
-
var Container$
|
|
5154
|
+
var Container$58 = styled_components.default.div`
|
|
5152
5155
|
display: flex;
|
|
5153
5156
|
flex-direction: column;
|
|
5154
5157
|
gap: 8px;
|
|
@@ -5157,7 +5160,7 @@ var Container$57 = styled_components.default.div`
|
|
|
5157
5160
|
}
|
|
5158
5161
|
`;
|
|
5159
5162
|
var ButtonsStack = ({ buttons }) => {
|
|
5160
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
5163
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$58, { children: buttons.map(({ id, buttonType, icon, text, iconPosition, size, ...buttonProps }) => {
|
|
5161
5164
|
if (buttonType === "icon-button") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonWithIcon, {
|
|
5162
5165
|
size: size || "small",
|
|
5163
5166
|
icon: icon || "",
|
|
@@ -5530,7 +5533,7 @@ var CropArea = ({ isResizable, hasAspectRatio }) => {
|
|
|
5530
5533
|
};
|
|
5531
5534
|
//#endregion
|
|
5532
5535
|
//#region src/Form/molecules/CropTool.tsx
|
|
5533
|
-
var Container$
|
|
5536
|
+
var Container$57 = styled_components.default.div`
|
|
5534
5537
|
position: fixed;
|
|
5535
5538
|
top: 0;
|
|
5536
5539
|
left: 0;
|
|
@@ -5738,7 +5741,7 @@ var CropTool = ({ title = "Crop Image", cancelBtnTxt = "Cancel", cropBtnTxt = "C
|
|
|
5738
5741
|
if (!viewDimensions.isResizing) return;
|
|
5739
5742
|
viewDimensions.isResizing = false;
|
|
5740
5743
|
}, []);
|
|
5741
|
-
return react_dom.default.createPortal(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
5744
|
+
return react_dom.default.createPortal(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$57, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(InnerContainer$1, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ToolHeader, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(TextGroup$1, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LineUIVideoBase.Icon, {
|
|
5742
5745
|
icon: "Crop",
|
|
5743
5746
|
size: 20,
|
|
5744
5747
|
color: "mono"
|
|
@@ -5798,7 +5801,7 @@ var CropTool = ({ title = "Crop Image", cancelBtnTxt = "Cancel", cropBtnTxt = "C
|
|
|
5798
5801
|
* Marks could also be handle by it.
|
|
5799
5802
|
* Providing quantity of marks and generating the marks array based with unit
|
|
5800
5803
|
*/
|
|
5801
|
-
var Container$
|
|
5804
|
+
var Container$56 = styled_components.default.div``;
|
|
5802
5805
|
var Headers$1 = styled_components.default.div`
|
|
5803
5806
|
font-size: 14px;
|
|
5804
5807
|
color: var(--grey-10);
|
|
@@ -5881,7 +5884,7 @@ var DurationSlider = ({ max, min, defaultValue = 0, title = "", timeUnit, contro
|
|
|
5881
5884
|
if (inputCallback) inputCallback(value);
|
|
5882
5885
|
setSelectedValue(value);
|
|
5883
5886
|
}, [inputCallback]);
|
|
5884
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$
|
|
5887
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$56, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Headers$1, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
5885
5888
|
htmlFor: "duration-slider",
|
|
5886
5889
|
labelText: title
|
|
5887
5890
|
}), getValueTitle(controlledValue ? controlledValue : selectedValue, timeUnit, timeFormat)] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SliderInput, {
|
|
@@ -5894,83 +5897,6 @@ var DurationSlider = ({ max, min, defaultValue = 0, title = "", timeUnit, contro
|
|
|
5894
5897
|
})] });
|
|
5895
5898
|
};
|
|
5896
5899
|
//#endregion
|
|
5897
|
-
//#region src/Form/molecules/PasswordField.tsx
|
|
5898
|
-
var PasswordField = ({ name, label, fieldState, feedbackMessage, required, children, formAction, ...props }) => {
|
|
5899
|
-
const [showValue, setShowValue] = (0, react.useState)(false);
|
|
5900
|
-
const [actionIcon, setActionIcon] = (0, react.useState)("PasswordHide");
|
|
5901
|
-
const actionCallback = () => {
|
|
5902
|
-
const newValue = !showValue;
|
|
5903
|
-
setShowValue(newValue);
|
|
5904
|
-
setActionIcon(newValue ? "PasswordShow" : "PasswordHide");
|
|
5905
|
-
};
|
|
5906
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
5907
|
-
htmlFor: name,
|
|
5908
|
-
labelText: label,
|
|
5909
|
-
required,
|
|
5910
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
|
|
5911
|
-
type: showValue ? "text" : "password",
|
|
5912
|
-
actionCallback,
|
|
5913
|
-
actionIcon,
|
|
5914
|
-
name,
|
|
5915
|
-
fieldState,
|
|
5916
|
-
feedbackMessage,
|
|
5917
|
-
required,
|
|
5918
|
-
...props
|
|
5919
|
-
})
|
|
5920
|
-
});
|
|
5921
|
-
};
|
|
5922
|
-
//#endregion
|
|
5923
|
-
//#region src/Form/molecules/PercentageSlider.tsx
|
|
5924
|
-
var Container$54 = styled_components.default.div``;
|
|
5925
|
-
var Headers = styled_components.default.div`
|
|
5926
|
-
font-size: 14px;
|
|
5927
|
-
color: var(--grey-10);
|
|
5928
|
-
display: flex;
|
|
5929
|
-
justify-content: space-between;
|
|
5930
|
-
margin-bottom: 20px;
|
|
5931
|
-
${({ $allMarkCentered }) => $allMarkCentered ? `padding: 0;` : `padding: 0 6px;`};
|
|
5932
|
-
`;
|
|
5933
|
-
var ValueTitle = (0, styled_components.default)(Label)`
|
|
5934
|
-
font-family: ${({ theme }) => theme.fontFamily.data};
|
|
5935
|
-
`;
|
|
5936
|
-
var getThumbColor = (value) => {
|
|
5937
|
-
if (value <= 10) return "error";
|
|
5938
|
-
if (value > 10 && value <= 30) return "warning";
|
|
5939
|
-
return "success";
|
|
5940
|
-
};
|
|
5941
|
-
var getTitleLevel = (value) => {
|
|
5942
|
-
if (value <= 10) return "Critical Level";
|
|
5943
|
-
if (value > 10 && value <= 30) return "Warning Level";
|
|
5944
|
-
return "Safe Level";
|
|
5945
|
-
};
|
|
5946
|
-
var PercentageSlider = ({ defaultValue = 0, inputCallback, updateThumbColor, updateTitle, showValue, allMarkCentered, ...props }) => {
|
|
5947
|
-
const [selectedValue, setSelectedValue] = (0, react.useState)(defaultValue);
|
|
5948
|
-
const handleSelectedValue = (0, react.useCallback)((value) => {
|
|
5949
|
-
if (inputCallback) inputCallback(value);
|
|
5950
|
-
setSelectedValue(value);
|
|
5951
|
-
}, [inputCallback]);
|
|
5952
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$54, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Headers, {
|
|
5953
|
-
$allMarkCentered: allMarkCentered,
|
|
5954
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
5955
|
-
htmlFor: "percentage-slider",
|
|
5956
|
-
labelText: updateTitle ? updateTitle(selectedValue) : getTitleLevel(selectedValue)
|
|
5957
|
-
}), showValue && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueTitle, {
|
|
5958
|
-
htmlFor: "percentage-slider",
|
|
5959
|
-
labelText: `${selectedValue}%`
|
|
5960
|
-
})]
|
|
5961
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SliderInput, {
|
|
5962
|
-
...props,
|
|
5963
|
-
id: "percentage-slider",
|
|
5964
|
-
max: 100,
|
|
5965
|
-
min: 0,
|
|
5966
|
-
defaultValue,
|
|
5967
|
-
showValue,
|
|
5968
|
-
onChangeCallback: handleSelectedValue,
|
|
5969
|
-
thumbColor: updateThumbColor ? updateThumbColor(selectedValue) : getThumbColor(selectedValue),
|
|
5970
|
-
allMarkCentered
|
|
5971
|
-
})] });
|
|
5972
|
-
};
|
|
5973
|
-
//#endregion
|
|
5974
5900
|
//#region src/hooks/useMediaQuery.ts
|
|
5975
5901
|
/**
|
|
5976
5902
|
* Custom hook that tells you whether a given media query is active.
|
|
@@ -6224,7 +6150,7 @@ var MediaBox = ({ src: incomingSrc, alt, videoOptions = {}, mediaType, hasModalL
|
|
|
6224
6150
|
};
|
|
6225
6151
|
//#endregion
|
|
6226
6152
|
//#region src/Modals/Modal.tsx
|
|
6227
|
-
var Container$
|
|
6153
|
+
var Container$55 = styled_components.default.div`
|
|
6228
6154
|
position: fixed;
|
|
6229
6155
|
top: 0;
|
|
6230
6156
|
left: 0;
|
|
@@ -6299,7 +6225,7 @@ var Modal = ({ isOpen = false, isCloseEnable = true, closeText = "", width = "",
|
|
|
6299
6225
|
if (dismissCallback) dismissCallback();
|
|
6300
6226
|
onDismiss();
|
|
6301
6227
|
}, [onDismiss, dismissCallback]);
|
|
6302
|
-
return isOpen ? react_dom.default.createPortal(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$
|
|
6228
|
+
return isOpen ? react_dom.default.createPortal(/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$55, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LightBox, {
|
|
6303
6229
|
ref: lightBoxRef,
|
|
6304
6230
|
$width: width,
|
|
6305
6231
|
$padding: padding,
|
|
@@ -6631,6 +6557,325 @@ var useTo = () => {
|
|
|
6631
6557
|
return (0, react.useCallback)((url) => () => navigate(url), [navigate]);
|
|
6632
6558
|
};
|
|
6633
6559
|
//#endregion
|
|
6560
|
+
//#region src/Form/molecules/EditableText.tsx
|
|
6561
|
+
var IconSlot = styled_components.default.span`
|
|
6562
|
+
display: flex;
|
|
6563
|
+
flex-shrink: 0;
|
|
6564
|
+
`;
|
|
6565
|
+
var Text = styled_components.default.span`
|
|
6566
|
+
overflow: hidden;
|
|
6567
|
+
white-space: nowrap;
|
|
6568
|
+
text-overflow: ellipsis;
|
|
6569
|
+
`;
|
|
6570
|
+
var Container$54 = styled_components.default.div`
|
|
6571
|
+
display: inline-flex;
|
|
6572
|
+
align-items: center;
|
|
6573
|
+
gap: 8px;
|
|
6574
|
+
min-width: 0;
|
|
6575
|
+
height: 100%;
|
|
6576
|
+
font-family: var(--font-ui);
|
|
6577
|
+
font-size: 14px;
|
|
6578
|
+
font-weight: 500;
|
|
6579
|
+
line-height: 20px;
|
|
6580
|
+
color: var(--grey-12);
|
|
6581
|
+
`;
|
|
6582
|
+
var Trigger$1 = styled_components.default.button`
|
|
6583
|
+
display: inline-flex;
|
|
6584
|
+
align-items: center;
|
|
6585
|
+
gap: 8px;
|
|
6586
|
+
min-width: 0;
|
|
6587
|
+
padding: 0;
|
|
6588
|
+
border: none;
|
|
6589
|
+
background: transparent;
|
|
6590
|
+
cursor: pointer;
|
|
6591
|
+
outline: none;
|
|
6592
|
+
font: inherit;
|
|
6593
|
+
color: inherit;
|
|
6594
|
+
text-align: left;
|
|
6595
|
+
|
|
6596
|
+
& svg [stroke] { stroke: currentColor; }
|
|
6597
|
+
|
|
6598
|
+
${IconSlot} {
|
|
6599
|
+
opacity: 0;
|
|
6600
|
+
transition: opacity var(--speed-normal) var(--easing-primary-in-out);
|
|
6601
|
+
}
|
|
6602
|
+
|
|
6603
|
+
&:hover ${IconSlot},
|
|
6604
|
+
&:focus-visible ${IconSlot} {
|
|
6605
|
+
opacity: 1;
|
|
6606
|
+
}
|
|
6607
|
+
|
|
6608
|
+
&:focus-visible {
|
|
6609
|
+
outline: 2px solid var(--primary-9);
|
|
6610
|
+
outline-offset: 2px;
|
|
6611
|
+
}
|
|
6612
|
+
|
|
6613
|
+
${({ $alwaysShowIcon }) => $alwaysShowIcon && styled_components.css`
|
|
6614
|
+
${IconSlot} { opacity: 1; }
|
|
6615
|
+
`}
|
|
6616
|
+
`;
|
|
6617
|
+
var Field = styled_components.default.input`
|
|
6618
|
+
box-sizing: border-box;
|
|
6619
|
+
height: 24px;
|
|
6620
|
+
width: ${({ $fieldWidth }) => $fieldWidth};
|
|
6621
|
+
max-width: 100%;
|
|
6622
|
+
min-width: 0;
|
|
6623
|
+
padding: 0 8px;
|
|
6624
|
+
border: 1px solid var(--input-default-border-color);
|
|
6625
|
+
border-radius: 3px;
|
|
6626
|
+
background: var(--input-default-background-color);
|
|
6627
|
+
color: var(--input-color-default);
|
|
6628
|
+
font: inherit;
|
|
6629
|
+
outline: none;
|
|
6630
|
+
|
|
6631
|
+
&:focus {
|
|
6632
|
+
border-color: var(--input-default-focused-border-color);
|
|
6633
|
+
box-shadow: 0 3px 3px var(--input-default-focused-shadow-color);
|
|
6634
|
+
}
|
|
6635
|
+
|
|
6636
|
+
&::placeholder {
|
|
6637
|
+
color: var(--input-color-placeholder);
|
|
6638
|
+
font-style: italic;
|
|
6639
|
+
}
|
|
6640
|
+
|
|
6641
|
+
&:lang(ja)::placeholder {
|
|
6642
|
+
font-style: normal;
|
|
6643
|
+
}
|
|
6644
|
+
|
|
6645
|
+
&[readonly] {
|
|
6646
|
+
color: var(--input-color-disabled);
|
|
6647
|
+
}
|
|
6648
|
+
`;
|
|
6649
|
+
var Actions = styled_components.default.div`
|
|
6650
|
+
display: flex;
|
|
6651
|
+
flex-shrink: 0;
|
|
6652
|
+
align-items: center;
|
|
6653
|
+
gap: 8px;
|
|
6654
|
+
`;
|
|
6655
|
+
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 }) => {
|
|
6656
|
+
const [isEditing, setIsEditing] = (0, react.useState)(false);
|
|
6657
|
+
const [isSaving, setIsSaving] = (0, react.useState)(false);
|
|
6658
|
+
const [ownText, setOwnText] = (0, react.useState)(defaultValue ?? "");
|
|
6659
|
+
const isControlled = value !== void 0;
|
|
6660
|
+
const text = isControlled ? value : ownText;
|
|
6661
|
+
const [draft, setDraft] = (0, react.useState)(text);
|
|
6662
|
+
const containerRef = (0, react.useRef)(null);
|
|
6663
|
+
const fieldRef = (0, react.useRef)(null);
|
|
6664
|
+
const triggerRef = (0, react.useRef)(null);
|
|
6665
|
+
const restoreFocus = (0, react.useRef)(false);
|
|
6666
|
+
const setEditing = (0, react.useCallback)((next) => {
|
|
6667
|
+
setIsEditing(next);
|
|
6668
|
+
onEditingChange?.(next);
|
|
6669
|
+
}, [onEditingChange]);
|
|
6670
|
+
const open = (0, react.useCallback)(() => {
|
|
6671
|
+
setDraft(text);
|
|
6672
|
+
setEditing(true);
|
|
6673
|
+
}, [text, setEditing]);
|
|
6674
|
+
const close = (0, react.useCallback)((withFocus) => {
|
|
6675
|
+
restoreFocus.current = withFocus;
|
|
6676
|
+
setEditing(false);
|
|
6677
|
+
}, [setEditing]);
|
|
6678
|
+
(0, react.useEffect)(() => {
|
|
6679
|
+
if (!isEditing) return;
|
|
6680
|
+
fieldRef.current?.focus();
|
|
6681
|
+
fieldRef.current?.select();
|
|
6682
|
+
}, [isEditing]);
|
|
6683
|
+
(0, react.useEffect)(() => {
|
|
6684
|
+
if (isEditing || !restoreFocus.current) return;
|
|
6685
|
+
restoreFocus.current = false;
|
|
6686
|
+
triggerRef.current?.focus();
|
|
6687
|
+
}, [isEditing]);
|
|
6688
|
+
(0, react.useEffect)(() => {
|
|
6689
|
+
if (disabled && isEditing) close(false);
|
|
6690
|
+
}, [
|
|
6691
|
+
disabled,
|
|
6692
|
+
isEditing,
|
|
6693
|
+
close
|
|
6694
|
+
]);
|
|
6695
|
+
const cancel = (0, react.useCallback)((withFocus) => {
|
|
6696
|
+
close(withFocus);
|
|
6697
|
+
onCancel?.();
|
|
6698
|
+
}, [close, onCancel]);
|
|
6699
|
+
const commit = (0, react.useCallback)(async (withFocus) => {
|
|
6700
|
+
if (isSaving) return;
|
|
6701
|
+
const next = draft.trim();
|
|
6702
|
+
if (!next && !allowEmpty) return;
|
|
6703
|
+
if (next === text) {
|
|
6704
|
+
close(withFocus);
|
|
6705
|
+
return;
|
|
6706
|
+
}
|
|
6707
|
+
setIsSaving(true);
|
|
6708
|
+
try {
|
|
6709
|
+
await onSave?.(next);
|
|
6710
|
+
if (!isControlled) setOwnText(next);
|
|
6711
|
+
close(withFocus);
|
|
6712
|
+
} catch {} finally {
|
|
6713
|
+
setIsSaving(false);
|
|
6714
|
+
}
|
|
6715
|
+
}, [
|
|
6716
|
+
isSaving,
|
|
6717
|
+
draft,
|
|
6718
|
+
allowEmpty,
|
|
6719
|
+
text,
|
|
6720
|
+
isControlled,
|
|
6721
|
+
onSave,
|
|
6722
|
+
close
|
|
6723
|
+
]);
|
|
6724
|
+
useClickOutside(containerRef, (0, react.useCallback)(() => {
|
|
6725
|
+
if (!isEditing || isSaving) return;
|
|
6726
|
+
if (saveOnClickOutside) {
|
|
6727
|
+
commit(false);
|
|
6728
|
+
return;
|
|
6729
|
+
}
|
|
6730
|
+
cancel(false);
|
|
6731
|
+
}, [
|
|
6732
|
+
isEditing,
|
|
6733
|
+
isSaving,
|
|
6734
|
+
saveOnClickOutside,
|
|
6735
|
+
commit,
|
|
6736
|
+
cancel
|
|
6737
|
+
]));
|
|
6738
|
+
const handleKeyDown = (0, react.useCallback)((e) => {
|
|
6739
|
+
onKeyDown?.(e);
|
|
6740
|
+
if (e.nativeEvent.isComposing) return;
|
|
6741
|
+
if (e.key === "Enter") {
|
|
6742
|
+
e.preventDefault();
|
|
6743
|
+
commit(true);
|
|
6744
|
+
return;
|
|
6745
|
+
}
|
|
6746
|
+
if (e.key === "Escape") cancel(true);
|
|
6747
|
+
}, [
|
|
6748
|
+
onKeyDown,
|
|
6749
|
+
commit,
|
|
6750
|
+
cancel
|
|
6751
|
+
]);
|
|
6752
|
+
const canSave = allowEmpty || draft.trim().length > 0;
|
|
6753
|
+
if (isEditing) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$54, {
|
|
6754
|
+
ref: containerRef,
|
|
6755
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Field, {
|
|
6756
|
+
...props,
|
|
6757
|
+
ref: fieldRef,
|
|
6758
|
+
type,
|
|
6759
|
+
$fieldWidth: fieldWidth,
|
|
6760
|
+
"aria-label": label,
|
|
6761
|
+
"aria-busy": isSaving,
|
|
6762
|
+
readOnly: isSaving,
|
|
6763
|
+
value: draft,
|
|
6764
|
+
onChange: (e) => setDraft(e.target.value),
|
|
6765
|
+
onKeyDown: handleKeyDown
|
|
6766
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Actions, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ButtonWithLoading, {
|
|
6767
|
+
size: "small",
|
|
6768
|
+
loading: isSaving,
|
|
6769
|
+
disabled: !canSave,
|
|
6770
|
+
"aria-label": isSaving ? savingText : saveText,
|
|
6771
|
+
onClick: () => {
|
|
6772
|
+
commit(true);
|
|
6773
|
+
},
|
|
6774
|
+
children: isSaving ? savingText : saveText
|
|
6775
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button, {
|
|
6776
|
+
design: "secondary",
|
|
6777
|
+
size: "small",
|
|
6778
|
+
disabled: isSaving,
|
|
6779
|
+
onClick: () => cancel(true),
|
|
6780
|
+
children: cancelText
|
|
6781
|
+
})] })]
|
|
6782
|
+
});
|
|
6783
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$54, {
|
|
6784
|
+
ref: containerRef,
|
|
6785
|
+
children: disabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, { children: text }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Trigger$1, {
|
|
6786
|
+
ref: triggerRef,
|
|
6787
|
+
type: "button",
|
|
6788
|
+
$alwaysShowIcon: alwaysShowEditIcon || text === "",
|
|
6789
|
+
"aria-label": `${text}, ${editText}`,
|
|
6790
|
+
onClick: open,
|
|
6791
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, { children: text }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconSlot, {
|
|
6792
|
+
"aria-hidden": "true",
|
|
6793
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LineUIVideoBase.Icon, {
|
|
6794
|
+
icon: editIcon,
|
|
6795
|
+
size: 12
|
|
6796
|
+
})
|
|
6797
|
+
})]
|
|
6798
|
+
})
|
|
6799
|
+
});
|
|
6800
|
+
};
|
|
6801
|
+
//#endregion
|
|
6802
|
+
//#region src/Form/molecules/PasswordField.tsx
|
|
6803
|
+
var PasswordField = ({ name, label, fieldState, feedbackMessage, required, children, formAction, ...props }) => {
|
|
6804
|
+
const [showValue, setShowValue] = (0, react.useState)(false);
|
|
6805
|
+
const [actionIcon, setActionIcon] = (0, react.useState)("PasswordHide");
|
|
6806
|
+
const actionCallback = () => {
|
|
6807
|
+
const newValue = !showValue;
|
|
6808
|
+
setShowValue(newValue);
|
|
6809
|
+
setActionIcon(newValue ? "PasswordShow" : "PasswordHide");
|
|
6810
|
+
};
|
|
6811
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
6812
|
+
htmlFor: name,
|
|
6813
|
+
labelText: label,
|
|
6814
|
+
required,
|
|
6815
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Input, {
|
|
6816
|
+
type: showValue ? "text" : "password",
|
|
6817
|
+
actionCallback,
|
|
6818
|
+
actionIcon,
|
|
6819
|
+
name,
|
|
6820
|
+
fieldState,
|
|
6821
|
+
feedbackMessage,
|
|
6822
|
+
required,
|
|
6823
|
+
...props
|
|
6824
|
+
})
|
|
6825
|
+
});
|
|
6826
|
+
};
|
|
6827
|
+
//#endregion
|
|
6828
|
+
//#region src/Form/molecules/PercentageSlider.tsx
|
|
6829
|
+
var Container$53 = styled_components.default.div``;
|
|
6830
|
+
var Headers = styled_components.default.div`
|
|
6831
|
+
font-size: 14px;
|
|
6832
|
+
color: var(--grey-10);
|
|
6833
|
+
display: flex;
|
|
6834
|
+
justify-content: space-between;
|
|
6835
|
+
margin-bottom: 20px;
|
|
6836
|
+
${({ $allMarkCentered }) => $allMarkCentered ? `padding: 0;` : `padding: 0 6px;`};
|
|
6837
|
+
`;
|
|
6838
|
+
var ValueTitle = (0, styled_components.default)(Label)`
|
|
6839
|
+
font-family: ${({ theme }) => theme.fontFamily.data};
|
|
6840
|
+
`;
|
|
6841
|
+
var getThumbColor = (value) => {
|
|
6842
|
+
if (value <= 10) return "error";
|
|
6843
|
+
if (value > 10 && value <= 30) return "warning";
|
|
6844
|
+
return "success";
|
|
6845
|
+
};
|
|
6846
|
+
var getTitleLevel = (value) => {
|
|
6847
|
+
if (value <= 10) return "Critical Level";
|
|
6848
|
+
if (value > 10 && value <= 30) return "Warning Level";
|
|
6849
|
+
return "Safe Level";
|
|
6850
|
+
};
|
|
6851
|
+
var PercentageSlider = ({ defaultValue = 0, inputCallback, updateThumbColor, updateTitle, showValue, allMarkCentered, ...props }) => {
|
|
6852
|
+
const [selectedValue, setSelectedValue] = (0, react.useState)(defaultValue);
|
|
6853
|
+
const handleSelectedValue = (0, react.useCallback)((value) => {
|
|
6854
|
+
if (inputCallback) inputCallback(value);
|
|
6855
|
+
setSelectedValue(value);
|
|
6856
|
+
}, [inputCallback]);
|
|
6857
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$53, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Headers, {
|
|
6858
|
+
$allMarkCentered: allMarkCentered,
|
|
6859
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
|
|
6860
|
+
htmlFor: "percentage-slider",
|
|
6861
|
+
labelText: updateTitle ? updateTitle(selectedValue) : getTitleLevel(selectedValue)
|
|
6862
|
+
}), showValue && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueTitle, {
|
|
6863
|
+
htmlFor: "percentage-slider",
|
|
6864
|
+
labelText: `${selectedValue}%`
|
|
6865
|
+
})]
|
|
6866
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SliderInput, {
|
|
6867
|
+
...props,
|
|
6868
|
+
id: "percentage-slider",
|
|
6869
|
+
max: 100,
|
|
6870
|
+
min: 0,
|
|
6871
|
+
defaultValue,
|
|
6872
|
+
showValue,
|
|
6873
|
+
onChangeCallback: handleSelectedValue,
|
|
6874
|
+
thumbColor: updateThumbColor ? updateThumbColor(selectedValue) : getThumbColor(selectedValue),
|
|
6875
|
+
allMarkCentered
|
|
6876
|
+
})] });
|
|
6877
|
+
};
|
|
6878
|
+
//#endregion
|
|
6634
6879
|
//#region src/Form/atoms/SplitButtonOption.tsx
|
|
6635
6880
|
var StyledButton$5 = styled_components.default.button`
|
|
6636
6881
|
${resetButtonStyles}
|
|
@@ -12409,6 +12654,407 @@ var TagList = ({ tagsConfig }) => {
|
|
|
12409
12654
|
}) });
|
|
12410
12655
|
};
|
|
12411
12656
|
//#endregion
|
|
12657
|
+
//#region src/Chips/ChipCompactContext.tsx
|
|
12658
|
+
var ChipCompactContext = (0, react.createContext)(false);
|
|
12659
|
+
//#endregion
|
|
12660
|
+
//#region src/Chips/atoms/ChipButton.tsx
|
|
12661
|
+
var collapse = styled_components.keyframes`
|
|
12662
|
+
to {
|
|
12663
|
+
width: 0;
|
|
12664
|
+
padding-left: 0;
|
|
12665
|
+
padding-right: 0;
|
|
12666
|
+
opacity: 0;
|
|
12667
|
+
border-left-width: 0;
|
|
12668
|
+
}
|
|
12669
|
+
`;
|
|
12670
|
+
var StyledChip = styled_components.default.button`
|
|
12671
|
+
position: relative;
|
|
12672
|
+
display: flex;
|
|
12673
|
+
align-items: center;
|
|
12674
|
+
justify-content: center;
|
|
12675
|
+
gap: 8px;
|
|
12676
|
+
width: 56px;
|
|
12677
|
+
height: 56px;
|
|
12678
|
+
padding: 0;
|
|
12679
|
+
border: none;
|
|
12680
|
+
background: transparent;
|
|
12681
|
+
cursor: pointer;
|
|
12682
|
+
outline: none;
|
|
12683
|
+
box-sizing: border-box;
|
|
12684
|
+
font-family: var(--font-ui);
|
|
12685
|
+
font-size: 14px;
|
|
12686
|
+
font-weight: 500;
|
|
12687
|
+
line-height: 20px;
|
|
12688
|
+
color: var(--grey-12);
|
|
12689
|
+
transition:
|
|
12690
|
+
color var(--speed-normal) var(--easing-primary-in-out),
|
|
12691
|
+
background-color var(--speed-normal) var(--easing-primary-in-out);
|
|
12692
|
+
|
|
12693
|
+
${({ $showDivider }) => $showDivider && styled_components.css`border-left: 1px solid var(--grey-4);`}
|
|
12694
|
+
|
|
12695
|
+
& svg [stroke] { stroke: var(--grey-12); }
|
|
12696
|
+
|
|
12697
|
+
&::after {
|
|
12698
|
+
content: '';
|
|
12699
|
+
position: absolute;
|
|
12700
|
+
bottom: 0;
|
|
12701
|
+
left: -1px;
|
|
12702
|
+
right: -1px;
|
|
12703
|
+
height: 4px;
|
|
12704
|
+
background-color: transparent;
|
|
12705
|
+
transition: background-color var(--speed-normal) var(--easing-primary-in-out);
|
|
12706
|
+
}
|
|
12707
|
+
&:hover:enabled::after { background-color: var(--primary-6); }
|
|
12708
|
+
|
|
12709
|
+
&:focus-visible {
|
|
12710
|
+
outline: 2px solid var(--primary-9);
|
|
12711
|
+
outline-offset: -2px;
|
|
12712
|
+
}
|
|
12713
|
+
|
|
12714
|
+
${({ $isCompact }) => $isCompact && styled_components.css`
|
|
12715
|
+
width: auto;
|
|
12716
|
+
height: 100%;
|
|
12717
|
+
min-height: 32px;
|
|
12718
|
+
padding: 0 12px;
|
|
12719
|
+
justify-content: flex-start;
|
|
12720
|
+
white-space: nowrap;
|
|
12721
|
+
|
|
12722
|
+
&::after { height: 2px; }
|
|
12723
|
+
`}
|
|
12724
|
+
|
|
12725
|
+
${({ $selected, $barOnly }) => $selected && styled_components.css`
|
|
12726
|
+
${!$barOnly && styled_components.css`
|
|
12727
|
+
background-color: var(--primary-a3);
|
|
12728
|
+
color: var(--primary-11);
|
|
12729
|
+
& svg [stroke] { stroke: var(--primary-11); }
|
|
12730
|
+
`}
|
|
12731
|
+
&::after { background-color: var(--primary-9); }
|
|
12732
|
+
&:hover:enabled::after { background-color: var(--primary-9); }
|
|
12733
|
+
`}
|
|
12734
|
+
|
|
12735
|
+
&:disabled { cursor: not-allowed; opacity: 0.5; }
|
|
12736
|
+
|
|
12737
|
+
${({ $leaving }) => $leaving && styled_components.css`
|
|
12738
|
+
overflow: hidden;
|
|
12739
|
+
min-width: 0;
|
|
12740
|
+
pointer-events: none;
|
|
12741
|
+
animation: ${collapse} var(--speed-fast) var(--easing-primary-in-out) forwards;
|
|
12742
|
+
|
|
12743
|
+
@media (prefers-reduced-motion: reduce) { animation: none; }
|
|
12744
|
+
`}
|
|
12745
|
+
`;
|
|
12746
|
+
var ChipButton = ({ variant = "text", isCompact, barOnly = false, icon, label, selected = false, noDivider = false, leaving = false, onLeaveEnd, onAnimationEnd, children, ...props }) => {
|
|
12747
|
+
const showDivider = !noDivider;
|
|
12748
|
+
const barIsCompact = (0, react.useContext)(ChipCompactContext);
|
|
12749
|
+
const compact = isCompact ?? barIsCompact;
|
|
12750
|
+
const showIcon = variant !== "text" && !!icon;
|
|
12751
|
+
const showText = variant !== "icon" || !icon;
|
|
12752
|
+
const isMenuButton = props["aria-haspopup"] !== void 0;
|
|
12753
|
+
const chipRef = (0, react.useRef)(null);
|
|
12754
|
+
(0, react.useLayoutEffect)(() => {
|
|
12755
|
+
const chip = chipRef.current;
|
|
12756
|
+
if (!chip) return;
|
|
12757
|
+
chip.style.width = leaving && compact ? `${chip.offsetWidth}px` : "";
|
|
12758
|
+
}, [leaving, compact]);
|
|
12759
|
+
const hasFired = (0, react.useRef)(false);
|
|
12760
|
+
const fireLeaveEnd = (0, react.useCallback)(() => {
|
|
12761
|
+
if (hasFired.current) return;
|
|
12762
|
+
hasFired.current = true;
|
|
12763
|
+
onLeaveEnd?.();
|
|
12764
|
+
}, [onLeaveEnd]);
|
|
12765
|
+
(0, react.useEffect)(() => {
|
|
12766
|
+
if (!leaving) {
|
|
12767
|
+
hasFired.current = false;
|
|
12768
|
+
return;
|
|
12769
|
+
}
|
|
12770
|
+
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) fireLeaveEnd();
|
|
12771
|
+
}, [leaving, fireLeaveEnd]);
|
|
12772
|
+
const handleAnimationEnd = (0, react.useCallback)((e) => {
|
|
12773
|
+
onAnimationEnd?.(e);
|
|
12774
|
+
if (leaving && e.target === e.currentTarget) fireLeaveEnd();
|
|
12775
|
+
}, [
|
|
12776
|
+
leaving,
|
|
12777
|
+
fireLeaveEnd,
|
|
12778
|
+
onAnimationEnd
|
|
12779
|
+
]);
|
|
12780
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledChip, {
|
|
12781
|
+
ref: chipRef,
|
|
12782
|
+
type: "button",
|
|
12783
|
+
"aria-pressed": isMenuButton ? void 0 : selected,
|
|
12784
|
+
$selected: selected,
|
|
12785
|
+
$showDivider: showDivider,
|
|
12786
|
+
$leaving: leaving,
|
|
12787
|
+
$isCompact: compact,
|
|
12788
|
+
$barOnly: barOnly,
|
|
12789
|
+
...props,
|
|
12790
|
+
onAnimationEnd: handleAnimationEnd,
|
|
12791
|
+
children: [showIcon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LineUIVideoBase.Icon, {
|
|
12792
|
+
icon,
|
|
12793
|
+
size: 16
|
|
12794
|
+
}) : null, showText ? label ?? children : null]
|
|
12795
|
+
});
|
|
12796
|
+
};
|
|
12797
|
+
//#endregion
|
|
12798
|
+
//#region src/Chips/atoms/ChipZoneBreak.tsx
|
|
12799
|
+
var Break = styled_components.default.div`
|
|
12800
|
+
box-sizing: border-box;
|
|
12801
|
+
flex-shrink: 0;
|
|
12802
|
+
width: 12px;
|
|
12803
|
+
height: 56px;
|
|
12804
|
+
background-color: var(--grey-3);
|
|
12805
|
+
border-left: 1px solid var(--grey-4);
|
|
12806
|
+
border-right: 1px solid var(--grey-4);
|
|
12807
|
+
`;
|
|
12808
|
+
var ChipZoneBreak = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Break, {
|
|
12809
|
+
"aria-hidden": "true",
|
|
12810
|
+
...props
|
|
12811
|
+
});
|
|
12812
|
+
//#endregion
|
|
12813
|
+
//#region src/Chips/molecules/ChipDropdown.tsx
|
|
12814
|
+
var Wrapper = styled_components.default.div`
|
|
12815
|
+
position: relative;
|
|
12816
|
+
display: inline-flex;
|
|
12817
|
+
`;
|
|
12818
|
+
var Trigger = (0, styled_components.default)(ChipButton)`
|
|
12819
|
+
&& {
|
|
12820
|
+
background-color: transparent;
|
|
12821
|
+
|
|
12822
|
+
${({ $labelled }) => $labelled && styled_components.css`
|
|
12823
|
+
width: auto;
|
|
12824
|
+
padding: 0 16px 0 14px;
|
|
12825
|
+
gap: 8px;
|
|
12826
|
+
justify-content: flex-start;
|
|
12827
|
+
white-space: nowrap;
|
|
12828
|
+
color: var(--grey-12);
|
|
12829
|
+
& svg [stroke] { stroke: var(--grey-12); }
|
|
12830
|
+
`}
|
|
12831
|
+
}
|
|
12832
|
+
`;
|
|
12833
|
+
var Menu = styled_components.default.div`
|
|
12834
|
+
position: absolute;
|
|
12835
|
+
top: calc(100% + 8px);
|
|
12836
|
+
left: -1px;
|
|
12837
|
+
z-index: 100;
|
|
12838
|
+
display: flex;
|
|
12839
|
+
flex-direction: column;
|
|
12840
|
+
align-items: stretch;
|
|
12841
|
+
min-width: 216px;
|
|
12842
|
+
padding: 4px 0;
|
|
12843
|
+
background: var(--grey-1);
|
|
12844
|
+
border: 1px solid var(--grey-4);
|
|
12845
|
+
border-radius: 4px;
|
|
12846
|
+
box-shadow: 0px 5px 25px 0px var(--filter-button-shadow-color);
|
|
12847
|
+
`;
|
|
12848
|
+
var MenuItem = styled_components.default.button`
|
|
12849
|
+
display: flex;
|
|
12850
|
+
align-items: center;
|
|
12851
|
+
gap: 4px;
|
|
12852
|
+
width: 100%;
|
|
12853
|
+
height: var(--button-height, 32px);
|
|
12854
|
+
padding: 3px 8px;
|
|
12855
|
+
border: none;
|
|
12856
|
+
border-bottom: 1px solid var(--grey-7);
|
|
12857
|
+
background: transparent;
|
|
12858
|
+
cursor: pointer;
|
|
12859
|
+
font-family: var(--font-ui);
|
|
12860
|
+
font-size: 14px;
|
|
12861
|
+
font-weight: 500;
|
|
12862
|
+
line-height: 20px;
|
|
12863
|
+
color: var(--grey-12);
|
|
12864
|
+
text-align: left;
|
|
12865
|
+
transition: background-color var(--speed-fast) var(--easing-primary-in-out);
|
|
12866
|
+
|
|
12867
|
+
& svg [stroke] { stroke: var(--grey-12); }
|
|
12868
|
+
|
|
12869
|
+
&:last-child { border-bottom: none; }
|
|
12870
|
+
&:hover:enabled { background-color: var(--grey-3); }
|
|
12871
|
+
&:disabled { cursor: not-allowed; opacity: 0.5; }
|
|
12872
|
+
|
|
12873
|
+
${({ $current }) => $current && styled_components.css`
|
|
12874
|
+
background-color: var(--grey-4);
|
|
12875
|
+
&:hover:enabled { background-color: var(--grey-5); }
|
|
12876
|
+
`}
|
|
12877
|
+
`;
|
|
12878
|
+
var CheckSlot = styled_components.default.span`
|
|
12879
|
+
display: flex;
|
|
12880
|
+
margin-left: auto;
|
|
12881
|
+
`;
|
|
12882
|
+
var ChipDropdown = ({ items, icon = "FilterEllipsis", label, selectedId, checkIcon = "Success", triggerLabel, noDivider = false, disabled = false, onOpenChange, onKeyDown, ...props }) => {
|
|
12883
|
+
const [isOpen, setIsOpen] = (0, react.useState)(false);
|
|
12884
|
+
const wrapperRef = (0, react.useRef)(null);
|
|
12885
|
+
const isLabelled = Boolean(label);
|
|
12886
|
+
const marksCurrent = selectedId !== void 0;
|
|
12887
|
+
const ariaLabel = triggerLabel ?? (isLabelled ? void 0 : "Space actions");
|
|
12888
|
+
const setOpen = (0, react.useCallback)((next) => {
|
|
12889
|
+
setIsOpen(next);
|
|
12890
|
+
onOpenChange?.(next);
|
|
12891
|
+
}, [onOpenChange]);
|
|
12892
|
+
const close = (0, react.useCallback)(() => setOpen(false), [setOpen]);
|
|
12893
|
+
const toggle = (0, react.useCallback)(() => setOpen(!isOpen), [isOpen, setOpen]);
|
|
12894
|
+
useClickOutside(wrapperRef, (0, react.useCallback)(() => {
|
|
12895
|
+
if (isOpen) close();
|
|
12896
|
+
}, [isOpen, close]));
|
|
12897
|
+
(0, react.useEffect)(() => {
|
|
12898
|
+
if (disabled && isOpen) close();
|
|
12899
|
+
}, [
|
|
12900
|
+
disabled,
|
|
12901
|
+
isOpen,
|
|
12902
|
+
close
|
|
12903
|
+
]);
|
|
12904
|
+
const handleKeyDown = (0, react.useCallback)((e) => {
|
|
12905
|
+
onKeyDown?.(e);
|
|
12906
|
+
if (e.key === "Escape" && isOpen) close();
|
|
12907
|
+
}, [
|
|
12908
|
+
isOpen,
|
|
12909
|
+
close,
|
|
12910
|
+
onKeyDown
|
|
12911
|
+
]);
|
|
12912
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Wrapper, {
|
|
12913
|
+
ref: wrapperRef,
|
|
12914
|
+
...props,
|
|
12915
|
+
onKeyDown: handleKeyDown,
|
|
12916
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Trigger, {
|
|
12917
|
+
$labelled: isLabelled,
|
|
12918
|
+
variant: isLabelled ? void 0 : "icon",
|
|
12919
|
+
icon: isLabelled ? void 0 : icon,
|
|
12920
|
+
selected: isOpen,
|
|
12921
|
+
noDivider,
|
|
12922
|
+
disabled,
|
|
12923
|
+
"aria-label": ariaLabel,
|
|
12924
|
+
"aria-haspopup": "menu",
|
|
12925
|
+
"aria-expanded": isOpen,
|
|
12926
|
+
onClick: toggle,
|
|
12927
|
+
children: isLabelled ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
12928
|
+
icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LineUIVideoBase.Icon, {
|
|
12929
|
+
icon,
|
|
12930
|
+
size: 18
|
|
12931
|
+
}) : null,
|
|
12932
|
+
label,
|
|
12933
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LineUIVideoBase.Icon, {
|
|
12934
|
+
icon: "Down",
|
|
12935
|
+
size: 12
|
|
12936
|
+
})
|
|
12937
|
+
] }) : null
|
|
12938
|
+
}), isOpen && !disabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Menu, {
|
|
12939
|
+
role: "menu",
|
|
12940
|
+
children: items.map((item) => {
|
|
12941
|
+
const isCurrent = marksCurrent && item.id === selectedId;
|
|
12942
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(MenuItem, {
|
|
12943
|
+
type: "button",
|
|
12944
|
+
role: marksCurrent ? "menuitemradio" : "menuitem",
|
|
12945
|
+
"aria-checked": marksCurrent ? isCurrent : void 0,
|
|
12946
|
+
$current: isCurrent,
|
|
12947
|
+
disabled: item.disabled,
|
|
12948
|
+
onClick: () => {
|
|
12949
|
+
item.onClick?.();
|
|
12950
|
+
close();
|
|
12951
|
+
},
|
|
12952
|
+
children: [
|
|
12953
|
+
item.icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LineUIVideoBase.Icon, {
|
|
12954
|
+
icon: item.icon,
|
|
12955
|
+
size: 14
|
|
12956
|
+
}) : null,
|
|
12957
|
+
item.label,
|
|
12958
|
+
isCurrent ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CheckSlot, {
|
|
12959
|
+
"aria-hidden": "true",
|
|
12960
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LineUIVideoBase.Icon, {
|
|
12961
|
+
icon: checkIcon,
|
|
12962
|
+
size: 14,
|
|
12963
|
+
weight: "light"
|
|
12964
|
+
})
|
|
12965
|
+
}) : null
|
|
12966
|
+
]
|
|
12967
|
+
}, item.id);
|
|
12968
|
+
})
|
|
12969
|
+
}) : null]
|
|
12970
|
+
});
|
|
12971
|
+
};
|
|
12972
|
+
//#endregion
|
|
12973
|
+
//#region src/Chips/organisms/ChipBar.tsx
|
|
12974
|
+
var Bar = styled_components.default.div`
|
|
12975
|
+
display: flex;
|
|
12976
|
+
align-items: center;
|
|
12977
|
+
height: 56px;
|
|
12978
|
+
|
|
12979
|
+
& > * {
|
|
12980
|
+
flex-shrink: 0;
|
|
12981
|
+
}
|
|
12982
|
+
|
|
12983
|
+
${({ $isCompact }) => $isCompact && styled_components.css`
|
|
12984
|
+
height: 100%;
|
|
12985
|
+
min-height: 32px;
|
|
12986
|
+
`}
|
|
12987
|
+
`;
|
|
12988
|
+
var NAV_KEYS = [
|
|
12989
|
+
"ArrowLeft",
|
|
12990
|
+
"ArrowRight",
|
|
12991
|
+
"Home",
|
|
12992
|
+
"End"
|
|
12993
|
+
];
|
|
12994
|
+
var ChipBar = ({ children, isCompact = false, leadingDivider = false, onKeyDown, onFocus, ...props }) => {
|
|
12995
|
+
const barRef = (0, react.useRef)(null);
|
|
12996
|
+
const [activeIndex, setActiveIndex] = (0, react.useState)(0);
|
|
12997
|
+
const getCells = (0, react.useCallback)(() => {
|
|
12998
|
+
const root = barRef.current;
|
|
12999
|
+
if (!root) return [];
|
|
13000
|
+
return Array.from(root.querySelectorAll("button:not(:disabled)")).filter((el) => !el.closest("[role=\"menu\"]"));
|
|
13001
|
+
}, []);
|
|
13002
|
+
(0, react.useEffect)(() => {
|
|
13003
|
+
const root = barRef.current;
|
|
13004
|
+
if (!root) return;
|
|
13005
|
+
const sync = () => {
|
|
13006
|
+
const focusables = getCells();
|
|
13007
|
+
const index = Math.min(activeIndex, focusables.length - 1);
|
|
13008
|
+
focusables.forEach((cell, i) => {
|
|
13009
|
+
cell.tabIndex = i === index ? 0 : -1;
|
|
13010
|
+
});
|
|
13011
|
+
};
|
|
13012
|
+
sync();
|
|
13013
|
+
const observer = new MutationObserver(sync);
|
|
13014
|
+
observer.observe(root, {
|
|
13015
|
+
childList: true,
|
|
13016
|
+
subtree: true,
|
|
13017
|
+
attributes: true,
|
|
13018
|
+
attributeFilter: ["disabled"]
|
|
13019
|
+
});
|
|
13020
|
+
return () => observer.disconnect();
|
|
13021
|
+
}, [activeIndex, getCells]);
|
|
13022
|
+
const cells = react.Children.toArray(children).filter(react.isValidElement);
|
|
13023
|
+
const handleFocus = (0, react.useCallback)((e) => {
|
|
13024
|
+
onFocus?.(e);
|
|
13025
|
+
const index = getCells().indexOf(e.target);
|
|
13026
|
+
if (index >= 0) setActiveIndex(index);
|
|
13027
|
+
}, [getCells, onFocus]);
|
|
13028
|
+
const handleKeyDown = (0, react.useCallback)((e) => {
|
|
13029
|
+
onKeyDown?.(e);
|
|
13030
|
+
if (!NAV_KEYS.includes(e.key)) return;
|
|
13031
|
+
if (barRef.current?.querySelector("[role=\"menu\"]")) return;
|
|
13032
|
+
const focusables = getCells();
|
|
13033
|
+
const current = focusables.indexOf(document.activeElement);
|
|
13034
|
+
if (focusables.length === 0 || current < 0) return;
|
|
13035
|
+
e.preventDefault();
|
|
13036
|
+
let next = current;
|
|
13037
|
+
if (e.key === "ArrowLeft") next = (current - 1 + focusables.length) % focusables.length;
|
|
13038
|
+
if (e.key === "ArrowRight") next = (current + 1) % focusables.length;
|
|
13039
|
+
if (e.key === "Home") next = 0;
|
|
13040
|
+
if (e.key === "End") next = focusables.length - 1;
|
|
13041
|
+
focusables[next]?.focus();
|
|
13042
|
+
}, [getCells, onKeyDown]);
|
|
13043
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ChipCompactContext.Provider, {
|
|
13044
|
+
value: isCompact,
|
|
13045
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Bar, {
|
|
13046
|
+
ref: barRef,
|
|
13047
|
+
role: "toolbar",
|
|
13048
|
+
"aria-label": "Chip bar",
|
|
13049
|
+
$isCompact: isCompact,
|
|
13050
|
+
...props,
|
|
13051
|
+
onFocus: handleFocus,
|
|
13052
|
+
onKeyDown: handleKeyDown,
|
|
13053
|
+
children: cells.map((child, i) => i === 0 && !leadingDivider && typeof child.type !== "string" ? (0, react.cloneElement)(child, { noDivider: true }) : child)
|
|
13054
|
+
})
|
|
13055
|
+
});
|
|
13056
|
+
};
|
|
13057
|
+
//#endregion
|
|
12412
13058
|
//#region src/Modals/ConfirmationModal.tsx
|
|
12413
13059
|
var Container$20 = styled_components.default.div``;
|
|
12414
13060
|
var Title$3 = styled_components.default.div`
|
|
@@ -13220,7 +13866,7 @@ var Container$17 = styled_components.default.div`
|
|
|
13220
13866
|
width: 100%;
|
|
13221
13867
|
display: flex;
|
|
13222
13868
|
`;
|
|
13223
|
-
var LeftArea = styled_components.default.div`
|
|
13869
|
+
var LeftArea$1 = styled_components.default.div`
|
|
13224
13870
|
display: flex;
|
|
13225
13871
|
align-items: center;
|
|
13226
13872
|
gap: var(--columnPadding, 16px);
|
|
@@ -13305,7 +13951,7 @@ var UtilityHeader = ({ showBreadcrumbs = true, breadcrumbs = [], showHomeIcon =
|
|
|
13305
13951
|
const { isLarge } = useBreakpoints();
|
|
13306
13952
|
const iconInGutter = $iconInGutter !== void 0 ? $iconInGutter : isLarge;
|
|
13307
13953
|
const hasBreadcrumbs = showBreadcrumbs && breadcrumbs.length > 0;
|
|
13308
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$17, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LeftArea, { children: [back && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UtilityHeaderBack, {
|
|
13954
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$17, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LeftArea$1, { children: [back && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UtilityHeaderBack, {
|
|
13309
13955
|
$showDivider: hasBreadcrumbs,
|
|
13310
13956
|
$iconInGutter: iconInGutter,
|
|
13311
13957
|
...back
|
|
@@ -14100,26 +14746,63 @@ var NotificationsHistory = ({ read, unread, noNotificationsText = "No new notifi
|
|
|
14100
14746
|
};
|
|
14101
14747
|
//#endregion
|
|
14102
14748
|
//#region src/Global/molecules/TopBar.tsx
|
|
14749
|
+
var RESERVED_DRAWER_IDS = [
|
|
14750
|
+
"user",
|
|
14751
|
+
"notifications",
|
|
14752
|
+
"custom"
|
|
14753
|
+
];
|
|
14754
|
+
var TopBarHeightVars = styled_components.createGlobalStyle`
|
|
14755
|
+
:root {
|
|
14756
|
+
--top-bar-bottom-height: ${({ $bottomHeight }) => $bottomHeight};
|
|
14757
|
+
--top-bar-total-height: calc(var(--top-bar-height, 56px) + var(--top-bar-bottom-height, 0px));
|
|
14758
|
+
}
|
|
14759
|
+
`;
|
|
14103
14760
|
var Container$10 = styled_components.default.div`
|
|
14104
14761
|
z-index: 9;
|
|
14105
14762
|
position: sticky;
|
|
14106
14763
|
top: 0;
|
|
14107
|
-
height: 56px;
|
|
14108
|
-
padding: 0 16px 0 24px;
|
|
14109
14764
|
width: 100%;
|
|
14110
14765
|
display: flex;
|
|
14111
|
-
|
|
14766
|
+
flex-direction: column;
|
|
14112
14767
|
align-self: flex-start;
|
|
14113
|
-
border-bottom: 1px solid var(--dividing-line);
|
|
14768
|
+
border-bottom: var(--top-bar-divider-width, 1px) solid var(--dividing-line);
|
|
14114
14769
|
background: var(--grey-2);
|
|
14115
14770
|
box-shadow: 5px 0px 10px 0px var(--primary-a2);
|
|
14116
14771
|
`;
|
|
14772
|
+
var BarRow = styled_components.default.div`
|
|
14773
|
+
height: calc(var(--top-bar-height, 56px) - var(--top-bar-divider-width, 1px));
|
|
14774
|
+
padding: 0 16px 0 24px;
|
|
14775
|
+
display: flex;
|
|
14776
|
+
justify-content: space-between;
|
|
14777
|
+
`;
|
|
14778
|
+
var BottomArea = styled_components.default.div`
|
|
14779
|
+
position: relative;
|
|
14780
|
+
box-sizing: border-box;
|
|
14781
|
+
height: var(--top-bar-bottom-height, 32px);
|
|
14782
|
+
display: flex;
|
|
14783
|
+
align-items: center;
|
|
14784
|
+
background: var(--global-element-background);
|
|
14785
|
+
|
|
14786
|
+
&::before {
|
|
14787
|
+
content: '';
|
|
14788
|
+
position: absolute;
|
|
14789
|
+
top: 0;
|
|
14790
|
+
left: 0;
|
|
14791
|
+
right: 0;
|
|
14792
|
+
height: 1px;
|
|
14793
|
+
background: var(--dividing-line);
|
|
14794
|
+
}
|
|
14795
|
+
`;
|
|
14117
14796
|
var RightArea = styled_components.default.div`
|
|
14118
14797
|
display: flex;
|
|
14119
14798
|
align-items: center;
|
|
14120
14799
|
gap: 24px;
|
|
14121
14800
|
height: 100%;
|
|
14122
14801
|
`;
|
|
14802
|
+
var LeftArea = styled_components.default.div`
|
|
14803
|
+
display: flex;
|
|
14804
|
+
height: 100%;
|
|
14805
|
+
`;
|
|
14123
14806
|
var SearchBar = styled_components.default.div`
|
|
14124
14807
|
flex: 0 1 500px;
|
|
14125
14808
|
display: flex;
|
|
@@ -14234,7 +14917,7 @@ var Drawer = styled_components.default.div`
|
|
|
14234
14917
|
|
|
14235
14918
|
position: fixed;
|
|
14236
14919
|
right: -10px;
|
|
14237
|
-
top: 56px;
|
|
14920
|
+
top: var(--top-bar-total-height, 56px);
|
|
14238
14921
|
bottom: 0;
|
|
14239
14922
|
background: var(--global-element-background);
|
|
14240
14923
|
border-left: var(--dividing-line) 1px solid;
|
|
@@ -14265,21 +14948,46 @@ var NotificationsContainer = styled_components.default.div`
|
|
|
14265
14948
|
overflow-y: scroll;
|
|
14266
14949
|
margin-right: -17px;
|
|
14267
14950
|
`;
|
|
14268
|
-
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 }) => {
|
|
14269
|
-
const [
|
|
14951
|
+
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 }) => {
|
|
14952
|
+
const [internalDrawer, setInternalDrawer] = (0, react.useState)(null);
|
|
14953
|
+
const isControlled = activeDrawer !== void 0;
|
|
14954
|
+
const openDrawer = isControlled ? activeDrawer : internalDrawer;
|
|
14270
14955
|
const toggleDrawers = (drawerKey) => {
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
|
|
14274
|
-
});
|
|
14956
|
+
const nextDrawer = openDrawer === drawerKey ? null : drawerKey;
|
|
14957
|
+
if (!isControlled) setInternalDrawer(nextDrawer);
|
|
14958
|
+
onActiveDrawerChange?.(nextDrawer);
|
|
14275
14959
|
};
|
|
14960
|
+
const { sideDrawersToRender, sideDrawerWarnings } = (0, react.useMemo)(() => {
|
|
14961
|
+
const toRender = [];
|
|
14962
|
+
const warnings = [];
|
|
14963
|
+
const acceptedIds = /* @__PURE__ */ new Set();
|
|
14964
|
+
for (const drawer of sideDrawers ?? []) {
|
|
14965
|
+
if (RESERVED_DRAWER_IDS.includes(drawer.id)) {
|
|
14966
|
+
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.`);
|
|
14967
|
+
continue;
|
|
14968
|
+
}
|
|
14969
|
+
if (acceptedIds.has(drawer.id)) {
|
|
14970
|
+
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.`);
|
|
14971
|
+
continue;
|
|
14972
|
+
}
|
|
14973
|
+
acceptedIds.add(drawer.id);
|
|
14974
|
+
toRender.push(drawer);
|
|
14975
|
+
}
|
|
14976
|
+
return {
|
|
14977
|
+
sideDrawersToRender: toRender,
|
|
14978
|
+
sideDrawerWarnings: warnings
|
|
14979
|
+
};
|
|
14980
|
+
}, [sideDrawers]);
|
|
14981
|
+
(0, react.useEffect)(() => {
|
|
14982
|
+
for (const warning of sideDrawerWarnings) console.warn(`TopBar: ${warning}`);
|
|
14983
|
+
}, []);
|
|
14276
14984
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Container$10, { children: [
|
|
14277
|
-
|
|
14985
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TopBarHeightVars, { $bottomHeight: bottomAreaElement ? bottomAreaHeight : "0px" }),
|
|
14986
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(BarRow, { children: [hasSearch ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(SearchBar, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LineUIVideoBase.Icon, {
|
|
14278
14987
|
icon: "Search",
|
|
14279
14988
|
size: 16,
|
|
14280
14989
|
color: "grey-6"
|
|
14281
|
-
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchInput, { placeholder: searchPlaceholder })] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {}),
|
|
14282
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(RightArea, { children: [badge && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TopBarBadge, { ...badge }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonArea, { children: [
|
|
14990
|
+
}) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchInput, { placeholder: searchPlaceholder })] }) : leftAreaElement ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LeftArea, { children: leftAreaElement }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(RightArea, { children: [badge && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TopBarBadge, { ...badge }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ButtonArea, { children: [
|
|
14283
14991
|
customDrawer && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DrawerToggle, {
|
|
14284
14992
|
$isActive: openDrawer === "custom",
|
|
14285
14993
|
onClick: () => toggleDrawers("custom"),
|
|
@@ -14303,7 +15011,8 @@ var TopBar = ({ hasNotifications = false, hasLanguage = false, selectedLanguageT
|
|
|
14303
15011
|
color: "dimmed"
|
|
14304
15012
|
})
|
|
14305
15013
|
})
|
|
14306
|
-
] })] }),
|
|
15014
|
+
] })] })] }),
|
|
15015
|
+
bottomAreaElement ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(BottomArea, { children: bottomAreaElement }) : null,
|
|
14307
15016
|
react_dom.default.createPortal(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DrawerPortalWrapper, { children: [
|
|
14308
15017
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Drawer, {
|
|
14309
15018
|
$isOpen: openDrawer === "user",
|
|
@@ -14346,7 +15055,12 @@ var TopBar = ({ hasNotifications = false, hasLanguage = false, selectedLanguageT
|
|
|
14346
15055
|
$isOpen: openDrawer === "custom",
|
|
14347
15056
|
$baseWidth: customDrawer.width ? customDrawer.width : "200px",
|
|
14348
15057
|
children: customDrawer.customComponent
|
|
14349
|
-
})
|
|
15058
|
+
}),
|
|
15059
|
+
sideDrawersToRender.map((drawer) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Drawer, {
|
|
15060
|
+
$isOpen: openDrawer === drawer.id,
|
|
15061
|
+
$baseWidth: drawer.width ? drawer.width : "200px",
|
|
15062
|
+
children: drawer.content
|
|
15063
|
+
}, drawer.id))
|
|
14350
15064
|
] }), document.body)
|
|
14351
15065
|
] });
|
|
14352
15066
|
};
|
|
@@ -15437,7 +16151,11 @@ var HeaderContainer = styled_components.default.div`
|
|
|
15437
16151
|
flex-grow: 3;
|
|
15438
16152
|
}
|
|
15439
16153
|
`;
|
|
15440
|
-
var MobileNavbar = ({ content, home, logoMark, supportUrl, defaultMenuOpen = true, closeText, hasLanguage, hasLogout, logoutLink, hasCurrentUser, hasNotifications, userSubmenu, userDrawerBespoke, loggedInUser, notificationsHistory, customDrawer, supportText, onLogout, onLanguageToggle, ...props }) => {
|
|
16154
|
+
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 }) => {
|
|
16155
|
+
(0, react.useEffect)(() => {
|
|
16156
|
+
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.");
|
|
16157
|
+
if (bottomAreaElement) console.warn("MobileNavbar: `bottomAreaElement` is not supported on mobile and will not render.");
|
|
16158
|
+
}, []);
|
|
15441
16159
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Container$1, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Tabs, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HeaderContainer, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(MobileLogoLink, {
|
|
15442
16160
|
home,
|
|
15443
16161
|
logoMark,
|
|
@@ -15655,6 +16373,10 @@ exports.ButtonsStack = ButtonsStack;
|
|
|
15655
16373
|
exports.CameraPanelWrapper = CameraPanelWrapper;
|
|
15656
16374
|
exports.CameraPanels = CameraPanels;
|
|
15657
16375
|
exports.Checkbox = Checkbox;
|
|
16376
|
+
exports.ChipBar = ChipBar;
|
|
16377
|
+
exports.ChipButton = ChipButton;
|
|
16378
|
+
exports.ChipDropdown = ChipDropdown;
|
|
16379
|
+
exports.ChipZoneBreak = ChipZoneBreak;
|
|
15658
16380
|
exports.ConfirmationModal = ConfirmationModal;
|
|
15659
16381
|
exports.Content = Content;
|
|
15660
16382
|
exports.ContentLayout = ContentLayout;
|
|
@@ -15664,6 +16386,7 @@ exports.DebouncedSearcher = DebouncedSearcher;
|
|
|
15664
16386
|
exports.DropArea = DropArea;
|
|
15665
16387
|
exports.DurationSlider = DurationSlider;
|
|
15666
16388
|
exports.EditCell = EditCell;
|
|
16389
|
+
exports.EditableText = EditableText;
|
|
15667
16390
|
exports.FilterBar = FilterBar;
|
|
15668
16391
|
exports.FilterButton = FilterButton;
|
|
15669
16392
|
exports.FilterDropdown = FilterDropdown;
|