@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,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An edge-docked panel that renders through {@link Dialog} — the same native
|
|
3
|
+
* `<dialog>` host, Invoker Commands, backdrop dimming, and missing-`id` dev
|
|
4
|
+
* warning — repositioned from a centered panel to a fixed inline-side column
|
|
5
|
+
* entirely through CSS keyed off a `data-side` attribute. Compound parts
|
|
6
|
+
* cover a header, title, description, footer, and a dismiss control shaped
|
|
7
|
+
* for a column-docked panel's own layout rather than a centered dialog's.
|
|
8
|
+
*
|
|
9
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
10
|
+
* @copyright Sergio Xalambrí 2026
|
|
11
|
+
*/
|
|
12
|
+
import type { Handle } from "remix/ui";
|
|
13
|
+
import { Dialog } from "./dialog.js";
|
|
14
|
+
/**
|
|
15
|
+
* Prop types for {@link Sheet} and its compound parts.
|
|
16
|
+
*/
|
|
17
|
+
export declare namespace Sheet {
|
|
18
|
+
/**
|
|
19
|
+
* Physical side of the viewport the panel docks to and slides in from,
|
|
20
|
+
* fixed rather than reading-direction-relative so it keeps docking to the
|
|
21
|
+
* same edge under any `dir` value, matching the safe-area padding's edge.
|
|
22
|
+
*/
|
|
23
|
+
type Side = "left" | "right";
|
|
24
|
+
/** Every prop {@link Dialog.Props} accepts, plus which side the panel docks to. */
|
|
25
|
+
interface Props extends Dialog.Props {
|
|
26
|
+
/** Physical side of the viewport to dock to. Defaults to {@link DEFAULT_SIDE}. */
|
|
27
|
+
side?: Side;
|
|
28
|
+
}
|
|
29
|
+
/** Every prop {@link Dialog.HeaderProps} accepts, unchanged. */
|
|
30
|
+
interface HeaderProps extends Dialog.HeaderProps {
|
|
31
|
+
}
|
|
32
|
+
/** Every prop {@link Dialog.TitleProps} accepts, unchanged. */
|
|
33
|
+
interface TitleProps extends Dialog.TitleProps {
|
|
34
|
+
}
|
|
35
|
+
/** Every prop {@link Dialog.DescriptionProps} accepts, unchanged. */
|
|
36
|
+
interface DescriptionProps extends Dialog.DescriptionProps {
|
|
37
|
+
}
|
|
38
|
+
/** Every prop {@link Dialog.FooterProps} accepts, unchanged. */
|
|
39
|
+
interface FooterProps extends Dialog.FooterProps {
|
|
40
|
+
}
|
|
41
|
+
/** Every prop {@link Dialog.CloseProps} accepts, unchanged. */
|
|
42
|
+
interface CloseProps extends Dialog.CloseProps {
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Renders the panel through {@link Dialog}: fixed, pinned to whichever
|
|
47
|
+
* inline edge `side` names with the far edge released to `auto`, and slid
|
|
48
|
+
* via `@starting-style`/`allow-discrete` so the close animates too.
|
|
49
|
+
*
|
|
50
|
+
* @param handle Runtime handle carrying the host `<dialog>`'s props, plus `side`.
|
|
51
|
+
* @returns The render function producing the panel's markup.
|
|
52
|
+
* @example
|
|
53
|
+
* <Button commandfor="cart" command="show-modal">{t("cart.open")}</Button>
|
|
54
|
+
* <Sheet id="cart" side="right" aria-labelledby="cart-title">
|
|
55
|
+
* <Sheet.Header>
|
|
56
|
+
* <Sheet.Title id="cart-title">{t("cart.title")}</Sheet.Title>
|
|
57
|
+
* <Sheet.Description>{t("cart.description")}</Sheet.Description>
|
|
58
|
+
* </Sheet.Header>
|
|
59
|
+
* <Sheet.Footer>
|
|
60
|
+
* <Button commandfor="cart" command="close">{t("actions.checkout")}</Button>
|
|
61
|
+
* </Sheet.Footer>
|
|
62
|
+
* <Sheet.Close commandfor="cart" aria-label={t("actions.close")} />
|
|
63
|
+
* </Sheet>
|
|
64
|
+
* @example
|
|
65
|
+
* <Sheet id="filters" side="left" aria-labelledby="filters-title">
|
|
66
|
+
* <Sheet.Header>
|
|
67
|
+
* <Sheet.Title id="filters-title">{t("filters.title")}</Sheet.Title>
|
|
68
|
+
* </Sheet.Header>
|
|
69
|
+
* </Sheet>
|
|
70
|
+
*/
|
|
71
|
+
export declare function Sheet(handle: Handle<Sheet.Props>): () => import("remix/ui").RemixElement;
|
|
72
|
+
export declare namespace Sheet {
|
|
73
|
+
var Header: (handle: Handle<Sheet.HeaderProps>) => () => import("remix/ui").RemixElement;
|
|
74
|
+
var Title: (handle: Handle<Dialog.TitleProps>) => () => import("remix/ui").RemixElement;
|
|
75
|
+
var Description: (handle: Handle<Sheet.DescriptionProps>) => () => import("remix/ui").RemixElement;
|
|
76
|
+
var Footer: (handle: Handle<Sheet.FooterProps>) => () => import("remix/ui").RemixElement;
|
|
77
|
+
var Close: (handle: Handle<Dialog.CloseProps>) => () => import("remix/ui").RemixElement;
|
|
78
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/ui/jsx-runtime";
|
|
2
|
+
import { borderEdge, fg } from "@sdxc/u/color";
|
|
3
|
+
import { rounded, transition, transitionBehavior, transitionProperty } from "@sdxc/u/effects";
|
|
4
|
+
import { willChange } from "@sdxc/u/general";
|
|
5
|
+
import { fixed, flex, gap, insBe, insBs, insLeft, insRight, items, justify, vstack, } from "@sdxc/u/layout";
|
|
6
|
+
import { media, startingStyle } from "@sdxc/u/responsive";
|
|
7
|
+
import { is, m, maxBs, maxIs, mbs, paddingLeft, paddingRight, pbe, pbs } from "@sdxc/u/size";
|
|
8
|
+
import { data, when } from "@sdxc/u/state";
|
|
9
|
+
import { translateX } from "@sdxc/u/transform";
|
|
10
|
+
import { fontSize } from "@sdxc/u/typography";
|
|
11
|
+
import { durations, easings } from "../animations/tokens.js";
|
|
12
|
+
import { Dialog } from "./dialog.js";
|
|
13
|
+
/**
|
|
14
|
+
* Physical side of the viewport {@link Sheet} docks to when `side` is left
|
|
15
|
+
* unset.
|
|
16
|
+
*/
|
|
17
|
+
const DEFAULT_SIDE = "right";
|
|
18
|
+
/**
|
|
19
|
+
* Renders the panel through {@link Dialog}: fixed, pinned to whichever
|
|
20
|
+
* inline edge `side` names with the far edge released to `auto`, and slid
|
|
21
|
+
* via `@starting-style`/`allow-discrete` so the close animates too.
|
|
22
|
+
*
|
|
23
|
+
* @param handle Runtime handle carrying the host `<dialog>`'s props, plus `side`.
|
|
24
|
+
* @returns The render function producing the panel's markup.
|
|
25
|
+
* @example
|
|
26
|
+
* <Button commandfor="cart" command="show-modal">{t("cart.open")}</Button>
|
|
27
|
+
* <Sheet id="cart" side="right" aria-labelledby="cart-title">
|
|
28
|
+
* <Sheet.Header>
|
|
29
|
+
* <Sheet.Title id="cart-title">{t("cart.title")}</Sheet.Title>
|
|
30
|
+
* <Sheet.Description>{t("cart.description")}</Sheet.Description>
|
|
31
|
+
* </Sheet.Header>
|
|
32
|
+
* <Sheet.Footer>
|
|
33
|
+
* <Button commandfor="cart" command="close">{t("actions.checkout")}</Button>
|
|
34
|
+
* </Sheet.Footer>
|
|
35
|
+
* <Sheet.Close commandfor="cart" aria-label={t("actions.close")} />
|
|
36
|
+
* </Sheet>
|
|
37
|
+
* @example
|
|
38
|
+
* <Sheet id="filters" side="left" aria-labelledby="filters-title">
|
|
39
|
+
* <Sheet.Header>
|
|
40
|
+
* <Sheet.Title id="filters-title">{t("filters.title")}</Sheet.Title>
|
|
41
|
+
* </Sheet.Header>
|
|
42
|
+
* </Sheet>
|
|
43
|
+
*/
|
|
44
|
+
export function Sheet(handle) {
|
|
45
|
+
return () => {
|
|
46
|
+
let { side, mix, ...rest } = handle.props;
|
|
47
|
+
let resolvedSide = side ?? DEFAULT_SIDE;
|
|
48
|
+
return (_jsx(Dialog, { ...rest, "data-side": resolvedSide, mix: [
|
|
49
|
+
fixed(),
|
|
50
|
+
m(0),
|
|
51
|
+
rounded("none"),
|
|
52
|
+
maxBs("none"),
|
|
53
|
+
maxIs("none"),
|
|
54
|
+
is("min(90vw, var(--ui-sheet-size, 24rem))"),
|
|
55
|
+
insBs("0"),
|
|
56
|
+
insBe("0"),
|
|
57
|
+
transitionBehavior("allow-discrete"),
|
|
58
|
+
willChange("transform"),
|
|
59
|
+
data("side", "right", [
|
|
60
|
+
borderEdge("left", { width: 1, color: "neutral" }),
|
|
61
|
+
translateX("100%"),
|
|
62
|
+
insRight("0"),
|
|
63
|
+
insLeft("auto"),
|
|
64
|
+
paddingLeft("1.5rem"),
|
|
65
|
+
paddingRight("calc(1.5rem + env(safe-area-inset-right, 0px))"),
|
|
66
|
+
]),
|
|
67
|
+
data("side", "right", when("&[open]", translateX("0"))),
|
|
68
|
+
data("side", "left", [
|
|
69
|
+
borderEdge("right", { width: 1, color: "neutral" }),
|
|
70
|
+
translateX("-100%"),
|
|
71
|
+
insLeft("0"),
|
|
72
|
+
insRight("auto"),
|
|
73
|
+
paddingRight("1.5rem"),
|
|
74
|
+
paddingLeft("calc(1.5rem + env(safe-area-inset-left, 0px))"),
|
|
75
|
+
]),
|
|
76
|
+
data("side", "left", when("&[open]", translateX("0"))),
|
|
77
|
+
startingStyle([
|
|
78
|
+
when('&[data-side="right"][open]', translateX("100%")),
|
|
79
|
+
when('&[data-side="left"][open]', translateX("-100%")),
|
|
80
|
+
]),
|
|
81
|
+
media("(prefers-reduced-motion: reduce)", transitionProperty("none")),
|
|
82
|
+
gap("1rem"),
|
|
83
|
+
pbs(`calc(1.5rem + env(safe-area-inset-top, 0px))`),
|
|
84
|
+
pbe(`calc(1.5rem + env(safe-area-inset-bottom, 0px))`),
|
|
85
|
+
transition("transform, display, overlay", {
|
|
86
|
+
duration: durations.slow,
|
|
87
|
+
easing: easings.decelerate,
|
|
88
|
+
}),
|
|
89
|
+
mix,
|
|
90
|
+
] }));
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Renders {@link Sheet.HeaderProps.children} as the panel's header slot: a
|
|
95
|
+
* tightly-stacked column of {@link Sheet.Title} and {@link Sheet.Description},
|
|
96
|
+
* start-aligned at every width rather than centering like {@link Dialog.Header}.
|
|
97
|
+
*
|
|
98
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
99
|
+
* @returns The render function producing the header slot's markup.
|
|
100
|
+
* @example
|
|
101
|
+
* <Sheet.Header>
|
|
102
|
+
* <Sheet.Title>{t("cart.title")}</Sheet.Title>
|
|
103
|
+
* <Sheet.Description>{t("cart.description")}</Sheet.Description>
|
|
104
|
+
* </Sheet.Header>
|
|
105
|
+
*/
|
|
106
|
+
Sheet.Header = function SheetHeader(handle) {
|
|
107
|
+
return () => {
|
|
108
|
+
let { mix, ...rest } = handle.props;
|
|
109
|
+
return _jsx("div", { ...rest, "data-slot": "header", mix: [vstack({ gap: "0.25rem" }), mix] });
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Renders {@link Sheet.TitleProps.children} as the panel's heading: identical
|
|
114
|
+
* to {@link Dialog.Title}, since both name a panel with the same size and
|
|
115
|
+
* weight of heading text.
|
|
116
|
+
*
|
|
117
|
+
* @param handle Runtime handle carrying the host `<h2>`'s props.
|
|
118
|
+
* @returns The render function producing the heading's markup.
|
|
119
|
+
* @example
|
|
120
|
+
* <Sheet.Title>{t("cart.title")}</Sheet.Title>
|
|
121
|
+
*/
|
|
122
|
+
Sheet.Title = Dialog.Title;
|
|
123
|
+
/**
|
|
124
|
+
* Renders {@link Sheet.DescriptionProps.children} as the panel's supporting
|
|
125
|
+
* copy, in a native `<p>` set to the panel's own foreground color rather
|
|
126
|
+
* than {@link Dialog.Description}'s more muted one.
|
|
127
|
+
*
|
|
128
|
+
* @param handle Runtime handle carrying the host `<p>`'s props.
|
|
129
|
+
* @returns The render function producing the description's markup.
|
|
130
|
+
* @example
|
|
131
|
+
* <Sheet.Description>{t("cart.description")}</Sheet.Description>
|
|
132
|
+
*/
|
|
133
|
+
Sheet.Description = function SheetDescription(handle) {
|
|
134
|
+
return () => {
|
|
135
|
+
let { mix, ...rest } = handle.props;
|
|
136
|
+
return (_jsx("p", { ...rest, "data-slot": "description", mix: [fontSize("sm"), fg("neutral"), mix], children: rest.children }));
|
|
137
|
+
};
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Renders {@link Sheet.FooterProps.children} as the panel's action row: a
|
|
141
|
+
* single end-aligned row pinned to the block-end edge at every width, unlike
|
|
142
|
+
* {@link Dialog.Footer}'s column that only becomes a row as its container grows.
|
|
143
|
+
*
|
|
144
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
145
|
+
* @returns The render function producing the action row's markup.
|
|
146
|
+
* @example
|
|
147
|
+
* <Sheet.Footer>
|
|
148
|
+
* <Button commandfor="cart" command="close" variant="outline">{t("actions.cancel")}</Button>
|
|
149
|
+
* <Button commandfor="cart" command="close">{t("actions.checkout")}</Button>
|
|
150
|
+
* </Sheet.Footer>
|
|
151
|
+
*/
|
|
152
|
+
Sheet.Footer = function SheetFooter(handle) {
|
|
153
|
+
return () => {
|
|
154
|
+
let { mix, ...rest } = handle.props;
|
|
155
|
+
return (_jsx("div", { ...rest, "data-slot": "footer", mix: [mbs("auto"), flex(), items("center"), justify("end"), gap("0.5rem"), mix] }));
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Renders a dismiss control for the ancestor {@link Sheet} named by
|
|
160
|
+
* `commandfor`: identical to {@link Dialog.Close}.
|
|
161
|
+
*
|
|
162
|
+
* @param handle Runtime handle carrying the host button's props.
|
|
163
|
+
* @returns The render function producing the dismiss control's markup.
|
|
164
|
+
* @example
|
|
165
|
+
* <Sheet.Close commandfor="cart" aria-label={t("actions.close")} />
|
|
166
|
+
*/
|
|
167
|
+
Sheet.Close = Dialog.Close;
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An application shell's primary navigation rail, composed from a layout
|
|
3
|
+
* root, a collapsible rail, a main-content inset, and a family of
|
|
4
|
+
* group/menu/item parts for organizing links. Collapsing rides a single
|
|
5
|
+
* checkbox's native `:checked` state, so the whole shell works with zero
|
|
6
|
+
* library JavaScript.
|
|
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
|
+
import { Dialog } from "./dialog.js";
|
|
13
|
+
import { ScrollArea } from "./scroll-area.js";
|
|
14
|
+
import { Separator } from "./separator.js";
|
|
15
|
+
/**
|
|
16
|
+
* Prop types for {@link Sidebar} and its compound parts.
|
|
17
|
+
*/
|
|
18
|
+
export declare namespace Sidebar {
|
|
19
|
+
/**
|
|
20
|
+
* Visual treatment the rail renders with: `"sidebar"` sits flush against
|
|
21
|
+
* its edge, `"floating"` insets itself with a margin, a rounded, shadowed
|
|
22
|
+
* panel, and a blurred backdrop; `"inset"` renders the same panel without blur.
|
|
23
|
+
*/
|
|
24
|
+
type Variant = "sidebar" | "floating" | "inset";
|
|
25
|
+
/**
|
|
26
|
+
* How the rail collapses: `"none"` always renders at full width, `"icon"`
|
|
27
|
+
* narrows to an icon-only rail, and `"offcanvas"` narrows to nothing. Every
|
|
28
|
+
* mode but `"none"` yields to {@link Sidebar.MobileNav} on narrow shells.
|
|
29
|
+
*/
|
|
30
|
+
type Collapsible = "none" | "offcanvas" | "icon";
|
|
31
|
+
/**
|
|
32
|
+
* Physical edge of the shell the rail docks against and, for
|
|
33
|
+
* {@link Sidebar.MobileNav}, slides in from. `"left"` and `"right"` name
|
|
34
|
+
* that edge regardless of `dir`, staying pinned to one physical side.
|
|
35
|
+
*/
|
|
36
|
+
type Side = "left" | "right";
|
|
37
|
+
/**
|
|
38
|
+
* Semantic color role {@link Sidebar.Item} renders its current-page
|
|
39
|
+
* treatment in, each mapped to its matching `--ui-*` variables.
|
|
40
|
+
*/
|
|
41
|
+
type Color = "brand" | "neutral" | "success" | "warning" | "danger";
|
|
42
|
+
/**
|
|
43
|
+
* Size variant controlling {@link Sidebar.MenuButton}'s and
|
|
44
|
+
* {@link Sidebar.MenuLink}'s padding, font size, and icon size.
|
|
45
|
+
*/
|
|
46
|
+
type MenuButtonSize = "sm" | "md" | "lg";
|
|
47
|
+
/**
|
|
48
|
+
* Every native `<div>` attribute, plus the `mix` passthrough. Establishes
|
|
49
|
+
* the shell's row layout — {@link Sidebar} beside {@link Sidebar.Inset} —
|
|
50
|
+
* plus the {@link PROVIDER_CONTAINER_NAME} container and `:checked` collapse rules.
|
|
51
|
+
*/
|
|
52
|
+
interface ProviderProps extends TagProps<"div"> {
|
|
53
|
+
/** {@link Sidebar} and {@link Sidebar.Inset}, in either order. */
|
|
54
|
+
children: RemixNode;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Every native `<aside>` attribute, plus the `mix` passthrough.
|
|
58
|
+
*/
|
|
59
|
+
interface Props extends TagProps<"aside"> {
|
|
60
|
+
/** Visual treatment. Defaults to {@link DEFAULT_VARIANT}. */
|
|
61
|
+
variant?: Variant;
|
|
62
|
+
/** Collapse behavior. Defaults to {@link DEFAULT_COLLAPSIBLE}. */
|
|
63
|
+
collapsible?: Collapsible;
|
|
64
|
+
/** Physical docking edge. Defaults to {@link DEFAULT_SIDE}. */
|
|
65
|
+
side?: Side;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Every prop {@link Dialog.Props} accepts, plus `side`. `id` stays the id
|
|
69
|
+
* a trigger elsewhere on the page opens this drawer with — see
|
|
70
|
+
* {@link Dialog.Props} for the full Invoker Commands contract.
|
|
71
|
+
*/
|
|
72
|
+
interface MobileNavProps extends Dialog.Props {
|
|
73
|
+
/** Physical edge to dock against and slide in from. Defaults to {@link DEFAULT_SIDE}. */
|
|
74
|
+
side?: Side;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Every native `<header>` attribute, plus the `mix` passthrough.
|
|
78
|
+
*/
|
|
79
|
+
interface HeaderProps extends TagProps<"header"> {
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Every prop {@link ScrollArea.ViewportProps} accepts, unchanged.
|
|
83
|
+
*/
|
|
84
|
+
interface ContentProps extends ScrollArea.ViewportProps {
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Every native `<footer>` attribute, plus the `mix` passthrough.
|
|
88
|
+
*/
|
|
89
|
+
interface FooterProps extends TagProps<"footer"> {
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Every native `<nav>` attribute, plus the `mix` passthrough.
|
|
93
|
+
*/
|
|
94
|
+
interface NavProps extends TagProps<"nav"> {
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Props accepted by {@link Sidebar.Item}, built as an intersection because
|
|
98
|
+
* the underlying anchor prop type is a union keyed on `href` — the
|
|
99
|
+
* accessible-anchor contract restricts `role` once `href` is present.
|
|
100
|
+
*/
|
|
101
|
+
type ItemProps = TagProps<"a"> & {
|
|
102
|
+
/** Destination the item navigates to. */
|
|
103
|
+
href: string;
|
|
104
|
+
/** Semantic color role applied once the item is current. Defaults to {@link DEFAULT_ITEM_COLOR}. */
|
|
105
|
+
color?: Color;
|
|
106
|
+
/** Shorthand setting `aria-current="page"` when true and `aria-current` is otherwise unset. */
|
|
107
|
+
current?: boolean;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Every native `<section>` attribute, plus the `mix` passthrough.
|
|
111
|
+
*/
|
|
112
|
+
interface GroupProps extends TagProps<"section"> {
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Every native `<div>` attribute, plus the `mix` passthrough.
|
|
116
|
+
*/
|
|
117
|
+
interface GroupLabelProps extends TagProps<"div"> {
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Every native `<button>` attribute, plus the `mix` passthrough.
|
|
121
|
+
*/
|
|
122
|
+
interface GroupActionProps extends TagProps<"button"> {
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Every native `<div>` attribute, plus the `mix` passthrough.
|
|
126
|
+
*/
|
|
127
|
+
interface GroupContentProps extends TagProps<"div"> {
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Every native `<ul>` attribute, plus the `mix` passthrough.
|
|
131
|
+
*/
|
|
132
|
+
interface MenuProps extends TagProps<"ul"> {
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Every native `<li>` attribute, plus the `mix` passthrough. Its own
|
|
136
|
+
* `:hover`/`:focus-within` state reveals a nested {@link Sidebar.MenuAction}
|
|
137
|
+
* that would otherwise stay hidden.
|
|
138
|
+
*/
|
|
139
|
+
interface MenuItemProps extends TagProps<"li"> {
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Props accepted by {@link Sidebar.MenuButton}.
|
|
143
|
+
*/
|
|
144
|
+
interface MenuButtonProps extends TagProps<"button"> {
|
|
145
|
+
/** Size variant. Defaults to {@link DEFAULT_MENU_BUTTON_SIZE}. */
|
|
146
|
+
size?: MenuButtonSize;
|
|
147
|
+
/** Marks the row as the current selection, independent of navigation. */
|
|
148
|
+
active?: boolean;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Props accepted by {@link Sidebar.MenuLink}. Built as an intersection for
|
|
152
|
+
* the same reason as {@link Sidebar.ItemProps}.
|
|
153
|
+
*/
|
|
154
|
+
type MenuLinkProps = TagProps<"a"> & {
|
|
155
|
+
/** Destination the link navigates to. */
|
|
156
|
+
href: string;
|
|
157
|
+
/** Size variant. Defaults to {@link DEFAULT_MENU_BUTTON_SIZE}. */
|
|
158
|
+
size?: MenuButtonSize;
|
|
159
|
+
/** Shorthand setting `aria-current="page"` when true and `aria-current` is otherwise unset. */
|
|
160
|
+
active?: boolean;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Props accepted by {@link Sidebar.MenuAction}.
|
|
164
|
+
*/
|
|
165
|
+
interface MenuActionProps extends TagProps<"button"> {
|
|
166
|
+
/**
|
|
167
|
+
* Whether the control stays invisible until its ancestor
|
|
168
|
+
* {@link Sidebar.MenuItem} is hovered or focused. Defaults to
|
|
169
|
+
* {@link DEFAULT_SHOW_ON_HOVER}; set `false` to keep it always visible.
|
|
170
|
+
*/
|
|
171
|
+
showOnHover?: boolean;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Every native `<span>` attribute, plus the `mix` passthrough.
|
|
175
|
+
*/
|
|
176
|
+
interface MenuBadgeProps extends TagProps<"span"> {
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Props accepted by {@link Sidebar.MenuSkeleton}.
|
|
180
|
+
*/
|
|
181
|
+
interface MenuSkeletonProps extends TagProps<"div"> {
|
|
182
|
+
/** Whether to render a leading icon-shaped placeholder. Defaults to {@link DEFAULT_SHOW_ICON}. */
|
|
183
|
+
showIcon?: boolean;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Every native `<ul>` attribute, plus the `mix` passthrough.
|
|
187
|
+
*/
|
|
188
|
+
interface MenuSubProps extends TagProps<"ul"> {
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Every native `<li>` attribute, plus the `mix` passthrough.
|
|
192
|
+
*/
|
|
193
|
+
interface MenuSubItemProps extends TagProps<"li"> {
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Props accepted by {@link Sidebar.MenuSubButton}.
|
|
197
|
+
*/
|
|
198
|
+
interface MenuSubButtonProps extends TagProps<"button"> {
|
|
199
|
+
/** Marks the row as the current selection, independent of navigation. */
|
|
200
|
+
active?: boolean;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Props accepted by {@link Sidebar.MenuSubLink}. Built as an intersection
|
|
204
|
+
* for the same reason as {@link Sidebar.ItemProps}.
|
|
205
|
+
*/
|
|
206
|
+
type MenuSubLinkProps = TagProps<"a"> & {
|
|
207
|
+
/** Destination the link navigates to. */
|
|
208
|
+
href: string;
|
|
209
|
+
/** Shorthand setting `aria-current="page"` when true and `aria-current` is otherwise unset. */
|
|
210
|
+
active?: boolean;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Props accepted by {@link Sidebar.Rail}: every native `<label>` attribute
|
|
214
|
+
* except `htmlFor`, narrowed to required since it names the id of
|
|
215
|
+
* {@link Sidebar.Trigger}'s own checkbox, the control this rail mirrors.
|
|
216
|
+
*/
|
|
217
|
+
interface RailProps extends Omit<TagProps<"label">, "htmlFor"> {
|
|
218
|
+
/** Id of the {@link Sidebar.Trigger} checkbox this rail toggles. */
|
|
219
|
+
htmlFor: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Props accepted by {@link Sidebar.Trigger}: every native `<input>`
|
|
223
|
+
* attribute except `type` and `role`, fixed by the platform's checkbox
|
|
224
|
+
* semantics, so `id`, `checked`, `defaultChecked`, and `disabled` all work.
|
|
225
|
+
*/
|
|
226
|
+
interface TriggerProps extends Omit<TagProps<"input">, "type" | "role"> {
|
|
227
|
+
/**
|
|
228
|
+
* Accessible label for the icon-only control — required, since the
|
|
229
|
+
* control carries no visible text for assistive technology to read.
|
|
230
|
+
*/
|
|
231
|
+
"aria-label": string;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Every prop {@link ScrollArea.ViewportProps} accepts, unchanged.
|
|
235
|
+
*/
|
|
236
|
+
interface InsetProps extends ScrollArea.ViewportProps {
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Every prop {@link Separator.Props} accepts, unchanged.
|
|
240
|
+
*/
|
|
241
|
+
interface SeparatorProps extends Separator.Props {
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Renders the rail itself: a native `<aside>` sized and styled through its
|
|
246
|
+
* `data-variant`, `data-collapsible`, and `data-side` attributes, with
|
|
247
|
+
* every collapse rule keyed off {@link Sidebar.Provider}'s `:has()` state.
|
|
248
|
+
*
|
|
249
|
+
* @param handle Runtime handle carrying the host `<aside>`'s props.
|
|
250
|
+
* @returns The render function producing the rail's markup.
|
|
251
|
+
* @example
|
|
252
|
+
* <Sidebar.Provider>
|
|
253
|
+
* <Sidebar variant="floating" collapsible="icon" side="right">
|
|
254
|
+
* <Sidebar.Header>{logo}</Sidebar.Header>
|
|
255
|
+
* <Sidebar.Content>{nav}</Sidebar.Content>
|
|
256
|
+
* </Sidebar>
|
|
257
|
+
* <Sidebar.Inset>{children}</Sidebar.Inset>
|
|
258
|
+
* </Sidebar.Provider>
|
|
259
|
+
*/
|
|
260
|
+
export declare function Sidebar(handle: Handle<Sidebar.Props>): () => import("remix/ui").RemixElement;
|
|
261
|
+
export declare namespace Sidebar {
|
|
262
|
+
var Provider: (handle: Handle<Sidebar.ProviderProps>) => () => import("remix/ui").RemixElement;
|
|
263
|
+
var MobileNav: (handle: Handle<Sidebar.MobileNavProps>) => () => import("remix/ui").RemixElement;
|
|
264
|
+
var Header: (handle: Handle<Sidebar.HeaderProps>) => () => import("remix/ui").RemixElement;
|
|
265
|
+
var Content: (handle: Handle<Sidebar.ContentProps>) => () => import("remix/ui").RemixElement;
|
|
266
|
+
var Footer: (handle: Handle<Sidebar.FooterProps>) => () => import("remix/ui").RemixElement;
|
|
267
|
+
var Nav: (handle: Handle<Sidebar.NavProps>) => () => import("remix/ui").RemixElement;
|
|
268
|
+
var Item: (handle: Handle<Sidebar.ItemProps>) => () => import("remix/ui").RemixElement;
|
|
269
|
+
var Group: (handle: Handle<Sidebar.GroupProps>) => () => import("remix/ui").RemixElement;
|
|
270
|
+
var GroupLabel: (handle: Handle<Sidebar.GroupLabelProps>) => () => import("remix/ui").RemixElement;
|
|
271
|
+
var GroupAction: (handle: Handle<Sidebar.GroupActionProps>) => () => import("remix/ui").RemixElement;
|
|
272
|
+
var GroupContent: (handle: Handle<Sidebar.GroupContentProps>) => () => import("remix/ui").RemixElement;
|
|
273
|
+
var Menu: (handle: Handle<Sidebar.MenuProps>) => () => import("remix/ui").RemixElement;
|
|
274
|
+
var MenuItem: (handle: Handle<Sidebar.MenuItemProps>) => () => import("remix/ui").RemixElement;
|
|
275
|
+
var MenuButton: (handle: Handle<Sidebar.MenuButtonProps>) => () => import("remix/ui").RemixElement;
|
|
276
|
+
var MenuLink: (handle: Handle<Sidebar.MenuLinkProps>) => () => import("remix/ui").RemixElement;
|
|
277
|
+
var MenuAction: (handle: Handle<Sidebar.MenuActionProps>) => () => import("remix/ui").RemixElement;
|
|
278
|
+
var MenuBadge: (handle: Handle<Sidebar.MenuBadgeProps>) => () => import("remix/ui").RemixElement;
|
|
279
|
+
var MenuSkeleton: (handle: Handle<Sidebar.MenuSkeletonProps>) => () => import("remix/ui").RemixElement;
|
|
280
|
+
var MenuSub: (handle: Handle<Sidebar.MenuSubProps>) => () => import("remix/ui").RemixElement;
|
|
281
|
+
var MenuSubItem: (handle: Handle<Sidebar.MenuSubItemProps>) => () => import("remix/ui").RemixElement;
|
|
282
|
+
var MenuSubButton: (handle: Handle<Sidebar.MenuSubButtonProps>) => () => import("remix/ui").RemixElement;
|
|
283
|
+
var MenuSubLink: (handle: Handle<Sidebar.MenuSubLinkProps>) => () => import("remix/ui").RemixElement;
|
|
284
|
+
var Rail: (handle: Handle<Sidebar.RailProps>) => () => import("remix/ui").RemixElement;
|
|
285
|
+
var Trigger: (handle: Handle<Sidebar.TriggerProps>) => () => import("remix/ui").RemixElement;
|
|
286
|
+
var Inset: (handle: Handle<Sidebar.InsetProps>) => () => import("remix/ui").RemixElement;
|
|
287
|
+
var Separator: (handle: Handle<Sidebar.SeparatorProps>) => () => import("remix/ui").RemixElement;
|
|
288
|
+
}
|