@midas-ds/components 8.0.0 → 8.2.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/accordion/AccordionItem.d.ts +5 -2
  3. package/calendar/Calendar.d.ts +4 -4
  4. package/calendar/CalendarGrid.d.ts +6 -0
  5. package/calendar/CalendarHeader.d.ts +2 -0
  6. package/calendar/RangeCalendar.d.ts +4 -4
  7. package/calendar/index.d.ts +2 -2
  8. package/color-scheme-switch/ColorSchemeSwitch.d.ts +13 -0
  9. package/color-scheme-switch/index.d.ts +1 -0
  10. package/combobox/ComboBox.d.ts +2 -0
  11. package/combobox/index.d.ts +2 -1
  12. package/combobox/types.d.ts +3 -0
  13. package/combobox/utils.d.ts +8 -0
  14. package/date-field/DateField.d.ts +4 -4
  15. package/date-field/DateInput.d.ts +4 -0
  16. package/date-field/DateInputDivider.d.ts +2 -0
  17. package/date-field/DateSegment.d.ts +4 -0
  18. package/date-field/index.d.ts +4 -1
  19. package/date-picker/DatePicker.d.ts +4 -10
  20. package/date-picker/DatePickerInputField.d.ts +8 -0
  21. package/date-picker/DatePickerPopover.d.ts +6 -0
  22. package/date-picker/DateRangePicker.d.ts +9 -0
  23. package/date-picker/index.d.ts +2 -2
  24. package/index.cjs +44 -29
  25. package/index.css +1 -1
  26. package/index.d.ts +11 -9
  27. package/index.js +6335 -6044
  28. package/label/Label.d.ts +1 -1
  29. package/package.json +1 -1
  30. package/select/utils.d.ts +7 -0
  31. package/theme/index.d.ts +23 -17
  32. package/theme/tokens.d.ts +23 -17
  33. package/theme.cjs +1 -1
  34. package/theme.js +2 -2
  35. package/toggle-button/ToggleButton.d.ts +2 -0
  36. package/toggle-button/ToggleButtonGroup.d.ts +3 -0
  37. package/toggle-button/index.d.ts +2 -0
  38. package/tokens-CIuAmuws.cjs +1 -0
  39. package/{tokens-f_GueHFO.js → tokens-Dq5vcWLv.js} +43 -37
  40. package/tooltip/Tooltip.d.ts +1 -2
  41. package/utils/storybook.d.ts +4 -0
  42. package/utils/test.d.ts +7 -0
  43. package/tokens-BzHPOv0Z.cjs +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,35 @@
