@zonsh/ui 0.0.0 → 0.2.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 +21 -0
- package/README.md +75 -1
- package/assets/illustrations/drawing/bracket-construction-dark.svg +77 -0
- package/assets/illustrations/drawing/bracket-construction-filled-dark.svg +50 -0
- package/assets/illustrations/drawing/bracket-construction-filled.svg +50 -0
- package/assets/illustrations/drawing/bracket-construction.svg +77 -0
- package/assets/illustrations/drawing/crescent-dark.svg +28 -0
- package/assets/illustrations/drawing/crescent-guides-dark.svg +33 -0
- package/assets/illustrations/drawing/crescent-guides.svg +33 -0
- package/assets/illustrations/drawing/crescent.svg +28 -0
- package/assets/illustrations/drawing/eclipse-dark.svg +187 -0
- package/assets/illustrations/drawing/eclipse-guides-dark.svg +191 -0
- package/assets/illustrations/drawing/eclipse-guides.svg +191 -0
- package/assets/illustrations/drawing/eclipse.svg +187 -0
- package/assets/illustrations/drawing/elevation-guides-dark.svg +31 -0
- package/assets/illustrations/drawing/elevation-guides-plain-dark.svg +9 -0
- package/assets/illustrations/drawing/elevation-guides-plain.svg +9 -0
- package/assets/illustrations/drawing/elevation-guides.svg +31 -0
- package/assets/illustrations/drawing/horizon-dark.svg +30 -0
- package/assets/illustrations/drawing/horizon.svg +30 -0
- package/assets/illustrations/drawing/nib-study-dark.svg +107 -0
- package/assets/illustrations/drawing/nib-study-plain-dark.svg +93 -0
- package/assets/illustrations/drawing/nib-study-plain.svg +93 -0
- package/assets/illustrations/drawing/nib-study.svg +107 -0
- package/assets/illustrations/editorial/assistant-640.webp +0 -0
- package/assets/illustrations/editorial/assistant.webp +0 -0
- package/assets/illustrations/editorial/automation-640.webp +0 -0
- package/assets/illustrations/editorial/automation.webp +0 -0
- package/assets/illustrations/editorial/bracket-left-640.webp +0 -0
- package/assets/illustrations/editorial/bracket-left.webp +0 -0
- package/assets/illustrations/editorial/bracket-right-640.webp +0 -0
- package/assets/illustrations/editorial/bracket-right.webp +0 -0
- package/assets/illustrations/editorial/custom-software-640.webp +0 -0
- package/assets/illustrations/editorial/custom-software.webp +0 -0
- package/assets/illustrations/editorial/digitalization-640.webp +0 -0
- package/assets/illustrations/editorial/digitalization.webp +0 -0
- package/assets/illustrations/editorial/integration-640.webp +0 -0
- package/assets/illustrations/editorial/integration.webp +0 -0
- package/assets/illustrations/editorial/problem-640.webp +0 -0
- package/assets/illustrations/editorial/problem.webp +0 -0
- package/assets/illustrations/editorial/process-analysis-640.webp +0 -0
- package/assets/illustrations/editorial/process-analysis.webp +0 -0
- package/assets/illustrations/editorial/process-concept-640.webp +0 -0
- package/assets/illustrations/editorial/process-concept.webp +0 -0
- package/assets/illustrations/editorial/process-development-640.webp +0 -0
- package/assets/illustrations/editorial/process-development.webp +0 -0
- package/assets/illustrations/editorial/process-discovery-640.webp +0 -0
- package/assets/illustrations/editorial/process-discovery.webp +0 -0
- package/assets/illustrations/editorial/process-maintenance-640.webp +0 -0
- package/assets/illustrations/editorial/process-maintenance.webp +0 -0
- package/assets/illustrations/editorial/process-prototype-640.webp +0 -0
- package/assets/illustrations/editorial/process-prototype.webp +0 -0
- package/assets/illustrations/editorial/process-testing-640.webp +0 -0
- package/assets/illustrations/editorial/process-testing.webp +0 -0
- package/assets/illustrations/iso/automation-dark.svg +6 -0
- package/assets/illustrations/iso/automation.svg +6 -0
- package/assets/illustrations/iso/bar-chart-dark.svg +6 -0
- package/assets/illustrations/iso/bar-chart.svg +6 -0
- package/assets/illustrations/iso/brackets-classic-dark.svg +6 -0
- package/assets/illustrations/iso/brackets-classic.svg +6 -0
- package/assets/illustrations/iso/brackets-dark.svg +6 -0
- package/assets/illustrations/iso/brackets.svg +6 -0
- package/assets/illustrations/iso/city-dark.svg +6 -0
- package/assets/illustrations/iso/city.svg +6 -0
- package/assets/illustrations/iso/conveyor-dark.svg +6 -0
- package/assets/illustrations/iso/conveyor.svg +6 -0
- package/assets/illustrations/iso/database-dark.svg +6 -0
- package/assets/illustrations/iso/database.svg +6 -0
- package/assets/illustrations/iso/documents-dark.svg +6 -0
- package/assets/illustrations/iso/documents.svg +6 -0
- package/assets/illustrations/iso/inbox-dark.svg +6 -0
- package/assets/illustrations/iso/inbox.svg +6 -0
- package/assets/illustrations/iso/laptop-dark.svg +6 -0
- package/assets/illustrations/iso/laptop.svg +6 -0
- package/assets/illustrations/iso/monitor-dark.svg +6 -0
- package/assets/illustrations/iso/monitor.svg +6 -0
- package/assets/illustrations/iso/pipeline-dark.svg +6 -0
- package/assets/illustrations/iso/pipeline.svg +6 -0
- package/assets/illustrations/iso/platform-dark.svg +6 -0
- package/assets/illustrations/iso/platform.svg +6 -0
- package/assets/illustrations/iso/server-dark.svg +6 -0
- package/assets/illustrations/iso/server.svg +6 -0
- package/assets/illustrations/iso/spreadsheet-dark.svg +6 -0
- package/assets/illustrations/iso/spreadsheet.svg +6 -0
- package/assets/illustrations/iso/timeline-dark.svg +6 -0
- package/assets/illustrations/iso/timeline.svg +6 -0
- package/assets/illustrations/sheet/construction.svg +115 -0
- package/assets/illustrations/sheet/crescent.svg +40 -0
- package/assets/illustrations/sheet/limb.svg +42 -0
- package/assets/illustrations/sheet/stress-axis.svg +119 -0
- package/assets/illustrations/sheet/totality.svg +215 -0
- package/assets/illustrations/sheet/vertical-metrics.svg +43 -0
- package/assets/logo-left.svg +1 -0
- package/assets/logo-right.svg +1 -0
- package/assets/logo.svg +1 -0
- package/dist/components/_overlay.d.ts +47 -0
- package/dist/components/_overlay.js +59 -0
- package/dist/components/accordion.d.ts +32 -0
- package/dist/components/accordion.js +39 -0
- package/dist/components/alert-dialog.d.ts +45 -0
- package/dist/components/alert-dialog.js +56 -0
- package/dist/components/alert.d.ts +35 -0
- package/dist/components/alert.js +42 -0
- package/dist/components/ascii-field.d.ts +34 -0
- package/dist/components/ascii-field.js +410 -0
- package/dist/components/aspect-ratio.d.ts +14 -0
- package/dist/components/aspect-ratio.js +17 -0
- package/dist/components/avatar.d.ts +42 -0
- package/dist/components/avatar.js +55 -0
- package/dist/components/badge.d.ts +70 -0
- package/dist/components/badge.js +62 -0
- package/dist/components/breadcrumb.d.ts +22 -0
- package/dist/components/breadcrumb.js +32 -0
- package/dist/components/button-group.d.ts +30 -0
- package/dist/components/button-group.js +47 -0
- package/dist/components/button.d.ts +53 -0
- package/dist/components/button.js +130 -0
- package/dist/components/calendar.d.ts +26 -0
- package/dist/components/calendar.js +164 -0
- package/dist/components/card.d.ts +42 -0
- package/dist/components/card.js +76 -0
- package/dist/components/carousel.d.ts +90 -0
- package/dist/components/carousel.js +213 -0
- package/dist/components/chart.d.ts +180 -0
- package/dist/components/chart.js +286 -0
- package/dist/components/checkbox.d.ts +23 -0
- package/dist/components/checkbox.js +43 -0
- package/dist/components/code-block.d.ts +45 -0
- package/dist/components/code-block.js +58 -0
- package/dist/components/code-highlight.d.ts +13 -0
- package/dist/components/code-highlight.js +107 -0
- package/dist/components/collapsible.d.ts +20 -0
- package/dist/components/collapsible.js +32 -0
- package/dist/components/color-picker.d.ts +85 -0
- package/dist/components/color-picker.js +407 -0
- package/dist/components/combobox.d.ts +81 -0
- package/dist/components/combobox.js +100 -0
- package/dist/components/command.d.ts +112 -0
- package/dist/components/command.js +212 -0
- package/dist/components/context-menu.d.ts +29 -0
- package/dist/components/context-menu.js +35 -0
- package/dist/components/conversation.d.ts +27 -0
- package/dist/components/conversation.js +293 -0
- package/dist/components/copy-button.d.ts +46 -0
- package/dist/components/copy-button.js +118 -0
- package/dist/components/data-table.d.ts +175 -0
- package/dist/components/data-table.js +302 -0
- package/dist/components/date-picker.d.ts +91 -0
- package/dist/components/date-picker.js +207 -0
- package/dist/components/dialog.d.ts +48 -0
- package/dist/components/dialog.js +92 -0
- package/dist/components/direction.d.ts +16 -0
- package/dist/components/direction.js +18 -0
- package/dist/components/drawer.d.ts +60 -0
- package/dist/components/drawer.js +76 -0
- package/dist/components/empty.d.ts +31 -0
- package/dist/components/empty.js +50 -0
- package/dist/components/feature-list.d.ts +54 -0
- package/dist/components/feature-list.js +43 -0
- package/dist/components/field.d.ts +15 -0
- package/dist/components/field.js +36 -0
- package/dist/components/file-drop.d.ts +55 -0
- package/dist/components/file-drop.js +197 -0
- package/dist/components/filter-bar.d.ts +106 -0
- package/dist/components/filter-bar.js +296 -0
- package/dist/components/form.d.ts +33 -0
- package/dist/components/form.js +34 -0
- package/dist/components/graph.d.ts +105 -0
- package/dist/components/graph.js +786 -0
- package/dist/components/illustration.d.ts +85 -0
- package/dist/components/illustration.js +165 -0
- package/dist/components/input-group.d.ts +127 -0
- package/dist/components/input-group.js +292 -0
- package/dist/components/input.d.ts +16 -0
- package/dist/components/input.js +25 -0
- package/dist/components/item.d.ts +64 -0
- package/dist/components/item.js +116 -0
- package/dist/components/kbd.d.ts +33 -0
- package/dist/components/kbd.js +38 -0
- package/dist/components/label.d.ts +12 -0
- package/dist/components/label.js +24 -0
- package/dist/components/layout.d.ts +136 -0
- package/dist/components/layout.js +162 -0
- package/dist/components/logo.d.ts +54 -0
- package/dist/components/logo.js +96 -0
- package/dist/components/menu.d.ts +60 -0
- package/dist/components/menu.js +138 -0
- package/dist/components/menubar.d.ts +62 -0
- package/dist/components/menubar.js +223 -0
- package/dist/components/message.d.ts +42 -0
- package/dist/components/message.js +56 -0
- package/dist/components/meter.d.ts +31 -0
- package/dist/components/meter.js +25 -0
- package/dist/components/native-select.d.ts +26 -0
- package/dist/components/native-select.js +35 -0
- package/dist/components/navigation-menu.d.ts +42 -0
- package/dist/components/navigation-menu.js +97 -0
- package/dist/components/number-field.d.ts +36 -0
- package/dist/components/number-field.js +153 -0
- package/dist/components/otp-field.d.ts +35 -0
- package/dist/components/otp-field.js +94 -0
- package/dist/components/pagination.d.ts +31 -0
- package/dist/components/pagination.js +70 -0
- package/dist/components/pdf-viewer.d.ts +69 -0
- package/dist/components/pdf-viewer.js +929 -0
- package/dist/components/popover.d.ts +33 -0
- package/dist/components/popover.js +48 -0
- package/dist/components/preview-card.d.ts +25 -0
- package/dist/components/preview-card.js +22 -0
- package/dist/components/progress.d.ts +27 -0
- package/dist/components/progress.js +23 -0
- package/dist/components/prompt-input.d.ts +131 -0
- package/dist/components/prompt-input.js +403 -0
- package/dist/components/quote.d.ts +22 -0
- package/dist/components/quote.js +15 -0
- package/dist/components/radio-group.d.ts +18 -0
- package/dist/components/radio-group.js +34 -0
- package/dist/components/reasoning.d.ts +31 -0
- package/dist/components/reasoning.js +70 -0
- package/dist/components/resizable.d.ts +38 -0
- package/dist/components/resizable.js +41 -0
- package/dist/components/response.d.ts +30 -0
- package/dist/components/response.js +538 -0
- package/dist/components/scroll-area.d.ts +33 -0
- package/dist/components/scroll-area.js +31 -0
- package/dist/components/select.d.ts +35 -0
- package/dist/components/select.js +60 -0
- package/dist/components/separator.d.ts +14 -0
- package/dist/components/separator.js +17 -0
- package/dist/components/sidebar.d.ts +147 -0
- package/dist/components/sidebar.js +489 -0
- package/dist/components/site-header.d.ts +59 -0
- package/dist/components/site-header.js +67 -0
- package/dist/components/skeleton.d.ts +31 -0
- package/dist/components/skeleton.js +29 -0
- package/dist/components/slider.d.ts +24 -0
- package/dist/components/slider.js +129 -0
- package/dist/components/sources.d.ts +25 -0
- package/dist/components/sources.js +35 -0
- package/dist/components/spinner.d.ts +36 -0
- package/dist/components/spinner.js +72 -0
- package/dist/components/suggestions.d.ts +20 -0
- package/dist/components/suggestions.js +18 -0
- package/dist/components/switch.d.ts +14 -0
- package/dist/components/switch.js +26 -0
- package/dist/components/table.d.ts +162 -0
- package/dist/components/table.js +758 -0
- package/dist/components/tabs.d.ts +25 -0
- package/dist/components/tabs.js +162 -0
- package/dist/components/tag.d.ts +41 -0
- package/dist/components/tag.js +88 -0
- package/dist/components/tags-input.d.ts +40 -0
- package/dist/components/tags-input.js +239 -0
- package/dist/components/textarea.d.ts +13 -0
- package/dist/components/textarea.js +16 -0
- package/dist/components/theme.d.ts +41 -0
- package/dist/components/theme.js +112 -0
- package/dist/components/time-field.d.ts +51 -0
- package/dist/components/time-field.js +437 -0
- package/dist/components/timeline.d.ts +76 -0
- package/dist/components/timeline.js +99 -0
- package/dist/components/toast.d.ts +72 -0
- package/dist/components/toast.js +196 -0
- package/dist/components/toggle-group.d.ts +41 -0
- package/dist/components/toggle-group.js +140 -0
- package/dist/components/toggle.d.ts +23 -0
- package/dist/components/toggle.js +35 -0
- package/dist/components/tool-call.d.ts +52 -0
- package/dist/components/tool-call.js +57 -0
- package/dist/components/toolbar.d.ts +17 -0
- package/dist/components/toolbar.js +34 -0
- package/dist/components/tooltip.d.ts +42 -0
- package/dist/components/tooltip.js +47 -0
- package/dist/components/tree.d.ts +75 -0
- package/dist/components/tree.js +636 -0
- package/dist/components/typography.d.ts +134 -0
- package/dist/components/typography.js +176 -0
- package/dist/components/video-player.d.ts +276 -0
- package/dist/components/video-player.js +1352 -0
- package/dist/components/whiteboard.d.ts +80 -0
- package/dist/components/whiteboard.js +389 -0
- package/dist/index.d.ts +85 -0
- package/dist/index.js +86 -0
- package/dist/lib/cn.d.ts +20 -0
- package/dist/lib/cn.js +38 -0
- package/dist/lib/code-highlight.d.ts +31 -0
- package/dist/lib/code-highlight.js +24 -0
- package/dist/lib/code-theme.d.ts +19 -0
- package/dist/lib/code-theme.js +140 -0
- package/dist/lib/collapse-row.d.ts +9 -0
- package/dist/lib/collapse-row.js +129 -0
- package/dist/lib/digit-roll.d.ts +21 -0
- package/dist/lib/digit-roll.js +31 -0
- package/dist/lib/editorial-assets.d.ts +16 -0
- package/dist/lib/editorial-assets.js +56 -0
- package/dist/lib/figure/catalog.d.ts +127 -0
- package/dist/lib/figure/catalog.js +130 -0
- package/dist/lib/figure/figures/automation.d.ts +7 -0
- package/dist/lib/figure/figures/automation.js +143 -0
- package/dist/lib/figure/figures/bar-chart.d.ts +7 -0
- package/dist/lib/figure/figures/bar-chart.js +99 -0
- package/dist/lib/figure/figures/brackets-classic.d.ts +11 -0
- package/dist/lib/figure/figures/brackets-classic.js +170 -0
- package/dist/lib/figure/figures/brackets.d.ts +8 -0
- package/dist/lib/figure/figures/brackets.js +84 -0
- package/dist/lib/figure/figures/city.d.ts +7 -0
- package/dist/lib/figure/figures/city.js +93 -0
- package/dist/lib/figure/figures/conveyor.d.ts +7 -0
- package/dist/lib/figure/figures/conveyor.js +97 -0
- package/dist/lib/figure/figures/database.d.ts +7 -0
- package/dist/lib/figure/figures/database.js +65 -0
- package/dist/lib/figure/figures/documents.d.ts +7 -0
- package/dist/lib/figure/figures/documents.js +83 -0
- package/dist/lib/figure/figures/inbox.d.ts +7 -0
- package/dist/lib/figure/figures/inbox.js +92 -0
- package/dist/lib/figure/figures/laptop.d.ts +7 -0
- package/dist/lib/figure/figures/laptop.js +67 -0
- package/dist/lib/figure/figures/monitor.d.ts +7 -0
- package/dist/lib/figure/figures/monitor.js +59 -0
- package/dist/lib/figure/figures/pipeline.d.ts +8 -0
- package/dist/lib/figure/figures/pipeline.js +117 -0
- package/dist/lib/figure/figures/platform.d.ts +7 -0
- package/dist/lib/figure/figures/platform.js +117 -0
- package/dist/lib/figure/figures/server.d.ts +7 -0
- package/dist/lib/figure/figures/server.js +115 -0
- package/dist/lib/figure/figures/spreadsheet.d.ts +7 -0
- package/dist/lib/figure/figures/spreadsheet.js +87 -0
- package/dist/lib/figure/figures/timeline.d.ts +7 -0
- package/dist/lib/figure/figures/timeline.js +65 -0
- package/dist/lib/figure/kernel.d.ts +152 -0
- package/dist/lib/figure/kernel.js +576 -0
- package/dist/lib/figure/parts.d.ts +42 -0
- package/dist/lib/figure/parts.js +126 -0
- package/dist/lib/form-reset.d.ts +11 -0
- package/dist/lib/form-reset.js +22 -0
- package/dist/lib/glide.d.ts +53 -0
- package/dist/lib/glide.js +138 -0
- package/dist/lib/graph-layout.d.ts +58 -0
- package/dist/lib/graph-layout.js +200 -0
- package/dist/lib/illustration-drawings.d.ts +89 -0
- package/dist/lib/illustration-drawings.js +539 -0
- package/dist/lib/illustration-info.d.ts +37 -0
- package/dist/lib/illustration-info.js +22 -0
- package/dist/lib/illustration-library.d.ts +87 -0
- package/dist/lib/illustration-library.js +352 -0
- package/dist/lib/logo-geometry.d.ts +29 -0
- package/dist/lib/logo-geometry.js +67 -0
- package/dist/lib/markdown-guard.d.ts +16 -0
- package/dist/lib/markdown-guard.js +123 -0
- package/dist/lib/merge-refs.d.ts +10 -0
- package/dist/lib/merge-refs.js +26 -0
- package/dist/lib/motion.d.ts +6 -0
- package/dist/lib/motion.js +12 -0
- package/dist/lib/pdf-worker.d.ts +1 -0
- package/dist/lib/pdf-worker.js +6 -0
- package/dist/lib/pdf.d.ts +19 -0
- package/dist/lib/pdf.js +58 -0
- package/dist/lib/platform.d.ts +33 -0
- package/dist/lib/platform.js +68 -0
- package/dist/lib/room.d.ts +25 -0
- package/dist/lib/room.js +46 -0
- package/dist/lib/table-fit.d.ts +143 -0
- package/dist/lib/table-fit.js +577 -0
- package/dist/lib/theme-script.d.ts +18 -0
- package/dist/lib/theme-script.js +29 -0
- package/dist/styles/expressive.css +188 -0
- package/dist/styles/fonts.css +145 -0
- package/dist/styles/index.css +206 -0
- package/dist/styles/material.css +313 -0
- package/dist/styles/parts/ai.css +360 -0
- package/dist/styles/parts/brand.css +75 -0
- package/dist/styles/parts/controls.css +725 -0
- package/dist/styles/parts/data.css +222 -0
- package/dist/styles/parts/editorial.css +120 -0
- package/dist/styles/parts/feedback.css +273 -0
- package/dist/styles/parts/foundations.css +166 -0
- package/dist/styles/parts/graph.css +214 -0
- package/dist/styles/parts/inputs.css +261 -0
- package/dist/styles/parts/isometric.css +124 -0
- package/dist/styles/parts/navigation.css +232 -0
- package/dist/styles/parts/overlays.css +250 -0
- package/dist/styles/parts/pdf.css +154 -0
- package/dist/styles/parts/react-flow.css +519 -0
- package/dist/styles/parts/whiteboard.css +855 -0
- package/dist/styles/tokens.css +290 -0
- package/dist/vite.d.ts +116 -0
- package/dist/vite.js +129 -0
- package/package.json +188 -5
|
@@ -0,0 +1,725 @@
|
|
|
1
|
+
/* controls components — owned by the controls group. Prefer Tailwind in TSX; use this only for what classes cannot express (keyframes, complex selectors, SVG). */
|
|
2
|
+
|
|
3
|
+
/* The switch thumb's stretch and travel, registered so they can transition as values. */
|
|
4
|
+
@property --thumb-w {
|
|
5
|
+
syntax: "<length>";
|
|
6
|
+
inherits: false;
|
|
7
|
+
initial-value: 18px;
|
|
8
|
+
}
|
|
9
|
+
@property --thumb-on {
|
|
10
|
+
syntax: "<number>";
|
|
11
|
+
inherits: false;
|
|
12
|
+
initial-value: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@layer components {
|
|
16
|
+
/* ── Toggle: the pressed ("on") shadow ───────────────────────────────────────
|
|
17
|
+
* The raised-current edge (--control-focus) plus a pressed-in inset. The inset uses
|
|
18
|
+
* --control-edge, which is 18% black in light and 65% black in dark, so the sink reads
|
|
19
|
+
* in both themes. Applied in toggle.tsx with `data-pressed:shadow-(--toggle-shadow-pressed)`. */
|
|
20
|
+
[data-slot="toggle"] {
|
|
21
|
+
--toggle-shadow-pressed:
|
|
22
|
+
0 0 0 1px var(--control-focus), inset 0 2px 4px var(--control-edge),
|
|
23
|
+
inset 0 0 0 1px var(--control-inner-edge);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/* ── Toggle and toggle-group items ──────────────────────────────────────────
|
|
27
|
+
* Hover only brightens the ink — no fill, so hover never reads as "on". A press shows in the
|
|
28
|
+
* material (the pressed inset), not in movement. The inset is inlined: theme shadows exist as
|
|
29
|
+
* variables only when a utility uses them. */
|
|
30
|
+
[data-slot="toggle"],
|
|
31
|
+
[data-slot="toggle-group-item"] {
|
|
32
|
+
transition:
|
|
33
|
+
background-color var(--duration) var(--ease),
|
|
34
|
+
color var(--duration) var(--ease),
|
|
35
|
+
box-shadow var(--duration) var(--ease);
|
|
36
|
+
}
|
|
37
|
+
[data-slot="toggle"]:active:not(:disabled, [data-disabled]) {
|
|
38
|
+
--toggle-shadow-pressed:
|
|
39
|
+
0 0 0 1px var(--control-edge), inset 0 2px 4px #0000002e, inset 0 0 0 1px var(--control-inner-edge);
|
|
40
|
+
box-shadow: var(--toggle-shadow-pressed);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* ── Checkbox: the check draws in, and undraws the same way out ──────────────
|
|
44
|
+
* Ticking draws the check from its short leg up to the long one; unticking runs it backwards,
|
|
45
|
+
* faster, and the fill clears as it finishes. Base UI keeps the indicator mounted while
|
|
46
|
+
* its own transitions run, so it carries a stepped opacity of the same length. Starting and
|
|
47
|
+
* ending styles exist only on change, so nothing animates on first render. */
|
|
48
|
+
[data-slot="checkbox"],
|
|
49
|
+
[data-slot="menu-checkbox-item"],
|
|
50
|
+
[data-slot="menubar-checkbox-item"] {
|
|
51
|
+
--check-undraw: calc(var(--duration) * 0.72);
|
|
52
|
+
}
|
|
53
|
+
/* A menu's checkbox item draws its check the same way. */
|
|
54
|
+
:is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"]) {
|
|
55
|
+
transition: opacity var(--check-undraw) steps(1, end);
|
|
56
|
+
}
|
|
57
|
+
:is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"])[data-ending-style] {
|
|
58
|
+
opacity: 0;
|
|
59
|
+
}
|
|
60
|
+
:is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"]) svg {
|
|
61
|
+
stroke-dasharray: 24;
|
|
62
|
+
stroke-dashoffset: 0;
|
|
63
|
+
transition: stroke-dashoffset calc(var(--duration) * 1.6) var(--ease);
|
|
64
|
+
}
|
|
65
|
+
:is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"]):is(
|
|
66
|
+
[data-starting-style],
|
|
67
|
+
[data-ending-style]
|
|
68
|
+
)
|
|
69
|
+
svg {
|
|
70
|
+
stroke-dashoffset: -24;
|
|
71
|
+
}
|
|
72
|
+
:is([data-slot="checkbox-indicator"], [data-slot="menu-checkbox-indicator"])[data-ending-style] svg {
|
|
73
|
+
transition-duration: var(--check-undraw);
|
|
74
|
+
transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* ── Menu: a trigger's down chevron turns up while its menu is open ───────────────────── */
|
|
78
|
+
[aria-haspopup="menu"] svg.lucide-chevron-down {
|
|
79
|
+
transition: rotate var(--duration) var(--ease);
|
|
80
|
+
}
|
|
81
|
+
[aria-haspopup="menu"][aria-expanded="true"] svg.lucide-chevron-down {
|
|
82
|
+
rotate: 180deg;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ── Switch: the thumb stretches, then slides ────────────────────────────────
|
|
86
|
+
* Hover stretches the thumb from 18 to 22px, a press to 25px, toward the side it will travel.
|
|
87
|
+
* Checked, it sits against the far edge: the track's inner width (34px) minus its own width,
|
|
88
|
+
* so it stays flush while it stretches.
|
|
89
|
+
*
|
|
90
|
+
* Two registered values move, not width and position: the stretch (--thumb-w) and how far on
|
|
91
|
+
* the switch is (--thumb-on, 0 to 1), each in 2 × --duration. Width and offset are worked out
|
|
92
|
+
* from them every frame, both in layout, so the far edge cannot drift — two separate
|
|
93
|
+
* transitions fell out of step whenever one was reversed mid-way (hover out, release). */
|
|
94
|
+
[data-slot="switch-thumb"] {
|
|
95
|
+
--thumb-w: 18px;
|
|
96
|
+
--thumb-on: 0;
|
|
97
|
+
width: var(--thumb-w);
|
|
98
|
+
height: 18px;
|
|
99
|
+
margin-inline-start: calc((34px - var(--thumb-w)) * var(--thumb-on));
|
|
100
|
+
transition:
|
|
101
|
+
--thumb-w calc(var(--duration) * 2) var(--ease),
|
|
102
|
+
--thumb-on calc(var(--duration) * 2) var(--ease),
|
|
103
|
+
background-color var(--duration) var(--ease),
|
|
104
|
+
box-shadow var(--duration) var(--ease);
|
|
105
|
+
}
|
|
106
|
+
[data-slot="switch-thumb"][data-checked] {
|
|
107
|
+
--thumb-on: 1;
|
|
108
|
+
}
|
|
109
|
+
@media (hover: hover) {
|
|
110
|
+
[data-slot="switch"]:not([data-disabled], [data-readonly]):hover > [data-slot="switch-thumb"] {
|
|
111
|
+
--thumb-w: 22px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
[data-slot="switch"]:not([data-disabled], [data-readonly]):active > [data-slot="switch-thumb"] {
|
|
115
|
+
--thumb-w: 25px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/* ── Button group: how neighbours meet ───────────────────────────────────────
|
|
119
|
+
* Fields (real borders) overlap by a pixel so their borders merge into one line. Buttons draw
|
|
120
|
+
* their edge as an outer ring plus inner highlights, which doubled up at the join — a heavy bar
|
|
121
|
+
* on a split primary, and the right half seeming to sit on the left. So a joined button trims
|
|
122
|
+
* 1px of its inner side (ring and highlight with it), the two meet exactly, and the later one
|
|
123
|
+
* draws a single 1px seam: the edge colour on raised buttons, a soft line on the primary. A
|
|
124
|
+
* focused or open control drops the trim so its outline and ring show whole. */
|
|
125
|
+
[data-slot="button-group"][data-orientation="horizontal"]
|
|
126
|
+
> :not(
|
|
127
|
+
:nth-child(
|
|
128
|
+
1
|
|
129
|
+
of
|
|
130
|
+
:not(
|
|
131
|
+
[data-base-ui-focus-guard],
|
|
132
|
+
span[aria-owns],
|
|
133
|
+
[data-slot="button-group-separator"],
|
|
134
|
+
[data-slot="copy-button-status"]
|
|
135
|
+
)
|
|
136
|
+
)
|
|
137
|
+
) {
|
|
138
|
+
margin-left: -1px;
|
|
139
|
+
}
|
|
140
|
+
[data-slot="button-group"][data-orientation="vertical"]
|
|
141
|
+
> :not(
|
|
142
|
+
:nth-child(
|
|
143
|
+
1
|
|
144
|
+
of
|
|
145
|
+
:not(
|
|
146
|
+
[data-base-ui-focus-guard],
|
|
147
|
+
span[aria-owns],
|
|
148
|
+
[data-slot="button-group-separator"],
|
|
149
|
+
[data-slot="copy-button-status"]
|
|
150
|
+
)
|
|
151
|
+
)
|
|
152
|
+
) {
|
|
153
|
+
margin-top: -1px;
|
|
154
|
+
}
|
|
155
|
+
[data-slot="button-group"][data-orientation="horizontal"]
|
|
156
|
+
> [data-variant]:not(
|
|
157
|
+
:nth-child(
|
|
158
|
+
1
|
|
159
|
+
of
|
|
160
|
+
:not(
|
|
161
|
+
[data-base-ui-focus-guard],
|
|
162
|
+
span[aria-owns],
|
|
163
|
+
[data-slot="button-group-separator"],
|
|
164
|
+
[data-slot="copy-button-status"]
|
|
165
|
+
)
|
|
166
|
+
)
|
|
167
|
+
) {
|
|
168
|
+
margin-left: -2px;
|
|
169
|
+
}
|
|
170
|
+
[data-slot="button-group"][data-orientation="vertical"]
|
|
171
|
+
> [data-variant]:not(
|
|
172
|
+
:nth-child(
|
|
173
|
+
1
|
|
174
|
+
of
|
|
175
|
+
:not(
|
|
176
|
+
[data-base-ui-focus-guard],
|
|
177
|
+
span[aria-owns],
|
|
178
|
+
[data-slot="button-group-separator"],
|
|
179
|
+
[data-slot="copy-button-status"]
|
|
180
|
+
)
|
|
181
|
+
)
|
|
182
|
+
) {
|
|
183
|
+
margin-top: -2px;
|
|
184
|
+
}
|
|
185
|
+
[data-slot="button-group"][data-orientation="horizontal"]
|
|
186
|
+
> [data-variant]:nth-child(
|
|
187
|
+
1
|
|
188
|
+
of
|
|
189
|
+
:not(
|
|
190
|
+
[data-base-ui-focus-guard],
|
|
191
|
+
span[aria-owns],
|
|
192
|
+
[data-slot="button-group-separator"],
|
|
193
|
+
[data-slot="copy-button-status"]
|
|
194
|
+
)
|
|
195
|
+
):not(
|
|
196
|
+
:nth-last-child(
|
|
197
|
+
1
|
|
198
|
+
of
|
|
199
|
+
:not(
|
|
200
|
+
[data-base-ui-focus-guard],
|
|
201
|
+
span[aria-owns],
|
|
202
|
+
[data-slot="button-group-separator"],
|
|
203
|
+
[data-slot="copy-button-status"]
|
|
204
|
+
)
|
|
205
|
+
)
|
|
206
|
+
) {
|
|
207
|
+
clip-path: inset(-16px 1px -16px -16px);
|
|
208
|
+
}
|
|
209
|
+
[data-slot="button-group"][data-orientation="horizontal"]
|
|
210
|
+
> [data-variant]:nth-last-child(
|
|
211
|
+
1
|
|
212
|
+
of
|
|
213
|
+
:not(
|
|
214
|
+
[data-base-ui-focus-guard],
|
|
215
|
+
span[aria-owns],
|
|
216
|
+
[data-slot="button-group-separator"],
|
|
217
|
+
[data-slot="copy-button-status"]
|
|
218
|
+
)
|
|
219
|
+
):not(
|
|
220
|
+
:nth-child(
|
|
221
|
+
1
|
|
222
|
+
of
|
|
223
|
+
:not(
|
|
224
|
+
[data-base-ui-focus-guard],
|
|
225
|
+
span[aria-owns],
|
|
226
|
+
[data-slot="button-group-separator"],
|
|
227
|
+
[data-slot="copy-button-status"]
|
|
228
|
+
)
|
|
229
|
+
)
|
|
230
|
+
) {
|
|
231
|
+
clip-path: inset(-16px -16px -16px 1px);
|
|
232
|
+
}
|
|
233
|
+
[data-slot="button-group"][data-orientation="horizontal"]
|
|
234
|
+
> [data-variant]:not(
|
|
235
|
+
:nth-child(
|
|
236
|
+
1
|
|
237
|
+
of
|
|
238
|
+
:not(
|
|
239
|
+
[data-base-ui-focus-guard],
|
|
240
|
+
span[aria-owns],
|
|
241
|
+
[data-slot="button-group-separator"],
|
|
242
|
+
[data-slot="copy-button-status"]
|
|
243
|
+
)
|
|
244
|
+
)
|
|
245
|
+
):not(
|
|
246
|
+
:nth-last-child(
|
|
247
|
+
1
|
|
248
|
+
of
|
|
249
|
+
:not(
|
|
250
|
+
[data-base-ui-focus-guard],
|
|
251
|
+
span[aria-owns],
|
|
252
|
+
[data-slot="button-group-separator"],
|
|
253
|
+
[data-slot="copy-button-status"]
|
|
254
|
+
)
|
|
255
|
+
)
|
|
256
|
+
) {
|
|
257
|
+
clip-path: inset(-16px 1px);
|
|
258
|
+
}
|
|
259
|
+
[data-slot="button-group"][data-orientation="vertical"]
|
|
260
|
+
> [data-variant]:nth-child(
|
|
261
|
+
1
|
|
262
|
+
of
|
|
263
|
+
:not(
|
|
264
|
+
[data-base-ui-focus-guard],
|
|
265
|
+
span[aria-owns],
|
|
266
|
+
[data-slot="button-group-separator"],
|
|
267
|
+
[data-slot="copy-button-status"]
|
|
268
|
+
)
|
|
269
|
+
):not(
|
|
270
|
+
:nth-last-child(
|
|
271
|
+
1
|
|
272
|
+
of
|
|
273
|
+
:not(
|
|
274
|
+
[data-base-ui-focus-guard],
|
|
275
|
+
span[aria-owns],
|
|
276
|
+
[data-slot="button-group-separator"],
|
|
277
|
+
[data-slot="copy-button-status"]
|
|
278
|
+
)
|
|
279
|
+
)
|
|
280
|
+
) {
|
|
281
|
+
clip-path: inset(-16px -16px 1px -16px);
|
|
282
|
+
}
|
|
283
|
+
[data-slot="button-group"][data-orientation="vertical"]
|
|
284
|
+
> [data-variant]:nth-last-child(
|
|
285
|
+
1
|
|
286
|
+
of
|
|
287
|
+
:not(
|
|
288
|
+
[data-base-ui-focus-guard],
|
|
289
|
+
span[aria-owns],
|
|
290
|
+
[data-slot="button-group-separator"],
|
|
291
|
+
[data-slot="copy-button-status"]
|
|
292
|
+
)
|
|
293
|
+
):not(
|
|
294
|
+
:nth-child(
|
|
295
|
+
1
|
|
296
|
+
of
|
|
297
|
+
:not(
|
|
298
|
+
[data-base-ui-focus-guard],
|
|
299
|
+
span[aria-owns],
|
|
300
|
+
[data-slot="button-group-separator"],
|
|
301
|
+
[data-slot="copy-button-status"]
|
|
302
|
+
)
|
|
303
|
+
)
|
|
304
|
+
) {
|
|
305
|
+
clip-path: inset(1px -16px -16px -16px);
|
|
306
|
+
}
|
|
307
|
+
[data-slot="button-group"][data-orientation="vertical"]
|
|
308
|
+
> [data-variant]:not(
|
|
309
|
+
:nth-child(
|
|
310
|
+
1
|
|
311
|
+
of
|
|
312
|
+
:not(
|
|
313
|
+
[data-base-ui-focus-guard],
|
|
314
|
+
span[aria-owns],
|
|
315
|
+
[data-slot="button-group-separator"],
|
|
316
|
+
[data-slot="copy-button-status"]
|
|
317
|
+
)
|
|
318
|
+
)
|
|
319
|
+
):not(
|
|
320
|
+
:nth-last-child(
|
|
321
|
+
1
|
|
322
|
+
of
|
|
323
|
+
:not(
|
|
324
|
+
[data-base-ui-focus-guard],
|
|
325
|
+
span[aria-owns],
|
|
326
|
+
[data-slot="button-group-separator"],
|
|
327
|
+
[data-slot="copy-button-status"]
|
|
328
|
+
)
|
|
329
|
+
)
|
|
330
|
+
) {
|
|
331
|
+
clip-path: inset(1px -16px);
|
|
332
|
+
}
|
|
333
|
+
[data-slot="button-group"] > [data-variant]:is(:focus-visible, :has(:focus-visible), [data-popup-open]) {
|
|
334
|
+
clip-path: none;
|
|
335
|
+
}
|
|
336
|
+
[data-slot="button-group"]
|
|
337
|
+
> [data-variant]:not(
|
|
338
|
+
:nth-child(
|
|
339
|
+
1
|
|
340
|
+
of
|
|
341
|
+
:not(
|
|
342
|
+
[data-base-ui-focus-guard],
|
|
343
|
+
span[aria-owns],
|
|
344
|
+
[data-slot="button-group-separator"],
|
|
345
|
+
[data-slot="copy-button-status"]
|
|
346
|
+
)
|
|
347
|
+
)
|
|
348
|
+
)::after {
|
|
349
|
+
content: "";
|
|
350
|
+
position: absolute;
|
|
351
|
+
pointer-events: none;
|
|
352
|
+
background: var(--control-edge);
|
|
353
|
+
}
|
|
354
|
+
[data-slot="button-group"]
|
|
355
|
+
> [data-variant="primary"]:not(
|
|
356
|
+
:nth-child(
|
|
357
|
+
1
|
|
358
|
+
of
|
|
359
|
+
:not(
|
|
360
|
+
[data-base-ui-focus-guard],
|
|
361
|
+
span[aria-owns],
|
|
362
|
+
[data-slot="button-group-separator"],
|
|
363
|
+
[data-slot="copy-button-status"]
|
|
364
|
+
)
|
|
365
|
+
)
|
|
366
|
+
)::after {
|
|
367
|
+
background: color-mix(in oklab, var(--primary-text) 22%, transparent);
|
|
368
|
+
}
|
|
369
|
+
[data-slot="button-group"][data-orientation="horizontal"]
|
|
370
|
+
> [data-variant]:not(
|
|
371
|
+
:nth-child(
|
|
372
|
+
1
|
|
373
|
+
of
|
|
374
|
+
:not(
|
|
375
|
+
[data-base-ui-focus-guard],
|
|
376
|
+
span[aria-owns],
|
|
377
|
+
[data-slot="button-group-separator"],
|
|
378
|
+
[data-slot="copy-button-status"]
|
|
379
|
+
)
|
|
380
|
+
)
|
|
381
|
+
)::after {
|
|
382
|
+
top: -1px;
|
|
383
|
+
bottom: -1px;
|
|
384
|
+
left: 0;
|
|
385
|
+
width: 1px;
|
|
386
|
+
}
|
|
387
|
+
[data-slot="button-group"][data-orientation="vertical"]
|
|
388
|
+
> [data-variant]:not(
|
|
389
|
+
:nth-child(
|
|
390
|
+
1
|
|
391
|
+
of
|
|
392
|
+
:not(
|
|
393
|
+
[data-base-ui-focus-guard],
|
|
394
|
+
span[aria-owns],
|
|
395
|
+
[data-slot="button-group-separator"],
|
|
396
|
+
[data-slot="copy-button-status"]
|
|
397
|
+
)
|
|
398
|
+
)
|
|
399
|
+
)::after {
|
|
400
|
+
left: -1px;
|
|
401
|
+
right: -1px;
|
|
402
|
+
top: 0;
|
|
403
|
+
height: 1px;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/* ── Toggle group, reveal: one part of a segment stays hidden until it is pressed ──────────
|
|
407
|
+
* A segment's icon and label each sit in a one-column grid; the hidden one is a 0fr column
|
|
408
|
+
* with its content clipped, and widens to 1fr when the segment is pressed. The width moves on
|
|
409
|
+
* 2 × --duration like the raised surface that follows it; the fade on --duration. */
|
|
410
|
+
[data-slot="toggle-group-item"] > [data-slot="toggle-group-icon"],
|
|
411
|
+
[data-slot="toggle-group-item"] > [data-slot="toggle-group-label"] {
|
|
412
|
+
display: grid;
|
|
413
|
+
grid-template-columns: 1fr;
|
|
414
|
+
align-items: center;
|
|
415
|
+
transition:
|
|
416
|
+
grid-template-columns calc(var(--duration) * 2) var(--ease),
|
|
417
|
+
opacity var(--duration) var(--ease);
|
|
418
|
+
}
|
|
419
|
+
[data-slot="toggle-group-icon"] > span,
|
|
420
|
+
[data-slot="toggle-group-label"] > span {
|
|
421
|
+
display: flex;
|
|
422
|
+
align-items: center;
|
|
423
|
+
min-width: 0;
|
|
424
|
+
overflow: hidden;
|
|
425
|
+
}
|
|
426
|
+
/* The icon–label gap travels inside the part that slides (a pseudo-element, which a 0fr
|
|
427
|
+
track does not count the way it counts padding), so nothing is left of it while hidden. */
|
|
428
|
+
[data-slot="toggle-group"][data-reveal="label"] [data-slot="toggle-group-label"] > span::before,
|
|
429
|
+
[data-slot="toggle-group"][data-reveal="icon"] [data-slot="toggle-group-icon"] > span::after {
|
|
430
|
+
content: "";
|
|
431
|
+
flex: none;
|
|
432
|
+
width: --spacing(1.5);
|
|
433
|
+
}
|
|
434
|
+
[data-slot="toggle-group"][data-reveal="label"]
|
|
435
|
+
> [data-slot="toggle-group-item"]:not([data-pressed])
|
|
436
|
+
> [data-slot="toggle-group-label"],
|
|
437
|
+
[data-slot="toggle-group"][data-reveal="icon"]
|
|
438
|
+
> [data-slot="toggle-group-item"]:not([data-pressed])
|
|
439
|
+
> [data-slot="toggle-group-icon"] {
|
|
440
|
+
grid-template-columns: 0fr;
|
|
441
|
+
opacity: 0;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/* ── Button, collapsible: the label folds away to leave the icon ─────────────────────────
|
|
445
|
+
* Like a revealing toggle-group segment: the label is a one-column grid that narrows to 0fr
|
|
446
|
+
* with its text clipped, on 2 × --duration, and fades on --duration. The icon–label gap
|
|
447
|
+
* travels inside it (a pseudo-element on the icon's side), so nothing of it is left. The
|
|
448
|
+
* first decision, before the first paint, is drawn without motion (data-collapse-instant; the
|
|
449
|
+
* button's own transitions are switched off by a utility in Button, above the material). */
|
|
450
|
+
[data-slot="button"] > [data-slot="button-label"] {
|
|
451
|
+
display: grid;
|
|
452
|
+
grid-template-columns: 1fr;
|
|
453
|
+
align-items: center;
|
|
454
|
+
transition:
|
|
455
|
+
grid-template-columns calc(var(--duration) * 2) var(--ease),
|
|
456
|
+
opacity var(--duration) var(--ease);
|
|
457
|
+
}
|
|
458
|
+
[data-slot="button-label"] > span {
|
|
459
|
+
display: flex;
|
|
460
|
+
align-items: center;
|
|
461
|
+
min-width: 0;
|
|
462
|
+
overflow: hidden;
|
|
463
|
+
}
|
|
464
|
+
[data-slot="button-label"][data-after-icon] > span::before,
|
|
465
|
+
[data-slot="button-label"]:not([data-after-icon]) > span::after {
|
|
466
|
+
content: "";
|
|
467
|
+
flex: none;
|
|
468
|
+
width: var(--button-gap);
|
|
469
|
+
}
|
|
470
|
+
[data-slot="button"][data-collapsed] > [data-slot="button-label"] {
|
|
471
|
+
grid-template-columns: 0fr;
|
|
472
|
+
opacity: 0;
|
|
473
|
+
}
|
|
474
|
+
/* An expandable button is the fold in reverse: folded at rest, open on hover or keyboard
|
|
475
|
+
focus. Touch screens have no hover, so there it stays an icon. */
|
|
476
|
+
@media (hover: hover) {
|
|
477
|
+
[data-slot="button"][data-expandable="label"]:hover > [data-slot="button-label"] {
|
|
478
|
+
grid-template-columns: 1fr;
|
|
479
|
+
opacity: 1;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
[data-slot="button"][data-expandable="label"]:focus-visible > [data-slot="button-label"] {
|
|
483
|
+
grid-template-columns: 1fr;
|
|
484
|
+
opacity: 1;
|
|
485
|
+
}
|
|
486
|
+
/* Hover intent: an expandable button opens once the pointer rests on it (70ms), so passing over
|
|
487
|
+
it on the way somewhere does nothing, and stays open a moment after it leaves (140ms), so
|
|
488
|
+
the button the pointer is heading for does not move away under it. Keyboard focus and
|
|
489
|
+
reduced motion are immediate. */
|
|
490
|
+
[data-slot="button"][data-expandable] {
|
|
491
|
+
--expand-delay: 140ms;
|
|
492
|
+
}
|
|
493
|
+
@media (hover: hover) {
|
|
494
|
+
[data-slot="button"][data-expandable]:hover {
|
|
495
|
+
--expand-delay: 70ms;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
[data-slot="button"][data-expandable]:focus-visible {
|
|
499
|
+
--expand-delay: 0s;
|
|
500
|
+
}
|
|
501
|
+
@media (prefers-reduced-motion: reduce) {
|
|
502
|
+
[data-slot="button"][data-expandable] {
|
|
503
|
+
--expand-delay: 0s !important;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
[data-slot="button"][data-expandable] > :is([data-slot="button-label"], [data-slot="button-icon"]) {
|
|
507
|
+
transition-delay: var(--expand-delay);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/* expandable="icon" is the other way round: the text stays, and the icon slides in beside it
|
|
511
|
+
on hover or keyboard focus, out of a 0fr column like a revealing toggle-group segment. The
|
|
512
|
+
gap travels inside the icon's column, on the side that faces the text. */
|
|
513
|
+
[data-slot="button"] > [data-slot="button-icon"] {
|
|
514
|
+
display: grid;
|
|
515
|
+
grid-template-columns: 1fr;
|
|
516
|
+
align-items: center;
|
|
517
|
+
transition:
|
|
518
|
+
grid-template-columns calc(var(--duration) * 2) var(--ease),
|
|
519
|
+
opacity var(--duration) var(--ease);
|
|
520
|
+
}
|
|
521
|
+
[data-slot="button-icon"] > span {
|
|
522
|
+
display: flex;
|
|
523
|
+
align-items: center;
|
|
524
|
+
min-width: 0;
|
|
525
|
+
overflow: hidden;
|
|
526
|
+
}
|
|
527
|
+
[data-slot="button-icon"][data-before-label] > span::after,
|
|
528
|
+
[data-slot="button-icon"]:not([data-before-label]) > span::before {
|
|
529
|
+
content: "";
|
|
530
|
+
flex: none;
|
|
531
|
+
width: var(--button-gap);
|
|
532
|
+
}
|
|
533
|
+
[data-slot="button"][data-expandable="icon"] > [data-slot="button-icon"] {
|
|
534
|
+
grid-template-columns: 0fr;
|
|
535
|
+
opacity: 0;
|
|
536
|
+
}
|
|
537
|
+
@media (hover: hover) {
|
|
538
|
+
[data-slot="button"][data-expandable="icon"]:hover > [data-slot="button-icon"] {
|
|
539
|
+
grid-template-columns: 1fr;
|
|
540
|
+
opacity: 1;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
[data-slot="button"][data-expandable="icon"]:focus-visible > [data-slot="button-icon"] {
|
|
544
|
+
grid-template-columns: 1fr;
|
|
545
|
+
opacity: 1;
|
|
546
|
+
}
|
|
547
|
+
[data-slot="button"][data-collapse-instant] > [data-slot="button-label"] {
|
|
548
|
+
transition: none;
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
/* ── Input group: nested radius ──────────────────────────────────────────────
|
|
552
|
+
* A button inside the field is concentric with it: outer radius − inset = inner radius,
|
|
553
|
+
* where the inset is the space between the field's border and the button.
|
|
554
|
+
* default: 10 − ((38 − 30) / 2 − 1) = 7px
|
|
555
|
+
* dense: 10 − ((30 − 24) / 2 − 1) = 8px
|
|
556
|
+
* Applied in input-group.tsx with `rounded-(--input-group-button-radius)`. */
|
|
557
|
+
[data-slot="input-group-button"] {
|
|
558
|
+
--input-group-button-radius: calc(
|
|
559
|
+
var(--radius-control) - ((var(--control-h) - var(--control-inset)) / 2 - 1px)
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
[data-slot="input-group"][data-size="sm"] [data-slot="input-group-button"] {
|
|
563
|
+
--input-group-button-radius: calc(
|
|
564
|
+
var(--radius-control) - ((var(--control-h-sm) - var(--control-inset-sm)) / 2 - 1px)
|
|
565
|
+
);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/* ── Badge: pinned to the corner of what it marks ────────────────────────────
|
|
569
|
+
* The badge is centred on the anchor point. For a circle that is its 45° point,
|
|
570
|
+
* (1 − 1/√2) / 2 ≈ 14.6% in from the bounding box; for a rect, just inside the corner.
|
|
571
|
+
* The outline is a cut-out in the page colour that separates the badge from the object. */
|
|
572
|
+
[data-slot="badge-anchor"] {
|
|
573
|
+
--badge-inset: 14.6%;
|
|
574
|
+
}
|
|
575
|
+
[data-slot="badge-anchor"][data-shape="rect"] {
|
|
576
|
+
--badge-inset: 2px;
|
|
577
|
+
}
|
|
578
|
+
[data-slot="badge-anchor"] > [data-slot="badge"] {
|
|
579
|
+
position: absolute;
|
|
580
|
+
z-index: 1;
|
|
581
|
+
top: var(--badge-inset);
|
|
582
|
+
inset-inline-end: var(--badge-inset);
|
|
583
|
+
translate: 50% -50%;
|
|
584
|
+
outline: 2px solid var(--badge-cutout, var(--background));
|
|
585
|
+
outline-offset: 0;
|
|
586
|
+
pointer-events: none;
|
|
587
|
+
}
|
|
588
|
+
[data-slot="badge-anchor"][data-placement="bottom-end"] > [data-slot="badge"] {
|
|
589
|
+
top: auto;
|
|
590
|
+
bottom: var(--badge-inset);
|
|
591
|
+
translate: 50% 50%;
|
|
592
|
+
}
|
|
593
|
+
[data-slot="badge-anchor"]:dir(rtl) > [data-slot="badge"] {
|
|
594
|
+
translate: -50% -50%;
|
|
595
|
+
}
|
|
596
|
+
[data-slot="badge-anchor"][data-placement="bottom-end"]:dir(rtl) > [data-slot="badge"] {
|
|
597
|
+
translate: -50% 50%;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
/* ── Checkbox: the fill clears right behind the undraw ───────────────────────
|
|
602
|
+
* Ticking fills at once and draws the check; unticking is the same in reverse and quicker: the
|
|
603
|
+
* check undraws in ~110ms and the fill clears as it finishes. Unlayered: the field material sets
|
|
604
|
+
* its own `transition`, which a layered rule cannot change. */
|
|
605
|
+
[data-slot="checkbox"] {
|
|
606
|
+
transition:
|
|
607
|
+
border-color var(--duration) var(--ease),
|
|
608
|
+
box-shadow var(--duration) var(--ease),
|
|
609
|
+
background-color var(--duration) var(--ease);
|
|
610
|
+
}
|
|
611
|
+
[data-slot="checkbox"]:not([data-checked], [data-indeterminate]) {
|
|
612
|
+
transition-duration: calc(var(--duration) * 0.72);
|
|
613
|
+
transition-delay: calc(var(--check-undraw) * 0.6);
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
/* ── Button group with a field: one outline for the pair ─────────────────────────────────────
|
|
617
|
+
* A raised button draws its edge 1px outside its box; a field draws it inside its border, plus
|
|
618
|
+
* a 1px highlight under it. Next to a field a secondary button takes the field's geometry and
|
|
619
|
+
* colours: its edge moves inside and becomes --field-edge, it gets the same highlight below,
|
|
620
|
+
* and the seam between them is --field-edge too. In light mode the two edge colours were close;
|
|
621
|
+
* in dark mode the button's near-black edge vanished into the page and the field's light one
|
|
622
|
+
* did not, so the button looked 2px smaller while measuring the same. (A primary button keeps
|
|
623
|
+
* its own shadow.) Unlayered: it must beat the raised material, which is a utility. */
|
|
624
|
+
[data-slot="button-group"]:has(
|
|
625
|
+
[data-slot="input"],
|
|
626
|
+
[data-slot="input-group"],
|
|
627
|
+
[data-slot="select-trigger"],
|
|
628
|
+
[data-slot="native-select"]
|
|
629
|
+
)
|
|
630
|
+
> [data-variant="secondary"] {
|
|
631
|
+
border-color: var(--field-edge);
|
|
632
|
+
box-shadow:
|
|
633
|
+
inset 0 1px 0 var(--control-highlight),
|
|
634
|
+
inset 0 0 0 1px var(--control-inner-edge),
|
|
635
|
+
0 1px 0 var(--control-highlight);
|
|
636
|
+
}
|
|
637
|
+
[data-slot="button-group"]:has(
|
|
638
|
+
[data-slot="input"],
|
|
639
|
+
[data-slot="input-group"],
|
|
640
|
+
[data-slot="select-trigger"],
|
|
641
|
+
[data-slot="native-select"]
|
|
642
|
+
)
|
|
643
|
+
> [data-variant="secondary"]:active:not(:disabled, [data-disabled]) {
|
|
644
|
+
box-shadow:
|
|
645
|
+
inset 0 2px 4px #0000002e,
|
|
646
|
+
inset 0 0 0 1px var(--control-inner-edge),
|
|
647
|
+
0 1px 0 var(--control-highlight);
|
|
648
|
+
}
|
|
649
|
+
[data-slot="button-group"]:has(
|
|
650
|
+
[data-slot="input"],
|
|
651
|
+
[data-slot="input-group"],
|
|
652
|
+
[data-slot="select-trigger"],
|
|
653
|
+
[data-slot="native-select"]
|
|
654
|
+
)
|
|
655
|
+
> [data-variant="secondary"]::after {
|
|
656
|
+
background: var(--field-edge);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/*
|
|
660
|
+
* A folded collapsible Button is a circle as tall as the button: padding of (height − 16px icon −
|
|
661
|
+
* 2px border) / 2 and corners of half the height. Unlayered on purpose: it has to win over the
|
|
662
|
+
* Button size utilities (px-3, rounded-button), and both move on --material-motion.
|
|
663
|
+
*/
|
|
664
|
+
[data-slot="button"][data-collapsed] {
|
|
665
|
+
--collapsed-h: var(--control-h);
|
|
666
|
+
padding-inline: calc((var(--collapsed-h) - 1rem - 2px) / 2);
|
|
667
|
+
border-radius: calc(var(--collapsed-h) / 2);
|
|
668
|
+
}
|
|
669
|
+
[data-slot="button"][data-collapsed][data-size="sm"] {
|
|
670
|
+
--collapsed-h: var(--control-h-sm);
|
|
671
|
+
}
|
|
672
|
+
[data-slot="button"][data-collapsed][data-size="lg"] {
|
|
673
|
+
--collapsed-h: var(--control-h-lg);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/* An expandable Button opens to its size's padding and corners on hover or keyboard focus. */
|
|
677
|
+
@media (hover: hover) {
|
|
678
|
+
[data-slot="button"][data-expandable="label"][data-collapsed]:hover {
|
|
679
|
+
padding-inline: var(--expanded-pad, 1rem);
|
|
680
|
+
border-radius: var(--radius-button);
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
[data-slot="button"][data-expandable="label"][data-collapsed]:focus-visible {
|
|
684
|
+
padding-inline: var(--expanded-pad, 1rem);
|
|
685
|
+
border-radius: var(--radius-button);
|
|
686
|
+
}
|
|
687
|
+
[data-slot="button"][data-expandable="label"][data-size="sm"] {
|
|
688
|
+
--expanded-pad: 0.75rem;
|
|
689
|
+
}
|
|
690
|
+
[data-slot="button"][data-expandable="label"][data-size="lg"] {
|
|
691
|
+
--expanded-pad: 1.25rem;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/* ── Forced colours: on-states drawn with fills ──────────────────────────────
|
|
695
|
+
* A contrast theme (Windows) replaces fills with the page colour and drops shadows, which is how
|
|
696
|
+
* the material draws a chosen radio, an "on" switch, a slider's value, a pressed toggle and a
|
|
697
|
+
* status dot. Those marks take system colours instead; the focusable controls themselves keep
|
|
698
|
+
* the forced colours (and so their focus ring) and show "pressed" with a heavier edge. */
|
|
699
|
+
@media (forced-colors: active) {
|
|
700
|
+
[data-slot="radio-indicator"],
|
|
701
|
+
[data-slot="switch-thumb"],
|
|
702
|
+
[data-slot="slider-indicator"],
|
|
703
|
+
[data-slot="toggle-group-indicator"],
|
|
704
|
+
[data-slot="badge"][data-dot] {
|
|
705
|
+
forced-color-adjust: none;
|
|
706
|
+
}
|
|
707
|
+
[data-slot="radio-indicator"]::before,
|
|
708
|
+
[data-slot="switch-thumb"],
|
|
709
|
+
[data-slot="badge"][data-dot] {
|
|
710
|
+
background: CanvasText;
|
|
711
|
+
}
|
|
712
|
+
[data-slot="switch-thumb"][data-checked],
|
|
713
|
+
[data-slot="slider-indicator"] {
|
|
714
|
+
background: Highlight;
|
|
715
|
+
}
|
|
716
|
+
[data-slot="slider-thumb"] {
|
|
717
|
+
border: 2px solid;
|
|
718
|
+
}
|
|
719
|
+
[data-slot="toggle-group-indicator"] {
|
|
720
|
+
border: 2px solid Highlight;
|
|
721
|
+
}
|
|
722
|
+
:is([data-slot="toggle"], [data-slot="toggle-group-item"])[data-pressed] {
|
|
723
|
+
border-width: 2px;
|
|
724
|
+
}
|
|
725
|
+
}
|