@peculiar/react-components 0.6.7 → 1.0.0

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 (55) hide show
  1. package/dist/cjs/Chip/chip.js +1 -3
  2. package/dist/cjs/Chip/chip.js.map +1 -1
  3. package/dist/cjs/NativeSelect/index.js +6 -0
  4. package/dist/cjs/NativeSelect/index.js.map +1 -0
  5. package/dist/cjs/NativeSelect/native_select.js +151 -0
  6. package/dist/cjs/NativeSelect/native_select.js.map +1 -0
  7. package/dist/cjs/Select/select.js +170 -53
  8. package/dist/cjs/Select/select.js.map +1 -1
  9. package/dist/cjs/Toast/toast.js +1 -1
  10. package/dist/cjs/Toast/toast.js.map +1 -1
  11. package/dist/cjs/index.js +2 -2
  12. package/dist/cjs/index.js.map +1 -1
  13. package/dist/esm/Chip/chip.js +1 -3
  14. package/dist/esm/Chip/chip.js.map +1 -1
  15. package/dist/esm/NativeSelect/index.js +2 -0
  16. package/dist/esm/NativeSelect/index.js.map +1 -0
  17. package/dist/esm/NativeSelect/native_select.js +122 -0
  18. package/dist/esm/NativeSelect/native_select.js.map +1 -0
  19. package/dist/esm/Select/select.js +169 -30
  20. package/dist/esm/Select/select.js.map +1 -1
  21. package/dist/esm/Toast/toast.js +1 -1
  22. package/dist/esm/Toast/toast.js.map +1 -1
  23. package/dist/esm/index.js +2 -2
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/esnext/Chip/chip.js +1 -2
  26. package/dist/esnext/Chip/chip.js.map +1 -1
  27. package/dist/esnext/NativeSelect/index.js +2 -0
  28. package/dist/esnext/NativeSelect/index.js.map +1 -0
  29. package/dist/esnext/NativeSelect/native_select.js +129 -0
  30. package/dist/esnext/NativeSelect/native_select.js.map +1 -0
  31. package/dist/esnext/Select/select.js +184 -44
  32. package/dist/esnext/Select/select.js.map +1 -1
  33. package/dist/esnext/Toast/toast.js +1 -1
  34. package/dist/esnext/Toast/toast.js.map +1 -1
  35. package/dist/esnext/index.js +2 -2
  36. package/dist/esnext/index.js.map +1 -1
  37. package/dist/types/NativeSelect/index.d.ts +1 -0
  38. package/dist/types/NativeSelect/native_select.d.ts +76 -0
  39. package/dist/types/Select/select.d.ts +65 -33
  40. package/dist/types/index.d.ts +2 -2
  41. package/package.json +5 -5
  42. package/dist/cjs/Autocomplete/autocomplete.js +0 -269
  43. package/dist/cjs/Autocomplete/autocomplete.js.map +0 -1
  44. package/dist/cjs/Autocomplete/index.js +0 -6
  45. package/dist/cjs/Autocomplete/index.js.map +0 -1
  46. package/dist/esm/Autocomplete/autocomplete.js +0 -262
  47. package/dist/esm/Autocomplete/autocomplete.js.map +0 -1
  48. package/dist/esm/Autocomplete/index.js +0 -2
  49. package/dist/esm/Autocomplete/index.js.map +0 -1
  50. package/dist/esnext/Autocomplete/autocomplete.js +0 -272
  51. package/dist/esnext/Autocomplete/autocomplete.js.map +0 -1
  52. package/dist/esnext/Autocomplete/index.js +0 -2
  53. package/dist/esnext/Autocomplete/index.js.map +0 -1
  54. package/dist/types/Autocomplete/autocomplete.d.ts +0 -108
  55. package/dist/types/Autocomplete/index.d.ts +0 -1
