@homecode/ui 4.23.3 → 4.24.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.
- package/dist/esm/index.js +2 -0
- package/dist/esm/src/components/Autocomplete/Autocomplete.js +2 -0
- package/dist/esm/src/components/Input/Input.js +2 -0
- package/dist/esm/src/components/InputFile/InputFile.js +2 -0
- package/dist/esm/src/components/Popup/Popup.styl.js +1 -1
- package/dist/esm/src/components/Progress/Progress.helpers.js +5 -0
- package/dist/esm/src/components/Progress/Progress.js +12 -0
- package/dist/esm/src/components/Progress/Progress.styl.js +7 -0
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.js +22 -0
- package/dist/esm/src/components/ProgressCircular/ProgressCircular.styl.js +7 -0
- package/dist/esm/types/src/components/Icon/Icon.d.ts +9 -0
- package/dist/esm/types/src/components/Progress/Progress.d.ts +2 -0
- package/dist/esm/types/src/components/Progress/Progress.helpers.d.ts +1 -0
- package/dist/esm/types/src/components/Progress/Progress.types.d.ts +9 -0
- package/dist/esm/types/src/components/ProgressCircular/ProgressCircular.d.ts +3 -0
- package/dist/esm/types/src/components/ProgressCircular/ProgressCircular.types.d.ts +4 -0
- package/dist/esm/types/src/components/index.d.ts +2 -0
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -26,6 +26,8 @@ export { Paranja } from './src/components/Paranja/Paranja.js';
|
|
|
26
26
|
export { ANIMATION_DURATION, Popup } from './src/components/Popup/Popup.js';
|
|
27
27
|
export { Portal } from './src/components/Portal/Portal.js';
|
|
28
28
|
export { PopupMenu } from './src/components/PopupMenu/PopupMenu.js';
|
|
29
|
+
export { Progress } from './src/components/Progress/Progress.js';
|
|
30
|
+
export { ProgressCircular } from './src/components/ProgressCircular/ProgressCircular.js';
|
|
29
31
|
export { Router, RouterContext, RouterStore } from './src/components/Router/Router.js';
|
|
30
32
|
export { RequiredStar } from './src/components/RequiredStar/RequiredStar.js';
|
|
31
33
|
export { Select, SelectHelpers } from './src/components/Select/Select.js';
|
|
@@ -49,6 +49,8 @@ import { Menu } from '../Menu/Menu.js';
|
|
|
49
49
|
import '../Notifications/store.js';
|
|
50
50
|
import '../Notifications/Notifications.styl.js';
|
|
51
51
|
import '../PopupMenu/PopupMenu.styl.js';
|
|
52
|
+
import '../Progress/Progress.styl.js';
|
|
53
|
+
import '../ProgressCircular/ProgressCircular.styl.js';
|
|
52
54
|
import '../Router/Router.js';
|
|
53
55
|
import '../Table/Table.styl.js';
|
|
54
56
|
import '../Tabs/Tabs.styl.js';
|
|
@@ -47,6 +47,8 @@ import '../Menu/Menu.js';
|
|
|
47
47
|
import '../Notifications/store.js';
|
|
48
48
|
import '../Notifications/Notifications.styl.js';
|
|
49
49
|
import '../PopupMenu/PopupMenu.styl.js';
|
|
50
|
+
import '../Progress/Progress.styl.js';
|
|
51
|
+
import '../ProgressCircular/ProgressCircular.styl.js';
|
|
50
52
|
import '../Router/Router.js';
|
|
51
53
|
import '../Table/Table.styl.js';
|
|
52
54
|
import '../Tabs/Tabs.styl.js';
|
|
@@ -47,6 +47,8 @@ import '../Menu/Menu.js';
|
|
|
47
47
|
import '../Notifications/store.js';
|
|
48
48
|
import '../Notifications/Notifications.styl.js';
|
|
49
49
|
import '../PopupMenu/PopupMenu.styl.js';
|
|
50
|
+
import '../Progress/Progress.styl.js';
|
|
51
|
+
import '../ProgressCircular/ProgressCircular.styl.js';
|
|
50
52
|
import '../Router/Router.js';
|
|
51
53
|
import '../Table/Table.styl.js';
|
|
52
54
|
import '../Tabs/Tabs.styl.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
2
|
|
|
3
|
-
var css_248z = ".Popup_root__uQ-fP{display:inline-block;position:relative}.Popup_contentWrapper__2yi-2{opacity:0;pointer-events:none;position:absolute}.Popup_contentWrapper__2yi-2.Popup_animating__kR0qF{transition:opacity .1s ease-out}.Popup_contentWrapper__2yi-2.Popup_isOpen__BRIdP{opacity:1;pointer-events:all}.Popup_contentWrapper__2yi-2.Popup_inline__1-l1S.Popup_isOpen__BRIdP{position:relative}.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S),.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S)>.Popup_content__e8Qyu{position:absolute}.Popup_trigger__jQNaQ{cursor:pointer}.Popup_trigger__jQNaQ.Popup_isOpen__BRIdP{position:relative;z-index:11}.Popup_trigger__jQNaQ.Popup_disabled__DlE9y{opacity:.4;pointer-events:none}.Popup_content__e8Qyu{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--decent-color);box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50);max-width:70vw;min-width:100%;overflow:hidden;position:relative;transform-origin:top center;transition:background-color .1s ease-in-out;z-index:11}.Popup_content__e8Qyu.Popup_blur__1hfU8{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);background-color:var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_size-s__UmixP{border-radius:4px}.Popup_content__e8Qyu.Popup_size-s__UmixP.Popup_round__7rD1m{border-radius:15px}.Popup_content__e8Qyu.Popup_size-m__FYpTL{border-radius:6px}.Popup_content__e8Qyu.Popup_size-m__FYpTL.Popup_round__7rD1m{border-radius:20px}.Popup_content__e8Qyu.Popup_size-l__BTS57{border-radius:8px}.Popup_content__e8Qyu.Popup_size-l__BTS57.Popup_round__7rD1m{border-radius:25px}.Popup_content__e8Qyu.Popup_elevation-1__vmP3e{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--indent-s) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_elevation-2__Ci4sI{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--indent-m) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_outlined__g3cJV:after{border-radius:inherit;bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.Popup_isOpen__BRIdP .Popup_content__e8Qyu{
|
|
3
|
+
var css_248z = ".Popup_root__uQ-fP{display:inline-block;position:relative}.Popup_contentWrapper__2yi-2{opacity:0;pointer-events:none;position:absolute}.Popup_contentWrapper__2yi-2.Popup_animating__kR0qF{transition:opacity .1s ease-out}.Popup_contentWrapper__2yi-2.Popup_isOpen__BRIdP{opacity:1;pointer-events:all}.Popup_contentWrapper__2yi-2.Popup_inline__1-l1S.Popup_isOpen__BRIdP{position:relative}.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S),.Popup_contentWrapper__2yi-2:not(.Popup_inline__1-l1S)>.Popup_content__e8Qyu{position:absolute}.Popup_trigger__jQNaQ{cursor:pointer}.Popup_trigger__jQNaQ.Popup_isOpen__BRIdP{position:relative;z-index:11}.Popup_trigger__jQNaQ.Popup_disabled__DlE9y{opacity:.4;pointer-events:none}.Popup_content__e8Qyu{-webkit-backface-visibility:hidden;backface-visibility:hidden;background-color:var(--decent-color);box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50);max-width:70vw;min-width:100%;overflow:hidden;position:relative;transform-origin:top center;transition:background-color .1s ease-in-out;z-index:11}.Popup_content__e8Qyu:before{background-color:var(--accent-color-alpha-50);bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.Popup_content__e8Qyu.Popup_blur__1hfU8{-webkit-backdrop-filter:blur(50px);backdrop-filter:blur(50px);background-color:var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_size-s__UmixP{border-radius:4px}.Popup_content__e8Qyu.Popup_size-s__UmixP.Popup_round__7rD1m{border-radius:15px}.Popup_content__e8Qyu.Popup_size-m__FYpTL{border-radius:6px}.Popup_content__e8Qyu.Popup_size-m__FYpTL.Popup_round__7rD1m{border-radius:20px}.Popup_content__e8Qyu.Popup_size-l__BTS57{border-radius:8px}.Popup_content__e8Qyu.Popup_size-l__BTS57.Popup_round__7rD1m{border-radius:25px}.Popup_content__e8Qyu.Popup_elevation-1__vmP3e{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--indent-s) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_elevation-2__Ci4sI{box-shadow:inset 0 0 0 1px var(--accent-color-alpha-50),0 0 var(--indent-m) 2px var(--decent-color-alpha-500)}.Popup_content__e8Qyu.Popup_outlined__g3cJV:after{border-radius:inherit;bottom:0;content:\"\";left:0;pointer-events:none;position:absolute;right:0;top:0}.Popup_isOpen__BRIdP .Popup_content__e8Qyu{opacity:1;pointer-events:all;transform:scaleX(1)}.Popup_animating__kR0qF{transition:70ms ease-out;transition-property:transform,opacity,margin}.Popup_axis-top__BaLgG{bottom:100%}.Popup_axis-bottom__hZwwr{top:100%}.Popup_axis-right__LMYVy{left:100%}.Popup_axis-left__SFKm-{right:100%}.Popup_float-top__8SQAu{bottom:0}.Popup_float-right__mdm-3{left:0}.Popup_float-bottom__7flve{top:0}.Popup_float-left__tz7fX{right:0}.Popup_axis-bottom__hZwwr,.Popup_axis-top__BaLgG{transform:scaleY(.5)}.Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1,.Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{left:50%;transform:translateX(-50%) scaleY(.5)}.Popup_isOpen__BRIdP .Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1,.Popup_isOpen__BRIdP .Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{transform:translateX(-50%) scaleX(1)}.Popup_axis-left__SFKm-,.Popup_axis-right__LMYVy{transform:scaleX(.5)}.Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1,.Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{top:50%;transform:translateY(-50%) scaleX(.5)}.Popup_isOpen__BRIdP .Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1,.Popup_isOpen__BRIdP .Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{transform:translateY(-50%) scaleX(1)}.Popup_axis-top__BaLgG.Popup_float-middle__Dmnn1{transform-origin:bottom center}.Popup_axis-top__BaLgG.Popup_float-right__mdm-3{transform-origin:bottom left}.Popup_axis-top__BaLgG.Popup_float-left__tz7fX{transform-origin:bottom right}.Popup_axis-bottom__hZwwr.Popup_float-middle__Dmnn1{transform-origin:top center}.Popup_axis-bottom__hZwwr.Popup_float-right__mdm-3{transform-origin:top left}.Popup_axis-bottom__hZwwr.Popup_float-left__tz7fX{transform-origin:top right}.Popup_axis-right__LMYVy.Popup_float-middle__Dmnn1{transform-origin:center left}.Popup_axis-right__LMYVy.Popup_float-top__8SQAu{transform-origin:bottom left}.Popup_axis-right__LMYVy.Popup_float-bottom__7flve{transform-origin:top left}.Popup_axis-left__SFKm-.Popup_float-middle__Dmnn1{transform-origin:center right}.Popup_axis-left__SFKm-.Popup_float-top__8SQAu{transform-origin:bottom right}.Popup_axis-left__SFKm-.Popup_float-bottom__7flve{transform-origin:top right}";
|
|
4
4
|
var S = {"root":"Popup_root__uQ-fP","contentWrapper":"Popup_contentWrapper__2yi-2","animating":"Popup_animating__kR0qF","isOpen":"Popup_isOpen__BRIdP","inline":"Popup_inline__1-l1S","content":"Popup_content__e8Qyu","trigger":"Popup_trigger__jQNaQ","disabled":"Popup_disabled__DlE9y","blur":"Popup_blur__1hfU8","size-s":"Popup_size-s__UmixP","round":"Popup_round__7rD1m","size-m":"Popup_size-m__FYpTL","size-l":"Popup_size-l__BTS57","elevation-1":"Popup_elevation-1__vmP3e","elevation-2":"Popup_elevation-2__Ci4sI","outlined":"Popup_outlined__g3cJV","axis-top":"Popup_axis-top__BaLgG","axis-bottom":"Popup_axis-bottom__hZwwr","axis-right":"Popup_axis-right__LMYVy","axis-left":"Popup_axis-left__SFKm-","float-top":"Popup_float-top__8SQAu","float-right":"Popup_float-right__mdm-3","float-bottom":"Popup_float-bottom__7flve","float-left":"Popup_float-left__tz7fX","float-middle":"Popup_float-middle__Dmnn1"};
|
|
5
5
|
styleInject(css_248z);
|
|
6
6
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { calculateProgress } from './Progress.helpers.js';
|
|
4
|
+
import S from './Progress.styl.js';
|
|
5
|
+
|
|
6
|
+
function Progress({ value, showPercentage, size = 'm', alignText = 'center', }) {
|
|
7
|
+
const progress = calculateProgress(value);
|
|
8
|
+
const classes = cn(S.root, S[`size-${size}`], S[`align-${alignText}`], value > 0 && S.animated);
|
|
9
|
+
return (jsxs("div", { className: classes, children: [jsx("div", { className: S.bar, style: { width: `${progress}%` } }), showPercentage && jsxs("div", { className: S.label, children: [Math.round(progress), "%"] })] }));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { Progress };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".Progress_root__gGPO9{background-color:var(--accent-color-alpha-100);border-radius:50px;position:relative;width:100%}.Progress_size-s__Xl7Vl{font-size:14px;height:2px}.Progress_size-m__2vNe8{font-size:16px;height:8px}.Progress_size-l__GYI3y{font-size:18px;height:12px}.Progress_bar__guoEx{background-color:var(--active-color);border-radius:inherit;height:100%}.Progress_animated__rfWjG .Progress_bar__guoEx{transition:width .3s ease}.Progress_hasLabel__1Xx16{margin-top:1em}.Progress_label__rQqsN{bottom:100%;color:var(--accent-color);font-weight:700;margin-bottom:4px;position:absolute}.Progress_align-left__p45c1 .Progress_label__rQqsN{left:var(--indent-s)}.Progress_align-center__HheKi .Progress_label__rQqsN{left:50%;transform:translate(-50%)}.Progress_align-right__lIRT2 .Progress_label__rQqsN{right:var(--indent-s)}";
|
|
4
|
+
var S = {"root":"Progress_root__gGPO9","size-s":"Progress_size-s__Xl7Vl","size-m":"Progress_size-m__2vNe8","size-l":"Progress_size-l__GYI3y","bar":"Progress_bar__guoEx","animated":"Progress_animated__rfWjG","hasLabel":"Progress_hasLabel__1Xx16","label":"Progress_label__rQqsN","align-left":"Progress_align-left__p45c1","align-center":"Progress_align-center__HheKi","align-right":"Progress_align-right__lIRT2"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import cn from 'classnames';
|
|
3
|
+
import { calculateProgress } from '../Progress/Progress.helpers.js';
|
|
4
|
+
import S from './ProgressCircular.styl.js';
|
|
5
|
+
|
|
6
|
+
const SIZE_MAP = {
|
|
7
|
+
s: 20,
|
|
8
|
+
m: 30,
|
|
9
|
+
l: 60,
|
|
10
|
+
xl: 120,
|
|
11
|
+
};
|
|
12
|
+
function ProgressCircular({ value, showPercentage, size = 'm', strokeWidth, }) {
|
|
13
|
+
const progress = calculateProgress(value);
|
|
14
|
+
const pixelSize = SIZE_MAP[size];
|
|
15
|
+
const calculatedStrokeWidth = strokeWidth ?? pixelSize / 10;
|
|
16
|
+
const radius = (pixelSize - calculatedStrokeWidth) / 2;
|
|
17
|
+
const circumference = 2 * Math.PI * radius;
|
|
18
|
+
const strokeDashoffset = circumference - (progress / 100) * circumference;
|
|
19
|
+
return (jsxs("svg", { width: pixelSize, height: pixelSize, viewBox: `0 0 ${pixelSize} ${pixelSize}`, className: cn(S.root, value > 0 && S.animated), children: [jsx("circle", { className: S.background, cx: pixelSize / 2, cy: pixelSize / 2, r: radius, fill: "none", strokeWidth: calculatedStrokeWidth }), jsx("circle", { cx: pixelSize / 2, cy: pixelSize / 2, r: radius, fill: "none", stroke: "var(--active-color)", strokeWidth: calculatedStrokeWidth, strokeLinecap: "round", strokeDasharray: circumference, strokeDashoffset: strokeDashoffset, transform: `rotate(-90 ${pixelSize / 2} ${pixelSize / 2})` }), showPercentage && (jsxs("text", { x: "50%", y: "50%", textAnchor: "middle", dominantBaseline: "middle", fontSize: "16", fontWeight: "bold", children: [Math.round(progress), "%"] }))] }));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { ProgressCircular };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import styleInject from '../../../node_modules/style-inject/dist/style-inject.es.js';
|
|
2
|
+
|
|
3
|
+
var css_248z = ".ProgressCircular_root__z7xBm .ProgressCircular_background__Rlqcq{stroke:var(--accent-color-alpha-100)}.ProgressCircular_root__z7xBm.ProgressCircular_animated__w3Bpf .ProgressCircular_background__Rlqcq{transition:stroke-dashoffset .3s ease-in-out}.ProgressCircular_root__z7xBm text{fill:var(--accent-color)}";
|
|
4
|
+
var S = {"root":"ProgressCircular_root__z7xBm","background":"ProgressCircular_background__Rlqcq","animated":"ProgressCircular_animated__w3Bpf"};
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
export { S as default };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as T from './Icon.types';
|
|
2
2
|
export declare const icons: {
|
|
3
|
+
arrowRight: () => Promise<any>;
|
|
4
|
+
arrowLeft: () => Promise<any>;
|
|
5
|
+
arrowUp: () => Promise<any>;
|
|
6
|
+
arrowDown: () => Promise<any>;
|
|
3
7
|
avatar: () => Promise<any>;
|
|
4
8
|
bookmark: () => Promise<any>;
|
|
5
9
|
bookmarkAdd: () => Promise<any>;
|
|
@@ -18,6 +22,7 @@ export declare const icons: {
|
|
|
18
22
|
chevronRight: () => Promise<any>;
|
|
19
23
|
chevronLeft: () => Promise<any>;
|
|
20
24
|
clearAll: () => Promise<any>;
|
|
25
|
+
cubes: () => Promise<any>;
|
|
21
26
|
delete: () => Promise<any>;
|
|
22
27
|
draft: () => Promise<any>;
|
|
23
28
|
dragHandlerHorizontal: () => Promise<any>;
|
|
@@ -56,8 +61,10 @@ export declare const icons: {
|
|
|
56
61
|
plus: () => Promise<any>;
|
|
57
62
|
redo: () => Promise<any>;
|
|
58
63
|
undo: () => Promise<any>;
|
|
64
|
+
usage: () => Promise<any>;
|
|
59
65
|
requiredStar: () => Promise<any>;
|
|
60
66
|
rewind: () => Promise<any>;
|
|
67
|
+
rocket: () => Promise<any>;
|
|
61
68
|
route: () => Promise<any>;
|
|
62
69
|
routeFrom: () => Promise<any>;
|
|
63
70
|
routeTo: () => Promise<any>;
|
|
@@ -66,11 +73,13 @@ export declare const icons: {
|
|
|
66
73
|
send: () => Promise<any>;
|
|
67
74
|
settings: () => Promise<any>;
|
|
68
75
|
shoppingBag: () => Promise<any>;
|
|
76
|
+
soundWave: () => Promise<any>;
|
|
69
77
|
sparks: () => Promise<any>;
|
|
70
78
|
star: () => Promise<any>;
|
|
71
79
|
syncArrows: () => Promise<any>;
|
|
72
80
|
table: () => Promise<any>;
|
|
73
81
|
telegram: () => Promise<any>;
|
|
82
|
+
tool: () => Promise<any>;
|
|
74
83
|
trafficLight: () => Promise<any>;
|
|
75
84
|
};
|
|
76
85
|
export type { IconType } from './Icon.types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const calculateProgress: (value: number) => number;
|
|
@@ -26,6 +26,8 @@ export * from './Paranja/Paranja';
|
|
|
26
26
|
export * from './Popup/Popup';
|
|
27
27
|
export * from './Portal/Portal';
|
|
28
28
|
export * from './PopupMenu/PopupMenu';
|
|
29
|
+
export * from './Progress/Progress';
|
|
30
|
+
export * from './ProgressCircular/ProgressCircular';
|
|
29
31
|
export * from './Router/Router';
|
|
30
32
|
export * from './RequiredStar/RequiredStar';
|
|
31
33
|
export * from './Select/Select';
|