@midas-ds/components 8.2.0 → 9.0.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,39 @@
1
+ # 9.0.0
2
+
3
+ ### 🩹 Fixes
4
+
5
+ - **info-banner:** add correct line-height ([#540](https://github.com/migrationsverket/midas/pull/540))
6
+ - **grid:** prevent midas classnames to get overwritten ([#541](https://github.com/migrationsverket/midas/pull/541))
7
+ - **textfield:** merge textfield and input/textarea native dom props ([#499](https://github.com/migrationsverket/midas/pull/499))
8
+
9
+ ### Documentation Changes
10
+
11
+ - **toast:** fix local example in storybook ([#542](https://github.com/migrationsverket/midas/pull/542))
12
+
13
+ ## 8.3.0
14
+
15
+ ### 🚀 Features
16
+
17
+ - **theme:** use `--support-border-warning` instead of `--border-invalid` ([#518](https://github.com/migrationsverket/midas/pull/518))
18
+ - **textfield:** add medium size variant ([#520](https://github.com/migrationsverket/midas/pull/520))
19
+ - **layout:** change font weight for active menu item ([57e2485234](https://github.com/migrationsverket/midas/commit/57e2485234))
20
+ - **layout:** change background color for menu item ([d9ffc16bb6](https://github.com/migrationsverket/midas/commit/d9ffc16bb6))
21
+
22
+ ### 🩹 Fixes
23
+
24
+ - **modal:** adjust modal header when content is scollable ([#527](https://github.com/migrationsverket/midas/pull/527))
25
+ - **combobox:** add disabled color to the icon in disabled state ([9cd5657149](https://github.com/migrationsverket/midas/commit/9cd5657149))
26
+ - **select:** add disabled styling to description ([4cabb0c8ae](https://github.com/migrationsverket/midas/commit/4cabb0c8ae))
27
+ - **select:** change invalid border from 3px to 2 px ([834f1f8fdc](https://github.com/migrationsverket/midas/commit/834f1f8fdc))
28
+ - **accordion:** add a minimal padding to allow items with margin-bottom ([e0b2d8058b](https://github.com/migrationsverket/midas/commit/e0b2d8058b))
29
+ - **accordion:** remove padding bottom for last uncontained accordionitem ([463a7fa29e](https://github.com/migrationsverket/midas/commit/463a7fa29e))
30
+ - **textfield:** remove opacity from disabled ([0332d83cb6](https://github.com/migrationsverket/midas/commit/0332d83cb6))
31
+ - **textfield:** add border bottom in disabled and change ivalid border to 2px ([2bcd1d5beb](https://github.com/migrationsverket/midas/commit/2bcd1d5beb))
32
+
33
+ ### Documentation Changes
34
+
35
+ - improvements to preview 💅 🔍 ✨ ([#530](https://github.com/migrationsverket/midas/pull/530))
36
+
1
37
  ## 8.2.0
2
38
 
3
39
  ### 🚀 Features
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  React component library implementing Midas Design System (Migrationsverket)
4
4
 
5
- -----
5
+ ---
6
6
 
7
7
  ## Getting started
8
8
 
@@ -11,6 +11,7 @@ Add `@midas-ds/components` to your project:
11
11
  ```
12
12
  npm install @midas-ds/components
13
13
  ```
14
+
14
15
  And then import the components you need:
15
16
 
16
17
  ```
@@ -19,7 +20,6 @@ import {Button, Checkbox, etc} from '@midas-ds/components'
19
20
 
20
21
  ## Documentation
21
22
 
22
- * See the full design system documentation on [Midas](https://designsystem.migrationsverket.se/) (Swedish).
23
-
24
- * Component API documentation on [Storybook](https://designsystem.migrationsverket.se/storybook/).
23
+ - See the full design system documentation on [Midas](https://designsystem.migrationsverket.se/) (Swedish).
25
24
 
25
+ - Component API documentation on [Storybook](https://main--6810d578d5507438df0f0d22.chromatic.com).
@@ -4,7 +4,7 @@ export declare const ACCORDION_TEST_ID = "accordion";
4
4
  interface MidasAccordion extends DisclosureGroupProps {
5
5
  /** Display either the larger contained variant or a smaller uncontained variant */
6
6
  variant?: 'uncontained' | 'contained';
7
- /** @deprecated Use 'allowsMultipleExpanded' instead */
7
+ /** @deprecated since v8.0.0 Use 'allowsMultipleExpanded' instead */
8
8
  type?: 'single' | 'multiple';
9
9
  }
10
10
  /**
@@ -15,7 +15,7 @@ export interface MidasButtonProps {
15
15
  */
16
16
  fullwidth?: boolean;
17
17
  /** Choose between different button sizes */
18
- /** @deprecated This variant will be replaced with a new scaling api accross all components. */
18
+ /** @deprecated since v4.0.0 This variant will be replaced with a new scaling api accross all components. */
19
19
  size?: 'small';
20
20
  /** Add an icon from lucide-react
21
21
  *
package/card/Card.d.ts CHANGED
@@ -1,35 +1,32 @@
1
- import { Link, LinkProps, RouterProvider } from '../link/Link';
1
+ import { HeadingProps } from '../heading';
2
+ import { ButtonProps, Link } from 'react-aria-components';
2
3
  import * as React from 'react';
3
- export interface CardProps<C extends React.ElementType = typeof Link> extends React.HTMLAttributes<HTMLDivElement> {
4
- /** Optional image displayed at the top of card */
5
- image?: {
6
- source: string;
7
- description: string;
8
- };
9
- /** Sets background to predetermined color
10
- * @default false
11
- * @deprecated Not supported since v5.0.0
12
- * */
13
- background?: boolean;
14
- /** Header as h1 for the component rendered below image if there is one */
15
- title: string;
16
- /** Content as p element for the component */
17
- content: string;
18
- /** Props for when card element is clicked */
19
- link: LinkProps<C>;
20
- /** Adjust the tag to be used for the header
21
- * @default 'h1'
22
- */
23
- headingTag?: React.ElementType;
4
+ export interface MidasCard extends React.HTMLAttributes<HTMLDivElement> {
5
+ /** Stack content in card vertical or horizontal */
6
+ horizontal?: boolean;
7
+ /** Card content, usually wrap with CardContent */
8
+ children: React.ReactNode;
9
+ }
10
+ export interface MidasCardContext {
11
+ horizontal?: MidasCard['horizontal'];
12
+ titleId?: string;
13
+ }
14
+ export interface MidasCardImage {
24
15
  /** Custom image component to be used instead of the default img tag */
25
- customImageComponent?: React.ReactElement;
26
- /** Custom link component to be used instead of the default a tag. For example your client side router link. */
27
- customLinkComponent?: React.ElementType;
16
+ as?: React.ElementType;
17
+ className?: string;
18
+ [key: string]: unknown;
19
+ }
20
+ interface MidasCardLink<C extends React.ElementType> {
21
+ children: React.ReactNode;
22
+ as?: C;
28
23
  }
29
- /**
30
- * This component renders a card with optional image, title, content.
31
- *
32
- * @see {@link https://designsystem.migrationsverket.se/components/card/}
33
- */
34
- export declare const Card: React.FC<CardProps>;
35
- export { RouterProvider };
24
+ export type MidasCardLinkProps<C extends React.ElementType> = MidasCardLink<C> & Omit<React.ComponentProps<C>, keyof MidasCardLink<C>>;
25
+ export declare const Card: React.FC<MidasCard>;
26
+ export declare const CardContent: React.FC<React.HTMLAttributes<HTMLDivElement>>;
27
+ export declare const CardTitle: React.FC<HeadingProps>;
28
+ export declare const CardActions: React.FC<React.HTMLAttributes<HTMLDivElement>>;
29
+ export declare const CardActionArea: React.FC<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
30
+ export declare const CardImage: React.FC<MidasCardImage>;
31
+ export declare const CardLink: <C extends React.ElementType = (props: import('react-aria-components').LinkProps & React.RefAttributes<HTMLAnchorElement>) => React.ReactElement | null>({ children, as, ...rest }: MidasCardLinkProps<C>) => import("react/jsx-runtime").JSX.Element;
32
+ export {};