@youngonesworks/ui 0.1.87 → 0.1.91
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/components/datePickerInput/DatePickerInput.stories.d.ts +1 -1
- package/dist/components/datePickerInput/index.d.ts +2 -2
- package/dist/components/searchInput/index.d.ts +1 -2
- package/dist/index.cjs +10 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +11 -70
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/dist/components/phoneNumberInput/PhoneInputSelect.stories.d.ts +0 -6
- package/dist/components/phoneNumberInput/PhoneNumberInput.test.d.ts +0 -1
- package/dist/components/phoneNumberInput/index.d.ts +0 -32
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,6 @@ export { NavButtons } from './components/navButtons';
|
|
|
28
28
|
export { NumberField } from './components/numberField';
|
|
29
29
|
export { PageUnavailable } from './components/pageUnavailable';
|
|
30
30
|
export { PasswordInput } from './components/passwordInput';
|
|
31
|
-
export { PhoneNumberInput } from './components/phoneNumberInput';
|
|
32
31
|
export { Popover } from './components/popover';
|
|
33
32
|
export { ProgressBar } from './components/progressBar';
|
|
34
33
|
export { RadioButton } from './components/radioButton';
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,6 @@ import { addMonths, format, setMonth } from "date-fns";
|
|
|
13
13
|
import { enGB, fr, nl, nlBE } from "date-fns/locale";
|
|
14
14
|
import { FloatingArrow, arrow, autoUpdate, flip, offset, shift, useClick, useDismiss, useFloating, useFocus, useHover, useInteractions, useRole } from "@floating-ui/react";
|
|
15
15
|
import { createPortal } from "react-dom";
|
|
16
|
-
import PhoneInput from "react-phone-input-2";
|
|
17
16
|
import ReactSelect, { components } from "react-select";
|
|
18
17
|
import { Placeholder } from "@tiptap/extension-placeholder";
|
|
19
18
|
import { Underline } from "@tiptap/extension-underline";
|
|
@@ -1105,10 +1104,20 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
|
|
|
1105
1104
|
}),
|
|
1106
1105
|
selected !== undefined && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("span", {
|
|
1107
1106
|
className: "cursor-pointer text-sm font-normal text-gray-800",
|
|
1107
|
+
role: "button",
|
|
1108
|
+
"aria-label": "Clear date",
|
|
1109
|
+
tabIndex: 0,
|
|
1108
1110
|
onClick: () => {
|
|
1109
1111
|
setSelected(undefined);
|
|
1110
1112
|
onChange?.(undefined);
|
|
1111
1113
|
},
|
|
1114
|
+
onKeyDown: (e) => {
|
|
1115
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1116
|
+
e.preventDefault();
|
|
1117
|
+
setSelected(undefined);
|
|
1118
|
+
onChange?.(undefined);
|
|
1119
|
+
}
|
|
1120
|
+
},
|
|
1112
1121
|
children: /* @__PURE__ */ jsx(IconX, { size: 15 })
|
|
1113
1122
|
}) })
|
|
1114
1123
|
]
|
|
@@ -1774,74 +1783,6 @@ const PasswordInput = React.forwardRef((props, ref) => /* @__PURE__ */ jsx(TextI
|
|
|
1774
1783
|
}));
|
|
1775
1784
|
PasswordInput.displayName = "PasswordInput";
|
|
1776
1785
|
|
|
1777
|
-
//#endregion
|
|
1778
|
-
//#region src/components/phoneNumberInput/index.tsx
|
|
1779
|
-
const PhoneNumberInput = ({ setValue, setPhoneNumberExt, phoneNumberExt, isValid = true, phoneNumberError, phoneNumberExtensionError, phoneNumberField, phoneNumberExtField, placeholder, className, inputClass, label, disabled }) => {
|
|
1780
|
-
const handlePhoneChange = useCallback((value, country) => {
|
|
1781
|
-
if (!value || typeof country !== "object" || country === null || !("dialCode" in country)) return;
|
|
1782
|
-
const dialCode = `+${country.dialCode}`;
|
|
1783
|
-
const numberWithoutDialCode = value.startsWith(country.dialCode) ? value.slice(country.dialCode.length).trim() : value.trim();
|
|
1784
|
-
setValue(phoneNumberField, numberWithoutDialCode, {
|
|
1785
|
-
shouldDirty: true,
|
|
1786
|
-
shouldValidate: true
|
|
1787
|
-
});
|
|
1788
|
-
setValue(phoneNumberExtField, dialCode, {
|
|
1789
|
-
shouldDirty: true,
|
|
1790
|
-
shouldValidate: true
|
|
1791
|
-
});
|
|
1792
|
-
if (setPhoneNumberExt) {
|
|
1793
|
-
setPhoneNumberExt({
|
|
1794
|
-
number: numberWithoutDialCode,
|
|
1795
|
-
ext: dialCode,
|
|
1796
|
-
countryCode: country.countryCode || ""
|
|
1797
|
-
});
|
|
1798
|
-
}
|
|
1799
|
-
}, [
|
|
1800
|
-
setValue,
|
|
1801
|
-
phoneNumberField,
|
|
1802
|
-
phoneNumberExtField,
|
|
1803
|
-
setPhoneNumberExt
|
|
1804
|
-
]);
|
|
1805
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
1806
|
-
className: `${className}`,
|
|
1807
|
-
children: [
|
|
1808
|
-
typeof label === "string" ? /* @__PURE__ */ jsx(Label, {
|
|
1809
|
-
htmlFor: "phoneNumber",
|
|
1810
|
-
className: "mb-2",
|
|
1811
|
-
children: label
|
|
1812
|
-
}) : label,
|
|
1813
|
-
/* @__PURE__ */ jsx(PhoneInput, {
|
|
1814
|
-
inputProps: {
|
|
1815
|
-
name: phoneNumberField,
|
|
1816
|
-
id: phoneNumberField,
|
|
1817
|
-
required: true,
|
|
1818
|
-
disabled
|
|
1819
|
-
},
|
|
1820
|
-
country: phoneNumberExt?.countryCode?.toLowerCase() || "nl",
|
|
1821
|
-
onlyCountries: [
|
|
1822
|
-
"nl",
|
|
1823
|
-
"be",
|
|
1824
|
-
"gb",
|
|
1825
|
-
"fr"
|
|
1826
|
-
],
|
|
1827
|
-
placeholder,
|
|
1828
|
-
autoFormat: false,
|
|
1829
|
-
isValid: isValid && !phoneNumberExtensionError && !phoneNumberError,
|
|
1830
|
-
value: `${(phoneNumberExt?.ext || "").replace(/^\+/, "")}${phoneNumberExt?.number || ""}`,
|
|
1831
|
-
onChange: handlePhoneChange,
|
|
1832
|
-
countryCodeEditable: false,
|
|
1833
|
-
enableSearch: false,
|
|
1834
|
-
disableSearchIcon: true,
|
|
1835
|
-
inputClass
|
|
1836
|
-
}),
|
|
1837
|
-
(phoneNumberExtensionError || phoneNumberError) && /* @__PURE__ */ jsx("span", {
|
|
1838
|
-
className: "text-xs font-normal text-red-500",
|
|
1839
|
-
children: phoneNumberExtensionError || phoneNumberError
|
|
1840
|
-
})
|
|
1841
|
-
]
|
|
1842
|
-
});
|
|
1843
|
-
};
|
|
1844
|
-
|
|
1845
1786
|
//#endregion
|
|
1846
1787
|
//#region src/components/progressBar/index.tsx
|
|
1847
1788
|
const ProgressBar = ({ value, maxValue = 100, className }) => {
|
|
@@ -3197,5 +3138,5 @@ const setCSSVariable = (variable, value) => {
|
|
|
3197
3138
|
};
|
|
3198
3139
|
|
|
3199
3140
|
//#endregion
|
|
3200
|
-
export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, Button, CSS_VARIABLE_KEYS, Checkbox, DatePickerInput, Divider, FavouriteButton, Filters, GoogleAppButtonIcon, HR, HamburgerMenuButton, Island, Label, Loader, LogoBlack, Modal, NavButtons, NumberField, NumberedStepper, PageUnavailable, PasswordInput,
|
|
3141
|
+
export { AccordionItem, AccordionWrapper, ActionIcon, Alert, AppleAppButtonIcon, AutoCompleteInput, Avatar, AvatarIndicator, Badge, BigBadge, BreadCrumb, Button, CSS_VARIABLE_KEYS, Checkbox, DatePickerInput, Divider, FavouriteButton, Filters, GoogleAppButtonIcon, HR, HamburgerMenuButton, Island, Label, Loader, LogoBlack, Modal, NavButtons, NumberField, NumberedStepper, PageUnavailable, PasswordInput, Popover, ProfileMenu, ProgressBar, RadioButton, Rating, RegionSelector, Reviews, ScrollToTop, SearchInput, Select, SettingsCard, Skeleton, SkillPill, Stepper, StickyMobileButtonWrapper, Table, TableCell, TableHeader, TableHeaderItem, TableHeaderRow, TableRow, TabsBadge, TabsWrapper, TextInput, Textarea, ThemeIcon, TimeInput, Toggle, Tooltip, TruncatedText, UnorderedList, UnorderedListItem, UnstyledButton, WysiwygEditor, buttonVariants, getCSSVariable, setCSSVariable };
|
|
3201
3142
|
//# sourceMappingURL=index.js.map
|