Skip to content

Commit f8954db

Browse files
authored
Merge pull request #16 from kubit-ui/feature/improvements-and-new-components
Feature/improvements and new components
2 parents 6e9dd23 + 496a529 commit f8954db

File tree

80 files changed

+2417
-122
lines changed

Some content is hidden

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

80 files changed

+2417
-122
lines changed

.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { create } from '@storybook/theming';
44

55
const theme = create({
66
base: 'light', // this will inherit the base properties of Storybook's dark theme
7-
brandTitle: `Kubit | react-components`,
7+
brandTitle: `React components by Kubit`,
88
brandUrl: 'https://kubit-ui.com/',
99

1010
// colors

.storybook/overview/introduction.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
// import Package from '../../package.json';
3+
import Package from '../../package.json';
44
import bg from './assets/cover_home.webp';
55
import './introduction.css';
66

@@ -24,7 +24,7 @@ export const Introduction = () => {
2424
>
2525
<div className="welcome-text-container">
2626
<h2 className="welcome_title">Kubit | web-components</h2>
27-
<h4 className="welcome_version">{`v.1.0.0 | Saturn`}</h4>
27+
<h4 className="welcome_version">{`v.${Package.version} | Saturn`}</h4>
2828
</div>
2929
</div>
3030
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kubit-ui-web/react-components",
3-
"version": "1.5.2",
3+
"version": "1.6.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",

src/components/backToTop/backToTopControlled.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,13 @@ const BackToTopControlledComponent = React.forwardRef(
2525

2626
const innerRef = React.useRef<HTMLButtonElement | null>(null);
2727

28-
React.useImperativeHandle(ref, () => {
29-
return innerRef?.current as HTMLButtonElement;
30-
}, []);
28+
React.useImperativeHandle(
29+
ref,
30+
() => {
31+
return innerRef?.current as HTMLButtonElement;
32+
},
33+
[]
34+
);
3135

3236
const { state, setRef } = useManageState({
3337
states: Object.values(BackToTopStateType) as States,

src/components/calendar/list/list.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ export const List = ({
229229
styles={props.styles}
230230
>
231231
<ItemRove
232+
ariaDisabled={isDisabled}
232233
ariaLabel={formatDate(day, {
233234
weekday: 'long',
234235
year: 'numeric',

src/components/dot/dot.styled.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ export const DotStyled = styled.span<IDotStyled>`
1616
${props => getMeasuresStyles(props.sizeStyles.container)}
1717
${props => getTypographyStyles(props.sizeStyles.container)}
1818
${props => getTypographyStyles(props.styles.container)}
19+
width: ${props => props.$width};
20+
height: ${props => props.$height};
1921
`;

src/components/dot/dotStandAlone.tsx

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,25 @@ import { DotStyled } from './dot.styled';
44
import { IDotStandAlone } from './types/dot';
55

66
const DotStandAloneComponent = (
7-
{ formatedNumber, sizeStyles, styles, dataTestId = 'dot-standalone-test-id' }: IDotStandAlone,
7+
{
8+
formatedNumber,
9+
sizeStyles,
10+
styles,
11+
dataTestId = 'dot-standalone-test-id',
12+
height,
13+
width,
14+
}: IDotStandAlone,
815
ref: React.ForwardedRef<HTMLSpanElement> | undefined | null
916
): JSX.Element => {
1017
return (
11-
<DotStyled ref={ref} data-testid={dataTestId} sizeStyles={sizeStyles} styles={styles}>
18+
<DotStyled
19+
ref={ref}
20+
$height={height}
21+
$width={width}
22+
data-testid={dataTestId}
23+
sizeStyles={sizeStyles}
24+
styles={styles}
25+
>
1226
{formatedNumber}
1327
</DotStyled>
1428
);

src/components/dot/stories/argtypes.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,28 @@ export const argtypes = (variants: IThemeObjectVariants, themeSelected: string):
5757
category: CATEGORY_CONTROL.CONTENT,
5858
},
5959
},
60+
width: {
61+
control: { type: 'text' },
62+
type: { name: 'string' },
63+
description: 'Add width to the dot',
64+
table: {
65+
type: {
66+
summary: 'string',
67+
},
68+
category: CATEGORY_CONTROL.MODIFIERS,
69+
},
70+
},
71+
height: {
72+
control: { type: 'text' },
73+
type: { name: 'string' },
74+
description: 'Add height to the dot',
75+
table: {
76+
type: {
77+
summary: 'string',
78+
},
79+
category: CATEGORY_CONTROL.MODIFIERS,
80+
},
81+
},
6082
dataTestId: {
6183
control: { type: 'text' },
6284
type: { name: 'string' },

src/components/dot/types/dot.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { DotSizePropsType, DotVariantStylesType } from './dotTheme';
1010
export interface IDotStyled {
1111
styles: DotVariantStylesType;
1212
sizeStyles: DotSizePropsType;
13+
$width?: string;
14+
$height?: string;
1315
}
1416

1517
/**
@@ -21,6 +23,8 @@ export interface IDotStandAlone {
2123
styles: DotVariantStylesType;
2224
sizeStyles: DotSizePropsType;
2325
formatedNumber?: number | string;
26+
width?: string;
27+
height?: string;
2428
dataTestId?: string;
2529
}
2630

src/components/header/header.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,23 @@ import { useStyles } from '@/hooks/useStyles/useStyles';
66
import { ErrorBoundary, FallbackComponent } from '@/provider/errorBoundary';
77

88
import { HeaderStandAlone } from './headerStandAlone';
9+
import { useHeaderShadow } from './hook/useHeaderShadow';
910
import { HeaderPropsStylesType, IHeader, IHeaderStandAlone } from './types';
1011

1112
const HeaderComponent = React.forwardRef(
1213
<V extends string | unknown>(
13-
{ variant, ctv, ...props }: IHeader<V>,
14+
{ variant, ctv, showShadowFrom, ...props }: IHeader<V>,
1415
ref: React.ForwardedRef<HTMLDivElement> | undefined | null
1516
): JSX.Element => {
1617
const styles = useStyles<HeaderPropsStylesType, V>(STYLES_NAME.HEADER, variant, ctv);
1718
const device = useMediaDevice();
19+
const { box_shadow } = styles?.container?.scrollShadow || {};
20+
const { headerRef } = useHeaderShadow({
21+
ref,
22+
shadow: { boxShadow: box_shadow, showShadowFrom },
23+
});
1824

19-
return <HeaderStandAlone {...props} ref={ref} device={device} styles={styles} />;
25+
return <HeaderStandAlone {...props} ref={headerRef} device={device} styles={styles} />;
2026
}
2127
);
2228
HeaderComponent.displayName = 'HeaderComponent';

0 commit comments

Comments
 (0)