@mt-gloss/ui 0.0.13 → 0.0.15

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,223 +0,0 @@
1
- import { jsx as o, jsxs as m } from "react/jsx-runtime";
2
- import { f as b, b as y, aj as p, h as B } from "./UIContext-8dkjkIV1.js";
3
- import u, { useEffect as x } from "react";
4
- const F = {
5
- // Font families (CSS vars)
6
- FontDisplay: "var(--gloss-font-display)",
7
- FontBody: "var(--gloss-font-body)",
8
- FontMono: "var(--gloss-font-mono)",
9
- // Font sizes (CSS vars)
10
- TextXs: "var(--gloss-text-xs)",
11
- TextSm: "var(--gloss-text-sm)",
12
- TextBase: "var(--gloss-text-base)",
13
- TextLg: "var(--gloss-text-lg)",
14
- TextXl: "var(--gloss-text-xl)",
15
- Text2xl: "var(--gloss-text-2xl)",
16
- Text3xl: "var(--gloss-text-3xl)",
17
- Text4xl: "var(--gloss-text-4xl)",
18
- // Line heights (raw values — no SCSS token)
19
- LeadingTight: "1.25",
20
- LeadingNormal: "1.5",
21
- LeadingRelaxed: "1.75",
22
- // Font weights (raw values — no SCSS token)
23
- WeightNormal: "400",
24
- WeightMedium: "500",
25
- WeightSemibold: "600",
26
- WeightBold: "700"
27
- }, f = {
28
- 1: "h1",
29
- 2: "h2",
30
- 3: "h3",
31
- 4: "h4",
32
- 5: "h5",
33
- 6: "h6"
34
- }, N = function(t) {
35
- const { as: a, level: s = 2, className: l, ...r } = t, i = a || f[s];
36
- return /* @__PURE__ */ o(
37
- b,
38
- {
39
- as: i,
40
- className: l ? `gloss-base-title ${l}` : "gloss-base-title",
41
- ...r
42
- }
43
- );
44
- };
45
- N.displayName = "BaseTitle";
46
- const v = function(t) {
47
- const { as: a, htmlFor: s, className: l, ...r } = t;
48
- return /* @__PURE__ */ o(
49
- b,
50
- {
51
- as: a || "label",
52
- htmlFor: s,
53
- className: l ? `gloss-base-label ${l}` : "gloss-base-label",
54
- ...r
55
- }
56
- );
57
- };
58
- v.displayName = "BaseLabel";
59
- const _ = function(t) {
60
- const { as: a, className: s, ...l } = t;
61
- return /* @__PURE__ */ o(
62
- b,
63
- {
64
- as: a || "span",
65
- "data-role": "value",
66
- className: s ? `gloss-base-value ${s}` : "gloss-base-value",
67
- ...l
68
- }
69
- );
70
- };
71
- _.displayName = "BaseValue";
72
- function T({
73
- definition: e,
74
- open: t,
75
- onDismiss: a,
76
- className: s,
77
- style: l,
78
- children: r
79
- }) {
80
- const i = e?.position ?? "top-right", n = e?.duration ?? 0;
81
- x(() => {
82
- if (!t || n <= 0 || !a) return;
83
- const h = setTimeout(() => {
84
- a();
85
- }, n);
86
- return () => clearTimeout(h);
87
- }, [t, n, a]);
88
- const c = {
89
- portal: !0,
90
- dismissOnClickOutside: !1,
91
- dismissOnEscape: !0,
92
- bg: e?.bg,
93
- shadow: e?.shadow,
94
- radius: e?.radius,
95
- padding: e?.padding,
96
- zIndex: e?.zIndex
97
- }, g = ["gloss-base-toast", `gloss-base-toast--${i}`];
98
- return s && g.push(s), /* @__PURE__ */ o(
99
- y,
100
- {
101
- definition: c,
102
- open: t,
103
- onDismiss: a,
104
- children: /* @__PURE__ */ o(
105
- "div",
106
- {
107
- className: g.join(" "),
108
- style: l,
109
- role: "status",
110
- "aria-live": "polite",
111
- children: r
112
- }
113
- )
114
- }
115
- );
116
- }
117
- T.displayName = "BaseToast";
118
- const L = {
119
- bg: "--_bg",
120
- borderColor: "--_border-color",
121
- color: "--_color",
122
- padding: "--_padding",
123
- radius: "--_radius",
124
- iconColor: "--_icon-color"
125
- };
126
- function A(e) {
127
- const { definition: t, className: a, style: s, role: l, children: r, ...i } = e, { style: n, dataAttrs: c } = p(t, L);
128
- return /* @__PURE__ */ o(
129
- "div",
130
- {
131
- role: l || "alert",
132
- className: a ? `gloss-base-alert ${a}` : "gloss-base-alert",
133
- style: { ...n, ...s },
134
- ...c,
135
- ...i,
136
- children: r
137
- }
138
- );
139
- }
140
- A.displayName = "BaseAlert";
141
- const S = {
142
- gap: "--_gap",
143
- color: "--_color",
144
- fontSize: "--_font-size"
145
- };
146
- function C(e) {
147
- const { definition: t, separator: a = "/", className: s, style: l, children: r } = e, { style: i } = p(
148
- t,
149
- S
150
- ), n = u.Children.toArray(r);
151
- return /* @__PURE__ */ o(
152
- "nav",
153
- {
154
- "aria-label": "Breadcrumb",
155
- className: s ? `gloss-base-breadcrumbs-nav ${s}` : "gloss-base-breadcrumbs-nav",
156
- style: { ...i, ...l },
157
- children: /* @__PURE__ */ o("ol", { className: "gloss-base-breadcrumbs", children: n.map((c, d) => {
158
- const g = d === n.length - 1;
159
- return /* @__PURE__ */ m(u.Fragment, { children: [
160
- /* @__PURE__ */ o(
161
- "li",
162
- {
163
- className: "gloss-base-breadcrumbs__item",
164
- ...g ? { "aria-current": "page" } : {},
165
- children: c
166
- }
167
- ),
168
- !g && /* @__PURE__ */ o("li", { className: "gloss-base-breadcrumbs__separator", "aria-hidden": "true", children: a })
169
- ] }, d);
170
- }) })
171
- }
172
- );
173
- }
174
- C.displayName = "BaseBreadcrumbs";
175
- function E(e) {
176
- const {
177
- as: t,
178
- definition: a,
179
- loading: s = !1,
180
- disabled: l = !1,
181
- className: r,
182
- style: i,
183
- children: n,
184
- ...c
185
- } = e, d = [
186
- "gloss-base-async-button",
187
- r
188
- ].filter(Boolean).join(" ");
189
- return /* @__PURE__ */ m(
190
- B,
191
- {
192
- as: t,
193
- definition: a,
194
- disabled: l || s,
195
- loading: s,
196
- className: d,
197
- style: i,
198
- ...c,
199
- children: [
200
- /* @__PURE__ */ o(
201
- "span",
202
- {
203
- className: "gloss-base-async-button__content",
204
- ...s ? { "data-hidden": "" } : {},
205
- children: n
206
- }
207
- ),
208
- s && /* @__PURE__ */ o("span", { className: "gloss-base-async-button__spinner" })
209
- ]
210
- }
211
- );
212
- }
213
- E.displayName = "BaseAsyncButton";
214
- export {
215
- N as B,
216
- F as T,
217
- v as a,
218
- _ as b,
219
- T as c,
220
- A as d,
221
- C as e,
222
- E as f
223
- };