Skip to content

Commit 2698076

Browse files
authored
Merge pull request #27 from kubit-ui/feature/improvements-and-bugs-solved
Feature/improvements and bugs solved
2 parents 977c936 + ada3524 commit 2698076

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1155
-72
lines changed

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kubit-ui-web/react-components",
3-
"version": "1.10.1",
3+
"version": "1.11.0",
44
"description": "Kubit React Components is a customizable, accessible library of React web components, designed to enhance your application's user experience",
55
"author": {
66
"name": "Kubit",
@@ -111,12 +111,12 @@
111111
"@types/jest": "^29.5.12",
112112
"@types/jest-axe": "^3.5.9",
113113
"@types/mocha": "^10.0.7",
114-
"@types/react": "^18.3.3",
114+
"@types/react": "^18.3.4",
115115
"@types/react-dom": "^18.3.0",
116116
"@types/styled-components": "^5.1.34",
117117
"@types/ungap__structured-clone": "^1.2.0",
118-
"@typescript-eslint/eslint-plugin": "^8.1.0",
119-
"@typescript-eslint/parser": "^8.1.0",
118+
"@typescript-eslint/eslint-plugin": "^8.2.0",
119+
"@typescript-eslint/parser": "^8.2.0",
120120
"@ungap/structured-clone": "^1.2.0",
121121
"@vitejs/plugin-react": "^4.3.1",
122122
"babel-jest": "^29.7.0",
@@ -134,7 +134,7 @@
134134
"eslint-plugin-promise": "^7.1.0",
135135
"eslint-plugin-react": "^7.35.0",
136136
"eslint-plugin-react-hooks": "^4.6.2",
137-
"eslint-plugin-react-refresh": "^0.4.9",
137+
"eslint-plugin-react-refresh": "^0.4.10",
138138
"eslint-plugin-storybook": "^0.8.0",
139139
"eslint-plugin-unused-imports": "^4.1.3",
140140
"globals": "^15.9.0",
@@ -154,10 +154,10 @@
154154
"storybook": "^8.2.9",
155155
"ts-jest": "^29.2.4",
156156
"tsc-alias": "1.8.10",
157-
"typedoc": "^0.26.5",
158-
"typedoc-plugin-markdown": "^4.2.3",
157+
"typedoc": "^0.26.6",
158+
"typedoc-plugin-markdown": "^4.2.5",
159159
"typescript": "^5.5.4",
160-
"vite": "^5.4.0",
160+
"vite": "^5.4.2",
161161
"vite-tsconfig-paths": "^4.3.2",
162162
"yarn-deduplicate": "^6.0.2"
163163
},

src/components/button/button.styled.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,14 +67,26 @@ export const ButtonStyled = styled.button<IButtonStyled>`
6767
)};
6868
}
6969
70-
&:hover:not(:disabled) {
71-
${({ $styles, $sizeStyles }) => setTokens(ButtonStateType.HOVER, $styles, $sizeStyles)}
70+
@media (hover: hover) {
71+
&:hover:not(:disabled) {
72+
${({ $styles, $sizeStyles }) => setTokens(ButtonStateType.HOVER, $styles, $sizeStyles)}
73+
}
7274
}
7375
7476
&:active:not(:disabled) {
7577
${({ $styles, $sizeStyles }) => setTokens(ButtonStateType.PRESSED, $styles, $sizeStyles)}
7678
}
7779
80+
&:focus-visible {
81+
${({ $styles, $sizeStyles }) => setTokens(ButtonStateType.DEFAULT, $styles, $sizeStyles)}
82+
}
83+
84+
@media (hover: none) {
85+
&:hover {
86+
${({ $styles, $sizeStyles }) => setTokens(ButtonStateType.DEFAULT, $styles, $sizeStyles)}
87+
}
88+
}
89+
7890
width: ${props => (props.$fullWidth ? '100%' : 'auto')};
7991
8092
&::after {

src/components/calendar/calendarStandAlone.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { YearSelector } from './selector/yearSelector/yearSelector';
1212
import { ICalendarStandAlone } from './types';
1313

1414
const CalendarStandAloneComponent = (
15-
{ maxDate = new Date(), ...props }: ICalendarStandAlone,
15+
{ maxDate = new Date(), customBackText = 'Back', ...props }: ICalendarStandAlone,
1616
ref: React.ForwardedRef<HTMLDivElement> | undefined | null
1717
): React.JSX.Element => {
1818
const [showMonthSelector, setShowMonthSelector] = React.useState(false);
@@ -31,6 +31,7 @@ const CalendarStandAloneComponent = (
3131
configAccesibility={props.configAccesibility}
3232
configCalendar={props.configCalendar}
3333
currentDate={props.currentDate}
34+
customBackText={customBackText}
3435
maxDate={maxDate}
3536
minDate={props.minDate}
3637
setCurrentDate={props.setCurrentDate}

src/components/calendar/selector/__tests__/selector.test.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ describe('Selector component', () => {
3838
it('Selector with Range and selected Date Component', () => {
3939
renderProvider(<Selector {...mockProps} />);
4040

41-
const selector = screen.getByRole('button', {
42-
name: mockProps.configCalendar.leftArrowIcon['aria-label'],
43-
});
41+
const selector = screen.getByLabelText(mockProps.configCalendar.leftArrowIcon['aria-label']);
4442

4543
expect(selector).toBeInTheDocument();
4644
});

src/components/calendar/selector/selector.styled.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ export const RightIconStyled = styled.span<RightIconType>`
3030
visibility: ${({ showCustomSelector }) => (showCustomSelector ? 'hidden' : 'visible')};
3131
`;
3232

33-
export const IconAndBackTextStyled = styled.div<SelectorStyledType>`
33+
export const IconAndBackTextStyled = styled.button<SelectorStyledType>`
3434
display: flex;
3535
flex-direction: row;
3636
align-items: center;
37+
cursor: pointer;
3738
${({ styles }) => getStyles(styles?.selectorIconAndBackTextContainer)};
3839
`;

