skillgrid 0.0.1 → 0.0.2

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.
Files changed (67) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.cjs10.js +1 -1
  3. package/dist/index.cjs11.js +1 -1
  4. package/dist/index.cjs12.js +1 -1
  5. package/dist/index.cjs14.js +1 -1
  6. package/dist/index.cjs15.js +1 -1
  7. package/dist/index.cjs16.js +1 -1
  8. package/dist/index.cjs17.js +1 -1
  9. package/dist/index.cjs18.js +1 -1
  10. package/dist/index.cjs19.js +1 -1
  11. package/dist/index.cjs20.js +1 -1
  12. package/dist/index.cjs21.js +1 -1
  13. package/dist/index.cjs22.js +1 -1
  14. package/dist/index.cjs24.js +1 -1
  15. package/dist/index.cjs25.js +1 -1
  16. package/dist/index.cjs26.js +1 -1
  17. package/dist/index.cjs27.js +1 -1
  18. package/dist/index.cjs28.js +1 -1
  19. package/dist/index.cjs3.js +1 -1
  20. package/dist/index.cjs30.js +1 -1
  21. package/dist/index.cjs31.js +1 -1
  22. package/dist/index.cjs32.js +1 -1
  23. package/dist/index.cjs4.js +1 -1
  24. package/dist/index.cjs41.js +1 -1
  25. package/dist/index.cjs42.js +1 -1
  26. package/dist/index.cjs43.js +1 -1
  27. package/dist/index.cjs44.js +1 -1
  28. package/dist/index.cjs45.js +1 -1
  29. package/dist/index.cjs5.js +1 -1
  30. package/dist/index.cjs6.js +1 -1
  31. package/dist/index.cjs7.js +1 -1
  32. package/dist/index.cjs8.js +1 -1
  33. package/dist/index.cjs9.js +1 -1
  34. package/dist/index.es.js +17 -17
  35. package/dist/index.es10.js +16 -2
  36. package/dist/index.es11.js +14 -14
  37. package/dist/index.es12.js +7 -7
  38. package/dist/index.es14.js +5 -30
  39. package/dist/index.es15.js +46 -5
  40. package/dist/index.es16.js +20 -3
  41. package/dist/index.es17.js +3 -71
  42. package/dist/index.es18.js +68 -43
  43. package/dist/index.es19.js +8 -19
  44. package/dist/index.es20.js +24 -5
  45. package/dist/index.es21.js +4 -8
  46. package/dist/index.es22.js +30 -24
  47. package/dist/index.es24.js +9 -3
  48. package/dist/index.es25.js +2 -10
  49. package/dist/index.es26.js +3 -3
  50. package/dist/index.es27.js +20 -2
  51. package/dist/index.es28.js +3 -19
  52. package/dist/index.es3.js +2 -64
  53. package/dist/index.es30.js +11 -15
  54. package/dist/index.es31.js +14 -4
  55. package/dist/index.es32.js +5 -12
  56. package/dist/index.es4.js +2 -178
  57. package/dist/index.es41.js +4 -2
  58. package/dist/index.es42.js +1 -1
  59. package/dist/index.es43.js +2 -2
  60. package/dist/index.es44.js +1 -1
  61. package/dist/index.es45.js +2 -4
  62. package/dist/index.es5.js +57 -66
  63. package/dist/index.es6.js +173 -60
  64. package/dist/index.es7.js +71 -20
  65. package/dist/index.es8.js +65 -16
  66. package/dist/index.es9.js +22 -2
  67. package/package.json +8 -3
