@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/cjs/components/styled.js
CHANGED
|
@@ -1,235 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __reExport = (target, module2, copyDefault, desc) => {
|
|
13
|
-
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(module2))
|
|
15
|
-
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
16
|
-
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return target;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (module2, isNodeMode) => {
|
|
21
|
-
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
22
|
-
};
|
|
23
|
-
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
24
|
-
return (module2, temp) => {
|
|
25
|
-
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
26
|
-
};
|
|
27
|
-
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
28
|
-
var styled_exports = {};
|
|
29
|
-
__export(styled_exports, {
|
|
30
|
-
StyledDropdownPillWrapper: () => StyledDropdownPillWrapper,
|
|
31
|
-
StyledInputPillWrapper: () => StyledInputPillWrapper,
|
|
32
|
-
StyledLabelPillWrapper: () => StyledLabelPillWrapper,
|
|
33
|
-
StyledPillButton: () => StyledPillButton,
|
|
34
|
-
StyledPillGroup: () => StyledPillGroup,
|
|
35
|
-
StyledReadonlyPillWrapper: () => StyledReadonlyPillWrapper,
|
|
36
|
-
StyledRemovablePillWrapper: () => StyledRemovablePillWrapper,
|
|
37
|
-
StyledSpanWithTooltip: () => StyledSpanWithTooltip,
|
|
38
|
-
StyledValuePillWrapper: () => StyledValuePillWrapper
|
|
39
|
-
});
|
|
40
|
-
var React = __toESM(require("react"));
|
|
41
|
-
var import_styled_components = __toESM(require("styled-components"));
|
|
42
|
-
var import_ds_system = __toESM(require("@elliemae/ds-system"));
|
|
43
|
-
var import_ds_grid = __toESM(require("@elliemae/ds-grid"));
|
|
44
|
-
var import_ds_button = __toESM(require("@elliemae/ds-button"));
|
|
45
|
-
const borderOutside = (color, size = 1, zIndex = 2, borderRadius = "12px") => import_ds_system.css`
|
|
46
|
-
:after {
|
|
47
|
-
content: ' ';
|
|
48
|
-
position: absolute;
|
|
49
|
-
top: 0px;
|
|
50
|
-
left: 0px;
|
|
51
|
-
right: 0px;
|
|
52
|
-
bottom: 0px;
|
|
53
|
-
border: ${size}px solid ${color};
|
|
54
|
-
border-top-left-radius: ${borderRadius};
|
|
55
|
-
border-top-right-radius: ${borderRadius};
|
|
56
|
-
border-bottom-left-radius: ${borderRadius};
|
|
57
|
-
border-bottom-right-radius: ${borderRadius};
|
|
58
|
-
pointer-events: none;
|
|
59
|
-
z-index: ${zIndex};
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
const commonPillWrapperCss = import_ds_system.css`
|
|
63
|
-
height: ${(props) => props?.size === "m" ? "24px" : "18px"};
|
|
64
|
-
|
|
65
|
-
position: relative;
|
|
66
|
-
|
|
67
|
-
width: fit-content;
|
|
68
|
-
|
|
69
|
-
background-color: ${(props) => props.theme.colors.brand[200]};
|
|
70
|
-
|
|
71
|
-
outline: none;
|
|
72
|
-
|
|
73
|
-
white-space: nowrap;
|
|
74
|
-
|
|
75
|
-
padding: 0px 12px 0 12px;
|
|
76
|
-
border-radius: 12px;
|
|
77
|
-
|
|
78
|
-
font-size: 13px;
|
|
79
|
-
line-height: 1;
|
|
80
|
-
color: ${(props) => props.theme.colors.brand[800]};
|
|
81
|
-
${(props) => borderOutside(props.theme.colors.brand[300])};
|
|
82
|
-
`;
|
|
83
|
-
const StyledLabelPillWrapper = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
84
|
-
${commonPillWrapperCss}
|
|
85
|
-
|
|
86
|
-
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
87
|
-
padding-left: ${(props) => props.hasIcon ? "0px !important" : "12px"};
|
|
88
|
-
`;
|
|
89
|
-
const StyledValuePillWrapper = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
90
|
-
${commonPillWrapperCss}
|
|
91
|
-
|
|
92
|
-
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
93
|
-
padding-left: ${(props) => props.hasIcon ? "0px !important" : "12px"};
|
|
94
|
-
`;
|
|
95
|
-
const StyledInputPillWrapper = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
96
|
-
${commonPillWrapperCss}
|
|
1
|
+
'use strict';
|
|
97
2
|
|
|
98
|
-
|
|
99
|
-
padding: 0;
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
100
4
|
|
|
101
|
-
|
|
5
|
+
var _taggedTemplateLiteral = require('@babel/runtime/helpers/taggedTemplateLiteral');
|
|
6
|
+
var styled = require('styled-components');
|
|
7
|
+
var dsSystem = require('@elliemae/ds-system');
|
|
8
|
+
var Grid = require('@elliemae/ds-grid');
|
|
9
|
+
var dsButton = require('@elliemae/ds-button');
|
|
102
10
|
|
|
103
|
-
|
|
104
|
-
${(props) => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : ""}
|
|
105
|
-
}
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
106
12
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
13
|
+
var _taggedTemplateLiteral__default = /*#__PURE__*/_interopDefaultLegacy(_taggedTemplateLiteral);
|
|
14
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
15
|
+
var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
|
|
110
16
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
box-shadow: none !important;
|
|
115
|
-
border-radius: 0 !important;
|
|
116
|
-
height: 100%;
|
|
117
|
-
background: transparent;
|
|
118
|
-
width: ${(props) => `${props.inputWidth + (props.value === "" ? 24 : 0)}px`};
|
|
119
|
-
padding: 0;
|
|
120
|
-
margin: 0 0 0 8px;
|
|
121
|
-
}
|
|
17
|
+
var _templateObject, _templateObject2;
|
|
18
|
+
// Common CSS
|
|
19
|
+
// =============================================================================
|
|
122
20
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
130
|
-
|
|
131
|
-
padding: 0 0 0 12px;
|
|
132
|
-
`;
|
|
133
|
-
const StyledReadonlyPillWrapper = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
134
|
-
${commonPillWrapperCss}
|
|
135
|
-
font-weight: ${(props) => props.theme.fontWeights.semibold};
|
|
136
|
-
padding-right: ${(props) => props.hasIconRight ? "0 !important" : "12px"};
|
|
137
|
-
padding-left: ${(props) => props.hasIconLeft ? "0 !important" : "12px"};
|
|
138
|
-
`;
|
|
139
|
-
const StyledRemovablePillWrapper = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
140
|
-
${commonPillWrapperCss}
|
|
141
|
-
font-weight: ${(props) => props.theme.fontWeights.regular};
|
|
142
|
-
padding: 0 0 0 12px;
|
|
143
|
-
`;
|
|
144
|
-
const StyledPillGroup = (0, import_styled_components.default)(import_ds_grid.Grid)`
|
|
145
|
-
width: ${({ width }) => width};
|
|
146
|
-
|
|
147
|
-
// Pill edges
|
|
148
|
-
& .ds-pill-wrapper {
|
|
149
|
-
&:not(:first-of-type) {
|
|
150
|
-
&,
|
|
151
|
-
:after,
|
|
152
|
-
:before,
|
|
153
|
-
.ds-pill-tooltip-value:after {
|
|
154
|
-
border-top-left-radius: 0px;
|
|
155
|
-
border-bottom-left-radius: 0px;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
&:not(:last-of-type) {
|
|
159
|
-
&,
|
|
160
|
-
:after,
|
|
161
|
-
:before,
|
|
162
|
-
.ds-pill-tooltip-value:after {
|
|
163
|
-
border-top-right-radius: 0px;
|
|
164
|
-
border-bottom-right-radius: 0px;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Pill paddings to the left / right
|
|
170
|
-
& .ds-pill-wrapper-label,
|
|
171
|
-
& .ds-pill-wrapper-value,
|
|
172
|
-
& .ds-pill-wrapper-readonly {
|
|
173
|
-
&:not(:first-of-type) {
|
|
174
|
-
padding-left: 8px;
|
|
175
|
-
}
|
|
176
|
-
&:not(:last-of-type) {
|
|
177
|
-
padding-right: 8px;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
& .ds-pill-wrapper-removable:not(:first-of-type) {
|
|
182
|
-
padding-left: 8px;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
& .ds-pill-wrapper-dropdown:not(:first-of-type) {
|
|
186
|
-
padding-left: 8px;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
& .ds-pill-wrapper {
|
|
190
|
-
:not(:first-of-type) {
|
|
191
|
-
.ds-pill-button-left {
|
|
192
|
-
border-radius: 0px;
|
|
193
|
-
}
|
|
194
|
-
.ds-pill-button-only {
|
|
195
|
-
border-top-left-radius: 0px;
|
|
196
|
-
border-bottom-left-radius: 0px;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
:not(:last-of-type) {
|
|
200
|
-
.ds-pill-button-right {
|
|
201
|
-
border-radius: 0px;
|
|
202
|
-
}
|
|
203
|
-
.ds-pill-button-only {
|
|
204
|
-
border-top-right-radius: 0px;
|
|
205
|
-
border-bottom-right-radius: 0px;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
`;
|
|
210
|
-
const StyledSpanWithTooltip = import_styled_components.default.span`
|
|
211
|
-
outline: none;
|
|
212
|
-
:focus {
|
|
213
|
-
${(props) => borderOutside(props.theme.colors.brand[700], 2, 3)}
|
|
214
|
-
}
|
|
215
|
-
`;
|
|
216
|
-
const StyledPillButton = (0, import_styled_components.default)(import_ds_button.DSButtonV2)`
|
|
217
|
-
display: grid;
|
|
218
|
-
place-items: center;
|
|
219
|
-
|
|
220
|
-
position: relative;
|
|
221
|
-
|
|
222
|
-
padding: 0;
|
|
223
|
-
width: ${(props) => props.width};
|
|
224
|
-
height: ${(props) => props.height};
|
|
225
|
-
|
|
226
|
-
border-radius: 12px;
|
|
227
|
-
|
|
228
|
-
:focus {
|
|
229
|
-
${(props) => borderOutside(props.theme.colors.brand[700], 2, 3, "inherit")}
|
|
230
|
-
}
|
|
21
|
+
const borderOutside = function (color) {
|
|
22
|
+
let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
|
|
23
|
+
let zIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
|
|
24
|
+
let borderRadius = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '12px';
|
|
25
|
+
return dsSystem.css(_templateObject || (_templateObject = _taggedTemplateLiteral__default["default"](["\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);
|
|
26
|
+
};
|
|
231
27
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
28
|
+
const commonPillWrapperCss = dsSystem.css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral__default["default"](["\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])); // =============================================================================
|
|
29
|
+
// Pills wrappers
|
|
30
|
+
// =============================================================================
|
|
31
|
+
|
|
32
|
+
const StyledLabelPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
33
|
+
componentId: "sc-j0tlch-0"
|
|
34
|
+
})(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIcon ? '0px !important' : '12px');
|
|
35
|
+
const StyledValuePillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
36
|
+
componentId: "sc-j0tlch-1"
|
|
37
|
+
})(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.regular, props => props.hasIcon ? '0px !important' : '12px');
|
|
38
|
+
const StyledInputPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
39
|
+
componentId: "sc-j0tlch-2"
|
|
40
|
+
})(["", " 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 => {
|
|
41
|
+
let {
|
|
42
|
+
value,
|
|
43
|
+
theme
|
|
44
|
+
} = _ref;
|
|
45
|
+
return borderOutside(value === '' ? theme.colors.neutral[400] : theme.colors.brand[500]);
|
|
46
|
+
}, 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"));
|
|
47
|
+
const StyledDropdownPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
48
|
+
componentId: "sc-j0tlch-3"
|
|
49
|
+
})(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.semibold);
|
|
50
|
+
const StyledReadonlyPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
51
|
+
componentId: "sc-j0tlch-4"
|
|
52
|
+
})(["", " font-weight:", ";padding-right:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIconRight ? '0 !important' : '12px', props => props.hasIconLeft ? '0 !important' : '12px');
|
|
53
|
+
const StyledRemovablePillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
54
|
+
componentId: "sc-j0tlch-5"
|
|
55
|
+
})(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.regular); // =============================================================================
|
|
56
|
+
// Pill group
|
|
57
|
+
// =============================================================================
|
|
58
|
+
|
|
59
|
+
const StyledPillGroup = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
60
|
+
componentId: "sc-j0tlch-6"
|
|
61
|
+
})(["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 => {
|
|
62
|
+
let {
|
|
63
|
+
width
|
|
64
|
+
} = _ref2;
|
|
65
|
+
return width;
|
|
66
|
+
}); // =============================================================================
|
|
67
|
+
// Extra stuff
|
|
68
|
+
// =============================================================================
|
|
69
|
+
|
|
70
|
+
const StyledSpanWithTooltip = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
71
|
+
componentId: "sc-j0tlch-7"
|
|
72
|
+
})(["outline:none;:focus{", "}"], props => borderOutside(props.theme.colors.brand[700], 2, 3));
|
|
73
|
+
const StyledPillButton = /*#__PURE__*/styled__default["default"](dsButton.DSButtonV2).withConfig({
|
|
74
|
+
componentId: "sc-j0tlch-8"
|
|
75
|
+
})(["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'));
|
|
76
|
+
|
|
77
|
+
exports.StyledDropdownPillWrapper = StyledDropdownPillWrapper;
|
|
78
|
+
exports.StyledInputPillWrapper = StyledInputPillWrapper;
|
|
79
|
+
exports.StyledLabelPillWrapper = StyledLabelPillWrapper;
|
|
80
|
+
exports.StyledPillButton = StyledPillButton;
|
|
81
|
+
exports.StyledPillGroup = StyledPillGroup;
|
|
82
|
+
exports.StyledReadonlyPillWrapper = StyledReadonlyPillWrapper;
|
|
83
|
+
exports.StyledRemovablePillWrapper = StyledRemovablePillWrapper;
|
|
84
|
+
exports.StyledSpanWithTooltip = StyledSpanWithTooltip;
|
|
85
|
+
exports.StyledValuePillWrapper = StyledValuePillWrapper;
|
|
@@ -1,88 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var import_ds_dropdownmenu = __toESM(require("@elliemae/ds-dropdownmenu"));
|
|
35
|
-
var import_uid = __toESM(require("uid"));
|
|
36
|
-
var import_ds_icons = __toESM(require("@elliemae/ds-icons"));
|
|
37
|
-
var import_ds_truncated_tooltip_text = __toESM(require("@elliemae/ds-truncated-tooltip-text"));
|
|
38
|
-
var import_styled = __toESM(require("../styled"));
|
|
39
|
-
var import_utils = __toESM(require("../../utils"));
|
|
40
|
-
var import_PillButton = __toESM(require("../PillButton"));
|
|
41
|
-
const DropdownPill = import_react.default.memo(({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {
|
|
42
|
-
const chevronRef = (0, import_react.useRef)(null);
|
|
43
|
-
const pillUid = (0, import_react.useMemo)(() => `ds-pill-${(0, import_uid.uid)()}`, []);
|
|
44
|
-
const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ import_react.default.createElement(import_ds_truncated_tooltip_text.SimpleTruncatedTooltipText, {
|
|
45
|
-
value: children
|
|
46
|
-
}) : import_react.default.Fragment;
|
|
47
|
-
return /* @__PURE__ */ import_react.default.createElement(import_styled.StyledDropdownPillWrapper, {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
12
|
+
var React = require('react');
|
|
13
|
+
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
14
|
+
var uid = require('uid');
|
|
15
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
16
|
+
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
17
|
+
var styled = require('../styled.js');
|
|
18
|
+
var utils = require('../../utils.js');
|
|
19
|
+
var PillButton = require('../PillButton.js');
|
|
20
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
21
|
+
|
|
22
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
23
|
+
|
|
24
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
25
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
26
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
|
+
|
|
28
|
+
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; }
|
|
29
|
+
|
|
30
|
+
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__default["default"](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; }
|
|
31
|
+
const DropdownPill = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
32
|
+
let {
|
|
33
|
+
label,
|
|
48
34
|
size,
|
|
35
|
+
labelTruncated,
|
|
36
|
+
dropdownProps,
|
|
37
|
+
innerRef,
|
|
38
|
+
ariaLabel,
|
|
39
|
+
onDropdownClick
|
|
40
|
+
} = _ref;
|
|
41
|
+
const chevronRef = React.useRef(null);
|
|
42
|
+
const pillUid = React.useMemo(() => "ds-pill-".concat(uid.uid()), []);
|
|
43
|
+
const TextComponent = labelTruncated ? _ref2 => {
|
|
44
|
+
let {
|
|
45
|
+
children
|
|
46
|
+
} = _ref2;
|
|
47
|
+
return /*#__PURE__*/_jsx__default["default"](dsTruncatedTooltipText.SimpleTruncatedTooltipText, {
|
|
48
|
+
value: children
|
|
49
|
+
});
|
|
50
|
+
} : React__default["default"].Fragment;
|
|
51
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledDropdownPillWrapper, {
|
|
52
|
+
size: size,
|
|
49
53
|
id: pillUid,
|
|
50
54
|
className: "ds-pill-wrapper ds-pill-wrapper-dropdown",
|
|
51
55
|
"data-testid": "ds-pill-wrapper",
|
|
52
|
-
cols: [
|
|
56
|
+
cols: ['auto', '24px'],
|
|
53
57
|
gutter: "2px",
|
|
54
58
|
alignItems: "center",
|
|
55
59
|
justifyItems: "center"
|
|
56
|
-
},
|
|
57
|
-
placementOrderPreference: [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
...dropdownProps,
|
|
67
|
-
onClickOutside: (e) => {
|
|
68
|
-
if (e.code === "Escape")
|
|
69
|
-
chevronRef.current.focus();
|
|
70
|
-
if (dropdownProps.onClickOutside)
|
|
71
|
-
dropdownProps.onClickOutside(e);
|
|
60
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](TextComponent, {}, void 0, label), /*#__PURE__*/jsxRuntime.jsx(DSDropdownMenu.DSDropdownMenuV2, _objectSpread(_objectSpread({
|
|
61
|
+
placementOrderPreference: ['bottom-start', 'bottom', 'bottom-end', 'right-end', 'top-start', 'top', 'top-end']
|
|
62
|
+
}, dropdownProps), {}, {
|
|
63
|
+
onClickOutside: e => {
|
|
64
|
+
if (e.code === 'Escape') chevronRef.current.focus();
|
|
65
|
+
if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);
|
|
66
|
+
},
|
|
67
|
+
wrapperStyles: {
|
|
68
|
+
w: '100%',
|
|
69
|
+
h: '100%'
|
|
72
70
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})))
|
|
71
|
+
children: /*#__PURE__*/_jsx__default["default"](PillButton.DSPillButton, {
|
|
72
|
+
className: "ds-pill-focus-point",
|
|
73
|
+
"data-testid": "ds-pill-dropdown-chevron",
|
|
74
|
+
innerRef: utils.setMultipleRefs(chevronRef, innerRef),
|
|
75
|
+
"aria-label": ariaLabel || label,
|
|
76
|
+
type: "right",
|
|
77
|
+
onClick: onDropdownClick
|
|
78
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsIcons.ChevronSmallDown, {
|
|
79
|
+
color: ['brand-primary', '800'],
|
|
80
|
+
width: 20,
|
|
81
|
+
height: 20
|
|
82
|
+
}))
|
|
83
|
+
})));
|
|
86
84
|
});
|
|
87
|
-
|
|
88
|
-
|
|
85
|
+
|
|
86
|
+
exports.DropdownPill = DropdownPill;
|
|
@@ -1,84 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var import_ds_icons = __toESM(require("@elliemae/ds-icons"));
|
|
36
|
-
var import_styled = __toESM(require("../styled"));
|
|
37
|
-
var import_utils = __toESM(require("../../utils"));
|
|
38
|
-
var import_PillButton = __toESM(require("../PillButton"));
|
|
39
|
-
const InputPill = import_react.default.memo(({ label, size, inputPlaceholder, inputWidth, inputRender, onInputChange, onInputClear, innerRef }) => {
|
|
40
|
-
const ref = (0, import_react.useRef)(null);
|
|
41
|
-
const InputComponent = (0, import_react.useMemo)(() => inputRender, [inputRender]);
|
|
42
|
-
const pillUid = (0, import_react.useMemo)(() => `ds-pill-${(0, import_uid.uid)()}`, []);
|
|
43
|
-
const onCloseIconClick = (0, import_react.useCallback)((e) => {
|
|
44
|
-
if ([void 0, "Enter", "Space"].includes(e.code)) {
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var uid = require('uid');
|
|
9
|
+
var dsIcons = require('@elliemae/ds-icons');
|
|
10
|
+
var styled = require('../styled.js');
|
|
11
|
+
var utils = require('../../utils.js');
|
|
12
|
+
var PillButton = require('../PillButton.js');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
18
|
+
|
|
19
|
+
const InputPill = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
20
|
+
let {
|
|
21
|
+
label,
|
|
22
|
+
size,
|
|
23
|
+
inputPlaceholder,
|
|
24
|
+
inputWidth,
|
|
25
|
+
inputRender,
|
|
26
|
+
onInputChange,
|
|
27
|
+
onInputClear,
|
|
28
|
+
innerRef
|
|
29
|
+
} = _ref;
|
|
30
|
+
const ref = React.useRef(null);
|
|
31
|
+
const InputComponent = React.useMemo(() => inputRender, [inputRender]);
|
|
32
|
+
const pillUid = React.useMemo(() => "ds-pill-".concat(uid.uid()), []);
|
|
33
|
+
const onCloseIconClick = React.useCallback(e => {
|
|
34
|
+
if ([undefined, 'Enter', 'Space'].includes(e.code)) {
|
|
45
35
|
e.preventDefault();
|
|
46
36
|
onInputClear(e);
|
|
47
37
|
ref.current.focus();
|
|
48
38
|
}
|
|
49
39
|
}, [onInputClear]);
|
|
50
|
-
const [inputHasFocus, setInputHasFocus] =
|
|
51
|
-
return
|
|
52
|
-
size,
|
|
40
|
+
const [inputHasFocus, setInputHasFocus] = React.useState(false);
|
|
41
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledInputPillWrapper, {
|
|
42
|
+
size: size,
|
|
53
43
|
className: "ds-pill-wrapper",
|
|
54
44
|
"data-testid": "ds-pill-wrapper",
|
|
55
|
-
cols: label ===
|
|
56
|
-
inputWidth,
|
|
45
|
+
cols: label === '' ? ['auto'] : ['auto', '24px'],
|
|
46
|
+
inputWidth: inputWidth,
|
|
57
47
|
value: label,
|
|
58
|
-
inputHasFocus
|
|
59
|
-
},
|
|
48
|
+
inputHasFocus: inputHasFocus
|
|
49
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](InputComponent, {
|
|
60
50
|
id: pillUid,
|
|
61
51
|
className: "ds-pill-focus-point",
|
|
62
52
|
"data-testid": "ds-pill-input",
|
|
63
|
-
innerRef:
|
|
53
|
+
innerRef: utils.setMultipleRefs(ref, innerRef),
|
|
64
54
|
value: label,
|
|
65
55
|
onChange: onInputChange,
|
|
66
56
|
placeholder: inputPlaceholder,
|
|
67
57
|
onFocus: () => setInputHasFocus(true),
|
|
68
58
|
onBlur: () => setInputHasFocus(false),
|
|
69
59
|
disableTooltip: false
|
|
70
|
-
}), label !==
|
|
60
|
+
}), label !== '' && /*#__PURE__*/_jsx__default["default"](PillButton.DSPillButton, {
|
|
71
61
|
id: pillUid,
|
|
72
62
|
"data-testid": "ds-pill-clear-icon",
|
|
73
|
-
innerRef,
|
|
63
|
+
innerRef: innerRef,
|
|
74
64
|
onClick: onCloseIconClick,
|
|
75
65
|
onKeyDown: onCloseIconClick,
|
|
76
66
|
"aria-label": "Clear input",
|
|
77
67
|
type: "right"
|
|
78
|
-
},
|
|
68
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsIcons.CloseXsmall, {
|
|
79
69
|
size: "s",
|
|
80
|
-
color: [
|
|
70
|
+
color: ['brand-primary', '700']
|
|
81
71
|
})));
|
|
82
72
|
});
|
|
83
|
-
|
|
84
|
-
|
|
73
|
+
|
|
74
|
+
exports.InputPill = InputPill;
|