@elliemae/ds-pills 2.2.0-alpha.2 → 2.2.0-beta.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.
- package/cjs/components/Pill.js +49 -56
- package/cjs/components/PillButton.js +52 -54
- package/cjs/components/PillGroup.js +53 -61
- package/cjs/components/index.js +17 -30
- package/cjs/components/styled.js +78 -228
- package/cjs/components/types/DropdownPill.js +77 -79
- package/cjs/components/types/InputPill.js +48 -58
- package/cjs/components/types/LabelPill.js +38 -44
- package/cjs/components/types/ReadOnlyPill.js +43 -48
- package/cjs/components/types/RemovablePill.js +53 -60
- package/cjs/components/types/ValuePill.js +43 -48
- package/cjs/components/types/index.js +19 -33
- package/cjs/deprecated/DropdownPill.js +101 -80
- package/cjs/deprecated/InputPill.js +69 -67
- package/cjs/deprecated/LabeledDropdownPills.js +96 -92
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +94 -91
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +114 -106
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +127 -119
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +15 -39
- package/cjs/deprecated/LabeledPills.js +52 -65
- package/cjs/deprecated/OverflowPill.js +53 -59
- package/cjs/deprecated/Pill.js +82 -67
- package/cjs/deprecated/PillGroup.js +68 -68
- package/cjs/deprecated/ReadOnlyPill.js +94 -93
- package/cjs/deprecated/RemovablePill.js +57 -61
- package/cjs/deprecated/index.js +33 -43
- package/cjs/index.d.js +2 -27
- package/cjs/index.js +43 -37
- package/cjs/props.js +46 -72
- package/cjs/utils.js +25 -43
- package/esm/components/Pill.js +31 -18
- package/esm/components/PillButton.js +39 -22
- package/esm/components/PillGroup.js +38 -28
- package/esm/components/index.js +3 -5
- package/esm/components/styled.js +66 -205
- package/esm/components/types/DropdownPill.js +67 -50
- package/esm/components/types/InputPill.js +35 -25
- package/esm/components/types/LabelPill.js +29 -15
- package/esm/components/types/ReadOnlyPill.js +34 -19
- package/esm/components/types/RemovablePill.js +44 -31
- package/esm/components/types/ValuePill.js +34 -19
- package/esm/components/types/index.js +6 -8
- package/esm/deprecated/DropdownPill.js +86 -49
- package/esm/deprecated/InputPill.js +59 -38
- package/esm/deprecated/LabeledDropdownPills.js +81 -59
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +84 -60
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +94 -65
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +108 -79
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +10 -9
- package/esm/deprecated/LabeledPills.js +41 -34
- package/esm/deprecated/OverflowPill.js +37 -25
- package/esm/deprecated/Pill.js +71 -39
- package/esm/deprecated/PillGroup.js +56 -39
- package/esm/deprecated/ReadOnlyPill.js +79 -60
- package/esm/deprecated/RemovablePill.js +45 -30
- package/esm/deprecated/index.js +8 -14
- package/esm/index.d.js +1 -2
- package/esm/index.js +11 -8
- package/esm/props.js +36 -42
- package/esm/utils.js +23 -16
- package/package.json +15 -15
- package/types/components/PillGroup.d.ts +1 -1
- package/types/deprecated/DropdownPill.d.ts +1 -10
- package/types/deprecated/LabeledDropdownPills.d.ts +1 -12
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +1 -3
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +1 -3
- package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +0 -1
- package/types/deprecated/LabeledPills.d.ts +1 -8
- package/types/deprecated/OverflowPill.d.ts +1 -5
- package/types/deprecated/Pill.d.ts +1 -9
- package/types/deprecated/PillGroup.d.ts +1 -7
- package/types/deprecated/ReadOnlyPill.d.ts +1 -8
- package/types/deprecated/RemovablePill.d.ts +1 -7
- package/cjs/components/Pill.js.map +0 -7
- package/cjs/components/PillButton.js.map +0 -7
- package/cjs/components/PillGroup.js.map +0 -7
- package/cjs/components/index.js.map +0 -7
- package/cjs/components/styled.js.map +0 -7
- package/cjs/components/types/DropdownPill.js.map +0 -7
- package/cjs/components/types/InputPill.js.map +0 -7
- package/cjs/components/types/LabelPill.js.map +0 -7
- package/cjs/components/types/ReadOnlyPill.js.map +0 -7
- package/cjs/components/types/RemovablePill.js.map +0 -7
- package/cjs/components/types/ValuePill.js.map +0 -7
- package/cjs/components/types/index.js.map +0 -7
- package/cjs/deprecated/DropdownPill.js.map +0 -7
- package/cjs/deprecated/InputPill.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPills.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -7
- package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -7
- package/cjs/deprecated/LabeledPills.js.map +0 -7
- package/cjs/deprecated/OverflowPill.js.map +0 -7
- package/cjs/deprecated/Pill.js.map +0 -7
- package/cjs/deprecated/PillGroup.js.map +0 -7
- package/cjs/deprecated/ReadOnlyPill.js.map +0 -7
- package/cjs/deprecated/RemovablePill.js.map +0 -7
- package/cjs/deprecated/index.js.map +0 -7
- package/cjs/index.d.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/props.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/esm/components/Pill.js.map +0 -7
- package/esm/components/PillButton.js.map +0 -7
- package/esm/components/PillGroup.js.map +0 -7
- package/esm/components/index.js.map +0 -7
- package/esm/components/styled.js.map +0 -7
- package/esm/components/types/DropdownPill.js.map +0 -7
- package/esm/components/types/InputPill.js.map +0 -7
- package/esm/components/types/LabelPill.js.map +0 -7
- package/esm/components/types/ReadOnlyPill.js.map +0 -7
- package/esm/components/types/RemovablePill.js.map +0 -7
- package/esm/components/types/ValuePill.js.map +0 -7
- package/esm/components/types/index.js.map +0 -7
- package/esm/deprecated/DropdownPill.js.map +0 -7
- package/esm/deprecated/InputPill.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPills.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -7
- package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -7
- package/esm/deprecated/LabeledPills.js.map +0 -7
- package/esm/deprecated/OverflowPill.js.map +0 -7
- package/esm/deprecated/Pill.js.map +0 -7
- package/esm/deprecated/PillGroup.js.map +0 -7
- package/esm/deprecated/ReadOnlyPill.js.map +0 -7
- package/esm/deprecated/RemovablePill.js.map +0 -7
- package/esm/deprecated/index.js.map +0 -7
- package/esm/index.d.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/props.js.map +0 -7
- package/esm/utils.js.map +0 -7
package/esm/components/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export * from "./PillButton";
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { DSPillV2, DSPillV2WithSchema } from './Pill.js';
|
|
2
|
+
export { DSPillGroupV2, DSPillGroupV2Context, DSPillGroupV2WithSchema } from './PillGroup.js';
|
|
3
|
+
export { DSPillButton, DSPillButtonWithSchema } from './PillButton.js';
|
package/esm/components/styled.js
CHANGED
|
@@ -1,206 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import styled from
|
|
3
|
-
import { css } from
|
|
4
|
-
import
|
|
5
|
-
import { DSButtonV2 } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
border-top-left-radius:
|
|
16
|
-
border-top-right-radius: ${borderRadius};
|
|
17
|
-
border-bottom-left-radius: ${borderRadius};
|
|
18
|
-
border-bottom-right-radius: ${borderRadius};
|
|
19
|
-
pointer-events: none;
|
|
20
|
-
z-index: ${zIndex};
|
|
21
|
-
}
|
|
22
|
-
`;
|
|
23
|
-
const commonPillWrapperCss = css`
|
|
24
|
-
height: ${(props) => props?.size === "m" ? "24px" : "18px"};
|
|
25
|
-
|
|
26
|
-
position: relative;
|
|
27
|
-
|
|
28
|
-
width: fit-content;
|
|
29
|
-
|
|
30
|
-
background-color: ${(props) => props.theme.colors.brand[200]};
|
|
31
|
-
|
|
32
|
-
outline: none;
|
|
33
|
-
|
|
34
|
-
white-space: nowrap;
|
|
35
|
-
|
|
36
|
-
padding: 0px 12px 0 12px;
|
|
37
|
-
border-radius: 12px;
|
|
38
|
-
|
|
39
|
-
font-size: 13px;
|
|
40
|
-
line-height: 1;
|
|
41
|
-
color: ${(props) => props.theme.colors.brand[800]};
|
|
42
|
-
${(props) => borderOutside(props.theme.colors.brand[300])};
|
|
43
|
-
`;
|
|
44
|
-
const StyledLabelPillWrapper = styled(Grid)`
|
|
45
|
-
${commonPillWrapperCss}
|
|
46
|
-
|
|
47
|
-
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
48
|
-
padding-left: ${(props) => props.hasIcon ? "0px !important" : "12px"};
|
|
49
|
-
`;
|
|
50
|
-
const StyledValuePillWrapper = styled(Grid)`
|
|
51
|
-
${commonPillWrapperCss}
|
|
52
|
-
|
|
53
|
-
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
54
|
-
padding-left: ${(props) => props.hasIcon ? "0px !important" : "12px"};
|
|
55
|
-
`;
|
|
56
|
-
const StyledInputPillWrapper = styled(Grid)`
|
|
57
|
-
${commonPillWrapperCss}
|
|
58
|
-
|
|
59
|
-
background: ${(props) => props.theme.colors.neutral["000"]};
|
|
60
|
-
padding: 0;
|
|
61
|
-
|
|
62
|
-
${({ value, theme }) => borderOutside(value === "" ? theme.colors.neutral[400] : theme.colors.brand[500])}
|
|
63
|
-
|
|
64
|
-
:focus-within {
|
|
65
|
-
${(props) => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : ""}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
:active {
|
|
69
|
-
${(props) => props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : ""}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
& .em-ds-input {
|
|
73
|
-
outline: none !important;
|
|
74
|
-
border: none !important;
|
|
75
|
-
box-shadow: none !important;
|
|
76
|
-
border-radius: 0 !important;
|
|
77
|
-
height: 100%;
|
|
78
|
-
background: transparent;
|
|
79
|
-
width: ${(props) => `${props.inputWidth + (props.value === "" ? 24 : 0)}px`};
|
|
80
|
-
padding: 0;
|
|
81
|
-
margin: 0 0 0 8px;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
& .em-ds-input__tooltip-ref {
|
|
85
|
-
height: 100%;
|
|
86
|
-
}
|
|
87
|
-
`;
|
|
88
|
-
const StyledDropdownPillWrapper = styled(Grid)`
|
|
89
|
-
${commonPillWrapperCss}
|
|
90
|
-
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
91
|
-
|
|
92
|
-
padding: 0 0 0 12px;
|
|
93
|
-
`;
|
|
94
|
-
const StyledReadonlyPillWrapper = styled(Grid)`
|
|
95
|
-
${commonPillWrapperCss}
|
|
96
|
-
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
97
|
-
padding-right: ${(props) => props.hasIconRight ? "0 !important" : "12px"};
|
|
98
|
-
padding-left: ${(props) => props.hasIconLeft ? "0 !important" : "12px"};
|
|
99
|
-
`;
|
|
100
|
-
const StyledRemovablePillWrapper = styled(Grid)`
|
|
101
|
-
${commonPillWrapperCss}
|
|
102
|
-
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
103
|
-
padding: 0 0 0 12px;
|
|
104
|
-
`;
|
|
105
|
-
const StyledPillGroup = styled(Grid)`
|
|
106
|
-
width: ${({ width }) => width};
|
|
107
|
-
|
|
108
|
-
// Pill edges
|
|
109
|
-
& .ds-pill-wrapper {
|
|
110
|
-
&:not(:first-of-type) {
|
|
111
|
-
&,
|
|
112
|
-
:after,
|
|
113
|
-
:before,
|
|
114
|
-
.ds-pill-tooltip-value:after {
|
|
115
|
-
border-top-left-radius: 0px;
|
|
116
|
-
border-bottom-left-radius: 0px;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
&:not(:last-of-type) {
|
|
120
|
-
&,
|
|
121
|
-
:after,
|
|
122
|
-
:before,
|
|
123
|
-
.ds-pill-tooltip-value:after {
|
|
124
|
-
border-top-right-radius: 0px;
|
|
125
|
-
border-bottom-right-radius: 0px;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Pill paddings to the left / right
|
|
131
|
-
& .ds-pill-wrapper-label,
|
|
132
|
-
& .ds-pill-wrapper-value,
|
|
133
|
-
& .ds-pill-wrapper-readonly {
|
|
134
|
-
&:not(:first-of-type) {
|
|
135
|
-
padding-left: 8px;
|
|
136
|
-
}
|
|
137
|
-
&:not(:last-of-type) {
|
|
138
|
-
padding-right: 8px;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
& .ds-pill-wrapper-removable:not(:first-of-type) {
|
|
143
|
-
padding-left: 8px;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
& .ds-pill-wrapper-dropdown:not(:first-of-type) {
|
|
147
|
-
padding-left: 8px;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
& .ds-pill-wrapper {
|
|
151
|
-
:not(:first-of-type) {
|
|
152
|
-
.ds-pill-button-left {
|
|
153
|
-
border-radius: 0px;
|
|
154
|
-
}
|
|
155
|
-
.ds-pill-button-only {
|
|
156
|
-
border-top-left-radius: 0px;
|
|
157
|
-
border-bottom-left-radius: 0px;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
:not(:last-of-type) {
|
|
161
|
-
.ds-pill-button-right {
|
|
162
|
-
border-radius: 0px;
|
|
163
|
-
}
|
|
164
|
-
.ds-pill-button-only {
|
|
165
|
-
border-top-right-radius: 0px;
|
|
166
|
-
border-bottom-right-radius: 0px;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
`;
|
|
171
|
-
const StyledSpanWithTooltip = styled.span`
|
|
172
|
-
outline: none;
|
|
173
|
-
:focus {
|
|
174
|
-
${(props) => borderOutside(props.theme.colors.brand[700], 2, 3)}
|
|
175
|
-
}
|
|
176
|
-
`;
|
|
177
|
-
const StyledPillButton = styled(DSButtonV2)`
|
|
178
|
-
display: grid;
|
|
179
|
-
place-items: center;
|
|
180
|
-
|
|
181
|
-
position: relative;
|
|
182
|
-
|
|
183
|
-
padding: 0;
|
|
184
|
-
width: ${(props) => props.width};
|
|
185
|
-
height: ${(props) => props.height};
|
|
186
|
-
|
|
187
|
-
border-radius: 12px;
|
|
188
|
-
|
|
189
|
-
:focus {
|
|
190
|
-
${(props) => borderOutside(props.theme.colors.brand[700], 2, 3, "inherit")}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
cursor: pointer;
|
|
194
|
-
`;
|
|
195
|
-
export {
|
|
196
|
-
StyledDropdownPillWrapper,
|
|
197
|
-
StyledInputPillWrapper,
|
|
198
|
-
StyledLabelPillWrapper,
|
|
199
|
-
StyledPillButton,
|
|
200
|
-
StyledPillGroup,
|
|
201
|
-
StyledReadonlyPillWrapper,
|
|
202
|
-
StyledRemovablePillWrapper,
|
|
203
|
-
StyledSpanWithTooltip,
|
|
204
|
-
StyledValuePillWrapper
|
|
1
|
+
import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { css } from '@elliemae/ds-system';
|
|
4
|
+
import Grid from '@elliemae/ds-grid';
|
|
5
|
+
import { DSButtonV2 } from '@elliemae/ds-button';
|
|
6
|
+
|
|
7
|
+
var _templateObject, _templateObject2;
|
|
8
|
+
// Common CSS
|
|
9
|
+
// =============================================================================
|
|
10
|
+
|
|
11
|
+
const borderOutside = function (color) {
|
|
12
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
13
|
+
let zIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
|
14
|
+
let borderRadius = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '12px';
|
|
15
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :after {\n content: ' ';\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n border: ", "px solid ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n pointer-events: none;\n z-index: ", ";\n }\n"])), size, color, borderRadius, borderRadius, borderRadius, borderRadius, zIndex);
|
|
205
16
|
};
|
|
206
|
-
|
|
17
|
+
|
|
18
|
+
const commonPillWrapperCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", ";\n\n position: relative;\n\n width: fit-content;\n\n background-color: ", ";\n\n outline: none;\n\n white-space: nowrap;\n\n padding: 0px 12px 0 12px;\n border-radius: 12px;\n\n font-size: 13px;\n line-height: 1;\n color: ", ";\n ", ";\n"])), props => (props === null || props === void 0 ? void 0 : props.size) === 'm' ? '24px' : '18px', props => props.theme.colors.brand[200], props => props.theme.colors.brand[800], props => borderOutside(props.theme.colors.brand[300])); // =============================================================================
|
|
19
|
+
// Pills wrappers
|
|
20
|
+
// =============================================================================
|
|
21
|
+
|
|
22
|
+
const StyledLabelPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
23
|
+
componentId: "sc-j0tlch-0"
|
|
24
|
+
})(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIcon ? '0px !important' : '12px');
|
|
25
|
+
const StyledValuePillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
26
|
+
componentId: "sc-j0tlch-1"
|
|
27
|
+
})(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.regular, props => props.hasIcon ? '0px !important' : '12px');
|
|
28
|
+
const StyledInputPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
29
|
+
componentId: "sc-j0tlch-2"
|
|
30
|
+
})(["", " background:", ";padding:0;", ":focus-within{", "}:active{", "}& .em-ds-input{outline:none !important;border:none !important;box-shadow:none !important;border-radius:0 !important;height:100%;background:transparent;width:", ";padding:0;margin:0 0 0 8px;}& .em-ds-input__tooltip-ref{height:100%;}"], commonPillWrapperCss, props => props.theme.colors.neutral['000'], _ref => {
|
|
31
|
+
let {
|
|
32
|
+
value,
|
|
33
|
+
theme
|
|
34
|
+
} = _ref;
|
|
35
|
+
return borderOutside(value === '' ? theme.colors.neutral[400] : theme.colors.brand[500]);
|
|
36
|
+
}, props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '', props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '', props => "".concat(props.inputWidth + (props.value === '' ? 24 : 0), "px"));
|
|
37
|
+
const StyledDropdownPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
38
|
+
componentId: "sc-j0tlch-3"
|
|
39
|
+
})(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.semibold);
|
|
40
|
+
const StyledReadonlyPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
41
|
+
componentId: "sc-j0tlch-4"
|
|
42
|
+
})(["", " font-weight:", ";padding-right:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIconRight ? '0 !important' : '12px', props => props.hasIconLeft ? '0 !important' : '12px');
|
|
43
|
+
const StyledRemovablePillWrapper = /*#__PURE__*/styled(Grid).withConfig({
|
|
44
|
+
componentId: "sc-j0tlch-5"
|
|
45
|
+
})(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.regular); // =============================================================================
|
|
46
|
+
// Pill group
|
|
47
|
+
// =============================================================================
|
|
48
|
+
|
|
49
|
+
const StyledPillGroup = /*#__PURE__*/styled(Grid).withConfig({
|
|
50
|
+
componentId: "sc-j0tlch-6"
|
|
51
|
+
})(["width:", ";& .ds-pill-wrapper{&:not(:first-of-type){&,:after,:before,.ds-pill-tooltip-value:after{border-top-left-radius:0px;border-bottom-left-radius:0px;}}&:not(:last-of-type){&,:after,:before,.ds-pill-tooltip-value:after{border-top-right-radius:0px;border-bottom-right-radius:0px;}}}& .ds-pill-wrapper-label,& .ds-pill-wrapper-value,& .ds-pill-wrapper-readonly{&:not(:first-of-type){padding-left:8px;}&:not(:last-of-type){padding-right:8px;}}& .ds-pill-wrapper-removable:not(:first-of-type){padding-left:8px;}& .ds-pill-wrapper-dropdown:not(:first-of-type){padding-left:8px;}& .ds-pill-wrapper{:not(:first-of-type){.ds-pill-button-left{border-radius:0px;}.ds-pill-button-only{border-top-left-radius:0px;border-bottom-left-radius:0px;}}:not(:last-of-type){.ds-pill-button-right{border-radius:0px;}.ds-pill-button-only{border-top-right-radius:0px;border-bottom-right-radius:0px;}}}"], _ref2 => {
|
|
52
|
+
let {
|
|
53
|
+
width
|
|
54
|
+
} = _ref2;
|
|
55
|
+
return width;
|
|
56
|
+
}); // =============================================================================
|
|
57
|
+
// Extra stuff
|
|
58
|
+
// =============================================================================
|
|
59
|
+
|
|
60
|
+
const StyledSpanWithTooltip = /*#__PURE__*/styled.span.withConfig({
|
|
61
|
+
componentId: "sc-j0tlch-7"
|
|
62
|
+
})(["outline:none;:focus{", "}"], props => borderOutside(props.theme.colors.brand[700], 2, 3));
|
|
63
|
+
const StyledPillButton = /*#__PURE__*/styled(DSButtonV2).withConfig({
|
|
64
|
+
componentId: "sc-j0tlch-8"
|
|
65
|
+
})(["display:grid;place-items:center;position:relative;padding:0;width:", ";height:", ";border-radius:12px;:focus{", "}cursor:pointer;"], props => props.width, props => props.height, props => borderOutside(props.theme.colors.brand[700], 2, 3, 'inherit'));
|
|
66
|
+
|
|
67
|
+
export { StyledDropdownPillWrapper, StyledInputPillWrapper, StyledLabelPillWrapper, StyledPillButton, StyledPillGroup, StyledReadonlyPillWrapper, StyledRemovablePillWrapper, StyledSpanWithTooltip, StyledValuePillWrapper };
|
|
@@ -1,59 +1,76 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import React, { useRef, useMemo } from 'react';
|
|
9
|
+
import { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';
|
|
10
|
+
import { uid } from 'uid';
|
|
11
|
+
import { ChevronSmallDown } from '@elliemae/ds-icons';
|
|
12
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
13
|
+
import { StyledDropdownPillWrapper } from '../styled.js';
|
|
14
|
+
import { setMultipleRefs } from '../../utils.js';
|
|
15
|
+
import { DSPillButton } from '../PillButton.js';
|
|
16
|
+
import { jsx } from 'react/jsx-runtime';
|
|
17
|
+
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
const DropdownPill = /*#__PURE__*/React.memo(_ref => {
|
|
22
|
+
let {
|
|
23
|
+
label,
|
|
17
24
|
size,
|
|
25
|
+
labelTruncated,
|
|
26
|
+
dropdownProps,
|
|
27
|
+
innerRef,
|
|
28
|
+
ariaLabel,
|
|
29
|
+
onDropdownClick
|
|
30
|
+
} = _ref;
|
|
31
|
+
const chevronRef = useRef(null);
|
|
32
|
+
const pillUid = useMemo(() => "ds-pill-".concat(uid()), []);
|
|
33
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
34
|
+
let {
|
|
35
|
+
children
|
|
36
|
+
} = _ref2;
|
|
37
|
+
return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
38
|
+
value: children
|
|
39
|
+
});
|
|
40
|
+
} : React.Fragment;
|
|
41
|
+
return /*#__PURE__*/_jsx(StyledDropdownPillWrapper, {
|
|
42
|
+
size: size,
|
|
18
43
|
id: pillUid,
|
|
19
44
|
className: "ds-pill-wrapper ds-pill-wrapper-dropdown",
|
|
20
45
|
"data-testid": "ds-pill-wrapper",
|
|
21
|
-
cols: [
|
|
46
|
+
cols: ['auto', '24px'],
|
|
22
47
|
gutter: "2px",
|
|
23
48
|
alignItems: "center",
|
|
24
49
|
justifyItems: "center"
|
|
25
|
-
},
|
|
26
|
-
placementOrderPreference: [
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
...dropdownProps,
|
|
36
|
-
onClickOutside: (e) => {
|
|
37
|
-
if (e.code === "Escape")
|
|
38
|
-
chevronRef.current.focus();
|
|
39
|
-
if (dropdownProps.onClickOutside)
|
|
40
|
-
dropdownProps.onClickOutside(e);
|
|
50
|
+
}, void 0, /*#__PURE__*/_jsx(TextComponent, {}, void 0, label), /*#__PURE__*/jsx(DSDropdownMenuV2, _objectSpread(_objectSpread({
|
|
51
|
+
placementOrderPreference: ['bottom-start', 'bottom', 'bottom-end', 'right-end', 'top-start', 'top', 'top-end']
|
|
52
|
+
}, dropdownProps), {}, {
|
|
53
|
+
onClickOutside: e => {
|
|
54
|
+
if (e.code === 'Escape') chevronRef.current.focus();
|
|
55
|
+
if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);
|
|
56
|
+
},
|
|
57
|
+
wrapperStyles: {
|
|
58
|
+
w: '100%',
|
|
59
|
+
h: '100%'
|
|
41
60
|
},
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
})))
|
|
61
|
+
children: /*#__PURE__*/_jsx(DSPillButton, {
|
|
62
|
+
className: "ds-pill-focus-point",
|
|
63
|
+
"data-testid": "ds-pill-dropdown-chevron",
|
|
64
|
+
innerRef: setMultipleRefs(chevronRef, innerRef),
|
|
65
|
+
"aria-label": ariaLabel || label,
|
|
66
|
+
type: "right",
|
|
67
|
+
onClick: onDropdownClick
|
|
68
|
+
}, void 0, /*#__PURE__*/_jsx(ChevronSmallDown, {
|
|
69
|
+
color: ['brand-primary', '800'],
|
|
70
|
+
width: 20,
|
|
71
|
+
height: 20
|
|
72
|
+
}))
|
|
73
|
+
})));
|
|
55
74
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
//# sourceMappingURL=DropdownPill.js.map
|
|
75
|
+
|
|
76
|
+
export { DropdownPill };
|
|
@@ -1,31 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
|
+
import React, { useRef, useMemo, useCallback, useState } from 'react';
|
|
4
|
+
import { uid } from 'uid';
|
|
5
|
+
import { CloseXsmall } from '@elliemae/ds-icons';
|
|
6
|
+
import { StyledInputPillWrapper } from '../styled.js';
|
|
7
|
+
import { setMultipleRefs } from '../../utils.js';
|
|
8
|
+
import { DSPillButton } from '../PillButton.js';
|
|
9
|
+
|
|
10
|
+
const InputPill = /*#__PURE__*/React.memo(_ref => {
|
|
11
|
+
let {
|
|
12
|
+
label,
|
|
13
|
+
size,
|
|
14
|
+
inputPlaceholder,
|
|
15
|
+
inputWidth,
|
|
16
|
+
inputRender,
|
|
17
|
+
onInputChange,
|
|
18
|
+
onInputClear,
|
|
19
|
+
innerRef
|
|
20
|
+
} = _ref;
|
|
9
21
|
const ref = useRef(null);
|
|
10
22
|
const InputComponent = useMemo(() => inputRender, [inputRender]);
|
|
11
|
-
const pillUid = useMemo(() =>
|
|
12
|
-
const onCloseIconClick = useCallback(
|
|
13
|
-
if ([
|
|
23
|
+
const pillUid = useMemo(() => "ds-pill-".concat(uid()), []);
|
|
24
|
+
const onCloseIconClick = useCallback(e => {
|
|
25
|
+
if ([undefined, 'Enter', 'Space'].includes(e.code)) {
|
|
14
26
|
e.preventDefault();
|
|
15
27
|
onInputClear(e);
|
|
16
28
|
ref.current.focus();
|
|
17
29
|
}
|
|
18
30
|
}, [onInputClear]);
|
|
19
31
|
const [inputHasFocus, setInputHasFocus] = useState(false);
|
|
20
|
-
return
|
|
21
|
-
size,
|
|
32
|
+
return /*#__PURE__*/_jsx(StyledInputPillWrapper, {
|
|
33
|
+
size: size,
|
|
22
34
|
className: "ds-pill-wrapper",
|
|
23
35
|
"data-testid": "ds-pill-wrapper",
|
|
24
|
-
cols: label ===
|
|
25
|
-
inputWidth,
|
|
36
|
+
cols: label === '' ? ['auto'] : ['auto', '24px'],
|
|
37
|
+
inputWidth: inputWidth,
|
|
26
38
|
value: label,
|
|
27
|
-
inputHasFocus
|
|
28
|
-
},
|
|
39
|
+
inputHasFocus: inputHasFocus
|
|
40
|
+
}, void 0, /*#__PURE__*/_jsx(InputComponent, {
|
|
29
41
|
id: pillUid,
|
|
30
42
|
className: "ds-pill-focus-point",
|
|
31
43
|
"data-testid": "ds-pill-input",
|
|
@@ -36,20 +48,18 @@ const InputPill = React2.memo(({ label, size, inputPlaceholder, inputWidth, inpu
|
|
|
36
48
|
onFocus: () => setInputHasFocus(true),
|
|
37
49
|
onBlur: () => setInputHasFocus(false),
|
|
38
50
|
disableTooltip: false
|
|
39
|
-
}), label !==
|
|
51
|
+
}), label !== '' && /*#__PURE__*/_jsx(DSPillButton, {
|
|
40
52
|
id: pillUid,
|
|
41
53
|
"data-testid": "ds-pill-clear-icon",
|
|
42
|
-
innerRef,
|
|
54
|
+
innerRef: innerRef,
|
|
43
55
|
onClick: onCloseIconClick,
|
|
44
56
|
onKeyDown: onCloseIconClick,
|
|
45
57
|
"aria-label": "Clear input",
|
|
46
58
|
type: "right"
|
|
47
|
-
},
|
|
59
|
+
}, void 0, /*#__PURE__*/_jsx(CloseXsmall, {
|
|
48
60
|
size: "s",
|
|
49
|
-
color: [
|
|
61
|
+
color: ['brand-primary', '700']
|
|
50
62
|
})));
|
|
51
63
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=InputPill.js.map
|
|
64
|
+
|
|
65
|
+
export { InputPill };
|
|
@@ -1,23 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
7
|
+
import { StyledLabelPillWrapper } from '../styled.js';
|
|
8
|
+
|
|
9
|
+
const LabelPill = /*#__PURE__*/React.memo(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
label,
|
|
10
12
|
size,
|
|
13
|
+
labelTruncated,
|
|
14
|
+
iconLeft,
|
|
15
|
+
ariaLabel
|
|
16
|
+
} = _ref;
|
|
17
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
18
|
+
let {
|
|
19
|
+
children
|
|
20
|
+
} = _ref2;
|
|
21
|
+
return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
22
|
+
value: children
|
|
23
|
+
});
|
|
24
|
+
} : React.Fragment;
|
|
25
|
+
return /*#__PURE__*/_jsx(StyledLabelPillWrapper, {
|
|
26
|
+
size: size,
|
|
11
27
|
alignItems: "center",
|
|
12
28
|
className: "ds-pill-wrapper ds-pill-wrapper-label",
|
|
13
29
|
"data-testid": "ds-pill-wrapper",
|
|
14
30
|
"aria-label": ariaLabel || label,
|
|
15
|
-
cols: [iconLeft &&
|
|
31
|
+
cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
|
|
16
32
|
gutter: "xxxs",
|
|
17
33
|
hasIcon: iconLeft !== null
|
|
18
|
-
}, iconLeft,
|
|
34
|
+
}, void 0, iconLeft, /*#__PURE__*/_jsx(TextComponent, {}, void 0, label));
|
|
19
35
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=LabelPill.js.map
|
|
36
|
+
|
|
37
|
+
export { LabelPill };
|
|
@@ -1,26 +1,41 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
|
|
7
|
+
import { StyledReadonlyPillWrapper } from '../styled.js';
|
|
8
|
+
|
|
9
|
+
const ReadOnlyPill = /*#__PURE__*/React.memo(_ref => {
|
|
10
|
+
let {
|
|
11
|
+
label,
|
|
12
12
|
size,
|
|
13
|
+
labelTruncated,
|
|
14
|
+
iconLeft,
|
|
15
|
+
iconRight,
|
|
16
|
+
ariaLabel
|
|
17
|
+
} = _ref;
|
|
18
|
+
const hasIconLeft = iconLeft !== null || iconRight !== null && label === '';
|
|
19
|
+
const hasIconRight = iconRight !== null || iconLeft !== null && label === '';
|
|
20
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
21
|
+
let {
|
|
22
|
+
children
|
|
23
|
+
} = _ref2;
|
|
24
|
+
return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
|
|
25
|
+
value: children
|
|
26
|
+
});
|
|
27
|
+
} : React.Fragment;
|
|
28
|
+
return /*#__PURE__*/_jsx(StyledReadonlyPillWrapper, {
|
|
29
|
+
size: size,
|
|
13
30
|
alignItems: "center",
|
|
14
31
|
className: "ds-pill-wrapper ds-pill-wrapper-readonly",
|
|
15
32
|
"data-testid": "ds-pill-wrapper",
|
|
16
33
|
"aria-label": ariaLabel || label,
|
|
17
|
-
cols: [iconLeft &&
|
|
34
|
+
cols: [iconLeft && 'min-content', label && 'auto', iconRight && 'min-content'].filter(notFalse => notFalse),
|
|
18
35
|
gutter: "xxxs",
|
|
19
|
-
hasIconRight,
|
|
20
|
-
hasIconLeft
|
|
21
|
-
}, iconLeft, label ?
|
|
36
|
+
hasIconRight: hasIconRight,
|
|
37
|
+
hasIconLeft: hasIconLeft
|
|
38
|
+
}, void 0, iconLeft, label ? /*#__PURE__*/_jsx(TextComponent, {}, void 0, label) : null, iconRight);
|
|
22
39
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=ReadOnlyPill.js.map
|
|
40
|
+
|
|
41
|
+
export { ReadOnlyPill };
|