@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
@@ -0,0 +1,36 @@
1
+ import React from 'react';
2
+ import { DivAttributes } from '../_utils/types';
3
+ import { SuperSelectMenuItemProps } from './SuperSelect.types';
4
+ export declare const Overlay: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLElement>>;
5
+ export declare const SingleTrigger: (props: React.PropsWithChildren<any>) => JSX.Element;
6
+ export declare const MultiTrigger: (props: React.PropsWithChildren<any>) => JSX.Element | null;
7
+ export declare const Trigger: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLDivElement>>;
8
+ export declare const Indicators: (props: React.PropsWithChildren<any>) => JSX.Element;
9
+ export declare const Label: React.ForwardRefExoticComponent<{
10
+ hoverable: boolean;
11
+ } & React.RefAttributes<HTMLDivElement>>;
12
+ export declare const Loading: () => JSX.Element;
13
+ export declare const ArrowContainer: (props: React.PropsWithChildren<any>) => JSX.Element;
14
+ export declare const Arrow: ({ up, down, left, right, width, height, border, }: any) => JSX.Element;
15
+ export declare const Clear: () => JSX.Element;
16
+ export declare const MultiInputContainer: (props: React.PropsWithChildren<{}>) => JSX.Element;
17
+ export declare const MultiInput: (props: React.PropsWithChildren<any>) => JSX.Element;
18
+ export declare const MultiValue: (props: React.PropsWithChildren<any>) => JSX.Element;
19
+ export declare const MultiValueContainer: (props: React.PropsWithChildren<any>) => JSX.Element;
20
+ export declare const SearchContainer: (props: React.PropsWithChildren<any>) => JSX.Element;
21
+ export declare const Search: (props: React.PropsWithChildren<any>) => JSX.Element;
22
+ export declare const Header: (props: React.PropsWithChildren<any>) => JSX.Element;
23
+ export declare const Footer: (props: React.PropsWithChildren<any>) => JSX.Element;
24
+ export declare const EmptyMessage: (props: any) => JSX.Element;
25
+ export declare const Options: (props: React.PropsWithChildren<{}> & DivAttributes) => JSX.Element;
26
+ export declare const Group: (props: React.PropsWithChildren<{}>) => JSX.Element;
27
+ export declare const Item: React.ForwardRefExoticComponent<SuperSelectMenuItemProps & React.RefAttributes<HTMLDivElement>>;
28
+ export declare const OptionGroupHeader: ({ optgroup }: any) => JSX.Element;
29
+ export declare const OptionLabel: ({ option }: any) => JSX.Element;
30
+ export declare const OptionContent: ({ option }: any) => JSX.Element;
31
+ export declare const DraggableOptionContent: ({ index, option }: any) => JSX.Element;
32
+ export declare const DragHandle: (props: React.PropsWithChildren<any>) => JSX.Element;
33
+ export declare const CheckboxContainer: (props: React.PropsWithChildren<any>) => JSX.Element;
34
+ export declare const Checkbox: (props: React.PropsWithChildren<any>) => JSX.Element;
35
+ export declare const CheckmarkContainer: (props: React.PropsWithChildren<any>) => JSX.Element;
36
+ export declare const Checkmark: (props: React.PropsWithChildren<any>) => JSX.Element;
@@ -0,0 +1,249 @@
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, Clear as ClearIcon, Grip } from '@procore/core-icons';
24
+ import React from 'react';
25
+ import { Draggable } from 'react-beautiful-dnd';
26
+ import { FakeCheckbox } from '../Checkbox/Checkbox';
27
+ import { Spinner } from '../Spinner/Spinner';
28
+ import { Token } from '../Token/Token';
29
+ import { Tooltip } from '../Tooltip/Tooltip';
30
+ import { Typeahead } from '../Typeahead/Typeahead';
31
+ import { OverflowObserver } from '../_hooks/OverflowObserver';
32
+ import { colors } from '../_styles/colors';
33
+ import { InternalDragDropContext } from './SuperSelect';
34
+ import { draggableOptionIdSymbol } from './SuperSelect.constants';
35
+ import { StyledArrow, StyledArrowContainer, StyledArrowFill, StyledArrowOutline, StyledCheckboxContainer, StyledCheckmarkContainer, StyledClearIcon, StyledDraggableWrapper, StyledEmptyMessage, StyledFooter, StyledGrip, StyledGroup, StyledHeader, StyledIndicators, StyledItem, StyledItemLabel, StyledLabel, StyledMultiInput, StyledMultiInputContainer, StyledMultiValue, StyledMultiValueContainer, StyledOptionGroupLabel, StyledOptions, StyledOverlay, StyledSearchContainer, StyledTrigger, } from './SuperSelect.styles';
36
+ import { useSuperSelectContext } from './useSuperSelect';
37
+ export var Overlay = React.forwardRef(function (props, ref) {
38
+ return React.createElement(StyledOverlay, __assign({ ref: ref }, props));
39
+ });
40
+ export var SingleTrigger = function (props) {
41
+ var ctx = useSuperSelectContext();
42
+ return (React.createElement(OverflowObserver, null, function (_a) {
43
+ var isOverflowingX = _a.isOverflowingX, ref = _a.ref;
44
+ var showTooltip = !ctx.config.disabled && isOverflowingX && !ctx.state.open;
45
+ var label = ctx.state.selectedLabel || ctx.config.placeholder;
46
+ var labelComponent = (React.createElement(ctx.components.Label, __assign({}, props, { ref: ref, hoverable: showTooltip })));
47
+ return (React.createElement(Tooltip, { trigger: showTooltip ? 'hover' : 'none', overlay: label }, labelComponent));
48
+ }));
49
+ };
50
+ export var MultiTrigger = function (props) {
51
+ var _a;
52
+ var ctx = useSuperSelectContext();
53
+ if (ctx.config.multiple && Array.isArray(ctx.state.value)) {
54
+ return (React.createElement(ctx.components.MultiValueContainer, __assign({}, props), (_a = ctx.state.value) === null || _a === void 0 ? void 0 :
55
+ _a.map(function (val, j) {
56
+ var option = ctx.state.sourceOptions.find(function (o) { return ctx.option.value(o) === val; });
57
+ return (option && React.createElement(ctx.components.MultiValue, { index: j, option: option }));
58
+ }),
59
+ React.createElement(ctx.components.MultiInputContainer, null,
60
+ React.createElement(ctx.components.MultiInput, __assign({}, ctx.props.multiInput())))));
61
+ }
62
+ return null;
63
+ };
64
+ export var Trigger = React.forwardRef(function (props, ref) {
65
+ var ctx = useSuperSelectContext();
66
+ var searchRef = React.useRef(null);
67
+ React.useEffect(function () {
68
+ var _a;
69
+ (_a = searchRef.current) === null || _a === void 0 ? void 0 : _a.focus();
70
+ }, [ctx.state.value]);
71
+ var TriggerComponent = StyledTrigger;
72
+ return (React.createElement(TriggerComponent, __assign({ ref: ref }, props),
73
+ ctx.config.multiple ? (React.createElement(ctx.components.MultiTrigger, null)) : (React.createElement(ctx.components.SingleTrigger, null)),
74
+ React.createElement(ctx.components.Indicators, null)));
75
+ });
76
+ export var Indicators = function (props) {
77
+ var ctx = useSuperSelectContext();
78
+ var hasValue = Array.isArray(ctx.state.value)
79
+ ? ctx.state.value.length > 0
80
+ : ctx.state.value;
81
+ return (React.createElement(StyledIndicators, null,
82
+ hasValue && React.createElement(ctx.components.Clear, null),
83
+ ctx.config.loading ? (React.createElement(ctx.components.Loading, null)) : (React.createElement(ctx.components.ArrowContainer, null,
84
+ React.createElement(ctx.components.Arrow, { up: ctx.state.open, down: !ctx.state.open, width: 8, height: 4 })))));
85
+ };
86
+ export var Label = React.forwardRef(function (_a, ref) {
87
+ var hoverable = _a.hoverable, props = __rest(_a, ["hoverable"]);
88
+ var ctx = useSuperSelectContext();
89
+ return (React.createElement(StyledLabel, __assign({}, props, ctx.props.label(), { ref: ref, "$hoverable": hoverable }), ctx.state.selectedLabel || ctx.config.placeholder));
90
+ });
91
+ export var Loading = function () {
92
+ return React.createElement(Spinner, { color: "blue50", size: "xs" });
93
+ };
94
+ export var ArrowContainer = function (props) {
95
+ return React.createElement(StyledArrowContainer, __assign({}, props));
96
+ };
97
+ export var Arrow = function (_a) {
98
+ var up = _a.up, down = _a.down, left = _a.left, right = _a.right, _b = _a.width, width = _b === void 0 ? 12 : _b, _c = _a.height, height = _c === void 0 ? 12 : _c, _d = _a.border, border = _d === void 0 ? 0 : _d;
99
+ var outline = '';
100
+ var fill = '';
101
+ if (up) {
102
+ outline = "0,".concat(height, " ").concat(width, ",").concat(height, " {width / 2},0");
103
+ // prettier-ignore
104
+ fill = "".concat(border, ",").concat(height, " ").concat(width - border, ",").concat(height, " ").concat(width / 2, ",").concat(border * 2);
105
+ }
106
+ else if (down) {
107
+ outline = "0,0 ".concat(width, ",0 ").concat(width / 2, ",").concat(height);
108
+ // prettier-ignore
109
+ fill = "".concat(border, ",0 ").concat(width - border, ",0 ").concat(width / 2, ",").concat(height - border * 2);
110
+ }
111
+ else if (left) {
112
+ outline = "".concat(width, ",0 ").concat(width, ",").concat(height, " 0,").concat(height / 2);
113
+ // prettier-ignore
114
+ fill = "".concat(width, ",").concat(border, " ").concat(width, ",").concat(height - border, " ").concat(border * 2, ",").concat(height / 2);
115
+ }
116
+ else if (right) {
117
+ outline = "0,0 0,".concat(height, " ").concat(width, ",").concat(height / 2);
118
+ // prettier-ignore
119
+ fill = "0,".concat(border, " 0,").concat(height - border, " ").concat(width - border * 2, ",").concat(height / 2);
120
+ }
121
+ return (React.createElement(StyledArrow, null,
122
+ React.createElement("svg", { height: height, width: width, focusable: "false" },
123
+ border > 0 && React.createElement(StyledArrowOutline, { points: outline }),
124
+ React.createElement(StyledArrowFill, { points: fill }))));
125
+ };
126
+ export var Clear = function () {
127
+ var ctx = useSuperSelectContext();
128
+ return (React.createElement(StyledClearIcon, __assign({}, ctx.props.clear(), { size: "sm", variant: "tertiary", disabled: ctx.config.disabled, icon: React.createElement(ClearIcon, null), tabIndex: -1 })));
129
+ };
130
+ export var MultiInputContainer = function (props) {
131
+ return React.createElement(StyledMultiInputContainer, null, props.children);
132
+ };
133
+ export var MultiInput = function (props) {
134
+ return React.createElement(StyledMultiInput, __assign({}, props));
135
+ };
136
+ export var MultiValue = function (props) {
137
+ var ctx = useSuperSelectContext();
138
+ return (React.createElement(StyledMultiValue, null,
139
+ React.createElement(Token, { focused: ctx.state.activeTokenIndex === props.index },
140
+ React.createElement(Token.Label, null, ctx.option.label(props.option)),
141
+ React.createElement(Token.Remove, __assign({}, ctx.props.tokenClear(props.index))))));
142
+ };
143
+ export var MultiValueContainer = function (props) {
144
+ return React.createElement(StyledMultiValueContainer, __assign({}, props));
145
+ };
146
+ export var SearchContainer = function (props) {
147
+ return React.createElement(StyledSearchContainer, __assign({}, props));
148
+ };
149
+ export var Search = function (props) {
150
+ return React.createElement(Typeahead, __assign({}, props));
151
+ };
152
+ export var Header = function (props) {
153
+ return React.createElement(StyledHeader, __assign({}, props));
154
+ };
155
+ export var Footer = function (props) {
156
+ return React.createElement(StyledFooter, __assign({}, props, { padding: "md lg" }));
157
+ };
158
+ export var EmptyMessage = function (props) {
159
+ return React.createElement(StyledEmptyMessage, __assign({}, props));
160
+ };
161
+ export var Options = function (props) {
162
+ var ctx = useSuperSelectContext();
163
+ return React.createElement(StyledOptions, __assign({}, props, ctx.props.menu()));
164
+ };
165
+ export var Group = function (props) {
166
+ var ctx = useSuperSelectContext();
167
+ return (React.createElement(StyledGroup, __assign({}, props, ctx.props.item(), { role: "separator", "aria-disabled": true })));
168
+ };
169
+ export var Item = React.forwardRef(function (_a, ref) {
170
+ var _b;
171
+ var children = _a.children, _c = _a.isDragging, isDragging = _c === void 0 ? false : _c, props = __rest(_a, ["children", "isDragging"]);
172
+ var ctx = useSuperSelectContext();
173
+ var isDraggingOver = React.useContext(InternalDragDropContext).isDraggingOver;
174
+ var _d = React.useState(0), size = _d[0], setSize = _d[1];
175
+ var knownSize = (_b = props['data-known-size']) !== null && _b !== void 0 ? _b : 0;
176
+ React.useEffect(function () {
177
+ setSize(function (prevSize) { return (knownSize === 0 ? prevSize : knownSize); });
178
+ }, [knownSize]);
179
+ var index = props['data-index'];
180
+ var option = ctx.state.options[index];
181
+ if (!option) {
182
+ return null;
183
+ }
184
+ var isDisabled = ctx.option.isDisabled(option);
185
+ var isSelected = ctx.option.isSelected(option);
186
+ var isOptgroup = ctx.option.isOptgroup(option);
187
+ var value = ctx === null || ctx === void 0 ? void 0 : ctx.option.value(option);
188
+ function setNode(node) {
189
+ if (ctx) {
190
+ ctx.refs.navigationList.current[index] = node;
191
+ }
192
+ }
193
+ if (isOptgroup) {
194
+ return React.createElement(ctx.components.Group, __assign({}, props), children);
195
+ }
196
+ return (React.createElement(StyledItem, __assign({}, props, ctx.props.item({
197
+ onClick: function () { return ctx.state.onSelect(option); },
198
+ }), { "$disabled": ctx.option.isDisabled(option), "$emptyMinHeight": size, "$highlighted": ctx.state.activeMenuIndex === index, "$isDraggable": !isDisabled, "$isDragging": isDragging, "$isDraggingDisabled": Boolean(ctx.state.searchValue), "$isDraggingOver": isDraggingOver, "$selected": isSelected, "aria-posinset": index + 1, "aria-selected": ctx.state.activeMenuIndex === index, "aria-setsize": ctx.state.options.length || 0, id: "item-".concat(value), ref: setNode, role: "option" }),
199
+ ctx.config.selectionStyle === 'checkbox' && (React.createElement(ctx.components.CheckboxContainer, null,
200
+ React.createElement(ctx.components.Checkbox, { disabled: isDisabled, checked: isSelected }))),
201
+ children,
202
+ ctx.config.selectionStyle === 'checkmark' && (React.createElement(ctx.components.CheckmarkContainer, null, isSelected && React.createElement(ctx.components.Checkmark, null)))));
203
+ });
204
+ export var OptionGroupHeader = function (_a) {
205
+ var optgroup = _a.optgroup;
206
+ return React.createElement(StyledOptionGroupLabel, null, optgroup.label);
207
+ };
208
+ export var OptionLabel = function (_a) {
209
+ var option = _a.option;
210
+ var ctx = useSuperSelectContext();
211
+ return (React.createElement(StyledItemLabel, { "$draggable": ctx.config.draggable }, ctx.option.label(option)));
212
+ };
213
+ export var OptionContent = function (_a) {
214
+ var option = _a.option;
215
+ var ctx = useSuperSelectContext();
216
+ if (ctx.option.isOptgroup(option)) {
217
+ return React.createElement(ctx.components.OptionGroupHeader, { optgroup: option });
218
+ }
219
+ return React.createElement(ctx.components.OptionLabel, { option: option });
220
+ };
221
+ export var DraggableOptionContent = function (_a) {
222
+ var index = _a.index, option = _a.option;
223
+ var ctx = useSuperSelectContext();
224
+ var disabled = ctx.option.isDisabled(option);
225
+ var isOptgroup = ctx.option.isOptgroup(option);
226
+ var optionId = isOptgroup ? option.id : option[draggableOptionIdSymbol];
227
+ return (React.createElement(Draggable, { draggableId: optionId, index: index, key: optionId, isDragDisabled: isOptgroup || disabled || Boolean(ctx.state.searchValue) }, function (provided) {
228
+ return (React.createElement(StyledDraggableWrapper, __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps),
229
+ !isOptgroup && React.createElement(ctx.components.DragHandle, null),
230
+ React.createElement(ctx.components.OptionContent, { index: index, option: option })));
231
+ }));
232
+ };
233
+ export var DragHandle = function (props) {
234
+ return (React.createElement(StyledGrip, __assign({}, props),
235
+ React.createElement(Grip, { color: colors.gray45 })));
236
+ };
237
+ export var CheckboxContainer = function (props) {
238
+ return React.createElement(StyledCheckboxContainer, __assign({}, props));
239
+ };
240
+ export var Checkbox = function (props) {
241
+ return React.createElement(FakeCheckbox, __assign({}, props));
242
+ };
243
+ export var CheckmarkContainer = function (props) {
244
+ return React.createElement(StyledCheckmarkContainer, __assign({}, props));
245
+ };
246
+ export var Checkmark = function (props) {
247
+ return React.createElement(Check, __assign({}, props, { size: "sm" }));
248
+ };
249
+ //# sourceMappingURL=SuperSelect.components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SuperSelect.components.js","sourceRoot":"","sources":["../../src/SuperSelect/SuperSelect.components.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,KAAK,IAAI,SAAS,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAE1C,OA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reference types="lodash" />
2
2
  import React from 'react';
