@northlight/ui 2.31.1 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/northlight.d.ts +24 -10
- package/dist/es/northlight.js +87 -33
- package/dist/es/northlight.js.map +1 -1
- package/dist/umd/northlight.cjs +85 -30
- package/dist/umd/northlight.cjs.map +1 -1
- package/dist/umd/northlight.min.cjs +3 -3
- package/dist/umd/northlight.min.cjs.map +1 -1
- package/package.json +2 -2
package/dist/es/northlight.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import * as react_select_dist_declarations_src_types from 'react-select/dist/dec
|
|
|
30
30
|
import * as _chakra_ui_switch_dist_switch from '@chakra-ui/switch/dist/switch';
|
|
31
31
|
import * as _chakra_ui_textarea_dist_textarea from '@chakra-ui/textarea/dist/textarea';
|
|
32
32
|
import { Props as Props$1 } from 'react-input-mask';
|
|
33
|
-
import { NumericFormatProps } from 'react-number-format';
|
|
33
|
+
import { NumericFormatProps, NumberFormatValues, SourceInfo } from 'react-number-format';
|
|
34
34
|
import { Schema } from 'joi';
|
|
35
35
|
import { UseClickableProps } from '@chakra-ui/clickable';
|
|
36
36
|
import { Variant } from 'chakra-react-select/dist/types/types';
|
|
@@ -2543,6 +2543,8 @@ declare const useCurrentTheme: () => CurrentTheme;
|
|
|
2543
2543
|
|
|
2544
2544
|
declare const clamp: (minValue: number, maxValue: number, value: number) => number;
|
|
2545
2545
|
|
|
2546
|
+
declare const getConsistentRandomColorFromString: (str: string, colors?: string[]) => string;
|
|
2547
|
+
|
|
2546
2548
|
interface MediatoolThemeProviderProps {
|
|
2547
2549
|
children: ReactNode;
|
|
2548
2550
|
theme?: Record<string, any>;
|
|
@@ -3234,7 +3236,7 @@ interface TextFieldProps extends Omit<InputProps, 'onChange'>, InputFieldProps {
|
|
|
3234
3236
|
formatter?: TextInputFormatter;
|
|
3235
3237
|
validate?: RegisterOptions;
|
|
3236
3238
|
direction?: StackDirection;
|
|
3237
|
-
onChange?: (e:
|
|
3239
|
+
onChange?: (e: React__default.ChangeEvent<HTMLInputElement> | string) => void;
|
|
3238
3240
|
}
|
|
3239
3241
|
type MaskedTextInputProps = InputProps & Props$1 & {
|
|
3240
3242
|
maskPlaceholder?: string;
|
|
@@ -3250,13 +3252,13 @@ interface FormattedNumberInputProps extends Omit<NumericFormatProps, 'onChange'
|
|
|
3250
3252
|
/** Changes thousand and decimal separators */
|
|
3251
3253
|
preset?: FormattedNumberInputPreset;
|
|
3252
3254
|
/** Gives you back an object, see https://s-yadav.github.io/react-number-format/docs/quirks */
|
|
3253
|
-
onChange?:
|
|
3255
|
+
onChange?: (values: NumberFormatValues, sourceInfo?: SourceInfo) => void;
|
|
3254
3256
|
/** Will format number UI as percentage, but return as decimal value */
|
|
3255
3257
|
isPercentage?: boolean;
|
|
3256
3258
|
/** Will round up and restrict number of decimals */
|
|
3257
3259
|
numberOfDecimals?: number;
|
|
3258
|
-
inputLeftElement?:
|
|
3259
|
-
inputRightElement?:
|
|
3260
|
+
inputLeftElement?: React__default.ReactNode;
|
|
3261
|
+
inputRightElement?: React__default.ReactNode;
|
|
3260
3262
|
}
|
|
3261
3263
|
interface FormattedNumberInputFieldProps extends FormattedNumberInputProps {
|
|
3262
3264
|
name: string;
|
|
@@ -3307,7 +3309,7 @@ interface FormattedNumberInputFieldProps extends FormattedNumberInputProps {
|
|
|
3307
3309
|
?)
|
|
3308
3310
|
|
|
3309
3311
|
*/
|
|
3310
|
-
declare const FormattedNumberInput: ({ preset, isPercentage, onChange, value, numberOfDecimals, max, min, inputLeftElement, inputRightElement, ...rest }: FormattedNumberInputProps) => JSX.Element;
|
|
3312
|
+
declare const FormattedNumberInput: ({ preset, isPercentage, onChange, value: valueProp, numberOfDecimals, max, min, inputLeftElement, inputRightElement, onBlur, ...rest }: FormattedNumberInputProps) => JSX.Element;
|
|
3311
3313
|
|
|
3312
3314
|
/**
|
|
3313
3315
|
* The formatted number input component wrapped in a <Field />
|
|
@@ -3411,19 +3413,18 @@ interface OurTooltipProps extends TooltipProps {
|
|
|
3411
3413
|
* (?
|
|
3412
3414
|
* <HStack>
|
|
3413
3415
|
* <Tooltip
|
|
3416
|
+
* hasIcon={ true }
|
|
3414
3417
|
* description="Here’s a regular tooltip with some with icon
|
|
3415
3418
|
* inside of it that’s supposed to be substantially large.">
|
|
3416
3419
|
* <Badge>ICON</Badge>
|
|
3417
3420
|
* </Tooltip>
|
|
3418
3421
|
* <Tooltip
|
|
3419
|
-
* hasIcon={ false }
|
|
3420
3422
|
* description="Here’s a regular tooltip with some text without icon
|
|
3421
3423
|
* inside of it that’s supposed to be substantially large."
|
|
3422
3424
|
* >
|
|
3423
3425
|
* <Badge>NOICON</Badge>
|
|
3424
3426
|
* </Tooltip>
|
|
3425
3427
|
* <Tooltip
|
|
3426
|
-
* hasIcon={ false }
|
|
3427
3428
|
* description={
|
|
3428
3429
|
* <Box>
|
|
3429
3430
|
* <Text>
|
|
@@ -3454,12 +3455,14 @@ interface OurTooltipProps extends TooltipProps {
|
|
|
3454
3455
|
* <HStack>
|
|
3455
3456
|
* <VStack>
|
|
3456
3457
|
* <Tooltip
|
|
3458
|
+
* hasIcon={ true }
|
|
3457
3459
|
* variant="success"
|
|
3458
3460
|
* description="This is a successful message"
|
|
3459
3461
|
* >
|
|
3460
3462
|
* <Badge colorScheme="green">Success</Badge>
|
|
3461
3463
|
* </Tooltip>
|
|
3462
3464
|
* <Tooltip
|
|
3465
|
+
* hasIcon={ true }
|
|
3463
3466
|
* variant="success"
|
|
3464
3467
|
* title="Please check fields"
|
|
3465
3468
|
* description="This is a successful message with a title and an icon
|
|
@@ -3470,12 +3473,14 @@ interface OurTooltipProps extends TooltipProps {
|
|
|
3470
3473
|
* </VStack>
|
|
3471
3474
|
* <VStack>
|
|
3472
3475
|
* <Tooltip
|
|
3476
|
+
* hasIcon={ true }
|
|
3473
3477
|
* variant="info"
|
|
3474
3478
|
* description="This is an informative text"
|
|
3475
3479
|
* >
|
|
3476
3480
|
* <Badge colorScheme="blue">Info</Badge>
|
|
3477
3481
|
* </Tooltip>
|
|
3478
3482
|
* <Tooltip
|
|
3483
|
+
* hasIcon={ true }
|
|
3479
3484
|
* variant="info"
|
|
3480
3485
|
* title="Please check fields"
|
|
3481
3486
|
* description="This is an informative text with a title and an icon
|
|
@@ -3486,12 +3491,14 @@ interface OurTooltipProps extends TooltipProps {
|
|
|
3486
3491
|
* </VStack>
|
|
3487
3492
|
* <VStack>
|
|
3488
3493
|
* <Tooltip
|
|
3494
|
+
* hasIcon={ true }
|
|
3489
3495
|
* variant="warning"
|
|
3490
3496
|
* description="This is a warning"
|
|
3491
3497
|
* >
|
|
3492
3498
|
* <Badge colorScheme="yellow">Warning</Badge>
|
|
3493
3499
|
* </Tooltip>
|
|
3494
3500
|
* <Tooltip
|
|
3501
|
+
* hasIcon={ true }
|
|
3495
3502
|
* variant="warning"
|
|
3496
3503
|
* title="Please check fields"
|
|
3497
3504
|
* description="This is a warning with a title and an icon
|
|
@@ -3502,12 +3509,14 @@ interface OurTooltipProps extends TooltipProps {
|
|
|
3502
3509
|
* </VStack>
|
|
3503
3510
|
* <VStack>
|
|
3504
3511
|
* <Tooltip
|
|
3512
|
+
* hasIcon={ true }
|
|
3505
3513
|
* variant="danger"
|
|
3506
3514
|
* description="This is an error message"
|
|
3507
3515
|
* >
|
|
3508
3516
|
* <Badge colorScheme="red">Error</Badge>
|
|
3509
3517
|
* </Tooltip>
|
|
3510
3518
|
* <Tooltip
|
|
3519
|
+
* hasIcon={ true }
|
|
3511
3520
|
* variant="danger"
|
|
3512
3521
|
* title="Please check fields"
|
|
3513
3522
|
* description="This is an error message with a title and an icon
|
|
@@ -3518,11 +3527,13 @@ interface OurTooltipProps extends TooltipProps {
|
|
|
3518
3527
|
* </VStack>
|
|
3519
3528
|
* <VStack>
|
|
3520
3529
|
* <Tooltip
|
|
3530
|
+
* hasIcon={ true }
|
|
3521
3531
|
* variant="ai"
|
|
3522
3532
|
* description="This is an AI message">
|
|
3523
3533
|
* <Badge colorScheme="teal" variant="subtle">AI</Badge>
|
|
3524
3534
|
* </Tooltip>
|
|
3525
3535
|
* <Tooltip
|
|
3536
|
+
* hasIcon={ true }
|
|
3526
3537
|
* variant="ai"
|
|
3527
3538
|
* title="Please check fields"
|
|
3528
3539
|
* description="This is an AI message with a title and an icon
|
|
@@ -3533,11 +3544,13 @@ interface OurTooltipProps extends TooltipProps {
|
|
|
3533
3544
|
* </VStack>
|
|
3534
3545
|
* <VStack>
|
|
3535
3546
|
* <Tooltip
|
|
3547
|
+
* hasIcon={ true }
|
|
3536
3548
|
* variant="ghost"
|
|
3537
3549
|
* description="This is an clean message">
|
|
3538
3550
|
* <Badge>Ghost</Badge>
|
|
3539
3551
|
* </Tooltip>
|
|
3540
3552
|
* <Tooltip
|
|
3553
|
+
* hasIcon={ true }
|
|
3541
3554
|
* variant="ghost"
|
|
3542
3555
|
* title="Please check fields"
|
|
3543
3556
|
* description="This is an clean message with a title and an icon
|
|
@@ -4256,6 +4269,7 @@ interface ComboPickerProps extends Omit<FormattedNumberInputProps, 'value' | 'on
|
|
|
4256
4269
|
formatPreset?: FormattedNumberInputPreset;
|
|
4257
4270
|
isDisabled?: boolean;
|
|
4258
4271
|
isReadOnly?: boolean;
|
|
4272
|
+
defaultToZeroIfEmpty?: boolean;
|
|
4259
4273
|
}
|
|
4260
4274
|
interface ComboPickerFieldProps extends ComboPickerProps {
|
|
4261
4275
|
name: string;
|
|
@@ -4271,7 +4285,7 @@ interface ComboPickerFieldProps extends ComboPickerProps {
|
|
|
4271
4285
|
* @see ComboPickerField
|
|
4272
4286
|
* @see {@link https://northlight.dev/reference/combo-picker}
|
|
4273
4287
|
*/
|
|
4274
|
-
declare const ComboPicker: ({ onChange, options, size, value, placeholder, precision, formatPreset, isDisabled, isReadOnly, ...rest }: ComboPickerProps) => JSX.Element;
|
|
4288
|
+
declare const ComboPicker: ({ onChange, options, size, value: valueProp, placeholder, precision, formatPreset, isDisabled, isReadOnly, defaultToZeroIfEmpty, max, min, ...rest }: ComboPickerProps) => JSX.Element;
|
|
4275
4289
|
|
|
4276
4290
|
/**
|
|
4277
4291
|
* The <ComboPicker /> component wrapped in a <Field />
|
|
@@ -4402,4 +4416,4 @@ declare const useResizeWidth: ({ stationaryEdge, minWidthPx, maxWidthPx, default
|
|
|
4402
4416
|
declare const theme: Record<string, any>;
|
|
4403
4417
|
declare const tottTheme: Record<string, any>;
|
|
4404
4418
|
|
|
4405
|
-
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert, AlertProps, AlertVariants, AspectRatio, AsyncError, AsyncErrorProps, Avatar, AvatarBadgeProps, AvatarGroup, AvatarGroupProps, AvatarProps, Badge, BasicOption, Blinker, BlinkerProps, Blockquote, BodyType, Button, ButtonProps, ButtonVariants, Capitalized, Carousel, Checkbox, CheckboxField, CheckboxFieldProps, CheckboxProps, CheckboxVariants, ChildrenType, Clickable, ClickableProps, ClipboardInput, ClipboardInputProps, Collapse, CollapseProps, Color, ColorButtonProps, ColorGrade, ColorPicker, ColorPickerField, ColorPickerFieldProps, ColorPickerProps, ColorShades, ColorsExpandButtonProps, ComboPicker, ComboPickerField, ComboPickerFieldProps, ComboPickerOption, ComboPickerProps, ComboPickerValue, ConfirmDeleteModalProps, CreatableSelectDropdown, CurrentTheme, CustomContainerPropsType, CustomElementType, CustomFlipButtonProps, CustomFlipButtonPropsType, CustomTheme, DatePicker, DatePickerField, DatePickerFieldProps, DatePickerLocaleWrapper, DatePickerProps, DateRange, DateRangePicker, DateRangePickerField, DateRangePickerFieldProps, DateRangePickerProps, DragAndDrop, DragHandle, DragHandleProps, DragItem, DragItemProps, Draggable, DraggableProps, DropZone, DropZoneProps, Droppable, DroppableProps, DurationType, EditableControlsProps, EditableProps, EditableSizes, EditableText, EditableVariant, Fade, FadeProps, FastGrid, FastGridProps, FastList, FastListProps, Field, FieldErrorType, FieldProps, FileEditorModalProps, FileFormat, FileIconButtonProps, FileItemProps, FilePicker, FilePickerField, FilePickerFieldProps, FilePickerProps, FileWithSizeAndType, FileWithSrcNameType, FileWithType, FlipButton, FlipButtonGroup, FlipButtonGroupField, FlipButtonGroupFieldProps, FlipButtonGroupProps, FlipButtonProps, Form, FormBody, FormLabel, FormLabelProps, FormProps, FormattedNumberInput, FormattedNumberInputField, FormattedNumberInputFieldProps, FormattedNumberInputPreset, FormattedNumberInputProps, H1, H2, H3, H4, H5, H6, HeadingProps, HeadingType, Icon, IconButton, IconButtonProps, IconProps, InputFieldProps, IntentButton, Label, LabelProps, LabelSizes, LabelType, Lead, ListenersType, LoadingBar, MaskedTextInput, MaskedTextInputProps, MediatoolThemeProvider, MediatoolThemeProviderProps, Menu, MenuProps, MenuVariants, Message, Modal, ModalBase, ModalBody, ModalBooleans, ModalProps, ModalSizes, MultiFileList, MultiFileListProps, MultiFilePicker, MultiFilePickerField, MultiFilePickerFieldProps, MultiFilePickerProps, MultiFileUploader, MultiFileUploaderProps, MultiItemType, MultiSort, MultiSortProps, NotificationIconButton, NotificationIconButtonProps, NumVal, NumValType, NumberInput, NumberInputField, NumberInputFieldProps, NumberInputProps, NumberInputSizeProps, NumberInputStepperProps, OffsetType, Option, OrganizationLogo, OrganizationLogoProps, OverflowGroup, OverflowGroupProps, OverflowIndicatorProps, P, PProps, PaneDivider, PaneItem, PinInput, PinInputProps, PinSize, PinSizeTuple, PinVariant, Popover, PresetOptions, ProgressBar, ProgressBarProps, Radio, RadioFieldGroupProps, RadioFieldProps, RadioGroup, RadioGroupField, RadioGroupProps, RadioProps, ResizeHandle, ScaleFade, ScaleFadeProps, SearchBar, SearchBarField, SearchBarFieldProps, SearchBarOptionType, SearchBarProps, Select, SelectActionMeta, SelectField, SelectFieldProps, SelectProps, SetValueOptionsType, Slide, SlideFade, SlideFadeProps, SlideProps, Small, Sortable, SortableContainer, SortableContainerProps, SortableItem, SortableItemProps, SortableList, SortableListProps, Spinner, SpinnerProps, SplitPane, SplitPaneProps, StatusPin, StatusPinProps, Step, StepList, StepListProps, StepPanel, StepPanelProps, StepProps, StepStack, Steps, StepsProps, StylizedType, Switch, SwitchField, SwitchFieldProps, SwitchProps, TabPanel, TabPanelProps, Table, TableProps, Tabs, TabsProps, Tag, TagGroup, TagGroupProps, TagProps, TagsInput, TagsInputProps, TextField, TextFieldProps, TextInputFormatter, TextSizeProps, Textarea, TextareaField, TextareaFieldProps, TextareaProps, Tiny, Toast, ToastProps, Toolbox, ToolboxContent, ToolboxContentProps, ToolboxFooter, ToolboxFooterProps, ToolboxHeader, ToolboxHeaderProps, ToolboxProps, Tooltip, TransitionDirection, UseFormReturn, UseSelectCallbacksProps, UseToastOptions, addAlpha, advancedParseFloat, clamp, createDebounceFunctionInstance, getChildrenWithProps, getContrastColor, getFieldError, getInitials, getMatchingValue, getShades, highlight, luminosity, ring, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useResizeWidth, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };
|
|
4419
|
+
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert, AlertProps, AlertVariants, AspectRatio, AsyncError, AsyncErrorProps, Avatar, AvatarBadgeProps, AvatarGroup, AvatarGroupProps, AvatarProps, Badge, BasicOption, Blinker, BlinkerProps, Blockquote, BodyType, Button, ButtonProps, ButtonVariants, Capitalized, Carousel, Checkbox, CheckboxField, CheckboxFieldProps, CheckboxProps, CheckboxVariants, ChildrenType, Clickable, ClickableProps, ClipboardInput, ClipboardInputProps, Collapse, CollapseProps, Color, ColorButtonProps, ColorGrade, ColorPicker, ColorPickerField, ColorPickerFieldProps, ColorPickerProps, ColorShades, ColorsExpandButtonProps, ComboPicker, ComboPickerField, ComboPickerFieldProps, ComboPickerOption, ComboPickerProps, ComboPickerValue, ConfirmDeleteModalProps, CreatableSelectDropdown, CurrentTheme, CustomContainerPropsType, CustomElementType, CustomFlipButtonProps, CustomFlipButtonPropsType, CustomTheme, DatePicker, DatePickerField, DatePickerFieldProps, DatePickerLocaleWrapper, DatePickerProps, DateRange, DateRangePicker, DateRangePickerField, DateRangePickerFieldProps, DateRangePickerProps, DragAndDrop, DragHandle, DragHandleProps, DragItem, DragItemProps, Draggable, DraggableProps, DropZone, DropZoneProps, Droppable, DroppableProps, DurationType, EditableControlsProps, EditableProps, EditableSizes, EditableText, EditableVariant, Fade, FadeProps, FastGrid, FastGridProps, FastList, FastListProps, Field, FieldErrorType, FieldProps, FileEditorModalProps, FileFormat, FileIconButtonProps, FileItemProps, FilePicker, FilePickerField, FilePickerFieldProps, FilePickerProps, FileWithSizeAndType, FileWithSrcNameType, FileWithType, FlipButton, FlipButtonGroup, FlipButtonGroupField, FlipButtonGroupFieldProps, FlipButtonGroupProps, FlipButtonProps, Form, FormBody, FormLabel, FormLabelProps, FormProps, FormattedNumberInput, FormattedNumberInputField, FormattedNumberInputFieldProps, FormattedNumberInputPreset, FormattedNumberInputProps, H1, H2, H3, H4, H5, H6, HeadingProps, HeadingType, Icon, IconButton, IconButtonProps, IconProps, InputFieldProps, IntentButton, Label, LabelProps, LabelSizes, LabelType, Lead, ListenersType, LoadingBar, MaskedTextInput, MaskedTextInputProps, MediatoolThemeProvider, MediatoolThemeProviderProps, Menu, MenuProps, MenuVariants, Message, Modal, ModalBase, ModalBody, ModalBooleans, ModalProps, ModalSizes, MultiFileList, MultiFileListProps, MultiFilePicker, MultiFilePickerField, MultiFilePickerFieldProps, MultiFilePickerProps, MultiFileUploader, MultiFileUploaderProps, MultiItemType, MultiSort, MultiSortProps, NotificationIconButton, NotificationIconButtonProps, NumVal, NumValType, NumberInput, NumberInputField, NumberInputFieldProps, NumberInputProps, NumberInputSizeProps, NumberInputStepperProps, OffsetType, Option, OrganizationLogo, OrganizationLogoProps, OverflowGroup, OverflowGroupProps, OverflowIndicatorProps, P, PProps, PaneDivider, PaneItem, PinInput, PinInputProps, PinSize, PinSizeTuple, PinVariant, Popover, PresetOptions, ProgressBar, ProgressBarProps, Radio, RadioFieldGroupProps, RadioFieldProps, RadioGroup, RadioGroupField, RadioGroupProps, RadioProps, ResizeHandle, ScaleFade, ScaleFadeProps, SearchBar, SearchBarField, SearchBarFieldProps, SearchBarOptionType, SearchBarProps, Select, SelectActionMeta, SelectField, SelectFieldProps, SelectProps, SetValueOptionsType, Slide, SlideFade, SlideFadeProps, SlideProps, Small, Sortable, SortableContainer, SortableContainerProps, SortableItem, SortableItemProps, SortableList, SortableListProps, Spinner, SpinnerProps, SplitPane, SplitPaneProps, StatusPin, StatusPinProps, Step, StepList, StepListProps, StepPanel, StepPanelProps, StepProps, StepStack, Steps, StepsProps, StylizedType, Switch, SwitchField, SwitchFieldProps, SwitchProps, TabPanel, TabPanelProps, Table, TableProps, Tabs, TabsProps, Tag, TagGroup, TagGroupProps, TagProps, TagsInput, TagsInputProps, TextField, TextFieldProps, TextInputFormatter, TextSizeProps, Textarea, TextareaField, TextareaFieldProps, TextareaProps, Tiny, Toast, ToastProps, Toolbox, ToolboxContent, ToolboxContentProps, ToolboxFooter, ToolboxFooterProps, ToolboxHeader, ToolboxHeaderProps, ToolboxProps, Tooltip, TransitionDirection, UseFormReturn, UseSelectCallbacksProps, UseToastOptions, addAlpha, advancedParseFloat, clamp, createDebounceFunctionInstance, getChildrenWithProps, getConsistentRandomColorFromString, getContrastColor, getFieldError, getInitials, getMatchingValue, getShades, highlight, luminosity, ring, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useResizeWidth, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };
|
package/dist/es/northlight.js
CHANGED
|
@@ -3,7 +3,7 @@ export { AbsoluteCenter, AccordionIcon, AlertDescription, AlertDialog, AlertDial
|
|
|
3
3
|
import React, { useState, useEffect, useRef, isValidElement, cloneElement, Children, createContext, useContext, forwardRef as forwardRef$1, useImperativeHandle, memo, useMemo, useCallback } from 'react';
|
|
4
4
|
import { CreatableSelect, chakraComponents, AsyncSelect, Select as Select$3 } from 'chakra-react-select';
|
|
5
5
|
export { AsyncCreatableSelect, AsyncSelect, Select as ChakraReactSelect, CreatableSelect, chakraComponents as selectChakraComponents } from 'chakra-react-select';
|
|
6
|
-
import { isNil, last, map, prop, difference, replace, split, path, T, identity, any, isEmpty, init, append, ifElse, gt, always, defaultTo, take, inc, dec, forEach, is, trim,
|
|
6
|
+
import { isNil, last, map, prop, difference, replace, split, path, T, keys, omit, identity, any, isEmpty, init, append, ifElse, gt, always, defaultTo, take, inc, dec, forEach, is, trim, values, equals, mergeAll, merge, toLower, find, times, add, has, not, all, filter, test, indexOf, remove, insert, intersection, findIndex, concat, head, match, length, propEq } from 'ramda';
|
|
7
7
|
import { useFocusManager, FocusScope, useFocusRing } from '@react-aria/focus';
|
|
8
8
|
import { useForm, FormProvider, useFormContext, Controller } from 'react-hook-form';
|
|
9
9
|
export { useController, useFieldArray, useForm, useFormContext, useFormState, useWatch } from 'react-hook-form';
|
|
@@ -38,7 +38,7 @@ export * from '@dnd-kit/modifiers';
|
|
|
38
38
|
import { VariableSizeList, VariableSizeGrid } from 'react-window';
|
|
39
39
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
40
40
|
import AvatarEditor from 'react-avatar-editor';
|
|
41
|
-
import { NumericFormat } from 'react-number-format';
|
|
41
|
+
import { NumericFormat, numericFormatter } from 'react-number-format';
|
|
42
42
|
import InputMask from 'react-input-mask';
|
|
43
43
|
import { uniqBy } from 'yafu';
|
|
44
44
|
|
|
@@ -496,6 +496,21 @@ const useCurrentTheme = () => {
|
|
|
496
496
|
|
|
497
497
|
const clamp = (minValue, maxValue, value) => Math.min(Math.max(value, minValue), maxValue);
|
|
498
498
|
|
|
499
|
+
const availableColorSchemes = keys(omit(["mono"], palette));
|
|
500
|
+
const djb2Hash = (str, colors) => {
|
|
501
|
+
let hash = 5381;
|
|
502
|
+
for (let i = 0; i < str.length; i += 1) {
|
|
503
|
+
const char = str.charCodeAt(i);
|
|
504
|
+
hash = (hash << 5) + hash + char;
|
|
505
|
+
hash &= hash;
|
|
506
|
+
}
|
|
507
|
+
return Math.abs(hash) % colors.length;
|
|
508
|
+
};
|
|
509
|
+
const getConsistentRandomColorFromString = (str, colors = availableColorSchemes) => {
|
|
510
|
+
const index = djb2Hash(str, colors);
|
|
511
|
+
return colors[index];
|
|
512
|
+
};
|
|
513
|
+
|
|
499
514
|
const useResizeWidth = ({
|
|
500
515
|
stationaryEdge = "left",
|
|
501
516
|
minWidthPx = 0,
|
|
@@ -4805,10 +4820,13 @@ const Tooltip$1 = {
|
|
|
4805
4820
|
}),
|
|
4806
4821
|
variants: {
|
|
4807
4822
|
default: ({ theme: { colors: color } }) => ({
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4811
|
-
|
|
4823
|
+
color: color.text.default,
|
|
4824
|
+
bgColor: color.bg.base,
|
|
4825
|
+
borderWidth: "xs",
|
|
4826
|
+
borderColor: color.border.default,
|
|
4827
|
+
borderStyle: "solid",
|
|
4828
|
+
[$arrowBg.variable]: color.bg.base,
|
|
4829
|
+
[$arrowBorder.variable]: color.border.default
|
|
4812
4830
|
}),
|
|
4813
4831
|
success: ({ theme: { colors: color } }) => ({
|
|
4814
4832
|
color: "text.over.success",
|
|
@@ -7810,7 +7828,7 @@ const Tooltip = (_a) => {
|
|
|
7810
7828
|
hasArrow = true,
|
|
7811
7829
|
title = "",
|
|
7812
7830
|
description = "",
|
|
7813
|
-
hasIcon =
|
|
7831
|
+
hasIcon = false
|
|
7814
7832
|
} = _b, rest = __objRest$18(_b, [
|
|
7815
7833
|
"variant",
|
|
7816
7834
|
"hasArrow",
|
|
@@ -7825,7 +7843,7 @@ const Tooltip = (_a) => {
|
|
|
7825
7843
|
{
|
|
7826
7844
|
variant: "14",
|
|
7827
7845
|
sx: {
|
|
7828
|
-
color: !variant || variant === "ai"
|
|
7846
|
+
color: !variant || variant === "ai" ? "text.inverted" : "text.default"
|
|
7829
7847
|
}
|
|
7830
7848
|
},
|
|
7831
7849
|
description
|
|
@@ -13053,12 +13071,13 @@ const FormattedNumberInput = (_a) => {
|
|
|
13053
13071
|
preset = "eu",
|
|
13054
13072
|
isPercentage = false,
|
|
13055
13073
|
onChange = identity,
|
|
13056
|
-
value,
|
|
13074
|
+
value: valueProp,
|
|
13057
13075
|
numberOfDecimals = 2,
|
|
13058
13076
|
max = Infinity,
|
|
13059
13077
|
min = -Infinity,
|
|
13060
13078
|
inputLeftElement,
|
|
13061
|
-
inputRightElement
|
|
13079
|
+
inputRightElement,
|
|
13080
|
+
onBlur
|
|
13062
13081
|
} = _b, rest = __objRest$g(_b, [
|
|
13063
13082
|
"preset",
|
|
13064
13083
|
"isPercentage",
|
|
@@ -13068,27 +13087,37 @@ const FormattedNumberInput = (_a) => {
|
|
|
13068
13087
|
"max",
|
|
13069
13088
|
"min",
|
|
13070
13089
|
"inputLeftElement",
|
|
13071
|
-
"inputRightElement"
|
|
13090
|
+
"inputRightElement",
|
|
13091
|
+
"onBlur"
|
|
13072
13092
|
]);
|
|
13093
|
+
const [valueState, setValueState] = useState(valueProp);
|
|
13094
|
+
const isControlled = typeof valueProp !== "undefined";
|
|
13095
|
+
const value = isControlled ? valueProp : valueState;
|
|
13073
13096
|
const props = presetMap[preset];
|
|
13074
|
-
const
|
|
13097
|
+
const getNumberFormatValues = (number) => ({
|
|
13098
|
+
floatValue: number,
|
|
13099
|
+
formattedValue: numericFormatter(number.toString(), props),
|
|
13100
|
+
value: number.toString()
|
|
13101
|
+
});
|
|
13075
13102
|
const validateRange = () => {
|
|
13076
|
-
if (isNil(
|
|
13103
|
+
if (isNil(value))
|
|
13077
13104
|
return;
|
|
13078
|
-
const vNum = typeof
|
|
13105
|
+
const vNum = typeof value === "string" ? parseFloat(value) : value;
|
|
13079
13106
|
const factor = isPercentage ? 100 : 1;
|
|
13080
13107
|
if (vNum * factor > max) {
|
|
13081
13108
|
const newValue = roundToPrecision(max / factor, numberOfDecimals);
|
|
13082
|
-
|
|
13109
|
+
setValueState(newValue);
|
|
13110
|
+
onChange(getNumberFormatValues(newValue));
|
|
13083
13111
|
}
|
|
13084
13112
|
if (vNum * factor < min) {
|
|
13085
13113
|
const newValue = roundToPrecision(min / factor, numberOfDecimals);
|
|
13086
|
-
|
|
13114
|
+
setValueState(newValue);
|
|
13115
|
+
onChange(getNumberFormatValues(newValue));
|
|
13087
13116
|
}
|
|
13088
13117
|
};
|
|
13089
13118
|
const onValueChangeHandler = (values, sourceInfo) => {
|
|
13090
13119
|
const newFloatValue = values.floatValue && isPercentage ? roundToPrecision(values.floatValue / 100, numberOfDecimals) : values.floatValue;
|
|
13091
|
-
|
|
13120
|
+
setValueState(newFloatValue);
|
|
13092
13121
|
onChange(
|
|
13093
13122
|
__spreadProps$3(__spreadValues$k({}, values), {
|
|
13094
13123
|
floatValue: newFloatValue
|
|
@@ -13096,6 +13125,9 @@ const FormattedNumberInput = (_a) => {
|
|
|
13096
13125
|
sourceInfo
|
|
13097
13126
|
);
|
|
13098
13127
|
};
|
|
13128
|
+
useEffect(() => {
|
|
13129
|
+
validateRange();
|
|
13130
|
+
}, [value]);
|
|
13099
13131
|
return /* @__PURE__ */ React.createElement(
|
|
13100
13132
|
InputGroupWrapper,
|
|
13101
13133
|
{
|
|
@@ -13107,10 +13139,13 @@ const FormattedNumberInput = (_a) => {
|
|
|
13107
13139
|
__spreadValues$k(__spreadValues$k({
|
|
13108
13140
|
allowLeadingZeros: true,
|
|
13109
13141
|
customInput: Input$1,
|
|
13110
|
-
onBlur:
|
|
13142
|
+
onBlur: (e) => {
|
|
13143
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
13144
|
+
validateRange();
|
|
13145
|
+
},
|
|
13111
13146
|
onValueChange: onValueChangeHandler,
|
|
13112
13147
|
decimalScale: numberOfDecimals,
|
|
13113
|
-
value: isPercentage ? roundToPrecision(parseFloat(`${
|
|
13148
|
+
value: isPercentage ? roundToPrecision(parseFloat(`${value != null ? value : 0}`) * 100, numberOfDecimals) : value,
|
|
13114
13149
|
suffix: isPercentage ? "%" : ""
|
|
13115
13150
|
}, props), rest)
|
|
13116
13151
|
)
|
|
@@ -14274,12 +14309,15 @@ const ComboPicker = (_a) => {
|
|
|
14274
14309
|
onChange,
|
|
14275
14310
|
options,
|
|
14276
14311
|
size,
|
|
14277
|
-
value,
|
|
14312
|
+
value: valueProp,
|
|
14278
14313
|
placeholder,
|
|
14279
14314
|
precision,
|
|
14280
14315
|
formatPreset,
|
|
14281
14316
|
isDisabled,
|
|
14282
|
-
isReadOnly
|
|
14317
|
+
isReadOnly,
|
|
14318
|
+
defaultToZeroIfEmpty = true,
|
|
14319
|
+
max = Infinity,
|
|
14320
|
+
min = -Infinity
|
|
14283
14321
|
} = _b, rest = __objRest$1(_b, [
|
|
14284
14322
|
"onChange",
|
|
14285
14323
|
"options",
|
|
@@ -14289,19 +14327,26 @@ const ComboPicker = (_a) => {
|
|
|
14289
14327
|
"precision",
|
|
14290
14328
|
"formatPreset",
|
|
14291
14329
|
"isDisabled",
|
|
14292
|
-
"isReadOnly"
|
|
14330
|
+
"isReadOnly",
|
|
14331
|
+
"defaultToZeroIfEmpty",
|
|
14332
|
+
"max",
|
|
14333
|
+
"min"
|
|
14293
14334
|
]);
|
|
14294
14335
|
var _a2;
|
|
14295
14336
|
const { isOpen, onToggle, onClose } = useDisclosure();
|
|
14296
|
-
const [
|
|
14297
|
-
const [
|
|
14337
|
+
const [inputValueState, setInputValueState] = useState(valueProp == null ? void 0 : valueProp.input);
|
|
14338
|
+
const [selectOptionState, setselectOptionState] = useState((_a2 = valueProp == null ? void 0 : valueProp.option) != null ? _a2 : options[0]);
|
|
14298
14339
|
const [enableSelectInput, setEnableSelectInput] = useState(false);
|
|
14340
|
+
const isInputValueControlled = typeof (valueProp == null ? void 0 : valueProp.input) !== "undefined";
|
|
14341
|
+
const inputValue = isInputValueControlled ? valueProp.input : inputValueState;
|
|
14342
|
+
const isOptionControlled = typeof (valueProp == null ? void 0 : valueProp.option) !== "undefined";
|
|
14343
|
+
const selectOption = isOptionControlled ? valueProp.option : selectOptionState;
|
|
14299
14344
|
const buttonRef = useRef();
|
|
14300
14345
|
const selectRef = useRef();
|
|
14301
|
-
const getNewValue = (option, input) => input ? { input: Number(input), option } : { option };
|
|
14346
|
+
const getNewValue = (option, input) => is(Number, input) ? { input: Number(input), option } : { option };
|
|
14302
14347
|
const handleInputChange = (newInputvalue) => {
|
|
14303
|
-
const newValue = getNewValue(selectOption, newInputvalue
|
|
14304
|
-
|
|
14348
|
+
const newValue = getNewValue(selectOption, newInputvalue);
|
|
14349
|
+
setInputValueState(newValue.input);
|
|
14305
14350
|
onChange == null ? void 0 : onChange(newValue);
|
|
14306
14351
|
};
|
|
14307
14352
|
const handleSelectClose = () => {
|
|
@@ -14313,9 +14358,11 @@ const ComboPicker = (_a) => {
|
|
|
14313
14358
|
};
|
|
14314
14359
|
const handleSelectChange = (selectedOption) => {
|
|
14315
14360
|
if (selectedOption) {
|
|
14316
|
-
|
|
14361
|
+
setselectOptionState(selectedOption);
|
|
14317
14362
|
onChange == null ? void 0 : onChange(getNewValue(selectedOption, inputValue));
|
|
14318
|
-
|
|
14363
|
+
if (isOpen) {
|
|
14364
|
+
handleSelectClose();
|
|
14365
|
+
}
|
|
14319
14366
|
}
|
|
14320
14367
|
};
|
|
14321
14368
|
const handleSelectToggle = () => {
|
|
@@ -14329,18 +14376,25 @@ const ComboPicker = (_a) => {
|
|
|
14329
14376
|
selectRef.current.focus();
|
|
14330
14377
|
}
|
|
14331
14378
|
}, [enableSelectInput]);
|
|
14379
|
+
useEffect(() => {
|
|
14380
|
+
if (!is(Number, inputValue) && defaultToZeroIfEmpty) {
|
|
14381
|
+
handleInputChange(clamp(min, max, 0));
|
|
14382
|
+
}
|
|
14383
|
+
}, [valueProp == null ? void 0 : valueProp.input]);
|
|
14332
14384
|
return /* @__PURE__ */ React.createElement(InputGroup, null, /* @__PURE__ */ React.createElement(
|
|
14333
14385
|
FormattedNumberInput,
|
|
14334
14386
|
__spreadValues$1({
|
|
14335
14387
|
width: "100%",
|
|
14336
|
-
onChange: handleInputChange,
|
|
14337
|
-
|
|
14388
|
+
onChange: (values) => handleInputChange(values.floatValue),
|
|
14389
|
+
value: inputValue,
|
|
14338
14390
|
placeholder,
|
|
14339
14391
|
size,
|
|
14340
14392
|
numberOfDecimals: precision,
|
|
14341
14393
|
preset: formatPreset,
|
|
14342
14394
|
disabled: isDisabled,
|
|
14343
|
-
readOnly: isReadOnly
|
|
14395
|
+
readOnly: isReadOnly,
|
|
14396
|
+
min,
|
|
14397
|
+
max
|
|
14344
14398
|
}, rest)
|
|
14345
14399
|
), /* @__PURE__ */ React.createElement(
|
|
14346
14400
|
InputRightElement,
|
|
@@ -14458,5 +14512,5 @@ const ComboPickerField = (_a) => {
|
|
|
14458
14512
|
);
|
|
14459
14513
|
};
|
|
14460
14514
|
|
|
14461
|
-
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert$1 as Alert, AspectRatio, AsyncError, Avatar$1 as Avatar, AvatarGroup, Badge$1 as Badge, Blinker$1 as Blinker, Blockquote$1 as Blockquote, Button$1 as Button, Capitalized$1 as Capitalized, Carousel, Checkbox$1 as Checkbox, CheckboxField, Clickable, ClipboardInput, Collapse, ColorPicker$1 as ColorPicker, ColorPickerField, ComboPicker, ComboPickerField, CreatableSelectDropdown, CustomTheme, DatePicker, DatePickerField, DatePickerLocaleWrapper, DateRangePicker, DateRangePickerField, DragAndDrop, DragHandle, DragItem, Draggable, DropZone, Droppable, EditableText, Fade, FastGrid, FastList, Field, FilePicker, FilePickerField, FlipButton$1 as FlipButton, FlipButtonGroup, FlipButtonGroupField, Form, FormLabel, FormattedNumberInput, FormattedNumberInputField, H1$1 as H1, H2$1 as H2, H3$1 as H3, H4$1 as H4, H5$1 as H5, H6$1 as H6, Icon$1 as Icon, IconButton, IntentButton, Label$1 as Label, Lead$1 as Lead, LoadingBar, MaskedTextInput, MediatoolThemeProvider, Menu, Modal, ModalBase, ModalBody, MultiFileList, MultiFilePicker, MultiFilePickerField, MultiFileUploader, MultiSort, NotificationIconButton, NumVal$1 as NumVal, NumberInput, NumberInputField, OrganizationLogo, OverflowGroup, P$1 as P, PaneDivider, PaneItem, PinInput, Popover$1 as Popover, ProgressBar, Radio, RadioGroup, RadioGroupField, ResizeHandle, ScaleFade, SearchBar, SearchBarField, Select, SelectField, Slide, SlideFade, Small$1 as Small, Sortable, SortableContainer, SortableItem, SortableList, Spinner$1 as Spinner, SplitPane, StatusPin, Step, StepList, StepPanel, StepStack, Steps, Switch, SwitchField, TabPanel, Table, Tabs, Tag, TagGroup, TagsInput, TextField, Textarea, TextareaField, Tiny$1 as Tiny, Toast, Toolbox, ToolboxContent, ToolboxFooter, ToolboxHeader, Tooltip, addAlpha, advancedParseFloat, clamp, createDebounceFunctionInstance, getChildrenWithProps, getContrastColor, getFieldError, getInitials, getMatchingValue, getShades, highlight, luminosity, ring, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useResizeWidth, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };
|
|
14515
|
+
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert$1 as Alert, AspectRatio, AsyncError, Avatar$1 as Avatar, AvatarGroup, Badge$1 as Badge, Blinker$1 as Blinker, Blockquote$1 as Blockquote, Button$1 as Button, Capitalized$1 as Capitalized, Carousel, Checkbox$1 as Checkbox, CheckboxField, Clickable, ClipboardInput, Collapse, ColorPicker$1 as ColorPicker, ColorPickerField, ComboPicker, ComboPickerField, CreatableSelectDropdown, CustomTheme, DatePicker, DatePickerField, DatePickerLocaleWrapper, DateRangePicker, DateRangePickerField, DragAndDrop, DragHandle, DragItem, Draggable, DropZone, Droppable, EditableText, Fade, FastGrid, FastList, Field, FilePicker, FilePickerField, FlipButton$1 as FlipButton, FlipButtonGroup, FlipButtonGroupField, Form, FormLabel, FormattedNumberInput, FormattedNumberInputField, H1$1 as H1, H2$1 as H2, H3$1 as H3, H4$1 as H4, H5$1 as H5, H6$1 as H6, Icon$1 as Icon, IconButton, IntentButton, Label$1 as Label, Lead$1 as Lead, LoadingBar, MaskedTextInput, MediatoolThemeProvider, Menu, Modal, ModalBase, ModalBody, MultiFileList, MultiFilePicker, MultiFilePickerField, MultiFileUploader, MultiSort, NotificationIconButton, NumVal$1 as NumVal, NumberInput, NumberInputField, OrganizationLogo, OverflowGroup, P$1 as P, PaneDivider, PaneItem, PinInput, Popover$1 as Popover, ProgressBar, Radio, RadioGroup, RadioGroupField, ResizeHandle, ScaleFade, SearchBar, SearchBarField, Select, SelectField, Slide, SlideFade, Small$1 as Small, Sortable, SortableContainer, SortableItem, SortableList, Spinner$1 as Spinner, SplitPane, StatusPin, Step, StepList, StepPanel, StepStack, Steps, Switch, SwitchField, TabPanel, Table, Tabs, Tag, TagGroup, TagsInput, TextField, Textarea, TextareaField, Tiny$1 as Tiny, Toast, Toolbox, ToolboxContent, ToolboxFooter, ToolboxHeader, Tooltip, addAlpha, advancedParseFloat, clamp, createDebounceFunctionInstance, getChildrenWithProps, getConsistentRandomColorFromString, getContrastColor, getFieldError, getInitials, getMatchingValue, getShades, highlight, luminosity, ring, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useResizeWidth, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };
|
|
14462
14516
|
//# sourceMappingURL=northlight.js.map
|