@elliemae/ds-pills 2.2.1 → 2.3.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/cjs/components/Pill.js +56 -49
  2. package/cjs/components/Pill.js.map +7 -0
  3. package/cjs/components/PillButton.js +54 -52
  4. package/cjs/components/PillButton.js.map +7 -0
  5. package/cjs/components/PillGroup.js +61 -53
  6. package/cjs/components/PillGroup.js.map +7 -0
  7. package/cjs/components/index.js +30 -17
  8. package/cjs/components/index.js.map +7 -0
  9. package/cjs/components/styled.js +228 -78
  10. package/cjs/components/styled.js.map +7 -0
  11. package/cjs/components/types/DropdownPill.js +79 -77
  12. package/cjs/components/types/DropdownPill.js.map +7 -0
  13. package/cjs/components/types/InputPill.js +58 -48
  14. package/cjs/components/types/InputPill.js.map +7 -0
  15. package/cjs/components/types/LabelPill.js +44 -38
  16. package/cjs/components/types/LabelPill.js.map +7 -0
  17. package/cjs/components/types/ReadOnlyPill.js +48 -43
  18. package/cjs/components/types/ReadOnlyPill.js.map +7 -0
  19. package/cjs/components/types/RemovablePill.js +60 -53
  20. package/cjs/components/types/RemovablePill.js.map +7 -0
  21. package/cjs/components/types/ValuePill.js +48 -43
  22. package/cjs/components/types/ValuePill.js.map +7 -0
  23. package/cjs/components/types/index.js +33 -19
  24. package/cjs/components/types/index.js.map +7 -0
  25. package/cjs/deprecated/DropdownPill.js +80 -101
  26. package/cjs/deprecated/DropdownPill.js.map +7 -0
  27. package/cjs/deprecated/InputPill.js +67 -69
  28. package/cjs/deprecated/InputPill.js.map +7 -0
  29. package/cjs/deprecated/LabeledDropdownPills.js +92 -96
  30. package/cjs/deprecated/LabeledDropdownPills.js.map +7 -0
  31. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +91 -94
  32. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +7 -0
  33. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +106 -114
  34. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +7 -0
  35. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +119 -127
  36. package/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +7 -0
  37. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js +39 -15
  38. package/cjs/deprecated/LabeledDropdownPillsTypes/utils.js.map +7 -0
  39. package/cjs/deprecated/LabeledPills.js +65 -52
  40. package/cjs/deprecated/LabeledPills.js.map +7 -0
  41. package/cjs/deprecated/OverflowPill.js +59 -53
  42. package/cjs/deprecated/OverflowPill.js.map +7 -0
  43. package/cjs/deprecated/Pill.js +67 -82
  44. package/cjs/deprecated/Pill.js.map +7 -0
  45. package/cjs/deprecated/PillGroup.js +68 -68
  46. package/cjs/deprecated/PillGroup.js.map +7 -0
  47. package/cjs/deprecated/ReadOnlyPill.js +93 -94
  48. package/cjs/deprecated/ReadOnlyPill.js.map +7 -0
  49. package/cjs/deprecated/RemovablePill.js +61 -57
  50. package/cjs/deprecated/RemovablePill.js.map +7 -0
  51. package/cjs/deprecated/index.js +43 -33
  52. package/cjs/deprecated/index.js.map +7 -0
  53. package/cjs/index.d.js +27 -2
  54. package/cjs/index.d.js.map +7 -0
  55. package/cjs/index.js +37 -43
  56. package/cjs/index.js.map +7 -0
  57. package/cjs/props.js +72 -46
  58. package/cjs/props.js.map +7 -0
  59. package/cjs/utils.js +43 -25
  60. package/cjs/utils.js.map +7 -0
  61. package/esm/components/Pill.js +18 -31
  62. package/esm/components/Pill.js.map +7 -0
  63. package/esm/components/PillButton.js +22 -39
  64. package/esm/components/PillButton.js.map +7 -0
  65. package/esm/components/PillGroup.js +28 -38
  66. package/esm/components/PillGroup.js.map +7 -0
  67. package/esm/components/index.js +5 -3
  68. package/esm/components/index.js.map +7 -0
  69. package/esm/components/styled.js +205 -66
  70. package/esm/components/styled.js.map +7 -0
  71. package/esm/components/types/DropdownPill.js +50 -67
  72. package/esm/components/types/DropdownPill.js.map +7 -0
  73. package/esm/components/types/InputPill.js +25 -35
  74. package/esm/components/types/InputPill.js.map +7 -0
  75. package/esm/components/types/LabelPill.js +15 -29
  76. package/esm/components/types/LabelPill.js.map +7 -0
  77. package/esm/components/types/ReadOnlyPill.js +19 -34
  78. package/esm/components/types/ReadOnlyPill.js.map +7 -0
  79. package/esm/components/types/RemovablePill.js +31 -44
  80. package/esm/components/types/RemovablePill.js.map +7 -0
  81. package/esm/components/types/ValuePill.js +19 -34
  82. package/esm/components/types/ValuePill.js.map +7 -0
  83. package/esm/components/types/index.js +8 -6
  84. package/esm/components/types/index.js.map +7 -0
  85. package/esm/deprecated/DropdownPill.js +49 -86
  86. package/esm/deprecated/DropdownPill.js.map +7 -0
  87. package/esm/deprecated/InputPill.js +38 -59
  88. package/esm/deprecated/InputPill.js.map +7 -0
  89. package/esm/deprecated/LabeledDropdownPills.js +59 -81
  90. package/esm/deprecated/LabeledDropdownPills.js.map +7 -0
  91. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +60 -84
  92. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +7 -0
  93. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +65 -94
  94. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +7 -0
  95. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +79 -108
  96. package/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +7 -0
  97. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js +9 -10
  98. package/esm/deprecated/LabeledDropdownPillsTypes/utils.js.map +7 -0
  99. package/esm/deprecated/LabeledPills.js +34 -41
  100. package/esm/deprecated/LabeledPills.js.map +7 -0
  101. package/esm/deprecated/OverflowPill.js +25 -37
  102. package/esm/deprecated/OverflowPill.js.map +7 -0
  103. package/esm/deprecated/Pill.js +39 -71
  104. package/esm/deprecated/Pill.js.map +7 -0
  105. package/esm/deprecated/PillGroup.js +39 -56
  106. package/esm/deprecated/PillGroup.js.map +7 -0
  107. package/esm/deprecated/ReadOnlyPill.js +60 -79
  108. package/esm/deprecated/ReadOnlyPill.js.map +7 -0
  109. package/esm/deprecated/RemovablePill.js +30 -45
  110. package/esm/deprecated/RemovablePill.js.map +7 -0
  111. package/esm/deprecated/index.js +14 -8
  112. package/esm/deprecated/index.js.map +7 -0
  113. package/esm/index.d.js +2 -1
  114. package/esm/index.d.js.map +7 -0
  115. package/esm/index.js +8 -11
  116. package/esm/index.js.map +7 -0
  117. package/esm/props.js +42 -36
  118. package/esm/props.js.map +7 -0
  119. package/esm/utils.js +16 -23
  120. package/esm/utils.js.map +7 -0
  121. package/package.json +15 -15
  122. package/types/deprecated/LabeledDropdownPills.d.ts +1 -1
  123. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +3 -1
  124. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +3 -1
  125. package/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +1 -0
