@vchasno/ui-kit 0.2.0 → 0.2.2

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 CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.2.2] - 2024-01-18
11
+
12
+ ## Fixed
13
+
14
+ - add export SelectOption type from Select, SelectCreatable components
15
+ - fix input styles vchasno-ui-input__wrapper height
16
+
17
+ - ## [0.2.1] - 2024-01-18
18
+
19
+ ## Fixed
20
+
21
+ - description css exports in package.json
22
+
10
23
  ## [0.2.0] - 2024-01-18
11
24
 
12
25
  ## Added
package/README.md CHANGED
@@ -53,9 +53,9 @@ Suggestions:
53
53
 
54
54
  ```jsx
55
55
  // index.tsx
56
- import "@vchasno/ui-kit/dist/css/_reset.css"; // optional reset styles
57
- import "@vchasno/ui-kit/dist/css/_base.css"; // optional base styles
58
- import "@vchasno/ui-kit/dist/css/_theme.css"; // optional theme variables
56
+ import "@vchasno/ui-kit/reset.css"; // optional reset styles
57
+ import "@vchasno/ui-kit/base.css"; // optional base styles
58
+ import "@vchasno/ui-kit/theme.css"; // optional theme variables
59
59
  import "src/styles/_theme-override.css"; // yuor own css file with theme variables override
60
60
  ```
61
61
 
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Props as ReactSelectProps } from 'react-select';
3
3
  import type { ErrorFeedback, LoadingFeedback, WithHint, WithLabel } from '../types';
4
+ import { Option } from './types';
4
5
  import './Select.global.css';
6
+ export type SelectOption = Option;
5
7
  export interface SelectProps extends ReactSelectProps, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
6
8
  wide?: boolean;
7
9
  dataQa?: string;
@@ -4,6 +4,7 @@ import type { GroupBase } from 'react-select/dist/declarations/src/types';
4
4
  import type { ErrorFeedback, LoadingFeedback, WithHint, WithLabel } from '../types';
5
5
  import { Option } from './types';
6
6
  import './Select.global.css';
7
+ export type SelectOption = Option;
7
8
  export interface SelectCreatableProps extends CreatableProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
8
9
  wide?: boolean;
9
10
  labelProps?: InputHTMLAttributes<HTMLLabelElement>;
@@ -18,10 +18,16 @@ interface WithHint {
18
18
  hint: string;
19
19
  }
20
20
 
21
+ interface Option {
22
+ readonly label: string;
23
+ readonly value: string;
24
+ }
25
+
26
+ type SelectOption = Option;
21
27
  interface SelectProps extends Props, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
22
28
  wide?: boolean;
23
29
  dataQa?: string;
24
30
  }
25
31
  declare const Select: React.FC<SelectProps>;
26
32
 
27
- export { type SelectProps, Select as default };
33
+ export { type SelectOption, type SelectProps, Select as default };
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Props as ReactSelectProps } from 'react-select';
3
3
  import type { ErrorFeedback, LoadingFeedback, WithHint, WithLabel } from '../types';
4
+ import { Option } from './types';
4
5
  import './Select.global.css';
6
+ export type SelectOption = Option;
5
7
  export interface SelectProps extends ReactSelectProps, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
6
8
  wide?: boolean;
7
9
  dataQa?: string;
@@ -4,6 +4,7 @@ import type { GroupBase } from 'react-select/dist/declarations/src/types';
4
4
  import type { ErrorFeedback, LoadingFeedback, WithHint, WithLabel } from '../types';
5
5
  import { Option } from './types';
6
6
  import './Select.global.css';
7
+ export type SelectOption = Option;
7
8
  export interface SelectCreatableProps extends CreatableProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
8
9
  wide?: boolean;
9
10
  labelProps?: InputHTMLAttributes<HTMLLabelElement>;
@@ -24,6 +24,7 @@ interface Option {
24
24
  readonly value: string;
25
25
  }
26
26
 
27
+ type SelectOption = Option;
27
28
  interface SelectCreatableProps extends CreatableProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
28
29
  wide?: boolean;
29
30
  labelProps?: InputHTMLAttributes<HTMLLabelElement>;
@@ -31,4 +32,4 @@ interface SelectCreatableProps extends CreatableProps<Option, false | true, Grou
31
32
  }
32
33
  declare const SelectCreatable: React.FC<SelectCreatableProps>;
33
34
 
