Skip to content

Commit 4bda068

Browse files
committed
feat(NumberInput): on iOS the steppers are one UIStepper-style control beside the field
In the iOS touch idiom (a coarse pointer in WebKit on iOS or iPadOS: the resolver's two nested keys, `@media (pointer: coarse)` around `@supports (-webkit-touch-callout: none)`, so it paints before hydration) the number steppers leave the field and sit beside it as one control shaped like iOS 26's UIStepper, its shape measured on iOS 26.2 (motion/uikit/stepper.ts `look`): a 94 x 32 capsule, 8px past the field's inline end, two 47px halves with − on the left and + on the right in either writing direction, a centred 1 x 24 divider, and 13pt glyphs with 1.67pt strokes drawn as vector paths. The colours are the theme's: the neutral fill SegmentedControl uses for its track, the track colour for the divider and a disabled glyph, the primary icon colour for the glyphs, and the pressed overlay for the touched half. The Field box gives up the control's width and a gap at its inline end (the input box takes its own end padding back), so an attached status still lines up with the input. A Field box narrower than 170 px (the control, the gap and a box that still shows a few digits), whether a numeric width says so or a measurement does, keeps the column inside it, as an InputGroup and a horizontal-labels FormLayout (no Field box) do. Material has no stepper, so Android and every other touch screen keep the compact column, as do a mouse and an InputGroup. The column's chevrons sit in a wrapper that adds no box, hidden in the iOS idiom, so nothing merges into the icon and its own display survives. Every touch style's default is a value, never null (a null default would erase the same property of a style merged before it): the base's where it sets one, the CSS initial value elsewhere; a desktop computed-style test holds that. The half under a finger is now the one whose centre is nearer, so the same tracking serves the column and the side-by-side halves. The specs run the control in the iOS idiom (emulated, iosWebKit.ts) and check that Android, a mouse and an InputGroup keep the column.
1 parent a76cd60 commit 4bda068

10 files changed

Lines changed: 1398 additions & 47 deletions
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[feat] NumberInput: on iPhone and iPad the number steppers sit beside the field as one control shaped like the iOS stepper: a 94 × 32 capsule with − on the left and + on the right in either writing direction, a divider between them, and the theme's neutral fill and icon colours. The pressed half darkens at once, and a finger can slide across the divider. The field gives up the control's width and a gap, so an attached status still lines up with the input; a field narrower than 170 px keeps the steppers inside it. On Android and other touch screens (Material has no stepper), with a mouse, and inside an InputGroup, the steppers stay in the field as before.
6+
7+
@vjeux

‎packages/core/src/NumberInput/NumberInput.doc.mjs‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,12 +226,14 @@ export const docs = {
226226
{
227227
name: 'containerClassName',
228228
type: 'string',
229-
description: 'Class name for the field container. Same targeting as `containerXstyle`.',
229+
description:
230+
'Class name for the field container. Same targeting as `containerXstyle`.',
230231
},
231232
{
232233
name: 'containerStyle',
233234
type: 'CSSProperties',
234-
description: 'Inline styles for the field container. Same targeting as `containerXstyle`.',
235+
description:
236+
'Inline styles for the field container. Same targeting as `containerXstyle`.',
235237
},
236238
{
237239
name: 'controlXstyle',
@@ -336,7 +338,7 @@ export const docs = {
336338
name: 'Number steppers',
337339
required: false,
338340
description:
339-
'Optional buttons that increment or decrement by the configured step. On iPhone and iPad a tap steps once when the finger lifts, and a button held down keeps stepping: after half a second, then faster after three seconds, until the finger lifts or slides off.',
341+
'Optional buttons that increment or decrement by the configured step. On iPhone and iPad they sit beside the field as one control, − on the left and + on the right, as on iOS (inside an InputGroup, or in a field narrower than 170 px, they stay in the field). A tap steps once when the finger lifts, and a button held down keeps stepping: after half a second, then faster after three seconds, until the finger lifts or slides off.',
340342
},
341343
],
342344
},
@@ -641,7 +643,7 @@ export const docsZh = {
641643
name: 'Number steppers',
642644
required: false,
643645
description:
644-
'Optional buttons that increment or decrement by the configured step. On iPhone and iPad a tap steps once when the finger lifts, and a button held down keeps stepping: after half a second, then faster after three seconds, until the finger lifts or slides off.',
646+
'Optional buttons that increment or decrement by the configured step. On iPhone and iPad they sit beside the field as one control, − on the left and + on the right, as on iOS (inside an InputGroup, or in a field narrower than 170 px, they stay in the field). A tap steps once when the finger lifts, and a button held down keeps stepping: after half a second, then faster after three seconds, until the finger lifts or slides off.',
645647
},
646648
],
647649
},
@@ -715,15 +717,17 @@ export const docsDense = {
715717
name: 'Number steppers',
716718
required: false,
717719
description:
718-
'Optional buttons that increment or decrement by the configured step. On iPhone and iPad a tap steps once when the finger lifts, and a button held down keeps stepping: after half a second, then faster after three seconds, until the finger lifts or slides off.',
720+
'Optional buttons that increment or decrement by the configured step. On iPhone and iPad they sit beside the field as one control, − on the left and + on the right, as on iOS (inside an InputGroup, or in a field narrower than 170 px, they stay in the field). A tap steps once when the finger lifts, and a button held down keeps stepping: after half a second, then faster after three seconds, until the finger lifts or slides off.',
719721
},
720722
],
721723
},
722724
propDescriptions: {
723-
containerXstyle: 'StyleX styles for the field container; no effect in InputGroup or horizontal-labels FormLayout. No root xstyle/className/style.',
725+
containerXstyle:
726+
'StyleX styles for the field container; no effect in InputGroup or horizontal-labels FormLayout. No root xstyle/className/style.',
724727
containerClassName: 'Class name for the field container.',
725728
containerStyle: 'Inline styles for the field container.',
726-
controlXstyle: 'StyleX styles for the visual control box (border, background, icons); not the native input.',
729+
controlXstyle:
730+
'StyleX styles for the visual control box (border, background, icons); not the native input.',
727731
controlClassName: 'Class name for the visual control box.',
728732
controlStyle: 'Inline styles for the visual control box.',
729733
label: 'Label text (always rendered for accessibility).',

0 commit comments

Comments
 (0)