@pk-design/react-tailwind 1.5.3 → 1.6.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/react-tailwind.cjs.js +1429 -289
- package/dist/react-tailwind.cjs.js.map +1 -1
- package/dist/react-tailwind.es.js +1420 -292
- package/dist/react-tailwind.es.js.map +1 -1
- package/dist/types/components/BodyText/BodyText.d.ts +1 -1
- package/dist/types/components/BodyText/BodyText.types.d.ts +47 -8
- package/dist/types/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/dist/types/components/Breadcrumb/Breadcrumb.types.d.ts +43 -10
- package/dist/types/components/Button/Button.types.d.ts +17 -63
- package/dist/types/components/ButtonGroup/ButtonGroup.types.d.ts +16 -0
- package/dist/types/components/Card/Card.d.ts +7 -1
- package/dist/types/components/Card/Card.types.d.ts +48 -42
- package/dist/types/components/Checkbox/Checkbox.types.d.ts +28 -1
- package/dist/types/components/CheckboxGroup/CheckboxGroup.types.d.ts +53 -1
- package/dist/types/components/DetailedInformation/DetailedInformation.d.ts +1 -1
- package/dist/types/components/DetailedInformation/DetailedInformation.types.d.ts +47 -3
- package/dist/types/components/Drawer/Drawer.types.d.ts +37 -13
- package/dist/types/components/Dropdown/Dropdown.types.d.ts +17 -1
- package/dist/types/components/HeadingText/HeadingText.d.ts +7 -7
- package/dist/types/components/HeadingText/HeadingText.test.d.ts +1 -0
- package/dist/types/components/HeadingText/HeadingText.types.d.ts +56 -3
- package/dist/types/components/Input/Input.d.ts +4 -2
- package/dist/types/components/Input/Input.types.d.ts +36 -3
- package/dist/types/components/Loader/index.d.ts +1 -1
- package/dist/types/components/PasswordInput/PasswordInput.d.ts +8 -4
- package/dist/types/components/PasswordInput/PasswordInput.types.d.ts +8 -0
- package/dist/types/components/QuantityStepper/QuantityStepper.d.ts +3 -0
- package/dist/types/components/QuantityStepper/QuantityStepper.test.d.ts +1 -0
- package/dist/types/components/QuantityStepper/QuantityStepper.types.d.ts +49 -0
- package/dist/types/components/QuantityStepper/index.d.ts +2 -0
- package/dist/types/components/Radio/Radio.d.ts +1 -1
- package/dist/types/components/Radio/Radio.types.d.ts +12 -2
- package/dist/types/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/types/components/RadioGroup/RadioGroup.types.d.ts +41 -13
- package/dist/types/components/RadioSwitch/RadioSwitch.d.ts +0 -4
- package/dist/types/components/RadioSwitch/RadioSwitch.types.d.ts +6 -31
- package/dist/types/components/RangeInput/RangeInput.d.ts +1 -1
- package/dist/types/components/RangeInput/RangeInput.types.d.ts +14 -1
- package/dist/types/components/RangeSlider/RangeSlider.d.ts +1 -1
- package/dist/types/components/RangeSlider/RangeSlider.types.d.ts +28 -13
- package/dist/types/components/SegmentedControl/SegmentedControl.d.ts +3 -0
- package/dist/types/components/SegmentedControl/SegmentedControl.test.d.ts +1 -0
- package/dist/types/components/SegmentedControl/SegmentedControl.types.d.ts +53 -0
- package/dist/types/components/SegmentedControl/index.d.ts +2 -0
- package/dist/types/components/SelectBox/SelectBox.types.d.ts +23 -14
- package/dist/types/components/Skeleton/Skeleton.d.ts +2 -0
- package/dist/types/components/Skeleton/Skeleton.test.d.ts +1 -0
- package/dist/types/components/Skeleton/Skeleton.types.d.ts +38 -0
- package/dist/types/components/Skeleton/index.d.ts +2 -0
- package/dist/types/components/StatusPill/StatusPill.d.ts +2 -0
- package/dist/types/components/StatusPill/StatusPill.test.d.ts +1 -0
- package/dist/types/components/StatusPill/StatusPill.types.d.ts +29 -0
- package/dist/types/components/StatusPill/index.d.ts +2 -0
- package/dist/types/components/StickyActionBar/StickyActionBar.d.ts +2 -0
- package/dist/types/components/StickyActionBar/StickyActionBar.test.d.ts +1 -0
- package/dist/types/components/StickyActionBar/StickyActionBar.types.d.ts +30 -0
- package/dist/types/components/StickyActionBar/index.d.ts +2 -0
- package/dist/types/components/TextContent/TextContent.d.ts +2 -2
- package/dist/types/components/TextContent/TextContent.types.d.ts +47 -7
- package/dist/types/components/Textarea/Textarea.types.d.ts +37 -3
- package/dist/types/components/Toast/Toast.d.ts +1 -1
- package/dist/types/components/Toast/Toast.types.d.ts +117 -43
- package/dist/types/components/Toast/ToastProvider.d.ts +3 -6
- package/dist/types/index.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,28 +1,67 @@
|
|
|
1
|
-
import type { HTMLAttributes, JSX, JSXElementConstructor } from 'react';
|
|
1
|
+
import type { HTMLAttributes, JSX, JSXElementConstructor, ReactNode } from 'react';
|
|
2
|
+
export type BodyTextSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type BodyTextWeight = 'light' | 'normal' | 'medium' | 'semibold' | 'bold';
|
|
4
|
+
export type BodyTextAlign = 'left' | 'center' | 'right' | 'justify';
|
|
2
5
|
export interface BodyTextProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
6
|
+
children?: ReactNode;
|
|
3
7
|
/**
|
|
4
|
-
*
|
|
8
|
+
* Font size variant (`xs`, `sm`, `md`, `lg`, `xl`).
|
|
9
|
+
*/
|
|
10
|
+
size?: BodyTextSize;
|
|
11
|
+
/**
|
|
12
|
+
* Font weight variant (`light`, `normal`, `medium`, `semibold`, `bold`).
|
|
13
|
+
*/
|
|
14
|
+
weight?: BodyTextWeight;
|
|
15
|
+
/**
|
|
16
|
+
* Shortcut prop adding `text-sm` class (retained for backward compatibility).
|
|
5
17
|
*/
|
|
6
18
|
small?: boolean;
|
|
7
19
|
/**
|
|
8
|
-
*
|
|
20
|
+
* Shortcut prop adding `font-semibold` class (retained for backward compatibility).
|
|
9
21
|
*/
|
|
10
22
|
strong?: boolean;
|
|
11
23
|
/**
|
|
12
|
-
*
|
|
24
|
+
* Muted secondary text color.
|
|
13
25
|
*/
|
|
14
26
|
muted?: boolean;
|
|
15
27
|
/**
|
|
16
|
-
*
|
|
28
|
+
* Error red text color.
|
|
17
29
|
*/
|
|
18
30
|
error?: boolean;
|
|
19
31
|
/**
|
|
20
|
-
*
|
|
32
|
+
* Success green text color.
|
|
33
|
+
*/
|
|
34
|
+
success?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Warning amber text color.
|
|
37
|
+
*/
|
|
38
|
+
warning?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Info blue text color.
|
|
41
|
+
*/
|
|
42
|
+
info?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Renders `inline-flex items-center gap-2`.
|
|
21
45
|
*/
|
|
22
46
|
inline?: boolean;
|
|
23
47
|
/**
|
|
24
|
-
*
|
|
48
|
+
* Inverted text color for dark backgrounds.
|
|
25
49
|
*/
|
|
26
|
-
as?: keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
|
|
27
50
|
invert?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Text alignment (`left`, `center`, `right`, `justify`).
|
|
53
|
+
*/
|
|
54
|
+
align?: BodyTextAlign;
|
|
55
|
+
/**
|
|
56
|
+
* Truncate single line with ellipsis.
|
|
57
|
+
*/
|
|
58
|
+
truncate?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Multi-line line clamp count (`1`, `2`, `3`, `4`).
|
|
61
|
+
*/
|
|
62
|
+
clamp?: 1 | 2 | 3 | 4;
|
|
63
|
+
/**
|
|
64
|
+
* JSX element to render in place of `p` (e.g. `div`, `span`, `article`).
|
|
65
|
+
*/
|
|
66
|
+
as?: keyof JSX.IntrinsicElements | JSXElementConstructor<any>;
|
|
28
67
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
1
|
+
import type { BreadcrumbProps } from './Breadcrumb.types';
|
|
2
|
+
export declare const Breadcrumb: import("react").ForwardRefExoticComponent<BreadcrumbProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type BreadcrumbItem = {
|
|
3
3
|
/**
|
|
4
|
-
* Unique key for each
|
|
4
|
+
* Unique key for each breadcrumb item
|
|
5
5
|
*/
|
|
6
6
|
key: string;
|
|
7
7
|
/**
|
|
@@ -9,21 +9,54 @@ export type BreadcrumbItem = {
|
|
|
9
9
|
*/
|
|
10
10
|
text: string;
|
|
11
11
|
/**
|
|
12
|
-
* Href
|
|
12
|
+
* Href link for navigation
|
|
13
13
|
*/
|
|
14
14
|
to?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional icon displayed before the text label
|
|
17
|
+
*/
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Additional custom class for the item element
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
15
23
|
};
|
|
16
|
-
export interface BreadcrumbProps {
|
|
24
|
+
export interface BreadcrumbProps extends HTMLAttributes<HTMLElement> {
|
|
17
25
|
/**
|
|
18
26
|
* List of breadcrumb items
|
|
19
27
|
*/
|
|
20
28
|
items: BreadcrumbItem[];
|
|
21
29
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
30
|
+
* Custom render method for breadcrumb items.
|
|
31
|
+
* If omitted, defaults to standard <a href={item.to}>{item.text}</a>
|
|
32
|
+
*/
|
|
33
|
+
render?: (item: BreadcrumbItem) => ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* Separator icon or variant ('slash' | 'chevron' | 'dot' | ReactNode). Default is 'slash'
|
|
36
|
+
*/
|
|
37
|
+
separator?: 'slash' | 'chevron' | 'dot' | ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Size variant ('sm' | 'md' | 'lg'). Default is 'md'
|
|
40
|
+
*/
|
|
41
|
+
size?: 'sm' | 'md' | 'lg';
|
|
42
|
+
/**
|
|
43
|
+
* Maximum number of items to display before collapsing middle items into a '...' dropdown menu
|
|
44
|
+
*/
|
|
45
|
+
maxItems?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Additional container class name
|
|
48
|
+
*/
|
|
49
|
+
className?: string;
|
|
50
|
+
/**
|
|
51
|
+
* Custom class name applied to non-active ancestor links
|
|
52
|
+
*/
|
|
53
|
+
itemClass?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Custom class name applied to the active current page item
|
|
56
|
+
*/
|
|
57
|
+
activeItemClass?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Custom class name applied to separator elements
|
|
27
60
|
*/
|
|
28
|
-
|
|
61
|
+
separatorClass?: string;
|
|
29
62
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { JSX, ElementType, ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { JSX, ElementType, ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import type { PolymorphicRef } from '../common-type';
|
|
3
3
|
/**
|
|
4
4
|
* Theme variants applied to the Button component.
|
|
@@ -7,7 +7,7 @@ import type { PolymorphicRef } from '../common-type';
|
|
|
7
7
|
*
|
|
8
8
|
* @default "primary"
|
|
9
9
|
*/
|
|
10
|
-
export type ButtonTheme = 'primary' | 'secondary' | 'danger';
|
|
10
|
+
export type ButtonTheme = 'primary' | 'secondary' | 'danger' | 'success' | 'warning';
|
|
11
11
|
/**
|
|
12
12
|
* Visual variant of the button.
|
|
13
13
|
*
|
|
@@ -36,89 +36,66 @@ export type ThemedButtonClass = {
|
|
|
36
36
|
[key in ButtonVariant]: string;
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
|
-
/**
|
|
40
|
-
* Utility: Builds a polymorphic prop type.
|
|
41
|
-
*
|
|
42
|
-
* This allows the component to accept **any HTML element** or **any custom React component**
|
|
43
|
-
* via the `as` prop while automatically inheriting the correct props.
|
|
44
|
-
*
|
|
45
|
-
* Example:
|
|
46
|
-
* ```tsx
|
|
47
|
-
* <Button as="a" href="/home" />
|
|
48
|
-
* <Button as={MyLink} to="/home" customProp />
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
39
|
export type PolymorphicButtonProps<C extends ElementType, Props = {}> = Props & {
|
|
52
40
|
/**
|
|
53
41
|
* The element or component to render.
|
|
54
|
-
*
|
|
55
|
-
* Supports:
|
|
56
|
-
* - HTML elements (e.g., `"button"`, `"a"`, `"div"`)
|
|
57
|
-
* - React components (e.g., `Link`, `NextLink`, `MyCustomButton`)
|
|
58
|
-
*
|
|
59
42
|
* @default "button"
|
|
60
43
|
*/
|
|
61
44
|
as?: C;
|
|
62
45
|
} & Omit<ComponentPropsWithoutRef<C>, keyof Props | 'as' | 'type' | 'disabled'>;
|
|
63
46
|
/**
|
|
64
47
|
* Core props shared by all Button variants.
|
|
65
|
-
*
|
|
66
|
-
* These do **not** include any HTML attributes — those come from the polymorphic type.
|
|
67
48
|
*/
|
|
68
49
|
export interface ButtonBaseProps {
|
|
69
50
|
/**
|
|
70
51
|
* Controls button theme (color palette).
|
|
71
|
-
*
|
|
72
52
|
* @default "primary"
|
|
73
53
|
*/
|
|
74
54
|
theme?: ButtonTheme;
|
|
75
55
|
/**
|
|
76
56
|
* Controls the visual styling of the button.
|
|
77
|
-
*
|
|
78
57
|
* @default "default"
|
|
79
58
|
*/
|
|
80
59
|
variant?: ButtonVariant;
|
|
81
60
|
/**
|
|
82
61
|
* Controls padding, font size, spacing.
|
|
83
|
-
*
|
|
84
62
|
* @default "md"
|
|
85
63
|
*/
|
|
86
64
|
size?: ButtonSize;
|
|
65
|
+
/**
|
|
66
|
+
* Icon displayed on the left side of button text.
|
|
67
|
+
*/
|
|
68
|
+
leftIcon?: ReactNode;
|
|
69
|
+
/**
|
|
70
|
+
* Icon displayed on the right side of button text.
|
|
71
|
+
*/
|
|
72
|
+
rightIcon?: ReactNode;
|
|
73
|
+
/**
|
|
74
|
+
* Stretches button to share 100% of container width.
|
|
75
|
+
* @default false
|
|
76
|
+
*/
|
|
77
|
+
fullWidth?: boolean;
|
|
87
78
|
/**
|
|
88
79
|
* If true, shows a Loader inside the button.
|
|
89
|
-
*
|
|
90
|
-
* While loading:
|
|
91
|
-
* - children are replaced
|
|
92
|
-
* - button typically becomes disabled
|
|
93
80
|
*/
|
|
94
81
|
loading?: boolean;
|
|
95
82
|
/**
|
|
96
83
|
* Optional text to display next to the loader.
|
|
97
|
-
*
|
|
98
|
-
* Only shown when `loading=true`.
|
|
99
|
-
*
|
|
100
84
|
* @default ""
|
|
101
85
|
*/
|
|
102
86
|
loadingText?: string;
|
|
103
87
|
/**
|
|
104
88
|
* Applies 50% border radius, producing a pill-shaped button.
|
|
105
|
-
*
|
|
106
89
|
* @default false
|
|
107
90
|
*/
|
|
108
91
|
rounded?: boolean;
|
|
109
92
|
/**
|
|
110
93
|
* Indicates that the button only contains an icon.
|
|
111
|
-
*
|
|
112
|
-
* Adjusts padding to match icon-only UX.
|
|
113
|
-
*
|
|
114
94
|
* @default false
|
|
115
95
|
*/
|
|
116
96
|
iconOnly?: boolean;
|
|
117
97
|
/**
|
|
118
98
|
* Prevents outline styles on keyboard focus.
|
|
119
|
-
*
|
|
120
|
-
* Useful for icon buttons or custom focus handling.
|
|
121
|
-
*
|
|
122
99
|
* @default false
|
|
123
100
|
*/
|
|
124
101
|
noOutlineOnFocus?: boolean;
|
|
@@ -127,37 +104,14 @@ export interface ButtonBaseProps {
|
|
|
127
104
|
*/
|
|
128
105
|
className?: string;
|
|
129
106
|
/**
|
|
130
|
-
* The HTML button type.
|
|
131
|
-
* Only valid when rendering as <button>.
|
|
107
|
+
* The HTML button type. Only valid when rendering as <button>.
|
|
132
108
|
*/
|
|
133
109
|
type?: 'button' | 'submit' | 'reset';
|
|
134
110
|
/**
|
|
135
|
-
* Standard disabled attribute.
|
|
136
|
-
* Only applies when as="button".
|
|
111
|
+
* Standard disabled attribute. Only applies when as="button".
|
|
137
112
|
*/
|
|
138
113
|
disabled?: boolean;
|
|
139
114
|
}
|
|
140
|
-
/**
|
|
141
|
-
* Complete Button props,
|
|
142
|
-
* supporting **polymorphic rendering** via the `as` prop.
|
|
143
|
-
*
|
|
144
|
-
* Examples:
|
|
145
|
-
*
|
|
146
|
-
* Render as a native button:
|
|
147
|
-
* ```tsx
|
|
148
|
-
* <Button type="submit">Save</Button>
|
|
149
|
-
* ```
|
|
150
|
-
*
|
|
151
|
-
* Render as a link:
|
|
152
|
-
* ```tsx
|
|
153
|
-
* <Button as="a" href="/pricing" target="_blank">Learn More</Button>
|
|
154
|
-
* ```
|
|
155
|
-
*
|
|
156
|
-
* Render as a custom component:
|
|
157
|
-
* ```tsx
|
|
158
|
-
* <Button as={MyCustomComponent} customProp="123">Custom</Button>
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
115
|
export type ButtonProps<C extends ElementType = 'button'> = PolymorphicButtonProps<C, ButtonBaseProps>;
|
|
162
116
|
export interface ButtonComponent {
|
|
163
117
|
<C extends ElementType = 'button'>(props: ButtonProps<C> & {
|
|
@@ -44,6 +44,22 @@ export interface ButtonGroupProps {
|
|
|
44
44
|
* @default "md"
|
|
45
45
|
*/
|
|
46
46
|
size?: ButtonSize;
|
|
47
|
+
/**
|
|
48
|
+
* Currently selected value (or array of values for multi-select) in toggle mode.
|
|
49
|
+
* Compares against each child's `value`, `id`, or button label.
|
|
50
|
+
*/
|
|
51
|
+
value?: string | number | (string | number)[];
|
|
52
|
+
/**
|
|
53
|
+
* Callback fired when a button in toggle selection mode is clicked.
|
|
54
|
+
* Receives the selected button value.
|
|
55
|
+
*/
|
|
56
|
+
onChange?: (value: any) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Disables all child buttons in the group.
|
|
59
|
+
*
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
disabled?: boolean;
|
|
47
63
|
/**
|
|
48
64
|
* Rounds the group's outer corners into a full pill shape instead of the
|
|
49
65
|
* size-matched corner radius.
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
import type { CardComponent } from './Card.types';
|
|
1
|
+
import type { CardComponent, CardContentProps, CardDescriptionProps, CardFooterProps, CardHeaderProps, CardMediaProps, CardTitleProps } from './Card.types';
|
|
2
2
|
export declare const Card: CardComponent;
|
|
3
|
+
export declare const CardHeader: ({ className, bordered, children, ...props }: CardHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const CardTitle: ({ className, as: Component, children, ...props }: CardTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const CardDescription: ({ className, children, ...props }: CardDescriptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const CardContent: ({ className, children, ...props }: CardContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const CardFooter: ({ className, bordered, children, ...props }: CardFooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const CardMedia: ({ className, aspectRatio, alt, ...props }: CardMediaProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ElementType, JSX } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType, HTMLAttributes, ImgHTMLAttributes, JSX, FC } from 'react';
|
|
2
2
|
import { PolymorphicRef } from '../common-type';
|
|
3
|
+
export type CardVariant = 'outlined' | 'elevated' | 'filled' | 'ghost';
|
|
4
|
+
export type CardRadius = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
3
5
|
export type CardBaseProps = {
|
|
4
6
|
/**
|
|
5
|
-
*
|
|
7
|
+
* Surface visual variant ('outlined' | 'elevated' | 'filled' | 'ghost')
|
|
8
|
+
* @default 'outlined'
|
|
9
|
+
*/
|
|
10
|
+
variant?: CardVariant;
|
|
11
|
+
/**
|
|
12
|
+
* Border radius variant ('none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl')
|
|
13
|
+
* @default 'xl'
|
|
14
|
+
*/
|
|
15
|
+
radius?: CardRadius;
|
|
16
|
+
/**
|
|
17
|
+
* Make card hoverable (adds subtle background transitions)
|
|
6
18
|
* @default false
|
|
7
19
|
*/
|
|
8
20
|
hoverable?: boolean;
|
|
9
21
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @default
|
|
22
|
+
* Make card clickable (adds hover elevation lift & pointer cursor)
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
clickable?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Highlights card with a primary brand ring & border
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
selected?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Adds border around the card. Default is true (when variant='outlined')
|
|
12
33
|
*/
|
|
13
34
|
bordered?: boolean;
|
|
14
35
|
/**
|
|
@@ -22,55 +43,40 @@ export type CardBaseProps = {
|
|
|
22
43
|
*/
|
|
23
44
|
zeroPadding?: boolean;
|
|
24
45
|
};
|
|
25
|
-
/**
|
|
26
|
-
* Utility: Builds a polymorphic prop type.
|
|
27
|
-
*
|
|
28
|
-
* This allows the component to accept **any HTML element** or **any custom React component**
|
|
29
|
-
* via the `as` prop while automatically inheriting the correct props.
|
|
30
|
-
*
|
|
31
|
-
* Example:
|
|
32
|
-
* ```tsx
|
|
33
|
-
* <Card as="a" href="/home" />
|
|
34
|
-
* <Card as={MyLink} to="/home" customProp />
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
46
|
export type PolymorphicCardProps<C extends ElementType, Props = {}> = Props & {
|
|
38
47
|
/**
|
|
39
48
|
* The element or component to render.
|
|
40
|
-
*
|
|
41
|
-
* Supports:
|
|
42
|
-
* - HTML elements (e.g., `"a"`, `"div"`)
|
|
43
|
-
* - React components (e.g., `Link`, `NextLink`, `MyCustomCard`)
|
|
44
|
-
*
|
|
45
49
|
* @default "div"
|
|
46
50
|
*/
|
|
47
51
|
as?: C;
|
|
48
52
|
} & Omit<ComponentPropsWithoutRef<C>, keyof Props | 'as'>;
|
|
49
|
-
/**
|
|
50
|
-
* Complete Card props,
|
|
51
|
-
* supporting **polymorphic rendering** via the `as` prop.
|
|
52
|
-
*
|
|
53
|
-
* Examples:
|
|
54
|
-
*
|
|
55
|
-
* Render as a native card:
|
|
56
|
-
* ```tsx
|
|
57
|
-
* <Card>Card content</Card>
|
|
58
|
-
* ```
|
|
59
|
-
*
|
|
60
|
-
* Render as a link:
|
|
61
|
-
* ```tsx
|
|
62
|
-
* <Card as="a" href="/pricing" target="_blank">Learn More</Card>
|
|
63
|
-
* ```
|
|
64
|
-
*
|
|
65
|
-
* Render as a custom component:
|
|
66
|
-
* ```tsx
|
|
67
|
-
* <Card as={MyCustomComponent} customProp="123">Custom card content</Card>
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
53
|
export type CardProps<C extends ElementType = 'div'> = PolymorphicCardProps<C, CardBaseProps>;
|
|
54
|
+
export interface CardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
55
|
+
bordered?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface CardTitleProps extends HTMLAttributes<HTMLHeadingElement> {
|
|
58
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span';
|
|
59
|
+
}
|
|
60
|
+
export interface CardDescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
61
|
+
}
|
|
62
|
+
export interface CardContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
63
|
+
}
|
|
64
|
+
export interface CardFooterProps extends HTMLAttributes<HTMLDivElement> {
|
|
65
|
+
bordered?: boolean;
|
|
66
|
+
}
|
|
67
|
+
export interface CardMediaProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
68
|
+
aspectRatio?: 'auto' | 'square' | 'video' | 'wide';
|
|
69
|
+
}
|
|
71
70
|
export interface CardComponent {
|
|
72
71
|
<C extends ElementType = 'div'>(props: CardProps<C> & {
|
|
73
72
|
ref?: PolymorphicRef<C>;
|
|
74
73
|
}): JSX.Element;
|
|
74
|
+
Header: FC<CardHeaderProps>;
|
|
75
|
+
Title: FC<CardTitleProps>;
|
|
76
|
+
Description: FC<CardDescriptionProps>;
|
|
77
|
+
Content: FC<CardContentProps>;
|
|
78
|
+
Body: FC<CardContentProps>;
|
|
79
|
+
Footer: FC<CardFooterProps>;
|
|
80
|
+
Media: FC<CardMediaProps>;
|
|
75
81
|
displayName?: string;
|
|
76
82
|
}
|
|
@@ -1,8 +1,35 @@
|
|
|
1
1
|
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { InputCustomProps } from '../common-type';
|
|
3
|
-
export
|
|
3
|
+
export type CheckboxSize = 'sm' | 'md' | 'lg';
|
|
4
|
+
export type CheckboxVariant = 'default' | 'card';
|
|
5
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'>, Omit<InputCustomProps, 'labelHint'> {
|
|
4
6
|
/** Force type to checkbox only */
|
|
5
7
|
type?: 'checkbox';
|
|
8
|
+
/**
|
|
9
|
+
* Indeterminate (partially checked) state.
|
|
10
|
+
* Useful for "Select All" parent checkboxes.
|
|
11
|
+
*/
|
|
12
|
+
indeterminate?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Size scale of the checkbox.
|
|
15
|
+
* Defaults to `"md"`.
|
|
16
|
+
*/
|
|
17
|
+
size?: CheckboxSize;
|
|
18
|
+
/**
|
|
19
|
+
* Container style variant.
|
|
20
|
+
* - `default` — standard inline checkbox
|
|
21
|
+
* - `card` — enclosed interactive card container
|
|
22
|
+
* Defaults to `"default"`.
|
|
23
|
+
*/
|
|
24
|
+
variant?: CheckboxVariant;
|
|
25
|
+
/**
|
|
26
|
+
* Optional subtext description displayed beneath label.
|
|
27
|
+
*/
|
|
28
|
+
description?: ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* Optional helper message displayed below checkbox.
|
|
31
|
+
*/
|
|
32
|
+
helperText?: ReactNode;
|
|
6
33
|
/** Extra class for outer wrapper */
|
|
7
34
|
wrapperClass?: string;
|
|
8
35
|
/** Input container class */
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChangeEvent, ReactNode } from 'react';
|
|
2
|
+
import type { CheckboxSize, CheckboxVariant } from '../Checkbox/Checkbox.types';
|
|
2
3
|
export type CheckboxGroupItem<T = any> = {
|
|
3
4
|
/**
|
|
4
5
|
* Checkbox item label
|
|
@@ -8,6 +9,14 @@ export type CheckboxGroupItem<T = any> = {
|
|
|
8
9
|
* Checkbox item value
|
|
9
10
|
*/
|
|
10
11
|
value: T;
|
|
12
|
+
/**
|
|
13
|
+
* Optional subtext description beneath label
|
|
14
|
+
*/
|
|
15
|
+
description?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Whether this individual option is disabled
|
|
18
|
+
*/
|
|
19
|
+
disabled?: boolean;
|
|
11
20
|
};
|
|
12
21
|
export interface CheckboxGroupProps<T = any> {
|
|
13
22
|
/**
|
|
@@ -15,9 +24,13 @@ export interface CheckboxGroupProps<T = any> {
|
|
|
15
24
|
*/
|
|
16
25
|
name?: string;
|
|
17
26
|
/**
|
|
18
|
-
* Currently selected values
|
|
27
|
+
* Currently selected values (Controlled Mode).
|
|
19
28
|
*/
|
|
20
29
|
value?: T[];
|
|
30
|
+
/**
|
|
31
|
+
* Default selected values (Uncontrolled Mode).
|
|
32
|
+
*/
|
|
33
|
+
defaultValue?: T[];
|
|
21
34
|
/**
|
|
22
35
|
* Label displayed above the group
|
|
23
36
|
*/
|
|
@@ -52,4 +65,43 @@ export interface CheckboxGroupProps<T = any> {
|
|
|
52
65
|
* Whether to arrange checkboxes inline
|
|
53
66
|
*/
|
|
54
67
|
inline?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Multi-column grid layout (1, 2, 3, or 4 columns).
|
|
70
|
+
* Takes precedence over `inline`.
|
|
71
|
+
*/
|
|
72
|
+
columns?: 1 | 2 | 3 | 4;
|
|
73
|
+
/**
|
|
74
|
+
* Size scale passed to all checkboxes in the group.
|
|
75
|
+
* Defaults to `"md"`.
|
|
76
|
+
*/
|
|
77
|
+
size?: CheckboxSize;
|
|
78
|
+
/**
|
|
79
|
+
* Visual variant passed to all checkboxes in the group.
|
|
80
|
+
* - `default` — standard inline checkboxes
|
|
81
|
+
* - `card` — enclosed interactive card containers
|
|
82
|
+
* Defaults to `"default"`.
|
|
83
|
+
*/
|
|
84
|
+
variant?: CheckboxVariant;
|
|
85
|
+
/**
|
|
86
|
+
* Automatically renders a "Select All" parent checkbox header with indeterminate state!
|
|
87
|
+
* Defaults to `false`.
|
|
88
|
+
*/
|
|
89
|
+
showSelectAll?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* Label for the "Select All" checkbox.
|
|
92
|
+
* Defaults to `"Select All"`.
|
|
93
|
+
*/
|
|
94
|
+
selectAllLabel?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Group-level error message.
|
|
97
|
+
*/
|
|
98
|
+
error?: string | ReactNode;
|
|
99
|
+
/**
|
|
100
|
+
* Group-level helper text.
|
|
101
|
+
*/
|
|
102
|
+
helperText?: ReactNode;
|
|
103
|
+
/**
|
|
104
|
+
* Disable all checkboxes in the group.
|
|
105
|
+
*/
|
|
106
|
+
disabled?: boolean;
|
|
55
107
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { DetailedInformationProps } from './DetailedInformation.types';
|
|
1
|
+
import type { DetailedInformationProps } from './DetailedInformation.types';
|
|
2
2
|
export declare const DetailedInformation: import("react").ForwardRefExoticComponent<DetailedInformationProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
export type Detail = {
|
|
3
3
|
/**
|
|
4
4
|
* Label of the information to be displayed
|
|
@@ -8,16 +8,36 @@ export type Detail = {
|
|
|
8
8
|
* Information to be displayed
|
|
9
9
|
*/
|
|
10
10
|
value?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Optional icon displayed next to the label
|
|
13
|
+
*/
|
|
14
|
+
icon?: ReactNode;
|
|
11
15
|
/**
|
|
12
16
|
* Classname of the value content sections
|
|
13
17
|
*/
|
|
14
18
|
contentClass?: string;
|
|
15
19
|
/**
|
|
16
|
-
*
|
|
20
|
+
* Classname of the label section
|
|
21
|
+
*/
|
|
22
|
+
labelClass?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Enables hover-to-copy button next to the value
|
|
25
|
+
*/
|
|
26
|
+
copyable?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Custom tooltip / help text to display next to the label
|
|
29
|
+
*/
|
|
30
|
+
helpText?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Custom fallback value when value is empty or undefined
|
|
33
|
+
*/
|
|
34
|
+
emptyValue?: ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Defines if the item should be hidden.
|
|
17
37
|
*/
|
|
18
38
|
hidden?: boolean;
|
|
19
39
|
};
|
|
20
|
-
export interface DetailedInformationProps {
|
|
40
|
+
export interface DetailedInformationProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
|
|
21
41
|
className?: string;
|
|
22
42
|
/**
|
|
23
43
|
* Title for the information section
|
|
@@ -27,10 +47,26 @@ export interface DetailedInformationProps {
|
|
|
27
47
|
* Subtitle for the information section
|
|
28
48
|
*/
|
|
29
49
|
subTitle?: ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Action element rendered at the top-right of the header area
|
|
52
|
+
*/
|
|
53
|
+
action?: ReactNode;
|
|
30
54
|
/**
|
|
31
55
|
* List of details / information to be displayed
|
|
32
56
|
*/
|
|
33
57
|
details: Detail[];
|
|
58
|
+
/**
|
|
59
|
+
* Number of grid columns for details layout (1, 2, 3, or 4). Default is 1
|
|
60
|
+
*/
|
|
61
|
+
columns?: 1 | 2 | 3 | 4;
|
|
62
|
+
/**
|
|
63
|
+
* Direction of label vs value. 'horizontal' (side-by-side) or 'vertical' (stacked). Default is 'horizontal'
|
|
64
|
+
*/
|
|
65
|
+
layout?: 'horizontal' | 'vertical';
|
|
66
|
+
/**
|
|
67
|
+
* Visual presentation variant. Default is 'flat'
|
|
68
|
+
*/
|
|
69
|
+
variant?: 'flat' | 'bordered' | 'card';
|
|
34
70
|
/**
|
|
35
71
|
* Defines if the layout should be compact
|
|
36
72
|
*/
|
|
@@ -43,6 +79,10 @@ export interface DetailedInformationProps {
|
|
|
43
79
|
* Defines if each item in section should have divider
|
|
44
80
|
*/
|
|
45
81
|
divider?: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Default fallback when value is missing or empty. Default is '- -'
|
|
84
|
+
*/
|
|
85
|
+
emptyValue?: ReactNode;
|
|
46
86
|
/**
|
|
47
87
|
* Classname for title element
|
|
48
88
|
*/
|
|
@@ -51,4 +91,8 @@ export interface DetailedInformationProps {
|
|
|
51
91
|
* Classname for details section
|
|
52
92
|
*/
|
|
53
93
|
detailsClass?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Classname for label elements
|
|
96
|
+
*/
|
|
97
|
+
labelClass?: string;
|
|
54
98
|
}
|