@vellira-ui/react-native 2.44.4 → 2.44.5
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.js +15 -57
- package/package.json +1 -1
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
|
],
|