@northlight/ui 2.22.2 → 2.24.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.
@@ -32,6 +32,8 @@ import { Props as Props$1 } from 'react-input-mask';
32
32
  import { NumericFormatProps } from 'react-number-format';
33
33
  import { Schema } from 'joi';
34
34
  import { UseClickableProps } from '@chakra-ui/clickable';
35
+ import { Option as Option$1 } from '@northlight/ui';
36
+ import { Variant } from 'chakra-react-select/dist/types/types';
35
37
  import * as _react_types_shared from '@react-types/shared';
36
38
  import * as _react_aria_focus from '@react-aria/focus';
37
39
 
@@ -3345,7 +3347,7 @@ declare const useToast: (defaultOpts?: UseToastOptions) => (opts?: UseToastOptio
3345
3347
  type TooltipVariants = 'success' | 'warning' | 'error' | 'info' | 'danger' | 'ai' | 'default' | 'ghost';
3346
3348
  interface OurTooltipProps extends TooltipProps {
3347
3349
  variant?: TooltipVariants;
3348
- description?: string;
3350
+ description?: React.ReactNode;
3349
3351
  hasIcon?: boolean;
3350
3352
  }
3351
3353
 
@@ -3368,6 +3370,29 @@ interface OurTooltipProps extends TooltipProps {
3368
3370
  * >
3369
3371
  * <Badge>NOICON</Badge>
3370
3372
  * </Tooltip>
3373
+ * <Tooltip
3374
+ * hasIcon={ false }
3375
+ * description={
3376
+ * <Box>
3377
+ * <Text>
3378
+ * Some text
3379
+ * </Text>
3380
+ * <UnorderedList>
3381
+ * <ListItem>
3382
+ * List item 1
3383
+ * </ListItem>
3384
+ * <ListItem>
3385
+ * List item 2
3386
+ * </ListItem>
3387
+ * <ListItem>
3388
+ * List item 3
3389
+ * </ListItem>
3390
+ * </UnorderedList>
3391
+ * </Box>
3392
+ * }
3393
+ * >
3394
+ * <Badge>With JSX content</Badge>
3395
+ * </Tooltip>
3371
3396
  * </HStack>
3372
3397
  * ?)
3373
3398
  *
@@ -4110,6 +4135,125 @@ interface StepStackProps extends StackProps {
4110
4135
  */
4111
4136
  declare const StepStack: ({ children, spacing, rowHeight, stepCircleAlignment, stepCircleMarginTopPx, ...rest }: StepStackProps) => JSX.Element;
4112
4137
 
4138
+ interface CreationOption extends Option$1 {
4139
+ isCreation: boolean;
4140
+ }
4141
+ interface CreatableSelectDropdownProps {
4142
+ /**
4143
+ * An array of "Option" objects that represents the initial options available in the dropdown.
4144
+ * Each "Option" object must have a "label" and a "value" property (both strings).
4145
+ */
4146
+ standardOptions: Option$1[];
4147
+ /**
4148
+ * A callback function that is called whenever the selected option changes.
4149
+ * This function receives the newly selected "Option" object as its only argument.
4150
+ */
4151
+ onOptionChange: (option: Option$1) => void;
4152
+ /**
4153
+ * Optional placeholder text displayed when no option is selected and the dropdown is not focused.
4154
+ * Defaults to 'Select or create...' if not provided.
4155
+ */
4156
+ initialPlaceholder?: string;
4157
+ /**
4158
+ * Optional placeholder text displayed when the dropdown is
4159
+ * focused and the user is prompted to create a new option.
4160
+ * Defaults to 'Enter text...' if not provided.
4161
+ */
4162
+ addOptionPlaceholder?: string;
4163
+ /**
4164
+ * Optional "Option" object representing the option to create a new item within the dropdown.
4165
+ * This option is typically displayed at the top of the dropdown list.
4166
+ * Defaults to "{ label: 'Add option...', value: 'Add option...' }" if not provided.
4167
+ */
4168
+ creationOption?: CreationOption;
4169
+ /**
4170
+ * Optional CSS width property value for the dropdown container.
4171
+ * Specify the width of the dropdown. Defaults to '100%' if not provided.
4172
+ */
4173
+ width?: string;
4174
+ /**
4175
+ * An optional string that determines the overall styling of the select field.
4176
+ * Accepted values are 'outline', 'filled', 'flushed', or 'unstyled'.
4177
+ * The default value is 'outline'.
4178
+ *
4179
+ */
4180
+ variant?: Variant;
4181
+ /**
4182
+ * Value of the initially selected option.
4183
+ */
4184
+ initialValue?: string;
4185
+ }
4186
+
4187
+ /**
4188
+ * A dropdown component that allows users to select a value from given options
4189
+ * or create a new one if it doesn't exist.
4190
+ * @see {@link https://northlight.dev/reference/creatable-select-dropdown}
4191
+ *
4192
+ * @example (Example)
4193
+ * (?
4194
+ * () => {
4195
+ * const [artist, setArtist] = useState(null);
4196
+ * const [element, setElement] = useState({ label: 'Technique', value: 'technique' })
4197
+ * const someOptions = [
4198
+ * { label: 'Scooter', value: 'scooter' },
4199
+ * { label: 'Snoop Doggy Dogg', value: 'snoop-dogg' },
4200
+ * ];
4201
+ *
4202
+ * const someOtherOptions = [
4203
+ * { label: 'Vision', value: 'vision' },
4204
+ * { label: 'Technique', value: 'technique' },
4205
+ * { label: 'Expression', value: 'expression' }
4206
+ * ];
4207
+ *
4208
+ * return (
4209
+ * <VStack gap={10} alignItems={"flex-start"}>
4210
+ * <Box align="left">
4211
+ * <H1>Basic example</H1>
4212
+ * <H3>Select the best artist</H3>
4213
+ * <CreatableSelectDropdown
4214
+ * standardOptions={someOptions}
4215
+ * onOptionChange={setArtist}
4216
+ * width="300px"
4217
+ * />
4218
+ * {artist && artist.value !== 'Add option...' && (
4219
+ * <H3 py={8}>The best artist is: {artist.label}</H3>
4220
+ * )}
4221
+ * </Box>
4222
+ * <Box align="left">
4223
+ * <H1>Pre-selected option</H1>
4224
+ * <H3>What is the quintessential element of an exceptional artisan?</H3>
4225
+ * <CreatableSelectDropdown
4226
+ * standardOptions={someOtherOptions}
4227
+ * onOptionChange={setElement}
4228
+ * width="300px"
4229
+ * initialValue="technique"
4230
+ * />
4231
+ * {element && element.value !== 'Add option...' && (
4232
+ * <H3 py={8}>
4233
+ * {element.value === 'vision' && (
4234
+ * 'The artist\'s vision shapes their creative world.'
4235
+ * )}
4236
+ * {element.value === 'technique' && (
4237
+ * 'Technique is the legacy\'s bedrock.'
4238
+ * )}
4239
+ * {element.value === 'expression' && (
4240
+ * 'Expression communicates the artist\'s inner voice.'
4241
+ * )}
4242
+ * {element.value !== 'vision' &&
4243
+ * element.value !== 'technique' &&
4244
+ * element.value !== 'expression' && (
4245
+ * 'Absent the selection of legitimate alternatives.'
4246
+ * )}
4247
+ * </H3>
4248
+ * )}
4249
+ * </Box>
4250
+ * </VStack>
4251
+ * );
4252
+ * }
4253
+ * ?)
4254
+ */
4255
+ declare const CreatableSelectDropdown: ({ standardOptions, initialPlaceholder, addOptionPlaceholder, creationOption, onOptionChange, width, variant, initialValue, }: CreatableSelectDropdownProps) => JSX.Element;
4256
+
4113
4257
  declare const useDebounce: <T>(value: T, delay: number) => T;
4114
4258
 
4115
4259
  declare const useLoadingMessage: (prefix?: string, delay?: number) => string;
@@ -4174,4 +4318,4 @@ declare const useResizeWidth: ({ stationaryEdge, minWidthPx, maxWidthPx, default
4174
4318
  declare const theme: Record<string, any>;
4175
4319
  declare const tottTheme: Record<string, any>;
4176
4320
 
4177
- 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, IntentButton, Label, LabelProps, LabelSizes, LabelType, Lead, ListenersType, LoadingBar, MaskedTextInput, MaskedTextInputProps, MediatoolThemeProvider, MediatoolThemeProviderProps, Menu, MenuProps, MenuVariants, Message, Modal, ModalBase, ModalBody, ModalBooleans, ModalProps, ModalSizes, MultiFileList, MultiFileListProps, MultiFilePicker, MultiFilePickerField, MultiFilePickerFieldProps, MultiFilePickerProps, MultiFileUploader, MultiFileUploaderProps, MultiItemType, MultiSort, MultiSortProps, NotificationIconButton, NotificationIconButtonProps, NumVal, NumValType, NumberInput, NumberInputField, NumberInputFieldProps, NumberInputProps, NumberInputSizeProps, NumberInputStepperProps, OffsetType, Option, OrganizationLogo, OrganizationLogoProps, OverflowGroup, OverflowGroupProps, OverflowIndicatorProps, P, PProps, PaneDivider, PaneItem, PinInput, PinInputProps, PinSize, PinSizeTuple, PinVariant, Popover, PresetOptions, ProgressBar, ProgressBarProps, Radio, RadioFieldGroupProps, RadioFieldProps, RadioGroup, RadioGroupField, RadioGroupProps, RadioProps, ResizeHandle, ScaleFade, ScaleFadeProps, SearchBar, SearchBarField, SearchBarFieldProps, SearchBarOptionType, SearchBarProps, Select, SelectActionMeta, SelectField, SelectFieldProps, SelectProps, SetValueOptionsType, Slide, SlideFade, SlideFadeProps, SlideProps, Small, Sortable, SortableContainer, SortableContainerProps, SortableItem, SortableItemProps, SortableList, SortableListProps, Spinner, SpinnerProps, SplitPane, SplitPaneProps, 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, Tooltip, TransitionDirection, UseFormReturn, UseSelectCallbacksProps, UseToastOptions, addAlpha, advancedParseFloat, clamp, createDebounceFunctionInstance, getChildrenWithProps, getContrastColor, getFieldError, getInitials, getMatchingValue, getShades, highlight, luminosity, ring, statusIconMap, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useResizeWidth, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };
4321
+ 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, CreatableSelectDropdown, 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, IntentButton, Label, LabelProps, LabelSizes, LabelType, Lead, ListenersType, LoadingBar, MaskedTextInput, MaskedTextInputProps, MediatoolThemeProvider, MediatoolThemeProviderProps, Menu, MenuProps, MenuVariants, Message, Modal, ModalBase, ModalBody, ModalBooleans, ModalProps, ModalSizes, MultiFileList, MultiFileListProps, MultiFilePicker, MultiFilePickerField, MultiFilePickerFieldProps, MultiFilePickerProps, MultiFileUploader, MultiFileUploaderProps, MultiItemType, MultiSort, MultiSortProps, NotificationIconButton, NotificationIconButtonProps, NumVal, NumValType, NumberInput, NumberInputField, NumberInputFieldProps, NumberInputProps, NumberInputSizeProps, NumberInputStepperProps, OffsetType, Option, OrganizationLogo, OrganizationLogoProps, OverflowGroup, OverflowGroupProps, OverflowIndicatorProps, P, PProps, PaneDivider, PaneItem, PinInput, PinInputProps, PinSize, PinSizeTuple, PinVariant, Popover, PresetOptions, ProgressBar, ProgressBarProps, Radio, RadioFieldGroupProps, RadioFieldProps, RadioGroup, RadioGroupField, RadioGroupProps, RadioProps, ResizeHandle, ScaleFade, ScaleFadeProps, SearchBar, SearchBarField, SearchBarFieldProps, SearchBarOptionType, SearchBarProps, Select, SelectActionMeta, SelectField, SelectFieldProps, SelectProps, SetValueOptionsType, Slide, SlideFade, SlideFadeProps, SlideProps, Small, Sortable, SortableContainer, SortableContainerProps, SortableItem, SortableItemProps, SortableList, SortableListProps, Spinner, SpinnerProps, SplitPane, SplitPaneProps, 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, Tooltip, TransitionDirection, UseFormReturn, UseSelectCallbacksProps, UseToastOptions, addAlpha, advancedParseFloat, clamp, createDebounceFunctionInstance, getChildrenWithProps, getContrastColor, getFieldError, getInitials, getMatchingValue, getShades, highlight, luminosity, ring, statusIconMap, theme, tottTheme, trimFormValues, useArrowFocus, useCurrentTheme, useDebounce, useDidUpdateEffect, useLoadingMessage, useOutsideRectClick, useOverflowGroup, useResizeWidth, useScreenSize, useScrollToBottom, useSelectCallbacks, useSetValueRefreshed, useToast };