@midas-ds/components 8.1.0 → 8.3.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,45 @@
1
+ ## 8.3.0
2
+
3
+ ### 🚀 Features
4
+
5
+ - **theme:** use `--support-border-warning` instead of `--border-invalid` ([#518](https://github.com/migrationsverket/midas/pull/518))
6
+ - **textfield:** add medium size variant ([#520](https://github.com/migrationsverket/midas/pull/520))
7
+ - **layout:** change font weight for active menu item ([57e2485234](https://github.com/migrationsverket/midas/commit/57e2485234))
8
+ - **layout:** change background color for menu item ([d9ffc16bb6](https://github.com/migrationsverket/midas/commit/d9ffc16bb6))
9
+
10
+ ### 🩹 Fixes
11
+
12
+ - **modal:** adjust modal header when content is scollable ([#527](https://github.com/migrationsverket/midas/pull/527))
13
+ - **combobox:** add disabled color to the icon in disabled state ([9cd5657149](https://github.com/migrationsverket/midas/commit/9cd5657149))
14
+ - **select:** add disabled styling to description ([4cabb0c8ae](https://github.com/migrationsverket/midas/commit/4cabb0c8ae))
15
+ - **select:** change invalid border from 3px to 2 px ([834f1f8fdc](https://github.com/migrationsverket/midas/commit/834f1f8fdc))
16
+ - **accordion:** add a minimal padding to allow items with margin-bottom ([e0b2d8058b](https://github.com/migrationsverket/midas/commit/e0b2d8058b))
17
+ - **accordion:** remove padding bottom for last uncontained accordionitem ([463a7fa29e](https://github.com/migrationsverket/midas/commit/463a7fa29e))
18
+ - **textfield:** remove opacity from disabled ([0332d83cb6](https://github.com/migrationsverket/midas/commit/0332d83cb6))
19
+ - **textfield:** add border bottom in disabled and change ivalid border to 2px ([2bcd1d5beb](https://github.com/migrationsverket/midas/commit/2bcd1d5beb))
20
+
21
+ ### Documentation Changes
22
+
23
+ - improvements to preview 💅 🔍 ✨ ([#530](https://github.com/migrationsverket/midas/pull/530))
24
+
25
+ ## 8.2.0
26
+
27
+ ### 🚀 Features
28
+
29
+ - **theme:** add --icon-tertiary, new color for --icon-secondary ([f0ef381472](https://github.com/migrationsverket/midas/commit/f0ef381472))
30
+ - **label:** deprecate prop variant and add new css class ([42e33be662](https://github.com/migrationsverket/midas/commit/42e33be662))
31
+ - **tooltip:** allow locale agnostic tooltip placement ([#492](https://github.com/migrationsverket/midas/pull/492))
32
+
33
+ ### 🩹 Fixes
34
+
35
+ - **accordion:** remove disabled styling if component has disabled children ([1c704b714d](https://github.com/migrationsverket/midas/commit/1c704b714d))
36
+ - **checkbox:** set correct line-height and adjust high contrast visibility ([6ca7ea9ba9](https://github.com/migrationsverket/midas/commit/6ca7ea9ba9))
37
+
38
+ ### Documentation Changes
39
+
40
+ - **propstable:** add support for enums in table ([#511](https://github.com/migrationsverket/midas/pull/511))
41
+ - **modal:** change arg types in storybook ([f9588f170b](https://github.com/migrationsverket/midas/commit/f9588f170b))
42
+
1
43
  ## 8.1.0
2
44
 
3
45
  ### 🚀 Features
@@ -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
  *
@@ -1,6 +1,6 @@
1
- import { CalendarGridProps, CalendarProps, DateValue } from 'react-aria-components';
2
- interface MidasCalendarProps<T extends DateValue> extends CalendarProps<T>, Pick<CalendarGridProps, 'weekdayStyle'> {
1
+ import { CalendarProps as AriaCalendarProps, DateValue } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ export interface CalendarProps extends AriaCalendarProps<DateValue> {
3
4
  errorMessage?: string;
4
5
  }
5
- export declare function Calendar<T extends DateValue>({ errorMessage, weekdayStyle, className, ...props }: MidasCalendarProps<T>): import("react/jsx-runtime").JSX.Element;
6
- export {};
6
+ export declare const Calendar: React.FC<CalendarProps>;
@@ -0,0 +1,6 @@
1
+ import { CalendarGridProps as AriaCalendarGridProps } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ export interface CalendarGridProps {
4
+ weekdayStyle?: AriaCalendarGridProps['weekdayStyle'];
5
+ }
6
+ export declare const CalendarGrid: React.FC<CalendarGridProps>;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const CalendarHeader: React.FC;
@@ -1,6 +1,6 @@
1
- import { CalendarGridProps, RangeCalendarProps, DateValue } from 'react-aria-components';
2
- interface MidasCalendarProps<T extends DateValue> extends RangeCalendarProps<T>, Pick<CalendarGridProps, 'weekdayStyle'> {
1
+ import { DateValue, RangeCalendarProps as AriaRangeCalendarProps } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ export interface RangeCalendarProps extends AriaRangeCalendarProps<DateValue> {
3
4
  errorMessage?: string;
4
5
  }
5
- export declare function RangeCalendar<T extends DateValue>({ errorMessage, weekdayStyle, className, ...props }: MidasCalendarProps<T>): import("react/jsx-runtime").JSX.Element;
6
- export {};
6
+ export declare const RangeCalendar: React.FC<RangeCalendarProps>;
@@ -1,2 +1,2 @@
1
- export { Calendar } from './Calendar';
2
- export { RangeCalendar } from './RangeCalendar';
1
+ export * from './Calendar';
2
+ export * from './RangeCalendar';
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 {};
@@ -1,9 +1,9 @@
1
1
  import { DateFieldProps as AriaDateFieldProps, DateValue, ValidationResult } from 'react-aria-components';
2
- interface DateFieldProps<T extends DateValue> extends AriaDateFieldProps<T> {
3
- label?: string;
2
+ import * as React from 'react';
3
+ export interface DateFieldProps extends AriaDateFieldProps<DateValue> {
4
4
  description?: string;
5
5
  errorMessage?: string | ((validation: ValidationResult) => string);
6
6
  errorPosition?: 'top' | 'bottom';
7
+ label?: string;
7
8
  }
8
- export declare function DateField<T extends DateValue>({ label, description, errorMessage, className, errorPosition, ...props }: DateFieldProps<T>): import("react/jsx-runtime").JSX.Element;
9
- export {};
9
+ export declare const DateField: React.FC<DateFieldProps>;
@@ -0,0 +1,4 @@
1
+ import { DateInputProps } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ export type { DateInputProps };
4
+ export declare const DateInput: React.FC<DateInputProps>;
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export declare const DateInputDivider: React.FC;
@@ -0,0 +1,4 @@
1
+ import { DateSegmentProps } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ export type { DateSegmentProps };
4
+ export declare const DateSegment: React.FC<DateSegmentProps>;
@@ -1 +1,4 @@
1
- export { DateField } from './DateField';
1
+ export * from './DateField';
2
+ export * from './DateSegment';
3
+ export * from './DateInput';
4
+ export * from './DateInputDivider';
@@ -1,16 +1,10 @@
1
- import { DatePickerProps, DateRangePickerProps, DateValue, ValidationResult } from 'react-aria-components';
2
- interface MidasDateRangePickerProps<T extends DateValue> extends DateRangePickerProps<T> {
3
- label?: string;
1
+ import { DatePickerProps as AriaDatePickerProps, DateValue, ValidationResult } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ interface DatePickerProps extends AriaDatePickerProps<DateValue> {
4
4
  description?: string;
5
5
  errorMessage?: string | ((validation: ValidationResult) => string);
6
6
  errorPosition?: 'top' | 'bottom';
7
- }
8
- export declare const DateRangePicker: <T extends DateValue>({ label, description, errorMessage, errorPosition, ...props }: MidasDateRangePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
9
- interface MidasDatePickerProps<T extends DateValue> extends DatePickerProps<T> {
10
7
  label?: string;
11
- description?: string;
12
- errorMessage?: string | ((validation: ValidationResult) => string);
13
- errorPosition?: 'top' | 'bottom';
14
8
  }
15
- export declare const DatePicker: <T extends DateValue>({ label, description, errorMessage, errorPosition, ...props }: MidasDatePickerProps<T>) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const DatePicker: React.FC<DatePickerProps>;
16
10
  export {};
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ interface DatePickerInputFieldProps {
3
+ children?: React.ReactNode;
4
+ isDisabled?: boolean;
5
+ isInvalid?: boolean;
6
+ }
7
+ export declare const DatePickerInputField: React.FC<DatePickerInputFieldProps>;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ interface DatePickerPopoverProps {
3
+ children?: React.ReactNode;
4
+ }
5
+ export declare const DatePickerPopover: React.ForwardRefExoticComponent<DatePickerPopoverProps & React.RefAttributes<HTMLDivElement>>;
6
+ export {};
@@ -0,0 +1,9 @@
1
+ import { DateRangePickerProps as AriaDateRangePickerProps, DateValue, ValidationResult } from 'react-aria-components';
2
+ import * as React from 'react';
3
+ export interface DateRangePickerProps extends AriaDateRangePickerProps<DateValue> {
4
+ description?: string;
5
+ errorMessage?: string | ((validation: ValidationResult) => string);
6
+ errorPosition?: 'top' | 'bottom';
7
+ label?: string;
8
+ }
9
+ export declare const DateRangePicker: React.FC<DateRangePickerProps>;
@@ -1,2 +1,2 @@
1
- export { DatePicker } from './DatePicker';
2
- export { DateRangePicker } from './DatePicker';
1
+ export * from './DatePicker';
2
+ export * from './DateRangePicker';