@sps-woodland/action-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 -25
- package/lib/ActionBar.css.d.ts +9 -0
- package/lib/ActionBar.d.ts +8 -0
- package/lib/ActionBarAdditionalContent.d.ts +3 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +87 -13
- package/lib/index.umd.cjs +4 -4
- package/lib/style.css +1 -1
- package/package.json +14 -6
- package/vite.config.mjs +14 -5
package/README.md
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
1
|
## [@sps-woodland/action-bar](https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/action-bar#readme)
|
|
2
2
|
|
|
3
|
-
SPS Woodland Design System Action Bar component
|
|
4
|
-
|
|
5
|
-
> **Heads up — this is a wrapper package.** The component source now lives in
|
|
6
|
-
> [`@sps-woodland/core`](../core). This package re-exports from core so existing
|
|
7
|
-
> imports keep working, but new code should prefer the core paths.
|
|
8
|
-
|
|
9
|
-
### Preferred imports (core)
|
|
10
|
-
|
|
11
|
-
```ts
|
|
12
|
-
import { ActionBar, ActionBarAdditionalContent } from "@sps-woodland/core/action-bar";
|
|
13
|
-
// or, if you only need the additional-content slot:
|
|
14
|
-
import { ActionBarAdditionalContent } from "@sps-woodland/core/action-bar-additional-content";
|
|
15
|
-
|
|
16
|
-
import "@sps-woodland/core/action-bar/style.css";
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
`ActionBar` is barrel-only (the family name and the parent component share a
|
|
20
|
-
name). `ActionBarAdditionalContent` additionally has its own flat subpath.
|
|
21
|
-
|
|
22
|
-
### Legacy imports (still supported)
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
import { ActionBar, ActionBarAdditionalContent } from "@sps-woodland/action-bar";
|
|
26
|
-
import "@sps-woodland/action-bar/style.css";
|
|
27
|
-
```
|
|
3
|
+
SPS Woodland Design System Action Bar component
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare const root: string;
|
|
2
|
+
declare const content: string;
|
|
3
|
+
declare const contentMainBar: string;
|
|
4
|
+
declare const itemsSelected: string;
|
|
5
|
+
declare const itemsSelectedTag: string;
|
|
6
|
+
declare const actionButtons: string;
|
|
7
|
+
declare const clearSelected: string;
|
|
8
|
+
declare const additionalContent: string;
|
|
9
|
+
export { root, content, contentMainBar, itemsSelected, itemsSelectedTag, actionButtons, clearSelected, additionalContent, };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
export declare function ActionBar({ className, children, clearSelected, itemsSelected, itemsSelectedLabel, clearSelectedLabel, ...rest }: ComponentProps<{
|
|
4
|
+
clearSelected: () => void;
|
|
5
|
+
itemsSelected: number | string;
|
|
6
|
+
itemsSelectedLabel?: string;
|
|
7
|
+
clearSelectedLabel?: string;
|
|
8
|
+
}>): React.ReactElement;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,10 +1,82 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { Button as h } from "@sps-woodland/buttons";
|
|
3
|
+
import { Metadata as r, Box as S, cl as l, selectChildren as f } from "@sps-woodland/core";
|
|
4
|
+
import { Tag as b } from "@sps-woodland/tags";
|
|
5
|
+
import { useWoodlandLanguage as A } from "@spscommerce/i18n";
|
|
6
|
+
import { code as s } from "@spscommerce/utils";
|
|
7
|
+
var w = "pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s90", v = "pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s91", g = "pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s92", k = "pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s93", C = "pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s94", x = "pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s95", E = "pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s96", I = "pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s97";
|
|
8
|
+
function i({
|
|
9
|
+
className: t,
|
|
10
|
+
children: n,
|
|
11
|
+
...a
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ e.createElement(
|
|
14
|
+
S,
|
|
15
|
+
{
|
|
16
|
+
className: l(I, t),
|
|
17
|
+
...a
|
|
18
|
+
},
|
|
19
|
+
n
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
r.set(i, {
|
|
23
|
+
name: "ActionBarAdditionalContent",
|
|
24
|
+
props: {}
|
|
25
|
+
});
|
|
26
|
+
function d({
|
|
27
|
+
className: t,
|
|
28
|
+
children: n,
|
|
29
|
+
clearSelected: a,
|
|
30
|
+
itemsSelected: c,
|
|
31
|
+
itemsSelectedLabel: m,
|
|
32
|
+
clearSelectedLabel: u,
|
|
33
|
+
...p
|
|
34
|
+
}) {
|
|
35
|
+
const { t: o } = A(), [_, B] = f(n, [
|
|
36
|
+
{ type: i }
|
|
37
|
+
]);
|
|
38
|
+
return Number(c) > 0 ? /* @__PURE__ */ e.createElement(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: l(w, t),
|
|
42
|
+
...p
|
|
43
|
+
},
|
|
44
|
+
/* @__PURE__ */ e.createElement("div", { className: v }, _, /* @__PURE__ */ e.createElement("div", { className: g }, /* @__PURE__ */ e.createElement("div", { className: k }, /* @__PURE__ */ e.createElement(b, { kind: "info", className: C }, c), m ?? o("listActionBar.itemsSelected", { defaultValue: "Items Selected" })), /* @__PURE__ */ e.createElement("div", { className: x }, B), /* @__PURE__ */ e.createElement("div", { className: E }, /* @__PURE__ */ e.createElement(
|
|
45
|
+
h,
|
|
46
|
+
{
|
|
47
|
+
title: o("listActionBar.clearSelected", { defaultValue: "Clear Selected" }),
|
|
48
|
+
kind: "link",
|
|
49
|
+
icon: "x",
|
|
50
|
+
onPress: a
|
|
51
|
+
},
|
|
52
|
+
u ?? o("listActionBar.clearSelected", { defaultValue: "Clear Selected" })
|
|
53
|
+
))))
|
|
54
|
+
) : /* @__PURE__ */ e.createElement(e.Fragment, null);
|
|
55
|
+
}
|
|
56
|
+
r.set(d, {
|
|
57
|
+
name: "ActionBar",
|
|
58
|
+
props: {
|
|
59
|
+
clearSelected: {
|
|
60
|
+
type: "() => void",
|
|
61
|
+
required: !0
|
|
62
|
+
},
|
|
63
|
+
itemsSelected: {
|
|
64
|
+
type: "number | string",
|
|
65
|
+
required: !0
|
|
66
|
+
},
|
|
67
|
+
itemsSelectedLabel: {
|
|
68
|
+
type: "string",
|
|
69
|
+
required: !1
|
|
70
|
+
},
|
|
71
|
+
clearSelectedLabel: {
|
|
72
|
+
type: "string",
|
|
73
|
+
required: !1
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const y = {
|
|
78
|
+
components: [d, i],
|
|
79
|
+
description: () => /* @__PURE__ */ e.createElement("p", null, "The Action Bar contains the action buttons relevant to selected items from a Table List, Row List, or Card List. The Action Bar is only visible when one or more list items have been selected and appears anchored to the bottom of the page above all other content."),
|
|
8
80
|
examples: {
|
|
9
81
|
general: {
|
|
10
82
|
label: "General Usage",
|
|
@@ -16,7 +88,7 @@ const a = {
|
|
|
16
88
|
description: "This example makes use of the Text Buttons + Icon Buttons + Basic Buttons Group.",
|
|
17
89
|
examples: {
|
|
18
90
|
basic: {
|
|
19
|
-
react:
|
|
91
|
+
react: s`
|
|
20
92
|
import { ActionBar } from "@sps-woodland/action-bar";
|
|
21
93
|
import { Button } from "@sps-woodland/buttons";
|
|
22
94
|
import { Vr } from "@sps-woodland/core";
|
|
@@ -71,7 +143,7 @@ const a = {
|
|
|
71
143
|
description: "If needed, the text that appears next to the Tag indicating the number of items that have been selected can be customized, as well as the text for the Clear Selected button.",
|
|
72
144
|
examples: {
|
|
73
145
|
basic: {
|
|
74
|
-
react:
|
|
146
|
+
react: s`
|
|
75
147
|
import { ActionBar } from "@sps-woodland/action-bar";
|
|
76
148
|
import { Button } from "@sps-woodland/buttons";
|
|
77
149
|
|
|
@@ -120,7 +192,7 @@ const a = {
|
|
|
120
192
|
description: "An Action Bar may contain additional content that is not part of the action buttons group, which is displayed above the main content.",
|
|
121
193
|
examples: {
|
|
122
194
|
basic: {
|
|
123
|
-
react:
|
|
195
|
+
react: s`
|
|
124
196
|
import { ActionBar, ActionBarAdditionalContent } from "@sps-woodland/action-bar";
|
|
125
197
|
import { Button } from "@sps-woodland/buttons";
|
|
126
198
|
import { Card } from "@sps-woodland/cards";
|
|
@@ -158,9 +230,11 @@ const a = {
|
|
|
158
230
|
}
|
|
159
231
|
}
|
|
160
232
|
}
|
|
161
|
-
},
|
|
162
|
-
"Action Bar":
|
|
233
|
+
}, P = {
|
|
234
|
+
"Action Bar": y
|
|
163
235
|
};
|
|
164
236
|
export {
|
|
165
|
-
|
|
237
|
+
d as ActionBar,
|
|
238
|
+
i as ActionBarAdditionalContent,
|
|
239
|
+
P as MANIFEST
|
|
166
240
|
};
|
package/lib/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("react"),require("@sps-woodland/buttons"),require("@sps-woodland/core"),require("@sps-woodland/tags"),require("@spscommerce/i18n"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/buttons","@sps-woodland/core","@sps-woodland/tags","@spscommerce/i18n","@spscommerce/utils"],i):(e=typeof globalThis<"u"?globalThis:e||self,i(e.ActionBar={},e.React,e.buttons,e.core,e.tags,e.i18n,e.utils))})(this,(function(e,i,u,s,p,_,l){"use strict";function B(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const o in n)if(o!=="default"){const c=Object.getOwnPropertyDescriptor(n,o);Object.defineProperty(a,o,c.get?c:{enumerable:!0,get:()=>n[o]})}}return a.default=n,Object.freeze(a)}const t=B(i);var h="pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s90",f="pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s91",S="pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s92",b="pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s93",A="pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s94",w="pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s95",g="pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s96",v="pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s97";function r({className:n,children:a,...o}){return t.createElement(s.Box,{className:s.cl(v,n),...o},a)}s.Metadata.set(r,{name:"ActionBarAdditionalContent",props:{}});function d({className:n,children:a,clearSelected:o,itemsSelected:c,itemsSelectedLabel:C,clearSelectedLabel:x,...y}){const{t:m}=_.useWoodlandLanguage(),[E,I]=s.selectChildren(a,[{type:r}]);return Number(c)>0?t.createElement("div",{className:s.cl(h,n),...y},t.createElement("div",{className:f},E,t.createElement("div",{className:S},t.createElement("div",{className:b},t.createElement(p.Tag,{kind:"info",className:A},c),C??m("listActionBar.itemsSelected",{defaultValue:"Items Selected"})),t.createElement("div",{className:w},I),t.createElement("div",{className:g},t.createElement(u.Button,{title:m("listActionBar.clearSelected",{defaultValue:"Clear Selected"}),kind:"link",icon:"x",onPress:o},x??m("listActionBar.clearSelected",{defaultValue:"Clear Selected"})))))):t.createElement(t.Fragment,null)}s.Metadata.set(d,{name:"ActionBar",props:{clearSelected:{type:"() => void",required:!0},itemsSelected:{type:"number | string",required:!0},itemsSelectedLabel:{type:"string",required:!1},clearSelectedLabel:{type:"string",required:!1}}});const k={"Action Bar":{components:[d,r],description:()=>t.createElement("p",null,"The Action Bar contains the action buttons relevant to selected items from a Table List, Row List, or Card List. The Action Bar is only visible when one or more list items have been selected and appears anchored to the bottom of the page above all other content."),examples:{general:{label:"General Usage",description:""},actionBar:{label:"Action Bar",description:"This example makes use of the Text Buttons + Icon Buttons + Basic Buttons Group.",examples:{basic:{react:l.code`
|
|
2
2
|
import { ActionBar } from "@sps-woodland/action-bar";
|
|
3
3
|
import { Button } from "@sps-woodland/buttons";
|
|
4
4
|
import { Vr } from "@sps-woodland/core";
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
</ActionBar>
|
|
45
45
|
</>
|
|
46
46
|
}
|
|
47
|
-
`}}},customLabel:{label:"Custom Labels",description:"If needed, the text that appears next to the Tag indicating the number of items that have been selected can be customized, as well as the text for the Clear Selected button.",examples:{basic:{react:
|
|
47
|
+
`}}},customLabel:{label:"Custom Labels",description:"If needed, the text that appears next to the Tag indicating the number of items that have been selected can be customized, as well as the text for the Clear Selected button.",examples:{basic:{react:l.code`
|
|
48
48
|
import { ActionBar } from "@sps-woodland/action-bar";
|
|
49
49
|
import { Button } from "@sps-woodland/buttons";
|
|
50
50
|
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
</ActionBar>
|
|
85
85
|
</>
|
|
86
86
|
}
|
|
87
|
-
`}}},addlContent:{label:"Additional Content",description:"An Action Bar may contain additional content that is not part of the action buttons group, which is displayed above the main content.",examples:{basic:{react:
|
|
87
|
+
`}}},addlContent:{label:"Additional Content",description:"An Action Bar may contain additional content that is not part of the action buttons group, which is displayed above the main content.",examples:{basic:{react:l.code`
|
|
88
88
|
import { ActionBar, ActionBarAdditionalContent } from "@sps-woodland/action-bar";
|
|
89
89
|
import { Button } from "@sps-woodland/buttons";
|
|
90
90
|
import { Card } from "@sps-woodland/cards";
|
|
@@ -117,4 +117,4 @@
|
|
|
117
117
|
</ActionBar>
|
|
118
118
|
</>
|
|
119
119
|
}
|
|
120
|
-
`}}}}}};e.
|
|
120
|
+
`}}}}}};e.ActionBar=d,e.ActionBarAdditionalContent=r,e.MANIFEST=k,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s90{background-color:#fff;display:flex;bottom:0;position:fixed;justify-content:center;left:0;right:0;padding:.5rem;box-shadow:0 0 .25rem .25rem #1f282c1a;z-index:99}.pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s91{display:flex;flex-direction:column;max-width:1280px;padding-left:1.25rem;padding-right:1.25rem;width:100%}.pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s92{height:2rem;display:flex;align-items:center;width:100%}.pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s93{flex:1}.pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s94{margin-right:.25rem}.pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s95{display:flex;flex:2;align-items:center;justify-content:center}.pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s96{flex:1;text-align:right}.pkg_sps-woodland_action-bar__version_8_52_0__hash_9yu2s97{margin-bottom:.5rem}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/action-bar",
|
|
3
3
|
"description": "SPS Woodland Design System Action Bar component",
|
|
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/action-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"
|
|
@@ -30,19 +29,28 @@
|
|
|
30
29
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
31
30
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
31
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
33
|
-
"@sps-woodland/
|
|
32
|
+
"@sps-woodland/buttons": "8.52.0",
|
|
33
|
+
"@sps-woodland/core": "8.52.0",
|
|
34
|
+
"@sps-woodland/tags": "8.52.0",
|
|
35
|
+
"@sps-woodland/tokens": "8.52.0",
|
|
36
|
+
"@spscommerce/i18n": "8.52.0"
|
|
34
37
|
},
|
|
35
38
|
"devDependencies": {
|
|
36
39
|
"@spscommerce/utils": "9.0.3",
|
|
40
|
+
"@vanilla-extract/css": "1.17.4",
|
|
41
|
+
"@vanilla-extract/recipes": "0.2.5",
|
|
37
42
|
"react": "16.14.0",
|
|
38
43
|
"react-dom": "16.14.0",
|
|
39
|
-
"@sps-woodland/
|
|
44
|
+
"@sps-woodland/buttons": "8.52.0",
|
|
45
|
+
"@sps-woodland/core": "8.52.0",
|
|
46
|
+
"@sps-woodland/tags": "8.52.0",
|
|
47
|
+
"@sps-woodland/tokens": "8.52.0",
|
|
48
|
+
"@spscommerce/i18n": "8.52.0"
|
|
40
49
|
},
|
|
41
50
|
"scripts": {
|
|
42
|
-
"build": "pnpm run build:js && pnpm run build:types
|
|
51
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
43
52
|
"build:js": "vite build",
|
|
44
53
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
45
|
-
"build:css": "cp ../core/lib/action-bar/style.css lib/style.css 2>/dev/null || echo 'action-bar style.css not found, skipping'",
|
|
46
54
|
"watch": "vite build --watch",
|
|
47
55
|
"clean": "git clean -fdX",
|
|
48
56
|
"pub": "node ../../../scripts/publish-package.mjs"
|
package/vite.config.mjs
CHANGED
|
@@ -1,24 +1,33 @@
|
|
|
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
|
+
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
console.log({ packageVersion });
|
|
9
10
|
|
|
10
11
|
export default defineConfig({
|
|
12
|
+
plugins: [
|
|
13
|
+
vanillaExtractPlugin(
|
|
14
|
+
getVanillaExtractPluginProps({
|
|
15
|
+
packageName: pkg.name,
|
|
16
|
+
packageVersion,
|
|
17
|
+
})
|
|
18
|
+
),
|
|
19
|
+
],
|
|
11
20
|
build: {
|
|
12
21
|
lib: {
|
|
13
22
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
14
23
|
name: "ActionBar",
|
|
15
24
|
fileName: "index",
|
|
25
|
+
cssFileName: "style",
|
|
16
26
|
},
|
|
17
27
|
outDir: path.resolve(__dirname, "./lib"),
|
|
18
28
|
emptyOutDir: false,
|
|
19
29
|
rollupOptions: {
|
|
20
|
-
|
|
21
|
-
external: (id) => !id.endsWith(".css") && peerDeps.some((dep) => id === dep || id.startsWith(dep + "/")),
|
|
30
|
+
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
|
22
31
|
},
|
|
23
32
|
},
|
|
24
33
|
});
|