@fluityy/designsystem 0.2.9 → 0.2.10

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as o, jsxs as E } from "react/jsx-runtime";
2
- import { forwardRef as C, useState as F, useRef as H, useEffect as D, createContext as j, useContext as B, useId as we, cloneElement as ke, Children as Ze, Fragment as We, useCallback as V, createElement as qe, useMemo as Ee } from "react";
2
+ import { forwardRef as C, useState as F, useRef as H, useEffect as D, createContext as j, useContext as B, useId as we, cloneElement as ke, Children as Ze, Fragment as We, useCallback as z, createElement as qe, useMemo as Ee } from "react";
3
3
  import { cva as M } from "class-variance-authority";
4
4
  import Ae, { clsx as He } from "clsx";
5
5
  import { twMerge as Ye } from "tailwind-merge";
@@ -446,7 +446,7 @@ const dt = M(
446
446
  primary: "bg-brand-500 text-fg-on-brand",
447
447
  accent: "bg-accent-subtle text-accent-fg",
448
448
  "accent-bold": "bg-accent text-accent-fg",
449
- success: "bg-accent text-accent-fg",
449
+ success: "bg-success text-fg-on-brand",
450
450
  warning: "bg-warning/35 text-fg",
451
451
  danger: "bg-danger/10 text-danger",
452
452
  outline: "border border-border-strong text-fg"
@@ -770,7 +770,7 @@ function Ft({
770
770
  defaultValue: t,
771
771
  onChange: r
772
772
  }) {
773
- const a = e !== void 0, [n, c] = F(t), s = a ? e : n, p = V(
773
+ const a = e !== void 0, [n, c] = F(t), s = a ? e : n, p = z(
774
774
  (d) => {
775
775
  a || c(d), r == null || r(d);
776
776
  },
@@ -1170,7 +1170,7 @@ function Ba({ className: e, ...t }) {
1170
1170
  function Pa({ className: e, ...t }) {
1171
1171
  return /* @__PURE__ */ o("div", { className: x("flex-1 overflow-y-auto p-6", e), ...t });
1172
1172
  }
1173
- function za({ className: e, ...t }) {
1173
+ function Va({ className: e, ...t }) {
1174
1174
  return /* @__PURE__ */ o(
1175
1175
  "div",
1176
1176
  {
@@ -1185,21 +1185,21 @@ const Pe = j(null), Pt = {
1185
1185
  warning: { wrapper: "bg-[var(--color-toast-warning-bg)]", title: "text-fg", description: "text-fg-muted", action: "text-fg hover:text-fg/80" },
1186
1186
  danger: { wrapper: "bg-[var(--color-toast-danger-bg)]", title: "text-danger", description: "text-fg-muted", action: "text-danger hover:text-danger/80" }
1187
1187
  };
1188
- function Va({ children: e }) {
1189
- const [t, r] = F([]), a = H(0), n = V((s) => {
1188
+ function za({ children: e }) {
1189
+ const [t, r] = F([]), a = H(0), n = z((s) => {
1190
1190
  r((p) => p.map((d) => d.id === s ? { ...d, leaving: !0 } : d)), setTimeout(() => {
1191
1191
  r((p) => p.filter((d) => d.id !== s));
1192
1192
  }, 160);
1193
- }, []), c = V((s) => {
1193
+ }, []), c = z((s) => {
1194
1194
  const p = ++a.current;
1195
1195
  return r((d) => [...d, { id: p, variant: "info", duration: 4e3, ...s }]), p;
1196
1196
  }, []);
1197
1197
  return /* @__PURE__ */ E(Pe.Provider, { value: { toast: c, dismiss: n }, children: [
1198
1198
  e,
1199
- /* @__PURE__ */ o(ue, { children: /* @__PURE__ */ o("div", { className: "pointer-events-none fixed bottom-4 right-8 z-[60] flex w-80 max-w-[90vw] flex-col gap-2", children: t.map((s) => /* @__PURE__ */ o(zt, { item: s, onDismiss: () => n(s.id) }, s.id)) }) })
1199
+ /* @__PURE__ */ o(ue, { children: /* @__PURE__ */ o("div", { className: "pointer-events-none fixed bottom-4 right-8 z-[60] flex w-80 max-w-[90vw] flex-col gap-2", children: t.map((s) => /* @__PURE__ */ o(Vt, { item: s, onDismiss: () => n(s.id) }, s.id)) }) })
1200
1200
  ] });
1201
1201
  }
1202
- function zt({ item: e, onDismiss: t }) {
1202
+ function Vt({ item: e, onDismiss: t }) {
1203
1203
  D(() => {
1204
1204
  if (!e.duration) return;
1205
1205
  const a = setTimeout(t, e.duration);
@@ -1248,7 +1248,7 @@ function zt({ item: e, onDismiss: t }) {
1248
1248
  }
1249
1249
  );
1250
1250
  }
1251
- function Vt() {
1251
+ function zt() {
1252
1252
  const e = B(Pe);
1253
1253
  if (!e) throw new Error("useToast precisa estar dentro de <ToastProvider>");
1254
1254
  return e;
@@ -1275,12 +1275,12 @@ const $t = M(
1275
1275
  )
1276
1276
  );
1277
1277
  jt.displayName = "Textarea";
1278
- var Mt = Object.create, ee = Object.defineProperty, Ut = Object.defineProperties, Gt = Object.getOwnPropertyDescriptor, Zt = Object.getOwnPropertyDescriptors, ze = Object.getOwnPropertyNames, J = Object.getOwnPropertySymbols, Wt = Object.getPrototypeOf, de = Object.prototype.hasOwnProperty, Ve = Object.prototype.propertyIsEnumerable, ge = (e, t, r) => t in e ? ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, $ = (e, t) => {
1278
+ var Mt = Object.create, ee = Object.defineProperty, Ut = Object.defineProperties, Gt = Object.getOwnPropertyDescriptor, Zt = Object.getOwnPropertyDescriptors, Ve = Object.getOwnPropertyNames, J = Object.getOwnPropertySymbols, Wt = Object.getPrototypeOf, de = Object.prototype.hasOwnProperty, ze = Object.prototype.propertyIsEnumerable, ge = (e, t, r) => t in e ? ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, $ = (e, t) => {
1279
1279
  for (var r in t || (t = {}))
1280
1280
  de.call(t, r) && ge(e, r, t[r]);
1281
1281
  if (J)
1282
1282
  for (var r of J(t))
1283
- Ve.call(t, r) && ge(e, r, t[r]);
1283
+ ze.call(t, r) && ge(e, r, t[r]);
1284
1284
  return e;
1285
1285
  }, te = (e, t) => Ut(e, Zt(t)), $e = (e, t) => {
1286
1286
  var r = {};
@@ -1288,16 +1288,16 @@ var Mt = Object.create, ee = Object.defineProperty, Ut = Object.defineProperties
1288
1288
  de.call(e, a) && t.indexOf(a) < 0 && (r[a] = e[a]);
1289
1289
  if (e != null && J)
1290
1290
  for (var a of J(e))
1291
- t.indexOf(a) < 0 && Ve.call(e, a) && (r[a] = e[a]);
1291
+ t.indexOf(a) < 0 && ze.call(e, a) && (r[a] = e[a]);
1292
1292
  return r;
1293
1293
  }, qt = (e, t) => function() {
1294
- return t || (0, e[ze(e)[0]])((t = { exports: {} }).exports, t), t.exports;
1294
+ return t || (0, e[Ve(e)[0]])((t = { exports: {} }).exports, t), t.exports;
1295
1295
  }, Ht = (e, t) => {
1296
1296
  for (var r in t)
1297
1297
  ee(e, r, { get: t[r], enumerable: !0 });
1298
1298
  }, Yt = (e, t, r, a) => {
1299
1299
  if (t && typeof t == "object" || typeof t == "function")
1300
- for (let n of ze(t))
1300
+ for (let n of Ve(t))
1301
1301
  !de.call(e, n) && n !== r && ee(e, n, { get: () => t[n], enumerable: !(a = Gt(t, n)) || a.enumerable });
1302
1302
  return e;
1303
1303
  }, Kt = (e, t, r) => (r = e != null ? Mt(Wt(e)) : {}, Yt(
@@ -1750,36 +1750,36 @@ var Mt = Object.create, ee = Object.defineProperty, Ut = Object.defineProperties
1750
1750
  var P = _.pattern.toString().match(/[imsuy]*$/)[0];
1751
1751
  _.pattern = RegExp(_.pattern.source, P + "g");
1752
1752
  }
1753
- for (var pe = _.pattern || _, T = v.next, z = m; T !== i.tail && !(b && z >= b.reach); z += T.value.length, T = T.next) {
1753
+ for (var pe = _.pattern || _, T = v.next, V = m; T !== i.tail && !(b && V >= b.reach); V += T.value.length, T = T.next) {
1754
1754
  var W = T.value;
1755
1755
  if (i.length > l.length)
1756
1756
  return;
1757
1757
  if (!(W instanceof p)) {
1758
1758
  var Y = 1, O;
1759
1759
  if (G) {
1760
- if (O = d(pe, z, l, I), !O || O.index >= l.length)
1760
+ if (O = d(pe, V, l, I), !O || O.index >= l.length)
1761
1761
  break;
1762
- var K = O.index, Ue = O.index + O[0].length, Z = z;
1762
+ var K = O.index, Ue = O.index + O[0].length, Z = V;
1763
1763
  for (Z += T.value.length; K >= Z; )
1764
1764
  T = T.next, Z += T.value.length;
1765
- if (Z -= T.value.length, z = Z, T.value instanceof p)
1765
+ if (Z -= T.value.length, V = Z, T.value instanceof p)
1766
1766
  continue;
1767
1767
  for (var q = T; q !== i.tail && (Z < Ue || typeof q.value == "string"); q = q.next)
1768
1768
  Y++, Z += q.value.length;
1769
- Y--, W = l.slice(z, Z), O.index -= z;
1769
+ Y--, W = l.slice(V, Z), O.index -= V;
1770
1770
  } else if (O = d(pe, 0, W, I), !O)
1771
1771
  continue;
1772
- var K = O.index, X = O[0], re = W.slice(0, K), fe = W.slice(K + X.length), ae = z + W.length;
1772
+ var K = O.index, X = O[0], re = W.slice(0, K), fe = W.slice(K + X.length), ae = V + W.length;
1773
1773
  b && ae > b.reach && (b.reach = ae);
1774
1774
  var Q = T.prev;
1775
- re && (Q = y(i, Q, re), z += re.length), w(i, Q, Y);
1775
+ re && (Q = y(i, Q, re), V += re.length), w(i, Q, Y);
1776
1776
  var Ge = new p(A, R ? s.tokenize(X, R) : X, U, X);
1777
1777
  if (T = y(i, Q, Ge), fe && y(i, T, fe), Y > 1) {
1778
1778
  var ne = {
1779
1779
  cause: A + "," + N,
1780
1780
  reach: ae
1781
1781
  };
1782
- g(l, i, f, T.prev, z, ne), b && ne.reach > b.reach && (b.reach = ne.reach);
1782
+ g(l, i, f, T.prev, V, ne), b && ne.reach > b.reach && (b.reach = ne.reach);
1783
1783
  }
1784
1784
  }
1785
1785
  }
@@ -3922,7 +3922,7 @@ var Jt = {
3922
3922
  }
3923
3923
  }
3924
3924
  ]
3925
- }, Pr = Br, zr = (e) => V(
3925
+ }, Pr = Br, Vr = (e) => z(
3926
3926
  (t) => {
3927
3927
  var r = t, { className: a, style: n, line: c } = r, s = $e(r, ["className", "style", "line"]);
3928
3928
  const p = te($({}, s), {
@@ -3931,8 +3931,8 @@ var Jt = {
3931
3931
  return typeof e == "object" && "plain" in e && (p.style = e.plain), typeof n == "object" && (p.style = $($({}, p.style || {}), n)), p;
3932
3932
  },
3933
3933
  [e]
3934
- ), Vr = (e) => {
3935
- const t = V(
3934
+ ), zr = (e) => {
3935
+ const t = z(
3936
3936
  ({ types: r, empty: a }) => {
3937
3937
  if (e != null) {
3938
3938
  {
@@ -3949,7 +3949,7 @@ var Jt = {
3949
3949
  },
3950
3950
  [e]
3951
3951
  );
3952
- return V(
3952
+ return z(
3953
3953
  (r) => {
3954
3954
  var a = r, { token: n, className: c, style: s } = a, p = $e(a, ["token", "className", "style"]);
3955
3955
  const d = te($({}, p), {
@@ -4030,7 +4030,7 @@ var Jt = {
4030
4030
  theme: a,
4031
4031
  prism: n
4032
4032
  }) => {
4033
- const c = t.toLowerCase(), s = Gr(a, c), p = zr(s), d = Vr(s), g = n.languages[c], h = Mr({ prism: n, language: c, code: r, grammar: g });
4033
+ const c = t.toLowerCase(), s = Gr(a, c), p = Vr(s), d = zr(s), g = n.languages[c], h = Mr({ prism: n, language: c, code: r, grammar: g });
4034
4034
  return e({
4035
4035
  tokens: h,
4036
4036
  className: `prism-code language-${c}`,
@@ -4133,7 +4133,7 @@ const Xr = {
4133
4133
  ]
4134
4134
  }, Qr = C(
4135
4135
  ({ code: e, language: t, className: r, ...a }, n) => {
4136
- const { toast: c } = Vt(), s = Yr(t), p = Kr(s);
4136
+ const { toast: c } = zt(), s = Yr(t), p = Kr(s);
4137
4137
  function d() {
4138
4138
  navigator.clipboard.writeText(e).then(() => {
4139
4139
  c({ title: "Copiado!", variant: "success", duration: 2e3 });
@@ -4143,7 +4143,7 @@ const Xr = {
4143
4143
  "div",
4144
4144
  {
4145
4145
  ref: n,
4146
- className: x("overflow-hidden rounded-lg bg-bg-subtle", r),
4146
+ className: x("overflow-hidden rounded-lg bg-bg-subtle dark:bg-bg-elevated", r),
4147
4147
  ...a,
4148
4148
  children: [
4149
4149
  /* @__PURE__ */ E("div", { className: "flex items-center justify-between bg-bg-muted px-4 py-2", children: [
@@ -4363,25 +4363,25 @@ function Ga({
4363
4363
  const b = (n == null ? void 0 : n()) ?? document.documentElement;
4364
4364
  b.setAttribute("data-theme", k), p && p !== "default" ? b.setAttribute("data-brand", p) : b.removeAttribute("data-brand"), g && g !== "default" ? b.setAttribute("data-radius", g) : b.removeAttribute("data-radius");
4365
4365
  }, [k, p, g, n]);
4366
- const l = V((b) => {
4366
+ const l = z((b) => {
4367
4367
  s(b);
4368
4368
  try {
4369
4369
  localStorage.setItem(he, b);
4370
4370
  } catch {
4371
4371
  }
4372
- }, []), i = V((b) => {
4372
+ }, []), i = z((b) => {
4373
4373
  d(b);
4374
4374
  try {
4375
4375
  localStorage.setItem(ve, b);
4376
4376
  } catch {
4377
4377
  }
4378
- }, []), f = V((b) => {
4378
+ }, []), f = z((b) => {
4379
4379
  h(b);
4380
4380
  try {
4381
4381
  localStorage.setItem(xe, b);
4382
4382
  } catch {
4383
4383
  }
4384
- }, []), v = V(() => {
4384
+ }, []), v = z(() => {
4385
4385
  l(k === "dark" ? "light" : "dark");
4386
4386
  }, [k, l]), m = Ee(
4387
4387
  () => ({ mode: c, resolvedMode: k, brand: p, radius: g, setMode: l, setBrand: i, setRadius: f, toggleMode: v }),
@@ -4877,6 +4877,45 @@ const Wa = [
4877
4877
  isColor: !0,
4878
4878
  reference: null
4879
4879
  },
4880
+ {
4881
+ name: "flui-color-success-50",
4882
+ cssVar: "--flui-color-success-50",
4883
+ path: [
4884
+ "color",
4885
+ "success",
4886
+ "50"
4887
+ ],
4888
+ group: "color",
4889
+ value: "#ecfdf3",
4890
+ isColor: !0,
4891
+ reference: null
4892
+ },
4893
+ {
4894
+ name: "flui-color-success-100",
4895
+ cssVar: "--flui-color-success-100",
4896
+ path: [
4897
+ "color",
4898
+ "success",
4899
+ "100"
4900
+ ],
4901
+ group: "color",
4902
+ value: "#d1fae5",
4903
+ isColor: !0,
4904
+ reference: null
4905
+ },
4906
+ {
4907
+ name: "flui-color-success-300",
4908
+ cssVar: "--flui-color-success-300",
4909
+ path: [
4910
+ "color",
4911
+ "success",
4912
+ "300"
4913
+ ],
4914
+ group: "color",
4915
+ value: "#6ee7a0",
4916
+ isColor: !0,
4917
+ reference: null
4918
+ },
4880
4919
  {
4881
4920
  name: "flui-color-success-500",
4882
4921
  cssVar: "--flui-color-success-500",
@@ -4903,6 +4942,32 @@ const Wa = [
4903
4942
  isColor: !0,
4904
4943
  reference: null
4905
4944
  },
4945
+ {
4946
+ name: "flui-color-success-800",
4947
+ cssVar: "--flui-color-success-800",
4948
+ path: [
4949
+ "color",
4950
+ "success",
4951
+ "800"
4952
+ ],
4953
+ group: "color",
4954
+ value: "#0d3d24",
4955
+ isColor: !0,
4956
+ reference: null
4957
+ },
4958
+ {
4959
+ name: "flui-color-success-900",
4960
+ cssVar: "--flui-color-success-900",
4961
+ path: [
4962
+ "color",
4963
+ "success",
4964
+ "900"
4965
+ ],
4966
+ group: "color",
4967
+ value: "#052e16",
4968
+ isColor: !0,
4969
+ reference: null
4970
+ },
4906
4971
  {
4907
4972
  name: "flui-color-warning-500",
4908
4973
  cssVar: "--flui-color-warning-500",
@@ -5224,9 +5289,9 @@ const Wa = [
5224
5289
  "default"
5225
5290
  ],
5226
5291
  group: "semantic",
5227
- value: "#afd100",
5292
+ value: "#1f9d55",
5228
5293
  isColor: !0,
5229
- reference: "--flui-color-accent-scale-600"
5294
+ reference: "--flui-color-success-500"
5230
5295
  },
5231
5296
  {
5232
5297
  name: "flui-semantic-success-subtle",
@@ -5237,9 +5302,9 @@ const Wa = [
5237
5302
  "subtle"
5238
5303
  ],
5239
5304
  group: "semantic",
5240
- value: "#f3ffb8",
5305
+ value: "#d1fae5",
5241
5306
  isColor: !0,
5242
- reference: "--flui-color-accent-scale-100"
5307
+ reference: "--flui-color-success-100"
5243
5308
  },
5244
5309
  {
5245
5310
  name: "flui-semantic-success-foreground",
@@ -5250,9 +5315,9 @@ const Wa = [
5250
5315
  "foreground"
5251
5316
  ],
5252
5317
  group: "semantic",
5253
- value: "#1a2200",
5318
+ value: "#052e16",
5254
5319
  isColor: !0,
5255
- reference: "--flui-color-accent-scale-900"
5320
+ reference: "--flui-color-success-900"
5256
5321
  },
5257
5322
  {
5258
5323
  name: "flui-semantic-warning-default",
@@ -5751,7 +5816,7 @@ export {
5751
5816
  La as Drawer,
5752
5817
  Pa as DrawerBody,
5753
5818
  Oa as DrawerContent,
5754
- za as DrawerFooter,
5819
+ Va as DrawerFooter,
5755
5820
  Da as DrawerHeader,
5756
5821
  Ba as DrawerTitle,
5757
5822
  ua as Dropdown,
@@ -5788,7 +5853,7 @@ export {
5788
5853
  ha as TabsTrigger,
5789
5854
  jt as Textarea,
5790
5855
  Ga as ThemeProvider,
5791
- Va as ToastProvider,
5856
+ za as ToastProvider,
5792
5857
  Aa as Tooltip,
5793
5858
  dt as badgeVariants,
5794
5859
  Xe as buttonVariants,
@@ -5797,6 +5862,6 @@ export {
5797
5862
  $t as textareaVariants,
5798
5863
  Wa as tokens,
5799
5864
  Za as useTheme,
5800
- Vt as useToast
5865
+ zt as useToast
5801
5866
  };
5802
5867
  //# sourceMappingURL=index.js.map