fiboui 2.7.0 → 2.7.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.
package/dist/structure.js CHANGED
@@ -1,5 +1,5 @@
1
- import { au as r, aw as e, av as o } from "./client-CGjHCx8F.js";
2
- import { A as C, B as d, C as i, c as l, d as n, G as T, b as f, L as m, P as p, T as x, a as B } from "./index-C4qvvr03.js";
1
+ import { au as r, aw as e, av as o } from "./client-Bydlscpe.js";
2
+ import { A as C, B as d, C as i, c as l, d as n, G as T, b as f, L as m, P as p, T as x, a as B } from "./index-D4JzwKSP.js";
3
3
  export {
4
4
  C as AssetCard,
5
5
  d as Banner,
package/dist/theme.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aL as s, aF as m, aN as h, aI as T, aO as o, aH as t, aK as r, aM as i, aS as l, aR as n, aP as F, aQ as b, aG as p, aJ as u } from "./client-CGjHCx8F.js";
1
+ import { aL as s, aF as m, aN as h, aI as T, aO as o, aH as t, aK as r, aM as i, aS as l, aR as n, aP as F, aQ as b, aG as p, aJ as u } from "./client-Bydlscpe.js";
2
2
  export {
3
3
  s as FIBO_THEMES,
4
4
  m as FiboThemeProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiboui",
3
- "version": "2.7.0",
3
+ "version": "2.7.1",
4
4
  "description": "Flutter/SwiftUI-inspired React UI — fluent builders, signals, and themes. https://fiboui.vercel.app",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,217 +0,0 @@
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
- };