@phillips/seldon 1.85.0 → 1.85.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.
@@ -33,6 +33,14 @@ export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement>
33
33
  * Number of milliseconds for the expansion transition. Defaults to 250.
34
34
  */
35
35
  transitionTimeInMs?: number;
36
+ /**
37
+ * Callback function that is called when the item is opened.
38
+ */
39
+ onOpen?: () => void;
40
+ /**
41
+ * Callback function that is called when the item is closed.
42
+ */
43
+ onClose?: () => void;
36
44
  }
37
45
  declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
38
46
  export default AccordionItem;
@@ -1,125 +1,136 @@
1
- import { jsxs as h, jsx as t } from "react/jsx-runtime";
2
- import { Item as I, Trigger as _, Content as x } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
3
- import m from "../../node_modules/classnames/index.js";
4
- import { forwardRef as A } from "react";
5
- import N from "../../assets/lock.svg.js";
6
- import k from "../../assets/minus.svg.js";
7
- import C from "../../assets/plus.svg.js";
8
- import { getCommonProps as S } from "../../utils/index.js";
9
- import { AccordionItemVariant as f } from "./types.js";
10
- import { getIconClasses as u } from "./utils.js";
11
- const j = ({
12
- children: n,
1
+ import { jsxs as _, jsx as o } from "react/jsx-runtime";
2
+ import { Item as A, Trigger as k, Content as x } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
3
+ import u from "../../node_modules/classnames/index.js";
4
+ import { forwardRef as N, useRef as R, useCallback as S } from "react";
5
+ import T from "../../assets/lock.svg.js";
6
+ import j from "../../assets/minus.svg.js";
7
+ import w from "../../assets/plus.svg.js";
8
+ import { getCommonProps as y } from "../../utils/index.js";
9
+ import { AccordionItemVariant as I } from "./types.js";
10
+ import { getIconClasses as v } from "./utils.js";
11
+ const P = ({
12
+ children: c,
13
13
  className: r,
14
- baseClassName: o,
14
+ baseClassName: t,
15
15
  disable: i,
16
- isLargeVariation: c,
17
- id: e
16
+ isLargeVariation: e,
17
+ id: n,
18
+ onOpen: d,
19
+ onClose: m
18
20
  }) => {
19
- const d = i, l = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
20
- N,
21
+ const l = R(null), a = i, f = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
22
+ T,
21
23
  {
22
- className: u(o, c, "lock"),
23
- "data-testid": `${e}-lockedIcon`,
24
+ className: v(t, e, "lock"),
25
+ "data-testid": `${n}-lockedIcon`,
24
26
  "aria-hidden": !0
25
27
  }
26
- ) }), a = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
27
- C,
28
+ ) }), g = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
29
+ w,
28
30
  {
29
- className: u(o, c, "plus"),
30
- "data-testid": `${e}-plusIcon`,
31
+ className: v(t, e, "plus"),
32
+ "data-testid": `${n}-plusIcon`,
31
33
  "aria-hidden": !0
32
34
  }
33
- ) }), p = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
34
- k,
35
+ ) }), p = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
36
+ j,
35
37
  {
36
- className: u(o, c, "minus"),
37
- "data-testid": `${e}-minusIcon`,
38
+ className: v(t, e, "minus"),
39
+ "data-testid": `${n}-minusIcon`,
38
40
  "aria-hidden": !0
39
41
  }
