sy-ui-lib 1.0.10 → 1.0.12
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/Chip/Chip.stories.d.ts +6 -0
- package/dist/components/Chip/Chip.types.d.ts +3 -0
- package/dist/components/DatePicker/DatePicker.component.d.ts +0 -25
- package/dist/components/DatePicker/DatePicker.stories.d.ts +1 -2
- package/dist/components/DatePicker/DatePicker.types.d.ts +22 -25
- package/dist/components/Dropdown/Dropdown.types.d.ts +2 -1
- package/dist/components/MultiSelectDropdown/MultiSelectDropdown.types.d.ts +2 -1
- package/dist/components/SnackBar/SnackBar.types.d.ts +1 -1
- package/dist/components/Toggle/Toggle.types.d.ts +1 -0
- package/dist/index.cjs +18 -16
- package/dist/index.css +1 -1
- package/dist/index.js +2760 -2763
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export type ChipType = "active" | "suspended" | "locked" | "pending" | "info";
|
|
|
5
5
|
export type ChipVariant = "filled" | "outlined";
|
|
6
6
|
/** Defines the available icon colors */
|
|
7
7
|
export type ChipIconColor = "white" | "success" | "error" | "slategray" | "goldenYellow" | "techBlue";
|
|
8
|
+
export type ChipSize = "xs" | "sm" | "md";
|
|
8
9
|
/** Props for the Chip component */
|
|
9
10
|
export interface ChipProps {
|
|
10
11
|
/** Text content to be displayed inside the chip */
|
|
@@ -19,4 +20,6 @@ export interface ChipProps {
|
|
|
19
20
|
onClick?: () => void;
|
|
20
21
|
/** Optional icon to be displayed in future use */
|
|
21
22
|
iconName?: IconName;
|
|
23
|
+
/** Size of the chip, affecting padding and minimum dimensions */
|
|
24
|
+
size?: ChipSize;
|
|
22
25
|
}
|
|
@@ -1,28 +1,3 @@
|
|
|
1
1
|
import { DatePickerProps } from './DatePicker.types';
|
|
2
|
-
/**
|
|
3
|
-
* A reusable and customizable date picker component that supports both
|
|
4
|
-
* single date and date range selection using `react-day-picker`.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} [title] - Optional button text placeholder. Default is "Select Date".
|
|
7
|
-
* @param {(value: HandleSelectDatePicker) => void} selectedDate - Callback function
|
|
8
|
-
* triggered when the user applies a selected date or range.
|
|
9
|
-
* @param {HandleSelectDatePicker} [value] - Controlled selected value (single date or date range).
|
|
10
|
-
* @param {boolean} [fullWidth] - If true, the date picker will stretch to full width of its container.
|
|
11
|
-
* @param {number} [maxPastDays] - Maximum number of past days selectable.
|
|
12
|
-
* @param {number} [maxRangeDays] - Maximum range in days (for range mode).
|
|
13
|
-
* @param {boolean} [currentSelected] - If true, today is pre-selected on mount.
|
|
14
|
-
*
|
|
15
|
-
* @returns {JSX.Element} The rendered DatePicker component.
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* <DatePicker
|
|
19
|
-
* title="Pick a date"
|
|
20
|
-
* fullWidth
|
|
21
|
-
* maxPastDays={30}
|
|
22
|
-
* maxRangeDays={14}
|
|
23
|
-
* currentSelected
|
|
24
|
-
* selectedDate={(value) => console.log("Selected:", value)}
|
|
25
|
-
* />
|
|
26
|
-
*/
|
|
27
2
|
declare const DatePicker: React.FC<DatePickerProps>;
|
|
28
3
|
export default DatePicker;
|
|
@@ -5,6 +5,5 @@ export default meta;
|
|
|
5
5
|
type Story = StoryObj<DatePickerProps>;
|
|
6
6
|
export declare const Default: Story;
|
|
7
7
|
export declare const CustomTitle: Story;
|
|
8
|
-
export declare const CurrentDateSelected: Story;
|
|
9
8
|
export declare const MaxPastDays: Story;
|
|
10
|
-
export declare const
|
|
9
|
+
export declare const Range: Story;
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/**
|
|
3
|
-
* The selection mode for the date picker.
|
|
4
|
-
* - "single": For selecting a single date
|
|
5
|
-
* - "range": For selecting a date range
|
|
6
|
-
*/
|
|
1
|
+
import { ButtonSize } from '../Button';
|
|
2
|
+
/** "single": For selecting a single date. "range": For selecting a date range*/
|
|
7
3
|
export type DatePickerMode = "single" | "range";
|
|
8
|
-
/**
|
|
9
|
-
* Represents the value returned from the date picker based on the selected mode.
|
|
10
|
-
* - `Date`: when mode is "single"
|
|
11
|
-
* - `DateRange`: when mode is "range" (includes `from` and optional `to`)
|
|
12
|
-
* - `undefined`: when no date is selected
|
|
13
|
-
*/
|
|
14
|
-
export type HandleSelectDatePicker = Date | DateRange | undefined;
|
|
15
|
-
/**
|
|
16
|
-
* Props for the reusable DatePicker component.
|
|
17
|
-
*/
|
|
4
|
+
/** Props for the reusable DatePicker component. */
|
|
18
5
|
export interface DatePickerProps {
|
|
19
6
|
/** Optional title/label to show above the date picker, default value "Select Date" */
|
|
20
7
|
title?: string;
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
value?:
|
|
25
|
-
/**
|
|
26
|
-
|
|
27
|
-
/**
|
|
8
|
+
/** Defines picker behavior */
|
|
9
|
+
variant?: DatePickerMode;
|
|
10
|
+
/** Selected date (controlled) */
|
|
11
|
+
value?: Date;
|
|
12
|
+
/** Callback when single date changes */
|
|
13
|
+
onChange?: (date: Date | undefined) => void;
|
|
14
|
+
/** Selected "from" date */
|
|
15
|
+
fromDate?: Date;
|
|
16
|
+
/** Selected "to" date */
|
|
17
|
+
toDate?: Date;
|
|
18
|
+
/** Callback when "from" date changes */
|
|
19
|
+
onFromChange?: (date: Date | undefined) => void;
|
|
20
|
+
/** Callback when "to" date changes */
|
|
21
|
+
onToChange?: (date: Date | undefined) => void;
|
|
22
|
+
/** Size of the picker */
|
|
23
|
+
size?: ButtonSize;
|
|
24
|
+
/** Maximum selectable past days */
|
|
28
25
|
maxPastDays?: number;
|
|
29
|
-
/** Maximum
|
|
26
|
+
/** Maximum selectable past days */
|
|
30
27
|
maxRangeDays?: number;
|
|
31
|
-
/** If true, today is pre-selected on mount
|
|
28
|
+
/** If true, today is pre-selected on mount. */
|
|
32
29
|
currentSelected?: boolean;
|
|
33
30
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ButtonSize } from '../Button';
|
|
1
2
|
/**
|
|
2
3
|
* Represents an individual option in the dropdown.
|
|
3
4
|
*/
|
|
@@ -12,7 +13,7 @@ export interface DropdownProps {
|
|
|
12
13
|
/** The fallback label to display when no option is selected. */
|
|
13
14
|
label: string;
|
|
14
15
|
/** Defines the size of the dropdown button and options. default value is "sm" */
|
|
15
|
-
size?:
|
|
16
|
+
size?: ButtonSize;
|
|
16
17
|
/** List of dropdown options available for selection. */
|
|
17
18
|
options: DropdownOptionValues[];
|
|
18
19
|
/** Currently selected option. Must be one of the items from `options`. */
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ButtonSize } from '../Button';
|
|
1
2
|
export interface MultiSelectOptionValues {
|
|
2
3
|
/** The visible label shown in the dropdown list and selected state */
|
|
3
4
|
label: string;
|
|
@@ -9,7 +10,7 @@ export interface MultiSelectDropdownProps {
|
|
|
9
10
|
/** The fallback label to display when no option is selected. */
|
|
10
11
|
label: string;
|
|
11
12
|
/** Defines the size of the dropdown button and options. default value is "sm" */
|
|
12
|
-
size?:
|
|
13
|
+
size?: ButtonSize;
|
|
13
14
|
/** List of dropdown options available for selection. */
|
|
14
15
|
options: MultiSelectOptionValues[];
|
|
15
16
|
/** Currently selected option. Must be one of the items from `options`. */
|
|
@@ -17,7 +17,7 @@ export interface DismissProps {
|
|
|
17
17
|
/** Base props common to all snackbar variants */
|
|
18
18
|
interface SnackBarBaseProps {
|
|
19
19
|
/** Message text to display in the snackbar */
|
|
20
|
-
message:
|
|
20
|
+
message: React.ReactNode;
|
|
21
21
|
/** Time (in milliseconds) before the snackbar auto-dismisses */
|
|
22
22
|
duration?: number;
|
|
23
23
|
/** Type of message (info, success, error) to control the snackbar color */
|