@alxgrn/telefrag-ui 0.0.12 → 0.0.14

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.
@@ -1 +1 @@
1
- .Content{display:flex;align-items:stretch;gap:var(--alxgrn-unit);max-width:var(--alxgrn-layout-width);margin:0 auto;margin-top:var(--alxgrn-layout-header-height)}.Content .ContentMenu{flex:0 0 auto;width:var(--alxgrn-layout-menu-width);color:var(--alxgrn-color-text);background-color:var(--alxgrn-bg-main)}.Content .ContentMenu .ContentMenuInner{position:sticky;top:var(--alxgrn-layout-header-height)}.Content .ContentMain{flex:1 1 auto}@media (max-width: 1024px){.Content .ContentMenu{display:none}}@media (max-width: 768px){.Content{padding-left:0;padding-right:0}}
1
+ .Content{display:flex;align-items:stretch;gap:var(--alxgrn-unit);max-width:var(--alxgrn-layout-width);margin:0 auto;margin-top:calc(var(--alxgrn-unit-half) + var(--alxgrn-layout-header-height))}.Content .ContentMenu{flex:0 0 auto;width:var(--alxgrn-layout-menu-width);color:var(--alxgrn-color-text);background-color:var(--alxgrn-bg-main)}.Content .ContentMenu .ContentMenuInner{position:sticky;top:calc(var(--alxgrn-unit) + var(--alxgrn-layout-header-height))}.Content .ContentMain{flex:1 1 auto}@media (max-width: 1024px){.Content .ContentMenu{display:none}}@media (max-width: 768px){.Content{padding-left:0;padding-right:0}}
@@ -1 +1 @@
1
- .HeaderWrapper{z-index:100;display:block;position:fixed;top:0;width:100%;background-color:var(--alxgrn-bg-main)}.Header{display:flex;align-items:center;gap:var(--alxgrn-unit);max-width:var(--alxgrn-layout-width);height:var(--alxgrn-layout-header-height);margin:0 auto}.HeaderLeft{display:none}.HeaderLeft span{cursor:pointer}.HeaderCenter{flex:1 1 auto;display:flex;align-items:center;padding-left:calc(var(--alxgrn-unit) + var(--alxgrn-layout-menu-width))}.HeaderCenter svg{width:auto;height:calc(2 * var(--alxgrn-unit))}@media (max-width: 1024px){.HeaderLeft{flex:0 0 auto;display:flex;align-items:center;justify-content:center}.HeaderCenter{padding-left:0}}
1
+ .HeaderWrapper{z-index:100;display:block;position:fixed;top:0;width:100%;background-color:var(--alxgrn-bg-panel)}.Header{display:flex;align-items:center;gap:var(--alxgrn-unit);max-width:var(--alxgrn-layout-width);height:var(--alxgrn-layout-header-height);margin:0 auto}.HeaderLeft{display:none}.HeaderLeft span{cursor:pointer}.HeaderCenter{flex:1 1 auto;display:flex;align-items:center;padding-left:calc(var(--alxgrn-unit) + var(--alxgrn-layout-menu-width))}.HeaderCenter svg{width:auto;height:calc(2 * var(--alxgrn-unit))}@media (max-width: 1024px){.HeaderLeft{flex:0 0 auto;display:flex;align-items:center;justify-content:center}.HeaderCenter{padding-left:0}}
@@ -1 +1 @@
1
- .MainMenu div{display:flex;align-items:center;gap:var(--alxgrn-unit-half);margin-bottom:var(--alxgrn-unit-half);cursor:pointer}.MainMenu div:hover *{color:var(--alxgrn-color-accent)}.MainMenu div svg{font-size:var(--alxgrn-font-size-big)}.MainMenu div span{font-size:var(--alxgrn-font-size)}
1
+ .MainMenu div{display:flex;align-items:center;gap:var(--alxgrn-unit-half);margin-bottom:var(--alxgrn-unit);cursor:pointer}.MainMenu div:hover *{color:var(--alxgrn-color-accent)}.MainMenu div svg{font-size:var(--alxgrn-font-size-big)}.MainMenu div span{font-size:var(--alxgrn-font-size)}
@@ -1,26 +1,28 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { Radio as f } from "../radio/Radio.js";
3
- const d = ({
4
- value: o,
5
- onChange: a,
6
- label: s,
7
- bottom: m,
8
- required: r = !1,
9
- disabled: t = !1,
10
- checked: c = !1
2
+ import { Radio as l } from "../radio/Radio.js";
3
+ const p = ({
4
+ id: o,
5
+ value: a,
6
+ onChange: s,
7
+ label: m,
8
+ bottom: r,
9
+ required: t = !1,
10
+ disabled: c = !1,
11
+ checked: f = !1
11
12
  }) => /* @__PURE__ */ e("div", { className: "FormItem", children: /* @__PURE__ */ e(
12
- f,
13
+ l,
13
14
  {
15
+ id: o,
14
16
  type: "checkbox",
15
- label: s,
16
- value: o,
17
- bottom: m,
18
- required: r,
19
- disabled: t,
20
- checked: c,
21
- onChange: a
17
+ label: m,
18
+ value: a,
19
+ bottom: r,
20
+ required: t,
21
+ disabled: c,
22
+ checked: f,
23
+ onChange: s
22
24
  }
23
25
  ) });
24
26
  export {
25
- d as default
27
+ p as default
26
28
  };
@@ -9,6 +9,7 @@ export interface CheckboxListOption {
9
9
  required?: boolean | null;
10
10
  }
11
11
  export interface CheckboxListProps {
12
+ id: string;
12
13
  label?: string | null;
13
14
  options: CheckboxListOption[];
14
15
  onChange: (v: CheckboxListOption[]) => void;
@@ -1,32 +1,34 @@
1
1
  import { jsx as f } from "react/jsx-runtime";
2
- import { useState as u, useEffect as b } from "react";
3
- import i from "../fieldset/Fieldset.js";
4
- import { Radio as k } from "../radio/Radio.js";
5
- const g = ({
6
- label: d,
7
- onChange: n,
2
+ import { useState as b, useEffect as i } from "react";
3
+ import k from "../fieldset/Fieldset.js";
4
+ import { Radio as m } from "../radio/Radio.js";
5
+ const v = ({
6
+ id: d,
7
+ label: n,
8
+ onChange: h,
8
9
  required: t = !1,
9
10
  disabled: a = !1,
10
11
  options: r
11
12
  }) => {
12
- const [l, s] = u(!1);
13
- b(() => {
13
+ const [l, s] = b(!1);
14
+ i(() => {
14
15
  s(!1), t && r.findIndex((o) => o.checked === !0) < 0 && s(!0);
15
16
  }, [t, r]);
16
- const h = (e, o) => {
17
+ const u = (e, o) => {
17
18
  const c = [...r];
18
- c[e].checked = o, n(c);
19
+ c[e].checked = o, h(c);
19
20
  };
20
21
  return /* @__PURE__ */ f(
21
- i,
22
+ k,
22
23
  {
23
- label: d,
24
+ label: n,
24
25
  error: l,
25
26
  disabled: a,
26
27
  required: t,
27
28
  children: r.map((e, o) => /* @__PURE__ */ f(
28
- k,
29
+ m,
29
30
  {
31
+ id: d,
30
32
  type: "checkbox",
31
33
  error: l,
32
34
  label: e.label,
@@ -35,7 +37,7 @@ const g = ({
35
37
  disabled: e.disabled || a,
36
38
  required: e.required,
37
39
  checked: e.checked,
38
- onChange: (c) => h(o, c)
40
+ onChange: (c) => u(o, c)
39
41
  },
40
42
  o
41
43
  ))
@@ -43,6 +45,6 @@ const g = ({
43
45
  );
44
46
  };
45
47
  export {
46
- g as CheckboxList,
47
- g as default
48
+ v as CheckboxList,
49
+ v as default
48
50
  };
@@ -8,6 +8,7 @@ import { default as React } from 'react';
8
8
  * отметки элемента.
9
9
  */
10
10
  export interface RadioProps {
11
+ id: string;
11
12
  type?: 'radio' | 'checkbox';
12
13
  value: string | number;
13
14
  error?: boolean;
@@ -1,29 +1,31 @@
1
1
  import { jsx as t } from "react/jsx-runtime";
2
- import n from "./RadioLabel.js";
3
- const p = ({
4
- type: l = "radio",
5
- value: s,
6
- onChange: f,
7
- label: o,
8
- bottom: u,
9
- error: d = !1,
2
+ import c from "./RadioLabel.js";
3
+ const h = ({
4
+ id: l,
5
+ type: s = "radio",
6
+ value: f,
7
+ onChange: o,
8
+ label: u,
9
+ bottom: d,
10
+ error: i = !1,
10
11
  required: e = !1,
11
12
  disabled: r = !1,
12
13
  checked: a = !1
13
14
  }) => /* @__PURE__ */ t(
14
- n,
15
+ c,
15
16
  {
16
- label: o,
17
- bottom: u,
17
+ label: u,
18
+ bottom: d,
18
19
  required: !!e,
19
- error: d || e && !a,
20
+ error: i || e && !a,
20
21
  disabled: !!r,
21
22
  checked: !!a,
22
23
  children: /* @__PURE__ */ t(
23
24
  "input",
24
25
  {
25
- type: l,
26
- onChange: (i) => f(i.target.checked, s),
26
+ id: l,
27
+ type: s,
28
+ onChange: (n) => o(n.target.checked, f),
27
29
  checked: !!a,
28
30
  disabled: !!r,
29
31
  required: !!e
@@ -32,6 +34,6 @@ const p = ({
32
34
  }
33
35
  );
34
36
  export {
35
- p as Radio,
36
- p as default
37
+ h as Radio,
38
+ h as default
37
39
  };
@@ -12,6 +12,7 @@ export interface RadioListOption {
12
12
  required?: boolean | null;
13
13
  }
14
14
  export interface RadioListProps {
15
+ id: string;
15
16
  label?: string | null;
16
17
  value: RadioListValue;
17
18
  options: RadioListOption[];
@@ -1,21 +1,22 @@
1
1
  import { jsx as d } from "react/jsx-runtime";
2
- import { useState as m, useEffect as b } from "react";
3
- import { Radio as x } from "./Radio.js";
4
- import p from "../fieldset/Fieldset.js";
5
- const g = ({ label: n, value: r, onChange: i, required: o = !1, disabled: l = !1, options: a }) => {
6
- const [t, s] = m(!1);
7
- return b(() => {
2
+ import { useState as b, useEffect as x } from "react";
3
+ import { Radio as p } from "./Radio.js";
4
+ import h from "../fieldset/Fieldset.js";
5
+ const j = ({ id: n, label: i, value: r, onChange: c, required: o = !1, disabled: l = !1, options: a }) => {
6
+ const [t, s] = b(!1);
7
+ return x(() => {
8
8
  s(!1), o && a.findIndex((f) => f.value === r) < 0 && s(!0);
9
9
  }, [r, o, a]), /* @__PURE__ */ d(
10
- p,
10
+ h,
11
11
  {
12
- label: n,
12
+ label: i,
13
13
  error: t,
14
14
  disabled: l,
15
15
  required: o,
16
16
  children: a.map((e, f) => /* @__PURE__ */ d(
17
- x,
17
+ p,
18
18
  {
19
+ id: n,
19
20
  label: e.label,
20
21
  value: e.value,
21
22
  error: t,
@@ -23,7 +24,7 @@ const g = ({ label: n, value: r, onChange: i, required: o = !1, disabled: l = !1
23
24
  disabled: e.disabled || l,
24
25
  required: e.required,
25
26
  checked: e.value === r,
26
- onChange: (c, u) => i(u, c)
27
+ onChange: (u, m) => c(m, u)
27
28
  },
28
29
  f
29
30
  ))
@@ -31,6 +32,6 @@ const g = ({ label: n, value: r, onChange: i, required: o = !1, disabled: l = !1
31
32
  );
32
33
  };
33
34
  export {
34
- g as RadioList,
35
- g as default
35
+ j as RadioList,
36
+ j as default
36
37
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@alxgrn/telefrag-ui",
3
3
  "description": "UI library for The Daily Telefrag project",
4
- "version": "0.0.12",
4
+ "version": "0.0.14",
5
5
  "private": false,
6
6
  "author": "Alexander Fedorov <alex@molner.ru>",
7
7
  "license": "Apache-2.0",