@iress-oss/ids-components 6.1.0 → 6.2.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 (244) hide show
  1. package/.ai/components/select.md +16 -0
  2. package/dist/Autocomplete-DKufjQU5.js +324 -0
  3. package/dist/{Button-bZPKq0ue.js → Button-BY2qzshw.js} +4 -4
  4. package/dist/{Provider-DvnuqPfQ.js → Provider-BNuRw7ck.js} +2 -2
  5. package/dist/{Shadow-D2KoVwxD.js → Shadow-DAfthdT2.js} +3 -3
  6. package/dist/{Slideout-RnRSkJsj.js → Slideout-BOH2gwIN.js} +3 -3
  7. package/dist/{Table.styles-BLO9zGfS.js → Table.styles-CKD_vWqh.js} +3 -3
  8. package/dist/TableProvider-C8bDaWu2.js +80 -0
  9. package/dist/{TableRows-B3nZnazw.js → TableRows-DXoiLfwt.js} +3 -4
  10. package/dist/{Text.styles-C0D5aEE_.js → Text.styles-DUvXBRio.js} +2 -2
  11. package/dist/components/Alert/Alert.js +4 -4
  12. package/dist/components/Alert/Alert.styles.js +1 -1
  13. package/dist/components/Autocomplete/Autocomplete.d.ts +1 -1
  14. package/dist/components/Autocomplete/Autocomplete.js +1 -1
  15. package/dist/components/Autocomplete/Autocomplete.styles.js +1 -1
  16. package/dist/components/Autocomplete/components/AutocompleteInstructions.js +4 -1
  17. package/dist/components/Autocomplete/hooks/useAutocompleteSearch.d.ts +7 -2
  18. package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +1 -1
  19. package/dist/components/Autocomplete/index.js +2 -2
  20. package/dist/components/Avatar/Avatar.js +3 -3
  21. package/dist/components/Avatar/Avatar.styles.js +1 -1
  22. package/dist/components/Avatar/AvatarGroup/AvatarGroup.js +3 -3
  23. package/dist/components/Avatar/AvatarGroup/AvatarGroup.styles.js +1 -1
  24. package/dist/components/Button/Button.js +1 -1
  25. package/dist/components/Button/CloseButton/CloseButton.js +2 -2
  26. package/dist/components/Button/index.js +1 -1
  27. package/dist/components/ButtonGroup/ButtonGroup.js +4 -4
  28. package/dist/components/ButtonGroup/ButtonGroup.styles.js +1 -1
  29. package/dist/components/Card/Card.js +3 -3
  30. package/dist/components/Card/Card.styles.js +1 -1
  31. package/dist/components/Checkbox/Checkbox.js +4 -4
  32. package/dist/components/Checkbox/Checkbox.styles.js +1 -1
  33. package/dist/components/CheckboxGroup/CheckboxGroup.js +1 -1
  34. package/dist/components/CheckboxGroup/CheckboxGroup.styles.js +1 -1
  35. package/dist/components/CheckboxMark/CheckboxMark.js +3 -3
  36. package/dist/components/CheckboxMark/CheckboxMark.styles.js +1 -1
  37. package/dist/components/Col/Col.js +2 -2
  38. package/dist/components/Col/Col.styles.js +1 -1
  39. package/dist/components/Container/Container.js +2 -2
  40. package/dist/components/Container/Container.styles.js +1 -1
  41. package/dist/components/Divider/Divider.js +3 -3
  42. package/dist/components/Divider/Divider.styles.js +1 -1
  43. package/dist/components/Expander/Expander.js +4 -4
  44. package/dist/components/Expander/Expander.styles.js +1 -1
  45. package/dist/components/ExpanderChevron/ExpanderChevron.js +1 -1
  46. package/dist/components/ExpanderChevron/ExpanderChevron.styles.js +1 -1
  47. package/dist/components/Field/Field.js +5 -5
  48. package/dist/components/Field/Field.styles.js +1 -1
  49. package/dist/components/Field/components/FieldFooter.js +3 -3
  50. package/dist/components/Field/components/FieldHint.js +3 -3
  51. package/dist/components/FieldGroup/FieldGroup.js +4 -4
  52. package/dist/components/FieldGroup/FieldGroup.styles.js +1 -1
  53. package/dist/components/Hide/Hide.js +1 -1
  54. package/dist/components/Hide/helpers/normaliseHideValues.js +1 -1
  55. package/dist/components/Icon/Icon.constants.js +1 -1
  56. package/dist/components/Icon/Icon.js +5 -5
  57. package/dist/components/Icon/Icon.styles.js +1 -1
  58. package/dist/components/Icon/IconProvider.js +2 -2
  59. package/dist/components/Icon/helpers/getMaterialSymbolsList.js +1 -1
  60. package/dist/components/Icon/hooks/useDynamicFontSubsetting.js +56 -39
  61. package/dist/components/Icon/index.js +1 -1
  62. package/dist/components/Image/Image.js +2 -2
  63. package/dist/components/Image/Image.styles.js +1 -1
  64. package/dist/components/Inline/Inline.js +2 -2
  65. package/dist/components/Inline/Inline.styles.js +1 -1
  66. package/dist/components/Input/Input.js +4 -4
  67. package/dist/components/Input/Input.styles.js +1 -1
  68. package/dist/components/Input/InputBase/InputBase.js +1 -1
  69. package/dist/components/InputCurrency/InputCurrency.js +1 -1
  70. package/dist/components/Label/Label.styles.js +1 -1
  71. package/dist/components/Label/LabelBase/LabelBase.js +2 -2
  72. package/dist/components/Link/Link.js +3 -3
  73. package/dist/components/Link/Link.styles.js +1 -1
  74. package/dist/components/Menu/Menu.js +3 -3
  75. package/dist/components/Menu/Menu.styles.js +1 -1
  76. package/dist/components/Menu/MenuDivider/MenuDivider.js +1 -1
  77. package/dist/components/Menu/MenuGroup/MenuGroup.js +2 -2
  78. package/dist/components/Menu/MenuGroup/MenuGroup.styles.js +1 -1
  79. package/dist/components/Menu/MenuHeading/MenuHeading.js +1 -1
  80. package/dist/components/Menu/MenuItem/MenuItem.js +4 -4
  81. package/dist/components/Menu/MenuItem/MenuItem.styles.js +1 -1
  82. package/dist/components/Menu/MenuText/MenuText.js +3 -3
  83. package/dist/components/Modal/Modal.js +6 -6
  84. package/dist/components/Modal/Modal.styles.js +1 -1
  85. package/dist/components/Panel/Panel.js +1 -1
  86. package/dist/components/Pill/Pill.js +4 -4
  87. package/dist/components/Pill/Pill.styles.js +1 -1
  88. package/dist/components/Placeholder/Placeholder.js +1 -1
  89. package/dist/components/Placeholder/Placeholder.styles.js +1 -1
  90. package/dist/components/Popover/InputPopover/InputPopover.js +2 -2
  91. package/dist/components/Popover/Popover.js +4 -4
  92. package/dist/components/Popover/Popover.styles.js +1 -1
  93. package/dist/components/Popover/components/PopoverActivator.js +14 -10
  94. package/dist/components/Popover/components/PopoverContent.js +54 -44
  95. package/dist/components/Popover/helpers/handlePopoverTabKey.js +2 -2
  96. package/dist/components/Popover/hooks/useFloatingPopover.js +1 -1
  97. package/dist/components/Popover/hooks/usePopoverItem.js +1 -1
  98. package/dist/components/Popover/hooks/usePopoverNavigation.js +1 -1
  99. package/dist/components/Progress/Progress.js +5 -5
  100. package/dist/components/Progress/Progress.styles.js +1 -1
  101. package/dist/components/Provider/Provider.js +1 -1
  102. package/dist/components/Provider/index.js +1 -1
  103. package/dist/components/Radio/Radio.js +4 -4
  104. package/dist/components/Radio/Radio.styles.js +1 -1
  105. package/dist/components/RadioGroup/RadioGroup.js +2 -2
  106. package/dist/components/RadioGroup/RadioGroup.styles.js +1 -1
  107. package/dist/components/RadioMark/RadioMark.js +3 -3
  108. package/dist/components/RadioMark/RadioMark.styles.js +1 -1
  109. package/dist/components/Readonly/Readonly.js +4 -4
  110. package/dist/components/Readonly/Readonly.styles.js +1 -1
  111. package/dist/components/Row/Row.js +2 -2
  112. package/dist/components/Row/Row.styles.js +1 -1
  113. package/dist/components/Select/Select.d.ts +6 -0
  114. package/dist/components/Select/Select.js +1 -1
  115. package/dist/components/Select/Select.styles.js +1 -1
  116. package/dist/components/Select/SelectBody/SelectBody.js +1 -1
  117. package/dist/components/Select/SelectBody/SelectBody.styles.js +1 -1
  118. package/dist/components/Select/SelectHeading/SelectHeading.js +2 -2
  119. package/dist/components/Select/SelectLabel/SelectLabel.js +1 -1
  120. package/dist/components/Select/SelectLabel/SelectLabel.styles.js +1 -1
  121. package/dist/components/Select/SelectMenu/SelectMenu.js +1 -1
  122. package/dist/components/Select/SelectMenu/SelectMenu.styles.js +1 -1
  123. package/dist/components/Select/SelectMenu/SelectMenuItem.js +1 -1
  124. package/dist/components/Select/SelectSearch/SelectSearch.js +1 -1
  125. package/dist/components/Select/SelectSearch/SelectSearch.styles.js +1 -1
  126. package/dist/components/Select/SelectSearchInput/SelectSearchInput.js +1 -1
  127. package/dist/components/Select/SelectSearchInput/SelectSearchInput.styles.js +1 -1
  128. package/dist/components/Select/SelectTags/SelectTags.js +2 -2
  129. package/dist/components/Select/SelectTags/SelectTags.styles.js +1 -1
  130. package/dist/components/Select/components/NativeSelect.js +3 -3
  131. package/dist/components/Select/components/NativeSelect.styles.d.ts +1 -1
  132. package/dist/components/Select/components/NativeSelect.styles.js +2 -2
  133. package/dist/components/Select/components/SelectOptions.d.ts +2 -2
  134. package/dist/components/Select/components/SelectOptions.js +78 -72
  135. package/dist/components/Select/index.js +1 -1
  136. package/dist/components/Skeleton/Skeleton.js +1 -1
  137. package/dist/components/Skeleton/Skeleton.styles.js +1 -1
  138. package/dist/components/SkipLink/SkipLink.js +2 -2
  139. package/dist/components/SkipLink/SkipLink.styles.js +1 -1
  140. package/dist/components/Slideout/Slideout.js +1 -1
  141. package/dist/components/Slideout/Slideout.styles.js +1 -1
  142. package/dist/components/Slideout/components/SlideoutInner.js +2 -2
  143. package/dist/components/Slideout/hooks/usePushElement.js +1 -1
  144. package/dist/components/Slideout/index.js +1 -1
  145. package/dist/components/Slider/Slider.js +3 -3
  146. package/dist/components/Slider/Slider.styles.js +1 -1
  147. package/dist/components/Slider/components/SliderTicks.js +2 -2
  148. package/dist/components/Spinner/Spinner.js +1 -1
  149. package/dist/components/Spinner/Spinner.styles.js +2 -2
  150. package/dist/components/Stack/Stack.js +2 -2
  151. package/dist/components/Stack/Stack.styles.js +1 -1
  152. package/dist/components/Styled/Styled.js +1 -1
  153. package/dist/components/TabSet/Tab/Tab.js +3 -3
  154. package/dist/components/TabSet/Tab/Tab.styles.js +1 -1
  155. package/dist/components/TabSet/TabSet.js +5 -5
  156. package/dist/components/TabSet/TabSet.styles.js +1 -1
  157. package/dist/components/Table/Table.js +1 -1
  158. package/dist/components/Table/Table.styles.js +1 -1
  159. package/dist/components/Table/TableBody/TableBody.js +1 -1
  160. package/dist/components/Table/TableProvider.js +2 -43
  161. package/dist/components/Table/components/TableEmpty.js +1 -1
  162. package/dist/components/Table/components/TableFilterButton.js +1 -1
  163. package/dist/components/Table/components/TableHeader.js +1 -1
  164. package/dist/components/Table/components/TableHeaderCell.js +1 -1
  165. package/dist/components/Table/components/TableRows.js +1 -1
  166. package/dist/components/Table/components/TableSortButton.js +1 -1
  167. package/dist/components/Table/helpers/composeTableColumnDefs.js +1 -1
  168. package/dist/components/Table/helpers/composeTableInitialColumnFilters.js +1 -1
  169. package/dist/components/Table/hooks/useTable.js +1 -1
  170. package/dist/components/Table/hooks/useTableColumnFilter.js +2 -2
  171. package/dist/components/Table/hooks/useTableColumnSort.js +1 -1
  172. package/dist/components/Table/hooks/useTableColumnStyles.js +4 -4
  173. package/dist/components/Table/index.js +2 -2
  174. package/dist/components/Tag/Tag.js +3 -3
  175. package/dist/components/Tag/Tag.styles.js +1 -1
  176. package/dist/components/TagInput/TagInput.styles.js +1 -1
  177. package/dist/components/Text/Text.js +3 -3
  178. package/dist/components/Text/Text.styles.js +1 -1
  179. package/dist/components/Text/index.js +1 -1
  180. package/dist/components/Toaster/Toaster.js +3 -3
  181. package/dist/components/Toaster/Toaster.styles.js +1 -1
  182. package/dist/components/Toaster/components/Toast/Toast.js +2 -2
  183. package/dist/components/Toaster/components/Toast/Toast.styles.js +1 -1
  184. package/dist/components/Toggle/Toggle.js +3 -3
  185. package/dist/components/Toggle/Toggle.styles.js +1 -1
  186. package/dist/components/Tooltip/Tooltip.js +3 -3
  187. package/dist/components/Tooltip/Tooltip.styles.js +1 -1
  188. package/dist/components/ValidationMessage/ValidationLink/ValidationLink.js +1 -1
  189. package/dist/components/ValidationMessage/ValidationMessage.js +3 -3
  190. package/dist/components/ValidationMessage/ValidationSummary/ValidationSummary.js +2 -2
  191. package/dist/{composeTableColumnDefs-B1U_Snxq.js → composeTableColumnDefs-DzUn8D5f.js} +230 -266
  192. package/dist/constants.js +1 -1
  193. package/dist/{create-recipe-CYwSzH6a.js → create-recipe-A316lnq3.js} +3 -3
  194. package/dist/{css-D3KwXbP0.js → css-R34N3rft.js} +32 -32
  195. package/dist/{cva-BWFp4eLV.js → cva-DcOwIar2.js} +2 -2
  196. package/dist/{factory-sKbby7-S.js → factory-BKr3zaf6.js} +4 -4
  197. package/dist/{floating-ui.react-COiJC198.js → floating-ui.react-TDMXDOBr.js} +50 -50
  198. package/dist/helpers/dom/focusableElements.js +1 -1
  199. package/dist/helpers/label-value/highlightQueryInLabel.js +378 -2
  200. package/dist/helpers/label-value/highlightQueryInLabelValue.js +1 -1
  201. package/dist/helpers/label-value/searchLabelValues.js +3 -2
  202. package/dist/helpers/styling/iressCss.js +1 -1
  203. package/dist/hooks/useBreakpoint.js +1 -1
  204. package/dist/hooks/useResponsiveProps.js +1 -1
  205. package/dist/index.d-BITk11Vr.js +4 -0
  206. package/dist/{index.esm-CmxdHJYy.js → index.esm-CapMi3wi.js} +2 -2
  207. package/dist/{is-valid-prop-BoZ7GJt2.js → is-valid-prop-BVyYPT21.js} +1 -1
  208. package/dist/{main-BpD96KHv.js → main-TklToXNs.js} +24 -25
  209. package/dist/main.js +10 -10
  210. package/dist/patterns/Breadcrumbs/Breadcrumbs.js +2 -2
  211. package/dist/patterns/Breadcrumbs/Breadcrumbs.styles.js +1 -1
  212. package/dist/patterns/ContextualMenu/ContextualMenu.js +5 -5
  213. package/dist/patterns/ContextualMenu/ContextualMenu.styles.js +1 -1
  214. package/dist/patterns/DropdownMenu/DropdownMenu.js +86 -85
  215. package/dist/patterns/DropdownMenu/DropdownMenu.styles.js +1 -1
  216. package/dist/patterns/Form/Form.styles.js +1 -1
  217. package/dist/patterns/Form/FormField/helpers/getErrorTypeMessage.js +2 -2
  218. package/dist/patterns/Form/FormField/helpers/transformCustomRulesToValidateRule.js +5 -5
  219. package/dist/patterns/Form/FormValidationSummary/FormValidationSummary.js +1 -1
  220. package/dist/patterns/Form/HookForm/HookForm.js +2 -2
  221. package/dist/patterns/Form/components/LongForm.js +1 -1
  222. package/dist/patterns/Form/components/ShortForm.js +1 -1
  223. package/dist/patterns/Loading/Loading.styles.js +1 -1
  224. package/dist/patterns/Loading/components/ComponentLoading.js +4 -4
  225. package/dist/patterns/Loading/components/DefaultLoading.js +2 -2
  226. package/dist/patterns/Loading/components/LongLoading.js +4 -4
  227. package/dist/patterns/Loading/components/PageLoading.js +2 -2
  228. package/dist/patterns/Loading/components/StartUpLoading.js +2 -2
  229. package/dist/patterns/Loading/components/ValidateLoading.js +3 -3
  230. package/dist/patterns/Shadow/Shadow.js +1 -1
  231. package/dist/patterns/Shadow/index.js +1 -1
  232. package/dist/patterns/SideNav/SideNav.js +4 -4
  233. package/dist/patterns/SideNav/SideNav.styles.js +1 -1
  234. package/dist/rolldown-runtime-3b4jIN3o.js +13 -0
  235. package/dist/style.css +1 -1
  236. package/dist/{sva-DOLIp5Dd.js → sva-DGhdmNso.js} +3 -3
  237. package/dist/{useAutocompleteSearch-DxKxs6HH.js → useAutocompleteSearch-BYzUn7Ag.js} +45 -44
  238. package/package.json +16 -16
  239. package/dist/Autocomplete-BRGD9dSh.js +0 -321
  240. package/dist/highlightQueryInLabel-BLIy9JHT.js +0 -386
  241. package/dist/index.d-CLYyYDIv.js +0 -4
  242. /package/dist/{constants-D0UW4Ewm.js → constants-DJz-xntC.js} +0 -0
  243. /package/dist/{cx-CZ8IJJTy.js → cx-QcEwjve6.js} +0 -0
  244. /package/dist/{tokens-CG_Rn1W3.js → tokens-DQsbW5to.js} +0 -0
