@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.
Files changed (180) hide show
  1. package/dist/blockquote/blockquote.d.ts +4 -11
  2. package/dist/blockquote/blockquote.d.ts.map +1 -1
  3. package/dist/blockquote/blockquote.js.map +1 -1
  4. package/dist/blockquote/blockquote.mjs +1 -1
  5. package/dist/blockquote/index.js.map +1 -1
  6. package/dist/blockquote/index.mjs +1 -1
  7. package/dist/button/button.d.ts +5 -2
  8. package/dist/button/button.d.ts.map +1 -1
  9. package/dist/button/button.js.map +1 -1
  10. package/dist/button/button.mjs +1 -1
  11. package/dist/button/index.js.map +1 -1
  12. package/dist/button/index.mjs +1 -1
  13. package/dist/card/card.d.ts +1 -1
  14. package/dist/card/card.js +1 -1
  15. package/dist/card/card.js.map +1 -1
  16. package/dist/card/card.mjs +1 -1
  17. package/dist/card/index.js +1 -1
  18. package/dist/card/index.js.map +1 -1
  19. package/dist/card/index.mjs +1 -1
  20. package/dist/{chunk-TYCGAA35.mjs → chunk-45Q2TCH6.mjs} +1 -1
  21. package/dist/chunk-45Q2TCH6.mjs.map +1 -0
  22. package/dist/{chunk-3VKESN3T.mjs → chunk-6BDVJ3J2.mjs} +2 -2
  23. package/dist/{chunk-N4W3OMA2.mjs → chunk-7T2GDVFS.mjs} +2 -2
  24. package/dist/{chunk-YNGU3V4J.mjs → chunk-B4D2GO6E.mjs} +2 -2
  25. package/dist/chunk-BOPY5K4T.mjs +1 -0
  26. package/dist/chunk-CAIGPMDS.mjs +1 -0
  27. package/dist/chunk-CAIGPMDS.mjs.map +1 -0
  28. package/dist/{chunk-NBEGX26X.mjs → chunk-IZFODQCF.mjs} +2 -2
  29. package/dist/{chunk-6OJINZ37.mjs → chunk-JFTUBOIF.mjs} +2 -2
  30. package/dist/chunk-JFTUBOIF.mjs.map +1 -0
  31. package/dist/{chunk-JYN2QSN2.mjs → chunk-NZB6BBFT.mjs} +1 -1
  32. package/dist/chunk-NZB6BBFT.mjs.map +1 -0
  33. package/dist/{chunk-W6CFPK2C.mjs → chunk-SF6EDUHP.mjs} +2 -1
  34. package/dist/chunk-SF6EDUHP.mjs.map +1 -0
  35. package/dist/{chunk-BFM6UZGI.mjs → chunk-TTDR3NZL.mjs} +2 -2
  36. package/dist/chunk-TTDR3NZL.mjs.map +1 -0
  37. package/dist/{chunk-NUP7ZBVE.mjs → chunk-UYLKAPXD.mjs} +2 -2
  38. package/dist/{chunk-F7MLQ6JI.mjs → chunk-WNYCOHSD.mjs} +11 -2
  39. package/dist/{chunk-F7MLQ6JI.mjs.map → chunk-WNYCOHSD.mjs.map} +1 -1
  40. package/dist/{chunk-J35DWEJX.mjs → chunk-Z56XN4AZ.mjs} +2 -2
  41. package/dist/chunk-ZIVURWHY.mjs +30 -0
  42. package/dist/chunk-ZIVURWHY.mjs.map +1 -0
  43. package/dist/footer/footer.js.map +1 -1
  44. package/dist/footer/footer.mjs +2 -2
  45. package/dist/footer/index.js.map +1 -1
  46. package/dist/footer/index.mjs +2 -2
  47. package/dist/form/date-picker/date-picker.js +1 -1
  48. package/dist/form/date-picker/date-picker.js.map +1 -1
  49. package/dist/form/date-picker/date-picker.mjs +2 -2
  50. package/dist/form/date-picker/index.js +1 -1
  51. package/dist/form/date-picker/index.js.map +1 -1
  52. package/dist/form/date-picker/index.mjs +2 -2
  53. package/dist/form/error-summary/error-summary.d.ts.map +1 -1
  54. package/dist/form/error-summary/error-summary.js +10 -1
  55. package/dist/form/error-summary/error-summary.js.map +1 -1
  56. package/dist/form/error-summary/error-summary.mjs +1 -1
  57. package/dist/form/error-summary/index.js +10 -1
  58. package/dist/form/error-summary/index.js.map +1 -1
  59. package/dist/form/error-summary/index.mjs +1 -1
  60. package/dist/form/index.d.ts +1 -0
  61. package/dist/form/index.d.ts.map +1 -1
  62. package/dist/form/index.js +45 -14
  63. package/dist/form/index.js.map +1 -1
  64. package/dist/form/index.mjs +15 -10
  65. package/dist/form/input/index.js +1 -1
  66. package/dist/form/input/index.js.map +1 -1
  67. package/dist/form/input/index.mjs +2 -2
  68. package/dist/form/input/input.js +1 -1
  69. package/dist/form/input/input.js.map +1 -1
  70. package/dist/form/input/input.mjs +2 -2
  71. package/dist/form/input-group/index.js +1 -1
  72. package/dist/form/input-group/index.js.map +1 -1
  73. package/dist/form/input-group/index.mjs +1 -1
  74. package/dist/form/input-group/input-group.d.ts +1 -1
  75. package/dist/form/input-group/input-group.d.ts.map +1 -1
  76. package/dist/form/input-group/input-group.js +1 -1
  77. package/dist/form/input-group/input-group.js.map +1 -1
  78. package/dist/form/input-group/input-group.mjs +1 -1
  79. package/dist/form/search-wrapper/index.d.ts +3 -0
  80. package/dist/form/search-wrapper/index.d.ts.map +1 -0
  81. package/dist/form/search-wrapper/index.js +79 -0
  82. package/dist/form/search-wrapper/index.js.map +1 -0
  83. package/dist/form/search-wrapper/index.mjs +9 -0
  84. package/dist/form/search-wrapper/index.mjs.map +1 -0
  85. package/dist/form/search-wrapper/search-wrapper.d.ts +9 -0
  86. package/dist/form/search-wrapper/search-wrapper.d.ts.map +1 -0
  87. package/dist/form/search-wrapper/search-wrapper.js +77 -0
  88. package/dist/form/search-wrapper/search-wrapper.js.map +1 -0
  89. package/dist/form/search-wrapper/search-wrapper.mjs +8 -0
  90. package/dist/form/search-wrapper/search-wrapper.mjs.map +1 -0
  91. package/dist/form/select/index.js +1 -1
  92. package/dist/form/select/index.js.map +1 -1
  93. package/dist/form/select/index.mjs +2 -2
  94. package/dist/form/select/select.js +1 -1
  95. package/dist/form/select/select.js.map +1 -1
  96. package/dist/form/select/select.mjs +2 -2
  97. package/dist/form/textarea/index.js +1 -1
  98. package/dist/form/textarea/index.js.map +1 -1
  99. package/dist/form/textarea/index.mjs +2 -2
  100. package/dist/form/textarea/textarea.js +1 -1
  101. package/dist/form/textarea/textarea.js.map +1 -1
  102. package/dist/form/textarea/textarea.mjs +2 -2
  103. package/dist/index.js +284 -252
  104. package/dist/index.js.map +1 -1
  105. package/dist/index.mjs +35 -30
  106. package/dist/layout/index.mjs +7 -7
  107. package/dist/navbar/index.js +1 -0
  108. package/dist/navbar/index.js.map +1 -1
  109. package/dist/navbar/index.mjs +2 -2
  110. package/dist/navbar/navbar-expandable-menu.d.ts.map +1 -1
  111. package/dist/navbar/navbar-expandable-menu.js +1 -0
  112. package/dist/navbar/navbar-expandable-menu.js.map +1 -1
  113. package/dist/navbar/navbar-expandable-menu.mjs +1 -1
  114. package/dist/navbar/navbar.js +1 -0
  115. package/dist/navbar/navbar.js.map +1 -1
  116. package/dist/navbar/navbar.mjs +2 -2
  117. package/package.json +2 -2
  118. package/src/accordion/accordion.stories.tsx +13 -20
  119. package/src/alert/alert.stories.tsx +1 -1
  120. package/src/badge/badge.stories.tsx +1 -1
  121. package/src/blockquote/blockquote.stories.tsx +1 -1
  122. package/src/blockquote/blockquote.tsx +4 -12
  123. package/src/box/box.stories.tsx +1 -1
  124. package/src/breadcrumbs/breadcrumbs.stories.tsx +1 -1
  125. package/src/button/button.stories.tsx +1 -1
  126. package/src/button/button.tsx +6 -2
  127. package/src/button-list/button-list.stories.tsx +1 -1
  128. package/src/card/card.stories.tsx +10 -9
  129. package/src/card/card.tsx +2 -2
  130. package/src/description-list/description-list.stories.tsx +1 -1
  131. package/src/figure/figure.stories.tsx +1 -1
  132. package/src/form/checkbox/checkbox.stories.tsx +1 -1
  133. package/src/form/date-picker/date-picker.stories.tsx +1 -1
  134. package/src/form/error-message/error-message.stories.tsx +1 -1
  135. package/src/form/error-summary/error-summary.stories.tsx +1 -1
  136. package/src/form/error-summary/error-summary.tsx +6 -1
  137. package/src/form/fieldset/fieldset.stories.tsx +1 -1
  138. package/src/form/index.tsx +1 -0
  139. package/src/form/input/input.stories.tsx +1 -1
  140. package/src/form/input-group/input-group.tsx +10 -8
  141. package/src/form/radio-button/radio-button.stories.tsx +1 -1
  142. package/src/form/radio-button/radio-group.stories.tsx +1 -1
  143. package/src/form/search-wrapper/index.tsx +2 -0
  144. package/src/form/search-wrapper/search-wrapper.stories.tsx +34 -0
  145. package/src/form/search-wrapper/search-wrapper.tsx +29 -0
  146. package/src/form/select/select.stories.tsx +1 -1
  147. package/src/form/textarea/textarea.stories.tsx +1 -1
  148. package/src/help-text/help-text.stories.tsx +1 -1
  149. package/src/layout/container/container.stories.tsx +1 -1
  150. package/src/layout/grid/grid.stories.tsx +1 -1
  151. package/src/layout/stack/stack.stories.tsx +1 -1
  152. package/src/link/link.stories.tsx +1 -1
  153. package/src/list/link-list.stories.tsx +1 -1
  154. package/src/list/list.stories.tsx +1 -1
  155. package/src/message/message.stories.tsx +1 -1
  156. package/src/modal/modal.stories.tsx +5 -9
  157. package/src/navbar/navbar-expandable-menu.tsx +1 -0
  158. package/src/navbar/navbar.stories.tsx +1 -1
  159. package/src/show-more/show-more.stories.tsx +1 -1
  160. package/src/skeleton/skeleton.stories.tsx +1 -1
  161. package/src/spinner/spinner.stories.tsx +1 -1
  162. package/src/step-indicator/step-indicator.stories.tsx +1 -1
  163. package/src/styled-html/styled-html.stories.tsx +1 -1
  164. package/src/table/table.stories.tsx +1 -1
  165. package/src/tabs/tabs.stories.tsx +1 -1
  166. package/src/text/text.stories.tsx +1 -1
  167. package/src/warning-banner/warning-banner.stories.tsx +1 -1
  168. package/dist/chunk-6OJINZ37.mjs.map +0 -1
  169. package/dist/chunk-BFM6UZGI.mjs.map +0 -1
  170. package/dist/chunk-IJSEJZ3W.mjs +0 -1
  171. package/dist/chunk-JYN2QSN2.mjs.map +0 -1
  172. package/dist/chunk-TYCGAA35.mjs.map +0 -1
  173. package/dist/chunk-W6CFPK2C.mjs.map +0 -1
  174. /package/dist/{chunk-3VKESN3T.mjs.map → chunk-6BDVJ3J2.mjs.map} +0 -0
  175. /package/dist/{chunk-N4W3OMA2.mjs.map → chunk-7T2GDVFS.mjs.map} +0 -0
  176. /package/dist/{chunk-YNGU3V4J.mjs.map → chunk-B4D2GO6E.mjs.map} +0 -0
  177. /package/dist/{chunk-IJSEJZ3W.mjs.map → chunk-BOPY5K4T.mjs.map} +0 -0
  178. /package/dist/{chunk-NBEGX26X.mjs.map → chunk-IZFODQCF.mjs.map} +0 -0
  179. /package/dist/{chunk-NUP7ZBVE.mjs.map → chunk-UYLKAPXD.mjs.map} +0 -0
  180. /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>Professional accordion title</Accordion.Header>
