@photon-ai/pho-ui 4.18.2 → 4.18.4
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/chunks/{bar-chart-B-c6dujU.js → bar-chart-CNCmuhQV.js} +2 -2
- package/dist/chunks/{bar-chart-B-c6dujU.js.map → bar-chart-CNCmuhQV.js.map} +1 -1
- package/dist/chunks/{basic-page-Bfcda8w5.js → basic-page-D_Wgu2pJ.js} +3 -3
- package/dist/chunks/{basic-page-Bfcda8w5.js.map → basic-page-D_Wgu2pJ.js.map} +1 -1
- package/dist/chunks/{chart-PPuzbeXN.js → chart-B5wjhkBu.js} +99 -99
- package/dist/chunks/chart-B5wjhkBu.js.map +1 -0
- package/dist/chunks/{combobox-D4LiGJB2.js → combobox-BJusx5b2.js} +82 -76
- package/dist/chunks/combobox-BJusx5b2.js.map +1 -0
- package/dist/chunks/{line-chart-CNvnFb-M.js → line-chart-BODTNBrX.js} +2 -2
- package/dist/chunks/{line-chart-CNvnFb-M.js.map → line-chart-BODTNBrX.js.map} +1 -1
- package/dist/chunks/popup-anchor-C3_iXdbh.js +40 -0
- package/dist/chunks/popup-anchor-C3_iXdbh.js.map +1 -0
- package/dist/chunks/{select-COFV0NLb.js → select-DU_0zVbn.js} +62 -56
- package/dist/chunks/select-DU_0zVbn.js.map +1 -0
- package/dist/components/bar-chart.js +1 -1
- package/dist/components/chart.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/line-chart.js +1 -1
- package/dist/components/phone-input.js +1 -1
- package/dist/components/scope.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/index.js +4 -4
- package/dist/sections/basic-page.js +1 -1
- package/dist/src/components/chart/scale.d.ts +5 -2
- package/dist/src/components/combobox/combobox.d.ts +1 -1
- package/dist/src/components/select/select.d.ts +1 -1
- package/dist/src/utils/popup-anchor.d.ts +28 -0
- package/package.json +1 -1
- package/dist/chunks/chart-PPuzbeXN.js.map +0 -1
- package/dist/chunks/combobox-D4LiGJB2.js.map +0 -1
- package/dist/chunks/select-COFV0NLb.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"line-chart-
|
|
1
|
+
{"version":3,"file":"line-chart-BODTNBrX.js","names":[],"sources":["../../src/components/line-chart/line-chart.tsx"],"sourcesContent":["import { Chart, ChartLine } from \"../chart/chart\";\nimport type {\n ChartBaseProps,\n ChartCurve,\n ChartDatum,\n ChartGaps,\n} from \"../chart/types\";\n\n/**\n * LineChart — series over time as lines: latency percentiles, one line\n * per destination, a min / average / max where the bounds are dashed.\n *\n * A preset on `Chart`: the `series` array becomes one `Chart.Line` per\n * entry, in order; `curve` and `gaps` apply to every line and `area`\n * washes the surface under the first. The marks, axes, tooltip and legend are the\n * root's.\n */\nexport interface LineChartProps<\n T extends ChartDatum,\n> extends ChartBaseProps<T> {\n /** Straight segments, or a monotone curve that never overshoots a sample. @default \"linear\" */\n curve?: ChartCurve;\n /** A soft fill under the first series (a lone one, as a rule). */\n area?: boolean;\n /**\n * What every line does at a bucket with no value: break there, or\n * connect its neighbours across it — for a measure that has no reading\n * in an empty bucket rather than a reading of nothing. @default \"break\"\n */\n gaps?: ChartGaps;\n}\n\nexport function LineChart<T extends ChartDatum>({\n series,\n curve = \"linear\",\n area = false,\n gaps = \"break\",\n ...props\n}: LineChartProps<T>) {\n return (\n <Chart {...props}>\n {series.map((s, index) => (\n <ChartLine\n key={s.key}\n dataKey={s.key}\n label={s.label}\n color={s.color}\n dashed={s.dashed}\n curve={curve}\n area={area && index === 0}\n gaps={gaps}\n />\n ))}\n </Chart>\n );\n}\n\nLineChart.displayName = \"LineChart\";\n"],"mappings":";;;AAgCA,SAAgB,EAAgC,EAC9C,QAAA,GACA,OAAA,IAAQ,UACR,MAAA,IAAO,IACP,MAAA,IAAO,SACP,GAAG,EAAA,GACiB;AACpB,SACE,gBAAA,EAAC,GAAD;AAAA,IAAO,GAAI;AAAA,IACR,UAAA,EAAO,IAAA,CAAK,GAAG,MACd,gBAAA,EAAC,GAAD;AAAA,MAEE,SAAS,EAAE;AAAA,MACX,OAAO,EAAE;AAAA,MACT,OAAO,EAAE;AAAA,MACT,QAAQ,EAAE;AAAA,MACH,OAAA;AAAA,MACP,MAAM,KAAQ,MAAU;AAAA,MAClB,MAAA;AAAA,IACP,GARM,EAAE,GAQR,CACF;AAAA,EACI,CAAA;AAEX;AAEA,EAAU,cAAc"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext as l, useCallback as p, useContext as i, useMemo as s, useState as f } from "react";
|
|
3
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
4
|
+
var o = l(null);
|
|
5
|
+
function h({ children: e }) {
|
|
6
|
+
const [n, r] = f(null), t = s(() => ({
|
|
7
|
+
element: n,
|
|
8
|
+
register: r
|
|
9
|
+
}), [n]);
|
|
10
|
+
return /* @__PURE__ */ m(o.Provider, {
|
|
11
|
+
value: t,
|
|
12
|
+
children: e
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function C() {
|
|
16
|
+
const e = i(o)?.register;
|
|
17
|
+
return p((n) => e?.(n), [e]);
|
|
18
|
+
}
|
|
19
|
+
function P() {
|
|
20
|
+
const e = i(o)?.element ?? null;
|
|
21
|
+
return s(() => e ? () => ({
|
|
22
|
+
contextElement: e,
|
|
23
|
+
getBoundingClientRect: () => g(e)
|
|
24
|
+
}) : void 0, [e]);
|
|
25
|
+
}
|
|
26
|
+
function g(e) {
|
|
27
|
+
const n = e.getBoundingClientRect(), r = getComputedStyle(e);
|
|
28
|
+
if (!r.transform || r.transform === "none") return n;
|
|
29
|
+
const t = new DOMMatrixReadOnly(r.transform);
|
|
30
|
+
if (!t.is2D || t.b !== 0 || t.c !== 0 || t.a <= 0 || t.d <= 0) return n;
|
|
31
|
+
const [u = 0, c = 0] = r.transformOrigin.split(" ").map((a) => parseFloat(a) || 0);
|
|
32
|
+
return new DOMRect(n.left - t.e - u * (1 - t.a), n.top - t.f - c * (1 - t.d), n.width / t.a, n.height / t.d);
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
P as n,
|
|
36
|
+
C as r,
|
|
37
|
+
h as t
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=popup-anchor-C3_iXdbh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popup-anchor-C3_iXdbh.js","names":[],"sources":["../../src/utils/popup-anchor.tsx"],"sourcesContent":["import {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n type ReactNode,\n} from \"react\";\n\n/**\n * Where a popup anchors when its trigger pulses on press.\n *\n * The press pulse scales the trigger with a transform, and the popup opens on\n * that same press, so Base UI's positioner measures the trigger mid-pulse.\n * Its anchor rect includes the transform, so `--anchor-width` (the popup's\n * width) follows the scale frame by frame. The positioner's own\n * ResizeObserver then sees the popup resize inside its own callback, which the\n * browser reports as \"ResizeObserver loop completed with undelivered\n * notifications\". Anchoring to the trigger's laid-out box, the transform\n * taken back out, keeps the anchor still while the trigger pulses.\n */\nconst PopupAnchorContext = createContext<{\n element: HTMLElement | null;\n register: (element: HTMLElement | null) => void;\n} | null>(null);\n\n/** Holds the pulsing trigger a Root's positioner anchors to. */\nexport function PopupAnchorProvider({ children }: { children: ReactNode }) {\n const [element, register] = useState<HTMLElement | null>(null);\n const value = useMemo(() => ({ element, register }), [element]);\n return (\n <PopupAnchorContext.Provider value={value}>\n {children}\n </PopupAnchorContext.Provider>\n );\n}\n\n/**\n * The ref for a trigger that pulses on press (`usePressPulse`), so the\n * popup it opens anchors to its laid-out box rather than its scaled one.\n * Outside a Pho `Select.Root` or `Combobox.Root` it does nothing.\n */\nexport function usePopupAnchorTrigger() {\n const context = useContext(PopupAnchorContext);\n const register = context?.register;\n return useCallback(\n (element: HTMLElement | null) => register?.(element),\n [register],\n );\n}\n\n/**\n * The positioner's `anchor`: the registered trigger's laid-out box. With no\n * trigger registered (a Combobox anchored to its input, a trigger whose\n * `render` dropped the ref) it is `undefined`, so Base UI keeps its own\n * default anchor; a callback resolving to `null` would clear that anchor and\n * leave the popup unpositioned.\n */\nexport function usePopupAnchor() {\n const element = useContext(PopupAnchorContext)?.element ?? null;\n return useMemo(\n () =>\n element\n ? () => ({\n contextElement: element,\n getBoundingClientRect: () => layoutRect(element),\n })\n : undefined,\n [element],\n );\n}\n\n/**\n * The element's border box as laid out, its own scale undone. Only a scale\n * and a translate (what a press pulse writes) are undone; any other transform\n * leaves the measured rect as it is.\n */\nexport function layoutRect(element: Element): DOMRect {\n const rect = element.getBoundingClientRect();\n const style = getComputedStyle(element);\n if (!style.transform || style.transform === \"none\") return rect;\n const matrix = new DOMMatrixReadOnly(style.transform);\n if (!matrix.is2D || matrix.b !== 0 || matrix.c !== 0) return rect;\n if (matrix.a <= 0 || matrix.d <= 0) return rect;\n // A point x of the box lands at origin + scale * (x - origin) + translate.\n const [originX = 0, originY = 0] = style.transformOrigin\n .split(\" \")\n .map((value) => parseFloat(value) || 0);\n return new DOMRect(\n rect.left - matrix.e - originX * (1 - matrix.a),\n rect.top - matrix.f - originY * (1 - matrix.d),\n rect.width / matrix.a,\n rect.height / matrix.d,\n );\n}\n"],"mappings":";;;AAqBA,IAAM,IAAqB,EAGjB,IAAI;AAGd,SAAgB,EAAoB,EAAE,UAAA,EAAA,GAAqC;AACzE,QAAM,CAAC,GAAS,CAAA,IAAY,EAA6B,IAAI,GACvD,IAAQ,EAAA,OAAe;AAAA,IAAE,SAAA;AAAA,IAAS,UAAA;AAAA,EAAS,IAAI,CAAC,CAAO,CAAC;AAC9D,SACE,gBAAA,EAAC,EAAmB,UAApB;AAAA,IAAoC,OAAA;AAAA,IACjC,UAAA;AAAA,EAC0B,CAAA;AAEjC;AAOA,SAAgB,IAAwB;AAEtC,QAAM,IADU,EAAW,CACV,GAAS;AAC1B,SAAO,EAAA,CACJ,MAAgC,IAAW,CAAO,GACnD,CAAC,CAAQ,CACX;AACF;AASA,SAAgB,IAAiB;AAC/B,QAAM,IAAU,EAAW,CAAkB,GAAG,WAAW;AAC3D,SAAO,EAAA,MAEH,IAAA,OACW;AAAA,IACL,gBAAgB;AAAA,IAChB,uBAAA,MAA6B,EAAW,CAAO;AAAA,EACjD,KACA,QACN,CAAC,CAAO,CACV;AACF;AAOA,SAAgB,EAAW,GAA2B;AACpD,QAAM,IAAO,EAAQ,sBAAsB,GACrC,IAAQ,iBAAiB,CAAO;AACtC,MAAI,CAAC,EAAM,aAAa,EAAM,cAAc,OAAQ,QAAO;AAC3D,QAAM,IAAS,IAAI,kBAAkB,EAAM,SAAS;AAEpD,MADI,CAAC,EAAO,QAAQ,EAAO,MAAM,KAAK,EAAO,MAAM,KAC/C,EAAO,KAAK,KAAK,EAAO,KAAK,EAAG,QAAO;AAE3C,QAAM,CAAC,IAAU,GAAG,IAAU,CAAA,IAAK,EAAM,gBACtC,MAAM,GAAG,EACT,IAAA,CAAK,MAAU,WAAW,CAAK,KAAK,CAAC;AACxC,SAAO,IAAI,QACT,EAAK,OAAO,EAAO,IAAI,KAAW,IAAI,EAAO,IAC7C,EAAK,MAAM,EAAO,IAAI,KAAW,IAAI,EAAO,IAC5C,EAAK,QAAQ,EAAO,GACpB,EAAK,SAAS,EAAO,CACvB;AACF"}
|
|
@@ -1,109 +1,115 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as
|
|
3
|
-
import { SPRING_PRESS_INLINE as
|
|
4
|
-
import { r as
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
2
|
+
import { t as n } from "./cn-ChIgwEl3.js";
|
|
3
|
+
import { SPRING_PRESS_INLINE as u } from "../motion.js";
|
|
4
|
+
import { r as m } from "./use-press-pulse-IbNstUT0.js";
|
|
5
|
+
import { t as g } from "./IconCheck-D2WuculQ.js";
|
|
6
|
+
import { n as h, r as f, t as y } from "./popup-anchor-C3_iXdbh.js";
|
|
7
|
+
import { createContext as b, useContext as x } from "react";
|
|
7
8
|
import { jsx as r } from "react/jsx-runtime";
|
|
8
|
-
import { motion as
|
|
9
|
+
import { motion as v } from "motion/react";
|
|
9
10
|
import { Select as o } from "@base-ui/react/select";
|
|
10
|
-
var
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */ r(
|
|
11
|
+
var p = b(!1), I = 0.99, P = u;
|
|
12
|
+
function N({ multiple: e = !1, ...t }) {
|
|
13
|
+
return /* @__PURE__ */ r(p.Provider, {
|
|
13
14
|
value: !!e,
|
|
14
|
-
children: /* @__PURE__ */ r(o.Root, {
|
|
15
|
+
children: /* @__PURE__ */ r(y, { children: /* @__PURE__ */ r(o.Root, {
|
|
15
16
|
multiple: e,
|
|
16
17
|
...t
|
|
17
|
-
})
|
|
18
|
+
}) })
|
|
18
19
|
});
|
|
19
20
|
}
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
const c =
|
|
23
|
-
scale: c ?
|
|
24
|
-
transition: c ?
|
|
21
|
+
var S = o.Value, w = o.Portal, R = o.List, _ = o.Group, E = n("flex cursor-pointer items-center justify-between gap-2 text-base select-none", "transition-[color,background-color,box-shadow,outline-color] duration-150 ease-out", "data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50", "[&_svg]:text-pho-secondary [&_svg]:size-4");
|
|
22
|
+
function G({ className: e, disabled: t, variant: a = "default", onPointerDown: s, ...i }) {
|
|
23
|
+
const c = a === "inline", { motionProps: l } = m({
|
|
24
|
+
scale: c ? I : 0.98,
|
|
25
|
+
transition: c ? P : void 0,
|
|
25
26
|
disabled: !!t
|
|
26
|
-
});
|
|
27
|
+
}), d = f();
|
|
27
28
|
return /* @__PURE__ */ r(o.Trigger, {
|
|
28
29
|
disabled: t,
|
|
29
30
|
onPointerDown: s,
|
|
30
|
-
render: /* @__PURE__ */ r(
|
|
31
|
-
|
|
31
|
+
render: /* @__PURE__ */ r(v.button, {
|
|
32
|
+
ref: d,
|
|
33
|
+
...l
|
|
34
|
+
}),
|
|
35
|
+
className: n(E, c ? "rounded-base min-w-0 bg-transparent focus-visible:outline-none" : n("bg-pho-primary ring-pho-primary text-pho-primary rounded-base min-w-44 px-3 py-2 ring-1 ring-inset focus-visible:outline-none", "data-[popup-open]:ring-pho-brand focus-visible:ring-pho-brand focus-visible:ring-2 data-[popup-open]:ring-2"), e),
|
|
32
36
|
...i
|
|
33
37
|
});
|
|
34
38
|
}
|
|
35
|
-
function
|
|
39
|
+
function L({ className: e, ...t }) {
|
|
36
40
|
return /* @__PURE__ */ r(o.Icon, {
|
|
37
|
-
className:
|
|
41
|
+
className: n("flex shrink-0 items-center", e),
|
|
38
42
|
...t
|
|
39
43
|
});
|
|
40
44
|
}
|
|
41
|
-
function
|
|
45
|
+
function z({ className: e, sideOffset: t = 6, align: a = "start", alignItemWithTrigger: s = !1, anchor: i, ...c }) {
|
|
46
|
+
const l = h();
|
|
42
47
|
return /* @__PURE__ */ r(o.Positioner, {
|
|
48
|
+
anchor: i ?? l,
|
|
43
49
|
sideOffset: t,
|
|
44
|
-
align:
|
|
50
|
+
align: a,
|
|
45
51
|
alignItemWithTrigger: s,
|
|
46
|
-
className:
|
|
47
|
-
...
|
|
52
|
+
className: n("z-50 outline-none", e),
|
|
53
|
+
...c
|
|
48
54
|
});
|
|
49
55
|
}
|
|
50
|
-
function
|
|
56
|
+
function k({ className: e, ...t }) {
|
|
51
57
|
return /* @__PURE__ */ r(o.Popup, {
|
|
52
|
-
className:
|
|
58
|
+
className: n("bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base max-h-[var(--available-height)] min-w-[var(--anchor-width)] origin-[var(--transform-origin)] overflow-y-auto p-1 ring-1 outline-none ring-inset", "transition-[transform,opacity] duration-[140ms] ease-[cubic-bezier(0.34,1.3,0.64,1)]", "data-[starting-style]:scale-95 data-[starting-style]:opacity-0", "data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-100 data-[ending-style]:ease-out", e),
|
|
53
59
|
...t
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
|
-
function
|
|
62
|
+
function A({ className: e, ...t }) {
|
|
57
63
|
return /* @__PURE__ */ r(o.Item, {
|
|
58
|
-
className:
|
|
64
|
+
className: n("group/pho-item text-pho-secondary grid cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 rounded-[calc(var(--radius-base)-4px)] py-1.5 pr-2.5 pl-2 text-base outline-none select-none", "data-[highlighted]:bg-pho-ghost-hover data-[highlighted]:text-pho-primary data-[disabled]:opacity-50", e),
|
|
59
65
|
...t
|
|
60
66
|
});
|
|
61
67
|
}
|
|
62
|
-
function
|
|
68
|
+
function T({ className: e, ...t }) {
|
|
63
69
|
return /* @__PURE__ */ r(o.ItemText, {
|
|
64
|
-
className:
|
|
70
|
+
className: n("col-start-2 min-w-0", e),
|
|
65
71
|
...t
|
|
66
72
|
});
|
|
67
73
|
}
|
|
68
|
-
function
|
|
69
|
-
const s =
|
|
74
|
+
function j({ className: e, children: t, ...a }) {
|
|
75
|
+
const s = x(p), i = t ?? /* @__PURE__ */ r(g, {});
|
|
70
76
|
return s ? /* @__PURE__ */ r("span", {
|
|
71
77
|
"aria-hidden": !0,
|
|
72
|
-
className:
|
|
78
|
+
className: n("col-start-1 flex size-4 shrink-0 items-center justify-center rounded-sm ring-1 ring-inset", "bg-pho-primary ring-pho-primary text-pho-on-brand", "transition-[background-color,box-shadow,color] duration-150 ease-out", "group-data-[selected]/pho-item:bg-pho-brand-solid group-data-[selected]/pho-item:ring-transparent"),
|
|
73
79
|
children: /* @__PURE__ */ r(o.ItemIndicator, {
|
|
74
|
-
className:
|
|
75
|
-
...
|
|
80
|
+
className: n("flex items-center justify-center [&>svg]:size-3", "transition-[transform,opacity] duration-150 ease-out", "data-[starting-style]:scale-50 data-[starting-style]:opacity-0", "data-[ending-style]:scale-50 data-[ending-style]:opacity-0", e),
|
|
81
|
+
...a,
|
|
76
82
|
children: i
|
|
77
83
|
})
|
|
78
84
|
}) : /* @__PURE__ */ r(o.ItemIndicator, {
|
|
79
|
-
className:
|
|
80
|
-
...
|
|
85
|
+
className: n("text-pho-brand col-start-1 flex size-4 items-center justify-center [&>svg]:size-4", e),
|
|
86
|
+
...a,
|
|
81
87
|
children: i
|
|
82
88
|
});
|
|
83
89
|
}
|
|
84
|
-
function
|
|
90
|
+
function C({ className: e, ...t }) {
|
|
85
91
|
return /* @__PURE__ */ r(o.GroupLabel, {
|
|
86
|
-
className:
|
|
92
|
+
className: n("text-pho-secondary px-2.5 py-1.5 text-xs font-medium", e),
|
|
87
93
|
...t
|
|
88
94
|
});
|
|
89
95
|
}
|
|
90
|
-
var
|
|
91
|
-
Root:
|
|
92
|
-
Trigger:
|
|
93
|
-
Value:
|
|
94
|
-
Icon:
|
|
95
|
-
Portal:
|
|
96
|
-
Positioner:
|
|
97
|
-
Popup:
|
|
98
|
-
List:
|
|
99
|
-
Item:
|
|
100
|
-
ItemText:
|
|
101
|
-
ItemIndicator:
|
|
102
|
-
Group:
|
|
103
|
-
GroupLabel:
|
|
96
|
+
var K = {
|
|
97
|
+
Root: N,
|
|
98
|
+
Trigger: G,
|
|
99
|
+
Value: S,
|
|
100
|
+
Icon: L,
|
|
101
|
+
Portal: w,
|
|
102
|
+
Positioner: z,
|
|
103
|
+
Popup: k,
|
|
104
|
+
List: R,
|
|
105
|
+
Item: A,
|
|
106
|
+
ItemText: T,
|
|
107
|
+
ItemIndicator: j,
|
|
108
|
+
Group: _,
|
|
109
|
+
GroupLabel: C
|
|
104
110
|
};
|
|
105
111
|
export {
|
|
106
|
-
|
|
112
|
+
K as t
|
|
107
113
|
};
|
|
108
114
|
|
|
109
|
-
//# sourceMappingURL=select-
|
|
115
|
+
//# sourceMappingURL=select-DU_0zVbn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-DU_0zVbn.js","names":[],"sources":["../../src/components/select/select.tsx"],"sourcesContent":["import {\n createContext,\n useContext,\n type ComponentProps,\n type ElementType,\n type ReactNode,\n} from \"react\";\nimport { Select as BaseSelect } from \"@base-ui/react/select\";\nimport { SPRING_PRESS_INLINE } from \"../../motion\";\nimport { motion } from \"motion/react\";\nimport { IconCheck } from \"@tabler/icons-react\";\nimport { cn } from \"../../utils/cn\";\nimport {\n PopupAnchorProvider,\n usePopupAnchor,\n usePopupAnchorTrigger,\n} from \"../../utils/popup-anchor\";\nimport { usePressPulse } from \"../../utils/use-press-pulse\";\n\n/** Override Base UI's `string | (state) => string` className with plain string. */\ntype StyledProps<T extends ElementType> = Omit<\n ComponentProps<T>,\n \"className\"\n> & {\n className?: string;\n};\n\n/** Lets `ItemIndicator` know whether the Root is in `multiple` mode. */\nconst SelectMultipleContext = createContext(false);\n\nexport type SelectTriggerVariant = \"default\" | \"inline\";\n\n// Inline rides someone else's surface, so its pulse is shallower and snappier\n// than the default field's (0.98 / stiffness 700) — felt, not seen moving.\nconst INLINE_PRESS_SCALE = 0.99;\nconst INLINE_PRESS_SPRING = SPRING_PRESS_INLINE;\n\nfunction Root({\n multiple = false,\n ...props\n}: ComponentProps<typeof BaseSelect.Root>) {\n return (\n <SelectMultipleContext.Provider value={Boolean(multiple)}>\n <PopupAnchorProvider>\n <BaseSelect.Root multiple={multiple} {...props} />\n </PopupAnchorProvider>\n </SelectMultipleContext.Provider>\n );\n}\n\nconst Value = BaseSelect.Value;\nconst Portal = BaseSelect.Portal;\nconst List = BaseSelect.List;\nconst Group = BaseSelect.Group;\n\n// Shared by both Trigger variants — layout, easing, disabled, icon tone.\nconst TRIGGER_BASE = cn(\n \"flex cursor-pointer items-center justify-between gap-2 text-base select-none\",\n // Colors/stroke ease briefly; transform stays out (Motion owns it).\n \"transition-[color,background-color,box-shadow,outline-color] duration-150 ease-out\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50\",\n \"[&_svg]:text-pho-secondary [&_svg]:size-4\",\n);\n\nfunction Trigger({\n className,\n disabled,\n variant = \"default\",\n onPointerDown,\n ...props\n}: StyledProps<typeof BaseSelect.Trigger> & {\n /**\n * `inline` drops the field chrome (ring, background, padding, min-width)\n * to ride a host surface — an Input Group addon, a toolbar — which then\n * carries the focus/open treatment. The press pulse moves to the arrow.\n * @default \"default\"\n */\n variant?: SelectTriggerVariant;\n}) {\n // One-shot press pulse (fires on pointer-down, always completes) — the\n // Effect Button gesture family adapted for a field-sized control. Both\n // variants pulse the whole trigger; inline is shallower and quicker.\n const inline = variant === \"inline\";\n const { motionProps } = usePressPulse({\n scale: inline ? INLINE_PRESS_SCALE : 0.98,\n transition: inline ? INLINE_PRESS_SPRING : undefined,\n disabled: Boolean(disabled),\n });\n // The pulse scales the trigger as the popup opens: the popup anchors to\n // its laid-out box, so the scale doesn't resize the popup.\n const anchorRef = usePopupAnchorTrigger();\n\n return (\n <BaseSelect.Trigger\n disabled={disabled}\n onPointerDown={onPointerDown}\n // Motion owns transform; a caller-supplied `render` in props still wins.\n render={<motion.button ref={anchorRef} {...motionProps} />}\n className={cn(\n TRIGGER_BASE,\n inline\n ? // Chrome-free: no surface of its own, text inherits the host\n // tone, and the host shows focus (e.g. Input Group's shared ring).\n \"rounded-base min-w-0 bg-transparent focus-visible:outline-none\"\n : cn(\n // Flat field surface — shadows are reserved for floating\n // layers; the 15% ring-pho-primary hairline is the input edge.\n \"bg-pho-primary ring-pho-primary text-pho-primary rounded-base min-w-44 px-3 py-2 ring-1 ring-inset focus-visible:outline-none\",\n // Open or focused, the edge is Input's: the brand ring at 2px,\n // inset, in place of the hairline.\n \"data-[popup-open]:ring-pho-brand focus-visible:ring-pho-brand focus-visible:ring-2 data-[popup-open]:ring-2\",\n ),\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Icon({ className, ...props }: StyledProps<typeof BaseSelect.Icon>) {\n return (\n <BaseSelect.Icon\n className={cn(\"flex shrink-0 items-center\", className)}\n {...props}\n />\n );\n}\n\nfunction Positioner({\n className,\n sideOffset = 6,\n align = \"start\",\n alignItemWithTrigger = false,\n anchor,\n ...props\n}: StyledProps<typeof BaseSelect.Positioner>) {\n const triggerAnchor = usePopupAnchor();\n return (\n <BaseSelect.Positioner\n anchor={anchor ?? triggerAnchor}\n sideOffset={sideOffset}\n align={align}\n // Base UI defaults to the macOS-style overlap (popup covers the trigger\n // so the selected item sits on the value text) — disorienting in a page\n // flow, so Pho drops the list below the field like a menu instead.\n alignItemWithTrigger={alignItemWithTrigger}\n className={cn(\"z-50 outline-none\", className)}\n {...props}\n />\n );\n}\n\nfunction Popup({ className, ...props }: StyledProps<typeof BaseSelect.Popup>) {\n return (\n <BaseSelect.Popup\n className={cn(\n // Floating layer: keeps its elevation shadow, edged with the site\n // hairline (ring-pho-secondary, #eee/#202020).\n \"bg-pho-primary text-pho-primary shadow-pho-lg ring-pho-secondary rounded-base max-h-[var(--available-height)] min-w-[var(--anchor-width)] origin-[var(--transform-origin)] overflow-y-auto p-1 ring-1 outline-none ring-inset\",\n // Effect-Button animation family, faster: the open springs from the\n // trigger edge with a slight overshoot; close is a quick ease-out.\n \"transition-[transform,opacity] duration-[140ms] ease-[cubic-bezier(0.34,1.3,0.64,1)]\",\n \"data-[starting-style]:scale-95 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[ending-style]:duration-100 data-[ending-style]:ease-out\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction Item({ className, ...props }: StyledProps<typeof BaseSelect.Item>) {\n return (\n <BaseSelect.Item\n className={cn(\n // Fixed 1rem leading column: the selection mark lives there, so every\n // label starts at the same x whether or not it is selected.\n // `group/pho-item` feeds the multiple-mode checkbox indicator.\n \"group/pho-item text-pho-secondary grid cursor-pointer grid-cols-[1rem_1fr] items-center gap-2 rounded-[calc(var(--radius-base)-4px)] py-1.5 pr-2.5 pl-2 text-base outline-none select-none\",\n // Secondary at rest; highlight lifts to primary + ghost wash (Menu idiom).\n \"data-[highlighted]:bg-pho-ghost-hover data-[highlighted]:text-pho-primary data-[disabled]:opacity-50\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction ItemText({\n className,\n ...props\n}: StyledProps<typeof BaseSelect.ItemText>) {\n return (\n <BaseSelect.ItemText\n // Pin to column 2: when the single-select indicator unmounts, grid\n // auto-placement would otherwise pull the label into the mark column.\n className={cn(\"col-start-2 min-w-0\", className)}\n {...props}\n />\n );\n}\n\n/**\n * Leading selection mark, mode-aware. Single: a brand check that appears in\n * the reserved column. Multiple: an always-visible checkbox box that fills\n * with the same quiet fill/stroke ease as the standalone Checkbox.\n */\nfunction ItemIndicator({\n className,\n children,\n ...props\n}: StyledProps<typeof BaseSelect.ItemIndicator> & { children?: ReactNode }) {\n const multiple = useContext(SelectMultipleContext);\n const mark = children ?? <IconCheck />;\n\n if (multiple) {\n return (\n <span\n aria-hidden\n className={cn(\n \"col-start-1 flex size-4 shrink-0 items-center justify-center rounded-sm ring-1 ring-inset\",\n \"bg-pho-primary ring-pho-primary text-pho-on-brand\",\n // Fill + stroke ease together on toggle — Checkbox's transition.\n \"transition-[background-color,box-shadow,color] duration-150 ease-out\",\n \"group-data-[selected]/pho-item:bg-pho-brand-solid group-data-[selected]/pho-item:ring-transparent\",\n )}\n >\n <BaseSelect.ItemIndicator\n className={cn(\n \"flex items-center justify-center [&>svg]:size-3\",\n // Glyph pops with the fill; exits on the same path.\n \"transition-[transform,opacity] duration-150 ease-out\",\n \"data-[starting-style]:scale-50 data-[starting-style]:opacity-0\",\n \"data-[ending-style]:scale-50 data-[ending-style]:opacity-0\",\n className,\n )}\n {...props}\n >\n {mark}\n </BaseSelect.ItemIndicator>\n </span>\n );\n }\n\n return (\n <BaseSelect.ItemIndicator\n className={cn(\n \"text-pho-brand col-start-1 flex size-4 items-center justify-center [&>svg]:size-4\",\n className,\n )}\n {...props}\n >\n {mark}\n </BaseSelect.ItemIndicator>\n );\n}\n\nfunction GroupLabel({\n className,\n ...props\n}: StyledProps<typeof BaseSelect.GroupLabel>) {\n return (\n <BaseSelect.GroupLabel\n className={cn(\n \"text-pho-secondary px-2.5 py-1.5 text-xs font-medium\",\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Select built on Base UI `Select` — pick one option (or several with\n * `multiple`) from a list that opens below the trigger on click; the pattern\n * other design systems call a picker. Pass `items` to `Select.Root`, render an\n * `Item` per option, and show the selection with `Select.Value`. For a short,\n * always-visible set use `RadioGroup`; to filter a long list by typing use\n * `Combobox`.\n */\nexport const Select = {\n Root,\n Trigger,\n Value,\n Icon,\n Portal,\n Positioner,\n Popup,\n List,\n Item,\n ItemText,\n ItemIndicator,\n Group,\n GroupLabel,\n};\n"],"mappings":"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"}
|
package/dist/components/chart.js
CHANGED
|
@@ -6,7 +6,7 @@ import { r as E4 } from "../chunks/use-press-pulse-IbNstUT0.js";
|
|
|
6
6
|
import { t as p4 } from "../chunks/IconCheck-D2WuculQ.js";
|
|
7
7
|
import { t as g4 } from "../chunks/IconChevronDown-CZilB71T.js";
|
|
8
8
|
import { t as U } from "../chunks/input-group-fc9_jD4d.js";
|
|
9
|
-
import { t as b } from "../chunks/combobox-
|
|
9
|
+
import { t as b } from "../chunks/combobox-BJusx5b2.js";
|
|
10
10
|
import e, { useEffect as z4, useId as w4, useLayoutEffect as M4, useMemo as le, useRef as H1, useState as re } from "react";
|
|
11
11
|
import { jsx as p, jsxs as M } from "react/jsx-runtime";
|
|
12
12
|
import { motion as F4 } from "motion/react";
|
package/dist/components/scope.js
CHANGED
|
@@ -9,7 +9,7 @@ import { r as ce } from "../chunks/checkbox-CwvoEJhd.js";
|
|
|
9
9
|
import { t as I } from "../chunks/skeleton-DwjSl4vC.js";
|
|
10
10
|
import { t as dt } from "../chunks/ghost-search-8PzP73zS.js";
|
|
11
11
|
import { t as A } from "../chunks/tooltip-BTF7GChl.js";
|
|
12
|
-
import { t as p } from "../chunks/select-
|
|
12
|
+
import { t as p } from "../chunks/select-DU_0zVbn.js";
|
|
13
13
|
import { useEffect as Ne, useId as ut, useLayoutEffect as pt, useMemo as G, useRef as S, useState as X } from "react";
|
|
14
14
|
import { jsx as n, jsxs as a } from "react/jsx-runtime";
|
|
15
15
|
import { AnimatePresence as H, motion as b, useReducedMotion as ht } from "motion/react";
|
package/dist/index.js
CHANGED
|
@@ -26,11 +26,11 @@ import { n as xs, t as zs } from "./chunks/card-N-tvFsuV.js";
|
|
|
26
26
|
import { n as Ys, t as Zs } from "./chunks/dialog-12foDiQb.js";
|
|
27
27
|
import { i as Js, n as Qs, r as qs, t as $s } from "./chunks/status-view-C8tabjDu.js";
|
|
28
28
|
import { t as st } from "./chunks/description-list-BRRQ0oF6.js";
|
|
29
|
-
import { a as rt, c as ot, d as et, f as it, i as St, l as Et, m as _t, n as nt, o as mt, p as At, r as It, s as Tt, t as pt, u as Rt } from "./chunks/basic-page-
|
|
30
|
-
import { a as Ct, i as ut, n as Bt, o as ft, r as Nt, s as Lt, t as Pt } from "./chunks/chart-
|
|
29
|
+
import { a as rt, c as ot, d as et, f as it, i as St, l as Et, m as _t, n as nt, o as mt, p as At, r as It, s as Tt, t as pt, u as Rt } from "./chunks/basic-page-D_Wgu2pJ.js";
|
|
30
|
+
import { a as Ct, i as ut, n as Bt, o as ft, r as Nt, s as Lt, t as Pt } from "./chunks/chart-B5wjhkBu.js";
|
|
31
31
|
import "./components/chart.js";
|
|
32
|
-
import { t as Ot } from "./chunks/bar-chart-
|
|
33
|
-
import { t as Vt } from "./chunks/line-chart-
|
|
32
|
+
import { t as Ot } from "./chunks/bar-chart-CNCmuhQV.js";
|
|
33
|
+
import { t as Vt } from "./chunks/line-chart-BODTNBrX.js";
|
|
34
34
|
import { i as ht, n as Gt, r as Ut, t as Mt } from "./chunks/log-list-tNuCFGlP.js";
|
|
35
35
|
import { n as Ft, t as vt } from "./chunks/bubble-eaoLJP4N.js";
|
|
36
36
|
import { n as wt, r as Wt, t as yt } from "./chunks/message-Dz2-numf.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { i as s } from "../chunks/data-table-T4QKnrxQ.js";
|
|
3
|
-
import { a as E, c as a, d as C, f as S, i as I, l as e, m as o, n as B, o as P, p as N, r, s as t, t as D, u as R } from "../chunks/basic-page-
|
|
3
|
+
import { a as E, c as a, d as C, f as S, i as I, l as e, m as o, n as B, o as P, p as N, r, s as t, t as D, u as R } from "../chunks/basic-page-D_Wgu2pJ.js";
|
|
4
4
|
export {
|
|
5
5
|
D as AUTO_SAVE_DELAY_MS,
|
|
6
6
|
B as BASIC_PAGE_CALLOUT,
|
|
@@ -19,9 +19,12 @@ export declare function niceLinearDomain(min: number, max: number, options?: {
|
|
|
19
19
|
export declare function bucketSpan(times: ReadonlyArray<number>): number;
|
|
20
20
|
/**
|
|
21
21
|
* Time ticks for a plot `width` px wide: one every ~96px, on the round
|
|
22
|
-
* boundaries d3-time picks (5 minutes, an hour, a day, a month…).
|
|
22
|
+
* boundaries d3-time picks (5 minutes, an hour, a day, a month…). A band
|
|
23
|
+
* axis passes the buckets its span covers (one fewer than its columns) as
|
|
24
|
+
* `maxCount`: asking for more makes d3 step finer than the buckets, and a
|
|
25
|
+
* week of daily columns on a wide plot would be labelled at noon.
|
|
23
26
|
*/
|
|
24
|
-
export declare function timeAxisTicks(start: number, stop: number, width: number): Date[];
|
|
27
|
+
export declare function timeAxisTicks(start: number, stop: number, width: number, maxCount?: number): Date[];
|
|
25
28
|
/**
|
|
26
29
|
* Labels a tick by the boundary it sits on: a time within a day, a date at
|
|
27
30
|
* midnight, month and year at a new year. `Intl` does the wording, so the
|
|
@@ -30,7 +30,7 @@ declare function Trigger({ className, variant, disabled, ...props }: StyledProps
|
|
|
30
30
|
}): import("react").JSX.Element;
|
|
31
31
|
/** The glyph at a field trigger's end, `IconSelector` as on `Select`. */
|
|
32
32
|
declare function Icon({ className, ...props }: StyledProps<typeof BaseCombobox.Icon>): import("react").JSX.Element;
|
|
33
|
-
declare function Positioner({ className, sideOffset, ...props }: StyledProps<typeof BaseCombobox.Positioner>): import("react").JSX.Element;
|
|
33
|
+
declare function Positioner({ className, sideOffset, anchor, ...props }: StyledProps<typeof BaseCombobox.Positioner>): import("react").JSX.Element;
|
|
34
34
|
declare function Popup({ className, ...props }: StyledProps<typeof BaseCombobox.Popup>): import("react").JSX.Element;
|
|
35
35
|
declare function List({ className, ...props }: StyledProps<typeof BaseCombobox.List>): import("react").JSX.Element;
|
|
36
36
|
declare function Empty({ className, ...props }: StyledProps<typeof BaseCombobox.Empty>): import("react").JSX.Element;
|
|
@@ -16,7 +16,7 @@ declare function Trigger({ className, disabled, variant, onPointerDown, ...props
|
|
|
16
16
|
variant?: SelectTriggerVariant;
|
|
17
17
|
}): import("react").JSX.Element;
|
|
18
18
|
declare function Icon({ className, ...props }: StyledProps<typeof BaseSelect.Icon>): import("react").JSX.Element;
|
|
19
|
-
declare function Positioner({ className, sideOffset, align, alignItemWithTrigger, ...props }: StyledProps<typeof BaseSelect.Positioner>): import("react").JSX.Element;
|
|
19
|
+
declare function Positioner({ className, sideOffset, align, alignItemWithTrigger, anchor, ...props }: StyledProps<typeof BaseSelect.Positioner>): import("react").JSX.Element;
|
|
20
20
|
declare function Popup({ className, ...props }: StyledProps<typeof BaseSelect.Popup>): import("react").JSX.Element;
|
|
21
21
|
declare function Item({ className, ...props }: StyledProps<typeof BaseSelect.Item>): import("react").JSX.Element;
|
|
22
22
|
declare function ItemText({ className, ...props }: StyledProps<typeof BaseSelect.ItemText>): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/** Holds the pulsing trigger a Root's positioner anchors to. */
|
|
3
|
+
export declare function PopupAnchorProvider({ children }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* The ref for a trigger that pulses on press (`usePressPulse`), so the
|
|
8
|
+
* popup it opens anchors to its laid-out box rather than its scaled one.
|
|
9
|
+
* Outside a Pho `Select.Root` or `Combobox.Root` it does nothing.
|
|
10
|
+
*/
|
|
11
|
+
export declare function usePopupAnchorTrigger(): (element: HTMLElement | null) => void | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* The positioner's `anchor`: the registered trigger's laid-out box. With no
|
|
14
|
+
* trigger registered (a Combobox anchored to its input, a trigger whose
|
|
15
|
+
* `render` dropped the ref) it is `undefined`, so Base UI keeps its own
|
|
16
|
+
* default anchor; a callback resolving to `null` would clear that anchor and
|
|
17
|
+
* leave the popup unpositioned.
|
|
18
|
+
*/
|
|
19
|
+
export declare function usePopupAnchor(): (() => {
|
|
20
|
+
contextElement: HTMLElement;
|
|
21
|
+
getBoundingClientRect: () => DOMRect;
|
|
22
|
+
}) | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* The element's border box as laid out, its own scale undone. Only a scale
|
|
25
|
+
* and a translate (what a press pulse writes) are undone; any other transform
|
|
26
|
+
* leaves the measured rect as it is.
|
|
27
|
+
*/
|
|
28
|
+
export declare function layoutRect(element: Element): DOMRect;
|