@pk-design/react-tailwind 1.0.6 → 1.1.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.
Files changed (144) hide show
  1. package/dist/react-tailwind.cjs.js +1593 -362
  2. package/dist/react-tailwind.cjs.js.map +1 -1
  3. package/dist/react-tailwind.es.js +1579 -360
  4. package/dist/react-tailwind.es.js.map +1 -1
  5. package/dist/types/components/Alert/Alert.d.ts +3 -0
  6. package/dist/types/components/Alert/Alert.test.d.ts +1 -0
  7. package/dist/types/components/Alert/Alert.types.d.ts +34 -0
  8. package/dist/types/components/Alert/index.d.ts +2 -35
  9. package/dist/types/components/Badge/Badge.d.ts +3 -0
  10. package/dist/types/components/Badge/Badge.test.d.ts +1 -0
  11. package/dist/types/components/Badge/Badge.types.d.ts +22 -0
  12. package/dist/types/components/Badge/index.d.ts +2 -24
  13. package/dist/types/components/Banner/Banner.d.ts +3 -0
  14. package/dist/types/components/Banner/Banner.test.d.ts +1 -0
  15. package/dist/types/components/Banner/Banner.types.d.ts +14 -0
  16. package/dist/types/components/Banner/index.d.ts +2 -16
  17. package/dist/types/components/BodyText/BodyText.d.ts +3 -0
  18. package/dist/types/components/BodyText/BodyText.test.d.ts +1 -0
  19. package/dist/types/components/BodyText/BodyText.types.d.ts +27 -0
  20. package/dist/types/components/BodyText/index.d.ts +2 -28
  21. package/dist/types/components/Breadcrumb/Breadcrumb.d.ts +3 -0
  22. package/dist/types/components/Breadcrumb/Breadcrumb.test.d.ts +1 -0
  23. package/dist/types/components/Breadcrumb/Breadcrumb.types.d.ts +29 -0
  24. package/dist/types/components/Breadcrumb/index.d.ts +2 -30
  25. package/dist/types/components/Button/Button.d.ts +2 -3
  26. package/dist/types/components/Button/Button.test.d.ts +1 -0
  27. package/dist/types/components/Button/Button.types.d.ts +171 -0
  28. package/dist/types/components/Button/index.d.ts +1 -1
  29. package/dist/types/components/Card/Card.d.ts +3 -0
  30. package/dist/types/components/Card/Card.test.d.ts +1 -0
  31. package/dist/types/components/Card/Card.types.d.ts +23 -0
  32. package/dist/types/components/Card/index.d.ts +2 -9
  33. package/dist/types/components/Checkbox/Checkbox.d.ts +2 -0
  34. package/dist/types/components/Checkbox/Checkbox.test.d.ts +1 -0
  35. package/dist/types/components/Checkbox/Checkbox.types.d.ts +14 -0
  36. package/dist/types/components/Checkbox/index.d.ts +2 -13
  37. package/dist/types/components/CheckboxGroup/CheckboxGroup.d.ts +5 -0
  38. package/dist/types/components/CheckboxGroup/CheckboxGroup.test.d.ts +1 -0
  39. package/dist/types/components/CheckboxGroup/CheckboxGroup.types.d.ts +55 -0
  40. package/dist/types/components/CheckboxGroup/index.d.ts +2 -56
  41. package/dist/types/components/DataTable/DataTable.d.ts +2 -0
  42. package/dist/types/components/DataTable/DataTable.icons.d.ts +4 -0
  43. package/dist/types/components/DataTable/DataTable.test.d.ts +1 -0
  44. package/dist/types/components/DataTable/DataTable.types.d.ts +63 -0
  45. package/dist/types/components/DataTable/DataTable.utils.d.ts +12 -0
  46. package/dist/types/components/DataTable/DataTable.utils.test.d.ts +1 -0
  47. package/dist/types/components/DataTable/index.d.ts +4 -0
  48. package/dist/types/components/DetailedInformation/DetailedInformation.d.ts +2 -0
  49. package/dist/types/components/DetailedInformation/DetailedInformation.test.d.ts +1 -0
  50. package/dist/types/components/DetailedInformation/DetailedInformation.types.d.ts +54 -0
  51. package/dist/types/components/DetailedInformation/index.d.ts +2 -63
  52. package/dist/types/components/Drawer/Drawer.d.ts +1 -1
  53. package/dist/types/components/Drawer/Drawer.test.d.ts +1 -0
  54. package/dist/types/components/Drawer/{type.d.ts → Drawer.types.d.ts} +1 -1
  55. package/dist/types/components/Drawer/index.d.ts +1 -1
  56. package/dist/types/components/Dropdown/Dropdown.d.ts +3 -0
  57. package/dist/types/components/Dropdown/Dropdown.test.d.ts +1 -0
  58. package/dist/types/components/Dropdown/Dropdown.types.d.ts +107 -0
  59. package/dist/types/components/Dropdown/index.d.ts +2 -62
  60. package/dist/types/components/HeadingText/HeadingText.d.ts +9 -0
  61. package/dist/types/components/HeadingText/HeadingText.types.d.ts +5 -0
  62. package/dist/types/components/HeadingText/index.d.ts +2 -12
  63. package/dist/types/components/Input/Input.d.ts +6 -0
  64. package/dist/types/components/Input/Input.test.d.ts +1 -0
  65. package/dist/types/components/Input/Input.types.d.ts +12 -0
  66. package/dist/types/components/Input/index.d.ts +2 -13
  67. package/dist/types/components/Label/Label.d.ts +6 -0
  68. package/dist/types/components/Label/index.d.ts +1 -5
  69. package/dist/types/components/Pagination/Pagination.d.ts +1 -31
  70. package/dist/types/components/Pagination/Pagination.test.d.ts +1 -0
  71. package/dist/types/components/Pagination/Pagination.types.d.ts +36 -0
  72. package/dist/types/components/Pagination/index.d.ts +1 -0
  73. package/dist/types/components/Pagination/usePagination.d.ts +1 -5
  74. package/dist/types/components/PasswordInput/PasswordInput.d.ts +6 -0
  75. package/dist/types/components/PasswordInput/PasswordInput.test.d.ts +1 -0
  76. package/dist/types/components/PasswordInput/index.d.ts +1 -6
  77. package/dist/types/components/Radio/Radio.d.ts +2 -0
  78. package/dist/types/components/Radio/Radio.test.d.ts +1 -0
  79. package/dist/types/components/Radio/Radio.types.d.ts +14 -0
  80. package/dist/types/components/Radio/index.d.ts +2 -0
  81. package/dist/types/components/RadioGroup/RadioGroup.d.ts +3 -0
  82. package/dist/types/components/RadioGroup/RadioGroup.test.d.ts +1 -0
  83. package/dist/types/components/RadioGroup/RadioGroup.types.d.ts +65 -0
  84. package/dist/types/components/RadioGroup/index.d.ts +2 -0
  85. package/dist/types/components/RadioSwitch/RadioSwitch.d.ts +7 -0
  86. package/dist/types/components/RadioSwitch/RadioSwitch.test.d.ts +1 -0
  87. package/dist/types/components/RadioSwitch/RadioSwitch.types.d.ts +47 -0
  88. package/dist/types/components/RadioSwitch/index.d.ts +2 -0
  89. package/dist/types/components/RangeInput/-backup.d.ts +10 -0
  90. package/dist/types/components/RangeInput/RangeInput.d.ts +2 -0
  91. package/dist/types/components/RangeInput/RangeInput.test.d.ts +1 -0
  92. package/dist/types/components/RangeInput/RangeInput.types.d.ts +14 -0
  93. package/dist/types/components/RangeInput/index.d.ts +1 -10
  94. package/dist/types/components/RangeSlider/RangeSlider.d.ts +3 -0
  95. package/dist/types/components/RangeSlider/RangeSlider.test.d.ts +1 -0
  96. package/dist/types/components/RangeSlider/RangeSlider.types.d.ts +68 -0
  97. package/dist/types/components/RangeSlider/index.d.ts +2 -0
  98. package/dist/types/components/SelectBox/SelectBox.d.ts +2 -0
  99. package/dist/types/components/SelectBox/SelectBox.test.d.ts +1 -0
  100. package/dist/types/components/SelectBox/SelectBox.types.d.ts +94 -0
  101. package/dist/types/components/SelectBox/index.d.ts +2 -40
  102. package/dist/types/components/Table/Table.d.ts +10 -0
  103. package/dist/types/components/Table/Table.test.d.ts +1 -0
  104. package/dist/types/components/Table/Table.types.d.ts +91 -0
  105. package/dist/types/components/Table/index.d.ts +2 -48
  106. package/dist/types/components/Tabs/Tabs.d.ts +3 -0
  107. package/dist/types/components/Tabs/Tabs.test.d.ts +1 -0
  108. package/dist/types/components/Tabs/Tabs.types.d.ts +48 -0
  109. package/dist/types/components/Tabs/index.d.ts +1 -2
  110. package/dist/types/components/TextContent/TextContent.d.ts +3 -0
  111. package/dist/types/components/TextContent/TextContent.test.d.ts +1 -0
  112. package/dist/types/components/TextContent/TextContent.types.d.ts +23 -0
  113. package/dist/types/components/TextContent/index.d.ts +2 -10
  114. package/dist/types/components/Textarea/Textarea.d.ts +2 -0
  115. package/dist/types/components/Textarea/Textarea.test.d.ts +1 -0
  116. package/dist/types/components/Textarea/Textarea.types.d.ts +6 -0
  117. package/dist/types/components/Textarea/index.d.ts +2 -7
  118. package/dist/types/components/Toast/Toast.d.ts +4 -8
  119. package/dist/types/components/Toast/Toast.test.d.ts +1 -0
  120. package/dist/types/components/Toast/Toast.types.d.ts +117 -0
  121. package/dist/types/components/Toast/ToastProvider.d.ts +2 -11
  122. package/dist/types/components/Toast/ToastProvider.test.d.ts +1 -0
  123. package/dist/types/components/Toast/index.d.ts +1 -0
  124. package/dist/types/components/VirtualizedDataTable/VirtualizedDataTable.d.ts +3 -0
  125. package/dist/types/components/VirtualizedDataTable/VirtualizedDataTable.test.d.ts +1 -0
  126. package/dist/types/components/VirtualizedDataTable/VirtualizedDataTable.types.d.ts +18 -0
  127. package/dist/types/components/VirtualizedDataTable/VirtualizedRow.d.ts +5 -0
  128. package/dist/types/components/VirtualizedDataTable/index.d.ts +2 -0
  129. package/dist/types/components/_Dialog/Dialog.d.ts +4 -0
  130. package/dist/types/components/_Dialog/Dialog.types.d.ts +53 -0
  131. package/dist/types/components/_Dialog/index.d.ts +2 -0
  132. package/dist/types/components/common-type.d.ts +2 -1
  133. package/dist/types/hooks/use-debounce.d.ts +2 -0
  134. package/dist/types/hooks/use-is-mobile.d.ts +1 -0
  135. package/dist/types/hooks/use-is-tablet.d.ts +1 -0
  136. package/dist/types/index.d.ts +11 -6
  137. package/dist/types/utils/get.d.ts +1 -0
  138. package/package.json +20 -4
  139. package/dist/types/components/Button/type.d.ts +0 -58
  140. package/dist/types/components/RadioButton/index.d.ts +0 -7
  141. package/dist/types/components/RadioButtonGroup/index.d.ts +0 -19
  142. package/dist/types/components/RadioSwtich/index.d.ts +0 -14
  143. package/dist/types/components/Tag/index.d.ts +0 -12
  144. package/dist/types/components/hooks/use-debounce.d.ts +0 -1
