@midas-ds/components 16.3.0 → 16.3.2

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 (60) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/accordion/index.js +1 -1
  3. package/assets/ComboBox.css +1 -1
  4. package/assets/Select.css +1 -1
  5. package/button/index.js +1 -1
  6. package/calendar/index.js +1 -1
  7. package/checkbox/index.js +1 -1
  8. package/chunks/{AccordionItem-BUUDZ7l6.js → AccordionItem-D6vWtoJN.js} +2 -2
  9. package/chunks/{Button-wBgWrXj3.js → Button-BYrLbzir.js} +1 -1
  10. package/chunks/{CheckboxGroup-BQ8EpX7O.js → CheckboxGroup-C6LIpj_R.js} +2 -2
  11. package/chunks/{ColorSchemeSwitch-DugvPh6T.js → ColorSchemeSwitch-D-vCkxQo.js} +1 -1
  12. package/chunks/ComboBox-BXcuyHPd.js +108 -0
  13. package/chunks/{DateField-06YL8tj_.js → DateField-DPJrihTz.js} +1 -1
  14. package/chunks/{DateRangePicker-CZRWDV_g.js → DateRangePicker-DzgK_p0d.js} +2 -2
  15. package/chunks/{Dialog-DC0cGNj5.js → Dialog-DprWZBKT.js} +2 -2
  16. package/chunks/{FeedbackStatusIcon-COWuMusk.js → FeedbackStatusIcon-YJaUAfjp.js} +1 -1
  17. package/chunks/{InfoBanner-DLiVpNON.js → InfoBanner-BOKZ4lBE.js} +3 -3
  18. package/chunks/{Label-Dup4lWaR.js → Label-6SXmzRZE.js} +2 -2
  19. package/chunks/{Layout-DX3HUm5b.js → Layout-DveMXIKw.js} +3 -3
  20. package/chunks/{ListBoxLoadMoreItem-CB67meAb.js → ListBoxLoadMoreItem-CygpsU3W.js} +2 -2
  21. package/chunks/{Logo-InDSslpO.js → Logo-CsWcKqIg.js} +1 -1
  22. package/chunks/{ProgressBar-CbwvcHvk.js → ProgressBar-67lCngwJ.js} +1 -1
  23. package/chunks/{Radio-BDHczAt5.js → Radio-XQA8CylD.js} +1 -1
  24. package/chunks/{RangeCalendar-BSth1Fmv.js → RangeCalendar-Bt8q3FZi.js} +1 -1
  25. package/chunks/{SearchField-DTkfUFwn.js → SearchField-CxoPi6Ql.js} +2 -2
  26. package/chunks/Select-BNCz_ox4.js +221 -0
  27. package/chunks/{Select-CPM82ww2.js → Select-CyYUhMOg.js} +4 -4
  28. package/chunks/{Spinner-BORNnHph.js → Spinner-tvJ7rPiT.js} +1 -1
  29. package/chunks/{Tag-DxBoeE_n.js → Tag-BKcduKRR.js} +1 -1
  30. package/chunks/{TextArea-DQ_dAC-2.js → TextArea-BM5wOL3b.js} +3 -3
  31. package/chunks/{Toast-DTwUGSJ8.js → Toast-C-EV39pd.js} +2 -2
  32. package/chunks/useLocalizedStringFormatter-BHvsRxDk.js +25 -0
  33. package/color-scheme-switch/index.js +1 -1
  34. package/combobox/index.js +1 -1
  35. package/date-field/index.js +1 -1
  36. package/date-picker/index.js +1 -1
  37. package/index.d.ts +1 -0
  38. package/index.js +65 -63
  39. package/info-banner/index.js +1 -1
  40. package/label/index.js +1 -1
  41. package/layout/index.js +1 -1
  42. package/legacy-select/index.js +1 -1
  43. package/list-box/index.js +1 -1
  44. package/logo/index.js +1 -1
  45. package/modal/index.js +1 -1
  46. package/package.json +1 -1
  47. package/progress-bar/index.js +1 -1
  48. package/radio/index.js +1 -1
  49. package/search-field/index.js +1 -1
  50. package/select/MultiSelectValue.d.ts +4 -0
  51. package/select/SelectTrigger.d.ts +4 -2
  52. package/select/index.js +1 -1
  53. package/spinner/index.js +1 -1
  54. package/tag/index.js +1 -1
  55. package/textfield/index.js +1 -1
  56. package/toast/index.js +1 -1
  57. package/chunks/ComboBox-DVK0dL2W.js +0 -108
  58. package/chunks/Select-C8Fr7Vn3.js +0 -208
  59. package/chunks/useLocalizedStringFormatter-ZgRJmvHC.js +0 -25
  60. package/select/SelectValueTag.d.ts +0 -5