@@ -1,53 +1,43 @@
1
- import _jsx from '@babel/runtime/helpers/esm/jsx';
2
- import 'core-js/modules/web.dom-collections.iterator.js';
3
- import 'core-js/modules/esnext.async-iterator.map.js';
4
- import 'core-js/modules/esnext.iterator.map.js';
5
- import React, { createContext, useMemo, useCallback } from 'react';
6
- import { describe } from 'react-desc';
7
- import { uid } from 'uid';
8
- import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';
9
- import { DSPillGroupPropTypes, DSPillGroupDefaultProps } from '../props.js';
10
- import { StyledPillGroup } from './styled.js';
11
- import { jsx } from 'react/jsx-runtime';
12
-
13
- const DSPillGroupV2Context = /*#__PURE__*/createContext({
1
+ import * as React from "react";
2
+ import React2, { createContext, useCallback, useMemo } from "react";
3
+ import { describe } from "react-desc";
4
+ import { uid } from "uid";
5
+ import { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from "@elliemae/ds-props-helpers";
6
+ import { DSPillGroupDefaultProps, DSPillGroupPropTypes } from "../props";
7
+ import { StyledPillGroup } from "./styled";
8
+ const DSPillGroupV2Context = createContext({
14
9
  onKeyboardRemove: () => null
15
10
  });
16
-
17
- const DSPillGroupV2 = props => {
11
+ const DSPillGroupV2 = (props) => {
18
12
  const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillGroupDefaultProps);
19
13
  useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes);
20
- const pillGroupUid = useMemo(() => "ds-pill-group-".concat(uid()), []);
21
- const {
22
- children,
23
- width,
24
- innerRef
25
- } = propsWithDefaults;
26
- const onKeyboardRemove = useCallback(pillUid => {
27
- const elems = [...document.querySelectorAll("#".concat(pillGroupUid, " .ds-pill-focus-point"))];
28
- const pillIndex = elems.findIndex(elem => elem.id === pillUid);
29
-
14
+ const pillGroupUid = useMemo(() => `ds-pill-group-${uid()}`, []);
15
+ const { children, width, innerRef } = propsWithDefaults;
16
+ const onKeyboardRemove = useCallback((pillUid) => {
17
+ const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)];
18
+ const pillIndex = elems.findIndex((elem) => elem.id === pillUid);
30
19
  if (pillIndex > 0) {
31
20
  elems[pillIndex - 1].focus();
32
21
  } else if (pillIndex + 1 < elems.length) {
33
22
  elems[pillIndex + 1].focus();
34
23
  }
35
24
  }, [pillGroupUid]);
36
- return /*#__PURE__*/_jsx(DSPillGroupV2Context.Provider, {
37
- value: {
38
- onKeyboardRemove
39
- }
40
- }, void 0, /*#__PURE__*/jsx(StyledPillGroup, {
41
- width: width,
25
+ return /* @__PURE__ */ React2.createElement(DSPillGroupV2Context.Provider, {
26
+ value: { onKeyboardRemove }
27
+ }, /* @__PURE__ */ React2.createElement(StyledPillGroup, {
28
+ width,
42
29
  id: pillGroupUid,
43
- cols: React.Children.map(children, () => 'auto'),
30
+ cols: React2.Children.map(children, () => "auto"),
44
31
  gutter: "2px",
45
- ref: innerRef,
46
- children: children
47
- }));
32
+ ref: innerRef
33
+ }, children));
48
34
  };
49
-
35
+ DSPillGroupV2.propTypes = DSPillGroupPropTypes;
50
36
  const DSPillGroupV2WithSchema = describe(DSPillGroupV2);
51
37
  DSPillGroupV2WithSchema.propTypes = DSPillGroupPropTypes;
52
-
53
- export { DSPillGroupV2, DSPillGroupV2Context, DSPillGroupV2WithSchema };
38
+ export {
39
+ DSPillGroupV2,
40
+ DSPillGroupV2Context,
41
+ DSPillGroupV2WithSchema
42
+ };
43
+ //# sourceMappingURL=PillGroup.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/PillGroup.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { createContext, useCallback, useMemo } from 'react';\nimport { describe } from 'react-desc';\nimport { uid } from 'uid';\nimport { useMemoMergePropsWithDefault, useValidateTypescriptPropTypes } from '@elliemae/ds-props-helpers';\nimport { DSPillGroupProps } from '../index.d';\nimport { DSPillGroupDefaultProps, DSPillGroupPropTypes } from '../props';\nimport { StyledPillGroup } from './styled';\n\nexport const DSPillGroupV2Context = createContext<{ onKeyboardRemove: (pillUid: string) => void }>({\n onKeyboardRemove: () => null,\n});\n\nconst DSPillGroupV2: React.ComponentType<DSPillGroupProps> = (props) => {\n const propsWithDefaults = useMemoMergePropsWithDefault(props, DSPillGroupDefaultProps);\n useValidateTypescriptPropTypes(propsWithDefaults, DSPillGroupPropTypes);\n\n const pillGroupUid = useMemo(() => `ds-pill-group-${uid()}`, []);\n const { children, width, innerRef } = propsWithDefaults;\n const onKeyboardRemove = useCallback(\n (pillUid: string) => {\n const elems = [...document.querySelectorAll(`#${pillGroupUid} .ds-pill-focus-point`)] as HTMLElement[];\n\n const pillIndex = elems.findIndex((elem) => elem.id === pillUid);\n\n if (pillIndex > 0) {\n elems[pillIndex - 1].focus();\n } else if (pillIndex + 1 < elems.length) {\n elems[pillIndex + 1].focus();\n }\n },\n [pillGroupUid],\n );\n\n return (\n <DSPillGroupV2Context.Provider value={{ onKeyboardRemove }}>\n <StyledPillGroup\n width={width}\n id={pillGroupUid}\n cols={React.Children.map(children, () => 'auto')}\n gutter=\"2px\"\n ref={innerRef}\n >\n {children}\n </StyledPillGroup>\n </DSPillGroupV2Context.Provider>\n );\n};\n\nDSPillGroupV2.propTypes = DSPillGroupPropTypes;\nconst DSPillGroupV2WithSchema = describe(DSPillGroupV2);\nDSPillGroupV2WithSchema.propTypes = DSPillGroupPropTypes;\n\nexport { DSPillGroupV2, DSPillGroupV2WithSchema };\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AAEA;AACA;AAEO,MAAM,uBAAuB,cAA+D;AAAA,EACjG,kBAAkB,MAAM;AAAA;AAG1B,MAAM,gBAAuD,CAAC,UAAU;AACtE,QAAM,oBAAoB,6BAA6B,OAAO;AAC9D,iCAA+B,mBAAmB;AAElD,QAAM,eAAe,QAAQ,MAAM,iBAAiB,SAAS;AAC7D,QAAM,EAAE,UAAU,OAAO,aAAa;AACtC,QAAM,mBAAmB,YACvB,CAAC,YAAoB;AACnB,UAAM,QAAQ,CAAC,GAAG,SAAS,iBAAiB,IAAI;AAEhD,UAAM,YAAY,MAAM,UAAU,CAAC,SAAS,KAAK,OAAO;AAExD,QAAI,YAAY,GAAG;AACjB,YAAM,YAAY,GAAG;AAAA,eACZ,YAAY,IAAI,MAAM,QAAQ;AACvC,YAAM,YAAY,GAAG;AAAA;AAAA,KAGzB,CAAC;AAGH,SACE,qCAAC,qBAAqB,UAAtB;AAAA,IAA+B,OAAO,EAAE;AAAA,KACtC,qCAAC,iBAAD;AAAA,IACE;AAAA,IACA,IAAI;AAAA,IACJ,MAAM,OAAM,SAAS,IAAI,UAAU,MAAM;AAAA,IACzC,QAAO;AAAA,IACP,KAAK;AAAA,KAEJ;AAAA;AAMT,cAAc,YAAY;AAC1B,MAAM,0BAA0B,SAAS;AACzC,wBAAwB,YAAY;",
6
+ "names": []
7
+ }
@@ -1,3 +1,5 @@
1
- export { DSPillV2, DSPillV2WithSchema } from './Pill.js';
2
- export { DSPillGroupV2, DSPillGroupV2Context, DSPillGroupV2WithSchema } from './PillGroup.js';
3
- export { DSPillButton, DSPillButtonWithSchema } from './PillButton.js';
1
+ import * as React from "react";
2
+ export * from "./Pill";
3
+ export * from "./PillGroup";
4
+ export * from "./PillButton";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/index.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export * from './Pill';\nexport * from './PillGroup';\nexport * from './PillButton';\n"],
5
+ "mappings": "AAAA;ACAA;AACA;AACA;",
6
+ "names": []
7
+ }
@@ -1,67 +1,206 @@
1
- import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
2
- import styled from 'styled-components';
3
- import { css } from '@elliemae/ds-system';
4
- import Grid from '@elliemae/ds-grid';
5
- import { DSButtonV2 } from '@elliemae/ds-button';
6
-
7
- var _templateObject, _templateObject2;
8
- // Common CSS
9
- // =============================================================================
10
-
11
- const borderOutside = function (color) {
12
- let size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
13
- let zIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 2;
14
- let borderRadius = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '12px';
15
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n :after {\n content: ' ';\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n border: ", "px solid ", ";\n border-top-left-radius: ", ";\n border-top-right-radius: ", ";\n border-bottom-left-radius: ", ";\n border-bottom-right-radius: ", ";\n pointer-events: none;\n z-index: ", ";\n }\n"])), size, color, borderRadius, borderRadius, borderRadius, borderRadius, zIndex);
16
- };
1
+ import * as React from "react";
2
+ import styled from "styled-components";
3
+ import { css } from "@elliemae/ds-system";
4
+ import { Grid } from "@elliemae/ds-grid";
5
+ import { DSButtonV2 } from "@elliemae/ds-button";
6
+ const borderOutside = (color, size = 1, zIndex = 2, borderRadius = "12px") => css`
7
+ :after {
8
+ content: ' ';
9
+ position: absolute;
10
+ top: 0px;
11
+ left: 0px;
12
+ right: 0px;
13
+ bottom: 0px;
14
+ border: ${size}px solid ${color};
15
+ border-top-left-radius: ${borderRadius};
16
+ border-top-right-radius: ${borderRadius};
17
+ border-bottom-left-radius: ${borderRadius};
18
+ border-bottom-right-radius: ${borderRadius};
19
+ pointer-events: none;
20
+ z-index: ${zIndex};
21
+ }
22
+ `;
23
+ const commonPillWrapperCss = css`
24
+ height: ${(props) => props?.size === "m" ? "24px" : "18px"};
25
+
26
+ position: relative;
27
+
28
+ width: fit-content;
29
+
30
+ background-color: ${(props) => props.theme.colors.brand[200]};
31
+
32
+ outline: none;
33
+
34
+ white-space: nowrap;
35
+
36
+ padding: 0px 12px 0 12px;
37
+ border-radius: 12px;
38
+
39
+ font-size: 13px;
40
+ line-height: 1;
41
+ color: ${(props) => props.theme.colors.brand[800]};
42
+ ${(props) => borderOutside(props.theme.colors.brand[300])};
43
+ `;
44
+ const StyledLabelPillWrapper = styled(Grid)`
45
+ ${commonPillWrapperCss}
46
+
47
+ font-weight: ${(props) => props.theme.fontWeights.semibold};
48
+ padding-left: ${(props) => props.hasIcon ? "0px !important" : "12px"};
49
+ `;
50
+ const StyledValuePillWrapper = styled(Grid)`
51
+ ${commonPillWrapperCss}
52
+
53
+ font-weight: ${(props) => props.theme.fontWeights.regular};
54
+ padding-left: ${(props) => props.hasIcon ? "0px !important" : "12px"};
55
+ `;
56
+ const StyledInputPillWrapper = styled(Grid)`
57
+ ${commonPillWrapperCss}
58
+
59
+ background: ${(props) => props.theme.colors.neutral["000"]};
60
+ padding: 0;
61
+
62
+ ${({ value, theme }) => borderOutside(value === "" ? theme.colors.neutral[400] : theme.colors.brand[500])}
63
+
64
+ :focus-within {
65
+ ${(props) => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : ""}
66
+ }
67
+
68
+ :active {
69
+ ${(props) => props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : ""}
70
+ }
17
71
 
18
- const commonPillWrapperCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n height: ", ";\n\n position: relative;\n\n width: fit-content;\n\n background-color: ", ";\n\n outline: none;\n\n white-space: nowrap;\n\n padding: 0px 12px 0 12px;\n border-radius: 12px;\n\n font-size: 13px;\n line-height: 1;\n color: ", ";\n ", ";\n"])), props => (props === null || props === void 0 ? void 0 : props.size) === 'm' ? '24px' : '18px', props => props.theme.colors.brand[200], props => props.theme.colors.brand[800], props => borderOutside(props.theme.colors.brand[300])); // =============================================================================
19
- // Pills wrappers
20
- // =============================================================================
21
-
22
- const StyledLabelPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
23
- componentId: "sc-j0tlch-0"
24
- })(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIcon ? '0px !important' : '12px');
25
- const StyledValuePillWrapper = /*#__PURE__*/styled(Grid).withConfig({
26
- componentId: "sc-j0tlch-1"
27
- })(["", " font-weight:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.regular, props => props.hasIcon ? '0px !important' : '12px');
28
- const StyledInputPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
29
- componentId: "sc-j0tlch-2"
30
- })(["", " background:", ";padding:0;", ":focus-within{", "}:active{", "}& .em-ds-input{outline:none !important;border:none !important;box-shadow:none !important;border-radius:0 !important;height:100%;background:transparent;width:", ";padding:0;margin:0 0 0 8px;}& .em-ds-input__tooltip-ref{height:100%;}"], commonPillWrapperCss, props => props.theme.colors.neutral['000'], _ref => {
31
- let {
32
- value,
33
- theme
34
- } = _ref;
35
- return borderOutside(value === '' ? theme.colors.neutral[400] : theme.colors.brand[500]);
36
- }, props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '', props => props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '', props => "".concat(props.inputWidth + (props.value === '' ? 24 : 0), "px"));
37
- const StyledDropdownPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
38
- componentId: "sc-j0tlch-3"
39
- })(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.semibold);
40
- const StyledReadonlyPillWrapper = /*#__PURE__*/styled(Grid).withConfig({
41
- componentId: "sc-j0tlch-4"
42
- })(["", " font-weight:", ";padding-right:", ";padding-left:", ";"], commonPillWrapperCss, props => props.theme.fontWeights.semibold, props => props.hasIconRight ? '0 !important' : '12px', props => props.hasIconLeft ? '0 !important' : '12px');
43
- const StyledRemovablePillWrapper = /*#__PURE__*/styled(Grid).withConfig({
44
- componentId: "sc-j0tlch-5"
45
- })(["", " font-weight:", ";padding:0 0 0 12px;"], commonPillWrapperCss, props => props.theme.fontWeights.regular); // =============================================================================
46
- // Pill group
47
- // =============================================================================
48
-
49
- const StyledPillGroup = /*#__PURE__*/styled(Grid).withConfig({
50
- componentId: "sc-j0tlch-6"
51
- })(["width:", ";& .ds-pill-wrapper{&:not(:first-of-type){&,:after,:before,.ds-pill-tooltip-value:after{border-top-left-radius:0px;border-bottom-left-radius:0px;}}&:not(:last-of-type){&,:after,:before,.ds-pill-tooltip-value:after{border-top-right-radius:0px;border-bottom-right-radius:0px;}}}& .ds-pill-wrapper-label,& .ds-pill-wrapper-value,& .ds-pill-wrapper-readonly{&:not(:first-of-type){padding-left:8px;}&:not(:last-of-type){padding-right:8px;}}& .ds-pill-wrapper-removable:not(:first-of-type){padding-left:8px;}& .ds-pill-wrapper-dropdown:not(:first-of-type){padding-left:8px;}& .ds-pill-wrapper{:not(:first-of-type){.ds-pill-button-left{border-radius:0px;}.ds-pill-button-only{border-top-left-radius:0px;border-bottom-left-radius:0px;}}:not(:last-of-type){.ds-pill-button-right{border-radius:0px;}.ds-pill-button-only{border-top-right-radius:0px;border-bottom-right-radius:0px;}}}"], _ref2 => {
52
- let {
53
- width
54
- } = _ref2;
55
- return width;
56
- }); // =============================================================================
57
- // Extra stuff
58
- // =============================================================================
59
-
60
- const StyledSpanWithTooltip = /*#__PURE__*/styled.span.withConfig({
61
- componentId: "sc-j0tlch-7"
62
- })(["outline:none;:focus{", "}"], props => borderOutside(props.theme.colors.brand[700], 2, 3));
63
- const StyledPillButton = /*#__PURE__*/styled(DSButtonV2).withConfig({
64
- componentId: "sc-j0tlch-8"
65
- })(["display:grid;place-items:center;position:relative;padding:0;width:", ";height:", ";border-radius:12px;:focus{", "}cursor:pointer;"], props => props.width, props => props.height, props => borderOutside(props.theme.colors.brand[700], 2, 3, 'inherit'));
66
-
67
- export { StyledDropdownPillWrapper, StyledInputPillWrapper, StyledLabelPillWrapper, StyledPillButton, StyledPillGroup, StyledReadonlyPillWrapper, StyledRemovablePillWrapper, StyledSpanWithTooltip, StyledValuePillWrapper };
72
+ & .em-ds-input {
73
+ outline: none !important;
74
+ border: none !important;
75
+ box-shadow: none !important;
76
+ border-radius: 0 !important;
77
+ height: 100%;
78
+ background: transparent;
79
+ width: ${(props) => `${props.inputWidth + (props.value === "" ? 24 : 0)}px`};
80
+ padding: 0;
81
+ margin: 0 0 0 8px;
82
+ }
83
+
84
+ & .em-ds-input__tooltip-ref {
85
+ height: 100%;
86
+ }
87
+ `;
88
+ const StyledDropdownPillWrapper = styled(Grid)`
89
+ ${commonPillWrapperCss}
90
+ font-weight: ${(props) => props.theme.fontWeights.semibold};
91
+
92
+ padding: 0 0 0 12px;
93
+ `;
94
+ const StyledReadonlyPillWrapper = styled(Grid)`
95
+ ${commonPillWrapperCss}
96
+ font-weight: ${(props) => props.theme.fontWeights.semibold};
97
+ padding-right: ${(props) => props.hasIconRight ? "0 !important" : "12px"};
98
+ padding-left: ${(props) => props.hasIconLeft ? "0 !important" : "12px"};
99
+ `;
100
+ const StyledRemovablePillWrapper = styled(Grid)`
101
+ ${commonPillWrapperCss}
102
+ font-weight: ${(props) => props.theme.fontWeights.regular};
103
+ padding: 0 0 0 12px;
104
+ `;
105
+ const StyledPillGroup = styled(Grid)`
106
+ width: ${({ width }) => width};
107
+
108
+ // Pill edges
109
+ & .ds-pill-wrapper {
110
+ &:not(:first-of-type) {
111
+ &,
112
+ :after,
113
+ :before,
114
+ .ds-pill-tooltip-value:after {
115
+ border-top-left-radius: 0px;
116
+ border-bottom-left-radius: 0px;
117
+ }
118
+ }
119
+ &:not(:last-of-type) {
120
+ &,
121
+ :after,
122
+ :before,
123
+ .ds-pill-tooltip-value:after {
124
+ border-top-right-radius: 0px;
125
+ border-bottom-right-radius: 0px;
126
+ }
127
+ }
128
+ }
129
+
130
+ // Pill paddings to the left / right
131
+ & .ds-pill-wrapper-label,
132
+ & .ds-pill-wrapper-value,
133
+ & .ds-pill-wrapper-readonly {
134
+ &:not(:first-of-type) {
135
+ padding-left: 8px;
136
+ }
137
+ &:not(:last-of-type) {
138
+ padding-right: 8px;
139
+ }
140
+ }
141
+
142
+ & .ds-pill-wrapper-removable:not(:first-of-type) {
143
+ padding-left: 8px;
144
+ }
145
+
146
+ & .ds-pill-wrapper-dropdown:not(:first-of-type) {
147
+ padding-left: 8px;
148
+ }
149
+
150
+ & .ds-pill-wrapper {
151
+ :not(:first-of-type) {
152
+ .ds-pill-button-left {
153
+ border-radius: 0px;
154
+ }
155
+ .ds-pill-button-only {
156
+ border-top-left-radius: 0px;
157
+ border-bottom-left-radius: 0px;
158
+ }
159
+ }
160
+ :not(:last-of-type) {
161
+ .ds-pill-button-right {
162
+ border-radius: 0px;
163
+ }
164
+ .ds-pill-button-only {
165
+ border-top-right-radius: 0px;
166
+ border-bottom-right-radius: 0px;
167
+ }
168
+ }
169
+ }
170
+ `;
171
+ const StyledSpanWithTooltip = styled.span`
172
+ outline: none;
173
+ :focus {
174
+ ${(props) => borderOutside(props.theme.colors.brand[700], 2, 3)}
175
+ }
176
+ `;
177
+ const StyledPillButton = styled(DSButtonV2)`
178
+ display: grid;
179
+ place-items: center;
180
+
181
+ position: relative;
182
+
183
+ padding: 0;
184
+ width: ${(props) => props.width};
185
+ height: ${(props) => props.height};
186
+
187
+ border-radius: 12px;
188
+
189
+ :focus {
190
+ ${(props) => borderOutside(props.theme.colors.brand[700], 2, 3, "inherit")}
191
+ }
192
+
193
+ cursor: pointer;
194
+ `;
195
+ export {
196
+ StyledDropdownPillWrapper,
197
+ StyledInputPillWrapper,
198
+ StyledLabelPillWrapper,
199
+ StyledPillButton,
200
+ StyledPillGroup,
201
+ StyledReadonlyPillWrapper,
202
+ StyledRemovablePillWrapper,
203
+ StyledSpanWithTooltip,
204
+ StyledValuePillWrapper
205
+ };
206
+ //# sourceMappingURL=styled.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/styled.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport styled from 'styled-components';\nimport { css } from '@elliemae/ds-system';\nimport { Grid } from '@elliemae/ds-grid';\nimport { DSButtonV2 } from '@elliemae/ds-button';\n\n// =============================================================================\n// Common CSS\n// =============================================================================\n\nconst borderOutside = (color: string, size = 1, zIndex = 2, borderRadius = '12px') => css`\n :after {\n content: ' ';\n position: absolute;\n top: 0px;\n left: 0px;\n right: 0px;\n bottom: 0px;\n border: ${size}px solid ${color};\n border-top-left-radius: ${borderRadius};\n border-top-right-radius: ${borderRadius};\n border-bottom-left-radius: ${borderRadius};\n border-bottom-right-radius: ${borderRadius};\n pointer-events: none;\n z-index: ${zIndex};\n }\n`;\n\nconst commonPillWrapperCss = css<{ size: 'm' | 's' }>`\n height: ${(props) => (props?.size === 'm' ? '24px' : '18px')};\n\n position: relative;\n\n width: fit-content;\n\n background-color: ${(props) => props.theme.colors.brand[200]};\n\n outline: none;\n\n white-space: nowrap;\n\n padding: 0px 12px 0 12px;\n border-radius: 12px;\n\n font-size: 13px;\n line-height: 1;\n color: ${(props) => props.theme.colors.brand[800]};\n ${(props) => borderOutside(props.theme.colors.brand[300])};\n`;\n\n// =============================================================================\n// Pills wrappers\n// =============================================================================\n\nexport const StyledLabelPillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\nexport const StyledValuePillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding-left: ${(props) => (props.hasIcon ? '0px !important' : '12px')};\n`;\n\nexport const StyledInputPillWrapper = styled(Grid)<{ value: string; inputWidth: number; inputHasFocus: boolean }>`\n ${commonPillWrapperCss}\n\n background: ${(props) => props.theme.colors.neutral['000']};\n padding: 0;\n\n ${({ value, theme }) => borderOutside(value === '' ? theme.colors.neutral[400] : theme.colors.brand[500])}\n\n :focus-within {\n ${(props) => (props.inputHasFocus ? borderOutside(props.theme.colors.brand[700], 2) : '')}\n }\n\n :active {\n ${(props) => (props.inputHasFocus ? borderOutside(props.theme.colors.brand[500]) : '')}\n }\n\n & .em-ds-input {\n outline: none !important;\n border: none !important;\n box-shadow: none !important;\n border-radius: 0 !important;\n height: 100%;\n background: transparent;\n width: ${(props) => `${props.inputWidth + (props.value === '' ? 24 : 0)}px`};\n padding: 0;\n margin: 0 0 0 8px;\n }\n\n & .em-ds-input__tooltip-ref {\n height: 100%;\n }\n`;\n\nexport const StyledDropdownPillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n\n padding: 0 0 0 12px;\n`;\n\nexport const StyledReadonlyPillWrapper = styled(Grid)<{ hasIconRight: boolean; hasIconLeft: boolean }>`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.semibold};\n padding-right: ${(props) => (props.hasIconRight ? '0 !important' : '12px')};\n padding-left: ${(props) => (props.hasIconLeft ? '0 !important' : '12px')};\n`;\n\nexport const StyledRemovablePillWrapper = styled(Grid)`\n ${commonPillWrapperCss}\n font-weight: ${(props) => props.theme.fontWeights.regular};\n padding: 0 0 0 12px;\n`;\n\n// =============================================================================\n// Pill group\n// =============================================================================\n\nexport const StyledPillGroup = styled(Grid)`\n width: ${({ width }) => width};\n\n // Pill edges\n & .ds-pill-wrapper {\n &:not(:first-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n &:not(:last-of-type) {\n &,\n :after,\n :before,\n .ds-pill-tooltip-value:after {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n\n // Pill paddings to the left / right\n & .ds-pill-wrapper-label,\n & .ds-pill-wrapper-value,\n & .ds-pill-wrapper-readonly {\n &:not(:first-of-type) {\n padding-left: 8px;\n }\n &:not(:last-of-type) {\n padding-right: 8px;\n }\n }\n\n & .ds-pill-wrapper-removable:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper-dropdown:not(:first-of-type) {\n padding-left: 8px;\n }\n\n & .ds-pill-wrapper {\n :not(:first-of-type) {\n .ds-pill-button-left {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n }\n }\n :not(:last-of-type) {\n .ds-pill-button-right {\n border-radius: 0px;\n }\n .ds-pill-button-only {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n }\n }\n }\n`;\n\n// =============================================================================\n// Extra stuff\n// =============================================================================\n\nexport const StyledSpanWithTooltip = styled.span`\n outline: none;\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700], 2, 3)}\n }\n`;\n\nexport const StyledPillButton = styled(DSButtonV2)<{ width: string; height: string }>`\n display: grid;\n place-items: center;\n\n position: relative;\n\n padding: 0;\n width: ${(props) => props.width};\n height: ${(props) => props.height};\n\n border-radius: 12px;\n\n :focus {\n ${(props) => borderOutside(props.theme.colors.brand[700], 2, 3, 'inherit')}\n }\n\n cursor: pointer;\n`;\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AAMA,MAAM,gBAAgB,CAAC,OAAe,OAAO,GAAG,SAAS,GAAG,eAAe,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,cAQxE,gBAAgB;AAAA,8BACA;AAAA,+BACC;AAAA,iCACE;AAAA,kCACC;AAAA;AAAA,eAEnB;AAAA;AAAA;AAIf,MAAM,uBAAuB;AAAA,YACjB,CAAC,UAAW,OAAO,SAAS,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,sBAMjC,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAW/C,CAAC,UAAU,MAAM,MAAM,OAAO,MAAM;AAAA,IAC3C,CAAC,UAAU,cAAc,MAAM,MAAM,OAAO,MAAM;AAAA;AAO/C,MAAM,yBAAyB,OAAO;AAAA,IACzC;AAAA;AAAA,iBAEa,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,kBAClC,CAAC,UAAW,MAAM,UAAU,mBAAmB;AAAA;AAG1D,MAAM,yBAAyB,OAAO;AAAA,IACzC;AAAA;AAAA,iBAEa,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,kBAClC,CAAC,UAAW,MAAM,UAAU,mBAAmB;AAAA;AAG1D,MAAM,yBAAyB,OAAO;AAAA,IACzC;AAAA;AAAA,gBAEY,CAAC,UAAU,MAAM,MAAM,OAAO,QAAQ;AAAA;AAAA;AAAA,IAGlD,CAAC,EAAE,OAAO,YAAY,cAAc,UAAU,KAAK,MAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,MAAM;AAAA;AAAA;AAAA,MAGhG,CAAC,UAAW,MAAM,gBAAgB,cAAc,MAAM,MAAM,OAAO,MAAM,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,MAIpF,CAAC,UAAW,MAAM,gBAAgB,cAAc,MAAM,MAAM,OAAO,MAAM,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,aAU1E,CAAC,UAAU,GAAG,MAAM,aAAc,OAAM,UAAU,KAAK,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAUlE,MAAM,4BAA4B,OAAO;AAAA,IAC5C;AAAA,iBACa,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA;AAAA;AAAA;AAK7C,MAAM,4BAA4B,OAAO;AAAA,IAC5C;AAAA,iBACa,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA,mBACjC,CAAC,UAAW,MAAM,eAAe,iBAAiB;AAAA,kBACnD,CAAC,UAAW,MAAM,cAAc,iBAAiB;AAAA;AAG5D,MAAM,6BAA6B,OAAO;AAAA,IAC7C;AAAA,iBACa,CAAC,UAAU,MAAM,MAAM,YAAY;AAAA;AAAA;AAQ7C,MAAM,kBAAkB,OAAO;AAAA,WAC3B,CAAC,EAAE,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAsEnB,MAAM,wBAAwB,OAAO;AAAA;AAAA;AAAA,MAGtC,CAAC,UAAU,cAAc,MAAM,MAAM,OAAO,MAAM,MAAM,GAAG;AAAA;AAAA;AAI1D,MAAM,mBAAmB,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,WAO5B,CAAC,UAAU,MAAM;AAAA,YAChB,CAAC,UAAU,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,MAKvB,CAAC,UAAU,cAAc,MAAM,MAAM,OAAO,MAAM,MAAM,GAAG,GAAG;AAAA;AAAA;AAAA;AAAA;",
6
+ "names": []
7
+ }
@@ -1,76 +1,59 @@
1
- import 'core-js/modules/esnext.async-iterator.filter.js';
2
- import 'core-js/modules/esnext.iterator.constructor.js';
3
- import 'core-js/modules/esnext.iterator.filter.js';
4
- import 'core-js/modules/esnext.async-iterator.for-each.js';
5
- import 'core-js/modules/esnext.iterator.for-each.js';
6
- import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
7
- import _jsx from '@babel/runtime/helpers/esm/jsx';
8
- import React, { useRef, useMemo } from 'react';
9
- import { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';
10
- import { uid } from 'uid';
11
- import { ChevronSmallDown } from '@elliemae/ds-icons';
12
- import { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';
13
- import { StyledDropdownPillWrapper } from '../styled.js';
14
- import { setMultipleRefs } from '../../utils.js';
15
- import { DSPillButton } from '../PillButton.js';
16
- import { jsx } from 'react/jsx-runtime';
17
-
18
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
19
-
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
21
- const DropdownPill = /*#__PURE__*/React.memo(_ref => {
22
- let {
23
- label,
24
- size,
25
- labelTruncated,
26
- dropdownProps,
27
- innerRef,
28
- ariaLabel,
29
- onDropdownClick
30
- } = _ref;
1
+ import * as React from "react";
2
+ import React2, { useMemo, useRef } from "react";
3
+ import { DSDropdownMenuV2 } from "@elliemae/ds-dropdownmenu";
4
+ import { uid } from "uid";
5
+ import { ChevronSmallDown } from "@elliemae/ds-icons";
6
+ import { SimpleTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
7
+ import { StyledDropdownPillWrapper } from "../styled";
8
+ import { setMultipleRefs } from "../../utils";
9
+ import { DSPillButton } from "../PillButton";
10
+ const DropdownPill = React2.memo(({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {
31
11
  const chevronRef = useRef(null);
32
- const pillUid = useMemo(() => "ds-pill-".concat(uid()), []);
33
- const TextComponent = labelTruncated ? _ref2 => {
34
- let {
35
- children
36
- } = _ref2;
37
- return /*#__PURE__*/_jsx(SimpleTruncatedTooltipText, {
38
- value: children
39
- });
40
- } : React.Fragment;
41
- return /*#__PURE__*/_jsx(StyledDropdownPillWrapper, {
42
- size: size,
12
+ const pillUid = useMemo(() => `ds-pill-${uid()}`, []);
13
+ const TextComponent = labelTruncated ? ({ children }) => /* @__PURE__ */ React2.createElement(SimpleTruncatedTooltipText, {
14
+ value: children
15
+ }) : React2.Fragment;
16
+ return /* @__PURE__ */ React2.createElement(StyledDropdownPillWrapper, {
17
+ size,
43
18
  id: pillUid,
44
19
  className: "ds-pill-wrapper ds-pill-wrapper-dropdown",
45
20
  "data-testid": "ds-pill-wrapper",
46
- cols: ['auto', '24px'],
21
+ cols: ["auto", "24px"],
47
22
  gutter: "2px",
48
23
  alignItems: "center",
49
24
  justifyItems: "center"
50
- }, void 0, /*#__PURE__*/_jsx(TextComponent, {}, void 0, label), /*#__PURE__*/jsx(DSDropdownMenuV2, _objectSpread(_objectSpread({
51
- placementOrderPreference: ['bottom-start', 'bottom', 'bottom-end', 'right-end', 'top-start', 'top', 'top-end']
52
- }, dropdownProps), {}, {
53
- onClickOutside: e => {
54
- if (e.code === 'Escape') chevronRef.current.focus();
55
- if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);
56
- },
57
- wrapperStyles: {
58
- w: '100%',
59
- h: '100%'
25
+ }, /* @__PURE__ */ React2.createElement(TextComponent, null, label), /* @__PURE__ */ React2.createElement(DSDropdownMenuV2, {
26
+ placementOrderPreference: [
27
+ "bottom-start",
28
+ "bottom",
29
+ "bottom-end",
30
+ "right-end",
31
+ "top-start",
32
+ "top",
33
+ "top-end"
34
+ ],
35
+ ...dropdownProps,
36
+ onClickOutside: (e) => {
37
+ if (e.code === "Escape")
38
+ chevronRef.current.focus();
39
+ if (dropdownProps.onClickOutside)
40
+ dropdownProps.onClickOutside(e);
60
41
  },
61
- children: /*#__PURE__*/_jsx(DSPillButton, {
62
- className: "ds-pill-focus-point",
63
- "data-testid": "ds-pill-dropdown-chevron",
64
- innerRef: setMultipleRefs(chevronRef, innerRef),
65
- "aria-label": ariaLabel || label,
66
- type: "right",
67
- onClick: onDropdownClick
68
- }, void 0, /*#__PURE__*/_jsx(ChevronSmallDown, {
69
- color: ['brand-primary', '800'],
70
- width: 20,
71
- height: 20
72
- }))
73
- })));
42
+ wrapperStyles: { w: "100%", h: "100%" }
43
+ }, /* @__PURE__ */ React2.createElement(DSPillButton, {
44
+ className: "ds-pill-focus-point",
45
+ "data-testid": "ds-pill-dropdown-chevron",
46
+ innerRef: setMultipleRefs(chevronRef, innerRef),
47
+ "aria-label": ariaLabel || label,
48
+ type: "right",
49
+ onClick: onDropdownClick
50
+ }, /* @__PURE__ */ React2.createElement(ChevronSmallDown, {
51
+ color: ["brand-primary", "800"],
52
+ width: 20,
53
+ height: 20
54
+ }))));
74
55
  });
75
-
76
- export { DropdownPill };
56
+ export {
57
+ DropdownPill
58
+ };
59
+ //# sourceMappingURL=DropdownPill.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/components/types/DropdownPill.tsx"],
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\nimport React, { useMemo, useRef } from 'react';\nimport { DSDropdownMenuV2 } from '@elliemae/ds-dropdownmenu';\nimport { uid } from 'uid';\nimport { ChevronSmallDown } from '@elliemae/ds-icons';\nimport { SimpleTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\nimport { StyledDropdownPillWrapper } from '../styled';\nimport type { DSPillProps } from '../../index.d';\nimport { setMultipleRefs } from '../../utils';\nimport { DSPillButton } from '../PillButton';\n\nexport const DropdownPill = React.memo<DSPillProps>(\n ({ label, size, labelTruncated, dropdownProps, innerRef, ariaLabel, onDropdownClick }) => {\n const chevronRef = useRef(null);\n\n const pillUid = useMemo(() => `ds-pill-${uid()}`, []);\n\n const TextComponent = labelTruncated\n ? ({ children }) => <SimpleTruncatedTooltipText value={children} />\n : React.Fragment;\n\n return (\n <StyledDropdownPillWrapper\n size={size}\n id={pillUid}\n className=\"ds-pill-wrapper ds-pill-wrapper-dropdown\"\n data-testid=\"ds-pill-wrapper\"\n cols={['auto', '24px']}\n gutter=\"2px\"\n alignItems=\"center\"\n justifyItems=\"center\"\n >\n <TextComponent>{label}</TextComponent>\n <DSDropdownMenuV2\n placementOrderPreference={[\n 'bottom-start',\n 'bottom',\n 'bottom-end',\n 'right-end',\n 'top-start',\n 'top',\n 'top-end',\n ]}\n {...dropdownProps}\n onClickOutside={(e) => {\n if (e.code === 'Escape') chevronRef.current.focus();\n if (dropdownProps.onClickOutside) dropdownProps.onClickOutside(e);\n }}\n wrapperStyles={{ w: '100%', h: '100%' }}\n >\n <DSPillButton\n className=\"ds-pill-focus-point\"\n data-testid=\"ds-pill-dropdown-chevron\"\n innerRef={setMultipleRefs(chevronRef, innerRef)}\n aria-label={ariaLabel || label}\n type=\"right\"\n onClick={onDropdownClick}\n >\n <ChevronSmallDown color={['brand-primary', '800']} width={20} height={20} />\n </DSPillButton>\n </DSDropdownMenuV2>\n </StyledDropdownPillWrapper>\n );\n },\n);\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEO,MAAM,eAAe,OAAM,KAChC,CAAC,EAAE,OAAO,MAAM,gBAAgB,eAAe,UAAU,WAAW,sBAAsB;AACxF,QAAM,aAAa,OAAO;AAE1B,QAAM,UAAU,QAAQ,MAAM,WAAW,SAAS;AAElD,QAAM,gBAAgB,iBAClB,CAAC,EAAE,eAAe,qCAAC,4BAAD;AAAA,IAA4B,OAAO;AAAA,OACrD,OAAM;AAEV,SACE,qCAAC,2BAAD;AAAA,IACE;AAAA,IACA,IAAI;AAAA,IACJ,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,MAAM,CAAC,QAAQ;AAAA,IACf,QAAO;AAAA,IACP,YAAW;AAAA,IACX,cAAa;AAAA,KAEb,qCAAC,eAAD,MAAgB,QAChB,qCAAC,kBAAD;AAAA,IACE,0BAA0B;AAAA,MACxB;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA,OAEE;AAAA,IACJ,gBAAgB,CAAC,MAAM;AACrB,UAAI,EAAE,SAAS;AAAU,mBAAW,QAAQ;AAC5C,UAAI,cAAc;AAAgB,sBAAc,eAAe;AAAA;AAAA,IAEjE,eAAe,EAAE,GAAG,QAAQ,GAAG;AAAA,KAE/B,qCAAC,cAAD;AAAA,IACE,WAAU;AAAA,IACV,eAAY;AAAA,IACZ,UAAU,gBAAgB,YAAY;AAAA,IACtC,cAAY,aAAa;AAAA,IACzB,MAAK;AAAA,IACL,SAAS;AAAA,KAET,qCAAC,kBAAD;AAAA,IAAkB,OAAO,CAAC,iBAAiB;AAAA,IAAQ,OAAO;AAAA,IAAI,QAAQ;AAAA;AAAA;",
6
+ "names": []
7
+ }