package/dist/index.es6.js CHANGED
@@ -1,67 +1,180 @@
1
- import { j as s } from "./index.es13.js";
2
- import { forwardRef as c } from "react";
3
- import a from "./index.es14.js";
4
- import x from "./index.es15.js";
5
- const j = c(
6
- ({
7
- size: e = 24,
8
- variant: t = "accent",
9
- className: r,
10
- "data-testid": n = "loader",
11
- style: o,
12
- ...i
13
- }, d) => {
14
- const l = x(
15
- a.loader,
16
- a[t],
17
- a[`size-${e}`],
18
- r
19
- );
20
- return /* @__PURE__ */ s.jsx(
21
- "svg",
1
+ import { j as e } from "./index.es13.js";
2
+ import { forwardRef as Y } from "react";
3
+ import { isAsLink as Z, isAsButton as tt } from "./index.es17.js";
4
+ import t from "./index.es18.js";
5
+ import R from "./index.es14.js";
6
+ const k = ({
7
+ isLoading: a,
8
+ showBadge: u,
9
+ badgeValue: d,
10
+ badgeSize: s,
11
+ icon: o,
12
+ children: l,
13
+ postfix: m,
14
+ showSubcaption: p,
15
+ subcaption: _,
16
+ size: h
17
+ }) => {
18
+ if (a)
19
+ return /* @__PURE__ */ e.jsx("span", { className: t.loader, "data-testid": "button-loader", "aria-hidden": "true" });
20
+ const n = s === "extra-small", i = parseInt(String(d), 10), x = !isNaN(i) && i >= 0 && i <= 9;
21
+ return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
22
+ u && (d || n) && /* @__PURE__ */ e.jsx(
23
+ "span",
24
+ {
25
+ "data-testid": "button-badge",
26
+ className: R(
27
+ t.badge,
28
+ t[`badge${n ? "ExtraSmall" : s === "medium" ? "Medium" : "Small"}`],
29
+ { [t.circular]: x && !n }
30
+ ),
31
+ children: !n && d
32
+ }
33
+ ),
34
+ p && h !== "s" && h !== "xs" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
35
+ /* @__PURE__ */ e.jsx("span", { "data-testid": "button-label", className: t.label, children: l }),
36
+ /* @__PURE__ */ e.jsx("span", { "data-testid": "button-subcaption", className: t.subcaption, children: _ })
37
+ ] }) : l ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
38
+ /* @__PURE__ */ e.jsx("span", { "data-testid": "button-label", className: t.label, children: l }),
39
+ /* @__PURE__ */ e.jsxs("div", { "data-testid": "button-right-group", className: t.rightGroup, children: [
40
+ o && /* @__PURE__ */ e.jsx("span", { "data-testid": "button-icon", className: t.icon, children: o }),
41
+ m && /* @__PURE__ */ e.jsx("span", { "data-testid": "button-postfix", className: t.postfix, children: m })
42
+ ] })
43
+ ] }) : /* @__PURE__ */ e.jsx("span", { "data-testid": "button-icon", className: t.icon, children: o })
44
+ ] });
45
+ }, dt = Y((a, u) => {
46
+ const {
47
+ mode: d = "primary",
48
+ size: s = "m",
49
+ buttonStyle: o = "neutral",
50
+ loading: l = !1,
51
+ disabled: m = !1,
52
+ showBadge: p = !1,
53
+ badgeSize: _ = "small",
54
+ badgeValue: h,
55
+ showSubcaption: n = !1,
56
+ subcaption: i,
57
+ stretched: x = !1,
58
+ spaceBetween: V = !1,
59
+ icon: I,
60
+ postfix: v,
61
+ className: E,
62
+ children: y
63
+ } = a, c = m, r = l, g = !c && !r, F = !!I && !y, C = R(
64
+ t.button,
65
+ t[s],
66
+ t[d],
67
+ t[o],
68
+ {
69
+ [t.disabled]: c,
70
+ [t.loading]: r,
71
+ [t.stretched]: x,
72
+ [t.spaceBetween]: V && x,
73
+ [t.withSubcaption]: n && i && s !== "s" && s !== "xs",
74
+ [t.iconOnly]: F
75
+ },
76
+ E
77
+ ), z = {
78
+ isLoading: r,
79
+ showBadge: p,
80
+ badgeValue: h,
81
+ badgeSize: _,
82
+ icon: I,
83
+ children: y,
84
+ postfix: v,
85
+ showSubcaption: n,
86
+ subcaption: i,
87
+ size: s
88
+ };
89
+ if (Z(a)) {
90
+ const {
91
+ href: f,
92
+ onClick: b,
93
+ mode: A,
94
+ size: L,
95
+ buttonStyle: O,
96
+ loading: T,
97
+ disabled: D,
98
+ showBadge: G,
99
+ badgeSize: M,
100
+ badgeValue: P,
101
+ showSubcaption: $,
102
+ subcaption: q,
103
+ stretched: H,
104
+ spaceBetween: J,
105
+ icon: K,
106
+ postfix: Q,
107
+ className: U,
108
+ tabIndex: W,
109
+ children: X,
110
+ "data-testid": N,
111
+ style: S,
112
+ ...j
113
+ } = a, w = (B) => {
114
+ g && b && b(B);
115
+ };
116
+ return /* @__PURE__ */ e.jsx(
117
+ "a",
22
118
  {
23
- ref: d,
24
- className: l,
25
- fill: "none",
26
- viewBox: "0 0 16 16",
27
- xmlns: "http://www.w3.org/2000/svg",
28
- "data-testid": n,
29
- style: o,
30
- ...i,
31
- children: /* @__PURE__ */ s.jsx(
32
- "path",
33
- {
34
- d: "M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2",
35
- stroke: "currentColor",
36
- strokeLinecap: "round",
37
- strokeWidth: "1.33333"
38
- }
39
- )
119
+ ref: u,
120
+ className: C,
121
+ href: g ? f : void 0,
122
+ tabIndex: a.tabIndex,
123
+ onClick: w,
124
+ "data-testid": N,
125
+ "aria-disabled": c || r,
126
+ style: S,
127
+ ...j,
128
+ children: /* @__PURE__ */ e.jsx(k, { ...z })
40
129
  }
41
130
  );
42
131
  }
43
- ), p = c((e, t) => {
44
- const {
45
- loading: r = !1,
46
- size: n = 24,
47
- variant: o = "accent",
48
- children: i,
49
- className: d,
50
- style: l,
51
- "data-testid": m,
52
- ...f
53
- } = e, h = x(a.container, d);
54
- return /* @__PURE__ */ s.jsxs("div", { ref: t, className: h, style: l, "data-testid": m, ...f, children: [
55
- i,
56
- r && /* @__PURE__ */ s.jsx("div", { className: a.overlay, children: /* @__PURE__ */ s.jsx(j, { size: n, variant: o, "data-testid": `${m}-spinner` }) })
57
- ] });
58
- }), w = c((e, t) => e.children ? /* @__PURE__ */ s.jsx(
59
- p,
60
- {
61
- ref: t,
62
- ...e
132
+ if (tt(a)) {
133
+ const {
134
+ type: f = "button",
135
+ onClick: b,
136
+ mode: A,
137
+ size: L,
138
+ buttonStyle: O,
139
+ loading: T,
140
+ disabled: D,
141
+ showBadge: G,
142
+ badgeSize: M,
143
+ badgeValue: P,
144
+ showSubcaption: $,
145
+ subcaption: q,
146
+ stretched: H,
147
+ spaceBetween: J,
148
+ icon: K,
149
+ postfix: Q,
150
+ className: U,
151
+ tabIndex: W,
152
+ children: X,
153
+ "data-testid": N,
154
+ style: S,
155
+ ...j
156
+ } = a, w = (B) => {
157
+ g && b && b(B);
158
+ };
159
+ return /* @__PURE__ */ e.jsx(
160
+ "button",
161
+ {
162
+ ref: u,
163
+ type: f,
164
+ className: C,
165
+ disabled: c,
166
+ tabIndex: a.tabIndex,
167
+ onClick: w,
168
+ "data-testid": N,
169
+ "aria-disabled": c || r,
170
+ style: S,
171
+ ...j,
172
+ children: /* @__PURE__ */ e.jsx(k, { ...z })
173
+ }
174
+ );
63
175
  }
64
- ) : /* @__PURE__ */ s.jsx(j, { ref: t, ...e }));
176
+ return null;
177
+ });
65
178
  export {
66
- w as Loader
179
+ dt as Button
67
180
  };
