@flamingo-stack/openframe-frontend-core 0.0.232 → 0.0.233
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/{chunk-MQHM7DZZ.js → chunk-4ZUR4RJ7.js} +2 -2
- package/dist/{chunk-CBFXWWS7.js → chunk-55IS2VJD.js} +795 -770
- package/dist/chunk-55IS2VJD.js.map +1 -0
- package/dist/{chunk-ZMLYGCFD.cjs → chunk-7CCNTX6H.cjs} +39 -14
- package/dist/chunk-7CCNTX6H.cjs.map +1 -0
- package/dist/{chunk-XZHVCPXN.cjs → chunk-7RR7C26P.cjs} +7 -7
- package/dist/{chunk-XZHVCPXN.cjs.map → chunk-7RR7C26P.cjs.map} +1 -1
- package/dist/{chunk-KQJXNBIS.cjs → chunk-L7AKGXCD.cjs} +10 -10
- package/dist/{chunk-KQJXNBIS.cjs.map → chunk-L7AKGXCD.cjs.map} +1 -1
- package/dist/{chunk-5TJUN6ON.js → chunk-N3CB52DX.js} +2 -2
- package/dist/{chunk-ZHGIILP7.cjs → chunk-QZFUVNYV.cjs} +25 -25
- package/dist/{chunk-ZHGIILP7.cjs.map → chunk-QZFUVNYV.cjs.map} +1 -1
- package/dist/{chunk-OYG66WRJ.js → chunk-T7REIQSK.js} +2 -2
- package/dist/{chunk-LG33WCJY.cjs → chunk-VENRDZ74.cjs} +9 -9
- package/dist/{chunk-LG33WCJY.cjs.map → chunk-VENRDZ74.cjs.map} +1 -1
- package/dist/{chunk-UTUUCSKU.js → chunk-VHPEQK2V.js} +2 -2
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +3 -3
- package/dist/components/contact/index.js +2 -2
- package/dist/components/features/entity-tag-badges.d.ts +14 -6
- package/dist/components/features/entity-tag-badges.d.ts.map +1 -1
- package/dist/components/features/index.cjs +2 -2
- package/dist/components/features/index.js +1 -1
- package/dist/components/index.cjs +77 -77
- package/dist/components/index.js +4 -4
- package/dist/components/navigation/index.cjs +2 -2
- package/dist/components/navigation/index.js +1 -1
- package/dist/components/onboarding-guides/index.cjs +26 -26
- package/dist/components/onboarding-guides/index.js +3 -3
- package/dist/components/tickets/index.cjs +64 -64
- package/dist/components/tickets/index.js +4 -4
- package/dist/components/ui/index.cjs +2 -2
- package/dist/components/ui/index.js +1 -1
- package/dist/components/ui/search-input.d.ts.map +1 -1
- package/dist/components/ui/tag.d.ts +1 -1
- package/dist/components/ui/tag.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/components/features/entity-tag-badges.tsx +47 -16
- package/src/components/ui/search-input.tsx +5 -2
- package/src/components/ui/tag.tsx +7 -0
- package/dist/chunk-CBFXWWS7.js.map +0 -1
- package/dist/chunk-ZMLYGCFD.cjs.map +0 -1
- /package/dist/{chunk-MQHM7DZZ.js.map → chunk-4ZUR4RJ7.js.map} +0 -0
- /package/dist/{chunk-5TJUN6ON.js.map → chunk-N3CB52DX.js.map} +0 -0
- /package/dist/{chunk-OYG66WRJ.js.map → chunk-T7REIQSK.js.map} +0 -0
- /package/dist/{chunk-UTUUCSKU.js.map → chunk-VHPEQK2V.js.map} +0 -0
|
@@ -1,32 +1,63 @@
|
|
|
1
|
+
import Link from 'next/link'
|
|
1
2
|
import { StatusBadge } from '../ui/status-badge'
|
|
2
3
|
import type { TagAssoc } from '../../types/blog'
|
|
3
4
|
|
|
4
5
|
interface EntityTagBadgesProps {
|
|
5
6
|
/** Flat `<entity>_tags[]` association array (from entity_tags hydration). */
|
|
6
7
|
tags?: TagAssoc[] | null
|
|
8
|
+
/**
|
|
9
|
+
* When set, each badge links to `${basePath}?tags=${slug}` (clickable, SPA nav
|
|
10
|
+
* via next/link). Omit for a non-interactive display (badges with no slug also
|
|
11
|
+
* render non-interactive even when basePath is set).
|
|
12
|
+
*/
|
|
13
|
+
basePath?: string
|
|
14
|
+
/** Cap visible badges; the remainder collapse into a "+N" badge. */
|
|
15
|
+
max?: number
|
|
7
16
|
/** Extra classes on the wrapper row. */
|
|
8
17
|
className?: string
|
|
9
18
|
}
|
|
10
19
|
|
|
20
|
+
// The ONE tag-badge skin (OpenFrame design): rounded-rect, font-mono uppercase
|
|
21
|
+
// StatusBadge on ods-card + ods-border. Clickable badges add the accent hover.
|
|
22
|
+
const BADGE_CLASS = 'bg-ods-card border border-ods-border'
|
|
23
|
+
|
|
11
24
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* nothing when there are no tags.
|
|
25
|
+
* THE single tag-badge renderer for the whole product (hub + lib). Renders the
|
|
26
|
+
* OpenFrame `StatusBadge` chip skin for a flat `<entity>_tags[]` array, optionally
|
|
27
|
+
* clickable (links each tag to its filtered list via `basePath`). The hub's
|
|
28
|
+
* `EntityTagList` delegates here so there is exactly one tag-display design.
|
|
29
|
+
* Renders nothing when there are no tags.
|
|
17
30
|
*/
|
|
18
|
-
export function EntityTagBadges({ tags, className }: EntityTagBadgesProps) {
|
|
19
|
-
|
|
31
|
+
export function EntityTagBadges({ tags, basePath, max, className }: EntityTagBadgesProps) {
|
|
32
|
+
const items = (tags || []).filter((t): t is TagAssoc => !!t && !!t.name)
|
|
33
|
+
if (items.length === 0) return null
|
|
34
|
+
|
|
35
|
+
// Only null/undefined means "no cap"; max={0} shows none, negatives clamp to 0.
|
|
36
|
+
const visibleLimit = max == null ? items.length : Math.max(0, max)
|
|
37
|
+
const shown = items.slice(0, visibleLimit)
|
|
38
|
+
const overflow = items.length - shown.length
|
|
39
|
+
|
|
20
40
|
return (
|
|
21
|
-
<div className={`flex flex-wrap gap-2 w-full ${className || ''}`}>
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
<div className={`flex flex-wrap items-center gap-2 w-full ${className || ''}`}>
|
|
42
|
+
{shown.map((tag) => {
|
|
43
|
+
const key = tag.tag_id ?? tag.id ?? tag.slug ?? tag.name
|
|
44
|
+
const label = (tag.name || '').toUpperCase()
|
|
45
|
+
if (basePath && tag.slug) {
|
|
46
|
+
return (
|
|
47
|
+
<Link key={key} href={`${basePath}?tags=${tag.slug}`} className="inline-flex">
|
|
48
|
+
<StatusBadge
|
|
49
|
+
text={label}
|
|
50
|
+
variant="card"
|
|
51
|
+
className={`${BADGE_CLASS} cursor-pointer transition-colors hover:border-ods-accent`}
|
|
52
|
+
/>
|
|
53
|
+
</Link>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
return <StatusBadge key={key} text={label} variant="card" className={BADGE_CLASS} />
|
|
57
|
+
})}
|
|
58
|
+
{overflow > 0 && (
|
|
59
|
+
<StatusBadge text={`+${overflow}`} variant="card" className={`${BADGE_CLASS} text-ods-text-secondary`} />
|
|
60
|
+
)}
|
|
30
61
|
</div>
|
|
31
62
|
)
|
|
32
63
|
}
|
|
@@ -114,13 +114,16 @@ const innerInputStyles = cn(
|
|
|
114
114
|
// Helper: chip variant → Tag variant mapping
|
|
115
115
|
// ---------------------------------------------------------------------------
|
|
116
116
|
|
|
117
|
-
function chipVariantToTagVariant(variant?: FilterChipData["variant"]): "primary" | "outline" {
|
|
117
|
+
function chipVariantToTagVariant(variant?: FilterChipData["variant"]): "primary" | "outline" | "badge" {
|
|
118
118
|
switch (variant) {
|
|
119
119
|
case "selected":
|
|
120
120
|
return "primary"
|
|
121
|
+
// Content tags render with the unified badge skin (ods-card + ods-border,
|
|
122
|
+
// mono uppercase) — identical to the public EntityTagBadges display.
|
|
123
|
+
case "tag":
|
|
124
|
+
return "badge"
|
|
121
125
|
case "category":
|
|
122
126
|
case "subcategory":
|
|
123
|
-
case "tag":
|
|
124
127
|
default:
|
|
125
128
|
return "outline"
|
|
126
129
|
}
|
|
@@ -42,6 +42,13 @@ const tagVariants = cva(
|
|
|
42
42
|
"bg-[var(--ods-system-greys-soft-grey)] text-[var(--ods-system-greys-grey)]",
|
|
43
43
|
"hover:bg-[var(--ods-system-greys-soft-grey-hover)] active:bg-[var(--ods-system-greys-soft-grey-action)]",
|
|
44
44
|
],
|
|
45
|
+
// Matches the EntityTagBadges / StatusBadge tag skin (ods-card + ods-border,
|
|
46
|
+
// mono uppercase) so the tag-editor chips render identically to the public
|
|
47
|
+
// tag badges. Used for FilterChipData variant 'tag' (see search-input).
|
|
48
|
+
badge: [
|
|
49
|
+
"bg-ods-card text-ods-text-primary border border-ods-border font-mono uppercase tracking-wide",
|
|
50
|
+
"hover:border-ods-accent transition-colors",
|
|
51
|
+
],
|
|
45
52
|
},
|
|
46
53
|
},
|
|
47
54
|
defaultVariants: {
|