@slipstream-ui/core 0.12.1 → 0.13.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 +177 -2
- package/dist/index.d.ts +177 -2
- package/dist/index.js +229 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +221 -0
- 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 +1 -1
- 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/consent-banner.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 +1 -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/figure.manifest.json +105 -0
- 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/icon-button.manifest.json +101 -0
- package/dist/manifests/icon-tile.manifest.json +107 -0
- package/dist/manifests/icon.manifest.json +119 -0
- 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 +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/media-card.manifest.json +1 -1
- package/dist/manifests/media.manifest.json +142 -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 +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 +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 +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 +1 -1
- package/dist/manifests/skeleton.manifest.json +1 -1
- package/dist/manifests/social-links.manifest.json +120 -0
- 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/figure/Figure.d.ts +23 -0
- package/dist/src/components/figure/Figure.js +60 -0
- package/dist/src/components/figure/Figure.js.map +1 -0
- package/dist/src/components/figure/Figure.mjs +26 -0
- package/dist/src/components/figure/Figure.mjs.map +1 -0
- package/dist/src/components/figure/index.d.ts +2 -0
- package/dist/src/components/figure/index.js +29 -0
- package/dist/src/components/figure/index.js.map +1 -0
- package/dist/src/components/figure/index.mjs +5 -0
- package/dist/src/components/figure/index.mjs.map +1 -0
- package/dist/src/components/icon/Icon.d.ts +33 -0
- package/dist/src/components/icon/Icon.js +82 -0
- package/dist/src/components/icon/Icon.js.map +1 -0
- package/dist/src/components/icon/Icon.mjs +47 -0
- package/dist/src/components/icon/Icon.mjs.map +1 -0
- package/dist/src/components/icon/index.d.ts +2 -0
- package/dist/src/components/icon/index.js +31 -0
- package/dist/src/components/icon/index.js.map +1 -0
- package/dist/src/components/icon/index.mjs +6 -0
- package/dist/src/components/icon/index.mjs.map +1 -0
- package/dist/src/components/icon-button/IconButton.d.ts +25 -0
- package/dist/src/components/icon-button/IconButton.js +60 -0
- package/dist/src/components/icon-button/IconButton.js.map +1 -0
- package/dist/src/components/icon-button/IconButton.mjs +26 -0
- package/dist/src/components/icon-button/IconButton.mjs.map +1 -0
- package/dist/src/components/icon-button/index.d.ts +2 -0
- package/dist/src/components/icon-button/index.js +29 -0
- package/dist/src/components/icon-button/index.js.map +1 -0
- package/dist/src/components/icon-button/index.mjs +5 -0
- package/dist/src/components/icon-button/index.mjs.map +1 -0
- package/dist/src/components/icon-tile/IconTile.d.ts +23 -0
- package/dist/src/components/icon-tile/IconTile.js +75 -0
- package/dist/src/components/icon-tile/IconTile.js.map +1 -0
- package/dist/src/components/icon-tile/IconTile.mjs +40 -0
- package/dist/src/components/icon-tile/IconTile.mjs.map +1 -0
- package/dist/src/components/icon-tile/index.d.ts +2 -0
- package/dist/src/components/icon-tile/index.js +31 -0
- package/dist/src/components/icon-tile/index.js.map +1 -0
- package/dist/src/components/icon-tile/index.mjs +6 -0
- package/dist/src/components/icon-tile/index.mjs.map +1 -0
- package/dist/src/components/media/Media.d.ts +48 -0
- package/dist/src/components/media/Media.js +97 -0
- package/dist/src/components/media/Media.js.map +1 -0
- package/dist/src/components/media/Media.mjs +63 -0
- package/dist/src/components/media/Media.mjs.map +1 -0
- package/dist/src/components/media/index.d.ts +2 -0
- package/dist/src/components/media/index.js +29 -0
- package/dist/src/components/media/index.js.map +1 -0
- package/dist/src/components/media/index.mjs +5 -0
- package/dist/src/components/media/index.mjs.map +1 -0
- package/dist/src/components/social-links/SocialLinks.d.ts +34 -0
- package/dist/src/components/social-links/SocialLinks.js +69 -0
- package/dist/src/components/social-links/SocialLinks.js.map +1 -0
- package/dist/src/components/social-links/SocialLinks.mjs +35 -0
- package/dist/src/components/social-links/SocialLinks.mjs.map +1 -0
- package/dist/src/components/social-links/index.d.ts +2 -0
- package/dist/src/components/social-links/index.js +29 -0
- package/dist/src/components/social-links/index.js.map +1 -0
- package/dist/src/components/social-links/index.mjs +5 -0
- package/dist/src/components/social-links/index.mjs.map +1 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/styles-full.css +1 -1
- package/dist/styles.css +1 -1
- package/package.json +4 -4
- package/src/components/figure/Figure.test.tsx +54 -0
- package/src/components/figure/Figure.tsx +38 -0
- package/src/components/figure/index.ts +2 -0
- package/src/components/icon/Icon.test.tsx +70 -0
- package/src/components/icon/Icon.tsx +61 -0
- package/src/components/icon/index.ts +2 -0
- package/src/components/icon-button/IconButton.test.tsx +76 -0
- package/src/components/icon-button/IconButton.tsx +38 -0
- package/src/components/icon-button/index.ts +2 -0
- package/src/components/icon-tile/IconTile.test.tsx +63 -0
- package/src/components/icon-tile/IconTile.tsx +55 -0
- package/src/components/icon-tile/index.ts +2 -0
- package/src/components/media/Media.test.tsx +53 -0
- package/src/components/media/Media.tsx +92 -0
- package/src/components/media/index.ts +2 -0
- package/src/components/social-links/SocialLinks.test.tsx +59 -0
- package/src/components/social-links/SocialLinks.tsx +73 -0
- package/src/components/social-links/index.ts +2 -0
- package/src/index.ts +6 -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 +1 -1
- 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/consent-banner.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 +1 -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/figure.manifest.json +105 -0
- 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/icon-button.manifest.json +101 -0
- package/src/manifests/icon-tile.manifest.json +107 -0
- package/src/manifests/icon.manifest.json +119 -0
- 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 +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/media-card.manifest.json +1 -1
- package/src/manifests/media.manifest.json +142 -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 +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 +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 +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 +1 -1
- package/src/manifests/skeleton.manifest.json +1 -1
- package/src/manifests/social-links.manifest.json +120 -0
- 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,48 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type FigureProps } from '../figure/Figure';
|
|
3
|
+
export type MediaProps = Omit<FigureProps, 'children'> & {
|
|
4
|
+
/**
|
|
5
|
+
* Aspect ratio: 'video' (16:9), 'square' (1:1), 'wide' (2:1), or any CSS
|
|
6
|
+
* aspect-ratio value such as '16/9' or '4/3'. The box reserves space so
|
|
7
|
+
* grids never shift while media loads.
|
|
8
|
+
*/
|
|
9
|
+
aspect?: 'video' | 'square' | 'wide' | string;
|
|
10
|
+
/** Image URL. When set, rendered through Image's fallback chain. */
|
|
11
|
+
src?: string;
|
|
12
|
+
/** Alt text for `src` media (required for meaningful images). */
|
|
13
|
+
alt?: string;
|
|
14
|
+
/** Responsive `sizes` hint forwarded to the image. */
|
|
15
|
+
sizes?: string;
|
|
16
|
+
/** Load eagerly and fetch at high priority for the LCP image. */
|
|
17
|
+
priority?: boolean;
|
|
18
|
+
/** Fallback content when `src` is absent or fails (e.g. a placeholder). */
|
|
19
|
+
fallback?: React.ReactNode;
|
|
20
|
+
/** Arbitrary media (video, embed, illustration) rendered inside the frame. */
|
|
21
|
+
children?: React.ReactNode;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Figure-level media frame: a fixed-aspect box that shows an Image (with its
|
|
25
|
+
* fallback chain) or arbitrary children, plus an optional caption and credit
|
|
26
|
+
* via Figure. Reserves layout space before media loads.
|
|
27
|
+
*/
|
|
28
|
+
declare const Media: React.ForwardRefExoticComponent<Omit<FigureProps, "children"> & {
|
|
29
|
+
/**
|
|
30
|
+
* Aspect ratio: 'video' (16:9), 'square' (1:1), 'wide' (2:1), or any CSS
|
|
31
|
+
* aspect-ratio value such as '16/9' or '4/3'. The box reserves space so
|
|
32
|
+
* grids never shift while media loads.
|
|
33
|
+
*/
|
|
34
|
+
aspect?: "video" | "square" | "wide" | string;
|
|
35
|
+
/** Image URL. When set, rendered through Image's fallback chain. */
|
|
36
|
+
src?: string;
|
|
37
|
+
/** Alt text for `src` media (required for meaningful images). */
|
|
38
|
+
alt?: string;
|
|
39
|
+
/** Responsive `sizes` hint forwarded to the image. */
|
|
40
|
+
sizes?: string;
|
|
41
|
+
/** Load eagerly and fetch at high priority for the LCP image. */
|
|
42
|
+
priority?: boolean;
|
|
43
|
+
/** Fallback content when `src` is absent or fails (e.g. a placeholder). */
|
|
44
|
+
fallback?: React.ReactNode;
|
|
45
|
+
/** Arbitrary media (video, embed, illustration) rendered inside the frame. */
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
48
|
+
export { Media };
|
|
@@ -0,0 +1,97 @@
|
|
|
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 Media_exports = {};
|
|
30
|
+
__export(Media_exports, {
|
|
31
|
+
Media: () => Media
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(Media_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_Figure = require("../figure/Figure.js");
|
|
38
|
+
var import_Image = require("../image/Image.js");
|
|
39
|
+
const aspectClasses = {
|
|
40
|
+
video: "aspect-video",
|
|
41
|
+
square: "aspect-square",
|
|
42
|
+
wide: "aspect-[2/1]"
|
|
43
|
+
};
|
|
44
|
+
const Media = React.forwardRef(
|
|
45
|
+
({
|
|
46
|
+
className,
|
|
47
|
+
aspect = "video",
|
|
48
|
+
src,
|
|
49
|
+
alt = "",
|
|
50
|
+
sizes,
|
|
51
|
+
priority = false,
|
|
52
|
+
fallback,
|
|
53
|
+
caption,
|
|
54
|
+
credit,
|
|
55
|
+
align,
|
|
56
|
+
children,
|
|
57
|
+
...props
|
|
58
|
+
}, ref) => {
|
|
59
|
+
const preset = aspectClasses[aspect];
|
|
60
|
+
const aspectStyle = preset === void 0 && typeof aspect === "string" ? { aspectRatio: aspect } : void 0;
|
|
61
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
62
|
+
import_Figure.Figure,
|
|
63
|
+
{
|
|
64
|
+
ref,
|
|
65
|
+
caption,
|
|
66
|
+
credit,
|
|
67
|
+
align,
|
|
68
|
+
className,
|
|
69
|
+
...props,
|
|
70
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: (0, import_cn.cn)("relative overflow-hidden rounded-lg bg-muted", preset),
|
|
74
|
+
style: aspectStyle,
|
|
75
|
+
children: src ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
76
|
+
import_Image.Image,
|
|
77
|
+
{
|
|
78
|
+
src,
|
|
79
|
+
alt,
|
|
80
|
+
priority,
|
|
81
|
+
sizes,
|
|
82
|
+
fallback,
|
|
83
|
+
className: "h-full w-full object-cover"
|
|
84
|
+
}
|
|
85
|
+
) : children ?? fallback
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
Media.displayName = "Media";
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
Media
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=Media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media/Media.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Figure, type FigureProps } from '../figure/Figure';\nimport { Image } from '../image/Image';\n\nexport type MediaProps = Omit<FigureProps, 'children'> & {\n /**\n * Aspect ratio: 'video' (16:9), 'square' (1:1), 'wide' (2:1), or any CSS\n * aspect-ratio value such as '16/9' or '4/3'. The box reserves space so\n * grids never shift while media loads.\n */\n aspect?: 'video' | 'square' | 'wide' | string;\n /** Image URL. When set, rendered through Image's fallback chain. */\n src?: string;\n /** Alt text for `src` media (required for meaningful images). */\n alt?: string;\n /** Responsive `sizes` hint forwarded to the image. */\n sizes?: string;\n /** Load eagerly and fetch at high priority for the LCP image. */\n priority?: boolean;\n /** Fallback content when `src` is absent or fails (e.g. a placeholder). */\n fallback?: React.ReactNode;\n /** Arbitrary media (video, embed, illustration) rendered inside the frame. */\n children?: React.ReactNode;\n};\n\nconst aspectClasses = {\n video: 'aspect-video',\n square: 'aspect-square',\n wide: 'aspect-[2/1]',\n} as const;\n\n/**\n * Figure-level media frame: a fixed-aspect box that shows an Image (with its\n * fallback chain) or arbitrary children, plus an optional caption and credit\n * via Figure. Reserves layout space before media loads.\n */\nconst Media = React.forwardRef<HTMLElement, MediaProps>(\n (\n {\n className,\n aspect = 'video',\n src,\n alt = '',\n sizes,\n priority = false,\n fallback,\n caption,\n credit,\n align,\n children,\n ...props\n },\n ref\n ) => {\n const preset = aspectClasses[aspect as keyof typeof aspectClasses];\n const aspectStyle =\n preset === undefined && typeof aspect === 'string' ? { aspectRatio: aspect } : undefined;\n\n return (\n <Figure\n ref={ref}\n caption={caption}\n credit={credit}\n align={align}\n className={className}\n {...props}\n >\n <div\n className={cn('relative overflow-hidden rounded-lg bg-muted', preset)}\n style={aspectStyle}\n >\n {src ? (\n <Image\n src={src}\n alt={alt}\n priority={priority}\n sizes={sizes}\n fallback={fallback}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n (children ?? fallback)\n )}\n </div>\n </Figure>\n );\n }\n);\nMedia.displayName = 'Media';\n\nexport { Media };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyEY;AAzEZ,YAAuB;AACvB,gBAAmB;AACnB,oBAAyC;AACzC,mBAAsB;AAuBtB,MAAM,gBAAgB;AAAA,EACpB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AACR;AAOA,MAAM,QAAQ,MAAM;AAAA,EAClB,CACE;AAAA,IACE;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,SAAS,cAAc,MAAoC;AACjE,UAAM,cACJ,WAAW,UAAa,OAAO,WAAW,WAAW,EAAE,aAAa,OAAO,IAAI;AAEjF,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,QAEJ;AAAA,UAAC;AAAA;AAAA,YACC,eAAW,cAAG,gDAAgD,MAAM;AAAA,YACpE,OAAO;AAAA,YAEN,gBACC;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,WAAU;AAAA;AAAA,YACZ,IAEC,YAAY;AAAA;AAAA,QAEjB;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { Figure } from "../figure/Figure.mjs";
|
|
5
|
+
import { Image } from "../image/Image.mjs";
|
|
6
|
+
const aspectClasses = {
|
|
7
|
+
video: "aspect-video",
|
|
8
|
+
square: "aspect-square",
|
|
9
|
+
wide: "aspect-[2/1]"
|
|
10
|
+
};
|
|
11
|
+
const Media = React.forwardRef(
|
|
12
|
+
({
|
|
13
|
+
className,
|
|
14
|
+
aspect = "video",
|
|
15
|
+
src,
|
|
16
|
+
alt = "",
|
|
17
|
+
sizes,
|
|
18
|
+
priority = false,
|
|
19
|
+
fallback,
|
|
20
|
+
caption,
|
|
21
|
+
credit,
|
|
22
|
+
align,
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}, ref) => {
|
|
26
|
+
const preset = aspectClasses[aspect];
|
|
27
|
+
const aspectStyle = preset === void 0 && typeof aspect === "string" ? { aspectRatio: aspect } : void 0;
|
|
28
|
+
return /* @__PURE__ */ jsx(
|
|
29
|
+
Figure,
|
|
30
|
+
{
|
|
31
|
+
ref,
|
|
32
|
+
caption,
|
|
33
|
+
credit,
|
|
34
|
+
align,
|
|
35
|
+
className,
|
|
36
|
+
...props,
|
|
37
|
+
children: /* @__PURE__ */ jsx(
|
|
38
|
+
"div",
|
|
39
|
+
{
|
|
40
|
+
className: cn("relative overflow-hidden rounded-lg bg-muted", preset),
|
|
41
|
+
style: aspectStyle,
|
|
42
|
+
children: src ? /* @__PURE__ */ jsx(
|
|
43
|
+
Image,
|
|
44
|
+
{
|
|
45
|
+
src,
|
|
46
|
+
alt,
|
|
47
|
+
priority,
|
|
48
|
+
sizes,
|
|
49
|
+
fallback,
|
|
50
|
+
className: "h-full w-full object-cover"
|
|
51
|
+
}
|
|
52
|
+
) : children ?? fallback
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
Media.displayName = "Media";
|
|
60
|
+
export {
|
|
61
|
+
Media
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=Media.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media/Media.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Figure, type FigureProps } from '../figure/Figure';\nimport { Image } from '../image/Image';\n\nexport type MediaProps = Omit<FigureProps, 'children'> & {\n /**\n * Aspect ratio: 'video' (16:9), 'square' (1:1), 'wide' (2:1), or any CSS\n * aspect-ratio value such as '16/9' or '4/3'. The box reserves space so\n * grids never shift while media loads.\n */\n aspect?: 'video' | 'square' | 'wide' | string;\n /** Image URL. When set, rendered through Image's fallback chain. */\n src?: string;\n /** Alt text for `src` media (required for meaningful images). */\n alt?: string;\n /** Responsive `sizes` hint forwarded to the image. */\n sizes?: string;\n /** Load eagerly and fetch at high priority for the LCP image. */\n priority?: boolean;\n /** Fallback content when `src` is absent or fails (e.g. a placeholder). */\n fallback?: React.ReactNode;\n /** Arbitrary media (video, embed, illustration) rendered inside the frame. */\n children?: React.ReactNode;\n};\n\nconst aspectClasses = {\n video: 'aspect-video',\n square: 'aspect-square',\n wide: 'aspect-[2/1]',\n} as const;\n\n/**\n * Figure-level media frame: a fixed-aspect box that shows an Image (with its\n * fallback chain) or arbitrary children, plus an optional caption and credit\n * via Figure. Reserves layout space before media loads.\n */\nconst Media = React.forwardRef<HTMLElement, MediaProps>(\n (\n {\n className,\n aspect = 'video',\n src,\n alt = '',\n sizes,\n priority = false,\n fallback,\n caption,\n credit,\n align,\n children,\n ...props\n },\n ref\n ) => {\n const preset = aspectClasses[aspect as keyof typeof aspectClasses];\n const aspectStyle =\n preset === undefined && typeof aspect === 'string' ? { aspectRatio: aspect } : undefined;\n\n return (\n <Figure\n ref={ref}\n caption={caption}\n credit={credit}\n align={align}\n className={className}\n {...props}\n >\n <div\n className={cn('relative overflow-hidden rounded-lg bg-muted', preset)}\n style={aspectStyle}\n >\n {src ? (\n <Image\n src={src}\n alt={alt}\n priority={priority}\n sizes={sizes}\n fallback={fallback}\n className=\"h-full w-full object-cover\"\n />\n ) : (\n (children ?? fallback)\n )}\n </div>\n </Figure>\n );\n }\n);\nMedia.displayName = 'Media';\n\nexport { Media };\n"],"mappings":"AAyEY;AAzEZ,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,cAAgC;AACzC,SAAS,aAAa;AAuBtB,MAAM,gBAAgB;AAAA,EACpB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AACR;AAOA,MAAM,QAAQ,MAAM;AAAA,EAClB,CACE;AAAA,IACE;AAAA,IACA,SAAS;AAAA,IACT;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,GACA,QACG;AACH,UAAM,SAAS,cAAc,MAAoC;AACjE,UAAM,cACJ,WAAW,UAAa,OAAO,WAAW,WAAW,EAAE,aAAa,OAAO,IAAI;AAEjF,WACE;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACC,GAAG;AAAA,QAEJ;AAAA,UAAC;AAAA;AAAA,YACC,WAAW,GAAG,gDAAgD,MAAM;AAAA,YACpE,OAAO;AAAA,YAEN,gBACC;AAAA,cAAC;AAAA;AAAA,gBACC;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA,WAAU;AAAA;AAAA,YACZ,IAEC,YAAY;AAAA;AAAA,QAEjB;AAAA;AAAA,IACF;AAAA,EAEJ;AACF;AACA,MAAM,cAAc;","names":[]}
|
|
@@ -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 media_exports = {};
|
|
20
|
+
__export(media_exports, {
|
|
21
|
+
Media: () => import_Media.Media
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(media_exports);
|
|
24
|
+
var import_Media = require("./Media.js");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
Media
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media/index.ts"],"sourcesContent":["export { Media } from './Media';\nexport type { MediaProps } from './Media';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAsB;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/media/index.ts"],"sourcesContent":["export { Media } from './Media';\nexport type { MediaProps } from './Media';\n"],"mappings":"AAAA,SAAS,aAAa;","names":[]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type IconProps } from '../icon/Icon';
|
|
3
|
+
export type SocialLink = {
|
|
4
|
+
/** Destination URL. Rendered with safe external-link attributes. */
|
|
5
|
+
href: string;
|
|
6
|
+
/** Accessible name for the destination (e.g. "GitHub"). */
|
|
7
|
+
label: string;
|
|
8
|
+
/** Optional icon element or component rendered inside the link. */
|
|
9
|
+
icon?: React.ReactElement | React.ComponentType<React.SVGProps<SVGSVGElement>>;
|
|
10
|
+
};
|
|
11
|
+
export type SocialLinksProps = React.HTMLAttributes<HTMLElement> & {
|
|
12
|
+
links: SocialLink[];
|
|
13
|
+
/** Accessible name for the navigation landmark (default "Social links"). */
|
|
14
|
+
label?: string;
|
|
15
|
+
/** Icon size passed through to Icon (default 'md'). */
|
|
16
|
+
iconSize?: IconProps['size'];
|
|
17
|
+
/** Icon tone (default 'muted'). */
|
|
18
|
+
iconTone?: IconProps['tone'];
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Row of outbound social/profile links. Every destination is named via
|
|
22
|
+
* `aria-label`, external links get `target="_blank" rel="noopener noreferrer"`,
|
|
23
|
+
* and icon-only links stay accessible because the label is always applied.
|
|
24
|
+
*/
|
|
25
|
+
declare const SocialLinks: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & {
|
|
26
|
+
links: SocialLink[];
|
|
27
|
+
/** Accessible name for the navigation landmark (default "Social links"). */
|
|
28
|
+
label?: string;
|
|
29
|
+
/** Icon size passed through to Icon (default 'md'). */
|
|
30
|
+
iconSize?: IconProps["size"];
|
|
31
|
+
/** Icon tone (default 'muted'). */
|
|
32
|
+
iconTone?: IconProps["tone"];
|
|
33
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
34
|
+
export { SocialLinks };
|
|
@@ -0,0 +1,69 @@
|
|
|
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 SocialLinks_exports = {};
|
|
30
|
+
__export(SocialLinks_exports, {
|
|
31
|
+
SocialLinks: () => SocialLinks
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(SocialLinks_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_Icon = require("../icon/Icon.js");
|
|
38
|
+
function isElement(icon) {
|
|
39
|
+
return React.isValidElement(icon);
|
|
40
|
+
}
|
|
41
|
+
const SocialLinks = React.forwardRef(
|
|
42
|
+
({ className, links, label = "Social links", iconSize = "md", iconTone = "muted", ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { ref, "aria-label": label, className: (0, import_cn.cn)("flex items-center gap-1", className), ...props, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "flex items-center gap-1", children: links.map((link) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
43
|
+
"a",
|
|
44
|
+
{
|
|
45
|
+
href: link.href,
|
|
46
|
+
target: "_blank",
|
|
47
|
+
rel: "noopener noreferrer",
|
|
48
|
+
"aria-label": link.icon ? link.label : void 0,
|
|
49
|
+
className: (0, import_cn.cn)(
|
|
50
|
+
"inline-flex items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
51
|
+
link.icon ? "h-9 w-9" : "px-3 py-1.5 text-sm"
|
|
52
|
+
),
|
|
53
|
+
children: link.icon ? isElement(link.icon) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Icon.Icon, { size: iconSize, tone: iconTone, children: link.icon }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
54
|
+
import_Icon.Icon,
|
|
55
|
+
{
|
|
56
|
+
size: iconSize,
|
|
57
|
+
tone: iconTone,
|
|
58
|
+
icon: link.icon
|
|
59
|
+
}
|
|
60
|
+
) : link.label
|
|
61
|
+
}
|
|
62
|
+
) }, link.href)) }) })
|
|
63
|
+
);
|
|
64
|
+
SocialLinks.displayName = "SocialLinks";
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
SocialLinks
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=SocialLinks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/social-links/SocialLinks.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Icon, type IconProps } from '../icon/Icon';\n\nexport type SocialLink = {\n /** Destination URL. Rendered with safe external-link attributes. */\n href: string;\n /** Accessible name for the destination (e.g. \"GitHub\"). */\n label: string;\n /** Optional icon element or component rendered inside the link. */\n icon?: React.ReactElement | React.ComponentType<React.SVGProps<SVGSVGElement>>;\n};\n\nexport type SocialLinksProps = React.HTMLAttributes<HTMLElement> & {\n links: SocialLink[];\n /** Accessible name for the navigation landmark (default \"Social links\"). */\n label?: string;\n /** Icon size passed through to Icon (default 'md'). */\n iconSize?: IconProps['size'];\n /** Icon tone (default 'muted'). */\n iconTone?: IconProps['tone'];\n};\n\nfunction isElement(icon: SocialLink['icon']): icon is React.ReactElement {\n return React.isValidElement(icon);\n}\n\n/**\n * Row of outbound social/profile links. Every destination is named via\n * `aria-label`, external links get `target=\"_blank\" rel=\"noopener noreferrer\"`,\n * and icon-only links stay accessible because the label is always applied.\n */\nconst SocialLinks = React.forwardRef<HTMLElement, SocialLinksProps>(\n ({ className, links, label = 'Social links', iconSize = 'md', iconTone = 'muted', ...props }, ref) => (\n <nav ref={ref} aria-label={label} className={cn('flex items-center gap-1', className)} {...props}>\n <ul className=\"flex items-center gap-1\">\n {links.map((link) => (\n <li key={link.href}>\n <a\n href={link.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={link.icon ? link.label : undefined}\n className={cn(\n 'inline-flex items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n link.icon ? 'h-9 w-9' : 'px-3 py-1.5 text-sm'\n )}\n >\n {link.icon ? (\n isElement(link.icon) ? (\n <Icon size={iconSize} tone={iconTone}>\n {link.icon}\n </Icon>\n ) : (\n <Icon\n size={iconSize}\n tone={iconTone}\n icon={link.icon as React.ComponentType<React.SVGProps<SVGSVGElement>>}\n />\n )\n ) : (\n link.label\n )}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n )\n);\nSocialLinks.displayName = 'SocialLinks';\n\nexport { SocialLinks };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAkDkB;AAlDlB,YAAuB;AACvB,gBAAmB;AACnB,kBAAqC;AAqBrC,SAAS,UAAU,MAAsD;AACvE,SAAO,MAAM,eAAe,IAAI;AAClC;AAOA,MAAM,cAAc,MAAM;AAAA,EACxB,CAAC,EAAE,WAAW,OAAO,QAAQ,gBAAgB,WAAW,MAAM,WAAW,SAAS,GAAG,MAAM,GAAG,QAC5F,4CAAC,SAAI,KAAU,cAAY,OAAO,eAAW,cAAG,2BAA2B,SAAS,GAAI,GAAG,OACzF,sDAAC,QAAG,WAAU,2BACX,gBAAM,IAAI,CAAC,SACV,4CAAC,QACC;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,KAAK;AAAA,MACX,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,cAAY,KAAK,OAAO,KAAK,QAAQ;AAAA,MACrC,eAAW;AAAA,QACT;AAAA,QACA,KAAK,OAAO,YAAY;AAAA,MAC1B;AAAA,MAEC,eAAK,OACJ,UAAU,KAAK,IAAI,IACjB,4CAAC,oBAAK,MAAM,UAAU,MAAM,UACzB,eAAK,MACR,IAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,MAAM,KAAK;AAAA;AAAA,MACb,IAGF,KAAK;AAAA;AAAA,EAET,KA1BO,KAAK,IA2Bd,CACD,GACH,GACF;AAEJ;AACA,YAAY,cAAc;","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { cn } from "../../utils/cn.mjs";
|
|
4
|
+
import { Icon } from "../icon/Icon.mjs";
|
|
5
|
+
function isElement(icon) {
|
|
6
|
+
return React.isValidElement(icon);
|
|
7
|
+
}
|
|
8
|
+
const SocialLinks = React.forwardRef(
|
|
9
|
+
({ className, links, label = "Social links", iconSize = "md", iconTone = "muted", ...props }, ref) => /* @__PURE__ */ jsx("nav", { ref, "aria-label": label, className: cn("flex items-center gap-1", className), ...props, children: /* @__PURE__ */ jsx("ul", { className: "flex items-center gap-1", children: links.map((link) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsx(
|
|
10
|
+
"a",
|
|
11
|
+
{
|
|
12
|
+
href: link.href,
|
|
13
|
+
target: "_blank",
|
|
14
|
+
rel: "noopener noreferrer",
|
|
15
|
+
"aria-label": link.icon ? link.label : void 0,
|
|
16
|
+
className: cn(
|
|
17
|
+
"inline-flex items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
18
|
+
link.icon ? "h-9 w-9" : "px-3 py-1.5 text-sm"
|
|
19
|
+
),
|
|
20
|
+
children: link.icon ? isElement(link.icon) ? /* @__PURE__ */ jsx(Icon, { size: iconSize, tone: iconTone, children: link.icon }) : /* @__PURE__ */ jsx(
|
|
21
|
+
Icon,
|
|
22
|
+
{
|
|
23
|
+
size: iconSize,
|
|
24
|
+
tone: iconTone,
|
|
25
|
+
icon: link.icon
|
|
26
|
+
}
|
|
27
|
+
) : link.label
|
|
28
|
+
}
|
|
29
|
+
) }, link.href)) }) })
|
|
30
|
+
);
|
|
31
|
+
SocialLinks.displayName = "SocialLinks";
|
|
32
|
+
export {
|
|
33
|
+
SocialLinks
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=SocialLinks.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/social-links/SocialLinks.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cn } from '../../utils/cn';\nimport { Icon, type IconProps } from '../icon/Icon';\n\nexport type SocialLink = {\n /** Destination URL. Rendered with safe external-link attributes. */\n href: string;\n /** Accessible name for the destination (e.g. \"GitHub\"). */\n label: string;\n /** Optional icon element or component rendered inside the link. */\n icon?: React.ReactElement | React.ComponentType<React.SVGProps<SVGSVGElement>>;\n};\n\nexport type SocialLinksProps = React.HTMLAttributes<HTMLElement> & {\n links: SocialLink[];\n /** Accessible name for the navigation landmark (default \"Social links\"). */\n label?: string;\n /** Icon size passed through to Icon (default 'md'). */\n iconSize?: IconProps['size'];\n /** Icon tone (default 'muted'). */\n iconTone?: IconProps['tone'];\n};\n\nfunction isElement(icon: SocialLink['icon']): icon is React.ReactElement {\n return React.isValidElement(icon);\n}\n\n/**\n * Row of outbound social/profile links. Every destination is named via\n * `aria-label`, external links get `target=\"_blank\" rel=\"noopener noreferrer\"`,\n * and icon-only links stay accessible because the label is always applied.\n */\nconst SocialLinks = React.forwardRef<HTMLElement, SocialLinksProps>(\n ({ className, links, label = 'Social links', iconSize = 'md', iconTone = 'muted', ...props }, ref) => (\n <nav ref={ref} aria-label={label} className={cn('flex items-center gap-1', className)} {...props}>\n <ul className=\"flex items-center gap-1\">\n {links.map((link) => (\n <li key={link.href}>\n <a\n href={link.href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n aria-label={link.icon ? link.label : undefined}\n className={cn(\n 'inline-flex items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n link.icon ? 'h-9 w-9' : 'px-3 py-1.5 text-sm'\n )}\n >\n {link.icon ? (\n isElement(link.icon) ? (\n <Icon size={iconSize} tone={iconTone}>\n {link.icon}\n </Icon>\n ) : (\n <Icon\n size={iconSize}\n tone={iconTone}\n icon={link.icon as React.ComponentType<React.SVGProps<SVGSVGElement>>}\n />\n )\n ) : (\n link.label\n )}\n </a>\n </li>\n ))}\n </ul>\n </nav>\n )\n);\nSocialLinks.displayName = 'SocialLinks';\n\nexport { SocialLinks };\n"],"mappings":"AAkDkB;AAlDlB,YAAY,WAAW;AACvB,SAAS,UAAU;AACnB,SAAS,YAA4B;AAqBrC,SAAS,UAAU,MAAsD;AACvE,SAAO,MAAM,eAAe,IAAI;AAClC;AAOA,MAAM,cAAc,MAAM;AAAA,EACxB,CAAC,EAAE,WAAW,OAAO,QAAQ,gBAAgB,WAAW,MAAM,WAAW,SAAS,GAAG,MAAM,GAAG,QAC5F,oBAAC,SAAI,KAAU,cAAY,OAAO,WAAW,GAAG,2BAA2B,SAAS,GAAI,GAAG,OACzF,8BAAC,QAAG,WAAU,2BACX,gBAAM,IAAI,CAAC,SACV,oBAAC,QACC;AAAA,IAAC;AAAA;AAAA,MACC,MAAM,KAAK;AAAA,MACX,QAAO;AAAA,MACP,KAAI;AAAA,MACJ,cAAY,KAAK,OAAO,KAAK,QAAQ;AAAA,MACrC,WAAW;AAAA,QACT;AAAA,QACA,KAAK,OAAO,YAAY;AAAA,MAC1B;AAAA,MAEC,eAAK,OACJ,UAAU,KAAK,IAAI,IACjB,oBAAC,QAAK,MAAM,UAAU,MAAM,UACzB,eAAK,MACR,IAEA;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,MAAM;AAAA,UACN,MAAM,KAAK;AAAA;AAAA,MACb,IAGF,KAAK;AAAA;AAAA,EAET,KA1BO,KAAK,IA2Bd,CACD,GACH,GACF;AAEJ;AACA,YAAY,cAAc;","names":[]}
|
|
@@ -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 social_links_exports = {};
|
|
20
|
+
__export(social_links_exports, {
|
|
21
|
+
SocialLinks: () => import_SocialLinks.SocialLinks
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(social_links_exports);
|
|
24
|
+
var import_SocialLinks = require("./SocialLinks.js");
|
|
25
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
26
|
+
0 && (module.exports = {
|
|
27
|
+
SocialLinks
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/social-links/index.ts"],"sourcesContent":["export { SocialLinks } from './SocialLinks';\nexport type { SocialLinksProps, SocialLink } from './SocialLinks';\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/social-links/index.ts"],"sourcesContent":["export { SocialLinks } from './SocialLinks';\nexport type { SocialLinksProps, SocialLink } from './SocialLinks';\n"],"mappings":"AAAA,SAAS,mBAAmB;","names":[]}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -105,3 +105,9 @@ export * from './components/alert';
|
|
|
105
105
|
export * from './components/popover';
|
|
106
106
|
export * from './components/breadcrumb';
|
|
107
107
|
export * from './components/pagination';
|
|
108
|
+
export * from './components/icon';
|
|
109
|
+
export * from './components/icon-button';
|
|
110
|
+
export * from './components/icon-tile';
|
|
111
|
+
export * from './components/social-links';
|
|
112
|
+
export * from './components/figure';
|
|
113
|
+
export * from './components/media';
|