@northlight/ui 1.5.9 → 2.1.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/CHANGELOG.md +1609 -0
- package/dist/es/northlight.d.mts +46 -7
- package/dist/es/northlight.mjs +115 -51
- package/dist/es/northlight.mjs.map +1 -1
- package/dist/ts/types.d.ts +46 -7
- package/dist/umd/northlight.js +120 -47
- package/dist/umd/northlight.js.map +1 -1
- package/dist/umd/northlight.min.js +3 -3
- package/dist/umd/northlight.min.js.map +1 -1
- package/package.json +2 -3
- package/LICENSE +0 -21
package/dist/ts/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AccordionProps, AccordionButtonProps, AccordionPanelProps, AccordionItemProps, AvatarProps as AvatarProps$1, AlertProps as AlertProps$1, AspectRatioProps, StackProps, BadgeProps, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, StackDirection, IconButtonProps as IconButtonProps$1, InputProps, FlexProps, BoxProps, TagProps as TagProps$1, IconProps as IconProps$1, SystemStyleObject, HeadingProps as HeadingProps$1, TextProps, FormLabelProps as FormLabelProps$1, Heading, Text, ModalProps as ModalProps$1, NumberInputProps as NumberInputProps$1, PinInputProps as PinInputProps$1, RadioProps as RadioProps$1, RadioGroupProps as RadioGroupProps$1, SpinnerProps as SpinnerProps$1, SwitchProps as SwitchProps$1, TabsProps as TabsProps$1, TabPanelProps as TabPanelProps$1, TextareaProps as TextareaProps$1, UseToastOptions as UseToastOptions$1, FadeProps as FadeProps$1, ScaleFadeProps as ScaleFadeProps$1, SlideProps as SlideProps$1, SlideFadeProps as SlideFadeProps$1, CollapseProps as CollapseProps$1, TabListProps, TabProps, LinkProps, GridProps, GridItemProps, EditableProps as EditableProps$1 } from '@chakra-ui/react';
|
|
2
|
-
export { AbsoluteCenter, AccordionButtonProps, AccordionIcon, AccordionIconProps, AccordionItemProps, AccordionPanelProps, AccordionProps, AlertDescription, AlertDialog, AlertDialogBody, AlertDialogCloseButton, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertIcon, AlertTitle, AspectRatioProps, BadgeProps, Box, BoxProps, BreadcrumbItem as Breadcrumb, BreadcrumbLink, BreadcrumbSeparator, Breadcrumb as Breadcrumbs, ButtonGroup, Card, CardBody, CardFooter, CardHeader, Center, Modal as ChakraModal, CheckboxGroup, Circle, CircularProgress, CircularProgressLabel, CloseButton, Code, Container, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, Editable, EditableInput, EditablePreview, Flex, FormControl, FormErrorMessage, FormHelperText, Grid, GridItem, HStack, Heading, Highlight, Image, Input, InputAddon, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Kbd, Link, LinkOverlay, List, ListIcon, ListItem, Menu, MenuButton, MenuCommand, MenuDivider, MenuGroup, MenuIcon, MenuItem, MenuItemOption, MenuList, MenuOptionGroup, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, NumberDecrementStepper, NumberIncrementStepper, OrderedList, PinInputField, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, RangeSlider, RangeSliderFilledTrack, RangeSliderMark, RangeSliderThumb, RangeSliderTrack, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack, Spacer, Stack, StackDivider, Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber, TabIndicator as StepIndicator, TabPanels as StepPanels, Tab, TabIndicator, TabList, TabPanels, Table, TableCaption, TableContainer, TagCloseButton, TagLabel, TagLeftIcon, TagRightIcon, Tbody, Td, Text, Tfoot, Th, Thead, Tooltip, Tr, UnorderedList, VStack, VisuallyHidden, VisuallyHiddenInput, Wrap, WrapItem, useBoolean, useBreakpoint, useBreakpointValue, useClipboard, useControllableProp, useControllableState, useDisclosure, useEditable, useEditableControls, useEditableState, useMediaQuery, useMergeRefs, useNumberInput, useOutsideClick, usePrefersReducedMotion, useRadio, useRadioGroup, useTab, useTabs, useTheme, useToken } from '@chakra-ui/react';
|
|
2
|
+
export { AbsoluteCenter, AccordionButtonProps, AccordionIcon, AccordionIconProps, AccordionItemProps, AccordionPanelProps, AccordionProps, AlertDescription, AlertDialog, AlertDialogBody, AlertDialogCloseButton, AlertDialogContent, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertIcon, AlertTitle, AspectRatioProps, BadgeProps, Box, BoxProps, BreadcrumbItem as Breadcrumb, BreadcrumbLink, BreadcrumbSeparator, Breadcrumb as Breadcrumbs, ButtonGroup, Card, CardBody, CardFooter, CardHeader, Center, Modal as ChakraModal, CheckboxGroup, Circle, CircularProgress, CircularProgressLabel, CloseButton, Code, Container, Divider, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerFooter, DrawerHeader, DrawerOverlay, Editable, EditableInput, EditablePreview, Flex, FormControl, FormErrorMessage, FormHelperText, Grid, GridItem, HStack, Heading, Highlight, Image, Input, InputAddon, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Kbd, Link, LinkOverlay, List, ListIcon, ListItem, Menu, MenuButton, MenuCommand, MenuDivider, MenuGroup, MenuIcon, MenuItem, MenuItemOption, MenuList, MenuOptionGroup, ModalBody, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, NumberDecrementStepper, NumberIncrementStepper, OrderedList, PinInputField, Popover, PopoverAnchor, PopoverArrow, PopoverBody, PopoverCloseButton, PopoverContent, PopoverFooter, PopoverHeader, PopoverTrigger, Portal, RangeSlider, RangeSliderFilledTrack, RangeSliderMark, RangeSliderThumb, RangeSliderTrack, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack, Spacer, Stack, StackDivider, Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber, TabIndicator as StepIndicator, TabPanels as StepPanels, Tab, TabIndicator, TabList, TabPanels, Table, TableCaption, TableContainer, TagCloseButton, TagLabel, TagLeftIcon, TagRightIcon, Tbody, Td, Text, Tfoot, Th, Thead, Tooltip, Tr, UnorderedList, VStack, VisuallyHidden, VisuallyHiddenInput, Wrap, WrapItem, useBoolean, useBreakpoint, useBreakpointValue, useClipboard, useControllableProp, useControllableState, useDisclosure, useEditable, useEditableControls, useEditableState, useInterval, useMediaQuery, useMergeRefs, useNumberInput, useOutsideClick, usePrefersReducedMotion, useRadio, useRadioGroup, useTab, useTabs, useTheme, useToken } from '@chakra-ui/react';
|
|
3
3
|
import * as React$1 from 'react';
|
|
4
4
|
import React__default, { ChangeEvent, ComponentType, InputHTMLAttributes, ReactNode, ReactElement } from 'react';
|
|
5
5
|
import { RegisterOptions, FieldValues, UseFormReturn as UseFormReturn$1, SetValueConfig, ControllerRenderProps, UseFormProps, FieldError, Merge, FieldErrorsImpl } from 'react-hook-form';
|
|
@@ -13,6 +13,7 @@ import { Props, GroupBase, ActionMeta, ChakraStylesConfig, SelectInstance, MenuL
|
|
|
13
13
|
export { AsyncCreatableSelect, AsyncSelect, Select as ChakraReactSelect, CreatableSelect } from 'chakra-react-select';
|
|
14
14
|
import { DndContextProps, UseDroppableArguments, UseDraggableArguments, UniqueIdentifier, CollisionDetection, SensorDescriptor, SensorOptions } from '@dnd-kit/core';
|
|
15
15
|
export * from '@dnd-kit/core';
|
|
16
|
+
export { useInterval as dndUseInterval } from '@dnd-kit/core';
|
|
16
17
|
import { UseSortableArguments, SortingStrategy, SortableContextProps } from '@dnd-kit/sortable';
|
|
17
18
|
export * from '@dnd-kit/sortable';
|
|
18
19
|
import { SyntheticListenerMap } from '@dnd-kit/core/dist/hooks/utilities';
|
|
@@ -310,6 +311,8 @@ interface CheckboxFieldProps extends CheckboxProps$1 {
|
|
|
310
311
|
isRequired?: boolean;
|
|
311
312
|
variant?: CheckboxVariants;
|
|
312
313
|
direction?: StackDirection;
|
|
314
|
+
labelPlacement?: 'left' | 'right';
|
|
315
|
+
labelSize?: '2xs' | 'xs' | 'md' | 'lg';
|
|
313
316
|
}
|
|
314
317
|
|
|
315
318
|
/**
|
|
@@ -346,9 +349,21 @@ declare const Checkbox: ({ value, onChange, name, size, variant, ...rest }: Chec
|
|
|
346
349
|
* meant to be used only inside <Form />
|
|
347
350
|
* @see Checkbox
|
|
348
351
|
* @see {@link https://northlight.dev/reference/checkbox-field}
|
|
352
|
+
* @example (Example)
|
|
353
|
+
* ## Basic
|
|
354
|
+
* (?
|
|
355
|
+
* <Form initialValues={{name: ''}}>
|
|
356
|
+
* <CheckboxField
|
|
357
|
+
* name="terms"
|
|
358
|
+
* label="I agree to the Terms & Conditions"
|
|
359
|
+
* labelPlacement="left"
|
|
360
|
+
* labelSize="md"
|
|
361
|
+
* />
|
|
362
|
+
* </Form>
|
|
363
|
+
* ?)
|
|
349
364
|
*
|
|
350
365
|
*/
|
|
351
|
-
declare const CheckboxField: ({ name, label, variant, isRequired, validate, direction, ...rest }: CheckboxFieldProps) => JSX.Element;
|
|
366
|
+
declare const CheckboxField: ({ name, label, variant, isRequired, validate, onChange: onChangeCallback, direction, labelPlacement, labelSize, ...rest }: CheckboxFieldProps) => JSX.Element;
|
|
352
367
|
|
|
353
368
|
type ColorPickerSize = 'sm' | 'md' | 'lg';
|
|
354
369
|
interface ColorPickerProps extends Omit<IconButtonProps$1, 'onChange' | 'value' | 'aria-label' | 'variant'> {
|
|
@@ -469,6 +484,7 @@ interface FlipButtonProps {
|
|
|
469
484
|
icon?: ComponentType<any>;
|
|
470
485
|
value: string;
|
|
471
486
|
label?: string;
|
|
487
|
+
iconPlacement?: 'left' | 'right' | 'none';
|
|
472
488
|
children?: ((props: CustomFlipButtonProps) => JSX.Element) | string;
|
|
473
489
|
}
|
|
474
490
|
interface FlipButtonGroupProps extends Omit<FlipButtonProps, 'value' | 'children' | 'label'> {
|
|
@@ -477,6 +493,7 @@ interface FlipButtonGroupProps extends Omit<FlipButtonProps, 'value' | 'children
|
|
|
477
493
|
children?: React__default.ReactNode[] | React__default.ReactNode;
|
|
478
494
|
name?: string;
|
|
479
495
|
value?: string | string[];
|
|
496
|
+
iconPlacement?: 'left' | 'right' | 'none';
|
|
480
497
|
/** This enables passing styles directly to the div closes to the flip buttons */
|
|
481
498
|
sx?: CSSObject;
|
|
482
499
|
}
|
|
@@ -486,6 +503,7 @@ interface FlipButtonGroupFieldProps extends FlipButtonGroupProps {
|
|
|
486
503
|
isRequired?: boolean;
|
|
487
504
|
validate?: RegisterOptions;
|
|
488
505
|
value?: string;
|
|
506
|
+
iconPlacement?: 'left' | 'right' | 'none';
|
|
489
507
|
}
|
|
490
508
|
|
|
491
509
|
/**
|
|
@@ -601,7 +619,7 @@ declare const FlipButtonGroup: (props: FlipButtonGroupProps) => JSX.Element;
|
|
|
601
619
|
* ?)
|
|
602
620
|
*
|
|
603
621
|
*/
|
|
604
|
-
declare const FlipButtonGroupField: ({ name, label, children, direction, isRequired, onChange: onChangeCallback, validate, ...rest }: FlipButtonGroupFieldProps) => JSX.Element;
|
|
622
|
+
declare const FlipButtonGroupField: ({ name, label, children, direction, isRequired, iconPlacement, onChange: onChangeCallback, validate, ...rest }: FlipButtonGroupFieldProps) => JSX.Element;
|
|
605
623
|
|
|
606
624
|
type Color = 'blue' | 'gray' | 'red' | 'pink' | 'green' | 'orange' | 'purple' | 'yellow' | 'mediatoolBlue';
|
|
607
625
|
type ColorGrade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
@@ -1337,12 +1355,16 @@ declare function MultiSort<itemKeys extends string | number | symbol>({ items: s
|
|
|
1337
1355
|
* @example (Example)
|
|
1338
1356
|
* ### With custom component
|
|
1339
1357
|
* (?
|
|
1358
|
+
* () => {
|
|
1359
|
+
* const [items, setItems] = useState([ { name: 'item1' }, { name: 'item2' }, { name: 'item3' } ])
|
|
1360
|
+
* return (
|
|
1340
1361
|
* <Stack>
|
|
1341
1362
|
*
|
|
1342
1363
|
* <SortableList
|
|
1343
|
-
items={
|
|
1364
|
+
items={ items }
|
|
1344
1365
|
createKey={ (item) => item.name }
|
|
1345
1366
|
disableDrag={ true }
|
|
1367
|
+
onChange={setItems}
|
|
1346
1368
|
>
|
|
1347
1369
|
{ ({ name }, listeners, { isOver }) => (
|
|
1348
1370
|
<HStack>
|
|
@@ -1352,6 +1374,7 @@ declare function MultiSort<itemKeys extends string | number | symbol>({ items: s
|
|
|
1352
1374
|
) }
|
|
1353
1375
|
</SortableList>
|
|
1354
1376
|
</Stack>
|
|
1377
|
+
)}
|
|
1355
1378
|
* ?)
|
|
1356
1379
|
<br />
|
|
1357
1380
|
If disableDrag=false, then when the user double clicks it will trigger
|
|
@@ -1360,7 +1383,7 @@ the default behaviour of the rendered component instead of the dragging,
|
|
|
1360
1383
|
*
|
|
1361
1384
|
*
|
|
1362
1385
|
*/
|
|
1363
|
-
declare function SortableList<T>({ children, items
|
|
1386
|
+
declare function SortableList<T>({ children, items, collisionDetection, createKey, strategy, onChange, onMovedItem, displayOverlay, sensors, dblClickThreshold, disableDrag, }: SortableListProps<T>): JSX.Element;
|
|
1364
1387
|
|
|
1365
1388
|
/**
|
|
1366
1389
|
* Used with multi sort to render a sortable list inside a droppable
|
|
@@ -2565,6 +2588,7 @@ type SwitchFieldProps = SwitchProps$1 & {
|
|
|
2565
2588
|
validate?: RegisterOptions;
|
|
2566
2589
|
isRequired?: boolean;
|
|
2567
2590
|
direction?: StackDirection;
|
|
2591
|
+
labelPosition?: 'left' | 'right';
|
|
2568
2592
|
};
|
|
2569
2593
|
|
|
2570
2594
|
/**
|
|
@@ -2596,9 +2620,20 @@ declare const Switch: ({ value, onChange, name, size, ...rest }: SwitchProps) =>
|
|
|
2596
2620
|
* meant to be used only inside <Form />
|
|
2597
2621
|
* @see switch
|
|
2598
2622
|
* @see {@link https://northlight.dev/reference/switch-field}
|
|
2623
|
+
* @example (Example)
|
|
2624
|
+
* ## Basic
|
|
2625
|
+
* (?
|
|
2626
|
+
* <Form initialValues={{name: ''}}>
|
|
2627
|
+
* <SwitchField
|
|
2628
|
+
* name="terms"
|
|
2629
|
+
* label="I agree to the Terms & Conditions"
|
|
2630
|
+
* labelPosition="left"
|
|
2631
|
+
* />
|
|
2632
|
+
* </Form>
|
|
2633
|
+
* ?)
|
|
2599
2634
|
*
|
|
2600
2635
|
*/
|
|
2601
|
-
declare const SwitchField: ({ name, label, isRequired, validate, onChange: onChangeCallback, direction, ...rest }: SwitchFieldProps) => JSX.Element;
|
|
2636
|
+
declare const SwitchField: ({ name, label, isRequired, validate, onChange: onChangeCallback, direction, labelPosition, ...rest }: SwitchFieldProps) => JSX.Element;
|
|
2602
2637
|
|
|
2603
2638
|
interface TabsProps extends TabsProps$1 {
|
|
2604
2639
|
}
|
|
@@ -3415,6 +3450,10 @@ It takes all the props that a normal stack takes, with the addition of a
|
|
|
3415
3450
|
*/
|
|
3416
3451
|
declare const StepStack: ({ children, spacing, rowHeight, ...rest }: StepStackProps) => JSX.Element;
|
|
3417
3452
|
|
|
3453
|
+
declare const useDebounce: <T>(value: T, delay: number) => T;
|
|
3454
|
+
|
|
3455
|
+
declare const useLoadingMessage: (prefix?: string, delay?: number) => string;
|
|
3456
|
+
|
|
3418
3457
|
declare const useArrowFocus: (columns: number) => {
|
|
3419
3458
|
defaultArrows: (e: any) => void;
|
|
3420
3459
|
focusPrevious: ({ repeat, wrap, }?: {
|
|
@@ -3447,4 +3486,4 @@ declare const useSelectCallbacks: <T extends BasicOption>({ onChange, onAdd, onR
|
|
|
3447
3486
|
declare const theme: Record<string, any>;
|
|
3448
3487
|
declare const tottTheme: Record<string, any>;
|
|
3449
3488
|
|
|
3450
|
-
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert, AlertProps, AlertVariants, AspectRatio, AsyncError, AsyncErrorProps, Avatar, AvatarBadgeProps, AvatarGroup, AvatarGroupProps, AvatarProps, Badge, BasicOption, Blinker, BlinkerProps, BlockVariant, BlockVariantColorTuple, 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, ConfirmDeleteModalProps, CurrentTheme, CustomContainerPropsType, CustomElementType, CustomFlipButtonProps, CustomFlipButtonPropsType, CustomTheme, DatePicker, DatePickerField, DatePickerFieldProps, DatePickerProps, DateRange, DateRangePicker, DateRangePickerField, DateRangePickerFieldProps, DateRangePickerProps, DragAndDrop, DragHandle, DragHandleProps, DragItem, DragItemProps, Draggable, DraggableProps, DropZone, DropZoneProps, Droppable, DroppableProps, DurationType, EditableControlsProps, EditableProps, EditableSizes, EditableText, 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, FormattedNumberInputProps, H1, H2, H3, H4, H5, H6, HeadingProps, HeadingType, Icon, IconButton, IconButtonProps, IconProps, InputFieldProps, Label, LabelProps, LabelSizes, LabelType, Lead, ListenersType, MaskedTextInput, MaskedTextInputProps, MediatoolThemeProvider, MediatoolThemeProviderProps, Modal, ModalBooleans, ModalProps, ModalSizes, MultiFileList, MultiFileListProps, MultiFilePicker, MultiFilePickerField, MultiFilePickerFieldProps, MultiFilePickerProps, MultiFileUploader, MultiFileUploaderProps, MultiItemType, MultiSort, MultiSortProps, NotificationIconButton, NotificationIconButtonProps, NumberInput, NumberInputField, NumberInputFieldProps, NumberInputProps, NumberInputSizeProps, NumberInputStepperProps, OffsetType, Option, OrganizationLogo, OrganizationLogoProps, OverflowGroup, OverflowGroupProps, OverflowIndicatorProps, P, PProps, PaneDivider, PaneItem, PinInput, PinInputProps, PinSize, PinSizeTuple, PinVariant, ProgressBar, Radio, RadioFieldGroupProps, RadioFieldProps, RadioGroup, RadioGroupField, RadioGroupProps, RadioProps, 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, StatusBlock, StatusBlockProps, StatusPin, StatusPinProps, Step, StepList, StepListProps, StepPanel, StepPanelProps, StepProps, StepStack, Steps, StepsProps, StylizedType, Switch, SwitchField, SwitchFieldProps, SwitchProps, TabPanel, TabPanelProps, Tabs, TabsProps, Tag, TagGroup, TagGroupProps, TagProps, TextField, TextFieldProps, TextInputFormatter, TextSizeProps, Textarea, TextareaField, TextareaFieldProps, TextareaProps, Tiny, Toast, ToastProps, Toolbox, ToolboxContent, ToolboxContentProps, ToolboxFooter, ToolboxFooterProps, ToolboxHeader, ToolboxHeaderProps, ToolboxProps, TransitionDirection, UseFormReturn, UseSelectCallbacksProps, UseToastOptions, addAlpha, advancedParseFloat, createDebounceFunctionInstance, getChildrenWithProps, getContrastColor, getFieldError, getInitials, getShades, highlight, luminosity, ring, statusIconMap, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useOverflowGroup, useSelectCallbacks, useSetValueRefreshed, useToast };
|
|
3489
|
+
export { Accordion, AccordionButton, AccordionItem, AccordionPanel, Alert, AlertProps, AlertVariants, AspectRatio, AsyncError, AsyncErrorProps, Avatar, AvatarBadgeProps, AvatarGroup, AvatarGroupProps, AvatarProps, Badge, BasicOption, Blinker, BlinkerProps, BlockVariant, BlockVariantColorTuple, 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, ConfirmDeleteModalProps, CurrentTheme, CustomContainerPropsType, CustomElementType, CustomFlipButtonProps, CustomFlipButtonPropsType, CustomTheme, DatePicker, DatePickerField, DatePickerFieldProps, DatePickerProps, DateRange, DateRangePicker, DateRangePickerField, DateRangePickerFieldProps, DateRangePickerProps, DragAndDrop, DragHandle, DragHandleProps, DragItem, DragItemProps, Draggable, DraggableProps, DropZone, DropZoneProps, Droppable, DroppableProps, DurationType, EditableControlsProps, EditableProps, EditableSizes, EditableText, 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, FormattedNumberInputProps, H1, H2, H3, H4, H5, H6, HeadingProps, HeadingType, Icon, IconButton, IconButtonProps, IconProps, InputFieldProps, Label, LabelProps, LabelSizes, LabelType, Lead, ListenersType, MaskedTextInput, MaskedTextInputProps, MediatoolThemeProvider, MediatoolThemeProviderProps, Modal, ModalBooleans, ModalProps, ModalSizes, MultiFileList, MultiFileListProps, MultiFilePicker, MultiFilePickerField, MultiFilePickerFieldProps, MultiFilePickerProps, MultiFileUploader, MultiFileUploaderProps, MultiItemType, MultiSort, MultiSortProps, NotificationIconButton, NotificationIconButtonProps, NumberInput, NumberInputField, NumberInputFieldProps, NumberInputProps, NumberInputSizeProps, NumberInputStepperProps, OffsetType, Option, OrganizationLogo, OrganizationLogoProps, OverflowGroup, OverflowGroupProps, OverflowIndicatorProps, P, PProps, PaneDivider, PaneItem, PinInput, PinInputProps, PinSize, PinSizeTuple, PinVariant, ProgressBar, Radio, RadioFieldGroupProps, RadioFieldProps, RadioGroup, RadioGroupField, RadioGroupProps, RadioProps, 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, StatusBlock, StatusBlockProps, StatusPin, StatusPinProps, Step, StepList, StepListProps, StepPanel, StepPanelProps, StepProps, StepStack, Steps, StepsProps, StylizedType, Switch, SwitchField, SwitchFieldProps, SwitchProps, TabPanel, TabPanelProps, Tabs, TabsProps, Tag, TagGroup, TagGroupProps, TagProps, TextField, TextFieldProps, TextInputFormatter, TextSizeProps, Textarea, TextareaField, TextareaFieldProps, TextareaProps, Tiny, Toast, ToastProps, Toolbox, ToolboxContent, ToolboxContentProps, ToolboxFooter, ToolboxFooterProps, ToolboxHeader, ToolboxHeaderProps, ToolboxProps, TransitionDirection, UseFormReturn, UseSelectCallbacksProps, UseToastOptions, addAlpha, advancedParseFloat, createDebounceFunctionInstance, getChildrenWithProps, getContrastColor, getFieldError, getInitials, getShades, highlight, luminosity, ring, statusIconMap, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useLoadingMessage, useOverflowGroup, useSelectCallbacks, useSetValueRefreshed, useToast };
|
package/dist/umd/northlight.js
CHANGED
|
@@ -1480,6 +1480,31 @@
|
|
|
1480
1480
|
);
|
|
1481
1481
|
};
|
|
1482
1482
|
|
|
1483
|
+
const useDebounce = (value, delay) => {
|
|
1484
|
+
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
|
1485
|
+
React.useEffect(() => {
|
|
1486
|
+
const handler = setTimeout(() => {
|
|
1487
|
+
setDebouncedValue(value);
|
|
1488
|
+
}, delay);
|
|
1489
|
+
return () => {
|
|
1490
|
+
clearTimeout(handler);
|
|
1491
|
+
};
|
|
1492
|
+
}, [value, delay]);
|
|
1493
|
+
return debouncedValue;
|
|
1494
|
+
};
|
|
1495
|
+
|
|
1496
|
+
const useLoadingMessage = (prefix = "", delay = 300) => {
|
|
1497
|
+
const [dots, setDots] = React.useState(".");
|
|
1498
|
+
react.useInterval(() => {
|
|
1499
|
+
if (dots.length === 3) {
|
|
1500
|
+
setDots(".");
|
|
1501
|
+
} else {
|
|
1502
|
+
setDots(`${dots}.`);
|
|
1503
|
+
}
|
|
1504
|
+
}, delay);
|
|
1505
|
+
return `${prefix}${dots}`;
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1483
1508
|
const useArrowFocus = (columns) => {
|
|
1484
1509
|
const {
|
|
1485
1510
|
focusNext: next,
|
|
@@ -1654,35 +1679,59 @@
|
|
|
1654
1679
|
variant,
|
|
1655
1680
|
isRequired,
|
|
1656
1681
|
validate,
|
|
1657
|
-
|
|
1682
|
+
onChange: onChangeCallback = ramda.identity,
|
|
1683
|
+
direction = "row",
|
|
1684
|
+
labelPlacement = "left",
|
|
1685
|
+
labelSize = "md"
|
|
1658
1686
|
} = _b, rest = __objRest$15(_b, [
|
|
1659
1687
|
"name",
|
|
1660
1688
|
"label",
|
|
1661
1689
|
"variant",
|
|
1662
1690
|
"isRequired",
|
|
1663
1691
|
"validate",
|
|
1664
|
-
"
|
|
1692
|
+
"onChange",
|
|
1693
|
+
"direction",
|
|
1694
|
+
"labelPlacement",
|
|
1695
|
+
"labelSize"
|
|
1665
1696
|
]);
|
|
1666
|
-
return /* @__PURE__ */ React.createElement(
|
|
1667
|
-
|
|
1697
|
+
return /* @__PURE__ */ React.createElement(
|
|
1698
|
+
react.Box,
|
|
1668
1699
|
{
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
direction,
|
|
1672
|
-
isRequired,
|
|
1673
|
-
validate
|
|
1700
|
+
w: label ? "full" : "fit-content",
|
|
1701
|
+
display: "inline-flex"
|
|
1674
1702
|
},
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1703
|
+
/* @__PURE__ */ React.createElement(
|
|
1704
|
+
Field,
|
|
1705
|
+
{
|
|
1678
1706
|
name,
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
},
|
|
1707
|
+
label: "",
|
|
1708
|
+
isRequired,
|
|
1709
|
+
direction,
|
|
1710
|
+
validate
|
|
1711
|
+
},
|
|
1712
|
+
({ onChange, value }) => /* @__PURE__ */ React.createElement(
|
|
1713
|
+
react.Flex,
|
|
1714
|
+
{
|
|
1715
|
+
gap: 2,
|
|
1716
|
+
direction: labelPlacement === "left" ? "row-reverse" : "row"
|
|
1717
|
+
},
|
|
1718
|
+
/* @__PURE__ */ React.createElement(
|
|
1719
|
+
Checkbox$1,
|
|
1720
|
+
__spreadValues$1B({
|
|
1721
|
+
name,
|
|
1722
|
+
onChange: (e) => {
|
|
1723
|
+
onChange(e);
|
|
1724
|
+
onChangeCallback(e);
|
|
1725
|
+
},
|
|
1726
|
+
value,
|
|
1727
|
+
variant,
|
|
1728
|
+
"data-testid": "checkbox-field-test-id"
|
|
1729
|
+
}, rest)
|
|
1730
|
+
),
|
|
1731
|
+
/* @__PURE__ */ React.createElement(Label$1, { htmlFor: name, sx: { fontWeight: "normal" }, size: labelSize }, label)
|
|
1732
|
+
)
|
|
1684
1733
|
)
|
|
1685
|
-
)
|
|
1734
|
+
);
|
|
1686
1735
|
};
|
|
1687
1736
|
|
|
1688
1737
|
var __defProp$1A = Object.defineProperty;
|
|
@@ -2111,7 +2160,8 @@
|
|
|
2111
2160
|
isMulti,
|
|
2112
2161
|
isDisabled = false,
|
|
2113
2162
|
icon,
|
|
2114
|
-
value
|
|
2163
|
+
value,
|
|
2164
|
+
iconPlacement = "left"
|
|
2115
2165
|
} = _a, rest = __objRest$11(_a, [
|
|
2116
2166
|
"children",
|
|
2117
2167
|
"size",
|
|
@@ -2119,7 +2169,8 @@
|
|
|
2119
2169
|
"isMulti",
|
|
2120
2170
|
"isDisabled",
|
|
2121
2171
|
"icon",
|
|
2122
|
-
"value"
|
|
2172
|
+
"value",
|
|
2173
|
+
"iconPlacement"
|
|
2123
2174
|
]);
|
|
2124
2175
|
const state = React.useContext(FlipButtonContext);
|
|
2125
2176
|
const ref = React.useRef(null);
|
|
@@ -2161,13 +2212,13 @@
|
|
|
2161
2212
|
react.HStack,
|
|
2162
2213
|
{
|
|
2163
2214
|
spacing: isSelected || icon ? 2 : 0,
|
|
2164
|
-
sx: ramda.
|
|
2215
|
+
sx: ramda.mergeAll([button, isFocused ? focusStyles : {}, { flexDirection: iconPlacement === "left" ? "row" : "row-reverse" }]),
|
|
2165
2216
|
"aria-checked": isSelected,
|
|
2166
2217
|
"aria-disabled": isDisabled,
|
|
2167
2218
|
as: "label"
|
|
2168
2219
|
},
|
|
2169
2220
|
/* @__PURE__ */ React.createElement("input", __spreadValues$1w({}, flipButtonProps)),
|
|
2170
|
-
icon ? /* @__PURE__ */ React.createElement(Icon$1, { as: icon || icons.CheckSolid, sx: buttonIcon }) : isSelected && /* @__PURE__ */ React.createElement(react.SlideFade, { in: isSelected }, /* @__PURE__ */ React.createElement(Icon$1, { as: icon || icons.CheckSolid, sx: buttonIcon })),
|
|
2221
|
+
icon && iconPlacement !== "none" ? /* @__PURE__ */ React.createElement(Icon$1, { as: icon || icons.CheckSolid, sx: buttonIcon }) : isSelected && iconPlacement !== "none" && /* @__PURE__ */ React.createElement(react.SlideFade, { in: isSelected }, /* @__PURE__ */ React.createElement(Icon$1, { as: icon || icons.CheckSolid, sx: buttonIcon })),
|
|
2171
2222
|
/* @__PURE__ */ React.createElement(react.Text, { textAlign: "center" }, children)
|
|
2172
2223
|
);
|
|
2173
2224
|
};
|
|
@@ -2210,6 +2261,7 @@
|
|
|
2210
2261
|
children,
|
|
2211
2262
|
direction = "row",
|
|
2212
2263
|
isDisabled = false,
|
|
2264
|
+
iconPlacement = "left",
|
|
2213
2265
|
size,
|
|
2214
2266
|
variant,
|
|
2215
2267
|
icon,
|
|
@@ -2220,6 +2272,7 @@
|
|
|
2220
2272
|
"children",
|
|
2221
2273
|
"direction",
|
|
2222
2274
|
"isDisabled",
|
|
2275
|
+
"iconPlacement",
|
|
2223
2276
|
"size",
|
|
2224
2277
|
"variant",
|
|
2225
2278
|
"icon",
|
|
@@ -2233,6 +2286,7 @@
|
|
|
2233
2286
|
isMulti,
|
|
2234
2287
|
variant,
|
|
2235
2288
|
isDisabled,
|
|
2289
|
+
iconPlacement,
|
|
2236
2290
|
icon,
|
|
2237
2291
|
size
|
|
2238
2292
|
}, child.props)) : child
|
|
@@ -2291,6 +2345,7 @@
|
|
|
2291
2345
|
children,
|
|
2292
2346
|
direction,
|
|
2293
2347
|
isRequired,
|
|
2348
|
+
iconPlacement = "left",
|
|
2294
2349
|
onChange: onChangeCallback = ramda.identity,
|
|
2295
2350
|
validate
|
|
2296
2351
|
} = _b, rest = __objRest$$(_b, [
|
|
@@ -2299,6 +2354,7 @@
|
|
|
2299
2354
|
"children",
|
|
2300
2355
|
"direction",
|
|
2301
2356
|
"isRequired",
|
|
2357
|
+
"iconPlacement",
|
|
2302
2358
|
"onChange",
|
|
2303
2359
|
"validate"
|
|
2304
2360
|
]);
|
|
@@ -2320,7 +2376,8 @@
|
|
|
2320
2376
|
onChangeCallback(e);
|
|
2321
2377
|
},
|
|
2322
2378
|
direction,
|
|
2323
|
-
value
|
|
2379
|
+
value,
|
|
2380
|
+
iconPlacement
|
|
2324
2381
|
}, rest),
|
|
2325
2382
|
children
|
|
2326
2383
|
)
|
|
@@ -5943,7 +6000,7 @@
|
|
|
5943
6000
|
|
|
5944
6001
|
function SortableList({
|
|
5945
6002
|
children,
|
|
5946
|
-
items
|
|
6003
|
+
items,
|
|
5947
6004
|
collisionDetection,
|
|
5948
6005
|
createKey = ramda.identity,
|
|
5949
6006
|
strategy,
|
|
@@ -5955,7 +6012,6 @@
|
|
|
5955
6012
|
dblClickThreshold = 300,
|
|
5956
6013
|
disableDrag = false
|
|
5957
6014
|
}) {
|
|
5958
|
-
const [items, setItems] = React.useState(sortableItems);
|
|
5959
6015
|
const [activeItem, setActiveItem] = React.useState(null);
|
|
5960
6016
|
const identifierItems = React.useMemo(() => ramda.map(createKey, items), [items]);
|
|
5961
6017
|
const customSensors = core.useSensors(
|
|
@@ -5973,15 +6029,12 @@
|
|
|
5973
6029
|
const handleDragEnd = (event) => {
|
|
5974
6030
|
const { active, over } = event;
|
|
5975
6031
|
if (active && over && active.id !== over.id) {
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
onChange(newItems);
|
|
5983
|
-
return newItems;
|
|
5984
|
-
});
|
|
6032
|
+
const prevIds = ramda.map(createKey, items);
|
|
6033
|
+
const oldIndex = ramda.indexOf(active.id, prevIds);
|
|
6034
|
+
const newIndex = ramda.indexOf(over.id, prevIds);
|
|
6035
|
+
onMovedItem({ item: items[oldIndex], oldIndex, newIndex });
|
|
6036
|
+
const newItems = sortable.arrayMove(items, oldIndex, newIndex);
|
|
6037
|
+
onChange(newItems);
|
|
5985
6038
|
}
|
|
5986
6039
|
};
|
|
5987
6040
|
return /* @__PURE__ */ React.createElement(
|
|
@@ -10877,35 +10930,45 @@
|
|
|
10877
10930
|
isRequired,
|
|
10878
10931
|
validate,
|
|
10879
10932
|
onChange: onChangeCallback = ramda.identity,
|
|
10880
|
-
direction = "row"
|
|
10933
|
+
direction = "row",
|
|
10934
|
+
labelPosition = "right"
|
|
10881
10935
|
} = _b, rest = __objRest$d(_b, [
|
|
10882
10936
|
"name",
|
|
10883
10937
|
"label",
|
|
10884
10938
|
"isRequired",
|
|
10885
10939
|
"validate",
|
|
10886
10940
|
"onChange",
|
|
10887
|
-
"direction"
|
|
10941
|
+
"direction",
|
|
10942
|
+
"labelPosition"
|
|
10888
10943
|
]);
|
|
10889
10944
|
return /* @__PURE__ */ React.createElement(react.Box, { w: label ? "full" : "fit-content" }, /* @__PURE__ */ React.createElement(
|
|
10890
10945
|
Field,
|
|
10891
10946
|
{
|
|
10892
10947
|
name,
|
|
10893
|
-
label,
|
|
10948
|
+
label: "",
|
|
10894
10949
|
isRequired,
|
|
10895
10950
|
direction,
|
|
10896
10951
|
validate
|
|
10897
10952
|
},
|
|
10898
10953
|
({ onChange, value }) => /* @__PURE__ */ React.createElement(
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10904
|
-
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10954
|
+
react.Flex,
|
|
10955
|
+
{
|
|
10956
|
+
gap: 2,
|
|
10957
|
+
direction: labelPosition === "left" ? "row-reverse" : "row"
|
|
10958
|
+
},
|
|
10959
|
+
/* @__PURE__ */ React.createElement(
|
|
10960
|
+
Switch,
|
|
10961
|
+
__spreadValues$i({
|
|
10962
|
+
name,
|
|
10963
|
+
onChange: (e) => {
|
|
10964
|
+
onChange(e);
|
|
10965
|
+
onChangeCallback(e);
|
|
10966
|
+
},
|
|
10967
|
+
value,
|
|
10968
|
+
"data-testid": "switch-field-test-id"
|
|
10969
|
+
}, rest)
|
|
10970
|
+
),
|
|
10971
|
+
label && /* @__PURE__ */ React.createElement(Label$1, { htmlFor: name }, label)
|
|
10909
10972
|
)
|
|
10910
10973
|
));
|
|
10911
10974
|
};
|
|
@@ -12526,6 +12589,10 @@
|
|
|
12526
12589
|
enumerable: true,
|
|
12527
12590
|
get: function () { return react.useEditableState; }
|
|
12528
12591
|
});
|
|
12592
|
+
Object.defineProperty(exports, 'useInterval', {
|
|
12593
|
+
enumerable: true,
|
|
12594
|
+
get: function () { return react.useInterval; }
|
|
12595
|
+
});
|
|
12529
12596
|
Object.defineProperty(exports, 'useMediaQuery', {
|
|
12530
12597
|
enumerable: true,
|
|
12531
12598
|
get: function () { return react.useMediaQuery; }
|
|
@@ -12610,6 +12677,10 @@
|
|
|
12610
12677
|
enumerable: true,
|
|
12611
12678
|
get: function () { return chakraReactSelect.CreatableSelect; }
|
|
12612
12679
|
});
|
|
12680
|
+
Object.defineProperty(exports, 'dndUseInterval', {
|
|
12681
|
+
enumerable: true,
|
|
12682
|
+
get: function () { return core.useInterval; }
|
|
12683
|
+
});
|
|
12613
12684
|
exports.Accordion = Accordion;
|
|
12614
12685
|
exports.AccordionButton = AccordionButton;
|
|
12615
12686
|
exports.AccordionItem = AccordionItem;
|
|
@@ -12740,6 +12811,8 @@
|
|
|
12740
12811
|
exports.trimFormValues = trimFormValues;
|
|
12741
12812
|
exports.useArrowFocus = useArrowFocus;
|
|
12742
12813
|
exports.useCurrentTheme = useCurrentTheme;
|
|
12814
|
+
exports.useDebounce = useDebounce;
|
|
12815
|
+
exports.useLoadingMessage = useLoadingMessage;
|
|
12743
12816
|
exports.useOverflowGroup = useOverflowGroup;
|
|
12744
12817
|
exports.useSelectCallbacks = useSelectCallbacks;
|
|
12745
12818
|
exports.useSetValueRefreshed = useSetValueRefreshed;
|