@dloizides/ui-forms 1.25.1 → 1.26.0
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/CHANGELOG.md +9 -0
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.26.0
|
|
4
|
+
|
|
5
|
+
INVOICE-3 "Invoice interface over a user-chosen folder": owner picks.
|
|
6
|
+
|
|
7
|
+
- `SelectControl` trigger fills with `surfaceElevated`, like an editable field, so it differs from read-only.
|
|
8
|
+
- Read-only `useThemedInput` draws the rest border, so the box shows on a form of the same fill.
|
|
9
|
+
- Placeholder is solid `textSecondary`: 0.6 alpha measured 2.38 against the 4.5 AA floor.
|
|
10
|
+
- `FormField` gains `inputRef`.
|
|
11
|
+
|
|
3
12
|
## 1.25.0
|
|
4
13
|
|
|
5
14
|
INVOICE-3 "Invoice interface over a user-chosen folder": extracted from invoice-web.
|
package/dist/index.d.mts
CHANGED
|
@@ -438,8 +438,10 @@ interface FormFieldProps extends Omit<TextInputProps, 'style'> {
|
|
|
438
438
|
recentKey?: string;
|
|
439
439
|
/** Cap on remembered values when {@link recentKey} is set (most-recent-first). Default 10. */
|
|
440
440
|
recentMax?: number;
|
|
441
|
+
/** Reaches the input, for focusing it without scrolling the page. Not forwarded when `recentKey` is set. */
|
|
442
|
+
inputRef?: React.Ref<TextInput>;
|
|
441
443
|
}
|
|
442
|
-
declare const FormField: ({ label, labelHidden, required, error, containerStyle, recentKey, recentMax, ...textInputProps }: FormFieldProps) => React.ReactElement;
|
|
444
|
+
declare const FormField: ({ label, labelHidden, required, error, containerStyle, recentKey, recentMax, inputRef, ...textInputProps }: FormFieldProps) => React.ReactElement;
|
|
443
445
|
|
|
444
446
|
/**
|
|
445
447
|
* `ThemedTextInput` — the shared, readable + lively text-input primitive. A thin `<TextInput>`
|
package/dist/index.d.ts
CHANGED
|
@@ -438,8 +438,10 @@ interface FormFieldProps extends Omit<TextInputProps, 'style'> {
|
|
|
438
438
|
recentKey?: string;
|
|
439
439
|
/** Cap on remembered values when {@link recentKey} is set (most-recent-first). Default 10. */
|
|
440
440
|
recentMax?: number;
|
|
441
|
+
/** Reaches the input, for focusing it without scrolling the page. Not forwarded when `recentKey` is set. */
|
|
442
|
+
inputRef?: React.Ref<TextInput>;
|
|
441
443
|
}
|
|
442
|
-
declare const FormField: ({ label, labelHidden, required, error, containerStyle, recentKey, recentMax, ...textInputProps }: FormFieldProps) => React.ReactElement;
|
|
444
|
+
declare const FormField: ({ label, labelHidden, required, error, containerStyle, recentKey, recentMax, inputRef, ...textInputProps }: FormFieldProps) => React.ReactElement;
|
|
443
445
|
|
|
444
446
|
/**
|
|
445
447
|
* `ThemedTextInput` — the shared, readable + lively text-input primitive. A thin `<TextInput>`
|
package/dist/index.js
CHANGED
|
@@ -813,7 +813,6 @@ var TRANSITION_DURATION = "0.14s";
|
|
|
813
813
|
var TRANSITION_TIMING = "ease";
|
|
814
814
|
var NO_RING = { outlineWidth: 0 };
|
|
815
815
|
var HOVER_BORDER_ALPHA = 0.22;
|
|
816
|
-
var PLACEHOLDER_ALPHA = 0.6;
|
|
817
816
|
var HEX_RADIX = 16;
|
|
818
817
|
var HEX_SHORT_LENGTH = 4;
|
|
819
818
|
var HEX_FULL_LENGTH = 7;
|
|
@@ -863,8 +862,7 @@ function useThemedInput(options = {}) {
|
|
|
863
862
|
const restBorder = hasError ? errorColor : colors.border;
|
|
864
863
|
const focusBorder = hasError ? errorColor : primary;
|
|
865
864
|
const editableBorder = isFocused ? focusBorder : isHovered ? withAlpha(colors.text, HOVER_BORDER_ALPHA) : restBorder;
|
|
866
|
-
const
|
|
867
|
-
const borderColor = editable ? editableBorder : readOnlyBorder;
|
|
865
|
+
const borderColor = editable ? editableBorder : restBorder;
|
|
868
866
|
const editableFill = isFocused ? colors.surface : colors.surfaceElevated;
|
|
869
867
|
const backgroundColor = editable ? editableFill : colors.surface;
|
|
870
868
|
const base = { color: editable ? colors.text : colors.textSecondary, borderColor, backgroundColor };
|
|
@@ -901,7 +899,7 @@ function useThemedInput(options = {}) {
|
|
|
901
899
|
);
|
|
902
900
|
return {
|
|
903
901
|
style,
|
|
904
|
-
placeholderTextColor:
|
|
902
|
+
placeholderTextColor: colors.textSecondary,
|
|
905
903
|
isFocused,
|
|
906
904
|
isHovered,
|
|
907
905
|
focusBind,
|
|
@@ -1144,6 +1142,7 @@ var FormField = ({
|
|
|
1144
1142
|
containerStyle,
|
|
1145
1143
|
recentKey,
|
|
1146
1144
|
recentMax,
|
|
1145
|
+
inputRef,
|
|
1147
1146
|
...textInputProps
|
|
1148
1147
|
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1149
1148
|
Field,
|
|
@@ -1163,7 +1162,7 @@ var FormField = ({
|
|
|
1163
1162
|
testID: "form-field-input",
|
|
1164
1163
|
...textInputProps
|
|
1165
1164
|
};
|
|
1166
|
-
return recentKey !== void 0 && recentKey !== "" ? /* @__PURE__ */ jsxRuntime.jsx(RecentInputField, { label, recentKey, recentMax, ...inputProps }) : /* @__PURE__ */ jsxRuntime.jsx(ThemedTextInput, { ...inputProps });
|
|
1165
|
+
return recentKey !== void 0 && recentKey !== "" ? /* @__PURE__ */ jsxRuntime.jsx(RecentInputField, { label, recentKey, recentMax, ...inputProps }) : /* @__PURE__ */ jsxRuntime.jsx(ThemedTextInput, { ref: inputRef, ...inputProps });
|
|
1167
1166
|
}
|
|
1168
1167
|
}
|
|
1169
1168
|
);
|
|
@@ -1744,7 +1743,7 @@ function SelectControl({
|
|
|
1744
1743
|
"aria-expanded": isOpen,
|
|
1745
1744
|
"aria-labelledby": labelledById,
|
|
1746
1745
|
onPress: toggle,
|
|
1747
|
-
style: [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.
|
|
1746
|
+
style: [controlStyles.selectTrigger, { borderColor: colors.border, backgroundColor: colors.surfaceElevated }],
|
|
1748
1747
|
testID: `${testID}-trigger`,
|
|
1749
1748
|
children: [
|
|
1750
1749
|
/* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { numberOfLines: 1, style: [controlStyles.selectTriggerText, { color: value === "" ? colors.textSecondary : colors.text }], children: selectedLabel }),
|