@eqtylab/equality 4.2.0 → 4.3.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.
@@ -76,6 +76,10 @@
76
76
  width: calc(0.25rem * 4);
77
77
  height: calc(0.25rem * 4);
78
78
  }
79
+ .select-icon--sm {
80
+ width: calc(0.25rem * 3);
81
+ height: calc(0.25rem * 3);
82
+ }
79
83
  .select-icon--low-opacity {
80
84
  opacity: 50%;
81
85
  }
@@ -278,6 +282,61 @@
278
282
  margin-block: calc(0.25rem * 1);
279
283
  height: 1px;
280
284
  }
285
+ .select-item[hidden] {
286
+ display: none;
287
+ }
288
+ .select-search {
289
+ display: flex;
290
+ align-items: center;
291
+ justify-content: center;
292
+ gap: calc(0.25rem * 2);
293
+ padding-inline: calc(0.25rem * 2);
294
+ padding-block: calc(0.25rem * 1.5);
295
+ margin-bottom: calc(0.25rem * 1);
296
+ border-bottom-style: var(--tw-border-style);
297
+ border-bottom-width: 1px;
298
+ position: sticky;
299
+ top: calc(0.25rem * 0);
300
+ z-index: 10;
301
+ }
302
+ .select-search-icon {
303
+ display: flex;
304
+ flex-shrink: 0;
305
+ }
306
+ .select-search-input {
307
+ min-width: calc(0.25rem * 0);
308
+ flex: 1;
309
+ --tw-border-style: none;
310
+ border-style: none;
311
+ background-color: transparent;
312
+ --tw-outline-style: none;
313
+ outline-style: none;
314
+ font-size: 0.875rem;
315
+ line-height: var(--tw-leading, calc(1.25 / 0.875));
316
+ color: var(--color-text-primary, color(display-p3 0 0 0));
317
+ &::placeholder {
318
+ color: var(--color-text-secondary, color(display-p3 0.1792 0.1792 0.1792));
319
+ }
320
+ }
321
+ .select-empty {
322
+ padding-inline: calc(0.25rem * 2);
323
+ padding-block: calc(0.25rem * 1.5);
324
+ text-align: center;
325
+ font-size: 0.75rem;
326
+ line-height: var(--tw-leading, calc(1 / 0.75));
327
+ color: var(--color-text-secondary, color(display-p3 0.1792 0.1792 0.1792));
328
+ }
329
+ .select-sr-status {
330
+ position: absolute;
331
+ width: 1px;
332
+ height: 1px;
333
+ padding: 0;
334
+ margin: -1px;
335
+ overflow: hidden;
336
+ clip-path: inset(50%);
337
+ white-space: nowrap;
338
+ border-width: 0;
339
+ }
281
340
  .select-content--sunken {
282
341
  border-color: var(--color-border-sunken, color(display-p3 0.7432 0.7432 0.7432));
283
342
  background-color: var(--color-background-sunken, color(display-p3 0.8648 0.8708 0.8779));
@@ -289,6 +348,10 @@
289
348
  .select-content--sunken .select-item {
290
349
  --mix-color: var(--color-background-sunken);
291
350
  }
351
+ .select-content--sunken .select-search {
352
+ border-color: var(--color-border-sunken, color(display-p3 0.7432 0.7432 0.7432));
353
+ background-color: var(--color-background-sunken, color(display-p3 0.8648 0.8708 0.8779));
354
+ }
292
355
  .select-content--base {
293
356
  border-color: var(--color-border-base, color(display-p3 0.7432 0.7432 0.7432));
294
357
  background-color: var(--color-background, color(display-p3 1 1 1));
@@ -300,6 +363,10 @@
300
363
  .select-content--base .select-item {
301
364
  --mix-color: var(--color-background);
302
365
  }
366
+ .select-content--base .select-search {
367
+ border-color: var(--color-border-base, color(display-p3 0.7432 0.7432 0.7432));
368
+ background-color: var(--color-background, color(display-p3 1 1 1));
369
+ }
303
370
  .select-content--raised {
304
371
  border-color: var(--color-border-raised, color(display-p3 0.7383 0.7441 0.751));
305
372
  background-color: var(--color-background-raised, color(display-p3 0.9554 0.9616 0.9688));
@@ -311,6 +378,10 @@
311
378
  .select-content--raised .select-item {
312
379
  --mix-color: var(--color-background-raised);
313
380
  }
381
+ .select-content--raised .select-search {
382
+ border-color: var(--color-border-raised, color(display-p3 0.7383 0.7441 0.751));
383
+ background-color: var(--color-background-raised, color(display-p3 0.9554 0.9616 0.9688));
384
+ }
314
385
  .select-content--overlay {
315
386
  border-color: var(--color-border-overlay, color(display-p3 0.8011 0.807 0.814));
316
387
  background-color: var(--color-background-overlay, color(display-p3 0.9946 0.9998 0.9999));
@@ -322,6 +393,10 @@
322
393
  .select-content--overlay .select-item {
323
394
  --mix-color: var(--color-background-overlay);
324
395
  }
396
+ .select-content--overlay .select-search {
397
+ border-color: var(--color-border-overlay, color(display-p3 0.8011 0.807 0.814));
398
+ background-color: var(--color-background-overlay, color(display-p3 0.9946 0.9998 0.9999));
399
+ }
325
400
  @property --tw-border-style {
326
401
  syntax: "*";
327
402
  inherits: false;
@@ -50,6 +50,25 @@
50
50
  @apply dropdown-item-hover;
51
51
  }
52
52
 
53
+ @utility dropdown-search {
54
+ @apply flex-center gap-2;
55
+ @apply px-2 py-1.5;
56
+ @apply mb-1;
57
+ @apply border-b;
58
+ }
59
+
60
+ @utility dropdown-search-input {
61
+ @apply min-w-0 flex-1;
62
+ @apply border-none bg-transparent outline-none;
63
+ @apply text-text-primary text-sm;
64
+ @apply placeholder:text-text-secondary;
65
+ }
66
+
67
+ @utility dropdown-empty {
68
+ @apply px-2 py-1.5;
69
+ @apply text-text-secondary text-center text-xs;
70
+ }
71
+
53
72
  @utility animate-popup-overlay {
54
73
  @apply data-[state=open]:animate-in data-[state=open]:fade-in-0;
55
74
  @apply data-[state=closed]:animate-out data-[state=closed]:fade-out-0;
@@ -6,6 +6,7 @@
6
6
  --font-mono: 'IBM Plex Mono', monospace;
7
7
  --color-amber-100: color(display-p3 0.9767 0.9238 0.8764);
8
8
  --color-blue-500: color(display-p3 0.2366 0.3261 0.7513);
9
+ --radius-md: 0.375rem;
9
10
  --color-mixed-light: var(--mix-color);
10
11
  @supports (color: color-mix(in lab, red, red)) {
11
12
  --color-mixed-light: color-mix(in oklch, var(--mix-color), white var(--hover-lighten, 20%));
@@ -56,6 +57,10 @@
56
57
  --color-button-secondary-fill: color(display-p3 0.0861 0.0861 0.0861);
57
58
  --color-button-tertiary-fill: color(display-p3 1 1 1);
58
59
  --color-button-warning-fill: color(display-p3 0.8263 0.6154 0.2247);
60
+ --color-lilac-100: color(display-p3 0.9492 0.917 0.9935);
61
+ --color-lilac-300: color(display-p3 0.7319 0.6108 0.8873);
62
+ --color-lilac-600: color(display-p3 0.4045 0.2306 0.6077);
63
+ --color-lilac-700: color(display-p3 0.2927 0.172 0.4505);
59
64
  --color-resource-background-agent: color(display-p3 0.7135 0.8482 0.7942);
60
65
  --color-resource-background-benchmark-result: color(display-p3 0.8859 0.7455 0.9086);
61
66
  --color-resource-background-benchmark: color(display-p3 0.8859 0.7455 0.9086);
@@ -103,10 +108,106 @@
103
108
  --color-resource-text-tool: color(display-p3 0.2625 0.1106 0.09605);
104
109
  --color-resource-text-unknown: color(display-p3 0.1792 0.1792 0.1792);
105
110
  --color-text-link: color(display-p3 0.4045 0.2306 0.6077);
111
+ --color-text-primary: color(display-p3 0 0 0);
112
+ --color-text-secondary: color(display-p3 0.1792 0.1792 0.1792);
106
113
  }
107
114
  }
108
115
  @layer utilities {
109
116
  [data-equality-theme] {
117
+ .dropdown-item {
118
+ cursor: pointer;
119
+ display: flex;
120
+ align-items: center;
121
+ font-size: 0.875rem;
122
+ line-height: var(--tw-leading, calc(1.25 / 0.875));
123
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
124
+ transition-timing-function: var(--tw-ease, cubic-bezier(0.4, 0, 0.2, 1));
125
+ transition-duration: var(--tw-duration, 150ms);
126
+ position: relative;
127
+ border-radius: 0.25rem;
128
+ --tw-outline-style: none;
129
+ outline-style: none;
130
+ @media (forced-colors: active) {
131
+ outline: 2px solid transparent;
132
+ outline-offset: 2px;
133
+ }
134
+ -webkit-user-select: none;
135
+ user-select: none;
136
+ &[data-disabled] {
137
+ pointer-events: none;
138
+ }
139
+ &[data-disabled] {
140
+ opacity: 50%;
141
+ }
142
+ &:hover {
143
+ @media (hover: hover) {
144
+ &:not(*:disabled) {
145
+ color: var(--color-lilac-700) !important;
146
+ }
147
+ }
148
+ }
149
+ &:focus {
150
+ color: var(--color-lilac-700) !important;
151
+ }
152
+ &:hover {
153
+ @media (hover: hover) {
154
+ &:not(*:disabled) {
155
+ background-color: color-mix(in srgb, color(display-p3 0.7319 0.6108 0.8873) 50%, transparent) !important;
156
+ @supports (color: color-mix(in lab, red, red)) {
157
+ background-color: color-mix(in oklab, var(--color-lilac-300) 50%, transparent) !important;
158
+ }
159
+ }
160
+ }
161
+ }
162
+ &:focus {
163
+ background-color: color-mix(in srgb, color(display-p3 0.7319 0.6108 0.8873) 50%, transparent) !important;
164
+ @supports (color: color-mix(in lab, red, red)) {
165
+ background-color: color-mix(in oklab, var(--color-lilac-300) 50%, transparent) !important;
166
+ }
167
+ }
168
+ &:hover {
169
+ @media (hover: hover) {
170
+ &:not(*:disabled) {
171
+ --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
172
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
173
+ }
174
+ }
175
+ }
176
+ &:where(html[data-equality-theme=dark], html[data-equality-theme=dark] *, [data-equality-theme=dark] .root, [data-equality-theme=dark] .root *) {
177
+ &:hover {
178
+ @media (hover: hover) {
179
+ &:not(*:disabled) {
180
+ background-color: color-mix(in srgb, color(display-p3 0.4045 0.2306 0.6077) 50%, transparent) !important;
181
+ @supports (color: color-mix(in lab, red, red)) {
182
+ background-color: color-mix(in oklab, var(--color-lilac-600) 50%, transparent) !important;
183
+ }
184
+ }
185
+ }
186
+ }
187
+ }
188
+ &:where(html[data-equality-theme=dark], html[data-equality-theme=dark] *, [data-equality-theme=dark] .root, [data-equality-theme=dark] .root *) {
189
+ &:focus {
190
+ background-color: color-mix(in srgb, color(display-p3 0.4045 0.2306 0.6077) 50%, transparent) !important;
191
+ @supports (color: color-mix(in lab, red, red)) {
192
+ background-color: color-mix(in oklab, var(--color-lilac-600) 50%, transparent) !important;
193
+ }
194
+ }
195
+ }
196
+ &:where(html[data-equality-theme=dark], html[data-equality-theme=dark] *, [data-equality-theme=dark] .root, [data-equality-theme=dark] .root *) {
197
+ &:hover {
198
+ @media (hover: hover) {
199
+ &:not(*:disabled) {
200
+ color: var(--color-lilac-100) !important;
201
+ }
202
+ }
203
+ }
204
+ }
205
+ &:where(html[data-equality-theme=dark], html[data-equality-theme=dark] *, [data-equality-theme=dark] .root, [data-equality-theme=dark] .root *) {
206
+ &:focus {
207
+ color: var(--color-lilac-100) !important;
208
+ }
209
+ }
210
+ }
110
211
  .visible {
111
212
  visibility: visible;
112
213
  }
@@ -125,6 +226,54 @@
125
226
  .sticky {
126
227
  position: sticky;
127
228
  }
229
+ .dropdown-content {
230
+ border-style: var(--tw-border-style);
231
+ border-width: 1px;
232
+ border-color: var(--color-border);
233
+ background-color: var(--color-background-overlay);
234
+ color: var(--color-text-primary);
235
+ z-index: 50;
236
+ border-radius: var(--radius-md);
237
+ padding: calc(0.25rem * 1);
238
+ overflow-x: hidden;
239
+ overflow-y: auto;
240
+ max-height: calc(0.25rem * 80);
241
+ min-width: calc(0.25rem * 32);
242
+ &[data-side="bottom"] {
243
+ --tw-enter-translate-y: calc(2*var(--spacing)*-1);
244
+ }
245
+ &[data-side="left"] {
246
+ --tw-enter-translate-x: calc(2*var(--spacing));
247
+ }
248
+ &[data-side="right"] {
249
+ --tw-enter-translate-x: calc(2*var(--spacing)*-1);
250
+ }
251
+ &[data-side="top"] {
252
+ --tw-enter-translate-y: calc(2*var(--spacing));
253
+ }
254
+ &[data-state="open"] {
255
+ animation: enter var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);
256
+ }
257
+ &[data-state="open"] {
258
+ --tw-enter-opacity: calc(0/100);
259
+ --tw-enter-opacity: 0;
260
+ }
261
+ &[data-state="open"] {
262
+ --tw-enter-scale: calc(95*1%);
263
+ --tw-enter-scale: .95;
264
+ }
265
+ &[data-state="closed"] {
266
+ animation: exit var(--tw-animation-duration,var(--tw-duration,.15s))var(--tw-ease,ease)var(--tw-animation-delay,0s)var(--tw-animation-iteration-count,1)var(--tw-animation-direction,normal)var(--tw-animation-fill-mode,none);
267
+ }
268
+ &[data-state="closed"] {
269
+ --tw-exit-opacity: calc(0/100);
270
+ --tw-exit-opacity: 0;
271
+ }
272
+ &[data-state="closed"] {
273
+ --tw-exit-scale: calc(95*1%);
274
+ --tw-exit-scale: .95;
275
+ }
276
+ }
128
277
  .container {
129
278
  width: 100%;
130
279
  @media (width >= 40rem) {
@@ -143,6 +292,17 @@
143
292
  max-width: 96rem;
144
293
  }
145
294
  }
295
+ .dropdown-search {
296
+ display: flex;
297
+ align-items: center;
298
+ justify-content: center;
299
+ gap: calc(0.25rem * 2);
300
+ padding-inline: calc(0.25rem * 2);
301
+ padding-block: calc(0.25rem * 1.5);
302
+ margin-bottom: calc(0.25rem * 1);
303
+ border-bottom-style: var(--tw-border-style);
304
+ border-bottom-width: 1px;
305
+ }
146
306
  .block {
147
307
  display: block;
148
308
  }
@@ -173,6 +333,21 @@
173
333
  .table-row {
174
334
  display: table-row;
175
335
  }
336
+ .dropdown-search-input {
337
+ min-width: calc(0.25rem * 0);
338
+ flex: 1;
339
+ --tw-border-style: none;
340
+ border-style: none;
341
+ background-color: transparent;
342
+ --tw-outline-style: none;
343
+ outline-style: none;
344
+ font-size: 0.875rem;
345
+ line-height: var(--tw-leading, calc(1.25 / 0.875));
346
+ color: var(--color-text-primary);
347
+ &::placeholder {
348
+ color: var(--color-text-secondary);
349
+ }
350
+ }
176
351
  .transform {
177
352
  transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
178
353
  }
@@ -197,6 +372,14 @@
197
372
  border-style: var(--tw-border-style);
198
373
  border-width: 1px;
199
374
  }
375
+ .dropdown-empty {
376
+ padding-inline: calc(0.25rem * 2);
377
+ padding-block: calc(0.25rem * 1.5);
378
+ text-align: center;
379
+ font-size: 0.75rem;
380
+ line-height: var(--tw-leading, calc(1 / 0.75));
381
+ color: var(--color-text-secondary);
382
+ }
200
383
  .shadow {
201
384
  --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
202
385
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -843,31 +1026,6 @@
843
1026
  display: none !important;
844
1027
  }
845
1028
  }
846
- @property --tw-rotate-x {
847
- syntax: "*";
848
- inherits: false;
849
- }
850
- @property --tw-rotate-y {
851
- syntax: "*";
852
- inherits: false;
853
- }
854
- @property --tw-rotate-z {
855
- syntax: "*";
856
- inherits: false;
857
- }
858
- @property --tw-skew-x {
859
- syntax: "*";
860
- inherits: false;
861
- }
862
- @property --tw-skew-y {
863
- syntax: "*";
864
- inherits: false;
865
- }
866
- @property --tw-border-style {
867
- syntax: "*";
868
- inherits: false;
869
- initial-value: solid;
870
- }
871
1029
  @property --tw-shadow {
872
1030
  syntax: "*";
873
1031
  inherits: false;
@@ -933,6 +1091,31 @@
933
1091
  inherits: false;
934
1092
  initial-value: 0 0 #0000;
935
1093
  }
1094
+ @property --tw-border-style {
1095
+ syntax: "*";
1096
+ inherits: false;
1097
+ initial-value: solid;
1098
+ }
1099
+ @property --tw-rotate-x {
1100
+ syntax: "*";
1101
+ inherits: false;
1102
+ }
1103
+ @property --tw-rotate-y {
1104
+ syntax: "*";
1105
+ inherits: false;
1106
+ }
1107
+ @property --tw-rotate-z {
1108
+ syntax: "*";
1109
+ inherits: false;
1110
+ }
1111
+ @property --tw-skew-x {
1112
+ syntax: "*";
1113
+ inherits: false;
1114
+ }
1115
+ @property --tw-skew-y {
1116
+ syntax: "*";
1117
+ inherits: false;
1118
+ }
936
1119
  @property --tw-blur {
937
1120
  syntax: "*";
938
1121
  inherits: false;
@@ -986,3 +1169,17 @@
986
1169
  syntax: "*";
987
1170
  inherits: false;
988
1171
  }
1172
+ @keyframes enter {
1173
+ from {
1174
+ opacity: var(--tw-enter-opacity,1);
1175
+ transform: translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0)scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1))rotate(var(--tw-enter-rotate,0));
1176
+ filter: blur(var(--tw-enter-blur,0));
1177
+ }
1178
+ }
1179
+ @keyframes exit {
1180
+ to {
1181
+ opacity: var(--tw-exit-opacity,1);
1182
+ transform: translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0)scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1))rotate(var(--tw-exit-rotate,0));
1183
+ filter: blur(var(--tw-exit-blur,0));
1184
+ }
1185
+ }
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "url": "git+https://github.com/eqtylab/equality.git",
8
8
  "directory": "packages/ui"
