@viasat/beam-react 2.8.0 → 2.10.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/{Search.Results.css → Search.css} +1 -1
- package/assets/panel.css +1 -1
- package/chunks/{ActionList.Group.C2R56u2A.js → ActionList.Group.Bw5vZpeb.js} +1 -1
- package/chunks/{ActionList.Group.B4PX5SKS.js → ActionList.Group.CUHMD8Oo.js} +3 -3
- package/chunks/ActionList.Item.CxvNhTRB.js +188 -0
- package/chunks/ActionList.Item.YxZyttjT.js +1 -0
- package/chunks/{Avatar.C9tpC3sT.js → Avatar.C-4xc2_q.js} +3 -3
- package/chunks/{BreadcrumbsItem.CPJ-ECZa.js → BreadcrumbsItem.fDLMzx4K.js} +3 -3
- package/chunks/{CSSLookup.Cjf6o2Gz.js → CSSLookup.DOOy1rxJ.js} +1 -1
- package/chunks/Search.Results.DBQWuhZu.js +1 -0
- package/chunks/Search.Results.DR20Rl2x.js +66 -0
- package/chunks/{SpinnerWrap.DI2J26ka.js → SpinnerWrap.DWZk-Vfo.js} +4 -4
- package/chunks/{ToastContext.DzKCvrgk.js → ToastContext.CYGy7l7R.js} +1 -1
- package/chunks/{classNames.DNsS4J__.js → classNames.BTJmrO_L.js} +2 -2
- package/chunks/{constants.BBi77pmH.js → constants.CKKGf1-i.js} +5 -5
- package/chunks/{form.context.CfsTSQpm.js → form.context.BhylRiG2.js} +2 -2
- package/chunks/{helpers.Wv7n4ip7.js → helpers.CPNYYxrE.js} +1 -1
- package/chunks/{panel.module.RGiUyC84.js → panel.module.BVm3KvDs.js} +14 -4
- package/chunks/panel.module.BX1x4FlX.js +1 -0
- package/index.es.js +3 -3
- package/lib/Accordion/Accordion.es.js +1 -1
- package/lib/Accordion/AccordionGroup.es.js +1 -1
- package/lib/ActionList/ActionList.Group.cjs.js +1 -1
- package/lib/ActionList/ActionList.Group.es.js +4 -4
- package/lib/ActionList/ActionList.IconButton.cjs.js +1 -1
- package/lib/ActionList/ActionList.IconButton.es.js +3 -3
- package/lib/ActionList/ActionList.Item.cjs.js +1 -1
- package/lib/ActionList/ActionList.Item.d.ts +18 -7
- package/lib/ActionList/ActionList.Item.es.js +4 -4
- package/lib/ActionList/ActionList.cjs.js +1 -1
- package/lib/ActionList/ActionList.d.ts +1 -1
- package/lib/ActionList/ActionList.es.js +5 -5
- package/lib/ActionList/useActionListChildren.cjs.js +1 -1
- package/lib/ActionList/useActionListChildren.es.js +2 -2
- package/lib/Alert/Alert.es.js +4 -4
- package/lib/Autocomplete/Autocomplete.cjs.js +1 -1
- package/lib/Autocomplete/Autocomplete.es.js +6 -6
- package/lib/Autocomplete/AutocompleteDropdown.es.js +3 -3
- package/lib/Autocomplete/AutocompleteField.es.js +2 -2
- package/lib/Autocomplete/useAutocompleteA11y.es.js +1 -1
- package/lib/Autocomplete/useAutocompleteDropdown.es.js +1 -1
- package/lib/Avatar/Avatar.es.js +1 -1
- package/lib/Avatar/AvatarGroup.es.js +3 -3
- package/lib/Avatar/index.es.js +1 -1
- package/lib/Badge/Badge.es.js +2 -2
- package/lib/BadgeDot/BadgeDot.es.js +2 -2
- package/lib/Box/Box.es.js +4 -4
- package/lib/Breadcrumbs/Breadcrumbs.es.js +3 -3
- package/lib/Breadcrumbs/BreadcrumbsItem.es.js +2 -2
- package/lib/Breadcrumbs/index.es.js +1 -1
- package/lib/Button/Button.es.js +3 -3
- package/lib/Card/AspectRatio.es.js +2 -2
- package/lib/Card/Card.Body.es.js +2 -2
- package/lib/Card/Card.Content.es.js +2 -2
- package/lib/Card/Card.Footer.es.js +2 -2
- package/lib/Card/Card.Header.es.js +2 -2
- package/lib/Card/Card.Media.es.js +2 -2
- package/lib/Card/Card.es.js +3 -3
- package/lib/Card/CardGroup.es.js +3 -3
- package/lib/Checkbox/Checkbox.es.js +3 -3
- package/lib/Chips/Chip.es.js +2 -2
- package/lib/Chips/ChipGroup.es.js +2 -2
- package/lib/CloseButton/CloseButton.es.js +2 -2
- package/lib/Dialog/Dialog.Body.es.js +2 -2
- package/lib/Dialog/Dialog.Content.es.js +2 -2
- package/lib/Dialog/Dialog.Footer.es.js +1 -1
- package/lib/Dialog/Dialog.Header.es.js +2 -2
- package/lib/Divider/Divider.es.js +2 -2
- package/lib/EmptyState/EmptyState.es.js +3 -3
- package/lib/FileUpload/FileUpload.Button.es.js +2 -2
- package/lib/FileUpload/FileUpload.Dropzone.es.js +2 -2
- package/lib/FileUpload/FileUpload.List.Item.es.js +3 -3
- package/lib/FileUpload/FileUpload.List.es.js +2 -2
- package/lib/FileUpload/FileUpload.es.js +3 -3
- package/lib/FileUpload/useFileManagement.es.js +1 -1
- package/lib/Flag/Flag.es.js +2 -2
- package/lib/FloatingUI/FloatingUI.arrow.es.js +2 -2
- package/lib/FloatingUI/FloatingUI.content.es.js +2 -2
- package/lib/FloatingUI/index.cjs.js +1 -1
- package/lib/FloatingUI/index.es.js +6 -6
- package/lib/Form/Form.es.js +2 -2
- package/lib/Form/contexts/form.context.es.js +2 -2
- package/lib/Form/contexts/index.es.js +1 -1
- package/lib/Form/hooks/index.es.js +1 -1
- package/lib/Form/hooks/useAccessibleId.hook.es.js +1 -1
- package/lib/Form/hooks/useFieldValidator.hook.es.js +1 -1
- package/lib/Header/Header.es.js +2 -2
- package/lib/Header/HeaderActionGroup.es.js +2 -2
- package/lib/Header/HeaderMasthead.es.js +2 -2
- package/lib/Header/HeaderSideNavTrigger.es.js +2 -2
- package/lib/HelperText/HelperText.es.js +3 -3
- package/lib/HelperText/index.es.js +1 -1
- package/lib/Icon/Icon.es.js +2 -2
- package/lib/InputChoiceGroup/InputChoiceGroup.es.js +3 -3
- package/lib/Label/Label.es.js +3 -3
- package/lib/Link/Link.es.js +2 -2
- package/lib/List/List.Item.es.js +2 -2
- package/lib/List/List.es.js +2 -2
- package/lib/Logo/Logo.es.js +2 -2
- package/lib/Menu/Menu.PopoverContent.es.js +2 -2
- package/lib/NativeSelect/NativeSelect.es.js +4 -4
- package/lib/PageHeader/PageHeader.es.js +2 -2
- package/lib/PageLayout/PageLayout.es.js +2 -2
- package/lib/PageLayout/PageLayoutAside.es.js +2 -2
- package/lib/PageLayout/PageLayoutHeader.es.js +2 -2
- package/lib/PageLayout/PageLayoutMain.es.js +2 -2
- package/lib/Pagination/PageButton.es.js +2 -2
- package/lib/Pagination/Pagination.es.js +2 -2
- package/lib/Pagination/PaginationControls.es.js +1 -1
- package/lib/Pagination/Truncation.es.js +2 -2
- package/lib/Popover/Popover.content.es.js +2 -2
- package/lib/Popover/Popover.es.js +3 -3
- package/lib/Popover/Popover.utils.es.js +2 -2
- package/lib/ProgressBar/ProgressBar.es.js +3 -3
- package/lib/RadioButton/RadioButton.es.js +3 -3
- package/lib/SegmentedControl/SegmentedControl.Item.es.js +2 -2
- package/lib/SegmentedControl/SegmentedControl.List.es.js +2 -2
- package/lib/SegmentedControl/SegmentedControl.Panel.es.js +2 -2
- package/lib/SegmentedControl/SegmentedControl.es.js +2 -2
- package/lib/Select/Select.cjs.js +1 -1
- package/lib/Select/Select.es.js +5 -5
- package/lib/Select/SelectDropdown.es.js +3 -3
- package/lib/Select/SelectField.es.js +2 -2
- package/lib/Select/useSelectA11y.es.js +1 -1
- package/lib/SideNav/SideNav.es.js +2 -2
- package/lib/SideNav/SideNavActionListGroup.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListGroup.es.js +3 -3
- package/lib/SideNav/SideNavActionListGroupHeading.es.js +2 -2
- package/lib/SideNav/SideNavActionListItem.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItem.es.js +3 -3
- package/lib/SideNav/SideNavActionListItemExpandable.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItemExpandable.es.js +3 -3
- package/lib/SideNav/SideNavActionListItemFlyout.cjs.js +1 -1
- package/lib/SideNav/SideNavActionListItemFlyout.es.js +1 -1
- package/lib/SideNav/SideNavBody.es.js +3 -3
- package/lib/SideNav/SideNavContext.es.js +2 -2
- package/lib/SideNav/SideNavFooter.es.js +2 -2
- package/lib/SideNav/SideNavHeader.es.js +2 -2
- package/lib/Slider/DualSlider.es.js +3 -3
- package/lib/Slider/SingleSlider.es.js +6 -6
- package/lib/Slider/Slider.Error.es.js +3 -3
- package/lib/Slider/Slider.TextField.es.js +2 -2
- package/lib/Slider/Slider.Thumb.es.js +4 -4
- package/lib/Slider/Slider.TickMarks.es.js +2 -2
- package/lib/Slider/Slider.ValueAxisLabels.es.js +2 -2
- package/lib/Slider/hooks/useSliderBase.es.js +2 -2
- package/lib/Spinner/Spinner.es.js +7 -7
- package/lib/Spinner/SpinnerWrap.es.js +1 -1
- package/lib/StateLayer/StateLayer.es.js +2 -2
- package/lib/Stepper/Stepper.Body.es.js +2 -2
- package/lib/Stepper/Stepper.Heading.es.js +2 -2
- package/lib/Stepper/Stepper.Marker.es.js +2 -2
- package/lib/Stepper/Stepper.Step.es.js +2 -2
- package/lib/Stepper/Stepper.es.js +2 -2
- package/lib/Switch/Switch.es.js +3 -3
- package/lib/Tabs/Tabs.Group.es.js +3 -3
- package/lib/Tabs/Tabs.Item.es.js +2 -2
- package/lib/Tabs/Tabs.Panel.es.js +2 -2
- package/lib/Tabs/Tabs.es.js +2 -2
- package/lib/Text/Text.es.js +2 -2
- package/lib/TextArea/TextArea.es.js +3 -3
- package/lib/TextField/TextField.es.js +3 -3
- package/lib/Toasts/Toast.es.js +4 -4
- package/lib/Toasts/ToastContainer.es.js +4 -4
- package/lib/Toasts/ToastContext.es.js +1 -1
- package/lib/Toasts/index.es.js +1 -1
- package/lib/Tooltip/Tooltip.es.js +3 -3
- package/lib/_Navigation/classes.es.js +2 -2
- package/lib/_Options/OptionChips.es.js +2 -2
- package/lib/_Options/useSelectValue.es.js +2 -2
- package/lib/index.es.js +3 -3
- package/lib/wip/Panel/Panel.Body.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Body.es.js +3 -3
- package/lib/wip/Panel/Panel.Footer.Actions.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Footer.Actions.es.js +3 -3
- package/lib/wip/Panel/Panel.Footer.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Footer.d.ts +2 -2
- package/lib/wip/Panel/Panel.Footer.es.js +13 -13
- package/lib/wip/Panel/Panel.Header.ContentAfter.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.ContentAfter.es.js +3 -3
- package/lib/wip/Panel/Panel.Header.ContentBefore.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.ContentBefore.es.js +3 -3
- package/lib/wip/Panel/Panel.Header.Description.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Description.es.js +3 -3
- package/lib/wip/Panel/Panel.Header.Heading.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Heading.es.js +3 -3
- package/lib/wip/Panel/Panel.Header.Row.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Row.es.js +3 -3
- package/lib/wip/Panel/Panel.Header.Subheader.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.Subheader.es.js +3 -3
- package/lib/wip/Panel/Panel.Header.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Header.d.ts +2 -2
- package/lib/wip/Panel/Panel.Header.es.js +21 -21
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.context.d.ts +5 -0
- package/lib/wip/Panel/Panel.d.ts +3 -3
- package/lib/wip/Panel/Panel.es.js +113 -39
- package/lib/wip/Panel/Panel.helpers.cjs.js +1 -0
- package/lib/wip/Panel/Panel.helpers.d.ts +13 -0
- package/lib/wip/Panel/Panel.helpers.es.js +40 -0
- package/lib/wip/Panel/Panel.types.d.ts +16 -11
- package/lib/wip/Search/Search.Results.Item.cjs.js +1 -1
- package/lib/wip/Search/Search.Results.Item.d.ts +8 -5
- package/lib/wip/Search/Search.Results.Item.es.js +8 -10
- package/lib/wip/Search/Search.Results.ViewAll.cjs.js +1 -0
- package/lib/wip/Search/Search.Results.ViewAll.d.ts +22 -0
- package/lib/wip/Search/Search.Results.ViewAll.es.js +11 -0
- package/lib/wip/Search/Search.Results.cjs.js +1 -1
- package/lib/wip/Search/Search.Results.d.ts +5 -2
- package/lib/wip/Search/Search.Results.es.js +12 -17
- package/lib/wip/Search/Search.cjs.js +1 -1
- package/lib/wip/Search/Search.es.js +114 -110
- package/lib/wip/Search/SearchDropdown.cjs.js +1 -1
- package/lib/wip/Search/SearchDropdown.d.ts +2 -3
- package/lib/wip/Search/SearchDropdown.es.js +45 -59
- package/lib/wip/Search/useSearchDropdown.cjs.js +1 -1
- package/lib/wip/Search/useSearchDropdown.d.ts +0 -18
- package/lib/wip/Search/useSearchDropdown.es.js +25 -25
- package/package.json +6 -6
- package/utils/hooks/index.es.js +3 -3
- package/utils/hooks/useElementResize.es.js +2 -2
- package/utils/hooks/useId.es.js +1 -1
- package/utils/hooks/useLocalStorage.es.js +2 -2
- package/utils/spacing.es.js +1 -1
- package/utils/theming/useBeamTheme.es.js +5 -5
- package/chunks/ActionList.Item.5Y-SwzjK.js +0 -1
- package/chunks/ActionList.Item.BFcT86lS.js +0 -187
- package/chunks/Search.Results.Item.CLmMBPz1.js +0 -41
- package/chunks/Search.Results.Item.Dkh2yo4p.js +0 -1
- package/chunks/panel.module.DbEoAg1J.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("clsx"),o=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const _=require("../../Divider/Divider.cjs.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),l=require("clsx"),o=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const _=require("../../Divider/Divider.cjs.js"),d=require("./Panel.Header.Row.cjs.js"),c=require("./Panel.Header.ContentBefore.cjs.js"),u=require("./Panel.Header.Heading.cjs.js"),b=require("./Panel.Header.ContentAfter.cjs.js"),P=require("./Panel.Header.Description.cjs.js"),p=require("./Panel.Header.Subheader.cjs.js"),q=require("../../../chunks/panel.module.BX1x4FlX.js"),{subElementClassPrefix:H}=o.getBEMClassNames("panel"),m=`${H}header`,e=({children:n,className:a,divider:i=!0,...t})=>{const s=l(q.styles[m],a);return r.jsxs(r.Fragment,{children:[r.jsx("header",{className:s,...t,children:n}),i&&r.jsx(_.Divider,{borderColor:"01"})]})};e.displayName="Panel.Header";e.Row=d.Row;e.ContentBefore=c.ContentBefore;e.Heading=u.Heading;e.Description=P.Description;e.ContentAfter=b.ContentAfter;e.Subheader=p.Subheader;exports.Header=e;
|
|
@@ -5,13 +5,13 @@ export interface PanelHeaderProps extends ComponentPropsWithoutRef<'header'> {
|
|
|
5
5
|
*/
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
/**
|
|
8
|
-
* Whether to show a divider
|
|
8
|
+
* Whether to show a divider after the header
|
|
9
9
|
* @default true
|
|
10
10
|
*/
|
|
11
11
|
divider?: boolean;
|
|
12
12
|
}
|
|
13
13
|
export declare const Header: {
|
|
14
|
-
({ children,
|
|
14
|
+
({ children, className: _className, divider, ...props }: PanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
displayName: string;
|
|
16
16
|
Row: {
|
|
17
17
|
({ children, className: _className, ...props }: import('./Panel.Header.Row').PanelHeaderRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { jsxs as i, Fragment as n, jsx as
|
|
1
|
+
import { jsxs as i, Fragment as n, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import p from "clsx";
|
|
3
|
-
import { g as f } from "../../../chunks/classNames.
|
|
4
|
-
import "../../../chunks/constants.
|
|
3
|
+
import { g as f } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
|
+
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
5
|
import { Divider as l } from "../../Divider/Divider.es.js";
|
|
6
6
|
import { Row as d } from "./Panel.Header.Row.es.js";
|
|
7
7
|
import { ContentBefore as c } from "./Panel.Header.ContentBefore.es.js";
|
|
8
8
|
import { Heading as C } from "./Panel.Header.Heading.es.js";
|
|
9
|
-
import { ContentAfter as
|
|
10
|
-
import { Description as
|
|
11
|
-
import { Subheader as
|
|
12
|
-
import { s as
|
|
13
|
-
const { subElementClassPrefix:
|
|
9
|
+
import { ContentAfter as b } from "./Panel.Header.ContentAfter.es.js";
|
|
10
|
+
import { Description as g } from "./Panel.Header.Description.es.js";
|
|
11
|
+
import { Subheader as h } from "./Panel.Header.Subheader.es.js";
|
|
12
|
+
import { s as u } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
13
|
+
const { subElementClassPrefix: x } = f("panel"), H = `${x}header`, r = ({
|
|
14
14
|
children: o,
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
className: t,
|
|
16
|
+
divider: m = !0,
|
|
17
17
|
...s
|
|
18
18
|
}) => {
|
|
19
|
-
const a = p(
|
|
19
|
+
const a = p(u[H], t);
|
|
20
20
|
return /* @__PURE__ */ i(n, { children: [
|
|
21
|
-
/* @__PURE__ */
|
|
22
|
-
|
|
21
|
+
/* @__PURE__ */ e("header", { className: a, ...s, children: o }),
|
|
22
|
+
m && /* @__PURE__ */ e(l, { borderColor: "01" })
|
|
23
23
|
] });
|
|
24
24
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
r.displayName = "Panel.Header";
|
|
26
|
+
r.Row = d;
|
|
27
|
+
r.ContentBefore = c;
|
|
28
|
+
r.Heading = C;
|
|
29
|
+
r.Description = g;
|
|
30
|
+
r.ContentAfter = b;
|
|
31
|
+
r.Subheader = h;
|
|
32
32
|
export {
|
|
33
|
-
|
|
33
|
+
r as Header
|
|
34
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("clsx"),S=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const $=require("./Panel.context.cjs.js"),R=require("./Panel.Header.cjs.js"),U=require("./Panel.Body.cjs.js"),B=require("./Panel.Footer.cjs.js"),r=require("./Panel.helpers.cjs.js"),T=require("../../FloatingUI/FloatingUI.root.cjs.js"),A=require("../../FloatingUI/FloatingUI.content.cjs.js"),H=require("../../Divider/Divider.cjs.js"),s=require("../../../chunks/panel.module.BX1x4FlX.js"),{baseClassNamePrefix:t}=S.getBEMClassNames("panel"),a=({position:l,className:d})=>e.jsx(H.Divider,{borderColor:"01",orientation:l==="bottom"?"horizontal":"vertical",className:d}),n=({children:l,className:d,padding:q="md",onOpenChange:v,open:p,size:c,dismissible:g=!0,closeButtonAriaLabel:I="Close panel",kind:o="inline",position:P,divider:f=!0,isAnimated:y=!0,...x})=>{const i=r.getResolvedPanelPosition(P),m=u(s.styles[t],s.styles[`${t}--${o}`],c&&s.styles[`${t}--size-${c}`],s.styles[`${t}--padding-${q}`],s.styles[`${t}--position-${i}`],d),w=u(s.styles[`${t}__inline-wrapper`],c==="full"&&s.styles[`${t}__inline-wrapper--full`]),b={dismissible:g,closeButtonAriaLabel:I,onOpenChange:v,position:P},{inlineStatus:C,isInlineVisible:N}=r.useInlineTransition(o==="inline"?p:void 0,y),{showDivider:j,dividerBefore:D,dividerAfter:F}=r.getPanelDividerState(f,i),h=o==="overlay"?u(s.styles[`${t}__overlay-divider`],s.styles[`${t}__overlay-divider--${i}`]):void 0,_=j&&N;return o==="inline"?N?e.jsxs($.PanelContext.Provider,{value:b,children:[D&&_&&e.jsx(a,{position:i}),e.jsx("div",{className:w,"data-position":i,"data-status":C,children:e.jsxs("div",{className:s.styles[`${t}__inline-wrapper-content`],children:[i==="bottom"&&_&&e.jsx(a,{position:i}),e.jsx("aside",{className:m,...x,children:l})]})}),F&&_&&e.jsx(a,{position:i})]}):null:e.jsx($.PanelContext.Provider,{value:b,children:e.jsx(T.FloatingUIRoot,{open:p,onOpenChange:v,portalled:!0,transitionConfig:{duration:y?r.PANEL_TRANSITION_DURATION_MS:0},children:e.jsxs(A.Content,{className:m,skipFloatingStyles:!0,overlay:!0,...x,"data-position":i,children:[l,j&&e.jsx(a,{position:i,className:h})]})})})};n.displayName="Panel";n.Header=R.Header;n.Body=U.Body;n.Footer=B.Footer;exports.Panel=n;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PanelPosition } from './Panel.types';
|
|
1
2
|
export interface PanelContextValue {
|
|
2
3
|
/**
|
|
3
4
|
* Whether to show a dismissible button
|
|
@@ -11,6 +12,10 @@ export interface PanelContextValue {
|
|
|
11
12
|
* Callback when panel open state changes
|
|
12
13
|
*/
|
|
13
14
|
onOpenChange?: (open: boolean) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Panel position (determines divider placement)
|
|
17
|
+
*/
|
|
18
|
+
position?: PanelPosition;
|
|
14
19
|
}
|
|
15
20
|
export declare const PanelContext: import('react').Context<PanelContextValue | undefined>;
|
|
16
21
|
export declare const usePanelContext: () => PanelContextValue;
|
package/lib/wip/Panel/Panel.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { PanelProps } from './Panel.types';
|
|
2
2
|
export declare const Panel: {
|
|
3
|
-
({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, ...props }: PanelProps):
|
|
3
|
+
({ children, className: _className, padding, onOpenChange, open, size, dismissible, closeButtonAriaLabel, kind, position, divider, isAnimated, ...props }: PanelProps): JSX.Element | null;
|
|
4
4
|
displayName: string;
|
|
5
5
|
Header: {
|
|
6
|
-
({ children,
|
|
6
|
+
({ children, className: _className, divider, ...props }: import('./Panel.Header').PanelHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
displayName: string;
|
|
8
8
|
Row: {
|
|
9
9
|
({ children, className: _className, ...props }: import('./Panel.Header.Row').PanelHeaderRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -35,7 +35,7 @@ export declare const Panel: {
|
|
|
35
35
|
displayName: string;
|
|
36
36
|
};
|
|
37
37
|
Footer: {
|
|
38
|
-
({ children,
|
|
38
|
+
({ children, className: _className, divider, ...props }: import('./Panel.Footer').PanelFooterProps): import("react/jsx-runtime").JSX.Element;
|
|
39
39
|
displayName: string;
|
|
40
40
|
Actions: {
|
|
41
41
|
({ layout, children, className: _className, ...props }: import('./Panel.Footer.Actions').PanelFooterActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,43 +1,117 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { g as
|
|
4
|
-
import "../../../chunks/constants.
|
|
5
|
-
import { PanelContext as
|
|
6
|
-
import { Header as
|
|
7
|
-
import { Body as
|
|
8
|
-
import { Footer as
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import { jsxs as p, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import v from "clsx";
|
|
3
|
+
import { g as F } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
|
+
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
+
import { PanelContext as I } from "./Panel.context.es.js";
|
|
6
|
+
import { Header as T } from "./Panel.Header.es.js";
|
|
7
|
+
import { Body as A } from "./Panel.Body.es.js";
|
|
8
|
+
import { Footer as j } from "./Panel.Footer.es.js";
|
|
9
|
+
import { useInlineTransition as E, getPanelDividerState as H, PANEL_TRANSITION_DURATION_MS as M, getResolvedPanelPosition as U } from "./Panel.helpers.es.js";
|
|
10
|
+
import { FloatingUIRoot as V } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
11
|
+
import { Content as L } from "../../FloatingUI/FloatingUI.content.es.js";
|
|
12
|
+
import { Divider as O } from "../../Divider/Divider.es.js";
|
|
13
|
+
import { s as i } from "../../../chunks/panel.module.BVm3KvDs.js";
|
|
14
|
+
const { baseClassNamePrefix: o } = F("panel"), l = ({
|
|
15
|
+
position: t,
|
|
16
|
+
className: a
|
|
17
|
+
}) => /* @__PURE__ */ r(
|
|
18
|
+
O,
|
|
19
|
+
{
|
|
20
|
+
borderColor: "01",
|
|
21
|
+
orientation: t === "bottom" ? "horizontal" : "vertical",
|
|
22
|
+
className: a
|
|
23
|
+
}
|
|
24
|
+
), s = ({
|
|
25
|
+
children: t,
|
|
26
|
+
className: a,
|
|
27
|
+
padding: g = "md",
|
|
28
|
+
onOpenChange: c,
|
|
29
|
+
open: f,
|
|
30
|
+
size: d,
|
|
31
|
+
dismissible: h = !0,
|
|
32
|
+
closeButtonAriaLabel: x = "Close panel",
|
|
33
|
+
kind: n = "inline",
|
|
34
|
+
position: u,
|
|
35
|
+
divider: D = !0,
|
|
36
|
+
isAnimated: N = !0,
|
|
37
|
+
...$
|
|
22
38
|
}) => {
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
const e = U(u), _ = v(
|
|
40
|
+
i[o],
|
|
41
|
+
i[`${o}--${n}`],
|
|
42
|
+
d && i[`${o}--size-${d}`],
|
|
43
|
+
i[`${o}--padding-${g}`],
|
|
44
|
+
i[`${o}--position-${e}`],
|
|
45
|
+
a
|
|
46
|
+
), b = v(
|
|
47
|
+
i[`${o}__inline-wrapper`],
|
|
48
|
+
d === "full" && i[`${o}__inline-wrapper--full`]
|
|
49
|
+
), P = {
|
|
50
|
+
dismissible: h,
|
|
51
|
+
closeButtonAriaLabel: x,
|
|
52
|
+
onOpenChange: c,
|
|
53
|
+
position: u
|
|
54
|
+
}, { inlineStatus: R, isInlineVisible: y } = E(
|
|
55
|
+
n === "inline" ? f : void 0,
|
|
56
|
+
N
|
|
57
|
+
), { showDivider: C, dividerBefore: S, dividerAfter: w } = H(
|
|
58
|
+
D,
|
|
59
|
+
e
|
|
60
|
+
), B = n === "overlay" ? v(
|
|
61
|
+
i[`${o}__overlay-divider`],
|
|
62
|
+
i[`${o}__overlay-divider--${e}`]
|
|
63
|
+
) : void 0, m = C && y;
|
|
64
|
+
return n === "inline" ? y ? /* @__PURE__ */ p(I.Provider, { value: P, children: [
|
|
65
|
+
S && m && /* @__PURE__ */ r(l, { position: e }),
|
|
66
|
+
/* @__PURE__ */ r(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: b,
|
|
70
|
+
"data-position": e,
|
|
71
|
+
"data-status": R,
|
|
72
|
+
children: /* @__PURE__ */ p("div", { className: i[`${o}__inline-wrapper-content`], children: [
|
|
73
|
+
e === "bottom" && m && /* @__PURE__ */ r(l, { position: e }),
|
|
74
|
+
/* @__PURE__ */ r("aside", { className: _, ...$, children: t })
|
|
75
|
+
] })
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
w && m && /* @__PURE__ */ r(l, { position: e })
|
|
79
|
+
] }) : null : /* @__PURE__ */ r(I.Provider, { value: P, children: /* @__PURE__ */ r(
|
|
80
|
+
V,
|
|
81
|
+
{
|
|
82
|
+
open: f,
|
|
83
|
+
onOpenChange: c,
|
|
84
|
+
portalled: !0,
|
|
85
|
+
transitionConfig: {
|
|
86
|
+
duration: N ? M : 0
|
|
87
|
+
},
|
|
88
|
+
children: /* @__PURE__ */ p(
|
|
89
|
+
L,
|
|
90
|
+
{
|
|
91
|
+
className: _,
|
|
92
|
+
skipFloatingStyles: !0,
|
|
93
|
+
overlay: !0,
|
|
94
|
+
...$,
|
|
95
|
+
"data-position": e,
|
|
96
|
+
children: [
|
|
97
|
+
t,
|
|
98
|
+
C && /* @__PURE__ */ r(
|
|
99
|
+
l,
|
|
100
|
+
{
|
|
101
|
+
position: e,
|
|
102
|
+
className: B
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
)
|
|
108
|
+
}
|
|
109
|
+
) });
|
|
36
110
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
111
|
+
s.displayName = "Panel";
|
|
112
|
+
s.Header = T;
|
|
113
|
+
s.Body = A;
|
|
114
|
+
s.Footer = j;
|
|
41
115
|
export {
|
|
42
|
-
|
|
116
|
+
s as Panel
|
|
43
117
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react"),o=400,c=e=>e||"end",d=(e,t)=>{const n=e&&t!=="full";return{showDivider:n,dividerBefore:n&&t!=="start"&&t!=="bottom",dividerAfter:n&&t==="start"}},I=(e,t)=>{const[n,i]=a.useState(void 0),[l,s]=a.useState(e!==!1);return a.useEffect(()=>{if(!t){s(e!==!1),i(void 0);return}if(e!==void 0)if(e){s(!0),i("close");let r;const u=requestAnimationFrame(()=>{r=requestAnimationFrame(()=>i("open"))});return()=>{cancelAnimationFrame(u),cancelAnimationFrame(r)}}else{i("close");const r=setTimeout(()=>{s(!1),i(void 0)},o);return()=>clearTimeout(r)}},[t,e]),{inlineStatus:n,isInlineVisible:l}};exports.PANEL_TRANSITION_DURATION_MS=o;exports.getPanelDividerState=d;exports.getResolvedPanelPosition=c;exports.useInlineTransition=I;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PanelPosition } from './Panel.types';
|
|
2
|
+
export declare const PANEL_TRANSITION_DURATION_MS = 400;
|
|
3
|
+
export type PanelInlineStatus = 'open' | 'close' | undefined;
|
|
4
|
+
export declare const getResolvedPanelPosition: (position?: PanelPosition) => PanelPosition;
|
|
5
|
+
export declare const getPanelDividerState: (divider: boolean, position?: PanelPosition) => {
|
|
6
|
+
showDivider: boolean;
|
|
7
|
+
dividerBefore: boolean;
|
|
8
|
+
dividerAfter: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare const useInlineTransition: (open: boolean | undefined, isAnimated: boolean) => {
|
|
11
|
+
inlineStatus: PanelInlineStatus;
|
|
12
|
+
isInlineVisible: boolean;
|
|
13
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useState as o, useEffect as u } from "react";
|
|
2
|
+
const c = 400, m = (e) => e || "end", f = (e, t) => {
|
|
3
|
+
const n = e && t !== "full";
|
|
4
|
+
return {
|
|
5
|
+
showDivider: n,
|
|
6
|
+
dividerBefore: n && t !== "start" && t !== "bottom",
|
|
7
|
+
dividerAfter: n && t === "start"
|
|
8
|
+
};
|
|
9
|
+
}, I = (e, t) => {
|
|
10
|
+
const [n, i] = o(void 0), [a, s] = o(e !== !1);
|
|
11
|
+
return u(() => {
|
|
12
|
+
if (!t) {
|
|
13
|
+
s(e !== !1), i(void 0);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
if (e !== void 0)
|
|
17
|
+
if (e) {
|
|
18
|
+
s(!0), i("close");
|
|
19
|
+
let r;
|
|
20
|
+
const l = requestAnimationFrame(() => {
|
|
21
|
+
r = requestAnimationFrame(() => i("open"));
|
|
22
|
+
});
|
|
23
|
+
return () => {
|
|
24
|
+
cancelAnimationFrame(l), cancelAnimationFrame(r);
|
|
25
|
+
};
|
|
26
|
+
} else {
|
|
27
|
+
i("close");
|
|
28
|
+
const r = setTimeout(() => {
|
|
29
|
+
s(!1), i(void 0);
|
|
30
|
+
}, c);
|
|
31
|
+
return () => clearTimeout(r);
|
|
32
|
+
}
|
|
33
|
+
}, [t, e]), { inlineStatus: n, isInlineVisible: a };
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
c as PANEL_TRANSITION_DURATION_MS,
|
|
37
|
+
f as getPanelDividerState,
|
|
38
|
+
m as getResolvedPanelPosition,
|
|
39
|
+
I as useInlineTransition
|
|
40
|
+
};
|
|
@@ -38,29 +38,34 @@ interface BasePanelProps extends ComponentPropsWithoutRef<'aside'> {
|
|
|
38
38
|
* @default 'Close panel'
|
|
39
39
|
*/
|
|
40
40
|
closeButtonAriaLabel?: string;
|
|
41
|
+
/**
|
|
42
|
+
* Whether to animate the panel on open/close
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
isAnimated?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to show an external divider between panel and page content
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
divider?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Specify the position of the Panel
|
|
53
|
+
* 'start' | 'end' | 'bottom' | 'full'
|
|
54
|
+
* @default 'end'
|
|
55
|
+
*/
|
|
56
|
+
position?: PanelPosition;
|
|
41
57
|
}
|
|
42
58
|
export interface InlinePanelProps extends BasePanelProps {
|
|
43
59
|
/**
|
|
44
60
|
* Specify the Panel as inline
|
|
45
61
|
*/
|
|
46
62
|
kind?: 'inline';
|
|
47
|
-
/**
|
|
48
|
-
* Specify the position of the Panel
|
|
49
|
-
* For inline: 'bottom'
|
|
50
|
-
*/
|
|
51
|
-
position?: 'bottom';
|
|
52
63
|
}
|
|
53
64
|
export interface OverlayPanelProps extends BasePanelProps {
|
|
54
65
|
/**
|
|
55
66
|
* Specify the Panel as overlay
|
|
56
67
|
*/
|
|
57
68
|
kind: 'overlay';
|
|
58
|
-
/**
|
|
59
|
-
* Specify the position of the Panel
|
|
60
|
-
* For overlay: 'start' | 'end' | 'bottom' | 'full'
|
|
61
|
-
* @default 'end'
|
|
62
|
-
*/
|
|
63
|
-
position?: PanelPosition;
|
|
64
69
|
/**
|
|
65
70
|
* Specify the modal type (overlay only)
|
|
66
71
|
* @default 'nonModal'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.
|
|
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,8 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ActionListItemProps } from '../../ActionList/ActionList.Item';
|
|
3
|
-
export
|
|
4
|
-
|
|
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;
|
|
5
10
|
}
|
|
6
|
-
export
|
|
7
|
-
export declare const SearchResultsItem: typeof SearchResultsItemComponent;
|
|
8
|
-
export default SearchResultsItem;
|
|
11
|
+
export {};
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
|
-
import "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
8
|
export {
|
|
9
|
-
|
|
10
|
-
S as SearchResultsItemComponent,
|
|
11
|
-
l as default
|
|
9
|
+
a as SearchResultsItem
|
|
12
10
|
};
|
|
@@ -0,0 +1 @@
|
|
|
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.DBQWuhZu.js");require("../../ActionList/ActionList.cjs.js");require("../../Icon/Icon.cjs.js");exports.SearchResultsViewAll=e.SearchResultsViewAll;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export type SearchResultsViewAllProps<C extends React.ElementType = 'div'> = {
|
|
3
|
+
/**
|
|
4
|
+
* Specify a different component to render the item, such as an anchor tag for links
|
|
5
|
+
*
|
|
6
|
+
* @default div
|
|
7
|
+
*/
|
|
8
|
+
as?: C;
|
|
9
|
+
/**
|
|
10
|
+
* Specify the variant of the View All item. By default, it is inferred from context:
|
|
11
|
+
* 'group' when inside a Search.Results, 'global' when directly inside Search.
|
|
12
|
+
*/
|
|
13
|
+
variant?: 'group' | 'global';
|
|
14
|
+
} & React.ComponentPropsWithoutRef<C>;
|
|
15
|
+
export declare const SearchResultsViewAll: SearchResultsViewAllComponent;
|
|
16
|
+
interface SearchResultsViewAllComponent {
|
|
17
|
+
<C extends React.ElementType = 'div'>(props: SearchResultsViewAllProps<C> & {
|
|
18
|
+
ref?: React.ComponentPropsWithRef<C>['ref'];
|
|
19
|
+
}): React.ReactElement | null;
|
|
20
|
+
displayName?: string;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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.DR20Rl2x.js";
|
|
7
|
+
import "../../ActionList/ActionList.es.js";
|
|
8
|
+
import "../../Icon/Icon.es.js";
|
|
9
|
+
export {
|
|
10
|
+
a as SearchResultsViewAll
|
|
11
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});
|
|
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.DBQWuhZu.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,12 +1,15 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { SearchResultsItem } from './Search.Results.Item';
|
|
3
|
+
import { SearchResultsViewAll } from './Search.Results.ViewAll';
|
|
3
4
|
import { ActionListGroupProps } from '../../ActionList/ActionList.Group';
|
|
5
|
+
export declare const SearchResultsContext: React.Context<boolean>;
|
|
4
6
|
export interface SearchResultsProps extends ActionListGroupProps {
|
|
5
7
|
children?: React.ReactNode;
|
|
6
8
|
noResults?: React.ReactNode;
|
|
7
9
|
}
|
|
8
10
|
export declare const SearchResultsComponent: React.FC<SearchResultsProps>;
|
|
9
11
|
export declare const SearchResults: typeof SearchResultsComponent & {
|
|
10
|
-
Item: typeof
|
|
12
|
+
Item: typeof SearchResultsItem;
|
|
13
|
+
ViewAll: typeof SearchResultsViewAll;
|
|
11
14
|
};
|
|
12
15
|
export default SearchResults;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import "../../../chunks/
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
c[`${p}__results`]
|
|
10
|
-
);
|
|
11
|
-
return /* @__PURE__ */ o(i.Group, { className: r, ...e, children: t });
|
|
12
|
-
}, s = n;
|
|
13
|
-
s.Item = l;
|
|
14
|
-
s.displayName = "Search.Results";
|
|
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.DR20Rl2x.js";
|
|
7
|
+
import "./Search.Results.Item.es.js";
|
|
8
|
+
import "../../ActionList/ActionList.es.js";
|
|
15
9
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
c as SearchResults,
|
|
11
|
+
l as SearchResultsComponent,
|
|
12
|
+
u as SearchResultsContext,
|
|
13
|
+
h as default
|
|
19
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),
|
|
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.DBQWuhZu.js"),F=require("clsx"),ue=require("../../../chunks/form.context.B26th8Od.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;
|