@brett_lamy/ui 5.0.0 → 5.2.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.
- package/dist/components/adaptive-pane.d.ts +12 -1
- package/dist/components/adaptive-pane.d.ts.map +1 -1
- package/dist/components/adaptive-pane.js +122 -19
- package/dist/components/avatar.d.ts +47 -5
- package/dist/components/avatar.d.ts.map +1 -1
- package/dist/components/avatar.js +101 -14
- package/dist/components/breadcrumb.d.ts +87 -0
- package/dist/components/breadcrumb.d.ts.map +1 -0
- package/dist/components/breadcrumb.js +312 -0
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.d.ts.map +1 -0
- package/dist/components/calendar.js +97 -0
- package/dist/components/color-field.d.ts +22 -0
- package/dist/components/color-field.d.ts.map +1 -0
- package/dist/components/color-field.js +60 -0
- package/dist/components/color-picker.d.ts +49 -0
- package/dist/components/color-picker.d.ts.map +1 -0
- package/dist/components/color-picker.js +121 -0
- package/dist/components/command-menu.js +13 -13
- package/dist/components/credenza.d.ts +5 -2
- package/dist/components/credenza.d.ts.map +1 -1
- package/dist/components/credenza.js +62 -60
- package/dist/components/date-field.d.ts +19 -0
- package/dist/components/date-field.d.ts.map +1 -0
- package/dist/components/date-field.js +79 -0
- package/dist/components/date-picker.d.ts +38 -0
- package/dist/components/date-picker.d.ts.map +1 -0
- package/dist/components/date-picker.js +110 -0
- package/dist/components/edge-drawer.d.ts +7 -2
- package/dist/components/edge-drawer.d.ts.map +1 -1
- package/dist/components/edge-drawer.js +7 -4
- package/dist/components/filmstrip.d.ts +19 -0
- package/dist/components/filmstrip.d.ts.map +1 -0
- package/dist/components/filmstrip.js +59 -0
- package/dist/components/filter-input.js +4 -4
- package/dist/components/filter.js +62 -62
- package/dist/components/font-picker.d.ts +67 -0
- package/dist/components/font-picker.d.ts.map +1 -0
- package/dist/components/font-picker.js +373 -0
- package/dist/components/markdown-editor.d.ts +11 -0
- package/dist/components/markdown-editor.d.ts.map +1 -1
- package/dist/components/markdown-editor.js +72 -65
- package/dist/components/navigation-stack.d.ts.map +1 -1
- package/dist/components/navigation-stack.js +75 -65
- package/dist/components/number-morph.d.ts.map +1 -1
- package/dist/components/number-morph.js +5 -5
- package/dist/components/replay-preview.d.ts +2 -2
- package/dist/components/replay-preview.d.ts.map +1 -1
- package/dist/components/replay-preview.js +3 -3
- package/dist/components/result-table.js +10 -10
- package/dist/components/schema-tree.d.ts.map +1 -1
- package/dist/components/schema-tree.js +62 -131
- package/dist/components/segmented.d.ts +1 -1
- package/dist/components/segmented.d.ts.map +1 -1
- package/dist/components/segmented.js +1 -1
- package/dist/components/sidebar.d.ts.map +1 -1
- package/dist/components/sidebar.js +8 -4
- package/dist/components/spinner-shapes.d.ts +36 -0
- package/dist/components/spinner-shapes.d.ts.map +1 -1
- package/dist/components/spinner-shapes.js +105 -0
- package/dist/components/spinner.d.ts +1 -1
- package/dist/components/spinner.d.ts.map +1 -1
- package/dist/components/split-view.d.ts +3 -1
- package/dist/components/split-view.d.ts.map +1 -1
- package/dist/components/split-view.js +211 -211
- package/dist/components/spreadsheet.d.ts +58 -0
- package/dist/components/spreadsheet.d.ts.map +1 -0
- package/dist/components/spreadsheet.js +804 -0
- package/dist/components/sql-console.d.ts.map +1 -1
- package/dist/components/sql-console.js +2 -1
- package/dist/components/sql-editor.js +8 -8
- package/dist/components/stl-viewer.d.ts +3 -0
- package/dist/components/stl-viewer.d.ts.map +1 -0
- package/dist/components/stl-viewer.js +2 -0
- package/dist/components/strudel-player.d.ts +3 -0
- package/dist/components/strudel-player.d.ts.map +1 -0
- package/dist/components/strudel-player.js +2 -0
- package/dist/components/strudel-rack.d.ts +3 -0
- package/dist/components/strudel-rack.d.ts.map +1 -0
- package/dist/components/strudel-rack.js +2 -0
- package/dist/components/strudel-syntax.d.ts +3 -0
- package/dist/components/strudel-syntax.d.ts.map +1 -0
- package/dist/components/strudel-syntax.js +2 -0
- package/dist/components/tabs.js +3 -3
- package/dist/components/tailscale-menu.d.ts +69 -0
- package/dist/components/tailscale-menu.d.ts.map +1 -0
- package/dist/components/tailscale-menu.js +202 -0
- package/dist/components/toggle-group.js +3 -3
- package/dist/components/tree.d.ts +82 -0
- package/dist/components/tree.d.ts.map +1 -0
- package/dist/components/tree.js +494 -0
- package/dist/components/video-preview.d.ts +46 -0
- package/dist/components/video-preview.d.ts.map +1 -0
- package/dist/components/video-preview.js +197 -0
- package/dist/components/video-timeline.d.ts +64 -0
- package/dist/components/video-timeline.d.ts.map +1 -0
- package/dist/components/video-timeline.js +479 -0
- package/dist/components/waveform.d.ts +23 -0
- package/dist/components/waveform.d.ts.map +1 -0
- package/dist/components/waveform.js +56 -0
- package/dist/ffmpeg-worker.js +118 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +53 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +145 -116
- package/dist/lib/csv.d.ts +28 -0
- package/dist/lib/csv.d.ts.map +1 -0
- package/dist/lib/csv.js +90 -0
- package/dist/lib/drawer-swipe.d.ts +31 -0
- package/dist/lib/drawer-swipe.d.ts.map +1 -0
- package/dist/lib/drawer-swipe.js +68 -0
- package/dist/lib/ffmpeg/index.d.ts +117 -0
- package/dist/lib/ffmpeg/index.d.ts.map +1 -0
- package/dist/lib/ffmpeg/index.js +204 -0
- package/dist/lib/ffmpeg/media.d.ts +39 -0
- package/dist/lib/ffmpeg/media.d.ts.map +1 -0
- package/dist/lib/ffmpeg/media.js +100 -0
- package/dist/lib/ffmpeg/react.d.ts +51 -0
- package/dist/lib/ffmpeg/react.d.ts.map +1 -0
- package/dist/lib/ffmpeg/react.js +113 -0
- package/dist/lib/google-fonts.d.ts +47 -0
- package/dist/lib/google-fonts.d.ts.map +1 -0
- package/dist/lib/google-fonts.generated.d.ts +2 -0
- package/dist/lib/google-fonts.generated.d.ts.map +1 -0
- package/dist/lib/google-fonts.generated.js +1925 -0
- package/dist/lib/google-fonts.js +112 -0
- package/dist/lib/icon.d.ts +6 -1
- package/dist/lib/icon.d.ts.map +1 -1
- package/dist/lib/icon.js +2 -0
- package/dist/lib/playback.d.ts +34 -0
- package/dist/lib/playback.d.ts.map +1 -0
- package/dist/lib/playback.js +79 -0
- package/dist/lib/spreadsheet-gpu.d.ts +9 -0
- package/dist/lib/spreadsheet-gpu.d.ts.map +1 -0
- package/dist/lib/spreadsheet-gpu.js +237 -0
- package/dist/lib/spreadsheet.d.ts +82 -0
- package/dist/lib/spreadsheet.d.ts.map +1 -0
- package/dist/lib/spreadsheet.js +162 -0
- package/dist/lib/syntax.d.ts +2 -6
- package/dist/lib/syntax.d.ts.map +1 -1
- package/dist/lib/syntax.js +53 -75
- package/dist/lib/tailscale-connect.d.ts +33 -0
- package/dist/lib/tailscale-connect.d.ts.map +1 -1
- package/dist/lib/tailscale-connect.js +221 -42
- package/dist/lib/tailscale-exit.d.ts +19 -0
- package/dist/lib/tailscale-exit.d.ts.map +1 -0
- package/dist/lib/tailscale-exit.js +14 -0
- package/dist/lib/tailscale-fake.d.ts +8 -0
- package/dist/lib/tailscale-fake.d.ts.map +1 -1
- package/dist/lib/tailscale-fake.js +51 -26
- package/dist/lib/tailscale-roots.d.ts +3 -0
- package/dist/lib/tailscale-roots.d.ts.map +1 -0
- package/dist/lib/tailscale-roots.js +4 -0
- package/dist/lib/tailscale.d.ts +23 -0
- package/dist/lib/tailscale.d.ts.map +1 -1
- package/dist/lib/tailscale.js +156 -94
- package/dist/lib/title-flight.d.ts +4 -0
- package/dist/lib/title-flight.d.ts.map +1 -1
- package/dist/lib/title-flight.js +15 -12
- package/dist/lib/tokens.generated.d.ts +2 -2
- package/dist/lib/tokens.generated.d.ts.map +1 -1
- package/dist/lib/tokens.generated.js +2 -2
- package/dist/lib/video-render.d.ts +38 -0
- package/dist/lib/video-render.d.ts.map +1 -0
- package/dist/lib/video-render.js +147 -0
- package/dist/lib/video-timeline.d.ts +154 -0
- package/dist/lib/video-timeline.d.ts.map +1 -0
- package/dist/lib/video-timeline.js +265 -0
- package/dist/lib/webgpu.d.ts +26 -0
- package/dist/lib/webgpu.d.ts.map +1 -0
- package/dist/lib/webgpu.js +28 -0
- package/dist/theme.css +3 -0
- package/package.json +10 -4
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { Icon as t } from "../lib/icon.js";
|
|
4
|
+
import { Popover as n } from "./popover.js";
|
|
5
|
+
import { Button as r } from "./button.js";
|
|
6
|
+
import { Calendar as i, RangeCalendar as a } from "./calendar.js";
|
|
7
|
+
import { DateInput as o } from "./date-field.js";
|
|
8
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
9
|
+
import { DatePicker as l, DateRangePicker as u, Dialog as d, Group as f, composeRenderProps as p } from "react-aria-components";
|
|
10
|
+
import { cva as m } from "class-variance-authority";
|
|
11
|
+
//#region src/components/date-picker.tsx
|
|
12
|
+
var h = m([
|
|
13
|
+
"flex min-w-0 items-center gap-1 bg-input pl-3 pr-1.5 text-foreground outline-none transition-[box-shadow,background-color] duration-spring-snappy ease-spring-snappy",
|
|
14
|
+
"data-focus-within:bg-transparent data-focus-within:ring-[1.5px] data-focus-within:ring-primary data-focus-within:ring-inset",
|
|
15
|
+
"group-data-open:bg-transparent group-data-open:ring-[1.5px] group-data-open:ring-primary group-data-open:ring-inset",
|
|
16
|
+
"data-invalid:ring-[1.5px] data-invalid:ring-destructive data-invalid:ring-inset data-disabled:cursor-not-allowed data-disabled:opacity-50"
|
|
17
|
+
], {
|
|
18
|
+
variants: { size: {
|
|
19
|
+
sm: "h-8 rounded-lg text-subhead",
|
|
20
|
+
default: "h-11 rounded-ctl text-body",
|
|
21
|
+
lg: "h-[50px] rounded-xl text-body"
|
|
22
|
+
} },
|
|
23
|
+
defaultVariants: { size: "default" }
|
|
24
|
+
});
|
|
25
|
+
function g() {
|
|
26
|
+
return /* @__PURE__ */ s(r, {
|
|
27
|
+
variant: "quiet",
|
|
28
|
+
size: "icon",
|
|
29
|
+
className: "size-8 shrink-0",
|
|
30
|
+
children: /* @__PURE__ */ s(t, {
|
|
31
|
+
name: "calendar",
|
|
32
|
+
size: 18
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function _({ className: t, size: n }) {
|
|
37
|
+
return /* @__PURE__ */ c(f, {
|
|
38
|
+
"data-slot": "date-picker-field",
|
|
39
|
+
className: e(h({ size: n }), t),
|
|
40
|
+
children: [/* @__PURE__ */ s(o, {
|
|
41
|
+
variant: "bare",
|
|
42
|
+
size: n
|
|
43
|
+
}), /* @__PURE__ */ s(g, {})]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
function v({ className: t, size: n }) {
|
|
47
|
+
return /* @__PURE__ */ c(f, {
|
|
48
|
+
"data-slot": "date-range-picker-field",
|
|
49
|
+
className: e(h({ size: n }), t),
|
|
50
|
+
children: [
|
|
51
|
+
/* @__PURE__ */ s(o, {
|
|
52
|
+
variant: "bare",
|
|
53
|
+
size: n,
|
|
54
|
+
slot: "start",
|
|
55
|
+
className: "flex-none"
|
|
56
|
+
}),
|
|
57
|
+
/* @__PURE__ */ s("span", {
|
|
58
|
+
"aria-hidden": "true",
|
|
59
|
+
className: "px-1 text-muted-foreground",
|
|
60
|
+
children: "–"
|
|
61
|
+
}),
|
|
62
|
+
/* @__PURE__ */ s(o, {
|
|
63
|
+
variant: "bare",
|
|
64
|
+
size: n,
|
|
65
|
+
slot: "end"
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ s(g, {})
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
function y({ children: e }) {
|
|
72
|
+
return /* @__PURE__ */ s(d, {
|
|
73
|
+
className: "p-3 outline-none",
|
|
74
|
+
children: e
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function b({ calendarProps: t, children: r, placement: a = "bottom start", className: o, ...c }) {
|
|
78
|
+
return /* @__PURE__ */ s(n, {
|
|
79
|
+
"data-slot": "date-picker-content",
|
|
80
|
+
placement: a,
|
|
81
|
+
...c,
|
|
82
|
+
className: p(o, (t) => e("min-w-0", t)),
|
|
83
|
+
children: /* @__PURE__ */ s(y, { children: r ?? /* @__PURE__ */ s(i, { ...t }) })
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function x({ calendarProps: t, children: r, placement: i = "bottom start", className: o, ...c }) {
|
|
87
|
+
return /* @__PURE__ */ s(n, {
|
|
88
|
+
"data-slot": "date-range-picker-content",
|
|
89
|
+
placement: i,
|
|
90
|
+
...c,
|
|
91
|
+
className: p(o, (t) => e("min-w-0", t)),
|
|
92
|
+
children: /* @__PURE__ */ s(y, { children: r ?? /* @__PURE__ */ s(a, { ...t }) })
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function S({ className: t, ...n }) {
|
|
96
|
+
return /* @__PURE__ */ s(l, {
|
|
97
|
+
"data-slot": "date-picker",
|
|
98
|
+
className: p(t, (t) => e("group flex flex-col gap-1.5", t)),
|
|
99
|
+
...n
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
function C({ className: t, ...n }) {
|
|
103
|
+
return /* @__PURE__ */ s(u, {
|
|
104
|
+
"data-slot": "date-range-picker",
|
|
105
|
+
className: p(t, (t) => e("group flex flex-col gap-1.5", t)),
|
|
106
|
+
...n
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { S as DatePicker, b as DatePickerContent, _ as DatePickerField, C as DateRangePicker, x as DateRangePickerContent, v as DateRangePickerField, h as datePickerFieldVariants };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
1
|
+
import { CSSProperties, HTMLAttributes, ReactNode, Ref } from 'react';
|
|
2
2
|
import { VariantProps } from 'class-variance-authority';
|
|
3
3
|
/** The sliding panel: its edge, and (while open) the lifted shadow. Closed, it waits just past its edge. */
|
|
4
4
|
export declare const edgeDrawerVariants: (props?: ({
|
|
@@ -21,9 +21,14 @@ export interface EdgeDrawerProps extends Pick<VariantProps<typeof edgeDrawerVari
|
|
|
21
21
|
/** Any CSS box-shadow for the open panel, replacing the default lift (`none` for flat). Or pass `shadow-*`
|
|
22
22
|
* utilities in `className`. */
|
|
23
23
|
shadow?: string;
|
|
24
|
+
/** The panel and the scrim, for a host that drives them directly (a drag that follows the finger). */
|
|
25
|
+
panelRef?: Ref<HTMLDivElement>;
|
|
26
|
+
scrimRef?: Ref<HTMLDivElement>;
|
|
27
|
+
/** Extra props for the panel (a gesture's pointer handlers). */
|
|
28
|
+
panelProps?: HTMLAttributes<HTMLDivElement>;
|
|
24
29
|
children?: ReactNode;
|
|
25
30
|
className?: string;
|
|
26
31
|
style?: CSSProperties;
|
|
27
32
|
}
|
|
28
|
-
export declare function EdgeDrawer({ side, open, onClose, width, maxWidth, zIndex, scrimClassName, scrim, shadow, children, className, style, }: EdgeDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export declare function EdgeDrawer({ side, open, onClose, width, maxWidth, zIndex, scrimClassName, scrim, shadow, panelRef, scrimRef, panelProps, children, className, style, }: EdgeDrawerProps): import("react/jsx-runtime").JSX.Element;
|
|
29
34
|
//# sourceMappingURL=edge-drawer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edge-drawer.d.ts","sourceRoot":"","sources":["../../src/components/edge-drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"edge-drawer.d.ts","sourceRoot":"","sources":["../../src/components/edge-drawer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAC3E,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,4GAA4G;AAC5G,eAAO,MAAM,kBAAkB;;;;8EAgB9B,CAAC;AAEF,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,YAAY,CAAC,OAAO,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5F,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACxB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,0FAA0F;IAC1F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,yFAAyF;IACzF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;oCACgC;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sGAAsG;IACtG,QAAQ,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC/B,QAAQ,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;IAC/B,gEAAgE;IAChE,UAAU,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAID,wBAAgB,UAAU,CAAC,EACzB,IAAa,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAW,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EACzF,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,GAC3D,EAAE,eAAe,2CA4CjB"}
|
|
@@ -40,8 +40,9 @@ var a = i("absolute inset-y-0 z-(--edge-drawer-z) transition-[translate,box-shad
|
|
|
40
40
|
lifted: !0
|
|
41
41
|
}
|
|
42
42
|
}), o = (e) => typeof e == "number" ? e + "px" : e;
|
|
43
|
-
function s({ side: i = "left", open: s, onClose: c, width: l, maxWidth: u, zIndex: d = 30, scrimClassName: f, scrim: p, shadow: m,
|
|
43
|
+
function s({ side: i = "left", open: s, onClose: c, width: l, maxWidth: u, zIndex: d = 30, scrimClassName: f, scrim: p, shadow: m, panelRef: h, scrimRef: g, panelProps: _, children: v, className: y, style: b }) {
|
|
44
44
|
return /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n("div", {
|
|
45
|
+
ref: g,
|
|
45
46
|
"data-slot": "edge-drawer-scrim",
|
|
46
47
|
onClick: c,
|
|
47
48
|
className: e("absolute inset-0 z-(--edge-drawer-z) bg-black/45 transition-opacity duration-spring-smooth ease-spring-smooth", s ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0", f, p != null && "bg-(--edge-drawer-scrim)"),
|
|
@@ -50,6 +51,8 @@ function s({ side: i = "left", open: s, onClose: c, width: l, maxWidth: u, zInde
|
|
|
50
51
|
...p == null ? null : { "--edge-drawer-scrim": p }
|
|
51
52
|
}
|
|
52
53
|
}), /* @__PURE__ */ n("div", {
|
|
54
|
+
..._,
|
|
55
|
+
ref: h,
|
|
53
56
|
"data-slot": "edge-drawer",
|
|
54
57
|
"data-side": i,
|
|
55
58
|
"data-open": s,
|
|
@@ -59,15 +62,15 @@ function s({ side: i = "left", open: s, onClose: c, width: l, maxWidth: u, zInde
|
|
|
59
62
|
side: i,
|
|
60
63
|
open: s,
|
|
61
64
|
lifted: m == null
|
|
62
|
-
}), l != null && "w-(--edge-drawer-w)", u != null && "max-w-(--edge-drawer-max-w)", m != null && s && "[box-shadow:var(--edge-drawer-shadow)]",
|
|
65
|
+
}), l != null && "w-(--edge-drawer-w)", u != null && "max-w-(--edge-drawer-max-w)", m != null && s && "[box-shadow:var(--edge-drawer-shadow)]", y),
|
|
63
66
|
style: {
|
|
64
67
|
"--edge-drawer-z": d + 1,
|
|
65
68
|
...l == null ? null : { "--edge-drawer-w": o(l) },
|
|
66
69
|
...u == null ? null : { "--edge-drawer-max-w": o(u) },
|
|
67
70
|
...m == null ? null : { "--edge-drawer-shadow": m },
|
|
68
|
-
...
|
|
71
|
+
...b
|
|
69
72
|
},
|
|
70
|
-
children:
|
|
73
|
+
children: v
|
|
71
74
|
})] });
|
|
72
75
|
}
|
|
73
76
|
//#endregion
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface FilmstripFrame {
|
|
3
|
+
/** Media time, seconds. */
|
|
4
|
+
time: number;
|
|
5
|
+
src: string;
|
|
6
|
+
}
|
|
7
|
+
export interface FilmstripProps {
|
|
8
|
+
frames: readonly FilmstripFrame[];
|
|
9
|
+
/** The media time at the left edge. Default: the first frame's. */
|
|
10
|
+
from?: number;
|
|
11
|
+
/** The media time at the right edge. Default: the last frame's. */
|
|
12
|
+
to?: number;
|
|
13
|
+
/** Width over height of a frame. Default: measured from the first frame, else 16 / 9. */
|
|
14
|
+
aspect?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
}
|
|
18
|
+
export declare function Filmstrip({ frames, from, to, aspect, className, style }: FilmstripProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
//# sourceMappingURL=filmstrip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filmstrip.d.ts","sourceRoot":"","sources":["../../src/components/filmstrip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAqC,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAS9E,MAAM,WAAW,cAAc;IAC7B,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,SAAS,cAAc,EAAE,CAAC;IAClC,mEAAmE;IACnE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,cAAc,2CAqDvF"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../lib/utils.js";
|
|
3
|
+
import { useLayoutEffect as t, useRef as n, useState as r } from "react";
|
|
4
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/filmstrip.tsx
|
|
6
|
+
function a({ frames: a, from: o, to: s, aspect: c, className: l, style: u }) {
|
|
7
|
+
let d = n(null), [f, p] = r({
|
|
8
|
+
w: 0,
|
|
9
|
+
h: 0
|
|
10
|
+
}), [m, h] = r(null);
|
|
11
|
+
t(() => {
|
|
12
|
+
let e = d.current;
|
|
13
|
+
if (!e) return;
|
|
14
|
+
let t = () => p((t) => t.w === e.clientWidth && t.h === e.clientHeight ? t : {
|
|
15
|
+
w: e.clientWidth,
|
|
16
|
+
h: e.clientHeight
|
|
17
|
+
});
|
|
18
|
+
if (t(), typeof ResizeObserver > "u") return;
|
|
19
|
+
let n = new ResizeObserver(t);
|
|
20
|
+
return n.observe(e), () => n.disconnect();
|
|
21
|
+
}, []);
|
|
22
|
+
let g = a[0]?.src;
|
|
23
|
+
t(() => {
|
|
24
|
+
if (c || !g) return;
|
|
25
|
+
let e = !0, t = new Image();
|
|
26
|
+
return t.onload = () => {
|
|
27
|
+
e && t.naturalHeight && h(t.naturalWidth / t.naturalHeight);
|
|
28
|
+
}, t.src = g, () => {
|
|
29
|
+
e = !1;
|
|
30
|
+
};
|
|
31
|
+
}, [c, g]);
|
|
32
|
+
let _ = c ?? m ?? 16 / 9, v = Math.max(8, f.h * _), y = a.length && f.w ? Math.ceil(f.w / v) : 0, b = o ?? a[0]?.time ?? 0, x = s ?? a[a.length - 1]?.time ?? b, S = a.length > 1 && a.some((e, t) => t && e.time < a[t - 1].time) ? [...a].sort((e, t) => e.time - t.time) : a, C = (e) => {
|
|
33
|
+
let t = 0, n = S.length - 1;
|
|
34
|
+
for (; t < n;) {
|
|
35
|
+
let r = t + n >> 1;
|
|
36
|
+
S[r].time < e ? t = r + 1 : n = r;
|
|
37
|
+
}
|
|
38
|
+
return t > 0 && Math.abs(S[t - 1].time - e) <= Math.abs(S[t].time - e) ? S[t - 1] : S[t];
|
|
39
|
+
};
|
|
40
|
+
return /* @__PURE__ */ i("div", {
|
|
41
|
+
ref: d,
|
|
42
|
+
"data-slot": "filmstrip",
|
|
43
|
+
"aria-hidden": !0,
|
|
44
|
+
className: e("relative flex h-full w-full overflow-hidden", l),
|
|
45
|
+
style: u,
|
|
46
|
+
children: Array.from({ length: y }, (e, t) => {
|
|
47
|
+
let n = b + (t + .5) * v / Math.max(1, f.w) * (x - b), r = C(n);
|
|
48
|
+
return /* @__PURE__ */ i("div", {
|
|
49
|
+
className: "h-full w-(--cell) shrink-0 bg-(image:--frame) bg-cover bg-center",
|
|
50
|
+
style: {
|
|
51
|
+
"--cell": `${v}px`,
|
|
52
|
+
"--frame": r ? `url("${r.src}")` : "none"
|
|
53
|
+
}
|
|
54
|
+
}, t);
|
|
55
|
+
})
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { a as Filmstrip };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../lib/utils.js";
|
|
3
3
|
import { Icon as t } from "../lib/icon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { selectableText as n } from "../lib/primitives.js";
|
|
5
|
+
import { Button as r } from "./button.js";
|
|
6
6
|
import { describeFilter as i } from "../lib/filter.js";
|
|
7
7
|
import { FilterChip as a, useOptionalFilterBar as o } from "./filter.js";
|
|
8
8
|
import { useFilterQuery as s, warmFilterQuery as c } from "../lib/filter-query.js";
|
|
@@ -59,10 +59,10 @@ function b({ fields: g, onApply: b, mode: x = "merge", value: S, defaultValue: C
|
|
|
59
59
|
onKeyDown: (e) => {
|
|
60
60
|
e.key === "Enter" && !e.nativeEvent.isComposing ? (e.preventDefault(), X()) : e.key === "Escape" && P && (e.preventDefault(), e.stopPropagation(), F(""), L(""));
|
|
61
61
|
},
|
|
62
|
-
className: e("min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 [font-family:inherit] text-body text-foreground outline-none placeholder:text-tertiary-foreground",
|
|
62
|
+
className: e("min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 [font-family:inherit] text-body text-foreground outline-none placeholder:text-tertiary-foreground", n)
|
|
63
63
|
})]
|
|
64
64
|
})
|
|
65
|
-
}), /* @__PURE__ */ f(
|
|
65
|
+
}), /* @__PURE__ */ f(r, {
|
|
66
66
|
variant: "secondary",
|
|
67
67
|
size: "sm",
|
|
68
68
|
isDisabled: !J,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../lib/utils.js";
|
|
3
3
|
import { Icon as t } from "../lib/icon.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { selectableText as n } from "../lib/primitives.js";
|
|
5
|
+
import { Popover as r, PopoverTrigger as i } from "./popover.js";
|
|
6
|
+
import { DropdownMenu as a, DropdownMenuContent as o, DropdownMenuItem as s } from "./dropdown-menu.js";
|
|
7
|
+
import { Segmented as c } from "./segmented.js";
|
|
8
|
+
import { checkboxVariants as l } from "./checkbox.js";
|
|
9
9
|
import { ListBox as u, listBoxItemVariants as d } from "./list-box.js";
|
|
10
10
|
import { DATE_PRESETS as f, RELATIVE_UNITS as p, createFilter as m, describeFilter as h, describeValue as g, isDateValue as _, isFilterComplete as v, operatorLabel as y, operatorsFor as b, withOperator as x, withValue as S } from "../lib/filter.js";
|
|
11
11
|
import { createContext as C, useCallback as w, useContext as T, useEffect as ee, useMemo as E, useRef as D, useState as O } from "react";
|
|
@@ -128,10 +128,10 @@ function ce(e) {
|
|
|
128
128
|
kind: n
|
|
129
129
|
};
|
|
130
130
|
}
|
|
131
|
-
function le({ label:
|
|
131
|
+
function le({ label: r, placeholder: i, autoFocus: a, onBack: o }) {
|
|
132
132
|
return /* @__PURE__ */ j(L, {
|
|
133
133
|
"data-slot": "filter-search",
|
|
134
|
-
"aria-label":
|
|
134
|
+
"aria-label": r,
|
|
135
135
|
autoFocus: a,
|
|
136
136
|
onKeyDown: (e) => {
|
|
137
137
|
o && e.key === "Backspace" && e.target.value === "" && o();
|
|
@@ -144,7 +144,7 @@ function le({ label: n, placeholder: i, autoFocus: a, onBack: o }) {
|
|
|
144
144
|
className: "shrink-0 text-foreground/70"
|
|
145
145
|
}), /* @__PURE__ */ A(F, {
|
|
146
146
|
placeholder: i,
|
|
147
|
-
className: e("min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 [font-family:inherit] text-subhead text-foreground outline-none placeholder:text-tertiary-foreground [&::-webkit-search-cancel-button]:appearance-none",
|
|
147
|
+
className: e("min-w-0 flex-1 appearance-none border-0 bg-transparent p-0 [font-family:inherit] text-subhead text-foreground outline-none placeholder:text-tertiary-foreground [&::-webkit-search-cancel-button]:appearance-none", n)
|
|
148
148
|
})]
|
|
149
149
|
});
|
|
150
150
|
}
|
|
@@ -177,15 +177,15 @@ function Q({ id: e, icon: n, checked: r, trailing: i, children: a, onAction: o,
|
|
|
177
177
|
]
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
-
function de({ field: n, value: r, onChange:
|
|
181
|
-
let { contains:
|
|
180
|
+
function de({ field: n, value: r, onChange: i, onBack: a }) {
|
|
181
|
+
let { contains: o } = H({ sensitivity: "base" }), s = n.options ?? [];
|
|
182
182
|
return /* @__PURE__ */ j(M, {
|
|
183
|
-
filter: (e, t) =>
|
|
183
|
+
filter: (e, t) => o(e, t),
|
|
184
184
|
children: [/* @__PURE__ */ A(le, {
|
|
185
185
|
label: `Search ${n.label.toLowerCase()}`,
|
|
186
186
|
placeholder: `Search ${n.label.toLowerCase()}…`,
|
|
187
187
|
autoFocus: !0,
|
|
188
|
-
onBack:
|
|
188
|
+
onBack: a
|
|
189
189
|
}), /* @__PURE__ */ A(u, {
|
|
190
190
|
variant: "popup",
|
|
191
191
|
"aria-label": n.label,
|
|
@@ -193,10 +193,10 @@ function de({ field: n, value: r, onChange: a, onBack: o }) {
|
|
|
193
193
|
escapeKeyBehavior: "none",
|
|
194
194
|
selectedKeys: new Set(r),
|
|
195
195
|
onSelectionChange: (e) => {
|
|
196
|
-
let t = new Set(e === "all" ?
|
|
197
|
-
|
|
196
|
+
let t = new Set(e === "all" ? s.map((e) => e.value) : [...e].map(String));
|
|
197
|
+
i([...s.map((e) => e.value).filter((e) => t.has(e)), ...[...t].filter((e) => !s.some((t) => t.value === e))]);
|
|
198
198
|
},
|
|
199
|
-
items:
|
|
199
|
+
items: s.map((e) => ({
|
|
200
200
|
...e,
|
|
201
201
|
id: e.value
|
|
202
202
|
})),
|
|
@@ -209,7 +209,7 @@ function de({ field: n, value: r, onChange: a, onBack: o }) {
|
|
|
209
209
|
children: [
|
|
210
210
|
/* @__PURE__ */ A("span", {
|
|
211
211
|
"aria-hidden": "true",
|
|
212
|
-
className: e(
|
|
212
|
+
className: e(l({ shape: "square" }), "size-4.5"),
|
|
213
213
|
children: /* @__PURE__ */ A(t, {
|
|
214
214
|
name: "check",
|
|
215
215
|
size: 12,
|
|
@@ -257,8 +257,8 @@ function fe({ value: e, onChange: t, onDone: n }) {
|
|
|
257
257
|
})]
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
function pe({ field: t, value:
|
|
261
|
-
let s = t.kind === "number", c = typeof
|
|
260
|
+
function pe({ field: t, value: r, onChange: i, onDone: a, onBack: o }) {
|
|
261
|
+
let s = t.kind === "number", c = typeof r == "number" || typeof r == "string" ? String(r) : "", [l, u] = O(c), d = D(c), f = (e) => {
|
|
262
262
|
let t = l.trim();
|
|
263
263
|
t === "" || s && !Number.isFinite(Number(t)) || (t !== d.current && (d.current = t, i(s ? Number(t) : t)), e && a?.());
|
|
264
264
|
};
|
|
@@ -277,7 +277,7 @@ function pe({ field: t, value: n, onChange: i, onDone: a, onBack: o }) {
|
|
|
277
277
|
e.key === "Enter" ? (e.preventDefault(), f(!0)) : e.key === "Backspace" && l === "" && o && o();
|
|
278
278
|
},
|
|
279
279
|
onBlur: () => f(!1),
|
|
280
|
-
className: e("box-border h-9 w-full rounded-lg border-0 bg-input px-3 [font-family:inherit] text-subhead text-foreground outline-none placeholder:text-tertiary-foreground data-focused:ring-2 data-focused:ring-ring/45",
|
|
280
|
+
className: e("box-border h-9 w-full rounded-lg border-0 bg-input px-3 [font-family:inherit] text-subhead text-foreground outline-none placeholder:text-tertiary-foreground data-focused:ring-2 data-focused:ring-ring/45", n)
|
|
281
281
|
})
|
|
282
282
|
}), /* @__PURE__ */ j("div", {
|
|
283
283
|
className: "flex items-center justify-between gap-2 text-caption text-foreground/70",
|
|
@@ -291,16 +291,16 @@ function pe({ field: t, value: n, onChange: i, onDone: a, onBack: o }) {
|
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
293
|
var me = /^\d{4}-\d{2}-\d{2}$/;
|
|
294
|
-
function he({ operator: t, value:
|
|
295
|
-
let
|
|
294
|
+
function he({ operator: t, value: r, onChange: i, onDone: a }) {
|
|
295
|
+
let o = _(r) ? r : void 0, s = o?.type === "relative" ? o : {
|
|
296
296
|
type: "relative",
|
|
297
297
|
amount: 7,
|
|
298
298
|
unit: "day"
|
|
299
|
-
}, [l, d] = O(String(
|
|
299
|
+
}, [l, d] = O(String(s.amount)), [m, h] = O(o?.type === "date" ? o.date : ""), g = "rounded-lg border-0 bg-input px-3 [font-family:inherit] text-subhead text-foreground outline-none data-focused:ring-2 data-focused:ring-ring/45";
|
|
300
300
|
if (t === "in_the_last") {
|
|
301
301
|
let t = (e, t) => {
|
|
302
302
|
let n = Math.floor(Number(e));
|
|
303
|
-
Number.isFinite(n) && n > 0 &&
|
|
303
|
+
Number.isFinite(n) && n > 0 && i({
|
|
304
304
|
type: "relative",
|
|
305
305
|
amount: n,
|
|
306
306
|
unit: t
|
|
@@ -312,7 +312,7 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
|
|
|
312
312
|
"aria-label": "How many",
|
|
313
313
|
value: l,
|
|
314
314
|
onChange: (e) => {
|
|
315
|
-
d(e), t(e,
|
|
315
|
+
d(e), t(e, s.unit);
|
|
316
316
|
},
|
|
317
317
|
type: "number",
|
|
318
318
|
inputMode: "numeric",
|
|
@@ -320,13 +320,13 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
|
|
|
320
320
|
autoFocus: !0,
|
|
321
321
|
min: 1,
|
|
322
322
|
onKeyDown: (e) => {
|
|
323
|
-
e.key === "Enter" && (e.preventDefault(), t(l,
|
|
323
|
+
e.key === "Enter" && (e.preventDefault(), t(l, s.unit), a?.());
|
|
324
324
|
},
|
|
325
|
-
className: e("box-border h-9 w-full tabular-nums", g,
|
|
325
|
+
className: e("box-border h-9 w-full tabular-nums", g, n)
|
|
326
326
|
})
|
|
327
|
-
}), /* @__PURE__ */ A(
|
|
327
|
+
}), /* @__PURE__ */ A(c, {
|
|
328
328
|
"aria-label": "Unit",
|
|
329
|
-
value:
|
|
329
|
+
value: s.unit,
|
|
330
330
|
onChange: (e) => t(l, e),
|
|
331
331
|
options: p.map((e) => ({
|
|
332
332
|
id: e,
|
|
@@ -336,10 +336,10 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
|
|
|
336
336
|
});
|
|
337
337
|
}
|
|
338
338
|
let v = (e) => {
|
|
339
|
-
me.test(m) && (
|
|
339
|
+
me.test(m) && (o?.type !== "date" || o.date !== m) && i({
|
|
340
340
|
type: "date",
|
|
341
341
|
date: m
|
|
342
|
-
}), e && me.test(m) &&
|
|
342
|
+
}), e && me.test(m) && a?.();
|
|
343
343
|
};
|
|
344
344
|
return /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A(u, {
|
|
345
345
|
variant: "popup",
|
|
@@ -349,12 +349,12 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
|
|
|
349
349
|
children: f.map((e) => /* @__PURE__ */ A(Q, {
|
|
350
350
|
id: e.id,
|
|
351
351
|
textValue: e.label,
|
|
352
|
-
checked:
|
|
352
|
+
checked: o?.type === "preset" && o.preset === e.id,
|
|
353
353
|
onAction: () => {
|
|
354
|
-
|
|
354
|
+
i({
|
|
355
355
|
type: "preset",
|
|
356
356
|
preset: e.id
|
|
357
|
-
}),
|
|
357
|
+
}), a?.();
|
|
358
358
|
},
|
|
359
359
|
children: e.label
|
|
360
360
|
}, e.id))
|
|
@@ -370,7 +370,7 @@ function he({ operator: t, value: i, onChange: a, onDone: o }) {
|
|
|
370
370
|
onKeyDown: (e) => {
|
|
371
371
|
e.key === "Enter" && (e.preventDefault(), v(!0));
|
|
372
372
|
},
|
|
373
|
-
className: e("box-border h-9 w-full", g,
|
|
373
|
+
className: e("box-border h-9 w-full", g, n)
|
|
374
374
|
})
|
|
375
375
|
})
|
|
376
376
|
})] });
|
|
@@ -407,31 +407,31 @@ function $({ field: e, operator: t, value: n, onChange: r, onDone: i, onBack: a
|
|
|
407
407
|
function ge(e) {
|
|
408
408
|
return e instanceof Element && !!e.closest("input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], [role=\"textbox\"], [role=\"searchbox\"], [role=\"combobox\"]");
|
|
409
409
|
}
|
|
410
|
-
function _e({ fields: n, state:
|
|
411
|
-
let y = K(), b = n ?? y?.fields ?? [], x = y ??
|
|
410
|
+
function _e({ fields: n, state: a, hotkey: o = null, children: s, label: c = "Filter", isOpen: l, defaultOpen: f = !1, onOpenChange: p, placement: h = "bottom start", className: g, popoverClassName: _, allowDuplicates: v }) {
|
|
411
|
+
let y = K(), b = n ?? y?.fields ?? [], x = y ?? a, C = v ?? y?.allowDuplicates ?? !1, [T, E] = O(f), D = l ?? T, [k, F] = O(null), [L, R] = O(null), { contains: z } = H({ sensitivity: "base" }), B = w((e) => {
|
|
412
412
|
e && (F(null), R(null)), E(e), p?.(e);
|
|
413
413
|
}, [p]);
|
|
414
414
|
if (ee(() => {
|
|
415
|
-
if (!
|
|
416
|
-
let e =
|
|
415
|
+
if (!o) return;
|
|
416
|
+
let e = o.toLowerCase(), t = (t) => {
|
|
417
417
|
t.defaultPrevented || t.metaKey || t.ctrlKey || t.altKey || t.key.toLowerCase() !== e || ge(t.target) || t.target instanceof Element && t.target.closest("[role=\"dialog\"], [role=\"alertdialog\"], [role=\"menu\"]") || (t.preventDefault(), B(!0));
|
|
418
418
|
};
|
|
419
419
|
return document.addEventListener("keydown", t), () => document.removeEventListener("keydown", t);
|
|
420
|
-
}, [
|
|
420
|
+
}, [o, B]), !x) return null;
|
|
421
421
|
let V = L ? x.filters.find((e) => e.id === L) : void 0, U = new Set(x.filters.map((e) => e.field)), W = b.filter((e) => C || !U.has(e.id));
|
|
422
|
-
return /* @__PURE__ */ j(
|
|
422
|
+
return /* @__PURE__ */ j(i, {
|
|
423
423
|
isOpen: D,
|
|
424
424
|
onOpenChange: B,
|
|
425
425
|
children: [s ?? /* @__PURE__ */ j(N, {
|
|
426
426
|
"data-slot": "filter-menu-trigger",
|
|
427
|
-
"aria-keyshortcuts":
|
|
427
|
+
"aria-keyshortcuts": o ? o.toUpperCase() : void 0,
|
|
428
428
|
className: e(X, g),
|
|
429
429
|
children: [/* @__PURE__ */ A(t, {
|
|
430
430
|
name: "filter-circle",
|
|
431
431
|
size: 16,
|
|
432
432
|
sw: 2
|
|
433
433
|
}), c]
|
|
434
|
-
}), /* @__PURE__ */ A(
|
|
434
|
+
}), /* @__PURE__ */ A(r, {
|
|
435
435
|
"data-slot": "filter-menu",
|
|
436
436
|
placement: h,
|
|
437
437
|
className: e("w-64 min-w-0 overflow-hidden", _),
|
|
@@ -515,18 +515,18 @@ function _e({ fields: n, state: r, hotkey: i = null, children: s, label: c = "Fi
|
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
517
|
function ve({ filter: t, field: n, onChange: r }) {
|
|
518
|
-
let i = Array.isArray(t.value) ? t.value.length : 2,
|
|
519
|
-
return
|
|
518
|
+
let i = Array.isArray(t.value) ? t.value.length : 2, c = y(t.operator, i), l = b(n.kind);
|
|
519
|
+
return l.length < 2 ? /* @__PURE__ */ A("span", {
|
|
520
520
|
"data-slot": "filter-chip-operator",
|
|
521
521
|
className: e(J, "text-foreground/70"),
|
|
522
|
-
children:
|
|
523
|
-
}) : /* @__PURE__ */ j(
|
|
522
|
+
children: c
|
|
523
|
+
}) : /* @__PURE__ */ j(a, { children: [/* @__PURE__ */ A(N, {
|
|
524
524
|
"data-slot": "filter-chip-operator",
|
|
525
525
|
"data-part": "operator",
|
|
526
|
-
"aria-label": `${n.label} operator: ${
|
|
526
|
+
"aria-label": `${n.label} operator: ${c}`,
|
|
527
527
|
className: e(J, Y, "text-foreground/70"),
|
|
528
|
-
children:
|
|
529
|
-
}), /* @__PURE__ */ A(
|
|
528
|
+
children: c
|
|
529
|
+
}), /* @__PURE__ */ A(o, {
|
|
530
530
|
placement: "bottom start",
|
|
531
531
|
"aria-label": `${n.label} operator`,
|
|
532
532
|
selectionMode: "single",
|
|
@@ -537,7 +537,7 @@ function ve({ filter: t, field: n, onChange: r }) {
|
|
|
537
537
|
i && i !== t.operator && r(x(n, t, i));
|
|
538
538
|
},
|
|
539
539
|
popoverClassName: "min-w-44",
|
|
540
|
-
children:
|
|
540
|
+
children: l.map((e) => /* @__PURE__ */ A(s, {
|
|
541
541
|
id: e,
|
|
542
542
|
textValue: y(e, 2),
|
|
543
543
|
className: "min-h-9 py-1.5 text-subhead",
|
|
@@ -545,9 +545,9 @@ function ve({ filter: t, field: n, onChange: r }) {
|
|
|
545
545
|
}, e))
|
|
546
546
|
})] });
|
|
547
547
|
}
|
|
548
|
-
function ye({ filter: t, field: n, locale:
|
|
549
|
-
let [s, c] = O(!1), l = g(t, n,
|
|
550
|
-
return /* @__PURE__ */ j(
|
|
548
|
+
function ye({ filter: t, field: n, locale: a, onChange: o }) {
|
|
549
|
+
let [s, c] = O(!1), l = g(t, n, a);
|
|
550
|
+
return /* @__PURE__ */ j(i, {
|
|
551
551
|
isOpen: s,
|
|
552
552
|
onOpenChange: c,
|
|
553
553
|
children: [/* @__PURE__ */ A(N, {
|
|
@@ -558,9 +558,9 @@ function ye({ filter: t, field: n, locale: r, onChange: i }) {
|
|
|
558
558
|
children: /* @__PURE__ */ A(se, {
|
|
559
559
|
filter: t,
|
|
560
560
|
field: n,
|
|
561
|
-
locale:
|
|
561
|
+
locale: a
|
|
562
562
|
})
|
|
563
|
-
}), /* @__PURE__ */ A(
|
|
563
|
+
}), /* @__PURE__ */ A(r, {
|
|
564
564
|
placement: "bottom start",
|
|
565
565
|
className: "w-64 min-w-0 overflow-hidden",
|
|
566
566
|
children: /* @__PURE__ */ A(P, {
|
|
@@ -570,7 +570,7 @@ function ye({ filter: t, field: n, locale: r, onChange: i }) {
|
|
|
570
570
|
field: n,
|
|
571
571
|
operator: t.operator,
|
|
572
572
|
value: t.value,
|
|
573
|
-
onChange: (e) =>
|
|
573
|
+
onChange: (e) => o(S(n, t, e)),
|
|
574
574
|
onDone: () => c(!1)
|
|
575
575
|
})
|
|
576
576
|
})
|
|
@@ -666,8 +666,8 @@ function Se({ className: t, children: n = "Clear all", ...r }) {
|
|
|
666
666
|
}) : null;
|
|
667
667
|
}
|
|
668
668
|
function Ce({ className: n }) {
|
|
669
|
-
let { filters: r, match: i, setMatch:
|
|
670
|
-
return r.length < 2 ? null : /* @__PURE__ */ j(
|
|
669
|
+
let { filters: r, match: i, setMatch: c, announce: l } = q();
|
|
670
|
+
return r.length < 2 ? null : /* @__PURE__ */ j(a, { children: [/* @__PURE__ */ j(N, {
|
|
671
671
|
"data-slot": "filter-match",
|
|
672
672
|
"aria-label": `Match mode: ${i === "all" ? "all filters" : "any filter"}`,
|
|
673
673
|
className: e(X, n),
|
|
@@ -681,7 +681,7 @@ function Ce({ className: n }) {
|
|
|
681
681
|
className: "opacity-60"
|
|
682
682
|
})
|
|
683
683
|
]
|
|
684
|
-
}), /* @__PURE__ */ j(
|
|
684
|
+
}), /* @__PURE__ */ j(o, {
|
|
685
685
|
placement: "bottom start",
|
|
686
686
|
"aria-label": "Match mode",
|
|
687
687
|
selectionMode: "single",
|
|
@@ -689,15 +689,15 @@ function Ce({ className: n }) {
|
|
|
689
689
|
selectedKeys: [i],
|
|
690
690
|
onSelectionChange: (e) => {
|
|
691
691
|
let t = [...e][0];
|
|
692
|
-
t && t !== i && (
|
|
692
|
+
t && t !== i && (c(t), l(t === "all" ? "Matching all filters" : "Matching any filter"));
|
|
693
693
|
},
|
|
694
694
|
popoverClassName: "min-w-48",
|
|
695
|
-
children: [/* @__PURE__ */ A(
|
|
695
|
+
children: [/* @__PURE__ */ A(s, {
|
|
696
696
|
id: "all",
|
|
697
697
|
textValue: "Match all filters",
|
|
698
698
|
className: "min-h-9 py-1.5 text-subhead",
|
|
699
699
|
children: "Match all filters"
|
|
700
|
-
}), /* @__PURE__ */ A(
|
|
700
|
+
}), /* @__PURE__ */ A(s, {
|
|
701
701
|
id: "any",
|
|
702
702
|
textValue: "Match any filter",
|
|
703
703
|
className: "min-h-9 py-1.5 text-subhead",
|