3
- import { SuperSelectProps } from './SuperSelect.types';
4
- export declare const SuperSelect: React.ForwardRefExoticComponent<SuperSelectProps & React.RefAttributes<{
5
- activeMenuIndex: number | null;
6
- activeTokenIndex: number | null;
7
- components: import("./SuperSelect.types").SuperSelectComponents | undefined;
8
- draggable: boolean | undefined;
9
- floating: import("@floating-ui/react-dom-interactions").UseFloatingReturn<HTMLElement>;
10
- getClearProps: () => React.AriaAttributes & React.HTMLAttributes<HTMLElement>;
11
- getFloatingProps: (userProps?: any) => Record<string, unknown>;
12
- getItemProps: (userProps?: any) => Record<string, unknown>;
13
- getMultiInputProps: () => React.AriaAttributes & React.InputHTMLAttributes<HTMLInputElement>;
14
- getOptionGroup: (option: any) => string;
15
- getOptionIcon: ((option: any) => string) | undefined;
16
- getOptionAvatar: ((option: any) => string) | undefined;
17
- getOptionIsBatch: (option: any) => boolean;
18
- getOptionIsDisabled: (option: any) => boolean;
19
- getOptionIsOptgroup: (item: any) => item is import("./SuperSelect.types").SuperSelectOptgroup;
20
- getOptionLabel: (option: any) => string;
21
- getOptionTitle: ((option: any) => string) | undefined;
22
- getOptionTooltip: ((option: any) => string) | undefined;
23
- getOptionValue: (option: any) => import("./SuperSelect.types").SuperSelectValuePrimitive;
24
- getReferenceProps: (userProps?: any) => Record<string, unknown>;
25
- getTokenClearProps: (index: number) => React.AriaAttributes & React.SVGAttributes<SVGElement>;
26
- getTypeaheadProps: () => React.AriaAttributes & import("../Typeahead/Typeahead.types").TypeaheadInputProps & import("..").TypeaheadProps;
27
- isEmpty: () => boolean;
28
- isSelected: (option: any) => boolean;
29
- listId: string;
30
- maxHeight: number;
31
- multiple: boolean;
32
- navigationListRef: React.MutableRefObject<(HTMLElement | null)[]>;
33
- onSelect: (option: any) => void;
34
- open: boolean;
35
- sourceOptions: any[];
36
- options: any[];
37
- overlayId: string;
38
- searchValue: string;
39
- selectedIndex: number;
40
- selectedOption: any;
41
- selectedLabel: string;
42
- setOpen: React.Dispatch<React.SetStateAction<boolean>>;
43
- setPointer: React.Dispatch<React.SetStateAction<boolean>>;
44
- setSearchValue: import("lodash").DebouncedFunc<React.Dispatch<React.SetStateAction<string>>>;
45
- value: import("./SuperSelect.types").SuperSelectValue;
46
- virtuoso: React.RefObject<import("react-virtuoso").VirtuosoHandle>;
47
- width: number;
48
- onDragEnd: (result: any) => void;
3
+ import { SuperSelectConfig } from './SuperSelect.types';
4
+ export declare const InternalDragDropContext: React.Context<{
5
+ isDraggingOver: boolean;
6
+ }>;
7
+ export declare const SuperSelect: React.ForwardRefExoticComponent<SuperSelectConfig & React.RefAttributes<{
8
+ config: {
9
+ block: boolean;
10
+ disabled: boolean;
11
+ draggable: boolean;
12
+ emptyMessage: string;
13
+ error: boolean | undefined;
14
+ footer: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
15
+ header: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
16
+ placeholder: string | undefined;
17
+ preset: import("./SuperSelect.types").SuperSelectPreset;
18
+ selectionStyle: "checkbox" | "highlight" | "checkmark";
19
+ tabIndex: number;
20
+ loading: boolean;
21
+ multiple: boolean;
22
+ };
23
+ components: {
24
+ Overlay: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLElement>>;
25
+ SingleTrigger: (props: any) => JSX.Element;
26
+ MultiTrigger: (props: any) => JSX.Element | null;
27
+ Trigger: React.ForwardRefExoticComponent<Pick<any, string | number | symbol> & React.RefAttributes<HTMLDivElement>>;
28
+ Indicators: (props: any) => JSX.Element;
29
+ Label: React.ForwardRefExoticComponent<{
30
+ hoverable: boolean;
31
+ } & React.RefAttributes<HTMLDivElement>>;
32
+ Loading: () => JSX.Element;
33
+ ArrowContainer: (props: any) => JSX.Element;
34
+ Arrow: ({ up, down, left, right, width, height, border, }: any) => JSX.Element;
35
+ Clear: () => JSX.Element;
36
+ MultiInputContainer: (props: {
37
+ children?: React.ReactNode;
38
+ }) => JSX.Element;
39
+ MultiInput: (props: any) => JSX.Element;
40
+ MultiValue: (props: any) => JSX.Element;
41
+ MultiValueContainer: (props: any) => JSX.Element;
42
+ SearchContainer: (props: any) => JSX.Element;
43
+ Search: (props: any) => JSX.Element;
44
+ Header: (props: any) => JSX.Element;
45
+ Footer: (props: any) => JSX.Element;
46
+ EmptyMessage: (props: any) => JSX.Element;
47
+ Options: (props: {
48
+ children?: React.ReactNode;
49
+ } & import("../_utils/types").DivAttributes) => JSX.Element;
50
+ Group: (props: {
51
+ children?: React.ReactNode;
52
+ }) => JSX.Element;
53
+ Item: React.ForwardRefExoticComponent<import("./SuperSelect.types").SuperSelectMenuItemProps & React.RefAttributes<HTMLDivElement>>;
54
+ OptionGroupHeader: ({ optgroup }: any) => JSX.Element;
55
+ OptionLabel: ({ option }: any) => JSX.Element;
56
+ OptionContent: ({ option }: any) => JSX.Element;
57
+ DraggableOptionContent: ({ index, option }: any) => JSX.Element;
58
+ DragHandle: (props: any) => JSX.Element;
59
+ CheckboxContainer: (props: any) => JSX.Element;
60
+ Checkbox: (props: any) => JSX.Element;
61
+ CheckmarkContainer: (props: any) => JSX.Element;
62
+ Checkmark: (props: any) => JSX.Element;
63
+ };
64
+ state: {
65
+ activeMenuIndex: number | null;
66
+ activeTokenIndex: number | null;
67
+ isEmpty: () => boolean;
68
+ listContainerHeight: number;
69
+ listId: string;
70
+ maxHeight: number;
71
+ onDragEnd: (result: any) => void;
72
+ onSelect: (option: any) => void;
73
+ open: boolean;
74
+ options: any[];
75
+ overlayId: string;
76
+ searchValue: string;
77
+ selectedIndex: number;
78
+ selectedLabel: string;
79
+ selectedOption: any;
80
+ setOpen: React.Dispatch<React.SetStateAction<boolean>>;
81
+ setPointer: React.Dispatch<React.SetStateAction<boolean>>;
82
+ setSearchValue: import("lodash").DebouncedFunc<React.Dispatch<React.SetStateAction<string>>>;
83
+ sourceOptions: any[];
84
+ value: import("./SuperSelect.types").SuperSelectValue;
85
+ width: number;
86
+ };
87
+ props: {
88
+ clear: () => {
89
+ 'aria-hidden': boolean;
90
+ 'aria-label': string;
91
+ onClick(e: React.MouseEvent<Element, MouseEvent>): void;
92
+ };
93
+ emptyMessage: () => {
94
+ emptyMessage: string;
95
+ };
96
+ footer: () => {
97
+ ref: (el: HTMLElement | null) => void;
98
+ onKeyDown: (e: React.KeyboardEvent<Element>) => void;
99
+ };
100
+ header: () => {
101
+ ref: (el: HTMLElement | null) => void;
102
+ };
103
+ item: (userProps?: any) => Record<string, unknown>;
104
+ label: () => {
105
+ $hoverable: boolean;
106
+ };
107
+ menu: () => {
108
+ scrollable: boolean;
109
+ style: {
110
+ height: number;
111
+ };
112
+ };
113
+ multiInput: () => React.AriaAttributes & React.InputHTMLAttributes<HTMLInputElement> & {
114
+ ref: React.Ref<HTMLInputElement>;
115
+ };
116
+ overlay: (userProps?: any) => Record<string, unknown>;
117
+ search: () => {
118
+ 'aria-controls': string;
119
+ onChange(value: string): void;
120
+ placeholder: string;
121
+ };
122
+ searchContainer: () => {
123
+ ref: (el: HTMLElement | null) => void;
124
+ };
125
+ tokenClear: (index: number) => {
126
+ onClick(e: React.MouseEvent<Element, MouseEvent>): void;
127
+ };
128
+ trigger: (userProps?: any) => Record<string, unknown>;
129
+ virtuoso: () => import("react-virtuoso").VirtuosoProps<{}, {}>;
130
+ };
131
+ option: {
132
+ group: (option: any) => string;
133
+ isBatch: (option: any) => boolean;
134
+ isSelected: (option: any) => boolean;
135
+ isDisabled: (option: any) => boolean;
136
+ isOptgroup: (item: any) => item is import("./SuperSelect.types").SuperSelectOptgroup;
137
+ label: (option: any) => string;
138
+ value: (option: any) => import("./SuperSelect.types").SuperSelectValuePrimitive;
139
+ };
140
+ refs: {
141
+ floating: import("@floating-ui/react-dom-interactions").UseFloatingReturn<HTMLElement>;
142
+ navigationList: React.MutableRefObject<(HTMLElement | null)[]>;
143
+ virtuoso: React.RefObject<import("react-virtuoso").VirtuosoHandle>;
144
+ };
49
145
  }>>;