@@ -1,208 +0,0 @@
1
- import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
- import { SelectStateContext as m, Button as v, TagList as V, Select as x, SelectValue as C } from "react-aria-components";
3
- import { FocusScope as b } from "@react-aria/focus";
4
- import { a as T, L as N } from "./Label-Dup4lWaR.js";
5
- import { a as y, c as h } from "./clsx-AexbMWKp.js";
6
- import { T as B } from "./Text-TWzJxnto.js";
7
- import { F as _ } from "./FieldError-Bra5aRT3.js";
8
- import f, { useContext as p } from "react";
9
- import { C as L } from "./Checkbox-BTAfwDxU.js";
10
- import { u } from "./useLocalizedStringFormatter-ZgRJmvHC.js";
11
- import { useFocusManager as M } from "react-aria";
12
- import { X as F } from "./x-BXShoIAM.js";
13
- import { L as I } from "./ListBox-D5BBeZWL.js";
14
- import { P as G } from "./Popover-BcEtFiU1.js";
15
- import { a as j, T as k } from "./Tag-DxBoeE_n.js";
16
- import { C as R } from "./chevron-down-DgT-uSF9.js";
17
- import '../assets/Select.css';const $ = { clearAll: "Clear all", selectAll: "Select all", selectedItems: "Selected items", selected: "selected" }, w = { clearAll: "Rensa alla", selectAll: "Välj alla", selectedItems: "Valda objekt", selected: "valda" }, g = {
18
- en: $,
19
- sv: w
20
- }, D = "_select_nivht_1", z = "_triggerContainer_nivht_7", E = "_trigger_nivht_7", K = "_medium_nivht_28", P = "_selectValue_nivht_71", W = "_placeholder_nivht_81", X = "_selectValueTag_nivht_95", q = "_clearButton_nivht_109", H = "_truncate_nivht_121", J = "_popover_nivht_158", O = "_selectAll_nivht_184", Q = "_tagGroup_nivht_247", a = {
21
- select: D,
22
- triggerContainer: z,
23
- trigger: E,
24
- medium: K,
25
- selectValue: P,
26
- placeholder: W,
27
- selectValueTag: X,
28
- clearButton: q,
29
- truncate: H,
30
- popover: J,
31
- selectAll: O,
32
- tagGroup: Q
33
- }, U = () => {
34
- const t = f.useContext(m), l = u(g), s = () => t?.setValue(
35
- t?.selectionManager.isSelectAll ? null : Array.from(t.collection.getKeys())
36
- );
37
- return /* @__PURE__ */ e(
38
- L,
39
- {
40
- className: a.selectAll,
41
- isIndeterminate: !t?.selectionManager.isSelectAll && !t?.selectionManager.isEmpty,
42
- isSelected: t?.selectionManager.isSelectAll,
43
- onChange: s,
44
- children: l.format("selectAll")
45
- }
46
- );
47
- }, Y = ({
48
- isDisabled: t,
49
- selectedItems: l,
50
- selectedText: s
51
- }) => {
52
- const c = u(g), o = () => l.length === 1 ? s : `${l.length} ${c.format("selected")}`;
53
- return /* @__PURE__ */ d(
54
- "div",
55
- {
56
- className: a.selectValueTag,
57
- "data-disabled": t || void 0,
58
- children: [
59
- /* @__PURE__ */ e("span", { className: a.truncate, children: o() }),
60
- /* @__PURE__ */ e(Z, { isDisabled: t })
61
- ]
62
- }
63
- );
64
- }, Z = ({
65
- isDisabled: t
66
- }) => {
67
- const l = f.useContext(m), s = u(g), c = M(), o = () => {
68
- c?.focusFirst(), l?.setValue(null);
69
- };
70
- return /* @__PURE__ */ e(
71
- v,
72
- {
73
- "aria-label": s.format("clearAll"),
74
- className: a.clearButton,
75
- onPress: o,
76
- slot: null,
77
- isDisabled: t,
78
- children: /* @__PURE__ */ e(
79
- F,
80
- {
81
- width: 20,
82
- height: 20
83
- }
84
- )
85
- }
86
- );
87
- }, ee = ({
88
- showTags: t,
89
- isDisabled: l
90
- }) => {
91
- const s = u(g), c = p(m), o = (n) => {
92
- c?.selectionManager.toggleSelection(Array.from(n)[0]);
93
- };
94
- return !c?.selectedItems.length || !t ? null : /* @__PURE__ */ e(
95
- j,
96
- {
97
- "aria-label": s.format("selectedItems"),
98
- className: a.tagGroup,
99
- onRemove: o,
100
- selectionBehavior: "toggle",
101
- children: /* @__PURE__ */ e(V, { items: c.selectedItems, children: (n) => /* @__PURE__ */ e(
102
- k,
103
- {
104
- dismissable: !0,
105
- id: n.key,
106
- isDisabled: l,
107
- textValue: n.textValue,
108
- children: n.textValue
109
- },
110
- n.key
111
- ) })
112
- }
113
- );
114
- }, te = ({ size: t }) => {
115
- const l = p(m);
116
- return /* @__PURE__ */ e(
117
- v,
118
- {
119
- className: y(
120
- {
121
- [a.medium]: t === "medium"
122
- },
123
- a.trigger
124
- ),
125
- "data-invalid": !!l?.displayValidation.isInvalid || void 0,
126
- children: /* @__PURE__ */ e(
127
- "span",
128
- {
129
- "aria-hidden": "true",
130
- style: { display: "flex" },
131
- children: /* @__PURE__ */ e(R, { size: 20 })
132
- }
133
- )
134
- }
135
- );
136
- };
137
- function pe({
138
- children: t,
139
- description: l,
140
- errorMessage: s,
141
- errorPosition: c = "top",
142
- items: o,
143
- label: n,
144
- popover: S,
145
- size: A = "large",
146
- ...r
147
- }) {
148
- return /* @__PURE__ */ e(b, { children: /* @__PURE__ */ d(
149
- x,
150
- {
151
- ...r,
152
- className: h(r.className, a.select),
153
- children: [
154
- /* @__PURE__ */ e(T, { popover: S, children: n && /* @__PURE__ */ e(N, { "data-disabled": r.isDisabled || void 0, children: n }) }),
155
- l && /* @__PURE__ */ e(B, { slot: "description", children: l }),
156
- c === "top" && /* @__PURE__ */ e(_, { children: s }),
157
- /* @__PURE__ */ d(
158
- "div",
159
- {
160
- className: a.triggerContainer,
161
- "data-disabled": r.isDisabled || void 0,
162
- children: [
163
- /* @__PURE__ */ e(te, { size: A }),
164
- /* @__PURE__ */ e(
165
- C,
166
- {
167
- className: a.selectValue,
168
- "data-disabled": r.isDisabled || void 0,
169
- children: (i) => i.isPlaceholder || r.selectionMode !== "multiple" ? /* @__PURE__ */ e("div", { className: h(a.placeholder), children: /* @__PURE__ */ e("span", { className: h(a.truncate), children: i.selectedText || i.defaultChildren }) }) : /* @__PURE__ */ e(
170
- Y,
171
- {
172
- ...r,
173
- ...i
174
- }
175
- )
176
- }
177
- )
178
- ]
179
- }
180
- ),
181
- c === "bottom" && /* @__PURE__ */ e(_, { children: s }),
182
- /* @__PURE__ */ d(
183
- G,
184
- {
185
- className: a.popover,
186
- offset: 0,
187
- hideArrow: !0,
188
- children: [
189
- r.isSelectableAll && /* @__PURE__ */ e(U, {}),
190
- /* @__PURE__ */ e(
191
- I,
192
- {
193
- escapeKeyBehavior: "none",
194
- items: o,
195
- children: t
196
- }
197
- )
198
- ]
199
- }
200
- ),
201
- /* @__PURE__ */ e(ee, { ...r })
202
- ]
203
- }
204
- ) });
205
- }
206
- export {
207
- pe as S
208
- };
@@ -1,25 +0,0 @@
1
- import { LocalizedStringFormatter as n, LocalizedStringDictionary as c } from "@internationalized/string";
2
- import { useMemo as u } from "react";
3
- import { useLocale as m } from "react-aria-components";
4
- const t = "sv", i = /* @__PURE__ */ new WeakMap();
5
- function d(e) {
6
- let o = i.get(e);
7
- return o || (o = new c(e, t), i.set(e, o)), o;
8
- }
9
- function f(e, o) {
10
- return d(e);
11
- }
12
- function y(e, o) {
13
- if (!e || typeof e != "object" || !(t in e))
14
- throw new Error(
15
- `useLocalizedStringFormatter: Default language "${t}" must be defined in dictionary.`
16
- );
17
- const { locale: a } = m(), r = f(e);
18
- return u(
19
- () => new n(a, r),
20
- [r, a]
21
- );
22
- }
23
- export {
24
- y as u
25
- };
@@ -1,5 +0,0 @@
1
- import { SelectValueRenderProps } from 'react-aria-components';
2
- import { MidasSelectProps, SelectionMode } from './';
3
- type SelectValueTagProps<T extends object, M extends SelectionMode = 'single'> = SelectValueRenderProps<T> & Pick<MidasSelectProps<T, M>, 'isDisabled'>;
4
- export declare const SelectValueTag: <T extends object, M extends SelectionMode = "single">({ isDisabled, selectedItems, selectedText, }: SelectValueTagProps<T, M>) => import("react/jsx-runtime").JSX.Element;
5
- export {};