@viasat/beam-react 2.2.0 → 2.8.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 (260) hide show
  1. package/assets/ActionList.css +1 -1
  2. package/assets/Checkbox.css +1 -1
  3. package/assets/RadioButton.css +1 -1
  4. package/assets/Search.Results.css +1 -0
  5. package/assets/card.css +1 -1
  6. package/assets/panel.css +1 -0
  7. package/chunks/ActionList.Group.B4PX5SKS.js +111 -0
  8. package/chunks/ActionList.Group.C2R56u2A.js +1 -0
  9. package/chunks/ActionList.Item.5Y-SwzjK.js +1 -0
  10. package/chunks/{ActionList.Item.Dg_KHGsm.js → ActionList.Item.BFcT86lS.js} +3 -2
  11. package/chunks/Search.Results.Item.CLmMBPz1.js +41 -0
  12. package/chunks/Search.Results.Item.Dkh2yo4p.js +1 -0
  13. package/chunks/card.module.8KnCe1uR.js +1 -0
  14. package/chunks/{card.module.Dy87qmTH.js → card.module.ByBYpexJ.js} +12 -6
  15. package/chunks/dom.DGM-dxLe.js +21 -0
  16. package/chunks/dom.zgzOBFUw.js +1 -0
  17. package/chunks/{form.context.B1PXIJNq.js → form.context.B26th8Od.js} +1 -1
  18. package/chunks/{form.context.CNWjF5qA.js → form.context.CfsTSQpm.js} +1 -1
  19. package/chunks/panel.module.DbEoAg1J.js +1 -0
  20. package/chunks/panel.module.RGiUyC84.js +30 -0
  21. package/chunks/tokens.BD_71qmL.js +19 -0
  22. package/chunks/tokens.Bc11gmpN.js +1 -0
  23. package/index.cjs.js +1 -1
  24. package/index.es.js +17 -15
  25. package/lib/ActionList/ActionList.Group.cjs.js +1 -1
  26. package/lib/ActionList/ActionList.Group.d.ts +7 -4
  27. package/lib/ActionList/ActionList.Group.es.js +2 -2
  28. package/lib/ActionList/ActionList.IconButton.cjs.js +1 -1
  29. package/lib/ActionList/ActionList.IconButton.es.js +1 -1
  30. package/lib/ActionList/ActionList.Item.cjs.js +1 -1
  31. package/lib/ActionList/ActionList.Item.es.js +3 -3
  32. package/lib/ActionList/ActionList.cjs.js +1 -1
  33. package/lib/ActionList/ActionList.d.ts +1 -1
  34. package/lib/ActionList/ActionList.es.js +54 -54
  35. package/lib/ActionList/useActionListChildren.cjs.js +1 -1
  36. package/lib/ActionList/useActionListChildren.es.js +2 -2
  37. package/lib/Autocomplete/Autocomplete.cjs.js +1 -1
  38. package/lib/Autocomplete/Autocomplete.es.js +1 -1
  39. package/lib/Autocomplete/AutocompleteDropdown.cjs.js +1 -1
  40. package/lib/Autocomplete/AutocompleteDropdown.es.js +1 -1
  41. package/lib/Autocomplete/useAutocompleteA11y.cjs.js +1 -1
  42. package/lib/Autocomplete/useAutocompleteA11y.es.js +1 -1
  43. package/lib/Autocomplete/useAutocompleteDropdown.cjs.js +1 -1
  44. package/lib/Autocomplete/useAutocompleteDropdown.es.js +1 -1
  45. package/lib/Box/utils.cjs.js +1 -0
  46. package/lib/Box/utils.d.ts +6 -0
  47. package/lib/Box/utils.es.js +12 -0
  48. package/lib/Button/Button.cjs.js +1 -1
  49. package/lib/Button/Button.es.js +1 -1
  50. package/lib/Card/Card.Body.cjs.js +1 -1
  51. package/lib/Card/Card.Body.es.js +1 -1
  52. package/lib/Card/Card.Content.cjs.js +1 -1
  53. package/lib/Card/Card.Content.es.js +12 -17
  54. package/lib/Card/Card.Footer.cjs.js +1 -1
  55. package/lib/Card/Card.Footer.d.ts +1 -1
  56. package/lib/Card/Card.Footer.es.js +1 -1
  57. package/lib/Card/Card.Header.cjs.js +1 -1
  58. package/lib/Card/Card.Header.es.js +1 -1
  59. package/lib/Card/Card.Media.cjs.js +1 -1
  60. package/lib/Card/Card.Media.es.js +1 -1
  61. package/lib/Card/Card.cjs.js +1 -1
  62. package/lib/Card/Card.d.ts +61 -18
  63. package/lib/Card/Card.es.js +181 -82
  64. package/lib/Card/CardContext.cjs.js +1 -1
  65. package/lib/Card/CardContext.d.ts +10 -8
  66. package/lib/Card/CardContext.es.js +7 -12
  67. package/lib/Card/CardGroup.cjs.js +1 -0
  68. package/lib/Card/CardGroup.d.ts +55 -0
  69. package/lib/Card/CardGroup.es.js +67 -0
  70. package/lib/Card/card.utils.cjs.js +1 -0
  71. package/lib/Card/card.utils.d.ts +7 -0
  72. package/lib/Card/card.utils.es.js +14 -0
  73. package/lib/Card/index.cjs.js +1 -1
  74. package/lib/Card/index.d.ts +9 -1
  75. package/lib/Card/index.es.js +4 -2
  76. package/lib/Card/useCardGroup.cjs.js +1 -0
  77. package/lib/Card/useCardGroup.d.ts +27 -0
  78. package/lib/Card/useCardGroup.es.js +42 -0
  79. package/lib/Card/useCardGroupValue.cjs.js +1 -0
  80. package/lib/Card/useCardGroupValue.d.ts +14 -0
  81. package/lib/Card/useCardGroupValue.es.js +29 -0
  82. package/lib/Checkbox/Checkbox.cjs.js +1 -1
  83. package/lib/Checkbox/Checkbox.es.js +1 -1
  84. package/lib/Dialog/Dialog.Trigger.cjs.js +1 -1
  85. package/lib/Dialog/Dialog.Trigger.es.js +7 -6
  86. package/lib/EmptyState/EmptyState.cjs.js +1 -1
  87. package/lib/EmptyState/EmptyState.es.js +1 -1
  88. package/lib/FileUpload/FileUpload.List.Item.cjs.js +1 -1
  89. package/lib/FileUpload/FileUpload.List.Item.es.js +20 -20
  90. package/lib/FileUpload/FileUpload.cjs.js +1 -1
  91. package/lib/FileUpload/FileUpload.es.js +1 -1
  92. package/lib/FloatingUI/index.cjs.js +1 -1
  93. package/lib/FloatingUI/index.d.ts +1 -0
  94. package/lib/FloatingUI/index.es.js +7 -5
  95. package/lib/FloatingUI/useBlur.cjs.js +1 -0
  96. package/lib/FloatingUI/useBlur.d.ts +8 -0
  97. package/lib/FloatingUI/useBlur.es.js +15 -0
  98. package/lib/FloatingUI/useTyping.cjs.js +1 -0
  99. package/lib/FloatingUI/useTyping.d.ts +10 -0
  100. package/lib/FloatingUI/useTyping.es.js +42 -0
  101. package/lib/Form/Form.cjs.js +1 -1
  102. package/lib/Form/Form.es.js +1 -1
  103. package/lib/Form/contexts/form.context.cjs.js +1 -1
  104. package/lib/Form/contexts/form.context.es.js +1 -1
  105. package/lib/Form/contexts/index.cjs.js +1 -1
  106. package/lib/Form/contexts/index.es.js +1 -1
  107. package/lib/Form/hooks/index.cjs.js +1 -1
  108. package/lib/Form/hooks/index.es.js +1 -1
  109. package/lib/Form/hooks/useFieldValidator.hook.cjs.js +1 -1
  110. package/lib/Form/hooks/useFieldValidator.hook.es.js +2 -2
  111. package/lib/HelperText/HelperText.cjs.js +1 -1
  112. package/lib/HelperText/HelperText.es.js +1 -1
  113. package/lib/HelperText/index.cjs.js +1 -1
  114. package/lib/HelperText/index.es.js +1 -1
  115. package/lib/InputChoiceGroup/InputChoiceGroup.cjs.js +1 -1
  116. package/lib/InputChoiceGroup/InputChoiceGroup.es.js +1 -1
  117. package/lib/Label/Label.cjs.js +1 -1
  118. package/lib/Label/Label.es.js +1 -1
  119. package/lib/Link/Link.cjs.js +1 -1
  120. package/lib/Link/Link.es.js +6 -6
  121. package/lib/NativeSelect/NativeSelect.cjs.js +1 -1
  122. package/lib/NativeSelect/NativeSelect.es.js +1 -1
  123. package/lib/Popover/Popover.cjs.js +1 -1
  124. package/lib/Popover/Popover.es.js +1 -1
  125. package/lib/Popover/Popover.trigger.cjs.js +1 -1
  126. package/lib/Popover/Popover.trigger.es.js +7 -6
  127. package/lib/Popover/Popover.utils.cjs.js +1 -1
  128. package/lib/Popover/Popover.utils.es.js +1 -1
  129. package/lib/ProgressBar/ProgressBar.cjs.js +1 -1
  130. package/lib/ProgressBar/ProgressBar.es.js +1 -1
  131. package/lib/RadioButton/RadioButton.cjs.js +1 -1
  132. package/lib/RadioButton/RadioButton.es.js +1 -1
  133. package/lib/Select/Select.cjs.js +1 -1
  134. package/lib/Select/Select.es.js +1 -1
  135. package/lib/Select/SelectDropdown.cjs.js +1 -1
  136. package/lib/Select/SelectDropdown.es.js +1 -1
  137. package/lib/Select/useSelectA11y.cjs.js +1 -1
  138. package/lib/Select/useSelectA11y.es.js +1 -1
  139. package/lib/SideNav/SideNavActionListGroup.cjs.js +1 -1
  140. package/lib/SideNav/SideNavActionListGroup.es.js +1 -1
  141. package/lib/SideNav/SideNavActionListItem.cjs.js +1 -1
  142. package/lib/SideNav/SideNavActionListItem.es.js +1 -1
  143. package/lib/SideNav/SideNavActionListItemExpandable.cjs.js +1 -1
  144. package/lib/SideNav/SideNavActionListItemExpandable.es.js +1 -1
  145. package/lib/SideNav/SideNavActionListItemFlyout.cjs.js +1 -1
  146. package/lib/SideNav/SideNavActionListItemFlyout.es.js +1 -1
  147. package/lib/Slider/DualSlider.cjs.js +1 -1
  148. package/lib/Slider/DualSlider.d.ts +1 -1
  149. package/lib/Slider/DualSlider.es.js +73 -72
  150. package/lib/Slider/SingleSlider.cjs.js +1 -1
  151. package/lib/Slider/SingleSlider.d.ts +1 -1
  152. package/lib/Slider/SingleSlider.es.js +52 -51
  153. package/lib/Slider/Slider.Error.cjs.js +1 -1
  154. package/lib/Slider/Slider.Error.es.js +1 -1
  155. package/lib/Slider/Slider.Thumb.cjs.js +1 -1
  156. package/lib/Slider/Slider.Thumb.es.js +1 -1
  157. package/lib/Slider/Slider.cjs.js +1 -1
  158. package/lib/Slider/Slider.d.ts +1 -3
  159. package/lib/Slider/Slider.es.js +13 -11
  160. package/lib/Slider/Slider.types.d.ts +1 -1
  161. package/lib/Slider/hooks/useSliderBase.cjs.js +1 -1
  162. package/lib/Slider/hooks/useSliderBase.es.js +1 -1
  163. package/lib/Switch/Switch.cjs.js +1 -1
  164. package/lib/Switch/Switch.es.js +1 -1
  165. package/lib/Tabs/Tabs.Group.cjs.js +1 -1
  166. package/lib/Tabs/Tabs.Group.es.js +1 -1
  167. package/lib/TextArea/TextArea.cjs.js +1 -1
  168. package/lib/TextArea/TextArea.es.js +1 -1
  169. package/lib/TextField/TextField.cjs.js +1 -1
  170. package/lib/TextField/TextField.es.js +1 -1
  171. package/lib/Tooltip/Tooltip.cjs.js +1 -1
  172. package/lib/Tooltip/Tooltip.es.js +9 -9
  173. package/lib/_Options/useSelectValue.cjs.js +1 -1
  174. package/lib/_Options/useSelectValue.es.js +1 -1
  175. package/lib/index.cjs.js +1 -1
  176. package/lib/index.es.js +18 -16
  177. package/lib/wip/Panel/Panel.Body.cjs.js +1 -0
  178. package/lib/wip/Panel/Panel.Body.d.ts +11 -0
  179. package/lib/wip/Panel/Panel.Body.es.js +17 -0
  180. package/lib/wip/Panel/Panel.Footer.Actions.cjs.js +1 -0
  181. package/lib/wip/Panel/Panel.Footer.Actions.d.ts +17 -0
  182. package/lib/wip/Panel/Panel.Footer.Actions.es.js +22 -0
  183. package/lib/wip/Panel/Panel.Footer.cjs.js +1 -0
  184. package/lib/wip/Panel/Panel.Footer.d.ts +20 -0
  185. package/lib/wip/Panel/Panel.Footer.es.js +24 -0
  186. package/lib/wip/Panel/Panel.Header.ContentAfter.cjs.js +1 -0
  187. package/lib/wip/Panel/Panel.Header.ContentAfter.d.ts +11 -0
  188. package/lib/wip/Panel/Panel.Header.ContentAfter.es.js +17 -0
  189. package/lib/wip/Panel/Panel.Header.ContentBefore.cjs.js +1 -0
  190. package/lib/wip/Panel/Panel.Header.ContentBefore.d.ts +11 -0
  191. package/lib/wip/Panel/Panel.Header.ContentBefore.es.js +17 -0
  192. package/lib/wip/Panel/Panel.Header.Description.cjs.js +1 -0
  193. package/lib/wip/Panel/Panel.Header.Description.d.ts +11 -0
  194. package/lib/wip/Panel/Panel.Header.Description.es.js +17 -0
  195. package/lib/wip/Panel/Panel.Header.Heading.cjs.js +1 -0
  196. package/lib/wip/Panel/Panel.Header.Heading.d.ts +11 -0
  197. package/lib/wip/Panel/Panel.Header.Heading.es.js +17 -0
  198. package/lib/wip/Panel/Panel.Header.Row.cjs.js +1 -0
  199. package/lib/wip/Panel/Panel.Header.Row.d.ts +11 -0
  200. package/lib/wip/Panel/Panel.Header.Row.es.js +29 -0
  201. package/lib/wip/Panel/Panel.Header.Subheader.cjs.js +1 -0
  202. package/lib/wip/Panel/Panel.Header.Subheader.d.ts +11 -0
  203. package/lib/wip/Panel/Panel.Header.Subheader.es.js +17 -0
  204. package/lib/wip/Panel/Panel.Header.cjs.js +1 -0
  205. package/lib/wip/Panel/Panel.Header.d.ts +40 -0
  206. package/lib/wip/Panel/Panel.Header.es.js +34 -0
  207. package/lib/wip/Panel/Panel.cjs.js +1 -0
  208. package/lib/wip/Panel/Panel.context.cjs.js +1 -0
  209. package/lib/wip/Panel/Panel.context.d.ts +16 -0
  210. package/lib/wip/Panel/Panel.context.es.js +11 -0
  211. package/lib/wip/Panel/Panel.d.ts +45 -0
  212. package/lib/wip/Panel/Panel.es.js +43 -0
  213. package/lib/wip/Panel/Panel.types.cjs.js +1 -0
  214. package/lib/wip/Panel/Panel.types.d.ts +71 -0
  215. package/lib/wip/Panel/Panel.types.es.js +1 -0
  216. package/lib/wip/Panel/index.cjs.js +1 -0
  217. package/lib/wip/Panel/index.d.ts +12 -0
  218. package/lib/wip/Panel/index.es.js +4 -0
  219. package/lib/wip/Search/Search.Results.Item.cjs.js +1 -0
  220. package/lib/wip/Search/Search.Results.Item.d.ts +8 -0
  221. package/lib/wip/Search/Search.Results.Item.es.js +12 -0
  222. package/lib/wip/Search/Search.Results.cjs.js +1 -0
  223. package/lib/wip/Search/Search.Results.d.ts +12 -0
  224. package/lib/wip/Search/Search.Results.es.js +19 -0
  225. package/lib/wip/Search/Search.cjs.js +1 -0
  226. package/lib/wip/Search/Search.d.ts +88 -0
  227. package/lib/wip/Search/Search.es.js +157 -0
  228. package/lib/wip/Search/SearchDropdown.cjs.js +1 -0
  229. package/lib/wip/Search/SearchDropdown.d.ts +19 -0
  230. package/lib/wip/Search/SearchDropdown.es.js +71 -0
  231. package/lib/wip/Search/index.cjs.js +1 -0
  232. package/lib/wip/Search/index.d.ts +1 -0
  233. package/lib/wip/Search/index.es.js +4 -0
  234. package/lib/wip/Search/useSearchDropdown.cjs.js +1 -0
  235. package/lib/wip/Search/useSearchDropdown.d.ts +875 -0
  236. package/lib/wip/Search/useSearchDropdown.es.js +92 -0
  237. package/lib/wip/index.cjs.js +1 -1
  238. package/lib/wip/index.d.ts +2 -0
  239. package/lib/wip/index.es.js +6 -1
  240. package/package.json +6 -6
  241. package/utils/hooks/index.cjs.js +1 -1
  242. package/utils/hooks/index.d.ts +1 -0
  243. package/utils/hooks/index.es.js +33 -31
  244. package/utils/hooks/useDebounced.cjs.js +1 -0
  245. package/utils/hooks/useDebounced.d.ts +5 -0
  246. package/utils/hooks/useDebounced.es.js +18 -0
  247. package/utils/hooks/useEffectAfterMount.cjs.js +1 -0
  248. package/utils/hooks/useEffectAfterMount.d.ts +2 -0
  249. package/utils/hooks/useEffectAfterMount.es.js +14 -0
  250. package/utils/hooks/useInteractiveProps.cjs.js +1 -0
  251. package/utils/hooks/useInteractiveProps.d.ts +24 -0
  252. package/utils/hooks/useInteractiveProps.es.js +31 -0
  253. package/chunks/ActionList.Group.Bv9vgU22.js +0 -1
  254. package/chunks/ActionList.Group.DuNxYNZQ.js +0 -107
  255. package/chunks/ActionList.Item.D7Rg5iMb.js +0 -1
  256. package/chunks/card.module.BG9mkRao.js +0 -1
  257. package/chunks/dom.CVmkHCnh.js +0 -21
  258. package/chunks/dom.PCrm8EUc.js +0 -1
  259. package/chunks/tokens.Bgac_JPh.js +0 -1
  260. package/chunks/tokens.CXaNS8Cf.js +0 -13
