@phillips/seldon 1.43.0 → 1.44.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.
@@ -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
+ };
@@ -36,4 +36,5 @@
36
36
  @use 'components/Breadcrumb/breadcrumb';
37
37
  @use 'components/Drawer/drawer';
38
38
  @use 'components/HTMLParser/htmlParser';
39
+ @use 'components/Dropdown/dropdown';
39
40
  @use 'components/Video/video';
@@ -40,21 +40,21 @@
40
40
  }
41
41
 
42
42
  &[data-state='open'] {
43
- .phillips-accordion-item-label-plus__icon {
43
+ .#{$px}-accordion-item-label-plus__icon {
44
44
  display: none;
45
45
  }
46
46
 
47
- .phillips-accordion-item-label-minus__icon {
47
+ .#{$px}-accordion-item-label-minus__icon {
48
48
  display: block;
49
49
  }
50
50
  }
51
51
 
52
52
  &[data-state='closed'] {
53
- .phillips-accordion-item-label-plus__icon {
53
+ .#{$px}-accordion-item-label-plus__icon {
54
54
  display: block;
55
55
  }
56
56
 
57
- .phillips-accordion-item-label-minus__icon {
57
+ .#{$px}-accordion-item-label-minus__icon {
58
58
  display: none;
59
59
  }
60
60
  }
@@ -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.43.0",
3
+ "version": "1.44.1",
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",