@juspay/blend-design-system 0.0.30 → 0.0.31-beta
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/Button/button.tokens.d.ts +3 -0
- package/dist/components/Card/card.tokens.d.ts +6 -1
- package/dist/components/Charts/chart.tokens.d.ts +3 -0
- package/dist/components/CodeEditor/CodeEditorHeader.d.ts +2 -1
- package/dist/components/CodeEditor/MonacoEditorWrapper.d.ts +7 -1
- package/dist/components/CodeEditor/types.d.ts +20 -0
- package/dist/components/DataTable/DataTableHeader/types.d.ts +9 -0
- package/dist/components/DataTable/TableBody/BulkActionBar.d.ts +1 -0
- package/dist/components/DataTable/TableHeader/utils.d.ts +4 -0
- package/dist/components/DataTable/types.d.ts +10 -0
- package/dist/components/DateRangePicker/types.d.ts +10 -0
- package/dist/components/DateRangePicker/utils.d.ts +51 -8
- package/dist/components/Inputs/NumberInput/NumberInput.d.ts +1 -1
- package/dist/components/Inputs/NumberInput/types.d.ts +1 -0
- package/dist/components/Inputs/NumberInput/utils.d.ts +27 -0
- package/dist/components/Inputs/SearchInput/SearchInput.d.ts +3 -0
- package/dist/components/Inputs/SearchInput/types.d.ts +3 -0
- package/dist/components/Inputs/TextInput/textInput.tokens.d.ts +4 -0
- package/dist/components/Inputs/utils/InputFooter/InputFooter.d.ts +1 -2
- package/dist/components/Inputs/utils/InputLabels/InputLabels.d.ts +1 -2
- package/dist/components/Modal/modal.animations.d.ts +1 -1
- package/dist/components/MultiSelect/multiSelect.tokens.d.ts +5 -0
- package/dist/components/Sidebar/types.d.ts +7 -0
- package/dist/components/StatCard/utils.d.ts +29 -0
- package/dist/components/Switch/switch.token.d.ts +8 -0
- package/dist/components/Switch/utils.d.ts +0 -8
- package/dist/components/Upload/types.d.ts +1 -0
- package/dist/main.js +23332 -22600
- package/package.json +1 -1
|
@@ -18,6 +18,9 @@ import { BreakpointType } from '../../breakpoints/breakPoints';
|
|
|
18
18
|
*/
|
|
19
19
|
export type ButtonTokensType = {
|
|
20
20
|
gap: CSSObject['gap'];
|
|
21
|
+
slotMaxHeight: {
|
|
22
|
+
[key in ButtonSize]: CSSObject['maxHeight'];
|
|
23
|
+
};
|
|
21
24
|
backgroundColor: {
|
|
22
25
|
[key in ButtonType]: {
|
|
23
26
|
[key in ButtonSubType]: {
|
|
@@ -26,10 +26,15 @@ export type CardTokenType = {
|
|
|
26
26
|
boxShadow: CSSObject['boxShadow'];
|
|
27
27
|
backgroundColor: CSSObject['backgroundColor'];
|
|
28
28
|
padding: {
|
|
29
|
-
[
|
|
29
|
+
[CardVariant.DEFAULT]: {
|
|
30
30
|
x: CSSObject['padding'];
|
|
31
31
|
y: CSSObject['padding'];
|
|
32
32
|
};
|
|
33
|
+
[CardVariant.ALIGNED]: {
|
|
34
|
+
x: CSSObject['padding'];
|
|
35
|
+
y: CSSObject['padding'];
|
|
36
|
+
};
|
|
37
|
+
[CardVariant.CUSTOM]: undefined;
|
|
33
38
|
};
|
|
34
39
|
header: {
|
|
35
40
|
[CardVariant.DEFAULT]: {
|
|
@@ -4,10 +4,11 @@ type CodeEditorHeaderProps = {
|
|
|
4
4
|
header: string;
|
|
5
5
|
headerLeftSlot?: ReactNode;
|
|
6
6
|
headerRightSlot?: ReactNode;
|
|
7
|
+
showLeftIcon: boolean;
|
|
7
8
|
showCopyButton: boolean;
|
|
8
9
|
isCopied: boolean;
|
|
9
10
|
onCopy: () => void;
|
|
10
11
|
tokens: CodeBlockTokenType;
|
|
11
12
|
};
|
|
12
|
-
export declare const CodeEditorHeader: ({ header, headerLeftSlot, headerRightSlot, showCopyButton, isCopied, onCopy, tokens, }: CodeEditorHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const CodeEditorHeader: ({ header, headerLeftSlot, headerRightSlot, showLeftIcon, showCopyButton, isCopied, onCopy, tokens, }: CodeEditorHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -13,6 +13,12 @@ type MonacoEditorWrapperProps = {
|
|
|
13
13
|
tokens: CodeBlockTokenType;
|
|
14
14
|
onFocus?: () => void;
|
|
15
15
|
onBlur?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* When true, automatically focuses the editor when it mounts.
|
|
18
|
+
* When false or undefined, the editor will not auto-focus.
|
|
19
|
+
* Defaults to false.
|
|
20
|
+
*/
|
|
21
|
+
autoFocus?: boolean;
|
|
16
22
|
};
|
|
17
|
-
export declare const MonacoEditorWrapper: ({ value, language, onChange, readOnly, disabled, placeholder, showLineNumbers, minHeight, maxHeight, height, tokens, onFocus, onBlur, }: MonacoEditorWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const MonacoEditorWrapper: ({ value, language, onChange, readOnly, disabled, placeholder, showLineNumbers, minHeight, maxHeight, height, tokens, onFocus, onBlur, autoFocus, }: MonacoEditorWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
24
|
export {};
|
|
@@ -11,8 +11,22 @@ export type CodeEditorProps = {
|
|
|
11
11
|
showLineNumbers?: boolean;
|
|
12
12
|
showHeader?: boolean;
|
|
13
13
|
header?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Custom content to display on the left side of the header, before the header text.
|
|
16
|
+
* If provided, replaces the default FileCode icon.
|
|
17
|
+
*/
|
|
14
18
|
headerLeftSlot?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Custom content to display on the right side of the header, after the header text.
|
|
21
|
+
* Uses the same gap as the left icon.
|
|
22
|
+
*/
|
|
15
23
|
headerRightSlot?: ReactNode;
|
|
24
|
+
/**
|
|
25
|
+
* When false, hides the default left FileCode icon.
|
|
26
|
+
* Has no effect if headerLeftSlot is provided.
|
|
27
|
+
* Defaults to true.
|
|
28
|
+
*/
|
|
29
|
+
showLeftIcon?: boolean;
|
|
16
30
|
showCopyButton?: boolean;
|
|
17
31
|
language?: SupportedLanguage;
|
|
18
32
|
placeholder?: string;
|
|
@@ -24,4 +38,10 @@ export type CodeEditorProps = {
|
|
|
24
38
|
className?: string;
|
|
25
39
|
onBlur?: () => void;
|
|
26
40
|
onFocus?: () => void;
|
|
41
|
+
/**
|
|
42
|
+
* When true, automatically focuses the editor when it mounts.
|
|
43
|
+
* When false or undefined, the editor will not auto-focus.
|
|
44
|
+
* Defaults to false.
|
|
45
|
+
*/
|
|
46
|
+
autoFocus?: boolean;
|
|
27
47
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ColumnDefinition, SearchConfig, AdvancedFilterProps } from '../types';
|
|
2
|
+
import { TooltipSide, TooltipAlign, TooltipSize } from '../../Tooltip/types';
|
|
2
3
|
export type DataTableHeaderProps<T extends Record<string, unknown>> = {
|
|
3
4
|
title?: string;
|
|
4
5
|
description?: string;
|
|
@@ -18,4 +19,12 @@ export type DataTableHeaderProps<T extends Record<string, unknown>> = {
|
|
|
18
19
|
headerSlot1?: React.ReactNode;
|
|
19
20
|
headerSlot2?: React.ReactNode;
|
|
20
21
|
headerSlot3?: React.ReactNode;
|
|
22
|
+
descriptionTooltipProps?: {
|
|
23
|
+
side?: TooltipSide;
|
|
24
|
+
align?: TooltipAlign;
|
|
25
|
+
size?: TooltipSize;
|
|
26
|
+
showArrow?: boolean;
|
|
27
|
+
delayDuration?: number;
|
|
28
|
+
offset?: number;
|
|
29
|
+
};
|
|
21
30
|
};
|
|
@@ -3,6 +3,7 @@ export type BulkActionBarProps = {
|
|
|
3
3
|
onExport: () => void;
|
|
4
4
|
onDeselectAll: () => void;
|
|
5
5
|
customActions?: React.ReactNode;
|
|
6
|
+
showExport?: boolean;
|
|
6
7
|
};
|
|
7
8
|
declare const BulkActionBar: import('react').ForwardRefExoticComponent<BulkActionBarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
8
9
|
export default BulkActionBar;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { ButtonType, ButtonSize, ButtonSubType } from '../Button/types';
|
|
3
3
|
import { SkeletonVariant } from '../Skeleton/skeleton.tokens';
|
|
4
|
+
import { TooltipSide, TooltipAlign, TooltipSize } from '../Tooltip/types';
|
|
4
5
|
export declare enum SortDirection {
|
|
5
6
|
NONE = "none",
|
|
6
7
|
ASCENDING = "asc",
|
|
@@ -198,6 +199,7 @@ export type BulkActionsConfig = {
|
|
|
198
199
|
onSelectAll?: () => void;
|
|
199
200
|
onDeselectAll?: () => void;
|
|
200
201
|
customActions?: ReactNode;
|
|
202
|
+
showExport?: boolean;
|
|
201
203
|
};
|
|
202
204
|
export type RowActionConfig<T extends Record<string, unknown>> = {
|
|
203
205
|
id: string;
|
|
@@ -222,6 +224,14 @@ export type DataTableProps<T extends Record<string, unknown>> = {
|
|
|
222
224
|
idField: keyof T;
|
|
223
225
|
title?: string;
|
|
224
226
|
description?: string;
|
|
227
|
+
descriptionTooltipProps?: {
|
|
228
|
+
side?: TooltipSide;
|
|
229
|
+
align?: TooltipAlign;
|
|
230
|
+
size?: TooltipSize;
|
|
231
|
+
showArrow?: boolean;
|
|
232
|
+
delayDuration?: number;
|
|
233
|
+
offset?: number;
|
|
234
|
+
};
|
|
225
235
|
className?: string;
|
|
226
236
|
isHoverable?: boolean;
|
|
227
237
|
defaultSort?: SortConfig;
|
|
@@ -271,6 +271,16 @@ export type DateRangePickerProps = {
|
|
|
271
271
|
triggerConfig?: TriggerConfig;
|
|
272
272
|
maxMenuHeight?: number;
|
|
273
273
|
showPreset?: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* IANA timezone string (e.g., "America/New_York", "Europe/London", "Asia/Tokyo")
|
|
276
|
+
* When provided, all date/time operations use this timezone.
|
|
277
|
+
* Presets like "yesterday" or "today" are calculated in this timezone.
|
|
278
|
+
* Defaults to system timezone if not provided.
|
|
279
|
+
* @example timezone="America/New_York"
|
|
280
|
+
* @example timezone="Asia/Tokyo"
|
|
281
|
+
* @see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
282
|
+
*/
|
|
283
|
+
timezone?: string;
|
|
274
284
|
};
|
|
275
285
|
export type PresetItemProps = {
|
|
276
286
|
preset: DateRangePreset;
|
|
@@ -1,12 +1,54 @@
|
|
|
1
1
|
import { DateRange, DateRangePreset, DateFormatConfig, CustomFormatFunction, HapticFeedbackType, CustomPresetConfig, CustomPresetDefinition, PresetsConfig, CustomRangeConfig } from './types';
|
|
2
2
|
import { CalendarTokenType } from './dateRangePicker.tokens';
|
|
3
|
+
/**
|
|
4
|
+
* Gets the date components (year, month, day, etc.) for a given Date in a specific timezone
|
|
5
|
+
* @param date The date to get components for
|
|
6
|
+
* @param timezone IANA timezone string (e.g., "America/New_York")
|
|
7
|
+
* @returns Object with date components in the target timezone
|
|
8
|
+
*/
|
|
9
|
+
export declare const getDatePartsInTimezone: (date: Date, timezone: string) => {
|
|
10
|
+
year: number;
|
|
11
|
+
month: number;
|
|
12
|
+
day: number;
|
|
13
|
+
hours: number;
|
|
14
|
+
minutes: number;
|
|
15
|
+
seconds: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Creates a Date object representing a specific moment in a timezone
|
|
19
|
+
* This interprets the given date/time as being in the target timezone and returns
|
|
20
|
+
* the equivalent JavaScript Date object (which is always in UTC internally)
|
|
21
|
+
*
|
|
22
|
+
* @param timezone IANA timezone string (e.g., "America/New_York")
|
|
23
|
+
* @param year Year
|
|
24
|
+
* @param month Month (0-11)
|
|
25
|
+
* @param day Day of month (1-31)
|
|
26
|
+
* @param hours Hours (0-23)
|
|
27
|
+
* @param minutes Minutes (0-59)
|
|
28
|
+
* @param seconds Seconds (0-59)
|
|
29
|
+
* @returns Date object
|
|
30
|
+
*/
|
|
31
|
+
export declare const createDateInTimezone: (timezone: string | undefined, year: number, month: number, day: number, hours?: number, minutes?: number, seconds?: number) => Date;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the current date/time
|
|
34
|
+
* @param _timezone Timezone parameter (not used - now is the same moment everywhere)
|
|
35
|
+
* @returns Current Date object
|
|
36
|
+
*/
|
|
37
|
+
export declare const getNowInTimezone: (_timezone: string | undefined) => Date;
|
|
38
|
+
/**
|
|
39
|
+
* Gets today's date (at midnight) in the specified timezone
|
|
40
|
+
* @param timezone IANA timezone string
|
|
41
|
+
* @returns Date object representing today at 00:00:00 in the specified timezone
|
|
42
|
+
*/
|
|
43
|
+
export declare const getTodayInTimezone: (timezone: string | undefined) => Date;
|
|
3
44
|
/**
|
|
4
45
|
* Formats a date according to the specified format
|
|
5
46
|
* @param date The date to format
|
|
6
47
|
* @param format The format string (e.g., "dd/MM/yyyy")
|
|
48
|
+
* @param timezone Optional IANA timezone string
|
|
7
49
|
* @returns The formatted date string or empty string if date is invalid
|
|
8
50
|
*/
|
|
9
|
-
export declare const formatDate: (date: Date, format: string) => string;
|
|
51
|
+
export declare const formatDate: (date: Date, format: string, timezone?: string) => string;
|
|
10
52
|
/**
|
|
11
53
|
* Parses a date string according to the specified format
|
|
12
54
|
* @param dateString The date string to parse
|
|
@@ -36,9 +78,10 @@ export declare const formatDateRange: (range: DateRange, showTime?: boolean) =>
|
|
|
36
78
|
/**
|
|
37
79
|
* Gets a date range based on a preset
|
|
38
80
|
* @param preset The preset to get the range for
|
|
81
|
+
* @param timezone Optional IANA timezone string for timezone-aware calculations
|
|
39
82
|
* @returns The date range for the preset
|
|
40
83
|
*/
|
|
41
|
-
export declare const getPresetDateRange: (preset: DateRangePreset) => DateRange;
|
|
84
|
+
export declare const getPresetDateRange: (preset: DateRangePreset, timezone?: string) => DateRange;
|
|
42
85
|
/**
|
|
43
86
|
* Gets a label for a preset
|
|
44
87
|
* @param preset The preset to get the label for
|
|
@@ -134,7 +177,7 @@ export declare const isDateToday: (date: Date, today: Date) => boolean;
|
|
|
134
177
|
* @param date The date to create a range for
|
|
135
178
|
* @returns DateRange spanning the entire day (same date, different times)
|
|
136
179
|
*/
|
|
137
|
-
export declare const createSingleDateRange: (date: Date) => DateRange;
|
|
180
|
+
export declare const createSingleDateRange: (date: Date, timezone?: string) => DateRange;
|
|
138
181
|
/**
|
|
139
182
|
* Handles date click logic for calendar with clean first click = start, second click = end pattern
|
|
140
183
|
* @param clickedDate The date that was clicked
|
|
@@ -358,7 +401,7 @@ export declare const isDateInputComplete: (value: string, format: string) => boo
|
|
|
358
401
|
* @param allowSingleDateSelection Whether single date selection is allowed
|
|
359
402
|
* @returns Formatted display string
|
|
360
403
|
*/
|
|
361
|
-
export declare const formatDateDisplay: (selectedRange: DateRange, allowSingleDateSelection?: boolean) => string;
|
|
404
|
+
export declare const formatDateDisplay: (selectedRange: DateRange, allowSingleDateSelection?: boolean, timezone?: string) => string;
|
|
362
405
|
/**
|
|
363
406
|
* Handles date input change with formatting and validation
|
|
364
407
|
* @param value Input value
|
|
@@ -391,7 +434,7 @@ export declare const handleTimeChange: (time: string, currentRange: DateRange, i
|
|
|
391
434
|
* @param dateFormat Date format string
|
|
392
435
|
* @returns Object with updated range and formatted date strings
|
|
393
436
|
*/
|
|
394
|
-
export declare const handleCalendarDateSelect: (range: DateRange, startTime: string, endTime: string, dateFormat: string) => {
|
|
437
|
+
export declare const handleCalendarDateSelect: (range: DateRange, startTime: string, endTime: string, dateFormat: string, timezone?: string) => {
|
|
395
438
|
updatedRange: DateRange;
|
|
396
439
|
formattedStartDate: string;
|
|
397
440
|
formattedEndDate: string;
|
|
@@ -402,7 +445,7 @@ export declare const handleCalendarDateSelect: (range: DateRange, startTime: str
|
|
|
402
445
|
* @param dateFormat Date format string
|
|
403
446
|
* @returns Object with updated range, formatted dates, and times
|
|
404
447
|
*/
|
|
405
|
-
export declare const handlePresetSelection: (preset: DateRangePreset, dateFormat: string) => {
|
|
448
|
+
export declare const handlePresetSelection: (preset: DateRangePreset, dateFormat: string, timezone?: string) => {
|
|
406
449
|
updatedRange: DateRange;
|
|
407
450
|
formattedStartDate: string;
|
|
408
451
|
formattedEndDate: string;
|
|
@@ -535,7 +578,7 @@ export declare const getPresetDisplayLabel: (preset: DateRangePreset) => string;
|
|
|
535
578
|
* @param config Format configuration
|
|
536
579
|
* @returns Formatted date range string
|
|
537
580
|
*/
|
|
538
|
-
export declare const formatDateRangeWithConfig: (range: DateRange, config?: DateFormatConfig) => string;
|
|
581
|
+
export declare const formatDateRangeWithConfig: (range: DateRange, config?: DateFormatConfig, timezone?: string) => string;
|
|
539
582
|
/**
|
|
540
583
|
* Creates a custom trigger element with enhanced formatting
|
|
541
584
|
* @param range Current selected date range
|
|
@@ -543,7 +586,7 @@ export declare const formatDateRangeWithConfig: (range: DateRange, config?: Date
|
|
|
543
586
|
* @param placeholder Placeholder text when no range is selected
|
|
544
587
|
* @returns Formatted display string for trigger
|
|
545
588
|
*/
|
|
546
|
-
export declare const formatTriggerDisplay: (range: DateRange | undefined, config?: DateFormatConfig, placeholder?: string) => string;
|
|
589
|
+
export declare const formatTriggerDisplay: (range: DateRange | undefined, config?: DateFormatConfig, placeholder?: string, timezone?: string) => string;
|
|
547
590
|
/**
|
|
548
591
|
* Predefined format configurations for common use cases
|
|
549
592
|
*/
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { NumberInputProps } from './types';
|
|
2
|
-
declare const NumberInput: ({ value, onChange, min, max, step, error, errorMessage, required, disabled, size, placeholder, sublabel, helpIconHintText, label, hintText, name, onBlur, onFocus, ...rest }: NumberInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const NumberInput: ({ value, onChange, min, max, step, error, errorMessage, required, disabled, size, placeholder, sublabel, helpIconHintText, label, hintText, name, preventNegative, onBlur, onFocus, ...rest }: NumberInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default NumberInput;
|
|
@@ -13,6 +13,7 @@ export type NumberInputProps = {
|
|
|
13
13
|
sublabel?: string;
|
|
14
14
|
helpIconHintText?: string;
|
|
15
15
|
hintText?: string;
|
|
16
|
+
preventNegative?: boolean;
|
|
16
17
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
17
18
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
|
18
19
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className' | 'value' | 'onBlur' | 'onFocus'>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitizes a number input string to ensure it's a valid number format
|
|
3
|
+
* Similar to Chakra UI's number input sanitization behavior
|
|
4
|
+
*
|
|
5
|
+
* @param inputValue - The raw input string value
|
|
6
|
+
* @param allowNegative - Whether negative numbers are allowed
|
|
7
|
+
* @returns Sanitized string value
|
|
8
|
+
*/
|
|
9
|
+
export declare const sanitizeNumberInput: (inputValue: string, allowNegative?: boolean) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Clamps and sanitizes the value on blur
|
|
12
|
+
* Similar to Chakra UI's clampValueOnBlur behavior
|
|
13
|
+
*
|
|
14
|
+
* @param inputValue - The input string value
|
|
15
|
+
* @param allowNegative - Whether negative numbers are allowed
|
|
16
|
+
* @param min - Minimum allowed value
|
|
17
|
+
* @param max - Maximum allowed value
|
|
18
|
+
* @returns Clamped and sanitized number value or empty string
|
|
19
|
+
*/
|
|
20
|
+
export declare const clampValueOnBlur: (inputValue: string, allowNegative?: boolean, min?: number, max?: number) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Validates if a string represents a valid number
|
|
23
|
+
*
|
|
24
|
+
* @param value - The string value to validate
|
|
25
|
+
* @returns True if valid number, false otherwise
|
|
26
|
+
*/
|
|
27
|
+
export declare const isValidNumber: (value: string) => boolean;
|
|
@@ -4,5 +4,8 @@ declare const SearchInput: import('react').ForwardRefExoticComponent<{
|
|
|
4
4
|
error?: boolean;
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
allowClear?: boolean;
|
|
8
|
+
onClear?: () => void;
|
|
9
|
+
clearIcon?: React.ReactNode;
|
|
7
10
|
} & Omit<import('react').InputHTMLAttributes<HTMLInputElement>, "size" | "style" | "className"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
8
11
|
export default SearchInput;
|
|
@@ -4,4 +4,7 @@ export type SearchInputProps = {
|
|
|
4
4
|
error?: boolean;
|
|
5
5
|
value?: string;
|
|
6
6
|
onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
+
allowClear?: boolean;
|
|
8
|
+
onClear?: () => void;
|
|
9
|
+
clearIcon?: React.ReactNode;
|
|
7
10
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'style' | 'className'>;
|
|
@@ -3,6 +3,10 @@ import { FoundationTokenType } from '../../../tokens/theme.token';
|
|
|
3
3
|
import { TextInputSize, TextInputState } from './types';
|
|
4
4
|
import { BreakpointType } from '../../../breakpoints/breakPoints';
|
|
5
5
|
export type TextInputTokensType = {
|
|
6
|
+
placeholder: {
|
|
7
|
+
color: CSSObject['color'];
|
|
8
|
+
fontWeight: CSSObject['fontWeight'];
|
|
9
|
+
};
|
|
6
10
|
gap: CSSObject['gap'];
|
|
7
11
|
label: {
|
|
8
12
|
fontSize: CSSObject['fontSize'];
|
|
@@ -17,12 +17,11 @@ type InputFooterProps = {
|
|
|
17
17
|
error?: boolean;
|
|
18
18
|
errorMessage?: string;
|
|
19
19
|
hintText?: string;
|
|
20
|
-
disabled?: boolean;
|
|
21
20
|
errorId?: string;
|
|
22
21
|
hintId?: string;
|
|
23
22
|
tokens?: InputFooterTokens;
|
|
24
23
|
hintTextId?: string;
|
|
25
24
|
errorMessageId?: string;
|
|
26
25
|
};
|
|
27
|
-
declare const InputFooter: ({ error, errorMessage, hintText,
|
|
26
|
+
declare const InputFooter: ({ error, errorMessage, hintText, errorId, hintId, tokens, hintTextId, errorMessageId, }: InputFooterProps) => "" | import("react/jsx-runtime").JSX.Element | undefined;
|
|
28
27
|
export default InputFooter;
|
|
@@ -29,7 +29,6 @@ type InputLabelTokens = {
|
|
|
29
29
|
type InputLabelsProps<TTokens extends InputLabelTokens = InputLabelTokens> = {
|
|
30
30
|
label?: string;
|
|
31
31
|
sublabel?: string;
|
|
32
|
-
disabled?: boolean;
|
|
33
32
|
helpIconHintText?: string;
|
|
34
33
|
name?: string;
|
|
35
34
|
inputId?: string;
|
|
@@ -46,5 +45,5 @@ type InputLabelsProps<TTokens extends InputLabelTokens = InputLabelTokens> = {
|
|
|
46
45
|
* @param {string} inputId - Unique ID for proper label association (WCAG 3.3.2).
|
|
47
46
|
* @param {boolean} required - Whether the input field is required.
|
|
48
47
|
*/
|
|
49
|
-
declare const InputLabels: <TTokens extends InputLabelTokens>({ label, sublabel,
|
|
48
|
+
declare const InputLabels: <TTokens extends InputLabelTokens>({ label, sublabel, helpIconHintText, name, inputId, required, tokens, labelId, }: InputLabelsProps<TTokens>) => "" | import("react/jsx-runtime").JSX.Element | undefined;
|
|
50
49
|
export default InputLabels;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const modalBackdropAnimations: (isAnimatingIn: boolean) => import('styled-components').RuleSet<object>;
|
|
2
2
|
export declare const modalContentAnimations: (isAnimatingIn: boolean) => import('styled-components').RuleSet<object>;
|
|
3
|
-
export declare const ANIMATION_DURATION =
|
|
3
|
+
export declare const ANIMATION_DURATION = 300;
|
|
@@ -81,6 +81,11 @@ export type MultiSelectTokensType = {
|
|
|
81
81
|
fontSize: CSSObject['fontSize'];
|
|
82
82
|
fontWeight: CSSObject['fontWeight'];
|
|
83
83
|
};
|
|
84
|
+
selectedValue: {
|
|
85
|
+
color: CSSObject['color'];
|
|
86
|
+
fontSize: CSSObject['fontSize'];
|
|
87
|
+
fontWeight: CSSObject['fontWeight'];
|
|
88
|
+
};
|
|
84
89
|
};
|
|
85
90
|
menu: {
|
|
86
91
|
backgroundColor: CSSObject['backgroundColor'];
|
|
@@ -90,6 +90,13 @@ export type SidebarProps = {
|
|
|
90
90
|
* Only applies when leftPanel is provided
|
|
91
91
|
*/
|
|
92
92
|
panelOnlyMode?: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* When true, disables the intermediate state that appears on hover
|
|
95
|
+
* When false or undefined, hovering over the collapsed sidebar will temporarily show it in an intermediate/expanded state
|
|
96
|
+
* The intermediate state allows users to see the sidebar content without fully expanding it
|
|
97
|
+
* Defaults to false (intermediate state enabled)
|
|
98
|
+
*/
|
|
99
|
+
disableIntermediateState?: boolean;
|
|
93
100
|
/**
|
|
94
101
|
* Show primary action button in mobile navigation
|
|
95
102
|
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { StatCardChange, ChartDataPoint } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates whether the chart data is trending down (first value > last value)
|
|
4
|
+
* @param chartData - Array of chart data points
|
|
5
|
+
* @returns true if trending down, false otherwise
|
|
6
|
+
*/
|
|
7
|
+
export declare const calculateTrend: (chartData?: ChartDataPoint[]) => boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Calculates delta change from chart data (first vs last value)
|
|
10
|
+
* @param chartData - Array of chart data points
|
|
11
|
+
* @returns Calculated change object with value and valueType, or null if calculation is not possible
|
|
12
|
+
*/
|
|
13
|
+
export declare const calculateChangeFromChartData: (chartData?: ChartDataPoint[]) => Pick<StatCardChange, "value" | "valueType"> | null;
|
|
14
|
+
/**
|
|
15
|
+
* Gets the effective change to use for display
|
|
16
|
+
* Uses provided change prop if available, otherwise calculates from chartData
|
|
17
|
+
* @param change - Optional change prop from component
|
|
18
|
+
* @param chartData - Array of chart data points
|
|
19
|
+
* @returns Effective change object or null
|
|
20
|
+
*/
|
|
21
|
+
export declare const getEffectiveChange: (change?: StatCardChange, chartData?: ChartDataPoint[]) => StatCardChange | Pick<StatCardChange, "value" | "valueType"> | null;
|
|
22
|
+
/**
|
|
23
|
+
* Determines if decrease color should be shown
|
|
24
|
+
* Uses effectiveChange valueType if available, otherwise falls back to trend calculation
|
|
25
|
+
* @param effectiveChange - The effective change object (from prop or calculated)
|
|
26
|
+
* @param isTrendingDown - Whether chart data is trending down
|
|
27
|
+
* @returns true if decrease color should be shown, false for increase
|
|
28
|
+
*/
|
|
29
|
+
export declare const shouldShowDecreaseColor: (effectiveChange: StatCardChange | Pick<StatCardChange, "value" | "valueType"> | null, isTrendingDown: boolean) => boolean;
|
|
@@ -86,6 +86,14 @@ export type SwitchTokensType = {
|
|
|
86
86
|
required: {
|
|
87
87
|
color: CSSObject['color'];
|
|
88
88
|
};
|
|
89
|
+
slot: {
|
|
90
|
+
width: {
|
|
91
|
+
[key in SwitchSize]: CSSObject['width'];
|
|
92
|
+
};
|
|
93
|
+
height: {
|
|
94
|
+
[key in SwitchSize]: CSSObject['height'];
|
|
95
|
+
};
|
|
96
|
+
};
|
|
89
97
|
};
|
|
90
98
|
export type ResponsiveSwitchTokens = {
|
|
91
99
|
[key in keyof BreakpointType]: SwitchTokensType;
|
|
@@ -6,14 +6,6 @@ export declare const getSpacingBySize: (size: SwitchSize) => {
|
|
|
6
6
|
marginLeft: string;
|
|
7
7
|
marginTop: string;
|
|
8
8
|
};
|
|
9
|
-
/**
|
|
10
|
-
* Determines if the switch component is controlled based on the checked prop
|
|
11
|
-
*/
|
|
12
|
-
export declare const isControlledSwitch: (checked: boolean | undefined) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Creates a toggle handler for switch components
|
|
15
|
-
*/
|
|
16
|
-
export declare const createSwitchToggleHandler: (currentChecked: boolean, disabled: boolean, isControlled: boolean, setInternalChecked?: React.Dispatch<React.SetStateAction<boolean>>, onChange?: (checked: boolean) => void) => () => void;
|
|
17
9
|
/**
|
|
18
10
|
* Gets the text color based on switch state
|
|
19
11
|
*/
|
|
@@ -64,4 +64,5 @@ export type UploadProps = {
|
|
|
64
64
|
isDragAccept?: boolean;
|
|
65
65
|
isDragReject?: boolean;
|
|
66
66
|
validator?: (file: File) => FileRejection['errors'][0] | null;
|
|
67
|
+
actionSlot?: React.ReactNode;
|
|
67
68
|
} & Omit<React.HTMLAttributes<HTMLDivElement>, 'onDrop' | 'onDragOver' | 'onDragLeave' | 'onChange'>;
|