@sps-woodland/action-bar 8.50.1 → 8.51.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 +25 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +13 -87
- package/lib/index.umd.cjs +4 -4
- package/lib/style.css +1 -1
- package/package.json +6 -14
- package/vite.config.mjs +5 -14
- package/lib/ActionBar.css.d.ts +0 -9
- package/lib/ActionBar.d.ts +0 -8
- package/lib/ActionBarAdditionalContent.d.ts +0 -3
package/README.md
CHANGED
|
@@ -1,3 +1,27 @@
|
|
|
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
|
|
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
|
+
```
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,82 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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."),
|
|
1
|
+
import { ActionBar as e, ActionBarAdditionalContent as o } from "@sps-woodland/core/action-bar";
|
|
2
|
+
export * from "@sps-woodland/core/action-bar";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { code as t } from "@spscommerce/utils";
|
|
5
|
+
const a = {
|
|
6
|
+
components: [e, o],
|
|
7
|
+
description: () => /* @__PURE__ */ n.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."),
|
|
80
8
|
examples: {
|
|
81
9
|
general: {
|
|
82
10
|
label: "General Usage",
|
|
@@ -88,7 +16,7 @@ const y = {
|
|
|
88
16
|
description: "This example makes use of the Text Buttons + Icon Buttons + Basic Buttons Group.",
|
|
89
17
|
examples: {
|
|
90
18
|
basic: {
|
|
91
|
-
react:
|
|
19
|
+
react: t`
|
|
92
20
|
import { ActionBar } from "@sps-woodland/action-bar";
|
|
93
21
|
import { Button } from "@sps-woodland/buttons";
|
|
94
22
|
import { Vr } from "@sps-woodland/core";
|
|
@@ -143,7 +71,7 @@ const y = {
|
|
|
143
71
|
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.",
|
|
144
72
|
examples: {
|
|
145
73
|
basic: {
|
|
146
|
-
react:
|
|
74
|
+
react: t`
|
|
147
75
|
import { ActionBar } from "@sps-woodland/action-bar";
|
|
148
76
|
import { Button } from "@sps-woodland/buttons";
|
|
149
77
|
|
|
@@ -192,7 +120,7 @@ const y = {
|
|
|
192
120
|
description: "An Action Bar may contain additional content that is not part of the action buttons group, which is displayed above the main content.",
|
|
193
121
|
examples: {
|
|
194
122
|
basic: {
|
|
195
|
-
react:
|
|
123
|
+
react: t`
|
|
196
124
|
import { ActionBar, ActionBarAdditionalContent } from "@sps-woodland/action-bar";
|
|
197
125
|
import { Button } from "@sps-woodland/buttons";
|
|
198
126
|
import { Card } from "@sps-woodland/cards";
|
|
@@ -230,11 +158,9 @@ const y = {
|
|
|
230
158
|
}
|
|
231
159
|
}
|
|
232
160
|
}
|
|
233
|
-
},
|
|
234
|
-
"Action Bar":
|
|
161
|
+
}, c = {
|
|
162
|
+
"Action Bar": a
|
|
235
163
|
};
|
|
236
164
|
export {
|
|
237
|
-
|
|
238
|
-
i as ActionBarAdditionalContent,
|
|
239
|
-
P as MANIFEST
|
|
165
|
+
c as MANIFEST
|
|
240
166
|
};
|
package/lib/index.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("@sps-woodland/core/action-bar"),require("react"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core/action-bar","react","@spscommerce/utils"],n):(e=typeof globalThis<"u"?globalThis:e||self,n(e.ActionBar={},e.actionBar,e.React,e.utils))})(this,(function(e,n,s,a){"use strict";function r(t){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(c,o,i.get?i:{enumerable:!0,get:()=>t[o]})}}return c.default=t,Object.freeze(c)}const l=r(s),d={"Action Bar":{components:[n.ActionBar,n.ActionBarAdditionalContent],description:()=>l.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:a.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:a.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:a.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.MANIFEST=d,Object.keys(n).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:()=>n[t]})}),Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_core__version_8_51_0__hash_nz1a1l0{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_core__version_8_51_0__hash_nz1a1l1{display:flex;flex-direction:column;max-width:1280px;padding-left:1.25rem;padding-right:1.25rem;width:100%}.pkg_sps-woodland_core__version_8_51_0__hash_nz1a1l2{height:2rem;display:flex;align-items:center;width:100%}.pkg_sps-woodland_core__version_8_51_0__hash_nz1a1l3{flex:1}.pkg_sps-woodland_core__version_8_51_0__hash_nz1a1l4{margin-right:.25rem}.pkg_sps-woodland_core__version_8_51_0__hash_nz1a1l5{display:flex;flex:2;align-items:center;justify-content:center}.pkg_sps-woodland_core__version_8_51_0__hash_nz1a1l6{flex:1;text-align:right}.pkg_sps-woodland_core__version_8_51_0__hash_nz1a1l7{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.51.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,6 +17,7 @@
|
|
|
17
17
|
"import": "./lib/index.js",
|
|
18
18
|
"default": "./lib/index.js"
|
|
19
19
|
},
|
|
20
|
+
"./style.css": "./lib/style.css",
|
|
20
21
|
"./lib/style.css": {
|
|
21
22
|
"import": "./lib/style.css",
|
|
22
23
|
"require": "./lib/style.css"
|
|
@@ -29,28 +30,19 @@
|
|
|
29
30
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
30
31
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
31
32
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
|
-
"@sps-woodland/
|
|
33
|
-
"@sps-woodland/core": "8.50.1",
|
|
34
|
-
"@sps-woodland/tags": "8.50.1",
|
|
35
|
-
"@sps-woodland/tokens": "8.50.1",
|
|
36
|
-
"@spscommerce/i18n": "8.50.1"
|
|
33
|
+
"@sps-woodland/core": "8.51.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
36
|
"@spscommerce/utils": "9.0.3",
|
|
40
|
-
"@vanilla-extract/css": "1.17.4",
|
|
41
|
-
"@vanilla-extract/recipes": "0.2.5",
|
|
42
37
|
"react": "16.14.0",
|
|
43
38
|
"react-dom": "16.14.0",
|
|
44
|
-
"@sps-woodland/
|
|
45
|
-
"@sps-woodland/core": "8.50.1",
|
|
46
|
-
"@sps-woodland/tags": "8.50.1",
|
|
47
|
-
"@sps-woodland/tokens": "8.50.1",
|
|
48
|
-
"@spscommerce/i18n": "8.50.1"
|
|
39
|
+
"@sps-woodland/core": "8.51.0"
|
|
49
40
|
},
|
|
50
41
|
"scripts": {
|
|
51
|
-
"build": "pnpm run build:js && pnpm run build:types",
|
|
42
|
+
"build": "pnpm run build:js && pnpm run build:types && pnpm run build:css",
|
|
52
43
|
"build:js": "vite build",
|
|
53
44
|
"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'",
|
|
54
46
|
"watch": "vite build --watch",
|
|
55
47
|
"clean": "git clean -fdX",
|
|
56
48
|
"pub": "node ../../../scripts/publish-package.mjs"
|
package/vite.config.mjs
CHANGED
|
@@ -1,33 +1,24 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
3
2
|
import { defineConfig } from "vite";
|
|
4
|
-
import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.mjs";
|
|
5
3
|
import pkg from "./package.json";
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
// Action-bar is now a wrapper package that re-exports from @sps-woodland/core.
|
|
6
|
+
// No vanilla-extract needed - CSS is provided by the mono-package.
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
const peerDeps = pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [];
|
|
10
9
|
|
|
11
10
|
export default defineConfig({
|
|
12
|
-
plugins: [
|
|
13
|
-
vanillaExtractPlugin(
|
|
14
|
-
getVanillaExtractPluginProps({
|
|
15
|
-
packageName: pkg.name,
|
|
16
|
-
packageVersion,
|
|
17
|
-
})
|
|
18
|
-
),
|
|
19
|
-
],
|
|
20
11
|
build: {
|
|
21
12
|
lib: {
|
|
22
13
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
23
14
|
name: "ActionBar",
|
|
24
15
|
fileName: "index",
|
|
25
|
-
cssFileName: "style",
|
|
26
16
|
},
|
|
27
17
|
outDir: path.resolve(__dirname, "./lib"),
|
|
28
18
|
emptyOutDir: false,
|
|
29
19
|
rollupOptions: {
|
|
30
|
-
|
|
20
|
+
// External must match subpath imports like @sps-woodland/core/action-bar
|
|
21
|
+
external: (id) => peerDeps.some((dep) => id === dep || id.startsWith(dep + "/")),
|
|
31
22
|
},
|
|
32
23
|
},
|
|
33
24
|
});
|
package/lib/ActionBar.css.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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, };
|
package/lib/ActionBar.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
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;
|