package/dist/index.es7.js CHANGED
@@ -1,24 +1,75 @@
1
- import { j as o } from "./index.es13.js";
2
- import n from "./index.es15.js";
3
- import { ConfigContext as m } from "./index.es8.js";
4
- import a from "./index.es20.js";
5
- const j = ({
6
- locale: t = {},
7
- theme: r,
8
- children: e,
9
- className: s
10
- }) => {
11
- const i = r ? { ...Object.fromEntries(Object.entries(r)) } : {};
12
- return /* @__PURE__ */ o.jsx(
13
- "div",
1
+ import { j as a } from "./index.es13.js";
2
+ import { forwardRef as L, useState as S, useCallback as p, useEffect as $, Fragment as b } from "react";
3
+ import l from "./index.es19.js";
4
+ import k from "./index.es14.js";
5
+ import { PlaceholderImageIcon as v } from "./index.es20.js";
6
+ import { Loader as z } from "./index.es8.js";
7
+ const q = L((x, h) => {
8
+ const {
9
+ alt: m = "",
10
+ loading: j = "lazy",
11
+ src: e,
12
+ isLoading: c = !1,
13
+ className: u,
14
+ "data-testid": r = "image",
15
+ onError: s,
16
+ onLoad: o,
17
+ ...I
18
+ } = x, [i, t] = S("loading"), g = i === "error", f = (c || i === "loading") && !g, N = i === "loaded" && !c, w = k(
19
+ l.image,
14
20
  {
15
- "data-testid": "ConfigProvider-component",
16
- style: i,
17
- className: n(a.wrapper, s),
18
- children: /* @__PURE__ */ o.jsx(m.Provider, { value: { locale: t }, children: e })
21
+ [l.loading]: f
22
+ },
23
+ u
24
+ ), y = p(
25
+ (n) => {
26
+ t("loaded"), o == null || o(n);
27
+ },
28
+ [o]
29
+ ), E = p(
30
+ (n) => {
31
+ t("error"), s == null || s(n);
32
+ },
33
+ [s]
34
+ ), d = {
35
+ loader: /* @__PURE__ */ a.jsxs(b, { children: [
36
+ /* @__PURE__ */ a.jsx(z, { size: 48, variant: "special", "data-testid": `${r}-loader` }),
37
+ /* @__PURE__ */ a.jsx(
38
+ "img",
39
+ {
40
+ alt: m,
41
+ src: e,
42
+ onLoad: y,
43
+ onError: E,
44
+ style: { display: "none" }
45
+ }
46
+ )
47
+ ] }),
48
+ error: /* @__PURE__ */ a.jsx(v, { "data-testid": `${r}-fallback` }),
49
+ image: /* @__PURE__ */ a.jsx(
50
+ "img",
51
+ {
52
+ ref: h,
53
+ alt: m,
54
+ "data-testid": r,
55
+ loading: j,
56
+ src: e,
57
+ className: w
58
+ }
59
+ )
60
+ };
61
+ return $(() => {
62
+ if (!e) {
63
+ t("error");
64
+ return;
19
65
  }
20
- );
21
- };
66
+ t("loading");
67
+ }, [e]), /* @__PURE__ */ a.jsxs("div", { className: l.container, "data-testid": `${r}-container`, ...I, children: [
68
+ f && d.loader,
69
+ g && d.error,
70
+ N && d.image
71
+ ] });
72
+ });
22
73
  export {
23
- j as ConfigProvider
74
+ q as Image
24
75
  };