9
9
  },
10
- "version": "4.2.0",
10
+ "version": "4.3.0",
11
11
  "license": "Apache-2.0",
12
12
  "keywords": [
13
13
  "component library",
@@ -87,10 +87,14 @@
87
87
  },
88
88
  "devDependencies": {
89
89
  "@tailwindcss/postcss": "^4.1.14",
90
+ "@testing-library/dom": "^10.4.2",
91
+ "@testing-library/react": "^16.3.3",
92
+ "@testing-library/user-event": "^14.6.7",
90
93
  "@types/react": "^19.2.2",
91
94
  "@types/react-dom": "^19.2.2",
92
95
  "autoprefixer": "^10.4.0",
93
96
  "chokidar-cli": "^3.0.0",
97
+ "jsdom": "^30.1.1",
94
98
  "postcss": "^8.4.47",
95
99
  "postcss-cli": "^11.0.0",
96
100
  "react": "^19.0.0",
@@ -99,7 +103,8 @@
99
103
  "tailwindcss": "^4.1.14",
100
104
  "tsup": "^8.0.1",
101
105
  "tw-animate-css": "^1.4.0",
102
- "typescript": ">=5.4.x"
106
+ "typescript": ">=5.4.x",
107
+ "vitest": "^5.0.1"
103
108
  },
104
109
  "scripts": {
105
110
  "dev": "pnpm run watch:tokens",
@@ -109,6 +114,7 @@
109
114
  "check:grammars": "node src/scripts/check-grammars.js",
110
115
  "build:lib": "pnpm run build:preflight && pnpm run check:grammars && tsup --config tsup.config.ts && cp src/theme/*.css dist/ && mkdir -p dist/generated && cp src/theme/generated/*.css dist/generated/",
111
116
  "watch": "tsup --config tsup.config.ts --watch",
117
+ "test": "vitest run",
112
118
  "watch:tokens": "chokidar '../tokens/equality-tokens.json' --debounce 300 --initial=false -c 'pnpm run build:tokens'",
113
119
  "release": "pnpm run build && npm publish --access public"
114
120
  }