@postenbring/hedwig-react 4.0.1 → 4.1.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/blockquote/blockquote.d.ts +4 -11
- package/dist/blockquote/blockquote.d.ts.map +1 -1
- package/dist/blockquote/blockquote.js.map +1 -1
- package/dist/blockquote/blockquote.mjs +1 -1
- package/dist/blockquote/index.js.map +1 -1
- package/dist/blockquote/index.mjs +1 -1
- package/dist/button/button.d.ts +5 -2
- package/dist/button/button.d.ts.map +1 -1
- package/dist/button/button.js.map +1 -1
- package/dist/button/button.mjs +1 -1
- package/dist/button/index.js.map +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/card/card.d.ts +1 -1
- package/dist/card/card.js +1 -1
- package/dist/card/card.js.map +1 -1
- package/dist/card/card.mjs +1 -1
- package/dist/card/index.js +1 -1
- package/dist/card/index.js.map +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/{chunk-TYCGAA35.mjs → chunk-45Q2TCH6.mjs} +1 -1
- package/dist/chunk-45Q2TCH6.mjs.map +1 -0
- package/dist/{chunk-3VKESN3T.mjs → chunk-6BDVJ3J2.mjs} +2 -2
- package/dist/{chunk-N4W3OMA2.mjs → chunk-7T2GDVFS.mjs} +2 -2
- package/dist/{chunk-YNGU3V4J.mjs → chunk-B4D2GO6E.mjs} +2 -2
- package/dist/chunk-BOPY5K4T.mjs +1 -0
- package/dist/chunk-CAIGPMDS.mjs +1 -0
- package/dist/chunk-CAIGPMDS.mjs.map +1 -0
- package/dist/{chunk-NBEGX26X.mjs → chunk-IZFODQCF.mjs} +2 -2
- package/dist/{chunk-6OJINZ37.mjs → chunk-JFTUBOIF.mjs} +2 -2
- package/dist/chunk-JFTUBOIF.mjs.map +1 -0
- package/dist/{chunk-JYN2QSN2.mjs → chunk-NZB6BBFT.mjs} +1 -1
- package/dist/chunk-NZB6BBFT.mjs.map +1 -0
- package/dist/{chunk-W6CFPK2C.mjs → chunk-SF6EDUHP.mjs} +2 -1
- package/dist/chunk-SF6EDUHP.mjs.map +1 -0
- package/dist/{chunk-BFM6UZGI.mjs → chunk-TTDR3NZL.mjs} +2 -2
- package/dist/chunk-TTDR3NZL.mjs.map +1 -0
- package/dist/{chunk-NUP7ZBVE.mjs → chunk-UYLKAPXD.mjs} +2 -2
- package/dist/{chunk-F7MLQ6JI.mjs → chunk-WNYCOHSD.mjs} +11 -2
- package/dist/{chunk-F7MLQ6JI.mjs.map → chunk-WNYCOHSD.mjs.map} +1 -1
- package/dist/{chunk-J35DWEJX.mjs → chunk-Z56XN4AZ.mjs} +2 -2
- package/dist/chunk-ZIVURWHY.mjs +30 -0
- package/dist/chunk-ZIVURWHY.mjs.map +1 -0
- package/dist/footer/footer.js.map +1 -1
- package/dist/footer/footer.mjs +2 -2
- package/dist/footer/index.js.map +1 -1
- package/dist/footer/index.mjs +2 -2
- package/dist/form/date-picker/date-picker.js +1 -1
- package/dist/form/date-picker/date-picker.js.map +1 -1
- package/dist/form/date-picker/date-picker.mjs +2 -2
- package/dist/form/date-picker/index.js +1 -1
- package/dist/form/date-picker/index.js.map +1 -1
- package/dist/form/date-picker/index.mjs +2 -2
- package/dist/form/error-summary/error-summary.d.ts.map +1 -1
- package/dist/form/error-summary/error-summary.js +10 -1
- package/dist/form/error-summary/error-summary.js.map +1 -1
- package/dist/form/error-summary/error-summary.mjs +1 -1
- package/dist/form/error-summary/index.js +10 -1
- package/dist/form/error-summary/index.js.map +1 -1
- package/dist/form/error-summary/index.mjs +1 -1
- package/dist/form/index.d.ts +1 -0
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +45 -14
- package/dist/form/index.js.map +1 -1
- package/dist/form/index.mjs +15 -10
- package/dist/form/input/index.js +1 -1
- package/dist/form/input/index.js.map +1 -1
- package/dist/form/input/index.mjs +2 -2
- package/dist/form/input/input.js +1 -1
- package/dist/form/input/input.js.map +1 -1
- package/dist/form/input/input.mjs +2 -2
- package/dist/form/input-group/index.js +1 -1
- package/dist/form/input-group/index.js.map +1 -1
- package/dist/form/input-group/index.mjs +1 -1
- package/dist/form/input-group/input-group.d.ts +1 -1
- package/dist/form/input-group/input-group.d.ts.map +1 -1
- package/dist/form/input-group/input-group.js +1 -1
- package/dist/form/input-group/input-group.js.map +1 -1
- package/dist/form/input-group/input-group.mjs +1 -1
- package/dist/form/search-wrapper/index.d.ts +3 -0
- package/dist/form/search-wrapper/index.d.ts.map +1 -0
- package/dist/form/search-wrapper/index.js +79 -0
- package/dist/form/search-wrapper/index.js.map +1 -0
- package/dist/form/search-wrapper/index.mjs +9 -0
- package/dist/form/search-wrapper/index.mjs.map +1 -0
- package/dist/form/search-wrapper/search-wrapper.d.ts +9 -0
- package/dist/form/search-wrapper/search-wrapper.d.ts.map +1 -0
- package/dist/form/search-wrapper/search-wrapper.js +77 -0
- package/dist/form/search-wrapper/search-wrapper.js.map +1 -0
- package/dist/form/search-wrapper/search-wrapper.mjs +8 -0
- package/dist/form/search-wrapper/search-wrapper.mjs.map +1 -0
- package/dist/form/select/index.js +1 -1
- package/dist/form/select/index.js.map +1 -1
- package/dist/form/select/index.mjs +2 -2
- package/dist/form/select/select.js +1 -1
- package/dist/form/select/select.js.map +1 -1
- package/dist/form/select/select.mjs +2 -2
- package/dist/form/textarea/index.js +1 -1
- package/dist/form/textarea/index.js.map +1 -1
- package/dist/form/textarea/index.mjs +2 -2
- package/dist/form/textarea/textarea.js +1 -1
- package/dist/form/textarea/textarea.js.map +1 -1
- package/dist/form/textarea/textarea.mjs +2 -2
- package/dist/index.js +284 -252
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +35 -30
- package/dist/layout/index.mjs +7 -7
- package/dist/navbar/index.js +1 -0
- package/dist/navbar/index.js.map +1 -1
- package/dist/navbar/index.mjs +2 -2
- package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -1
- package/dist/navbar/navbar-expandable-menu.js +1 -0
- package/dist/navbar/navbar-expandable-menu.js.map +1 -1
- package/dist/navbar/navbar-expandable-menu.mjs +1 -1
- package/dist/navbar/navbar.js +1 -0
- package/dist/navbar/navbar.js.map +1 -1
- package/dist/navbar/navbar.mjs +2 -2
- package/package.json +2 -2
- package/src/accordion/accordion.stories.tsx +13 -20
- package/src/alert/alert.stories.tsx +1 -1
- package/src/badge/badge.stories.tsx +1 -1
- package/src/blockquote/blockquote.stories.tsx +1 -1
- package/src/blockquote/blockquote.tsx +4 -12
- package/src/box/box.stories.tsx +1 -1
- package/src/breadcrumbs/breadcrumbs.stories.tsx +1 -1
- package/src/button/button.stories.tsx +1 -1
- package/src/button/button.tsx +6 -2
- package/src/button-list/button-list.stories.tsx +1 -1
- package/src/card/card.stories.tsx +10 -9
- package/src/card/card.tsx +2 -2
- package/src/description-list/description-list.stories.tsx +1 -1
- package/src/figure/figure.stories.tsx +1 -1
- package/src/form/checkbox/checkbox.stories.tsx +1 -1
- package/src/form/date-picker/date-picker.stories.tsx +1 -1
- package/src/form/error-message/error-message.stories.tsx +1 -1
- package/src/form/error-summary/error-summary.stories.tsx +1 -1
- package/src/form/error-summary/error-summary.tsx +6 -1
- package/src/form/fieldset/fieldset.stories.tsx +1 -1
- package/src/form/index.tsx +1 -0
- package/src/form/input/input.stories.tsx +1 -1
- package/src/form/input-group/input-group.tsx +10 -8
- package/src/form/radio-button/radio-button.stories.tsx +1 -1
- package/src/form/radio-button/radio-group.stories.tsx +1 -1
- package/src/form/search-wrapper/index.tsx +2 -0
- package/src/form/search-wrapper/search-wrapper.stories.tsx +34 -0
- package/src/form/search-wrapper/search-wrapper.tsx +29 -0
- package/src/form/select/select.stories.tsx +1 -1
- package/src/form/textarea/textarea.stories.tsx +1 -1
- package/src/help-text/help-text.stories.tsx +1 -1
- package/src/layout/container/container.stories.tsx +1 -1
- package/src/layout/grid/grid.stories.tsx +1 -1
- package/src/layout/stack/stack.stories.tsx +1 -1
- package/src/link/link.stories.tsx +1 -1
- package/src/list/link-list.stories.tsx +1 -1
- package/src/list/list.stories.tsx +1 -1
- package/src/message/message.stories.tsx +1 -1
- package/src/modal/modal.stories.tsx +5 -9
- package/src/navbar/navbar-expandable-menu.tsx +1 -0
- package/src/navbar/navbar.stories.tsx +1 -1
- package/src/show-more/show-more.stories.tsx +1 -1
- package/src/skeleton/skeleton.stories.tsx +1 -1
- package/src/spinner/spinner.stories.tsx +1 -1
- package/src/step-indicator/step-indicator.stories.tsx +1 -1
- package/src/styled-html/styled-html.stories.tsx +1 -1
- package/src/table/table.stories.tsx +1 -1
- package/src/tabs/tabs.stories.tsx +1 -1
- package/src/text/text.stories.tsx +1 -1
- package/src/warning-banner/warning-banner.stories.tsx +1 -1
- package/dist/chunk-6OJINZ37.mjs.map +0 -1
- package/dist/chunk-BFM6UZGI.mjs.map +0 -1
- package/dist/chunk-IJSEJZ3W.mjs +0 -1
- package/dist/chunk-JYN2QSN2.mjs.map +0 -1
- package/dist/chunk-TYCGAA35.mjs.map +0 -1
- package/dist/chunk-W6CFPK2C.mjs.map +0 -1
- /package/dist/{chunk-3VKESN3T.mjs.map → chunk-6BDVJ3J2.mjs.map} +0 -0
- /package/dist/{chunk-N4W3OMA2.mjs.map → chunk-7T2GDVFS.mjs.map} +0 -0
- /package/dist/{chunk-YNGU3V4J.mjs.map → chunk-B4D2GO6E.mjs.map} +0 -0
- /package/dist/{chunk-IJSEJZ3W.mjs.map → chunk-BOPY5K4T.mjs.map} +0 -0
- /package/dist/{chunk-NBEGX26X.mjs.map → chunk-IZFODQCF.mjs.map} +0 -0
- /package/dist/{chunk-NUP7ZBVE.mjs.map → chunk-UYLKAPXD.mjs.map} +0 -0
- /package/dist/{chunk-J35DWEJX.mjs.map → chunk-Z56XN4AZ.mjs.map} +0 -0
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
-
import { Link } from "../link";
|
|
4
|
-
import { UnorderedList } from "../list";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
5
3
|
import { Accordion } from ".";
|
|
6
4
|
|
|
7
5
|
const meta: Meta<typeof Accordion> = {
|
|
@@ -19,28 +17,23 @@ export const Preview: Story = {
|
|
|
19
17
|
children: (
|
|
20
18
|
<>
|
|
21
19
|
<Accordion.Item>
|
|
22
|
-
<Accordion.Header>
|
|
20
|
+
<Accordion.Header>Can the mail be forwarded abroad?</Accordion.Header>
|
|
23
21
|
<Accordion.Content>
|
|
24
|
-
|
|
22
|
+
Yes, with some limitations. Shipments of items cannot be forwarded abroad due to customs
|
|
23
|
+
declaration.
|
|
24
|
+
</Accordion.Content>
|
|
25
|
+
</Accordion.Item>
|
|
26
|
+
<Accordion.Item defaultOpen>
|
|
27
|
+
<Accordion.Header>Will all mail be forwarded to new address?</Accordion.Header>
|
|
28
|
+
<Accordion.Content>
|
|
29
|
+
All types of addressed mail distributed through Posten will be forwarded. Within Norway,
|
|
30
|
+
it also applies to items sent in letters.
|
|
25
31
|
</Accordion.Content>
|
|
26
32
|
</Accordion.Item>
|
|
27
33
|
<Accordion.Item>
|
|
28
|
-
<Accordion.Header>
|
|
34
|
+
<Accordion.Header>How do I change my order?</Accordion.Header>
|
|
29
35
|
<Accordion.Content>
|
|
30
|
-
|
|
31
|
-
<div>
|
|
32
|
-
<p>
|
|
33
|
-
This is some really, really exciting stuff with{" "}
|
|
34
|
-
<Link href="https://www.posten.no">a link</Link> and all sorts of things like a
|
|
35
|
-
list, even!
|
|
36
|
-
</p>
|
|
37
|
-
<UnorderedList>
|
|
38
|
-
<li>Unordered</li>
|
|
39
|
-
<li>Like</li>
|
|
40
|
-
<li>You have</li>
|
|
41
|
-
<li>Never seen</li>
|
|
42
|
-
</UnorderedList>
|
|
43
|
-
</div>
|
|
36
|
+
Sign in to My address or call customer service at 22 03 00 00.
|
|
44
37
|
</Accordion.Content>
|
|
45
38
|
</Accordion.Item>
|
|
46
39
|
</>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { Blockquote } from ".";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Blockquote> = {
|
|
@@ -2,6 +2,9 @@ import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
|
2
2
|
import { Slot } from "@radix-ui/react-slot";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated This interface is deprecated and will be removed in a future release.
|
|
7
|
+
*/
|
|
5
8
|
export interface BlockquoteProps extends React.HTMLAttributes<HTMLQuoteElement> {
|
|
6
9
|
children?: React.ReactNode;
|
|
7
10
|
|
|
@@ -19,18 +22,7 @@ export interface BlockquoteProps extends React.HTMLAttributes<HTMLQuoteElement>
|
|
|
19
22
|
*/
|
|
20
23
|
asChild?: boolean;
|
|
21
24
|
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* @example
|
|
25
|
-
*
|
|
26
|
-
* ```tsx
|
|
27
|
-
* <Blockquote>
|
|
28
|
-
* <p>... but they’ll never take our freedom!</p>
|
|
29
|
-
* <footer>William Wallace</footer>
|
|
30
|
-
* </Blockquote>
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
25
|
+
/** @deprecated This component is deprecated and will be removed in a future release. */
|
|
34
26
|
export const Blockquote = forwardRef<HTMLQuoteElement, BlockquoteProps>(
|
|
35
27
|
({ children, asChild, className, variant, ...rest }, ref) => {
|
|
36
28
|
const Component = asChild ? Slot : "blockquote";
|
package/src/box/box.stories.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { Text } from "../text";
|
|
4
4
|
import { Link } from "../link";
|
|
5
5
|
import { Box } from ".";
|
package/src/button/button.tsx
CHANGED
|
@@ -2,6 +2,11 @@ import { forwardRef } from "react";
|
|
|
2
2
|
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
3
3
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The "inverted" variant is deprecated. Use "primary", "secondary", or "tertiary" instead.
|
|
7
|
+
*/
|
|
8
|
+
export type DeprecatedVariant = "inverted";
|
|
9
|
+
|
|
5
10
|
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
11
|
/**
|
|
7
12
|
* The height, font size and padding of the button
|
|
@@ -15,7 +20,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
15
20
|
*
|
|
16
21
|
* @default "primary"
|
|
17
22
|
*/
|
|
18
|
-
variant?: "primary" | "secondary" | "tertiary" |
|
|
23
|
+
variant?: "primary" | "secondary" | "tertiary" | DeprecatedVariant;
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
26
|
* Make the button use 100% width available.
|
|
@@ -47,7 +52,6 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
47
52
|
* @example
|
|
48
53
|
* <Button variant="primary">Primary</Button>
|
|
49
54
|
* <Button variant="secondary" size="large">Secondary</Button>
|
|
50
|
-
* <Button variant="inverted">Inverted</Button>
|
|
51
55
|
* <Button variant="tertiary" fullWidth="mobile">Tertiary</Button>
|
|
52
56
|
* <Button icon="leading"><LeadingIcon />Leading icon</Button>
|
|
53
57
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { Link } from "../link";
|
|
3
4
|
import { Card } from ".";
|
|
4
5
|
|
|
5
6
|
const meta: Meta<typeof Card> = {
|
|
@@ -25,17 +26,17 @@ export const Preview: Story = {
|
|
|
25
26
|
<Card.Body>
|
|
26
27
|
<Card.BodyHeader as="h2">
|
|
27
28
|
<Card.BodyHeaderOverline>Theme</Card.BodyHeaderOverline>
|
|
28
|
-
<Card.BodyHeaderTitle
|
|
29
|
-
<a href="#article">Cool article</a>
|
|
30
|
-
</Card.BodyHeaderTitle>
|
|
29
|
+
<Card.BodyHeaderTitle>Cool article</Card.BodyHeaderTitle>
|
|
31
30
|
</Card.BodyHeader>
|
|
32
31
|
<Card.BodyDescription>
|
|
33
|
-
This is a card
|
|
34
|
-
<code>Link</code> component, or a link component from your routing library. The link
|
|
35
|
-
component of your choice should be set with the <code>as</code> property on the body
|
|
36
|
-
header title. The card component provides a lot of flexibility.
|
|
32
|
+
This is a card The card component provides a lot of flexibility.
|
|
37
33
|
</Card.BodyDescription>
|
|
38
|
-
<Card.
|
|
34
|
+
<Card.BodyAction asChild>
|
|
35
|
+
<Link href="#article-1" variant="solid">
|
|
36
|
+
<Card.BodyActionArrow />
|
|
37
|
+
Go to this article
|
|
38
|
+
</Link>
|
|
39
|
+
</Card.BodyAction>
|
|
39
40
|
</Card.Body>
|
|
40
41
|
</Card>
|
|
41
42
|
),
|
package/src/card/card.tsx
CHANGED
|
@@ -29,7 +29,7 @@ export interface CardImageMediaProps extends React.ImgHTMLAttributes<HTMLImageEl
|
|
|
29
29
|
* "scale": No cropping, image scales to the maximum size available and centers.
|
|
30
30
|
* If the aspect ratio doesn't match, then the background will show on the top/bottom or left/right sides of the image.
|
|
31
31
|
*
|
|
32
|
-
* @default "
|
|
32
|
+
* @default "scale"
|
|
33
33
|
*/
|
|
34
34
|
variant?: "crop" | "scale";
|
|
35
35
|
}
|
|
@@ -41,7 +41,7 @@ export const CardMediaImg = forwardRef<HTMLImageElement, CardImageMediaProps>(
|
|
|
41
41
|
{...rest}
|
|
42
42
|
className={clsx(
|
|
43
43
|
"hds-card__media__img",
|
|
44
|
-
{ "hds-
|
|
44
|
+
{ "hds-card__img__crop": variant === "crop" },
|
|
45
45
|
className as undefined,
|
|
46
46
|
)}
|
|
47
47
|
ref={ref}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { DescriptionList } from ".";
|
|
4
4
|
|
|
5
5
|
type Story = StoryObj<typeof DescriptionList>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { Checkbox } from "./index";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Checkbox> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { DatePicker } from ".";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof DatePicker> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { ErrorMessage } from ".";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof ErrorMessage> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { ErrorSummary } from ".";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof ErrorSummary> = {
|
|
@@ -129,7 +129,12 @@ export type ErrorSummaryProps = Omit<
|
|
|
129
129
|
|
|
130
130
|
export const ErrorSummary = forwardRef<HTMLDivElement, ErrorSummaryProps>(
|
|
131
131
|
({ children, className, ...rest }, ref) => (
|
|
132
|
-
<Box
|
|
132
|
+
<Box
|
|
133
|
+
data-color="error"
|
|
134
|
+
ref={ref}
|
|
135
|
+
{...rest}
|
|
136
|
+
className={clsx(`hds-error-summary`, className as undefined)}
|
|
137
|
+
>
|
|
133
138
|
{children}
|
|
134
139
|
</Box>
|
|
135
140
|
),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { Checkbox } from "../checkbox";
|
|
4
4
|
import { Fieldset } from ".";
|
|
5
5
|
|
package/src/form/index.tsx
CHANGED
|
@@ -18,7 +18,7 @@ export interface InputGroupProps {
|
|
|
18
18
|
errorMessage?: ReactNode;
|
|
19
19
|
errorMessageProps?: Partial<ErrorMessageProps>;
|
|
20
20
|
labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
|
|
21
|
-
label
|
|
21
|
+
label?: ReactNode;
|
|
22
22
|
disabled?: boolean;
|
|
23
23
|
readOnly?: boolean;
|
|
24
24
|
/**
|
|
@@ -88,13 +88,15 @@ export const InputGroup = forwardRef<HTMLDivElement, InputGroupProps>(function I
|
|
|
88
88
|
style={style}
|
|
89
89
|
{...rest}
|
|
90
90
|
>
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
{label !== null && label !== undefined && label !== false && (
|
|
92
|
+
<label
|
|
93
|
+
className={clsx("hds-input-group__label", labelClassName as undefined)}
|
|
94
|
+
{...labelProps}
|
|
95
|
+
htmlFor={id ?? inputId}
|
|
96
|
+
>
|
|
97
|
+
{label}
|
|
98
|
+
</label>
|
|
99
|
+
)}
|
|
98
100
|
<div
|
|
99
101
|
className={clsx("hds-input-group__input-wrapper")}
|
|
100
102
|
data-disabled={disabled}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { RadioButton } from "./index";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof RadioButton> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { RadioGroup } from "./radio-group";
|
|
4
4
|
import { RadioButton } from "./index";
|
|
5
5
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
|
+
import { Input } from "../input";
|
|
4
|
+
import { Button } from "../../button";
|
|
5
|
+
import { SearchWrapper } from ".";
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof SearchWrapper> = {
|
|
8
|
+
title: "Form/Search wrapper",
|
|
9
|
+
component: SearchWrapper,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
function XmarkIcon() {
|
|
15
|
+
return (
|
|
16
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
|
|
17
|
+
<path d="M183.1 137.4C170.6 124.9 150.3 124.9 137.8 137.4C125.3 149.9 125.3 170.2 137.8 182.7L275.2 320L137.9 457.4C125.4 469.9 125.4 490.2 137.9 502.7C150.4 515.2 170.7 515.2 183.2 502.7L320.5 365.3L457.9 502.6C470.4 515.1 490.7 515.1 503.2 502.6C515.7 490.1 515.7 469.8 503.2 457.3L365.8 320L503.1 182.6C515.6 170.1 515.6 149.8 503.1 137.3C490.6 124.8 470.3 124.8 457.8 137.3L320.5 274.7L183.1 137.4z" />
|
|
18
|
+
</svg>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
type Story = StoryObj<typeof SearchWrapper>;
|
|
22
|
+
|
|
23
|
+
export const Preview: Story = {
|
|
24
|
+
tags: ["!dev"],
|
|
25
|
+
render: () => (
|
|
26
|
+
<SearchWrapper>
|
|
27
|
+
<Input name="name" />
|
|
28
|
+
<Button>Search</Button>
|
|
29
|
+
<Button variant="tertiary" icon>
|
|
30
|
+
<XmarkIcon />
|
|
31
|
+
</Button>
|
|
32
|
+
</SearchWrapper>
|
|
33
|
+
),
|
|
34
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { forwardRef } from "react";
|
|
2
|
+
import type { ReactNode, CSSProperties } from "react";
|
|
3
|
+
import { clsx } from "@postenbring/hedwig-css/typed-classname";
|
|
4
|
+
|
|
5
|
+
export interface SearchWrapperProps {
|
|
6
|
+
id?: string;
|
|
7
|
+
className?: string;
|
|
8
|
+
style?: CSSProperties;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const SearchWrapper = forwardRef<HTMLDivElement, SearchWrapperProps>(function SearchWrapper(
|
|
13
|
+
{ id, className, style, children, ...rest },
|
|
14
|
+
ref,
|
|
15
|
+
) {
|
|
16
|
+
return (
|
|
17
|
+
<div
|
|
18
|
+
id={id}
|
|
19
|
+
className={clsx("hds-search-wrapper", className as undefined)}
|
|
20
|
+
ref={ref}
|
|
21
|
+
style={style}
|
|
22
|
+
{...rest}
|
|
23
|
+
>
|
|
24
|
+
{children}
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
SearchWrapper.displayName = "SearchWrapper";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { HelpText } from ".";
|
|
4
4
|
|
|
5
5
|
type Story = StoryObj<typeof HelpText>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { useState, useEffect, useRef, useId } from "react";
|
|
4
4
|
import { Container, Grid } from "..";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { Link } from "../link";
|
|
4
4
|
import { LinkList } from "./link-list";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { StoryObj, Meta } from "@storybook/react";
|
|
2
|
+
import type { StoryObj, Meta } from "@storybook/react-vite";
|
|
3
3
|
import { HStack } from "../layout";
|
|
4
4
|
import { UnorderedList } from ".";
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { Button } from "../button";
|
|
5
5
|
import { HStack } from "../layout";
|
|
@@ -17,26 +17,22 @@ export const Preview: Story = {
|
|
|
17
17
|
tags: ["!dev"],
|
|
18
18
|
render: function Render(args) {
|
|
19
19
|
const modalRef = useRef<HTMLDialogElement>(null);
|
|
20
|
-
const onClose = () => modalRef.current?.close();
|
|
21
20
|
const onMainAction = () => modalRef.current?.close();
|
|
22
21
|
|
|
23
22
|
return (
|
|
24
23
|
<>
|
|
25
24
|
<Button onClick={() => modalRef.current?.showModal()}>Open Modal</Button>
|
|
26
25
|
<Modal ref={modalRef} {...args}>
|
|
27
|
-
<Modal.Header>
|
|
26
|
+
<Modal.Header>Case registered</Modal.Header>
|
|
28
27
|
<Modal.Content>
|
|
29
28
|
<p>
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
Your case has been registered. Reference number: #123456 something about the
|
|
30
|
+
consequences.
|
|
32
31
|
</p>
|
|
33
32
|
</Modal.Content>
|
|
34
33
|
<Modal.Footer>
|
|
35
34
|
<HStack gap="16" wrap>
|
|
36
|
-
<Button onClick={onMainAction}>
|
|
37
|
-
<Button variant="secondary" onClick={onClose}>
|
|
38
|
-
Cancel
|
|
39
|
-
</Button>
|
|
35
|
+
<Button onClick={onMainAction}>OK</Button>
|
|
40
36
|
</HStack>
|
|
41
37
|
</Modal.Footer>
|
|
42
38
|
</Modal>
|
|
@@ -97,6 +97,7 @@ export const NavbarExpandableMenuTrigger = forwardRef<
|
|
|
97
97
|
<button
|
|
98
98
|
aria-expanded={open}
|
|
99
99
|
aria-controls={contentId}
|
|
100
|
+
aria-label={open ? whenOpenHelperTitle : whenClosedHelperTitle}
|
|
100
101
|
className={clsx(
|
|
101
102
|
"hds-navbar__item",
|
|
102
103
|
className as undefined,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
2
|
|
|
3
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
3
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
4
4
|
import { ShowMoreButton } from ".";
|
|
5
5
|
|
|
6
6
|
const meta: Meta<typeof ShowMoreButton> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { StepIndicator } from ".";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof StepIndicator> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/no-extraneous-dependencies -- storybook story */
|
|
2
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import type { Meta, StoryObj } from "@storybook/react-vite";
|
|
3
3
|
import { StyledHtml } from ".";
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof StyledHtml> = {
|