@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.
Files changed (133) hide show
  1. package/cjs/components/Pill.js +49 -56
  2. package/cjs/components/PillButton.js +52 -54
  3. package/cjs/components/PillGroup.js +53 -61
  4. package/cjs/components/index.js +17 -30
  5. package/cjs/components/styled.js +78 -228
  6. package/cjs/components/types/DropdownPill.js +77 -79
  7. package/cjs/components/types/InputPill.js +48 -58
  8. package/cjs/components/types/LabelPill.js +38 -44
  9. package/cjs/components/types/ReadOnlyPill.js +43 -48
  10. package/cjs/components/types/RemovablePill.js +53 -60
  11. package/cjs/components/types/ValuePill.js +43 -48
  12. package/cjs/components/types/index.js +19 -33
  13. package/cjs/deprecated/DropdownPill.js +101 -80
  14. package/cjs/deprecated/InputPill.js +69 -67
  15. package/cjs/deprecated/LabeledDropdownPills.js +96 -92
  16. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +94 -91
  17. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +114 -106
  18. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +127 -119
  19. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +15 -39
  20. package/cjs/deprecated/LabeledPills.js +52 -65
  21. package/cjs/deprecated/OverflowPill.js +53 -59
  22. package/cjs/deprecated/Pill.js +82 -67
  23. package/cjs/deprecated/PillGroup.js +68 -68
  24. package/cjs/deprecated/ReadOnlyPill.js +94 -93
  25. package/cjs/deprecated/RemovablePill.js +57 -61
  26. package/cjs/deprecated/index.js +33 -43
  27. package/cjs/index.d.js +2 -27
  28. package/cjs/index.js +43 -37
  29. package/cjs/props.js +46 -72
  30. package/cjs/utils.js +25 -43
  31. package/esm/components/Pill.js +31 -18
  32. package/esm/components/PillButton.js +39 -22
  33. package/esm/components/PillGroup.js +38 -28
  34. package/esm/components/index.js +3 -5
  35. package/esm/components/styled.js +66 -205
  36. package/esm/components/types/DropdownPill.js +67 -50
  37. package/esm/components/types/InputPill.js +35 -25
  38. package/esm/components/types/LabelPill.js +29 -15
  39. package/esm/components/types/ReadOnlyPill.js +34 -19
  40. package/esm/components/types/RemovablePill.js +44 -31
  41. package/esm/components/types/ValuePill.js +34 -19
  42. package/esm/components/types/index.js +6 -8
  43. package/esm/deprecated/DropdownPill.js +86 -49
  44. package/esm/deprecated/InputPill.js +59 -38
  45. package/esm/deprecated/LabeledDropdownPills.js +81 -59
  46. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +84 -60
  47. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +94 -65
  48. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +108 -79
  49. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +10 -9
  50. package/esm/deprecated/LabeledPills.js +41 -34
  51. package/esm/deprecated/OverflowPill.js +37 -25
  52. package/esm/deprecated/Pill.js +71 -39
  53. package/esm/deprecated/PillGroup.js +56 -39
  54. package/esm/deprecated/ReadOnlyPill.js +79 -60
  55. package/esm/deprecated/RemovablePill.js +45 -30
  56. package/esm/deprecated/index.js +8 -14
  57. package/esm/index.d.js +1 -2
  58. package/esm/index.js +11 -8
  59. package/esm/props.js +36 -42
  60. package/esm/utils.js +23 -16
  61. package/package.json +15 -15
  62. package/types/components/PillGroup.d.ts +1 -1
  63. package/types/deprecated/DropdownPill.d.ts +1 -10
  64. package/types/deprecated/LabeledDropdownPills.d.ts +1 -12
  65. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +1 -3
  66. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +1 -3
  67. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +0 -1
  68. package/types/deprecated/LabeledPills.d.ts +1 -8
  69. package/types/deprecated/OverflowPill.d.ts +1 -5
  70. package/types/deprecated/Pill.d.ts +1 -9
  71. package/types/deprecated/PillGroup.d.ts +1 -7
  72. package/types/deprecated/ReadOnlyPill.d.ts +1 -8
  73. package/types/deprecated/RemovablePill.d.ts +1 -7
  74. package/cjs/components/Pill.js.map +0 -7
  75. package/cjs/components/PillButton.js.map +0 -7
  76. package/cjs/components/PillGroup.js.map +0 -7
  77. package/cjs/components/index.js.map +0 -7
  78. package/cjs/components/styled.js.map +0 -7
  79. package/cjs/components/types/DropdownPill.js.map +0 -7
  80. package/cjs/components/types/InputPill.js.map +0 -7
  81. package/cjs/components/types/LabelPill.js.map +0 -7
  82. package/cjs/components/types/ReadOnlyPill.js.map +0 -7
  83. package/cjs/components/types/RemovablePill.js.map +0 -7
  84. package/cjs/components/types/ValuePill.js.map +0 -7
  85. package/cjs/components/types/index.js.map +0 -7
  86. package/cjs/deprecated/DropdownPill.js.map +0 -7
  87. package/cjs/deprecated/InputPill.js.map +0 -7
  88. package/cjs/deprecated/LabeledDropdownPills.js.map +0 -7
  89. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -7
  90. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -7
  91. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -7
  92. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -7
  93. package/cjs/deprecated/LabeledPills.js.map +0 -7
  94. package/cjs/deprecated/OverflowPill.js.map +0 -7
  95. package/cjs/deprecated/Pill.js.map +0 -7
  96. package/cjs/deprecated/PillGroup.js.map +0 -7
  97. package/cjs/deprecated/ReadOnlyPill.js.map +0 -7
  98. package/cjs/deprecated/RemovablePill.js.map +0 -7
  99. package/cjs/deprecated/index.js.map +0 -7
  100. package/cjs/index.d.js.map +0 -7
  101. package/cjs/index.js.map +0 -7
  102. package/cjs/props.js.map +0 -7
  103. package/cjs/utils.js.map +0 -7
  104. package/esm/components/Pill.js.map +0 -7
  105. package/esm/components/PillButton.js.map +0 -7
  106. package/esm/components/PillGroup.js.map +0 -7
  107. package/esm/components/index.js.map +0 -7
  108. package/esm/components/styled.js.map +0 -7
  109. package/esm/components/types/DropdownPill.js.map +0 -7
  110. package/esm/components/types/InputPill.js.map +0 -7
  111. package/esm/components/types/LabelPill.js.map +0 -7
  112. package/esm/components/types/ReadOnlyPill.js.map +0 -7
  113. package/esm/components/types/RemovablePill.js.map +0 -7
  114. package/esm/components/types/ValuePill.js.map +0 -7
  115. package/esm/components/types/index.js.map +0 -7
  116. package/esm/deprecated/DropdownPill.js.map +0 -7
  117. package/esm/deprecated/InputPill.js.map +0 -7
  118. package/esm/deprecated/LabeledDropdownPills.js.map +0 -7
  119. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +0 -7
  120. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +0 -7
  121. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +0 -7
  122. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +0 -7
  123. package/esm/deprecated/LabeledPills.js.map +0 -7
  124. package/esm/deprecated/OverflowPill.js.map +0 -7
  125. package/esm/deprecated/Pill.js.map +0 -7
  126. package/esm/deprecated/PillGroup.js.map +0 -7
  127. package/esm/deprecated/ReadOnlyPill.js.map +0 -7
  128. package/esm/deprecated/RemovablePill.js.map +0 -7
  129. package/esm/deprecated/index.js.map +0 -7
  130. package/esm/index.d.js.map +0 -7
  131. package/esm/index.js.map +0 -7
  132. package/esm/props.js.map +0 -7
  133. package/esm/utils.js.map +0 -7
