@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.
- package/assets/ActionList.css +1 -1
- package/assets/Checkbox.css +1 -1
- package/assets/RadioButton.css +1 -1
- package/assets/Search.Results.css +1 -0
- package/assets/card.css +1 -1
- package/assets/panel.css +1 -0
- package/chunks/ActionList.Group.B4PX5SKS.js +111 -0
- package/chunks/ActionList.Group.C2R56u2A.js +1 -0
- package/chunks/ActionList.Item.5Y-SwzjK.js +1 -0
- package/chunks/{ActionList.Item.Dg_KHGsm.js → ActionList.Item.BFcT86lS.js} +3 -2
- package/chunks/Search.Results.Item.CLmMBPz1.js +41 -0
- package/chunks/Search.Results.Item.Dkh2yo4p.js +1 -0
- package/chunks/card.module.8KnCe1uR.js +1 -0
- package/chunks/{card.module.Dy87qmTH.js → card.module.ByBYpexJ.js} +12 -6
- package/chunks/dom.DGM-dxLe.js +21 -0
- package/chunks/dom.zgzOBFUw.js +1 -0
- package/chunks/{form.context.B1PXIJNq.js → form.context.B26th8Od.js} +1 -1
- package/chunks/{form.context.CNWjF5qA.js → form.context.CfsTSQpm.js} +1 -1
- package/chunks/panel.module.DbEoAg1J.js +1 -0
- package/chunks/panel.module.RGiUyC84.js +30 -0
- package/chunks/tokens.BD_71qmL.js +19 -0
- package/chunks/tokens.Bc11gmpN.js +1 -0
- package/index.cjs.js +1 -1
- package/index.es.js +17 -15
- package/lib/ActionList/ActionList.Group.cjs.js +1 -1
- package/lib/ActionList/ActionList.Group.d.ts +7 -4
- package/lib/ActionList/ActionList.Group.es.js +2 -2
- package/lib/ActionList/ActionList.IconButton.cjs.js +1 -1
- package/lib/ActionList/ActionList.IconButton.es.js +1 -1
- package/lib/ActionList/ActionList.Item.cjs.js +1 -1
- package/lib/ActionList/ActionList.Item.es.js +3 -3
- package/lib/ActionList/ActionList.cjs.js +1 -1
- package/lib/ActionList/ActionList.d.ts +1 -1
- package/lib/ActionList/ActionList.es.js +54 -54
- package/lib/ActionList/useActionListChildren.cjs.js +1 -1
- package/lib/ActionList/useActionListChildren.es.js +2 -2
- package/lib/Autocomplete/Autocomplete.cjs.js +1 -1
- package/lib/Autocomplete/Autocomplete.es.js +1 -1
- package/lib/Autocomplete/AutocompleteDropdown.cjs.js +1 -1
- package/lib/Autocomplete/AutocompleteDropdown.es.js +1 -1
- package/lib/Autocomplete/useAutocompleteA11y.cjs.js +1 -1
- package/lib/Autocomplete/useAutocompleteA11y.es.js +1 -1
- package/lib/Autocomplete/useAutocompleteDropdown.cjs.js +1 -1
- package/lib/Autocomplete/useAutocompleteDropdown.es.js +1 -1
- package/lib/Box/utils.cjs.js +1 -0
- package/lib/Box/utils.d.ts +6 -0
- package/lib/Box/utils.es.js +12 -0
- package/lib/Button/Button.cjs.js +1 -1
- package/lib/Button/Button.es.js +1 -1
- package/lib/Card/Card.Body.cjs.js +1 -1
- package/lib/Card/Card.Body.es.js +1 -1
- package/lib/Card/Card.Content.cjs.js +1 -1
- package/lib/Card/Card.Content.es.js +12 -17
- package/lib/Card/Card.Footer.cjs.js +1 -1
- package/lib/Card/Card.Footer.d.ts +1 -1
- package/lib/Card/Card.Footer.es.js +1 -1
- package/lib/Card/Card.Header.cjs.js +1 -1
- package/lib/Card/Card.Header.es.js +1 -1
- package/lib/Card/Card.Media.cjs.js +1 -1
- package/lib/Card/Card.Media.es.js +1 -1
- package/lib/Card/Card.cjs.js +1 -1
- package/lib/Card/Card.d.ts +61 -18
- package/lib/Card/Card.es.js +181 -82
- package/lib/Card/CardContext.cjs.js +1 -1
- package/lib/Card/CardContext.d.ts +10 -8
- package/lib/Card/CardContext.es.js +7 -12
- package/lib/Card/CardGroup.cjs.js +1 -0
- package/lib/Card/CardGroup.d.ts +55 -0
- package/lib/Card/CardGroup.es.js +67 -0
- package/lib/Card/card.utils.cjs.js +1 -0
- package/lib/Card/card.utils.d.ts +7 -0
- package/lib/Card/card.utils.es.js +14 -0
- package/lib/Card/index.cjs.js +1 -1
- package/lib/Card/index.d.ts +9 -1
- package/lib/Card/index.es.js +4 -2
- package/lib/Card/useCardGroup.cjs.js +1 -0
- package/lib/Card/useCardGroup.d.ts +27 -0
- package/lib/Card/useCardGroup.es.js +42 -0
- package/lib/Card/useCardGroupValue.cjs.js +1 -0
- package/lib/Card/useCardGroupValue.d.ts +14 -0
- package/lib/Card/useCardGroupValue.es.js +29 -0
- package/lib/Checkbox/Checkbox.cjs.js +1 -1
- package/lib/Checkbox/Checkbox.es.js +1 -1
- package/lib/Dialog/Dialog.Trigger.cjs.js +1 -1
- package/lib/Dialog/Dialog.Trigger.es.js +7 -6
- package/lib/EmptyState/EmptyState.cjs.js +1 -1
- package/lib/EmptyState/EmptyState.es.js +1 -1
- package/lib/FileUpload/FileUpload.List.Item.cjs.js +1 -1
- package/lib/FileUpload/FileUpload.List.Item.es.js +20 -20
- package/lib/FileUpload/FileUpload.cjs.js +1 -1
- package/lib/FileUpload/FileUpload.es.js +1 -1
- package/lib/FloatingUI/index.cjs.js +1 -1
- package/lib/FloatingUI/index.d.ts +1 -0
- package/lib/FloatingUI/index.es.js +7 -5
- package/lib/FloatingUI/useBlur.cjs.js +1 -0
- package/lib/FloatingUI/useBlur.d.ts +8 -0
- package/lib/FloatingUI/useBlur.es.js +15 -0
- package/lib/FloatingUI/useTyping.cjs.js +1 -0
- package/lib/FloatingUI/useTyping.d.ts +10 -0
- package/lib/FloatingUI/useTyping.es.js +42 -0
- package/lib/Form/Form.cjs.js +1 -1
- package/lib/Form/Form.es.js +1 -1
- package/lib/Form/contexts/form.context.cjs.js +1 -1
- package/lib/Form/contexts/form.context.es.js +1 -1
- package/lib/Form/contexts/index.cjs.js +1 -1
- package/lib/Form/contexts/index.es.js +1 -1
- package/lib/Form/hooks/index.cjs.js +1 -1
- package/lib/Form/hooks/index.es.js +1 -1
- package/lib/Form/hooks/useFieldValidator.hook.cjs.js +1 -1
- package/lib/Form/hooks/useFieldValidator.hook.es.js +2 -2
- package/lib/HelperText/HelperText.cjs.js +1 -1
- package/lib/HelperText/HelperText.es.js +1 -1
- package/lib/HelperText/index.cjs.js +1 -1
- package/lib/HelperText/index.es.js +1 -1
- package/lib/InputChoiceGroup/InputChoiceGroup.cjs.js +1 -1
- package/lib/InputChoiceGroup/InputChoiceGroup.es.js +1 -1
- package/lib/Label/Label.cjs.js +1 -1
- package/lib/Label/Label.es.js +1 -1
- package/lib/Link/Link.cjs.js +1 -1
- package/lib/Link/Link.es.js +6 -6
- package/lib/NativeSelect/NativeSelect.cjs.js +1 -1
- package/lib/NativeSelect/NativeSelect.es.js +1 -1
- package/lib/Popover/Popover.cjs.js +1 -1
- package/lib/Popover/Popover.es.js +1 -1
- package/lib/Popover/Popover.trigger.cjs.js +1 -1
- package/lib/Popover/Popover.trigger.es.js +7 -6
- package/lib/Popover/Popover.utils.cjs.js +1 -1
- package/lib/Popover/Popover.utils.es.js +1 -1
- package/lib/ProgressBar/ProgressBar.cjs.js +1 -1
- package/lib/ProgressBar/ProgressBar.es.js +1 -1
- package/lib/RadioButton/RadioButton.cjs.js +1 -1
- package/lib/RadioButton/RadioButton.es.js +1 -1
- package/lib/Select/Select.cjs.js +1 -1
- package/lib/Select/Select.es.js +1 -1
- package/lib/Select/SelectDropdown.cjs.js +1 -1
- package/lib/Select/SelectDropdown.es.js +1 -1
- package/lib/Select/useSelectA11y.cjs.js +1 -1
- package/lib/Select/useSelectA11y.es.js +1 -1
- package/lib/SideNav/SideNavActionListGroup.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListGroup.es.js +1 -1
- package/lib/SideNav/SideNavActionListItem.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItem.es.js +1 -1
- package/lib/SideNav/SideNavActionListItemExpandable.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItemExpandable.es.js +1 -1
- package/lib/SideNav/SideNavActionListItemFlyout.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItemFlyout.es.js +1 -1
- package/lib/Slider/DualSlider.cjs.js +1 -1
- package/lib/Slider/DualSlider.d.ts +1 -1
- package/lib/Slider/DualSlider.es.js +73 -72
- package/lib/Slider/SingleSlider.cjs.js +1 -1
- package/lib/Slider/SingleSlider.d.ts +1 -1
- package/lib/Slider/SingleSlider.es.js +52 -51
- package/lib/Slider/Slider.Error.cjs.js +1 -1
- package/lib/Slider/Slider.Error.es.js +1 -1
- package/lib/Slider/Slider.Thumb.cjs.js +1 -1
- package/lib/Slider/Slider.Thumb.es.js +1 -1
- package/lib/Slider/Slider.cjs.js +1 -1
- package/lib/Slider/Slider.d.ts +1 -3
- package/lib/Slider/Slider.es.js +13 -11
- package/lib/Slider/Slider.types.d.ts +1 -1
- package/lib/Slider/hooks/useSliderBase.cjs.js +1 -1
- package/lib/Slider/hooks/useSliderBase.es.js +1 -1
- package/lib/Switch/Switch.cjs.js +1 -1
- package/lib/Switch/Switch.es.js +1 -1
- package/lib/Tabs/Tabs.Group.cjs.js +1 -1
- package/lib/Tabs/Tabs.Group.es.js +1 -1
- package/lib/TextArea/TextArea.cjs.js +1 -1
- package/lib/TextArea/TextArea.es.js +1 -1
- package/lib/TextField/TextField.cjs.js +1 -1
- package/lib/TextField/TextField.es.js +1 -1
- package/lib/Tooltip/Tooltip.cjs.js +1 -1
- package/lib/Tooltip/Tooltip.es.js +9 -9
- package/lib/_Options/useSelectValue.cjs.js +1 -1
- package/lib/_Options/useSelectValue.es.js +1 -1
- package/lib/index.cjs.js +1 -1
- package/lib/index.es.js +18 -16
- package/lib/wip/Panel/Panel.Body.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Body.d.ts +11 -0
- package/lib/wip/Panel/Panel.Body.es.js +17 -0
- package/lib/wip/Panel/Panel.Footer.Actions.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Footer.Actions.d.ts +17 -0
- package/lib/wip/Panel/Panel.Footer.Actions.es.js +22 -0
- package/lib/wip/Panel/Panel.Footer.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Footer.d.ts +20 -0
- package/lib/wip/Panel/Panel.Footer.es.js +24 -0
- package/lib/wip/Panel/Panel.Header.ContentAfter.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Header.ContentAfter.d.ts +11 -0
- package/lib/wip/Panel/Panel.Header.ContentAfter.es.js +17 -0
- package/lib/wip/Panel/Panel.Header.ContentBefore.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Header.ContentBefore.d.ts +11 -0
- package/lib/wip/Panel/Panel.Header.ContentBefore.es.js +17 -0
- package/lib/wip/Panel/Panel.Header.Description.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Header.Description.d.ts +11 -0
- package/lib/wip/Panel/Panel.Header.Description.es.js +17 -0
- package/lib/wip/Panel/Panel.Header.Heading.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Header.Heading.d.ts +11 -0
- package/lib/wip/Panel/Panel.Header.Heading.es.js +17 -0
- package/lib/wip/Panel/Panel.Header.Row.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Header.Row.d.ts +11 -0
- package/lib/wip/Panel/Panel.Header.Row.es.js +29 -0
- package/lib/wip/Panel/Panel.Header.Subheader.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Header.Subheader.d.ts +11 -0
- package/lib/wip/Panel/Panel.Header.Subheader.es.js +17 -0
- package/lib/wip/Panel/Panel.Header.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Header.d.ts +40 -0
- package/lib/wip/Panel/Panel.Header.es.js +34 -0
- package/lib/wip/Panel/Panel.cjs.js +1 -0
- package/lib/wip/Panel/Panel.context.cjs.js +1 -0
- package/lib/wip/Panel/Panel.context.d.ts +16 -0
- package/lib/wip/Panel/Panel.context.es.js +11 -0
- package/lib/wip/Panel/Panel.d.ts +45 -0
- package/lib/wip/Panel/Panel.es.js +43 -0
- package/lib/wip/Panel/Panel.types.cjs.js +1 -0
- package/lib/wip/Panel/Panel.types.d.ts +71 -0
- package/lib/wip/Panel/Panel.types.es.js +1 -0
- package/lib/wip/Panel/index.cjs.js +1 -0
- package/lib/wip/Panel/index.d.ts +12 -0
- package/lib/wip/Panel/index.es.js +4 -0
- package/lib/wip/Search/Search.Results.Item.cjs.js +1 -0
- package/lib/wip/Search/Search.Results.Item.d.ts +8 -0
- package/lib/wip/Search/Search.Results.Item.es.js +12 -0
- package/lib/wip/Search/Search.Results.cjs.js +1 -0
- package/lib/wip/Search/Search.Results.d.ts +12 -0
- package/lib/wip/Search/Search.Results.es.js +19 -0
- package/lib/wip/Search/Search.cjs.js +1 -0
- package/lib/wip/Search/Search.d.ts +88 -0
- package/lib/wip/Search/Search.es.js +157 -0
- package/lib/wip/Search/SearchDropdown.cjs.js +1 -0
- package/lib/wip/Search/SearchDropdown.d.ts +19 -0
- package/lib/wip/Search/SearchDropdown.es.js +71 -0
- package/lib/wip/Search/index.cjs.js +1 -0
- package/lib/wip/Search/index.d.ts +1 -0
- package/lib/wip/Search/index.es.js +4 -0
- package/lib/wip/Search/useSearchDropdown.cjs.js +1 -0
- package/lib/wip/Search/useSearchDropdown.d.ts +875 -0
- package/lib/wip/Search/useSearchDropdown.es.js +92 -0
- package/lib/wip/index.cjs.js +1 -1
- package/lib/wip/index.d.ts +2 -0
- package/lib/wip/index.es.js +6 -1
- package/package.json +6 -6
- package/utils/hooks/index.cjs.js +1 -1
- package/utils/hooks/index.d.ts +1 -0
- package/utils/hooks/index.es.js +33 -31
- package/utils/hooks/useDebounced.cjs.js +1 -0
- package/utils/hooks/useDebounced.d.ts +5 -0
- package/utils/hooks/useDebounced.es.js +18 -0
- package/utils/hooks/useEffectAfterMount.cjs.js +1 -0
- package/utils/hooks/useEffectAfterMount.d.ts +2 -0
- package/utils/hooks/useEffectAfterMount.es.js +14 -0
- package/utils/hooks/useInteractiveProps.cjs.js +1 -0
- package/utils/hooks/useInteractiveProps.d.ts +24 -0
- package/utils/hooks/useInteractiveProps.es.js +31 -0
- package/chunks/ActionList.Group.Bv9vgU22.js +0 -1
- package/chunks/ActionList.Group.DuNxYNZQ.js +0 -107
- package/chunks/ActionList.Item.D7Rg5iMb.js +0 -1
- package/chunks/card.module.BG9mkRao.js +0 -1
- package/chunks/dom.CVmkHCnh.js +0 -21
- package/chunks/dom.PCrm8EUc.js +0 -1
- package/chunks/tokens.Bgac_JPh.js +0 -1
- package/chunks/tokens.CXaNS8Cf.js +0 -13
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useFloating as T, autoUpdate as j, flip as z, size as L, useClick as U, useRole as V, useFocus as $, useDismiss as q, useListNavigation as B, useInteractions as F, useTransitionStyles as G } from "@floating-ui/react";
|
|
2
|
+
import { useState as k, useRef as u, useEffect as x, useCallback as h, useMemo as S } from "react";
|
|
3
|
+
import { useTyping as J } from "../../FloatingUI/useTyping.es.js";
|
|
4
|
+
const Y = (E) => {
|
|
5
|
+
const { disabled: r, readOnly: l, enabled: e = !0 } = E, [t, c] = k(!1), f = u(t);
|
|
6
|
+
f.current = t;
|
|
7
|
+
const [a, d] = k(null);
|
|
8
|
+
x(() => t ? void 0 : d(null), [t]);
|
|
9
|
+
const { context: n, refs: o, floatingStyles: p } = T({
|
|
10
|
+
placement: "bottom-start",
|
|
11
|
+
middleware: [
|
|
12
|
+
z(),
|
|
13
|
+
L({
|
|
14
|
+
apply({ elements: s, rects: i }) {
|
|
15
|
+
Object.assign(s.floating.style, {
|
|
16
|
+
width: `${i.reference.width}px`
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
],
|
|
21
|
+
whileElementsMounted: j,
|
|
22
|
+
open: t,
|
|
23
|
+
onOpenChange: c
|
|
24
|
+
}), g = u([]), C = u([]), D = U(n, {
|
|
25
|
+
enabled: !t && e && !r && !l,
|
|
26
|
+
toggle: !1,
|
|
27
|
+
stickIfOpen: !1,
|
|
28
|
+
keyboardHandlers: !1
|
|
29
|
+
}), M = V(n, { enabled: e, role: "listbox" }), N = J(n, { enabled: !t && e && !r && !l, event: "keyboard" }), A = $(n, { enabled: !t && e && !r && !l, visibleOnly: !0 }), H = q(n, { enabled: t && e && !r && !l, escapeKey: !0, outsidePress: !0, referencePress: !1 }), K = B(n, {
|
|
30
|
+
enabled: e && !r && !l,
|
|
31
|
+
listRef: g,
|
|
32
|
+
activeIndex: a,
|
|
33
|
+
onNavigate: d,
|
|
34
|
+
focusItemOnHover: !1,
|
|
35
|
+
focusItemOnOpen: "auto",
|
|
36
|
+
openOnArrowKeyDown: !0,
|
|
37
|
+
nested: !1,
|
|
38
|
+
loop: !0,
|
|
39
|
+
virtual: !1,
|
|
40
|
+
scrollItemIntoView: !0
|
|
41
|
+
}), { getReferenceProps: m, getFloatingProps: b, getItemProps: y } = F([
|
|
42
|
+
M,
|
|
43
|
+
N,
|
|
44
|
+
K
|
|
45
|
+
]), { getReferenceProps: R } = F([D, A, H]), { isMounted: v, styles: I } = G(n, { duration: 50 });
|
|
46
|
+
x(() => {
|
|
47
|
+
if (!e || r || l || f.current)
|
|
48
|
+
return;
|
|
49
|
+
const s = o.domReference.current, i = document.activeElement;
|
|
50
|
+
s && i && s.contains(i) && c(!0);
|
|
51
|
+
}, [e, r, l, c, o.domReference]);
|
|
52
|
+
const P = h(
|
|
53
|
+
(s = {}) => e ? m(s) : s,
|
|
54
|
+
[m, e]
|
|
55
|
+
), O = h(
|
|
56
|
+
(s = {}) => e ? {
|
|
57
|
+
ref: o.setReference,
|
|
58
|
+
...R(s)
|
|
59
|
+
} : s,
|
|
60
|
+
[e, o.setReference, R]
|
|
61
|
+
), w = S(
|
|
62
|
+
() => ({
|
|
63
|
+
isMounted: v,
|
|
64
|
+
getFloatingProps: b,
|
|
65
|
+
getItemProps: y,
|
|
66
|
+
floatingStyles: {
|
|
67
|
+
...p,
|
|
68
|
+
...I
|
|
69
|
+
},
|
|
70
|
+
setOpen: c,
|
|
71
|
+
labelsRef: C,
|
|
72
|
+
elementsRef: g,
|
|
73
|
+
setFloating: o.setFloating,
|
|
74
|
+
activeIndex: a,
|
|
75
|
+
context: n,
|
|
76
|
+
open: t
|
|
77
|
+
}),
|
|
78
|
+
[v, b, y, p, I, o.setFloating, a, n, t]
|
|
79
|
+
);
|
|
80
|
+
return S(
|
|
81
|
+
() => ({
|
|
82
|
+
getFieldProps: O,
|
|
83
|
+
getInputProps: P,
|
|
84
|
+
dropdownProps: w,
|
|
85
|
+
refs: o
|
|
86
|
+
}),
|
|
87
|
+
[w, O, P, o]
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
Y as useSearchDropdown
|
|
92
|
+
};
|
package/lib/wip/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Search/Search.cjs.js"),r=require("./Panel/Panel.cjs.js");exports.Search=e.Search;exports.Panel=r.Panel;
|
package/lib/wip/index.d.ts
CHANGED
package/lib/wip/index.es.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@viasat/beam-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "React component library for the Beam design system",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Viasat",
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@viasat/beam-fonts": "2.
|
|
63
|
-
"@viasat/beam-shared": "2.
|
|
64
|
-
"@viasat/beam-styles": "2.
|
|
65
|
-
"@viasat/beam-tokens": "2.
|
|
66
|
-
"@viasat/beam-icons": "2.
|
|
62
|
+
"@viasat/beam-fonts": "2.8.0",
|
|
63
|
+
"@viasat/beam-shared": "2.8.0",
|
|
64
|
+
"@viasat/beam-styles": "2.8.0",
|
|
65
|
+
"@viasat/beam-tokens": "2.8.0",
|
|
66
|
+
"@viasat/beam-icons": "2.8.0",
|
|
67
67
|
"clsx": "^1.2.1",
|
|
68
68
|
"@floating-ui/react": "^0.26.18",
|
|
69
69
|
"@stepperize/react": "^5.1.5",
|
package/utils/hooks/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),d=require("../../chunks/constants.hwjHOsvT.js"),p=require("../../chunks/helpers.COm6C5Gf.js"),a=require("../../chunks/CSSLookup.DESAWWRT.js"),w=require("./useId.cjs.js");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),d=require("../../chunks/constants.hwjHOsvT.js"),p=require("../../chunks/helpers.COm6C5Gf.js"),a=require("../../chunks/CSSLookup.DESAWWRT.js"),w=require("./useId.cjs.js"),f=require("./useInteractiveProps.cjs.js");function g(e,t=window.getComputedStyle(e)){return parseInt(t.getPropertyValue("-webkit-line-clamp"),10)>=1&&t.getPropertyValue("display")==="-webkit-box"&&t.getPropertyValue("overflow")==="hidden"}function h(e,t=window.getComputedStyle(e)){return t.getPropertyValue("text-overflow")==="ellipsis"&&t.getPropertyValue("white-space")==="nowrap"&&t.getPropertyValue("overflow")==="hidden"&&e.scrollWidth>e.clientWidth}function v(e){return e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight}function S(e){if(!e)return!1;if(v(e))return!0;const t=window.getComputedStyle(e);return g(e,t)||h(e,t)}const b=e=>{if(!e)return!1;const t=e.cloneNode(!0);t.style.position="absolute",t.style.whiteSpace="nowrap",t.style.width="auto",t.style.height="auto",t.style.visibility="hidden",document.body.appendChild(t);const n=t.offsetWidth>e.offsetWidth;return document.body.removeChild(t),n},l=(e,t=d.FPS_120,n=[])=>{const r=s.useRef(null);return s.useLayoutEffect(()=>{const{current:i}=r;if(!i)return;e();const u=p.debounce(()=>{e()},t),c=new ResizeObserver(u);return c.observe(i),()=>{c.disconnect(),u.cancel()}},[r,e,t,n]),{ref:r}},m=()=>{const[e,t]=s.useState(!1),n=()=>{r.current&&t(S(r.current))},{ref:r}=l(n);return{ref:r,isOverFlowing:e}},y=e=>{const[t,n]=s.useState(!1),r=()=>{i.current&&n(b(i.current))},{ref:i}=l(r,200);return{ref:i,isTextWrapping:t}},C=e=>{const[t,n]=s.useState(()=>a.CSSManager.findVar(e)??"");return s.useEffect(()=>{const r=i=>{n(i)};return a.CSSManager.findVar(e,r),()=>{a.CSSManager.unsubscribe(e,r)}},[e]),t};function W(e){const[t,n]=s.useState(!1);return s.useLayoutEffect(()=>{if(typeof window>"u")return;const r=o=>o?getComputedStyle(o).direction:"ltr",i=()=>{const o=e.current;return o?r(o)==="rtl"||!!o.closest('[dir="rtl"]')||r(document.documentElement)==="rtl":!1};n(i());const u=new MutationObserver(()=>n(i()));u.observe(document.documentElement,{attributes:!0,attributeFilter:["dir","class"],subtree:!0});const c=requestAnimationFrame(function o(){n(i()),requestAnimationFrame(o)});return()=>{u.disconnect(),cancelAnimationFrame(c)}},[e]),t}const I=()=>{const[e,t]=s.useState(!1);return s.useEffect(()=>{if(typeof window>"u")return;const n=()=>{const r="ontouchstart"in window||navigator.maxTouchPoints>0,i=window.innerHeight>window.innerWidth,u=i?window.innerWidth:window.innerHeight,c=i?window.innerHeight:window.innerWidth,o=u<1024||c<768;t(r&&o)};return n(),window.addEventListener("resize",n,{passive:!0}),window.addEventListener("orientationchange",n,{passive:!0}),()=>{window.removeEventListener("resize",n),window.removeEventListener("orientationchange",n)}},[]),e};exports.useId=w.useId;exports.useInteractiveProps=f.useInteractiveProps;exports.useCSSLookup=C;exports.useIsOverFlowing=m;exports.useIsTextWrapping=y;exports.useMobileDetection=I;exports.useRTLDirection=W;exports.useResizeObserver=l;
|
package/utils/hooks/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { VoidFunction } from '@viasat/beam-shared/utils/constants';
|
|
3
3
|
import { debounce } from '@viasat/beam-shared/utils/helpers';
|
|
4
4
|
export { useId } from './useId';
|
|
5
|
+
export { useInteractiveProps, type UseInteractivePropsOptions, type InteractiveProps, type InteractiveElementType, } from './useInteractiveProps';
|
|
5
6
|
type WaitFor = Parameters<typeof debounce>[1];
|
|
6
7
|
/**
|
|
7
8
|
* Hook to set up a resize observer on an element.
|
package/utils/hooks/index.es.js
CHANGED
|
@@ -3,6 +3,7 @@ import { a as f } from "../../chunks/constants.BBi77pmH.js";
|
|
|
3
3
|
import { d as m } from "../../chunks/helpers.Wv7n4ip7.js";
|
|
4
4
|
import { C as a } from "../../chunks/CSSLookup.Cjf6o2Gz.js";
|
|
5
5
|
import { useId as V } from "./useId.es.js";
|
|
6
|
+
import { useInteractiveProps as M } from "./useInteractiveProps.es.js";
|
|
6
7
|
function h(e, t = window.getComputedStyle(e)) {
|
|
7
8
|
return parseInt(t.getPropertyValue("-webkit-line-clamp"), 10) >= 1 && t.getPropertyValue("display") === "-webkit-box" && t.getPropertyValue("overflow") === "hidden";
|
|
8
9
|
}
|
|
@@ -25,51 +26,51 @@ const y = (e) => {
|
|
|
25
26
|
const n = t.offsetWidth > e.offsetWidth;
|
|
26
27
|
return document.body.removeChild(t), n;
|
|
27
28
|
}, p = (e, t = f, n = []) => {
|
|
28
|
-
const
|
|
29
|
+
const r = w(null);
|
|
29
30
|
return l(() => {
|
|
30
|
-
const { current:
|
|
31
|
-
if (!
|
|
31
|
+
const { current: i } = r;
|
|
32
|
+
if (!i) return;
|
|
32
33
|
e();
|
|
33
34
|
const s = m(() => {
|
|
34
35
|
e();
|
|
35
36
|
}, t), c = new ResizeObserver(s);
|
|
36
|
-
return c.observe(
|
|
37
|
+
return c.observe(i), () => {
|
|
37
38
|
c.disconnect(), s.cancel();
|
|
38
39
|
};
|
|
39
|
-
}, [
|
|
40
|
-
},
|
|
40
|
+
}, [r, e, t, n]), { ref: r };
|
|
41
|
+
}, L = () => {
|
|
41
42
|
const [e, t] = u(!1), n = () => {
|
|
42
|
-
|
|
43
|
-
}, { ref:
|
|
44
|
-
return { ref:
|
|
43
|
+
r.current && t(b(r.current));
|
|
44
|
+
}, { ref: r } = p(n);
|
|
45
|
+
return { ref: r, isOverFlowing: e };
|
|
45
46
|
}, E = (e) => {
|
|
46
|
-
const [t, n] = u(!1),
|
|
47
|
-
|
|
48
|
-
}, { ref:
|
|
49
|
-
return { ref:
|
|
50
|
-
},
|
|
47
|
+
const [t, n] = u(!1), r = () => {
|
|
48
|
+
i.current && n(y(i.current));
|
|
49
|
+
}, { ref: i } = p(r, 200);
|
|
50
|
+
return { ref: i, isTextWrapping: t };
|
|
51
|
+
}, P = (e) => {
|
|
51
52
|
const [t, n] = u(
|
|
52
53
|
() => a.findVar(e) ?? ""
|
|
53
54
|
);
|
|
54
55
|
return d(() => {
|
|
55
|
-
const
|
|
56
|
-
n(
|
|
56
|
+
const r = (i) => {
|
|
57
|
+
n(i);
|
|
57
58
|
};
|
|
58
|
-
return a.findVar(e,
|
|
59
|
-
a.unsubscribe(e,
|
|
59
|
+
return a.findVar(e, r), () => {
|
|
60
|
+
a.unsubscribe(e, r);
|
|
60
61
|
};
|
|
61
62
|
}, [e]), t;
|
|
62
63
|
};
|
|
63
|
-
function
|
|
64
|
+
function T(e) {
|
|
64
65
|
const [t, n] = u(!1);
|
|
65
66
|
return l(() => {
|
|
66
67
|
if (typeof window > "u") return;
|
|
67
|
-
const
|
|
68
|
+
const r = (o) => o ? getComputedStyle(o).direction : "ltr", i = () => {
|
|
68
69
|
const o = e.current;
|
|
69
|
-
return o ?
|
|
70
|
+
return o ? r(o) === "rtl" || !!o.closest('[dir="rtl"]') || r(document.documentElement) === "rtl" : !1;
|
|
70
71
|
};
|
|
71
|
-
n(
|
|
72
|
-
const s = new MutationObserver(() => n(
|
|
72
|
+
n(i());
|
|
73
|
+
const s = new MutationObserver(() => n(i()));
|
|
73
74
|
s.observe(document.documentElement, {
|
|
74
75
|
attributes: !0,
|
|
75
76
|
attributeFilter: ["dir", "class"],
|
|
@@ -77,20 +78,20 @@ function F(e) {
|
|
|
77
78
|
// catch any descendant <div dir="rtl">
|
|
78
79
|
});
|
|
79
80
|
const c = requestAnimationFrame(function o() {
|
|
80
|
-
n(
|
|
81
|
+
n(i()), requestAnimationFrame(o);
|
|
81
82
|
});
|
|
82
83
|
return () => {
|
|
83
84
|
s.disconnect(), cancelAnimationFrame(c);
|
|
84
85
|
};
|
|
85
86
|
}, [e]), t;
|
|
86
87
|
}
|
|
87
|
-
const
|
|
88
|
+
const F = () => {
|
|
88
89
|
const [e, t] = u(!1);
|
|
89
90
|
return d(() => {
|
|
90
91
|
if (typeof window > "u") return;
|
|
91
92
|
const n = () => {
|
|
92
|
-
const
|
|
93
|
-
t(
|
|
93
|
+
const r = "ontouchstart" in window || navigator.maxTouchPoints > 0, i = window.innerHeight > window.innerWidth, s = i ? window.innerWidth : window.innerHeight, c = i ? window.innerHeight : window.innerWidth, o = s < 1024 || c < 768;
|
|
94
|
+
t(r && o);
|
|
94
95
|
};
|
|
95
96
|
return n(), window.addEventListener("resize", n, { passive: !0 }), window.addEventListener("orientationchange", n, { passive: !0 }), () => {
|
|
96
97
|
window.removeEventListener("resize", n), window.removeEventListener("orientationchange", n);
|
|
@@ -98,11 +99,12 @@ const O = () => {
|
|
|
98
99
|
}, []), e;
|
|
99
100
|
};
|
|
100
101
|
export {
|
|
101
|
-
|
|
102
|
+
P as useCSSLookup,
|
|
102
103
|
V as useId,
|
|
103
|
-
|
|
104
|
+
M as useInteractiveProps,
|
|
105
|
+
L as useIsOverFlowing,
|
|
104
106
|
E as useIsTextWrapping,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
F as useMobileDetection,
|
|
108
|
+
T as useRTLDirection,
|
|
107
109
|
p as useResizeObserver
|
|
108
110
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),a=(r,s)=>{const c=t.useRef(null),u=t.useRef(r);u.current=r;const e=t.useCallback(()=>{c.current&&clearTimeout(c.current)},[]),o=t.useCallback((...n)=>{e(),c.current=setTimeout(()=>{u.current(...n)},s)},[e,s]),l=t.useCallback((...n)=>{e(),u.current(...n)},[e]);return t.useEffect(()=>e,[e]),{debounced:o,immediate:l,cancel:e}};exports.useDebounced=a;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import t from "react";
|
|
2
|
+
const f = (n, o) => {
|
|
3
|
+
const c = t.useRef(null), u = t.useRef(n);
|
|
4
|
+
u.current = n;
|
|
5
|
+
const e = t.useCallback(() => {
|
|
6
|
+
c.current && clearTimeout(c.current);
|
|
7
|
+
}, []), s = t.useCallback((...r) => {
|
|
8
|
+
e(), c.current = setTimeout(() => {
|
|
9
|
+
u.current(...r);
|
|
10
|
+
}, o);
|
|
11
|
+
}, [e, o]), a = t.useCallback((...r) => {
|
|
12
|
+
e(), u.current(...r);
|
|
13
|
+
}, [e]);
|
|
14
|
+
return t.useEffect(() => e, [e]), { debounced: s, immediate: a, cancel: e };
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
f as useDebounced
|
|
18
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),f=(r,u)=>{const e=t.useRef(!0);t.useEffect(()=>{if(e.current){e.current=!1;return}return r()},u)};exports.useEffectAfterMount=f;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react"),v=require("../../chunks/dom.zgzOBFUw.js");function a({isInteractive:n,disabled:r,isClickable:e,elementType:o,href:i,target:u,rel:c,onClick:f,onKeyDown:s}){return b.useMemo(()=>{const t={};return n&&(t["aria-disabled"]=r||void 0,t.onClick=f,e&&(o==="a"&&i&&!r&&(t.href=i,u&&(t.target=u),t.rel=v.getSecureRelAttribute(u,c)),o==="button"&&(t.type="button"),o==="div"&&(t.tabIndex=r?-1:0,t.onKeyDown=s,t.role="button"))),t},[n,r,e,o,i,u,c,f,s])}exports.useInteractiveProps=a;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type InteractiveElementType = 'div' | 'a' | 'button';
|
|
3
|
+
export interface UseInteractivePropsOptions {
|
|
4
|
+
isInteractive: boolean;
|
|
5
|
+
disabled: boolean;
|
|
6
|
+
isClickable: boolean;
|
|
7
|
+
elementType: InteractiveElementType;
|
|
8
|
+
href?: string;
|
|
9
|
+
target?: string;
|
|
10
|
+
rel?: string;
|
|
11
|
+
onClick: (event: React.MouseEvent<HTMLElement>) => void;
|
|
12
|
+
onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
|
|
13
|
+
}
|
|
14
|
+
export type InteractiveProps = React.HTMLAttributes<HTMLElement> & {
|
|
15
|
+
href?: string;
|
|
16
|
+
target?: string;
|
|
17
|
+
rel?: string;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Returns props for an interactive container (e.g. clickable/selectable Card)
|
|
21
|
+
* that may render as div, anchor, or button. Handles aria-disabled, tabIndex,
|
|
22
|
+
* keyboard handler, and link attributes when elementType is 'a'.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useInteractiveProps({ isInteractive, disabled, isClickable, elementType, href, target, rel, onClick, onKeyDown, }: UseInteractivePropsOptions): InteractiveProps;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useMemo as m } from "react";
|
|
2
|
+
import { a as s } from "../../chunks/dom.DGM-dxLe.js";
|
|
3
|
+
function a({
|
|
4
|
+
isInteractive: i,
|
|
5
|
+
disabled: r,
|
|
6
|
+
isClickable: n,
|
|
7
|
+
elementType: t,
|
|
8
|
+
href: f,
|
|
9
|
+
target: u,
|
|
10
|
+
rel: p,
|
|
11
|
+
onClick: b,
|
|
12
|
+
onKeyDown: c
|
|
13
|
+
}) {
|
|
14
|
+
return m(() => {
|
|
15
|
+
const o = {};
|
|
16
|
+
return i && (o["aria-disabled"] = r || void 0, o.onClick = b, n && (t === "a" && f && !r && (o.href = f, u && (o.target = u), o.rel = s(u, p)), t === "button" && (o.type = "button"), t === "div" && (o.tabIndex = r ? -1 : 0, o.onKeyDown = c, o.role = "button"))), o;
|
|
17
|
+
}, [
|
|
18
|
+
i,
|
|
19
|
+
r,
|
|
20
|
+
n,
|
|
21
|
+
t,
|
|
22
|
+
f,
|
|
23
|
+
u,
|
|
24
|
+
p,
|
|
25
|
+
b,
|
|
26
|
+
c
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
a as useInteractiveProps
|
|
31
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const d=require("react/jsx-runtime"),I=require("clsx"),t=require("./ActionList.Item.D7Rg5iMb.js"),$=require("./classNames.DAeKwerT.js");require("./constants.hwjHOsvT.js");const E=require("../lib/ActionList/ActionListSelectionContext.cjs.js"),_=require("../lib/ActionList/ActionListIndentationContext.cjs.js"),N=require("../lib/Divider/Divider.cjs.js"),o=require("react"),L=require("../utils/functions.cjs.js"),P=require("../lib/ActionList/ActionList.context.cjs.js"),b=({children:u,disabled:n,allowGroups:c=!1,kind:r="action"})=>{const{allowChildrenTypes:l=[]}=P.useActionListContext();return o.useMemo(()=>{let s=!1;const m=[t.ActionListItem,...c?[C]:[],...l];return{children:o.Children.toArray(u).flatMap((e,p)=>{if(!o.isValidElement(e))return[];const{disabled:a,kind:h}=e.props;if(L.isSameComponent(e.type,t.ActionListItem)){const i=h??r;return s=s||t.isChoiceKind(i),[o.cloneElement(e,{disabled:n??a,kind:i})]}if(c&&L.isSameComponent(e.type,C)){const i=e.props;return o.Children.forEach(i.children,x=>{if(o.isValidElement(x)){const v=x.props.kind??i.kind??r;s=s||t.isChoiceKind(v)}}),[o.cloneElement(e,{disabled:n??a})]}if(l.some(i=>L.isSameComponent(e.type,i)))return[o.cloneElement(e,{disabled:n??a})];const A=m.map(i=>i.displayName??i.name).join(", ").replace(/, (.+?)$/," or $1");return console.warn(`ActionList: Invalid child at position ${p}. Only ${A} allowed.`),[]}),hasChoiceItems:s}},[u,l,c,n,r])},{baseClassNamePrefix:g,classModifierPrefix:y,subElementClassPrefix:q}=$.getBEMClassNames("action-list__group"),C=({children:u,heading:n,divider:c=!1,kind:r="action",className:l,disabled:s,indent:m,role:f="group"})=>{const e=I(t.styles[g],t.styles[`${y}kind-${r}`],s&&t.styles[`${y}disabled`],l),{children:p,hasChoiceItems:a}=b({children:u,disabled:s,allowGroups:!1,kind:r}),h=_.useActionListIndentation({hasChoiceItems:a,indentProp:m}),A=typeof n=="string"?d.jsx("div",{className:t.styles[`${q}heading`],children:n}):n;return d.jsx(E.ActionListSelectionProvider,{kind:r,children:d.jsx(_.ActionListIndentationProvider,{indent:h,children:d.jsxs("div",{className:e,role:f,children:[A||null,p,c&&d.jsx(N.Divider,{borderColor:"01",className:t.styles[`${q}divider`],role:"presentation","aria-orientation":void 0})]})})})};exports.ActionListGroup=C;exports.useActionListChildren=b;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { jsx as m, jsxs as b } from "react/jsx-runtime";
|
|
2
|
-
import E from "clsx";
|
|
3
|
-
import { A as L, i as $, s as l } from "./ActionList.Item.Dg_KHGsm.js";
|
|
4
|
-
import { g as M } from "./classNames.DNsS4J__.js";
|
|
5
|
-
import "./constants.BBi77pmH.js";
|
|
6
|
-
import { ActionListSelectionProvider as j } from "../lib/ActionList/ActionListSelectionContext.es.js";
|
|
7
|
-
import { useActionListIndentation as k, ActionListIndentationProvider as w } from "../lib/ActionList/ActionListIndentationContext.es.js";
|
|
8
|
-
import { Divider as D } from "../lib/Divider/Divider.es.js";
|
|
9
|
-
import { useMemo as K, Children as g, isValidElement as v, cloneElement as h } from "react";
|
|
10
|
-
import { isSameComponent as C } from "../utils/functions.es.js";
|
|
11
|
-
import { useActionListContext as S } from "../lib/ActionList/ActionList.context.es.js";
|
|
12
|
-
const B = ({
|
|
13
|
-
children: c,
|
|
14
|
-
disabled: o,
|
|
15
|
-
allowGroups: r = !1,
|
|
16
|
-
kind: t = "action"
|
|
17
|
-
}) => {
|
|
18
|
-
const { allowChildrenTypes: n = [] } = S();
|
|
19
|
-
return K(() => {
|
|
20
|
-
let s = !1;
|
|
21
|
-
const d = [
|
|
22
|
-
L,
|
|
23
|
-
...r ? [N] : [],
|
|
24
|
-
...n
|
|
25
|
-
];
|
|
26
|
-
return { children: g.toArray(c).flatMap((e, p) => {
|
|
27
|
-
if (!v(e))
|
|
28
|
-
return [];
|
|
29
|
-
const { disabled: a, kind: f } = e.props;
|
|
30
|
-
if (C(e.type, L)) {
|
|
31
|
-
const i = f ?? t;
|
|
32
|
-
return s = s || $(i), [
|
|
33
|
-
h(e, {
|
|
34
|
-
disabled: o ?? a,
|
|
35
|
-
kind: i
|
|
36
|
-
})
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
if (r && C(e.type, N)) {
|
|
40
|
-
const i = e.props;
|
|
41
|
-
return g.forEach(i.children, (y) => {
|
|
42
|
-
if (v(y)) {
|
|
43
|
-
const I = y.props.kind ?? i.kind ?? t;
|
|
44
|
-
s = s || $(I);
|
|
45
|
-
}
|
|
46
|
-
}), [
|
|
47
|
-
h(e, {
|
|
48
|
-
disabled: o ?? a
|
|
49
|
-
})
|
|
50
|
-
];
|
|
51
|
-
}
|
|
52
|
-
if (n.some(
|
|
53
|
-
(i) => C(e.type, i)
|
|
54
|
-
))
|
|
55
|
-
return [
|
|
56
|
-
h(e, {
|
|
57
|
-
disabled: o ?? a
|
|
58
|
-
})
|
|
59
|
-
];
|
|
60
|
-
const u = d.map((i) => i.displayName ?? i.name).join(", ").replace(/, (.+?)$/, " or $1");
|
|
61
|
-
return console.warn(
|
|
62
|
-
`ActionList: Invalid child at position ${p}. Only ${u} allowed.`
|
|
63
|
-
), [];
|
|
64
|
-
}), hasChoiceItems: s };
|
|
65
|
-
}, [c, n, r, o, t]);
|
|
66
|
-
}, { baseClassNamePrefix: O, classModifierPrefix: x, subElementClassPrefix: P } = M("action-list__group"), N = ({
|
|
67
|
-
children: c,
|
|
68
|
-
heading: o,
|
|
69
|
-
divider: r = !1,
|
|
70
|
-
kind: t = "action",
|
|
71
|
-
className: n,
|
|
72
|
-
disabled: s,
|
|
73
|
-
indent: d,
|
|
74
|
-
role: A = "group"
|
|
75
|
-
}) => {
|
|
76
|
-
const e = E(
|
|
77
|
-
l[O],
|
|
78
|
-
l[`${x}kind-${t}`],
|
|
79
|
-
s && l[`${x}disabled`],
|
|
80
|
-
n
|
|
81
|
-
), { children: p, hasChoiceItems: a } = B({
|
|
82
|
-
children: c,
|
|
83
|
-
disabled: s,
|
|
84
|
-
allowGroups: !1,
|
|
85
|
-
kind: t
|
|
86
|
-
}), f = k({
|
|
87
|
-
hasChoiceItems: a,
|
|
88
|
-
indentProp: d
|
|
89
|
-
}), u = typeof o == "string" ? /* @__PURE__ */ m("div", { className: l[`${P}heading`], children: o }) : o;
|
|
90
|
-
return /* @__PURE__ */ m(j, { kind: t, children: /* @__PURE__ */ m(w, { indent: f, children: /* @__PURE__ */ b("div", { className: e, role: A, children: [
|
|
91
|
-
u || null,
|
|
92
|
-
p,
|
|
93
|
-
r && /* @__PURE__ */ m(
|
|
94
|
-
D,
|
|
95
|
-
{
|
|
96
|
-
borderColor: "01",
|
|
97
|
-
className: l[`${P}divider`],
|
|
98
|
-
role: "presentation",
|
|
99
|
-
"aria-orientation": void 0
|
|
100
|
-
}
|
|
101
|
-
)
|
|
102
|
-
] }) }) });
|
|
103
|
-
};
|
|
104
|
-
export {
|
|
105
|
-
N as A,
|
|
106
|
-
B as u
|
|
107
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var At=require("../assets/ActionList.css");const e=require("react/jsx-runtime"),tt=require("../lib/ActionList/ActionListIndentationContext.cjs.js"),et=require("clsx"),it=require("./classNames.DAeKwerT.js");require("./constants.hwjHOsvT.js");const w=require("../lib/Icon/Icon.cjs.js"),N=require("./tokens.Bgac_JPh.js"),st=require("./Check.CR4kqxW9.js"),nt=require("./ChevronRightCurved.CoT-Bqyo.js"),ot=require("../lib/StateLayer/StateLayer.cjs.js"),ct=require("../lib/ActionList/ActionListSelectionContext.cjs.js"),rt=require("../lib/Tooltip/Tooltip.cjs.js"),x=require("../utils/functions.cjs.js"),lt=require("../lib/Tooltip/useTooltipClipping.cjs.js"),n=require("react"),at=require("../lib/Checkbox/Checkbox.cjs.js"),_t=require("../lib/RadioButton/RadioButton.cjs.js"),mt=require("@floating-ui/react"),ut=require("../lib/ActionList/ActionList.Item.context.cjs.js"),bt=require("../lib/ActionList/ActionList.context.cjs.js"),dt=require("../lib/Form/hooks/useAccessibleId.hook.cjs.js");require("./form.context.B1PXIJNq.js");const ht=require("../lib/Switch/Switch.cjs.js"),i={"bm-light":"bm-light","bm-dark":"bm-dark","bm-inverse":"bm-inverse","bm-action-list":"bm-action-list","bm-action-list__no-results":"bm-action-list__no-results","bm-action-list__loading":"bm-action-list__loading","bm-action-list__item":"bm-action-list__item","bm-action-list__item__supporting-text":"bm-action-list__item__supporting-text","bm-action-list__item--kind-destructive":"bm-action-list__item--kind-destructive","bm-action-list__item--disabled":"bm-action-list__item--disabled","bm-state-layer":"bm-state-layer","bm-action-list__item--active":"bm-action-list__item--active","bm-action-list__item__choice":"bm-action-list__item__choice","bm-action-list__item__switch":"bm-action-list__item__switch","bm-action-list__item__content-before":"bm-action-list__item__content-before","bm-action-list__item__content":"bm-action-list__item__content","bm-action-list__item__text":"bm-action-list__item__text","bm-action-list__item--header":"bm-action-list__item--header","bm-action-list__item__content-after":"bm-action-list__item__content-after","bm-button":"bm-button","bm-action-list__item__flyout":"bm-action-list__item__flyout","bm-action-list__group":"bm-action-list__group","bm-action-list__group__heading":"bm-action-list__group__heading","bm-action-list__group__divider":"bm-action-list__group__divider","bm-action-list__item__icon-button__placeholder":"bm-action-list__item__icon-button__placeholder"},xt="singleCheckMark",ft="multiCheckMark",kt="checkbox",Ct="radio",vt="switch",pt=[xt,ft,kt,Ct,vt],k=r=>pt.includes(r),{baseClassNamePrefix:gt,classModifierPrefix:f,subElementClassPrefix:o}=it.getBEMClassNames("action-list__item"),C=n.createContext({current:null}),qt=()=>n.useContext(C),yt=n.forwardRef(({children:r,supportingText:v,contentAfter:p,contentBefore:g,onClick:a,onSelectionChange:$,defaultSelected:M=!1,kind:T="action",indent:F,disabled:l=!1,className:D,role:_,tooltipPlacement:E,hidden:K,...P},O)=>{const{kind:t}=ut.useActionListItemContext(T),{onItemClick:m,itemsFocusable:z,getItemProps:u,insideMenu:q,activeIndex:B}=bt.useActionListContext(),{selected:b,setSelected:G}=ct.useActionListItemSelection(t,M,$),[c,H]=n.useState(b);n.useEffect(()=>{requestAnimationFrame(()=>H(b))},[b]);const y=k(t),J=t==="flyout",d=tt.useActionListIndentation({isChoiceItem:y,indentProp:F}),{index:A,ref:Q}=mt.useListItem({label:l?null:x.extractTextFromReactNode(r)}),I=s=>{l||(k(t)?G(!c):a==null||a(s),m==null||m(A,t,s.nativeEvent))},U=s=>{(s.key==="Enter"||s.key===" ")&&(s.preventDefault(),I(s))},h=n.useCallback(s=>{s.preventDefault()},[]),L=n.useRef(null),R=n.useRef(null),V=lt.useTooltipClipping({clippingRef:R}),W=x.mergeRefs(Q,O),X=n.useMemo(()=>_||(q?t==="singleCheckMark"||t==="radio"?"menuitemradio":t==="multiCheckMark"||t==="checkbox"||t==="switch"?"menuitemcheckbox":"menuitem":"option"),[_,q,t]),j={...P,onClick:I,tabIndex:z?0:-1},{id:Y}=dt.useAccessibleId(),S=B===A,Z=et(i[gt],i[`${f}kind-${t}`],l&&i[`${f}disabled`],S&&i[`${f}active`],D);return e.jsxs(C.Provider,{value:L,children:[e.jsx(rt.Tooltip,{showDelay:500,portalled:!0,text:x.extractTextFromReactNode(r),...V,placement:E,children:e.jsxs("div",{className:Z,role:X,"aria-checked":c||void 0,"aria-selected":S||void 0,"aria-disabled":l,onKeyDown:U,id:Y,...(u==null?void 0:u(j))??j,ref:W,hidden:K,children:[d&&e.jsx("div",{style:{width:d===!0?N.bmCompActionlistSizeIcon:`${d}rem`}}),y&&t!=="switch"&&e.jsxs("div",{className:i[`${o}choice`],inert:"",children:[(t==="singleCheckMark"||t==="multiCheckMark")&&c&&e.jsx(w.Icon,{customIconSize:N.bmCompActionlistSizeChoice,icon:st.SvgCheck}),t==="checkbox"&&e.jsx(at.Checkbox,{checked:c,onChange:h}),t==="radio"&&e.jsx(_t.RadioButton,{checked:c,onChange:h})]}),g&&e.jsx("div",{className:i[`${o}content-before`],children:g}),e.jsxs("div",{className:i[`${o}content`],children:[e.jsx("div",{className:i[`${o}text`],ref:R,children:r}),v&&e.jsx("div",{className:i[`${o}supporting-text`],children:v})]}),p&&e.jsx("div",{className:i[`${o}content-after`],children:p}),t==="switch"&&e.jsx("div",{className:i[`${o}switch`],inert:"",children:e.jsx(ht.Switch,{checked:c,onChange:h})}),J&&e.jsx(w.Icon,{className:i[`${o}flyout`],icon:nt.SvgChevronRightCurved}),e.jsx(ot.StateLayer,{})]})}),e.jsx("div",{ref:L})]})});exports.ActionListItem=yt;exports.ActionListItemOverlayRefContext=C;exports.isChoiceKind=k;exports.styles=i;exports.useActionListItemOverlayRef=qt;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=require("../assets/card.css");const a={"bm-light":"bm-light","bm-dark":"bm-dark","bm-inverse":"bm-inverse","bm-card":"bm-card","bm-card--default-background":"bm-card--default-background","bm-card--default-shadow":"bm-card--default-shadow","bm-card--default-border":"bm-card--default-border","bm-card--default-border-radius":"bm-card--default-border-radius","bm-card--interactive":"bm-card--interactive","bm-state-layer":"bm-state-layer","bm-card--disabled":"bm-card--disabled","bm-card--selected":"bm-card--selected","bm-card__content":"bm-card__content","bm-card__content--density-sm":"bm-card__content--density-sm","bm-card__content--density-md":"bm-card__content--density-md","bm-card__content--density-lg":"bm-card__content--density-lg","bm-card__header":"bm-card__header","bm-card__header__content-before":"bm-card__header__content-before","bm-card__header__heading":"bm-card__header__heading","bm-card__header__heading__eyebrow":"bm-card__header__heading__eyebrow","bm-card__header__heading__text":"bm-card__header__heading__text","bm-card__header__heading__supporting-text":"bm-card__header__heading__supporting-text","bm-card__header__content-after":"bm-card__header__content-after","bm-card__media-below":"bm-card__media-below","bm-card__media-above":"bm-card__media-above","bm-card__media-above--overlay-color-black-10":"bm-card__media-above--overlay-color-black-10","bm-card__media-below--overlay-color-black-10":"bm-card__media-below--overlay-color-black-10","bm-card__media-above--overlay-color-black-20":"bm-card__media-above--overlay-color-black-20","bm-card__media-below--overlay-color-black-20":"bm-card__media-below--overlay-color-black-20","bm-card__media-above--overlay-color-black-30":"bm-card__media-above--overlay-color-black-30","bm-card__media-below--overlay-color-black-30":"bm-card__media-below--overlay-color-black-30","bm-card__media-above--overlay-color-black-40":"bm-card__media-above--overlay-color-black-40","bm-card__media-below--overlay-color-black-40":"bm-card__media-below--overlay-color-black-40","bm-card__media-above--overlay-color-white-10":"bm-card__media-above--overlay-color-white-10","bm-card__media-below--overlay-color-white-10":"bm-card__media-below--overlay-color-white-10","bm-card__media-above--overlay-color-white-20":"bm-card__media-above--overlay-color-white-20","bm-card__media-below--overlay-color-white-20":"bm-card__media-below--overlay-color-white-20","bm-card__media-above--overlay-color-white-30":"bm-card__media-above--overlay-color-white-30","bm-card__media-below--overlay-color-white-30":"bm-card__media-below--overlay-color-white-30","bm-card__media-above--overlay-color-white-40":"bm-card__media-above--overlay-color-white-40","bm-card__media-below--overlay-color-white-40":"bm-card__media-below--overlay-color-white-40","bm-card__media-above__overlay-top":"bm-card__media-above__overlay-top","bm-card__media-above__overlay-middle":"bm-card__media-above__overlay-middle","bm-card__media-above__overlay-bottom":"bm-card__media-above__overlay-bottom","bm-card__media-below__overlay-top":"bm-card__media-below__overlay-top","bm-card__media-below__overlay-middle":"bm-card__media-below__overlay-middle","bm-card__media-below__overlay-bottom":"bm-card__media-below__overlay-bottom","bm-card__body":"bm-card__body","bm-card__footer":"bm-card__footer","bm-card__footer__actions":"bm-card__footer__actions","bm-card__footer__actions--start":"bm-card__footer__actions--start","bm-card__footer__actions--end":"bm-card__footer__actions--end","bm-card__footer__actions--spaceBetween":"bm-card__footer__actions--spaceBetween","bm-card__footer__actions--stacked":"bm-card__footer__actions--stacked"};exports.styles=a;
|
package/chunks/dom.CVmkHCnh.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const o = (n) => new DOMRect(
|
|
2
|
-
n.x + window.scrollX,
|
|
3
|
-
n.y + window.scrollY,
|
|
4
|
-
n.width,
|
|
5
|
-
n.height
|
|
6
|
-
), i = (n) => {
|
|
7
|
-
if (!n)
|
|
8
|
-
return null;
|
|
9
|
-
const t = n.getBoundingClientRect();
|
|
10
|
-
return o(t);
|
|
11
|
-
}, l = (n, t) => {
|
|
12
|
-
if (n === "_blank") {
|
|
13
|
-
const e = t ? t.split(/\s+/) : [];
|
|
14
|
-
return e.includes("noopener") || e.push("noopener"), e.join(" ");
|
|
15
|
-
}
|
|
16
|
-
return t;
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
i as a,
|
|
20
|
-
l as g
|
|
21
|
-
};
|
package/chunks/dom.PCrm8EUc.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const i=t=>new DOMRect(t.x+window.scrollX,t.y+window.scrollY,t.width,t.height),o=t=>{if(!t)return null;const e=t.getBoundingClientRect();return i(e)},l=(t,e)=>{if(t==="_blank"){const n=e?e.split(/\s+/):[];return n.includes("noopener")||n.push("noopener"),n.join(" ")}return e};exports.getElementScrollBoundingClientRect=o;exports.getSecureRelAttribute=l;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const o="var(--bm-sem-color-surface-01)",e="var(--bm-sem-space-100)",c="var(--bm-comp-actionlist-size-icon)",p="var(--bm-comp-actionlist-size-choice)",m="var(--bm-comp-file-upload-color-file-icon-success)",r="var(--bm-comp-file-upload-color-file-icon-error)",i="var(--bm-comp-helper-text-space-top)",t="var(--bm-comp-popover-space-offset)",l="var(--bm-comp-tooltip-space-arrow)",s="var(--bm-comp-tooltip-space-offset)";exports.bmCompActionlistSizeChoice=p;exports.bmCompActionlistSizeIcon=c;exports.bmCompFileUploadColorFileIconError=r;exports.bmCompFileUploadColorFileIconSuccess=m;exports.bmCompHelperTextSpaceTop=i;exports.bmCompPopoverSpaceOffset=t;exports.bmCompTooltipSpaceArrow=l;exports.bmCompTooltipSpaceOffset=s;exports.bmSemColorSurface01=o;exports.bmSemSpace100=e;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const o = "var(--bm-sem-color-surface-01)", c = "var(--bm-sem-space-100)", e = "var(--bm-comp-actionlist-size-icon)", s = "var(--bm-comp-actionlist-size-choice)", p = "var(--bm-comp-file-upload-color-file-icon-success)", a = "var(--bm-comp-file-upload-color-file-icon-error)", m = "var(--bm-comp-helper-text-space-top)", r = "var(--bm-comp-popover-space-offset)", t = "var(--bm-comp-tooltip-space-arrow)", i = "var(--bm-comp-tooltip-space-offset)";
|
|
2
|
-
export {
|
|
3
|
-
o as a,
|
|
4
|
-
c as b,
|
|
5
|
-
r as c,
|
|
6
|
-
t as d,
|
|
7
|
-
i as e,
|
|
8
|
-
p as f,
|
|
9
|
-
a as g,
|
|
10
|
-
e as h,
|
|
11
|
-
s as i,
|
|
12
|
-
m as j
|
|
13
|
-
};
|