radix-native-ui 0.1.2 → 0.1.4

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.mjs CHANGED
@@ -3931,10 +3931,6 @@ AnimatedPressable.displayName = "AnimatedPressable";
3931
3931
 
3932
3932
  //#endregion
3933
3933
  //#region src/components/layout/Box.tsx
3934
- const areEqual$12 = (prevProps, nextProps) => {
3935
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.backgroundColor === nextProps.backgroundColor && prevProps.display === nextProps.display && prevProps.flexDirection === nextProps.flexDirection && prevProps.flex === nextProps.flex && prevProps.opacity === nextProps.opacity && prevProps.radius === nextProps.radius) return true;
3936
- return false;
3937
- };
3938
3934
  const Box = React.memo(React.forwardRef(({ asChild = false, children, style, backgroundColor, radius, display, flexDirection, justifyContent, alignItems, flexWrap, flex, flexGrow, flexShrink, flexBasis, alignSelf, width, height, minWidth, maxWidth, minHeight, maxHeight, position, top, right, bottom, left, zIndex, overflow, margin, marginTop, marginBottom, marginLeft, marginRight, marginHorizontal, marginVertical, padding, paddingTop, paddingBottom, paddingLeft, paddingRight, paddingHorizontal, paddingVertical, borderWidth, borderRadius: borderRadiusProp, borderColor, opacity, elevation, ...rest }, ref) => {
3939
3935
  const theme = useTheme$1();
3940
3936
  const colors = theme.colors.gray;
@@ -4048,7 +4044,7 @@ const Box = React.memo(React.forwardRef(({ asChild = false, children, style, bac
4048
4044
  ...rest,
4049
4045
  children
4050
4046
  });
4051
- }), areEqual$12);
4047
+ }));
4052
4048
  Box.displayName = "Box";
4053
4049
 
4054
4050
  //#endregion
@@ -4098,10 +4094,6 @@ Slot.displayName = "Slot";
4098
4094
 
4099
4095
  //#endregion
4100
4096
  //#region src/components/layout/Flex.tsx
4101
- const areEqual$11 = (prevProps, nextProps) => {
4102
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.direction === nextProps.direction && prevProps.align === nextProps.align && prevProps.justify === nextProps.justify && prevProps.wrap === nextProps.wrap && prevProps.gap === nextProps.gap && prevProps.backgroundColor === nextProps.backgroundColor && prevProps.opacity === nextProps.opacity) return true;
4103
- return false;
4104
- };
4105
4097
  const Flex = React.memo(React.forwardRef(({ asChild = false, children, style, direction = "row", align = "stretch", alignContent, justify = "flex-start", wrap = "nowrap", gap, flexGrow, flexShrink, flexBasis, flex, alignSelf, width, height, minWidth, maxWidth, minHeight, maxHeight, position, top, right, bottom, left, zIndex, overflow, margin, marginTop, marginBottom, marginLeft, marginRight, marginHorizontal, marginVertical, padding, paddingTop, paddingBottom, paddingLeft, paddingRight, paddingHorizontal, paddingVertical, columnGap, rowGap, backgroundColor, borderRadius, opacity, ...rest }, ref) => {
4106
4098
  const theme = useTheme$1();
4107
4099
  const flexStyle = useMemo(() => ({
@@ -4199,15 +4191,11 @@ const Flex = React.memo(React.forwardRef(({ asChild = false, children, style, di
4199
4191
  ...rest,
4200
4192
  children
4201
4193
  });
4202
- }), areEqual$11);
4194
+ }));
4203
4195
  Flex.displayName = "Flex";
4204
4196
 
4205
4197
  //#endregion
4206
4198
  //#region src/components/layout/Grid.tsx
4207
- const areEqual$10 = (prevProps, nextProps) => {
4208
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.columns === nextProps.columns && prevProps.gap === nextProps.gap && prevProps.rowGap === nextProps.rowGap && prevProps.columnGap === nextProps.columnGap && prevProps.align === nextProps.align && prevProps.justify === nextProps.justify && prevProps.columnWidth === nextProps.columnWidth) return true;
4209
- return false;
4210
- };
4211
4199
  const Grid = React.memo(React.forwardRef(({ children, style = {}, columns = 1, gap, rowGap, columnGap, align = "stretch", justify = "flex-start", columnWidth, ...rest }, ref) => {
4212
4200
  const theme = useTheme$1();
4213
4201
  useThemeMode();
@@ -4243,7 +4231,7 @@ const Grid = React.memo(React.forwardRef(({ children, style = {}, columns = 1, g
4243
4231
  ...rest,
4244
4232
  children: childrenWithWidth
4245
4233
  });
4246
- }), areEqual$10);
4234
+ }));
4247
4235
  Grid.displayName = "Grid";
4248
4236
 
4249
4237
  //#endregion
@@ -4254,10 +4242,6 @@ const containerMaxWidths = {
4254
4242
  3: 640,
4255
4243
  4: 896
4256
4244
  };
4257
- const areEqual$9 = (prevProps, nextProps) => {
4258
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.size === nextProps.size && prevProps.responsive === nextProps.responsive) return true;
4259
- return false;
4260
- };
4261
4245
  const Container = React.memo(React.forwardRef(({ children, style, size = 2, responsive = true, ...rest }, ref) => {
4262
4246
  const theme = useTheme$1();
4263
4247
  const maxWidth = containerMaxWidths[size];
@@ -4276,7 +4260,7 @@ const Container = React.memo(React.forwardRef(({ children, style, size = 2, resp
4276
4260
  ...rest,
4277
4261
  children
4278
4262
  });
4279
- }), areEqual$9);
4263
+ }));
4280
4264
  Container.displayName = "Container";
