@donotdev/components 0.3.2 → 0.3.4

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.
@@ -161,8 +161,10 @@
161
161
  --font-family: var(--font-sans);
162
162
 
163
163
  /* Sans-serif: Inter (2026 standard). '<Family> Fallback': size-matched local face
164
- shown until the web font loads, so the swap shifts no layout (Next: defined in
165
- public/dndev-fonts.css, see @donotdev/core config/fonts/fontFallback.js) */
164
+ rendered while the web font is not available (font-display: optional), so text
165
+ keeps its box. Defined by the framework font plan on both bundlers
166
+ (@donotdev/core config/fonts/buildFontPlan.js); a stack leading with a web font
167
+ must list it right after the family (the build fails otherwise). */
166
168
  --font-sans:
167
169
  Inter, 'Inter Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI',
168
170
  'Helvetica Neue', Arial, sans-serif;
@@ -1223,7 +1225,9 @@ em {
1223
1225
  var(--floating-glow-start) 100%
1224
1226
  );
1225
1227
 
1226
- background: var(--floating-glow-gradient);
1228
+ /* --floating-background: optional theme token, set on :root / theme class
1229
+ (e.g. var(--popover)) to flatten every floating surface. Unset = glow gradient. */
1230
+ background: var(--floating-background, var(--floating-glow-gradient));
1227
1231
  color: var(--popover-foreground);
1228
1232
  border: var(--border-hairline) solid var(--line-2);
1229
1233
  border-radius: var(--radius-floating);
@@ -1255,11 +1259,14 @@ em {
1255
1259
  background: var(--popover);
1256
1260
  }
