tcce-design-system 0.3.22 → 0.3.23
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.
|
@@ -122,6 +122,14 @@ declare type BadgeVariant = 'primary' | 'secondary' | 'success' | 'warning' | 'd
|
|
|
122
122
|
|
|
123
123
|
export declare const baseFieldStyles: RuleSet<object>;
|
|
124
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Base props shared across all form field components.
|
|
127
|
+
* Extends standard HTML input attributes while providing consistent sizing and state management.
|
|
128
|
+
* @param size - The size variant of the form field. Default is 'md'.
|
|
129
|
+
* @param hasError - When true, displays the field in an error state with error styling.
|
|
130
|
+
* @param disabled - When true, disables the field and prevents user interaction.
|
|
131
|
+
* @param className - Additional CSS class names for custom styling.
|
|
132
|
+
*/
|
|
125
133
|
export declare interface BaseFormFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
126
134
|
size?: FormFieldSize;
|
|
127
135
|
hasError?: boolean;
|
|
@@ -129,8 +137,39 @@ export declare interface BaseFormFieldProps extends Omit<InputHTMLAttributes<HTM
|
|
|
129
137
|
className?: string;
|
|
130
138
|
}
|
|
131
139
|
|
|
140
|
+
/**
|
|
141
|
+
* BaseInput is the foundational text input component with support for icons, multiple types, sizes, and states.
|
|
142
|
+
*
|
|
143
|
+
* Features:
|
|
144
|
+
* - Multiple sizes (xs, sm, md, lg) with appropriate text sizing
|
|
145
|
+
* - Icon support on both left and right sides
|
|
146
|
+
* - Various input types (text, email, password, number, tel, url)
|
|
147
|
+
* - Error and disabled states with visual feedback
|
|
148
|
+
* - Flushed variant for minimal styling
|
|
149
|
+
* - Full HTML input attributes support
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```tsx
|
|
153
|
+
* <BaseInput
|
|
154
|
+
* placeholder="Enter email"
|
|
155
|
+
* type="email"
|
|
156
|
+
* leftIcon={RiMailLine}
|
|
157
|
+
* size="md"
|
|
158
|
+
* />
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
132
161
|
export declare const BaseInput: ForwardRefExoticComponent<BaseInputProps & RefAttributes<HTMLInputElement>>;
|
|
133
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Props for the BaseInput component.
|
|
165
|
+
* Extends BaseFormFieldProps with input-specific properties and icon support.
|
|
166
|
+
* @param type - HTML input type determining keyboard and validation behavior. Default is 'text'.
|
|
167
|
+
* @param flushed - When true, applies a minimal style with only a bottom border. Default is false.
|
|
168
|
+
* @param leftIcon - Optional icon component displayed on the left side of the input.
|
|
169
|
+
* @param rightIcon - Optional icon component displayed on the right side of the input.
|
|
170
|
+
* @param iconSize - Size of the left and right icons ('tn', 'sm', 'md'). Default is 'md'.
|
|
171
|
+
* @param iconColor - Color of the icons. Default is 'currentColor'.
|
|
172
|
+
*/
|
|
134
173
|
export declare interface BaseInputProps extends Omit<BaseFormFieldProps, 'type'>, WithIconsProps {
|
|
135
174
|
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url';
|
|
136
175
|
flushed?: boolean;
|
|
@@ -727,8 +766,19 @@ export declare interface FormFieldProps extends BaseFormFieldProps, Omit<WithIco
|
|
|
727
766
|
className?: string;
|
|
728
767
|
}
|
|
729
768
|
|
|
769
|
+
/**
|
|
770
|
+
* Available sizes for form field components.
|
|
771
|
+
* - xs: Extra small size (30px height, 14px font).
|
|
772
|
+
* - sm: Small size (36px height, 14px font).
|
|
773
|
+
* - md: Medium size (42px height, 16px font) - Default for most inputs.
|
|
774
|
+
* - lg: Large size (48px height, 18px font).
|
|
775
|
+
*/
|
|
730
776
|
export declare type FormFieldSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
731
777
|
|
|
778
|
+
/**
|
|
779
|
+
* Interactive states for form fields.
|
|
780
|
+
* Used to describe the current visual and interactive state of a form element.
|
|
781
|
+
*/
|
|
732
782
|
export declare type FormFieldState = 'default' | 'hover' | 'focus' | 'error' | 'disabled';
|
|
733
783
|
|
|
734
784
|
/**
|
|
@@ -1075,6 +1125,9 @@ export declare const isAllowedInputType: (t: string) => t is AllowedInputType;
|
|
|
1075
1125
|
|
|
1076
1126
|
export declare const Label: ({ children, htmlFor, className, required, disabled, size, ...props }: BaseLabelProps) => JSX.Element;
|
|
1077
1127
|
|
|
1128
|
+
/**
|
|
1129
|
+
* Available sizes for label components.
|
|
1130
|
+
*/
|
|
1078
1131
|
export declare type LabelSize = 'xs' | 'sm' | 'md' | 'lg';
|
|
1079
1132
|
|
|
1080
1133
|
/**
|
|
@@ -2067,9 +2120,29 @@ color?: string;
|
|
|
2067
2120
|
}>> & string;
|
|
2068
2121
|
export { Text_2 as Text }
|
|
2069
2122
|
|
|
2123
|
+
/**
|
|
2124
|
+
* TextAreaInput provides a flexible multi-line text input component.
|
|
2125
|
+
* Supports manual and automatic resizing, icons, and multiple size variants.
|
|
2126
|
+
* Use for comments, descriptions, messages, or any long-form text input.
|
|
2127
|
+
*/
|
|
2070
2128
|
export declare const TextAreaInput: ForwardRefExoticComponent<TextAreaInputProps & RefAttributes<HTMLTextAreaElement>>;
|
|
2071
2129
|
|
|
2072
|
-
|
|
2130
|
+
/**
|
|
2131
|
+
* Props for the TextAreaInput component.
|
|
2132
|
+
* A flexible multi-line text input with support for icons, auto-resize, and various sizing options.
|
|
2133
|
+
* @param size - The size variant of the textarea. Default is 'md'.
|
|
2134
|
+
* @param hasError - When true, displays the textarea in an error state with error styling.
|
|
2135
|
+
* @param disabled - When true, disables the textarea and prevents user interaction.
|
|
2136
|
+
* @param minRows - Minimum number of visible rows. Affects the initial height of the textarea. Default is 3.
|
|
2137
|
+
* @param maxRows - Maximum number of rows when autoResize is enabled. Limits the height expansion.
|
|
2138
|
+
* @param resize - Controls the manual resize behavior of the textarea. Default is 'vertical'.
|
|
2139
|
+
* @param autoResize - When true, automatically adjusts height based on content within minRows/maxRows constraints.
|
|
2140
|
+
* @param leftIcon - Optional icon component displayed on the left side of the textarea.
|
|
2141
|
+
* @param rightIcon - Optional icon component displayed on the right side of the textarea.
|
|
2142
|
+
* @param iconSize - Size of the left and right icons. Default is 'md'.
|
|
2143
|
+
* @param iconColor - Color of the icons. Default is 'currentColor'.
|
|
2144
|
+
*/
|
|
2145
|
+
export declare interface TextAreaInputProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'size'>, WithIconsProps {
|
|
2073
2146
|
size?: FormFieldSize;
|
|
2074
2147
|
hasError?: boolean;
|
|
2075
2148
|
disabled?: boolean;
|
|
@@ -2180,13 +2253,13 @@ export declare interface UserAbilities {
|
|
|
2180
2253
|
}
|
|
2181
2254
|
|
|
2182
2255
|
/**
|
|
2183
|
-
*
|
|
2184
|
-
* Defines
|
|
2185
|
-
* @param id Unique identifier for the menu item
|
|
2186
|
-
* @param label Display text
|
|
2187
|
-
* @param icon Icon component
|
|
2188
|
-
* @param onClick
|
|
2189
|
-
* @param variant
|
|
2256
|
+
* Menu item configuration for the user profile dropdown.
|
|
2257
|
+
* Defines individual actions displayed in the dropdown menu.
|
|
2258
|
+
* @param id - Unique identifier for the menu item.
|
|
2259
|
+
* @param label - Display text shown in the menu.
|
|
2260
|
+
* @param icon - Icon component or ReactNode displayed next to the label.
|
|
2261
|
+
* @param onClick - Callback invoked when the menu item is clicked.
|
|
2262
|
+
* @param variant - Visual style variant. 'danger' applies warning colors (e.g., for logout/delete). Default is 'default'.
|
|
2190
2263
|
*/
|
|
2191
2264
|
export declare interface UserMenuItem {
|
|
2192
2265
|
id: string;
|
|
@@ -2207,10 +2280,10 @@ export declare const UserProfile: {
|
|
|
2207
2280
|
|
|
2208
2281
|
/**
|
|
2209
2282
|
* Props for the UserProfile component.
|
|
2210
|
-
* @param user
|
|
2211
|
-
* @param onProfileClick Optional
|
|
2212
|
-
* @param onLogout Optional
|
|
2213
|
-
* @param menuItems Optional array of custom menu items to display
|
|
2283
|
+
* @param user - User object containing id, name, email, and roles array. The first role's name is displayed.
|
|
2284
|
+
* @param onProfileClick - Optional callback invoked when the Profile menu item is selected.
|
|
2285
|
+
* @param onLogout - Optional callback invoked when the Logout menu item is selected.
|
|
2286
|
+
* @param menuItems - Optional array of custom menu items to display alongside the default Profile and Logout items.
|
|
2214
2287
|
*/
|
|
2215
2288
|
export declare interface UserProfileProps {
|
|
2216
2289
|
user: User;
|