@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.
@@ -1,4 +1,4 @@
1
- import { type Meta, type StoryObj } from '@storybook/react';
1
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
2
2
  import { DatePickerInput } from './index';
3
3
  declare const meta: Meta<typeof DatePickerInput>;
4
4
  export default meta;
@@ -1,4 +1,4 @@
1
- import { ReactNode } from 'react';
1
+ import { type ReactNode } from 'react';
2
2
  interface IDatePickerInputProps {
3
3
  value?: Date;
4
4
  label?: ReactNode | string;
@@ -16,5 +16,5 @@ interface IDatePickerInputProps {
16
16
  disabled?: boolean;
17
17
  minimalDropdownYears?: number;
18
18
  }
19
- export declare const DatePickerInput: ({ lang, todayText, value, disabledFrom, disabledUntil, className, error, onChange, placeholder, label, disabled, minimalDropdownYears }: IDatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const DatePickerInput: ({ lang, todayText, value, disabledFrom, disabledUntil, className, error, onChange, placeholder, label, disabled, minimalDropdownYears, }: IDatePickerInputProps) => import("react/jsx-runtime").JSX.Element;
20
20
  export {};
@@ -1,9 +1,8 @@
1
1
  import { type ChangeEvent } from 'react';
2
2
  import { type TextInputProps } from '../textInput';
3
- interface SearchInputProps extends TextInputProps {
3
+ export interface SearchInputProps extends TextInputProps {
4
4
  placeholder: string;
5
5
  value?: string;
6
6
  onChange?: (e: ChangeEvent<HTMLInputElement>) => void;
7
7
  }
8
8
  export declare const SearchInput: ({ placeholder, value, onChange, className, rightSection, ...props }: SearchInputProps) => import("react/jsx-runtime").JSX.Element;
9
- export {};
package/dist/index.cjs CHANGED
@@ -35,7 +35,6 @@ const date_fns = __toESM(require("date-fns"));
35
35
  const date_fns_locale = __toESM(require("date-fns/locale"));
36
36
  const __floating_ui_react = __toESM(require("@floating-ui/react"));
37
37
  const react_dom = __toESM(require("react-dom"));
38
- const react_phone_input_2 = __toESM(require("react-phone-input-2"));
39
38
  const react_select = __toESM(require("react-select"));
40
39
  const __tiptap_extension_placeholder = __toESM(require("@tiptap/extension-placeholder"));
41
40
  const __tiptap_extension_underline = __toESM(require("@tiptap/extension-underline"));
@@ -1127,10 +1126,20 @@ const DatePickerInput = ({ lang, todayText, value, disabledFrom, disabledUntil,
1127
1126
  }),
1128
1127
  selected !== undefined && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1129
1128
  className: "cursor-pointer text-sm font-normal text-gray-800",
1129
+ role: "button",
1130
+ "aria-label": "Clear date",
1131
+ tabIndex: 0,
1130
1132
  onClick: () => {
1131
1133
  setSelected(undefined);
1132
1134
  onChange?.(undefined);
1133
1135
  },
1136
+ onKeyDown: (e) => {
1137
+ if (e.key === "Enter" || e.key === " ") {
1138
+ e.preventDefault();
1139
+ setSelected(undefined);
1140
+ onChange?.(undefined);
1141
+ }
1142
+ },
1134
1143
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__tabler_icons_react.IconX, { size: 15 })
1135
1144
  }) })
1136
1145
  ]
@@ -1796,74 +1805,6 @@ const PasswordInput = react.default.forwardRef((props, ref) => /* @__PURE__ */ (
1796
1805
  }));
1797
1806
  PasswordInput.displayName = "PasswordInput";
1798
1807
 
1799
- //#endregion
1800
- //#region src/components/phoneNumberInput/index.tsx
1801
- const PhoneNumberInput = ({ setValue, setPhoneNumberExt, phoneNumberExt, isValid = true, phoneNumberError, phoneNumberExtensionError, phoneNumberField, phoneNumberExtField, placeholder, className, inputClass, label, disabled }) => {
1802
- const handlePhoneChange = (0, react.useCallback)((value, country) => {
1803
- if (!value || typeof country !== "object" || country === null || !("dialCode" in country)) return;
1804
- const dialCode = `+${country.dialCode}`;
1805
- const numberWithoutDialCode = value.startsWith(country.dialCode) ? value.slice(country.dialCode.length).trim() : value.trim();
1806
- setValue(phoneNumberField, numberWithoutDialCode, {
1807
- shouldDirty: true,
1808
- shouldValidate: true
1809
- });
1810
- setValue(phoneNumberExtField, dialCode, {
1811
- shouldDirty: true,
1812
- shouldValidate: true
1813
- });
1814
- if (setPhoneNumberExt) {
1815
- setPhoneNumberExt({
1816
- number: numberWithoutDialCode,
1817
- ext: dialCode,
1818
- countryCode: country.countryCode || ""
1819
- });
1820
- }
1821
- }, [
1822
- setValue,
1823
- phoneNumberField,
1824
- phoneNumberExtField,
1825
- setPhoneNumberExt
1826
- ]);
1827
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1828
- className: `${className}`,
1829
- children: [
1830
- typeof label === "string" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Label, {
1831
- htmlFor: "phoneNumber",
1832
- className: "mb-2",
1833
- children: label
1834
- }) : label,
1835
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_phone_input_2.default, {
1836
- inputProps: {
1837
- name: phoneNumberField,
1838
- id: phoneNumberField,
1839
- required: true,
1840
- disabled
1841
- },
1842
- country: phoneNumberExt?.countryCode?.toLowerCase() || "nl",
1843
- onlyCountries: [
1844
- "nl",
1845
- "be",
1846
- "gb",
1847
- "fr"
1848
- ],
1849
- placeholder,
1850
- autoFormat: false,
1851
- isValid: isValid && !phoneNumberExtensionError && !phoneNumberError,
1852
- value: `${(phoneNumberExt?.ext || "").replace(/^\+/, "")}${phoneNumberExt?.number || ""}`,
1853
- onChange: handlePhoneChange,
1854
- countryCodeEditable: false,
1855
- enableSearch: false,
1856
- disableSearchIcon: true,
1857
- inputClass
1858
- }),
1859
- (phoneNumberExtensionError || phoneNumberError) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1860
- className: "text-xs font-normal text-red-500",
1861
- children: phoneNumberExtensionError || phoneNumberError
1862
- })
1863
- ]
1864
- });
1865
- };
1866
-
1867
1808
  //#endregion
1868
1809
  //#region src/components/progressBar/index.tsx
1869
1810
  const ProgressBar = ({ value, maxValue = 100, className }) => {
@@ -3250,7 +3191,6 @@ exports.NumberField = NumberField;
3250
3191
  exports.NumberedStepper = NumberedStepper;
3251
3192
  exports.PageUnavailable = PageUnavailable;
3252
3193
  exports.PasswordInput = PasswordInput;
3253
- exports.PhoneNumberInput = PhoneNumberInput;
3254
3194
  exports.Popover = Popover;
3255
3195
  exports.ProfileMenu = ProfileMenu;
3256
3196
  exports.ProgressBar = ProgressBar;