1
+ ## 8.2.0
2
+
3
+ ### 🚀 Features
4
+
5
+ - **theme:** add --icon-tertiary, new color for --icon-secondary ([f0ef381472](https://github.com/migrationsverket/midas/commit/f0ef381472))
6
+ - **label:** deprecate prop variant and add new css class ([42e33be662](https://github.com/migrationsverket/midas/commit/42e33be662))
7
+ - **tooltip:** allow locale agnostic tooltip placement ([#492](https://github.com/migrationsverket/midas/pull/492))
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - **accordion:** remove disabled styling if component has disabled children ([1c704b714d](https://github.com/migrationsverket/midas/commit/1c704b714d))
12
+ - **checkbox:** set correct line-height and adjust high contrast visibility ([6ca7ea9ba9](https://github.com/migrationsverket/midas/commit/6ca7ea9ba9))
13
+
14
+ ### Documentation Changes
15
+
16
+ - **propstable:** add support for enums in table ([#511](https://github.com/migrationsverket/midas/pull/511))
17
+ - **modal:** change arg types in storybook ([f9588f170b](https://github.com/migrationsverket/midas/commit/f9588f170b))
18
+
19
+ ## 8.1.0
20
+
21
+ ### 🚀 Features
22
+
23
+ - **accordion:** accordion status ✅ / 🚨 ([#485](https://github.com/migrationsverket/midas/pull/485))
24
+
25
+ ### 🩹 Fixes
26
+
27
+ - **theme:** add dark mode focus ([#483](https://github.com/migrationsverket/midas/pull/483))
28
+ - **modal:** make text in modal selectable ([#490](https://github.com/migrationsverket/midas/pull/490))
29
+ - **accordion:** rename invalid token ([e4b13c928](https://github.com/migrationsverket/midas/commit/e4b13c928))
30
+ - **select:** remove explicit size for indeterminate symbol ([5f805c134](https://github.com/migrationsverket/midas/commit/5f805c134))
31
+ - **select:** change checkbox size to prevent disappearing border ([3ab520633](https://github.com/migrationsverket/midas/commit/3ab520633))
32
+
1
33
  # 8.0.0
2
34
 
3
35
  ### 🚀 Features
@@ -1,11 +1,14 @@
1
- import { DisclosureProps, HeadingProps } from 'react-aria-components';
1
+ import { DisclosureProps } from 'react-aria-components';
2
+ import { HeadingProps } from '../heading';
2
3
  import * as React from 'react';
3
4
  interface MidasAccordionItem extends Omit<DisclosureProps, 'children'> {
4
5
  /** The text displayed in the collapsed state. If a ReactNode is proveded we're not adding a heading and you have to provide one yourself. */
5
6
  title?: string | React.ReactNode;
6
7
  children?: React.ReactNode;
7
8
  /** Adjust the titles heading level to your heading tag structure */
8
- headingLevel?: HeadingProps['level'];
9
+ headingLevel?: HeadingProps['elementType'];
10
+ /** Display an accordion item in different status states */
11
+ type?: 'default' | 'success' | 'warning';
9
12
  }
10
13
  export declare const AccordionItem: React.FC<MidasAccordionItem>;
11
14
  export {};
@@ -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';
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ export interface ColorSchemeSwitchProps {
3
+ /** Choose what element that should be affected by the scheme switch.
4
+ * @default body
5
+ */
6
+ selector?: string;
7
+ /** Set the default value for the color scheme. Default is "light dark" meaning follow system settings
8
+ *
9
+ * @default new Set(['light dark'])
10
+ */
11
+ defaultValue?: Set<'light' | 'dark' | 'light dark'>;
12
+ }
13
+ export declare const ColorSchemeSwitch: React.FC<ColorSchemeSwitchProps>;
@@ -0,0 +1 @@
1
+ export * from './ColorSchemeSwitch';
@@ -1,5 +1,6 @@
1
1
  import { default as React } from 'react';
2
2
  import { ComboBoxProps as AriaComboBoxProps, ListBoxItemProps, ValidationResult } from 'react-aria-components';
3
+ import { Item, Section } from './types';
3
4
  export interface ComboBoxProps<T extends object> extends Omit<AriaComboBoxProps<T>, 'children'> {
4
5
  label?: string;
5
6
  description?: string;
@@ -11,3 +12,4 @@ export interface ComboBoxProps<T extends object> extends Omit<AriaComboBoxProps<
11
12
  }
12
13
  export declare function ComboBox<T extends object>({ label, description, errorMessage, children, items, className, errorPosition, ...props }: ComboBoxProps<T>): import("react/jsx-runtime").JSX.Element;
13
14
  export declare function ComboBoxItem(props: ListBoxItemProps): import("react/jsx-runtime").JSX.Element;
15
+ export declare function ComboBoxSelection(props: Section<Item>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1,2 @@
1
- export { ComboBox, ComboBoxItem } from './ComboBox';
1
+ export { ComboBox, ComboBoxItem, ComboBoxSelection } from './ComboBox';
2
+ export type { Section, Item } from './types';
@@ -2,3 +2,6 @@ export type Item = {
2
2
  id: number;
3
3
  name: string;
4
4
  };
5
+ export type Section<T> = Item & {
6
+ children?: Iterable<T>;
7
+ };
@@ -1,2 +1,10 @@
1
1
  import { Item } from './types';
2
2
  export declare function generateMockOptions(count: number): Iterable<Item>;
3
+ export declare const optionsWithSections: {
4
+ name: string;
5
+ id: number;
6
+ children: {
7
+ name: string;
8
+ id: number;
9
+ }[];
10
+ }[];
@@ -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';