@lifesg/react-design-system 1.0.0-alpha.17 → 1.0.0-alpha.18
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/card/types.d.ts +1 -1
- package/checkbox/checkbox.d.ts +1 -1
- package/checkbox/index.js +6 -6
- package/checkbox/index.js.map +1 -1
- package/cjs/index.js +101 -29
- package/cjs/index.js.map +1 -1
- package/color/types.d.ts +1 -1
- package/date-input/date-input.d.ts +1 -1
- package/date-input/index.js +76 -76
- package/date-input/index.js.map +1 -1
- package/date-input/types.d.ts +6 -19
- package/feedback-rating/feedback-rating-stars-container.styles.d.ts +1 -1
- package/feedback-rating/feedback-rating.styles.d.ts +1 -1
- package/feedback-rating/index.js.map +1 -1
- package/footer/index.js +2 -2
- package/footer/index.js.map +1 -1
- package/footer/types.d.ts +2 -2
- package/form/index.js +455 -442
- package/form/index.js.map +1 -1
- package/form/types.d.ts +1 -1
- package/index.d.ts +1 -0
- package/index.js +101 -29
- package/index.js.map +1 -1
- package/input-group/index.js +14 -2
- package/input-group/index.js.map +1 -1
- package/input-group/types.d.ts +6 -6
- package/input-select/index.js +15 -3
- package/input-select/index.js.map +1 -1
- package/input-select/input-select-wrapper.d.ts +1 -1
- package/input-select/input-select.styles.d.ts +1 -0
- package/input-select/types.d.ts +11 -9
- package/input-textarea/types.d.ts +1 -1
- package/link-list/types.d.ts +1 -1
- package/modal/types.d.ts +3 -3
- package/navbar/brand.d.ts +1 -1
- package/navbar/index.js.map +1 -1
- package/navbar/types.d.ts +5 -5
- package/notification-banner/types.d.ts +1 -1
- package/overlay/types.d.ts +1 -1
- package/package.json +1 -1
- package/popover/types.d.ts +3 -3
- package/progress-indicator/types.d.ts +1 -1
- package/shared/dropdown-list/dropdown-list.styles.d.ts +1 -1
- package/shared/dropdown-list/types.d.ts +11 -11
- package/smart-app-banner/types.d.ts +1 -1
- package/timepicker/types.d.ts +3 -3
- package/unit-number/types.d.ts +5 -5
- package/util/date-helper.d.ts +19 -0
- package/util/index.d.ts +2 -0
package/navbar/types.d.ts
CHANGED
|
@@ -30,13 +30,13 @@ export interface NavbarSharedProps {
|
|
|
30
30
|
resources?: NavbarResourcesProps | undefined;
|
|
31
31
|
actionButtons?: NavbarActionButtonsProps | undefined;
|
|
32
32
|
/** Triggered when the brand icon is being clicked */
|
|
33
|
-
onBrandClick?: (event: React.MouseEvent<HTMLAnchorElement>) => void | undefined;
|
|
33
|
+
onBrandClick?: ((event: React.MouseEvent<HTMLAnchorElement>) => void) | undefined;
|
|
34
34
|
}
|
|
35
35
|
export declare type DrawerDismissalMethod = "close-button-click" | "item-click" | "brand-click";
|
|
36
36
|
export interface NavbarDrawerProps extends NavbarSharedProps {
|
|
37
37
|
show: boolean;
|
|
38
38
|
children: JSX.Element | JSX.Element[];
|
|
39
|
-
onClose?: () => void | undefined;
|
|
39
|
+
onClose?: (() => void) | undefined;
|
|
40
40
|
}
|
|
41
41
|
export interface NavbarProps<T = void> extends NavbarSharedProps {
|
|
42
42
|
items: NavItemsProps<T>;
|
|
@@ -50,7 +50,7 @@ export interface NavbarProps<T = void> extends NavbarSharedProps {
|
|
|
50
50
|
/** Specifies which methods will not dismiss the drawer */
|
|
51
51
|
drawerDismissalExclusions?: DrawerDismissalMethod[] | undefined;
|
|
52
52
|
hideNavElements?: boolean | undefined;
|
|
53
|
-
onBrandClick?: () => void | undefined;
|
|
54
|
-
onItemClick?: (item: NavItemProps<T>) => void | undefined;
|
|
55
|
-
onActionButtonClick?: (actionButton: NavbarButtonProps) => void;
|
|
53
|
+
onBrandClick?: (() => void) | undefined;
|
|
54
|
+
onItemClick?: ((item: NavItemProps<T>) => void) | undefined;
|
|
55
|
+
onActionButtonClick?: ((actionButton: NavbarButtonProps) => void) | undefined;
|
|
56
56
|
}
|
|
@@ -5,7 +5,7 @@ export interface NotificationBannerProps extends React.HTMLAttributes<HTMLDivEle
|
|
|
5
5
|
dismissible?: boolean | undefined;
|
|
6
6
|
visible?: boolean | undefined;
|
|
7
7
|
sticky?: boolean | undefined;
|
|
8
|
-
onDismiss?: () => void | undefined;
|
|
8
|
+
onDismiss?: (() => void) | undefined;
|
|
9
9
|
}
|
|
10
10
|
export interface NotificationBannerWithForwardedRefProps extends NotificationBannerProps {
|
|
11
11
|
forwardedRef?: React.Ref<HTMLDivElement> | undefined;
|
package/overlay/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface OverlayProps {
|
|
|
8
8
|
disableTransition?: boolean | undefined;
|
|
9
9
|
enableOverlayClick?: boolean | undefined;
|
|
10
10
|
zIndex?: number | undefined;
|
|
11
|
-
onOverlayClick?: () => void | undefined;
|
|
11
|
+
onOverlayClick?: (() => void) | undefined;
|
|
12
12
|
id?: string | undefined;
|
|
13
13
|
}
|
|
14
14
|
/**
|
package/package.json
CHANGED
package/popover/types.d.ts
CHANGED
|
@@ -5,11 +5,11 @@ export interface PopoverProps {
|
|
|
5
5
|
id?: string | undefined;
|
|
6
6
|
className?: string | undefined;
|
|
7
7
|
"data-testid"?: string | undefined;
|
|
8
|
-
onMobileClose?: () => void | undefined;
|
|
8
|
+
onMobileClose?: (() => void) | undefined;
|
|
9
9
|
}
|
|
10
10
|
export interface PopoverHOCProps {
|
|
11
|
-
onPopoverAppear?: () => void | undefined;
|
|
12
|
-
onPopoverDismiss?: () => void | undefined;
|
|
11
|
+
onPopoverAppear?: (() => void) | undefined;
|
|
12
|
+
onPopoverDismiss?: (() => void) | undefined;
|
|
13
13
|
}
|
|
14
14
|
export interface PopoverHOCOptionsProps {
|
|
15
15
|
content: string | JSX.Element;
|
|
@@ -4,6 +4,6 @@ export interface ProgressIndicatorProps<T> {
|
|
|
4
4
|
currentIndex: number;
|
|
5
5
|
fadeColor?: string[] | undefined;
|
|
6
6
|
fadePosition?: FadePosition | undefined;
|
|
7
|
-
displayExtractor?: (item: T) => string | undefined;
|
|
7
|
+
displayExtractor?: ((item: T) => string) | undefined;
|
|
8
8
|
}
|
|
9
9
|
export {};
|
|
@@ -22,7 +22,7 @@ export declare const TruncateContainer: import("styled-components").StyledCompon
|
|
|
22
22
|
export declare const TruncateFirstLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
23
|
export declare const TruncateSecondLine: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
24
|
export declare const Clickable: import("styled-components").StyledComponent<(props: import("../../text").TextLinkProps) => JSX.Element, any, {}, never>;
|
|
25
|
-
export declare const ListCheckbox: import("styled-components").StyledComponent<({ className, checked, disabled,
|
|
25
|
+
export declare const ListCheckbox: import("styled-components").StyledComponent<({ className, checked, disabled, onChange, onKeyPress, displaySize, ...otherProps }: import("../../checkbox").CheckboxProps) => JSX.Element, any, {}, never>;
|
|
26
26
|
export declare const SelectAllContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
27
27
|
export declare const DropdownCommonButton: import("styled-components").StyledComponent<"button", any, {}, never>;
|
|
28
28
|
export declare const ResultStateContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
@@ -6,26 +6,26 @@ export interface ListItemRenderArgs {
|
|
|
6
6
|
}
|
|
7
7
|
export interface DropdownDisplayProps<T, V> {
|
|
8
8
|
/** Function to derive value from an item */
|
|
9
|
-
valueExtractor?: (item: T) => V | undefined;
|
|
9
|
+
valueExtractor?: ((item: T) => V) | undefined;
|
|
10
10
|
/** Function to derive options display value from an item */
|
|
11
|
-
listExtractor?: (item: T) => string | undefined;
|
|
11
|
+
listExtractor?: ((item: T) => string) | undefined;
|
|
12
12
|
/** Function to render custom component */
|
|
13
|
-
renderListItem?: (item: T, args: ListItemRenderArgs) => JSX.Element | undefined;
|
|
13
|
+
renderListItem?: ((item: T, args: ListItemRenderArgs) => JSX.Element) | undefined;
|
|
14
14
|
}
|
|
15
15
|
export interface DropdownStyleProps {
|
|
16
16
|
listStyleWidth?: string | undefined;
|
|
17
17
|
}
|
|
18
18
|
export interface DropdownEventHandlerProps<T, V> {
|
|
19
|
-
onSelectItem?: (item: T, extractedValue: V) => void | undefined;
|
|
20
|
-
onSelectItems?: (items: T[]) => void | undefined;
|
|
19
|
+
onSelectItem?: ((item: T, extractedValue: V) => void) | undefined;
|
|
20
|
+
onSelectItems?: ((items: T[]) => void) | undefined;
|
|
21
21
|
}
|
|
22
22
|
export interface DropdownSearchProps<T> {
|
|
23
23
|
/** Specifying will render a search bar in the dropdown */
|
|
24
24
|
enableSearch?: boolean | undefined;
|
|
25
25
|
searchPlaceholder?: string | undefined;
|
|
26
26
|
/** Custom function to perform search when a user keys in a value in the search input */
|
|
27
|
-
searchFunction?: (searchValue: string) => T[] | undefined;
|
|
28
|
-
onSearch?: () => void | undefined;
|
|
27
|
+
searchFunction?: ((searchValue: string) => T[]) | undefined;
|
|
28
|
+
onSearch?: (() => void) | undefined;
|
|
29
29
|
}
|
|
30
30
|
export interface DropdownListProps<T, V> extends React.HTMLAttributes<HTMLUListElement>, DropdownEventHandlerProps<T, V>, DropdownDisplayProps<T, V>, DropdownSearchProps<T>, DropdownStyleProps {
|
|
31
31
|
listItems?: T[] | undefined;
|
|
@@ -39,10 +39,10 @@ export interface DropdownListProps<T, V> extends React.HTMLAttributes<HTMLUListE
|
|
|
39
39
|
itemsLoadState?: ItemsLoadStateType | undefined;
|
|
40
40
|
/** Specifies the truncation type. Truncated text will be replaced with ellipsis. Values: "middle" | "end" */
|
|
41
41
|
itemTruncationType?: TruncateType | undefined;
|
|
42
|
-
onDismiss?: () => void | undefined;
|
|
43
|
-
onSelectAll?: () => void | undefined;
|
|
44
|
-
onRetry?: () => void | undefined;
|
|
42
|
+
onDismiss?: (() => void) | undefined;
|
|
43
|
+
onSelectAll?: (() => void) | undefined;
|
|
44
|
+
onRetry?: (() => void) | undefined;
|
|
45
45
|
}
|
|
46
46
|
export interface ListItemSelectorProps {
|
|
47
|
-
onClick?: () => void | undefined;
|
|
47
|
+
onClick?: (() => void) | undefined;
|
|
48
48
|
}
|
|
@@ -7,7 +7,7 @@ export interface SmartAppBannerProps {
|
|
|
7
7
|
animated?: boolean | undefined;
|
|
8
8
|
className?: string | undefined;
|
|
9
9
|
onDismiss: () => void;
|
|
10
|
-
onClick?: () => void | undefined;
|
|
10
|
+
onClick?: (() => void) | undefined;
|
|
11
11
|
}
|
|
12
12
|
export interface SmartAppBannerContentProps {
|
|
13
13
|
title: string;
|
package/timepicker/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface TimepickerProps extends React.AriaAttributes {
|
|
|
13
13
|
format?: TimepickerFormat | undefined;
|
|
14
14
|
disabled?: boolean | undefined;
|
|
15
15
|
error?: boolean | undefined;
|
|
16
|
-
onChange?: (value: string) => void | undefined;
|
|
17
|
-
onBlur?: () => void | undefined;
|
|
18
|
-
onSelectionCancel?: () => void | undefined;
|
|
16
|
+
onChange?: ((value: string) => void) | undefined;
|
|
17
|
+
onBlur?: (() => void) | undefined;
|
|
18
|
+
onSelectionCancel?: (() => void) | undefined;
|
|
19
19
|
}
|
package/unit-number/types.d.ts
CHANGED
|
@@ -7,21 +7,21 @@ export interface UnitNumberInputProps extends React.AriaAttributes {
|
|
|
7
7
|
"data-testid"?: string | undefined;
|
|
8
8
|
readOnly?: boolean | undefined;
|
|
9
9
|
placeholder?: string | undefined;
|
|
10
|
-
role?:
|
|
10
|
+
role?: React.AriaRole | undefined;
|
|
11
11
|
value?: string | undefined;
|
|
12
12
|
name?: string | undefined;
|
|
13
13
|
error?: boolean | undefined;
|
|
14
14
|
disabled?: boolean | undefined;
|
|
15
|
-
onChange?: (value: string) => void | undefined;
|
|
15
|
+
onChange?: ((value: string) => void) | undefined;
|
|
16
16
|
/**
|
|
17
17
|
* Function that returns the raw values in the UnitNumberInput on change in an array format
|
|
18
18
|
* as such [floor, unit]
|
|
19
19
|
*/
|
|
20
|
-
onChangeRaw?: (value: string[]) => void | undefined;
|
|
21
|
-
onBlur?: (value: string) => void | undefined;
|
|
20
|
+
onChangeRaw?: ((value: string[]) => void) | undefined;
|
|
21
|
+
onBlur?: ((value: string) => void) | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Function that returns the raw values in the UnitNumberInput on blur in an array format
|
|
24
24
|
* as such [floor, unit]
|
|
25
25
|
*/
|
|
26
|
-
onBlurRaw?: (value: string[]) => void | undefined;
|
|
26
|
+
onBlurRaw?: ((value: string[]) => void) | undefined;
|
|
27
27
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare namespace DateHelper {
|
|
2
|
+
/**
|
|
3
|
+
* Ensures that the given value is transformed into a logical day number (i.e. 1 - 31 days)
|
|
4
|
+
* @param day input day number
|
|
5
|
+
* @param month input month number
|
|
6
|
+
* @param month input year number
|
|
7
|
+
*/
|
|
8
|
+
const clampDay: (day: string, month: string, year: string) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Ensures that the given value is transformed into a logical month number (i.e. 1 - 12 months)
|
|
11
|
+
* @param month input month number
|
|
12
|
+
*/
|
|
13
|
+
const clampMonth: (month: string) => string;
|
|
14
|
+
/**
|
|
15
|
+
* Checks if the specified year is a leap year
|
|
16
|
+
* @param year input year number
|
|
17
|
+
*/
|
|
18
|
+
const isLeapYear: (year: number) => boolean;
|
|
19
|
+
}
|
package/util/index.d.ts
ADDED