@viasat/beam-react 2.22.0 → 2.24.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/Search.css +1 -1
- package/assets/panel.css +1 -1
- package/chunks/{FloatingUI.context.Dl4Y1y1z.js → FloatingUI.context.D3kSM-y1.js} +2 -2
- package/chunks/Search.Results.DqEXVJeE.js +1 -0
- package/chunks/Search.Results.XLqY_iES.js +73 -0
- package/chunks/{panel.module.a_gaicKX.js → panel.module.DCpj0tSX.js} +1 -1
- package/index.cjs.js +1 -1
- package/index.es.js +22 -20
- package/lib/Alert/Alert.figma.d.ts +1 -0
- package/lib/Dialog/Dialog.Header.es.js +1 -1
- package/lib/Dialog/Dialog.Trigger.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.context.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.root.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.trigger.close.es.js +7 -7
- package/lib/FloatingUI/FloatingUI.trigger.es.js +4 -4
- package/lib/Menu/ActionListContextWrapper.es.js +1 -1
- package/lib/Popover/Popover.content.es.js +1 -1
- package/lib/Popover/Popover.trigger.es.js +1 -1
- package/lib/Search/Search.Results.Item.cjs.js +1 -0
- package/lib/Search/Search.Results.Item.d.ts +11 -0
- package/lib/Search/Search.Results.Item.es.js +9 -0
- package/lib/Search/Search.Results.ViewAll.cjs.js +1 -0
- package/lib/{wip/Search → Search}/Search.Results.ViewAll.d.ts +11 -4
- package/lib/Search/Search.Results.ViewAll.es.js +11 -0
- package/lib/Search/Search.Results.cjs.js +1 -0
- package/lib/Search/Search.Results.es.js +12 -0
- package/lib/Search/Search.cjs.js +1 -0
- package/lib/{wip/Search → Search}/Search.d.ts +18 -9
- package/lib/Search/Search.es.js +179 -0
- package/lib/Search/SearchDropdown.cjs.js +1 -0
- package/lib/Search/SearchDropdown.es.js +58 -0
- package/lib/Search/index.d.ts +4 -0
- package/lib/Search/useSearchDropdown.cjs.js +1 -0
- package/lib/{wip/Search → Search}/useSearchDropdown.es.js +2 -2
- package/lib/Switch/Switch.figma.d.ts +1 -0
- package/lib/Tooltip/Tooltip.es.js +1 -1
- package/lib/Tooltip/Tooltip.figma.d.ts +1 -0
- package/lib/index.cjs.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.es.js +21 -19
- package/lib/wip/Panel/Panel.Body.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Body.d.ts +6 -1
- package/lib/wip/Panel/Panel.Body.es.js +11 -9
- package/lib/wip/Panel/Panel.Divider.cjs.js +1 -0
- package/lib/wip/Panel/Panel.Divider.d.ts +6 -0
- package/lib/wip/Panel/Panel.Divider.es.js +18 -0
- package/lib/wip/Panel/Panel.Footer.Actions.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Footer.Actions.es.js +1 -1
- package/lib/wip/Panel/Panel.Footer.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Footer.d.ts +12 -1
- package/lib/wip/Panel/Panel.Footer.es.js +28 -15
- package/lib/wip/Panel/Panel.Header.ContentAfter.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.ContentAfter.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.ContentBefore.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.ContentBefore.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.Description.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Description.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.Heading.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Heading.es.js +2 -2
- package/lib/wip/Panel/Panel.Header.Row.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Row.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.Subheader.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Subheader.es.js +1 -1
- package/lib/wip/Panel/Panel.Header.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.d.ts +12 -1
- package/lib/wip/Panel/Panel.Header.es.js +37 -24
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.d.ts +3 -6
- package/lib/wip/Panel/Panel.Inline.es.js +58 -66
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +3 -2
- package/lib/wip/Panel/Panel.Overlay.es.js +23 -22
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.d.ts +4 -4
- package/lib/wip/Panel/Panel.es.js +69 -60
- package/lib/wip/Panel/Panel.helpers.cjs.js +1 -1
- package/lib/wip/Panel/Panel.helpers.d.ts +2 -1
- package/lib/wip/Panel/Panel.helpers.es.js +8 -7
- package/lib/wip/Panel/Panel.types.cjs.js +1 -1
- package/lib/wip/Panel/Panel.types.d.ts +11 -1
- package/lib/wip/Panel/Panel.types.es.js +5 -1
- package/lib/wip/index.cjs.js +1 -1
- package/lib/wip/index.d.ts +0 -1
- package/lib/wip/index.es.js +2 -4
- package/package.json +6 -6
- package/chunks/Search.Results.CFA_KEdP.js +0 -1
- package/chunks/Search.Results.DVf6WKnI.js +0 -68
- package/lib/wip/Search/Search.Results.Item.cjs.js +0 -1
- package/lib/wip/Search/Search.Results.Item.d.ts +0 -11
- package/lib/wip/Search/Search.Results.Item.es.js +0 -10
- package/lib/wip/Search/Search.Results.ViewAll.cjs.js +0 -1
- package/lib/wip/Search/Search.Results.ViewAll.es.js +0 -11
- package/lib/wip/Search/Search.Results.cjs.js +0 -1
- package/lib/wip/Search/Search.Results.d.ts +0 -15
- package/lib/wip/Search/Search.Results.es.js +0 -14
- package/lib/wip/Search/Search.cjs.js +0 -1
- package/lib/wip/Search/Search.es.js +0 -161
- package/lib/wip/Search/SearchDropdown.cjs.js +0 -1
- package/lib/wip/Search/SearchDropdown.es.js +0 -57
- package/lib/wip/Search/index.d.ts +0 -1
- package/lib/wip/Search/useSearchDropdown.cjs.js +0 -1
- package/chunks/{panel.module.DGxSyRdA.js → panel.module.DJLJpnm_.js} +2 -2
- /package/lib/{wip/Search → Search}/SearchDropdown.d.ts +0 -0
- /package/lib/{wip/Search → Search}/index.cjs.js +0 -0
- /package/lib/{wip/Search → Search}/index.es.js +0 -0
- /package/lib/{wip/Search → Search}/useSearchDropdown.d.ts +0 -0
|
@@ -1,92 +1,101 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { useMemo as
|
|
1
|
+
import { jsx as $ } from "react/jsx-runtime";
|
|
2
|
+
import g from "clsx";
|
|
3
|
+
import { useMemo as h } from "react";
|
|
4
4
|
import { g as R } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
5
5
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
6
|
-
import { Header as
|
|
7
|
-
import { Body as
|
|
8
|
-
import { Footer as
|
|
9
|
-
import { usePanelClose as
|
|
10
|
-
import { InlinePanel as
|
|
11
|
-
import { OverlayPanel as
|
|
12
|
-
import { s as e } from "../../../chunks/panel.module.
|
|
13
|
-
const { baseClassNamePrefix: o } = R("panel"),
|
|
6
|
+
import { Header as V } from "./Panel.Header.es.js";
|
|
7
|
+
import { Body as F } from "./Panel.Body.es.js";
|
|
8
|
+
import { Footer as H } from "./Panel.Footer.es.js";
|
|
9
|
+
import { usePanelClose as T, getPanelDividerState as j, PANEL_TRANSITION_DURATION_MS as q, getResolvedPanelPosition as U } from "./Panel.helpers.es.js";
|
|
10
|
+
import { InlinePanel as W } from "./Panel.Inline.es.js";
|
|
11
|
+
import { OverlayPanel as G } from "./Panel.Overlay.es.js";
|
|
12
|
+
import { s as e } from "../../../chunks/panel.module.DJLJpnm_.js";
|
|
13
|
+
const { baseClassNamePrefix: o } = R("panel"), l = ({
|
|
14
14
|
children: m,
|
|
15
15
|
className: _,
|
|
16
|
-
padding:
|
|
17
|
-
onOpenChange:
|
|
18
|
-
open:
|
|
19
|
-
size:
|
|
20
|
-
dismissible:
|
|
21
|
-
closeButtonAriaLabel:
|
|
22
|
-
kind:
|
|
16
|
+
padding: w = "md",
|
|
17
|
+
onOpenChange: y,
|
|
18
|
+
open: p,
|
|
19
|
+
size: r,
|
|
20
|
+
dismissible: d = !0,
|
|
21
|
+
closeButtonAriaLabel: f = "Close panel",
|
|
22
|
+
kind: t = "inline",
|
|
23
23
|
position: a,
|
|
24
24
|
divider: D = !0,
|
|
25
|
-
|
|
25
|
+
dividerColor: c,
|
|
26
|
+
isAnimated: u = !0,
|
|
26
27
|
onBeforeClose: E,
|
|
27
28
|
modalType: s,
|
|
28
|
-
...
|
|
29
|
+
...i
|
|
29
30
|
}) => {
|
|
30
|
-
process.env.NODE_ENV !== "production" && s === "alert" &&
|
|
31
|
+
process.env.NODE_ENV !== "production" && s === "alert" && d && console.warn(
|
|
31
32
|
'Panel: `dismissible` is ignored when `modalType="alert"`. The close button is always hidden.'
|
|
32
|
-
), process.env.NODE_ENV !== "production" &&
|
|
33
|
+
), process.env.NODE_ENV !== "production" && i.closeOnOutsidePress && s !== "nonModal" && s !== void 0 && console.warn(
|
|
33
34
|
'Panel: `closeOnOutsidePress` has no effect when `modalType` is not `"nonModal"`.'
|
|
34
35
|
);
|
|
35
|
-
const
|
|
36
|
+
const N = s === "alert" ? !1 : d, n = U(a), x = r && (n !== "bottom" || r === "full"), P = g(
|
|
36
37
|
e[o],
|
|
37
|
-
e[`${o}--${
|
|
38
|
-
|
|
39
|
-
e[`${o}--padding-${
|
|
38
|
+
e[`${o}--${t}`],
|
|
39
|
+
x && e[`${o}--size-${r}`],
|
|
40
|
+
e[`${o}--padding-${w}`],
|
|
40
41
|
e[`${o}--position-${n}`],
|
|
41
42
|
_
|
|
42
|
-
),
|
|
43
|
+
), I = g(
|
|
43
44
|
e[`${o}__inline-wrapper`],
|
|
44
|
-
|
|
45
|
-
), { requestClose: v, handleOverlayOpenChange:
|
|
45
|
+
r === "full" && e[`${o}__inline-wrapper--full`]
|
|
46
|
+
), { requestClose: v, handleOverlayOpenChange: M } = T(
|
|
46
47
|
E,
|
|
47
|
-
|
|
48
|
-
),
|
|
49
|
-
() => ({
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
y
|
|
49
|
+
), O = h(
|
|
50
|
+
() => ({
|
|
51
|
+
kind: t,
|
|
52
|
+
dismissible: N,
|
|
53
|
+
closeButtonAriaLabel: f,
|
|
54
|
+
position: a,
|
|
55
|
+
requestClose: v
|
|
56
|
+
}),
|
|
57
|
+
[t, N, f, a, v]
|
|
58
|
+
), { showDivider: b, dividerBefore: S, dividerInner: A, dividerAfter: B } = j(D, n), C = h(
|
|
59
|
+
() => ({ duration: u ? q : 0 }),
|
|
60
|
+
[u]
|
|
54
61
|
);
|
|
55
|
-
return
|
|
56
|
-
|
|
62
|
+
return t === "inline" ? /* @__PURE__ */ $(
|
|
63
|
+
W,
|
|
57
64
|
{
|
|
58
|
-
contextValue:
|
|
59
|
-
panelClassName:
|
|
60
|
-
inlineWrapperClassName:
|
|
65
|
+
contextValue: O,
|
|
66
|
+
panelClassName: P,
|
|
67
|
+
inlineWrapperClassName: I,
|
|
61
68
|
resolvedPosition: n,
|
|
62
|
-
dividerBefore:
|
|
63
|
-
dividerInner:
|
|
69
|
+
dividerBefore: S,
|
|
70
|
+
dividerInner: A,
|
|
64
71
|
dividerAfter: B,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
dividerColor: c,
|
|
73
|
+
open: p,
|
|
74
|
+
transitionConfig: C,
|
|
75
|
+
...i,
|
|
68
76
|
children: m
|
|
69
77
|
}
|
|
70
|
-
) : /* @__PURE__ */
|
|
71
|
-
|
|
78
|
+
) : /* @__PURE__ */ $(
|
|
79
|
+
G,
|
|
72
80
|
{
|
|
73
|
-
contextValue:
|
|
74
|
-
panelClassName:
|
|
81
|
+
contextValue: O,
|
|
82
|
+
panelClassName: P,
|
|
75
83
|
resolvedPosition: n,
|
|
76
|
-
showDivider:
|
|
84
|
+
showDivider: b,
|
|
85
|
+
dividerColor: c,
|
|
77
86
|
modalType: s,
|
|
78
|
-
open:
|
|
79
|
-
onOpenChange:
|
|
80
|
-
transitionConfig:
|
|
81
|
-
...
|
|
87
|
+
open: p,
|
|
88
|
+
onOpenChange: M,
|
|
89
|
+
transitionConfig: C,
|
|
90
|
+
...i,
|
|
82
91
|
children: m
|
|
83
92
|
}
|
|
84
93
|
);
|
|
85
94
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
95
|
+
l.displayName = "Panel";
|
|
96
|
+
l.Header = V;
|
|
97
|
+
l.Body = F;
|
|
98
|
+
l.Footer = H;
|
|
90
99
|
export {
|
|
91
|
-
|
|
100
|
+
l as Panel
|
|
92
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),d=400,f="01",P=t=>t||"end",a=(t,s)=>{const e=t&&s!=="full";return{showDivider:e,dividerBefore:e&&s!=="start"&&s!=="bottom",dividerInner:e&&s==="bottom",dividerAfter:e&&s==="start"}},D=(t,s)=>{if(t!=="isModal")return t==="alert"?{escapeKey:!1,outsidePress:!1}:{escapeKey:!1,outsidePress:s??!1}},_=t=>t==="escape-key"?"escapeKey":t==="outside-press"?"outsidePress":"programmatic",v=(t,s)=>{const e=c.useCallback(i=>{if(!t){s==null||s(!1);return}const r=t(i);r instanceof Promise?r.then(l=>{l&&(s==null||s(!1))}).catch(()=>{}):r&&(s==null||s(!1))},[t,s]),u=c.useCallback((i,r,l)=>{i?s==null||s(!0):e(_(l))},[s,e]);return{requestClose:e,handleOverlayOpenChange:u}};exports.DEFAULT_PANEL_DIVIDER_COLOR=f;exports.PANEL_TRANSITION_DURATION_MS=d;exports.getPanelDismissConfig=D;exports.getPanelDividerState=a;exports.getResolvedPanelPosition=P;exports.usePanelClose=v;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { OpenChangeReason } from '@floating-ui/react';
|
|
2
|
-
import { PanelCloseReason, PanelModalType, PanelPosition, PanelProps } from './Panel.types';
|
|
2
|
+
import { PanelCloseReason, PanelDividerColor, PanelModalType, PanelPosition, PanelProps } from './Panel.types';
|
|
3
3
|
export declare const PANEL_TRANSITION_DURATION_MS = 400;
|
|
4
|
+
export declare const DEFAULT_PANEL_DIVIDER_COLOR: PanelDividerColor;
|
|
4
5
|
export declare const getResolvedPanelPosition: (position?: PanelPosition) => PanelPosition;
|
|
5
6
|
export declare const getPanelDividerState: (divider: boolean, position?: PanelPosition) => {
|
|
6
7
|
showDivider: boolean;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as c } from "react";
|
|
2
|
-
const P = 400, v = (t) => t || "end",
|
|
2
|
+
const P = 400, v = "01", m = (t) => t || "end", D = (t, s) => {
|
|
3
3
|
const r = t && s !== "full";
|
|
4
4
|
return {
|
|
5
5
|
showDivider: r,
|
|
@@ -9,10 +9,10 @@ const P = 400, v = (t) => t || "end", m = (t, s) => {
|
|
|
9
9
|
dividerInner: r && s === "bottom",
|
|
10
10
|
dividerAfter: r && s === "start"
|
|
11
11
|
};
|
|
12
|
-
},
|
|
12
|
+
}, _ = (t, s) => {
|
|
13
13
|
if (t !== "isModal")
|
|
14
14
|
return t === "alert" ? { escapeKey: !1, outsidePress: !1 } : { escapeKey: !1, outsidePress: s ?? !1 };
|
|
15
|
-
}, u = (t) => t === "escape-key" ? "escapeKey" : t === "outside-press" ? "outsidePress" : "programmatic",
|
|
15
|
+
}, u = (t) => t === "escape-key" ? "escapeKey" : t === "outside-press" ? "outsidePress" : "programmatic", a = (t, s) => {
|
|
16
16
|
const r = c(
|
|
17
17
|
(i) => {
|
|
18
18
|
if (!t) {
|
|
@@ -35,9 +35,10 @@ const P = 400, v = (t) => t || "end", m = (t, s) => {
|
|
|
35
35
|
return { requestClose: r, handleOverlayOpenChange: f };
|
|
36
36
|
};
|
|
37
37
|
export {
|
|
38
|
+
v as DEFAULT_PANEL_DIVIDER_COLOR,
|
|
38
39
|
P as PANEL_TRANSITION_DURATION_MS,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
_ as getPanelDismissConfig,
|
|
41
|
+
D as getPanelDividerState,
|
|
42
|
+
m as getResolvedPanelPosition,
|
|
43
|
+
a as usePanelClose
|
|
43
44
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../../../chunks/constants.hwjHOsvT.js");const e=["00","00-alt","01","02","03"],o=e;exports.PanelDividerColors=o;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import { PanelDividerColor, PanelDividerColors } from '@viasat/beam-shared/components/panel';
|
|
3
|
+
export type { PanelDividerColor };
|
|
4
|
+
export { PanelDividerColors };
|
|
2
5
|
export type PanelKind = 'inline' | 'overlay';
|
|
3
6
|
export type PanelPosition = 'start' | 'end' | 'bottom' | 'full';
|
|
4
7
|
export type PanelModalType = 'nonModal' | 'isModal' | 'alert';
|
|
@@ -40,7 +43,9 @@ interface BasePanelProps extends ComponentPropsWithoutRef<'aside'> {
|
|
|
40
43
|
*/
|
|
41
44
|
onOpenChange?: (open: boolean) => void;
|
|
42
45
|
/**
|
|
43
|
-
* Specify the size of the Panel
|
|
46
|
+
* Specify the size of the Panel.
|
|
47
|
+
* When `position="bottom"`, only `size="full"` has an effect (enables full-viewport height).
|
|
48
|
+
* All other values are ignored for bottom panels — width is always 100%.
|
|
44
49
|
* @default 'md'
|
|
45
50
|
*/
|
|
46
51
|
size?: PanelSize;
|
|
@@ -71,6 +76,11 @@ interface BasePanelProps extends ComponentPropsWithoutRef<'aside'> {
|
|
|
71
76
|
* @default true
|
|
72
77
|
*/
|
|
73
78
|
divider?: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Specify the border color of the external divider between panel and page content
|
|
81
|
+
* @default '01'
|
|
82
|
+
*/
|
|
83
|
+
dividerColor?: PanelDividerColor;
|
|
74
84
|
/**
|
|
75
85
|
* Specify the position of the Panel
|
|
76
86
|
* 'start' | 'end' | 'bottom' | 'full'
|
package/lib/wip/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./Panel/Panel.cjs.js");exports.Panel=e.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.24.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.24.0",
|
|
63
|
+
"@viasat/beam-shared": "2.24.0",
|
|
64
|
+
"@viasat/beam-styles": "2.24.0",
|
|
65
|
+
"@viasat/beam-tokens": "2.24.0",
|
|
66
|
+
"@viasat/beam-icons": "2.24.0",
|
|
67
67
|
"clsx": "^1.2.1",
|
|
68
68
|
"@floating-ui/react": "^0.26.18",
|
|
69
69
|
"@stepperize/react": "^5.1.5",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var L=require("../assets/Search.css");const c=require("react/jsx-runtime"),a=require("react"),u=require("./classNames.DAeKwerT.js");require("./constants.hwjHOsvT.js");const b=require("clsx"),x=require("../lib/wip/Search/Search.Results.Item.cjs.js"),h=require("../lib/ActionList/ActionList.cjs.js"),R=require("../lib/Icon/Icon.cjs.js");function w(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(t,s,r.get?r:{enumerable:!0,get:()=>e[s]})}}return t.default=e,Object.freeze(t)}const _=w(a),d=e=>_.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.5 14H14.71L14.43 13.73C15.41 12.59 16 11.11 16 9.5C16 5.91 13.09 3 9.5 3C5.91 3 3 5.91 3 9.5C3 13.09 5.91 16 9.5 16C11.11 16 12.59 15.41 13.73 14.43L14 14.71V15.5L19 20.49L20.49 19L15.5 14ZM9.5 14C7.01 14 5 11.99 5 9.5C5 7.01 7.01 5 9.5 5C11.99 5 14 7.01 14 9.5C14 11.99 11.99 14 9.5 14Z",fill:"currentColor"})),l={"bm-light":"bm-light","bm-dark":"bm-dark","bm-inverse":"bm-inverse","bm-enterprise":"bm-enterprise","bm-consumer":"bm-consumer","bm-search":"bm-search","bm-search--disabled":"bm-search--disabled","bm-search--fluid":"bm-search--fluid","bm-search__field":"bm-search__field","bm-search__field__input":"bm-search__field__input","bm-search--error":"bm-search--error","bm-search--read-only":"bm-search--read-only","bm-search__content":"bm-search__content","bm-search__results__view-all":"bm-search__results__view-all","bm-action-list__item__content-before":"bm-action-list__item__content-before","bm-search__results__view-all--group":"bm-search__results__view-all--group"},{baseClassNamePrefix:N,classModifierPrefix:j}=u.getBEMClassNames("search__results__view-all"),o=a.forwardRef(({children:e,onClick:t,variant:s,as:r="div",className:p,...v},C)=>{const g=a.useContext(i),m=s??(g?"group":"global"),S=b.clsx(l[N],l[`${j}${m}`],p);return c.jsx(h.ActionList.Item,{ref:C,className:S,onClick:t,contentBefore:m==="global"?c.jsx(R.Icon,{icon:d}):void 0,role:"option",as:r,...v,children:e})});o.displayName="Search.Results.ViewAll";const{baseClassNamePrefix:y}=u.getBEMClassNames("search"),i=a.createContext(!1),f=({children:e,...t})=>{const s=b.clsx(l[`${y}__results`]);return c.jsx(i.Provider,{value:!0,children:c.jsx(h.ActionList.Group,{className:s,...t,children:e})})},n=f;n.Item=x.SearchResultsItem;n.ViewAll=o;n.displayName="Search.Results";exports.SearchResults=n;exports.SearchResultsComponent=f;exports.SearchResultsContext=i;exports.SearchResultsViewAll=o;exports.SvgSearch=d;exports.styles=l;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import "../assets/Search.css";
|
|
2
|
-
import { jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import * as c from "react";
|
|
4
|
-
import t from "react";
|
|
5
|
-
import { g as i } from "./classNames.BTJmrO_L.js";
|
|
6
|
-
import "./constants.CKKGf1-i.js";
|
|
7
|
-
import { clsx as n } from "clsx";
|
|
8
|
-
import { SearchResultsItem as w } from "../lib/wip/Search/Search.Results.Item.es.js";
|
|
9
|
-
import { ActionList as _ } from "../lib/ActionList/ActionList.es.js";
|
|
10
|
-
import { Icon as g } from "../lib/Icon/Icon.es.js";
|
|
11
|
-
const x = (e) => /* @__PURE__ */ c.createElement("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ c.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M15.5 14H14.71L14.43 13.73C15.41 12.59 16 11.11 16 9.5C16 5.91 13.09 3 9.5 3C5.91 3 3 5.91 3 9.5C3 13.09 5.91 16 9.5 16C11.11 16 12.59 15.41 13.73 14.43L14 14.71V15.5L19 20.49L20.49 19L15.5 14ZM9.5 14C7.01 14 5 11.99 5 9.5C5 7.01 7.01 5 9.5 5C11.99 5 14 7.01 14 9.5C14 11.99 11.99 14 9.5 14Z", fill: "currentColor" })), l = {
|
|
12
|
-
"bm-light": "bm-light",
|
|
13
|
-
"bm-dark": "bm-dark",
|
|
14
|
-
"bm-inverse": "bm-inverse",
|
|
15
|
-
"bm-enterprise": "bm-enterprise",
|
|
16
|
-
"bm-consumer": "bm-consumer",
|
|
17
|
-
"bm-search": "bm-search",
|
|
18
|
-
"bm-search--disabled": "bm-search--disabled",
|
|
19
|
-
"bm-search--fluid": "bm-search--fluid",
|
|
20
|
-
"bm-search__field": "bm-search__field",
|
|
21
|
-
"bm-search__field__input": "bm-search__field__input",
|
|
22
|
-
"bm-search--error": "bm-search--error",
|
|
23
|
-
"bm-search--read-only": "bm-search--read-only",
|
|
24
|
-
"bm-search__content": "bm-search__content",
|
|
25
|
-
"bm-search__results__view-all": "bm-search__results__view-all",
|
|
26
|
-
"bm-action-list__item__content-before": "bm-action-list__item__content-before",
|
|
27
|
-
"bm-search__results__view-all--group": "bm-search__results__view-all--group"
|
|
28
|
-
}, { baseClassNamePrefix: R, classModifierPrefix: S } = i("search__results__view-all"), b = t.forwardRef(
|
|
29
|
-
({ children: e, onClick: r, variant: a, as: u = "div", className: d, ...f }, p) => {
|
|
30
|
-
const v = t.useContext(h), m = a ?? (v ? "group" : "global"), C = n(
|
|
31
|
-
l[R],
|
|
32
|
-
l[`${S}${m}`],
|
|
33
|
-
d
|
|
34
|
-
);
|
|
35
|
-
return /* @__PURE__ */ s(
|
|
36
|
-
_.Item,
|
|
37
|
-
{
|
|
38
|
-
ref: p,
|
|
39
|
-
className: C,
|
|
40
|
-
onClick: r,
|
|
41
|
-
contentBefore: m === "global" ? /* @__PURE__ */ s(g, { icon: x }) : void 0,
|
|
42
|
-
role: "option",
|
|
43
|
-
as: u,
|
|
44
|
-
...f,
|
|
45
|
-
children: e
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
b.displayName = "Search.Results.ViewAll";
|
|
51
|
-
const { baseClassNamePrefix: N } = i("search"), h = t.createContext(!1), L = ({
|
|
52
|
-
children: e,
|
|
53
|
-
...r
|
|
54
|
-
}) => {
|
|
55
|
-
const a = n(l[`${N}__results`]);
|
|
56
|
-
return /* @__PURE__ */ s(h.Provider, { value: !0, children: /* @__PURE__ */ s(_.Group, { className: a, ...r, children: e }) });
|
|
57
|
-
}, o = L;
|
|
58
|
-
o.Item = w;
|
|
59
|
-
o.ViewAll = b;
|
|
60
|
-
o.displayName = "Search.Results";
|
|
61
|
-
export {
|
|
62
|
-
x as S,
|
|
63
|
-
o as a,
|
|
64
|
-
b,
|
|
65
|
-
L as c,
|
|
66
|
-
h as d,
|
|
67
|
-
l as s
|
|
68
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),c=require("react"),o=require("../../ActionList/ActionList.cjs.js"),e=c.forwardRef(({children:t,...s},r)=>i.jsx(o.ActionList.Item,{ref:r,...s,children:t}));e.displayName="Search.Results.Item";exports.SearchResultsItem=e;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { ActionListItemProps } from '../../ActionList/ActionList.Item';
|
|
3
|
-
export type SearchResultsItemProps<C extends React.ElementType = 'div'> = ActionListItemProps<C>;
|
|
4
|
-
export declare const SearchResultsItem: SearchResultsItemComponent;
|
|
5
|
-
interface SearchResultsItemComponent {
|
|
6
|
-
<C extends React.ElementType = 'div'>(props: ActionListItemProps<C> & {
|
|
7
|
-
ref?: React.ComponentPropsWithRef<C>['ref'];
|
|
8
|
-
}): React.ReactElement | null;
|
|
9
|
-
displayName?: string;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import o from "react";
|
|
3
|
-
import { ActionList as s } from "../../ActionList/ActionList.es.js";
|
|
4
|
-
const a = o.forwardRef(
|
|
5
|
-
({ children: t, ...e }, r) => /* @__PURE__ */ m(s.Item, { ref: r, ...e, children: t })
|
|
6
|
-
);
|
|
7
|
-
a.displayName = "Search.Results.Item";
|
|
8
|
-
export {
|
|
9
|
-
a as SearchResultsItem
|
|
10
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("react/jsx-runtime");require("react");require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");require("clsx");const e=require("../../../chunks/Search.Results.CFA_KEdP.js");require("../../ActionList/ActionList.cjs.js");require("../../Icon/Icon.cjs.js");exports.SearchResultsViewAll=e.SearchResultsViewAll;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
|
-
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import "clsx";
|
|
6
|
-
import { b as a } from "../../../chunks/Search.Results.DVf6WKnI.js";
|
|
7
|
-
import "../../ActionList/ActionList.es.js";
|
|
8
|
-
import "../../Icon/Icon.es.js";
|
|
9
|
-
export {
|
|
10
|
-
a as SearchResultsViewAll
|
|
11
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require("react/jsx-runtime");require("react");require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");require("clsx");const e=require("../../../chunks/Search.Results.CFA_KEdP.js");require("./Search.Results.Item.cjs.js");require("../../ActionList/ActionList.cjs.js");exports.SearchResults=e.SearchResults;exports.SearchResultsComponent=e.SearchResultsComponent;exports.SearchResultsContext=e.SearchResultsContext;exports.default=e.SearchResults;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { default as React } from 'react';
|
|
2
|
-
import { SearchResultsItem } from './Search.Results.Item';
|
|
3
|
-
import { SearchResultsViewAll } from './Search.Results.ViewAll';
|
|
4
|
-
import { ActionListGroupProps } from '../../ActionList/ActionList.Group';
|
|
5
|
-
export declare const SearchResultsContext: React.Context<boolean>;
|
|
6
|
-
export interface SearchResultsProps extends ActionListGroupProps {
|
|
7
|
-
children?: React.ReactNode;
|
|
8
|
-
noResults?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare const SearchResultsComponent: React.FC<SearchResultsProps>;
|
|
11
|
-
export declare const SearchResults: typeof SearchResultsComponent & {
|
|
12
|
-
Item: typeof SearchResultsItem;
|
|
13
|
-
ViewAll: typeof SearchResultsViewAll;
|
|
14
|
-
};
|
|
15
|
-
export default SearchResults;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
|
-
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import "clsx";
|
|
6
|
-
import { a as c, c as l, d as u, a as h } from "../../../chunks/Search.Results.DVf6WKnI.js";
|
|
7
|
-
import "./Search.Results.Item.es.js";
|
|
8
|
-
import "../../ActionList/ActionList.es.js";
|
|
9
|
-
export {
|
|
10
|
-
c as SearchResults,
|
|
11
|
-
l as SearchResultsComponent,
|
|
12
|
-
u as SearchResultsContext,
|
|
13
|
-
h as default
|
|
14
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),oe=require("../../../chunks/classNames.DAeKwerT.js"),ae=require("../../../chunks/constants.hwjHOsvT.js"),S=require("react"),t=require("../../../chunks/Search.Results.CFA_KEdP.js"),F=require("clsx"),ue=require("../../../chunks/form.context.hesWPMlU.js"),de=require("../../Form/contexts/label.context.cjs.js"),_e=require("../../Form/contexts/helperText.context.cjs.js"),pe=require("../../Form/hooks/useUniversalRef.hook.cjs.js"),q=require("../../Form/hooks/useAccessibleId.hook.cjs.js"),fe=require("../../Icon/Icon.cjs.js"),be=require("./useSearchDropdown.cjs.js"),xe=require("./SearchDropdown.cjs.js"),he=require("../../ActionList/ActionList.cjs.js"),me=require("../../../utils/hooks/useDebounced.cjs.js"),Se=require("../../../utils/hooks/useEffectAfterMount.cjs.js"),qe=require("../../Spinner/Spinner.cjs.js"),ye=require("../../CloseButton/CloseButton.cjs.js"),{baseClassNamePrefix:Ie,subElementClassPrefix:n,classModifierPrefix:_}=oe.getBEMClassNames("search"),je=S.forwardRef(({id:T,defaultValue:H="",value:y,onChange:r,onSearch:C,loading:I=!1,debounce:L=200,onKeyDown:f,label:B,contentAfter:j,contentBefore:D,helperText:P,fluid:V,width:z,theme:v,disabled:i,hideIcon:U,icon:W=t.SvgSearch,error:c,readOnly:a,clearable:N=!0,noResults:k,clearButtonAriaLabel:G="Clear search",className:J,children:w,"aria-describedby":Q,...b},X)=>{const{refFn:Y,ref:Z}=pe.useUniversalRef(X),[O,R]=S.useState(String(H)),u=y!==void 0,o=u?String(y):O,K=e=>{u||R(e.target.value),r==null||r(e)},{immediate:x,debounced:A}=me.useDebounced(C,L),ee=e=>{if(f==null||f(e),e.key==="Enter"){if(e.isDefaultPrevented()||e.isPropagationStopped())return;const{activeIndex:l,elementsRef:ne}=h,m=l!==null?ne.current[l]:null;m&&m.getAttribute("aria-disabled")!=="true"?(e.preventDefault(),m.click()):l===null&&x(o)}e.key==="Escape"&&(!N||h.open)&&e.preventDefault()},{id:d}=q.useAccessibleId(),{id:$}=q.useAccessibleId(),{id:g}=q.useAccessibleId(),E=!!(c!=null&&c.length),M=!!w||!!k,se=F(P&&g,E&&$,Q),{dropdownProps:h,getFieldProps:te,getInputProps:re}=be.useSearchDropdown({enabled:M,disabled:!!i,readOnly:!!a});Se.useEffectAfterMount(()=>{A(o)},[o,A]);const ie=F(t.styles[Ie],v&&ae.themeClassName(v),V&&t.styles[`${_}fluid`],i&&t.styles[`${_}disabled`],a&&t.styles[`${_}read-only`],c&&t.styles[`${_}error`],J),ce=e=>{var l;i||e.target instanceof HTMLInputElement||e.target.closest('button,[role="button"],a,[role="link"]')||(e.preventDefault(),e.stopPropagation(),(l=Z.current)==null||l.focus())},le=S.useCallback(()=>{u?r==null||r({target:{value:"",name:b.name,id:d,type:"search"}}):R(""),x("")},[d,u,r,x,b.name]);return s.jsxs("div",{id:T,className:ie,role:"search",style:{maxWidth:z},"aria-busy":I,children:[s.jsx(de.LabelProvider,{ctxDisabled:!!i,ctxRequired:!1,ctxHtmlFor:d,children:B}),s.jsxs("div",{className:t.styles[`${n}field`],...te({onPointerDown:ce}),children:[!U&&s.jsx(fe.Icon,{icon:W,"aria-hidden":!0}),D&&s.jsx("div",{className:t.styles[`${n}content`],children:D}),s.jsx("input",{id:d,type:"search",className:t.styles[`${n}field__input`],value:o,disabled:i,readOnly:a,"aria-invalid":!!c,"aria-describedby":se,...re({...b,onChange:K,onKeyDown:ee}),ref:Y}),I&&s.jsx("div",{className:t.styles[`${n}field__spinner`],children:s.jsx(qe.Spinner,{size:"xxs"})}),N&&o&&!i&&!a&&s.jsx(ye.CloseButton,{onClick:le,className:`${n}field__clear-button`,size:"sm","aria-label":G}),j&&s.jsx("div",{className:t.styles[`${n}content`],children:j})]}),s.jsxs(_e.HelperTextProvider,{ctxId:g,ctxDisabled:!!i,children:[P,E&&s.jsx(ue.HelperText,{id:$,appearance:"negative",children:c})]}),M&&s.jsx(xe.SearchDropdown,{...h,children:s.jsx(he.ActionList,{role:"listbox",noResults:k,children:w})})]})}),p=je;p.Results=t.SearchResults;p.displayName="Search";exports.Search=p;exports.default=p;
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { jsxs as S, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { g as ne } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
3
|
-
import { t as me } from "../../../chunks/constants.CKKGf1-i.js";
|
|
4
|
-
import C, { useCallback as de } from "react";
|
|
5
|
-
import { s as r, S as fe, a as ue } from "../../../chunks/Search.Results.DVf6WKnI.js";
|
|
6
|
-
import F from "clsx";
|
|
7
|
-
import { H as pe } from "../../../chunks/form.context.D7b4066_.js";
|
|
8
|
-
import { LabelProvider as he } from "../../Form/contexts/label.context.es.js";
|
|
9
|
-
import { HelperTextProvider as be } from "../../Form/contexts/helperText.context.es.js";
|
|
10
|
-
import { useUniversalRef as xe } from "../../Form/hooks/useUniversalRef.hook.es.js";
|
|
11
|
-
import { useAccessibleId as I } from "../../Form/hooks/useAccessibleId.hook.es.js";
|
|
12
|
-
import { Icon as Se } from "../../Icon/Icon.es.js";
|
|
13
|
-
import { useSearchDropdown as Ie } from "./useSearchDropdown.es.js";
|
|
14
|
-
import { SearchDropdown as Pe } from "./SearchDropdown.es.js";
|
|
15
|
-
import { ActionList as De } from "../../ActionList/ActionList.es.js";
|
|
16
|
-
import { useDebounced as Ne } from "../../../utils/hooks/useDebounced.es.js";
|
|
17
|
-
import { useEffectAfterMount as ve } from "../../../utils/hooks/useEffectAfterMount.es.js";
|
|
18
|
-
import { Spinner as $e } from "../../Spinner/Spinner.es.js";
|
|
19
|
-
import { CloseButton as ye } from "../../CloseButton/CloseButton.es.js";
|
|
20
|
-
const { baseClassNamePrefix: ge, subElementClassPrefix: l, classModifierPrefix: f } = ne("search"), Re = C.forwardRef(({
|
|
21
|
-
id: T,
|
|
22
|
-
defaultValue: j = "",
|
|
23
|
-
value: P,
|
|
24
|
-
onChange: s,
|
|
25
|
-
onSearch: q,
|
|
26
|
-
loading: D = !1,
|
|
27
|
-
debounce: z = 200,
|
|
28
|
-
onKeyDown: u,
|
|
29
|
-
label: B,
|
|
30
|
-
contentAfter: N,
|
|
31
|
-
contentBefore: v,
|
|
32
|
-
helperText: $,
|
|
33
|
-
fluid: V,
|
|
34
|
-
width: U,
|
|
35
|
-
theme: y,
|
|
36
|
-
disabled: i,
|
|
37
|
-
hideIcon: W,
|
|
38
|
-
icon: G = fe,
|
|
39
|
-
error: a,
|
|
40
|
-
readOnly: n,
|
|
41
|
-
clearable: g = !0,
|
|
42
|
-
noResults: R,
|
|
43
|
-
clearButtonAriaLabel: J = "Clear search",
|
|
44
|
-
className: Q,
|
|
45
|
-
children: _,
|
|
46
|
-
"aria-describedby": X,
|
|
47
|
-
...p
|
|
48
|
-
}, Y) => {
|
|
49
|
-
const { refFn: Z, ref: K } = xe(Y), [O, E] = C.useState(String(j)), m = P !== void 0, c = m ? String(P) : O, ee = (e) => {
|
|
50
|
-
m || E(e.target.value), s == null || s(e);
|
|
51
|
-
}, { immediate: h, debounced: k } = Ne(q, z), te = (e) => {
|
|
52
|
-
if (u == null || u(e), e.key === "Enter") {
|
|
53
|
-
if (e.isDefaultPrevented() || e.isPropagationStopped())
|
|
54
|
-
return;
|
|
55
|
-
const { activeIndex: o, elementsRef: ce } = b, x = o !== null ? ce.current[o] : null;
|
|
56
|
-
x && x.getAttribute("aria-disabled") !== "true" ? (e.preventDefault(), x.click()) : o === null && h(c);
|
|
57
|
-
}
|
|
58
|
-
e.key === "Escape" && (!g || b.open) && e.preventDefault();
|
|
59
|
-
}, { id: d } = I(), { id: w } = I(), { id: H } = I(), M = !!(a != null && a.length), A = !!_ || !!R, re = F(
|
|
60
|
-
$ && H,
|
|
61
|
-
M && w,
|
|
62
|
-
X
|
|
63
|
-
), {
|
|
64
|
-
dropdownProps: b,
|
|
65
|
-
getFieldProps: se,
|
|
66
|
-
getInputProps: ie
|
|
67
|
-
} = Ie({
|
|
68
|
-
enabled: A,
|
|
69
|
-
disabled: !!i,
|
|
70
|
-
readOnly: !!n
|
|
71
|
-
});
|
|
72
|
-
ve(() => {
|
|
73
|
-
k(c);
|
|
74
|
-
}, [c, k]);
|
|
75
|
-
const ae = F(
|
|
76
|
-
r[ge],
|
|
77
|
-
y && me(y),
|
|
78
|
-
V && r[`${f}fluid`],
|
|
79
|
-
i && r[`${f}disabled`],
|
|
80
|
-
n && r[`${f}read-only`],
|
|
81
|
-
a && r[`${f}error`],
|
|
82
|
-
Q
|
|
83
|
-
), oe = (e) => {
|
|
84
|
-
var o;
|
|
85
|
-
i || e.target instanceof HTMLInputElement || e.target.closest('button,[role="button"],a,[role="link"]') || (e.preventDefault(), e.stopPropagation(), (o = K.current) == null || o.focus());
|
|
86
|
-
}, le = de(() => {
|
|
87
|
-
m ? s == null || s({
|
|
88
|
-
target: {
|
|
89
|
-
value: "",
|
|
90
|
-
name: p.name,
|
|
91
|
-
id: d,
|
|
92
|
-
type: "search"
|
|
93
|
-
}
|
|
94
|
-
}) : E(""), h("");
|
|
95
|
-
}, [d, m, s, h, p.name]);
|
|
96
|
-
return /* @__PURE__ */ S(
|
|
97
|
-
"div",
|
|
98
|
-
{
|
|
99
|
-
id: T,
|
|
100
|
-
className: ae,
|
|
101
|
-
role: "search",
|
|
102
|
-
style: { maxWidth: U },
|
|
103
|
-
"aria-busy": D,
|
|
104
|
-
children: [
|
|
105
|
-
/* @__PURE__ */ t(
|
|
106
|
-
he,
|
|
107
|
-
{
|
|
108
|
-
ctxDisabled: !!i,
|
|
109
|
-
ctxRequired: !1,
|
|
110
|
-
ctxHtmlFor: d,
|
|
111
|
-
children: B
|
|
112
|
-
}
|
|
113
|
-
),
|
|
114
|
-
/* @__PURE__ */ S(
|
|
115
|
-
"div",
|
|
116
|
-
{
|
|
117
|
-
className: r[`${l}field`],
|
|
118
|
-
...se({ onPointerDown: oe }),
|
|
119
|
-
children: [
|
|
120
|
-
!W && /* @__PURE__ */ t(Se, { icon: G, "aria-hidden": !0 }),
|
|
121
|
-
v && /* @__PURE__ */ t("div", { className: r[`${l}content`], children: v }),
|
|
122
|
-
/* @__PURE__ */ t(
|
|
123
|
-
"input",
|
|
124
|
-
{
|
|
125
|
-
id: d,
|
|
126
|
-
type: "search",
|
|
127
|
-
className: r[`${l}field__input`],
|
|
128
|
-
value: c,
|
|
129
|
-
disabled: i,
|
|
130
|
-
readOnly: n,
|
|
131
|
-
"aria-invalid": !!a,
|
|
132
|
-
"aria-describedby": re,
|
|
133
|
-
...ie({
|
|
134
|
-
...p,
|
|
135
|
-
onChange: ee,
|
|
136
|
-
onKeyDown: te
|
|
137
|
-
}),
|
|
138
|
-
ref: Z
|
|
139
|
-
}
|
|
140
|
-
),
|
|
141
|
-
D && /* @__PURE__ */ t("div", { className: r[`${l}field__spinner`], children: /* @__PURE__ */ t($e, { size: "xxs" }) }),
|
|
142
|
-
g && c && !i && !n && /* @__PURE__ */ t(ye, { onClick: le, className: `${l}field__clear-button`, size: "sm", "aria-label": J }),
|
|
143
|
-
N && /* @__PURE__ */ t("div", { className: r[`${l}content`], children: N })
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
/* @__PURE__ */ S(be, { ctxId: H, ctxDisabled: !!i, children: [
|
|
148
|
-
$,
|
|
149
|
-
M && /* @__PURE__ */ t(pe, { id: w, appearance: "negative", children: a })
|
|
150
|
-
] }),
|
|
151
|
-
A && /* @__PURE__ */ t(Pe, { ...b, children: /* @__PURE__ */ t(De, { role: "listbox", noResults: R, children: _ }) })
|
|
152
|
-
]
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
}), L = Re;
|
|
156
|
-
L.Results = ue;
|
|
157
|
-
L.displayName = "Search";
|
|
158
|
-
export {
|
|
159
|
-
L as Search,
|
|
160
|
-
L as default
|
|
161
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),_=require("@floating-ui/react"),d=require("../../Box/Box.cjs.js"),h=require("clsx"),o=require("../../../chunks/classNames.DAeKwerT.js"),q=require("../../../chunks/constants.hwjHOsvT.js"),S=require("../../ActionList/ActionList.context.cjs.js"),N=require("react"),b=require("../../../chunks/floatingui.module.D3Aw_aYe.js"),g=require("../../../chunks/popover.module.DGUJIXrP.js"),s=require("../../../chunks/Search.Results.CFA_KEdP.js"),{baseClassNamePrefix:B}=o.getBEMClassNames("floatingui"),{baseClassNamePrefix:P}=o.getBEMClassNames("popover"),v=[s.SearchResults,s.SearchResults.Item,s.SearchResults.ViewAll],w=({setOpen:t,isMounted:l,getFloatingProps:a,floatingStyles:i,labelsRef:c,elementsRef:n,getItemProps:u,setFloating:m,theme:r,className:x,children:f,activeIndex:p})=>{const C=N.useCallback(()=>t(!1),[t]);return l?e.jsx(_.FloatingPortal,{children:e.jsx(d.Box,{className:h(r&&q.themeClassName(r),b.floatinguiStyles[B],g.popoverStyles[P],x),...a(),style:i,ref:m,children:e.jsx(S.ActionListContextProvider,{allowChildrenTypes:v,getItemProps:u,itemsFocusable:!1,onItemClick:C,labelsRef:c,elementsRef:n,activeIndex:p,children:f})})}):null};exports.SearchDropdown=w;
|