@alxgrn/telefrag-ui 0.0.4 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Content.css +1 -0
- package/dist/assets/Footer.css +1 -0
- package/dist/assets/Header.css +1 -0
- package/dist/assets/Input.css +1 -1
- package/dist/assets/Menu.css +1 -1
- package/dist/assets/Modal.css +1 -1
- package/dist/assets/Overlay.css +1 -0
- package/dist/assets/Page.css +1 -0
- package/dist/assets/Popup.css +1 -1
- package/dist/assets/Sidebar.css +1 -0
- package/dist/components/form/button/Button.d.ts +1 -1
- package/dist/components/form/button/Button.js +5 -3
- package/dist/components/form/date/DatePicker.js +31 -30
- package/dist/components/form/fieldset/Fieldset.js +12 -11
- package/dist/components/form/files/Files.js +4 -3
- package/dist/components/form/form/Form.js +32 -26
- package/dist/components/form/input/Input.js +14 -13
- package/dist/components/form/label/Label.js +13 -12
- package/dist/components/form/radio/RadioLabel.js +15 -14
- package/dist/components/form/required/RequiredMark.js +5 -3
- package/dist/components/form/select/Select.js +9 -8
- package/dist/components/form/time/Time.js +9 -8
- package/dist/components/icons/Menu.d.ts +2 -0
- package/dist/components/icons/Menu.js +23 -0
- package/dist/components/icons/Plus.d.ts +2 -0
- package/dist/components/icons/Plus.js +22 -0
- package/dist/components/icons/TelefragLogo.d.ts +6 -0
- package/dist/components/icons/TelefragLogo.js +49 -0
- package/dist/components/icons/index.d.ts +4 -1
- package/dist/components/icons/index.js +9 -3
- package/dist/components/layout/Content.d.ts +6 -0
- package/dist/components/layout/Content.js +9 -0
- package/dist/components/layout/Footer.d.ts +2 -0
- package/dist/components/layout/Footer.js +9 -0
- package/dist/components/layout/Header.d.ts +7 -0
- package/dist/components/layout/Header.js +12 -0
- package/dist/components/layout/Layout.d.ts +7 -0
- package/dist/components/layout/Layout.js +55 -0
- package/dist/components/layout/Page.d.ts +9 -0
- package/dist/components/layout/Page.js +51 -0
- package/dist/components/ui/alert/Alert.js +1 -1
- package/dist/components/ui/block/Block.js +4 -3
- package/dist/components/ui/confirm/Confirm.js +1 -1
- package/dist/components/ui/menu/Menu.js +9 -8
- package/dist/components/ui/modal/Modal.d.ts +1 -1
- package/dist/components/ui/modal/Modal.js +25 -35
- package/dist/components/ui/overlay/Overlay.d.ts +9 -0
- package/dist/components/ui/overlay/Overlay.js +26 -0
- package/dist/components/ui/popup/Popup.js +24 -22
- package/dist/components/ui/prompt/Prompt.js +1 -1
- package/dist/components/ui/sidebar/Sidebar.d.ts +8 -0
- package/dist/components/ui/sidebar/Sidebar.js +24 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +4 -0
- package/dist/main.d.ts +9 -5
- package/dist/main.js +62 -53
- package/package.json +1 -1
- package/dist/assets/Form.css +0 -1
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as v, useState as y, useEffect as m } from "react";
|
|
3
|
-
import { CSSTransition as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
3
|
+
import { CSSTransition as L } from "react-transition-group";
|
|
4
|
+
import S from "../portal/Portal.js";
|
|
5
|
+
import { ANIMATION_LENGTH as T } from "../../../config.js";
|
|
6
|
+
import '../../../assets/Popup.css';/* empty css */
|
|
7
|
+
const N = T, M = ({
|
|
6
8
|
parent: s,
|
|
7
9
|
isOpen: d,
|
|
8
|
-
onClose:
|
|
10
|
+
onClose: c,
|
|
9
11
|
vertical: p = "auto",
|
|
10
12
|
horizontal: f = "auto",
|
|
11
13
|
margin: o = "0",
|
|
12
14
|
maxHeight: h = "none",
|
|
13
15
|
width: b = "auto",
|
|
14
16
|
position: l = "absolute",
|
|
15
|
-
children:
|
|
17
|
+
children: E
|
|
16
18
|
}) => {
|
|
17
|
-
const u = v(null), [
|
|
19
|
+
const u = v(null), [w, g] = y({}), [x, k] = y({});
|
|
18
20
|
return m(() => {
|
|
19
21
|
if (!d) return;
|
|
20
22
|
if (!s.current) {
|
|
@@ -32,25 +34,25 @@ import '../../../assets/Popup.css';const P = 100, I = ({
|
|
|
32
34
|
const t = {
|
|
33
35
|
width: b === "parent" ? e.width : "auto"
|
|
34
36
|
};
|
|
35
|
-
let
|
|
37
|
+
let i = 0;
|
|
36
38
|
switch (p) {
|
|
37
39
|
case "top":
|
|
38
|
-
t.bottom = "100%", t.marginBottom = o,
|
|
40
|
+
t.bottom = "100%", t.marginBottom = o, i = e.top;
|
|
39
41
|
break;
|
|
40
42
|
case "bottom":
|
|
41
|
-
t.top = "100%", t.marginTop = o,
|
|
43
|
+
t.top = "100%", t.marginTop = o, i = n - e.bottom;
|
|
42
44
|
break;
|
|
43
45
|
case "inner-top":
|
|
44
|
-
t.top = 0,
|
|
46
|
+
t.top = 0, i = n - e.top;
|
|
45
47
|
break;
|
|
46
48
|
case "inner-bottom":
|
|
47
|
-
t.bottom = 0,
|
|
49
|
+
t.bottom = 0, i = e.bottom;
|
|
48
50
|
break;
|
|
49
51
|
default:
|
|
50
|
-
e.top < n - e.bottom ? (t.top = "100%", t.marginTop = o,
|
|
52
|
+
e.top < n - e.bottom ? (t.top = "100%", t.marginTop = o, i = n - e.bottom) : (t.bottom = "100%", t.marginBottom = o, i = e.top);
|
|
51
53
|
break;
|
|
52
54
|
}
|
|
53
|
-
switch (h === "auto" && (t.maxHeight = `calc(${
|
|
55
|
+
switch (h === "auto" && (t.maxHeight = `calc(${i}px - 2 * ${o})`), f) {
|
|
54
56
|
case "left":
|
|
55
57
|
t.right = "100%", t.marginRight = o;
|
|
56
58
|
break;
|
|
@@ -70,31 +72,31 @@ import '../../../assets/Popup.css';const P = 100, I = ({
|
|
|
70
72
|
g(t);
|
|
71
73
|
}, [s, d, o, p, f, h, b, l]), m(() => {
|
|
72
74
|
const r = (n) => {
|
|
73
|
-
u.current && !u.current.contains(n.target) &&
|
|
75
|
+
u.current && !u.current.contains(n.target) && c();
|
|
74
76
|
};
|
|
75
77
|
return document.addEventListener("click", r, !0), () => {
|
|
76
78
|
document.removeEventListener("click", r, !0);
|
|
77
79
|
};
|
|
78
|
-
}, [
|
|
80
|
+
}, [c]), m(() => {
|
|
79
81
|
const r = (n) => {
|
|
80
|
-
n.key === "Escape" &&
|
|
82
|
+
n.key === "Escape" && c();
|
|
81
83
|
};
|
|
82
84
|
return document.body.addEventListener("keydown", r), () => {
|
|
83
85
|
document.body.removeEventListener("keydown", r);
|
|
84
86
|
};
|
|
85
|
-
}, [
|
|
86
|
-
|
|
87
|
+
}, [c]), /* @__PURE__ */ a(S, { id: "alxgrn-popup", children: /* @__PURE__ */ a(
|
|
88
|
+
L,
|
|
87
89
|
{
|
|
88
90
|
in: d,
|
|
89
|
-
timeout:
|
|
91
|
+
timeout: N,
|
|
90
92
|
unmountOnExit: !0,
|
|
91
93
|
classNames: "Popup",
|
|
92
94
|
nodeRef: u,
|
|
93
|
-
children: /* @__PURE__ */ a("div", { className: "Popup", style: x, children: /* @__PURE__ */ a("div", { className: "PopupInner", ref: u, style:
|
|
95
|
+
children: /* @__PURE__ */ a("div", { className: "Popup", style: x, children: /* @__PURE__ */ a("div", { className: "PopupInner", ref: u, style: w, children: E }) })
|
|
94
96
|
}
|
|
95
97
|
) });
|
|
96
98
|
};
|
|
97
99
|
export {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
+
M as Popup,
|
|
101
|
+
M as default
|
|
100
102
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as d, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useState as p, useEffect as h } from "react";
|
|
3
|
-
import x from "../modal/Modal.js";
|
|
3
|
+
import { Modal as x } from "../modal/Modal.js";
|
|
4
4
|
import { Form as b } from "../../form/form/Form.js";
|
|
5
5
|
import j from "../../form/input/Input.js";
|
|
6
6
|
const g = ({
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as i } from "react";
|
|
3
|
+
import { Overlay as n } from "../overlay/Overlay.js";
|
|
4
|
+
import '../../../assets/Sidebar.css';/* empty css */
|
|
5
|
+
const y = ({ children: d, position: a = "Left", isOpen: e, onClose: t }) => (i(() => {
|
|
6
|
+
const r = (c) => {
|
|
7
|
+
c.key === "Escape" && t();
|
|
8
|
+
};
|
|
9
|
+
return e && document.body.addEventListener("keydown", r), () => {
|
|
10
|
+
e && document.body.removeEventListener("keydown", r);
|
|
11
|
+
};
|
|
12
|
+
}, [e, t]), /* @__PURE__ */ o(
|
|
13
|
+
n,
|
|
14
|
+
{
|
|
15
|
+
isOpen: e,
|
|
16
|
+
onClick: t,
|
|
17
|
+
hAlign: a,
|
|
18
|
+
children: /* @__PURE__ */ o("div", { className: `Sidebar ${a}`, onClick: (r) => r.stopPropagation(), children: /* @__PURE__ */ o("div", { className: "SidebarInner Scrollbar", children: d }) })
|
|
19
|
+
}
|
|
20
|
+
));
|
|
21
|
+
export {
|
|
22
|
+
y as Sidebar,
|
|
23
|
+
y as default
|
|
24
|
+
};
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ANIMATION_LENGTH = 150;
|
package/dist/config.js
ADDED
package/dist/main.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ import { default as Time } from './components/form/time/Time';
|
|
|
7
7
|
import { default as Files } from './components/form/files/Files';
|
|
8
8
|
import { default as Input } from './components/form/input/Input';
|
|
9
9
|
import { default as Label } from './components/form/label/Label';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { RadioList, RadioListOption, RadioListValue } from './components/form/radio/RadioList';
|
|
11
|
+
import { Button, ButtonType } from './components/form/button/Button';
|
|
12
12
|
import { default as Select } from './components/form/select/Select';
|
|
13
13
|
import { default as Hidden } from './components/form/hidden/Hidden';
|
|
14
14
|
import { default as Checkbox } from './components/form/checkbox/Checkbox';
|
|
@@ -17,13 +17,17 @@ import { default as Fieldset } from './components/form/fieldset/Fieldset';
|
|
|
17
17
|
import { Menu, MenuItem } from './components/ui/menu/Menu';
|
|
18
18
|
import { default as Block } from './components/ui/block/Block';
|
|
19
19
|
import { default as Panel } from './components/ui/panel/Panel';
|
|
20
|
-
import {
|
|
20
|
+
import { Modal, ModalProps } from './components/ui/modal/Modal';
|
|
21
|
+
import { default as Overlay } from './components/ui/overlay/Overlay';
|
|
21
22
|
import { default as Popup } from './components/ui/popup/Popup';
|
|
22
23
|
import { default as Portal } from './components/ui/portal/Portal';
|
|
23
24
|
import { default as Message } from './components/ui/message/Message';
|
|
24
25
|
import { default as Alert } from './components/ui/alert/Alert';
|
|
25
26
|
import { default as Confirm } from './components/ui/confirm/Confirm';
|
|
26
27
|
import { default as Prompt } from './components/ui/prompt/Prompt';
|
|
28
|
+
import { default as Sidebar } from './components/ui/sidebar/Sidebar';
|
|
27
29
|
import { default as Editable } from './components/ui/editable/Editable';
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
import { default as Layout } from './components/layout/Layout';
|
|
31
|
+
import { default as Page } from './components/layout/Page';
|
|
32
|
+
export { Form, Date, Time, Files, Input, Label, RadioList, Button, Select, Hidden, Checkbox, CheckboxList, Fieldset, FormRow, FormCol, DatePicker, Menu, Block, Panel, Modal, Overlay, Popup, Portal, Message, Alert, Confirm, Prompt, Sidebar, Editable, Layout, Page, };
|
|
33
|
+
export type { FormData, MenuItem, ModalProps, ButtonType, RadioListOption, RadioListValue, };
|
package/dist/main.js
CHANGED
|
@@ -1,56 +1,65 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as p } from "./components/form/
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { default as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { default as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
1
|
+
import './assets/Page.css';/* empty css */
|
|
2
|
+
import { Form as t } from "./components/form/form/Form.js";
|
|
3
|
+
import { default as f } from "./components/form/form/FormRow.js";
|
|
4
|
+
import { default as p } from "./components/form/form/FormCol.js";
|
|
5
|
+
import { default as l } from "./components/form/date/Date.js";
|
|
6
|
+
import { default as s } from "./components/form/date/DatePicker.js";
|
|
7
|
+
import { default as i } from "./components/form/time/Time.js";
|
|
8
|
+
import { Files as P } from "./components/form/files/Files.js";
|
|
9
|
+
import { default as c } from "./components/form/input/Input.js";
|
|
10
|
+
import { default as k } from "./components/form/label/Label.js";
|
|
11
|
+
import { RadioList as L } from "./components/form/radio/RadioList.js";
|
|
12
|
+
import { Button as g } from "./components/form/button/Button.js";
|
|
13
|
+
import { Select as y } from "./components/form/select/Select.js";
|
|
14
|
+
import { default as D } from "./components/form/hidden/Hidden.js";
|
|
15
|
+
import { default as S } from "./components/form/checkbox/Checkbox.js";
|
|
16
|
+
import { CheckboxList as w } from "./components/form/checkbox/CheckboxList.js";
|
|
17
|
+
import { default as E } from "./components/form/fieldset/Fieldset.js";
|
|
18
|
+
import { Menu as I } from "./components/ui/menu/Menu.js";
|
|
19
|
+
import { default as T } from "./components/ui/block/Block.js";
|
|
20
|
+
import { default as q } from "./components/ui/panel/Panel.js";
|
|
21
|
+
import { Modal as G } from "./components/ui/modal/Modal.js";
|
|
22
|
+
import { Overlay as K } from "./components/ui/overlay/Overlay.js";
|
|
23
|
+
import { Popup as Q } from "./components/ui/popup/Popup.js";
|
|
24
|
+
import { default as V } from "./components/ui/portal/Portal.js";
|
|
25
|
+
import { default as X } from "./components/ui/message/Message.js";
|
|
26
|
+
import { default as Z } from "./components/ui/alert/Alert.js";
|
|
27
|
+
import { default as $ } from "./components/ui/confirm/Confirm.js";
|
|
28
|
+
import { default as eo } from "./components/ui/prompt/Prompt.js";
|
|
29
|
+
import { Sidebar as to } from "./components/ui/sidebar/Sidebar.js";
|
|
30
|
+
import { default as fo } from "./components/ui/editable/Editable.js";
|
|
31
|
+
import { default as po } from "./components/layout/Layout.js";
|
|
32
|
+
import { default as lo } from "./components/layout/Page.js";
|
|
28
33
|
export {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
Z as Alert,
|
|
35
|
+
T as Block,
|
|
36
|
+
g as Button,
|
|
37
|
+
S as Checkbox,
|
|
38
|
+
w as CheckboxList,
|
|
39
|
+
$ as Confirm,
|
|
40
|
+
l as Date,
|
|
41
|
+
s as DatePicker,
|
|
42
|
+
fo as Editable,
|
|
43
|
+
E as Fieldset,
|
|
44
|
+
P as Files,
|
|
45
|
+
t as Form,
|
|
46
|
+
p as FormCol,
|
|
47
|
+
f as FormRow,
|
|
48
|
+
D as Hidden,
|
|
49
|
+
c as Input,
|
|
50
|
+
k as Label,
|
|
51
|
+
po as Layout,
|
|
52
|
+
I as Menu,
|
|
53
|
+
X as Message,
|
|
48
54
|
G as Modal,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
K as Overlay,
|
|
56
|
+
lo as Page,
|
|
57
|
+
q as Panel,
|
|
58
|
+
Q as Popup,
|
|
59
|
+
V as Portal,
|
|
60
|
+
eo as Prompt,
|
|
61
|
+
L as RadioList,
|
|
62
|
+
y as Select,
|
|
63
|
+
to as Sidebar,
|
|
64
|
+
i as Time
|
|
56
65
|
};
|
package/package.json
CHANGED
package/dist/assets/Form.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
*{box-sizing:border-box;overflow-wrap:anywhere}:root{--alxgrn-unit: 16px;--alxgrn-unit-half: 8px;--alxgrn-unit-small: 4px;--alxgrn-unit-double: 32px;--alxgrn-unit-smallest: 2px;--alxgrn-font-size: 16px;--alxgrn-font-small: 12px;--alxgrn-line-height: 1.3;--alxgrn-font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;--alxgrn-color-text: #555;--alxgrn-color-dark: var(--alxgrn-color-text);--alxgrn-color-light: lightslategrey;--alxgrn-color-error: firebrick;--alxgrn-color-accent: steelblue;--alxgrn-color-active: var(--alxgrn-color-text);--alxgrn-color-success: forestgreen;--alxgrn-bg-main: #eee;--alxgrn-bg-panel: #fff;--alxgrn-bg-modal: var(--alxgrn-bg-panel);--alxgrn-bg-popup: var(--alxgrn-bg-panel);--alxgrn-bg-dark: #888;--alxgrn-bg-light: rgba(119, 136, 153, .1);--alxgrn-bg-error: rgba(178, 34, 34, .1);--alxgrn-bg-accent: rgba(70, 130, 180, .1);--alxgrn-bg-active: moccasin;--alxgrn-bg-success: rgba(34, 139, 34, .1);--alxgrn-border-dark: rgba(136, 136, 136, 1);--alxgrn-border-light: rgba(119, 136, 153, 1);--alxgrn-border-error: rgba(178, 34, 34, 1);--alxgrn-border-accent: rgba(70, 130, 180, 1);--alxgrn-border-active: moccasin;--alxgrn-border-success: rgba(34, 139, 34, 1)}[data-theme=dark]{--alxgrn-color-text: #999;--alxgrn-color-light: #666;--alxgrn-bg-main: #111;--alxgrn-bg-panel: #222;--alxgrn-bg-modal: #222;--alxgrn-bg-popup: #333;--alxgrn-bg-active: #444;--alxgrn-border-dark: rgba(136, 136, 136, .5);--alxgrn-border-light: rgba(119, 136, 153, .5);--alxgrn-border-error: rgba(178, 34, 34, .5);--alxgrn-border-accent: rgba(70, 130, 180, .5);--alxgrn-border-active: rgba(255, 228, 181, .5);--alxgrn-border-success: rgba(34, 139, 34, .5)}:root{--alxgrn-form-width: 512px;--alxgrn-form-width-wide: 1024px}.Form{max-width:var(--alxgrn-form-width)}.Form.FormWide{max-width:var(--alxgrn-form-width-wide)}.Form *{font-size:inherit;line-height:inherit;font-family:inherit;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}.Form .FormItem{display:block;margin:var(--alxgrn-unit) 0}.FormSubmitButtons{margin-top:var(--alxgrn-unit-double);margin-bottom:0;display:flex;flex-wrap:nowrap;justify-content:space-between;gap:var(--alxgrn-unit)}
|