Skip to content

Commit dacf35f

Browse files
authored
Merge pull request #14 from kubit-ui/feature/improvements-and-new-components
Feature/improvements and new components
2 parents 3e2b1ec + ddc8842 commit dacf35f

File tree

162 files changed

+1010
-382
lines changed

Some content is hidden

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

162 files changed

+1010
-382
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Div } from '@storybook/components';
2+
import { addons, types } from '@storybook/manager-api';
3+
import { useParameter } from '@storybook/manager-api';
4+
5+
import React from 'react';
6+
7+
const ADDON_ID = 'myaddon/status';
8+
const PARAM_KEY = 'status';
9+
10+
addons.register(ADDON_ID, () => {
11+
addons.add(ADDON_ID, {
12+
title: 'Status',
13+
type: types.TOOL,
14+
match: ({ viewMode }) => viewMode === 'story',
15+
render: () => {
16+
const status = useParameter(PARAM_KEY, '#');
17+
18+
if (status === '#') {
19+
return null;
20+
}
21+
22+
if (status === 'DEPRECATED') {
23+
return (
24+
<Div
25+
style={{
26+
backgroundColor: 'rgb(223, 43, 81)',
27+
color: '#FFF',
28+
padding: '5px 15px',
29+
fontWeight: 'bold',
30+
}}
31+
>
32+
Deprecated
33+
</Div>
34+
);
35+
}
36+
37+
return <Div></Div>;
38+
},
39+
});
40+
});

.storybook/main.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ const config: StorybookConfig = {
1414
'@storybook/addon-interactions',
1515
'@storybook/addon-a11y',
1616
'@storybook/addon-coverage',
17-
'./tokensAddons/register.tsx',
18-
'./figmaAddon/register.tsx',
19-
'./githubAddon/register.tsx',
17+
'./addons/tokensAddons/register.tsx',
18+
'./addons/figmaAddon/register.tsx',
19+
'./addons/githubAddon/register.tsx',
20+
'./addons/statusAddon/register.tsx',
2021
],
2122
framework: {
2223
name: '@storybook/react-vite',

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kubit-ui-web/react-components",
3-
"version": "1.5.0",
3+
"version": "1.5.1",
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",
@@ -27,7 +27,13 @@
2727
"dist",
2828
"package.json",
2929
"README.md",
30-
"LICENSE.md"
30+
"LICENSE.md",
31+
"!dist/cjs/assets",
32+
"!dist/esm/assets",
33+
"!dist/**/tests",
34+
"!dist/**/**/*.test.*",
35+
"!dist/**/storybook",
36+
"!dist/**/**/stories"
3137
],
3238
"keywords": [
3339
"web-components",

src/components/accordion/stories/argtypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TextComponentType } from '@/components/text';
2-
import { CATEGORY_CONTROL } from '@/constants';
2+
import { CATEGORY_CONTROL } from '@/constants/categoryControl';
33
import { IThemeObjectVariants } from '@/designSystem/themesObject';
44
import { ArgTypesReturn } from '@/types';
55

src/components/actionBottomSheet/actionBottomSheet.styled.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ type IActionBottomSheetStyles = {
1313
styles?: CommonStyleType;
1414
};
1515

16-
export const ActionBottomSheetSyled = styled.div<IActionBottomSheetStyles & { $height?: string }>`
16+
export const ActionBottomSheetStyled = styled.div<IActionBottomSheetStyles & { $height?: string }>`
1717
max-height: 100vh;
18+
max-height: var(--100svh, 100vh);
19+
max-height: 100svh;
1820
${props => getStyles(props.styles)}
1921
height: ${({ $height }) => $height};
2022
`;
@@ -49,6 +51,8 @@ export const ActionBottomSheetContentStyled = styled.div<IActionBottomSheetStyle
4951
${({ theme: { MEDIA_QUERIES } }) => css`
5052
${MEDIA_QUERIES?.mobileAndTablet} {
5153
max-height: 100vh;
54+
max-height: var(--100svh, 100vh);
55+
max-height: 100svh;
5256
}
5357
`}
5458
`;

src/components/actionBottomSheet/actionBottomSheetControlled.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react';
22

33
import { PopoverControlled as Popover } from '@/components/popover';
44
import { STYLES_NAME } from '@/constants';
5-
import { useId, useMediaDevice, useScrollEffect } from '@/hooks';
5+
import { useDeviceHeight, useId, useMediaDevice, useScrollEffect } from '@/hooks';
66
import { useStyles } from '@/hooks/useStyles/useStyles';
77
import { ErrorBoundary, FallbackComponent } from '@/provider/errorBoundary';
88
import { DeviceBreakpointsType } from '@/types';
@@ -22,6 +22,7 @@ const ActionBottomSheetControlledStructureComponent = React.forwardRef(
2222
{ variant, ctv, ...props }: IActionBottomSheetControlledStructure<V>,
2323
ref: React.ForwardedRef<HTMLDivElement> | undefined | null
2424
): JSX.Element => {
25+
useDeviceHeight();
2526
const styles = useStyles<ActionBottomSheetVariantStylesType, V>(
2627
STYLES_NAME.ACTION_BOTTOM_SHEET,
2728
variant,

src/components/actionBottomSheet/actionBottomSheetStandAlone.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
ActionBottomSheetHeaderContentStyled,
99
ActionBottomSheetHeaderStyled,
1010
ActionBottomSheetIconSyled,
11-
ActionBottomSheetSyled,
11+
ActionBottomSheetStyled,
1212
ActionBottomSheetTitleSyled,
1313
} from './actionBottomSheet.styled';
1414
import { IActionBottomSheetStandAlone } from './types';
@@ -18,7 +18,7 @@ const ActionBottomSheetStandAloneComponent = (
1818
ref: React.ForwardedRef<HTMLDivElement> | undefined | null
1919
): JSX.Element => {
2020
return (
21-
<ActionBottomSheetSyled
21+
<ActionBottomSheetStyled
2222
ref={ref}
2323
$height={props.height}
2424
data-testid={`${props.dataTestId}Container`}
@@ -53,7 +53,7 @@ const ActionBottomSheetStandAloneComponent = (
5353
<ActionBottomSheetContentStyled ref={scrollableRef} styles={props.styles.content}>
5454
{props.children}
5555
</ActionBottomSheetContentStyled>
56-
</ActionBottomSheetSyled>
56+
</ActionBottomSheetStyled>
5757
);
5858
};
5959

0 commit comments

Comments
 (0)