4281
4265
 
4282
4266
  //#endregion
@@ -4293,9 +4277,6 @@ const getPaddingStyles = (side, spacing) => {
4293
4277
  };
4294
4278
  return paddingMap[side] ?? paddingMap.all;
4295
4279
  };
4296
- const areEqual$8 = (prevProps, nextProps) => {
4297
- return prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.side === nextProps.side && prevProps.p === nextProps.p && prevProps.clip === nextProps.clip && prevProps.asChild === nextProps.asChild;
4298
- };
4299
4280
  const Inset = React.memo(React.forwardRef(({ asChild = false, children, style, side = "all", p: pProp, trim, clip, ...rest }, ref) => {
4300
4281
  const theme = useTheme$1();
4301
4282
  const paddingSize = pProp ?? trim ?? 4;
@@ -4315,7 +4296,7 @@ const Inset = React.memo(React.forwardRef(({ asChild = false, children, style, s
4315
4296
  ...rest,
4316
4297
  children
4317
4298
  });
4318
- }), areEqual$8);
4299
+ }));
4319
4300
  Inset.displayName = "Inset";
4320
4301
 
4321
4302
  //#endregion
@@ -4483,21 +4464,20 @@ Separator.displayName = "Separator";
4483
4464
  * </Stack>
4484
4465
  */
4485
4466
  const Stack = React.memo(({ children, direction = "vertical", gap, align, justify, wrap = "nowrap", asChild = false, style, width, height, flexGrow, flexShrink, padding, backgroundColor }) => {
4486
- const theme = useTheme$1();
4487
4467
  const stackStyle = useMemo(() => {
4488
4468
  const baseStyle = {
4489
4469
  display: "flex",
4490
4470
  flexDirection: direction === "horizontal" ? "row" : "column",
4491
4471
  flexWrap: wrap
4492
4472
  };
4493
- if (gap !== void 0) baseStyle.gap = theme.space[gap];
4473
+ if (gap !== void 0) baseStyle.gap = gap;
4494
4474
  if (align !== void 0) baseStyle.alignItems = align;
4495
4475
  if (justify !== void 0) baseStyle.justifyContent = justify;
4496
4476
  if (width !== void 0) baseStyle.width = width;
4497
4477
  if (height !== void 0) baseStyle.height = height;
4498
4478
  if (flexGrow !== void 0) baseStyle.flexGrow = flexGrow;
4499
4479
  if (flexShrink !== void 0) baseStyle.flexShrink = flexShrink;
4500
- if (padding !== void 0) baseStyle.padding = theme.space[padding];
4480
+ if (padding !== void 0) baseStyle.padding = padding;
4501
4481
  if (backgroundColor !== void 0) baseStyle.backgroundColor = backgroundColor;
4502
4482
  return baseStyle;
4503
4483
  }, [
@@ -4511,8 +4491,7 @@ const Stack = React.memo(({ children, direction = "vertical", gap, align, justif
4511
4491
  flexGrow,
4512
4492
  flexShrink,
4513
4493
  padding,
4514
- backgroundColor,
4515
- theme.space
4494
+ backgroundColor
4516
4495
  ]);
4517
4496
  return /* @__PURE__ */ jsx(asChild ? Slot : RnView, {
4518
4497
  style: [stackStyle, style],
@@ -4696,10 +4675,6 @@ AbsoluteCenter.displayName = "AbsoluteCenter";
4696
4675
 
4697
4676
  //#endregion
4698
4677
  //#region src/components/typography/Text.tsx
4699
- const areEqual$7 = (prevProps, nextProps) => {
4700
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.size === nextProps.size && prevProps.weight === nextProps.weight && prevProps.align === nextProps.align && prevProps.color === nextProps.color && prevProps.truncate === nextProps.truncate && prevProps.numberOfLines === nextProps.numberOfLines && prevProps.fontFamily === nextProps.fontFamily && prevProps.fontStyle === nextProps.fontStyle && prevProps.lineHeight === nextProps.lineHeight && prevProps.letterSpacing === nextProps.letterSpacing && prevProps.textDecorationLine === nextProps.textDecorationLine && prevProps.opacity === nextProps.opacity) return true;
4701
- return false;
4702
- };
4703
4678
  const TextComponent = React.memo(React.forwardRef(({ asChild = false, children, style, size = 3, weight, align, color, truncate, numberOfLines, fontFamily, fontStyle, lineHeight, letterSpacing, textDecorationLine, opacity, ...rest }, ref) => {
4704
4679
  const theme = useTheme$1();
4705
4680
  const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
@@ -4736,15 +4711,11 @@ const TextComponent = React.memo(React.forwardRef(({ asChild = false, children,
4736
4711
  ...rest,
4737
4712
  children
4738
4713
  });
4739
- }), areEqual$7);
4714
+ }));
4740
4715
  TextComponent.displayName = "Text";
4741
4716
 
4742
4717
  //#endregion
4743
4718
  //#region src/components/typography/Heading.tsx
4744
- const areEqual$6 = (prevProps, nextProps) => {
4745
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.size === nextProps.size && prevProps.weight === nextProps.weight && prevProps.align === nextProps.align && prevProps.color === nextProps.color && prevProps.truncate === nextProps.truncate && prevProps.numberOfLines === nextProps.numberOfLines && prevProps.fontFamily === nextProps.fontFamily && prevProps.opacity === nextProps.opacity) return true;
4746
- return false;
4747
- };
4748
4719
  const Heading = React.memo(React.forwardRef(({ asChild = false, children, style = {}, size = 4, weight = "bold", align, color, truncate, numberOfLines, fontFamily, opacity, ...rest }, ref) => {
4749
4720
  const theme = useTheme$1();
4750
4721
  const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
@@ -4787,15 +4758,11 @@ const Heading = React.memo(React.forwardRef(({ asChild = false, children, style
4787
4758
  ...rest,
4788
4759
  children
4789
4760
  });
4790
- }), areEqual$6);
4761
+ }));
4791
4762
  Heading.displayName = "Heading";
4792
4763
 
4793
4764
  //#endregion
4794
4765
  //#region src/components/typography/Strong.tsx
4795
- const areEqual$5 = (prevProps, nextProps) => {
4796
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.color === nextProps.color) return true;
4797
- return false;
4798
- };
4799
4766
  const Strong = React.memo(React.forwardRef(({ children, style = {}, color, ...rest }, ref) => {
4800
4767
  const theme = useTheme$1();
4801
4768
  const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
@@ -4815,15 +4782,11 @@ const Strong = React.memo(React.forwardRef(({ children, style = {}, color, ...re
4815
4782
  ...rest,
4816
4783
  children
4817
4784
  });
4818
- }), areEqual$5);
4785
+ }));
4819
4786
  Strong.displayName = "Strong";
4820
4787
 
4821
4788
  //#endregion
4822
4789
  //#region src/components/typography/Em.tsx
4823
- const areEqual$4 = (prevProps, nextProps) => {
4824
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.color === nextProps.color) return true;
4825
- return false;
4826
- };
4827
4790
  const Em = React.memo(React.forwardRef(({ children, style = {}, color, ...rest }, ref) => {
4828
4791
  const theme = useTheme$1();
4829
4792
  const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
@@ -4843,15 +4806,11 @@ const Em = React.memo(React.forwardRef(({ children, style = {}, color, ...rest }
4843
4806
  ...rest,
4844
4807
  children
4845
4808
  });
4846
- }), areEqual$4);
4809
+ }));
4847
4810
  Em.displayName = "Em";
