@midas-ds/components 16.8.6 → 17.0.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 (70) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/accordion/Accordion.d.ts +0 -4
  3. package/accordion/AccordionContext.d.ts +2 -2
  4. package/accordion/index.d.ts +0 -1
  5. package/assets/DateRangePicker.css +1 -1
  6. package/assets/Text.css +1 -1
  7. package/breadcrumbs/Breadcrumbs.d.ts +0 -6
  8. package/breadcrumbs/index.js +1 -1
  9. package/calendar/index.js +1 -1
  10. package/checkbox/index.js +1 -1
  11. package/chunks/Breadcrumb-CHldDcyz.js +37 -0
  12. package/chunks/{CheckboxGroup-DSXCj_ho.js → CheckboxGroup-DooCBqUG.js} +2 -2
  13. package/chunks/ComboBox-XaJDIr5h.js +101 -0
  14. package/chunks/{DateField-zdUv4ooW.js → DateField-6CclHfL2.js} +2 -2
  15. package/chunks/{DateRangePicker-D6lnN0ox.js → DateRangePicker-BoL-sn9u.js} +54 -54
  16. package/chunks/{FieldError-C_3uLAGY.js → FieldError-BMTrvSof.js} +1 -1
  17. package/chunks/ListBoxHeader-CL9bFH22.js +63 -0
  18. package/chunks/ListBoxPopover-DOmhA5xx.js +20 -0
  19. package/chunks/{Radio-Bp-JwJid.js → Radio-CAIyBgBp.js} +2 -2
  20. package/chunks/{RangeCalendar-h9wkh43W.js → RangeCalendar-DIMxoHhy.js} +1 -1
  21. package/chunks/{SearchField-Dcs9LjKo.js → SearchField-aUMEFhOO.js} +1 -1
  22. package/chunks/{Select-w2o-VyrP.js → Select-CzmgPK8V.js} +2 -2
  23. package/chunks/Text-BuXvuoqM.js +36 -0
  24. package/chunks/{TextArea-Bb7H-w23.js → TextArea-B3Z4fA1e.js} +2 -2
  25. package/combobox/ComboBox.d.ts +1 -11
  26. package/combobox/index.d.ts +1 -1
  27. package/combobox/index.js +2 -4
  28. package/date-field/index.js +1 -1
  29. package/date-picker/index.js +1 -1
  30. package/field-error/index.js +1 -1
  31. package/index.d.ts +0 -1
  32. package/index.js +125 -129
  33. package/list-box/ListBoxSection.d.ts +3 -11
  34. package/list-box/index.d.ts +0 -1
  35. package/list-box/index.js +8 -8
  36. package/menu/Menu.d.ts +0 -7
  37. package/package.json +1 -1
  38. package/radio/index.js +1 -1
  39. package/search-field/index.js +1 -1
  40. package/select/index.js +1 -1
  41. package/text/Text.d.ts +0 -8
  42. package/text/Text.stories.d.ts +0 -2
  43. package/text/index.js +1 -1
  44. package/textfield/TextArea.stories.d.ts +4 -4
  45. package/textfield/index.js +1 -1
  46. package/tooltip/Tooltip.d.ts +1 -5
  47. package/tooltip/Tooltip.stories.d.ts +2 -2
  48. package/tooltip/index.d.ts +0 -1
  49. package/assets/Select2.css +0 -1
  50. package/chunks/Breadcrumb-W7qQSxd-.js +0 -70
  51. package/chunks/ComboBox-B7T13rzp.js +0 -109
  52. package/chunks/ListBoxLoadMoreItem-ufPaJaNS.js +0 -41
  53. package/chunks/ListBoxSection-C4y3K7T5.js +0 -49
  54. package/chunks/Select-BYz3DdXs.js +0 -576
  55. package/chunks/Text-Bxww8mmL.js +0 -39
  56. package/legacy-select/HiddenMultiSelect.d.ts +0 -48
  57. package/legacy-select/LegacySelect.stories.d.ts +0 -27
  58. package/legacy-select/MultiSelectValueTag.d.ts +0 -11
  59. package/legacy-select/Select.d.ts +0 -8
  60. package/legacy-select/SelectFieldError.d.ts +0 -8
  61. package/legacy-select/SelectListBox.d.ts +0 -8
  62. package/legacy-select/SelectTrigger.d.ts +0 -10
  63. package/legacy-select/index.d.ts +0 -2
  64. package/legacy-select/index.js +0 -4
  65. package/legacy-select/intl/translations.json.d.ts +0 -17
  66. package/legacy-select/types.d.ts +0 -179
  67. package/legacy-select/useMultiSelect.d.ts +0 -5
  68. package/legacy-select/useMultiSelectListState.d.ts +0 -3
  69. package/legacy-select/useMultiSelectState.d.ts +0 -3
  70. package/list-box/types.d.ts +0 -29
