@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
@@ -0,0 +1,129 @@
1
+ import * as React from 'react';
2
+ import styled from '@emotion/styled';
3
+ import { Typography } from '../Typography';
4
+ import { ArrowDropDownIcon } from '../icons';
5
+ /**
6
+ *
7
+ */
8
+ /**
9
+ * Styles.
10
+ */
11
+ const NativeSelectRoot = styled('select')((props) => ({
12
+ fontFamily: 'inherit',
13
+ outline: 'none',
14
+ cursor: 'pointer',
15
+ boxSizing: 'border-box',
16
+ width: '100%',
17
+ borderRadius: '4px',
18
+ padding: '0 calc(var(--pv-size-base-2) + 24px) 0 var(--pv-size-base-2)',
19
+ backgroundColor: 'var(--pv-color-gray-1)',
20
+ borderStyle: 'solid',
21
+ borderWidth: '1px',
22
+ transition: 'background-color 200ms, color 200ms, border-color 200ms',
23
+ display: 'block',
24
+ appearance: 'none',
25
+ fontWeight: 'var(--pv-text-c1-weight)',
26
+ fontSize: 'var(--pv-text-c1-size)',
27
+ lineHeight: 'var(--pv-text-c1-height)',
28
+ letterSpacing: 'var(--pv-text-c1-spacing)',
29
+ ...(props.selectSize === 'small' && {
30
+ height: 'var(--pv-size-base-6)',
31
+ }),
32
+ ...(props.selectSize === 'medium' && {
33
+ height: 'var(--pv-size-base-7)',
34
+ }),
35
+ ...(props.selectSize === 'large' && {
36
+ height: 'var(--pv-size-base-8)',
37
+ }),
38
+ }), (props) => {
39
+ const isDark = props.theme.mode === 'dark';
40
+ const color = isDark
41
+ ? 'var(--pv-color-white)'
42
+ : 'var(--pv-color-black)';
43
+ let borderColor = 'var(--pv-color-gray-8)';
44
+ let borderColorHover = 'var(--pv-color-gray-7)';
45
+ let borderColorDisabled = 'var(--pv-color-gray-5)';
46
+ let colorDisabled = 'var(--pv-color-gray-7)';
47
+ let invalidBackgroundColor = 'var(--pv-color-wrong-tint-5)';
48
+ let invalidBorderColor = 'var(--pv-color-wrong-tint-3)';
49
+ let backgroundColorFocus = 'var(--pv-color-secondary-tint-5)';
50
+ let borderColorFocus = 'var(--pv-color-secondary-tint-3)';
51
+ if (isDark) {
52
+ borderColor = 'var(--pv-color-gray-5)';
53
+ borderColorHover = 'var(--pv-color-gray-4)';
54
+ borderColorDisabled = 'var(--pv-color-gray-4)';
55
+ colorDisabled = 'var(--pv-color-gray-4)';
56
+ invalidBackgroundColor = 'var(--pv-color-wrong-shade-4)';
57
+ invalidBorderColor = 'var(--pv-color-wrong-shade-1)';
58
+ backgroundColorFocus = 'var(--pv-color-secondary-shade-4)';
59
+ borderColorFocus = 'var(--pv-color-secondary-shade-1)';
60
+ }
61
+ return ({
62
+ color,
63
+ borderColor,
64
+ '&:hover': {
65
+ backgroundColor: 'var(--pv-color-gray-3)',
66
+ borderColor: borderColorHover,
67
+ },
68
+ '&:disabled': {
69
+ cursor: 'not-allowed',
70
+ backgroundColor: 'var(--pv-color-gray-1)',
71
+ borderColor: borderColorDisabled,
72
+ color: colorDisabled,
73
+ },
74
+ '&:not(:disabled)': {
75
+ '&[aria-invalid]': {
76
+ backgroundColor: invalidBackgroundColor,
77
+ borderColor: invalidBorderColor,
78
+ },
79
+ '&:focus-visible': {
80
+ backgroundColor: backgroundColorFocus,
81
+ borderColor: borderColorFocus,
82
+ },
83
+ },
84
+ });
85
+ });
86
+ const NativeSelectLabel = styled('label')({
87
+ marginBottom: '2px',
88
+ display: 'inline-block',
89
+ });
90
+ const NativeSelectErrorMessage = styled(Typography)({
91
+ marginTop: '2px',
92
+ });
93
+ const NativeSelectContainer = styled('div')({
94
+ position: 'relative',
95
+ });
96
+ const NativeSelectArrowIcon = styled(ArrowDropDownIcon)((props) => ({
97
+ position: 'absolute',
98
+ right: '0px',
99
+ top: 'calc(50% - 12px)',
100
+ pointerEvents: 'none',
101
+ margin: '0px var(--pv-size-base)',
102
+ color: 'var(--pv-color-gray-10)',
103
+ ...(props.disabled && {
104
+ color: 'var(--pv-color-gray-7)',
105
+ }),
106
+ }));
107
+ /**
108
+ *
109
+ */
110
+ export const NativeSelect = React.forwardRef((props, ref) => {
111
+ const { options, size, label, inputProps, disabled, defaultValue, id, value, placeholder, required, name, inputRef, error, errorText, autoFocus, onChange, ...other } = props;
112
+ return (React.createElement("div", { ref: ref, ...other },
113
+ label && (React.createElement(NativeSelectLabel, { htmlFor: id },
114
+ React.createElement(Typography, { component: "span", variant: "c2", color: "gray-10" }, label))),
115
+ React.createElement(NativeSelectContainer, null,
116
+ React.createElement(NativeSelectRoot, { selectSize: size, disabled: disabled, defaultValue: defaultValue, id: id, value: value, required: required, name: name, ref: inputRef,
117
+ // eslint-disable-next-line jsx-a11y/no-autofocus
118
+ autoFocus: autoFocus, "aria-invalid": error || undefined, onChange: onChange, ...inputProps },
119
+ placeholder && (React.createElement("option", { value: "" }, placeholder)),
120
+ options.map((option) => (React.createElement("option", { key: option.value, value: option.value }, option.label)))),
121
+ React.createElement(NativeSelectArrowIcon, { disabled: disabled, "aria-hidden": true })),
122
+ error && errorText && (React.createElement(NativeSelectErrorMessage, { variant: "c2", color: "wrong" }, errorText))));
123
+ });
124
+ NativeSelect.displayName = 'NativeSelect';
125
+ NativeSelect.defaultProps = {
126
+ disabled: false,
127
+ size: 'medium',
128
+ };
129
+ //# sourceMappingURL=native_select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native_select.js","sourceRoot":"","sources":["../../../src/NativeSelect/native_select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAiF7C;;GAEG;AAEH;;GAEG;AACH,MAAM,gBAAgB,GAAG,MAAM,CAAC,QAAQ,CAAC,CACvC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACV,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,YAAY;IACvB,KAAK,EAAE,MAAM;IACb,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,8DAA8D;IACvE,eAAe,EAAE,wBAAwB;IACzC,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,yDAAyD;IACrE,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,0BAAsC;IAClD,QAAQ,EAAE,wBAAwB;IAClC,UAAU,EAAE,0BAA0B;IACtC,aAAa,EAAE,2BAA2B;IAC1C,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,OAAO,IAAI;QAClC,MAAM,EAAE,uBAAuB;KAChC,CAAC;IACF,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,QAAQ,IAAI;QACnC,MAAM,EAAE,uBAAuB;KAChC,CAAC;IACF,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,OAAO,IAAI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AO,EAAE,EAAE;YAEX,oBAAC,UAAU,IACT,SAAS,EAAC,MAAM,EAChB,OAAO,EAAC,IAAI,EACZ,KAAK,EAAC,SAAS,IAEd,KAAK,CACK,CACK,CACrB;QACD,oBAAC,qBAAqB;YACpB,oBAAC,gBAAgB,IACf,UAAU,EAAE,IAAI,EAChB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,QAAQ;gBACb,iDAAiD;gBACjD,SAAS,EAAE,SAAS,kBACN,KAAK,IAAI,SAAS,EAChC,QAAQ,EAAE,QAAQ,KACd,UAAU;gBAEb,WAAW,IAAI,CACd,gCAAQ,KAAK,EAAC,EAAE,IACb,WAAW,CACL,CACV;gBACA,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CACvB,gCACE,GAAG,EAAE,MAAM,CAAC,KAAK,EACjB,KAAK,EAAE,MAAM,CAAC,KAAK,IAElB,MAAM,CAAC,KAAK,CACN,CACV,CAAC,CACe;YACnB,oBAAC,qBAAqB,IACpB,QAAQ,EAAE,QAAQ,wBAElB,CACoB;QACvB,KAAK,IAAI,SAAS,IAAI,CACrB,oBAAC,wBAAwB,IACvB,OAAO,EAAC,IAAI,EACZ,KAAK,EAAC,OAAO,IAEZ,SAAS,CACe,CAC5B,CACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC;AAE1C,YAAY,CAAC,YAAY,GAAG;IAC1B,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,QAAQ;CACf,CAAC"}
@@ -1,17 +1,22 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import styled from '@emotion/styled';
3
+ import { useAutocomplete, } from '../hooks';
4
+ import { Popover } from '../Popover';
5
+ import { TextField } from '../TextField';
3
6
  import { Typography } from '../Typography';
