@procore/core-react 11.8.0-rc.6 → 11.8.0-rc.9

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 (120) hide show
  1. package/dist/Field/Field.d.ts +12 -0
  2. package/dist/Field/Field.js +50 -0
  3. package/dist/Field/Field.js.map +1 -0
  4. package/dist/Field/Field.styles.d.ts +3 -0
  5. package/dist/Field/Field.styles.js +11 -0
  6. package/dist/Field/Field.styles.js.map +1 -0
  7. package/dist/Field/index.d.ts +1 -0
  8. package/dist/Field/index.js +2 -0
  9. package/dist/Field/index.js.map +1 -0
  10. package/dist/Form/Form.js +6 -3
  11. package/dist/Form/Form.js.map +1 -1
  12. package/dist/Form/Form.styles.d.ts +5 -2
  13. package/dist/Form/Form.styles.js +6 -4
  14. package/dist/Form/Form.styles.js.map +1 -1
  15. package/dist/Semantic/Semantic.d.ts +4 -0
  16. package/dist/Semantic/Semantic.js +5 -1
  17. package/dist/Semantic/Semantic.js.map +1 -1
  18. package/dist/Semantic/Semantic.styles.d.ts +9 -0
  19. package/dist/Semantic/Semantic.styles.js +26 -8
  20. package/dist/Semantic/Semantic.styles.js.map +1 -1
  21. package/dist/Semantic/index.d.ts +1 -1
  22. package/dist/Semantic/index.js +1 -1
  23. package/dist/Semantic/index.js.map +1 -1
  24. package/dist/SuperSelect/SuperSelect.components.d.ts +36 -0
  25. package/dist/SuperSelect/SuperSelect.components.js +249 -0
  26. package/dist/SuperSelect/SuperSelect.components.js.map +1 -0
  27. package/dist/SuperSelect/SuperSelect.d.ts +142 -46
  28. package/dist/SuperSelect/SuperSelect.js +50 -203
  29. package/dist/SuperSelect/SuperSelect.js.map +1 -1
  30. package/dist/SuperSelect/SuperSelect.presets.d.ts +2 -0
  31. package/dist/SuperSelect/SuperSelect.presets.js +104 -0
  32. package/dist/SuperSelect/SuperSelect.presets.js.map +1 -0
  33. package/dist/SuperSelect/SuperSelect.styles.d.ts +61 -26
  34. package/dist/SuperSelect/SuperSelect.styles.js +127 -25
  35. package/dist/SuperSelect/SuperSelect.styles.js.map +1 -1
  36. package/dist/SuperSelect/SuperSelect.types.d.ts +19 -61
  37. package/dist/SuperSelect/SuperSelect.types.js.map +1 -1
  38. package/dist/SuperSelect/useSuperSelect.d.ts +417 -47
  39. package/dist/SuperSelect/useSuperSelect.js +230 -116
  40. package/dist/SuperSelect/useSuperSelect.js.map +1 -1
  41. package/dist/Typography/Typography.styles.d.ts +1 -2
  42. package/dist/Typography/Typography.styles.js +6 -3
  43. package/dist/Typography/Typography.styles.js.map +1 -1
  44. package/dist/Typography/Typography.types.d.ts +1 -1
  45. package/dist/_typedoc/Avatar/Avatar.types.json +20 -20
  46. package/dist/_typedoc/AvatarStack/AvatarStack.types.json +22 -22
  47. package/dist/_typedoc/Badge/Badge.types.json +6 -6
  48. package/dist/_typedoc/Banner/Banner.types.json +13 -13
  49. package/dist/_typedoc/Box/Box.types.json +68 -68
  50. package/dist/_typedoc/Breadcrumbs/Breadcrumbs.types.json +10 -10
  51. package/dist/_typedoc/Button/Button.types.json +11 -11
  52. package/dist/_typedoc/Calendar/Calendar.types.json +80 -80
  53. package/dist/_typedoc/Card/Card.types.json +6 -6
  54. package/dist/_typedoc/Checkbox/Checkbox.types.json +7 -7
  55. package/dist/_typedoc/ContactItem/ContactItem.types.json +9 -9
  56. package/dist/_typedoc/DateInput/DateInput.types.json +35 -35
  57. package/dist/_typedoc/DateSelect/DateSelect.types.json +13 -13
  58. package/dist/_typedoc/DetailPage/DetailPage.types.json +4 -4
  59. package/dist/_typedoc/Dropdown/Dropdown.types.json +37 -37
  60. package/dist/_typedoc/DropdownFlyout/DropdownFlyout.types.json +29 -29
  61. package/dist/_typedoc/Dropzone/Dropzone.types.json +41 -41
  62. package/dist/_typedoc/EmptyState/EmptyState.types.json +14 -14
  63. package/dist/_typedoc/FileList/FileList.types.json +9 -9
  64. package/dist/_typedoc/FileSelect/FileSelect.types.json +26 -26
  65. package/dist/_typedoc/FileSelect/GridSource/GridSource.types.json +20 -20
  66. package/dist/_typedoc/FileSelect/LocalSource/LocalSource.types.json +14 -14
  67. package/dist/_typedoc/FileSelect/TreeSource/TreeSource.types.json +9 -9
  68. package/dist/_typedoc/Flex/Flex.types.json +27 -27
  69. package/dist/_typedoc/FlexList/FlexList.types.json +30 -30
  70. package/dist/_typedoc/Form/Form.types.json +694 -694
  71. package/dist/_typedoc/Grid/Grid.types.json +8 -8
  72. package/dist/_typedoc/GroupSelect/GroupSelect.types.json +52 -52
  73. package/dist/_typedoc/Input/Input.types.json +2 -2
  74. package/dist/_typedoc/Link/Link.types.json +4 -4
  75. package/dist/_typedoc/ListPage/ListPage.types.json +13 -13
  76. package/dist/_typedoc/Menu/Menu.types.json +62 -62
  77. package/dist/_typedoc/MenuImperative/MenuImperative.types.json +71 -71
  78. package/dist/_typedoc/Modal/Modal.types.json +28 -28
  79. package/dist/_typedoc/MultiSelect/MultiSelect.types.json +31 -31
  80. package/dist/_typedoc/Notation/Notation.types.json +4 -4
  81. package/dist/_typedoc/NumberInput/NumberInput.types.json +43 -43
  82. package/dist/_typedoc/PageLayout/PageLayout.types.json +22 -22
  83. package/dist/_typedoc/Pagination/Pagination.types.json +7 -7
  84. package/dist/_typedoc/Panel/Panel.types.json +27 -27
  85. package/dist/_typedoc/Pill/Pill.types.json +1 -1
  86. package/dist/_typedoc/PillSelect/PillSelect.types.json +46 -46
  87. package/dist/_typedoc/Popover/Popover.types.json +10 -10
  88. package/dist/_typedoc/ProgressBar/ProgressBar.types.json +6 -6
  89. package/dist/_typedoc/RadioButton/RadioButton.types.json +6 -6
  90. package/dist/_typedoc/Required/Required.types.json +5 -5
  91. package/dist/_typedoc/Search/Search.types.json +18 -18
  92. package/dist/_typedoc/Section/Section.types.json +14 -14
  93. package/dist/_typedoc/SegmentedController/SegmentedController.types.json +20 -20
  94. package/dist/_typedoc/Select/Select.types.json +31 -31
  95. package/dist/_typedoc/Slider/Slider.types.json +6 -6
  96. package/dist/_typedoc/Spinner/Spinner.types.json +9 -9
  97. package/dist/_typedoc/Switch/Switch.types.json +3 -3
  98. package/dist/_typedoc/Table/Table.types.json +94 -94
  99. package/dist/_typedoc/Tabs/Tabs.types.json +17 -17
  100. package/dist/_typedoc/Tearsheet/Tearsheet.types.json +10 -10
  101. package/dist/_typedoc/TextArea/TextArea.types.json +3 -3
  102. package/dist/_typedoc/TextEditor/TextEditor.types.json +7 -7
  103. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +3 -3
  104. package/dist/_typedoc/Thumbnail/Thumbnail.types.json +19 -19
  105. package/dist/_typedoc/TieredDropdown/TieredDropdown.types.json +42 -42
  106. package/dist/_typedoc/TieredSelect/TieredSelect.types.json +28 -28
  107. package/dist/_typedoc/Tile/Tile.types.json +30 -30
  108. package/dist/_typedoc/Toast/Toast.types.json +4 -4
  109. package/dist/_typedoc/ToggleButton/ToggleButton.types.json +3 -3
  110. package/dist/_typedoc/Token/Token.types.json +4 -4
  111. package/dist/_typedoc/ToolHeader/ToolHeader.types.json +10 -10
  112. package/dist/_typedoc/Tooltip/Tooltip.types.json +13 -13
  113. package/dist/_typedoc/Tree/Tree.types.json +86 -86
  114. package/dist/_typedoc/Typeahead/Typeahead.types.json +2 -2
  115. package/dist/_typedoc/Typography/Typography.types.json +9 -9
  116. package/dist/_typedoc/_utils/types.json +3 -3
  117. package/package.json +5 -3
  118. package/dist/SuperSelect/SuperSelectDraggableOptions.d.ts +0 -12
  119. package/dist/SuperSelect/SuperSelectDraggableOptions.js +0 -61
  120. package/dist/SuperSelect/SuperSelectDraggableOptions.js.map +0 -1
