@vellira-ui/react-native 2.73.3 → 2.75.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 CHANGED
@@ -24,6 +24,8 @@ export type { PortalProps, PortalProviderProps } from './primitives/Portal';
24
24
  export { Portal, PortalProvider } from './primitives/Portal';
25
25
  export type { RadioProps } from './primitives/Radio';
26
26
  export { Radio } from './primitives/Radio';
27
+ export type { SwitchProps } from './primitives/Switch';
28
+ export { Switch } from './primitives/Switch';
27
29
  export type { NativeThemeName, ThemeProviderProps } from './theme';
28
30
  export { nativeThemes, ThemeProvider, useTheme } from './theme';
29
31
  //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -750,7 +750,7 @@ const useDropdownContext = () => {
750
750
  DropdownContext.displayName = "DropdownContext";
751
751
  //#endregion
752
752
  //#region src/components/Dropdown/Content/DropdownContent.styles.ts
753
- const createStyles$21 = (theme) => StyleSheet.create({
753
+ const createStyles$22 = (theme) => StyleSheet.create({
754
754
  modalRoot: { flex: 1 },
755
755
  sheet: { justifyContent: "flex-end" },
756
756
  modal: {
@@ -836,7 +836,7 @@ const webPointerEventsBoxNone$1 = Platform.OS === "web" ? { pointerEvents: "box-
836
836
  function DropdownContent({ children, contentStyle, accessibilityLabel }) {
837
837
  const { open, color, presentation, zIndex, position, searchable, searchValue, searchPlaceholder, searchAccessibilityLabel, requestClose, getOutsidePressProps, onSearchChange, onFloatingLayout } = useDropdownContext();
838
838
  const { theme } = useTheme();
839
- const styles = useThemeStyles(createStyles$21);
839
+ const styles = useThemeStyles(createStyles$22);
840
840
  const colorPalette = theme.components.dropdown[color];
841
841
  const isSheet = presentation === "sheet";
842
842
  const isPopover = presentation === "popover";
@@ -1331,7 +1331,7 @@ function useNativeFloatingPosition(placement = "top", offset = 8) {
1331
1331
  }
1332
1332
  //#endregion
1333
1333
  //#region src/components/Dropdown/Dropdown.styles.ts
1334
- const createStyles$20 = (theme) => StyleSheet.create({
1334
+ const createStyles$21 = (theme) => StyleSheet.create({
1335
1335
  root: { alignSelf: Platform.select({
1336
1336
  web: "auto",
1337
1337
  default: "flex-start"
@@ -1348,7 +1348,7 @@ const createStyles$20 = (theme) => StyleSheet.create({
1348
1348
  });
1349
1349
  //#endregion
1350
1350
  //#region src/components/Dropdown/Group/DropdownGroup.styles.ts
1351
- const createStyles$19 = (theme) => StyleSheet.create({ groupLabel: {
1351
+ const createStyles$20 = (theme) => StyleSheet.create({ groupLabel: {
1352
1352
  paddingHorizontal: theme.tokens.spacing[4],
1353
1353
  paddingVertical: theme.tokens.spacing[2],
1354
1354
  color: theme.components.dropdown.groupLabel.fg,
@@ -1360,7 +1360,7 @@ const createStyles$19 = (theme) => StyleSheet.create({ groupLabel: {
1360
1360
  //#endregion
1361
1361
  //#region src/components/Dropdown/Group/DropdownGroup.tsx
1362
1362
  function DropdownGroup({ label }) {
1363
- const styles = useThemeStyles(createStyles$19);
1363
+ const styles = useThemeStyles(createStyles$20);
1364
1364
  return /* @__PURE__ */ jsx(Text, {
1365
1365
  accessibilityRole: "header",
1366
1366
  style: styles.groupLabel,
@@ -1375,7 +1375,7 @@ const devWarning = (condition, message) => {
1375
1375
  };
1376
1376
  //#endregion
1377
1377
  //#region src/components/Dropdown/Item/DropdownItem.styles.ts
1378
- const createStyles$18 = (theme) => StyleSheet.create({
1378
+ const createStyles$19 = (theme) => StyleSheet.create({
1379
1379
  item: {
1380
1380
  minWidth: 0,
1381
1381
  minHeight: 44,
@@ -1401,7 +1401,7 @@ const createStyles$18 = (theme) => StyleSheet.create({
1401
1401
  function DropdownItem({ label, value, asChild = false, children, color = "default", icon, disabled = false, textWrap = "truncate", onSelect }) {
1402
1402
  const { color: rootColor, itemStyle, textStyle } = useDropdownContext();
1403
1403
  const { theme } = useTheme();
1404
- const styles = useThemeStyles(createStyles$18);
1404
+ const styles = useThemeStyles(createStyles$19);
1405
1405
  const rootColorPalette = theme.components.dropdown[rootColor];
1406
1406
  const itemColorPalette = color === "default" ? void 0 : theme.components.dropdown[color];
1407
1407
  const renderColoredNode = (node, color) => {
@@ -1469,20 +1469,20 @@ function DropdownItem({ label, value, asChild = false, children, color = "defaul
1469
1469
  DropdownItem.displayName = "DropdownItem";
1470
1470
  //#endregion
1471
1471
  //#region src/components/Dropdown/Separator/DropdownSeparator.styles.ts
1472
- const createStyles$17 = (theme) => StyleSheet.create({ separator: {
1472
+ const createStyles$18 = (theme) => StyleSheet.create({ separator: {
1473
1473
  height: 1,
1474
1474
  backgroundColor: theme.components.dropdown.separator.bg
1475
1475
  } });
1476
1476
  //#endregion
1477
1477
  //#region src/components/Dropdown/Separator/DropdownSeparator.tsx
1478
1478
  function DropdownSeparator() {
1479
- const styles = useThemeStyles(createStyles$17);
1479
+ const styles = useThemeStyles(createStyles$18);
1480
1480
  return /* @__PURE__ */ jsx(View, { style: styles.separator });
1481
1481
  }
1482
1482
  DropdownSeparator.displayName = "DropdownSeparator";
1483
1483
  //#endregion
1484
1484
  //#region src/components/Dropdown/Trigger/DropdownTrigger.styles.ts
1485
- const createStyles$16 = (theme) => StyleSheet.create({
1485
+ const createStyles$17 = (theme) => StyleSheet.create({
1486
1486
  trigger: {
1487
1487
  alignItems: "center",
1488
1488
  justifyContent: "center",
@@ -1571,7 +1571,7 @@ const createStyles$16 = (theme) => StyleSheet.create({
1571
1571
  function DropdownTrigger({ asChild = false, label, trigger, children, icon, arrowIcon, showArrow = true, triggerStyle, triggerRef, accessibilityLabel, accessibilityHint }) {
1572
1572
  const { open, color, disabled, size, toggle } = useDropdownContext();
1573
1573
  const { theme } = useTheme();
1574
- const styles = useThemeStyles(createStyles$16);
1574
+ const styles = useThemeStyles(createStyles$17);
1575
1575
  const colorPalette = theme.components.dropdown[color];
1576
1576
  const textSizeStyle = {
1577
1577
  sm: styles.textSm,
@@ -1693,7 +1693,7 @@ DropdownTrigger.displayName = "DropdownTrigger";
1693
1693
  //#endregion
1694
1694
  //#region src/components/Dropdown/Root/DropdownRoot.tsx
1695
1695
  function DropdownRoot({ children, label = "Menu", trigger, icon, arrowIcon, showArrow = true, open, defaultOpen = false, onOpenChange, presentation = "auto", placement = "bottom-start", offset = 8, closeOnSelect = true, color = "primary", disabled = false, loading = false, loadingText = "Loading actions...", searchable = false, command = false, searchValue, defaultSearchValue = "", searchPlaceholder, onSearch, empty, size = "md", style, triggerStyle, contentStyle, itemStyle, textStyle, accessibilityLabel, accessibilityHint }) {
1696
- const styles = useThemeStyles(createStyles$20);
1696
+ const styles = useThemeStyles(createStyles$21);
1697
1697
  const overlayId = useId();
1698
1698
  const triggerRef = useRef(null);
1699
1699
  const setTriggerRef = useCallback((node) => {
@@ -1893,7 +1893,7 @@ const Dropdown = Object.assign(DropdownRoot, {
1893
1893
  });
1894
1894
  //#endregion
1895
1895
  //#region src/components/Modal/Body/ModalBody.styles.ts
1896
- const createStyles$15 = (theme) => StyleSheet.create({
1896
+ const createStyles$16 = (theme) => StyleSheet.create({
1897
1897
  body: { paddingBottom: theme.components.modal.body.paddingBottom },
1898
1898
  text: {
1899
1899
  color: theme.components.modal.content.fg,
@@ -1920,7 +1920,7 @@ const renderBodyChildren = (children, textStyle) => Children.map(children, (chil
1920
1920
  return cloneElement(child, { style: [textStyle, child.props.style] });
1921
1921
  });
1922
1922
  const ModalBody = ({ children, style }) => {
1923
- const styles = useThemeStyles(createStyles$15);
1923
+ const styles = useThemeStyles(createStyles$16);
1924
1924
  return /* @__PURE__ */ jsx(View, {
1925
1925
  style: [styles.body, style],
1926
1926
  children: renderBodyChildren(children, styles.text)
@@ -1929,7 +1929,7 @@ const ModalBody = ({ children, style }) => {
1929
1929
  ModalBody.displayName = "ModalBody";
1930
1930
  //#endregion
1931
1931
  //#region src/components/Modal/Header/ModalHeader.styles.ts
1932
- const createStyles$14 = (theme) => StyleSheet.create({
1932
+ const createStyles$15 = (theme) => StyleSheet.create({
1933
1933
  header: {
1934
1934
  alignItems: "center",
1935
1935
  flexDirection: "row",
@@ -1979,7 +1979,7 @@ ModalContext.displayName = "ModalContext";
1979
1979
  //#region src/components/Modal/Close/ModalClose.tsx
1980
1980
  const ModalClose = ({ asChild = false, children, accessibilityLabel, style }) => {
1981
1981
  const { theme } = useTheme();
1982
- const styles = useThemeStyles(createStyles$14);
1982
+ const styles = useThemeStyles(createStyles$15);
1983
1983
  const { onClose } = useModalContext();
1984
1984
  if ((asChild || children !== void 0) && isValidElement(children)) return cloneElement(children, {
1985
1985
  accessibilityLabel: children.props.accessibilityLabel ?? accessibilityLabel,
@@ -2005,7 +2005,7 @@ const ModalClose = ({ asChild = false, children, accessibilityLabel, style }) =>
2005
2005
  ModalClose.displayName = "Modal.Close";
2006
2006
  //#endregion
2007
2007
  //#region src/components/Modal/Content/ModalContent.styles.ts
2008
- const createStyles$13 = (theme) => StyleSheet.create({ content: {
2008
+ const createStyles$14 = (theme) => StyleSheet.create({ content: {
2009
2009
  width: "100%",
2010
2010
  maxWidth: theme.components.modal.content.size.md,
2011
2011
  maxHeight: theme.components.modal.content.nativeMaxHeight,
@@ -2032,7 +2032,7 @@ const createStyles$13 = (theme) => StyleSheet.create({ content: {
2032
2032
  //#endregion
2033
2033
  //#region src/components/Modal/Content/ModalContent.tsx
2034
2034
  const ModalContent = ({ children, style }) => {
2035
- const styles = useThemeStyles(createStyles$13);
2035
+ const styles = useThemeStyles(createStyles$14);
2036
2036
  const { animation, animationProgress, open } = useModalContext();
2037
2037
  const closedTranslateY = open ? animation === "slide" ? 16 : 8 : 4;
2038
2038
  const closedScale = open ? .96 : .98;
@@ -2058,7 +2058,7 @@ const ModalContent = ({ children, style }) => {
2058
2058
  ModalContent.displayName = "ModalContent";
2059
2059
  //#endregion
2060
2060
  //#region src/components/Modal/Footer/ModalFooter.styles.ts
2061
- const createStyles$12 = (theme) => StyleSheet.create({ footer: {
2061
+ const createStyles$13 = (theme) => StyleSheet.create({ footer: {
2062
2062
  flexDirection: "row",
2063
2063
  gap: theme.components.modal.footer.gap,
2064
2064
  justifyContent: "flex-end",
@@ -2067,7 +2067,7 @@ const createStyles$12 = (theme) => StyleSheet.create({ footer: {
2067
2067
  //#endregion
2068
2068
  //#region src/components/Modal/Footer/ModalFooter.tsx
2069
2069
  const ModalFooter = ({ children, style }) => {
2070
- const styles = useThemeStyles(createStyles$12);
2070
+ const styles = useThemeStyles(createStyles$13);
2071
2071
  return /* @__PURE__ */ jsx(View, {
2072
2072
  style: [styles.footer, style],
2073
2073
  children
@@ -2077,7 +2077,7 @@ ModalFooter.displayName = "ModalFooter";
2077
2077
  //#endregion
2078
2078
  //#region src/components/Modal/Header/ModalDescription.tsx
2079
2079
  const ModalDescription = ({ children, style }) => {
2080
- const styles = useThemeStyles(createStyles$14);
2080
+ const styles = useThemeStyles(createStyles$15);
2081
2081
  return /* @__PURE__ */ jsx(Text, {
2082
2082
  style: [styles.description, style],
2083
2083
  children
@@ -2087,7 +2087,7 @@ ModalDescription.displayName = "Modal.Description";
2087
2087
  //#endregion
2088
2088
  //#region src/components/Modal/Header/ModalHeader.tsx
2089
2089
  const ModalHeader = ({ children, style, textStyle }) => {
2090
- const styles = useThemeStyles(createStyles$14);
2090
+ const styles = useThemeStyles(createStyles$15);
2091
2091
  const isPlainTitle = typeof children === "string" || typeof children === "number";
2092
2092
  return /* @__PURE__ */ jsxs(View, {
2093
2093
  style: [styles.header, style],
@@ -2108,7 +2108,7 @@ ModalHeader.displayName = "ModalHeader";
2108
2108
  //#endregion
2109
2109
  //#region src/components/Modal/Header/ModalTitle.tsx
2110
2110
  const ModalTitle = ({ children, style }) => {
2111
- const styles = useThemeStyles(createStyles$14);
2111
+ const styles = useThemeStyles(createStyles$15);
2112
2112
  return /* @__PURE__ */ jsx(Text, {
2113
2113
  accessibilityRole: "header",
2114
2114
  style: [styles.title, style],
@@ -2118,7 +2118,7 @@ const ModalTitle = ({ children, style }) => {
2118
2118
  ModalTitle.displayName = "Modal.Title";
2119
2119
  //#endregion
2120
2120
  //#region src/components/Modal/Modal.styles.ts
2121
- const createStyles$11 = (theme) => StyleSheet.create({
2121
+ const createStyles$12 = (theme) => StyleSheet.create({
2122
2122
  overlay: {
2123
2123
  alignItems: "center",
2124
2124
  flex: 1,
@@ -2133,7 +2133,7 @@ const createStyles$11 = (theme) => StyleSheet.create({
2133
2133
  //#endregion
2134
2134
  //#region src/components/Modal/Overlay/ModalOverlay.tsx
2135
2135
  const ModalOverlay = ({ children, overlayStyle }) => {
2136
- const styles = useThemeStyles(createStyles$11);
2136
+ const styles = useThemeStyles(createStyles$12);
2137
2137
  const { animation, animationProgress, zIndex, onClose, getOutsidePressProps, shouldRender } = useModalContext();
2138
2138
  const backdropStyle = animation === "none" ? void 0 : { opacity: animationProgress };
2139
2139
  return /* @__PURE__ */ jsx(Modal$1, {
@@ -2714,7 +2714,7 @@ function useRadioGroupContext() {
2714
2714
  }
2715
2715
  //#endregion
2716
2716
  //#region src/primitives/Radio/Radio.styles.ts
2717
- const createStyles$10 = (theme) => StyleSheet.create({
2717
+ const createStyles$11 = (theme) => StyleSheet.create({
2718
2718
  root: { alignSelf: Platform.select({
2719
2719
  web: "auto",
2720
2720
  default: "flex-start"
@@ -2773,7 +2773,7 @@ const nativePointerEventsNone$3 = Platform.OS === "web" ? void 0 : { pointerEven
2773
2773
  const webPointerEventsNone$3 = Platform.OS === "web" ? { pointerEvents: "none" } : void 0;
2774
2774
  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) => {
2775
2775
  const { theme } = useTheme();
2776
- const styles = createStyles$10(theme);
2776
+ const styles = createStyles$11(theme);
2777
2777
  const group = useRadioGroupContext();
2778
2778
  const isInsideGroup = group !== null;
2779
2779
  const [standaloneChecked, setStandaloneChecked] = useControllableState({
@@ -2919,7 +2919,7 @@ RadioGroupItem.displayName = "RadioGroup.Item";
2919
2919
  //#endregion
2920
2920
  //#region src/patterns/FormField/FormField.styles.ts
2921
2921
  const fontWeight$2 = (value) => value;
2922
- const createStyles$9 = (theme) => StyleSheet.create({
2922
+ const createStyles$10 = (theme) => StyleSheet.create({
2923
2923
  root: {
2924
2924
  width: "100%",
2925
2925
  minWidth: 0,
@@ -3042,7 +3042,7 @@ function FormFieldRoot({ id, label, description, error, message, messageTone, me
3042
3042
  const resolvedOptionalText = optionalText ?? parsedChildren.label?.optionalText;
3043
3043
  const resolvedChildren = parsedChildren.hasSlots ? parsedChildren.control?.children ?? parsedChildren.fallbackChildren : children;
3044
3044
  const { theme } = useTheme();
3045
- const styles = useThemeStyles(createStyles$9);
3045
+ const styles = useThemeStyles(createStyles$10);
3046
3046
  const sizeTokens = theme.components.formField.size[size];
3047
3047
  const generatedId = useId();
3048
3048
  const controlId = id ?? generatedId;
@@ -3201,7 +3201,7 @@ const FormField = Object.assign(FormFieldRoot, {
3201
3201
  });
3202
3202
  //#endregion
3203
3203
  //#region src/components/RadioGroup/RadioGroup.styles.ts
3204
- const createStyles$8 = (_theme) => StyleSheet.create({
3204
+ const createStyles$9 = (_theme) => StyleSheet.create({
3205
3205
  items: {
3206
3206
  width: "100%",
3207
3207
  minWidth: 0,
@@ -3217,7 +3217,7 @@ const createStyles$8 = (_theme) => StyleSheet.create({
3217
3217
  //#region src/components/RadioGroup/Root/RadioGroupRoot.tsx
3218
3218
  const RadioGroupRoot = forwardRef(({ value, defaultValue = "", onValueChange, disabled = false, required = false, invalid = false, size = "md", color = "primary", orientation = "vertical", label, description, error, children, style, itemsStyle, labelStyle, descriptionStyle, errorStyle, accessibilityLabel, accessibilityHint, ...rest }, ref) => {
3219
3219
  const { theme } = useTheme();
3220
- const styles = useThemeStyles(createStyles$8);
3220
+ const styles = useThemeStyles(createStyles$9);
3221
3221
  const radioGroupSizeTokens = theme.components.radioGroup.size[size];
3222
3222
  const [selectedValue, setSelectedValue] = useControllableState({
3223
3223
  value,
@@ -5042,7 +5042,7 @@ const useTabs = () => {
5042
5042
  TabsContext.displayName = "TabsContext";
5043
5043
  //#endregion
5044
5044
  //#region src/components/Tabs/Content/TabsContent.styles.ts
5045
- const createStyles$7 = (theme) => StyleSheet.create({
5045
+ const createStyles$8 = (theme) => StyleSheet.create({
5046
5046
  panel: {
5047
5047
  width: "100%",
5048
5048
  minWidth: 0,
@@ -5061,7 +5061,7 @@ const createStyles$7 = (theme) => StyleSheet.create({
5061
5061
  //#endregion
5062
5062
  //#region src/components/Tabs/Content/TabsContent.tsx
5063
5063
  const TabsContent = ({ value, children, forceMount = false, style }) => {
5064
- const styles = useThemeStyles(createStyles$7);
5064
+ const styles = useThemeStyles(createStyles$8);
5065
5065
  const { value: selectedValue, orientation, keepMounted, lazyMount } = useTabs();
5066
5066
  const isActive = selectedValue === value;
5067
5067
  const [hasMounted, setHasMounted] = useState(isActive);
@@ -5299,7 +5299,7 @@ const TabsIndicator = ({ children, style }) => {
5299
5299
  TabsIndicator.displayName = "Tabs.Indicator";
5300
5300
  //#endregion
5301
5301
  //#region src/components/Tabs/List/TabsList.styles.ts
5302
- const createStyles$6 = (theme) => StyleSheet.create({
5302
+ const createStyles$7 = (theme) => StyleSheet.create({
5303
5303
  list: {
5304
5304
  position: "relative",
5305
5305
  flexDirection: "row",
@@ -5353,7 +5353,7 @@ const createStyles$6 = (theme) => StyleSheet.create({
5353
5353
  //#endregion
5354
5354
  //#region src/components/Tabs/List/TabsList.tsx
5355
5355
  const TabsList = ({ children, scrollable: scrollableProp, style }) => {
5356
- const styles = useThemeStyles(createStyles$6);
5356
+ const styles = useThemeStyles(createStyles$7);
5357
5357
  const { mode, orientation, variant } = useTabs();
5358
5358
  const scrollable = scrollableProp ?? false;
5359
5359
  const listStyle = [
@@ -5383,7 +5383,7 @@ TabsList.displayName = "TabsList";
5383
5383
  //#endregion
5384
5384
  //#region src/components/Tabs/Trigger/TabsTrigger.styles.ts
5385
5385
  const fontWeight$1 = (value) => value;
5386
- const createStyles$5 = (theme) => StyleSheet.create({
5386
+ const createStyles$6 = (theme) => StyleSheet.create({
5387
5387
  tab: {
5388
5388
  minHeight: 36,
5389
5389
  minWidth: 44,
@@ -5568,7 +5568,7 @@ const getTriggerStyle = ({ styles, isSm, isLg, isOnlyIcon, isVertical, isPills,
5568
5568
  //#endregion
5569
5569
  //#region src/components/Tabs/Trigger/TabsBadge.tsx
5570
5570
  const TabsBadge = ({ children, style }) => {
5571
- const styles = useThemeStyles(createStyles$5);
5571
+ const styles = useThemeStyles(createStyles$6);
5572
5572
  const { color } = useTabs();
5573
5573
  const { theme } = useTheme();
5574
5574
  const palette = theme.components.tabs[color];
@@ -5588,7 +5588,7 @@ TabsBadge.displayName = "Tabs.Badge";
5588
5588
  //#endregion
5589
5589
  //#region src/components/Tabs/Trigger/TabsIcon.tsx
5590
5590
  const TabsIcon = ({ children, style }) => {
5591
- const styles = useThemeStyles(createStyles$5);
5591
+ const styles = useThemeStyles(createStyles$6);
5592
5592
  return /* @__PURE__ */ jsx(View, {
5593
5593
  style: [styles.tabIcon, style],
5594
5594
  children
@@ -5599,7 +5599,7 @@ TabsIcon.displayName = "Tabs.Icon";
5599
5599
  //#region src/components/Tabs/Trigger/TabsTrigger.tsx
5600
5600
  const TabsTrigger = ({ value, children, asChild = false, icon, badge, description, disabled, style, textStyle }) => {
5601
5601
  const { theme } = useTheme();
5602
- const styles = useThemeStyles(createStyles$5);
5602
+ const styles = useThemeStyles(createStyles$6);
5603
5603
  const { value: selectedValue, variant, color, size, mode, orientation, disabled: rootDisabled, setValue, registerTrigger, registerTriggerLayout } = useTabs();
5604
5604
  const isDisabled = rootDisabled || Boolean(disabled);
5605
5605
  const isActive = selectedValue === value;
@@ -5743,7 +5743,7 @@ const TabsTrigger = ({ value, children, asChild = false, icon, badge, descriptio
5743
5743
  TabsTrigger.displayName = "Tabs.Trigger";
5744
5744
  //#endregion
5745
5745
  //#region src/components/Tabs/Tabs.styles.ts
5746
- const createStyles$4 = (theme) => StyleSheet.create({
5746
+ const createStyles$5 = (theme) => StyleSheet.create({
5747
5747
  root: {
5748
5748
  width: "100%",
5749
5749
  minWidth: 0
@@ -5759,7 +5759,7 @@ const createStyles$4 = (theme) => StyleSheet.create({
5759
5759
  //#endregion
5760
5760
  //#region src/components/Tabs/Root/TabsRoot.tsx
5761
5761
  const TabsRoot = ({ children, value: controlledValue, defaultValue, onValueChange, orientation = "horizontal", mode = "tabs", variant = "line", color = "primary", size = "md", keepMounted = false, lazyMount = false, disabled = false, style }) => {
5762
- const styles = useThemeStyles(createStyles$4);
5762
+ const styles = useThemeStyles(createStyles$5);
5763
5763
  const isControlled = controlledValue !== void 0;
5764
5764
  const [version, setVersion] = useState(0);
5765
5765
  const [indicatorVersion, setIndicatorVersion] = useState(0);
@@ -5920,7 +5920,7 @@ function TooltipArrow() {
5920
5920
  }
5921
5921
  //#endregion
5922
5922
  //#region src/components/Tooltip/Tooltip.styles.ts
5923
- const createStyles$3 = (theme) => StyleSheet.create({
5923
+ const createStyles$4 = (theme) => StyleSheet.create({
5924
5924
  root: { alignSelf: Platform.select({
5925
5925
  web: "auto",
5926
5926
  default: "flex-start"
@@ -5961,7 +5961,7 @@ const createStyles$3 = (theme) => StyleSheet.create({
5961
5961
  //#endregion
5962
5962
  //#region src/components/Tooltip/Content/TooltipContent.tsx
5963
5963
  const TooltipContent = ({ children, forceMount = false, withArrow = false, style, textStyle }) => {
5964
- const styles = useThemeStyles(createStyles$3);
5964
+ const styles = useThemeStyles(createStyles$4);
5965
5965
  const tooltip = useTooltipContext();
5966
5966
  const visible = tooltip.open && !tooltip.disabled;
5967
5967
  if (!forceMount && !visible) return null;
@@ -6230,7 +6230,7 @@ Tooltip.displayName = "Tooltip";
6230
6230
  //#endregion
6231
6231
  //#region src/primitives/Button/Button.styles.ts
6232
6232
  const fontWeight = (value) => value;
6233
- const createStyles$2 = (theme) => StyleSheet.create({
6233
+ const createStyles$3 = (theme) => StyleSheet.create({
6234
6234
  button: {
6235
6235
  flexDirection: "row",
6236
6236
  alignItems: "center",
@@ -6298,7 +6298,7 @@ const buttonSizeMap = {
6298
6298
  };
6299
6299
  function Button({ children, color = "primary", appearance = "solid", shape = "pill", disabled = false, loading = false, loadingText, onPress, onFocus, onBlur, onHoverIn, onHoverOut, size = "md", iconStart, iconEnd, badge, shortcut, fullWidth = false, iconOnly: iconOnlyProp = false, style, textStyle, accessibilityLabel, iconSize, testID, ...props }) {
6300
6300
  const { theme } = useTheme();
6301
- const styles = useThemeStyles(createStyles$2);
6301
+ const styles = useThemeStyles(createStyles$3);
6302
6302
  const controlSize = controlSizes[size];
6303
6303
  const buttonSize = buttonSizeMap[size];
6304
6304
  const radius = shape === "square" ? theme.tokens.radius.sm : shape === "rounded" ? theme.tokens.radius.md : theme.tokens.radius.full;
@@ -6432,7 +6432,7 @@ function Button({ children, color = "primary", appearance = "solid", shape = "pi
6432
6432
  }
6433
6433
  //#endregion
6434
6434
  //#region src/primitives/Checkbox/Checkbox.styles.ts
6435
- const createStyles$1 = (theme) => StyleSheet.create({
6435
+ const createStyles$2 = (theme) => StyleSheet.create({
6436
6436
  container: { gap: theme.tokens.spacing[2] },
6437
6437
  wrapper: {
6438
6438
  flexDirection: "row",
@@ -6546,7 +6546,7 @@ const iconSizeBySize = {
6546
6546
  };
6547
6547
  const Checkbox = forwardRef(({ label, description, icon, indeterminateIcon, checked, defaultChecked = false, disabled = false, required = false, indeterminate = false, size = "md", color = "primary", labelPosition = "end", onCheckedChange, error, style, accessibilityLabel, accessibilityHint, ...PressableProps }, ref) => {
6548
6548
  const { theme } = useTheme();
6549
- const styles = useThemeStyles(createStyles$1);
6549
+ const styles = useThemeStyles(createStyles$2);
6550
6550
  const checkboxColor = theme.components.checkbox[color];
6551
6551
  const boxSizeStyle = {
6552
6552
  sm: styles.boxSm,
@@ -6664,7 +6664,7 @@ Checkbox.displayName = "Checkbox";
6664
6664
  //#region src/primitives/Input/Input.styles.ts
6665
6665
  const getDisabledPlaceholderTextColor = (theme) => theme.components.input.disabled.placeholder;
6666
6666
  const resolveRingColor = (ring) => typeof ring === "string" ? ring : ring.color;
6667
- const createStyles = (theme) => StyleSheet.create({
6667
+ const createStyles$1 = (theme) => StyleSheet.create({
6668
6668
  inputWrapper: {
6669
6669
  position: "relative",
6670
6670
  width: "100%",
@@ -6855,7 +6855,7 @@ const nativePointerEventsNone = Platform.OS === "web" ? void 0 : { pointerEvents
6855
6855
  const webPointerEventsNone = Platform.OS === "web" ? { pointerEvents: "none" } : void 0;
6856
6856
  const Input = forwardRef(({ label, description, value, defaultValue, onValueChange, placeholder, size, error, invalid = false, disabled = false, required = false, loading = false, readOnly = false, type = "text", startIcon, endIcon, startIconTone = "default", endIconTone = "default", clearIcon, clearIconTone = "danger", iconSize, containerStyle, inputStyle, keyboardType, secureTextEntry, autoCapitalize, autoCorrect, onBlur, onFocus, accessibilityLabel, accessibilityHint, testID, autoFocus, maxLength, clearable, onClear, color = "primary", variant = "outline", revealPassword = false, showCounter: _showCounter, mask, format, parse, ...props }, ref) => {
6857
6857
  const { theme } = useTheme();
6858
- const styles = useThemeStyles(createStyles);
6858
+ const styles = useThemeStyles(createStyles$1);
6859
6859
  const field = useFormFieldContext();
6860
6860
  const hasOwnField = Boolean(label || description || error);
6861
6861
  const [isFocused, setIsFocused] = useState(false);
@@ -7044,4 +7044,83 @@ const Input = forwardRef(({ label, description, value, defaultValue, onValueChan
7044
7044
  });
7045
7045
  Input.displayName = "Input";
7046
7046
  //#endregion
7047
- export { Button, Checkbox, Dropdown, FormField, Input, Modal, Popover, Portal, PortalProvider, Radio, RadioGroup, Select, Tabs, ThemeProvider, Tooltip, nativeThemes, useTheme };
7047
+ //#region src/primitives/Switch/Switch.styles.ts
7048
+ const createStyles = (theme) => StyleSheet.create({
7049
+ root: {
7050
+ width: theme.components.switch.geometry.trackWidth,
7051
+ height: theme.components.switch.geometry.trackHeight,
7052
+ borderRadius: theme.tokens.radius.full,
7053
+ borderWidth: theme.components.switch.geometry.borderWidth,
7054
+ padding: theme.components.switch.geometry.padding,
7055
+ justifyContent: "center",
7056
+ backgroundColor: theme.components.switch.off.trackBg,
7057
+ borderColor: theme.components.switch.off.trackBorder
7058
+ },
7059
+ checked: {
7060
+ backgroundColor: theme.components.switch.on.default.trackBg,
7061
+ borderColor: theme.components.switch.on.default.trackBorder
7062
+ },
7063
+ pressed: { transform: [{ scale: theme.components.switch.geometry.pressScale }] },
7064
+ checkedPressed: {
7065
+ backgroundColor: theme.components.switch.on.pressed.trackBg,
7066
+ borderColor: theme.components.switch.on.pressed.trackBorder
7067
+ },
7068
+ invalid: { borderColor: theme.components.switch.errorBorder },
7069
+ disabled: {
7070
+ backgroundColor: theme.components.switch.disabled.trackBg,
7071
+ borderColor: theme.components.switch.disabled.trackBorder
7072
+ },
7073
+ thumb: {
7074
+ width: theme.components.switch.geometry.thumbSize,
7075
+ height: theme.components.switch.geometry.thumbSize,
7076
+ borderRadius: theme.tokens.radius.full,
7077
+ backgroundColor: theme.components.switch.off.thumbBg,
7078
+ transform: [{ translateX: 0 }]
7079
+ },
7080
+ thumbChecked: {
7081
+ backgroundColor: theme.components.switch.on.default.thumbBg,
7082
+ transform: [{ translateX: theme.components.switch.geometry.thumbTravel }]
7083
+ },
7084
+ thumbCheckedPressed: { backgroundColor: theme.components.switch.on.pressed.thumbBg },
7085
+ thumbDisabled: { backgroundColor: theme.components.switch.disabled.thumbBg }
7086
+ });
7087
+ //#endregion
7088
+ //#region src/primitives/Switch/Switch.tsx
7089
+ function Switch({ accessibilityLabel = "Switch", checked, defaultChecked = false, disabled = false, required = false, invalid = false, onCheckedChange }) {
7090
+ const styles = useThemeStyles(createStyles);
7091
+ const [uncontrolledChecked, setUncontrolledChecked] = useState(defaultChecked);
7092
+ const isControlled = checked !== void 0;
7093
+ const resolvedChecked = isControlled ? checked : uncontrolledChecked;
7094
+ const handlePress = () => {
7095
+ const nextChecked = !resolvedChecked;
7096
+ if (!isControlled) setUncontrolledChecked(nextChecked);
7097
+ onCheckedChange?.(nextChecked);
7098
+ };
7099
+ return /* @__PURE__ */ jsx(Pressable, {
7100
+ disabled,
7101
+ accessibilityLabel,
7102
+ accessibilityRole: "switch",
7103
+ accessibilityState: {
7104
+ checked: resolvedChecked,
7105
+ disabled
7106
+ },
7107
+ accessibilityHint: [required ? "Required." : void 0, invalid ? "Invalid." : void 0].filter(Boolean).join(" ") || void 0,
7108
+ onPress: handlePress,
7109
+ style: ({ pressed }) => [
7110
+ styles.root,
7111
+ resolvedChecked && styles.checked,
7112
+ pressed && !disabled && styles.pressed,
7113
+ resolvedChecked && pressed && !disabled && styles.checkedPressed,
7114
+ invalid && styles.invalid,
7115
+ disabled && styles.disabled
7116
+ ],
7117
+ children: ({ pressed }) => /* @__PURE__ */ jsx(View, { style: [
7118
+ styles.thumb,
7119
+ resolvedChecked && styles.thumbChecked,
7120
+ resolvedChecked && pressed && !disabled && styles.thumbCheckedPressed,
7121
+ disabled && styles.thumbDisabled
7122
+ ] })
7123
+ });
7124
+ }
7125
+ //#endregion
7126
+ export { Button, Checkbox, Dropdown, FormField, Input, Modal, Popover, Portal, PortalProvider, Radio, RadioGroup, Select, Switch, Tabs, ThemeProvider, Tooltip, nativeThemes, useTheme };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vellira-ui/react-native",
3
- "version": "2.73.3",
3
+ "version": "2.75.0",
4
4
  "description": "React Native components for Vellira Design System",
5
5
  "keywords": [
6
6
  "vellira",