@teamofsilicons/silicon-ui 0.2.0 → 0.4.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/README.md +4 -3
- package/check.mjs +14 -5
- package/components/activity-heatmap/activity-heatmap.module.css +4 -4
- package/components/alert/alert.module.css +1 -1
- package/components/animated-counter/animated-counter.js +1 -1
- package/components/announcement-bar/announcement-bar.module.css +6 -6
- package/components/avatar/avatar.d.ts +2 -2
- package/components/avatar/avatar.js +1 -1
- package/components/avatar/avatar.module.css +5 -2
- package/components/avatar-group/avatar-group.module.css +4 -4
- package/components/badge/badge.module.css +4 -4
- package/components/bar-chart/bar-chart.js +1 -1
- package/components/bar-chart/bar-chart.module.css +4 -4
- package/components/billing-toggle/billing-toggle.js +2 -2
- package/components/billing-toggle/billing-toggle.module.css +10 -10
- package/components/bottom-sheet/bottom-sheet.js +1 -1
- package/components/bottom-sheet/bottom-sheet.module.css +4 -5
- package/components/breadcrumb/breadcrumb.d.ts +8 -2
- package/components/breadcrumb/breadcrumb.js +21 -9
- package/components/breadcrumb/breadcrumb.module.css +7 -3
- package/components/brush-chart/brush-chart.module.css +9 -9
- package/components/button/button.d.ts +7 -2
- package/components/button/button.js +3 -1
- package/components/button/button.module.css +10 -1
- package/components/button-group/button-group.module.css +7 -7
- package/components/calendar/calendar.js +15 -5
- package/components/calendar/calendar.module.css +13 -10
- package/components/card/card.js +4 -4
- package/components/card/card.module.css +2 -2
- package/components/card-stack/card-stack.js +2 -2
- package/components/card-stack/card-stack.module.css +2 -3
- package/components/carousel/carousel.module.css +3 -3
- package/components/chat-thread/chat-thread.module.css +41 -41
- package/components/checkbox/checkbox.module.css +1 -1
- package/components/chip-group/chip-group.js +1 -1
- package/components/chip-group/chip-group.module.css +2 -2
- package/components/code-block/code-block.module.css +7 -14
- package/components/color-picker/color-picker.module.css +20 -21
- package/components/combobox/combobox.js +5 -1
- package/components/combobox/combobox.module.css +2 -2
- package/components/command-palette/command-palette.js +18 -11
- package/components/command-palette/command-palette.module.css +18 -18
- package/components/comment-thread/comment-thread.module.css +35 -35
- package/components/confirm-morph/confirm-morph.js +5 -5
- package/components/confirm-morph/confirm-morph.module.css +9 -9
- package/components/context-menu/context-menu.js +10 -28
- package/components/context-menu/context-menu.module.css +3 -3
- package/components/copy-button/copy-button.js +4 -4
- package/components/countdown/countdown.module.css +4 -4
- package/components/date-picker/date-picker.js +3 -3
- package/components/date-picker/date-picker.module.css +7 -7
- package/components/date-range-picker/date-range-picker.js +13 -10
- package/components/date-range-picker/date-range-picker.module.css +23 -22
- package/components/dialog/dialog.module.css +2 -2
- package/components/donut-chart/donut-chart.module.css +5 -5
- package/components/drawer/drawer.module.css +7 -7
- package/components/dropdown-menu/dropdown-menu.d.ts +71 -1
- package/components/dropdown-menu/dropdown-menu.js +100 -6
- package/components/dropdown-menu/dropdown-menu.module.css +15 -5
- package/components/elastic-slider/elastic-slider.js +2 -2
- package/components/elastic-slider/elastic-slider.module.css +4 -4
- package/components/expandable-card/expandable-card.js +1 -1
- package/components/expandable-card/expandable-card.module.css +1 -1
- package/components/expanding-button-group/expanding-button-group.module.css +3 -3
- package/components/expanding-search/expanding-search.js +3 -3
- package/components/expanding-search/expanding-search.module.css +9 -9
- package/components/file-dropzone/file-dropzone.js +3 -3
- package/components/file-dropzone/file-dropzone.module.css +21 -21
- package/components/file-upload/file-upload.module.css +7 -7
- package/components/filter-toolbar/filter-toolbar.js +7 -3
- package/components/filter-toolbar/filter-toolbar.module.css +9 -9
- package/components/floating-button-group/floating-button-group.module.css +7 -7
- package/components/gauge/gauge.js +1 -1
- package/components/gauge/gauge.module.css +2 -2
- package/components/hover-card/hover-card.js +2 -2
- package/components/hover-card/hover-card.module.css +2 -2
- package/components/image-compare/image-compare.module.css +4 -4
- package/components/inline-edit/inline-edit.module.css +12 -12
- package/components/json-viewer/json-viewer.module.css +12 -12
- package/components/line-chart/line-chart.js +1 -1
- package/components/line-chart/line-chart.module.css +8 -8
- package/components/mention-input/mention-input.js +4 -2
- package/components/mention-input/mention-input.module.css +8 -8
- package/components/metric-card/metric-card.module.css +1 -1
- package/components/money-input/money-input.js +6 -3
- package/components/money-input/money-input.module.css +10 -10
- package/components/morph-select/morph-select.js +7 -5
- package/components/morph-select/morph-select.module.css +13 -13
- package/components/multi-select/multi-select.js +4 -2
- package/components/multi-select/multi-select.module.css +6 -6
- package/components/nav-list/nav-list.d.ts +64 -0
- package/components/nav-list/nav-list.js +96 -0
- package/components/nav-list/nav-list.module.css +25 -0
- package/components/notification-center/notification-center.module.css +27 -27
- package/components/number-field/number-field.js +3 -3
- package/components/number-field/number-field.module.css +3 -3
- package/components/otp-input/otp-input.module.css +4 -4
- package/components/pagination/pagination.module.css +1 -1
- package/components/password-field/password-field.module.css +2 -2
- package/components/password-strength/password-strength.module.css +8 -8
- package/components/phone-input/phone-input.js +9 -7
- package/components/phone-input/phone-input.module.css +19 -19
- package/components/popover/popover.module.css +2 -2
- package/components/progress/progress.module.css +1 -1
- package/components/radio-cards/radio-cards.module.css +8 -8
- package/components/radio-group/radio-group.js +4 -1
- package/components/radio-group/radio-group.module.css +4 -3
- package/components/resizable-panels/resizable-panels.module.css +5 -5
- package/components/rich-text-editor/rich-text-editor.js +3 -3
- package/components/rich-text-editor/rich-text-editor.module.css +12 -12
- package/components/ridgeline/ridgeline.module.css +7 -7
- package/components/scroll-area/scroll-area.module.css +8 -8
- package/components/segmented-control/segmented-control.d.ts +3 -1
- package/components/segmented-control/segmented-control.js +5 -2
- package/components/segmented-control/segmented-control.module.css +9 -4
- package/components/select/select.module.css +5 -5
- package/components/shortcut-recorder/shortcut-recorder.js +5 -5
- package/components/shortcut-recorder/shortcut-recorder.module.css +16 -16
- package/components/signature-pad/signature-pad.module.css +11 -11
- package/components/slider/slider.module.css +4 -4
- package/components/slope-chart/slope-chart.module.css +7 -7
- package/components/slot-text/slot-text.js +2 -1
- package/components/sortable-data-table/sortable-data-table.module.css +4 -4
- package/components/sparkline/sparkline.js +1 -1
- package/components/split-button/split-button.module.css +6 -6
- package/components/stepper/stepper.module.css +3 -3
- package/components/streamgraph/streamgraph.module.css +7 -7
- package/components/swipe-actions/swipe-actions.js +2 -2
- package/components/swipe-actions/swipe-actions.module.css +5 -5
- package/components/switch/switch.js +2 -2
- package/components/switch/switch.module.css +1 -1
- package/components/tabs/tabs.d.ts +9 -2
- package/components/tabs/tabs.js +11 -5
- package/components/tabs/tabs.module.css +10 -3
- package/components/tag-input/tag-input.module.css +4 -4
- package/components/text-reveal/text-reveal.js +1 -1
- package/components/time-picker/time-picker.js +4 -2
- package/components/time-picker/time-picker.module.css +3 -3
- package/components/timeline/timeline.js +4 -4
- package/components/timeline/timeline.module.css +3 -3
- package/components/toast/toast.js +1 -1
- package/components/toast/toast.module.css +5 -5
- package/components/toast-stack/toast-stack.js +1 -1
- package/components/toast-stack/toast-stack.module.css +5 -5
- package/components/tooltip/tooltip.module.css +1 -1
- package/components/tree-view/tree-view.js +16 -12
- package/components/tree-view/tree-view.module.css +10 -8
- package/components/treemap/treemap.module.css +13 -13
- package/components/usage-meter/usage-meter.js +1 -1
- package/components/usage-meter/usage-meter.module.css +5 -5
- package/components/user-menu/user-menu.js +16 -14
- package/components/user-menu/user-menu.module.css +22 -22
- package/components/waffle-chart/waffle-chart.module.css +7 -7
- package/components.json +416 -1
- package/eslint.js +35 -3
- package/lib/fluid-hover.d.ts +83 -0
- package/lib/fluid-hover.js +184 -0
- package/lib/menu-highlight.d.ts +24 -11
- package/lib/menu-highlight.js +29 -28
- package/lib/motion-tokens.d.ts +76 -18
- package/lib/motion-tokens.js +45 -10
- package/package.json +1 -1
- package/styles.css +50 -7
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
.root[data-variant="title"] { --size: var(--text-xl); --leading: round(var(--size) * 1.3, 2px); --weight: 500; --ink: var(--foreground); }
|
|
5
5
|
.root[data-variant="body"] { --pad-y: 5px; --size: var(--text-sm); --leading: round(var(--size) * 1.5, 1px); --weight: 400; --ink: var(--text-secondary); }
|
|
6
6
|
/* Room for the actions is reserved in every state, so the text never rewraps when editing starts. */
|
|
7
|
-
/*
|
|
8
|
-
.line { display: block; min-width: 0; margin: 0; padding-inline-end:
|
|
9
|
-
.root[data-multiline] .line { padding-inline-end:
|
|
7
|
+
/* The body face at every size here: a heading host keeps its semantics but not the display face. */
|
|
8
|
+
.line { display: block; min-width: 0; margin: 0; padding-inline-end: var(--space-stage); color: var(--ink); font-family: var(--font-body); font-size: var(--size); font-weight: var(--weight); line-height: var(--leading); letter-spacing: var(--tracking-body); }
|
|
9
|
+
.root[data-multiline] .line { padding-inline-end: var(--space-block); }
|
|
10
10
|
.box { position: relative; display: inline-block; max-width: 100%; vertical-align: top; }
|
|
11
11
|
.root[data-multiline] .box { display: block; }
|
|
12
12
|
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
.root[data-multiline] .display { width: 100%; }
|
|
17
17
|
.root[data-editing] .display { visibility: hidden; }
|
|
18
18
|
/* While editing, a single line keeps a little extra room, so the next character never has to wait for the box. */
|
|
19
|
-
.root[data-editing]:not([data-multiline]) .display { min-width: 5em; padding-inline-end: calc(var(--pad-x) +
|
|
19
|
+
.root[data-editing]:not([data-multiline]) .display { min-width: 5em; padding-inline-end: calc(var(--pad-x) + var(--space-inset)); }
|
|
20
20
|
.display[aria-disabled="true"] { cursor: progress; }
|
|
21
21
|
.layer { position: relative; display: block; transition: opacity var(--duration-standard) var(--ease-standard); }
|
|
22
22
|
.layer[data-empty] { color: var(--text-muted); }
|
|
@@ -45,28 +45,28 @@ textarea.control { white-space: pre-wrap; overflow-wrap: break-word; }
|
|
|
45
45
|
.root[data-flash="off"] .frame { transition-duration: var(--duration-considered); }
|
|
46
46
|
|
|
47
47
|
/* The slot rides on the frame's edge, so it follows the width morph instead of jumping to the new width. */
|
|
48
|
-
.slot { position: absolute; top: 50%; left: calc(100% +
|
|
49
|
-
.root[data-multiline] .slot { top: 0; left: calc(100% +
|
|
48
|
+
.slot { position: absolute; top: 50%; left: calc(100% + var(--space-related)); display: grid; min-height: 28px; margin-top: calc(var(--space-inset) * -1); pointer-events: auto; }
|
|
49
|
+
.root[data-multiline] .slot { top: 0; left: calc(100% + var(--space-related)); margin-top: calc(var(--pad-y) + var(--leading) / 2 - var(--space-group)); }
|
|
50
50
|
.slotItem { display: grid; grid-area: 1 / 1; min-height: 28px; place-items: center start; }
|
|
51
|
-
.actions { display: flex; gap:
|
|
51
|
+
.actions { display: flex; gap: var(--space-tight); }
|
|
52
52
|
.root[data-multiline] .actions { flex-direction: column; }
|
|
53
53
|
.save, .cancel { display: grid; width: 28px; height: 28px; flex: none; place-items: center; padding: 0; border: 1px solid transparent; border-radius: var(--radius-full); corner-shape: round; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), transform var(--duration-instant) var(--ease-standard); }
|
|
54
54
|
.save { background: var(--foreground); color: var(--background); }
|
|
55
55
|
.cancel { border-color: var(--border); background: var(--surface); color: var(--text-secondary); }
|
|
56
56
|
.save:active, .cancel:active { transform: scale(.96); }
|
|
57
57
|
@media (hover: hover) and (pointer: fine) { .save:hover { background: color-mix(in oklab, var(--foreground) 86%, var(--background)); } .cancel:hover { border-color: var(--border-strong); background: var(--surface-muted); color: var(--foreground); } }
|
|
58
|
-
.pencil { margin-left:
|
|
59
|
-
.spinner { display: block; width: 14px; height: 14px; margin-left:
|
|
58
|
+
.pencil { margin-left: var(--space-hair); color: var(--text-muted); cursor: pointer; }
|
|
59
|
+
.spinner { display: block; width: 14px; height: 14px; margin-left: var(--space-hair); border: 1.5px solid var(--text-muted); border-right-color: transparent; border-radius: var(--radius-full); corner-shape: round; animation: spin .7s linear infinite; }
|
|
60
60
|
.saved { display: grid; margin-left: 1px; place-items: center; color: var(--success); }
|
|
61
61
|
.failedIcon { margin-left: 1px; color: var(--danger); }
|
|
62
62
|
|
|
63
63
|
/* The message row opens from a true zero; its spacing lives inside the clipped slot. */
|
|
64
64
|
.reveal { display: block; overflow: hidden; }
|
|
65
65
|
.revealInner { position: relative; display: block; }
|
|
66
|
-
.message { display: flex; align-items: flex-start; gap:
|
|
66
|
+
.message { display: flex; align-items: flex-start; gap: var(--space-related); padding: var(--space-related) var(--pad-x) var(--space-tight) calc(var(--pad-x) + 1px); color: var(--text-secondary); font-size: var(--text-xs); font-weight: 400; line-height: var(--leading-body); }
|
|
67
67
|
.message[data-tone="error"] { color: var(--danger); }
|
|
68
|
-
.messageIcon { flex: none; margin-top:
|
|
69
|
-
.retry { margin: 0 0 0
|
|
68
|
+
.messageIcon { flex: none; margin-top: var(--space-hair); color: var(--danger); }
|
|
69
|
+
.retry { margin: 0 0 0 var(--space-hair); padding: 0; border: 0; border-radius: var(--radius-detail); corner-shape: var(--corner-shape); background: none; color: var(--foreground); font: inherit; font-weight: 500; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; cursor: pointer; }
|
|
70
70
|
@media (hover: hover) and (pointer: fine) { .retry:hover { text-decoration-color: currentColor; } }
|
|
71
71
|
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
72
72
|
@keyframes spin { to { transform: rotate(360deg); } }
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
.root { --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace; --indent: 16px; display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-container); background: var(--surface); color: var(--foreground); font-family: var(--font-body); letter-spacing: var(--tracking-body); }
|
|
2
2
|
|
|
3
3
|
/* Toolbar: search with a match counter, then expand and collapse all. */
|
|
4
|
-
.toolbar { display: flex; align-items: center; gap:
|
|
5
|
-
.search { position: relative; display: flex; min-width: 0; flex: 1; align-items: center; gap:
|
|
4
|
+
.toolbar { display: flex; align-items: center; gap: var(--space-hair); padding: var(--space-related); border-bottom: 1px solid var(--border-subtle); }
|
|
5
|
+
.search { position: relative; display: flex; min-width: 0; flex: 1; align-items: center; gap: var(--space-tight); min-height: 34px; padding: 0 var(--space-tight) 0 var(--space-group); border-radius: var(--radius-control); background: var(--surface-muted); cursor: text; }
|
|
6
6
|
.searchIcon { flex: none; color: var(--text-muted); }
|
|
7
|
-
.input { min-width: 0; flex: 1; height: 34px; padding: 0
|
|
7
|
+
.input { min-width: 0; flex: 1; height: 34px; padding: 0 var(--space-tight); border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: var(--text-sm); outline: none; }
|
|
8
8
|
.input::placeholder { color: var(--text-muted); }
|
|
9
9
|
.input::-webkit-search-cancel-button { display: none; }
|
|
10
10
|
.matches { display: inline-flex; flex: none; align-items: center; gap: 0; }
|
|
11
|
-
.count { min-width: 3.5ch; padding-inline:
|
|
11
|
+
.count { min-width: 3.5ch; padding-inline: var(--space-tight); color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; text-align: right; }
|
|
12
12
|
.grow { flex: 1; }
|
|
13
|
-
.divider { width: 1px; height: 18px; margin-inline:
|
|
13
|
+
.divider { width: 1px; height: 18px; margin-inline: var(--space-tight); background: var(--border-subtle); }
|
|
14
14
|
.tool { display: inline-grid; width: 34px; height: 34px; flex: none; place-items: center; padding: 0; border: 0; border-radius: var(--radius-control); background: transparent; color: var(--text-secondary); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), opacity var(--duration-fast) var(--ease-standard); }
|
|
15
15
|
.tool:disabled { cursor: default; opacity: .4; }
|
|
16
16
|
.tool:active:not(:disabled) { background: var(--surface-muted); color: var(--foreground); }
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
.search .tool:active:not(:disabled) { background: var(--surface); }
|
|
19
19
|
|
|
20
20
|
/* Tree. Rows are one fixed height, so scrolling can aim at where a row will settle. */
|
|
21
|
-
.tree { position: relative; max-height: var(--json-max-height, 420px); padding:
|
|
21
|
+
.tree { position: relative; max-height: var(--json-max-height, 420px); padding: var(--space-related); overflow: auto; overflow-anchor: none; overscroll-behavior: contain; font-family: var(--mono); font-size: var(--text-sm); font-variant-ligatures: none; letter-spacing: 0; scrollbar-width: thin; }
|
|
22
22
|
.row { position: relative; border-radius: var(--radius-detail); cursor: default; outline: none; -webkit-tap-highlight-color: transparent; }
|
|
23
23
|
.highlight { position: absolute; inset: 1px 0; border-radius: var(--radius-detail); background: var(--surface-muted); }
|
|
24
|
-
.line { position: relative; display: flex; height: 30px; min-width: 0; align-items: center; gap:
|
|
24
|
+
.line { position: relative; display: flex; height: 30px; min-width: 0; align-items: center; gap: var(--space-related); padding-right: var(--space-related); padding-left: calc(var(--space-tight) + var(--level, 0) * var(--indent)); white-space: nowrap; }
|
|
25
25
|
.row[data-kind="node"] .line { cursor: pointer; }
|
|
26
26
|
|
|
27
27
|
.chevron { display: inline-grid; width: 14px; height: 14px; flex: none; place-items: center; color: var(--text-muted); transition: transform var(--duration-spring) var(--ease-spring), color var(--duration-fast) var(--ease-standard); }
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
|
|
31
31
|
.key { flex: none; max-width: 45%; overflow: hidden; color: var(--foreground); text-overflow: ellipsis; }
|
|
32
32
|
.index { flex: none; color: var(--text-muted); font-variant-numeric: tabular-nums; }
|
|
33
|
-
.colon { flex: none; margin-left: -
|
|
34
|
-
.summary { display: inline-flex; min-width: 0; align-items: baseline; gap:
|
|
33
|
+
.colon { flex: none; margin-left: calc(var(--space-tight) * -1); color: var(--text-muted); }
|
|
34
|
+
.summary { display: inline-flex; min-width: 0; align-items: baseline; gap: var(--space-related); overflow: hidden; }
|
|
35
35
|
.preview { min-width: 0; overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; }
|
|
36
36
|
.countLabel { flex: none; color: var(--text-muted); font-family: var(--font-body); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
|
|
37
37
|
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
.mark { border-radius: var(--radius-detail); background: color-mix(in oklab, var(--warning) 22%, transparent); color: inherit; box-shadow: 0 0 0 1px color-mix(in oklab, var(--warning) 22%, transparent); transition: background-color var(--duration-fast) var(--ease-standard); }
|
|
46
46
|
.mark[data-current] { background: color-mix(in oklab, var(--warning) 48%, transparent); }
|
|
47
47
|
|
|
48
|
-
.more { display: inline-flex; align-items: baseline; gap:
|
|
48
|
+
.more { display: inline-flex; align-items: baseline; gap: var(--space-group); padding-left: var(--space-comfort); font-family: var(--font-body); font-size: var(--text-sm); }
|
|
49
49
|
.moreLabel { color: var(--foreground); font-weight: 500; }
|
|
50
50
|
.row[data-kind="more"] { cursor: pointer; }
|
|
51
51
|
.muted { color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
|
|
52
52
|
|
|
53
53
|
/* Copy actions appear at the row's end over a soft fade, on hover or on the current row. */
|
|
54
54
|
/* Inset like the highlight, with its right corners, so the fade never shows a square edge past the row's rounded end. */
|
|
55
|
-
.actions { position: absolute; top: 1px; right: 0; bottom: 1px; display: flex; align-items: center; gap: 0; padding-right: 1px; padding-left:
|
|
55
|
+
.actions { position: absolute; top: 1px; right: 0; bottom: 1px; display: flex; align-items: center; gap: 0; padding-right: 1px; padding-left: var(--space-section); border-radius: 0 var(--radius-detail) var(--radius-detail) 0; background: linear-gradient(to right, transparent, var(--surface) 22px); opacity: 0; pointer-events: none; transition: opacity var(--duration-fast) var(--ease-standard); }
|
|
56
56
|
.row[data-active] .actions { background: linear-gradient(to right, transparent, var(--surface-muted) 22px); }
|
|
57
57
|
.action { position: relative; display: inline-grid; width: 26px; height: 26px; place-items: center; padding: 0; border: 0; border-radius: var(--radius-detail); background: transparent; color: var(--text-secondary); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard); }
|
|
58
58
|
.action[data-state="done"] { color: var(--success); }
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
.row[data-active] .actions, .row:focus-within .actions { opacity: 1; pointer-events: auto; }
|
|
63
63
|
|
|
64
64
|
/* The current path, always readable in full through its copy action. */
|
|
65
|
-
.pathBar { display: flex; min-width: 0; align-items: center; gap:
|
|
65
|
+
.pathBar { display: flex; min-width: 0; align-items: center; gap: var(--space-group); padding: var(--space-related) var(--space-related) var(--space-related) var(--space-inset); border-top: 1px solid var(--border-subtle); }
|
|
66
66
|
.path { min-width: 0; flex: 1; overflow: hidden; color: var(--text-secondary); font-family: var(--mono); font-size: var(--text-xs); letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
|
|
67
67
|
.pathType { flex: none; color: var(--text-muted); font-size: var(--text-xs); }
|
|
68
68
|
.pathCopy { width: 30px; height: 30px; border-radius: var(--radius-detail); }
|
|
@@ -10,7 +10,7 @@ const physical = ({ visualDuration, bounce }, restDelta = .001) => { const root
|
|
|
10
10
|
const settle = physical(spring.smooth);
|
|
11
11
|
const glide = physical(spring.snappy, .0001);
|
|
12
12
|
const follow = { stiffness: glide.stiffness, damping: glide.damping, restDelta: .01 };
|
|
13
|
-
const draw = { duration: duration.
|
|
13
|
+
const draw = { duration: duration.expressive * 1.75, ease: [...ease.inOut] };
|
|
14
14
|
const fadeFast = { duration: duration.instant, ease: [...ease.standard] };
|
|
15
15
|
/** Room above the top gridline, and the gap between the crosshair and its tooltip. */
|
|
16
16
|
const TOP = 12, GAP = 14;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
.figure { display: grid; min-width: 0; gap: var(--space-inset); margin: 0; color: var(--foreground); font-family: var(--font-body); letter-spacing: var(--tracking-body); }
|
|
2
2
|
|
|
3
3
|
/* Series toggles: a plain line swatch beside each name. A hidden series keeps its place, its swatch empties and its name steps back. */
|
|
4
|
-
.legend { display: flex; flex-wrap: wrap; gap:
|
|
5
|
-
.toggle { display: inline-flex; min-height: 32px; align-items: center; gap:
|
|
4
|
+
.legend { display: flex; flex-wrap: wrap; gap: var(--space-hair) var(--space-tight); min-width: 0; margin-inline: calc(var(--space-related) * -1); }
|
|
5
|
+
.toggle { display: inline-flex; min-height: 32px; align-items: center; gap: var(--space-related); padding: 0 var(--space-group) 0 var(--space-related); border: 0; border-radius: var(--radius-full); corner-shape: round; background: transparent; color: var(--text-secondary); cursor: pointer; font: inherit; font-size: var(--text-sm); line-height: var(--leading-body); -webkit-tap-highlight-color: transparent; transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), transform var(--duration-instant) var(--ease-standard); }
|
|
6
6
|
.toggle:active { transform: scale(.97); }
|
|
7
7
|
.toggle[aria-pressed="false"] { color: var(--text-muted); }
|
|
8
8
|
.toggleLabel { white-space: nowrap; transition: opacity var(--duration-fast) var(--ease-standard); }
|
|
@@ -31,25 +31,25 @@
|
|
|
31
31
|
.chart[data-scrubbing] .dot:not([data-hidden]) { opacity: 1; }
|
|
32
32
|
|
|
33
33
|
/* The tooltip floats over the plot, so it is the one layer here with a shadow. Springs carry its position; opacity and a small scale bring it in. */
|
|
34
|
-
.tooltip { position: absolute; top: 0; left: 0; z-index: 1; display: grid; min-width: 140px; max-width: min(220px, 100%); gap:
|
|
34
|
+
.tooltip { position: absolute; top: 0; left: 0; z-index: 1; display: grid; min-width: 140px; max-width: min(220px, 100%); gap: var(--space-tight); padding: var(--space-group) var(--space-group); border: 1px solid var(--border); border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: var(--surface-raised); box-shadow: var(--shadow-floating); opacity: 0; pointer-events: none; scale: .96; transition: opacity var(--duration-fast) var(--ease-standard), scale var(--duration-fast) var(--ease-standard); }
|
|
35
35
|
.chart[data-scrubbing] .tooltip { opacity: 1; scale: 1; }
|
|
36
|
-
.tipTitle { margin: 0 0
|
|
37
|
-
.tipRow { display: flex; min-width: 0; align-items: center; gap:
|
|
36
|
+
.tipTitle { margin: 0 0 var(--space-hair); color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-body); white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
37
|
+
.tipRow { display: flex; min-width: 0; align-items: center; gap: var(--space-related); margin: 0; font-size: var(--text-sm); line-height: var(--leading-body); }
|
|
38
38
|
.tipSwatch { width: 10px; height: 2.5px; flex: none; border-radius: var(--radius-full); corner-shape: round; background: var(--series); }
|
|
39
39
|
.tipSwatch[data-dashed] { background: repeating-linear-gradient(to right, var(--series) 0 3px, transparent 3px 5px); }
|
|
40
40
|
.tipName { min-width: 0; flex: 1; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; }
|
|
41
|
-
.tipValue { flex: none; margin-left:
|
|
41
|
+
.tipValue { flex: none; margin-left: var(--space-related); color: var(--foreground); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
42
42
|
|
|
43
43
|
.message { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--text-muted); font-size: var(--text-sm); pointer-events: none; }
|
|
44
44
|
/* First load with nothing to keep on screen: a calm band that breathes where the lines will be. */
|
|
45
45
|
.skeleton { position: absolute; inset: 30% 0 25%; border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: linear-gradient(to bottom, transparent, color-mix(in oklab, var(--foreground) 5%, transparent)); animation: breathe 1.4s var(--ease-in-out) infinite alternate; }
|
|
46
46
|
|
|
47
47
|
.gutter { position: relative; grid-area: 1 / 2; min-width: 0; }
|
|
48
|
-
.tick { position: absolute; top: 0; left:
|
|
48
|
+
.tick { position: absolute; top: 0; left: var(--space-group); display: block; height: 0; white-space: nowrap; pointer-events: none; }
|
|
49
49
|
.tickText { display: block; transform: translateY(-50%); color: var(--text-muted); font-size: var(--text-xs); line-height: 1; font-variant-numeric: tabular-nums; }
|
|
50
50
|
|
|
51
51
|
.axis { position: relative; grid-area: 2 / 1; min-width: 0; }
|
|
52
|
-
.axisLabel { position: absolute; top:
|
|
52
|
+
.axisLabel { position: absolute; top: var(--space-related); color: var(--text-muted); font-size: var(--text-xs); line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
|
|
53
53
|
|
|
54
54
|
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
55
55
|
|
|
@@ -4,6 +4,7 @@ import { forwardRef, useCallback, useId, useImperativeHandle, useLayoutEffect, u
|
|
|
4
4
|
import { AnimatePresence, animate, motion, useMotionValue, useReducedMotion } from "motion/react";
|
|
5
5
|
import { Hash } from "lucide-react";
|
|
6
6
|
import { motionTokens } from "../../lib/motion-tokens.js";
|
|
7
|
+
import { useNearestItem } from "../../lib/fluid-hover.js";
|
|
7
8
|
import styles from "./mention-input.module.css";
|
|
8
9
|
const EMPTY = { text: "", mentions: [] };
|
|
9
10
|
const SYMBOL = { person: "@", channel: "#" };
|
|
@@ -111,6 +112,8 @@ export const MentionInput = forwardRef(function MentionInput({ value: valueProp,
|
|
|
111
112
|
const [focused, setFocused] = useState(false);
|
|
112
113
|
const [dismissed, setDismissed] = useState(null);
|
|
113
114
|
const [active, setActive] = useState(0);
|
|
115
|
+
// Fluid hover: the mouse makes the nearest option active, gaps and padding included, and a click there picks it.
|
|
116
|
+
const nearest = useNearestItem({ items: '[role="option"]', onPick: item => setActive(Number(item.dataset.index)) });
|
|
114
117
|
const commit = useCallback((next) => {
|
|
115
118
|
if (valueProp === undefined)
|
|
116
119
|
setInner(next);
|
|
@@ -404,8 +407,7 @@ export const MentionInput = forwardRef(function MentionInput({ value: valueProp,
|
|
|
404
407
|
const optionId = (index) => `${uid}-option-${index}`;
|
|
405
408
|
const popIn = reduced ? { opacity: 0 } : { opacity: 0, scale: .96, y: anchor?.above ? 4 : -4 };
|
|
406
409
|
const countLabel = open ? (suggestions.length ? `${suggestions.length} ${trigger?.kind === "person" ? (suggestions.length === 1 ? "person" : "people") : (suggestions.length === 1 ? "channel" : "channels")}` : "No matches") : "";
|
|
407
|
-
return _jsxs("div", { ref: rootRef, className: [styles.root, className].filter(Boolean).join(" "), "data-disabled": disabled || undefined, children: [_jsxs(motion.div, { ref: fieldRef, className: styles.field, style: { height }, "data-focused": focused || undefined, children: [_jsxs("div", { ref: backdropRef, className: styles.backdrop, "aria-hidden": "true", children: [mirror, "\u200b"] }), _jsx("textarea", { ref: areaRef, id: id, name: name, className: styles.textarea, value: value.text, placeholder: placeholder, disabled: disabled, rows: minRows, spellCheck: true, role: "combobox", "aria-label": ariaLabel, "aria-describedby": describedBy, "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? listId : undefined, "aria-activedescendant": open && suggestions.length ? optionId(activeIndex) : undefined, onChange: onInput, onSelect: onSelect, onKeyDown: onKeyDown, onScroll: onScroll, onFocus: () => setFocused(true), onBlur: () => { setFocused(false); setCaret(null); } })] }), _jsx("span", { className: styles.srOnly, "aria-live": "polite", children: countLabel }), _jsx(AnimatePresence, { children: open && anchor && _jsx(motion.div, { className: styles.popover, "data-above": anchor.above || undefined, style: { left: anchor.x, top: anchor.y, height: panelHeight, transformOrigin: anchor.above ? "14px 100%" : "14px 0" }, initial: popIn, animate: { opacity: 1, scale: 1, y: 0, transition: reduced ? { duration: duration.fast } : { ...spring.snappy, opacity: { duration: duration.fast, ease: enter } } }, exit: { ...popIn, transition: { duration: duration.exit * .7, ease: standard } }, onMouseDown: event => event.preventDefault(), children: _jsx("div", { ref: bodyRef, className: styles.popoverBody, children: suggestions.length ? _jsxs("ul", { ref: listRef, id: listId, role: "listbox", "aria-label": trigger?.kind === "person" ? "People" : "Channels", className: styles.list, children: [_jsx(motion.li, { "aria-hidden": "true", className: styles.highlight, style: { y: hy, height: hh } }), suggestions.map((suggestion, index) => _jsxs("li", { id: optionId(index), role: "option", "aria-selected": index === activeIndex, "data-index": index, className: styles.option,
|
|
408
|
-
setActive(index); }, onClick: () => choose(suggestion), children: [suggestion.kind === "person"
|
|
410
|
+
return _jsxs("div", { ref: rootRef, className: [styles.root, className].filter(Boolean).join(" "), "data-disabled": disabled || undefined, children: [_jsxs(motion.div, { ref: fieldRef, className: styles.field, style: { height }, "data-focused": focused || undefined, children: [_jsxs("div", { ref: backdropRef, className: styles.backdrop, "aria-hidden": "true", children: [mirror, "\u200b"] }), _jsx("textarea", { ref: areaRef, id: id, name: name, className: styles.textarea, value: value.text, placeholder: placeholder, disabled: disabled, rows: minRows, spellCheck: true, role: "combobox", "aria-label": ariaLabel, "aria-describedby": describedBy, "aria-autocomplete": "list", "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": open ? listId : undefined, "aria-activedescendant": open && suggestions.length ? optionId(activeIndex) : undefined, onChange: onInput, onSelect: onSelect, onKeyDown: onKeyDown, onScroll: onScroll, onFocus: () => setFocused(true), onBlur: () => { setFocused(false); setCaret(null); } })] }), _jsx("span", { className: styles.srOnly, "aria-live": "polite", children: countLabel }), _jsx(AnimatePresence, { children: open && anchor && _jsx(motion.div, { className: styles.popover, "data-above": anchor.above || undefined, style: { left: anchor.x, top: anchor.y, height: panelHeight, transformOrigin: anchor.above ? "14px 100%" : "14px 0" }, initial: popIn, animate: { opacity: 1, scale: 1, y: 0, transition: reduced ? { duration: duration.fast } : { ...spring.snappy, opacity: { duration: duration.fast, ease: enter } } }, exit: { ...popIn, transition: { duration: duration.exit * .7, ease: standard } }, onMouseDown: event => event.preventDefault(), ...nearest, children: _jsx("div", { ref: bodyRef, className: styles.popoverBody, children: suggestions.length ? _jsxs("ul", { ref: listRef, id: listId, role: "listbox", "aria-label": trigger?.kind === "person" ? "People" : "Channels", className: styles.list, children: [_jsx(motion.li, { "aria-hidden": "true", className: styles.highlight, style: { y: hy, height: hh } }), suggestions.map((suggestion, index) => _jsxs("li", { id: optionId(index), role: "option", "aria-selected": index === activeIndex, "data-index": index, className: styles.option, onClick: () => choose(suggestion), children: [suggestion.kind === "person"
|
|
409
411
|
? _jsx("span", { className: styles.avatar, "aria-hidden": "true", children: suggestion.item.avatar
|
|
410
412
|
// eslint-disable-next-line @next/next/no-img-element -- registry components stay framework agnostic
|
|
411
413
|
? _jsx("img", { src: suggestion.item.avatar, alt: "", width: 28, height: 28, loading: "lazy" })
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
box-sizing: border-box;
|
|
25
25
|
width: 100%;
|
|
26
26
|
margin: 0;
|
|
27
|
-
padding:
|
|
27
|
+
padding: var(--space-group) var(--space-inset);
|
|
28
28
|
border: 0;
|
|
29
29
|
font: inherit;
|
|
30
30
|
font-size: var(--text-base);
|
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
|
|
67
67
|
/* A token is tinted around its own glyphs; the negative margin keeps every character where the textarea put it. */
|
|
68
68
|
.token {
|
|
69
|
-
margin: 0 -
|
|
70
|
-
padding: 1px
|
|
69
|
+
margin: 0 calc(var(--space-tight) * -1);
|
|
70
|
+
padding: 1px var(--space-tight);
|
|
71
71
|
border-radius: var(--radius-detail); corner-shape: var(--corner-shape);
|
|
72
72
|
background: var(--accent-subtle);
|
|
73
73
|
color: var(--accent-strong);
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
|
|
79
79
|
.popover {
|
|
80
80
|
position: absolute;
|
|
81
|
-
z-index:
|
|
81
|
+
z-index: var(--layer-dropdown);
|
|
82
82
|
width: 272px;
|
|
83
83
|
max-width: 100%;
|
|
84
84
|
overflow: hidden;
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
box-shadow: var(--shadow-floating);
|
|
89
89
|
}
|
|
90
90
|
.popover[data-above] { translate: 0 -100%; }
|
|
91
|
-
.popoverBody { padding:
|
|
91
|
+
.popoverBody { padding: var(--space-related); }
|
|
92
92
|
|
|
93
93
|
.list { position: relative; display: grid; margin: 0; padding: 0; list-style: none; }
|
|
94
94
|
.highlight { position: absolute; top: 0; right: 0; left: 0; border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: color-mix(in oklab, var(--foreground) 6.5%, transparent); pointer-events: none; }
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
display: flex;
|
|
99
99
|
min-width: 0;
|
|
100
100
|
align-items: center;
|
|
101
|
-
gap:
|
|
102
|
-
padding:
|
|
101
|
+
gap: var(--space-group);
|
|
102
|
+
padding: var(--space-related) var(--space-group) var(--space-related) var(--space-related);
|
|
103
103
|
border-radius: var(--radius-control); corner-shape: var(--corner-shape);
|
|
104
104
|
cursor: pointer;
|
|
105
105
|
font-size: var(--text-sm);
|
|
@@ -129,6 +129,6 @@
|
|
|
129
129
|
.optionMeta { overflow: hidden; color: var(--text-muted); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
|
|
130
130
|
.count { flex: none; color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
|
|
131
131
|
|
|
132
|
-
.empty { margin: 0; padding:
|
|
132
|
+
.empty { margin: 0; padding: var(--space-group) var(--space-group); color: var(--text-secondary); font-size: var(--text-sm); }
|
|
133
133
|
|
|
134
134
|
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.card { min-width: 0; border: 1px solid var(--border); border-radius: var(--radius-overlay); corner-shape: var(--corner-shape); padding: var(--space-section); background: var(--surface); box-shadow: var(--shadow-resting); }
|
|
2
2
|
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-group); margin-bottom: var(--space-block); }
|
|
3
3
|
.top span { color: var(--text-secondary); font-size: var(--text-sm); }
|
|
4
|
-
.top small { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius-full); corner-shape: round; padding:
|
|
4
|
+
.top small { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--border); border-radius: var(--radius-full); corner-shape: round; padding: var(--space-tight) var(--space-related); color: var(--text-secondary); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
|
|
5
5
|
.card p { margin: var(--space-inset) 0 0; color: var(--text-muted); font-size: var(--text-sm); line-height: var(--leading-body); }
|
|
6
6
|
@media (max-width: 380px) { .card { padding: var(--space-inset); } .top { align-items: flex-start; flex-wrap: wrap; margin-bottom: var(--space-section); } }
|
|
7
7
|
/* Text swaps: the outgoing copy is popped out of flow so the wrapper never holds both widths. */
|
|
@@ -4,6 +4,7 @@ import { forwardRef, useCallback, useEffect, useId, useImperativeHandle, useLayo
|
|
|
4
4
|
import { AnimatePresence, animate, motion, useMotionValue, useReducedMotion } from "motion/react";
|
|
5
5
|
import { Check, ChevronDown } from "lucide-react";
|
|
6
6
|
import { motionTokens } from "../../lib/motion-tokens.js";
|
|
7
|
+
import { useNearestItem } from "../../lib/fluid-hover.js";
|
|
7
8
|
import styles from "./money-input.module.css";
|
|
8
9
|
const enterEase = [...motionTokens.ease.enter];
|
|
9
10
|
const standardEase = [...motionTokens.ease.standard];
|
|
@@ -374,6 +375,9 @@ export const MoneyInput = forwardRef(function MoneyInput({ label, hideLabel = fa
|
|
|
374
375
|
/* ---------------------------------------------- Currency menu ---------------------------------------------- */
|
|
375
376
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
376
377
|
const [activeCode, setActiveCode] = useState(code);
|
|
378
|
+
// Fluid hover: the mouse makes the nearest option active, gaps and padding included, and a click there picks it.
|
|
379
|
+
const nearest = useNearestItem({ items: '[role="option"]', onPick: item => { if (item.dataset.code)
|
|
380
|
+
setActiveCode(item.dataset.code); } });
|
|
377
381
|
const menuRef = useRef(null);
|
|
378
382
|
const listRef = useRef(null);
|
|
379
383
|
const menuButtonRef = useRef(null);
|
|
@@ -489,11 +493,10 @@ export const MoneyInput = forwardRef(function MoneyInput({ label, hideLabel = fa
|
|
|
489
493
|
setDraft(settle(draft, info.digits)); onBlur?.(event); } })] }), info.position === "suffix" && _jsx(SymbolSlot, { symbol: info.symbol, reduced: reduced })] }) }), canSwitch ? _jsxs("div", { ref: menuRef, className: styles.menuAnchor, children: [_jsxs("button", { ref: menuButtonRef, type: "button", className: styles.currencyButton, disabled: disabled, "aria-haspopup": "listbox", "aria-expanded": menuOpen, "aria-controls": `${uid}-currencies`, "aria-label": `Currency, ${info.name}`, "data-open": menuOpen || undefined, onClick: () => (menuOpen ? closeMenu(true) : openMenu()), onKeyDown: event => { if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
490
494
|
event.preventDefault();
|
|
491
495
|
openMenu();
|
|
492
|
-
} }, children: [_jsx("span", { className: styles.code, children: code }), _jsx(motion.span, { className: styles.chevron, "aria-hidden": "true", initial: false, animate: { rotate: menuOpen ? 180 : 0 }, transition: reduced ? { duration: 0 } : GLIDE, children: _jsx(ChevronDown, { size: 16, strokeWidth: 1.75 }) })] }), _jsx(AnimatePresence, { children: menuOpen && _jsx(motion.div, { className: styles.menu, initial: reduced ? { opacity: 0 } : { opacity: 0, scale: .96, y: -4, filter: `blur(${blur.subtle}px)` }, animate: { opacity: 1, scale: 1, y: 0, filter: "blur(0px)" }, exit: reduced ? { opacity: 0, transition: { duration: duration.instant } } : { opacity: 0, scale: .97, y: -2, filter: `blur(${blur.subtle}px)`, transition: { duration: duration.instant, ease: standardEase } }, transition: reduced ? { duration: duration.instant } : { ...spring.snappy, opacity: { duration: duration.fast, ease: enterEase }, filter: { duration: duration.fast, ease: enterEase } }, children: _jsxs("div", { ref: listRef, id: `${uid}-currencies`, className: styles.list, role: "listbox", tabIndex: -1, "aria-label": "Currency", "aria-activedescendant": `${uid}-cur-${activeCode}`, onKeyDown: onMenuKeyDown, children: [_jsx(motion.span, { className: styles.highlight, style: { y: hy, height: hh, opacity: ho }, "aria-hidden": "true" }), options.map(option => _jsxs("div", { id: `${uid}-cur-${option.code}`, role: "option", "aria-selected": option.code === code, className: styles.option, "data-active": option.code === activeCode || undefined, ref: node => { if (node)
|
|
496
|
+
} }, children: [_jsx("span", { className: styles.code, children: code }), _jsx(motion.span, { className: styles.chevron, "aria-hidden": "true", initial: false, animate: { rotate: menuOpen ? 180 : 0 }, transition: reduced ? { duration: 0 } : GLIDE, children: _jsx(ChevronDown, { size: 16, strokeWidth: 1.75 }) })] }), _jsx(AnimatePresence, { children: menuOpen && _jsx(motion.div, { className: styles.menu, initial: reduced ? { opacity: 0 } : { opacity: 0, scale: .96, y: -4, filter: `blur(${blur.subtle}px)` }, animate: { opacity: 1, scale: 1, y: 0, filter: "blur(0px)" }, exit: reduced ? { opacity: 0, transition: { duration: duration.instant } } : { opacity: 0, scale: .97, y: -2, filter: `blur(${blur.subtle}px)`, transition: { duration: duration.instant, ease: standardEase } }, transition: reduced ? { duration: duration.instant } : { ...spring.snappy, opacity: { duration: duration.fast, ease: enterEase }, filter: { duration: duration.fast, ease: enterEase } }, children: _jsxs("div", { ref: listRef, id: `${uid}-currencies`, className: styles.list, role: "listbox", tabIndex: -1, "aria-label": "Currency", "aria-activedescendant": `${uid}-cur-${activeCode}`, onKeyDown: onMenuKeyDown, onPointerDown: event => event.preventDefault(), ...nearest, children: [_jsx(motion.span, { className: styles.highlight, style: { y: hy, height: hh, opacity: ho }, "aria-hidden": "true" }), options.map(option => _jsxs("div", { id: `${uid}-cur-${option.code}`, role: "option", "aria-selected": option.code === code, className: styles.option, "data-active": option.code === activeCode || undefined, ref: node => { if (node)
|
|
493
497
|
optionRefs.current.set(option.code, node);
|
|
494
498
|
else
|
|
495
|
-
optionRefs.current.delete(option.code); },
|
|
496
|
-
setActiveCode(option.code); }, onPointerDown: event => event.preventDefault(), onClick: () => chooseCurrency(option), children: [_jsx("span", { className: styles.optionSymbol, "aria-hidden": "true", children: option.symbol }), _jsx("span", { className: styles.optionCode, children: option.code }), _jsx("span", { className: styles.optionName, children: option.name }), _jsx("span", { className: styles.check, "data-on": option.code === code || undefined, "aria-hidden": "true", children: _jsx(Check, { size: 16, strokeWidth: 1.75 }) })] }, option.code))] }) }, "menu") })] }) : _jsx("span", { className: styles.codeStatic, children: code })] }), (chips.length > 0 || range) && _jsxs("div", { className: styles.toolbar, children: [chips.length > 0 && _jsx("div", { className: styles.chips, role: "group", "aria-label": "Quick add", children: chips.map(amount => {
|
|
499
|
+
optionRefs.current.delete(option.code); }, "data-code": option.code, onPointerDown: event => event.preventDefault(), onClick: () => chooseCurrency(option), children: [_jsx("span", { className: styles.optionSymbol, "aria-hidden": "true", children: option.symbol }), _jsx("span", { className: styles.optionCode, children: option.code }), _jsx("span", { className: styles.optionName, children: option.name }), _jsx("span", { className: styles.check, "data-on": option.code === code || undefined, "aria-hidden": "true", children: _jsx(Check, { size: 16, strokeWidth: 1.75 }) })] }, option.code))] }) }, "menu") })] }) : _jsx("span", { className: styles.codeStatic, children: code })] }), (chips.length > 0 || range) && _jsxs("div", { className: styles.toolbar, children: [chips.length > 0 && _jsx("div", { className: styles.chips, role: "group", "aria-label": "Quick add", children: chips.map(amount => {
|
|
497
500
|
const add = amount * pow10(info.digits);
|
|
498
501
|
const atMax = max !== undefined && (minor ?? 0) >= max;
|
|
499
502
|
return _jsxs("button", { type: "button", className: styles.chip, disabled: disabled, "aria-disabled": atMax || undefined, "aria-controls": inputId, "aria-label": `Add ${info.whole.format(amount)}`, onClick: () => nudge(add, "chip"), children: ["+", info.whole.format(amount)] }, amount);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
.label { justify-self: start; margin-bottom: var(--space-related); color: var(--foreground); font-size: var(--text-sm); font-weight: 500; line-height: var(--leading-body); }
|
|
4
4
|
|
|
5
5
|
/* One tall shell: the amount on the left, the currency on the right. Set --money-input-height to resize it. */
|
|
6
|
-
.control { position: relative; display: flex; min-width: 0; height: var(--money-input-height, 76px); box-sizing: border-box; align-items: center; gap: var(--space-related); padding: 0
|
|
6
|
+
.control { position: relative; display: flex; min-width: 0; height: var(--money-input-height, 76px); box-sizing: border-box; align-items: center; gap: var(--space-related); padding: 0 var(--space-related) 0 var(--space-comfort); border: 1px solid var(--border-strong); border-radius: var(--radius-container); corner-shape: var(--corner-shape); background: var(--surface); transition: border-color var(--duration-fast) var(--ease-standard); }
|
|
7
7
|
@media (hover: hover) and (pointer: fine) { .control:hover:not([data-invalid]) { border-color: var(--foreground); } }
|
|
8
8
|
.control[data-focused] { border-color: var(--foreground); }
|
|
9
9
|
.control[data-invalid] { border-color: var(--danger); }
|
|
@@ -35,19 +35,19 @@
|
|
|
35
35
|
|
|
36
36
|
/* Currency switch: plain text on the shell, a quiet fill on hover and while open. It answers a press with color, since it anchors a menu. */
|
|
37
37
|
.menuAnchor { position: relative; flex: none; }
|
|
38
|
-
.currencyButton { display: inline-flex; height: 36px; align-items: center; gap:
|
|
38
|
+
.currencyButton { display: inline-flex; height: 36px; align-items: center; gap: var(--space-tight); padding: 0 var(--space-related) 0 var(--space-group); border: 0; border-radius: var(--radius-full); corner-shape: round; background: transparent; color: var(--foreground); cursor: pointer; font: inherit; font-size: var(--text-sm); font-weight: 500; -webkit-tap-highlight-color: transparent; transition: background-color var(--duration-fast) var(--ease-standard); }
|
|
39
39
|
@media (hover: hover) and (pointer: fine) { .currencyButton:hover:not(:disabled) { background: var(--surface-muted); } }
|
|
40
40
|
.currencyButton:active:not(:disabled), .currencyButton[data-open] { background: var(--surface-muted); }
|
|
41
41
|
.currencyButton:disabled { cursor: not-allowed; }
|
|
42
42
|
.code { font-variant-numeric: tabular-nums; }
|
|
43
|
-
.codeStatic { flex: none; padding: 0
|
|
43
|
+
.codeStatic { flex: none; padding: 0 var(--space-group); color: var(--text-secondary); font-size: var(--text-sm); font-weight: 500; }
|
|
44
44
|
.chevron { display: grid; width: 16px; height: 16px; place-items: center; color: var(--text-muted); }
|
|
45
45
|
|
|
46
46
|
/* The menu grows out of the currency button's corner and opens 8px below the shell, whatever its height. */
|
|
47
|
-
.menu { --drop: calc((var(--money-input-height, 76px) - 36px) / 2 + var(--space-related)); position: absolute; z-index:
|
|
48
|
-
.list { position: relative; display: grid; max-height: 288px; gap:
|
|
47
|
+
.menu { --drop: calc((var(--money-input-height, 76px) - 36px) / 2 + var(--space-related)); position: absolute; z-index: var(--layer-dropdown); top: calc(100% + var(--drop)); right: calc(var(--space-related) * -1); width: min(256px, calc(100vw - 2rem)); box-sizing: border-box; padding: var(--space-related); border: 1px solid var(--border); border-radius: var(--radius-container); corner-shape: var(--corner-shape); background: var(--surface-raised); box-shadow: var(--shadow-floating); transform-origin: calc(100% - 44px) calc(var(--drop) * -1 - 18px); }
|
|
48
|
+
.list { position: relative; display: grid; max-height: 288px; gap: var(--space-hair); overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: thin; }
|
|
49
49
|
.highlight { position: absolute; top: 0; right: 0; left: 0; border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: color-mix(in oklab, var(--foreground) 6.5%, transparent); pointer-events: none; }
|
|
50
|
-
.option { position: relative; display: flex; min-height: 36px; box-sizing: border-box; align-items: center; gap:
|
|
50
|
+
.option { position: relative; display: flex; min-height: 36px; box-sizing: border-box; align-items: center; gap: var(--space-group); padding: 0 var(--space-group); border-radius: var(--radius-control); corner-shape: var(--corner-shape); color: var(--text-secondary); cursor: pointer; font-size: var(--text-sm); user-select: none; -webkit-user-select: none; transition: color var(--duration-fast) var(--ease-standard); }
|
|
51
51
|
.option[data-active], .option[aria-selected="true"] { color: var(--foreground); }
|
|
52
52
|
.optionSymbol { width: 22px; flex: none; color: var(--text-muted); text-align: center; }
|
|
53
53
|
.optionCode { flex: none; font-weight: 500; font-variant-numeric: tabular-nums; }
|
|
@@ -57,10 +57,10 @@
|
|
|
57
57
|
|
|
58
58
|
/* Quick add chips and the allowed range share one row under the shell. */
|
|
59
59
|
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-related) var(--space-group); padding-top: var(--space-group); }
|
|
60
|
-
.chips { display: flex; flex-wrap: wrap; gap:
|
|
61
|
-
.chip { height: 30px; padding: 0
|
|
60
|
+
.chips { display: flex; flex-wrap: wrap; gap: var(--space-related); }
|
|
61
|
+
.chip { height: 30px; padding: 0 var(--space-group); border: 1px solid var(--border); border-radius: var(--radius-full); corner-shape: round; background: var(--surface); color: var(--text-secondary); cursor: pointer; font: inherit; font-size: var(--text-xs); font-weight: 500; font-variant-numeric: tabular-nums; -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: background-color var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard), transform var(--duration-spring) var(--ease-spring); }
|
|
62
62
|
@media (hover: hover) and (pointer: fine) { .chip:hover:not(:disabled) { background: var(--surface-muted); color: var(--foreground); } }
|
|
63
|
-
.chip:active:not(:disabled) { transform: scale(.96); transition-duration: var(--duration-fast), var(--duration-fast), var(--duration-fast),
|
|
63
|
+
.chip:active:not(:disabled) { transform: scale(.96); transition-duration: var(--duration-fast), var(--duration-fast), var(--duration-fast), var(--duration-fast); }
|
|
64
64
|
.chip[aria-disabled="true"] { opacity: .45; }
|
|
65
65
|
.chip:disabled { opacity: .45; cursor: not-allowed; }
|
|
66
66
|
.range { color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; transition: color var(--duration-standard) var(--ease-standard); }
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
|
|
74
74
|
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
|
|
75
75
|
|
|
76
|
-
@media (max-width: 420px) { .control { padding-left:
|
|
76
|
+
@media (max-width: 420px) { .control { padding-left: var(--space-inset); } .group { font-size: var(--text-2xl); } }
|
|
77
77
|
@media (prefers-reduced-motion: reduce) { .control, .column, .check, .chip, .range { transition-duration: 0ms; } .chip:active:not(:disabled) { transform: none; } }
|
|
@@ -4,6 +4,7 @@ import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useSta
|
|
|
4
4
|
import { AnimatePresence, animate, motion, useMotionValue, useReducedMotion } from "motion/react";
|
|
5
5
|
import { Check, ChevronDown, Search, X } from "lucide-react";
|
|
6
6
|
import { motionTokens } from "../../lib/motion-tokens.js";
|
|
7
|
+
import { useNearestItem } from "../../lib/fluid-hover.js";
|
|
7
8
|
import styles from "./morph-select.module.css";
|
|
8
9
|
const { blur } = motionTokens;
|
|
9
10
|
const enter = [...motionTokens.ease.enter];
|
|
@@ -49,9 +50,9 @@ function matches(option, needle) {
|
|
|
49
50
|
const valueVariants = {
|
|
50
51
|
enter: (change) => change.fly ? { opacity: 1, x: change.fly.x, y: change.fly.y, filter: "blur(0px)" } : { opacity: 0, x: 0, y: `${change.dir * .5}em`, filter: `blur(${blur.soft}px)` },
|
|
51
52
|
rest: { opacity: 1, x: 0, y: 0, filter: "blur(0px)" },
|
|
52
|
-
exit: (change) => ({ opacity: 0, x: 0, y: change.fly ? "-0.3em" : `${change.dir * -.45}em`, filter: `blur(${blur.subtle}px)`, transition: { duration: .
|
|
53
|
+
exit: (change) => ({ opacity: 0, x: 0, y: change.fly ? "-0.3em" : `${change.dir * -.45}em`, filter: `blur(${blur.subtle}px)`, transition: { duration: motionTokens.duration.instant, ease: standard } }),
|
|
53
54
|
};
|
|
54
|
-
const valueFade = { enter: { opacity: 0 }, rest: { opacity: 1, x: 0, y: 0, filter: "blur(0px)" }, exit: { opacity: 0, transition: { duration: .
|
|
55
|
+
const valueFade = { enter: { opacity: 0 }, rest: { opacity: 1, x: 0, y: 0, filter: "blur(0px)" }, exit: { opacity: 0, transition: { duration: motionTokens.duration.instant } } };
|
|
55
56
|
/** The closed trigger's width, rounded up. offsetWidth rounds to the nearest pixel, and half a pixel short is enough to ellipsize the label. */
|
|
56
57
|
const triggerWidth = (node) => {
|
|
57
58
|
const exact = node.getBoundingClientRect().width, rounded = node.offsetWidth;
|
|
@@ -80,6 +81,8 @@ export function MorphSelect({ label, hideLabel = false, items, value, defaultVal
|
|
|
80
81
|
const [open, setOpen] = useState(false);
|
|
81
82
|
const [query, setQuery] = useState("");
|
|
82
83
|
const [active, setActive] = useState(null);
|
|
84
|
+
// Fluid hover: the mouse makes the nearest option active, group labels and padding included, and a click there picks it.
|
|
85
|
+
const nearest = useNearestItem({ items: '[role="option"]', onPick: item => setActive(item.dataset.value ?? null) });
|
|
83
86
|
const [change, setChange] = useState({ key: 0, value: null, dir: 1, fly: null });
|
|
84
87
|
const needle = query.trim().toLowerCase();
|
|
85
88
|
const visibleSections = useMemo(() => needle
|
|
@@ -377,15 +380,14 @@ export function MorphSelect({ label, hideLabel = false, items, value, defaultVal
|
|
|
377
380
|
close(true);
|
|
378
381
|
else
|
|
379
382
|
openList(); }, onKeyDown: event => onKey(event, false), onKeyUp: event => { if (event.key === " ")
|
|
380
|
-
window.setTimeout(() => { suppressClick.current = false; }); }, children: _jsx("span", { ref: slotRef, className: styles.slot, "data-hidden": showSearch || undefined, children: _jsx(AnimatePresence, { initial: false, custom: changeForLayer, children: _jsx(motion.span, { className: styles.layer, custom: changeForLayer, variants: reduced ? valueFade : valueVariants, initial: "enter", animate: "rest", exit: "exit", transition: reduced ? { duration: .
|
|
383
|
+
window.setTimeout(() => { suppressClick.current = false; }); }, children: _jsx("span", { ref: slotRef, className: styles.slot, "data-hidden": showSearch || undefined, children: _jsx(AnimatePresence, { initial: false, custom: changeForLayer, children: _jsx(motion.span, { className: styles.layer, custom: changeForLayer, variants: reduced ? valueFade : valueVariants, initial: "enter", animate: "rest", exit: "exit", transition: reduced ? { duration: motionTokens.duration.instant } : changeForLayer.fly ? { x: FLY, y: FLY, opacity: { duration: 0 } } : { y: GLIDE, opacity: { duration: motionTokens.duration.exit, ease: enter }, filter: { duration: motionTokens.duration.exit, ease: enter } }, children: renderValue(selectedOption) }, layerKey) }) }) }), canSearch && _jsxs(motion.div, { className: styles.searchRow, inert: !showSearch || undefined, initial: false, animate: showSearch ? { opacity: 1, filter: "blur(0px)" } : { opacity: 0, filter: reduced ? "blur(0px)" : `blur(${blur.subtle}px)` }, transition: showSearch ? { duration: motionTokens.duration.exit, ease: enter, delay: reduced ? 0 : motionTokens.stagger.word } : { duration: motionTokens.duration.instant, ease: standard }, children: [_jsx(Search, { className: styles.searchIcon, size: 16, strokeWidth: 1.75, "aria-hidden": "true" }), _jsx("input", { ref: inputRef, className: styles.input, type: "text", role: "combobox", "aria-label": `Search ${label.toLowerCase()}`, "aria-expanded": open, "aria-controls": listId, "aria-autocomplete": "list", "aria-activedescendant": open && current !== null ? optionId(indexOf.get(current) ?? 0) : undefined, placeholder: searchPlaceholder ?? selectedOption?.label ?? "Search", value: query, autoComplete: "off", spellCheck: false, onChange: event => onQuery(event.target.value), onKeyDown: event => onKey(event, true) }), _jsx(AnimatePresence, { initial: false, children: query && _jsx(motion.button, { type: "button", className: styles.clear, "aria-label": "Clear search", onPointerDown: event => event.preventDefault(), onClick: () => { onQuery(""); inputRef.current?.focus(); }, initial: { opacity: 0, scale: .6 }, animate: { opacity: 1, scale: 1 }, exit: { opacity: 0, scale: .6, transition: { duration: motionTokens.duration.instant } }, transition: reduced ? { duration: 0 } : GLIDE, children: _jsx(X, { size: 14, strokeWidth: 1.75, "aria-hidden": "true" }) }, "clear") }), _jsx("button", { type: "button", className: styles.closeHit, "aria-label": `Close ${label.toLowerCase()}`, onClick: () => close(true) })] }), _jsx(motion.span, { className: styles.chevron, "aria-hidden": "true", initial: false, animate: { rotate: open ? 180 : 0 }, transition: reduced ? { duration: 0 } : GLIDE, children: _jsx(ChevronDown, { size: 16, strokeWidth: 1.75 }) })] }), _jsx(motion.div, { ref: listFaceRef, className: styles.listFace, inert: !open || undefined, "aria-hidden": !open || undefined, initial: false, animate: open ? { opacity: 1, y: 0, filter: "blur(0px)" } : { opacity: 0, y: reduced ? 0 : -6, filter: reduced ? "blur(0px)" : `blur(${blur.subtle}px)` }, transition: open ? { y: GROW, opacity: { duration: motionTokens.duration.exit, ease: enter, delay: reduced ? 0 : motionTokens.stagger.word }, filter: { duration: motionTokens.duration.exit, ease: enter, delay: motionTokens.stagger.word } } : { duration: motionTokens.duration.instant, ease: standard }, children: _jsx("div", { ref: scrollRef, className: styles.scroll, children: _jsxs("div", { id: listId, className: styles.options, role: "listbox", "aria-labelledby": labelId, onPointerDown: event => event.preventDefault(), ...nearest, children: [_jsx(motion.span, { className: styles.highlight, style: { y: hy, height: hh, opacity: ho }, "aria-hidden": "true" }), visibleSections.map(section => {
|
|
381
384
|
const rows = section.options.map(option => {
|
|
382
385
|
const index = indexOf.get(option.value) ?? 0;
|
|
383
386
|
const isSelected = option.value === selected, isActive = option.value === current;
|
|
384
387
|
return _jsxs("div", { id: optionId(index), role: "option", "aria-selected": isSelected, "aria-disabled": option.disabled || undefined, className: styles.option, "data-active": isActive || undefined, ref: node => { if (node)
|
|
385
388
|
optionRefs.current.set(option.value, node);
|
|
386
389
|
else
|
|
387
|
-
optionRefs.current.delete(option.value); },
|
|
388
|
-
setActive(option.value); }, onPointerDown: event => event.preventDefault(), onClick: event => commit(option, event.currentTarget), children: [_jsxs("span", { className: styles.optionValue, "data-part": "value", children: [option.icon && _jsx("span", { className: styles.icon, "aria-hidden": "true", children: option.icon }), _jsx("span", { className: styles.valueText, children: option.label })] }), option.meta && _jsx("span", { className: styles.meta, children: option.meta }), _jsx("span", { className: styles.check, "data-on": isSelected || undefined, "aria-hidden": "true", children: _jsx(Check, { size: 16, strokeWidth: 1.75 }) })] }, option.value);
|
|
390
|
+
optionRefs.current.delete(option.value); }, "data-value": option.value, onPointerDown: event => event.preventDefault(), onClick: event => commit(option, event.currentTarget), children: [_jsxs("span", { className: styles.optionValue, "data-part": "value", children: [option.icon && _jsx("span", { className: styles.icon, "aria-hidden": "true", children: option.icon }), _jsx("span", { className: styles.valueText, children: option.label })] }), option.meta && _jsx("span", { className: styles.meta, children: option.meta }), _jsx("span", { className: styles.check, "data-on": isSelected || undefined, "aria-hidden": "true", children: _jsx(Check, { size: 16, strokeWidth: 1.75 }) })] }, option.value);
|
|
389
391
|
});
|
|
390
392
|
return section.label
|
|
391
393
|
? _jsxs("div", { role: "group", "aria-labelledby": `${uid}-${section.key}`, className: styles.group, children: [_jsx("div", { id: `${uid}-${section.key}`, className: styles.groupLabel, role: "presentation", children: section.label }), rows] }, section.key)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* The root lays out the label and the anchor. The anchor holds the closed trigger's place; the shape floats over it and grows past it when open. */
|
|
2
2
|
.root { --ms-h: var(--control-height-md); --ms-trigger-w: 0px; position: relative; display: inline-grid; justify-items: start; gap: var(--space-related); min-width: 0; color: var(--foreground); font-family: var(--font-body); font-size: var(--text-sm); letter-spacing: var(--tracking-body); line-height: var(--leading-body); }
|
|
3
3
|
.root[data-align="end"] { justify-items: end; }
|
|
4
|
-
.root[data-open] { z-index:
|
|
4
|
+
.root[data-open] { z-index: var(--layer-dropdown); }
|
|
5
5
|
.label { color: var(--text-secondary); font-size: var(--text-sm); font-weight: 500; }
|
|
6
6
|
|
|
7
7
|
.anchor { position: relative; height: var(--ms-h); max-width: 100%; }
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
/* The lid is the trigger row. It stays at the top of the surface in both states and sits above the list, so a lifted label passes over it. */
|
|
23
23
|
.lid { position: absolute; z-index: 1; top: 0; right: 0; left: 0; height: var(--ms-h); }
|
|
24
24
|
|
|
25
|
-
.trigger { box-sizing: border-box; display: flex; height: var(--ms-h); align-items: center; gap: var(--space-related); padding: 0
|
|
25
|
+
.trigger { box-sizing: border-box; display: flex; height: var(--ms-h); align-items: center; gap: var(--space-related); padding: 0 var(--space-block) 0 var(--space-inset); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; }
|
|
26
26
|
.lid .trigger { position: absolute; inset: 0; width: 100%; margin: 0; border: 0; background: transparent; color: inherit; cursor: pointer; font-family: inherit; letter-spacing: inherit; text-align: left; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
|
|
27
27
|
.lid .trigger:disabled { cursor: not-allowed; }
|
|
28
28
|
/* An invisible copy that says how wide the closed trigger wants to be. It sits in flow until the first measurement lands, so the server render already has the right size. */
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
.icon > svg { width: 16px; height: 16px; }
|
|
40
40
|
.icon > img { width: 20px; height: 20px; border-radius: 50%; corner-shape: round; object-fit: cover; }
|
|
41
41
|
|
|
42
|
-
.chevron { position: absolute; top: 50%; right:
|
|
42
|
+
.chevron { position: absolute; top: 50%; right: var(--space-group); display: grid; width: 16px; height: 16px; margin-top: calc(var(--space-related) * -1); place-items: center; color: var(--text-muted); pointer-events: none; }
|
|
43
43
|
|
|
44
44
|
/* Search takes the lid's place when the list is long. */
|
|
45
|
-
.searchRow { position: absolute; inset: 0; display: flex; align-items: center; gap: var(--space-related); padding: 0
|
|
45
|
+
.searchRow { position: absolute; inset: 0; display: flex; align-items: center; gap: var(--space-related); padding: 0 var(--space-hair) 0 var(--space-inset); }
|
|
46
46
|
.searchRow[inert] { pointer-events: none; }
|
|
47
47
|
.searchIcon { flex: none; color: var(--text-muted); }
|
|
48
48
|
.input { min-width: 0; height: 100%; flex: 1; padding: 0; border: 0; background: transparent; color: var(--foreground); font: inherit; font-size: var(--text-sm); letter-spacing: var(--tracking-body); outline: none; }
|
|
@@ -56,19 +56,19 @@
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/* The list hangs under the lid at its own width, so it measures the same whatever size the surface is mid spring. */
|
|
59
|
-
.listFace { position: absolute; top: var(--ms-h); left: 0; box-sizing: border-box; width: max(var(--ms-trigger-w), min(var(--ms-panel-w), calc(100vw - 2rem))); padding: 0
|
|
59
|
+
.listFace { position: absolute; top: var(--ms-h); left: 0; box-sizing: border-box; width: max(var(--ms-trigger-w), min(var(--ms-panel-w), calc(100vw - 2rem))); padding: 0 var(--space-related) var(--space-related); }
|
|
60
60
|
.root[data-align="end"] .listFace { right: 0; left: auto; }
|
|
61
|
-
.listFace::before { content: ""; position: absolute; top: 0; right:
|
|
61
|
+
.listFace::before { content: ""; position: absolute; top: 0; right: var(--space-inset); left: var(--space-inset); height: 1px; background: var(--border-subtle); }
|
|
62
62
|
.listFace[inert] { pointer-events: none; }
|
|
63
|
-
.scroll { max-height: var(--ms-list-max); overflow-y: auto; overscroll-behavior: contain; padding-top:
|
|
64
|
-
.options { position: relative; display: grid; gap:
|
|
63
|
+
.scroll { max-height: var(--ms-list-max); overflow-y: auto; overscroll-behavior: contain; padding-top: var(--space-related); scrollbar-width: thin; }
|
|
64
|
+
.options { position: relative; display: grid; gap: var(--space-hair); }
|
|
65
65
|
.highlight { position: absolute; top: 0; right: 0; left: 0; border-radius: var(--radius-control); corner-shape: var(--corner-shape); background: color-mix(in oklab, var(--foreground) 6.5%, transparent); pointer-events: none; }
|
|
66
66
|
|
|
67
|
-
.group { display: grid; gap:
|
|
68
|
-
.group + .group { margin-top:
|
|
69
|
-
.groupLabel { padding:
|
|
67
|
+
.group { display: grid; gap: var(--space-hair); }
|
|
68
|
+
.group + .group { margin-top: var(--space-tight); }
|
|
69
|
+
.groupLabel { padding: var(--space-related) var(--space-group) var(--space-tight); color: var(--text-muted); font-size: var(--text-xs); font-weight: 400; }
|
|
70
70
|
|
|
71
|
-
.option { position: relative; display: flex; min-height: 36px; box-sizing: border-box; align-items: center; gap: var(--space-related); padding: 0
|
|
71
|
+
.option { position: relative; display: flex; min-height: 36px; box-sizing: border-box; align-items: center; gap: var(--space-related); padding: 0 var(--space-group) 0 var(--space-related); border-radius: var(--radius-control); corner-shape: var(--corner-shape); color: var(--text-secondary); cursor: pointer; user-select: none; -webkit-user-select: none; transition: color var(--duration-fast) var(--ease-standard); }
|
|
72
72
|
.option[data-active], .option[aria-selected="true"] { color: var(--foreground); }
|
|
73
73
|
.option[aria-disabled="true"] { color: var(--text-muted); cursor: not-allowed; opacity: .6; }
|
|
74
74
|
/* Lid padding minus list inset, so a lifted label starts exactly level with where it lands. */
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
.meta { flex: none; color: var(--text-muted); font-size: var(--text-xs); font-variant-numeric: tabular-nums; }
|
|
77
77
|
.check { display: grid; width: 16px; height: 16px; flex: none; place-items: center; color: var(--foreground); opacity: 0; transform: scale(.6); transition: opacity var(--duration-fast) var(--ease-standard), transform var(--duration-spring) var(--ease-spring); }
|
|
78
78
|
.check[data-on] { opacity: 1; transform: none; }
|
|
79
|
-
.empty { margin: 0; padding:
|
|
79
|
+
.empty { margin: 0; padding: var(--space-group) var(--space-group) var(--space-inset); color: var(--text-muted); font-size: var(--text-sm); }
|
|
80
80
|
|
|
81
81
|
.srOnly { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
|
|
82
82
|
|