summaryrefslogtreecommitdiffhomepage
path: root/packages/ui/src/components/select.css
diff options
context:
space:
mode:
authorAdam <[email protected]>2025-10-17 12:05:52 -0500
committerAdam <[email protected]>2025-10-17 12:06:36 -0500
commit887a819f2444c8454a43049983d831194883c6cd (patch)
tree7247e5d619c6065a4b1c7d02c74366d43e7e3c05 /packages/ui/src/components/select.css
parentfe8b3a25155c0aaad20b506d0ba6fc6b8f2d0e5b (diff)
downloadopencode-887a819f2444c8454a43049983d831194883c6cd.tar.gz
opencode-887a819f2444c8454a43049983d831194883c6cd.zip
wip: desktop work
Diffstat (limited to 'packages/ui/src/components/select.css')
-rw-r--r--packages/ui/src/components/select.css124
1 files changed, 124 insertions, 0 deletions
diff --git a/packages/ui/src/components/select.css b/packages/ui/src/components/select.css
new file mode 100644
index 000000000..b6b884a1f
--- /dev/null
+++ b/packages/ui/src/components/select.css
@@ -0,0 +1,124 @@
+[data-component="select"] {
+ [data-slot="trigger"] {
+ padding: 0 4px 0 8px;
+
+ [data-slot="value"] {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ [data-slot="icon"] {
+ width: fit-content;
+ height: fit-content;
+ flex-shrink: 0;
+ color: var(--text-weak);
+ transition: transform 0.1s ease-in-out;
+ }
+ }
+}
+
+[data-component="select-content"] {
+ min-width: 8rem;
+ overflow: hidden;
+ border-radius: var(--radius-md);
+ border-width: 1px;
+ border-style: solid;
+ border-color: var(--border-weak-base);
+ background-color: var(--surface-raised-base);
+ padding: calc(var(--spacing) * 1);
+ box-shadow: var(--shadow-md);
+ z-index: 50;
+
+ &[data-closed] {
+ animation: select-close 0.15s ease-out;
+ }
+
+ &[data-expanded] {
+ animation: select-open 0.15s ease-out;
+ }
+
+ [data-slot="list"] {
+ overflow-y: auto;
+ max-height: 12rem;
+ white-space: nowrap;
+ overflow-x: hidden;
+
+ &:focus {
+ outline: none;
+ }
+ }
+
+ [data-slot="section"] {
+ font-size: var(--text-xs);
+ line-height: var(--text-xs--line-height);
+ font-weight: var(--font-weight-light);
+ text-transform: uppercase;
+ color: var(--text-weak);
+ opacity: 0.6;
+ margin-top: calc(var(--spacing) * 3);
+ margin-left: calc(var(--spacing) * 2);
+ &:first-child {
+ margin-top: 0;
+ }
+ }
+
+ [data-slot="item"] {
+ position: relative;
+ display: flex;
+ align-items: center;
+ padding: calc(var(--spacing) * 2) calc(var(--spacing) * 2);
+ border-radius: var(--radius-sm);
+ font-size: var(--text-xs);
+ line-height: var(--text-xs--line-height);
+ color: var(--text-base);
+ cursor: pointer;
+ transition:
+ background-color 0.2s ease-in-out,
+ color 0.2s ease-in-out;
+ outline: none;
+ user-select: none;
+
+ &[data-highlighted] {
+ background-color: var(--surface-base);
+ }
+
+ &[data-disabled] {
+ background-color: var(--surface-disabled);
+ pointer-events: none;
+ }
+
+ [data-slot="item-indicator"] {
+ margin-left: auto;
+ }
+
+ &:focus {
+ outline: none;
+ }
+
+ &:hover {
+ background-color: var(--surface-hover);
+ }
+ }
+}
+
+@keyframes select-open {
+ from {
+ opacity: 0;
+ transform: scale(0.95);
+ }
+ to {
+ opacity: 1;
+ transform: scale(1);
+ }
+}
+
+@keyframes select-close {
+ from {
+ opacity: 1;
+ transform: scale(1);
+ }
+ to {
+ opacity: 0;
+ transform: scale(0.95);
+ }
+}