@prokodo/ui 0.0.52 → 0.0.53
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 +81 -81
- package/dist/components/accordion/Accordion.client.js +3 -1
- package/dist/components/accordion/Accordion.view.js +100 -81
- package/dist/components/animated/Animated.server.js +3 -1
- package/dist/components/animatedText/AnimatedText.client.js +1 -7
- package/dist/components/animatedText/AnimatedText.view.js +4 -1
- package/dist/components/avatar/Avatar.view.js +2 -2
- package/dist/components/base-link/BaseLink.view.js +1 -1
- package/dist/components/button/Button.server.js +1 -8
- package/dist/components/calendly/Calendly.client.js +63 -54
- package/dist/components/calendly/Calendly.server.js +3 -1
- package/dist/components/card/Card.client.js +2 -1
- package/dist/components/card/Card.effects.client.js +5 -1
- package/dist/components/card/Card.view.js +19 -2
- package/dist/components/carousel/Carousel.client.js +36 -12
- package/dist/components/chip/Chip.view.js +10 -6
- package/dist/components/datePicker/DatePicker.client.js +53 -37
- package/dist/components/datePicker/DatePicker.view.js +3 -1
- package/dist/components/dialog/Dialog.client.js +22 -14
- package/dist/components/dialog/Dialog.view.js +10 -2
- package/dist/components/drawer/Drawer.client.js +10 -2
- package/dist/components/drawer/Drawer.effects.client.js +7 -2
- package/dist/components/dynamic-list/DynamicList.client.js +8 -7
- package/dist/components/dynamic-list/DynamicList.server.js +10 -4
- package/dist/components/dynamic-list/DynamicList.view.js +1 -1
- package/dist/components/form/Form.client.js +16 -13
- package/dist/components/form/Form.view.js +8 -4
- package/dist/components/form/FormField.client.js +5 -5
- package/dist/components/form/FormField.server.js +3 -23
- package/dist/components/form/FormResponse.js +5 -1
- package/dist/components/grid/Grid.js +7 -2
- package/dist/components/grid/GridRow.js +12 -2
- package/dist/components/headline/Headline.js +3 -1
- package/dist/components/icon/Icon.js +8 -4
- package/dist/components/image-text/ImageText.js +5 -1
- package/dist/components/input/Input.client.js +52 -28
- package/dist/components/input/Input.view.js +92 -68
- package/dist/components/inputOTP/InputOTP.js +107 -90
- package/dist/components/label/Label.js +1 -8
- package/dist/components/link/Link.view.js +3 -1
- package/dist/components/list/List.js +94 -42
- package/dist/components/loading/Loading.client.js +15 -2
- package/dist/components/loading/Loading.server.js +8 -1
- package/dist/components/loading/Loading.view.js +30 -7
- package/dist/components/post-item/PostItem.client.js +18 -0
- package/dist/components/post-item/PostItem.js +7 -136
- package/dist/components/post-item/PostItem.lazy.js +14 -0
- package/dist/components/post-item/PostItem.module.scss.js +3 -1
- package/dist/components/post-item/PostItem.server.js +15 -0
- package/dist/components/post-item/PostItem.view.js +238 -0
- package/dist/components/post-item/PostItemAuthor.js +28 -22
- package/dist/components/post-teaser/PostTeaser.client.js +31 -0
- package/dist/components/post-teaser/PostTeaser.js +9 -169
- package/dist/components/post-teaser/PostTeaser.lazy.js +13 -0
- package/dist/components/post-teaser/PostTeaser.module.scss.js +3 -0
- package/dist/components/post-teaser/PostTeaser.server.js +23 -0
- package/dist/components/post-teaser/PostTeaser.view.js +252 -0
- package/dist/components/post-widget/PostWidget.client.js +9 -0
- package/dist/components/post-widget/PostWidget.js +11 -156
- package/dist/components/post-widget/PostWidget.lazy.js +13 -0
- package/dist/components/post-widget/PostWidget.module.scss.js +1 -0
- package/dist/components/post-widget/PostWidget.server.js +11 -0
- package/dist/components/post-widget/PostWidget.view.js +263 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.client.js +9 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.js +9 -160
- package/dist/components/post-widget-carousel/PostWidgetCarousel.lazy.js +13 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.module.scss.js +3 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.server.js +11 -0
- package/dist/components/post-widget-carousel/PostWidgetCarousel.view.js +244 -0
- package/dist/components/rich-text/RichText.client.js +7 -2
- package/dist/components/select/Select.view.js +132 -116
- package/dist/components/sidenav/SideNav.client.js +19 -18
- package/dist/components/sidenav/SideNav.server.js +8 -1
- package/dist/components/sidenav/SideNav.view.js +21 -3
- package/dist/components/skeleton/Skeleton.effects.client.js +3 -1
- package/dist/components/slider/Slider.client.js +56 -38
- package/dist/components/slider/Slider.view.js +1 -7
- package/dist/components/snackbar/SnackbarProvider.client.js +21 -22
- package/dist/components/stepper/Stepper.client.js +1 -8
- package/dist/components/switch/Switch.client.js +1 -6
- package/dist/components/switch/Switch.server.js +1 -3
- package/dist/components/table/Table.js +3 -1
- package/dist/components/table/TableCell.js +13 -1
- package/dist/components/teaser/Teaser.js +1 -5
- package/dist/constants/project.js +1 -1
- package/dist/helpers/createIsland.js +3 -1
- package/dist/helpers/createLazyWrapper.js +3 -1
- package/dist/helpers/date.js +21 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/components/accordion/Accordion.model.d.ts +1 -1
- package/dist/types/components/animated/Animated.client.d.ts +2 -2
- package/dist/types/components/animated/Animated.model.d.ts +1 -1
- package/dist/types/components/button/Button.client.d.ts +1 -1
- package/dist/types/components/button/Button.d.ts +1 -1
- package/dist/types/components/button/Button.lazy.d.ts +1 -1
- package/dist/types/components/button/Button.server.d.ts +1 -1
- package/dist/types/components/button/Button.view.d.ts +1 -1
- package/dist/types/components/card/Card.effects.client.d.ts +1 -1
- package/dist/types/components/card/index.d.ts +1 -1
- package/dist/types/components/carousel/Carousel.d.ts +3 -0
- package/dist/types/components/carousel/Carousel.lazy.d.ts +3 -0
- package/dist/types/components/carousel/Carousel.model.d.ts +4 -0
- package/dist/types/components/dialog/Dialog.client.d.ts +1 -1
- package/dist/types/components/dialog/Dialog.model.d.ts +4 -4
- package/dist/types/components/dialog/Dialog.view.d.ts +2 -2
- package/dist/types/components/drawer/Drawer.client.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.effects.client.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.lazy.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.model.d.ts +6 -6
- package/dist/types/components/drawer/Drawer.server.d.ts +1 -1
- package/dist/types/components/drawer/Drawer.view.d.ts +2 -2
- package/dist/types/components/drawer/index.d.ts +1 -1
- package/dist/types/components/icon/IconList.d.ts +1 -1
- package/dist/types/components/icon/index.d.ts +1 -1
- package/dist/types/components/image/Image.model.d.ts +2 -2
- package/dist/types/components/link/Link.d.ts +1 -1
- package/dist/types/components/link/Link.model.d.ts +1 -1
- package/dist/types/components/link/Link.server.d.ts +1 -1
- package/dist/types/components/loading/index.d.ts +1 -1
- package/dist/types/components/post-item/PostItem.client.d.ts +4 -0
- package/dist/types/components/post-item/PostItem.d.ts +3 -2
- package/dist/types/components/post-item/PostItem.lazy.d.ts +5 -0
- package/dist/types/components/post-item/PostItem.model.d.ts +46 -6
- package/dist/types/components/post-item/PostItem.server.d.ts +3 -0
- package/dist/types/components/post-item/PostItem.view.d.ts +3 -0
- package/dist/types/components/post-item/PostItemAuthor.model.d.ts +5 -8
- package/dist/types/components/post-item/index.d.ts +2 -2
- package/dist/types/components/post-teaser/PostTeaser.client.d.ts +4 -0
- package/dist/types/components/post-teaser/PostTeaser.d.ts +3 -2
- package/dist/types/components/post-teaser/PostTeaser.lazy.d.ts +5 -0
- package/dist/types/components/post-teaser/PostTeaser.model.d.ts +49 -3
- package/dist/types/components/post-teaser/PostTeaser.server.d.ts +3 -0
- package/dist/types/components/post-teaser/PostTeaser.view.d.ts +3 -0
- package/dist/types/components/post-teaser/index.d.ts +1 -1
- package/dist/types/components/post-widget/PostWidget.client.d.ts +4 -0
- package/dist/types/components/post-widget/PostWidget.d.ts +13 -3
- package/dist/types/components/post-widget/PostWidget.lazy.d.ts +14 -0
- package/dist/types/components/post-widget/PostWidget.model.d.ts +53 -3
- package/dist/types/components/post-widget/PostWidget.server.d.ts +3 -0
- package/dist/types/components/post-widget/PostWidget.view.d.ts +3 -0
- package/dist/types/components/post-widget/index.d.ts +1 -1
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.client.d.ts +3 -0
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.d.ts +11 -3
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.lazy.d.ts +12 -0
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.model.d.ts +39 -0
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.server.d.ts +3 -0
- package/dist/types/components/post-widget-carousel/PostWidgetCarousel.view.d.ts +3 -0
- package/dist/types/components/post-widget-carousel/index.d.ts +1 -1
- package/dist/types/components/sidenav/index.d.ts +1 -1
- package/dist/types/components/skeleton/Skeleton.effects.client.d.ts +2 -2
- package/dist/types/helpers/createIsland.d.ts +1 -1
- package/dist/types/helpers/createLazyWrapper.d.ts +1 -1
- package/dist/types/helpers/date.d.ts +5 -0
- package/dist/ui.css +116 -35
- package/package.json +3 -2
|
@@ -16,7 +16,10 @@ function SliderClient(props) {
|
|
|
16
16
|
marks = false,
|
|
17
17
|
snap = "none"
|
|
18
18
|
} = props;
|
|
19
|
-
const clamp = useCallback(
|
|
19
|
+
const clamp = useCallback(
|
|
20
|
+
(v) => Math.min(Math.max(v, min), max),
|
|
21
|
+
[min, max]
|
|
22
|
+
);
|
|
20
23
|
const markValues = useMemo(() => {
|
|
21
24
|
if (Array.isArray(marks)) {
|
|
22
25
|
return [...new Set(marks.map((m) => m.value))].filter((v) => typeof v === "number").sort((a, b) => a - b);
|
|
@@ -35,30 +38,36 @@ function SliderClient(props) {
|
|
|
35
38
|
(v) => clamp(step > 0 ? Math.round((v - min) / step) * step + min : v),
|
|
36
39
|
[clamp, step, min]
|
|
37
40
|
);
|
|
38
|
-
const snapToMarks = useCallback(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
const snapToMarks = useCallback(
|
|
42
|
+
(v) => {
|
|
43
|
+
const c = clamp(v);
|
|
44
|
+
const arr = markValues;
|
|
45
|
+
if (arr.length === 0) return snapToStep(c);
|
|
46
|
+
let best = c, bestD = Infinity;
|
|
47
|
+
for (const mv of arr) {
|
|
48
|
+
const d = Math.abs(c - mv);
|
|
49
|
+
if (d < bestD) {
|
|
50
|
+
best = mv;
|
|
51
|
+
bestD = d;
|
|
52
|
+
}
|
|
48
53
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
54
|
+
return clamp(best);
|
|
55
|
+
},
|
|
56
|
+
[clamp, markValues, snapToStep]
|
|
57
|
+
);
|
|
58
|
+
const quantize = useCallback(
|
|
59
|
+
(v) => {
|
|
60
|
+
switch (snap) {
|
|
61
|
+
case "step":
|
|
62
|
+
return snapToStep(v);
|
|
63
|
+
case "marks":
|
|
64
|
+
return snapToMarks(v);
|
|
65
|
+
default:
|
|
66
|
+
return clamp(v);
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
[snap, snapToMarks, snapToStep, clamp]
|
|
70
|
+
);
|
|
62
71
|
const initial = useMemo(() => {
|
|
63
72
|
const numeric = typeof controlledValue === "number" ? controlledValue : typeof controlledValue === "string" ? Number(controlledValue) : min;
|
|
64
73
|
return quantize(numeric);
|
|
@@ -72,20 +81,29 @@ function SliderClient(props) {
|
|
|
72
81
|
}
|
|
73
82
|
}, [controlledValue, min, quantize]);
|
|
74
83
|
const [isFocused, setIsFocused] = useState(false);
|
|
75
|
-
const handleFocus = useCallback(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
const handleFocus = useCallback(
|
|
85
|
+
(e) => {
|
|
86
|
+
setIsFocused(true);
|
|
87
|
+
onFocus == null ? void 0 : onFocus(e);
|
|
88
|
+
},
|
|
89
|
+
[onFocus]
|
|
90
|
+
);
|
|
91
|
+
const handleBlur = useCallback(
|
|
92
|
+
(e) => {
|
|
93
|
+
setIsFocused(false);
|
|
94
|
+
onBlur == null ? void 0 : onBlur(e);
|
|
95
|
+
},
|
|
96
|
+
[onBlur]
|
|
97
|
+
);
|
|
98
|
+
const handleChange = useCallback(
|
|
99
|
+
(e) => {
|
|
100
|
+
const raw = Number(e.currentTarget.value);
|
|
101
|
+
const q = quantize(raw);
|
|
102
|
+
setInternalValue((prev) => prev === q ? prev : q);
|
|
103
|
+
onChange == null ? void 0 : onChange(e, q);
|
|
104
|
+
},
|
|
105
|
+
[onChange, quantize]
|
|
106
|
+
);
|
|
89
107
|
return /* @__PURE__ */ jsx(
|
|
90
108
|
SliderView,
|
|
91
109
|
{
|
|
@@ -59,13 +59,7 @@ const SliderView = /* @__PURE__ */ __name(({
|
|
|
59
59
|
),
|
|
60
60
|
/* @__PURE__ */ jsxs("div", { className: bem("root", { disabled: Boolean(disabled) }), children: [
|
|
61
61
|
/* @__PURE__ */ jsx("div", { className: bem("rail") }),
|
|
62
|
-
/* @__PURE__ */ jsx(
|
|
63
|
-
"div",
|
|
64
|
-
{
|
|
65
|
-
className: bem("track"),
|
|
66
|
-
style: { width: `${pct}%` }
|
|
67
|
-
}
|
|
68
|
-
),
|
|
62
|
+
/* @__PURE__ */ jsx("div", { className: bem("track"), style: { width: `${pct}%` } }),
|
|
69
63
|
markPoints.map((m) => {
|
|
70
64
|
const leftPct = max > min ? ((m.value < min ? min : m.value > max ? max : m.value) - min) / (max - min) * 100 : 0;
|
|
71
65
|
return /* @__PURE__ */ jsx(
|
|
@@ -36,13 +36,19 @@ function SnackbarProvider({
|
|
|
36
36
|
const close = useCallback((id) => {
|
|
37
37
|
setQueue((q) => q.filter((s) => s.id !== id));
|
|
38
38
|
}, []);
|
|
39
|
-
const ctx = useMemo(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
const ctx = useMemo(
|
|
40
|
+
() => ({ enqueue, close }),
|
|
41
|
+
[enqueue, close]
|
|
42
|
+
);
|
|
43
|
+
const grouped = useMemo(
|
|
44
|
+
() => queue.reduce((acc, s) => {
|
|
45
|
+
var _a, _b;
|
|
46
|
+
const key = `${(_a = s.anchorOrigin) == null ? void 0 : _a.vertical}-${(_b = s.anchorOrigin) == null ? void 0 : _b.horizontal}`;
|
|
47
|
+
(acc[key] ?? (acc[key] = [])).push(s);
|
|
48
|
+
return acc;
|
|
49
|
+
}, {}),
|
|
50
|
+
[queue]
|
|
51
|
+
);
|
|
46
52
|
return /* @__PURE__ */ jsxs(SnackbarCtx.Provider, { value: ctx, children: [
|
|
47
53
|
children,
|
|
48
54
|
Object.entries(grouped).map(([key, snacks]) => {
|
|
@@ -52,23 +58,16 @@ function SnackbarProvider({
|
|
|
52
58
|
[`is-${vertical}`]: true,
|
|
53
59
|
[`is-${horizontal}`]: true
|
|
54
60
|
};
|
|
55
|
-
return /* @__PURE__ */ jsx(
|
|
56
|
-
|
|
61
|
+
return /* @__PURE__ */ jsx("div", { className: bem(void 0, mod, className), children: snacks.map((snk) => /* @__PURE__ */ jsx(
|
|
62
|
+
Snackbar,
|
|
57
63
|
{
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
...snk,
|
|
63
|
-
open: true,
|
|
64
|
-
className: bem("snackbar", mod, snk.className),
|
|
65
|
-
onClose: /* @__PURE__ */ __name(() => close(snk.id), "onClose")
|
|
66
|
-
},
|
|
67
|
-
snk.id
|
|
68
|
-
))
|
|
64
|
+
...snk,
|
|
65
|
+
open: true,
|
|
66
|
+
className: bem("snackbar", mod, snk.className),
|
|
67
|
+
onClose: /* @__PURE__ */ __name(() => close(snk.id), "onClose")
|
|
69
68
|
},
|
|
70
|
-
|
|
71
|
-
);
|
|
69
|
+
snk.id
|
|
70
|
+
)) }, key);
|
|
72
71
|
})
|
|
73
72
|
] });
|
|
74
73
|
}
|
|
@@ -104,14 +104,7 @@ const StepperClient = forwardRef((props, ref) => {
|
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
106
|
}),
|
|
107
|
-
[
|
|
108
|
-
steps,
|
|
109
|
-
activeStep,
|
|
110
|
-
handleStepClick,
|
|
111
|
-
handleStepKeyDown,
|
|
112
|
-
onFocus,
|
|
113
|
-
onBlur
|
|
114
|
-
]
|
|
107
|
+
[steps, activeStep, handleStepClick, handleStepKeyDown, onFocus, onBlur]
|
|
115
108
|
);
|
|
116
109
|
return /* @__PURE__ */ jsx(
|
|
117
110
|
StepperView,
|
|
@@ -5,12 +5,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
5
5
|
import { memo, useState, useEffect, useCallback } from "react";
|
|
6
6
|
import { SwitchView } from "./Switch.view.js";
|
|
7
7
|
function SwitchClient(props) {
|
|
8
|
-
const {
|
|
9
|
-
checked: controlledChecked,
|
|
10
|
-
onChange,
|
|
11
|
-
onFocus,
|
|
12
|
-
onBlur
|
|
13
|
-
} = props;
|
|
8
|
+
const { checked: controlledChecked, onChange, onFocus, onBlur } = props;
|
|
14
9
|
const [isChecked, setIsChecked] = useState(
|
|
15
10
|
controlledChecked ?? false
|
|
16
11
|
);
|
|
@@ -3,9 +3,7 @@ var __name = (target, value) => __defProp(target, "name", { value, configurable:
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { SwitchView } from "./Switch.view.js";
|
|
5
5
|
function SwitchServer(props) {
|
|
6
|
-
const {
|
|
7
|
-
checked: controlledChecked
|
|
8
|
-
} = props;
|
|
6
|
+
const { checked: controlledChecked } = props;
|
|
9
7
|
const isChecked = typeof controlledChecked === "boolean" ? controlledChecked : false;
|
|
10
8
|
return /* @__PURE__ */ jsx(
|
|
11
9
|
SwitchView,
|
|
@@ -50,7 +50,9 @@ const Table = /* @__PURE__ */ __name(({
|
|
|
50
50
|
return /* @__PURE__ */ jsx(
|
|
51
51
|
"tr",
|
|
52
52
|
{
|
|
53
|
-
className: bem("body__row", {
|
|
53
|
+
className: bem("body__row", {
|
|
54
|
+
"has-link": isString((_a = row == null ? void 0 : row.redirect) == null ? void 0 : _a.href)
|
|
55
|
+
}),
|
|
54
56
|
children: row == null ? void 0 : row.cells.filter((el) => el !== null).map((cell, b) => /* @__PURE__ */ createElement(
|
|
55
57
|
TableCell,
|
|
56
58
|
{
|
|
@@ -36,7 +36,19 @@ const TableCell = /* @__PURE__ */ __name(({
|
|
|
36
36
|
...cellProps,
|
|
37
37
|
className: bem(void 0, { "has-icon": Boolean(icon) }, className),
|
|
38
38
|
id,
|
|
39
|
-
children: (redirect == null ? void 0 : redirect.href) !== void 0 ? /* @__PURE__ */ jsx(
|
|
39
|
+
children: (redirect == null ? void 0 : redirect.href) !== void 0 ? /* @__PURE__ */ jsx(
|
|
40
|
+
Link,
|
|
41
|
+
{
|
|
42
|
+
priority: true,
|
|
43
|
+
...redirect,
|
|
44
|
+
className: bem(
|
|
45
|
+
"inner",
|
|
46
|
+
{ "has-link": true },
|
|
47
|
+
(redirect == null ? void 0 : redirect.className) ?? classNameInner
|
|
48
|
+
),
|
|
49
|
+
children: renderCellContent()
|
|
50
|
+
}
|
|
51
|
+
) : /* @__PURE__ */ jsx("span", { className: bem("inner", void 0, classNameInner), children: renderCellContent() })
|
|
40
52
|
}
|
|
41
53
|
);
|
|
42
54
|
}, "TableCell");
|
|
@@ -80,11 +80,7 @@ const Teaser = /* @__PURE__ */ __name(({
|
|
|
80
80
|
name: "ArrowRight01Icon",
|
|
81
81
|
size: "xs",
|
|
82
82
|
...redirect == null ? void 0 : redirect.icon,
|
|
83
|
-
className: bem(
|
|
84
|
-
"link__icon",
|
|
85
|
-
void 0,
|
|
86
|
-
(_a = redirect == null ? void 0 : redirect.icon) == null ? void 0 : _a.className
|
|
87
|
-
)
|
|
83
|
+
className: bem("link__icon", void 0, (_a = redirect == null ? void 0 : redirect.icon) == null ? void 0 : _a.className)
|
|
88
84
|
}
|
|
89
85
|
),
|
|
90
86
|
redirect == null ? void 0 : redirect.label
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
import { isString } from "./validations.js";
|
|
4
|
+
const localizeDate = /* @__PURE__ */ __name((locale, date) => {
|
|
5
|
+
if (!isString(date)) return void 0;
|
|
6
|
+
const newDate = new Date(date);
|
|
7
|
+
const year = newDate.getFullYear();
|
|
8
|
+
const month = String(newDate.getMonth() + 1).padStart(2, "0");
|
|
9
|
+
const day = String(newDate.getDate()).padStart(2, "0");
|
|
10
|
+
return {
|
|
11
|
+
locale: newDate.toLocaleDateString(locale, {
|
|
12
|
+
year: "numeric",
|
|
13
|
+
month: "long",
|
|
14
|
+
day: "numeric"
|
|
15
|
+
}),
|
|
16
|
+
meta: `${year}-${month}-${day}`
|
|
17
|
+
};
|
|
18
|
+
}, "localizeDate");
|
|
19
|
+
export {
|
|
20
|
+
localizeDate
|
|
21
|
+
};
|