@contui/ui 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +30 -0
- package/README.md +150 -2
- package/cli/contui.mjs +250 -0
- package/dist/charts/area-chart.d.ts +8 -0
- package/dist/charts/area-chart.js +9 -0
- package/dist/charts/bar-chart.d.ts +9 -0
- package/dist/charts/bar-chart.js +10 -0
- package/dist/charts/bubble-chart.d.ts +60 -0
- package/dist/charts/bubble-chart.js +392 -0
- package/dist/charts/bullet-chart.d.ts +53 -0
- package/dist/charts/bullet-chart.js +123 -0
- package/dist/charts/candlestick-chart.d.ts +77 -0
- package/dist/charts/candlestick-chart.js +558 -0
- package/dist/charts/cartesian.d.ts +121 -0
- package/dist/charts/cartesian.js +625 -0
- package/dist/charts/chart-card.d.ts +80 -0
- package/dist/charts/chart-card.js +114 -0
- package/dist/charts/donut-chart.d.ts +40 -0
- package/dist/charts/donut-chart.js +88 -0
- package/dist/charts/funnel-chart.d.ts +16 -0
- package/dist/charts/funnel-chart.js +164 -0
- package/dist/charts/horizontal-bar-chart.d.ts +67 -0
- package/dist/charts/horizontal-bar-chart.js +481 -0
- package/dist/charts/index.d.ts +21 -0
- package/dist/charts/index.js +32 -0
- package/dist/charts/legend.d.ts +23 -0
- package/dist/charts/legend.js +22 -0
- package/dist/charts/lib/candlestick-window.d.ts +15 -0
- package/dist/charts/lib/candlestick-window.js +23 -0
- package/dist/charts/lib/color.d.ts +39 -0
- package/dist/charts/lib/color.js +83 -0
- package/dist/charts/lib/format.d.ts +11 -0
- package/dist/charts/lib/format.js +33 -0
- package/dist/charts/lib/frame.d.ts +6 -0
- package/dist/charts/lib/frame.js +6 -0
- package/dist/charts/lib/layout.d.ts +11 -0
- package/dist/charts/lib/layout.js +71 -0
- package/dist/charts/lib/path.d.ts +35 -0
- package/dist/charts/lib/path.js +203 -0
- package/dist/charts/lib/scale.d.ts +41 -0
- package/dist/charts/lib/scale.js +80 -0
- package/dist/charts/lib/use-active.d.ts +18 -0
- package/dist/charts/lib/use-active.js +71 -0
- package/dist/charts/lib/use-size.d.ts +9 -0
- package/dist/charts/lib/use-size.js +40 -0
- package/dist/charts/line-chart.d.ts +7 -0
- package/dist/charts/line-chart.js +8 -0
- package/dist/charts/radar-chart.d.ts +27 -0
- package/dist/charts/radar-chart.js +165 -0
- package/dist/charts/rose-chart.d.ts +35 -0
- package/dist/charts/rose-chart.js +242 -0
- package/dist/charts/sparkline.d.ts +35 -0
- package/dist/charts/sparkline.js +110 -0
- package/dist/charts/tooltip.d.ts +35 -0
- package/dist/charts/tooltip.js +22 -0
- package/dist/charts/treemap.d.ts +28 -0
- package/dist/charts/treemap.js +103 -0
- package/dist/charts/uptime-strip.d.ts +40 -0
- package/dist/charts/uptime-strip.js +178 -0
- package/dist/components/accordion.d.ts +31 -0
- package/dist/components/accordion.js +34 -0
- package/dist/components/activity-item.d.ts +12 -0
- package/dist/components/activity-item.js +6 -0
- package/dist/components/alert.d.ts +21 -0
- package/dist/components/alert.js +58 -0
- package/dist/components/assistant-answer.d.ts +52 -0
- package/dist/components/assistant-answer.js +40 -0
- package/dist/components/assistant-prompt.d.ts +63 -0
- package/dist/components/assistant-prompt.js +122 -0
- package/dist/components/avatar.d.ts +28 -0
- package/dist/components/avatar.js +75 -0
- package/dist/components/badge.d.ts +16 -0
- package/dist/components/badge.js +33 -0
- package/dist/components/bar-list.d.ts +65 -0
- package/dist/components/bar-list.js +119 -0
- package/dist/components/block-slider.d.ts +43 -0
- package/dist/components/block-slider.js +63 -0
- package/dist/components/branch-graph.d.ts +87 -0
- package/dist/components/branch-graph.js +231 -0
- package/dist/components/breadcrumb.d.ts +41 -0
- package/dist/components/breadcrumb.js +53 -0
- package/dist/components/button.d.ts +23 -0
- package/dist/components/button.js +108 -0
- package/dist/components/calendar.d.ts +5 -0
- package/dist/components/calendar.js +90 -0
- package/dist/components/card.d.ts +65 -0
- package/dist/components/card.js +104 -0
- package/dist/components/chat-attachment.d.ts +47 -0
- package/dist/components/chat-attachment.js +63 -0
- package/dist/components/chat-event.d.ts +7 -0
- package/dist/components/chat-event.js +7 -0
- package/dist/components/chat-message.d.ts +59 -0
- package/dist/components/chat-message.js +91 -0
- package/dist/components/chat-reference.d.ts +20 -0
- package/dist/components/chat-reference.js +41 -0
- package/dist/components/chat-shared.d.ts +21 -0
- package/dist/components/chat-shared.js +23 -0
- package/dist/components/chat-suggestions.d.ts +59 -0
- package/dist/components/chat-suggestions.js +88 -0
- package/dist/components/chat-thread.d.ts +39 -0
- package/dist/components/chat-thread.js +172 -0
- package/dist/components/chat-typing.d.ts +35 -0
- package/dist/components/chat-typing.js +66 -0
- package/dist/components/checkbox.d.ts +18 -0
- package/dist/components/checkbox.js +33 -0
- package/dist/components/checklist.d.ts +26 -0
- package/dist/components/checklist.js +18 -0
- package/dist/components/chip.d.ts +29 -0
- package/dist/components/chip.js +61 -0
- package/dist/components/code-input.d.ts +40 -0
- package/dist/components/code-input.js +285 -0
- package/dist/components/color-picker.d.ts +38 -0
- package/dist/components/color-picker.js +855 -0
- package/dist/components/combobox.d.ts +75 -0
- package/dist/components/combobox.js +112 -0
- package/dist/components/command-menu.d.ts +58 -0
- package/dist/components/command-menu.js +166 -0
- package/dist/components/copy-button.d.ts +16 -0
- package/dist/components/copy-button.js +31 -0
- package/dist/components/data-grid.d.ts +50 -0
- package/dist/components/data-grid.js +599 -0
- package/dist/components/date-picker.d.ts +109 -0
- package/dist/components/date-picker.js +268 -0
- package/dist/components/description-list.d.ts +12 -0
- package/dist/components/description-list.js +10 -0
- package/dist/components/dialog.d.ts +57 -0
- package/dist/components/dialog.js +140 -0
- package/dist/components/dock.d.ts +45 -0
- package/dist/components/dock.js +79 -0
- package/dist/components/drop-zone.d.ts +46 -0
- package/dist/components/drop-zone.js +101 -0
- package/dist/components/dropdown-menu.d.ts +50 -0
- package/dist/components/dropdown-menu.js +78 -0
- package/dist/components/editable-cell.d.ts +34 -0
- package/dist/components/editable-cell.js +89 -0
- package/dist/components/empty-state.d.ts +17 -0
- package/dist/components/empty-state.js +9 -0
- package/dist/components/field.d.ts +43 -0
- package/dist/components/field.js +75 -0
- package/dist/components/filter-condition.d.ts +188 -0
- package/dist/components/filter-condition.js +113 -0
- package/dist/components/filter-menu.d.ts +57 -0
- package/dist/components/filter-menu.js +46 -0
- package/dist/components/header-bar.d.ts +84 -0
- package/dist/components/header-bar.js +94 -0
- package/dist/components/hold-button.d.ts +15 -0
- package/dist/components/hold-button.js +88 -0
- package/dist/components/icon-tile.d.ts +12 -0
- package/dist/components/icon-tile.js +29 -0
- package/dist/components/info-tip.d.ts +13 -0
- package/dist/components/info-tip.js +26 -0
- package/dist/components/input.d.ts +17 -0
- package/dist/components/input.js +83 -0
- package/dist/components/kbd.d.ts +6 -0
- package/dist/components/kbd.js +7 -0
- package/dist/components/menu-item.d.ts +56 -0
- package/dist/components/menu-item.js +94 -0
- package/dist/components/message-composer.d.ts +75 -0
- package/dist/components/message-composer.js +199 -0
- package/dist/components/nav-rail.d.ts +31 -0
- package/dist/components/nav-rail.js +85 -0
- package/dist/components/notice.d.ts +45 -0
- package/dist/components/notice.js +66 -0
- package/dist/components/optimistic-undo.d.ts +28 -0
- package/dist/components/optimistic-undo.js +43 -0
- package/dist/components/option-row.d.ts +15 -0
- package/dist/components/option-row.js +14 -0
- package/dist/components/page-content.d.ts +11 -0
- package/dist/components/page-content.js +31 -0
- package/dist/components/pagination.d.ts +34 -0
- package/dist/components/pagination.js +41 -0
- package/dist/components/popover.d.ts +27 -0
- package/dist/components/popover.js +25 -0
- package/dist/components/progress.d.ts +33 -0
- package/dist/components/progress.js +75 -0
- package/dist/components/radio-group.d.ts +7 -0
- package/dist/components/radio-group.js +33 -0
- package/dist/components/readonly-field.d.ts +33 -0
- package/dist/components/readonly-field.js +80 -0
- package/dist/components/segmented-control.d.ts +21 -0
- package/dist/components/segmented-control.js +108 -0
- package/dist/components/select.d.ts +42 -0
- package/dist/components/select.js +86 -0
- package/dist/components/separator.d.ts +10 -0
- package/dist/components/separator.js +7 -0
- package/dist/components/setting-row.d.ts +53 -0
- package/dist/components/setting-row.js +93 -0
- package/dist/components/sidebar-switcher.d.ts +47 -0
- package/dist/components/sidebar-switcher.js +20 -0
- package/dist/components/sidebar.d.ts +220 -0
- package/dist/components/sidebar.js +327 -0
- package/dist/components/skeleton.d.ts +18 -0
- package/dist/components/skeleton.js +23 -0
- package/dist/components/slider.d.ts +15 -0
- package/dist/components/slider.js +28 -0
- package/dist/components/spinner.d.ts +14 -0
- package/dist/components/spinner.js +19 -0
- package/dist/components/status-dot.d.ts +24 -0
- package/dist/components/status-dot.js +35 -0
- package/dist/components/stepper.d.ts +60 -0
- package/dist/components/stepper.js +197 -0
- package/dist/components/switch.d.ts +9 -0
- package/dist/components/switch.js +26 -0
- package/dist/components/table-cell.d.ts +38 -0
- package/dist/components/table-cell.js +107 -0
- package/dist/components/table-context.d.ts +48 -0
- package/dist/components/table-context.js +69 -0
- package/dist/components/table-head.d.ts +42 -0
- package/dist/components/table-head.js +188 -0
- package/dist/components/table-tree.d.ts +96 -0
- package/dist/components/table-tree.js +137 -0
- package/dist/components/table.d.ts +78 -0
- package/dist/components/table.js +119 -0
- package/dist/components/tabs.d.ts +27 -0
- package/dist/components/tabs.js +79 -0
- package/dist/components/textarea.d.ts +3 -0
- package/dist/components/textarea.js +20 -0
- package/dist/components/theme.d.ts +41 -0
- package/dist/components/theme.js +60 -0
- package/dist/components/thinking.d.ts +68 -0
- package/dist/components/thinking.js +94 -0
- package/dist/components/toast.d.ts +39 -0
- package/dist/components/toast.js +110 -0
- package/dist/components/toolbar.d.ts +25 -0
- package/dist/components/toolbar.js +92 -0
- package/dist/components/tooltip.d.ts +23 -0
- package/dist/components/tooltip.js +27 -0
- package/dist/components/top-nav.d.ts +129 -0
- package/dist/components/top-nav.js +211 -0
- package/dist/components/truncate.d.ts +29 -0
- package/dist/components/truncate.js +138 -0
- package/dist/deprecated.d.ts +43 -0
- package/dist/deprecated.js +47 -0
- package/dist/index.d.ts +93 -0
- package/dist/index.js +93 -0
- package/dist/lib/cn.d.ts +5 -0
- package/dist/lib/cn.js +14 -0
- package/dist/lib/color.d.ts +136 -0
- package/dist/lib/color.js +307 -0
- package/dist/lib/contrast.d.ts +53 -0
- package/dist/lib/contrast.js +169 -0
- package/dist/lib/create-theme.d.ts +240 -0
- package/dist/lib/create-theme.js +461 -0
- package/dist/lib/harmony.d.ts +102 -0
- package/dist/lib/harmony.js +426 -0
- package/dist/lib/import-theme.d.ts +22 -0
- package/dist/lib/import-theme.js +221 -0
- package/dist/lib/overflow-scroll.d.ts +25 -0
- package/dist/lib/overflow-scroll.js +66 -0
- package/dist/lib/radio-toggle-render.d.ts +3 -0
- package/dist/lib/radio-toggle-render.js +9 -0
- package/dist/lib/reorder.d.ts +38 -0
- package/dist/lib/reorder.js +193 -0
- package/dist/lib/spacing.d.ts +101 -0
- package/dist/lib/spacing.js +118 -0
- package/dist/lib/tailwind-palette.d.ts +5 -0
- package/dist/lib/tailwind-palette.js +351 -0
- package/dist/lib/truncate.d.ts +18 -0
- package/dist/lib/truncate.js +69 -0
- package/dist/lib/use-single-value.d.ts +5 -0
- package/dist/lib/use-single-value.js +17 -0
- package/dist/styles.css +7988 -0
- package/mcp/server.mjs +87590 -0
- package/package.json +58 -5
- package/skills/continuum-fix-padding/SKILL.md +69 -0
- package/skills/continuum-fix-padding/scripts/compute.ts +155 -0
- package/skills/continuum-fix-padding/scripts/spacing.ts +189 -0
- package/skills/continuum-taste/SKILL.md +186 -0
- package/skills/continuum-taste/assets/tokens.css +647 -0
- package/skills/continuum-taste/references/charts.md +375 -0
- package/skills/continuum-taste/references/components.md +1369 -0
- package/skills/continuum-taste/references/foundations.md +539 -0
- package/skills/continuum-taste/references/media/canvas.md +75 -0
- package/skills/continuum-taste/references/media/css.md +61 -0
- package/skills/continuum-taste/references/media/react.md +161 -0
- package/skills/continuum-taste/references/method.md +87 -0
- package/skills/continuum-taste/references/pages.md +391 -0
- package/skills/continuum-taste/references/patterns.md +77 -0
- package/skills/continuum-taste/references/screens/agent.tsx +450 -0
- package/skills/continuum-taste/references/screens/analytics-overview.tsx +377 -0
- package/skills/continuum-taste/references/screens/checkout-funnel.tsx +193 -0
- package/skills/continuum-taste/references/screens/customer.tsx +475 -0
- package/skills/continuum-taste/references/screens/customers.tsx +608 -0
- package/skills/continuum-taste/references/screens/index.tsx +72 -0
- package/skills/continuum-taste/references/screens/invoice-editor.tsx +558 -0
- package/skills/continuum-taste/references/screens/new-customer.tsx +205 -0
- package/skills/continuum-taste/references/screens/overview.tsx +196 -0
- package/skills/continuum-taste/references/screens/report-generator.tsx +329 -0
- package/skills/continuum-taste/references/screens/risk-report.tsx +577 -0
- package/skills/continuum-taste/references/screens/sequence-editor.tsx +455 -0
- package/skills/continuum-taste/references/screens/settings.tsx +288 -0
- package/skills/continuum-taste/references/screens/shared.tsx +204 -0
- package/skills/continuum-taste/references/screens/sign-in.tsx +104 -0
- package/skills/continuum-taste/references/screens/workspace.tsx +596 -0
- package/skills/continuum-taste/references/theming.md +95 -0
- package/src/charts/area-chart.tsx +17 -0
- package/src/charts/bar-chart.tsx +15 -0
- package/src/charts/bubble-chart.tsx +913 -0
- package/src/charts/bullet-chart.tsx +419 -0
- package/src/charts/candlestick-chart.tsx +1242 -0
- package/src/charts/cartesian.tsx +1437 -0
- package/src/charts/chart-card.tsx +394 -0
- package/src/charts/donut-chart.tsx +299 -0
- package/src/charts/funnel-chart.tsx +373 -0
- package/src/charts/horizontal-bar-chart.tsx +991 -0
- package/src/charts/index.ts +76 -0
- package/src/charts/legend.tsx +59 -0
- package/src/charts/lib/candlestick-window.ts +42 -0
- package/src/charts/lib/color.ts +110 -0
- package/src/charts/lib/format.ts +42 -0
- package/src/charts/lib/frame.ts +6 -0
- package/src/charts/lib/layout.ts +78 -0
- package/src/charts/lib/path.ts +225 -0
- package/src/charts/lib/scale.ts +91 -0
- package/src/charts/lib/use-active.ts +87 -0
- package/src/charts/lib/use-size.ts +45 -0
- package/src/charts/line-chart.tsx +16 -0
- package/src/charts/radar-chart.tsx +485 -0
- package/src/charts/rose-chart.tsx +553 -0
- package/src/charts/sparkline.tsx +293 -0
- package/src/charts/tooltip.tsx +105 -0
- package/src/charts/treemap.tsx +271 -0
- package/src/charts/uptime-strip.tsx +469 -0
- package/src/components/accordion.tsx +136 -0
- package/src/components/activity-item.tsx +43 -0
- package/src/components/alert.tsx +135 -0
- package/src/components/assistant-answer.tsx +185 -0
- package/src/components/assistant-prompt.tsx +352 -0
- package/src/components/avatar.tsx +157 -0
- package/src/components/badge.tsx +55 -0
- package/src/components/bar-list.tsx +350 -0
- package/src/components/block-slider.tsx +189 -0
- package/src/components/branch-graph.tsx +580 -0
- package/src/components/breadcrumb.tsx +173 -0
- package/src/components/button.tsx +157 -0
- package/src/components/calendar.tsx +154 -0
- package/src/components/card.tsx +296 -0
- package/src/components/chat-attachment.tsx +255 -0
- package/src/components/chat-event.tsx +34 -0
- package/src/components/chat-message.tsx +332 -0
- package/src/components/chat-reference.tsx +100 -0
- package/src/components/chat-shared.ts +41 -0
- package/src/components/chat-suggestions.tsx +188 -0
- package/src/components/chat-thread.tsx +348 -0
- package/src/components/chat-typing.tsx +155 -0
- package/src/components/checkbox.tsx +83 -0
- package/src/components/checklist.tsx +146 -0
- package/src/components/chip.tsx +152 -0
- package/src/components/code-input.tsx +406 -0
- package/src/components/color-picker.tsx +1385 -0
- package/src/components/combobox.tsx +420 -0
- package/src/components/command-menu.tsx +405 -0
- package/src/components/copy-button.tsx +87 -0
- package/src/components/data-grid.tsx +965 -0
- package/src/components/date-picker.tsx +652 -0
- package/src/components/description-list.tsx +39 -0
- package/src/components/dialog.tsx +367 -0
- package/src/components/dock.tsx +192 -0
- package/src/components/drop-zone.tsx +283 -0
- package/src/components/dropdown-menu.tsx +323 -0
- package/src/components/editable-cell.tsx +219 -0
- package/src/components/empty-state.tsx +50 -0
- package/src/components/field.tsx +148 -0
- package/src/components/filter-condition.tsx +463 -0
- package/src/components/filter-menu.tsx +196 -0
- package/src/components/header-bar.tsx +220 -0
- package/src/components/hold-button.tsx +146 -0
- package/src/components/icon-tile.tsx +43 -0
- package/src/components/info-tip.tsx +87 -0
- package/src/components/input.tsx +136 -0
- package/src/components/kbd.tsx +17 -0
- package/src/components/menu-item.tsx +216 -0
- package/src/components/message-composer.tsx +458 -0
- package/src/components/nav-rail.tsx +235 -0
- package/src/components/notice.tsx +133 -0
- package/src/components/optimistic-undo.ts +68 -0
- package/src/components/option-row.tsx +54 -0
- package/src/components/page-content.tsx +44 -0
- package/src/components/pagination.tsx +182 -0
- package/src/components/popover.tsx +113 -0
- package/src/components/progress.tsx +222 -0
- package/src/components/radio-group.tsx +80 -0
- package/src/components/readonly-field.tsx +251 -0
- package/src/components/segmented-control.tsx +205 -0
- package/src/components/select.tsx +259 -0
- package/src/components/separator.tsx +30 -0
- package/src/components/setting-row.tsx +277 -0
- package/src/components/sidebar-switcher.tsx +134 -0
- package/src/components/sidebar.tsx +804 -0
- package/src/components/skeleton.tsx +57 -0
- package/src/components/slider.tsx +106 -0
- package/src/components/spinner.tsx +43 -0
- package/src/components/status-dot.tsx +100 -0
- package/src/components/stepper.tsx +459 -0
- package/src/components/switch.tsx +54 -0
- package/src/components/table-cell.tsx +239 -0
- package/src/components/table-context.ts +135 -0
- package/src/components/table-head.tsx +393 -0
- package/src/components/table-tree.tsx +357 -0
- package/src/components/table.tsx +295 -0
- package/src/components/tabs.tsx +191 -0
- package/src/components/textarea.tsx +44 -0
- package/src/components/theme.tsx +120 -0
- package/src/components/thinking.tsx +295 -0
- package/src/components/toast.tsx +308 -0
- package/src/components/toolbar.tsx +166 -0
- package/src/components/tooltip.tsx +84 -0
- package/src/components/top-nav.tsx +660 -0
- package/src/components/truncate.tsx +234 -0
- package/src/deprecated.ts +61 -0
- package/src/index.ts +184 -0
- package/src/lib/cn.ts +22 -0
- package/src/lib/color.ts +469 -0
- package/src/lib/contrast.ts +220 -0
- package/src/lib/create-theme.ts +659 -0
- package/src/lib/harmony.ts +609 -0
- package/src/lib/import-theme.ts +272 -0
- package/src/lib/overflow-scroll.tsx +108 -0
- package/src/lib/radio-toggle-render.tsx +15 -0
- package/src/lib/reorder.ts +222 -0
- package/src/lib/spacing.ts +189 -0
- package/src/lib/tailwind-palette.ts +355 -0
- package/src/lib/truncate.ts +79 -0
- package/src/lib/use-single-value.ts +23 -0
- package/src/styles/continuum.css +3 -0
- package/src/styles/theme.css +524 -0
- package/src/styles/tokens.css +647 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronLeft, ChevronRight } from 'lucide-react';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
import { focusRing } from './button.js';
|
|
6
|
+
/** A square page button on the control row's 34px; the current page only darkens its label. */
|
|
7
|
+
export const PaginationButton = ({ current, className, type = 'button', ...props }) => (_jsx("button", { "aria-current": current ? 'page' : undefined, className: cn('inline-flex size-control shrink-0 cursor-pointer select-none items-center justify-center rounded-control border border-neutral-200 font-medium text-neutral-600 text-sm tabular-nums transition-[border-color,color] duration-150', 'hover:border-neutral-300 hover:text-neutral-950 aria-[current=page]:text-neutral-950',
|
|
8
|
+
// Disabled as every control is: half strength, no pointer.
|
|
9
|
+
'disabled:pointer-events-none disabled:opacity-50 [&_svg]:size-icon [&_svg]:shrink-0', focusRing, className), "data-slot": "pagination-button", type: type, ...props }));
|
|
10
|
+
export const PaginationPrevious = ({ 'aria-label': label = 'Previous page', ...props }) => (_jsx(PaginationButton, { "aria-label": label, ...props, children: _jsx(ChevronLeft, { strokeWidth: 2 }) }));
|
|
11
|
+
export const PaginationNext = ({ 'aria-label': label = 'Next page', ...props }) => (_jsx(PaginationButton, { "aria-label": label, ...props, children: _jsx(ChevronRight, { strokeWidth: 2 }) }));
|
|
12
|
+
/**
|
|
13
|
+
* Always the same number of slots (first, last, the current page with its
|
|
14
|
+
* siblings, and an ellipsis on either side), so the row never changes width.
|
|
15
|
+
*/
|
|
16
|
+
export const getPageItems = (page, pageCount, siblings = 1) => {
|
|
17
|
+
const slots = siblings * 2 + 5;
|
|
18
|
+
if (pageCount <= slots)
|
|
19
|
+
return Array.from({ length: pageCount }, (_, i) => i + 1);
|
|
20
|
+
const range = (from, to) => Array.from({ length: to - from + 1 }, (_, i) => from + i);
|
|
21
|
+
const inner = siblings * 2 + 3;
|
|
22
|
+
if (page <= siblings + 3)
|
|
23
|
+
return [...range(1, inner), 'end-ellipsis', pageCount];
|
|
24
|
+
if (page >= pageCount - siblings - 2)
|
|
25
|
+
return [1, 'start-ellipsis', ...range(pageCount - inner + 1, pageCount)];
|
|
26
|
+
return [
|
|
27
|
+
1,
|
|
28
|
+
'start-ellipsis',
|
|
29
|
+
...range(page - siblings, page + siblings),
|
|
30
|
+
'end-ellipsis',
|
|
31
|
+
pageCount,
|
|
32
|
+
];
|
|
33
|
+
};
|
|
34
|
+
/** The library's pagination bar: results on the left, pages centred, an optional right slot. */
|
|
35
|
+
export const Pagination = ({ page, pageCount, onPageChange, siblings = 1, results, end, previousLabel, nextLabel, className, 'aria-label': label = 'Pagination', ...props }) => {
|
|
36
|
+
const count = Math.max(1, pageCount);
|
|
37
|
+
const current = Math.min(Math.max(1, page), count);
|
|
38
|
+
// Its own container, so it answers the room it is given wherever it sits. Under 720 the results
|
|
39
|
+
// line goes and the pages fold into "‹ 3 of 25 ›": the way along cannot go, so it gets smaller.
|
|
40
|
+
return (_jsx("nav", { "aria-label": label, className: cn('@container/pagination', className), "data-slot": "pagination", ...props, children: _jsxs("div", { className: "@max-[720px]/pagination:flex grid grid-cols-[1fr_auto_1fr] items-center @max-[720px]/pagination:justify-center @max-[720px]/pagination:gap-3 gap-12", children: [_jsx("div", { className: "@max-[720px]/pagination:hidden min-w-0 whitespace-nowrap font-medium text-neutral-800 text-xs", "data-slot": "pagination-results", children: results }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(PaginationPrevious, { "aria-label": previousLabel, disabled: current <= 1, onClick: () => onPageChange(current - 1) }), _jsx("div", { className: "flex @max-[720px]/pagination:hidden items-center gap-2", "data-slot": "pagination-pages", children: getPageItems(current, count, siblings).map(item => typeof item === 'number' ? (_jsx(PaginationButton, { current: item === current, onClick: () => onPageChange(item), children: item }, item)) : (_jsx("span", { "aria-hidden": true, className: "inline-flex size-control items-center justify-center font-medium text-neutral-600 text-sm", children: "\u2026" }, item))) }), _jsxs("span", { className: "@max-[720px]/pagination:inline-flex hidden h-control min-w-control items-center justify-center whitespace-nowrap px-1 font-medium text-neutral-800 text-xs tabular-nums", "data-slot": "pagination-position", children: [_jsx("span", { className: "sr-only", children: "Page " }), current, " of ", count] }), _jsx(PaginationNext, { "aria-label": nextLabel, disabled: current >= count, onClick: () => onPageChange(current + 1) })] }), _jsx("div", { className: "@max-[720px]/pagination:ml-auto flex min-w-0 items-center justify-end @max-[720px]/pagination:empty:hidden", children: end })] }) }));
|
|
41
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
2
|
+
import type { ComponentProps } from 'react';
|
|
3
|
+
import { type WithClassName } from '../lib/cn.js';
|
|
4
|
+
/** A handle that lets a trigger outside the Popover open it (detached triggers). */
|
|
5
|
+
export declare const createPopoverHandle: typeof PopoverPrimitive.createHandle;
|
|
6
|
+
/** Small anchored panels that hold controls: filters, a date picker, column settings. */
|
|
7
|
+
export declare const Popover: <Payload>(props: PopoverPrimitive.Root.Props<Payload>) => import("react").JSX.Element;
|
|
8
|
+
/** Opens the popover; pass `render={<Button />}` to use one of the system's controls. */
|
|
9
|
+
export declare const PopoverTrigger: <Payload>(props: PopoverPrimitive.Trigger.Props<Payload>) => import("react").JSX.Element;
|
|
10
|
+
export type PopoverContentProps = WithClassName<PopoverPrimitive.Popup.Props> & Pick<PopoverPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'anchor' | 'positionMethod' | 'collisionPadding'> & {
|
|
11
|
+
/** Where the panel is portalled; the body by default. */
|
|
12
|
+
container?: PopoverPrimitive.Portal.Props['container'];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* The panel. It is a card-sized surface rather than a menu, so it takes the card radius and p-3; it
|
|
16
|
+
* grows from the trigger (95% to 100%) so it reads as coming out of it, and fades out faster than it
|
|
17
|
+
* comes in.
|
|
18
|
+
*/
|
|
19
|
+
export declare const PopoverContent: ({ className, side, align, sideOffset, alignOffset, anchor, positionMethod, collisionPadding, container, ...props }: PopoverContentProps) => import("react").JSX.Element;
|
|
20
|
+
/** Title and description stacked tight, above the popover's controls. */
|
|
21
|
+
export declare const PopoverHeader: ({ className, ...props }: ComponentProps<"div">) => import("react").JSX.Element;
|
|
22
|
+
/** Labels the popup for assistive tech through aria-labelledby. */
|
|
23
|
+
export declare const PopoverTitle: ({ className, ...props }: WithClassName<PopoverPrimitive.Title.Props>) => import("react").JSX.Element;
|
|
24
|
+
/** Describes the popup for assistive tech through aria-describedby. */
|
|
25
|
+
export declare const PopoverDescription: ({ className, ...props }: WithClassName<PopoverPrimitive.Description.Props>) => import("react").JSX.Element;
|
|
26
|
+
/** Closes the popover; pass `render={<Button />}` to use one of the system's controls. */
|
|
27
|
+
export declare const PopoverClose: (props: PopoverPrimitive.Close.Props) => import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Popover as PopoverPrimitive } from '@base-ui/react/popover';
|
|
4
|
+
import { cn } from '../lib/cn.js';
|
|
5
|
+
import { ThemeScope, usePortalContainer } from './theme.js';
|
|
6
|
+
/** A handle that lets a trigger outside the Popover open it (detached triggers). */
|
|
7
|
+
export const createPopoverHandle = PopoverPrimitive.createHandle;
|
|
8
|
+
/** Small anchored panels that hold controls: filters, a date picker, column settings. */
|
|
9
|
+
export const Popover = (props) => (_jsx(PopoverPrimitive.Root, { "data-slot": "popover", ...props }));
|
|
10
|
+
/** Opens the popover; pass `render={<Button />}` to use one of the system's controls. */
|
|
11
|
+
export const PopoverTrigger = (props) => (_jsx(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props }));
|
|
12
|
+
/**
|
|
13
|
+
* The panel. It is a card-sized surface rather than a menu, so it takes the card radius and p-3; it
|
|
14
|
+
* grows from the trigger (95% to 100%) so it reads as coming out of it, and fades out faster than it
|
|
15
|
+
* comes in.
|
|
16
|
+
*/
|
|
17
|
+
export const PopoverContent = ({ className, side = 'bottom', align = 'center', sideOffset = 4, alignOffset = 0, anchor, positionMethod, collisionPadding, container, ...props }) => (_jsx(PopoverPrimitive.Portal, { container: usePortalContainer(container), children: _jsx(ThemeScope, { children: _jsx(PopoverPrimitive.Positioner, { align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", collisionPadding: collisionPadding, "data-slot": "popover-positioner", positionMethod: positionMethod, side: side, sideOffset: sideOffset, children: _jsx(PopoverPrimitive.Popup, { className: cn('flex max-h-(--available-height) w-popover flex-col gap-3 overflow-y-auto rounded-card border border-neutral-200 bg-neutral-50 p-3 text-neutral-700 text-xs shadow-float outline-none', 'origin-(--transform-origin) transition-[opacity,scale] duration-150 ease-out-strong data-ending-style:scale-95 data-starting-style:scale-95 data-ending-style:opacity-0 data-starting-style:opacity-0 data-ending-style:duration-100 motion-reduce:transition-none', className), "data-slot": "popover-content", ...props }) }) }) }));
|
|
18
|
+
/** Title and description stacked tight, above the popover's controls. */
|
|
19
|
+
export const PopoverHeader = ({ className, ...props }) => (_jsx("div", { className: cn('flex flex-col gap-0.5', className), "data-slot": "popover-header", ...props }));
|
|
20
|
+
/** Labels the popup for assistive tech through aria-labelledby. */
|
|
21
|
+
export const PopoverTitle = ({ className, ...props }) => (_jsx(PopoverPrimitive.Title, { className: cn('font-medium text-neutral-950 text-sm', className), "data-slot": "popover-title", ...props }));
|
|
22
|
+
/** Describes the popup for assistive tech through aria-describedby. */
|
|
23
|
+
export const PopoverDescription = ({ className, ...props }) => (_jsx(PopoverPrimitive.Description, { className: cn('text-neutral-600 text-xs', className), "data-slot": "popover-description", ...props }));
|
|
24
|
+
/** Closes the popover; pass `render={<Button />}` to use one of the system's controls. */
|
|
25
|
+
export const PopoverClose = (props) => (_jsx(PopoverPrimitive.Close, { "data-slot": "popover-close", ...props }));
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Meter as MeterPrimitive } from '@base-ui/react/meter';
|
|
2
|
+
import { Progress as ProgressPrimitive } from '@base-ui/react/progress';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
import { type ReactNode } from 'react';
|
|
5
|
+
import { type WithClassName } from '../lib/cn.js';
|
|
6
|
+
export declare const progressTrackVariants: (props?: ({
|
|
7
|
+
size?: "sm" | "md" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export declare const progressIndicatorVariants: (props?: ({
|
|
10
|
+
tone?: "action" | "success" | "warning" | "error" | "chart" | null | undefined;
|
|
11
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
type BarVariants = VariantProps<typeof progressTrackVariants> & VariantProps<typeof progressIndicatorVariants>;
|
|
13
|
+
type BarOwnProps = BarVariants & {
|
|
14
|
+
/** Names the bar for screen readers too; without it, pass `aria-label`. */
|
|
15
|
+
label?: ReactNode;
|
|
16
|
+
/** Trailing text on the label row, e.g. "Resets in 10 days"; read as the bar's description. */
|
|
17
|
+
caption?: ReactNode;
|
|
18
|
+
/** Shows the formatted value on the label row when there is no caption. */
|
|
19
|
+
showValue?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type ProgressProps = Omit<WithClassName<ProgressPrimitive.Root.Props>, 'children'> & BarOwnProps;
|
|
22
|
+
/**
|
|
23
|
+
* Task progress on Base UI Progress: a 4 or 8px bar with an optional label row. `value={null}`
|
|
24
|
+
* makes it indeterminate, which fills the track faintly rather than animating.
|
|
25
|
+
*/
|
|
26
|
+
export declare const Progress: ({ label, caption, showValue, size, tone, className, "aria-describedby": ariaDescribedBy, ...props }: ProgressProps) => import("react").JSX.Element;
|
|
27
|
+
export type MeterProps = Omit<WithClassName<MeterPrimitive.Root.Props>, 'children'> & BarOwnProps;
|
|
28
|
+
/**
|
|
29
|
+
* A value within a known range on Base UI Meter, such as credits used of a plan's total:
|
|
30
|
+
* the same bar as Progress, always determinate. Base UI clamps the fill to the range.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Meter: ({ label, caption, showValue, size, tone, className, "aria-describedby": ariaDescribedBy, ...props }: MeterProps) => import("react").JSX.Element;
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Meter as MeterPrimitive } from '@base-ui/react/meter';
|
|
4
|
+
import { Progress as ProgressPrimitive } from '@base-ui/react/progress';
|
|
5
|
+
import { cva } from 'class-variance-authority';
|
|
6
|
+
import { useId } from 'react';
|
|
7
|
+
import { cn } from '../lib/cn.js';
|
|
8
|
+
/*
|
|
9
|
+
* Both bars draw a track in the hairline colour, the step the slider's track uses, so a bar
|
|
10
|
+
* sits in a card the way a divider would. The track rounds fully at 4 and 8px in every theme.
|
|
11
|
+
*/
|
|
12
|
+
export const progressTrackVariants = cva('relative w-full overflow-hidden rounded-full bg-neutral-200', {
|
|
13
|
+
variants: {
|
|
14
|
+
size: {
|
|
15
|
+
sm: 'h-1',
|
|
16
|
+
md: 'h-2',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
defaultVariants: { size: 'sm' },
|
|
20
|
+
});
|
|
21
|
+
export const progressIndicatorVariants = cva([
|
|
22
|
+
// Base UI sets the width inline; only that width animates, and never for reduced motion.
|
|
23
|
+
'h-full rounded-full transition-[width] duration-200 ease-out-strong motion-reduce:transition-none',
|
|
24
|
+
// An indeterminate task has no width to show, so the whole track fills faintly and holds still.
|
|
25
|
+
'data-indeterminate:w-full data-indeterminate:opacity-30',
|
|
26
|
+
], {
|
|
27
|
+
variants: {
|
|
28
|
+
tone: {
|
|
29
|
+
action: 'bg-action [background-image:var(--action-gradient)]',
|
|
30
|
+
success: 'bg-success-500',
|
|
31
|
+
warning: 'bg-warning-500',
|
|
32
|
+
error: 'bg-error-500',
|
|
33
|
+
chart: 'bg-chart-1',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
defaultVariants: { tone: 'action' },
|
|
37
|
+
});
|
|
38
|
+
const rootClassName = 'flex w-full min-w-0 flex-col gap-2';
|
|
39
|
+
const labelClassName = 'min-w-0 truncate font-medium text-neutral-900 text-xs';
|
|
40
|
+
// Without a label the trailing text still sits at the end of the row.
|
|
41
|
+
const valueClassName = 'ms-auto shrink-0 font-normal text-neutral-600 text-xs tabular-nums';
|
|
42
|
+
// A caption is a sentence and can outrun a narrow row, so it truncates rather than pushing out.
|
|
43
|
+
const captionClassName = 'ms-auto min-w-0 truncate font-normal text-neutral-600 text-xs';
|
|
44
|
+
/** The label left and the value or caption right, sharing a baseline. */
|
|
45
|
+
const LabelRow = ({ slot, children }) => (_jsx("div", { className: "flex min-w-0 items-baseline justify-between gap-3", "data-slot": slot, children: children }));
|
|
46
|
+
/** The caption describes rather than names, so it is linked by id instead of through the label. */
|
|
47
|
+
const useCaption = (caption, describedBy) => {
|
|
48
|
+
const id = useId();
|
|
49
|
+
const has = caption != null && caption !== false && caption !== '';
|
|
50
|
+
return {
|
|
51
|
+
has,
|
|
52
|
+
id: `${id}-caption`,
|
|
53
|
+
describedBy: [describedBy, has ? `${id}-caption` : undefined].filter(Boolean).join(' ') || undefined,
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Task progress on Base UI Progress: a 4 or 8px bar with an optional label row. `value={null}`
|
|
58
|
+
* makes it indeterminate, which fills the track faintly rather than animating.
|
|
59
|
+
*/
|
|
60
|
+
export const Progress = ({ label, caption, showValue = false, size, tone, className, 'aria-describedby': ariaDescribedBy, ...props }) => {
|
|
61
|
+
const captionLink = useCaption(caption, ariaDescribedBy);
|
|
62
|
+
const hasHeader = label != null || captionLink.has || showValue;
|
|
63
|
+
return (_jsxs(ProgressPrimitive.Root, { "aria-describedby": captionLink.describedBy, className: cn(rootClassName, className), "data-size": size ?? 'sm', "data-slot": "progress", "data-tone": tone ?? 'action', ...props, children: [hasHeader && (_jsxs(LabelRow, { slot: "progress-header", children: [label != null ? (_jsx(ProgressPrimitive.Label, { className: labelClassName, "data-slot": "progress-label", children: label })) : null, captionLink.has ? (_jsx("span", { className: captionClassName, "data-slot": "progress-caption", id: captionLink.id, children: caption })) : (showValue && (
|
|
64
|
+
// aria-valuetext already speaks the value, so the visible copy stays out of the way.
|
|
65
|
+
_jsx(ProgressPrimitive.Value, { "aria-hidden": true, className: valueClassName, "data-slot": "progress-value" })))] })), _jsx(ProgressPrimitive.Track, { className: progressTrackVariants({ size }), "data-slot": "progress-track", children: _jsx(ProgressPrimitive.Indicator, { className: progressIndicatorVariants({ tone }), "data-slot": "progress-indicator" }) })] }));
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A value within a known range on Base UI Meter, such as credits used of a plan's total:
|
|
69
|
+
* the same bar as Progress, always determinate. Base UI clamps the fill to the range.
|
|
70
|
+
*/
|
|
71
|
+
export const Meter = ({ label, caption, showValue = false, size, tone, className, 'aria-describedby': ariaDescribedBy, ...props }) => {
|
|
72
|
+
const captionLink = useCaption(caption, ariaDescribedBy);
|
|
73
|
+
const hasHeader = label != null || captionLink.has || showValue;
|
|
74
|
+
return (_jsxs(MeterPrimitive.Root, { "aria-describedby": captionLink.describedBy, className: cn(rootClassName, className), "data-size": size ?? 'sm', "data-slot": "meter", "data-tone": tone ?? 'action', ...props, children: [hasHeader && (_jsxs(LabelRow, { slot: "meter-header", children: [label != null ? (_jsx(MeterPrimitive.Label, { className: labelClassName, "data-slot": "meter-label", children: label })) : null, captionLink.has ? (_jsx("span", { className: captionClassName, "data-slot": "meter-caption", id: captionLink.id, children: caption })) : (showValue && (_jsx(MeterPrimitive.Value, { "aria-hidden": true, className: valueClassName, "data-slot": "meter-value" })))] })), _jsx(MeterPrimitive.Track, { className: progressTrackVariants({ size }), "data-slot": "meter-track", children: _jsx(MeterPrimitive.Indicator, { className: progressIndicatorVariants({ tone }), "data-slot": "meter-indicator" }) })] }));
|
|
75
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
2
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
3
|
+
import { type WithClassName } from '../lib/cn.js';
|
|
4
|
+
/** A stack of radios; inside a Field it is named by the FieldLabel and described by the helper. */
|
|
5
|
+
export declare const RadioGroup: <Value>({ className, disabled, "aria-labelledby": labelledBy, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, ...props }: WithClassName<RadioGroupPrimitive.Props<Value>>) => import("react").JSX.Element;
|
|
6
|
+
/** The library radiobutton: a hairline ring with a 14px action dot, as in the report generator. */
|
|
7
|
+
export declare const RadioGroupItem: <Value>({ className, id, "aria-describedby": describedBy, ...props }: WithClassName<RadioPrimitive.Root.Props<Value>>) => import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { Radio as RadioPrimitive } from '@base-ui/react/radio';
|
|
4
|
+
import { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group';
|
|
5
|
+
import { cn } from '../lib/cn.js';
|
|
6
|
+
import { focusRing, touchTarget } from './button.js';
|
|
7
|
+
import { FieldContext, useField, useFieldControl } from './field.js';
|
|
8
|
+
/** A stack of radios; inside a Field it is named by the FieldLabel and described by the helper. */
|
|
9
|
+
export const RadioGroup = ({ className, disabled, 'aria-labelledby': labelledBy, 'aria-describedby': describedBy, 'aria-invalid': ariaInvalid, ...props }) => {
|
|
10
|
+
const field = useField();
|
|
11
|
+
// The group is a div, so a <label for> cannot name it; the id stays on the label.
|
|
12
|
+
const { id: _id, invalid: _invalid, ...control } = useFieldControl({
|
|
13
|
+
disabled,
|
|
14
|
+
'aria-describedby': describedBy,
|
|
15
|
+
'aria-invalid': ariaInvalid,
|
|
16
|
+
});
|
|
17
|
+
return (
|
|
18
|
+
// The group has used its Field; items must not take that Field's id, or its label would name
|
|
19
|
+
// the first radio. An item only answers to a Field nested inside the group (one per option).
|
|
20
|
+
_jsx(FieldContext.Provider, { value: null, children: _jsx(RadioGroupPrimitive, { "aria-labelledby": labelledBy ?? (props['aria-label'] ? undefined : field?.labelId), className: cn('flex flex-col gap-2', className), "data-slot": "radio-group", ...control, ...props }) }));
|
|
21
|
+
};
|
|
22
|
+
/** The library radiobutton: a hairline ring with a 14px action dot, as in the report generator. */
|
|
23
|
+
export const RadioGroupItem = ({ className, id, 'aria-describedby': describedBy, ...props }) => {
|
|
24
|
+
// A radio in its own Field (label beside each option) takes that Field's id, so the
|
|
25
|
+
// label's for= names it and a click on the label selects it, as with Checkbox and Switch.
|
|
26
|
+
const field = useField();
|
|
27
|
+
const control = useFieldControl({ id, 'aria-describedby': describedBy });
|
|
28
|
+
return (_jsx(RadioPrimitive.Root, { className: cn('inline-flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-full border border-neutral-300 bg-transparent shadow-control transition-[border-color] duration-150',
|
|
29
|
+
// A 44px square a finger can find round the 20px ring, on a touch screen only.
|
|
30
|
+
touchTarget,
|
|
31
|
+
// The root is a span, not a button, so the disabled state comes from its data attribute.
|
|
32
|
+
'not-data-disabled:hover:border-neutral-400 data-disabled:cursor-not-allowed data-disabled:opacity-50', '[[aria-invalid=true]_&]:border-error-500', focusRing, className), "data-slot": "radio-group-item", id: control.id, "aria-describedby": field ? control['aria-describedby'] : describedBy, ...props, children: _jsx(RadioPrimitive.Indicator, { className: "size-3.5 rounded-full bg-action [background-image:var(--action-gradient)]", "data-slot": "radio-group-indicator" }) }));
|
|
33
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { type ComponentProps, type ReactNode } from 'react';
|
|
3
|
+
import { type StatusDotTone } from './status-dot.js';
|
|
4
|
+
export declare const readonlyFieldWellVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "md" | null | undefined;
|
|
6
|
+
copyable?: boolean | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
|
+
export declare const readonlyFieldVitalVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
|
|
9
|
+
export type ReadonlyFieldProps = Omit<ComponentProps<'div'>, 'children' | 'onCopy'> & Pick<VariantProps<typeof readonlyFieldWellVariants>, 'size'> & {
|
|
10
|
+
label: ReactNode;
|
|
11
|
+
value?: ReactNode;
|
|
12
|
+
/** `well` stacks the label over a filled box; `vital` is a compact bordered row for one reading. */
|
|
13
|
+
variant?: 'well' | 'vital';
|
|
14
|
+
/** Shown, quieter, when there is no value. */
|
|
15
|
+
emptyText?: ReactNode;
|
|
16
|
+
/** Well only: adds a copy button. */
|
|
17
|
+
copyable?: boolean;
|
|
18
|
+
/** The text copied; defaults to the value when it is a string or number. */
|
|
19
|
+
copyValue?: string;
|
|
20
|
+
onCopy?: (text: string) => void;
|
|
21
|
+
/** The copy button's name and tooltip, and what it says once it has copied. */
|
|
22
|
+
copyLabel?: string;
|
|
23
|
+
copiedLabel?: string;
|
|
24
|
+
/** Vital only: the colour of the dot before the value; leave it out for no dot. */
|
|
25
|
+
tone?: StatusDotTone;
|
|
26
|
+
/**
|
|
27
|
+
* Well only: where a long text value cuts. `end` by default; `middle` for a key, an ID, a
|
|
28
|
+
* hash or a URL, which are told apart by their end (`whsec_9f2c…a71d`).
|
|
29
|
+
*/
|
|
30
|
+
truncate?: 'end' | 'middle';
|
|
31
|
+
};
|
|
32
|
+
/** A read-only fact in a form layout: a label over a filled well, or a compact vital row with a status dot. */
|
|
33
|
+
export declare const ReadonlyField: ({ label, value, variant, size, emptyText, copyable, copyValue, onCopy, copyLabel, copiedLabel, tone, truncate, className, ...props }: ReadonlyFieldProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { cva } from 'class-variance-authority';
|
|
4
|
+
import { Check, Copy } from 'lucide-react';
|
|
5
|
+
import { useEffect, useId, useRef, useState } from 'react';
|
|
6
|
+
import { cn } from '../lib/cn.js';
|
|
7
|
+
import { Button } from './button.js';
|
|
8
|
+
import { StatusDot } from './status-dot.js';
|
|
9
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from './tooltip.js';
|
|
10
|
+
import { Truncate } from './truncate.js';
|
|
11
|
+
/*
|
|
12
|
+
* The well is a read-only twin of Input: the same heights and radii, but filled with the 4% wash instead of
|
|
13
|
+
* bordered, so a fact never looks like something to type into.
|
|
14
|
+
*/
|
|
15
|
+
export const readonlyFieldWellVariants = cva('flex w-full min-w-0 items-center gap-2 bg-neutral-950/4 font-normal text-neutral-900 text-xs', {
|
|
16
|
+
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
sm: 'h-control rounded-control px-3',
|
|
19
|
+
md: 'h-control-lg rounded-control px-3',
|
|
20
|
+
},
|
|
21
|
+
copyable: {
|
|
22
|
+
// The copy button sits inset in the well, so the well's right padding becomes that inset.
|
|
23
|
+
true: '',
|
|
24
|
+
false: '',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
// The inset is the well's height less the 28px button, halved, so it matches the inset above
|
|
28
|
+
// and below at every size scale, and the button's corner calc below uses the same sum.
|
|
29
|
+
compoundVariants: [
|
|
30
|
+
{ size: 'sm', copyable: true, className: 'pr-[3px]' },
|
|
31
|
+
{
|
|
32
|
+
size: 'md',
|
|
33
|
+
copyable: true,
|
|
34
|
+
className: 'pr-[calc((var(--spacing-control-lg)-var(--spacing-control-sm))/2)]',
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
defaultVariants: { size: 'md', copyable: false },
|
|
38
|
+
});
|
|
39
|
+
/* A bordered pill row for a single reading, such as a web vital: label left, status and value right. */
|
|
40
|
+
export const readonlyFieldVitalVariants = cva([
|
|
41
|
+
'flex h-segment w-full min-w-0 items-center justify-between gap-3 rounded-pill border border-neutral-200 px-3 text-xs',
|
|
42
|
+
]);
|
|
43
|
+
// The copy button is 28px, so its corner is the well's corner less the inset that centres it.
|
|
44
|
+
const copyButtonRadius = {
|
|
45
|
+
sm: 'rounded-[calc(var(--radius-control)-3px)]',
|
|
46
|
+
md: 'rounded-[calc(var(--radius-control)-(var(--spacing-control-lg)-var(--spacing-control-sm))/2)]',
|
|
47
|
+
};
|
|
48
|
+
const isEmpty = (value) => value === null || value === undefined || value === false || value === '';
|
|
49
|
+
/** A read-only fact in a form layout: a label over a filled well, or a compact vital row with a status dot. */
|
|
50
|
+
export const ReadonlyField = ({ label, value, variant = 'well', size, emptyText = '—', copyable = false, copyValue, onCopy, copyLabel = 'Copy', copiedLabel = 'Copied', tone, truncate = 'end', className, ...props }) => {
|
|
51
|
+
const labelId = useId();
|
|
52
|
+
const empty = isEmpty(value);
|
|
53
|
+
const shown = empty ? _jsx("span", { className: "text-neutral-600", children: emptyText }) : value;
|
|
54
|
+
if (variant === 'vital') {
|
|
55
|
+
return (_jsxs("div", { className: cn(readonlyFieldVitalVariants(), className), "data-empty": empty || undefined, "data-slot": "readonly-field", "data-variant": "vital", ...props, children: [_jsx("span", { className: "min-w-0 truncate font-normal text-neutral-600", "data-slot": "readonly-field-label", id: labelId, children: label }), _jsxs("span", { className: "flex shrink-0 items-center gap-1.5 font-medium text-neutral-950 tabular-nums", "data-slot": "readonly-field-value", children: [tone && !empty && _jsx(StatusDot, { size: "sm", tone: tone }), shown] })] }));
|
|
56
|
+
}
|
|
57
|
+
const text = copyValue ?? (typeof value === 'string' || typeof value === 'number' ? String(value) : '');
|
|
58
|
+
const canCopy = copyable && !empty && text !== '';
|
|
59
|
+
const resolvedSize = size ?? 'md';
|
|
60
|
+
return (_jsxs("div", { className: cn('flex min-w-0 flex-col gap-1.5', className), "data-empty": empty || undefined, "data-slot": "readonly-field", "data-variant": "well", ...props, children: [_jsx("span", { className: "font-normal text-neutral-600 text-xs", "data-slot": "readonly-field-label", id: labelId, children: label }), _jsxs("div", { className: readonlyFieldWellVariants({ size: resolvedSize, copyable: copyable }), "data-slot": "readonly-field-well", children: [_jsx("span", { className: "min-w-0 flex-1 truncate tabular-nums", "data-slot": "readonly-field-value", children: truncate === 'middle' && typeof value === 'string' && !empty ? (_jsx(Truncate, { at: "middle", children: value })) : (shown) }), copyable && (_jsx(CopyButton, { className: copyButtonRadius[resolvedSize], copiedLabel: copiedLabel, copyLabel: copyLabel, describedBy: labelId, disabled: !canCopy, onCopy: onCopy, text: text }))] })] }));
|
|
61
|
+
};
|
|
62
|
+
const CopyButton = ({ text, disabled, className, describedBy, onCopy, copyLabel, copiedLabel, }) => {
|
|
63
|
+
const [copied, setCopied] = useState(false);
|
|
64
|
+
const timer = useRef(undefined);
|
|
65
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
66
|
+
const copy = async () => {
|
|
67
|
+
try {
|
|
68
|
+
await navigator.clipboard.writeText(text);
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// No clipboard (an insecure origin or a denied permission): leave the state alone rather than lie.
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
onCopy?.(text);
|
|
75
|
+
setCopied(true);
|
|
76
|
+
clearTimeout(timer.current);
|
|
77
|
+
timer.current = setTimeout(() => setCopied(false), 1500);
|
|
78
|
+
};
|
|
79
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { render: _jsx(Button, { "aria-describedby": describedBy, "aria-label": copied ? copiedLabel : copyLabel, className: className, "data-copied": copied || undefined, disabled: disabled, onClick: copy, size: "icon-sm", variant: "ghost" }), children: _jsxs("span", { className: "grid place-items-center *:col-start-1 *:row-start-1 *:transition-[opacity,scale] *:duration-150 *:ease-out-strong motion-reduce:*:scale-100", children: [_jsx(Copy, { className: cn(copied && 'scale-[0.8] opacity-0'), strokeWidth: 2 }), _jsx(Check, { className: cn(!copied && 'scale-[0.8] opacity-0'), strokeWidth: 2 })] }) }), _jsx(TooltipContent, { children: copied ? copiedLabel : copyLabel })] }), _jsx("span", { "aria-live": "polite", className: "sr-only", children: copied ? copiedLabel : '' })] }));
|
|
80
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Toggle } from '@base-ui/react/toggle';
|
|
2
|
+
import { ToggleGroup } from '@base-ui/react/toggle-group';
|
|
3
|
+
export type SegmentedControlProps = Omit<ToggleGroup.Props, 'className' | 'multiple' | 'value' | 'defaultValue' | 'onValueChange'> & {
|
|
4
|
+
className?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
defaultValue?: string;
|
|
7
|
+
onValueChange?: (value: string) => void;
|
|
8
|
+
/** Shares the full width out evenly between the items, instead of hugging them. */
|
|
9
|
+
fill?: boolean;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Picks one value that reshapes the same content: a view (List · Grid), a range (7d · 30d), a filter.
|
|
13
|
+
* To switch between panels with content of their own, use Tabs instead.
|
|
14
|
+
* Always holds one value: clicking the active segment keeps it selected. The active fill is one
|
|
15
|
+
* thumb under the items, so it slides from the old value to the new one.
|
|
16
|
+
*/
|
|
17
|
+
export declare const SegmentedControl: ({ fill, value, defaultValue, onValueChange, disabled, className, children, onKeyDown, "aria-labelledby": labelledBy, "aria-describedby": describedBy, ...props }: SegmentedControlProps) => import("react").JSX.Element;
|
|
18
|
+
export type SegmentedControlItemProps = Omit<Toggle.Props, 'className'> & {
|
|
19
|
+
className?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const SegmentedControlItem: ({ className, ...props }: SegmentedControlItemProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Toggle } from '@base-ui/react/toggle';
|
|
4
|
+
import { ToggleGroup } from '@base-ui/react/toggle-group';
|
|
5
|
+
import { Children, isValidElement, useCallback, useEffect, useLayoutEffect, useRef, useState, } from 'react';
|
|
6
|
+
import { cn } from '../lib/cn.js';
|
|
7
|
+
import { useOverflowScroll } from '../lib/overflow-scroll.js';
|
|
8
|
+
import { radioToggleRender } from '../lib/radio-toggle-render.js';
|
|
9
|
+
import { useSingleValue } from '../lib/use-single-value.js';
|
|
10
|
+
import { focusRing } from './button.js';
|
|
11
|
+
import { useField, useFieldControl } from './field.js';
|
|
12
|
+
// The keys Base UI's group moves focus with.
|
|
13
|
+
const selectKeys = new Set(['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Home', 'End']);
|
|
14
|
+
/** The value of the first enabled item among the children, for a control given no value at all. */
|
|
15
|
+
const firstItemValue = (children) => {
|
|
16
|
+
for (const child of Children.toArray(children)) {
|
|
17
|
+
if (!isValidElement(child))
|
|
18
|
+
continue;
|
|
19
|
+
const { value, disabled } = child.props;
|
|
20
|
+
if (typeof value === 'string' && !disabled)
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
return undefined;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Picks one value that reshapes the same content: a view (List · Grid), a range (7d · 30d), a filter.
|
|
27
|
+
* To switch between panels with content of their own, use Tabs instead.
|
|
28
|
+
* Always holds one value: clicking the active segment keeps it selected. The active fill is one
|
|
29
|
+
* thumb under the items, so it slides from the old value to the new one.
|
|
30
|
+
*/
|
|
31
|
+
export const SegmentedControl = ({ fill, value, defaultValue, onValueChange, disabled, className, children, onKeyDown, 'aria-labelledby': labelledBy, 'aria-describedby': describedBy, ...props }) => {
|
|
32
|
+
// Left without a value, it starts on its first item, so it holds one from the start.
|
|
33
|
+
const [current, select] = useSingleValue(value, defaultValue ?? firstItemValue(children), onValueChange);
|
|
34
|
+
const ref = useRef(null);
|
|
35
|
+
const field = useField();
|
|
36
|
+
// Inside a Field it is named by the FieldLabel, described by the helper and disabled with it.
|
|
37
|
+
// The group is a div, so a <label for> cannot name it; the id stays on the label.
|
|
38
|
+
const control = useFieldControl({ disabled, 'aria-describedby': describedBy });
|
|
39
|
+
// A radiogroup selects as the arrows move along it; Base UI's group only moves focus, so once it
|
|
40
|
+
// has, the item that took focus is picked.
|
|
41
|
+
const handleKeyDown = event => {
|
|
42
|
+
onKeyDown?.(event);
|
|
43
|
+
if (!selectKeys.has(event.key))
|
|
44
|
+
return;
|
|
45
|
+
const group = event.currentTarget;
|
|
46
|
+
const from = document.activeElement;
|
|
47
|
+
requestAnimationFrame(() => {
|
|
48
|
+
const item = document.activeElement;
|
|
49
|
+
if (item instanceof HTMLElement &&
|
|
50
|
+
item !== from &&
|
|
51
|
+
item.parentElement === group &&
|
|
52
|
+
item.matches('[data-slot=segmented-control-item]:not([data-disabled])')) {
|
|
53
|
+
item.click();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const [thumb, setThumb] = useState();
|
|
58
|
+
// Measured before paint, so the thumb lands on the first value without sliding to it; it only
|
|
59
|
+
// slides once it has a place to slide from, and follows a resize (a font loading, `fill`) the same way.
|
|
60
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: the pressed item is read from the DOM, so a new value re-measures
|
|
61
|
+
useLayoutEffect(() => {
|
|
62
|
+
const group = ref.current;
|
|
63
|
+
if (!group)
|
|
64
|
+
return;
|
|
65
|
+
const measure = () => {
|
|
66
|
+
const item = group.querySelector(':scope > [data-slot=segmented-control-item][data-pressed]');
|
|
67
|
+
setThumb(previous => item
|
|
68
|
+
? {
|
|
69
|
+
left: item.offsetLeft,
|
|
70
|
+
width: item.offsetWidth,
|
|
71
|
+
moved: previous !== undefined,
|
|
72
|
+
}
|
|
73
|
+
: undefined);
|
|
74
|
+
};
|
|
75
|
+
measure();
|
|
76
|
+
const observer = new ResizeObserver(() => measure());
|
|
77
|
+
observer.observe(group);
|
|
78
|
+
return () => observer.disconnect();
|
|
79
|
+
}, [current]);
|
|
80
|
+
// Items keep their labels' width, so labels never run into each other; more than fit scrolls
|
|
81
|
+
// the track sideways, the picked one kept in view. Only once it overflows, so a track that fits
|
|
82
|
+
// keeps its focus rings whole. More than four options on a narrow page is a Select's job.
|
|
83
|
+
const overflow = useOverflowScroll();
|
|
84
|
+
const setGroup = useCallback((node) => {
|
|
85
|
+
ref.current = node;
|
|
86
|
+
overflow.ref(node);
|
|
87
|
+
}, [overflow.ref]);
|
|
88
|
+
const { overflows } = overflow.edges;
|
|
89
|
+
const { reveal } = overflow;
|
|
90
|
+
useEffect(() => {
|
|
91
|
+
if (current && overflows)
|
|
92
|
+
reveal('[data-pressed]');
|
|
93
|
+
}, [current, overflows, reveal]);
|
|
94
|
+
return (_jsxs(ToggleGroup, { className: cn(
|
|
95
|
+
// Hugs its items even in a stretching flex column, and never outgrows its parent.
|
|
96
|
+
'relative isolate flex h-control max-w-full items-center rounded-control border border-neutral-200 bg-segment-track p-[2px] shadow-control', fill ? 'w-full [&>[data-slot=segmented-control-item]]:flex-1' : 'w-fit', overflows && 'scrollbar-none overflow-x-auto', className), "data-slot": "segmented-control", ref: setGroup, style: overflows ? overflow.style : undefined, role: "radiogroup", "aria-describedby": control['aria-describedby'], "aria-labelledby": labelledBy ?? (props['aria-label'] ? undefined : field?.labelId), disabled: control.disabled, onKeyDown: handleKeyDown, ...props,
|
|
97
|
+
// Clicking the pressed item hands back an empty array, which `select` ignores.
|
|
98
|
+
onValueChange: values => select(values[0] ?? ''), value: current ? [current] : [], children: [thumb && (_jsx("span", { "aria-hidden": true, className: cn(
|
|
99
|
+
// The item's own corner and raise: an inset ring, so its outline adds no width.
|
|
100
|
+
// The 2px inset is fixed, as h-segment (control − 5px) assumes, at every spacing unit.
|
|
101
|
+
'absolute top-[2px] left-0 -z-10 h-segment rounded-[calc(var(--radius-control)-3px)] bg-segment [box-shadow:inset_0_0_0_1px_var(--color-segment-border),var(--shadow-segment)]', thumb.moved &&
|
|
102
|
+
'transition-[translate,width] duration-200 ease-out-strong motion-reduce:transition-none'), "data-slot": "segmented-control-thumb", style: { translate: `${thumb.left}px 0`, width: thumb.width } })), children] }));
|
|
103
|
+
};
|
|
104
|
+
export const SegmentedControlItem = ({ className, ...props }) => (_jsx(Toggle, { className: cn(
|
|
105
|
+
// The track's radius minus its 2px inset and 1px border, so the curves stay concentric in every theme.
|
|
106
|
+
'inline-flex h-segment shrink-0 cursor-pointer select-none items-center justify-center gap-2 whitespace-nowrap rounded-[calc(var(--radius-control)-3px)] px-2.5 font-medium text-neutral-600 text-xs transition-[background-color,color] duration-150', 'hover:bg-neutral-950/5 hover:text-neutral-800',
|
|
107
|
+
// The thumb under it is the fill; the item only takes the thumb's text colour.
|
|
108
|
+
'data-pressed:text-segment-fg data-pressed:hover:bg-transparent data-pressed:hover:text-segment-fg', 'data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg:not([class*=size-])]:size-icon [&_svg]:shrink-0', focusRing, className), "data-slot": "segmented-control-item", render: radioToggleRender, ...props }));
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Select as SelectPrimitive } from '@base-ui/react/select';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import { type ReactNode } from 'react';
|
|
4
|
+
import { type WithClassName } from '../lib/cn.js';
|
|
5
|
+
export type SelectProps<Value = string> = Omit<SelectPrimitive.Root.Props<Value>, 'onValueChange' | 'multiple'> & {
|
|
6
|
+
/**
|
|
7
|
+
* The value-to-label map the closed trigger shows. Leave it out when the SelectItems are written
|
|
8
|
+
* inline under <Select>: their labels are read from the JSX. Pass it when the items come from a
|
|
9
|
+
* component of your own (<SelectContent><RangeOptions /></SelectContent>) or a wrapper around
|
|
10
|
+
* SelectItem, since those are not walked, and the trigger would otherwise show the raw value.
|
|
11
|
+
*/
|
|
12
|
+
items?: SelectPrimitive.Root.Props<Value>['items'];
|
|
13
|
+
/** Never called with null: a single select without a null item can't be cleared. */
|
|
14
|
+
onValueChange?: (value: Value, eventDetails: SelectPrimitive.Root.ChangeEventDetails) => void;
|
|
15
|
+
};
|
|
16
|
+
export declare const Select: <Value = string>({ children, items, onValueChange, ...props }: SelectProps<Value>) => import("react").JSX.Element;
|
|
17
|
+
export declare const SelectGroup: (props: SelectPrimitive.Group.Props) => import("react").JSX.Element;
|
|
18
|
+
export declare const SelectValue: (props: SelectPrimitive.Value.Props) => import("react").JSX.Element;
|
|
19
|
+
export declare const selectTriggerVariants: (props?: ({
|
|
20
|
+
size?: "sm" | "md" | null | undefined;
|
|
21
|
+
invalid?: boolean | null | undefined;
|
|
22
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
23
|
+
export type SelectTriggerProps = WithClassName<SelectPrimitive.Trigger.Props> & Omit<VariantProps<typeof selectTriggerVariants>, 'invalid'> & {
|
|
24
|
+
leadingIcon?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* `right` gives the "Select ›" picker look of a settings row, where the trigger reads as a
|
|
27
|
+
* way into a choice rather than a field; the list still opens below it.
|
|
28
|
+
*/
|
|
29
|
+
indicator?: 'down' | 'right';
|
|
30
|
+
};
|
|
31
|
+
/** The library's "select input small/medium"; also the rows-per-page picker in tables. */
|
|
32
|
+
export declare const SelectTrigger: ({ size, leadingIcon, indicator, className, children, id, disabled, "aria-describedby": describedBy, "aria-invalid": ariaInvalid, ...props }: SelectTriggerProps) => import("react").JSX.Element;
|
|
33
|
+
export type SelectContentProps = WithClassName<SelectPrimitive.Popup.Props> & Pick<SelectPrimitive.Positioner.Props, 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'alignItemWithTrigger'> & {
|
|
34
|
+
/** Where the list is portalled; the body by default. */
|
|
35
|
+
container?: SelectPrimitive.Portal.Props['container'];
|
|
36
|
+
};
|
|
37
|
+
/** The library's "dropdown": a raised list on the surface colour, at least as wide as its trigger. */
|
|
38
|
+
export declare const SelectContent: ({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, container, ...props }: SelectContentProps) => import("react").JSX.Element;
|
|
39
|
+
export declare const SelectLabel: ({ className, ...props }: WithClassName<SelectPrimitive.GroupLabel.Props>) => import("react").JSX.Element;
|
|
40
|
+
/** An option: a `MenuItem` row, with a check on the picked one. */
|
|
41
|
+
export declare const SelectItem: ({ className, children, ...props }: WithClassName<SelectPrimitive.Item.Props>) => import("react").JSX.Element;
|
|
42
|
+
export declare const SelectSeparator: ({ className, ...props }: WithClassName<SelectPrimitive.Separator.Props>) => import("react").JSX.Element;
|