4848
4811
 
4849
4812
  //#endregion
4850
4813
  //#region src/components/typography/Code.tsx
4851
- const areEqual$3 = (prevProps, nextProps) => {
4852
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.size === nextProps.size && prevProps.color === nextProps.color && prevProps.backgroundColor === nextProps.backgroundColor) return true;
4853
- return false;
4854
- };
4855
4814
  const Code = React.memo(React.forwardRef(({ children, style = {}, size = 2, color, backgroundColor, ...rest }, ref) => {
4856
4815
  const theme = useTheme$1();
4857
4816
  const isDark = useThemeMode$1() === "dark";
@@ -4880,15 +4839,11 @@ const Code = React.memo(React.forwardRef(({ children, style = {}, size = 2, colo
4880
4839
  ...rest,
4881
4840
  children
4882
4841
  });
4883
- }), areEqual$3);
4842
+ }));
4884
4843
  Code.displayName = "Code";
4885
4844
 
4886
4845
  //#endregion
4887
4846
  //#region src/components/typography/Kbd.tsx
4888
- const areEqual$2 = (prevProps, nextProps) => {
4889
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.color === nextProps.color && prevProps.backgroundColor === nextProps.backgroundColor && prevProps.size === nextProps.size) return true;
4890
- return false;
4891
- };
4892
4847
  const Kbd = React.memo(React.forwardRef(({ children, style = {}, color, backgroundColor, size = 1, ...rest }, ref) => {
4893
4848
  const theme = useTheme$1();
4894
4849
  const isDark = useThemeMode$1() === "dark";
@@ -4934,7 +4889,7 @@ const Kbd = React.memo(React.forwardRef(({ children, style = {}, color, backgrou
4934
4889
  children
4935
4890
  })
4936
4891
  });
4937
- }), areEqual$2);
4892
+ }));
4938
4893
  Kbd.displayName = "Kbd";
4939
4894
 
4940
4895
  //#endregion
@@ -4972,10 +4927,6 @@ Link.displayName = "Link";
4972
4927
 
4973
4928
  //#endregion
4974
4929
  //#region src/components/typography/Blockquote.tsx
4975
- const areEqual$1 = (prevProps, nextProps) => {
4976
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.textStyle === nextProps.textStyle && prevProps.color === nextProps.color && prevProps.borderColor === nextProps.borderColor && prevProps.quoteColor === nextProps.quoteColor) return true;
4977
- return false;
4978
- };
4979
4930
  const Blockquote = React.memo(React.forwardRef(({ children, style, textStyle = {}, color, borderColor, quoteColor, ...rest }, ref) => {
4980
4931
  const theme = useTheme$1();
4981
4932
  const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
@@ -5029,7 +4980,7 @@ const Blockquote = React.memo(React.forwardRef(({ children, style, textStyle = {
5029
4980
  ]
5030
4981
  })
5031
4982
  });
5032
- }), areEqual$1);
4983
+ }));
5033
4984
  Blockquote.displayName = "Blockquote";
5034
4985
 
5035
4986
  //#endregion
@@ -5063,10 +5014,6 @@ const getIconSize = (size) => {
5063
5014
  default: return 20;
5064
5015
  }
5065
5016
  };
