@vchasno/ui-kit 0.4.33 → 0.4.35
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.
- package/CHANGELOG.md +12 -0
- package/dist/components/Select/Select.d.ts +3 -3
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectCreatable.d.ts +2 -3
- package/dist/components/Select/SelectCreatable.js.map +1 -1
- package/dist/components/Select/types.d.ts +3 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.4.35] - 2024-12-31
|
|
11
|
+
|
|
12
|
+
## Changed
|
|
13
|
+
|
|
14
|
+
- SelectRef export
|
|
15
|
+
|
|
16
|
+
## [0.4.34] - 2024-12-31
|
|
17
|
+
|
|
18
|
+
## Changed
|
|
19
|
+
|
|
20
|
+
- `Select`, `SelectCreatable` change SelectRef type + export
|
|
21
|
+
|
|
10
22
|
## [0.4.33] - 2024-12-31
|
|
11
23
|
|
|
12
24
|
## Changed
|
|
@@ -3,15 +3,15 @@ import * as react_select_dist_declarations_src_components_Menu from 'react-selec
|
|
|
3
3
|
import * as react_select_dist_declarations_src_components_indicators from 'react-select/dist/declarations/src/components/indicators';
|
|
4
4
|
import * as _emotion_react from '@emotion/react';
|
|
5
5
|
import * as react_select from 'react-select';
|
|
6
|
-
import { Props, GroupBase
|
|
6
|
+
import { Props, GroupBase } from 'react-select';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { WithLabel, WithHint, LoadingFeedback, ErrorFeedback, DataQa, HideEmptyMeta, WithPulseAnimation } from '../types.js';
|
|
9
|
-
import { Option } from './types.js';
|
|
9
|
+
import { Option, SelectRef } from './types.js';
|
|
10
10
|
|
|
11
11
|
interface SelectProps extends Props<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation> {
|
|
12
12
|
wide?: boolean;
|
|
13
13
|
}
|
|
14
|
-
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<
|
|
14
|
+
declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<SelectRef>>;
|
|
15
15
|
declare const SelectComponents: {
|
|
16
16
|
ClearIndicator: <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(props: react_select.ClearIndicatorProps<Option, IsMulti, Group>) => _emotion_react.jsx.JSX.Element;
|
|
17
17
|
Control: <Option_1, IsMulti_1 extends boolean, Group_1 extends GroupBase<Option_1>>(props: react_select.ControlProps<Option_1, IsMulti_1, Group_1>) => _emotion_react.jsx.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport ReactSelect, { GroupBase, Props as ReactSelectProps,
|
|
1
|
+
{"version":3,"file":"Select.js","sources":["../../../src/components/Select/Select.tsx"],"sourcesContent":["import React, { forwardRef } from 'react';\nimport ReactSelect, { GroupBase, Props as ReactSelectProps, components } from 'react-select';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport { SelectCreatableProps } from './SelectCreatable';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option, SelectRef } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport interface SelectProps\n extends ReactSelectProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n WithPulseAnimation\n > {\n wide?: boolean;\n}\n\nconst Select = forwardRef<SelectRef, SelectProps>(({\n className,\n label,\n hint,\n wide,\n required,\n loading,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n error = '',\n dataQa,\n closeMenuOnSelect = true,\n hideEmptyMeta = false,\n pulse,\n ...rest\n}, ref) => {\n return (\n <label\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse && !isDisabled,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n }, \n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactSelect\n ref={ref}\n required={required}\n isLoading={loading}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n closeMenuOnSelect={closeMenuOnSelect}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n});\n\nSelect.displayName = 'Select';\n\nexport const SelectComponents = components;\n\nexport default Select;\n"],"names":["Select","forwardRef","ref","className","label","hint","wide","required","loading","isDisabled","menuPlacement","_param_noOptionsMessage","_param","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","placeholder","components","error","dataQa","closeMenuOnSelect","hideEmptyMeta","pulse","rest","React","data-qa","cn","Label","ReactSelect","isLoading","_object_spread","CustomComponents","classNamePrefix","_param_menuPlacement","styles","composeStyles","InputMeta","displayName","SelectComponents"],"mappings":"msBAsCMA,IAAAA,eAASC,EAAmC,SAmB/CC,CAAAA,CAAAA,CAAAA,UAlBCC,EAAAA,EAAAA,SAAAA,CACAC,IAAAA,KACAC,CA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AA,CAAA,EACOK,EACAZ,EAAKW,MAAM,CAIzBb,+UAAAA,CA3CTA,CAAAA,AAAAA,KAAAA,IAAAA,GACAC,CAAAA,GA0C2BJ,GAAUf,EAAc,WAAA,EAAAqB,EAACY,aAAAA,CAAAA,EAAAA,CAAUjC,KAAMA,EAAMe,MAAOA,IAArC,KAGhD,EAEApB,CAAAA,EAAOuC,WAAW,CAAG,SAEd,IAAMC,EAAmBrB"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import React, { InputHTMLAttributes } from 'react';
|
|
2
|
-
import { SelectInstance } from 'react-select';
|
|
3
2
|
import { CreatableProps } from 'react-select/creatable';
|
|
4
3
|
import { GroupBase } from 'react-select/dist/declarations/src/types';
|
|
5
4
|
import { WithLabel, WithHint, LoadingFeedback, ErrorFeedback, DataQa, HideEmptyMeta, WithPulseAnimation } from '../types.js';
|
|
6
|
-
import { Option } from './types.js';
|
|
5
|
+
import { Option, SelectRef } from './types.js';
|
|
7
6
|
|
|
8
7
|
interface SelectCreatableProps extends CreatableProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback & DataQa & HideEmptyMeta & WithPulseAnimation> {
|
|
9
8
|
wide?: boolean;
|
|
10
9
|
labelProps?: InputHTMLAttributes<HTMLLabelElement>;
|
|
11
10
|
}
|
|
12
|
-
declare const SelectCreatable: React.ForwardRefExoticComponent<SelectCreatableProps & React.RefAttributes<
|
|
11
|
+
declare const SelectCreatable: React.ForwardRefExoticComponent<SelectCreatableProps & React.RefAttributes<SelectRef>>;
|
|
13
12
|
|
|
14
13
|
export { type SelectCreatableProps, SelectCreatable as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SelectCreatable.js","sources":["../../../src/components/Select/SelectCreatable.tsx"],"sourcesContent":["import React, { InputHTMLAttributes, forwardRef } from 'react';\nimport
|
|
1
|
+
{"version":3,"file":"SelectCreatable.js","sources":["../../../src/components/Select/SelectCreatable.tsx"],"sourcesContent":["import React, { InputHTMLAttributes, forwardRef } from 'react';\nimport ReactSelectCreatable, { CreatableProps } from 'react-select/creatable';\nimport type { GroupBase } from 'react-select/dist/declarations/src/types';\n\nimport cn from 'classnames';\n\nimport InputMeta from '../InputMeta';\nimport {\n DataQa,\n ErrorFeedback,\n HideEmptyMeta,\n LoadingFeedback,\n WithHint,\n WithLabel,\n WithPulseAnimation,\n} from '../types';\nimport Label from './Label';\nimport CustomComponents from './customComponents';\nimport defaultProps from './defaultProps';\nimport { Option, SelectRef } from './types';\nimport { composeStyles } from './utils';\n\nimport './Select.global.css';\n\nexport type SelectOption = Option;\n\nexport interface SelectCreatableProps\n extends CreatableProps<Option, false | true, GroupBase<Option>>,\n Partial<\n WithLabel &\n WithHint &\n LoadingFeedback &\n ErrorFeedback &\n DataQa &\n HideEmptyMeta &\n WithPulseAnimation\n > {\n wide?: boolean;\n labelProps?: InputHTMLAttributes<HTMLLabelElement>;\n}\n\nconst SelectCreatable = forwardRef<SelectRef, SelectCreatableProps>(({\n className,\n label,\n hint,\n wide,\n required,\n loading,\n isDisabled,\n menuPlacement = 'auto',\n noOptionsMessage = defaultProps.noOptionsMessageDefault,\n loadingMessage = defaultProps.loadingMessageDefault,\n placeholder = ' ', //need \"space\" for correct label working\n components = {},\n isClearable,\n dataQa,\n labelProps,\n hideEmptyMeta = false,\n pulse,\n error,\n ...rest\n}, ref) => {\n return (\n <label\n {...labelProps}\n data-qa={dataQa}\n className={cn(\n 'vchasno-ui-select',\n {\n '--pulse': pulse && !isDisabled,\n '--required': required,\n '--disabled': isDisabled,\n '--wide': wide,\n '--error': error,\n },\n className,\n )}\n >\n {label && <Label label={label} />}\n <ReactSelectCreatable\n ref={ref}\n isClearable={isClearable}\n required={required}\n isLoading={loading}\n components={{\n ...(CustomComponents as SelectCreatableProps['components']),\n ...components,\n }}\n classNamePrefix=\"vchasno-ui-select\"\n menuPlacement={menuPlacement}\n isDisabled={isDisabled}\n noOptionsMessage={noOptionsMessage}\n loadingMessage={loadingMessage}\n placeholder={placeholder}\n {...rest}\n styles={\n {\n ...composeStyles,\n ...rest.styles,\n } as never\n }\n />\n {hideEmptyMeta && !error && !hint ? null : <InputMeta hint={hint} error={error} />}\n </label>\n );\n});\n\nSelectCreatable.displayName = 'SelectCreatable';\n\nexport default SelectCreatable;\n"],"names":["SelectCreatable","forwardRef","ref","className","label","hint","wide","required","loading","isDisabled","menuPlacement","_param_noOptionsMessage","_param","noOptionsMessage","defaultProps","noOptionsMessageDefault","loadingMessage","loadingMessageDefault","placeholder","components","isClearable","dataQa","labelProps","hideEmptyMeta","pulse","error","rest","React","data-qa","cn","Label","ReactSelectCreatable","isLoading","_object_spread","CustomComponents","classNamePrefix","_param_menuPlacement","styles","composeStyles","InputMeta","displayName"],"mappings":"6iCAyCMA,IAAAA,eAAkBC,EAA4C,SAoBjEC,CAAAA,CAAAA,CAAAA,MAnBCC,EAAAA,EAAAA,SAAAA,CACAC,IAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACAC,EAAAA,EAAAA,IAAAA,CACAC,IAAAA,QACAC,CAAAA,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,UAAAA,CAAAA,EAAAA,EACAC,cAAgBC,EAAAC,EAChBC,iBAAAA,EAAmBC,AAAAA,KAAAA,IAAAA,EAAAA,EAAaC,uBAAuB,CACvDC,EAAAA,EAAAA,EAAAA,cAAAA,CAAAA,aAAiBF,EAAaG,qBAAqB,OACnDC,WAAAA,KACAC,UAAAA,CACAC,EAAAA,EAAAA,YACAC,EAAAA,EAAAA,MAAAA,CACAC,IAAAA,UACAC,CAAAA,EAAAA,EAAAA,aAAAA,CACAC,EAAAA,EAAAA,KACAC,CAAAA,EAAAA,EAAAA,KACGC,CAAAA,EAAAA,sXAAAA,EAAAA,CAlBHvB,YACAC,QACAC,OACAC,OACAC,WACAC,UACAC,aACAC,gBACAG,mBACAG,iBACAE,cACAC,aACAC,cACAC,SACAC,aACAC,gBACAC,QACAC,UAGA,OACI,WAAA,EAAAE,gBAACvB,QACOkB,EAAAA,EAAAA,CAAAA,EAAAA,GAAAA,CACJM,UAASP,EACTlB,UAAW0B,EACP,oBACA,CACI,UAAWL,GAAS,CAACf,EACrB,aAAcF,EACd,aAAcE,EACd,SAAUH,EACV,UAAWmB,CAEftB,EAAAA,EAGHC,GAAAA,GAAAA,WAAAA,EAASuB,EAACG,aAAAA,CAAAA,EAAAA,CAAM1B,MAAOA,IACxB,WAAA,EAAAuB,EAACI,aAAAA,CAAAA,EAAAA,EAAAA,EAAAA,CACG7B,IAAKA,EACLkB,YAAaA,EACbb,SAAUA,EACVyB,UAAWxB,EACXW,WAAYc,KACJC,EAhCpBf,AAAAA,KAAAA,IAAAA,EAAa,CACbC,EAAAA,GAkCYe,gBAAgB,oBAChBzB,cAxCI0B,AAAA,KAAA,IAAAA,EAAA,OAAAA,EAyCJ3B,WAAYA,EACZI,iBAAkBA,EAClBG,eAAgBA,EAChBE,YAzCZA,AAAAA,KAAAA,IAAAA,EAAc,KA0CEQ,EAAAA,GAAAA,CACJW,OACIJ,EAAA,CAAA,EACOK,EACAZ,EAAKW,MAAM,CAIzBd,IAAAA,cA5CTC,IA4C2BC,GAAUpB,EAAc,WAAA,EAAAsB,EAACY,aAAAA,CAAAA,EAAAA,CAAUlC,KAAMA,EAAMoB,MAAOA,IAArC,KAGhD,EAEAzB,CAAAA,EAAgBwC,WAAW,CAAG"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { ControlProps } from 'react-select';
|
|
2
|
+
import Select from 'react-select/dist/declarations/src/Select';
|
|
2
3
|
import { GroupBase } from 'react-select/dist/declarations/src/types';
|
|
3
4
|
|
|
4
5
|
interface Option {
|
|
5
6
|
readonly label: string;
|
|
6
7
|
readonly value: string;
|
|
7
8
|
}
|
|
9
|
+
type SelectRef = Select<Option, boolean, GroupBase<Option>>;
|
|
8
10
|
interface CustomControlProps extends ControlProps<Option, boolean, GroupBase<Option>> {
|
|
9
11
|
label?: string;
|
|
10
12
|
}
|
|
11
13
|
|
|
12
|
-
export type { CustomControlProps, Option };
|
|
14
|
+
export type { CustomControlProps, Option, SelectRef };
|
package/dist/index.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export { default as ProjectsPopover, ProjectsPopoverProps } from './components/P
|
|
|
25
25
|
export { default as PulseDot, PulseDotProps } from './components/PulseDot/PulseDot.js';
|
|
26
26
|
export { default as Select, SelectComponents, SelectProps } from './components/Select/Select.js';
|
|
27
27
|
export { default as SelectCreatable, SelectCreatableProps } from './components/Select/SelectCreatable.js';
|
|
28
|
-
export { CustomControlProps, Option as SelectOption } from './components/Select/types.js';
|
|
28
|
+
export { CustomControlProps, Option as SelectOption, SelectRef } from './components/Select/types.js';
|
|
29
29
|
export { default as AsyncSelect, AsyncSelectProps } from './components/Select/AsyncSelect.js';
|
|
30
30
|
export { default as Snackbar, SnackbarIconProps, SnackbarProps, snackbarToast } from './components/Snackbar/Snackbar.js';
|
|
31
31
|
export { default as Spinner, SpinnerProps } from './components/Spinner/Spinner.js';
|