summaryrefslogtreecommitdiffhomepage
path: root/packages/css/src/components/select.css
blob: d7b4b589d275a354c636ccd79efb73f499b18eca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
[data-component="select"] {
  display: inline-flex;
  align-items: center;
  gap: calc(var(--spacing) * 2);
  border-style: solid;
  border-width: 1px;
  border-radius: var(--radius-md);
  border-color: var(--color-smoke-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--text-base--line-height);
  font-weight: var(--font-weight-normal);
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-decoration: none;
  user-select: none;

  &:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  &:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary);
  }

  [data-slot="section"] {
    font-size: var(--text-xs);
    line-height: var(--text-xs--line-height);
    font-weight: var(--font-weight-normal);
    margin-top: calc(var(--spacing) * 3);
    margin-left: calc(var(--spacing) * 2);
    &:first-child {
      margin-top: calc(var(--spacing) * 0);
    }
  }

  [data-slot="item"] {
    /*             "relative flex cursor-pointer select-none items-center": true, */
    /*             "rounded-sm px-2 py-0.5 text-xs outline-none text-text": true, */
    /*             "transition-colors data-[disabled]:pointer-events-none": true, */
    /*             "data-[highlighted]:bg-background-element data-[disabled]:opacity-50": true, */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--spacing) * 2);
    border-style: solid;
    border-width: 1px;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--text-base--line-height);
    font-weight: var(--font-weight-normal);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    user-select: none;

    &[data-highlighted] {
      background-color: var(--color-background-element);
    }

    &[data-disabled] {
      pointer-events: none;
      opacity: 0.5;
    }

    /* [data-slot="item-label"] { */
    /* font-size: var(--text-xs); */
    /* line-height: var(--text-xs--line-height); */
    /* font-weight: var(--font-weight-normal); */
    /* } */

    [data-slot="item-indicator"] {
      /* display: flex; */
      /* align-items: center; */
      /* gap: calc(var(--spacing) * 1); */
      margin-left: auto;
    }
  }

  [data-slot="trigger"] {
    [data-slot="value"] {
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    [data-slot="icon"] {
      /*             "group size-fit shrink-0 text-text-muted transition-transform duration-100": true, */
      width: fit-content;
      height: fit-content;
      flex-shrink: 0;
    }
  }
}

[data-component="select-content"] {
  /*             "min-w-32 overflow-hidden rounded-md border border-border-subtle/40": true, */
  /*             "bg-background-panel p-1 shadow-md z-50": true, */
  /*             "data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:zoom-out-95": true, */
  /*             "data-[expanded]:animate-in data-[expanded]:fade-in-0 data-[expanded]:zoom-in-95": true, */
  min-width: 8rem;
  overflow: hidden;
  border-radius: var(--radius-md);
  border-width: 1px;
  border-style: solid;
  border-color: var(--color-smoke-4);
  background-color: var(--color-smoke-2);
  padding: calc(var(--spacing) * 1);
  z-index: 50;

  /* &[data-closed] { */
  /* animation: fade-out-0 0.2s ease-out; */
  /* animation-fill-mode: forwards; */
  /* animation-delay: 0.2s; */
  /* opacity: 0; */
  /* } */
  /* &[data-expanded] { */
  /* animation: fade-in-0 0.2s ease-out; */
  /* animation-fill-mode: forwards; */
  /* animation-delay: 0.2s; */
  /* opacity: 1; */
  /* } */
  [data-slot="list"] {
    /* overflow-y-auto max-h-48 whitespace-nowrap overflow-x-hidden */
    overflow-y: auto;
    max-height: 12rem;
    white-space: nowrap;
    overflow-x: hidden;
  }
}