@pihanga2/shadcn 0.2.21 → 0.2.22

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 (58) hide show
  1. package/README.md +4 -1
  2. package/cards/attachment/attachment.component.d.ts +4 -0
  3. package/cards/attachment/attachment.component.js +46 -0
  4. package/cards/attachment/attachment.component.js.map +1 -0
  5. package/cards/attachment/attachment.types.d.ts +95 -0
  6. package/cards/attachment/attachment.types.js +7 -0
  7. package/cards/attachment/attachment.types.js.map +1 -0
  8. package/cards/attachment/attachmentGroup.component.d.ts +4 -0
  9. package/cards/attachment/attachmentGroup.component.js +21 -0
  10. package/cards/attachment/attachmentGroup.component.js.map +1 -0
  11. package/cards/attachment/index.d.ts +1 -0
  12. package/cards/attachment/index.js +16 -0
  13. package/cards/attachment/index.js.map +1 -0
  14. package/cards/bubble/bubble.component.d.ts +4 -0
  15. package/cards/bubble/bubble.component.js +67 -0
  16. package/cards/bubble/bubble.component.js.map +1 -0
  17. package/cards/bubble/bubble.types.d.ts +106 -0
  18. package/cards/bubble/bubble.types.js +7 -0
  19. package/cards/bubble/bubble.types.js.map +1 -0
  20. package/cards/bubble/bubbleGroup.component.d.ts +4 -0
  21. package/cards/bubble/bubbleGroup.component.js +21 -0
  22. package/cards/bubble/bubbleGroup.component.js.map +1 -0
  23. package/cards/bubble/index.d.ts +1 -0
  24. package/cards/bubble/index.js +16 -0
  25. package/cards/bubble/index.js.map +1 -0
  26. package/cards/dataTable/dataTable.component.js +191 -124
  27. package/cards/dataTable/dataTable.component.js.map +1 -1
  28. package/cards/dataTable/dataTable.types.d.ts +50 -0
  29. package/cards/dataTable/dataTable.types.js +6 -3
  30. package/cards/dataTable/dataTable.types.js.map +1 -1
  31. package/cards/dataTable/index.js +6 -6
  32. package/cards/dropDownMenu/dropdown-menu.ui.js +41 -41
  33. package/cards/input/input.component.js +4 -4
  34. package/cards/message/index.d.ts +1 -0
  35. package/cards/message/index.js +15 -0
  36. package/cards/message/index.js.map +1 -0
  37. package/cards/message/message.component.d.ts +4 -0
  38. package/cards/message/message.component.js +47 -0
  39. package/cards/message/message.component.js.map +1 -0
  40. package/cards/message/message.types.d.ts +56 -0
  41. package/cards/message/message.types.js +7 -0
  42. package/cards/message/message.types.js.map +1 -0
  43. package/cards/message/messageGroup.component.d.ts +4 -0
  44. package/cards/message/messageGroup.component.js +21 -0
  45. package/cards/message/messageGroup.component.js.map +1 -0
  46. package/components/ui/attachment.js +102 -0
  47. package/components/ui/attachment.js.map +1 -0
  48. package/components/ui/badge.js +7 -7
  49. package/components/ui/bubble.js +73 -0
  50. package/components/ui/bubble.js.map +1 -0
  51. package/components/ui/button.js +11 -11
  52. package/components/ui/empty.js +12 -12
  53. package/components/ui/field.js +16 -16
  54. package/components/ui/message.js +51 -0
  55. package/components/ui/message.js.map +1 -0
  56. package/components/ui/toggle-group.js +1 -1
  57. package/components/ui/toggle.js +1 -1
  58. package/package.json +16 -1
