@sps-woodland/dropdowns 8.35.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 +3 -0
- package/lib/dropdown/Dropdown.css.d.ts +73 -0
- package/lib/dropdown/Dropdown.d.ts +15 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +180 -0
- package/lib/index.umd.cjs +1 -0
- package/lib/option-list/Option.css.d.ts +2 -0
- package/lib/option-list/Option.d.ts +5 -0
- package/lib/option-list/OptionList.css.d.ts +2 -0
- package/lib/option-list/OptionList.d.ts +11 -0
- package/lib/style.css +1 -0
- package/package.json +56 -0
- package/vite.config.mjs +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export declare const dropdown: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
2
|
+
kind: {
|
|
3
|
+
default: {
|
|
4
|
+
background: string;
|
|
5
|
+
color: string;
|
|
6
|
+
borderColor: string;
|
|
7
|
+
selectors: {
|
|
8
|
+
"&:hover": {
|
|
9
|
+
background: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
key: {
|
|
14
|
+
background: string;
|
|
15
|
+
color: string;
|
|
16
|
+
borderColor: string;
|
|
17
|
+
selectors: {
|
|
18
|
+
"&:hover": {
|
|
19
|
+
background: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
confirm: {
|
|
24
|
+
background: string;
|
|
25
|
+
color: string;
|
|
26
|
+
borderColor: string;
|
|
27
|
+
selectors: {
|
|
28
|
+
"&:hover": {
|
|
29
|
+
background: string;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
delete: {
|
|
34
|
+
background: string;
|
|
35
|
+
color: string;
|
|
36
|
+
borderColor: string;
|
|
37
|
+
selectors: {
|
|
38
|
+
"&:hover": {
|
|
39
|
+
background: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
disabled: {
|
|
45
|
+
true: {
|
|
46
|
+
cursor: "not-allowed";
|
|
47
|
+
color: string;
|
|
48
|
+
background: string;
|
|
49
|
+
borderColor: string;
|
|
50
|
+
};
|
|
51
|
+
false: {};
|
|
52
|
+
};
|
|
53
|
+
spinning: {
|
|
54
|
+
true: {
|
|
55
|
+
display: "inline-block";
|
|
56
|
+
color: "transparent !important";
|
|
57
|
+
cursor: "not-allowed";
|
|
58
|
+
};
|
|
59
|
+
false: {};
|
|
60
|
+
};
|
|
61
|
+
}>;
|
|
62
|
+
export declare const icon: string;
|
|
63
|
+
export declare const dropdownArrow: string;
|
|
64
|
+
export declare const spinner: import("@vanilla-extract/recipes/dist/declarations/src/types").RuntimeFn<{
|
|
65
|
+
spinning: {
|
|
66
|
+
true: {
|
|
67
|
+
cursor: "not-allowed";
|
|
68
|
+
};
|
|
69
|
+
false: {
|
|
70
|
+
display: "none";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
import type { IconName } from "@sps-woodland/tokens";
|
|
4
|
+
export declare function Dropdown({ label, disabled, icon, kind, maxHeightPx, maxHeightRem, spinning, onOpen, onClose, loading, className, children, ...rest }: ComponentProps<{
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
icon?: IconName;
|
|
8
|
+
kind?: "default" | "key" | "confirm" | "delete";
|
|
9
|
+
maxHeightPx?: number;
|
|
10
|
+
maxHeightRem?: number;
|
|
11
|
+
spinning?: boolean;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
onOpen?: () => void;
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
}>): React.ReactElement<HTMLButtonElement>;
|
package/lib/index.d.ts
ADDED
package/lib/index.js
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import * as _ from "react";
|
|
2
|
+
import { Metadata as h, useChildTestIdAttrBuilder as E, modChildren as P, cl as m, Spinner as b, Icon as g, selectChildren as N } from "@sps-woodland/core";
|
|
3
|
+
import { MenuProvider as V, MenuButton as C, MenuItem as D, Menu as I } from "@ariakit/react";
|
|
4
|
+
import { useWoodlandLanguage as L } from "@spscommerce/i18n";
|
|
5
|
+
function M(e, r, n) {
|
|
6
|
+
return r in e ? Object.defineProperty(e, r, {
|
|
7
|
+
value: n,
|
|
8
|
+
enumerable: !0,
|
|
9
|
+
configurable: !0,
|
|
10
|
+
writable: !0
|
|
11
|
+
}) : e[r] = n, e;
|
|
12
|
+
}
|
|
13
|
+
function k(e, r) {
|
|
14
|
+
var n = Object.keys(e);
|
|
15
|
+
if (Object.getOwnPropertySymbols) {
|
|
16
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
17
|
+
r && (o = o.filter(function(s) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(e, s).enumerable;
|
|
19
|
+
})), n.push.apply(n, o);
|
|
20
|
+
}
|
|
21
|
+
return n;
|
|
22
|
+
}
|
|
23
|
+
function y(e) {
|
|
24
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
25
|
+
var n = arguments[r] != null ? arguments[r] : {};
|
|
26
|
+
r % 2 ? k(Object(n), !0).forEach(function(o) {
|
|
27
|
+
M(e, o, n[o]);
|
|
28
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : k(Object(n)).forEach(function(o) {
|
|
29
|
+
Object.defineProperty(e, o, Object.getOwnPropertyDescriptor(n, o));
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return e;
|
|
33
|
+
}
|
|
34
|
+
var S = (e, r, n) => {
|
|
35
|
+
for (var o of Object.keys(e)) {
|
|
36
|
+
var s;
|
|
37
|
+
if (e[o] !== ((s = r[o]) !== null && s !== void 0 ? s : n[o]))
|
|
38
|
+
return !1;
|
|
39
|
+
}
|
|
40
|
+
return !0;
|
|
41
|
+
}, O = (e) => (r) => {
|
|
42
|
+
var n = e.defaultClassName, o = y(y({}, e.defaultVariants), r);
|
|
43
|
+
for (var s in o) {
|
|
44
|
+
var a, t = (a = o[s]) !== null && a !== void 0 ? a : e.defaultVariants[s];
|
|
45
|
+
if (t != null) {
|
|
46
|
+
var d = t;
|
|
47
|
+
typeof d == "boolean" && (d = d === !0 ? "true" : "false");
|
|
48
|
+
var p = (
|
|
49
|
+
// @ts-expect-error
|
|
50
|
+
e.variantClassNames[s][d]
|
|
51
|
+
);
|
|
52
|
+
p && (n += " " + p);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
for (var [i, l] of e.compoundVariants)
|
|
56
|
+
S(i, o, e.defaultVariants) && (n += " " + l);
|
|
57
|
+
return n;
|
|
58
|
+
}, x = O({ defaultClassName: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz0", variantClassNames: { kind: { default: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz1", key: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz2", confirm: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz3", delete: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz4" }, disabled: { true: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz5", false: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz6" }, spinning: { true: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz7", false: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz8" } }, defaultVariants: { kind: "default", disabled: !1, spinning: !1 }, compoundVariants: [] }), B = "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz9", W = "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdza", q = O({ defaultClassName: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzb", variantClassNames: { spinning: { true: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzc", false: "pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzd" } }, defaultVariants: {}, compoundVariants: [] });
|
|
59
|
+
function A({
|
|
60
|
+
label: e,
|
|
61
|
+
disabled: r,
|
|
62
|
+
icon: n,
|
|
63
|
+
kind: o = "default",
|
|
64
|
+
maxHeightPx: s,
|
|
65
|
+
maxHeightRem: a,
|
|
66
|
+
spinning: t,
|
|
67
|
+
onOpen: d,
|
|
68
|
+
onClose: p,
|
|
69
|
+
loading: i,
|
|
70
|
+
className: l,
|
|
71
|
+
children: u,
|
|
72
|
+
...f
|
|
73
|
+
}) {
|
|
74
|
+
const { t: c } = L(), w = _.useRef(null), v = E(f), j = _.useMemo(
|
|
75
|
+
() => P(u, () => [
|
|
76
|
+
{
|
|
77
|
+
maxHeightPx: s,
|
|
78
|
+
maxHeightRem: a,
|
|
79
|
+
buttonRef: w,
|
|
80
|
+
loading: i,
|
|
81
|
+
onClose: p
|
|
82
|
+
}
|
|
83
|
+
]),
|
|
84
|
+
[u]
|
|
85
|
+
);
|
|
86
|
+
return /* @__PURE__ */ _.createElement(V, null, /* @__PURE__ */ _.createElement(
|
|
87
|
+
C,
|
|
88
|
+
{
|
|
89
|
+
ref: w,
|
|
90
|
+
className: m(x({ kind: o, disabled: r, spinning: t }), l),
|
|
91
|
+
disabled: r || t,
|
|
92
|
+
"data-testid": `${v}__dropdown`,
|
|
93
|
+
...f
|
|
94
|
+
},
|
|
95
|
+
t && /* @__PURE__ */ _.createElement(
|
|
96
|
+
b,
|
|
97
|
+
{
|
|
98
|
+
color: o === "default" ? "dark" : "light",
|
|
99
|
+
className: q({ spinning: t }),
|
|
100
|
+
title: c("button.spinningTitle", { defaultValue: "Loading..." }),
|
|
101
|
+
"data-testid": `${v}__spinner`
|
|
102
|
+
}
|
|
103
|
+
),
|
|
104
|
+
n && /* @__PURE__ */ _.createElement(g, { icon: n, className: B, "aria-hidden": "true" }),
|
|
105
|
+
e,
|
|
106
|
+
/* @__PURE__ */ _.createElement(g, { icon: "chevron-down", className: W })
|
|
107
|
+
), j);
|
|
108
|
+
}
|
|
109
|
+
h.set(A, {
|
|
110
|
+
name: "Dropdown",
|
|
111
|
+
props: {
|
|
112
|
+
label: { type: "string", required: !0 },
|
|
113
|
+
disabled: "boolean",
|
|
114
|
+
icon: "IconName",
|
|
115
|
+
kind: { type: '"default" | "key" | "confirm" | "delete"', default: '"default"' },
|
|
116
|
+
maxHeightPx: "number",
|
|
117
|
+
maxHeightRem: "number",
|
|
118
|
+
spinning: "boolean"
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
var H = "pkg_sps-woodland_dropdowns__version_8_35_0__hash_qzju7d0", R = "pkg_sps-woodland_dropdowns__version_8_35_0__hash_qzju7d1";
|
|
122
|
+
function z({ disabled: e, children: r, ...n }) {
|
|
123
|
+
return /* @__PURE__ */ _.createElement(
|
|
124
|
+
D,
|
|
125
|
+
{
|
|
126
|
+
className: m(H, e && R),
|
|
127
|
+
"aria-disabled": e,
|
|
128
|
+
...n
|
|
129
|
+
},
|
|
130
|
+
r
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
h.set(z, {
|
|
134
|
+
name: "Option",
|
|
135
|
+
props: {}
|
|
136
|
+
});
|
|
137
|
+
var T = "pkg_sps-woodland_dropdowns__version_8_35_0__hash_1jben8t0", F = "pkg_sps-woodland_dropdowns__version_8_35_0__hash_1jben8t1";
|
|
138
|
+
function K({
|
|
139
|
+
buttonRef: e,
|
|
140
|
+
conformWidth: r,
|
|
141
|
+
maxHeightPx: n,
|
|
142
|
+
maxHeightRem: o,
|
|
143
|
+
minWidth: s,
|
|
144
|
+
loading: a,
|
|
145
|
+
onClose: t,
|
|
146
|
+
children: d,
|
|
147
|
+
...p
|
|
148
|
+
}) {
|
|
149
|
+
const [i, l] = _.useState(void 0);
|
|
150
|
+
_.useEffect(() => {
|
|
151
|
+
r && e?.current && l(e.current.offsetWidth);
|
|
152
|
+
}, [r, e]);
|
|
153
|
+
const u = n ? n / 16 : o, f = {
|
|
154
|
+
...u ? { maxHeight: `${u}rem` } : {},
|
|
155
|
+
...r && i ? { width: i } : {}
|
|
156
|
+
}, [c] = N(d, [{ type: z }]);
|
|
157
|
+
return /* @__PURE__ */ _.createElement(
|
|
158
|
+
I,
|
|
159
|
+
{
|
|
160
|
+
className: m(T),
|
|
161
|
+
style: f,
|
|
162
|
+
onClose: t,
|
|
163
|
+
preventBodyScroll: !0,
|
|
164
|
+
typeahead: !0,
|
|
165
|
+
...p
|
|
166
|
+
},
|
|
167
|
+
a ? /* @__PURE__ */ _.createElement(b, { className: F }) : c
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
h.set(K, {
|
|
171
|
+
name: "Option List",
|
|
172
|
+
props: {
|
|
173
|
+
conformWidth: "boolean"
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
export {
|
|
177
|
+
A as Dropdown,
|
|
178
|
+
z as Option,
|
|
179
|
+
K as OptionList
|
|
180
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(o,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("react"),require("@sps-woodland/core"),require("@ariakit/react"),require("@spscommerce/i18n")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@ariakit/react","@spscommerce/i18n"],f):(o=typeof globalThis<"u"?globalThis:o||self,f(o.Dropdowns={},o.React,o.core,o.react,o.i18n))})(this,function(o,f,s,h,E){"use strict";function N(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const a=N(f);function S(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(d){return Object.getOwnPropertyDescriptor(e,d).enumerable})),n.push.apply(n,r)}return n}function g(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?b(Object(n),!0).forEach(function(r){S(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}var D=(e,t,n)=>{for(var r of Object.keys(e)){var d;if(e[r]!==((d=t[r])!==null&&d!==void 0?d:n[r]))return!1}return!0},k=e=>t=>{var n=e.defaultClassName,r=g(g({},e.defaultVariants),t);for(var d in r){var i,_=(i=r[d])!==null&&i!==void 0?i:e.defaultVariants[d];if(_!=null){var p=_;typeof p=="boolean"&&(p=p===!0?"true":"false");var l=e.variantClassNames[d][p];l&&(n+=" "+l)}}for(var[u,c]of e.compoundVariants)D(u,r,e.defaultVariants)&&(n+=" "+c);return n},M=k({defaultClassName:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz0",variantClassNames:{kind:{default:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz1",key:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz2",confirm:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz3",delete:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz4"},disabled:{true:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz5",false:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz6"},spinning:{true:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz7",false:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz8"}},defaultVariants:{kind:"default",disabled:!1,spinning:!1},compoundVariants:[]}),V="pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz9",C="pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdza",q=k({defaultClassName:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzb",variantClassNames:{spinning:{true:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzc",false:"pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzd"}},defaultVariants:{},compoundVariants:[]});function O({label:e,disabled:t,icon:n,kind:r="default",maxHeightPx:d,maxHeightRem:i,spinning:_,onOpen:p,onClose:l,loading:u,className:c,children:w,...m}){const{t:y}=E.useWoodlandLanguage(),z=a.useRef(null),P=s.useChildTestIdAttrBuilder(m),R=a.useMemo(()=>s.modChildren(w,()=>[{maxHeightPx:d,maxHeightRem:i,buttonRef:z,loading:u,onClose:l}]),[w]);return a.createElement(h.MenuProvider,null,a.createElement(h.MenuButton,{ref:z,className:s.cl(M({kind:r,disabled:t,spinning:_}),c),disabled:t||_,"data-testid":`${P}__dropdown`,...m},_&&a.createElement(s.Spinner,{color:r==="default"?"dark":"light",className:q({spinning:_}),title:y("button.spinningTitle",{defaultValue:"Loading..."}),"data-testid":`${P}__spinner`}),n&&a.createElement(s.Icon,{icon:n,className:V,"aria-hidden":"true"}),e,a.createElement(s.Icon,{icon:"chevron-down",className:C})),R)}s.Metadata.set(O,{name:"Dropdown",props:{label:{type:"string",required:!0},disabled:"boolean",icon:"IconName",kind:{type:'"default" | "key" | "confirm" | "delete"',default:'"default"'},maxHeightPx:"number",maxHeightRem:"number",spinning:"boolean"}});var I="pkg_sps-woodland_dropdowns__version_8_35_0__hash_qzju7d0",L="pkg_sps-woodland_dropdowns__version_8_35_0__hash_qzju7d1";function v({disabled:e,children:t,...n}){return a.createElement(h.MenuItem,{className:s.cl(I,e&&L),"aria-disabled":e,...n},t)}s.Metadata.set(v,{name:"Option",props:{}});var T="pkg_sps-woodland_dropdowns__version_8_35_0__hash_1jben8t0",B="pkg_sps-woodland_dropdowns__version_8_35_0__hash_1jben8t1";function j({buttonRef:e,conformWidth:t,maxHeightPx:n,maxHeightRem:r,minWidth:d,loading:i,onClose:_,children:p,...l}){const[u,c]=a.useState(void 0);a.useEffect(()=>{t&&e?.current&&c(e.current.offsetWidth)},[t,e]);const w=n?n/16:r,m={...w?{maxHeight:`${w}rem`}:{},...t&&u?{width:u}:{}},[y]=s.selectChildren(p,[{type:v}]);return a.createElement(h.Menu,{className:s.cl(T),style:m,onClose:_,preventBodyScroll:!0,typeahead:!0,...l},i?a.createElement(s.Spinner,{className:B}):y)}s.Metadata.set(j,{name:"Option List",props:{conformWidth:"boolean"}}),o.Dropdown=O,o.Option=v,o.OptionList=j,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { ComponentProps } from "@sps-woodland/core";
|
|
3
|
+
export declare function OptionList({ buttonRef, conformWidth, maxHeightPx, maxHeightRem, minWidth, loading, onClose, children, ...rest }: ComponentProps<{
|
|
4
|
+
buttonRef?: any;
|
|
5
|
+
conformWidth?: boolean;
|
|
6
|
+
maxHeightPx?: number;
|
|
7
|
+
maxHeightRem?: number;
|
|
8
|
+
minWidth?: number;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
}>): React.JSX.Element;
|
package/lib/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz0{color:inherit;text-decoration:none;padding-top:.5rem;padding-bottom:.5rem;padding-left:1rem;border-width:.0625rem;border-style:solid;border-radius:.25rem;cursor:pointer;display:inline-block;font-size:.75rem;font-weight:600;line-height:.875rem;position:relative;padding-right:30px}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz0:focus{outline-color:#007db8;outline-style:solid;outline-offset:.125rem;outline-width:.125rem;box-shadow:0 0 0 6px #fff}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz0[aria-expanded=true]{border-radius:.25rem .25rem 0 0}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz1{background:#e9e9ea;color:#4b5356;border-color:#d2d4d4}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz1:hover{background:#d2d4d4}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz2{background:#4b5356;color:#fff;border-color:#1f282c}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz2:hover{background:#1f282c}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz3{background:#007db8;color:#fff;border-color:#09638d}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz3:hover{background:#09638d}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz4{background:#de002e;color:#fff;border-color:#a30d2d}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz4:hover{background:#a30d2d}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz5{cursor:not-allowed;color:#717779;background:#fff;border-color:#d2d4d4}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz7{display:inline-block;color:transparent!important;cursor:not-allowed}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdz9{line-height:0;font-size:.875rem;margin-right:.25rem}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdza{line-height:0;font-size:.75rem;position:absolute;top:10px;right:12px}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzb{left:50%;margin:-.875rem -.4375rem;position:absolute;top:22px}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzc{cursor:not-allowed}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzd{display:none}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_16yekdzb>i{border-width:.125rem;height:.875rem;width:.875rem;display:block}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_qzju7d0{cursor:pointer;display:block;font-weight:400;padding:.5rem 1rem;white-space:break-spaces;overflow-wrap:break-word}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_qzju7d0:hover{background:#e6f2f8}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_qzju7d0:focus{background:#e6f2f8;outline:.125rem solid #007db8ff!important;outline-offset:.125rem;box-shadow:0 0 0 6px #fff}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_qzju7d1{color:#717779}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_1jben8t0{background:#fff;border-style:solid;border-width:.0625rem;border-radius:.25rem;border-top-left-radius:0;border-top-right-radius:0;border-color:#717779;font-size:.75rem;overflow-y:auto;overscroll-behavior:contain;z-index:100}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_1jben8t0:focus{outline:.125rem solid #007db8ff!important;outline-offset:.125rem;box-shadow:0 0 0 6px #fff}.pkg_sps-woodland_dropdowns__version_8_35_0__hash_1jben8t1{margin:1rem 4rem}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sps-woodland/dropdowns",
|
|
3
|
+
"description": "SPS Woodland Design System dropdown form components",
|
|
4
|
+
"version": "8.35.0",
|
|
5
|
+
"author": "SPS Commerce",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/forms-core",
|
|
8
|
+
"homepage": "https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/forms-core#readme",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"module": "./lib/index.js",
|
|
11
|
+
"main": "./lib/index.umd.cjs",
|
|
12
|
+
"types": "./lib/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./lib/index.d.ts",
|
|
16
|
+
"require": "./lib/index.umd.cjs",
|
|
17
|
+
"import": "./lib/index.js",
|
|
18
|
+
"default": "./lib/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./lib/style.css": {
|
|
21
|
+
"import": "./lib/style.css",
|
|
22
|
+
"require": "./lib/style.css"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@ariakit/react": "^0.4.15",
|
|
30
|
+
"@spscommerce/utils": "^7.0.0 || ^8.0.0",
|
|
31
|
+
"react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
32
|
+
"react-dom": "^16.14.0",
|
|
33
|
+
"@sps-woodland/core": "8.35.0",
|
|
34
|
+
"@sps-woodland/tokens": "8.35.0",
|
|
35
|
+
"@spscommerce/i18n": "8.35.0"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@ariakit/react": "^0.4.15",
|
|
39
|
+
"@spscommerce/utils": "^7.0.0",
|
|
40
|
+
"@vanilla-extract/css": "^1.9.3",
|
|
41
|
+
"@vanilla-extract/recipes": "^0.2.5",
|
|
42
|
+
"react": "^16.14.0",
|
|
43
|
+
"react-dom": "^16.14.0",
|
|
44
|
+
"@sps-woodland/core": "8.35.0",
|
|
45
|
+
"@sps-woodland/tokens": "8.35.0",
|
|
46
|
+
"@spscommerce/i18n": "8.35.0"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
50
|
+
"build:js": "vite build",
|
|
51
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
52
|
+
"watch": "vite build --watch",
|
|
53
|
+
"clean": "git clean -fdX",
|
|
54
|
+
"pub": "node ../../../scripts/publish-package.mjs"
|
|
55
|
+
}
|
|
56
|
+
}
|
package/vite.config.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
3
|
+
import { defineConfig } from "vite";
|
|
4
|
+
import { getVanillaExtractPluginProps } from "../../../scripts/vanilla-extract-plugin-props.mjs";
|
|
5
|
+
import pkg from "./package.json";
|
|
6
|
+
|
|
7
|
+
const packageVersion = process.env.PREDICTED_VERSION || pkg.version;
|
|
8
|
+
|
|
9
|
+
export default defineConfig({
|
|
10
|
+
plugins: [
|
|
11
|
+
vanillaExtractPlugin(
|
|
12
|
+
getVanillaExtractPluginProps({
|
|
13
|
+
packageName: pkg.name,
|
|
14
|
+
packageVersion,
|
|
15
|
+
})
|
|
16
|
+
),
|
|
17
|
+
],
|
|
18
|
+
build: {
|
|
19
|
+
lib: {
|
|
20
|
+
entry: path.resolve(__dirname, "src/index.ts"),
|
|
21
|
+
name: "Dropdowns",
|
|
22
|
+
fileName: "index",
|
|
23
|
+
cssFileName: "style",
|
|
24
|
+
},
|
|
25
|
+
outDir: path.resolve(__dirname, "./lib"),
|
|
26
|
+
emptyOutDir: false,
|
|
27
|
+
rollupOptions: {
|
|
28
|
+
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
});
|