@northlight/ui 2.12.2 → 2.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,10 @@
1
- import { AccordionProps, AccordionButtonProps, AccordionPanelProps, AccordionItemProps, StackDirection, AvatarProps as AvatarProps$1, AlertProps as AlertProps$1, AspectRatioProps, StackProps, BadgeProps, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, 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, TableProps as TableProps$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';
1
+ import { AccordionProps, AccordionButtonProps, AccordionPanelProps, AccordionItemProps, StackDirection, AvatarProps as AvatarProps$1, AlertProps as AlertProps$1, AspectRatioProps, StackProps, BadgeProps, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, IconButtonProps as IconButtonProps$1, PopoverProps, 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, TableProps as TableProps$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
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, Hide, Highlight, Image, Input, InputAddon, InputGroup, InputLeftAddon, InputLeftElement, InputRightAddon, InputRightElement, Kbd, Link, LinkBox, 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, Show, SimpleGrid, Skeleton, SkeletonCircle, SkeletonText, Slider, SliderFilledTrack, SliderMark, SliderThumb, SliderTrack, Spacer, Stack, StackDivider, StackProps, Stat, StatArrow, StatGroup, StatHelpText, StatLabel, StatNumber, TabIndicator as StepIndicator, TabPanels as StepPanels, Tab, TabIndicator, TabList, TabPanels, TableBodyProps, TableCaption, TableCaptionProps, TableCellProps, TableColumnHeaderProps, TableContainer, TableContainerProps, TableFooterProps, TableHeadProps, TableRowProps, 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 { Props, GroupBase, MultiValue, SingleValue, ActionMeta, MenuListProps, SelectInstance, ChakraStylesConfig } from 'chakra-react-select';
4
4
  export { AsyncCreatableSelect, AsyncSelect, Select as ChakraReactSelect, CreatableSelect } from 'chakra-react-select';
5
5
  import * as React$1 from 'react';
6
- import React__default, { ComponentType, Ref, ComponentProps, ChangeEvent, InputHTMLAttributes, ReactNode, ReactElement, RefObject, MutableRefObject, EffectCallback, DependencyList } from 'react';
6
+ import React__default, { ComponentType, Ref, RefObject, ComponentProps, ChangeEvent, InputHTMLAttributes, ReactNode, ReactElement, MutableRefObject, EffectCallback, DependencyList } from 'react';
7
+ import * as react_hook_form from 'react-hook-form';
7
8
  import { RegisterOptions, FieldValues, UseFormReturn as UseFormReturn$1, SetValueConfig, FieldPath, Control, ControllerRenderProps, UseFormProps, FieldError, Merge, FieldErrorsImpl } from 'react-hook-form';
8
9
  export { useController, useFieldArray, useForm, useFormContext, useFormState, useWatch } from 'react-hook-form';
9
10
  import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
@@ -22,7 +23,11 @@ export * from '@dnd-kit/utilities';
22
23
  export { useInterval as dndUseInterval } from '@dnd-kit/utilities';
23
24
  export * from '@dnd-kit/modifiers';
24
25
  import { VariableSizeListProps, VariableSizeList, VariableSizeGridProps, VariableSizeGrid } from 'react-window';
26
+ import * as _chakra_ui_layout_dist_stack_stack_utils from '@chakra-ui/layout/dist/stack/stack.utils';
27
+ import * as _chakra_ui_radio_dist_radio_group from '@chakra-ui/radio/dist/radio-group';
25
28
  import * as react_select from 'react-select';
29
+ import * as _chakra_ui_switch_dist_switch from '@chakra-ui/switch/dist/switch';
30
+ import * as _chakra_ui_textarea_dist_textarea from '@chakra-ui/textarea/dist/textarea';
26
31
  import { Props as Props$1 } from 'react-input-mask';
27
32
  import { NumericFormatProps } from 'react-number-format';
28
33
  import * as _chakra_ui_toast_dist_toast_types_24f022fd from '@chakra-ui/toast/dist/toast.types-24f022fd';
@@ -137,6 +142,15 @@ interface SelectProps<T, K extends boolean> extends Omit<Props<T, K, GroupBase<T
137
142
  customOption?: ((option: T) => JSX.Element) | null;
138
143
  isMulti?: K;
139
144
  ref?: Ref<SelectInstance<T, K, GroupBase<T>>>;
145
+ /** Points to the container that the select refers to when deciding where to fit menu.
146
+ * E.g if you render the select in a modal you may want to sent
147
+ * containerRef equal to a ref pointing to that modal,
148
+ * because in that case the select dropdown change placement to try and stay within the modal */
149
+ containerRef?: UseAdaptiveMenuPlacementProps['containerRef'];
150
+ /** The min height that will be reserveed for the select dropdown, used to determine wheter to put
151
+ * dropdown on top of or bottom of select
152
+ */
153
+ dropdownMinHeightPx?: number;
140
154
  }
141
155
  type SelectFieldProps<T, K extends boolean = false> = SelectProps<T, K> & Omit<InputFieldProps, 'isMulti'> & {
142
156
  direction?: StackDirection;
@@ -145,6 +159,10 @@ type SelectFieldProps<T, K extends boolean = false> = SelectProps<T, K> & Omit<I
145
159
  validate?: RegisterOptions;
146
160
  isRequired?: boolean;
147
161
  };
162
+ interface UseAdaptiveMenuPlacementProps {
163
+ dropdownHeightPx: number;
164
+ containerRef?: RefObject<HTMLDivElement>;
165
+ }
148
166
 
149
167
  /**
150
168
  * Select component that provides a customizable and accessible select input.
@@ -271,7 +289,13 @@ render(<CustomSelect />);
271
289
  */
272
290
  declare const Select: <T extends Option, K extends boolean = false>(props: SelectProps<T, K> & React__default.RefAttributes<SelectInstance<T, K, GroupBase<T>>>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
273
291
 
274
- declare function SelectField<T extends Option, K extends boolean = false>({ name, label, options, direction, isMulti, isRequired, validate, isClearable, onChange: onChangeCallback, inputLeftElement, inputRightElement, ...rest }: SelectFieldProps<T, K>): JSX.Element;
292
+ declare const SelectField: <T extends Option, K extends boolean = false>(props: SelectProps<T, K> & Omit<InputFieldProps, "isMulti"> & {
293
+ direction?: _chakra_ui_layout_dist_stack_stack_utils.StackDirection | undefined;
294
+ name: string;
295
+ label: string;
296
+ validate?: react_hook_form.RegisterOptions | undefined;
297
+ isRequired?: boolean | undefined;
298
+ } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
275
299
 
276
300
  declare const getMatchingValue: <T extends Option, K extends boolean>(value: (K extends true ? string[] | T[] : string | T) | undefined, options: react_select.OptionsOrGroups<T, react_select.GroupBase<T>> | undefined) => T | T[] | undefined;
277
301
 
@@ -450,8 +474,9 @@ interface BlinkerProps {
450
474
  declare const Blinker: ({ color, size, isBlinking, ...rest }: BlinkerProps) => JSX.Element;
451
475
 
452
476
  type ButtonVariants = 'default' | 'danger' | 'success' | 'brand' | 'brandSubdued' | 'link' | 'ghost';
453
- type ButtonProps<As extends React.ElementType> = Omit<ButtonProps$1, 'as'> & GenericAsProps<As> & {
477
+ type ButtonProps<As extends React.ElementType> = Omit<ButtonProps$1, 'as' | 'size'> & Omit<GenericAsProps<As>, 'size'> & {
454
478
  variant?: ButtonVariants;
479
+ size?: 'xs' | 'sm' | 'md' | 'lg';
455
480
  };
456
481
  type GenericAsProps<As extends React.ElementType> = ({
457
482
  as?: As;
@@ -501,10 +526,9 @@ type GenericAsProps<As extends React.ElementType> = ({
501
526
  * render(<ExampleButton/>)
502
527
  * ?)
503
528
  */
504
- declare const Button: <As extends React__default.ElementType<any> = _chakra_ui_system_dist_system_types.ComponentWithAs<"button", _chakra_ui_button_dist_button.ButtonProps>>(props: Omit<_chakra_ui_button_dist_button.ButtonProps, "as"> & {
505
- as?: As | undefined;
506
- } & React__default.ComponentProps<As> & {
529
+ declare const Button: <As extends React__default.ElementType<any> = _chakra_ui_system_dist_system_types.ComponentWithAs<"button", _chakra_ui_button_dist_button.ButtonProps>>(props: Omit<_chakra_ui_button_dist_button.ButtonProps, "as" | "size"> & Omit<GenericAsProps<As>, "size"> & {
507
530
  variant?: ButtonVariants | undefined;
531
+ size?: "sm" | "md" | "lg" | "xs" | undefined;
508
532
  } & React__default.RefAttributes<unknown>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
509
533
 
510
534
  type CheckboxVariants = 'default' | 'rounded';
@@ -572,7 +596,7 @@ declare const Checkbox: ({ value, onChange, name, size, variant, ...rest }: Chec
572
596
  * ?)
573
597
  *
574
598
  */
575
- declare const CheckboxField: ({ name, label, variant, isRequired, validate, onChange: onChangeCallback, direction, labelPlacement, labelSize, ...rest }: CheckboxFieldProps) => JSX.Element;
599
+ declare const CheckboxField: (props: CheckboxFieldProps & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
576
600
 
577
601
  type ColorPickerSize = 'sm' | 'md' | 'lg';
578
602
  interface ColorPickerProps extends Omit<IconButtonProps$1, 'onChange' | 'value' | 'aria-label' | 'variant'> {
@@ -584,6 +608,7 @@ interface ColorPickerProps extends Omit<IconButtonProps$1, 'onChange' | 'value'
584
608
  value?: string | null;
585
609
  size?: ColorPickerSize;
586
610
  name?: string;
611
+ popoverProps?: PopoverProps;
587
612
  }
588
613
  type ColorButtonProps = {
589
614
  color: string;
@@ -628,7 +653,7 @@ type ColorPickerFieldProps = ColorPickerProps & {
628
653
  *
629
654
  *
630
655
  */
631
- declare const ColorPicker: ({ onChange, colors, expandedColors, value, name, size, ...rest }: ColorPickerProps) => JSX.Element;
656
+ declare const ColorPicker: ({ onChange, colors, expandedColors, value, name, size, popoverProps, ...rest }: ColorPickerProps) => JSX.Element;
632
657
 
633
658
  /**
634
659
  * The <ColorPicker /> component wrapped in a <Field />
@@ -828,7 +853,7 @@ declare const FlipButtonGroup: (props: FlipButtonGroupProps) => JSX.Element;
828
853
  * ?)
829
854
  *
830
855
  */
831
- declare const FlipButtonGroupField: ({ name, label, children, direction, isRequired, iconPlacement, onChange: onChangeCallback, validate, ...rest }: FlipButtonGroupFieldProps) => JSX.Element;
856
+ declare const FlipButtonGroupField: (props: FlipButtonGroupFieldProps & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
832
857
 
833
858
  interface DateRange {
834
859
  startDate: string;
@@ -995,7 +1020,7 @@ declare const DateRangePicker: (props: DateRangePickerProps) => JSX.Element;
995
1020
  * yyyy-mm-dd on the onSubmit callback on <Form>
996
1021
  *
997
1022
  */
998
- declare const DatePickerField: ({ name, minValue, maxValue, isRequired, direction, label, validate, firstDayOfWeek, onChange: onChangeCallback, inputLeftElement, inputRightElement, ...rest }: DatePickerFieldProps) => JSX.Element;
1023
+ declare const DatePickerField: (props: DatePickerFieldProps & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
999
1024
 
1000
1025
  /**
1001
1026
  * The <DateRangePicker /> component wrapped in a <Field />
@@ -1004,7 +1029,7 @@ declare const DatePickerField: ({ name, minValue, maxValue, isRequired, directio
1004
1029
  * @see {@link https://northlight.dev/reference/date-range-picker-field}
1005
1030
  *
1006
1031
  */
1007
- declare const DateRangePickerField: ({ name, minValue, maxValue, isRequired, direction, label, validate, firstDayOfWeek, onChange: onChangeCallback, isClearable, ...rest }: DateRangePickerFieldProps) => JSX.Element;
1032
+ declare const DateRangePickerField: (props: DateRangePickerFieldProps & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1008
1033
 
1009
1034
  interface ToolboxProps extends Omit<FlexProps, 'direction'> {
1010
1035
  isResizable?: boolean;
@@ -1225,7 +1250,7 @@ interface SearchBarFieldProps<T extends SearchBarOptionType, K extends boolean =
1225
1250
 
1226
1251
  declare const SearchBar: <T extends SearchBarOptionType, K extends boolean = false>(props: SearchBarProps<T, K> & React__default.RefAttributes<SelectInstance<T, K, GroupBase<T>>>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1227
1252
 
1228
- declare const SearchBarField: <T extends SearchBarOptionType, K extends boolean = false>({ name, label, direction, isMulti, isRequired, validate, isClearable, onChange: onChangeCallback, inputLeftElement, inputRightElement, ...rest }: SearchBarFieldProps<T, K>) => JSX.Element;
1253
+ declare const SearchBarField: <T extends SearchBarOptionType, K extends boolean = false>(props: SearchBarFieldProps<T, K> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1229
1254
 
1230
1255
  /**
1231
1256
  * Context used for all drag and drop components
@@ -1426,7 +1451,7 @@ declare const SortableItem: ({ itemLabel, dblClickThreshold, children, disableDr
1426
1451
  * ?)
1427
1452
  *
1428
1453
  */
1429
- declare const DragItem: (props: DragItemProps & React__default.RefAttributes<unknown>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1454
+ declare const DragItem: (props: DragItemProps & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1430
1455
 
1431
1456
  /**
1432
1457
  * Util component to display drag handle icon
@@ -1790,7 +1815,7 @@ interface LabelProps extends FormLabelProps$1 {
1790
1815
  * under the props tab to right should be passed down via **sx**_)
1791
1816
  *
1792
1817
  */
1793
- declare const Label: ({ children, size, sx, ...rest }: LabelProps) => JSX.Element;
1818
+ declare const Label: (props: LabelProps & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1794
1819
 
1795
1820
  type HeadingType = typeof Heading;
1796
1821
  type BodyType = typeof P;
@@ -1807,7 +1832,7 @@ interface FormLabelProps extends LabelProps {
1807
1832
  * @see {@link https://northlight.dev/reference/form-label}
1808
1833
  *
1809
1834
  */
1810
- declare const FormLabel: ({ children: label, ...rest }: FormLabelProps) => JSX.Element;
1835
+ declare const FormLabel: (props: FormLabelProps & React__default.RefAttributes<HTMLLabelElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
1811
1836
 
1812
1837
  interface FastListProps extends Omit<VariableSizeListProps, 'itemSize' | 'children' | 'height' | 'width' | 'direction'> {
1813
1838
  itemSize: number | ((index: number) => number);
@@ -2493,7 +2518,18 @@ declare const NumberInput: ({ variant, size, onChange, onInputChange, enableStep
2493
2518
  * @see {@link https://northlight.dev/reference/number-input-field}
2494
2519
  *
2495
2520
  */
2496
- declare const NumberInputField: ({ name, label, direction, isRequired, validate, onChange: onChangeCallback, onlyAcceptPercentage, inputLeftElement, inputRightElement, ...rest }: NumberInputFieldProps) => JSX.Element;
2521
+ declare const NumberInputField: (props: Omit<NumberInputProps, "onChange"> & InputFieldProps & {
2522
+ name: string;
2523
+ label: string;
2524
+ validate?: react_hook_form.RegisterOptions | undefined;
2525
+ size?: NumberInputSizeProps | undefined;
2526
+ isRequired?: boolean | undefined;
2527
+ unit?: string | undefined;
2528
+ direction?: _chakra_ui_layout_dist_stack_stack_utils.StackDirection | undefined;
2529
+ onChange?: ((e: string | number) => void) | undefined;
2530
+ inputLeftElement?: React__default.ReactNode;
2531
+ inputRightElement?: React__default.ReactNode;
2532
+ } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2497
2533
 
2498
2534
  declare const advancedParseFloat: (value: number | string) => string | number;
2499
2535
 
@@ -2638,7 +2674,14 @@ declare const RadioGroup: ({ direction, children, name, ...rest }: RadioGroupPro
2638
2674
  * @see {@link https://northlight.dev/reference/radio-group-field}
2639
2675
  *
2640
2676
  */
2641
- declare const RadioGroupField: ({ name, label, children, direction, isRequired, validate, onChange: onChangeCallback, ...rest }: RadioFieldGroupProps) => JSX.Element;
2677
+ declare const RadioGroupField: (props: _chakra_ui_radio_dist_radio_group.RadioGroupProps & {
2678
+ direction?: _chakra_ui_layout_dist_stack_stack_utils.StackDirection | undefined;
2679
+ name: string;
2680
+ label: string;
2681
+ validate?: react_hook_form.RegisterOptions | undefined;
2682
+ isRequired?: boolean | undefined;
2683
+ value?: string | undefined;
2684
+ } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2642
2685
 
2643
2686
  type SpinnerProps = SpinnerProps$1;
2644
2687
 
@@ -2660,7 +2703,8 @@ type SwitchFieldProps = SwitchProps$1 & {
2660
2703
  validate?: RegisterOptions;
2661
2704
  isRequired?: boolean;
2662
2705
  direction?: StackDirection;
2663
- labelPosition?: 'left' | 'right';
2706
+ labelPlacement?: 'left' | 'right';
2707
+ labelSize?: '2xs' | 'xs' | 'md' | 'lg';
2664
2708
  };
2665
2709
 
2666
2710
  /**
@@ -2694,18 +2738,30 @@ declare const Switch: ({ value, onChange, name, size, ...rest }: SwitchProps) =>
2694
2738
  * @see {@link https://northlight.dev/reference/switch-field}
2695
2739
  * @example (Example)
2696
2740
  * ## Basic
2741
+ * Tip:
2742
+ * * For `labelPlacement` you can use `"left" | "right"`
2743
+ * * For `labelSize` you can use `"2xs" | "xs" | "md" | "lg"` or leave it blank
2697
2744
  * (?
2698
2745
  * <Form initialValues={{name: ''}}>
2699
2746
  * <SwitchField
2700
2747
  * name="terms"
2701
2748
  * label="I agree to the Terms & Conditions"
2702
- * labelPosition="left"
2749
+ * labelPlacement="right"
2750
+ * labelSize="md"
2703
2751
  * />
2704
2752
  * </Form>
2705
2753
  * ?)
2706
2754
  *
2707
2755
  */
2708
- declare const SwitchField: ({ name, label, isRequired, validate, onChange: onChangeCallback, direction, labelPosition, ...rest }: SwitchFieldProps) => JSX.Element;
2756
+ declare const SwitchField: (props: _chakra_ui_switch_dist_switch.SwitchProps & {
2757
+ name: string;
2758
+ label: string;
2759
+ validate?: react_hook_form.RegisterOptions | undefined;
2760
+ isRequired?: boolean | undefined;
2761
+ direction?: _chakra_ui_layout_dist_stack_stack_utils.StackDirection | undefined;
2762
+ labelPlacement?: "right" | "left" | undefined;
2763
+ labelSize?: "md" | "lg" | "2xs" | "xs" | undefined;
2764
+ } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2709
2765
 
2710
2766
  interface TableProps extends Omit<TableProps$1, 'variant'> {
2711
2767
  variant?: TableProps$1['variant'] | 'rounded';
@@ -2817,7 +2873,7 @@ interface TagGroupProps extends StackProps {
2817
2873
  * ?)
2818
2874
  *
2819
2875
  */
2820
- declare const Tag: (props: TagProps & React__default.RefAttributes<unknown>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2876
+ declare const Tag: (props: TagProps & React__default.RefAttributes<HTMLSpanElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2821
2877
 
2822
2878
  /**
2823
2879
  * Used when rending multiple tags in limited container for responsive layout
@@ -2869,7 +2925,14 @@ type TextareaFieldProps = TextareaProps$1 & {
2869
2925
  */
2870
2926
  declare const Textarea: ({ size, onChange, name, value, ...rest }: TextareaProps) => JSX.Element;
2871
2927
 
2872
- declare const TextareaField: ({ name, label, isRequired, validate, direction, onChange: onChangeCallback, ...rest }: TextareaFieldProps) => JSX.Element;
2928
+ declare const TextareaField: (props: _chakra_ui_textarea_dist_textarea.TextareaProps & {
2929
+ name: string;
2930
+ label: string;
2931
+ validate?: react_hook_form.RegisterOptions | undefined;
2932
+ isRequired?: boolean | undefined;
2933
+ size?: TextSizeProps | undefined;
2934
+ direction?: _chakra_ui_layout_dist_stack_stack_utils.StackDirection | undefined;
2935
+ } & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2873
2936
 
2874
2937
  interface TextInputFormatter {
2875
2938
  format: (value: string) => string;
@@ -2903,6 +2966,8 @@ interface FormattedNumberInputProps extends Omit<NumericFormatProps, 'onChange'
2903
2966
  isPercentage?: boolean;
2904
2967
  /** Will round up and restrict number of decimals */
2905
2968
  numberOfDecimals?: number;
2969
+ inputLeftElement?: React.ReactNode;
2970
+ inputRightElement?: React.ReactNode;
2906
2971
  }
2907
2972
  interface FormattedNumberInputFieldProps extends FormattedNumberInputProps {
2908
2973
  name: string;
@@ -2953,7 +3018,7 @@ interface FormattedNumberInputFieldProps extends FormattedNumberInputProps {
2953
3018
  ?)
2954
3019
 
2955
3020
  */
2956
- declare const FormattedNumberInput: ({ preset, isPercentage, onChange, value, numberOfDecimals, max, min, ...rest }: FormattedNumberInputProps) => JSX.Element;
3021
+ declare const FormattedNumberInput: ({ preset, isPercentage, onChange, value, numberOfDecimals, max, min, inputLeftElement, inputRightElement, ...rest }: FormattedNumberInputProps) => JSX.Element;
2957
3022
 
2958
3023
  /**
2959
3024
  * The formatted number input component wrapped in a <Field />
@@ -2972,7 +3037,7 @@ declare const FormattedNumberInput: ({ preset, isPercentage, onChange, value, nu
2972
3037
  * ?)
2973
3038
  *
2974
3039
  */
2975
- declare const FormattedNumberInputField: ({ name, label, isRequired, validate, onChange: onChangeCallback, direction, ...rest }: FormattedNumberInputFieldProps) => JSX.Element;
3040
+ declare const FormattedNumberInputField: (props: FormattedNumberInputFieldProps & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2976
3041
 
2977
3042
  declare const MaskedTextInput: ({ mask, maskPlaceholder, alwaysShowMask, name, value, placeholder, onChange, onBlur, ...rest }: MaskedTextInputProps) => JSX.Element;
2978
3043
 
@@ -2986,7 +3051,7 @@ declare const MaskedTextInput: ({ mask, maskPlaceholder, alwaysShowMask, name, v
2986
3051
  *
2987
3052
  *
2988
3053
  */
2989
- declare const TextField: ({ name, label, as: As, isRequired, validate, direction, onChange: onChangeCallback, inputLeftElement, inputRightElement, ...rest }: TextFieldProps) => JSX.Element;
3054
+ declare const TextField: (props: TextFieldProps & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
2990
3055
 
2991
3056
  interface ToastProps extends AlertProps {
2992
3057
  title?: string;
@@ -3341,97 +3406,7 @@ You can move up the form state using a ref as well
3341
3406
  */
3342
3407
  declare const Form: <FormValues extends FieldValues>(props: FormProps<FormValues> & React__default.RefAttributes<UseFormReturn$1<FormValues>>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
3343
3408
 
3344
- /**
3345
- * Wraps children under form context
3346
- * @see TextField
3347
- * @see Form
3348
- * @see {@link https://northlight.dev/reference/field}
3349
- *
3350
- * @example (Example)
3351
- * ## Input example
3352
- * (?
3353
- * <Form initialValues={{name: ''}}>
3354
- * <Box p="2">
3355
- * <Field name="name" label="Input name">
3356
- * {({value, onChange}) => (
3357
- * <Input value={value} onChange={onChange} />
3358
- * )}
3359
- * </Field>
3360
- * </Box>
3361
- *
3362
- * </Form>
3363
- * ?)
3364
- * <br />
3365
- * As you can see the field component acts as a middleman to connect
3366
- * any component to the form context, via a controlled value and onChange prop.
3367
- * Most of the common use cases for field,
3368
- * such as text input have been abstracted into their own components, for example _TextField_
3369
- *
3370
- * @example (Example)
3371
- * ## Example with validation and form submition
3372
- * (?
3373
- * () => {
3374
- * const toast = useToast()
3375
- * const handleSubmit =(v) => {
3376
- * toast({title: 'Sent Message', description: `"${v.message}"`})
3377
- * }
3378
- * return (
3379
- * <Form initialValues={{message: ''}} onSubmit={handleSubmit}>
3380
- * <Stack p="2">
3381
- * <Field
3382
- * name="message"
3383
- * label="Write email"
3384
- * isRequired={true}
3385
- * validate={{maxLength: {message: 'Message must be under 30 characters', value: 30}}}
3386
- * >
3387
- * {({value, onChange}) => (
3388
- * <Textarea value={value} onChange={onChange} />
3389
- * )}
3390
- * </Field>
3391
- * <Button type="submit" variant="brand">Send Message</Button>
3392
- * </Stack>
3393
- *
3394
- * </Form>
3395
- * )
3396
- * }
3397
- * ?)
3398
- *
3399
- * @example (Example)
3400
- * ## Type-safety
3401
- * There are multiple ways to provide types for
3402
- * the field callback values. To ensure that each
3403
- * component within the field receives the correct
3404
- * value, it's essential to make the field aware
3405
- * of the form state values. When the Field component
3406
- * does not receive any types, the "value" callback
3407
- * argument will have the type of "any".
3408
- * <br /><br />
3409
- * ### Passing down the control prop (Recommended)
3410
- * (?
3411
- * <Form initialValues={{username: 'Alex'}}>
3412
- * {
3413
- * ({ control }) => {
3414
- * <Box p="2">
3415
- * <Field name="username" label="Input name" control={ control }>
3416
- * {({value, onChange}) => ( // "value" has type of "string"
3417
- * <Input value={value} onChange={onChange} />
3418
- * )}
3419
- * </Field>
3420
- * </Box>
3421
- * }
3422
- * }
3423
- * </Form>
3424
- * ?)
3425
- * <br /><br />
3426
- * ### Specifying generic arguments
3427
- * You can also specify generic arguments on the Field
3428
- * component to ensure that "value" has a valid type.
3429
- * The passed generic type combined with the valid
3430
- * "name" property ensures that "value" has the expected
3431
- * type received from the generic type:
3432
- * `<Field<MyFormBody> name="username">...</Field>`
3433
- */
3434
- declare function Field<FormValues extends FieldValues = FieldValues, FieldName extends FieldPath<FormValues> = FieldPath<FormValues>>({ name, label, children, direction, isRequired, noLabelConnection, validate, control: passedControl, ...rest }: FieldProps<FormValues, FieldName>): JSX.Element;
3409
+ declare const Field: <FormValues extends FieldValues = FieldValues, FieldName extends FieldPath<FormValues> = FieldPath<FormValues>>(props: FieldProps<FormValues, FieldName> & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
3435
3410
 
3436
3411
  declare const useSetValueRefreshed: () => (name: any, value: any, options: SetValueOptionsType) => void;
3437
3412
 
@@ -3525,7 +3500,7 @@ interface ClipboardInputProps extends InputProps {
3525
3500
  * ?)
3526
3501
  *
3527
3502
  */
3528
- declare const ClipboardInput: ({ size, value, "aria-label": ariaLabel, ...rest }: ClipboardInputProps) => JSX.Element;
3503
+ declare const ClipboardInput: (props: ClipboardInputProps & React__default.RefAttributes<HTMLDivElement>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
3529
3504
 
3530
3505
  interface ClickableProps extends UseClickableProps {
3531
3506
  href?: string;
@@ -3766,4 +3741,4 @@ declare const useDidUpdateEffect: (effect: EffectCallback, dependencies: Depende
3766
3741
  declare const theme: Record<string, any>;
3767
3742
  declare const tottTheme: Record<string, any>;
3768
3743
 
3769
- 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, FormattedNumberInputField, FormattedNumberInputFieldProps, FormattedNumberInputPreset, FormattedNumberInputProps, GenericAsProps, H1, H2, H3, H4, H5, H6, HeadingProps, HeadingType, Icon, IconButton, IconButtonProps, IconProps, InputFieldProps, Label, LabelProps, LabelSizes, LabelType, Lead, ListenersType, MaskedTextInput, MaskedTextInputProps, MediatoolThemeProvider, MediatoolThemeProviderProps, Message, Modal, ModalBase, 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, PresetOptions, 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, 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, TransitionDirection, UseFormReturn, UseSelectCallbacksProps, UseToastOptions, addAlpha, advancedParseFloat, createDebounceFunctionInstance, getChildrenWithProps, getContrastColor, getFieldError, getInitials, getMatchingValue, getShades, highlight, luminosity, ring, statusIconMap, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };
3744
+ 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, FormattedNumberInputField, FormattedNumberInputFieldProps, FormattedNumberInputPreset, FormattedNumberInputProps, GenericAsProps, H1, H2, H3, H4, H5, H6, HeadingProps, HeadingType, Icon, IconButton, IconButtonProps, IconProps, InputFieldProps, Label, LabelProps, LabelSizes, LabelType, Lead, ListenersType, MaskedTextInput, MaskedTextInputProps, MediatoolThemeProvider, MediatoolThemeProviderProps, Message, Modal, ModalBase, 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, PresetOptions, 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, 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, TransitionDirection, UseAdaptiveMenuPlacementProps, UseFormReturn, UseSelectCallbacksProps, UseToastOptions, addAlpha, advancedParseFloat, createDebounceFunctionInstance, getChildrenWithProps, getContrastColor, getFieldError, getInitials, getMatchingValue, getShades, highlight, luminosity, ring, statusIconMap, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };