Skip to content

Commit 400ca99

Browse files
authored
Merge pull request #24 from kubit-ui/feature/new-v2-components-and-improvements
Feature/new v2 components and improvements
2 parents 5a70e1f + febe82d commit 400ca99

Some content is hidden

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

47 files changed

+1018
-38
lines changed

package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kubit-ui-web/react-components",
3-
"version": "1.8.3",
3+
"version": "1.9.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",
@@ -89,16 +89,16 @@
8989
"@eslint/compat": "^1.1.1",
9090
"@eslint/eslintrc": "^3.1.0",
9191
"@eslint/js": "^9.8.0",
92-
"@storybook/addon-a11y": "^8.2.6",
93-
"@storybook/addon-controls": "^8.2.6",
92+
"@storybook/addon-a11y": "^8.2.7",
93+
"@storybook/addon-controls": "^8.2.7",
9494
"@storybook/addon-coverage": "^1.0.4",
95-
"@storybook/addon-essentials": "^8.2.6",
96-
"@storybook/addon-interactions": "^8.2.6",
97-
"@storybook/addon-links": "^8.2.6",
98-
"@storybook/addon-themes": "^8.2.6",
99-
"@storybook/blocks": "^8.2.6",
100-
"@storybook/react": "^8.2.6",
101-
"@storybook/react-vite": "^8.2.6",
95+
"@storybook/addon-essentials": "^8.2.7",
96+
"@storybook/addon-interactions": "^8.2.7",
97+
"@storybook/addon-links": "^8.2.7",
98+
"@storybook/addon-themes": "^8.2.7",
99+
"@storybook/blocks": "^8.2.7",
100+
"@storybook/react": "^8.2.7",
101+
"@storybook/react-vite": "^8.2.7",
102102
"@testing-library/jest-dom": "^6.4.8",
103103
"@testing-library/react": "^16.0.0",
104104
"@testing-library/react-hooks": "^8.0.1",
@@ -111,8 +111,8 @@
111111
"@types/react-dom": "^18.3.0",
112112
"@types/styled-components": "^5.1.34",
113113
"@types/ungap__structured-clone": "^1.2.0",
114-
"@typescript-eslint/eslint-plugin": "^7.18.0",
115-
"@typescript-eslint/parser": "^7.18.0",
114+
"@typescript-eslint/eslint-plugin": "^8.0.0",
115+
"@typescript-eslint/parser": "^8.0.0",
116116
"@ungap/structured-clone": "^1.2.0",
117117
"@vitejs/plugin-react": "^4.3.1",
118118
"babel-jest": "^29.7.0",
@@ -122,9 +122,9 @@
122122
"eslint-config-standard-with-typescript": "^43.0.1",
123123
"eslint-import-resolver-typescript": "^3.6.1",
124124
"eslint-plugin-import": "^2.29.1",
125-
"eslint-plugin-jest": "^28.6.0",
125+
"eslint-plugin-jest": "^28.7.0",
126126
"eslint-plugin-jsx-a11y": "^6.9.0",
127-
"eslint-plugin-n": "^17.10.1",
127+
"eslint-plugin-n": "^17.10.2",
128128
"eslint-plugin-node": "^11.1.0",
129129
"eslint-plugin-prettier": "5.2.1",
130130
"eslint-plugin-promise": "^7.0.0",
@@ -133,7 +133,7 @@
133133
"eslint-plugin-react-refresh": "^0.4.9",
134134
"eslint-plugin-storybook": "^0.8.0",
135135
"eslint-plugin-unused-imports": "^4.0.1",
136-
"globals": "^15.8.0",
136+
"globals": "^15.9.0",
137137
"gts": "^5.3.1",
138138
"html-validate": "^8.21.0",
139139
"jest": "^29.7.0",
@@ -147,8 +147,8 @@
147147
"prettier": "^3.3.3",
148148
"react-transition-group": "^4.4.5",
149149
"sort-imports": "^1.1.0",
150-
"storybook": "^8.2.6",
151-
"ts-jest": "^29.2.3",
150+
"storybook": "^8.2.7",
151+
"ts-jest": "^29.2.4",
152152
"tsc-alias": "1.8.10",
153153
"typedoc": "^0.26.5",
154154
"typedoc-plugin-markdown": "^4.2.3",

