@sps-woodland/list-bar 8.51.2 → 8.52.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/README.md +1 -40
- package/lib/advanced-search/AdvancedSearch.css.d.ts +10 -0
- package/lib/advanced-search/AdvancedSearch.d.ts +15 -0
- package/lib/index.d.ts +7 -1
- package/lib/index.js +357 -50
- package/lib/index.umd.cjs +23 -23
- package/lib/list-bar/InputGroupWrapper.d.ts +3 -0
- package/lib/list-bar/ListBar.css.d.ts +38 -0
- package/lib/list-bar/ListBar.d.ts +19 -0
- package/lib/list-bar/ListBarSearch.d.ts +5 -0
- package/lib/list-bar/ListBarSearchInfo.d.ts +3 -0
- package/lib/list-bar/ListBarSortBy.d.ts +15 -0
- package/lib/search-results-bar/SearchResultsBar.css.d.ts +9 -0
- package/lib/search-results-bar/SearchResultsBar.d.ts +10 -0
- package/lib/style.css +1 -1
- package/package.json +21 -8
- package/vite.config.mjs +13 -6
package/README.md
CHANGED
|
@@ -1,42 +1,3 @@
|
|
|
1
1
|
## [@sps-woodland/list-bar](https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/list-bar#readme)
|
|
2
2
|
|
|
3
|
-
SPS Woodland Design System list bar components
|
|
4
|
-
|
|
5
|
-
> **Heads up — this is a wrapper package.** The component source now lives in
|
|
6
|
-
> [`@sps-woodland/core`](../react). This package re-exports from the
|
|
7
|
-
> mono-package so existing imports keep working, but new code should prefer the
|
|
8
|
-
> mono-package paths.
|
|
9
|
-
|
|
10
|
-
### Preferred imports (mono-package)
|
|
11
|
-
|
|
12
|
-
```ts
|
|
13
|
-
import {
|
|
14
|
-
ListBar,
|
|
15
|
-
ListBarSearch,
|
|
16
|
-
ListBarSearchInfo,
|
|
17
|
-
ListBarSortBy,
|
|
18
|
-
InputGroupWrapper,
|
|
19
|
-
SearchResultsBar,
|
|
20
|
-
AdvancedSearch,
|
|
21
|
-
} from "@sps-woodland/core/list-bar";
|
|
22
|
-
|
|
23
|
-
// Or per-component (everything except ListBar has a flat subpath):
|
|
24
|
-
import { ListBarSearch } from "@sps-woodland/core/list-bar-search";
|
|
25
|
-
import { ListBarSearchInfo } from "@sps-woodland/core/list-bar-search-info";
|
|
26
|
-
import { ListBarSortBy } from "@sps-woodland/core/list-bar-sort-by";
|
|
27
|
-
import { InputGroupWrapper } from "@sps-woodland/core/input-group-wrapper";
|
|
28
|
-
import { SearchResultsBar } from "@sps-woodland/core/search-results-bar";
|
|
29
|
-
import { AdvancedSearch } from "@sps-woodland/core/advanced-search";
|
|
30
|
-
|
|
31
|
-
import "@sps-woodland/core/list-bar/style.css";
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
`ListBar` is barrel-only (the family name and the parent component share a
|
|
35
|
-
name). Everything else has both a barrel entry and a flat subpath.
|
|
36
|
-
|
|
37
|
-
### Legacy imports (still supported)
|
|
38
|
-
|
|
39
|
-
```ts
|
|
40
|
-
import { ListBar, AdvancedSearch, SearchResultsBar } from "@sps-woodland/list-bar";
|
|
41
|
-
import "@sps-woodland/list-bar/style.css";
|
|
42
|
-
```
|
|
3
|
+
SPS Woodland Design System list bar components
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BooleanRecipeVariant, VariantDefinitions } from "@sps-woodland/core";
|
|
2
|
+
interface AdvancedSearchVariantDefinitions extends VariantDefinitions {
|
|
3
|
+
open: BooleanRecipeVariant;
|
|
4
|
+
compact: BooleanRecipeVariant;
|
|
5
|
+
}
|
|
6
|
+
export declare const advancedSearch: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<AdvancedSearchVariantDefinitions, "compact" | "open">>;
|
|
7
|
+
export declare const advancedSearchForm: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<Pick<AdvancedSearchVariantDefinitions, "open">>;
|
|
8
|
+
export declare const advancedSearchFooter: string;
|
|
9
|
+
export declare const advancedSearchFooterControls: string;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
import type { SpsFormArray, SpsFormGroup, SpsFormSetMeta } from "@spscommerce/ds-react";
|
|
4
|
+
export declare function AdvancedSearch({ formArray, formGroup, formMeta, onSubmit, controlsDisabled, footerLinks, isOpen, onClear, submitButtonText, compact, className, children, ...rest }: ComponentProps<{
|
|
5
|
+
formArray?: SpsFormArray<any>;
|
|
6
|
+
formGroup?: SpsFormGroup;
|
|
7
|
+
formMeta?: SpsFormSetMeta<any>;
|
|
8
|
+
onSubmit?: React.FormEventHandler;
|
|
9
|
+
controlsDisabled?: boolean;
|
|
10
|
+
footerLinks?: React.ReactNode | (() => React.ReactNode);
|
|
11
|
+
isOpen?: boolean;
|
|
12
|
+
onClear?: () => void;
|
|
13
|
+
submitButtonText?: string;
|
|
14
|
+
compact?: boolean;
|
|
15
|
+
}, HTMLDivElement>): React.ReactElement;
|
package/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
export * from "
|
|
1
|
+
export * from "./list-bar/ListBar";
|
|
2
|
+
export * from "./list-bar/ListBarSearch";
|
|
3
|
+
export * from "./list-bar/ListBarSearchInfo";
|
|
4
|
+
export * from "./list-bar/ListBarSortBy";
|
|
5
|
+
export * from "./list-bar/InputGroupWrapper";
|
|
6
|
+
export * from "./search-results-bar/SearchResultsBar";
|
|
7
|
+
export * from "./advanced-search/AdvancedSearch";
|
|
2
8
|
export * from "./manifest";
|
package/lib/index.js
CHANGED
|
@@ -1,24 +1,324 @@
|
|
|
1
|
-
import { ListBar as i, ListBarSearch as d, ListBarSearchInfo as u, ListBarSortBy as m } from "@sps-woodland/core/list-bar";
|
|
2
|
-
export * from "@sps-woodland/core/list-bar";
|
|
3
1
|
import * as e from "react";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { Metadata as b, modChildren as te, cl as A, selectChildren as ae, addProps as re, PortalContext as se, contentOf as ne } from "@sps-woodland/core";
|
|
3
|
+
import { Button as _ } from "@sps-woodland/buttons";
|
|
4
|
+
import { Tag as k } from "@sps-woodland/tags";
|
|
5
|
+
import { lockToAnimationFrames as oe, code as o } from "@spscommerce/utils";
|
|
6
|
+
import { SpsInputGroup as le, SpsCheckbox as ce, SpsDropdown as ie, SpsForm as de, SpsFocusedTask as ue, SpsTable as me, SpsTableHead as pe, SpsTableHeader as C, SpsTableBody as he, SpsTableRow as v, SpsTableCell as n } from "@spscommerce/ds-react";
|
|
7
|
+
import { useWoodlandLanguage as R } from "@spscommerce/i18n";
|
|
8
|
+
import { sprinkles as Se } from "@sps-woodland/tokens";
|
|
9
|
+
var fe = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc0", ve = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc1", be = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc2", _e = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc3", Be = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc4", ge = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc5", Te = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc6", Ee = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc7", Le = "pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc8";
|
|
10
|
+
function F({
|
|
11
|
+
results: t,
|
|
12
|
+
selections: a,
|
|
13
|
+
zeroStateText: r,
|
|
14
|
+
onClear: s,
|
|
15
|
+
className: l,
|
|
16
|
+
children: d,
|
|
17
|
+
...u
|
|
18
|
+
}) {
|
|
19
|
+
const { t: c } = R(), h = a ? Object.keys(a).reduce((m, p) => (a[p].length > 0 && (m[p] = a[p]), m), {}) : {};
|
|
20
|
+
return /* @__PURE__ */ e.createElement("div", { className: ve, ...u }, t != null && /* @__PURE__ */ e.createElement("div", { className: be }, /* @__PURE__ */ e.createElement("span", null, c("searchResultsBar.results", { defaultValue: "Results:" })), /* @__PURE__ */ e.createElement(k, { className: _e, kind: "info" }, /* @__PURE__ */ e.createElement("span", null, t))), /* @__PURE__ */ e.createElement("div", { className: Be }, Object.keys(h).length > 0 ? Object.keys(h).map((m, p) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("span", { key: p, className: ge }, m, ":"), h[m].map((B, g) => /* @__PURE__ */ e.createElement(k, { className: Te, key: g, kind: "key" }, /* @__PURE__ */ e.createElement("span", null, B))))) : /* @__PURE__ */ e.createElement("span", { className: "font-italic" }, r || c("searchResultsBar.noAdvancedSearchSelections", { defaultValue: "No Advanced Search Selections" }))), /* @__PURE__ */ e.createElement("div", { className: Ee }, /* @__PURE__ */ e.createElement(_, { className: Le, kind: "link", onClick: s }, c("searchResultsBar.clearResults", { defaultValue: "Clear Results" }))));
|
|
21
|
+
}
|
|
22
|
+
b.set(F, {
|
|
23
|
+
name: "Search Results Bar",
|
|
24
|
+
props: {
|
|
25
|
+
results: { type: "number | string | null" },
|
|
26
|
+
selections: { type: "{ [key: string]: string[] }" },
|
|
27
|
+
zeroStateText: { type: "string" },
|
|
28
|
+
onClear: { type: "() => void" }
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function we(t, a, r) {
|
|
32
|
+
return a in t ? Object.defineProperty(t, a, {
|
|
33
|
+
value: r,
|
|
34
|
+
enumerable: !0,
|
|
35
|
+
configurable: !0,
|
|
36
|
+
writable: !0
|
|
37
|
+
}) : t[a] = r, t;
|
|
38
|
+
}
|
|
39
|
+
function j(t, a) {
|
|
40
|
+
var r = Object.keys(t);
|
|
41
|
+
if (Object.getOwnPropertySymbols) {
|
|
42
|
+
var s = Object.getOwnPropertySymbols(t);
|
|
43
|
+
a && (s = s.filter(function(l) {
|
|
44
|
+
return Object.getOwnPropertyDescriptor(t, l).enumerable;
|
|
45
|
+
})), r.push.apply(r, s);
|
|
46
|
+
}
|
|
47
|
+
return r;
|
|
48
|
+
}
|
|
49
|
+
function U(t) {
|
|
50
|
+
for (var a = 1; a < arguments.length; a++) {
|
|
51
|
+
var r = arguments[a] != null ? arguments[a] : {};
|
|
52
|
+
a % 2 ? j(Object(r), !0).forEach(function(s) {
|
|
53
|
+
we(t, s, r[s]);
|
|
54
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)) : j(Object(r)).forEach(function(s) {
|
|
55
|
+
Object.defineProperty(t, s, Object.getOwnPropertyDescriptor(r, s));
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
}
|
|
60
|
+
var ye = (t, a, r) => {
|
|
61
|
+
for (var s of Object.keys(t)) {
|
|
62
|
+
var l;
|
|
63
|
+
if (t[s] !== ((l = a[s]) !== null && l !== void 0 ? l : r[s]))
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
return !0;
|
|
67
|
+
}, O = (t) => (a) => {
|
|
68
|
+
var r = t.defaultClassName, s = U(U({}, t.defaultVariants), a);
|
|
69
|
+
for (var l in s) {
|
|
70
|
+
var d, u = (d = s[l]) !== null && d !== void 0 ? d : t.defaultVariants[l];
|
|
71
|
+
if (u != null) {
|
|
72
|
+
var c = u;
|
|
73
|
+
typeof c == "boolean" && (c = c === !0 ? "true" : "false");
|
|
74
|
+
var h = (
|
|
75
|
+
// @ts-expect-error
|
|
76
|
+
t.variantClassNames[l][c]
|
|
77
|
+
);
|
|
78
|
+
h && (r += " " + h);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
for (var [m, p] of t.compoundVariants)
|
|
82
|
+
ye(m, s, t.defaultVariants) && (r += " " + p);
|
|
83
|
+
return r;
|
|
84
|
+
}, xe = O({ defaultClassName: "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p701", variantClassNames: { pinned: { true: "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p702", false: "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p703" } }, defaultVariants: { pinned: !1 }, compoundVariants: [] }), Ae = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p704", Ce = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p705", ke = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p706", Re = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p707", Fe = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p708", Oe = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p709", Me = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70a", K = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70b", Ie = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70c", Ve = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d", Ne = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70e", De = "pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70f";
|
|
85
|
+
function Pe({
|
|
86
|
+
children: t
|
|
87
|
+
}) {
|
|
88
|
+
const a = te(
|
|
89
|
+
t,
|
|
90
|
+
(r) => r.type === _ ? [
|
|
91
|
+
{
|
|
92
|
+
className: A(r.props.className, Ne)
|
|
93
|
+
}
|
|
94
|
+
] : []
|
|
95
|
+
);
|
|
96
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, a);
|
|
97
|
+
}
|
|
98
|
+
function M({
|
|
99
|
+
onSubmit: t,
|
|
100
|
+
children: a
|
|
101
|
+
}) {
|
|
102
|
+
function r(s) {
|
|
103
|
+
s.preventDefault(), t && t(s);
|
|
104
|
+
}
|
|
105
|
+
return /* @__PURE__ */ e.createElement("form", { onSubmit: r, className: Ie, noValidate: !0 }, /* @__PURE__ */ e.createElement(le, { className: Ve }, /* @__PURE__ */ e.createElement(Pe, null, a)));
|
|
106
|
+
}
|
|
107
|
+
b.set(M, {
|
|
108
|
+
name: "ListBarSearch",
|
|
109
|
+
props: {
|
|
110
|
+
onSubmit: { type: "FormEventHandler" }
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
function I({
|
|
114
|
+
children: t
|
|
115
|
+
}) {
|
|
116
|
+
return /* @__PURE__ */ e.createElement("div", null, t);
|
|
117
|
+
}
|
|
118
|
+
b.set(I, {
|
|
119
|
+
name: "ListBarSearchInfo"
|
|
120
|
+
});
|
|
121
|
+
function q({
|
|
122
|
+
advancedSearch: t,
|
|
123
|
+
onToggleAdvancedSearch: a,
|
|
124
|
+
title: r,
|
|
125
|
+
onToolbarPinned: s,
|
|
126
|
+
selectable: l,
|
|
127
|
+
isSelected: d,
|
|
128
|
+
isIndeterminate: u,
|
|
129
|
+
disableSelection: c = !1,
|
|
130
|
+
onSelectionChange: h,
|
|
131
|
+
pinResultsBar: m,
|
|
132
|
+
pinToolbar: p = !0,
|
|
133
|
+
advancedSearchToggleText: B,
|
|
134
|
+
children: g,
|
|
135
|
+
className: L,
|
|
136
|
+
...w
|
|
137
|
+
}) {
|
|
138
|
+
const { t: Y } = R();
|
|
139
|
+
let y = null;
|
|
140
|
+
const [S, V] = e.useState(!1), T = e.useRef(null), f = e.useRef(null), { "data-testid": N } = w, x = oe(() => {
|
|
141
|
+
if (T.current && p) {
|
|
142
|
+
const i = T.current.getBoundingClientRect();
|
|
143
|
+
if (!i)
|
|
144
|
+
return;
|
|
145
|
+
const X = Math.round(i.height), $ = Math.round(i.top), ee = Math.round(window.scrollY);
|
|
146
|
+
X > 0 && $ <= 60 && (typeof y == "number" ? ee <= y && (y = null, V(!1)) : (y = Math.round(window.scrollY), V(!0), a && a(!1)));
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
e.useEffect(() => (window.addEventListener("scroll", x), window.addEventListener("resize", x), () => {
|
|
150
|
+
window.removeEventListener("scroll", x), window.removeEventListener("resize", x);
|
|
151
|
+
}), []);
|
|
152
|
+
const E = e.useRef();
|
|
153
|
+
e.useLayoutEffect(() => {
|
|
154
|
+
if (f.current && T.current && p) {
|
|
155
|
+
if (S && E.current)
|
|
156
|
+
f.current.style.height = E.current.height, f.current.style.width = E.current.width, f.current.style.marginBottom = E.current.marginBottom;
|
|
157
|
+
else if (!S) {
|
|
158
|
+
f.current.style.height = "", f.current.style.width = "", f.current.style.marginBottom = "";
|
|
159
|
+
const i = window.getComputedStyle(T.current);
|
|
160
|
+
E.current = {
|
|
161
|
+
height: i.height,
|
|
162
|
+
width: i.width,
|
|
163
|
+
marginBottom: i.marginBottom
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}, [S]);
|
|
168
|
+
function z() {
|
|
169
|
+
a && a(!t?.isOpen);
|
|
170
|
+
}
|
|
171
|
+
function Z(i) {
|
|
172
|
+
s && s(i);
|
|
173
|
+
}
|
|
174
|
+
e.useEffect(() => {
|
|
175
|
+
Z(S);
|
|
176
|
+
}, [S]);
|
|
177
|
+
const [
|
|
178
|
+
D,
|
|
179
|
+
J,
|
|
180
|
+
Q,
|
|
181
|
+
[P],
|
|
182
|
+
G
|
|
183
|
+
] = ae(g, [
|
|
184
|
+
{ type: M },
|
|
185
|
+
{ type: I },
|
|
186
|
+
{ type: F },
|
|
187
|
+
{
|
|
188
|
+
custom: (i) => b.isWoodlandComponent(i) && b.get(i).name === "Tabs"
|
|
189
|
+
}
|
|
190
|
+
]);
|
|
191
|
+
return /* @__PURE__ */ e.createElement("div", { className: A(L), ref: f, ...w }, /* @__PURE__ */ e.createElement("div", { className: xe({ pinned: S }), ref: T }, P ? re(P, { context: "container" }) : /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("div", { className: Ae }, !!l && /* @__PURE__ */ e.createElement("div", { className: Ce }, /* @__PURE__ */ e.createElement(
|
|
192
|
+
ce,
|
|
193
|
+
{
|
|
194
|
+
checked: d,
|
|
195
|
+
disabled: c,
|
|
196
|
+
indeterminate: u,
|
|
197
|
+
onChange: () => {
|
|
198
|
+
h?.(!d);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
)), /* @__PURE__ */ e.createElement("div", { className: ke }, !r && D, !r && J, D.length > 0 && t && /* @__PURE__ */ e.createElement(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
className: Re,
|
|
205
|
+
"data-testid": `${N}__advanced-search`
|
|
206
|
+
},
|
|
207
|
+
/* @__PURE__ */ e.createElement("div", { className: Fe }, /* @__PURE__ */ e.createElement(_, { kind: "link", onClick: z }, B ?? Y("listToolbar.advancedSearchToggle", { defaultValue: "Advanced Search" }))),
|
|
208
|
+
(t.enteredFields || 0) > 0 && /* @__PURE__ */ e.createElement(k, { className: Oe, kind: "info", "data-testid": `${N}__entered-fields` }, /* @__PURE__ */ e.createElement("span", null, t.enteredFields))
|
|
209
|
+
), r && /* @__PURE__ */ e.createElement("div", { className: Me }, r)), S ? /* @__PURE__ */ e.createElement("div", { className: K }, /* @__PURE__ */ e.createElement(se.Provider, { value: { fixed: !0 } }, G)) : /* @__PURE__ */ e.createElement("div", { className: K }, G)), /* @__PURE__ */ e.createElement("div", { className: fe }, (!S || m) && Q))));
|
|
210
|
+
}
|
|
211
|
+
b.set(q, {
|
|
212
|
+
name: "ListBar",
|
|
213
|
+
props: {
|
|
214
|
+
activeTab: { type: "Tab" },
|
|
215
|
+
advancedSearch: { type: "{ isOpen: boolean, enteredFields: number }" },
|
|
216
|
+
onToggleAdvancedSearch: { type: "(boolean) => void" },
|
|
217
|
+
title: { type: "string" },
|
|
218
|
+
onToolbarPinned: { type: "(boolean) => void" },
|
|
219
|
+
selectable: { type: "boolean" },
|
|
220
|
+
disableSelection: { type: "boolean", default: "false" },
|
|
221
|
+
isSelected: { type: "boolean" },
|
|
222
|
+
isIndeterminate: { type: "boolean" },
|
|
223
|
+
onSelectionChange: { type: "(boolean) => void" },
|
|
224
|
+
pinResultsBar: { type: "boolean" },
|
|
225
|
+
pinToolbar: { type: "boolean", default: "true" },
|
|
226
|
+
advancedSearchToggleText: { type: "string" }
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
function H({
|
|
230
|
+
options: t,
|
|
231
|
+
activeOption: a,
|
|
232
|
+
onSortChange: r,
|
|
233
|
+
defaultOption: s,
|
|
234
|
+
className: l,
|
|
235
|
+
...d
|
|
236
|
+
}) {
|
|
237
|
+
const u = (t || []).map((c) => [
|
|
238
|
+
{ label: c.label, icon: c.icon },
|
|
239
|
+
() => {
|
|
240
|
+
r && r(c);
|
|
241
|
+
}
|
|
242
|
+
]);
|
|
243
|
+
return /* @__PURE__ */ e.createElement(
|
|
244
|
+
ie,
|
|
245
|
+
{
|
|
246
|
+
className: A(l, De),
|
|
247
|
+
icon: a?.icon || s?.icon,
|
|
248
|
+
label: a?.label || s?.label,
|
|
249
|
+
options: u
|
|
250
|
+
}
|
|
251
|
+
);
|
|
252
|
+
}
|
|
253
|
+
b.set(H, {
|
|
254
|
+
name: "ListBarSortBy",
|
|
255
|
+
props: {
|
|
256
|
+
options: { type: "SortOption[]" },
|
|
257
|
+
activeOption: { type: "SortOption" },
|
|
258
|
+
onSortChange: { type: "(option: SortOption) => void" },
|
|
259
|
+
defaultOption: { type: "SortOption" }
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
var Ge = O({ defaultClassName: "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj410", variantClassNames: { open: { true: "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj411", false: "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj412" }, compact: { true: "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj413", false: "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj414" } }, defaultVariants: { open: !1, compact: !1 }, compoundVariants: [] }), je = O({ defaultClassName: "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj415", variantClassNames: { open: { true: "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj416", false: "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj417" } }, defaultVariants: { open: !0 }, compoundVariants: [] }), Ue = "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj418", Ke = "pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj419";
|
|
263
|
+
function W({
|
|
264
|
+
formArray: t,
|
|
265
|
+
formGroup: a,
|
|
266
|
+
formMeta: r,
|
|
267
|
+
onSubmit: s,
|
|
268
|
+
controlsDisabled: l,
|
|
269
|
+
footerLinks: d,
|
|
270
|
+
isOpen: u,
|
|
271
|
+
onClear: c,
|
|
272
|
+
submitButtonText: h,
|
|
273
|
+
compact: m,
|
|
274
|
+
className: p,
|
|
275
|
+
children: B,
|
|
276
|
+
...g
|
|
277
|
+
}) {
|
|
278
|
+
const { t: L } = R();
|
|
279
|
+
function w() {
|
|
280
|
+
c && c();
|
|
281
|
+
}
|
|
282
|
+
return /* @__PURE__ */ e.createElement("div", { className: A(Ge({ open: u, compact: m })), ...g }, /* @__PURE__ */ e.createElement(de, { onSubmit: s, formArray: t, formGroup: a, formMeta: r }, /* @__PURE__ */ e.createElement("div", { className: je({ open: u }) }, B), /* @__PURE__ */ e.createElement("div", { className: Ue }, d && /* @__PURE__ */ e.createElement("div", { id: "footer_links" }, ne(d)), /* @__PURE__ */ e.createElement("div", { className: Ke }, /* @__PURE__ */ e.createElement(
|
|
283
|
+
_,
|
|
284
|
+
{
|
|
285
|
+
kind: "default",
|
|
286
|
+
type: "button",
|
|
287
|
+
className: Se({ mr: "sm" }),
|
|
288
|
+
onClick: w,
|
|
289
|
+
disabled: l
|
|
290
|
+
},
|
|
291
|
+
L("advancedSearch.clear", { defaultValue: "Clear Fields" })
|
|
292
|
+
), /* @__PURE__ */ e.createElement(_, { kind: "key", type: "submit", disabled: l }, h ?? L("advancedSearch.search", { defaultValue: "Search" }))))));
|
|
293
|
+
}
|
|
294
|
+
b.set(W, {
|
|
295
|
+
name: "Advanced Search",
|
|
296
|
+
props: {
|
|
297
|
+
formArray: { type: "SpsFormArray<any>" },
|
|
298
|
+
formGroup: { type: "SpsFormGroup" },
|
|
299
|
+
formMeta: { type: "SpsFormSetMeta<any>" },
|
|
300
|
+
onSubmit: { type: "React.FormEventHandler" },
|
|
301
|
+
controlsDisabled: { type: "boolean" },
|
|
302
|
+
footerLinks: { type: "React.ReactNode | (() => React.ReactNode)" },
|
|
303
|
+
isOpen: { type: "boolean" },
|
|
304
|
+
onClear: { type: "() => void" },
|
|
305
|
+
submitButtonText: { type: "string" },
|
|
306
|
+
compact: { type: "boolean" }
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
const qe = {
|
|
310
|
+
components: [W],
|
|
11
311
|
examples: {
|
|
12
312
|
general: {
|
|
13
313
|
label: "General Usage",
|
|
14
|
-
description: ({ NavigateTo: t, Link:
|
|
314
|
+
description: ({ NavigateTo: t, Link: a }) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, 'Advanced Search is comprised of a panel of input fields, and a text button that exposes and hides the panel. By default, the Advanced Search panel is hidden (with the exception of "Advanced Search Only" scenarios).'), /* @__PURE__ */ e.createElement("p", null, "Advanced Search works in conjunction with the", " ", /* @__PURE__ */ e.createElement(t, { to: "list-toolbar" }, "List Bar"), " and", " ", /* @__PURE__ */ e.createElement(t, { to: "search-results-bar" }, "Search Results"), " components. Refer to those pages for additional details."), /* @__PURE__ */ e.createElement("p", null, "Use the following guidelines when including Advanced Search on your page:", /* @__PURE__ */ e.createElement("ul", null, /* @__PURE__ */ e.createElement("li", null, "The Advanced Search Panel can contain any number of input fields."), /* @__PURE__ */ e.createElement("li", null, "The Advanced Search Panel can place input fields in any unique layout to best serve the needs of the search criteria, but must adhere to the rules of the", " ", /* @__PURE__ */ e.createElement(a, { to: "/style-and-layout/grid/" }, "SPS Grid"), " and guidelines for", " ", /* @__PURE__ */ e.createElement(t, { to: "form" }, "Form Layouts"), "."))))
|
|
15
315
|
},
|
|
16
316
|
basic: {
|
|
17
317
|
label: "Basic Usage",
|
|
18
318
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "A Basic Advanced Search consists of the List Bar with a search input and an Advanced Search text button. For more details on additional button and component options in the List Bar reference the ", /* @__PURE__ */ e.createElement(t, { to: "list-toolbar" }, "List Bar"), " page.")),
|
|
19
319
|
examples: {
|
|
20
320
|
basic: {
|
|
21
|
-
react:
|
|
321
|
+
react: o`
|
|
22
322
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
23
323
|
import { Button } from "@sps-woodland/buttons";
|
|
24
324
|
import { grid } from "@sps-woodland/tokens";
|
|
@@ -127,7 +427,7 @@ const T = {
|
|
|
127
427
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "A Footer Link can be included in the Advanced Search footer (visible only when the menu is exposed). The Footer Link is used to link to preferences that control the Advanced Search panel display (such as customized fields and defaults).")),
|
|
128
428
|
examples: {
|
|
129
429
|
footerLink: {
|
|
130
|
-
react:
|
|
430
|
+
react: o`
|
|
131
431
|
import { ListBar, ListBarSearch, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
132
432
|
import { Button } from "@sps-woodland/buttons";
|
|
133
433
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -188,7 +488,7 @@ const T = {
|
|
|
188
488
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "The Search and Clear Fields buttons in the footer can be disabled when no input fields in the Advanced Search Panel contain values.")),
|
|
189
489
|
examples: {
|
|
190
490
|
disabledButtons: {
|
|
191
|
-
react:
|
|
491
|
+
react: o`
|
|
192
492
|
import { ListBar, ListBarSearch, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
193
493
|
import { Button } from "@sps-woodland/buttons";
|
|
194
494
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -243,7 +543,7 @@ const T = {
|
|
|
243
543
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "Certain scenarios may require an Advanced Search Panel to display by default (eschewing a basic search). In these scenarios a title will replace the search input in the List Bar."), /* @__PURE__ */ e.createElement("p", null, "To achieve an Advanced Search Only effect, remove the basic search input from the List Bar.")),
|
|
244
544
|
examples: {
|
|
245
545
|
withTitle: {
|
|
246
|
-
react:
|
|
546
|
+
react: o`
|
|
247
547
|
import { ListBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
248
548
|
|
|
249
549
|
function Component() {
|
|
@@ -269,26 +569,26 @@ const T = {
|
|
|
269
569
|
}
|
|
270
570
|
}
|
|
271
571
|
};
|
|
272
|
-
function
|
|
273
|
-
const [t,
|
|
274
|
-
function
|
|
275
|
-
|
|
572
|
+
function He() {
|
|
573
|
+
const [t, a] = e.useState(!1);
|
|
574
|
+
function r() {
|
|
575
|
+
a(!1);
|
|
276
576
|
}
|
|
277
|
-
function
|
|
278
|
-
|
|
577
|
+
function s() {
|
|
578
|
+
a(!0);
|
|
279
579
|
}
|
|
280
|
-
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "The List Bar is divided into a number of different sections. It spans the entire width of the corresponding list."), /* @__PURE__ */ e.createElement(
|
|
580
|
+
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "The List Bar is divided into a number of different sections. It spans the entire width of the corresponding list."), /* @__PURE__ */ e.createElement(_, { kind: "link", onClick: s }, "View Content Order Example"), /* @__PURE__ */ e.createElement(ue, { isOpen: t, onClose: r }, /* @__PURE__ */ e.createElement("h1", null, "Content Order"), /* @__PURE__ */ e.createElement(
|
|
281
581
|
"img",
|
|
282
582
|
{
|
|
283
583
|
src: "assets/images/list-toolbar-example.svg",
|
|
284
584
|
alt: "A List Toolbar with labels on each section",
|
|
285
585
|
className: "w-100 mb-3"
|
|
286
586
|
}
|
|
287
|
-
), /* @__PURE__ */ e.createElement(
|
|
587
|
+
), /* @__PURE__ */ e.createElement(me, null, /* @__PURE__ */ e.createElement(pe, null, /* @__PURE__ */ e.createElement(C, { style: { width: "80px" } }, "Order"), /* @__PURE__ */ e.createElement(C, null, "Section"), /* @__PURE__ */ e.createElement(C, null, "Notes")), /* @__PURE__ */ e.createElement(he, null, /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement(n, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "1")), /* @__PURE__ */ e.createElement(n, null, "Checkbox"), /* @__PURE__ */ e.createElement(n, null, "For Content Rows and Content Tiles only.")), /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement(n, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "2")), /* @__PURE__ */ e.createElement(n, null, "Search/Filter Box"), /* @__PURE__ */ e.createElement(n, null)), /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement(n, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "3")), /* @__PURE__ */ e.createElement(n, null, "Saved Search"), /* @__PURE__ */ e.createElement(n, null)), /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement(n, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "4")), /* @__PURE__ */ e.createElement(n, null, "Advanced Search"), /* @__PURE__ */ e.createElement(n, null, "For more information, visit the Advanced Search page.")), /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement(n, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "5")), /* @__PURE__ */ e.createElement(n, null, "Column Editor"), /* @__PURE__ */ e.createElement(n, { wrap: 500 }, "Use for Tables only. For more information, visit the Column Editor page.")), /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement(n, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "6")), /* @__PURE__ */ e.createElement(n, null, "List View Selector"), /* @__PURE__ */ e.createElement(n, null)), /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement(n, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "7")), /* @__PURE__ */ e.createElement(n, null, "Sorting"), /* @__PURE__ */ e.createElement(n, null)), /* @__PURE__ */ e.createElement(v, null, /* @__PURE__ */ e.createElement(n, null, /* @__PURE__ */ e.createElement("span", { className: "sps-tag sps-tag--info" }, "8")), /* @__PURE__ */ e.createElement(n, null, "Buttons"), /* @__PURE__ */ e.createElement(n, { wrap: 500 }, "Buttons always appear in the rightmost section of the List Toolbar. For the ordering of Buttons, refer to the Button Groups section on the Buttons page."))))));
|
|
288
588
|
}
|
|
289
|
-
const
|
|
589
|
+
const We = {
|
|
290
590
|
description: () => /* @__PURE__ */ e.createElement("p", null, "The List Toolbar provides the ability to interact with elements in a list or table. It can contain elements to search, filter, sort, or perform other actions."),
|
|
291
|
-
components: [
|
|
591
|
+
components: [q, M, I, H],
|
|
292
592
|
examples: {
|
|
293
593
|
general: {
|
|
294
594
|
label: "General Usage",
|
|
@@ -296,14 +596,14 @@ const g = {
|
|
|
296
596
|
},
|
|
297
597
|
contentOrder: {
|
|
298
598
|
label: "Content Order",
|
|
299
|
-
description: /* @__PURE__ */ e.createElement(
|
|
599
|
+
description: /* @__PURE__ */ e.createElement(He, null)
|
|
300
600
|
},
|
|
301
601
|
checkbox: {
|
|
302
602
|
label: "Checkbox",
|
|
303
603
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement("p", null, "Use a Checkbox in the List Bar when items in a", " ", /* @__PURE__ */ e.createElement(t, { to: "content-row" }, "Content Row"), " or", " ", /* @__PURE__ */ e.createElement(t, { to: "content-tile" }, "Content Tile"), " are selectable. The Checkbox selects all items in the list, and will cause the Action Bar to appear. Do not use this with a Table, as Tables have a built-in checkbox in the header row."),
|
|
304
604
|
examples: {
|
|
305
605
|
basic: {
|
|
306
|
-
react:
|
|
606
|
+
react: o`
|
|
307
607
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
308
608
|
|
|
309
609
|
function Component() {
|
|
@@ -373,7 +673,7 @@ const g = {
|
|
|
373
673
|
examples: {
|
|
374
674
|
search: {
|
|
375
675
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h5", null, "Search"), /* @__PURE__ */ e.createElement("p", null, "Use Search to find list item(s) starting from an empty list.")),
|
|
376
|
-
react:
|
|
676
|
+
react: o`
|
|
377
677
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
378
678
|
import { Button } from "@sps-woodland/buttons";
|
|
379
679
|
|
|
@@ -403,7 +703,7 @@ const g = {
|
|
|
403
703
|
},
|
|
404
704
|
searchAndSelect: {
|
|
405
705
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h5", null, "Search + Select"), /* @__PURE__ */ e.createElement("p", null, "Use Select to search for list item(s) in a particular category.")),
|
|
406
|
-
react:
|
|
706
|
+
react: o`
|
|
407
707
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
408
708
|
import { Button } from "@sps-woodland/buttons";
|
|
409
709
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -443,7 +743,7 @@ const g = {
|
|
|
443
743
|
},
|
|
444
744
|
multiValue: {
|
|
445
745
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h5", null, "Search + Select"), /* @__PURE__ */ e.createElement("p", null, "Search + Select with a Multi-Value Text Input")),
|
|
446
|
-
react:
|
|
746
|
+
react: o`
|
|
447
747
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
448
748
|
import { Button } from "@sps-woodland/buttons";
|
|
449
749
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -484,7 +784,7 @@ const g = {
|
|
|
484
784
|
},
|
|
485
785
|
filter: {
|
|
486
786
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h5", null, "Filter"), /* @__PURE__ */ e.createElement("p", null, "Use Filter to find list item(s) starting from a populated list.")),
|
|
487
|
-
react:
|
|
787
|
+
react: o`
|
|
488
788
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
489
789
|
import { Button } from "@sps-woodland/buttons";
|
|
490
790
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -515,7 +815,7 @@ const g = {
|
|
|
515
815
|
},
|
|
516
816
|
filterAndSelect: {
|
|
517
817
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h5", null, "Filter + Select"), /* @__PURE__ */ e.createElement("p", null, "Use Select to filter list item(s) in a particular category.")),
|
|
518
|
-
react:
|
|
818
|
+
react: o`
|
|
519
819
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
520
820
|
import { Button } from "@sps-woodland/buttons";
|
|
521
821
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -555,7 +855,7 @@ const g = {
|
|
|
555
855
|
},
|
|
556
856
|
searchInfo: {
|
|
557
857
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h5", null, "Search Info"), /* @__PURE__ */ e.createElement("p", null, "Use SpsListToolbarSearchInfo component to add additional information about your search.")),
|
|
558
|
-
react:
|
|
858
|
+
react: o`
|
|
559
859
|
import { ListBar, ListBarSearch, ListBarSearchInfo } from "@sps-woodland/list-bar";
|
|
560
860
|
import { Icon } from "@sps-woodland/core";
|
|
561
861
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -661,7 +961,7 @@ const g = {
|
|
|
661
961
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement("p", null, "Include the Advanced Search feature when more complex options are required to narrow down search results. For more information, visit the", " ", /* @__PURE__ */ e.createElement(t, { to: "advanced-search" }, "Advanced Search"), " page."),
|
|
662
962
|
examples: {
|
|
663
963
|
advancedSearch: {
|
|
664
|
-
react:
|
|
964
|
+
react: o`
|
|
665
965
|
import { ListBar, ListBarSearch, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
666
966
|
import { Button } from "@sps-woodland/buttons";
|
|
667
967
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -705,7 +1005,7 @@ const g = {
|
|
|
705
1005
|
},
|
|
706
1006
|
withResultsBar: {
|
|
707
1007
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement("p", null, "You can include ", /* @__PURE__ */ e.createElement(t, { to: "search-results-bar" }, "Search Results Bar"), "."),
|
|
708
|
-
react:
|
|
1008
|
+
react: o`
|
|
709
1009
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
710
1010
|
import { Button } from "@sps-woodland/buttons";
|
|
711
1011
|
import { SpsTextInput, SpsLabel, SpsMultiselect } from "@spscommerce/ds-react";
|
|
@@ -821,7 +1121,7 @@ const g = {
|
|
|
821
1121
|
},
|
|
822
1122
|
pinnedResultsBar: {
|
|
823
1123
|
description: () => /* @__PURE__ */ e.createElement("p", null, "You can pin the Results Bar by passing pinResultsBar prop to SpsListToolbar."),
|
|
824
|
-
react:
|
|
1124
|
+
react: o`
|
|
825
1125
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
826
1126
|
import { Button } from "@sps-woodland/buttons";
|
|
827
1127
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -896,7 +1196,7 @@ const g = {
|
|
|
896
1196
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement("p", null, "Use a Column Editor when tables require the ability to show or hide specific columns based on the user's preferences. The Column Editor should only be used for", " ", /* @__PURE__ */ e.createElement(t, { to: "tables" }, "Tables"), ", and not any other type of list view. For more information, visit the ", /* @__PURE__ */ e.createElement(t, { to: "column-chooser" }, "Column Editor"), " page."),
|
|
897
1197
|
examples: {
|
|
898
1198
|
columnEditor: {
|
|
899
|
-
react:
|
|
1199
|
+
react: o`
|
|
900
1200
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
901
1201
|
import { Button } from "@sps-woodland/buttons";
|
|
902
1202
|
|
|
@@ -1050,7 +1350,7 @@ const g = {
|
|
|
1050
1350
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement("p", null, "Use Buttons only for actions that do not affect existing list items, such as exporting the list or creating a new list item. For actions that are taken on list items, such as changing a status of a list item, refer to the", " ", /* @__PURE__ */ e.createElement(t, { to: "list-action-bar" }, "List Action Bar"), "."),
|
|
1051
1351
|
examples: {
|
|
1052
1352
|
buttons: {
|
|
1053
|
-
react:
|
|
1353
|
+
react: o`
|
|
1054
1354
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
1055
1355
|
import { Button } from "@sps-woodland/buttons";
|
|
1056
1356
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -1090,7 +1390,7 @@ const g = {
|
|
|
1090
1390
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "When tabs are included, they appear above the List Toolbar. Tab rules are outlined on the ", /* @__PURE__ */ e.createElement(t, { to: "cards" }, "Cards"), " page."), /* @__PURE__ */ e.createElement("p", null, /* @__PURE__ */ e.createElement("code", null, "<Item>"), " comes from the ", /* @__PURE__ */ e.createElement("code", null, "@react-stately/collections"), "package, which is a peer dependency of our React components.")),
|
|
1091
1391
|
examples: {
|
|
1092
1392
|
tabs: {
|
|
1093
|
-
react:
|
|
1393
|
+
react: o`
|
|
1094
1394
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
1095
1395
|
import { Button } from "@sps-woodland/buttons";
|
|
1096
1396
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -1146,7 +1446,7 @@ const g = {
|
|
|
1146
1446
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement("p", null, "Use Titles when there is no Search or Filter input required for the list items, such as when the only search options are in an Advanced Search panel. For more information, visit the ", /* @__PURE__ */ e.createElement(t, { to: "advanced-search" }, "Advanced Search"), " page."),
|
|
1147
1447
|
examples: {
|
|
1148
1448
|
title: {
|
|
1149
|
-
react:
|
|
1449
|
+
react: o`
|
|
1150
1450
|
import { ListBar } from "@sps-woodland/list-bar";
|
|
1151
1451
|
import { Button } from "@sps-woodland/buttons";
|
|
1152
1452
|
|
|
@@ -1166,7 +1466,7 @@ const g = {
|
|
|
1166
1466
|
description: () => /* @__PURE__ */ e.createElement("p", null, "Use Sort By component to sort list of rows. It looks like SpsDropdown but with sorting interface."),
|
|
1167
1467
|
examples: {
|
|
1168
1468
|
basic: {
|
|
1169
|
-
react:
|
|
1469
|
+
react: o`
|
|
1170
1470
|
import { ListBar, ListBarSortBy } from "@sps-woodland/list-bar";
|
|
1171
1471
|
import { Button } from "@sps-woodland/buttons";
|
|
1172
1472
|
import { VerticalRule } from "@sps-woodland/core";
|
|
@@ -1227,15 +1527,15 @@ const g = {
|
|
|
1227
1527
|
}
|
|
1228
1528
|
}
|
|
1229
1529
|
}
|
|
1230
|
-
},
|
|
1231
|
-
components: [
|
|
1530
|
+
}, Ye = {
|
|
1531
|
+
components: [F],
|
|
1232
1532
|
examples: {
|
|
1233
1533
|
basic: {
|
|
1234
1534
|
label: "Basic",
|
|
1235
1535
|
description: ({ NavigateTo: t }) => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("p", null, "The SearchResultsBar should be used with List Bar and Advanced Search."), /* @__PURE__ */ e.createElement("p", null, "For more examples go to the Advanced Search section on the", " ", /* @__PURE__ */ e.createElement(t, { to: "list-bar" }, "List Bar"), " page.")),
|
|
1236
1536
|
examples: {
|
|
1237
1537
|
basic: {
|
|
1238
|
-
react:
|
|
1538
|
+
react: o`
|
|
1239
1539
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
1240
1540
|
import { Button } from "@sps-woodland/buttons";
|
|
1241
1541
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -1307,7 +1607,7 @@ const g = {
|
|
|
1307
1607
|
},
|
|
1308
1608
|
situational: {
|
|
1309
1609
|
description: () => /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("h4", null, "Unknown Results Count"), /* @__PURE__ */ e.createElement("p", null, "In cases where the exact count of results is not able to be determined, Results section won't be displayed.")),
|
|
1310
|
-
react:
|
|
1610
|
+
react: o`
|
|
1311
1611
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
1312
1612
|
import { Button } from "@sps-woodland/buttons";
|
|
1313
1613
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -1379,7 +1679,7 @@ const g = {
|
|
|
1379
1679
|
description: () => /* @__PURE__ */ e.createElement("p", null, "You can pass in custom text to be displayed when there are no selections."),
|
|
1380
1680
|
examples: {
|
|
1381
1681
|
customText: {
|
|
1382
|
-
react:
|
|
1682
|
+
react: o`
|
|
1383
1683
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
1384
1684
|
import { Button } from "@sps-woodland/buttons";
|
|
1385
1685
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -1453,11 +1753,18 @@ const g = {
|
|
|
1453
1753
|
}
|
|
1454
1754
|
}
|
|
1455
1755
|
}
|
|
1456
|
-
},
|
|
1457
|
-
"Advanced Search":
|
|
1458
|
-
"List Bar":
|
|
1459
|
-
"Search Results Bar":
|
|
1756
|
+
}, tt = {
|
|
1757
|
+
"Advanced Search": qe,
|
|
1758
|
+
"List Bar": We,
|
|
1759
|
+
"Search Results Bar": Ye
|
|
1460
1760
|
};
|
|
1461
1761
|
export {
|
|
1462
|
-
|
|
1762
|
+
W as AdvancedSearch,
|
|
1763
|
+
Pe as InputGroupWrapper,
|
|
1764
|
+
q as ListBar,
|
|
1765
|
+
M as ListBarSearch,
|
|
1766
|
+
I as ListBarSearchInfo,
|
|
1767
|
+
H as ListBarSortBy,
|
|
1768
|
+
tt as MANIFEST,
|
|
1769
|
+
F as SearchResultsBar
|
|
1463
1770
|
};
|
package/lib/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(n,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@sps-woodland/core/list-bar"),require("react"),require("@spscommerce/utils"),require("@sps-woodland/core/advanced-search"),require("@sps-woodland/core/button"),require("@spscommerce/ds-react"),require("@sps-woodland/core/search-results-bar")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core/list-bar","react","@spscommerce/utils","@sps-woodland/core/advanced-search","@sps-woodland/core/button","@spscommerce/ds-react","@sps-woodland/core/search-results-bar"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.ListBar={},n.listBar,n.React,n.utils,n.advancedSearch,n.button,n.dsReact,n.searchResultsBar))})(this,(function(n,o,i,r,d,u,t,m){"use strict";function h(a){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const l in a)if(l!=="default"){const c=Object.getOwnPropertyDescriptor(a,l);Object.defineProperty(s,l,c.get?c:{enumerable:!0,get:()=>a[l]})}}return s.default=a,Object.freeze(s)}const e=h(i),p={components:[d.AdvancedSearch],examples:{general:{label:"General Usage",description:({NavigateTo:a,Link:s})=>e.createElement(e.Fragment,null,e.createElement("p",null,'Advanced Search is comprised of a panel of input fields, and a text button that exposes and hides the panel. By default, the Advanced Search panel is hidden (with the exception of "Advanced Search Only" scenarios).'),e.createElement("p",null,"Advanced Search works in conjunction with the"," ",e.createElement(a,{to:"list-toolbar"},"List Bar")," and"," ",e.createElement(a,{to:"search-results-bar"},"Search Results")," components. Refer to those pages for additional details."),e.createElement("p",null,"Use the following guidelines when including Advanced Search on your page:",e.createElement("ul",null,e.createElement("li",null,"The Advanced Search Panel can contain any number of input fields."),e.createElement("li",null,"The Advanced Search Panel can place input fields in any unique layout to best serve the needs of the search criteria, but must adhere to the rules of the"," ",e.createElement(s,{to:"/style-and-layout/grid/"},"SPS Grid")," and guidelines for"," ",e.createElement(a,{to:"form"},"Form Layouts"),"."))))},basic:{label:"Basic Usage",description:({NavigateTo:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"A Basic Advanced Search consists of the List Bar with a search input and an Advanced Search text button. For more details on additional button and component options in the List Bar reference the ",e.createElement(a,{to:"list-toolbar"},"List Bar")," page.")),examples:{basic:{react:r.code`
|
|
1
|
+
(function(l,B){typeof exports=="object"&&typeof module<"u"?B(exports,require("react"),require("@sps-woodland/core"),require("@sps-woodland/buttons"),require("@sps-woodland/tags"),require("@spscommerce/utils"),require("@spscommerce/ds-react"),require("@spscommerce/i18n"),require("@sps-woodland/tokens")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@sps-woodland/buttons","@sps-woodland/tags","@spscommerce/utils","@spscommerce/ds-react","@spscommerce/i18n","@sps-woodland/tokens"],B):(l=typeof globalThis<"u"?globalThis:l||self,B(l.ListBar={},l.React,l.core,l.buttons,l.tags,l.utils,l.dsReact,l.i18n,l.tokens))})(this,(function(l,B,c,_,M,o,a,O,Y){"use strict";function z(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,s.get?s:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const e=z(B);var Z="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc0",J="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc1",Q="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc2",X="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc3",$="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc4",ee="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc5",te="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc6",ae="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc7",re="pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc8";function w({results:t,selections:r,zeroStateText:n,onClear:s,className:i,children:p,...m}){const{t:d}=O.useWoodlandLanguage(),f=r?Object.keys(r).reduce((h,S)=>(r[S].length>0&&(h[S]=r[S]),h),{}):{};return e.createElement("div",{className:J,...m},t!=null&&e.createElement("div",{className:Q},e.createElement("span",null,d("searchResultsBar.results",{defaultValue:"Results:"})),e.createElement(M.Tag,{className:X,kind:"info"},e.createElement("span",null,t))),e.createElement("div",{className:$},Object.keys(f).length>0?Object.keys(f).map((h,S)=>e.createElement(e.Fragment,null,e.createElement("span",{key:S,className:ee},h,":"),f[h].map((g,T)=>e.createElement(M.Tag,{className:te,key:T,kind:"key"},e.createElement("span",null,g))))):e.createElement("span",{className:"font-italic"},n||d("searchResultsBar.noAdvancedSearchSelections",{defaultValue:"No Advanced Search Selections"}))),e.createElement("div",{className:ae},e.createElement(_.Button,{className:re,kind:"link",onClick:s},d("searchResultsBar.clearResults",{defaultValue:"Clear Results"}))))}c.Metadata.set(w,{name:"Search Results Bar",props:{results:{type:"number | string | null"},selections:{type:"{ [key: string]: string[] }"},zeroStateText:{type:"string"},onClear:{type:"() => void"}}});function ne(t,r,n){return r in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t}function D(t,r){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);r&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,s)}return n}function P(t){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?D(Object(n),!0).forEach(function(s){ne(t,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):D(Object(n)).forEach(function(s){Object.defineProperty(t,s,Object.getOwnPropertyDescriptor(n,s))})}return t}var se=(t,r,n)=>{for(var s of Object.keys(t)){var i;if(t[s]!==((i=r[s])!==null&&i!==void 0?i:n[s]))return!1}return!0},I=t=>r=>{var n=t.defaultClassName,s=P(P({},t.defaultVariants),r);for(var i in s){var p,m=(p=s[i])!==null&&p!==void 0?p:t.defaultVariants[i];if(m!=null){var d=m;typeof d=="boolean"&&(d=d===!0?"true":"false");var f=t.variantClassNames[i][d];f&&(n+=" "+f)}}for(var[h,S]of t.compoundVariants)se(h,s,t.defaultVariants)&&(n+=" "+S);return n},oe=I({defaultClassName:"pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p701",variantClassNames:{pinned:{true:"pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p702",false:"pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p703"}},defaultVariants:{pinned:!1},compoundVariants:[]}),le="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p704",ce="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p705",ie="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p706",de="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p707",ue="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p708",pe="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p709",me="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70a",j="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70b",he="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70c",Se="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d",fe="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70e",ve="pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70f";function G({children:t}){const r=c.modChildren(t,n=>n.type===_.Button?[{className:c.cl(n.props.className,fe)}]:[]);return e.createElement(e.Fragment,null,r)}function y({onSubmit:t,children:r}){function n(s){s.preventDefault(),t&&t(s)}return e.createElement("form",{onSubmit:n,className:he,noValidate:!0},e.createElement(a.SpsInputGroup,{className:Se},e.createElement(G,null,r)))}c.Metadata.set(y,{name:"ListBarSearch",props:{onSubmit:{type:"FormEventHandler"}}});function C({children:t}){return e.createElement("div",null,t)}c.Metadata.set(C,{name:"ListBarSearchInfo"});function V({advancedSearch:t,onToggleAdvancedSearch:r,title:n,onToolbarPinned:s,selectable:i,isSelected:p,isIndeterminate:m,disableSelection:d=!1,onSelectionChange:f,pinResultsBar:h,pinToolbar:S=!0,advancedSearchToggleText:g,children:T,className:A,...x}){const{t:Ce}=O.useWoodlandLanguage();let k=null;const[v,q]=e.useState(!1),E=e.useRef(null),b=e.useRef(null),{"data-testid":U}=x,F=o.lockToAnimationFrames(()=>{if(E.current&&S){const u=E.current.getBoundingClientRect();if(!u)return;const Me=Math.round(u.height),Oe=Math.round(u.top),Ie=Math.round(window.scrollY);Me>0&&Oe<=60&&(typeof k=="number"?Ie<=k&&(k=null,q(!1)):(k=Math.round(window.scrollY),q(!0),r&&r(!1)))}});e.useEffect(()=>(window.addEventListener("scroll",F),window.addEventListener("resize",F),()=>{window.removeEventListener("scroll",F),window.removeEventListener("resize",F)}),[]);const L=e.useRef();e.useLayoutEffect(()=>{if(b.current&&E.current&&S){if(v&&L.current)b.current.style.height=L.current.height,b.current.style.width=L.current.width,b.current.style.marginBottom=L.current.marginBottom;else if(!v){b.current.style.height="",b.current.style.width="",b.current.style.marginBottom="";const u=window.getComputedStyle(E.current);L.current={height:u.height,width:u.width,marginBottom:u.marginBottom}}}},[v]);function Ae(){r&&r(!t?.isOpen)}function xe(u){s&&s(u)}e.useEffect(()=>{xe(v)},[v]);const[K,ke,Fe,[H],W]=c.selectChildren(T,[{type:y},{type:C},{type:w},{custom:u=>c.Metadata.isWoodlandComponent(u)&&c.Metadata.get(u).name==="Tabs"}]);return e.createElement("div",{className:c.cl(A),ref:b,...x},e.createElement("div",{className:oe({pinned:v}),ref:E},H?c.addProps(H,{context:"container"}):e.createElement(e.Fragment,null,e.createElement("div",{className:le},!!i&&e.createElement("div",{className:ce},e.createElement(a.SpsCheckbox,{checked:p,disabled:d,indeterminate:m,onChange:()=>{f?.(!p)}})),e.createElement("div",{className:ie},!n&&K,!n&&ke,K.length>0&&t&&e.createElement("div",{className:de,"data-testid":`${U}__advanced-search`},e.createElement("div",{className:ue},e.createElement(_.Button,{kind:"link",onClick:Ae},g??Ce("listToolbar.advancedSearchToggle",{defaultValue:"Advanced Search"}))),(t.enteredFields||0)>0&&e.createElement(M.Tag,{className:pe,kind:"info","data-testid":`${U}__entered-fields`},e.createElement("span",null,t.enteredFields))),n&&e.createElement("div",{className:me},n)),v?e.createElement("div",{className:j},e.createElement(c.PortalContext.Provider,{value:{fixed:!0}},W)):e.createElement("div",{className:j},W)),e.createElement("div",{className:Z},(!v||h)&&Fe))))}c.Metadata.set(V,{name:"ListBar",props:{activeTab:{type:"Tab"},advancedSearch:{type:"{ isOpen: boolean, enteredFields: number }"},onToggleAdvancedSearch:{type:"(boolean) => void"},title:{type:"string"},onToolbarPinned:{type:"(boolean) => void"},selectable:{type:"boolean"},disableSelection:{type:"boolean",default:"false"},isSelected:{type:"boolean"},isIndeterminate:{type:"boolean"},onSelectionChange:{type:"(boolean) => void"},pinResultsBar:{type:"boolean"},pinToolbar:{type:"boolean",default:"true"},advancedSearchToggleText:{type:"string"}}});function N({options:t,activeOption:r,onSortChange:n,defaultOption:s,className:i,...p}){const m=(t||[]).map(d=>[{label:d.label,icon:d.icon},()=>{n&&n(d)}]);return e.createElement(a.SpsDropdown,{className:c.cl(i,ve),icon:r?.icon||s?.icon,label:r?.label||s?.label,options:m})}c.Metadata.set(N,{name:"ListBarSortBy",props:{options:{type:"SortOption[]"},activeOption:{type:"SortOption"},onSortChange:{type:"(option: SortOption) => void"},defaultOption:{type:"SortOption"}}});var be=I({defaultClassName:"pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj410",variantClassNames:{open:{true:"pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj411",false:"pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj412"},compact:{true:"pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj413",false:"pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj414"}},defaultVariants:{open:!1,compact:!1},compoundVariants:[]}),_e=I({defaultClassName:"pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj415",variantClassNames:{open:{true:"pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj416",false:"pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj417"}},defaultVariants:{open:!0},compoundVariants:[]}),Be="pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj418",ge="pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj419";function R({formArray:t,formGroup:r,formMeta:n,onSubmit:s,controlsDisabled:i,footerLinks:p,isOpen:m,onClear:d,submitButtonText:f,compact:h,className:S,children:g,...T}){const{t:A}=O.useWoodlandLanguage();function x(){d&&d()}return e.createElement("div",{className:c.cl(be({open:m,compact:h})),...T},e.createElement(a.SpsForm,{onSubmit:s,formArray:t,formGroup:r,formMeta:n},e.createElement("div",{className:_e({open:m})},g),e.createElement("div",{className:Be},p&&e.createElement("div",{id:"footer_links"},c.contentOf(p)),e.createElement("div",{className:ge},e.createElement(_.Button,{kind:"default",type:"button",className:Y.sprinkles({mr:"sm"}),onClick:x,disabled:i},A("advancedSearch.clear",{defaultValue:"Clear Fields"})),e.createElement(_.Button,{kind:"key",type:"submit",disabled:i},f??A("advancedSearch.search",{defaultValue:"Search"}))))))}c.Metadata.set(R,{name:"Advanced Search",props:{formArray:{type:"SpsFormArray<any>"},formGroup:{type:"SpsFormGroup"},formMeta:{type:"SpsFormSetMeta<any>"},onSubmit:{type:"React.FormEventHandler"},controlsDisabled:{type:"boolean"},footerLinks:{type:"React.ReactNode | (() => React.ReactNode)"},isOpen:{type:"boolean"},onClear:{type:"() => void"},submitButtonText:{type:"string"},compact:{type:"boolean"}}});const Te={components:[R],examples:{general:{label:"General Usage",description:({NavigateTo:t,Link:r})=>e.createElement(e.Fragment,null,e.createElement("p",null,'Advanced Search is comprised of a panel of input fields, and a text button that exposes and hides the panel. By default, the Advanced Search panel is hidden (with the exception of "Advanced Search Only" scenarios).'),e.createElement("p",null,"Advanced Search works in conjunction with the"," ",e.createElement(t,{to:"list-toolbar"},"List Bar")," and"," ",e.createElement(t,{to:"search-results-bar"},"Search Results")," components. Refer to those pages for additional details."),e.createElement("p",null,"Use the following guidelines when including Advanced Search on your page:",e.createElement("ul",null,e.createElement("li",null,"The Advanced Search Panel can contain any number of input fields."),e.createElement("li",null,"The Advanced Search Panel can place input fields in any unique layout to best serve the needs of the search criteria, but must adhere to the rules of the"," ",e.createElement(r,{to:"/style-and-layout/grid/"},"SPS Grid")," and guidelines for"," ",e.createElement(t,{to:"form"},"Form Layouts"),"."))))},basic:{label:"Basic Usage",description:({NavigateTo:t})=>e.createElement(e.Fragment,null,e.createElement("p",null,"A Basic Advanced Search consists of the List Bar with a search input and an Advanced Search text button. For more details on additional button and component options in the List Bar reference the ",e.createElement(t,{to:"list-toolbar"},"List Bar")," page.")),examples:{basic:{react:o.code`
|
|
2
2
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
3
3
|
import { Button } from "@sps-woodland/buttons";
|
|
4
4
|
import { grid } from "@sps-woodland/tokens";
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
</>
|
|
99
99
|
)
|
|
100
100
|
}
|
|
101
|
-
`}}},footerLink:{label:"Footer Link",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"A Footer Link can be included in the Advanced Search footer (visible only when the menu is exposed). The Footer Link is used to link to preferences that control the Advanced Search panel display (such as customized fields and defaults).")),examples:{footerLink:{react:
|
|
101
|
+
`}}},footerLink:{label:"Footer Link",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"A Footer Link can be included in the Advanced Search footer (visible only when the menu is exposed). The Footer Link is used to link to preferences that control the Advanced Search panel display (such as customized fields and defaults).")),examples:{footerLink:{react:o.code`
|
|
102
102
|
import { ListBar, ListBarSearch, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
103
103
|
import { Button } from "@sps-woodland/buttons";
|
|
104
104
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
</>
|
|
151
151
|
)
|
|
152
152
|
}
|
|
153
|
-
`}}},disabledButtons:{label:"Disabling the Clear/Search Buttons",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"The Search and Clear Fields buttons in the footer can be disabled when no input fields in the Advanced Search Panel contain values.")),examples:{disabledButtons:{react:
|
|
153
|
+
`}}},disabledButtons:{label:"Disabling the Clear/Search Buttons",description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"The Search and Clear Fields buttons in the footer can be disabled when no input fields in the Advanced Search Panel contain values.")),examples:{disabledButtons:{react:o.code`
|
|
154
154
|
import { ListBar, ListBarSearch, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
155
155
|
import { Button } from "@sps-woodland/buttons";
|
|
156
156
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -196,7 +196,7 @@
|
|
|
196
196
|
</>
|
|
197
197
|
)
|
|
198
198
|
}
|
|
199
|
-
`}}},advancedSearchOnly:{label:'"Advanced Search Only" List Bar',description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Certain scenarios may require an Advanced Search Panel to display by default (eschewing a basic search). In these scenarios a title will replace the search input in the List Bar."),e.createElement("p",null,"To achieve an Advanced Search Only effect, remove the basic search input from the List Bar.")),examples:{withTitle:{react:
|
|
199
|
+
`}}},advancedSearchOnly:{label:'"Advanced Search Only" List Bar',description:()=>e.createElement(e.Fragment,null,e.createElement("p",null,"Certain scenarios may require an Advanced Search Panel to display by default (eschewing a basic search). In these scenarios a title will replace the search input in the List Bar."),e.createElement("p",null,"To achieve an Advanced Search Only effect, remove the basic search input from the List Bar.")),examples:{withTitle:{react:o.code`
|
|
200
200
|
import { ListBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
201
201
|
|
|
202
202
|
function Component() {
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
</>
|
|
217
217
|
)
|
|
218
218
|
}
|
|
219
|
-
`}}}}};function
|
|
219
|
+
`}}}}};function Ee(){const[t,r]=e.useState(!1);function n(){r(!1)}function s(){r(!0)}return e.createElement(e.Fragment,null,e.createElement("p",null,"The List Bar is divided into a number of different sections. It spans the entire width of the corresponding list."),e.createElement(_.Button,{kind:"link",onClick:s},"View Content Order Example"),e.createElement(a.SpsFocusedTask,{isOpen:t,onClose:n},e.createElement("h1",null,"Content Order"),e.createElement("img",{src:"assets/images/list-toolbar-example.svg",alt:"A List Toolbar with labels on each section",className:"w-100 mb-3"}),e.createElement(a.SpsTable,null,e.createElement(a.SpsTableHead,null,e.createElement(a.SpsTableHeader,{style:{width:"80px"}},"Order"),e.createElement(a.SpsTableHeader,null,"Section"),e.createElement(a.SpsTableHeader,null,"Notes")),e.createElement(a.SpsTableBody,null,e.createElement(a.SpsTableRow,null,e.createElement(a.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"1")),e.createElement(a.SpsTableCell,null,"Checkbox"),e.createElement(a.SpsTableCell,null,"For Content Rows and Content Tiles only.")),e.createElement(a.SpsTableRow,null,e.createElement(a.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"2")),e.createElement(a.SpsTableCell,null,"Search/Filter Box"),e.createElement(a.SpsTableCell,null)),e.createElement(a.SpsTableRow,null,e.createElement(a.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"3")),e.createElement(a.SpsTableCell,null,"Saved Search"),e.createElement(a.SpsTableCell,null)),e.createElement(a.SpsTableRow,null,e.createElement(a.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"4")),e.createElement(a.SpsTableCell,null,"Advanced Search"),e.createElement(a.SpsTableCell,null,"For more information, visit the Advanced Search page.")),e.createElement(a.SpsTableRow,null,e.createElement(a.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"5")),e.createElement(a.SpsTableCell,null,"Column Editor"),e.createElement(a.SpsTableCell,{wrap:500},"Use for Tables only. For more information, visit the Column Editor page.")),e.createElement(a.SpsTableRow,null,e.createElement(a.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"6")),e.createElement(a.SpsTableCell,null,"List View Selector"),e.createElement(a.SpsTableCell,null)),e.createElement(a.SpsTableRow,null,e.createElement(a.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"7")),e.createElement(a.SpsTableCell,null,"Sorting"),e.createElement(a.SpsTableCell,null)),e.createElement(a.SpsTableRow,null,e.createElement(a.SpsTableCell,null,e.createElement("span",{className:"sps-tag sps-tag--info"},"8")),e.createElement(a.SpsTableCell,null,"Buttons"),e.createElement(a.SpsTableCell,{wrap:500},"Buttons always appear in the rightmost section of the List Toolbar. For the ordering of Buttons, refer to the Button Groups section on the Buttons page."))))))}const Le={description:()=>e.createElement("p",null,"The List Toolbar provides the ability to interact with elements in a list or table. It can contain elements to search, filter, sort, or perform other actions."),components:[V,y,C,N],examples:{general:{label:"General Usage",description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Use a List Toolbar:"),e.createElement("ul",null,e.createElement("li",null,"When list content needs to be searched, filtered, sorted, or otherwise interacted with.")),e.createElement("h5",null,"Avoid a List Toolbar:"),e.createElement("ul",null,e.createElement("li",null,"When no list is present."),e.createElement("li",null,"When there will always be a small number of elements in the list, or the list does not require searching, filtering, or other actions.")))},contentOrder:{label:"Content Order",description:e.createElement(Ee,null)},checkbox:{label:"Checkbox",description:({NavigateTo:t})=>e.createElement("p",null,"Use a Checkbox in the List Bar when items in a"," ",e.createElement(t,{to:"content-row"},"Content Row")," or"," ",e.createElement(t,{to:"content-tile"},"Content Tile")," are selectable. The Checkbox selects all items in the list, and will cause the Action Bar to appear. Do not use this with a Table, as Tables have a built-in checkbox in the header row."),examples:{basic:{react:o.code`
|
|
220
220
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
221
221
|
|
|
222
222
|
function Component() {
|
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
</>
|
|
277
277
|
)
|
|
278
278
|
}
|
|
279
|
-
`}}},searchAndFilter:{label:"Search + Filter Inputs",description:()=>e.createElement("p",null,"Use Search and Filter inputs to make it easier to quickly find list items."),examples:{search:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Search"),e.createElement("p",null,"Use Search to find list item(s) starting from an empty list.")),react:
|
|
279
|
+
`}}},searchAndFilter:{label:"Search + Filter Inputs",description:()=>e.createElement("p",null,"Use Search and Filter inputs to make it easier to quickly find list items."),examples:{search:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Search"),e.createElement("p",null,"Use Search to find list item(s) starting from an empty list.")),react:o.code`
|
|
280
280
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
281
281
|
import { Button } from "@sps-woodland/buttons";
|
|
282
282
|
|
|
@@ -302,7 +302,7 @@
|
|
|
302
302
|
</ListBar>
|
|
303
303
|
)
|
|
304
304
|
}
|
|
305
|
-
`},searchAndSelect:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Search + Select"),e.createElement("p",null,"Use Select to search for list item(s) in a particular category.")),react:
|
|
305
|
+
`},searchAndSelect:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Search + Select"),e.createElement("p",null,"Use Select to search for list item(s) in a particular category.")),react:o.code`
|
|
306
306
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
307
307
|
import { Button } from "@sps-woodland/buttons";
|
|
308
308
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
</ListBar>
|
|
339
339
|
)
|
|
340
340
|
}
|
|
341
|
-
`},multiValue:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Search + Select"),e.createElement("p",null,"Search + Select with a Multi-Value Text Input")),react:
|
|
341
|
+
`},multiValue:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Search + Select"),e.createElement("p",null,"Search + Select with a Multi-Value Text Input")),react:o.code`
|
|
342
342
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
343
343
|
import { Button } from "@sps-woodland/buttons";
|
|
344
344
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -375,7 +375,7 @@
|
|
|
375
375
|
</ListBar>
|
|
376
376
|
)
|
|
377
377
|
}
|
|
378
|
-
`},filter:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Filter"),e.createElement("p",null,"Use Filter to find list item(s) starting from a populated list.")),react:
|
|
378
|
+
`},filter:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Filter"),e.createElement("p",null,"Use Filter to find list item(s) starting from a populated list.")),react:o.code`
|
|
379
379
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
380
380
|
import { Button } from "@sps-woodland/buttons";
|
|
381
381
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -402,7 +402,7 @@
|
|
|
402
402
|
</ListBar>
|
|
403
403
|
)
|
|
404
404
|
}
|
|
405
|
-
`},filterAndSelect:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Filter + Select"),e.createElement("p",null,"Use Select to filter list item(s) in a particular category.")),react:
|
|
405
|
+
`},filterAndSelect:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Filter + Select"),e.createElement("p",null,"Use Select to filter list item(s) in a particular category.")),react:o.code`
|
|
406
406
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
407
407
|
import { Button } from "@sps-woodland/buttons";
|
|
408
408
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -438,7 +438,7 @@
|
|
|
438
438
|
</ListBar>
|
|
439
439
|
)
|
|
440
440
|
}
|
|
441
|
-
`},searchInfo:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Search Info"),e.createElement("p",null,"Use SpsListToolbarSearchInfo component to add additional information about your search.")),react:
|
|
441
|
+
`},searchInfo:{description:()=>e.createElement(e.Fragment,null,e.createElement("h5",null,"Search Info"),e.createElement("p",null,"Use SpsListToolbarSearchInfo component to add additional information about your search.")),react:o.code`
|
|
442
442
|
import { ListBar, ListBarSearch, ListBarSearchInfo } from "@sps-woodland/list-bar";
|
|
443
443
|
import { Icon } from "@sps-woodland/core";
|
|
444
444
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -482,7 +482,7 @@
|
|
|
482
482
|
</ListBar>
|
|
483
483
|
)
|
|
484
484
|
}
|
|
485
|
-
`}}},advancedSearch:{label:"Advanced Search",description:({NavigateTo:
|
|
485
|
+
`}}},advancedSearch:{label:"Advanced Search",description:({NavigateTo:t})=>e.createElement("p",null,"Include the Advanced Search feature when more complex options are required to narrow down search results. For more information, visit the"," ",e.createElement(t,{to:"advanced-search"},"Advanced Search")," page."),examples:{advancedSearch:{react:o.code`
|
|
486
486
|
import { ListBar, ListBarSearch, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
487
487
|
import { Button } from "@sps-woodland/buttons";
|
|
488
488
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -522,7 +522,7 @@
|
|
|
522
522
|
</>
|
|
523
523
|
)
|
|
524
524
|
}
|
|
525
|
-
`},withResultsBar:{description:({NavigateTo:
|
|
525
|
+
`},withResultsBar:{description:({NavigateTo:t})=>e.createElement("p",null,"You can include ",e.createElement(t,{to:"search-results-bar"},"Search Results Bar"),"."),react:o.code`
|
|
526
526
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
527
527
|
import { Button } from "@sps-woodland/buttons";
|
|
528
528
|
import { SpsTextInput, SpsLabel, SpsMultiselect } from "@spscommerce/ds-react";
|
|
@@ -634,7 +634,7 @@
|
|
|
634
634
|
</>
|
|
635
635
|
)
|
|
636
636
|
}
|
|
637
|
-
`},pinnedResultsBar:{description:()=>e.createElement("p",null,"You can pin the Results Bar by passing pinResultsBar prop to SpsListToolbar."),react:
|
|
637
|
+
`},pinnedResultsBar:{description:()=>e.createElement("p",null,"You can pin the Results Bar by passing pinResultsBar prop to SpsListToolbar."),react:o.code`
|
|
638
638
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
639
639
|
import { Button } from "@sps-woodland/buttons";
|
|
640
640
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -699,7 +699,7 @@
|
|
|
699
699
|
</>
|
|
700
700
|
)
|
|
701
701
|
}
|
|
702
|
-
`}}},columnEditor:{label:"Column Editor",description:({NavigateTo:
|
|
702
|
+
`}}},columnEditor:{label:"Column Editor",description:({NavigateTo:t})=>e.createElement("p",null,"Use a Column Editor when tables require the ability to show or hide specific columns based on the user's preferences. The Column Editor should only be used for"," ",e.createElement(t,{to:"tables"},"Tables"),", and not any other type of list view. For more information, visit the ",e.createElement(t,{to:"column-chooser"},"Column Editor")," page."),examples:{columnEditor:{react:o.code`
|
|
703
703
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
704
704
|
import { Button } from "@sps-woodland/buttons";
|
|
705
705
|
|
|
@@ -738,7 +738,7 @@
|
|
|
738
738
|
</ListBar>
|
|
739
739
|
)
|
|
740
740
|
}
|
|
741
|
-
`}}},buttons:{label:"Buttons",description:({NavigateTo:
|
|
741
|
+
`}}},buttons:{label:"Buttons",description:({NavigateTo:t})=>e.createElement("p",null,"Use Buttons only for actions that do not affect existing list items, such as exporting the list or creating a new list item. For actions that are taken on list items, such as changing a status of a list item, refer to the"," ",e.createElement(t,{to:"list-action-bar"},"List Action Bar"),"."),examples:{buttons:{react:o.code`
|
|
742
742
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
743
743
|
import { Button } from "@sps-woodland/buttons";
|
|
744
744
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -769,7 +769,7 @@
|
|
|
769
769
|
</ListBar>
|
|
770
770
|
)
|
|
771
771
|
}
|
|
772
|
-
`}}},tabs:{label:"Tabs",description:({NavigateTo:
|
|
772
|
+
`}}},tabs:{label:"Tabs",description:({NavigateTo:t})=>e.createElement(e.Fragment,null,e.createElement("p",null,"When tabs are included, they appear above the List Toolbar. Tab rules are outlined on the ",e.createElement(t,{to:"cards"},"Cards")," page."),e.createElement("p",null,e.createElement("code",null,"<Item>")," comes from the ",e.createElement("code",null,"@react-stately/collections"),"package, which is a peer dependency of our React components.")),examples:{tabs:{react:o.code`
|
|
773
773
|
import { ListBar, ListBarSearch } from "@sps-woodland/list-bar";
|
|
774
774
|
import { Button } from "@sps-woodland/buttons";
|
|
775
775
|
import { SpsSelect, SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -816,7 +816,7 @@
|
|
|
816
816
|
</ListBar>
|
|
817
817
|
)
|
|
818
818
|
}
|
|
819
|
-
`}}},title:{label:"Title",description:({NavigateTo:
|
|
819
|
+
`}}},title:{label:"Title",description:({NavigateTo:t})=>e.createElement("p",null,"Use Titles when there is no Search or Filter input required for the list items, such as when the only search options are in an Advanced Search panel. For more information, visit the ",e.createElement(t,{to:"advanced-search"},"Advanced Search")," page."),examples:{title:{react:o.code`
|
|
820
820
|
import { ListBar } from "@sps-woodland/list-bar";
|
|
821
821
|
import { Button } from "@sps-woodland/buttons";
|
|
822
822
|
|
|
@@ -827,7 +827,7 @@
|
|
|
827
827
|
</ListBar>
|
|
828
828
|
)
|
|
829
829
|
}
|
|
830
|
-
`}}},sortBy:{label:"Sort By",description:()=>e.createElement("p",null,"Use Sort By component to sort list of rows. It looks like SpsDropdown but with sorting interface."),examples:{basic:{react:
|
|
830
|
+
`}}},sortBy:{label:"Sort By",description:()=>e.createElement("p",null,"Use Sort By component to sort list of rows. It looks like SpsDropdown but with sorting interface."),examples:{basic:{react:o.code`
|
|
831
831
|
import { ListBar, ListBarSortBy } from "@sps-woodland/list-bar";
|
|
832
832
|
import { Button } from "@sps-woodland/buttons";
|
|
833
833
|
import { VerticalRule } from "@sps-woodland/core";
|
|
@@ -883,7 +883,7 @@
|
|
|
883
883
|
</ListBar>
|
|
884
884
|
)
|
|
885
885
|
}
|
|
886
|
-
`}}}}},
|
|
886
|
+
`}}}}},we={components:[w],examples:{basic:{label:"Basic",description:({NavigateTo:t})=>e.createElement(e.Fragment,null,e.createElement("p",null,"The SearchResultsBar should be used with List Bar and Advanced Search."),e.createElement("p",null,"For more examples go to the Advanced Search section on the"," ",e.createElement(t,{to:"list-bar"},"List Bar")," page.")),examples:{basic:{react:o.code`
|
|
887
887
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
888
888
|
import { Button } from "@sps-woodland/buttons";
|
|
889
889
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -951,7 +951,7 @@
|
|
|
951
951
|
</>
|
|
952
952
|
)
|
|
953
953
|
}
|
|
954
|
-
`},situational:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Unknown Results Count"),e.createElement("p",null,"In cases where the exact count of results is not able to be determined, Results section won't be displayed.")),react:
|
|
954
|
+
`},situational:{description:()=>e.createElement(e.Fragment,null,e.createElement("h4",null,"Unknown Results Count"),e.createElement("p",null,"In cases where the exact count of results is not able to be determined, Results section won't be displayed.")),react:o.code`
|
|
955
955
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
956
956
|
import { Button } from "@sps-woodland/buttons";
|
|
957
957
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -1014,7 +1014,7 @@
|
|
|
1014
1014
|
</>
|
|
1015
1015
|
)
|
|
1016
1016
|
}
|
|
1017
|
-
`}}},customText:{label:"Custom Text",description:()=>e.createElement("p",null,"You can pass in custom text to be displayed when there are no selections."),examples:{customText:{react:
|
|
1017
|
+
`}}},customText:{label:"Custom Text",description:()=>e.createElement("p",null,"You can pass in custom text to be displayed when there are no selections."),examples:{customText:{react:o.code`
|
|
1018
1018
|
import { ListBar, ListBarSearch, SearchResultsBar, AdvancedSearch } from "@sps-woodland/list-bar";
|
|
1019
1019
|
import { Button } from "@sps-woodland/buttons";
|
|
1020
1020
|
import { SpsTextInput } from "@spscommerce/ds-react";
|
|
@@ -1083,4 +1083,4 @@
|
|
|
1083
1083
|
</>
|
|
1084
1084
|
)
|
|
1085
1085
|
}
|
|
1086
|
-
`}}}}},
|
|
1086
|
+
`}}}}},ye={"Advanced Search":Te,"List Bar":Le,"Search Results Bar":we};l.AdvancedSearch=R,l.InputGroupWrapper=G,l.ListBar=V,l.ListBarSearch=y,l.ListBarSearchInfo=C,l.ListBarSortBy=N,l.MANIFEST=ye,l.SearchResultsBar=w,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export declare const listBarWrapper: string;
|
|
2
|
+
export declare const listBar: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
3
|
+
pinned: {
|
|
4
|
+
true: {
|
|
5
|
+
width: `calc(${string} - (${string} * 2))`;
|
|
6
|
+
borderRadius: number;
|
|
7
|
+
transform: "translateX(-50%)";
|
|
8
|
+
position: "fixed";
|
|
9
|
+
top: string;
|
|
10
|
+
left: "50%";
|
|
11
|
+
zIndex: number;
|
|
12
|
+
selectors: {
|
|
13
|
+
"&:after": {
|
|
14
|
+
background: "linear-gradient(180deg, rgba(0, 0, 0, 0.1), transparent)";
|
|
15
|
+
content: "";
|
|
16
|
+
display: "block";
|
|
17
|
+
height: string;
|
|
18
|
+
position: "absolute";
|
|
19
|
+
top: "calc(100% + 1px)";
|
|
20
|
+
width: "100%";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
false: {};
|
|
25
|
+
};
|
|
26
|
+
}>;
|
|
27
|
+
export declare const listBarContent: string;
|
|
28
|
+
export declare const listBarSelectionControls: string;
|
|
29
|
+
export declare const listBarSearchControls: string;
|
|
30
|
+
export declare const listBarAdvSearchToggle: string;
|
|
31
|
+
export declare const listBarAdvSearchToggleWrapper: string;
|
|
32
|
+
export declare const listBarAdvSearchEnteredFields: string;
|
|
33
|
+
export declare const listBarAdvSearchTitle: string;
|
|
34
|
+
export declare const listBarHeaderContent: string;
|
|
35
|
+
export declare const listBarSearchForm: string;
|
|
36
|
+
export declare const listBarSearchField: string;
|
|
37
|
+
export declare const inputGroupIconButton: string;
|
|
38
|
+
export declare const listBarSortBy: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
export declare function ListBar({ advancedSearch, onToggleAdvancedSearch, title, onToolbarPinned, selectable, isSelected, isIndeterminate, disableSelection, onSelectionChange, pinResultsBar, pinToolbar, advancedSearchToggleText, children, className, ...rest }: ComponentProps<{
|
|
4
|
+
advancedSearch?: {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
enteredFields?: number;
|
|
7
|
+
};
|
|
8
|
+
onToggleAdvancedSearch?: (arg: boolean) => void;
|
|
9
|
+
title?: string;
|
|
10
|
+
onToolbarPinned?: (arg: boolean) => void;
|
|
11
|
+
selectable?: boolean;
|
|
12
|
+
isSelected?: boolean;
|
|
13
|
+
isIndeterminate?: boolean;
|
|
14
|
+
disableSelection?: boolean;
|
|
15
|
+
onSelectionChange?: (arg: boolean) => void;
|
|
16
|
+
pinResultsBar?: boolean;
|
|
17
|
+
pinToolbar?: boolean;
|
|
18
|
+
advancedSearchToggleText?: string;
|
|
19
|
+
}, HTMLDivElement>): React.ReactElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ComponentProps, SortDirection } from "@sps-woodland/core";
|
|
3
|
+
import { SpsIcon } from "@spscommerce/ds-shared";
|
|
4
|
+
export interface SortOption {
|
|
5
|
+
label: string;
|
|
6
|
+
key: string;
|
|
7
|
+
direction: SortDirection;
|
|
8
|
+
icon: SpsIcon;
|
|
9
|
+
}
|
|
10
|
+
export declare function ListBarSortBy({ options, activeOption, onSortChange, defaultOption, className, ...rest }: ComponentProps<{
|
|
11
|
+
options?: SortOption[];
|
|
12
|
+
activeOption?: SortOption;
|
|
13
|
+
onSortChange?: (option: SortOption) => void;
|
|
14
|
+
defaultOption?: SortOption;
|
|
15
|
+
}, HTMLElement>): React.ReactElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const searchResultsBarWrapper: string;
|
|
2
|
+
export declare const searchResultsBar: string;
|
|
3
|
+
export declare const searchResultsBarResults: string;
|
|
4
|
+
export declare const searchResutlsBarResultsTag: string;
|
|
5
|
+
export declare const searchResultsBarSelections: string;
|
|
6
|
+
export declare const searchResultsBarSelection: string;
|
|
7
|
+
export declare const searchResultsBarSelectionTag: string;
|
|
8
|
+
export declare const searchResultsBarButtons: string;
|
|
9
|
+
export declare const searchResultsBarButton: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
export declare function SearchResultsBar({ results, selections, zeroStateText, onClear, className, children, ...rest }: ComponentProps<{
|
|
4
|
+
results?: number | string | null;
|
|
5
|
+
selections?: {
|
|
6
|
+
[key: string]: string[];
|
|
7
|
+
};
|
|
8
|
+
zeroStateText?: string;
|
|
9
|
+
onClear?: () => void;
|
|
10
|
+
}, HTMLDivElement>): React.ReactElement;
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p701{background:#fff;border-color:#d2d4d4;border-style:solid;border-width:.0625rem;border-radius:.25rem;display:flex;flex-flow:column wrap;margin-top:0;margin-right:0;margin-bottom:.5rem;margin-left:0;position:relative}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p702{width:calc(1280px - 2.5rem);border-radius:0;transform:translate(-50%);position:fixed;top:3.75rem;left:50%;z-index:999}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p702:after{content:"";background:linear-gradient(180deg,rgba(0,0,0,.1),transparent);display:block;height:.625rem;position:absolute;top:calc(100% + 1px);width:100%}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p704{display:flex;flex-wrap:wrap;padding:.5rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p705{display:flex;align-items:center;border-right-color:#d2d4d4;border-right-style:solid;border-right-width:.0625rem;padding:1rem;margin:-.5rem .5rem -.5rem -.5rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p706{align-items:center;display:inline-flex;flex:1 0 auto;height:2rem;vertical-align:middle}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p707{padding-top:.25rem;padding-right:0;padding-bottom:.25rem;padding-left:0;white-space:nowrap}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p708{display:inline-block;position:relative}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p709{margin-left:.25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70a{align-items:center;display:flex;float:left;font-size:.75rem;font-weight:600;line-height:1.5rem;margin-bottom:0;padding-left:.5rem;text-transform:uppercase}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70b{display:inline-block;height:2rem;margin-left:auto;text-align:right;vertical-align:middle;white-space:nowrap}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70c{flex:1;margin-right:.25rem;max-width:25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70e{background-color:#e9e9ea;border-color:#717779;border-width:.0625rem;border-style:solid;border-bottom-left-radius:0;border-bottom-right-radius:.25rem;border-top-left-radius:0;border-top-right-radius:.25rem;border-left-width:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70e:hover{background-color:#d2d4d4;border-width:.0625rem;border-style:solid;border-color:#717779;border-left-width:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70f>.sps-button{margin:0!important;background:transparent;border-color:transparent;color:#4b5356}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70f>.sps-button>button{padding:.25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70e>button{height:1.875rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70a>i{font-size:.875rem;margin-right:.25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group{flex-wrap:nowrap}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-autocomplete{flex:1}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-multi-select{flex:1}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-select{min-width:30%}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-select:not(:last-child)>.sps-select__dropctrl{height:2rem;line-height:2rem;border-bottom-right-radius:0;border-top-right-radius:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-autocomplete:not(:first-child)>.sps-text-input>.sps-form-control{border-bottom-left-radius:0;border-top-left-radius:0;border-left:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-autocomplete:not(:last-child)>.sps-text-input>.sps-form-control{height:2rem;line-height:2rem;border-bottom-right-radius:0;border-top-right-radius:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-text-input:not(:last-child)>.sps-form-control{border-bottom-right-radius:0;border-top-right-radius:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-multi-select>.sps-text-input>.sps-form-control{border-radius:0;border-left:0;height:32px}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d>.sps-input-group>.sps-text-input:not(:first-child):not(:only-child)>.sps-form-control{border-bottom-left-radius:0;border-left:0;border-top-left-radius:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p70d svg{margin-bottom:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc1{background-color:#e9e9ea;border-width:.0625rem;border-color:#d2d4d4;border-style:solid;border-radius:.25rem;display:flex;min-height:3.25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_9h4p701>.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc0>.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc1{border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:.125rem;border-bottom-right-radius:.125rem;border-top-width:.0625rem;border-right-width:0;border-bottom-width:0;border-left-width:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc2{flex:1 1 auto;border-right-width:.0625rem;border-right-color:#d2d4d4;border-right-style:solid;padding:.5rem;display:flex;align-items:center}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc3{margin-left:.25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc4{flex:1 1 100%;padding:.5rem;display:flex;align-items:center;flex-wrap:wrap}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc5{margin-top:0;margin-bottom:0;margin-right:.25rem;margin-left:.25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc5:first-child{margin-left:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc6{margin-top:.125rem;margin-bottom:.125rem;margin-right:.25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc6:last-child{margin-right:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc7{flex:1 1 auto;border-left-width:.0625rem;border-left-style:solid;border-left-color:#d2d4d4;display:flex;align-items:center}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc7:hover{background:#d2d4d4}.pkg_sps-woodland_list-bar__version_8_52_0__hash_1gxdcgc8{padding:.5rem;width:5.25rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj410{background:#fff;border-color:#d2d4d4;border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;border-style:solid;border-top-width:0;border-right-width:.0625rem;border-bottom-width:.0625rem;border-left-width:.0625rem;display:none;margin-top:-.625rem;margin-right:0;margin-bottom:1rem;margin-left:0}.pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj411,.pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj413{display:block}.pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj415{padding:1rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj417{display:none}.pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj418{background:#f3f4f4;border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:.25rem;border-bottom-right-radius:.25rem;display:flex;padding:.5rem}.pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj419{text-align:right}.pkg_sps-woodland_list-bar__version_8_52_0__hash_q4fj418>*{flex:1}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/list-bar",
|
|
3
3
|
"description": "SPS Woodland Design System list bar components",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.52.0",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/list-bar",
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
"import": "./lib/index.js",
|
|
18
18
|
"default": "./lib/index.js"
|
|
19
19
|
},
|
|
20
|
-
"./style.css": "./lib/style.css",
|
|
21
20
|
"./lib/style.css": {
|
|
22
21
|
"import": "./lib/style.css",
|
|
23
22
|
"require": "./lib/style.css"
|
|
@@ -27,24 +26,38 @@
|
|
|
27
26
|
"access": "public"
|
|
28
27
|
},
|
|
29
28
|
"peerDependencies": {
|
|
29
|
+
"@react-stately/collections": "^3.0.0",
|
|
30
30
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
31
31
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
32
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
33
|
-
"@sps-woodland/
|
|
34
|
-
"@
|
|
33
|
+
"@sps-woodland/buttons": "8.52.0",
|
|
34
|
+
"@sps-woodland/core": "8.52.0",
|
|
35
|
+
"@sps-woodland/tabs": "8.52.0",
|
|
36
|
+
"@sps-woodland/tags": "8.52.0",
|
|
37
|
+
"@sps-woodland/tokens": "8.52.0",
|
|
38
|
+
"@spscommerce/ds-react": "8.52.0",
|
|
39
|
+
"@spscommerce/i18n": "8.52.0"
|
|
35
40
|
},
|
|
36
41
|
"devDependencies": {
|
|
42
|
+
"@react-stately/collections": "3.12.10",
|
|
37
43
|
"@spscommerce/utils": "9.0.3",
|
|
44
|
+
"@vanilla-extract/css": "1.17.4",
|
|
45
|
+
"@vanilla-extract/recipes": "0.2.5",
|
|
38
46
|
"react": "16.14.0",
|
|
39
47
|
"react-dom": "16.14.0",
|
|
40
|
-
"@sps-woodland/
|
|
41
|
-
"@
|
|
48
|
+
"@sps-woodland/buttons": "8.52.0",
|
|
49
|
+
"@sps-woodland/core": "8.52.0",
|
|
50
|
+
"@sps-woodland/tabs": "8.52.0",
|
|
51
|
+
"@sps-woodland/tags": "8.52.0",
|
|
52
|
+
"@sps-woodland/tokens": "8.52.0",
|
|
53
|
+
"@spscommerce/ds-react": "8.52.0",
|
|
54
|
+
"@spscommerce/ds-shared": "8.52.0",
|
|
55
|
+
"@spscommerce/i18n": "8.52.0"
|
|
42
56
|
},
|
|
43
57
|
"scripts": {
|
|
44
|
-
"build": "pnpm run build:js && pnpm run build:types
|
|
58
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
45
59
|
"build:js": "vite build",
|
|
46
60
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
47
|
-
"build:css": "cp ../core/lib/list-bar/style.css lib/style.css 2>/dev/null || echo 'list-bar style.css not found, skipping'",
|
|
48
61
|
"watch": "vite build --watch",
|
|
49
62
|
"clean": "git clean -fdX",
|
|
50
63
|
"pub": "node ../../../scripts/publish-package.mjs"
|
package/vite.config.mjs
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
+
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
2
3
|
import { defineConfig } from "vite";
|
|
4
|
+
import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.mjs";
|
|
3
5
|
import pkg from "./package.json";
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
// No vanilla-extract needed - CSS is provided by the mono-package.
|
|
7
|
-
|
|
8
|
-
const peerDeps = pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [];
|
|
7
|
+
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
9
8
|
|
|
10
9
|
export default defineConfig({
|
|
10
|
+
plugins: [
|
|
11
|
+
vanillaExtractPlugin(
|
|
12
|
+
getVanillaExtractPluginProps({
|
|
13
|
+
packageName: pkg.name,
|
|
14
|
+
packageVersion,
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
],
|
|
11
18
|
build: {
|
|
12
19
|
lib: {
|
|
13
20
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
14
21
|
name: "ListBar",
|
|
15
22
|
fileName: "index",
|
|
23
|
+
cssFileName: "style",
|
|
16
24
|
},
|
|
17
25
|
outDir: path.resolve(__dirname, "./lib"),
|
|
18
26
|
emptyOutDir: false,
|
|
19
27
|
rollupOptions: {
|
|
20
|
-
|
|
21
|
-
external: (id) => !id.endsWith(".css") && peerDeps.some((dep) => id === dep || id.startsWith(dep + "/")),
|
|
28
|
+
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
|
22
29
|
},
|
|
23
30
|
},
|
|
24
31
|
});
|