5066
- const areEqual = (prevProps, nextProps) => {
5067
- if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.variant === nextProps.variant && prevProps.color === nextProps.color && prevProps.radius === nextProps.radius && prevProps.size === nextProps.size && prevProps.disabled === nextProps.disabled && prevProps.loading === nextProps.loading && prevProps.onPress === nextProps.onPress && prevProps.onLongPress === nextProps.onLongPress && prevProps.delayLongPress === nextProps.delayLongPress && prevProps.width === nextProps.width && prevProps.highContrast === nextProps.highContrast) return true;
5068
- return false;
5069
- };
5070
5017
  const Button = React.memo(React.forwardRef(({ children, style, variant = "solid", color, radius, size = 2, disabled, loading, onPress, accessibilityLabel, width, highContrast, hapticFeedback, ...rest }, ref) => {
5071
5018
  const theme = useTheme$1();
5072
5019
  const mode = useThemeMode$1();
@@ -5247,7 +5194,7 @@ const Button = React.memo(React.forwardRef(({ children, style, variant = "solid"
5247
5194
  rightIcons.map((icon, index) => renderIcon(icon, index))
5248
5195
  ] })
5249
5196
  });
5250
- }), areEqual);
5197
+ }));
5251
5198
  Button.displayName = "Button";
5252
5199
  Button.Icon = ButtonIcon;
5253
5200
  Button.Label = ButtonLabel;
