fiboui 2.6.3 → 2.7.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.
Files changed (50) hide show
  1. package/README.md +16 -6
  2. package/dist/cli/bin.js +3 -4
  3. package/dist/cli/commands/generate/component.js +21 -33
  4. package/dist/cli/commands/generate/index.js +3 -3
  5. package/dist/cli/commands/generate/module.js +21 -24
  6. package/dist/cli/commands/generate/plugin.js +18 -34
  7. package/dist/cli/commands/init.js +5 -25
  8. package/dist/cli/config.js +118 -0
  9. package/dist/cli/names.js +35 -0
  10. package/dist/cli/templates.js +76 -0
  11. package/dist/client-CGjHCx8F.js +17621 -0
  12. package/dist/content.d.ts +1 -0
  13. package/dist/content.js +14 -14
  14. package/dist/core.d.ts +2 -0
  15. package/dist/core.js +65 -59
  16. package/dist/effects-BxvduC-G.js +14 -0
  17. package/dist/icons-GEqYd2M9.js +383 -0
  18. package/dist/index-7bieEGAP.js +944 -0
  19. package/dist/index-C4qvvr03.js +1474 -0
  20. package/dist/index-D-ljLuf8.js +839 -0
  21. package/dist/index-DVApKYWt.js +217 -0
  22. package/dist/index-Db8lVjta.js +150 -0
  23. package/dist/index.d.ts +73156 -505
  24. package/dist/index.js +4419 -2237
  25. package/dist/interactive.d.ts +2 -0
  26. package/dist/interactive.js +22 -9
  27. package/dist/layout.d.ts +1 -0
  28. package/dist/layout.js +14 -13
  29. package/dist/metadata-3YYH1uiS.js +147 -0
  30. package/dist/navigation.d.ts +1 -0
  31. package/dist/navigation.js +15 -9
  32. package/dist/page-CYqQOLXe.js +266 -0
  33. package/dist/server.d.ts +2 -0
  34. package/dist/server.js +5001 -1777
  35. package/dist/structure.d.ts +1 -0
  36. package/dist/structure.js +13 -9
  37. package/dist/style.css +1 -1
  38. package/dist/theme.d.ts +2 -0
  39. package/dist/theme.js +8 -8
  40. package/package.json +9 -2
  41. package/dist/Link-l2KUUUg4.js +0 -50
  42. package/dist/PluginManager-BRjgOLVa.js +0 -110
  43. package/dist/client-BtHxgLa_.js +0 -10602
  44. package/dist/effects-D16XdB_d.js +0 -10
  45. package/dist/index-Bhq7-OrE.js +0 -602
  46. package/dist/index-CZJqskaC.js +0 -1028
  47. package/dist/index-D50CTdE9.js +0 -455
  48. package/dist/index-D5Ru-8kF.js +0 -608
  49. package/dist/index-DjwLjHe1.js +0 -119
  50. package/dist/mount-yYCj33dL.js +0 -135
