@elliemae/ds-pills 3.0.0-alpha.0 → 3.0.0-alpha.1

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 (93) hide show
  1. package/dist/cjs/components/Pill.js +15 -3
  2. package/dist/cjs/components/Pill.js.map +1 -1
  3. package/dist/cjs/components/PillButton.js +32 -4
  4. package/dist/cjs/components/PillButton.js.map +1 -1
  5. package/dist/cjs/components/PillGroup.js +34 -6
  6. package/dist/cjs/components/PillGroup.js.map +2 -2
  7. package/dist/cjs/components/types/DropdownPill.js +21 -4
  8. package/dist/cjs/components/types/DropdownPill.js.map +1 -1
  9. package/dist/cjs/components/types/RemovablePill.js +17 -6
  10. package/dist/cjs/components/types/RemovablePill.js.map +2 -2
  11. package/dist/cjs/deprecated/DropdownPill.js +50 -14
  12. package/dist/cjs/deprecated/DropdownPill.js.map +1 -1
  13. package/dist/cjs/deprecated/InputPill.js +46 -14
  14. package/dist/cjs/deprecated/InputPill.js.map +1 -1
  15. package/dist/cjs/deprecated/LabeledDropdownPills.js +53 -15
  16. package/dist/cjs/deprecated/LabeledDropdownPills.js.map +1 -1
  17. package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +64 -26
  18. package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
  19. package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +55 -19
  20. package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
  21. package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +60 -24
  22. package/dist/cjs/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
  23. package/dist/cjs/deprecated/Pill.js +48 -14
  24. package/dist/cjs/deprecated/Pill.js.map +1 -1
  25. package/dist/cjs/deprecated/PillGroup.js +15 -3
  26. package/dist/cjs/deprecated/PillGroup.js.map +1 -1
  27. package/dist/cjs/index.d.js.map +1 -1
  28. package/dist/cjs/props.js +2 -1
  29. package/dist/cjs/props.js.map +2 -2
  30. package/dist/esm/components/Pill.js +17 -3
  31. package/dist/esm/components/Pill.js.map +1 -1
  32. package/dist/esm/components/PillButton.js +34 -4
  33. package/dist/esm/components/PillButton.js.map +1 -1
  34. package/dist/esm/components/PillGroup.js +41 -6
  35. package/dist/esm/components/PillGroup.js.map +2 -2
  36. package/dist/esm/components/types/DropdownPill.js +23 -4
  37. package/dist/esm/components/types/DropdownPill.js.map +1 -1
  38. package/dist/esm/components/types/RemovablePill.js +17 -6
  39. package/dist/esm/components/types/RemovablePill.js.map +2 -2
  40. package/dist/esm/deprecated/DropdownPill.js +52 -14
  41. package/dist/esm/deprecated/DropdownPill.js.map +1 -1
  42. package/dist/esm/deprecated/InputPill.js +48 -14
  43. package/dist/esm/deprecated/InputPill.js.map +1 -1
  44. package/dist/esm/deprecated/LabeledDropdownPills.js +55 -15
  45. package/dist/esm/deprecated/LabeledDropdownPills.js.map +1 -1
  46. package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js +66 -26
  47. package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.js.map +1 -1
  48. package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js +57 -19
  49. package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.js.map +1 -1
  50. package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js +62 -24
  51. package/dist/esm/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.js.map +1 -1
  52. package/dist/esm/deprecated/Pill.js +50 -14
  53. package/dist/esm/deprecated/Pill.js.map +1 -1
  54. package/dist/esm/deprecated/PillGroup.js +17 -3
  55. package/dist/esm/deprecated/PillGroup.js.map +1 -1
  56. package/dist/esm/props.js +2 -1
  57. package/dist/esm/props.js.map +2 -2
  58. package/package.json +16 -15
  59. package/dist/types/components/Pill.d.ts +0 -5
  60. package/dist/types/components/PillButton.d.ts +0 -5
  61. package/dist/types/components/PillGroup.d.ts +0 -13
  62. package/dist/types/components/index.d.ts +0 -3
  63. package/dist/types/components/styled.d.ts +0 -24
  64. package/dist/types/components/types/DropdownPill.d.ts +0 -3
  65. package/dist/types/components/types/InputPill.d.ts +0 -3
  66. package/dist/types/components/types/LabelPill.d.ts +0 -3
  67. package/dist/types/components/types/ReadOnlyPill.d.ts +0 -3
  68. package/dist/types/components/types/RemovablePill.d.ts +0 -3
  69. package/dist/types/components/types/ValuePill.d.ts +0 -3
  70. package/dist/types/components/types/index.d.ts +0 -6
  71. package/dist/types/deprecated/DropdownPill.d.ts +0 -66
  72. package/dist/types/deprecated/InputPill.d.ts +0 -10
  73. package/dist/types/deprecated/LabeledDropdownPills.d.ts +0 -82
  74. package/dist/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownCascadeMenuPill.d.ts +0 -17
  75. package/dist/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownMultiPill.d.ts +0 -15
  76. package/dist/types/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.d.ts +0 -29
  77. package/dist/types/deprecated/LabeledDropdownPillsTypes/utils.d.ts +0 -1
  78. package/dist/types/deprecated/LabeledPills.d.ts +0 -52
  79. package/dist/types/deprecated/OverflowPill.d.ts +0 -33
  80. package/dist/types/deprecated/Pill.d.ts +0 -59
  81. package/dist/types/deprecated/PillGroup.d.ts +0 -50
  82. package/dist/types/deprecated/ReadOnlyPill.d.ts +0 -56
  83. package/dist/types/deprecated/RemovablePill.d.ts +0 -49
  84. package/dist/types/deprecated/index.d.ts +0 -9
  85. package/dist/types/index.d.ts +0 -3
  86. package/dist/types/props.d.ts +0 -92
  87. package/dist/types/tests/DSPill.test.d.ts +0 -1
  88. package/dist/types/tests/DSPillGroup.test.d.ts +0 -1
  89. package/dist/types/tests/events/DSPill.events.keyboard.test.d.ts +0 -1
  90. package/dist/types/tests/events/DSPill.events.test.d.ts +0 -1
  91. package/dist/types/tests/events/DSPillGroup.events.keyboard.test.d.ts +0 -1
  92. package/dist/types/tests/events/DSPillGroup.events.test.d.ts +0 -1
  93. package/dist/types/utils.d.ts +0 -4