@@ -5384,8 +5331,8 @@ const TextFieldRoot = React.forwardRef(({ children, ...props }, ref) => {
5384
5331
  const variantColors = getVariantColors(theme, activeColor, mode, variant || "outline", highContrast || false);
5385
5332
  const [isFocused, setIsFocused] = React.useState(false);
5386
5333
  const getSizeValues = () => {
5387
- switch (size) {
5388
- case "1": return {
5334
+ switch (Number(size)) {
5335
+ case 1: return {
5389
5336
  fontSize: theme.typography.fontSizes[4].fontSize,
5390
5337
  paddingVertical: theme.space[2],
5391
5338
  paddingHorizontal: theme.space[3],
@@ -5393,7 +5340,7 @@ const TextFieldRoot = React.forwardRef(({ children, ...props }, ref) => {
5393
5340
  height: multiline ? void 0 : 36,
5394
5341
  slotPadding: theme.space[1]
5395
5342
  };
5396
- case "3": return {
5343
+ case 3: return {
5397
5344
  fontSize: theme.typography.fontSizes[6].fontSize,
5398
5345
  paddingVertical: theme.space[4],
5399
5346
  paddingHorizontal: theme.space[4],
@@ -5656,13 +5603,13 @@ const TextAreaRoot = React.forwardRef(({ children, ...props }, ref) => {
5656
5603
  const variantColors = getVariantColors(theme, activeColor, mode, variant, highContrast);
5657
5604
  const accentColorScale = getColorScale(theme, activeColor, mode);
5658
5605
  const getSizeValues = () => {
5659
- switch (size) {
5660
- case "1": return {
5606
+ switch (Number(size)) {
5607
+ case 1: return {
5661
5608
  fontSize: theme.typography.fontSizes[4].fontSize,
5662
5609
  padding: theme.space[2],
5663
5610
  height: 100
5664
5611
  };
5665
- case "3": return {
5612
+ case 3: return {
5666
5613
  fontSize: theme.typography.fontSizes[6].fontSize,
5667
5614
  padding: theme.space[4],
5668
5615
  height: 140
@@ -5826,8 +5773,8 @@ const Checkbox = React.forwardRef(({ checked, defaultChecked = false, onCheckedC
5826
5773
  getContrast(theme, activeColor, mode, highContrast);
5827
5774
  const variantColors = getVariantColors(theme, activeColor, mode, variant, highContrast);
5828
5775
  const getSizeValues = () => {
5829
- switch (size) {
5830
- case "1": return {
5776
+ switch (Number(size)) {
5777
+ case 1: return {
5831
5778
  boxSize: 20,
5832
5779
  iconSize: 11,
5833
5780
  fontSize: theme.typography.fontSizes[1].fontSize,
@@ -5835,7 +5782,7 @@ const Checkbox = React.forwardRef(({ checked, defaultChecked = false, onCheckedC
5835
5782
  borderWidth: 1,
5836
5783
  height: 2.5
5837
5784
  };
5838
- case "3": return {
5785
+ case 3: return {
5839
5786
  boxSize: 28,
5840
5787
  iconSize: 16,
5841
5788
  fontSize: theme.typography.fontSizes[3].fontSize,
@@ -6052,15 +5999,15 @@ const CheckboxCardsItem = React.forwardRef(({ value, side: itemSide, disabled: i
6052
5999
  getAccentColor(theme, mode);
6053
6000
  const variantColors = getVariantColors(theme, color || theme.accentColor, mode, variant, highContrast);
6054
6001
  const getSizeValues = () => {
6055
- switch (size) {
6056
- case "1": return {
6002
+ switch (Number(size)) {
6003
+ case 1: return {
6057
6004
  padding: theme.space[3],
6058
6005
  indicatorSize: 18,
6059
6006
  innerIndicatorSize: 6,
6060
6007
  borderWidth: 1,
6061
6008
  checkHeight: 2.2
6062
6009
  };
6063
- case "3": return {
6010
+ case 3: return {
6064
6011
  padding: theme.space[5],
6065
6012
  indicatorSize: 26,
6066
6013
  innerIndicatorSize: 10,
@@ -6159,15 +6106,15 @@ const Radio = React.forwardRef(({ defaultChecked, value, selected, onSelect, dis
6159
6106
  const [isInternallySelected, setIsInternallySelected] = React.useState(defaultChecked ?? false);
6160
6107
  const isSelected = selected !== void 0 ? selected : isInternallySelected;
6161
6108
  const getSizeValues = () => {
6162
- switch (size) {
6163
- case "1": return {
6109
+ switch (Number(size)) {
6110
+ case 1: return {
6164
6111
  boxSize: 18,
6165
6112
  innerSize: 6,
6166
6113
  iconSize: 8,
6167
6114
  fontSize: theme.typography.fontSizes[1].fontSize,
6168
6115
  gap: theme.space[1]
6169
6116
  };
6170
- case "3": return {
6117
+ case 3: return {
6171
6118
  boxSize: 28,
6172
6119
  innerSize: 12,
6173
6120
  iconSize: 16,
@@ -6390,14 +6337,14 @@ const RadioCardsItem = React.forwardRef(({ value, side: itemSide, disabled: item
6390
6337
  getAccentColor(theme, mode);
6391
6338
  const variantColors = getVariantColors(theme, color || theme.accentColor, mode, variant, highContrast);
6392
6339
  const getSizeValues = () => {
6393
- switch (size) {
6394
- case "1": return {
6340
+ switch (Number(size)) {
6341
+ case 1: return {
6395
6342
  padding: theme.space[3],
6396
6343
  indicatorSize: 18,
6397
6344
  innerIndicatorSize: 8,
6398
6345
  borderWidth: 1
6399
6346
  };
6400
- case "3": return {
6347
+ case 3: return {
6401
6348
  padding: theme.space[5],
6402
6349
  indicatorSize: 26,
6403
6350
  innerIndicatorSize: 12,
@@ -6525,15 +6472,15 @@ const Switch = React.forwardRef(({ defaultChecked, checked, onCheckedChange, dis
6525
6472
  }).start();
6526
6473
  }, [isChecked]);
6527
6474
  const getSizeValues = () => {
6528
- switch (size) {
6529
- case "1": return {
6475
+ switch (Number(size)) {
6476
+ case 1: return {
6530
6477
  trackWidth: 32,
6531
6478
  trackHeight: 20,
6532
6479
  thumbSize: 14,
6533
6480
  gap: theme.space[1],
6534
6481
  fontSize: theme.typography.fontSizes[1].fontSize
6535
6482
  };
6536
- case "3": return {
6483
+ case 3: return {
6537
6484
  trackWidth: 58,
6538
6485
  trackHeight: 32,
6539
6486
  thumbSize: 26,
@@ -7576,18 +7523,18 @@ const Slider = React.forwardRef(({ value: controlledValue, defaultValue, onValue
7576
7523
  };
7577
7524
  const thumbAnimations = useRef(values.map((v) => new Animated.Value(getInitialPosition(v)))).current;
7578
7525
  const sizeValues = useMemo(() => {
7579
- switch (size) {
7580
- case "1": return {
7526
+ switch (Number(size)) {
7527
+ case 1: return {
7581
7528
  trackHeight: 4,
7582
7529
  thumbSize: 16,
7583
7530
  fontSize: theme.typography.fontSizes[1].fontSize
7584
7531
  };
7585
- case "3": return {
7532
+ case 3: return {
7586
7533
  trackHeight: 8,
7587
7534
  thumbSize: 28,
7588
7535
  fontSize: theme.typography.fontSizes[3].fontSize
7589
7536
  };
7590
- case "4": return {
7537
+ case 4: return {
7591
7538
  trackHeight: 10,
7592
7539
  thumbSize: 34,
7593
7540
  fontSize: theme.typography.fontSizes[4].fontSize
@@ -11910,7 +11857,7 @@ const DataList = {
11910
11857
 
11911
11858
  //#endregion
11912
11859
  //#region src/components/data-display/FancyList.tsx
11913
- const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true, scrollable = true, itemPadding, ListEmptyComponent, ListHeaderComponent, ListFooterComponent }) => {
11860
+ const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true, scrollable = true, itemPadding, ListEmptyComponent, ListHeaderComponent, ListFooterComponent, ListBackend: Backend = RnFlatList, backendProps }) => {
11914
11861
  const theme = useTheme$1();
11915
11862
  const isDark = useThemeMode$1() === "dark";
11916
11863
  isDark ? theme.colors.gray.dark : theme.colors.gray;
@@ -11963,7 +11910,8 @@ const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true,
11963
11910
  });
11964
11911
  return /* @__PURE__ */ jsx(RnView, {
11965
11912
  style: [styles$9.container, style],
11966
- children: /* @__PURE__ */ jsx(RnFlatList, {
11913
+ children: /* @__PURE__ */ jsx(Backend, {
11914
+ ...backendProps,
11967
11915
  data,
11968
11916
  renderItem: renderListItem,
11969
11917
  keyExtractor: defaultKeyExtractor,
@@ -12175,11 +12123,9 @@ const PULSE_ANIMATION = {
12175
12123
  duration: 1e3,
12176
12124
  useNativeDriver: true
12177
12125
  };
12178
- const SKELEON_COLORS = {
12179
- light: "#E5E7EB",
12180
- dark: "#D1D5DB"
12181
- };
12182
12126
  const Skeleton = React.forwardRef(({ children, loading = true, style, textStyle, width, height, accessibilityLabel = "Loading", testID }, ref) => {
12127
+ const theme = useTheme$1();
12128
+ const grayScale = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
12183
12129
  const pulseAnim = useRef(new Animated.Value(0)).current;
12184
12130
  useEffect(() => {
12185
12131
  const animation = Animated.loop(Animated.sequence([Animated.timing(pulseAnim, {
@@ -12194,18 +12140,21 @@ const Skeleton = React.forwardRef(({ children, loading = true, style, textStyle,
12194
12140
  animation.stop();
12195
12141
  };
12196
12142
  }, [pulseAnim]);
12197
- const pulseStyle = { backgroundColor: pulseAnim.interpolate({
12143
+ const pulseStyle = { opacity: pulseAnim.interpolate({
12198
12144
  inputRange: [0, 1],
12199
- outputRange: [SKELEON_COLORS.light, SKELEON_COLORS.dark]
12145
+ outputRange: [.55, 1]
12200
12146
  }) };
12147
+ const skeletonBackground = { backgroundColor: grayScale[3] };
12201
12148
  if (!loading) return /* @__PURE__ */ jsx(Fragment, { children });
12202
12149
  if (!React.isValidElement(children) && typeof children === "string") return /* @__PURE__ */ jsx(Animated.Text, {
12203
12150
  ref,
12204
12151
  style: [
12205
- textStyle,
12152
+ styles$6.inlineText,
12153
+ skeletonBackground,
12206
12154
  pulseStyle,
12207
12155
  width !== void 0 ? { width } : void 0,
12208
- height !== void 0 ? { height } : void 0
12156
+ height !== void 0 ? { height } : void 0,
12157
+ textStyle
12209
12158
  ],
12210
12159
  accessibilityLabel,
12211
12160
  accessibilityRole: "progressbar",
@@ -12216,6 +12165,7 @@ const Skeleton = React.forwardRef(({ children, loading = true, style, textStyle,
12216
12165
  ref,
12217
12166
  style: [
12218
12167
  styles$6.blockContainer,
12168
+ skeletonBackground,
12219
12169
  pulseStyle,
12220
12170
  width !== void 0 ? { width } : void 0,
12221
12171
  height !== void 0 ? { height } : void 0,
@@ -12342,12 +12292,12 @@ const TableColumnHeaderCell = React.forwardRef(({ children, width, align = "left
12342
12292
  const theme = useTheme$1();
12343
12293
  const grayScale = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
12344
12294
  const getSizePadding = () => {
12345
- switch (context.size) {
12346
- case "1": return {
12295
+ switch (Number(context.size)) {
12296
+ case 1: return {
12347
12297
  paddingVertical: theme.space[2],
12348
12298
  paddingHorizontal: theme.space[3]
12349
12299
  };
12350
- case "3": return {
12300
+ case 3: return {
12351
12301
  paddingVertical: theme.space[4],
12352
12302
  paddingHorizontal: theme.space[5]
12353
12303
  };
@@ -12358,9 +12308,9 @@ const TableColumnHeaderCell = React.forwardRef(({ children, width, align = "left
12358
12308
  }
12359
12309
  };
12360
12310
  const getSizeFont = () => {
12361
- switch (context.size) {
12362
- case "1": return { fontSize: theme.typography.fontSizes[1].fontSize };
12363
- case "3": return { fontSize: theme.typography.fontSizes[3].fontSize };
12311
+ switch (Number(context.size)) {
12312
+ case 1: return { fontSize: theme.typography.fontSizes[1].fontSize };
12313
+ case 3: return { fontSize: theme.typography.fontSizes[3].fontSize };
12364
12314
  default: return { fontSize: theme.typography.fontSizes[2].fontSize };
12365
12315
  }
12366
12316
  };
@@ -12397,12 +12347,12 @@ const TableCell = React.forwardRef(({ children, align = "left", style }, ref) =>
12397
12347
  const theme = useTheme$1();
12398
12348
  const grayScale = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
12399
12349
  const getSizePadding = () => {
12400
- switch (context.size) {
12401
- case "1": return {
12350
+ switch (Number(context.size)) {
12351
+ case 1: return {
12402
12352
  paddingVertical: theme.space[2],
12403
12353
  paddingHorizontal: theme.space[3]
12404
12354
  };
12405
- case "3": return {
12355
+ case 3: return {
12406
12356
  paddingVertical: theme.space[4],
12407
12357
  paddingHorizontal: theme.space[5]
12408
12358
  };
@@ -12413,9 +12363,9 @@ const TableCell = React.forwardRef(({ children, align = "left", style }, ref) =>
12413
12363
  }
12414
12364
  };
12415
12365
  const getSizeFont = () => {
12416
- switch (context.size) {
12417
- case "1": return { fontSize: theme.typography.fontSizes[1].fontSize };
12418
- case "3": return { fontSize: theme.typography.fontSizes[3].fontSize };
12366
+ switch (Number(context.size)) {
12367
+ case 1: return { fontSize: theme.typography.fontSizes[1].fontSize };
12368
+ case 3: return { fontSize: theme.typography.fontSizes[3].fontSize };
12419
12369
  default: return { fontSize: theme.typography.fontSizes[2].fontSize };
12420
12370
  }
12421
12371
  };
@@ -13083,15 +13033,15 @@ const AccordionTrigger = React.forwardRef(({ children, style, icon, hapticFeedba
13083
13033
  }).start();
13084
13034
  }, [open, rotationAnim]);
13085
13035
  const getSizeStyles = () => {
13086
- switch (size) {
13087
- case "1": return {
13036
+ switch (Number(size)) {
13037
+ case 1: return {
13088
13038
  paddingVertical: theme.space[2],
13089
13039
  paddingHorizontal: theme.space[3],
13090
13040
  fontSize: theme.typography.fontSizes[1].fontSize,
13091
13041
  lineHeight: theme.typography.fontSizes[1].lineHeight,
13092
13042
  iconSize: 14
13093
13043
  };
13094
- case "3": return {
13044
+ case 3: return {
13095
13045
  paddingVertical: theme.space[4],
13096
13046
  paddingHorizontal: theme.space[5],
13097
13047
  fontSize: theme.typography.fontSizes[4].fontSize,
@@ -13197,9 +13147,9 @@ const AccordionContent = React.forwardRef(({ children, style }, ref) => {
13197
13147
  const heightAnim = useRef(new Animated.Value(0)).current;
13198
13148
  const opacityAnim = useRef(new Animated.Value(0)).current;
13199
13149
  const getContentPadding = () => {
13200
- switch (size) {
13201
- case "1": return theme.space[2];
13202
- case "3": return theme.space[5];
13150
+ switch (Number(size)) {
13151
+ case 1: return theme.space[2];
13152
+ case 3: return theme.space[5];
13203
13153
  default: return theme.space[4];
13204
13154
  }
13205
13155
  };
@@ -13326,4 +13276,13 @@ const useResponsive = (breakpoints = defaultBreakpoints) => {
13326
13276
  };
13327
13277
 
13328
13278
  //#endregion
13329
- export { AbsoluteCenter, Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, AccordionTrigger, RnActivityIndicator as ActivityIndicator, AlertDialogComponent as AlertDialog, AnimatedPressable, AspectRatio, Avatar, Badge, Blockquote, BottomSheet, Box, Button, ButtonIcon, ButtonLabel, Callout, CalloutIcon, CalloutRoot, CalloutText, Card, Center, Checkbox, CheckboxCards, CheckboxCardsItem, CheckboxCardsRoot, CheckboxGroup, Code, Container, ContextMenu, DataList, DataListItem, DataListLabel, DataListRoot, DataListValue, Dialog, DropdownMenu, Em, FancyList, RnFlatList as FlatList, Flex, Grid, HCenter, HStack, Heading, IconButton, RnImage as Image, Inset, Kbd, Link, ManagedPortal, Popover, Portal, PortalProvider, RnPressable as Pressable, RnText as PrimitiveText, Progress, Radio, RadioCards, RadioCardsItem, RadioCardsRoot, RadioGroup, RadioGroupItem, RadioGroupRoot, ScrollArea, RnScrollView as ScrollView, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectOverlay, SelectPortal, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Separator, Sidebar, Skeleton, Slider, Slot, Spacer, Spinner, Stack, Strong, Switch, TabNav, Table, Tabs, TextComponent as Text, TextArea, TextField, RnTextInput as TextInput, ThemeProvider, Toast, TooltipExport as Tooltip, RnTouchableHighlight as TouchableHighlight, RnTouchableOpacity as TouchableOpacity, VCenter, VStack, RnView as View, VisuallyHidden, addColorSchemeListener, amber, amberAlpha, black, blackAlpha, blue, blueAlpha, bronze, bronzeAlpha, brown, brownAlpha, calculatePopoverPosition, createTheme, crimson, crimsonAlpha, cyan, cyanAlpha, defaultTheme, fontFamilies, getAccentAlpha, getAccentAlphaScale, getAccentColor, getAccentContrast, getAccentScale, getAccentTextColor, getActiveColors, getColorAlpha, getColorScale, getColorScheme, getContrast, getDisabledColors, getExtendedAccentScale, getFocusColor, getForegroundColor, getGrayAlpha, getGrayScale, getHighContrastBackground, getHighContrastTextColor, getHoverColors, getRadii, getSelectionColor, getShadow, getShadows, getSpace, getThemeColors, getThemeShadow, getTypography, getVariantColors, gold, goldAlpha, grass, grassAlpha, gray, grayAlpha, green, greenAlpha, indigo, indigoAlpha, iris, irisAlpha, jade, jadeAlpha, lime, limeAlpha, mauve, mauveAlpha, mint, mintAlpha, needsDarkText, olive, oliveAlpha, orange, orangeAlpha, pink, pinkAlpha, plum, plumAlpha, purple, purpleAlpha, radii, radiusFactors, red, redAlpha, ruby, rubyAlpha, sage, sageAlpha, sand, sandAlpha, scalingOptions, shadows, sky, skyAlpha, slate, slateAlpha, space, teal, tealAlpha, tomato, tomatoAlpha, typography, useAnchorPosition, useDeviceColorScheme, useHaptics, usePortal, useResponsive, useTheme, useThemeActions, useThemeColors, useThemeContext, useThemeMode, useToast, useToastContext, violet, violetAlpha, white, whiteAlpha, yellow, yellowAlpha };
13279
+ //#region src/utils/size.ts
13280
+ /**
13281
+ * Normalize a SizeInput to its canonical numeric form.
13282
+ * Returns the value unchanged when already numeric, the parsed number for
13283
+ * legacy string inputs, or `undefined` when absent.
13284
+ */
13285
+ const toNumericSize = (size) => size === void 0 ? void 0 : Number(size);
13286
+
13287
+ //#endregion
13288
+ export { AbsoluteCenter, Accordion, AccordionContent, AccordionHeader, AccordionItem, AccordionRoot, AccordionTrigger, RnActivityIndicator as ActivityIndicator, AlertDialogComponent as AlertDialog, AnimatedPressable, AspectRatio, Avatar, Badge, Blockquote, BottomSheet, Box, Button, ButtonIcon, ButtonLabel, Callout, CalloutIcon, CalloutRoot, CalloutText, Card, Center, Checkbox, CheckboxCards, CheckboxCardsItem, CheckboxCardsRoot, CheckboxGroup, Code, Container, ContextMenu, DataList, DataListItem, DataListLabel, DataListRoot, DataListValue, Dialog, DropdownMenu, Em, FancyList, RnFlatList as FlatList, Flex, Grid, HCenter, HStack, Heading, IconButton, RnImage as Image, Inset, Kbd, Link, ManagedPortal, Popover, Portal, PortalProvider, RnPressable as Pressable, RnText as PrimitiveText, Progress, Radio, RadioCards, RadioCardsItem, RadioCardsRoot, RadioGroup, RadioGroupItem, RadioGroupRoot, ScrollArea, RnScrollView as ScrollView, SegmentedControl, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectOverlay, SelectPortal, SelectRoot, SelectSeparator, SelectTrigger, SelectValue, Separator, Sidebar, Skeleton, Slider, Slot, Spacer, Spinner, Stack, Strong, Switch, TabNav, Table, Tabs, TextComponent as Text, TextArea, TextField, RnTextInput as TextInput, ThemeProvider, Toast, TooltipExport as Tooltip, RnTouchableHighlight as TouchableHighlight, RnTouchableOpacity as TouchableOpacity, VCenter, VStack, RnView as View, VisuallyHidden, addColorSchemeListener, amber, amberAlpha, black, blackAlpha, blue, blueAlpha, bronze, bronzeAlpha, brown, brownAlpha, calculatePopoverPosition, createTheme, crimson, crimsonAlpha, cyan, cyanAlpha, defaultTheme, fontFamilies, getAccentAlpha, getAccentAlphaScale, getAccentColor, getAccentContrast, getAccentScale, getAccentTextColor, getActiveColors, getColorAlpha, getColorScale, getColorScheme, getContrast, getDisabledColors, getExtendedAccentScale, getFocusColor, getForegroundColor, getGrayAlpha, getGrayScale, getHighContrastBackground, getHighContrastTextColor, getHoverColors, getRadii, getSelectionColor, getShadow, getShadows, getSpace, getThemeColors, getThemeShadow, getTypography, getVariantColors, gold, goldAlpha, grass, grassAlpha, gray, grayAlpha, green, greenAlpha, indigo, indigoAlpha, iris, irisAlpha, jade, jadeAlpha, lime, limeAlpha, mauve, mauveAlpha, mint, mintAlpha, needsDarkText, olive, oliveAlpha, orange, orangeAlpha, pink, pinkAlpha, plum, plumAlpha, purple, purpleAlpha, radii, radiusFactors, red, redAlpha, ruby, rubyAlpha, sage, sageAlpha, sand, sandAlpha, scalingOptions, shadows, sky, skyAlpha, slate, slateAlpha, space, teal, tealAlpha, toNumericSize, tomato, tomatoAlpha, typography, useAnchorPosition, useDeviceColorScheme, useHaptics, usePortal, useResponsive, useTheme, useThemeActions, useThemeColors, useThemeContext, useThemeMode, useToast, useToastContext, violet, violetAlpha, white, whiteAlpha, yellow, yellowAlpha };
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "radix-native-ui",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "A React Native component library inspired by the Radix Themes design system",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
+ "sideEffects": false,
7
8
  "types": "dist/index.d.mts",
8
9
  "type": "module",
9
10
  "exports": {
@@ -21,6 +22,18 @@
21
22
  "files": [
22
23
  "dist"
23
24
  ],
25
+ "scripts": {
26
+ "build": "tsdown",
27
+ "dev": "tsdown --watch",
28
+ "build:tsdown": "tsdown",
29
+ "dev:tsdown": "tsdown --watch",
30
+ "test": "jest",
31
+ "clean": "rm -rf dist .turbo coverage",
32
+ "yalc:publish": "yalc publish",
33
+ "yalc:push": "yalc push",
34
+ "yalc:watch": "yalc publish --watch",
35
+ "dev:for-demo-app": "pnpm dev:tsdown && pnpm yalc:watch"
36
+ },
24
37
  "peerDependencies": {
25
38
  "expo": ">=48",
26
39
  "expo-haptics": "^55.0.8",
@@ -30,7 +43,7 @@
30
43
  "devDependencies": {
31
44
  "@react-native/babel-preset": "^0.81.5",
32
45
  "@testing-library/react-native": "^13.3.3",
33
- "@types/react": "^19.2.10",
46
+ "@types/react": "19.1.17",
34
47
  "jest": "^29.6.0",
35
48
  "react": "^19.1.0",
36
49
  "react-native": "^0.81.5",
@@ -54,17 +67,5 @@
54
67
  "bugs": {
55
68
  "url": "https://github.com/Copy-Labs/radix-native-ui/issues"
56
69
  },
57
- "homepage": "https://github.com/Copy-Labs/radix-native-ui#readme",
58
- "scripts": {
59
- "build": "tsdown",
60
- "dev": "tsdown --watch",
61
- "build:tsdown": "tsdown",
62
- "dev:tsdown": "tsdown --watch",
63
- "test": "jest",
64
- "clean": "rm -rf dist .turbo coverage",
65
- "yalc:publish": "yalc publish",
66
- "yalc:push": "yalc push",
67
- "yalc:watch": "yalc publish --watch",
68
- "dev:for-demo-app": "pnpm dev:tsdown && pnpm yalc:watch"
69
- }
70
- }
70
+ "homepage": "https://github.com/Copy-Labs/radix-native-ui#readme"
71
+ }