@northlight/ui 2.11.0 → 2.12.1

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,16 +1,18 @@
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, 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, 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
+ import { Props, GroupBase, MultiValue, SingleValue, ActionMeta, MenuListProps, SelectInstance, ChakraStylesConfig } from 'chakra-react-select';
4
+ export { AsyncCreatableSelect, AsyncSelect, Select as ChakraReactSelect, CreatableSelect } from 'chakra-react-select';
3
5
  import * as React$1 from 'react';
4
- import React__default, { ChangeEvent, ComponentType, InputHTMLAttributes, ReactNode, Ref, ReactElement, RefObject, MutableRefObject, EffectCallback, DependencyList } from 'react';
6
+ import React__default, { ComponentType, Ref, ComponentProps, ChangeEvent, InputHTMLAttributes, ReactNode, ReactElement, RefObject, MutableRefObject, EffectCallback, DependencyList } from 'react';
5
7
  import { RegisterOptions, FieldValues, UseFormReturn as UseFormReturn$1, SetValueConfig, FieldPath, Control, ControllerRenderProps, UseFormProps, FieldError, Merge, FieldErrorsImpl } from 'react-hook-form';
6
8
  export { useController, useFieldArray, useForm, useFormContext, useFormState, useWatch } from 'react-hook-form';
9
+ import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
10
+ import * as _chakra_ui_button_dist_button from '@chakra-ui/button/dist/button';
7
11
  import { CheckboxGroupState } from '@react-stately/checkbox';
8
12
  import { RadioGroupState } from '@react-stately/radio';
9
13
  import { CSSObject } from '@emotion/react';
10
14
  import { DateValue } from '@internationalized/date';
11
15
  import { AriaDatePickerProps, AriaDateRangePickerProps } from '@react-aria/datepicker';
12
- import { Props, GroupBase, ActionMeta, ChakraStylesConfig, SelectInstance, MultiValue, SingleValue, MenuListProps } from 'chakra-react-select';
13
- export { AsyncCreatableSelect, AsyncSelect, Select as ChakraReactSelect, CreatableSelect } from 'chakra-react-select';
14
16
  import { DndContextProps, UseDroppableArguments, UseDraggableArguments, UniqueIdentifier, CollisionDetection, SensorDescriptor, SensorOptions, Modifiers } from '@dnd-kit/core';
15
17
  export * from '@dnd-kit/core';
16
18
  import { UseSortableArguments, SortingStrategy, SortableContextProps } from '@dnd-kit/sortable';
@@ -20,7 +22,7 @@ export * from '@dnd-kit/utilities';
20
22
  export { useInterval as dndUseInterval } from '@dnd-kit/utilities';
21
23
  export * from '@dnd-kit/modifiers';
22
24
  import { VariableSizeListProps, VariableSizeList, VariableSizeGridProps, VariableSizeGrid } from 'react-window';
23
- import * as _chakra_ui_system_dist_system_types from '@chakra-ui/system/dist/system.types';
25
+ import * as react_select from 'react-select';
24
26
  import { Props as Props$1 } from 'react-input-mask';
25
27
  import { NumericFormatProps } from 'react-number-format';
26
28
  import * as _chakra_ui_toast_dist_toast_types_24f022fd from '@chakra-ui/toast/dist/toast.types-24f022fd';
@@ -100,6 +102,205 @@ declare const AccordionPanel: (props: AccordionPanelProps) => JSX.Element;
100
102
 
101
103
  declare const AccordionItem: (props: AccordionItemProps) => JSX.Element;
102
104
 