@@ -1,5 +1,3 @@
1
- import * as React from "react";
2
- export * from "./Pill";
3
- export * from "./PillGroup";
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';
@@ -1,206 +1,67 @@
1
- import * as React from "react";
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
- const borderOutside = (color, size = 1, zIndex = 2, borderRadius = "12px") => css`
7
- :after {
8
- content: ' ';
9
- position: absolute;
10
- top: 0px;
11
- left: 0px;
12
- right: 0px;
13
- bottom: 0px;
14
- border: ${size}px solid ${color};
15
- border-top-left-radius: ${borderRadius};
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
- //# sourceMappingURL=styled.js.map
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 * as React from "react";
2
- import React2, { useMemo, useRef } from "react";
3
- import { DSDropdownMenuV2 } from "@elliemae/ds-dropdownmenu";
4
- import { uid } from "uid";
5
- import { ChevronSmallDown } from "@elliemae/ds-icons";
6
- import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
7
- import { StyledDropdownPillWrapper } from "../styled";
8
- import { setMultipleRefs } from "../../utils";
9
- import { DSPillButton } from "../PillButton";
10
- const DropdownPill = React2.memo(({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {
11
- const chevronRef = useRef(null);
12
- const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
13
- const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
14
- value: children
15
- }) : React2.Fragment;
16
- return /* @__PURE__ */ React2.createElement(StyledDropdownPillWrapper, {
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: ["auto", "24px"],
46
+ cols: ['auto', '24px'],
22
47
  gutter: "2px",
23
48
  alignItems: "center",
24
49
  justifyItems: "center"
25
- }, /* @__PURE__ */ React2.createElement(TextComponent, null, label), /* @__PURE__ */ React2.createElement(DSDropdownMenuV2, {
26
- placementOrderPreference: [
27
- "bottom-start",
28
- "bottom",
29
- "bottom-end",
30
- "right-end",
31
- "top-start",
32
- "top",
33
- "top-end"
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
- wrapperStyles: { w: "100%", h: "100%" }
43
- }, /* @__PURE__ */ React2.createElement(DSPillButton, {
44
- className: "ds-pill-focus-point",
45
- "data-testid": "ds-pill-dropdown-chevron",
46
- innerRef: setMultipleRefs(chevronRef, innerRef),
47
- "aria-label": ariaLabel || label,
48
- type: "right",
49
- onClick: onDropdownClick
50
- }, /* @__PURE__ */ React2.createElement(ChevronSmallDown, {
51
- color: ["brand-primary", "800"],
52
- width: 20,
53
- height: 20
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
- export {
57
- DropdownPill
58
- };
59
- //# sourceMappingURL=DropdownPill.js.map
75
+
76
+ export { DropdownPill };
@@ -1,31 +1,43 @@
1
- import * as React from "react";
2
- import React2, { useCallback, useMemo, useRef, useState } from "react";
3
- import { uid } from "uid";
4
- import { CloseXsmall } from "@elliemae/ds-icons";
5
- import { StyledInputPillWrapper } from "../styled";
6
- import { setMultipleRefs } from "../../utils";
7
- import { DSPillButton } from "../PillButton";
8
- const InputPill = React2.memo(({ label, size, inputPlaceholder, inputWidth, inputRender, onInputChange, onInputClear, innerRef }) => {
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(() => `ds-pill-${uid()}`, []);
12
- const onCloseIconClick = useCallback((e) => {
13
- if ([void 0, "Enter", "Space"].includes(e.code)) {
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 /* @__PURE__ */ React2.createElement(StyledInputPillWrapper, {
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 === "" ? ["auto"] : ["auto", "24px"],
25
- inputWidth,
36
+ cols: label === '' ? ['auto'] : ['auto', '24px'],
37
+ inputWidth: inputWidth,
26
38
  value: label,
27
- inputHasFocus
28
- }, /* @__PURE__ */ React2.createElement(InputComponent, {
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 !== "" && /* @__PURE__ */ React2.createElement(DSPillButton, {
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
- }, /* @__PURE__ */ React2.createElement(CloseXsmall, {
59
+ }, void 0, /*#__PURE__*/_jsx(CloseXsmall, {
48
60
  size: "s",
49
- color: ["brand-primary", "700"]
61
+ color: ['brand-primary', '700']
50
62
  })));
51
63
  });
52
- export {
53
- InputPill
54
- };
55
- //# sourceMappingURL=InputPill.js.map
64
+
65
+ export { InputPill };
@@ -1,23 +1,37 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
4
- import { StyledLabelPillWrapper } from "../styled";
5
- const LabelPill = React2.memo(({ label, size, labelTruncated, iconLeft, ariaLabel }) => {
6
- const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
7
- value: children
8
- }) : React2.Fragment;
9
- return /* @__PURE__ */ React2.createElement(StyledLabelPillWrapper, {
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 && "min-content", "auto"].filter((notFalse) => notFalse),
31
+ cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
16
32
  gutter: "xxxs",
17
33
  hasIcon: iconLeft !== null
18
- }, iconLeft, /* @__PURE__ */ React2.createElement(TextComponent, null, label));
34
+ }, void 0, iconLeft, /*#__PURE__*/_jsx(TextComponent, {}, void 0, label));
19
35
  });
20
- export {
21
- LabelPill
22
- };
23
- //# sourceMappingURL=LabelPill.js.map
36
+
37
+ export { LabelPill };
@@ -1,26 +1,41 @@
1
- import * as React from "react";
2
- import React2 from "react";
3
- import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
4
- import { StyledReadonlyPillWrapper } from "../styled";
5
- const ReadOnlyPill = React2.memo(({ label, size, labelTruncated, iconLeft, iconRight, ariaLabel }) => {
6
- const hasIconLeft = iconLeft !== null || iconRight !== null && label === "";
7
- const hasIconRight = iconRight !== null || iconLeft !== null && label === "";
8
- const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
9
- value: children
10
- }) : React2.Fragment;
11
- return /* @__PURE__ */ React2.createElement(StyledReadonlyPillWrapper, {
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 && "min-content", label && "auto", iconRight && "min-content"].filter((notFalse) => notFalse),
34
+ cols: [iconLeft && 'min-content', label && 'auto', iconRight && 'min-content'].filter(notFalse => notFalse),
18
35
  gutter: "xxxs",
19
- hasIconRight,
20
- hasIconLeft
21
- }, iconLeft, label ? /* @__PURE__ */ React2.createElement(TextComponent, null, label) : null, iconRight);
36
+ hasIconRight: hasIconRight,
37
+ hasIconLeft: hasIconLeft
38
+ }, void 0, iconLeft, label ? /*#__PURE__*/_jsx(TextComponent, {}, void 0, label) : null, iconRight);
22
39
  });
23
- export {
24
- ReadOnlyPill
25
- };
26
- //# sourceMappingURL=ReadOnlyPill.js.map
40
+
41
+ export { ReadOnlyPill };