@prokodo/ui 0.0.41 → 0.0.43
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/README.md +5 -2
- package/dist/components/accordion/Accordion.client.js +1 -1
- package/dist/components/animatedText/AnimatedText.client.js +4 -4
- package/dist/components/dialog/Dialog.client.js +9 -3
- package/dist/components/dialog/Dialog.module.scss.js +2 -0
- package/dist/components/dialog/Dialog.view.js +72 -57
- package/dist/components/dynamic-list/DynamicList.client.js +91 -0
- package/dist/components/dynamic-list/DynamicList.js +12 -0
- package/dist/components/dynamic-list/DynamicList.lazy.js +12 -0
- package/dist/components/dynamic-list/DynamicList.module.scss.js +20 -0
- package/dist/components/dynamic-list/DynamicList.server.js +15 -0
- package/dist/components/dynamic-list/DynamicList.view.js +128 -0
- package/dist/components/dynamic-list/index.js +4 -0
- package/dist/components/form/Form.client.js +4 -0
- package/dist/components/form/Form.server.js +2 -0
- package/dist/components/form/Form.view.js +2 -3
- package/dist/components/form/FormField.client.js +22 -1
- package/dist/components/form/FormField.server.js +3 -1
- package/dist/components/form/FormResponse.js +1 -0
- package/dist/components/label/Label.js +48 -38
- package/dist/components/list/List.js +11 -10
- package/dist/components/list/List.module.scss.js +1 -0
- package/dist/components/progressBar/ProgressBar.client.js +34 -0
- package/dist/components/progressBar/ProgressBar.js +13 -0
- package/dist/components/progressBar/ProgressBar.lazy.js +15 -0
- package/dist/components/progressBar/ProgressBar.module.scss.js +35 -0
- package/dist/components/progressBar/ProgressBar.server.js +11 -0
- package/dist/components/progressBar/ProgressBar.view.js +55 -0
- package/dist/components/progressBar/index.js +4 -0
- package/dist/components/select/Select.view.js +10 -1
- package/dist/components/sidenav/SideNav.client.js +22 -2
- package/dist/components/sidenav/SideNav.module.scss.js +1 -0
- package/dist/components/sidenav/SideNav.view.js +2 -2
- package/dist/components/snackbar/Snackbar.client.js +38 -0
- package/dist/components/snackbar/Snackbar.js +12 -0
- package/dist/components/snackbar/Snackbar.lazy.js +12 -0
- package/dist/components/snackbar/Snackbar.module.scss.js +30 -0
- package/dist/components/snackbar/Snackbar.server.js +12 -0
- package/dist/components/snackbar/Snackbar.view.js +55 -0
- package/dist/components/snackbar/SnackbarProvider.client.js +79 -0
- package/dist/components/snackbar/SnackbarProvider.context.js +11 -0
- package/dist/components/snackbar/SnackbarProvider.js +14 -0
- package/dist/components/snackbar/SnackbarProvider.lazy.js +15 -0
- package/dist/components/snackbar/index.js +10 -0
- package/dist/components/stepper/Stepper.view.js +5 -2
- package/dist/components/table/Table.js +9 -8
- package/dist/components/table/TableCell.js +4 -3
- package/dist/constants/project.js +1 -1
- package/dist/helpers/createIsland.js +8 -5
- package/dist/helpers/createLazyWrapper.js +13 -8
- package/dist/index.js +6 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/accordion/Accordion.d.ts +1 -1
- package/dist/types/components/accordion/Accordion.lazy.d.ts +1 -1
- package/dist/types/components/accordion/Accordion.model.d.ts +1 -1
- package/dist/types/components/dialog/Dialog.d.ts +1 -1
- package/dist/types/components/dialog/Dialog.lazy.d.ts +1 -1
- package/dist/types/components/dialog/Dialog.model.d.ts +7 -3
- package/dist/types/components/dialog/Dialog.view.d.ts +1 -1
- package/dist/types/components/dynamic-list/DynamicList.client.d.ts +4 -0
- package/dist/types/components/dynamic-list/DynamicList.d.ts +4 -0
- package/dist/types/components/dynamic-list/DynamicList.lazy.d.ts +5 -0
- package/dist/types/components/dynamic-list/DynamicList.model.d.ts +32 -0
- package/dist/types/components/dynamic-list/DynamicList.server.d.ts +3 -0
- package/dist/types/components/dynamic-list/DynamicList.view.d.ts +12 -0
- package/dist/types/components/dynamic-list/index.d.ts +2 -0
- package/dist/types/components/form/Form.d.ts +1 -1
- package/dist/types/components/form/Form.lazy.d.ts +1 -1
- package/dist/types/components/form/Form.model.d.ts +9 -5
- package/dist/types/components/form/index.d.ts +1 -2
- package/dist/types/components/label/Label.model.d.ts +9 -2
- package/dist/types/components/link/Link.model.d.ts +2 -2
- package/dist/types/components/list/List.model.d.ts +11 -5
- package/dist/types/components/progressBar/ProgressBar.client.d.ts +3 -0
- package/dist/types/components/progressBar/ProgressBar.d.ts +12 -0
- package/dist/types/components/progressBar/ProgressBar.lazy.d.ts +13 -0
- package/dist/types/components/progressBar/ProgressBar.model.d.ts +14 -0
- package/dist/types/components/progressBar/ProgressBar.server.d.ts +3 -0
- package/dist/types/components/progressBar/ProgressBar.view.d.ts +3 -0
- package/dist/types/components/progressBar/index.d.ts +2 -0
- package/dist/types/components/select/Select.model.d.ts +3 -2
- package/dist/types/components/sidenav/SideNav.client.d.ts +1 -1
- package/dist/types/components/sidenav/SideNav.model.d.ts +2 -0
- package/dist/types/components/snackbar/Snackbar.client.d.ts +5 -0
- package/dist/types/components/snackbar/Snackbar.d.ts +4 -0
- package/dist/types/components/snackbar/Snackbar.lazy.d.ts +5 -0
- package/dist/types/components/snackbar/Snackbar.model.d.ts +20 -0
- package/dist/types/components/snackbar/Snackbar.server.d.ts +3 -0
- package/dist/types/components/snackbar/Snackbar.view.d.ts +7 -0
- package/dist/types/components/snackbar/SnackbarProvider.client.d.ts +4 -0
- package/dist/types/components/snackbar/SnackbarProvider.context.d.ts +6 -0
- package/dist/types/components/snackbar/SnackbarProvider.d.ts +3 -0
- package/dist/types/components/snackbar/SnackbarProvider.lazy.d.ts +5 -0
- package/dist/types/components/snackbar/SnackbarProvider.model.d.ts +25 -0
- package/dist/types/components/snackbar/index.d.ts +6 -0
- package/dist/types/components/stepper/Stepper.model.d.ts +1 -1
- package/dist/types/components/table/Table.model.d.ts +3 -2
- package/dist/types/index.d.ts +3 -0
- package/dist/ui.css +745 -16
- package/package.json +14 -2
|
@@ -4,11 +4,11 @@ import { jsx } from "react/jsx-runtime";
|
|
|
4
4
|
import { create } from "../../helpers/bem.js";
|
|
5
5
|
import styles from "./FormField.module.scss.js";
|
|
6
6
|
import { DatePicker } from "../datePicker/DatePicker.js";
|
|
7
|
-
import { Input } from "../input/Input.js";
|
|
8
7
|
import { Select } from "../select/Select.js";
|
|
9
8
|
import { Slider } from "../slider/Slider.js";
|
|
10
9
|
import { Switch } from "../switch/Switch.js";
|
|
11
10
|
import { GridRow } from "../grid/GridRow.js";
|
|
11
|
+
import { Input } from "../input/Input.js";
|
|
12
12
|
const bem = create(styles, "FormField");
|
|
13
13
|
function FormFieldServer({
|
|
14
14
|
fieldType,
|
|
@@ -56,6 +56,7 @@ function FormFieldServer({
|
|
|
56
56
|
/* @__PURE__ */ jsx(
|
|
57
57
|
Input,
|
|
58
58
|
{
|
|
59
|
+
readOnly: true,
|
|
59
60
|
errorTranslations: (_a = messagesFields == null ? void 0 : messagesFields.errors) == null ? void 0 : _a.input,
|
|
60
61
|
...props
|
|
61
62
|
}
|
|
@@ -66,6 +67,7 @@ function FormFieldServer({
|
|
|
66
67
|
/* @__PURE__ */ jsx(
|
|
67
68
|
DatePicker,
|
|
68
69
|
{
|
|
70
|
+
readOnly: true,
|
|
69
71
|
...props,
|
|
70
72
|
translations: (_b = messagesFields == null ? void 0 : messagesFields.errors) == null ? void 0 : _b.date
|
|
71
73
|
}
|
|
@@ -11,6 +11,7 @@ const FormResponse = /* @__PURE__ */ __name(({ className, messages, ...props })
|
|
|
11
11
|
const listItems = errorKeys.map((key) => {
|
|
12
12
|
var _a, _b;
|
|
13
13
|
return {
|
|
14
|
+
id: key,
|
|
14
15
|
title: key.charAt(0).toUpperCase() + key.slice(1),
|
|
15
16
|
desc: (messages == null ? void 0 : messages.errors) ? (_b = (_a = messages.errors) == null ? void 0 : _a[key]) == null ? void 0 : _b.join(", ") : "",
|
|
16
17
|
className: bem("errors__item")
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
import { jsxs,
|
|
3
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
4
4
|
import { create } from "../../helpers/bem.js";
|
|
5
5
|
import styles from "./Label.module.scss.js";
|
|
6
6
|
const bem = create(styles, "Label");
|
|
7
7
|
const Label = /* @__PURE__ */ __name(({
|
|
8
|
+
type = "label",
|
|
8
9
|
className,
|
|
9
|
-
htmlFor,
|
|
10
10
|
required,
|
|
11
11
|
label,
|
|
12
12
|
contentProps,
|
|
@@ -16,47 +16,57 @@ const Label = /* @__PURE__ */ __name(({
|
|
|
16
16
|
...props
|
|
17
17
|
}) => {
|
|
18
18
|
const splittedLabel = label == null ? void 0 : label.split(" ");
|
|
19
|
+
const renderContent = /* @__PURE__ */ __name(() => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
20
|
+
/* @__PURE__ */ jsxs("span", { ...contentProps, children: [
|
|
21
|
+
/* @__PURE__ */ jsxs(
|
|
22
|
+
"i",
|
|
23
|
+
{
|
|
24
|
+
...textProps,
|
|
25
|
+
className: bem(
|
|
26
|
+
"highlighted",
|
|
27
|
+
{
|
|
28
|
+
error: Boolean(error)
|
|
29
|
+
},
|
|
30
|
+
textProps == null ? void 0 : textProps.className
|
|
31
|
+
),
|
|
32
|
+
children: [
|
|
33
|
+
splittedLabel == null ? void 0 : splittedLabel[0],
|
|
34
|
+
" "
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
/* @__PURE__ */ jsxs(
|
|
39
|
+
"i",
|
|
40
|
+
{
|
|
41
|
+
...textProps,
|
|
42
|
+
className: bem("text", void 0, textProps == null ? void 0 : textProps.className),
|
|
43
|
+
children: [
|
|
44
|
+
splittedLabel == null ? void 0 : splittedLabel.slice(1).join(" "),
|
|
45
|
+
" ",
|
|
46
|
+
Boolean(required) && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "*" })
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] }),
|
|
51
|
+
children
|
|
52
|
+
] }), "renderContent");
|
|
19
53
|
if (!splittedLabel) return children;
|
|
20
|
-
|
|
54
|
+
if (type === "legend") {
|
|
55
|
+
return /* @__PURE__ */ jsx(
|
|
56
|
+
"legend",
|
|
57
|
+
{
|
|
58
|
+
...props,
|
|
59
|
+
className: bem(void 0, void 0, className),
|
|
60
|
+
children: renderContent()
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
21
65
|
"label",
|
|
22
66
|
{
|
|
23
67
|
...props,
|
|
24
68
|
className: bem(void 0, void 0, className),
|
|
25
|
-
|
|
26
|
-
children: [
|
|
27
|
-
/* @__PURE__ */ jsxs("span", { ...contentProps, children: [
|
|
28
|
-
/* @__PURE__ */ jsxs(
|
|
29
|
-
"i",
|
|
30
|
-
{
|
|
31
|
-
...textProps,
|
|
32
|
-
className: bem(
|
|
33
|
-
"highlighted",
|
|
34
|
-
{
|
|
35
|
-
error: Boolean(error)
|
|
36
|
-
},
|
|
37
|
-
textProps == null ? void 0 : textProps.className
|
|
38
|
-
),
|
|
39
|
-
children: [
|
|
40
|
-
splittedLabel == null ? void 0 : splittedLabel[0],
|
|
41
|
-
" "
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
),
|
|
45
|
-
/* @__PURE__ */ jsxs(
|
|
46
|
-
"i",
|
|
47
|
-
{
|
|
48
|
-
...textProps,
|
|
49
|
-
className: bem("text", void 0, textProps == null ? void 0 : textProps.className),
|
|
50
|
-
children: [
|
|
51
|
-
splittedLabel == null ? void 0 : splittedLabel.slice(1).join(" "),
|
|
52
|
-
" ",
|
|
53
|
-
Boolean(required) && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "*" })
|
|
54
|
-
]
|
|
55
|
-
}
|
|
56
|
-
)
|
|
57
|
-
] }),
|
|
58
|
-
children
|
|
59
|
-
]
|
|
69
|
+
children: renderContent()
|
|
60
70
|
}
|
|
61
71
|
);
|
|
62
72
|
}, "Label");
|
|
@@ -29,9 +29,9 @@ function List({
|
|
|
29
29
|
"aria-relevant": "additions text",
|
|
30
30
|
...props,
|
|
31
31
|
className: bem(void 0, void 0, className),
|
|
32
|
-
children: items.map((item) => {
|
|
32
|
+
children: items.map((item, i) => {
|
|
33
33
|
var _a;
|
|
34
|
-
const { title, desc, icon, redirect, onClick, variant: itemVariant, className: itemClassName } = item;
|
|
34
|
+
const { id, title, desc, icon, redirect, onClick, variant: itemVariant, className: itemClassName } = item;
|
|
35
35
|
const isClickable = Boolean(onClick || redirect);
|
|
36
36
|
const liHandlers = {};
|
|
37
37
|
if (isClickable) {
|
|
@@ -52,6 +52,7 @@ function List({
|
|
|
52
52
|
{
|
|
53
53
|
"is-clickable": isClickable,
|
|
54
54
|
[`is-clickable--${itemVariant ?? variant}`]: isClickable,
|
|
55
|
+
"has-icon": Boolean(item == null ? void 0 : item.icon),
|
|
55
56
|
...modifier
|
|
56
57
|
},
|
|
57
58
|
itemClassName
|
|
@@ -65,11 +66,11 @@ function List({
|
|
|
65
66
|
}, "TitleSpan");
|
|
66
67
|
const DescParagraph = /* @__PURE__ */ __name(() => {
|
|
67
68
|
if (!isString(desc) && !isValidElement(desc)) return null;
|
|
68
|
-
return /* @__PURE__ */ jsx("
|
|
69
|
+
return /* @__PURE__ */ jsx("div", { className: bem("item__desc", { "card": type === "card" }, classNameDesc), children: desc });
|
|
69
70
|
}, "DescParagraph");
|
|
70
71
|
const IconWrapper = /* @__PURE__ */ __name(() => {
|
|
71
|
-
if (
|
|
72
|
-
return /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: bem("item__icon__wrapper"), children: /* @__PURE__ */ jsx(Icon, { color: variant, name: icon, ...options.icon }) });
|
|
72
|
+
if (icon === void 0 || icon === null) return null;
|
|
73
|
+
return /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: bem("item__icon__wrapper"), children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(Icon, { color: variant, name: icon, ...options.icon }) });
|
|
73
74
|
}, "IconWrapper");
|
|
74
75
|
if (type === "card") {
|
|
75
76
|
const cardItem = item;
|
|
@@ -86,12 +87,12 @@ function List({
|
|
|
86
87
|
cardItem.contentClassName
|
|
87
88
|
),
|
|
88
89
|
children: /* @__PURE__ */ jsxs("div", { className: bem("item__inner", void 0, cardItem.innerClassName), children: [
|
|
89
|
-
icon && /* @__PURE__ */ jsx(
|
|
90
|
+
icon !== void 0 && icon !== null && /* @__PURE__ */ jsx(
|
|
90
91
|
"div",
|
|
91
92
|
{
|
|
92
93
|
"aria-hidden": "true",
|
|
93
94
|
className: bem("item__icon", void 0, (_a = cardItem.iconProps) == null ? void 0 : _a.className),
|
|
94
|
-
children: /* @__PURE__ */ jsx(
|
|
95
|
+
children: isValidElement(icon) ? icon : /* @__PURE__ */ jsx(
|
|
95
96
|
Icon,
|
|
96
97
|
{
|
|
97
98
|
...cardItem.iconProps,
|
|
@@ -108,7 +109,7 @@ function List({
|
|
|
108
109
|
] })
|
|
109
110
|
] })
|
|
110
111
|
}
|
|
111
|
-
) }, `list-item-${
|
|
112
|
+
) }, `list-item-${id ?? i}`);
|
|
112
113
|
}
|
|
113
114
|
if (redirect) {
|
|
114
115
|
const linkProps = redirect;
|
|
@@ -126,13 +127,13 @@ function List({
|
|
|
126
127
|
/* @__PURE__ */ jsx(DescParagraph, {})
|
|
127
128
|
]
|
|
128
129
|
}
|
|
129
|
-
) }, `list-item-${
|
|
130
|
+
) }, `list-item-${id ?? i}`);
|
|
130
131
|
}
|
|
131
132
|
return /* @__PURE__ */ jsxs("li", { className: liClass, ...liHandlers, children: [
|
|
132
133
|
/* @__PURE__ */ jsx(IconWrapper, {}),
|
|
133
134
|
/* @__PURE__ */ jsx(TitleSpan, {}),
|
|
134
135
|
/* @__PURE__ */ jsx(DescParagraph, {})
|
|
135
|
-
] }, `list-item-${
|
|
136
|
+
] }, `list-item-${id ?? i}`);
|
|
136
137
|
})
|
|
137
138
|
}
|
|
138
139
|
);
|
|
@@ -3,6 +3,7 @@ const fadeInKeyframe = "fadeInKeyframe";
|
|
|
3
3
|
const styles = {
|
|
4
4
|
"prokodo-List": "prokodo-List",
|
|
5
5
|
"prokodo-List__item": "prokodo-List__item",
|
|
6
|
+
"prokodo-List__item--has-icon": "prokodo-List__item--has-icon",
|
|
6
7
|
"prokodo-List__item__card": "prokodo-List__item__card",
|
|
7
8
|
"prokodo-List__item__card__content": "prokodo-List__item__card__content",
|
|
8
9
|
"prokodo-List__item__inner": "prokodo-List__item__inner",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useState, useRef, useEffect } from "react";
|
|
6
|
+
import { ProgressBarView } from "./ProgressBar.view.js";
|
|
7
|
+
function ProgressBarClient(props) {
|
|
8
|
+
const { value, animated = true, ...rest } = props;
|
|
9
|
+
const [displayValue, setDisplayValue] = useState(value);
|
|
10
|
+
const frame = useRef(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!animated || value === void 0) {
|
|
13
|
+
setDisplayValue(value);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const start = displayValue ?? 0;
|
|
17
|
+
const end = value;
|
|
18
|
+
const duration = 400;
|
|
19
|
+
const startTime = performance.now();
|
|
20
|
+
const step = /* @__PURE__ */ __name((now) => {
|
|
21
|
+
const progress = Math.min(1, (now - startTime) / duration);
|
|
22
|
+
const next = start + (end - start) * progress;
|
|
23
|
+
setDisplayValue(next);
|
|
24
|
+
if (progress < 1) frame.current = requestAnimationFrame(step);
|
|
25
|
+
}, "step");
|
|
26
|
+
frame.current = requestAnimationFrame(step);
|
|
27
|
+
return () => cancelAnimationFrame(frame.current);
|
|
28
|
+
}, [value, animated]);
|
|
29
|
+
return /* @__PURE__ */ jsx(ProgressBarView, { ...rest, value: displayValue });
|
|
30
|
+
}
|
|
31
|
+
__name(ProgressBarClient, "ProgressBarClient");
|
|
32
|
+
export {
|
|
33
|
+
ProgressBarClient as default
|
|
34
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { createIsland } from "../../helpers/createIsland.js";
|
|
4
|
+
import ProgressBarServer from "./ProgressBar.server.js";
|
|
5
|
+
const ProgressBar = createIsland({
|
|
6
|
+
name: "ProgressBar",
|
|
7
|
+
Server: ProgressBarServer,
|
|
8
|
+
loadLazy: /* @__PURE__ */ __name(() => import("./ProgressBar.lazy.js"), "loadLazy"),
|
|
9
|
+
isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
|
|
10
|
+
});
|
|
11
|
+
export {
|
|
12
|
+
ProgressBar
|
|
13
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
import { createLazyWrapper } from "../../helpers/createLazyWrapper.js";
|
|
5
|
+
import ProgressBarClient from "./ProgressBar.client.js";
|
|
6
|
+
import ProgressBarServer from "./ProgressBar.server.js";
|
|
7
|
+
const ProgressBar_lazy = createLazyWrapper({
|
|
8
|
+
name: "ProgressBar",
|
|
9
|
+
Client: ProgressBarClient,
|
|
10
|
+
Server: ProgressBarServer,
|
|
11
|
+
isInteractive: /* @__PURE__ */ __name(() => true, "isInteractive")
|
|
12
|
+
});
|
|
13
|
+
export {
|
|
14
|
+
ProgressBar_lazy as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const gradientShift = "gradientShift";
|
|
2
|
+
const indeterminateMove = "indeterminateMove";
|
|
3
|
+
const ProgressBar__bar = "ProgressBar__bar";
|
|
4
|
+
const gradientMove = "gradientMove";
|
|
5
|
+
const fadeInKeyframe = "fadeInKeyframe";
|
|
6
|
+
const styles = {
|
|
7
|
+
"prokodo-ProgressBar": "prokodo-ProgressBar",
|
|
8
|
+
"prokodo-ProgressBar__track": "prokodo-ProgressBar__track",
|
|
9
|
+
"prokodo-ProgressBar__bar": "prokodo-ProgressBar__bar",
|
|
10
|
+
gradientShift,
|
|
11
|
+
"prokodo-ProgressBar__bar--primary": "prokodo-ProgressBar__bar--primary",
|
|
12
|
+
"prokodo-ProgressBar__bar--secondary": "prokodo-ProgressBar__bar--secondary",
|
|
13
|
+
"prokodo-ProgressBar__bar--info": "prokodo-ProgressBar__bar--info",
|
|
14
|
+
"prokodo-ProgressBar__bar--success": "prokodo-ProgressBar__bar--success",
|
|
15
|
+
"prokodo-ProgressBar__bar--warning": "prokodo-ProgressBar__bar--warning",
|
|
16
|
+
"prokodo-ProgressBar__bar--error": "prokodo-ProgressBar__bar--error",
|
|
17
|
+
"prokodo-ProgressBar__bar--infinity": "prokodo-ProgressBar__bar--infinity",
|
|
18
|
+
"prokodo-ProgressBar__bar--indeterminate": "prokodo-ProgressBar__bar--indeterminate",
|
|
19
|
+
indeterminateMove,
|
|
20
|
+
"prokodo-ProgressBar__bar--indeterminate--infinity": "prokodo-ProgressBar__bar--indeterminate--infinity",
|
|
21
|
+
"prokodo-ProgressBar__label": "prokodo-ProgressBar__label",
|
|
22
|
+
"prokodo-ProgressBar--animated": "prokodo-ProgressBar--animated",
|
|
23
|
+
ProgressBar__bar,
|
|
24
|
+
"ProgressBar__bar--indeterminate": "ProgressBar__bar--indeterminate",
|
|
25
|
+
gradientMove,
|
|
26
|
+
fadeInKeyframe
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
ProgressBar__bar,
|
|
30
|
+
styles as default,
|
|
31
|
+
fadeInKeyframe,
|
|
32
|
+
gradientMove,
|
|
33
|
+
gradientShift,
|
|
34
|
+
indeterminateMove
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { ProgressBarView } from "./ProgressBar.view.js";
|
|
5
|
+
function ProgressBarServer(props) {
|
|
6
|
+
return /* @__PURE__ */ jsx(ProgressBarView, { ...props });
|
|
7
|
+
}
|
|
8
|
+
__name(ProgressBarServer, "ProgressBarServer");
|
|
9
|
+
export {
|
|
10
|
+
ProgressBarServer as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
|
+
import { create } from "../../helpers/bem.js";
|
|
5
|
+
import { isString } from "../../helpers/validations.js";
|
|
6
|
+
import styles from "./ProgressBar.module.scss.js";
|
|
7
|
+
const bem = create(styles, "ProgressBar");
|
|
8
|
+
function ProgressBarView({
|
|
9
|
+
id,
|
|
10
|
+
value,
|
|
11
|
+
label,
|
|
12
|
+
hideLabel,
|
|
13
|
+
infinity,
|
|
14
|
+
variant = "primary",
|
|
15
|
+
animated = true,
|
|
16
|
+
className,
|
|
17
|
+
...domRest
|
|
18
|
+
}) {
|
|
19
|
+
const safeValue = typeof value === "number" ? Math.min(100, Math.max(0, value)) : void 0;
|
|
20
|
+
const isIndeterminate = safeValue === void 0;
|
|
21
|
+
return /* @__PURE__ */ jsxs(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
...domRest,
|
|
25
|
+
"aria-valuemax": 100,
|
|
26
|
+
"aria-valuemin": 0,
|
|
27
|
+
"aria-valuenow": safeValue ?? void 0,
|
|
28
|
+
className: bem(void 0, { animated }, className),
|
|
29
|
+
id,
|
|
30
|
+
role: "progressbar",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxs("div", { className: bem("track"), children: [
|
|
33
|
+
" ",
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
style: !isIndeterminate ? { width: `${safeValue}%` } : void 0,
|
|
38
|
+
className: bem("bar", {
|
|
39
|
+
[`${variant}`]: true,
|
|
40
|
+
indeterminate: isIndeterminate,
|
|
41
|
+
infinity: Boolean(infinity),
|
|
42
|
+
"indeterminate--infinity": isIndeterminate && Boolean(infinity)
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] }),
|
|
47
|
+
!Boolean(hideLabel) && isString(label) && /* @__PURE__ */ jsx("span", { className: bem("label"), children: label })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
__name(ProgressBarView, "ProgressBarView");
|
|
53
|
+
export {
|
|
54
|
+
ProgressBarView
|
|
55
|
+
};
|
|
@@ -56,7 +56,8 @@ function SelectView({
|
|
|
56
56
|
error: isError,
|
|
57
57
|
htmlFor: id,
|
|
58
58
|
label,
|
|
59
|
-
required
|
|
59
|
+
required,
|
|
60
|
+
type: "label"
|
|
60
61
|
}
|
|
61
62
|
),
|
|
62
63
|
/* @__PURE__ */ jsxs("div", { className: bem("field", void 0, fieldClassName), children: [
|
|
@@ -78,6 +79,14 @@ function SelectView({
|
|
|
78
79
|
children: display
|
|
79
80
|
}
|
|
80
81
|
),
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
"input",
|
|
84
|
+
{
|
|
85
|
+
name,
|
|
86
|
+
type: "hidden",
|
|
87
|
+
value: Array.isArray(value) ? value.join(",") : value ?? ""
|
|
88
|
+
}
|
|
89
|
+
),
|
|
81
90
|
/* @__PURE__ */ jsxs(
|
|
82
91
|
"ul",
|
|
83
92
|
{
|
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
import { useState, useEffect } from "react";
|
|
5
|
+
import { useState, useEffect, useMemo } from "react";
|
|
6
6
|
import SideNavView from "./SideNav.view.js";
|
|
7
7
|
const STORAGE_KEY = "prokodo-adminSidebarCollapsed";
|
|
8
|
-
function SidebarClient(
|
|
8
|
+
function SidebarClient({
|
|
9
|
+
items,
|
|
10
|
+
onChange,
|
|
11
|
+
...props
|
|
12
|
+
}) {
|
|
9
13
|
const [collapsed, setCollapsed] = useState(
|
|
10
14
|
props.initialCollapsed ?? false
|
|
11
15
|
);
|
|
@@ -19,11 +23,27 @@ function SidebarClient(props) {
|
|
|
19
23
|
return !c;
|
|
20
24
|
});
|
|
21
25
|
}, "handleToggle");
|
|
26
|
+
const formatedItems = useMemo(() => items.map((el) => {
|
|
27
|
+
var _a;
|
|
28
|
+
return {
|
|
29
|
+
...el,
|
|
30
|
+
redirect: (el == null ? void 0 : el.redirect) && {
|
|
31
|
+
...el == null ? void 0 : el.redirect,
|
|
32
|
+
href: ((_a = el == null ? void 0 : el.redirect) == null ? void 0 : _a.href) ?? "",
|
|
33
|
+
onClick: /* @__PURE__ */ __name((e) => {
|
|
34
|
+
var _a2, _b;
|
|
35
|
+
(_b = (_a2 = el == null ? void 0 : el.redirect) == null ? void 0 : _a2.onClick) == null ? void 0 : _b.call(_a2, e);
|
|
36
|
+
onChange == null ? void 0 : onChange(el);
|
|
37
|
+
}, "onClick")
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}), [items, onChange]);
|
|
22
41
|
return /* @__PURE__ */ jsx(
|
|
23
42
|
SideNavView,
|
|
24
43
|
{
|
|
25
44
|
...props,
|
|
26
45
|
collapsed,
|
|
46
|
+
items: formatedItems,
|
|
27
47
|
onToggle: handleToggle
|
|
28
48
|
}
|
|
29
49
|
);
|
|
@@ -8,6 +8,7 @@ const styles = {
|
|
|
8
8
|
"prokodo-SideNav__toggle": "prokodo-SideNav__toggle",
|
|
9
9
|
"prokodo-SideNav__list": "prokodo-SideNav__list",
|
|
10
10
|
"prokodo-SideNav__link": "prokodo-SideNav__link",
|
|
11
|
+
"prokodo-SideNav__link--is-active": "prokodo-SideNav__link--is-active",
|
|
11
12
|
"prokodo-SideNav__icon__wrapper": "prokodo-SideNav__icon__wrapper",
|
|
12
13
|
"prokodo-SideNav__label": "prokodo-SideNav__label",
|
|
13
14
|
"label-in": "label-in",
|
|
@@ -43,11 +43,11 @@ function SideNavView({
|
|
|
43
43
|
]
|
|
44
44
|
}
|
|
45
45
|
),
|
|
46
|
-
/* @__PURE__ */ jsx("nav", { id: "sidenav", children: /* @__PURE__ */ jsx("ul", { className: bem("list"), children: items.map(({ label, icon, redirect }) => /* @__PURE__ */ jsx("li", { children: (redirect == null ? void 0 : redirect.href) !== void 0 ? /* @__PURE__ */ jsx(
|
|
46
|
+
/* @__PURE__ */ jsx("nav", { id: "sidenav", children: /* @__PURE__ */ jsx("ul", { className: bem("list"), children: items.map(({ label, icon, redirect, active }) => /* @__PURE__ */ jsx("li", { children: (redirect == null ? void 0 : redirect.href) !== void 0 ? /* @__PURE__ */ jsx(
|
|
47
47
|
Link,
|
|
48
48
|
{
|
|
49
49
|
...redirect,
|
|
50
|
-
className: bem("link", { collapsed }, redirect == null ? void 0 : redirect.className),
|
|
50
|
+
className: bem("link", { collapsed, "is-active": Boolean(active) }, redirect == null ? void 0 : redirect.className),
|
|
51
51
|
href: redirect.href,
|
|
52
52
|
children: renderItem(icon, label)
|
|
53
53
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { memo, useState, useRef, useCallback, useEffect } from "react";
|
|
6
|
+
import { SnackbarView } from "./Snackbar.view.js";
|
|
7
|
+
function SnackbarClient({
|
|
8
|
+
open: openProp = false,
|
|
9
|
+
autoHideDuration = 6e3,
|
|
10
|
+
onClose,
|
|
11
|
+
...rest
|
|
12
|
+
}) {
|
|
13
|
+
const [open, setOpen] = useState(openProp);
|
|
14
|
+
const timer = useRef(null);
|
|
15
|
+
const handleClose = useCallback(
|
|
16
|
+
(reason, event) => {
|
|
17
|
+
setOpen(false);
|
|
18
|
+
onClose == null ? void 0 : onClose(reason, event);
|
|
19
|
+
},
|
|
20
|
+
[onClose]
|
|
21
|
+
);
|
|
22
|
+
useEffect(() => setOpen(openProp), [openProp]);
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (!open || autoHideDuration === 0) return;
|
|
25
|
+
if (timer.current) clearTimeout(timer.current);
|
|
26
|
+
timer.current = setTimeout(() => handleClose("timeout"), autoHideDuration);
|
|
27
|
+
return () => {
|
|
28
|
+
if (timer.current) clearTimeout(timer.current);
|
|
29
|
+
};
|
|
30
|
+
}, [open, autoHideDuration, handleClose]);
|
|
31
|
+
if (!open) return null;
|
|
32
|
+
return /* @__PURE__ */ jsx(SnackbarView, { ...rest, onClose: handleClose });
|
|
33
|
+
}
|
|
34
|
+
__name(SnackbarClient, "SnackbarClient");
|
|
35
|
+
const SnackbarClient$1 = memo(SnackbarClient);
|
|
36
|
+
export {
|
|
37
|
+
SnackbarClient$1 as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { createIsland } from "../../helpers/createIsland.js";
|
|
4
|
+
import SnackbarServer from "./Snackbar.server.js";
|
|
5
|
+
const Snackbar = createIsland({
|
|
6
|
+
name: "Snackbar",
|
|
7
|
+
Server: SnackbarServer,
|
|
8
|
+
loadLazy: /* @__PURE__ */ __name(() => import("./Snackbar.lazy.js"), "loadLazy")
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
Snackbar
|
|
12
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createLazyWrapper } from "../../helpers/createLazyWrapper.js";
|
|
3
|
+
import SnackbarClient from "./Snackbar.client.js";
|
|
4
|
+
import SnackbarServer from "./Snackbar.server.js";
|
|
5
|
+
const Snackbar_lazy = createLazyWrapper({
|
|
6
|
+
name: "Snackbar",
|
|
7
|
+
Client: SnackbarClient,
|
|
8
|
+
Server: SnackbarServer
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
Snackbar_lazy as default
|
|
12
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const gradientMove = "gradientMove";
|
|
2
|
+
const fadeInKeyframe = "fadeInKeyframe";
|
|
3
|
+
const styles = {
|
|
4
|
+
"prokodo-Snackbar": "prokodo-Snackbar",
|
|
5
|
+
"prokodo-Snackbar--success": "prokodo-Snackbar--success",
|
|
6
|
+
"prokodo-Snackbar--error": "prokodo-Snackbar--error",
|
|
7
|
+
"prokodo-Snackbar--warning": "prokodo-Snackbar--warning",
|
|
8
|
+
"prokodo-Snackbar--info": "prokodo-Snackbar--info",
|
|
9
|
+
"prokodo-Snackbar__message": "prokodo-Snackbar__message",
|
|
10
|
+
"prokodo-Snackbar__action": "prokodo-Snackbar__action",
|
|
11
|
+
"prokodo-Snackbar__close": "prokodo-Snackbar__close",
|
|
12
|
+
"prokodo-Snackbar--readonly": "prokodo-Snackbar--readonly",
|
|
13
|
+
"prokodo-SnackbarProvider": "prokodo-SnackbarProvider",
|
|
14
|
+
"prokodo-SnackbarProvider--is-top": "prokodo-SnackbarProvider--is-top",
|
|
15
|
+
"prokodo-SnackbarProvider--is-bottom": "prokodo-SnackbarProvider--is-bottom",
|
|
16
|
+
"prokodo-SnackbarProvider--is-left": "prokodo-SnackbarProvider--is-left",
|
|
17
|
+
"prokodo-SnackbarProvider--is-right": "prokodo-SnackbarProvider--is-right",
|
|
18
|
+
"prokodo-SnackbarProvider__snackbar": "prokodo-SnackbarProvider__snackbar",
|
|
19
|
+
"prokodo-SnackbarProvider__snackbar--is-top": "prokodo-SnackbarProvider__snackbar--is-top",
|
|
20
|
+
"prokodo-SnackbarProvider__snackbar--is-bottom": "prokodo-SnackbarProvider__snackbar--is-bottom",
|
|
21
|
+
"prokodo-SnackbarProvider__snackbar--is-left": "prokodo-SnackbarProvider__snackbar--is-left",
|
|
22
|
+
"prokodo-SnackbarProvider__snackbar--is-right": "prokodo-SnackbarProvider__snackbar--is-right",
|
|
23
|
+
gradientMove,
|
|
24
|
+
fadeInKeyframe
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
styles as default,
|
|
28
|
+
fadeInKeyframe,
|
|
29
|
+
gradientMove
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import { SnackbarView } from "./Snackbar.view.js";
|
|
5
|
+
function SnackbarServer(p) {
|
|
6
|
+
if (!Boolean(p.open)) return null;
|
|
7
|
+
return /* @__PURE__ */ jsx(SnackbarView, { ...p, readOnly: true });
|
|
8
|
+
}
|
|
9
|
+
__name(SnackbarServer, "SnackbarServer");
|
|
10
|
+
export {
|
|
11
|
+
SnackbarServer as default
|
|
12
|
+
};
|