@sequenceholdings/atlas-ui 3.7.1 → 4.1.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.
@@ -4,12 +4,12 @@ import { jsx as t, jsxs as n } from "react/jsx-runtime";
4
4
  function r({ options: r, value: i, onChange: a, className: o, size: s = "default" }) {
5
5
  return /* @__PURE__ */ t("div", {
6
6
  "data-slot": "segmented-control",
7
- className: e("inline-flex w-fit items-center rounded-md bg-muted dark:bg-card p-0.5", s === "touch" ? "h-11" : "h-8", o),
7
+ className: e("inline-flex w-fit items-center rounded-md bg-muted dark:bg-foreground/5 p-0.5", s === "touch" ? "h-11" : "h-8", o),
8
8
  children: r.map((t) => /* @__PURE__ */ n("button", {
9
9
  type: "button",
10
10
  onClick: () => i !== t.value && a(t.value),
11
11
  "aria-pressed": i === t.value,
12
- className: e("inline-flex cursor-pointer items-center gap-1.5 rounded-sm border px-2.5 text-xs font-medium transition-colors", s === "touch" ? "h-10" : "h-7", i === t.value ? "border-border bg-card dark:bg-muted text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"),
12
+ className: e("inline-flex cursor-pointer items-center gap-1.5 rounded-sm border px-2.5 text-xs font-medium transition-colors", s === "touch" ? "h-10" : "h-7", i === t.value ? "border-border bg-card dark:bg-foreground/12 text-foreground" : "border-transparent text-muted-foreground hover:text-foreground"),
13
13
  children: [t.icon, t.label]
14
14
  }, t.value))
15
15
  });
@@ -5,28 +5,30 @@ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
5
  //#region ../../../atlas/src/shared/components/ui/spinner.tsx
6
6
  var a = t("animate-spin [animation-duration:1.5s] text-muted-foreground", {
7
7
  variants: { size: {
8
+ xs: "",
8
9
  sm: "",
9
10
  default: "",
10
11
  lg: ""
11
12
  } },
12
13
  defaultVariants: { size: "default" }
13
14
  }), o = {
15
+ xs: 12,
14
16
  sm: 16,
15
17
  default: 24,
16
18
  lg: 40
17
19
  };
18
- function s({ size: t = "default", className: s, ...c }) {
19
- let l = t ?? "default";
20
- return /* @__PURE__ */ i("div", {
20
+ function s({ size: t = "default", decorative: s = !1, className: c, ...l }) {
21
+ let u = t ?? "default";
22
+ return /* @__PURE__ */ i("span", {
21
23
  "data-slot": "spinner",
22
- role: "status",
23
- className: e("flex items-center justify-center", s),
24
- ...c,
24
+ ...s ? { "aria-hidden": !0 } : { role: "status" },
25
+ className: e(s ? "inline-flex align-middle" : "flex items-center justify-center", c),
26
+ ...l,
25
27
  children: [/* @__PURE__ */ r(n, {
26
- size: o[l],
28
+ size: o[u],
27
29
  stroke: 1.5,
28
- className: e(a({ size: l }))
29
- }), /* @__PURE__ */ r("span", {
30
+ className: e(a({ size: u }))
31
+ }), !s && /* @__PURE__ */ r("span", {
30
32
  className: "sr-only",
31
33
  children: "Loading"
32
34
  })]
@@ -0,0 +1,40 @@
1
+ import { formatCurrency as e } from "../../lib/format.mjs";
2
+ //#region ../../../atlas/src/shared/components/ui/table-heatmap.ts
3
+ function t(e) {
4
+ let t = Infinity, n = -Infinity;
5
+ for (let r of e) !Number.isFinite(r) || r <= 0 || (t = Math.min(t, r), n = Math.max(n, r));
6
+ return t === Infinity ? {
7
+ min: 0,
8
+ max: 0
9
+ } : {
10
+ min: t,
11
+ max: n
12
+ };
13
+ }
14
+ var n = "color-mix(in oklch, var(--chart-danger) 40%, var(--chart-danger-soft))";
15
+ function r(e, t) {
16
+ if (!Number.isFinite(e) || e <= 0) return;
17
+ let r = t.max === t.min ? .5 : (e - t.min) / (t.max - t.min);
18
+ return { backgroundColor: `color-mix(in oklch shorter hue, ${n} ${Math.round(Math.min(Math.max(r, 0), 1) * 100)}%, var(--chart-success-soft))` };
19
+ }
20
+ function i({ periods: t, accessor: n, formatLabel: r, formatValue: i = e, domain: a = "filteredRows" }) {
21
+ return t.map((e) => ({
22
+ id: `period-${e}`,
23
+ header: r(e),
24
+ accessorFn: (t) => n(t)[e] ?? 0,
25
+ sortingFn: "basic",
26
+ cell: ({ getValue: e }) => {
27
+ let t = e();
28
+ return typeof t == "number" && t > 0 ? i(t) : null;
29
+ },
30
+ meta: {
31
+ width: 95,
32
+ minWidth: 95,
33
+ align: "right",
34
+ cellClassName: "text-code tabular-nums",
35
+ heatmap: { domain: a }
36
+ }
37
+ }));
38
+ }
39
+ //#endregion
40
+ export { i as buildHeatmapPeriodColumns, r as heatCellStyle, t as heatmapDomain };
@@ -7,7 +7,7 @@ import { jsx as s } from "react/jsx-runtime";
7
7
  //#region ../../../atlas/src/shared/components/ui/tabs.tsx
8
8
  var c = i, l = t("inline-flex items-center justify-center text-muted-foreground", {
9
9
  variants: { variant: {
10
- default: "h-9 w-fit rounded-lg bg-muted dark:bg-card p-1",
10
+ default: "h-9 w-fit rounded-lg bg-muted dark:bg-foreground/5 p-1",
11
11
  line: "gap-1 bg-transparent",
12
12
  pills: "h-auto w-fit flex-wrap justify-start gap-inline bg-transparent p-0",
13
13
  sidebar: "flex flex-col items-stretch justify-start w-full h-auto bg-transparent p-0 rounded-none gap-0"
@@ -15,7 +15,7 @@ var c = i, l = t("inline-flex items-center justify-center text-muted-foreground"
15
15
  defaultVariants: { variant: "default" }
16
16
  }), u = t("inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", {
17
17
  variants: { variant: {
18
- default: "rounded-md px-3 py-1 data-[state=active]:bg-card dark:data-[state=active]:bg-muted data-[state=active]:text-foreground data-[state=active]:shadow",
18
+ default: "rounded-md px-3 py-1 data-[state=active]:bg-card dark:data-[state=active]:bg-foreground/12 data-[state=active]:text-foreground data-[state=active]:shadow",
19
19
  line: "rounded-none border-b-2 border-transparent px-3 py-2 text-muted-foreground hover:text-foreground/80 data-[state=active]:border-primary data-[state=active]:text-primary",
20
20
  pills: "gap-inline rounded-full border border-border bg-card px-default py-compact text-control-sm text-foreground-secondary data-[state=active]:bg-foreground/8 data-[state=active]:text-foreground",
21
21
  sidebar: "rounded-md px-3 py-1 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow"
@@ -1,37 +1,37 @@
1
1
  import { cn as e } from "../../lib/utils.mjs";
2
- import { toggleVariants as t } from "./toggle.mjs";
3
- import { Item as n, Root as r } from "../../../vendor/@radix-ui_react-toggle-group@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.14__@type_f53932d1010514ee55ce15134943c7f6/dist/index.mjs";
4
- import * as i from "react";
5
- import { jsx as a } from "react/jsx-runtime";
2
+ import { omitDataState as t, toggleVariants as n } from "./toggle.mjs";
3
+ import { Item as r, Root as i } from "../../../vendor/@radix-ui_react-toggle-group@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.14__@type_f53932d1010514ee55ce15134943c7f6/dist/index.mjs";
4
+ import * as a from "react";
5
+ import { jsx as o } from "react/jsx-runtime";
6
6
  //#region ../../../atlas/src/shared/components/ui/toggle-group.tsx
7
- var o = i.createContext({
7
+ var s = a.createContext({
8
8
  size: "default",
9
9
  variant: "default"
10
- }), s = i.forwardRef(({ className: t, variant: n, size: i, children: s, ...c }, l) => /* @__PURE__ */ a(r, {
10
+ }), c = a.forwardRef(({ className: t, variant: n, size: r, children: a, ...c }, l) => /* @__PURE__ */ o(i, {
11
11
  ref: l,
12
12
  className: e("flex items-center justify-center gap-1", t),
13
13
  ...c,
14
- children: /* @__PURE__ */ a(o.Provider, {
14
+ children: /* @__PURE__ */ o(s.Provider, {
15
15
  value: {
16
16
  variant: n,
17
- size: i
17
+ size: r
18
18
  },
19
- children: s
19
+ children: a
20
20
  })
21
21
  }));
22
- s.displayName = r.displayName;
23
- var c = i.forwardRef(({ className: r, children: s, variant: c, size: l, ...u }, d) => {
24
- let f = i.useContext(o);
25
- return /* @__PURE__ */ a(n, {
26
- ref: d,
27
- className: e(t({
28
- variant: f.variant ?? c,
29
- size: f.size ?? l
30
- }), r),
31
- ...u,
32
- children: s
22
+ c.displayName = i.displayName;
23
+ var l = a.forwardRef(({ className: i, children: c, variant: l, size: u, ...d }, f) => {
24
+ let p = a.useContext(s);
25
+ return /* @__PURE__ */ o(r, {
26
+ ref: f,
27
+ className: e(n({
28
+ variant: p.variant ?? l,
29
+ size: p.size ?? u
30
+ }), i),
31
+ ...t(d),
32
+ children: c
33
33
  });
34
34
  });
35
- c.displayName = n.displayName;
35
+ l.displayName = r.displayName;
36
36
  //#endregion
37
- export { s as ToggleGroup, c as ToggleGroupItem };
37
+ export { c as ToggleGroup, l as ToggleGroupItem };
@@ -4,11 +4,11 @@ import { Root as n } from "../../../vendor/@radix-ui_react-toggle@1.1.10_@types_
4
4
  import * as r from "react";
5
5
  import { jsx as i } from "react/jsx-runtime";
6
6
  //#region ../../../atlas/src/shared/components/ui/toggle.tsx
7
- var a = t("inline-flex cursor-pointer items-center justify-center gap-2 rounded-control text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-icon [&_svg]:shrink-0", {
7
+ var a = t("inline-flex cursor-pointer items-center justify-center gap-2 rounded-control text-sm font-medium text-muted-foreground transition-colors hover:bg-foreground/5 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-foreground/12 data-[state=on]:text-foreground [&_svg]:pointer-events-none [&_svg]:size-icon [&_svg]:shrink-0", {
8
8
  variants: {
9
9
  variant: {
10
10
  default: "bg-transparent",
11
- outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"
11
+ outline: "border border-input bg-card shadow-sm data-[state=on]:border-border-strong"
12
12
  },
13
13
  size: {
14
14
  default: "h-9 px-2 min-w-9",
@@ -20,15 +20,20 @@ var a = t("inline-flex cursor-pointer items-center justify-center gap-2 rounded-
20
20
  variant: "default",
21
21
  size: "default"
22
22
  }
23
- }), o = r.forwardRef(({ className: t, variant: r, size: o, ...s }, c) => /* @__PURE__ */ i(n, {
24
- ref: c,
23
+ });
24
+ function o(e) {
25
+ let { "data-state": t, ...n } = e;
26
+ return n;
27
+ }
28
+ var s = r.forwardRef(({ className: t, variant: r, size: s, ...c }, l) => /* @__PURE__ */ i(n, {
29
+ ref: l,
25
30
  className: e(a({
26
31
  variant: r,
27
- size: o,
32
+ size: s,
28
33
  className: t
29
34
  })),
30
- ...s
35
+ ...o(c)
31
36
  }));
32
- o.displayName = n.displayName;
37
+ s.displayName = n.displayName;
33
38
  //#endregion
34
- export { o as Toggle, a as toggleVariants };
39
+ export { s as Toggle, o as omitDataState, a as toggleVariants };
@@ -1,25 +1,28 @@
1
1
  import { useAppClassName as e, usePortalContainer as t } from "../../contexts/PortalContainerContext.mjs";
2
2
  import * as n from "react";
3
3
  //#region ../../../atlas/src/shared/components/ui/use-overlay-portal-target.ts
4
- function r({ container: r, escapeMfeContainment: i, fallbackId: a }) {
5
- let o = t(), s = e(), [c, l] = n.useState(null), u = !r && i ? o?.closest("[data-mfe-container]")?.getAttribute("data-overlay-portal-class") ?? null : null, d = !r && i ? o?.closest("[data-mfe-container]")?.getAttribute("data-overlay-portal-theme") ?? null : null, f = !r && i && o?.closest("[data-mfe-container]") != null ? null : o;
4
+ var r = n.createContext(!0);
5
+ function i({ container: i, escapeMfeContainment: a, fallbackId: o }) {
6
+ let s = t(), c = e(), l = n.useContext(r), [u, d] = n.useState(null), f = n.useRef(null), p = !i && a ? s?.closest("[data-mfe-container]")?.getAttribute("data-overlay-portal-class") ?? null : null, m = !i && a ? s?.closest("[data-mfe-container]")?.getAttribute("data-overlay-portal-theme") ?? null : null, h = !i && a && s?.closest("[data-mfe-container]") != null ? null : s;
6
7
  return n.useLayoutEffect(() => {
7
- if (r || f) {
8
- l(null);
8
+ if (i || h) {
9
+ f.current?.remove(), f.current = null, d(null);
9
10
  return;
10
11
  }
12
+ if (!l) return;
11
13
  let e = document.createElement("div");
12
- e.id = a;
13
- let t = [s, u].filter(Boolean).join(" ");
14
- return t && (e.className = t), d && (e.dataset.theme = d), document.body.appendChild(e), l(e), () => e.remove();
14
+ e.dataset.overlayPortalRoot = o;
15
+ let t = [c, p].filter(Boolean).join(" ");
16
+ t && (e.className = t), m && (e.dataset.theme = m), document.body.appendChild(e), f.current?.remove(), f.current = e, d(e);
15
17
  }, [
16
- r,
17
- f,
18
- s,
19
- u,
20
- d,
21
- a
22
- ]), r ?? f ?? c ?? void 0;
18
+ l,
19
+ i,
20
+ h,
21
+ c,
22
+ p,
23
+ m,
24
+ o
25
+ ]), n.useLayoutEffect(() => () => f.current?.remove(), []), i ?? h ?? u ?? void 0;
23
26
  }
24
27
  //#endregion
25
- export { r as useOverlayPortalTarget };
28
+ export { r as OverlayOpenContext, i as useOverlayPortalTarget };
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "publishConfig": {
10
10
  "access": "public"
11
11
  },
12
- "version": "3.7.1",
12
+ "version": "4.1.0",
13
13
  "description": "Atlas shared UI component library for Artifact Studio apps",
14
14
  "type": "module",
15
15
  "sideEffects": [