@slipstream-ui/core 0.11.8 → 0.11.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +176 -9
- package/dist/index.d.ts +176 -9
- package/dist/index.js +1297 -905
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1294 -905
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/accordion.manifest.json +1 -1
- package/dist/manifests/alert.manifest.json +1 -1
- package/dist/manifests/announcement-bar.manifest.json +1 -1
- package/dist/manifests/app-shell.manifest.json +1 -1
- package/dist/manifests/applied-filters.manifest.json +1 -1
- package/dist/manifests/article-card.manifest.json +1 -1
- package/dist/manifests/auth-layout.manifest.json +1 -1
- package/dist/manifests/autocomplete.manifest.json +1 -1
- package/dist/manifests/avatar.manifest.json +1 -1
- package/dist/manifests/badge.manifest.json +1 -1
- package/dist/manifests/block.manifest.json +1 -1
- package/dist/manifests/bottom-nav.manifest.json +1 -1
- package/dist/manifests/breadcrumb.manifest.json +1 -1
- package/dist/manifests/button-group.manifest.json +1 -1
- package/dist/manifests/button.manifest.json +4 -2
- package/dist/manifests/calendar.manifest.json +1 -1
- package/dist/manifests/card.manifest.json +1 -1
- package/dist/manifests/checkbox.manifest.json +1 -1
- package/dist/manifests/comparison-table.manifest.json +1 -1
- package/dist/manifests/confirm-dialog.manifest.json +1 -1
- package/dist/manifests/contact-strip.manifest.json +1 -1
- package/dist/manifests/container.manifest.json +1 -1
- package/dist/manifests/cover-image.manifest.json +1 -1
- package/dist/manifests/cta-section.manifest.json +1 -1
- package/dist/manifests/data-table.manifest.json +22 -1
- package/dist/manifests/date-picker-popover.manifest.json +1 -1
- package/dist/manifests/date-picker.manifest.json +1 -1
- package/dist/manifests/date-range-picker.manifest.json +1 -1
- package/dist/manifests/deal-card.manifest.json +1 -1
- package/dist/manifests/dialog.manifest.json +1 -1
- package/dist/manifests/document-card.manifest.json +1 -1
- package/dist/manifests/drawer.manifest.json +1 -1
- package/dist/manifests/empty-state.manifest.json +1 -1
- package/dist/manifests/entity-card.manifest.json +1 -1
- package/dist/manifests/feature-grid.manifest.json +1 -1
- package/dist/manifests/feature-row.manifest.json +1 -1
- package/dist/manifests/fieldset.manifest.json +1 -1
- package/dist/manifests/file-upload.manifest.json +1 -1
- package/dist/manifests/filter-bar.manifest.json +1 -1
- package/dist/manifests/filter-chips.manifest.json +1 -1
- package/dist/manifests/filter-panel.manifest.json +1 -1
- package/dist/manifests/flex.manifest.json +1 -1
- package/dist/manifests/form-field.manifest.json +1 -1
- package/dist/manifests/form-layout.manifest.json +1 -1
- package/dist/manifests/form.manifest.json +1 -1
- package/dist/manifests/grid.manifest.json +1 -1
- package/dist/manifests/heading.manifest.json +1 -1
- package/dist/manifests/hero.manifest.json +1 -1
- package/dist/manifests/image.manifest.json +1 -1
- package/dist/manifests/input-group.manifest.json +1 -1
- package/dist/manifests/input.manifest.json +1 -1
- package/dist/manifests/label.manifest.json +1 -1
- package/dist/manifests/link-tabs.manifest.json +1 -1
- package/dist/manifests/link.manifest.json +1 -1
- package/dist/manifests/list-toolbar.manifest.json +120 -0
- package/dist/manifests/list.manifest.json +1 -1
- package/dist/manifests/load-more.manifest.json +1 -1
- package/dist/manifests/logo-cloud.manifest.json +1 -1
- package/dist/manifests/media-card.manifest.json +161 -0
- package/dist/manifests/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- package/dist/manifests/month-schedule.manifest.json +217 -0
- package/dist/manifests/multi-select.manifest.json +1 -1
- package/dist/manifests/newsletter.manifest.json +1 -1
- package/dist/manifests/page-header.manifest.json +1 -1
- package/dist/manifests/pagination.manifest.json +1 -1
- package/dist/manifests/password-input.manifest.json +1 -1
- package/dist/manifests/popover.manifest.json +1 -1
- package/dist/manifests/process-steps.manifest.json +1 -1
- package/dist/manifests/progress.manifest.json +1 -1
- package/dist/manifests/prose.manifest.json +1 -1
- package/dist/manifests/radio.manifest.json +1 -1
- package/dist/manifests/range-slider.manifest.json +1 -1
- package/dist/manifests/search.manifest.json +1 -1
- package/dist/manifests/section-heading.manifest.json +1 -1
- package/dist/manifests/section.manifest.json +1 -1
- package/dist/manifests/segmented-control.manifest.json +4 -4
- package/dist/manifests/select-menu.manifest.json +1 -1
- package/dist/manifests/select.manifest.json +1 -1
- package/dist/manifests/separator.manifest.json +1 -1
- package/dist/manifests/site-footer.manifest.json +1 -1
- package/dist/manifests/site-header.manifest.json +1 -1
- package/dist/manifests/skeleton.manifest.json +1 -1
- package/dist/manifests/spinner.manifest.json +1 -1
- package/dist/manifests/stat-band.manifest.json +1 -1
- package/dist/manifests/stepper.manifest.json +1 -1
- package/dist/manifests/switch.manifest.json +1 -1
- package/dist/manifests/table-card.manifest.json +1 -1
- package/dist/manifests/table-of-contents.manifest.json +1 -1
- package/dist/manifests/table.manifest.json +1 -1
- package/dist/manifests/tabs.manifest.json +1 -1
- package/dist/manifests/testimonial.manifest.json +1 -1
- package/dist/manifests/text.manifest.json +1 -1
- package/dist/manifests/textarea.manifest.json +1 -1
- package/dist/manifests/theme-toggle.manifest.json +1 -1
- package/dist/manifests/time-picker.manifest.json +1 -1
- package/dist/manifests/timeline.manifest.json +1 -1
- package/dist/manifests/toast.manifest.json +1 -1
- package/dist/manifests/tombstone-card.manifest.json +1 -1
- package/dist/manifests/tooltip.manifest.json +1 -1
- package/dist/src/components/button/Button.d.ts +2 -2
- package/dist/src/components/button/Button.js +1 -0
- package/dist/src/components/button/Button.js.map +1 -1
- package/dist/src/components/button/Button.mjs +1 -0
- package/dist/src/components/button/Button.mjs.map +1 -1
- package/dist/src/components/data-table/DataTable.d.ts +12 -1
- package/dist/src/components/data-table/DataTable.js +189 -112
- package/dist/src/components/data-table/DataTable.js.map +1 -1
- package/dist/src/components/data-table/DataTable.mjs +189 -112
- package/dist/src/components/data-table/DataTable.mjs.map +1 -1
- package/dist/src/components/list-toolbar/ListToolbar.d.ts +25 -0
- package/dist/src/components/list-toolbar/ListToolbar.js +68 -0
- package/dist/src/components/list-toolbar/ListToolbar.js.map +1 -0
- package/dist/src/components/list-toolbar/ListToolbar.mjs +44 -0
- package/dist/src/components/list-toolbar/ListToolbar.mjs.map +1 -0
- package/dist/src/components/list-toolbar/index.d.ts +1 -0
- package/dist/src/components/list-toolbar/index.js +23 -0
- package/dist/src/components/list-toolbar/index.js.map +1 -0
- package/dist/src/components/list-toolbar/index.mjs +2 -0
- package/dist/src/components/list-toolbar/index.mjs.map +1 -0
- package/dist/src/components/media-card/MediaCard.d.ts +61 -0
- package/dist/src/components/media-card/MediaCard.js +88 -0
- package/dist/src/components/media-card/MediaCard.js.map +1 -0
- package/dist/src/components/media-card/MediaCard.mjs +54 -0
- package/dist/src/components/media-card/MediaCard.mjs.map +1 -0
- package/dist/src/components/media-card/index.d.ts +1 -0
- package/dist/src/components/media-card/index.js +23 -0
- package/dist/src/components/media-card/index.js.map +1 -0
- package/dist/src/components/media-card/index.mjs +2 -0
- package/dist/src/components/media-card/index.mjs.map +1 -0
- package/dist/src/components/month-schedule/MonthSchedule.d.ts +56 -0
- package/dist/src/components/month-schedule/MonthSchedule.js +245 -0
- package/dist/src/components/month-schedule/MonthSchedule.js.map +1 -0
- package/dist/src/components/month-schedule/MonthSchedule.mjs +219 -0
- package/dist/src/components/month-schedule/MonthSchedule.mjs.map +1 -0
- package/dist/src/components/month-schedule/index.d.ts +1 -0
- package/dist/src/components/month-schedule/index.js +23 -0
- package/dist/src/components/month-schedule/index.js.map +1 -0
- package/dist/src/components/month-schedule/index.mjs +2 -0
- package/dist/src/components/month-schedule/index.mjs.map +1 -0
- package/dist/src/components/segmented-control/SegmentedControl.d.ts +20 -4
- package/dist/src/components/segmented-control/SegmentedControl.js +17 -3
- package/dist/src/components/segmented-control/SegmentedControl.js.map +1 -1
- package/dist/src/components/segmented-control/SegmentedControl.mjs +17 -3
- package/dist/src/components/segmented-control/SegmentedControl.mjs.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/src/components/button/Button.ssr.test.tsx +1 -1
- package/src/components/button/Button.test.tsx +6 -0
- package/src/components/button/Button.tsx +1 -0
- package/src/components/data-table/DataTable.test.tsx +99 -0
- package/src/components/data-table/DataTable.tsx +115 -1
- package/src/components/list-toolbar/ListToolbar.test.tsx +50 -0
- package/src/components/list-toolbar/ListToolbar.tsx +64 -0
- package/src/components/list-toolbar/index.ts +1 -0
- package/src/components/media-card/MediaCard.test.tsx +97 -0
- package/src/components/media-card/MediaCard.tsx +116 -0
- package/src/components/media-card/index.ts +1 -0
- package/src/components/month-schedule/MonthSchedule.test.tsx +137 -0
- package/src/components/month-schedule/MonthSchedule.tsx +332 -0
- package/src/components/month-schedule/index.ts +1 -0
- package/src/components/segmented-control/SegmentedControl.test.tsx +51 -0
- package/src/components/segmented-control/SegmentedControl.tsx +36 -4
- package/src/index.ts +3 -0
- package/src/manifests/accordion.manifest.json +1 -1
- package/src/manifests/alert.manifest.json +1 -1
- package/src/manifests/announcement-bar.manifest.json +1 -1
- package/src/manifests/app-shell.manifest.json +1 -1
- package/src/manifests/applied-filters.manifest.json +1 -1
- package/src/manifests/article-card.manifest.json +1 -1
- package/src/manifests/auth-layout.manifest.json +1 -1
- package/src/manifests/autocomplete.manifest.json +1 -1
- package/src/manifests/avatar.manifest.json +1 -1
- package/src/manifests/badge.manifest.json +1 -1
- package/src/manifests/block.manifest.json +1 -1
- package/src/manifests/bottom-nav.manifest.json +1 -1
- package/src/manifests/breadcrumb.manifest.json +1 -1
- package/src/manifests/button-group.manifest.json +1 -1
- package/src/manifests/button.manifest.json +4 -2
- package/src/manifests/calendar.manifest.json +1 -1
- package/src/manifests/card.manifest.json +1 -1
- package/src/manifests/checkbox.manifest.json +1 -1
- package/src/manifests/comparison-table.manifest.json +1 -1
- package/src/manifests/confirm-dialog.manifest.json +1 -1
- package/src/manifests/contact-strip.manifest.json +1 -1
- package/src/manifests/container.manifest.json +1 -1
- package/src/manifests/cover-image.manifest.json +1 -1
- package/src/manifests/cta-section.manifest.json +1 -1
- package/src/manifests/data-table.manifest.json +22 -1
- package/src/manifests/date-picker-popover.manifest.json +1 -1
- package/src/manifests/date-picker.manifest.json +1 -1
- package/src/manifests/date-range-picker.manifest.json +1 -1
- package/src/manifests/deal-card.manifest.json +1 -1
- package/src/manifests/dialog.manifest.json +1 -1
- package/src/manifests/document-card.manifest.json +1 -1
- package/src/manifests/drawer.manifest.json +1 -1
- package/src/manifests/empty-state.manifest.json +1 -1
- package/src/manifests/entity-card.manifest.json +1 -1
- package/src/manifests/feature-grid.manifest.json +1 -1
- package/src/manifests/feature-row.manifest.json +1 -1
- package/src/manifests/fieldset.manifest.json +1 -1
- package/src/manifests/file-upload.manifest.json +1 -1
- package/src/manifests/filter-bar.manifest.json +1 -1
- package/src/manifests/filter-chips.manifest.json +1 -1
- package/src/manifests/filter-panel.manifest.json +1 -1
- package/src/manifests/flex.manifest.json +1 -1
- package/src/manifests/form-field.manifest.json +1 -1
- package/src/manifests/form-layout.manifest.json +1 -1
- package/src/manifests/form.manifest.json +1 -1
- package/src/manifests/grid.manifest.json +1 -1
- package/src/manifests/heading.manifest.json +1 -1
- package/src/manifests/hero.manifest.json +1 -1
- package/src/manifests/image.manifest.json +1 -1
- package/src/manifests/input-group.manifest.json +1 -1
- package/src/manifests/input.manifest.json +1 -1
- package/src/manifests/label.manifest.json +1 -1
- package/src/manifests/link-tabs.manifest.json +1 -1
- package/src/manifests/link.manifest.json +1 -1
- package/src/manifests/list-toolbar.manifest.json +120 -0
- package/src/manifests/list.manifest.json +1 -1
- package/src/manifests/load-more.manifest.json +1 -1
- package/src/manifests/logo-cloud.manifest.json +1 -1
- package/src/manifests/media-card.manifest.json +161 -0
- package/src/manifests/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- package/src/manifests/month-schedule.manifest.json +217 -0
- package/src/manifests/multi-select.manifest.json +1 -1
- package/src/manifests/newsletter.manifest.json +1 -1
- package/src/manifests/page-header.manifest.json +1 -1
- package/src/manifests/pagination.manifest.json +1 -1
- package/src/manifests/password-input.manifest.json +1 -1
- package/src/manifests/popover.manifest.json +1 -1
- package/src/manifests/process-steps.manifest.json +1 -1
- package/src/manifests/progress.manifest.json +1 -1
- package/src/manifests/prose.manifest.json +1 -1
- package/src/manifests/radio.manifest.json +1 -1
- package/src/manifests/range-slider.manifest.json +1 -1
- package/src/manifests/search.manifest.json +1 -1
- package/src/manifests/section-heading.manifest.json +1 -1
- package/src/manifests/section.manifest.json +1 -1
- package/src/manifests/segmented-control.manifest.json +4 -4
- package/src/manifests/select-menu.manifest.json +1 -1
- package/src/manifests/select.manifest.json +1 -1
- package/src/manifests/separator.manifest.json +1 -1
- package/src/manifests/site-footer.manifest.json +1 -1
- package/src/manifests/site-header.manifest.json +1 -1
- package/src/manifests/skeleton.manifest.json +1 -1
- package/src/manifests/spinner.manifest.json +1 -1
- package/src/manifests/stat-band.manifest.json +1 -1
- package/src/manifests/stepper.manifest.json +1 -1
- package/src/manifests/switch.manifest.json +1 -1
- package/src/manifests/table-card.manifest.json +1 -1
- package/src/manifests/table-of-contents.manifest.json +1 -1
- package/src/manifests/table.manifest.json +1 -1
- package/src/manifests/tabs.manifest.json +1 -1
- package/src/manifests/testimonial.manifest.json +1 -1
- package/src/manifests/text.manifest.json +1 -1
- package/src/manifests/textarea.manifest.json +1 -1
- package/src/manifests/theme-toggle.manifest.json +1 -1
- package/src/manifests/time-picker.manifest.json +1 -1
- package/src/manifests/timeline.manifest.json +1 -1
- package/src/manifests/toast.manifest.json +1 -1
- package/src/manifests/tombstone-card.manifest.json +1 -1
- package/src/manifests/tooltip.manifest.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/list-toolbar/ListToolbar.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type ListToolbarProps = React.HTMLAttributes<HTMLDivElement> & {\n /** Number of matching results; renders \"{count} {countLabel}\". */\n count?: number;\n /** Noun for the result count. Default \"results\". */\n countLabel?: string;\n /** Page/range position text, e.g. \"Page 2 of 5\" or \"Showing 21–40 of 137\". */\n position?: React.ReactNode;\n /** Muted note at the end of the summary line, e.g. \"Sorted by date, soonest first\". */\n note?: React.ReactNode;\n /** Controls rendered at the far end: SegmentedControl view switch, sort Select. */\n children?: React.ReactNode;\n /** Distribution of the bar. Default 'between' (summary left, controls right). */\n align?: 'between' | 'start' | 'center' | 'end';\n};\n\nconst alignClasses = {\n between: 'justify-between',\n start: 'justify-start',\n center: 'justify-center',\n end: 'justify-end',\n} as const;\n\n/**\n * Slim result bar for filtered lists and directories: result count, optional\n * page position and a \"sorted by\" note on the left; a view switch (e.g.\n * SegmentedControl in link mode) and sort control on the right. Pair with\n * FilterBar for the input row above and Pagination below.\n */\nexport function ListToolbar({\n count,\n countLabel = 'results',\n position,\n note,\n align = 'between',\n className,\n children,\n ...props\n}: ListToolbarProps) {\n const hasSummary = count !== undefined || position !== undefined || note !== undefined;\n return (\n <div\n className={cn('flex flex-wrap items-center gap-x-4 gap-y-2 text-sm', alignClasses[align], className)}\n {...props}\n >\n {hasSummary && (\n <p className=\"flex flex-wrap items-baseline gap-x-2 text-muted-foreground\" aria-live=\"polite\">\n {count !== undefined && (\n <span className=\"font-medium text-foreground\">\n {count} {countLabel}\n </span>\n )}\n {position && <span>{position}</span>}\n {note && <span className=\"text-xs\">{note}</span>}\n </p>\n )}\n {children && <div className=\"flex flex-wrap items-center gap-2\">{children}</div>}\n </div>\n );\n}\n\nListToolbar.displayName = 'ListToolbar';\n"],"mappings":"AAkDY,SAIW,KAJX;AAjDZ,SAAS,UAAU;AAiBnB,MAAM,eAAe;AAAA,EACnB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AACP;AAQO,SAAS,YAAY;AAAA,EAC1B;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA,GAAG;AACL,GAAqB;AACnB,QAAM,aAAa,UAAU,UAAa,aAAa,UAAa,SAAS;AAC7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,uDAAuD,aAAa,KAAK,GAAG,SAAS;AAAA,MAClG,GAAG;AAAA,MAEH;AAAA,sBACC,qBAAC,OAAE,WAAU,+DAA8D,aAAU,UAClF;AAAA,oBAAU,UACT,qBAAC,UAAK,WAAU,+BACb;AAAA;AAAA,YAAM;AAAA,YAAE;AAAA,aACX;AAAA,UAED,YAAY,oBAAC,UAAM,oBAAS;AAAA,UAC5B,QAAQ,oBAAC,UAAK,WAAU,WAAW,gBAAK;AAAA,WAC3C;AAAA,QAED,YAAY,oBAAC,SAAI,WAAU,qCAAqC,UAAS;AAAA;AAAA;AAAA,EAC5E;AAEJ;AAEA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ListToolbar';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var list_toolbar_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(list_toolbar_exports);
|
|
18
|
+
__reExport(list_toolbar_exports, require("./ListToolbar.js"), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require("./ListToolbar.js")
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/list-toolbar/index.ts"],"sourcesContent":["export * from './ListToolbar';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,iCAAc,0BAAd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/list-toolbar/index.ts"],"sourcesContent":["export * from './ListToolbar';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type BadgeProps } from '../badge/Badge';
|
|
3
|
+
import { type CoverImageProps } from '../cover-image/CoverImage';
|
|
4
|
+
export type MediaCardChip = {
|
|
5
|
+
label: string;
|
|
6
|
+
/** Badge variant; quiet outline tones fit status metadata best. */
|
|
7
|
+
variant?: BadgeProps['variant'];
|
|
8
|
+
/** Leading status dot. */
|
|
9
|
+
dot?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & {
|
|
12
|
+
/** Card title. */
|
|
13
|
+
title: string;
|
|
14
|
+
/** Supporting copy under the title. */
|
|
15
|
+
description?: React.ReactNode;
|
|
16
|
+
/** Destination URL; the whole card becomes one link when set. */
|
|
17
|
+
href?: string;
|
|
18
|
+
/** Cover art rendered through CoverImage (seeded gradient fallback included). */
|
|
19
|
+
cover?: Omit<CoverImageProps, 'className'>;
|
|
20
|
+
/** Metadata line under the description (date, location, deadline). */
|
|
21
|
+
meta?: React.ReactNode;
|
|
22
|
+
/** Status/category chips rendered as Badges. */
|
|
23
|
+
chips?: MediaCardChip[];
|
|
24
|
+
/** Bottom slot for a details affordance or secondary text. Non-interactive when the card is a link. */
|
|
25
|
+
footer?: React.ReactNode;
|
|
26
|
+
/** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */
|
|
27
|
+
layout?: 'vertical' | 'row';
|
|
28
|
+
/** Custom link element for routers (Next Link, react-router). */
|
|
29
|
+
linkComponent?: React.ElementType;
|
|
30
|
+
/** Prop used to pass the destination to linkComponent ('href' or 'to'). */
|
|
31
|
+
linkHrefProp?: 'href' | 'to';
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* Media card for event, article and listing grids: CoverImage on top (or
|
|
35
|
+
* beside in `layout="row"`), title, description, metadata line, status chips
|
|
36
|
+
* and an optional footer. With `href` the entire card is a single link —
|
|
37
|
+
* one target, one hover state, one focus ring — so keep `footer` free of
|
|
38
|
+
* nested interactive elements.
|
|
39
|
+
*/
|
|
40
|
+
export declare const MediaCard: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "title"> & {
|
|
41
|
+
/** Card title. */
|
|
42
|
+
title: string;
|
|
43
|
+
/** Supporting copy under the title. */
|
|
44
|
+
description?: React.ReactNode;
|
|
45
|
+
/** Destination URL; the whole card becomes one link when set. */
|
|
46
|
+
href?: string;
|
|
47
|
+
/** Cover art rendered through CoverImage (seeded gradient fallback included). */
|
|
48
|
+
cover?: Omit<CoverImageProps, "className">;
|
|
49
|
+
/** Metadata line under the description (date, location, deadline). */
|
|
50
|
+
meta?: React.ReactNode;
|
|
51
|
+
/** Status/category chips rendered as Badges. */
|
|
52
|
+
chips?: MediaCardChip[];
|
|
53
|
+
/** Bottom slot for a details affordance or secondary text. Non-interactive when the card is a link. */
|
|
54
|
+
footer?: React.ReactNode;
|
|
55
|
+
/** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */
|
|
56
|
+
layout?: "vertical" | "row";
|
|
57
|
+
/** Custom link element for routers (Next Link, react-router). */
|
|
58
|
+
linkComponent?: React.ElementType;
|
|
59
|
+
/** Prop used to pass the destination to linkComponent ('href' or 'to'). */
|
|
60
|
+
linkHrefProp?: "href" | "to";
|
|
61
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var MediaCard_exports = {};
|
|
30
|
+
__export(MediaCard_exports, {
|
|
31
|
+
MediaCard: () => MediaCard
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(MediaCard_exports);
|
|
34
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
35
|
+
var React = __toESM(require("react"));
|
|
36
|
+
var import_cn = require("../../utils/cn.js");
|
|
37
|
+
var import_Badge = require("../badge/Badge.js");
|
|
38
|
+
var import_CoverImage = require("../cover-image/CoverImage.js");
|
|
39
|
+
const MediaCard = React.forwardRef(function MediaCard2({
|
|
40
|
+
title,
|
|
41
|
+
description,
|
|
42
|
+
href,
|
|
43
|
+
cover,
|
|
44
|
+
meta,
|
|
45
|
+
chips,
|
|
46
|
+
footer,
|
|
47
|
+
layout = "vertical",
|
|
48
|
+
linkComponent,
|
|
49
|
+
linkHrefProp = "href",
|
|
50
|
+
className,
|
|
51
|
+
...props
|
|
52
|
+
}, ref) {
|
|
53
|
+
const Link = linkComponent ?? "a";
|
|
54
|
+
const destination = href ? linkHrefProp === "to" ? { to: href } : { href } : void 0;
|
|
55
|
+
const row = layout === "row";
|
|
56
|
+
const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
57
|
+
cover && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
+
import_CoverImage.CoverImage,
|
|
59
|
+
{
|
|
60
|
+
...cover,
|
|
61
|
+
className: (0, import_cn.cn)(
|
|
62
|
+
row ? "w-36 shrink-0 sm:w-44" : "w-full",
|
|
63
|
+
!row && "rounded-none border-b border-border"
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("flex min-w-0 flex-1 flex-col gap-2", row ? "p-4" : "p-5"), children: [
|
|
68
|
+
chips && chips.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-1.5", children: chips.map((chip) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.Badge, { variant: chip.variant ?? "outline", size: "sm", dot: chip.dot, children: chip.label }, chip.label)) }),
|
|
69
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "font-semibold tracking-tight transition-colors group-hover:text-primary-ink", children: title }),
|
|
70
|
+
description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "line-clamp-3 text-sm leading-relaxed text-muted-foreground", children: description }),
|
|
71
|
+
meta && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-xs text-muted-foreground", children: meta }),
|
|
72
|
+
footer && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-auto pt-2 text-xs text-muted-foreground", children: footer })
|
|
73
|
+
] })
|
|
74
|
+
] });
|
|
75
|
+
const cardClass = (0, import_cn.cn)(
|
|
76
|
+
"group flex h-full overflow-hidden rounded-xl border border-border bg-card shadow-sm transition-colors hover:border-primary/40",
|
|
77
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
78
|
+
row ? "flex-row" : "flex-col",
|
|
79
|
+
className
|
|
80
|
+
);
|
|
81
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("article", { ref, className: "h-full", ...props, children: href && destination ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, { ...destination, className: cardClass, children: body }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: cardClass, children: body }) });
|
|
82
|
+
});
|
|
83
|
+
MediaCard.displayName = "MediaCard";
|
|
84
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
85
|
+
0 && (module.exports = {
|
|
86
|
+
MediaCard
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=MediaCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media-card/MediaCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge, type BadgeProps } from '../badge/Badge';\nimport { CoverImage, type CoverImageProps } from '../cover-image/CoverImage';\n\nexport type MediaCardChip = {\n label: string;\n /** Badge variant; quiet outline tones fit status metadata best. */\n variant?: BadgeProps['variant'];\n /** Leading status dot. */\n dot?: boolean;\n};\n\nexport type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & {\n /** Card title. */\n title: string;\n /** Supporting copy under the title. */\n description?: React.ReactNode;\n /** Destination URL; the whole card becomes one link when set. */\n href?: string;\n /** Cover art rendered through CoverImage (seeded gradient fallback included). */\n cover?: Omit<CoverImageProps, 'className'>;\n /** Metadata line under the description (date, location, deadline). */\n meta?: React.ReactNode;\n /** Status/category chips rendered as Badges. */\n chips?: MediaCardChip[];\n /** Bottom slot for a details affordance or secondary text. Non-interactive when the card is a link. */\n footer?: React.ReactNode;\n /** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */\n layout?: 'vertical' | 'row';\n /** Custom link element for routers (Next Link, react-router). */\n linkComponent?: React.ElementType;\n /** Prop used to pass the destination to linkComponent ('href' or 'to'). */\n linkHrefProp?: 'href' | 'to';\n};\n\n/**\n * Media card for event, article and listing grids: CoverImage on top (or\n * beside in `layout=\"row\"`), title, description, metadata line, status chips\n * and an optional footer. With `href` the entire card is a single link —\n * one target, one hover state, one focus ring — so keep `footer` free of\n * nested interactive elements.\n */\nexport const MediaCard = React.forwardRef<HTMLElement, MediaCardProps>(function MediaCard(\n {\n title,\n description,\n href,\n cover,\n meta,\n chips,\n footer,\n layout = 'vertical',\n linkComponent,\n linkHrefProp = 'href',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const destination = href ? (linkHrefProp === 'to' ? { to: href } : { href }) : undefined;\n const row = layout === 'row';\n\n const body = (\n <>\n {cover && (\n <CoverImage\n {...cover}\n className={cn(\n row ? 'w-36 shrink-0 sm:w-44' : 'w-full',\n !row && 'rounded-none border-b border-border'\n )}\n />\n )}\n <div className={cn('flex min-w-0 flex-1 flex-col gap-2', row ? 'p-4' : 'p-5')}>\n {chips && chips.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {chips.map((chip) => (\n <Badge key={chip.label} variant={chip.variant ?? 'outline'} size=\"sm\" dot={chip.dot}>\n {chip.label}\n </Badge>\n ))}\n </div>\n )}\n <h3 className=\"font-semibold tracking-tight transition-colors group-hover:text-primary-ink\">{title}</h3>\n {description && (\n <div className=\"line-clamp-3 text-sm leading-relaxed text-muted-foreground\">{description}</div>\n )}\n {meta && <div className=\"text-xs text-muted-foreground\">{meta}</div>}\n {footer && <div className=\"mt-auto pt-2 text-xs text-muted-foreground\">{footer}</div>}\n </div>\n </>\n );\n\n const cardClass = cn(\n 'group flex h-full overflow-hidden rounded-xl border border-border bg-card shadow-sm transition-colors hover:border-primary/40',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n row ? 'flex-row' : 'flex-col',\n className\n );\n\n return (\n <article ref={ref as never} className=\"h-full\" {...props}>\n {href && destination ? (\n <Link {...destination} className={cardClass}>\n {body}\n </Link>\n ) : (\n <div className={cardClass}>{body}</div>\n )}\n </article>\n );\n});\n\nMediaCard.displayName = 'MediaCard';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiEI;AAjEJ,YAAuB;AACvB,gBAAmB;AACnB,mBAAuC;AACvC,wBAAiD;AAwC1C,MAAM,YAAY,MAAM,WAAwC,SAASA,WAC9E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,cAAc,OAAQ,iBAAiB,OAAO,EAAE,IAAI,KAAK,IAAI,EAAE,KAAK,IAAK;AAC/E,QAAM,MAAM,WAAW;AAEvB,QAAM,OACJ,4EACG;AAAA,aACC;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,eAAW;AAAA,UACT,MAAM,0BAA0B;AAAA,UAChC,CAAC,OAAO;AAAA,QACV;AAAA;AAAA,IACF;AAAA,IAEF,6CAAC,SAAI,eAAW,cAAG,sCAAsC,MAAM,QAAQ,KAAK,GACzE;AAAA,eAAS,MAAM,SAAS,KACvB,4CAAC,SAAI,WAAU,0BACZ,gBAAM,IAAI,CAAC,SACV,4CAAC,sBAAuB,SAAS,KAAK,WAAW,WAAW,MAAK,MAAK,KAAK,KAAK,KAC7E,eAAK,SADI,KAAK,KAEjB,CACD,GACH;AAAA,MAEF,4CAAC,QAAG,WAAU,+EAA+E,iBAAM;AAAA,MAClG,eACC,4CAAC,SAAI,WAAU,8DAA8D,uBAAY;AAAA,MAE1F,QAAQ,4CAAC,SAAI,WAAU,iCAAiC,gBAAK;AAAA,MAC7D,UAAU,4CAAC,SAAI,WAAU,8CAA8C,kBAAO;AAAA,OACjF;AAAA,KACF;AAGF,QAAM,gBAAY;AAAA,IAChB;AAAA,IACA;AAAA,IACA,MAAM,aAAa;AAAA,IACnB;AAAA,EACF;AAEA,SACE,4CAAC,aAAQ,KAAmB,WAAU,UAAU,GAAG,OAChD,kBAAQ,cACP,4CAAC,QAAM,GAAG,aAAa,WAAW,WAC/B,gBACH,IAEA,4CAAC,SAAI,WAAW,WAAY,gBAAK,GAErC;AAEJ,CAAC;AAED,UAAU,cAAc;","names":["MediaCard"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { Badge } from "../badge/Badge.mjs";
|
|
5
|
+
import { CoverImage } from "../cover-image/CoverImage.mjs";
|
|
6
|
+
const MediaCard = React.forwardRef(function MediaCard2({
|
|
7
|
+
title,
|
|
8
|
+
description,
|
|
9
|
+
href,
|
|
10
|
+
cover,
|
|
11
|
+
meta,
|
|
12
|
+
chips,
|
|
13
|
+
footer,
|
|
14
|
+
layout = "vertical",
|
|
15
|
+
linkComponent,
|
|
16
|
+
linkHrefProp = "href",
|
|
17
|
+
className,
|
|
18
|
+
...props
|
|
19
|
+
}, ref) {
|
|
20
|
+
const Link = linkComponent ?? "a";
|
|
21
|
+
const destination = href ? linkHrefProp === "to" ? { to: href } : { href } : void 0;
|
|
22
|
+
const row = layout === "row";
|
|
23
|
+
const body = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
24
|
+
cover && /* @__PURE__ */ jsx(
|
|
25
|
+
CoverImage,
|
|
26
|
+
{
|
|
27
|
+
...cover,
|
|
28
|
+
className: cn(
|
|
29
|
+
row ? "w-36 shrink-0 sm:w-44" : "w-full",
|
|
30
|
+
!row && "rounded-none border-b border-border"
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsxs("div", { className: cn("flex min-w-0 flex-1 flex-col gap-2", row ? "p-4" : "p-5"), children: [
|
|
35
|
+
chips && chips.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex flex-wrap gap-1.5", children: chips.map((chip) => /* @__PURE__ */ jsx(Badge, { variant: chip.variant ?? "outline", size: "sm", dot: chip.dot, children: chip.label }, chip.label)) }),
|
|
36
|
+
/* @__PURE__ */ jsx("h3", { className: "font-semibold tracking-tight transition-colors group-hover:text-primary-ink", children: title }),
|
|
37
|
+
description && /* @__PURE__ */ jsx("div", { className: "line-clamp-3 text-sm leading-relaxed text-muted-foreground", children: description }),
|
|
38
|
+
meta && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: meta }),
|
|
39
|
+
footer && /* @__PURE__ */ jsx("div", { className: "mt-auto pt-2 text-xs text-muted-foreground", children: footer })
|
|
40
|
+
] })
|
|
41
|
+
] });
|
|
42
|
+
const cardClass = cn(
|
|
43
|
+
"group flex h-full overflow-hidden rounded-xl border border-border bg-card shadow-sm transition-colors hover:border-primary/40",
|
|
44
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
|
|
45
|
+
row ? "flex-row" : "flex-col",
|
|
46
|
+
className
|
|
47
|
+
);
|
|
48
|
+
return /* @__PURE__ */ jsx("article", { ref, className: "h-full", ...props, children: href && destination ? /* @__PURE__ */ jsx(Link, { ...destination, className: cardClass, children: body }) : /* @__PURE__ */ jsx("div", { className: cardClass, children: body }) });
|
|
49
|
+
});
|
|
50
|
+
MediaCard.displayName = "MediaCard";
|
|
51
|
+
export {
|
|
52
|
+
MediaCard
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=MediaCard.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media-card/MediaCard.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Badge, type BadgeProps } from '../badge/Badge';\nimport { CoverImage, type CoverImageProps } from '../cover-image/CoverImage';\n\nexport type MediaCardChip = {\n label: string;\n /** Badge variant; quiet outline tones fit status metadata best. */\n variant?: BadgeProps['variant'];\n /** Leading status dot. */\n dot?: boolean;\n};\n\nexport type MediaCardProps = Omit<React.HTMLAttributes<HTMLElement>, 'title'> & {\n /** Card title. */\n title: string;\n /** Supporting copy under the title. */\n description?: React.ReactNode;\n /** Destination URL; the whole card becomes one link when set. */\n href?: string;\n /** Cover art rendered through CoverImage (seeded gradient fallback included). */\n cover?: Omit<CoverImageProps, 'className'>;\n /** Metadata line under the description (date, location, deadline). */\n meta?: React.ReactNode;\n /** Status/category chips rendered as Badges. */\n chips?: MediaCardChip[];\n /** Bottom slot for a details affordance or secondary text. Non-interactive when the card is a link. */\n footer?: React.ReactNode;\n /** 'vertical' stacks cover over content; 'row' puts a fixed-width cover beside it. */\n layout?: 'vertical' | 'row';\n /** Custom link element for routers (Next Link, react-router). */\n linkComponent?: React.ElementType;\n /** Prop used to pass the destination to linkComponent ('href' or 'to'). */\n linkHrefProp?: 'href' | 'to';\n};\n\n/**\n * Media card for event, article and listing grids: CoverImage on top (or\n * beside in `layout=\"row\"`), title, description, metadata line, status chips\n * and an optional footer. With `href` the entire card is a single link —\n * one target, one hover state, one focus ring — so keep `footer` free of\n * nested interactive elements.\n */\nexport const MediaCard = React.forwardRef<HTMLElement, MediaCardProps>(function MediaCard(\n {\n title,\n description,\n href,\n cover,\n meta,\n chips,\n footer,\n layout = 'vertical',\n linkComponent,\n linkHrefProp = 'href',\n className,\n ...props\n },\n ref\n) {\n const Link = linkComponent ?? 'a';\n const destination = href ? (linkHrefProp === 'to' ? { to: href } : { href }) : undefined;\n const row = layout === 'row';\n\n const body = (\n <>\n {cover && (\n <CoverImage\n {...cover}\n className={cn(\n row ? 'w-36 shrink-0 sm:w-44' : 'w-full',\n !row && 'rounded-none border-b border-border'\n )}\n />\n )}\n <div className={cn('flex min-w-0 flex-1 flex-col gap-2', row ? 'p-4' : 'p-5')}>\n {chips && chips.length > 0 && (\n <div className=\"flex flex-wrap gap-1.5\">\n {chips.map((chip) => (\n <Badge key={chip.label} variant={chip.variant ?? 'outline'} size=\"sm\" dot={chip.dot}>\n {chip.label}\n </Badge>\n ))}\n </div>\n )}\n <h3 className=\"font-semibold tracking-tight transition-colors group-hover:text-primary-ink\">{title}</h3>\n {description && (\n <div className=\"line-clamp-3 text-sm leading-relaxed text-muted-foreground\">{description}</div>\n )}\n {meta && <div className=\"text-xs text-muted-foreground\">{meta}</div>}\n {footer && <div className=\"mt-auto pt-2 text-xs text-muted-foreground\">{footer}</div>}\n </div>\n </>\n );\n\n const cardClass = cn(\n 'group flex h-full overflow-hidden rounded-xl border border-border bg-card shadow-sm transition-colors hover:border-primary/40',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background',\n row ? 'flex-row' : 'flex-col',\n className\n );\n\n return (\n <article ref={ref as never} className=\"h-full\" {...props}>\n {href && destination ? (\n <Link {...destination} className={cardClass}>\n {body}\n </Link>\n ) : (\n <div className={cardClass}>{body}</div>\n )}\n </article>\n );\n});\n\nMediaCard.displayName = 'MediaCard';\n"],"mappings":"AAiEI,mBAEI,KAQF,YAVF;AAjEJ,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,aAA8B;AACvC,SAAS,kBAAwC;AAwC1C,MAAM,YAAY,MAAM,WAAwC,SAASA,WAC9E;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT;AAAA,EACA,eAAe;AAAA,EACf;AAAA,EACA,GAAG;AACL,GACA,KACA;AACA,QAAM,OAAO,iBAAiB;AAC9B,QAAM,cAAc,OAAQ,iBAAiB,OAAO,EAAE,IAAI,KAAK,IAAI,EAAE,KAAK,IAAK;AAC/E,QAAM,MAAM,WAAW;AAEvB,QAAM,OACJ,iCACG;AAAA,aACC;AAAA,MAAC;AAAA;AAAA,QACE,GAAG;AAAA,QACJ,WAAW;AAAA,UACT,MAAM,0BAA0B;AAAA,UAChC,CAAC,OAAO;AAAA,QACV;AAAA;AAAA,IACF;AAAA,IAEF,qBAAC,SAAI,WAAW,GAAG,sCAAsC,MAAM,QAAQ,KAAK,GACzE;AAAA,eAAS,MAAM,SAAS,KACvB,oBAAC,SAAI,WAAU,0BACZ,gBAAM,IAAI,CAAC,SACV,oBAAC,SAAuB,SAAS,KAAK,WAAW,WAAW,MAAK,MAAK,KAAK,KAAK,KAC7E,eAAK,SADI,KAAK,KAEjB,CACD,GACH;AAAA,MAEF,oBAAC,QAAG,WAAU,+EAA+E,iBAAM;AAAA,MAClG,eACC,oBAAC,SAAI,WAAU,8DAA8D,uBAAY;AAAA,MAE1F,QAAQ,oBAAC,SAAI,WAAU,iCAAiC,gBAAK;AAAA,MAC7D,UAAU,oBAAC,SAAI,WAAU,8CAA8C,kBAAO;AAAA,OACjF;AAAA,KACF;AAGF,QAAM,YAAY;AAAA,IAChB;AAAA,IACA;AAAA,IACA,MAAM,aAAa;AAAA,IACnB;AAAA,EACF;AAEA,SACE,oBAAC,aAAQ,KAAmB,WAAU,UAAU,GAAG,OAChD,kBAAQ,cACP,oBAAC,QAAM,GAAG,aAAa,WAAW,WAC/B,gBACH,IAEA,oBAAC,SAAI,WAAW,WAAY,gBAAK,GAErC;AAEJ,CAAC;AAED,UAAU,cAAc;","names":["MediaCard"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MediaCard';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var media_card_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(media_card_exports);
|
|
18
|
+
__reExport(media_card_exports, require("./MediaCard.js"), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require("./MediaCard.js")
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media-card/index.ts"],"sourcesContent":["export * from './MediaCard';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAc,wBAAd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media-card/index.ts"],"sourcesContent":["export * from './MediaCard';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type MonthScheduleLegendItem = {
|
|
3
|
+
/** Type key returned by getType. */
|
|
4
|
+
type: string;
|
|
5
|
+
/** Human-readable label shown in the legend. */
|
|
6
|
+
label: string;
|
|
7
|
+
};
|
|
8
|
+
export type MonthScheduleProps<T> = {
|
|
9
|
+
/** Events to place inside days; each is dated via getDate. */
|
|
10
|
+
events: T[];
|
|
11
|
+
/** ISO date key (YYYY-MM-DD) for an event. */
|
|
12
|
+
getDate: (event: T) => string;
|
|
13
|
+
/** Short label shown on the day chip and in the agenda. */
|
|
14
|
+
getLabel: (event: T) => string;
|
|
15
|
+
/** Optional type key used for chip color and the legend. */
|
|
16
|
+
getType?: (event: T) => string | undefined;
|
|
17
|
+
/** Optional destination per event. */
|
|
18
|
+
getHref?: (event: T) => string | undefined;
|
|
19
|
+
/** Controlled month as YYYY-MM. Falls back to defaultMonth, then today. */
|
|
20
|
+
month?: string;
|
|
21
|
+
/** Uncontrolled initial month (YYYY-MM). */
|
|
22
|
+
defaultMonth?: string;
|
|
23
|
+
/** Called with the new YYYY-MM when paging. */
|
|
24
|
+
onMonthChange?: (month: string) => void;
|
|
25
|
+
/** Override "today" for deterministic server rendering and tests. */
|
|
26
|
+
today?: string;
|
|
27
|
+
/** BCP-47 locale for month, weekday and agenda labels. */
|
|
28
|
+
locale?: string;
|
|
29
|
+
/** 0 starts the week on Sunday, 1 on Monday. */
|
|
30
|
+
weekStartsOn?: 0 | 1;
|
|
31
|
+
/** Maximum event chips per day before collapsing into "+N more". */
|
|
32
|
+
maxPerDay?: number;
|
|
33
|
+
/** Type key → label/color entries rendered as a legend under the grid. */
|
|
34
|
+
legend?: MonthScheduleLegendItem[];
|
|
35
|
+
/**
|
|
36
|
+
* Below this breakpoint an agenda list replaces the day grid:
|
|
37
|
+
* 'sm' swaps under 640px, 'md' under 768px.
|
|
38
|
+
*/
|
|
39
|
+
agendaBreakpoint?: 'sm' | 'md';
|
|
40
|
+
/** Custom link element for event hrefs (Next Link, react-router). */
|
|
41
|
+
linkComponent?: React.ElementType;
|
|
42
|
+
/** Prop used to pass the destination to linkComponent ('href' or 'to'). */
|
|
43
|
+
linkHrefProp?: 'href' | 'to';
|
|
44
|
+
'aria-label'?: string;
|
|
45
|
+
className?: string;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Month schedule: a month grid with dated events rendered inside each day,
|
|
49
|
+
* plus a legend and a small-screen agenda. Built on the same date utilities
|
|
50
|
+
* as Calendar; `today` stays explicit so server-rendered pages never read the
|
|
51
|
+
* server clock.
|
|
52
|
+
*/
|
|
53
|
+
export declare function MonthSchedule<T>({ events, getDate, getLabel, getType, getHref, month, defaultMonth, onMonthChange, today, locale, weekStartsOn, maxPerDay, legend, agendaBreakpoint, linkComponent, linkHrefProp, 'aria-label': ariaLabel, className, }: MonthScheduleProps<T>): React.JSX.Element;
|
|
54
|
+
export declare namespace MonthSchedule {
|
|
55
|
+
var displayName: string;
|
|
56
|
+
}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all)
|
|
11
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
12
|
+
};
|
|
13
|
+
var __copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
+
for (let key of __getOwnPropNames(from))
|
|
16
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
+
}
|
|
19
|
+
return to;
|
|
20
|
+
};
|
|
21
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
+
mod
|
|
28
|
+
));
|
|
29
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
30
|
+
var MonthSchedule_exports = {};
|
|
31
|
+
__export(MonthSchedule_exports, {
|
|
32
|
+
MonthSchedule: () => MonthSchedule
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(MonthSchedule_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var React = __toESM(require("react"));
|
|
37
|
+
var import_cn = require("../../utils/cn.js");
|
|
38
|
+
var import_date = require("../../utils/date.js");
|
|
39
|
+
var import_Badge = require("../badge/Badge.js");
|
|
40
|
+
var import_button = require("../button/index.js");
|
|
41
|
+
const TYPE_TONES = [
|
|
42
|
+
"outline-info",
|
|
43
|
+
"outline-success",
|
|
44
|
+
"outline-warning",
|
|
45
|
+
"outline-danger",
|
|
46
|
+
"outline"
|
|
47
|
+
];
|
|
48
|
+
function typeTone(type, legend) {
|
|
49
|
+
if (!type) return "outline";
|
|
50
|
+
const index = legend?.findIndex((item) => item.type === type) ?? -1;
|
|
51
|
+
if (index >= 0) return TYPE_TONES[index % TYPE_TONES.length];
|
|
52
|
+
let hash = 0;
|
|
53
|
+
for (let i = 0; i < type.length; i += 1) hash = hash * 31 + type.charCodeAt(i) >>> 0;
|
|
54
|
+
return TYPE_TONES[hash % TYPE_TONES.length];
|
|
55
|
+
}
|
|
56
|
+
function monthOf(key) {
|
|
57
|
+
const parts = (0, import_date.parseDateKey)(`${key}-01`);
|
|
58
|
+
return { year: parts?.year ?? 1970, month: parts?.month ?? 0 };
|
|
59
|
+
}
|
|
60
|
+
function shiftMonth(monthKey, delta) {
|
|
61
|
+
const { year, month } = monthOf(monthKey);
|
|
62
|
+
const shifted = (0, import_date.addMonths)(`${year}-${String(month + 1).padStart(2, "0")}-01`, delta);
|
|
63
|
+
return shifted.slice(0, 7);
|
|
64
|
+
}
|
|
65
|
+
function MonthSchedule({
|
|
66
|
+
events,
|
|
67
|
+
getDate,
|
|
68
|
+
getLabel,
|
|
69
|
+
getType,
|
|
70
|
+
getHref,
|
|
71
|
+
month,
|
|
72
|
+
defaultMonth,
|
|
73
|
+
onMonthChange,
|
|
74
|
+
today,
|
|
75
|
+
locale = "en-US",
|
|
76
|
+
weekStartsOn = 0,
|
|
77
|
+
maxPerDay = 3,
|
|
78
|
+
legend,
|
|
79
|
+
agendaBreakpoint = "md",
|
|
80
|
+
linkComponent,
|
|
81
|
+
linkHrefProp = "href",
|
|
82
|
+
"aria-label": ariaLabel,
|
|
83
|
+
className
|
|
84
|
+
}) {
|
|
85
|
+
const resolvedToday = today ?? (0, import_date.todayKey)();
|
|
86
|
+
const Link = linkComponent ?? "a";
|
|
87
|
+
const [internalMonth, setInternalMonth] = React.useState(
|
|
88
|
+
() => month ?? defaultMonth ?? resolvedToday.slice(0, 7)
|
|
89
|
+
);
|
|
90
|
+
const activeMonth = month ?? internalMonth;
|
|
91
|
+
const { year, month: monthIndex } = monthOf(activeMonth);
|
|
92
|
+
const byDay = React.useMemo(() => {
|
|
93
|
+
const map = /* @__PURE__ */ new Map();
|
|
94
|
+
for (const event of events) {
|
|
95
|
+
const key = getDate(event);
|
|
96
|
+
const list = map.get(key);
|
|
97
|
+
if (list) list.push(event);
|
|
98
|
+
else map.set(key, [event]);
|
|
99
|
+
}
|
|
100
|
+
for (const list of map.values()) {
|
|
101
|
+
list.sort((a, b) => getLabel(a).localeCompare(getLabel(b)));
|
|
102
|
+
}
|
|
103
|
+
return map;
|
|
104
|
+
}, [events, getDate, getLabel]);
|
|
105
|
+
const weeks = React.useMemo(
|
|
106
|
+
() => (0, import_date.calendarWeeks)(year, monthIndex, weekStartsOn),
|
|
107
|
+
[year, monthIndex, weekStartsOn]
|
|
108
|
+
);
|
|
109
|
+
const weekdays = React.useMemo(
|
|
110
|
+
() => (0, import_date.weekdayLabels)(locale, weekStartsOn),
|
|
111
|
+
[locale, weekStartsOn]
|
|
112
|
+
);
|
|
113
|
+
const monthName = (0, import_date.monthLabel)(year, monthIndex, locale);
|
|
114
|
+
const agendaDays = React.useMemo(
|
|
115
|
+
() => [...byDay.keys()].filter((key) => key.startsWith(activeMonth)).sort().map((key) => ({ key, items: byDay.get(key) ?? [] })),
|
|
116
|
+
[byDay, activeMonth]
|
|
117
|
+
);
|
|
118
|
+
const page = (delta) => {
|
|
119
|
+
const next = shiftMonth(activeMonth, delta);
|
|
120
|
+
if (month === void 0) setInternalMonth(next);
|
|
121
|
+
onMonthChange?.(next);
|
|
122
|
+
};
|
|
123
|
+
const renderEvent = (event, key) => {
|
|
124
|
+
const label = getLabel(event);
|
|
125
|
+
const type = getType?.(event);
|
|
126
|
+
const tone = typeTone(type, legend);
|
|
127
|
+
const href = getHref?.(event);
|
|
128
|
+
const chip = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.Badge, { variant: tone, size: "sm", className: "max-w-full truncate", children: label });
|
|
129
|
+
if (!href) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: chip }, key);
|
|
130
|
+
const destination = linkHrefProp === "to" ? { to: href } : { href };
|
|
131
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
132
|
+
Link,
|
|
133
|
+
{
|
|
134
|
+
...destination,
|
|
135
|
+
className: "block max-w-full rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
136
|
+
children: chip
|
|
137
|
+
},
|
|
138
|
+
key
|
|
139
|
+
);
|
|
140
|
+
};
|
|
141
|
+
const gridHidden = agendaBreakpoint === "sm" ? "hidden sm:block" : "hidden md:block";
|
|
142
|
+
const agendaHidden = agendaBreakpoint === "sm" ? "sm:hidden" : "md:hidden";
|
|
143
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("w-full select-none", className), children: [
|
|
144
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-2 flex items-center justify-between gap-2", children: [
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
146
|
+
import_button.Button,
|
|
147
|
+
{
|
|
148
|
+
type: "button",
|
|
149
|
+
variant: "ghost",
|
|
150
|
+
size: "icon",
|
|
151
|
+
"aria-label": "Previous month",
|
|
152
|
+
onClick: () => page(-1),
|
|
153
|
+
children: "\u2039"
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { "aria-live": "polite", className: "text-sm font-semibold text-foreground", children: monthName }),
|
|
157
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
158
|
+
import_button.Button,
|
|
159
|
+
{
|
|
160
|
+
type: "button",
|
|
161
|
+
variant: "ghost",
|
|
162
|
+
size: "icon",
|
|
163
|
+
"aria-label": "Next month",
|
|
164
|
+
onClick: () => page(1),
|
|
165
|
+
children: "\u203A"
|
|
166
|
+
}
|
|
167
|
+
)
|
|
168
|
+
] }),
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
170
|
+
"div",
|
|
171
|
+
{
|
|
172
|
+
role: "grid",
|
|
173
|
+
"aria-label": ariaLabel ?? monthName,
|
|
174
|
+
className: (0, import_cn.cn)("flex flex-col gap-1", gridHidden),
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { role: "row", className: "grid grid-cols-7 gap-1 text-center text-xs text-muted-foreground", children: weekdays.map((weekday) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { role: "columnheader", "aria-label": weekday, className: "py-1", children: weekday }, weekday)) }),
|
|
177
|
+
weeks.map((week) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { role: "row", className: "grid grid-cols-7 gap-1", children: week.map((day) => {
|
|
178
|
+
const dayEvents = byDay.get(day.key) ?? [];
|
|
179
|
+
const visible = dayEvents.slice(0, maxPerDay);
|
|
180
|
+
const overflow = dayEvents.length - visible.length;
|
|
181
|
+
const isToday = day.key === resolvedToday;
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
183
|
+
"div",
|
|
184
|
+
{
|
|
185
|
+
role: "gridcell",
|
|
186
|
+
"aria-current": isToday ? "date" : void 0,
|
|
187
|
+
className: (0, import_cn.cn)(
|
|
188
|
+
"flex min-h-16 flex-col gap-0.5 rounded-md border border-transparent p-1",
|
|
189
|
+
!day.inMonth && "opacity-50",
|
|
190
|
+
isToday && "border-primary/40 bg-primary/5"
|
|
191
|
+
),
|
|
192
|
+
children: [
|
|
193
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
194
|
+
"span",
|
|
195
|
+
{
|
|
196
|
+
className: (0, import_cn.cn)(
|
|
197
|
+
"self-start px-1 text-xs tabular-nums",
|
|
198
|
+
isToday ? "font-semibold text-primary-ink" : "text-muted-foreground"
|
|
199
|
+
),
|
|
200
|
+
children: day.day
|
|
201
|
+
}
|
|
202
|
+
),
|
|
203
|
+
visible.map(
|
|
204
|
+
(event, index) => renderEvent(event, `${day.key}-${index}-${getLabel(event)}`)
|
|
205
|
+
),
|
|
206
|
+
overflow > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "px-1 text-[11px] text-muted-foreground", children: [
|
|
207
|
+
"+",
|
|
208
|
+
overflow,
|
|
209
|
+
" more"
|
|
210
|
+
] })
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
day.key
|
|
214
|
+
);
|
|
215
|
+
}) }, week[0]?.key))
|
|
216
|
+
]
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("flex flex-col gap-3", agendaHidden), children: agendaDays.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "py-6 text-center text-sm text-muted-foreground", children: "No events this month." }) : agendaDays.map(({ key, items }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { "aria-label": (0, import_date.formatDateLabel)(key, locale), children: [
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { className: "mb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: (0, import_date.formatDateLabel)(key, locale) }),
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex flex-col gap-1", children: items.map((event, index) => {
|
|
222
|
+
const label = getLabel(event);
|
|
223
|
+
const type = getType?.(event);
|
|
224
|
+
const tone = typeTone(type, legend);
|
|
225
|
+
const href = getHref?.(event);
|
|
226
|
+
const row = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.Badge, { variant: tone, size: "sm", className: "max-w-full truncate", children: label });
|
|
227
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: href ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
228
|
+
Link,
|
|
229
|
+
{
|
|
230
|
+
...linkHrefProp === "to" ? { to: href } : { href },
|
|
231
|
+
className: "block max-w-full rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
232
|
+
children: row
|
|
233
|
+
}
|
|
234
|
+
) : row }, `${key}-${index}-${label}`);
|
|
235
|
+
}) })
|
|
236
|
+
] }, key)) }),
|
|
237
|
+
legend && legend.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "mt-3 flex flex-wrap gap-x-4 gap-y-1", "aria-label": "Event types", children: legend.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Badge.Badge, { variant: typeTone(item.type, legend), size: "sm", children: item.label }) }, item.type)) })
|
|
238
|
+
] });
|
|
239
|
+
}
|
|
240
|
+
MonthSchedule.displayName = "MonthSchedule";
|
|
241
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
242
|
+
0 && (module.exports = {
|
|
243
|
+
MonthSchedule
|
|
244
|
+
});
|
|
245
|
+
//# sourceMappingURL=MonthSchedule.js.map
|