@decisiv/ui-components 2.0.1-alpha.133 → 2.0.1-alpha.136
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/lib/atoms/OptionsList/Option.d.ts.map +1 -1
- package/lib/atoms/OptionsList/Option.js +16 -4
- package/lib/atoms/OptionsList/index.js +1 -1
- package/lib/atoms/OptionsList/index.test.js +38 -24
- package/lib/atoms/OptionsList/schema.d.ts.map +1 -1
- package/lib/atoms/OptionsList/schema.js +1 -0
- package/lib/atoms/OptionsList/types.d.ts +1 -0
- package/lib/atoms/OptionsList/types.d.ts.map +1 -1
- package/lib/components/Combobox/index.test.js +21 -21
- package/lib/components/Popover/index.d.ts.map +1 -1
- package/lib/components/Popover/index.js +6 -3
- package/lib/components/Popover/schema.d.ts.map +1 -1
- package/lib/components/Popover/schema.js +27 -20
- package/lib/components/Popover/types.d.ts +1 -0
- package/lib/components/Popover/types.d.ts.map +1 -1
- package/lib/components/Tooltip/index.d.ts.map +1 -1
- package/lib/components/Tooltip/index.js +3 -13
- package/lib/components/Tooltip/schema.d.ts +3 -0
- package/lib/components/Tooltip/schema.d.ts.map +1 -0
- package/lib/components/Tooltip/schema.js +29 -0
- package/lib/modifiers/spacingSchema.d.ts.map +1 -1
- package/lib/modifiers/spacingSchema.js +29 -16
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/Option.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,OAAO,EACL,WAAW,EAMZ,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"Option.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/Option.tsx"],"names":[],"mappings":"AAOA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAK/D,OAAO,EACL,WAAW,EAMZ,MAAM,SAAS,CAAC;AA8NjB,iBAAS,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,CAAC,OAAO,CAsH/C;;AAED,wBAAkC"}
|
|
@@ -60,7 +60,12 @@ var StyledLink = (0, _styledComponents.default)(_Link.default).withConfig({
|
|
|
60
60
|
var Container = _styledComponents.default.li.withConfig({
|
|
61
61
|
displayName: "Option__Container",
|
|
62
62
|
componentId: "sc-679ny4-1"
|
|
63
|
-
})(["
|
|
63
|
+
})(["text-align:left;&:focus{outline:none;}> .label,> ", "{align-items:center;border:1px solid transparent;color:", ";display:flex;padding:", ";pointer-events:none;width:100%;white-space:nowrap;", ";> *{margin-right:", ";}}> ", "{pointer-events:auto;background-color:transparent;text-decoration:none;}&:first-child > .label,&:first-child > ", "{border-top-left-radius:", ";border-top-right-radius:", ";}&:last-child > .label,&:last-child > ", "{border-bottom-left-radius:", ";border-bottom-right-radius:", ";}&:hover:not([aria-disabled='true']):not([aria-selected='true']) > .label,&:hover:not([aria-disabled='true']):not([aria-selected='true']) > ", "{color:", ";text-decoration:none;.label > *{border-color:", ";}}&[aria-selected='true'] > .label{background:", ";color:", ";}&[aria-selected='true'] > .label > div > #optionLabelDetails{background:", ";color:", ";}", ";", " &[aria-disabled='true']{cursor:not-allowed;", "{pointer-events:none;}}&[aria-disabled='true'] > .label,&[aria-disabled='true'] > ", "{background:", ";color:", ";}"], StyledLink, (0, _toColorString.default)(_color.default.interaction.pacificOcean), "".concat((0, _rem.default)(7), " ").concat((0, _rem.default)(20), " ").concat((0, _rem.default)(7), " ").concat((0, _rem.default)(10)), (0, _styleModifiers.when)('compact', (0, _styledComponents.css)(["padding:", ";"], "".concat((0, _rem.default)(5), " ").concat((0, _rem.default)(20), " ").concat((0, _rem.default)(5), " ").concat((0, _rem.default)(10)))), (0, _rem.default)(10), StyledLink, StyledLink, getBorderRadius, getBorderRadius, StyledLink, getBorderRadius, getBorderRadius, StyledLink, (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _toColorString.default)(_color.default.interaction.indianOcean), (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _toColorString.default)(_color.default.base.snowWhite), (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _toColorString.default)(_color.default.base.snowWhite), (0, _styleModifiers.when)('isActive', (0, _styledComponents.css)(["color:", ";background:", ";.label > *{border-color:", ";}"], (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _toColorString.default)(_color.default.interaction.pacificOcean15), (0, _toColorString.default)(_color.default.interaction.indianOcean))), (0, _styleModifiers.when)([['isActive'], ['inputMethod', 'keyboard']], (0, _styledComponents.css)(["background:none;> .label,> ", "{border-color:", ";", "}&[aria-selected='true'] > .label,&[aria-selected='true'] > ", "{color:", ";", "}"], StyledLink, (0, _toColorString.default)(_color.default.interaction.pacificOcean), (0, _focusRingWithColor.default)(_color.default.interaction.pacificOcean40), StyledLink, (0, _toColorString.default)(_color.default.base.snowWhite), (0, _focusRingWithColor.default)(_color.default.opacity.fullMoon50))), StyledLink, StyledLink, (0, _toColorString.default)(_color.default.base.snowWhite), (0, _toColorString.default)(_color.default.opacity.charcoal40));
|
|
64
|
+
|
|
65
|
+
var StyleLabelWrapper = _styledComponents.default.div.withConfig({
|
|
66
|
+
displayName: "Option__StyleLabelWrapper",
|
|
67
|
+
componentId: "sc-679ny4-2"
|
|
68
|
+
})(["display:flex;flex:1;flex-direction:column;"]); // This is used below to silence a React warning about
|
|
64
69
|
// having a controlled input without a change handler.
|
|
65
70
|
|
|
66
71
|
|
|
@@ -98,7 +103,7 @@ function DecorationComponent(props) {
|
|
|
98
103
|
|
|
99
104
|
var DecorationComponentContainer = _styledComponents.default.div.withConfig({
|
|
100
105
|
displayName: "Option__DecorationComponentContainer",
|
|
101
|
-
componentId: "sc-679ny4-
|
|
106
|
+
componentId: "sc-679ny4-3"
|
|
102
107
|
})(["", ";"], (0, _styleModifiers.when)('disabled', (0, _styledComponents.css)(["opacity:0.3;img{opacity:0.3;}"]))); // We always render the checkbox/radio inputs so that regular form
|
|
103
108
|
// submission (i.e. one not handled programmatically) still works.
|
|
104
109
|
|
|
@@ -109,6 +114,7 @@ function Option(props) {
|
|
|
109
114
|
decoration = props.decoration,
|
|
110
115
|
disabled = props.disabled,
|
|
111
116
|
borderRadius = props.borderRadius,
|
|
117
|
+
labelDetails = props.labelDetails,
|
|
112
118
|
_props$showCheckbox = props.showCheckbox,
|
|
113
119
|
showCheckbox = _props$showCheckbox === void 0 ? true : _props$showCheckbox;
|
|
114
120
|
var decorationType = (0, _get.default)(decoration, 'type');
|
|
@@ -183,13 +189,19 @@ function Option(props) {
|
|
|
183
189
|
}, _react.default.createElement(DecorationComponent, decoration)), renderOptionLabel ? renderOptionLabel({
|
|
184
190
|
id: id,
|
|
185
191
|
label: label,
|
|
192
|
+
labelDetails: labelDetails,
|
|
186
193
|
value: props.value,
|
|
187
194
|
disabled: disabled,
|
|
188
195
|
meta: props.meta
|
|
189
|
-
}) : _react.default.createElement(_Typography.P, {
|
|
196
|
+
}) : _react.default.createElement(StyleLabelWrapper, null, _react.default.createElement(_Typography.P, {
|
|
190
197
|
as: "span",
|
|
191
198
|
color: "inherit"
|
|
192
|
-
}, label)
|
|
199
|
+
}, label), labelDetails && _react.default.createElement(_Typography.P, {
|
|
200
|
+
as: "span",
|
|
201
|
+
shade: 1,
|
|
202
|
+
size: "small",
|
|
203
|
+
id: "optionLabelDetails"
|
|
204
|
+
}, labelDetails))));
|
|
193
205
|
}
|
|
194
206
|
|
|
195
207
|
var _default = _react.default.memo(Option);
|
|
@@ -233,7 +233,7 @@ function OptionsList(props, forwardedRef) {
|
|
|
233
233
|
}, [containerRef, activeId, inputMethod, previousActiveId]);
|
|
234
234
|
|
|
235
235
|
var setContainerRefFunc = function setContainerRefFunc(el) {
|
|
236
|
-
|
|
236
|
+
(0, _assignRef.default)(forwardedRef, el);
|
|
237
237
|
setContainerRef(el);
|
|
238
238
|
};
|
|
239
239
|
|
|
@@ -86,6 +86,14 @@ var items = [{
|
|
|
86
86
|
label: 'Option 5',
|
|
87
87
|
value: '5'
|
|
88
88
|
}]
|
|
89
|
+
}, {
|
|
90
|
+
label: 'WithDetailLabel',
|
|
91
|
+
items: [{
|
|
92
|
+
id: '6',
|
|
93
|
+
label: 'custom label here',
|
|
94
|
+
labelDetails: 'test detail label',
|
|
95
|
+
value: '6'
|
|
96
|
+
}]
|
|
89
97
|
}];
|
|
90
98
|
var defaultProps = {
|
|
91
99
|
items: items,
|
|
@@ -133,10 +141,16 @@ describe('OptionsList', function () {
|
|
|
133
141
|
}
|
|
134
142
|
});
|
|
135
143
|
});
|
|
136
|
-
it('
|
|
144
|
+
it('checks that labelDetails when provided ', function () {
|
|
137
145
|
var _render3 = render(_react.default.createElement(_.default, defaultProps)),
|
|
138
|
-
getByText = _render3.getByText
|
|
139
|
-
|
|
146
|
+
getByText = _render3.getByText;
|
|
147
|
+
|
|
148
|
+
expect(getByText('test detail label')).toBeInTheDocument();
|
|
149
|
+
});
|
|
150
|
+
it('navigates through the options with arrow keys', function () {
|
|
151
|
+
var _render4 = render(_react.default.createElement(_.default, defaultProps)),
|
|
152
|
+
getByText = _render4.getByText,
|
|
153
|
+
container = _render4.container;
|
|
140
154
|
|
|
141
155
|
var optionsList = container.querySelector('ul'); // simulate it is focused while tabbing
|
|
142
156
|
|
|
@@ -165,11 +179,11 @@ describe('OptionsList', function () {
|
|
|
165
179
|
it('selects an item with Enter or Space key', function () {
|
|
166
180
|
var onChange = jest.fn();
|
|
167
181
|
|
|
168
|
-
var
|
|
182
|
+
var _render5 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
169
183
|
onChange: onChange
|
|
170
184
|
}))),
|
|
171
|
-
getByLabelText =
|
|
172
|
-
container =
|
|
185
|
+
getByLabelText = _render5.getByLabelText,
|
|
186
|
+
container = _render5.container;
|
|
173
187
|
|
|
174
188
|
var selectedItem = defaultProps.items[1];
|
|
175
189
|
var optionsList = container.querySelector('ul'); // simulate it is focused while tabbing
|
|
@@ -206,12 +220,12 @@ describe('OptionsList', function () {
|
|
|
206
220
|
disabled: true
|
|
207
221
|
}];
|
|
208
222
|
|
|
209
|
-
var
|
|
223
|
+
var _render6 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
210
224
|
items: onlyDisabledItems,
|
|
211
225
|
onChange: onChange
|
|
212
226
|
}))),
|
|
213
|
-
getByLabelText =
|
|
214
|
-
container =
|
|
227
|
+
getByLabelText = _render6.getByLabelText,
|
|
228
|
+
container = _render6.container;
|
|
215
229
|
|
|
216
230
|
var optionsList = container.querySelector('ul'); // simulate it is focused while tabbing
|
|
217
231
|
|
|
@@ -238,11 +252,11 @@ describe('OptionsList', function () {
|
|
|
238
252
|
it('calls onChange with id when item is clicked', function () {
|
|
239
253
|
var onChange = jest.fn();
|
|
240
254
|
|
|
241
|
-
var
|
|
255
|
+
var _render7 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
242
256
|
onChange: onChange
|
|
243
257
|
}))),
|
|
244
|
-
getByText =
|
|
245
|
-
getByLabelText =
|
|
258
|
+
getByText = _render7.getByText,
|
|
259
|
+
getByLabelText = _render7.getByLabelText;
|
|
246
260
|
|
|
247
261
|
var item = items[0];
|
|
248
262
|
|
|
@@ -261,11 +275,11 @@ describe('OptionsList', function () {
|
|
|
261
275
|
it('does not calls onChange when item is clicked', function () {
|
|
262
276
|
var onChange = jest.fn();
|
|
263
277
|
|
|
264
|
-
var
|
|
278
|
+
var _render8 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
265
279
|
onChange: onChange
|
|
266
280
|
}))),
|
|
267
|
-
getByText =
|
|
268
|
-
getByLabelText =
|
|
281
|
+
getByText = _render8.getByText,
|
|
282
|
+
getByLabelText = _render8.getByLabelText;
|
|
269
283
|
|
|
270
284
|
_react2.fireEvent.click(getByText(disabledItemLabel));
|
|
271
285
|
|
|
@@ -279,11 +293,11 @@ describe('OptionsList', function () {
|
|
|
279
293
|
it('prefers value over internal', function () {
|
|
280
294
|
var selected = items[1];
|
|
281
295
|
|
|
282
|
-
var
|
|
296
|
+
var _render9 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
283
297
|
selected: selected.id
|
|
284
298
|
}))),
|
|
285
|
-
getByText =
|
|
286
|
-
getByLabelText =
|
|
299
|
+
getByText = _render9.getByText,
|
|
300
|
+
getByLabelText = _render9.getByLabelText;
|
|
287
301
|
|
|
288
302
|
var item = items[0];
|
|
289
303
|
|
|
@@ -298,12 +312,12 @@ describe('OptionsList', function () {
|
|
|
298
312
|
it('calls onChange with array of selected ids when item is clicked', function () {
|
|
299
313
|
var onChange = jest.fn();
|
|
300
314
|
|
|
301
|
-
var
|
|
315
|
+
var _render10 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
302
316
|
onChange: onChange,
|
|
303
317
|
multiple: true
|
|
304
318
|
}))),
|
|
305
|
-
getByText =
|
|
306
|
-
getByLabelText =
|
|
319
|
+
getByText = _render10.getByText,
|
|
320
|
+
getByLabelText = _render10.getByLabelText;
|
|
307
321
|
|
|
308
322
|
var item = items[0];
|
|
309
323
|
|
|
@@ -342,12 +356,12 @@ describe('OptionsList', function () {
|
|
|
342
356
|
onClick: onClick
|
|
343
357
|
}];
|
|
344
358
|
|
|
345
|
-
var
|
|
359
|
+
var _render11 = render(_react.default.createElement(_.default, _extends({}, defaultProps, {
|
|
346
360
|
actions: actions,
|
|
347
361
|
multiple: true
|
|
348
362
|
}))),
|
|
349
|
-
baseElement =
|
|
350
|
-
getByText =
|
|
363
|
+
baseElement = _render11.baseElement,
|
|
364
|
+
getByText = _render11.getByText;
|
|
351
365
|
|
|
352
366
|
actions.forEach(function (_ref5) {
|
|
353
367
|
var label = _ref5.text;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA2C,CAAC;AAuExD,eAAe,MAAM,CAAC"}
|
|
@@ -26,6 +26,7 @@ schema.makePropTypes = function () {
|
|
|
26
26
|
disabled: _reactDesc.PropTypes.bool,
|
|
27
27
|
id: _reactDesc.PropTypes.string,
|
|
28
28
|
label: _reactDesc.PropTypes.string.description('The label text for an option in the dropdown list.'),
|
|
29
|
+
labelDetails: _reactDesc.PropTypes.string.description('The secondary sub-text for an option in the dropdown list.'),
|
|
29
30
|
value: _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.number, _reactDesc.PropTypes.string]).description('The value for an option in the dropdown list.')
|
|
30
31
|
})).description('The array of item data that will be rendered').isRequired,
|
|
31
32
|
minWidth: _reactDesc.PropTypes.string.description('A CSS min-width value to apply'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/atoms/OptionsList/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,oBAAY,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC,CAAC;AAClE,oBAAY,gBAAgB,GAAG,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAEpE,oBAAY,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAAC;AAC3D,oBAAY,SAAS,GAAG,MA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M,CAAC;AAEjC,oBAAY,IAAI,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,gBAAiB,SAAQ,qBAAqB;IAC7D,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,CAAC,GAAG,EAAE,SAAS,KAAK,IAAI,CAAC;IACnC,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,GAAG,CAAC,OAAO,CAAC;IAChD,YAAY,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,oBAAY,uBAAuB,GAAG,gBAAgB,CAAC"}
|
|
@@ -143,7 +143,7 @@ describe('Combobox', function () {
|
|
|
143
143
|
// returns the <span>, but we need the `<li>`
|
|
144
144
|
|
|
145
145
|
|
|
146
|
-
var li = (0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement; // These two CSS values make an option look "active".
|
|
146
|
+
var li = (0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement.parentElement; // These two CSS values make an option look "active".
|
|
147
147
|
|
|
148
148
|
expect(li).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
149
149
|
});
|
|
@@ -593,7 +593,7 @@ describe('Combobox', function () {
|
|
|
593
593
|
|
|
594
594
|
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label)).toBeInTheDocument(); // The first element should be "active" by default if it's not disabled.
|
|
595
595
|
|
|
596
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n ")); // The focus should always remain on the input. The "active" item is kind of a fake.
|
|
596
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n ")); // The focus should always remain on the input. The "active" item is kind of a fake.
|
|
597
597
|
|
|
598
598
|
expect(queryByLabelText('test')).toHaveFocus();
|
|
599
599
|
|
|
@@ -602,8 +602,8 @@ describe('Combobox', function () {
|
|
|
602
602
|
keyCode: 40
|
|
603
603
|
});
|
|
604
604
|
|
|
605
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
606
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
605
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
606
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
607
607
|
expect(queryByLabelText('test')).toHaveFocus();
|
|
608
608
|
|
|
609
609
|
_react2.fireEvent.keyDown(queryByLabelText('test'), {
|
|
@@ -611,8 +611,8 @@ describe('Combobox', function () {
|
|
|
611
611
|
keyCode: 38
|
|
612
612
|
});
|
|
613
613
|
|
|
614
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
615
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
614
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
615
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
616
616
|
expect(queryByLabelText('test')).toHaveFocus();
|
|
617
617
|
expect(onChangeInputValue).not.toHaveBeenCalled();
|
|
618
618
|
expect(onChangeValue).not.toHaveBeenCalled();
|
|
@@ -660,7 +660,7 @@ describe('Combobox', function () {
|
|
|
660
660
|
|
|
661
661
|
expect((0, _react2.queryByText)(baseElement, enabledElements[0])).toBeInTheDocument(); // The first element should be "active" by default if it's not disabled.
|
|
662
662
|
|
|
663
|
-
expect((0, _react2.queryByText)(baseElement, enabledElements[0]).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n ")); // The focus should always remain on the input. The "active" item is kind of a fake.
|
|
663
|
+
expect((0, _react2.queryByText)(baseElement, enabledElements[0]).parentElement.parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n ")); // The focus should always remain on the input. The "active" item is kind of a fake.
|
|
664
664
|
|
|
665
665
|
expect(queryByLabelText('test')).toHaveFocus();
|
|
666
666
|
|
|
@@ -672,7 +672,7 @@ describe('Combobox', function () {
|
|
|
672
672
|
expect((0, _react2.queryByText)(baseElement, enabledElements[0]).parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n ")); // The next active element should be the next element in the list
|
|
673
673
|
// that is not marked as disabled
|
|
674
674
|
|
|
675
|
-
expect((0, _react2.queryByText)(baseElement, enabledElements[1]).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
675
|
+
expect((0, _react2.queryByText)(baseElement, enabledElements[1]).parentElement.parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
676
676
|
expect(queryByLabelText('test')).toHaveFocus();
|
|
677
677
|
|
|
678
678
|
_react2.fireEvent.keyDown(queryByLabelText('test'), {
|
|
@@ -683,7 +683,7 @@ describe('Combobox', function () {
|
|
|
683
683
|
expect((0, _react2.queryByText)(baseElement, enabledElements[1]).parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n ")); // The next active element should be the previous element in the list
|
|
684
684
|
// that is not marked as disabled
|
|
685
685
|
|
|
686
|
-
expect((0, _react2.queryByText)(baseElement, enabledElements[0]).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
686
|
+
expect((0, _react2.queryByText)(baseElement, enabledElements[0]).parentElement.parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean15), ";\n color: ").concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n "));
|
|
687
687
|
expect(queryByLabelText('test')).toHaveFocus();
|
|
688
688
|
expect(onChangeInputValue).not.toHaveBeenCalled();
|
|
689
689
|
expect(onChangeValue).not.toHaveBeenCalled();
|
|
@@ -854,7 +854,7 @@ describe('Combobox', function () {
|
|
|
854
854
|
_react2.fireEvent.click(queryByLabelText('test'));
|
|
855
855
|
|
|
856
856
|
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label)).toBeInTheDocument();
|
|
857
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
857
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
858
858
|
});
|
|
859
859
|
describe('when typing', function () {
|
|
860
860
|
it('does NOT update the selection automatically', function () {
|
|
@@ -887,7 +887,7 @@ describe('Combobox', function () {
|
|
|
887
887
|
});
|
|
888
888
|
|
|
889
889
|
expect(onChangeValue).toHaveBeenCalledTimes(1);
|
|
890
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
890
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
891
891
|
});
|
|
892
892
|
});
|
|
893
893
|
describe('when clicking the clear button', function () {
|
|
@@ -940,7 +940,7 @@ describe('Combobox', function () {
|
|
|
940
940
|
_react2.fireEvent.click(queryByLabelText('test'));
|
|
941
941
|
|
|
942
942
|
expect(queryByLabelText('test')).toHaveValue('value');
|
|
943
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
943
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
944
944
|
rerender(_react.default.createElement(_.default, {
|
|
945
945
|
label: "test",
|
|
946
946
|
options: defaultOptions,
|
|
@@ -950,15 +950,15 @@ describe('Combobox', function () {
|
|
|
950
950
|
onChangeValue: onChangeValue
|
|
951
951
|
}));
|
|
952
952
|
expect(queryByLabelText('test')).toHaveValue('value');
|
|
953
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
954
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
953
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
954
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
955
955
|
expect(onChangeInputValue).not.toHaveBeenCalled();
|
|
956
956
|
expect(onChangeValue).not.toHaveBeenCalled();
|
|
957
957
|
});
|
|
958
958
|
});
|
|
959
959
|
describe('when a controlled component', function () {
|
|
960
960
|
it('initializes with and prefers prop values', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
961
|
-
var newInputValue, onChangeInputValue, onChangeValue, _render32, baseElement, queryByLabelText, rerender;
|
|
961
|
+
var newInputValue, onChangeInputValue, onChangeValue, _render32, baseElement, queryByLabelText, rerender, container, getByRole, getAllByRole;
|
|
962
962
|
|
|
963
963
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
964
964
|
while (1) {
|
|
@@ -977,14 +977,14 @@ describe('Combobox', function () {
|
|
|
977
977
|
onChangeValue: onChangeValue,
|
|
978
978
|
autoComplete: "auto-complete-test",
|
|
979
979
|
type: "search"
|
|
980
|
-
})), baseElement = _render32.baseElement, queryByLabelText = _render32.queryByLabelText, rerender = _render32.rerender;
|
|
980
|
+
})), baseElement = _render32.baseElement, queryByLabelText = _render32.queryByLabelText, rerender = _render32.rerender, container = _render32.container, getByRole = _render32.getByRole, getAllByRole = _render32.getAllByRole;
|
|
981
981
|
|
|
982
982
|
_react2.fireEvent.click(queryByLabelText('test'));
|
|
983
983
|
|
|
984
984
|
expect(queryByLabelText('test')).toHaveValue('value');
|
|
985
985
|
expect(queryByLabelText('test')).toHaveAttribute('autoComplete', 'auto-complete-test');
|
|
986
986
|
expect(queryByLabelText('test')).toHaveAttribute('type', 'search');
|
|
987
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
987
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
988
988
|
rerender(_react.default.createElement(_.default, {
|
|
989
989
|
label: "test",
|
|
990
990
|
options: defaultOptions,
|
|
@@ -994,8 +994,8 @@ describe('Combobox', function () {
|
|
|
994
994
|
onChangeValue: onChangeValue
|
|
995
995
|
}));
|
|
996
996
|
expect(queryByLabelText('test')).toHaveValue('second value');
|
|
997
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
998
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
997
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
998
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
999
999
|
expect(onChangeInputValue).not.toHaveBeenCalled();
|
|
1000
1000
|
expect(onChangeValue).not.toHaveBeenCalled();
|
|
1001
1001
|
|
|
@@ -1019,8 +1019,8 @@ describe('Combobox', function () {
|
|
|
1019
1019
|
|
|
1020
1020
|
_react2.fireEvent.click(queryByLabelText('test'));
|
|
1021
1021
|
|
|
1022
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
1023
|
-
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
1022
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[0].label).parentElement.parentElement).toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
1023
|
+
expect((0, _react2.queryByText)(baseElement, defaultOptions[1].label).parentElement.parentElement).not.toHaveStyle("\n background: ".concat((0, _toColorString.default)(_color.default.interaction.pacificOcean), ";\n color: ").concat((0, _toColorString.default)(_color.default.base.snowWhite), ";\n "));
|
|
1024
1024
|
|
|
1025
1025
|
case 23:
|
|
1026
1026
|
case "end":
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAUN,MAAM,OAAO,CAAC;AAWf,OAAc,EAAE,WAAW,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,WAAW,IAAI,eAAe,EAE9B,SAAS,IAAI,aAAa,EAC1B,YAAY,IAAI,SAAS,EACzB,MAAM,IAAI,aAAa,EACvB,cAAc,IAAI,kBAAkB,EACpC,mBAAmB,IAAI,uBAAuB,EAE/C,MAAM,SAAS,CAAC;AAGjB,oBAAY,UAAU,GAAG,cAAc,CAAC;AACxC,oBAAY,WAAW,GAAG,eAAe,CAAC;AAC1C,oBAAY,WAAW,GAAG,eAAe,CAAC;AAC1C,oBAAY,SAAS,GAAG,aAAa,CAAC;AACtC,oBAAY,YAAY,GAAG,SAAS,CAAC;AACrC,oBAAY,MAAM,GAAG,aAAa,CAAC;AACnC,oBAAY,cAAc,GAAG,kBAAkB,CAAC;AAChD,oBAAY,mBAAmB,GAAG,uBAAuB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAUN,MAAM,OAAO,CAAC;AAWf,OAAc,EAAE,WAAW,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,SAAS,CAAC;AAE7E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,UAAU,IAAI,cAAc,EAC5B,WAAW,IAAI,eAAe,EAE9B,SAAS,IAAI,aAAa,EAC1B,YAAY,IAAI,SAAS,EACzB,MAAM,IAAI,aAAa,EACvB,cAAc,IAAI,kBAAkB,EACpC,mBAAmB,IAAI,uBAAuB,EAE/C,MAAM,SAAS,CAAC;AAGjB,oBAAY,UAAU,GAAG,cAAc,CAAC;AACxC,oBAAY,WAAW,GAAG,eAAe,CAAC;AAC1C,oBAAY,WAAW,GAAG,eAAe,CAAC;AAC1C,oBAAY,SAAS,GAAG,aAAa,CAAC;AACtC,oBAAY,YAAY,GAAG,SAAS,CAAC;AACrC,oBAAY,MAAM,GAAG,aAAa,CAAC;AACnC,oBAAY,cAAc,GAAG,kBAAkB,CAAC;AAChD,oBAAY,mBAAmB,GAAG,uBAAuB,CAAC;AAE1D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC;AA+PnC,QAAA,MAAM,cAAc,mFAAsB,CAAC;AAkD3C,eAAe,cAAc,CAAC"}
|
|
@@ -85,12 +85,13 @@ var modifiers = {
|
|
|
85
85
|
var Popover = function Popover(props, instanceRef) {
|
|
86
86
|
var alwaysRender = props.alwaysRender,
|
|
87
87
|
arrowColor = props.arrowColor,
|
|
88
|
+
borderRadius = props.borderRadius,
|
|
88
89
|
children = props.children,
|
|
89
90
|
containerSelector = props.containerSelector,
|
|
90
91
|
_props$contentRole = props.contentRole,
|
|
91
92
|
contentRole = _props$contentRole === void 0 ? 'dialog' : _props$contentRole,
|
|
92
93
|
defaultVisible = props.defaultVisible,
|
|
93
|
-
|
|
94
|
+
enabled = props.enabled,
|
|
94
95
|
_props$hideOnClickOut = props.hideOnClickOutside,
|
|
95
96
|
hideOnClickOutside = _props$hideOnClickOut === void 0 ? true : _props$hideOnClickOut,
|
|
96
97
|
_props$hideOnESC = props.hideOnESC,
|
|
@@ -106,7 +107,7 @@ var Popover = function Popover(props, instanceRef) {
|
|
|
106
107
|
target = props.target,
|
|
107
108
|
visible = props.visible,
|
|
108
109
|
zIndex = props.zIndex,
|
|
109
|
-
rest = _objectWithoutProperties(props, ["alwaysRender", "arrowColor", "children", "containerSelector", "contentRole", "defaultVisible", "
|
|
110
|
+
rest = _objectWithoutProperties(props, ["alwaysRender", "arrowColor", "borderRadius", "children", "containerSelector", "contentRole", "defaultVisible", "enabled", "hideOnClickOutside", "hideOnESC", "id", "manageEvents", "onHide", "onRequestHide", "onShow", "placement", "showArrow", "target", "visible", "zIndex"]);
|
|
110
111
|
|
|
111
112
|
var contentRef = (0, _react.useRef)(null);
|
|
112
113
|
var internalNodeRef = (0, _react.useRef)(null);
|
|
@@ -286,7 +287,7 @@ var Popover = function Popover(props, instanceRef) {
|
|
|
286
287
|
return target(data);
|
|
287
288
|
}), targetType === _types.TargetType.Element && (0, _react.cloneElement)(target, _objectSpread({
|
|
288
289
|
ref: internalNodeRef
|
|
289
|
-
}, ariaAttributes)), (alwaysRender || isVisible) && (containerSelector === 'parent' ?
|
|
290
|
+
}, ariaAttributes)), enabled && (alwaysRender || isVisible) && (containerSelector === 'parent' ?
|
|
290
291
|
/* istanbul ignore next */
|
|
291
292
|
popper : createPortal(popper, containerSelector)));
|
|
292
293
|
};
|
|
@@ -295,6 +296,7 @@ var PopoverWithRef = (0, _react.forwardRef)(Popover); // @ts-ignore
|
|
|
295
296
|
|
|
296
297
|
PopoverWithRef.propTypes = {
|
|
297
298
|
id: _propTypes.default.string,
|
|
299
|
+
enabled: _propTypes.default.bool,
|
|
298
300
|
onShow: _propTypes.default.func,
|
|
299
301
|
onHide: _propTypes.default.func,
|
|
300
302
|
target: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.element, _propTypes.default.shape({
|
|
@@ -319,6 +321,7 @@ PopoverWithRef.propTypes = {
|
|
|
319
321
|
};
|
|
320
322
|
PopoverWithRef.defaultProps = {
|
|
321
323
|
alwaysRender: false,
|
|
324
|
+
enabled: true,
|
|
322
325
|
showArrow: true,
|
|
323
326
|
placement: 'bottom'
|
|
324
327
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/schema.ts"],"names":[],"mappings":"AAGA,QAAA,MAAM,MAAM,KAA8C,CAAC;AAoG3D,eAAe,MAAM,CAAC"}
|
|
@@ -11,26 +11,33 @@ var _reactDesc = require("react-desc");
|
|
|
11
11
|
var schema = (0, _reactDesc.describe)({
|
|
12
12
|
displayName: 'ConfigProvider'
|
|
13
13
|
});
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
|
|
15
|
+
schema.makePropTypes = function () {
|
|
16
|
+
var component = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'popover';
|
|
17
|
+
return {
|
|
18
|
+
id: _reactDesc.PropTypes.string.description("A unique identifier for the ".concat(component, ". Auto generated if none provided.")),
|
|
19
|
+
ref: _reactDesc.PropTypes.string.description("A React Ref that will be set to the ".concat(component, " instance. See notes below.")),
|
|
20
|
+
target: _reactDesc.PropTypes.any.description("The element the ".concat(component, " will point to. See usage notes above.")).format('Element, Ref or function').isRequired,
|
|
21
|
+
children: _reactDesc.PropTypes.any.description("What should be rendered inside the ".concat(component, ". See notes below.")).format('React node or function').isRequired,
|
|
22
|
+
enabled: _reactDesc.PropTypes.bool.description("If `false` the ".concat(component, " will never be shown; only its target will be rendered.")),
|
|
23
|
+
placement: _reactDesc.PropTypes.string.description("The preferred side of the target the ".concat(component, " should attach to. See notes below.")).defaultValue('bottom'),
|
|
24
|
+
visible: _reactDesc.PropTypes.bool.description("Whether or not the ".concat(component, " should be visible. Setting this prop makes the ").concat(component, " a \"controlled\" component.")),
|
|
25
|
+
defaultVisible: _reactDesc.PropTypes.bool.description("Whether or not the ".concat(component, " should be visible when first rendered.")),
|
|
26
|
+
alwaysRender: _reactDesc.PropTypes.bool.description("If true, the ".concat(component, " window will be hidden instead of destroyed when closed. Useful if the ").concat(component, " window needs to maintain state.")),
|
|
27
|
+
showArrow: _reactDesc.PropTypes.bool.description('Whether or not to show an arrow pointing to the target.').defaultValue(true),
|
|
28
|
+
borderRadius: _reactDesc.PropTypes.string.description("Applies a custom border radius value to the ".concat(component, " content.")),
|
|
29
|
+
arrowColor: _reactDesc.PropTypes.string.description('The color of the arrow. See notes below.'),
|
|
30
|
+
manageEvents: _reactDesc.PropTypes.string.description('The type of events that should be automatically attached to the target. Only applied if `visible` is `undefined`.').format('click,hover,false'),
|
|
31
|
+
containerSelector: _reactDesc.PropTypes.string.description("A CSS selector to the element where the ".concat(component, "s should be rendered in, or \"parent\" to render the ").concat(component, " in-place.")).defaultValue('body'),
|
|
32
|
+
hideOnESC: _reactDesc.PropTypes.bool.description("Whether or not to close the ".concat(component, " when the user presses the \"Escape\" key. No effect when `visible` is not `undefined`.")).defaultValue('true'),
|
|
33
|
+
hideOnClickOutside: _reactDesc.PropTypes.bool.description("Whether or not to close the ".concat(component, " when the user clicks outside the ").concat(component, ". No effect when `visible` is not `undefined`.")).defaultValue('true'),
|
|
34
|
+
zIndex: _reactDesc.PropTypes.bool.description("The css `z-index` value to apply to the ".concat(component, " content wrapper. Is set to `auto` when not provided.")),
|
|
35
|
+
onShow: _reactDesc.PropTypes.func.description("A function called when the ".concat(component, " becomes visible. Only called if `visible` is `undefined`.")),
|
|
36
|
+
onHide: _reactDesc.PropTypes.func.description("A function called when the ".concat(component, " becomes hidden. Only called if `visible` is `undefined`.")),
|
|
37
|
+
onRequestHide: _reactDesc.PropTypes.func.description("A function called if `visible` is not `undefined` and when the user clicks outside the ".concat(component, " or presses the \"Escape\" key."))
|
|
38
|
+
};
|
|
34
39
|
};
|
|
40
|
+
|
|
41
|
+
schema.propTypes = schema.makePropTypes();
|
|
35
42
|
var _default = schema;
|
|
36
43
|
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/Popover/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,oBAAY,IAAI,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;AAEtC,oBAAY,SAAS,GAAG,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC;AAElD,oBAAY,IAAI,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AACvD,oBAAY,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AAExC,oBAAY,gBAAgB,GAAG,MAAM,IAAI,CAAC;AAE1C,MAAM,WAAW,iBAAiB;IAChC,CAAC,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC/B;AAED,MAAM,WAAW,WAAW;IAC1B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,gBAAgB,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAA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],"names":[],"mappings":"AAGA,OAAc,EAAO,sBAAsB,EAAc,MAAM,OAAO,CAAC;AAOvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/index.tsx"],"names":[],"mappings":"AAGA,OAAc,EAAO,sBAAsB,EAAc,MAAM,OAAO,CAAC;AAOvE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAK7D,OAAgB,EACd,UAAU,EACV,YAAY,EACZ,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI,UAAU,EAC1B,MAAM,YAAY,CAAC;AAGpB,oBAAY,WAAW,GAAG,UAAU,CAAC;AACrC,oBAAY,SAAS,GAAG,aAAa,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,QAAQ,EAAE,cAAc,CAAC;CAC1B;AAuCD,QAAA,MAAM,cAAc,EAAE,sBAAsB,CAC1C,WAAW,EACX,YAAY,CACS,CAAC;AAUxB,eAAe,cAAc,CAAC"}
|
|
@@ -11,12 +11,8 @@ Object.defineProperty(exports, "placements", {
|
|
|
11
11
|
});
|
|
12
12
|
exports.default = void 0;
|
|
13
13
|
|
|
14
|
-
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
15
|
-
|
|
16
14
|
var _rem = _interopRequireDefault(require("polished/lib/helpers/rem"));
|
|
17
15
|
|
|
18
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
19
|
-
|
|
20
16
|
var _react = _interopRequireWildcard(require("react"));
|
|
21
17
|
|
|
22
18
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
@@ -27,6 +23,8 @@ var _color = _interopRequireDefault(require("../../modifiers/color"));
|
|
|
27
23
|
|
|
28
24
|
var _useUniqueId = _interopRequireDefault(require("../../utils/useUniqueId"));
|
|
29
25
|
|
|
26
|
+
var _schema = _interopRequireDefault(require("./schema"));
|
|
27
|
+
|
|
30
28
|
var _Popover = _interopRequireWildcard(require("../Popover"));
|
|
31
29
|
|
|
32
30
|
var _Typography = require("../Typography");
|
|
@@ -35,12 +33,6 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
35
33
|
|
|
36
34
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
35
|
|
|
38
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
39
|
-
|
|
40
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
41
|
-
|
|
42
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
43
|
-
|
|
44
36
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
45
37
|
|
|
46
38
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
@@ -74,9 +66,7 @@ var Tooltip = function Tooltip(_ref, ref) {
|
|
|
74
66
|
|
|
75
67
|
var TooltipWithRef = (0, _react.forwardRef)(Tooltip); // @ts-ignore
|
|
76
68
|
|
|
77
|
-
TooltipWithRef.propTypes =
|
|
78
|
-
children: _propTypes.default.string.isRequired
|
|
79
|
-
}); // @ts-ignore
|
|
69
|
+
TooltipWithRef.propTypes = _schema.default.propTypes; // @ts-ignore
|
|
80
70
|
|
|
81
71
|
TooltipWithRef.defaultProps = _Popover.default.defaultProps;
|
|
82
72
|
TooltipWithRef.displayName = 'Tooltip';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/schema.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,MAAM,KAAuC,CAAC;AAapD,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactDesc = require("react-desc");
|
|
9
|
+
|
|
10
|
+
var _omit = _interopRequireDefault(require("lodash/omit"));
|
|
11
|
+
|
|
12
|
+
var _schema = _interopRequireDefault(require("../Popover/schema"));
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { keys.push.apply(keys, Object.getOwnPropertySymbols(object)); } if (enumerableOnly) keys = keys.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); return keys; }
|
|
17
|
+
|
|
18
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
19
|
+
|
|
20
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21
|
+
|
|
22
|
+
var schema = (0, _reactDesc.describe)({
|
|
23
|
+
displayName: 'Tooltip'
|
|
24
|
+
});
|
|
25
|
+
schema.propTypes = _objectSpread({}, (0, _omit.default)(_schema.default.makePropTypes('tooltip'), ['children', 'arrowColor', 'hideOnClickOutside']), {
|
|
26
|
+
children: _reactDesc.PropTypes.string.description('The text to be displayed inside the tooltip.').isRequired
|
|
27
|
+
});
|
|
28
|
+
var _default = schema;
|
|
29
|
+
exports.default = _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spacingSchema.d.ts","sourceRoot":"","sources":["../../src/modifiers/spacingSchema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"spacingSchema.d.ts","sourceRoot":"","sources":["../../src/modifiers/spacingSchema.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,0BAA0B,cA2CrC,CAAC"}
|
|
@@ -7,24 +7,37 @@ exports.makeSpacingSchemaPropTypes = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _reactDesc = require("react-desc");
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
var _breakpointObserver = require("@decisiv/breakpoint-observer");
|
|
11
|
+
|
|
12
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
|
|
14
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
+
|
|
16
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
17
|
+
|
|
18
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
19
|
+
|
|
20
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
21
|
+
|
|
22
|
+
var numberOrDynamicModifierProp = _reactDesc.PropTypes.oneOfType([_reactDesc.PropTypes.number, _reactDesc.PropTypes.shape(_defineProperty({}, _reactDesc.PropTypes.oneOf(['_'].concat(_toConsumableArray(Object.keys(_breakpointObserver.sizes)))), _reactDesc.PropTypes.number))]); // eslint-disable-next-line import/prefer-default-export
|
|
23
|
+
|
|
24
|
+
|
|
12
25
|
var makeSpacingSchemaPropTypes = function makeSpacingSchemaPropTypes() {
|
|
13
26
|
return {
|
|
14
|
-
margin:
|
|
15
|
-
marginBottom:
|
|
16
|
-
marginLeft:
|
|
17
|
-
marginRight:
|
|
18
|
-
marginTop:
|
|
19
|
-
marginX:
|
|
20
|
-
marginY:
|
|
21
|
-
padding:
|
|
22
|
-
paddingBottom:
|
|
23
|
-
paddingLeft:
|
|
24
|
-
paddingRight:
|
|
25
|
-
paddingTop:
|
|
26
|
-
paddingX:
|
|
27
|
-
paddingY:
|
|
27
|
+
margin: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on all axis margin.'),
|
|
28
|
+
marginBottom: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the bottom margin.'),
|
|
29
|
+
marginLeft: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the left margin.'),
|
|
30
|
+
marginRight: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the right margin.'),
|
|
31
|
+
marginTop: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the top margin.'),
|
|
32
|
+
marginX: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the X axis margin.'),
|
|
33
|
+
marginY: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the Y axis margin.'),
|
|
34
|
+
padding: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on all axis padding.'),
|
|
35
|
+
paddingBottom: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the bottom padding.'),
|
|
36
|
+
paddingLeft: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the left padding.'),
|
|
37
|
+
paddingRight: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the right padding.'),
|
|
38
|
+
paddingTop: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the top padding.'),
|
|
39
|
+
paddingX: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the X axis padding.'),
|
|
40
|
+
paddingY: numberOrDynamicModifierProp.description('Defines the spacing multiplier for use on the Y axis padding.')
|
|
28
41
|
};
|
|
29
42
|
};
|
|
30
43
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decisiv/ui-components",
|
|
3
|
-
"version": "2.0.1-alpha.
|
|
3
|
+
"version": "2.0.1-alpha.136+17bda20",
|
|
4
4
|
"description": "Decisiv's design system React components",
|
|
5
5
|
"author": "Decisiv UI Development Team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"access": "public"
|
|
72
72
|
},
|
|
73
73
|
"private": false,
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "17bda201ae815de284a963a08b609936e11544dc"
|
|
75
75
|
}
|