34
- export { type SelectCreatableProps, SelectCreatable as default };
35
+ export { type SelectCreatableProps, type SelectOption, SelectCreatable as default };
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Props as ReactSelectProps } from 'react-select';
3
3
  import type { ErrorFeedback, LoadingFeedback, WithHint, WithLabel } from '../types';
4
+ import { Option } from './types';
4
5
  import './Select.global.css';
6
+ export type SelectOption = Option;
5
7
  export interface SelectProps extends ReactSelectProps, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
6
8
  wide?: boolean;
7
9
  dataQa?: string;
@@ -4,6 +4,7 @@ import type { GroupBase } from 'react-select/dist/declarations/src/types';
4
4
  import type { ErrorFeedback, LoadingFeedback, WithHint, WithLabel } from '../types';
5
5
  import { Option } from './types';
6
6
  import './Select.global.css';
7
+ export type SelectOption = Option;
7
8
  export interface SelectCreatableProps extends CreatableProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
8
9
  wide?: boolean;
9
10
  labelProps?: InputHTMLAttributes<HTMLLabelElement>;
package/dist/index.js CHANGED
@@ -209,7 +209,7 @@ var LabelText = function (_a) {
209
209
  React__default.createElement("sup", null, "*")));
210
210
  };
211
211
 
212
- var css_248z$b = ".vchasno-ui-input {\n display: inline-flex;\n flex-direction: column;\n gap: 5px;\n}\n\n.vchasno-ui-input input::placeholder {\n color: var(--vchasno-ui-input-border-color-default);\n font-size: var(--vchasno-ui-input-font-size);\n line-height: calc(var(--vchasno-ui-input-font-size) * 1.2);\n transition: color var(--vchasno-ui-transition-duration-sec, 0.3s);\n}\n\n.vchasno-ui-input .vchasno-ui-text-input,\n.vchasno-ui-input .vchasno-ui-mask-input {\n flex-grow: 1;\n}\n\n.vchasno-ui-input.--wide {\n width: 100%;\n}\n\n.vchasno-ui-input__wrapper {\n position: relative;\n display: flex;\n height: 40px;\n align-items: center;\n padding-right: 33px;\n padding-left: 10px;\n border: 1px solid var(--vchasno-ui-input-border-color-default);\n border-radius: 4px;\n background-color: #fff;\n gap: 5px;\n transition: border var(--vchasno-ui-transition-duration-sec, 0.3s);\n}\n\n.vchasno-ui-input__wrapper > input {\n max-width: 100%;\n}\n\n.vchasno-ui-input__wrapper__start-element {\n display: flex;\n flex-grow: 0;\n flex-shrink: 0;\n align-items: center;\n font-size: var(--vchasno-ui-input-font-size, 14px);\n line-height: var(--vchasno-ui-input-font-size, 14px);\n}\n\n.vchasno-ui-input__feedback {\n position: absolute;\n top: 10px;\n right: 10px;\n display: block;\n width: 18px;\n height: 18px;\n}\n\n.vchasno-ui-input .vchasno-ui-spinner__svg__circle {\n stroke: var(--vchasno-ui-input-border-color-focused);\n}\n\n.vchasno-ui-input.--disabled .vchasno-ui-input__wrapper {\n background-color: #f3f6f8;\n color: #b6cadb;\n}\n\n.vchasno-ui-input:not(.--disabled) .vchasno-ui-input__wrapper:hover {\n cursor: text;\n}\n\n.vchasno-ui-input:not(.--disabled):hover .vchasno-ui-input__wrapper,\n.vchasno-ui-input:not(.--disabled):focus-within .vchasno-ui-input__wrapper {\n border-color: var(--vchasno-ui-input-border-color-focused);\n}\n\n.vchasno-ui-input:not(.--disabled).--error .vchasno-ui-input__wrapper {\n border-color: var(--vchasno-ui-input-color-error);\n background-color: var(--vchasno-ui-input-bg-error);\n}\n\n.vchasno-ui-input.--disabled,\n.vchasno-ui-input.--disabled * {\n cursor: not-allowed;\n opacity: 0.8;\n}\n";
212
+ var css_248z$b = ".vchasno-ui-input {\n display: inline-flex;\n flex-direction: column;\n gap: 5px;\n}\n\n.vchasno-ui-input input::placeholder {\n color: var(--vchasno-ui-input-border-color-default);\n font-size: var(--vchasno-ui-input-font-size);\n line-height: calc(var(--vchasno-ui-input-font-size) * 1.2);\n transition: color var(--vchasno-ui-transition-duration-sec, 0.3s);\n}\n\n.vchasno-ui-input .vchasno-ui-text-input,\n.vchasno-ui-input .vchasno-ui-mask-input {\n flex-grow: 1;\n}\n\n.vchasno-ui-input.--wide {\n width: 100%;\n}\n\n.vchasno-ui-input__wrapper {\n position: relative;\n display: flex;\n height: 40px;\n box-sizing: border-box;\n align-items: center;\n padding-right: 33px;\n padding-left: 10px;\n border: 1px solid var(--vchasno-ui-input-border-color-default);\n border-radius: 4px;\n background-color: #fff;\n gap: 5px;\n transition: border var(--vchasno-ui-transition-duration-sec, 0.3s);\n}\n\n.vchasno-ui-input__wrapper > input {\n max-width: 100%;\n}\n\n.vchasno-ui-input__wrapper__start-element {\n display: flex;\n flex-grow: 0;\n flex-shrink: 0;\n align-items: center;\n font-size: var(--vchasno-ui-input-font-size, 14px);\n line-height: var(--vchasno-ui-input-font-size, 14px);\n}\n\n.vchasno-ui-input__feedback {\n position: absolute;\n top: 10px;\n right: 10px;\n display: block;\n width: 18px;\n height: 18px;\n}\n\n.vchasno-ui-input .vchasno-ui-spinner__svg__circle {\n stroke: var(--vchasno-ui-input-border-color-focused);\n}\n\n.vchasno-ui-input.--disabled .vchasno-ui-input__wrapper {\n background-color: #f3f6f8;\n color: #b6cadb;\n}\n\n.vchasno-ui-input:not(.--disabled) .vchasno-ui-input__wrapper:hover {\n cursor: text;\n}\n\n.vchasno-ui-input:not(.--disabled):hover .vchasno-ui-input__wrapper,\n.vchasno-ui-input:not(.--disabled):focus-within .vchasno-ui-input__wrapper {\n border-color: var(--vchasno-ui-input-border-color-focused);\n}\n\n.vchasno-ui-input:not(.--disabled).--error .vchasno-ui-input__wrapper {\n border-color: var(--vchasno-ui-input-color-error);\n background-color: var(--vchasno-ui-input-bg-error);\n}\n\n.vchasno-ui-input.--disabled,\n.vchasno-ui-input.--disabled * {\n cursor: not-allowed;\n opacity: 0.8;\n}\n";
213
213
  styleInject(css_248z$b);