@@ -0,0 +1,217 @@
1
+ var F = Object.defineProperty;
2
+ var U = (e, r, t) => r in e ? F(e, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[r] = t;
3
+ var i = (e, r, t) => U(e, typeof r != "symbol" ? r + "" : r, t);
4
+ import _ from "react";
5
+ import { aT as V, aU as X, aV as v, aW as C, aX as Y, aY as $ } from "./client-CGjHCx8F.js";
6
+ function E(e, r) {
7
+ if (!(typeof r != "string" || !v(r)))
8
+ for (const t of Y(r))
9
+ e.bindSignal(t);
10
+ }
11
+ function y(e, r) {
12
+ if (typeof r == "function") {
13
+ try {
14
+ y(e, r());
15
+ } catch {
16
+ }
17
+ return;
18
+ }
19
+ if (typeof r == "string") {
20
+ E(e, r);
21
+ return;
22
+ }
23
+ if (Array.isArray(r))
24
+ for (const t of r) y(e, t);
25
+ }
26
+ function D(e) {
27
+ return typeof e == "string" && v(e) ? C(e) : e;
28
+ }
29
+ function c(e) {
30
+ return e === "submit" || e === "reset" || e === "button" ? e : "button";
31
+ }
32
+ const G = _.memo((e) => {
33
+ const {
34
+ text: r,
35
+ variant: t,
36
+ size: o,
37
+ onPress: u,
38
+ onHover: b,
39
+ disabled: p,
40
+ icon: g,
41
+ shape: d,
42
+ shadow: z,
43
+ tone: B,
44
+ motion: H,
45
+ expand: S,
46
+ className: k,
47
+ style: I,
48
+ type: N = "button",
49
+ bare: h,
50
+ onClick: x,
51
+ ...w
52
+ } = e, A = c(N), M = {
53
+ xs: "px-[21px] py-[8px] text-[10px] gap-[6px] h-auto tracking-[0.12em] font-normal",
54
+ sm: "px-[14px] py-[6px] text-[13px] gap-[6px] h-[32px]",
55
+ md: "px-[22px] py-[10px] text-[15px] gap-[8px] h-[44px]",
56
+ lg: "px-[32px] py-[16px] text-[17px] gap-[10px] h-[56px]"
57
+ };
58
+ let a = "rounded-[14px]";
59
+ d === "pill" ? a = "rounded-full" : d === "square" ? a = "rounded-[12px]" : d === "rect" ? a = "rounded-[2px]" : d === "rounded" ? a = "rounded-[8px]" : d === "sharp" && (a = "rounded-none");
60
+ const l = B === "inverse";
61
+ let s = "";
62
+ t === "ghost" ? s = l ? "bg-transparent text-white shadow-none border border-transparent" : "bg-transparent text-[var(--fibo-on-surface)] shadow-none border border-transparent hover:bg-[color-mix(in_srgb,var(--fibo-on-surface)_8%,transparent)]" : t === "text" ? s = l ? "bg-transparent text-white shadow-none border-none px-2" : "bg-transparent text-[var(--fibo-on-surface)] shadow-none border-none px-2 hover:bg-[color-mix(in_srgb,var(--fibo-on-surface)_8%,transparent)]" : t === "soft" ? s = "bg-[color-mix(in_srgb,var(--fibo-primary)_12%,transparent)] text-[var(--fibo-primary)] shadow-none border-none hover:bg-[color-mix(in_srgb,var(--fibo-primary)_18%,transparent)]" : t === "outline" || t === "outlined" ? s = l ? "bg-black text-white shadow-none border border-[#3b3b3b]" : "bg-transparent border-[1.5px] border-[var(--fibo-outline,rgba(0,0,0,0.12))] text-[var(--fibo-on-surface)] shadow-none hover:bg-[color-mix(in_srgb,var(--fibo-on-surface)_6%,transparent)]" : t === "solid" ? s = l ? "bg-[#f2f2f2] text-black shadow-none border border-[#f2f2f2]" : "bg-[var(--fibo-primary)] text-[var(--fibo-on-primary)] shadow-none border-none hover:opacity-90" : t === "filled" || t === "primary" ? s = "bg-[var(--fibo-primary)] text-[var(--fibo-on-primary)] shadow-sm border-none hover:opacity-90 active:opacity-100" : t === "elevated" ? s = "bg-[var(--fibo-surface)] text-[var(--fibo-primary)] shadow-md border-none hover:shadow-lg" : t === "tonal" ? s = "bg-[var(--fibo-secondary-container)] text-[var(--fibo-on-secondary-container)] shadow-sm border-none" : t === "raw" && (s = "bg-transparent border-none shadow-none p-0 h-auto gap-0 text-inherit font-inherit hover:bg-transparent", a = ""), z === "soft" && t !== "raw" && (s += " shadow-[0_8px_20px_-6px_rgba(59,130,246,0.4)]");
63
+ const n = I || {}, P = n.padding !== void 0 || n.paddingTop !== void 0 || n.paddingBottom !== void 0 || n.paddingLeft !== void 0 || n.paddingRight !== void 0 || n.fontSize !== void 0 || n.height !== void 0, R = n.borderRadius !== void 0, W = n.fontWeight !== void 0 || o === "xs" || l, T = t === "raw" || H === "none" || l || o === "xs" || h;
64
+ h ? (s = "", a = "") : p && (s = s.replace(/\s*(hover|active):\S+/g, "").trim());
65
+ const q = $(
66
+ "fibo-button",
67
+ h ? "" : "relative overflow-hidden",
68
+ "inline-flex items-center justify-center whitespace-nowrap",
69
+ W || h ? "" : "font-semibold",
70
+ // Resting scale(1) so active:scale eases instead of snapping from none.
71
+ T || p ? "" : "scale-100 active:scale-[0.96] transform transition-transform duration-200 ease-out",
72
+ p ? "cursor-not-allowed opacity-60 pointer-events-none" : "cursor-pointer",
73
+ t === "raw" || h || P ? "" : M[o],
74
+ t === "raw" || h || R ? "" : a,
75
+ S ? "flex-1 w-full" : "",
76
+ `fibo-button-${t}`,
77
+ s,
78
+ k
79
+ ), f = [];
80
+ return g && f.push(g), r && f.push(r), e.children && (Array.isArray(e.children) ? f.push(...e.children) : f.push(e.children)), _.createElement(
81
+ "button",
82
+ {
83
+ className: q,
84
+ onMouseEnter: b ? () => {
85
+ p || b();
86
+ } : w.onMouseEnter,
87
+ onClick: (m) => {
88
+ if (!p) {
89
+ if (!T && document.documentElement.classList.contains("fibo-theme-material") && t !== "raw") {
90
+ const L = m.currentTarget;
91
+ import("./effects-BxvduC-G.js").then(({ createRipple: j }) => {
92
+ j(m, L);
93
+ });
94
+ }
95
+ u == null || u(), x == null || x(m);
96
+ }
97
+ },
98
+ disabled: p,
99
+ ...w,
100
+ type: A,
101
+ style: n
102
+ },
103
+ ...f
104
+ );
105
+ });
106
+ class J extends X {
107
+ constructor(t = "") {
108
+ super();
109
+ i(this, "_text", "");
110
+ i(this, "_variant", "elevated");
111
+ i(this, "_size", "md");
112
+ i(this, "_onPress");
113
+ i(this, "_onHover");
114
+ i(this, "_disabled", !1);
115
+ i(this, "_icon");
116
+ i(this, "_shape", "default");
117
+ i(this, "_shadow", "none");
118
+ i(this, "_tone", "default");
119
+ i(this, "_motion", "default");
120
+ i(this, "_expand", !1);
121
+ i(this, "_htmlType", "button");
122
+ i(this, "_htmlTypeExplicit", !1);
123
+ this.text(t);
124
+ }
125
+ text(t) {
126
+ return this._text = t, typeof t == "function" ? this.observer() : E(this, t), this;
127
+ }
128
+ children(t) {
129
+ return y(this, t), super.children(t);
130
+ }
131
+ variant(t) {
132
+ return this._variant = t, this;
133
+ }
134
+ clean() {
135
+ return this._variant = "raw", this;
136
+ }
137
+ size(t) {
138
+ return this._size = t, this;
139
+ }
140
+ onPress(t) {
141
+ return this._onPress = t, this;
142
+ }
143
+ onHover(t) {
144
+ return this._onHover = t, this;
145
+ }
146
+ disabled(t = !0) {
147
+ return this._disabled = t, this;
148
+ }
149
+ icon(t) {
150
+ return this._icon = t, this;
151
+ }
152
+ shape(t) {
153
+ return this._shape = t, this;
154
+ }
155
+ shadow(t) {
156
+ return this._shadow = t, this;
157
+ }
158
+ tone(t) {
159
+ return this._tone = t, this;
160
+ }
161
+ motion(t) {
162
+ return this._motion = t, this;
163
+ }
164
+ expand(t = !0) {
165
+ return this._expand = t, this;
166
+ }
167
+ /**
168
+ * HTML button type. `.type('submit')` is what people write inside a Form.
169
+ * React still reads `element.type` as the component: a string sets this,
170
+ * a props object renders the button.
171
+ */
172
+ type(t) {
173
+ return this._htmlType = c(t), this._htmlTypeExplicit = !0, this;
174
+ }
175
+ htmlType(t) {
176
+ return this._htmlType = c(t), this._htmlTypeExplicit = !0, this;
177
+ }
178
+ /** Shortcut for `.htmlType('submit')` inside a `Form`. */
179
+ submit() {
180
+ return this._htmlType = "submit", this._htmlTypeExplicit = !0, this;
181
+ }
182
+ /** Shortcut for `.htmlType('reset')`. */
183
+ reset() {
184
+ return this._htmlType = "reset", this._htmlTypeExplicit = !0, this;
185
+ }
186
+ resolvedHtmlType() {
187
+ var t;
188
+ return this._htmlTypeExplicit ? c(this._htmlType) : c(((t = this._props) == null ? void 0 : t.type) ?? this._htmlType);
189
+ }
190
+ build() {
191
+ const t = this.getClassName(), o = typeof this._text == "function" ? this._text() : this._text, b = {
192
+ text: typeof o == "string" && v(o) ? C(o) : o,
193
+ variant: this._variant,
194
+ size: this._size,
195
+ onPress: this._onPress,
196
+ onHover: this._onHover,
197
+ disabled: this._disabled,
198
+ icon: this._icon,
199
+ shape: this._shape,
200
+ shadow: this._shadow,
201
+ tone: this._tone,
202
+ motion: this._motion,
203
+ expand: this._expand,
204
+ className: t,
205
+ style: this.getStyle(),
206
+ children: this.processChildren().map(D),
207
+ ...this._props,
208
+ type: this.resolvedHtmlType(),
209
+ bare: this.isReset()
210
+ };
211
+ return _.createElement(G, b);
212
+ }
213
+ }
214
+ const O = V(J);
215
+ export {
216
+ O as B
217
+ };
@@ -0,0 +1,150 @@
1
+ var w = Object.defineProperty;
2
+ var S = (s, e, t) => e in s ? w(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var n = (s, e, t) => S(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import m from "react";
5
+ import { aT as g, aU as d, aW as N, aV as _, aX as j } from "./client-CGjHCx8F.js";
6
+ function C(s, e) {
7
+ if (!(typeof e != "string" || !_(e)))
8
+ for (const t of j(e))
9
+ s.bindSignal(t);
10
+ }
11
+ function l(s, e) {
12
+ if (typeof e == "function") {
13
+ try {
14
+ l(s, e());
15
+ } catch {
16
+ }
17
+ return;
18
+ }
19
+ if (typeof e == "string") {
20
+ C(s, e);
21
+ return;
22
+ }
23
+ if (Array.isArray(e))
24
+ for (const t of e) l(s, t);
25
+ }
26
+ function z(s) {
27
+ return typeof s == "string" && _(s) ? N(s) : s;
28
+ }
29
+ function B(s, e) {
30
+ const { children: t, ...r } = e, o = t !== void 0 ? t : s;
31
+ return { nodes: o == null ? [] : Array.isArray(o) ? o : [o], rest: r };
32
+ }
33
+ class I extends d {
34
+ constructor() {
35
+ super(...arguments);
36
+ n(this, "_mainAxisAlignment", "start");
37
+ // Flutter Column / SwiftUI VStack default: center. Stretch is opt-in.
38
+ n(this, "_crossAxisAlignment", "center");
39
+ n(this, "_spacing");
40
+ n(this, "_size");
41
+ }
42
+ children(t) {
43
+ return l(this, t), super.children(t);
44
+ }
45
+ props(t) {
46
+ return t && "children" in t && l(this, t.children), super.props(t);
47
+ }
48
+ mainAxisAlignment(t) {
49
+ return this._mainAxisAlignment = t, this;
50
+ }
51
+ crossAxisAlignment(t) {
52
+ return this._crossAxisAlignment = t, this;
53
+ }
54
+ spacing(t) {
55
+ return this._spacing = t, this;
56
+ }
57
+ size(t) {
58
+ return this._size = t, this;
59
+ }
60
+ build() {
61
+ const t = {
62
+ start: "justify-start",
63
+ center: "justify-center",
64
+ end: "justify-end",
65
+ spaceBetween: "justify-between",
66
+ spaceAround: "justify-around",
67
+ spaceEvenly: "justify-evenly"
68
+ }, r = {
69
+ start: "items-start",
70
+ center: "items-center",
71
+ end: "items-end",
72
+ stretch: "items-stretch"
73
+ }, o = {
74
+ small: "flex-[0.3]",
75
+ medium: "flex-1",
76
+ large: "flex-[1.5]"
77
+ }, i = [
78
+ "fibo-column",
79
+ "flex",
80
+ "flex-col",
81
+ // min-w-0 / min-h-0: shrink inside flex/grid so nested overflow can scroll
82
+ this.isHug() ? "w-auto self-auto" : "w-full min-w-0 min-h-0",
83
+ t[this._mainAxisAlignment],
84
+ r[this._crossAxisAlignment],
85
+ this._size ? o[this._size] : "",
86
+ ...this._classNames
87
+ ], h = this.getStyle(), { nodes: c, rest: p } = B(this.processChildren(), this._props), { className: y, style: u, ...x } = p, A = [...i, y].filter(Boolean).join(" "), b = c.map(z), a = {
88
+ ...h,
89
+ ...u && typeof u == "object" ? u : {}
90
+ };
91
+ return this._spacing != null && this._spacing !== "" && (typeof this._spacing == "number" ? a.gap = `${this._spacing}px` : isNaN(Number(this._spacing)) ? a.gap = this._spacing : a.gap = `${Number(this._spacing) * 4}px`), m.createElement(
92
+ "div",
93
+ {
94
+ style: a,
95
+ ...x,
96
+ className: A
97
+ },
98
+ ...b
99
+ );
100
+ }
101
+ }
102
+ const F = g(I);
103
+ function f(s) {
104
+ return typeof s == "number" ? `${s}px` : s;
105
+ }
106
+ function M(s) {
107
+ return s && typeof s == "object" && !Array.isArray(s) ? s : {};
108
+ }
109
+ class $ extends d {
110
+ constructor() {
111
+ super(...arguments);
112
+ n(this, "_height");
113
+ n(this, "_width");
114
+ n(this, "_grow");
115
+ n(this, "_expand");
116
+ }
117
+ height(t) {
118
+ return this._height = t, this;
119
+ }
120
+ width(t) {
121
+ return this._width = t, this;
122
+ }
123
+ vertical() {
124
+ return this._expand = !0, this;
125
+ }
126
+ horizontal() {
127
+ return this._expand = !0, this;
128
+ }
129
+ /** Grow factor inside a Row or Column. Does not turn the spacer into a flex container. */
130
+ flex(t = 1) {
131
+ const r = typeof t == "number" ? t : Number(t);
132
+ return this._grow = Number.isFinite(r) ? r : 1, this._expand = !0, this;
133
+ }
134
+ build() {
135
+ const { className: t, style: r, ...o } = this._props, i = { ...this.getStyle(), ...M(r) }, h = this._height != null || this._width != null, c = this._expand ?? !h;
136
+ this._height != null && (i.height = f(this._height)), this._width != null && (i.width = f(this._width)), c ? (i.flex = `${this._grow ?? 1} 1 0%`, i.alignSelf = i.alignSelf ?? "stretch", i.minWidth = i.minWidth ?? 0, i.minHeight = i.minHeight ?? 0) : i.flex = "0 0 auto";
137
+ const p = ["fibo-spacer", this.getClassName(), t].filter(Boolean).join(" ");
138
+ return m.createElement("div", {
139
+ ...o,
140
+ style: i,
141
+ className: p,
142
+ "aria-hidden": !0
143
+ });
144
+ }
145
+ }
146
+ const T = g($);
147
+ export {
148
+ F as C,
149
+ T as S
150
+ };