@phillips/seldon 1.84.1 → 1.85.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.
@@ -1,8 +1,12 @@
1
1
  import { AccordionProps } from './Accordion';
2
+ import { AccordionItemProps } from './AccordionItem';
2
3
  import { AccordionVariants } from './types';
3
4
  declare const meta: {
4
5
  title: string;
5
6
  component: ({ className, children, ...props }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
7
+ args: {
8
+ transitionTimeInMs: number;
9
+ };
6
10
  argTypes: {
7
11
  variant: {
8
12
  options: AccordionVariants[];
@@ -13,6 +17,6 @@ declare const meta: {
13
17
  };
14
18
  };
15
19
  export default meta;
16
- export declare const AccordionLarge: (props: AccordionProps) => import("react/jsx-runtime").JSX.Element;
17
- export declare const AccordionSmall: (props: AccordionProps) => import("react/jsx-runtime").JSX.Element;
18
- export declare const AccordionSubmenu: (props: AccordionProps) => import("react/jsx-runtime").JSX.Element;
20
+ export declare const AccordionLarge: ({ transitionTimeInMs, ...props }: AccordionProps & AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
21
+ export declare const AccordionSmall: ({ transitionTimeInMs, ...props }: AccordionProps & AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
22
+ export declare const AccordionSubmenu: ({ transitionTimeInMs, ...props }: AccordionProps & AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -29,6 +29,10 @@ export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement>
29
29
  * When true applied the transition keyframe animation on item expand. Default as false.
30
30
  */
31
31
  hasTransition?: boolean;
32
+ /**
33
+ * Number of milliseconds for the expansion transition. Defaults to 250.
34
+ */
35
+ transitionTimeInMs?: number;
32
36
  }
33
37
  declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
34
38
  export default AccordionItem;
@@ -1,37 +1,37 @@
1
1
  import { jsxs as h, jsx as t } from "react/jsx-runtime";
2
- import { forwardRef as g } from "react";
3
- import { getCommonProps as v } from "../../utils/index.js";
4
- import I from "../../assets/plus.svg.js";
5
- import _ from "../../assets/minus.svg.js";
6
- import x from "../../assets/lock.svg.js";
7
- import s from "../../node_modules/classnames/index.js";
8
- import { Item as A, Trigger as N, Content as k } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
9
- import { AccordionItemVariant as $ } from "./types.js";
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
10
  import { getIconClasses as u } from "./utils.js";
11
- const C = ({
11
+ const j = ({
12
12
  children: n,
13
13
  className: r,
14
14
  baseClassName: o,
15
- disable: d,
15
+ disable: i,
16
16
  isLargeVariation: c,
17
17
  id: e
18
18
  }) => {
19
- const i = d, l = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
20
- x,
19
+ const d = i, l = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
20
+ N,
21
21
  {
22
22
  className: u(o, c, "lock"),
23
23
  "data-testid": `${e}-lockedIcon`,
24
24
  "aria-hidden": !0
25
25
  }
26
26
  ) }), a = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
27
- I,
27
+ C,
28
28
  {
29
29
  className: u(o, c, "plus"),
30
30
  "data-testid": `${e}-plusIcon`,
31
31
  "aria-hidden": !0
32
32
  }
33
33
  ) }), p = /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
34
- _,
34
+ k,
35
35
  {
36
36
  className: u(o, c, "minus"),
37
37
  "data-testid": `${e}-minusIcon`,
@@ -39,84 +39,87 @@ const C = ({
39
39
  }
40
40
  ) });
41
41
  return /* @__PURE__ */ t(
42
- N,
42
+ _,
43
43
  {
44
- "data-disabled": d,
44
+ "data-disabled": i,
45
45
  asChild: !0,
46
- className: s(
46
+ className: m(
47
47
  o,
48
48
  { [`${o}--large`]: c },
49
- { [`${o}--hoverable`]: !d },
49
+ { [`${o}--hoverable`]: !i },
50
50
  r
51
51
  ),
52
52
  children: /* @__PURE__ */ h("div", { "data-testid": `${e}-trigger`, children: [
53
- /* @__PURE__ */ t("div", { className: s(`${o}__text`, { [`${o}__text--lg`]: c }), children: n }),
54
- i && l,
55
- !i && a,
56
- !i && p
53
+ /* @__PURE__ */ t("div", { className: m(`${o}__text`, { [`${o}__text--lg`]: c }), children: n }),
54
+ d && l,
55
+ !d && a,
56
+ !d && p
57
57
  ] })
58
58
  }
59
59
  );
60
- }, S = ({
60
+ }, w = ({
61
61
  children: n,
62
62
  baseClassName: r,
63
63
  disable: o,
64
- hasTransition: d,
64
+ hasTransition: i,
65
65
  isLargeVariation: c,
66
66
  className: e
67
67
  }) => o && n ? /* @__PURE__ */ t("div", { className: `${r}__content--locked`, children: n }) : /* @__PURE__ */ t(
68
- k,
68
+ x,
69
69
  {
70
70
  asChild: !0,
71
- className: s(
71
+ className: m(
72
72
  `${r}__content`,
73
73
  { [`${r}__content--lg`]: c },
74
- { [`${r}--transition`]: d },
74
+ { [`${r}--transition`]: i },
75
75
  e
76
76
  ),
77
77
  children: n
78
78
  }
79
- ), j = g(
79
+ ), y = A(
80
80
  ({
81
81
  isLocked: n = !1,
82
- variant: r = $.sm,
82
+ variant: r = f.sm,
83
83
  id: o,
84
- label: d,
84
+ label: i,
85
85
  isLastItem: c,
86
86
  hasTransition: e = !1,
87
- children: i,
88
- ...l
89
- }, a) => {
90
- const { className: p } = v({ id: o }, "Accordion"), f = r === $.lg, m = `${p}-item`;
87
+ 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`;
91
93
  return /* @__PURE__ */ h(
92
- A,
94
+ I,
93
95
  {
94
96
  disabled: n,
95
97
  value: o,
96
- className: s(m, {
97
- [`${m}__border-bottom`]: !c
98
+ style: { "--seldon-accordion-transition-time": `${a}ms` },
99
+ className: m(s, l, {
100
+ [`${s}__border-bottom`]: !c
98
101
  }),
99
- ref: a,
100
- ...l,
102
+ ref: g,
103
+ ...p,
101
104
  children: [
102
105
  /* @__PURE__ */ t(
103
- C,
106
+ j,
104
107
  {
105
108
  disable: n,
106
- isLargeVariation: f,
109
+ isLargeVariation: $,
107
110
  id: o,
108
- baseClassName: `${m}-label`,
109
- children: d
111
+ baseClassName: `${s}-label`,
112
+ children: i
110
113
  }
111
114
  ),
112
115
  /* @__PURE__ */ t(
113
- S,
116
+ w,
114
117
  {
115
118
  disable: n,
116
119
  hasTransition: e,
117
- isLargeVariation: f,
118
- baseClassName: m,
119
- children: /* @__PURE__ */ t("div", { className: "radix-accordion-content", children: i })
120
+ isLargeVariation: $,
121
+ baseClassName: s,
122
+ children: /* @__PURE__ */ t("div", { className: "radix-accordion-content", children: d })
120
123
  }
121
124
  )
122
125
  ]
@@ -124,7 +127,7 @@ const C = ({
124
127
  );
125
128
  }
126
129
  );
127
- j.displayName = "AccordionItem";
130
+ y.displayName = "AccordionItem";
128
131
  export {
129
- j as default
132
+ y as default
130
133
  };
@@ -0,0 +1 @@
1
+ export {};
@@ -37,16 +37,24 @@
37
37
  @include text($body2);
38
38
  }
39
39
 
40
+ &--transition[data-state='open'] {
41
+ animation: slide-down var(--seldon-accordion-transition-time) ease-in-out;
42
+ }
43
+
44
+ &--transition[data-state='closed'] {
45
+ animation: slide-up var(--seldon-accordion-transition-time) ease-in-out;
46
+ }
47
+
40
48
  &--transition {
41
49
  overflow: hidden;
42
50
  }
43
51
 
44
52
  &--transition[data-state='open'] {
45
- animation: slide-down 250ms ease-in-out;
53
+ animation: slide-down var(--seldon-accordion-transition-time) ease-in-out;
46
54
  }
47
55
 
48
56
  &--transition[data-state='closed'] {
49
- animation: slide-up 250ms ease-in-out;
57
+ animation: slide-up var(--seldon-accordion-transition-time) ease-in-out;
50
58
  }
51
59
 
52
60
  &[data-state='open'] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.84.1",
3
+ "version": "1.85.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"