diff --git a/apps/public-feature-board/src/components/feedback/board-list-card.tsx b/apps/public-feature-board/src/components/feedback/board-list-card.tsx index 6c81e77ef..7d03e1748 100644 --- a/apps/public-feature-board/src/components/feedback/board-list-card.tsx +++ b/apps/public-feature-board/src/components/feedback/board-list-card.tsx @@ -1,4 +1,6 @@ +import { TablerIcon } from "@feeblo/ui/icon-picker"; import { cn } from "@feeblo/ui/utils"; +import { boardIconName } from "@feeblo/web-shared/icons/defaults"; import { eq, useLiveQuery } from "@tanstack/react-db"; import { Link, useLocation } from "@tanstack/react-router"; @@ -33,6 +35,7 @@ export function BoardListCard() { {data?.map((board) => ( @@ -44,10 +47,12 @@ export function BoardListCard() { export function BoardNavLink({ href, + icon, label, showActiveIndicator = false, }: { href: string; + icon?: string | null; label: string; showActiveIndicator?: boolean; }) { @@ -64,13 +69,23 @@ export function BoardNavLink({ )} to={href} > - + {icon === undefined ? ( + + ) : ( + + )} {label} ); diff --git a/apps/public-feature-board/src/components/feedback/feedback-card.tsx b/apps/public-feature-board/src/components/feedback/feedback-card.tsx index 76608f2d3..b22350077 100644 --- a/apps/public-feature-board/src/components/feedback/feedback-card.tsx +++ b/apps/public-feature-board/src/components/feedback/feedback-card.tsx @@ -1,3 +1,4 @@ +import type { TPostStatus } from "@feeblo/domain/post-status/schema"; import { usePostCollectionData } from "@feeblo/post-ui/post-page-context"; import { PostCard as SharedPostCard } from "@feeblo/post-ui/post/post-card"; import { UpvoteButton } from "@feeblo/post-ui/upvote-toggle"; @@ -56,7 +57,7 @@ function FeedbackPostCardBoardBadge({ children }: { children?: ReactNode }) { const { board } = usePostCollectionData(); return ( - + {children ?? board.name} ); @@ -120,11 +121,15 @@ export const PostCard = { // Convenience wrapper for feedback-page / board-page reuse export function FeedbackCard({ - label, color, + icon, + label, + type, }: { - label: string; color?: string; + icon?: string | null; + label: string; + type?: TPostStatus["type"]; }) { return ( @@ -136,7 +141,7 @@ export function FeedbackCard({ - + diff --git a/apps/public-feature-board/src/components/roadmap/public-roadmap-page.tsx b/apps/public-feature-board/src/components/roadmap/public-roadmap-page.tsx index 4217fc849..c281ceaec 100644 --- a/apps/public-feature-board/src/components/roadmap/public-roadmap-page.tsx +++ b/apps/public-feature-board/src/components/roadmap/public-roadmap-page.tsx @@ -198,6 +198,7 @@ function PublicRoadmapBoardContent() { key={post.id} onClick={() => openPost(post.slug)} status={post.status} + statusIcon={post.statusIcon} title={post.title} updatedAt={post.updatedAt} /> diff --git a/apps/public-feature-board/src/features/home/components/board-select.tsx b/apps/public-feature-board/src/features/home/components/board-select.tsx index 3ad51b79c..307b5138b 100644 --- a/apps/public-feature-board/src/features/home/components/board-select.tsx +++ b/apps/public-feature-board/src/features/home/components/board-select.tsx @@ -1,3 +1,4 @@ +import { TablerIcon } from "@feeblo/ui/icon-picker"; import { Select, SelectItem, @@ -6,6 +7,7 @@ import { SelectValue, } from "@feeblo/ui/select"; import { cn } from "@feeblo/ui/utils"; +import { boardIconName } from "@feeblo/web-shared/icons/defaults"; import { useHome } from "../home-context"; @@ -24,12 +26,32 @@ export function HomeBoardSelect({ className }: { className?: string }) { value={selectedBoard} > - + + {(value: string) => { + const item = boardItems.find( + (candidate) => candidate.value === value + ); + + return item ? ( + + {item.icon === undefined ? null : ( + + )} + {item.label} + + ) : null; + }} + {boardItems.map((item) => ( - {item.label} + + {item.icon === undefined ? null : ( + + )} + {item.label} + ))} diff --git a/apps/public-feature-board/src/features/home/components/status-menu.tsx b/apps/public-feature-board/src/features/home/components/status-menu.tsx index fa2d1ffe2..c8cb03f85 100644 --- a/apps/public-feature-board/src/features/home/components/status-menu.tsx +++ b/apps/public-feature-board/src/features/home/components/status-menu.tsx @@ -1,3 +1,4 @@ +import { PostStatusIcon } from "@feeblo/post-ui/post-status-icon"; import { Button } from "@feeblo/ui/button"; import { Menu, @@ -42,7 +43,12 @@ export function HomeStatusMenu({ className }: { className?: string }) { > {statusItems.map((item) => ( - {item.label} + + {item.statusType ? ( + + ) : null} + {item.label} + ))} diff --git a/apps/public-feature-board/src/features/home/home-context.ts b/apps/public-feature-board/src/features/home/home-context.ts index 1b5ad8c95..3a1d74845 100644 --- a/apps/public-feature-board/src/features/home/home-context.ts +++ b/apps/public-feature-board/src/features/home/home-context.ts @@ -7,14 +7,18 @@ import type { HomePageSortOption } from "../../hooks/use-home-page-filters"; export type HomeFilterItem = { count: number; + /** The board or status mark; absent on the "all" row. */ + icon?: string | null; label: string; + /** Present on status rows, absent on board rows and "all". */ + statusType?: TPostStatus["type"]; value: string; }; export type HomePost = { board: TBoard; post: TPostListItem; - status: Pick; + status: Pick; }; export type HomeFilters = { diff --git a/apps/public-feature-board/src/features/home/home-provider.tsx b/apps/public-feature-board/src/features/home/home-provider.tsx index 02082612c..7a78b3e9b 100644 --- a/apps/public-feature-board/src/features/home/home-provider.tsx +++ b/apps/public-feature-board/src/features/home/home-provider.tsx @@ -233,6 +233,7 @@ export function HomeProvider({ children }: { children: ReactNode }) { type: status.type, label: status.label, color: status.color, + icon: status.icon, }, createdAt: post.createdAt, upvoteCount: coalesce(upvoteCounts.upvoteCount, 0), @@ -272,7 +273,9 @@ export function HomeProvider({ children }: { children: ReactNode }) { { count: totalPosts, label: m.curly_many_badger(), value: "all" }, ...statuses.map((status) => ({ count: countMap.get(status.id) ?? 0, + icon: status.icon, label: status.label || formatPostStatus(status.type), + statusType: status.type, value: status.id, })), ]; @@ -298,6 +301,7 @@ export function HomeProvider({ children }: { children: ReactNode }) { { count: totalPosts, label: m.spry_male_nils(), value: "all" }, ...boards.map((board) => ({ count: countMap.get(board.slug) ?? 0, + icon: board.icon, label: board.name, value: board.slug, })), diff --git a/apps/public-feature-board/src/features/home/home.tsx b/apps/public-feature-board/src/features/home/home.tsx index efb151ee6..86af59897 100644 --- a/apps/public-feature-board/src/features/home/home.tsx +++ b/apps/public-feature-board/src/features/home/home.tsx @@ -136,7 +136,9 @@ function HomeList() { diff --git a/apps/public-feature-board/src/pages/board-page.tsx b/apps/public-feature-board/src/pages/board-page.tsx index c8667b653..c3766caa2 100644 --- a/apps/public-feature-board/src/pages/board-page.tsx +++ b/apps/public-feature-board/src/pages/board-page.tsx @@ -6,10 +6,12 @@ import { EmptyHeader, EmptyTitle, } from "@feeblo/ui/empty"; +import { TablerIcon } from "@feeblo/ui/icon-picker"; import { isLiveQueryFailed, isLiveQueryPending, } from "@feeblo/web-shared/collections"; +import { boardIconName } from "@feeblo/web-shared/icons/defaults"; import { and, eq, useLiveQuery } from "@tanstack/react-db"; import type { ReactNode } from "react"; @@ -41,10 +43,21 @@ function MainContent({ children }: { children: ReactNode }) { ); } -function ListHeader({ count, title }: { count?: number; title: string }) { +function ListHeader({ + count, + icon, + title, +}: { + count?: number; + icon?: string | null; + title: string; +}) { return (
-

+

+ {icon === undefined ? null : ( + + )} {title}

{count !== undefined && ( @@ -134,6 +147,7 @@ export function BoardPage({ boardSlug }: { readonly boardSlug: string }) { type: postStatus.type, label: postStatus.label, color: postStatus.color, + icon: postStatus.icon, }, })); }, @@ -192,7 +206,7 @@ export function BoardPage({ boardSlug }: { readonly boardSlug: string }) { return (
- + {m.plane_strong_crow()} @@ -207,7 +221,7 @@ export function BoardPage({ boardSlug }: { readonly boardSlug: string }) { return (
- +
{posts.map(({ post, postStatus }) => (
diff --git a/apps/web/src/dashboard/components/common/app-sidebar.tsx b/apps/web/src/dashboard/components/common/app-sidebar.tsx index 95b860d3f..887f98871 100644 --- a/apps/web/src/dashboard/components/common/app-sidebar.tsx +++ b/apps/web/src/dashboard/components/common/app-sidebar.tsx @@ -1,4 +1,5 @@ import { useAtomMount } from "@effect/atom-react"; +import { TablerIcon } from "@feeblo/ui/icon-picker"; import { Menu, MenuItem, @@ -21,6 +22,7 @@ import { useSidebar, } from "@feeblo/ui/sidebar"; import { SkeletonLoader, SkeletonWrapper } from "@feeblo/ui/skeleton-loader"; +import { boardIconName } from "@feeblo/web-shared/icons/defaults"; import { FeatureFlagGuard } from "@feeblo/web-shared/use-feature-flag"; import { anyPolicy, @@ -283,6 +285,7 @@ function BoardList() { @@ -297,6 +300,7 @@ function BoardList() { @@ -308,10 +312,11 @@ function BoardList() { interface BoardItemProp { boardPublicId: string; boardSlug: string; + icon: string | null; name: string; } -function BoardItem({ boardPublicId, name, boardSlug }: BoardItemProp) { +function BoardItem({ boardPublicId, icon, name, boardSlug }: BoardItemProp) { const organizationId = useOrganizationId(); const pathname = useRouterState({ @@ -331,6 +336,7 @@ function BoardItem({ boardPublicId, name, boardSlug }: BoardItemProp) { to="/$organizationId/board/$boardSlug" {...props} > + {name} )} diff --git a/apps/web/src/dashboard/features/board/components/board-surface/board-filter.tsx b/apps/web/src/dashboard/features/board/components/board-surface/board-filter.tsx index df79bad3d..8dc1afa00 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/board-filter.tsx +++ b/apps/web/src/dashboard/features/board/components/board-surface/board-filter.tsx @@ -9,6 +9,7 @@ import { type TBoardGrouping, } from "@feeblo/domain-contracts/board-query"; import { formatPostStatus } from "@feeblo/post-ui/post-status"; +import { PostStatusIcon } from "@feeblo/post-ui/post-status-icon"; import { Button } from "@feeblo/ui/button"; import { DebouncedInputGroupInput } from "@feeblo/ui/debounced-input"; import { Group, GroupText } from "@feeblo/ui/group"; @@ -88,6 +89,7 @@ type FilterMember = { }; type FilterStatus = { + icon: string | null; id: string; label: string; type: BoardPostStatus; @@ -202,13 +204,17 @@ const statusFilterItems = ( return [ ...postStatuses.map((status) => ({ checked: selectedTypes.has(status.type), + icon: status.icon, key: status.type, label: status.label || formatPostStatus(status.type), + type: status.type, })), ...unknownTypes.map((type) => ({ checked: true, + icon: undefined, key: type, label: formatPostStatus(type), + type, })), ]; }; @@ -658,7 +664,10 @@ function BoardFilterTrigger() { toggleStatus(item.key); }} > - {item.label} + + + {item.label} + ))} @@ -1060,7 +1069,13 @@ function BoardFilterValueMenu({ label, onToggle, }: { - items: Array<{ checked: boolean; key: T; label: string }>; + items: Array<{ + checked: boolean; + icon?: string | null; + key: T; + label: string; + type?: BoardPostStatus; + }>; label: string; onToggle: (value: T) => void; }) { @@ -1078,7 +1093,12 @@ function BoardFilterValueMenu({ onToggle(item.key); }} > - {item.label} + + {item.type ? ( + + ) : null} + {item.label} + )) )} diff --git a/apps/web/src/dashboard/features/board/components/board-surface/board-grid-lane-column.tsx b/apps/web/src/dashboard/features/board/components/board-surface/board-grid-lane-column.tsx index 7e1a79513..79e42ad1b 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/board-grid-lane-column.tsx +++ b/apps/web/src/dashboard/features/board/components/board-surface/board-grid-lane-column.tsx @@ -20,8 +20,11 @@ interface BoardGridLaneColumnProps { id: string; index: number; label: string; + /** Present only for a board lane. */ + boardIcon?: string | null; /** Present only for a status lane. */ status?: BoardPostStatus; + statusIcon?: string | null; statusId?: string; totalPosts: number; } @@ -31,7 +34,9 @@ const BoardGridLaneColumn = memo(function BoardGridLaneColumn({ index, children, totalPosts, + boardIcon, status, + statusIcon, statusId, boardId, groupBy, @@ -74,7 +79,14 @@ const BoardGridLaneColumn = memo(function BoardGridLaneColumn({ ) : undefined } contentRef={ref} - icon={} + icon={ + + } isHighlighted={isDropTarget} label={effectiveLabel} status={status} diff --git a/apps/web/src/dashboard/features/board/components/board-surface/board-grid-post-card.tsx b/apps/web/src/dashboard/features/board/components/board-surface/board-grid-post-card.tsx index 350b8b10b..a67d37c41 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/board-grid-post-card.tsx +++ b/apps/web/src/dashboard/features/board/components/board-surface/board-grid-post-card.tsx @@ -52,6 +52,7 @@ export const BoardGridPostCard = memo(function BoardGridPostCard({ } rootRef={ref} status={post.status} + statusIcon={post.statusIcon} title={post.title} updatedAt={post.updatedAt} /> diff --git a/apps/web/src/dashboard/features/board/components/board-surface/board-grid-view.tsx b/apps/web/src/dashboard/features/board/components/board-surface/board-grid-view.tsx index f519dd27c..4fc4df5c3 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/board-grid-view.tsx +++ b/apps/web/src/dashboard/features/board/components/board-surface/board-grid-view.tsx @@ -75,6 +75,7 @@ function movePostToColumn( { ...movedPost, status: targetStatus, + statusIcon: lane.statusIcon, statusId: targetLaneStatusId, }, ...lane.posts, @@ -308,8 +309,10 @@ export function BoardGridView({ id={laneId} index={columnIndex} key={lane.id} + boardIcon={lane.boardIcon} label={lane.label} status={lane.status} + statusIcon={lane.statusIcon} statusId={lane.statusId} totalPosts={rows.length} > diff --git a/apps/web/src/dashboard/features/board/components/board-surface/board-lane-icon.tsx b/apps/web/src/dashboard/features/board/components/board-surface/board-lane-icon.tsx index 3f2ab2fd7..9ee0d6863 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/board-lane-icon.tsx +++ b/apps/web/src/dashboard/features/board/components/board-surface/board-lane-icon.tsx @@ -1,5 +1,7 @@ import type { TBoardGroupBy } from "@feeblo/domain-contracts/board-query"; +import { TablerIcon } from "@feeblo/ui/icon-picker"; import type { BoardPostStatus } from "@feeblo/web-shared/board/constants"; +import { boardIconName } from "@feeblo/web-shared/icons/defaults"; import { DashboardSquare01Icon, GroupItemsIcon, @@ -32,14 +34,27 @@ const LANE_ICON_BY_GROUPING: Record = { * a status colour would say it is. */ export function BoardLaneIcon({ + boardIcon, groupBy, status, + statusIcon, }: { + boardIcon?: string | null; groupBy: TBoardGroupBy; status?: BoardPostStatus; + statusIcon?: string | null; }) { if (groupBy === "status" && status) { - return ; + return ; + } + + if (groupBy === "board" && boardIcon !== undefined) { + return ( + + ); } const icon = LANE_ICON_BY_GROUPING[groupBy]; diff --git a/apps/web/src/dashboard/features/board/components/board-surface/board-list-view.tsx b/apps/web/src/dashboard/features/board/components/board-surface/board-list-view.tsx index bb597b2e6..c15542776 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/board-list-view.tsx +++ b/apps/web/src/dashboard/features/board/components/board-surface/board-list-view.tsx @@ -161,7 +161,12 @@ function BoardListLaneHeader({ icon={ArrowUp01Icon} strokeWidth={2} /> - +

{laneLabel}

{lane.posts.length} diff --git a/apps/web/src/dashboard/features/board/components/board-surface/board-post-row-item.tsx b/apps/web/src/dashboard/features/board/components/board-surface/board-post-row-item.tsx index c3eb092f9..fc94cda64 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/board-post-row-item.tsx +++ b/apps/web/src/dashboard/features/board/components/board-surface/board-post-row-item.tsx @@ -69,7 +69,7 @@ export function BoardPostRowItem({ /> {post.upvoteCount} - +

{post.title}

diff --git a/apps/web/src/dashboard/features/board/components/board-surface/status-icon.tsx b/apps/web/src/dashboard/features/board/components/board-surface/status-icon.tsx index b45165d52..c45bb6cb1 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/status-icon.tsx +++ b/apps/web/src/dashboard/features/board/components/board-surface/status-icon.tsx @@ -1,18 +1,22 @@ +import { PostStatusIcon } from "@feeblo/post-ui/post-status-icon"; import { cn } from "@feeblo/ui/utils"; import { BOARD_LANE_COLOR_MAP, - BoardIconMap, type BoardPostStatus, } from "@feeblo/web-shared/board/constants"; -import { HugeiconsIcon } from "@hugeicons/react"; -export function StatusIcon({ status }: { status: BoardPostStatus }) { - const Icon = BoardIconMap[status] ?? BoardIconMap.PLANNED; +export function StatusIcon({ + icon, + status, +}: { + icon?: string | null; + status: BoardPostStatus; +}) { const color = BOARD_LANE_COLOR_MAP[status]; return ( - + ); } diff --git a/apps/web/src/dashboard/features/board/components/board-surface/types.ts b/apps/web/src/dashboard/features/board/components/board-surface/types.ts index 950346500..a69c6c951 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/types.ts +++ b/apps/web/src/dashboard/features/board/components/board-surface/types.ts @@ -5,6 +5,7 @@ export type BoardPostRow = { /** The member working on this post; null when unassigned. */ assigneeMemberId: string | null; authorIsMember: boolean; + boardIcon?: string | null; boardId: string; boardName?: string; boardSlug: string; @@ -13,6 +14,7 @@ export type BoardPostRow = { slug: string; statusId: string; status: BoardPostStatus; + statusIcon?: string | null; title: string; summary: string; updatedAt: Date | string; @@ -21,6 +23,8 @@ export type BoardPostRow = { }; export type BoardPostLane = { + /** The board mark when the lane groups by board. */ + boardIcon?: string | null; /** Stable across regroupings: a status id, member id, board id, tag id, or "all". */ id: string; label: string; @@ -31,6 +35,7 @@ export type BoardPostLane = { * status to write. */ status?: BoardPostStatus; + statusIcon?: string | null; statusId?: string; }; diff --git a/apps/web/src/dashboard/features/board/components/board-surface/use-board-posts-data.ts b/apps/web/src/dashboard/features/board/components/board-surface/use-board-posts-data.ts index b5915bd6a..972792f9f 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/use-board-posts-data.ts +++ b/apps/web/src/dashboard/features/board/components/board-surface/use-board-posts-data.ts @@ -59,6 +59,7 @@ type UseBoardPostsDataOptions = { */ function visiblePostStatuses( postStatuses: ReadonlyArray<{ + icon: string | null; id: string; type: BoardPostStatus; label: string; @@ -322,6 +323,7 @@ export function useBoardPostsData({ archivedAt: post.archivedAt, assigneeMemberId: post.assigneeMemberId, authorIsMember: post.authorIsMember, + boardIcon: board.icon, boardId: post.boardId, boardName: coalesce(board.name, ""), boardSlug: coalesce(board.slug, ""), @@ -330,6 +332,7 @@ export function useBoardPostsData({ slug: post.slug, statusId: post.statusId, status: postStatus.type, + statusIcon: postStatus.icon, summary: post.excerpt, title: post.title, updatedAt: post.updatedAt, diff --git a/apps/web/src/dashboard/features/board/components/board-surface/utils.ts b/apps/web/src/dashboard/features/board/components/board-surface/utils.ts index 12dbaa784..46fc68b4f 100644 --- a/apps/web/src/dashboard/features/board/components/board-surface/utils.ts +++ b/apps/web/src/dashboard/features/board/components/board-surface/utils.ts @@ -9,6 +9,8 @@ import type { } from "./types"; type BoardGroupingStatus = { + /** Optional so a test fixture or a partial status row still groups. */ + icon?: string | null; id: string; label: string; type: BoardPostStatus; @@ -81,6 +83,7 @@ function groupByStatus( label: string; posts: BoardPostRow[]; status: BoardPostStatus; + statusIcon?: string | null; statusId: string; } >( @@ -90,6 +93,7 @@ function groupByStatus( label: status.label, posts: [], status: status.type, + statusIcon: status.icon, statusId: status.id, }, ]) @@ -107,6 +111,7 @@ function groupByStatus( label: "", posts: [post], status: post.status, + statusIcon: post.statusIcon, statusId: post.statusId, }); } @@ -123,6 +128,7 @@ function groupByStatus( label: lane.label, posts: lane.posts, status: lane.status, + statusIcon: lane.statusIcon, statusId: lane.statusId, }); } @@ -178,7 +184,10 @@ function groupByAssignee( } function groupByBoard(posts: readonly BoardPostRow[]): BoardPostLane[] { - const byBoard = new Map(); + const byBoard = new Map< + string, + { boardIcon?: string | null; label: string; posts: BoardPostRow[] } + >(); for (const post of posts) { const board = byBoard.get(post.boardId); @@ -187,6 +196,7 @@ function groupByBoard(posts: readonly BoardPostRow[]): BoardPostLane[] { board.posts.push(post); } else { byBoard.set(post.boardId, { + boardIcon: post.boardIcon, label: post.boardName || "No board", posts: [post], }); @@ -196,6 +206,7 @@ function groupByBoard(posts: readonly BoardPostRow[]): BoardPostLane[] { return [...byBoard.entries()] .toSorted((left, right) => left[1].label.localeCompare(right[1].label)) .map(([id, board]) => ({ + boardIcon: board.boardIcon, id, label: board.label, posts: board.posts, diff --git a/apps/web/src/dashboard/features/board/components/create-board-dialog.tsx b/apps/web/src/dashboard/features/board/components/create-board-dialog.tsx index 5a5eac3be..d0a3964dc 100644 --- a/apps/web/src/dashboard/features/board/components/create-board-dialog.tsx +++ b/apps/web/src/dashboard/features/board/components/create-board-dialog.tsx @@ -9,6 +9,7 @@ import { EmptyTitle, } from "@feeblo/ui/empty"; import { useAppForm } from "@feeblo/ui/hooks/form"; +import { IconPickerField } from "@feeblo/ui/icon-picker"; import { Sheet, SheetClose, @@ -21,6 +22,7 @@ import { } from "@feeblo/ui/sheet"; import { toastManager } from "@feeblo/ui/toast"; import { slugify } from "@feeblo/utils/url"; +import { DEFAULT_BOARD_ICON } from "@feeblo/web-shared/icons/defaults"; import { SparklesIcon } from "@hugeicons/core-free-icons"; import { HugeiconsIcon } from "@hugeicons/react"; import { useSelector } from "@xstate/store-react"; @@ -77,6 +79,7 @@ function CreateBoardForm() { createdAt: new Date(), updatedAt: new Date(), name: data.value.name, + icon: data.value.icon, visibility: data.value.visibility, slug: slugify(data.value.name), organizationId, @@ -140,6 +143,16 @@ function CreateBoardForm() { {(field) => } + + {(field) => ( + field.handleChange(icon)} + value={field.state.value} + /> + )} + diff --git a/apps/web/src/dashboard/features/board/components/rename-board-dialog.tsx b/apps/web/src/dashboard/features/board/components/rename-board-dialog.tsx index 2a4b7d0ee..9aab96d33 100644 --- a/apps/web/src/dashboard/features/board/components/rename-board-dialog.tsx +++ b/apps/web/src/dashboard/features/board/components/rename-board-dialog.tsx @@ -1,5 +1,7 @@ +import type { TBoard } from "@feeblo/domain/board/schema"; import { Button } from "@feeblo/ui/button"; import { useAppForm } from "@feeblo/ui/hooks/form"; +import { IconPickerField } from "@feeblo/ui/icon-picker"; import { Sheet, SheetClose, @@ -12,15 +14,17 @@ import { } from "@feeblo/ui/sheet"; import { toastManager } from "@feeblo/ui/toast"; import { slugify } from "@feeblo/utils/url"; +import { DEFAULT_BOARD_ICON } from "@feeblo/web-shared/icons/defaults"; import { and, eq, useLiveQuery } from "@tanstack/react-db"; import { useNavigate } from "@tanstack/react-router"; import { useSelector } from "@xstate/store-react"; +import { useRef } from "react"; import { useOrganizationId } from "~/hooks/use-organization-id"; import { useDashboardCollections } from "~/providers/dashboard-collections-provider"; import { useRenameBoardDialogContext } from "../dialog-stores"; -import { type BoardFormValues, boardFormOpts } from "../shared-form"; +import { boardFormOpts } from "../shared-form"; import { BoardVisibilityField } from "./board-visibility-field"; export function RenameBoardDialog() { @@ -70,30 +74,58 @@ function RenameBoardForm() { return ; } -function RenameBoardFormFields({ board }: { board: BoardFormValues }) { +/** The row the edit sheet seeds from. */ +type RenameBoardRow = Pick; + +function RenameBoardFormFields({ board }: { board: RenameBoardRow }) { const organizationId = useOrganizationId(); const { boardCollection } = useDashboardCollections(); const store = useRenameBoardDialogContext(); const boardId = useSelector(store, (state) => state.context.data.boardId); const navigate = useNavigate(); + // Captured when the sheet opened: a refetch can change the row under the + // form, and a save must compare against the value the editor started with. + const initialIcon = useRef(board.icon); const form = useAppForm({ ...boardFormOpts, defaultValues: { name: board.name, + icon: board.icon, visibility: board.visibility, }, - onSubmit: async (data) => { + onSubmit: async ({ formApi, value }) => { try { - const boardSlug = slugify(data.value.name); + const boardSlug = slugify(value.name); + const nameIsDirty = formApi.getFieldMeta("name")?.isDirty ?? false; + + const visibilityIsDirty = + formApi.getFieldMeta("visibility")?.isDirty ?? false; + + // Compare with the value the sheet opened with, not `isDirty`: the + // form's defaults can be replaced by a refetch, and a save that only + // changed one field must not repoint the others. + const iconChanged = value.icon !== initialIcon.current; const tx = boardCollection.update(boardId, (draft) => { - draft.name = data.value.name; - draft.visibility = data.value.visibility; - draft.slug = boardSlug; + if (nameIsDirty) { + draft.name = value.name; + draft.slug = boardSlug; + } + + if (visibilityIsDirty) { + draft.visibility = value.visibility; + } + + if (iconChanged) { + draft.icon = value.icon; + } }); await tx.when("settled"); + // The server derives the slug from the saved name, and a concurrent + // rename may have moved it. Navigate to the row the save returned. + const savedSlug = boardCollection.get(boardId)?.slug ?? boardSlug; toastManager.add({ title: "Board renamed successfully", type: "success", @@ -104,7 +136,7 @@ function RenameBoardFormFields({ board }: { board: BoardFormValues }) { to: "/$organizationId/board/$boardSlug", params: { organizationId, - boardSlug, + boardSlug: savedSlug, }, }); } catch { @@ -129,6 +161,16 @@ function RenameBoardFormFields({ board }: { board: BoardFormValues }) { {(field) => } + + {(field) => ( + field.handleChange(icon)} + value={field.state.value} + /> + )} + diff --git a/apps/web/src/dashboard/features/board/shared-form.ts b/apps/web/src/dashboard/features/board/shared-form.ts index e77909abc..45ef08683 100644 --- a/apps/web/src/dashboard/features/board/shared-form.ts +++ b/apps/web/src/dashboard/features/board/shared-form.ts @@ -1,16 +1,21 @@ +import { DEFAULT_BOARD_ICON } from "@feeblo/web-shared/icons/defaults"; import { formOptions } from "@tanstack/react-form"; import { z } from "zod"; export const boardFormSchema = z.object({ name: z.string().trim().min(1, "Board name is required"), + // No length rule: an existing stored icon must not block a rename. New + // selections come from the picker, whose generated names are all shorter + // than the column's bound. + icon: z.string().trim().nullable(), visibility: z.enum(["PUBLIC", "PRIVATE"]), }); -export type BoardFormValues = z.infer; - export const boardFormOpts = formOptions({ defaultValues: { name: "", + // SAFETY: The form's icon is nullable; null means "use the client default". + icon: null as string | null, // SAFETY: The upstream source guarantees one of these values; the cast bridges an untyped API. visibility: "PUBLIC" as "PUBLIC" | "PRIVATE", }, diff --git a/apps/web/src/dashboard/features/dashboard-home/components/recent-posts-section.tsx b/apps/web/src/dashboard/features/dashboard-home/components/recent-posts-section.tsx index 029425e69..32770dff2 100644 --- a/apps/web/src/dashboard/features/dashboard-home/components/recent-posts-section.tsx +++ b/apps/web/src/dashboard/features/dashboard-home/components/recent-posts-section.tsx @@ -1,3 +1,4 @@ +import type { TPostStatusType } from "@feeblo/domain/post-status/schema"; import { formatPostStatus } from "@feeblo/post-ui/post-status"; import { PostCard } from "@feeblo/post-ui/post/post-card"; import { StandaloneUpvoteButton } from "@feeblo/post-ui/upvote-toggle"; @@ -39,16 +40,18 @@ interface Post { } interface Board { + icon: string | null; id: string; name: string; slug: string; } interface Status { + color?: string | null; + icon: string | null; id: string; - type: string; label: string; - color?: string | null; + type: TPostStatusType; } interface RecentPostsSectionProps { @@ -149,11 +152,15 @@ export function RecentPostsSection({ {status && ( )} {board?.name && ( - {board.name} + + {board.name} + )} ({ label: board.name, value: board.id })), + { icon: undefined, label: m.leafy_calm_jay(), value: ALL_BOARDS }, + ...boards.map((board) => ({ + icon: board.icon, + label: board.name, + value: board.id, + })), ]; return ( @@ -207,12 +213,30 @@ function BoardPicker({ value={value === "" ? null : value} > - + + {(value: string) => { + const item = items.find((candidate) => candidate.value === value); + + return item ? ( + + {item.icon === undefined ? null : ( + + )} + {item.label} + + ) : null; + }} + {items.map((item) => ( - {item.label} + + {item.icon === undefined ? null : ( + + )} + {item.label} + ))} diff --git a/apps/web/src/dashboard/features/help-center/components/help-center-article-editor.tsx b/apps/web/src/dashboard/features/help-center/components/help-center-article-editor.tsx index 44a9787a4..b94c3e617 100644 --- a/apps/web/src/dashboard/features/help-center/components/help-center-article-editor.tsx +++ b/apps/web/src/dashboard/features/help-center/components/help-center-article-editor.tsx @@ -28,7 +28,7 @@ import { helpCenterArticleFormValues, type HelpCenterArticleFormValues, } from "../help-center-forms"; -import { HelpCenterTopicIcon } from "./help-center-topic-icons"; +import { HelpCenterTopicIcon } from "./help-center-topic-icon"; /** * What the editor is editing, as a discriminated union rather than an optional diff --git a/apps/web/src/dashboard/features/help-center/components/help-center-index.tsx b/apps/web/src/dashboard/features/help-center/components/help-center-index.tsx index fc2230dcc..42ccfbad9 100644 --- a/apps/web/src/dashboard/features/help-center/components/help-center-index.tsx +++ b/apps/web/src/dashboard/features/help-center/components/help-center-index.tsx @@ -42,7 +42,7 @@ import { CreateHelpCenterTopicDialog, EditHelpCenterTopicDialog, } from "./help-center-topic-dialog"; -import { HelpCenterTopicIcon } from "./help-center-topic-icons"; +import { HelpCenterTopicIcon } from "./help-center-topic-icon"; /** The collection's own row: `description` and `icon` are nullable columns. */ type THelpCenterTopicRow = { diff --git a/apps/web/src/dashboard/features/help-center/components/help-center-topic-dialog.tsx b/apps/web/src/dashboard/features/help-center/components/help-center-topic-dialog.tsx index 0c4dc2c7c..2af02133d 100644 --- a/apps/web/src/dashboard/features/help-center/components/help-center-topic-dialog.tsx +++ b/apps/web/src/dashboard/features/help-center/components/help-center-topic-dialog.tsx @@ -11,7 +11,8 @@ import { DialogTitle, } from "@feeblo/ui/dialog"; import { useAppForm } from "@feeblo/ui/hooks/form"; -import { cn } from "@feeblo/ui/utils"; +import { IconPickerField } from "@feeblo/ui/icon-picker"; +import { DEFAULT_HELP_CENTER_TOPIC_ICON } from "@feeblo/web-shared/icons/defaults"; import { parseRpcError } from "@feeblo/web-shared/rpc-error"; import { useState } from "react"; @@ -22,10 +23,6 @@ import { helpCenterTopicFormValues, type HelpCenterTopicFormValues, } from "../help-center-forms"; -import { - HELP_CENTER_TOPIC_ICON_KEYS, - HelpCenterTopicIcon, -} from "./help-center-topic-icons"; /** * The section dialog, as two variants rather than one component with a mode. @@ -225,28 +222,12 @@ function TopicFields({ {(field) => ( -
- Icon -
- {HELP_CENTER_TOPIC_ICON_KEYS.map((key) => ( - - ))} -
-
+ field.handleChange(icon)} + value={field.state.value} + /> )}
diff --git a/apps/web/src/dashboard/features/help-center/components/help-center-topic-icon.tsx b/apps/web/src/dashboard/features/help-center/components/help-center-topic-icon.tsx new file mode 100644 index 000000000..caf348e4b --- /dev/null +++ b/apps/web/src/dashboard/features/help-center/components/help-center-topic-icon.tsx @@ -0,0 +1,22 @@ +import { TablerIcon } from "@feeblo/ui/icon-picker"; +import { helpCenterTopicIconName } from "@feeblo/web-shared/icons/defaults"; + +/** + * A section's icon. + * + * The column stores a Tabler name; a null or unknown value falls back to the + * client's default, so a section created before the picker existed still has + * a mark. The sprite is fetched by the first icon that renders, not by the + * dialog, so a list of sections draws without opening the picker. + */ +export function HelpCenterTopicIcon({ + className, + icon, +}: { + className?: string; + icon: string | null | undefined; +}) { + return ( + + ); +} diff --git a/apps/web/src/dashboard/features/help-center/components/help-center-topic-icons.tsx b/apps/web/src/dashboard/features/help-center/components/help-center-topic-icons.tsx deleted file mode 100644 index e0adee588..000000000 --- a/apps/web/src/dashboard/features/help-center/components/help-center-topic-icons.tsx +++ /dev/null @@ -1,85 +0,0 @@ -import { - BookOpen01Icon, - Briefcase01Icon, - Bug01Icon, - CreditCardIcon, - PuzzleIcon, - RocketIcon, - Settings01Icon, - UserIcon, -} from "@hugeicons/core-free-icons"; -import type { IconSvgElement } from "@hugeicons/react"; -import { HugeiconsIcon } from "@hugeicons/react"; - -/** - * The topic icons the dashboard offers. - * - * A closed set rather than a free-text field, and stored as the key: the column - * is a *name* the UI resolves, so changing the artwork later is a code change - * and not a data migration, and an unknown stored value degrades to the - * fallback instead of rendering nothing. - */ -export const HELP_CENTER_TOPIC_ICON_KEYS = [ - "book", - "rocket", - "settings", - "card", - "bug", - "puzzle", - "briefcase", - "user", -] as const; - -export type THelpCenterTopicIcon = (typeof HELP_CENTER_TOPIC_ICON_KEYS)[number]; - -// The `satisfies` is what makes adding a key to the list above a compile error -// until it has artwork, and what makes an artwork key that is not in the list a -// compile error too. -export const HELP_CENTER_TOPIC_ICONS = { - book: BookOpen01Icon, - rocket: RocketIcon, - settings: Settings01Icon, - card: CreditCardIcon, - bug: Bug01Icon, - puzzle: PuzzleIcon, - briefcase: Briefcase01Icon, - user: UserIcon, -} satisfies Record; - -export const DEFAULT_HELP_CENTER_TOPIC_ICON: THelpCenterTopicIcon = "book"; - -/** True when `value` names an icon this build knows. */ -export const isHelpCenterTopicIcon = ( - value: string | null | undefined -): value is THelpCenterTopicIcon => - value !== null && value !== undefined && isTopicIconKey(value); - -/** - * The membership test, widened once. - * - * `includes` on the readonly tuple wants a member of the union, and the whole - * point of the guard is to accept a value that is not one yet — so the search - * runs over the same keys as plain strings. - */ -const isTopicIconKey = (value: string): boolean => - HELP_CENTER_TOPIC_ICON_KEYS.some((key) => key === value); - -export function HelpCenterTopicIcon({ - className, - icon, -}: { - className?: string; - icon: string | null | undefined; -}) { - const resolved = isHelpCenterTopicIcon(icon) - ? icon - : DEFAULT_HELP_CENTER_TOPIC_ICON; - - return ( - - ); -} diff --git a/apps/web/src/dashboard/features/help-center/help-center-forms.ts b/apps/web/src/dashboard/features/help-center/help-center-forms.ts index cf18669cd..9fe317276 100644 --- a/apps/web/src/dashboard/features/help-center/help-center-forms.ts +++ b/apps/web/src/dashboard/features/help-center/help-center-forms.ts @@ -4,19 +4,14 @@ import type { THelpCenterTopic } from "@feeblo/domain/help-center-topic/schema"; import { formOptions } from "@tanstack/react-form"; import { z } from "zod"; -import { - DEFAULT_HELP_CENTER_TOPIC_ICON, - HELP_CENTER_TOPIC_ICON_KEYS, - type THelpCenterTopicIcon, -} from "./components/help-center-topic-icons"; - /** * The topic form's shape, and the labels its controls render. * * The schema mirrors the server's bounds rather than defining them: a courtesy * check that turns a round trip into an inline message, with the RPC as the - * enforcement point. `icon` is an enum over the catalogue, so a stored value - * the picker cannot render is a validation failure instead of an empty tile. + * enforcement point. `icon` is a Tabler name from the picker; an unknown name + * renders the client's default rather than an empty tile, so the form only + * enforces the column's length. */ export const helpCenterTopicFormSchema = z.object({ name: z @@ -25,7 +20,7 @@ export const helpCenterTopicFormSchema = z.object({ .min(1, "A section needs a name.") .max(100, "Use 100 characters or fewer."), description: z.string().trim().max(500, "Use 500 characters or fewer."), - icon: z.enum(HELP_CENTER_TOPIC_ICON_KEYS), + icon: z.string().trim().max(64).nullable(), }); export type HelpCenterTopicFormValues = z.infer< @@ -47,15 +42,12 @@ export type HelpCenterTopicFormSeed = Pick< >; export const helpCenterTopicFormValues = ( - topic?: HelpCenterTopicFormSeed, - fallbackIcon: THelpCenterTopicIcon = DEFAULT_HELP_CENTER_TOPIC_ICON + topic?: HelpCenterTopicFormSeed ): HelpCenterTopicFormValues => ({ description: topic?.description ?? "", - // `find` over the tuple already narrows to the icon union, so the fallback is - // the only `undefined` it can return. - icon: - HELP_CENTER_TOPIC_ICON_KEYS.find((key) => key === topic?.icon) ?? - fallbackIcon, + // Null means "no override": the picker shows the client default, and a + // "Use default" reset stays null instead of persisting that default. + icon: topic?.icon ?? null, name: topic?.name ?? "", }); diff --git a/apps/web/src/dashboard/features/post-status/components/post-status-create-dialog.tsx b/apps/web/src/dashboard/features/post-status/components/post-status-create-dialog.tsx index f64221efb..02ba4634f 100644 --- a/apps/web/src/dashboard/features/post-status/components/post-status-create-dialog.tsx +++ b/apps/web/src/dashboard/features/post-status/components/post-status-create-dialog.tsx @@ -14,7 +14,9 @@ import { } from "@feeblo/ui/dialog"; import { Field, FieldLabel } from "@feeblo/ui/field"; import { useAppForm } from "@feeblo/ui/hooks/form"; +import { IconPickerField } from "@feeblo/ui/icon-picker"; import { toastManager } from "@feeblo/ui/toast"; +import { DEFAULT_POST_STATUS_ICONS } from "@feeblo/web-shared/icons/defaults"; import { useSelector } from "@xstate/store-react"; import { z } from "zod"; @@ -58,11 +60,14 @@ function PostStatusCreateForm({ type }: { type: TPostStatusType }) { const form = useAppForm({ defaultValues: { color: DEFAULT_POST_STATUS_COLORS[type], + // SAFETY: The form's icon is nullable; null means "use the type default". + icon: null as string | null, label: "", }, validators: { onSubmit: z.object({ color: z.string(), + icon: z.string().trim().max(64).nullable(), label: z.string().min(1).max(60), }), }, @@ -84,6 +89,7 @@ function PostStatusCreateForm({ type }: { type: TPostStatusType }) { id, color: data.value.color, createdAt: new Date(), + icon: data.value.icon, isDefault: false, label: data.value.label, orderIndex, @@ -133,6 +139,19 @@ function PostStatusCreateForm({ type }: { type: TPostStatusType }) { )} + + {(field) => ( + + Icon + field.handleChange(icon)} + value={field.state.value} + /> + + )} + }>Cancel diff --git a/apps/web/src/dashboard/features/post-status/components/post-status-edit-dialog.tsx b/apps/web/src/dashboard/features/post-status/components/post-status-edit-dialog.tsx index 053d4dc79..f7b295263 100644 --- a/apps/web/src/dashboard/features/post-status/components/post-status-edit-dialog.tsx +++ b/apps/web/src/dashboard/features/post-status/components/post-status-edit-dialog.tsx @@ -1,4 +1,7 @@ -import type { TPostStatusType } from "@feeblo/domain/post-status/schema"; +import type { + TPostStatus, + TPostStatusType, +} from "@feeblo/domain/post-status/schema"; import { Button } from "@feeblo/ui/button"; import { Dialog, @@ -12,6 +15,7 @@ import { } from "@feeblo/ui/dialog"; import { Field, FieldLabel } from "@feeblo/ui/field"; import { useAppForm } from "@feeblo/ui/hooks/form"; +import { IconPickerField } from "@feeblo/ui/icon-picker"; import { Select, SelectItem, @@ -20,8 +24,10 @@ import { SelectValue, } from "@feeblo/ui/select"; import { toastManager } from "@feeblo/ui/toast"; +import { DEFAULT_POST_STATUS_ICONS } from "@feeblo/web-shared/icons/defaults"; import { eq, useLiveQuery } from "@tanstack/react-db"; import { useSelector } from "@xstate/store-react"; +import { useRef } from "react"; import { z } from "zod"; import { useDashboardCollections } from "~/providers/dashboard-collections-provider"; @@ -59,6 +65,7 @@ export function PostStatusEditDialog() { key={status.id} status={{ color: status.color ?? null, + icon: status.icon ?? null, id: status.id, label: status.label, type: status.type, @@ -70,26 +77,31 @@ export function PostStatusEditDialog() { ); } -type EditableStatus = { - color: string | null; - id: string; - label: string; - type: TPostStatusType; +type EditableStatus = Pick & { + /** The projection normalizes the optional column to an explicit null. */ + color: Exclude; }; function PostStatusEditForm({ status }: { status: EditableStatus }) { const { postStatusCollection } = useDashboardCollections(); const store = usePostStatusEditDialogContext(); + // The value the form opened with; a save that only renamed the status must + // not repoint its icon at a concurrent change. + const initialIcon = useRef(status.icon); const form = useAppForm({ defaultValues: { color: status.color, + icon: status.icon, label: status.label, type: status.type, }, validators: { onSubmit: z.object({ color: z.string().nullable(), + // No length rule here: an untouched stored icon must not block an + // unrelated edit. The picker can only emit catalogue names. + icon: z.string().trim().nullable(), label: z.string().min(1).max(60), type: z.enum([ "PENDING", @@ -114,11 +126,17 @@ function PostStatusEditForm({ status }: { status: EditableStatus }) { ) + 1 : undefined; + const iconChanged = data.value.icon !== initialIcon.current; + const tx = postStatusCollection.update(status.id, (draft) => { draft.color = data.value.color; draft.label = data.value.label; draft.type = data.value.type; + if (iconChanged) { + draft.icon = data.value.icon; + } + if (orderIndex !== undefined) { draft.orderIndex = orderIndex; } @@ -164,6 +182,23 @@ function PostStatusEditForm({ status }: { status: EditableStatus }) { )} + state.values.type}> + {(type) => ( + + {(field) => ( + + Icon + field.handleChange(icon)} + value={field.state.value} + /> + + )} + + )} + {(field) => ( diff --git a/apps/web/src/dashboard/features/post-status/components/post-status-settings.tsx b/apps/web/src/dashboard/features/post-status/components/post-status-settings.tsx index f210cbc52..97451590d 100644 --- a/apps/web/src/dashboard/features/post-status/components/post-status-settings.tsx +++ b/apps/web/src/dashboard/features/post-status/components/post-status-settings.tsx @@ -3,13 +3,13 @@ import { DragDropProvider } from "@dnd-kit/react"; import { useSortable } from "@dnd-kit/react/sortable"; import type { TPostStatusType } from "@feeblo/domain/post-status/schema"; import { formatPostStatus } from "@feeblo/post-ui/post-status"; +import { PostStatusIcon } from "@feeblo/post-ui/post-status-icon"; import { Badge } from "@feeblo/ui/badge"; import { Button } from "@feeblo/ui/button"; import { Menu, MenuItem, MenuPopup, MenuTrigger } from "@feeblo/ui/menu"; import { SkeletonLoader, SkeletonWrapper } from "@feeblo/ui/skeleton-loader"; import { toastManager } from "@feeblo/ui/toast"; import { cn } from "@feeblo/ui/utils"; -import { BoardIconMap } from "@feeblo/web-shared/board/constants"; import { hasPermission, PolicyGuard } from "@feeblo/web-shared/use-policy"; import { CheckmarkBadge01Icon, @@ -36,6 +36,7 @@ import { postStatusSections } from "../sections"; type StatusRow = { color?: string | null; + icon?: string | null; id: string; isDefault: boolean; label: string; @@ -261,7 +262,6 @@ function PostStatusRow({ data: { type: status.type }, }); - const Icon = BoardIconMap[status.type]; const label = status.label || formatPostStatus(status.type); /** @@ -318,7 +318,7 @@ function PostStatusRow({ className="inline-flex items-center justify-center" style={status.color ? { color: status.color } : undefined} > - +
diff --git a/apps/web/src/dashboard/features/post/components/post-activity-list.tsx b/apps/web/src/dashboard/features/post/components/post-activity-list.tsx index 94b5e79f9..a5cabe6f4 100644 --- a/apps/web/src/dashboard/features/post/components/post-activity-list.tsx +++ b/apps/web/src/dashboard/features/post/components/post-activity-list.tsx @@ -2,6 +2,7 @@ import type { TContact } from "@feeblo/domain/contact/schema"; import type { TPostActivityKind } from "@feeblo/domain/post-activity/schema"; import type { TPostActivity } from "@feeblo/domain/post-activity/schema"; import { formatPostStatus } from "@feeblo/post-ui/post-status"; +import { PostStatusIcon } from "@feeblo/post-ui/post-status-icon"; import { ActivityTimeline, ActivityTimelineItem, @@ -10,7 +11,6 @@ import { cn } from "@feeblo/ui/utils"; import * as dayjs from "@feeblo/utils/dayjs"; import { BOARD_LANE_COLOR_MAP, - BoardIconMap, type BoardPostStatus, } from "@feeblo/web-shared/board/constants"; import { @@ -158,26 +158,40 @@ function getActivityDescription({ return descriptions[activity.kind]; } -type ActivityIcon = { icon: typeof FileAddIcon; color: string }; +type ActivityIcon = + | { + color: string; + kind: "status"; + statusIcon: string | null; + statusType: BoardPostStatus; + } + | { + color: string; + icon: typeof FileAddIcon; + kind: "generic"; + }; function getActivityIcon( activity: TPostActivity, - statusTypes: ReadonlyMap + statuses: ReadonlyMap ): ActivityIcon { if (activity.kind === "STATUS_CHANGED" && activity.nextValue) { - const statusType = statusTypes.get(activity.nextValue); + const status = statuses.get(activity.nextValue); - if (statusType) { + if (status) { return { - icon: BoardIconMap[statusType] ?? StatusIcon, - color: BOARD_LANE_COLOR_MAP[statusType] ?? "text-muted-foreground", + color: BOARD_LANE_COLOR_MAP[status.type] ?? "text-muted-foreground", + kind: "status", + statusIcon: status.icon, + statusType: status.type, }; } } return { - icon: activityIconMap[activity.kind], color: "text-muted-foreground", + icon: activityIconMap[activity.kind] ?? FileAddIcon, + kind: "generic", }; } @@ -240,8 +254,14 @@ export function PostActivityList({ [statuses] ); - const statusTypes = useMemo( - () => new Map(statuses.map((status) => [status.id, status.type])), + const statusMarks = useMemo( + () => + new Map( + statuses.map((status) => [ + status.id, + { icon: status.icon, type: status.type }, + ]) + ), [statuses] ); @@ -311,7 +331,8 @@ export function PostActivityList({ {activities.map((activity) => { const actorName = activity.actor.name ?? "Someone"; - const { icon, color } = getActivityIcon(activity, statusTypes); + const activityIcon = getActivityIcon(activity, statusMarks); + const { color } = activityIcon; const onBehalfMetadata = getOnBehalfMetadata(activity); const onBehalfSubject = onBehalfMetadata @@ -326,12 +347,22 @@ export function PostActivityList({ return (
diff --git a/packages/post-ui/src/roadmap/roadmap-lane-column.tsx b/packages/post-ui/src/roadmap/roadmap-lane-column.tsx index 65a1a02c1..fdfd9e14e 100644 --- a/packages/post-ui/src/roadmap/roadmap-lane-column.tsx +++ b/packages/post-ui/src/roadmap/roadmap-lane-column.tsx @@ -16,6 +16,7 @@ interface RoadmapLaneColumnProps { label?: string; name?: string; status?: RoadmapStatus; + statusIcon?: string | null; totalPosts?: number; } @@ -28,6 +29,7 @@ export function RoadmapLaneColumn({ label, name, status, + statusIcon, totalPosts, }: RoadmapLaneColumnProps) { const readableStatus = @@ -46,7 +48,10 @@ export function RoadmapLaneColumn({
- {icon ?? (status ? : null)} + {icon ?? + (status ? ( + + ) : null)}

{readableStatus}

{resolvedAction} diff --git a/packages/post-ui/src/roadmap/roadmap-status-icon.tsx b/packages/post-ui/src/roadmap/roadmap-status-icon.tsx index cbb0e2185..335e31f00 100644 --- a/packages/post-ui/src/roadmap/roadmap-status-icon.tsx +++ b/packages/post-ui/src/roadmap/roadmap-status-icon.tsx @@ -1,19 +1,21 @@ import { cn } from "@feeblo/ui/utils"; -import { - BOARD_LANE_COLOR_MAP, - BoardIconMap, -} from "@feeblo/web-shared/board/constants"; -import { HugeiconsIcon } from "@hugeicons/react"; +import { BOARD_LANE_COLOR_MAP } from "@feeblo/web-shared/board/constants"; +import { PostStatusIcon } from "../post-status-icon"; import type { RoadmapStatus } from "./types"; -export function RoadmapStatusIcon({ status }: { status: RoadmapStatus }) { - const Icon = BoardIconMap[status] ?? BoardIconMap.PLANNED; +export function RoadmapStatusIcon({ + icon, + status, +}: { + icon?: string | null; + status: RoadmapStatus; +}) { const color = BOARD_LANE_COLOR_MAP[status]; return ( - + ); } diff --git a/packages/post-ui/src/roadmap/types.ts b/packages/post-ui/src/roadmap/types.ts index f7b1bc387..6d59a8263 100644 --- a/packages/post-ui/src/roadmap/types.ts +++ b/packages/post-ui/src/roadmap/types.ts @@ -7,6 +7,7 @@ export type RoadmapColumnDefinition = { name: string; roadmapId: string; statusId: string; + statusIcon?: string | null; type: RoadmapStatus; label: string; }; @@ -17,6 +18,7 @@ export type RoadmapPost = { id: string; slug: string; status: RoadmapStatus; + statusIcon?: string | null; statusId: string; summary: string; title: string; @@ -33,5 +35,6 @@ export type RoadmapLane = { name?: string; posts: TPost[]; status: RoadmapStatus; + statusIcon?: string | null; statusId: string; }; diff --git a/packages/post-ui/src/roadmap/use-roadmap-data.ts b/packages/post-ui/src/roadmap/use-roadmap-data.ts index ec199b7b1..d354f886b 100644 --- a/packages/post-ui/src/roadmap/use-roadmap-data.ts +++ b/packages/post-ui/src/roadmap/use-roadmap-data.ts @@ -43,7 +43,12 @@ type PostRowLike = Pick< type PostStatusRowLike = Pick< TPostStatus, "id" | "label" | "organizationId" | "type" ->; +> & + /** + * Optional so a collection fixture that predates the picker still satisfies + * the constraint; the production collection always carries it. + */ + Partial>; type RoadmapRowLike = Pick< TRoadmap, @@ -245,6 +250,7 @@ export function useRoadmapData< name: column.name, roadmapId: column.roadmapId, statusId: postStatus.id, + statusIcon: postStatus.icon ?? null, type: postStatus.type, label: postStatus.label, })) @@ -294,6 +300,7 @@ export function useRoadmapData< id: post.id, slug: post.slug, status: postStatus.type, + statusIcon: postStatus.icon ?? null, statusId: post.statusId, summary: post.excerpt, title: post.title, diff --git a/packages/post-ui/src/roadmap/utils.ts b/packages/post-ui/src/roadmap/utils.ts index cc3ce3b8a..84cea0a72 100644 --- a/packages/post-ui/src/roadmap/utils.ts +++ b/packages/post-ui/src/roadmap/utils.ts @@ -31,6 +31,7 @@ export function groupRoadmapPostsByStatus( name: column.name, posts: [], status: column.type, + statusIcon: column.statusIcon, statusId: column.statusId, }, ]) diff --git a/packages/ui/scripts/generate-tabler-filled-sprite.ts b/packages/ui/scripts/generate-tabler-filled-sprite.ts index ec77a52bc..f76c1dd62 100644 --- a/packages/ui/scripts/generate-tabler-filled-sprite.ts +++ b/packages/ui/scripts/generate-tabler-filled-sprite.ts @@ -1,5 +1,6 @@ /** - * Generates the icon picker's sprite sheet and its search metadata. + * Generates the icon picker's sprite sheet, its search metadata, and the name + * set the shared entity-icon defaults validate against. * * The picker does not import 1,054 React components. It imports one SVG * `` per icon in a single sprite, plus the name/category/tags records @@ -7,6 +8,9 @@ * committed, for the same reason `packages/feedback-widget` commits its * sprite: `pnpm check` has to work without running a code generator, and a * regenerated file should show up as a reviewable diff when the icon set moves. + * The name set lives in `@feeblo/web-shared` beside the resolver that reads it; + * it is only the names, not the labels and tags, so the search metadata stays + * code-split. * * Run it after bumping `@tabler/icons` in the catalog: * @@ -74,6 +78,18 @@ const outputDirectory = fileURLToPath( new URL("../src/icon-picker/generated", import.meta.url) ); +/** + * The name-only module the entity icon defaults import. + * + * `@feeblo/web-shared` owns the resolver and cannot import from + * `@feeblo/ui` (the UI package depends on it), so the generator writes this + * one file into web-shared. It carries no labels or tags; those stay in the + * lazy catalogue. + */ +const nameSetOutputDirectory = fileURLToPath( + new URL("../../web-shared/src/icons/generated", import.meta.url) +); + // SAFETY: `@tabler/icons` publishes `package.json` and `icons.json` with these // shapes; a mismatch would be a wrong dependency and not a runtime condition. const tablerPackage = JSON.parse( @@ -150,6 +166,15 @@ const symbolPrefix = [ ``, ].join("\n"); +const iconNames = [ + `// Generated by packages/ui/scripts/generate-tabler-filled-sprite.ts. Do not edit.`, + `// Source: @tabler/icons ${tablerVersion} (MIT). See LICENSE-tabler-icons.txt.`, + `export const TABLER_FILLED_ICON_NAMES: ReadonlySet = new Set([`, + ...generatedIcons.map(({ record }) => ` ${JSON.stringify(record.name)},`), + `]);`, + ``, +].join("\n"); + const metadata = [ `// Generated by packages/ui/scripts/generate-tabler-filled-sprite.ts. Do not edit.`, `// Source: @tabler/icons ${tablerVersion} (MIT). See LICENSE-tabler-icons.txt.`, @@ -172,8 +197,15 @@ const metadata = [ await mkdir(outputDirectory, { recursive: true }); +await mkdir(nameSetOutputDirectory, { recursive: true }); + await writeFile(join(outputDirectory, "tabler-filled-sprite.svg"), sprite); +await writeFile( + join(nameSetOutputDirectory, "tabler-filled-names.ts"), + iconNames +); + await writeFile(join(outputDirectory, "tabler-filled-icons.ts"), metadata); await writeFile( @@ -188,7 +220,8 @@ await writeFile( console.log( `Generated ${generatedIcons.length} icons in ${categoryNames.length} categories: ` + - `sprite ${kilobytes(sprite)}, metadata ${kilobytes(metadata)}.` + `sprite ${kilobytes(sprite)}, metadata ${kilobytes(metadata)}, ` + + `names ${kilobytes(iconNames)}.` ); async function generateIcon( diff --git a/packages/ui/src/icon-picker/index.tsx b/packages/ui/src/icon-picker/index.tsx index e0d1380b1..2ebc92f3a 100644 --- a/packages/ui/src/icon-picker/index.tsx +++ b/packages/ui/src/icon-picker/index.tsx @@ -1,4 +1,5 @@ import { isFunction, isString } from "@feeblo/utils/runtime-kind"; +import { isTablerFilledIconName } from "@feeblo/web-shared/icons/defaults"; import { useSelector } from "@xstate/store-react"; import { type ComponentProps, @@ -22,7 +23,9 @@ import { type UIEvent as ReactUIEvent, } from "react"; +import { Button } from "../button"; import { Input } from "../input"; +import { Popover, PopoverPopup, PopoverTrigger } from "../popover"; import { cn } from "../utils"; import { loadIconPickerCatalogue, preloadIconPickerCatalogue } from "./data"; import { TABLER_FILLED_SYMBOL_PREFIX } from "./generated/tabler-filled-symbol-prefix"; @@ -49,6 +52,7 @@ import type { IconPickerDataCategory, IconPickerEmptyProps, IconPickerEmptyRenderProps, + IconPickerFieldProps, IconPickerIcon, IconPickerListCategoryHeaderProps, IconPickerListComponents, @@ -1544,9 +1548,70 @@ function TablerIcon({ ); } +function IconPickerField({ + className, + disabled, + fallbackIcon, + label = "Choose icon", + onChange, + value, +}: IconPickerFieldProps): ReactElement { + const [open, setOpen] = useState(false); + + const trimmedValue = isString(value) ? value.trim() : ""; + + const selected = isTablerFilledIconName(trimmedValue) + ? trimmedValue + : fallbackIcon; + + return ( + + preloadIconPickerCatalogue()} + onPointerEnter={() => preloadIconPickerCatalogue()} + type="button" + variant="outline" + /> + } + > + + {label} + + + { + onChange(icon.name); + setOpen(false); + }} + value={selected} + /> +
+ +
+
+
+ ); +} + const IconPicker = { ActiveIcon: IconPickerActiveIcon, Content: IconPickerContent, + Field: IconPickerField, Empty: IconPickerEmpty, Icon: TablerIcon, List: IconPickerList, @@ -1564,6 +1629,7 @@ const IconPicker = { export { IconPicker, IconPickerActiveIcon, + IconPickerField, IconPickerContent, IconPickerEmpty, IconPickerList, @@ -1586,6 +1652,7 @@ export type { IconPickerDataCategory, IconPickerDataRow, IconPickerEmptyProps, + IconPickerFieldProps, IconPickerIcon, IconPickerInteraction, IconPickerListCategoryHeaderProps, diff --git a/packages/ui/src/icon-picker/sprite.ts b/packages/ui/src/icon-picker/sprite.ts index cdd2c54fe..84aa0523e 100644 --- a/packages/ui/src/icon-picker/sprite.ts +++ b/packages/ui/src/icon-picker/sprite.ts @@ -1,8 +1,20 @@ import { useEffect, useSyncExternalStore } from "react"; -import spriteUrl from "./generated/tabler-filled-sprite.svg?url"; import type { IconPickerSpriteStatus } from "./types"; +/** + * The generated sprite as a Vite asset. + * + * `new URL(..., import.meta.url)` is resolved at build time into one emitted + * file, the same as a `?url` import, and it keeps the asset's type out of the + * package's ambient declarations: a consumer that imports the picker would + * otherwise need the `*.svg?url` declaration in its own program. + */ +const spriteUrl = new URL( + "./generated/tabler-filled-sprite.svg", + import.meta.url +).href; + const SPRITE_ATTRIBUTE = "data-icon-picker-sprite"; type Listener = () => void; diff --git a/packages/ui/src/icon-picker/types.ts b/packages/ui/src/icon-picker/types.ts index 87bdec131..212071e6b 100644 --- a/packages/ui/src/icon-picker/types.ts +++ b/packages/ui/src/icon-picker/types.ts @@ -166,6 +166,26 @@ export type IconPickerActiveIconProps = { children: (props: IconPickerActiveIconRenderProps) => ReactNode; }; +/** + * The picker behind a trigger button, in a popover. + * + * A convenience composition rather than a fifth part: the picker itself does + * not own a popover, and the settings dialogs that select an entity icon would + * otherwise each repeat the same trigger, popup and preload wiring. `onChange` + * reports the Tabler name the caller stores, or null when "Use default" was + * chosen so the caller can persist "no override" rather than a catalogue name. + */ +export type IconPickerFieldProps = { + className?: string; + disabled?: boolean; + /** The icon a null value renders and "Use default" restores. */ + fallbackIcon: string; + /** The trigger's visible text and accessible name. */ + label?: string; + onChange: (name: string | null) => void; + value: string | null | undefined; +}; + export type IconPickerContentProps = Omit & { /** * The message shown when a search has no matches. diff --git a/packages/web-shared/package.json b/packages/web-shared/package.json index 77bb39887..7cd071fbe 100644 --- a/packages/web-shared/package.json +++ b/packages/web-shared/package.json @@ -102,6 +102,10 @@ "types": "./src/board/constants.ts", "default": "./src/board/constants.ts" }, + "./icons/defaults": { + "types": "./src/icons/defaults.ts", + "default": "./src/icons/defaults.ts" + }, "./analytics-provider": { "types": "./src/lib/analytics-provider.tsx", "default": "./src/lib/analytics-provider.tsx" diff --git a/packages/web-shared/src/board/constants.ts b/packages/web-shared/src/board/constants.ts index 83837c416..153bacb3f 100644 --- a/packages/web-shared/src/board/constants.ts +++ b/packages/web-shared/src/board/constants.ts @@ -1,24 +1,15 @@ import type { TPostStatusType } from "@feeblo/domain/post-status/schema"; -import { - CancelCircleIcon, - CheckmarkCircle02Icon, - CircleIcon, - Clock01Icon, - DashedLineCircleIcon, - PauseCircleIcon, -} from "@hugeicons/core-free-icons"; export type BoardPostStatus = TPostStatusType; -export const BoardIconMap = { - CLOSED: CancelCircleIcon, - PENDING: PauseCircleIcon, - COMPLETED: CheckmarkCircle02Icon, - REVIEW: DashedLineCircleIcon, - PLANNED: Clock01Icon, - IN_PROGRESS: CircleIcon, -} satisfies Record; - +/** + * The colour a status lane paints its mark with. + * + * The mark itself is a Tabler name stored on the status; this map is only the + * lane's colour, which a workspace does not customise on the board surface. + * A status with no colour still reads as a status because the mark is the + * picker's, not this map's. + */ export const BOARD_LANE_COLOR_MAP = { // Muted, dark-safe hues model the low-saturation status language of Linear. PENDING: "text-neutral-500 dark:text-neutral-400", diff --git a/packages/web-shared/src/icons/defaults.test.ts b/packages/web-shared/src/icons/defaults.test.ts new file mode 100644 index 000000000..2a4e4fd6d --- /dev/null +++ b/packages/web-shared/src/icons/defaults.test.ts @@ -0,0 +1,29 @@ +import { describe, expect, it } from "vitest"; + +import { + boardIconName, + DEFAULT_BOARD_ICON, + DEFAULT_HELP_CENTER_TOPIC_ICON, + helpCenterTopicIconName, + postStatusIconName, +} from "./defaults"; + +describe("entity icon defaults", () => { + it("uses the board default when no icon is stored or the name is unknown", () => { + expect(boardIconName(null)).toBe(DEFAULT_BOARD_ICON); + expect(boardIconName("")).toBe(DEFAULT_BOARD_ICON); + expect(boardIconName("not-a-tabler-icon")).toBe(DEFAULT_BOARD_ICON); + expect(boardIconName(" bolt ")).toBe("bolt"); + }); + + it("uses the status type's default when the row has no icon", () => { + expect(postStatusIconName(null, "COMPLETED")).toBe("circle-check"); + expect(postStatusIconName("sparkles", "PENDING")).toBe("sparkles"); + expect(postStatusIconName("card", "PENDING")).toBe("clock"); + }); + + it("uses the help-center default when no icon is stored", () => { + expect(helpCenterTopicIconName(null)).toBe(DEFAULT_HELP_CENTER_TOPIC_ICON); + expect(helpCenterTopicIconName("bug")).toBe("bug"); + }); +}); diff --git a/packages/web-shared/src/icons/defaults.ts b/packages/web-shared/src/icons/defaults.ts new file mode 100644 index 000000000..8da855107 --- /dev/null +++ b/packages/web-shared/src/icons/defaults.ts @@ -0,0 +1,63 @@ +import type { TPostStatusType } from "@feeblo/domain/post-status/schema"; +import { isString } from "@feeblo/utils/runtime-kind"; + +import { TABLER_FILLED_ICON_NAMES } from "./generated/tabler-filled-names"; + +/** + * The icon a board, status or help-center topic renders when it has none. + * + * The default lives on the client rather than in the database so an existing + * row can stay null and still draw something. A stored name the build does not + * know is treated like null: the sprite renders nothing for an unknown symbol, + * so an unknown value would otherwise leave an empty tile. The name set is + * generated beside the sprite; the search metadata stays code-split. + */ +export const DEFAULT_BOARD_ICON = "layout-grid"; + +export const DEFAULT_HELP_CENTER_TOPIC_ICON = "lifebuoy"; + +/** + * One default per built-in status type. + * + * A workspace may replace any of these with a picked icon; this map is what a + * status created before the picker existed still shows, and what the status + * form pre-selects for a new status in that section. + */ +export const DEFAULT_POST_STATUS_ICONS = { + PENDING: "clock", + REVIEW: "eye", + PLANNED: "calendar-event", + IN_PROGRESS: "circle-dot", + COMPLETED: "circle-check", + CLOSED: "circle-x", +} satisfies Record; + +export const isTablerFilledIconName = (name: string): boolean => + TABLER_FILLED_ICON_NAMES.has(name); + +const resolveIconName = ( + icon: string | null | undefined, + fallback: string +): string => { + if (!isString(icon)) { + return fallback; + } + + const trimmed = icon.trim(); + + return trimmed.length > 0 && isTablerFilledIconName(trimmed) + ? trimmed + : fallback; +}; + +export const boardIconName = (icon: string | null | undefined): string => + resolveIconName(icon, DEFAULT_BOARD_ICON); + +export const helpCenterTopicIconName = ( + icon: string | null | undefined +): string => resolveIconName(icon, DEFAULT_HELP_CENTER_TOPIC_ICON); + +export const postStatusIconName = ( + icon: string | null | undefined, + type: TPostStatusType +): string => resolveIconName(icon, DEFAULT_POST_STATUS_ICONS[type]); diff --git a/packages/web-shared/src/icons/generated/tabler-filled-names.ts b/packages/web-shared/src/icons/generated/tabler-filled-names.ts new file mode 100644 index 000000000..d41806e5d --- /dev/null +++ b/packages/web-shared/src/icons/generated/tabler-filled-names.ts @@ -0,0 +1,1058 @@ +// Generated by packages/ui/scripts/generate-tabler-filled-sprite.ts. Do not edit. +// Source: @tabler/icons 3.52.0 (MIT). See LICENSE-tabler-icons.txt. +export const TABLER_FILLED_ICON_NAMES: ReadonlySet = new Set([ + "accessible", + "ad", + "ad-circle", + "adjustments", + "adjustments-horizontal", + "aerial-lift", + "affiliate", + "air-balloon", + "alarm", + "alarm-minus", + "alarm-plus", + "alarm-snooze", + "alert-circle", + "alert-hexagon", + "alert-octagon", + "alert-square", + "alert-square-rounded", + "alert-triangle", + "alien", + "align-box-bottom-center", + "align-box-bottom-left", + "align-box-bottom-right", + "align-box-center-middle", + "align-box-left-bottom", + "align-box-left-middle", + "align-box-left-top", + "align-box-right-bottom", + "align-box-right-middle", + "align-box-right-top", + "align-box-top-center", + "align-box-top-left", + "align-box-top-right", + "analyze", + "app-window", + "apple", + "apps", + "archive", + "arrow-autofit-content", + "arrow-autofit-down", + "arrow-autofit-height", + "arrow-autofit-left", + "arrow-autofit-right", + "arrow-autofit-up", + "arrow-autofit-width", + "arrow-badge-down", + "arrow-badge-left", + "arrow-badge-right", + "arrow-badge-up", + "arrow-big-down", + "arrow-big-down-line", + "arrow-big-down-lines", + "arrow-big-left", + "arrow-big-left-line", + "arrow-big-left-lines", + "arrow-big-right", + "arrow-big-right-line", + "arrow-big-right-lines", + "arrow-big-up", + "arrow-big-up-line", + "arrow-big-up-lines", + "arrow-down-circle", + "arrow-down-rhombus", + "arrow-down-square", + "arrow-guide", + "arrow-left-circle", + "arrow-left-rhombus", + "arrow-left-square", + "arrow-move-down", + "arrow-move-left", + "arrow-move-right", + "arrow-move-up", + "arrow-right-circle", + "arrow-right-rhombus", + "arrow-right-square", + "arrow-up-circle", + "arrow-up-rhombus", + "arrow-up-square", + "artboard", + "article", + "aspect-ratio", + "assembly", + "asset", + "atom-2", + "automatic-gearbox", + "award", + "baby-carriage", + "backspace", + "badge", + "badge-3d", + "badge-4k", + "badge-8k", + "badge-ad", + "badge-ar", + "badge-cc", + "badge-hd", + "badge-sd", + "badge-tm", + "badge-vo", + "badge-vr", + "badge-wc", + "badges", + "ball-bowling", + "balloon", + "ballpen", + "bandage", + "barbell", + "barrier-block", + "basket", + "bath", + "battery", + "battery-1", + "battery-2", + "battery-3", + "battery-4", + "battery-automotive", + "battery-vertical", + "battery-vertical-1", + "battery-vertical-2", + "battery-vertical-3", + "battery-vertical-4", + "bed", + "bed-flat", + "beer", + "bell", + "bell-minus", + "bell-plus", + "bell-ringing", + "bell-ringing-2", + "bell-x", + "bell-z", + "bike", + "binary-tree", + "binary-tree-2", + "binoculars", + "biohazard", + "blade", + "blender", + "blob", + "bolt", + "bomb", + "bone", + "bong", + "book", + "bookmark", + "bookmarks", + "boom", + "bottle", + "bounce-left", + "bounce-right", + "bow", + "bowl", + "bowl-chopsticks", + "bowl-spoon", + "box-align-bottom", + "box-align-bottom-left", + "box-align-bottom-right", + "box-align-left", + "box-align-right", + "box-align-top", + "box-align-top-left", + "box-align-top-right", + "box-multiple", + "brand-angular", + "brand-apple", + "brand-bitbucket", + "brand-discord", + "brand-dribbble", + "brand-facebook", + "brand-github", + "brand-google", + "brand-instagram", + "brand-kick", + "brand-linkedin", + "brand-messenger", + "brand-open-source", + "brand-opera", + "brand-patreon", + "brand-paypal", + "brand-pinterest", + "brand-signal", + "brand-sketch", + "brand-snapchat", + "brand-spotify", + "brand-steam", + "brand-stripe", + "brand-tabler", + "brand-tiktok", + "brand-tinder", + "brand-tumblr", + "brand-twitter", + "brand-vercel", + "brand-vimeo", + "brand-weibo", + "brand-whatsapp", + "brand-windows", + "brand-x", + "brand-youtube", + "bread", + "briefcase", + "briefcase-2", + "brightness", + "brightness-auto", + "brightness-down", + "brightness-up", + "bubble", + "bubble-text", + "bug", + "building-bridge-2", + "building-broadcast-tower", + "bulb", + "bus", + "butterfly", + "cactus", + "calculator", + "calendar", + "calendar-event", + "calendar-month", + "calendar-week", + "camera", + "campfire", + "candle", + "cannabis", + "capsule", + "capsule-horizontal", + "capture", + "car", + "car-4wd", + "car-crane", + "car-fan", + "car-suv", + "carambola", + "caravan", + "cardboards", + "cards", + "caret-down", + "caret-left", + "caret-left-right", + "caret-right", + "caret-up", + "caret-up-down", + "carousel-horizontal", + "carousel-vertical", + "cash-banknote", + "category", + "charging-pile", + "chart-area", + "chart-area-line", + "chart-bubble", + "chart-candle", + "chart-donut", + "chart-dots", + "chart-dots-2", + "chart-dots-3", + "chart-funnel", + "chart-grid-dots", + "chart-pie", + "chart-pie-2", + "chart-pie-3", + "chart-pie-4", + "check", + "chef-hat", + "cherry", + "chess", + "chess-bishop", + "chess-king", + "chess-knight", + "chess-queen", + "chess-rook", + "chevron-down", + "chevron-right", + "christmas-tree", + "circle", + "circle-arrow-down", + "circle-arrow-down-left", + "circle-arrow-down-right", + "circle-arrow-left", + "circle-arrow-right", + "circle-arrow-up", + "circle-arrow-up-left", + "circle-arrow-up-right", + "circle-caret-down", + "circle-caret-left", + "circle-caret-right", + "circle-caret-up", + "circle-check", + "circle-chevron-down", + "circle-chevron-left", + "circle-chevron-right", + "circle-chevron-up", + "circle-chevrons-down", + "circle-chevrons-left", + "circle-chevrons-right", + "circle-chevrons-up", + "circle-dot", + "circle-key", + "circle-letter-a", + "circle-letter-b", + "circle-letter-c", + "circle-letter-d", + "circle-letter-e", + "circle-letter-f", + "circle-letter-g", + "circle-letter-h", + "circle-letter-i", + "circle-letter-j", + "circle-letter-k", + "circle-letter-l", + "circle-letter-m", + "circle-letter-n", + "circle-letter-o", + "circle-letter-p", + "circle-letter-q", + "circle-letter-r", + "circle-letter-s", + "circle-letter-t", + "circle-letter-u", + "circle-letter-v", + "circle-letter-w", + "circle-letter-x", + "circle-letter-y", + "circle-letter-z", + "circle-number-0", + "circle-number-1", + "circle-number-2", + "circle-number-3", + "circle-number-4", + "circle-number-5", + "circle-number-6", + "circle-number-7", + "circle-number-8", + "circle-number-9", + "circle-percentage", + "circle-plus", + "circle-rectangle", + "circle-x", + "circles", + "click", + "clipboard", + "clipboard-check", + "clipboard-data", + "clipboard-list", + "clipboard-plus", + "clipboard-smile", + "clipboard-text", + "clipboard-typography", + "clipboard-x", + "clock", + "clock-hour-1", + "clock-hour-10", + "clock-hour-11", + "clock-hour-12", + "clock-hour-2", + "clock-hour-3", + "clock-hour-4", + "clock-hour-5", + "clock-hour-6", + "clock-hour-7", + "clock-hour-8", + "clock-hour-9", + "cloud", + "cloud-computing", + "cloud-data-connection", + "clover", + "clubs", + "code-circle", + "code-circle-2", + "coin", + "coin-bitcoin", + "coin-euro", + "coin-monero", + "coin-pound", + "coin-rupee", + "coin-taka", + "coin-yen", + "coin-yuan", + "columns-1", + "columns-2", + "columns-3", + "compass", + "cone", + "cone-2", + "confetti", + "container", + "contrast", + "contrast-2", + "cookie", + "cookie-man", + "copy", + "copy-check", + "copy-minus", + "copy-plus", + "copy-x", + "copyleft", + "copyright", + "credit-card", + "crop-1-1", + "crop-16-9", + "crop-3-2", + "crop-5-4", + "crop-7-5", + "crop-landscape", + "crop-portrait", + "cross", + "crown", + "current-location", + "dashboard", + "database", + "device-cctv", + "device-desktop", + "device-floppy", + "device-gamepad", + "device-gamepad-2", + "device-gamepad-3", + "device-heart-monitor", + "device-imac", + "device-ipad", + "device-mobile", + "device-remote", + "device-speaker", + "device-tablet", + "device-tv", + "device-tv-old", + "device-unknown", + "device-usb", + "device-vision-pro", + "device-watch", + "dialpad", + "diamond", + "diamonds", + "dice", + "dice-1", + "dice-2", + "dice-3", + "dice-4", + "dice-5", + "dice-6", + "direction-arrows", + "direction-sign", + "directions", + "disc", + "discount", + "dots", + "dots-vertical", + "download", + "drop-circle", + "droplet", + "droplet-half", + "droplet-half-2", + "droplets", + "dual-screen", + "dumpling", + "ease-in-control-point", + "ease-in-out-control-points", + "ease-out-control-point", + "edit", + "egg", + "egg-cracked", + "egg-fried", + "elevator", + "engine", + "escalator", + "escalator-down", + "escalator-up", + "exchange", + "exclamation-circle", + "explicit", + "exposure", + "external-link", + "eye", + "eye-table", + "eyeglass", + "eyeglass-2", + "face-mask", + "favicon", + "feather", + "fence", + "ferry", + "fidget-spinner", + "file", + "file-analytics", + "file-check", + "file-code", + "file-code-2", + "file-cv", + "file-delta", + "file-description", + "file-diff", + "file-digit", + "file-dollar", + "file-dots", + "file-download", + "file-euro", + "file-function", + "file-horizontal", + "file-info", + "file-invoice", + "file-lambda", + "file-minus", + "file-music", + "file-neutral", + "file-pencil", + "file-percent", + "file-phone", + "file-power", + "file-rss", + "file-sad", + "file-scissors", + "file-settings", + "file-signal", + "file-smile", + "file-star", + "file-text", + "file-time", + "file-typography", + "file-unknown", + "file-upload", + "file-vector", + "file-x", + "files", + "filter", + "filters", + "fish-bone", + "flag", + "flag-2", + "flag-3", + "flame", + "flare", + "flask", + "flask-2", + "flower", + "folder", + "folder-open", + "folders", + "forbid", + "forbid-2", + "fountain", + "function", + "garden-cart", + "gas-station", + "gauge", + "ghost", + "ghost-2", + "ghost-3", + "gift", + "gift-card", + "glass", + "glass-full", + "globe", + "golf", + "gps", + "graph", + "grid-pattern", + "guitar-pick", + "hanger-2", + "headphones", + "headset", + "heart", + "heart-broken", + "helicopter", + "helicopter-landing", + "help", + "help-circle", + "help-hexagon", + "help-octagon", + "help-square", + "help-square-rounded", + "help-triangle", + "hexagon", + "hexagon-letter-a", + "hexagon-letter-b", + "hexagon-letter-c", + "hexagon-letter-d", + "hexagon-letter-e", + "hexagon-letter-f", + "hexagon-letter-g", + "hexagon-letter-h", + "hexagon-letter-i", + "hexagon-letter-j", + "hexagon-letter-k", + "hexagon-letter-l", + "hexagon-letter-m", + "hexagon-letter-n", + "hexagon-letter-o", + "hexagon-letter-p", + "hexagon-letter-q", + "hexagon-letter-r", + "hexagon-letter-s", + "hexagon-letter-t", + "hexagon-letter-u", + "hexagon-letter-v", + "hexagon-letter-w", + "hexagon-letter-x", + "hexagon-letter-y", + "hexagon-letter-z", + "hexagon-minus", + "hexagon-number-0", + "hexagon-number-1", + "hexagon-number-2", + "hexagon-number-3", + "hexagon-number-4", + "hexagon-number-5", + "hexagon-number-6", + "hexagon-number-7", + "hexagon-number-8", + "hexagon-number-9", + "hexagon-plus", + "home", + "home-2", + "hospital-circle", + "hourglass", + "icons", + "id", + "info-circle", + "info-hexagon", + "info-octagon", + "info-square", + "info-square-rounded", + "info-triangle", + "inner-shadow-bottom", + "inner-shadow-bottom-left", + "inner-shadow-bottom-right", + "inner-shadow-left", + "inner-shadow-right", + "inner-shadow-top", + "inner-shadow-top-left", + "inner-shadow-top-right", + "ironing", + "ironing-1", + "ironing-2", + "ironing-3", + "ironing-steam", + "jetpack", + "jewish-star", + "key", + "keyboard", + "keyframe", + "keyframe-align-center", + "keyframe-align-horizontal", + "keyframe-align-vertical", + "keyframes", + "label", + "label-important", + "lasso-polygon", + "laurel-wreath", + "laurel-wreath-1", + "laurel-wreath-2", + "laurel-wreath-3", + "layout", + "layout-2", + "layout-align-bottom", + "layout-align-center", + "layout-align-left", + "layout-align-middle", + "layout-align-right", + "layout-align-top", + "layout-board", + "layout-board-split", + "layout-bottombar", + "layout-bottombar-collapse", + "layout-bottombar-expand", + "layout-cards", + "layout-dashboard", + "layout-distribute-horizontal", + "layout-distribute-vertical", + "layout-grid", + "layout-kanban", + "layout-list", + "layout-navbar", + "layout-navbar-collapse", + "layout-navbar-expand", + "layout-sidebar", + "layout-sidebar-left-collapse", + "layout-sidebar-left-expand", + "layout-sidebar-right", + "layout-sidebar-right-collapse", + "layout-sidebar-right-expand", + "leaf", + "lego", + "lemon-2", + "library", + "library-plus", + "lifebuoy", + "link", + "list", + "list-check", + "list-details", + "live-photo", + "live-view", + "location", + "lock", + "lock-square-rounded", + "lungs", + "macro", + "magnet", + "mail", + "mail-opened", + "man", + "manual-gearbox", + "map-pin", + "medical-cross", + "meeple", + "melon", + "menu-2", + "message", + "message-2", + "message-chatbot", + "message-circle", + "message-report", + "messages", + "meteor", + "michelin-star", + "mickey", + "microphone", + "microscope", + "microwave", + "military-rank", + "milk", + "mood-angry", + "mood-confused", + "mood-crazy-happy", + "mood-empty", + "mood-happy", + "mood-kid", + "mood-neutral", + "mood-sad", + "mood-smile", + "mood-wrrr", + "moon", + "motorbike", + "mountain", + "mouse", + "mug", + "mushroom", + "navigation", + "nurse", + "octagon", + "octagon-minus", + "octagon-plus", + "oval", + "oval-vertical", + "pacman", + "paint", + "palette", + "panorama-horizontal", + "panorama-vertical", + "parking-circle", + "paw", + "pencil", + "pennant", + "pennant-2", + "pentagon", + "phone", + "phone-call", + "phone-calling", + "phone-check", + "phone-x", + "photo", + "picture-in-picture", + "picture-in-picture-top", + "pig", + "pill", + "pin", + "pinned", + "pizza", + "plane", + "plane-arrival", + "plane-departure", + "plane-tilt", + "play-card", + "play-card-1", + "play-card-10", + "play-card-2", + "play-card-3", + "play-card-4", + "play-card-5", + "play-card-6", + "play-card-7", + "play-card-8", + "play-card-9", + "play-card-a", + "play-card-j", + "play-card-k", + "play-card-q", + "play-card-star", + "player-eject", + "player-pause", + "player-play", + "player-record", + "player-skip-back", + "player-skip-forward", + "player-stop", + "player-track-next", + "player-track-prev", + "playlist", + "plus", + "point", + "pointer", + "polaroid", + "poo", + "presentation", + "presentation-analytics", + "puzzle", + "quote", + "radar", + "radioactive", + "receipt", + "receipt-dollar", + "receipt-euro", + "receipt-pound", + "receipt-rupee", + "receipt-yen", + "receipt-yuan", + "rectangle", + "rectangle-vertical", + "registered", + "relation-many-to-many", + "relation-one-to-many", + "relation-one-to-one", + "replace", + "report-analytics", + "report-money", + "rollercoaster", + "rosette", + "rosette-discount", + "rosette-discount-check", + "salad", + "satellite", + "scale", + "school", + "scuba-diving-tank", + "search", + "section", + "seedling", + "send", + "settings", + "shield", + "shield-check", + "shield-checkered", + "shield-half", + "shield-lock", + "shirt", + "shopping-cart", + "sign-left", + "sign-right", + "sitemap", + "sort-ascending-2", + "sort-ascending-shapes", + "sort-descending-2", + "sort-descending-shapes", + "soup", + "spade", + "sparkles", + "sparkles-2", + "speedboat", + "spider", + "square", + "square-arrow-down", + "square-arrow-left", + "square-arrow-right", + "square-arrow-up", + "square-asterisk", + "square-check", + "square-chevron-down", + "square-chevron-left", + "square-chevron-right", + "square-chevron-up", + "square-chevrons-down", + "square-chevrons-left", + "square-chevrons-right", + "square-chevrons-up", + "square-dot", + "square-f0", + "square-f1", + "square-f2", + "square-f3", + "square-f4", + "square-f5", + "square-f6", + "square-f7", + "square-f8", + "square-f9", + "square-letter-a", + "square-letter-b", + "square-letter-c", + "square-letter-d", + "square-letter-e", + "square-letter-f", + "square-letter-g", + "square-letter-h", + "square-letter-i", + "square-letter-j", + "square-letter-k", + "square-letter-l", + "square-letter-m", + "square-letter-n", + "square-letter-o", + "square-letter-p", + "square-letter-q", + "square-letter-r", + "square-letter-s", + "square-letter-t", + "square-letter-u", + "square-letter-v", + "square-letter-w", + "square-letter-x", + "square-letter-y", + "square-letter-z", + "square-minus", + "square-number-0", + "square-number-1", + "square-number-2", + "square-number-3", + "square-number-4", + "square-number-5", + "square-number-6", + "square-number-7", + "square-number-8", + "square-number-9", + "square-rotated", + "square-rounded", + "square-rounded-arrow-down", + "square-rounded-arrow-left", + "square-rounded-arrow-right", + "square-rounded-arrow-up", + "square-rounded-check", + "square-rounded-chevron-down", + "square-rounded-chevron-left", + "square-rounded-chevron-right", + "square-rounded-chevron-up", + "square-rounded-chevrons-down", + "square-rounded-chevrons-left", + "square-rounded-chevrons-right", + "square-rounded-chevrons-up", + "square-rounded-letter-a", + "square-rounded-letter-b", + "square-rounded-letter-c", + "square-rounded-letter-d", + "square-rounded-letter-e", + "square-rounded-letter-f", + "square-rounded-letter-g", + "square-rounded-letter-h", + "square-rounded-letter-i", + "square-rounded-letter-j", + "square-rounded-letter-k", + "square-rounded-letter-l", + "square-rounded-letter-m", + "square-rounded-letter-n", + "square-rounded-letter-o", + "square-rounded-letter-p", + "square-rounded-letter-q", + "square-rounded-letter-r", + "square-rounded-letter-s", + "square-rounded-letter-t", + "square-rounded-letter-u", + "square-rounded-letter-v", + "square-rounded-letter-w", + "square-rounded-letter-x", + "square-rounded-letter-y", + "square-rounded-letter-z", + "square-rounded-minus", + "square-rounded-number-0", + "square-rounded-number-1", + "square-rounded-number-2", + "square-rounded-number-3", + "square-rounded-number-4", + "square-rounded-number-5", + "square-rounded-number-6", + "square-rounded-number-7", + "square-rounded-number-8", + "square-rounded-number-9", + "square-rounded-plus", + "square-rounded-x", + "square-x", + "squares", + "stack", + "stack-2", + "stack-3", + "star", + "star-half", + "stars", + "steering-wheel", + "sun", + "sun-high", + "sun-low", + "sunglasses", + "sunrise", + "sunset", + "sunset-2", + "swipe-down", + "swipe-left", + "swipe-right", + "swipe-up", + "table", + "tag", + "tags", + "temperature-minus", + "temperature-plus", + "template", + "test-pipe-2", + "thumb-down", + "thumb-up", + "ticket", + "tilt-shift", + "timeline-event", + "toggle-left", + "toggle-right", + "tools-kitchen-2", + "train", + "transform", + "transition-bottom", + "transition-left", + "transition-right", + "transition-top", + "trash", + "trash-x", + "triangle", + "triangle-inverted", + "triangle-square-circle", + "trolley", + "trophy", + "truck", + "ufo", + "umbrella", + "user", + "versions", + "video", + "video-minus", + "video-plus", + "windmill", + "windsock", + "woman", + "world", + "writing", + "writing-sign", + "x", + "xbox-a", + "xbox-b", + "xbox-x", + "xbox-y", + "yin-yang", + "zeppelin", + "zoom", + "zoom-cancel", + "zoom-check", + "zoom-code", + "zoom-exclamation", + "zoom-in", + "zoom-in-area", + "zoom-money", + "zoom-out", + "zoom-out-area", + "zoom-pan", + "zoom-question", + "zoom-scan", +]);