@@ -9,219 +9,66 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { FloatingFocusManager, FloatingPortal, } from '@floating-ui/react-dom-interactions';
24
- import { Clear } from '@procore/core-icons';
13
+ import merge from 'lodash.merge';
25
14
  import React from 'react';
26
- import { Box } from '../Box/Box';
27
- import { StyledFooter, StyledHeader, StyledSearch, } from '../MenuImperative/MenuImperative.styles';
28
- import { StyledMultiSelectArrow, StyledMultiSelectArrowContainer, StyledMultiSelectButton, StyledMultiSelectClearIcon, StyledMultiSelectSearch, StyledMultiSelectSearchIcon, StyledMultiSelectSearchInput, StyledMultiSelectToken, StyledMultiSelectValues, } from '../MultiSelect/MultiSelect.styles';
29
- import { Button } from '../Select/Select';
30
- import { Spinner } from '../Spinner/Spinner';
31
- import { Token } from '../Token/Token';
32
- import { Typeahead } from '../Typeahead/Typeahead';
33
- import { Typography } from '../Typography/Typography';
15
+ import { DragDropContext, Droppable } from 'react-beautiful-dnd';
16
+ import { Virtuoso } from 'react-virtuoso';
34
17
  import { useI18nContext } from '../_hooks/I18n';
