@sps-woodland/action-bar 8.50.2 → 8.51.1

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 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
@@ -1,3 +1,2 @@
1
- export * from "./ActionBar";
2
- export * from "./ActionBarAdditionalContent";
1
+ export * from "@sps-woodland/core/action-bar";
3
2
  export * from "./manifest";
package/lib/index.js CHANGED
@@ -1,82 +1,10 @@
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_50_2__hash_9yu2s90", v = "pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s91", g = "pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s92", k = "pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s93", C = "pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s94", x = "pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s95", E = "pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s96", I = "pkg_sps-woodland_action-bar__version_8_50_2__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."),
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: s`
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: s`
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: s`
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
- }, P = {
234
- "Action Bar": y
161
+ }, c = {
162
+ "Action Bar": a
235
163
  };
236
164
  export {
237
- d as ActionBar,
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,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_50_2__hash_9yu2s90",f="pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s91",S="pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s92",b="pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s93",A="pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s94",w="pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s95",g="pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s96",v="pkg_sps-woodland_action-bar__version_8_50_2__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`
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:l.code`
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:l.code`
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.ActionBar=d,e.ActionBarAdditionalContent=r,e.MANIFEST=k,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
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-woodland_action-bar__version_8_50_2__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_50_2__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_50_2__hash_9yu2s92{height:2rem;display:flex;align-items:center;width:100%}.pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s93{flex:1}.pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s94{margin-right:.25rem}.pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s95{display:flex;flex:2;align-items:center;justify-content:center}.pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s96{flex:1;text-align:right}.pkg_sps-woodland_action-bar__version_8_50_2__hash_9yu2s97{margin-bottom:.5rem}
1
+ .pkg_sps-woodland_core__version_8_51_1__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_1__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_1__hash_nz1a1l2{height:2rem;display:flex;align-items:center;width:100%}.pkg_sps-woodland_core__version_8_51_1__hash_nz1a1l3{flex:1}.pkg_sps-woodland_core__version_8_51_1__hash_nz1a1l4{margin-right:.25rem}.pkg_sps-woodland_core__version_8_51_1__hash_nz1a1l5{display:flex;flex:2;align-items:center;justify-content:center}.pkg_sps-woodland_core__version_8_51_1__hash_nz1a1l6{flex:1;text-align:right}.pkg_sps-woodland_core__version_8_51_1__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.50.2",
4
+ "version": "8.51.1",
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/buttons": "8.50.2",
33
- "@sps-woodland/core": "8.50.2",
34
- "@sps-woodland/tags": "8.50.2",
35
- "@sps-woodland/tokens": "8.50.2",
36
- "@spscommerce/i18n": "8.50.2"
33
+ "@sps-woodland/core": "8.51.1"
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/buttons": "8.50.2",
45
- "@sps-woodland/core": "8.50.2",
46
- "@sps-woodland/tokens": "8.50.2",
47
- "@sps-woodland/tags": "8.50.2",
48
- "@spscommerce/i18n": "8.50.2"
39
+ "@sps-woodland/core": "8.51.1"
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
- const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
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
- console.log({ packageVersion });
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
- external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
20
+ // External must match subpath imports like @sps-woodland/core/action-bar
21
+ external: (id) => !id.endsWith(".css") && peerDeps.some((dep) => id === dep || id.startsWith(dep + "/")),
31
22
  },
32
23
  },
33
24
  });
@@ -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, };
@@ -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;
@@ -1,3 +0,0 @@
1
- import * as React from "react";
2
- import type { ComponentProps, BoxProps } from "@sps-woodland/core";
3
- export declare function ActionBarAdditionalContent({ className, children, ...rest }: ComponentProps<Record<string, unknown>> & BoxProps): React.ReactElement;