4
- import { ArrowDropDownIcon } from '../icons';
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';
5
12
  /**
6
13
  *
7
14
  */
8
15
  /**
9
16
  * Styles.
10
17
  */
11
- const SelectRoot = styled('select')((props) => ({
12
- fontFamily: 'inherit',
18
+ const SelectField = styled(Typography)((props) => ({
13
19
  outline: 'none',
14
- cursor: 'pointer',
15
20
  boxSizing: 'border-box',
16
21
  width: '100%',
17
22
  borderRadius: '4px',
@@ -20,20 +25,22 @@ const SelectRoot = styled('select')((props) => ({
20
25
  borderStyle: 'solid',
21
26
  borderWidth: '1px',
22
27
  transition: 'background-color 200ms, color 200ms, border-color 200ms',
23
- display: 'block',
24
28
  appearance: 'none',
25
- fontWeight: 'var(--pv-text-c1-weight)',
26
- fontSize: 'var(--pv-text-c1-size)',
27
- lineHeight: 'var(--pv-text-c1-height)',
28
- letterSpacing: 'var(--pv-text-c1-spacing)',
29
- ...(props.selectSize === 'small' && {
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' && {
30
36
  height: 'var(--pv-size-base-6)',
31
37
  }),
32
- ...(props.selectSize === 'medium' && {
38
+ ...(props.size === 'medium' && {
33
39
  height: 'var(--pv-size-base-7)',
34
40
  }),
35
- ...(props.selectSize === 'large' && {
36
- height: 'var(--pv-size-base-8)',
41
+ ...(props.multiple === true && {
42
+ display: 'inline-flex',
43
+ alignItems: 'center',
37
44
  }),
38
45
  }), (props) => {
39
46
  const isDark = props.theme.mode === 'dark';
@@ -41,6 +48,7 @@ const SelectRoot = styled('select')((props) => ({
41
48
  ? 'var(--pv-color-white)'
42
49
  : 'var(--pv-color-black)';
43
50
  let borderColor = 'var(--pv-color-gray-8)';
51
+ let colorPlaceholder = 'var(--pv-color-gray-9)';
44
52
  let borderColorHover = 'var(--pv-color-gray-7)';
45
53
  let borderColorDisabled = 'var(--pv-color-gray-5)';
46
54
  let colorDisabled = 'var(--pv-color-gray-7)';
@@ -50,6 +58,7 @@ const SelectRoot = styled('select')((props) => ({
50
58
  let borderColorFocus = 'var(--pv-color-secondary-tint-3)';
51
59
  if (isDark) {
52
60
  borderColor = 'var(--pv-color-gray-5)';
61
+ colorPlaceholder = 'var(--pv-color-gray-6)';
53
62
  borderColorHover = 'var(--pv-color-gray-4)';
54
63
  borderColorDisabled = 'var(--pv-color-gray-4)';
55
64
  colorDisabled = 'var(--pv-color-gray-4)';
@@ -59,7 +68,6 @@ const SelectRoot = styled('select')((props) => ({
59
68
  borderColorFocus = 'var(--pv-color-secondary-shade-1)';
60
69
  }
61
70
  return ({
62
- color,
63
71
  borderColor,
64
72
  '&:hover': {
65
73
  backgroundColor: 'var(--pv-color-gray-3)',
@@ -72,6 +80,10 @@ const SelectRoot = styled('select')((props) => ({
72
80
  color: colorDisabled,
73
81
  },
74
82
  '&:not(:disabled)': {
83
+ color,
84
+ '&[aria-placeholder]': {
85
+ color: colorPlaceholder,
86
+ },
75
87
  '&[aria-invalid]': {
76
88
  backgroundColor: invalidBackgroundColor,
77
89
  borderColor: invalidBorderColor,
@@ -83,47 +95,175 @@ const SelectRoot = styled('select')((props) => ({
83
95
  },
84
96
  });
85
97
  });
86
- const SelectLabel = styled('label')({
87
- marginBottom: '2px',
88
- display: 'inline-block',
89
- });
90
- const SelectErrorMessage = styled(Typography)({
91
- marginTop: '2px',
92
- });
93
- const SelectContainer = styled('div')({
94
- position: 'relative',
95
- });
96
- const SelectArrowIcon = styled(ArrowDropDownIcon)((props) => ({
98
+ const SelectArrowIcon = styled(ArrowDropDownIcon)({
97
99
  position: 'absolute',
98
100
  right: '0px',
99
101
  top: 'calc(50% - 12px)',
100
- pointerEvents: 'none',
101
102
  margin: '0px var(--pv-size-base)',
102
103
  color: 'var(--pv-color-gray-10)',
103
- ...(props.disabled && {
104
- color: 'var(--pv-color-gray-7)',
104
+ '&[aria-disabled="true"]': {
105
+ color: 'inherit',
106
+ },
107
+ });
108
+ const SelectNativeInput = 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 SelectDropdownStateItem = styled('div')({
119
+ padding: 'var(--pv-size-base-3) var(--pv-size-base-2)',
120
+ });
121
+ const SelectDropdownList = styled('ul')({
122
+ maxHeight: '36vh',
123
+ overflowY: 'auto',
124
+ margin: 0,
125
+ listStyleType: 'none',
126
+ position: 'relative',
127
+ padding: '10px 0',
128
+ });
129
+ const SelectDropdownGroupName = 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 SelectDropdownGroupList = styled('ul')({
136
+ padding: 0,
137
+ listStyleType: 'none',
138
+ });
139
+ const SelectDropdownGroupListItem = styled(MenuItem)((props) => ({
140
+ ...(props.inGroup && {
141
+ padding: '0px var(--pv-size-base-2) 0 var(--pv-size-base-3)',
105
142
  }),
106
143
  }));
144
+ const SelectPopover = styled(Popover)({
145
+ minWidth: 240,
146
+ });
147
+ const SelectTagsList = styled('div')({
148
+ overflow: 'hidden',
149
+ width: '100%',
150
+ display: 'grid',
151
+ gridTemplateColumns: 'repeat(auto-fit, minmax(0, max-content))',
152
+ gap: 'var(--pv-size-base)',
153
+ });
154
+ const SelectTag = styled(Chip)((props) => ({
155
+ label: 'Select-tag',
156
+ borderRadius: '3px',
157
+ margin: 0,
158
+ ...(props.size === 'small' && {
159
+ height: 'var(--pv-size-base-5)',
160
+ }),
161
+ }));
162
+ const SelectTagSize = styled(Typography)({
163
+ margin: '0 var(--pv-size-base-2)',
164
+ });
165
+ const SelectSearchInput = styled(TextField)({
166
+ padding: 'var(--pv-size-base-3) var(--pv-size-base-3) var(--pv-size-base-2)',
167
+ });
168
+ const SelectCreateNewButton = styled(Button)({
169
+ width: '100%',
170
+ borderRadius: 0,
171
+ justifyContent: 'left',
172
+ padding: '0px var(--pv-size-base-2)',
173
+ });
174
+ const SelectError = styled(Typography)({
175
+ marginTop: '2px',
176
+ });
177
+ const SelectLabel = styled('label')({
178
+ label: 'TextField-label',
179
+ marginBottom: '2px',
180
+ display: 'inline-block',
181
+ });
107
182
  /**
108
183
  *
109
184
  */
110
- export const Select = React.forwardRef((props, ref) => {
111
- const { options, size, label, inputProps, disabled, defaultValue, id, value, placeholder, required, name, inputRef, error, errorText, autoFocus, onChange, ...other } = props;
112
- return (React.createElement("div", { ref: ref, ...other },
113
- label && (React.createElement(SelectLabel, { htmlFor: id },
185
+ export const Select = (props) => {
186
+ 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;
187
+ const { id, value, searchValue, groupedOptions, getRootProps, getInputLabelProps, getInputProps, getListboxProps, getOptionProps, getPopoverProps, getTagProps, getOptionLabel, } = useAutocomplete(props);
188
+ const { onChange, ...otherInputProps } = getInputProps();
189
+ const popoverProps = getPopoverProps();
190
+ const handleCreate = (event) => {
191
+ if (onCreate) {
192
+ onCreate(event, searchValue);
193
+ }
194
+ popoverProps.onClose(event);
195
+ };
196
+ const defaultRenderOption = (propsOption, option) => (React.createElement(SelectDropdownGroupListItem, { ...propsOption, inGroup: Boolean(groupBy) }, getOptionLabel(option)));
197
+ const renderGroup = (params) => (React.createElement("li", { key: params.key },
198
+ React.createElement(SelectDropdownGroupName, { variant: "c1", color: "gray-10" }, params.group),
199
+ React.createElement(SelectDropdownGroupList, null, params.children)));
200
+ const renderValue = () => {
201
+ if (!value || (Array.isArray(value) && value.length === 0)) {
202
+ return null;
203
+ }
204
+ if (Array.isArray(value)) {
205
+ const more = (value.length > limitTags) ? (value.length - limitTags) : 0;
206
+ const valueLimits = more > 0 ? value.slice(0, limitTags) : value;
207
+ return (React.createElement(React.Fragment, null,
208
+ React.createElement(SelectTagsList, null, valueLimits.map((v, index) => (React.createElement(SelectTag, { ...getTagProps(v, index), color: "secondary", variant: "contained", size: size }, getOptionLabel(v))))),
209
+ !!more && (React.createElement(SelectTagSize, { variant: "c2", color: "gray-9" }, getLimitTagsText(more)))));
210
+ }
211
+ return getOptionLabel(value);
212
+ };
213
+ const renderedValue = renderValue();
214
+ const isValueEmpty = renderedValue === null;
215
+ const defaultRenderRoot = (propsRoot, valueRoot) => (React.createElement(SelectField, { ...propsRoot, noWrap: true,
216
+ // @ts-ignore
217
+ component: "button", type: "button", variant: size === 'small' ? 'c1' : 'b3', "aria-invalid": error || undefined, "aria-placeholder": isValueEmpty || undefined, multiple: multiple, size: size },
218
+ isValueEmpty ? placeholder : renderedValue,
219
+ React.createElement(SelectArrowIcon, { "aria-disabled": disabled, "aria-hidden": true }),
220
+ React.createElement(SelectNativeInput, { 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: () => { } })));
221
+ const renderOption = renderOptionProp || defaultRenderOption;
222
+ const renderRoot = renderRootProp || defaultRenderRoot;
223
+ const renderListOption = (option, index) => {
224
+ const optionProps = getOptionProps(option, index);
225
+ return renderOption(optionProps, option);
226
+ };
227
+ return (React.createElement("div", { className: className },
228
+ label && (React.createElement(SelectLabel, { ...getInputLabelProps() },
114
229
  React.createElement(Typography, { component: "span", variant: "c2", color: "gray-10" }, label))),
115
- React.createElement(SelectContainer, null,
116
- React.createElement(SelectRoot, { selectSize: size, disabled: disabled, defaultValue: defaultValue, id: id, value: value, required: required, name: name, ref: inputRef,
117
- // eslint-disable-next-line jsx-a11y/no-autofocus
118
- autoFocus: autoFocus, "aria-invalid": error || undefined, onChange: onChange, ...inputProps },
119
- placeholder && (React.createElement("option", { value: "" }, placeholder)),
120
- options.map((option) => (React.createElement("option", { key: option.value, value: option.value }, option.label)))),
121
- React.createElement(SelectArrowIcon, { disabled: disabled, "aria-hidden": true })),
122
- error && errorText && (React.createElement(SelectErrorMessage, { variant: "c2", color: "wrong" }, errorText))));
123
- });
124
- Select.displayName = 'Select';
230
+ renderRoot({
231
+ ...getRootProps(),
232
+ disabled,
233
+ }, value, getTagProps),
234
+ error && errorText && (React.createElement(SelectError, { variant: "c2", color: "wrong" }, errorText)),
235
+ React.createElement(SelectPopover, { placement: "bottom-start", allowUseSameWidth: true, ...popoverProps },
236
+ !disableSearch && (React.createElement(Box, { borderColor: "gray-3", borderPosition: "bottom", borderStyle: "solid", borderWidth: 1 },
237
+ React.createElement(SelectSearchInput, { id: otherInputProps.id, inputProps: otherInputProps, onChange: onChange, placeholder: "Search", disabled: loading }))),
238
+ loading && groupedOptions.length === 0 && (React.createElement(SelectDropdownStateItem, null, typeof loadingText === 'string' ? (React.createElement(Typography, { variant: "b2", color: "gray-10" }, loadingText)) : loadingText)),
239
+ groupedOptions.length === 0 && !loading && (React.createElement(SelectDropdownStateItem, null, typeof noOptionsText === 'string' ? (React.createElement(Typography, { variant: "b2", color: "gray-10" }, noOptionsText)) : noOptionsText)),
240
+ groupedOptions.length > 0 && (React.createElement(SelectDropdownList, { ...getListboxProps() }, groupedOptions
241
+ // @ts-ignore
242
+ .map((option, index) => {
243
+ // @ts-ignore
244
+ if (groupBy && 'options' in option) {
245
+ return renderGroup({
246
+ key: option.key,
247
+ group: option.group,
248
+ // @ts-ignore
249
+ children: option.options.map((option2, index2) => (renderListOption(option2, option.index + index2))),
250
+ });
251
+ }
252
+ return renderListOption(option, index);
253
+ }))),
254
+ (allowCreateOption && searchValue.length > 0 && !loading) && (React.createElement(Box, { borderColor: "gray-3", borderPosition: "top", borderStyle: "solid", borderWidth: 1 },
255
+ React.createElement(SelectCreateNewButton, { color: "secondary", textVariant: "b3", onClick: handleCreate, startIcon: React.createElement(PlusIcon, null) }, createOptionText.replace('{{value}}', searchValue)))))));
256
+ };
257
+ // @ts-ignore
125
258
  Select.defaultProps = {
126
- disabled: false,
259
+ disableSearch: false,
260
+ noOptionsText: 'No options',
261
+ loading: false,
262
+ loadingText: 'Loading...',
263
+ limitTags: 2,
264
+ required: false,
265
+ allowCreateOption: false,
266
+ createOptionText: 'Create "{{value}}"',
127
267
  size: 'medium',
128
268
  };
129
269
  //# sourceMappingURL=select.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","sourceRoot":"","sources":["../../../src/Select/select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAiF7C;;GAEG;AAEH;;GAEG;AACH,MAAM,UAAU,GAAG,MAAM,CAAC,QAAQ,CAAC,CACjC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACV,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,MAAM;IACf,MAAM,EAAE,SAAS;IACjB,SAAS,EAAE,YAAY;IACvB,KAAK,EAAE,MAAM;IACb,YAAY,EAAE,KAAK;IACnB,OAAO,EAAE,8DAA8D;IACvE,eAAe,EAAE,wBAAwB;IACzC,WAAW,EAAE,OAAO;IACpB,WAAW,EAAE,KAAK;IAClB,UAAU,EAAE,yDAAyD;IACrE,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,0BAAsC;IAClD,QAAQ,EAAE,wBAAwB;IAClC,UAAU,EAAE,0BAA0B;IACtC,aAAa,EAAE,2BAA2B;IAC1C,GAAG,CAAC,KA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ACjD,CAAC;qBACH,CAAC,CAAC;iBACJ;gBAED,OAAO,gBAAgB,CAAC,MAAW,EAAE,KAAK,CAAC,CAAC;YAC9C,CAAC,CAAC,CACe,CACtB;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,qBAAqB,IACpB,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,CAC7B,CACpB,CACP,CACa,CACZ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,aAAa;AACb,MAAM,CAAC,YAAY,GAAG;IACpB,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"}
@@ -17,7 +17,7 @@ export const Toast = (props) => {
17
17
  };
18
18
  }
19
19
  return undefined;
20
- });
20
+ }, []);
21
21
  return (React.createElement(Fade, { in: true },
22
22
  React.createElement(Alert, { ...alertProps, onClose: isClosable ? handleClose : undefined }, children)));
23
23
  };
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../src/Toast/toast.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAc,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,IAAI,EAA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EACV,QAAQ,EACR,OAAO,GACR,GAAG,KAAK,CAAC;IAEV,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,OAAO,CAAC,EAAE,CAAC,CAAC;IACd,CAAC,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,QAAQ,GAAG,CAAC,EAAE;YAChB,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAC/B,WAAW,EACX,QAAQ,CACT,CAAC;YAEF,OAAO,GAAG,EAAE;gBACV,YAAY,CAAC,OAAO,CAAC,CAAC;YACxB,CAAC,CAAC;SACH;QAED,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,oBAAC,IAAI,IAAC,EAAE;QACN,oBAAC,KAAK,OACA,UAAU,EACd,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,IAE5C,QAAQ,CACH,CACH,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,KAAK,CAAC,WAAW,GAAG,OAAO,CAAC;AAE5B,KAAK,CAAC,YAAY,GAAG;IACnB,QAAQ,EAAE,IAAI;CACf,CAAC"}
@@ -20,9 +20,9 @@ export * from './Popper';
20
20
  export * from './Popover';
21
21
  export * from './Portal';
22
22
  export * from './Radio';
23
- export * from './Select';
23
+ export * from './NativeSelect';
24
24
  export * from './Skeleton';
25
- export * from './Autocomplete';
25
+ export * from './Select';
26
26
  export * from './Slide';
27
27
  export * from './Slider';
28
28
  export * from './Switch';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AA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ACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ export { NativeSelect } from './native_select';
@@ -0,0 +1,76 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Types.
4
+ */
5
+ declare type NativeSelectOwnProps = {
6
+ options: {
7
+ value: string;
8
+ label: string;
9
+ }[];
10
+ /**
11
+ * If `true`, the component is disabled.
12
+ */
13
+ disabled?: boolean;
14
+ /**
15
+ * The size of the select.
16
+ */
17
+ size?: ('small' | 'medium' | 'large');
18
+ /**
19
+ * The className of the component.
20
+ */
21
+ className?: string;
22
+ /**
23
+ * Attributes applied to the `input` element.
24
+ */
25
+ inputProps?: React.SelectHTMLAttributes<HTMLSelectElement>;
26
+ /**
27
+ * The default value. Use when the component is not controlled.
28
+ */
29
+ defaultValue?: string;
30
+ /**
31
+ * The id of the `input` element.
32
+ */
33
+ id?: string;
34
+ /**
35
+ * The label of the input. It is only used for layout.
36
+ */
37
+ label?: string;
38
+ /**
39
+ * The value of the `input` element, required for a controlled component.
40
+ */
41
+ value?: string;
42
+ /**
43
+ * The short hint displayed in the `input` before the user enters a value.
44
+ */
45
+ placeholder?: string;
46
+ /**
47
+ * If `true`, the `input` element is required.
48
+ */
49
+ required?: boolean;
50
+ /**
51
+ * Name attribute of the `input` element.
52
+ */
53
+ name?: string;
54
+ /**
55
+ * Pass a ref to the `input` element.
56
+ */
57
+ inputRef?: React.ForwardedRef<HTMLSelectElement>;
58
+ /**
59
+ * If `true`, the `input` element is focused during the first mount.
60
+ */
61
+ autoFocus?: boolean;
62
+ /**
63
+ * If `true`, the `input` will indicate an error.
64
+ */
65
+ error?: boolean;
66
+ errorText?: string;
67
+ /**
68
+ * Callback fired when the value is changed.
69
+ */
70
+ onChange?: React.ChangeEventHandler<HTMLSelectElement>;
71
+ };
72
+ /**
73
+ *
74
+ */
75
+ export declare const NativeSelect: React.ForwardRefExoticComponent<NativeSelectOwnProps & Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> & React.RefAttributes<HTMLDivElement>>;
76
+ export {};