src/components/calendar/selector/selector.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,22 +123,21 @@ export const Selector = (props: ISelector): JSX.Element => {
123123

124124
return (
125125
<SelectorStyled isDaySelector={isDaySelector} styles={props.styles}>
126-
<IconAndBackTextStyled styles={props.styles}>
126+
<IconAndBackTextStyled
127+
aria-label={showCustomSelector ? '' : leftArrowIcon['aria-label']}
128+
styles={props.styles}
129+
type="button"
130+
onClick={handleOnClickLeftIcon}
131+
>
127132
<ElementOrIcon
128133
color={iconArrowDisabled(props.minDate) ? props.styles?.colorArrowDisabled : undefined}
129134
customIconStyles={props.styles?.leftArrow}
130135
disabled={iconArrowDisabled(props.minDate)}
131136
{...leftArrowIcon}
132-
aria-label={
133-
showCustomSelector
134-
? props.configAccesibility?.backToMonthAriaLabel
135-
: leftArrowIcon['aria-label']
136-
}
137-
onClick={handleOnClickLeftIcon}
138137
/>
139138
{showCustomSelector && (
140139
<Text component={TextComponentType.PARAGRAPH} customTypography={props.styles?.backText}>
141-
{'Back'}
140+
{props.customBackText}
142141
</Text>
143142
)}
144143
</IconAndBackTextStyled>

src/components/calendar/selector/types/selector.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { CalendarContainerStylesType } from '../../types/calendarTheme';
44

55
export interface ISelector {
66
currentDate: Date;
7+
customBackText?: string;
78
setCurrentDate: (date: Date) => void;
89
maxDate: Date;
910
minDate: Date;

src/components/calendar/types/calendar.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type IConfigAccesibility = {
3434
};
3535
export interface ICalendarStandAlone<V = undefined extends string ? unknown : string> {
3636
id?: string;
37+
customBackText?: string;
3738
selectedDate: Date[];
3839
hasRange?: boolean;
3940
disabledDates?: Date[];

src/components/icon/icon.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ const IconBasicComponent = (
3737
disabled={disabled}
3838
id={props.id}
3939
tabIndex={tabIndex}
40+
title={props.title || ''}
4041
type={ButtonType.BUTTON}
4142
onClick={onClick}
4243
>

src/components/icon/types/icon.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export interface IIconStandAlone extends IconAriaAttributes {
4040
twistAnimationTransformValue?: string | null | undefined;
4141
complex?: boolean;
4242
customIconStyles?: IconTypes;
43+
title?: string;
4344
}
4445

4546
export type IIcon = Omit<IIconStandAlone, 'onKeyDown'> & {

0 commit comments

Comments
 (0)