@vellira-ui/react-native 2.44.4 → 2.45.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/dist/index.d.ts +1 -1
- package/dist/index.js +175 -122
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export type { TabsContentProps, TabsListProps, TabsProps, TabsTriggerProps, } fr
|
|
|
10
10
|
export { Tabs } from './components/Tabs';
|
|
11
11
|
export type { TooltipContentProps, TooltipProps, TooltipRootProps, TooltipTriggerProps, } from './components/Tooltip';
|
|
12
12
|
export { Tooltip } from './components/Tooltip';
|
|
13
|
-
export type { FormFieldProps } from './patterns/FormField';
|
|
13
|
+
export type { FormFieldControlProps, FormFieldDescriptionProps, FormFieldLabelProps, FormFieldMessageProps, FormFieldProps, } from './patterns/FormField';
|
|
14
14
|
export { FormField } from './patterns/FormField';
|
|
15
15
|
export type { ButtonProps } from './primitives/Button';
|
|
16
16
|
export { Button } from './primitives/Button';
|
package/dist/index.js
CHANGED
|
@@ -1789,7 +1789,7 @@ const createStyles$10 = (theme) => StyleSheet.create({
|
|
|
1789
1789
|
alignItems: "flex-start",
|
|
1790
1790
|
gap: theme.tokens.spacing[2]
|
|
1791
1791
|
},
|
|
1792
|
-
pressablePressed: { opacity: .
|
|
1792
|
+
pressablePressed: { opacity: theme.components.radio.motion.pressedOpacity },
|
|
1793
1793
|
pressableDisabled: { opacity: 1 },
|
|
1794
1794
|
control: {
|
|
1795
1795
|
alignItems: "center",
|
|
@@ -1799,14 +1799,6 @@ const createStyles$10 = (theme) => StyleSheet.create({
|
|
|
1799
1799
|
borderColor: theme.components.radio.default.border,
|
|
1800
1800
|
backgroundColor: theme.components.radio.default.bg
|
|
1801
1801
|
},
|
|
1802
|
-
controlChecked: {
|
|
1803
|
-
borderColor: theme.components.radio.primary.default.border,
|
|
1804
|
-
backgroundColor: theme.components.radio.primary.default.bg
|
|
1805
|
-
},
|
|
1806
|
-
controlCheckedPressed: {
|
|
1807
|
-
borderColor: theme.components.radio.primary.pressed.border,
|
|
1808
|
-
backgroundColor: theme.components.radio.primary.pressed.bg
|
|
1809
|
-
},
|
|
1810
1802
|
controlInvalid: { borderColor: theme.components.radio.invalid.border },
|
|
1811
1803
|
controlDisabled: {
|
|
1812
1804
|
borderColor: theme.components.radio.disabled.border,
|
|
@@ -1820,7 +1812,6 @@ const createStyles$10 = (theme) => StyleSheet.create({
|
|
|
1820
1812
|
borderRadius: theme.tokens.radius.full,
|
|
1821
1813
|
backgroundColor: theme.components.radio.primary.default.fg
|
|
1822
1814
|
},
|
|
1823
|
-
indicatorPressed: { backgroundColor: theme.components.radio.primary.pressed.fg },
|
|
1824
1815
|
indicatorDisabled: { backgroundColor: theme.components.radio.selectedDisabled.fg },
|
|
1825
1816
|
content: {
|
|
1826
1817
|
flexShrink: 1,
|
|
@@ -1830,8 +1821,6 @@ const createStyles$10 = (theme) => StyleSheet.create({
|
|
|
1830
1821
|
color: theme.components.radio.default.fg,
|
|
1831
1822
|
fontFamily: theme.tokens.typography.family.regular
|
|
1832
1823
|
},
|
|
1833
|
-
labelChecked: { color: theme.components.radio.primary.default.labelFg },
|
|
1834
|
-
labelCheckedPressed: { color: theme.components.radio.primary.pressed.labelFg },
|
|
1835
1824
|
labelInvalid: { color: theme.components.radio.invalid.fg },
|
|
1836
1825
|
description: {
|
|
1837
1826
|
color: theme.components.formField.description.fg,
|
|
@@ -1845,16 +1834,6 @@ const createStyles$10 = (theme) => StyleSheet.create({
|
|
|
1845
1834
|
});
|
|
1846
1835
|
//#endregion
|
|
1847
1836
|
//#region src/primitives/Radio/Radio.tsx
|
|
1848
|
-
const controlSizeBySize = {
|
|
1849
|
-
sm: 14,
|
|
1850
|
-
md: 16,
|
|
1851
|
-
lg: 20
|
|
1852
|
-
};
|
|
1853
|
-
const indicatorSizeBySize = {
|
|
1854
|
-
sm: 6,
|
|
1855
|
-
md: 8,
|
|
1856
|
-
lg: 10
|
|
1857
|
-
};
|
|
1858
1837
|
const nativePointerEventsNone$4 = Platform.OS === "web" ? void 0 : { pointerEvents: "none" };
|
|
1859
1838
|
const webPointerEventsNone$4 = Platform.OS === "web" ? { pointerEvents: "none" } : void 0;
|
|
1860
1839
|
const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: disabledProp = false, required: requiredProp = false, size: sizeProp, color: colorProp, onCheckedChange, label, description, icon, error, accessibilityLabel, accessibilityHint, containerStyle, labelStyle, descriptionStyle, errorStyle, style, ...rest }, ref) => {
|
|
@@ -1874,29 +1853,8 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
|
|
|
1874
1853
|
const resolvedSize = sizeProp ?? group?.size ?? "md";
|
|
1875
1854
|
const resolvedColor = colorProp ?? group?.color ?? "primary";
|
|
1876
1855
|
const radioColor = theme.components.radio[resolvedColor];
|
|
1877
|
-
const
|
|
1878
|
-
const
|
|
1879
|
-
const typographySize = {
|
|
1880
|
-
sm: {
|
|
1881
|
-
labelSize: theme.tokens.typography.size.sm,
|
|
1882
|
-
labelLineHeight: theme.tokens.typography.lineHeight.sm,
|
|
1883
|
-
descriptionSize: theme.tokens.typography.size.xs,
|
|
1884
|
-
descriptionLineHeight: theme.tokens.typography.lineHeight.xs
|
|
1885
|
-
},
|
|
1886
|
-
md: {
|
|
1887
|
-
labelSize: theme.tokens.typography.size.md,
|
|
1888
|
-
labelLineHeight: theme.tokens.typography.lineHeight.md,
|
|
1889
|
-
descriptionSize: theme.tokens.typography.size.sm,
|
|
1890
|
-
descriptionLineHeight: theme.tokens.typography.lineHeight.sm
|
|
1891
|
-
},
|
|
1892
|
-
lg: {
|
|
1893
|
-
labelSize: theme.tokens.typography.size.lg,
|
|
1894
|
-
labelLineHeight: theme.tokens.typography.lineHeight.lg,
|
|
1895
|
-
descriptionSize: theme.tokens.typography.size.md,
|
|
1896
|
-
descriptionLineHeight: theme.tokens.typography.lineHeight.md
|
|
1897
|
-
}
|
|
1898
|
-
}[resolvedSize];
|
|
1899
|
-
const controlMarginTop = (typographySize.labelLineHeight - controlSize) / 2;
|
|
1856
|
+
const radioSize = theme.components.radio.size[resolvedSize];
|
|
1857
|
+
const controlMarginTop = (radioSize.labelLineHeight - radioSize.controlSize) / 2;
|
|
1900
1858
|
useEffect(() => {
|
|
1901
1859
|
if (typeof __DEV__ !== "undefined" && __DEV__ && !label && !accessibilityLabel) console.warn("Radio requires either a visible label or accessibilityLabel.");
|
|
1902
1860
|
}, [accessibilityLabel, label]);
|
|
@@ -1941,8 +1899,8 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
|
|
|
1941
1899
|
styles.control,
|
|
1942
1900
|
webPointerEventsNone$4,
|
|
1943
1901
|
{
|
|
1944
|
-
width: controlSize,
|
|
1945
|
-
height: controlSize,
|
|
1902
|
+
width: radioSize.controlSize,
|
|
1903
|
+
height: radioSize.controlSize,
|
|
1946
1904
|
marginTop: controlMarginTop
|
|
1947
1905
|
},
|
|
1948
1906
|
resolvedChecked && {
|
|
@@ -1952,7 +1910,7 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
|
|
|
1952
1910
|
resolvedChecked && state.pressed && !resolvedDisabled && {
|
|
1953
1911
|
backgroundColor: radioColor.pressed.bg,
|
|
1954
1912
|
borderColor: radioColor.pressed.border,
|
|
1955
|
-
transform: [{ scale: .
|
|
1913
|
+
transform: [{ scale: theme.components.radio.motion.pressedScale }]
|
|
1956
1914
|
},
|
|
1957
1915
|
resolvedInvalid && styles.controlInvalid,
|
|
1958
1916
|
resolvedDisabled && styles.controlDisabled,
|
|
@@ -1961,8 +1919,8 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
|
|
|
1961
1919
|
children: resolvedChecked && (icon ?? /* @__PURE__ */ jsx(View, { style: [
|
|
1962
1920
|
styles.indicator,
|
|
1963
1921
|
{
|
|
1964
|
-
width: indicatorSize,
|
|
1965
|
-
height: indicatorSize,
|
|
1922
|
+
width: radioSize.indicatorSize,
|
|
1923
|
+
height: radioSize.indicatorSize,
|
|
1966
1924
|
backgroundColor: state.pressed && !resolvedDisabled ? radioColor.pressed.fg : radioColor.default.fg
|
|
1967
1925
|
},
|
|
1968
1926
|
resolvedDisabled && styles.indicatorDisabled
|
|
@@ -1974,8 +1932,8 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
|
|
|
1974
1932
|
style: [
|
|
1975
1933
|
styles.label,
|
|
1976
1934
|
{
|
|
1977
|
-
fontSize:
|
|
1978
|
-
lineHeight:
|
|
1935
|
+
fontSize: radioSize.labelFontSize,
|
|
1936
|
+
lineHeight: radioSize.labelLineHeight
|
|
1979
1937
|
},
|
|
1980
1938
|
resolvedChecked && { color: radioColor.default.labelFg },
|
|
1981
1939
|
resolvedChecked && state.pressed && !resolvedDisabled && { color: radioColor.pressed.labelFg },
|
|
@@ -1988,8 +1946,8 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
|
|
|
1988
1946
|
style: [
|
|
1989
1947
|
styles.description,
|
|
1990
1948
|
{
|
|
1991
|
-
fontSize:
|
|
1992
|
-
lineHeight:
|
|
1949
|
+
fontSize: radioSize.descriptionFontSize,
|
|
1950
|
+
lineHeight: radioSize.descriptionLineHeight
|
|
1993
1951
|
},
|
|
1994
1952
|
resolvedDisabled && styles.textDisabled,
|
|
1995
1953
|
descriptionStyle
|
|
@@ -2002,9 +1960,9 @@ const Radio = forwardRef(({ value, checked, defaultChecked = false, disabled: di
|
|
|
2002
1960
|
style: [
|
|
2003
1961
|
styles.error,
|
|
2004
1962
|
{
|
|
2005
|
-
marginLeft: controlSize + theme.tokens.spacing[2],
|
|
2006
|
-
fontSize:
|
|
2007
|
-
lineHeight:
|
|
1963
|
+
marginLeft: radioSize.controlSize + theme.tokens.spacing[2],
|
|
1964
|
+
fontSize: radioSize.descriptionFontSize,
|
|
1965
|
+
lineHeight: radioSize.descriptionLineHeight
|
|
2008
1966
|
},
|
|
2009
1967
|
errorStyle
|
|
2010
1968
|
],
|
|
@@ -2037,6 +1995,13 @@ const createStyles$9 = (theme) => StyleSheet.create({
|
|
|
2037
1995
|
fontWeight: fontWeight$2(theme.tokens.typography.weight.medium),
|
|
2038
1996
|
lineHeight: theme.components.formField.size.md.labelLineHeight
|
|
2039
1997
|
},
|
|
1998
|
+
labelRow: {
|
|
1999
|
+
flexDirection: "row",
|
|
2000
|
+
justifyContent: "space-between",
|
|
2001
|
+
alignItems: "flex-start",
|
|
2002
|
+
gap: theme.components.formField.size.md.gap
|
|
2003
|
+
},
|
|
2004
|
+
labelAction: { flexShrink: 0 },
|
|
2040
2005
|
labelDisabled: { color: theme.components.formField.disabled.labelFg },
|
|
2041
2006
|
required: {
|
|
2042
2007
|
marginLeft: theme.tokens.spacing[1],
|
|
@@ -2073,12 +2038,15 @@ const createStyles$9 = (theme) => StyleSheet.create({
|
|
|
2073
2038
|
minWidth: 0,
|
|
2074
2039
|
alignSelf: "stretch"
|
|
2075
2040
|
},
|
|
2076
|
-
|
|
2077
|
-
color: theme.components.formField.helperText.
|
|
2041
|
+
message: {
|
|
2042
|
+
color: theme.components.formField.helperText.default.fg,
|
|
2078
2043
|
fontFamily: theme.tokens.typography.family.regular,
|
|
2079
2044
|
fontSize: theme.components.formField.size.md.helperTextFontSize,
|
|
2080
2045
|
lineHeight: theme.components.formField.size.md.helperTextLineHeight
|
|
2081
2046
|
},
|
|
2047
|
+
messageSuccess: { color: theme.components.formField.helperText.success.fg },
|
|
2048
|
+
messageWarning: { color: theme.components.formField.helperText.warning.fg },
|
|
2049
|
+
messageDanger: { color: theme.components.formField.helperText.error.fg },
|
|
2082
2050
|
helperTextDisabled: { color: theme.components.formField.disabled.helperTextFg }
|
|
2083
2051
|
});
|
|
2084
2052
|
//#endregion
|
|
@@ -2087,29 +2055,92 @@ const FormFieldContext = createContext(null);
|
|
|
2087
2055
|
const useFormFieldContext = () => useContext(FormFieldContext);
|
|
2088
2056
|
//#endregion
|
|
2089
2057
|
//#region src/patterns/FormField/FormField.tsx
|
|
2090
|
-
function
|
|
2058
|
+
function createFormFieldSlot(name, displayName) {
|
|
2059
|
+
const Slot = () => null;
|
|
2060
|
+
Slot.__velliraFormFieldPart = name;
|
|
2061
|
+
Slot.displayName = displayName;
|
|
2062
|
+
return Slot;
|
|
2063
|
+
}
|
|
2064
|
+
function parseFormFieldChildren(children) {
|
|
2065
|
+
const fallbackChildren = [];
|
|
2066
|
+
const parsed = { hasSlots: false };
|
|
2067
|
+
Children.forEach(children, (child) => {
|
|
2068
|
+
if (!isValidElement(child)) {
|
|
2069
|
+
if (child !== null && child !== void 0 && child !== false) fallbackChildren.push(child);
|
|
2070
|
+
return;
|
|
2071
|
+
}
|
|
2072
|
+
switch (child.type.__velliraFormFieldPart) {
|
|
2073
|
+
case "label":
|
|
2074
|
+
parsed.hasSlots = true;
|
|
2075
|
+
parsed.label = child.props;
|
|
2076
|
+
return;
|
|
2077
|
+
case "description":
|
|
2078
|
+
parsed.hasSlots = true;
|
|
2079
|
+
parsed.description = child.props;
|
|
2080
|
+
return;
|
|
2081
|
+
case "control":
|
|
2082
|
+
parsed.hasSlots = true;
|
|
2083
|
+
parsed.control = child.props;
|
|
2084
|
+
return;
|
|
2085
|
+
case "message":
|
|
2086
|
+
parsed.hasSlots = true;
|
|
2087
|
+
parsed.message = child.props;
|
|
2088
|
+
return;
|
|
2089
|
+
default: fallbackChildren.push(child);
|
|
2090
|
+
}
|
|
2091
|
+
});
|
|
2092
|
+
if (fallbackChildren.length > 0) parsed.fallbackChildren = fallbackChildren.length === 1 ? fallbackChildren[0] : fallbackChildren;
|
|
2093
|
+
return parsed;
|
|
2094
|
+
}
|
|
2095
|
+
function FormFieldRoot({ id, label, description, error, message, messageTone, messageLive, required = false, disabled = false, invalid = false, size = "md", labelInfo, labelAction, optionalText, children, style, controlStyle, labelStyle, descriptionStyle, errorStyle, messageStyle, ...rest }) {
|
|
2096
|
+
const parsedChildren = parseFormFieldChildren(children);
|
|
2097
|
+
const resolvedLabel = label ?? parsedChildren.label?.children;
|
|
2098
|
+
const resolvedDescription = description ?? parsedChildren.description?.children;
|
|
2099
|
+
const resolvedMessage = message ?? parsedChildren.message?.children;
|
|
2100
|
+
const resolvedMessageTone = messageTone ?? parsedChildren.message?.tone ?? "neutral";
|
|
2101
|
+
const resolvedMessageLive = messageLive ?? parsedChildren.message?.live ?? "off";
|
|
2102
|
+
const resolvedLabelInfo = labelInfo ?? parsedChildren.label?.info;
|
|
2103
|
+
const resolvedLabelAction = labelAction ?? parsedChildren.label?.action;
|
|
2104
|
+
const resolvedOptionalText = optionalText ?? parsedChildren.label?.optionalText;
|
|
2105
|
+
const resolvedChildren = parsedChildren.hasSlots ? parsedChildren.control?.children ?? parsedChildren.fallbackChildren : children;
|
|
2091
2106
|
const { theme } = useTheme();
|
|
2092
2107
|
const styles = useThemeStyles(createStyles$9);
|
|
2093
2108
|
const sizeTokens = theme.components.formField.size[size];
|
|
2094
2109
|
const generatedId = useId();
|
|
2095
2110
|
const controlId = id ?? generatedId;
|
|
2096
|
-
const labelId =
|
|
2097
|
-
const descriptionId =
|
|
2111
|
+
const labelId = resolvedLabel ? `${controlId}-label` : void 0;
|
|
2112
|
+
const descriptionId = resolvedDescription ? `${controlId}-description` : void 0;
|
|
2098
2113
|
const errorId = error ? `${controlId}-error` : void 0;
|
|
2114
|
+
const messageId = !error && resolvedMessage ? `${controlId}-message` : void 0;
|
|
2115
|
+
const isInvalid = invalid || Boolean(error);
|
|
2116
|
+
const visibleMessage = error ?? resolvedMessage;
|
|
2117
|
+
const visibleTone = error ? "danger" : resolvedMessageTone;
|
|
2099
2118
|
const contextValue = {
|
|
2100
2119
|
controlId,
|
|
2101
2120
|
labelId,
|
|
2102
2121
|
descriptionId,
|
|
2103
2122
|
errorId,
|
|
2123
|
+
messageId,
|
|
2104
2124
|
description,
|
|
2105
2125
|
error,
|
|
2126
|
+
message: resolvedMessage,
|
|
2106
2127
|
required,
|
|
2107
2128
|
disabled,
|
|
2108
|
-
invalid:
|
|
2129
|
+
invalid: isInvalid,
|
|
2109
2130
|
size,
|
|
2110
2131
|
ariaLabelledBy: labelId,
|
|
2111
|
-
ariaDescribedBy: [
|
|
2132
|
+
ariaDescribedBy: [
|
|
2133
|
+
descriptionId,
|
|
2134
|
+
errorId,
|
|
2135
|
+
messageId
|
|
2136
|
+
].filter(Boolean).join(" ") || void 0
|
|
2112
2137
|
};
|
|
2138
|
+
const messageToneStyle = {
|
|
2139
|
+
neutral: void 0,
|
|
2140
|
+
success: styles.messageSuccess,
|
|
2141
|
+
warning: styles.messageWarning,
|
|
2142
|
+
danger: styles.messageDanger
|
|
2143
|
+
}[visibleTone];
|
|
2113
2144
|
return /* @__PURE__ */ jsxs(View, {
|
|
2114
2145
|
...rest,
|
|
2115
2146
|
accessibilityState: disabled ? { disabled: true } : void 0,
|
|
@@ -2119,54 +2150,61 @@ function FormField({ id, label, description, error, required = false, disabled =
|
|
|
2119
2150
|
style
|
|
2120
2151
|
],
|
|
2121
2152
|
children: [
|
|
2122
|
-
|
|
2123
|
-
style: [
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2153
|
+
(resolvedLabel || resolvedLabelAction) && /* @__PURE__ */ jsxs(View, {
|
|
2154
|
+
style: [styles.labelRow, { gap: sizeTokens.gap }],
|
|
2155
|
+
children: [resolvedLabel && (typeof resolvedLabel === "string" || typeof resolvedLabel === "number" ? /* @__PURE__ */ jsxs(Text, {
|
|
2156
|
+
style: [
|
|
2157
|
+
styles.label,
|
|
2158
|
+
{
|
|
2159
|
+
fontSize: sizeTokens.labelFontSize,
|
|
2160
|
+
lineHeight: sizeTokens.labelLineHeight
|
|
2161
|
+
},
|
|
2162
|
+
disabled && styles.labelDisabled,
|
|
2163
|
+
parsedChildren.label?.style,
|
|
2164
|
+
labelStyle
|
|
2165
|
+
],
|
|
2166
|
+
children: [
|
|
2167
|
+
resolvedLabel,
|
|
2168
|
+
required && /* @__PURE__ */ jsx(Text, {
|
|
2169
|
+
style: styles.required,
|
|
2170
|
+
accessible: false,
|
|
2171
|
+
importantForAccessibility: "no",
|
|
2172
|
+
children: " *"
|
|
2173
|
+
}),
|
|
2174
|
+
!required && resolvedOptionalText && /* @__PURE__ */ jsx(Text, {
|
|
2175
|
+
style: [styles.optional, {
|
|
2176
|
+
fontSize: sizeTokens.optionalFontSize,
|
|
2177
|
+
lineHeight: sizeTokens.optionalLineHeight
|
|
2178
|
+
}],
|
|
2179
|
+
children: resolvedOptionalText
|
|
2180
|
+
}),
|
|
2181
|
+
resolvedLabelInfo && /* @__PURE__ */ jsx(Text, {
|
|
2182
|
+
style: [styles.labelInfo, {
|
|
2183
|
+
fontSize: sizeTokens.labelInfoFontSize,
|
|
2184
|
+
lineHeight: sizeTokens.labelInfoSize
|
|
2185
|
+
}],
|
|
2186
|
+
children: resolvedLabelInfo
|
|
2187
|
+
})
|
|
2188
|
+
]
|
|
2189
|
+
}) : /* @__PURE__ */ jsxs(View, {
|
|
2190
|
+
style: styles.customLabel,
|
|
2191
|
+
children: [
|
|
2192
|
+
resolvedLabel,
|
|
2193
|
+
required && /* @__PURE__ */ jsx(Text, {
|
|
2194
|
+
style: styles.required,
|
|
2195
|
+
accessible: false,
|
|
2196
|
+
importantForAccessibility: "no",
|
|
2197
|
+
children: "*"
|
|
2198
|
+
}),
|
|
2199
|
+
!required && resolvedOptionalText,
|
|
2200
|
+
resolvedLabelInfo
|
|
2201
|
+
]
|
|
2202
|
+
})), resolvedLabelAction && /* @__PURE__ */ jsx(View, {
|
|
2203
|
+
style: styles.labelAction,
|
|
2204
|
+
children: resolvedLabelAction
|
|
2205
|
+
})]
|
|
2206
|
+
}),
|
|
2207
|
+
resolvedDescription && (typeof resolvedDescription === "string" || typeof resolvedDescription === "number" ? /* @__PURE__ */ jsx(Text, {
|
|
2170
2208
|
style: [
|
|
2171
2209
|
styles.description,
|
|
2172
2210
|
{
|
|
@@ -2174,40 +2212,55 @@ function FormField({ id, label, description, error, required = false, disabled =
|
|
|
2174
2212
|
lineHeight: sizeTokens.descriptionLineHeight
|
|
2175
2213
|
},
|
|
2176
2214
|
disabled && styles.descriptionDisabled,
|
|
2215
|
+
parsedChildren.description?.style,
|
|
2177
2216
|
descriptionStyle
|
|
2178
2217
|
],
|
|
2179
|
-
children:
|
|
2180
|
-
}) :
|
|
2218
|
+
children: resolvedDescription
|
|
2219
|
+
}) : resolvedDescription),
|
|
2181
2220
|
/* @__PURE__ */ jsx(FormFieldContext.Provider, {
|
|
2182
2221
|
value: contextValue,
|
|
2183
2222
|
children: /* @__PURE__ */ jsx(View, {
|
|
2184
2223
|
style: [
|
|
2185
2224
|
styles.control,
|
|
2186
2225
|
{ gap: sizeTokens.gap },
|
|
2226
|
+
parsedChildren.control?.style,
|
|
2187
2227
|
controlStyle
|
|
2188
2228
|
],
|
|
2189
|
-
children
|
|
2229
|
+
children: resolvedChildren
|
|
2190
2230
|
})
|
|
2191
2231
|
}),
|
|
2192
|
-
|
|
2193
|
-
accessibilityLiveRegion: "polite",
|
|
2232
|
+
visibleMessage && (typeof visibleMessage === "string" || typeof visibleMessage === "number" ? /* @__PURE__ */ jsx(Text, {
|
|
2233
|
+
accessibilityLiveRegion: error || resolvedMessageLive === "polite" ? "polite" : void 0,
|
|
2194
2234
|
style: [
|
|
2195
|
-
styles.
|
|
2235
|
+
styles.message,
|
|
2196
2236
|
{
|
|
2197
2237
|
fontSize: sizeTokens.helperTextFontSize,
|
|
2198
2238
|
lineHeight: sizeTokens.helperTextLineHeight
|
|
2199
2239
|
},
|
|
2240
|
+
messageToneStyle,
|
|
2200
2241
|
disabled && styles.helperTextDisabled,
|
|
2201
|
-
|
|
2242
|
+
!error && parsedChildren.message?.style,
|
|
2243
|
+
error ? errorStyle : messageStyle
|
|
2202
2244
|
],
|
|
2203
|
-
children:
|
|
2245
|
+
children: visibleMessage
|
|
2204
2246
|
}) : /* @__PURE__ */ jsx(View, {
|
|
2205
|
-
accessibilityLiveRegion: "polite",
|
|
2206
|
-
children:
|
|
2247
|
+
accessibilityLiveRegion: error || resolvedMessageLive === "polite" ? "polite" : void 0,
|
|
2248
|
+
children: visibleMessage
|
|
2207
2249
|
}))
|
|
2208
2250
|
]
|
|
2209
2251
|
});
|
|
2210
2252
|
}
|
|
2253
|
+
const FormFieldLabel = createFormFieldSlot("label", "FormField.Label");
|
|
2254
|
+
const FormFieldDescription = createFormFieldSlot("description", "FormField.Description");
|
|
2255
|
+
const FormFieldControl = createFormFieldSlot("control", "FormField.Control");
|
|
2256
|
+
const FormFieldMessage = createFormFieldSlot("message", "FormField.Message");
|
|
2257
|
+
const FormField = Object.assign(FormFieldRoot, {
|
|
2258
|
+
Label: FormFieldLabel,
|
|
2259
|
+
Description: FormFieldDescription,
|
|
2260
|
+
Control: FormFieldControl,
|
|
2261
|
+
Message: FormFieldMessage,
|
|
2262
|
+
displayName: "FormField"
|
|
2263
|
+
});
|
|
2211
2264
|
//#endregion
|
|
2212
2265
|
//#region src/components/RadioGroup/RadioGroup.styles.ts
|
|
2213
2266
|
const createStyles$8 = (_theme) => StyleSheet.create({
|