@slipstream-ui/core 0.8.0 → 0.9.0
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 +184 -8
- package/dist/index.d.ts +184 -8
- package/dist/index.js +1609 -887
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1651 -933
- package/dist/index.mjs.map +1 -1
- package/dist/manifests/accordion.manifest.json +2 -2
- 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 +1 -1
- package/dist/manifests/calendar.manifest.json +175 -0
- 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/cta-section.manifest.json +1 -1
- package/dist/manifests/data-table.manifest.json +8 -1
- package/dist/manifests/date-picker-popover.manifest.json +202 -0
- 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 +142 -0
- 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.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/menu.manifest.json +1 -1
- package/dist/manifests/metric-card.manifest.json +1 -1
- 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 +86 -4
- 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 +1 -1
- 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 +13 -3
- 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 +7 -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/alert/Alert.js +1 -1
- package/dist/src/components/alert/Alert.js.map +1 -1
- package/dist/src/components/alert/Alert.mjs +1 -1
- package/dist/src/components/alert/Alert.mjs.map +1 -1
- package/dist/src/components/app-shell/AppShell.js +1 -1
- package/dist/src/components/app-shell/AppShell.js.map +1 -1
- package/dist/src/components/app-shell/AppShell.mjs +1 -1
- package/dist/src/components/app-shell/AppShell.mjs.map +1 -1
- package/dist/src/components/article-card/ArticleCard.js +2 -2
- package/dist/src/components/article-card/ArticleCard.js.map +1 -1
- package/dist/src/components/article-card/ArticleCard.mjs +2 -2
- package/dist/src/components/article-card/ArticleCard.mjs.map +1 -1
- package/dist/src/components/calendar/Calendar.d.ts +34 -0
- package/dist/src/components/calendar/Calendar.js +233 -0
- package/dist/src/components/calendar/Calendar.js.map +1 -0
- package/dist/src/components/calendar/Calendar.mjs +208 -0
- package/dist/src/components/calendar/Calendar.mjs.map +1 -0
- package/dist/src/components/calendar/index.d.ts +1 -0
- package/dist/src/components/calendar/index.js +23 -0
- package/dist/src/components/calendar/index.js.map +1 -0
- package/dist/src/components/calendar/index.mjs +2 -0
- package/dist/src/components/calendar/index.mjs.map +1 -0
- package/dist/src/components/comparison-table/ComparisonTable.js +1 -1
- package/dist/src/components/comparison-table/ComparisonTable.js.map +1 -1
- package/dist/src/components/comparison-table/ComparisonTable.mjs +1 -1
- package/dist/src/components/comparison-table/ComparisonTable.mjs.map +1 -1
- package/dist/src/components/cta-section/CTASection.js +1 -1
- package/dist/src/components/cta-section/CTASection.js.map +1 -1
- package/dist/src/components/cta-section/CTASection.mjs +1 -1
- package/dist/src/components/cta-section/CTASection.mjs.map +1 -1
- package/dist/src/components/data-table/DataTable.d.ts +3 -1
- package/dist/src/components/data-table/DataTable.js +2 -4
- package/dist/src/components/data-table/DataTable.js.map +1 -1
- package/dist/src/components/data-table/DataTable.mjs +2 -4
- package/dist/src/components/data-table/DataTable.mjs.map +1 -1
- package/dist/src/components/date-picker-popover/DatePickerPopover.d.ts +33 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.js +117 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.js.map +1 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.mjs +83 -0
- package/dist/src/components/date-picker-popover/DatePickerPopover.mjs.map +1 -0
- package/dist/src/components/date-picker-popover/index.d.ts +1 -0
- package/dist/src/components/date-picker-popover/index.js +23 -0
- package/dist/src/components/date-picker-popover/index.js.map +1 -0
- package/dist/src/components/date-picker-popover/index.mjs +2 -0
- package/dist/src/components/date-picker-popover/index.mjs.map +1 -0
- package/dist/src/components/image/Image.d.ts +34 -0
- package/dist/src/components/image/Image.js +75 -0
- package/dist/src/components/image/Image.js.map +1 -0
- package/dist/src/components/image/Image.mjs +41 -0
- package/dist/src/components/image/Image.mjs.map +1 -0
- package/dist/src/components/image/index.d.ts +1 -0
- package/dist/src/components/image/index.js +29 -0
- package/dist/src/components/image/index.js.map +1 -0
- package/dist/src/components/image/index.mjs +5 -0
- package/dist/src/components/image/index.mjs.map +1 -0
- package/dist/src/components/link/Link.js +4 -4
- package/dist/src/components/link/Link.js.map +1 -1
- package/dist/src/components/link/Link.mjs +4 -4
- package/dist/src/components/link/Link.mjs.map +1 -1
- package/dist/src/components/page-header/PageHeader.js +1 -1
- package/dist/src/components/page-header/PageHeader.js.map +1 -1
- package/dist/src/components/page-header/PageHeader.mjs +1 -1
- package/dist/src/components/page-header/PageHeader.mjs.map +1 -1
- package/dist/src/components/popover/Popover.d.ts +36 -3
- package/dist/src/components/popover/Popover.js +118 -22
- package/dist/src/components/popover/Popover.js.map +1 -1
- package/dist/src/components/popover/Popover.mjs +117 -22
- package/dist/src/components/popover/Popover.mjs.map +1 -1
- package/dist/src/components/section-heading/SectionHeading.js +1 -1
- package/dist/src/components/section-heading/SectionHeading.js.map +1 -1
- package/dist/src/components/section-heading/SectionHeading.mjs +1 -1
- package/dist/src/components/section-heading/SectionHeading.mjs.map +1 -1
- package/dist/src/components/site-header/SiteHeader.d.ts +25 -3
- package/dist/src/components/site-header/SiteHeader.js +141 -6
- package/dist/src/components/site-header/SiteHeader.js.map +1 -1
- package/dist/src/components/site-header/SiteHeader.mjs +141 -6
- package/dist/src/components/site-header/SiteHeader.mjs.map +1 -1
- package/dist/src/components/stepper/Stepper.d.ts +18 -0
- package/dist/src/components/stepper/Stepper.js +2 -1
- package/dist/src/components/stepper/Stepper.js.map +1 -1
- package/dist/src/components/stepper/Stepper.mjs +2 -1
- package/dist/src/components/stepper/Stepper.mjs.map +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/utils/date.d.ts +32 -0
- package/dist/src/utils/date.js +171 -0
- package/dist/src/utils/date.js.map +1 -0
- package/dist/src/utils/date.mjs +134 -0
- package/dist/src/utils/date.mjs.map +1 -0
- package/dist/src/utils/position.d.ts +42 -0
- package/dist/src/utils/position.js +91 -0
- package/dist/src/utils/position.js.map +1 -0
- package/dist/src/utils/position.mjs +67 -0
- package/dist/src/utils/position.mjs.map +1 -0
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/src/components/alert/Alert.tsx +1 -1
- package/src/components/app-shell/AppShell.tsx +1 -1
- package/src/components/article-card/ArticleCard.tsx +2 -2
- package/src/components/calendar/Calendar.test.tsx +277 -0
- package/src/components/calendar/Calendar.tsx +273 -0
- package/src/components/calendar/index.ts +1 -0
- package/src/components/comparison-table/ComparisonTable.tsx +1 -1
- package/src/components/cta-section/CTASection.tsx +1 -1
- package/src/components/data-table/DataTable.test.tsx +21 -0
- package/src/components/data-table/DataTable.tsx +4 -1
- package/src/components/date-picker-popover/DatePickerPopover.test.tsx +223 -0
- package/src/components/date-picker-popover/DatePickerPopover.tsx +117 -0
- package/src/components/date-picker-popover/index.ts +1 -0
- package/src/components/image/Image.test.tsx +94 -0
- package/src/components/image/Image.tsx +71 -0
- package/src/components/image/index.ts +1 -0
- package/src/components/link/Link.test.tsx +2 -1
- package/src/components/link/Link.tsx +4 -4
- package/src/components/page-header/PageHeader.tsx +1 -1
- package/src/components/popover/Popover.test.tsx +307 -3
- package/src/components/popover/Popover.tsx +228 -91
- package/src/components/section-heading/SectionHeading.tsx +1 -1
- package/src/components/site-header/SiteHeader.test.tsx +103 -1
- package/src/components/site-header/SiteHeader.tsx +220 -16
- package/src/components/stepper/Stepper.test.tsx +12 -0
- package/src/components/stepper/Stepper.tsx +15 -1
- package/src/index.ts +3 -0
- package/src/manifests/accordion.manifest.json +2 -2
- 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 +1 -1
- package/src/manifests/calendar.manifest.json +175 -0
- 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/cta-section.manifest.json +1 -1
- package/src/manifests/data-table.manifest.json +8 -1
- package/src/manifests/date-picker-popover.manifest.json +202 -0
- 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 +142 -0
- 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.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/menu.manifest.json +1 -1
- package/src/manifests/metric-card.manifest.json +1 -1
- 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 +86 -4
- 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 +1 -1
- 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 +13 -3
- 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 +7 -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
- package/src/utils/date.test.ts +190 -0
- package/src/utils/date.ts +162 -0
- package/src/utils/position.test.ts +227 -0
- package/src/utils/position.ts +129 -0
|
@@ -0,0 +1,117 @@
|
|
|
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 DatePickerPopover_exports = {};
|
|
31
|
+
__export(DatePickerPopover_exports, {
|
|
32
|
+
DatePickerPopover: () => DatePickerPopover
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(DatePickerPopover_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_button = require("../button/index.js");
|
|
40
|
+
var import_calendar = require("../calendar/index.js");
|
|
41
|
+
var import_popover = require("../popover/index.js");
|
|
42
|
+
const DatePickerPopover = React.forwardRef(
|
|
43
|
+
({
|
|
44
|
+
value,
|
|
45
|
+
onValueChange,
|
|
46
|
+
min,
|
|
47
|
+
max,
|
|
48
|
+
today,
|
|
49
|
+
locale = "en-US",
|
|
50
|
+
weekStartsOn = 0,
|
|
51
|
+
placeholder = "Pick a date",
|
|
52
|
+
name,
|
|
53
|
+
required,
|
|
54
|
+
disabled,
|
|
55
|
+
side = "bottom",
|
|
56
|
+
align = "start",
|
|
57
|
+
id,
|
|
58
|
+
className,
|
|
59
|
+
"aria-label": ariaLabel
|
|
60
|
+
}, ref) => {
|
|
61
|
+
const [open, setOpen] = React.useState(false);
|
|
62
|
+
const triggerRef = React.useRef(null);
|
|
63
|
+
const setTriggerRef = React.useCallback(
|
|
64
|
+
(node) => {
|
|
65
|
+
triggerRef.current = node;
|
|
66
|
+
if (typeof ref === "function") ref(node);
|
|
67
|
+
else if (ref) ref.current = node;
|
|
68
|
+
},
|
|
69
|
+
[ref]
|
|
70
|
+
);
|
|
71
|
+
const label = value ? (0, import_date.formatDateLabel)(value, locale) : placeholder;
|
|
72
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_popover.Popover, { open, onOpenChange: setOpen, children: [
|
|
74
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
75
|
+
import_popover.PopoverTrigger,
|
|
76
|
+
{
|
|
77
|
+
ref: setTriggerRef,
|
|
78
|
+
id,
|
|
79
|
+
disabled,
|
|
80
|
+
"aria-label": ariaLabel,
|
|
81
|
+
className: (0, import_cn.cn)(
|
|
82
|
+
(0, import_button.buttonVariants)({ variant: "outline" }),
|
|
83
|
+
"w-full justify-start font-normal",
|
|
84
|
+
!value && "text-muted-foreground",
|
|
85
|
+
className
|
|
86
|
+
),
|
|
87
|
+
children: label
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_popover.PopoverContent, { side, align, matchTriggerWidth: true, className: "w-auto p-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
91
|
+
import_calendar.Calendar,
|
|
92
|
+
{
|
|
93
|
+
value,
|
|
94
|
+
min,
|
|
95
|
+
max,
|
|
96
|
+
today,
|
|
97
|
+
locale,
|
|
98
|
+
weekStartsOn,
|
|
99
|
+
autoFocus: true,
|
|
100
|
+
onValueChange: (next) => {
|
|
101
|
+
onValueChange?.(next);
|
|
102
|
+
setOpen(false);
|
|
103
|
+
triggerRef.current?.focus();
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
) })
|
|
107
|
+
] }),
|
|
108
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("input", { type: "hidden", name, value: value ?? "", required }) : null
|
|
109
|
+
] });
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
DatePickerPopover.displayName = "DatePickerPopover";
|
|
113
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
114
|
+
0 && (module.exports = {
|
|
115
|
+
DatePickerPopover
|
|
116
|
+
});
|
|
117
|
+
//# sourceMappingURL=DatePickerPopover.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-picker-popover/DatePickerPopover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { formatDateLabel } from '../../utils/date';\nimport { buttonVariants } from '../button';\nimport { Calendar } from '../calendar';\nimport { Popover, PopoverContent, PopoverTrigger } from '../popover';\n\nexport type DatePickerPopoverProps = {\n /** Selected date as an ISO key (`YYYY-MM-DD`). */\n value?: string;\n /** Called with the ISO key when a day is chosen. */\n onValueChange?: (value: string) => void;\n /** Earliest selectable day, inclusive. */\n min?: string;\n /** Latest selectable day, inclusive. */\n max?: string;\n /** Override \"today\" for deterministic rendering. */\n today?: string;\n locale?: string;\n weekStartsOn?: 0 | 1;\n /** Text shown before a date is chosen. */\n placeholder?: string;\n /** Renders a hidden input so the value posts with a native form. */\n name?: string;\n required?: boolean;\n disabled?: boolean;\n /** Preferred side of the field; flips when it cannot fit. */\n side?: 'top' | 'right' | 'bottom' | 'left';\n align?: 'start' | 'center' | 'end';\n id?: string;\n className?: string;\n 'aria-label'?: string;\n};\n\n/**\n * Date field with a month-grid panel. Values stay ISO `YYYY-MM-DD` strings, so\n * a browser in a different zone cannot shift the chosen day.\n */\nconst DatePickerPopover = React.forwardRef<HTMLButtonElement, DatePickerPopoverProps>(\n (\n {\n value,\n onValueChange,\n min,\n max,\n today,\n locale = 'en-US',\n weekStartsOn = 0,\n placeholder = 'Pick a date',\n name,\n required,\n disabled,\n side = 'bottom',\n align = 'start',\n id,\n className,\n 'aria-label': ariaLabel,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false);\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\n const setTriggerRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref]\n );\n\n const label = value ? formatDateLabel(value, locale) : placeholder;\n\n return (\n <>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={setTriggerRef}\n id={id}\n disabled={disabled}\n aria-label={ariaLabel}\n className={cn(\n buttonVariants({ variant: 'outline' }),\n 'w-full justify-start font-normal',\n !value && 'text-muted-foreground',\n className\n )}\n >\n {label}\n </PopoverTrigger>\n <PopoverContent side={side} align={align} matchTriggerWidth className=\"w-auto p-3\">\n <Calendar\n value={value}\n min={min}\n max={max}\n today={today}\n locale={locale}\n weekStartsOn={weekStartsOn}\n autoFocus\n onValueChange={(next) => {\n onValueChange?.(next);\n setOpen(false);\n triggerRef.current?.focus();\n }}\n />\n </PopoverContent>\n </Popover>\n {name ? <input type=\"hidden\" name={name} value={value ?? ''} required={required} /> : null}\n </>\n );\n }\n);\nDatePickerPopover.displayName = 'DatePickerPopover';\n\nexport { DatePickerPopover };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA4EM;AA1EN,YAAuB;AACvB,gBAAmB;AACnB,kBAAgC;AAChC,oBAA+B;AAC/B,sBAAyB;AACzB,qBAAwD;AAiCxD,MAAM,oBAAoB,MAAM;AAAA,EAC9B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,eAAe;AAAA,IACf,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,cAAc;AAAA,EAChB,GACA,QACG;AACH,UAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,UAAM,aAAa,MAAM,OAAiC,IAAI;AAC9D,UAAM,gBAAgB,MAAM;AAAA,MAC1B,CAAC,SAAmC;AAClC,mBAAW,UAAU;AACrB,YAAI,OAAO,QAAQ,WAAY,KAAI,IAAI;AAAA,iBAC9B,IAAK,KAAI,UAAU;AAAA,MAC9B;AAAA,MACA,CAAC,GAAG;AAAA,IACN;AAEA,UAAM,QAAQ,YAAQ,6BAAgB,OAAO,MAAM,IAAI;AAEvD,WACE,4EACE;AAAA,mDAAC,0BAAQ,MAAY,cAAc,SACjC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL;AAAA,YACA;AAAA,YACA,cAAY;AAAA,YACZ,eAAW;AAAA,kBACT,8BAAe,EAAE,SAAS,UAAU,CAAC;AAAA,cACrC;AAAA,cACA,CAAC,SAAS;AAAA,cACV;AAAA,YACF;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QACA,4CAAC,iCAAe,MAAY,OAAc,mBAAiB,MAAC,WAAU,cACpE;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAS;AAAA,YACT,eAAe,CAAC,SAAS;AACvB,8BAAgB,IAAI;AACpB,sBAAQ,KAAK;AACb,yBAAW,SAAS,MAAM;AAAA,YAC5B;AAAA;AAAA,QACF,GACF;AAAA,SACF;AAAA,MACC,OAAO,4CAAC,WAAM,MAAK,UAAS,MAAY,OAAO,SAAS,IAAI,UAAoB,IAAK;AAAA,OACxF;AAAA,EAEJ;AACF;AACA,kBAAkB,cAAc;","names":[]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
import { formatDateLabel } from "../../utils/date.mjs";
|
|
6
|
+
import { buttonVariants } from "../button/index.mjs";
|
|
7
|
+
import { Calendar } from "../calendar/index.mjs";
|
|
8
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../popover/index.mjs";
|
|
9
|
+
const DatePickerPopover = React.forwardRef(
|
|
10
|
+
({
|
|
11
|
+
value,
|
|
12
|
+
onValueChange,
|
|
13
|
+
min,
|
|
14
|
+
max,
|
|
15
|
+
today,
|
|
16
|
+
locale = "en-US",
|
|
17
|
+
weekStartsOn = 0,
|
|
18
|
+
placeholder = "Pick a date",
|
|
19
|
+
name,
|
|
20
|
+
required,
|
|
21
|
+
disabled,
|
|
22
|
+
side = "bottom",
|
|
23
|
+
align = "start",
|
|
24
|
+
id,
|
|
25
|
+
className,
|
|
26
|
+
"aria-label": ariaLabel
|
|
27
|
+
}, ref) => {
|
|
28
|
+
const [open, setOpen] = React.useState(false);
|
|
29
|
+
const triggerRef = React.useRef(null);
|
|
30
|
+
const setTriggerRef = React.useCallback(
|
|
31
|
+
(node) => {
|
|
32
|
+
triggerRef.current = node;
|
|
33
|
+
if (typeof ref === "function") ref(node);
|
|
34
|
+
else if (ref) ref.current = node;
|
|
35
|
+
},
|
|
36
|
+
[ref]
|
|
37
|
+
);
|
|
38
|
+
const label = value ? formatDateLabel(value, locale) : placeholder;
|
|
39
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
40
|
+
/* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
41
|
+
/* @__PURE__ */ jsx(
|
|
42
|
+
PopoverTrigger,
|
|
43
|
+
{
|
|
44
|
+
ref: setTriggerRef,
|
|
45
|
+
id,
|
|
46
|
+
disabled,
|
|
47
|
+
"aria-label": ariaLabel,
|
|
48
|
+
className: cn(
|
|
49
|
+
buttonVariants({ variant: "outline" }),
|
|
50
|
+
"w-full justify-start font-normal",
|
|
51
|
+
!value && "text-muted-foreground",
|
|
52
|
+
className
|
|
53
|
+
),
|
|
54
|
+
children: label
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ jsx(PopoverContent, { side, align, matchTriggerWidth: true, className: "w-auto p-3", children: /* @__PURE__ */ jsx(
|
|
58
|
+
Calendar,
|
|
59
|
+
{
|
|
60
|
+
value,
|
|
61
|
+
min,
|
|
62
|
+
max,
|
|
63
|
+
today,
|
|
64
|
+
locale,
|
|
65
|
+
weekStartsOn,
|
|
66
|
+
autoFocus: true,
|
|
67
|
+
onValueChange: (next) => {
|
|
68
|
+
onValueChange?.(next);
|
|
69
|
+
setOpen(false);
|
|
70
|
+
triggerRef.current?.focus();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
) })
|
|
74
|
+
] }),
|
|
75
|
+
name ? /* @__PURE__ */ jsx("input", { type: "hidden", name, value: value ?? "", required }) : null
|
|
76
|
+
] });
|
|
77
|
+
}
|
|
78
|
+
);
|
|
79
|
+
DatePickerPopover.displayName = "DatePickerPopover";
|
|
80
|
+
export {
|
|
81
|
+
DatePickerPopover
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=DatePickerPopover.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-picker-popover/DatePickerPopover.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { formatDateLabel } from '../../utils/date';\nimport { buttonVariants } from '../button';\nimport { Calendar } from '../calendar';\nimport { Popover, PopoverContent, PopoverTrigger } from '../popover';\n\nexport type DatePickerPopoverProps = {\n /** Selected date as an ISO key (`YYYY-MM-DD`). */\n value?: string;\n /** Called with the ISO key when a day is chosen. */\n onValueChange?: (value: string) => void;\n /** Earliest selectable day, inclusive. */\n min?: string;\n /** Latest selectable day, inclusive. */\n max?: string;\n /** Override \"today\" for deterministic rendering. */\n today?: string;\n locale?: string;\n weekStartsOn?: 0 | 1;\n /** Text shown before a date is chosen. */\n placeholder?: string;\n /** Renders a hidden input so the value posts with a native form. */\n name?: string;\n required?: boolean;\n disabled?: boolean;\n /** Preferred side of the field; flips when it cannot fit. */\n side?: 'top' | 'right' | 'bottom' | 'left';\n align?: 'start' | 'center' | 'end';\n id?: string;\n className?: string;\n 'aria-label'?: string;\n};\n\n/**\n * Date field with a month-grid panel. Values stay ISO `YYYY-MM-DD` strings, so\n * a browser in a different zone cannot shift the chosen day.\n */\nconst DatePickerPopover = React.forwardRef<HTMLButtonElement, DatePickerPopoverProps>(\n (\n {\n value,\n onValueChange,\n min,\n max,\n today,\n locale = 'en-US',\n weekStartsOn = 0,\n placeholder = 'Pick a date',\n name,\n required,\n disabled,\n side = 'bottom',\n align = 'start',\n id,\n className,\n 'aria-label': ariaLabel,\n },\n ref\n ) => {\n const [open, setOpen] = React.useState(false);\n const triggerRef = React.useRef<HTMLButtonElement | null>(null);\n const setTriggerRef = React.useCallback(\n (node: HTMLButtonElement | null) => {\n triggerRef.current = node;\n if (typeof ref === 'function') ref(node);\n else if (ref) ref.current = node;\n },\n [ref]\n );\n\n const label = value ? formatDateLabel(value, locale) : placeholder;\n\n return (\n <>\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n ref={setTriggerRef}\n id={id}\n disabled={disabled}\n aria-label={ariaLabel}\n className={cn(\n buttonVariants({ variant: 'outline' }),\n 'w-full justify-start font-normal',\n !value && 'text-muted-foreground',\n className\n )}\n >\n {label}\n </PopoverTrigger>\n <PopoverContent side={side} align={align} matchTriggerWidth className=\"w-auto p-3\">\n <Calendar\n value={value}\n min={min}\n max={max}\n today={today}\n locale={locale}\n weekStartsOn={weekStartsOn}\n autoFocus\n onValueChange={(next) => {\n onValueChange?.(next);\n setOpen(false);\n triggerRef.current?.focus();\n }}\n />\n </PopoverContent>\n </Popover>\n {name ? <input type=\"hidden\" name={name} value={value ?? ''} required={required} /> : null}\n </>\n );\n }\n);\nDatePickerPopover.displayName = 'DatePickerPopover';\n\nexport { DatePickerPopover };\n"],"mappings":";AA4EM,mBAEI,KADF,YADF;AA1EN,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,uBAAuB;AAChC,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,SAAS,gBAAgB,sBAAsB;AAiCxD,MAAM,oBAAoB,MAAM;AAAA,EAC9B,CACE;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT,eAAe;AAAA,IACf,cAAc;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA,OAAO;AAAA,IACP,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA,cAAc;AAAA,EAChB,GACA,QACG;AACH,UAAM,CAAC,MAAM,OAAO,IAAI,MAAM,SAAS,KAAK;AAC5C,UAAM,aAAa,MAAM,OAAiC,IAAI;AAC9D,UAAM,gBAAgB,MAAM;AAAA,MAC1B,CAAC,SAAmC;AAClC,mBAAW,UAAU;AACrB,YAAI,OAAO,QAAQ,WAAY,KAAI,IAAI;AAAA,iBAC9B,IAAK,KAAI,UAAU;AAAA,MAC9B;AAAA,MACA,CAAC,GAAG;AAAA,IACN;AAEA,UAAM,QAAQ,QAAQ,gBAAgB,OAAO,MAAM,IAAI;AAEvD,WACE,iCACE;AAAA,2BAAC,WAAQ,MAAY,cAAc,SACjC;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,KAAK;AAAA,YACL;AAAA,YACA;AAAA,YACA,cAAY;AAAA,YACZ,WAAW;AAAA,cACT,eAAe,EAAE,SAAS,UAAU,CAAC;AAAA,cACrC;AAAA,cACA,CAAC,SAAS;AAAA,cACV;AAAA,YACF;AAAA,YAEC;AAAA;AAAA,QACH;AAAA,QACA,oBAAC,kBAAe,MAAY,OAAc,mBAAiB,MAAC,WAAU,cACpE;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAS;AAAA,YACT,eAAe,CAAC,SAAS;AACvB,8BAAgB,IAAI;AACpB,sBAAQ,KAAK;AACb,yBAAW,SAAS,MAAM;AAAA,YAC5B;AAAA;AAAA,QACF,GACF;AAAA,SACF;AAAA,MACC,OAAO,oBAAC,WAAM,MAAK,UAAS,MAAY,OAAO,SAAS,IAAI,UAAoB,IAAK;AAAA,OACxF;AAAA,EAEJ;AACF;AACA,kBAAkB,cAAc;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DatePickerPopover';
|
|
@@ -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 date_picker_popover_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(date_picker_popover_exports);
|
|
18
|
+
__reExport(date_picker_popover_exports, require("./DatePickerPopover.js"), module.exports);
|
|
19
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
+
0 && (module.exports = {
|
|
21
|
+
...require("./DatePickerPopover.js")
|
|
22
|
+
});
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-picker-popover/index.ts"],"sourcesContent":["export * from './DatePickerPopover';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wCAAc,gCAAd;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/date-picker-popover/index.ts"],"sourcesContent":["export * from './DatePickerPopover';\n"],"mappings":"AAAA,cAAc;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type ImageProps = {
|
|
3
|
+
/** Primary image URL. Hotlinked sources are expected. */
|
|
4
|
+
src: string;
|
|
5
|
+
/** Required: describes the image, not the component. */
|
|
6
|
+
alt: string;
|
|
7
|
+
/** Second chance before the fallback node (e.g. generated placeholder art). */
|
|
8
|
+
fallbackSrc?: string;
|
|
9
|
+
/** Rendered when every URL has failed (icon, initials, empty panel). */
|
|
10
|
+
fallback?: React.ReactNode;
|
|
11
|
+
/** Load eagerly and fetch at high priority for the LCP image. */
|
|
12
|
+
priority?: boolean;
|
|
13
|
+
/** Intrinsic width; always emitted so the browser reserves space. */
|
|
14
|
+
width?: number;
|
|
15
|
+
/** Intrinsic height; always emitted so the browser reserves space. */
|
|
16
|
+
height?: number;
|
|
17
|
+
/** Classes for the image; merged with imgClassName. */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** Classes for the image when a consumer wants to keep them separate. */
|
|
20
|
+
imgClassName?: string;
|
|
21
|
+
style?: React.CSSProperties;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Resilient image: `src` -> `fallbackSrc` -> `fallback` node.
|
|
25
|
+
*
|
|
26
|
+
* Organizer images are hotlinked and occasionally 403, move, or die. Cards
|
|
27
|
+
* must never show a broken-image box or shift layout when that happens, so
|
|
28
|
+
* intrinsic dimensions are always rendered and only the priority image is
|
|
29
|
+
* eager.
|
|
30
|
+
*/
|
|
31
|
+
export declare function Image({ src, alt, fallbackSrc, fallback, priority, width, height, className, imgClassName, style, }: ImageProps): React.JSX.Element;
|
|
32
|
+
export declare namespace Image {
|
|
33
|
+
var displayName: string;
|
|
34
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
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 Image_exports = {};
|
|
31
|
+
__export(Image_exports, {
|
|
32
|
+
Image: () => Image
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(Image_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
|
+
function Image({
|
|
39
|
+
src,
|
|
40
|
+
alt,
|
|
41
|
+
fallbackSrc,
|
|
42
|
+
fallback,
|
|
43
|
+
priority = false,
|
|
44
|
+
width = 1200,
|
|
45
|
+
height = 630,
|
|
46
|
+
className,
|
|
47
|
+
imgClassName,
|
|
48
|
+
style
|
|
49
|
+
}) {
|
|
50
|
+
const [stage, setStage] = React.useState(0);
|
|
51
|
+
const onError = () => setStage((current2) => current2 === 0 && fallbackSrc ? 1 : 2);
|
|
52
|
+
const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;
|
|
53
|
+
if (!current || stage === 2) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: fallback ?? null });
|
|
54
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
55
|
+
"img",
|
|
56
|
+
{
|
|
57
|
+
src: current,
|
|
58
|
+
alt,
|
|
59
|
+
width,
|
|
60
|
+
height,
|
|
61
|
+
loading: priority ? "eager" : "lazy",
|
|
62
|
+
fetchPriority: priority ? "high" : "auto",
|
|
63
|
+
decoding: "async",
|
|
64
|
+
className: (0, import_cn.cn)(className, imgClassName),
|
|
65
|
+
style,
|
|
66
|
+
onError
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
Image.displayName = "Image";
|
|
71
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
72
|
+
0 && (module.exports = {
|
|
73
|
+
Image
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=Image.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/image/Image.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type ImageProps = {\n /** Primary image URL. Hotlinked sources are expected. */\n src: string;\n /** Required: describes the image, not the component. */\n alt: string;\n /** Second chance before the fallback node (e.g. generated placeholder art). */\n fallbackSrc?: string;\n /** Rendered when every URL has failed (icon, initials, empty panel). */\n fallback?: React.ReactNode;\n /** Load eagerly and fetch at high priority for the LCP image. */\n priority?: boolean;\n /** Intrinsic width; always emitted so the browser reserves space. */\n width?: number;\n /** Intrinsic height; always emitted so the browser reserves space. */\n height?: number;\n /** Classes for the image; merged with imgClassName. */\n className?: string;\n /** Classes for the image when a consumer wants to keep them separate. */\n imgClassName?: string;\n style?: React.CSSProperties;\n};\n\n/**\n * Resilient image: `src` -> `fallbackSrc` -> `fallback` node.\n *\n * Organizer images are hotlinked and occasionally 403, move, or die. Cards\n * must never show a broken-image box or shift layout when that happens, so\n * intrinsic dimensions are always rendered and only the priority image is\n * eager.\n */\nexport function Image({\n src,\n alt,\n fallbackSrc,\n fallback,\n priority = false,\n width = 1200,\n height = 630,\n className,\n imgClassName,\n style,\n}: ImageProps) {\n const [stage, setStage] = React.useState<0 | 1 | 2>(0);\n\n const onError = () => setStage((current) => (current === 0 && fallbackSrc ? 1 : 2));\n const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;\n\n if (!current || stage === 2) return <>{fallback ?? null}</>;\n\n return (\n <img\n src={current}\n alt={alt}\n width={width}\n height={height}\n loading={priority ? 'eager' : 'lazy'}\n fetchPriority={priority ? 'high' : 'auto'}\n decoding=\"async\"\n className={cn(className, imgClassName)}\n style={style}\n onError={onError}\n />\n );\n}\n\nImage.displayName = 'Image';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoDsC;AAlDtC,YAAuB;AACvB,gBAAmB;AAgCZ,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AACF,GAAe;AACb,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAoB,CAAC;AAErD,QAAM,UAAU,MAAM,SAAS,CAACA,aAAaA,aAAY,KAAK,cAAc,IAAI,CAAE;AAClF,QAAM,UAAU,UAAU,IAAI,MAAM,UAAU,IAAI,cAAc;AAEhE,MAAI,CAAC,WAAW,UAAU,EAAG,QAAO,2EAAG,sBAAY,MAAK;AAExD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,WAAW,UAAU;AAAA,MAC9B,eAAe,WAAW,SAAS;AAAA,MACnC,UAAS;AAAA,MACT,eAAW,cAAG,WAAW,YAAY;AAAA,MACrC;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,cAAc;","names":["current"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { cn } from "../../utils/cn.mjs";
|
|
5
|
+
function Image({
|
|
6
|
+
src,
|
|
7
|
+
alt,
|
|
8
|
+
fallbackSrc,
|
|
9
|
+
fallback,
|
|
10
|
+
priority = false,
|
|
11
|
+
width = 1200,
|
|
12
|
+
height = 630,
|
|
13
|
+
className,
|
|
14
|
+
imgClassName,
|
|
15
|
+
style
|
|
16
|
+
}) {
|
|
17
|
+
const [stage, setStage] = React.useState(0);
|
|
18
|
+
const onError = () => setStage((current2) => current2 === 0 && fallbackSrc ? 1 : 2);
|
|
19
|
+
const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;
|
|
20
|
+
if (!current || stage === 2) return /* @__PURE__ */ jsx(Fragment, { children: fallback ?? null });
|
|
21
|
+
return /* @__PURE__ */ jsx(
|
|
22
|
+
"img",
|
|
23
|
+
{
|
|
24
|
+
src: current,
|
|
25
|
+
alt,
|
|
26
|
+
width,
|
|
27
|
+
height,
|
|
28
|
+
loading: priority ? "eager" : "lazy",
|
|
29
|
+
fetchPriority: priority ? "high" : "auto",
|
|
30
|
+
decoding: "async",
|
|
31
|
+
className: cn(className, imgClassName),
|
|
32
|
+
style,
|
|
33
|
+
onError
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
Image.displayName = "Image";
|
|
38
|
+
export {
|
|
39
|
+
Image
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=Image.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/image/Image.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type ImageProps = {\n /** Primary image URL. Hotlinked sources are expected. */\n src: string;\n /** Required: describes the image, not the component. */\n alt: string;\n /** Second chance before the fallback node (e.g. generated placeholder art). */\n fallbackSrc?: string;\n /** Rendered when every URL has failed (icon, initials, empty panel). */\n fallback?: React.ReactNode;\n /** Load eagerly and fetch at high priority for the LCP image. */\n priority?: boolean;\n /** Intrinsic width; always emitted so the browser reserves space. */\n width?: number;\n /** Intrinsic height; always emitted so the browser reserves space. */\n height?: number;\n /** Classes for the image; merged with imgClassName. */\n className?: string;\n /** Classes for the image when a consumer wants to keep them separate. */\n imgClassName?: string;\n style?: React.CSSProperties;\n};\n\n/**\n * Resilient image: `src` -> `fallbackSrc` -> `fallback` node.\n *\n * Organizer images are hotlinked and occasionally 403, move, or die. Cards\n * must never show a broken-image box or shift layout when that happens, so\n * intrinsic dimensions are always rendered and only the priority image is\n * eager.\n */\nexport function Image({\n src,\n alt,\n fallbackSrc,\n fallback,\n priority = false,\n width = 1200,\n height = 630,\n className,\n imgClassName,\n style,\n}: ImageProps) {\n const [stage, setStage] = React.useState<0 | 1 | 2>(0);\n\n const onError = () => setStage((current) => (current === 0 && fallbackSrc ? 1 : 2));\n const current = stage === 0 ? src : stage === 1 ? fallbackSrc : null;\n\n if (!current || stage === 2) return <>{fallback ?? null}</>;\n\n return (\n <img\n src={current}\n alt={alt}\n width={width}\n height={height}\n loading={priority ? 'eager' : 'lazy'}\n fetchPriority={priority ? 'high' : 'auto'}\n decoding=\"async\"\n className={cn(className, imgClassName)}\n style={style}\n onError={onError}\n />\n );\n}\n\nImage.displayName = 'Image';\n"],"mappings":";AAoDsC;AAlDtC,YAAY,WAAW;AACvB,SAAS,UAAU;AAgCZ,SAAS,MAAM;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AACF,GAAe;AACb,QAAM,CAAC,OAAO,QAAQ,IAAI,MAAM,SAAoB,CAAC;AAErD,QAAM,UAAU,MAAM,SAAS,CAACA,aAAaA,aAAY,KAAK,cAAc,IAAI,CAAE;AAClF,QAAM,UAAU,UAAU,IAAI,MAAM,UAAU,IAAI,cAAc;AAEhE,MAAI,CAAC,WAAW,UAAU,EAAG,QAAO,gCAAG,sBAAY,MAAK;AAExD,SACE;AAAA,IAAC;AAAA;AAAA,MACC,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS,WAAW,UAAU;AAAA,MAC9B,eAAe,WAAW,SAAS;AAAA,MACnC,UAAS;AAAA,MACT,WAAW,GAAG,WAAW,YAAY;AAAA,MACrC;AAAA,MACA;AAAA;AAAA,EACF;AAEJ;AAEA,MAAM,cAAc;","names":["current"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Image, type ImageProps } from './Image';
|
|
@@ -0,0 +1,29 @@
|
|
|
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 __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var image_exports = {};
|
|
20
|
+
__export(image_exports, {
|
|
21
|
+
Image: () => import_Image.Image
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(image_exports);
|
|
24
|
+
var import_Image = require("./Image.js");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
Image
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/image/index.ts"],"sourcesContent":["export { Image, type ImageProps } from './Image';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAuC;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/image/index.ts"],"sourcesContent":["export { Image, type ImageProps } from './Image';\n"],"mappings":"AAAA,SAAS,aAA8B;","names":[]}
|
|
@@ -40,11 +40,11 @@ var import_cn = require("../../utils/cn.js");
|
|
|
40
40
|
const linkVariants = (0, import_class_variance_authority.cva)("inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm", {
|
|
41
41
|
variants: {
|
|
42
42
|
variant: {
|
|
43
|
-
default: "text-primary hover:underline underline-offset-4",
|
|
43
|
+
default: "text-primary-ink hover:underline underline-offset-4",
|
|
44
44
|
muted: "text-muted-foreground hover:text-foreground",
|
|
45
|
-
underline: "underline underline-offset-4 hover:text-primary",
|
|
46
|
-
arrow: "font-medium text-primary hover:underline underline-offset-4",
|
|
47
|
-
external: "text-primary hover:underline underline-offset-4"
|
|
45
|
+
underline: "underline underline-offset-4 hover:text-primary-ink",
|
|
46
|
+
arrow: "font-medium text-primary-ink hover:underline underline-offset-4",
|
|
47
|
+
external: "text-primary-ink hover:underline underline-offset-4"
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
defaultVariants: { variant: "default" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst linkVariants = cva('inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm', {\n variants: {\n variant: {\n default: 'text-primary hover:underline underline-offset-4',\n muted: 'text-muted-foreground hover:text-foreground',\n underline: 'underline underline-offset-4 hover:text-primary',\n arrow: 'font-medium text-primary hover:underline underline-offset-4',\n external: 'text-primary hover:underline underline-offset-4',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n VariantProps<typeof linkVariants> & {\n /** Render the child element (router Link) with link styling. */\n asChild?: boolean;\n /**\n * Force external handling (target=_blank + rel). Absolute http(s) hrefs\n * are detected automatically; mailto:/tel: links never open a new tab.\n */\n external?: boolean;\n };\n\nconst ABSOLUTE = /^https?:\\/\\//i;\n\n/**\n * Inline link primitive with the project's link variants. Keeps a real\n * `<a href>` (SEO, modified clicks, middle-click) and adds safe external\n * handling: absolute URLs get target=\"_blank\" + rel=\"noopener noreferrer\"\n * and a screen-reader note, unless `external={false}`.\n *\n * For client-side routing, wrap your router's link: `<Link asChild><RouterLink …/></Link>`.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant, asChild = false, external, target, rel, children, ...props },\n ref\n) {\n const isAbsolute = typeof props.href === 'string' && ABSOLUTE.test(props.href);\n const isExternal = external ?? isAbsolute;\n const Comp = asChild ? Slot : 'a';\n\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n {isExternal && variant !== 'muted' && (\n <>\n <span aria-hidden=\"true\" className=\"text-[0.75em]\">\n ↗\n </span>\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </Comp>\n );\n});\n\nexport type LinkVariant = NonNullable<VariantProps<typeof linkVariants>['variant']>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDM;AAjDN,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,gBAAmB;AAEnB,MAAM,mBAAe,qCAAI,wMAAwM;AAAA,EAC/N,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CAAC;AAaD,MAAM,WAAW;AAUV,MAAM,OAAO,MAAM,WAAyC,SAASA,MAC1E,EAAE,WAAW,SAAS,UAAU,OAAO,UAAU,QAAQ,KAAK,UAAU,GAAG,MAAM,GACjF,KACA;AACA,QAAM,aAAa,OAAO,MAAM,SAAS,YAAY,SAAS,KAAK,MAAM,IAAI;AAC7E,QAAM,aAAa,YAAY;AAC/B,QAAM,OAAO,UAAU,yBAAO;AAE9B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,cAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,QAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,QAChD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,cAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,MAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,cAAc,YAAY,WACzB,4EACE;AAAA,sDAAC,UAAK,eAAY,QAAO,WAAU,iBAAgB,oBAEnD;AAAA,UACA,4CAAC,UAAK,WAAU,WAAU,kCAAoB;AAAA,WAChD;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;","names":["Link"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst linkVariants = cva('inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm', {\n variants: {\n variant: {\n default: 'text-primary-ink hover:underline underline-offset-4',\n muted: 'text-muted-foreground hover:text-foreground',\n underline: 'underline underline-offset-4 hover:text-primary-ink',\n arrow: 'font-medium text-primary-ink hover:underline underline-offset-4',\n external: 'text-primary-ink hover:underline underline-offset-4',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n VariantProps<typeof linkVariants> & {\n /** Render the child element (router Link) with link styling. */\n asChild?: boolean;\n /**\n * Force external handling (target=_blank + rel). Absolute http(s) hrefs\n * are detected automatically; mailto:/tel: links never open a new tab.\n */\n external?: boolean;\n };\n\nconst ABSOLUTE = /^https?:\\/\\//i;\n\n/**\n * Inline link primitive with the project's link variants. Keeps a real\n * `<a href>` (SEO, modified clicks, middle-click) and adds safe external\n * handling: absolute URLs get target=\"_blank\" + rel=\"noopener noreferrer\"\n * and a screen-reader note, unless `external={false}`.\n *\n * For client-side routing, wrap your router's link: `<Link asChild><RouterLink …/></Link>`.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant, asChild = false, external, target, rel, children, ...props },\n ref\n) {\n const isAbsolute = typeof props.href === 'string' && ABSOLUTE.test(props.href);\n const isExternal = external ?? isAbsolute;\n const Comp = asChild ? Slot : 'a';\n\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n {isExternal && variant !== 'muted' && (\n <>\n <span aria-hidden=\"true\" className=\"text-[0.75em]\">\n ↗\n </span>\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </Comp>\n );\n});\n\nexport type LinkVariant = NonNullable<VariantProps<typeof linkVariants>['variant']>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDM;AAjDN,YAAuB;AACvB,wBAAqB;AACrB,sCAAuC;AACvC,gBAAmB;AAEnB,MAAM,mBAAe,qCAAI,wMAAwM;AAAA,EAC/N,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CAAC;AAaD,MAAM,WAAW;AAUV,MAAM,OAAO,MAAM,WAAyC,SAASA,MAC1E,EAAE,WAAW,SAAS,UAAU,OAAO,UAAU,QAAQ,KAAK,UAAU,GAAG,MAAM,GACjF,KACA;AACA,QAAM,aAAa,OAAO,MAAM,SAAS,YAAY,SAAS,KAAK,MAAM,IAAI;AAC7E,QAAM,aAAa,YAAY;AAC/B,QAAM,OAAO,UAAU,yBAAO;AAE9B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,eAAW,cAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,QAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,QAChD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAW,cAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,MAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,cAAc,YAAY,WACzB,4EACE;AAAA,sDAAC,UAAK,eAAY,QAAO,WAAU,iBAAgB,oBAEnD;AAAA,UACA,4CAAC,UAAK,WAAU,WAAU,kCAAoB;AAAA,WAChD;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;","names":["Link"]}
|
|
@@ -7,11 +7,11 @@ import { cn } from "../../utils/cn.mjs";
|
|
|
7
7
|
const linkVariants = cva("inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm", {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
|
-
default: "text-primary hover:underline underline-offset-4",
|
|
10
|
+
default: "text-primary-ink hover:underline underline-offset-4",
|
|
11
11
|
muted: "text-muted-foreground hover:text-foreground",
|
|
12
|
-
underline: "underline underline-offset-4 hover:text-primary",
|
|
13
|
-
arrow: "font-medium text-primary hover:underline underline-offset-4",
|
|
14
|
-
external: "text-primary hover:underline underline-offset-4"
|
|
12
|
+
underline: "underline underline-offset-4 hover:text-primary-ink",
|
|
13
|
+
arrow: "font-medium text-primary-ink hover:underline underline-offset-4",
|
|
14
|
+
external: "text-primary-ink hover:underline underline-offset-4"
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
defaultVariants: { variant: "default" }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst linkVariants = cva('inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm', {\n variants: {\n variant: {\n default: 'text-primary hover:underline underline-offset-4',\n muted: 'text-muted-foreground hover:text-foreground',\n underline: 'underline underline-offset-4 hover:text-primary',\n arrow: 'font-medium text-primary hover:underline underline-offset-4',\n external: 'text-primary hover:underline underline-offset-4',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n VariantProps<typeof linkVariants> & {\n /** Render the child element (router Link) with link styling. */\n asChild?: boolean;\n /**\n * Force external handling (target=_blank + rel). Absolute http(s) hrefs\n * are detected automatically; mailto:/tel: links never open a new tab.\n */\n external?: boolean;\n };\n\nconst ABSOLUTE = /^https?:\\/\\//i;\n\n/**\n * Inline link primitive with the project's link variants. Keeps a real\n * `<a href>` (SEO, modified clicks, middle-click) and adds safe external\n * handling: absolute URLs get target=\"_blank\" + rel=\"noopener noreferrer\"\n * and a screen-reader note, unless `external={false}`.\n *\n * For client-side routing, wrap your router's link: `<Link asChild><RouterLink …/></Link>`.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant, asChild = false, external, target, rel, children, ...props },\n ref\n) {\n const isAbsolute = typeof props.href === 'string' && ABSOLUTE.test(props.href);\n const isExternal = external ?? isAbsolute;\n const Comp = asChild ? Slot : 'a';\n\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n {isExternal && variant !== 'muted' && (\n <>\n <span aria-hidden=\"true\" className=\"text-[0.75em]\">\n ↗\n </span>\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </Comp>\n );\n});\n\nexport type LinkVariant = NonNullable<VariantProps<typeof linkVariants>['variant']>;\n"],"mappings":";AAmDM,SAsBE,UAtBF,KAsBE,YAtBF;AAjDN,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,UAAU;AAEnB,MAAM,eAAe,IAAI,wMAAwM;AAAA,EAC/N,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CAAC;AAaD,MAAM,WAAW;AAUV,MAAM,OAAO,MAAM,WAAyC,SAASA,MAC1E,EAAE,WAAW,SAAS,UAAU,OAAO,UAAU,QAAQ,KAAK,UAAU,GAAG,MAAM,GACjF,KACA;AACA,QAAM,aAAa,OAAO,MAAM,SAAS,YAAY,SAAS,KAAK,MAAM,IAAI;AAC7E,QAAM,aAAa,YAAY;AAC/B,QAAM,OAAO,UAAU,OAAO;AAE9B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,QAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,QAChD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,MAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,cAAc,YAAY,WACzB,iCACE;AAAA,8BAAC,UAAK,eAAY,QAAO,WAAU,iBAAgB,oBAEnD;AAAA,UACA,oBAAC,UAAK,WAAU,WAAU,kCAAoB;AAAA,WAChD;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;","names":["Link"]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/link/Link.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Slot } from '@radix-ui/react-slot';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../../utils/cn';\n\nconst linkVariants = cva('inline-flex items-center gap-1 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background rounded-sm', {\n variants: {\n variant: {\n default: 'text-primary-ink hover:underline underline-offset-4',\n muted: 'text-muted-foreground hover:text-foreground',\n underline: 'underline underline-offset-4 hover:text-primary-ink',\n arrow: 'font-medium text-primary-ink hover:underline underline-offset-4',\n external: 'text-primary-ink hover:underline underline-offset-4',\n },\n },\n defaultVariants: { variant: 'default' },\n});\n\nexport type LinkProps = React.AnchorHTMLAttributes<HTMLAnchorElement> &\n VariantProps<typeof linkVariants> & {\n /** Render the child element (router Link) with link styling. */\n asChild?: boolean;\n /**\n * Force external handling (target=_blank + rel). Absolute http(s) hrefs\n * are detected automatically; mailto:/tel: links never open a new tab.\n */\n external?: boolean;\n };\n\nconst ABSOLUTE = /^https?:\\/\\//i;\n\n/**\n * Inline link primitive with the project's link variants. Keeps a real\n * `<a href>` (SEO, modified clicks, middle-click) and adds safe external\n * handling: absolute URLs get target=\"_blank\" + rel=\"noopener noreferrer\"\n * and a screen-reader note, unless `external={false}`.\n *\n * For client-side routing, wrap your router's link: `<Link asChild><RouterLink …/></Link>`.\n */\nexport const Link = React.forwardRef<HTMLAnchorElement, LinkProps>(function Link(\n { className, variant, asChild = false, external, target, rel, children, ...props },\n ref\n) {\n const isAbsolute = typeof props.href === 'string' && ABSOLUTE.test(props.href);\n const isExternal = external ?? isAbsolute;\n const Comp = asChild ? Slot : 'a';\n\n if (asChild) {\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n </Comp>\n );\n }\n\n return (\n <Comp\n ref={ref}\n className={cn(linkVariants({ variant }), className)}\n target={isExternal ? target ?? '_blank' : target}\n rel={isExternal ? rel ?? 'noopener noreferrer' : rel}\n {...props}\n >\n {children}\n {isExternal && variant !== 'muted' && (\n <>\n <span aria-hidden=\"true\" className=\"text-[0.75em]\">\n ↗\n </span>\n <span className=\"sr-only\">(opens in a new tab)</span>\n </>\n )}\n </Comp>\n );\n});\n\nexport type LinkVariant = NonNullable<VariantProps<typeof linkVariants>['variant']>;\n"],"mappings":";AAmDM,SAsBE,UAtBF,KAsBE,YAtBF;AAjDN,YAAY,WAAW;AACvB,SAAS,YAAY;AACrB,SAAS,WAA8B;AACvC,SAAS,UAAU;AAEnB,MAAM,eAAe,IAAI,wMAAwM;AAAA,EAC/N,UAAU;AAAA,IACR,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,MACP,UAAU;AAAA,IACZ;AAAA,EACF;AAAA,EACA,iBAAiB,EAAE,SAAS,UAAU;AACxC,CAAC;AAaD,MAAM,WAAW;AAUV,MAAM,OAAO,MAAM,WAAyC,SAASA,MAC1E,EAAE,WAAW,SAAS,UAAU,OAAO,UAAU,QAAQ,KAAK,UAAU,GAAG,MAAM,GACjF,KACA;AACA,QAAM,aAAa,OAAO,MAAM,SAAS,YAAY,SAAS,KAAK,MAAM,IAAI;AAC7E,QAAM,aAAa,YAAY;AAC/B,QAAM,OAAO,UAAU,OAAO;AAE9B,MAAI,SAAS;AACX,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,QAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,QAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,QAChD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,GAAG,aAAa,EAAE,QAAQ,CAAC,GAAG,SAAS;AAAA,MAClD,QAAQ,aAAa,UAAU,WAAW;AAAA,MAC1C,KAAK,aAAa,OAAO,wBAAwB;AAAA,MAChD,GAAG;AAAA,MAEH;AAAA;AAAA,QACA,cAAc,YAAY,WACzB,iCACE;AAAA,8BAAC,UAAK,eAAY,QAAO,WAAU,iBAAgB,oBAEnD;AAAA,UACA,oBAAC,UAAK,WAAU,WAAU,kCAAoB;AAAA,WAChD;AAAA;AAAA;AAAA,EAEJ;AAEJ,CAAC;","names":["Link"]}
|
|
@@ -44,7 +44,7 @@ const PageHeader = React.forwardRef(function PageHeader2({ title, description, s
|
|
|
44
44
|
const supporting = description ?? subtitle;
|
|
45
45
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { ref, className: (0, import_cn.cn)("flex flex-col gap-2", align === "center" && "items-center text-center", className), ...props, children: [
|
|
46
46
|
breadcrumbs && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-sm text-muted-foreground", children: breadcrumbs }),
|
|
47
|
-
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("text-xs font-medium uppercase tracking-wide text-primary", eyebrowClassName), children: eyebrow }),
|
|
47
|
+
eyebrow && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_cn.cn)("text-xs font-medium uppercase tracking-wide text-primary-ink", eyebrowClassName), children: eyebrow }),
|
|
48
48
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("flex w-full flex-wrap items-start justify-between gap-3", align === "center" && "justify-center"), children: [
|
|
49
49
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_cn.cn)("min-w-0", align === "center" && "flex flex-col items-center"), children: [
|
|
50
50
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h1", { className: (0, import_cn.cn)("font-semibold tracking-tight", sizeClasses[size], titleClassName), children: title }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Alias for `description` (migration-friendly). */\n subtitle?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, subtitle, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n const supporting = description ?? subtitle;\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {supporting && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{supporting}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CsB;AA/CtB,YAAuB;AACvB,gBAAmB;AA2BnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,UAAU,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAClL,KACA;AACA,QAAM,aAAa,eAAe;AAClC,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,4CAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,4CAAC,SAAI,eAAW,cAAG,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/page-header/PageHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\n\nexport type PageHeaderProps = React.HTMLAttributes<HTMLDivElement> & {\n title: string;\n description?: string;\n /** Alias for `description` (migration-friendly). */\n subtitle?: string;\n /** Breadcrumbs/eyebrow above the title. */\n breadcrumbs?: React.ReactNode;\n /** Right-aligned actions (buttons, menus). */\n actions?: React.ReactNode;\n /** Small slot under the title row (tabs, filters). */\n children?: React.ReactNode;\n /** Eyebrow/kicker above the title (category, date, overline). */\n eyebrow?: React.ReactNode;\n /** Heading scale - 'hero' is for marketing landing pages. */\n size?: 'sm' | 'md' | 'lg' | 'hero';\n /** Text alignment; hero marketing pages often center. */\n align?: 'left' | 'center';\n /** Extra classes for the h1, for host display typography. */\n titleClassName?: string;\n /** Extra classes for the description. */\n descriptionClassName?: string;\n /** Extra classes for the eyebrow. */\n eyebrowClassName?: string;\n};\n\nconst sizeClasses: Record<NonNullable<PageHeaderProps['size']>, string> = {\n sm: 'text-xl',\n md: 'text-2xl',\n lg: 'text-3xl',\n hero: 'text-4xl sm:text-5xl lg:text-[3.4rem] lg:leading-[1.1]',\n};\n\n/**\n * Standard page heading block: optional breadcrumbs, title, description and\n * a right-aligned action cluster. Pages stop inventing their own spacing\n * and heading hierarchy.\n */\nexport const PageHeader = React.forwardRef<HTMLDivElement, PageHeaderProps>(function PageHeader(\n { title, description, subtitle, breadcrumbs, actions, eyebrow, size = 'md', align = 'left', titleClassName, descriptionClassName, eyebrowClassName, className, children, ...props },\n ref\n) {\n const supporting = description ?? subtitle;\n return (\n <div ref={ref} className={cn('flex flex-col gap-2', align === 'center' && 'items-center text-center', className)} {...props}>\n {breadcrumbs && <div className=\"text-sm text-muted-foreground\">{breadcrumbs}</div>}\n {eyebrow && (\n <div className={cn('text-xs font-medium uppercase tracking-wide text-primary-ink', eyebrowClassName)}>{eyebrow}</div>\n )}\n <div className={cn('flex w-full flex-wrap items-start justify-between gap-3', align === 'center' && 'justify-center')}>\n <div className={cn('min-w-0', align === 'center' && 'flex flex-col items-center')}>\n <h1 className={cn('font-semibold tracking-tight', sizeClasses[size], titleClassName)}>{title}</h1>\n {supporting && <p className={cn('mt-2 max-w-2xl text-base text-muted-foreground', descriptionClassName)}>{supporting}</p>}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-2\">{actions}</div>}\n </div>\n {children && <div className=\"mt-2\">{children}</div>}\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CsB;AA/CtB,YAAuB;AACvB,gBAAmB;AA2BnB,MAAM,cAAoE;AAAA,EACxE,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,IAAI;AAAA,EACJ,MAAM;AACR;AAOO,MAAM,aAAa,MAAM,WAA4C,SAASA,YACnF,EAAE,OAAO,aAAa,UAAU,aAAa,SAAS,SAAS,OAAO,MAAM,QAAQ,QAAQ,gBAAgB,sBAAsB,kBAAkB,WAAW,UAAU,GAAG,MAAM,GAClL,KACA;AACA,QAAM,aAAa,eAAe;AAClC,SACE,6CAAC,SAAI,KAAU,eAAW,cAAG,uBAAuB,UAAU,YAAY,4BAA4B,SAAS,GAAI,GAAG,OACnH;AAAA,mBAAe,4CAAC,SAAI,WAAU,iCAAiC,uBAAY;AAAA,IAC3E,WACC,4CAAC,SAAI,eAAW,cAAG,gEAAgE,gBAAgB,GAAI,mBAAQ;AAAA,IAEjH,6CAAC,SAAI,eAAW,cAAG,2DAA2D,UAAU,YAAY,gBAAgB,GAClH;AAAA,mDAAC,SAAI,eAAW,cAAG,WAAW,UAAU,YAAY,4BAA4B,GAC9E;AAAA,oDAAC,QAAG,eAAW,cAAG,gCAAgC,YAAY,IAAI,GAAG,cAAc,GAAI,iBAAM;AAAA,QAC5F,cAAc,4CAAC,OAAE,eAAW,cAAG,kDAAkD,oBAAoB,GAAI,sBAAW;AAAA,SACvH;AAAA,MACC,WAAW,4CAAC,SAAI,WAAU,oCAAoC,mBAAQ;AAAA,OACzE;AAAA,IACC,YAAY,4CAAC,SAAI,WAAU,QAAQ,UAAS;AAAA,KAC/C;AAEJ,CAAC;","names":["PageHeader"]}
|
|
@@ -11,7 +11,7 @@ const PageHeader = React.forwardRef(function PageHeader2({ title, description, s
|
|
|
11
11
|
const supporting = description ?? subtitle;
|
|
12
12
|
return /* @__PURE__ */ jsxs("div", { ref, className: cn("flex flex-col gap-2", align === "center" && "items-center text-center", className), ...props, children: [
|
|
13
13
|
breadcrumbs && /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: breadcrumbs }),
|
|
14
|
-
eyebrow && /* @__PURE__ */ jsx("div", { className: cn("text-xs font-medium uppercase tracking-wide text-primary", eyebrowClassName), children: eyebrow }),
|
|
14
|
+
eyebrow && /* @__PURE__ */ jsx("div", { className: cn("text-xs font-medium uppercase tracking-wide text-primary-ink", eyebrowClassName), children: eyebrow }),
|
|
15
15
|
/* @__PURE__ */ jsxs("div", { className: cn("flex w-full flex-wrap items-start justify-between gap-3", align === "center" && "justify-center"), children: [
|
|
16
16
|
/* @__PURE__ */ jsxs("div", { className: cn("min-w-0", align === "center" && "flex flex-col items-center"), children: [
|
|
17
17
|
/* @__PURE__ */ jsx("h1", { className: cn("font-semibold tracking-tight", sizeClasses[size], titleClassName), children: title }),
|