@pk-design/react-tailwind 1.4.4 → 1.5.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 +232 -99
- package/dist/react-tailwind.cjs.js.map +1 -1
- package/dist/react-tailwind.css +1 -1
- package/dist/react-tailwind.css.map +1 -1
- package/dist/react-tailwind.es.js +232 -101
- package/dist/react-tailwind.es.js.map +1 -1
- package/dist/types/components/Accordion/Accordion.d.ts +3 -0
- package/dist/types/components/Accordion/Accordion.test.d.ts +1 -0
- package/dist/types/components/Accordion/Accordion.types.d.ts +85 -0
- package/dist/types/components/Accordion/index.d.ts +2 -0
- package/dist/types/components/BodyText/BodyText.types.d.ts +1 -0
- package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +3 -0
- package/dist/types/components/ButtonGroup/ButtonGroup.test.d.ts +1 -0
- package/dist/types/components/ButtonGroup/ButtonGroup.types.d.ts +70 -0
- package/dist/types/components/ButtonGroup/index.d.ts +2 -0
- package/dist/types/components/DataTable/DataTable.icons.d.ts +1 -1
- package/dist/types/components/SelectBox/SelectBox.d.ts +1 -1
- package/dist/types/components/SelectBox/SelectBox.types.d.ts +7 -0
- package/dist/types/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Single accordion item.
|
|
4
|
+
*/
|
|
5
|
+
export type AccordionItem = {
|
|
6
|
+
/** Header content for this item */
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
/** Content rendered in the collapsible panel when this item is open */
|
|
9
|
+
content: ReactNode;
|
|
10
|
+
/** Optional icon rendered before the title */
|
|
11
|
+
icon?: ReactNode;
|
|
12
|
+
/** Unique key for this item; falls back to index when omitted */
|
|
13
|
+
id?: string | number;
|
|
14
|
+
/** Prevents this item from being opened/closed */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** Extra classes applied to this specific item's header button */
|
|
17
|
+
titleClass?: string;
|
|
18
|
+
/** Extra classes applied to this specific item's panel content */
|
|
19
|
+
panelClass?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Whether one or multiple items can be open at the same time.
|
|
23
|
+
*
|
|
24
|
+
* @default "single"
|
|
25
|
+
*/
|
|
26
|
+
export type AccordionType = 'single' | 'multiple';
|
|
27
|
+
/**
|
|
28
|
+
* Visual style of the accordion.
|
|
29
|
+
*
|
|
30
|
+
* - **bordered** (default): items share a single bordered container, divided by hairlines
|
|
31
|
+
* - **separated**: each item renders as its own bordered card with spacing between items
|
|
32
|
+
* - **plain**: no borders, just a divided list
|
|
33
|
+
*
|
|
34
|
+
* @default "bordered"
|
|
35
|
+
*/
|
|
36
|
+
export type AccordionVariant = 'bordered' | 'separated' | 'plain';
|
|
37
|
+
/**
|
|
38
|
+
* Accordion component props.
|
|
39
|
+
*/
|
|
40
|
+
export interface AccordionProps {
|
|
41
|
+
/** Item data array. Order defines visual order. */
|
|
42
|
+
items: AccordionItem[];
|
|
43
|
+
/**
|
|
44
|
+
* Whether one or multiple items can be open at the same time.
|
|
45
|
+
*
|
|
46
|
+
* @default "single"
|
|
47
|
+
*/
|
|
48
|
+
type?: AccordionType;
|
|
49
|
+
/**
|
|
50
|
+
* Visual style of the accordion.
|
|
51
|
+
*
|
|
52
|
+
* @default "bordered"
|
|
53
|
+
*/
|
|
54
|
+
variant?: AccordionVariant;
|
|
55
|
+
/**
|
|
56
|
+
* When `type="single"`, whether clicking the currently open item's header
|
|
57
|
+
* closes it. Has no effect when `type="multiple"`.
|
|
58
|
+
*
|
|
59
|
+
* @default true
|
|
60
|
+
*/
|
|
61
|
+
collapsible?: boolean;
|
|
62
|
+
/** Initially open item id(s) (uncontrolled) */
|
|
63
|
+
defaultOpenIds?: Array<string | number>;
|
|
64
|
+
/** Controlled open item id(s) — pair with onChange */
|
|
65
|
+
openIds?: Array<string | number>;
|
|
66
|
+
/** Called with the new open id(s) whenever an item is toggled */
|
|
67
|
+
onChange?: (openIds: Array<string | number>) => void;
|
|
68
|
+
/**
|
|
69
|
+
* Custom trailing indicator icon rendered in place of the default chevron.
|
|
70
|
+
*
|
|
71
|
+
* - Pass a `ReactNode` to swap the icon while keeping the default
|
|
72
|
+
* rotate-180°-on-open behavior.
|
|
73
|
+
* - Pass a function of the item's open state for full control (e.g.
|
|
74
|
+
* swapping between plus/minus icons instead of rotating).
|
|
75
|
+
*
|
|
76
|
+
* @default undefined (renders the built-in chevron)
|
|
77
|
+
*/
|
|
78
|
+
expandIcon?: ReactNode | ((isOpen: boolean) => ReactNode);
|
|
79
|
+
/** Extra classes for the outer container */
|
|
80
|
+
className?: string;
|
|
81
|
+
/** Extra classes applied to every item's header button */
|
|
82
|
+
titleClass?: string;
|
|
83
|
+
/** Extra classes applied to every item's panel content */
|
|
84
|
+
panelClass?: string;
|
|
85
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ButtonSize, ButtonTheme, ButtonVariant } from '../Button/Button.types';
|
|
3
|
+
/**
|
|
4
|
+
* Layout direction of a ButtonGroup.
|
|
5
|
+
*
|
|
6
|
+
* @default "horizontal"
|
|
7
|
+
*/
|
|
8
|
+
export type ButtonGroupOrientation = 'horizontal' | 'vertical';
|
|
9
|
+
/**
|
|
10
|
+
* ButtonGroup component props.
|
|
11
|
+
*/
|
|
12
|
+
export interface ButtonGroupProps {
|
|
13
|
+
/**
|
|
14
|
+
* `Button` elements to render as a single joined control.
|
|
15
|
+
*
|
|
16
|
+
* Each child may still set its own `theme`/`variant`/`size`/`className`
|
|
17
|
+
* to override the group's fallback styling (e.g. a colored icon).
|
|
18
|
+
*/
|
|
19
|
+
children: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Layout direction of the group.
|
|
22
|
+
*
|
|
23
|
+
* - **horizontal** (default): buttons sit side by side, divided by a vertical hairline.
|
|
24
|
+
* - **vertical**: buttons stack top to bottom, divided by a horizontal hairline.
|
|
25
|
+
*
|
|
26
|
+
* @default "horizontal"
|
|
27
|
+
*/
|
|
28
|
+
orientation?: ButtonGroupOrientation;
|
|
29
|
+
/**
|
|
30
|
+
* Fallback theme applied to child buttons that don't set their own `theme`.
|
|
31
|
+
*
|
|
32
|
+
* @default "secondary"
|
|
33
|
+
*/
|
|
34
|
+
theme?: ButtonTheme;
|
|
35
|
+
/**
|
|
36
|
+
* Fallback variant applied to child buttons that don't set their own `variant`.
|
|
37
|
+
*
|
|
38
|
+
* @default "default"
|
|
39
|
+
*/
|
|
40
|
+
variant?: ButtonVariant;
|
|
41
|
+
/**
|
|
42
|
+
* Fallback size applied to child buttons that don't set their own `size`.
|
|
43
|
+
*
|
|
44
|
+
* @default "md"
|
|
45
|
+
*/
|
|
46
|
+
size?: ButtonSize;
|
|
47
|
+
/**
|
|
48
|
+
* Rounds the group's outer corners into a full pill shape instead of the
|
|
49
|
+
* size-matched corner radius.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
rounded?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Stretches child buttons to share the group's width (horizontal) or
|
|
56
|
+
* height (vertical) equally.
|
|
57
|
+
*
|
|
58
|
+
* @default false
|
|
59
|
+
*/
|
|
60
|
+
fullWidth?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Accessible label describing the purpose of the group.
|
|
63
|
+
* Rendered as `aria-label` on the `role="group"` container.
|
|
64
|
+
*/
|
|
65
|
+
label?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Additional classNames merged onto the outer container.
|
|
68
|
+
*/
|
|
69
|
+
className?: string;
|
|
70
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { SortIconKey, Sorting } from './DataTable.types';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
export declare const SortIconMap: Record<SortIconKey, ReactNode>;
|
|
4
|
-
export declare const getSortIcon: (sort?: Sorting) => string | number | bigint | boolean |
|
|
4
|
+
export declare const getSortIcon: (sort?: Sorting) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { BaseOption, SelectBoxProps } from './SelectBox.types';
|
|
2
|
-
export declare const SelectBox: import("react").ForwardRefExoticComponent<SelectBoxProps<string | BaseOption> & import("react").RefAttributes<
|
|
2
|
+
export declare const SelectBox: import("react").ForwardRefExoticComponent<SelectBoxProps<string | BaseOption> & import("react").RefAttributes<HTMLDivElement | HTMLInputElement>>;
|
|
@@ -91,6 +91,13 @@ export interface SelectBoxProps<T extends BaseOption | string = BaseOption> {
|
|
|
91
91
|
allowAdd?: boolean;
|
|
92
92
|
/** Label prefix for the “Add new” action (e.g., "Create") */
|
|
93
93
|
addNewText?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Message shown in the dropdown when `options` is empty and the user
|
|
96
|
+
* hasn't typed a search query yet.
|
|
97
|
+
*
|
|
98
|
+
* @default "No options available"
|
|
99
|
+
*/
|
|
100
|
+
noOptionsText?: string;
|
|
94
101
|
/**
|
|
95
102
|
* Callback when the user chooses the "create/add" option.
|
|
96
103
|
*
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import './styles/tokens.css';
|
|
2
|
+
export * from './components/Accordion';
|
|
2
3
|
export * from './components/Alert';
|
|
3
4
|
export * from './components/Badge';
|
|
4
5
|
export * from './components/Banner';
|
|
5
6
|
export * from './components/BodyText';
|
|
6
7
|
export * from './components/Breadcrumb';
|
|
7
8
|
export * from './components/Button';
|
|
9
|
+
export * from './components/ButtonGroup';
|
|
8
10
|
export * from './components/Card';
|
|
9
11
|
export * from './components/Checkbox';
|
|
10
12
|
export * from './components/CheckboxGroup';
|