@@ -1,6 +1,6 @@
1
- import { a as e, c as t, f as n, l as r } from "./css-D3KwXbP0.js";
2
- import { t as i } from "./cx-CZ8IJJTy.js";
3
- import { n as a } from "./cva-BWFp4eLV.js";
1
+ import { a as e, c as t, f as n, l as r } from "./css-R34N3rft.js";
2
+ import { t as i } from "./cx-QcEwjve6.js";
3
+ import { n as a } from "./cva-DcOwIar2.js";
4
4
  //#region src/styled-system/css/sva.mjs
5
5
  function o(o) {
6
6
  let s = Object.entries(t(o)).map(([e, t]) => [e, a(t)]), c = o.defaultVariants ?? {}, l = s.reduce((e, [t, n]) => (o.className && (e[t] = n.config.className), e), {});
@@ -79,7 +79,7 @@ function l(e, t, r) {
79
79
  }
80
80
  //#endregion
81
81
  //#region src/components/Autocomplete/hooks/useAutocompleteSearch.tsx
82
- var u = 500, d = 1, f = 250, p = (e) => e instanceof Error && e.message ? e.message : typeof e == "string" ? e : !0, m = () => {
82
+ var u = 300, d = 1, f = 250, p = (e) => e instanceof Error && e.message ? e.message : typeof e != "string" || e, m = () => {
83
83
  let [t, r] = o(!1), [i, a] = o(!1), [s, c] = o([]), [l, u] = o(!1);
84
84
  return {
85
85
  loading: t,
@@ -108,79 +108,80 @@ var u = 500, d = 1, f = 250, p = (e) => e instanceof Error && e.message ? e.mess
108
108
  a(!1);
109
109
  }, [])
110
110
  };
111
- }, h = (e, r) => {
112
- let i = a(""), o = a(null), s = n(() => {
113
- o.current &&= (clearTimeout(o.current), null);
114
- }, []), c = n((e) => i.current === e, []), l = n((e) => {
115
- i.current = e;
111
+ }, h = (e, r, i) => {
112
+ let o = a(""), s = a(null), c = n(() => {
113
+ s.current &&= (clearTimeout(s.current), null);
114
+ }, []), l = n((e) => o.current === e, []), u = n((e) => {
115
+ o.current = e;
116
116
  }, []);
117
117
  return {
118
- handleAsync: n(async (t, n, i, a = !1) => {
119
- if (c(n) && !a) return;
120
- let u = ++r.current;
121
- if (l(n), n.length >= i || a) {
122
- s(), e.clearErrorState(), o.current = setTimeout(() => {
118
+ handleAsync: n(async (t, n, a, o = !1) => {
119
+ if (l(n) && !o) return;
120
+ let d = ++r.current;
121
+ if (u(n), n.length >= a || o) {
122
+ c(), e.clearErrorState(), s.current = setTimeout(() => {
123
123
  e.setLoadingState(!0);
124
- }, f);
124
+ }, i);
125
125
  try {
126
126
  let i = await t(n);
127
- if (u !== r.current) return;
128
- s(), e.setSearched(!0), e.updateWithResults(i, n);
127
+ if (d !== r.current) return;
128
+ c(), e.setSearched(!0), e.updateWithResults(i, n);
129
129
  } catch (t) {
130
- if (u !== r.current) return;
131
- s(), e.setSearched(!0), e.updateWithError(p(t));
130
+ if (d !== r.current) return;
131
+ c(), e.setSearched(!0), e.updateWithError(p(t));
132
132
  }
133
- } else s(), e.reset();
133
+ } else c(), e.reset();
134
134
  }, [
135
135
  e,
136
- c,
137
136
  l,
137
+ u,
138
138
  r,
139
- s
139
+ c,
140
+ i
140
141
  ]),
141
142
  handleSync: n((n, r, i, a = !1) => {
142
- if (!(c(r) && !a)) if (l(r), r.length >= i || a) {
143
+ if (!(l(r) && !a)) if (u(r), r.length >= i || a) {
143
144
  e.setSearched(!0);
144
145
  let i = t(r, n);
145
146
  e.updateWithResults(i, r);
146
147
  } else e.reset();
147
148
  }, [
148
149
  e,
149
- c,
150
- l
150
+ l,
151
+ u
151
152
  ])
152
153
  };
153
- }, g = ({ debounceThreshold: e = u, disabled: t = !1, initialOptions: i = [], minSearchLength: o = d, options: s = [], query: c = "" }) => {
154
- let f = m(), p = h(f, a(0)), [g] = l(c, e), _ = n((e = !1) => {
154
+ }, g = ({ debounceThreshold: e = u, disabled: t = !1, initialOptions: i = [], loadingDelay: o = f, minSearchLength: s = d, options: c = [], query: p = "" }) => {
155
+ let g = m(), _ = h(g, a(0), o), [v] = l(p, e), y = n((e = !1) => {
155
156
  if (!t) {
156
- if (typeof s == "function") {
157
- p.handleAsync(s, g, o, e);
157
+ if (typeof c == "function") {
158
+ _.handleAsync(c, v, s, e);
158
159
  return;
159
160
  }
160
- p.handleSync(s, g, o, e);
161
+ _.handleSync(c, v, s, e);
161
162
  }
162
163
  }, [
163
164
  t,
164
- g,
165
- o,
165
+ v,
166
166
  s,
167
- p
167
+ c,
168
+ _
168
169
  ]);
169
170
  r(() => {
170
- t || _();
171
- }, [t, _]);
172
- let v;
173
- return v = t ? Array.isArray(s) ? s : i ?? [] : f.results.length ? f.results : g.length ? [] : i ?? [], {
174
- clearError: f.clearError,
175
- debouncedQuery: g,
176
- error: f.error,
177
- loading: t ? !1 : f.loading,
178
- shouldShowInstructions: !t && c.length < o && !f.results.length && !i?.length,
179
- shouldShowDebounceWaiting: !t && c.length >= o && g.length < o && !f.loading && !f.hasSearched,
180
- shouldShowNoResults: !t && f.hasSearched && !f.loading && f.results.length === 0 && c.length >= o,
181
- results: v,
182
- startSearch: _,
183
- stopSearch: f.reset
171
+ t || y();
172
+ }, [t, y]);
173
+ let b;
174
+ return b = t ? Array.isArray(c) ? c : i ?? [] : g.results.length ? g.results : v.length ? [] : i ?? [], {
175
+ clearError: g.clearError,
176
+ debouncedQuery: v,
177
+ error: g.error,
178
+ loading: !t && g.loading,
179
+ shouldShowInstructions: !t && p.length < s && !g.results.length && !i?.length,
180
+ shouldShowDebounceWaiting: !t && p.length >= s && v.length < s && !g.loading && !g.hasSearched,
181
+ shouldShowNoResults: !t && g.hasSearched && !g.loading && g.results.length === 0 && p.length >= s,
182
+ results: b,
183
+ startSearch: y,
184
+ stopSearch: g.reset
184
185
  };
185
186
  };
186
187
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iress-oss/ids-components",
3
- "version": "6.1.0",
3
+ "version": "6.2.1",
4
4
  "description": "Iress React Component Library",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -43,36 +43,36 @@
43
43
  "@types/query-selector-shadow-dom": "1.0.4",
44
44
  "@types/react": "^19.2.14",
45
45
  "@types/react-dom": "^19.2.3",
46
- "@vitejs/plugin-react": "^6.0.1",
47
- "@vitest/coverage-v8": "4.1.5",
48
- "@vitest/ui": "4.1.5",
46
+ "@vitejs/plugin-react": "^6.0.3",
47
+ "@vitest/coverage-v8": "4.1.10",
48
+ "@vitest/ui": "4.1.10",
49
49
  "concurrently": "^9.2.1",
50
- "dompurify": "^3.4.1",
51
- "eslint": "10.3.0",
50
+ "dompurify": "^3.4.12",
51
+ "eslint": "10.6.0",
52
52
  "eslint-plugin-file-progress": "^4.0.0",
53
- "eslint-plugin-mdx": "3.7.0",
54
- "eslint-plugin-prettier": "5.5.5",
53
+ "eslint-plugin-mdx": "3.8.1",
54
+ "eslint-plugin-prettier": "5.5.6",
55
55
  "eslint-plugin-react-hooks": "^7.1.1",
56
- "eslint-plugin-react-refresh": "^0.5.2",
56
+ "eslint-plugin-react-refresh": "^0.5.3",
57
57
  "eslint-plugin-sonarjs": "^4.0.3",
58
58
  "glob": "13.0.6",
59
59
  "jest-axe": "10.0.0",
60
60
  "jsdom": "29.1.1",
61
61
  "lightningcss": "^1.32.0",
62
- "postcss": "8.5.15",
62
+ "postcss": "8.5.19",
63
63
  "prettier": "^3.8.2",
64
64
  "react": "^19.2.6",
65
65
  "react-dom": "^19.2.6",
66
66
  "react-dropzone": "15.0.0",
67
67
  "react-hook-form": "7.72.1",
68
68
  "rimraf": "^6.1.3",
69
- "storybook": "10.3.6",
69
+ "storybook": "10.4.6",
70
70
  "typescript": "6.0.3",
71
- "vite": "8.0.11",
71
+ "vite": "8.1.5",
72
72
  "vite-bundle-visualizer": "^1.2.1",
73
- "vite-plugin-dts": "5.0.0",
74
- "vite-plugin-static-copy": "4.1.0",
75
- "vitest": "4.1.5"
73
+ "vite-plugin-dts": "5.0.3",
74
+ "vite-plugin-static-copy": "4.1.1",
75
+ "vitest": "4.1.10"
76
76
  },
77
77
  "dependencies": {
78
78
  "@floating-ui/react": "0.27.19",
@@ -81,7 +81,7 @@
81
81
  "@tanstack/react-virtual": "3.13.12",
82
82
  "@types/mdx": "^2.0.13",
83
83
  "fuzzysort": "3.1.0",
84
- "material-symbols": "0.44.6",
84
+ "material-symbols": "0.45.6",
85
85
  "query-selector-shadow-dom": "1.0.1",
86
86
  "use-debounce": "10.1.1"
87
87
  },
@@ -1,321 +0,0 @@
1
- import { t as e } from "./cx-CZ8IJJTy.js";
2
- import { GlobalCSSClass as t } from "./enums.js";
3
- import { idsLogger as n } from "./helpers/utility/idsLogger.js";
4
- import { IressIcon as r } from "./components/Icon/Icon.js";
5
- import { IressText as i } from "./components/Text/Text.js";
6
- import { propagateTestid as a } from "./helpers/utility/propagateTestid.js";
7
- import { IressSpinner as o } from "./components/Spinner/Spinner.js";
8
- import { toArray as s } from "./helpers/formatting/toArray.js";
9
- import { useControlledState as ee } from "./hooks/useControlledState.js";
10
- import { useResponsiveProps as te } from "./hooks/useResponsiveProps.js";
11
- import { IressPopover as ne } from "./components/Popover/Popover.js";
12
- import { IressInputPopover as re } from "./components/Popover/InputPopover/InputPopover.js";
13
- import { IressAlert as c } from "./components/Alert/Alert.js";
14
- import { autoComplete as ie } from "./components/Autocomplete/Autocomplete.styles.js";
15
- import { getFormControlValueAsStringIfDefined as l } from "./helpers/form/getFormControlValueAsStringIfDefined.js";
16
- import { useNoDefaultValueInForms as ae } from "./patterns/Form/hooks/useNoDefaultValueInForms.js";
17
- import { IressReadonly as oe } from "./components/Readonly/Readonly.js";
18
- import { IressInput as se } from "./components/Input/Input.js";
19
- import { getValueAsEvent as u } from "./helpers/form/getValueAsEvent.js";
20
- import { t as ce } from "./useAutocompleteSearch-DxKxs6HH.js";
21
- import { AutocompleteInstructions as d } from "./components/Autocomplete/components/AutocompleteInstructions.js";
22
- import { select as le } from "./components/Select/Select.styles.js";
23
- import { IressInline as f } from "./components/Inline/Inline.js";
24
- import { SelectActivator as ue } from "./components/Select/components/SelectActivator.js";
25
- import { IressSelectMenu as p } from "./components/Select/SelectMenu/SelectMenu.js";
26
- import { SelectOptions as m } from "./components/Select/components/SelectOptions.js";
27
- import { SelectHiddenInput as de } from "./components/Select/components/SelectHiddenInput.js";
28
- import { NativeSelect as fe } from "./components/Select/components/NativeSelect.js";
29
- import { useSelectState as pe } from "./components/Select/hooks/useSelectState.js";
30
- import { forwardRef as h, useCallback as me, useEffect as g, useImperativeHandle as he, useMemo as _, useRef as v, useState as y } from "react";
31
- import { Fragment as ge, jsx as b, jsxs as x } from "react/jsx-runtime";
32
- //#region src/components/Select/Select.tsx
33
- var S = (e) => typeof e == "object" && !!e && "label" in e, C = (e, t) => {
34
- for (let n of t) if (n.children) {
35
- let t = C(e, n.children);
36
- if (t) return t;
37
- } else if (n.value !== void 0 && n.value === e) return n;
38
- }, w = (e, t) => {
39
- if (S(e)) return e;
40
- if (typeof t != "function") return C(e, t) ?? (typeof e == "number" ? C(String(e), t) : void 0);
41
- }, T = (e, t) => {
42
- if (e !== void 0) {
43
- if (Array.isArray(e)) {
44
- let r = e, i = r.map((e) => w(e, t)).filter((e) => e !== void 0);
45
- return i.length < r.length && typeof t != "function" && n(`IressSelect: ${r.length - i.length} value(s) could not be resolved to matching options and were dropped.`, "warn"), i;
46
- }
47
- return w(e, t);
48
- }
49
- }, E = h(({ align: r = "bottom-start", autoHighlight: i = !0, className: a, defaultValue: o, disabled: s, footer: ee, header: re, id: c, matchActivatorWidth: ie = !0, multiSelect: l, multiSelectLimit: se, name: u, onChange: d, onBlur: f, options: p, native: h, placeholder: C, readOnly: w, renderHiddenInput: E, renderLabel: D, renderOptions: _e, required: O, type: k, value: A, virtualFocus: j, width: M, ...N }, P) => {
50
- ae({
51
- component: "IressSelect",
52
- defaultValue: o
53
- });
54
- let [F, I] = y(!1), L = F && !s, [R, ve] = y(""), z = _(() => T(A, p), [A, p]), B = _(() => T(o, p), [o, p]);
55
- g(() => {
56
- A !== void 0 && !S(A) && z === void 0 && typeof p == "function" && n("IressSelect: A primitive value was passed but cannot be resolved because options are asynchronous. Pass a LabelValueMeta object instead when using async options, otherwise the component will behave as uncontrolled.", "warn");
57
- }, [
58
- A,
59
- z,
60
- p
61
- ]);
62
- let { value: V, setValue: H, getValuesString: U, getLabelsString: ye } = pe({
63
- component: "IressSelect",
64
- defaultValue: B,
65
- multiple: l,
66
- value: z
67
- }), W = v(null), G = v(null), K = v(null), { value: q } = te(typeof h == "string" ? {
68
- xs: !0,
69
- [h]: !1
70
- } : { xs: h }, { disabled: !h }), { append: be, debounceThreshold: xe, initialOptions: J, minSearchLength: Y, onActivated: X, onDeactivated: Se, prepend: Ce, selectedOptionsText: we, ...Z } = N, { debouncedQuery: Te, error: Ee, results: De, stopSearch: Oe, loading: ke, shouldShowInstructions: Ae, shouldShowNoResults: je } = ce({
71
- debounceThreshold: xe,
72
- disabled: !F || !!q,
73
- initialOptions: J,
74
- minSearchLength: Y,
75
- options: p,
76
- query: R
77
- });
78
- he(P, () => q ? {
79
- focus: () => G.current?.focus(),
80
- blur: () => G.current?.blur(),
81
- input: G.current ?? null
82
- } : W.current ? {
83
- ...W.current,
84
- focus: () => W.current?.getActivator()?.focus(),
85
- blur: () => W.current?.getActivator()?.blur(),
86
- hiddenInput: K.current ?? void 0,
87
- input: K.current ?? null
88
- } : {
89
- hiddenInput: K.current ?? void 0,
90
- input: K.current ?? null,
91
- focus: () => K.current?.focus(),
92
- blur: () => K.current?.blur()
93
- }, [q]), g(() => {
94
- F ? X?.() : Se?.();
95
- }, [
96
- X,
97
- Se,
98
- F
99
- ]);
100
- let Me = me((e) => {
101
- if (!f) return;
102
- let t = e.currentTarget, n = e.relatedTarget;
103
- !F && (!n || !t.contains(n)) && f(e), e.stopPropagation();
104
- }, [f, F]);
105
- if (w) return /* @__PURE__ */ b(oe, {
106
- value: U(),
107
- ref: K,
108
- variant: w,
109
- name: u,
110
- disabled: s,
111
- required: O,
112
- children: ye(", ")
113
- });
114
- if (q) {
115
- if (p instanceof Function) throw Error("[IressSelect] The native select does not support asynchronous options. Please provide options as an array.");
116
- if (l) throw Error("[IressSelect] The native select does not support multiple selection. Please remove the multiSelect prop or use the non-native select.");
117
- return /* @__PURE__ */ b(fe, {
118
- className: e(a, t.Select),
119
- "data-testid": Z["data-testid"],
120
- disabled: s,
121
- id: c,
122
- name: u,
123
- onChange: (e, t) => {
124
- d?.(e, t?.value ?? null, t), H(t);
125
- },
126
- options: p,
127
- placeholder: typeof h == "string" ? C ?? "" : C,
128
- style: Z.style,
129
- value: V,
130
- width: M,
131
- ref: G
132
- });
133
- }
134
- let Q = typeof p == "function", Ne = j ?? !Q, Pe = k ?? (Q ? void 0 : "listbox"), $ = le({ width: M }), Fe = () => {
135
- I(!0);
136
- }, Ie = () => {
137
- I(!1), Oe();
138
- };
139
- return /* @__PURE__ */ x(ge, { children: [/* @__PURE__ */ b(de, {
140
- "data-testid": Z["data-testid"],
141
- getValuesString: U,
142
- name: u,
143
- renderHiddenInput: E,
144
- required: O,
145
- value: V,
146
- disabled: s,
147
- ref: K
148
- }), /* @__PURE__ */ b(ne, {
149
- ...Z,
150
- activator: /* @__PURE__ */ b(ue, {
151
- append: be,
152
- async: Q,
153
- disabled: s,
154
- error: Ee,
155
- id: c,
156
- loading: ke,
157
- multiSelect: l,
158
- multiSelectLimit: se,
159
- onChange: d,
160
- placeholder: C,
161
- prepend: Ce,
162
- renderLabel: D,
163
- selectedOptionsText: we,
164
- setValue: H,
165
- setShow: I,
166
- show: F,
167
- value: V
168
- }),
169
- align: r,
170
- className: e(a, $.root, t.Select),
171
- contentClassName: e($.popoverContent),
172
- contentStyle: {
173
- ...Z.contentStyle,
174
- p: "none"
175
- },
176
- matchActivatorWidth: ie,
177
- onActivated: Fe,
178
- onDeactivated: Ie,
179
- ref: W,
180
- show: L,
181
- type: Pe,
182
- virtualFocus: Ne,
183
- onBlur: Me,
184
- children: /* @__PURE__ */ x("div", {
185
- className: $.wrapper,
186
- children: [
187
- re,
188
- /* @__PURE__ */ b(m, {
189
- autoHighlight: i,
190
- debouncedQuery: Te,
191
- error: Ee,
192
- initialOptions: J,
193
- loading: ke,
194
- minSearchLength: Y,
195
- multiSelect: l,
196
- onChange: d,
197
- options: p,
198
- query: R,
199
- renderOptions: _e,
200
- results: De,
201
- setQuery: ve,
202
- setShow: I,
203
- setValue: H,
204
- shouldShowInstructions: Ae,
205
- shouldShowNoResults: je,
206
- show: L,
207
- value: V
208
- }),
209
- ee
210
- ]
211
- })
212
- })] });
213
- });
214
- E.displayName = "IressSelect";
215
- //#endregion
216
- //#region src/components/Autocomplete/Autocomplete.tsx
217
- var D = h(({ alwaysShowOnFocus: n, append: te = /* @__PURE__ */ b(r, { name: "search" }), autoComplete: ne = "off", autoSelect: ae = !0, className: le, clearable: ue = !0, "data-testid": m, debounceThreshold: de, defaultValue: fe, errorText: pe = /* @__PURE__ */ b(c, {
218
- status: "danger",
219
- mb: "none",
220
- borderRadius: "radius.system.form",
221
- children: "An unknown error occurred. Please contact support if the error persists."
222
- }), initialOptions: h, limitDesktop: me = 12, limitMobile: he = 6, minSearchLength: _, noResultsText: v, onChange: S, onClear: C, onFocus: w, options: T, popoverProps: { autoHighlight: E = !1, append: D, prepend: _e, ...O } = {}, readOnly: k, value: A, ...j }, M) => {
223
- let [N, P] = y(!1), { value: F, setValue: I } = ee({
224
- component: "IressAutocomplete",
225
- defaultValue: fe,
226
- value: A
227
- }), [L, R] = y(!1), { clearError: ve, debouncedQuery: z, error: B, loading: V, results: H, startSearch: U, stopSearch: ye, shouldShowInstructions: W, shouldShowNoResults: G } = ce({
228
- debounceThreshold: de,
229
- initialOptions: h,
230
- minSearchLength: _,
231
- options: T,
232
- query: l(F)
233
- });
234
- if (g(() => {
235
- L && !N && H.length > 0 && F && P(!0);
236
- }, [
237
- H.length,
238
- N,
239
- L,
240
- F
241
- ]), g(() => {
242
- V && L && P(!0);
243
- }, [V, L]), g(() => {
244
- B && P(!0);
245
- }, [B]), k) return /* @__PURE__ */ b(oe, {
246
- value: F,
247
- variant: k
248
- });
249
- let K = (e, t) => {
250
- S?.(e, t), I(t), R(!!t);
251
- }, q = (e) => {
252
- C?.(e), I("");
253
- }, be = (e) => {
254
- w?.(e), h?.length && P(!0);
255
- }, xe = (e) => {
256
- let t = s(e)?.[0];
257
- S?.(u(t?.label), t?.label, t), I(t?.label), P(!1), R(!1);
258
- }, J = () => {
259
- (!n || !F) && ye(), ve(), P(!1), F && R(!1);
260
- }, Y = (e) => {
261
- j.onKeyDown?.(e), e.key === "ArrowDown" && (!N || !L) && (H.length || U(!0), R(!0), P(!0));
262
- }, X = ie({ isEmpty: H.length === 0 && !V && !B && !W && !G });
263
- return /* @__PURE__ */ x(re, {
264
- ...O,
265
- activator: /* @__PURE__ */ b(se, {
266
- ...j,
267
- append: te,
268
- autoComplete: ne,
269
- clearable: ue,
270
- "data-testid": a(m, "input"),
271
- onChange: K,
272
- onClear: q,
273
- onFocus: be,
274
- onKeyDown: Y,
275
- value: F,
276
- ref: M
277
- }),
278
- autoHighlight: E,
279
- className: e(le, O.className, X.root, t.Autocomplete),
280
- contentClassName: e(O.contentClassName, X.popoverContent),
281
- contentStyle: O.contentStyle,
282
- "data-testid": m,
283
- minLength: 0,
284
- onActivated: () => (L || n) && P(!0),
285
- onDeactivated: J,
286
- show: N,
287
- type: "listbox",
288
- focusStartIndex: 0,
289
- children: [
290
- V && !H.length && /* @__PURE__ */ x(f, {
291
- gap: "sm",
292
- verticalAlign: "middle",
293
- p: "spacing.3",
294
- children: [/* @__PURE__ */ b(o, { color: "colour.neutral.70" }), /* @__PURE__ */ b(i, {
295
- color: "colour.neutral.70",
296
- children: "Loading results..."
297
- })]
298
- }),
299
- H.length > 0 && /* @__PURE__ */ x(ge, { children: [
300
- _e,
301
- /* @__PURE__ */ b(p, {
302
- changeOnBlur: ae,
303
- className: e(X.optionList),
304
- "data-testid": a(m, "menu"),
305
- items: H,
306
- limitDesktop: me,
307
- limitMobile: he,
308
- onChange: xe,
309
- selected: { label: z }
310
- }),
311
- D
312
- ] }),
313
- B && pe,
314
- W && !B && /* @__PURE__ */ b(d, { minSearchLength: _ ?? 1 }),
315
- G && !B && v
316
- ]
317
- });
318
- });
319
- D.displayName = "IressAutocomplete";
320
- //#endregion
321
- export { E as n, D as t };