@mt-gloss/ui 0.1.107 → 0.1.109

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,48 +1,49 @@
1
1
  import { jsx as o, jsxs as m } from "react/jsx-runtime";
2
- import { g as p, d as B, al as g, i as _ } from "./UIContext-DP6JGCto.js";
3
- import b, { useEffect as f } from "react";
4
- const N = function(l) {
5
- const { as: e, htmlFor: s, className: t, ...n } = l;
2
+ import { c as p } from "./BaseText-Dxbk1JJa.js";
3
+ import b, { useEffect as B } from "react";
4
+ import { b as f, ah as g, e as _ } from "./UIContext-Dm0GYHFT.js";
5
+ const h = function(t) {
6
+ const { as: e, htmlFor: s, className: l, ...n } = t;
6
7
  return /* @__PURE__ */ o(
7
8
  p,
8
9
  {
9
10
  as: e || "label",
10
11
  htmlFor: s,
11
- className: t ? `gloss-base-label ${t}` : "gloss-base-label",
12
+ className: l ? `gloss-base-label ${l}` : "gloss-base-label",
12
13
  ...n
13
14
  }
14
15
  );
15
16
  };
16
- N.displayName = "BaseLabel";
17
- const h = function(l) {
18
- const { as: e, className: s, ...t } = l;
17
+ h.displayName = "BaseLabel";
18
+ const N = function(t) {
19
+ const { as: e, className: s, ...l } = t;
19
20
  return /* @__PURE__ */ o(
20
21
  p,
21
22
  {
22
23
  as: e || "span",
23
24
  "data-role": "value",
24
25
  className: s ? `gloss-base-value ${s}` : "gloss-base-value",
25
- ...t
26
+ ...l
26
27
  }
27
28
  );
28
29
  };
29
- h.displayName = "BaseValue";
30
+ N.displayName = "BaseValue";
30
31
  function v({
31
32
  definition: a,
32
- open: l,
33
+ open: t,
33
34
  onDismiss: e,
34
35
  className: s,
35
- style: t,
36
+ style: l,
36
37
  children: n
37
38
  }) {
38
39
  const c = a?.position ?? "top-right", r = a?.duration ?? 0;
39
- f(() => {
40
- if (!l || r <= 0 || !e) return;
40
+ B(() => {
41
+ if (!t || r <= 0 || !e) return;
41
42
  const y = setTimeout(() => {
42
43
  e();
43
44
  }, r);
44
45
  return () => clearTimeout(y);
45
- }, [l, r, e]);
46
+ }, [t, r, e]);
46
47
  const i = {
47
48
  portal: !0,
48
49
  dismissOnClickOutside: !1,
@@ -54,16 +55,16 @@ function v({
54
55
  zIndex: a?.zIndex
55
56
  }, u = ["gloss-base-toast", `gloss-base-toast--${c}`];
56
57
  return s && u.push(s), /* @__PURE__ */ o(
57
- B,
58
+ f,
58
59
  {
59
60
  definition: i,
60
- open: l,
61
+ open: t,
61
62
  onDismiss: e,
62
63
  children: /* @__PURE__ */ o(
63
64
  "div",
64
65
  {
65
66
  className: u.join(" "),
66
- style: t,
67
+ style: l,
67
68
  role: "status",
68
69
  "aria-live": "polite",
69
70
  children: n
@@ -82,11 +83,11 @@ const A = {
82
83
  iconColor: "--_icon-color"
83
84
  };
84
85
  function C(a) {
85
- const { definition: l, className: e, style: s, role: t, children: n, ...c } = a, { style: r, dataAttrs: i } = g(l, A);
86
+ const { definition: t, className: e, style: s, role: l, children: n, ...c } = a, { style: r, dataAttrs: i } = g(t, A);
86
87
  return /* @__PURE__ */ o(
87
88
  "div",
88
89
  {
89
- role: t || "alert",
90
+ role: l || "alert",
90
91
  className: e ? `gloss-base-alert ${e}` : "gloss-base-alert",
91
92
  style: { ...r, ...s },
92
93
  ...i,
@@ -102,8 +103,8 @@ const S = {
102
103
  fontSize: "--_font-size"
103
104
  };
104
105
  function $(a) {
105
- const { definition: l, separator: e = "/", className: s, style: t, children: n } = a, { style: c } = g(
106
- l,
106
+ const { definition: t, separator: e = "/", className: s, style: l, children: n } = a, { style: c } = g(
107
+ t,
107
108
  S
108
109
  ), r = b.Children.toArray(n);
109
110
  return /* @__PURE__ */ o(
@@ -111,7 +112,7 @@ function $(a) {
111
112
  {
112
113
  "aria-label": "Breadcrumb",
113
114
  className: s ? `gloss-base-breadcrumbs-nav ${s}` : "gloss-base-breadcrumbs-nav",
114
- style: { ...c, ...t },
115
+ style: { ...c, ...l },
115
116
  children: /* @__PURE__ */ o("ol", { className: "gloss-base-breadcrumbs", children: r.map((i, d) => {
116
117
  const u = d === r.length - 1;
117
118
  return /* @__PURE__ */ m(b.Fragment, { children: [
@@ -132,10 +133,10 @@ function $(a) {
132
133
  $.displayName = "BaseBreadcrumbs";
133
134
  function T(a) {
134
135
  const {
135
- as: l,
136
+ as: t,
136
137
  definition: e,
137
138
  loading: s = !1,
138
- disabled: t = !1,
139
+ disabled: l = !1,
139
140
  className: n,
140
141
  style: c,
141
142
  children: r,
@@ -147,9 +148,9 @@ function T(a) {
147
148
  return /* @__PURE__ */ m(
148
149
  _,
149
150
  {
150
- as: l,
151
+ as: t,
151
152
  definition: e,
152
- disabled: t || s,
153
+ disabled: l || s,
153
154
  loading: s,
154
155
  className: d,
155
156
  style: c,
@@ -170,8 +171,8 @@ function T(a) {
170
171
  }
171
172
  T.displayName = "BaseAsyncButton";
172
173
  export {
173
- N as B,
174
- h as a,
174
+ h as B,
175
+ N as a,
175
176
  v as b,
176
177
  C as c,
177
178
  $ as d,
@@ -0,0 +1,66 @@
1
+ import { jsx as c } from "react/jsx-runtime";
2
+ function f(r) {
3
+ const { as: n, definition: a, className: s, style: o, children: d, ...l } = r, e = n || "div", i = { ...o };
4
+ a?.padding && (i["--_padding"] = a.padding), a?.paddingX && (i["--_px"] = a.paddingX), a?.paddingY && (i["--_py"] = a.paddingY), a?.margin && (i["--_margin"] = a.margin), a?.gap && (i["--_gap"] = a.gap), a?.bg && (i["--_bg"] = a.bg), a?.border && (i["--_border"] = a.border), a?.radius && (i["--_radius"] = a.radius);
5
+ const t = {};
6
+ return a?.display && (t["data-display"] = a.display), a?.direction && (t["data-direction"] = a.direction), a?.align && (t["data-align"] = a.align), a?.justify && (t["data-justify"] = a.justify), a?.wrap && (t["data-wrap"] = ""), a?.paddingX && (t["data-has-px"] = ""), a?.paddingY && (t["data-has-py"] = ""), /* @__PURE__ */ c(
7
+ e,
8
+ {
9
+ className: s ? `gloss-base-box ${s}` : "gloss-base-box",
10
+ style: i,
11
+ ...t,
12
+ ...l,
13
+ children: d
14
+ }
15
+ );
16
+ }
17
+ f.displayName = "BaseBox";
18
+ function g(r) {
19
+ const { as: n, definition: a, className: s, style: o, ...d } = r, l = n || "hr", e = { ...o };
20
+ a?.color && (e["--_color"] = a.color), a?.thickness && (e["--_thickness"] = a.thickness), a?.spacing && (e["--_spacing"] = a.spacing);
21
+ const i = {};
22
+ return a?.orientation === "vertical" && (i["data-orientation"] = "vertical"), /* @__PURE__ */ c(
23
+ l,
24
+ {
25
+ className: s ? `gloss-base-divider ${s}` : "gloss-base-divider",
26
+ style: e,
27
+ ...i,
28
+ ...d
29
+ }
30
+ );
31
+ }
32
+ g.displayName = "BaseDivider";
33
+ function p(r) {
34
+ const { as: n, definition: a, className: s, style: o, children: d, ...l } = r, e = n || "span", i = { ...o };
35
+ a?.fontFamily && (i["--_font-family"] = a.fontFamily), a?.fontSize && (i["--_font-size"] = a.fontSize), a?.fontWeight && (i["--_font-weight"] = a.fontWeight), a?.lineHeight && (i["--_line-height"] = a.lineHeight), a?.letterSpacing && (i["--_letter-spacing"] = a.letterSpacing), a?.color && (i["--_color"] = a.color);
36
+ const t = {};
37
+ return a?.align && (t["data-align"] = a.align), a?.truncate && (t["data-truncate"] = ""), a?.wrap && (t["data-wrap"] = a.wrap), /* @__PURE__ */ c(
38
+ e,
39
+ {
40
+ className: s ? `gloss-base-typography ${s}` : "gloss-base-typography",
41
+ style: i,
42
+ ...t,
43
+ ...l,
44
+ children: d
45
+ }
46
+ );
47
+ }
48
+ p.displayName = "BaseTypography";
49
+ const y = function(n) {
50
+ const { as: a, className: s, ...o } = n;
51
+ return /* @__PURE__ */ c(
52
+ p,
53
+ {
54
+ as: a || "span",
55
+ className: s ? `gloss-base-text ${s}` : "gloss-base-text",
56
+ ...o
57
+ }
58
+ );
59
+ };
60
+ y.displayName = "BaseText";
61
+ export {
62
+ f as B,
63
+ y as a,
64
+ g as b,
65
+ p as c
66
+ };