@lotics/ui 47.1.0 → 47.1.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/package.json +1 -1
- package/src/inline_edit.tsx +12 -2
- package/src/number_input.tsx +7 -0
- package/src/text_input_field.tsx +6 -0
package/package.json
CHANGED
package/src/inline_edit.tsx
CHANGED
|
@@ -823,7 +823,11 @@ const styles = StyleSheet.create({
|
|
|
823
823
|
// the row's own menu. With `marginLeft` alone the box grows leftward, its right
|
|
824
824
|
// edge stays on the container, and `paddingRight` still holds the text off the
|
|
825
825
|
// border.
|
|
826
|
-
|
|
826
|
+
// Stretches for the same reason `editRow` does — it is the outermost element
|
|
827
|
+
// when there are no verbs, so a right-aligned cell would size IT to content
|
|
828
|
+
// instead. The negative margin is the bare variant's deliberate 8px bleed, so
|
|
829
|
+
// the field reads 8px wider than its column by design.
|
|
830
|
+
viewBareBleed: { marginLeft: -8, alignSelf: "stretch", minWidth: 0 },
|
|
827
831
|
// The shell's own inset: the right edge tightens to 4 so an `InlineButton` sits
|
|
828
832
|
// on the surface's edge with the same air a `Chip`'s dismiss gets.
|
|
829
833
|
shell: { paddingRight: 4 },
|
|
@@ -864,7 +868,13 @@ const styles = StyleSheet.create({
|
|
|
864
868
|
// showed it — `Text` sets its own alignment — so the centring only surfaced
|
|
865
869
|
// once `display` accepted a node and rendered prose that inherited it.
|
|
866
870
|
viewNode: { flex: 1, minWidth: 0, textAlign: "left" },
|
|
867
|
-
|
|
871
|
+
// `alignSelf: stretch` because an inline edit takes its width from the COLUMN
|
|
872
|
+
// it sits in, never from what it happens to contain. Without it a right-aligned
|
|
873
|
+
// cell (`alignItems: flex-end`) sizes this row to its content, and in edit mode
|
|
874
|
+
// the content is a native `<input>`, whose default `size=20` is ~236px it will
|
|
875
|
+
// not shrink below. In a 104px quantity column that overflowed 132px LEFTWARD —
|
|
876
|
+
// pinned to the cell's right edge, spilling across the column beside it.
|
|
877
|
+
editRow: { flexDirection: "row", alignItems: "flex-start", gap: 6, alignSelf: "stretch", minWidth: 0 },
|
|
868
878
|
editControl: { flex: 1, position: "relative" },
|
|
869
879
|
// The input brings its own 40px height, so the surface must not add its resting
|
|
870
880
|
// vertical padding on top — that was a 12px jump the moment the field focused.
|
package/src/number_input.tsx
CHANGED
|
@@ -73,6 +73,13 @@ export function NumberInput(props: NumberInputProps) {
|
|
|
73
73
|
autoFocus={autoFocus}
|
|
74
74
|
style={{
|
|
75
75
|
height: 40,
|
|
76
|
+
// A native input carries `size=20` — about 236px of intrinsic width it
|
|
77
|
+
// refuses to shrink below, because a flex item's `min-width` defaults to
|
|
78
|
+
// `auto`. In any column narrower than that the field overflowed rather
|
|
79
|
+
// than fitting. Width comes from the container; the input never states
|
|
80
|
+
// its own.
|
|
81
|
+
width: "100%",
|
|
82
|
+
minWidth: 0,
|
|
76
83
|
paddingLeft: seamless ? 0 : 8,
|
|
77
84
|
paddingRight: seamless ? 0 : 8,
|
|
78
85
|
borderRadius: CONTROL_RADIUS,
|
package/src/text_input_field.tsx
CHANGED
|
@@ -291,6 +291,12 @@ const styles = StyleSheet.create({
|
|
|
291
291
|
// overrides via `style` (it lands after this in the array).
|
|
292
292
|
backgroundColor: colors.white,
|
|
293
293
|
height: 40,
|
|
294
|
+
// Same reason `NumberInput` states it: a native input carries `size=20`,
|
|
295
|
+
// about 236px of intrinsic width, and a flex item's `min-width` defaults to
|
|
296
|
+
// `auto` — so in any column narrower than that the field overflows instead
|
|
297
|
+
// of fitting. Width comes from the container; the input never states its own.
|
|
298
|
+
width: "100%",
|
|
299
|
+
minWidth: 0,
|
|
294
300
|
paddingVertical: INPUT_PADDING_Y,
|
|
295
301
|
paddingHorizontal: 8,
|
|
296
302
|
fontFamily: fontFamilyRegular,
|