use-wc 1.0.0-pre.40 → 1.0.0-pre.42

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.
@@ -14,29 +14,29 @@
14
14
  font-size: var(--usewc-font-document-size);
15
15
  }
16
16
 
17
- :is(button, a, details summary, use-widget):not([data-appear-as="native"]):focus-visible,
17
+ :is(button, a, details summary, use-widget):not(.appearance-native):focus-visible,
18
18
  :is(input, textarea, select, use-date-input, use-time-input, use-datetime-input, use-duration-input):not(
19
- [data-appear-as="native"]
19
+ .appearance-native
20
20
  ):focus,
21
- input[type="file"]:not([data-appear-as="native"]):focus-visible,
22
- use-dropdown:not([data-appear-as="native"])::part(trigger):focus-visible,
23
- [data-appear-as="input"]:has(input:focus) {
21
+ input[type="file"]:not(.appearance-native):focus-visible,
22
+ use-dropdown:not(.appearance-native)::part(trigger):focus-visible,
23
+ .appearance-input:has(input:focus) {
24
24
  outline: var(--usewc-effect-outline-size) var(--usewc-effect-outline-style) var(--usewc-color-outline);
25
25
  outline-offset: var(--usewc-effect-outline-offset);
26
26
  transition: var(--usewc-effect-outline-transition);
27
27
  }
28
28
 
29
29
  :is(
30
- input:not(:is([type="checkbox"], [type="radio"], [type="range"], [type="file"], [data-appear-as])),
30
+ input:not(:is([type="checkbox"], [type="radio"], [type="range"], [type="file"], [class*="appearance-"])),
31
31
  select,
32
32
  textarea,
33
- [data-appear-as="input"],
33
+ .appearance-input,
34
34
  use-date-input,
35
35
  use-time-input,
36
36
  use-datetime-input,
37
37
  use-duration-input
38
- ):not([data-appear-as="native"]),
39
- use-listbox-input:not([data-appear-as="native"])::part(listbox) {
38
+ ):not(.appearance-native),
39
+ use-listbox-input:not(.appearance-native)::part(listbox) {
40
40
  border: var(--usewc-layout-input-border) var(--usewc-effect-input-border-style)
41
41
  var(--usewc-color-input-border-static);
42
42
  line-height: var(--usewc-layout-input-line-height);
@@ -49,7 +49,7 @@
49
49
  color: var(--usewc-color-input-text-static);
50
50
  border-radius: var(--usewc-effect-input-border-radius);
51
51
 
52
- &:not(:is(:disabled, [aria-disabled="true"], [data-appear-as="input"])):hover,
52
+ &:not(:is(:disabled, [aria-disabled="true"], .appearance-input)):hover,
53
53
  &:has(input:not(:is(:disabled, [aria-disabled="true"])):hover) {
54
54
  border-color: var(--usewc-color-input-border-hover);
55
55
  }
@@ -75,15 +75,15 @@
75
75
  }
76
76
  }
77
77
 