105
+ type Color = 'blue' | 'gray' | 'red' | 'pink' | 'green' | 'orange' | 'purple' | 'yellow' | 'mediatoolBlue';
106
+ type ColorGrade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
107
+ type ColorShades = Record<ColorGrade, string>;
108
+
109
+ interface InputFieldProps {
110
+ inputLeftElement?: React.ReactNode;
111
+ inputRightElement?: React.ReactNode;
112
+ }
113
+
114
+ type Size$1 = 'sm' | 'md' | 'lg';
115
+ interface Option {
116
+ label: string;
117
+ value: string;
118
+ }
119
+ interface SelectProps<T, K extends boolean> extends Omit<Props<T, K, GroupBase<T>>, 'onChange' | 'value' | 'isMulti'> {
120
+ /** Whatever is currently selected by the select will be controlled by value prop, if value is
121
+ * of type string then it will automatically pair it up with matching object from options list */
122
+ value?: K extends true ? T[] | string[] : T | string;
123
+ /** Take a look at the second argument, the event,
124
+ * for info as to which specific element was added */
125
+ onChange?: (option: K extends true ? MultiValue<T> : SingleValue<T>, event: ActionMeta<T>) => void;
126
+ onAdd?: (val: unknown) => void;
127
+ onRemove?: (val: unknown) => void;
128
+ /** Used for accessibility */
129
+ name?: string;
130
+ size?: Size$1;
131
+ 'data-testid'?: string;
132
+ loadingList?: ComponentType<MenuListProps<T, K, GroupBase<T>>> | undefined;
133
+ /** Custom icon that will be put to the faremost right of the component */
134
+ icon?: ComponentType<any>;
135
+ /** Custom icon that will be put to the faremost left of the component */
136
+ leftIcon?: ComponentType<any>;
137
+ customOption?: ((option: T) => JSX.Element) | null;
138
+ isMulti?: K;
139
+ ref?: Ref<SelectInstance<T, K, GroupBase<T>>>;
140
+ }
141
+ type SelectFieldProps<T, K extends boolean = false> = SelectProps<T, K> & Omit<InputFieldProps, 'isMulti'> & {
142
+ direction?: StackDirection;
143
+ name: string;
144
+ label: string;
145
+ validate?: RegisterOptions;
146
+ isRequired?: boolean;
147
+ };
148
+
149
+ /**
150
+ * Select component that provides a customizable and accessible select input.
151
+ * It is built on top of Chakra UI and Chakra React Select components.
152
+ *
153
+ * @see SearchBar
154
+ * @see {@link https://northlight.dev/reference/select}
155
+ *
156
+ * @example (Example)
157
+ * ## Single Select
158
+ * (?
159
+ * <Select
160
+ * options={[{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }]}
161
+ * onChange={(value, action) => console.log('Selected:', value)}
162
+ * />
163
+ * ?)
164
+ *
165
+ * @example (Example)
166
+ * ## Clearable Select
167
+ * (?
168
+ * <Select
169
+ * options={[{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }]}
170
+ * onChange={(value, action) => console.log('Selected:', value)}
171
+ * isClearable={ true }
172
+ * />
173
+ * ?)
174
+ *
175
+ * @example (Example)
176
+ * ## Multi select
177
+ * (?
178
+ * <Select
179
+ * options={[{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }]}
180
+ * onChange={(value, action) => console.log('Selected:', value)}
181
+ * isMulti
182
+ * />
183
+ * ?)
184
+ *
185
+ * @example (Example)
186
+ * ## Event meta
187
+ * _There is a second argument passed to the handlechange that can be useful
188
+ * for knowing which elements where adding/removed_
189
+ * (?
190
+ * () => {
191
+ * const handleChange = (val, e) => {
192
+ switch (e.action) {
193
+ case 'select-option':
194
+ //on add value
195
+ console.log(e.option)
196
+ break
197
+ case 'pop-value':
198
+ //on remove value
199
+ console.log(e.removedValue.categoryKey)
200
+ break
201
+ default:
202
+ break
203
+ }
204
+ }
205
+ * return <Select onChange={handleChange} options={[{label: '1', value: '1'}]} isMulti={true}/>
206
+ *
207
+ * }
208
+ * ?)
209
+ *
210
+ * @example (Example)
211
+ * ##Customizing
212
+ * There are two special props for easy customization
213
+ * * customOption
214
+ * * customTag
215
+ *
216
+ * This are themselves react components
217
+ * (?
218
+ +const customOption = ({ label }) => (
219
+ <HStack>
220
+ <Avatar name={label} />
221
+ <P>{label}</P>
222
+ </HStack>
223
+ );
224
+
225
+ const customTag = ({ label }) => {
226
+ const [ isIncluded, setIsIncluded ] = useState(true)
227
+ const toggle = () => setIsIncluded((prev) => !prev)
228
+
229
+ return (
230
+ <Flex>
231
+ <Button
232
+ size="xs"
233
+ onClick={ toggle }
234
+ onMouseDown={ (e) => e.stopPropagation() }
235
+ >
236
+ { isIncluded ? 'Include' : 'Exclude' }
237
+ </Button>
238
+ <Tag>{ label }</Tag>
239
+ </Flex>
240
+ )
241
+ }
242
+
243
+ const CustomSelect = () => (
244
+ <Select
245
+ customOption={customOption}
246
+ customTag={ customTag }
247
+ isMulti={true}
248
+ options={[
249
+ { label: 'Option 1', value: '1' },
250
+ { label: 'Option 2', value: '2' },
251
+ ]}
252
+
253
+ />
254
+ );
255
+
256
+ render(<CustomSelect />);
257
+ *
258
+ * ?)
259
+ *
260
+ *
261
+ * @example (Example)
262
+ * ## Testing
263
+ * You can grab the test id for the select by
264
+ * **screen.getByTestId('custom-testid)
265
+ * .children[0].children[2].children[0].children[1].children[0]**
266
+ * (?
267
+ * <Select
268
+ * data-testid="custom-test-id"
269
+ * />
270
+ * ?)
271
+ */
272
+ 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
+
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;
275
+
276
+ 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
+
278
+ interface TagsInputProps<T> extends Omit<SelectProps<T, true>, 'value' | 'formatCreateLabel' | 'isValidNewOption' | 'onAdd' | 'onRemove' | 'leftIcon' | 'icon' | 'customOption'> {
279
+ value?: MultiValue<T>;
280
+ formatCreateLabel?: (textInputValue: string) => string;
281
+ isValidNewOption?: (option: string, selectOptions: MultiValue<T>) => boolean;
282
+ }
283
+
284
+ /**
285
+ * Tags Input, based of react creatable select, is meant to select
286
+ * multiple tags. Follows styling of textarea and is resizable.
287
+ *
288
+ * @see {@link https://northlight.dev/reference/tags-input}
289
+ * @example (Example)
290
+ * ## Simple
291
+ * (?
292
+ * <TagsInput />
293
+ * ?)
294
+ *
295
+ * @example (Example)
296
+ * ## With suggestions
297
+ * (?
298
+ * <TagsInput options={[{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }]}/>
299
+ * ?)
300
+ *
301
+ */
302
+ declare function TagsInput<T extends Option>({ options, onChange, isLoading, loadingList, 'data-testid': testId, value, ...rest }: TagsInputProps<T>): JSX.Element;
303
+
103
304
  interface OrganizationLogoProps extends AvatarProps$1 {
104
305
  name: string;
105
306
  image?: string;
@@ -249,9 +450,12 @@ interface BlinkerProps {
249
450
  declare const Blinker: ({ color, size, isBlinking, ...rest }: BlinkerProps) => JSX.Element;
250
451
 
251
452
  type ButtonVariants = 'default' | 'danger' | 'success' | 'brand' | 'brandSubdued' | 'link' | 'ghost';
252
- interface ButtonProps extends ButtonProps$1 {
453
+ type ButtonProps<As extends React.ElementType> = Omit<ButtonProps$1, 'as'> & GenericAsProps<As> & {
253
454
  variant?: ButtonVariants;
254
- }
455
+ };
456
+ type GenericAsProps<As extends React.ElementType> = ({
457
+ as?: As;
458
+ } & ComponentProps<As>);
255
459
 
256
460
  /**
257
461
  * @see {@link https://northlight.dev/reference/button}
@@ -297,7 +501,11 @@ interface ButtonProps extends ButtonProps$1 {
297
501
  * render(<ExampleButton/>)
298
502
  * ?)
299
503
  */
300
- declare const Button: (props: ButtonProps & React__default.RefAttributes<unknown>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
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> & {
507
+ variant?: ButtonVariants | undefined;
508
+ } & React__default.RefAttributes<unknown>) => React__default.ReactElement<any, string | React__default.JSXElementConstructor<any>> | null;
301
509
 
302
510
  type CheckboxVariants = 'default' | 'rounded';
303
511
  interface CheckboxProps extends Omit<CheckboxProps$1, 'value'> {
@@ -622,15 +830,6 @@ declare const FlipButtonGroup: (props: FlipButtonGroupProps) => JSX.Element;
622
830
  */
623
831
  declare const FlipButtonGroupField: ({ name, label, children, direction, isRequired, iconPlacement, onChange: onChangeCallback, validate, ...rest }: FlipButtonGroupFieldProps) => JSX.Element;
624
832
 
625
- type Color = 'blue' | 'gray' | 'red' | 'pink' | 'green' | 'orange' | 'purple' | 'yellow' | 'mediatoolBlue';
626
- type ColorGrade = 50 | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
627
- type ColorShades = Record<ColorGrade, string>;
628
-
629
- interface InputFieldProps {
630
- inputLeftElement?: React.ReactNode;
631
- inputRightElement?: React.ReactNode;
632
- }
633
-
634
833
  interface DateRange {
635
834
  startDate: string;
636
835
  endDate: string;
@@ -808,6 +1007,7 @@ declare const DatePickerField: ({ name, minValue, maxValue, isRequired, directio
808
1007
  declare const DateRangePickerField: ({ name, minValue, maxValue, isRequired, direction, label, validate, firstDayOfWeek, onChange: onChangeCallback, isClearable, ...rest }: DateRangePickerFieldProps) => JSX.Element;
809
1008
 
810
1009
  interface ToolboxProps extends Omit<FlexProps, 'direction'> {
1010
+ isResizable?: boolean;
811
1011
  isOpen: boolean;
812
1012
  /** where the toolbox pops in from */
813
1013
  direction?: 'right' | 'left';
@@ -844,7 +1044,7 @@ interface ToolboxFooterProps extends FlexProps {
844
1044
  <Button onClick={ onOpen } w="full">
845
1045
  Open Toolbox
846
1046
  </Button>
847
- <Toolbox isOpen={ isOpen } onClose={ onClose } size="md">
1047
+ <Toolbox isOpen={ isOpen } onClose={ onClose } size="sm">
848
1048
  <ToolboxHeader>Title</ToolboxHeader>
849
1049
  <ToolboxContent>
850
1050
  <Stack>
@@ -862,7 +1062,7 @@ interface ToolboxFooterProps extends FlexProps {
862
1062
  }
863
1063
  * ?)
864
1064
  */
865
- declare const Toolbox: ({ isOpen, children, direction, shouldPush, size, width, onClose, autoFocus, ...rest }: ToolboxProps) => JSX.Element;
1065
+ declare const Toolbox: ({ isResizable, isOpen, children, direction, shouldPush, size, onClose, autoFocus, ...rest }: ToolboxProps) => JSX.Element;
866
1066
 
867
1067
  /**
868
1068
  * @see Toolbox
@@ -989,7 +1189,7 @@ render(<MyCarousel/>)
989
1189
  */
990
1190
  declare const Carousel: ({ children, showArrows, showRadio, value: controlledIndex, onChange, itemWidth, itemHeight, spacing, carouselStyles, ...rest }: CarouselProps) => JSX.Element;
991
1191
 
992
- type Size$1 = 'sm' | 'md' | 'lg';
1192
+ type Size = 'sm' | 'md' | 'lg';
993
1193
  interface SearchBarOptionType {
994
1194
  label: string;
995
1195
  value: any;
@@ -1000,7 +1200,7 @@ interface SearchBarProps<T extends SearchBarOptionType, K extends boolean = fals
1000
1200
  onChange?: (val: any, event: ActionMeta<T>) => void;
1001
1201
  onAdd?: (val: unknown) => void;
1002
1202
  onRemove?: (val: unknown) => void;
1003
- size?: Size$1;
1203
+ size?: Size;
1004
1204
  'data-testid'?: string;
1005
1205
  debouncedWaitTime?: number;
1006
1206
  clearInputOnSelect?: boolean;
@@ -2440,167 +2640,6 @@ declare const RadioGroup: ({ direction, children, name, ...rest }: RadioGroupPro
2440
2640
  */
2441
2641
  declare const RadioGroupField: ({ name, label, children, direction, isRequired, validate, onChange: onChangeCallback, ...rest }: RadioFieldGroupProps) => JSX.Element;
2442
2642
 
2443
- type Size = 'sm' | 'md' | 'lg';
2444
- interface Option {
2445
- label: string;
2446
- value: string;
2447
- }
2448
- interface SelectProps<T, K extends boolean> extends Omit<Props<T, K, GroupBase<T>>, 'onChange' | 'value' | 'isMulti'> {
2449
- /** Whatever is currently selected by the select will be controlled by value prop */
2450
- value?: Option | Option[];
2451
- /** Take a look at the second argument, the event,
2452
- * for info as to which specific element was added */
2453
- onChange?: (option: K extends true ? MultiValue<T> : SingleValue<T>, event: ActionMeta<T>) => void;
2454
- onAdd?: (val: unknown) => void;
2455
- onRemove?: (val: unknown) => void;
2456
- /** Used for accessibility */
2457
- name?: string;
2458
- size?: Size;
2459
- 'data-testid'?: string;
2460
- loadingList?: ComponentType<MenuListProps<T, K, GroupBase<T>>> | undefined;
2461
- /** Custom icon that will be put to the faremost right of the component */
2462
- icon?: ComponentType<any>;
2463
- /** Custom icon that will be put to the faremost left of the component */
2464
- leftIcon?: ComponentType<any>;
2465
- customOption?: ((option: T) => JSX.Element) | null;
2466
- isMulti?: K;
2467
- ref?: Ref<SelectInstance<T, K, GroupBase<T>>>;
2468
- }
2469
- type SelectFieldProps<T, K extends boolean = false> = SelectProps<T, K> & Omit<InputFieldProps, 'isMulti'> & {
2470
- direction?: StackDirection;
2471
- name: string;
2472
- label: string;
2473
- validate?: RegisterOptions;
2474
- isRequired?: boolean;
2475
- };
2476
-
2477
- /**
2478
- * Select component that provides a customizable and accessible select input.
2479
- * It is built on top of Chakra UI and Chakra React Select components.
2480
- *
2481
- * @see SearchBar
2482
- * @see {@link https://northlight.dev/reference/select}
2483
- *
2484
- * @example (Example)
2485
- * ## Single Select
2486
- * (?
2487
- * <Select
2488
- * options={[{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }]}
2489
- * onChange={(value, action) => console.log('Selected:', value)}
2490
- * />
2491
- * ?)
2492
- *
2493
- * @example (Example)
2494
- * ## Clearable Select
2495
- * (?
2496
- * <Select
2497
- * options={[{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }]}
2498
- * onChange={(value, action) => console.log('Selected:', value)}
2499
- * isClearable={ true }
2500
- * />
2501
- * ?)
2502
- *
2503
- * @example (Example)
2504
- * ## Multi select
2505
- * (?
2506
- * <Select
2507
- * options={[{ label: 'Option 1', value: '1' }, { label: 'Option 2', value: '2' }]}
2508
- * onChange={(value, action) => console.log('Selected:', value)}
2509
- * isMulti
2510
- * />
2511
- * ?)
2512
- *
2513
- * @example (Example)
2514
- * ## Event meta
2515
- * _There is a second argument passed to the handlechange that can be useful
2516
- * for knowing which elements where adding/removed_
2517
- * (?
2518
- * () => {
2519
- * const handleChange = (val, e) => {
2520
- switch (e.action) {
2521
- case 'select-option':
2522
- //on add value
2523
- console.log(e.option)
2524
- break
2525
- case 'pop-value':
2526
- //on remove value
2527
- console.log(e.removedValue.categoryKey)
2528
- break
2529
- default:
2530
- break
2531
- }
2532
- }
2533
- * return <Select onChange={handleChange} options={[{label: '1', value: '1'}]} isMulti={true}/>
2534
- *
2535
- * }
2536
- * ?)
2537
- *
2538
- * @example (Example)
2539
- * ##Customizing
2540
- * There are two special props for easy customization
2541
- * * customOption
2542
- * * customTag
2543
- *
2544
- * This are themselves react components
2545
- * (?
2546
- +const customOption = ({ label }) => (
2547
- <HStack>
2548
- <Avatar name={label} />
2549
- <P>{label}</P>
2550
- </HStack>
2551
- );
2552
-
2553
- const customTag = ({ label }) => {
2554
- const [ isIncluded, setIsIncluded ] = useState(true)
2555
- const toggle = () => setIsIncluded((prev) => !prev)
2556
-
2557
- return (
2558
- <Flex>
2559
- <Button
2560
- size="xs"
2561
- onClick={ toggle }
2562
- onMouseDown={ (e) => e.stopPropagation() }
2563
- >
2564
- { isIncluded ? 'Include' : 'Exclude' }
2565
- </Button>
2566
- <Tag>{ label }</Tag>
2567
- </Flex>
2568
- )
2569
- }
2570
-
2571
- const CustomSelect = () => (
2572
- <Select
2573
- customOption={customOption}
2574
- customTag={ customTag }
2575
- isMulti={true}
2576
- options={[
2577
- { label: 'Option 1', value: '1' },
2578
- { label: 'Option 2', value: '2' },
2579
- ]}
2580
-
2581
- />
2582
- );
2583
-
2584
- render(<CustomSelect />);
2585
- *
2586
- * ?)
2587
- *
2588
- *
2589
- * @example (Example)
2590
- * ## Testing
2591
- * You can grab the test id for the select by
2592
- * **screen.getByTestId('custom-testid)
2593
- * .children[0].children[2].children[0].children[1].children[0]**
2594
- * (?
2595
- * <Select
2596
- * data-testid="custom-test-id"
2597
- * />
2598
- * ?)
2599
- */
2600
- 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;
2601
-
2602
- 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;
2603
-
2604
2643
  type SpinnerProps = SpinnerProps$1;
2605
2644
 
2606
2645
  /**
@@ -3613,6 +3652,11 @@ interface StepStackProps extends StackProps {
3613
3652
  * Defaults to "center".
3614
3653
  */
3615
3654
  stepCircleAlignment?: string;
3655
+ /** Margin top for circles in pixels.
3656
+ * Useful for nonsymmetrical layouts.
3657
+ * Defaults to 0.
3658
+ */
3659
+ stepCircleMarginTopPx?: number;
3616
3660
  }
3617
3661
 
3618
3662
  /**
@@ -3634,23 +3678,43 @@ interface StepStackProps extends StackProps {
3634
3678
  <br />
3635
3679
  ## Example with flex-start stepCircleAlignment prop
3636
3680
  (?
3637
- <StepStack maxW="sm" spacing="4" rowHeight="10" stepCircleAlignment="flex-start">
3681
+ <StepStack
3682
+ maxW="sm"
3683
+ spacing="4"
3684
+ rowHeight="10"
3685
+ stepCircleAlignment="flex-start"
3686
+ stepCircleMarginTopPx={ 40 }
3687
+ >
3638
3688
  { Array.from({ length: 5 }, (_, i) => i).map((i) => (
3639
- <Center
3640
- key={ i }
3641
- width={ 400 }
3642
- height={ 100 }
3643
- borderRadius={ 10 }
3644
- backgroundColor="blue.500"
3645
- color="white"
3646
- >
3647
- <Text>Step { i + 1 }</Text>
3648
- </Center>
3689
+ <VStack key={ i }>
3690
+ <Center
3691
+ width={ 400 }
3692
+ height={ 24 }
3693
+ borderRadius={ 10 }
3694
+ backgroundColor="blue.500"
3695
+ color="white"
3696
+ >
3697
+ <VStack spacing="5">
3698
+ <Text>Step { i + 1 }</Text>
3699
+ </VStack>
3700
+ </Center>
3701
+ <Center
3702
+ width={ 400 }
3703
+ height={ 36 }
3704
+ borderRadius={ 10 }
3705
+ backgroundColor="green.500"
3706
+ color="white"
3707
+ >
3708
+ <VStack spacing="5">
3709
+ <Text>Some information</Text>
3710
+ </VStack>
3711
+ </Center>
3712
+ </VStack>
3649
3713
  )) }
3650
3714
  </StepStack>
3651
3715
  ?)
3652
3716
  */
3653
- declare const StepStack: ({ children, spacing, rowHeight, stepCircleAlignment, ...rest }: StepStackProps) => JSX.Element;
3717
+ declare const StepStack: ({ children, spacing, rowHeight, stepCircleAlignment, stepCircleMarginTopPx, ...rest }: StepStackProps) => JSX.Element;
3654
3718
 
3655
3719
  declare const useDebounce: <T>(value: T, delay: number) => T;
3656
3720
 
@@ -3702,4 +3766,4 @@ declare const useDidUpdateEffect: (effect: EffectCallback, dependencies: Depende
3702
3766
  declare const theme: Record<string, any>;
3703
3767
  declare const tottTheme: Record<string, any>;
3704
3768
 
3705
- 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, 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, 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, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };
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 };