@donotdev/ui 0.1.47 → 0.2.1

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.
package/dist/dndev.css CHANGED
@@ -193,7 +193,6 @@
193
193
  --font-size-xs: 0.75rem; /* 12px - captions, shortcuts, meta */
194
194
  --font-size-sm: 0.875rem; /* 14px - small text, captions */
195
195
  --font-size-base: 1rem; /* 16px - body text, DEFAULT */
196
- --font-size-input: 16px; /* Form field text - hardcoded for iOS zoom + density-proof */
197
196
  --font-size-lg: 1.25rem; /* 20px - base × 1.25¹ - emphasized text */
198
197
  --font-size-xl: 1.563rem; /* 25px - base × 1.25² - headings */
199
198
  --font-size-2xl: 1.953rem; /* 31px - base × 1.25³ - large headings */
@@ -447,6 +446,13 @@
447
446
  ); /* 32-48px fluid, 2vw floor */
448
447
  --line-height: 1.33; /* Perfect Fourth - All text */
449
448
  }
449
+
450
+ /* Form field text: follows density, never below 16px (iOS focus zoom).
451
+ Declared on [data-density] too, so nested densities resolve their own base. */
452
+ :root,
453
+ [data-density] {
454
+ --font-size-input: max(16px, var(--font-size-base));
455
+ }
450
456
  /* 2. Theme system - color palette definitions */
451
457
  /* packages/components/src/styles/themes.css */
452
458
 
@@ -1398,6 +1404,14 @@ em {
1398
1404
  pointer-events: none;
1399
1405
  opacity: var(--opacity-muted);
1400
1406
  }
1407
+ /* Ripple clip layer (injected by JS) - contains the ripple regardless of the host's overflow */
1408
+ .dndev-interactive .dndev-ripple-clip {
1409
+ position: absolute;
1410
+ inset: 0;
1411
+ overflow: hidden;
1412
+ border-radius: inherit;
1413
+ pointer-events: none;
1414
+ }
1401
1415
  /* Ripple effect element (injected by JS) */
