@hyphen/hyphen-components 6.12.1 → 6.15.1
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/dist/components/Alert/Alert.d.ts +3 -12
- package/dist/components/Alert/Alert.stories.d.ts +8 -4
- package/dist/components/Badge/Badge.stories.d.ts +5 -5
- package/dist/components/Button/Button.stories.d.ts +13 -13
- package/dist/components/Modal/components/ModalHeader/ModalHeader.d.ts +6 -1
- package/dist/hyphen-components.cjs.development.js +145 -128
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +146 -129
- package/dist/hyphen-components.esm.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Alert/Alert.constants.ts +0 -1
- package/src/components/Alert/Alert.stories.tsx +102 -47
- package/src/components/Alert/Alert.test.tsx +2 -66
- package/src/components/Alert/Alert.tsx +78 -65
- package/src/components/Badge/Badge.stories.tsx +69 -22
- package/src/components/Button/Button.stories.tsx +265 -127
- package/src/components/Modal/Modal.stories.tsx +3 -1
- package/src/components/Modal/components/ModalHeader/ModalHeader.tsx +27 -9
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { ReactNode, MouseEvent, KeyboardEvent } from 'react';
|
|
2
2
|
import { AlertVariant } from './Alert.types';
|
|
3
3
|
export interface AlertProps {
|
|
4
4
|
/**
|
|
5
5
|
* Custom class to apply to the alert.
|
|
6
6
|
*/
|
|
7
7
|
className?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Custom text to use as a close button.
|
|
10
|
-
*/
|
|
11
|
-
closeText?: string;
|
|
12
8
|
/**
|
|
13
9
|
* Whether the alert as an icon that corresponds to its variant (Success, warning, etc.).
|
|
14
10
|
*/
|
|
15
11
|
hasIcon?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Whether the alert can be closed by the user. If `true` it will render
|
|
18
|
-
* the 'close' icon on the right hand side of the alert.
|
|
19
|
-
*/
|
|
20
|
-
isClosable?: boolean;
|
|
21
12
|
/**
|
|
22
13
|
* Renders a version of the alert with smaller padding.
|
|
23
14
|
*/
|
|
24
15
|
isCompact?: boolean;
|
|
25
16
|
/**
|
|
26
|
-
* The text message or ReactNode to be rendered in the alert.
|
|
17
|
+
* @deprecated Use children instead. The text message or ReactNode to be rendered in the alert.
|
|
27
18
|
*/
|
|
28
19
|
message?: string | ReactNode;
|
|
29
20
|
/**
|
|
@@ -48,4 +39,4 @@ export interface AlertProps {
|
|
|
48
39
|
*/
|
|
49
40
|
[x: string]: any;
|
|
50
41
|
}
|
|
51
|
-
export declare const Alert:
|
|
42
|
+
export declare const Alert: React.NamedExoticComponent<AlertProps>;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { Alert } from './Alert';
|
|
2
|
-
import type { Meta } from '@storybook/react-vite';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
declare const meta: Meta<typeof Alert>;
|
|
5
5
|
export default meta;
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
6
|
+
type Story = StoryObj<typeof Alert>;
|
|
7
|
+
export declare const Overview: Story;
|
|
8
|
+
export declare const Compact: Story;
|
|
9
|
+
export declare const WithCustomContent: Story;
|
|
10
|
+
export declare const Variants: Story;
|
|
11
|
+
export declare const ClosableAlert: () => React.JSX.Element;
|
|
12
|
+
export declare const Closable: Story;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Meta } from '@storybook/react-vite';
|
|
2
1
|
import { Badge } from './Badge';
|
|
3
|
-
import
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
3
|
declare const meta: Meta<typeof Badge>;
|
|
5
4
|
export default meta;
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
5
|
+
type Story = StoryObj<typeof Badge>;
|
|
6
|
+
export declare const Overview: Story;
|
|
7
|
+
export declare const Variants: Story;
|
|
8
|
+
export declare const Sizes: Story;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { Button } from './Button';
|
|
3
|
-
import type { Meta } from '@storybook/react-vite';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
4
3
|
declare const meta: Meta<typeof Button>;
|
|
5
4
|
export default meta;
|
|
6
|
-
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
12
|
-
export declare const
|
|
13
|
-
export declare const
|
|
14
|
-
export declare const
|
|
15
|
-
export declare const
|
|
16
|
-
export declare const
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AsChild: Story;
|
|
8
|
+
export declare const Variants: Story;
|
|
9
|
+
export declare const Sizes: Story;
|
|
10
|
+
export declare const FullWidth: Story;
|
|
11
|
+
export declare const Icons: Story;
|
|
12
|
+
export declare const IconButton: Story;
|
|
13
|
+
export declare const Loading: Story;
|
|
14
|
+
export declare const Disabled: Story;
|
|
15
|
+
export declare const Shadow: Story;
|
|
16
|
+
export declare const InlineLink: Story;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { FC } from 'react';
|
|
2
|
-
|
|
2
|
+
import { BoxProps } from '../../../Box/Box';
|
|
3
|
+
export type ModalHeaderProps = Omit<BoxProps, 'as' | 'radius' | 'justifyContent'> & {
|
|
3
4
|
/**
|
|
4
5
|
* id of the element containing the title, used by the Modal `aria-labelledby` prop
|
|
5
6
|
*/
|
|
@@ -8,6 +9,10 @@ export type ModalHeaderProps = {
|
|
|
8
9
|
* Modal's header title
|
|
9
10
|
*/
|
|
10
11
|
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Additional content to render in the modal header, displayed alongside the title.
|
|
14
|
+
*/
|
|
15
|
+
children?: React.ReactNode;
|
|
11
16
|
/**
|
|
12
17
|
* If defined, will render a 'x' close button on the right side of the ModalHeader
|
|
13
18
|
*/
|