35
- import { spacing } from '../_styles/spacing';
36
- import { StyledGroup, StyledGroupHeaderLabel, StyledItem, StyledItemAvatar, StyledItemAvatarWrapper, StyledItemContent, StyledItemLabelWrapper, StyledItemTitle, StyledLabel, StyledOptions, StyledOverlay, StyledVirtuoso, } from './SuperSelect.styles';
37
- import { InternalDragDropContext, SuperSelectDraggableOptions, } from './SuperSelectDraggableOptions';
38
- import { useSuperSelect } from './useSuperSelect';
18
+ import { DraggableOptionContent, OptionContent } from './SuperSelect.components';
19
+ import { presets } from './SuperSelect.presets';
20
+ import { SuperSelectContext, useSuperSelect } from './useSuperSelect';
39
21
  import { useVirtuosoResizeErrorFix } from './useVirtuosoResizeErrorFix';
40
- var SuperSelectContext = React.createContext(null);
41
- var SuperSelectLabel = function (_a) {
42
- var selectApi = _a.selectApi;
43
- return React.createElement(React.Fragment, null, selectApi.selectedLabel);
44
- };
45
- var SuperSelectToken = function (_a) {
46
- var selectApi = _a.selectApi, option = _a.option, focused = _a.focused, index = _a.index;
47
- return (React.createElement(StyledMultiSelectToken, null,
48
- React.createElement(Token, { focused: focused },
49
- React.createElement(Token.Label, null, selectApi.getOptionLabel(option)),
50
- React.createElement(Token.Remove, __assign({}, selectApi.getTokenClearProps(index))))));
51
- };
52
- function SuperSelectMenuGroupHeader(_a) {
53
- var optgroup = _a.optgroup;
54
- return React.createElement(StyledGroupHeaderLabel, null, optgroup.label);
55
- }
56
- function SuperSelectMenuItemLabel(_a) {
57
- var option = _a.option, selectApi = _a.selectApi;
58
- if (selectApi.getOptionAvatar || selectApi.getOptionTitle) {
59
- return (React.createElement(StyledItemContent, null,
60
- selectApi.getOptionAvatar && (React.createElement(StyledItemAvatarWrapper, null,
61
- React.createElement(StyledItemAvatar, null,
62
- React.createElement(StyledItemAvatar.Portrait, { imageUrl: selectApi.getOptionAvatar(option) })))),
63
- React.createElement(StyledItemLabelWrapper, null,
64
- selectApi.getOptionTitle && (React.createElement(StyledItemTitle, { weight: "bold", color: "gray15" }, selectApi.getOptionTitle(option))),
65
- selectApi.getOptionLabel(option))));
66
- }
67
- return (React.createElement(StyledLabel, { "$draggable": selectApi.draggable }, selectApi.getOptionLabel(option)));
68
- }
69
- var SuperSelectMenuItem = React.forwardRef(function (_a, ref) {
70
- var _b;
71
- var children = _a.children, _c = _a.isDragging, isDragging = _c === void 0 ? false : _c, props = __rest(_a, ["children", "isDragging"]);
72
- var selectApi = React.useContext(SuperSelectContext);
73
- var isDraggingOver = React.useContext(InternalDragDropContext).isDraggingOver;
74
- var _d = React.useState(0), size = _d[0], setSize = _d[1];
75
- var knownSize = (_b = props['data-known-size']) !== null && _b !== void 0 ? _b : 0;
76
- React.useEffect(function () {
77
- setSize(function (prevSize) { return (knownSize === 0 ? prevSize : knownSize); });
78
- }, [knownSize]);
79
- if (!selectApi) {
80
- return null;
81
- }
82
- var index = props['data-index'];
83
- var option = selectApi.options[index];
84
- if (!option) {
85
- return null;
86
- }
87
- var disabled = selectApi.getOptionIsDisabled(option);
88
- var isOptgroup = selectApi.getOptionIsOptgroup(option);
89
- var value = selectApi === null || selectApi === void 0 ? void 0 : selectApi.getOptionValue(option);
90
- function setNode(node) {
91
- if (selectApi) {
92
- selectApi.navigationListRef.current[index] = node;
93
- }
94
- }
95
- if (isOptgroup) {
96
- return (React.createElement(StyledGroup, __assign({}, props, selectApi.getItemProps(), { role: "separator", "aria-disabled": true }), children));
97
- }
98
- return (React.createElement(StyledItem, __assign({}, props, selectApi.getItemProps({
99
- onClick: function () {
100
- selectApi === null || selectApi === void 0 ? void 0 : selectApi.onSelect(option);
101
- },
102
- }), { ref: setNode, id: "item-".concat(value), role: "option", "aria-selected": selectApi.activeMenuIndex === index, "aria-setsize": selectApi.options.length || 0, "aria-posinset": index + 1, "$highlighted": selectApi.activeMenuIndex === index, "$disabled": selectApi.getOptionIsDisabled(option), "$selected": selectApi.isSelected(option), "$isDragging": isDragging, "$isDraggable": !disabled, "$isDraggingOver": isDraggingOver, "$isDraggingDisabled": Boolean(selectApi.searchValue), "$emptyMinHeight": size }), children));
22
+ export var InternalDragDropContext = React.createContext({
23
+ isDraggingOver: false,
103
24
  });
104
- var SingleSelectReference = React.forwardRef(function SingleSelect(_a, ref) {
105
- var _b, _c;
106
- var selectApi = _a.selectApi, _d = _a.block, block = _d === void 0 ? false : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.error, error = _f === void 0 ? false : _f, _g = _a.loading, loading = _g === void 0 ? false : _g, placeholder = _a.placeholder, _h = _a.tabIndex, tabIndex = _h === void 0 ? 0 : _h;
107
- var LabelComponent = (_c = (_b = selectApi.components) === null || _b === void 0 ? void 0 : _b['Label']) !== null && _c !== void 0 ? _c : SuperSelectLabel;
108
- var label = selectApi.selectedLabel ? (React.createElement(LabelComponent, { selectApi: selectApi })) : ('');
109
- return (React.createElement(Button, __assign({}, selectApi.getReferenceProps(), { ref: ref, block: block, disabled: disabled, error: error, isMenuOpened: selectApi.open, label: label, loading: loading, onClear: selectApi.getClearProps().onClick, open: selectApi.open, placeholder: placeholder, tabIndex: tabIndex, role: "combobox" })));
110
- });
111
- var MultiSelectReference = React.forwardRef(function MultiSelect(_a, ref) {
112
- var _b, _c, _d;
113
- var selectApi = _a.selectApi, _e = _a.block, block = _e === void 0 ? false : _e, _f = _a.disabled, disabled = _f === void 0 ? false : _f, _g = _a.error, error = _g === void 0 ? false : _g, _h = _a.loading, loading = _h === void 0 ? false : _h, placeholder = _a.placeholder, _j = _a.tabIndex, tabIndex = _j === void 0 ? 0 : _j;
114
- var searchRef = React.useRef(null);
115
- React.useEffect(function () {
116
- var _a;
117
- (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
118
- }, [selectApi.value]);
119
- if (!Array.isArray(selectApi.value)) {
120
- return null;
121
- }
122
- var TokenComponent = (_c = (_b = selectApi.components) === null || _b === void 0 ? void 0 : _b['Token']) !== null && _c !== void 0 ? _c : SuperSelectToken;
123
- return (React.createElement(StyledMultiSelectButton, __assign({}, selectApi.getReferenceProps({
124
- onClick: function () { var _a; return (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus(); },
125
- }), { ref: ref, "$block": block, "$error": error, "$emptyValue": selectApi.isEmpty(), "$disabled": disabled, "$hasClearIcon": !selectApi.isEmpty() && !loading, "$loading": loading, "$open": selectApi.open, tabIndex: tabIndex }),
126
- React.createElement(StyledMultiSelectValues, null, (_d = selectApi.value) === null || _d === void 0 ? void 0 :
127
- _d.map(function (val, j) {
128
- var option = selectApi.sourceOptions.find(function (o) { return selectApi.getOptionValue(o) === val; });
129
- return (option && (React.createElement(TokenComponent, { key: val.toString(), index: j, focused: j === selectApi.activeTokenIndex, option: option, selectApi: selectApi })));
130
- }),
131
- React.createElement(StyledMultiSelectSearch, null,
132
- React.createElement(StyledMultiSelectSearchInput, __assign({}, selectApi.getMultiInputProps(), { ref: searchRef, placeholder: selectApi.isEmpty() ? placeholder : '' })))),
133
- React.createElement(StyledMultiSelectSearchIcon, null,
134
- React.createElement(StyledMultiSelectClearIcon, __assign({}, selectApi.getClearProps(), { size: "sm", variant: "tertiary", disabled: disabled, icon: React.createElement(Clear, null), tabIndex: -1 })),
135
- loading ? (React.createElement(Spinner, { color: "blue50", size: "xs" })) : (React.createElement(StyledMultiSelectArrowContainer, null,
136
- React.createElement(StyledMultiSelectArrow, null))))));
137
- });
138
- function SelectComponent(_a, ref) {
139
- var _b, _c, _d, _e;
140
- var _f = _a.block, block = _f === void 0 ? false : _f, _g = _a.draggable, draggable = _g === void 0 ? false : _g, _h = _a.sort, sort = _h === void 0 ? true : _h, components = _a.components, defaultValue = _a.defaultValue, _j = _a.disabled, disabled = _j === void 0 ? false : _j, _k = _a.emptyMessage, emptyMessage = _k === void 0 ? 'No Results' : _k, _l = _a.error, error = _l === void 0 ? false : _l, footer = _a.footer, getOptionAvatar = _a.getOptionAvatar, getOptionGroup = _a.getOptionGroup, getOptionIcon = _a.getOptionIcon, setOptionGroup = _a.setOptionGroup, getOptionIsBatch = _a.getOptionIsBatch, getOptionIsDisabled = _a.getOptionIsDisabled, getOptionLabel = _a.getOptionLabel, getOptionTitle = _a.getOptionTitle, getOptionTooltip = _a.getOptionTooltip, getOptionValue = _a.getOptionValue, onManualSort = _a.onManualSort, header = _a.header, _m = _a.loading, loading = _m === void 0 ? false : _m, _o = _a.multiple, multiple = _o === void 0 ? false : _o, onChange = _a.onChange, options = _a.options, placeholder = _a.placeholder, _p = _a.search, search = _p === void 0 ? true : _p, _q = _a.tabIndex, tabIndex = _q === void 0 ? 0 : _q, value = _a.value;
141
- var I18n = useI18nContext();
25
+ var InternalDragDropProvider = function (_a) {
26
+ var isDraggingOver = _a.isDraggingOver, children = _a.children;
27
+ var value = React.useMemo(function () {
28
+ return {
29
+ isDraggingOver: isDraggingOver,
30
+ };
31
+ }, [isDraggingOver]);
32
+ return (React.createElement(InternalDragDropContext.Provider, { value: value }, children));
33
+ };
34
+ function SelectComponent(props, ref) {
142
35
  useVirtuosoResizeErrorFix();
143
- var selectApi = useSuperSelect({
144
- components: components,
145
- draggable: draggable,
146
- sort: sort,
147
- defaultValue: defaultValue,
148
- disabled: disabled,
149
- getOptionAvatar: getOptionAvatar,
150
- getOptionIcon: getOptionIcon,
151
- getOptionIsBatch: getOptionIsBatch,
152
- getOptionIsDisabled: getOptionIsDisabled,
153
- getOptionLabel: getOptionLabel,
154
- getOptionTitle: getOptionTitle,
155
- getOptionTooltip: getOptionTooltip,
156
- getOptionValue: getOptionValue,
157
- getOptionGroup: getOptionGroup,
158
- setOptionGroup: setOptionGroup,
159
- onManualSort: onManualSort,
160
- multiple: multiple,
161
- onChange: onChange,
162
- options: options,
163
- search: search,
164
- value: value,
165
- });
166
- var _r = React.useState(0), listHeight = _r[0], setListHeight = _r[1];
167
- var _s = React.useState(0), searchHeight = _s[0], setSearchHeight = _s[1];
168
- var _t = React.useState(0), footerHeight = _t[0], setFooterHeight = _t[1];
169
- var listContainerVerticalPadding = spacing.sm * 2;
170
- var listContainerHeight = Math.min(selectApi.maxHeight -
171
- searchHeight -
172
- footerHeight +
173
- listContainerVerticalPadding, listHeight + listContainerVerticalPadding);
174
- React.useImperativeHandle(ref, function () { return selectApi; });
36
+ var I18n = useI18nContext();
37
+ var search = props.search === undefined || props.search === true;
38
+ var config = __assign(__assign({}, props), { search: search });
39
+ console.log(props.placeholder);
40
+ var preset = props.preset || '';
41
+ var presetConfig = __assign({}, presets[preset]);
42
+ var ctx = useSuperSelect(merge(presetConfig, config));
43
+ React.useImperativeHandle(ref, function () { return ctx; });
175
44
  React.useEffect(function () {
176
- if (value && onChange === undefined) {
45
+ if (props.value && props.onChange === undefined) {
177
46
  console.warn('Must provide both a `value` and `onChange` prop for a controlled Select');
178
47
  }
179
48
  }, []);
180
- var ReferenceComponent = multiple
181
- ? MultiSelectReference
182
- : SingleSelectReference;
183
- var MenuItemLabelComponent = (_c = (_b = selectApi.components) === null || _b === void 0 ? void 0 : _b['MenuItemLabel']) !== null && _c !== void 0 ? _c : SuperSelectMenuItemLabel;
184
- var MenuGroupHeaderComponent = (_e = (_d = selectApi.components) === null || _d === void 0 ? void 0 : _d['MenuGroupHeader']) !== null && _e !== void 0 ? _e : SuperSelectMenuGroupHeader;
185
- var getItemContent = function (_, option) {
186
- if (selectApi.getOptionIsOptgroup(option)) {
187
- return (React.createElement(MenuGroupHeaderComponent, { optgroup: option, selectApi: selectApi }));
188
- }
189
- return React.createElement(MenuItemLabelComponent, { option: option, selectApi: selectApi });
190
- };
191
- return (React.createElement(SuperSelectContext.Provider, { value: selectApi },
192
- React.createElement(ReferenceComponent, { ref: selectApi.floating.reference, search: search, selectApi: selectApi, block: block, loading: loading, disabled: disabled, placeholder: placeholder, error: error, tabIndex: tabIndex }),
193
- React.createElement(FloatingPortal, null, selectApi.open && (React.createElement(FloatingFocusManager, { context: selectApi.floating.context, order: search ? ['content', 'reference'] : ['reference', 'content'], initialFocus: multiple ? false : 0 },
194
- React.createElement(StyledOverlay, __assign({}, selectApi.getFloatingProps(), { role: search ? 'dialog' : 'none', ref: selectApi.floating.floating, id: selectApi.overlayId, style: {
195
- position: selectApi.floating.strategy,
196
- left: selectApi.floating.x || 0,
197
- top: selectApi.floating.y || 0,
198
- width: selectApi.width,
199
- maxHeight: selectApi.maxHeight,
200
- zIndex: 10,
201
- } }),
202
- search && !multiple && (React.createElement(StyledSearch, { ref: function (el) {
203
- var _a;
204
- setSearchHeight((_a = el === null || el === void 0 ? void 0 : el.clientHeight) !== null && _a !== void 0 ? _a : 0);
205
- } },
206
- React.createElement(Typeahead, __assign({}, selectApi.getTypeaheadProps(), { placeholder: I18n.t('core.select.search') })))),
207
- header && (React.createElement(StyledHeader, null,
208
- React.createElement("div", null, header))),
209
- selectApi.options.length > 0 ? (React.createElement(StyledOptions, { "$scrollable": false, style: {
210
- height: listContainerHeight,
211
- } }, draggable ? (React.createElement(SuperSelectDraggableOptions, { selectApi: selectApi, SuperSelectMenuItem: SuperSelectMenuItem, MenuItemLabelComponent: MenuItemLabelComponent, MenuGroupHeaderComponent: MenuGroupHeaderComponent, onListHeightChange: setListHeight })) : (React.createElement(StyledVirtuoso, { role: "listbox", id: selectApi.overlayId, ref: selectApi.virtuoso, data: selectApi.options, components: {
212
- Item: SuperSelectMenuItem,
213
- }, itemContent: getItemContent, initialTopMostItemIndex: selectApi.selectedIndex >= 0
214
- ? selectApi.selectedIndex
215
- : 0, totalListHeightChanged: setListHeight, tabIndex: -1 })))) : (React.createElement(Box, { padding: "md lg" },
216
- React.createElement(Typography, { italic: true, color: "gray50" }, emptyMessage))),
217
- footer && (React.createElement(StyledFooter, { ref: function (el) {
218
- var _a;
219
- setFooterHeight((_a = el === null || el === void 0 ? void 0 : el.clientHeight) !== null && _a !== void 0 ? _a : 0);
220
- }, onKeyDown: function (e) {
221
- if (e.key !== 'Escape') {
222
- e.stopPropagation();
223
- }
224
- }, padding: "md lg" }, footer))))))));
49
+ return (React.createElement(SuperSelectContext.Provider, { value: ctx },
50
+ React.createElement(ctx.components.Trigger, __assign({ ref: ctx.refs.floating.reference }, ctx.props.trigger())),
51
+ React.createElement(FloatingPortal, null, ctx.state.open && (React.createElement(FloatingFocusManager, { context: ctx.refs.floating.context, order: config.search
52
+ ? ['content', 'reference']
53
+ : ['reference', 'content'], initialFocus: config.multiple ? false : 0 },
54
+ React.createElement(ctx.components.Overlay, __assign({ ref: ctx.refs.floating.floating }, ctx.props.overlay()),
55
+ (config.search === true ||
56
+ (config.search === undefined && !config.multiple)) && (React.createElement(ctx.components.SearchContainer, __assign({}, ctx.props.searchContainer()),
57
+ React.createElement(ctx.components.Search, __assign({}, ctx.props.search())))),
58
+ config.header && (React.createElement(ctx.components.Header, __assign({}, ctx.props.header()), config.header)),
59
+ ctx.state.options.length > 0 ? (React.createElement(ctx.components.Options, null, config.draggable ? (React.createElement(DragDropContext, { onDragEnd: ctx.state.onDragEnd },
60
+ React.createElement(Droppable, { droppableId: "droppable", mode: "virtual", renderClone: function (provided, snapshot, dragged) {
61
+ var option = ctx.state.options[dragged.source.index];
62
+ return (React.createElement(ctx.components.Item, __assign({ isDragging: true, "data-index": dragged.source.index }, provided.draggableProps),
63
+ React.createElement(ctx.components.DragHandle, null),
64
+ React.createElement(ctx.components.OptionLabel, { option: option })));
65
+ } }, function (provided, snapshot) {
66
+ return (React.createElement(InternalDragDropProvider, { isDraggingOver: snapshot.isDraggingOver },
67
+ React.createElement(Virtuoso, __assign({}, ctx.props.virtuoso(), { scrollerRef: function (el) {
68
+ return provided.innerRef(el);
69
+ }, itemContent: function (i, data) { return (React.createElement(DraggableOptionContent, { index: i, option: data })); } }))));
70
+ }))) : (React.createElement(Virtuoso, __assign({}, ctx.props.virtuoso(), { ref: ctx.refs.virtuoso, itemContent: function (i, option) { return (React.createElement(OptionContent, { option: option })); } }))))) : (React.createElement(ctx.components.EmptyMessage, __assign({}, ctx.props.emptyMessage()))),
71
+ config.footer && (React.createElement(ctx.components.Footer, __assign({}, ctx.props.footer())))))))));
225
72
  }
226
73
  export var SuperSelect = React.forwardRef(SelectComponent);
227
74
  //# sourceMappingURL=SuperSelect.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SuperSelect.js","sourceRoot":"","sources":["../../src/SuperSelect/SuperSelect.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EACL,oBAAoB,EACpB,cAAc,GACf,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAA;AAChC,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,YAAY,GACb,MAAM,yCAAyC,CAAA;AAChD,OAAO,EACL,sBAAsB,EACtB,+BAA+B,EAC/B,uBAAuB,EACvB,0BAA0B,EAC1B,uBA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electPreset } from './SuperSelect.types';
2
+ export declare const presets: Record<SuperSelectPreset, SuperSelectConfig>;
@@ -0,0 +1,104 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { Check } from '@procore/core-icons';
24
+ import React from 'react';
25
+ import { ContactItem } from '../ContactItem';
26
+ import { Pill } from '../Pill/Pill';
27
+ import { PillSelectCheckedContainer } from '../PillSelect/PillSelect.styles';
28
+ import { Tooltip } from '../Tooltip/Tooltip';
29
+ import { OverflowObserver } from '../_hooks/OverflowObserver';
30
+ import { Label } from './SuperSelect.components';
31
+ import { PillSelectLabel, PillSelectLabelWrapper, PillSelectOptionWrapper, StyledLabel, } from './SuperSelect.styles';
32
+ import { useSuperSelectContext } from './useSuperSelect';
33
+ var pill = {
34
+ components: {
35
+ Label: React.forwardRef(function (_a, ref) {
36
+ var hoverable = _a.hoverable;
37
+ var ctx = useSuperSelectContext();
38
+ return (React.createElement(StyledLabel, { "$hoverable": hoverable },
39
+ React.createElement(PillSelectLabelWrapper, null,
40
+ React.createElement(OverflowObserver, null, function (_a) {
41
+ var _b;
42
+ var isOverflowing = _a.isOverflowing, ref = _a.ref;
43
+ return (React.createElement(Tooltip, { trigger: isOverflowing ? 'hover' : 'none', overlay: ctx.state.selectedLabel }, ctx.state.isEmpty() ? (React.createElement(Label, { ref: ref, hoverable: hoverable })) : (React.createElement(PillSelectLabel, { ref: ref, color: (_b = ctx.state.selectedOption) === null || _b === void 0 ? void 0 : _b.color }, ctx.state.selectedLabel))));
44
+ }))));
45
+ }),
46
+ OptionLabel: function (_a) {
47
+ var option = _a.option;
48
+ var ctx = useSuperSelectContext();
49
+ return (React.createElement(PillSelectOptionWrapper, null,
50
+ React.createElement(Pill, { color: option.color }, ctx.option.label(option)),
51
+ React.createElement(PillSelectCheckedContainer, null, ctx.option.isSelected(option) && React.createElement(Check, { size: "sm" }))));
52
+ },
53
+ MultiValue: function (_a) {
54
+ var option = _a.option;
55
+ var ctx = useSuperSelectContext();
56
+ return React.createElement(Pill, { color: option.color }, ctx.option.label(option));
57
+ },
58
+ },
59
+ };
60
+ var filter = {
61
+ multiple: true,
62
+ components: {
63
+ Label: React.forwardRef(function () {
64
+ var ctx = useSuperSelectContext();
65
+ return (React.createElement(StyledLabel, { "$hoverable": false },
66
+ ctx.config.placeholder,
67
+ ctx.state.selectedLabel));
68
+ }),
69
+ MultiValueContainer: function () {
70
+ var ctx = useSuperSelectContext();
71
+ if (Array.isArray(ctx.state.value)) {
72
+ var label = ctx.state.value.length > 1
73
+ ? "(".concat(ctx.state.value.length, ")")
74
+ : ctx.state.value.length === 1
75
+ ? "".concat(ctx.state.selectedLabel)
76
+ : '';
77
+ return (React.createElement(StyledLabel, { "$hoverable": false },
78
+ ctx.config.placeholder,
79
+ " ",
80
+ label));
81
+ }
82
+ return React.createElement("div", null, "Value is not an array");
83
+ },
84
+ },
85
+ selectionStyle: 'checkbox',
86
+ };
87
+ var contacts = {
88
+ selectionStyle: 'checkmark',
89
+ components: {
90
+ OptionLabel: function (_a) {
91
+ var option = _a.option, props = __rest(_a, ["option"]);
92
+ return (React.createElement(ContactItem, __assign({}, props, { initials: option.initials, icon: option.icon, disabled: option.disabled }),
93
+ React.createElement(ContactItem.Title, null, option.title),
94
+ React.createElement(ContactItem.Description, null, option.description)));
95
+ },
96
+ },
97
+ };
98
+ export var presets = {
99
+ '': {},
100
+ contacts: contacts,
101
+ filter: filter,
102
+ pill: pill,
103
+ };
104
+ //# sourceMappingURL=SuperSelect.presets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuperSelect.presets.js","sourceRoot":"","sources":["../../src/SuperSelect/SuperSelect.presets.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAA;AAChD,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,WAAW,GACZ,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAExD,IAAM,IAAI,GAAsB;IAC9B,UAAU,EAAE;QACV,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,UAAC,EAAa,EAAE,GAAG;gBAAhB,SAAS,eAAA;YAClC,IAAM,GAAG,GAAG,qBAAqB,EAAE,CAAA;YAEnC,OAAO,CACL,oBAAC,WAAW,kBAAa,SAAS;gBAChC,oBAAC,sBAAsB;oBACrB,oBAAC,gBAAgB,QACd,UAAC,EAAsB;;4BAApB,aAAa,mBAAA,EAAE,GAAG,SAAA;wBACpB,OAAO,CACL,oBAAC,OAAO,IACN,O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AAK,QAAE,MAAM,CAAC,KAAK,CAAqB;gBACrD,oBAAC,WAAW,CAAC,WAAW,QACrB,MAAM,CAAC,WAAW,CACK,CACd,CACf,CAAA;QACH,CAAC;KACF;CACF,CAAA;AAED,MAAM,CAAC,IAAM,OAAO,GAAiD;IACnE,EAAE,EAAE,EAAE;IACN,QAAQ,UAAA;IACR,MAAM,QAAA;IACN,IAAI,MAAA;CACL,CAAA"}
@@ -1,40 +1,75 @@
1
1
  /// <reference types="react" />
2
- export declare const StyledOverlay: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../_utils/types").DivAttributes & import("..").CardProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
3
- export declare const StyledVirtuoso: import("styled-components").StyledComponent<(<ItemData = any, Context = any>(props: import("react-virtuoso").VirtuosoProps<ItemData, Context> & {
4
- ref?: any;
5
- }) => ReactElement), any, {}, never>;
6
- export declare const StyledEllipses: import("styled-components").StyledComponent<"div", any, {}, never>;
2
+ export declare const dataQa: {
3
+ focused: string;
4
+ hovered: string;
5
+ };
6
+ export declare const PillSelectOptionWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
7
+ export declare const PillSelectLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("..").PillProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
8
+ export declare const PillSelectLabelWrapper: import("styled-components").StyledComponent<"div", any, {
9
+ disabled?: boolean | undefined;
10
+ }, never>;
11
+ export declare const StyledCheckboxContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
12
+ export declare const StyledCheckmarkContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
13
+ export declare const StyledWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
14
+ export declare const StyledMenu: import("styled-components").StyledComponent<"div", any, {}, never>;
15
+ export declare const StyledOptions: import("styled-components").StyledComponent<"div", any, {
16
+ $scrollable?: boolean | undefined;
17
+ }, never>;
7
18
  export declare const StyledItemContent: import("styled-components").StyledComponent<"div", any, {}, never>;
8
- export declare const StyledItemAvatarWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
9
- export declare const StyledItemAvatar: import("styled-components").StyledComponent<(<Role extends import("../Avatar/Avatar.types").AvatarRoles>(props: import("..").AvatarProps<Role> | (import("../Avatar/Avatar.types").BaseAvatarProps & {
10
- ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
11
- })) => JSX.Element) & {
12
- Icon: import("react").ForwardRefExoticComponent<import("../_utils/types").DivAttributes & import("..").AvatarIconProps & import("react").RefAttributes<HTMLDivElement>>;
13
- Label: import("react").ForwardRefExoticComponent<import("../_utils/types").DivAttributes & import("../Avatar/Avatar.types").AvatarLabelProps & import("react").RefAttributes<HTMLDivElement>>;
14
- Portrait: import("react").ForwardRefExoticComponent<import("../_utils/types").DivAttributes & import("..").AvatarPortraitProps & import("react").RefAttributes<HTMLDivElement>>;
15
- }, any, {}, never>;
16
- export declare const StyledItemLabelWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
17
- export declare const StyledItemTitle: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../_utils/types").SpanAttributes & import("..").TypographyProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
18
- export declare const StyledItemLabel: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../_utils/types").SpanAttributes & import("..").TypographyProps & import("react").RefAttributes<HTMLSpanElement>>, any, {}, never>;
19
- export declare const StyledLabel: import("styled-components").StyledComponent<"div", any, {
19
+ export declare const StyledOptionGroupLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
20
+ export declare const StyledItemLabel: import("styled-components").StyledComponent<"div", any, {
20
21
  $draggable?: boolean | undefined;
22
+ $selectionStyle?: "checkbox" | "highlight" | "checkmark" | undefined;
21
23
  }, never>;
22
24
  export declare const StyledDraggableWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
25
+ export declare const StyledGrip: import("styled-components").StyledComponent<"div", any, {}, never>;
26
+ export declare const StyledFooter: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../_utils/types").DivAttributes & import("..").BoxProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
27
+ export declare const StyledHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
28
+ export declare const StyledEmptyMessage: import("styled-components").StyledComponent<"div", any, {}, never>;
29
+ export declare const StyledSearchContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
30
+ export declare const StyledGroup: import("styled-components").StyledComponent<"div", any, {
31
+ $clickable?: boolean | undefined;
32
+ }, never>;
23
33
  export declare const StyledItem: import("styled-components").StyledComponent<"div", any, {
24
34
  $disabled?: boolean | undefined;
25
35
  $selected?: boolean | undefined;
26
36
  $highlighted?: boolean | undefined;
27
37
  $isDraggable?: boolean | undefined;
28
38
  $isDragging?: boolean | undefined;
29
- } & {
30
- $emptyMinHeight: number;
31
- $isDraggingOver: boolean;
32
- $isDraggingDisabled: boolean;
39
+ $emptyMinHeight?: number | undefined;
40
+ $isDraggingOver?: boolean | undefined;
41
+ $isDraggingDisabled?: boolean | undefined;
33
42
  }, never>;
34
- export declare const StyledGroupHeaderLabel: import("styled-components").StyledComponent<"div", any, {}, never>;
35
- export declare const StyledGroup: import("styled-components").StyledComponent<"div", any, {
36
- $clickable?: boolean | undefined;
43
+ export declare const StyledDroppable: import("styled-components").StyledComponent<"div", any, {}, never>;
44
+ export declare const StyledSelectMenu: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../_utils/types").DivAttributes & import("..").CardProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
45
+ export declare const StyledLabel: import("styled-components").StyledComponent<"div", any, {
46
+ $hoverable: boolean;
37
47
  }, never>;
38
- export declare const StyledOptions: import("styled-components").StyledComponent<"div", any, {
39
- $scrollable?: boolean | undefined;
48
+ export declare const StyledIndicators: import("styled-components").StyledComponent<"div", any, {}, never>;
49
+ export declare const StyledClearIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../Button").ButtonProps & import("react").RefAttributes<HTMLButtonElement>>, any, {}, never>;
50
+ export declare const StyledSpinner: import("styled-components").StyledComponent<"div", any, {}, never>;
51
+ export declare const StyledArrowContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
52
+ export declare const StyledArrow: import("styled-components").StyledComponent<"span", any, {}, never>;
53
+ export declare const StyledArrowOutline: import("styled-components").StyledComponent<"polygon", any, {}, never>;
54
+ export declare const StyledArrowFill: import("styled-components").StyledComponent<"polygon", any, {}, never>;
55
+ export declare const StyledTrigger: import("styled-components").StyledComponent<"div", any, {
56
+ $block?: boolean | undefined;
57
+ $disabled?: boolean | undefined;
58
+ $error?: boolean | undefined;
59
+ $hasClearIcon?: boolean | undefined;
60
+ $loading?: boolean | undefined;
61
+ $multiple?: boolean | undefined;
62
+ $open?: boolean | undefined;
63
+ $placeholder?: boolean | undefined;
64
+ }, never>;
65
+ export declare const StyledOverlay: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../_utils/types").DivAttributes & import("..").CardProps & import("react").RefAttributes<HTMLDivElement>>, any, {}, never>;
66
+ export declare const StyledVirtuoso: import("styled-components").StyledComponent<(<ItemData = any, Context = any>(props: import("react-virtuoso").VirtuosoProps<ItemData, Context> & {
67
+ ref?: any;
68
+ }) => ReactElement), any, {}, never>;
69
+ export declare const StyledEllipses: import("styled-components").StyledComponent<"div", any, {}, never>;
70
+ export declare const StyledMultiValueContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
71
+ export declare const StyledMultiValue: import("styled-components").StyledComponent<"div", any, {}, never>;
72
+ export declare const StyledMultiInputContainer: import("styled-components").StyledComponent<"div", any, {}, never>;
73
+ export declare const StyledMultiInput: import("styled-components").StyledComponent<"input", any, {
74
+ $isNavigatingTokens?: boolean | undefined;
40
75
  }, never>;