package/dist/index.es8.js CHANGED
@@ -1,18 +1,67 @@
1
- import { createContext as t, useContext as e } from "react";
2
- import n from "./index.es9.js";
3
- const r = t({
4
- locale: n
5
- }), c = () => {
6
- const o = e(r);
7
- if (!o)
8
- throw new Error("useConfig must be used within a ConfigProvider");
9
- return o;
10
- }, u = () => {
11
- const { locale: o } = c();
12
- return o;
13
- };
1
+ import { j as s } from "./index.es13.js";
2
+ import { forwardRef as c } from "react";
3
+ import a from "./index.es22.js";
4
+ import x from "./index.es14.js";
5
+ const j = c(
6
+ ({
7
+ size: e = 24,
8
+ variant: t = "accent",
9
+ className: r,
10
+ "data-testid": n = "loader",
11
+ style: o,
12
+ ...i
13
+ }, d) => {
14
+ const l = x(
15
+ a.loader,
16
+ a[t],
17
+ a[`size-${e}`],
18
+ r
19
+ );
20
+ return /* @__PURE__ */ s.jsx(
21
+ "svg",
22
+ {
23
+ ref: d,
24
+ className: l,
25
+ fill: "none",
26
+ viewBox: "0 0 16 16",
27
+ xmlns: "http://www.w3.org/2000/svg",
28
+ "data-testid": n,
29
+ style: o,
30
+ ...i,
31
+ children: /* @__PURE__ */ s.jsx(
32
+ "path",
33
+ {
34
+ d: "M14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2",
35
+ stroke: "currentColor",
36
+ strokeLinecap: "round",
37
+ strokeWidth: "1.33333"
38
+ }
39
+ )
40
+ }
41
+ );
42
+ }
43
+ ), p = c((e, t) => {
44
+ const {
45
+ loading: r = !1,
46
+ size: n = 24,
47
+ variant: o = "accent",
48
+ children: i,
49
+ className: d,
50
+ style: l,
51
+ "data-testid": m,
52
+ ...f
53
+ } = e, h = x(a.container, d);
54
+ return /* @__PURE__ */ s.jsxs("div", { ref: t, className: h, style: l, "data-testid": m, ...f, children: [
55
+ i,
56
+ r && /* @__PURE__ */ s.jsx("div", { className: a.overlay, children: /* @__PURE__ */ s.jsx(j, { size: n, variant: o, "data-testid": `${m}-spinner` }) })
57
+ ] });
58
+ }), w = c((e, t) => e.children ? /* @__PURE__ */ s.jsx(
59
+ p,
60
+ {
61
+ ref: t,
62
+ ...e
63
+ }
64
+ ) : /* @__PURE__ */ s.jsx(j, { ref: t, ...e }));
14
65
  export {
15
- r as ConfigContext,
16
- c as useConfig,
17
- u as useLocale
66
+ w as Loader
18
67
  };
