@e-burgos/tucu-ui 1.0.0 → 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.
- package/CHANGELOG.md +103 -0
- package/components/forms/input-searcher.d.ts +9 -5
- package/components/forms/input.d.ts +2 -0
- package/components/forms/pin-code.d.ts +3 -5
- package/components/forms/radio.d.ts +2 -5
- package/index.css +1 -1
- package/index.js +31 -31
- package/index.mjs +8021 -7702
- package/package.json +4 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.1.0] - 2024-12-19
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **Radio Component**: Enhanced hover experience when radio is checked
|
|
13
|
+
- Added darker color on hover (`checked:hover:enabled:bg-*/90` or `checked:hover:enabled:bg-*-600`)
|
|
14
|
+
- Added subtle scale effect (`checked:hover:enabled:scale-105`)
|
|
15
|
+
- Improved transitions with `transition-all duration-200`
|
|
16
|
+
- **Checkbox Component**: Enhanced hover experience when checkbox is checked
|
|
17
|
+
- Added darker color on hover for checked state
|
|
18
|
+
- Added subtle scale effect on hover
|
|
19
|
+
- Improved transitions for smoother animations
|
|
20
|
+
- **PinCode Component**: Hide native number input spinners
|
|
21
|
+
- Added styles to hide webkit and moz spinners when `type="number"`
|
|
22
|
+
- Improved visual consistency for numeric pin codes
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- **Radio Component**: Removed "DEFAULT" values
|
|
27
|
+
- Changed default `size` from `'DEFAULT'` to `'md'`
|
|
28
|
+
- Changed default `color` from `'DEFAULT'` to `'primary'`
|
|
29
|
+
- Updated internal class mappings to use explicit values
|
|
30
|
+
- **RadioGroup Component**: Removed "DEFAULT" values
|
|
31
|
+
- Changed default `size` from `'DEFAULT'` to `'md'`
|
|
32
|
+
- Changed default `color` from `'DEFAULT'` to `'primary'`
|
|
33
|
+
- Updated Storybook stories to reflect new defaults
|
|
34
|
+
- **PinCode Component**: Removed "DEFAULT" values
|
|
35
|
+
- Changed default `size` from `'DEFAULT'` to `'md'`
|
|
36
|
+
- Changed default `rounded` from `'DEFAULT'` to `'md'`
|
|
37
|
+
- Changed default `color` from `'DEFAULT'` to `'primary'`
|
|
38
|
+
- Updated internal class mappings (`inputClasses.size`, `inputClasses.rounded`, `inputClasses.variant.*.color`)
|
|
39
|
+
- Updated Storybook stories to reflect new defaults
|
|
40
|
+
|
|
41
|
+
### Fixed
|
|
42
|
+
|
|
43
|
+
- **Radio Component**: Fixed variant and color props not displaying correctly
|
|
44
|
+
- Added `appearance-none` to remove native browser styles
|
|
45
|
+
- Implemented custom checked indicator using `peer-checked` utility
|
|
46
|
+
- Fixed color classes to properly apply `checked:border-*` and `checked:bg-*` styles
|
|
47
|
+
- **PinCode Component**: Fixed native number input spinners appearing in numeric pin codes
|
|
48
|
+
- Added cross-browser support for hiding spinners (Chrome, Safari, Edge, Firefox)
|
|
49
|
+
|
|
50
|
+
### Documentation
|
|
51
|
+
|
|
52
|
+
- Updated Storybook stories for Radio, RadioGroup, and PinCode components
|
|
53
|
+
- Removed "DEFAULT" from argTypes options
|
|
54
|
+
- Updated default args to use explicit values (`'md'`, `'primary'`)
|
|
55
|
+
- Ensured consistency across all form component stories
|
|
56
|
+
|
|
57
|
+
## [Unreleased]
|
|
58
|
+
|
|
59
|
+
## [1.0.0] - Initial Release
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- **Input Component**:
|
|
64
|
+
- Password visibility toggle with eye icon
|
|
65
|
+
- Custom date picker with year selection
|
|
66
|
+
- Support for multiple date formats (DD-MM-YYYY, MM-DD-YYYY, YYYY-MM-DD, DD/MM/YYYY, MM/DD/YYYY, YYYY/MM/DD)
|
|
67
|
+
- Default date format: DD-MM-YYYY
|
|
68
|
+
- **InputSearcher Component**:
|
|
69
|
+
- Internal state management (removed external `value` and `onChange` props)
|
|
70
|
+
- Option filtering after 3 characters typed
|
|
71
|
+
- Error message display when no matches found (after 3+ characters)
|
|
72
|
+
- Text highlighting for matching characters in dropdown options
|
|
73
|
+
- Multiple selection support with `multiple` prop
|
|
74
|
+
- Selected options displayed as chips below the input
|
|
75
|
+
- Custom error message support via `noMatchesMessage` prop
|
|
76
|
+
- **Tab Component**:
|
|
77
|
+
- Animated tab panel transitions using Framer Motion
|
|
78
|
+
- Smooth fade and slide animations
|
|
79
|
+
|
|
80
|
+
### Changed
|
|
81
|
+
|
|
82
|
+
- **Input Component**:
|
|
83
|
+
- Improved `onChange` prop handling to prevent read-only warnings
|
|
84
|
+
- Enhanced date picker UI with custom calendar dropdown
|
|
85
|
+
- **InputSearcher Component**:
|
|
86
|
+
- Refactored to be internally controlled
|
|
87
|
+
- Improved state management to prevent infinite loops
|
|
88
|
+
- Enhanced user experience with better error handling
|
|
89
|
+
|
|
90
|
+
### Fixed
|
|
91
|
+
|
|
92
|
+
- **Input Component**: Fixed `onChange` prop not being passed to native input element
|
|
93
|
+
- **InputSearcher Component**:
|
|
94
|
+
- Fixed infinite loop issues with `useEffect` dependencies
|
|
95
|
+
- Fixed input not being writable
|
|
96
|
+
- Fixed state synchronization with `initialValue` prop
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Version History
|
|
101
|
+
|
|
102
|
+
- **1.1.0** - Enhanced form components with improved hover states, removed DEFAULT values, and bug fixes
|
|
103
|
+
- **1.0.0** - Initial release with core form components and UI elements
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { InputSelectOption } from './input-select';
|
|
3
|
+
export declare function InputSearcher({ label, onOptionSelect, options, initialValue, noMatchesMessage, multiple, ...props }: {
|
|
4
|
+
label?: string;
|
|
5
|
+
initialValue?: string | number;
|
|
6
|
+
onOptionSelect?: (option: InputSelectOption | InputSelectOption[]) => void;
|
|
7
|
+
options?: InputSelectOption[];
|
|
8
|
+
noMatchesMessage?: string;
|
|
9
|
+
multiple?: boolean;
|
|
10
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'value'>): import("react/jsx-runtime").JSX.Element;
|
|
7
11
|
export default InputSearcher;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type DateFormat = 'DD-MM-YYYY' | 'MM-DD-YYYY' | 'YYYY-MM-DD' | 'DD/MM/YYYY' | 'MM/DD/YYYY' | 'YYYY/MM/DD';
|
|
1
2
|
export type InputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {
|
|
2
3
|
label?: string;
|
|
3
4
|
error?: string;
|
|
@@ -9,6 +10,7 @@ export type InputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLI
|
|
|
9
10
|
suffix?: React.ReactNode;
|
|
10
11
|
suffixClassName?: string;
|
|
11
12
|
icon?: React.ReactNode;
|
|
13
|
+
dateFormat?: DateFormat;
|
|
12
14
|
};
|
|
13
15
|
export declare const Input: import('react').ForwardRefExoticComponent<Omit<InputProps, "ref"> & import('react').RefAttributes<HTMLInputElement>>;
|
|
14
16
|
export default Input;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
declare const inputClasses: {
|
|
3
3
|
base: string;
|
|
4
|
+
numberType: string;
|
|
4
5
|
error: string;
|
|
5
6
|
size: {
|
|
6
7
|
sm: string;
|
|
7
|
-
|
|
8
|
+
md: string;
|
|
8
9
|
lg: string;
|
|
9
10
|
xl: string;
|
|
10
11
|
};
|
|
11
12
|
rounded: {
|
|
12
13
|
none: string;
|
|
13
14
|
sm: string;
|
|
14
|
-
|
|
15
|
+
md: string;
|
|
15
16
|
lg: string;
|
|
16
17
|
full: string;
|
|
17
18
|
};
|
|
@@ -19,7 +20,6 @@ declare const inputClasses: {
|
|
|
19
20
|
active: {
|
|
20
21
|
base: string;
|
|
21
22
|
color: {
|
|
22
|
-
DEFAULT: string;
|
|
23
23
|
primary: string;
|
|
24
24
|
secondary: string;
|
|
25
25
|
danger: string;
|
|
@@ -31,7 +31,6 @@ declare const inputClasses: {
|
|
|
31
31
|
flat: {
|
|
32
32
|
base: string;
|
|
33
33
|
color: {
|
|
34
|
-
DEFAULT: string;
|
|
35
34
|
primary: string;
|
|
36
35
|
secondary: string;
|
|
37
36
|
danger: string;
|
|
@@ -43,7 +42,6 @@ declare const inputClasses: {
|
|
|
43
42
|
outline: {
|
|
44
43
|
base: string;
|
|
45
44
|
color: {
|
|
46
|
-
DEFAULT: string;
|
|
47
45
|
primary: string;
|
|
48
46
|
secondary: string;
|
|
49
47
|
danger: string;
|
|
@@ -3,7 +3,7 @@ declare const inputClasses: {
|
|
|
3
3
|
base: string;
|
|
4
4
|
size: {
|
|
5
5
|
sm: string;
|
|
6
|
-
|
|
6
|
+
md: string;
|
|
7
7
|
lg: string;
|
|
8
8
|
xl: string;
|
|
9
9
|
};
|
|
@@ -11,7 +11,6 @@ declare const inputClasses: {
|
|
|
11
11
|
outline: {
|
|
12
12
|
base: string;
|
|
13
13
|
color: {
|
|
14
|
-
DEFAULT: string;
|
|
15
14
|
primary: string;
|
|
16
15
|
secondary: string;
|
|
17
16
|
danger: string;
|
|
@@ -23,7 +22,6 @@ declare const inputClasses: {
|
|
|
23
22
|
flat: {
|
|
24
23
|
base: string;
|
|
25
24
|
color: {
|
|
26
|
-
DEFAULT: string;
|
|
27
25
|
primary: string;
|
|
28
26
|
secondary: string;
|
|
29
27
|
danger: string;
|
|
@@ -35,7 +33,6 @@ declare const inputClasses: {
|
|
|
35
33
|
active: {
|
|
36
34
|
base: string;
|
|
37
35
|
color: {
|
|
38
|
-
DEFAULT: string;
|
|
39
36
|
primary: string;
|
|
40
37
|
secondary: string;
|
|
41
38
|
danger: string;
|
|
@@ -52,7 +49,7 @@ export interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
52
49
|
/** The size of the component. `"sm"` is equivalent to the dense input styling. */
|
|
53
50
|
size?: keyof typeof inputClasses.size;
|
|
54
51
|
/** Change radio button color */
|
|
55
|
-
color?: keyof
|
|
52
|
+
color?: keyof typeof inputClasses.variant.outline.color;
|
|
56
53
|
/** Available directions of the label are: */
|
|
57
54
|
labelPlacement?: 'start' | 'end';
|
|
58
55
|
/** Whether the input is disabled */
|