@@ -1 +1 @@
1
- {"version":3,"file":"dataTable.types.js","names":[],"sources":["../../../src/cards/dataTable/dataTable.types.ts"],"sourcesContent":["import React from \"react\";\nimport {\n type PiCardRef,\n createCardDeclaration,\n createOnAction,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const DATA_TABLE_CARD = \"shad/data-table\";\n\nexport const DataTable = createCardDeclaration<DataTableProps, DataTableEvents>(\n DATA_TABLE_CARD,\n);\n\nexport const DATA_TABLE_ACTION = registerActions(DATA_TABLE_CARD, [\n \"row_clicked\",\n \"sort_changed\",\n \"show_detail\",\n \"hide_detail\",\n \"page_changed\",\n]);\n\nexport const onDataTableRowClicked = createOnAction<DataTableRowClickedEvent>(\n DATA_TABLE_ACTION.ROW_CLICKED,\n);\nexport const onDataTableSortChanged = createOnAction<DataTableSortChangedEvent>(\n DATA_TABLE_ACTION.SORT_CHANGED,\n);\nexport const onDataTableShowDetail = createOnAction<DataTableDetailEvent>(\n DATA_TABLE_ACTION.SHOW_DETAIL,\n);\nexport const onDataTableHideDetail = createOnAction<DataTableDetailEvent>(\n DATA_TABLE_ACTION.HIDE_DETAIL,\n);\nexport const onDataTablePageChanged = createOnAction<DataTablePageChangedEvent>(\n DATA_TABLE_ACTION.PAGE_CHANGED,\n);\n\n// ---------------------------------------------------------------------------\n// Column type definitions\n// ---------------------------------------------------------------------------\n\n/** Shared base for all column definitions */\nexport type DataTableColumnBase = {\n /** Key into the row's `data` object used to retrieve the cell value */\n key: string;\n /**\n * Column header label.\n * Defaults to the `key` with camelCase expanded to \"Title Case\".\n */\n title?: string;\n /** Column width as a CSS value (e.g. \"120px\", \"10%\", \"1fr\") */\n width?: string | number;\n /** Horizontal alignment of cell content. Defaults to \"left\". */\n align?: \"left\" | \"center\" | \"right\";\n /** Whether the column header is clickable for sorting */\n sortable?: boolean;\n /** Extra CSS class applied to the `<th>` header cell */\n headerClassName?: string;\n /**\n * Extra CSS class applied to every `<td>` data cell in this column.\n * May be a static string **or** a function called per-cell:\n * `(value, row) => \"bg-red-500 text-white\"`.\n */\n cellClassName?:\n | string\n | ((value: unknown, row: DataTableRow) => string | undefined);\n /**\n * Inline style applied to every `<td>` data cell in this column.\n * May be a static `React.CSSProperties` object **or** a function called\n * per-cell: `(value, row) => ({ backgroundColor: \"blue\", color: \"white\" })`.\n *\n * @example\n * ```ts\n * cellStyle: (value) => {\n * const map: Record<string, React.CSSProperties> = {\n * Superior: { backgroundColor: \"#4472C4\", color: \"#fff\" },\n * Satisfactory: { backgroundColor: \"#70AD47\", color: \"#fff\" },\n * \"Needs Improvement\": { backgroundColor: \"#FFC000\", color: \"#fff\" },\n * Unsatisfactory: { backgroundColor: \"#FF0000\", color: \"#fff\" },\n * };\n * return map[String(value)];\n * }\n * ```\n */\n cellStyle?:\n | React.CSSProperties\n | ((value: unknown, row: DataTableRow) => React.CSSProperties | undefined);\n};\n\n/** Plain text column — cell value rendered as a string */\nexport type TextColumn = DataTableColumnBase & {\n type?: \"text\";\n};\n\n/** Numeric column with optional custom formatter */\nexport type NumberColumn = DataTableColumnBase & {\n type: \"number\";\n /** Custom number formatter; defaults to `String(value)` */\n format?: (n: number) => string;\n};\n\n/** Badge/chip column — cell value is rendered inside a `<Badge>` */\nexport type BadgeColumn = DataTableColumnBase & {\n type: \"badge\";\n /**\n * Map from cell value (as a string) to a shadcn Badge variant.\n * Falls back to \"secondary\" for unrecognised values.\n */\n variants?: Record<\n string,\n \"default\" | \"secondary\" | \"destructive\" | \"outline\"\n >;\n};\n\n/** Date column with optional custom formatter */\nexport type DateColumn = DataTableColumnBase & {\n type: \"date\";\n /** Custom date formatter; defaults to `toLocaleDateString()` */\n format?: (d: Date | string) => string;\n};\n\n/** Boolean column — renders a check-mark or cross icon */\nexport type BooleanColumn = DataTableColumnBase & {\n type: \"boolean\";\n};\n\n/**\n * Card column — cell value must be a `PiCardRef` (string).\n * The referenced card is rendered inline via Pihanga's `<Card />`.\n * This enables full reuse of any registered Pihanga card as cell content.\n */\nexport type CardColumn = DataTableColumnBase & {\n type: \"card\";\n};\n\nexport type DataTableColumn =\n | TextColumn\n | NumberColumn\n | BadgeColumn\n | DateColumn\n | BooleanColumn\n | CardColumn;\n\n// ---------------------------------------------------------------------------\n// Row\n// ---------------------------------------------------------------------------\n\nexport type DataTableRow<T = Record<string, unknown>> = {\n /** Unique row identifier used as the React key and in events */\n id: string | number;\n /**\n * Row payload — values are keyed by the column's `key` field.\n * For \"card\" columns the value should be a `PiCardRef` string.\n */\n data: T;\n /**\n * When set, the row shows an expand/collapse toggle button.\n * The referenced card is rendered full-width below the row on expand.\n * Use `onShowDetail` / `onHideDetail` events to track expanded state in\n * your redux store and update `detailCard` per row as needed.\n */\n detailCard?: PiCardRef;\n};\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport type DataTableProps<T = Record<string, unknown>> = {\n /** Column definitions — order determines display order */\n columns: DataTableColumn[];\n /** Row data */\n rows: DataTableRow<T>[];\n /** Optional visible `<caption>` rendered below the table */\n caption?: string;\n\n // --- Sorting ---\n /**\n * Key of the currently sorted column.\n * When provided the sort state is controlled; otherwise managed internally.\n */\n sortKey?: string;\n /**\n * Sort direction.\n * When provided together with `sortKey` the sort state is controlled.\n */\n sortAscending?: boolean;\n\n // --- Pagination ---\n /** Maximum number of rows per page. Omit to disable pagination. */\n pageSize?: number;\n /** Current page index (0-based). Treated as controlled when provided. */\n currentPage?: number;\n /**\n * Total row count, used for server-side pagination display.\n * Leave unset for client-side pagination derived from `rows.length`.\n */\n totalRows?: number;\n\n // --- Display ---\n /** Keep the header visible while the body scrolls */\n stickyHeader?: boolean;\n /** Alternate row background colour (zebra striping) */\n striped?: boolean;\n /** Highlight rows on hover (default: true) */\n hoverable?: boolean;\n /** Use compact row padding */\n compact?: boolean;\n\n // --- Empty state ---\n /** Card rendered when `rows` is empty */\n emptyCard?: PiCardRef;\n /** Fallback text when `rows` is empty and `emptyCard` is not set */\n emptyText?: string;\n\n className?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Events\n// ---------------------------------------------------------------------------\n\nexport type DataTableRowClickedEvent = {\n rowId: string | number;\n row: DataTableRow;\n};\n\nexport type DataTableSortChangedEvent = {\n /** The column key that was clicked */\n key: string;\n /** `true` = ascending, `false` = descending */\n ascending: boolean;\n};\n\nexport type DataTableDetailEvent = {\n rowId: string | number;\n row: DataTableRow;\n};\n\nexport type DataTablePageChangedEvent = {\n /** New page index (0-based) */\n page: number;\n pageSize: number;\n};\n\nexport type DataTableEvents = {\n onRowClicked: DataTableRowClickedEvent;\n onSortChanged: DataTableSortChangedEvent;\n onShowDetail: DataTableDetailEvent;\n onHideDetail: DataTableDetailEvent;\n onPageChanged: DataTablePageChangedEvent;\n};\n\n// ---------------------------------------------------------------------------\n// DataTableRowDetail — generic single-template detail panel\n// ---------------------------------------------------------------------------\n\n/** Configuration for a single field shown in the detail panel. */\nexport type DataTableRowDetailField = {\n /** Key to look up in `row.data` */\n key: string;\n /** Optional human-readable label prefix (e.g. \"Director\") */\n label?: string;\n /** Render style: \"title\" → h4 bold, \"muted\" → muted foreground, \"text\" (default) → plain */\n type?: \"title\" | \"text\" | \"muted\";\n /** Additional Tailwind class names forwarded to the element */\n className?: string;\n};\n\nexport type DataTableRowDetailProps = {\n /**\n * The row to display. Set this via a state mapper so a single template\n * card works for all rows:\n * ```ts\n * DataTableRowDetail({\n * row: (_, ctx) => ctx.ctxtProps?.row,\n * fields: [{ key: \"title\", type: \"title\" }, ...],\n * })\n * ```\n */\n row?: DataTableRow<Record<string, unknown>>;\n /**\n * Fields to render in order.\n * When omitted, every key in `row.data` is rendered as a plain key:value pair.\n */\n fields?: DataTableRowDetailField[];\n};\n\nexport const DATA_TABLE_ROW_DETAIL_CARD = \"shad/data-table-row-detail\";\nexport const DataTableRowDetail =\n createCardDeclaration<DataTableRowDetailProps>(DATA_TABLE_ROW_DETAIL_CARD);\n"],"mappings":";;;AAQA,IAAa,IAAkB,mBAElB,IAAY,EACvB,CACF,GAEa,IAAoB,EAAgB,GAAiB;CAChE;CACA;CACA;CACA;CACA;AACF,CAAC,GAEY,IAAwB,EACnC,EAAkB,WACpB,GACa,IAAyB,EACpC,EAAkB,YACpB,GACa,IAAwB,EACnC,EAAkB,WACpB,GACa,IAAwB,EACnC,EAAkB,WACpB,GACa,IAAyB,EACpC,EAAkB,YACpB,GA6Pa,IAA6B,8BAC7B,IACX,EAA+C,CAA0B"}
1
+ {"version":3,"file":"dataTable.types.js","names":[],"sources":["../../../src/cards/dataTable/dataTable.types.ts"],"sourcesContent":["import React from \"react\";\nimport {\n type PiCardRef,\n createCardDeclaration,\n createOnAction,\n registerActions,\n} from \"@pihanga2/core\";\n\nexport const DATA_TABLE_CARD = \"shad/data-table\";\n\nexport const DataTable = createCardDeclaration<DataTableProps, DataTableEvents>(\n DATA_TABLE_CARD,\n);\n\nexport const DATA_TABLE_ACTION = registerActions(DATA_TABLE_CARD, [\n \"row_clicked\",\n \"sort_changed\",\n \"show_detail\",\n \"hide_detail\",\n \"page_changed\",\n \"rows_selected\",\n \"all_rows_selected\",\n \"search_changed\",\n]);\n\nexport const onDataTableRowClicked = createOnAction<DataTableRowClickedEvent>(\n DATA_TABLE_ACTION.ROW_CLICKED,\n);\nexport const onDataTableSortChanged = createOnAction<DataTableSortChangedEvent>(\n DATA_TABLE_ACTION.SORT_CHANGED,\n);\nexport const onDataTableShowDetail = createOnAction<DataTableDetailEvent>(\n DATA_TABLE_ACTION.SHOW_DETAIL,\n);\nexport const onDataTableHideDetail = createOnAction<DataTableDetailEvent>(\n DATA_TABLE_ACTION.HIDE_DETAIL,\n);\nexport const onDataTablePageChanged = createOnAction<DataTablePageChangedEvent>(\n DATA_TABLE_ACTION.PAGE_CHANGED,\n);\nexport const onDataTableRowsSelected =\n createOnAction<DataTableRowsSelectedEvent>(\n DATA_TABLE_ACTION.ROWS_SELECTED,\n );\nexport const onDataTableAllRowsSelected =\n createOnAction<DataTableAllRowsSelectedEvent>(\n DATA_TABLE_ACTION.ALL_ROWS_SELECTED,\n );\nexport const onDataTableSearchChanged =\n createOnAction<DataTableSearchChangedEvent>(\n DATA_TABLE_ACTION.SEARCH_CHANGED,\n );\n\n// ---------------------------------------------------------------------------\n// Column type definitions\n// ---------------------------------------------------------------------------\n\n/** Shared base for all column definitions */\nexport type DataTableColumnBase = {\n /** Key into the row's `data` object used to retrieve the cell value */\n key: string;\n /**\n * Column header label.\n * Defaults to the `key` with camelCase expanded to \"Title Case\".\n */\n title?: string;\n /** Column width as a CSS value (e.g. \"120px\", \"10%\", \"1fr\") */\n width?: string | number;\n /** Horizontal alignment of cell content. Defaults to \"left\". */\n align?: \"left\" | \"center\" | \"right\";\n /** Whether the column header is clickable for sorting */\n sortable?: boolean;\n /** Extra CSS class applied to the `<th>` header cell */\n headerClassName?: string;\n /**\n * Extra CSS class applied to every `<td>` data cell in this column.\n * May be a static string **or** a function called per-cell:\n * `(value, row) => \"bg-red-500 text-white\"`.\n */\n cellClassName?:\n | string\n | ((value: unknown, row: DataTableRow) => string | undefined);\n /**\n * Inline style applied to every `<td>` data cell in this column.\n * May be a static `React.CSSProperties` object **or** a function called\n * per-cell: `(value, row) => ({ backgroundColor: \"blue\", color: \"white\" })`.\n *\n * @example\n * ```ts\n * cellStyle: (value) => {\n * const map: Record<string, React.CSSProperties> = {\n * Superior: { backgroundColor: \"#4472C4\", color: \"#fff\" },\n * Satisfactory: { backgroundColor: \"#70AD47\", color: \"#fff\" },\n * \"Needs Improvement\": { backgroundColor: \"#FFC000\", color: \"#fff\" },\n * Unsatisfactory: { backgroundColor: \"#FF0000\", color: \"#fff\" },\n * };\n * return map[String(value)];\n * }\n * ```\n */\n cellStyle?:\n | React.CSSProperties\n | ((value: unknown, row: DataTableRow) => React.CSSProperties | undefined);\n};\n\n/** Plain text column — cell value rendered as a string */\nexport type TextColumn = DataTableColumnBase & {\n type?: \"text\";\n};\n\n/** Numeric column with optional custom formatter */\nexport type NumberColumn = DataTableColumnBase & {\n type: \"number\";\n /** Custom number formatter; defaults to `String(value)` */\n format?: (n: number) => string;\n};\n\n/** Badge/chip column — cell value is rendered inside a `<Badge>` */\nexport type BadgeColumn = DataTableColumnBase & {\n type: \"badge\";\n /**\n * Map from cell value (as a string) to a shadcn Badge variant.\n * Falls back to \"secondary\" for unrecognised values.\n */\n variants?: Record<\n string,\n \"default\" | \"secondary\" | \"destructive\" | \"outline\"\n >;\n};\n\n/** Date column with optional custom formatter */\nexport type DateColumn = DataTableColumnBase & {\n type: \"date\";\n /** Custom date formatter; defaults to `toLocaleDateString()` */\n format?: (d: Date | string) => string;\n};\n\n/** Boolean column — renders a check-mark or cross icon */\nexport type BooleanColumn = DataTableColumnBase & {\n type: \"boolean\";\n};\n\n/**\n * Card column — cell value must be a `PiCardRef` (string).\n * The referenced card is rendered inline via Pihanga's `<Card />`.\n * This enables full reuse of any registered Pihanga card as cell content.\n */\nexport type CardColumn = DataTableColumnBase & {\n type: \"card\";\n};\n\nexport type DataTableColumn =\n | TextColumn\n | NumberColumn\n | BadgeColumn\n | DateColumn\n | BooleanColumn\n | CardColumn;\n\n// ---------------------------------------------------------------------------\n// Row\n// ---------------------------------------------------------------------------\n\nexport type DataTableRow<T = Record<string, unknown>> = {\n /** Unique row identifier used as the React key and in events */\n id: string | number;\n /**\n * Row payload — values are keyed by the column's `key` field.\n * For \"card\" columns the value should be a `PiCardRef` string.\n */\n data: T;\n /**\n * When set, the row shows an expand/collapse toggle button.\n * The referenced card is rendered full-width below the row on expand.\n * Use `onShowDetail` / `onHideDetail` events to track expanded state in\n * your redux store and update `detailCard` per row as needed.\n */\n detailCard?: PiCardRef;\n};\n\n// ---------------------------------------------------------------------------\n// Props\n// ---------------------------------------------------------------------------\n\nexport type DataTableProps<T = Record<string, unknown>> = {\n /** Column definitions — order determines display order */\n columns: DataTableColumn[];\n /** Row data */\n rows: DataTableRow<T>[];\n /** Optional visible `<caption>` rendered below the table */\n caption?: string;\n\n // --- Sorting ---\n /**\n * Key of the currently sorted column.\n * When provided the sort state is controlled; otherwise managed internally.\n */\n sortKey?: string;\n /**\n * Sort direction.\n * When provided together with `sortKey` the sort state is controlled.\n */\n sortAscending?: boolean;\n\n // --- Pagination ---\n /** Maximum number of rows per page. Omit to disable pagination. */\n pageSize?: number;\n /** Current page index (0-based). Treated as controlled when provided. */\n currentPage?: number;\n /**\n * Total row count, used for server-side pagination display.\n * Leave unset for client-side pagination derived from `rows.length`.\n */\n totalRows?: number;\n\n // --- Display ---\n /** Keep the header visible while the body scrolls */\n stickyHeader?: boolean;\n /** Alternate row background colour (zebra striping) */\n striped?: boolean;\n /** Highlight rows on hover (default: true) */\n hoverable?: boolean;\n /** Use compact row padding */\n compact?: boolean;\n\n // --- Empty state ---\n /** Card rendered when `rows` is empty */\n emptyCard?: PiCardRef;\n /** Fallback text when `rows` is empty and `emptyCard` is not set */\n emptyText?: string;\n\n // --- Row selection ---\n /**\n * When true, a checkbox column is rendered so rows can be selected.\n * Selection state is uncontrolled unless `selectedRowIds` is provided.\n */\n selectable?: boolean;\n /**\n * Ids of the currently selected rows.\n * When provided, selection becomes controlled — pair with `onRowsSelected`\n * to update it from your redux store.\n */\n selectedRowIds?: (string | number)[];\n\n // --- Search ---\n /** Show a search input above the table that filters rows client-side. */\n showSearch?: boolean;\n /** Placeholder text for the search input. */\n searchPlaceholder?: string;\n /**\n * Current search text.\n * When provided the search box becomes controlled — pair with\n * `onSearchChanged` to filter `rows` yourself (e.g. server-side).\n */\n searchText?: string;\n\n className?: string;\n};\n\n// ---------------------------------------------------------------------------\n// Events\n// ---------------------------------------------------------------------------\n\nexport type DataTableRowClickedEvent = {\n rowId: string | number;\n row: DataTableRow;\n};\n\nexport type DataTableSortChangedEvent = {\n /** The column key that was clicked */\n key: string;\n /** `true` = ascending, `false` = descending */\n ascending: boolean;\n};\n\nexport type DataTableDetailEvent = {\n rowId: string | number;\n row: DataTableRow;\n};\n\nexport type DataTablePageChangedEvent = {\n /** New page index (0-based) */\n page: number;\n pageSize: number;\n};\n\nexport type DataTableRowsSelectedEvent<T = Record<string, unknown>> = {\n /** All currently-selected rows (on the current page unless server-driven) */\n selected: DataTableRow<T>[];\n};\n\nexport type DataTableAllRowsSelectedEvent<T = Record<string, unknown>> = {\n /** Whether the header checkbox selected (true) or cleared (false) all rows */\n selected: boolean;\n /** Rows affected by the select-all toggle (visible/paginated rows) */\n rows: DataTableRow<T>[];\n};\n\nexport type DataTableSearchChangedEvent = {\n /** New search text */\n text: string;\n};\n\nexport type DataTableEvents = {\n onRowClicked: DataTableRowClickedEvent;\n onSortChanged: DataTableSortChangedEvent;\n onShowDetail: DataTableDetailEvent;\n onHideDetail: DataTableDetailEvent;\n onPageChanged: DataTablePageChangedEvent;\n onRowsSelected: DataTableRowsSelectedEvent;\n onAllRowsSelected: DataTableAllRowsSelectedEvent;\n onSearchChanged: DataTableSearchChangedEvent;\n};\n\n// ---------------------------------------------------------------------------\n// DataTableRowDetail — generic single-template detail panel\n// ---------------------------------------------------------------------------\n\n/** Configuration for a single field shown in the detail panel. */\nexport type DataTableRowDetailField = {\n /** Key to look up in `row.data` */\n key: string;\n /** Optional human-readable label prefix (e.g. \"Director\") */\n label?: string;\n /** Render style: \"title\" → h4 bold, \"muted\" → muted foreground, \"text\" (default) → plain */\n type?: \"title\" | \"text\" | \"muted\";\n /** Additional Tailwind class names forwarded to the element */\n className?: string;\n};\n\nexport type DataTableRowDetailProps = {\n /**\n * The row to display. Set this via a state mapper so a single template\n * card works for all rows:\n * ```ts\n * DataTableRowDetail({\n * row: (_, ctx) => ctx.ctxtProps?.row,\n * fields: [{ key: \"title\", type: \"title\" }, ...],\n * })\n * ```\n */\n row?: DataTableRow<Record<string, unknown>>;\n /**\n * Fields to render in order.\n * When omitted, every key in `row.data` is rendered as a plain key:value pair.\n */\n fields?: DataTableRowDetailField[];\n};\n\nexport const DATA_TABLE_ROW_DETAIL_CARD = \"shad/data-table-row-detail\";\nexport const DataTableRowDetail =\n createCardDeclaration<DataTableRowDetailProps>(DATA_TABLE_ROW_DETAIL_CARD);\n"],"mappings":";;;AAQA,IAAa,IAAkB,mBAElB,IAAY,EACvB,CACF,GAEa,IAAoB,EAAgB,GAAiB;CAChE;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC,GAEY,IAAwB,EACnC,EAAkB,WACpB,GACa,IAAyB,EACpC,EAAkB,YACpB,GACa,IAAwB,EACnC,EAAkB,WACpB,GACa,IAAwB,EACnC,EAAkB,WACpB,GACa,IAAyB,EACpC,EAAkB,YACpB,GACa,IACX,EACE,EAAkB,aACpB,GACW,IACX,EACE,EAAkB,iBACpB,GACW,IACX,EACE,EAAkB,cACpB,GA0SW,IAA6B,8BAC7B,IACX,EAA+C,CAA0B"}
@@ -1,16 +1,16 @@
1
1
  import { DataTableComponent as e } from "./dataTable.component.js";
