@phillips/seldon 1.171.1 → 1.172.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/dist/components/Drawer/Drawer.d.ts +22 -3
- package/dist/components/Drawer/Drawer.js +80 -73
- package/dist/components/Drawer/Drawer.stories.d.ts +97 -2
- package/dist/components/Drawer/DrawerHeader.d.ts +12 -0
- package/dist/components/Drawer/DrawerHeader.js +34 -0
- package/dist/components/Drawer/DrawerHeader.test.d.ts +1 -0
- package/dist/patterns/FiltersInline/MainFilterDropdown.js +23 -22
- package/dist/patterns/FiltersInline/SubFilterDropdown.js +67 -66
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/components/Drawer/_drawer.scss +43 -16
- package/dist/scss/components/Drawer/_drawerHeader.scss +45 -0
- package/package.json +1 -1
|
@@ -12,14 +12,33 @@ export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
12
12
|
* The content of the drawer
|
|
13
13
|
*/
|
|
14
14
|
children?: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* A string to be displayed center at the top of the drawer, up with the close button.
|
|
17
|
+
* Its presence also triggers the horizontal rule below the header to be rendered.
|
|
18
|
+
*/
|
|
19
|
+
headerText?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Used as the accessibility label for the drawer, used for screen readers.
|
|
22
|
+
* Defaults to the headerText if that's provided, otherwise an empty string.
|
|
23
|
+
*/
|
|
24
|
+
title?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Used as the accessibility description for the drawer, used for screen readers.
|
|
27
|
+
* Defaults to the title if that's provided, otherwise an empty string.
|
|
28
|
+
*/
|
|
29
|
+
description?: string;
|
|
15
30
|
/**
|
|
16
31
|
* Which side the drawer opens from: left, right, or bottom
|
|
17
32
|
*/
|
|
18
33
|
drawerOpenSide?: 'left' | 'right' | 'bottom';
|
|
19
34
|
/**
|
|
20
|
-
*
|
|
35
|
+
* Older designs for left/right drawers have more padding around the content.
|
|
36
|
+
* This value is in rem, and must be an integer under 3.
|
|
37
|
+
*
|
|
38
|
+
* Default is 2 if null or undefined, or 1 if headingText is supplied. This is silly
|
|
39
|
+
* but aligns with design and allows this prop to be left out most of the time.
|
|
21
40
|
*/
|
|
22
|
-
|
|
41
|
+
paddingLevel?: 0 | 1 | 2;
|
|
23
42
|
}
|
|
24
43
|
/**
|
|
25
44
|
* ## Overview
|
|
@@ -27,5 +46,5 @@ export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
27
46
|
* A component for displaying a drawer.
|
|
28
47
|
*
|
|
29
48
|
*/
|
|
30
|
-
declare const Drawer:
|
|
49
|
+
declare const Drawer: React.ForwardRefExoticComponent<DrawerProps & React.RefAttributes<HTMLDivElement>>;
|
|
31
50
|
export default Drawer;
|
|
@@ -1,80 +1,87 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
1
|
+
import { jsx as r, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as y } from "react";
|
|
3
|
+
import s from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { Root as $, Portal as w, Overlay as D, Content as b, Title as v, Description as B, Close as P } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
5
|
+
import { VisuallyHidden as n } from "../../node_modules/@radix-ui/react-visually-hidden/dist/index.js";
|
|
6
|
+
import { getCommonProps as j, noOp as k } from "../../utils/index.js";
|
|
7
|
+
import H from "./DrawerHeader.js";
|
|
8
|
+
import I from "../IconButton/IconButton.js";
|
|
9
|
+
import { ButtonVariants as R } from "../Button/types.js";
|
|
10
|
+
import V from "../Icon/Icon.js";
|
|
11
|
+
const g = y(
|
|
12
|
+
({
|
|
13
|
+
isOpen: d,
|
|
14
|
+
onClose: t = k,
|
|
15
|
+
headerText: a,
|
|
16
|
+
title: m,
|
|
17
|
+
description: f = m,
|
|
18
|
+
drawerOpenSide: e = "right",
|
|
19
|
+
paddingLevel: i,
|
|
20
|
+
className: h,
|
|
21
|
+
children: p,
|
|
22
|
+
...l
|
|
23
|
+
}, C) => {
|
|
24
|
+
const { className: o, ...u } = j(l, "Drawer"), N = e === "bottom";
|
|
25
|
+
return i ?? (i = a ? 1 : 2), /* @__PURE__ */ r(
|
|
26
|
+
$,
|
|
27
|
+
{
|
|
28
|
+
open: d,
|
|
29
|
+
onOpenChange: (_) => {
|
|
30
|
+
_ || t();
|
|
31
|
+
},
|
|
32
|
+
children: /* @__PURE__ */ c(w, { children: [
|
|
33
|
+
/* @__PURE__ */ r(D, { onClick: t, className: `${o}__overlay`, "data-testid": "drawer-overlay" }),
|
|
34
|
+
/* @__PURE__ */ c(
|
|
35
|
+
b,
|
|
36
|
+
{
|
|
37
|
+
className: s(o, h, {
|
|
38
|
+
[`${o}--bottom`]: N
|
|
39
|
+
}),
|
|
40
|
+
"data-side": e,
|
|
41
|
+
id: l.id,
|
|
42
|
+
ref: C,
|
|
43
|
+
...u,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ r(n, { asChild: !0, children: /* @__PURE__ */ r(v, { children: m }) }),
|
|
46
|
+
/* @__PURE__ */ r(n, { asChild: !0, children: /* @__PURE__ */ r(B, { children: f }) }),
|
|
47
|
+
a ? /* @__PURE__ */ r(
|
|
48
|
+
H,
|
|
49
49
|
{
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
baseClassName: o,
|
|
51
|
+
headerText: a,
|
|
52
|
+
onClose: t,
|
|
53
|
+
drawerOpenSide: e
|
|
54
|
+
}
|
|
55
|
+
) : /* @__PURE__ */ r(P, { asChild: !0, children: /* @__PURE__ */ r(
|
|
56
|
+
I,
|
|
57
|
+
{
|
|
58
|
+
onClick: t,
|
|
59
|
+
className: s(`${o}__close`),
|
|
52
60
|
"aria-label": "Close",
|
|
53
61
|
"data-testid": "drawer-close",
|
|
54
|
-
variant:
|
|
55
|
-
children: /* @__PURE__ */
|
|
62
|
+
variant: R.tertiary,
|
|
63
|
+
children: /* @__PURE__ */ r(V, { icon: "CloseX", color: "currentColor" })
|
|
56
64
|
}
|
|
57
65
|
) }),
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
};
|
|
66
|
+
/* @__PURE__ */ r(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
className: s(
|
|
70
|
+
`${o}__content`,
|
|
71
|
+
i < 3 && `${o}__content--ep${i}`
|
|
72
|
+
),
|
|
73
|
+
children: p
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
)
|
|
79
|
+
] })
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
g.displayName = "Drawer";
|
|
78
85
|
export {
|
|
79
|
-
|
|
86
|
+
g as default
|
|
80
87
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DrawerProps } from './Drawer';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: (
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<DrawerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
5
|
};
|
|
6
6
|
export default meta;
|
|
7
7
|
export declare const Playground: {
|
|
@@ -9,6 +9,101 @@ export declare const Playground: {
|
|
|
9
9
|
args: {
|
|
10
10
|
children: string;
|
|
11
11
|
isOpen: boolean;
|
|
12
|
+
headerText: string;
|
|
13
|
+
title: undefined;
|
|
14
|
+
drawerOpenSide: string;
|
|
15
|
+
paddingLevel: number;
|
|
16
|
+
};
|
|
17
|
+
argTypes: {
|
|
18
|
+
isOpen: {
|
|
19
|
+
control: string;
|
|
20
|
+
description: string;
|
|
21
|
+
defaultValue: boolean;
|
|
22
|
+
table: {
|
|
23
|
+
type: {
|
|
24
|
+
summary: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
onClose: {
|
|
29
|
+
action: string;
|
|
30
|
+
description: string;
|
|
31
|
+
table: {
|
|
32
|
+
type: {
|
|
33
|
+
summary: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
children: {
|
|
38
|
+
control: string;
|
|
39
|
+
description: string;
|
|
40
|
+
table: {
|
|
41
|
+
type: {
|
|
42
|
+
summary: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
headerText: {
|
|
47
|
+
control: string;
|
|
48
|
+
description: string;
|
|
49
|
+
table: {
|
|
50
|
+
type: {
|
|
51
|
+
summary: string;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
title: {
|
|
56
|
+
control: string;
|
|
57
|
+
description: string;
|
|
58
|
+
table: {
|
|
59
|
+
type: {
|
|
60
|
+
summary: string;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
drawerOpenSide: {
|
|
65
|
+
control: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
options: string[];
|
|
69
|
+
description: string;
|
|
70
|
+
defaultValue: string;
|
|
71
|
+
table: {
|
|
72
|
+
type: {
|
|
73
|
+
summary: string;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
paddingLevel: {
|
|
78
|
+
control: {
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
options: (number | undefined)[];
|
|
82
|
+
description: string;
|
|
83
|
+
defaultValue: undefined;
|
|
84
|
+
table: {
|
|
85
|
+
type: {
|
|
86
|
+
summary: string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
className: {
|
|
91
|
+
control: string;
|
|
92
|
+
description: string;
|
|
93
|
+
table: {
|
|
94
|
+
type: {
|
|
95
|
+
summary: string;
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
id: {
|
|
100
|
+
control: string;
|
|
101
|
+
description: string;
|
|
102
|
+
table: {
|
|
103
|
+
type: {
|
|
104
|
+
summary: string;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
12
108
|
};
|
|
13
|
-
argTypes: {};
|
|
14
109
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { DrawerProps } from './Drawer';
|
|
3
|
+
type CommonProps = ComponentProps<'div'> & {
|
|
4
|
+
baseClassName: string;
|
|
5
|
+
drawerOpenSide: DrawerProps['drawerOpenSide'];
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
};
|
|
8
|
+
export type DrawerHeaderProps = CommonProps & {
|
|
9
|
+
headerText?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const DrawerHeader: import('react').ForwardRefExoticComponent<Omit<DrawerHeaderProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export default DrawerHeader;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as i, Fragment as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as m } from "react";
|
|
3
|
+
import { Close as d } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
4
|
+
import f from "../IconButton/IconButton.js";
|
|
5
|
+
import { ButtonVariants as h } from "../Button/types.js";
|
|
6
|
+
import b from "../Icon/Icon.js";
|
|
7
|
+
const n = ({ baseClassName: a, drawerOpenSide: t, onClose: l, bookendSide: e, ...s }) => {
|
|
8
|
+
const r = t === "bottom" && e === "left" || t !== "bottom" && e === "right";
|
|
9
|
+
return /* @__PURE__ */ o("div", { className: `${a}__bookend ${a}__bookend-${e}`, ...s, children: r && /* @__PURE__ */ o(d, { asChild: !0, children: /* @__PURE__ */ o(f, { onClick: l, "aria-label": "Close", "data-testid": "drawer-close", variant: h.tertiary, children: /* @__PURE__ */ o(b, { icon: "CloseX", color: "currentColor" }) }) }) });
|
|
10
|
+
}, _ = m(
|
|
11
|
+
({ baseClassName: a, headerText: t, drawerOpenSide: l, onClose: e }, s) => {
|
|
12
|
+
const r = `${a}-header`;
|
|
13
|
+
return /* @__PURE__ */ i(c, { children: [
|
|
14
|
+
/* @__PURE__ */ i("div", { className: r, children: [
|
|
15
|
+
/* @__PURE__ */ o(n, { baseClassName: r, onClose: e, drawerOpenSide: l, bookendSide: "left" }),
|
|
16
|
+
/* @__PURE__ */ o("h3", { className: `${r}__title`, children: t }),
|
|
17
|
+
/* @__PURE__ */ o(
|
|
18
|
+
n,
|
|
19
|
+
{
|
|
20
|
+
baseClassName: r,
|
|
21
|
+
onClose: e,
|
|
22
|
+
drawerOpenSide: l,
|
|
23
|
+
bookendSide: "right"
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] }),
|
|
27
|
+
t && /* @__PURE__ */ o("div", { className: `${r}__hr` })
|
|
28
|
+
] });
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
_.displayName = "DrawerHeader";
|
|
32
|
+
export {
|
|
33
|
+
_ as default
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as l, Fragment as A, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import N from "../../node_modules/classnames/index.js";
|
|
3
|
-
import
|
|
3
|
+
import g from "react";
|
|
4
4
|
import c from "../../components/Button/Button.js";
|
|
5
|
-
import { ButtonVariants as
|
|
5
|
+
import { ButtonVariants as x } from "../../components/Button/types.js";
|
|
6
6
|
import k from "../../components/Drawer/Drawer.js";
|
|
7
7
|
import B from "../../components/Filter/Filter.js";
|
|
8
8
|
import D from "../../components/Filter/FilterHeader.js";
|
|
@@ -12,7 +12,7 @@ import j from "../FilterMenu/FilterMenu.js";
|
|
|
12
12
|
import { FilterButton as H } from "./FilterButton.js";
|
|
13
13
|
import { FilterButtonIconType as I } from "./types.js";
|
|
14
14
|
import { countActiveFilters as O, getFilterButtonClickHandler as R, resetAllFilters as S } from "./utils.js";
|
|
15
|
-
const T =
|
|
15
|
+
const T = g.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
className: f,
|
|
18
18
|
filterButtonLabel: n,
|
|
@@ -24,22 +24,22 @@ const T = x.forwardRef(
|
|
|
24
24
|
onClickClear: w,
|
|
25
25
|
resultsCount: F,
|
|
26
26
|
dropdownMenuTranslation: d,
|
|
27
|
-
ariaLabels:
|
|
27
|
+
ariaLabels: p = {},
|
|
28
28
|
id: h
|
|
29
29
|
}, _) => {
|
|
30
|
-
const
|
|
30
|
+
const s = i?.[0] ?? !1, { totalCount: y, filterCount: C } = O(m, n);
|
|
31
31
|
return /* @__PURE__ */ l(A, { children: [
|
|
32
32
|
/* @__PURE__ */ o(
|
|
33
33
|
H,
|
|
34
34
|
{
|
|
35
35
|
ref: _,
|
|
36
36
|
className: f,
|
|
37
|
-
isSelected:
|
|
37
|
+
isSelected: s,
|
|
38
38
|
count: C,
|
|
39
39
|
label: n,
|
|
40
40
|
totalCount: y,
|
|
41
41
|
id: h,
|
|
42
|
-
ariaLabel:
|
|
42
|
+
ariaLabel: p.button || `${n} button`,
|
|
43
43
|
onClick: R(i, a, 0),
|
|
44
44
|
isMobile: !1,
|
|
45
45
|
type: I.Filter
|
|
@@ -48,28 +48,29 @@ const T = x.forwardRef(
|
|
|
48
48
|
/* @__PURE__ */ l(
|
|
49
49
|
k,
|
|
50
50
|
{
|
|
51
|
-
isOpen:
|
|
51
|
+
isOpen: s,
|
|
52
52
|
drawerOpenSide: "left",
|
|
53
53
|
onClose: () => S(i, a),
|
|
54
54
|
className: `${t}-filter-drawer`,
|
|
55
|
-
"aria-label":
|
|
55
|
+
"aria-label": p.drawer || "Filter drawer",
|
|
56
|
+
paddingLevel: 0,
|
|
56
57
|
children: [
|
|
57
|
-
/* @__PURE__ */ o(j, { className: `${t}-filter-drawer-menu`, children: m?.map((
|
|
58
|
-
/* @__PURE__ */ o(D, { heading:
|
|
59
|
-
Array.from(
|
|
58
|
+
/* @__PURE__ */ o(j, { className: `${t}-filter-drawer-menu`, children: m?.map((e) => /* @__PURE__ */ l(B, { name: e.label, children: [
|
|
59
|
+
/* @__PURE__ */ o(D, { heading: e.label }),
|
|
60
|
+
Array.from(e.filterDimensions).map((r) => /* @__PURE__ */ o(
|
|
60
61
|
M,
|
|
61
62
|
{
|
|
62
|
-
id:
|
|
63
|
-
labelText:
|
|
64
|
-
onChange: ($) => u?.($,
|
|
65
|
-
type:
|
|
66
|
-
disabled:
|
|
67
|
-
name:
|
|
68
|
-
checked:
|
|
63
|
+
id: r.label,
|
|
64
|
+
labelText: r.label,
|
|
65
|
+
onChange: ($) => u?.($, e.buttonType),
|
|
66
|
+
type: e.type,
|
|
67
|
+
disabled: r?.disabled,
|
|
68
|
+
name: r.label,
|
|
69
|
+
checked: r.active
|
|
69
70
|
},
|
|
70
|
-
|
|
71
|
+
r.label
|
|
71
72
|
))
|
|
72
|
-
] },
|
|
73
|
+
] }, e.id)) }),
|
|
73
74
|
/* @__PURE__ */ l(
|
|
74
75
|
"div",
|
|
75
76
|
{
|
|
@@ -82,7 +83,7 @@ const T = x.forwardRef(
|
|
|
82
83
|
c,
|
|
83
84
|
{
|
|
84
85
|
className: `${t}-filter-dropdown-menu__button`,
|
|
85
|
-
variant:
|
|
86
|
+
variant: x.secondary,
|
|
86
87
|
onClick: () => w?.("all"),
|
|
87
88
|
children: d?.clearAll || "Clear all"
|
|
88
89
|
}
|
|
@@ -1,103 +1,104 @@
|
|
|
1
1
|
import { jsxs as g, Fragment as S, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { Root as f, Trigger as
|
|
2
|
+
import { Root as f, Trigger as v, Portal as j, Content as P } from "../../node_modules/@radix-ui/react-popover/dist/index.js";
|
|
3
3
|
import _ from "react";
|
|
4
4
|
import q from "../../components/Drawer/Drawer.js";
|
|
5
|
-
import { SSRMediaQuery as
|
|
5
|
+
import { SSRMediaQuery as O } from "../../providers/SeldonProvider/utils.js";
|
|
6
6
|
import { px as E } from "../../utils/index.js";
|
|
7
|
-
import { FilterButton as
|
|
7
|
+
import { FilterButton as C } from "./FilterButton.js";
|
|
8
8
|
import { FilterDropdownMenuDesktop as H } from "./FilterDropdownMenuDesktop.js";
|
|
9
9
|
import { FilterDropdownMenuMobile as N } from "./FilterDropdownMenuMobile.js";
|
|
10
10
|
import { FilterButtonType as Q } from "./types.js";
|
|
11
|
-
import { countActiveFilters as k, getFilterButtonClickHandler as
|
|
11
|
+
import { countActiveFilters as k, getFilterButtonClickHandler as l, getFilterButtonLabel as z } from "./utils.js";
|
|
12
12
|
const A = _.forwardRef(
|
|
13
13
|
({
|
|
14
14
|
filterId: e = 0,
|
|
15
|
-
className:
|
|
15
|
+
className: h,
|
|
16
16
|
filterButtonLabel: r,
|
|
17
|
-
buttonType:
|
|
17
|
+
buttonType: i,
|
|
18
18
|
handleClick: m,
|
|
19
19
|
filtersListState: a,
|
|
20
|
-
filters:
|
|
21
|
-
onSelectFilter:
|
|
22
|
-
onApplyFilter:
|
|
23
|
-
onClickClear:
|
|
24
|
-
resultsCount:
|
|
25
|
-
filterButtonLabelTranslated:
|
|
26
|
-
dropdownMenuTranslation:
|
|
27
|
-
ariaLabels:
|
|
20
|
+
filters: t,
|
|
21
|
+
onSelectFilter: w,
|
|
22
|
+
onApplyFilter: F,
|
|
23
|
+
onClickClear: $,
|
|
24
|
+
resultsCount: b,
|
|
25
|
+
filterButtonLabelTranslated: p,
|
|
26
|
+
dropdownMenuTranslation: x,
|
|
27
|
+
ariaLabels: n = {},
|
|
28
28
|
hideDesktopSortButton: R,
|
|
29
|
-
id:
|
|
30
|
-
},
|
|
31
|
-
const
|
|
32
|
-
return R &&
|
|
33
|
-
/* @__PURE__ */ g(
|
|
29
|
+
id: c
|
|
30
|
+
}, M) => {
|
|
31
|
+
const d = a?.[e] ?? !1, { totalCount: D, filterCount: s } = k(t, i), u = z(r, s, p || null);
|
|
32
|
+
return R && i === Q.Sort ? null : /* @__PURE__ */ g(S, { children: [
|
|
33
|
+
/* @__PURE__ */ g(O.Media, { lessThan: "md", children: [
|
|
34
34
|
/* @__PURE__ */ o(
|
|
35
|
-
|
|
35
|
+
C,
|
|
36
36
|
{
|
|
37
|
-
ref:
|
|
38
|
-
className:
|
|
39
|
-
isSelected:
|
|
37
|
+
ref: M,
|
|
38
|
+
className: h,
|
|
39
|
+
isSelected: d,
|
|
40
40
|
count: s,
|
|
41
41
|
label: u,
|
|
42
|
-
id:
|
|
43
|
-
totalCount:
|
|
44
|
-
ariaLabel:
|
|
45
|
-
onClick:
|
|
42
|
+
id: c,
|
|
43
|
+
totalCount: D,
|
|
44
|
+
ariaLabel: n.button || `${r} button`,
|
|
45
|
+
onClick: l(a, m, e),
|
|
46
46
|
isMobile: !0,
|
|
47
|
-
type:
|
|
47
|
+
type: i
|
|
48
48
|
}
|
|
49
49
|
),
|
|
50
50
|
/* @__PURE__ */ o(
|
|
51
51
|
q,
|
|
52
52
|
{
|
|
53
53
|
drawerOpenSide: "bottom",
|
|
54
|
-
isOpen:
|
|
55
|
-
onClose:
|
|
56
|
-
"aria-label":
|
|
54
|
+
isOpen: d,
|
|
55
|
+
onClose: l(a, m, e),
|
|
56
|
+
"aria-label": n.drawer || `${r} drawer`,
|
|
57
57
|
className: `${E}-filter-drawer-mobile`,
|
|
58
|
-
|
|
58
|
+
headerText: `${u} Filter`,
|
|
59
|
+
paddingLevel: 0,
|
|
59
60
|
children: /* @__PURE__ */ o(
|
|
60
61
|
N,
|
|
61
62
|
{
|
|
62
|
-
buttonType:
|
|
63
|
-
filters:
|
|
63
|
+
buttonType: i,
|
|
64
|
+
filters: t,
|
|
64
65
|
filterIndex: e,
|
|
65
|
-
onSelectFilter:
|
|
66
|
-
onApplyFilter:
|
|
67
|
-
onClickClear:
|
|
68
|
-
resultsCount:
|
|
69
|
-
ariaLabels:
|
|
66
|
+
onSelectFilter: w,
|
|
67
|
+
onApplyFilter: F,
|
|
68
|
+
onClickClear: $,
|
|
69
|
+
resultsCount: b,
|
|
70
|
+
ariaLabels: n?.ariaLabel,
|
|
70
71
|
filterButtonLabel: r,
|
|
71
|
-
filterButtonLabelTranslated:
|
|
72
|
-
dropdownMenuTranslation:
|
|
72
|
+
filterButtonLabelTranslated: p,
|
|
73
|
+
dropdownMenuTranslation: x
|
|
73
74
|
}
|
|
74
75
|
)
|
|
75
76
|
}
|
|
76
77
|
)
|
|
77
78
|
] }),
|
|
78
|
-
/* @__PURE__ */ o(
|
|
79
|
+
/* @__PURE__ */ o(O.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ g(
|
|
79
80
|
f,
|
|
80
81
|
{
|
|
81
|
-
open:
|
|
82
|
-
onOpenChange:
|
|
82
|
+
open: d,
|
|
83
|
+
onOpenChange: l(a, m, e),
|
|
83
84
|
children: [
|
|
84
|
-
/* @__PURE__ */ o(
|
|
85
|
-
|
|
85
|
+
/* @__PURE__ */ o(v, { asChild: !0, children: /* @__PURE__ */ o(
|
|
86
|
+
C,
|
|
86
87
|
{
|
|
87
|
-
ref:
|
|
88
|
-
className:
|
|
89
|
-
isSelected:
|
|
88
|
+
ref: M,
|
|
89
|
+
className: h,
|
|
90
|
+
isSelected: d,
|
|
90
91
|
count: s,
|
|
91
92
|
label: u,
|
|
92
|
-
totalCount:
|
|
93
|
-
id:
|
|
94
|
-
ariaLabel:
|
|
95
|
-
onClick:
|
|
93
|
+
totalCount: D,
|
|
94
|
+
id: c,
|
|
95
|
+
ariaLabel: n.ariaLabel || `${r} button`,
|
|
96
|
+
onClick: l(a, m, e),
|
|
96
97
|
isMobile: !1,
|
|
97
|
-
type:
|
|
98
|
+
type: i
|
|
98
99
|
}
|
|
99
100
|
) }),
|
|
100
|
-
/* @__PURE__ */ o(
|
|
101
|
+
/* @__PURE__ */ o(j, { children: /* @__PURE__ */ o(
|
|
101
102
|
P,
|
|
102
103
|
{
|
|
103
104
|
avoidCollisions: !0,
|
|
@@ -105,28 +106,28 @@ const A = _.forwardRef(
|
|
|
105
106
|
sideOffset: 5,
|
|
106
107
|
align: "start",
|
|
107
108
|
alignOffset: 5,
|
|
108
|
-
"aria-label":
|
|
109
|
+
"aria-label": n.ariaLabel || `${r} dropdown`,
|
|
109
110
|
children: /* @__PURE__ */ o(
|
|
110
111
|
H,
|
|
111
112
|
{
|
|
112
|
-
buttonType:
|
|
113
|
-
filters:
|
|
113
|
+
buttonType: i,
|
|
114
|
+
filters: t,
|
|
114
115
|
filterIndex: e,
|
|
115
|
-
onSelectFilter:
|
|
116
|
-
onApplyFilter:
|
|
117
|
-
onClickClear:
|
|
118
|
-
resultsCount:
|
|
119
|
-
ariaLabels:
|
|
116
|
+
onSelectFilter: w,
|
|
117
|
+
onApplyFilter: F,
|
|
118
|
+
onClickClear: $,
|
|
119
|
+
resultsCount: b,
|
|
120
|
+
ariaLabels: n?.ariaLabel,
|
|
120
121
|
filterButtonLabel: r,
|
|
121
|
-
filterButtonLabelTranslated:
|
|
122
|
-
dropdownMenuTranslation:
|
|
122
|
+
filterButtonLabelTranslated: p,
|
|
123
|
+
dropdownMenuTranslation: x
|
|
123
124
|
}
|
|
124
125
|
)
|
|
125
126
|
}
|
|
126
127
|
) })
|
|
127
128
|
]
|
|
128
129
|
},
|
|
129
|
-
`${
|
|
130
|
+
`${c}-${r}-button`
|
|
130
131
|
) })
|
|
131
132
|
] });
|
|
132
133
|
}
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
@use 'components/Accordion/accordion';
|
|
33
33
|
@use 'components/Breadcrumb/breadcrumb';
|
|
34
34
|
@use 'components/Drawer/drawer';
|
|
35
|
+
@use 'components/Drawer/drawerHeader';
|
|
35
36
|
@use 'components/Dropdown/dropdown';
|
|
36
37
|
@use 'components/Video/video';
|
|
37
38
|
@use 'components/Select/select';
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
height: 100dvh;
|
|
9
9
|
max-width: 480px;
|
|
10
|
-
padding: $padding-xl $padding-md $padding-md;
|
|
11
10
|
position: fixed;
|
|
12
11
|
right: 0;
|
|
13
12
|
top: 0;
|
|
@@ -18,10 +17,6 @@
|
|
|
18
17
|
outline: none;
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
.#{$px}-icon-close-x:hover {
|
|
22
|
-
color: $white;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
20
|
@media (max-width: $breakpoint-sm) {
|
|
26
21
|
max-width: 100%;
|
|
27
22
|
}
|
|
@@ -30,13 +25,6 @@
|
|
|
30
25
|
padding-bottom: $padding-sm;
|
|
31
26
|
}
|
|
32
27
|
|
|
33
|
-
&__overlay {
|
|
34
|
-
background-color: $overlay-black;
|
|
35
|
-
inset: 0;
|
|
36
|
-
position: fixed;
|
|
37
|
-
z-index: 10;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
28
|
&__close {
|
|
41
29
|
align-items: center;
|
|
42
30
|
border-radius: 100%;
|
|
@@ -46,11 +34,13 @@
|
|
|
46
34
|
position: absolute;
|
|
47
35
|
right: 10px;
|
|
48
36
|
top: 10px;
|
|
37
|
+
}
|
|
49
38
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
&__overlay {
|
|
40
|
+
background-color: $overlay-black;
|
|
41
|
+
inset: 0;
|
|
42
|
+
position: fixed;
|
|
43
|
+
z-index: 10;
|
|
54
44
|
}
|
|
55
45
|
|
|
56
46
|
// Bottom sheet modifier
|
|
@@ -84,6 +74,43 @@
|
|
|
84
74
|
width: fit-content;
|
|
85
75
|
}
|
|
86
76
|
}
|
|
77
|
+
|
|
78
|
+
&__content {
|
|
79
|
+
align-items: center;
|
|
80
|
+
display: flex;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
height: 100%;
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
overflow-y: auto;
|
|
85
|
+
padding-top: $snowflake-menu-padding;
|
|
86
|
+
width: 100%;
|
|
87
|
+
|
|
88
|
+
// different designs require different padding (ep = extra padding). more info in the component.
|
|
89
|
+
|
|
90
|
+
&--ep0 {
|
|
91
|
+
padding-top: 0;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
&--ep1 {
|
|
95
|
+
padding: 1rem;
|
|
96
|
+
padding-top: $snowflake-menu-padding;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&--ep2 {
|
|
100
|
+
padding: 2rem;
|
|
101
|
+
padding-top: $spacing-xl;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&--ep3 {
|
|
105
|
+
padding: 3rem;
|
|
106
|
+
padding-top: $snowflake-menu-padding;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// make the children scroll in their little children box
|
|
110
|
+
> * {
|
|
111
|
+
overflow-y: auto;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
87
114
|
}
|
|
88
115
|
|
|
89
116
|
// Drawer open/close animations
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
@use '../../allPartials' as *;
|
|
2
|
+
|
|
3
|
+
.#{$px}-drawer-header {
|
|
4
|
+
align-items: center;
|
|
5
|
+
display: flex;
|
|
6
|
+
padding: $margin-sm $margin-xsm;
|
|
7
|
+
width: 100%;
|
|
8
|
+
|
|
9
|
+
&__bookend {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex: 1 1 0;
|
|
12
|
+
|
|
13
|
+
&-right {
|
|
14
|
+
justify-content: flex-end;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&-left {
|
|
18
|
+
justify-content: flex-start;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
&__hr {
|
|
23
|
+
border-bottom: 2px solid $light-gray;
|
|
24
|
+
margin-bottom: $spacing-sm;
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&__title {
|
|
29
|
+
@include DistinctDisplay;
|
|
30
|
+
|
|
31
|
+
color: $primary-black;
|
|
32
|
+
font-size: $heading-size4;
|
|
33
|
+
font-variation-settings: 'wght' 600;
|
|
34
|
+
line-height: $body-line-height-size1;
|
|
35
|
+
margin-top: 4px; // better visual align with the close icon
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
text-align: center;
|
|
38
|
+
text-overflow: ellipsis;
|
|
39
|
+
white-space: nowrap;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.#{$px}-icon-close-x:hover {
|
|
43
|
+
color: $white;
|
|
44
|
+
}
|
|
45
|
+
}
|