@trackunit/react-components 0.0.47 → 0.0.50
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/README.md +12 -30
- package/common/CommonProps.d.ts +0 -2
- package/common/useContainerProps.d.ts +8 -0
- package/components/NumberField/NumberField.d.ts +0 -1
- package/components/NumberInput/NumberInput.d.ts +2 -2
- package/components/TextInput/TextInput.d.ts +2 -2
- package/components/alert/Alert.d.ts +6 -7
- package/components/badge/Badge.d.ts +8 -9
- package/components/baseInput/BaseInput.d.ts +0 -8
- package/components/buttons/button/Button.d.ts +4 -6
- package/components/buttons/icon-button/IconButton.d.ts +0 -3
- package/components/buttons/shared/ButtonProps.d.ts +0 -7
- package/components/buttons/shared/helpers.d.ts +10 -0
- package/components/buttons/star-button/StarButton.d.ts +6 -0
- package/components/card/Card.d.ts +7 -3
- package/components/card/CardBody.d.ts +5 -4
- package/components/card/CardFooter.d.ts +2 -2
- package/components/card/CardHeader.d.ts +4 -13
- package/components/card/DensityContainer.d.ts +10 -11
- package/components/chart/Chart.d.ts +5 -10
- package/components/checkbox/CheckIcon.d.ts +11 -3
- package/components/checkbox/Checkbox.d.ts +0 -6
- package/components/checkbox/IndeterminateIcon.d.ts +6 -0
- package/components/collapse/Collapse.d.ts +6 -3
- package/components/copyableText/CopyableText.d.ts +6 -3
- package/components/dateField/DateField.d.ts +2 -6
- package/components/dayPicker/DayPicker.d.ts +18 -0
- package/components/dayPicker/DayPickerPopover.d.ts +6 -0
- package/components/dayPicker/DayRangePicker.d.ts +6 -0
- package/components/dayPicker/useLocale.d.ts +6 -0
- package/components/formGroup/FormGroup.d.ts +8 -6
- package/components/heading/Heading.d.ts +6 -4
- package/components/icon/Icon.d.ts +12 -10
- package/components/indicator/Indicator.d.ts +7 -5
- package/components/label/Label.d.ts +8 -4
- package/components/legendItem/LegendItem.d.ts +6 -0
- package/components/menu/MenuButton.d.ts +6 -0
- package/components/menu/MenuItem.d.ts +6 -4
- package/components/menu/MenuList.d.ts +6 -3
- package/components/modal/Modal.d.ts +0 -4
- package/components/modal/ModalBackdrop.d.ts +6 -0
- package/components/modal/useModal.d.ts +6 -0
- package/components/multiRowTableCell/MultiRowTableCell.d.ts +4 -4
- package/components/pageHeading/PageHeading.d.ts +6 -3
- package/components/popover/PopoverList.d.ts +6 -0
- package/components/popover/PopoverListItem.d.ts +6 -0
- package/components/popover/PopoverTitle.d.ts +6 -0
- package/components/popover/usePopover.d.ts +6 -0
- package/components/prompt/Prompt.d.ts +13 -3
- package/components/radioGroup/RadioGroup.d.ts +6 -8
- package/components/radioGroup/RadioItem.d.ts +6 -2
- package/components/select/CreatableSelect.d.ts +6 -0
- package/components/select/FieldContainer.d.ts +6 -0
- package/components/select/Select.d.ts +6 -0
- package/components/select/shared.d.ts +15 -9
- package/components/skeletonLines/SkeletonLines.d.ts +0 -5
- package/components/spacer/Spacer.d.ts +6 -2
- package/components/spinner/Spinner.d.ts +6 -0
- package/components/text/Text.d.ts +6 -10
- package/components/textArea/TextArea.d.ts +0 -54
- package/components/textField/TextField.d.ts +0 -2
- package/components/textField/TextLenghtIndicator.d.ts +13 -0
- package/components/tip/Tip.d.ts +8 -3
- package/components/toggle/Toggle.d.ts +0 -26
- package/components/tooltip/Tooltip.d.ts +6 -9
- package/hooks/useDebounce.d.ts +7 -0
- package/hooks/useLocalStorage.d.ts +7 -0
- package/hooks/useTimeout.d.ts +6 -0
- package/index.js +445 -39
- package/layout/helper/MinTopFullContentLayout.d.ts +6 -0
- package/layout/responsive/FilterListMapLayout.d.ts +6 -3
- package/layout/responsive/FullWidthRepeatingLayout.d.ts +8 -5
- package/layout/responsive/GridArea.d.ts +3 -1
- package/layout/responsive/IntrinsicallyResponsiveGrid.d.ts +12 -8
- package/layout/responsive/TitleNavContentLayout.d.ts +8 -2
- package/layout/responsive/TwoColumnLayout.d.ts +8 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,36 +1,18 @@
|
|
|
1
|
-
# React
|
|
1
|
+
# Trackunit React Components
|
|
2
|
+
The `@trackunit/react-components` package is the home of Trackunits public UI library.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
This library is (going to be) exposed publibly and should therfore be treated accordingly.
|
|
4
|
+
This library is exposed publicly for use in the the Trackunit [Iris App SDK](https://www.npmjs.com/package/@trackunit/iris-app).
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
`yarn nx workspace-generator react-component MyTestComponent --directory=components --project=react-components --no-interactive`
|
|
6
|
+
To browse all avaliable components visit our [Public Storybook](https://developers.trackunit.com/page/ui-components).
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
_Not all current components lives up the these standards but any new component should_
|
|
11
|
-
_We are working on updating all existing components_
|
|
8
|
+
For more info and a full guide on Iris App SDK Development, please visit our [Developer Hub](https://developers.trackunit.com/).
|
|
12
9
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
- Must extend CommonProps (Have ClassName and DataTestId).
|
|
17
|
-
- Must expose their styles in a .css file using @apply and be exposed in our css-components library.
|
|
18
|
-
- Should be reviewed by @patr2275.
|
|
19
|
-
- May only depend on other Buildable, Publishable and visibility:public tagged libs.
|
|
10
|
+
## Development
|
|
11
|
+
At this point this library is only developed by Trackunit Employees.
|
|
12
|
+
For development related information see the [development readme](https://github.com/Trackunit/manager/blob/master/libs/react/components/DEVELOPMENT.md).
|
|
20
13
|
|
|
21
|
-
##
|
|
14
|
+
## Trackunit
|
|
15
|
+
This package was developed by Trackunit ApS.
|
|
16
|
+
Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
Used for holding the code for the individual stories and configuring the story parameters.
|
|
25
|
-
Keeping these in the .tsx file allows for Typescript and auto completion.
|
|
26
|
-
|
|
27
|
-
Prefixing a story with Hidden removes it form the sidebar navigation, but they can still be referenced in the docs mdx.
|
|
28
|
-
|
|
29
|
-
**Component.docs.mdx**
|
|
30
|
-
Handles the layout of the docs page shown in storybook.
|
|
31
|
-
References stories from the tsx file.
|
|
32
|
-
|
|
33
|
-
## TODO:
|
|
34
|
-
1. Update Introduction and Fundamentals documentation.
|
|
35
|
-
2. Enable docs autogen to generate props and controls from typescript and jsdocs.
|
|
36
|
-
3. Update stories on existing components and move them away from Legacy Components.
|
|
18
|
+

|
package/common/CommonProps.d.ts
CHANGED
|
@@ -2,14 +2,12 @@ export interface CommonProps {
|
|
|
2
2
|
/**
|
|
3
3
|
* A custom class name to be attached to root element
|
|
4
4
|
*
|
|
5
|
-
* @type string
|
|
6
5
|
* @memberof CommonProps
|
|
7
6
|
*/
|
|
8
7
|
className?: string;
|
|
9
8
|
/**
|
|
10
9
|
* A id that can be used in tests to get the component
|
|
11
10
|
*
|
|
12
|
-
* @type string
|
|
13
11
|
* @memberof CommonProps
|
|
14
12
|
*/
|
|
15
13
|
dataTestId?: string;
|
|
@@ -2,6 +2,14 @@ export interface IUseContainerProps {
|
|
|
2
2
|
className?: string;
|
|
3
3
|
dataTestId?: string;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* Utility for common props on containers.
|
|
7
|
+
*
|
|
8
|
+
* @param {IUseContainerProps} ContainerProps - Props for the utility
|
|
9
|
+
* @param {string} ContainerProps.className - Optional custom className
|
|
10
|
+
* @param {string} ContainerProps.dataTestId - Optional custom data-TestId
|
|
11
|
+
* @returns {IUseContainerProps} - Object with undefined values removed
|
|
12
|
+
*/
|
|
5
13
|
export declare const useContainerProps: ({ className, dataTestId }: IUseContainerProps) => {
|
|
6
14
|
className: string | undefined;
|
|
7
15
|
"data-testid": string | undefined;
|
|
@@ -4,9 +4,9 @@ declare type BaseInputExposedProps = Omit<BaseInputProps, "type">;
|
|
|
4
4
|
export interface NumberInputProps extends BaseInputExposedProps {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* A thin wrapper
|
|
7
|
+
* A thin wrapper around the `BaseInput` component for number input fields.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* NOTE: If shown with a label, please use the `NumberField` component instead.
|
|
10
10
|
*/
|
|
11
11
|
export declare const NumberInput: import("react").ForwardRefExoticComponent<NumberInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
12
|
export {};
|
|
@@ -4,9 +4,9 @@ declare type BaseInputExposedProps = Omit<BaseInputProps, "type">;
|
|
|
4
4
|
export interface TextInputProps extends BaseInputExposedProps {
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
|
-
* A thin wrapper
|
|
7
|
+
* A thin wrapper around the `BaseInput` component for text input fields.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
9
|
+
* NOTE: If shown with a label, please use the `TextField` component instead.
|
|
10
10
|
*/
|
|
11
11
|
export declare const TextInput: import("react").ForwardRefExoticComponent<TextInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
12
12
|
export {};
|
|
@@ -11,13 +11,11 @@ export interface AlertProps extends CommonProps {
|
|
|
11
11
|
/**
|
|
12
12
|
* Child nodes.
|
|
13
13
|
*
|
|
14
|
-
* @type React.ReactNode
|
|
15
14
|
* @memberof AlertProps
|
|
16
15
|
*/
|
|
17
16
|
children: React.ReactNode;
|
|
18
17
|
/**
|
|
19
18
|
* Intent of the alert component.
|
|
20
|
-
* @type "info" | "warning" | "danger" | "success"
|
|
21
19
|
*
|
|
22
20
|
* @memberof AlertProps
|
|
23
21
|
*/
|
|
@@ -25,21 +23,18 @@ export interface AlertProps extends CommonProps {
|
|
|
25
23
|
/**
|
|
26
24
|
* Title of the alert component.
|
|
27
25
|
*
|
|
28
|
-
* @type string
|
|
29
26
|
* @memberof AlertProps
|
|
30
27
|
*/
|
|
31
28
|
title?: string;
|
|
32
29
|
/**
|
|
33
30
|
* Action to be performed on clicking the primary button.
|
|
34
31
|
*
|
|
35
|
-
* @type AlertAction
|
|
36
32
|
* @memberof AlertProps
|
|
37
33
|
*/
|
|
38
34
|
primaryAction?: AlertAction;
|
|
39
35
|
/**
|
|
40
36
|
* Action to be performed on clicking the secondary button.
|
|
41
37
|
*
|
|
42
|
-
* @type {AlertAction}
|
|
43
38
|
* @memberof AlertProps
|
|
44
39
|
*/
|
|
45
40
|
secondaryAction?: AlertAction;
|
|
@@ -52,7 +47,6 @@ export interface AlertProps extends CommonProps {
|
|
|
52
47
|
/**
|
|
53
48
|
* Whether the contents should be displayed inline or not.
|
|
54
49
|
*
|
|
55
|
-
* @type boolean
|
|
56
50
|
* @memberof AlertProps
|
|
57
51
|
*/
|
|
58
52
|
inline?: boolean;
|
|
@@ -61,9 +55,14 @@ export interface AlertProps extends CommonProps {
|
|
|
61
55
|
*
|
|
62
56
|
* could be used for displaying errors on long scrollable forms
|
|
63
57
|
*
|
|
64
|
-
* @type boolean
|
|
65
58
|
* @memberof AlertProps
|
|
66
59
|
*/
|
|
67
60
|
autoScroll?: boolean;
|
|
68
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* The Alert component should be used to inform the user of important information.
|
|
64
|
+
*
|
|
65
|
+
* @param {AlertProps} props - The props for the Alert component
|
|
66
|
+
* @returns {JSX.Element} Alert component
|
|
67
|
+
*/
|
|
69
68
|
export declare const Alert: ({ intent, title, className, children, primaryAction, secondaryAction, onClose, dataTestId, autoScroll, inline, }: AlertProps) => JSX.Element;
|
|
@@ -3,7 +3,7 @@ import { CommonProps } from "../../common/CommonProps";
|
|
|
3
3
|
import { Colors } from "../../constants/colors";
|
|
4
4
|
export declare type BadgeSize = "default" | "large";
|
|
5
5
|
declare type BadgeVariant = "badge" | "pill" | "tag";
|
|
6
|
-
|
|
6
|
+
interface TagProps extends BaseBadgeProps {
|
|
7
7
|
/**
|
|
8
8
|
* The name of the variant.
|
|
9
9
|
*
|
|
@@ -14,16 +14,14 @@ export interface TagProps extends BaseBadgeProps {
|
|
|
14
14
|
* A handler for a click event triggered on x icon
|
|
15
15
|
* if not passed then x icon won't be visible
|
|
16
16
|
*
|
|
17
|
-
* @type () => void
|
|
18
17
|
* @memberof TagProps
|
|
19
18
|
*/
|
|
20
19
|
onClose?: () => void;
|
|
21
20
|
}
|
|
22
|
-
|
|
21
|
+
interface BaseBadgeProps extends CommonProps {
|
|
23
22
|
/**
|
|
24
23
|
* The color of the badge.
|
|
25
24
|
*
|
|
26
|
-
* @type "primary" | "accent" | "neutral" | "info" | "success" | "warning" | "danger" | "good" | "low" | "critical" | "working" | "idle" | "stopped" | "unknown"
|
|
27
25
|
* @memberof BadgeProps
|
|
28
26
|
*/
|
|
29
27
|
color?: Colors;
|
|
@@ -31,7 +29,6 @@ export interface BaseBadgeProps extends CommonProps {
|
|
|
31
29
|
* Specifies whether the badge is subtle or not.
|
|
32
30
|
* Subtle badges have a light background color wither a darker text color.
|
|
33
31
|
*
|
|
34
|
-
* @type boolean
|
|
35
32
|
* @memberof BadgeProps
|
|
36
33
|
*/
|
|
37
34
|
subtle?: boolean;
|
|
@@ -41,7 +38,6 @@ export interface BaseBadgeProps extends CommonProps {
|
|
|
41
38
|
* Tag will display x icon if you provide onClose handler.
|
|
42
39
|
* Badge is subtle by default.
|
|
43
40
|
*
|
|
44
|
-
* @type "badge" | "pill" | "tag"
|
|
45
41
|
* @memberof BadgeProps
|
|
46
42
|
*/
|
|
47
43
|
variant?: BadgeVariant;
|
|
@@ -50,25 +46,28 @@ export interface BaseBadgeProps extends CommonProps {
|
|
|
50
46
|
* Example: Set a maximum width of the badge by adding the className "max-w-[your-max-width]" or similar tailwind max-w class.
|
|
51
47
|
* This will make the badge truncate the text if it is too long.
|
|
52
48
|
*
|
|
53
|
-
* @type string
|
|
54
49
|
* @memberof BadgeProps
|
|
55
50
|
*/
|
|
56
51
|
className?: string;
|
|
57
52
|
/**
|
|
58
53
|
* Child nodes of the Badge.
|
|
59
54
|
*
|
|
60
|
-
* @type React.ReactNode
|
|
61
55
|
* @memberof BadgeProps
|
|
62
56
|
*/
|
|
63
57
|
children?: React.ReactNode;
|
|
64
58
|
/**
|
|
65
59
|
* Size of the badge.
|
|
66
60
|
*
|
|
67
|
-
* @type "default" | "large"
|
|
68
61
|
* @memberof BadgeProps
|
|
69
62
|
*/
|
|
70
63
|
size?: BadgeSize;
|
|
71
64
|
}
|
|
72
65
|
export declare type BadgeProps = BaseBadgeProps | TagProps;
|
|
66
|
+
/**
|
|
67
|
+
* The Badge component us used to display states or similar short form information.
|
|
68
|
+
*
|
|
69
|
+
* @param {BadgeProps} props - The props for the Badge component
|
|
70
|
+
* @returns {JSX.Element} Badge component
|
|
71
|
+
*/
|
|
73
72
|
export declare const Badge: ({ color, subtle, className, variant, dataTestId, children, size, ...rest }: BadgeProps) => JSX.Element;
|
|
74
73
|
export {};
|
|
@@ -8,7 +8,6 @@ export interface BaseInputProps extends FilteredInputProps, CommonProps {
|
|
|
8
8
|
* This is typically used to render an icon.
|
|
9
9
|
* For other elements than icons, please concider using the addonBefore prop.
|
|
10
10
|
*
|
|
11
|
-
* @type React.ReactNode
|
|
12
11
|
* @memberof BaseInputProps
|
|
13
12
|
*/
|
|
14
13
|
prefix?: React.ReactNode;
|
|
@@ -17,7 +16,6 @@ export interface BaseInputProps extends FilteredInputProps, CommonProps {
|
|
|
17
16
|
* This is typically used to render an icon.
|
|
18
17
|
* For other elements than icons, please concider using the addonAfter prop.
|
|
19
18
|
*
|
|
20
|
-
* @type React.ReactNode
|
|
21
19
|
* @memberof BaseInputProps
|
|
22
20
|
*/
|
|
23
21
|
suffix?: React.ReactNode;
|
|
@@ -26,7 +24,6 @@ export interface BaseInputProps extends FilteredInputProps, CommonProps {
|
|
|
26
24
|
* This is typically used to render text.
|
|
27
25
|
* For icons, please concider using the prefix prop.
|
|
28
26
|
*
|
|
29
|
-
* @type React.ReactNode
|
|
30
27
|
* @memberof BaseInputProps
|
|
31
28
|
*/
|
|
32
29
|
addonBefore?: React.ReactNode;
|
|
@@ -35,7 +32,6 @@ export interface BaseInputProps extends FilteredInputProps, CommonProps {
|
|
|
35
32
|
* This is typically used to render text.
|
|
36
33
|
* For icons, please concider using the suffix prop.
|
|
37
34
|
*
|
|
38
|
-
* @type React.ReactNode
|
|
39
35
|
* @memberof BaseInputProps
|
|
40
36
|
*/
|
|
41
37
|
addonAfter?: React.ReactNode;
|
|
@@ -43,7 +39,6 @@ export interface BaseInputProps extends FilteredInputProps, CommonProps {
|
|
|
43
39
|
* An ReactNode to render at the end of the input field befire the addonAfter.
|
|
44
40
|
* Mainly meant for the icon button actions for special input types.
|
|
45
41
|
*
|
|
46
|
-
* @type React.ReactNode
|
|
47
42
|
* @memberof BaseInputProps
|
|
48
43
|
*/
|
|
49
44
|
actions?: React.ReactNode;
|
|
@@ -51,21 +46,18 @@ export interface BaseInputProps extends FilteredInputProps, CommonProps {
|
|
|
51
46
|
* The size of the input.
|
|
52
47
|
* Default == 40px, Small == 32px.
|
|
53
48
|
*
|
|
54
|
-
* @type "small" | "default"
|
|
55
49
|
* @memberof BaseInputProps
|
|
56
50
|
*/
|
|
57
51
|
fieldSize?: FieldSize;
|
|
58
52
|
/**
|
|
59
53
|
* If ture the field is rendered in its invalid state.
|
|
60
54
|
*
|
|
61
|
-
* @type boolean
|
|
62
55
|
* @memberof BaseInputProps
|
|
63
56
|
*/
|
|
64
57
|
isInvalid?: boolean;
|
|
65
58
|
/**
|
|
66
59
|
* The Placeholder text for the input.
|
|
67
60
|
*
|
|
68
|
-
* @type string
|
|
69
61
|
* @memberof BaseInputProps
|
|
70
62
|
*/
|
|
71
63
|
placeholder?: string;
|
|
@@ -12,44 +12,42 @@ export interface ButtonProps extends ButtonCommonProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* Child nodes. Can be used to pass in text to be displayed on the button.
|
|
14
14
|
*
|
|
15
|
-
* @type React.ReactNode
|
|
16
15
|
* @memberof ButtonProps
|
|
17
16
|
*/
|
|
18
17
|
children?: React.ReactNode;
|
|
19
18
|
/**
|
|
20
19
|
* Whether button is fullWidth or not.
|
|
21
20
|
*
|
|
22
|
-
* @type boolean
|
|
23
21
|
* @memberof ButtonProps
|
|
24
22
|
*/
|
|
25
23
|
fullWidth?: boolean;
|
|
26
24
|
/**
|
|
27
25
|
* The button prefix.
|
|
28
26
|
*
|
|
29
|
-
* @type React.ReactNode
|
|
30
27
|
* @memberof ButtonProps
|
|
31
28
|
*/
|
|
32
29
|
prefix?: React.ReactNode;
|
|
33
30
|
/**
|
|
34
31
|
* The button suffix.
|
|
35
32
|
*
|
|
36
|
-
* @type React.ReactNode
|
|
37
33
|
* @memberof ButtonProps
|
|
38
34
|
*/
|
|
39
35
|
suffix?: React.ReactNode;
|
|
40
36
|
/**
|
|
41
37
|
* The type of the button. Values can be "submit" or "button".
|
|
42
38
|
*
|
|
43
|
-
* @type "submit" | "button"
|
|
44
39
|
* @memberof ButtonProps
|
|
45
40
|
*/
|
|
46
41
|
type?: ButtonType;
|
|
47
42
|
/**
|
|
48
43
|
* The element type the button will be rendered as.
|
|
49
44
|
*
|
|
50
|
-
* @type {(keyof JSX.IntrinsicElements | React.ComponentType<any>)}
|
|
51
45
|
* @memberof ButtonProps
|
|
52
46
|
*/
|
|
53
47
|
renderAs?: keyof JSX.IntrinsicElements | React.ComponentType<any>;
|
|
48
|
+
/**
|
|
49
|
+
* The Id of the form to submit, for button type submit
|
|
50
|
+
*/
|
|
51
|
+
form?: string;
|
|
54
52
|
}
|
|
55
53
|
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -4,14 +4,12 @@ export interface IconButtonProps extends ButtonCommonProps {
|
|
|
4
4
|
/**
|
|
5
5
|
* The icon to display.
|
|
6
6
|
*
|
|
7
|
-
* @type React.ReactNode
|
|
8
7
|
* @memberof IconButtonProps
|
|
9
8
|
*/
|
|
10
9
|
icon: React.ReactNode;
|
|
11
10
|
/**
|
|
12
11
|
* Whether the button is circular or not.
|
|
13
12
|
*
|
|
14
|
-
* @type boolean
|
|
15
13
|
* @memberof IconButtonProps
|
|
16
14
|
*/
|
|
17
15
|
circular?: boolean;
|
|
@@ -25,7 +23,6 @@ export interface IconButtonProps extends ButtonCommonProps {
|
|
|
25
23
|
/**
|
|
26
24
|
* The size of the button. Defaults to "small".
|
|
27
25
|
*
|
|
28
|
-
* @type "small" | "normal" | "large"
|
|
29
26
|
* @memberof IconButtonProps
|
|
30
27
|
*/
|
|
31
28
|
size?: ButtonSize;
|
|
@@ -9,49 +9,42 @@ export interface ButtonCommonProps extends CommonProps {
|
|
|
9
9
|
/**
|
|
10
10
|
* Whether the button is loading.
|
|
11
11
|
*
|
|
12
|
-
* @type boolean
|
|
13
12
|
* @memberof ButtonCommonProps
|
|
14
13
|
*/
|
|
15
14
|
loading?: boolean;
|
|
16
15
|
/**
|
|
17
16
|
* Whether the button is disabled.
|
|
18
17
|
*
|
|
19
|
-
* @type boolean
|
|
20
18
|
* @memberof ButtonCommonProps
|
|
21
19
|
*/
|
|
22
20
|
disabled?: boolean;
|
|
23
21
|
/**
|
|
24
22
|
* Button with square aspect ratio.
|
|
25
23
|
*
|
|
26
|
-
* @type boolean
|
|
27
24
|
* @memberof ButtonCommonProps
|
|
28
25
|
*/
|
|
29
26
|
square?: boolean;
|
|
30
27
|
/**
|
|
31
28
|
* The button's variant. Values are filled, transparent, plain.
|
|
32
29
|
*
|
|
33
|
-
* @type "primary" | "secondary" | "danger" | "warning" | "tertiary"
|
|
34
30
|
* @memberof ButtonCommonProps
|
|
35
31
|
*/
|
|
36
32
|
intent?: ButtonIntent;
|
|
37
33
|
/**
|
|
38
34
|
* The variant of the button.
|
|
39
35
|
*
|
|
40
|
-
* @type "filled" | "transparent"
|
|
41
36
|
* @memberof ButtonCommonProps
|
|
42
37
|
*/
|
|
43
38
|
variant?: ButtonVariant;
|
|
44
39
|
/**
|
|
45
40
|
* The size of the button.
|
|
46
41
|
*
|
|
47
|
-
* @type "small" | "normal" | "large"
|
|
48
42
|
* @memberof ButtonCommonProps
|
|
49
43
|
*/
|
|
50
44
|
size?: ButtonSize;
|
|
51
45
|
/**
|
|
52
46
|
* The link to be used for the button.
|
|
53
47
|
*
|
|
54
|
-
* @type string
|
|
55
48
|
* @memberof ButtonCommonProps
|
|
56
49
|
*/
|
|
57
50
|
to?: string;
|
|
@@ -4,6 +4,16 @@ interface ButtonProps {
|
|
|
4
4
|
$variant: ButtonVariant;
|
|
5
5
|
$size: ButtonSize;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Helper to get the needed classname from buttonProps.
|
|
9
|
+
*
|
|
10
|
+
* @returns {string} - Classnames for the button
|
|
11
|
+
*/
|
|
7
12
|
export declare const getStyles: () => ({ $intent, $variant }: ButtonProps) => string;
|
|
13
|
+
/**
|
|
14
|
+
* Helper to get the needed classname for padding.
|
|
15
|
+
*
|
|
16
|
+
* @returns {string} - The correct class for setting padding.
|
|
17
|
+
*/
|
|
8
18
|
export declare const getPadding: () => ({ $size }: ButtonProps) => string;
|
|
9
19
|
export {};
|
|
@@ -3,5 +3,11 @@ interface StarButtonProps {
|
|
|
3
3
|
starred: boolean;
|
|
4
4
|
onClick: (e: React.MouseEvent) => void;
|
|
5
5
|
}
|
|
6
|
+
/**
|
|
7
|
+
* The StarButton component is used for favorite actions or similar.
|
|
8
|
+
*
|
|
9
|
+
* @param {StarButtonProps} props - The props for the StarButton component
|
|
10
|
+
* @returns {JSX.Element} StarButton component
|
|
11
|
+
*/
|
|
6
12
|
export declare const StarButton: ({ starred, onClick }: StarButtonProps) => JSX.Element;
|
|
7
13
|
export {};
|
|
@@ -10,24 +10,28 @@ export interface CardProps extends CommonProps {
|
|
|
10
10
|
/**
|
|
11
11
|
* Whether the card should have full height or not.
|
|
12
12
|
*
|
|
13
|
-
* @type boolean
|
|
14
13
|
* @memberof CardProps
|
|
15
14
|
*/
|
|
16
15
|
fullHeight?: boolean;
|
|
17
16
|
/**
|
|
18
17
|
* Whether the card should overflow contents.
|
|
19
18
|
*
|
|
20
|
-
* @type "visible" | "hidden" | "scroll" | "auto"
|
|
21
19
|
* @memberof CardProps
|
|
22
20
|
*/
|
|
23
21
|
overflow?: Overflow;
|
|
24
22
|
/**
|
|
25
23
|
*
|
|
26
24
|
* @deprecated Use tailwind based grid layouts instead.
|
|
27
|
-
* @type string
|
|
28
25
|
* @memberof CardProps
|
|
29
26
|
*/
|
|
30
27
|
gridArea?: string;
|
|
31
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* The Card component is a container for ui elements.
|
|
31
|
+
* Is also used for modals etc.
|
|
32
|
+
*
|
|
33
|
+
* @param {CardProps} props - The props for the Card component
|
|
34
|
+
* @returns {JSX.Element} Card component
|
|
35
|
+
*/
|
|
32
36
|
export declare const Card: ({ children, onClick, fullHeight, onMouseEnter, onMouseLeave, className, dataTestId, overflow, gridArea, }: CardProps) => JSX.Element;
|
|
33
37
|
export {};
|
|
@@ -11,11 +11,12 @@ interface CardContentProps extends CommonProps {
|
|
|
11
11
|
children: React.ReactNode | null;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
* For applying padding and gap to a Card.
|
|
14
|
+
* The CardBody component should be used to inform the user of important information.
|
|
16
15
|
*
|
|
17
|
-
* @
|
|
18
|
-
* The padding must live here, and not on the Card itself, as to not inset the scrollbar in case of overflow
|
|
16
|
+
* @summary For applying padding and gap to a Card.
|
|
17
|
+
* @description The padding must live here, and not on the Card itself, as to not inset the scrollbar in case of overflow
|
|
18
|
+
* @param {CardContentProps} props - The props for the CardBody component
|
|
19
|
+
* @returns {JSX.Element} CardBody component
|
|
19
20
|
*/
|
|
20
21
|
export declare const CardBody: ({ density, overflow, children, dataTestId, className, disableGap, }: CardContentProps) => JSX.Element;
|
|
21
22
|
export {};
|
|
@@ -9,8 +9,8 @@ interface CardFooterProps extends CommonProps {
|
|
|
9
9
|
* Currently only intended to contain Buttons.
|
|
10
10
|
* The buttons justifies to the right, but if you style a button with "margin-right: auto" it will move to the left
|
|
11
11
|
*
|
|
12
|
-
* @param {CardFooterProps}
|
|
13
|
-
* @
|
|
12
|
+
* @param {CardFooterProps} props - The props for the CardFooter component
|
|
13
|
+
* @returns {JSX.Element} CardFooter component
|
|
14
14
|
*/
|
|
15
15
|
export declare const CardFooter: ({ dataTestId, className, children, density }: CardFooterProps) => JSX.Element;
|
|
16
16
|
export {};
|
|
@@ -7,6 +7,7 @@ interface CardHeaderProps extends CommonProps {
|
|
|
7
7
|
/**
|
|
8
8
|
* The variant/size of the heading.
|
|
9
9
|
* Same as the `Heading` component.
|
|
10
|
+
*
|
|
10
11
|
* @default "primary"
|
|
11
12
|
*/
|
|
12
13
|
headingVariant?: HeadingVariant;
|
|
@@ -20,20 +21,10 @@ interface CardHeaderProps extends CommonProps {
|
|
|
20
21
|
showSeparator?: boolean;
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
23
|
-
* Header for Cards and
|
|
24
|
+
* Header for Cards and Modals.
|
|
24
25
|
*
|
|
25
|
-
*
|
|
26
|
-
* @
|
|
27
|
-
* heading,
|
|
28
|
-
* headingVariant = "primary",
|
|
29
|
-
* subHeading,
|
|
30
|
-
* onClose,
|
|
31
|
-
* dataTestId,
|
|
32
|
-
* className,
|
|
33
|
-
* children,
|
|
34
|
-
* density,
|
|
35
|
-
* }
|
|
36
|
-
* @return {*}
|
|
26
|
+
* @param {CardHeaderProps} props - The props for the CardHeader component
|
|
27
|
+
* @returns {JSX.Element} CardHeader component
|
|
37
28
|
*/
|
|
38
29
|
export declare const CardHeader: ({ heading, headingVariant, subHeading, onClose, dataTestId, className, children, accessories, density, }: CardHeaderProps) => JSX.Element;
|
|
39
30
|
export {};
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { CommonProps, Density } from "../../common/CommonProps";
|
|
3
|
-
/**
|
|
4
|
-
* @summary
|
|
5
|
-
* For applying auto padding and gap to a Card or Modal or whatever.
|
|
6
|
-
*
|
|
7
|
-
* @description
|
|
8
|
-
* Density applies gap and padding.
|
|
9
|
-
* The padding should live here, and not on the Card itself, as to not inset the scrollbar in case of overflow.
|
|
10
|
-
*/
|
|
11
3
|
interface ContainerProps extends CommonProps {
|
|
12
4
|
/**
|
|
13
5
|
* The density of the card components.
|
|
@@ -15,23 +7,30 @@ interface ContainerProps extends CommonProps {
|
|
|
15
7
|
* "comfortable" = 16px gap and padding.
|
|
16
8
|
* "spacious" = 16px gap, 26px padding.
|
|
17
9
|
*
|
|
18
|
-
* @type "none" | "compact" | "comfortable" | "spacious" | "auto"
|
|
19
10
|
* @memberof ContainerProps
|
|
20
11
|
*/
|
|
21
12
|
$density?: Density;
|
|
22
13
|
/**
|
|
23
14
|
* Set gap to be 0px (not preferable)
|
|
24
|
-
*
|
|
15
|
+
*
|
|
16
|
+
* @memberof ContainerProps
|
|
25
17
|
*/
|
|
26
18
|
$disableGap?: boolean;
|
|
27
19
|
/**
|
|
28
20
|
* The flex direction of the Card. Defaults to "column".
|
|
29
21
|
*
|
|
30
|
-
* @type "row" | "row-reverse" | "column" | "column-reverse"
|
|
31
22
|
* @memberof ContainerProps
|
|
32
23
|
*/
|
|
33
24
|
$direction?: "row" | "row-reverse" | "column" | "column-reverse";
|
|
34
25
|
children?: React.ReactNode;
|
|
35
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* The DensityContainer component applies gap and padding.
|
|
29
|
+
* The padding should live here, and not on the Card itself, as to not inset the scrollbar in case of overflow.
|
|
30
|
+
*
|
|
31
|
+
* @summary For applying auto padding and gap to a Card or Modal or whatever.
|
|
32
|
+
* @param {ContainerProps} props - The props for the DensityContainer component
|
|
33
|
+
* @returns {JSX.Element} DensityContainer component
|
|
34
|
+
*/
|
|
36
35
|
export declare const DensityContainer: ({ children, className, dataTestId, $density, $disableGap, $direction, }: ContainerProps) => JSX.Element;
|
|
37
36
|
export {};
|