@@ -1,262 +0,0 @@
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 React from 'react';
24
- import styled from '@emotion/styled';
25
- import { useAutocomplete, } from '../hooks';
26
- import { Popover } from '../Popover';
27
- import { TextField } from '../TextField';
28
- import { Typography } from '../Typography';
29
- import { Box } from '../Box';
30
- import { Chip } from '../Chip';
31
- import { Button } from '../Button';
32
- import { ArrowDropDownIcon, PlusIcon } from '../icons';
33
- import { MenuItem } from '../MenuList';
34
- /**
35
- *
36
- */
37
- /**
38
- * Styles.
39
- */
40
- var AutocompleteField = styled(Typography)(function (props) { return (__assign(__assign(__assign({ outline: 'none', boxSizing: 'border-box', width: '100%', borderRadius: '4px', padding: '0 calc(var(--pv-size-base-2) + 24px) 0 var(--pv-size-base-2)', backgroundColor: 'var(--pv-color-gray-1)', borderStyle: 'solid', borderWidth: '1px', transition: 'background-color 200ms, color 200ms, border-color 200ms', appearance: 'none', userSelect: 'none', textAlign: 'left', cursor: 'pointer', fontFamily: 'inherit', height: 'var(--pv-size-base-8)', position: 'relative' }, (props.size === 'small' && {
41
- height: 'var(--pv-size-base-6)',
42
- })), (props.size === 'medium' && {
43
- height: 'var(--pv-size-base-7)',
44
- })), (props.multiple === true && {
45
- display: 'inline-flex',
46
- alignItems: 'center',
47
- }))); }, function (props) {
48
- var isDark = props.theme.mode === 'dark';
49
- var color = isDark
50
- ? 'var(--pv-color-white)'
51
- : 'var(--pv-color-black)';
52
- var borderColor = 'var(--pv-color-gray-8)';
53
- var colorPlaceholder = 'var(--pv-color-gray-9)';
54
- var borderColorHover = 'var(--pv-color-gray-7)';
55
- var borderColorDisabled = 'var(--pv-color-gray-5)';
56
- var colorDisabled = 'var(--pv-color-gray-7)';
57
- var invalidBackgroundColor = 'var(--pv-color-wrong-tint-5)';
58
- var invalidBorderColor = 'var(--pv-color-wrong-tint-3)';
59
- var backgroundColorFocus = 'var(--pv-color-secondary-tint-5)';
60
- var borderColorFocus = 'var(--pv-color-secondary-tint-3)';
61
- if (isDark) {
62
- borderColor = 'var(--pv-color-gray-5)';
63
- colorPlaceholder = 'var(--pv-color-gray-6)';
64
- borderColorHover = 'var(--pv-color-gray-4)';
65
- borderColorDisabled = 'var(--pv-color-gray-4)';
66
- colorDisabled = 'var(--pv-color-gray-4)';
67
- invalidBackgroundColor = 'var(--pv-color-wrong-shade-4)';
68
- invalidBorderColor = 'var(--pv-color-wrong-shade-1)';
69
- backgroundColorFocus = 'var(--pv-color-secondary-shade-4)';
70
- borderColorFocus = 'var(--pv-color-secondary-shade-1)';
71
- }
72
- return ({
73
- borderColor: borderColor,
74
- '&:hover': {
75
- backgroundColor: 'var(--pv-color-gray-3)',
76
- borderColor: borderColorHover,
77
- },
78
- '&:disabled': {
79
- cursor: 'not-allowed',
80
- backgroundColor: 'var(--pv-color-gray-1)',
81
- borderColor: borderColorDisabled,
82
- color: colorDisabled,
83
- },
84
- '&:not(:disabled)': {
85
- color: color,
86
- '&[aria-placeholder]': {
87
- color: colorPlaceholder,
88
- },
89
- '&[aria-invalid]': {
90
- backgroundColor: invalidBackgroundColor,
91
- borderColor: invalidBorderColor,
92
- },
93
- '&:focus-visible': {
94
- backgroundColor: backgroundColorFocus,
95
- borderColor: borderColorFocus,
96
- },
97
- },
98
- });
99
- });
100
- var AutocompleteArrowIcon = styled(ArrowDropDownIcon)({
101
- position: 'absolute',
102
- right: '0px',
103
- top: 'calc(50% - 12px)',
104
- margin: '0px var(--pv-size-base)',
105
- color: 'var(--pv-color-gray-10)',
106
- '&[aria-disabled="true"]': {
107
- color: 'inherit',
108
- },
109
- });
110
- var AutocompleteNativeInput = styled('input')({
111
- bottom: 0,
112
- left: 0,
113
- height: '100%',
114
- position: 'absolute',
115
- opacity: 0,
116
- pointerEvents: 'none',
117
- width: '100%',
118
- boxSizing: 'border-box',
119
- });
120
- var AutocompleteDropdownStateItem = styled('div')({
121
- padding: 'var(--pv-size-base-3) var(--pv-size-base-2)',
122
- });
123
- var AutocompleteDropdownList = styled('ul')({
124
- maxHeight: '36vh',
125
- overflowY: 'auto',
126
- margin: 0,
127
- listStyleType: 'none',
128
- position: 'relative',
129
- padding: '10px 0',
130
- });
131
- var AutocompleteDropdownGroupName = styled(Typography)(function (props) { return ({
132
- padding: 'var(--pv-size-base-2)',
133
- color: props.theme.mode === 'dark'
134
- ? 'var(--pv-color-gray-6)'
135
- : 'var(--pv-color-gray-9)',
136
- }); });
137
- var AutocompleteDropdownGroupList = styled('ul')({
138
- padding: 0,
139
- listStyleType: 'none',
140
- });
141
- var AutocompleteDropdownGroupListItem = styled(MenuItem)(function (props) { return (__assign({}, (props.inGroup && {
142
- padding: '0px var(--pv-size-base-2) 0 var(--pv-size-base-3)',
143
- }))); });
144
- var AutocompletePopover = styled(Popover)({
145
- minWidth: 240,
146
- });
147
- var AutocompleteTagsList = styled('div')({
148
- overflow: 'hidden',
149
- width: '100%',
150
- });
151
- var AutocompleteTag = styled(Chip)(function (props) { return (__assign(__assign(__assign({ label: 'Autocomplete-tag', borderRadius: '3px', margin: '0 var(--pv-size-base) 0 0' }, (props.tagsLength === 1 && {
152
- maxWidth: 'calc(100% - var(--pv-size-base))',
153
- })), (props.tagsLength > 1 && props.limitTags && {
154
- maxWidth: "calc(".concat(100 / props.limitTags, "% - var(--pv-size-base))"),
155
- })), (props.size === 'small' && {
156
- height: 'var(--pv-size-base-5)',
157
- }))); });
158
- var AutocompleteTagSize = styled(Typography)({
159
- margin: '0 var(--pv-size-base-2)',
160
- });
161
- var AutocompleteSearchInput = styled(TextField)({
162
- padding: 'var(--pv-size-base-3) var(--pv-size-base-3) var(--pv-size-base-2)',
163
- });
164
- var AutocompleteCreateNewButton = styled(Button)({
165
- width: '100%',
166
- borderRadius: 0,
167
- justifyContent: 'left',
168
- padding: '0px var(--pv-size-base-2)',
169
- });
170
- var AutocompleteError = styled(Typography)({
171
- marginTop: '2px',
172
- });
173
- var AutocompleteLabel = styled('label')({
174
- label: 'TextField-label',
175
- marginBottom: '2px',
176
- display: 'inline-block',
177
- });
178
- /**
179
- *
180
- */
181
- export var Autocomplete = function (props) {
182
- var className = props.className, size = props.size, placeholder = props.placeholder, label = props.label, disableSearch = props.disableSearch, _a = props.disabled, disabled = _a === void 0 ? false : _a, noOptionsText = props.noOptionsText, loading = props.loading, loadingText = props.loadingText, _b = props.limitTags, limitTags = _b === void 0 ? 2 : _b, name = props.name, required = props.required, _c = props.multiple, multiple = _c === void 0 ? false : _c, readOnly = props.readOnly, createOptionText = props.createOptionText, allowCreateOption = props.allowCreateOption, error = props.error, errorText = props.errorText, renderRootProp = props.renderRoot, renderOptionProp = props.renderOption, _d = props.getLimitTagsText, getLimitTagsText = _d === void 0 ? function (more) { return "".concat(more, " more"); } : _d, groupBy = props.groupBy, onCreate = props.onCreate;
183
- var _e = useAutocomplete(props), id = _e.id, value = _e.value, searchValue = _e.searchValue, groupedOptions = _e.groupedOptions, getRootProps = _e.getRootProps, getInputLabelProps = _e.getInputLabelProps, getInputProps = _e.getInputProps, getListboxProps = _e.getListboxProps, getOptionProps = _e.getOptionProps, getPopoverProps = _e.getPopoverProps, getTagProps = _e.getTagProps, getOptionLabel = _e.getOptionLabel;
184
- var _f = getInputProps(), onChange = _f.onChange, otherInputProps = __rest(_f, ["onChange"]);
185
- var popoverProps = getPopoverProps();
186
- var handleCreate = function (event) {
187
- if (onCreate) {
188
- onCreate(event, searchValue);
189
- }
190
- popoverProps.onClose(event);
191
- };
192
- var defaultRenderOption = function (propsOption, option) { return (React.createElement(AutocompleteDropdownGroupListItem, __assign({}, propsOption, { inGroup: Boolean(groupBy) }), getOptionLabel(option))); };
193
- var renderGroup = function (params) { return (React.createElement("li", { key: params.key },
194
- React.createElement(AutocompleteDropdownGroupName, { variant: "c1", color: "gray-10" }, params.group),
195
- React.createElement(AutocompleteDropdownGroupList, null, params.children))); };
196
- var renderValue = function () {
197
- if (!value || (Array.isArray(value) && value.length === 0)) {
198
- return null;
199
- }
200
- if (Array.isArray(value)) {
201
- var more = (value.length > limitTags) ? (value.length - limitTags) : 0;
202
- var valueLimits = more > 0 ? value.slice(0, limitTags) : value;
203
- return (React.createElement(React.Fragment, null,
204
- React.createElement(AutocompleteTagsList, null, valueLimits.map(function (v, index) { return (React.createElement(AutocompleteTag, __assign({}, getTagProps(v, index), { color: "secondary", variant: "contained", size: size, limitTags: limitTags, tagsLength: value.length }), getOptionLabel(v))); })),
205
- !!more && (React.createElement(AutocompleteTagSize, { variant: "c2", color: "gray-9" }, getLimitTagsText(more)))));
206
- }
207
- return getOptionLabel(value);
208
- };
209
- var renderedValue = renderValue();
210
- var isValueEmpty = renderedValue === null;
211
- var defaultRenderRoot = function (propsRoot, valueRoot) { return (React.createElement(AutocompleteField, __assign({}, propsRoot, { noWrap: true,
212
- // @ts-ignore
213
- component: "button", type: "button", variant: size === 'small' ? 'c1' : 'b3', "aria-invalid": error || undefined, "aria-placeholder": isValueEmpty || undefined, multiple: multiple, size: size }),
214
- isValueEmpty ? placeholder : renderedValue,
215
- React.createElement(AutocompleteArrowIcon, { "aria-disabled": disabled, "aria-hidden": true }),
216
- React.createElement(AutocompleteNativeInput, { type: "text", value: isValueEmpty ? '' : JSON.stringify(valueRoot), tabIndex: -1, "aria-hidden": "true", disabled: disabled, autoComplete: "off", id: id, name: name, required: required, readOnly: readOnly, onChange: function () { } }))); };
217
- var renderOption = renderOptionProp || defaultRenderOption;
218
- var renderRoot = renderRootProp || defaultRenderRoot;
219
- var renderListOption = function (option, index) {
220
- var optionProps = getOptionProps(option, index);
221
- return renderOption(optionProps, option);
222
- };
223
- return (React.createElement("div", { className: className },
224
- label && (React.createElement(AutocompleteLabel, __assign({}, getInputLabelProps()),
225
- React.createElement(Typography, { component: "span", variant: "c2", color: "gray-10" }, label))),
226
- renderRoot(__assign(__assign({}, getRootProps()), { disabled: disabled }), value, getTagProps),
227
- error && errorText && (React.createElement(AutocompleteError, { variant: "c2", color: "wrong" }, errorText)),
228
- React.createElement(AutocompletePopover, __assign({ placement: "bottom-start", allowUseSameWidth: true }, popoverProps),
229
- !disableSearch && (React.createElement(Box, { borderColor: "gray-3", borderPosition: "bottom", borderStyle: "solid", borderWidth: 1 },
230
- React.createElement(AutocompleteSearchInput, { id: otherInputProps.id, inputProps: otherInputProps, onChange: onChange, placeholder: "Search", disabled: loading }))),
231
- loading && groupedOptions.length === 0 && (React.createElement(AutocompleteDropdownStateItem, null, typeof loadingText === 'string' ? (React.createElement(Typography, { variant: "b2", color: "gray-10" }, loadingText)) : loadingText)),
232
- groupedOptions.length === 0 && !loading && (React.createElement(AutocompleteDropdownStateItem, null, typeof noOptionsText === 'string' ? (React.createElement(Typography, { variant: "b2", color: "gray-10" }, noOptionsText)) : noOptionsText)),
233
- groupedOptions.length > 0 && (React.createElement(AutocompleteDropdownList, __assign({}, getListboxProps()), groupedOptions
234
- // @ts-ignore
235
- .map(function (option, index) {
236
- // @ts-ignore
237
- if (groupBy && 'options' in option) {
238
- return renderGroup({
239
- key: option.key,
240
- group: option.group,
241
- // @ts-ignore
242
- children: option.options.map(function (option2, index2) { return (renderListOption(option2, option.index + index2)); }),
243
- });
244
- }
245
- return renderListOption(option, index);
246
- }))),
247
- (allowCreateOption && searchValue.length > 0 && !loading) && (React.createElement(Box, { borderColor: "gray-3", borderPosition: "top", borderStyle: "solid", borderWidth: 1 },
248
- React.createElement(AutocompleteCreateNewButton, { color: "secondary", textVariant: "b3", onClick: handleCreate, startIcon: React.createElement(PlusIcon, null) }, createOptionText.replace('{{value}}', searchValue)))))));
249
- };
250
- // @ts-ignore
251
- Autocomplete.defaultProps = {
252
- disableSearch: false,
253
- noOptionsText: 'No options',
254
- loading: false,
255
- loadingText: 'Loading...',
256
- limitTags: 2,
257
- required: false,
258
- allowCreateOption: false,
259
- createOptionText: 'Create "{{value}}"',
260
- size: 'medium',
261
- };
262
- //# sourceMappingURL=autocomplete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../../src/Autocomplete/autocomplete.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,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KAAK;IACpB,aAAa,EAAE,YAAY;IAC3B,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,YAAY;IACzB,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,KAAK;IACf,iBAAiB,EAAE,KAAK;IACxB,gBAAgB,EAAE,oBAAoB;IACtC,IAAI,EAAE,QAAQ;CACf,CAAC"}
@@ -1,2 +0,0 @@
1
- export { Autocomplete } from './autocomplete';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,272 +0,0 @@
1
- import React from 'react';
2
- import styled from '@emotion/styled';
3
- import { useAutocomplete, } from '../hooks';
4
- import { Popover } from '../Popover';
5
- import { TextField } from '../TextField';
6
- import { Typography } from '../Typography';
7
- import { Box } from '../Box';
8
- import { Chip } from '../Chip';
9
- import { Button } from '../Button';
10
- import { ArrowDropDownIcon, PlusIcon } from '../icons';
11
- import { MenuItem } from '../MenuList';
12
- /**
13
- *
14
- */
15
- /**
16
- * Styles.
17
- */
18
- const AutocompleteField = styled(Typography)((props) => ({
19
- outline: 'none',
20
- boxSizing: 'border-box',
21
- width: '100%',
22
- borderRadius: '4px',
23
- padding: '0 calc(var(--pv-size-base-2) + 24px) 0 var(--pv-size-base-2)',
24
- backgroundColor: 'var(--pv-color-gray-1)',
25
- borderStyle: 'solid',
26
- borderWidth: '1px',
27
- transition: 'background-color 200ms, color 200ms, border-color 200ms',
28
- appearance: 'none',
29
- userSelect: 'none',
30
- textAlign: 'left',
31
- cursor: 'pointer',
32
- fontFamily: 'inherit',
33
- height: 'var(--pv-size-base-8)',
34
- position: 'relative',
35
- ...(props.size === 'small' && {
36
- height: 'var(--pv-size-base-6)',
37
- }),
38
- ...(props.size === 'medium' && {
39
- height: 'var(--pv-size-base-7)',
40
- }),
41
- ...(props.multiple === true && {
42
- display: 'inline-flex',
43
- alignItems: 'center',
44
- }),
45
- }), (props) => {
46
- const isDark = props.theme.mode === 'dark';
47
- const color = isDark
48
- ? 'var(--pv-color-white)'
49
- : 'var(--pv-color-black)';
50
- let borderColor = 'var(--pv-color-gray-8)';
51
- let colorPlaceholder = 'var(--pv-color-gray-9)';
52
- let borderColorHover = 'var(--pv-color-gray-7)';
53
- let borderColorDisabled = 'var(--pv-color-gray-5)';
54
- let colorDisabled = 'var(--pv-color-gray-7)';
55
- let invalidBackgroundColor = 'var(--pv-color-wrong-tint-5)';
56
- let invalidBorderColor = 'var(--pv-color-wrong-tint-3)';
57
- let backgroundColorFocus = 'var(--pv-color-secondary-tint-5)';
58
- let borderColorFocus = 'var(--pv-color-secondary-tint-3)';
59
- if (isDark) {
60
- borderColor = 'var(--pv-color-gray-5)';
61
- colorPlaceholder = 'var(--pv-color-gray-6)';
62
- borderColorHover = 'var(--pv-color-gray-4)';
63
- borderColorDisabled = 'var(--pv-color-gray-4)';
64
- colorDisabled = 'var(--pv-color-gray-4)';
65
- invalidBackgroundColor = 'var(--pv-color-wrong-shade-4)';
66
- invalidBorderColor = 'var(--pv-color-wrong-shade-1)';
67
- backgroundColorFocus = 'var(--pv-color-secondary-shade-4)';
68
- borderColorFocus = 'var(--pv-color-secondary-shade-1)';
69
- }
70
- return ({
71
- borderColor,
72
- '&:hover': {
73
- backgroundColor: 'var(--pv-color-gray-3)',
74
- borderColor: borderColorHover,
75
- },
76
- '&:disabled': {
77
- cursor: 'not-allowed',
78
- backgroundColor: 'var(--pv-color-gray-1)',
79
- borderColor: borderColorDisabled,
80
- color: colorDisabled,
81
- },
82
- '&:not(:disabled)': {
83
- color,
84
- '&[aria-placeholder]': {
85
- color: colorPlaceholder,
86
- },
87
- '&[aria-invalid]': {
88
- backgroundColor: invalidBackgroundColor,
89
- borderColor: invalidBorderColor,
90
- },
91
- '&:focus-visible': {
92
- backgroundColor: backgroundColorFocus,
93
- borderColor: borderColorFocus,
94
- },
95
- },
96
- });
97
- });
98
- const AutocompleteArrowIcon = styled(ArrowDropDownIcon)({
99
- position: 'absolute',
100
- right: '0px',
101
- top: 'calc(50% - 12px)',
102
- margin: '0px var(--pv-size-base)',
103
- color: 'var(--pv-color-gray-10)',
104
- '&[aria-disabled="true"]': {
105
- color: 'inherit',
106
- },
107
- });
108
- const AutocompleteNativeInput = styled('input')({
109
- bottom: 0,
110
- left: 0,
111
- height: '100%',
112
- position: 'absolute',
113
- opacity: 0,
114
- pointerEvents: 'none',
115
- width: '100%',
116
- boxSizing: 'border-box',
117
- });
118
- const AutocompleteDropdownStateItem = styled('div')({
119
- padding: 'var(--pv-size-base-3) var(--pv-size-base-2)',
120
- });
121
- const AutocompleteDropdownList = styled('ul')({
122
- maxHeight: '36vh',
123
- overflowY: 'auto',
124
- margin: 0,
125
- listStyleType: 'none',
126
- position: 'relative',
127
- padding: '10px 0',
128
- });
129
- const AutocompleteDropdownGroupName = styled(Typography)((props) => ({
130
- padding: 'var(--pv-size-base-2)',
131
- color: props.theme.mode === 'dark'
132
- ? 'var(--pv-color-gray-6)'
133
- : 'var(--pv-color-gray-9)',
134
- }));
135
- const AutocompleteDropdownGroupList = styled('ul')({
136
- padding: 0,
137
- listStyleType: 'none',
138
- });
139
- const AutocompleteDropdownGroupListItem = styled(MenuItem)((props) => ({
140
- ...(props.inGroup && {
141
- padding: '0px var(--pv-size-base-2) 0 var(--pv-size-base-3)',
142
- }),
143
- }));
144
- const AutocompletePopover = styled(Popover)({
145
- minWidth: 240,
146
- });
147
- const AutocompleteTagsList = styled('div')({
148
- overflow: 'hidden',
149
- width: '100%',
150
- });
151
- const AutocompleteTag = styled(Chip)((props) => ({
152
- label: 'Autocomplete-tag',
153
- borderRadius: '3px',
154
- margin: '0 var(--pv-size-base) 0 0',
155
- ...(props.tagsLength === 1 && {
156
- maxWidth: 'calc(100% - var(--pv-size-base))',
157
- }),
158
- ...(props.tagsLength > 1 && props.limitTags && {
159
- maxWidth: `calc(${100 / props.limitTags}% - var(--pv-size-base))`,
160
- }),
161
- ...(props.size === 'small' && {
162
- height: 'var(--pv-size-base-5)',
163
- }),
164
- }));
165
- const AutocompleteTagSize = styled(Typography)({
166
- margin: '0 var(--pv-size-base-2)',
167
- });
168
- const AutocompleteSearchInput = styled(TextField)({
169
- padding: 'var(--pv-size-base-3) var(--pv-size-base-3) var(--pv-size-base-2)',
170
- });
171
- const AutocompleteCreateNewButton = styled(Button)({
172
- width: '100%',
173
- borderRadius: 0,
174
- justifyContent: 'left',
175
- padding: '0px var(--pv-size-base-2)',
176
- });
177
- const AutocompleteError = styled(Typography)({
178
- marginTop: '2px',
179
- });
180
- const AutocompleteLabel = styled('label')({
181
- label: 'TextField-label',
182
- marginBottom: '2px',
183
- display: 'inline-block',
184
- });
185
- /**
186
- *
187
- */
188
- export const Autocomplete = (props) => {
189
- const { className, size, placeholder, label, disableSearch, disabled = false, noOptionsText, loading, loadingText, limitTags = 2, name, required, multiple = false, readOnly, createOptionText, allowCreateOption, error, errorText, renderRoot: renderRootProp, renderOption: renderOptionProp, getLimitTagsText = (more) => `${more} more`, groupBy, onCreate, } = props;
190
- const { id, value, searchValue, groupedOptions, getRootProps, getInputLabelProps, getInputProps, getListboxProps, getOptionProps, getPopoverProps, getTagProps, getOptionLabel, } = useAutocomplete(props);
191
- const { onChange, ...otherInputProps } = getInputProps();
192
- const popoverProps = getPopoverProps();
193
- const handleCreate = (event) => {
194
- if (onCreate) {
195
- onCreate(event, searchValue);
196
- }
197
- popoverProps.onClose(event);
198
- };
199
- const defaultRenderOption = (propsOption, option) => (React.createElement(AutocompleteDropdownGroupListItem, { ...propsOption, inGroup: Boolean(groupBy) }, getOptionLabel(option)));
200
- const renderGroup = (params) => (React.createElement("li", { key: params.key },
201
- React.createElement(AutocompleteDropdownGroupName, { variant: "c1", color: "gray-10" }, params.group),
202
- React.createElement(AutocompleteDropdownGroupList, null, params.children)));
203
- const renderValue = () => {
204
- if (!value || (Array.isArray(value) && value.length === 0)) {
205
- return null;
206
- }
207
- if (Array.isArray(value)) {
208
- const more = (value.length > limitTags) ? (value.length - limitTags) : 0;
209
- const valueLimits = more > 0 ? value.slice(0, limitTags) : value;
210
- return (React.createElement(React.Fragment, null,
211
- React.createElement(AutocompleteTagsList, null, valueLimits.map((v, index) => (React.createElement(AutocompleteTag, { ...getTagProps(v, index), color: "secondary", variant: "contained", size: size, limitTags: limitTags, tagsLength: value.length }, getOptionLabel(v))))),
212
- !!more && (React.createElement(AutocompleteTagSize, { variant: "c2", color: "gray-9" }, getLimitTagsText(more)))));
213
- }
214
- return getOptionLabel(value);
215
- };
216
- const renderedValue = renderValue();
217
- const isValueEmpty = renderedValue === null;
218
- const defaultRenderRoot = (propsRoot, valueRoot) => (React.createElement(AutocompleteField, { ...propsRoot, noWrap: true,
219
- // @ts-ignore
220
- component: "button", type: "button", variant: size === 'small' ? 'c1' : 'b3', "aria-invalid": error || undefined, "aria-placeholder": isValueEmpty || undefined, multiple: multiple, size: size },
221
- isValueEmpty ? placeholder : renderedValue,
222
- React.createElement(AutocompleteArrowIcon, { "aria-disabled": disabled, "aria-hidden": true }),
223
- React.createElement(AutocompleteNativeInput, { type: "text", value: isValueEmpty ? '' : JSON.stringify(valueRoot), tabIndex: -1, "aria-hidden": "true", disabled: disabled, autoComplete: "off", id: id, name: name, required: required, readOnly: readOnly, onChange: () => { } })));
224
- const renderOption = renderOptionProp || defaultRenderOption;
225
- const renderRoot = renderRootProp || defaultRenderRoot;
226
- const renderListOption = (option, index) => {
227
- const optionProps = getOptionProps(option, index);
228
- return renderOption(optionProps, option);
229
- };
230
- return (React.createElement("div", { className: className },
231
- label && (React.createElement(AutocompleteLabel, { ...getInputLabelProps() },
232
- React.createElement(Typography, { component: "span", variant: "c2", color: "gray-10" }, label))),
233
- renderRoot({
234
- ...getRootProps(),
235
- disabled,
236
- }, value, getTagProps),
237
- error && errorText && (React.createElement(AutocompleteError, { variant: "c2", color: "wrong" }, errorText)),
238
- React.createElement(AutocompletePopover, { placement: "bottom-start", allowUseSameWidth: true, ...popoverProps },
239
- !disableSearch && (React.createElement(Box, { borderColor: "gray-3", borderPosition: "bottom", borderStyle: "solid", borderWidth: 1 },
240
- React.createElement(AutocompleteSearchInput, { id: otherInputProps.id, inputProps: otherInputProps, onChange: onChange, placeholder: "Search", disabled: loading }))),
241
- loading && groupedOptions.length === 0 && (React.createElement(AutocompleteDropdownStateItem, null, typeof loadingText === 'string' ? (React.createElement(Typography, { variant: "b2", color: "gray-10" }, loadingText)) : loadingText)),
242
- groupedOptions.length === 0 && !loading && (React.createElement(AutocompleteDropdownStateItem, null, typeof noOptionsText === 'string' ? (React.createElement(Typography, { variant: "b2", color: "gray-10" }, noOptionsText)) : noOptionsText)),
243
- groupedOptions.length > 0 && (React.createElement(AutocompleteDropdownList, { ...getListboxProps() }, groupedOptions
244
- // @ts-ignore
245
- .map((option, index) => {
246
- // @ts-ignore
247
- if (groupBy && 'options' in option) {
248
- return renderGroup({
249
- key: option.key,
250
- group: option.group,
251
- // @ts-ignore
252
- children: option.options.map((option2, index2) => (renderListOption(option2, option.index + index2))),
253
- });
254
- }
255
- return renderListOption(option, index);
256
- }))),
257
- (allowCreateOption && searchValue.length > 0 && !loading) && (React.createElement(Box, { borderColor: "gray-3", borderPosition: "top", borderStyle: "solid", borderWidth: 1 },
258
- React.createElement(AutocompleteCreateNewButton, { color: "secondary", textVariant: "b3", onClick: handleCreate, startIcon: React.createElement(PlusIcon, null) }, createOptionText.replace('{{value}}', searchValue)))))));
259
- };
260
- // @ts-ignore
261
- Autocomplete.defaultProps = {
262
- disableSearch: false,
263
- noOptionsText: 'No options',
264
- loading: false,
265
- loadingText: 'Loading...',
266
- limitTags: 2,
267
- required: false,
268
- allowCreateOption: false,
269
- createOptionText: 'Create "{{value}}"',
270
- size: 'medium',
271
- };
272
- //# sourceMappingURL=autocomplete.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"autocomplete.js","sourceRoot":"","sources":["../../../src/Autocomplete/autocomplete.tsx"],"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K;wBACnB,aAAa;wBACb,QAAQ,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAChD,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,CACjD,CAAC;qBACH,CAAC,CAAC;iBACJ;gBAED,OAAO,gBAAgB,CAAC,MAAW,EAAE,KAAK,CAAC,CAAC;YAC9C,CAAC,CAAC,CACqB,CAC5B;YACA,CAAC,iBAAiB,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAC5D,oBAAC,GAAG,IACF,WAAW,EAAC,QAAQ,EACpB,cAAc,EAAC,KAAK,EACpB,WAAW,EAAC,OAAO,EACnB,WAAW,EAAE,CAAC;gBAEd,oBAAC,2BAA2B,IAC1B,KAAK,EAAC,WAAW,EACjB,WAAW,EAAC,IAAI,EAChB,OAAO,EAAE,YAAY,EACrB,SAAS,EAAE,oBAAC,QAAQ,OAAG,IAEtB,gBAAgB,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CACvB,CAC1B,CACP,CACmB,CAClB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa;AACb,YAAY,CAAC,YAAY,GAAG;IAC1B,aAAa,EAAE,KAAK;IACpB,aAAa,EAAE,YAAY;IAC3B,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,YAAY;IACzB,SAAS,EAAE,CAAC;IACZ,QAAQ,EAAE,KAAK;IACf,iBAAiB,EAAE,KAAK;IACxB,gBAAgB,EAAE,oBAAoB;IACtC,IAAI,EAAE,QAAQ;CACf,CAAC"}
@@ -1,2 +0,0 @@
1
- export { Autocomplete } from './autocomplete';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Autocomplete/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}