@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,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A scrollable region wrapping long or overflowing content — a chat log, a
|
|
3
|
+
* table, a tall list — so it scrolls its own axis inside a bordered panel
|
|
4
|
+
* instead of pushing the surrounding page. {@link ScrollArea.Viewport} is the
|
|
5
|
+
* element that actually scrolls; the root only supplies the panel's border
|
|
6
|
+
* and rounding.
|
|
7
|
+
*
|
|
8
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
9
|
+
* @copyright Sergio Xalambrí 2026
|
|
10
|
+
*/
|
|
11
|
+
import type { Handle, Props as TagProps } from "remix/ui";
|
|
12
|
+
/**
|
|
13
|
+
* Prop types for {@link ScrollArea} and its compound parts.
|
|
14
|
+
*/
|
|
15
|
+
export declare namespace ScrollArea {
|
|
16
|
+
/**
|
|
17
|
+
* Axis {@link ScrollArea.Viewport} scrolls along: only the block axis
|
|
18
|
+
* (`"vertical"`), only the inline axis (`"horizontal"`), or both at once
|
|
19
|
+
* (`"both"`).
|
|
20
|
+
*/
|
|
21
|
+
type Orientation = "vertical" | "horizontal" | "both";
|
|
22
|
+
/**
|
|
23
|
+
* Every native `<div>` attribute, unchanged, plus the `mix` passthrough.
|
|
24
|
+
*/
|
|
25
|
+
interface Props extends TagProps<"div"> {
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Every native `<div>` attribute, unchanged, plus the `mix` passthrough.
|
|
29
|
+
* `orientation` defaults to {@link DEFAULT_ORIENTATION}; `tabIndex` defaults
|
|
30
|
+
* to {@link DEFAULT_TAB_INDEX}, overridable to `-1` when content is reachable.
|
|
31
|
+
*/
|
|
32
|
+
interface ViewportProps extends TagProps<"div"> {
|
|
33
|
+
/** Axis the viewport scrolls along. Defaults to {@link DEFAULT_ORIENTATION}. */
|
|
34
|
+
orientation?: Orientation;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Renders the scroll area's outer panel: a relatively positioned, rounded,
|
|
39
|
+
* bordered `<div>` that frames whatever {@link ScrollArea.Viewport} scrolls
|
|
40
|
+
* inside it, staying a fixed border around the scrolling content.
|
|
41
|
+
*
|
|
42
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
43
|
+
* @returns The render function producing the panel's markup.
|
|
44
|
+
* @example
|
|
45
|
+
* <ScrollArea>
|
|
46
|
+
* <ScrollArea.Viewport>
|
|
47
|
+
* <p>{t("changelog.body")}</p>
|
|
48
|
+
* </ScrollArea.Viewport>
|
|
49
|
+
* </ScrollArea>
|
|
50
|
+
*/
|
|
51
|
+
export declare function ScrollArea(handle: Handle<ScrollArea.Props>): () => import("remix/ui").RemixElement;
|
|
52
|
+
export declare namespace ScrollArea {
|
|
53
|
+
var Viewport: (handle: Handle<ScrollArea.ViewportProps>) => () => import("remix/ui").RemixElement;
|
|
54
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/ui/jsx-runtime";
|
|
2
|
+
import { bg, border, outline } from "@sdxc/u/color";
|
|
3
|
+
import { rounded } from "@sdxc/u/effects";
|
|
4
|
+
import { raw } from "@sdxc/u/general";
|
|
5
|
+
import { relative } from "@sdxc/u/layout";
|
|
6
|
+
import { overflow } from "@sdxc/u/overflow";
|
|
7
|
+
import { media } from "@sdxc/u/responsive";
|
|
8
|
+
import { bs, is } from "@sdxc/u/size";
|
|
9
|
+
import { data, hover, when } from "@sdxc/u/state";
|
|
10
|
+
import { attrs } from "remix/ui";
|
|
11
|
+
import { panelChrome } from "../styles/panel-chrome.js";
|
|
12
|
+
/**
|
|
13
|
+
* Native tab-stop order applied to {@link ScrollArea.Viewport} through
|
|
14
|
+
* {@link attrs} unless a consumer supplies its own `tabIndex`, keeping it
|
|
15
|
+
* reachable via keyboard even when none of its content is focusable.
|
|
16
|
+
*/
|
|
17
|
+
const DEFAULT_TAB_INDEX = 0;
|
|
18
|
+
/**
|
|
19
|
+
* Default {@link ScrollArea.Viewport} axis, applied whenever a consumer
|
|
20
|
+
* omits `orientation`.
|
|
21
|
+
*/
|
|
22
|
+
const DEFAULT_ORIENTATION = "vertical";
|
|
23
|
+
/**
|
|
24
|
+
* Renders the scroll area's outer panel: a relatively positioned, rounded,
|
|
25
|
+
* bordered `<div>` that frames whatever {@link ScrollArea.Viewport} scrolls
|
|
26
|
+
* inside it, staying a fixed border around the scrolling content.
|
|
27
|
+
*
|
|
28
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
29
|
+
* @returns The render function producing the panel's markup.
|
|
30
|
+
* @example
|
|
31
|
+
* <ScrollArea>
|
|
32
|
+
* <ScrollArea.Viewport>
|
|
33
|
+
* <p>{t("changelog.body")}</p>
|
|
34
|
+
* </ScrollArea.Viewport>
|
|
35
|
+
* </ScrollArea>
|
|
36
|
+
*/
|
|
37
|
+
export function ScrollArea(handle) {
|
|
38
|
+
return () => {
|
|
39
|
+
let { mix, ...rest } = handle.props;
|
|
40
|
+
return _jsx("div", { ...rest, "data-slot": "scroll-area", mix: [panelChrome(), relative(), mix] });
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Renders the scroll area's scrolling surface: a `<div>` filling its parent
|
|
45
|
+
* panel, clipping and scrolling along the axis named by `data-orientation`
|
|
46
|
+
* with a thin native scrollbar that gains a focus ring when focus-visible.
|
|
47
|
+
*
|
|
48
|
+
* @param handle Runtime handle carrying the host `<div>`'s props.
|
|
49
|
+
* @returns The render function producing the viewport's markup.
|
|
50
|
+
* @example
|
|
51
|
+
* <ScrollArea.Viewport>
|
|
52
|
+
* <Table>...</Table>
|
|
53
|
+
* </ScrollArea.Viewport>
|
|
54
|
+
* @example
|
|
55
|
+
* <ScrollArea.Viewport orientation="horizontal">
|
|
56
|
+
* <Toolbar aria-label={t("gallery.filmstrip")}>...</Toolbar>
|
|
57
|
+
* </ScrollArea.Viewport>
|
|
58
|
+
*/
|
|
59
|
+
ScrollArea.Viewport = function ScrollAreaViewport(handle) {
|
|
60
|
+
return () => {
|
|
61
|
+
let { orientation, mix, ...rest } = handle.props;
|
|
62
|
+
let resolvedOrientation = orientation ?? DEFAULT_ORIENTATION;
|
|
63
|
+
return (_jsx("div", { ...rest, "data-orientation": resolvedOrientation, "data-slot": "viewport", mix: [
|
|
64
|
+
attrs({ tabIndex: DEFAULT_TAB_INDEX }),
|
|
65
|
+
when("&:focus-visible", outline({ color: "brand.ring", offset: 2 })),
|
|
66
|
+
is("full"),
|
|
67
|
+
bs("full"),
|
|
68
|
+
raw({
|
|
69
|
+
scrollBehavior: "smooth",
|
|
70
|
+
scrollbarWidth: "thin",
|
|
71
|
+
scrollbarGutter: "stable",
|
|
72
|
+
}),
|
|
73
|
+
data("orientation", "vertical", raw({ overflowBlock: "auto", overflowInline: "hidden" })),
|
|
74
|
+
data("orientation", "horizontal", raw({ overflowInline: "auto", overflowBlock: "hidden" })),
|
|
75
|
+
data("orientation", "both", overflow("auto")),
|
|
76
|
+
when("&::-webkit-scrollbar", raw({ width: "0.75rem", height: "0.75rem" })),
|
|
77
|
+
when("&::-webkit-scrollbar-track", bg("transparent")),
|
|
78
|
+
when("&::-webkit-scrollbar-thumb", [
|
|
79
|
+
rounded("full"),
|
|
80
|
+
bg("neutral.border"),
|
|
81
|
+
border({ color: "transparent", width: "3px" }),
|
|
82
|
+
raw({ backgroundClip: "content-box" }),
|
|
83
|
+
hover(bg("neutral.strong")),
|
|
84
|
+
]),
|
|
85
|
+
media("(prefers-reduced-motion: reduce)", raw({ scrollBehavior: "auto" })),
|
|
86
|
+
mix,
|
|
87
|
+
] }));
|
|
88
|
+
};
|
|
89
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single-line search field: a `<search>` landmark stacking a caption, a
|
|
3
|
+
* decorated control, and optional supporting or validation copy, composed
|
|
4
|
+
* from whatever compound parts a given field needs. Its own
|
|
5
|
+
* {@link SearchField.Input} part pairs a leading glyph with the native
|
|
6
|
+
* `<input type="search">` control it decorates, building on {@link Input} for
|
|
7
|
+
* that control's box, color, and state styling.
|
|
8
|
+
*
|
|
9
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
10
|
+
* @copyright Sergio Xalambrí 2026
|
|
11
|
+
*/
|
|
12
|
+
import type { Handle, Props as TagProps, RemixNode } from "remix/ui";
|
|
13
|
+
import { Input } from "./input.js";
|
|
14
|
+
/**
|
|
15
|
+
* Prop types for {@link SearchField} and its compound parts.
|
|
16
|
+
*/
|
|
17
|
+
export declare namespace SearchField {
|
|
18
|
+
/**
|
|
19
|
+
* Every native `<search>` attribute, unchanged, plus the `mix` passthrough.
|
|
20
|
+
* `children` composes this field's parts — typically a caption, the
|
|
21
|
+
* {@link SearchField.Input} control, and validation copy — in a single column.
|
|
22
|
+
*/
|
|
23
|
+
interface Props extends TagProps<"search"> {
|
|
24
|
+
/** The field's compound parts: a caption, the control, and any supporting or validation copy. */
|
|
25
|
+
children: RemixNode;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Every prop {@link Input} accepts except `type`, `list`, and `role`,
|
|
29
|
+
* which this control fixes to `"search"` and the platform's own implicit
|
|
30
|
+
* `searchbox` role on the consumer's behalf, plus the `mix` passthrough.
|
|
31
|
+
*/
|
|
32
|
+
interface InputProps extends Omit<Input.Props, "type" | "list" | "role"> {
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Renders a `<search>` landmark — the platform's own role for a search
|
|
37
|
+
* region, needing no explicit `role` attribute — stacking a caption,
|
|
38
|
+
* {@link SearchField.Input}, and validation copy in a single column.
|
|
39
|
+
*
|
|
40
|
+
* @param handle Runtime handle carrying the host `<search>`'s props.
|
|
41
|
+
* @returns The render function producing the field's markup.
|
|
42
|
+
* @example
|
|
43
|
+
* <SearchField>
|
|
44
|
+
* <Label htmlFor="site-search">{t("search.label")}</Label>
|
|
45
|
+
* <SearchField.Input id="site-search" name="q" placeholder={t("search.placeholder")} />
|
|
46
|
+
* </SearchField>
|
|
47
|
+
* @example
|
|
48
|
+
* <SearchField aria-label={t("search.label")}>
|
|
49
|
+
* <SearchField.Input name="q" />
|
|
50
|
+
* </SearchField>
|
|
51
|
+
*/
|
|
52
|
+
export declare function SearchField(handle: Handle<SearchField.Props>): () => import("remix/ui").RemixElement;
|
|
53
|
+
export declare namespace SearchField {
|
|
54
|
+
var Input: (handle: Handle<SearchField.InputProps>) => () => import("remix/ui").RemixElement;
|
|
55
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "remix/ui/jsx-runtime";
|
|
2
|
+
import { SearchIcon } from "@sdxc/icons";
|
|
3
|
+
import { fg } from "@sdxc/u/color";
|
|
4
|
+
import { pointerEvents } from "@sdxc/u/general";
|
|
5
|
+
import { absolute, flex, insIs, items, relative } from "@sdxc/u/layout";
|
|
6
|
+
import { pis } from "@sdxc/u/size";
|
|
7
|
+
import { fieldStackLayout } from "../styles/field-stack-layout.js";
|
|
8
|
+
import { Input } from "./input.js";
|
|
9
|
+
/**
|
|
10
|
+
* Renders a `<search>` landmark — the platform's own role for a search
|
|
11
|
+
* region, needing no explicit `role` attribute — stacking a caption,
|
|
12
|
+
* {@link SearchField.Input}, and validation copy in a single column.
|
|
13
|
+
*
|
|
14
|
+
* @param handle Runtime handle carrying the host `<search>`'s props.
|
|
15
|
+
* @returns The render function producing the field's markup.
|
|
16
|
+
* @example
|
|
17
|
+
* <SearchField>
|
|
18
|
+
* <Label htmlFor="site-search">{t("search.label")}</Label>
|
|
19
|
+
* <SearchField.Input id="site-search" name="q" placeholder={t("search.placeholder")} />
|
|
20
|
+
* </SearchField>
|
|
21
|
+
* @example
|
|
22
|
+
* <SearchField aria-label={t("search.label")}>
|
|
23
|
+
* <SearchField.Input name="q" />
|
|
24
|
+
* </SearchField>
|
|
25
|
+
*/
|
|
26
|
+
export function SearchField(handle) {
|
|
27
|
+
return () => {
|
|
28
|
+
let { mix, ...rest } = handle.props;
|
|
29
|
+
return _jsx("search", { ...rest, "data-slot": "search-field", mix: [fieldStackLayout(), mix] });
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Renders {@link SearchField}'s control: a positioning wrapper pairing a
|
|
34
|
+
* muted, decorative {@link SearchIcon} with a native `<input type="search">`
|
|
35
|
+
* built on {@link Input}, inheriting its box, color, and state styling.
|
|
36
|
+
*
|
|
37
|
+
* @param handle Runtime handle carrying the host `<input>`'s props.
|
|
38
|
+
* @returns The render function producing the control's markup.
|
|
39
|
+
* @example
|
|
40
|
+
* <SearchField.Input aria-label={t("search.label")} placeholder={t("search.placeholder")} />
|
|
41
|
+
* @example
|
|
42
|
+
* <SearchField.Input name="q" color="brand" defaultValue="remix" />
|
|
43
|
+
*/
|
|
44
|
+
SearchField.Input = function SearchFieldInput(handle) {
|
|
45
|
+
return () => {
|
|
46
|
+
let { mix, ...rest } = handle.props;
|
|
47
|
+
return (_jsxs("div", { "data-slot": "input-wrapper", mix: [relative(), flex(), items("center")], children: [_jsx(SearchIcon, { size: 16, "data-slot": "icon", mix: [absolute(), insIs("0.75rem"), pointerEvents(), fg("neutral.muted")] }), _jsx(Input, { type: "search", ...rest, mix: [pis("2.25rem"), mix] })] }));
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A grouping wrapper for a set of related items inside a listbox, menu, or
|
|
3
|
+
* combobox — a native `<section>` element carrying the small block-axis
|
|
4
|
+
* padding that sets one group apart from the next. Pairing it with a
|
|
5
|
+
* `Header` as its first child gives the group a visible label.
|
|
6
|
+
*
|
|
7
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
8
|
+
* @copyright Sergio Xalambrí 2026
|
|
9
|
+
*/
|
|
10
|
+
import type { Handle, Props as TagProps } from "remix/ui";
|
|
11
|
+
/**
|
|
12
|
+
* Props accepted by {@link Section}.
|
|
13
|
+
*/
|
|
14
|
+
export declare namespace Section {
|
|
15
|
+
/**
|
|
16
|
+
* Every native `<section>` attribute, unchanged, plus the `mix`
|
|
17
|
+
* passthrough. Content is whatever `children` the consumer supplies,
|
|
18
|
+
* most often a `Header` label followed by the group's items.
|
|
19
|
+
*/
|
|
20
|
+
interface Props extends TagProps<"section"> {
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Renders its children inside a `<section>` element with small block-axis
|
|
25
|
+
* padding, separating one group of items from its siblings inside a
|
|
26
|
+
* listbox, menu, or combobox; pair it with a `Header` to label the group.
|
|
27
|
+
*
|
|
28
|
+
* @param handle Runtime handle carrying the host `<section>`'s props.
|
|
29
|
+
* @returns The render function producing the group's markup.
|
|
30
|
+
* @example
|
|
31
|
+
* <Section aria-labelledby="account-heading">
|
|
32
|
+
* <Header id="account-heading">{t("settings.account")}</Header>
|
|
33
|
+
* <ListBox.Item id="profile">{t("settings.profile")}</ListBox.Item>
|
|
34
|
+
* <ListBox.Item id="billing">{t("settings.billing")}</ListBox.Item>
|
|
35
|
+
* </Section>
|
|
36
|
+
*/
|
|
37
|
+
export declare function Section(handle: Handle<Section.Props>): () => import("remix/ui").RemixElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "remix/ui/jsx-runtime";
|
|
2
|
+
import { pb } from "@sdxc/u/size";
|
|
3
|
+
/**
|
|
4
|
+
* Renders its children inside a `<section>` element with small block-axis
|
|
5
|
+
* padding, separating one group of items from its siblings inside a
|
|
6
|
+
* listbox, menu, or combobox; pair it with a `Header` to label the group.
|
|
7
|
+
*
|
|
8
|
+
* @param handle Runtime handle carrying the host `<section>`'s props.
|
|
9
|
+
* @returns The render function producing the group's markup.
|
|
10
|
+
* @example
|
|
11
|
+
* <Section aria-labelledby="account-heading">
|
|
12
|
+
* <Header id="account-heading">{t("settings.account")}</Header>
|
|
13
|
+
* <ListBox.Item id="profile">{t("settings.profile")}</ListBox.Item>
|
|
14
|
+
* <ListBox.Item id="billing">{t("settings.billing")}</ListBox.Item>
|
|
15
|
+
* </Section>
|
|
16
|
+
*/
|
|
17
|
+
export function Section(handle) {
|
|
18
|
+
return () => {
|
|
19
|
+
let { mix, ...rest } = handle.props;
|
|
20
|
+
return _jsx("section", { ...rest, mix: [pb("0.25rem"), mix] });
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A native `<select>` styled as a bordered, rounded field and progressively
|
|
3
|
+
* upgraded with customizable-select rendering — a custom trigger button, a
|
|
4
|
+
* value slot mirroring the current selection, and richly styled options and
|
|
5
|
+
* groups — wherever the browser resolves `appearance: base-select`. The
|
|
6
|
+
* trigger, value, and picker styling layer on top of ordinary
|
|
7
|
+
* `<option>`/`<optgroup>` markup, so every browser renders a working
|
|
8
|
+
* dropdown from that same markup.
|
|
9
|
+
*
|
|
10
|
+
* @author [Sergio Xalambrí](https://sergiodxa.com)
|
|
11
|
+
* @copyright Sergio Xalambrí 2026
|
|
12
|
+
*/
|
|
13
|
+
import type { Handle, Props as TagProps } from "remix/ui";
|
|
14
|
+
/**
|
|
15
|
+
* The `<selectedcontent>` element mirrors the currently selected
|
|
16
|
+
* `<option>`'s rendered content inside a customized `<select>`'s trigger
|
|
17
|
+
* button, its attribute shape declared here to match a plain `<span>`'s.
|
|
18
|
+
*/
|
|
19
|
+
declare global {
|
|
20
|
+
namespace JSX {
|
|
21
|
+
interface IntrinsicHTMLElements {
|
|
22
|
+
selectedcontent: IntrinsicHTMLElements["span"];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Prop types for {@link Select} and its compound parts.
|
|
28
|
+
*/
|
|
29
|
+
export declare namespace Select {
|
|
30
|
+
/**
|
|
31
|
+
* Semantic color role, each mapped to its matching `--ui-*` variables.
|
|
32
|
+
*/
|
|
33
|
+
type Color = "brand" | "neutral" | "success" | "warning" | "danger";
|
|
34
|
+
/**
|
|
35
|
+
* Every native `<select>` attribute, unchanged, plus the `mix` passthrough.
|
|
36
|
+
* `multiple` and a `size` greater than `1` remain functional but switch
|
|
37
|
+
* rendering back to the plain list-box; `role` is already implicit.
|
|
38
|
+
*/
|
|
39
|
+
interface Props extends Omit<TagProps<"select">, "role"> {
|
|
40
|
+
/** Semantic color role for the focus-visible ring. Defaults to {@link DEFAULT_COLOR}. */
|
|
41
|
+
color?: Color;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Every native `<button>` attribute, unchanged, plus the `mix` passthrough.
|
|
45
|
+
* `type` defaults to {@link DEFAULT_TRIGGER_TYPE}.
|
|
46
|
+
*/
|
|
47
|
+
interface TriggerProps extends TagProps<"button"> {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Every attribute a plain `<span>` accepts, unchanged, plus the `mix`
|
|
51
|
+
* passthrough. Any `children` supplied render as a fallback in browsers
|
|
52
|
+
* treating `<selectedcontent>` as unknown — see {@link Select.Value}.
|
|
53
|
+
*/
|
|
54
|
+
interface ValueProps extends TagProps<"selectedcontent"> {
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Every native `<option>` attribute, unchanged, plus the `mix` passthrough.
|
|
58
|
+
*/
|
|
59
|
+
interface OptionProps extends TagProps<"option"> {
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Every native `<optgroup>` attribute, unchanged, plus the `mix`
|
|
63
|
+
* passthrough.
|
|
64
|
+
*/
|
|
65
|
+
interface GroupProps extends TagProps<"optgroup"> {
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Renders a native `<select>` styled as a bordered, rounded field that
|
|
70
|
+
* progressively upgrades to customizable-select rendering via
|
|
71
|
+
* `appearance: base-select`, falling back to the platform's own dropdown.
|
|
72
|
+
*
|
|
73
|
+
* @param handle Runtime handle carrying the host `<select>`'s props.
|
|
74
|
+
* @returns The render function producing the field's markup.
|
|
75
|
+
* @example
|
|
76
|
+
* <Select aria-label={t("form.country.label")} required>
|
|
77
|
+
* <Select.Option value="">{t("form.country.placeholder")}</Select.Option>
|
|
78
|
+
* <Select.Option value="us">{t("countries.us")}</Select.Option>
|
|
79
|
+
* <Select.Option value="ca">{t("countries.ca")}</Select.Option>
|
|
80
|
+
* </Select>
|
|
81
|
+
* @example
|
|
82
|
+
* <Select aria-label={t("form.plan.label")} color="brand">
|
|
83
|
+
* <Select.Trigger />
|
|
84
|
+
* <Select.Group label={t("form.plan.groups.personal")}>
|
|
85
|
+
* <Select.Option value="free">{t("plans.free")}</Select.Option>
|
|
86
|
+
* <Select.Option value="pro">{t("plans.pro")}</Select.Option>
|
|
87
|
+
* </Select.Group>
|
|
88
|
+
* </Select>
|
|
89
|
+
*/
|
|
90
|
+
export declare function Select(handle: Handle<Select.Props>): () => import("remix/ui").RemixElement;
|
|
91
|
+
export declare namespace Select {
|
|
92
|
+
var Trigger: (handle: Handle<Select.TriggerProps>) => () => import("remix/ui").RemixElement;
|
|
93
|
+
var Value: (handle: Handle<Select.ValueProps>) => () => import("remix/ui").RemixElement;
|
|
94
|
+
var Option: (handle: Handle<Select.OptionProps>) => () => import("remix/ui").RemixElement;
|
|
95
|
+
var Group: (handle: Handle<Select.GroupProps>) => () => import("remix/ui").RemixElement;
|
|
96
|
+
}
|