@iress-oss/ids-components 6.0.0-alpha.49 → 6.0.0-alpha.50

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 (32) hide show
  1. package/.ai/guides/migration-guides-v6.md +2 -1
  2. package/dist/{Autocomplete-C1SPFcaX.js → Autocomplete-B8Ac_bPk.js} +71 -67
  3. package/dist/{TableBody-DnTSsbYF.js → TableBody-r9poBt3c.js} +1 -1
  4. package/dist/components/Autocomplete/Autocomplete.js +1 -1
  5. package/dist/components/Autocomplete/index.js +1 -1
  6. package/dist/components/Hide/helpers/normaliseHideValues.js +1 -1
  7. package/dist/components/Icon/Icon.constants.d.ts +1 -1
  8. package/dist/components/Icon/Icon.constants.js +2 -2
  9. package/dist/components/Icon/IconProvider.js +1 -1
  10. package/dist/components/Icon/index.js +4 -4
  11. package/dist/components/Select/Select.d.ts +3 -3
  12. package/dist/components/Select/Select.js +1 -1
  13. package/dist/components/Select/components/SelectActivator.js +50 -45
  14. package/dist/components/Select/components/SelectOptions.js +134 -129
  15. package/dist/components/Select/helpers/toPrimitiveValue.d.ts +4 -0
  16. package/dist/components/Select/helpers/toPrimitiveValue.js +7 -0
  17. package/dist/components/Select/index.js +1 -1
  18. package/dist/components/Table/Table.js +1 -1
  19. package/dist/components/Table/TableBody/TableBody.js +1 -1
  20. package/dist/components/Table/components/TableFilterButton.js +2 -2
  21. package/dist/components/Table/components/TableHeader.js +1 -1
  22. package/dist/components/Table/components/TableHeaderCell.js +1 -1
  23. package/dist/components/Table/index.js +1 -1
  24. package/dist/constants.d.ts +93 -2
  25. package/dist/constants.js +139 -13
  26. package/dist/hooks/useBreakpoint.d.ts +1 -1
  27. package/dist/hooks/useBreakpoint.js +6 -6
  28. package/dist/hooks/useResponsiveProps.js +4 -4
  29. package/dist/main.js +266 -267
  30. package/dist/patterns/DropdownMenu/DropdownMenu.js +1 -1
  31. package/package.json +1 -1
  32. package/dist/Icon.constants-CITIz_Fu.js +0 -139
@@ -1,219 +1,224 @@
1
- import { jsx as s, jsxs as O, Fragment as P } from "react/jsx-runtime";
2
- import { getValueAsEvent as E } from "../../../helpers/form/getValueAsEvent.js";
3
- import { useCallback as F, useRef as $, useId as D, useEffect as T } from "react";
4
- import { IressSelectSearch as z } from "../SelectSearch/SelectSearch.js";
5
- import { toArray as B } from "../../../helpers/formatting/toArray.js";
1
+ import { jsx as r, jsxs as O, Fragment as D } from "react/jsx-runtime";
2
+ import { getValueAsEvent as F } from "../../../helpers/form/getValueAsEvent.js";
3
+ import { toPrimitiveValue as P } from "../helpers/toPrimitiveValue.js";
4
+ import { useCallback as W, useRef as T, useId as z, useEffect as B } from "react";
5
+ import { IressSelectSearch as G } from "../SelectSearch/SelectSearch.js";
6
+ import { toArray as H } from "../../../helpers/formatting/toArray.js";
6
7
  import { IressSelectMenu as C } from "../SelectMenu/SelectMenu.js";
7
- import { IressAlert as G } from "../../Alert/Alert.js";
8
+ import { IressAlert as J } from "../../Alert/Alert.js";
8
9
  import "../../Alert/Alert.styles.js";
9
- import { IressSelectSearchInput as H } from "../SelectSearchInput/SelectSearchInput.js";
10
- import { IressSelectHeading as J } from "../SelectHeading/SelectHeading.js";
10
+ import { IressSelectSearchInput as K } from "../SelectSearchInput/SelectSearchInput.js";
11
+ import { IressSelectHeading as L } from "../SelectHeading/SelectHeading.js";
11
12
  import "../../Menu/Menu.js";