2
2
  import { DataTableRowDetailComponent as t } from "./dataTableRowDetail.component.js";
3
- import { DATA_TABLE_ACTION as n, DATA_TABLE_CARD as r, DATA_TABLE_ROW_DETAIL_CARD as i, DataTable as a, DataTableRowDetail as o, onDataTableHideDetail as s, onDataTablePageChanged as c, onDataTableRowClicked as l, onDataTableShowDetail as u, onDataTableSortChanged as d } from "./dataTable.types.js";
4
- import { actionTypesToEvents as f, registerCardComponent as p } from "@pihanga2/core";
5
- p({
3
+ import { DATA_TABLE_ACTION as n, DATA_TABLE_CARD as r, DATA_TABLE_ROW_DETAIL_CARD as i, DataTable as a, DataTableRowDetail as o, onDataTableAllRowsSelected as s, onDataTableHideDetail as c, onDataTablePageChanged as l, onDataTableRowClicked as u, onDataTableRowsSelected as d, onDataTableSearchChanged as f, onDataTableShowDetail as p, onDataTableSortChanged as m } from "./dataTable.types.js";
4
+ import { actionTypesToEvents as h, registerCardComponent as g } from "@pihanga2/core";
5
+ g({
6
6
  name: r,
7
7
  component: e,
8
- events: f(n)
9
- }), p({
8
+ events: h(n)
9
+ }), g({
10
10
  name: i,
11
11
  component: t
12
12
  });
13
13
  //#endregion
14
- export { n as DATA_TABLE_ACTION, r as DATA_TABLE_CARD, i as DATA_TABLE_ROW_DETAIL_CARD, a as DataTable, o as DataTableRowDetail, s as onDataTableHideDetail, c as onDataTablePageChanged, l as onDataTableRowClicked, u as onDataTableShowDetail, d as onDataTableSortChanged };
14
+ export { n as DATA_TABLE_ACTION, r as DATA_TABLE_CARD, i as DATA_TABLE_ROW_DETAIL_CARD, a as DataTable, o as DataTableRowDetail, s as onDataTableAllRowsSelected, c as onDataTableHideDetail, l as onDataTablePageChanged, u as onDataTableRowClicked, d as onDataTableRowsSelected, f as onDataTableSearchChanged, p as onDataTableShowDetail, m as onDataTableSortChanged };
15
15
 
16
16
  //# sourceMappingURL=index.js.map
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { cn as e } from "../../lib/utils.js";
3
3
  import "react";
4
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
5
- import { cva as r } from "class-variance-authority";
4
+ import { cva as t } from "class-variance-authority";
5
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
6
6
  import { CheckIcon as i, ChevronRightIcon as a } from "lucide-react";
7
7
  import * as o from "@radix-ui/react-dropdown-menu";
8
8
  //#region src/cards/dropDownMenu/dropdown-menu.ui.tsx
9
- var s = r(e("relative flex cursor-pointer items-center gap-2 rounded-md align-middle text-sm no-focus-ring transition-bg-ease select-none data-disabled:pointer-events-none data-disabled:opacity-50", "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-subtle-foreground", "text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground"), {
9
+ var s = t(e("relative flex cursor-pointer items-center gap-2 rounded-md align-middle text-sm no-focus-ring transition-bg-ease select-none data-disabled:pointer-events-none data-disabled:opacity-50", "[&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg]:text-subtle-foreground", "text-accent-foreground hover:bg-accent focus:bg-accent focus:text-accent-foreground"), {
10
10
  defaultVariants: {
11
11
  size: "default",
12
12
  variant: "default"
@@ -21,87 +21,87 @@ var s = r(e("relative flex cursor-pointer items-center gap-2 rounded-md align-mi
21
21
  none: ""
22
22
  }
23
23
  }
24
- }), c = r(e("mt-1.5 mb-2 cursor-default px-[14px] text-xs font-medium text-muted-foreground select-none"), { variants: { inset: { true: "pl-8" } } });
24
+ }), c = t(e("mt-1.5 mb-2 cursor-default px-[14px] text-xs font-medium text-muted-foreground select-none"), { variants: { inset: { true: "pl-8" } } });
25
25
  function l(e) {
26
- return /* @__PURE__ */ t(o.Root, { ...e });
26
+ return /* @__PURE__ */ n(o.Root, { ...e });
27
27
  }
28
28
  function u(e) {
29
- return /* @__PURE__ */ t(o.Trigger, { ...e });
29
+ return /* @__PURE__ */ n(o.Trigger, { ...e });
30
30
  }
31
31
  function d(e) {
32
- return /* @__PURE__ */ t(o.Group, {
32
+ return /* @__PURE__ */ n(o.Group, {
33
33
  className: "py-1.5",
34
34
  ...e
35
35
  });
36
36
  }
37
37
  function f(e) {
38
- return /* @__PURE__ */ t(o.Sub, { ...e });
38
+ return /* @__PURE__ */ n(o.Sub, { ...e });
39
39
  }
40
40
  function p(e) {
41
- return /* @__PURE__ */ t(o.RadioGroup, { ...e });
41
+ return /* @__PURE__ */ n(o.RadioGroup, { ...e });
42
42
  }
43
- function m({ children: r, className: i, inset: s, ...c }) {
44
- return /* @__PURE__ */ n(o.SubTrigger, {
43
+ function m({ children: t, className: i, inset: s, ...c }) {
44
+ return /* @__PURE__ */ r(o.SubTrigger, {
45
45
  className: e("mx-1 flex cursor-default items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent data-[state=open]:bg-accent", "no-focus-ring", "data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", s && "pl-8", i),
46
46
  ...c,
47
- children: [r, /* @__PURE__ */ t(a, { className: "ml-auto" })]
47
+ children: [t, /* @__PURE__ */ n(a, { className: "ml-auto" })]
48
48
  });
49
49
  }
50
- function h({ className: n, ...r }) {
51
- return /* @__PURE__ */ t(o.SubContent, {
52
- className: e("z-50 max-w-[100vw] min-w-32 w-max overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-floating data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", n),
50
+ function h({ className: t, ...r }) {
51
+ return /* @__PURE__ */ n(o.SubContent, {
52
+ className: e("z-50 max-w-[100vw] min-w-32 w-max overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-floating data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", t),
53
53
  ...r
54
54
  });
55
55
  }
56
- function g({ className: n, portal: r, ...i }) {
57
- let a = /* @__PURE__ */ t(o.Content, {
58
- className: e("z-50 max-w-[100vw] min-w-32 w-max overflow-hidden rounded-lg bg-popover p-0 text-sm text-popover-foreground shadow-floating no-focus-ring", "data-[side=bottom]:origin-top data-[side=left]:origin-right data-[side=right]:origin-left data-[side=top]:origin-bottom data-[state=closed]:hidden data-[state=open]:animate-zoom", n),
56
+ function g({ className: t, portal: r, ...i }) {
57
+ let a = /* @__PURE__ */ n(o.Content, {
58
+ className: e("z-50 max-w-[100vw] min-w-32 w-max overflow-hidden rounded-lg bg-popover p-0 text-sm text-popover-foreground shadow-floating no-focus-ring", "data-[side=bottom]:origin-top data-[side=left]:origin-right data-[side=right]:origin-left data-[side=top]:origin-bottom data-[state=closed]:hidden data-[state=open]:animate-zoom", t),
59
59
  sideOffset: 4,
60
60
  ...i
61
61
  });
62
- return r ? /* @__PURE__ */ t(o.Portal, { children: a }) : a;
62
+ return r ? /* @__PURE__ */ n(o.Portal, { children: a }) : a;
63
63
  }
64
- function _({ className: n, ...r }) {
65
- return /* @__PURE__ */ t(o.Item, {
66
- className: e(s(), n),
64
+ function _({ className: t, ...r }) {
65
+ return /* @__PURE__ */ n(o.Item, {
66
+ className: e(s(), t),
67
67
  ...r
68
68
  });
69
69
  }
70
- function v({ children: r, className: a, ...s }) {
71
- return /* @__PURE__ */ n(o.CheckboxItem, {
70
+ function v({ children: t, className: a, ...s }) {
71
+ return /* @__PURE__ */ r(o.CheckboxItem, {
72
72
  className: e("relative flex items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 no-focus-ring transition-bg-ease select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:size-4", "mx-1 h-[28px] cursor-pointer data-[state=highlighted]:bg-accent data-[state=highlighted]:text-accent-foreground", a),
73
73
  ...s,
74
- children: [/* @__PURE__ */ t("span", {
74
+ children: [/* @__PURE__ */ n("span", {
75
75
  className: "absolute right-2 flex size-3.5 items-center justify-center",
76
- children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(i, {}) })
77
- }), r]
76
+ children: /* @__PURE__ */ n(o.ItemIndicator, { children: /* @__PURE__ */ n(i, {}) })
77
+ }), t]
78
78
  });
79
79
  }
80
- function y({ children: r, className: a, hideIcon: s, ...c }) {
81
- return /* @__PURE__ */ n(o.RadioItem, {
80
+ function y({ children: t, className: a, hideIcon: s, ...c }) {
81
+ return /* @__PURE__ */ r(o.RadioItem, {
82
82
  className: e("relative flex items-center rounded-sm pr-2 pl-8 no-focus-ring transition-bg-ease select-none focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50", "mx-1 h-[28px] cursor-pointer gap-2 data-[state=highlighted]:bg-accent data-[state=highlighted]:text-accent-foreground [&_svg]:size-4", a),
83
83
  ...c,
84
- children: [!s && /* @__PURE__ */ t("span", {
84
+ children: [!s && /* @__PURE__ */ n("span", {
85
85
  className: "absolute left-2 flex size-3.5 items-center justify-center",
86
- children: /* @__PURE__ */ t(o.ItemIndicator, { children: /* @__PURE__ */ t(i, {}) })
87
- }), r]
86
+ children: /* @__PURE__ */ n(o.ItemIndicator, { children: /* @__PURE__ */ n(i, {}) })
87
+ }), t]
88
88
  });
89
89
  }
90
- function b({ className: n, inset: r, ...i }) {
91
- return /* @__PURE__ */ t(o.Label, {
92
- className: e(c({ inset: r }), n),
90
+ function b({ className: t, inset: r, ...i }) {
91
+ return /* @__PURE__ */ n(o.Label, {
92
+ className: e(c({ inset: r }), t),
93
93
  ...i
94
94
  });
95
95
  }
96
- function x({ className: n, ...r }) {
97
- return /* @__PURE__ */ t(o.Separator, {
98
- className: e("-mx-1 my-1 h-px bg-muted", n),
96
+ function x({ className: t, ...r }) {
97
+ return /* @__PURE__ */ n(o.Separator, {
98
+ className: e("-mx-1 my-1 h-px bg-muted", t),
99
99
  ...r
100
100
  });
101
101
  }
102
- function S({ className: n, ...r }) {
103
- return /* @__PURE__ */ t("span", {
104
- className: e("ml-auto text-xs tracking-widest opacity-60", n),
102
+ function S({ className: t, ...r }) {
103
+ return /* @__PURE__ */ n("span", {
104
+ className: e("ml-auto text-xs tracking-widest opacity-60", t),
105
105
  ...r
106
106
  });
107
107
  }
@@ -1,6 +1,6 @@
1
1
  import { useFormContext as e } from "../form/form.context.js";
2
- import { Label as t } from "../../components/ui/label.js";
3
- import { Input as n } from "../../components/ui/input.js";
2
+ import { Input as t } from "../../components/ui/input.js";
3
+ import { Label as n } from "../../components/ui/label.js";
4
4
  import r from "react";
5
5
  import "@pihanga2/core";
6
6
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
@@ -49,11 +49,11 @@ var o = (o) => {
49
49
  "data-pihanga": _,
50
50
  className: "grid w-full gap-1.5",
51
51
  children: [
52
- f && /* @__PURE__ */ i(t, {
52
+ f && /* @__PURE__ */ i(n, {
53
53
  htmlFor: M,
54
54
  children: f
55
55
  }),
56
- /* @__PURE__ */ i(n, {
56
+ /* @__PURE__ */ i(t, {
57
57
  ref: b,
58
58
  id: M,
59
59
  type: l,
@@ -0,0 +1 @@
1
+ export * from './message.types';
@@ -0,0 +1,15 @@
1
+ import { MessageComponent as e } from "./message.component.js";
2
+ import { MessageGroupComponent as t } from "./messageGroup.component.js";
3
+ import { MESSAGE_CARD as n, MESSAGE_GROUP_CARD as r, Message as i, MessageGroup as a } from "./message.types.js";
4
+ import { registerCardComponent as o } from "@pihanga2/core";
5
+ o({
6
+ name: n,
7
+ component: e
8
+ }), o({
9
+ name: r,
10
+ component: t
11
+ });
12
+ //#endregion
13
+ export { n as MESSAGE_CARD, r as MESSAGE_GROUP_CARD, i as Message, a as MessageGroup };
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/cards/message/index.ts"],"sourcesContent":["import {registerCardComponent} from \"@pihanga2/core\";\n\nimport {MessageComponent} from \"./message.component\";\nimport {MessageGroupComponent} from \"./messageGroup.component\";\nimport {MESSAGE_CARD, MESSAGE_GROUP_CARD} from \"./message.types\";\n\nexport * from \"./message.types\";\n\nregisterCardComponent({\n name: MESSAGE_CARD,\n component: MessageComponent,\n});\n\nregisterCardComponent({\n name: MESSAGE_GROUP_CARD,\n component: MessageGroupComponent,\n});\n"],"mappings":";;;;AAQA,EAAsB;CACpB,MAAM;CACN,WAAW;AACb,CAAC,GAED,EAAsB;CACpB,MAAM;CACN,WAAW;AACb,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { PiCardProps } from '@pihanga2/core';
2
+ import { MessageProps } from './message.types';
3
+ import * as React from "react";
4
+ export declare const MessageComponent: (props: PiCardProps<MessageProps>) => React.ReactNode;
@@ -0,0 +1,47 @@
1
+ import { Message as e, MessageAvatar as t, MessageContent as n, MessageFooter as r, MessageHeader as i } from "../../components/ui/message.js";
2
+ import "react";
3
+ import { Card as a } from "@pihanga2/core";
4
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
5
+ //#region src/cards/message/message.component.tsx
6
+ var c = (c) => {
7
+ let { align: l = "start", avatarCard: u, headerCard: d, contentCard: f, footerCard: p, className: m, avatarClassName: h, contentClassName: g, headerClassName: _, footerClassName: v, style: y, cardName: b } = c;
8
+ return /* @__PURE__ */ s(e, {
9
+ align: l,
10
+ className: m,
11
+ style: y,
12
+ "data-pihanga": b,
13
+ children: [u && /* @__PURE__ */ o(t, {
14
+ className: h,
15
+ children: /* @__PURE__ */ o(a, {
16
+ cardName: u,
17
+ parentCard: b
18
+ })
19
+ }), /* @__PURE__ */ s(n, {
20
+ className: g,
21
+ children: [
22
+ d && /* @__PURE__ */ o(i, {
23
+ className: _,
24
+ children: /* @__PURE__ */ o(a, {
25
+ cardName: d,
26
+ parentCard: b
27
+ })
28
+ }),
29
+ /* @__PURE__ */ o(a, {
30
+ cardName: f,
31
+ parentCard: b
32
+ }),
33
+ p && /* @__PURE__ */ o(r, {
34
+ className: v,
35
+ children: /* @__PURE__ */ o(a, {
36
+ cardName: p,
37
+ parentCard: b
38
+ })
39
+ })
40
+ ]
41
+ })]
42
+ });
43
+ };
44
+ //#endregion
45
+ export { c as MessageComponent };
46
+
47
+ //# sourceMappingURL=message.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.component.js","names":[],"sources":["../../../src/cards/message/message.component.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\nimport {\n Message,\n MessageAvatar,\n MessageContent,\n MessageFooter,\n MessageHeader,\n} from \"@/components/ui/message\";\nimport type {MessageProps} from \"./message.types\";\n\nexport const MessageComponent = (\n props: PiCardProps<MessageProps>,\n): React.ReactNode => {\n const {\n align = \"start\",\n avatarCard,\n headerCard,\n contentCard,\n footerCard,\n className,\n avatarClassName,\n contentClassName,\n headerClassName,\n footerClassName,\n style,\n cardName,\n } = props;\n\n return (\n <Message\n align={align}\n className={className}\n style={style}\n data-pihanga={cardName}\n >\n {avatarCard && (\n <MessageAvatar className={avatarClassName}>\n <Card cardName={avatarCard} parentCard={cardName} />\n </MessageAvatar>\n )}\n\n <MessageContent className={contentClassName}>\n {headerCard && (\n <MessageHeader className={headerClassName}>\n <Card cardName={headerCard} parentCard={cardName} />\n </MessageHeader>\n )}\n\n <Card cardName={contentCard} parentCard={cardName} />\n\n {footerCard && (\n <MessageFooter className={footerClassName}>\n <Card cardName={footerCard} parentCard={cardName} />\n </MessageFooter>\n )}\n </MessageContent>\n </Message>\n );\n};\n"],"mappings":";;;;;AAWA,IAAa,KACX,MACoB;CACpB,IAAM,EACJ,WAAQ,SACR,eACA,eACA,gBACA,eACA,cACA,oBACA,qBACA,oBACA,oBACA,UACA,gBACE;CAEJ,OACE,kBAAC,GAAD;EACS;EACI;EACJ;EACP,gBAAc;YAJhB,CAMG,KACC,kBAAC,GAAD;GAAe,WAAW;aACxB,kBAAC,GAAD;IAAM,UAAU;IAAY,YAAY;GAAW,CAAA;EACtC,CAAA,GAGjB,kBAAC,GAAD;GAAgB,WAAW;aAA3B;IACG,KACC,kBAAC,GAAD;KAAe,WAAW;eACxB,kBAAC,GAAD;MAAM,UAAU;MAAY,YAAY;KAAW,CAAA;IACtC,CAAA;IAGjB,kBAAC,GAAD;KAAM,UAAU;KAAa,YAAY;IAAW,CAAA;IAEnD,KACC,kBAAC,GAAD;KAAe,WAAW;eACxB,kBAAC,GAAD;MAAM,UAAU;MAAY,YAAY;KAAW,CAAA;IACtC,CAAA;GAEH;IACT;;AAEb"}
@@ -0,0 +1,56 @@
1
+ import { PiCardRef } from '@pihanga2/core';
2
+ import { default as React } from 'react';
3
+ export declare const MESSAGE_CARD = "shad/message";
4
+ export declare const Message: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<MessageProps, S, {}>) => import('@pihanga2/core').PiCardDef;
5
+ export type MessageProps = {
6
+ /**
7
+ * Alignment of the message row.
8
+ * - `"start"` — sender / left-hand messages (default).
9
+ * - `"end"` — receiver / current-user messages (right-hand side).
10
+ * @default "start"
11
+ */
12
+ align?: "start" | "end";
13
+ /**
14
+ * Pihanga card reference rendered inside `MessageAvatar`
15
+ * (typically a `shad/avatar` card). Omit to render no avatar slot.
16
+ */
17
+ avatarCard?: PiCardRef;
18
+ /**
19
+ * Pihanga card reference rendered above the message surface, inside
20
+ * `MessageHeader` (e.g. a sender name via `shad/typography`).
21
+ */
22
+ headerCard?: PiCardRef;
23
+ /**
24
+ * Pihanga card reference rendered as the message surface itself.
25
+ * Typically a `shad/bubble` card, but any card works — including
26
+ * "large" content such as a `markdown-viewer` or `shad/data-table` card.
27
+ */
28
+ contentCard: PiCardRef;
29
+ /**
30
+ * Pihanga card reference rendered below the message surface, inside
31
+ * `MessageFooter` (e.g. delivery status, timestamps, or action buttons).
32
+ */
33
+ footerCard?: PiCardRef;
34
+ /** Additional Tailwind classes applied to the root `Message` element. */
35
+ className?: string;
36
+ /** Additional Tailwind classes applied to `MessageAvatar`. */
37
+ avatarClassName?: string;
38
+ /** Additional Tailwind classes applied to `MessageContent`. */
39
+ contentClassName?: string;
40
+ /** Additional Tailwind classes applied to `MessageHeader`. */
41
+ headerClassName?: string;
42
+ /** Additional Tailwind classes applied to `MessageFooter`. */
43
+ footerClassName?: string;
44
+ /** Inline styles applied to the root `Message` element. */
45
+ style?: React.CSSProperties;
46
+ };
47
+ export declare const MESSAGE_GROUP_CARD = "shad/message-group";
48
+ export declare const MessageGroup: <S extends import('@pihanga2/core').ReduxState>(p: import('@pihanga2/core').PiMapProps<MessageGroupProps, S, {}>) => import('@pihanga2/core').PiCardDef;
49
+ export type MessageGroupProps = {
50
+ /** Ordered list of `shad/message` (or other) card refs to stack. */
51
+ content: PiCardRef[];
52
+ /** Additional Tailwind classes applied to the root element. */
53
+ className?: string;
54
+ /** Inline styles applied to the root element. */
55
+ style?: React.CSSProperties;
56
+ };
@@ -0,0 +1,7 @@
1
+ import { createCardDeclaration as e } from "@pihanga2/core";
2
+ //#region src/cards/message/message.types.ts
3
+ var t = "shad/message", n = e(t), r = "shad/message-group", i = e(r);
4
+ //#endregion
5
+ export { t as MESSAGE_CARD, r as MESSAGE_GROUP_CARD, n as Message, i as MessageGroup };
6
+
7
+ //# sourceMappingURL=message.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.types.js","names":[],"sources":["../../../src/cards/message/message.types.ts"],"sourcesContent":["import {createCardDeclaration, type PiCardRef} from \"@pihanga2/core\";\nimport type React from \"react\";\n\nexport const MESSAGE_CARD = \"shad/message\";\n\nexport const Message = createCardDeclaration<MessageProps>(MESSAGE_CARD);\n\nexport type MessageProps = {\n /**\n * Alignment of the message row.\n * - `\"start\"` — sender / left-hand messages (default).\n * - `\"end\"` — receiver / current-user messages (right-hand side).\n * @default \"start\"\n */\n align?: \"start\" | \"end\";\n\n /**\n * Pihanga card reference rendered inside `MessageAvatar`\n * (typically a `shad/avatar` card). Omit to render no avatar slot.\n */\n avatarCard?: PiCardRef;\n\n /**\n * Pihanga card reference rendered above the message surface, inside\n * `MessageHeader` (e.g. a sender name via `shad/typography`).\n */\n headerCard?: PiCardRef;\n\n /**\n * Pihanga card reference rendered as the message surface itself.\n * Typically a `shad/bubble` card, but any card works — including\n * \"large\" content such as a `markdown-viewer` or `shad/data-table` card.\n */\n contentCard: PiCardRef;\n\n /**\n * Pihanga card reference rendered below the message surface, inside\n * `MessageFooter` (e.g. delivery status, timestamps, or action buttons).\n */\n footerCard?: PiCardRef;\n\n /** Additional Tailwind classes applied to the root `Message` element. */\n className?: string;\n /** Additional Tailwind classes applied to `MessageAvatar`. */\n avatarClassName?: string;\n /** Additional Tailwind classes applied to `MessageContent`. */\n contentClassName?: string;\n /** Additional Tailwind classes applied to `MessageHeader`. */\n headerClassName?: string;\n /** Additional Tailwind classes applied to `MessageFooter`. */\n footerClassName?: string;\n\n /** Inline styles applied to the root `Message` element. */\n style?: React.CSSProperties;\n};\n\n// ---------------------------------------------------------------------------\n// shad/message-group — stack consecutive messages from the same sender.\n// ---------------------------------------------------------------------------\n\nexport const MESSAGE_GROUP_CARD = \"shad/message-group\";\n\nexport const MessageGroup =\n createCardDeclaration<MessageGroupProps>(MESSAGE_GROUP_CARD);\n\nexport type MessageGroupProps = {\n /** Ordered list of `shad/message` (or other) card refs to stack. */\n content: PiCardRef[];\n /** Additional Tailwind classes applied to the root element. */\n className?: string;\n /** Inline styles applied to the root element. */\n style?: React.CSSProperties;\n};\n"],"mappings":";;AAGA,IAAa,IAAe,gBAEf,IAAU,EAAoC,CAAY,GAuD1D,IAAqB,sBAErB,IACX,EAAyC,CAAkB"}
@@ -0,0 +1,4 @@
1
+ import { PiCardProps } from '@pihanga2/core';
2
+ import { MessageGroupProps } from './message.types';
3
+ import * as React from "react";
4
+ export declare const MessageGroupComponent: (props: PiCardProps<MessageGroupProps>) => React.ReactNode;
@@ -0,0 +1,21 @@
1
+ import { MessageGroup as e } from "../../components/ui/message.js";
2
+ import "react";
3
+ import { Card as t } from "@pihanga2/core";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ //#region src/cards/message/messageGroup.component.tsx
6
+ var r = (r) => {
7
+ let { content: i, className: a, style: o, cardName: s } = r;
8
+ return /* @__PURE__ */ n(e, {
9
+ className: a,
10
+ style: o,
11
+ "data-pihanga": s,
12
+ children: i.map((e, r) => /* @__PURE__ */ n(t, {
13
+ cardName: e,
14
+ parentCard: s
15
+ }, r))
16
+ });
17
+ };
18
+ //#endregion
19
+ export { r as MessageGroupComponent };
20
+
21
+ //# sourceMappingURL=messageGroup.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messageGroup.component.js","names":[],"sources":["../../../src/cards/message/messageGroup.component.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {Card, type PiCardProps} from \"@pihanga2/core\";\nimport {MessageGroup} from \"@/components/ui/message\";\nimport type {MessageGroupProps} from \"./message.types\";\n\nexport const MessageGroupComponent = (\n props: PiCardProps<MessageGroupProps>,\n): React.ReactNode => {\n const {content, className, style, cardName} = props;\n\n return (\n <MessageGroup className={className} style={style} data-pihanga={cardName}>\n {content.map((cn, i) => (\n <Card cardName={cn} parentCard={cardName} key={i} />\n ))}\n </MessageGroup>\n );\n};\n"],"mappings":";;;;;AAKA,IAAa,KACX,MACoB;CACpB,IAAM,EAAC,YAAS,cAAW,UAAO,gBAAY;CAE9C,OACE,kBAAC,GAAD;EAAyB;EAAkB;EAAO,gBAAc;YAC7D,EAAQ,KAAK,GAAI,MAChB,kBAAC,GAAD;GAAM,UAAU;GAAI,YAAY;EAAmB,GAAJ,CAAI,CACpD;CACW,CAAA;AAElB"}
@@ -0,0 +1,102 @@
1
+ import { cn as e } from "../../lib/utils.js";
2
+ import { Button as t } from "./button.js";
3
+ import "react";
4
+ import { cva as n } from "class-variance-authority";
5
+ import { Slot as r } from "radix-ui";
6
+ import { jsx as i } from "react/jsx-runtime";
7
+ //#region src/components/ui/attachment.tsx
8
+ var a = n("group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed", { variants: {
9
+ size: {
10
+ default: "gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2",
11
+ sm: "gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5",
12
+ xs: "gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1"
13
+ },
14
+ orientation: {
15
+ horizontal: "min-w-40 items-center",
16
+ vertical: "w-24 flex-col has-data-[slot=attachment-content]:w-30"
17
+ }
18
+ } });
19
+ function o({ className: t, state: n = "done", size: r = "default", orientation: o = "horizontal", ...s }) {
20
+ return /* @__PURE__ */ i("div", {
21
+ "data-slot": "attachment",
22
+ "data-state": n,
23
+ "data-size": r,
24
+ "data-orientation": o,
25
+ className: e(a({
26
+ size: r,
27
+ orientation: o
28
+ }), t),
29
+ ...s
30
+ });
31
+ }
32
+ var s = n("relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5", {
33
+ variants: { variant: {
34
+ icon: "",
35
+ image: "opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover"
36
+ } },
37
+ defaultVariants: { variant: "icon" }
38
+ });
39
+ function c({ className: t, variant: n = "icon", ...r }) {
40
+ return /* @__PURE__ */ i("div", {
41
+ "data-slot": "attachment-media",
42
+ "data-variant": n,
43
+ className: e(s({ variant: n }), t),
44
+ ...r
45
+ });
46
+ }
47
+ function l({ className: t, ...n }) {
48
+ return /* @__PURE__ */ i("div", {
49
+ "data-slot": "attachment-content",
50
+ className: e("max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1", t),
51
+ ...n
52
+ });
53
+ }
54
+ function u({ className: t, ...n }) {
55
+ return /* @__PURE__ */ i("span", {
56
+ "data-slot": "attachment-title",
57
+ className: e("block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:animate-pulse group-data-[state=uploading]/attachment:animate-pulse", t),
58
+ ...n
59
+ });
60
+ }
61
+ function d({ className: t, ...n }) {
62
+ return /* @__PURE__ */ i("span", {
63
+ "data-slot": "attachment-description",
64
+ className: e("mt-0.5 block min-w-0 max-w-full truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80", t),
65
+ ...n
66
+ });
67
+ }
68
+ function f({ className: t, ...n }) {
69
+ return /* @__PURE__ */ i("div", {
70
+ "data-slot": "attachment-actions",
71
+ className: e("relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1", t),
72
+ ...n
73
+ });
74
+ }
75
+ function p({ className: n, variant: r, size: a = "icon-xs", ...o }) {
76
+ return /* @__PURE__ */ i(t, {
77
+ "data-slot": "attachment-action",
78
+ variant: r ?? "ghost",
79
+ size: a,
80
+ className: e(n),
81
+ ...o
82
+ });
83
+ }
84
+ function m({ className: t, asChild: n = !1, type: a, ...o }) {
85
+ return /* @__PURE__ */ i(n ? r.Root : "button", {
86
+ "data-slot": "attachment-trigger",
87
+ type: n ? void 0 : a ?? "button",
88
+ className: e("absolute inset-0 z-10 outline-none", t),
89
+ ...o
90
+ });
91
+ }
92
+ function h({ className: t, ...n }) {
93
+ return /* @__PURE__ */ i("div", {
94
+ "data-slot": "attachment-group",
95
+ className: e("flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 [scrollbar-width:none] *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start [&::-webkit-scrollbar]:hidden", t),
96
+ ...n
97
+ });
98
+ }
99
+ //#endregion
100
+ export { o as Attachment, p as AttachmentAction, f as AttachmentActions, l as AttachmentContent, d as AttachmentDescription, h as AttachmentGroup, c as AttachmentMedia, u as AttachmentTitle, m as AttachmentTrigger };
101
+
102
+ //# sourceMappingURL=attachment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attachment.js","names":[],"sources":["../../../src/components/ui/attachment.tsx"],"sourcesContent":["import * as React from \"react\";\nimport {cva, type VariantProps} from \"class-variance-authority\";\nimport {Slot} from \"radix-ui\";\n\nimport {cn} from \"@/lib/utils\";\nimport {Button} from \"@/components/ui/button\";\n\nconst attachmentVariants = cva(\n \"group/attachment relative flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-xl border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring/50 has-[>a,>button]:hover:bg-muted/50 data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed\",\n {\n variants: {\n size: {\n default:\n \"gap-2 text-sm has-data-[slot=attachment-content]:px-2.5 has-data-[slot=attachment-content]:py-2 has-data-[slot=attachment-media]:p-2\",\n sm: \"gap-2.5 text-xs has-data-[slot=attachment-content]:px-2 has-data-[slot=attachment-content]:py-1.5 has-data-[slot=attachment-media]:p-1.5\",\n xs: \"gap-1.5 rounded-lg text-xs has-data-[slot=attachment-content]:px-1.5 has-data-[slot=attachment-content]:py-1 has-data-[slot=attachment-media]:p-1\",\n },\n orientation: {\n horizontal: \"min-w-40 items-center\",\n vertical: \"w-24 flex-col has-data-[slot=attachment-content]:w-30\",\n },\n },\n },\n);\n\nfunction Attachment({\n className,\n state = \"done\",\n size = \"default\",\n orientation = \"horizontal\",\n ...props\n}: React.ComponentProps<\"div\"> &\n VariantProps<typeof attachmentVariants> & {\n state?: \"idle\" | \"uploading\" | \"processing\" | \"error\" | \"done\";\n }) {\n return (\n <div\n data-slot=\"attachment\"\n data-state={state}\n data-size={size}\n data-orientation={orientation}\n className={cn(attachmentVariants({size, orientation}), className)}\n {...props}\n />\n );\n}\n\nconst attachmentMediaVariants = cva(\n \"relative flex aspect-square w-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-8 group-data-[size=xs]/attachment:w-7 group-data-[size=xs]/attachment:rounded-md group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-6 group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-3.5\",\n {\n variants: {\n variant: {\n icon: \"\",\n image:\n \"opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 *:[img]:aspect-square *:[img]:w-full *:[img]:object-cover\",\n },\n },\n defaultVariants: {\n variant: \"icon\",\n },\n },\n);\n\nfunction AttachmentMedia({\n className,\n variant = \"icon\",\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof attachmentMediaVariants>) {\n return (\n <div\n data-slot=\"attachment-media\"\n data-variant={variant}\n className={cn(attachmentMediaVariants({variant}), className)}\n {...props}\n />\n );\n}\n\nfunction AttachmentContent({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-content\"\n className={cn(\n \"max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentTitle({className, ...props}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"attachment-title\"\n className={cn(\n \"block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:animate-pulse group-data-[state=uploading]/attachment:animate-pulse\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentDescription({\n className,\n ...props\n}: React.ComponentProps<\"span\">) {\n return (\n <span\n data-slot=\"attachment-description\"\n className={cn(\n \"mt-0.5 block min-w-0 max-w-full truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentActions({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-actions\"\n className={cn(\n \"relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:top-3 group-data-[orientation=vertical]/attachment:right-3 group-data-[orientation=vertical]/attachment:gap-1\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AttachmentAction({\n className,\n variant,\n size = \"icon-xs\",\n ...props\n}: React.ComponentProps<typeof Button>) {\n return (\n <Button\n data-slot=\"attachment-action\"\n variant={variant ?? \"ghost\"}\n size={size}\n className={cn(className)}\n {...props}\n />\n );\n}\n\nfunction AttachmentTrigger({\n className,\n asChild = false,\n type,\n ...props\n}: React.ComponentProps<\"button\"> & {\n asChild?: boolean;\n}) {\n const Comp = asChild ? Slot.Root : \"button\";\n\n return (\n <Comp\n data-slot=\"attachment-trigger\"\n type={asChild ? undefined : (type ?? \"button\")}\n className={cn(\"absolute inset-0 z-10 outline-none\", className)}\n {...props}\n />\n );\n}\n\nfunction AttachmentGroup({className, ...props}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"attachment-group\"\n className={cn(\n \"flex min-w-0 snap-x snap-mandatory scroll-px-1 gap-3 overflow-x-auto overscroll-x-contain py-1 [scrollbar-width:none] *:data-[slot=attachment]:flex-none *:data-[slot=attachment]:snap-start [&::-webkit-scrollbar]:hidden\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport {\n Attachment,\n AttachmentGroup,\n AttachmentMedia,\n AttachmentContent,\n AttachmentTitle,\n AttachmentDescription,\n AttachmentActions,\n AttachmentAction,\n AttachmentTrigger,\n};\n"],"mappings":";;;;;;;AAOA,IAAM,IAAqB,EACzB,ySACA,EACE,UAAU;CACR,MAAM;EACJ,SACE;EACF,IAAI;EACJ,IAAI;CACN;CACA,aAAa;EACX,YAAY;EACZ,UAAU;CACZ;AACF,EACF,CACF;AAEA,SAAS,EAAW,EAClB,cACA,WAAQ,QACR,UAAO,WACP,iBAAc,cACd,GAAG,KAIA;CACH,OACE,kBAAC,OAAD;EACE,aAAU;EACV,cAAY;EACZ,aAAW;EACX,oBAAkB;EAClB,WAAW,EAAG,EAAmB;GAAC;GAAM;EAAW,CAAC,GAAG,CAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,IAAM,IAA0B,EAC9B,ymBACA;CACE,UAAU,EACR,SAAS;EACP,MAAM;EACN,OACE;CACJ,EACF;CACA,iBAAiB,EACf,SAAS,OACX;AACF,CACF;AAEA,SAAS,EAAgB,EACvB,cACA,aAAU,QACV,GAAG,KAC0E;CAC7E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,gBAAc;EACd,WAAW,EAAG,EAAwB,EAAC,WAAO,CAAC,GAAG,CAAS;EAC3D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAkB,EAAC,cAAW,GAAG,KAAqC;CAC7E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,6FACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAgB,EAAC,cAAW,GAAG,KAAsC;CAC5E,OACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EACT,8JACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAsB,EAC7B,cACA,GAAG,KAC4B;CAC/B,OACE,kBAAC,QAAD;EACE,aAAU;EACV,WAAW,EACT,kIACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAkB,EAAC,cAAW,GAAG,KAAqC;CAC7E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,6PACA,CACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAiB,EACxB,cACA,YACA,UAAO,WACP,GAAG,KACmC;CACtC,OACE,kBAAC,GAAD;EACE,aAAU;EACV,SAAS,KAAW;EACd;EACN,WAAW,EAAG,CAAS;EACvB,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAkB,EACzB,cACA,aAAU,IACV,SACA,GAAG,KAGF;CAGD,OACE,kBAHW,IAAU,EAAK,OAAO,UAGjC;EACE,aAAU;EACV,MAAM,IAAU,KAAA,IAAa,KAAQ;EACrC,WAAW,EAAG,sCAAsC,CAAS;EAC7D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,EAAgB,EAAC,cAAW,GAAG,KAAqC;CAC3E,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAW,EACT,8NACA,CACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -1,10 +1,10 @@
1
1
  import { cn as e } from "../lib/utils.js";
2
2
  import "react";
3
- import { jsx as t } from "react/jsx-runtime";
4
- import { Slot as n } from "@radix-ui/react-slot";
5
- import { cva as r } from "class-variance-authority";
3
+ import { cva as t } from "class-variance-authority";
4
+ import { jsx as n } from "react/jsx-runtime";
5
+ import { Slot as r } from "@radix-ui/react-slot";
6
6
  //#region src/components/ui/badge.tsx
7
- var i = r("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
7
+ var i = t("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden", {
8
8
  variants: { variant: {
9
9
  default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
10
10
  secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
@@ -13,10 +13,10 @@ var i = r("inline-flex items-center justify-center rounded-full border px-2 py-0
13
13
  } },
14
14
  defaultVariants: { variant: "default" }
15
15
  });
16
- function a({ className: r, variant: a, asChild: o = !1, ...s }) {
17
- return /* @__PURE__ */ t(o ? n : "span", {
16
+ function a({ className: t, variant: a, asChild: o = !1, ...s }) {
17
+ return /* @__PURE__ */ n(o ? r : "span", {
18
18
  "data-slot": "badge",
19
- className: e(i({ variant: a }), r),
19
+ className: e(i({ variant: a }), t),
20
20
  ...s
21
21
  });
22
22
  }