@@ -1,7 +1,3 @@
1
+ import { UsePaginationProps } from './Pagination.types';
1
2
  export declare const DOTS = "...";
2
- export type UsePaginationProps = {
3
- totalPages: number;
4
- currentPage: number;
5
- siblingCount?: number;
6
- };
7
3
  export declare const usePagination: ({ totalPages, currentPage, siblingCount, }: UsePaginationProps) => (number | string)[];
@@ -0,0 +1,6 @@
1
+ import { type InputProps } from '../Input';
2
+ export interface PasswordInputProps extends Omit<InputProps, 'rightGroup'> {
3
+ }
4
+ export declare const PASSWORD_TYPE = "password";
5
+ export declare const PASSWORD_PLACEHOLDER = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
6
+ export declare const PasswordInput: React.FC<PasswordInputProps>;
@@ -1,6 +1 @@
1
- import { type InputProps } from '../Input';
2
- export interface PasswordInputProps extends Omit<InputProps, 'rightGroup'> {
3
- }
4
- export declare const PASSWORD_TYPE = "password";
5
- export declare const PASSWORD_PLACEHOLDER = "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022";
6
- export declare const PasswordInput: React.FC<PasswordInputProps>;
1
+ export * from './PasswordInput';
@@ -0,0 +1,2 @@
1
+ import { RadioProps } from './Radio.types';
2
+ export declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { InputHTMLAttributes, ReactNode } from 'react';
2
+ import type { InputCustomProps } from '../common-type';
3
+ export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>, Omit<InputCustomProps, 'labelHint'> {
4
+ /** Force type to checkbox only */
5
+ type?: 'radio';
6
+ /** Extra class for outer wrapper */
7
+ wrapperClass?: string;
8
+ /** Input container class */
9
+ containerClass?: string;
10
+ /** Label class */
11
+ labelClass?: string;
12
+ /** Error message */
13
+ error?: string | ReactNode;
14
+ }
@@ -0,0 +1,2 @@
1
+ export * from './Radio';
2
+ export * from './Radio.types';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { RadioGroupProps } from './RadioGroup.types';
3
+ export declare const RadioGroup: React.FC<RadioGroupProps>;
@@ -0,0 +1,65 @@
1
+ import type { ChangeEvent, ReactNode } from 'react';
2
+ export type RadionGroupItem = {
3
+ /**
4
+ * The display label shown next to the radio button.
5
+ */
6
+ label: string;
7
+ /**
8
+ * The underlying value associated with the option.
9
+ * Can be any type, including string, number, or object.
10
+ */
11
+ value: any;
12
+ };
13
+ export interface RadioGroupProps {
14
+ /**
15
+ * The name attribute shared by all radio buttons in the group.
16
+ * Ensures only one option can be selected at a time.
17
+ */
18
+ name: string;
19
+ /**
20
+ * Optional label displayed above the radio button group.
21
+ * Can be a string or a custom ReactNode.
22
+ */
23
+ label?: ReactNode;
24
+ /**
25
+ * Custom CSS classes applied to the label element.
26
+ */
27
+ labelClass?: string;
28
+ /**
29
+ * Custom CSS classes applied to the label wrapper container.
30
+ */
31
+ labelWrapperClass?: string;
32
+ /**
33
+ * Optional hint content displayed beside the label.
34
+ * Useful for showing small guidance text.
35
+ */
36
+ labelHint?: ReactNode;
37
+ /**
38
+ * Custom CSS classes applied to the outer container
39
+ * that wraps the entire radio group.
40
+ */
41
+ containerClass?: string;
42
+ /**
43
+ * The currently selected value.
44
+ * When provided, the component becomes controlled.
45
+ */
46
+ value?: any;
47
+ /**
48
+ * The list of options to render.
49
+ * - Strings → converted to { label, value } internally
50
+ * - Objects → must follow RadionButtonGroupItem structure
51
+ */
52
+ options: string[] | RadionGroupItem[];
53
+ /**
54
+ * Whether to display radio buttons horizontally in a row.
55
+ * Defaults to vertical column layout.
56
+ */
57
+ row?: boolean;
58
+ /**
59
+ * Change handler called when the selected radio button changes.
60
+ * Receives the native ChangeEvent from the input element.
61
+ */
62
+ onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
63
+ error?: string | null;
64
+ showErrorMessage?: boolean;
65
+ }
@@ -0,0 +1,2 @@
1
+ export * from './RadioGroup';
2
+ export * from './RadioGroup.types';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import type { RadioSwitchProps } from './RadioSwitch.types';
3
+ /**
4
+ * GPU-accelerated Radio Switch with perfect highlight alignment.
5
+ * Supports wrapping, icons, descriptions, and dark mode.
6
+ */
7
+ export declare const RadioSwitch: React.FC<RadioSwitchProps>;
@@ -0,0 +1,47 @@
1
+ import type { RadioGroupProps } from '@headlessui/react';
2
+ /**
3
+ * A single item in the RadioSwitch component.
4
+ * Can be:
5
+ * - a string → used as both label & value
6
+ * - an object → allows custom label, value, and an optional description
7
+ */
8
+ export type RadioSwitchItem = string | {
9
+ /** Text shown inside the switch option */
10
+ label: string;
11
+ /** The underlying value for this option */
12
+ value: string;
13
+ /** Optional description shown below the label (small text) */
14
+ description?: string;
15
+ };
16
+ /**
17
+ * Props for the RadioSwitch component.
18
+ * Extends HeadlessUI's RadioGroupProps.
19
+ */
20
+ export type RadioSwitchProps = RadioGroupProps & {
21
+ /**
22
+ * Accessible label for the group.
23
+ * Used internally for aria-label.
24
+ */
25
+ label?: string;
26
+ /**
27
+ * The currently selected value.
28
+ * Makes this a controlled component.
29
+ */
30
+ selected: string;
31
+ /**
32
+ * Callback fired when selection changes.
33
+ * Receives the selected string value.
34
+ */
35
+ onChange: (value: string) => void;
36
+ /**
37
+ * List of switch options.
38
+ * Can be:
39
+ * - an array of strings
40
+ * - an array of objects with label/value/description
41
+ */
42
+ items: RadioSwitchItem[];
43
+ switchClass?: string;
44
+ wrapperClass?: string;
45
+ contentClass?: string;
46
+ descriptionClass?: string;
47
+ };
@@ -0,0 +1,2 @@
1
+ export * from './RadioSwitch';
2
+ export * from './RadioSwitch.types';
@@ -0,0 +1,10 @@
1
+ import React, { type InputHTMLAttributes } from 'react';
2
+ import { type InputCustomProps } from '../common-type';
3
+ export type RangeValue = {
4
+ min: any;
5
+ max: any;
6
+ };
7
+ export interface RangeInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value'>, InputCustomProps {
8
+ value?: RangeValue;
9
+ }
10
+ export declare const RangeInput: React.FC<RangeInputProps>;
@@ -0,0 +1,2 @@
1
+ import { RangeInputProps } from './RangeInput.types';
2
+ export declare const RangeInput: import("react").ForwardRefExoticComponent<RangeInputProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,14 @@
1
+ import type { InputHTMLAttributes, ReactNode } from 'react';
2
+ import type { InputCustomProps } from '../common-type';
3
+ export interface RangeInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>, InputCustomProps {
4
+ /** Extra class for outer wrapper */
5
+ wrapperClass?: string;
6
+ /** Input container class */
7
+ containerClass?: string;
8
+ /** Label class */
9
+ labelClass?: string;
10
+ /** Error message */
11
+ error?: string | ReactNode;
12
+ showValue?: boolean;
13
+ valueSuffix?: string;
14
+ }
@@ -1,10 +1 @@
1
- import React, { type InputHTMLAttributes } from 'react';
2
- import { type InputCustomProps } from '../common-type';
3
- export type RangeValue = {
4
- min: any;
5
- max: any;
6
- };
7
- export interface RangeInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'value'>, InputCustomProps {
8
- value?: RangeValue;
9
- }
10
- export declare const RangeInput: React.FC<RangeInputProps>;
1
+ export * from './RangeInput';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { RangeSliderProps } from './RangeSlider.types';
3
+ export declare const RangeSlider: React.FC<RangeSliderProps>;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Props for the RangeSlider component.
3
+ * A dual-thumb, draggable range selector with support for labels,
4
+ * error display, and smooth animated thumb movement.
5
+ */
6
+ export interface RangeSliderProps {
7
+ /**
8
+ * Top label displayed above the slider.
9
+ * Useful for identifying the field in forms.
10
+ */
11
+ label?: string;
12
+ /**
13
+ * Optional hint displayed to the right of the label.
14
+ * Often used for contextual help or inline descriptions.
15
+ */
16
+ labelHint?: React.ReactNode;
17
+ /**
18
+ * Custom Tailwind classes applied to the label element.
19
+ */
20
+ labelClass?: string;
21
+ /**
22
+ * Custom Tailwind classes applied to the outer container
23
+ * that wraps the entire slider component.
24
+ */
25
+ containerClass?: string;
26
+ /**
27
+ * Custom Tailwind classes applied to the slider thumbs.
28
+ */
29
+ className?: string;
30
+ /**
31
+ * The minimum allowed numeric value of the slider.
32
+ */
33
+ min: number;
34
+ /**
35
+ * The maximum allowed numeric value of the slider.
36
+ */
37
+ max: number;
38
+ /**
39
+ * The current selected minimum value (left thumb).
40
+ * This makes the component fully controlled.
41
+ */
42
+ valueMin: number;
43
+ /**
44
+ * The current selected maximum value (right thumb).
45
+ * This makes the component fully controlled.
46
+ */
47
+ valueMax: number;
48
+ /**
49
+ * Callback triggered whenever either thumb moves.
50
+ * Receives the updated min and max values.
51
+ */
52
+ onChange: (min: number, max: number) => void;
53
+ /**
54
+ * Optional string appended to displayed values.
55
+ * Example: "kg", "₹", "cm", "hrs", "%".
56
+ */
57
+ valueSuffix?: string;
58
+ /**
59
+ * Error message to display below the slider.
60
+ * If provided, the slider is styled with an error state.
61
+ */
62
+ error?: string | null;
63
+ /**
64
+ * Whether the error message should be shown.
65
+ * Defaults to true.
66
+ */
67
+ showErrorMessage?: boolean;
68
+ }
@@ -0,0 +1,2 @@
1
+ export * from './RangeSlider';
2
+ export * from './RangeSlider.types';
@@ -0,0 +1,2 @@
1
+ import type { BaseOption, SelectBoxProps } from './SelectBox.types';
2
+ export declare const SelectBox: import("react").ForwardRefExoticComponent<SelectBoxProps<string | BaseOption> & import("react").RefAttributes<HTMLInputElement | HTMLDivElement>>;
@@ -0,0 +1,94 @@
1
+ import { type ReactNode } from 'react';
2
+ export type BaseOption = {
3
+ /** Unique value for the option (used for selection comparison) */
4
+ value: string;
5
+ /** Display label for the option (optional; if omitted, value may be used) */
6
+ label?: string;
7
+ /** Whether the option is disabled and non-selectable */
8
+ disabled?: boolean;
9
+ /** Additional metadata fields allowed on the option */
10
+ [k: string]: any;
11
+ };
12
+ export interface SelectBoxProps<T extends BaseOption | string = BaseOption> {
13
+ /** List of options to display in the dropdown */
14
+ options: T[];
15
+ /**
16
+ * Currently selected option(s).
17
+ * - For single select: a single T or null
18
+ * - For multi-select: T[]
19
+ */
20
+ selected?: T | T[] | null;
21
+ /** Name of the field inside option objects to use as the label (defaults to "label") */
22
+ labelKey?: string;
23
+ /** Name of the field inside option objects to use as the value (defaults to "value") */
24
+ valueKey?: string;
25
+ /** Input ID attribute; defaults to the name field */
26
+ id?: string;
27
+ /** Input name attribute */
28
+ name?: string;
29
+ /** Text label displayed above the component */
30
+ label?: string;
31
+ /** Additional CSS classes for the label wrapper */
32
+ labelWrapperClass?: string;
33
+ /** Additional CSS classes for the label element */
34
+ labelClass?: string;
35
+ /** Optional hint element (string or JSX) displayed beside the label */
36
+ labelHint?: string;
37
+ /**
38
+ * Callback fired when selection changes.
39
+ * - Single select → value is T or null
40
+ * - Multi-select → value is T[]
41
+ */
42
+ onChange?: (value: T | T[] | null) => void;
43
+ /** Whether the entire SelectBox is disabled */
44
+ disabled?: boolean;
45
+ /** Additional CSS classes for the outer container */
46
+ containerClass?: string;
47
+ /** Placeholder text displayed when no value is selected */
48
+ placeholder?: string;
49
+ /** CSS classes applied to the dropdown options container */
50
+ dropdownContainerClass?: string;
51
+ /** Enable multiple selection mode */
52
+ multiple?: boolean;
53
+ /** Maximum number of selections allowed in multi-select mode */
54
+ maxSelection?: number;
55
+ /**
56
+ * Whether to commit value selection immediately when clicking options.
57
+ * Headless UI uses "immediate" to control Combobox selection behavior.
58
+ */
59
+ immediate?: boolean;
60
+ /** Whether to show an error message below the field */
61
+ showErrorMessage?: boolean;
62
+ /** Error message displayed below the component */
63
+ error?: string | ReactNode;
64
+ /**
65
+ * Enables async search mode:
66
+ * - Component will not filter options locally
67
+ * - Calls onSearch(query) when user types
68
+ */
69
+ async?: boolean;
70
+ /**
71
+ * Async search callback.
72
+ * Should update the `options` prop externally after fetching.
73
+ */
74
+ onSearch?: (query: string) => Promise<void>;
75
+ /** Whether the user can type inside the input (false = readOnly mode) */
76
+ searchable?: boolean;
77
+ /** Mark input as required (used for accessibility) */
78
+ required?: boolean;
79
+ /** Whether to show an “Add new” option when no results match */
80
+ allowAdd?: boolean;
81
+ /** Label prefix for the “Add new” action (e.g., "Create") */
82
+ addNewText?: string;
83
+ /**
84
+ * Callback when the user chooses the "create/add" option.
85
+ *
86
+ * It may:
87
+ * - return void (do nothing automatically)
88
+ * - return a string or BaseOption → the component will auto-add/select it
89
+ * - return a Promise resolving to the above
90
+ */
91
+ onAdd?: (value: string) => Promise<T | string | void> | T | string | void;
92
+ /** Show a clear (X) button for single-select mode */
93
+ allowClear?: boolean;
94
+ }
@@ -1,40 +1,2 @@
1
- import React, { type ReactNode } from 'react';
2
- export type SelectOption = {
3
- value: string;
4
- label?: string;
5
- disabled?: boolean;
6
- [key: string]: any;
7
- };
8
- type Selected = SelectOption | string;
9
- interface SelectBoxProps {
10
- options: SelectOption[] | string[];
11
- selected?: Selected | Selected[] | null;
12
- labelKey?: string;
13
- valueKey?: string;
14
- id?: string;
15
- name?: string;
16
- label?: string;
17
- labelWrapperClass?: string;
18
- labelClass?: string;
19
- labelHint?: string;
20
- onChange?: (value: any) => void;
21
- disabled?: boolean;
22
- containerClass?: string;
23
- placeholder?: string;
24
- dropdownContainerClass?: string;
25
- multiple?: boolean;
26
- maxSelection?: number;
27
- immediate?: boolean;
28
- showErrorMessage?: boolean;
29
- error?: string | ReactNode;
30
- async?: boolean;
31
- onSearch?: (query: string) => Promise<void>;
32
- searchable?: boolean;
33
- required?: boolean;
34
- allowAdd?: boolean;
35
- addNewText?: string;
36
- onAdd?: (value: string) => void;
37
- allowClear?: boolean;
38
- }
39
- export declare const SelectBox: React.FC<SelectBoxProps>;
40
- export {};
1
+ export * from './SelectBox';
2
+ export * from './SelectBox.types';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { EmptyTableRowProps, TableProps, TableBodyProps, TableCellProps, TableFootProps, TableHeaderCellProps, TableHeadProps, TableRowProps } from './Table.types';
3
+ export declare const Table: React.FC<TableProps>;
4
+ export declare const TableHead: React.FC<TableHeadProps>;
5
+ export declare const TableBody: React.FC<TableBodyProps>;
6
+ export declare const TableFoot: React.FC<TableFootProps>;
7
+ export declare const TableRow: React.FC<TableRowProps>;
8
+ export declare const TableCell: React.FC<TableCellProps>;
9
+ export declare const TableHeaderCell: React.FC<TableHeaderCellProps>;
10
+ export declare const EmptyTableRow: React.FC<EmptyTableRowProps>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,91 @@
1
+ import type { HTMLAttributes, ReactNode, TdHTMLAttributes, ThHTMLAttributes } from 'react';
2
+ /**
3
+ * Root <Table /> props.
4
+ */
5
+ export interface TableProps {
6
+ /** Table layout mode ("auto" or "fixed"). Default = "auto" */
7
+ layout?: 'fixed' | 'auto';
8
+ /** Additional classes applied to the table wrapper */
9
+ wrapperClass?: string;
10
+ /** Additional classes applied to the <table> element */
11
+ className?: string;
12
+ /** Table content (Head + Body + Foot) */
13
+ children: ReactNode;
14
+ }
15
+ /**
16
+ * <TableHead /> — table header section
17
+ */
18
+ export interface TableHeadProps {
19
+ /** Additional classes applied to <thead> */
20
+ className?: string;
21
+ /** Header cells (TableHeaderCell components) */
22
+ children: ReactNode;
23
+ }
24
+ /**
25
+ * <TableBody /> — table body section
26
+ */
27
+ export interface TableBodyProps {
28
+ /** Additional classes applied to <tbody> */
29
+ className?: string;
30
+ /** Show loading shimmer (overrides children) */
31
+ loading?: boolean;
32
+ /** Number of columns — needed for shimmer loader layout */
33
+ colSize: number;
34
+ /** Number of shimmer rows to show when loading */
35
+ rowSize?: number;
36
+ /** Actual table rows */
37
+ children: ReactNode;
38
+ }
39
+ /**
40
+ * <TableFoot /> — table footer
41
+ */
42
+ export interface TableFootProps {
43
+ children: ReactNode;
44
+ }
45
+ /**
46
+ * <EmptyTableRow /> — rendered when no data is available
47
+ */
48
+ export interface EmptyTableRowProps {
49
+ /** Column span for empty row */
50
+ colSpan?: number;
51
+ /** Content shown in empty state */
52
+ children: ReactNode;
53
+ /** Optional custom styling */
54
+ contentClass?: string;
55
+ }
56
+ /**
57
+ * <TableCell /> — regular table cell
58
+ */
59
+ export interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
60
+ /** Horizontal alignment */
61
+ align?: 'left' | 'center' | 'right';
62
+ /** Cell content */
63
+ children: ReactNode;
64
+ /** Additional classes */
65
+ className?: string;
66
+ }
67
+ /**
68
+ * <TableRow /> — regular row
69
+ */
70
+ export interface TableRowProps extends ThHTMLAttributes<HTMLTableRowElement> {
71
+ /** Whether the row highlights on hover */
72
+ hoverable?: boolean;
73
+ }
74
+ /**
75
+ * <TableHeaderCell /> — header cell
76
+ */
77
+ export interface TableHeaderCellProps extends HTMLAttributes<HTMLTableCellElement> {
78
+ /** Horizontal alignment */
79
+ align?: 'left' | 'center' | 'right';
80
+ /** Additional classes */
81
+ className?: string;
82
+ /** Label */
83
+ children: ReactNode;
84
+ }
85
+ /**
86
+ * <TableRowLoader /> shimmer-loader row
87
+ */
88
+ export interface TableRowLoaderProps {
89
+ colSize: number;
90
+ rowSize: number;
91
+ }
@@ -1,48 +1,2 @@
1
- import React, { type HTMLAttributes, type MouseEventHandler, type ReactNode, type TdHTMLAttributes, type ThHTMLAttributes } from 'react';
2
- interface TableProps {
3
- layout?: 'fixed' | 'auto';
4
- wrapperClass?: string;
5
- className?: string;
6
- children: ReactNode;
7
- }
8
- interface TableHeadProps {
9
- className?: string;
10
- children: ReactNode;
11
- onSort?: MouseEventHandler<HTMLElement>;
12
- }
13
- interface TableBodyProps {
14
- className?: string;
15
- loading?: boolean;
16
- children: ReactNode;
17
- colSize: number;
18
- rowSize?: number;
19
- }
20
- interface TableFootProps {
21
- children: ReactNode;
22
- }
23
- interface EmptyTableRow {
24
- colSpan?: number;
25
- children: ReactNode;
26
- }
27
- interface TableCellProps extends TdHTMLAttributes<HTMLTableCellElement> {
28
- className?: string;
29
- children: ReactNode;
30
- align?: 'left' | 'center' | 'right';
31
- }
32
- interface TableRowProps extends ThHTMLAttributes<HTMLTableRowElement> {
33
- hoverable?: boolean;
34
- }
35
- interface TableHeaderCellProps extends HTMLAttributes<HTMLTableCellElement> {
36
- className?: string;
37
- children: ReactNode;
38
- align?: 'left' | 'center' | 'right';
39
- }
40
- export declare const Table: React.FC<TableProps>;
41
- export declare const TabelHead: React.FC<TableHeadProps>;
42
- export declare const TabelBody: React.FC<TableBodyProps>;
43
- export declare const TabelFoot: React.FC<TableFootProps>;
44
- export declare const TableRow: React.FC<TableRowProps>;
45
- export declare const TableCell: React.FC<TableCellProps>;
46
- export declare const TableHeaderCell: React.FC<TableHeaderCellProps>;
47
- export declare const EmptyTableRow: React.FC<EmptyTableRow>;
48
- export {};
1
+ export * from './Table';
2
+ export * from './Table.types';
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { TabsProps } from './Tabs.types';
3
+ export declare const Tabs: React.FC<TabsProps>;
@@ -0,0 +1 @@
1
+ export {};