diff --git a/packages/design-system/lib/components/Input/input.module.css b/packages/design-system/lib/components/Input/input.module.css
index 97add50c7..b8a0712b0 100644
--- a/packages/design-system/lib/components/Input/input.module.css
+++ b/packages/design-system/lib/components/Input/input.module.css
@@ -1,3 +1,6 @@
+@value globals: "../../styles/globals.css";
+@value inputContainerHeight, inputExpandedHeight from globals;
+
.container {
align-content: center;
background-color: var(--Surface-Primary-Default);
@@ -5,8 +8,8 @@
border-radius: var(--Corner-radius-md);
display: grid;
min-width: 0; /* allow shrinkage */
- height: 56px;
- padding: var(--Space-x15);
+ height: inputContainerHeight;
+ padding: 0 var(--Space-x15);
box-sizing: border-box;
cursor: text;
@@ -43,7 +46,7 @@
&:focus,
&:placeholder-shown,
&[value]:not([value='']) {
- height: 18px;
+ height: inputExpandedHeight;
outline: none;
}
@@ -54,7 +57,7 @@
@media (hover: hover) {
.input:active:not(:disabled) {
- height: 18px;
+ height: inputExpandedHeight;
outline: none;
}
}
diff --git a/packages/design-system/lib/components/Label/Label.tsx b/packages/design-system/lib/components/Label/Label.tsx
index 9ee9c896e..70dd9aee3 100644
--- a/packages/design-system/lib/components/Label/Label.tsx
+++ b/packages/design-system/lib/components/Label/Label.tsx
@@ -2,11 +2,18 @@ import { labelVariants } from './variants'
import type { LabelProps } from './types'
-export function Label({ children, className, required, size }: LabelProps) {
+export function Label({
+ children,
+ className,
+ selected,
+ required,
+ size,
+}: LabelProps) {
const classNames = labelVariants({
className,
size,
required,
+ selected,
})
return {children}
diff --git a/packages/design-system/lib/components/Label/label.module.css b/packages/design-system/lib/components/Label/label.module.css
index 6f3c4049a..385d2f5c6 100644
--- a/packages/design-system/lib/components/Label/label.module.css
+++ b/packages/design-system/lib/components/Label/label.module.css
@@ -43,23 +43,22 @@
content: ' *';
}
-input:focus,
-input:placeholder-shown,
-input[value]:not([value='']),
-textarea:focus,
-textarea:placeholder-shown,
-textarea[value]:not([value='']) {
- & ~ .label {
- font-family: var(--Label-Font-family), var(--Label-Font-fallback);
- font-size: var(--Label-Size);
- font-weight: var(--Label-Font-weight);
- letter-spacing: var(--Label-Letter-spacing);
- text-transform: unset;
- line-height: 1.5;
- text-decoration: none;
+input:focus ~ .label,
+input:placeholder-shown ~ .label,
+input[value]:not([value='']) ~ .label,
+textarea:focus ~ .label,
+textarea:placeholder-shown ~ .label,
+textarea[value]:not([value='']) ~ .label,
+.selected {
+ font-family: var(--Label-Font-family), var(--Label-Font-fallback);
+ font-size: var(--Label-Size);
+ font-weight: var(--Label-Font-weight);
+ letter-spacing: var(--Label-Letter-spacing);
+ text-transform: unset;
+ line-height: 1.5;
+ text-decoration: none;
- margin-bottom: var(--Space-x05);
- }
+ margin-bottom: var(--Space-x025);
}
input:disabled,
@@ -79,7 +78,7 @@ textarea:disabled {
line-height: 1.5;
text-decoration: none;
- margin-bottom: var(--Space-x05);
+ margin-bottom: var(--Space-x025);
}
}
diff --git a/packages/design-system/lib/components/Label/variants.ts b/packages/design-system/lib/components/Label/variants.ts
index ee28aab93..53162bc49 100644
--- a/packages/design-system/lib/components/Label/variants.ts
+++ b/packages/design-system/lib/components/Label/variants.ts
@@ -12,6 +12,9 @@ export const labelVariants = cva(styles.label, {
required: {
true: styles.required,
},
+ selected: {
+ true: styles.selected,
+ },
},
defaultVariants: {
size: 'regular',
diff --git a/packages/design-system/lib/components/Select/Select.tsx b/packages/design-system/lib/components/Select/Select.tsx
index 409b6d9de..92e574798 100644
--- a/packages/design-system/lib/components/Select/Select.tsx
+++ b/packages/design-system/lib/components/Select/Select.tsx
@@ -16,6 +16,7 @@ import type { SelectProps, SelectFilterProps } from './types'
import styles from './select.module.css'
import { useState } from 'react'
+import { Label } from '../Label'
export function Select({
name,
@@ -64,15 +65,12 @@ export function Select({
{({ selectedText }) => {
return (
<>
-
- {label}
-
+ {label}
+
{selectedText}
diff --git a/packages/design-system/lib/components/Select/SelectFilter.tsx b/packages/design-system/lib/components/Select/SelectFilter.tsx
index 7c80e1b4a..bb958efa1 100644
--- a/packages/design-system/lib/components/Select/SelectFilter.tsx
+++ b/packages/design-system/lib/components/Select/SelectFilter.tsx
@@ -7,7 +7,7 @@ import {
Key,
ListBox,
Popover,
- Label,
+ Label as AriaLabel,
ComboBoxStateContext,
} from 'react-aria-components'
import {
@@ -26,6 +26,7 @@ import { SelectItem } from './SelectItem'
import type { SelectFilterProps } from './types'
import styles from './select.module.css'
+import { Label } from '../Label'
/**
* ComboBoxInner
@@ -124,7 +125,7 @@ export function SelectFilter({
{...props}
>
-
+