react-better-html 1.1.91 → 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/dist/index.d.mts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.js +33 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -394,6 +394,14 @@ declare const InputField: typeof InputFieldComponent & {
|
|
|
394
394
|
time: typeof InputFieldComponent.time;
|
|
395
395
|
};
|
|
396
396
|
|
|
397
|
+
type Country = {
|
|
398
|
+
code: string;
|
|
399
|
+
name: string;
|
|
400
|
+
timeZone: string;
|
|
401
|
+
phoneNumberExtension: string;
|
|
402
|
+
phoneNumberFormat?: string;
|
|
403
|
+
};
|
|
404
|
+
|
|
397
405
|
type DropdownOption<Value, Data = unknown> = {
|
|
398
406
|
value: Value;
|
|
399
407
|
label: string;
|
|
@@ -435,9 +443,12 @@ type DropdownProps<Value, Data = unknown> = {
|
|
|
435
443
|
} & OmitProps<DivProps, "onChange" | "defaultChecked">;
|
|
436
444
|
type DropdownComponentType = {
|
|
437
445
|
<Value, Data>(props: ComponentPropWithRef<HTMLDivElement, DropdownProps<Value, Data>>): React.ReactElement;
|
|
446
|
+
countries: (props: ComponentPropWithRef<HTMLDivElement, OmitProps<DropdownProps<string, Country>, "options">>) => React.ReactElement;
|
|
438
447
|
};
|
|
439
448
|
declare const DropdownComponent: DropdownComponentType;
|
|
440
|
-
declare const Dropdown: typeof DropdownComponent & {
|
|
449
|
+
declare const Dropdown: typeof DropdownComponent & {
|
|
450
|
+
countries: typeof DropdownComponent.countries;
|
|
451
|
+
};
|
|
441
452
|
|
|
442
453
|
type ToggleInputRef = {};
|
|
443
454
|
type InternalToggleInputProps<Value> = {
|
package/dist/index.d.ts
CHANGED
|
@@ -394,6 +394,14 @@ declare const InputField: typeof InputFieldComponent & {
|
|
|
394
394
|
time: typeof InputFieldComponent.time;
|
|
395
395
|
};
|
|
396
396
|
|
|
397
|
+
type Country = {
|
|
398
|
+
code: string;
|
|
399
|
+
name: string;
|
|
400
|
+
timeZone: string;
|
|
401
|
+
phoneNumberExtension: string;
|
|
402
|
+
phoneNumberFormat?: string;
|
|
403
|
+
};
|
|
404
|
+
|
|
397
405
|
type DropdownOption<Value, Data = unknown> = {
|
|
398
406
|
value: Value;
|
|
399
407
|
label: string;
|
|
@@ -435,9 +443,12 @@ type DropdownProps<Value, Data = unknown> = {
|
|
|
435
443
|
} & OmitProps<DivProps, "onChange" | "defaultChecked">;
|
|
436
444
|
type DropdownComponentType = {
|
|
437
445
|
<Value, Data>(props: ComponentPropWithRef<HTMLDivElement, DropdownProps<Value, Data>>): React.ReactElement;
|
|
446
|
+
countries: (props: ComponentPropWithRef<HTMLDivElement, OmitProps<DropdownProps<string, Country>, "options">>) => React.ReactElement;
|
|
438
447
|
};
|
|
439
448
|
declare const DropdownComponent: DropdownComponentType;
|
|
440
|
-
declare const Dropdown: typeof DropdownComponent & {
|
|
449
|
+
declare const Dropdown: typeof DropdownComponent & {
|
|
450
|
+
countries: typeof DropdownComponent.countries;
|
|
451
|
+
};
|
|
441
452
|
|
|
442
453
|
type ToggleInputRef = {};
|
|
443
454
|
type InternalToggleInputProps<Value> = {
|
package/dist/index.js
CHANGED
|
@@ -2556,7 +2556,7 @@ Image.profileImage = (0, import_react8.forwardRef)(function ProfileImage({ size
|
|
|
2556
2556
|
justifyContent: "center",
|
|
2557
2557
|
ref,
|
|
2558
2558
|
...props,
|
|
2559
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text_default, { fontWeight: 700, children: letters.toUpperCase().slice(0, 2) })
|
|
2559
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Text_default, { fontSize: size / 2.5, fontWeight: 700, children: letters.toUpperCase().slice(0, 2) })
|
|
2560
2560
|
}
|
|
2561
2561
|
) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Image, { width: size, height: size, borderRadius: 999, objectFit: "cover", ref, ...props });
|
|
2562
2562
|
});
|
|
@@ -5227,7 +5227,39 @@ var DropdownComponent = (0, import_react16.forwardRef)(function Dropdown({
|
|
|
5227
5227
|
)
|
|
5228
5228
|
] }) });
|
|
5229
5229
|
});
|
|
5230
|
+
DropdownComponent.countries = (0, import_react16.forwardRef)(function Countries({ ...props }, ref) {
|
|
5231
|
+
const theme2 = useTheme();
|
|
5232
|
+
const renderOption = (0, import_react16.useCallback)(
|
|
5233
|
+
(option, index, isSelected) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Div_default.row, { alignItems: "center", gap: theme2.styles.gap, children: [
|
|
5234
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Image_default, { src: `https://flagcdn.com/w80/${option.data?.code.toString().toLowerCase()}.webp`, width: 20 }),
|
|
5235
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Text_default, { children: option.label })
|
|
5236
|
+
] }),
|
|
5237
|
+
[]
|
|
5238
|
+
);
|
|
5239
|
+
const options = (0, import_react16.useMemo)(
|
|
5240
|
+
() => countries.map(
|
|
5241
|
+
(country) => ({
|
|
5242
|
+
value: country.code,
|
|
5243
|
+
label: country.name,
|
|
5244
|
+
data: country,
|
|
5245
|
+
searchValues: [country.code]
|
|
5246
|
+
})
|
|
5247
|
+
),
|
|
5248
|
+
[]
|
|
5249
|
+
);
|
|
5250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
5251
|
+
DropdownComponent,
|
|
5252
|
+
{
|
|
5253
|
+
placeholder: "Select a country",
|
|
5254
|
+
options,
|
|
5255
|
+
renderOption,
|
|
5256
|
+
ref,
|
|
5257
|
+
...props
|
|
5258
|
+
}
|
|
5259
|
+
);
|
|
5260
|
+
});
|
|
5230
5261
|
var Dropdown2 = (0, import_react16.memo)(DropdownComponent);
|
|
5262
|
+
Dropdown2.countries = DropdownComponent.countries;
|
|
5231
5263
|
var Dropdown_default = Dropdown2;
|
|
5232
5264
|
|
|
5233
5265
|
// src/components/Calendar.tsx
|