@fluityy/designsystem 0.2.5 → 0.2.7

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 t, jsxs as u } from "react/jsx-runtime";
2
- import { forwardRef as p, useState as v, useRef as L, useEffect as N, createContext as C, useContext as y, useId as K, cloneElement as q, Children as oe, Fragment as le, useCallback as z, useMemo as se } from "react";
2
+ import { forwardRef as p, useState as v, useRef as L, useEffect as C, createContext as N, useContext as y, useId as K, cloneElement as q, Children as oe, Fragment as le, useCallback as z, useMemo as se } from "react";
3
3
  import { cva as V } from "class-variance-authority";
4
4
  import { clsx as ie } from "clsx";
5
5
  import { twMerge as ce } from "tailwind-merge";
@@ -115,7 +115,7 @@ const pe = p(
115
115
  {
116
116
  ref: a,
117
117
  className: i(
118
- "bg-bg border border-border-default rounded-lg shadow-sm",
118
+ "bg-bg-subtle border border-border-default rounded-lg shadow-sm",
119
119
  e
120
120
  ),
121
121
  ...r
@@ -183,7 +183,7 @@ G.displayName = "Switch";
183
183
  const ye = p(
184
184
  ({ className: e, label: r, indeterminate: a = !1, disabled: n, id: o, ...l }, s) => {
185
185
  const c = L(null);
186
- N(() => {
186
+ C(() => {
187
187
  c.current && (c.current.indeterminate = a);
188
188
  }, [a]);
189
189
  const d = (f) => {
@@ -248,7 +248,7 @@ const ye = p(
248
248
  }
249
249
  );
250
250
  ye.displayName = "Checkbox";
251
- const U = C(null);
251
+ const U = N(null);
252
252
  function ur({
253
253
  value: e,
254
254
  defaultValue: r,
@@ -269,7 +269,7 @@ function ur({
269
269
  }
270
270
  );
271
271
  }
272
- const Ne = p(
272
+ const Ce = p(
273
273
  ({ className: e, value: r, label: a, disabled: n, ...o }, l) => {
274
274
  const s = y(U);
275
275
  if (!s) throw new Error("<Radio> precisa estar dentro de <RadioGroup>");
@@ -315,8 +315,8 @@ const Ne = p(
315
315
  );
316
316
  }
317
317
  );
318
- Ne.displayName = "Radio";
319
- const Ce = V(
318
+ Ce.displayName = "Radio";
319
+ const Ne = V(
320
320
  "w-full appearance-none bg-bg-muted text-fg border border-transparent transition-colors outline-none focus-visible:border-border-strong disabled:opacity-50 disabled:pointer-events-none rounded-lg pr-9",
321
321
  {
322
322
  variants: {
@@ -338,7 +338,7 @@ const Ce = V(
338
338
  "select",
339
339
  {
340
340
  ref: l,
341
- className: i(Ce({ size: r, invalid: a }), e),
341
+ className: i(Ne({ size: r, invalid: a }), e),
342
342
  ...o,
343
343
  children: n
344
344
  }
@@ -360,7 +360,7 @@ const Ce = V(
360
360
  ] })
361
361
  );
362
362
  Ve.displayName = "Select";
363
- const O = C(null);
363
+ const O = N(null);
364
364
  function j() {
365
365
  const e = y(O);
366
366
  if (!e) throw new Error("Componentes de Dropdown precisam estar dentro de <Dropdown>");
@@ -368,7 +368,7 @@ function j() {
368
368
  }
369
369
  function dr({ children: e }) {
370
370
  const [r, a] = v(!1), n = L(null);
371
- return N(() => {
371
+ return C(() => {
372
372
  if (!r) return;
373
373
  const o = (s) => {
374
374
  n.current && !n.current.contains(s.target) && a(!1);
@@ -663,7 +663,7 @@ function je() {
663
663
  }
664
664
  function Be(e, r = 1e3) {
665
665
  const [a, n] = v(0);
666
- return N(() => {
666
+ return C(() => {
667
667
  n(0);
668
668
  const o = performance.now(), l = (s) => {
669
669
  const c = Math.min((s - o) / r, 1), d = 1 - (1 - c) ** 4;
@@ -680,7 +680,7 @@ const _e = p(
680
680
  {
681
681
  ref: f,
682
682
  className: i(
683
- "flex flex-col gap-2 rounded-xl bg-bg-muted dark:bg-neutral-900 p-8 shadow-sm",
683
+ "flex flex-col gap-2 rounded-xl bg-bg-subtle p-8 shadow-sm",
684
684
  e
685
685
  ),
686
686
  ...d,
@@ -778,7 +778,7 @@ function Ke({
778
778
  );
779
779
  return [s, c];
780
780
  }
781
- const $ = C(null);
781
+ const $ = N(null);
782
782
  function B() {
783
783
  const e = y($);
784
784
  if (!e) throw new Error("Componentes de Tabs precisam estar dentro de <Tabs>");
@@ -801,7 +801,7 @@ function br({
801
801
  }
802
802
  function vr({ className: e, children: r, ...a }) {
803
803
  const { value: n } = B(), o = L(null), [l, s] = v({ left: 0, width: 0, ready: !1 });
804
- return N(() => {
804
+ return C(() => {
805
805
  const c = o.current;
806
806
  if (!c) return;
807
807
  const d = c.querySelector('[aria-selected="true"]');
@@ -856,7 +856,7 @@ function wr({ value: e, className: r, ...a }) {
856
856
  }
857
857
  );
858
858
  }
859
- const J = C(null), _ = C("");
859
+ const J = N(null), _ = N("");
860
860
  function Q() {
861
861
  const e = y(J);
862
862
  if (!e) throw new Error("Componentes de Accordion precisam estar dentro de <Accordion>");
@@ -882,10 +882,10 @@ function yr({
882
882
  }
883
883
  ) });
884
884
  }
885
- function Nr({ value: e, children: r, ...a }) {
885
+ function Cr({ value: e, children: r, ...a }) {
886
886
  return /* @__PURE__ */ t(_.Provider, { value: e, children: /* @__PURE__ */ t("div", { ...a, children: r }) });
887
887
  }
888
- function Cr({
888
+ function Nr({
889
889
  className: e,
890
890
  children: r,
891
891
  ...a
@@ -953,7 +953,7 @@ function kr({ content: e, side: r = "top", children: a, className: n }) {
953
953
  }
954
954
  );
955
955
  }
956
- const X = C(null);
956
+ const X = N(null);
957
957
  function Z() {
958
958
  const e = y(X);
959
959
  if (!e) throw new Error("Componentes de Popover precisam estar dentro de <Popover>");
@@ -961,7 +961,7 @@ function Z() {
961
961
  }
962
962
  function zr({ children: e }) {
963
963
  const [r, a] = v(!1), n = L(null);
964
- return N(() => {
964
+ return C(() => {
965
965
  if (!r) return;
966
966
  const o = (s) => {
967
967
  n.current && !n.current.contains(s.target) && a(!1);
@@ -1001,10 +1001,10 @@ function Tr({
1001
1001
  }
1002
1002
  function R({ children: e }) {
1003
1003
  const [r, a] = v(!1);
1004
- return N(() => a(!0), []), r ? ue(e, document.body) : null;
1004
+ return C(() => a(!0), []), r ? ue(e, document.body) : null;
1005
1005
  }
1006
1006
  function ee(e, r) {
1007
- N(() => {
1007
+ C(() => {
1008
1008
  if (!e) return;
1009
1009
  const a = (o) => o.key === "Escape" && r(), n = document.body.style.overflow;
1010
1010
  return document.body.style.overflow = "hidden", document.addEventListener("keydown", a), () => {
@@ -1012,7 +1012,7 @@ function ee(e, r) {
1012
1012
  };
1013
1013
  }, [e, r]);
1014
1014
  }
1015
- const re = C(null);
1015
+ const re = N(null);
1016
1016
  function Ge({ open: e, onOpenChange: r, children: a }) {
1017
1017
  const n = () => r == null ? void 0 : r(!1);
1018
1018
  return ee(e, n), e ? /* @__PURE__ */ t(R, { children: /* @__PURE__ */ t(re.Provider, { value: { close: n }, children: /* @__PURE__ */ u("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
@@ -1077,7 +1077,7 @@ function Dr({ className: e, ...r }) {
1077
1077
  function Ar({ className: e, ...r }) {
1078
1078
  return /* @__PURE__ */ t("div", { className: i("flex justify-end gap-2 p-6 pt-4", e), ...r });
1079
1079
  }
1080
- const te = C(null), Oe = {
1080
+ const te = N(null), Oe = {
1081
1081
  left: "left-0 top-0 h-full w-[420px] max-w-[96vw] border-r",
1082
1082
  right: "right-0 top-0 h-full w-[420px] max-w-[96vw] border-l",
1083
1083
  top: "top-0 left-0 w-full max-h-[90vh] border-b",
@@ -1154,7 +1154,7 @@ function Rr({ className: e, ...r }) {
1154
1154
  }
1155
1155
  );
1156
1156
  }
1157
- const ae = C(null), Ye = {
1157
+ const ae = N(null), Ye = {
1158
1158
  info: { wrapper: "bg-[var(--color-toast-info-bg)]", title: "text-fg", description: "text-fg-muted", action: "text-primary hover:text-primary/80" },
1159
1159
  success: { wrapper: "bg-[var(--color-toast-success-bg)]", title: "text-success-fg", description: "text-fg-muted", action: "text-success-fg hover:text-success-fg/80" },
1160
1160
  warning: { wrapper: "bg-[var(--color-toast-warning-bg)]", title: "text-fg", description: "text-fg-muted", action: "text-fg hover:text-fg/80" },
@@ -1175,7 +1175,7 @@ function Fr({ children: e }) {
1175
1175
  ] });
1176
1176
  }
1177
1177
  function $e({ item: e, onDismiss: r }) {
1178
- N(() => {
1178
+ C(() => {
1179
1179
  if (!e.duration) return;
1180
1180
  const n = setTimeout(r, e.duration);
1181
1181
  return () => clearTimeout(n);
@@ -1301,8 +1301,8 @@ function rr({
1301
1301
  onSelect: n,
1302
1302
  footerAction: o
1303
1303
  }) {
1304
- const l = (s) => "flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm transition-colors " + (s ? "bg-bg-muted font-medium text-fg" : "text-fg hover:bg-bg-muted");
1305
- return /* @__PURE__ */ u("aside", { className: "flex w-52 shrink-0 flex-col gap-5 overflow-y-auto border-r border-border-default py-5 pl-4 pr-2", children: [
1304
+ const l = (s) => "flex w-full items-center gap-2 rounded-lg px-2 py-1.5 text-left text-sm transition-colors " + (s ? "bg-bg-subtle font-medium text-fg" : "text-fg hover:bg-bg-subtle");
1305
+ return /* @__PURE__ */ u("aside", { className: "flex w-52 shrink-0 flex-col gap-5 overflow-y-auto border-r border-border-default bg-bg py-5 pl-4 pr-2", children: [
1306
1306
  /* @__PURE__ */ u("div", { className: "flex items-center gap-2.5 px-1", children: [
1307
1307
  e.avatar ? /* @__PURE__ */ t(
1308
1308
  "img",
@@ -1364,7 +1364,7 @@ function Wr({
1364
1364
  ] });
1365
1365
  }
1366
1366
  function tr({ children: e }) {
1367
- return /* @__PURE__ */ t("div", { className: "divide-y divide-border-default rounded-xl bg-bg", children: e });
1367
+ return /* @__PURE__ */ t("div", { className: "divide-y divide-border-default rounded-xl bg-bg-elevated", children: e });
1368
1368
  }
1369
1369
  function Hr({
1370
1370
  title: e,
@@ -1383,7 +1383,7 @@ function Kr({
1383
1383
  onConnect: o,
1384
1384
  onDisconnect: l
1385
1385
  }) {
1386
- return /* @__PURE__ */ u("div", { className: "flex items-center gap-4 rounded-xl bg-bg px-4 py-4", children: [
1386
+ return /* @__PURE__ */ u("div", { className: "flex items-center gap-4 rounded-xl bg-bg-elevated px-4 py-4", children: [
1387
1387
  /* @__PURE__ */ t("div", { className: "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-bg-muted", children: /* @__PURE__ */ t("span", { className: "[&>svg]:h-4 [&>svg]:w-4", children: e }) }),
1388
1388
  /* @__PURE__ */ u("div", { className: "flex-1 min-w-0", children: [
1389
1389
  /* @__PURE__ */ t("p", { className: "text-sm font-medium text-fg", children: r }),
@@ -1436,7 +1436,7 @@ function qr({
1436
1436
  ] })
1437
1437
  ] }) }) });
1438
1438
  }
1439
- const ne = C(null), F = "flui-color-mode", W = "flui-brand", H = "flui-radius";
1439
+ const ne = N(null), F = "flui-color-mode", W = "flui-brand", H = "flui-radius";
1440
1440
  function ar() {
1441
1441
  var e;
1442
1442
  return typeof window < "u" && ((e = window.matchMedia) == null ? void 0 : e.call(window, "(prefers-color-scheme: dark)").matches);
@@ -1462,7 +1462,7 @@ function Gr({
1462
1462
  ), [f, g] = v(
1463
1463
  () => I(H, n)
1464
1464
  ), [b, x] = v(ar);
1465
- N(() => {
1465
+ C(() => {
1466
1466
  var E;
1467
1467
  const m = (E = window.matchMedia) == null ? void 0 : E.call(window, "(prefers-color-scheme: dark)");
1468
1468
  if (!m) return;
@@ -1470,7 +1470,7 @@ function Gr({
1470
1470
  return m.addEventListener("change", T), () => m.removeEventListener("change", T);
1471
1471
  }, []);
1472
1472
  const h = l === "system" ? b ? "dark" : "light" : l;
1473
- N(() => {
1473
+ C(() => {
1474
1474
  const m = (o == null ? void 0 : o()) ?? document.documentElement;
1475
1475
  m.setAttribute("data-theme", h), c && c !== "default" ? m.setAttribute("data-brand", c) : m.removeAttribute("data-brand"), f && f !== "default" ? m.setAttribute("data-radius", f) : m.removeAttribute("data-radius");
1476
1476
  }, [h, c, f, o]);
@@ -1806,6 +1806,19 @@ const Or = [
1806
1806
  isColor: !0,
1807
1807
  reference: null
1808
1808
  },
1809
+ {
1810
+ name: "flui-color-neutral-150",
1811
+ cssVar: "--flui-color-neutral-150",
1812
+ path: [
1813
+ "color",
1814
+ "neutral",
1815
+ "150"
1816
+ ],
1817
+ group: "color",
1818
+ value: "#eceef2",
1819
+ isColor: !0,
1820
+ reference: null
1821
+ },
1809
1822
  {
1810
1823
  name: "flui-color-neutral-200",
1811
1824
  cssVar: "--flui-color-neutral-200",
@@ -1923,6 +1936,19 @@ const Or = [
1923
1936
  isColor: !0,
1924
1937
  reference: null
1925
1938
  },
1939
+ {
1940
+ name: "flui-color-neutral-875",
1941
+ cssVar: "--flui-color-neutral-875",
1942
+ path: [
1943
+ "color",
1944
+ "neutral",
1945
+ "875"
1946
+ ],
1947
+ group: "color",
1948
+ value: "#161920",
1949
+ isColor: !0,
1950
+ reference: null
1951
+ },
1926
1952
  {
1927
1953
  name: "flui-color-neutral-900",
1928
1954
  cssVar: "--flui-color-neutral-900",
@@ -2075,9 +2101,22 @@ const Or = [
2075
2101
  "muted"
2076
2102
  ],
2077
2103
  group: "semantic",
2078
- value: "#f3f4f7",
2104
+ value: "#eceef2",
2079
2105
  isColor: !0,
2080
- reference: "--flui-color-neutral-100"
2106
+ reference: "--flui-color-neutral-150"
2107
+ },
2108
+ {
2109
+ name: "flui-semantic-bg-elevated",
2110
+ cssVar: "--flui-semantic-bg-elevated",
2111
+ path: [
2112
+ "semantic",
2113
+ "bg",
2114
+ "elevated"
2115
+ ],
2116
+ group: "semantic",
2117
+ value: "#ffffff",
2118
+ isColor: !0,
2119
+ reference: "--flui-color-neutral-0"
2081
2120
  },
2082
2121
  {
2083
2122
  name: "flui-semantic-fg-default",
@@ -2127,9 +2166,9 @@ const Or = [
2127
2166
  "default"
2128
2167
  ],
2129
2168
  group: "semantic",
2130
- value: "#dde1e9",
2169
+ value: "#eceef2",
2131
2170
  isColor: !0,
2132
- reference: "--flui-color-neutral-200"
2171
+ reference: "--flui-color-neutral-150"
2133
2172
  },
2134
2173
  {
2135
2174
  name: "flui-semantic-border-strong",
@@ -2791,8 +2830,8 @@ const Or = [
2791
2830
  export {
2792
2831
  yr as Accordion,
2793
2832
  Vr as AccordionContent,
2794
- Nr as AccordionItem,
2795
- Cr as AccordionTrigger,
2833
+ Cr as AccordionItem,
2834
+ Nr as AccordionTrigger,
2796
2835
  He as Alert,
2797
2836
  Le as Avatar,
2798
2837
  Y as Badge,
@@ -2833,7 +2872,7 @@ export {
2833
2872
  Mr as PopoverTrigger,
2834
2873
  qr as ProfileSettingsModal,
2835
2874
  Ae as Progress,
2836
- Ne as Radio,
2875
+ Ce as Radio,
2837
2876
  ur as RadioGroup,
2838
2877
  Ve as Select,
2839
2878
  Wr as SettingRow,