@elliemae/ds-pills 2.0.0-alpha.1 → 2.0.0-alpha.10
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 +48 -0
- package/cjs/components/PillButton.js +51 -0
- package/cjs/components/PillGroup.js +50 -0
- package/cjs/components/index.js +17 -0
- package/cjs/components/styled.js +69 -0
- package/cjs/components/types/DropdownPill.js +66 -0
- package/cjs/components/types/InputPill.js +71 -0
- package/cjs/components/types/LabelPill.js +31 -0
- package/cjs/components/types/ReadOnlyPill.js +37 -0
- package/cjs/components/types/RemovablePill.js +62 -0
- package/cjs/components/types/ValuePill.js +39 -0
- package/cjs/components/types/index.js +19 -0
- package/cjs/{DropdownPill.js → deprecated/DropdownPill.js} +9 -9
- package/cjs/{InputPill.js → deprecated/InputPill.js} +9 -9
- package/cjs/{LabeledDropdownPills.js → deprecated/LabeledDropdownPills.js} +3 -3
- package/cjs/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownCascadeMenuPill.js +7 -7
- package/cjs/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownMultiPill.js +15 -15
- package/cjs/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownSinglePill.js +13 -13
- package/cjs/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/utils.js +0 -0
- package/cjs/{LabeledPills.js → deprecated/LabeledPills.js} +2 -2
- package/cjs/{OverflowPill.js → deprecated/OverflowPill.js} +8 -8
- package/cjs/{Pill.js → deprecated/Pill.js} +4 -4
- package/cjs/{PillGroup.js → deprecated/PillGroup.js} +2 -2
- package/cjs/{ReadOnlyPill.js → deprecated/ReadOnlyPill.js} +8 -8
- package/cjs/{RemovablePill.js → deprecated/RemovablePill.js} +7 -7
- package/cjs/deprecated/index.js +32 -0
- package/cjs/index.d.js +2 -0
- package/cjs/index.js +19 -9
- package/cjs/props.js +57 -0
- package/cjs/utils.js +18 -0
- package/esm/components/Pill.js +39 -0
- package/esm/components/PillButton.js +41 -0
- package/esm/components/PillGroup.js +39 -0
- package/esm/components/index.js +3 -0
- package/esm/components/styled.js +52 -0
- package/esm/components/types/DropdownPill.js +54 -0
- package/esm/components/types/InputPill.js +61 -0
- package/esm/components/types/LabelPill.js +22 -0
- package/esm/components/types/ReadOnlyPill.js +28 -0
- package/esm/components/types/RemovablePill.js +52 -0
- package/esm/components/types/ValuePill.js +30 -0
- package/esm/components/types/index.js +6 -0
- package/esm/{DropdownPill.js → deprecated/DropdownPill.js} +0 -0
- package/esm/{InputPill.js → deprecated/InputPill.js} +2 -2
- package/esm/{LabeledDropdownPills.js → deprecated/LabeledDropdownPills.js} +0 -0
- package/esm/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownCascadeMenuPill.js +0 -0
- package/esm/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownMultiPill.js +0 -0
- package/esm/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownSinglePill.js +0 -0
- package/esm/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/utils.js +0 -0
- package/esm/{LabeledPills.js → deprecated/LabeledPills.js} +0 -0
- package/esm/{OverflowPill.js → deprecated/OverflowPill.js} +0 -0
- package/esm/{Pill.js → deprecated/Pill.js} +0 -0
- package/esm/{PillGroup.js → deprecated/PillGroup.js} +0 -0
- package/esm/{ReadOnlyPill.js → deprecated/ReadOnlyPill.js} +0 -0
- package/esm/{RemovablePill.js → deprecated/RemovablePill.js} +2 -2
- package/esm/deprecated/index.js +8 -0
- package/esm/index.d.js +1 -0
- package/esm/index.js +11 -8
- package/esm/props.js +46 -0
- package/esm/utils.js +14 -0
- package/package.json +108 -48
- package/types/components/Pill.d.ts +5 -0
- package/types/components/PillButton.d.ts +5 -0
- package/types/components/PillGroup.d.ts +7 -0
- package/types/components/index.d.ts +3 -0
- package/types/components/styled.d.ts +40 -0
- package/types/components/types/DropdownPill.d.ts +3 -0
- package/types/components/types/InputPill.d.ts +3 -0
- package/types/components/types/LabelPill.d.ts +3 -0
- package/types/components/types/ReadOnlyPill.d.ts +3 -0
- package/types/components/types/RemovablePill.d.ts +3 -0
- package/types/components/types/ValuePill.d.ts +3 -0
- package/types/components/types/index.d.ts +6 -0
- package/types/{DropdownPill.d.ts → deprecated/DropdownPill.d.ts} +0 -0
- package/types/{InputPill.d.ts → deprecated/InputPill.d.ts} +0 -0
- package/types/{LabeledDropdownPills.d.ts → deprecated/LabeledDropdownPills.d.ts} +0 -0
- package/types/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownCascadeMenuPill.d.ts +0 -0
- package/types/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownMultiPill.d.ts +0 -0
- package/types/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/LabeledDropdownSinglePill.d.ts +0 -0
- package/types/{LabeledDropdownPillsTypes → deprecated/LabeledDropdownPillsTypes}/utils.d.ts +0 -0
- package/types/{LabeledPills.d.ts → deprecated/LabeledPills.d.ts} +0 -0
- package/types/{OverflowPill.d.ts → deprecated/OverflowPill.d.ts} +0 -0
- package/types/{Pill.d.ts → deprecated/Pill.d.ts} +0 -0
- package/types/{PillGroup.d.ts → deprecated/PillGroup.d.ts} +0 -0
- package/types/{ReadOnlyPill.d.ts → deprecated/ReadOnlyPill.d.ts} +0 -0
- package/types/{RemovablePill.d.ts → deprecated/RemovablePill.d.ts} +0 -0
- package/types/deprecated/index.d.ts +8 -0
- package/types/index.d.ts +3 -9
- package/types/props.d.ts +39 -0
- package/types/tests/DSPill.test.d.ts +1 -0
- package/types/tests/DSPillGroup.test.d.ts +1 -0
- package/types/tests/events/DSPill.events.keyboard.test.d.ts +1 -0
- package/types/tests/events/DSPill.events.test.d.ts +1 -0
- package/types/tests/events/DSPillGroup.events.keyboard.test.d.ts +1 -0
- package/types/tests/events/DSPillGroup.events.test.d.ts +1 -0
- package/types/utils.d.ts +4 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
require('react');
|
|
7
|
+
var reactDesc = require('react-desc');
|
|
8
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
9
|
+
var props = require('../props.js');
|
|
10
|
+
var DropdownPill = require('./types/DropdownPill.js');
|
|
11
|
+
var InputPill = require('./types/InputPill.js');
|
|
12
|
+
var LabelPill = require('./types/LabelPill.js');
|
|
13
|
+
var ReadOnlyPill = require('./types/ReadOnlyPill.js');
|
|
14
|
+
var RemovablePill = require('./types/RemovablePill.js');
|
|
15
|
+
var ValuePill = require('./types/ValuePill.js');
|
|
16
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
17
|
+
|
|
18
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
19
|
+
|
|
20
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
21
|
+
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
25
|
+
const pillComponentGetter = {
|
|
26
|
+
dropdown: DropdownPill.DropdownPill,
|
|
27
|
+
input: InputPill.InputPill,
|
|
28
|
+
label: LabelPill.LabelPill,
|
|
29
|
+
readonly: ReadOnlyPill.ReadOnlyPill,
|
|
30
|
+
removable: RemovablePill.RemovablePill,
|
|
31
|
+
value: ValuePill.ValuePill
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const DSPillV2 = props$1 => {
|
|
35
|
+
const propsWithDefaults = dsPropsHelpers.useMemoMergePropsWithDefault(props$1, props.DSPillV2DefaultProps);
|
|
36
|
+
dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefaults, DSPillV2WithSchema.toTypescript());
|
|
37
|
+
const {
|
|
38
|
+
type
|
|
39
|
+
} = propsWithDefaults;
|
|
40
|
+
const PillComponent = pillComponentGetter[type];
|
|
41
|
+
return /*#__PURE__*/jsxRuntime.jsx(PillComponent, _objectSpread({}, propsWithDefaults));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const DSPillV2WithSchema = reactDesc.describe(DSPillV2).description('Pill');
|
|
45
|
+
DSPillV2WithSchema.propTypes = props.DSPillV2PropTypes;
|
|
46
|
+
|
|
47
|
+
exports.DSPillV2 = DSPillV2;
|
|
48
|
+
exports.DSPillV2WithSchema = DSPillV2WithSchema;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
7
|
+
require('react');
|
|
8
|
+
var reactDesc = require('react-desc');
|
|
9
|
+
var dsPropsHelpers = require('@elliemae/ds-props-helpers');
|
|
10
|
+
var styled = require('./styled.js');
|
|
11
|
+
var props = require('../props.js');
|
|
12
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
13
|
+
|
|
14
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
15
|
+
|
|
16
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
17
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
18
|
+
|
|
19
|
+
const _excluded = ["type", "children"];
|
|
20
|
+
|
|
21
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
+
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
24
|
+
const typeToClassName = {
|
|
25
|
+
only: 'ds-pill-button-only',
|
|
26
|
+
left: 'ds-pill-button-left',
|
|
27
|
+
right: 'ds-pill-button-right'
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const DSPillButton = props$1 => {
|
|
31
|
+
const propsWithDefaults = dsPropsHelpers.useMemoMergePropsWithDefault(props$1, props.DSPillButtonDefaultProps);
|
|
32
|
+
dsPropsHelpers.useValidateTypescriptPropTypes(propsWithDefaults, DSPillButtonWithSchema.toTypescript());
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
type,
|
|
36
|
+
children
|
|
37
|
+
} = propsWithDefaults,
|
|
38
|
+
rest = _objectWithoutProperties__default["default"](propsWithDefaults, _excluded);
|
|
39
|
+
|
|
40
|
+
return /*#__PURE__*/jsxRuntime.jsx(styled.StyledPillButton, _objectSpread(_objectSpread({}, rest), {}, {
|
|
41
|
+
buttonType: "raw",
|
|
42
|
+
className: `${typeToClassName[type]} ${rest.className}`,
|
|
43
|
+
children: children
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const DSPillButtonWithSchema = reactDesc.describe(DSPillButton).description('Pill button');
|
|
48
|
+
DSPillButtonWithSchema.propTypes = props.DSPillButtonPropTypes;
|
|
49
|
+
|
|
50
|
+
exports.DSPillButton = DSPillButton;
|
|
51
|
+
exports.DSPillButtonWithSchema = DSPillButtonWithSchema;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactDesc = require('react-desc');
|
|
8
|
+
var uid = require('uid');
|
|
9
|
+
var styled = require('./styled.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
|
|
16
|
+
const DSPillGroupV2Context = /*#__PURE__*/React.createContext({
|
|
17
|
+
onKeyboardRemove: () => null
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const DSPillGroupV2 = ({
|
|
21
|
+
children
|
|
22
|
+
}) => {
|
|
23
|
+
const pillGroupUid = React.useMemo(() => `ds-pill-group-${uid.uid()}`, []);
|
|
24
|
+
const onKeyboardRemove = React.useCallback(pillUid => {
|
|
25
|
+
const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)];
|
|
26
|
+
const pillIndex = elems.findIndex(elem => elem.id === pillUid);
|
|
27
|
+
|
|
28
|
+
if (pillIndex > 0) {
|
|
29
|
+
elems[pillIndex - 1].focus();
|
|
30
|
+
} else if (pillIndex + 1 < elems.length) {
|
|
31
|
+
elems[pillIndex + 1].focus();
|
|
32
|
+
}
|
|
33
|
+
}, [pillGroupUid]);
|
|
34
|
+
return /*#__PURE__*/_jsx__default["default"](DSPillGroupV2Context.Provider, {
|
|
35
|
+
value: {
|
|
36
|
+
onKeyboardRemove
|
|
37
|
+
}
|
|
38
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyledPillGroup, {
|
|
39
|
+
id: pillGroupUid,
|
|
40
|
+
cols: React__default["default"].Children.map(children, () => 'auto'),
|
|
41
|
+
gutter: "2px"
|
|
42
|
+
}, void 0, children));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const DSPillGroupV2WithSchema = reactDesc.describe(DSPillGroupV2);
|
|
46
|
+
DSPillGroupV2WithSchema.propTypes = {};
|
|
47
|
+
|
|
48
|
+
exports.DSPillGroupV2 = DSPillGroupV2;
|
|
49
|
+
exports.DSPillGroupV2Context = DSPillGroupV2Context;
|
|
50
|
+
exports.DSPillGroupV2WithSchema = DSPillGroupV2WithSchema;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var Pill = require('./Pill.js');
|
|
6
|
+
var PillGroup = require('./PillGroup.js');
|
|
7
|
+
var PillButton = require('./PillButton.js');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.DSPillV2 = Pill.DSPillV2;
|
|
12
|
+
exports.DSPillV2WithSchema = Pill.DSPillV2WithSchema;
|
|
13
|
+
exports.DSPillGroupV2 = PillGroup.DSPillGroupV2;
|
|
14
|
+
exports.DSPillGroupV2Context = PillGroup.DSPillGroupV2Context;
|
|
15
|
+
exports.DSPillGroupV2WithSchema = PillGroup.DSPillGroupV2WithSchema;
|
|
16
|
+
exports.DSPillButton = PillButton.DSPillButton;
|
|
17
|
+
exports.DSPillButtonWithSchema = PillButton.DSPillButtonWithSchema;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var styled = require('styled-components');
|
|
6
|
+
var Grid = require('@elliemae/ds-grid');
|
|
7
|
+
var dsButton = require('@elliemae/ds-button');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
12
|
+
var Grid__default = /*#__PURE__*/_interopDefaultLegacy(Grid);
|
|
13
|
+
|
|
14
|
+
/* eslint-disable max-lines */
|
|
15
|
+
// Common CSS
|
|
16
|
+
// =============================================================================
|
|
17
|
+
|
|
18
|
+
const borderOutside = (color, size = 1, zIndex = 2, borderRadius = '12px') => styled.css([":after{content:' ';position:absolute;top:0px;left:0px;right:0px;bottom:0px;border:", "px solid ", ";border-top-left-radius:", ";border-top-right-radius:", ";border-bottom-left-radius:", ";border-bottom-right-radius:", ";pointer-events:none;z-index:", ";}"], size, color, borderRadius, borderRadius, borderRadius, borderRadius, zIndex);
|
|
19
|
+
|
|
20
|
+
const commonPillWrapperCss = /*#__PURE__*/styled.css(["height:24px;position:relative;width:fit-content;background-color:", ";outline:none;padding:0px 12px 0 12px;border-radius:12px;font-size:13px;line-height:1;color:", ";", ";"], props => props.theme.colors.brand[200], props => props.theme.colors.brand[800], props => borderOutside(props.theme.colors.brand[300])); // =============================================================================
|
|
21
|
+
// Pills wrappers
|
|
22
|
+
// =============================================================================
|
|
23
|
+
|
|
24
|
+
const StyledLabelPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
25
|
+
componentId: "sc-j0tlch-0"
|
|
26
|
+
})(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIcon ? '0px !important' : '12px');
|
|
27
|
+
const StyledValuePillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
28
|
+
componentId: "sc-j0tlch-1"
|
|
29
|
+
})(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.regular, props => props.hasIcon ? '0px !important' : '12px');
|
|
30
|
+
const StyledInputPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
31
|
+
componentId: "sc-j0tlch-2"
|
|
32
|
+
})(["", " 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'], ({
|
|
33
|
+
value,
|
|
34
|
+
theme
|
|
35
|
+
}) => borderOutside(value === '' ? theme.colors.neutral[400] : theme.colors.brand[500]), props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '', props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '', props => `${props.inputWidth + (props.value === '' ? 24 : 0)}px`);
|
|
36
|
+
const StyledDropdownPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
37
|
+
componentId: "sc-j0tlch-3"
|
|
38
|
+
})(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.semibold);
|
|
39
|
+
const StyledReadonlyPillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
40
|
+
componentId: "sc-j0tlch-4"
|
|
41
|
+
})(["", " font-weight:", ";padding-right:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIconRight ? '0 !important' : '12px', props => props.hasIconLeft ? '0 !important' : '12px');
|
|
42
|
+
const StyledRemovablePillWrapper = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
43
|
+
componentId: "sc-j0tlch-5"
|
|
44
|
+
})(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.regular); // =============================================================================
|
|
45
|
+
// Pill group
|
|
46
|
+
// =============================================================================
|
|
47
|
+
|
|
48
|
+
const StyledPillGroup = /*#__PURE__*/styled__default["default"](Grid__default["default"]).withConfig({
|
|
49
|
+
componentId: "sc-j0tlch-6"
|
|
50
|
+
})(["width:fit-content;& .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;}}}"]); // =============================================================================
|
|
51
|
+
// Extra stuff
|
|
52
|
+
// =============================================================================
|
|
53
|
+
|
|
54
|
+
const StyledSpanWithTooltip = /*#__PURE__*/styled__default["default"].span.withConfig({
|
|
55
|
+
componentId: "sc-j0tlch-7"
|
|
56
|
+
})(["outline:none;:focus{", "}"], props => borderOutside(props.theme.colors.brand[700], 2, 3));
|
|
57
|
+
const StyledPillButton = /*#__PURE__*/styled__default["default"](dsButton.DSButtonV2).withConfig({
|
|
58
|
+
componentId: "sc-j0tlch-8"
|
|
59
|
+
})(["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'));
|
|
60
|
+
|
|
61
|
+
exports.StyledDropdownPillWrapper = StyledDropdownPillWrapper;
|
|
62
|
+
exports.StyledInputPillWrapper = StyledInputPillWrapper;
|
|
63
|
+
exports.StyledLabelPillWrapper = StyledLabelPillWrapper;
|
|
64
|
+
exports.StyledPillButton = StyledPillButton;
|
|
65
|
+
exports.StyledPillGroup = StyledPillGroup;
|
|
66
|
+
exports.StyledReadonlyPillWrapper = StyledReadonlyPillWrapper;
|
|
67
|
+
exports.StyledRemovablePillWrapper = StyledRemovablePillWrapper;
|
|
68
|
+
exports.StyledSpanWithTooltip = StyledSpanWithTooltip;
|
|
69
|
+
exports.StyledValuePillWrapper = StyledValuePillWrapper;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
9
|
+
var uid = require('uid');
|
|
10
|
+
var ChevronDown = require('@elliemae/ds-icons/ChevronSmallDown');
|
|
11
|
+
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
12
|
+
var styled = require('../styled.js');
|
|
13
|
+
var utils = require('../../utils.js');
|
|
14
|
+
var PillButton = require('../PillButton.js');
|
|
15
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
18
|
+
|
|
19
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
20
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
21
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
22
|
+
var DSDropdownMenu__default = /*#__PURE__*/_interopDefaultLegacy(DSDropdownMenu);
|
|
23
|
+
var ChevronDown__default = /*#__PURE__*/_interopDefaultLegacy(ChevronDown);
|
|
24
|
+
|
|
25
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
26
|
+
|
|
27
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
28
|
+
const DropdownPill = /*#__PURE__*/React__default["default"].memo(({
|
|
29
|
+
label,
|
|
30
|
+
dropdownProps,
|
|
31
|
+
innerRef,
|
|
32
|
+
ariaLabel
|
|
33
|
+
}) => {
|
|
34
|
+
const chevronRef = React.useRef(null);
|
|
35
|
+
const pillUid = React.useMemo(() => `ds-pill-${uid.uid()}`, []);
|
|
36
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledDropdownPillWrapper, {
|
|
37
|
+
id: pillUid,
|
|
38
|
+
className: "ds-pill-wrapper ds-pill-wrapper-dropdown",
|
|
39
|
+
"data-testid": "ds-pill-wrapper",
|
|
40
|
+
cols: ['auto', '24px'],
|
|
41
|
+
gutter: "2px",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
justifyItems: "center"
|
|
44
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsTruncatedTooltipText.SimpleTruncatedTooltipText, {
|
|
45
|
+
value: label
|
|
46
|
+
}), /*#__PURE__*/jsxRuntime.jsx(DSDropdownMenu__default["default"], _objectSpread(_objectSpread({
|
|
47
|
+
hideIfNotVisible: true,
|
|
48
|
+
onClose: () => chevronRef.current.focus(),
|
|
49
|
+
menuProps: {
|
|
50
|
+
zIndex: 100
|
|
51
|
+
}
|
|
52
|
+
}, dropdownProps), {}, {
|
|
53
|
+
triggerComponent: /*#__PURE__*/_jsx__default["default"](PillButton.DSPillButton, {
|
|
54
|
+
className: "ds-pill-focus-point",
|
|
55
|
+
"data-testid": "ds-pill-dropdown-chevron",
|
|
56
|
+
innerRef: utils.setMultipleRefs(chevronRef, innerRef),
|
|
57
|
+
"aria-label": ariaLabel || label,
|
|
58
|
+
type: "right"
|
|
59
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](ChevronDown__default["default"], {
|
|
60
|
+
color: ['brand-primary', '700'],
|
|
61
|
+
size: "s"
|
|
62
|
+
}))
|
|
63
|
+
})));
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
exports.DropdownPill = DropdownPill;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var uid = require('uid');
|
|
8
|
+
var CloseIcon = require('@elliemae/ds-icons/CloseXsmall');
|
|
9
|
+
var styled = require('../styled.js');
|
|
10
|
+
var utils = require('../../utils.js');
|
|
11
|
+
var PillButton = require('../PillButton.js');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
16
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
+
var CloseIcon__default = /*#__PURE__*/_interopDefaultLegacy(CloseIcon);
|
|
18
|
+
|
|
19
|
+
const InputPill = /*#__PURE__*/React__default["default"].memo(({
|
|
20
|
+
label,
|
|
21
|
+
inputPlaceholder,
|
|
22
|
+
inputWidth,
|
|
23
|
+
inputRender,
|
|
24
|
+
onInputChange,
|
|
25
|
+
onInputClear,
|
|
26
|
+
innerRef
|
|
27
|
+
}) => {
|
|
28
|
+
const ref = React.useRef(null);
|
|
29
|
+
const InputComponent = React.useMemo(() => inputRender, [inputRender]);
|
|
30
|
+
const pillUid = React.useMemo(() => `ds-pill-${uid.uid()}`, []);
|
|
31
|
+
const onCloseIconClick = React.useCallback(e => {
|
|
32
|
+
if ([undefined, 'Enter', 'Space'].includes(e.code)) {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
onInputClear(e);
|
|
35
|
+
ref.current.focus();
|
|
36
|
+
}
|
|
37
|
+
}, [onInputClear]);
|
|
38
|
+
const [inputHasFocus, setInputHasFocus] = React.useState(false);
|
|
39
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledInputPillWrapper, {
|
|
40
|
+
className: "ds-pill-wrapper",
|
|
41
|
+
"data-testid": "ds-pill-wrapper",
|
|
42
|
+
cols: label === '' ? ['auto'] : ['auto', '24px'],
|
|
43
|
+
inputWidth: inputWidth,
|
|
44
|
+
value: label,
|
|
45
|
+
inputHasFocus: inputHasFocus
|
|
46
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](InputComponent, {
|
|
47
|
+
id: pillUid,
|
|
48
|
+
className: "ds-pill-focus-point",
|
|
49
|
+
"data-testid": "ds-pill-input",
|
|
50
|
+
innerRef: utils.setMultipleRefs(ref, innerRef),
|
|
51
|
+
value: label,
|
|
52
|
+
onChange: onInputChange,
|
|
53
|
+
placeholder: inputPlaceholder,
|
|
54
|
+
onFocus: () => setInputHasFocus(true),
|
|
55
|
+
onBlur: () => setInputHasFocus(false),
|
|
56
|
+
disableTooltip: false
|
|
57
|
+
}), label !== '' && /*#__PURE__*/_jsx__default["default"](PillButton.DSPillButton, {
|
|
58
|
+
id: pillUid,
|
|
59
|
+
"data-testid": "ds-pill-clear-icon",
|
|
60
|
+
innerRef: innerRef,
|
|
61
|
+
onClick: onCloseIconClick,
|
|
62
|
+
onKeyDown: onCloseIconClick,
|
|
63
|
+
"aria-label": "Clear input",
|
|
64
|
+
type: "right"
|
|
65
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](CloseIcon__default["default"], {
|
|
66
|
+
size: "s",
|
|
67
|
+
color: ['brand-primary', '700']
|
|
68
|
+
})));
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
exports.InputPill = InputPill;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
8
|
+
var styled = require('../styled.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
|
|
15
|
+
const LabelPill = /*#__PURE__*/React__default["default"].memo(({
|
|
16
|
+
label,
|
|
17
|
+
iconLeft,
|
|
18
|
+
ariaLabel
|
|
19
|
+
}) => /*#__PURE__*/_jsx__default["default"](styled.StyledLabelPillWrapper, {
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
className: "ds-pill-wrapper ds-pill-wrapper-label",
|
|
22
|
+
"data-testid": "ds-pill-wrapper",
|
|
23
|
+
"aria-label": ariaLabel || label,
|
|
24
|
+
cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
|
|
25
|
+
gutter: "xxxs",
|
|
26
|
+
hasIcon: iconLeft !== null
|
|
27
|
+
}, void 0, iconLeft, /*#__PURE__*/_jsx__default["default"](dsTruncatedTooltipText.SimpleTruncatedTooltipText, {
|
|
28
|
+
value: label
|
|
29
|
+
})));
|
|
30
|
+
|
|
31
|
+
exports.LabelPill = LabelPill;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
8
|
+
var styled = require('../styled.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
+
|
|
12
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
|
+
|
|
15
|
+
const ReadOnlyPill = /*#__PURE__*/React__default["default"].memo(({
|
|
16
|
+
label,
|
|
17
|
+
iconLeft,
|
|
18
|
+
iconRight,
|
|
19
|
+
ariaLabel
|
|
20
|
+
}) => {
|
|
21
|
+
const hasIconLeft = iconLeft !== null || iconRight !== null && label === '';
|
|
22
|
+
const hasIconRight = iconRight !== null || iconLeft !== null && label === '';
|
|
23
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledReadonlyPillWrapper, {
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
className: "ds-pill-wrapper ds-pill-wrapper-readonly",
|
|
26
|
+
"data-testid": "ds-pill-wrapper",
|
|
27
|
+
"aria-label": ariaLabel || label,
|
|
28
|
+
cols: [iconLeft && 'min-content', label && 'auto', iconRight && 'min-content'].filter(notFalse => notFalse),
|
|
29
|
+
gutter: "xxxs",
|
|
30
|
+
hasIconRight: hasIconRight,
|
|
31
|
+
hasIconLeft: hasIconLeft
|
|
32
|
+
}, void 0, iconLeft, label ? /*#__PURE__*/_jsx__default["default"](dsTruncatedTooltipText.SimpleTruncatedTooltipText, {
|
|
33
|
+
value: label
|
|
34
|
+
}) : null, iconRight);
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
exports.ReadOnlyPill = ReadOnlyPill;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var uid = require('uid');
|
|
8
|
+
var CloseIcon = require('@elliemae/ds-icons/CloseXsmall');
|
|
9
|
+
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
10
|
+
var styled = require('../styled.js');
|
|
11
|
+
var PillGroup = require('../PillGroup.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
|
+
var CloseIcon__default = /*#__PURE__*/_interopDefaultLegacy(CloseIcon);
|
|
19
|
+
|
|
20
|
+
const RemovablePill = /*#__PURE__*/React__default["default"].memo(({
|
|
21
|
+
label,
|
|
22
|
+
onRemove,
|
|
23
|
+
innerRef,
|
|
24
|
+
ariaLabel
|
|
25
|
+
}) => {
|
|
26
|
+
const {
|
|
27
|
+
onKeyboardRemove
|
|
28
|
+
} = React.useContext(PillGroup.DSPillGroupV2Context);
|
|
29
|
+
const pillUid = React.useMemo(() => `ds-pill-${uid.uid()}`, []);
|
|
30
|
+
const onKeyDown = React.useCallback(e => {
|
|
31
|
+
if (['Enter', 'Space'].includes(e.code)) {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
if (onKeyboardRemove) onKeyboardRemove(pillUid);
|
|
34
|
+
onRemove(e);
|
|
35
|
+
}
|
|
36
|
+
}, [onKeyboardRemove, onRemove, pillUid]);
|
|
37
|
+
return /*#__PURE__*/_jsx__default["default"](styled.StyledRemovablePillWrapper, {
|
|
38
|
+
cols: ['auto', '24px'],
|
|
39
|
+
gutter: "2px",
|
|
40
|
+
alignItems: "center",
|
|
41
|
+
justifyItems: "center",
|
|
42
|
+
className: "ds-pill-wrapper ds-pill-wrapper-removable",
|
|
43
|
+
"data-testid": "ds-pill-wrapper",
|
|
44
|
+
"aria-label": ariaLabel || label
|
|
45
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsTruncatedTooltipText.SimpleTruncatedTooltipText, {
|
|
46
|
+
value: label
|
|
47
|
+
}), /*#__PURE__*/_jsx__default["default"](PillButton.DSPillButton, {
|
|
48
|
+
className: "ds-pill-focus-point",
|
|
49
|
+
id: pillUid,
|
|
50
|
+
"data-testid": "ds-pill-close-icon",
|
|
51
|
+
innerRef: innerRef,
|
|
52
|
+
onClick: onRemove,
|
|
53
|
+
onKeyDown: onKeyDown,
|
|
54
|
+
"aria-label": `Remove ${label}`,
|
|
55
|
+
type: "right"
|
|
56
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](CloseIcon__default["default"], {
|
|
57
|
+
size: "s",
|
|
58
|
+
color: ['brand-primary', '700']
|
|
59
|
+
})));
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
exports.RemovablePill = RemovablePill;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var DSTooltip = require('@elliemae/ds-tooltip');
|
|
8
|
+
var dsTruncatedTooltipText = require('@elliemae/ds-truncated-tooltip-text');
|
|
9
|
+
var styled = require('../styled.js');
|
|
10
|
+
|
|
11
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
12
|
+
|
|
13
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
14
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
15
|
+
|
|
16
|
+
const ValuePill = /*#__PURE__*/React__default["default"].memo(({
|
|
17
|
+
label,
|
|
18
|
+
tooltipValue,
|
|
19
|
+
iconLeft,
|
|
20
|
+
ariaLabel
|
|
21
|
+
}) => /*#__PURE__*/_jsx__default["default"](styled.StyledValuePillWrapper, {
|
|
22
|
+
alignItems: "center",
|
|
23
|
+
className: "ds-pill-wrapper ds-pill-wrapper-value",
|
|
24
|
+
"data-testid": "ds-pill-wrapper",
|
|
25
|
+
"aria-label": ariaLabel || label,
|
|
26
|
+
cols: [iconLeft && 'min-content', 'auto'].filter(notFalse => notFalse),
|
|
27
|
+
gutter: "xxxs",
|
|
28
|
+
hasIcon: iconLeft !== null
|
|
29
|
+
}, void 0, iconLeft, tooltipValue !== '' ? /*#__PURE__*/_jsx__default["default"](DSTooltip.DSTooltipV3, {
|
|
30
|
+
text: tooltipValue,
|
|
31
|
+
startPlacementPreference: "bottom"
|
|
32
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](styled.StyledSpanWithTooltip, {
|
|
33
|
+
className: "ds-pill-tooltip-value",
|
|
34
|
+
tabIndex: 0
|
|
35
|
+
}, void 0, label)) : /*#__PURE__*/_jsx__default["default"](dsTruncatedTooltipText.SimpleTruncatedTooltipText, {
|
|
36
|
+
value: label
|
|
37
|
+
})));
|
|
38
|
+
|
|
39
|
+
exports.ValuePill = ValuePill;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var DropdownPill = require('./DropdownPill.js');
|
|
6
|
+
var InputPill = require('./InputPill.js');
|
|
7
|
+
var LabelPill = require('./LabelPill.js');
|
|
8
|
+
var ReadOnlyPill = require('./ReadOnlyPill.js');
|
|
9
|
+
var RemovablePill = require('./RemovablePill.js');
|
|
10
|
+
var ValuePill = require('./ValuePill.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
exports.DropdownPill = DropdownPill.DropdownPill;
|
|
15
|
+
exports.InputPill = InputPill.InputPill;
|
|
16
|
+
exports.LabelPill = LabelPill.LabelPill;
|
|
17
|
+
exports.ReadOnlyPill = ReadOnlyPill.ReadOnlyPill;
|
|
18
|
+
exports.RemovablePill = RemovablePill.RemovablePill;
|
|
19
|
+
exports.ValuePill = ValuePill.ValuePill;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
6
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
7
7
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
8
|
-
var
|
|
8
|
+
var React = require('react');
|
|
9
9
|
var reactDesc = require('react-desc');
|
|
10
10
|
var DSDropdownMenu = require('@elliemae/ds-dropdownmenu');
|
|
11
11
|
var ChevronDown = require('@elliemae/ds-icons/ChevronDown');
|
|
@@ -28,7 +28,7 @@ const _excluded = ["containerProps", "label", "variant", "tabIndex", "closeMenuO
|
|
|
28
28
|
|
|
29
29
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
30
30
|
|
|
31
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default[
|
|
31
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
32
32
|
|
|
33
33
|
function DropdownPill(_ref) {
|
|
34
34
|
let {
|
|
@@ -40,14 +40,14 @@ function DropdownPill(_ref) {
|
|
|
40
40
|
maxWidth,
|
|
41
41
|
minWidth
|
|
42
42
|
} = _ref,
|
|
43
|
-
dropdownProps = _objectWithoutProperties__default[
|
|
43
|
+
dropdownProps = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
44
44
|
|
|
45
|
-
const ref =
|
|
46
|
-
const [chevronEl, chevronRef] =
|
|
45
|
+
const ref = React.useRef(null);
|
|
46
|
+
const [chevronEl, chevronRef] = React.useState();
|
|
47
47
|
const {
|
|
48
48
|
focusFirst
|
|
49
|
-
} = useFocusGroupItem__default[
|
|
50
|
-
return /*#__PURE__*/jsxRuntime.jsx(DSDropdownMenu__default[
|
|
49
|
+
} = useFocusGroupItem__default["default"](ref);
|
|
50
|
+
return /*#__PURE__*/jsxRuntime.jsx(DSDropdownMenu__default["default"], _objectSpread(_objectSpread({}, dropdownProps), {}, {
|
|
51
51
|
closeMenuOnItemSelection: closeMenuOnItemSelection,
|
|
52
52
|
maxWidth: maxWidth,
|
|
53
53
|
hideIfNotVisible: true,
|
|
@@ -58,7 +58,7 @@ function DropdownPill(_ref) {
|
|
|
58
58
|
minWidth: minWidth,
|
|
59
59
|
onClose: focusFirst,
|
|
60
60
|
referenceNode: chevronEl,
|
|
61
|
-
triggerComponent: /*#__PURE__*/_jsx__default[
|
|
61
|
+
triggerComponent: /*#__PURE__*/_jsx__default["default"](Pill.Pill, {
|
|
62
62
|
"data-testid": "dropdown-pill",
|
|
63
63
|
className: "dropdown-pill",
|
|
64
64
|
containerProps: _objectSpread({
|
|
@@ -68,7 +68,7 @@ function DropdownPill(_ref) {
|
|
|
68
68
|
label: label,
|
|
69
69
|
rightAddon: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
70
70
|
ref: chevronRef,
|
|
71
|
-
children: _ChevronDown || (_ChevronDown = /*#__PURE__*/_jsx__default[
|
|
71
|
+
children: _ChevronDown || (_ChevronDown = /*#__PURE__*/_jsx__default["default"](ChevronDown__default["default"], {
|
|
72
72
|
className: "dropdown-pill-chevron-down",
|
|
73
73
|
"data-testid": "dropdown-pill-button"
|
|
74
74
|
}))
|