@sdxc/ui 0.0.0-pre.1
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/LICENSE.md +21 -0
- package/README.md +812 -0
- package/dist/animations/index.d.ts +12 -0
- package/dist/animations/index.js +12 -0
- package/dist/animations/keyframes.d.ts +162 -0
- package/dist/animations/keyframes.js +297 -0
- package/dist/animations/scroll.d.ts +154 -0
- package/dist/animations/scroll.js +228 -0
- package/dist/animations/tokens.d.ts +47 -0
- package/dist/animations/tokens.js +47 -0
- package/dist/animations/transitions.d.ts +143 -0
- package/dist/animations/transitions.js +147 -0
- package/dist/behaviors/announcer.d.ts +90 -0
- package/dist/behaviors/announcer.js +93 -0
- package/dist/behaviors/calendar-model.d.ts +218 -0
- package/dist/behaviors/calendar-model.js +376 -0
- package/dist/behaviors/drag-session.d.ts +119 -0
- package/dist/behaviors/drag-session.js +110 -0
- package/dist/behaviors/filter-model.d.ts +117 -0
- package/dist/behaviors/filter-model.js +185 -0
- package/dist/behaviors/index.d.ts +16 -0
- package/dist/behaviors/index.js +16 -0
- package/dist/behaviors/resize-session.d.ts +115 -0
- package/dist/behaviors/resize-session.js +157 -0
- package/dist/behaviors/scroll-follow-model.d.ts +180 -0
- package/dist/behaviors/scroll-follow-model.js +197 -0
- package/dist/behaviors/selection-model.d.ts +129 -0
- package/dist/behaviors/selection-model.js +259 -0
- package/dist/behaviors/toaster.d.ts +144 -0
- package/dist/behaviors/toaster.js +228 -0
- package/dist/components/accordion.d.ts +93 -0
- package/dist/components/accordion.js +165 -0
- package/dist/components/alert-dialog.d.ts +110 -0
- package/dist/components/alert-dialog.js +169 -0
- package/dist/components/alert.d.ts +109 -0
- package/dist/components/alert.js +160 -0
- package/dist/components/aspect-ratio.d.ts +44 -0
- package/dist/components/aspect-ratio.js +35 -0
- package/dist/components/attachment.d.ts +146 -0
- package/dist/components/attachment.js +320 -0
- package/dist/components/avatar.d.ts +118 -0
- package/dist/components/avatar.js +89 -0
- package/dist/components/badge.d.ts +66 -0
- package/dist/components/badge.js +129 -0
- package/dist/components/breadcrumbs.d.ts +67 -0
- package/dist/components/breadcrumbs.js +121 -0
- package/dist/components/bubble.d.ts +91 -0
- package/dist/components/bubble.js +216 -0
- package/dist/components/button.d.ts +78 -0
- package/dist/components/button.js +207 -0
- package/dist/components/calendar.d.ts +166 -0
- package/dist/components/calendar.js +320 -0
- package/dist/components/card.d.ts +82 -0
- package/dist/components/card.js +126 -0
- package/dist/components/carousel.d.ts +96 -0
- package/dist/components/carousel.js +214 -0
- package/dist/components/chart.d.ts +485 -0
- package/dist/components/chart.js +563 -0
- package/dist/components/checkbox-group.d.ts +58 -0
- package/dist/components/checkbox-group.js +53 -0
- package/dist/components/checkbox.d.ts +61 -0
- package/dist/components/checkbox.js +81 -0
- package/dist/components/color-area.d.ts +83 -0
- package/dist/components/color-area.js +251 -0
- package/dist/components/color-field.d.ts +128 -0
- package/dist/components/color-field.js +73 -0
- package/dist/components/color-picker.d.ts +132 -0
- package/dist/components/color-picker.js +183 -0
- package/dist/components/color-slider.d.ts +103 -0
- package/dist/components/color-slider.js +198 -0
- package/dist/components/color-swatch-picker.d.ts +106 -0
- package/dist/components/color-swatch-picker.js +75 -0
- package/dist/components/color-swatch.d.ts +57 -0
- package/dist/components/color-swatch.js +82 -0
- package/dist/components/color-wheel.d.ts +58 -0
- package/dist/components/color-wheel.js +160 -0
- package/dist/components/combobox.d.ts +73 -0
- package/dist/components/combobox.js +108 -0
- package/dist/components/command.d.ts +80 -0
- package/dist/components/command.js +151 -0
- package/dist/components/confirm.d.ts +124 -0
- package/dist/components/confirm.js +56 -0
- package/dist/components/context-menu.d.ts +108 -0
- package/dist/components/context-menu.js +200 -0
- package/dist/components/date-field.d.ts +110 -0
- package/dist/components/date-field.js +49 -0
- package/dist/components/date-picker.d.ts +136 -0
- package/dist/components/date-picker.js +155 -0
- package/dist/components/date-range-picker.d.ts +152 -0
- package/dist/components/date-range-picker.js +106 -0
- package/dist/components/description.d.ts +36 -0
- package/dist/components/description.js +21 -0
- package/dist/components/dialog.d.ts +97 -0
- package/dist/components/dialog.js +203 -0
- package/dist/components/disclosure.d.ts +85 -0
- package/dist/components/disclosure.js +180 -0
- package/dist/components/drawer.d.ts +82 -0
- package/dist/components/drawer.js +162 -0
- package/dist/components/drop-indicator.d.ts +43 -0
- package/dist/components/drop-indicator.js +47 -0
- package/dist/components/drop-zone.d.ts +73 -0
- package/dist/components/drop-zone.js +54 -0
- package/dist/components/empty.d.ts +89 -0
- package/dist/components/empty.js +129 -0
- package/dist/components/field-error.d.ts +41 -0
- package/dist/components/field-error.js +36 -0
- package/dist/components/file-trigger.d.ts +84 -0
- package/dist/components/file-trigger.js +169 -0
- package/dist/components/form.d.ts +118 -0
- package/dist/components/form.js +113 -0
- package/dist/components/grid-list.d.ts +112 -0
- package/dist/components/grid-list.js +220 -0
- package/dist/components/group.d.ts +45 -0
- package/dist/components/group.js +44 -0
- package/dist/components/header.d.ts +33 -0
- package/dist/components/header.js +29 -0
- package/dist/components/heading-scope.d.ts +83 -0
- package/dist/components/heading-scope.js +82 -0
- package/dist/components/heading.d.ts +50 -0
- package/dist/components/heading.js +31 -0
- package/dist/components/hover-card.d.ts +77 -0
- package/dist/components/hover-card.js +151 -0
- package/dist/components/image-placeholder.d.ts +105 -0
- package/dist/components/image-placeholder.js +212 -0
- package/dist/components/index.d.ts +109 -0
- package/dist/components/index.js +109 -0
- package/dist/components/input.d.ts +53 -0
- package/dist/components/input.js +76 -0
- package/dist/components/item.d.ts +97 -0
- package/dist/components/item.js +185 -0
- package/dist/components/keyboard.d.ts +33 -0
- package/dist/components/keyboard.js +20 -0
- package/dist/components/label.d.ts +38 -0
- package/dist/components/label.js +24 -0
- package/dist/components/link-button.d.ts +59 -0
- package/dist/components/link-button.js +174 -0
- package/dist/components/link.d.ts +43 -0
- package/dist/components/link.js +85 -0
- package/dist/components/listbox.d.ts +119 -0
- package/dist/components/listbox.js +114 -0
- package/dist/components/logo.d.ts +117 -0
- package/dist/components/logo.js +89 -0
- package/dist/components/marker.d.ts +82 -0
- package/dist/components/marker.js +163 -0
- package/dist/components/menu.d.ts +90 -0
- package/dist/components/menu.js +146 -0
- package/dist/components/menubar.d.ts +54 -0
- package/dist/components/menubar.js +118 -0
- package/dist/components/message-scroller.d.ts +109 -0
- package/dist/components/message-scroller.js +180 -0
- package/dist/components/message.d.ts +104 -0
- package/dist/components/message.js +200 -0
- package/dist/components/meter.d.ts +60 -0
- package/dist/components/meter.js +110 -0
- package/dist/components/modal.d.ts +71 -0
- package/dist/components/modal.js +120 -0
- package/dist/components/nav-link.d.ts +53 -0
- package/dist/components/nav-link.js +83 -0
- package/dist/components/navigation-menu.d.ts +150 -0
- package/dist/components/navigation-menu.js +381 -0
- package/dist/components/number-field.d.ts +76 -0
- package/dist/components/number-field.js +190 -0
- package/dist/components/otp-field.d.ts +68 -0
- package/dist/components/otp-field.js +46 -0
- package/dist/components/overlay-arrow.d.ts +51 -0
- package/dist/components/overlay-arrow.js +77 -0
- package/dist/components/pagination.d.ts +67 -0
- package/dist/components/pagination.js +164 -0
- package/dist/components/popover.d.ts +69 -0
- package/dist/components/popover.js +68 -0
- package/dist/components/progress-bar.d.ts +53 -0
- package/dist/components/progress-bar.js +90 -0
- package/dist/components/radio-group.d.ts +102 -0
- package/dist/components/radio-group.js +114 -0
- package/dist/components/range-calendar.d.ts +169 -0
- package/dist/components/range-calendar.js +216 -0
- package/dist/components/resizable.d.ts +98 -0
- package/dist/components/resizable.js +151 -0
- package/dist/components/scroll-area.d.ts +54 -0
- package/dist/components/scroll-area.js +89 -0
- package/dist/components/search-field.d.ts +55 -0
- package/dist/components/search-field.js +49 -0
- package/dist/components/section.d.ts +37 -0
- package/dist/components/section.js +22 -0
- package/dist/components/select.d.ts +96 -0
- package/dist/components/select.js +285 -0
- package/dist/components/selection-indicator.d.ts +47 -0
- package/dist/components/selection-indicator.js +50 -0
- package/dist/components/sentinel-row.d.ts +22 -0
- package/dist/components/sentinel-row.js +29 -0
- package/dist/components/separator.d.ts +35 -0
- package/dist/components/separator.js +48 -0
- package/dist/components/shared-element.d.ts +45 -0
- package/dist/components/shared-element.js +48 -0
- package/dist/components/sheet.d.ts +78 -0
- package/dist/components/sheet.js +167 -0
- package/dist/components/sidebar.d.ts +288 -0
- package/dist/components/sidebar.js +1068 -0
- package/dist/components/skeleton.d.ts +36 -0
- package/dist/components/skeleton.js +38 -0
- package/dist/components/slider.d.ts +102 -0
- package/dist/components/slider.js +179 -0
- package/dist/components/spinner.d.ts +55 -0
- package/dist/components/spinner.js +51 -0
- package/dist/components/switch.d.ts +47 -0
- package/dist/components/switch.js +82 -0
- package/dist/components/table.d.ts +139 -0
- package/dist/components/table.js +216 -0
- package/dist/components/tabs.d.ts +124 -0
- package/dist/components/tabs.js +246 -0
- package/dist/components/tag-group.d.ts +83 -0
- package/dist/components/tag-group.js +157 -0
- package/dist/components/text-field.d.ts +119 -0
- package/dist/components/text-field.js +51 -0
- package/dist/components/text.d.ts +34 -0
- package/dist/components/text.js +19 -0
- package/dist/components/textarea.d.ts +52 -0
- package/dist/components/textarea.js +82 -0
- package/dist/components/time-field.d.ts +110 -0
- package/dist/components/time-field.js +48 -0
- package/dist/components/toast.d.ts +149 -0
- package/dist/components/toast.js +365 -0
- package/dist/components/toggle-button.d.ts +115 -0
- package/dist/components/toggle-button.js +237 -0
- package/dist/components/toolbar.d.ts +47 -0
- package/dist/components/toolbar.js +54 -0
- package/dist/components/tooltip.d.ts +52 -0
- package/dist/components/tooltip.js +92 -0
- package/dist/components/tree.d.ts +123 -0
- package/dist/components/tree.js +239 -0
- package/dist/components/typeset.d.ts +53 -0
- package/dist/components/typeset.js +271 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/mixins/aria-checked.d.ts +42 -0
- package/dist/mixins/aria-checked.js +127 -0
- package/dist/mixins/attachment-trigger.d.ts +64 -0
- package/dist/mixins/attachment-trigger.js +190 -0
- package/dist/mixins/calendar-keys.d.ts +27 -0
- package/dist/mixins/calendar-keys.js +113 -0
- package/dist/mixins/carousel-controls.d.ts +30 -0
- package/dist/mixins/carousel-controls.js +222 -0
- package/dist/mixins/chart-tooltip.d.ts +118 -0
- package/dist/mixins/chart-tooltip.js +323 -0
- package/dist/mixins/clear-field.d.ts +60 -0
- package/dist/mixins/clear-field.js +100 -0
- package/dist/mixins/color-area-drag.d.ts +58 -0
- package/dist/mixins/color-area-drag.js +162 -0
- package/dist/mixins/color-channel-sync.d.ts +73 -0
- package/dist/mixins/color-channel-sync.js +169 -0
- package/dist/mixins/color-preview.d.ts +28 -0
- package/dist/mixins/color-preview.js +77 -0
- package/dist/mixins/color-wheel-drag.d.ts +58 -0
- package/dist/mixins/color-wheel-drag.js +139 -0
- package/dist/mixins/combobox-filter.d.ts +59 -0
- package/dist/mixins/combobox-filter.js +81 -0
- package/dist/mixins/command-filter.d.ts +55 -0
- package/dist/mixins/command-filter.js +121 -0
- package/dist/mixins/command-keys.d.ts +31 -0
- package/dist/mixins/command-keys.js +116 -0
- package/dist/mixins/context-menu.d.ts +24 -0
- package/dist/mixins/context-menu.js +64 -0
- package/dist/mixins/copy-to-clipboard.d.ts +64 -0
- package/dist/mixins/copy-to-clipboard.js +109 -0
- package/dist/mixins/dismiss.d.ts +77 -0
- package/dist/mixins/dismiss.js +151 -0
- package/dist/mixins/drag-reorder.d.ts +88 -0
- package/dist/mixins/drag-reorder.js +214 -0
- package/dist/mixins/drop-zone.d.ts +52 -0
- package/dist/mixins/drop-zone.js +132 -0
- package/dist/mixins/dual-range.d.ts +60 -0
- package/dist/mixins/dual-range.js +100 -0
- package/dist/mixins/grid-list-keys.d.ts +34 -0
- package/dist/mixins/grid-list-keys.js +260 -0
- package/dist/mixins/heading-level-fallback.d.ts +81 -0
- package/dist/mixins/heading-level-fallback.js +112 -0
- package/dist/mixins/hotkey.d.ts +26 -0
- package/dist/mixins/hotkey.js +132 -0
- package/dist/mixins/image-fallback.d.ts +57 -0
- package/dist/mixins/image-fallback.js +86 -0
- package/dist/mixins/index.d.ts +48 -0
- package/dist/mixins/index.js +48 -0
- package/dist/mixins/listbox-keys.d.ts +52 -0
- package/dist/mixins/listbox-keys.js +63 -0
- package/dist/mixins/long-press.d.ts +76 -0
- package/dist/mixins/long-press.js +130 -0
- package/dist/mixins/menu-keys.d.ts +40 -0
- package/dist/mixins/menu-keys.js +117 -0
- package/dist/mixins/menubar-keys.d.ts +59 -0
- package/dist/mixins/menubar-keys.js +230 -0
- package/dist/mixins/message-follow.d.ts +56 -0
- package/dist/mixins/message-follow.js +368 -0
- package/dist/mixins/otp-slots.d.ts +53 -0
- package/dist/mixins/otp-slots.js +175 -0
- package/dist/mixins/persist.d.ts +36 -0
- package/dist/mixins/persist.js +78 -0
- package/dist/mixins/press-toggle.d.ts +43 -0
- package/dist/mixins/press-toggle.js +61 -0
- package/dist/mixins/range-preview.d.ts +26 -0
- package/dist/mixins/range-preview.js +120 -0
- package/dist/mixins/resize-handle.d.ts +101 -0
- package/dist/mixins/resize-handle.js +288 -0
- package/dist/mixins/stepper.d.ts +81 -0
- package/dist/mixins/stepper.js +194 -0
- package/dist/mixins/tab-keys.d.ts +30 -0
- package/dist/mixins/tab-keys.js +63 -0
- package/dist/mixins/theme-toggle.d.ts +82 -0
- package/dist/mixins/theme-toggle.js +158 -0
- package/dist/mixins/track-host-node.d.ts +34 -0
- package/dist/mixins/track-host-node.js +42 -0
- package/dist/mixins/treeKeys.d.ts +57 -0
- package/dist/mixins/treeKeys.js +266 -0
- package/dist/mixins/validate.d.ts +65 -0
- package/dist/mixins/validate.js +139 -0
- package/dist/mixins/view-transition.d.ts +56 -0
- package/dist/mixins/view-transition.js +111 -0
- package/dist/styles/chart-palette.d.ts +34 -0
- package/dist/styles/chart-palette.js +27 -0
- package/dist/styles/field-stack-layout.d.ts +27 -0
- package/dist/styles/field-stack-layout.js +16 -0
- package/dist/styles/floating-surface.d.ts +32 -0
- package/dist/styles/floating-surface.js +30 -0
- package/dist/styles/graphic-host.d.ts +25 -0
- package/dist/styles/graphic-host.js +18 -0
- package/dist/styles/index.d.ts +20 -0
- package/dist/styles/index.js +20 -0
- package/dist/styles/interactive-transition.d.ts +32 -0
- package/dist/styles/interactive-transition.js +32 -0
- package/dist/styles/legend-toggle.d.ts +29 -0
- package/dist/styles/legend-toggle.js +24 -0
- package/dist/styles/output-caption-text.d.ts +22 -0
- package/dist/styles/output-caption-text.js +15 -0
- package/dist/styles/panel-chrome.d.ts +34 -0
- package/dist/styles/panel-chrome.js +26 -0
- package/dist/styles/range-thumb-appearance.d.ts +36 -0
- package/dist/styles/range-thumb-appearance.js +76 -0
- package/dist/styles/rtl-aware-gradient-direction.d.ts +28 -0
- package/dist/styles/rtl-aware-gradient-direction.js +28 -0
- package/dist/styles/semantic-color-panel.d.ts +35 -0
- package/dist/styles/semantic-color-panel.js +41 -0
- package/dist/utils/chart-marker-indices.d.ts +22 -0
- package/dist/utils/chart-marker-indices.js +45 -0
- package/dist/utils/chart-path.d.ts +86 -0
- package/dist/utils/chart-path.js +122 -0
- package/dist/utils/chart-scale.d.ts +182 -0
- package/dist/utils/chart-scale.js +221 -0
- package/dist/utils/color-math.d.ts +252 -0
- package/dist/utils/color-math.js +480 -0
- package/dist/utils/command-event.d.ts +24 -0
- package/dist/utils/command-event.js +26 -0
- package/dist/utils/css-styles.d.ts +21 -0
- package/dist/utils/css-styles.js +11 -0
- package/dist/utils/decorative-icon.d.ts +15 -0
- package/dist/utils/decorative-icon.js +15 -0
- package/dist/utils/disabled-selector.d.ts +22 -0
- package/dist/utils/disabled-selector.js +22 -0
- package/dist/utils/dispatch-change.d.ts +17 -0
- package/dist/utils/dispatch-change.js +19 -0
- package/dist/utils/field-parts.d.ts +26 -0
- package/dist/utils/field-parts.js +12 -0
- package/dist/utils/full-turn-radians.d.ts +16 -0
- package/dist/utils/full-turn-radians.js +16 -0
- package/dist/utils/geometry.d.ts +14 -0
- package/dist/utils/geometry.js +9 -0
- package/dist/utils/has-accessible-text.d.ts +19 -0
- package/dist/utils/has-accessible-text.js +30 -0
- package/dist/utils/hue-spectrum.d.ts +19 -0
- package/dist/utils/hue-spectrum.js +19 -0
- package/dist/utils/index.d.ts +35 -0
- package/dist/utils/index.js +35 -0
- package/dist/utils/is-new-primary-press.d.ts +29 -0
- package/dist/utils/is-new-primary-press.js +31 -0
- package/dist/utils/keyboard-nav.d.ts +64 -0
- package/dist/utils/keyboard-nav.js +79 -0
- package/dist/utils/merge-style.d.ts +33 -0
- package/dist/utils/merge-style.js +30 -0
- package/dist/utils/paired-range-inputs.d.ts +26 -0
- package/dist/utils/paired-range-inputs.js +29 -0
- package/dist/utils/placement.d.ts +18 -0
- package/dist/utils/placement.js +12 -0
- package/dist/utils/prefers-reduced-motion.d.ts +17 -0
- package/dist/utils/prefers-reduced-motion.js +19 -0
- package/dist/utils/resolve-field-wiring.d.ts +83 -0
- package/dist/utils/resolve-field-wiring.js +53 -0
- package/dist/utils/resolve-fill-percent.d.ts +28 -0
- package/dist/utils/resolve-fill-percent.js +34 -0
- package/dist/utils/round-precision.d.ts +22 -0
- package/dist/utils/round-precision.js +25 -0
- package/dist/utils/semantic-color-panel.d.ts +35 -0
- package/dist/utils/semantic-color-panel.js +28 -0
- package/dist/utils/semantic-color.d.ts +17 -0
- package/dist/utils/semantic-color.js +11 -0
- package/dist/utils/warn-if-no-accessible-name.d.ts +52 -0
- package/dist/utils/warn-if-no-accessible-name.js +55 -0
- package/dist/utils/write-cookie.d.ts +35 -0
- package/dist/utils/write-cookie.js +37 -0
- package/package.json +32 -0
- package/src/reset.css +223 -0
- package/src/theme.css +146 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A supplementary detail panel that appears beside a trigger on hover or
|
|
3
|
+
* keyboard focus — a user card beneath an @mention, a definition beneath a
|
|
4
|
+
* term. Its panel shares {@link Popover}'s rounded, bordered, shadowed
|
|
5
|
+
* surface, sized narrower and padded for a compact block of text. Reveal
|
|
6
|
+
* rides `:hover` and `:focus-within` on the compound root, since a
|
|
7
|
+
* hover-revealed surface has no invoker to click — the hover path sits
|
|
8
|
+
* behind `@media (hover: hover)` to avoid a stuck-open panel on coarse
|
|
9
|
+
* pointers, while focus stays unconditional for keyboard and touch users.
|
|
10
|
+
*
|
|
11
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
12
|
+
* @copyright Sergio Xalambrí 2026
|
|
13
|
+
*/
|
|
14
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/ui";
|
|
15
|
+
import type { AnchorPlacement } from "../utils/placement.js";
|
|
16
|
+
/**
|
|
17
|
+
* Prop types for {@link HoverCard} and its compound parts.
|
|
18
|
+
*/
|
|
19
|
+
export declare namespace HoverCard {
|
|
20
|
+
/**
|
|
21
|
+
* Side of the trigger the panel renders against, and — for corner variants
|
|
22
|
+
* — which trigger edge it aligns to on the perpendicular axis. Names a
|
|
23
|
+
* physical viewport side, so it keeps attaching under any `dir` value.
|
|
24
|
+
*/
|
|
25
|
+
type Placement = AnchorPlacement;
|
|
26
|
+
/**
|
|
27
|
+
* Every native `<span>` attribute, plus the `mix` passthrough. This is
|
|
28
|
+
* the compound root every part below nests inside — its own hover and
|
|
29
|
+
* focus-within state is what reveals {@link HoverCard.Content}.
|
|
30
|
+
*/
|
|
31
|
+
interface Props extends TagProps<"span"> {
|
|
32
|
+
/** The compound root's parts: {@link HoverCard.Trigger} followed by {@link HoverCard.Content}. */
|
|
33
|
+
children: RemixNode;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Props accepted by {@link HoverCard.Trigger}.
|
|
37
|
+
*/
|
|
38
|
+
interface TriggerProps extends TagProps<"span"> {
|
|
39
|
+
/**
|
|
40
|
+
* The visible trigger — a link, button, or other element. The root
|
|
41
|
+
* reveals {@link HoverCard.Content} whenever focus or a hover-capable
|
|
42
|
+
* pointer rests inside it, so pointer users reach the panel even without a focusable child.
|
|
43
|
+
*/
|
|
44
|
+
children: RemixNode;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Props accepted by {@link HoverCard.Content}.
|
|
48
|
+
*/
|
|
49
|
+
interface ContentProps extends TagProps<"div"> {
|
|
50
|
+
/** Side of the trigger to render against. Defaults to {@link DEFAULT_PLACEMENT}. */
|
|
51
|
+
placement?: Placement;
|
|
52
|
+
/** The panel's content. */
|
|
53
|
+
children: RemixNode;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Renders the compound root: a `<span>` providing {@link HoverCard.Content}'s
|
|
58
|
+
* anchor and the hover/focus-within scope that reveals it, so hovering or
|
|
59
|
+
* focusing the trigger or panel keeps it open with no script-tracked state.
|
|
60
|
+
*
|
|
61
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
62
|
+
* @returns The render function producing the compound root's markup.
|
|
63
|
+
* @example
|
|
64
|
+
* <HoverCard>
|
|
65
|
+
* <HoverCard.Trigger>
|
|
66
|
+
* <Link href={`/users/${user.handle}`}>@{user.handle}</Link>
|
|
67
|
+
* </HoverCard.Trigger>
|
|
68
|
+
* <HoverCard.Content aria-label={t("userCard.label", { name: user.name })}>
|
|
69
|
+
* <p>{user.bio}</p>
|
|
70
|
+
* </HoverCard.Content>
|
|
71
|
+
* </HoverCard>
|
|
72
|
+
*/
|
|
73
|
+
export declare function HoverCard(handle: Handle<HoverCard.Props>): () => import("remix/ui").RemixElement;
|
|
74
|
+
export declare namespace HoverCard {
|
|
75
|
+
var Trigger: (handle: Handle<HoverCard.TriggerProps>) => () => import("remix/ui").RemixElement;
|
|
76
|
+
var Content: (handle: Handle<HoverCard.ContentProps>) => () => import("remix/ui").RemixElement;
|
|
77
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/ui/jsx-runtime";
|
|
2
|
+
import { fg } from "@sdxc/u/color";
|
|
3
|
+
import { opacity, transition, transitionDuration, visibility } from "@sdxc/u/effects";
|
|
4
|
+
import { pointerEvents, raw } from "@sdxc/u/general";
|
|
5
|
+
import { absolute, contents, inlineBlock, insBe, insBs, insIe, insIs, relative, } from "@sdxc/u/layout";
|
|
6
|
+
import { media } from "@sdxc/u/responsive";
|
|
7
|
+
import { is, mb, mbe, mbs, marginLeft, marginRight, mi, p } from "@sdxc/u/size";
|
|
8
|
+
import { when } from "@sdxc/u/state";
|
|
9
|
+
import { text } from "@sdxc/u/typography";
|
|
10
|
+
import { floatingSurface } from "../styles/floating-surface.js";
|
|
11
|
+
/**
|
|
12
|
+
* Side of the trigger {@link HoverCard.Content} renders against when
|
|
13
|
+
* `placement` is left unset.
|
|
14
|
+
*/
|
|
15
|
+
const DEFAULT_PLACEMENT = "bottom";
|
|
16
|
+
/**
|
|
17
|
+
* Renders the compound root: a `<span>` providing {@link HoverCard.Content}'s
|
|
18
|
+
* anchor and the hover/focus-within scope that reveals it, so hovering or
|
|
19
|
+
* focusing the trigger or panel keeps it open with no script-tracked state.
|
|
20
|
+
*
|
|
21
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
22
|
+
* @returns The render function producing the compound root's markup.
|
|
23
|
+
* @example
|
|
24
|
+
* <HoverCard>
|
|
25
|
+
* <HoverCard.Trigger>
|
|
26
|
+
* <Link href={`/users/${user.handle}`}>@{user.handle}</Link>
|
|
27
|
+
* </HoverCard.Trigger>
|
|
28
|
+
* <HoverCard.Content aria-label={t("userCard.label", { name: user.name })}>
|
|
29
|
+
* <p>{user.bio}</p>
|
|
30
|
+
* </HoverCard.Content>
|
|
31
|
+
* </HoverCard>
|
|
32
|
+
*/
|
|
33
|
+
export function HoverCard(handle) {
|
|
34
|
+
return () => {
|
|
35
|
+
let { children, mix, ...rest } = handle.props;
|
|
36
|
+
return (_jsx("span", { "data-slot": "hover-card", ...rest, mix: [
|
|
37
|
+
relative(),
|
|
38
|
+
inlineBlock(),
|
|
39
|
+
media("(hover: hover)", when('&:hover [data-slot="hover-card-content"]', [
|
|
40
|
+
opacity(100),
|
|
41
|
+
visibility(),
|
|
42
|
+
pointerEvents("auto"),
|
|
43
|
+
raw({
|
|
44
|
+
transitionDelay: "var(--ui-hover-card-open-delay, 0.4s)",
|
|
45
|
+
}),
|
|
46
|
+
])),
|
|
47
|
+
when('&:focus-within [data-slot="hover-card-content"]', [
|
|
48
|
+
opacity(100),
|
|
49
|
+
visibility(),
|
|
50
|
+
pointerEvents("auto"),
|
|
51
|
+
raw({
|
|
52
|
+
transitionDelay: "0s",
|
|
53
|
+
}),
|
|
54
|
+
]),
|
|
55
|
+
mix,
|
|
56
|
+
], children: children }));
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Renders {@link HoverCard.TriggerProps.children} inside a `<span>` styled
|
|
61
|
+
* `display: contents`, so the trigger keeps the child's own layout and
|
|
62
|
+
* hover/focus-within participation, visible straight through to the root above.
|
|
63
|
+
*
|
|
64
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
65
|
+
* @returns The render function producing the trigger's markup.
|
|
66
|
+
* @example
|
|
67
|
+
* <HoverCard.Trigger>
|
|
68
|
+
* <Link href={`/users/${user.handle}`}>@{user.handle}</Link>
|
|
69
|
+
* </HoverCard.Trigger>
|
|
70
|
+
*/
|
|
71
|
+
HoverCard.Trigger = function HoverCardTrigger(handle) {
|
|
72
|
+
return () => {
|
|
73
|
+
let { children, mix, ...rest } = handle.props;
|
|
74
|
+
return (_jsx("span", { "data-slot": "hover-card-trigger", ...rest, mix: [contents(), mix], children: children }));
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Renders the panel: a `<div>` sharing {@link Popover}'s surface and placement
|
|
79
|
+
* contract, kept in normal stacking order for its CSS-driven hover/focus
|
|
80
|
+
* reveal, with delays tuned for pointer and keyboard users.
|
|
81
|
+
*
|
|
82
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
83
|
+
* @returns The render function producing the panel's markup.
|
|
84
|
+
* @example
|
|
85
|
+
* <HoverCard.Content placement="bottom-start">
|
|
86
|
+
* <OverlayArrow placement="bottom-start">
|
|
87
|
+
* <svg width={12} height={12} viewBox="0 0 12 12">
|
|
88
|
+
* <path d="M0 0 L6 6 L12 0" />
|
|
89
|
+
* </svg>
|
|
90
|
+
* </OverlayArrow>
|
|
91
|
+
* <p>{user.bio}</p>
|
|
92
|
+
* </HoverCard.Content>
|
|
93
|
+
*/
|
|
94
|
+
HoverCard.Content = function HoverCardContent(handle) {
|
|
95
|
+
return () => {
|
|
96
|
+
let { placement, children, mix, ...rest } = handle.props;
|
|
97
|
+
let resolvedPlacement = placement ?? DEFAULT_PLACEMENT;
|
|
98
|
+
return (_jsx("div", { "data-slot": "hover-card-content", "data-placement": resolvedPlacement, ...rest, mix: [
|
|
99
|
+
floatingSurface(),
|
|
100
|
+
absolute(),
|
|
101
|
+
p(4),
|
|
102
|
+
fg("neutral.emphasis"),
|
|
103
|
+
is("18rem"),
|
|
104
|
+
text("sm"),
|
|
105
|
+
opacity(0),
|
|
106
|
+
transition("opacity, visibility, pointer-events"),
|
|
107
|
+
visibility("hidden"),
|
|
108
|
+
pointerEvents(),
|
|
109
|
+
raw({
|
|
110
|
+
zIndex: "var(--ui-hover-card-z, 50)",
|
|
111
|
+
transitionBehavior: "allow-discrete",
|
|
112
|
+
transitionDelay: "var(--ui-hover-card-close-delay, 0.2s)",
|
|
113
|
+
}),
|
|
114
|
+
when('&[data-placement^="bottom"]', [
|
|
115
|
+
mbs("var(--ui-popover-offset, 0.5rem)"),
|
|
116
|
+
insBs("100%"),
|
|
117
|
+
]),
|
|
118
|
+
when('&[data-placement^="top"]', [
|
|
119
|
+
mbe("var(--ui-popover-offset, 0.5rem)"),
|
|
120
|
+
insBe("100%"),
|
|
121
|
+
]),
|
|
122
|
+
when('&[data-placement^="left"]', [
|
|
123
|
+
marginRight("var(--ui-popover-offset, 0.5rem)"),
|
|
124
|
+
raw({ right: "100%" }),
|
|
125
|
+
]),
|
|
126
|
+
when('&[data-placement^="right"]', [
|
|
127
|
+
marginLeft("var(--ui-popover-offset, 0.5rem)"),
|
|
128
|
+
raw({ left: "100%" }),
|
|
129
|
+
]),
|
|
130
|
+
when('&[data-placement="bottom"], &[data-placement="top"]', [
|
|
131
|
+
mi("auto"),
|
|
132
|
+
insIs("0"),
|
|
133
|
+
insIe("0"),
|
|
134
|
+
]),
|
|
135
|
+
when('&[data-placement="bottom-start"], &[data-placement="top-start"]', insIs("0")),
|
|
136
|
+
when('&[data-placement="bottom-end"], &[data-placement="top-end"]', insIe("0")),
|
|
137
|
+
when('&[data-placement="left"], &[data-placement="right"]', [
|
|
138
|
+
mb("auto"),
|
|
139
|
+
insBs("0"),
|
|
140
|
+
insBe("0"),
|
|
141
|
+
]),
|
|
142
|
+
when('&[data-placement="left-start"], &[data-placement="right-start"]', insBs("0")),
|
|
143
|
+
when('&[data-placement="left-end"], &[data-placement="right-end"]', insBe("0")),
|
|
144
|
+
media("(prefers-reduced-motion: reduce)", [
|
|
145
|
+
transitionDuration("0s"),
|
|
146
|
+
raw({ transitionDelay: "0s" }),
|
|
147
|
+
]),
|
|
148
|
+
mix,
|
|
149
|
+
], children: children }));
|
|
150
|
+
};
|
|
151
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared foundation for a fixed-size image-with-fallback box — a user
|
|
3
|
+
* avatar, a brand logo, or any other picture that needs a graceful stand-in
|
|
4
|
+
* before it loads or when it's missing. It renders a sized, shaped host that
|
|
5
|
+
* an image and a fallback layer both stack into, plus a corner status badge
|
|
6
|
+
* and a group of overlapping instances with a trailing overflow count.
|
|
7
|
+
*
|
|
8
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
9
|
+
* @copyright Sergio Xalambrí 2026
|
|
10
|
+
*/
|
|
11
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/ui";
|
|
12
|
+
/**
|
|
13
|
+
* Prop types for {@link ImagePlaceholder} and its compound parts.
|
|
14
|
+
*/
|
|
15
|
+
export declare namespace ImagePlaceholder {
|
|
16
|
+
/**
|
|
17
|
+
* Size variant controlling the host's rendered dimensions and, through
|
|
18
|
+
* ordinary inheritance, the fallback initials' font size.
|
|
19
|
+
*/
|
|
20
|
+
type Size = "sm" | "md" | "lg";
|
|
21
|
+
/**
|
|
22
|
+
* Shape variant controlling the corner rounding of the host, its image,
|
|
23
|
+
* and its fallback layer: `"circle"` renders a fully rounded disc, and
|
|
24
|
+
* `"square"` renders a softly rounded square.
|
|
25
|
+
*/
|
|
26
|
+
type Shape = "circle" | "square";
|
|
27
|
+
/**
|
|
28
|
+
* Props accepted by {@link ImagePlaceholder}.
|
|
29
|
+
*/
|
|
30
|
+
interface Props extends TagProps<"span"> {
|
|
31
|
+
/** Size variant. Defaults to {@link DEFAULT_SIZE}. */
|
|
32
|
+
size?: Size;
|
|
33
|
+
/** Shape variant. Defaults to {@link DEFAULT_SHAPE}. */
|
|
34
|
+
shape?: Shape;
|
|
35
|
+
/** The host's compound parts: {@link ImagePlaceholder.Image}, {@link ImagePlaceholder.Fallback}, and an optional {@link ImagePlaceholder.Badge}. */
|
|
36
|
+
children: RemixNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Props accepted by {@link ImagePlaceholder.Image}.
|
|
40
|
+
*/
|
|
41
|
+
interface ImageProps extends Omit<TagProps<"img">, "src" | "alt" | "role" | "aria-label" | "aria-labelledby" | "title"> {
|
|
42
|
+
/** Image source URL. */
|
|
43
|
+
src: string;
|
|
44
|
+
/**
|
|
45
|
+
* Accessible text description of the image. Required, since a
|
|
46
|
+
* consumer's own localized description drives what assistive
|
|
47
|
+
* technology announces.
|
|
48
|
+
*/
|
|
49
|
+
alt: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Props accepted by {@link ImagePlaceholder.Fallback}.
|
|
53
|
+
*/
|
|
54
|
+
interface FallbackProps extends TagProps<"span"> {
|
|
55
|
+
/** Fallback content, typically the subject's initials. */
|
|
56
|
+
children: RemixNode;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Props accepted by {@link ImagePlaceholder.Badge}.
|
|
60
|
+
*/
|
|
61
|
+
interface BadgeProps extends TagProps<"span"> {
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Props accepted by {@link ImagePlaceholder.Group}.
|
|
65
|
+
*/
|
|
66
|
+
interface GroupProps extends TagProps<"div"> {
|
|
67
|
+
/** A run of {@link ImagePlaceholder} instances, optionally trailed by {@link ImagePlaceholder.GroupCount}. */
|
|
68
|
+
children: RemixNode;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Props accepted by {@link ImagePlaceholder.GroupCount}.
|
|
72
|
+
*/
|
|
73
|
+
interface GroupCountProps extends TagProps<"span"> {
|
|
74
|
+
/** Shape variant, matching the shape of the sibling placeholders it trails. Defaults to {@link DEFAULT_SHAPE}. */
|
|
75
|
+
shape?: Shape;
|
|
76
|
+
/** The overflow count text, e.g. `"+3"`. */
|
|
77
|
+
children: RemixNode;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Renders the placeholder host: a fixed-size, centered box whose `data-shape`
|
|
82
|
+
* attribute styles it, its image, and its fallback together, leaving room
|
|
83
|
+
* for {@link ImagePlaceholder.Badge} to sit unclipped on the corner.
|
|
84
|
+
*
|
|
85
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
86
|
+
* @returns The render function producing the placeholder's markup.
|
|
87
|
+
* @example
|
|
88
|
+
* <ImagePlaceholder>
|
|
89
|
+
* <ImagePlaceholder.Image src={user.avatarUrl} alt={user.name} />
|
|
90
|
+
* <ImagePlaceholder.Fallback>{initials}</ImagePlaceholder.Fallback>
|
|
91
|
+
* </ImagePlaceholder>
|
|
92
|
+
* @example
|
|
93
|
+
* <ImagePlaceholder size="lg" shape="square">
|
|
94
|
+
* <ImagePlaceholder.Image src={org.logoUrl} alt={org.name} />
|
|
95
|
+
* <ImagePlaceholder.Badge />
|
|
96
|
+
* </ImagePlaceholder>
|
|
97
|
+
*/
|
|
98
|
+
export declare function ImagePlaceholder(handle: Handle<ImagePlaceholder.Props>): () => import("remix/ui").RemixElement;
|
|
99
|
+
export declare namespace ImagePlaceholder {
|
|
100
|
+
var Image: (handle: Handle<ImagePlaceholder.ImageProps>) => () => import("remix/ui").RemixElement;
|
|
101
|
+
var Fallback: (handle: Handle<ImagePlaceholder.FallbackProps>) => () => import("remix/ui").RemixElement;
|
|
102
|
+
var Badge: (handle: Handle<ImagePlaceholder.BadgeProps>) => () => import("remix/ui").RemixElement;
|
|
103
|
+
var Group: (handle: Handle<ImagePlaceholder.GroupProps>) => () => import("remix/ui").RemixElement;
|
|
104
|
+
var GroupCount: (handle: Handle<ImagePlaceholder.GroupCountProps>) => () => import("remix/ui").RemixElement;
|
|
105
|
+
}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/ui/jsx-runtime";
|
|
2
|
+
import { bg, border, fg, outline } from "@sdxc/u/color";
|
|
3
|
+
import { ringShadow, rounded } from "@sdxc/u/effects";
|
|
4
|
+
import { userSelect } from "@sdxc/u/general";
|
|
5
|
+
import { absolute, center, flex, inlineFlex, insBe, insIe, inset, items, justify, relative, shrink, } from "@sdxc/u/layout";
|
|
6
|
+
import { overflow } from "@sdxc/u/overflow";
|
|
7
|
+
import { bs, fit, is, mis } from "@sdxc/u/size";
|
|
8
|
+
import { data, when } from "@sdxc/u/state";
|
|
9
|
+
import { text, textTransform, weight } from "@sdxc/u/typography";
|
|
10
|
+
/** Size variant {@link ImagePlaceholder} falls back to when `size` is omitted. */
|
|
11
|
+
const DEFAULT_SIZE = "md";
|
|
12
|
+
/**
|
|
13
|
+
* Shape variant {@link ImagePlaceholder} and {@link ImagePlaceholder.GroupCount}
|
|
14
|
+
* fall back to when `shape` is omitted.
|
|
15
|
+
*/
|
|
16
|
+
const DEFAULT_SHAPE = "circle";
|
|
17
|
+
/**
|
|
18
|
+
* Renders the placeholder host: a fixed-size, centered box whose `data-shape`
|
|
19
|
+
* attribute styles it, its image, and its fallback together, leaving room
|
|
20
|
+
* for {@link ImagePlaceholder.Badge} to sit unclipped on the corner.
|
|
21
|
+
*
|
|
22
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
23
|
+
* @returns The render function producing the placeholder's markup.
|
|
24
|
+
* @example
|
|
25
|
+
* <ImagePlaceholder>
|
|
26
|
+
* <ImagePlaceholder.Image src={user.avatarUrl} alt={user.name} />
|
|
27
|
+
* <ImagePlaceholder.Fallback>{initials}</ImagePlaceholder.Fallback>
|
|
28
|
+
* </ImagePlaceholder>
|
|
29
|
+
* @example
|
|
30
|
+
* <ImagePlaceholder size="lg" shape="square">
|
|
31
|
+
* <ImagePlaceholder.Image src={org.logoUrl} alt={org.name} />
|
|
32
|
+
* <ImagePlaceholder.Badge />
|
|
33
|
+
* </ImagePlaceholder>
|
|
34
|
+
*/
|
|
35
|
+
export function ImagePlaceholder(handle) {
|
|
36
|
+
return () => {
|
|
37
|
+
let { size, shape, children, mix, ...rest } = handle.props;
|
|
38
|
+
let resolvedSize = size ?? DEFAULT_SIZE;
|
|
39
|
+
let resolvedShape = shape ?? DEFAULT_SHAPE;
|
|
40
|
+
return (_jsx("span", { ...rest, "data-slot": "image-placeholder", "data-size": resolvedSize, "data-shape": resolvedShape, mix: [
|
|
41
|
+
when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
|
|
42
|
+
relative(),
|
|
43
|
+
inlineFlex(),
|
|
44
|
+
items("center"),
|
|
45
|
+
justify("center"),
|
|
46
|
+
bg("neutral.bg-tint-hover"),
|
|
47
|
+
fg("neutral.emphasis"),
|
|
48
|
+
shrink(),
|
|
49
|
+
userSelect(),
|
|
50
|
+
is("var(--ui-image-placeholder-size-md, 2.5rem)"),
|
|
51
|
+
bs("var(--ui-image-placeholder-size-md, 2.5rem)"),
|
|
52
|
+
text("sm"),
|
|
53
|
+
data("size", "sm", [
|
|
54
|
+
is("var(--ui-image-placeholder-size-sm, 2rem)"),
|
|
55
|
+
bs("var(--ui-image-placeholder-size-sm, 2rem)"),
|
|
56
|
+
text("xs"),
|
|
57
|
+
]),
|
|
58
|
+
data("size", "lg", [
|
|
59
|
+
is("var(--ui-image-placeholder-size-lg, 3rem)"),
|
|
60
|
+
bs("var(--ui-image-placeholder-size-lg, 3rem)"),
|
|
61
|
+
text("base"),
|
|
62
|
+
]),
|
|
63
|
+
data("shape", "circle", [
|
|
64
|
+
rounded("full"),
|
|
65
|
+
when('& > [data-slot="image"]', rounded("full")),
|
|
66
|
+
when('& > [data-slot="fallback"]', rounded("full")),
|
|
67
|
+
]),
|
|
68
|
+
data("shape", "square", [
|
|
69
|
+
rounded("lg"),
|
|
70
|
+
when('& > [data-slot="image"]', rounded("lg")),
|
|
71
|
+
when('& > [data-slot="fallback"]', rounded("lg")),
|
|
72
|
+
]),
|
|
73
|
+
mix,
|
|
74
|
+
], children: children }));
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Renders the placeholder's image layer: an `<img>` cropped with
|
|
79
|
+
* `object-fit: cover`, clipped to {@link ImagePlaceholder}'s `data-shape`.
|
|
80
|
+
* Stacking above or below {@link ImagePlaceholder.Fallback} decides what shows.
|
|
81
|
+
*
|
|
82
|
+
* @param handle Runtime handle carrying the host `<img>`'s props.
|
|
83
|
+
* @returns The render function producing the image layer's markup.
|
|
84
|
+
* @example
|
|
85
|
+
* <ImagePlaceholder.Image src={user.avatarUrl} alt={user.name} />
|
|
86
|
+
*/
|
|
87
|
+
ImagePlaceholder.Image = function ImagePlaceholderImage(handle) {
|
|
88
|
+
return () => {
|
|
89
|
+
let { mix, ...rest } = handle.props;
|
|
90
|
+
return (_jsx("img", { ...rest, "data-slot": "image", mix: [
|
|
91
|
+
absolute(),
|
|
92
|
+
is("full"),
|
|
93
|
+
bs("full"),
|
|
94
|
+
fit("cover"),
|
|
95
|
+
inset(0, 0, 0, 0),
|
|
96
|
+
overflow("hidden"),
|
|
97
|
+
mix,
|
|
98
|
+
] }));
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Renders the placeholder's fallback layer: a `<span>` centering a consumer's
|
|
103
|
+
* content in uppercase text. Font size inherits {@link ImagePlaceholder}'s
|
|
104
|
+
* `data-size` via CSS, keeping initials proportional at every size.
|
|
105
|
+
*
|
|
106
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
107
|
+
* @returns The render function producing the fallback layer's markup.
|
|
108
|
+
* @example
|
|
109
|
+
* <ImagePlaceholder.Fallback>{initials}</ImagePlaceholder.Fallback>
|
|
110
|
+
*/
|
|
111
|
+
ImagePlaceholder.Fallback = function ImagePlaceholderFallback(handle) {
|
|
112
|
+
return () => {
|
|
113
|
+
let { children, mix, ...rest } = handle.props;
|
|
114
|
+
return (_jsx("span", { ...rest, "data-slot": "fallback", mix: [
|
|
115
|
+
absolute(),
|
|
116
|
+
center(),
|
|
117
|
+
weight("medium"),
|
|
118
|
+
bg("neutral.bg-tint-pressed"),
|
|
119
|
+
fg("neutral"),
|
|
120
|
+
inset(0, 0, 0, 0),
|
|
121
|
+
overflow("hidden"),
|
|
122
|
+
textTransform("uppercase"),
|
|
123
|
+
mix,
|
|
124
|
+
], children: children }));
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Renders a small status dot pinned to the host's block-end/inline-end
|
|
129
|
+
* corner, always fully rounded regardless of {@link ImagePlaceholder}'s own
|
|
130
|
+
* shape, and ringed to read as cut from whatever sits beneath it.
|
|
131
|
+
*
|
|
132
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
133
|
+
* @returns The render function producing the badge's markup.
|
|
134
|
+
* @example
|
|
135
|
+
* <ImagePlaceholder.Badge />
|
|
136
|
+
*/
|
|
137
|
+
ImagePlaceholder.Badge = function ImagePlaceholderBadge(handle) {
|
|
138
|
+
return () => {
|
|
139
|
+
let { mix, ...rest } = handle.props;
|
|
140
|
+
return (_jsx("span", { ...rest, "data-slot": "badge", mix: [
|
|
141
|
+
absolute(),
|
|
142
|
+
is(3),
|
|
143
|
+
bs(3),
|
|
144
|
+
rounded("full"),
|
|
145
|
+
border({ color: "neutral.tint", width: 2 }),
|
|
146
|
+
bg("neutral.strong"),
|
|
147
|
+
insBe("0"),
|
|
148
|
+
insIe("0"),
|
|
149
|
+
mix,
|
|
150
|
+
] }));
|
|
151
|
+
};
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Renders a row of overlapping placeholders: a flex container that pulls each
|
|
155
|
+
* child back over the previous one and rings each in the neutral tint background,
|
|
156
|
+
* so the overlap reads as stacked cutouts.
|
|
157
|
+
*
|
|
158
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
159
|
+
* @returns The render function producing the group's markup.
|
|
160
|
+
* @example
|
|
161
|
+
* <ImagePlaceholder.Group>
|
|
162
|
+
* <ImagePlaceholder>…</ImagePlaceholder>
|
|
163
|
+
* <ImagePlaceholder>…</ImagePlaceholder>
|
|
164
|
+
* <ImagePlaceholder.GroupCount>+3</ImagePlaceholder.GroupCount>
|
|
165
|
+
* </ImagePlaceholder.Group>
|
|
166
|
+
*/
|
|
167
|
+
ImagePlaceholder.Group = function ImagePlaceholderGroup(handle) {
|
|
168
|
+
return () => {
|
|
169
|
+
let { children, mix, ...rest } = handle.props;
|
|
170
|
+
return (_jsx("div", { ...rest, "data-slot": "group", mix: [
|
|
171
|
+
flex(),
|
|
172
|
+
when("& > * + *", mis(-3)),
|
|
173
|
+
when('& > [data-slot="image-placeholder"]', ringShadow("neutral.tint")),
|
|
174
|
+
mix,
|
|
175
|
+
], children: children }));
|
|
176
|
+
};
|
|
177
|
+
};
|
|
178
|
+
/**
|
|
179
|
+
* Renders the "+N" overflow indicator trailing {@link ImagePlaceholder.Group}:
|
|
180
|
+
* a fixed medium-size box matching {@link ImagePlaceholder}'s dimensions and
|
|
181
|
+
* ring treatment, taking its own `shape` prop to match the sibling placeholders.
|
|
182
|
+
*
|
|
183
|
+
* @param handle Runtime handle carrying the host `<span>`'s props.
|
|
184
|
+
* @returns The render function producing the overflow indicator's markup.
|
|
185
|
+
* @example
|
|
186
|
+
* <ImagePlaceholder.GroupCount>+3</ImagePlaceholder.GroupCount>
|
|
187
|
+
*/
|
|
188
|
+
ImagePlaceholder.GroupCount = function ImagePlaceholderGroupCount(handle) {
|
|
189
|
+
return () => {
|
|
190
|
+
let { shape, children, mix, ...rest } = handle.props;
|
|
191
|
+
let resolvedShape = shape ?? DEFAULT_SHAPE;
|
|
192
|
+
return (_jsx("span", { ...rest, "data-slot": "group-count", "data-shape": resolvedShape, mix: [
|
|
193
|
+
relative(),
|
|
194
|
+
inlineFlex(),
|
|
195
|
+
items("center"),
|
|
196
|
+
justify("center"),
|
|
197
|
+
overflow("hidden"),
|
|
198
|
+
weight("medium"),
|
|
199
|
+
bg("neutral.bg-tint-hover"),
|
|
200
|
+
fg("neutral"),
|
|
201
|
+
when('&[data-shape="circle"]', rounded("full")),
|
|
202
|
+
when('&[data-shape="square"]', rounded("lg")),
|
|
203
|
+
shrink(),
|
|
204
|
+
userSelect(),
|
|
205
|
+
is("var(--ui-image-placeholder-size-md, 2.5rem)"),
|
|
206
|
+
bs("var(--ui-image-placeholder-size-md, 2.5rem)"),
|
|
207
|
+
text("sm"),
|
|
208
|
+
ringShadow("neutral.tint"),
|
|
209
|
+
mix,
|
|
210
|
+
], children: children }));
|
|
211
|
+
};
|
|
212
|
+
};
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel for the component catalog: one module per component, each keeping
|
|
3
|
+
* the compound pattern (`Dialog`, `Dialog.Header`, …) with styles inlined
|
|
4
|
+
* via `css()` on the host element. Re-exports every named export from every
|
|
5
|
+
* component module in the catalog.
|
|
6
|
+
*
|
|
7
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
8
|
+
* @copyright Sergio Xalambrí 2026
|
|
9
|
+
*/
|
|
10
|
+
export * from "./accordion.js";
|
|
11
|
+
export * from "./alert.js";
|
|
12
|
+
export * from "./alert-dialog.js";
|
|
13
|
+
export * from "./aspect-ratio.js";
|
|
14
|
+
export * from "./attachment.js";
|
|
15
|
+
export * from "./avatar.js";
|
|
16
|
+
export * from "./badge.js";
|
|
17
|
+
export * from "./breadcrumbs.js";
|
|
18
|
+
export * from "./bubble.js";
|
|
19
|
+
export * from "./button.js";
|
|
20
|
+
export * from "./calendar.js";
|
|
21
|
+
export * from "./card.js";
|
|
22
|
+
export * from "./carousel.js";
|
|
23
|
+
export * from "./chart.js";
|
|
24
|
+
export * from "./checkbox.js";
|
|
25
|
+
export * from "./checkbox-group.js";
|
|
26
|
+
export * from "./color-area.js";
|
|
27
|
+
export * from "./color-field.js";
|
|
28
|
+
export * from "./color-picker.js";
|
|
29
|
+
export * from "./color-slider.js";
|
|
30
|
+
export * from "./color-swatch.js";
|
|
31
|
+
export * from "./color-swatch-picker.js";
|
|
32
|
+
export * from "./color-wheel.js";
|
|
33
|
+
export * from "./combobox.js";
|
|
34
|
+
export * from "./command.js";
|
|
35
|
+
export * from "./confirm.js";
|
|
36
|
+
export * from "./context-menu.js";
|
|
37
|
+
export * from "./date-field.js";
|
|
38
|
+
export * from "./date-picker.js";
|
|
39
|
+
export * from "./date-range-picker.js";
|
|
40
|
+
export * from "./description.js";
|
|
41
|
+
export * from "./dialog.js";
|
|
42
|
+
export * from "./disclosure.js";
|
|
43
|
+
export * from "./drawer.js";
|
|
44
|
+
export * from "./drop-indicator.js";
|
|
45
|
+
export * from "./drop-zone.js";
|
|
46
|
+
export * from "./empty.js";
|
|
47
|
+
export * from "./field-error.js";
|
|
48
|
+
export * from "./file-trigger.js";
|
|
49
|
+
export * from "./form.js";
|
|
50
|
+
export * from "./grid-list.js";
|
|
51
|
+
export * from "./group.js";
|
|
52
|
+
export * from "./header.js";
|
|
53
|
+
export * from "./heading.js";
|
|
54
|
+
export * from "./heading-scope.js";
|
|
55
|
+
export * from "./hover-card.js";
|
|
56
|
+
export * from "./image-placeholder.js";
|
|
57
|
+
export * from "./input.js";
|
|
58
|
+
export * from "./item.js";
|
|
59
|
+
export * from "./keyboard.js";
|
|
60
|
+
export * from "./label.js";
|
|
61
|
+
export * from "./link.js";
|
|
62
|
+
export * from "./link-button.js";
|
|
63
|
+
export * from "./listbox.js";
|
|
64
|
+
export * from "./logo.js";
|
|
65
|
+
export * from "./marker.js";
|
|
66
|
+
export * from "./menu.js";
|
|
67
|
+
export * from "./menubar.js";
|
|
68
|
+
export * from "./message.js";
|
|
69
|
+
export * from "./message-scroller.js";
|
|
70
|
+
export * from "./meter.js";
|
|
71
|
+
export * from "./modal.js";
|
|
72
|
+
export * from "./nav-link.js";
|
|
73
|
+
export * from "./navigation-menu.js";
|
|
74
|
+
export * from "./number-field.js";
|
|
75
|
+
export * from "./otp-field.js";
|
|
76
|
+
export * from "./overlay-arrow.js";
|
|
77
|
+
export * from "./pagination.js";
|
|
78
|
+
export * from "./popover.js";
|
|
79
|
+
export * from "./progress-bar.js";
|
|
80
|
+
export * from "./radio-group.js";
|
|
81
|
+
export * from "./range-calendar.js";
|
|
82
|
+
export * from "./resizable.js";
|
|
83
|
+
export * from "./scroll-area.js";
|
|
84
|
+
export * from "./search-field.js";
|
|
85
|
+
export * from "./section.js";
|
|
86
|
+
export * from "./select.js";
|
|
87
|
+
export * from "./selection-indicator.js";
|
|
88
|
+
export * from "./sentinel-row.js";
|
|
89
|
+
export * from "./separator.js";
|
|
90
|
+
export * from "./shared-element.js";
|
|
91
|
+
export * from "./sheet.js";
|
|
92
|
+
export * from "./sidebar.js";
|
|
93
|
+
export * from "./skeleton.js";
|
|
94
|
+
export * from "./slider.js";
|
|
95
|
+
export * from "./spinner.js";
|
|
96
|
+
export * from "./switch.js";
|
|
97
|
+
export * from "./table.js";
|
|
98
|
+
export * from "./tabs.js";
|
|
99
|
+
export * from "./tag-group.js";
|
|
100
|
+
export * from "./text.js";
|
|
101
|
+
export * from "./text-field.js";
|
|
102
|
+
export * from "./textarea.js";
|
|
103
|
+
export * from "./time-field.js";
|
|
104
|
+
export * from "./toast.js";
|
|
105
|
+
export * from "./toggle-button.js";
|
|
106
|
+
export * from "./toolbar.js";
|
|
107
|
+
export * from "./tooltip.js";
|
|
108
|
+
export * from "./tree.js";
|
|
109
|
+
export * from "./typeset.js";
|