@vchasno/ui-kit 0.2.10 → 0.2.12
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 +21 -0
- package/README.md +38 -20
- package/dist/Datepicker/types/components/BubbleBox/index.d.ts +1 -0
- package/dist/Datepicker/types/components/Select/Select.d.ts +27 -0
- package/dist/Datepicker/types/components/Select/index.d.ts +1 -3
- package/dist/Datepicker/types/components/SvgBorder/SvgBorder.d.ts +18 -0
- package/dist/Datepicker/types/components/SvgBorder/index.d.ts +3 -0
- package/dist/Datepicker/types/components/SvgBorder/utils.d.ts +1 -0
- package/dist/Datepicker/types/components/index.d.ts +3 -1
- package/dist/Datepicker/types/{components/BubbleBox → hooks}/useClientRect.d.ts +1 -1
- package/dist/Datepicker/types/index.d.ts +1 -0
- package/dist/Datepicker/types/utils/react.d.ts +6 -0
- package/dist/Select/index.cjs.js +5 -1
- package/dist/Select/index.cjs.js.map +1 -1
- package/dist/Select/index.d.ts +34 -2
- package/dist/Select/index.js +2 -1
- package/dist/Select/index.js.map +1 -1
- package/dist/Select/types/components/BubbleBox/index.d.ts +1 -0
- package/dist/Select/types/components/Select/Select.d.ts +27 -0
- package/dist/Select/types/components/Select/index.d.ts +1 -3
- package/dist/Select/types/components/SvgBorder/SvgBorder.d.ts +18 -0
- package/dist/Select/types/components/SvgBorder/index.d.ts +3 -0
- package/dist/Select/types/components/SvgBorder/utils.d.ts +1 -0
- package/dist/Select/types/components/index.d.ts +3 -1
- package/dist/Select/types/{components/BubbleBox → hooks}/useClientRect.d.ts +1 -1
- package/dist/Select/types/index.d.ts +1 -0
- package/dist/Select/types/utils/react.d.ts +6 -0
- package/dist/SelectCreatable/types/components/BubbleBox/index.d.ts +1 -0
- package/dist/SelectCreatable/types/components/Select/Select.d.ts +27 -0
- package/dist/SelectCreatable/types/components/Select/index.d.ts +1 -3
- package/dist/SelectCreatable/types/components/SvgBorder/SvgBorder.d.ts +18 -0
- package/dist/SelectCreatable/types/components/SvgBorder/index.d.ts +3 -0
- package/dist/SelectCreatable/types/components/SvgBorder/utils.d.ts +1 -0
- package/dist/SelectCreatable/types/components/index.d.ts +3 -1
- package/dist/SelectCreatable/types/{components/BubbleBox → hooks}/useClientRect.d.ts +1 -1
- package/dist/SelectCreatable/types/index.d.ts +1 -0
- package/dist/SelectCreatable/types/utils/react.d.ts +6 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.js +105 -40
- package/dist/index.js.map +1 -1
- package/dist/types/components/BubbleBox/index.d.ts +1 -0
- package/dist/types/components/Select/Select.d.ts +27 -0
- package/dist/types/components/Select/index.d.ts +1 -3
- package/dist/types/components/SvgBorder/SvgBorder.d.ts +18 -0
- package/dist/types/components/SvgBorder/index.d.ts +3 -0
- package/dist/types/components/SvgBorder/utils.d.ts +1 -0
- package/dist/types/components/index.d.ts +3 -1
- package/dist/types/{components/BubbleBox → hooks}/useClientRect.d.ts +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/utils/react.d.ts +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.2.12] - 2024-03-22
|
|
11
|
+
|
|
12
|
+
## Added
|
|
13
|
+
|
|
14
|
+
- add `mergeRefs` utils
|
|
15
|
+
|
|
16
|
+
## Fixed
|
|
17
|
+
|
|
18
|
+
- fix wrap `SvgBorder` component with `forwardRef`
|
|
19
|
+
|
|
20
|
+
## [0.2.11] - 2024-03-18
|
|
21
|
+
|
|
22
|
+
## Added
|
|
23
|
+
|
|
24
|
+
- add `SvgBorder` component for apply custom borders
|
|
25
|
+
- export `useClientRect` hook and `composeBubblePath`, `composeRoundedBorderPath` utils
|
|
26
|
+
|
|
27
|
+
## Fixed
|
|
28
|
+
|
|
29
|
+
- fix reexport react-select components with SelectComponents
|
|
30
|
+
|
|
10
31
|
## [0.2.10] - 2024-03-08
|
|
11
32
|
|
|
12
33
|
## Changed
|
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
npm install @vchasno/ui-kit
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
```bash
|
|
9
|
+
```bash
|
|
10
10
|
yarn add @vchasno/ui-kit
|
|
11
11
|
```
|
|
12
12
|
|
|
@@ -16,6 +16,7 @@ Supports React ^16.8.0 || ^17.0.0 || ^18.0.0
|
|
|
16
16
|
|
|
17
17
|
```jsx
|
|
18
18
|
import React from 'react';
|
|
19
|
+
|
|
19
20
|
import { Button } from '@vchasno/ui-kit';
|
|
20
21
|
// import complex components (separate bundles)
|
|
21
22
|
import Datepicker from '@vchasno/ui-kit/Datepicker';
|
|
@@ -23,18 +24,18 @@ import Select from '@vchasno/ui-kit/Select';
|
|
|
23
24
|
import SelectCreatable from '@vchasno/ui-kit/SelectCreatable';
|
|
24
25
|
|
|
25
26
|
const App = () => (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
<>
|
|
28
|
+
<Button type="primary">PRESS ME</Button>
|
|
29
|
+
</>
|
|
29
30
|
);
|
|
30
31
|
```
|
|
31
32
|
|
|
32
33
|
### 🔨 Package entry points
|
|
33
34
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
35
|
+
- `@vchasno/ui-kit` - ES bundle, TypeScript typings - common components
|
|
36
|
+
- `@vchasno/ui-kit/Datepicker` - ES bundle, TypeScript typings and base react-datepicker dependencies
|
|
37
|
+
- `@vchasno/ui-kit/Select` - ES bundle, TypeScript typings and base react-select dependencies
|
|
38
|
+
- `@vchasno/ui-kit/SelectCreateble` - ES bundle, TypeScript and base react-select dependencies
|
|
38
39
|
|
|
39
40
|
We separate some components to separate bundles to reduce bundle size
|
|
40
41
|
|
|
@@ -46,17 +47,23 @@ also it will no have effect if you already have imported it and styles
|
|
|
46
47
|
Optionally you can import styles (use all or only what you need)
|
|
47
48
|
|
|
48
49
|
Suggestions:
|
|
49
|
-
|
|
50
|
-
-
|
|
51
|
-
-
|
|
52
|
-
-
|
|
50
|
+
|
|
51
|
+
- import reset styles
|
|
52
|
+
- import base styles
|
|
53
|
+
- import theme variables (will apply base theme)
|
|
54
|
+
- create your own theme variables override file (override only what you need)
|
|
53
55
|
|
|
54
56
|
```jsx
|
|
55
57
|
// index.tsx
|
|
56
|
-
|
|
57
|
-
import
|
|
58
|
-
import
|
|
59
|
-
|
|
58
|
+
// optional reset styles
|
|
59
|
+
import '@vchasno/ui-kit/dist/css/_base.css';
|
|
60
|
+
import '@vchasno/ui-kit/dist/css/_reset.css';
|
|
61
|
+
// optional base styles
|
|
62
|
+
import '@vchasno/ui-kit/dist/css/_theme.css';
|
|
63
|
+
// optional theme variables
|
|
64
|
+
import 'src/styles/_theme-override.css';
|
|
65
|
+
|
|
66
|
+
// yuor own css file with theme variables override
|
|
60
67
|
```
|
|
61
68
|
|
|
62
69
|
### Styling and customization
|
|
@@ -93,8 +100,8 @@ Supports only Ukrainian language
|
|
|
93
100
|
|
|
94
101
|
## 🔗 Links
|
|
95
102
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
103
|
+
- [Home page](https://vchasno.ua/)
|
|
104
|
+
- [Change Log](CHANGELOG.md)
|
|
98
105
|
|
|
99
106
|
## Development
|
|
100
107
|
|
|
@@ -132,13 +139,24 @@ npm run build
|
|
|
132
139
|
|
|
133
140
|
### Publish new version
|
|
134
141
|
|
|
142
|
+
## 0.2 versions
|
|
143
|
+
|
|
144
|
+
Should develop in `v0.2` branch. All merge requests should be merged to `v0.2` branch
|
|
145
|
+
|
|
146
|
+
## 0.3 version - latest
|
|
147
|
+
|
|
148
|
+
Should develop in `master` branch. All merge requests should be merged to `master` branch
|
|
149
|
+
|
|
150
|
+
## Publish version to npm registry
|
|
151
|
+
|
|
135
152
|
Publish new version to npm registry can only be done with CI/CD
|
|
136
153
|
|
|
137
154
|
To publish new version:
|
|
138
155
|
|
|
139
156
|
1. Make changes in new branch (e.g. `feature/new-component`)
|
|
140
157
|
2. Add changes to CHANGELOG.md (see [Keep a Changelog](https://keepachangelog.com/en/1.0.0/))
|
|
141
|
-
3. Commit changes
|
|
158
|
+
3. Commit changes
|
|
142
159
|
4. Create tag with version (e.g. `v0.1.2`) run `npm version patch|minor|major`
|
|
143
160
|
5. Push tag to remote repository
|
|
144
|
-
6.
|
|
161
|
+
6. Publish job will be started in CI/CD pipeline (only for `master` branch or version tag)
|
|
162
|
+
7. Confirm (CI/CD prepared manual stage) publish - new version will be published to npm registry
|
|
@@ -9,4 +9,31 @@ export interface SelectProps extends ReactSelectProps, Partial<WithLabel & WithH
|
|
|
9
9
|
dataQa?: string;
|
|
10
10
|
}
|
|
11
11
|
declare const Select: React.FC<SelectProps>;
|
|
12
|
+
export declare const SelectComponents: {
|
|
13
|
+
ClearIndicator: <Option_1, IsMulti extends boolean, Group extends import("react-select").GroupBase<Option_1>>(props: import("react-select").ClearIndicatorProps<Option_1, IsMulti, Group>) => import("@emotion/react").jsx.JSX.Element;
|
|
14
|
+
Control: <Option_1, IsMulti_1 extends boolean, Group_1 extends import("react-select").GroupBase<Option_1>>(props: import("react-select").ControlProps<Option_1, IsMulti_1, Group_1>) => import("@emotion/react").jsx.JSX.Element;
|
|
15
|
+
DropdownIndicator: <Option_2, IsMulti_2 extends boolean, Group_2 extends import("react-select").GroupBase<Option_2>>(props: import("react-select").DropdownIndicatorProps<Option_2, IsMulti_2, Group_2>) => import("@emotion/react").jsx.JSX.Element;
|
|
16
|
+
DownChevron: (props: import("react-select/dist/declarations/src/components/indicators").DownChevronProps) => import("@emotion/react").jsx.JSX.Element;
|
|
17
|
+
CrossIcon: (props: import("react-select/dist/declarations/src/components/indicators").CrossIconProps) => import("@emotion/react").jsx.JSX.Element;
|
|
18
|
+
Group: <Option_3, IsMulti_3 extends boolean, Group_3 extends import("react-select").GroupBase<Option_3>>(props: import("react-select").GroupProps<Option_3, IsMulti_3, Group_3>) => import("@emotion/react").jsx.JSX.Element;
|
|
19
|
+
GroupHeading: <Option_4, IsMulti_4 extends boolean, Group_4 extends import("react-select").GroupBase<Option_4>>(props: import("react-select").GroupHeadingProps<Option_4, IsMulti_4, Group_4>) => import("@emotion/react").jsx.JSX.Element;
|
|
20
|
+
IndicatorsContainer: <Option_5, IsMulti_5 extends boolean, Group_5 extends import("react-select").GroupBase<Option_5>>(props: import("react-select").IndicatorsContainerProps<Option_5, IsMulti_5, Group_5>) => import("@emotion/react").jsx.JSX.Element;
|
|
21
|
+
IndicatorSeparator: <Option_6, IsMulti_6 extends boolean, Group_6 extends import("react-select").GroupBase<Option_6>>(props: import("react-select").IndicatorSeparatorProps<Option_6, IsMulti_6, Group_6>) => import("@emotion/react").jsx.JSX.Element;
|
|
22
|
+
Input: <Option_7, IsMulti_7 extends boolean, Group_7 extends import("react-select").GroupBase<Option_7>>(props: import("react-select").InputProps<Option_7, IsMulti_7, Group_7>) => import("@emotion/react").jsx.JSX.Element;
|
|
23
|
+
LoadingIndicator: <Option_8, IsMulti_8 extends boolean, Group_8 extends import("react-select").GroupBase<Option_8>>({ innerProps, isRtl, size, ...restProps }: import("react-select").LoadingIndicatorProps<Option_8, IsMulti_8, Group_8>) => import("@emotion/react").jsx.JSX.Element;
|
|
24
|
+
Menu: <Option_9, IsMulti_9 extends boolean, Group_9 extends import("react-select").GroupBase<Option_9>>(props: import("react-select").MenuProps<Option_9, IsMulti_9, Group_9>) => import("@emotion/react").jsx.JSX.Element;
|
|
25
|
+
MenuList: <Option_10, IsMulti_10 extends boolean, Group_10 extends import("react-select").GroupBase<Option_10>>(props: import("react-select").MenuListProps<Option_10, IsMulti_10, Group_10>) => import("@emotion/react").jsx.JSX.Element;
|
|
26
|
+
MenuPortal: <Option_11, IsMulti_11 extends boolean, Group_11 extends import("react-select").GroupBase<Option_11>>(props: import("react-select/dist/declarations/src/components/Menu").MenuPortalProps<Option_11, IsMulti_11, Group_11>) => import("@emotion/react").jsx.JSX.Element | null;
|
|
27
|
+
LoadingMessage: <Option_12, IsMulti_12 extends boolean, Group_12 extends import("react-select").GroupBase<Option_12>>({ children, innerProps, ...restProps }: import("react-select").NoticeProps<Option_12, IsMulti_12, Group_12>) => import("@emotion/react").jsx.JSX.Element;
|
|
28
|
+
NoOptionsMessage: <Option_13, IsMulti_13 extends boolean, Group_13 extends import("react-select").GroupBase<Option_13>>({ children, innerProps, ...restProps }: import("react-select").NoticeProps<Option_13, IsMulti_13, Group_13>) => import("@emotion/react").jsx.JSX.Element;
|
|
29
|
+
MultiValue: <Option_14, IsMulti_14 extends boolean, Group_14 extends import("react-select").GroupBase<Option_14>>(props: import("react-select").MultiValueProps<Option_14, IsMulti_14, Group_14>) => import("@emotion/react").jsx.JSX.Element;
|
|
30
|
+
MultiValueContainer: <Option_15, IsMulti_15 extends boolean, Group_15 extends import("react-select").GroupBase<Option_15>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15, IsMulti_15, Group_15>) => import("@emotion/react").jsx.JSX.Element;
|
|
31
|
+
MultiValueLabel: <Option_15_1, IsMulti_15_1 extends boolean, Group_15_1 extends import("react-select").GroupBase<Option_15_1>>({ children, innerProps, }: import("react-select").MultiValueGenericProps<Option_15_1, IsMulti_15_1, Group_15_1>) => import("@emotion/react").jsx.JSX.Element;
|
|
32
|
+
MultiValueRemove: typeof import("react-select/dist/declarations/src/components/MultiValue").MultiValueRemove;
|
|
33
|
+
Option: <Option_16, IsMulti_16 extends boolean, Group_16 extends import("react-select").GroupBase<Option_16>>(props: import("react-select").OptionProps<Option_16, IsMulti_16, Group_16>) => import("@emotion/react").jsx.JSX.Element;
|
|
34
|
+
Placeholder: <Option_17, IsMulti_17 extends boolean, Group_17 extends import("react-select").GroupBase<Option_17>>(props: import("react-select").PlaceholderProps<Option_17, IsMulti_17, Group_17>) => import("@emotion/react").jsx.JSX.Element;
|
|
35
|
+
SelectContainer: <Option_18, IsMulti_18 extends boolean, Group_18 extends import("react-select").GroupBase<Option_18>>(props: import("react-select").ContainerProps<Option_18, IsMulti_18, Group_18>) => import("@emotion/react").jsx.JSX.Element;
|
|
36
|
+
SingleValue: <Option_19, IsMulti_19 extends boolean, Group_19 extends import("react-select").GroupBase<Option_19>>(props: import("react-select").SingleValueProps<Option_19, IsMulti_19, Group_19>) => import("@emotion/react").jsx.JSX.Element;
|
|
37
|
+
ValueContainer: <Option_20, IsMulti_20 extends boolean, Group_20 extends import("react-select").GroupBase<Option_20>>(props: import("react-select").ValueContainerProps<Option_20, IsMulti_20, Group_20>) => import("@emotion/react").jsx.JSX.Element;
|
|
38
|
+
};
|
|
12
39
|
export default Select;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export { default } from './Select';
|
|
1
|
+
export { default, SelectComponents } from './Select';
|
|
2
2
|
export type { SelectProps } from './Select';
|
|
3
3
|
export { default as SelectCreatable } from './SelectCreatable';
|
|
4
4
|
export type { SelectCreatableProps } from './SelectCreatable';
|
|
5
5
|
export type { Option } from './types';
|
|
6
|
-
export { PlaceholderProps, CommonProps, PropsValue, ControlProps, MultiValueProps, MultiValueRemoveProps, MultiValueGenericProps, SingleValueProps, ValueContainerProps, ContainerProps, IndicatorsContainerProps, ClearIndicatorProps, DropdownIndicatorProps, IndicatorSeparatorProps, LoadingIndicatorProps, GroupProps, GroupHeadingProps, MenuProps, MenuListProps, InputProps, AriaGuidanceProps, AriaOnFilterProps, ActionMetaBase, AriaLiveMessages, AriaOnFocusProps, ClearActionMeta, Colors, CommonPropsAndClassName, CreateOptionActionMeta, } from 'react-select';
|
|
7
|
-
export { components } from 'react-select';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { HTMLAttributes } from 'react';
|
|
2
|
+
import './SvgBorder.global.css';
|
|
3
|
+
export interface SvgBorderProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
svgClassName?: string;
|
|
5
|
+
strokeDasharray?: string;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
color?: string;
|
|
8
|
+
borderRadius?: number;
|
|
9
|
+
animation?: 'border-offset';
|
|
10
|
+
animationPlay?: boolean;
|
|
11
|
+
animationDurationSec?: number;
|
|
12
|
+
dashoffset?: number | string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @link <https://css-tricks.com/svg-line-animation-works/>
|
|
16
|
+
*/
|
|
17
|
+
declare const SvgBorder: React.ForwardRefExoticComponent<SvgBorderProps & React.RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export default SvgBorder;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const composeRoundedBorderPath: (width: number, height: number, radiusOffset: number) => string;
|
|
@@ -32,5 +32,7 @@ export { default as Checkbox } from './Checkbox';
|
|
|
32
32
|
export type { CheckboxProps } from './Checkbox';
|
|
33
33
|
export { default as PulseDot } from './PulseDot';
|
|
34
34
|
export type { PulseDotProps } from './PulseDot';
|
|
35
|
-
export { default as BubbleBox } from './BubbleBox';
|
|
35
|
+
export { default as BubbleBox, composeBubblePath } from './BubbleBox';
|
|
36
36
|
export type { BubbleBoxProps } from './BubbleBox';
|
|
37
|
+
export { default as SvgBorder, composeRoundedBorderPath } from './SvgBorder';
|
|
38
|
+
export type { SvgBorderProps } from './SvgBorder';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Merges multiple refs into a single ref callback.
|
|
4
|
+
* @see <https://www.jameskerr.blog/posts/react-useref-and-forward-ref/>
|
|
5
|
+
*/
|
|
6
|
+
export declare function mergeRefs<T = HTMLDivElement>(...refs: Array<React.MutableRefObject<T> | React.LegacyRef<T> | undefined | null>): React.RefCallback<T>;
|
package/dist/Select/index.cjs.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
var React = require('react');
|
|
4
6
|
var reactDom = require('react-dom');
|
|
5
7
|
|
|
@@ -7741,6 +7743,8 @@ var Select = function (_a) {
|
|
|
7741
7743
|
React.createElement(StateManagedSelect$1, __assign({ required: required, isLoading: loading, components: __assign(__assign({}, customComponents), components), classNamePrefix: "vchasno-ui-select", menuPlacement: menuPlacement, isDisabled: isDisabled, noOptionsMessage: noOptionsMessage, loadingMessage: loadingMessage, placeholder: placeholder }, rest)),
|
|
7742
7744
|
React.createElement(InputMeta, { hint: hint, error: error })));
|
|
7743
7745
|
};
|
|
7746
|
+
var SelectComponents = components;
|
|
7744
7747
|
|
|
7745
|
-
|
|
7748
|
+
exports.SelectComponents = SelectComponents;
|
|
7749
|
+
exports.default = Select;
|
|
7746
7750
|
//# sourceMappingURL=index.cjs.js.map
|