1402
1416
  .dndev-interactive .dndev-ripple {
1403
1417
  position: absolute;
@@ -1406,6 +1420,9 @@ em {
1406
1420
  pointer-events: none;
1407
1421
  animation: dndev-ripple var(--dur-slow) var(--ease-in-out) forwards;
1408
1422
  }
1423
+ .dndev-interactive[data-variant='ghost'],.dndev-interactive[data-variant='link'] {
1424
+ --ripple-opacity: 0;
1425
+ }
1409
1426
  .dndev-interactive[data-display='compact'] {
1410
1427
  width: var(--touch-target);
1411
1428
  height: var(--touch-target);
@@ -1550,8 +1567,12 @@ em {
1550
1567
  .dndev-interactive[data-role='menu-item']:focus-visible,.dndev-interactive[data-role='menu-item'][data-highlighted] {
1551
1568
  background: rgb(from var(--primary) r g b / 0.1);
1552
1569
  color: var(--primary);
1553
- outline: 2px solid var(--ring);
1554
- outline-offset: 0;
1570
+ outline: none;
1571
+ box-shadow: none;
1572
+ }
1573
+ /* Items fill their clipped container: scaling would expose its edges */
1574
+ .dndev-interactive[data-role='menu-item']:active:not(:disabled) {
1575
+ transform: none;
1555
1576
  }
1556
1577
  .dndev-interactive[data-role='menu-item'][data-disabled] {
1557
1578
  pointer-events: none;
@@ -1623,6 +1644,32 @@ em {
1623
1644
  text-transform: var(--text-transform-label, none);
1624
1645
  }
1625
1646
 
1647
+ /* ICON BADGE - count bubble on the icon's top-end corner (Button `badge`) */
1648
+ .dndev-interactive-icon-anchor {
1649
+ position: relative;
1650
+ display: inline-flex;
1651
+ }
1652
+
1653
+ .dndev-interactive-badge {
1654
+ position: absolute;
1655
+ inset-block-start: -0.5em;
1656
+ inset-inline-end: -0.65em;
1657
+ min-width: 1.25rem;
1658
+ height: 1.25rem;
1659
+ padding-inline: 0.3rem;
1660
+ display: inline-flex;
1661
+ align-items: center;
1662
+ justify-content: center;
1663
+ border-radius: var(--radius-full);
1664
+ background: var(--primary);
1665
+ color: var(--primary-foreground);
1666
+ font-size: var(--font-size-xs);
1667
+ font-weight: var(--font-weight-semibold);
1668
+ font-variant-numeric: tabular-nums;
1669
+ line-height: 1;
1670
+ pointer-events: none;
1671
+ }
1672
+
1626
1673
  /* Compact mode - always hide label */
1627
1674
  .dndev-interactive-label[data-display='compact'] {
1628
1675
  display: none;
@@ -3729,6 +3776,44 @@ em {
3729
3776
  object-fit: cover;
3730
3777
  }
3731
3778
 
3779
+ /* Contain: whole image visible on the muted cover background (cut-outs), inset
3780
+ proportionally so a packshot never touches the frame. */
3781
+ .dndev-card-cover[data-fit='contain'] > img:not(.dndev-card-cover-hover) {
3782
+ -o-object-fit: contain;
3783
+ object-fit: contain;
3784
+ box-sizing: border-box;
3785
+ padding: 8%;
3786
+ }
3787
+
3788
+ /* Hover view: stacked over the cover, crossfades in on hover / keyboard focus. */
3789
+ .dndev-card-cover > img.dndev-card-cover-hover {
3790
+ position: absolute;
3791
+ inset: 0;
3792
+ -o-object-fit: cover;
3793
+ object-fit: cover;
3794
+ opacity: 0;
3795
+ transition: opacity 0.4s var(--ease-in-out);
3796
+ }
3797
+
3798
+ @media (hover: hover) {
3799
+ .dndev-card:hover .dndev-card-cover-hover {
3800
+ opacity: 1;
3801
+ }
3802
+ }
3803
+
3804
+ /* Keyboard focus only: a mouse click keeps focus inside the card, which must not
3805
+ pin the hover view after the pointer leaves. */
3806
+ .dndev-card:has(:focus-visible) .dndev-card-cover-hover,
3807
+ .dndev-card:focus-visible .dndev-card-cover-hover {
3808
+ opacity: 1;
3809
+ }
3810
+
3811
+ @media (prefers-reduced-motion: reduce) {
3812
+ .dndev-card-cover > img.dndev-card-cover-hover {
3813
+ transition: none;
3814
+ }
3815
+ }
3816
+
3732
3817
  /* Consumer-supplied ReactNode: wrapper fills, inner media fills. */
3733
3818
  .dndev-card-cover-media {
3734
3819
  position: relative;
@@ -4201,6 +4286,7 @@ em {
4201
4286
  padding: var(--gap-sm) var(--gap-md);
4202
4287
  cursor: pointer;
4203
4288
  border-radius: var(--radius-interactive);
4289
+ font-weight: var(--font-weight-normal);
4204
4290
  transition: background-color var(--dur-fast) var(--ease-in-out);
4205
4291
  }
4206
4292
 
@@ -4231,7 +4317,7 @@ em {
4231
4317
  }
4232
4318
 
4233
4319
  .dndev-combobox-option-label {
4234
- font-size: var(--font-size-sm);
4320
+ font-size: var(--font-size-input);
4235
4321
  color: var(--foreground);
4236
4322
  }
4237
4323
 
@@ -5136,12 +5222,23 @@ em {
5136
5222
  margin-inline: calc(50% - 50vw);
5137
5223
  }
5138
5224
 
5139
- /* Background image with overlay for text readability */
5225
+ /* Background image with overlay for text readability.
5226
+ The photo is an <img> (discoverable by the preload scanner), laid under the scrim. */
5140
5227
  .dndev-hero-section--bg-image {
5141
5228
  position: relative;
5142
- background-size: cover;
5143
- background-position: center;
5144
- background-repeat: no-repeat;
5229
+ overflow: hidden;
5230
+ }
5231
+
5232
+ .dndev-hero-section--bg-image > .dndev-hero-section__cover {
5233
+ position: absolute;
5234
+ inset: 0;
5235
+ width: 100%;
5236
+ height: 100%;
5237
+ -o-object-fit: cover;
5238
+ object-fit: cover;
5239
+ -o-object-position: center;
5240
+ object-position: center;
5241
+ z-index: 0;
5145
5242
  }
5146
5243
 
5147
5244
  .dndev-hero-section--bg-image::before {
@@ -5153,12 +5250,22 @@ em {
5153
5250
  rgba(0, 0, 0, 0.4),
5154
5251
  rgba(0, 0, 0, 0.6)
5155
5252
  );
5156
- z-index: 0;
5253
+ z-index: 1;
5254
+ }
5255
+
5256
+ /* Soft scrim: bright photography stays bright; only the bottom band darkens
5257
+ enough for white text placed there. */
5258
+ .dndev-hero-section--bg-image[data-scrim='soft']::before {
5259
+ background: linear-gradient(
5260
+ to bottom,
5261
+ rgba(0, 0, 0, 0) 45%,
5262
+ rgba(0, 0, 0, 0.55) 100%
5263
+ );
5157
5264
  }
5158
5265
 
5159
- .dndev-hero-section--bg-image > * {
5266
+ .dndev-hero-section--bg-image > :not(.dndev-hero-section__cover) {
5160
5267
  position: relative;
5161
- z-index: 1;
5268
+ z-index: 2;
5162
5269
  }
5163
5270
 
5164
5271
  .dndev-hero-section--bg-image,
@@ -5465,6 +5572,12 @@ em {
5465
5572
  display: block;
5466
5573
  }
5467
5574
 
5575
+ .image-gallery__thumbnail-image[data-fit='contain'] {
5576
+ -o-object-fit: contain;
5577
+ object-fit: contain;
5578
+ background-color: var(--muted);
5579
+ }
5580
+
5468
5581
  /* Responsive adjustments */
5469
5582
  @media (max-width: 640px) {
5470
5583
  .image-gallery__thumbnail {
@@ -6345,7 +6458,7 @@ input[type='number'] {
6345
6458
  background-color: var(--secondary);
6346
6459
  }
6347
6460
 
6348
- .dndev-progress [data-radix-progress-indicator] {
6461
+ .dndev-progress > [data-state] {
6349
6462
  height: 100%;
6350
6463
  width: 100%;
6351
6464
  flex: 1;
@@ -6355,23 +6468,23 @@ input[type='number'] {
6355
6468
  /* Variant colors */
6356
6469
  }
6357
6470
 
6358
- [data-variant='default']:is(.dndev-progress [data-radix-progress-indicator]) {
6471
+ [data-variant='default']:is(.dndev-progress > [data-state]) {
6359
6472
  background-color: var(--primary);
6360
6473
  }
6361
6474
 
6362
- [data-variant='accent']:is(.dndev-progress [data-radix-progress-indicator]) {
6475
+ [data-variant='accent']:is(.dndev-progress > [data-state]) {
6363
6476
  background-color: var(--accent);
6364
6477
  }
6365
6478
 
6366
- [data-variant='success']:is(.dndev-progress [data-radix-progress-indicator]) {
6479
+ [data-variant='success']:is(.dndev-progress > [data-state]) {
6367
6480
  background-color: var(--success);
6368
6481
  }
6369
6482
 
6370
- [data-variant='warning']:is(.dndev-progress [data-radix-progress-indicator]) {
6483
+ [data-variant='warning']:is(.dndev-progress > [data-state]) {
6371
6484
  background-color: var(--warning);
6372
6485
  }
6373
6486
 
6374
- [data-variant='destructive']:is(.dndev-progress [data-radix-progress-indicator]) {
6487
+ [data-variant='destructive']:is(.dndev-progress > [data-state]) {
6375
6488
  background-color: var(--destructive);
6376
6489
  }
6377
6490
 
@@ -6685,39 +6798,20 @@ input[type='number'] {
6685
6798
  border-top-color: transparent;
6686
6799
  }
6687
6800
 
6688
- .dndev-select-trigger [data-radix-select-icon] {
6689
- opacity: var(--opacity-muted);
6690
- width: var(--icon-md);
6691
- height: var(--icon-md);
6692
- }
6693
-
6694
- .dndev-select-trigger [data-radix-select-value] {
6695
- font-size: var(--font-size-input);
6696
- }
6697
-
6698
6801
  .dndev-select-content {
6699
6802
  width: var(--radix-select-trigger-width);
6700
6803
  min-width: var(--radix-select-trigger-width);
6701
6804
  }
6702
6805
 
6703
- [data-radix-select-viewport] {
6704
- display: flex;
6705
- flex-direction: column;
6706
- padding: 0;
6707
- }
6708
-
6709
- .dndev-interactive[data-radix-select-item] {
6710
- width: 100%;
6711
- justify-content: flex-start;
6712
- text-align: start;
6806
+ .dndev-select-content .dndev-interactive[data-role='menu-item'] {
6807
+ font-size: var(--font-size-input);
6808
+ font-weight: var(--font-weight-normal);
6713
6809
  }
6714
6810
 
6715
- .dndev-interactive[data-radix-select-item] [data-radix-select-item-text] {
6811
+ [data-radix-select-viewport] {
6716
6812
  display: flex;
6717
6813
  flex-direction: column;
6718
- align-items: flex-start;
6719
- text-align: start;
6720
- flex: 1;
6814
+ padding: 0;
6721
6815
  }
6722
6816
 
6723
6817
  .dndev-select-item-description {
@@ -6725,20 +6819,6 @@ input[type='number'] {
6725
6819
  color: var(--muted-foreground);
6726
6820
  }
6727
6821
 
6728
- .dndev-interactive[data-radix-select-item] [data-radix-select-item-indicator] {
6729
- display: flex;
6730
- align-items: center;
6731
- justify-content: center;
6732
- color: currentColor;
6733
- }
6734
-
6735
- .dndev-interactive[data-radix-select-item]
6736
- [data-radix-select-item-indicator]
6737
- svg {
6738
- width: 1rem;
6739
- height: 1rem;
6740
- }
6741
-
6742
6822
  /* packages/components/src/atomic/ScrollArea/ScrollArea.css */
6743
6823
 
6744
6824
  .dndev-scroll-area {
@@ -7139,6 +7219,13 @@ input[type='number'] {
7139
7219
  /* Square edges for panel metaphor */
7140
7220
  }
7141
7221
 
7222
+ /* Narrow panel (carts, filters): full width on phones, a column on larger screens */
7223
+
7224
+ .dndev-sheet-content[data-size='narrow'][data-side='right'],.dndev-sheet-content[data-size='narrow'][data-side='left'] {
7225
+ width: 100%;
7226
+ max-width: 28rem;
7227
+ }
7228
+
7142
7229
  .dndev-sheet-content[data-side='right'] {
7143
7230
  /* Physical positioning: right edge */
7144
7231
  right: 0;
@@ -7878,9 +7965,9 @@ input[type='number'] {
7878
7965
  overflow: hidden;
7879
7966
  }
7880
7967
 
7881
- /* Default: show overflow when wrap is enabled (allows wrapping) */
7968
+ /* Default: show overflow when wrap is enabled (allows wrapping); interactive elements keep their own clipping */
7882
7969
 
7883
- .dndev-stack[data-direction='row'][data-wrap='wrap']:not([data-overflow]) > *,.dndev-stack[data-direction='row'][data-wrap='wrap-reverse']:not([data-overflow]) > * {
7970
+ .dndev-stack[data-direction='row'][data-wrap='wrap']:not([data-overflow]) > *:not(.dndev-interactive),.dndev-stack[data-direction='row'][data-wrap='wrap-reverse']:not([data-overflow]) > *:not(.dndev-interactive) {
7884
7971
  overflow: visible;
7885
7972
  }
7886
7973
 
@@ -8533,6 +8620,65 @@ input[type='number'] {
8533
8620
  display: none;
8534
8621
  }
8535
8622
 
8623
+ /* packages/components/src/atomic/QuantityStepper/QuantityStepper.css */
8624
+
8625
+ /* One outlined control (e-commerce standard, e.g. Shopify Dawn): borderless − / +
8626
+ buttons around a centred, tabular quantity. Same height and radius as buttons. */
8627
+ .dndev-quantity-stepper {
8628
+ display: inline-flex;
8629
+ align-items: stretch;
8630
+ min-height: var(--touch-target);
8631
+ border: var(--border-hairline) solid var(--border);
8632
+ border-radius: var(--radius-interactive);
8633
+ background: var(--interactive);
8634
+ color: var(--foreground);
8635
+ }
8636
+ .dndev-quantity-stepper[data-full-width] {
8637
+ display: flex;
8638
+ width: 100%;
8639
+ }
8640
+ .dndev-quantity-stepper[data-disabled] {
8641
+ opacity: 0.6;
8642
+ }
8643
+ .dndev-quantity-stepper > .dndev-interactive {
8644
+ flex: 0 0 auto;
8645
+ aspect-ratio: 1;
8646
+ min-height: 0;
8647
+ border: none;
8648
+ border-radius: inherit;
8649
+ background: transparent;
8650
+ }
8651
+
8652
+ .dndev-quantity-stepper-value {
8653
+ flex: 1 1 auto;
8654
+ display: flex;
8655
+ align-items: center;
8656
+ justify-content: center;
8657
+ min-width: 3ch;
8658
+ padding-inline: var(--gap-sm);
8659
+ border: none;
8660
+ background: none;
8661
+ color: inherit;
8662
+ font: inherit;
8663
+ font-weight: var(--font-weight-medium);
8664
+ font-variant-numeric: tabular-nums;
8665
+ text-align: center;
8666
+ }
8667
+
8668
+ .dndev-quantity-stepper-value:is(button) {
8669
+ cursor: pointer;
8670
+ }
8671
+
8672
+ .dndev-quantity-stepper-value:is(button):hover {
8673
+ text-decoration: underline;
8674
+ text-underline-offset: 0.2em;
8675
+ }
8676
+
8677
+ .dndev-quantity-stepper-value:is(button):focus-visible {
8678
+ outline: none;
8679
+ box-shadow: var(--shadow-focus);
8680
+ }
8681
+
8536
8682
  /* packages/components/src/atomic/Tag/Tag.css */
8537
8683
 
8538
8684
  .dndev-tag {
@@ -8719,6 +8865,9 @@ input[type='number'] {
8719
8865
 
8720
8866
  .dndev-text-base[data-level^='h'] {
8721
8867
  font-family: var(--font-headline);
8868
+ /* Display sizes need tighter leading than body copy; themes opt in with
8869
+ --line-height-heading, otherwise headings keep the text line-height. */
8870
+ line-height: var(--line-height-heading, var(--line-height));
8722
8871
 
8723
8872
  /* A single word wider than its column is the one thing text cannot solve by
8724
8873
  wrapping, and display type hits it first: uppercase, letter-spaced headings
@@ -10311,11 +10460,11 @@ input[type='number'] {
10311
10460
  /* ========== RIPPLE EFFECT ========== */
10312
10461
  @keyframes dndev-ripple {
10313
10462
  0% {
10314
- transform: translate(-50%, -50%) scale(0);
10463
+ transform: scale(0);
10315
10464
  opacity: var(--ripple-opacity);
10316
10465
  }
10317
10466
  100% {
10318
- transform: translate(-50%, -50%) scale(4);
10467
+ transform: scale(4);
10319
10468
  opacity: 0;
10320
10469
  }
10321
10470
  }
@@ -11760,6 +11909,12 @@ main[role='main'][data-routing-animation='none'] {
11760
11909
  .dndev-layout {
11761
11910
  position: relative;
11762
11911
  width: 100%;
11912
+ /* The density preset is rendered on this wrapper by the server, but <html> only
11913
+ receives it after hydration. font-size and line-height inherit as computed
11914
+ values from <body>, so re-read the density tokens here: otherwise the first
11915
+ paint uses the root defaults and text grows once <html> is updated. */
11916
+ font-size: var(--font-size-base);
11917
+ line-height: var(--line-height);
11763
11918
  height: 100vh;
11764
11919
  height: 100dvh;
11765
11920
  max-height: 100vh;
@@ -11937,7 +12092,7 @@ aside[role='navigation'].sidebar {
11937
12092
  /* Desktop presets with no sidebar: Hide sidebar element for performance/accessibility */
11938
12093
  /* Landing, Plain, Game have --sidebar-width: 0px, also need display: none */
11939
12094
  }
11940
- [data-layout='landing']:root aside.sidebar[role='navigation'],[data-layout='plain']:root aside.sidebar[role='navigation'],[data-layout='game']:root aside.sidebar[role='navigation'] {
12095
+ [data-layout='landing']:root aside.sidebar[role='navigation'],[data-layout='plain']:root aside.sidebar[role='navigation'],[data-layout='game']:root aside.sidebar[role='navigation'],.dndev-layout[data-layout='landing'] aside.sidebar[role='navigation'],.dndev-layout[data-layout='plain'] aside.sidebar[role='navigation'],.dndev-layout[data-layout='game'] aside.sidebar[role='navigation'] {
11941
12096
  display: none;
11942
12097
  }
11943
12098
  /* Moolti: Sidebar spans full height (no header/footer on desktop) */