@grasp-labs/ds-react-components 1.7.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/baseTextBox/BaseTextBox.d.ts +14 -5
- package/dist/components/datePicker/DatePicker.d.ts +9 -1
- package/dist/components/multiSelect/MultiSelect.d.ts +4 -1
- package/dist/components/select/Select.d.ts +5 -4
- package/dist/components/table/Table.d.ts +1 -1
- package/dist/components/table/types.d.ts +1 -0
- package/dist/components/textBox/TextBox.d.ts +1 -1
- package/dist/components/toast/Toast.d.ts +1 -1
- package/dist/components/toast/types.d.ts +3 -1
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/icons/iconsComponents.d.ts +2 -0
- package/dist/icons/iconsLazy.d.ts +2 -0
- package/dist/{index-DlpxAmKh.js → index-WnFiGAwm.js} +5103 -5109
- package/dist/index.css +1 -1
- package/dist/{index.esm-DXlFhov2.js → index.esm-Cw_y1o-h.js} +1 -1
- package/dist/index.js +96 -94
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { InputHTMLAttributes, JSX, ReactNode } from 'react';
|
|
1
|
+
import { InputHTMLAttributes, JSX, ReactNode, Ref } from 'react';
|
|
2
|
+
import { IconComponent } from '../../types/IconComponent';
|
|
2
3
|
export type AcceptOnlyPattern = "number" | "integer" | "alphanumeric" | "alpha" | "decimal";
|
|
3
4
|
export type BaseTextBoxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "children" | "prefix" | "suffix"> & {
|
|
4
5
|
/** Optional prefix element (e.g. icon, button) */
|
|
@@ -15,18 +16,26 @@ export type BaseTextBoxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "chil
|
|
|
15
16
|
name?: string;
|
|
16
17
|
/** Additional class names for the container */
|
|
17
18
|
className?: string;
|
|
18
|
-
/** Additional class names for the root element */
|
|
19
|
-
rootClassName?: string;
|
|
20
19
|
/** Placeholder text */
|
|
21
20
|
placeholder?: string;
|
|
22
21
|
/** Ref for the input element */
|
|
23
|
-
ref?:
|
|
22
|
+
ref?: Ref<HTMLInputElement>;
|
|
23
|
+
/** Ref for the container element */
|
|
24
|
+
containerRef?: Ref<HTMLDivElement>;
|
|
24
25
|
/**
|
|
25
26
|
* Restricts input to only accept specified values.
|
|
26
27
|
* Can be a predefined pattern ("number", "integer", "alphanumeric", "alpha", "decimal")
|
|
27
28
|
* or a custom filter function that returns the filtered/corrected string.
|
|
28
29
|
*/
|
|
29
30
|
acceptOnly?: AcceptOnlyPattern | ((value: string) => string);
|
|
31
|
+
/**
|
|
32
|
+
* Puts the textbox in a highlighted mode with the icon and
|
|
33
|
+
* an optional toolip that explains the cause of the state.
|
|
34
|
+
*/
|
|
35
|
+
highlight?: {
|
|
36
|
+
icon: IconComponent;
|
|
37
|
+
tooltip?: ReactNode;
|
|
38
|
+
};
|
|
30
39
|
};
|
|
31
40
|
/**
|
|
32
41
|
* BaseTextBox is a customizable text input component that supports optional prefix and suffix elements,
|
|
@@ -37,4 +46,4 @@ export type BaseTextBoxProps = Omit<InputHTMLAttributes<HTMLInputElement>, "chil
|
|
|
37
46
|
* @param ref - Ref forwarded to the native input element.
|
|
38
47
|
* @returns {JSX.Element} The rendered BaseTextBox component.
|
|
39
48
|
*/
|
|
40
|
-
export declare const BaseTextBox: ({ className, prefix, suffix,
|
|
49
|
+
export declare const BaseTextBox: ({ className, prefix, suffix, onChange, disabled, id, name, type, acceptOnly, highlight, containerRef, onClick, ...rest }: BaseTextBoxProps) => JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { DayPicker, Locale } from 'react-day-picker';
|
|
3
|
+
import { BaseTextBoxProps } from '../baseTextBox';
|
|
3
4
|
type DayPickerClassNamesConfig = Pick<ComponentProps<typeof DayPicker>, "classNames" | "modifiersClassNames">;
|
|
4
5
|
export type DatePickerProps = {
|
|
5
6
|
/** Optional id (auto-generated if not provided) */
|
|
@@ -22,6 +23,13 @@ export type DatePickerProps = {
|
|
|
22
23
|
className?: string;
|
|
23
24
|
/** Config for class names used to override default styles of calendar */
|
|
24
25
|
dayPickerClassNames?: DayPickerClassNamesConfig;
|
|
26
|
+
/** Whether the datepicker is in an error state */
|
|
27
|
+
error?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Puts the textbox in a highlighted mode with the icon and
|
|
30
|
+
* an optional toolip that explains the cause of the state.
|
|
31
|
+
*/
|
|
32
|
+
highlight?: BaseTextBoxProps["highlight"];
|
|
25
33
|
/** Determines if input is invalid */
|
|
26
34
|
"aria-invalid"?: boolean;
|
|
27
35
|
/** Callback function called when the date is changed */
|
|
@@ -33,5 +41,5 @@ export type DatePickerProps = {
|
|
|
33
41
|
* @param props - The props for the DatePicker component
|
|
34
42
|
* @returns The rendered date-picker
|
|
35
43
|
*/
|
|
36
|
-
export declare const DatePicker: ({ id, name, disabled, selectedDate, locale, minDate, maxDate, defaultMonth, className, dayPickerClassNames, onSelectedDateChange, ...props }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare const DatePicker: ({ id, name, disabled, selectedDate, locale, minDate, maxDate, defaultMonth, className, dayPickerClassNames, error, highlight, onSelectedDateChange, ...props }: DatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
45
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { BaseOption } from '../../types/BaseOption';
|
|
3
|
+
import { BaseTextBoxProps } from '../baseTextBox';
|
|
3
4
|
export type MultiSelectProps<Option extends BaseOption> = {
|
|
4
5
|
value: Option[];
|
|
5
6
|
setValue: (value: Option[] | ((prevState: Option[]) => Option[])) => void;
|
|
@@ -16,6 +17,8 @@ export type MultiSelectProps<Option extends BaseOption> = {
|
|
|
16
17
|
ref?: React.Ref<HTMLInputElement>;
|
|
17
18
|
maxHeight?: number;
|
|
18
19
|
listClassName?: string;
|
|
20
|
+
className?: string;
|
|
21
|
+
highlight?: BaseTextBoxProps["highlight"];
|
|
19
22
|
};
|
|
20
23
|
/**
|
|
21
24
|
* A multi-selection dropdown component with tag-based display of selected items.
|
|
@@ -25,4 +28,4 @@ export type MultiSelectProps<Option extends BaseOption> = {
|
|
|
25
28
|
* @param props - The props for the MultiSelect component.
|
|
26
29
|
* @returns The rendered multi-select dropdown with tag list.
|
|
27
30
|
*/
|
|
28
|
-
export declare const MultiSelect: <Option extends BaseOption>({ value, setValue, options, id, error, prefix, suffix, disabled, emptyPlaceholder, addMorePlaceholder, toggleAriaLabel, noOptionsText, ref, maxHeight, listClassName, }: MultiSelectProps<Option>) => import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare const MultiSelect: <Option extends BaseOption>({ value, setValue, options, id, error, prefix, suffix, disabled, emptyPlaceholder, addMorePlaceholder, toggleAriaLabel, noOptionsText, ref, maxHeight, listClassName, className, highlight, }: MultiSelectProps<Option>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { ReactElement, Ref } from 'react';
|
|
2
2
|
import { BaseOption, OptionNode } from '../../types';
|
|
3
|
+
import { BaseTextBoxProps } from '../baseTextBox';
|
|
3
4
|
import { NoneOf } from '../../types/NoneOf';
|
|
4
5
|
export type BaseSelectProps<Option extends BaseOption> = {
|
|
5
6
|
value: Option | null;
|
|
@@ -13,11 +14,11 @@ export type BaseSelectProps<Option extends BaseOption> = {
|
|
|
13
14
|
placeholder?: string;
|
|
14
15
|
toggleAriaLabel?: string;
|
|
15
16
|
noOptionsText?: string;
|
|
16
|
-
ref?:
|
|
17
|
+
ref?: Ref<HTMLInputElement>;
|
|
17
18
|
className?: string;
|
|
18
|
-
containerClassName?: string;
|
|
19
19
|
listClassName?: string;
|
|
20
20
|
maxHeight?: number;
|
|
21
|
+
highlight?: BaseTextBoxProps["highlight"];
|
|
21
22
|
onListScrollEnd?: () => void;
|
|
22
23
|
};
|
|
23
24
|
export type ClientSelectProps = {
|
|
@@ -38,4 +39,4 @@ export type SelectProps<Option extends BaseOption> = (BaseSelectProps<Option> &
|
|
|
38
39
|
* @param props - The props for the Select component.
|
|
39
40
|
* @returns The rendered select dropdown component.
|
|
40
41
|
*/
|
|
41
|
-
export declare const Select: <Option extends BaseOption>({ value, setValue, options, id, prefix, suffix, error, disabled, placeholder, toggleAriaLabel, noOptionsText, ref, disableSearch, className,
|
|
42
|
+
export declare const Select: <Option extends BaseOption>({ value, setValue, options, id, prefix, suffix, error, disabled, placeholder, toggleAriaLabel, noOptionsText, ref, disableSearch, className, listClassName, maxHeight, onSearch, debounce, isLoading, loadingText, highlight, onListScrollEnd, }: SelectProps<Option>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,5 +2,5 @@ import { JSX } from 'react';
|
|
|
2
2
|
import { TableProps } from './types';
|
|
3
3
|
declare function Table<T extends {
|
|
4
4
|
id?: string | number;
|
|
5
|
-
}>({ data, columns, rootClassName, className, scrollWrapperClassName, isLoading, loadingText, getCoreRowModel, enableRowSelection, enableMultiRowSelection, enablePagination, paginationProps, ...options }: TableProps<T>): JSX.Element;
|
|
5
|
+
}>({ data, columns, rootClassName, className, scrollWrapperClassName, isLoading, loadingText, getCoreRowModel, enableRowSelection, enableMultiRowSelection, enablePagination, emptyStateText, paginationProps, ...options }: TableProps<T>): JSX.Element;
|
|
6
6
|
export default Table;
|
|
@@ -38,6 +38,7 @@ export type TableProps<T> = Omit<TableOptions<T>, "getCoreRowModel" | "getSorted
|
|
|
38
38
|
loadingText?: string;
|
|
39
39
|
getCoreRowModel?: TableOptions<T>["getCoreRowModel"];
|
|
40
40
|
enablePagination?: boolean;
|
|
41
|
+
emptyStateText?: string;
|
|
41
42
|
paginationProps?: {
|
|
42
43
|
mode?: "client";
|
|
43
44
|
itemsPerPageOptions?: number[];
|
|
@@ -5,4 +5,4 @@ import { BaseTextBoxProps } from '../baseTextBox';
|
|
|
5
5
|
* @param props - Props to customize the textbox behavior and styling.
|
|
6
6
|
* @param ref - Ref forwarded to the underlying input element.
|
|
7
7
|
*/
|
|
8
|
-
export declare const TextBox: ({ value, error, disabled, className, id, name, ref, type, ...props }: BaseTextBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const TextBox: ({ value, error, disabled, className, id, name, ref, type, highlight, ...props }: BaseTextBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ToastProps } from './types';
|
|
2
|
-
export declare const Toast: ({ id, message, variant, onDismiss, className, index, visibleToasts, dismissLabel, }: ToastProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const Toast: ({ id, message, title, variant, onDismiss, className, index, visibleToasts, dismissLabel, }: ToastProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
1
2
|
export type ToastVariant = "success" | "error" | "warning" | "info";
|
|
2
3
|
export type ToastItem = {
|
|
3
4
|
id: string;
|
|
4
|
-
message:
|
|
5
|
+
message: ReactNode;
|
|
6
|
+
title?: string;
|
|
5
7
|
variant?: ToastVariant;
|
|
6
8
|
dismissLabel?: string;
|
|
7
9
|
};
|
|
@@ -19,4 +19,4 @@ export type TooltipProps = {
|
|
|
19
19
|
* @param props - The props for the Tooltip component.
|
|
20
20
|
* @returns The rendered tooltip with trigger element.
|
|
21
21
|
*/
|
|
22
|
-
export declare const Tooltip: ({ children, content, placement, openDelay, className, }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const Tooltip: ({ children, content, placement, openDelay, className, }: TooltipProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -23,6 +23,7 @@ export declare const DashboardIcon: IconComponent;
|
|
|
23
23
|
export declare const DatabaseIcon: IconComponent;
|
|
24
24
|
export declare const DeleteIcon: IconComponent;
|
|
25
25
|
export declare const DetailsIcon: IconComponent;
|
|
26
|
+
export declare const DiamondIcon: IconComponent;
|
|
26
27
|
export declare const DownIcon: IconComponent;
|
|
27
28
|
export declare const DownloadIcon: IconComponent;
|
|
28
29
|
export declare const EarthIcon: IconComponent;
|
|
@@ -50,6 +51,7 @@ export declare const ReloadIcon: IconComponent;
|
|
|
50
51
|
export declare const RightIcon: IconComponent;
|
|
51
52
|
export declare const SaveIcon: IconComponent;
|
|
52
53
|
export declare const SearchIcon: IconComponent;
|
|
54
|
+
export declare const SendOneIcon: IconComponent;
|
|
53
55
|
export declare const ServerIcon: IconComponent;
|
|
54
56
|
export declare const SuccessIcon: IconComponent;
|
|
55
57
|
export declare const TableIcon: IconComponent;
|
|
@@ -25,6 +25,7 @@ declare const iconImporters: {
|
|
|
25
25
|
readonly database: () => Promise<typeof import("*.svg?react")>;
|
|
26
26
|
readonly delete: () => Promise<typeof import("*.svg?react")>;
|
|
27
27
|
readonly details: () => Promise<typeof import("*.svg?react")>;
|
|
28
|
+
readonly diamond: () => Promise<typeof import("*.svg?react")>;
|
|
28
29
|
readonly down: () => Promise<typeof import("*.svg?react")>;
|
|
29
30
|
readonly download: () => Promise<typeof import("*.svg?react")>;
|
|
30
31
|
readonly earth: () => Promise<typeof import("*.svg?react")>;
|
|
@@ -52,6 +53,7 @@ declare const iconImporters: {
|
|
|
52
53
|
readonly right: () => Promise<typeof import("*.svg?react")>;
|
|
53
54
|
readonly save: () => Promise<typeof import("*.svg?react")>;
|
|
54
55
|
readonly search: () => Promise<typeof import("*.svg?react")>;
|
|
56
|
+
readonly sendOne: () => Promise<typeof import("*.svg?react")>;
|
|
55
57
|
readonly server: () => Promise<typeof import("*.svg?react")>;
|
|
56
58
|
readonly success: () => Promise<typeof import("*.svg?react")>;
|
|
57
59
|
readonly table: () => Promise<typeof import("*.svg?react")>;
|