@burdenoff/microfe-product 2026.525.2 → 2026.525.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/node_modules/clsx/dist/clsx.js +18 -0
- package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +1674 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
- package/dist/product-management/modules/content-pages/components/ContentPageForm.d.ts.map +1 -1
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js +371 -371
- package/dist/product-management/modules/content-pages/components/ContentPageForm.js.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.d.ts.map +1 -1
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js +147 -152
- package/dist/product-management/modules/content-pages/pages/ContentPagesListPage.js.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.d.ts.map +1 -1
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js +96 -107
- package/dist/product-management/modules/press-kit/components/PressKitAssetForm.js.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.d.ts.map +1 -1
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js +114 -119
- package/dist/product-management/modules/press-kit/pages/PressKitListPage.js.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.d.ts.map +1 -1
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js +136 -141
- package/dist/product-management/modules/shortcuts/pages/ShortcutsListPage.js.map +1 -1
- package/dist/product-management/shared/components/input/ProductCombobox.d.ts +29 -0
- package/dist/product-management/shared/components/input/ProductCombobox.d.ts.map +1 -0
- package/dist/product-management/shared/components/input/ProductCombobox.js +107 -0
- package/dist/product-management/shared/components/input/ProductCombobox.js.map +1 -0
- package/dist/product-management/shared/hooks/useDebounced.d.ts +6 -0
- package/dist/product-management/shared/hooks/useDebounced.d.ts.map +1 -0
- package/dist/product-management/shared/hooks/useDebounced.js +13 -0
- package/dist/product-management/shared/hooks/useDebounced.js.map +1 -0
- package/dist/product-management/shared/index.js +1 -0
- package/dist/product-management/shared/utils/cn.js +10 -0
- package/dist/product-management/shared/utils/cn.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { useProduct as e, useProducts as t } from "../../../modules/products/hooks/useProducts.js";
|
|
2
|
+
import { cn as n } from "../../utils/cn.js";
|
|
3
|
+
import { useEffect as r, useState as i } from "react";
|
|
4
|
+
import { Check as a, ChevronsUpDown as o } from "lucide-react";
|
|
5
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
|
+
import { Command as l, CommandEmpty as u, CommandInput as d, CommandItem as f, CommandList as p, Popover as m, PopoverContent as h, PopoverTrigger as g } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
//#region src/product-management/shared/components/input/ProductCombobox.tsx
|
|
8
|
+
function _(e, t) {
|
|
9
|
+
let [n, a] = i(e);
|
|
10
|
+
return r(() => {
|
|
11
|
+
let n = setTimeout(() => a(e), t);
|
|
12
|
+
return () => clearTimeout(n);
|
|
13
|
+
}, [e, t]), n;
|
|
14
|
+
}
|
|
15
|
+
function v({ value: r, onChange: v, disabled: y = !1, required: b = !1, placeholder: x = "Select a product…", id: S, error: C }) {
|
|
16
|
+
let [w, T] = i(!1), [E, D] = i(""), O = _(E.trim(), 200), { products: k, loading: A } = t(O ? { search: O } : void 0, { limit: 100 }), { product: j, loading: M } = e(r), N = j ? `${j.name} (${j.slug})` : r ? M ? "Loading…" : r : x, P = n("w-full flex items-center justify-between gap-2 px-3 py-2", "bg-surface", "border border-default", "rounded-lg", "text-left text-sm text-text-primary", "focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]", "disabled:bg-muted disabled:cursor-not-allowed", "transition-all duration-200", C && "border-[var(--color-status-error)]", !j && "text-text-tertiary");
|
|
17
|
+
return /* @__PURE__ */ c(m, {
|
|
18
|
+
open: w,
|
|
19
|
+
onOpenChange: (e) => {
|
|
20
|
+
T(e), e || D("");
|
|
21
|
+
},
|
|
22
|
+
children: [/* @__PURE__ */ s(g, {
|
|
23
|
+
asChild: !0,
|
|
24
|
+
children: /* @__PURE__ */ c("button", {
|
|
25
|
+
type: "button",
|
|
26
|
+
id: S,
|
|
27
|
+
role: "combobox",
|
|
28
|
+
"aria-expanded": w,
|
|
29
|
+
"aria-required": b,
|
|
30
|
+
"aria-invalid": C ? !0 : void 0,
|
|
31
|
+
disabled: y,
|
|
32
|
+
className: P,
|
|
33
|
+
children: [/* @__PURE__ */ s("span", {
|
|
34
|
+
className: "truncate",
|
|
35
|
+
children: N
|
|
36
|
+
}), /* @__PURE__ */ s(o, {
|
|
37
|
+
size: 16,
|
|
38
|
+
className: "shrink-0 text-text-tertiary",
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
42
|
+
}), /* @__PURE__ */ s(h, {
|
|
43
|
+
align: "start",
|
|
44
|
+
className: "w-[var(--radix-popover-trigger-width)] p-0 border border-default bg-surface",
|
|
45
|
+
children: /* @__PURE__ */ c(l, {
|
|
46
|
+
shouldFilter: !1,
|
|
47
|
+
className: "bg-surface text-text-primary",
|
|
48
|
+
children: [/* @__PURE__ */ s(d, {
|
|
49
|
+
value: E,
|
|
50
|
+
onValueChange: D,
|
|
51
|
+
placeholder: "Search products…",
|
|
52
|
+
className: "text-text-primary placeholder:text-text-tertiary"
|
|
53
|
+
}), /* @__PURE__ */ c(p, { children: [
|
|
54
|
+
/* @__PURE__ */ s(u, {
|
|
55
|
+
className: "text-text-tertiary",
|
|
56
|
+
children: A ? "Searching…" : "No products found."
|
|
57
|
+
}),
|
|
58
|
+
!b && /* @__PURE__ */ c(f, {
|
|
59
|
+
value: "__none__",
|
|
60
|
+
onSelect: () => {
|
|
61
|
+
v(""), T(!1);
|
|
62
|
+
},
|
|
63
|
+
className: "text-text-tertiary",
|
|
64
|
+
children: [/* @__PURE__ */ s(a, {
|
|
65
|
+
size: 16,
|
|
66
|
+
className: n("shrink-0", r === "" ? "opacity-100" : "opacity-0"),
|
|
67
|
+
"aria-hidden": "true"
|
|
68
|
+
}), /* @__PURE__ */ s("span", {
|
|
69
|
+
className: "truncate italic",
|
|
70
|
+
children: "None"
|
|
71
|
+
})]
|
|
72
|
+
}),
|
|
73
|
+
k.map((e) => /* @__PURE__ */ c(f, {
|
|
74
|
+
value: e.id,
|
|
75
|
+
onSelect: () => {
|
|
76
|
+
v(e.id), T(!1);
|
|
77
|
+
},
|
|
78
|
+
className: "text-text-primary",
|
|
79
|
+
children: [/* @__PURE__ */ s(a, {
|
|
80
|
+
size: 16,
|
|
81
|
+
className: n("shrink-0", e.id === r ? "opacity-100" : "opacity-0"),
|
|
82
|
+
"aria-hidden": "true"
|
|
83
|
+
}), /* @__PURE__ */ c("span", {
|
|
84
|
+
className: "truncate",
|
|
85
|
+
children: [
|
|
86
|
+
e.name,
|
|
87
|
+
" ",
|
|
88
|
+
/* @__PURE__ */ c("span", {
|
|
89
|
+
className: "text-text-tertiary",
|
|
90
|
+
children: [
|
|
91
|
+
"(",
|
|
92
|
+
e.slug,
|
|
93
|
+
")"
|
|
94
|
+
]
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
})]
|
|
98
|
+
}, e.id))
|
|
99
|
+
] })]
|
|
100
|
+
})
|
|
101
|
+
})]
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
export { v as ProductCombobox };
|
|
106
|
+
|
|
107
|
+
//# sourceMappingURL=ProductCombobox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProductCombobox.js","names":[],"sources":["../../../../../src/product-management/shared/components/input/ProductCombobox.tsx"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { Check, ChevronsUpDown } from 'lucide-react';\nimport {\n Command,\n CommandEmpty,\n CommandInput,\n CommandItem,\n CommandList,\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from '@burdenoff/fe-libs/ui';\n\nimport { cn } from '../../utils/cn';\nimport { useProduct, useProducts } from '../../../modules/products/hooks/useProducts';\n\ninterface ProductComboboxProps {\n /** Selected product id (controlled). Empty string = nothing selected. */\n value: string;\n /** Called with the selected product id ('' when cleared). */\n onChange: (id: string) => void;\n disabled?: boolean;\n required?: boolean;\n placeholder?: string;\n /** Id for the trigger button — pairs with an external <label htmlFor>. */\n id?: string;\n /** Optional error message — toggles the invalid border + aria-invalid. */\n error?: string;\n}\n\n/** Debounce a value so each keystroke doesn't fire a query. */\nfunction useDebounced<T>(value: T, ms: number): T {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n const t = setTimeout(() => setDebounced(value), ms);\n return () => clearTimeout(t);\n }, [value, ms]);\n return debounced;\n}\n\n/**\n * ProductCombobox — searchable single-select for platform products.\n *\n * A button trigger shows the selected product as `name (slug)` (or a\n * placeholder) and opens a Popover with a cmdk Command. Built entirely on the\n * existing fe-libs `ui` primitives (Command + Popover) — no new dependencies.\n *\n * Search is performed **server-side** (`useProducts({ search })`) so any\n * product is reachable, not just the first page — important now that the\n * free-text product-id input was replaced by this control. The current\n * selection's label is resolved independently via `useProduct(value)`, so it\n * renders correctly even while the list is filtered to a different search.\n */\nexport function ProductCombobox({\n value,\n onChange,\n disabled = false,\n required = false,\n placeholder = 'Select a product…',\n id,\n error,\n}: ProductComboboxProps) {\n const [open, setOpen] = useState(false);\n const [search, setSearch] = useState('');\n const debouncedSearch = useDebounced(search.trim(), 200);\n\n // Options: server-side search, so any product is reachable (no client-only cap).\n const { products, loading } = useProducts(\n debouncedSearch ? { search: debouncedSearch } : undefined,\n { limit: 100 }\n );\n\n // Resolve the selected product's label independently of the (searchable) list,\n // so a current selection still shows even when the list is filtered elsewhere.\n const { product: selectedProduct, loading: selectedLoading } = useProduct(value);\n\n // Resolved → name (slug). Still fetching → \"Loading…\". Set but unresolved\n // (e.g. a deleted/stale product id) → show the raw id, not a permanent spinner.\n // Empty → placeholder.\n const triggerLabel = selectedProduct\n ? `${selectedProduct.name} (${selectedProduct.slug})`\n : value\n ? selectedLoading\n ? 'Loading…'\n : value\n : placeholder;\n\n const triggerClassName = cn(\n 'w-full flex items-center justify-between gap-2 px-3 py-2',\n 'bg-surface',\n 'border border-default',\n 'rounded-lg',\n 'text-left text-sm text-text-primary',\n 'focus:outline-none focus:ring-2 focus:ring-[var(--color-border-focus)]',\n 'disabled:bg-muted disabled:cursor-not-allowed',\n 'transition-all duration-200',\n error && 'border-[var(--color-status-error)]',\n !selectedProduct && 'text-text-tertiary'\n );\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n setOpen(next);\n // Reset the query on close so reopening starts fresh, not pre-filtered.\n if (!next) setSearch('');\n }}\n >\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n id={id}\n role=\"combobox\"\n aria-expanded={open}\n aria-required={required}\n aria-invalid={error ? true : undefined}\n disabled={disabled}\n className={triggerClassName}\n >\n <span className=\"truncate\">{triggerLabel}</span>\n <ChevronsUpDown size={16} className=\"shrink-0 text-text-tertiary\" aria-hidden=\"true\" />\n </button>\n </PopoverTrigger>\n <PopoverContent\n align=\"start\"\n className=\"w-[var(--radix-popover-trigger-width)] p-0 border border-default bg-surface\"\n >\n {/* Search is server-side → disable cmdk's client filter so we render\n exactly what the query returned. */}\n <Command shouldFilter={false} className=\"bg-surface text-text-primary\">\n <CommandInput\n value={search}\n onValueChange={setSearch}\n placeholder=\"Search products…\"\n className=\"text-text-primary placeholder:text-text-tertiary\"\n />\n <CommandList>\n <CommandEmpty className=\"text-text-tertiary\">\n {loading ? 'Searching…' : 'No products found.'}\n </CommandEmpty>\n {/* Optional fields need a way back to \"no product\" — emit '' so\n callers like ContentPageForm (productId || undefined) can clear\n an existing association. Hidden when the field is required. */}\n {!required && (\n <CommandItem\n value=\"__none__\"\n onSelect={() => {\n onChange('');\n setOpen(false);\n }}\n className=\"text-text-tertiary\"\n >\n <Check\n size={16}\n className={cn('shrink-0', value === '' ? 'opacity-100' : 'opacity-0')}\n aria-hidden=\"true\"\n />\n <span className=\"truncate italic\">None</span>\n </CommandItem>\n )}\n {products.map((product) => (\n <CommandItem\n key={product.id}\n value={product.id}\n onSelect={() => {\n onChange(product.id);\n setOpen(false);\n }}\n className=\"text-text-primary\"\n >\n <Check\n size={16}\n className={cn('shrink-0', product.id === value ? 'opacity-100' : 'opacity-0')}\n aria-hidden=\"true\"\n />\n <span className=\"truncate\">\n {product.name} <span className=\"text-text-tertiary\">({product.slug})</span>\n </span>\n </CommandItem>\n ))}\n </CommandList>\n </Command>\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;AA+BA,SAAS,EAAgB,GAAU,GAAe;CAChD,IAAM,CAAC,GAAW,KAAgB,EAAS,EAAM;AAKjD,QAJA,QAAgB;EACd,IAAM,IAAI,iBAAiB,EAAa,EAAM,EAAE,EAAG;AACnD,eAAa,aAAa,EAAE;IAC3B,CAAC,GAAO,EAAG,CAAC,EACR;;AAgBT,SAAgB,EAAgB,EAC9B,UACA,aACA,cAAW,IACX,cAAW,IACX,iBAAc,qBACd,OACA,YACuB;CACvB,IAAM,CAAC,GAAM,KAAW,EAAS,GAAM,EACjC,CAAC,GAAQ,KAAa,EAAS,GAAG,EAClC,IAAkB,EAAa,EAAO,MAAM,EAAE,IAAI,EAGlD,EAAE,aAAU,eAAY,EAC5B,IAAkB,EAAE,QAAQ,GAAiB,GAAG,KAAA,GAChD,EAAE,OAAO,KAAK,CACf,EAIK,EAAE,SAAS,GAAiB,SAAS,MAAoB,EAAW,EAAM,EAK1E,IAAe,IACjB,GAAG,EAAgB,KAAK,IAAI,EAAgB,KAAK,KACjD,IACE,IACE,aACA,IACF,GAEA,IAAmB,EACvB,4DACA,cACA,yBACA,cACA,uCACA,0EACA,iDACA,+BACA,KAAS,sCACT,CAAC,KAAmB,qBACrB;AAED,QACE,kBAAC,GAAD;EACQ;EACN,eAAe,MAAS;AAGtB,GA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AAE,EAAQ;UAAK;UAAQ;;QACtE;SACK;QAhBP,EAAQ,GAgBD,CACd;KACU,EAAA,CAAA,CACN;;GACK,CAAA,CACT"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Debounce a value so rapid changes (e.g. typing in a search box) settle before
|
|
3
|
+
* downstream use — avoids firing a query (and flashing a list) on every keystroke.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useDebounced<T>(value: T, ms: number): T;
|
|
6
|
+
//# sourceMappingURL=useDebounced.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounced.d.ts","sourceRoot":"","sources":["../../../../src/product-management/shared/hooks/useDebounced.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAOvD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
//#region src/product-management/shared/hooks/useDebounced.ts
|
|
3
|
+
function n(n, r) {
|
|
4
|
+
let [i, a] = t(n);
|
|
5
|
+
return e(() => {
|
|
6
|
+
let e = setTimeout(() => a(n), r);
|
|
7
|
+
return () => clearTimeout(e);
|
|
8
|
+
}, [n, r]), i;
|
|
9
|
+
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { n as useDebounced };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=useDebounced.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDebounced.js","names":[],"sources":["../../../../src/product-management/shared/hooks/useDebounced.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\n/**\n * Debounce a value so rapid changes (e.g. typing in a search box) settle before\n * downstream use — avoids firing a query (and flashing a list) on every keystroke.\n */\nexport function useDebounced<T>(value: T, ms: number): T {\n const [debounced, setDebounced] = useState(value);\n useEffect(() => {\n const t = setTimeout(() => setDebounced(value), ms);\n return () => clearTimeout(t);\n }, [value, ms]);\n return debounced;\n}\n"],"mappings":";;AAMA,SAAgB,EAAgB,GAAU,GAAe;CACvD,IAAM,CAAC,GAAW,KAAgB,EAAS,EAAM;AAKjD,QAJA,QAAgB;EACd,IAAM,IAAI,iBAAiB,EAAa,EAAM,EAAE,EAAG;AACnD,eAAa,aAAa,EAAE;IAC3B,CAAC,GAAO,EAAG,CAAC,EACR"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import e from "../../../node_modules/clsx/dist/clsx.js";
|
|
2
|
+
import { twMerge as t } from "../../../node_modules/tailwind-merge/dist/bundle-mjs.js";
|
|
3
|
+
//#region src/product-management/shared/utils/cn.ts
|
|
4
|
+
function n(...n) {
|
|
5
|
+
return t(e(n));
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { n as cn };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=cn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.js","names":[],"sources":["../../../../src/product-management/shared/utils/cn.ts"],"sourcesContent":["import { clsx, type ClassValue } from 'clsx';\nimport { twMerge } from 'tailwind-merge';\n\n/**\n * Merge Tailwind CSS classes safely\n * Combines clsx for conditional classes and twMerge for Tailwind deduplication\n */\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n"],"mappings":";;;AAOA,SAAgB,EAAG,GAAG,GAAsB;AAC1C,QAAO,EAAQ,EAAK,EAAO,CAAC"}
|