214
214
 
215
215
  var Input = function (_a) {
@@ -1,7 +1,9 @@
1
1
  import React from 'react';
2
2
  import { Props as ReactSelectProps } from 'react-select';
3
3
  import type { ErrorFeedback, LoadingFeedback, WithHint, WithLabel } from '../types';
4
+ import { Option } from './types';
4
5
  import './Select.global.css';
6
+ export type SelectOption = Option;
5
7
  export interface SelectProps extends ReactSelectProps, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
6
8
  wide?: boolean;
7
9
  dataQa?: string;
@@ -4,6 +4,7 @@ import type { GroupBase } from 'react-select/dist/declarations/src/types';
4
4
  import type { ErrorFeedback, LoadingFeedback, WithHint, WithLabel } from '../types';
5
5
  import { Option } from './types';
6
6
  import './Select.global.css';
7
+ export type SelectOption = Option;
7
8
  export interface SelectCreatableProps extends CreatableProps<Option, false | true, GroupBase<Option>>, Partial<WithLabel & WithHint & LoadingFeedback & ErrorFeedback> {
8
9
  wide?: boolean;
9
10
  labelProps?: InputHTMLAttributes<HTMLLabelElement>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vchasno/ui-kit",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "React UI components for Vchasno applications",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -22,7 +22,10 @@
22
22
  "./SelectCreatable": {
23
23
  "types": "./dist/SelectCreatable/index.d.ts",
24
24
  "import": "./dist/SelectCreatable/index.js"
25
- }
25
+ },
26
+ "./base.css": "./dist/css/_base.css",
27
+ "./reset.css": "./dist/css/_reset.css",
28
+ "./theme.css": "./dist/css/_theme.css"
26
29
  },
27
30
  "types": "dist/index.d.ts",
28
31
  "scripts": {