@phillips/seldon 1.43.0 → 1.44.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/dist/assets/chevronDown.svg.js +5 -0
- package/dist/components/Dropdown/Dropdown.d.ts +32 -0
- package/dist/components/Dropdown/Dropdown.js +49 -0
- package/dist/components/Dropdown/index.d.ts +1 -0
- package/dist/components/Dropdown/types.d.ts +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +33 -31
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +521 -0
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +373 -0
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +203 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +128 -0
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +129 -0
- package/dist/node_modules/@radix-ui/number/dist/index.js +6 -0
- package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +220 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +824 -0
- package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
- package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
- package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -0
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/components/Dropdown/_dropdown.scss +86 -0
- package/package.json +2 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as u from "react";
|
|
2
|
+
function t(r) {
|
|
3
|
+
const e = u.useRef({ value: r, previous: r });
|
|
4
|
+
return u.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
t as usePrevious
|
|
8
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as h from "react";
|
|
2
|
+
import { useLayoutEffect as z } from "../../react-use-layout-effect/dist/index.js";
|
|
3
|
+
function c(r) {
|
|
4
|
+
const [d, e] = h.useState(void 0);
|
|
5
|
+
return z(() => {
|
|
6
|
+
if (r) {
|
|
7
|
+
e({ width: r.offsetWidth, height: r.offsetHeight });
|
|
8
|
+
const f = new ResizeObserver((i) => {
|
|
9
|
+
if (!Array.isArray(i) || !i.length)
|
|
10
|
+
return;
|
|
11
|
+
const b = i[0];
|
|
12
|
+
let o, t;
|
|
13
|
+
if ("borderBoxSize" in b) {
|
|
14
|
+
const s = b.borderBoxSize, u = Array.isArray(s) ? s[0] : s;
|
|
15
|
+
o = u.inlineSize, t = u.blockSize;
|
|
16
|
+
} else
|
|
17
|
+
o = r.offsetWidth, t = r.offsetHeight;
|
|
18
|
+
e({ width: o, height: t });
|
|
19
|
+
});
|
|
20
|
+
return f.observe(r, { box: "border-box" }), () => f.unobserve(r);
|
|
21
|
+
} else
|
|
22
|
+
e(void 0);
|
|
23
|
+
}, [r]), d;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
c as useSize
|
|
27
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
import { Primitive as a } from "../../react-primitive/dist/index.js";
|
|
3
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
4
|
+
var t = "VisuallyHidden", d = e.forwardRef(
|
|
5
|
+
(r, i) => /* @__PURE__ */ o(
|
|
6
|
+
a.span,
|
|
7
|
+
{
|
|
8
|
+
...r,
|
|
9
|
+
ref: i,
|
|
10
|
+
style: {
|
|
11
|
+
// See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss
|
|
12
|
+
position: "absolute",
|
|
13
|
+
border: 0,
|
|
14
|
+
width: 1,
|
|
15
|
+
height: 1,
|
|
16
|
+
padding: 0,
|
|
17
|
+
margin: -1,
|
|
18
|
+
overflow: "hidden",
|
|
19
|
+
clip: "rect(0, 0, 0, 0)",
|
|
20
|
+
whiteSpace: "nowrap",
|
|
21
|
+
wordWrap: "normal",
|
|
22
|
+
...r.style
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
);
|
|
27
|
+
d.displayName = t;
|
|
28
|
+
export {
|
|
29
|
+
d as VisuallyHidden
|
|
30
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
@use '../../allPartials' as *;
|
|
2
|
+
|
|
3
|
+
.#{$px}-dropdown {
|
|
4
|
+
@include text($body3);
|
|
5
|
+
|
|
6
|
+
&__trigger {
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: $white;
|
|
9
|
+
border: none;
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
gap: 10px;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
padding: $spacing-xsm;
|
|
14
|
+
|
|
15
|
+
svg {
|
|
16
|
+
height: 16px;
|
|
17
|
+
width: 16px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&-icon-expanded {
|
|
21
|
+
transform: rotateX(180deg);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&:hover {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&:focus {
|
|
29
|
+
box-shadow: 0 0 0 1px $light-gray;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__content {
|
|
34
|
+
background-color: $white;
|
|
35
|
+
border: 1px solid $light-gray;
|
|
36
|
+
|
|
37
|
+
// following will add additional arrows if list is near edge of viewport
|
|
38
|
+
max-height: var(--radix-select-content-available-height);
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__scroll-button,
|
|
43
|
+
&__scroll-button__up {
|
|
44
|
+
align-items: center;
|
|
45
|
+
cursor: default;
|
|
46
|
+
display: flex;
|
|
47
|
+
justify-content: center;
|
|
48
|
+
|
|
49
|
+
svg {
|
|
50
|
+
height: 16px;
|
|
51
|
+
width: 16px;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&__scroll-button__up {
|
|
56
|
+
transform: rotateX(180deg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&__viewport {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: $spacing-xsm;
|
|
63
|
+
padding: $spacing-sm 0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&__item {
|
|
67
|
+
@include text($body3);
|
|
68
|
+
|
|
69
|
+
align-items: center;
|
|
70
|
+
display: flex;
|
|
71
|
+
padding: 0 $padding-sm;
|
|
72
|
+
position: relative;
|
|
73
|
+
user-select: none;
|
|
74
|
+
|
|
75
|
+
&[data-disabled] {
|
|
76
|
+
color: $medium-gray;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&[data-highlighted] {
|
|
81
|
+
background-color: $light-gray;
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
outline: none;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phillips/seldon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.44.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/PhillipsAuctionHouse/seldon"
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@radix-ui/react-accordion": "^1.2.0",
|
|
44
44
|
"@radix-ui/react-dialog": "^1.1.1",
|
|
45
|
+
"@radix-ui/react-select": "^2.1.1",
|
|
45
46
|
"@types/dompurify": "^3.0.5",
|
|
46
47
|
"change-case": "^5.4.4",
|
|
47
48
|
"classnames": "^2.5.1",
|