@@ -1,8 +0,0 @@
1
- import { SelectProps } from './types';
2
- import * as React from 'react';
3
- /**
4
- * @deprecated since v15.2.0 Kept for backwards compatibility, but will be removed in a future version. Use `Select` from `@midas-ds/components` instead.
5
- */
6
- export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "children" | "items"> & {
7
- options: import('..').ListBoxOption[];
8
- } & React.RefAttributes<HTMLButtonElement>>;
@@ -1,8 +0,0 @@
1
- import { ListBoxOption } from '../list-box';
2
- import { MultiSelectState, SelectProps } from './types';
3
- import * as React from 'react';
4
- interface SelectFieldErrorProps extends SelectProps {
5
- state: MultiSelectState<ListBoxOption>;
6
- }
7
- export declare const SelectFieldError: React.FC<SelectFieldErrorProps>;
8
- export {};
@@ -1,8 +0,0 @@
1
- import { ListBoxOption } from '../list-box';
2
- import { AriaListBoxOptions } from '@react-aria/listbox';
3
- import { MultiSelectState } from './types';
4
- interface ListBoxProps<T extends ListBoxOption> extends AriaListBoxOptions<T> {
5
- state: MultiSelectState<T>;
6
- }
7
- export declare const SelectListBox: <T extends ListBoxOption>({ state, ...rest }: ListBoxProps<T>) => import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,10 +0,0 @@
1
- import { default as React } from 'react';
2
- import { AriaButtonProps } from 'react-aria';
3
- import { SelectProps, MultiSelectState } from './types';
4
- import { ListBoxOption } from '../list-box';
5
- interface SelectTriggerProps extends Omit<SelectProps, 'children'>, AriaButtonProps<'button'> {
6
- state: MultiSelectState<ListBoxOption>;
7
- triggerRef: React.MutableRefObject<HTMLButtonElement | null>;
8
- }
9
- export declare const SelectTrigger: React.FC<SelectTriggerProps>;
10
- export {};
@@ -1,2 +0,0 @@
1
- export { Select as LegacySelect } from './Select';
2
- export type { SelectContainerProps as LegacySelectProps } from './types';
@@ -1,4 +0,0 @@
1
- import { S as c } from "../chunks/Select-BYz3DdXs.js";
2
- export {
3
- c as LegacySelect
4
- };
@@ -1,17 +0,0 @@
1
- declare const _default: {
2
- "en": {
3
- "clearAll": "Clear all",
4
- "selectAll": "Select all",
5
- "selectedItems": "Selected items",
6
- "chosen": "chosen"
7
- },
8
- "sv": {
9
- "clearAll": "Rensa alla",
10
- "selectAll": "Välj alla",
11
- "selectedItems": "Valda objekt",
12
- "chosen": "valda"
13
- }
14
- }
15
- ;
16
-
17
- export default _default;
@@ -1,179 +0,0 @@
1
- import { MenuTriggerState } from '@react-stately/menu';
2
- import { FormValidationState } from '@react-stately/form';
3
- import { OverlayTriggerProps } from '@react-types/overlays';
4
- import { ListState } from '@react-stately/list';
5
- import { AsyncLoadable, CollectionBase, FocusableProps, InputBase, LabelableProps, MultipleSelection, TextInputBase, Validation, Key, Node, CollectionChildren } from '@react-types/shared';
6
- import { HTMLAttributes } from 'react';
7
- import { AriaListBoxOptions } from 'react-aria';
8
- import { AriaButtonProps } from '@react-types/button';
9
- import { AriaSelectProps } from '@react-types/select';
10
- import { Size } from '../common/types';
11
- import { ListBoxOption } from '../list-box/';
12
- import { SelectionMode } from '../select';
13
- /**
14
- * Props used for setting up the list state
15
- */
16
- export interface MultiSelectListProps<T extends ListBoxOption> extends CollectionBase<T>, MultipleSelection {
17
- }
18
- /**
19
- * The state of the select list
20
- */
21
- export interface MultiSelectListState<T extends ListBoxOption> extends ListState<T> {
22
- /**
23
- * The keys for the currently selected items.
24
- */
25
- selectedKeys: Set<Key>;
26
- /**
27
- * Sets the selected keys.
28
- */
29
- setSelectedKeys(keys: Iterable<Key>): void;
30
- /**
31
- * The value of the currently selected items.
32
- */
33
- selectedItems: Node<T>[] | null;
34
- /**
35
- * The type of selection.
36
- */
37
- selectionMode: MultiSelectListProps<T>['selectionMode'];
38
- }
39
- /**
40
- * Props used for setting up the select component state
41
- */
42
- export interface MultiSelectStateProps<T extends ListBoxOption> extends MultiSelectListProps<T>, AsyncLoadable, FocusableProps, LabelableProps, Omit<InputBase, 'isReadOnly'>, OverlayTriggerProps, TextInputBase, Validation {
43
- /**
44
- * Whether the menu should automatically flip direction when space is limited.
45
- * @default true
46
- */
47
- shouldFlip?: boolean;
48
- }
49
- /**
50
- * The state of the select component
51
- */
52
- export interface MultiSelectState<T extends ListBoxOption> extends MultiSelectListState<T>, MenuTriggerState, FormValidationState {
53
- /**
54
- * Whether the select is currently focused.
55
- */
56
- isFocused: boolean;
57
- /**
58
- * Sets whether the select is focused.
59
- */
60
- setFocused(isFocused: boolean): void;
61
- }
62
- /**
63
- * Props for setting up the select component parts
64
- */
65
- export interface MultiSelectProps<T extends ListBoxOption, M extends SelectionMode> extends Omit<AriaSelectProps<T, M>, 'onSelectionChange'> {
66
- /**
67
- * Wheter to allow an empty selection or not
68
- */
69
- disallowEmptySelection?: boolean;
70
- onSelectionChange?: MultiSelectStateProps<T>['onSelectionChange'];
71
- }
72
- /**
73
- * DOM attributes for rendering the parts of the Select component
74
- */
75
- export interface MultiSelectDOMProps<T extends ListBoxOption> {
76
- /**
77
- * Props for the label element.
78
- */
79
- labelProps: HTMLAttributes<HTMLElement>;
80
- /**
81
- * Props for the popup trigger element.
82
- */
83
- triggerProps: AriaButtonProps;
84
- /**
85
- * Props for the element representing the selected value.
86
- */
87
- valueProps: HTMLAttributes<HTMLElement>;
88
- /**
89
- * Props for the popup.
90
- */
91
- menuProps: AriaListBoxOptions<T>;
92
- }
93
- export interface SelectProps extends MultiSelectStateProps<ListBoxOption> {
94
- /**
95
- * Whether the element should receive focus on render.
96
- */
97
- autoFocus?: boolean;
98
- children: CollectionChildren<ListBoxOption>;
99
- /**
100
- * Sets the CSS [`className`](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element.
101
- */
102
- className?: string;
103
- /**
104
- * Sets the default open state of the field (uncontrolled).
105
- */
106
- defaultOpen?: boolean;
107
- excludeFromTabOrder?: boolean;
108
- items: ListBoxOption[];
109
- /**
110
- * Whether the field can be emptied.
111
- * @default true
112
- */
113
- isClearable?: boolean;
114
- /**
115
- * Whether the field is disabled.
116
- */
117
- isDisabled?: boolean;
118
- /**
119
- * Whether to show a button to select all items.
120
- */
121
- isSelectableAll?: boolean;
122
- /**
123
- * Sets the open state of the field (controlled).
124
- */
125
- isOpen?: boolean;
126
- /**
127
- * The content to display as the label.
128
- */
129
- label: string;
130
- /**
131
- * Optional description
132
- */
133
- description?: string;
134
- /**
135
- * Placeholder value
136
- */
137
- placeholder?: string;
138
- /**
139
- * Show selected items as tags below select
140
- */
141
- showTags?: boolean;
142
- /**
143
- * The type of selection that is allowed in the collection.
144
- * @default 'single'
145
- */
146
- selectionMode?: SelectionMode;
147
- /**
148
- * The selection is valid or not
149
- */
150
- isInvalid?: boolean;
151
- /**
152
- * Error message to be displayed in case of invalid state
153
- */
154
- errorMessage?: string;
155
- /**
156
- * Whether the field is required.
157
- */
158
- isRequired?: boolean;
159
- /**
160
- * Name of the field, for uncontrolled use
161
- */
162
- name?: string;
163
- /**
164
- * The position of the error message
165
- * @default "top"
166
- */
167
- errorPosition?: 'top' | 'bottom';
168
- /** Component size (large: height 48px, medium: height 40px)
169
- * @default 'large'
170
- */
171
- size?: Size;
172
- }
173
- /**
174
- * @deprecated since v15.2.0 please use `Select` and `SelectProps` instead
175
- */
176
- export type SelectContainerProps = Omit<SelectProps, 'children' | 'items'> & {
177
- /** Item objects in the collection. */
178
- options: ListBoxOption[];
179
- };
@@ -1,5 +0,0 @@
1
- import { RefObject } from 'react';
2
- import { MultiSelectDOMProps, MultiSelectProps, MultiSelectState } from './types';
3
- import { ListBoxOption } from '../list-box';
4
- import { SelectionMode } from '../select';
5
- export declare function useMultiSelect<T extends ListBoxOption, M extends SelectionMode>(props: MultiSelectProps<T, M>, state: MultiSelectState<T>, ref: RefObject<HTMLElement | null>): MultiSelectDOMProps<T>;
@@ -1,3 +0,0 @@
1
- import { MultiSelectListProps, MultiSelectListState } from './types';
2
- import { ListBoxOption } from '../list-box';
3
- export declare function useMultiSelectListState<T extends ListBoxOption>(props: MultiSelectListProps<T>): MultiSelectListState<T>;
@@ -1,3 +0,0 @@
1
- import { MultiSelectState, MultiSelectStateProps } from './types';
2
- import { ListBoxOption } from '../list-box';
3
- export declare function useMultiSelectState<T extends ListBoxOption>(props: MultiSelectStateProps<T>): MultiSelectState<T>;
@@ -1,29 +0,0 @@
1
- import { Key } from 'react-aria-components';
2
- /**
3
- * @deprecated since v15.2.0 ListBoxItem will extend `object` from now on
4
- */
5
- export type ListBoxItemElement = {
6
- children?: never;
7
- id: Key;
8
- name: string | React.ReactNode;
9
- /**
10
- * Textual representation of `name` in case it is not a string. Used for searching.
11
- */
12
- textValue?: string;
13
- /**
14
- * Additional properties.
15
- */
16
- [prop: string]: unknown;
17
- };
18
- /**
19
- * @deprecated since v15.2.0 ListBoxSection will extend `object` from now on
20
- */
21
- export type ListBoxSectionElement = {
22
- children: ListBoxItemElement[];
23
- name: string;
24
- /**
25
- * Additional properties for backwards compatibility.
26
- */
27
- [prop: string]: unknown;
28
- };
29
- export type ListBoxOption = ListBoxItemElement | ListBoxSectionElement;