@phillips/seldon 1.112.0 → 1.112.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,7 +1,8 @@
|
|
|
1
|
+
import { default as React, ComponentProps } from 'react';
|
|
1
2
|
export interface I18nObject {
|
|
2
3
|
clearAllLabel?: string;
|
|
3
4
|
}
|
|
4
|
-
export interface TagsListProps {
|
|
5
|
+
export interface TagsListProps extends ComponentProps<'ul'> {
|
|
5
6
|
/**
|
|
6
7
|
* Unique id for component testing
|
|
7
8
|
*/
|
|
@@ -40,8 +41,12 @@ export interface TagProps {
|
|
|
40
41
|
* Tag item label.
|
|
41
42
|
*/
|
|
42
43
|
label: string;
|
|
44
|
+
/**
|
|
45
|
+
* Tag button aria-label
|
|
46
|
+
*/
|
|
47
|
+
removeText?: string;
|
|
43
48
|
}
|
|
44
|
-
export declare const Tag: ({ id, className, onRemove, label }: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
49
|
+
export declare const Tag: ({ id, className, onRemove, label, removeText }: TagProps) => import("react/jsx-runtime").JSX.Element;
|
|
45
50
|
/**
|
|
46
51
|
* ## Overview
|
|
47
52
|
*
|
|
@@ -51,5 +56,5 @@ export declare const Tag: ({ id, className, onRemove, label }: TagProps) => impo
|
|
|
51
56
|
*
|
|
52
57
|
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/components-tags--overview)
|
|
53
58
|
*/
|
|
54
|
-
declare const TagsList:
|
|
59
|
+
declare const TagsList: React.ForwardRefExoticComponent<Omit<TagsListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
55
60
|
export default TagsList;
|
|
@@ -1,49 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { getCommonProps as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import v from "../../assets/chevronRight.svg.js";
|
|
8
|
-
import { ButtonVariants as h } from "../Button/types.js";
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import v, { forwardRef as N } from "react";
|
|
3
|
+
import d from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { getCommonProps as y, px as r } from "../../utils/index.js";
|
|
5
|
+
import $ from "../Button/Button.js";
|
|
6
|
+
import { ButtonVariants as p } from "../Button/types.js";
|
|
9
7
|
import b from "../../assets/close.svg.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
import C from "../../assets/arrowPrev.svg.js";
|
|
9
|
+
const w = ({ id: i, className: a, onRemove: o, label: s, removeText: e = "Remove" }) => /* @__PURE__ */ l(
|
|
10
|
+
$,
|
|
11
|
+
{
|
|
12
|
+
className: d(`${r}-tag`, `${r}-button`, a),
|
|
13
|
+
"aria-label": `${e} ${s}`,
|
|
14
|
+
onClick: () => o(s),
|
|
15
|
+
variant: p.tertiary,
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ t("div", { className: `${r}-tag__label`, children: s }),
|
|
18
|
+
/* @__PURE__ */ t("div", { className: `${r}-tag__button`, "data-testid": `${i}-item-close-button`, children: /* @__PURE__ */ t(b, {}) })
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
), _ = N(
|
|
22
|
+
({ className: i, children: a, clearAllLabel: o = "Clear All", onClear: s, ...e }, f) => {
|
|
23
|
+
const m = "tags-list", { className: g, ...u } = y(e, "TagsList"), { id: n } = e;
|
|
24
|
+
return /* @__PURE__ */ l(
|
|
25
|
+
"ul",
|
|
18
26
|
{
|
|
19
|
-
className:
|
|
20
|
-
|
|
21
|
-
...
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
className: d(`${r}-${m}`, g, i),
|
|
28
|
+
...u,
|
|
29
|
+
...e,
|
|
30
|
+
tabIndex: 0,
|
|
31
|
+
"data-testid": `${m}-${n}`,
|
|
32
|
+
ref: f,
|
|
24
33
|
children: [
|
|
25
|
-
|
|
26
|
-
Array.isArray(
|
|
27
|
-
|
|
34
|
+
Array.isArray(a) ? v.Children.map(a, (c) => /* @__PURE__ */ t("li", { children: c }, c.props.id)) : a,
|
|
35
|
+
Array.isArray(a) && a.length > 0 && /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l(
|
|
36
|
+
$,
|
|
28
37
|
{
|
|
29
|
-
onClick:
|
|
38
|
+
onClick: s,
|
|
30
39
|
"data-testid": `${n}-clear-all-button`,
|
|
31
|
-
className: `${
|
|
40
|
+
className: `${r}-${m}--clear`,
|
|
32
41
|
"aria-label": o,
|
|
33
|
-
variant:
|
|
42
|
+
variant: p.tertiary,
|
|
34
43
|
children: [
|
|
35
|
-
/* @__PURE__ */ t(
|
|
36
|
-
/* @__PURE__ */ t("div", { className: `${
|
|
44
|
+
/* @__PURE__ */ t(C, {}),
|
|
45
|
+
/* @__PURE__ */ t("div", { className: `${r}-label`, children: o })
|
|
37
46
|
]
|
|
38
47
|
}
|
|
39
|
-
)
|
|
48
|
+
) })
|
|
40
49
|
]
|
|
41
50
|
}
|
|
42
51
|
);
|
|
43
52
|
}
|
|
44
53
|
);
|
|
45
|
-
|
|
54
|
+
_.displayName = "Tags";
|
|
46
55
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
56
|
+
w as Tag,
|
|
57
|
+
_ as default
|
|
49
58
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TagsListProps } from './Tags';
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
|
-
component: import('react').ForwardRefExoticComponent<TagsListProps & import('react').RefAttributes<
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<TagsListProps, "ref"> & import('react').RefAttributes<HTMLUListElement>>;
|
|
5
5
|
};
|
|
6
6
|
export default meta;
|
|
7
7
|
interface StoryProps extends TagsListProps {
|
|
@@ -6,132 +6,102 @@
|
|
|
6
6
|
flex-flow: row wrap;
|
|
7
7
|
gap: $spacing-sm;
|
|
8
8
|
|
|
9
|
+
&:focus-visible {
|
|
10
|
+
border: unset;
|
|
11
|
+
outline: 1px solid $button-hover;
|
|
12
|
+
outline-offset: 1px;
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
.#{$px}-tag {
|
|
10
|
-
align-items: center;
|
|
11
|
-
background-color: $pure-white;
|
|
12
16
|
border: 1px solid $button-hover;
|
|
13
17
|
border-radius: 6.25rem;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
gap: 0;
|
|
17
|
-
height: $button-tertiary-height;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
padding: 0 $spacing-xsm 0 $spacing-sm;
|
|
18
|
+
gap: $spacing-micro;
|
|
19
|
+
padding: $spacing-micro $spacing-xsm $spacing-micro $spacing-sm;
|
|
20
20
|
|
|
21
21
|
&__label {
|
|
22
22
|
color: $button-hover;
|
|
23
|
-
font-size:
|
|
23
|
+
font-size: $body-size3;
|
|
24
24
|
font-variation-settings: 'wght' 600;
|
|
25
25
|
text-align: center;
|
|
26
|
+
|
|
27
|
+
&:hover {
|
|
28
|
+
color: $pure-black;
|
|
29
|
+
}
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
display: flex;
|
|
31
|
-
gap: $spacing-micro;
|
|
32
|
-
height: $button-tertiary-height;
|
|
33
|
-
justify-content: center;
|
|
34
|
-
padding: 0;
|
|
35
|
-
|
|
36
|
-
&--close {
|
|
37
|
-
height: 1.25rem;
|
|
38
|
-
width: 1.25rem;
|
|
39
|
-
|
|
40
|
-
svg {
|
|
41
|
-
height: 1rem;
|
|
42
|
-
width: 1rem;
|
|
43
|
-
|
|
44
|
-
path {
|
|
45
|
-
fill: $button-hover;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&:focus {
|
|
49
|
-
fill: $pure-black;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
32
|
+
svg {
|
|
33
|
+
fill: $button-hover;
|
|
52
34
|
|
|
53
|
-
|
|
54
|
-
|
|
35
|
+
path {
|
|
36
|
+
fill: $button-hover;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
55
39
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
40
|
+
&:hover {
|
|
41
|
+
color: $pure-black;
|
|
42
|
+
|
|
43
|
+
svg {
|
|
44
|
+
fill: $pure-black;
|
|
62
45
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
path {
|
|
66
|
-
fill: $pure-black;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
46
|
+
path {
|
|
47
|
+
fill: $pure-black;
|
|
69
48
|
}
|
|
70
49
|
}
|
|
71
50
|
}
|
|
72
51
|
}
|
|
73
52
|
|
|
74
53
|
&--clear {
|
|
54
|
+
@include text($body3);
|
|
55
|
+
|
|
75
56
|
align-items: center;
|
|
76
57
|
border-color: $pure-white;
|
|
58
|
+
border-style: solid;
|
|
59
|
+
border-width: 1px;
|
|
60
|
+
color: $button-hover;
|
|
77
61
|
display: flex;
|
|
78
|
-
gap:
|
|
62
|
+
gap: $spacing-micro;
|
|
79
63
|
height: 2rem;
|
|
64
|
+
padding: 0 $spacing-sm;
|
|
80
65
|
|
|
81
|
-
|
|
82
|
-
|
|
66
|
+
@include media($breakpoint-xl) {
|
|
67
|
+
padding: $spacing-sm;
|
|
68
|
+
}
|
|
83
69
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
svg {
|
|
71
|
+
fill: $button-hover;
|
|
72
|
+
height: 1rem;
|
|
73
|
+
width: 1rem;
|
|
87
74
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
}
|
|
75
|
+
path {
|
|
76
|
+
fill: $button-hover;
|
|
92
77
|
}
|
|
93
78
|
}
|
|
94
79
|
|
|
95
|
-
&:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
gap: 0;
|
|
99
|
-
outline-offset: 0;
|
|
100
|
-
padding: 0;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.#{$px}-left-arrow {
|
|
104
|
-
transform: rotateX(-1);
|
|
80
|
+
&:hover {
|
|
81
|
+
color: $pure-black;
|
|
82
|
+
cursor: pointer;
|
|
105
83
|
|
|
106
84
|
svg {
|
|
107
|
-
|
|
108
|
-
width: 1rem;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
&:hover {
|
|
112
|
-
background: $pure-white;
|
|
85
|
+
fill: $pure-black;
|
|
113
86
|
|
|
114
|
-
|
|
87
|
+
path {
|
|
115
88
|
fill: $pure-black;
|
|
116
|
-
|
|
117
|
-
path {
|
|
118
|
-
fill: $pure-black;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
&:focus-visible {
|
|
124
|
-
&:focus-visible {
|
|
125
|
-
outline: none;
|
|
126
|
-
outline-offset: none;
|
|
127
89
|
}
|
|
128
90
|
}
|
|
129
91
|
}
|
|
130
92
|
|
|
131
|
-
|
|
132
|
-
color: $
|
|
133
|
-
|
|
134
|
-
|
|
93
|
+
&:focus-visible {
|
|
94
|
+
border-color: $button-hover;
|
|
95
|
+
border-radius: 6.25rem;
|
|
96
|
+
border-style: solid;
|
|
97
|
+
border-width: 1px;
|
|
98
|
+
outline-color: transparent;
|
|
99
|
+
outline-offset: unset;
|
|
100
|
+
padding: 0 $spacing-sm;
|
|
101
|
+
|
|
102
|
+
@include media($breakpoint-xl) {
|
|
103
|
+
padding: $spacing-sm;
|
|
104
|
+
}
|
|
135
105
|
}
|
|
136
106
|
}
|
|
137
107
|
}
|