@upbound/monarch-blocks 0.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.
- package/LICENSE +21 -0
- package/README.md +58 -0
- package/dist/cel-filter-bar.d.ts +187 -0
- package/dist/cel-filter-bar.js +1850 -0
- package/dist/cel-filter-bar.js.map +1 -0
- package/dist/chart.d.ts +52 -0
- package/dist/chart.js +332 -0
- package/dist/chart.js.map +1 -0
- package/dist/chat-interface.d.ts +143 -0
- package/dist/chat-interface.js +676 -0
- package/dist/chat-interface.js.map +1 -0
- package/dist/code-block.d.ts +21 -0
- package/dist/code-block.js +201 -0
- package/dist/code-block.js.map +1 -0
- package/dist/data-table.d.ts +505 -0
- package/dist/data-table.js +4725 -0
- package/dist/data-table.js.map +1 -0
- package/dist/filter-bar.d.ts +80 -0
- package/dist/filter-bar.js +590 -0
- package/dist/filter-bar.js.map +1 -0
- package/dist/floating-widget.d.ts +36 -0
- package/dist/floating-widget.js +218 -0
- package/dist/floating-widget.js.map +1 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +6217 -0
- package/dist/index.js.map +1 -0
- package/dist/page-header.d.ts +12 -0
- package/dist/page-header.js +120 -0
- package/dist/page-header.js.map +1 -0
- package/dist/relative-time.d.ts +60 -0
- package/dist/relative-time.js +328 -0
- package/dist/relative-time.js.map +1 -0
- package/dist/section-header.d.ts +11 -0
- package/dist/section-header.js +123 -0
- package/dist/section-header.js.map +1 -0
- package/dist/section-nav.d.ts +50 -0
- package/dist/section-nav.js +143 -0
- package/dist/section-nav.js.map +1 -0
- package/dist/timeline.d.ts +8 -0
- package/dist/timeline.js +95 -0
- package/dist/timeline.js.map +1 -0
- package/dist/types-BULiU2qC.d.ts +170 -0
- package/package.json +58 -0
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/lib/utils.ts
|
|
34
|
+
import { clsx } from "clsx";
|
|
35
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
36
|
+
var twMerge = extendTailwindMerge({
|
|
37
|
+
extend: {
|
|
38
|
+
classGroups: {
|
|
39
|
+
"font-size": [
|
|
40
|
+
{
|
|
41
|
+
text: [
|
|
42
|
+
"display-hero",
|
|
43
|
+
"display-kpi-sm",
|
|
44
|
+
"display-kpi",
|
|
45
|
+
"display-kpi-lg",
|
|
46
|
+
"display-feature",
|
|
47
|
+
"h1",
|
|
48
|
+
"h2",
|
|
49
|
+
"h3",
|
|
50
|
+
"h4",
|
|
51
|
+
"body-lg",
|
|
52
|
+
"body",
|
|
53
|
+
"body-sm",
|
|
54
|
+
"caption",
|
|
55
|
+
"eyebrow"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
function cn(...inputs) {
|
|
63
|
+
return twMerge(clsx(inputs));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/section-header.tsx
|
|
67
|
+
import { jsx } from "react/jsx-runtime";
|
|
68
|
+
function SectionHeader(_a) {
|
|
69
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
71
|
+
"div",
|
|
72
|
+
__spreadProps(__spreadValues({
|
|
73
|
+
"data-slot": "section-header",
|
|
74
|
+
className: cn("flex w-full items-start justify-between gap-4", className)
|
|
75
|
+
}, props), {
|
|
76
|
+
children
|
|
77
|
+
})
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
function SectionHeaderContent(_a) {
|
|
81
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
82
|
+
return /* @__PURE__ */ jsx("div", __spreadValues({ "data-slot": "section-header-content", className: cn("flex flex-col gap-1", className) }, props));
|
|
83
|
+
}
|
|
84
|
+
function SectionHeaderTitle(_a) {
|
|
85
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
86
|
+
return /* @__PURE__ */ jsx("h2", __spreadValues({ "data-slot": "section-header-title", className: cn("text-h3 text-foreground", className) }, props));
|
|
87
|
+
}
|
|
88
|
+
function SectionHeaderDescription(_a) {
|
|
89
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
90
|
+
return /* @__PURE__ */ jsx("p", __spreadValues({ "data-slot": "section-header-description", className: cn("text-body text-muted-foreground", className) }, props));
|
|
91
|
+
}
|
|
92
|
+
function SectionHeaderMeta(_a) {
|
|
93
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
94
|
+
return /* @__PURE__ */ jsx(
|
|
95
|
+
"div",
|
|
96
|
+
__spreadValues({
|
|
97
|
+
"data-slot": "section-header-meta",
|
|
98
|
+
className: cn(
|
|
99
|
+
"text-body text-muted-foreground flex flex-wrap items-center gap-4",
|
|
100
|
+
"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--icon-default)",
|
|
101
|
+
className
|
|
102
|
+
)
|
|
103
|
+
}, props)
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function SectionHeaderActions(_a) {
|
|
107
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
108
|
+
return /* @__PURE__ */ jsx("div", __spreadValues({ "data-slot": "section-header-actions", className: cn("flex items-center gap-2", className) }, props));
|
|
109
|
+
}
|
|
110
|
+
function SectionHeaderTabs(_a) {
|
|
111
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
112
|
+
return /* @__PURE__ */ jsx("div", __spreadValues({ "data-slot": "section-header-tabs", className: cn("border-b", className) }, props));
|
|
113
|
+
}
|
|
114
|
+
export {
|
|
115
|
+
SectionHeader,
|
|
116
|
+
SectionHeaderActions,
|
|
117
|
+
SectionHeaderContent,
|
|
118
|
+
SectionHeaderDescription,
|
|
119
|
+
SectionHeaderMeta,
|
|
120
|
+
SectionHeaderTabs,
|
|
121
|
+
SectionHeaderTitle
|
|
122
|
+
};
|
|
123
|
+
//# sourceMappingURL=section-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/section-header.tsx"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'font-size': [\n {\n text: [\n 'display-hero',\n 'display-kpi-sm',\n 'display-kpi',\n 'display-kpi-lg',\n 'display-feature',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'body-lg',\n 'body',\n 'body-sm',\n 'caption',\n 'eyebrow',\n ],\n },\n ],\n },\n },\n});\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import { cn } from '@/lib/utils';\n\nfunction SectionHeader({ className, children, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"section-header\"\n className={cn('flex w-full items-start justify-between gap-4', className)}\n {...props}\n >\n {children}\n </div>\n );\n}\n\nfunction SectionHeaderContent({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"section-header-content\" className={cn('flex flex-col gap-1', className)} {...props} />;\n}\n\nfunction SectionHeaderTitle({ className, ...props }: React.ComponentProps<'h2'>) {\n return <h2 data-slot=\"section-header-title\" className={cn('text-h3 text-foreground', className)} {...props} />;\n}\n\nfunction SectionHeaderDescription({ className, ...props }: React.ComponentProps<'p'>) {\n return (\n <p data-slot=\"section-header-description\" className={cn('text-body text-muted-foreground', className)} {...props} />\n );\n}\n\nfunction SectionHeaderMeta({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"section-header-meta\"\n className={cn(\n 'text-body text-muted-foreground flex flex-wrap items-center gap-4',\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--icon-default)\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction SectionHeaderActions({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"section-header-actions\" className={cn('flex items-center gap-2', className)} {...props} />;\n}\n\nfunction SectionHeaderTabs({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"section-header-tabs\" className={cn('border-b', className)} {...props} />;\n}\n\nexport {\n SectionHeader,\n SectionHeaderContent,\n SectionHeaderTitle,\n SectionHeaderDescription,\n SectionHeaderMeta,\n SectionHeaderActions,\n SectionHeaderTabs,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAA6B;AACtC,SAAS,2BAA2B;AAEpC,IAAM,UAAU,oBAAoB;AAAA,EAClC,QAAQ;AAAA,IACN,aAAa;AAAA,MACX,aAAa;AAAA,QACX;AAAA,UACE,MAAM;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAEM,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AC5BI;AAFJ,SAAS,cAAc,IAAgE;AAAhE,eAAE,aAAW,SAFpC,IAEuB,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AAClC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,iDAAiD,SAAS;AAAA,OACpE,QAHL;AAAA,MAKE;AAAA;AAAA,EACH;AAEJ;AAEA,SAAS,qBAAqB,IAAsD;AAAtD,eAAE,YAdhC,IAc8B,IAAgB,kBAAhB,IAAgB,CAAd;AAC9B,SAAO,oBAAC,wBAAI,aAAU,0BAAyB,WAAW,GAAG,uBAAuB,SAAS,KAAO,MAAO;AAC7G;AAEA,SAAS,mBAAmB,IAAqD;AAArD,eAAE,YAlB9B,IAkB4B,IAAgB,kBAAhB,IAAgB,CAAd;AAC5B,SAAO,oBAAC,uBAAG,aAAU,wBAAuB,WAAW,GAAG,2BAA2B,SAAS,KAAO,MAAO;AAC9G;AAEA,SAAS,yBAAyB,IAAoD;AAApD,eAAE,YAtBpC,IAsBkC,IAAgB,kBAAhB,IAAgB,CAAd;AAClC,SACE,oBAAC,sBAAE,aAAU,8BAA6B,WAAW,GAAG,mCAAmC,SAAS,KAAO,MAAO;AAEtH;AAEA,SAAS,kBAAkB,IAAsD;AAAtD,eAAE,YA5B7B,IA4B2B,IAAgB,kBAAhB,IAAgB,CAAd;AAC3B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,OACI;AAAA,EACN;AAEJ;AAEA,SAAS,qBAAqB,IAAsD;AAAtD,eAAE,YA1ChC,IA0C8B,IAAgB,kBAAhB,IAAgB,CAAd;AAC9B,SAAO,oBAAC,wBAAI,aAAU,0BAAyB,WAAW,GAAG,2BAA2B,SAAS,KAAO,MAAO;AACjH;AAEA,SAAS,kBAAkB,IAAsD;AAAtD,eAAE,YA9C7B,IA8C2B,IAAgB,kBAAhB,IAAgB,CAAd;AAC3B,SAAO,oBAAC,wBAAI,aAAU,uBAAsB,WAAW,GAAG,YAAY,SAAS,KAAO,MAAO;AAC/F;","names":[]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* SectionNav — vertical navigation for in-page section routing.
|
|
6
|
+
*
|
|
7
|
+
* Distinct from `Sidebar`: Sidebar is the app-level chrome (org switcher,
|
|
8
|
+
* primary nav, user menu, mobile drawer). SectionNav is a context-free
|
|
9
|
+
* navigation list that lives inside a page or section — settings sub-nav,
|
|
10
|
+
* resource detail tabs (route-based), profile sub-pages, etc.
|
|
11
|
+
*
|
|
12
|
+
* Distinct from `Tabs (vertical orientation)`: Tabs swap views within a
|
|
13
|
+
* single route (UI state); SectionNav navigates between routes (URL changes,
|
|
14
|
+
* `aria-current="page"` on the active item).
|
|
15
|
+
*
|
|
16
|
+
* Composition:
|
|
17
|
+
*
|
|
18
|
+
* <SectionNav>
|
|
19
|
+
* <SectionNavList>
|
|
20
|
+
* <SectionNavItem href="/settings" isActive>Account</SectionNavItem>
|
|
21
|
+
* <SectionNavItem href="/settings/notifications">
|
|
22
|
+
* Notifications
|
|
23
|
+
* </SectionNavItem>
|
|
24
|
+
* </SectionNavList>
|
|
25
|
+
* </SectionNav>
|
|
26
|
+
*
|
|
27
|
+
* Wrap with Next `<Link>` via `asChild`:
|
|
28
|
+
*
|
|
29
|
+
* <SectionNavItem asChild isActive>
|
|
30
|
+
* <Link href="/settings">Account</Link>
|
|
31
|
+
* </SectionNavItem>
|
|
32
|
+
*/
|
|
33
|
+
declare function SectionNav({ className, ...props }: React.ComponentProps<'nav'>): react_jsx_runtime.JSX.Element;
|
|
34
|
+
declare function SectionNavList({ className, ...props }: React.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
|
|
35
|
+
declare function SectionNavGroup({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
36
|
+
declare function SectionNavGroupLabel({ className, ...props }: React.ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
37
|
+
interface SectionNavItemProps extends React.ComponentProps<'a'> {
|
|
38
|
+
/**
|
|
39
|
+
* Marks the item as the current page. Applies active styling and sets
|
|
40
|
+
* `aria-current="page"`. Active state is fully controlled — wire to your
|
|
41
|
+
* router's pathname match.
|
|
42
|
+
*/
|
|
43
|
+
isActive?: boolean;
|
|
44
|
+
asChild?: boolean;
|
|
45
|
+
}
|
|
46
|
+
declare function SectionNavItem({ className, isActive, asChild, children, ...props }: SectionNavItemProps): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare function SectionNavItemDescription({ className, ...props }: React.ComponentProps<'span'>): react_jsx_runtime.JSX.Element;
|
|
48
|
+
declare function SectionNavSub({ className, ...props }: React.ComponentProps<'ul'>): react_jsx_runtime.JSX.Element;
|
|
49
|
+
|
|
50
|
+
export { SectionNav, SectionNavGroup, SectionNavGroupLabel, SectionNavItem, SectionNavItemDescription, SectionNavList, SectionNavSub };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
var __objRest = (source, exclude) => {
|
|
22
|
+
var target = {};
|
|
23
|
+
for (var prop in source)
|
|
24
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
if (source != null && __getOwnPropSymbols)
|
|
27
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
+
target[prop] = source[prop];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
// src/section-nav.tsx
|
|
35
|
+
import { Slot } from "radix-ui";
|
|
36
|
+
|
|
37
|
+
// src/lib/utils.ts
|
|
38
|
+
import { clsx } from "clsx";
|
|
39
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
40
|
+
var twMerge = extendTailwindMerge({
|
|
41
|
+
extend: {
|
|
42
|
+
classGroups: {
|
|
43
|
+
"font-size": [
|
|
44
|
+
{
|
|
45
|
+
text: [
|
|
46
|
+
"display-hero",
|
|
47
|
+
"display-kpi-sm",
|
|
48
|
+
"display-kpi",
|
|
49
|
+
"display-kpi-lg",
|
|
50
|
+
"display-feature",
|
|
51
|
+
"h1",
|
|
52
|
+
"h2",
|
|
53
|
+
"h3",
|
|
54
|
+
"h4",
|
|
55
|
+
"body-lg",
|
|
56
|
+
"body",
|
|
57
|
+
"body-sm",
|
|
58
|
+
"caption",
|
|
59
|
+
"eyebrow"
|
|
60
|
+
]
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
function cn(...inputs) {
|
|
67
|
+
return twMerge(clsx(inputs));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// src/section-nav.tsx
|
|
71
|
+
import { jsx } from "react/jsx-runtime";
|
|
72
|
+
function SectionNav(_a) {
|
|
73
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
74
|
+
return /* @__PURE__ */ jsx("nav", __spreadValues({ "data-slot": "section-nav", className: cn("flex flex-col gap-4", className) }, props));
|
|
75
|
+
}
|
|
76
|
+
function SectionNavList(_a) {
|
|
77
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
78
|
+
return /* @__PURE__ */ jsx("ul", __spreadValues({ "data-slot": "section-nav-list", className: cn("flex flex-col gap-px", className) }, props));
|
|
79
|
+
}
|
|
80
|
+
function SectionNavGroup(_a) {
|
|
81
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
82
|
+
return /* @__PURE__ */ jsx("div", __spreadValues({ "data-slot": "section-nav-group", className: cn("flex flex-col gap-2", className) }, props));
|
|
83
|
+
}
|
|
84
|
+
function SectionNavGroupLabel(_a) {
|
|
85
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
86
|
+
return /* @__PURE__ */ jsx(
|
|
87
|
+
"div",
|
|
88
|
+
__spreadValues({
|
|
89
|
+
"data-slot": "section-nav-group-label",
|
|
90
|
+
className: cn("text-caption text-muted-foreground px-3 font-medium tracking-wide uppercase", className)
|
|
91
|
+
}, props)
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
function SectionNavItem(_a) {
|
|
95
|
+
var _b = _a, { className, isActive, asChild, children } = _b, props = __objRest(_b, ["className", "isActive", "asChild", "children"]);
|
|
96
|
+
const Comp = asChild ? Slot.Root : "a";
|
|
97
|
+
return /* @__PURE__ */ jsx("li", { "data-slot": "section-nav-item", children: /* @__PURE__ */ jsx(
|
|
98
|
+
Comp,
|
|
99
|
+
__spreadProps(__spreadValues({
|
|
100
|
+
"data-active": isActive || void 0,
|
|
101
|
+
"aria-current": isActive ? "page" : void 0,
|
|
102
|
+
className: cn(
|
|
103
|
+
"group/section-nav-item text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[active=true]:bg-accent data-[active=true]:text-accent-foreground flex w-full items-center gap-2 rounded-md px-3 py-1.5 font-medium outline-hidden motion-safe:transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--icon-default) [&_svg:not([class*='size-'])]:w-(--icon-default)!",
|
|
104
|
+
className
|
|
105
|
+
)
|
|
106
|
+
}, props), {
|
|
107
|
+
children
|
|
108
|
+
})
|
|
109
|
+
) });
|
|
110
|
+
}
|
|
111
|
+
function SectionNavItemDescription(_a) {
|
|
112
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
113
|
+
return /* @__PURE__ */ jsx(
|
|
114
|
+
"span",
|
|
115
|
+
__spreadValues({
|
|
116
|
+
"data-slot": "section-nav-item-description",
|
|
117
|
+
className: cn(
|
|
118
|
+
"text-body-sm text-muted-foreground group-hover/section-nav-item:text-accent-foreground/80 group-data-[active=true]/section-nav-item:text-accent-foreground/80 block font-normal",
|
|
119
|
+
className
|
|
120
|
+
)
|
|
121
|
+
}, props)
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
function SectionNavSub(_a) {
|
|
125
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
126
|
+
return /* @__PURE__ */ jsx(
|
|
127
|
+
"ul",
|
|
128
|
+
__spreadValues({
|
|
129
|
+
"data-slot": "section-nav-sub",
|
|
130
|
+
className: cn("border-border mt-1 ml-7 flex flex-col gap-px border-l pl-2", className)
|
|
131
|
+
}, props)
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
export {
|
|
135
|
+
SectionNav,
|
|
136
|
+
SectionNavGroup,
|
|
137
|
+
SectionNavGroupLabel,
|
|
138
|
+
SectionNavItem,
|
|
139
|
+
SectionNavItemDescription,
|
|
140
|
+
SectionNavList,
|
|
141
|
+
SectionNavSub
|
|
142
|
+
};
|
|
143
|
+
//# sourceMappingURL=section-nav.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/section-nav.tsx","../src/lib/utils.ts"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from 'radix-ui';\n\nimport { cn } from '@/lib/utils';\n\n/**\n * SectionNav — vertical navigation for in-page section routing.\n *\n * Distinct from `Sidebar`: Sidebar is the app-level chrome (org switcher,\n * primary nav, user menu, mobile drawer). SectionNav is a context-free\n * navigation list that lives inside a page or section — settings sub-nav,\n * resource detail tabs (route-based), profile sub-pages, etc.\n *\n * Distinct from `Tabs (vertical orientation)`: Tabs swap views within a\n * single route (UI state); SectionNav navigates between routes (URL changes,\n * `aria-current=\"page\"` on the active item).\n *\n * Composition:\n *\n * <SectionNav>\n * <SectionNavList>\n * <SectionNavItem href=\"/settings\" isActive>Account</SectionNavItem>\n * <SectionNavItem href=\"/settings/notifications\">\n * Notifications\n * </SectionNavItem>\n * </SectionNavList>\n * </SectionNav>\n *\n * Wrap with Next `<Link>` via `asChild`:\n *\n * <SectionNavItem asChild isActive>\n * <Link href=\"/settings\">Account</Link>\n * </SectionNavItem>\n */\n\n// ── Root ──────────────────────────────────────────────\n\nfunction SectionNav({ className, ...props }: React.ComponentProps<'nav'>) {\n return <nav data-slot=\"section-nav\" className={cn('flex flex-col gap-4', className)} {...props} />;\n}\n\n// ── List ──────────────────────────────────────────────\n\nfunction SectionNavList({ className, ...props }: React.ComponentProps<'ul'>) {\n return <ul data-slot=\"section-nav-list\" className={cn('flex flex-col gap-px', className)} {...props} />;\n}\n\n// ── Group (heading + list pair) ───────────────────────\n\nfunction SectionNavGroup({ className, ...props }: React.ComponentProps<'div'>) {\n return <div data-slot=\"section-nav-group\" className={cn('flex flex-col gap-2', className)} {...props} />;\n}\n\nfunction SectionNavGroupLabel({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"section-nav-group-label\"\n className={cn('text-caption text-muted-foreground px-3 font-medium tracking-wide uppercase', className)}\n {...props}\n />\n );\n}\n\n// ── Item ──────────────────────────────────────────────\n\ninterface SectionNavItemProps extends React.ComponentProps<'a'> {\n /**\n * Marks the item as the current page. Applies active styling and sets\n * `aria-current=\"page\"`. Active state is fully controlled — wire to your\n * router's pathname match.\n */\n isActive?: boolean;\n asChild?: boolean;\n}\n\nfunction SectionNavItem({ className, isActive, asChild, children, ...props }: SectionNavItemProps) {\n const Comp = asChild ? Slot.Root : 'a';\n return (\n <li data-slot=\"section-nav-item\">\n <Comp\n data-active={isActive || undefined}\n aria-current={isActive ? 'page' : undefined}\n className={cn(\n \"group/section-nav-item text-body text-muted-foreground hover:bg-accent hover:text-accent-foreground focus-visible:bg-accent focus-visible:text-accent-foreground data-[active=true]:bg-accent data-[active=true]:text-accent-foreground flex w-full items-center gap-2 rounded-md px-3 py-1.5 font-medium outline-hidden motion-safe:transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-(--icon-default) [&_svg:not([class*='size-'])]:w-(--icon-default)!\",\n className,\n )}\n {...props}\n >\n {children}\n </Comp>\n </li>\n );\n}\n\n// ── Item description (for rich items with label + sub-text) ────\n\nfunction SectionNavItemDescription({ className, ...props }: React.ComponentProps<'span'>) {\n return (\n <span\n data-slot=\"section-nav-item-description\"\n className={cn(\n 'text-body-sm text-muted-foreground group-hover/section-nav-item:text-accent-foreground/80 group-data-[active=true]/section-nav-item:text-accent-foreground/80 block font-normal',\n className,\n )}\n {...props}\n />\n );\n}\n\n// ── Sub navigation (nested under an item) ─────────────\n\nfunction SectionNavSub({ className, ...props }: React.ComponentProps<'ul'>) {\n return (\n <ul\n data-slot=\"section-nav-sub\"\n className={cn('border-border mt-1 ml-7 flex flex-col gap-px border-l pl-2', className)}\n {...props}\n />\n );\n}\n\nexport {\n SectionNav,\n SectionNavList,\n SectionNavGroup,\n SectionNavGroupLabel,\n SectionNavItem,\n SectionNavItemDescription,\n SectionNavSub,\n};\n","import { clsx, type ClassValue } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'font-size': [\n {\n text: [\n 'display-hero',\n 'display-kpi-sm',\n 'display-kpi',\n 'display-kpi-lg',\n 'display-feature',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'body-lg',\n 'body',\n 'body-sm',\n 'caption',\n 'eyebrow',\n ],\n },\n ],\n },\n },\n});\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,SAAS,YAAY;;;ACHrB,SAAS,YAA6B;AACtC,SAAS,2BAA2B;AAEpC,IAAM,UAAU,oBAAoB;AAAA,EAClC,QAAQ;AAAA,IACN,aAAa;AAAA,MACX,aAAa;AAAA,QACX;AAAA,UACE,MAAM;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAEM,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;ADQS;AADT,SAAS,WAAW,IAAsD;AAAtD,eAAE,YAvCtB,IAuCoB,IAAgB,kBAAhB,IAAgB,CAAd;AACpB,SAAO,oBAAC,wBAAI,aAAU,eAAc,WAAW,GAAG,uBAAuB,SAAS,KAAO,MAAO;AAClG;AAIA,SAAS,eAAe,IAAqD;AAArD,eAAE,YA7C1B,IA6CwB,IAAgB,kBAAhB,IAAgB,CAAd;AACxB,SAAO,oBAAC,uBAAG,aAAU,oBAAmB,WAAW,GAAG,wBAAwB,SAAS,KAAO,MAAO;AACvG;AAIA,SAAS,gBAAgB,IAAsD;AAAtD,eAAE,YAnD3B,IAmDyB,IAAgB,kBAAhB,IAAgB,CAAd;AACzB,SAAO,oBAAC,wBAAI,aAAU,qBAAoB,WAAW,GAAG,uBAAuB,SAAS,KAAO,MAAO;AACxG;AAEA,SAAS,qBAAqB,IAAsD;AAAtD,eAAE,YAvDhC,IAuD8B,IAAgB,kBAAhB,IAAgB,CAAd;AAC9B,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,+EAA+E,SAAS;AAAA,OAClG;AAAA,EACN;AAEJ;AAcA,SAAS,eAAe,IAA2E;AAA3E,eAAE,aAAW,UAAU,SAAS,SA7ExD,IA6EwB,IAA6C,kBAA7C,IAA6C,CAA3C,aAAW,YAAU,WAAS;AACtD,QAAM,OAAO,UAAU,KAAK,OAAO;AACnC,SACE,oBAAC,QAAG,aAAU,oBACZ;AAAA,IAAC;AAAA;AAAA,MACC,eAAa,YAAY;AAAA,MACzB,gBAAc,WAAW,SAAS;AAAA,MAClC,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI,QAPL;AAAA,MASE;AAAA;AAAA,EACH,GACF;AAEJ;AAIA,SAAS,0BAA0B,IAAuD;AAAvD,eAAE,YAlGrC,IAkGmC,IAAgB,kBAAhB,IAAgB,CAAd;AACnC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW;AAAA,QACT;AAAA,QACA;AAAA,MACF;AAAA,OACI;AAAA,EACN;AAEJ;AAIA,SAAS,cAAc,IAAqD;AAArD,eAAE,YAjHzB,IAiHuB,IAAgB,kBAAhB,IAAgB,CAAd;AACvB,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAW,GAAG,8DAA8D,SAAS;AAAA,OACjF;AAAA,EACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { ItemGroup, Item } from '@upbound/monarch-core';
|
|
4
|
+
|
|
5
|
+
declare function Timeline({ className, ...props }: React.ComponentProps<typeof ItemGroup>): react_jsx_runtime.JSX.Element;
|
|
6
|
+
declare function TimelineItem({ className, children, ...props }: React.ComponentProps<typeof Item>): react_jsx_runtime.JSX.Element;
|
|
7
|
+
|
|
8
|
+
export { Timeline, TimelineItem };
|
package/dist/timeline.js
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/lib/utils.ts
|
|
34
|
+
import { clsx } from "clsx";
|
|
35
|
+
import { extendTailwindMerge } from "tailwind-merge";
|
|
36
|
+
var twMerge = extendTailwindMerge({
|
|
37
|
+
extend: {
|
|
38
|
+
classGroups: {
|
|
39
|
+
"font-size": [
|
|
40
|
+
{
|
|
41
|
+
text: [
|
|
42
|
+
"display-hero",
|
|
43
|
+
"display-kpi-sm",
|
|
44
|
+
"display-kpi",
|
|
45
|
+
"display-kpi-lg",
|
|
46
|
+
"display-feature",
|
|
47
|
+
"h1",
|
|
48
|
+
"h2",
|
|
49
|
+
"h3",
|
|
50
|
+
"h4",
|
|
51
|
+
"body-lg",
|
|
52
|
+
"body",
|
|
53
|
+
"body-sm",
|
|
54
|
+
"caption",
|
|
55
|
+
"eyebrow"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
function cn(...inputs) {
|
|
63
|
+
return twMerge(clsx(inputs));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// src/timeline.tsx
|
|
67
|
+
import { Icon } from "@upbound/monarch-core";
|
|
68
|
+
import { Item, ItemGroup } from "@upbound/monarch-core";
|
|
69
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
70
|
+
function Timeline(_a) {
|
|
71
|
+
var _b = _a, { className } = _b, props = __objRest(_b, ["className"]);
|
|
72
|
+
return /* @__PURE__ */ jsx(ItemGroup, __spreadValues({ "data-slot": "timeline", className: cn(className) }, props));
|
|
73
|
+
}
|
|
74
|
+
function TimelineItem(_a) {
|
|
75
|
+
var _b = _a, { className, children } = _b, props = __objRest(_b, ["className", "children"]);
|
|
76
|
+
return /* @__PURE__ */ jsxs(Item, __spreadProps(__spreadValues({ "data-slot": "timeline-item", className: cn("group/timeline-item gap-3 py-4", className) }, props), { children: [
|
|
77
|
+
/* @__PURE__ */ jsxs("div", { className: "relative flex flex-col items-center self-stretch", children: [
|
|
78
|
+
/* @__PURE__ */ jsx(Icon, { name: "circle-dot", size: "sm", className: "text-primary shrink-0" }),
|
|
79
|
+
/* @__PURE__ */ jsx(
|
|
80
|
+
"span",
|
|
81
|
+
{
|
|
82
|
+
"aria-hidden": "true",
|
|
83
|
+
className: "bg-timeline-connector absolute top-5 w-px group-last/timeline-item:hidden",
|
|
84
|
+
style: { bottom: "-1rem" }
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
] }),
|
|
88
|
+
children
|
|
89
|
+
] }));
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
Timeline,
|
|
93
|
+
TimelineItem
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=timeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/utils.ts","../src/timeline.tsx"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { extendTailwindMerge } from 'tailwind-merge';\n\nconst twMerge = extendTailwindMerge({\n extend: {\n classGroups: {\n 'font-size': [\n {\n text: [\n 'display-hero',\n 'display-kpi-sm',\n 'display-kpi',\n 'display-kpi-lg',\n 'display-feature',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'body-lg',\n 'body',\n 'body-sm',\n 'caption',\n 'eyebrow',\n ],\n },\n ],\n },\n },\n});\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\nimport { Icon } from '@upbound/monarch-core';\nimport { Item, ItemGroup } from '@upbound/monarch-core';\n\nfunction Timeline({ className, ...props }: React.ComponentProps<typeof ItemGroup>) {\n return <ItemGroup data-slot=\"timeline\" className={cn(className)} {...props} />;\n}\n\nfunction TimelineItem({ className, children, ...props }: React.ComponentProps<typeof Item>) {\n return (\n <Item data-slot=\"timeline-item\" className={cn('group/timeline-item gap-3 py-4', className)} {...props}>\n <div className=\"relative flex flex-col items-center self-stretch\">\n <Icon name=\"circle-dot\" size=\"sm\" className=\"text-primary shrink-0\" />\n <span\n aria-hidden=\"true\"\n className=\"bg-timeline-connector absolute top-5 w-px group-last/timeline-item:hidden\"\n style={{ bottom: '-1rem' }}\n />\n </div>\n {children}\n </Item>\n );\n}\n\nexport { Timeline, TimelineItem };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,YAA6B;AACtC,SAAS,2BAA2B;AAEpC,IAAM,UAAU,oBAAoB;AAAA,EAClC,QAAQ;AAAA,IACN,aAAa;AAAA,MACX,aAAa;AAAA,QACX;AAAA,UACE,MAAM;AAAA,YACJ;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAEM,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;;;AC7BA,SAAS,YAAY;AACrB,SAAS,MAAM,iBAAiB;AAGvB,cAMH,YANG;AADT,SAAS,SAAS,IAAiE;AAAjE,eAAE,YANpB,IAMkB,IAAgB,kBAAhB,IAAgB,CAAd;AAClB,SAAO,oBAAC,4BAAU,aAAU,YAAW,WAAW,GAAG,SAAS,KAAO,MAAO;AAC9E;AAEA,SAAS,aAAa,IAAsE;AAAtE,eAAE,aAAW,SAVnC,IAUsB,IAA0B,kBAA1B,IAA0B,CAAxB,aAAW;AACjC,SACE,qBAAC,qCAAK,aAAU,iBAAgB,WAAW,GAAG,kCAAkC,SAAS,KAAO,QAA/F,EACC;AAAA,yBAAC,SAAI,WAAU,oDACb;AAAA,0BAAC,QAAK,MAAK,cAAa,MAAK,MAAK,WAAU,yBAAwB;AAAA,MACpE;AAAA,QAAC;AAAA;AAAA,UACC,eAAY;AAAA,UACZ,WAAU;AAAA,UACV,OAAO,EAAE,QAAQ,QAAQ;AAAA;AAAA,MAC3B;AAAA,OACF;AAAA,IACC;AAAA,MACH;AAEJ;","names":[]}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/** Stable operator ids used in code and tests. UI labels come from `getOperatorLabel`. */
|
|
2
|
+
type CelOperator = 'is' | 'is_not' | 'contains' | 'does_not_contain' | 'starts_with' | 'ends_with' | 'matches' | 'is_before' | 'is_after' | 'is_on_or_before' | 'is_on_or_after' | 'is_between' | 'is_not_between' | 'key_exists' | 'key_does_not_exist' | 'has_value' | 'does_not_have_value';
|
|
3
|
+
type CelFilterType = 'checkbox' | 'radio' | 'text' | 'multiText' | 'date' | 'keyValue' | 'static';
|
|
4
|
+
/** When a valid compiled expression may be emitted to consumers (API, URL, etc.). */
|
|
5
|
+
type CelEmitOn = 'change' | 'commit';
|
|
6
|
+
/**
|
|
7
|
+
* Resolved shape used by the compiler / dispatcher to pick a value variant and
|
|
8
|
+
* operator set. Columns map to their `filterType`; map fields resolve to `map`.
|
|
9
|
+
*/
|
|
10
|
+
type CelFilterShape = CelFilterType | 'map';
|
|
11
|
+
type CelColumnOption = {
|
|
12
|
+
/** Human-readable text shown in the UI and collapsed pill display. Never compiled into CEL. */
|
|
13
|
+
label: string;
|
|
14
|
+
/** Canonical CEL literal stored on the condition and emitted in compiled CEL. */
|
|
15
|
+
value: string;
|
|
16
|
+
/** When set, selecting this option also sets the condition operator (e.g. `'is_not'` for a negated choice). */
|
|
17
|
+
operator?: CelOperator;
|
|
18
|
+
/** When true, the option cannot be toggled; hosts may handle the click via `onRestrictedOptionSelect`. */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
};
|
|
21
|
+
/** Payload for clicks on disabled checkbox/radio options. */
|
|
22
|
+
type CelRestrictedOptionSelectPayload = {
|
|
23
|
+
columnId: string;
|
|
24
|
+
value: string;
|
|
25
|
+
label: string;
|
|
26
|
+
};
|
|
27
|
+
type CelColumnDefinition = {
|
|
28
|
+
/** Must match the API column id when targeting server-side resources. */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Display name in the add-filter menu. */
|
|
31
|
+
title: string;
|
|
32
|
+
/**
|
|
33
|
+
* Section heading this column is listed under in the add-filter menu. Sections appear in the
|
|
34
|
+
* order each group name first occurs in `columns`; columns without a group are listed last
|
|
35
|
+
* under no heading. Omit on every column to get a single flat alphabetical list.
|
|
36
|
+
*
|
|
37
|
+
* Group names are searchable: a phrase matching one keeps that entire section, on top of any
|
|
38
|
+
* columns matched by title.
|
|
39
|
+
*/
|
|
40
|
+
group?: string;
|
|
41
|
+
/** Lowercase natural plural for consolidated multi-value pill copy (e.g. "2 control planes"). */
|
|
42
|
+
pluralTitle: string;
|
|
43
|
+
filterType: CelFilterType;
|
|
44
|
+
/** Enum columns (checkbox / radio); static options only in v1. */
|
|
45
|
+
options?: CelColumnOption[];
|
|
46
|
+
/** Optional override; defaults from `filterType`. */
|
|
47
|
+
allowedOperators?: CelOperator[];
|
|
48
|
+
/** When true, hides the operator UI when only one operator is allowed. Defaults to `false`. */
|
|
49
|
+
hideOnSingleOperator?: boolean;
|
|
50
|
+
/** Pre-fill value when the condition is first added. Skips the initial "pick a value" step. */
|
|
51
|
+
defaultValue?: CelConditionValue;
|
|
52
|
+
/** When a valid compiled expression may be emitted. Defaults by `filterType`. */
|
|
53
|
+
emitOn?: CelEmitOn;
|
|
54
|
+
};
|
|
55
|
+
/** Host-provided schema describing which columns are filterable for a given filter bar. */
|
|
56
|
+
type CelFilterSchema = {
|
|
57
|
+
columns: CelColumnDefinition[];
|
|
58
|
+
};
|
|
59
|
+
type CheckboxCelValue = string[];
|
|
60
|
+
type RadioCelValue = string;
|
|
61
|
+
type TextCelValue = string;
|
|
62
|
+
type MultiTextCelValue = {
|
|
63
|
+
tokens: string[];
|
|
64
|
+
/** Required when `tokens.length > 1`; defaults to `any` in the UI when omitted. */
|
|
65
|
+
quantifier?: 'any' | 'all';
|
|
66
|
+
};
|
|
67
|
+
/** Trusted preset durations emitted as fixed literals in compiled CEL. */
|
|
68
|
+
type RelativeDurationPreset = '24h' | '168h' | '720h';
|
|
69
|
+
type DateCelValue = {
|
|
70
|
+
/** RFC3339 UTC; required for single-point comparators. Mutually exclusive with `preset`. */
|
|
71
|
+
instant?: string;
|
|
72
|
+
/** Required for the range operators (`is_between` / `is_not_between`). Mutually exclusive with `preset`. */
|
|
73
|
+
range?: {
|
|
74
|
+
start: string;
|
|
75
|
+
end: string;
|
|
76
|
+
};
|
|
77
|
+
/** Relative duration preset; mutually exclusive with `instant` / `range`. */
|
|
78
|
+
preset?: RelativeDurationPreset;
|
|
79
|
+
/**
|
|
80
|
+
* True once the user edits a boundary time. While false the operator's default
|
|
81
|
+
* day boundary applies, so an untouched condition compiles exactly as it did
|
|
82
|
+
* before times were selectable. Never set without `instant` / `range` — the
|
|
83
|
+
* `isDateCelValue` guard keys off those fields. Never compiled into CEL; a
|
|
84
|
+
* future parser would need to re-derive it from the instants in the expression.
|
|
85
|
+
*/
|
|
86
|
+
hasTime?: boolean;
|
|
87
|
+
};
|
|
88
|
+
type MapKeyCelValue = {
|
|
89
|
+
key: string;
|
|
90
|
+
/** Required when operator is `has_value` / `does_not_have_value`. */
|
|
91
|
+
value?: string;
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Union of all condition value shapes. The active variant is determined by the
|
|
95
|
+
* condition's `columnId` + schema `filterType`, not a discriminant on the value.
|
|
96
|
+
*/
|
|
97
|
+
type CelConditionValue = CheckboxCelValue | RadioCelValue | TextCelValue | MultiTextCelValue | DateCelValue | MapKeyCelValue;
|
|
98
|
+
/**
|
|
99
|
+
* v1 always `and`; the shape is forward-compatible with `or` and nesting.
|
|
100
|
+
* See `CelFilterGroup.children`, kept recursive so a future nested/OR-group UI
|
|
101
|
+
* is additive rather than a breaking type change.
|
|
102
|
+
*/
|
|
103
|
+
type CelCombinator = 'and';
|
|
104
|
+
type CelFilterGroup = {
|
|
105
|
+
id: string;
|
|
106
|
+
type: 'group';
|
|
107
|
+
combinator: CelCombinator;
|
|
108
|
+
/** Root group is `0`. */
|
|
109
|
+
depth: number;
|
|
110
|
+
children: CelFilterNode[];
|
|
111
|
+
};
|
|
112
|
+
type CelFilterCondition = {
|
|
113
|
+
id: string;
|
|
114
|
+
type: 'condition';
|
|
115
|
+
columnId: string;
|
|
116
|
+
operator: CelOperator;
|
|
117
|
+
/** Undefined on a newly added row until the user edits. */
|
|
118
|
+
value?: CelConditionValue;
|
|
119
|
+
};
|
|
120
|
+
type CelFilterNode = CelFilterGroup | CelFilterCondition;
|
|
121
|
+
type CelFilterTree = {
|
|
122
|
+
root: CelFilterGroup;
|
|
123
|
+
};
|
|
124
|
+
/** Closed union — `validateCondition` and `compileCelFilterTree` emit only these codes. */
|
|
125
|
+
type ValidationIssueCode = 'missing_column' | 'missing_value' | 'missing_key' | 'missing_tokens' | 'missing_quantifier' | 'missing_instant' | 'missing_range' | 'missing_duration' | 'unknown_column' | 'illegal_operator' | 'invalid_date_mode' | 'regex_too_long' | 'invalid_timestamp' | 'invalid_date_range' | 'nesting_depth_exceeded';
|
|
126
|
+
type ValidationSeverity = 'incomplete' | 'invalid';
|
|
127
|
+
type ValidationIssue = {
|
|
128
|
+
code: ValidationIssueCode;
|
|
129
|
+
message: string;
|
|
130
|
+
severity: ValidationSeverity;
|
|
131
|
+
nodeId: string;
|
|
132
|
+
nodeType: 'condition' | 'group';
|
|
133
|
+
/** Sub-target within the condition (e.g. `value`, `key`, `instant`). */
|
|
134
|
+
field?: string;
|
|
135
|
+
};
|
|
136
|
+
type CompileStatus = 'valid' | 'incomplete' | 'invalid';
|
|
137
|
+
type CompileResult = {
|
|
138
|
+
status: CompileStatus;
|
|
139
|
+
/** Present when `status === 'valid'` (may be `""`). */
|
|
140
|
+
expression?: string;
|
|
141
|
+
issues: ValidationIssue[];
|
|
142
|
+
/** True iff the raw compile status is `valid`; the API / parent emission gate. */
|
|
143
|
+
isEmitReady: boolean;
|
|
144
|
+
};
|
|
145
|
+
type CelValidationMeta = {
|
|
146
|
+
editingConditionId: string | null;
|
|
147
|
+
committedConditionIds: Set<string>;
|
|
148
|
+
};
|
|
149
|
+
/** Which pill sub-surface is open: operator picker, multiText quantifier, or the value editor. */
|
|
150
|
+
type PillActiveSurface = 'operator' | 'quantifier' | 'value';
|
|
151
|
+
type CelFilterBarProps = {
|
|
152
|
+
tree: CelFilterTree;
|
|
153
|
+
onChange: (tree: CelFilterTree) => void;
|
|
154
|
+
schema: CelFilterSchema;
|
|
155
|
+
onCompileResultChange?: (result: CompileResult) => void;
|
|
156
|
+
/** Invoked when the user clicks a disabled option (instead of toggling the filter value). */
|
|
157
|
+
onRestrictedOptionSelect?: (payload: CelRestrictedOptionSelectPayload) => void;
|
|
158
|
+
/** Default `false`. */
|
|
159
|
+
showClearButton?: boolean;
|
|
160
|
+
className?: string;
|
|
161
|
+
};
|
|
162
|
+
declare const isCelFilterGroup: (node: CelFilterNode) => node is CelFilterGroup;
|
|
163
|
+
declare const isCelFilterCondition: (node: CelFilterNode) => node is CelFilterCondition;
|
|
164
|
+
/** Checkbox values are arrays of option value strings. */
|
|
165
|
+
declare const isCheckboxCelValue: (value: unknown) => value is CheckboxCelValue;
|
|
166
|
+
declare const isMultiTextCelValue: (value: unknown) => value is MultiTextCelValue;
|
|
167
|
+
declare const isDateCelValue: (value: unknown) => value is DateCelValue;
|
|
168
|
+
declare const isMapKeyCelValue: (value: unknown) => value is MapKeyCelValue;
|
|
169
|
+
|
|
170
|
+
export { type CelColumnDefinition as C, type DateCelValue as D, type MapKeyCelValue as M, type PillActiveSurface as P, type RadioCelValue as R, type ValidationIssue as V, type CelColumnOption as a, type CelConditionValue as b, type CelFilterBarProps as c, type CelFilterCondition as d, type CelFilterGroup as e, type CelFilterSchema as f, type CelFilterTree as g, type CelOperator as h, type CelRestrictedOptionSelectPayload as i, type CheckboxCelValue as j, type CompileResult as k, type MultiTextCelValue as l, type RelativeDurationPreset as m, isCelFilterCondition as n, isCelFilterGroup as o, isCheckboxCelValue as p, isDateCelValue as q, isMapKeyCelValue as r, isMultiTextCelValue as s, type CelValidationMeta as t, type CelFilterType as u, type CelFilterShape as v, type CelEmitOn as w };
|