@memobit/libs 3.9.0 → 3.11.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/README.md +96 -95
- package/dist/components/Confetti/Confetti2.js +26 -25
- package/dist/components/ErrorBoundary/ErrorBoundary2.js +8 -7
- package/dist/components/InputDate/InputDate2.js +16 -15
- package/dist/components/InputEmail/InputEmail2.js +22 -21
- package/dist/components/InputFile/InputFile2.js +9 -8
- package/dist/components/InputNumber/InputNumber2.js +7 -6
- package/dist/components/InputPassword/InputPassword2.js +6 -5
- package/dist/components/InputSearch/InputSearch2.js +18 -17
- package/dist/components/InputText/InputText2.js +6 -5
- package/dist/components/InputTextarea/InputTextarea2.js +11 -10
- package/dist/components/InputTime/InputTime2.js +35 -34
- package/dist/components/InputUrl/InputUrl2.js +20 -19
- package/dist/components/QuantitySelector/QuantitySelector2.js +19 -18
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/memobit-icons.json +1 -41
- package/dist/styles/highlight.scss +6 -6
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -1,95 +1,96 @@
|
|
|
1
|
-
# @memobit/libs
|
|
2
|
-
|
|
3
|
-
A TypeScript-first React component library — 100+ components, 70+ themes, plus the hooks and helpers needed to glue them together. Built for, and battle-tested across, the [Memobit](https://memobit.ro) family of apps.
|
|
4
|
-
|
|
5
|
-
**📚 Live documentation & component playground → [react.memobit.ro](https://react.memobit.ro/)**
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Install
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
npm install @memobit/libs
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
Peer dependencies (you provide these in your own app):
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install react@^19 react-dom@^19
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Quick start
|
|
22
|
-
|
|
23
|
-
```tsx
|
|
24
|
-
import { Button, Card, ToastProvider, useToast } from '@memobit/libs';
|
|
25
|
-
import '@memobit/libs/dist/index.css';
|
|
26
|
-
import '@memobit/libs/dist/styles/themes.scss'; // optional — only if you want the bundled themes
|
|
27
|
-
|
|
28
|
-
function App() {
|
|
29
|
-
return (
|
|
30
|
-
<ToastProvider>
|
|
31
|
-
<Demo />
|
|
32
|
-
</ToastProvider>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function Demo() {
|
|
37
|
-
const { showToast } = useToast();
|
|
38
|
-
return (
|
|
39
|
-
<Card>
|
|
40
|
-
<Button onClick={() => showToast({ type: 'success', message: 'Hello' })}>
|
|
41
|
-
Click me
|
|
42
|
-
</Button>
|
|
43
|
-
</Card>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## What's in the box
|
|
49
|
-
|
|
50
|
-
- **Components** — Buttons, forms (Input/Select/Checkbox/DatePicker/ColorPicker/EmojiPicker/FileDropzone…), navigation (Breadcrumb/AppHeader/ControlPanel/Tabs…), overlays (Drawer/Modal/ConfirmDialog/ContextMenu/Tooltip…), data (DataView/Table/Calendar/CalendarHeatmap/Chart…), feedback (Toast/Banner/Badge/Chip/EmptyState…), and many more.
|
|
51
|
-
- **Icons** — 470+ stroke icons, each tree-shakeable.
|
|
52
|
-
- **Themes** — 70+ ready-made SCSS themes (Arctic Blue, Midnight Atlas, Terracotta Kitchen, Neon Tokyo, …). Theme tokens are pure CSS custom properties, so you can author your own.
|
|
53
|
-
- **Hooks** — `useBreakpoint`, `useBodyScrollLock`, `useComponentEffect`, `useAppPersistence`, `useAuth`.
|
|
54
|
-
- **Helpers** — date formatting, number formatting, string utilities, search/highlight, pagination, URL helpers.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
1
|
+
# @memobit/libs
|
|
2
|
+
|
|
3
|
+
A TypeScript-first React component library — 100+ components, 70+ themes, plus the hooks and helpers needed to glue them together. Built for, and battle-tested across, the [Memobit](https://memobit.ro) family of apps.
|
|
4
|
+
|
|
5
|
+
**📚 Live documentation & component playground → [react.memobit.ro](https://react.memobit.ro/)**
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @memobit/libs
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Peer dependencies (you provide these in your own app):
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install react@^19 react-dom@^19 @memobit/core
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick start
|
|
22
|
+
|
|
23
|
+
```tsx
|
|
24
|
+
import { Button, Card, ToastProvider, useToast } from '@memobit/libs';
|
|
25
|
+
import '@memobit/libs/dist/index.css';
|
|
26
|
+
import '@memobit/libs/dist/styles/themes.scss'; // optional — only if you want the bundled themes
|
|
27
|
+
|
|
28
|
+
function App() {
|
|
29
|
+
return (
|
|
30
|
+
<ToastProvider>
|
|
31
|
+
<Demo />
|
|
32
|
+
</ToastProvider>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function Demo() {
|
|
37
|
+
const { showToast } = useToast();
|
|
38
|
+
return (
|
|
39
|
+
<Card>
|
|
40
|
+
<Button onClick={() => showToast({ type: 'success', message: 'Hello' })}>
|
|
41
|
+
Click me
|
|
42
|
+
</Button>
|
|
43
|
+
</Card>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## What's in the box
|
|
49
|
+
|
|
50
|
+
- **Components** — Buttons, forms (Input/Select/Checkbox/DatePicker/ColorPicker/EmojiPicker/FileDropzone…), navigation (Breadcrumb/AppHeader/ControlPanel/Tabs…), overlays (Drawer/Modal/ConfirmDialog/ContextMenu/Tooltip…), data (DataView/Table/Calendar/CalendarHeatmap/Chart…), feedback (Toast/Banner/Badge/Chip/EmptyState…), and many more.
|
|
51
|
+
- **Icons** — 470+ stroke icons, each tree-shakeable.
|
|
52
|
+
- **Themes** — 70+ ready-made SCSS themes (Arctic Blue, Midnight Atlas, Terracotta Kitchen, Neon Tokyo, …). Theme tokens are pure CSS custom properties, so you can author your own.
|
|
53
|
+
- **Hooks** — `useBreakpoint`, `useBodyScrollLock`, `useComponentEffect`, `useAppPersistence`, `useAuth`.
|
|
54
|
+
- **Helpers** — date formatting, number formatting, string utilities, search/highlight, pagination, URL helpers.
|
|
55
|
+
- **Error reporting** — lives in [`@memobit/core`](https://www.npmjs.com/package/@memobit/core) (React-free, works in Node too), a peer dependency: `ErrorBoundary` crashes are reported through it once the app calls `installErrorReporting`.
|
|
56
|
+
|
|
57
|
+
See the [component reference](https://react.memobit.ro/) for props, variants, and live examples.
|
|
58
|
+
|
|
59
|
+
## Theming
|
|
60
|
+
|
|
61
|
+
Themes ship as standalone SCSS files. Pick what you need:
|
|
62
|
+
|
|
63
|
+
```scss
|
|
64
|
+
// import everything
|
|
65
|
+
@use '@memobit/libs/dist/styles/themes.scss';
|
|
66
|
+
|
|
67
|
+
// or a single theme
|
|
68
|
+
@use '@memobit/libs/dist/styles/theming/arctic-blue.scss';
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
All tokens — spacing, typography, radii, transitions, colors — are exposed as CSS custom properties (`--spacing-8`, `--card-bg`, `--button-primary-bg`, etc.) so you can override per-component or per-route without forking the library.
|
|
72
|
+
|
|
73
|
+
Token reference:
|
|
74
|
+
|
|
75
|
+
- Sizing / spacing / radii / transitions → `@memobit/libs/dist/styles/variables.scss`
|
|
76
|
+
- Theme colors → `@memobit/libs/dist/styles/theming/*.scss`
|
|
77
|
+
|
|
78
|
+
## Requirements
|
|
79
|
+
|
|
80
|
+
- React **19.2+** and React DOM **19.2+** (peer deps)
|
|
81
|
+
- ESM-only (your bundler must support ESM — Vite, Next.js 13+, Webpack 5, esbuild, Rollup all do)
|
|
82
|
+
- For SCSS imports: a Sass-capable bundler
|
|
83
|
+
|
|
84
|
+
## TypeScript
|
|
85
|
+
|
|
86
|
+
Type definitions are bundled (`dist/index.d.ts`). No `@types/...` package required.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
[Apache 2.0](./LICENSE) © Iulian Cristea
|
|
91
|
+
|
|
92
|
+
## Links
|
|
93
|
+
|
|
94
|
+
- 📚 Docs & playground — https://react.memobit.ro/
|
|
95
|
+
- 🐙 Source — https://github.com/CristeaIulian/memobit-react-library
|
|
96
|
+
- 📦 npm — https://www.npmjs.com/package/@memobit/libs
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './Confetti.css';
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { forwardRef as B, useCallback as E, useEffect as H, useImperativeHandle as L, useRef as v } from "react";
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
4
|
+
import { jsx as N } from "react/jsx-runtime";
|
|
5
|
+
var O = [
|
|
6
6
|
"#0891b2",
|
|
7
7
|
"#06b6d4",
|
|
8
8
|
"#16a34a",
|
|
@@ -11,7 +11,7 @@ var _ = [
|
|
|
11
11
|
"#8b5cf6",
|
|
12
12
|
"#ec4899",
|
|
13
13
|
"#f97316"
|
|
14
|
-
],
|
|
14
|
+
], _ = (t) => {
|
|
15
15
|
if (t && t.length > 0) return t;
|
|
16
16
|
const a = getComputedStyle(document.documentElement), s = [
|
|
17
17
|
a.getPropertyValue("--body-accent-color").trim(),
|
|
@@ -25,7 +25,7 @@ var _ = [
|
|
|
25
25
|
"#ec4899",
|
|
26
26
|
"#f97316",
|
|
27
27
|
"#06b6d4"
|
|
28
|
-
] :
|
|
28
|
+
] : O;
|
|
29
29
|
}, I = () => {
|
|
30
30
|
const t = Math.random();
|
|
31
31
|
return t < 0.5 ? "rect" : t < 0.8 ? "circle" : "star";
|
|
@@ -40,7 +40,7 @@ var _ = [
|
|
|
40
40
|
color: b(s),
|
|
41
41
|
opacity: 1,
|
|
42
42
|
shape: I()
|
|
43
|
-
}),
|
|
43
|
+
}), j = (t, a, s) => {
|
|
44
44
|
const o = Math.random() * Math.PI * 2, c = 3 + Math.random() * 10;
|
|
45
45
|
return {
|
|
46
46
|
x: t,
|
|
@@ -68,7 +68,7 @@ var _ = [
|
|
|
68
68
|
trail: [],
|
|
69
69
|
exploded: !1,
|
|
70
70
|
children: []
|
|
71
|
-
}),
|
|
71
|
+
}), D = (t, a, s) => {
|
|
72
72
|
const o = Math.random() * Math.PI * 2, c = 1 + Math.random() * 5;
|
|
73
73
|
return {
|
|
74
74
|
x: t,
|
|
@@ -102,37 +102,37 @@ var _ = [
|
|
|
102
102
|
U(t, 0, 0, a.size / 2);
|
|
103
103
|
}
|
|
104
104
|
t.restore();
|
|
105
|
-
},
|
|
105
|
+
}, W = B(({ colors: t, duration: a = 3e3, scope: s = "fullscreen", variant: o = "confetti", particleCount: c }, P) => {
|
|
106
106
|
const h = v(null), f = v(0), d = v(0), M = v(!1), V = {
|
|
107
107
|
confetti: 150,
|
|
108
108
|
burst: 200,
|
|
109
109
|
fireworks: 8
|
|
110
|
-
},
|
|
110
|
+
}, C = E(() => {
|
|
111
111
|
M.current = !1, cancelAnimationFrame(f.current);
|
|
112
112
|
const i = h.current;
|
|
113
113
|
i && i.getContext("2d")?.clearRect(0, 0, i.width, i.height);
|
|
114
|
-
}, []),
|
|
114
|
+
}, []), R = E(() => {
|
|
115
115
|
const i = h.current;
|
|
116
116
|
if (!i || M.current) return;
|
|
117
117
|
const r = i.getContext("2d");
|
|
118
118
|
if (!r) return;
|
|
119
119
|
i.width = i.offsetWidth, i.height = i.offsetHeight;
|
|
120
|
-
const
|
|
120
|
+
const y = i.width, m = i.height, u = _(t), x = c ?? V[o];
|
|
121
121
|
M.current = !0, d.current = performance.now();
|
|
122
122
|
let l = [];
|
|
123
|
-
if (o === "confetti") l = Array.from({ length: x }, () => S(
|
|
123
|
+
if (o === "confetti") l = Array.from({ length: x }, () => S(y, m, u));
|
|
124
124
|
else if (o === "burst") {
|
|
125
|
-
const k =
|
|
126
|
-
l = Array.from({ length: x }, () =>
|
|
127
|
-
} else o === "fireworks" && (l = Array.from({ length: x }, () => F(
|
|
128
|
-
const
|
|
125
|
+
const k = y / 2, A = m / 2;
|
|
126
|
+
l = Array.from({ length: x }, () => j(k, A, u));
|
|
127
|
+
} else o === "fireworks" && (l = Array.from({ length: x }, () => F(y, m, u)));
|
|
128
|
+
const z = (k) => {
|
|
129
129
|
if (!M.current) return;
|
|
130
130
|
const A = k - d.current, g = Math.min(A / a, 1);
|
|
131
|
-
if (r.clearRect(0, 0,
|
|
131
|
+
if (r.clearRect(0, 0, y, m), o === "confetti" ? (g < 0.6 && Math.random() < 0.3 && l.push(S(y, m, u)), l = l.filter((e) => e.opacity > 0 && e.y < m + 20), l.forEach((e) => {
|
|
132
132
|
e.x += e.vx, e.y += e.vy, e.vy += 0.08, e.vx += (Math.random() - 0.5) * 0.1, e.angle += e.spin, g > 0.6 && (e.opacity -= 0.015), w(r, e);
|
|
133
133
|
})) : o === "burst" ? (l = l.filter((e) => e.opacity > 0), l.forEach((e) => {
|
|
134
134
|
e.x += e.vx, e.y += e.vy, e.vy += 0.15, e.vx *= 0.98, e.angle += e.spin, e.opacity -= 0.012, w(r, e);
|
|
135
|
-
})) : o === "fireworks" && (g < 0.85 && Math.random() < 0.04 && l.push(F(
|
|
135
|
+
})) : o === "fireworks" && (g < 0.85 && Math.random() < 0.04 && l.push(F(y, m, u)), l = l.filter((e) => e.exploded ? e.children?.some((n) => n.opacity > 0) ?? !1 : e.y > -m * 0.1), l.forEach((e) => {
|
|
136
136
|
if (e.exploded)
|
|
137
137
|
e.children?.forEach((n) => {
|
|
138
138
|
n.x += n.vx, n.y += n.vy, n.vy += 0.06, n.vx *= 0.97, n.angle += n.spin, n.opacity -= 0.014, w(r, n);
|
|
@@ -146,29 +146,30 @@ var _ = [
|
|
|
146
146
|
}), r.save(), r.globalAlpha = 1, r.fillStyle = e.color, r.beginPath(), r.arc(e.x, e.y, 3, 0, Math.PI * 2), r.fill(), r.restore(), e.x += e.vx, e.y += e.vy, e.vy += 0.18, e.vy >= 0) {
|
|
147
147
|
e.exploded = !0;
|
|
148
148
|
const n = 60 + Math.floor(Math.random() * 40);
|
|
149
|
-
e.children = Array.from({ length: n }, () =>
|
|
149
|
+
e.children = Array.from({ length: n }, () => D(e.x, e.y, u)), r.save(), r.globalAlpha = 0.8, r.fillStyle = "#ffffff", r.beginPath(), r.arc(e.x, e.y, 12, 0, Math.PI * 2), r.fill(), r.restore();
|
|
150
150
|
}
|
|
151
151
|
})), g >= 1 || l.length === 0) {
|
|
152
|
-
|
|
152
|
+
C();
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
155
|
-
f.current = requestAnimationFrame(
|
|
155
|
+
f.current = requestAnimationFrame(z);
|
|
156
156
|
};
|
|
157
|
-
f.current = requestAnimationFrame(
|
|
157
|
+
f.current = requestAnimationFrame(z);
|
|
158
158
|
}, [
|
|
159
159
|
t,
|
|
160
160
|
a,
|
|
161
161
|
o,
|
|
162
162
|
c,
|
|
163
|
-
|
|
163
|
+
C
|
|
164
164
|
]);
|
|
165
|
-
return L(P, () => ({ trigger:
|
|
165
|
+
return L(P, () => ({ trigger: R }), [R]), H(() => () => {
|
|
166
166
|
cancelAnimationFrame(f.current);
|
|
167
|
-
}, []), /* @__PURE__ */
|
|
167
|
+
}, []), /* @__PURE__ */ N("canvas", {
|
|
168
168
|
ref: h,
|
|
169
169
|
className: `confetti-canvas confetti-canvas--${s}`
|
|
170
170
|
});
|
|
171
171
|
});
|
|
172
|
+
W.displayName = "Confetti";
|
|
172
173
|
export {
|
|
173
|
-
|
|
174
|
+
W as Confetti
|
|
174
175
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import './ErrorBoundary.css';
|
|
2
|
-
import { EmptyState as
|
|
2
|
+
import { EmptyState as s } from "../EmptyState/EmptyState2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { Component as a } from "react";
|
|
5
5
|
import { jsx as o } from "react/jsx-runtime";
|
|
6
|
-
|
|
6
|
+
import { reportError as c } from "@memobit/core";
|
|
7
|
+
var h = class extends a {
|
|
7
8
|
constructor(...r) {
|
|
8
9
|
super(...r), this.state = { error: null }, this.reset = () => {
|
|
9
10
|
this.setState({ error: null });
|
|
@@ -13,18 +14,18 @@ var u = class extends a {
|
|
|
13
14
|
return { error: r };
|
|
14
15
|
}
|
|
15
16
|
componentDidCatch(r, t) {
|
|
16
|
-
console.error("ErrorBoundary caught:", r, t.componentStack), this.props.onError?.(r, t);
|
|
17
|
+
c(r, { componentStack: t.componentStack ?? void 0 }), console.error("ErrorBoundary caught:", r, t.componentStack), this.props.onError?.(r, t);
|
|
17
18
|
}
|
|
18
19
|
render() {
|
|
19
|
-
const { error: r } = this.state, { children: t, title: n, resetLabel:
|
|
20
|
+
const { error: r } = this.state, { children: t, title: n, resetLabel: i, fallback: e } = this.props;
|
|
20
21
|
return r ? e ? e(r, this.reset) : /* @__PURE__ */ o("div", {
|
|
21
22
|
className: "error-boundary",
|
|
22
|
-
children: /* @__PURE__ */ o(
|
|
23
|
+
children: /* @__PURE__ */ o(s, {
|
|
23
24
|
icon: "warning",
|
|
24
25
|
title: n ?? "Something went wrong",
|
|
25
26
|
description: r.message || "An unexpected error occurred.",
|
|
26
27
|
primary: {
|
|
27
|
-
text:
|
|
28
|
+
text: i ?? "Try again",
|
|
28
29
|
variant: "info",
|
|
29
30
|
onClick: this.reset
|
|
30
31
|
}
|
|
@@ -33,5 +34,5 @@ var u = class extends a {
|
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
export {
|
|
36
|
-
|
|
37
|
+
h as ErrorBoundary
|
|
37
38
|
};
|
|
@@ -2,17 +2,17 @@ import './InputDate.css';
|
|
|
2
2
|
import { Icon as f } from "../Icon/Icon2.js";
|
|
3
3
|
import { Tooltip as N } from "../Tooltip/Tooltip2.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { forwardRef as j, useRef as
|
|
5
|
+
import { forwardRef as j, useRef as y } from "react";
|
|
6
6
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
8
|
-
const m = b && u && !a && !n, h =
|
|
7
|
+
var z = j(({ autoComplete: v = "on", autoFocus: k, clearable: b, disabled: a, error: c, highlighted: g, id: r, label: p, max: R, min: w, onBlur: x, onChange: o, onClick: C, onKeyDown: I, onKeyUp: $, readOnly: n = !1, required: d = !1, success: l, type: P = "date", value: u }, i) => {
|
|
8
|
+
const m = b && u && !a && !n, h = y(null);
|
|
9
9
|
return /* @__PURE__ */ s("div", {
|
|
10
10
|
className: `input-date-wrapper${g ? " input-date-highlighted" : ""}`,
|
|
11
11
|
children: [
|
|
12
|
-
|
|
13
|
-
htmlFor:
|
|
12
|
+
p && /* @__PURE__ */ s("label", {
|
|
13
|
+
htmlFor: r,
|
|
14
14
|
className: "input-date-label",
|
|
15
|
-
children: [
|
|
15
|
+
children: [p, d && /* @__PURE__ */ e("span", {
|
|
16
16
|
className: "input-date-required",
|
|
17
17
|
children: "*"
|
|
18
18
|
})]
|
|
@@ -24,8 +24,8 @@ var E = j(({ autoComplete: v = "on", autoFocus: k, clearable: b, disabled: a, er
|
|
|
24
24
|
autoFocus: k,
|
|
25
25
|
disabled: a,
|
|
26
26
|
type: P === "date" ? "date" : "datetime-local",
|
|
27
|
-
className: `input-date${c ? " input-date-error" : ""}${
|
|
28
|
-
id:
|
|
27
|
+
className: `input-date${c ? " input-date-error" : ""}${l ? " input-date-success" : ""}${m ? " input-date--clearable" : ""}`,
|
|
28
|
+
id: r,
|
|
29
29
|
max: R,
|
|
30
30
|
min: w,
|
|
31
31
|
ref: (t) => {
|
|
@@ -33,10 +33,10 @@ var E = j(({ autoComplete: v = "on", autoFocus: k, clearable: b, disabled: a, er
|
|
|
33
33
|
},
|
|
34
34
|
value: u ?? "",
|
|
35
35
|
onBlur: x,
|
|
36
|
-
onChange: (t) =>
|
|
36
|
+
onChange: (t) => o?.(t.target.value || void 0),
|
|
37
37
|
onClick: C,
|
|
38
|
-
onKeyDown:
|
|
39
|
-
onKeyUp:
|
|
38
|
+
onKeyDown: I,
|
|
39
|
+
onKeyUp: $,
|
|
40
40
|
readOnly: n,
|
|
41
41
|
required: d
|
|
42
42
|
}), /* @__PURE__ */ s("div", {
|
|
@@ -46,7 +46,7 @@ var E = j(({ autoComplete: v = "on", autoFocus: k, clearable: b, disabled: a, er
|
|
|
46
46
|
children: /* @__PURE__ */ e("button", {
|
|
47
47
|
type: "button",
|
|
48
48
|
className: "input-date-clear",
|
|
49
|
-
onClick: () =>
|
|
49
|
+
onClick: () => o?.(void 0),
|
|
50
50
|
children: /* @__PURE__ */ e(f, {
|
|
51
51
|
name: "clear",
|
|
52
52
|
size: "sm"
|
|
@@ -75,13 +75,14 @@ var E = j(({ autoComplete: v = "on", autoFocus: k, clearable: b, disabled: a, er
|
|
|
75
75
|
className: "input-date-error-message",
|
|
76
76
|
children: c
|
|
77
77
|
}),
|
|
78
|
-
|
|
78
|
+
l && /* @__PURE__ */ e("span", {
|
|
79
79
|
className: "input-date-success-message",
|
|
80
|
-
children:
|
|
80
|
+
children: l
|
|
81
81
|
})
|
|
82
82
|
]
|
|
83
83
|
});
|
|
84
84
|
});
|
|
85
|
+
z.displayName = "InputDate";
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
+
z as InputDate
|
|
87
88
|
};
|
|
@@ -2,27 +2,27 @@ import './InputEmail.css';
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { forwardRef as F, useEffect as G, useState as N } from "react";
|
|
4
4
|
import { jsx as n, jsxs as b } from "react/jsx-runtime";
|
|
5
|
-
var L = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, M = (r) => !r || r.trim() === "" ? !0 : L.test(r.trim()),
|
|
6
|
-
const [f, u] = N(!0), [d, g] = N(!1), c = (e) =>
|
|
5
|
+
var L = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, M = (r) => !r || r.trim() === "" ? !0 : L.test(r.trim()), P = F(({ autoComplete: r = "on", autoFocus: I, disabled: A, error: $ = "Please enter a valid email address", highlighted: v, id: o, label: p, maxLength: x, onBlur: z, onChange: Z, onClick: j, onKeyDown: y, onKeyUp: B, onValidate: a, placeholder: C, readOnly: R = !1, required: s = !1, showValidation: h = !1, success: m, validateOn: i = "blur", value: l }, T) => {
|
|
6
|
+
const [f, u] = N(!0), [d, g] = N(!1), c = (e) => s && (!e || e.trim() === "") ? !1 : !e || e.trim() === "" ? !0 : M(e);
|
|
7
7
|
G(() => {
|
|
8
8
|
if (l !== void 0) {
|
|
9
9
|
const e = c(l);
|
|
10
|
-
u(e),
|
|
10
|
+
u(e), a?.(e);
|
|
11
11
|
}
|
|
12
12
|
}, [
|
|
13
13
|
l,
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
a,
|
|
15
|
+
s
|
|
16
16
|
]);
|
|
17
|
-
const
|
|
17
|
+
const _ = (e) => {
|
|
18
18
|
if (Z?.(e), i === "change" || i === "both") {
|
|
19
19
|
const t = c(e);
|
|
20
|
-
u(t), g(!0),
|
|
20
|
+
u(t), g(!0), a?.(t);
|
|
21
21
|
}
|
|
22
|
-
},
|
|
22
|
+
}, w = (e) => {
|
|
23
23
|
if (g(!0), i === "blur" || i === "both") {
|
|
24
24
|
const t = c(e.target.value);
|
|
25
|
-
u(t),
|
|
25
|
+
u(t), a?.(t);
|
|
26
26
|
}
|
|
27
27
|
z?.(e);
|
|
28
28
|
}, E = h && d && !f;
|
|
@@ -32,29 +32,29 @@ var L = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, M = (r) => !r || r.t
|
|
|
32
32
|
p && /* @__PURE__ */ b("label", {
|
|
33
33
|
htmlFor: o,
|
|
34
34
|
className: "input-email-label",
|
|
35
|
-
children: [p,
|
|
35
|
+
children: [p, s && /* @__PURE__ */ n("span", {
|
|
36
36
|
className: "input-email-required",
|
|
37
37
|
children: "*"
|
|
38
38
|
})]
|
|
39
39
|
}),
|
|
40
40
|
/* @__PURE__ */ n("input", {
|
|
41
41
|
autoComplete: r,
|
|
42
|
-
autoFocus:
|
|
43
|
-
disabled:
|
|
42
|
+
autoFocus: I,
|
|
43
|
+
disabled: A,
|
|
44
44
|
type: "email",
|
|
45
45
|
className: `input-email${E ? " input-email--error" : ""}${m ? " input-email-success" : f && d && h ? " input-email--valid" : ""}`,
|
|
46
46
|
id: o,
|
|
47
47
|
maxLength: x,
|
|
48
|
-
placeholder:
|
|
49
|
-
ref:
|
|
48
|
+
placeholder: C,
|
|
49
|
+
ref: T,
|
|
50
50
|
value: l,
|
|
51
|
-
onBlur:
|
|
52
|
-
onChange: (e) =>
|
|
51
|
+
onBlur: w,
|
|
52
|
+
onChange: (e) => _(e.target.value),
|
|
53
53
|
onClick: j,
|
|
54
|
-
onKeyDown:
|
|
55
|
-
onKeyUp:
|
|
56
|
-
readOnly:
|
|
57
|
-
required:
|
|
54
|
+
onKeyDown: y,
|
|
55
|
+
onKeyUp: B,
|
|
56
|
+
readOnly: R,
|
|
57
|
+
required: s
|
|
58
58
|
}),
|
|
59
59
|
E && /* @__PURE__ */ n("span", {
|
|
60
60
|
className: "input-email-error-message",
|
|
@@ -67,7 +67,8 @@ var L = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/, M = (r) => !r || r.t
|
|
|
67
67
|
]
|
|
68
68
|
});
|
|
69
69
|
});
|
|
70
|
+
P.displayName = "InputEmail";
|
|
70
71
|
export {
|
|
71
|
-
|
|
72
|
+
P as InputEmail,
|
|
72
73
|
M as validateEmail
|
|
73
74
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './InputFile.css';
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as g } from "react";
|
|
4
4
|
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
5
|
+
var x = g(({ accept: p, disabled: r, error: i, highlighted: t, id: a, label: s, onChange: f, onClick: m, onKeyDown: u, placeholder: c, required: h, success: l, value: d }, o) => /* @__PURE__ */ n("div", {
|
|
6
6
|
className: `input-file-wrapper${t ? " input-file-highlighted" : ""}`,
|
|
7
7
|
children: [
|
|
8
8
|
s && /* @__PURE__ */ n("label", {
|
|
@@ -14,15 +14,15 @@ var v = N(({ accept: r, disabled: p, error: i, highlighted: t, id: a, label: s,
|
|
|
14
14
|
})]
|
|
15
15
|
}),
|
|
16
16
|
/* @__PURE__ */ e("input", {
|
|
17
|
-
accept:
|
|
18
|
-
disabled:
|
|
17
|
+
accept: p,
|
|
18
|
+
disabled: r,
|
|
19
19
|
type: "file",
|
|
20
20
|
className: `input-file${i ? " input-file-error" : ""}${l ? " input-file-success" : ""}`,
|
|
21
21
|
id: a,
|
|
22
22
|
placeholder: c,
|
|
23
|
-
ref:
|
|
24
|
-
value:
|
|
25
|
-
onChange: (
|
|
23
|
+
ref: o,
|
|
24
|
+
value: d,
|
|
25
|
+
onChange: (N) => f?.(N.target.files),
|
|
26
26
|
onClick: m,
|
|
27
27
|
onKeyDown: u
|
|
28
28
|
}),
|
|
@@ -36,6 +36,7 @@ var v = N(({ accept: r, disabled: p, error: i, highlighted: t, id: a, label: s,
|
|
|
36
36
|
})
|
|
37
37
|
]
|
|
38
38
|
}));
|
|
39
|
+
x.displayName = "InputFile";
|
|
39
40
|
export {
|
|
40
|
-
|
|
41
|
+
x as InputFile
|
|
41
42
|
};
|
|
@@ -2,7 +2,7 @@ import './InputNumber.css';
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { forwardRef as V } from "react";
|
|
4
4
|
import { jsx as i, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
5
|
+
var j = V(({ autoComplete: d = "on", autoFocus: c, disabled: b, error: a, hideNativeControls: h, highlighted: f, id: p, label: s, onChange: m, onClick: N, onKeyDown: v, required: g, success: l, value: n, min: u, max: t, placeholder: y, step: $ }, w) => {
|
|
6
6
|
const B = (e) => {
|
|
7
7
|
if (e === void 0) return;
|
|
8
8
|
let r = e;
|
|
@@ -20,8 +20,8 @@ var E = V(({ autoComplete: c = "on", autoFocus: d, disabled: b, error: a, hideNa
|
|
|
20
20
|
})]
|
|
21
21
|
}),
|
|
22
22
|
/* @__PURE__ */ i("input", {
|
|
23
|
-
autoComplete:
|
|
24
|
-
autoFocus:
|
|
23
|
+
autoComplete: d,
|
|
24
|
+
autoFocus: c,
|
|
25
25
|
disabled: b,
|
|
26
26
|
className: `input-number${a ? " input-number-error" : ""}${l ? " input-number-success" : ""}${h ? " input-number-hide-native-controls" : ""}`,
|
|
27
27
|
id: p,
|
|
@@ -34,9 +34,9 @@ var E = V(({ autoComplete: c = "on", autoFocus: d, disabled: b, error: a, hideNa
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
onChange: (e) => m?.(e.target.value ? Number(e.target.value) : void 0),
|
|
37
|
-
onClick:
|
|
37
|
+
onClick: N,
|
|
38
38
|
onKeyDown: (e) => {
|
|
39
|
-
(e.key === "e" || e.key === "E") && e.preventDefault(),
|
|
39
|
+
(e.key === "e" || e.key === "E") && e.preventDefault(), v?.(e);
|
|
40
40
|
},
|
|
41
41
|
placeholder: y,
|
|
42
42
|
ref: w,
|
|
@@ -55,6 +55,7 @@ var E = V(({ autoComplete: c = "on", autoFocus: d, disabled: b, error: a, hideNa
|
|
|
55
55
|
]
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
|
+
j.displayName = "InputNumber";
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
+
j as InputNumber
|
|
60
61
|
};
|
|
@@ -2,7 +2,7 @@ import './InputPassword.css';
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { forwardRef as j } from "react";
|
|
4
4
|
import { jsx as s, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
5
|
+
var y = j(({ autoComplete: t = "on", autoFocus: i, disabled: d, error: a, highlighted: l, id: r, label: e, maxLength: m, onBlur: u, onChange: w, onClick: c, onKeyDown: h, onKeyUp: N, placeholder: f, readOnly: g = !1, required: n = !1, success: p, value: v }, x) => /* @__PURE__ */ o("div", {
|
|
6
6
|
className: `input-password-wrapper${l ? " input-password-highlighted" : ""}`,
|
|
7
7
|
children: [
|
|
8
8
|
e && /* @__PURE__ */ o("label", {
|
|
@@ -21,15 +21,15 @@ var F = j(({ autoComplete: t = "on", autoFocus: i, disabled: d, error: a, highli
|
|
|
21
21
|
className: `input-password${a ? " input-password-error" : ""}${p ? " input-password-success" : ""}`,
|
|
22
22
|
id: r,
|
|
23
23
|
maxLength: m,
|
|
24
|
-
placeholder:
|
|
24
|
+
placeholder: f,
|
|
25
25
|
ref: x,
|
|
26
26
|
value: v,
|
|
27
27
|
onBlur: u,
|
|
28
28
|
onChange: ($) => w?.($.target.value),
|
|
29
29
|
onClick: c,
|
|
30
30
|
onKeyDown: h,
|
|
31
|
-
onKeyUp:
|
|
32
|
-
readOnly:
|
|
31
|
+
onKeyUp: N,
|
|
32
|
+
readOnly: g,
|
|
33
33
|
required: n
|
|
34
34
|
}),
|
|
35
35
|
a && /* @__PURE__ */ s("span", {
|
|
@@ -42,6 +42,7 @@ var F = j(({ autoComplete: t = "on", autoFocus: i, disabled: d, error: a, highli
|
|
|
42
42
|
})
|
|
43
43
|
]
|
|
44
44
|
}));
|
|
45
|
+
y.displayName = "InputPassword";
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
y as InputPassword
|
|
47
48
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import './InputSearch.css';
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import { InputText as
|
|
2
|
+
import { Icon as c } from "../Icon/Icon2.js";
|
|
3
|
+
import { Tooltip as C } from "../Tooltip/Tooltip2.js";
|
|
4
|
+
import { InputText as S } from "../InputText/InputText2.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import { forwardRef as
|
|
7
|
-
import { jsx as r, jsxs as
|
|
8
|
-
var
|
|
9
|
-
const
|
|
6
|
+
import { forwardRef as j } from "react";
|
|
7
|
+
import { jsx as r, jsxs as w } from "react/jsx-runtime";
|
|
8
|
+
var T = j(({ autoComplete: s = "off", autoFocus: i, disabled: t, id: n, label: m, onBlur: l, onChange: o, onClick: p, onKeyDown: h, onKeyUp: f, placeholder: u = "Search...", readOnly: a = !1, required: d = !1, value: e, className: x = "" }, I) => {
|
|
9
|
+
const N = () => {
|
|
10
10
|
o?.("");
|
|
11
|
-
},
|
|
12
|
-
return /* @__PURE__ */
|
|
11
|
+
}, _ = e && e.length > 0 && !t && !a;
|
|
12
|
+
return /* @__PURE__ */ w("div", {
|
|
13
13
|
className: `input-search ${x}`,
|
|
14
14
|
children: [
|
|
15
15
|
/* @__PURE__ */ r("div", {
|
|
16
16
|
className: "input-search__icon",
|
|
17
|
-
children: /* @__PURE__ */ r(
|
|
17
|
+
children: /* @__PURE__ */ r(c, { name: "search" })
|
|
18
18
|
}),
|
|
19
|
-
/* @__PURE__ */ r(
|
|
19
|
+
/* @__PURE__ */ r(S, {
|
|
20
20
|
autoComplete: s,
|
|
21
21
|
autoFocus: i,
|
|
22
22
|
disabled: t,
|
|
@@ -28,18 +28,18 @@ var R = w(({ autoComplete: s = "off", autoFocus: i, disabled: t, id: n, label: m
|
|
|
28
28
|
onKeyDown: h,
|
|
29
29
|
onKeyUp: f,
|
|
30
30
|
placeholder: u,
|
|
31
|
-
readOnly:
|
|
31
|
+
readOnly: a,
|
|
32
32
|
required: d,
|
|
33
33
|
value: e,
|
|
34
|
-
ref:
|
|
34
|
+
ref: I
|
|
35
35
|
}),
|
|
36
|
-
|
|
36
|
+
_ && /* @__PURE__ */ r(C, {
|
|
37
37
|
title: "Clear search",
|
|
38
38
|
children: /* @__PURE__ */ r("button", {
|
|
39
39
|
type: "button",
|
|
40
40
|
className: "input-search__clear",
|
|
41
|
-
onClick:
|
|
42
|
-
children: /* @__PURE__ */ r(
|
|
41
|
+
onClick: N,
|
|
42
|
+
children: /* @__PURE__ */ r(c, {
|
|
43
43
|
name: "clear",
|
|
44
44
|
size: "sm"
|
|
45
45
|
})
|
|
@@ -48,6 +48,7 @@ var R = w(({ autoComplete: s = "off", autoFocus: i, disabled: t, id: n, label: m
|
|
|
48
48
|
]
|
|
49
49
|
});
|
|
50
50
|
});
|
|
51
|
+
T.displayName = "InputSearch";
|
|
51
52
|
export {
|
|
52
|
-
|
|
53
|
+
T as InputSearch
|
|
53
54
|
};
|
|
@@ -2,7 +2,7 @@ import './InputText.css';
|
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { forwardRef as w } from "react";
|
|
4
4
|
import { jsx as t, jsxs as i } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
5
|
+
var y = w(({ autoComplete: r = "on", autoFocus: l, disabled: m, error: e, highlighted: x, id: s, label: n, maxLength: u, onBlur: c, onChange: h, onClick: o, onKeyDown: d, onKeyUp: N, placeholder: f, readOnly: g = !1, required: p = !1, success: a, value: v }, $) => /* @__PURE__ */ i("div", {
|
|
6
6
|
className: `input-text-wrapper${x ? " input-text-highlighted" : ""}`,
|
|
7
7
|
children: [
|
|
8
8
|
n && /* @__PURE__ */ i("label", {
|
|
@@ -21,15 +21,15 @@ var F = w(({ autoComplete: r = "on", autoFocus: l, disabled: m, error: e, highli
|
|
|
21
21
|
className: `input-text ${e ? "input-text-error" : ""} ${a ? "input-text-success" : ""}`,
|
|
22
22
|
id: s,
|
|
23
23
|
maxLength: u,
|
|
24
|
-
placeholder:
|
|
24
|
+
placeholder: f,
|
|
25
25
|
ref: $,
|
|
26
26
|
value: v,
|
|
27
27
|
onBlur: c,
|
|
28
28
|
onChange: (j) => h?.(j.target.value),
|
|
29
29
|
onClick: o,
|
|
30
30
|
onKeyDown: d,
|
|
31
|
-
onKeyUp:
|
|
32
|
-
readOnly:
|
|
31
|
+
onKeyUp: N,
|
|
32
|
+
readOnly: g,
|
|
33
33
|
required: p
|
|
34
34
|
}),
|
|
35
35
|
e && /* @__PURE__ */ t("span", {
|
|
@@ -42,6 +42,7 @@ var F = w(({ autoComplete: r = "on", autoFocus: l, disabled: m, error: e, highli
|
|
|
42
42
|
})
|
|
43
43
|
]
|
|
44
44
|
}));
|
|
45
|
+
y.displayName = "InputText";
|
|
45
46
|
export {
|
|
46
|
-
|
|
47
|
+
y as InputText
|
|
47
48
|
};
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import './InputTextarea.css';
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
3
|
+
import { forwardRef as I } from "react";
|
|
4
|
+
import { jsx as a, jsxs as n } from "react/jsx-runtime";
|
|
5
|
+
var T = I(({ autoComplete: p = "on", autoFocus: i, cols: l, disabled: m, error: e, id: r, label: s, maxLength: x, onBlur: u, onChange: c, onClick: o, onKeyDown: d, onKeyUp: h, placeholder: N, required: f, rows: g, success: t, value: v }, j) => /* @__PURE__ */ n("div", {
|
|
6
6
|
className: "input-textarea-wrapper",
|
|
7
7
|
children: [
|
|
8
8
|
s && /* @__PURE__ */ n("label", {
|
|
9
9
|
htmlFor: r,
|
|
10
10
|
className: "input-textarea-label",
|
|
11
|
-
children: [s, f && /* @__PURE__ */
|
|
11
|
+
children: [s, f && /* @__PURE__ */ a("span", {
|
|
12
12
|
className: "input-textarea-required",
|
|
13
13
|
children: "*"
|
|
14
14
|
})]
|
|
15
15
|
}),
|
|
16
|
-
/* @__PURE__ */
|
|
16
|
+
/* @__PURE__ */ a("textarea", {
|
|
17
17
|
autoComplete: p,
|
|
18
18
|
autoFocus: i,
|
|
19
|
-
className: `input-textarea${
|
|
19
|
+
className: `input-textarea${e ? " input-textarea-error" : ""}${t ? " input-textarea-success" : ""}`,
|
|
20
20
|
cols: l,
|
|
21
21
|
disabled: m,
|
|
22
22
|
id: r,
|
|
@@ -31,16 +31,17 @@ var F = $(({ autoComplete: p = "on", autoFocus: i, cols: l, disabled: m, error:
|
|
|
31
31
|
rows: g,
|
|
32
32
|
value: v
|
|
33
33
|
}),
|
|
34
|
-
|
|
34
|
+
e && /* @__PURE__ */ a("span", {
|
|
35
35
|
className: "input-textarea-error-message",
|
|
36
|
-
children:
|
|
36
|
+
children: e
|
|
37
37
|
}),
|
|
38
|
-
t && /* @__PURE__ */
|
|
38
|
+
t && /* @__PURE__ */ a("span", {
|
|
39
39
|
className: "input-textarea-success-message",
|
|
40
40
|
children: t
|
|
41
41
|
})
|
|
42
42
|
]
|
|
43
43
|
}));
|
|
44
|
+
T.displayName = "InputTextarea";
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
T as InputTextarea
|
|
46
47
|
};
|
|
@@ -1,85 +1,86 @@
|
|
|
1
1
|
import './InputTime.css';
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Popover as
|
|
2
|
+
import { Icon as R } from "../Icon/Icon2.js";
|
|
3
|
+
import { Popover as S } from "../Popover/Popover2.js";
|
|
4
4
|
import { TimePicker as j } from "../TimePicker/TimePicker2.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { forwardRef as w, useRef as y, useState as E } from "react";
|
|
7
|
-
import { jsx as e, jsxs as
|
|
8
|
-
var
|
|
7
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
8
|
+
var b = (i) => i.toString().padStart(2, "0"), O = (i) => {
|
|
9
9
|
const [n, t] = (i ?? "").split(":").map(Number);
|
|
10
10
|
return {
|
|
11
11
|
hours: Number.isFinite(n) ? n : 0,
|
|
12
12
|
minutes: Number.isFinite(t) ? t : 0,
|
|
13
13
|
seconds: 0
|
|
14
14
|
};
|
|
15
|
-
},
|
|
16
|
-
const [
|
|
17
|
-
p?.(`${
|
|
15
|
+
}, q = w(({ autoFocus: i, disabled: n, error: t, highlighted: v, id: o, label: c, max: k, min: g, minuteStep: C = 1, onBlur: $, onChange: p, onClick: I, onKeyDown: T, onKeyUp: x, readOnly: u = !1, required: d = !1, success: a, value: f, withClock: l = !1 }, F) => {
|
|
16
|
+
const [m, h] = E(!1), N = y(null), P = (s) => {
|
|
17
|
+
p?.(`${b(s.hours)}:${b(s.minutes)}`);
|
|
18
18
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
className: `input-time-wrapper${
|
|
19
|
+
return /* @__PURE__ */ r("div", {
|
|
20
|
+
className: `input-time-wrapper${v ? " input-time-highlighted" : ""}`,
|
|
21
21
|
children: [
|
|
22
|
-
c && /* @__PURE__ */
|
|
22
|
+
c && /* @__PURE__ */ r("label", {
|
|
23
23
|
htmlFor: o,
|
|
24
24
|
className: "input-time-label",
|
|
25
|
-
children: [c,
|
|
25
|
+
children: [c, d && /* @__PURE__ */ e("span", {
|
|
26
26
|
className: "input-time-required",
|
|
27
27
|
children: "*"
|
|
28
28
|
})]
|
|
29
29
|
}),
|
|
30
|
-
/* @__PURE__ */
|
|
31
|
-
ref:
|
|
32
|
-
className: `input-time-field${
|
|
30
|
+
/* @__PURE__ */ r("div", {
|
|
31
|
+
ref: N,
|
|
32
|
+
className: `input-time-field${l ? " input-time-field--with-clock" : ""}`,
|
|
33
33
|
children: [/* @__PURE__ */ e("input", {
|
|
34
34
|
autoFocus: i,
|
|
35
35
|
disabled: n,
|
|
36
36
|
type: "time",
|
|
37
|
-
className: `input-time${t ? " input-time-error" : ""}${
|
|
37
|
+
className: `input-time${t ? " input-time-error" : ""}${a ? " input-time-success" : ""}`,
|
|
38
38
|
id: o,
|
|
39
39
|
max: k,
|
|
40
40
|
min: g,
|
|
41
|
-
ref:
|
|
42
|
-
value:
|
|
41
|
+
ref: F,
|
|
42
|
+
value: f ?? "",
|
|
43
43
|
onBlur: $,
|
|
44
44
|
onChange: (s) => p?.(s.target.value || void 0),
|
|
45
|
-
onClick:
|
|
46
|
-
onKeyDown:
|
|
47
|
-
onKeyUp:
|
|
45
|
+
onClick: I,
|
|
46
|
+
onKeyDown: T,
|
|
47
|
+
onKeyUp: x,
|
|
48
48
|
readOnly: u,
|
|
49
|
-
required:
|
|
50
|
-
}),
|
|
51
|
-
className: `input-time-clock-button${
|
|
49
|
+
required: d
|
|
50
|
+
}), l && /* @__PURE__ */ e("button", {
|
|
51
|
+
className: `input-time-clock-button${m ? " input-time-clock-button--active" : ""}`,
|
|
52
52
|
disabled: n || u,
|
|
53
|
-
onClick: () =>
|
|
53
|
+
onClick: () => h(!m),
|
|
54
54
|
title: "Pick on a clock",
|
|
55
55
|
type: "button",
|
|
56
|
-
children: /* @__PURE__ */ e(
|
|
56
|
+
children: /* @__PURE__ */ e(R, { name: "time" })
|
|
57
57
|
})]
|
|
58
58
|
}),
|
|
59
59
|
t && /* @__PURE__ */ e("span", {
|
|
60
60
|
className: "input-time-error-message",
|
|
61
61
|
children: t
|
|
62
62
|
}),
|
|
63
|
-
|
|
63
|
+
a && /* @__PURE__ */ e("span", {
|
|
64
64
|
className: "input-time-success-message",
|
|
65
|
-
children:
|
|
65
|
+
children: a
|
|
66
66
|
}),
|
|
67
|
-
|
|
68
|
-
visible:
|
|
69
|
-
onClose: () =>
|
|
70
|
-
anchorEl:
|
|
67
|
+
l && /* @__PURE__ */ e(S, {
|
|
68
|
+
visible: m,
|
|
69
|
+
onClose: () => h(!1),
|
|
70
|
+
anchorEl: N.current,
|
|
71
71
|
children: /* @__PURE__ */ e(j, {
|
|
72
72
|
collapsibleClock: !1,
|
|
73
73
|
label: "",
|
|
74
74
|
minuteStep: C,
|
|
75
|
-
onChange:
|
|
76
|
-
value: O(
|
|
75
|
+
onChange: P,
|
|
76
|
+
value: O(f),
|
|
77
77
|
withClock: !0
|
|
78
78
|
})
|
|
79
79
|
})
|
|
80
80
|
]
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
|
+
q.displayName = "InputTime";
|
|
83
84
|
export {
|
|
84
|
-
|
|
85
|
+
q as InputTime
|
|
85
86
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import './InputUrl.css';
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { forwardRef as
|
|
3
|
+
import { forwardRef as j, useState as A } from "react";
|
|
4
4
|
import { jsx as t, jsxs as m } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
5
|
+
var B = "Please enter a valid URL (e.g. https://example.com)", F = (l) => {
|
|
6
6
|
try {
|
|
7
7
|
const e = new URL(l);
|
|
8
8
|
return e.protocol === "http:" || e.protocol === "https:";
|
|
9
9
|
} catch {
|
|
10
10
|
return !1;
|
|
11
11
|
}
|
|
12
|
-
},
|
|
13
|
-
const [c, d] =
|
|
12
|
+
}, b = j(({ autoFocus: l, disabled: e, error: f, highlighted: v, id: u, label: i, maxLength: g, onBlur: E, onChange: N, onClick: R, onKeyDown: U, onKeyUp: x, onValidationChange: p, placeholder: y = "https://...", readOnly: L = !1, required: o = !1, success: a, validationErrorMessage: w, value: I }, S) => {
|
|
13
|
+
const [c, d] = A(void 0), h = (r) => {
|
|
14
14
|
if (!r)
|
|
15
|
-
return d(void 0),
|
|
16
|
-
const n =
|
|
17
|
-
return d(n ? void 0 :
|
|
15
|
+
return d(void 0), p?.(!0), !0;
|
|
16
|
+
const n = F(r);
|
|
17
|
+
return d(n ? void 0 : w ?? B), p?.(n), n;
|
|
18
|
+
}, _ = (r) => {
|
|
19
|
+
N?.(r), c && h(r);
|
|
18
20
|
}, $ = (r) => {
|
|
19
|
-
R?.(r), c && h(r);
|
|
20
|
-
}, j = (r) => {
|
|
21
21
|
h(r.target.value), E?.(r);
|
|
22
22
|
}, s = f ?? c;
|
|
23
23
|
return /* @__PURE__ */ m("div", {
|
|
@@ -26,7 +26,7 @@ var F = "Please enter a valid URL (e.g. https://example.com)", I = (l) => {
|
|
|
26
26
|
i && /* @__PURE__ */ m("label", {
|
|
27
27
|
htmlFor: u,
|
|
28
28
|
className: "input-url-label",
|
|
29
|
-
children: [i,
|
|
29
|
+
children: [i, o && /* @__PURE__ */ t("span", {
|
|
30
30
|
className: "input-url-required",
|
|
31
31
|
children: "*"
|
|
32
32
|
})]
|
|
@@ -38,16 +38,16 @@ var F = "Please enter a valid URL (e.g. https://example.com)", I = (l) => {
|
|
|
38
38
|
className: `input-url${s ? " input-url-error" : ""}${a ? " input-url-success" : ""}`,
|
|
39
39
|
id: u,
|
|
40
40
|
maxLength: g,
|
|
41
|
-
placeholder:
|
|
42
|
-
ref:
|
|
43
|
-
value:
|
|
44
|
-
onBlur:
|
|
45
|
-
onChange: (r) =>
|
|
46
|
-
onClick:
|
|
41
|
+
placeholder: y,
|
|
42
|
+
ref: S,
|
|
43
|
+
value: I,
|
|
44
|
+
onBlur: $,
|
|
45
|
+
onChange: (r) => _(r.target.value),
|
|
46
|
+
onClick: R,
|
|
47
47
|
onKeyDown: U,
|
|
48
48
|
onKeyUp: x,
|
|
49
|
-
readOnly:
|
|
50
|
-
required:
|
|
49
|
+
readOnly: L,
|
|
50
|
+
required: o
|
|
51
51
|
}),
|
|
52
52
|
s && /* @__PURE__ */ t("span", {
|
|
53
53
|
className: "input-url-error-message",
|
|
@@ -60,6 +60,7 @@ var F = "Please enter a valid URL (e.g. https://example.com)", I = (l) => {
|
|
|
60
60
|
]
|
|
61
61
|
});
|
|
62
62
|
});
|
|
63
|
+
b.displayName = "InputUrl";
|
|
63
64
|
export {
|
|
64
|
-
|
|
65
|
+
b as InputUrl
|
|
65
66
|
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import './QuantitySelector.css';
|
|
2
|
-
import { Button as
|
|
2
|
+
import { Button as q } from "../Button/Button2.js";
|
|
3
3
|
import { InputNumber as I } from "../InputNumber/InputNumber2.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import { forwardRef as S } from "react";
|
|
6
6
|
import { jsx as s, jsxs as u } from "react/jsx-runtime";
|
|
7
|
-
var
|
|
7
|
+
var $ = S(({ disabled: n = !1, error: c, id: d, inputWidth: f, label: y, max: t, min: r = 0, onChange: i, readOnlyInput: p = !1, required: h = !1, step: a = 1, success: o, value: l }, v) => {
|
|
8
8
|
const N = f || (t !== void 0 ? Math.max(String(t).length, String(r).length, 3) : 3), m = () => {
|
|
9
9
|
if (n) return;
|
|
10
|
-
const e = (
|
|
10
|
+
const e = (l ?? 0) - a;
|
|
11
11
|
r !== void 0 && e < r || i?.(e);
|
|
12
12
|
}, b = () => {
|
|
13
13
|
if (n) return;
|
|
14
|
-
const e = (
|
|
14
|
+
const e = (l ?? 0) + a;
|
|
15
15
|
t !== void 0 && e > t || i?.(e);
|
|
16
16
|
}, g = (e) => {
|
|
17
|
-
if (!
|
|
17
|
+
if (!p) {
|
|
18
18
|
if (e === void 0) {
|
|
19
19
|
i?.(void 0);
|
|
20
20
|
return;
|
|
@@ -36,18 +36,18 @@ var D = S(({ disabled: n = !1, error: l, id: d, inputWidth: f, label: y, max: t,
|
|
|
36
36
|
y && /* @__PURE__ */ u("label", {
|
|
37
37
|
htmlFor: d,
|
|
38
38
|
className: "quantity-selector-label",
|
|
39
|
-
children: [y,
|
|
39
|
+
children: [y, h && /* @__PURE__ */ s("span", {
|
|
40
40
|
className: "quantity-selector-required",
|
|
41
41
|
children: "*"
|
|
42
42
|
})]
|
|
43
43
|
}),
|
|
44
44
|
/* @__PURE__ */ u("div", {
|
|
45
|
-
className: `quantity-selector${
|
|
45
|
+
className: `quantity-selector${p ? " quantity-selector-readonly" : ""}${c ? " quantity-selector-error" : ""}${o ? " quantity-selector-success" : ""}`,
|
|
46
46
|
style: { "--digits": N },
|
|
47
47
|
children: [
|
|
48
|
-
/* @__PURE__ */ s(
|
|
48
|
+
/* @__PURE__ */ s(q, {
|
|
49
49
|
className: "quantity-selector-button quantity-selector-button-decrease",
|
|
50
|
-
disabled: n || r !== void 0 && (
|
|
50
|
+
disabled: n || r !== void 0 && (l ?? 0) <= r,
|
|
51
51
|
onClick: m,
|
|
52
52
|
size: "small",
|
|
53
53
|
variant: "default",
|
|
@@ -63,13 +63,13 @@ var D = S(({ disabled: n = !1, error: l, id: d, inputWidth: f, label: y, max: t,
|
|
|
63
63
|
min: r,
|
|
64
64
|
onChange: g,
|
|
65
65
|
ref: v,
|
|
66
|
-
step:
|
|
67
|
-
value:
|
|
66
|
+
step: a,
|
|
67
|
+
value: l
|
|
68
68
|
})
|
|
69
69
|
}),
|
|
70
|
-
/* @__PURE__ */ s(
|
|
70
|
+
/* @__PURE__ */ s(q, {
|
|
71
71
|
className: "quantity-selector-button quantity-selector-button-increase",
|
|
72
|
-
disabled: n || t !== void 0 && (
|
|
72
|
+
disabled: n || t !== void 0 && (l ?? 0) >= t,
|
|
73
73
|
onClick: b,
|
|
74
74
|
size: "small",
|
|
75
75
|
variant: "default",
|
|
@@ -78,17 +78,18 @@ var D = S(({ disabled: n = !1, error: l, id: d, inputWidth: f, label: y, max: t,
|
|
|
78
78
|
})
|
|
79
79
|
]
|
|
80
80
|
}),
|
|
81
|
-
|
|
81
|
+
c && /* @__PURE__ */ s("span", {
|
|
82
82
|
className: "quantity-selector-error-message",
|
|
83
|
-
children:
|
|
83
|
+
children: c
|
|
84
84
|
}),
|
|
85
|
-
|
|
85
|
+
o && /* @__PURE__ */ s("span", {
|
|
86
86
|
className: "quantity-selector-success-message",
|
|
87
|
-
children:
|
|
87
|
+
children: o
|
|
88
88
|
})
|
|
89
89
|
]
|
|
90
90
|
});
|
|
91
91
|
});
|
|
92
|
+
$.displayName = "QuantitySelector";
|
|
92
93
|
export {
|
|
93
|
-
|
|
94
|
+
$ as QuantitySelector
|
|
94
95
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1481,8 +1481,8 @@ export declare interface ErrorBoundaryProps {
|
|
|
1481
1481
|
/** Label for the reset button. Defaults to "Try again". */
|
|
1482
1482
|
resetLabel?: string;
|
|
1483
1483
|
/**
|
|
1484
|
-
* Optional callback invoked when an error is caught.
|
|
1485
|
-
*
|
|
1484
|
+
* Optional callback invoked when an error is caught. Caught errors are already
|
|
1485
|
+
* reported to the hub once error reporting is installed, and always logged to the console.
|
|
1486
1486
|
*/
|
|
1487
1487
|
onError?: (error: Error, info: ErrorInfo) => void;
|
|
1488
1488
|
/**
|
|
@@ -3242,7 +3242,7 @@ export declare interface TimelineMarkerInfo {
|
|
|
3242
3242
|
dateLabel: string;
|
|
3243
3243
|
}
|
|
3244
3244
|
|
|
3245
|
-
export declare const TimelineMarkers: <T extends TimelineMarkersItem>({ items, renderItem, className
|
|
3245
|
+
export declare const TimelineMarkers: <T extends TimelineMarkersItem>({ items, renderItem, className }: TimelineMarkersProps<T>) => JSX.Element;
|
|
3246
3246
|
|
|
3247
3247
|
export declare interface TimelineMarkersItem {
|
|
3248
3248
|
id: string | number;
|
package/dist/memobit-icons.json
CHANGED
|
@@ -5,54 +5,14 @@
|
|
|
5
5
|
"arrow-left",
|
|
6
6
|
"arrow-right",
|
|
7
7
|
"arrow-up",
|
|
8
|
-
"bullet",
|
|
9
|
-
"burst",
|
|
10
|
-
"calendar",
|
|
11
8
|
"calendar-month",
|
|
12
9
|
"calendar-week",
|
|
13
10
|
"caret-down",
|
|
14
11
|
"caret-left",
|
|
15
12
|
"caret-right",
|
|
16
13
|
"caret-up",
|
|
17
|
-
"checkmark",
|
|
18
|
-
"clear",
|
|
19
|
-
"clipboard",
|
|
20
|
-
"comment",
|
|
21
|
-
"confetti",
|
|
22
14
|
"credit-card",
|
|
23
|
-
"empty",
|
|
24
|
-
"file",
|
|
25
|
-
"filters",
|
|
26
|
-
"fireworks",
|
|
27
|
-
"folder",
|
|
28
|
-
"food",
|
|
29
|
-
"gallery",
|
|
30
|
-
"grid",
|
|
31
|
-
"key",
|
|
32
|
-
"link",
|
|
33
|
-
"lock",
|
|
34
|
-
"logout",
|
|
35
|
-
"map",
|
|
36
15
|
"menu-hamburger",
|
|
37
|
-
"
|
|
38
|
-
"other",
|
|
39
|
-
"ownership",
|
|
40
|
-
"pin",
|
|
41
|
-
"plus",
|
|
42
|
-
"previous",
|
|
43
|
-
"radio",
|
|
44
|
-
"return",
|
|
45
|
-
"save",
|
|
46
|
-
"scss",
|
|
47
|
-
"search",
|
|
48
|
-
"sparkle",
|
|
49
|
-
"star",
|
|
50
|
-
"table",
|
|
51
|
-
"target",
|
|
52
|
-
"theme-picker",
|
|
53
|
-
"time",
|
|
54
|
-
"tree",
|
|
55
|
-
"tune",
|
|
56
|
-
"warning"
|
|
16
|
+
"theme-picker"
|
|
57
17
|
]
|
|
58
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
mark {
|
|
2
|
-
background-color: var(--button-warning-background-color);
|
|
3
|
-
color: var(--button-warning-color);
|
|
4
|
-
padding: var(--spacing-1) var(--spacing-4);
|
|
5
|
-
border-radius: var(--radius-sm);
|
|
6
|
-
}
|
|
1
|
+
mark {
|
|
2
|
+
background-color: var(--button-warning-background-color);
|
|
3
|
+
color: var(--button-warning-color);
|
|
4
|
+
padding: var(--spacing-1) var(--spacing-4);
|
|
5
|
+
border-radius: var(--radius-sm);
|
|
6
|
+
}
|
package/dist/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var I = "3.
|
|
1
|
+
var I = "3.11.0", B = 504, L = "7cca07f", _ = "2026-10-16T16:12:33.803Z", a = "504";
|
|
2
2
|
export {
|
|
3
3
|
_ as LIB_BUILD_DATE,
|
|
4
|
-
|
|
4
|
+
a as LIB_BUILD_ID,
|
|
5
5
|
B as LIB_BUILD_NUMBER,
|
|
6
6
|
L as LIB_COMMIT,
|
|
7
7
|
I as LIB_VERSION
|
package/dist/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memobit/libs",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0",
|
|
4
4
|
"description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -74,12 +74,13 @@
|
|
|
74
74
|
"prepublishOnly": "vite build",
|
|
75
75
|
"dev": "vite build --watch",
|
|
76
76
|
"playground": "vite serve playground --config playground/vite.config.ts",
|
|
77
|
-
"lint": "eslint
|
|
78
|
-
"lint:fix": "eslint
|
|
79
|
-
"format": "prettier --write \"
|
|
80
|
-
"format:check": "prettier --check \"
|
|
77
|
+
"lint": "eslint .",
|
|
78
|
+
"lint:fix": "eslint . --fix",
|
|
79
|
+
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,mjs,cjs,css,scss}\"",
|
|
80
|
+
"format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,mjs,cjs,css,scss}\""
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
+
"@memobit/core": "1.0.0",
|
|
83
84
|
"@memobit/icons": "^1.5.0",
|
|
84
85
|
"@memobit/themes": "^1.0.0",
|
|
85
86
|
"react": "19.3.0",
|
|
@@ -93,6 +94,7 @@
|
|
|
93
94
|
},
|
|
94
95
|
"devDependencies": {
|
|
95
96
|
"@eslint/js": "9.39.4",
|
|
97
|
+
"@memobit/core": "file:../memobit-core",
|
|
96
98
|
"@memobit/icons": "file:../memobit-react-icons",
|
|
97
99
|
"@memobit/themes": "file:../memobit-react-themes",
|
|
98
100
|
"@microsoft/api-extractor": "7.59.2",
|
|
@@ -102,9 +104,11 @@
|
|
|
102
104
|
"esbuild": "0.28.2",
|
|
103
105
|
"eslint": "9.39.4",
|
|
104
106
|
"eslint-config-prettier": "10.1.8",
|
|
105
|
-
"eslint-plugin-import
|
|
107
|
+
"eslint-plugin-import": "2.32.0",
|
|
106
108
|
"eslint-plugin-prettier": "5.5.6",
|
|
107
109
|
"eslint-plugin-react": "7.37.5",
|
|
110
|
+
"eslint-plugin-react-hooks": "7.1.1",
|
|
111
|
+
"eslint-plugin-react-refresh": "0.5.7",
|
|
108
112
|
"eslint-plugin-simple-import-sort": "14.0.0",
|
|
109
113
|
"globals": "17.12.0",
|
|
110
114
|
"prettier": "3.9.9",
|