fiboui 2.1.0 → 2.2.1

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,90 +0,0 @@
1
- "use client";
2
- var l = Object.defineProperty;
3
- var p = (s, e, t) => e in s ? l(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
4
- var r = (s, e, t) => p(s, typeof e != "symbol" ? e + "" : e, t);
5
- import h from "react";
6
- import { h as c, F as m } from "./builder-6GkZlCaz.js";
7
- import { F as u } from "./FineGrain-BTgNt7fN.js";
8
- const y = h.memo((s) => {
9
- const { text: e, type: t, className: i, style: a, ...n } = s, o = {
10
- h1: "h1",
11
- h2: "h2",
12
- h3: "h3",
13
- h4: "h4",
14
- h5: "h5",
15
- h6: "h6",
16
- body: "p",
17
- caption: "span",
18
- label: "label"
19
- };
20
- return h.createElement(
21
- o[t],
22
- {
23
- className: `fibo-text fibo-text-${t} ${i}`,
24
- style: { margin: 0, ...a },
25
- ...n
26
- },
27
- e
28
- );
29
- });
30
- class x extends m {
31
- constructor(t = "") {
32
- super();
33
- r(this, "_text", "");
34
- r(this, "_type", "body");
35
- this.text(t);
36
- }
37
- text(t) {
38
- return this._text = t, this;
39
- }
40
- type(t) {
41
- return this._type = t, this;
42
- }
43
- variant(t) {
44
- return this._type = t, this;
45
- }
46
- nowrap() {
47
- return this._classNames.push("whitespace-nowrap"), this;
48
- }
49
- mono() {
50
- return this._classNames.push("font-mono"), this;
51
- }
52
- muted() {
53
- return this._style = { ...this._style, color: "#9a9a9a" }, this;
54
- }
55
- build() {
56
- const t = {
57
- h1: "h1",
58
- h2: "h2",
59
- h3: "h3",
60
- h4: "h4",
61
- h5: "h5",
62
- h6: "h6",
63
- body: "p",
64
- caption: "span",
65
- label: "label"
66
- };
67
- if (typeof this._text == "function") {
68
- const a = this._text;
69
- return h.createElement(u, {
70
- compute: a,
71
- as: t[this._type],
72
- className: `fibo-text fibo-text-${this._type} ${this.getClassName()}`,
73
- style: { margin: 0, ...this.getStyle() },
74
- ...this._props
75
- });
76
- }
77
- const i = {
78
- text: this._text,
79
- type: this._type,
80
- className: this.getClassName(),
81
- style: this.getStyle(),
82
- ...this._props
83
- };
84
- return h.createElement(y, i);
85
- }
86
- }
87
- const N = c(x);
88
- export {
89
- N as T
90
- };
@@ -1,95 +0,0 @@
1
- "use client";
2
- var b = Object.defineProperty;
3
- var f = (e, t, n) => t in e ? b(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
4
- var s = (e, t, n) => f(e, typeof t != "symbol" ? t + "" : t, n);
5
- import r, { useCallback as u, useSyncExternalStore as c, StrictMode as E } from "react";
6
- import { createRoot as p } from "react-dom/client";
7
- import { P as g } from "./PluginManager-D5-ApsSN.js";
8
- import { R as d, j as _, P as w, k as S, l as R } from "./builder-6GkZlCaz.js";
9
- function v(e) {
10
- return (t) => e.subscribe(t);
11
- }
12
- function B(e) {
13
- const t = u(v(e), [e]);
14
- return c(t, () => e.value, () => e.value);
15
- }
16
- function k(e) {
17
- const t = u(
18
- (n) => e.subscribe(n),
19
- [e]
20
- );
21
- return c(t, () => e.getState(), () => e.getState());
22
- }
23
- function x(e) {
24
- const t = u(
25
- (n) => e.subscribe(n),
26
- [e]
27
- );
28
- return c(t, () => e.get(), () => e.get());
29
- }
30
- class C {
31
- constructor() {
32
- s(this, "_rootComponent", null);
33
- s(this, "_rootElement", null);
34
- s(this, "_plugins", []);
35
- }
36
- use(t) {
37
- return this._plugins.push(t), this;
38
- }
39
- plugins(t) {
40
- return this._plugins.push(...t), this;
41
- }
42
- root(t) {
43
- return this._rootComponent = t, this;
44
- }
45
- mount(t) {
46
- const n = document.getElementById(t);
47
- if (!n)
48
- throw new Error(`Root element with id "${t}" not found`);
49
- this._rootElement = n, this.build();
50
- }
51
- build() {
52
- if (!this._rootComponent || !this._rootElement)
53
- throw new Error("Root component and mount element must be provided");
54
- const t = g.getInstance();
55
- this._plugins.forEach((i) => {
56
- t.use(i);
57
- });
58
- const n = this._rootComponent, o = () => r.createElement(d, {
59
- children: r.createElement(_, {
60
- stateMap: /* @__PURE__ */ new Map(),
61
- children: r.createElement(w, {
62
- providers: /* @__PURE__ */ new Map(),
63
- children: r.createElement(n, null)
64
- })
65
- })
66
- });
67
- p(this._rootElement).render(r.createElement(o));
68
- }
69
- }
70
- const W = () => new C();
71
- function h(e) {
72
- return R(e);
73
- }
74
- function $({ children: e }) {
75
- return h(e);
76
- }
77
- function j(e, t, n) {
78
- const o = typeof e == "string" ? document.querySelector(e) : e;
79
- if (!o)
80
- throw new Error(`mount: element not found: ${String(e)}`);
81
- const l = typeof t == "function" && !S(t) ? t() : t, i = h(l), a = p(o), m = r.createElement(d, { children: i });
82
- return a.render(
83
- (n == null ? void 0 : n.strict) === !1 ? m : r.createElement(E, null, m)
84
- ), a;
85
- }
86
- export {
87
- W as F,
88
- k as a,
89
- x as b,
90
- C as c,
91
- $ as d,
92
- j as m,
93
- h as t,
94
- B as u
95
- };