react-better-html 1.1.90 → 1.1.92
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.d.mts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +48 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +48 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2464,8 +2464,22 @@ var Image = forwardRef4(function Image2({ name, src, ...props }, ref) {
|
|
|
2464
2464
|
}
|
|
2465
2465
|
);
|
|
2466
2466
|
});
|
|
2467
|
-
Image.profileImage = forwardRef4(function ProfileImage({ size = 40, ...props }, ref) {
|
|
2468
|
-
|
|
2467
|
+
Image.profileImage = forwardRef4(function ProfileImage({ size = 40, letters, backgroundColor, ...props }, ref) {
|
|
2468
|
+
const theme2 = useTheme();
|
|
2469
|
+
return letters ? /* @__PURE__ */ jsx6(
|
|
2470
|
+
Div_default.row,
|
|
2471
|
+
{
|
|
2472
|
+
width: size,
|
|
2473
|
+
height: size,
|
|
2474
|
+
backgroundColor: backgroundColor ?? theme2.colors.backgroundSecondary,
|
|
2475
|
+
borderRadius: 999,
|
|
2476
|
+
alignItems: "center",
|
|
2477
|
+
justifyContent: "center",
|
|
2478
|
+
ref,
|
|
2479
|
+
...props,
|
|
2480
|
+
children: /* @__PURE__ */ jsx6(Text_default, { fontSize: size / 2.5, fontWeight: 700, children: letters.toUpperCase().slice(0, 2) })
|
|
2481
|
+
}
|
|
2482
|
+
) : /* @__PURE__ */ jsx6(Image, { width: size, height: size, borderRadius: 999, objectFit: "cover", ref, ...props });
|
|
2469
2483
|
});
|
|
2470
2484
|
var MemoizedImage = memo6(Image);
|
|
2471
2485
|
MemoizedImage.profileImage = Image.profileImage;
|
|
@@ -5134,7 +5148,39 @@ var DropdownComponent = forwardRef7(function Dropdown({
|
|
|
5134
5148
|
)
|
|
5135
5149
|
] }) });
|
|
5136
5150
|
});
|
|
5151
|
+
DropdownComponent.countries = forwardRef7(function Countries({ ...props }, ref) {
|
|
5152
|
+
const theme2 = useTheme();
|
|
5153
|
+
const renderOption = useCallback6(
|
|
5154
|
+
(option, index, isSelected) => /* @__PURE__ */ jsxs8(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
5155
|
+
/* @__PURE__ */ jsx13(Image_default, { src: `https://flagcdn.com/w80/${option.data?.code.toString().toLowerCase()}.webp`, width: 20 }),
|
|
5156
|
+
/* @__PURE__ */ jsx13(Text_default, { children: option.label })
|
|
5157
|
+
] }),
|
|
5158
|
+
[]
|
|
5159
|
+
);
|
|
5160
|
+
const options = useMemo3(
|
|
5161
|
+
() => countries.map(
|
|
5162
|
+
(country) => ({
|
|
5163
|
+
value: country.code,
|
|
5164
|
+
label: country.name,
|
|
5165
|
+
data: country,
|
|
5166
|
+
searchValues: [country.code]
|
|
5167
|
+
})
|
|
5168
|
+
),
|
|
5169
|
+
[]
|
|
5170
|
+
);
|
|
5171
|
+
return /* @__PURE__ */ jsx13(
|
|
5172
|
+
DropdownComponent,
|
|
5173
|
+
{
|
|
5174
|
+
placeholder: "Select a country",
|
|
5175
|
+
options,
|
|
5176
|
+
renderOption,
|
|
5177
|
+
ref,
|
|
5178
|
+
...props
|
|
5179
|
+
}
|
|
5180
|
+
);
|
|
5181
|
+
});
|
|
5137
5182
|
var Dropdown2 = memo14(DropdownComponent);
|
|
5183
|
+
Dropdown2.countries = DropdownComponent.countries;
|
|
5138
5184
|
var Dropdown_default = Dropdown2;
|
|
5139
5185
|
|
|
5140
5186
|
// src/components/Calendar.tsx
|