@phillips/seldon 1.42.1 → 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.
Files changed (26) hide show
  1. package/dist/assets/chevronDown.svg.js +5 -0
  2. package/dist/components/Dropdown/Dropdown.d.ts +32 -0
  3. package/dist/components/Dropdown/Dropdown.js +49 -0
  4. package/dist/components/Dropdown/index.d.ts +1 -0
  5. package/dist/components/Dropdown/types.d.ts +4 -0
  6. package/dist/components/ViewingsList/ViewingsListCard.js +38 -38
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +33 -31
  9. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +521 -0
  10. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +373 -0
  11. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +203 -0
  12. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +128 -0
  13. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +129 -0
  14. package/dist/node_modules/@radix-ui/number/dist/index.js +6 -0
  15. package/dist/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  16. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +220 -0
  17. package/dist/node_modules/@radix-ui/react-select/dist/index.js +824 -0
  18. package/dist/node_modules/@radix-ui/react-use-previous/dist/index.js +8 -0
  19. package/dist/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  20. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +30 -0
  21. package/dist/scss/_vars.scss +1 -1
  22. package/dist/scss/componentStyles.scss +1 -0
  23. package/dist/scss/components/Dropdown/_dropdown.scss +86 -0
  24. package/dist/utils/index.d.ts +1 -1
  25. package/dist/utils/index.js +9 -9
  26. 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
+ };
@@ -1,5 +1,5 @@
1
1
  // prefix
2
- $px: phillips;
2
+ $px: seldon;
3
3
 
4
4
  ////////////////////////
5
5
  /// COlORS:
@@ -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';
@@ -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
+ }
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- export declare const px = "phillips";
2
+ export declare const px = "seldon";
3
3
  /**
4
4
  * Returns standard props values incorporating the component name into the class name and data-testid
5
5
  */
@@ -1,15 +1,15 @@
1
1
  import { jsx as m } from "react/jsx-runtime";
2
2
  import { kebabCase as d } from "../node_modules/change-case/dist/index.js";
3
3
  import * as u from "react";
4
- const i = "phillips", x = ({ id: e, ...n }, a) => {
4
+ const s = "seldon", x = ({ id: e, ...n }, a) => {
5
5
  const t = d(a);
6
6
  return {
7
7
  ...n,
8
8
  "data-testid": e ? `${t}-${e}` : `${t}`,
9
- className: `${i}-${t}`
9
+ className: `${s}-${t}`
10
10
  };
11
11
  };
12
- var p = /* @__PURE__ */ ((e) => (e.xs = "xs", e.sm = "sm", e.md = "md", e.lg = "lg", e.xl = "xl", e.xxl = "xxl", e))(p || {});
12
+ var $ = /* @__PURE__ */ ((e) => (e.xs = "xs", e.sm = "sm", e.md = "md", e.lg = "lg", e.xl = "xl", e.xxl = "xxl", e))($ || {});
13
13
  const v = () => {
14
14
  };
15
15
  function g({
@@ -18,7 +18,7 @@ function g({
18
18
  invalid: a = !1,
19
19
  invalidText: t = "invalid",
20
20
  readOnly: r = !1,
21
- type: s,
21
+ type: i,
22
22
  warn: l = !1,
23
23
  warnText: c
24
24
  }) {
@@ -26,14 +26,14 @@ function g({
26
26
  disabled: !r && e,
27
27
  invalid: !r && !e && a,
28
28
  invalidId: `${n}-error-msg`,
29
- type: s === "toggle" ? "checkbox" : s,
29
+ type: i === "toggle" ? "checkbox" : i,
30
30
  warn: !r && !e && !a && l,
31
31
  warnId: `${n}-warn-msg`,
32
32
  validation: null
33
33
  };
34
- return o.invalid && (o.validation = /* @__PURE__ */ m("div", { className: `${i}-input__validation ${i}-${s}-input--invalid`, id: o.invalidId, children: t })), o.warn && (o.validation = /* @__PURE__ */ m("div", { className: `${i}-input__validation ${i}-${s}-input--warn`, id: o.warnId, children: c })), o;
34
+ return o.invalid && (o.validation = /* @__PURE__ */ m("div", { className: `${s}-input__validation ${s}-${i}-input--invalid`, id: o.invalidId, children: t })), o.warn && (o.validation = /* @__PURE__ */ m("div", { className: `${s}-input__validation ${s}-${i}-input--warn`, id: o.warnId, children: c })), o;
35
35
  }
36
- const C = (/* @__PURE__ */ new Date()).getFullYear(), w = (e, n = "end", a = "vertical") => `${i}-padding-${a}-${e}-${n}`, h = (e) => /(.+)@(.+){2,}\.(.+){2,}/i.test(e), I = function(e, n, a = !1) {
36
+ const C = (/* @__PURE__ */ new Date()).getFullYear(), w = (e, n = "end", a = "vertical") => `${s}-padding-${a}-${e}-${n}`, h = (e) => /(.+)@(.+){2,}\.(.+){2,}/i.test(e), I = function(e, n, a = !1) {
37
37
  const t = u.Children.toArray(e).filter((r) => r && r.type === n && !a ? r : r && r.type !== n && a);
38
38
  return t.length > 0 ? t : null;
39
39
  }, N = (e) => {
@@ -41,7 +41,7 @@ const C = (/* @__PURE__ */ new Date()).getFullYear(), w = (e, n = "end", a = "ve
41
41
  return `${n[0]}?${r}`;
42
42
  };
43
43
  export {
44
- p as PaddingTokens,
44
+ $ as PaddingTokens,
45
45
  C as defaultYear,
46
46
  h as emailValidation,
47
47
  N as encodeURLSearchParams,
@@ -49,6 +49,6 @@ export {
49
49
  w as generatePaddingClassName,
50
50
  x as getCommonProps,
51
51
  v as noOp,
52
- i as px,
52
+ s as px,
53
53
  g as useNormalizedInputProps
54
54
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.42.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",