@northlight/ui 2.32.3 → 2.32.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es/northlight.js
CHANGED
|
@@ -9,7 +9,7 @@ import { useForm, FormProvider, useFormContext, Controller } from 'react-hook-fo
|
|
|
9
9
|
export { useController, useFieldArray, useForm, useFormContext, useFormState, useWatch } from 'react-hook-form';
|
|
10
10
|
import { useToken, useMultiStyleConfig as useMultiStyleConfig$1, chakra as chakra$1 } from '@chakra-ui/system';
|
|
11
11
|
import { palette, WebappComponentsTokensSet, WebappSystemTokensSet, typography, TottComponentsTokensSet, TottSystemTokensSet, coreZIndex, coreSizing, coreSpacing, coreFontWeight, coreBoxShadow, coreFontSize, coreLineHeight, coreBorderRadius } from '@northlight/tokens';
|
|
12
|
-
import { UserSquareDuo, BusinessContactDuo, CheckDuo, ChevronUpDuo, ChevronDownDuo, ColorsDuo, CheckSolid, CalendarDuo, ChevronLeftSolid, ChevronRightSolid, XCloseSolid, CheckCircleSolid, AlertTriangleSolid, AlertCircleSolid,
|
|
12
|
+
import { UserSquareDuo, BusinessContactDuo, CheckDuo, ChevronUpDuo, ChevronDownDuo, ColorsDuo, CheckSolid, CalendarDuo, ChevronLeftSolid, ChevronRightSolid, XCloseSolid, CheckCircleSolid, AlertTriangleSolid, AlertCircleSolid, AlertOctagonSolid, InfoSolid, BrightnessSolid, HelpCircleSolid, TrashDuo, SearchDuo, DotsMatrixSolid, DragDuo, EditDuo, ZoomInDuo, Image03Solid, UploadCloudSolid, FileBlankDuo, EditBoxDuo, DownloadDuo, TrashFullDuo, Image03Duo, ChevronUpSolid, ChevronDownSolid, BellSolid, CopyDuo, PlusSolid } from '@northlight/icons';
|
|
13
13
|
import { joiResolver } from '@hookform/resolvers/joi';
|
|
14
14
|
import { useCheckboxGroup, useCheckboxGroupItem } from '@react-aria/checkbox';
|
|
15
15
|
import { useRadioGroup, useRadio } from '@react-aria/radio';
|
|
@@ -4857,6 +4857,11 @@ const Tooltip$1 = {
|
|
|
4857
4857
|
bgColor: color["destructive-alt"],
|
|
4858
4858
|
[$arrowBg.variable]: color["destructive-alt"]
|
|
4859
4859
|
}),
|
|
4860
|
+
error: ({ theme: { colors: color } }) => ({
|
|
4861
|
+
color: "text.over.error",
|
|
4862
|
+
bgColor: color["destructive-alt"],
|
|
4863
|
+
[$arrowBg.variable]: color["destructive-alt"]
|
|
4864
|
+
}),
|
|
4860
4865
|
ai: ({ theme: { colors: color } }) => ({
|
|
4861
4866
|
bgColor: color.bg.ai.default,
|
|
4862
4867
|
[$arrowBg.variable]: color.bg.ai.default
|
|
@@ -7783,12 +7788,12 @@ const DateRangePickerField = forwardRef$1((_a, ref) => {
|
|
|
7783
7788
|
);
|
|
7784
7789
|
});
|
|
7785
7790
|
|
|
7786
|
-
const
|
|
7791
|
+
const tooltipIconMap = {
|
|
7787
7792
|
success: CheckCircleSolid,
|
|
7788
7793
|
warning: AlertTriangleSolid,
|
|
7789
7794
|
error: AlertCircleSolid,
|
|
7790
|
-
danger:
|
|
7791
|
-
info:
|
|
7795
|
+
danger: AlertOctagonSolid,
|
|
7796
|
+
info: InfoSolid,
|
|
7792
7797
|
ai: BrightnessSolid,
|
|
7793
7798
|
default: HelpCircleSolid,
|
|
7794
7799
|
ghost: HelpCircleSolid
|
|
@@ -7837,7 +7842,7 @@ const Tooltip = (_a) => {
|
|
|
7837
7842
|
"hasIcon"
|
|
7838
7843
|
]);
|
|
7839
7844
|
const iconVariant = variant;
|
|
7840
|
-
const icon =
|
|
7845
|
+
const icon = tooltipIconMap[iconVariant];
|
|
7841
7846
|
const TooltipContent = /* @__PURE__ */ React.createElement(HStack, { alignItems: "flex-start" }, hasIcon && /* @__PURE__ */ React.createElement(Icon$1, { as: icon, color: `icon.toast.${iconVariant}` }), /* @__PURE__ */ React.createElement(VStack, { spacing: 0, alignItems: "flex-start" }, /* @__PURE__ */ React.createElement(Label$1, { size: "sm" }, title), /* @__PURE__ */ React.createElement(
|
|
7842
7847
|
P$1,
|
|
7843
7848
|
{
|
|
@@ -13374,6 +13379,17 @@ const TextField = forwardRef$1((_a, ref) => {
|
|
|
13374
13379
|
);
|
|
13375
13380
|
});
|
|
13376
13381
|
|
|
13382
|
+
const toastIconMap = {
|
|
13383
|
+
success: CheckCircleSolid,
|
|
13384
|
+
warning: AlertTriangleSolid,
|
|
13385
|
+
error: AlertCircleSolid,
|
|
13386
|
+
danger: AlertCircleSolid,
|
|
13387
|
+
info: BellSolid,
|
|
13388
|
+
ai: BrightnessSolid,
|
|
13389
|
+
default: HelpCircleSolid,
|
|
13390
|
+
ghost: HelpCircleSolid
|
|
13391
|
+
};
|
|
13392
|
+
|
|
13377
13393
|
var __defProp$g = Object.defineProperty;
|
|
13378
13394
|
var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
|
|
13379
13395
|
var __hasOwnProp$g = Object.prototype.hasOwnProperty;
|
|
@@ -14335,7 +14351,7 @@ const ComboPicker = (_a) => {
|
|
|
14335
14351
|
var _a2;
|
|
14336
14352
|
const { isOpen, onToggle, onClose } = useDisclosure();
|
|
14337
14353
|
const [inputValueState, setInputValueState] = useState(valueProp == null ? void 0 : valueProp.input);
|
|
14338
|
-
const [selectOptionState, setselectOptionState] = useState(
|
|
14354
|
+
const [selectOptionState, setselectOptionState] = useState(valueProp == null ? void 0 : valueProp.option);
|
|
14339
14355
|
const [enableSelectInput, setEnableSelectInput] = useState(false);
|
|
14340
14356
|
const isInputValueControlled = typeof (valueProp == null ? void 0 : valueProp.input) !== "undefined";
|
|
14341
14357
|
const inputValue = isInputValueControlled ? valueProp.input : inputValueState;
|
|
@@ -14343,7 +14359,10 @@ const ComboPicker = (_a) => {
|
|
|
14343
14359
|
const selectOption = isOptionControlled ? valueProp.option : selectOptionState;
|
|
14344
14360
|
const buttonRef = useRef();
|
|
14345
14361
|
const selectRef = useRef();
|
|
14346
|
-
const getNewValue = (option, input) =>
|
|
14362
|
+
const getNewValue = (option, input) => {
|
|
14363
|
+
const newValueOption = option != null ? option : options[0];
|
|
14364
|
+
return is(Number, input) ? { input: Number(input), option: newValueOption } : { option: newValueOption };
|
|
14365
|
+
};
|
|
14347
14366
|
const handleInputChange = (newInputvalue) => {
|
|
14348
14367
|
const newValue = getNewValue(selectOption, newInputvalue);
|
|
14349
14368
|
setInputValueState(newValue.input);
|
|
@@ -14377,10 +14396,20 @@ const ComboPicker = (_a) => {
|
|
|
14377
14396
|
}
|
|
14378
14397
|
}, [enableSelectInput]);
|
|
14379
14398
|
useEffect(() => {
|
|
14380
|
-
|
|
14381
|
-
|
|
14399
|
+
const needsToCorrectOption = !selectOption;
|
|
14400
|
+
const needsToCorrectInput = !is(Number, inputValue) && defaultToZeroIfEmpty;
|
|
14401
|
+
const option = needsToCorrectOption ? options[0] : selectOption;
|
|
14402
|
+
const input = needsToCorrectInput ? clamp(min, max, 0) : inputValue;
|
|
14403
|
+
if (needsToCorrectOption) {
|
|
14404
|
+
setselectOptionState(option);
|
|
14405
|
+
}
|
|
14406
|
+
if (needsToCorrectInput) {
|
|
14407
|
+
setInputValueState(input);
|
|
14408
|
+
}
|
|
14409
|
+
if (needsToCorrectOption || needsToCorrectInput) {
|
|
14410
|
+
onChange == null ? void 0 : onChange(getNewValue(option, input));
|
|
14382
14411
|
}
|
|
14383
|
-
}, [
|
|
14412
|
+
}, [inputValue, defaultToZeroIfEmpty]);
|
|
14384
14413
|
return /* @__PURE__ */ React.createElement(InputGroup, null, /* @__PURE__ */ React.createElement(
|
|
14385
14414
|
FormattedNumberInput,
|
|
14386
14415
|
__spreadValues$1({
|
|
@@ -14413,7 +14442,7 @@ const ComboPicker = (_a) => {
|
|
|
14413
14442
|
flexShrink: "0",
|
|
14414
14443
|
height: "100%"
|
|
14415
14444
|
},
|
|
14416
|
-
selectOption.label
|
|
14445
|
+
(_a2 = selectOption == null ? void 0 : selectOption.label) != null ? _a2 : ""
|
|
14417
14446
|
)
|
|
14418
14447
|
), /* @__PURE__ */ React.createElement(Box, { position: "absolute", width: "100%" }, /* @__PURE__ */ React.createElement(
|
|
14419
14448
|
Select,
|