@@ -1,98 +1,197 @@
1
- import { jsx as N, jsxs as K } from "react/jsx-runtime";
2
- import { useCallback as p } from "react";
3
- import L from "clsx";
4
- import { g as T } from "../../chunks/classNames.DNsS4J__.js";
1
+ import { jsxs as le, jsx as E } from "react/jsx-runtime";
2
+ import { useRef as ne, useMemo as de, useCallback as g } from "react";
3
+ import R from "clsx";
4
+ import { g as ce } from "../../chunks/classNames.DNsS4J__.js";
5
5
  import "../../chunks/constants.BBi77pmH.js";
6
- import { g as j } from "../../chunks/dom.CVmkHCnh.js";
7
- import { Box as F } from "../Box/Box.es.js";
8
- import { s as o } from "../../chunks/card.module.Dy87qmTH.js";
9
- import { MediaAbove as R } from "./Card.MediaAbove.es.js";
10
- import { Header as _ } from "./Card.Header.es.js";
11
- import { MediaBelow as C } from "./Card.MediaBelow.es.js";
12
- import { Body as O } from "./Card.Body.es.js";
13
- import { Content as V } from "./Card.Content.es.js";
14
- import { Footer as W } from "./Card.Footer.es.js";
15
- import { CardProvider as q } from "./CardContext.es.js";
16
- import { StateLayer as z } from "../StateLayer/StateLayer.es.js";
17
- const { baseClassNamePrefix: m, classModifierPrefix: E } = T("card"), G = 'button, a, input, select, textarea, [role="button"], [role="link"], [tabindex]:not([tabindex="-1"])', i = ({
18
- children: B,
19
- className: h,
20
- density: v = "md",
21
- borderColor: b,
22
- borderRadius: x,
23
- backgroundColor: y,
24
- shadow: $,
25
- type: c,
26
- as: I,
27
- disabled: r = !1,
28
- href: l,
29
- target: d,
30
- rel: P,
31
- onClick: a,
32
- ...g
6
+ import { Box as ue } from "../Box/Box.es.js";
7
+ import "../../chunks/CSSLookup.Cjf6o2Gz.js";
8
+ import "../../utils/hooks/useId.es.js";
9
+ import { useInteractiveProps as me } from "../../utils/hooks/useInteractiveProps.es.js";
10
+ import { s as t } from "../../chunks/card.module.ByBYpexJ.js";
11
+ import { BOX_BORDER_RADIUS_TO_CSS_VAR as fe } from "../Box/utils.es.js";
12
+ import { MediaAbove as be } from "./Card.MediaAbove.es.js";
13
+ import { Header as pe } from "./Card.Header.es.js";
14
+ import { MediaBelow as he } from "./Card.MediaBelow.es.js";
15
+ import { Body as ye } from "./Card.Body.es.js";
16
+ import { Content as $e } from "./Card.Content.es.js";
17
+ import { Footer as Ie } from "./Card.Footer.es.js";
18
+ import { useCardGroupContext as ve } from "./CardContext.es.js";
19
+ import { useCardGroup as Ne } from "./useCardGroup.es.js";
20
+ import { StateLayer as Ce } from "../StateLayer/StateLayer.es.js";
21
+ const { baseClassNamePrefix: d, classModifierPrefix: n, subElementClassPrefix: c } = ce("card"), Ee = 'button, a, input:not([data-card-input]), select, textarea, [role="button"], [role="link"], [tabindex]:not([tabindex="-1"])', l = ({
22
+ children: T,
23
+ className: A,
24
+ density: x = "md",
25
+ borderColor: w,
26
+ borderRadius: b,
27
+ backgroundColor: S,
28
+ shadow: B,
29
+ type: D,
30
+ as: L,
31
+ disabled: k = !1,
32
+ href: M,
33
+ target: O,
34
+ rel: G,
35
+ onClick: i,
36
+ selectionMode: H = "single",
37
+ showIndicator: V = !1,
38
+ selected: j,
39
+ defaultSelected: F = !1,
40
+ onSelect: K,
41
+ name: U,
42
+ value: W,
43
+ style: p,
44
+ ...u
33
45
  }) => {
34
- const u = !!c, s = c === "clickable", n = I ?? (l ? "a" : "div"), f = p(
35
- (t) => {
36
- if (!t || !(t instanceof Element)) return !1;
37
- const M = t.closest(G);
38
- if (!M) return !1;
39
- const H = t.closest(`.${o[m]}`);
40
- return M !== H;
46
+ const h = ve();
47
+ process.env.NODE_ENV !== "production" && h && D === "clickable" && console.warn(
48
+ 'Card: type="clickable" is ignored when Card is inside a CardGroup; treating as selectable instead.'
49
+ );
50
+ const y = h ? "selectable" : D, $ = !!y, r = y === "clickable", o = y === "selectable", {
51
+ selected: I,
52
+ handleChange: X,
53
+ resolvedValue: q,
54
+ isSelectionEligible: v,
55
+ resolvedDisabled: a,
56
+ resolvedName: z,
57
+ resolvedShowIndicator: J,
58
+ inputType: _
59
+ } = Ne({
60
+ cardGroup: h,
61
+ selected: j,
62
+ defaultSelected: F,
63
+ value: W,
64
+ id: u.id,
65
+ disabled: k,
66
+ name: U,
67
+ selectionMode: H,
68
+ showIndicator: V,
69
+ onSelect: K
70
+ }), N = ne(null), m = L ?? (r && M ? "a" : "div"), Q = de(() => b ? {
71
+ ...p,
72
+ "--bm-card-radius-outer": fe[b]
73
+ } : p, [b, p]), f = g(
74
+ (e) => {
75
+ if (!e || !(e instanceof Element)) return !1;
76
+ const C = e.closest(Ee);
77
+ if (!C) return !1;
78
+ const s = e.closest(`.${t[d]}`);
79
+ return C !== s;
41
80
  },
42
81
  []
43
- ), w = p(
44
- (t) => {
45
- if (!(r || !s)) {
46
- if (f(t.target)) {
47
- t.preventDefault(), t.stopPropagation();
48
- return;
82
+ ), Y = g(
83
+ (e) => {
84
+ if (a) return;
85
+ if (f(e.target)) {
86
+ if (r && m === "a") {
87
+ const s = e.target, P = s == null ? void 0 : s.closest('a, [role="link"]');
88
+ (!P || P === e.currentTarget) && e.preventDefault();
49
89
  }
50
- a == null || a(t);
90
+ return;
91
+ }
92
+ if (r && (i == null || i(e)), o) {
93
+ if (!v) return;
94
+ const s = e.target;
95
+ if (s.tagName === "INPUT" && s.hasAttribute("data-card-input"))
96
+ return;
97
+ N.current && N.current.click();
51
98
  }
52
99
  },
53
- [r, s, f, a]
54
- ), A = p(
55
- (t) => {
56
- r || !s || t.key !== "Enter" && t.key !== " " || f(t.target) || (t.preventDefault(), a == null || a(t));
100
+ [
101
+ r,
102
+ o,
103
+ v,
104
+ f,
105
+ m,
106
+ i,
107
+ a
108
+ ]
109
+ ), Z = g(
110
+ (e) => {
111
+ a || e.key !== "Enter" && e.key !== " " || f(e.target) || (e.preventDefault(), r && (i == null || i(e)));
57
112
  },
58
- [r, s, f, a]
59
- ), D = n === "div", S = L(
60
- o[m],
61
- !y && o[`${m}--default-background`],
62
- !$ && o[`${m}--default-shadow`],
63
- !b && o[`${m}--default-border`],
64
- !x && o[`${m}--default-border-radius`],
65
- u && o[`${E}interactive`],
66
- s && o[`${E}clickable`],
67
- r && o[`${E}disabled`],
68
- h
69
- ), e = {};
70
- return u && (e.tabIndex = r ? -1 : 0, e["aria-disabled"] = r || void 0, s && (e.onClick = w, D && (e.onKeyDown = A), n === "a" && l && !r && (e.href = l, d && (e.target = d), e.rel = j(d, P)), n === "button" && (e.type = "button"), n === "div" && (e.role = "button"))), /* @__PURE__ */ N(q, { value: { density: v, type: c, disabled: r }, children: /* @__PURE__ */ K(
71
- F,
113
+ [r, f, i, a]
114
+ ), ee = R(
115
+ t[d],
116
+ !S && t[`${d}--default-background`],
117
+ !B && t[`${d}--default-shadow`],
118
+ !w && t[`${d}--default-border`],
119
+ $ && t[`${n}interactive`],
120
+ r && t[`${n}clickable`],
121
+ o && t[`${n}selectable`],
122
+ o && I && t[`${n}selected`],
123
+ a && t[`${n}disabled`],
124
+ x && t[`${n}density-${x}`],
125
+ A
126
+ ), te = me({
127
+ isInteractive: $,
128
+ disabled: a,
129
+ isClickable: r,
130
+ elementType: m,
131
+ href: r ? M : void 0,
132
+ target: r ? O : void 0,
133
+ rel: r ? G : void 0,
134
+ onClick: Y,
135
+ onKeyDown: Z
136
+ }), re = () => !o || !v ? null : /* @__PURE__ */ E(
137
+ "input",
138
+ {
139
+ ref: N,
140
+ type: _,
141
+ className: t[`${c}hidden-input`],
142
+ checked: I,
143
+ disabled: a,
144
+ name: z,
145
+ value: q,
146
+ onChange: X,
147
+ "aria-label": u["aria-label"],
148
+ "aria-labelledby": u["aria-labelledby"],
149
+ "data-card-input": ""
150
+ }
151
+ ), ae = () => {
152
+ if (!o || !J) return null;
153
+ const e = R(
154
+ t[`${c}selection-indicator`],
155
+ t[`${c}selection-indicator--${_}`],
156
+ I && t[`${c}selection-indicator--checked`],
157
+ a && t[`${c}selection-indicator--disabled`]
158
+ );
159
+ return /* @__PURE__ */ E("span", { className: e, "aria-hidden": "true" });
160
+ }, {
161
+ "aria-label": ie,
162
+ "aria-labelledby": oe,
163
+ ...se
164
+ } = u;
165
+ return /* @__PURE__ */ le(
166
+ ue,
72
167
  {
73
- as: n,
74
- className: S,
75
- borderColor: b,
76
- borderRadius: x,
168
+ as: m,
169
+ className: ee,
170
+ borderColor: w,
77
171
  borderWidth: "md",
78
- backgroundColor: y,
79
- shadow: $,
80
- ...e,
81
- ...g,
172
+ backgroundColor: S,
173
+ shadow: B,
174
+ style: Q,
175
+ ...te,
176
+ ...se,
177
+ "aria-label": o ? void 0 : ie,
178
+ "aria-labelledby": o ? void 0 : oe,
82
179
  children: [
83
- u && !r && /* @__PURE__ */ N(z, {}),
84
- B
180
+ re(),
181
+ ae(),
182
+ $ && !a && /* @__PURE__ */ E(Ce, {}),
183
+ T
85
184
  ]
86
185
  }
87
- ) });
186
+ );
88
187
  };
89
- i.displayName = "Card";
90
- i.MediaAbove = R;
91
- i.MediaBelow = C;
92
- i.Header = _;
93
- i.Body = O;
94
- i.Content = V;
95
- i.Footer = W;
188
+ l.displayName = "Card";
189
+ l.MediaAbove = be;
190
+ l.MediaBelow = he;
191
+ l.Header = pe;
192
+ l.Body = ye;
193
+ l.Content = $e;
194
+ l.Footer = Ie;
96
195
  export {
97
- i as Card
196
+ l as Card
98
197
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),r=require("react"),t=r.createContext(void 0),s=({children:e,value:o})=>n.jsx(t.Provider,{value:o,children:e}),d=()=>{const e=r.useContext(t);if(!e)throw new Error("useCard must be used within a CardProvider");return e};exports.CardProvider=s;exports.useCard=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),r=require("react"),e=r.createContext(void 0),n=({children:t,value:o})=>u.jsx(e.Provider,{value:o,children:t}),s=()=>r.useContext(e);exports.CardGroupProvider=n;exports.useCardGroupContext=s;
@@ -1,13 +1,15 @@
1
1
  import { default as React } from 'react';
2
- import { CardDensity, CardType } from '@viasat/beam-shared/components/card';
3
- interface CardContextValue {
4
- density: CardDensity;
5
- type?: CardType;
2
+ import { CardGroupSelectionMode } from '@viasat/beam-shared/components/card';
3
+ export interface CardGroupContextValue {
4
+ selectionMode?: CardGroupSelectionMode;
5
+ showIndicator?: boolean;
6
+ name?: string;
6
7
  disabled?: boolean;
8
+ value?: string | string[];
9
+ onItemSelect?: (value: string, event: React.ChangeEvent<HTMLInputElement>) => void;
7
10
  }
8
- export declare const CardProvider: ({ children, value, }: {
11
+ export declare const CardGroupProvider: ({ children, value, }: {
9
12
  children: React.ReactNode;
10
- value: CardContextValue;
13
+ value: CardGroupContextValue;
11
14
  }) => import("react/jsx-runtime").JSX.Element;
12
- export declare const useCard: () => CardContextValue;
13
- export {};
15
+ export declare const useCardGroupContext: () => CardGroupContextValue | undefined;
@@ -1,15 +1,10 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { createContext as n, useContext as d } from "react";
3
- const t = n(void 0), C = ({
4
- children: r,
5
- value: o
6
- }) => /* @__PURE__ */ e(t.Provider, { value: o, children: r }), a = () => {
7
- const r = d(t);
8
- if (!r)
9
- throw new Error("useCard must be used within a CardProvider");
10
- return r;
11
- };
2
+ import { createContext as n, useContext as u } from "react";
3
+ const r = n(void 0), p = ({
4
+ children: o,
5
+ value: t
6
+ }) => /* @__PURE__ */ e(r.Provider, { value: t, children: o }), s = () => u(r);
12
7
  export {
13
- C as CardProvider,
14
- a as useCard
8
+ p as CardGroupProvider,
9
+ s as useCardGroupContext
15
10
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),y=require("react"),f=require("clsx"),h=require("../../chunks/classNames.DAeKwerT.js");require("../../chunks/constants.hwjHOsvT.js");const G=require("../../chunks/card.module.8KnCe1uR.js");require("../../chunks/CSSLookup.DESAWWRT.js");const I=require("../../utils/hooks/useId.cjs.js"),M=require("./CardContext.cjs.js"),V=require("./useCardGroupValue.cjs.js"),{classModifierPrefix:j}=h.getBEMClassNames("card"),i=u=>{const{children:d,className:c,disabled:e=!1,selectionMode:a="single",showIndicator:r=!1,name:n,value:m,defaultValue:b,onChange:C,"aria-label":p,"aria-labelledby":q,...g}=u,v=I.useId(),s=n??v,{currentValue:l,handleItemSelect:o}=V.useCardGroupValue({value:m,defaultValue:b,selectionMode:a,onChange:C}),N=f(e&&G.styles[`${j}disabled`],c),_=a==="single"?"radiogroup":"group",x=y.useMemo(()=>({selectionMode:a,showIndicator:r,name:s,disabled:e,value:l,onItemSelect:o}),[a,r,s,e,l,o]);return t.jsx("div",{role:_,"aria-disabled":e||void 0,"aria-label":p,"aria-labelledby":q,className:N,...g,children:t.jsx(M.CardGroupProvider,{value:x,children:d})})};i.displayName="CardGroup";exports.CardGroup=i;
@@ -0,0 +1,55 @@
1
+ import { default as React } from 'react';
2
+ import { CardGroupSelectionMode } from '@viasat/beam-shared/components/card';
3
+ export type CardGroupProps = Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'> & {
4
+ /**
5
+ * The Cards that belong to this CardGroup
6
+ */
7
+ children?: React.ReactNode;
8
+ /**
9
+ * Accessible group label
10
+ */
11
+ 'aria-label'?: string;
12
+ /**
13
+ * ID(s) of elements that label the group
14
+ */
15
+ 'aria-labelledby'?: string;
16
+ /**
17
+ * Specify if all cards in the group are disabled
18
+ * @default false
19
+ */
20
+ 'disabled'?: boolean;
21
+ /**
22
+ * Specify the selection mode for the group
23
+ * @default 'single'
24
+ */
25
+ 'selectionMode'?: CardGroupSelectionMode;
26
+ /**
27
+ * When true, shows a visual selection indicator (radio or checkbox) on cards
28
+ * @default false
29
+ */
30
+ 'showIndicator'?: boolean;
31
+ /**
32
+ * Specify the shared name attribute for form integration when selectable.
33
+ * When omitted, CardGroup will auto-generate a name
34
+ */
35
+ 'name'?: string;
36
+ /**
37
+ * Controlled value for the group.
38
+ *
39
+ * - single selection expects a string
40
+ * - multiple selection expects a string[]
41
+ */
42
+ 'value'?: string | string[];
43
+ /**
44
+ * Uncontrolled initial value for the group
45
+ */
46
+ 'defaultValue'?: string | string[];
47
+ /**
48
+ * Callback invoked when the group selection changes
49
+ */
50
+ 'onChange'?: (value: string | string[] | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
51
+ };
52
+ export declare const CardGroup: {
53
+ (props: CardGroupProps): import("react/jsx-runtime").JSX.Element;
54
+ displayName: string;
55
+ };
@@ -0,0 +1,67 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { useMemo as x } from "react";
3
+ import y from "clsx";
4
+ import { g as G } from "../../chunks/classNames.DNsS4J__.js";
5
+ import "../../chunks/constants.BBi77pmH.js";
6
+ import { s as I } from "../../chunks/card.module.ByBYpexJ.js";
7
+ import "../../chunks/CSSLookup.Cjf6o2Gz.js";
8
+ import { useId as M } from "../../utils/hooks/useId.es.js";
9
+ import { CardGroupProvider as V } from "./CardContext.es.js";
10
+ import { useCardGroupValue as B } from "./useCardGroupValue.es.js";
11
+ const { classModifierPrefix: L } = G("card"), P = (i) => {
12
+ const {
13
+ children: m,
14
+ className: d,
15
+ disabled: e = !1,
16
+ selectionMode: a = "single",
17
+ showIndicator: r = !1,
18
+ name: n,
19
+ value: c,
20
+ defaultValue: u,
21
+ onChange: p,
22
+ "aria-label": f,
23
+ "aria-labelledby": b,
24
+ ...g
25
+ } = i, v = M(), o = n ?? v, { currentValue: l, handleItemSelect: s } = B({
26
+ value: c,
27
+ defaultValue: u,
28
+ selectionMode: a,
29
+ onChange: p
30
+ }), N = y(
31
+ e && I[`${L}disabled`],
32
+ d
33
+ ), C = a === "single" ? "radiogroup" : "group", h = x(
34
+ () => ({
35
+ selectionMode: a,
36
+ showIndicator: r,
37
+ name: o,
38
+ disabled: e,
39
+ value: l,
40
+ onItemSelect: s
41
+ }),
42
+ [
43
+ a,
44
+ r,
45
+ o,
46
+ e,
47
+ l,
48
+ s
49
+ ]
50
+ );
51
+ return /* @__PURE__ */ t(
52
+ "div",
53
+ {
54
+ role: C,
55
+ "aria-disabled": e || void 0,
56
+ "aria-label": f,
57
+ "aria-labelledby": b,
58
+ className: N,
59
+ ...g,
60
+ children: /* @__PURE__ */ t(V, { value: h, children: m })
61
+ }
62
+ );
63
+ };
64
+ P.displayName = "CardGroup";
65
+ export {
66
+ P as CardGroup
67
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(r){return r==="single"?"radio":"checkbox"}function o(r){return Array.isArray(r)?r[0]:r}function n(r){return r?Array.isArray(r)?r:[r]:[]}exports.getInputType=e;exports.normalizeToArray=n;exports.normalizeToSingle=o;
@@ -0,0 +1,7 @@
1
+ import { CardGroupSelectionMode } from '@viasat/beam-shared/components/card';
2
+ /**
3
+ * Maps selection mode to the underlying input/indicator type.
4
+ */
5
+ export declare function getInputType(selectionMode?: CardGroupSelectionMode): 'radio' | 'checkbox';
6
+ export declare function normalizeToSingle(input?: string | string[]): string | undefined;
7
+ export declare function normalizeToArray(input?: string | string[]): string[];
@@ -0,0 +1,14 @@
1
+ function e(r) {
2
+ return r === "single" ? "radio" : "checkbox";
3
+ }
4
+ function n(r) {
5
+ return Array.isArray(r) ? r[0] : r;
6
+ }
7
+ function o(r) {
8
+ return r ? Array.isArray(r) ? r : [r] : [];
9
+ }
10
+ export {
11
+ e as getInputType,
12
+ o as normalizeToArray,
13
+ n as normalizeToSingle
14
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Card.cjs.js");exports.Card=r.Card;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Card.cjs.js"),e=require("./CardGroup.cjs.js");exports.Card=r.Card;exports.CardGroup=e.CardGroup;
@@ -1,2 +1,10 @@
1
1
  import { Card, CardProps } from './Card';
2
- export { Card, type CardProps };
2
+ import { CardGroup, CardGroupProps } from './CardGroup';
3
+ export { Card, type CardProps, CardGroup, type CardGroupProps };
4
+ export type { CardBodyProps } from './Card.Body';
5
+ export type { CardContentProps } from './Card.Content';
6
+ export type { CardFooterProps, CardFooterActionsProps } from './Card.Footer';
7
+ export type { CardHeaderProps, CardHeaderHeadingProps, CardHeaderHeadingTextProps, CardHeaderEyebrowProps, CardHeaderSupportingTextProps, CardHeaderContentBeforeProps, CardHeaderContentAfterProps, } from './Card.Header';
8
+ export type { CardMediaProps } from './Card.Media';
9
+ export type { CardMediaAboveProps } from './Card.MediaAbove';
10
+ export type { CardMediaBelowProps } from './Card.MediaBelow';
@@ -1,4 +1,6 @@
1
- import { Card as a } from "./Card.es.js";
1
+ import { Card as p } from "./Card.es.js";
2
+ import { CardGroup as d } from "./CardGroup.es.js";
2
3
  export {
3
- a as Card
4
+ p as Card,
5
+ d as CardGroup
4
6
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),k=require("./card.utils.cjs.js");function q({cardGroup:e,selected:C,defaultSelected:S,value:b,id:m,disabled:I,name:y,selectionMode:M,showIndicator:a,onSelect:n}){const t=!!e,s=b??m,o=!t||!!s;l.useEffect(()=>{process.env.NODE_ENV!=="production"&&t&&!s&&console.warn("Card: A Card inside a CardGroup is missing a `value` or `id` prop. It will not participate in group selection.")},[]);const f=I||(e==null?void 0:e.disabled)||!1,c=(e==null?void 0:e.name)??y,h=(e==null?void 0:e.showIndicator)??a,w=(e==null?void 0:e.selectionMode)??M??"single",E=k.getInputType(w),[_,A]=l.useState(()=>t?!1:S),N=C!==void 0?C:_,i=e==null?void 0:e.value,v=(e==null?void 0:e.selectionMode)??"single",T=l.useMemo(()=>!t||!s?null:v==="single"?i===s:Array.isArray(i)?i.includes(s):!1,[i,v,t,s]),V=t?T??!1:N,d=l.useCallback(g=>{f||!o||(e!=null&&e.onItemSelect&&s?e.onItemSelect(s,g):A(g.target.checked),n==null||n(g))},[f,o,e,s,n]);return{selected:V,handleChange:d,resolvedValue:s,isSelectionEligible:o,resolvedDisabled:f,resolvedName:c,resolvedShowIndicator:h,inputType:E}}exports.useCardGroup=q;
@@ -0,0 +1,27 @@
1
+ import { default as React } from 'react';
2
+ import { CardGroupSelectionMode } from '@viasat/beam-shared/components/card';
3
+ import { CardGroupContextValue } from './CardContext';
4
+ interface UseCardGroupParams {
5
+ cardGroup: CardGroupContextValue | undefined;
6
+ selected: boolean | undefined;
7
+ defaultSelected: boolean;
8
+ value: string | undefined;
9
+ id: string | undefined;
10
+ disabled: boolean;
11
+ name: string | undefined;
12
+ selectionMode?: CardGroupSelectionMode;
13
+ showIndicator: boolean;
14
+ onSelect?: (event: React.ChangeEvent<HTMLInputElement>) => void;
15
+ }
16
+ interface UseCardGroupReturn {
17
+ selected: boolean;
18
+ handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
19
+ resolvedValue: string | undefined;
20
+ isSelectionEligible: boolean;
21
+ resolvedDisabled: boolean;
22
+ resolvedName: string | undefined;
23
+ resolvedShowIndicator: boolean;
24
+ inputType: 'radio' | 'checkbox';
25
+ }
26
+ export declare function useCardGroup({ cardGroup, selected: controlledSelected, defaultSelected, value, id, disabled, name, selectionMode, showIndicator, onSelect, }: UseCardGroupParams): UseCardGroupReturn;
27
+ export {};
@@ -0,0 +1,42 @@
1
+ import { useEffect as O, useState as _, useMemo as j, useCallback as q } from "react";
2
+ import { getInputType as z } from "./card.utils.es.js";
3
+ function J({
4
+ cardGroup: e,
5
+ selected: g,
6
+ defaultSelected: C,
7
+ value: v,
8
+ id: I,
9
+ disabled: S,
10
+ name: h,
11
+ selectionMode: M,
12
+ showIndicator: b,
13
+ onSelect: n
14
+ }) {
15
+ const t = !!e, s = v ?? I, l = !t || !!s;
16
+ O(() => {
17
+ process.env.NODE_ENV !== "production" && t && !s && console.warn(
18
+ "Card: A Card inside a CardGroup is missing a `value` or `id` prop. It will not participate in group selection."
19
+ );
20
+ }, []);
21
+ const o = S || (e == null ? void 0 : e.disabled) || !1, w = (e == null ? void 0 : e.name) ?? h, y = (e == null ? void 0 : e.showIndicator) ?? b, E = (e == null ? void 0 : e.selectionMode) ?? M ?? "single", A = z(E), [N, V] = _(
22
+ () => t ? !1 : C
23
+ ), k = g !== void 0 ? g : N, i = e == null ? void 0 : e.value, m = (e == null ? void 0 : e.selectionMode) ?? "single", D = j(() => !t || !s ? null : m === "single" ? i === s : Array.isArray(i) ? i.includes(s) : !1, [i, m, t, s]), T = t ? D ?? !1 : k, x = q(
24
+ (f) => {
25
+ o || !l || (e != null && e.onItemSelect && s ? e.onItemSelect(s, f) : V(f.target.checked), n == null || n(f));
26
+ },
27
+ [o, l, e, s, n]
28
+ );
29
+ return {
30
+ selected: T,
31
+ handleChange: x,
32
+ resolvedValue: s,
33
+ isSelectionEligible: l,
34
+ resolvedDisabled: o,
35
+ resolvedName: w,
36
+ resolvedShowIndicator: y,
37
+ inputType: A
38
+ };
39
+ }
40
+ export {
41
+ J as useCardGroup
42
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),s=require("./card.utils.cjs.js");function b({value:o,defaultValue:n,selectionMode:t,onChange:r}){const u=o!==void 0,[d,y]=a.useState(()=>t==="single"?s.normalizeToSingle(n):s.normalizeToArray(n)),i=u?o:d,e=a.useMemo(()=>t==="single"?s.normalizeToSingle(i):s.normalizeToArray(i),[i,t]),f=a.useCallback((l,S)=>{if(t==="single"){u||y(l),r==null||r(l,S);return}const c=s.normalizeToArray(e),T=c.includes(l)?c.filter(z=>z!==l):[...c,l];u||y(T),r==null||r(T,S)},[t,e,u,r]);return{currentValue:e,handleItemSelect:f}}exports.useCardGroupValue=b;
@@ -0,0 +1,14 @@
1
+ import { default as React } from 'react';
2
+ import { CardGroupSelectionMode } from '@viasat/beam-shared/components/card';
3
+ interface UseCardGroupValueParams {
4
+ value: string | string[] | undefined;
5
+ defaultValue: string | string[] | undefined;
6
+ selectionMode: CardGroupSelectionMode;
7
+ onChange?: (value: string | string[] | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
8
+ }
9
+ interface UseCardGroupValueReturn {
10
+ currentValue: string | string[] | undefined;
11
+ handleItemSelect: (itemValue: string, event: React.ChangeEvent<HTMLInputElement>) => void;
12
+ }
13
+ export declare function useCardGroupValue({ value, defaultValue, selectionMode, onChange, }: UseCardGroupValueParams): UseCardGroupValueReturn;
14
+ export {};
@@ -0,0 +1,29 @@
1
+ import { useState as I, useMemo as T, useCallback as a } from "react";
2
+ import { normalizeToSingle as x, normalizeToArray as f } from "./card.utils.es.js";
3
+ function w({
4
+ value: m,
5
+ defaultValue: o,
6
+ selectionMode: t,
7
+ onChange: r
8
+ }) {
9
+ const l = m !== void 0, [y, p] = I(
10
+ () => t === "single" ? x(o) : f(o)
11
+ ), u = l ? m : y, c = T(
12
+ () => t === "single" ? x(u) : f(u),
13
+ [u, t]
14
+ ), z = a(
15
+ (s, n) => {
16
+ if (t === "single") {
17
+ l || p(s), r == null || r(s, n);
18
+ return;
19
+ }
20
+ const i = f(c), S = i.includes(s) ? i.filter((A) => A !== s) : [...i, s];
21
+ l || p(S), r == null || r(S, n);
22
+ },
23
+ [t, c, l, r]
24
+ );
25
+ return { currentValue: c, handleItemSelect: z };
26
+ }
27
+ export {
28
+ w as useCardGroupValue
29
+ };