@@ -1,3 +1,34 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
1
32
  import * as React from "react";
2
33
  import React2, { useCallback, useState, useEffect, useLayoutEffect } from "react";
3
34
  import PropTypes from "prop-types";
@@ -7,18 +38,28 @@ import { InputPill } from "../InputPill";
7
38
  import { Pill } from "../Pill";
8
39
  import { RemovablePill } from "../RemovablePill";
9
40
  import { hasOptionChanged } from "./utils";
10
- function LabeledDropdownSinglePill({
11
- label,
12
- labelIsValue = false,
13
- options,
14
- value,
15
- onSelect = () => null,
16
- onChange,
17
- maxWidth,
18
- minWidth,
19
- fixed = false,
20
- ...menuProps
21
- }) {
41
+ function LabeledDropdownSinglePill(_a) {
42
+ var _b = _a, {
43
+ label,
44
+ labelIsValue = false,
45
+ options,
46
+ value,
47
+ onSelect = () => null,
48
+ onChange,
49
+ maxWidth,
50
+ minWidth,
51
+ fixed = false
52
+ } = _b, menuProps = __objRest(_b, [
53
+ "label",
54
+ "labelIsValue",
55
+ "options",
56
+ "value",
57
+ "onSelect",
58
+ "onChange",
59
+ "maxWidth",
60
+ "minWidth",
61
+ "fixed"
62
+ ]);
22
63
  const [optionValue, setOptionValue] = useState(value);
23
64
  const prevOptions = usePrevious(options);
24
65
  const areOptionsEqual = useShouldRecalculate(hasOptionChanged(prevOptions, options));
@@ -53,11 +94,11 @@ function LabeledDropdownSinglePill({
53
94
  const { onChangeInput } = optionValue;
54
95
  setOptionValue(null);
55
96
  onChangeInput && onChangeInput("");
56
- const newOption = { ...removedOption, input: "" };
97
+ const newOption = __spreadProps(__spreadValues({}, removedOption), { input: "" });
57
98
  onRemove && onRemove(newOption, removedOption);
58
99
  };
59
100
  const renderPill = (option, fixed2) => {
60
- const { input, onChangeInput, ...otherProps } = option;
101
+ const _a2 = option, { input, onChangeInput } = _a2, otherProps = __objRest(_a2, ["input", "onChangeInput"]);
61
102
  let SelectedPill;
62
103
  if (isString(input)) {
63
104
  SelectedPill = InputPill;
@@ -66,14 +107,13 @@ function LabeledDropdownSinglePill({
66
107
  } else {
67
108
  SelectedPill = RemovablePill;
68
109
  }
69
- return /* @__PURE__ */ React2.createElement(SelectedPill, {
110
+ return /* @__PURE__ */ React2.createElement(SelectedPill, __spreadValues({
70
111
  key: option.id,
71
112
  label: option.label,
72
113
  onChange: onChangeInputValue,
73
114
  onRemove: (e) => removeOption(option, e),
74
- value: input,
75
- ...otherProps
76
- });
115
+ value: input
116
+ }, otherProps));
77
117
  };
78
118
  const renderSelection = () => {
79
119
  if (!labelIsValue) {
@@ -84,27 +124,25 @@ function LabeledDropdownSinglePill({
84
124
  });
85
125
  }
86
126
  };
87
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(DropdownPill, {
88
- ...menuProps,
127
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(DropdownPill, __spreadProps(__spreadValues({}, menuProps), {
89
128
  label: !labelIsValue ? label : optionValue?.label,
90
129
  maxWidth,
91
130
  minWidth,
92
131
  onSelectMenuItem: selectOption,
93
132
  options: [
94
- {
95
- ...menuProps,
133
+ __spreadProps(__spreadValues({}, menuProps), {
96
134
  type: "SelectionGroup",
97
135
  id: "multi-selection-views",
98
136
  multi: false,
99
137
  items: options,
100
138
  closeOnClick: true
101
- }
139
+ })
102
140
  ],
103
141
  selection: {
104
142
  "multi-selection-views": optionValue ? [optionValue?.id] : ""
105
143
  },
106
144
  variant: "title"
107
- }), renderSelection());
145
+ })), renderSelection());
108
146
  }
109
147
  LabeledDropdownSinglePill.propTypes = {
110
148
  label: PropTypes.string,
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/deprecated/LabeledDropdownPillsTypes/LabeledDropdownSinglePill.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable mdx/no-unused-expressions */\n/* eslint-disable no-shadow */\n/* eslint-disable no-unused-expressions */\n/* eslint-disable max-lines */\nimport React, { useCallback, useState, useEffect, useLayoutEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { isFunction, isString, useShouldRecalculate, usePrevious } from '@elliemae/ds-utilities';\nimport { DropdownPill } from '../DropdownPill';\nimport { InputPill } from '../InputPill';\nimport { Pill } from '../Pill';\nimport { RemovablePill } from '../RemovablePill';\nimport { hasOptionChanged } from './utils';\n\nfunction LabeledDropdownSinglePill({\n label,\n labelIsValue = false,\n options,\n value,\n onSelect = () => null,\n onChange,\n maxWidth,\n minWidth,\n fixed = false,\n ...menuProps\n}) {\n const [optionValue, setOptionValue] = useState(value);\n const prevOptions = usePrevious(options);\n const areOptionsEqual = useShouldRecalculate(hasOptionChanged(prevOptions, options));\n\n useEffect(() => setOptionValue(value), [value]);\n\n useEffect(() => {\n const selectedValue = options.find((option) => option.selected);\n\n if (selectedValue) {\n setOptionValue(selectedValue);\n } else if (!selectedValue) {\n setOptionValue(options[0]);\n }\n }, [areOptionsEqual]);\n\n useLayoutEffect(() => {\n if (optionValue) {\n const selectedValue = options.find((option) => option.id === optionValue.id);\n setOptionValue(selectedValue);\n }\n }, [options]);\n\n const selectOption = useCallback(\n (option) => {\n if (isFunction(onChange)) {\n onChange(option);\n }\n setOptionValue(option);\n onSelect(option);\n },\n [onChange, onSelect],\n );\n\n const onChangeInputValue = useCallback(\n ({ target: { value: inputValue } }) => {\n const { onChangeInput } = optionValue;\n\n onChangeInput && onChangeInput(inputValue);\n },\n [optionValue],\n );\n\n const removeOption = (removedOption) => {\n const { onRemove } = menuProps;\n const { onChangeInput } = optionValue;\n setOptionValue(null);\n onChangeInput && onChangeInput('');\n const newOption = { ...removedOption, input: '' };\n onRemove && onRemove(newOption, removedOption);\n };\n\n const renderPill = (option, fixed) => {\n const { input, onChangeInput, ...otherProps } = option;\n let SelectedPill;\n if (isString(input)) {\n SelectedPill = InputPill;\n } else if (fixed) {\n SelectedPill = Pill;\n } else {\n SelectedPill = RemovablePill;\n }\n\n return (\n <SelectedPill\n key={option.id}\n label={option.label}\n onChange={onChangeInputValue}\n onRemove={(e) => removeOption(option, e)}\n value={input}\n {...otherProps}\n />\n );\n };\n\n const renderSelection = () => {\n if (!labelIsValue) {\n if (optionValue) return renderPill(optionValue, fixed);\n return <Pill label=\"-\" />;\n }\n };\n\n return (\n <>\n <DropdownPill\n {...menuProps}\n label={!labelIsValue ? label : optionValue?.label}\n maxWidth={maxWidth}\n minWidth={minWidth}\n onSelectMenuItem={selectOption}\n options={[\n {\n ...menuProps,\n type: 'SelectionGroup',\n id: 'multi-selection-views',\n multi: false,\n items: options,\n closeOnClick: true,\n },\n ]}\n selection={{\n 'multi-selection-views': optionValue ? [optionValue?.id] : '',\n }}\n variant=\"title\"\n />\n {renderSelection()}\n </>\n );\n}\n\nLabeledDropdownSinglePill.propTypes = {\n label: PropTypes.string,\n labelIsValue: PropTypes.bool,\n options: PropTypes.array,\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n onSelect: PropTypes.func,\n onChange: PropTypes.func,\n maxWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n minWidth: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n fixed: PropTypes.bool,\n};\n\nexport { LabeledDropdownSinglePill };\nexport default LabeledDropdownSinglePill;"],
5
- "mappings": "AAAA;ACIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,mCAAmC;AAAA,EACjC;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA;AAAA,EACA,WAAW,MAAM;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,KACL;AAAA,GACF;AACD,QAAM,CAAC,aAAa,kBAAkB,SAAS;AAC/C,QAAM,cAAc,YAAY;AAChC,QAAM,kBAAkB,qBAAqB,iBAAiB,aAAa;AAE3E,YAAU,MAAM,eAAe,QAAQ,CAAC;AAExC,YAAU,MAAM;AACd,UAAM,gBAAgB,QAAQ,KAAK,CAAC,WAAW,OAAO;AAEtD,QAAI,eAAe;AACjB,qBAAe;AAAA,eACN,CAAC,eAAe;AACzB,qBAAe,QAAQ;AAAA;AAAA,KAExB,CAAC;AAEJ,kBAAgB,MAAM;AACpB,QAAI,aAAa;AACf,YAAM,gBAAgB,QAAQ,KAAK,CAAC,WAAW,OAAO,OAAO,YAAY;AACzE,qBAAe;AAAA;AAAA,KAEhB,CAAC;AAEJ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;AAAA,QACN,IAAI;AAAA,QACJ,OAAO;AAAA,QACP,OAAO;AAAA,QACP,cAAc;AAAA;AAAA;AAAA,IAGlB,WAAW;AAAA,MACT,yBAAyB,cAAc,CAAC,aAAa,MAAM;AAAA;AAAA,IAE7D,SAAQ;AAAA,OAET;AAAA;AAKP,0BAA0B,YAAY;AAAA,EACpC,OAAO,UAAU;AAAA,EACjB,cAAc,UAAU;AAAA,EACxB,SAAS,UAAU;AAAA,EACnB,OAAO,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;AAAA,EACxD,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU;AAAA,EACpB,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;AAAA,EAC3D,UAAU,UAAU,UAAU,CAAC,UAAU,QAAQ,UAAU;AAAA,EAC3D,OAAO,UAAU;AAAA;AAInB,IAAO,oCAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,34 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __objRest = (source, exclude) => {
21
+ var target = {};
22
+ for (var prop in source)
23
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
+ target[prop] = source[prop];
25
+ if (source != null && __getOwnPropSymbols)
26
+ for (var prop of __getOwnPropSymbols(source)) {
27
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
+ target[prop] = source[prop];
29
+ }
30
+ return target;
31
+ };
1
32
  import * as React from "react";
2
33
  import React2 from "react";
3
34
  import { PropTypes, describe } from "react-desc";
@@ -9,20 +40,25 @@ const PillWrapper = aggregatedClasses("div")(pillBlockName, null, ({ size, varia
9
40
  }));
10
41
  const PillLabel = aggregatedClasses("span")(pillBlockName, "label");
11
42
  const PillAddon = aggregatedClasses("div")(pillBlockName, "addon");
12
- function Pill({
13
- containerProps = {},
14
- label = "",
15
- leftAddon,
16
- rightAddon,
17
- variant = "value",
18
- size = "m",
19
- ...otherProps
20
- }) {
21
- return /* @__PURE__ */ React2.createElement(PillWrapper, {
22
- ...containerProps,
23
- classProps: { variant, size },
24
- ...otherProps
25
- }, leftAddon && /* @__PURE__ */ React2.createElement(PillAddon, null, leftAddon), /* @__PURE__ */ React2.createElement(PillLabel, null, label), rightAddon && /* @__PURE__ */ React2.createElement(PillAddon, null, rightAddon));
43
+ function Pill(_a) {
44
+ var _b = _a, {
45
+ containerProps = {},
46
+ label = "",
47
+ leftAddon,
48
+ rightAddon,
49
+ variant = "value",
50
+ size = "m"
51
+ } = _b, otherProps = __objRest(_b, [
52
+ "containerProps",
53
+ "label",
54
+ "leftAddon",
55
+ "rightAddon",
56
+ "variant",
57
+ "size"
58
+ ]);
59
+ return /* @__PURE__ */ React2.createElement(PillWrapper, __spreadValues(__spreadProps(__spreadValues({}, containerProps), {
60
+ classProps: { variant, size }
61
+ }), otherProps), leftAddon && /* @__PURE__ */ React2.createElement(PillAddon, null, leftAddon), /* @__PURE__ */ React2.createElement(PillLabel, null, label), rightAddon && /* @__PURE__ */ React2.createElement(PillAddon, null, rightAddon));
26
62
  }
27
63
  const props = {
28
64
  containerProps: PropTypes.object.description("props to inject to pill wrapper"),
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/Pill.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst pillBlockName = 'pill';\n\nconst PillWrapper = aggregatedClasses('div')(\n pillBlockName,\n null,\n ({ size, variant }) => ({\n [variant]: !!variant,\n [size]: !!size,\n }),\n);\nconst PillLabel = aggregatedClasses('span')(pillBlockName, 'label');\nconst PillAddon = aggregatedClasses('div')(pillBlockName, 'addon');\n\nfunction Pill({\n containerProps = {},\n label = '',\n leftAddon,\n rightAddon,\n variant = 'value',\n size = 'm',\n ...otherProps\n}) {\n return (\n <PillWrapper\n {...containerProps}\n classProps={{ variant, size }}\n {...otherProps}\n >\n {leftAddon && <PillAddon>{leftAddon}</PillAddon>}\n <PillLabel>{label}</PillLabel>\n {rightAddon && <PillAddon>{rightAddon}</PillAddon>}\n </PillWrapper>\n );\n}\n\nconst props = {\n /** props to inject to pill wrapper */\n containerProps: PropTypes.object.description(\n 'props to inject to pill wrapper',\n ),\n /** pill text label */\n label: PropTypes.string.isRequired.description('pill text label'),\n /** pill size */\n size: PropTypes.oneOf(['m', 'l']).description('pill size'),\n /** pill variant */\n variant: PropTypes.oneOf(['value', 'title']).description('pill variant'),\n /** addon component to left */\n leftAddon: PropTypes.node.description('addon component to left'),\n /** addon component to right */\n rightAddon: PropTypes.node.description('addon component to right'),\n};\n\nPill.propTypes = props;\nconst DSPillWithSchema = describe(Pill);\nDSPillWithSchema.propTypes = props;\n\nexport { Pill, DSPillWithSchema };\nexport default Pill;\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AAEA,MAAM,gBAAgB;AAEtB,MAAM,cAAc,kBAAkB,OACpC,eACA,MACA,CAAC,EAAE,MAAM,cAAe;AAAA,GACrB,UAAU,CA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,OAAO;AAAA,MANK,IAOT,uBAPS,IAOT;AAAA,IANH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,SACE,qCAAC,aAAD,gDACM,iBADN;AAAA,IAEE,YAAY,EAAE,SAAS;AAAA,MACnB,aAEH,aAAa,qCAAC,WAAD,MAAY,YAC1B,qCAAC,WAAD,MAAY,QACX,cAAc,qCAAC,WAAD,MAAY;AAAA;AAKjC,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAGF,OAAO,UAAU,OAAO,WAAW,YAAY;AAAA,EAE/C,MAAM,UAAU,MAAM,CAAC,KAAK,MAAM,YAAY;AAAA,EAE9C,SAAS,UAAU,MAAM,CAAC,SAAS,UAAU,YAAY;AAAA,EAEzD,WAAW,UAAU,KAAK,YAAY;AAAA,EAEtC,YAAY,UAAU,KAAK,YAAY;AAAA;AAGzC,KAAK,YAAY;AACjB,MAAM,mBAAmB,SAAS;AAClC,iBAAiB,YAAY;AAG7B,IAAO,eAAQ;",
6
6
  "names": []
7
7
  }
@@ -1,3 +1,19 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
3
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
4
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
5
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
+ var __spreadValues = (a, b) => {
7
+ for (var prop in b || (b = {}))
8
+ if (__hasOwnProp.call(b, prop))
9
+ __defNormalProp(a, prop, b[prop]);
10
+ if (__getOwnPropSymbols)
11
+ for (var prop of __getOwnPropSymbols(b)) {
12
+ if (__propIsEnum.call(b, prop))
13
+ __defNormalProp(a, prop, b[prop]);
14
+ }
15
+ return a;
16
+ };
1
17
  import * as React from "react";
2
18
  import React2 from "react";
3
19
  import { describe, PropTypes } from "react-desc";
@@ -19,9 +35,7 @@ const PillGroup = ({
19
35
  onFocusNextGroup,
20
36
  onFocusPreviousGroup,
21
37
  orientation: "horizontal"
22
- }, /* @__PURE__ */ React2.createElement(Container, {
23
- ...containerProps
24
- }, children));
38
+ }, /* @__PURE__ */ React2.createElement(Container, __spreadValues({}, containerProps), children));
25
39
  const props = {
26
40
  containerProps: PropTypes.object.description("props injected to component wrapper"),
27
41
  onFocusNextGroup: PropTypes.func.description("focus next group callback"),
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/deprecated/PillGroup.tsx"],
4
4
  "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { describe, PropTypes } from 'react-desc';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { FocusGroupProvider } from '@elliemae/ds-shared/FocusGroup/FocusGroupManager';\n\nconst pillGroupBlockName = 'pill-group';\n\nexport const Container = aggregatedClasses('div')(pillGroupBlockName);\n\nconst PillGroup = ({\n containerProps = {},\n onFocusNextGroup,\n onFocusPreviousGroup,\n onFocusGroupSet,\n children,\n}) => (\n <FocusGroupProvider\n keyBindings={{\n Tab: 'next',\n }}\n onFocusGroupSet={onFocusGroupSet}\n onFocusNextGroup={onFocusNextGroup}\n onFocusPreviousGroup={onFocusPreviousGroup}\n orientation=\"horizontal\"\n >\n <Container {...containerProps}>{children}</Container>\n </FocusGroupProvider>\n);\n\nconst props = {\n /** props injected to component wrapper */\n containerProps: PropTypes.object.description(\n 'props injected to component wrapper',\n ),\n /** focus next group callback */\n onFocusNextGroup: PropTypes.func.description('focus next group callback'),\n /** focus prev group callback */\n onFocusPreviousGroup: PropTypes.func.description('focus prev group callback'),\n /** focus group set callback */\n onFocusGroupSet: PropTypes.func.description('focus group set callback'),\n /** pill components */\n children: PropTypes.oneOfType([\n PropTypes.arrayOf(PropTypes.node),\n PropTypes.node,\n ]).isRequired.description('pill components'),\n};\n\nPillGroup.propTypes = props;\n\nconst DSPillGroupWithSchema = describe(PillGroup);\nDSPillGroupWithSchema.propTypes = props;\n\nexport { PillGroup, DSPillGroupWithSchema };\n"],
5
- "mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,qBAAqB;AAEpB,MAAM,YAAY,kBAAkB,OAAO;AAElD,MAAM,YAAY,CAAC;AAAA,EACjB,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAEA,qCAAC,oBAAD;AAAA,EACE,aAAa;AAAA,IACX,KAAK;AAAA;AAAA,EAEP;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAY;AAAA,GAEZ,qCAAC,WAAD;AAAA,KAAe;AAAA,GAAiB;AAIpC,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAGF,kBAAkB,UAAU,KAAK,YAAY;AAAA,EAE7C,sBAAsB,UAAU,KAAK,YAAY;AAAA,EAEjD,iBAAiB,UAAU,KAAK,YAAY;AAAA,EAE5C,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU,QAAQ,UAAU;AAAA,IAC5B,UAAU;AAAA,KACT,WAAW,YAAY;AAAA;AAG5B,UAAU,YAAY;AAEtB,MAAM,wBAAwB,SAAS;AACvC,sBAAsB,YAAY;",
5
+ "mappings": ";;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,qBAAqB;AAEpB,MAAM,YAAY,kBAAkB,OAAO;AAElD,MAAM,YAAY,CAAC;AAAA,EACjB,iBAAiB;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,MAEA,qCAAC,oBAAD;AAAA,EACE,aAAa;AAAA,IACX,KAAK;AAAA;AAAA,EAEP;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAY;AAAA,GAEZ,qCAAC,WAAD,mBAAe,iBAAiB;AAIpC,MAAM,QAAQ;AAAA,EAEZ,gBAAgB,UAAU,OAAO,YAC/B;AAAA,EAGF,kBAAkB,UAAU,KAAK,YAAY;AAAA,EAE7C,sBAAsB,UAAU,KAAK,YAAY;AAAA,EAEjD,iBAAiB,UAAU,KAAK,YAAY;AAAA,EAE5C,UAAU,UAAU,UAAU;AAAA,IAC5B,UAAU,QAAQ,UAAU;AAAA,IAC5B,UAAU;AAAA,KACT,WAAW,YAAY;AAAA;AAG5B,UAAU,YAAY;AAEtB,MAAM,wBAAwB,SAAS;AACvC,sBAAsB,YAAY;",
6
6
  "names": []
7
7
  }
package/dist/esm/props.js CHANGED
@@ -44,7 +44,8 @@ const DSPillV2DefaultProps = {
44
44
  inputWidth: 72,
45
45
  inputRender: DSInput,
46
46
  dropdownProps: {},
47
- onDropdownClick: () => null
47
+ onDropdownClick: () => null,
48
+ tabIndex: 0
48
49
  };
49
50
  const DSPillButtonDefaultProps = {
50
51
  type: "right",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/props.tsx"],
4
- "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { PropTypes } from 'react-desc';\nimport { DSInput } from '@elliemae/ds-form';\n\nconst pillTypes = PropTypes.oneOf(['label', 'value', 'input', 'dropdown', 'removable', 'readonly']);\n\nexport const DSPillV2PropTypes = {\n label: PropTypes.string.description('Label to show in the pill').isRequired,\n type: pillTypes.description('The type of pill that you want to render').isRequired,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Reference to the focuseable internal element of each pill (remove icons, inputs, dropdown, etc.)')\n .defaultValue(() => null),\n size: PropTypes.oneOf(['s', 'm']).description('Vertical pill size').defaultValue('m'),\n ariaLabel: PropTypes.string\n .description('Aria label for the pill. If not provided we will use the label')\n .defaultValue(''),\n labelTruncated: PropTypes.bool.description('Whether to truncate the pills label').defaultValue(true),\n tooltipValue: PropTypes.string.description('String to show as a tooltip in the value pill').defaultValue(''),\n iconLeft: PropTypes.node.description('A component to show int the left of a readonly pill').defaultValue(null),\n iconRight: PropTypes.node.description('A component to show in the right of a readonly pill').defaultValue(null),\n onRemove: PropTypes.func\n .description('Callback triggered when removing a pill with the close icon')\n .defaultValue(() => null),\n inputPlaceholder: PropTypes.string.description('Placeholder for the input pill').defaultValue(''),\n onInputChange: PropTypes.func\n .description('Callback triggered when user provides input to the input pill')\n .defaultValue(() => null),\n onInputClear: PropTypes.func\n .description('Callback triggered when the user clears an input pill')\n .defaultValue(() => null),\n inputWidth: PropTypes.number.description('Width in pixels for the input tag in the input pill').defaultValue(150),\n dropdownProps: PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({}),\n onDropdownClick: PropTypes.func\n .description('Callback when dropdown button is clicked or pressed')\n .defaultValue(() => null),\n};\n\nexport const DSPillButtonPropTypes = {\n type: PropTypes.oneOf(['only', 'left', 'right'])\n .description('The position in which this button will be placed. Only used for css styling internally')\n .defaultValue('right'),\n width: PropTypes.string.description('Width of the button').defaultValue('100%'),\n height: PropTypes.string.description('Height of the button').defaultValue('100%'),\n};\n\nexport const DSPillGroupPropTypes = {\n width: PropTypes.string.description('Width of the group').defaultValue('fit-content'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Reference to the pill group wrapper')\n .defaultValue(() => null),\n};\n\nexport const DSPillV2DefaultProps = {\n innerRef: () => null,\n ariaLabel: '',\n size: 'm',\n labelTruncated: true,\n tooltipValue: '',\n iconLeft: null,\n iconRight: null,\n onRemove: () => null,\n inputPlaceholder: '',\n onInputChange: () => null,\n onInputClear: () => null,\n inputWidth: 72,\n inputRender: DSInput,\n dropdownProps: {},\n onDropdownClick: () => null,\n};\n\nexport const DSPillButtonDefaultProps = {\n type: 'right',\n width: '100%',\n height: '100%',\n};\n\nexport const DSPillGroupDefaultProps = {\n width: 'fit-content',\n innerRef: () => null,\n};\n"],
5
- "mappings": "AAAA;ACCA;AACA;AAEA,MAAM,YAAY,UAAU,MAAM,CAAC,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AAU,UAAU,CAAC,UAAU,QAAQ,UAAU,OACxD,YAAY,uCACZ,aAAa,MAAM;AAAA;AAGjB,MAAM,uBAAuB;AAAA,EAClC,UAAU,MAAM;AAAA,EAChB,WAAW;AAAA,EACX,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU,MAAM;AAAA,EAChB,kBAAkB;AAAA,EAClB,eAAe,MAAM;AAAA,EACrB,cAAc,MAAM;AAAA,EACpB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,iBAAiB,MAAM;AAAA;AAGlB,MAAM,2BAA2B;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA;AAGH,MAAM,0BAA0B;AAAA,EACrC,OAAO;AAAA,EACP,UAAU,MAAM;AAAA;",
4
+ "sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\nimport { PropTypes } from 'react-desc';\nimport { DSInput } from '@elliemae/ds-form';\n\nconst pillTypes = PropTypes.oneOf(['label', 'value', 'input', 'dropdown', 'removable', 'readonly']);\n\nexport const DSPillV2PropTypes = {\n label: PropTypes.string.description('Label to show in the pill').isRequired,\n type: pillTypes.description('The type of pill that you want to render').isRequired,\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Reference to the focuseable internal element of each pill (remove icons, inputs, dropdown, etc.)')\n .defaultValue(() => null),\n size: PropTypes.oneOf(['s', 'm']).description('Vertical pill size').defaultValue('m'),\n ariaLabel: PropTypes.string\n .description('Aria label for the pill. If not provided we will use the label')\n .defaultValue(''),\n labelTruncated: PropTypes.bool.description('Whether to truncate the pills label').defaultValue(true),\n tooltipValue: PropTypes.string.description('String to show as a tooltip in the value pill').defaultValue(''),\n iconLeft: PropTypes.node.description('A component to show int the left of a readonly pill').defaultValue(null),\n iconRight: PropTypes.node.description('A component to show in the right of a readonly pill').defaultValue(null),\n onRemove: PropTypes.func\n .description('Callback triggered when removing a pill with the close icon')\n .defaultValue(() => null),\n inputPlaceholder: PropTypes.string.description('Placeholder for the input pill').defaultValue(''),\n onInputChange: PropTypes.func\n .description('Callback triggered when user provides input to the input pill')\n .defaultValue(() => null),\n onInputClear: PropTypes.func\n .description('Callback triggered when the user clears an input pill')\n .defaultValue(() => null),\n inputWidth: PropTypes.number.description('Width in pixels for the input tag in the input pill').defaultValue(150),\n dropdownProps: PropTypes.object.description('Properties that will be used for the dropdown-menu').defaultValue({}),\n onDropdownClick: PropTypes.func\n .description('Callback when dropdown button is clicked or pressed')\n .defaultValue(() => null),\n};\n\nexport const DSPillButtonPropTypes = {\n type: PropTypes.oneOf(['only', 'left', 'right'])\n .description('The position in which this button will be placed. Only used for css styling internally')\n .defaultValue('right'),\n width: PropTypes.string.description('Width of the button').defaultValue('100%'),\n height: PropTypes.string.description('Height of the button').defaultValue('100%'),\n};\n\nexport const DSPillGroupPropTypes = {\n width: PropTypes.string.description('Width of the group').defaultValue('fit-content'),\n innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func])\n .description('Reference to the pill group wrapper')\n .defaultValue(() => null),\n};\n\nexport const DSPillV2DefaultProps = {\n innerRef: () => null,\n ariaLabel: '',\n size: 'm',\n labelTruncated: true,\n tooltipValue: '',\n iconLeft: null,\n iconRight: null,\n onRemove: () => null,\n inputPlaceholder: '',\n onInputChange: () => null,\n onInputClear: () => null,\n inputWidth: 72,\n inputRender: DSInput,\n dropdownProps: {},\n onDropdownClick: () => null,\n tabIndex: 0,\n};\n\nexport const DSPillButtonDefaultProps = {\n type: 'right',\n width: '100%',\n height: '100%',\n};\n\nexport const DSPillGroupDefaultProps = {\n width: 'fit-content',\n innerRef: () => null,\n};\n"],
5
+ "mappings": "AAAA;ACCA;AACA;AAEA,MAAM,YAAY,UAAU,MAAM,CAAC,SAAS,SAAS,SAAS,YAAY,aAAa;AAEhF,MAAM,oBAAoB;AAAA,EAC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MAAM;AAAA;AAGjB,MAAM,uBAAuB;AAAA,EAClC,UAAU,MAAM;AAAA,EAChB,WAAW;AAAA,EACX,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,UAAU;AAAA,EACV,WAAW;AAAA,EACX,UAAU,MAAM;AAAA,EAChB,kBAAkB;AAAA,EAClB,eAAe,MAAM;AAAA,EACrB,cAAc,MAAM;AAAA,EACpB,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,eAAe;AAAA,EACf,iBAAiB,MAAM;AAAA,EACvB,UAAU;AAAA;AAGL,MAAM,2BAA2B;AAAA,EACtC,MAAM;AAAA,EACN,OAAO;AAAA,EACP,QAAQ;AAAA;AAGH,MAAM,0BAA0B;AAAA,EACrC,OAAO;AAAA,EACP,UAAU,MAAM;AAAA;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elliemae/ds-pills",
3
- "version": "3.0.0-alpha.0",
3
+ "version": "3.0.0-alpha.1",
4
4
  "license": "MIT",
5
5
  "description": "ICE MT - Dimsum - Pills",
6
6
  "files": [
@@ -147,20 +147,20 @@
147
147
  "indent": 4
148
148
  },
149
149
  "dependencies": {
150
- "@elliemae/ds-button": "3.0.0-alpha.0",
151
- "@elliemae/ds-classnames": "3.0.0-alpha.0",
152
- "@elliemae/ds-dropdownmenu": "3.0.0-alpha.0",
153
- "@elliemae/ds-form": "3.0.0-alpha.0",
154
- "@elliemae/ds-grid": "3.0.0-alpha.0",
155
- "@elliemae/ds-icons": "3.0.0-alpha.0",
156
- "@elliemae/ds-modal": "3.0.0-alpha.0",
157
- "@elliemae/ds-popover": "3.0.0-alpha.0",
158
- "@elliemae/ds-props-helpers": "3.0.0-alpha.0",
159
- "@elliemae/ds-shared": "3.0.0-alpha.0",
160
- "@elliemae/ds-system": "3.0.0-alpha.0",
161
- "@elliemae/ds-tooltip": "3.0.0-alpha.0",
162
- "@elliemae/ds-truncated-tooltip-text": "3.0.0-alpha.0",
163
- "@elliemae/ds-utilities": "3.0.0-alpha.0",
150
+ "@elliemae/ds-button": "3.0.0-alpha.1",
151
+ "@elliemae/ds-classnames": "3.0.0-alpha.1",
152
+ "@elliemae/ds-dropdownmenu": "3.0.0-alpha.1",
153
+ "@elliemae/ds-form": "3.0.0-alpha.1",
154
+ "@elliemae/ds-grid": "3.0.0-alpha.1",
155
+ "@elliemae/ds-icons": "3.0.0-alpha.1",
156
+ "@elliemae/ds-modal": "3.0.0-alpha.1",
157
+ "@elliemae/ds-popover": "3.0.0-alpha.1",
158
+ "@elliemae/ds-props-helpers": "3.0.0-alpha.1",
159
+ "@elliemae/ds-shared": "3.0.0-alpha.1",
160
+ "@elliemae/ds-system": "3.0.0-alpha.1",
161
+ "@elliemae/ds-tooltip": "3.0.0-alpha.1",
162
+ "@elliemae/ds-truncated-tooltip-text": "3.0.0-alpha.1",
163
+ "@elliemae/ds-utilities": "3.0.0-alpha.1",
164
164
  "prop-types": "~15.7.2",
165
165
  "react-desc": "~4.1.3",
166
166
  "uid": "~2.0.0"
@@ -184,6 +184,7 @@
184
184
  "dev": "cross-env NODE_ENV=development node ../../scripts/build/build.mjs --watch",
185
185
  "test": "node ../../scripts/testing/test.mjs",
186
186
  "lint": "node ../../scripts/lint.mjs",
187
+ "dts": "node ../../scripts/dts.mjs",
187
188
  "build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs"
188
189
  }
189
190
  }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import type { DSPillProps } from '../index.d';
3
- declare const DSPillV2: React.ComponentType<DSPillProps>;
4
- declare const DSPillV2WithSchema: any;
5
- export { DSPillV2, DSPillV2WithSchema };
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import { DSButtonPropsT } from '@elliemae/ds-button';
3
- declare const DSPillButton: React.ComponentType<DSButtonPropsT>;
4
- declare const DSPillButtonWithSchema: any;
5
- export { DSPillButton, DSPillButtonWithSchema };
@@ -1,13 +0,0 @@
1
- /// <reference path="../../../../../shared/typings/react-desc.d.ts" />
2
- import React from 'react';
3
- import { DSPillGroupProps } from '../index.d';
4
- export declare const DSPillGroupV2Context: React.Context<{
5
- onKeyboardRemove: (pillUid: string) => void;
6
- }>;
7
- declare const DSPillGroupV2: React.ComponentType<DSPillGroupProps>;
8
- declare const DSPillGroupV2WithSchema: {
9
- (props?: unknown): JSX.Element;
10
- propTypes: unknown;
11
- toTypescript: () => import("react-desc").TypescriptSchema;
12
- };
13
- export { DSPillGroupV2, DSPillGroupV2WithSchema };
@@ -1,3 +0,0 @@
1
- export * from './Pill';
2
- export * from './PillGroup';
3
- export * from './PillButton';
@@ -1,24 +0,0 @@
1
- /// <reference types="react" />
2
- export declare const StyledLabelPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {
3
- size: 'm' | 's';
4
- }, never>;
5
- export declare const StyledValuePillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {
6
- size: 'm' | 's';
7
- }, never>;
8
- export declare const StyledInputPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
9
- export declare const StyledDropdownPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {
10
- size: 'm' | 's';
11
- }, never>;
12
- export declare const StyledReadonlyPillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
13
- export declare const StyledRemovablePillWrapper: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {
14
- size: 'm' | 's';
15
- }, never>;
16
- export declare const StyledPillGroup: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@elliemae/ds-grid/dist/types/types").GridPropsT & import("react").RefAttributes<HTMLDivElement>>, import("styled-components").DefaultTheme, {}, never>;
17
- export declare const StyledSpanWithTooltip: import("styled-components").StyledComponent<"span", import("styled-components").DefaultTheme, {}, never>;
18
- export declare const StyledPillButton: import("styled-components").StyledComponent<{
19
- (props: import("@elliemae/ds-button/dist/types/v2/propTypes").DSButtonPropsT): JSX.Element;
20
- propTypes: import("react").WeakValidationMap<unknown>;
21
- }, import("styled-components").DefaultTheme, {
22
- width: string;
23
- height: string;
24
- }, never>;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { DSPillProps } from '../../index.d';
3
- export declare const DropdownPill: React.NamedExoticComponent<DSPillProps>;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { DSPillProps } from '../../index.d';
3
- export declare const InputPill: React.NamedExoticComponent<DSPillProps>;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { DSPillProps } from '../../index.d';
3
- export declare const LabelPill: React.NamedExoticComponent<DSPillProps>;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { DSPillProps } from '../../index.d';
3
- export declare const ReadOnlyPill: React.NamedExoticComponent<DSPillProps>;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { DSPillProps } from '../../index.d';
3
- export declare const RemovablePill: React.NamedExoticComponent<DSPillProps>;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import type { DSPillProps } from '../../index.d';
3
- export declare const ValuePill: React.NamedExoticComponent<DSPillProps>;
@@ -1,6 +0,0 @@
1
- export * from './DropdownPill';
2
- export * from './InputPill';
3
- export * from './LabelPill';
4
- export * from './ReadOnlyPill';
5
- export * from './RemovablePill';
6
- export * from './ValuePill';
@@ -1,66 +0,0 @@
1
- /// <reference path="../../../../../shared/typings/react-desc.d.ts" />
2
- /// <reference types="react" />
3
- declare function DropdownPill({ containerProps, label, variant, tabIndex, closeMenuOnItemSelection, maxWidth, minWidth, ...dropdownProps }: {
4
- [x: string]: any;
5
- containerProps?: {} | undefined;
6
- label?: string | undefined;
7
- variant: any;
8
- tabIndex?: number | undefined;
9
- closeMenuOnItemSelection?: boolean | undefined;
10
- maxWidth: any;
11
- minWidth: any;
12
- }): JSX.Element;
13
- declare namespace DropdownPill {
14
- var propTypes: {
15
- /** props injected to component wrapper */
16
- containerProps: {
17
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
18
- deprecated: import("react-desc").PropTypesDescValidator;
19
- };
20
- isRequired: import("react-desc").PropTypesDescValue;
21
- };
22
- /** labeled pill text label */
23
- label: any;
24
- /** pill variant */
25
- variant: {
26
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
27
- deprecated: import("react-desc").PropTypesDescValidator;
28
- };
29
- isRequired: import("react-desc").PropTypesDescValue;
30
- };
31
- /** html focus border */
32
- tabIndex: {
33
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
34
- deprecated: import("react-desc").PropTypesDescValidator;
35
- };
36
- isRequired: import("react-desc").PropTypesDescValue;
37
- };
38
- /** close menu on item selection */
39
- closeMenuOnItemSelection: {
40
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
41
- deprecated: import("react-desc").PropTypesDescValidator;
42
- };
43
- isRequired: import("react-desc").PropTypesDescValue;
44
- };
45
- /** pill max width */
46
- maxWidth: {
47
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
48
- deprecated: import("react-desc").PropTypesDescValidator;
49
- };
50
- isRequired: import("react-desc").PropTypesDescValue;
51
- };
52
- /** pill min width */
53
- minWidth: {
54
- defaultValue(arg: import("react-desc").ReactDescPossibleDefaultValues): {
55
- deprecated: import("react-desc").PropTypesDescValidator;
56
- };
57
- isRequired: import("react-desc").PropTypesDescValue;
58
- };
59
- };
60
- }
61
- declare const DSDropdownPillWithSchema: {
62
- (props?: unknown): JSX.Element;
63
- propTypes: unknown;
64
- toTypescript: () => import("react-desc").TypescriptSchema;
65
- };
66
- export { DropdownPill, DSDropdownPillWithSchema };
@@ -1,10 +0,0 @@
1
- /// <reference types="react" />
2
- export declare function InputPill({ containerProps, placeholder, onChange, onRemove, value, type, ...otherProps }: {
3
- [x: string]: any;
4
- containerProps?: {} | undefined;
5
- placeholder?: string | undefined;
6
- onChange?: (() => void) | undefined;
7
- onRemove: any;
8
- value: any;
9
- type: any;
10
- }): JSX.Element;