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/README.md +1 -1
- package/dist/index.cjs +82 -122
- package/dist/index.d.cts +77 -32
- package/dist/index.d.mts +77 -32
- package/dist/index.mjs +82 -123
- package/package.json +17 -16
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -313,7 +313,7 @@ If you're familiar with Radix Themes for web, here are the key differences for R
|
|
|
313
313
|
|------------------|-------------------------------|
|
|
314
314
|
| `css={{ p: '$4' }}` | `padding={4}` |
|
|
315
315
|
| `variant="solid"` | `variant="solid"` (same) |
|
|
316
|
-
| `size="2"` | `size={2}` (number
|
|
316
|
+
| `size="2"` | `size={2}` (number is canonical; strings also accepted) |
|
|
317
317
|
| `onClick` | `onPress` |
|
|
318
318
|
| `color="red"` | `color="red"` (same) |
|
|
319
319
|
|
package/dist/index.cjs
CHANGED
|
@@ -3960,10 +3960,6 @@ AnimatedPressable.displayName = "AnimatedPressable";
|
|
|
3960
3960
|
|
|
3961
3961
|
//#endregion
|
|
3962
3962
|
//#region src/components/layout/Box.tsx
|
|
3963
|
-
const areEqual$12 = (prevProps, nextProps) => {
|
|
3964
|
-
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;
|
|
3965
|
-
return false;
|
|
3966
|
-
};
|
|
3967
3963
|
const Box = react.default.memo(react.default.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) => {
|
|
3968
3964
|
const theme = useTheme$1();
|
|
3969
3965
|
const colors = theme.colors.gray;
|
|
@@ -4077,7 +4073,7 @@ const Box = react.default.memo(react.default.forwardRef(({ asChild = false, chil
|
|
|
4077
4073
|
...rest,
|
|
4078
4074
|
children
|
|
4079
4075
|
});
|
|
4080
|
-
})
|
|
4076
|
+
}));
|
|
4081
4077
|
Box.displayName = "Box";
|
|
4082
4078
|
|
|
4083
4079
|
//#endregion
|
|
@@ -4127,10 +4123,6 @@ Slot.displayName = "Slot";
|
|
|
4127
4123
|
|
|
4128
4124
|
//#endregion
|
|
4129
4125
|
//#region src/components/layout/Flex.tsx
|
|
4130
|
-
const areEqual$11 = (prevProps, nextProps) => {
|
|
4131
|
-
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;
|
|
4132
|
-
return false;
|
|
4133
|
-
};
|
|
4134
4126
|
const Flex = react.default.memo(react.default.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) => {
|
|
4135
4127
|
const theme = useTheme$1();
|
|
4136
4128
|
const flexStyle = (0, react.useMemo)(() => ({
|
|
@@ -4228,15 +4220,11 @@ const Flex = react.default.memo(react.default.forwardRef(({ asChild = false, chi
|
|
|
4228
4220
|
...rest,
|
|
4229
4221
|
children
|
|
4230
4222
|
});
|
|
4231
|
-
})
|
|
4223
|
+
}));
|
|
4232
4224
|
Flex.displayName = "Flex";
|
|
4233
4225
|
|
|
4234
4226
|
//#endregion
|
|
4235
4227
|
//#region src/components/layout/Grid.tsx
|
|
4236
|
-
const areEqual$10 = (prevProps, nextProps) => {
|
|
4237
|
-
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;
|
|
4238
|
-
return false;
|
|
4239
|
-
};
|
|
4240
4228
|
const Grid = react.default.memo(react.default.forwardRef(({ children, style = {}, columns = 1, gap, rowGap, columnGap, align = "stretch", justify = "flex-start", columnWidth, ...rest }, ref) => {
|
|
4241
4229
|
const theme = useTheme$1();
|
|
4242
4230
|
useThemeMode();
|
|
@@ -4272,7 +4260,7 @@ const Grid = react.default.memo(react.default.forwardRef(({ children, style = {}
|
|
|
4272
4260
|
...rest,
|
|
4273
4261
|
children: childrenWithWidth
|
|
4274
4262
|
});
|
|
4275
|
-
})
|
|
4263
|
+
}));
|
|
4276
4264
|
Grid.displayName = "Grid";
|
|
4277
4265
|
|
|
4278
4266
|
//#endregion
|
|
@@ -4283,10 +4271,6 @@ const containerMaxWidths = {
|
|
|
4283
4271
|
3: 640,
|
|
4284
4272
|
4: 896
|
|
4285
4273
|
};
|
|
4286
|
-
const areEqual$9 = (prevProps, nextProps) => {
|
|
4287
|
-
if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.size === nextProps.size && prevProps.responsive === nextProps.responsive) return true;
|
|
4288
|
-
return false;
|
|
4289
|
-
};
|
|
4290
4274
|
const Container = react.default.memo(react.default.forwardRef(({ children, style, size = 2, responsive = true, ...rest }, ref) => {
|
|
4291
4275
|
const theme = useTheme$1();
|
|
4292
4276
|
const maxWidth = containerMaxWidths[size];
|
|
@@ -4305,7 +4289,7 @@ const Container = react.default.memo(react.default.forwardRef(({ children, style
|
|
|
4305
4289
|
...rest,
|
|
4306
4290
|
children
|
|
4307
4291
|
});
|
|
4308
|
-
})
|
|
4292
|
+
}));
|
|
4309
4293
|
Container.displayName = "Container";
|
|
4310
4294
|
|
|
4311
4295
|
//#endregion
|
|
@@ -4322,9 +4306,6 @@ const getPaddingStyles = (side, spacing) => {
|
|
|
4322
4306
|
};
|
|
4323
4307
|
return paddingMap[side] ?? paddingMap.all;
|
|
4324
4308
|
};
|
|
4325
|
-
const areEqual$8 = (prevProps, nextProps) => {
|
|
4326
|
-
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;
|
|
4327
|
-
};
|
|
4328
4309
|
const Inset = react.default.memo(react.default.forwardRef(({ asChild = false, children, style, side = "all", p: pProp, trim, clip, ...rest }, ref) => {
|
|
4329
4310
|
const theme = useTheme$1();
|
|
4330
4311
|
const paddingSize = pProp ?? trim ?? 4;
|
|
@@ -4344,7 +4325,7 @@ const Inset = react.default.memo(react.default.forwardRef(({ asChild = false, ch
|
|
|
4344
4325
|
...rest,
|
|
4345
4326
|
children
|
|
4346
4327
|
});
|
|
4347
|
-
})
|
|
4328
|
+
}));
|
|
4348
4329
|
Inset.displayName = "Inset";
|
|
4349
4330
|
|
|
4350
4331
|
//#endregion
|
|
@@ -4512,21 +4493,20 @@ Separator.displayName = "Separator";
|
|
|
4512
4493
|
* </Stack>
|
|
4513
4494
|
*/
|
|
4514
4495
|
const Stack = react.default.memo(({ children, direction = "vertical", gap, align, justify, wrap = "nowrap", asChild = false, style, width, height, flexGrow, flexShrink, padding, backgroundColor }) => {
|
|
4515
|
-
const theme = useTheme$1();
|
|
4516
4496
|
const stackStyle = (0, react.useMemo)(() => {
|
|
4517
4497
|
const baseStyle = {
|
|
4518
4498
|
display: "flex",
|
|
4519
4499
|
flexDirection: direction === "horizontal" ? "row" : "column",
|
|
4520
4500
|
flexWrap: wrap
|
|
4521
4501
|
};
|
|
4522
|
-
if (gap !== void 0) baseStyle.gap =
|
|
4502
|
+
if (gap !== void 0) baseStyle.gap = gap;
|
|
4523
4503
|
if (align !== void 0) baseStyle.alignItems = align;
|
|
4524
4504
|
if (justify !== void 0) baseStyle.justifyContent = justify;
|
|
4525
4505
|
if (width !== void 0) baseStyle.width = width;
|
|
4526
4506
|
if (height !== void 0) baseStyle.height = height;
|
|
4527
4507
|
if (flexGrow !== void 0) baseStyle.flexGrow = flexGrow;
|
|
4528
4508
|
if (flexShrink !== void 0) baseStyle.flexShrink = flexShrink;
|
|
4529
|
-
if (padding !== void 0) baseStyle.padding =
|
|
4509
|
+
if (padding !== void 0) baseStyle.padding = padding;
|
|
4530
4510
|
if (backgroundColor !== void 0) baseStyle.backgroundColor = backgroundColor;
|
|
4531
4511
|
return baseStyle;
|
|
4532
4512
|
}, [
|
|
@@ -4540,8 +4520,7 @@ const Stack = react.default.memo(({ children, direction = "vertical", gap, align
|
|
|
4540
4520
|
flexGrow,
|
|
4541
4521
|
flexShrink,
|
|
4542
4522
|
padding,
|
|
4543
|
-
backgroundColor
|
|
4544
|
-
theme.space
|
|
4523
|
+
backgroundColor
|
|
4545
4524
|
]);
|
|
4546
4525
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(asChild ? Slot : RnView, {
|
|
4547
4526
|
style: [stackStyle, style],
|
|
@@ -4725,10 +4704,6 @@ AbsoluteCenter.displayName = "AbsoluteCenter";
|
|
|
4725
4704
|
|
|
4726
4705
|
//#endregion
|
|
4727
4706
|
//#region src/components/typography/Text.tsx
|
|
4728
|
-
const areEqual$7 = (prevProps, nextProps) => {
|
|
4729
|
-
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;
|
|
4730
|
-
return false;
|
|
4731
|
-
};
|
|
4732
4707
|
const TextComponent = react.default.memo(react.default.forwardRef(({ asChild = false, children, style, size = 3, weight, align, color, truncate, numberOfLines, fontFamily, fontStyle, lineHeight, letterSpacing, textDecorationLine, opacity, ...rest }, ref) => {
|
|
4733
4708
|
const theme = useTheme$1();
|
|
4734
4709
|
const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
@@ -4765,15 +4740,11 @@ const TextComponent = react.default.memo(react.default.forwardRef(({ asChild = f
|
|
|
4765
4740
|
...rest,
|
|
4766
4741
|
children
|
|
4767
4742
|
});
|
|
4768
|
-
})
|
|
4743
|
+
}));
|
|
4769
4744
|
TextComponent.displayName = "Text";
|
|
4770
4745
|
|
|
4771
4746
|
//#endregion
|
|
4772
4747
|
//#region src/components/typography/Heading.tsx
|
|
4773
|
-
const areEqual$6 = (prevProps, nextProps) => {
|
|
4774
|
-
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;
|
|
4775
|
-
return false;
|
|
4776
|
-
};
|
|
4777
4748
|
const Heading = react.default.memo(react.default.forwardRef(({ asChild = false, children, style = {}, size = 4, weight = "bold", align, color, truncate, numberOfLines, fontFamily, opacity, ...rest }, ref) => {
|
|
4778
4749
|
const theme = useTheme$1();
|
|
4779
4750
|
const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
@@ -4816,15 +4787,11 @@ const Heading = react.default.memo(react.default.forwardRef(({ asChild = false,
|
|
|
4816
4787
|
...rest,
|
|
4817
4788
|
children
|
|
4818
4789
|
});
|
|
4819
|
-
})
|
|
4790
|
+
}));
|
|
4820
4791
|
Heading.displayName = "Heading";
|
|
4821
4792
|
|
|
4822
4793
|
//#endregion
|
|
4823
4794
|
//#region src/components/typography/Strong.tsx
|
|
4824
|
-
const areEqual$5 = (prevProps, nextProps) => {
|
|
4825
|
-
if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.color === nextProps.color) return true;
|
|
4826
|
-
return false;
|
|
4827
|
-
};
|
|
4828
4795
|
const Strong = react.default.memo(react.default.forwardRef(({ children, style = {}, color, ...rest }, ref) => {
|
|
4829
4796
|
const theme = useTheme$1();
|
|
4830
4797
|
const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
@@ -4844,15 +4811,11 @@ const Strong = react.default.memo(react.default.forwardRef(({ children, style =
|
|
|
4844
4811
|
...rest,
|
|
4845
4812
|
children
|
|
4846
4813
|
});
|
|
4847
|
-
})
|
|
4814
|
+
}));
|
|
4848
4815
|
Strong.displayName = "Strong";
|
|
4849
4816
|
|
|
4850
4817
|
//#endregion
|
|
4851
4818
|
//#region src/components/typography/Em.tsx
|
|
4852
|
-
const areEqual$4 = (prevProps, nextProps) => {
|
|
4853
|
-
if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.color === nextProps.color) return true;
|
|
4854
|
-
return false;
|
|
4855
|
-
};
|
|
4856
4819
|
const Em = react.default.memo(react.default.forwardRef(({ children, style = {}, color, ...rest }, ref) => {
|
|
4857
4820
|
const theme = useTheme$1();
|
|
4858
4821
|
const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
@@ -4872,15 +4835,11 @@ const Em = react.default.memo(react.default.forwardRef(({ children, style = {},
|
|
|
4872
4835
|
...rest,
|
|
4873
4836
|
children
|
|
4874
4837
|
});
|
|
4875
|
-
})
|
|
4838
|
+
}));
|
|
4876
4839
|
Em.displayName = "Em";
|
|
4877
4840
|
|
|
4878
4841
|
//#endregion
|
|
4879
4842
|
//#region src/components/typography/Code.tsx
|
|
4880
|
-
const areEqual$3 = (prevProps, nextProps) => {
|
|
4881
|
-
if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.size === nextProps.size && prevProps.color === nextProps.color && prevProps.backgroundColor === nextProps.backgroundColor) return true;
|
|
4882
|
-
return false;
|
|
4883
|
-
};
|
|
4884
4843
|
const Code = react.default.memo(react.default.forwardRef(({ children, style = {}, size = 2, color, backgroundColor, ...rest }, ref) => {
|
|
4885
4844
|
const theme = useTheme$1();
|
|
4886
4845
|
const isDark = useThemeMode$1() === "dark";
|
|
@@ -4909,15 +4868,11 @@ const Code = react.default.memo(react.default.forwardRef(({ children, style = {}
|
|
|
4909
4868
|
...rest,
|
|
4910
4869
|
children
|
|
4911
4870
|
});
|
|
4912
|
-
})
|
|
4871
|
+
}));
|
|
4913
4872
|
Code.displayName = "Code";
|
|
4914
4873
|
|
|
4915
4874
|
//#endregion
|
|
4916
4875
|
//#region src/components/typography/Kbd.tsx
|
|
4917
|
-
const areEqual$2 = (prevProps, nextProps) => {
|
|
4918
|
-
if (prevProps.children === nextProps.children && prevProps.style === nextProps.style && prevProps.color === nextProps.color && prevProps.backgroundColor === nextProps.backgroundColor && prevProps.size === nextProps.size) return true;
|
|
4919
|
-
return false;
|
|
4920
|
-
};
|
|
4921
4876
|
const Kbd = react.default.memo(react.default.forwardRef(({ children, style = {}, color, backgroundColor, size = 1, ...rest }, ref) => {
|
|
4922
4877
|
const theme = useTheme$1();
|
|
4923
4878
|
const isDark = useThemeMode$1() === "dark";
|
|
@@ -4963,7 +4918,7 @@ const Kbd = react.default.memo(react.default.forwardRef(({ children, style = {},
|
|
|
4963
4918
|
children
|
|
4964
4919
|
})
|
|
4965
4920
|
});
|
|
4966
|
-
})
|
|
4921
|
+
}));
|
|
4967
4922
|
Kbd.displayName = "Kbd";
|
|
4968
4923
|
|
|
4969
4924
|
//#endregion
|
|
@@ -5001,10 +4956,6 @@ Link.displayName = "Link";
|
|
|
5001
4956
|
|
|
5002
4957
|
//#endregion
|
|
5003
4958
|
//#region src/components/typography/Blockquote.tsx
|
|
5004
|
-
const areEqual$1 = (prevProps, nextProps) => {
|
|
5005
|
-
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;
|
|
5006
|
-
return false;
|
|
5007
|
-
};
|
|
5008
4959
|
const Blockquote = react.default.memo(react.default.forwardRef(({ children, style, textStyle = {}, color, borderColor, quoteColor, ...rest }, ref) => {
|
|
5009
4960
|
const theme = useTheme$1();
|
|
5010
4961
|
const colors = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
@@ -5058,7 +5009,7 @@ const Blockquote = react.default.memo(react.default.forwardRef(({ children, styl
|
|
|
5058
5009
|
]
|
|
5059
5010
|
})
|
|
5060
5011
|
});
|
|
5061
|
-
})
|
|
5012
|
+
}));
|
|
5062
5013
|
Blockquote.displayName = "Blockquote";
|
|
5063
5014
|
|
|
5064
5015
|
//#endregion
|
|
@@ -5092,10 +5043,6 @@ const getIconSize = (size) => {
|
|
|
5092
5043
|
default: return 20;
|
|
5093
5044
|
}
|
|
5094
5045
|
};
|
|
5095
|
-
const areEqual = (prevProps, nextProps) => {
|
|
5096
|
-
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;
|
|
5097
|
-
return false;
|
|
5098
|
-
};
|
|
5099
5046
|
const Button = react.default.memo(react.default.forwardRef(({ children, style, variant = "solid", color, radius, size = 2, disabled, loading, onPress, accessibilityLabel, width, highContrast, hapticFeedback, ...rest }, ref) => {
|
|
5100
5047
|
const theme = useTheme$1();
|
|
5101
5048
|
const mode = useThemeMode$1();
|
|
@@ -5276,7 +5223,7 @@ const Button = react.default.memo(react.default.forwardRef(({ children, style, v
|
|
|
5276
5223
|
rightIcons.map((icon, index) => renderIcon(icon, index))
|
|
5277
5224
|
] })
|
|
5278
5225
|
});
|
|
5279
|
-
})
|
|
5226
|
+
}));
|
|
5280
5227
|
Button.displayName = "Button";
|
|
5281
5228
|
Button.Icon = ButtonIcon;
|
|
5282
5229
|
Button.Label = ButtonLabel;
|
|
@@ -5413,8 +5360,8 @@ const TextFieldRoot = react.default.forwardRef(({ children, ...props }, ref) =>
|
|
|
5413
5360
|
const variantColors = getVariantColors(theme, activeColor, mode, variant || "outline", highContrast || false);
|
|
5414
5361
|
const [isFocused, setIsFocused] = react.default.useState(false);
|
|
5415
5362
|
const getSizeValues = () => {
|
|
5416
|
-
switch (size) {
|
|
5417
|
-
case
|
|
5363
|
+
switch (Number(size)) {
|
|
5364
|
+
case 1: return {
|
|
5418
5365
|
fontSize: theme.typography.fontSizes[4].fontSize,
|
|
5419
5366
|
paddingVertical: theme.space[2],
|
|
5420
5367
|
paddingHorizontal: theme.space[3],
|
|
@@ -5422,7 +5369,7 @@ const TextFieldRoot = react.default.forwardRef(({ children, ...props }, ref) =>
|
|
|
5422
5369
|
height: multiline ? void 0 : 36,
|
|
5423
5370
|
slotPadding: theme.space[1]
|
|
5424
5371
|
};
|
|
5425
|
-
case
|
|
5372
|
+
case 3: return {
|
|
5426
5373
|
fontSize: theme.typography.fontSizes[6].fontSize,
|
|
5427
5374
|
paddingVertical: theme.space[4],
|
|
5428
5375
|
paddingHorizontal: theme.space[4],
|
|
@@ -5685,13 +5632,13 @@ const TextAreaRoot = react.default.forwardRef(({ children, ...props }, ref) => {
|
|
|
5685
5632
|
const variantColors = getVariantColors(theme, activeColor, mode, variant, highContrast);
|
|
5686
5633
|
const accentColorScale = getColorScale(theme, activeColor, mode);
|
|
5687
5634
|
const getSizeValues = () => {
|
|
5688
|
-
switch (size) {
|
|
5689
|
-
case
|
|
5635
|
+
switch (Number(size)) {
|
|
5636
|
+
case 1: return {
|
|
5690
5637
|
fontSize: theme.typography.fontSizes[4].fontSize,
|
|
5691
5638
|
padding: theme.space[2],
|
|
5692
5639
|
height: 100
|
|
5693
5640
|
};
|
|
5694
|
-
case
|
|
5641
|
+
case 3: return {
|
|
5695
5642
|
fontSize: theme.typography.fontSizes[6].fontSize,
|
|
5696
5643
|
padding: theme.space[4],
|
|
5697
5644
|
height: 140
|
|
@@ -5855,8 +5802,8 @@ const Checkbox = react.default.forwardRef(({ checked, defaultChecked = false, on
|
|
|
5855
5802
|
getContrast(theme, activeColor, mode, highContrast);
|
|
5856
5803
|
const variantColors = getVariantColors(theme, activeColor, mode, variant, highContrast);
|
|
5857
5804
|
const getSizeValues = () => {
|
|
5858
|
-
switch (size) {
|
|
5859
|
-
case
|
|
5805
|
+
switch (Number(size)) {
|
|
5806
|
+
case 1: return {
|
|
5860
5807
|
boxSize: 20,
|
|
5861
5808
|
iconSize: 11,
|
|
5862
5809
|
fontSize: theme.typography.fontSizes[1].fontSize,
|
|
@@ -5864,7 +5811,7 @@ const Checkbox = react.default.forwardRef(({ checked, defaultChecked = false, on
|
|
|
5864
5811
|
borderWidth: 1,
|
|
5865
5812
|
height: 2.5
|
|
5866
5813
|
};
|
|
5867
|
-
case
|
|
5814
|
+
case 3: return {
|
|
5868
5815
|
boxSize: 28,
|
|
5869
5816
|
iconSize: 16,
|
|
5870
5817
|
fontSize: theme.typography.fontSizes[3].fontSize,
|
|
@@ -6081,15 +6028,15 @@ const CheckboxCardsItem = react.default.forwardRef(({ value, side: itemSide, dis
|
|
|
6081
6028
|
getAccentColor(theme, mode);
|
|
6082
6029
|
const variantColors = getVariantColors(theme, color || theme.accentColor, mode, variant, highContrast);
|
|
6083
6030
|
const getSizeValues = () => {
|
|
6084
|
-
switch (size) {
|
|
6085
|
-
case
|
|
6031
|
+
switch (Number(size)) {
|
|
6032
|
+
case 1: return {
|
|
6086
6033
|
padding: theme.space[3],
|
|
6087
6034
|
indicatorSize: 18,
|
|
6088
6035
|
innerIndicatorSize: 6,
|
|
6089
6036
|
borderWidth: 1,
|
|
6090
6037
|
checkHeight: 2.2
|
|
6091
6038
|
};
|
|
6092
|
-
case
|
|
6039
|
+
case 3: return {
|
|
6093
6040
|
padding: theme.space[5],
|
|
6094
6041
|
indicatorSize: 26,
|
|
6095
6042
|
innerIndicatorSize: 10,
|
|
@@ -6188,15 +6135,15 @@ const Radio = react.default.forwardRef(({ defaultChecked, value, selected, onSel
|
|
|
6188
6135
|
const [isInternallySelected, setIsInternallySelected] = react.default.useState(defaultChecked ?? false);
|
|
6189
6136
|
const isSelected = selected !== void 0 ? selected : isInternallySelected;
|
|
6190
6137
|
const getSizeValues = () => {
|
|
6191
|
-
switch (size) {
|
|
6192
|
-
case
|
|
6138
|
+
switch (Number(size)) {
|
|
6139
|
+
case 1: return {
|
|
6193
6140
|
boxSize: 18,
|
|
6194
6141
|
innerSize: 6,
|
|
6195
6142
|
iconSize: 8,
|
|
6196
6143
|
fontSize: theme.typography.fontSizes[1].fontSize,
|
|
6197
6144
|
gap: theme.space[1]
|
|
6198
6145
|
};
|
|
6199
|
-
case
|
|
6146
|
+
case 3: return {
|
|
6200
6147
|
boxSize: 28,
|
|
6201
6148
|
innerSize: 12,
|
|
6202
6149
|
iconSize: 16,
|
|
@@ -6419,14 +6366,14 @@ const RadioCardsItem = react.default.forwardRef(({ value, side: itemSide, disabl
|
|
|
6419
6366
|
getAccentColor(theme, mode);
|
|
6420
6367
|
const variantColors = getVariantColors(theme, color || theme.accentColor, mode, variant, highContrast);
|
|
6421
6368
|
const getSizeValues = () => {
|
|
6422
|
-
switch (size) {
|
|
6423
|
-
case
|
|
6369
|
+
switch (Number(size)) {
|
|
6370
|
+
case 1: return {
|
|
6424
6371
|
padding: theme.space[3],
|
|
6425
6372
|
indicatorSize: 18,
|
|
6426
6373
|
innerIndicatorSize: 8,
|
|
6427
6374
|
borderWidth: 1
|
|
6428
6375
|
};
|
|
6429
|
-
case
|
|
6376
|
+
case 3: return {
|
|
6430
6377
|
padding: theme.space[5],
|
|
6431
6378
|
indicatorSize: 26,
|
|
6432
6379
|
innerIndicatorSize: 12,
|
|
@@ -6554,15 +6501,15 @@ const Switch = react.default.forwardRef(({ defaultChecked, checked, onCheckedCha
|
|
|
6554
6501
|
}).start();
|
|
6555
6502
|
}, [isChecked]);
|
|
6556
6503
|
const getSizeValues = () => {
|
|
6557
|
-
switch (size) {
|
|
6558
|
-
case
|
|
6504
|
+
switch (Number(size)) {
|
|
6505
|
+
case 1: return {
|
|
6559
6506
|
trackWidth: 32,
|
|
6560
6507
|
trackHeight: 20,
|
|
6561
6508
|
thumbSize: 14,
|
|
6562
6509
|
gap: theme.space[1],
|
|
6563
6510
|
fontSize: theme.typography.fontSizes[1].fontSize
|
|
6564
6511
|
};
|
|
6565
|
-
case
|
|
6512
|
+
case 3: return {
|
|
6566
6513
|
trackWidth: 58,
|
|
6567
6514
|
trackHeight: 32,
|
|
6568
6515
|
thumbSize: 26,
|
|
@@ -7605,18 +7552,18 @@ const Slider = react.default.forwardRef(({ value: controlledValue, defaultValue,
|
|
|
7605
7552
|
};
|
|
7606
7553
|
const thumbAnimations = (0, react.useRef)(values.map((v) => new react_native.Animated.Value(getInitialPosition(v)))).current;
|
|
7607
7554
|
const sizeValues = (0, react.useMemo)(() => {
|
|
7608
|
-
switch (size) {
|
|
7609
|
-
case
|
|
7555
|
+
switch (Number(size)) {
|
|
7556
|
+
case 1: return {
|
|
7610
7557
|
trackHeight: 4,
|
|
7611
7558
|
thumbSize: 16,
|
|
7612
7559
|
fontSize: theme.typography.fontSizes[1].fontSize
|
|
7613
7560
|
};
|
|
7614
|
-
case
|
|
7561
|
+
case 3: return {
|
|
7615
7562
|
trackHeight: 8,
|
|
7616
7563
|
thumbSize: 28,
|
|
7617
7564
|
fontSize: theme.typography.fontSizes[3].fontSize
|
|
7618
7565
|
};
|
|
7619
|
-
case
|
|
7566
|
+
case 4: return {
|
|
7620
7567
|
trackHeight: 10,
|
|
7621
7568
|
thumbSize: 34,
|
|
7622
7569
|
fontSize: theme.typography.fontSizes[4].fontSize
|
|
@@ -11939,7 +11886,7 @@ const DataList = {
|
|
|
11939
11886
|
|
|
11940
11887
|
//#endregion
|
|
11941
11888
|
//#region src/components/data-display/FancyList.tsx
|
|
11942
|
-
const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true, scrollable = true, itemPadding, ListEmptyComponent, ListHeaderComponent, ListFooterComponent }) => {
|
|
11889
|
+
const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true, scrollable = true, itemPadding, ListEmptyComponent, ListHeaderComponent, ListFooterComponent, ListBackend: Backend = RnFlatList, backendProps }) => {
|
|
11943
11890
|
const theme = useTheme$1();
|
|
11944
11891
|
const isDark = useThemeMode$1() === "dark";
|
|
11945
11892
|
isDark ? theme.colors.gray.dark : theme.colors.gray;
|
|
@@ -11992,7 +11939,8 @@ const FancyList = ({ data, renderItem, keyExtractor, style, showDividers = true,
|
|
|
11992
11939
|
});
|
|
11993
11940
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RnView, {
|
|
11994
11941
|
style: [styles$9.container, style],
|
|
11995
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
11942
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Backend, {
|
|
11943
|
+
...backendProps,
|
|
11996
11944
|
data,
|
|
11997
11945
|
renderItem: renderListItem,
|
|
11998
11946
|
keyExtractor: defaultKeyExtractor,
|
|
@@ -12204,11 +12152,9 @@ const PULSE_ANIMATION = {
|
|
|
12204
12152
|
duration: 1e3,
|
|
12205
12153
|
useNativeDriver: true
|
|
12206
12154
|
};
|
|
12207
|
-
const SKELEON_COLORS = {
|
|
12208
|
-
light: "#E5E7EB",
|
|
12209
|
-
dark: "#D1D5DB"
|
|
12210
|
-
};
|
|
12211
12155
|
const Skeleton = react.default.forwardRef(({ children, loading = true, style, textStyle, width, height, accessibilityLabel = "Loading", testID }, ref) => {
|
|
12156
|
+
const theme = useTheme$1();
|
|
12157
|
+
const grayScale = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
12212
12158
|
const pulseAnim = (0, react.useRef)(new react_native.Animated.Value(0)).current;
|
|
12213
12159
|
(0, react.useEffect)(() => {
|
|
12214
12160
|
const animation = react_native.Animated.loop(react_native.Animated.sequence([react_native.Animated.timing(pulseAnim, {
|
|
@@ -12223,18 +12169,21 @@ const Skeleton = react.default.forwardRef(({ children, loading = true, style, te
|
|
|
12223
12169
|
animation.stop();
|
|
12224
12170
|
};
|
|
12225
12171
|
}, [pulseAnim]);
|
|
12226
|
-
const pulseStyle = {
|
|
12172
|
+
const pulseStyle = { opacity: pulseAnim.interpolate({
|
|
12227
12173
|
inputRange: [0, 1],
|
|
12228
|
-
outputRange: [
|
|
12174
|
+
outputRange: [.55, 1]
|
|
12229
12175
|
}) };
|
|
12176
|
+
const skeletonBackground = { backgroundColor: grayScale[3] };
|
|
12230
12177
|
if (!loading) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
|
|
12231
12178
|
if (!react.default.isValidElement(children) && typeof children === "string") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Animated.Text, {
|
|
12232
12179
|
ref,
|
|
12233
12180
|
style: [
|
|
12234
|
-
|
|
12181
|
+
styles$6.inlineText,
|
|
12182
|
+
skeletonBackground,
|
|
12235
12183
|
pulseStyle,
|
|
12236
12184
|
width !== void 0 ? { width } : void 0,
|
|
12237
|
-
height !== void 0 ? { height } : void 0
|
|
12185
|
+
height !== void 0 ? { height } : void 0,
|
|
12186
|
+
textStyle
|
|
12238
12187
|
],
|
|
12239
12188
|
accessibilityLabel,
|
|
12240
12189
|
accessibilityRole: "progressbar",
|
|
@@ -12245,6 +12194,7 @@ const Skeleton = react.default.forwardRef(({ children, loading = true, style, te
|
|
|
12245
12194
|
ref,
|
|
12246
12195
|
style: [
|
|
12247
12196
|
styles$6.blockContainer,
|
|
12197
|
+
skeletonBackground,
|
|
12248
12198
|
pulseStyle,
|
|
12249
12199
|
width !== void 0 ? { width } : void 0,
|
|
12250
12200
|
height !== void 0 ? { height } : void 0,
|
|
@@ -12371,12 +12321,12 @@ const TableColumnHeaderCell = react.default.forwardRef(({ children, width, align
|
|
|
12371
12321
|
const theme = useTheme$1();
|
|
12372
12322
|
const grayScale = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
12373
12323
|
const getSizePadding = () => {
|
|
12374
|
-
switch (context.size) {
|
|
12375
|
-
case
|
|
12324
|
+
switch (Number(context.size)) {
|
|
12325
|
+
case 1: return {
|
|
12376
12326
|
paddingVertical: theme.space[2],
|
|
12377
12327
|
paddingHorizontal: theme.space[3]
|
|
12378
12328
|
};
|
|
12379
|
-
case
|
|
12329
|
+
case 3: return {
|
|
12380
12330
|
paddingVertical: theme.space[4],
|
|
12381
12331
|
paddingHorizontal: theme.space[5]
|
|
12382
12332
|
};
|
|
@@ -12387,9 +12337,9 @@ const TableColumnHeaderCell = react.default.forwardRef(({ children, width, align
|
|
|
12387
12337
|
}
|
|
12388
12338
|
};
|
|
12389
12339
|
const getSizeFont = () => {
|
|
12390
|
-
switch (context.size) {
|
|
12391
|
-
case
|
|
12392
|
-
case
|
|
12340
|
+
switch (Number(context.size)) {
|
|
12341
|
+
case 1: return { fontSize: theme.typography.fontSizes[1].fontSize };
|
|
12342
|
+
case 3: return { fontSize: theme.typography.fontSizes[3].fontSize };
|
|
12393
12343
|
default: return { fontSize: theme.typography.fontSizes[2].fontSize };
|
|
12394
12344
|
}
|
|
12395
12345
|
};
|
|
@@ -12426,12 +12376,12 @@ const TableCell = react.default.forwardRef(({ children, align = "left", style },
|
|
|
12426
12376
|
const theme = useTheme$1();
|
|
12427
12377
|
const grayScale = useThemeMode$1() === "dark" ? theme.colors.gray.dark : theme.colors.gray;
|
|
12428
12378
|
const getSizePadding = () => {
|
|
12429
|
-
switch (context.size) {
|
|
12430
|
-
case
|
|
12379
|
+
switch (Number(context.size)) {
|
|
12380
|
+
case 1: return {
|
|
12431
12381
|
paddingVertical: theme.space[2],
|
|
12432
12382
|
paddingHorizontal: theme.space[3]
|
|
12433
12383
|
};
|
|
12434
|
-
case
|
|
12384
|
+
case 3: return {
|
|
12435
12385
|
paddingVertical: theme.space[4],
|
|
12436
12386
|
paddingHorizontal: theme.space[5]
|
|
12437
12387
|
};
|
|
@@ -12442,9 +12392,9 @@ const TableCell = react.default.forwardRef(({ children, align = "left", style },
|
|
|
12442
12392
|
}
|
|
12443
12393
|
};
|
|
12444
12394
|
const getSizeFont = () => {
|
|
12445
|
-
switch (context.size) {
|
|
12446
|
-
case
|
|
12447
|
-
case
|
|
12395
|
+
switch (Number(context.size)) {
|
|
12396
|
+
case 1: return { fontSize: theme.typography.fontSizes[1].fontSize };
|
|
12397
|
+
case 3: return { fontSize: theme.typography.fontSizes[3].fontSize };
|
|
12448
12398
|
default: return { fontSize: theme.typography.fontSizes[2].fontSize };
|
|
12449
12399
|
}
|
|
12450
12400
|
};
|
|
@@ -13112,15 +13062,15 @@ const AccordionTrigger = react.default.forwardRef(({ children, style, icon, hapt
|
|
|
13112
13062
|
}).start();
|
|
13113
13063
|
}, [open, rotationAnim]);
|
|
13114
13064
|
const getSizeStyles = () => {
|
|
13115
|
-
switch (size) {
|
|
13116
|
-
case
|
|
13065
|
+
switch (Number(size)) {
|
|
13066
|
+
case 1: return {
|
|
13117
13067
|
paddingVertical: theme.space[2],
|
|
13118
13068
|
paddingHorizontal: theme.space[3],
|
|
13119
13069
|
fontSize: theme.typography.fontSizes[1].fontSize,
|
|
13120
13070
|
lineHeight: theme.typography.fontSizes[1].lineHeight,
|
|
13121
13071
|
iconSize: 14
|
|
13122
13072
|
};
|
|
13123
|
-
case
|
|
13073
|
+
case 3: return {
|
|
13124
13074
|
paddingVertical: theme.space[4],
|
|
13125
13075
|
paddingHorizontal: theme.space[5],
|
|
13126
13076
|
fontSize: theme.typography.fontSizes[4].fontSize,
|
|
@@ -13226,9 +13176,9 @@ const AccordionContent = react.default.forwardRef(({ children, style }, ref) =>
|
|
|
13226
13176
|
const heightAnim = (0, react.useRef)(new react_native.Animated.Value(0)).current;
|
|
13227
13177
|
const opacityAnim = (0, react.useRef)(new react_native.Animated.Value(0)).current;
|
|
13228
13178
|
const getContentPadding = () => {
|
|
13229
|
-
switch (size) {
|
|
13230
|
-
case
|
|
13231
|
-
case
|
|
13179
|
+
switch (Number(size)) {
|
|
13180
|
+
case 1: return theme.space[2];
|
|
13181
|
+
case 3: return theme.space[5];
|
|
13232
13182
|
default: return theme.space[4];
|
|
13233
13183
|
}
|
|
13234
13184
|
};
|
|
@@ -13354,6 +13304,15 @@ const useResponsive = (breakpoints = defaultBreakpoints) => {
|
|
|
13354
13304
|
return getResponsiveInfo(window, breakpoints);
|
|
13355
13305
|
};
|
|
13356
13306
|
|
|
13307
|
+
//#endregion
|
|
13308
|
+
//#region src/utils/size.ts
|
|
13309
|
+
/**
|
|
13310
|
+
* Normalize a SizeInput to its canonical numeric form.
|
|
13311
|
+
* Returns the value unchanged when already numeric, the parsed number for
|
|
13312
|
+
* legacy string inputs, or `undefined` when absent.
|
|
13313
|
+
*/
|
|
13314
|
+
const toNumericSize = (size) => size === void 0 ? void 0 : Number(size);
|
|
13315
|
+
|
|
13357
13316
|
//#endregion
|
|
13358
13317
|
exports.AbsoluteCenter = AbsoluteCenter;
|
|
13359
13318
|
exports.Accordion = Accordion;
|
|
@@ -13560,6 +13519,7 @@ exports.slateAlpha = slateAlpha;
|
|
|
13560
13519
|
exports.space = space;
|
|
13561
13520
|
exports.teal = teal;
|
|
13562
13521
|
exports.tealAlpha = tealAlpha;
|
|
13522
|
+
exports.toNumericSize = toNumericSize;
|
|
13563
13523
|
exports.tomato = tomato;
|
|
13564
13524
|
exports.tomatoAlpha = tomatoAlpha;
|
|
13565
13525
|
exports.typography = typography;
|