@floegence/floe-webapp-core 0.79.0 → 0.80.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.
@@ -1,9 +1,9 @@
1
- import { spread as d, mergeProps as c, insert as n, createComponent as t, memo as g, Dynamic as l, template as u } from "solid-js/web";
2
- import { splitProps as m, Show as b } from "solid-js";
3
- import { cn as a } from "../../utils/cn.js";
4
- import { Loader2 as p } from "../icons/index.js";
5
- var h = /* @__PURE__ */ u("<button type=button data-floe-control=button data-floe-surface-part=action>");
6
- const v = {
1
+ import { spread as u, mergeProps as g, insert as n, createComponent as t, memo as m, Dynamic as b, effect as h, className as f, template as d } from "solid-js/web";
2
+ import { splitProps as p, Show as i } from "solid-js";
3
+ import { cn as s } from "../../utils/cn.js";
4
+ import { Loader2 as v } from "../icons/index.js";
5
+ var x = /* @__PURE__ */ d("<span aria-hidden=true>"), y = /* @__PURE__ */ d("<button type=button data-floe-control=button data-floe-surface-part=action>");
6
+ const w = {
7
7
  default: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-primary/80",
8
8
  primary: "bg-primary text-primary-foreground shadow-sm hover:bg-primary/90 active:bg-primary/80",
9
9
  secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80 active:bg-secondary/70",
@@ -11,57 +11,64 @@ const v = {
11
11
  ghost: "hover:bg-accent hover:text-accent-foreground active:bg-accent/80",
12
12
  "ghost-destructive": "bg-transparent text-muted-foreground hover:bg-error hover:text-error-foreground active:bg-error/80",
13
13
  destructive: "bg-error text-error-foreground shadow-sm hover:bg-error/90 active:bg-error/80"
14
- }, f = {
14
+ }, z = {
15
15
  xs: "h-6 px-2 text-[11px] rounded",
16
16
  sm: "h-7 px-2.5 text-xs rounded",
17
17
  md: "h-8 px-3 text-xs rounded-md",
18
18
  lg: "h-9 px-4 text-sm rounded-md",
19
19
  icon: "h-8 w-8 rounded-md"
20
- }, x = {
20
+ }, S = {
21
21
  xs: "w-3 h-3",
22
22
  sm: "w-3.5 h-3.5",
23
23
  md: "w-3.5 h-3.5",
24
24
  lg: "w-4 h-4",
25
25
  icon: "w-4 h-4"
26
26
  };
27
- function k(i) {
28
- const [r, s] = m(i, ["variant", "size", "loading", "icon", "class", "children", "disabled"]), o = () => x[r.size ?? "md"];
27
+ function P(a) {
28
+ const [e, c] = p(a, ["variant", "size", "loading", "icon", "class", "children", "disabled"]), l = () => S[e.size ?? "md"];
29
29
  return (() => {
30
- var e = h();
31
- return d(e, c({
30
+ var r = y();
31
+ return u(r, g({
32
32
  get "data-floe-surface"() {
33
- return r.variant === "ghost" || r.variant === "ghost-destructive" ? void 0 : "raised";
33
+ return e.variant === "ghost" || e.variant === "ghost-destructive" ? void 0 : "raised";
34
34
  },
35
35
  get class() {
36
- return a("inline-flex items-center justify-center gap-1.5 font-medium cursor-pointer", "transition-[color,background-color,border-color] duration-120", "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed", v[r.variant ?? "default"], f[r.size ?? "md"], r.class);
36
+ return s("inline-flex items-center justify-center gap-1.5 font-medium cursor-pointer", "transition-[color,background-color,border-color] duration-120", "focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", "disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed", w[e.variant ?? "default"], z[e.size ?? "md"], e.class);
37
37
  },
38
38
  get disabled() {
39
- return r.disabled || r.loading;
39
+ return e.disabled || e.loading;
40
+ },
41
+ get "aria-busy"() {
42
+ return e.loading || void 0;
40
43
  }
41
- }, s), !1, !0), n(e, t(b, {
44
+ }, c), !1, !0), n(r, t(i, {
42
45
  get when() {
43
- return r.loading;
44
- },
45
- get fallback() {
46
- return g(() => !!r.icon)() && t(l, {
47
- get component() {
48
- return r.icon;
49
- },
50
- get class() {
51
- return o();
52
- }
53
- });
46
+ return e.icon || "loading" in a;
54
47
  },
55
48
  get children() {
56
- return t(p, {
57
- get class() {
58
- return a(o(), "animate-spin");
49
+ var o = x();
50
+ return n(o, t(i, {
51
+ get when() {
52
+ return e.loading;
53
+ },
54
+ get fallback() {
55
+ return m(() => !!e.icon)() && t(b, {
56
+ get component() {
57
+ return e.icon;
58
+ },
59
+ class: "h-full w-full"
60
+ });
61
+ },
62
+ get children() {
63
+ return t(v, {
64
+ class: "h-full w-full animate-spin"
65
+ });
59
66
  }
60
- });
67
+ })), h(() => f(o, s("inline-flex shrink-0 items-center justify-center", l()))), o;
61
68
  }
62
- }), null), n(e, () => r.children, null), e;
69
+ }), null), n(r, () => e.children, null), r;
63
70
  })();
64
71
  }
65
72
  export {
66
- k as Button
73
+ P as Button
67
74
  };
@@ -0,0 +1,9 @@
1
+ import { type JSX } from 'solid-js';
2
+ export interface StableTextProps {
3
+ children: string;
4
+ /** All transient labels, in the current locale. Only the current label is exposed to assistive technology. */
5
+ reserve: readonly string[];
6
+ class?: string;
7
+ }
8
+ /** Intrinsic sizing includes every state before the first interaction, including wrapped labels. */
9
+ export declare function StableText(props: StableTextProps): JSX.Element;
@@ -0,0 +1,32 @@
1
+ import { insert as a, createComponent as m, effect as o, style as d, className as v, template as c } from "solid-js/web";
2
+ import { For as h } from "solid-js";
3
+ var u = /* @__PURE__ */ c("<span style=display:inline-grid;min-width:0;vertical-align:bottom><span>"), f = /* @__PURE__ */ c("<span aria-hidden=true style=visibility:hidden;pointer-events:none;user-select:none>");
4
+ function p(i) {
5
+ const s = {
6
+ "grid-area": "1 / 1",
7
+ "min-width": "0"
8
+ };
9
+ return (() => {
10
+ var r = u(), n = r.firstChild;
11
+ return a(r, m(h, {
12
+ get each() {
13
+ return i.reserve;
14
+ },
15
+ children: (e) => (() => {
16
+ var t = f();
17
+ return a(t, e), o((l) => d(t, {
18
+ ...s
19
+ }, l)), t;
20
+ })()
21
+ }), n), a(n, () => i.children), o((e) => {
22
+ var t = i.class, l = s;
23
+ return t !== e.e && v(r, e.e = t), e.t = d(n, l, e.t), e;
24
+ }, {
25
+ e: void 0,
26
+ t: void 0
27
+ }), r;
28
+ })();
29
+ }
30
+ export {
31
+ p as StableText
32
+ };
@@ -0,0 +1,8 @@
1
+ import { type JSX } from 'solid-js';
2
+ export interface StatusRegionProps extends Omit<JSX.HTMLAttributes<HTMLDivElement>, 'style'> {
3
+ /** Reserve a bounded number of text lines through idle, pending, success, and failure. */
4
+ lines?: number;
5
+ style?: JSX.CSSProperties;
6
+ }
7
+ /** A persistent, scrollable feedback slot. Long errors remain available without resizing adjacent content. */
8
+ export declare function StatusRegion(props: StatusRegionProps): JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { spread as o, mergeProps as i, insert as s, template as n } from "solid-js/web";
2
+ import { splitProps as a } from "solid-js";
3
+ var p = /* @__PURE__ */ n("<div role=status aria-live=polite>");
4
+ function f(t) {
5
+ const [e, l] = a(t, ["lines", "style", "children"]);
6
+ return (() => {
7
+ var r = p();
8
+ return o(r, i(l, {
9
+ get style() {
10
+ return {
11
+ "block-size": `${e.lines ?? 2}lh`,
12
+ "flex-shrink": "0",
13
+ "min-width": "0",
14
+ overflow: "auto",
15
+ "overflow-wrap": "anywhere",
16
+ ...e.style
17
+ };
18
+ }
19
+ }), !1, !0), s(r, () => e.children), r;
20
+ })();
21
+ }
22
+ export {
23
+ f as StatusRegion
24
+ };
@@ -1,4 +1,6 @@
1
1
  export { Button, type ButtonProps, type ButtonVariant, type ButtonSize } from './Button';
2
+ export { StableText, type StableTextProps } from './StableText';
3
+ export { StatusRegion, type StatusRegionProps } from './StatusRegion';
2
4
  export { intersectSurfaceRects, type SurfaceFloatingBoundary } from './surfaceFloatingBoundary';
3
5
  export { Tag, type TagProps, type TagVariant, type TagSize } from './Tag';
4
6
  export { Input, Textarea, NumberInput, AffixInput, type InputProps, type InputSize, type TextareaProps, type NumberInputProps, type AffixInputProps, type AffixOption, } from './Input';