@sps-woodland/filter-tiles 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 -18
- package/lib/filter-tile/FilterTile.css.d.ts +36 -0
- package/lib/filter-tile/FilterTile.d.ts +8 -0
- package/lib/filter-tile-set/FilterTileSet.css.d.ts +1 -0
- package/lib/filter-tile-set/FilterTileSet.d.ts +3 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +106 -12
- package/lib/index.umd.cjs +3 -4
- package/lib/style.css +1 -1
- package/package.json +8 -11
- package/vite.config.mjs +14 -5
package/README.md
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
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
|
|
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
|
-
```
|
|
3
|
+
SPS Woodland Design System filter-tile and filter-tile-set components
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const tileSet: string;
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -1,17 +1,109 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import * as a from "react";
|
|
2
|
+
import { Metadata as g, cl as u } from "@sps-woodland/core";
|
|
3
|
+
import { code as b } from "@spscommerce/utils";
|
|
4
|
+
function w(e, _, t) {
|
|
5
|
+
return _ in e ? Object.defineProperty(e, _, {
|
|
6
|
+
value: t,
|
|
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_52_0__hash_1ub5g6g0", y = v({ defaultClassName: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g1", variantClassNames: { kind: { general: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g2", error: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g3", success: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g4", warning: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g5", processing: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g6" }, active: { true: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g7" } }, defaultVariants: {}, compoundVariants: [[{ kind: "general", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g8"], [{ kind: "warning", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g9"], [{ kind: "error", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6ga"], [{ kind: "processing", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gb"], [{ kind: "success", active: !0 }, "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gc"]] }), T = "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gd", F = "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6ge", S = v({ defaultClassName: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gf", variantClassNames: { kind: { general: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gg", error: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gh", success: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gi", warning: "pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gj", processing: "pkg_sps-woodland_filter-tiles__version_8_52_0__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_52_0__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],
|
|
7
100
|
examples: {
|
|
8
101
|
basic: {
|
|
9
102
|
label: "Filter Tiles",
|
|
10
103
|
examples: {
|
|
11
104
|
basic: {
|
|
12
|
-
react:
|
|
13
|
-
import { FilterTile } from "@sps-woodland/
|
|
14
|
-
import { FilterTileSet } from "@sps-woodland/core/filter-tile-set";
|
|
105
|
+
react: b`
|
|
106
|
+
import { FilterTile, FilterTileSet } from "@sps-woodland/filter-tiles";
|
|
15
107
|
function MyComponent() {
|
|
16
108
|
const data = [
|
|
17
109
|
|
|
@@ -57,9 +149,11 @@ return (
|
|
|
57
149
|
}
|
|
58
150
|
}
|
|
59
151
|
}
|
|
60
|
-
},
|
|
61
|
-
"Filter Tiles":
|
|
152
|
+
}, V = {
|
|
153
|
+
"Filter Tiles": P
|
|
62
154
|
};
|
|
63
155
|
export {
|
|
64
|
-
|
|
156
|
+
c as FilterTile,
|
|
157
|
+
f as FilterTileSet,
|
|
158
|
+
V as MANIFEST
|
|
65
159
|
};
|
package/lib/index.umd.cjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
import { FilterTile } from "@sps-woodland/
|
|
3
|
-
import { FilterTileSet } from "@sps-woodland/core/filter-tile-set";
|
|
1
|
+
(function(s,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react"),require("@sps-woodland/core"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@spscommerce/utils"],n):(s=typeof globalThis<"u"?globalThis:s||self,n(s.FilterTiles={},s.React,s.core,s.utils))})(this,(function(s,n,o,h){"use strict";function b(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(i,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return i.default=e,Object.freeze(i)}const l=b(n);function w(e,i,t){return i in e?Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[i]=t,e}function f(e,i){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);i&&(r=r.filter(function(_){return Object.getOwnPropertyDescriptor(e,_).enumerable})),t.push.apply(t,r)}return t}function v(e){for(var i=1;i<arguments.length;i++){var t=arguments[i]!=null?arguments[i]:{};i%2?f(Object(t),!0).forEach(function(r){w(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):f(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}var k=(e,i,t)=>{for(var r of Object.keys(e)){var _;if(e[r]!==((_=i[r])!==null&&_!==void 0?_:t[r]))return!1}return!0},m=e=>i=>{var t=e.defaultClassName,r=v(v({},e.defaultVariants),i);for(var _ in r){var u,d=(u=r[_])!==null&&u!==void 0?u:e.defaultVariants[_];if(d!=null){var a=d;typeof a=="boolean"&&(a=a===!0?"true":"false");var p=e.variantClassNames[_][a];p&&(t+=" "+p)}}for(var[E,N]of e.compoundVariants)k(E,r,e.defaultVariants)&&(t+=" "+N);return t},O="pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g0",T=m({defaultClassName:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g1",variantClassNames:{kind:{general:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g2",error:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g3",success:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g4",warning:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g5",processing:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g6"},active:{true:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g7"}},defaultVariants:{},compoundVariants:[[{kind:"general",active:!0},"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g8"],[{kind:"warning",active:!0},"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g9"],[{kind:"error",active:!0},"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6ga"],[{kind:"processing",active:!0},"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gb"],[{kind:"success",active:!0},"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gc"]]}),y="pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gd",F="pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6ge",S=m({defaultClassName:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gf",variantClassNames:{kind:{general:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gg",error:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gh",success:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gi",warning:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gj",processing:"pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gk"}},defaultVariants:{kind:"general"},compoundVariants:[]});function c({value:e,title:i,active:t,kind:r="general",className:_,...u}){const[d,a]=l.useState(!1),p=t||d;return l.createElement("div",{className:o.cl(O,_),...u},l.createElement("div",{className:T({kind:r,active:p}),onMouseOver:()=>a(!0),onMouseOut:()=>a(!1)},l.createElement("div",{className:y},e),l.createElement("div",{className:F},i)),l.createElement("div",{className:o.cl(S({kind:r}))}))}o.Metadata.set(c,{name:"Fitler tile",props:{value:{type:"number",required:!0},title:{type:"string",required:!0},active:{type:"boolean"},kind:{type:"FilterTileKind",default:"general"}}});var j="pkg_sps-woodland_filter-tiles__version_8_52_0__hash_wqmu9d0";function g({className:e,children:i,...t}){return l.createElement("div",{className:o.cl(j,e),...t},i)}o.Metadata.set(g,{name:"Filter Tile Set"});const P={"Filter Tiles":{components:[c,g],examples:{basic:{label:"Filter Tiles",examples:{basic:{react:h.code`
|
|
2
|
+
import { FilterTile, FilterTileSet } from "@sps-woodland/filter-tiles";
|
|
4
3
|
function MyComponent() {
|
|
5
4
|
const data = [
|
|
6
5
|
|
|
@@ -41,4 +40,4 @@ return (
|
|
|
41
40
|
</FilterTileSet>
|
|
42
41
|
);
|
|
43
42
|
}
|
|
44
|
-
`}}}}}};
|
|
43
|
+
`}}}}}};s.FilterTile=c,s.FilterTileSet=g,s.MANIFEST=P,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|
package/lib/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.pkg_sps-
|
|
1
|
+
.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g0{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_filter-tiles__version_8_52_0__hash_1ub5g6g0:first-child{margin-left:0}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g0:last-child{margin-right:0}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g1{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_filter-tiles__version_8_52_0__hash_1ub5g6g8{border-color:#007db8;background-color:#e6f2f8}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6g9{border-color:#e7760b;background-color:#fcf1e7}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6ga{border-color:#de002e;background-color:#fbe6ea}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gb{border-color:#91467f;background-color:#f4ecf2}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gc{border-color:#0b8940;background-color:#e7f3ec}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gd{min-height:1.875rem;font-size:1.875rem;line-height:1.875rem;font-weight:600;text-align:center}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6ge{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_filter-tiles__version_8_52_0__hash_1ub5g6gf{height:.25rem}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gg{background-color:#007db8}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gh{background-color:#de002e}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gi{background-color:#0b8940}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gj{background-color:#e7760b}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_1ub5g6gk{background-color:#91467f}.pkg_sps-woodland_filter-tiles__version_8_52_0__hash_wqmu9d0{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.52.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,10 +20,6 @@
|
|
|
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"
|
|
27
23
|
}
|
|
28
24
|
},
|
|
29
25
|
"publishConfig": {
|
|
@@ -33,21 +29,22 @@
|
|
|
33
29
|
"@spscommerce/utils": "^7.0.0 || ^8.0.0 || ^9.0.0",
|
|
34
30
|
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
35
31
|
"react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
36
|
-
"@sps-woodland/core": "8.
|
|
37
|
-
"@sps-woodland/tokens": "8.
|
|
32
|
+
"@sps-woodland/core": "8.52.0",
|
|
33
|
+
"@sps-woodland/tokens": "8.52.0"
|
|
38
34
|
},
|
|
39
35
|
"devDependencies": {
|
|
40
36
|
"@spscommerce/utils": "9.0.3",
|
|
37
|
+
"@vanilla-extract/css": "1.17.4",
|
|
38
|
+
"@vanilla-extract/recipes": "0.2.5",
|
|
41
39
|
"react": "16.14.0",
|
|
42
40
|
"react-dom": "16.14.0",
|
|
43
|
-
"@sps-woodland/core": "8.
|
|
44
|
-
"@sps-woodland/tokens": "8.
|
|
41
|
+
"@sps-woodland/core": "8.52.0",
|
|
42
|
+
"@sps-woodland/tokens": "8.52.0"
|
|
45
43
|
},
|
|
46
44
|
"scripts": {
|
|
47
|
-
"build": "pnpm run build:js && pnpm run build:types
|
|
45
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
48
46
|
"build:js": "vite build",
|
|
49
47
|
"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'",
|
|
51
48
|
"watch": "vite build --watch",
|
|
52
49
|
"clean": "git clean -fdX",
|
|
53
50
|
"pub": "node ../../../scripts/publish-package.mjs"
|
package/vite.config.mjs
CHANGED
|
@@ -1,22 +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
|
|
|
7
|
+
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
8
|
+
|
|
5
9
|
export default defineConfig({
|
|
10
|
+
plugins: [
|
|
11
|
+
vanillaExtractPlugin(
|
|
12
|
+
getVanillaExtractPluginProps({
|
|
13
|
+
packageName: pkg.name,
|
|
14
|
+
packageVersion,
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
],
|
|
6
18
|
build: {
|
|
7
19
|
lib: {
|
|
8
20
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
9
21
|
name: "FilterTiles",
|
|
10
22
|
fileName: "index",
|
|
23
|
+
cssFileName: "style",
|
|
11
24
|
},
|
|
12
25
|
outDir: path.resolve(__dirname, "./lib"),
|
|
13
26
|
emptyOutDir: false,
|
|
14
27
|
rollupOptions: {
|
|
15
|
-
|
|
16
|
-
external: (id) => {
|
|
17
|
-
const peerDeps = pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [];
|
|
18
|
-
return peerDeps.some((dep) => id === dep || id.startsWith(dep + "/"));
|
|
19
|
-
},
|
|
28
|
+
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
|
20
29
|
},
|
|
21
30
|
},
|
|
22
31
|
});
|