src/components/button/buttonStandAlone.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ const ButtonStandAloneComponent = (
6969
data-testid={props.dataTestId}
7070
disabled={disabled}
7171
form={props.form}
72+
id={props.id}
7273
minWidth={props.minWidth}
7374
role={props.role}
7475
tabIndex={props.tabIndex}

src/components/button/stories/argtypes.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ export const argtypes = (variants: IThemeObjectVariants, themeSelected: string):
3535
category: CATEGORY_CONTROL.MODIFIERS,
3636
},
3737
},
38+
id: {
39+
control: { type: 'text' },
40+
type: { name: 'string' },
41+
description: 'Button id',
42+
table: {
43+
type: {
44+
summary: 'string',
45+
},
46+
category: CATEGORY_CONTROL.CONTENT,
47+
},
48+
},
3849
disabled: {
3950
description: 'Specifies if the button element is disabled or not',
4051
type: { name: 'boolean' },

src/components/button/stories/button.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const meta = {
1414
title: 'Components/Actions/Button',
1515
component: ButtonStory,
1616
parameters: {
17-
layout: 'centered',
17+
layout: 'fullscreen',
1818
githubUrl: 'https://github.com/kubit-ui/kubit-react-components/tree/main/src/components/button',
1919
figmaUrl:
2020
'https://www.figma.com/file/EYQkbENTFO5r8muvXlPoOy/Kubit-v.1.0.0?type=design&node-id=3922-9829',
@@ -31,6 +31,7 @@ export const Button: Story = {
3131
args: {
3232
variant: Object.values(variantsObject[themeSelected].ButtonVariantType || {})[0] as string,
3333
size: Object.values(variantsObject[themeSelected].ButtonSizeType || {})[0] as string,
34+
id: 'buttonId',
3435
children: 'Button',
3536
icon: {
3637
icon: ICONS.ICON_PLACEHOLDER,

src/components/button/types/button.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export interface IButtonStandAlone
6464
form?: string;
6565
role?: string | ROLES;
6666
title?: string;
67+
id?: string;
6768
}
6869

6970
/**

src/components/drawer/drawerControlled.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,7 @@ const SCROLL_DISTANCE = 5;
1717
const FOOTER_EDIT_STYLES: CssProperty[] = [
1818
{ cssPropertyName: 'position', cssPropertyValue: 'static' },
1919
];
20-
/* Constants for useZoomEffect (content) */
21-
const CONTENT_EDIT_STYLE: CssProperty[] = [
22-
{ cssPropertyName: 'height', cssPropertyValue: 'fit-content' },
23-
];
20+
2421
const MAX_ZOOM = 2.4;
2522

2623
const DrawerControlledComponent = React.forwardRef(
@@ -44,13 +41,11 @@ const DrawerControlledComponent = React.forwardRef(
4441
);
4542

4643
const footerRef = useZoomEffect(FOOTER_EDIT_STYLES, MAX_ZOOM);
47-
const contentRef = useZoomEffect(CONTENT_EDIT_STYLE, MAX_ZOOM);
4844

4945
const drawerStructure = (
5046
<DrawerStandAlone
5147
{...props}
5248
ref={ref}
53-
contentRef={contentRef}
5449
device={device}
5550
footerRef={footerRef}
5651
scrollableRef={scrollableRef}

src/components/drawer/types/drawer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export interface IDrawerStandAlone {
4141
scrollableRef: (node) => void;
4242
shadowRef: (node) => void;
4343
/* To useZoomEffect */
44-
footerRef: (node) => void;
45-
contentRef: (node) => void;
44+
footerRef?: (node) => void;
45+
contentRef?: (node) => void;
4646
}
4747

4848
type OmitProps = 'styles' | 'device' | 'scrollableRef' | 'shadowRef' | 'footerRef' | 'contentRef';

src/components/grid/grid.styled.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import styled, { css } from 'styled-components';
22

33
import { DeviceBreakpointsType } from '@/types/breakpoints';
4+
import { getStyles } from '@/utils';
45

56
import { ContentCustomGridItemType, CustomGridItemType, GridItemType, GridType } from './types';
67
import { getGridConfiguration, getItemGridConfiguration, getMaxWidth } from './utils/grid.utils';
@@ -10,6 +11,7 @@ export const GridStyled = styled.div<GridType>`
1011
margin: auto;
1112
${props =>
1213
({
14+
styles,
1315
theme: {
1416
MEDIA_QUERIES: { onlyTablet, onlyMobile, onlyDesktop },
1517
BREAKPOINTS,
@@ -27,15 +29,18 @@ export const GridStyled = styled.div<GridType>`
2729
)};
2830
padding: 0
2931
${props.addPaddingForLayout ? props.config?.[DeviceBreakpointsType.DESKTOP]?.gap : 0};
32+
${getStyles(styles)}
3033
}
3134
${onlyTablet} {
3235
${getGridConfiguration(props.config?.[DeviceBreakpointsType.TABLET])};
3336
margin: 0 ${props.config?.[DeviceBreakpointsType.TABLET]?.margin}rem;
37+
${getStyles(styles)}
3438
}
3539
3640
${onlyMobile} {
3741
${getGridConfiguration(props.config?.[DeviceBreakpointsType.MOBILE])};
3842
margin: 0 ${props.config?.[DeviceBreakpointsType.MOBILE]?.margin}rem;
43+
${getStyles(styles)}
3944
}
4045
`};
4146
`;

src/components/grid/types/grid.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import { DeviceBreakpointsType } from '@/types/breakpoints';
2+
import { CommonStyleType } from '@/types/styles/commonStyle';
23

34
export type GridType = {
45
addPaddingForLayout?: boolean;
56
isFullWidth?: boolean;
67
columnsPadding?: number;
8+
styles?: CommonStyleType;
79
config?: {
810
[DeviceBreakpointsType.DESKTOP]?: GridConfigType;
911
[DeviceBreakpointsType.TABLET]?: GridConfigType;
@@ -26,6 +28,9 @@ export type GridConfigType = {
2628
columns?: number;
2729
gap?: string;
2830
margin?: number;
31+
headerStyles?: CommonStyleType;
32+
mainStyles?: CommonStyleType;
33+
footerStyles?: CommonStyleType;
2934
};
3035

3136
export type CustomGridItemType = GridItemType & {

src/components/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from './image';
88
export * from './label';
99
export * from './link';
1010
export * from './pill';
11+
export * from './pillV2';
1112
export * from './popover';
1213
export * from './tagV2';
1314
export * from './text';

0 commit comments

Comments
 (0)