12
13
  import "../../Menu/Menu.styles.js";
13
14
  import "../../Menu/MenuItem/MenuItem.styles.js";
14
15
  import "../../Menu/MenuGroup/MenuGroup.styles.js";
15
- import { IressMenuDivider as K } from "../../Menu/MenuDivider/MenuDivider.js";
16
+ import { IressMenuDivider as U } from "../../Menu/MenuDivider/MenuDivider.js";
16
17
  import "../../Menu/MenuGroup/MenuGroup.js";
17
18
  import "../../Menu/MenuItem/MenuItem.js";
18
19
  import "../../Menu/MenuText/MenuText.js";
19
- const W = ({
20
+ const j = ({
20
21
  minSearchLength: e,
21
- multiSelect: r,
22
- onChange: i,
23
- query: I,
22
+ multiSelect: n,
23
+ onChange: l,
24
+ query: A,
24
25
  results: o,
25
- shouldShowInstructions: d,
26
+ shouldShowInstructions: p,
26
27
  shouldShowNoResults: c,
27
28
  value: t
28
- }) => /* @__PURE__ */ s(
29
+ }) => /* @__PURE__ */ r(
29
30
  C,
30
31
  {
31
- heading: r ? "Search results" : void 0,
32
+ heading: n ? "Search results" : void 0,
32
33
  items: o,
33
- multiSelect: r,
34
+ multiSelect: n,
34
35
  noResults: (() => {
35
- if (I) {
36
- if (d)
36
+ if (A) {
37
+ if (p)
37
38
  return `Type at least ${e} character${e === 1 ? "" : "s"} to search`;
38
39
  if (c)
39
40
  return "No results found";
40
41
  }
41
42
  })(),
42
- onChange: i,
43
+ onChange: l,
43
44
  selected: t,
44
- hideSelectedItems: r
45
+ hideSelectedItems: n
45
46
  }
46
47
  );
47
- W.displayName = "SelectAsyncResults";
48
- const j = ({ error: e }) => e ? /* @__PURE__ */ s(G, { status: "danger", children: typeof e == "string" ? e : /* @__PURE__ */ O(P, { children: [
48
+ j.displayName = "SelectAsyncResults";
49
+ const k = ({ error: e }) => e ? /* @__PURE__ */ r(J, { status: "danger", children: typeof e == "string" ? e : /* @__PURE__ */ O(D, { children: [
49
50
  "An unknown error occurred.",
50
- /* @__PURE__ */ s("br", {}),
51
+ /* @__PURE__ */ r("br", {}),
51
52
  " Please contact support if the error persists."
52
53
  ] }) }) : null;
53
- j.displayName = "SelectAsyncError";
54
- const k = ({
54
+ k.displayName = "SelectAsyncError";
55
+ const $ = ({
55
56
  autoHighlight: e,
56
- error: r,
57
- loading: i,
58
- minSearchLength: I,
57
+ error: n,
58
+ loading: l,
59
+ minSearchLength: A,
59
60
  multiSelect: o,
60
- onChange: d,
61
+ onChange: p,
61
62
  onClear: c,
62
63
  query: t,
63
- results: p,
64
- setQuery: f,
65
- show: A,
66
- value: l,
67
- shouldShowInstructions: x,
68
- shouldShowNoResults: S
64
+ results: f,
65
+ setQuery: m,
66
+ show: S,
67
+ value: d,
68
+ shouldShowInstructions: N,
69
+ shouldShowNoResults: y
69
70
  }) => {
70
- const n = B(l).map(
71
- (a) => {
72
- const { formattedLabel: g, ...R } = a;
73
- return R;
71
+ const s = H(d).map(
72
+ (i) => {
73
+ const { formattedLabel: I, ...a } = i;
74
+ return a;
74
75
  }
75
- ), m = !r && (!!p?.length || t && !i), u = !!n.length && o, b = m && u, h = $(null), y = D();
76
- T(() => {
77
- A || f?.("");
78
- }, [A, f]);
79
- const v = u ? n.length + 1 : 0;
76
+ ), u = !n && (!!f?.length || t && !l), h = !!s.length && o, v = u && h, g = T(null), x = z();
77
+ B(() => {
78
+ S || m?.("");
79
+ }, [S, m]);
80
+ const b = h ? s.length + 1 : 0;
80
81
  return /* @__PURE__ */ O(
81
- z,
82
+ G,
82
83
  {
83
- activator: /* @__PURE__ */ s(
84
- H,
84
+ activator: /* @__PURE__ */ r(
85
+ K,
85
86
  {
86
87
  "aria-label": "Search",
87
- loading: i,
88
- onChange: (a) => f?.(a.target.value),
89
- ref: h,
88
+ loading: l,
89
+ onChange: (i) => m?.(i.target.value),
90
+ ref: g,
90
91
  placeholder: "Search and select",
91
92
  value: t
92
93
  }
93
94
  ),
94
95
  autoHighlight: e,
95
- focusStartIndex: e ? t && m ? v : u ? 1 : 0 : void 0,
96
+ focusStartIndex: e ? t && u ? b : h ? 1 : 0 : void 0,
96
97
  children: [
97
- u && /* @__PURE__ */ s(
98
+ h && /* @__PURE__ */ r(
98
99
  C,
99
100
  {
100
- "aria-labelledby": y,
101
- heading: /* @__PURE__ */ s(
102
- J,
101
+ "aria-labelledby": x,
102
+ heading: /* @__PURE__ */ r(
103
+ L,
103
104
  {
104
105
  clearAll: !0,
105
- onClearAll: (a) => {
106
- c?.(a), h.current?.focus();
106
+ onClearAll: (i) => {
107
+ c?.(i), g.current?.focus();
107
108
  },
108
- children: /* @__PURE__ */ O("h2", { id: y, children: [
109
+ children: /* @__PURE__ */ O("h2", { id: x, children: [
109
110
  "Selected (",
110
- n.length,
111
+ s.length,
111
112
  ")"
112
113
  ] })
113
114
  }
114
115
  ),
115
- items: n,
116
+ items: s,
116
117
  multiSelect: o,
117
- onChange: d,
118
- selected: l
118
+ onChange: p,
119
+ selected: d
119
120
  }
120
121
  ),
121
- b && /* @__PURE__ */ s(K, {}),
122
- m && /* @__PURE__ */ s(
123
- W,
122
+ v && /* @__PURE__ */ r(U, {}),
123
+ u && /* @__PURE__ */ r(
124
+ j,
124
125
  {
125
- minSearchLength: I,
126
+ minSearchLength: A,
126
127
  multiSelect: o,
127
- onChange: d,
128
+ onChange: p,
128
129
  query: t,
129
- results: p,
130
- value: l,
131
- shouldShowInstructions: x,
132
- shouldShowNoResults: S
130
+ results: f,
131
+ value: d,
132
+ shouldShowInstructions: N,
133
+ shouldShowNoResults: y
133
134
  }
134
135
  ),
135
- /* @__PURE__ */ s(j, { error: r })
136
+ /* @__PURE__ */ r(k, { error: n })
136
137
  ]
137
138
  }
138
139
  );
139
140
  };
140
- k.displayName = "SelectAsyncOptions";
141
- const L = ({
141
+ $.displayName = "SelectAsyncOptions";
142
+ const X = ({
142
143
  autoHighlight: e,
143
- debouncedQuery: r,
144
- error: i,
145
- initialOptions: I,
144
+ debouncedQuery: n,
145
+ error: l,
146
+ initialOptions: A,
146
147
  loading: o,
147
- minSearchLength: d,
148
+ minSearchLength: p,
148
149
  multiSelect: c,
149
150
  onChange: t,
150
- options: p,
151
- query: f,
152
- renderOptions: A,
153
- results: l,
154
- setQuery: x,
155
- setShow: S,
156
- setValue: n,
157
- show: m,
158
- shouldShowInstructions: u,
159
- shouldShowNoResults: b,
160
- value: h
151
+ options: f,
152
+ query: m,
153
+ renderOptions: S,
154
+ results: d,
155
+ setQuery: N,
156
+ setShow: y,
157
+ setValue: s,
158
+ show: u,
159
+ shouldShowInstructions: h,
160
+ shouldShowNoResults: v,
161
+ value: g
161
162
  }) => {
162
- const y = typeof p == "function", v = I ?? (y ? [] : p), M = l.length ? l : v, N = F(
163
- (g) => {
164
- n(g), t?.(E(g), g), c || S(!1);
163
+ const x = typeof f == "function", b = A ?? (x ? [] : f), M = d.length ? d : b, R = W(
164
+ (I) => {
165
+ s(I);
166
+ const a = P(I);
167
+ t?.(F(a), a, I), c || y(!1);
165
168
  },
166
- [S, n, t, c]
167
- ), a = F(
168
- (g) => {
169
- g.stopPropagation();
170
- const R = [];
171
- n(R), t?.(E([]), R);
169
+ [y, s, t, c]
170
+ ), i = W(
171
+ (I) => {
172
+ I.stopPropagation();
173
+ const a = [];
174
+ s(a);
175
+ const E = P(a);
176
+ t?.(F(E), E, a);
172
177
  },
173
- [n, t]
178
+ [s, t]
174
179
  );
175
- return A ? A({
176
- close: () => S(!1),
177
- debouncedQuery: r,
178
- error: i,
179
- handleClear: a,
180
- handleMenuChange: N,
180
+ return S ? S({
181
+ close: () => y(!1),
182
+ debouncedQuery: n,
183
+ error: l,
184
+ handleClear: i,
185
+ handleMenuChange: R,
181
186
  loading: o,
182
- query: f,
187
+ query: m,
183
188
  results: M,
184
- setValue: n,
185
- setQuery: x,
186
- show: m,
187
- value: h
188
- }) : y ? /* @__PURE__ */ s(
189
- k,
189
+ setValue: s,
190
+ setQuery: N,
191
+ show: u,
192
+ value: g
193
+ }) : x ? /* @__PURE__ */ r(
194
+ $,
190
195
  {
191
196
  autoHighlight: e,
192
- error: i,
197
+ error: l,
193
198
  loading: o,
194
- minSearchLength: d,
199
+ minSearchLength: p,
195
200
  multiSelect: c,
196
- onChange: N,
197
- onClear: a,
198
- query: f,
199
- results: l,
200
- setQuery: x,
201
- show: m,
202
- value: h,
203
- shouldShowInstructions: u,
204
- shouldShowNoResults: b
201
+ onChange: R,
202
+ onClear: i,
203
+ query: m,
204
+ results: d,
205
+ setQuery: N,
206
+ show: u,
207
+ value: g,
208
+ shouldShowInstructions: h,
209
+ shouldShowNoResults: v
205
210
  }
206
- ) : /* @__PURE__ */ s(
211
+ ) : /* @__PURE__ */ r(
207
212
  C,
208
213
  {
209
214
  items: M,
210
215
  multiSelect: c,
211
- onChange: N,
212
- selected: h
216
+ onChange: R,
217
+ selected: g
213
218
  }
214
219
  );
215
220
  };
216
- L.displayName = "SelectOptions";
221
+ X.displayName = "SelectOptions";
217
222
  export {
218
- L as SelectOptions
223
+ X as SelectOptions
219
224
  };
@@ -0,0 +1,4 @@
1
+ import { ControlledValue } from '../../../hooks';
2
+ import { LabelValueMeta } from '../../../interfaces';
3
+ import { FormControlValue } from '../../../types';
4
+ export declare const toPrimitiveValue: <TMultiple extends boolean = false>(value: ControlledValue<LabelValueMeta, TMultiple> | undefined) => ControlledValue<FormControlValue, TMultiple> | undefined;
@@ -0,0 +1,7 @@
1
+ const t = (r) => {
2
+ if (r !== void 0)
3
+ return Array.isArray(r) ? r.map((i) => i.value ?? null) : r.value ?? null;
4
+ };
5
+ export {
6
+ t as toPrimitiveValue
7
+ };
@@ -1,4 +1,4 @@
1
- import { a as t } from "../../Autocomplete-C1SPFcaX.js";
1
+ import { a as t } from "../../Autocomplete-B8Ac_bPk.js";
2
2
  import { IressSelectBody as s } from "./SelectBody/SelectBody.js";
3
3
  import { IressSelectCreate as l } from "./SelectCreate/SelectCreate.js";
4
4
  import { IressSelectHeading as S } from "./SelectHeading/SelectHeading.js";
@@ -3,7 +3,7 @@ import "react";
3
3
  import "../../hooks/useIdIfNeeded.js";
4
4
  import "./components/TableEmpty.js";
5
5
  import "../../helpers/utility/propagateTestid.js";
6
- import { I as x } from "../../TableBody-DnTSsbYF.js";
6
+ import { I as x } from "../../TableBody-r9poBt3c.js";
7
7
  import "../../TableProvider-D84YrYSp.js";
8
8
  import "./components/TableRows.js";
9
9
  import "./Table.styles.js";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../../../helpers/utility/propagateTestid.js";
3
3
  import "../components/TableEmpty.js";
4
- import { a as x } from "../../../TableBody-DnTSsbYF.js";
4
+ import { a as x } from "../../../TableBody-r9poBt3c.js";
5
5
  import "react";
6
6
  import "../../../hooks/useIdIfNeeded.js";
7
7
  import "../components/TableRows.js";
@@ -19,10 +19,10 @@ import "../Table.styles.js";
19
19
  import "../../Icon/Icon.js";
20
20
  import "../../Icon/Icon.styles.js";
21
21
  import "../../Icon/IconProvider.js";
22
- import { T as Io } from "../../../TableBody-DnTSsbYF.js";
22
+ import { T as Io } from "../../../TableBody-r9poBt3c.js";
23
23
  import "../../Alert/Alert.js";
24
24
  import "../../Alert/Alert.styles.js";
25
- import "../../../Autocomplete-C1SPFcaX.js";
25
+ import "../../../Autocomplete-B8Ac_bPk.js";
26
26
  import "../../Autocomplete/Autocomplete.styles.js";
27
27
  import "../../../highlightQueryInLabel-Cx7nIoII.js";
28
28
  import "../../ButtonGroup/ButtonGroup.js";
@@ -1,7 +1,7 @@
1
1
  import "react/jsx-runtime";
2
2
  import "../../../helpers/utility/propagateTestid.js";
3
3
  import "../../../TableProvider-D84YrYSp.js";
4
- import { c as i } from "../../../TableBody-DnTSsbYF.js";
4
+ import { c as i } from "../../../TableBody-r9poBt3c.js";
5
5
  import "react";
6
6
  export {
7
7
  i as TableHeader
@@ -3,7 +3,7 @@ import "../hooks/useTableColumnStyles.js";
3
3
  import "../hooks/useTableColumnSort.js";
4
4
  import "../hooks/useTableColumnFilter.js";
5
5
  import "./TableSortButton.js";
6
- import { b as d } from "../../../TableBody-DnTSsbYF.js";
6
+ import { b as d } from "../../../TableBody-r9poBt3c.js";
7
7
  import "../Table.styles.js";
8
8
  import "react";
9
9
  import "../../../TableProvider-D84YrYSp.js";
@@ -1,4 +1,4 @@
1
- import { I as a, a as o } from "../../TableBody-DnTSsbYF.js";
1
+ import { I as a, a as o } from "../../TableBody-r9poBt3c.js";
2
2
  import { table as s, tableCell as t } from "./Table.styles.js";
3
3
  import { IressTableFormattedValue as m } from "./TableFormattedValue/TableFormattedValue.js";
4
4
  import { useTable as p } from "./hooks/useTable.js";
@@ -1,5 +1,96 @@
1
- export { BREAKPOINT_DETAILS, BREAKPOINTS, FORM_ELEMENT_WIDTHS, GRID_SIZE, HORIZONTAL_ALIGNS, MATERIAL_SYMBOLS, TEXT_ALIGNS, VERTICAL_ALIGNS, Z_INDEX, } from '../../theme-preset/src/constants';
2
- export type { BreakpointDetail } from '../../theme-preset/src/constants';
1
+ /** Details about a specific breakpoint in the design system. */
2
+ export interface BreakpointDetail {
3
+ containerMaxWidth: string;
4
+ margin?: string;
5
+ maxColumns?: number;
6
+ maxScreenWidth?: string;
7
+ mediaQuery: string;
8
+ minScreenWidth: string;
9
+ screenWidthRange: string;
10
+ viewportWidth: number;
11
+ }
12
+ export declare const BREAKPOINT_DETAILS: {
13
+ readonly xs: {
14
+ readonly mediaQuery: "(min-width: 0) and (max-width: 575px)";
15
+ readonly screenWidthRange: "0 - 575px";
16
+ readonly margin: "spacing.4";
17
+ readonly maxColumns: 4;
18
+ readonly minScreenWidth: "0px";
19
+ readonly maxScreenWidth: "575px";
20
+ readonly containerMaxWidth: "100%";
21
+ readonly viewportWidth: 360;
22
+ };
23
+ readonly sm: {
24
+ readonly mediaQuery: "(min-width: 576px) and (max-width: 767px)";
25
+ readonly screenWidthRange: "576px - 767px";
26
+ readonly margin: "spacing.4";
27
+ readonly minScreenWidth: "576px";
28
+ readonly maxScreenWidth: "767px";
29
+ readonly containerMaxWidth: "100%";
30
+ readonly viewportWidth: 767;
31
+ };
32
+ readonly md: {
33
+ readonly mediaQuery: "(min-width: 768px) and (max-width: 1023px)";
34
+ readonly screenWidthRange: "768px - 1023px";
35
+ readonly margin: "spacing.6";
36
+ readonly maxColumns: 4;
37
+ readonly minScreenWidth: "768px";
38
+ readonly maxScreenWidth: "1023px";
39
+ readonly containerMaxWidth: "100%";
40
+ readonly viewportWidth: 1022;
41
+ };
42
+ readonly lg: {
43
+ readonly mediaQuery: "(min-width: 1024px) and (max-width: 1279px)";
44
+ readonly screenWidthRange: "1024px - 1279px";
45
+ readonly margin: "spacing.6";
46
+ readonly maxColumns: 6;
47
+ readonly minScreenWidth: "1024px";
48
+ readonly maxScreenWidth: "1279px";
49
+ readonly containerMaxWidth: "100%";
50
+ readonly viewportWidth: 1278;
51
+ };
52
+ readonly xl: {
53
+ readonly mediaQuery: "(min-width: 1280px) and (max-width: 1599px)";
54
+ readonly screenWidthRange: "1280px - 1599px";
55
+ readonly margin: "spacing.8";
56
+ readonly minScreenWidth: "1280px";
57
+ readonly maxScreenWidth: "1599px";
58
+ readonly containerMaxWidth: "1440px";
59
+ readonly viewportWidth: number;
60
+ };
61
+ readonly xxl: {
62
+ readonly mediaQuery: "(min-width: 1600px)";
63
+ readonly margin: "spacing.8";
64
+ readonly screenWidthRange: "1600px and above";
65
+ readonly minScreenWidth: "1600px";
66
+ readonly containerMaxWidth: "1690px";
67
+ readonly viewportWidth: number;
68
+ };
69
+ };
70
+ export declare const BREAKPOINTS: ("xs" | "sm" | "md" | "lg" | "xl" | "xxl")[];
71
+ export declare const FORM_ELEMENT_WIDTHS: readonly ["2", "4", "6", "8", "10", "12", "16", "25%", "50%", "75%", "100%"];
72
+ export declare const GRID_SIZE = 12;
73
+ export declare const HORIZONTAL_ALIGNS: readonly ["around", "between", "center", "evenly", "left", "right", "stretch"];
74
+ export declare const MATERIAL_SYMBOLS: {
75
+ readonly family: "Material Symbols Rounded";
76
+ readonly className: "material-symbols-rounded";
77
+ readonly figmaGrade: "Emphasis";
78
+ readonly figmaOpticalSize: "24dp";
79
+ readonly grade: 0;
80
+ readonly opticalSize: 36;
81
+ readonly weight: 300;
82
+ };
83
+ export declare const TEXT_ALIGNS: readonly ["inherit", "left", "center", "right", "justify"];
84
+ export declare const VERTICAL_ALIGNS: readonly ["top", "middle", "bottom", "between", "around", "evenly", "stretch"];
85
+ export declare const Z_INDEX: {
86
+ DEFAULT: number;
87
+ NAVBAR: number;
88
+ POPOVER: number;
89
+ SLIDEOUT: number;
90
+ MODAL: number;
91
+ TOAST: number;
92
+ TOOLTIP: number;
93
+ };
3
94
  /**
4
95
  * A CSS selector string that matches all focusable elements.
5
96
  */