@phillips/seldon 1.42.0 → 1.42.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/AccordionItem.d.ts +1 -5
- package/dist/components/Accordion/AccordionItem.js +85 -75
- package/dist/components/Accordion/types.d.ts +0 -3
- package/dist/components/Accordion/utils.d.ts +8 -0
- package/dist/components/Accordion/utils.js +10 -6
- package/dist/scss/components/Accordion/_accordion.scss +21 -1
- package/package.json +1 -1
|
@@ -24,10 +24,6 @@ export interface AccordionItemProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
24
24
|
* When true applied the transition keyframe animation on item expand. Default as false.
|
|
25
25
|
*/
|
|
26
26
|
hasTransition?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* When true, isCollapsed won't be toggled.
|
|
29
|
-
*/
|
|
30
|
-
isControlled?: boolean;
|
|
31
27
|
}
|
|
32
|
-
declare const AccordionItem: ({ isLocked, variation, label, isLastItem, hasTransition, children,
|
|
28
|
+
declare const AccordionItem: ({ isLocked, variation, label, isLastItem, hasTransition, children, ...props }: AccordionItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
33
29
|
export default AccordionItem;
|
|
@@ -1,101 +1,111 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import v from "../../assets/lock.svg.js";
|
|
1
|
+
import { jsxs as g, jsx as o, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { getCommonProps as $ } from "../../utils/index.js";
|
|
3
|
+
import f from "../../assets/plus.svg.js";
|
|
4
|
+
import h from "../../assets/minus.svg.js";
|
|
5
|
+
import _ from "../../assets/lock.svg.js";
|
|
7
6
|
import d from "../../node_modules/classnames/index.js";
|
|
8
|
-
import { Item as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
import { Item as p, Trigger as C, Content as v } from "../../node_modules/@radix-ui/react-accordion/dist/index.js";
|
|
8
|
+
import { getIconClasses as u } from "./utils.js";
|
|
9
|
+
const x = ({
|
|
10
|
+
children: n,
|
|
11
|
+
className: m,
|
|
12
12
|
baseClassName: t,
|
|
13
|
-
disable:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
isLargeVariation: s,
|
|
17
|
-
id: c
|
|
13
|
+
disable: s,
|
|
14
|
+
isLargeVariation: c,
|
|
15
|
+
id: e
|
|
18
16
|
}) => {
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
N,
|
|
17
|
+
const r = s, l = /* @__PURE__ */ o(
|
|
18
|
+
"img",
|
|
22
19
|
{
|
|
23
|
-
|
|
20
|
+
className: u(t, c, "lock"),
|
|
21
|
+
src: _,
|
|
22
|
+
"data-testid": `${e}-lockedIcon`,
|
|
23
|
+
"aria-hidden": !0
|
|
24
|
+
}
|
|
25
|
+
), a = /* @__PURE__ */ o(
|
|
26
|
+
"img",
|
|
27
|
+
{
|
|
28
|
+
className: u(t, c, "plus"),
|
|
29
|
+
src: f,
|
|
30
|
+
"data-testid": `${e}-plusIcon`,
|
|
31
|
+
"aria-hidden": !0
|
|
32
|
+
}
|
|
33
|
+
), i = /* @__PURE__ */ o(
|
|
34
|
+
"img",
|
|
35
|
+
{
|
|
36
|
+
className: u(t, c, "minus"),
|
|
37
|
+
src: h,
|
|
38
|
+
"data-testid": `${e}-minusIcon`,
|
|
39
|
+
"aria-hidden": !0
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
return /* @__PURE__ */ o(
|
|
43
|
+
C,
|
|
44
|
+
{
|
|
45
|
+
"data-disabled": s,
|
|
24
46
|
asChild: !0,
|
|
25
|
-
className: d(t, { [`${t}--hoverable`]: !
|
|
26
|
-
children: /* @__PURE__ */
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
className: d(`${t}__icon`, { [`${t}__icon--lg`]: s }),
|
|
32
|
-
src: g,
|
|
33
|
-
"data-testid": $,
|
|
34
|
-
"aria-hidden": !0
|
|
35
|
-
}
|
|
36
|
-
)
|
|
47
|
+
className: d(t, { [`${t}--hoverable`]: !s }, m),
|
|
48
|
+
children: /* @__PURE__ */ g("div", { "data-testid": `${e}-trigger`, children: [
|
|
49
|
+
/* @__PURE__ */ o("div", { className: d(`${t}__text`, { [`${t}__text--lg`]: c }), children: n }),
|
|
50
|
+
r && l,
|
|
51
|
+
!r && a,
|
|
52
|
+
!r && i
|
|
37
53
|
] })
|
|
38
54
|
}
|
|
39
55
|
);
|
|
40
|
-
},
|
|
41
|
-
children:
|
|
42
|
-
baseClassName:
|
|
56
|
+
}, N = ({
|
|
57
|
+
children: n,
|
|
58
|
+
baseClassName: m,
|
|
43
59
|
disable: t,
|
|
44
|
-
hasTransition:
|
|
45
|
-
isLargeVariation:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
T,
|
|
60
|
+
hasTransition: s,
|
|
61
|
+
isLargeVariation: c,
|
|
62
|
+
className: e
|
|
63
|
+
}) => /* @__PURE__ */ o(I, { children: t && n ? /* @__PURE__ */ o("div", { children: n }) : /* @__PURE__ */ o(
|
|
64
|
+
v,
|
|
50
65
|
{
|
|
51
66
|
asChild: !0,
|
|
52
67
|
className: d(
|
|
53
|
-
{ [`${
|
|
54
|
-
{ [`${
|
|
55
|
-
|
|
56
|
-
s
|
|
68
|
+
{ [`${m}__content--lg`]: c },
|
|
69
|
+
{ [`${m}--transition`]: s },
|
|
70
|
+
e
|
|
57
71
|
),
|
|
58
|
-
children:
|
|
72
|
+
children: n
|
|
59
73
|
}
|
|
60
|
-
) }),
|
|
61
|
-
isLocked:
|
|
62
|
-
variation:
|
|
74
|
+
) }), P = ({
|
|
75
|
+
isLocked: n,
|
|
76
|
+
variation: m,
|
|
63
77
|
label: t,
|
|
64
|
-
isLastItem:
|
|
65
|
-
hasTransition:
|
|
66
|
-
children:
|
|
67
|
-
|
|
68
|
-
...c
|
|
78
|
+
isLastItem: s,
|
|
79
|
+
hasTransition: c = !1,
|
|
80
|
+
children: e,
|
|
81
|
+
...r
|
|
69
82
|
}) => {
|
|
70
|
-
const
|
|
71
|
-
return /* @__PURE__ */
|
|
72
|
-
|
|
83
|
+
const { className: l } = $(r, "Accordion"), a = m === "lg", i = `${l}-item`;
|
|
84
|
+
return /* @__PURE__ */ g(
|
|
85
|
+
p,
|
|
73
86
|
{
|
|
74
|
-
disabled:
|
|
87
|
+
disabled: n,
|
|
75
88
|
value: t,
|
|
76
|
-
className: d(
|
|
89
|
+
className: d(i, { [`${i}__border-bottom`]: !s }),
|
|
77
90
|
children: [
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
|
|
91
|
+
/* @__PURE__ */ o(
|
|
92
|
+
x,
|
|
80
93
|
{
|
|
81
|
-
disable:
|
|
82
|
-
isLargeVariation:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
id: c == null ? void 0 : c.id,
|
|
86
|
-
baseClassName: `${u}-label`,
|
|
94
|
+
disable: n,
|
|
95
|
+
isLargeVariation: a,
|
|
96
|
+
id: r == null ? void 0 : r.id,
|
|
97
|
+
baseClassName: `${i}-label`,
|
|
87
98
|
children: t
|
|
88
99
|
}
|
|
89
100
|
),
|
|
90
|
-
/* @__PURE__ */
|
|
91
|
-
|
|
101
|
+
/* @__PURE__ */ o(
|
|
102
|
+
N,
|
|
92
103
|
{
|
|
93
|
-
disable:
|
|
94
|
-
hasTransition:
|
|
95
|
-
isLargeVariation:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
children: a
|
|
104
|
+
disable: n,
|
|
105
|
+
hasTransition: c,
|
|
106
|
+
isLargeVariation: a,
|
|
107
|
+
baseClassName: i,
|
|
108
|
+
children: e
|
|
99
109
|
}
|
|
100
110
|
)
|
|
101
111
|
]
|
|
@@ -103,5 +113,5 @@ const j = ({
|
|
|
103
113
|
);
|
|
104
114
|
};
|
|
105
115
|
export {
|
|
106
|
-
|
|
116
|
+
P as default
|
|
107
117
|
};
|
|
@@ -12,8 +12,6 @@ export interface AccordionHeaderType {
|
|
|
12
12
|
*/
|
|
13
13
|
baseClassName: string;
|
|
14
14
|
disable: boolean;
|
|
15
|
-
isCollapsed: boolean;
|
|
16
|
-
setIsCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
|
|
17
15
|
isLargeVariation: boolean;
|
|
18
16
|
/**
|
|
19
17
|
* Unique id for icon component testing
|
|
@@ -39,7 +37,6 @@ export interface AccordionContentType {
|
|
|
39
37
|
*/
|
|
40
38
|
hasTransition?: boolean;
|
|
41
39
|
isLargeVariation: boolean;
|
|
42
|
-
isCollapsed: boolean;
|
|
43
40
|
}
|
|
44
41
|
export declare enum AccordionVariants {
|
|
45
42
|
multiple = "multiple",
|
|
@@ -15,3 +15,11 @@ export interface AccordionVariantProps {
|
|
|
15
15
|
* The collapsible prop should only be passed when the variant is single
|
|
16
16
|
*/
|
|
17
17
|
export declare const getAccordionVariantProps: (variant?: AccordionVariantKey) => AccordionVariantProps;
|
|
18
|
+
/**
|
|
19
|
+
* A helper for getting the classes of the Accordion icons
|
|
20
|
+
* @param className - The className of the component
|
|
21
|
+
* @param isLargeVariation - Determines whether the variation on text style is large or small.
|
|
22
|
+
* @param iconName - The name of the icon to be displayed
|
|
23
|
+
* @returns the classes that should be applied for the icon
|
|
24
|
+
*/
|
|
25
|
+
export declare const getIconClasses: (className: string, isLargeVariation: boolean, iconName: string) => string;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import n from "../../node_modules/classnames/index.js";
|
|
2
|
+
import { AccordionVariants as l } from "./types.js";
|
|
3
|
+
const r = (i) => {
|
|
4
|
+
const o = { type: "multiple" };
|
|
5
|
+
return i === l.singleCollapsible && (o.type = "single", o.collapsible = !0), i === l.singleNonCollapsible && (o.type = "single", o.collapsible = !1), o;
|
|
6
|
+
}, p = (i, o, e) => n(`${i}__icon`, `${i}-${e}__icon`, {
|
|
7
|
+
[`${i}__icon--lg`]: o
|
|
8
|
+
});
|
|
6
9
|
export {
|
|
7
|
-
|
|
10
|
+
r as getAccordionVariantProps,
|
|
11
|
+
p as getIconClasses
|
|
8
12
|
};
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
border-bottom: 1px solid $keyline-gray;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
&[data-state='open'] {
|
|
18
18
|
display: block;
|
|
19
19
|
font-weight: 400;
|
|
20
20
|
height: auto;
|
|
@@ -39,6 +39,26 @@
|
|
|
39
39
|
animation: slide-up 250ms end;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
&[data-state='open'] {
|
|
43
|
+
.phillips-accordion-item-label-plus__icon {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.phillips-accordion-item-label-minus__icon {
|
|
48
|
+
display: block;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&[data-state='closed'] {
|
|
53
|
+
.phillips-accordion-item-label-plus__icon {
|
|
54
|
+
display: block;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.phillips-accordion-item-label-minus__icon {
|
|
58
|
+
display: none;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
42
62
|
@keyframes slide-down {
|
|
43
63
|
from {
|
|
44
64
|
height: 0;
|