Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/hover-border-strong.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@surfnet/curve-react': minor
'@surfnet/curve-angular': minor
---

Form fields now show a `--border-strong` border on hover: Combobox (chips), Input, Input Group, Input OTP, Select and Textarea. Focus, active and invalid states still take precedence, and disabled fields don't react to hover.
4 changes: 4 additions & 0 deletions packages/angular/src/lib/ui/combobox/src/lib/hlm-combobox.css
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
background-color: color-mix(in oklab, var(--input) 30%, transparent);
}

.curve-combobox-chips:hover:where(:not(:has(:disabled))) {
border-color: var(--border-strong);
}

.curve-combobox-chips:focus-within {
border-color: var(--ring);
box-shadow:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
background-color: color-mix(in oklab, var(--input) 30%, transparent);
}

.curve-input-group:hover:where(:not(:has(:disabled))) {
border-color: var(--border-strong);
}

.curve-input-group:has([data-slot='input-group-control']:focus-visible) {
border-color: var(--ring);
box-shadow:
Expand All @@ -45,6 +49,7 @@
}

/* Inside a combobox popup the search field shows no focus ring. */
[data-slot='combobox-content'] .curve-input-group:hover,
[data-slot='combobox-content'] .curve-input-group:focus-within {
border-color: inherit;
box-shadow: var(--shadow-xs, 0 1px 2px 0 rgb(0 0 0 / 0.05));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.curve-input-otp-slot:disabled {
cursor: not-allowed;
}

.curve-input-otp-slot:first-child {
border-inline-start-width: 1px;
border-start-start-radius: var(--radius-md, calc(var(--radius, 0.625rem) * 0.8));
Expand All @@ -61,6 +65,11 @@
border-color: var(--destructive);
}

/* Hover; the active state below overrides it. */
.curve-input-otp-slot:hover:not([data-matches-spartan-invalid='true']) {
border-color: var(--border-strong);
}

/* The slot the next character goes into. */
.curve-input-otp-slot:has(brn-input-otp-slot[data-active='true']) {
z-index: 10;
Expand Down
4 changes: 4 additions & 0 deletions packages/angular/src/lib/ui/input/src/lib/hlm-input.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
color: var(--muted-foreground);
}

.curve-input:hover:where(:not(:disabled)) {
border-color: var(--border-strong);
}

.curve-input:focus {
border-color: var(--ring);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/angular/src/lib/ui/select/src/lib/hlm-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
background-color: color-mix(in oklab, var(--input) 50%, transparent);
}

.curve-select-trigger:hover:where(:not(:disabled)) {
border-color: var(--border-strong);
}

.curve-select-trigger:focus {
border-color: var(--ring);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/angular/src/lib/ui/textarea/src/lib/hlm-textarea.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
color: var(--muted-foreground);
}

.curve-textarea:hover:where(:not(:disabled)) {
border-color: var(--border-strong);
}

.curve-textarea:focus {
border-color: var(--ring);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/components/ui/combobox/combobox.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@
box-shadow 150ms ease;
}

.chips:hover:where(:not(:has(:disabled))) {
border-color: var(--border-strong);
}

.chips:focus-within {
border-color: var(--ring);
box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 32%, transparent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
background-color: color-mix(in oklch, var(--input) 30%, transparent);
}

.group:hover:where(:not(:has(:disabled))) {
border-color: var(--border-strong);
}

.group:has([data-slot='input-group-control']:focus-visible) {
border-color: var(--ring);
box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 32%, transparent);
Expand All @@ -42,6 +46,7 @@
height: auto;
}

:global([data-slot='combobox-content']) .group:hover,
:global([data-slot='combobox-content']) .group:focus-within {
border-color: inherit;
box-shadow: none;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
opacity: 0.5;
}

.input {
cursor: not-allowed;
}

.input:disabled {
cursor: not-allowed;
}
Expand Down Expand Up @@ -77,6 +73,10 @@
background-color: color-mix(in oklch, var(--input) 30%, transparent);
}

.slot:hover:not([aria-invalid='true']) {
border-color: var(--border-strong);
}

.slot[data-active='true'] {
z-index: 10;
border-color: var(--ring);
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/components/ui/input/input.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
color: var(--muted-foreground);
}

.input:hover:where(:not(:disabled)) {
border-color: var(--border-strong);
}

.input:focus {
border-color: var(--ring);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/components/ui/select/select.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
height: calc(var(--spacing, 0.25rem) * 8);
}

.trigger:hover:where(:not(:disabled)) {
border-color: var(--border-strong);
}

.trigger:focus {
border-color: var(--ring);
}
Expand Down
4 changes: 4 additions & 0 deletions packages/react/src/components/ui/textarea/textarea.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
color: var(--muted-foreground);
}

.textarea:hover:where(:not(:disabled)) {
border-color: var(--border-strong);
}

.textarea:focus {
border-color: var(--ring);
}
Expand Down
Loading