20
+ <Accordion.Header>Can the mail be forwarded abroad?</Accordion.Header>
23
21
  <Accordion.Content>
24
- This is the simplest form of accordion body. Can be extensive.
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>Yet another POAT with &laquo;advanced&raquo; content</Accordion.Header>
34
+ <Accordion.Header>How do I change my order?</Accordion.Header>
29
35
  <Accordion.Content>
30
- <h4>Hello</h4>
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 { Alert } from ".";
4
4
 
5
5
  const meta: Meta<typeof Alert> = {
@@ -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 { Badge } from ".";
4
4
 
5
5
  const meta: Meta<typeof Badge> = {
@@ -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&rsquo;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";
@@ -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 ".";
@@ -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 { Breadcrumbs } 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 { Button } from ".";
4
4
 
5
5
  const meta: Meta<typeof Button> = {
@@ -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" | "inverted";
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,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 { Button } from "../button";
4
4
  import { ButtonList } from ".";
5
5
 
@@ -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 asChild>
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 which acts as a giant link. You can also use the hedwig provided{" "}
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.BodyActionArrow />
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 "crop"
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-card__img__scale": variant === "scale" },
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 { Figure } from ".";
4
4
 
5
5
  const meta: Meta<typeof Figure> = {
@@ -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 ref={ref} {...rest} className={clsx(`hds-error-summary`, className as undefined)}>
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
 
@@ -5,5 +5,6 @@ export * from "./error-summary";
5
5
  export * from "./fieldset";
6
6
  export * from "./input";
7
7
  export * from "./radio-button";
8
+ export * from "./search-wrapper";
8
9
  export * from "./select";
9
10
  export * from "./textarea";
@@ -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 { Input } from ".";
4
4
 
5
5
  const meta: Meta<typeof Input> = {
@@ -18,7 +18,7 @@ export interface InputGroupProps {
18
18
  errorMessage?: ReactNode;
19
19
  errorMessageProps?: Partial<ErrorMessageProps>;
20
20
  labelProps?: LabelHTMLAttributes<HTMLLabelElement>;
21
- label: ReactNode;
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
- <label
92
- className={clsx("hds-input-group__label", labelClassName as undefined)}
93
- {...labelProps}
94
- htmlFor={id ?? inputId}
95
- >
96
- {label}
97
- </label>
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,2 @@
1
+ export { SearchWrapper } from "./search-wrapper";
2
+ export type * from "./search-wrapper";
@@ -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 { Select } from ".";
4
4
 
5
5
  const meta: Meta<typeof Select> = {
@@ -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 { Textarea } from ".";
4
4
 
5
5
  const meta: Meta<typeof Textarea> = {
@@ -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 { Box } from "../../box";
4
4
  import { 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 { Box } from "../../box";
4
4
  import { Stack } 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 ".";
4
4
 
5
5
  const meta: Meta<typeof Link> = {
@@ -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 { Message } from ".";
4
4
 
5
5
  const meta: Meta<typeof Message> = {
@@ -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>Dialog header</Modal.Header>
26
+ <Modal.Header>Case registered</Modal.Header>
28
27
  <Modal.Content>
29
28
  <p>
30
- Dialog header Dialog description - a description of what is about to happen and maybe
31
- something about the consequences.
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}>Main action</Button>
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,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 { Navbar } from ".";
4
4
 
5
5
  const meta: Meta<typeof Navbar> = {
@@ -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 { VStack } from "../layout";
4
4
  import { Skeleton } 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 { Spinner } from ".";
4
4
 
5
5
  const meta: Meta<typeof Spinner> = {
@@ -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> = {
@@ -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 { Table } from ".";
4
4
 
5
5
  type Story = StoryObj<typeof Table>;
@@ -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 { Tabs } from ".";
4
4
 
5
5
  type Story = StoryObj<typeof Tabs>;
@@ -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 { VStack } from "../layout";
4
4
  import { Text } from ".";
5
5