@phillips/seldon 1.84.1 → 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.
- package/dist/components/Accordion/Accordion.stories.d.ts +7 -3
- package/dist/components/Accordion/AccordionItem.d.ts +12 -0
- package/dist/components/Accordion/AccordionItem.js +102 -88
- package/dist/components/Accordion/AccordionItem.test.d.ts +1 -0
- package/dist/components/Accordion/types.d.ts +8 -0
- package/dist/node_modules/exenv/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/scss/components/Accordion/_accordion.scss +10 -2
- package/dist/scss/components/Input/_input.scss +10 -1
- package/package.json +1 -1
|
@@ -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,18 @@ 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;
|
|
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;
|
|
32
44
|
}
|
|
33
45
|
declare const AccordionItem: React.ForwardRefExoticComponent<AccordionItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
34
46
|
export default AccordionItem;
|
|
@@ -1,122 +1,136 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { AccordionItemVariant as
|
|
10
|
-
import { getIconClasses as
|
|
11
|
-
const
|
|
12
|
-
children:
|
|
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:
|
|
15
|
-
disable:
|
|
16
|
-
isLargeVariation:
|
|
17
|
-
id:
|
|
14
|
+
baseClassName: t,
|
|
15
|
+
disable: i,
|
|
16
|
+
isLargeVariation: e,
|
|
17
|
+
id: n,
|
|
18
|
+
onOpen: d,
|
|
19
|
+
onClose: m
|
|
18
20
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
+
const l = R(null), a = i, f = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
22
|
+
T,
|
|
21
23
|
{
|
|
22
|
-
className:
|
|
23
|
-
"data-testid": `${
|
|
24
|
+
className: v(t, e, "lock"),
|
|
25
|
+
"data-testid": `${n}-lockedIcon`,
|
|
24
26
|
"aria-hidden": !0
|
|
25
27
|
}
|
|
26
|
-
) }),
|
|
27
|
-
|
|
28
|
+
) }), g = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
29
|
+
w,
|
|
28
30
|
{
|
|
29
|
-
className:
|
|
30
|
-
"data-testid": `${
|
|
31
|
+
className: v(t, e, "plus"),
|
|
32
|
+
"data-testid": `${n}-plusIcon`,
|
|
31
33
|
"aria-hidden": !0
|
|
32
34
|
}
|
|
33
|
-
) }), p = /* @__PURE__ */
|
|
34
|
-
|
|
35
|
+
) }), p = /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
36
|
+
j,
|
|
35
37
|
{
|
|
36
|
-
className:
|
|
37
|
-
"data-testid": `${
|
|
38
|
+
className: v(t, e, "minus"),
|
|
39
|
+
"data-testid": `${n}-minusIcon`,
|
|
38
40
|
"aria-hidden": !0
|
|
39
41
|
}
|
|
40
|
-
) })
|
|
41
|
-
|
|
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
|
-
"data-disabled":
|
|
49
|
+
"data-disabled": i,
|
|
45
50
|
asChild: !0,
|
|
46
|
-
className:
|
|
47
|
-
|
|
48
|
-
{ [`${
|
|
49
|
-
{ [`${
|
|
51
|
+
className: u(
|
|
52
|
+
t,
|
|
53
|
+
{ [`${t}--large`]: e },
|
|
54
|
+
{ [`${t}--hoverable`]: !i },
|
|
50
55
|
r
|
|
51
56
|
),
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
},
|
|
61
|
-
children:
|
|
67
|
+
}, b = ({
|
|
68
|
+
children: c,
|
|
62
69
|
baseClassName: r,
|
|
63
|
-
disable:
|
|
64
|
-
hasTransition:
|
|
65
|
-
isLargeVariation:
|
|
66
|
-
className:
|
|
67
|
-
}) =>
|
|
68
|
-
|
|
70
|
+
disable: t,
|
|
71
|
+
hasTransition: i,
|
|
72
|
+
isLargeVariation: e,
|
|
73
|
+
className: n
|
|
74
|
+
}) => t && c ? /* @__PURE__ */ o("div", { className: `${r}__content--locked`, children: c }) : /* @__PURE__ */ o(
|
|
75
|
+
x,
|
|
69
76
|
{
|
|
70
77
|
asChild: !0,
|
|
71
|
-
className:
|
|
78
|
+
className: u(
|
|
72
79
|
`${r}__content`,
|
|
73
|
-
{ [`${r}__content--lg`]:
|
|
74
|
-
{ [`${r}--transition`]:
|
|
75
|
-
|
|
80
|
+
{ [`${r}__content--lg`]: e },
|
|
81
|
+
{ [`${r}--transition`]: i },
|
|
82
|
+
n
|
|
76
83
|
),
|
|
77
|
-
children:
|
|
84
|
+
children: c
|
|
78
85
|
}
|
|
79
|
-
),
|
|
86
|
+
), C = N(
|
|
80
87
|
({
|
|
81
|
-
isLocked:
|
|
82
|
-
variant: r =
|
|
83
|
-
id:
|
|
84
|
-
label:
|
|
85
|
-
isLastItem:
|
|
86
|
-
hasTransition:
|
|
87
|
-
children:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
isLocked: c = !1,
|
|
89
|
+
variant: r = I.sm,
|
|
90
|
+
id: t,
|
|
91
|
+
label: i,
|
|
92
|
+
isLastItem: e,
|
|
93
|
+
hasTransition: n = !1,
|
|
94
|
+
children: d,
|
|
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__ */ _(
|
|
92
103
|
A,
|
|
93
104
|
{
|
|
94
|
-
disabled:
|
|
95
|
-
value:
|
|
96
|
-
|
|
97
|
-
|
|
105
|
+
disabled: c,
|
|
106
|
+
value: t,
|
|
107
|
+
style: { "--seldon-accordion-transition-time": `${l}ms` },
|
|
108
|
+
className: u(s, m, {
|
|
109
|
+
[`${s}__border-bottom`]: !e
|
|
98
110
|
}),
|
|
99
|
-
ref:
|
|
100
|
-
...
|
|
111
|
+
ref: p,
|
|
112
|
+
...g,
|
|
101
113
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
103
|
-
|
|
114
|
+
/* @__PURE__ */ o(
|
|
115
|
+
P,
|
|
104
116
|
{
|
|
105
|
-
disable:
|
|
106
|
-
isLargeVariation:
|
|
107
|
-
id:
|
|
108
|
-
baseClassName: `${
|
|
109
|
-
|
|
117
|
+
disable: c,
|
|
118
|
+
isLargeVariation: h,
|
|
119
|
+
id: t,
|
|
120
|
+
baseClassName: `${s}-label`,
|
|
121
|
+
onOpen: a,
|
|
122
|
+
onClose: f,
|
|
123
|
+
children: i
|
|
110
124
|
}
|
|
111
125
|
),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
|
|
126
|
+
/* @__PURE__ */ o(
|
|
127
|
+
b,
|
|
114
128
|
{
|
|
115
|
-
disable:
|
|
116
|
-
hasTransition:
|
|
117
|
-
isLargeVariation:
|
|
118
|
-
baseClassName:
|
|
119
|
-
children: /* @__PURE__ */
|
|
129
|
+
disable: c,
|
|
130
|
+
hasTransition: n,
|
|
131
|
+
isLargeVariation: h,
|
|
132
|
+
baseClassName: s,
|
|
133
|
+
children: /* @__PURE__ */ o("div", { className: "radix-accordion-content", children: d })
|
|
120
134
|
}
|
|
121
135
|
)
|
|
122
136
|
]
|
|
@@ -124,7 +138,7 @@ const C = ({
|
|
|
124
138
|
);
|
|
125
139
|
}
|
|
126
140
|
);
|
|
127
|
-
|
|
141
|
+
C.displayName = "AccordionItem";
|
|
128
142
|
export {
|
|
129
|
-
|
|
143
|
+
C as default
|
|
130
144
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 e } from "../../../../_virtual/
|
|
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;
|
|
@@ -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
|
|
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
|
|
57
|
+
animation: slide-up var(--seldon-accordion-transition-time) ease-in-out;
|
|
50
58
|
}
|
|
51
59
|
|
|
52
60
|
&[data-state='open'] {
|
|
@@ -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:
|
|
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
|
|