@sps-woodland/filter-tiles 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 +18 -1
- package/lib/index.d.ts +1 -2
- package/lib/index.js +12 -106
- package/lib/index.umd.cjs +4 -3
- package/lib/style.css +1 -1
- package/package.json +11 -8
- package/vite.config.mjs +5 -14
- package/lib/filter-tile/FilterTile.css.d.ts +0 -36
- package/lib/filter-tile/FilterTile.d.ts +0 -8
- package/lib/filter-tile-set/FilterTileSet.css.d.ts +0 -1
- package/lib/filter-tile-set/FilterTileSet.d.ts +0 -3
package/README.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
1
|
## [@sps-woodland/filter-tiles](https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/filter-tiles#readme)
|
|
2
2
|
|
|
3
|
-
SPS Woodland Design System filter-tile and filter-tile-set components
|
|
3
|
+
SPS Woodland Design System filter-tile and filter-tile-set components.
|
|
4
|
+
|
|
5
|
+
This package now re-exports from `@sps-woodland/core`. New consumers should import directly from core:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
// Preferred (core, tree-shakes per component)
|
|
9
|
+
import { FilterTile } from "@sps-woodland/core/filter-tile";
|
|
10
|
+
import { FilterTileSet } from "@sps-woodland/core/filter-tile-set";
|
|
11
|
+
import "@sps-woodland/core/filter-tiles/style.css";
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The legacy wrapper import still works during the transition:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
// Still supported, re-exports from @sps-woodland/core
|
|
18
|
+
import { FilterTile, FilterTileSet } from "@sps-woodland/filter-tiles";
|
|
19
|
+
import "@sps-woodland/filter-tiles/style.css";
|
|
20
|
+
```
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,109 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
enumerable: !0,
|
|
8
|
-
configurable: !0,
|
|
9
|
-
writable: !0
|
|
10
|
-
}) : e[_] = t, e;
|
|
11
|
-
}
|
|
12
|
-
function d(e, _) {
|
|
13
|
-
var t = Object.keys(e);
|
|
14
|
-
if (Object.getOwnPropertySymbols) {
|
|
15
|
-
var r = Object.getOwnPropertySymbols(e);
|
|
16
|
-
_ && (r = r.filter(function(i) {
|
|
17
|
-
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
18
|
-
})), t.push.apply(t, r);
|
|
19
|
-
}
|
|
20
|
-
return t;
|
|
21
|
-
}
|
|
22
|
-
function p(e) {
|
|
23
|
-
for (var _ = 1; _ < arguments.length; _++) {
|
|
24
|
-
var t = arguments[_] != null ? arguments[_] : {};
|
|
25
|
-
_ % 2 ? d(Object(t), !0).forEach(function(r) {
|
|
26
|
-
w(e, r, t[r]);
|
|
27
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : d(Object(t)).forEach(function(r) {
|
|
28
|
-
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return e;
|
|
32
|
-
}
|
|
33
|
-
var k = (e, _, t) => {
|
|
34
|
-
for (var r of Object.keys(e)) {
|
|
35
|
-
var i;
|
|
36
|
-
if (e[r] !== ((i = _[r]) !== null && i !== void 0 ? i : t[r]))
|
|
37
|
-
return !1;
|
|
38
|
-
}
|
|
39
|
-
return !0;
|
|
40
|
-
}, v = (e) => (_) => {
|
|
41
|
-
var t = e.defaultClassName, r = p(p({}, e.defaultVariants), _);
|
|
42
|
-
for (var i in r) {
|
|
43
|
-
var l, n = (l = r[i]) !== null && l !== void 0 ? l : e.defaultVariants[i];
|
|
44
|
-
if (n != null) {
|
|
45
|
-
var s = n;
|
|
46
|
-
typeof s == "boolean" && (s = s === !0 ? "true" : "false");
|
|
47
|
-
var o = (
|
|
48
|
-
// @ts-expect-error
|
|
49
|
-
e.variantClassNames[i][s]
|
|
50
|
-
);
|
|
51
|
-
o && (t += " " + o);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
for (var [m, h] of e.compoundVariants)
|
|
55
|
-
k(m, r, e.defaultVariants) && (t += " " + h);
|
|
56
|
-
return t;
|
|
57
|
-
}, O = "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g0", y = v({ defaultClassName: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g1", variantClassNames: { kind: { general: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g2", error: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g3", success: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g4", warning: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g5", processing: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g6" }, active: { true: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g7" } }, defaultVariants: {}, compoundVariants: [[{ kind: "general", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g8"], [{ kind: "warning", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6g9"], [{ kind: "error", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6ga"], [{ kind: "processing", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gb"], [{ kind: "success", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gc"]] }), T = "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gd", F = "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6ge", S = v({ defaultClassName: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gf", variantClassNames: { kind: { general: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gg", error: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gh", success: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gi", warning: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gj", processing: "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_1ub5g6gk" } }, defaultVariants: { kind: "general" }, compoundVariants: [] });
|
|
58
|
-
function c({
|
|
59
|
-
value: e,
|
|
60
|
-
title: _,
|
|
61
|
-
active: t,
|
|
62
|
-
kind: r = "general",
|
|
63
|
-
className: i,
|
|
64
|
-
...l
|
|
65
|
-
}) {
|
|
66
|
-
const [n, s] = a.useState(!1), o = t || n;
|
|
67
|
-
return /* @__PURE__ */ a.createElement("div", { className: u(O, i), ...l }, /* @__PURE__ */ a.createElement(
|
|
68
|
-
"div",
|
|
69
|
-
{
|
|
70
|
-
className: y({ kind: r, active: o }),
|
|
71
|
-
onMouseOver: () => s(!0),
|
|
72
|
-
onMouseOut: () => s(!1)
|
|
73
|
-
},
|
|
74
|
-
/* @__PURE__ */ a.createElement("div", { className: T }, e),
|
|
75
|
-
/* @__PURE__ */ a.createElement("div", { className: F }, _)
|
|
76
|
-
), /* @__PURE__ */ a.createElement("div", { className: u(S({ kind: r })) }));
|
|
77
|
-
}
|
|
78
|
-
g.set(c, {
|
|
79
|
-
name: "Fitler tile",
|
|
80
|
-
props: {
|
|
81
|
-
value: { type: "number", required: !0 },
|
|
82
|
-
title: { type: "string", required: !0 },
|
|
83
|
-
active: { type: "boolean" },
|
|
84
|
-
kind: { type: "FilterTileKind", default: "general" }
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
var E = "pkg_sps-woodland_filter-tiles__version_8_50_1__hash_wqmu9d0";
|
|
88
|
-
function f({
|
|
89
|
-
className: e,
|
|
90
|
-
children: _,
|
|
91
|
-
...t
|
|
92
|
-
}) {
|
|
93
|
-
return /* @__PURE__ */ a.createElement("div", { className: u(E, e), ...t }, _);
|
|
94
|
-
}
|
|
95
|
-
g.set(f, {
|
|
96
|
-
name: "Filter Tile Set"
|
|
97
|
-
});
|
|
98
|
-
const P = {
|
|
99
|
-
components: [c, f],
|
|
1
|
+
export * from "@sps-woodland/core/filter-tiles";
|
|
2
|
+
import { code as e } from "@spscommerce/utils";
|
|
3
|
+
import { FilterTile as t } from "@sps-woodland/core/filter-tile";
|
|
4
|
+
import { FilterTileSet as i } from "@sps-woodland/core/filter-tile-set";
|
|
5
|
+
const l = {
|
|
6
|
+
components: [t, i],
|
|
100
7
|
examples: {
|
|
101
8
|
basic: {
|
|
102
9
|
label: "Filter Tiles",
|
|
103
10
|
examples: {
|
|
104
11
|
basic: {
|
|
105
|
-
react:
|
|
106
|
-
import { FilterTile
|
|
12
|
+
react: e`
|
|
13
|
+
import { FilterTile } from "@sps-woodland/core/filter-tile";
|
|
14
|
+
import { FilterTileSet } from "@sps-woodland/core/filter-tile-set";
|
|
107
15
|
function MyComponent() {
|
|
108
16
|
const data = [
|
|
109
17
|
|
|
@@ -149,11 +57,9 @@ return (
|
|
|
149
57
|
}
|
|
150
58
|
}
|
|
151
59
|
}
|
|
152
|
-
},
|
|
153
|
-
"Filter Tiles":
|
|
60
|
+
}, a = {
|
|
61
|
+
"Filter Tiles": l
|
|
154
62
|
};
|
|
155
63
|
export {
|
|
156
|
-
|
|
157
|
-
f as FilterTileSet,
|
|
158
|
-
V as MANIFEST
|
|
64
|
+
a as MANIFEST
|
|
159
65
|
};
|
package/lib/index.umd.cjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
import { FilterTile
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("@sps-woodland/core/filter-tiles"),require("@spscommerce/utils"),require("@sps-woodland/core/filter-tile"),require("@sps-woodland/core/filter-tile-set")):typeof define=="function"&&define.amd?define(["exports","@sps-woodland/core/filter-tiles","@spscommerce/utils","@sps-woodland/core/filter-tile","@sps-woodland/core/filter-tile-set"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.FilterTiles={},e.filterTiles,e.utils,e.filterTile,e.filterTileSet))})(this,(function(e,t,l,r,o){"use strict";const s={"Filter Tiles":{components:[r.FilterTile,o.FilterTileSet],examples:{basic:{label:"Filter Tiles",examples:{basic:{react:l.code`
|
|
2
|
+
import { FilterTile } from "@sps-woodland/core/filter-tile";
|
|
3
|
+
import { FilterTileSet } from "@sps-woodland/core/filter-tile-set";
|
|
3
4
|
function MyComponent() {
|
|
4
5
|
const data = [
|
|
5
6
|
|
|
@@ -40,4 +41,4 @@ return (
|
|
|
40
41
|
</FilterTileSet>
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
|
-
`}}}}}};
|
|
44
|
+
`}}}}}};e.MANIFEST=s,Object.keys(t).forEach(i=>{i!=="default"&&!Object.prototype.hasOwnProperty.call(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:()=>t[i]})}),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_1fdabiv0{min-height:6.625rem;max-width:15.625rem;min-width:6.875rem;flex:1;display:flex;flex-direction:column;justify-content:flex-end;margin-right:.25rem;margin-left:.25rem}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabiv0:first-child{margin-left:0}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabiv0:last-child{margin-right:0}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabiv1{padding:1rem;color:#1f282c;background-color:#fff;border-width:.0625rem;border-color:#d2d4d4;border-style:solid;border-top-left-radius:.25rem;border-top-right-radius:.25rem;cursor:pointer;height:100%}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabiv8{border-color:#007db8;background-color:#e6f2f8}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabiv9{border-color:#e7760b;background-color:#fcf1e7}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabiva{border-color:#de002e;background-color:#fbe6ea}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivb{border-color:#91467f;background-color:#f4ecf2}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivc{border-color:#0b8940;background-color:#e7f3ec}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivd{min-height:1.875rem;font-size:1.875rem;line-height:1.875rem;font-weight:600;text-align:center}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabive{min-height:2.25rem;font-size:.875rem;line-height:1.125rem;display:flex;justify-content:center;align-items:center;text-align:center;word-break:break-word}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivf{height:.25rem}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivg{background-color:#007db8}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivh{background-color:#de002e}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivi{background-color:#0b8940}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivj{background-color:#e7760b}.pkg_sps-woodland_core__version_8_51_0__hash_1fdabivk{background-color:#91467f}.pkg_sps-woodland_core__version_8_51_0__hash_4quq2n0{display:flex}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/filter-tiles",
|
|
3
3
|
"description": "SPS Woodland Design System filter tile 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/filter-tiles",
|
|
@@ -20,6 +20,10 @@
|
|
|
20
20
|
"./lib/style.css": {
|
|
21
21
|
"import": "./lib/style.css",
|
|
22
22
|
"require": "./lib/style.css"
|
|
23
|
+
},
|
|
24
|
+
"./style.css": {
|
|
25
|
+
"import": "./lib/style.css",
|
|
26
|
+
"require": "./lib/style.css"
|
|
23
27
|
}
|
|
24
28
|
},
|
|
25
29
|
"publishConfig": {
|
|
@@ -29,22 +33,21 @@
|
|
|
29
33
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
30
34
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
31
35
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
|
-
"@sps-woodland/core": "8.
|
|
33
|
-
"@sps-woodland/tokens": "8.
|
|
36
|
+
"@sps-woodland/core": "8.51.0",
|
|
37
|
+
"@sps-woodland/tokens": "8.51.0"
|
|
34
38
|
},
|
|
35
39
|
"devDependencies": {
|
|
36
40
|
"@spscommerce/utils": "9.0.3",
|
|
37
|
-
"@vanilla-extract/css": "1.17.4",
|
|
38
|
-
"@vanilla-extract/recipes": "0.2.5",
|
|
39
41
|
"react": "16.14.0",
|
|
40
42
|
"react-dom": "16.14.0",
|
|
41
|
-
"@sps-woodland/core": "8.
|
|
42
|
-
"@sps-woodland/tokens": "8.
|
|
43
|
+
"@sps-woodland/core": "8.51.0",
|
|
44
|
+
"@sps-woodland/tokens": "8.51.0"
|
|
43
45
|
},
|
|
44
46
|
"scripts": {
|
|
45
|
-
"build": "pnpm run build:js && pnpm run build:types",
|
|
47
|
+
"build": "pnpm run build:js && pnpm run build:types && pnpm run build:css",
|
|
46
48
|
"build:js": "vite build",
|
|
47
49
|
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
50
|
+
"build:css": "cp ../core/lib/filter-tiles/style.css lib/style.css 2>/dev/null || echo 'filter-tiles style.css not found, skipping'",
|
|
48
51
|
"watch": "vite build --watch",
|
|
49
52
|
"clean": "git clean -fdX",
|
|
50
53
|
"pub": "node ../../../scripts/publish-package.mjs"
|
package/vite.config.mjs
CHANGED
|
@@ -1,31 +1,22 @@
|
|
|
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;
|
|
8
|
-
|
|
9
5
|
export default defineConfig({
|
|
10
|
-
plugins: [
|
|
11
|
-
vanillaExtractPlugin(
|
|
12
|
-
getVanillaExtractPluginProps({
|
|
13
|
-
packageName: pkg.name,
|
|
14
|
-
packageVersion,
|
|
15
|
-
})
|
|
16
|
-
),
|
|
17
|
-
],
|
|
18
6
|
build: {
|
|
19
7
|
lib: {
|
|
20
8
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
21
9
|
name: "FilterTiles",
|
|
22
10
|
fileName: "index",
|
|
23
|
-
cssFileName: "style",
|
|
24
11
|
},
|
|
25
12
|
outDir: path.resolve(__dirname, "./lib"),
|
|
26
13
|
emptyOutDir: false,
|
|
27
14
|
rollupOptions: {
|
|
28
|
-
|
|
15
|
+
// External must match subpath imports like @sps-woodland/core/filter-tiles
|
|
16
|
+
external: (id) => {
|
|
17
|
+
const peerDeps = pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [];
|
|
18
|
+
return peerDeps.some((dep) => id === dep || id.startsWith(dep + "/"));
|
|
19
|
+
},
|
|
29
20
|
},
|
|
30
21
|
},
|
|
31
22
|
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Tokens } from "@sps-woodland/tokens";
|
|
2
|
-
export type FilterTileKind = keyof (typeof Tokens.component)["filter-tile"]["kind"];
|
|
3
|
-
export declare const tile: string;
|
|
4
|
-
export declare const tileBody: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
5
|
-
kind: {
|
|
6
|
-
general: {};
|
|
7
|
-
error: {};
|
|
8
|
-
success: {};
|
|
9
|
-
warning: {};
|
|
10
|
-
processing: {};
|
|
11
|
-
};
|
|
12
|
-
active: {
|
|
13
|
-
true: {};
|
|
14
|
-
};
|
|
15
|
-
}>;
|
|
16
|
-
export declare const tileValue: string;
|
|
17
|
-
export declare const tileTitle: string;
|
|
18
|
-
export declare const tileFooter: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
19
|
-
kind: {
|
|
20
|
-
general: {
|
|
21
|
-
backgroundColor: string;
|
|
22
|
-
};
|
|
23
|
-
error: {
|
|
24
|
-
backgroundColor: string;
|
|
25
|
-
};
|
|
26
|
-
success: {
|
|
27
|
-
backgroundColor: string;
|
|
28
|
-
};
|
|
29
|
-
warning: {
|
|
30
|
-
backgroundColor: string;
|
|
31
|
-
};
|
|
32
|
-
processing: {
|
|
33
|
-
backgroundColor: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from "@sps-woodland/core";
|
|
2
|
-
import type { FilterTileKind } from "./FilterTile.css";
|
|
3
|
-
export declare function FilterTile({ value, title, active: isActiveProp, kind, className, ...rest }: ComponentProps<{
|
|
4
|
-
value: number;
|
|
5
|
-
title: string;
|
|
6
|
-
active?: boolean;
|
|
7
|
-
kind?: FilterTileKind;
|
|
8
|
-
}>): JSX.Element;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const tileSet: string;
|