78
- use-listbox-input:not([data-appear-as="native"])::part(listbox) {
78
+ use-listbox-input:not(.appearance-native)::part(listbox) {
79
79
  padding: var(--usewc-layout-popover-menu-padding);
80
80
  }
81
81
 
82
- select:not([data-appear-as="native"]) {
82
+ select:not(.appearance-native) {
83
83
  appearance: none;
84
84
  }
85
85
 
86
- [data-appear-as="input"] {
86
+ .appearance-input {
87
87
  display: inline-flex;
88
88
  align-items: center;
89
89
  justify-content: center;
@@ -190,11 +190,11 @@
190
190
  * - https://codepen.io/ShadowShahriar/pen/zYPPYrQ
191
191
  * - https://open-ui.org/components/enhanced-range-input.explainer/
192
192
  */
193
- input[type="range"]:not([data-appear-as="native"]) {
193
+ input[type="range"]:not(.appearance-native) {
194
194
  accent-color: var(--usewc-color-range-thumb-background-static);
195
195
  }
196
196
 
197
- :is(a:not([data-appear-as]), [data-appear-as="a"]) {
197
+ :is(a:not([class*="appearance-"]), .appearance-a) {
198
198
  &:where(:not(a)) {
199
199
  all: unset;
200
200
  }
@@ -212,9 +212,9 @@
212
212
  }
213
213
  }
214
214
 
215
- :is(button:not([data-appear-as]), [data-appear-as="button"]),
215
+ :is(button:not([class*="appearance-"]), .appearance-button),
216
216
  use-dropdown,
217
- input[type="file"]:not([data-appear-as]) {
217
+ input[type="file"]:not([class*="appearance-"]) {
218
218
  &:where(:not(button)),
219
219
  &::file-selector-button {
220
220
  all: unset;
@@ -347,28 +347,36 @@
347
347
  border-color: var(--usewc-theme-color-button-border-static-auxiliary);
348
348
  }
349
349
 
350
- &.extra-small {
350
+ &.extra-small::part(trigger),
351
+ &.extra-small:not([type="file"], use-dropdown),
352
+ &.extra-small::file-selector-button {
351
353
  padding-block: var(--usewc-layout-button-extra-small-padding-block);
352
354
  padding-inline: var(--usewc-layout-button-extra-small-padding-inline);
353
355
  font-size: var(--usewc-layout-button-extra-small-font-size);
354
356
  line-height: var(--usewc-layout-button-extra-small-line-height);
355
357
  }
356
358
 
357
- &.small {
359
+ &.small::part(trigger),
360
+ &.small:not([type="file"], use-dropdown),
361
+ &.small::file-selector-button {
358
362
  padding-block: var(--usewc-layout-button-small-padding-block);
359
363
  padding-inline: var(--usewc-layout-button-small-padding-inline);
360
364
  font-size: var(--usewc-layout-button-small-font-size);
361
365
  line-height: var(--usewc-layout-button-small-line-height);
362
366
  }
363
367
 
364
- &.large {
368
+ &.large::part(trigger),
369
+ &.large:not([type="file"], use-dropdown),
370
+ &.large::file-selector-button {
365
371
  padding-block: var(--usewc-layout-button-large-padding-block);
366
372
  padding-inline: var(--usewc-layout-button-large-padding-inline);
367
373
  font-size: var(--usewc-layout-button-large-font-size);
368
374
  line-height: var(--usewc-layout-button-large-line-height);
369
375
  }
370
376
 
371
- &.extra-large {
377
+ &.extra-large::part(trigger),
378
+ &.extra-large:not([type="file"], use-dropdown),
379
+ &.extra-large::file-selector-button {
372
380
  padding-block: var(--usewc-layout-button-extra-large-padding-block);
373
381
  padding-inline: var(--usewc-layout-button-extra-large-padding-inline);
374
382
  font-size: var(--usewc-layout-button-extra-large-font-size);
@@ -376,12 +384,45 @@
376
384
  }
377
385
  }
378
386
 
379
- input[type="file"]:not([data-appear-as]) {
387
+ /* Sizing-only: use-select-input's trigger looks like a button but is not a
388
+ member of the button group above (no color/base styling), so the size
389
+ classes are wired through to its trigger separately. */
390
+ use-select-input {
391
+ &.extra-small::part(trigger) {
392
+ padding-block: var(--usewc-layout-button-extra-small-padding-block);
393
+ padding-inline: var(--usewc-layout-button-extra-small-padding-inline);
394
+ font-size: var(--usewc-layout-button-extra-small-font-size);
395
+ line-height: var(--usewc-layout-button-extra-small-line-height);
396
+ }
397
+
398
+ &.small::part(trigger) {
399
+ padding-block: var(--usewc-layout-button-small-padding-block);
400
+ padding-inline: var(--usewc-layout-button-small-padding-inline);
401
+ font-size: var(--usewc-layout-button-small-font-size);
402
+ line-height: var(--usewc-layout-button-small-line-height);
403
+ }
404
+
405
+ &.large::part(trigger) {
406
+ padding-block: var(--usewc-layout-button-large-padding-block);
407
+ padding-inline: var(--usewc-layout-button-large-padding-inline);
408
+ font-size: var(--usewc-layout-button-large-font-size);
409
+ line-height: var(--usewc-layout-button-large-line-height);
410
+ }
411
+
412
+ &.extra-large::part(trigger) {
413
+ padding-block: var(--usewc-layout-button-extra-large-padding-block);
414
+ padding-inline: var(--usewc-layout-button-extra-large-padding-inline);
415
+ font-size: var(--usewc-layout-button-extra-large-font-size);
416
+ line-height: var(--usewc-layout-button-extra-large-line-height);
417
+ }
418
+ }
419
+
420
+ input[type="file"]:not([class*="appearance-"]) {
380
421
  border-radius: var(--usewc-effect-input-border-radius);
381
422
  }
382
423
 
383
424
  code,
384
- [data-appear-as="code"] {
425
+ .appearance-code {
385
426
  display: inline-block;
386
427
  font-family: var(--usewc-font-code-family);
387
428
  font-size: var(--usewc-font-code-size);
@@ -453,7 +494,7 @@
453
494
  }
454
495
  }
455
496
 
456
- details:not([data-appear-as="native"]) {
497
+ details:not(.appearance-native) {
457
498
  summary {
458
499
  all: unset;
459
500
 
@@ -485,7 +526,7 @@
485
526
  input styling block. The date and time sub-inputs live in shadow DOM and are reached via
486
527
  ::part(date) and ::part(time) to override their internal layout. Segment inputs are
487
528
  re-exported via exportparts so ::part(segment-input) reaches them too. */
488
- use-datetime-input:not([data-appear-as="native"]) {
529
+ use-datetime-input:not(.appearance-native) {
489
530
  display: inline-flex;
490
531
  align-items: center;
491
532
  width: fit-content;
@@ -532,7 +573,7 @@
532
573
  }
533
574
 
534
575
  /* Segment based controls */
535
- :is(use-date-input, use-time-input):not([data-appear-as="native"]) {
576
+ :is(use-date-input, use-time-input):not(.appearance-native) {
536
577
  display: inline-flex;
537
578
  align-items: center;
538
579
  width: fit-content;
@@ -571,7 +612,7 @@
571
612
  }
572
613
  }
573
614
 
574
- use-duration-input:not([data-appear-as="native"]) {
615
+ use-duration-input:not(.appearance-native) {
575
616
  display: inline-flex;
576
617
  align-items: center;
577
618
  width: fit-content;
@@ -610,7 +651,7 @@
610
651
  }
611
652
  }
612
653
 
613
- select:not([data-appear-as="native"]),
654
+ select:not(.appearance-native),
614
655
  use-dropdown::part(trigger),
615
656
  use-dropdown use-dropdown::part(trigger) {
616
657
  padding-inline-end: calc(var(--usewc-layout-input-padding-inline) * 2 + var(--usewc-layout-selector-width));
@@ -627,12 +668,16 @@
627
668
  background-position: right center;
628
669
  }
629
670
 
630
- select:not([data-appear-as="native"]),
671
+ select:not(.appearance-native),
631
672
  use-dropdown::part(trigger),
632
673
  use-dropdown use-dropdown::part(trigger) {
633
674
  anchor-name: --use-popover-trigger;
634
675
  }
635
676
 
677
+ use-dropdown {
678
+ anchor-scope: --use-popover-trigger;
679
+ }
680
+
636
681
  use-dropdown::part(trigger-icon-default),
637
682
  use-option::part(selected-indicator-default) {
638
683
  display: none;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-wc",
3
- "version": "1.0.0-pre.40",
3
+ "version": "1.0.0-pre.42",
4
4
  "private": false,
5
5
  "homepage": "https://usewc.com",
6
6
  "bugs": "https://github.com/dang-rabbits/use-wc/issues",
@@ -20,6 +20,8 @@
20
20
  "types": "./dist/use-wc.d.ts",
21
21
  "exports": {
22
22
  ".": "./dist/use-wc.mjs",
23
+ "./tokens.css": "./dist/tokens.css",
24
+ "./design-system.css": "./dist/design-system.css",
23
25
  "./package.json": "./package.json"
24
26
  },
25
27
  "scripts": {
@@ -45,7 +47,6 @@
45
47
  "@storybook/addon-docs": "^10.2.7",
46
48
  "@storybook/addon-links": "^10.2.7",
47
49
  "@storybook/web-components-vite": "^10.2.7",
48
- "@tsdown/css": "0.21.4",
49
50
  "@types/node": "^25.5.0",
50
51
  "@typescript/native-preview": "7.0.0-dev.20260316.1",
51
52
  "@vitest/coverage-v8": "^4.0.18",
@@ -59,7 +60,6 @@
59
60
  "semantic-release": "^25.0.3",
60
61
  "storybook": "^10.2.7",
61
62
  "storybook-addon-tag-badges": "^1.4.0",
62
- "tsdown": "0.21.4",
63
63
  "typescript": "^5.9.3",
64
64
  "typescript-eslint": "^8.29.1",
65
65
  "vite-plus": "^0.1.11",
File without changes