1257
1261
  .dndev-floating:dir(rtl) {
1258
- background: linear-gradient(
1259
- 135deg,
1260
- var(--floating-glow-start) 0%,
1261
- var(--floating-glow-mid) 50%,
1262
- var(--floating-glow-end) 100%
1262
+ background: var(
1263
+ --floating-background,
1264
+ linear-gradient(
1265
+ 135deg,
1266
+ var(--floating-glow-start) 0%,
1267
+ var(--floating-glow-mid) 50%,
1268
+ var(--floating-glow-end) 100%
1269
+ )
1263
1270
  );
1264
1271
  }
1265
1272
  /* Size variants - ONLY 3 sizes */
@@ -1749,7 +1756,7 @@ em {
1749
1756
  font-size: var(--font-size-input);
1750
1757
  color: var(--foreground);
1751
1758
  cursor: pointer;
1752
- transition: color var(--transition-fast);
1759
+ transition: color var(--dur-fast) var(--ease-in-out);
1753
1760
 
1754
1761
  /* Subtle hover on label text */
1755
1762
  }
@@ -5648,8 +5655,8 @@ em {
5648
5655
  display: flex;
5649
5656
  align-items: center;
5650
5657
  justify-content: center;
5651
- width: 44px;
5652
- height: 44px;
5658
+ width: var(--touch-target);
5659
+ height: var(--touch-target);
5653
5660
  border: none;
5654
5661
  border-radius: var(--radius-full);
5655
5662
  /* --card not --background: surface must be opaque */
@@ -6452,6 +6459,11 @@ input[type='number'] {
6452
6459
  gap: var(--gap-none);
6453
6460
  }
6454
6461
 
6462
+ /* Sub-menu lists: base.css gives every ul list-style disc */
6463
+ .dndev-nav-menu-grid-container {
6464
+ list-style: none;
6465
+ }
6466
+
6455
6467
  /* Navigation trigger - NavigationMenu-specific styles only */
6456
6468
  .dndev-interactive[data-role='nav-trigger'] {
6457
6469
  height: var(--touch-target);
@@ -6463,6 +6475,12 @@ input[type='number'] {
6463
6475
  background-color: rgb(from var(--accent) r g b / 0.5);
6464
6476
  }
6465
6477
 
6478
+ /* Active page: top-level links, overflow dropdown links, sub-menu links */
6479
+ .dndev-interactive[data-role='menu-item'][data-active='true'],
6480
+ .dndev-nav-menu-item-container[data-active='true'] {
6481
+ background-color: rgb(from var(--accent) r g b / 0.5);
6482
+ }
6483
+
6466
6484
  .dndev-nav-menu-trigger-icon {
6467
6485
  position: relative;
6468
6486
  top: 1px;
@@ -6643,36 +6661,121 @@ input[type='number'] {
6643
6661
 
6644
6662
  /* packages/components/src/atomic/PinInput/PinInput.css */
6645
6663
 
6646
- .dndev-pin-input {
6664
+ /* Label above the slots */
6665
+ .dndev-pin-input-field {
6647
6666
  display: flex;
6667
+ flex-direction: column;
6648
6668
  gap: var(--gap-sm);
6669
+ min-inline-size: 0;
6670
+ }
6671
+
6672
+ .dndev-pin-input-field__label {
6673
+ display: flex;
6674
+ align-items: center;
6675
+ gap: calc(var(--gap-sm) / 2);
6676
+ }
6677
+
6678
+ .dndev-pin-input-field[data-disabled='true'] .dndev-pin-input-field__label {
6679
+ opacity: var(--opacity-muted);
6680
+ }
6681
+
6682
+ .dndev-pin-input {
6683
+ display: flex;
6649
6684
  align-items: center;
6650
6685
  justify-content: center;
6686
+ min-inline-size: 0;
6651
6687
  direction: ltr; /* digits are always LTR even in RTL locales */
6652
6688
  }
6653
6689
 
6654
- .dndev-pin-input__box {
6655
- inline-size: var(--input-height, 2.75rem) !important;
6656
- block-size: var(--input-height, 2.75rem) !important;
6657
- padding: 0 !important;
6658
- text-align: center !important;
6659
- font-size: var(--font-xl, 1.25rem) !important;
6690
+ /* The row shrinks with its container; each slot shrinks from the touch-target
6691
+ size, so 8 slots fit 320px without overflow */
6692
+ .dndev-pin-input__slots {
6693
+ position: relative;
6694
+ display: flex;
6695
+ flex: 0 1 auto;
6696
+ min-inline-size: 0;
6697
+ gap: var(--gap-sm);
6698
+ }
6699
+
6700
+ .dndev-pin-input__slot {
6701
+ display: flex;
6702
+ flex: 0 1 var(--touch-target);
6703
+ align-items: center;
6704
+ justify-content: center;
6705
+ inline-size: var(--touch-target);
6706
+ min-inline-size: 0;
6707
+ block-size: var(--touch-target);
6708
+ border: var(--border-hairline) solid var(--line-2);
6709
+ border-radius: var(--radius-interactive);
6710
+ background-color: var(--interactive, transparent);
6711
+ color: var(--foreground);
6712
+ box-shadow: var(--shadow-sm);
6713
+ font-size: var(--font-size-lg);
6660
6714
  font-variant-numeric: tabular-nums;
6661
- font-feature-settings: 'tnum' 1;
6662
- caret-color: var(--primary);
6715
+ transition:
6716
+ border-color var(--dur-fast) var(--ease-in-out),
6717
+ box-shadow var(--dur-fast) var(--ease-in-out);
6663
6718
  }
6664
6719
 
6665
- /* Mask the typed digit via CSS, not by overwriting React's controlled value.
6666
- Rewriting value={raw} → value='•' on every keystroke forces React to
6667
- overwrite the native input value after the browser has already painted
6668
- the user's keystroke, which is the classic "lags like shit" PinInput bug
6669
- on mobile Chrome/Safari. `-webkit-text-security: disc` renders a bullet
6670
- purely in the layout layer while the input's real value stays the digit,
6671
- so React never has to race the browser's paint pipeline.
6672
- Firefox does not support -webkit-text-security and will render the digit
6673
- unmasked; the eye-toggle still works for revealing on WebKit/Blink. */
6674
- .dndev-pin-input__box--masked {
6675
- -webkit-text-security: disc;
6720
+ .dndev-pin-input__slots:hover .dndev-pin-input__slot {
6721
+ border-color: var(--ring);
6722
+ }
6723
+
6724
+ /* Focus ring on the active slot while the input has focus */
6725
+ .dndev-pin-input__slots:focus-within .dndev-pin-input__slot[data-active] {
6726
+ border-color: var(--ring);
6727
+ box-shadow: var(--shadow-focus);
6728
+ }
6729
+
6730
+ /* Fake caret in the empty active slot */
6731
+ .dndev-pin-input__slots:focus-within .dndev-pin-input__slot[data-caret]::after {
6732
+ content: '';
6733
+ inline-size: var(--border-hairline);
6734
+ block-size: 1em;
6735
+ background-color: var(--foreground);
6736
+ animation: dndev-pin-input-caret 1s steps(2, start) infinite;
6737
+ }
6738
+
6739
+ @keyframes dndev-pin-input-caret {
6740
+ to {
6741
+ visibility: hidden;
6742
+ }
6743
+ }
6744
+
6745
+ /* The real input: covers the slots, invisible, receives every interaction.
6746
+ 16px minimum font size: no iOS zoom on focus. */
6747
+ .dndev-pin-input__field {
6748
+ position: absolute;
6749
+ inset: 0;
6750
+ inline-size: 100%;
6751
+ block-size: 100%;
6752
+ margin: 0;
6753
+ padding: 0;
6754
+ border: 0;
6755
+ outline: 0;
6756
+ background: transparent;
6757
+ color: transparent;
6758
+ -webkit-text-fill-color: transparent;
6759
+ caret-color: transparent;
6760
+ font-size: var(--font-size-input);
6761
+ cursor: text;
6762
+ }
6763
+
6764
+ .dndev-pin-input__field::-moz-selection {
6765
+ background: transparent;
6766
+ }
6767
+
6768
+ .dndev-pin-input__field::selection {
6769
+ background: transparent;
6770
+ }
6771
+
6772
+ .dndev-pin-input__field:disabled {
6773
+ cursor: not-allowed;
6774
+ }
6775
+
6776
+ .dndev-pin-input__slots:has(.dndev-pin-input__field:disabled)
6777
+ .dndev-pin-input__slot {
6778
+ opacity: var(--opacity-muted);
6676
6779
  }
6677
6780
 
6678
6781
  .dndev-pin-input__reveal {
@@ -6736,6 +6839,11 @@ input[type='number'] {
6736
6839
  .dndev-pin-input[data-shake='true'] {
6737
6840
  animation: none;
6738
6841
  }
6842
+
6843
+ .dndev-pin-input__slots:focus-within
6844
+ .dndev-pin-input__slot[data-caret]::after {
6845
+ animation: none;
6846
+ }
6739
6847
  }
6740
6848
 
6741
6849
  /* packages/components/src/atomic/Pagination/Pagination.css */
@@ -8528,7 +8636,7 @@ input[type='number'] {
8528
8636
  .dndev-swipe-action-content {
8529
8637
  flex: 0 0 100%;
8530
8638
  min-inline-size: 0;
8531
- min-block-size: 44px;
8639
+ min-block-size: var(--touch-target);
8532
8640
  scroll-snap-align: start;
8533
8641
  background: var(--background);
8534
8642
  }
@@ -8551,8 +8659,8 @@ input[type='number'] {
8551
8659
  display: flex;
8552
8660
  align-items: center;
8553
8661
  justify-content: center;
8554
- min-inline-size: 44px;
8555
- min-block-size: 44px;
8662
+ min-inline-size: var(--touch-target);
8663
+ min-block-size: var(--touch-target);
8556
8664
  border: 0;
8557
8665
  font: inherit;
8558
8666
  cursor: pointer;
@@ -9137,34 +9245,52 @@ input[type='number'] {
9137
9245
  display: none;
9138
9246
  }
9139
9247
 
9140
- /* Reserve the complete footprint, even when zero is presented as one large +. */
9248
+ /* Collapsed: one square + at the inline end. Expanded: [ − qty + ].
9249
+ Rows are fixed in both states (no vertical shift); only the inline size animates,
9250
+ growing from the inline end toward the inline start. */
9141
9251
  .dndev-quantity-stepper {
9142
- --quantity-target: max(var(--touch-target), 44px);
9143
- /* Include both icon states, padding and inherited text BEFORE placing items.
9144
- Auto rows otherwise grow for the larger collapsed icon, then shrink on expand. */
9145
- --quantity-cell: max(
9146
- var(--quantity-target),
9147
- calc(max(var(--icon-md), var(--quantity-target) * 0.6, 1lh) + 2 * var(--gap-sm))
9148
- );
9252
+ --quantity-target: var(--touch-target);
9253
+ /* The cell IS the touch target: padding and icons fit inside it. State-independent,
9254
+ so the larger collapsed icon never changes the row; only enlarged text grows it. */
9255
+ --quantity-cell: max(var(--quantity-target), calc(1lh + 2 * var(--gap-sm)));
9256
+ /* Quantity field: three tabular digits plus breathing room. */
9257
+ --quantity-field: calc(3ch + var(--gap-sm));
9258
+ --quantity-square: calc(var(--quantity-cell) + 2 * var(--border-hairline));
9259
+ --quantity-expanded: calc(2 * var(--quantity-cell) + var(--quantity-field) + 2 * var(--border-hairline));
9149
9260
  display: inline-grid;
9150
- grid-template-columns: var(--quantity-cell) minmax(var(--quantity-cell), 1fr) var(--quantity-cell);
9261
+ /* − and the quantity shrink to nothing while collapsed or mid-transition; + is always one cell. */
9262
+ grid-template-columns: minmax(0, var(--quantity-cell)) minmax(0, var(--quantity-field)) var(--quantity-cell);
9151
9263
  grid-template-rows: var(--quantity-cell);
9152
- inline-size: calc(3 * var(--quantity-cell));
9153
- min-inline-size: calc(3 * var(--quantity-cell));
9264
+ inline-size: var(--quantity-expanded);
9265
+ min-inline-size: var(--quantity-expanded);
9154
9266
  border: var(--border-hairline) solid var(--border);
9155
9267
  border-radius: var(--radius-interactive);
9156
9268
  background: var(--interactive);
9157
9269
  color: var(--foreground);
9270
+ transition:
9271
+ inline-size var(--dur-normal) var(--ease-in-out),
9272
+ min-inline-size var(--dur-normal) var(--ease-in-out);
9273
+
9274
+ /* A clickable quantity is a target of its own: keep it at the touch target. */
9158
9275
  }
9276
+ .dndev-quantity-stepper:has( > button.dndev-quantity-stepper-value) {
9277
+ --quantity-field: max(var(--quantity-target), calc(3ch + var(--gap-sm)));
9278
+ }
9159
9279
  .dndev-quantity-stepper[data-full-width] {
9160
9280
  display: grid;
9281
+ grid-template-columns: minmax(0, var(--quantity-cell)) minmax(0, 1fr) var(--quantity-cell);
9161
9282
  inline-size: 100%;
9283
+ /* The collapsed + sits at the inline end; resolves to zero once expanded. */
9284
+ margin-inline-start: auto;
9285
+ }
9286
+ .dndev-quantity-stepper[data-collapsed]:not([data-vertical]) {
9287
+ inline-size: var(--quantity-square);
9288
+ min-inline-size: var(--quantity-square);
9162
9289
  }
9163
9290
  .dndev-quantity-stepper[data-disabled] {
9164
9291
  opacity: 0.6;
9165
9292
  }
9166
9293
  .dndev-quantity-stepper > button,.dndev-quantity-stepper > input {
9167
- min-inline-size: var(--quantity-target);
9168
9294
  min-block-size: var(--quantity-target);
9169
9295
  border: none;
9170
9296
  border-radius: inherit;
@@ -9186,9 +9312,10 @@ input[type='number'] {
9186
9312
  display: flex;
9187
9313
  align-items: center;
9188
9314
  justify-content: center;
9189
- padding: var(--gap-sm);
9315
+ /* The cell is the target: the icon centres inside it. */
9316
+ padding: 0;
9190
9317
  cursor: pointer;
9191
- transition: background-color var(--transition-fast);
9318
+ transition: background-color var(--dur-fast) var(--ease-in-out);
9192
9319
  /* Press-and-hold repeats: no text selection or touch callout on long press. */
9193
9320
  -moz-user-select: none;
9194
9321
  user-select: none;
@@ -9199,9 +9326,20 @@ input[type='number'] {
9199
9326
  background: var(--muted);
9200
9327
  }
9201
9328
  :is(.dndev-quantity-stepper > button) > svg {
9329
+ flex-shrink: 0;
9202
9330
  inline-size: var(--icon-md);
9203
9331
  block-size: var(--icon-md);
9204
9332
  }
9333
+ .dndev-quantity-stepper > .dndev-quantity-stepper-decrement,.dndev-quantity-stepper > .dndev-quantity-stepper-value {
9334
+ min-inline-size: 0;
9335
+ /* Clips the icon/digits while the track is narrower than them. The focus ring is
9336
+ the element's own box-shadow, outside its box, so it is never clipped. */
9337
+ overflow: hidden;
9338
+ transition:
9339
+ opacity var(--dur-normal) var(--ease-in-out),
9340
+ visibility var(--dur-normal) var(--ease-in-out),
9341
+ background-color var(--dur-fast) var(--ease-in-out);
9342
+ }
9205
9343
  .dndev-quantity-stepper > .dndev-quantity-stepper-decrement {
9206
9344
  grid-area: 1 / 1;
9207
9345
  }
@@ -9210,12 +9348,13 @@ input[type='number'] {
9210
9348
  }
9211
9349
  .dndev-quantity-stepper > .dndev-quantity-stepper-increment {
9212
9350
  grid-area: 1 / 3;
9351
+ min-inline-size: var(--quantity-target);
9213
9352
  }
9214
9353
  .dndev-quantity-stepper[data-vertical] {
9215
9354
  grid-template-columns: minmax(var(--quantity-cell), 1fr);
9216
9355
  grid-template-rows: repeat(3, var(--quantity-cell));
9217
- inline-size: var(--quantity-cell);
9218
- min-inline-size: var(--quantity-cell);
9356
+ inline-size: var(--quantity-square);
9357
+ min-inline-size: var(--quantity-square);
9219
9358
  }
9220
9359
  .dndev-quantity-stepper[data-vertical][data-full-width] {
9221
9360
  inline-size: 100%;
@@ -9231,15 +9370,17 @@ input[type='number'] {
9231
9370
  }
9232
9371
  .dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-decrement,.dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-value {
9233
9372
  visibility: hidden;
9373
+ opacity: 0;
9234
9374
  pointer-events: none;
9235
9375
  }
9236
- .dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-increment {
9237
- grid-area: 1 / 1 / -1 / -1;
9376
+ .dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-increment > svg {
9377
+ inline-size: calc(var(--quantity-target) * 0.6);
9378
+ block-size: calc(var(--quantity-target) * 0.6);
9238
9379
  }
9239
- :is(.dndev-quantity-stepper[data-collapsed] > .dndev-quantity-stepper-increment) > svg {
9240
- inline-size: calc(var(--quantity-target) * 0.6);
9241
- block-size: calc(var(--quantity-target) * 0.6);
9242
- }
9380
+ /* Vertical keeps its stacked footprint: the collapsed + spans all three cells. */
9381
+ .dndev-quantity-stepper[data-vertical][data-collapsed] > .dndev-quantity-stepper-increment {
9382
+ grid-area: 1 / 1 / -1 / -1;
9383
+ }
9243
9384
 
9244
9385
  .dndev-quantity-stepper-value {
9245
9386
  box-sizing: border-box;
@@ -9248,7 +9389,7 @@ input[type='number'] {
9248
9389
  justify-content: center;
9249
9390
  inline-size: 100%;
9250
9391
  min-inline-size: 0;
9251
- padding-inline: var(--gap-sm);
9392
+ padding-inline: 0;
9252
9393
  border: none;
9253
9394
  background: none;
9254
9395
  color: inherit;
@@ -9256,11 +9397,13 @@ input[type='number'] {
9256
9397
  font-weight: var(--font-weight-medium);
9257
9398
  font-variant-numeric: tabular-nums;
9258
9399
  text-align: center;
9259
-
9260
9400
  }
9261
9401
 
9262
9402
  @media (prefers-reduced-motion: reduce) {
9263
- .dndev-quantity-stepper > button {
9403
+ .dndev-quantity-stepper,
9404
+ .dndev-quantity-stepper > button,
9405
+ .dndev-quantity-stepper > .dndev-quantity-stepper-decrement,
9406
+ .dndev-quantity-stepper > .dndev-quantity-stepper-value {
9264
9407
  transition: none;
9265
9408
  }
9266
9409
  }