@burdenoff/microfe-coolandlovely 2026.706.1 → 2026.706.3

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.
Files changed (89) hide show
  1. package/dist/coolandlovely/CoolAndLovelyRoot.js +62 -46
  2. package/dist/coolandlovely/CoolAndLovelyRoot.js.map +1 -1
  3. package/dist/coolandlovely/CoolAndLovelyRoutes.js +14 -6
  4. package/dist/coolandlovely/CoolAndLovelyRoutes.js.map +1 -1
  5. package/dist/coolandlovely/components/ActorName.js +29 -0
  6. package/dist/coolandlovely/components/ActorName.js.map +1 -0
  7. package/dist/coolandlovely/components/AddToLookbookButton.js +81 -0
  8. package/dist/coolandlovely/components/AddToLookbookButton.js.map +1 -0
  9. package/dist/coolandlovely/components/BrandCover.js +39 -0
  10. package/dist/coolandlovely/components/BrandCover.js.map +1 -0
  11. package/dist/coolandlovely/components/BrandCreatorAvatars.js +57 -0
  12. package/dist/coolandlovely/components/BrandCreatorAvatars.js.map +1 -0
  13. package/dist/coolandlovely/components/ColourSwatchRow.js +86 -0
  14. package/dist/coolandlovely/components/ColourSwatchRow.js.map +1 -0
  15. package/dist/coolandlovely/components/Comments.js +109 -0
  16. package/dist/coolandlovely/components/Comments.js.map +1 -0
  17. package/dist/coolandlovely/components/Field.js +22 -2
  18. package/dist/coolandlovely/components/Field.js.map +1 -1
  19. package/dist/coolandlovely/components/FileImage.js +17 -0
  20. package/dist/coolandlovely/components/FileImage.js.map +1 -0
  21. package/dist/coolandlovely/components/FollowButton.js +24 -0
  22. package/dist/coolandlovely/components/FollowButton.js.map +1 -0
  23. package/dist/coolandlovely/components/ImageUploadField.js +153 -0
  24. package/dist/coolandlovely/components/ImageUploadField.js.map +1 -0
  25. package/dist/coolandlovely/components/LookCard.js +77 -0
  26. package/dist/coolandlovely/components/LookCard.js.map +1 -0
  27. package/dist/coolandlovely/components/MetricsCard.js +1 -1
  28. package/dist/coolandlovely/components/MetricsCard.js.map +1 -1
  29. package/dist/coolandlovely/components/ShopItemCard.js +45 -0
  30. package/dist/coolandlovely/components/ShopItemCard.js.map +1 -0
  31. package/dist/coolandlovely/components/StepTracker.js +35 -0
  32. package/dist/coolandlovely/components/StepTracker.js.map +1 -0
  33. package/dist/coolandlovely/components/Thumbnail.js +25 -14
  34. package/dist/coolandlovely/components/Thumbnail.js.map +1 -1
  35. package/dist/coolandlovely/components/VisibilityChip.js +32 -0
  36. package/dist/coolandlovely/components/VisibilityChip.js.map +1 -0
  37. package/dist/coolandlovely/hooks/index.js +2 -0
  38. package/dist/coolandlovely/hooks/useComments.js +68 -0
  39. package/dist/coolandlovely/hooks/useComments.js.map +1 -0
  40. package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js +155 -60
  41. package/dist/coolandlovely/hooks/useCoolAndLovelyApi.js.map +1 -1
  42. package/dist/coolandlovely/hooks/useFiles.js +111 -0
  43. package/dist/coolandlovely/hooks/useFiles.js.map +1 -0
  44. package/dist/coolandlovely/pages/HomePage.js +130 -133
  45. package/dist/coolandlovely/pages/HomePage.js.map +1 -1
  46. package/dist/coolandlovely/pages/brands/BrandDetailPage.js +261 -228
  47. package/dist/coolandlovely/pages/brands/BrandDetailPage.js.map +1 -1
  48. package/dist/coolandlovely/pages/brands/BrandFormPage.js +146 -104
  49. package/dist/coolandlovely/pages/brands/BrandFormPage.js.map +1 -1
  50. package/dist/coolandlovely/pages/brands/BrandsListPage.js +13 -11
  51. package/dist/coolandlovely/pages/brands/BrandsListPage.js.map +1 -1
  52. package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.js +117 -95
  53. package/dist/coolandlovely/pages/collaborations/CollaborationDetailPage.js.map +1 -1
  54. package/dist/coolandlovely/pages/collaborations/CollaborationFormPage.js +1 -1
  55. package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.js +50 -43
  56. package/dist/coolandlovely/pages/collaborations/CollaborationsListPage.js.map +1 -1
  57. package/dist/coolandlovely/pages/collections/CollectionDetailPage.js +134 -107
  58. package/dist/coolandlovely/pages/collections/CollectionDetailPage.js.map +1 -1
  59. package/dist/coolandlovely/pages/collections/CollectionFormPage.js +117 -102
  60. package/dist/coolandlovely/pages/collections/CollectionFormPage.js.map +1 -1
  61. package/dist/coolandlovely/pages/collections/CollectionsListPage.js +59 -54
  62. package/dist/coolandlovely/pages/collections/CollectionsListPage.js.map +1 -1
  63. package/dist/coolandlovely/pages/discover/DiscoverPage.js +223 -0
  64. package/dist/coolandlovely/pages/discover/DiscoverPage.js.map +1 -0
  65. package/dist/coolandlovely/pages/items/StyleItemDetailPage.js +176 -144
  66. package/dist/coolandlovely/pages/items/StyleItemDetailPage.js.map +1 -1
  67. package/dist/coolandlovely/pages/items/StyleItemFormPage.js +144 -130
  68. package/dist/coolandlovely/pages/items/StyleItemFormPage.js.map +1 -1
  69. package/dist/coolandlovely/pages/items/StyleItemsListPage.js +73 -62
  70. package/dist/coolandlovely/pages/items/StyleItemsListPage.js.map +1 -1
  71. package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.js +215 -102
  72. package/dist/coolandlovely/pages/lookbooks/LookbookDetailPage.js.map +1 -1
  73. package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js +115 -86
  74. package/dist/coolandlovely/pages/lookbooks/LookbooksListPage.js.map +1 -1
  75. package/dist/coolandlovely/pages/looks/LookDetailPage.js +217 -155
  76. package/dist/coolandlovely/pages/looks/LookDetailPage.js.map +1 -1
  77. package/dist/coolandlovely/pages/looks/LookFormPage.js +147 -96
  78. package/dist/coolandlovely/pages/looks/LookFormPage.js.map +1 -1
  79. package/dist/coolandlovely/pages/looks/LooksListPage.js +60 -95
  80. package/dist/coolandlovely/pages/looks/LooksListPage.js.map +1 -1
  81. package/dist/coolandlovely/pages/profile/StyleProfilePage.js +376 -146
  82. package/dist/coolandlovely/pages/profile/StyleProfilePage.js.map +1 -1
  83. package/dist/coolandlovely/pages/trends/TrendsPage.js +249 -0
  84. package/dist/coolandlovely/pages/trends/TrendsPage.js.map +1 -0
  85. package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.js +136 -88
  86. package/dist/coolandlovely/pages/wardrobe/WardrobeFormPage.js.map +1 -1
  87. package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js +75 -74
  88. package/dist/coolandlovely/pages/wardrobe/WardrobeListPage.js.map +1 -1
  89. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LookCard.js","names":[],"sources":["../../../src/coolandlovely/components/LookCard.tsx"],"sourcesContent":["/**\n * LookCard — an editorial, image-forward card for a look.\n * @module coolandlovely/components\n *\n * A portrait `Thumbnail` (the look photo) with a frosted bottom caption (title +\n * occasion pill) and, when `showActions`, a hover-revealed top-right cluster: a\n * Like heart (optimistic, via `useLikeLook`) + `AddToLookbookButton`. Reused by\n * the home latest-looks, Discover, the looks list and the collaboration\n * attributed-looks grid. Token-only; reuses `Thumbnail`/`FileImage` for imagery.\n */\n\nimport type { FC } from 'react';\nimport { useEffect, useState } from 'react';\nimport { Heart, Sparkles } from 'lucide-react';\nimport { Thumbnail } from './Thumbnail';\nimport { AddToLookbookButton } from './AddToLookbookButton';\nimport { useLikeLook } from '../hooks/useCoolAndLovelyApi';\nimport { titleCase } from '../utils/formatters';\nimport { cn } from '../utils/cn';\n\ninterface LookCardProps {\n id: string;\n title: string;\n /** Occasion label/value (rendered as a pill; enum values are title-cased). */\n occasion: string;\n imageFileId?: string | null;\n likeCount?: number;\n onOpen: () => void;\n /** Show the hover like/add-to-lookbook overlay cluster. */\n showActions?: boolean;\n className?: string;\n}\n\n/** Optimistic like heart — one-way like (no unlike op exists on the server). */\nconst LikeHeart: FC<{ lookId: string; likeCount: number }> = ({ lookId, likeCount }) => {\n const like = useLikeLook();\n const [liked, setLiked] = useState(false);\n const [count, setCount] = useState(likeCount);\n\n // Keep in sync with the server count until the user likes in this session.\n useEffect(() => {\n if (!liked) setCount(likeCount);\n }, [likeCount, liked]);\n\n const handleClick = () => {\n if (liked || like.isPending) return;\n setLiked(true);\n setCount((current) => current + 1);\n like.mutate(lookId, {\n onSuccess: (look) => setCount(look.likeCount),\n onError: () => {\n setLiked(false);\n setCount(likeCount);\n },\n });\n };\n\n return (\n <button\n type=\"button\"\n onClick={handleClick}\n disabled={like.isPending}\n aria-pressed={liked}\n aria-label={liked ? 'Liked' : 'Like this look'}\n className=\"inline-flex items-center gap-1 rounded-full bg-bg-surface/90 px-2 py-1 text-xs font-medium text-text-primary shadow-sm backdrop-blur transition-colors hover:bg-bg-surface disabled:opacity-60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]\"\n >\n <Heart\n className={cn(\n 'h-3.5 w-3.5',\n liked ? 'fill-current text-accent-primary' : 'text-text-secondary'\n )}\n />\n <span className=\"tabular-nums\">{count}</span>\n </button>\n );\n};\n\nexport const LookCard: FC<LookCardProps> = ({\n id,\n title,\n occasion,\n imageFileId,\n likeCount,\n onOpen,\n showActions = false,\n className,\n}) => {\n return (\n <div\n className={cn(\n 'group relative overflow-hidden rounded-xl border border-border-seam bg-bg-surface transition-shadow hover:shadow-lg',\n className\n )}\n >\n <button\n type=\"button\"\n onClick={onOpen}\n aria-label={`Open look ${title}`}\n className=\"block w-full text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--color-focus-ring)]\"\n >\n <Thumbnail\n icon={<Sparkles className=\"h-8 w-8\" />}\n seed={id}\n fileId={imageFileId}\n alt={title}\n className=\"aspect-[3/4] w-full rounded-none\"\n overlay={\n <div className=\"pointer-events-none absolute inset-x-0 bottom-0 flex flex-col gap-1.5 bg-gradient-to-t from-bg-canvas/90 via-bg-canvas/45 to-transparent p-3 pt-10\">\n <p className=\"truncate text-sm font-semibold text-text-primary\">{title}</p>\n <div className=\"flex items-center justify-between gap-2\">\n <span className=\"inline-flex items-center rounded-full bg-bg-surface/85 px-2 py-0.5 text-[11px] font-medium text-text-primary backdrop-blur\">\n {titleCase(occasion)}\n </span>\n {!showActions && typeof likeCount === 'number' && likeCount > 0 ? (\n <span className=\"inline-flex items-center gap-1 text-xs text-text-secondary\">\n <Heart className=\"h-3.5 w-3.5 fill-current text-accent-primary\" />\n <span className=\"tabular-nums\">{likeCount}</span>\n </span>\n ) : null}\n </div>\n </div>\n }\n />\n </button>\n\n {showActions ? (\n <div className=\"absolute right-2 top-2 flex items-center gap-1.5 opacity-100 transition-opacity duration-200 sm:opacity-0 sm:focus-within:opacity-100 sm:group-hover:opacity-100\">\n <LikeHeart lookId={id} likeCount={likeCount ?? 0} />\n <AddToLookbookButton lookId={id} />\n </div>\n ) : null}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;AAkCA,IAAM,KAAwD,EAAE,WAAQ,mBAAgB;CACtF,IAAM,IAAO,GAAa,EACpB,CAAC,GAAO,KAAY,EAAS,GAAM,EACnC,CAAC,GAAO,KAAY,EAAS,EAAU;AAoB7C,QAjBA,QAAgB;AACd,EAAK,KAAO,EAAS,EAAU;IAC9B,CAAC,GAAW,EAAM,CAAC,EAgBpB,kBAAC,UAAD;EACE,MAAK;EACL,eAhBsB;AACpB,QAAS,EAAK,cAClB,EAAS,GAAK,EACd,GAAU,MAAY,IAAU,EAAE,EAClC,EAAK,OAAO,GAAQ;IAClB,YAAY,MAAS,EAAS,EAAK,UAAU;IAC7C,eAAe;AAEb,KADA,EAAS,GAAM,EACf,EAAS,EAAU;;IAEtB,CAAC;;EAOA,UAAU,EAAK;EACf,gBAAc;EACd,cAAY,IAAQ,UAAU;EAC9B,WAAU;YANZ,CAQE,kBAAC,GAAD,EACE,WAAW,EACT,eACA,IAAQ,qCAAqC,sBAC9C,EACD,CAAA,EACF,kBAAC,QAAD;GAAM,WAAU;aAAgB;GAAa,CAAA,CACtC;;GAIA,KAA+B,EAC1C,OACA,UACA,aACA,gBACA,cACA,WACA,iBAAc,IACd,mBAGE,kBAAC,OAAD;CACE,WAAW,EACT,uHACA,EACD;WAJH,CAME,kBAAC,UAAD;EACE,MAAK;EACL,SAAS;EACT,cAAY,aAAa;EACzB,WAAU;YAEV,kBAAC,GAAD;GACE,MAAM,kBAAC,GAAD,EAAU,WAAU,WAAY,CAAA;GACtC,MAAM;GACN,QAAQ;GACR,KAAK;GACL,WAAU;GACV,SACE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,KAAD;KAAG,WAAU;eAAoD;KAAU,CAAA,EAC3E,kBAAC,OAAD;KAAK,WAAU;eAAf,CACE,kBAAC,QAAD;MAAM,WAAU;gBACb,EAAU,EAAS;MACf,CAAA,EACN,CAAC,KAAe,OAAO,KAAc,YAAY,IAAY,IAC5D,kBAAC,QAAD;MAAM,WAAU;gBAAhB,CACE,kBAAC,GAAD,EAAO,WAAU,gDAAiD,CAAA,EAClE,kBAAC,QAAD;OAAM,WAAU;iBAAgB;OAAiB,CAAA,CAC5C;UACL,KACA;OACF;;GAER,CAAA;EACK,CAAA,EAER,IACC,kBAAC,OAAD;EAAK,WAAU;YAAf,CACE,kBAAC,GAAD;GAAW,QAAQ;GAAI,WAAW,KAAa;GAAK,CAAA,EACpD,kBAAC,GAAD,EAAqB,QAAQ,GAAM,CAAA,CAC/B;MACJ,KACA"}
@@ -25,7 +25,7 @@ var s = {
25
25
  children: [/* @__PURE__ */ a("div", {
26
26
  className: "flex items-center justify-between",
27
27
  children: [/* @__PURE__ */ i("div", {
28
- className: "text-text-secondary",
28
+ className: "inline-flex h-9 w-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent-primary",
29
29
  children: t
30
30
  }), c && f && p && /* @__PURE__ */ a("div", {
31
31
  className: e("flex items-center gap-1 text-xs font-medium", f.color),
@@ -1 +1 @@
1
- {"version":3,"file":"MetricsCard.js","names":[],"sources":["../../../src/coolandlovely/components/MetricsCard.tsx"],"sourcesContent":["/**\n * Metrics Card Component\n * @module coolandlovely/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { TrendingUp, TrendingDown, Minus } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport type { TrendDirection } from '../types';\n\ninterface MetricsCardProps {\n icon: ReactNode;\n value: string | number;\n label: string;\n trend?: TrendDirection;\n trendValue?: string;\n className?: string;\n /** Renders the featured hero metric (glass treatment + accent glow). */\n featured?: boolean;\n}\n\nconst trendConfig: Record<TrendDirection, { icon: typeof TrendingUp; color: string }> = {\n up: { icon: TrendingUp, color: 'text-status-success-text' },\n down: { icon: TrendingDown, color: 'text-status-error-text' },\n neutral: { icon: Minus, color: 'text-text-secondary' },\n};\n\nexport const MetricsCard: FC<MetricsCardProps> = ({\n icon,\n value,\n label,\n trend,\n trendValue,\n className,\n featured = false,\n}) => {\n const trendInfo = trend ? trendConfig[trend] : null;\n const TrendIcon = trendInfo?.icon;\n\n return (\n <GlassCard\n treatment={featured ? 'glass' : 'metric'}\n glow={featured}\n className={cn('p-6', className)}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"text-text-secondary\">{icon}</div>\n {trend && trendInfo && TrendIcon && (\n <div className={cn('flex items-center gap-1 text-xs font-medium', trendInfo.color)}>\n <TrendIcon className=\"h-3.5 w-3.5\" />\n {trendValue && <span className=\"tabular-nums\">{trendValue}</span>}\n </div>\n )}\n </div>\n <div className=\"mt-3\">\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">{value}</p>\n <p className=\"mt-1 text-sm text-text-secondary\">{label}</p>\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;AAsBA,IAAM,IAAkF;CACtF,IAAI;EAAE,MAAM;EAAY,OAAO;EAA4B;CAC3D,MAAM;EAAE,MAAM;EAAc,OAAO;EAA0B;CAC7D,SAAS;EAAE,MAAM;EAAO,OAAO;EAAuB;CACvD,EAEY,KAAqC,EAChD,SACA,UACA,UACA,UACA,eACA,cACA,cAAW,SACP;CACJ,IAAM,IAAY,IAAQ,EAAY,KAAS,MACzC,IAAY,GAAW;AAE7B,QACE,kBAAC,GAAD;EACE,WAAW,IAAW,UAAU;EAChC,MAAM;EACN,WAAW,EAAG,OAAO,EAAU;YAHjC,CAKE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAuB;IAAW,CAAA,EAChD,KAAS,KAAa,KACrB,kBAAC,OAAD;IAAK,WAAW,EAAG,+CAA+C,EAAU,MAAM;cAAlF,CACE,kBAAC,GAAD,EAAW,WAAU,eAAgB,CAAA,EACpC,KAAc,kBAAC,QAAD;KAAM,WAAU;eAAgB;KAAkB,CAAA,CAC7D;MAEJ;MACN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAqD;IAAU,CAAA,EAC5E,kBAAC,KAAD;IAAG,WAAU;cAAoC;IAAU,CAAA,CACvD;KACI"}
1
+ {"version":3,"file":"MetricsCard.js","names":[],"sources":["../../../src/coolandlovely/components/MetricsCard.tsx"],"sourcesContent":["/**\n * Metrics Card Component\n * @module coolandlovely/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { TrendingUp, TrendingDown, Minus } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport type { TrendDirection } from '../types';\n\ninterface MetricsCardProps {\n icon: ReactNode;\n value: string | number;\n label: string;\n trend?: TrendDirection;\n trendValue?: string;\n className?: string;\n /** Renders the featured hero metric (glass treatment + accent glow). */\n featured?: boolean;\n}\n\nconst trendConfig: Record<TrendDirection, { icon: typeof TrendingUp; color: string }> = {\n up: { icon: TrendingUp, color: 'text-status-success-text' },\n down: { icon: TrendingDown, color: 'text-status-error-text' },\n neutral: { icon: Minus, color: 'text-text-secondary' },\n};\n\nexport const MetricsCard: FC<MetricsCardProps> = ({\n icon,\n value,\n label,\n trend,\n trendValue,\n className,\n featured = false,\n}) => {\n const trendInfo = trend ? trendConfig[trend] : null;\n const TrendIcon = trendInfo?.icon;\n\n return (\n <GlassCard\n treatment={featured ? 'glass' : 'metric'}\n glow={featured}\n className={cn('p-6', className)}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"inline-flex h-9 w-9 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-accent-primary\">\n {icon}\n </div>\n {trend && trendInfo && TrendIcon && (\n <div className={cn('flex items-center gap-1 text-xs font-medium', trendInfo.color)}>\n <TrendIcon className=\"h-3.5 w-3.5\" />\n {trendValue && <span className=\"tabular-nums\">{trendValue}</span>}\n </div>\n )}\n </div>\n <div className=\"mt-3\">\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">{value}</p>\n <p className=\"mt-1 text-sm text-text-secondary\">{label}</p>\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;AAsBA,IAAM,IAAkF;CACtF,IAAI;EAAE,MAAM;EAAY,OAAO;EAA4B;CAC3D,MAAM;EAAE,MAAM;EAAc,OAAO;EAA0B;CAC7D,SAAS;EAAE,MAAM;EAAO,OAAO;EAAuB;CACvD,EAEY,KAAqC,EAChD,SACA,UACA,UACA,UACA,eACA,cACA,cAAW,SACP;CACJ,IAAM,IAAY,IAAQ,EAAY,KAAS,MACzC,IAAY,GAAW;AAE7B,QACE,kBAAC,GAAD;EACE,WAAW,IAAW,UAAU;EAChC,MAAM;EACN,WAAW,EAAG,OAAO,EAAU;YAHjC,CAKE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cACZ;IACG,CAAA,EACL,KAAS,KAAa,KACrB,kBAAC,OAAD;IAAK,WAAW,EAAG,+CAA+C,EAAU,MAAM;cAAlF,CACE,kBAAC,GAAD,EAAW,WAAU,eAAgB,CAAA,EACpC,KAAc,kBAAC,QAAD;KAAM,WAAU;eAAgB;KAAkB,CAAA,CAC7D;MAEJ;MACN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAqD;IAAU,CAAA,EAC5E,kBAAC,KAAD;IAAG,WAAU;cAAoC;IAAU,CAAA,CACvD;KACI"}
@@ -0,0 +1,45 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { Thumbnail as t } from "./Thumbnail.js";
3
+ import { formatPrice as n } from "../utils/formatters.js";
4
+ import { ChevronRight as r, ShoppingBag as i } from "lucide-react";
5
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region src/coolandlovely/components/ShopItemCard.tsx
7
+ var s = ({ id: s, name: c, brandName: l, price: u, currency: d, imageFileId: f, onOpen: p, className: m }) => /* @__PURE__ */ o("button", {
8
+ type: "button",
9
+ onClick: p,
10
+ "aria-label": `Shop ${c}`,
11
+ className: e("group flex w-full flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface text-left transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", m),
12
+ children: [/* @__PURE__ */ a(t, {
13
+ icon: /* @__PURE__ */ a(i, { className: "h-7 w-7" }),
14
+ seed: s,
15
+ fileId: f,
16
+ alt: c,
17
+ className: "aspect-square w-full rounded-none"
18
+ }), /* @__PURE__ */ o("div", {
19
+ className: "flex flex-col gap-0.5 p-3",
20
+ children: [
21
+ /* @__PURE__ */ a("p", {
22
+ className: "truncate text-sm font-medium text-text-primary",
23
+ children: c
24
+ }),
25
+ l ? /* @__PURE__ */ a("p", {
26
+ className: "truncate text-xs text-text-secondary",
27
+ children: l
28
+ }) : null,
29
+ /* @__PURE__ */ o("div", {
30
+ className: "mt-2 flex items-center justify-between gap-2",
31
+ children: [/* @__PURE__ */ a("span", {
32
+ className: "text-sm font-semibold text-text-primary tabular-nums",
33
+ children: n(u, d)
34
+ }), /* @__PURE__ */ o("span", {
35
+ className: "inline-flex items-center gap-0.5 text-xs font-semibold text-accent-primary",
36
+ children: ["Shop", /* @__PURE__ */ a(r, { className: "h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5" })]
37
+ })]
38
+ })
39
+ ]
40
+ })]
41
+ });
42
+ //#endregion
43
+ export { s as ShopItemCard };
44
+
45
+ //# sourceMappingURL=ShopItemCard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShopItemCard.js","names":[],"sources":["../../../src/coolandlovely/components/ShopItemCard.tsx"],"sourcesContent":["/**\n * ShopItemCard — a product card for the \"shop the look\" grid.\n * @module coolandlovely/components\n *\n * Image + name + brand line + price + a rose \"Shop\" chevron that drills through\n * to the item detail page (the platform has no external shop URL, so \"Shop\" is\n * the internal drill-through). Reuses `Thumbnail`/`FileImage` for imagery.\n */\n\nimport type { FC } from 'react';\nimport { ChevronRight, ShoppingBag } from 'lucide-react';\nimport { Thumbnail } from './Thumbnail';\nimport { formatPrice } from '../utils/formatters';\nimport { cn } from '../utils/cn';\n\ninterface ShopItemCardProps {\n id: string;\n name: string;\n brandName?: string;\n price: number;\n currency: string;\n imageFileId?: string | null;\n onOpen: () => void;\n className?: string;\n}\n\nexport const ShopItemCard: FC<ShopItemCardProps> = ({\n id,\n name,\n brandName,\n price,\n currency,\n imageFileId,\n onOpen,\n className,\n}) => {\n return (\n <button\n type=\"button\"\n onClick={onOpen}\n aria-label={`Shop ${name}`}\n className={cn(\n 'group flex w-full flex-col overflow-hidden rounded-xl border border-border-seam bg-bg-surface text-left transition-shadow hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n className\n )}\n >\n <Thumbnail\n icon={<ShoppingBag className=\"h-7 w-7\" />}\n seed={id}\n fileId={imageFileId}\n alt={name}\n className=\"aspect-square w-full rounded-none\"\n />\n <div className=\"flex flex-col gap-0.5 p-3\">\n <p className=\"truncate text-sm font-medium text-text-primary\">{name}</p>\n {brandName ? <p className=\"truncate text-xs text-text-secondary\">{brandName}</p> : null}\n <div className=\"mt-2 flex items-center justify-between gap-2\">\n <span className=\"text-sm font-semibold text-text-primary tabular-nums\">\n {formatPrice(price, currency)}\n </span>\n <span className=\"inline-flex items-center gap-0.5 text-xs font-semibold text-accent-primary\">\n Shop\n <ChevronRight className=\"h-3.5 w-3.5 transition-transform group-hover:translate-x-0.5\" />\n </span>\n </div>\n </div>\n </button>\n );\n};\n"],"mappings":";;;;;;AA0BA,IAAa,KAAuC,EAClD,OACA,SACA,cACA,UACA,aACA,gBACA,WACA,mBAGE,kBAAC,UAAD;CACE,MAAK;CACL,SAAS;CACT,cAAY,QAAQ;CACpB,WAAW,EACT,0OACA,EACD;WAPH,CASE,kBAAC,GAAD;EACE,MAAM,kBAAC,GAAD,EAAa,WAAU,WAAY,CAAA;EACzC,MAAM;EACN,QAAQ;EACR,KAAK;EACL,WAAU;EACV,CAAA,EACF,kBAAC,OAAD;EAAK,WAAU;YAAf;GACE,kBAAC,KAAD;IAAG,WAAU;cAAkD;IAAS,CAAA;GACvE,IAAY,kBAAC,KAAD;IAAG,WAAU;cAAwC;IAAc,CAAA,GAAG;GACnF,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,QAAD;KAAM,WAAU;eACb,EAAY,GAAO,EAAS;KACxB,CAAA,EACP,kBAAC,QAAD;KAAM,WAAU;eAAhB,CAA6F,QAE3F,kBAAC,GAAD,EAAc,WAAU,gEAAiE,CAAA,CACpF;OACH;;GACF;IACC"}
@@ -0,0 +1,35 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { titleCase as t } from "../utils/formatters.js";
3
+ import { Check as n } from "lucide-react";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/coolandlovely/components/StepTracker.tsx
6
+ var a = ({ steps: a, current: o, className: s }) => {
7
+ let c = a.findIndex((e) => e === o), l = c === -1 ? 0 : c;
8
+ return /* @__PURE__ */ r("ol", {
9
+ className: e("flex w-full items-start", s),
10
+ children: a.map((a, o) => {
11
+ let s = o < l ? "done" : o === l ? "current" : "upcoming";
12
+ return /* @__PURE__ */ i("li", {
13
+ className: "relative flex flex-1 flex-col items-center gap-2 text-center",
14
+ children: [
15
+ o > 0 ? /* @__PURE__ */ r("span", {
16
+ "aria-hidden": "true",
17
+ className: e("absolute left-[-50%] top-4 z-0 h-0.5 w-full -translate-y-1/2", o <= l ? "bg-accent-primary" : "bg-border-seam")
18
+ }) : null,
19
+ /* @__PURE__ */ r("span", {
20
+ className: e("relative z-10 flex h-8 w-8 items-center justify-center rounded-full text-xs font-semibold tabular-nums transition-colors", s === "done" && "bg-accent-primary text-action-primary-text", s === "current" && "border-2 border-accent-primary bg-bg-surface text-accent-primary", s === "upcoming" && "border border-border-seam bg-bg-surface text-text-secondary"),
21
+ children: s === "done" ? /* @__PURE__ */ r(n, { className: "h-4 w-4" }) : o + 1
22
+ }),
23
+ /* @__PURE__ */ r("span", {
24
+ className: e("text-xs font-medium", s === "upcoming" ? "text-text-secondary" : "text-text-primary"),
25
+ children: t(a)
26
+ })
27
+ ]
28
+ }, a);
29
+ })
30
+ });
31
+ };
32
+ //#endregion
33
+ export { a as StepTracker };
34
+
35
+ //# sourceMappingURL=StepTracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StepTracker.js","names":[],"sources":["../../../src/coolandlovely/components/StepTracker.tsx"],"sourcesContent":["/**\n * StepTracker — a horizontal lifecycle tracker for any `Coo*Status` machine.\n * @module coolandlovely/components\n *\n * Renders a row of numbered nodes with connectors: steps before `current` are\n * done (accent-filled + check), the `current` step is ringed, upcoming steps are\n * muted. Token-only. Used by the collaboration lifecycle (Proposed → Accepted →\n * In progress → Published) and reusable for brand/collection lifecycles.\n */\n\nimport type { FC } from 'react';\nimport { Check } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { titleCase } from '../utils/formatters';\n\ninterface StepTrackerProps {\n /** Ordered step values (e.g. ['PROPOSED','ACCEPTED','IN_PROGRESS','PUBLISHED']). */\n steps: string[];\n /** The current step value — must be one of `steps`. */\n current: string;\n className?: string;\n}\n\nexport const StepTracker: FC<StepTrackerProps> = ({ steps, current, className }) => {\n const foundIdx = steps.findIndex((step) => step === current);\n const currentIdx = foundIdx === -1 ? 0 : foundIdx;\n\n return (\n <ol className={cn('flex w-full items-start', className)}>\n {steps.map((step, index) => {\n const state = index < currentIdx ? 'done' : index === currentIdx ? 'current' : 'upcoming';\n const connectorDone = index <= currentIdx;\n return (\n <li key={step} className=\"relative flex flex-1 flex-col items-center gap-2 text-center\">\n {index > 0 ? (\n <span\n aria-hidden=\"true\"\n className={cn(\n 'absolute left-[-50%] top-4 z-0 h-0.5 w-full -translate-y-1/2',\n connectorDone ? 'bg-accent-primary' : 'bg-border-seam'\n )}\n />\n ) : null}\n <span\n className={cn(\n 'relative z-10 flex h-8 w-8 items-center justify-center rounded-full text-xs font-semibold tabular-nums transition-colors',\n state === 'done' && 'bg-accent-primary text-action-primary-text',\n state === 'current' &&\n 'border-2 border-accent-primary bg-bg-surface text-accent-primary',\n state === 'upcoming' &&\n 'border border-border-seam bg-bg-surface text-text-secondary'\n )}\n >\n {state === 'done' ? <Check className=\"h-4 w-4\" /> : index + 1}\n </span>\n <span\n className={cn(\n 'text-xs font-medium',\n state === 'upcoming' ? 'text-text-secondary' : 'text-text-primary'\n )}\n >\n {titleCase(step)}\n </span>\n </li>\n );\n })}\n </ol>\n );\n};\n"],"mappings":";;;;;AAuBA,IAAa,KAAqC,EAAE,UAAO,YAAS,mBAAgB;CAClF,IAAM,IAAW,EAAM,WAAW,MAAS,MAAS,EAAQ,EACtD,IAAa,MAAa,KAAK,IAAI;AAEzC,QACE,kBAAC,MAAD;EAAI,WAAW,EAAG,2BAA2B,EAAU;YACpD,EAAM,KAAK,GAAM,MAAU;GAC1B,IAAM,IAAQ,IAAQ,IAAa,SAAS,MAAU,IAAa,YAAY;AAE/E,UACE,kBAAC,MAAD;IAAe,WAAU;cAAzB;KACG,IAAQ,IACP,kBAAC,QAAD;MACE,eAAY;MACZ,WAAW,EACT,gEAPY,KAAS,IAQL,sBAAsB,iBACvC;MACD,CAAA,GACA;KACJ,kBAAC,QAAD;MACE,WAAW,EACT,4HACA,MAAU,UAAU,8CACpB,MAAU,aACR,oEACF,MAAU,cACR,8DACH;gBAEA,MAAU,SAAS,kBAAC,GAAD,EAAO,WAAU,WAAY,CAAA,GAAG,IAAQ;MACvD,CAAA;KACP,kBAAC,QAAD;MACE,WAAW,EACT,uBACA,MAAU,aAAa,wBAAwB,oBAChD;gBAEA,EAAU,EAAK;MACX,CAAA;KACJ;MA9BI,EA8BJ;IAEP;EACC,CAAA"}
@@ -1,29 +1,40 @@
1
1
  import { cn as e } from "../utils/cn.js";
2
- import { jsx as t } from "react/jsx-runtime";
2
+ import { FileImage as t } from "./FileImage.js";
3
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
4
  //#region src/coolandlovely/components/Thumbnail.tsx
4
- var n = [
5
+ var i = [
5
6
  "from-accent-purple-subtle to-bg-sunken",
6
7
  "from-accent-blue-subtle to-bg-sunken",
7
8
  "from-status-success-bg-subtle to-bg-sunken",
8
9
  "from-status-warning-bg-subtle to-bg-sunken",
9
10
  "from-[var(--color-accent-soft)] to-bg-sunken"
10
11
  ];
11
- function r(e) {
12
- if (!e) return n[0];
12
+ function a(e) {
13
+ if (!e) return i[0];
13
14
  let t = 0;
14
15
  for (let n = 0; n < e.length; n += 1) t = (t * 31 + e.charCodeAt(n)) % 997;
15
- return n[t % n.length];
16
+ return i[t % i.length];
16
17
  }
17
- var i = ({ icon: n, seed: i, className: a, label: o }) => /* @__PURE__ */ t("div", {
18
- className: e("relative flex items-center justify-center overflow-hidden rounded-lg bg-gradient-to-br", r(i), a),
19
- "aria-hidden": o ? void 0 : !0,
20
- "aria-label": o,
21
- children: /* @__PURE__ */ t("span", {
22
- className: "text-text-secondary opacity-80",
23
- children: n
24
- })
18
+ var o = ({ icon: i, seed: o, className: s, label: c, fileId: l, alt: u, overlay: d }) => /* @__PURE__ */ r("div", {
19
+ className: e("relative flex items-center justify-center overflow-hidden rounded-lg bg-gradient-to-br", a(o), s),
20
+ "aria-hidden": c ? void 0 : !0,
21
+ "aria-label": c,
22
+ children: [
23
+ /* @__PURE__ */ n("span", {
24
+ className: "text-text-secondary opacity-80 transition-transform duration-300 motion-safe:group-hover:scale-[1.03]",
25
+ children: i
26
+ }),
27
+ l ? /* @__PURE__ */ n("span", {
28
+ className: "absolute inset-0 transition-transform duration-300 motion-safe:group-hover:scale-[1.03]",
29
+ children: /* @__PURE__ */ n(t, {
30
+ fileId: l,
31
+ alt: u ?? c ?? ""
32
+ })
33
+ }) : null,
34
+ d
35
+ ]
25
36
  });
26
37
  //#endregion
27
- export { i as Thumbnail };
38
+ export { o as Thumbnail };
28
39
 
29
40
  //# sourceMappingURL=Thumbnail.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Thumbnail.js","names":[],"sources":["../../../src/coolandlovely/components/Thumbnail.tsx"],"sourcesContent":["/**\n * Thumbnail Component\n * @module coolandlovely/components\n *\n * Renders a calm, on-token visual placeholder for a fashion entity. Imagery in\n * CoolAndLovely is referenced from wspace-files-svc via federation (we only\n * have the File id here, not a resolvable URL), so the catalogue/wardrobe/look\n * surfaces render a branded glyph tile keyed by an icon rather than a broken\n * <img>. The seed (entity id) gives each tile a stable accent tint.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface ThumbnailProps {\n icon: ReactNode;\n /** Stable seed (e.g. entity id) used to pick a deterministic accent tint. */\n seed?: string;\n className?: string;\n /** Whether a File reference exists (shows a subtle \"image attached\" hint). */\n hasImage?: boolean;\n label?: string;\n}\n\nconst tints = [\n 'from-accent-purple-subtle to-bg-sunken',\n 'from-accent-blue-subtle to-bg-sunken',\n 'from-status-success-bg-subtle to-bg-sunken',\n 'from-status-warning-bg-subtle to-bg-sunken',\n 'from-[var(--color-accent-soft)] to-bg-sunken',\n];\n\nfunction tintFor(seed: string | undefined): string {\n if (!seed) return tints[0];\n let hash = 0;\n for (let i = 0; i < seed.length; i += 1) {\n hash = (hash * 31 + seed.charCodeAt(i)) % 997;\n }\n return tints[hash % tints.length];\n}\n\nexport const Thumbnail: FC<ThumbnailProps> = ({ icon, seed, className, label }) => {\n return (\n <div\n className={cn(\n 'relative flex items-center justify-center overflow-hidden rounded-lg bg-gradient-to-br',\n tintFor(seed),\n className\n )}\n aria-hidden={label ? undefined : true}\n aria-label={label}\n >\n <span className=\"text-text-secondary opacity-80\">{icon}</span>\n </div>\n );\n};\n"],"mappings":";;;AAwBA,IAAM,IAAQ;CACZ;CACA;CACA;CACA;CACA;CACD;AAED,SAAS,EAAQ,GAAkC;AACjD,KAAI,CAAC,EAAM,QAAO,EAAM;CACxB,IAAI,IAAO;AACX,MAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAAK,EACpC,MAAQ,IAAO,KAAK,EAAK,WAAW,EAAE,IAAI;AAE5C,QAAO,EAAM,IAAO,EAAM;;AAG5B,IAAa,KAAiC,EAAE,SAAM,SAAM,cAAW,eAEnE,kBAAC,OAAD;CACE,WAAW,EACT,0FACA,EAAQ,EAAK,EACb,EACD;CACD,eAAa,IAAQ,KAAA,IAAY;CACjC,cAAY;WAEZ,kBAAC,QAAD;EAAM,WAAU;YAAkC;EAAY,CAAA;CAC1D,CAAA"}
1
+ {"version":3,"file":"Thumbnail.js","names":[],"sources":["../../../src/coolandlovely/components/Thumbnail.tsx"],"sourcesContent":["/**\n * Thumbnail Component\n * @module coolandlovely/components\n *\n * Renders a calm, on-token visual placeholder for a fashion entity. Imagery in\n * CoolAndLovely is referenced from wspace-files-svc via federation (we only\n * have the File id here, not a resolvable URL), so the catalogue/wardrobe/look\n * surfaces render a branded glyph tile keyed by an icon rather than a broken\n * <img>. The seed (entity id) gives each tile a stable accent tint.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\nimport { FileImage } from './FileImage';\n\ninterface ThumbnailProps {\n icon: ReactNode;\n /** Stable seed (e.g. entity id) used to pick a deterministic accent tint. */\n seed?: string;\n className?: string;\n /** Whether a File reference exists (shows a subtle \"image attached\" hint). */\n hasImage?: boolean;\n label?: string;\n /** wspace-files File id — when it resolves, its image overlays the glyph. */\n fileId?: string | null;\n /** Alt text when a real image is shown. */\n alt?: string;\n /**\n * Optional content rendered absolutely over the image (e.g. a gradient scrim\n * + overlaid caption). Positioned by the caller; sits above the FileImage.\n */\n overlay?: ReactNode;\n}\n\nconst tints = [\n 'from-accent-purple-subtle to-bg-sunken',\n 'from-accent-blue-subtle to-bg-sunken',\n 'from-status-success-bg-subtle to-bg-sunken',\n 'from-status-warning-bg-subtle to-bg-sunken',\n 'from-[var(--color-accent-soft)] to-bg-sunken',\n];\n\nfunction tintFor(seed: string | undefined): string {\n if (!seed) return tints[0];\n let hash = 0;\n for (let i = 0; i < seed.length; i += 1) {\n hash = (hash * 31 + seed.charCodeAt(i)) % 997;\n }\n return tints[hash % tints.length];\n}\n\nexport const Thumbnail: FC<ThumbnailProps> = ({\n icon,\n seed,\n className,\n label,\n fileId,\n alt,\n overlay,\n}) => {\n return (\n <div\n className={cn(\n 'relative flex items-center justify-center overflow-hidden rounded-lg bg-gradient-to-br',\n tintFor(seed),\n className\n )}\n aria-hidden={label ? undefined : true}\n aria-label={label}\n >\n <span className=\"text-text-secondary opacity-80 transition-transform duration-300 motion-safe:group-hover:scale-[1.03]\">\n {icon}\n </span>\n {fileId ? (\n <span className=\"absolute inset-0 transition-transform duration-300 motion-safe:group-hover:scale-[1.03]\">\n <FileImage fileId={fileId} alt={alt ?? label ?? ''} />\n </span>\n ) : null}\n {overlay}\n </div>\n );\n};\n"],"mappings":";;;;AAkCA,IAAM,IAAQ;CACZ;CACA;CACA;CACA;CACA;CACD;AAED,SAAS,EAAQ,GAAkC;AACjD,KAAI,CAAC,EAAM,QAAO,EAAM;CACxB,IAAI,IAAO;AACX,MAAK,IAAI,IAAI,GAAG,IAAI,EAAK,QAAQ,KAAK,EACpC,MAAQ,IAAO,KAAK,EAAK,WAAW,EAAE,IAAI;AAE5C,QAAO,EAAM,IAAO,EAAM;;AAG5B,IAAa,KAAiC,EAC5C,SACA,SACA,cACA,UACA,WACA,QACA,iBAGE,kBAAC,OAAD;CACE,WAAW,EACT,0FACA,EAAQ,EAAK,EACb,EACD;CACD,eAAa,IAAQ,KAAA,IAAY;CACjC,cAAY;WAPd;EASE,kBAAC,QAAD;GAAM,WAAU;aACb;GACI,CAAA;EACN,IACC,kBAAC,QAAD;GAAM,WAAU;aACd,kBAAC,GAAD;IAAmB;IAAQ,KAAK,KAAO,KAAS;IAAM,CAAA;GACjD,CAAA,GACL;EACH;EACG"}
@@ -0,0 +1,32 @@
1
+ import { cn as e } from "../utils/cn.js";
2
+ import { titleCase as t } from "../utils/formatters.js";
3
+ import { Globe as n, Lock as r, Users as i } from "lucide-react";
4
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
+ //#region src/coolandlovely/components/VisibilityChip.tsx
6
+ var s = {
7
+ public: {
8
+ icon: n,
9
+ label: "Public"
10
+ },
11
+ followers: {
12
+ icon: i,
13
+ label: "Followers"
14
+ },
15
+ private: {
16
+ icon: r,
17
+ label: "Private"
18
+ }
19
+ }, c = ({ visibility: n, className: i }) => {
20
+ let c = s[n.trim().toLowerCase()], l = c?.icon ?? r, u = c?.label ?? t(n);
21
+ return /* @__PURE__ */ o("span", {
22
+ className: e("inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary", i),
23
+ children: [/* @__PURE__ */ a(l, {
24
+ className: "h-3.5 w-3.5",
25
+ "aria-hidden": "true"
26
+ }), u]
27
+ });
28
+ };
29
+ //#endregion
30
+ export { c as VisibilityChip };
31
+
32
+ //# sourceMappingURL=VisibilityChip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisibilityChip.js","names":[],"sources":["../../../src/coolandlovely/components/VisibilityChip.tsx"],"sourcesContent":["/**\n * VisibilityChip — a small icon + label chip for a look/lookbook/profile\n * visibility (PRIVATE / FOLLOWERS / PUBLIC).\n * @module coolandlovely/components\n *\n * Token-only. The lock/users/globe glyph makes the visibility scannable at a\n * glance on lookbook cards, the lookbook detail header and the style profile.\n */\n\nimport type { FC } from 'react';\nimport { Globe, Lock, Users } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { titleCase } from '../utils/formatters';\n\ninterface VisibilityChipProps {\n /** A `CooVisibility` value (PUBLIC / FOLLOWERS / PRIVATE) — case-insensitive. */\n visibility: string;\n className?: string;\n}\n\nconst CONFIG: Record<string, { icon: typeof Globe; label: string }> = {\n public: { icon: Globe, label: 'Public' },\n followers: { icon: Users, label: 'Followers' },\n private: { icon: Lock, label: 'Private' },\n};\n\nexport const VisibilityChip: FC<VisibilityChipProps> = ({ visibility, className }) => {\n const key = visibility.trim().toLowerCase();\n const config = CONFIG[key];\n const Icon = config?.icon ?? Lock;\n const label = config?.label ?? titleCase(visibility);\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium text-text-secondary',\n className\n )}\n >\n <Icon className=\"h-3.5 w-3.5\" aria-hidden=\"true\" />\n {label}\n </span>\n );\n};\n"],"mappings":";;;;;AAoBA,IAAM,IAAgE;CACpE,QAAQ;EAAE,MAAM;EAAO,OAAO;EAAU;CACxC,WAAW;EAAE,MAAM;EAAO,OAAO;EAAa;CAC9C,SAAS;EAAE,MAAM;EAAM,OAAO;EAAW;CAC1C,EAEY,KAA2C,EAAE,eAAY,mBAAgB;CAEpF,IAAM,IAAS,EADH,EAAW,MAAM,CAAC,aAAa,GAErC,IAAO,GAAQ,QAAQ,GACvB,IAAQ,GAAQ,SAAS,EAAU,EAAW;AAEpD,QACE,kBAAC,QAAD;EACE,WAAW,EACT,gHACA,EACD;YAJH,CAME,kBAAC,GAAD;GAAM,WAAU;GAAc,eAAY;GAAS,CAAA,EAClD,EACI"}
@@ -1 +1,3 @@
1
+ import "./useFiles.js";
1
2
  import "./useCoolAndLovelyApi.js";
3
+ import "./useComments.js";
@@ -0,0 +1,68 @@
1
+ import { useCoolAndLovely as e } from "../context/CoolAndLovelyContext.js";
2
+ import "../context/index.js";
3
+ import { useMutation as t, useQuery as n, useQueryClient as r } from "@tanstack/react-query";
4
+ import { graphqlFetch as i } from "@burdenoff/fe-libs/shared/graphql";
5
+ import { clearGraphqlFetchResponseCache as a } from "@burdenoff/fe-libs/shared/graphql/fetch";
6
+ //#region src/coolandlovely/hooks/useComments.ts
7
+ var o = "coolandlovely-comments", s = async (e, t, n) => {
8
+ let r = await i({
9
+ gateway: "workspace",
10
+ baseUrl: n,
11
+ query: e,
12
+ variables: t,
13
+ workspaceToken: !0
14
+ });
15
+ if (r.errors?.length) throw Error(r.errors[0]?.message ?? "Comments request failed");
16
+ if (!r.data) throw Error("Comments response did not include data");
17
+ return /^\s*mutation\b/.test(e) && a(), r.data;
18
+ }, c = "\n query CooGetEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n total\n items {\n id\n authorId\n authorType\n edited\n createdAt\n content { text }\n }\n }\n }\n", l = "\n mutation CooCreateEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) {\n id\n }\n }\n", u = (t, r) => {
19
+ let { apiGatewayUrl: i } = e();
20
+ return n({
21
+ queryKey: [
22
+ o,
23
+ t,
24
+ r
25
+ ],
26
+ enabled: !!r,
27
+ queryFn: async () => {
28
+ let e = (await s(c, { input: {
29
+ entityType: t,
30
+ entityId: r,
31
+ take: 100,
32
+ sortBy: "createdAt",
33
+ sortOrder: "desc"
34
+ } }, i)).getEntityComments;
35
+ return {
36
+ total: e.total,
37
+ comments: e.items.map((e) => ({
38
+ id: e.id,
39
+ authorId: e.authorId,
40
+ authorType: (e.authorType ?? "user").toLowerCase(),
41
+ text: e.content?.text ?? "",
42
+ createdAt: e.createdAt,
43
+ edited: e.edited
44
+ }))
45
+ };
46
+ }
47
+ });
48
+ }, d = () => {
49
+ let n = r(), { apiGatewayUrl: i } = e();
50
+ return t({
51
+ mutationFn: async ({ entityType: e, entityId: t, text: n }) => (await s(l, { input: {
52
+ entityType: e,
53
+ entityId: t,
54
+ content: { text: n }
55
+ } }, i)).createEntityComment,
56
+ onSuccess: (e, t) => {
57
+ n.invalidateQueries({ queryKey: [
58
+ o,
59
+ t.entityType,
60
+ t.entityId
61
+ ] });
62
+ }
63
+ });
64
+ };
65
+ //#endregion
66
+ export { d as useAddComment, u as useEntityComments };
67
+
68
+ //# sourceMappingURL=useComments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useComments.js","names":[],"sources":["../../../src/coolandlovely/hooks/useComments.ts"],"sourcesContent":["/**\n * Comments hooks — reviews / feedback via wspace-conversations-svc (NO new table).\n * @module coolandlovely/hooks\n *\n * CoolAndLovely does NOT own a comment/review table. Reviews & feedback on a\n * look or brand are polymorphic `EntityComment` records owned by\n * wspace-conversations-svc, keyed by (entityType, entityId). Same graphqlFetch\n * transport (workspace gateway + workspace token) as every other coo* call.\n *\n * Commenter display names must be resolved via fe-libs useActorProfiles\n * (GLOBAL gateway) — the federated wspace `User` here exposes only ids, so\n * NEVER select firstName/name on the comment author.\n */\n\nimport { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';\nimport { graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\nimport { clearGraphqlFetchResponseCache } from '@burdenoff/fe-libs/shared/graphql/fetch';\n\nimport { useCoolAndLovely } from '../context';\n\nconst QK = 'coolandlovely-comments';\n\n/** A single review/comment as surfaced in the MFE (scalar-only projection). */\nexport interface EntityCommentView {\n id: string;\n authorId: string;\n authorType: string;\n text: string;\n createdAt: string;\n edited: boolean;\n}\n\ninterface RawEntityComment {\n id: string;\n authorId: string;\n authorType: string;\n edited: boolean;\n createdAt: string;\n content: { text?: string | null } | null;\n}\n\nconst commentFetch = async <TData>(\n query: string,\n variables: Record<string, unknown>,\n baseUrl?: string\n): Promise<TData> => {\n const response = await graphqlFetch<TData>({\n gateway: 'workspace',\n baseUrl,\n query,\n variables,\n workspaceToken: true,\n });\n if (response.errors?.length) {\n throw new Error(response.errors[0]?.message ?? 'Comments request failed');\n }\n if (!response.data) {\n throw new Error('Comments response did not include data');\n }\n if (/^\\s*mutation\\b/.test(query)) {\n clearGraphqlFetchResponseCache();\n }\n return response.data;\n};\n\nconst GET_COMMENTS = `\n query CooGetEntityComments($input: GetCommentsInput!) {\n getEntityComments(input: $input) {\n total\n items {\n id\n authorId\n authorType\n edited\n createdAt\n content { text }\n }\n }\n }\n`;\n\nconst CREATE_COMMENT = `\n mutation CooCreateEntityComment($input: CreateEntityCommentInput!) {\n createEntityComment(input: $input) {\n id\n }\n }\n`;\n\nexport interface EntityCommentsResult {\n total: number;\n comments: EntityCommentView[];\n}\n\n/** List reviews/comments for a (entityType, entityId), newest first. */\nexport const useEntityComments = (entityType: string, entityId: string | undefined) => {\n const { apiGatewayUrl } = useCoolAndLovely();\n return useQuery({\n queryKey: [QK, entityType, entityId],\n enabled: Boolean(entityId),\n queryFn: async (): Promise<EntityCommentsResult> => {\n const data = await commentFetch<{\n getEntityComments: { total: number; items: RawEntityComment[] };\n }>(\n GET_COMMENTS,\n {\n input: {\n entityType,\n entityId,\n take: 100,\n sortBy: 'createdAt',\n sortOrder: 'desc',\n },\n },\n apiGatewayUrl\n );\n const conn = data.getEntityComments;\n return {\n total: conn.total,\n comments: conn.items.map((c) => ({\n id: c.id,\n authorId: c.authorId,\n authorType: (c.authorType ?? 'user').toLowerCase(),\n text: c.content?.text ?? '',\n createdAt: c.createdAt,\n edited: c.edited,\n })),\n };\n },\n });\n};\n\n/** Post a review/comment on a (entityType, entityId). */\nexport const useAddComment = () => {\n const queryClient = useQueryClient();\n const { apiGatewayUrl } = useCoolAndLovely();\n return useMutation({\n mutationFn: async ({\n entityType,\n entityId,\n text,\n }: {\n entityType: string;\n entityId: string;\n text: string;\n }) => {\n const data = await commentFetch<{ createEntityComment: { id: string } }>(\n CREATE_COMMENT,\n {\n input: {\n entityType,\n entityId,\n content: { text },\n },\n },\n apiGatewayUrl\n );\n return data.createEntityComment;\n },\n onSuccess: (_result, variables) => {\n void queryClient.invalidateQueries({\n queryKey: [QK, variables.entityType, variables.entityId],\n });\n },\n });\n};\n"],"mappings":";;;;;;AAoBA,IAAM,IAAK,0BAqBL,IAAe,OACnB,GACA,GACA,MACmB;CACnB,IAAM,IAAW,MAAM,EAAoB;EACzC,SAAS;EACT;EACA;EACA;EACA,gBAAgB;EACjB,CAAC;AACF,KAAI,EAAS,QAAQ,OACnB,OAAU,MAAM,EAAS,OAAO,IAAI,WAAW,0BAA0B;AAE3E,KAAI,CAAC,EAAS,KACZ,OAAU,MAAM,yCAAyC;AAK3D,QAHI,iBAAiB,KAAK,EAAM,IAC9B,GAAgC,EAE3B,EAAS;GAGZ,IAAe,yQAgBf,IAAiB,8IAcV,KAAqB,GAAoB,MAAiC;CACrF,IAAM,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAS;EACd,UAAU;GAAC;GAAI;GAAY;GAAS;EACpC,SAAS,EAAQ;EACjB,SAAS,YAA2C;GAgBlD,IAAM,KAfO,MAAM,EAGjB,GACA,EACE,OAAO;IACL;IACA;IACA,MAAM;IACN,QAAQ;IACR,WAAW;IACZ,EACF,EACD,EACD,EACiB;AAClB,UAAO;IACL,OAAO,EAAK;IACZ,UAAU,EAAK,MAAM,KAAK,OAAO;KAC/B,IAAI,EAAE;KACN,UAAU,EAAE;KACZ,aAAa,EAAE,cAAc,QAAQ,aAAa;KAClD,MAAM,EAAE,SAAS,QAAQ;KACzB,WAAW,EAAE;KACb,QAAQ,EAAE;KACX,EAAE;IACJ;;EAEJ,CAAC;GAIS,UAAsB;CACjC,IAAM,IAAc,GAAgB,EAC9B,EAAE,qBAAkB,GAAkB;AAC5C,QAAO,EAAY;EACjB,YAAY,OAAO,EACjB,eACA,aACA,eAMa,MAAM,EACjB,GACA,EACE,OAAO;GACL;GACA;GACA,SAAS,EAAE,SAAM;GAClB,EACF,EACD,EACD,EACW;EAEd,YAAY,GAAS,MAAc;AAC5B,KAAY,kBAAkB,EACjC,UAAU;IAAC;IAAI,EAAU;IAAY,EAAU;IAAS,EACzD,CAAC;;EAEL,CAAC"}