40
- ) });
41
- return /* @__PURE__ */ t(
42
- _,
42
+ ) }), $ = S(() => {
43
+ var s;
44
+ ((s = l.current) == null ? void 0 : s.getAttribute("data-state")) === "closed" ? d == null || d() : m == null || m();
45
+ }, [d, m]);
46
+ return /* @__PURE__ */ o(
47
+ k,
43
48
  {
44
49
  "data-disabled": i,
45
50
  asChild: !0,
46
- className: m(
47
- o,
48
- { [`${o}--large`]: c },
49
- { [`${o}--hoverable`]: !i },
51
+ className: u(
52
+ t,
53
+ { [`${t}--large`]: e },
54
+ { [`${t}--hoverable`]: !i },
50
55
  r
51
56
  ),
52
- children: /* @__PURE__ */ h("div", { "data-testid": `${e}-trigger`, children: [
53
- /* @__PURE__ */ t("div", { className: m(`${o}__text`, { [`${o}__text--lg`]: c }), children: n }),
54
- d && l,
55
- !d && a,
56
- !d && p
57
+ ref: l,
58
+ onClick: $,
59
+ children: /* @__PURE__ */ _("div", { "data-testid": `${n}-trigger`, children: [
60
+ /* @__PURE__ */ o("div", { className: u(`${t}__text`, { [`${t}__text--lg`]: e }), children: c }),
61
+ a && f,
62
+ !a && g,
63
+ !a && p
57
64
  ] })
58
65
  }
59
66
  );
60
- }, w = ({
61
- children: n,
67
+ }, b = ({
68
+ children: c,
62
69
  baseClassName: r,
63
- disable: o,
70
+ disable: t,
64
71
  hasTransition: i,
65
- isLargeVariation: c,
66
- className: e
67
- }) => o && n ? /* @__PURE__ */ t("div", { className: `${r}__content--locked`, children: n }) : /* @__PURE__ */ t(
72
+ isLargeVariation: e,
73
+ className: n
74
+ }) => t && c ? /* @__PURE__ */ o("div", { className: `${r}__content--locked`, children: c }) : /* @__PURE__ */ o(
68
75
  x,
69
76
  {
70
77
  asChild: !0,
71
- className: m(
78
+ className: u(
72
79
  `${r}__content`,
73
- { [`${r}__content--lg`]: c },
80
+ { [`${r}__content--lg`]: e },
74
81
  { [`${r}--transition`]: i },
75
- e
82
+ n
76
83
  ),
77
- children: n
84
+ children: c
78
85
  }
79
- ), y = A(
86
+ ), C = N(
80
87
  ({
81
- isLocked: n = !1,
82
- variant: r = f.sm,
83
- id: o,
88
+ isLocked: c = !1,
89
+ variant: r = I.sm,
90
+ id: t,
84
91
  label: i,
85
- isLastItem: c,
86
- hasTransition: e = !1,
92
+ isLastItem: e,
93
+ hasTransition: n = !1,
87
94
  children: d,
88
- className: l,
89
- transitionTimeInMs: a = 250,
90
- ...p
91
- }, g) => {
92
- const { className: v } = S({ id: o }, "Accordion"), $ = r === f.lg, s = `${v}-item`;
93
- return /* @__PURE__ */ h(
94
- I,
95
+ className: m,
96
+ transitionTimeInMs: l = 250,
97
+ onOpen: a,
98
+ onClose: f,
99
+ ...g
100
+ }, p) => {
101
+ const { className: $ } = y({ id: t }, "Accordion"), h = r === I.lg, s = `${$}-item`;
102
+ return /* @__PURE__ */ _(
103
+ A,
95
104
  {
96
- disabled: n,
97
- value: o,
98
- style: { "--seldon-accordion-transition-time": `${a}ms` },
99
- className: m(s, l, {
100
- [`${s}__border-bottom`]: !c
105
+ disabled: c,
106
+ value: t,
107
+ style: { "--seldon-accordion-transition-time": `${l}ms` },
108
+ className: u(s, m, {
109
+ [`${s}__border-bottom`]: !e
101
110
  }),
102
- ref: g,
103
- ...p,
111
+ ref: p,
112
+ ...g,
104
113
  children: [
105
- /* @__PURE__ */ t(
106
- j,
114
+ /* @__PURE__ */ o(
115
+ P,
107
116
  {
108
- disable: n,
109
- isLargeVariation: $,
110
- id: o,
117
+ disable: c,
118
+ isLargeVariation: h,
119
+ id: t,
111
120
  baseClassName: `${s}-label`,
121
+ onOpen: a,
122
+ onClose: f,
112
123
  children: i
113
124
  }
114
125
  ),
115
- /* @__PURE__ */ t(
116
- w,
126
+ /* @__PURE__ */ o(
127
+ b,
117
128
  {
118
- disable: n,
119
- hasTransition: e,
120
- isLargeVariation: $,
129
+ disable: c,
130
+ hasTransition: n,
131
+ isLargeVariation: h,
121
132
  baseClassName: s,
122
- children: /* @__PURE__ */ t("div", { className: "radix-accordion-content", children: d })
133
+ children: /* @__PURE__ */ o("div", { className: "radix-accordion-content", children: d })
123
134
  }
124
135
  )
125
136
  ]
@@ -127,7 +138,7 @@ const j = ({
127
138
  );
128
139
  }
129
140
  );
130
- y.displayName = "AccordionItem";
141
+ C.displayName = "AccordionItem";
131
142
  export {
132
- y as default
143
+ C as default
133
144
  };
@@ -17,6 +17,14 @@ export interface AccordionHeaderType {
17
17
  * Unique id for icon component testing
18
18
  */
19
19
  id?: string;
20
+ /**
21
+ * Callback function that is called when the header is opened.
22
+ */
23
+ onOpen?: () => void;
24
+ /**
25
+ * Callback function that is called when the header is closed.
26
+ */
27
+ onClose?: () => void;
20
28
  }
21
29
  export interface AccordionContentType {
22
30
  /**
@@ -1,4 +1,4 @@
1
- import { __module as t } from "../../_virtual/index5.js";
1
+ import { __module as t } from "../../_virtual/index6.js";
2
2
  /*!
3
3
  Copyright (c) 2015 Jed Watson.
4
4
  Based on code that is Copyright 2013-2015, Facebook, Inc.
@@ -1,4 +1,4 @@
1
- import { __module as e } from "../../../../_virtual/index6.js";
1
+ import { __module as e } from "../../../../_virtual/index5.js";
2
2
  import { __require as o } from "./cjs/react-is.production.min.js";
3
3
  import { __require as t } from "./cjs/react-is.development.js";
4
4
  var r;
@@ -30,9 +30,14 @@ $lg: #{$px}-input--lg;
30
30
  border: 1px solid $keyline-gray;
31
31
  border-radius: 0.1875rem;
32
32
  font-size: 0.8125rem;
33
+ font-variation-settings: 'wght' 600;
33
34
  margin-bottom: 0.25rem;
34
35
  padding: $padding-xsm;
35
36
 
37
+ &::placeholder {
38
+ font-variation-settings: 'wght' 400;
39
+ }
40
+
36
41
  &:focus-within {
37
42
  outline: 1px solid $pure-black;
38
43
  }
@@ -98,12 +103,16 @@ $lg: #{$px}-input--lg;
98
103
  .#{$px}-input__input,
99
104
  .#{$px}-input__input::placeholder,
100
105
  .#{$px}-input__validation {
101
- color: inherit;
106
+ color: $pure-black;
102
107
  }
103
108
 
104
109
  .#{$px}-input__input {
105
110
  border: 1px solid $error-red;
106
111
  box-shadow: inset 0 0 3px 3px $error-pink;
112
+
113
+ &:focus-within {
114
+ outline: 1px solid $error-red;
115
+ }
107
116
  }
108
117
  }
109
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.85.0",
3
+ "version": "1.85.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"