@phillips/seldon 1.149.2 → 1.150.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.
@@ -1,37 +1,30 @@
1
- import { jsx as e, jsxs as C } from "react/jsx-runtime";
2
- import { forwardRef as h, useState as u } from "react";
3
- import { getCommonProps as g, px as s } from "../../utils/index.js";
4
- import N from "../../node_modules/classnames/index.js";
5
- import { TextVariants as O } from "../Text/types.js";
6
- import T from "../Text/Text.js";
7
- import { Root as $, Trigger as x, Portal as y, Content as w, Item as A } from "../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
8
- import I from "../Icon/Icon.js";
1
+ import { jsx as e, jsxs as b } from "react/jsx-runtime";
2
+ import { forwardRef as C, useState as h } from "react";
3
+ import { getCommonProps as g } from "../../utils/index.js";
4
+ import u from "../../node_modules/classnames/index.js";
5
+ import { TextVariants as N } from "../Text/types.js";
6
+ import O from "../Text/Text.js";
7
+ import { Root as T, Trigger as x, Portal as I, Content as A, Item as L } from "../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
8
+ import P from "../Icon/Icon.js";
9
9
  import "../Link/types.js";
10
- import L from "../Link/Link.js";
11
- import { generateGoogleCalendarLink as P, generateOutlookOnlineLink as R, generateYahooCalendarLink as S, generateCalendarFile as j } from "./calendarLinks.js";
12
- const G = h(
13
- ({ className: c, event: o, label: d = "Add to calendar", linkElement: m = L, ...n }, b) => {
14
- const { className: l, ...f } = g(n, "AddToCalendar"), [t, i] = u(!1), k = (a, r) => {
15
- a === "file" ? j(o) : a === "link" && r && window.open(r, "_blank");
10
+ import $ from "../Link/Link.js";
11
+ import { generateGoogleCalendarLink as w, generateOutlookOnlineLink as R, generateYahooCalendarLink as S, generateCalendarFile as j } from "./calendarLinks.js";
12
+ import y from "../IconButton/IconButton.js";
13
+ const G = C(
14
+ ({ className: r, event: o, label: s = "Add to calendar", linkElement: d = $, ...n }, m) => {
15
+ const { className: l, ...c } = g(n, "AddToCalendar"), [t, f] = h(!1), k = (a, i) => {
16
+ a === "file" ? j(o) : a === "link" && i && window.open(i, "_blank");
16
17
  }, p = [
17
18
  { label: "iCalendar", action: "file" },
18
- { label: "Google Calendar", action: "link", link: P(o) },
19
+ { label: "Google Calendar", action: "link", link: w(o) },
19
20
  { label: "Outlook", action: "file" },
20
21
  { label: "Outlook Online", action: "link", link: R(o) },
21
22
  { label: "Yahoo Calendar", action: "link", link: S(o) }
22
23
  ];
23
- return /* @__PURE__ */ e("div", { ...f, className: N(l, c), ...n, ref: b, children: /* @__PURE__ */ C($, { open: t, onOpenChange: i, children: [
24
- /* @__PURE__ */ e(x, { asChild: !0, children: /* @__PURE__ */ e(
25
- "button",
26
- {
27
- "aria-label": d,
28
- className: `${s}-icon-button ${s}-icon-button--small ${l}-icon-button`,
29
- type: "button",
30
- children: /* @__PURE__ */ e(I, { icon: t ? "CloseX" : "Calendar" })
31
- }
32
- ) }),
33
- /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(
34
- w,
24
+ return /* @__PURE__ */ e("div", { ...c, className: u(l, r), ...n, ref: m, children: /* @__PURE__ */ b(T, { open: t, onOpenChange: f, children: [
25
+ /* @__PURE__ */ e(x, { asChild: !0, children: /* @__PURE__ */ e(y, { children: /* @__PURE__ */ e(P, { icon: t ? "CloseX" : "Calendar", title: s }) }) }),
26
+ /* @__PURE__ */ e(I, { children: /* @__PURE__ */ e(
27
+ A,
35
28
  {
36
29
  sideOffset: 5,
37
30
  align: "start",
@@ -39,15 +32,12 @@ const G = h(
39
32
  "data-side": "bottom",
40
33
  avoidCollisions: !1,
41
34
  className: `${l}-atcb-list`,
42
- onKeyDown: (a) => {
43
- a.key === "Tab" && i(!1);
44
- },
45
35
  children: p.map((a) => /* @__PURE__ */ e(
46
- A,
36
+ L,
47
37
  {
48
38
  className: `${l}-atcb-item`,
49
39
  onSelect: () => k(a.action, a.link),
50
- children: a.action === "link" ? /* @__PURE__ */ e(m, { className: `${l}-atcb-item-link`, href: a.link, children: a.label }) : /* @__PURE__ */ e("button", { className: `${l}-atcb-item-link`, children: /* @__PURE__ */ e(T, { variant: O.body2, children: a.label }) })
40
+ children: a.action === "link" ? /* @__PURE__ */ e(d, { className: `${l}-atcb-item-link`, href: a.link, children: a.label }) : /* @__PURE__ */ e("button", { className: `${l}-atcb-item-link`, children: /* @__PURE__ */ e(O, { variant: N.body2, children: a.label }) })
51
41
  },
52
42
  a.label
53
43
  ))
@@ -1,89 +1,89 @@
1
- import { createEvent as y } from "../../node_modules/ics/dist/index.js";
1
+ import { createEvent as u } from "../../node_modules/ics/dist/index.js";
2
2
  import { isValid as p } from "../../node_modules/date-fns/isValid.js";
3
- import { toZonedTime as d } from "../../node_modules/date-fns-tz/dist/esm/toZonedTime/index.js";
4
- import { addHours as m } from "../../node_modules/date-fns/addHours.js";
5
- import { formatDate as s } from "../../node_modules/date-fns/format.js";
6
- const i = {
3
+ import { toZonedTime as m } from "../../node_modules/date-fns-tz/dist/esm/toZonedTime/index.js";
4
+ import { formatDate as a } from "../../node_modules/date-fns/format.js";
5
+ import { addHours as i } from "../../node_modules/date-fns/addHours.js";
6
+ const l = {
7
7
  google: "https://calendar.google.com/calendar/u/0/r/eventedit",
8
8
  outlook: "https://outlook.office.com/calendar/0/deeplink/compose",
9
9
  yahoo: "https://calendar.yahoo.com/"
10
- }, h = () => {
10
+ }, M = () => {
11
11
  try {
12
12
  return Intl.DateTimeFormat().resolvedOptions().timeZone;
13
13
  } catch {
14
14
  return console.warn("Unable to determine user's timezone. Using UTC as a fallback."), "UTC";
15
15
  }
16
- }, g = (t) => new URLSearchParams(t), l = (t, o) => {
17
- if (!o.start || !p(o.start))
18
- return console.error("Invalid event start date:", o), "#";
19
- const e = h(), n = d(o.start, t === "google" ? o.timezone : e), r = o.end ? d(o.end, t === "google" ? o.timezone : e) : m(n, 1);
20
- switch (t) {
16
+ }, y = (o) => new URLSearchParams(o), d = (o, t) => {
17
+ if (!t.start || !p(t.start))
18
+ return console.error("Invalid event start date:", t), "#";
19
+ const e = M(), n = m(t.start, o === "google" ? t.timezone : e), r = t.end ? m(t.end, o === "google" ? t.timezone : e) : null;
20
+ switch (o) {
21
21
  case "google":
22
- return k(n, r, o);
22
+ return H(n, r, t);
23
23
  case "outlook":
24
- return f(n, r, o);
24
+ return h(n, r, t);
25
25
  case "yahoo":
26
- return L(n, r, o);
26
+ return k(n, r, t);
27
27
  default:
28
- return console.error("Invalid calendar type:", t), "#";
28
+ return console.error("Invalid calendar type:", o), "#";
29
29
  }
30
- }, k = (t, o, e) => {
31
- const n = g({
30
+ }, H = (o, t, e) => {
31
+ const n = y({
32
32
  text: e.title,
33
- dates: `${s(t, "yyyyMMdd'T'HHmmss")}/${s(o, "yyyyMMdd'T'HHmmss")}`,
33
+ dates: t ? `${a(o, "yyyyMMdd'T'HHmmss")}/${a(t, "yyyyMMdd'T'HHmmss")}` : `${a(o, "yyyyMMdd'T'HHmmss")}/${a(i(o, 1), "yyyyMMdd'T'HHmmss")}`,
34
34
  ctz: e.timezone,
35
35
  details: e.description,
36
36
  location: e.location
37
- }), r = new URL(i.google);
37
+ }), r = new URL(l.google);
38
38
  return r.search = n.toString(), r.toString();
39
- }, f = (t, o, e) => {
40
- const n = g({
39
+ }, h = (o, t, e) => {
40
+ const n = y({
41
41
  path: "/calendar/action/compose",
42
42
  rru: "addevent",
43
43
  subject: e.title,
44
- startdt: s(t, "yyyy-MM-dd'T'HH:mm:ssXXX"),
45
- enddt: s(o, "yyyy-MM-dd'T'HH:mm:ssXXX"),
44
+ startdt: a(o, "yyyy-MM-dd'T'HH:mm:ssXXX"),
45
+ enddt: t ? a(t, "yyyy-MM-dd'T'HH:mm:ssXXX") : a(i(o, 1), "yyyy-MM-dd'T'HH:mm:ssXXX"),
46
46
  body: e.description,
47
47
  location: e.location,
48
48
  allday: "false"
49
- }), r = new URL(i.outlook);
49
+ }), r = new URL(l.outlook);
50
50
  return r.search = n.toString(), r.toString();
51
- }, L = (t, o, e) => {
52
- const n = encodeURIComponent(e.title), r = encodeURIComponent(e.description), c = encodeURIComponent(e.location), a = s(t, "yyyyMMdd'T'HHmmss"), u = s(o, "yyyyMMdd'T'HHmmss");
53
- return `${i.yahoo}?v=60&view=d&type=20&title=${n}&st=${a}&et=${u}&desc=${r}&in_loc=${c}`;
54
- }, T = (t) => l("google", t), $ = (t) => l("outlook", t), b = (t) => l("yahoo", t), w = (t) => {
55
- if (!t.start) {
56
- console.error("Invalid event start date:", t);
51
+ }, k = (o, t, e) => {
52
+ const n = encodeURIComponent(e.title), r = encodeURIComponent(e.description), c = encodeURIComponent(e.location), s = a(o, "yyyyMMdd'T'HHmmss"), g = t ? a(t, "yyyyMMdd'T'HHmmss") : a(i(o, 1), "yyyyMMdd'T'HHmmss");
53
+ return `${l.yahoo}?v=60&view=d&type=20&title=${n}&st=${s}&et=${g}&desc=${r}&in_loc=${c}`;
54
+ }, R = (o) => d("google", o), $ = (o) => d("outlook", o), X = (o) => d("yahoo", o), b = (o) => {
55
+ if (!o.start) {
56
+ console.error("Invalid event start date:", o);
57
57
  return;
58
58
  }
59
- const o = t.end ? t.end : m(t.start, 1);
60
- y(
59
+ const t = o.end ? o.end : i(o.start, 1);
60
+ u(
61
61
  {
62
- title: t.title,
63
- description: t.description,
62
+ title: o.title,
63
+ description: o.description,
64
64
  start: [
65
- t.start.getFullYear(),
66
- t.start.getMonth() + 1,
67
- t.start.getDate(),
68
- t.start.getHours(),
69
- t.start.getMinutes()
65
+ o.start.getFullYear(),
66
+ o.start.getMonth() + 1,
67
+ o.start.getDate(),
68
+ o.start.getHours(),
69
+ o.start.getMinutes()
70
70
  ],
71
- end: [o.getFullYear(), o.getMonth() + 1, o.getDate(), o.getHours(), o.getMinutes()],
72
- location: t.location
71
+ end: [t.getFullYear(), t.getMonth() + 1, t.getDate(), t.getHours(), t.getMinutes()],
72
+ location: o.location
73
73
  },
74
74
  (e, n) => {
75
75
  if (e)
76
76
  console.error("Error creating iCalendar event:", e);
77
77
  else {
78
- const r = new File([n], `${t.title}.ics`, { type: "text/calendar" }), c = URL.createObjectURL(r), a = document.createElement("a");
79
- a.href = c, a.download = r.name, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(c);
78
+ const r = new File([n], `${o.title}.ics`, { type: "text/calendar" }), c = URL.createObjectURL(r), s = document.createElement("a");
79
+ s.href = c, s.download = r.name, document.body.appendChild(s), s.click(), document.body.removeChild(s), URL.revokeObjectURL(c);
80
80
  }
81
81
  }
82
82
  );
83
83
  };
84
84
  export {
85
- w as generateCalendarFile,
86
- T as generateGoogleCalendarLink,
85
+ b as generateCalendarFile,
86
+ R as generateGoogleCalendarLink,
87
87
  $ as generateOutlookOnlineLink,
88
- b as generateYahooCalendarLink
88
+ X as generateYahooCalendarLink
89
89
  };
@@ -2,7 +2,7 @@ export interface CalendarEvent {
2
2
  title: string;
3
3
  description: string;
4
4
  start: Date;
5
- end: Date;
5
+ end: Date | null;
6
6
  location: string;
7
7
  timezone: string;
8
8
  }
@@ -26,5 +26,5 @@ export interface IconButtonProps extends Omit<React.HTMLAttributes<HTMLButtonEle
26
26
  */
27
27
  prefetch?: ButtonProps['prefetch'];
28
28
  }
29
- declare const IconButton: ({ children, variant, isDisabled, className, ...props }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
29
+ declare const IconButton: import('react').ForwardRefExoticComponent<IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
30
30
  export default IconButton;
@@ -1,28 +1,27 @@
1
- import { jsx as e } from "react/jsx-runtime";
1
+ import { jsx as f } from "react/jsx-runtime";
2
2
  import c from "../../node_modules/classnames/index.js";
3
- import f from "../Button/Button.js";
4
- import { getCommonProps as p } from "../../utils/index.js";
5
- import { ButtonVariants as i } from "../Button/types.js";
6
- const I = ({
7
- children: s,
8
- variant: o = i.primary,
9
- isDisabled: r = !1,
10
- className: a,
11
- ...t
12
- }) => {
13
- const { className: m, ...n } = p(t, "IconButton");
14
- return /* @__PURE__ */ e(
15
- f,
16
- {
17
- ...n,
18
- variant: o,
19
- className: c(m, `${m}--${o}`, a),
20
- isDisabled: r,
21
- ...t,
22
- children: s
23
- }
24
- );
25
- };
3
+ import p from "../Button/Button.js";
4
+ import { getCommonProps as i } from "../../utils/index.js";
5
+ import { ButtonVariants as l } from "../Button/types.js";
6
+ import { forwardRef as u } from "react";
7
+ const B = u(
8
+ ({ children: r, variant: o = l.primary, isDisabled: s = !1, className: a, ...t }, n) => {
9
+ const { className: m, ...e } = i(t, "IconButton");
10
+ return /* @__PURE__ */ f(
11
+ p,
12
+ {
13
+ ...e,
14
+ variant: o,
15
+ className: c(m, `${m}--${o}`, a),
16
+ isDisabled: s,
17
+ ref: n,
18
+ ...t,
19
+ children: r
20
+ }
21
+ );
22
+ }
23
+ );
24
+ B.displayName = "IconButton";
26
25
  export {
27
- I as default
26
+ B as default
28
27
  };
@@ -1,7 +1,7 @@
1
1
  import { ButtonVariants } from '../Button/types';
2
2
  declare const meta: {
3
3
  title: string;
4
- component: ({ children, variant, isDisabled, className, ...props }: import('./IconButton').IconButtonProps) => import("react/jsx-runtime").JSX.Element;
4
+ component: import('react').ForwardRefExoticComponent<import('./IconButton').IconButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
5
5
  argTypes: {
6
6
  variant: {
7
7
  options: ButtonVariants[];
@@ -6,25 +6,26 @@
6
6
  width: 30px;
7
7
  }
8
8
 
9
- &-icon-button {
10
- background: none;
11
- border: none;
12
- cursor: pointer;
13
-
9
+ .#{$px}-icon-button {
14
10
  &:focus-visible {
15
11
  border-radius: 5px;
16
- outline: 1px solid $medium-gray;
17
12
  }
18
13
  }
19
14
 
20
15
  &-atcb-list {
21
16
  background: #fff;
22
17
  border: 1px solid#ECEAE7;
23
- padding: $spacing-sm;
24
18
  }
25
19
 
26
20
  &-atcb-item {
27
- margin-bottom: $spacing-xsm;
21
+ padding: $spacing-xsm $spacing-sm;
22
+
23
+ &:hover,
24
+ &:focus-visible {
25
+ background-color: $light-gray;
26
+ cursor: pointer;
27
+ outline: none;
28
+ }
28
29
  }
29
30
 
30
31
  &-atcb-item-link {
@@ -43,22 +44,23 @@
43
44
  }
44
45
 
45
46
  &:hover {
46
- color: #000;
47
+ border: none;
48
+ outline: none;
47
49
  text-decoration: none;
48
50
  }
49
51
 
50
- &:focus-visible {
51
- color: #000;
52
- text-decoration: underline;
53
- text-decoration-thickness: 1px;
54
- text-underline-offset: $spacing-micro;
55
- }
56
-
57
52
  span {
58
53
  @include text($body-size2);
59
54
 
60
55
  font-variation-settings: 'wght' 400;
61
56
  text-decoration: none;
57
+
58
+ &:hover,
59
+ &:focus-visible {
60
+ color: #000;
61
+ outline: none;
62
+ text-decoration: none;
63
+ }
62
64
  }
63
65
  }
64
66
  }
@@ -57,10 +57,5 @@
57
57
  &__account-icon {
58
58
  height: 1.5rem;
59
59
  width: 1.5rem;
60
-
61
- @include isHeaderDesktop {
62
- height: 1rem;
63
- width: 1rem;
64
- }
65
60
  }
66
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.149.2",
3
+ "version": "1.150.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"