package/dist/index.es9.js CHANGED
@@ -1,4 +1,24 @@
1
- const a = {};
1
+ import { j as o } from "./index.es13.js";
2
+ import n from "./index.es14.js";
3
+ import { ConfigContext as m } from "./index.es10.js";
4
+ import a from "./index.es21.js";
5
+ const j = ({
6
+ locale: t = {},
7
+ theme: r,
8
+ children: e,
9
+ className: s
10
+ }) => {
11
+ const i = r ? { ...Object.fromEntries(Object.entries(r)) } : {};
12
+ return /* @__PURE__ */ o.jsx(
13
+ "div",
14
+ {
15
+ "data-testid": "ConfigProvider-component",
16
+ style: i,
17
+ className: n(a.wrapper, s),
18
+ children: /* @__PURE__ */ o.jsx(m.Provider, { value: { locale: t }, children: e })
19
+ }
20
+ );
21
+ };
2
22
  export {
3
- a as default
23
+ j as ConfigProvider
4
24
  };
package/package.json CHANGED
@@ -1,13 +1,16 @@
1
1
  {
2
2
  "name": "skillgrid",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Skillgrid Components Library",
5
5
  "keywords": ["react", "ui", "components"],
6
6
  "author": "Skillaz Dev.",
7
- "license": "MIT",
7
+ "license": "SEE LICENSE IN ./LICENCE.md",
8
8
  "repository": "https://gitlab.dev.skillaz.ru/frontend/skillgrid",
9
9
  "homepage": "https://skillaz.ru/",
10
10
  "type": "module",
11
+ "sideEffects": [
12
+ "*.css"
13
+ ],
11
14
  "main": "./dist/index.cjs.js",
12
15
  "module": "./dist/index.es.js",
13
16
  "types": "./dist/index.d.ts",
@@ -16,8 +19,10 @@
16
19
  "types": "./dist/index.d.ts",
17
20
  "import": "./dist/index.es.js",
18
21
  "require": "./dist/index.cjs.js"
19
- }
22
+ },
23
+ "./styles.css": "./dist/styles.css"
20
24
  },
25
+ "style": "./dist/styles.css",
21
26
  "files": [
22
27
  "dist"
23
28
  ],