@kashi-ui/react 0.22.0 → 0.23.0

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.
Files changed (87) hide show
  1. package/dist/Accordion.js +1 -0
  2. package/dist/ActivityHeatmap.js +1 -0
  3. package/dist/AddressForm.d.ts +28 -0
  4. package/dist/AddressForm.js +33 -0
  5. package/dist/Alert.js +1 -0
  6. package/dist/Avatar.js +1 -0
  7. package/dist/Badge.js +1 -0
  8. package/dist/BankBadge.js +1 -0
  9. package/dist/BankCard.js +1 -0
  10. package/dist/Banner.js +1 -0
  11. package/dist/Breadcrumb.js +1 -0
  12. package/dist/Button.js +1 -0
  13. package/dist/ButtonGroup.js +1 -0
  14. package/dist/Calendar.js +1 -0
  15. package/dist/Card.js +1 -0
  16. package/dist/CardNumberInput.js +1 -0
  17. package/dist/Carousel.js +1 -0
  18. package/dist/Chart.js +1 -0
  19. package/dist/Checkbox.js +1 -0
  20. package/dist/ChipGroup.js +1 -0
  21. package/dist/CitySelect.d.ts +14 -0
  22. package/dist/CitySelect.js +39 -0
  23. package/dist/ColorPicker.js +1 -0
  24. package/dist/Combobox.js +1 -0
  25. package/dist/CommandPalette.js +1 -0
  26. package/dist/ContextMenu.js +1 -0
  27. package/dist/CopyButton.js +2 -1
  28. package/dist/Countdown.js +1 -0
  29. package/dist/DataTable.js +1 -0
  30. package/dist/DatePicker.js +1 -0
  31. package/dist/DateRangePicker.js +1 -0
  32. package/dist/DateTile.js +1 -0
  33. package/dist/Dialog.js +1 -0
  34. package/dist/DropdownMenu.js +1 -0
  35. package/dist/Field.js +1 -0
  36. package/dist/FileUpload.js +1 -0
  37. package/dist/IbanInput.js +1 -0
  38. package/dist/InlineEdit.js +1 -0
  39. package/dist/Input.js +1 -0
  40. package/dist/IranMap.js +1 -0
  41. package/dist/KeyboardFixInput.js +1 -0
  42. package/dist/LandlineInput.js +1 -0
  43. package/dist/LegalIdInput.js +1 -0
  44. package/dist/Meter.js +1 -0
  45. package/dist/Misc.js +1 -0
  46. package/dist/MobileInput.js +1 -0
  47. package/dist/Money.js +1 -0
  48. package/dist/MonthPicker.js +1 -0
  49. package/dist/MultiSelect.js +1 -0
  50. package/dist/NationalIdInput.js +1 -0
  51. package/dist/NumberInput.js +1 -0
  52. package/dist/OtpInput.js +1 -0
  53. package/dist/Pagination.js +1 -0
  54. package/dist/PasswordStrength.js +1 -0
  55. package/dist/PaymentReceipt.js +1 -0
  56. package/dist/PersianInput.js +1 -0
  57. package/dist/PersianTextarea.js +1 -0
  58. package/dist/PlateInput.js +1 -0
  59. package/dist/Popover.js +1 -0
  60. package/dist/PostalCodeInput.js +1 -0
  61. package/dist/PriceInput.js +1 -0
  62. package/dist/Progress.js +1 -0
  63. package/dist/ProvinceSelect.js +1 -0
  64. package/dist/Radio.js +1 -0
  65. package/dist/Rating.js +1 -0
  66. package/dist/RelativeTime.js +1 -0
  67. package/dist/SegmentedControl.js +1 -0
  68. package/dist/Select.js +1 -0
  69. package/dist/SideNav.js +1 -0
  70. package/dist/Skeleton.js +1 -0
  71. package/dist/Slider.js +1 -0
  72. package/dist/Splitter.js +1 -0
  73. package/dist/Stat.js +1 -0
  74. package/dist/Stepper.js +1 -0
  75. package/dist/Tabs.js +1 -0
  76. package/dist/TagInput.js +1 -0
  77. package/dist/TimeInput.js +1 -0
  78. package/dist/Timeline.js +1 -0
  79. package/dist/Toast.js +2 -1
  80. package/dist/Tooltip.js +2 -1
  81. package/dist/Tour.js +1 -0
  82. package/dist/TreeView.js +1 -0
  83. package/dist/icons.js +1 -0
  84. package/dist/index.d.ts +4 -0
  85. package/dist/index.js +2 -0
  86. package/dist/useDigitsInput.js +1 -0
  87. package/package.json +4 -4
package/dist/Accordion.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { createContext, useContext, useId } from "react";
3
4
  import { cx } from "./cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { JALALI_MONTHS, formatJalali, formatNumber, jalaliMonthLength, toGregorian, toISODate, toJalali } from "@kashi-ui/persian";
3
4
  import { useRef, useState } from "react";
@@ -0,0 +1,28 @@
1
+ import { type ReactNode } from "react";
2
+ import { type IranAddress } from "@kashi-ui/persian";
3
+ type Field = keyof IranAddress;
4
+ export interface AddressFormProps {
5
+ value?: IranAddress;
6
+ defaultValue?: Partial<IranAddress>;
7
+ onChange?: (address: IranAddress) => void;
8
+ /** خطای هر فیلد، مثلاً از اعتبارسنجی سرور */
9
+ errors?: Partial<Record<Field, ReactNode>>;
10
+ /** پیشوند نام فیلدها در فرم HTML: name="shipping" ← shipping[province]، shipping[city]، … */
11
+ name?: string;
12
+ /** عنوان فیلدها (legend) @default «نشانی» */
13
+ legend?: ReactNode;
14
+ /** برچسب هر فیلد */
15
+ labels?: Partial<Record<Field, string>>;
16
+ /** نقشهٔ ایران کنار فیلدها برای انتخاب استان @default false */
17
+ map?: boolean;
18
+ /** فیلد واحد اختیاری است و بقیه اجباری @default true */
19
+ required?: boolean;
20
+ disabled?: boolean;
21
+ className?: string;
22
+ }
23
+ /**
24
+ * فرم نشانی ایرانی: استان، شهرِ همان استان، نشانی، پلاک، واحد و کد پستی ده‌رقمی.
25
+ * با انتخاب شهر بدون استان، استان خودکار پر می‌شود؛ با عوض شدن استان، شهرِ نامربوط پاک می‌شود.
26
+ */
27
+ export declare function AddressForm({ value, defaultValue, onChange, errors, name, legend, labels: labelsProp, map, required, disabled, className, }: AddressFormProps): import("react").JSX.Element;
28
+ export {};
@@ -0,0 +1,33 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { EMPTY_ADDRESS, getCities } from "@kashi-ui/persian";
5
+ import { cx } from "./cx.js";
6
+ import { CitySelect } from "./CitySelect.js";
7
+ import { Input, Textarea } from "./Input.js";
8
+ import { IranMap } from "./IranMap.js";
9
+ import { PostalCodeInput } from "./PostalCodeInput.js";
10
+ import { ProvinceSelect } from "./ProvinceSelect.js";
11
+ const LABELS = { province: "استان", city: "شهر", street: "نشانی", plaque: "پلاک", unit: "واحد", postalCode: "کد پستی" };
12
+ /**
13
+ * فرم نشانی ایرانی: استان، شهرِ همان استان، نشانی، پلاک، واحد و کد پستی ده‌رقمی.
14
+ * با انتخاب شهر بدون استان، استان خودکار پر می‌شود؛ با عوض شدن استان، شهرِ نامربوط پاک می‌شود.
15
+ */
16
+ export function AddressForm({ value, defaultValue, onChange, errors = {}, name, legend = "نشانی", labels: labelsProp, map = false, required = true, disabled, className, }) {
17
+ const [inner, setInner] = useState({ ...EMPTY_ADDRESS, ...defaultValue });
18
+ const address = value ?? inner;
19
+ const labels = { ...LABELS, ...labelsProp };
20
+ const field = (key) => (name ? `${name}[${key}]` : undefined);
21
+ const update = (patch) => {
22
+ const next = { ...address, ...patch };
23
+ if (value === undefined)
24
+ setInner(next);
25
+ onChange?.(next);
26
+ };
27
+ const setProvince = (province) => {
28
+ // شهر فقط وقتی می‌ماند که در استان تازه هم باشد (شهرهای خارج از فهرست هم پاک می‌شوند)
29
+ const keep = province && address.city && getCities(province).includes(address.city);
30
+ update({ province, city: keep ? address.city : null });
31
+ };
32
+ return (_jsxs("fieldset", { className: cx("k-address", map && "k-address--map", className), disabled: disabled, children: [legend && _jsx("legend", { className: "k-address__legend", children: legend }), _jsxs("div", { className: "k-address__fields", children: [_jsx(ProvinceSelect, { className: "k-address__province", label: labels.province, value: address.province, onChange: setProvince, error: errors.province, required: required, showCapital: false, placeholder: "\u062C\u0633\u062A\u062C\u0648\u06CC \u0627\u0633\u062A\u0627\u0646" }), _jsx(CitySelect, { className: "k-address__city", label: labels.city, province: address.province, value: address.city, onChange: (city, province) => update({ city, ...(province && !address.province ? { province } : {}) }), error: errors.city, required: required }), _jsx(Textarea, { fieldClassName: "k-address__street", label: labels.street, value: address.street, onChange: (e) => update({ street: e.target.value }), error: errors.street, required: required, name: field("street"), autoComplete: "street-address", placeholder: "\u062E\u06CC\u0627\u0628\u0627\u0646\u060C \u06A9\u0648\u0686\u0647\u060C \u0646\u0627\u0645 \u0633\u0627\u062E\u062A\u0645\u0627\u0646", rows: 2, autoResize: true }), _jsx(Input, { fieldClassName: "k-address__plaque", label: labels.plaque, value: address.plaque, onChange: (e) => update({ plaque: e.target.value }), error: errors.plaque, required: required, name: field("plaque"), inputMode: "numeric", autoComplete: "address-line2" }), _jsx(Input, { fieldClassName: "k-address__unit", label: labels.unit, value: address.unit, onChange: (e) => update({ unit: e.target.value }), error: errors.unit, optional: required, name: field("unit"), inputMode: "numeric", autoComplete: "address-line3" }), _jsx(PostalCodeInput, { fieldClassName: "k-address__postal", label: labels.postalCode, value: address.postalCode, onValueChange: (postalCode) => update({ postalCode }), error: errors.postalCode, required: required, name: field("postalCode") })] }), map && (_jsx(IranMap, { className: "k-address__map", label: `${labels.province} روی نقشه`, value: address.province, onChange: setProvince })), name && (_jsxs(_Fragment, { children: [_jsx("input", { type: "hidden", name: field("province"), value: address.province ?? "" }), _jsx("input", { type: "hidden", name: field("city"), value: address.city ?? "" })] }))] }));
33
+ }
package/dist/Alert.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/Avatar.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { Children, forwardRef, useState } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/Badge.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/BankBadge.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useState } from "react";
3
4
  /** لوگوی بانک را فقط هنگام نیاز بارگذاری می‌کند (code-split)، تا حجم اولیهٔ برنامه زیاد نشود */
package/dist/BankCard.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { formatCardNumber, getBankByCard, onlyDigits, toFaDigits } from "@kashi-ui/persian";
package/dist/Banner.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cx } from "./cx.js";
3
4
  import { CloseIcon } from "./icons.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useRef, useState } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/Button.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { cx } from "./cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { cx } from "./cx.js";
3
4
  /** دکمه‌های چسبیده به هم، مثل «قبلی / امروز / بعدی» یا ابزار قالب‌بندی */
package/dist/Calendar.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useRef, useState } from "react";
3
4
  import { JALALI_MONTHS, WEEKDAYS, WEEKDAYS_SHORT, formatJalali, getIranHoliday, jalaliMonthLength, jalaliWeekday, toFaDigits, toGregorian, toJalali, } from "@kashi-ui/persian";
package/dist/Card.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { cx } from "./cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId, useState } from "react";
3
4
  import { formatCardNumber, getBankByCard, isValidCardNumber } from "@kashi-ui/persian";
package/dist/Carousel.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { Children, useEffect, useId, useRef, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
package/dist/Chart.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useId, useLayoutEffect, useRef, useState } from "react";
3
4
  import { formatNumber } from "@kashi-ui/persian";
package/dist/Checkbox.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useEffect, useId, useRef } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/ChipGroup.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
@@ -0,0 +1,14 @@
1
+ import { type ComboboxProps } from "./Combobox.js";
2
+ export interface CitySelectProps extends Omit<ComboboxProps, "options" | "value" | "defaultValue" | "onChange"> {
3
+ /** فقط شهرهای این استان؛ بدون استان، همهٔ شهرها با نام استانشان */
4
+ province?: string | null;
5
+ /** نام شهر */
6
+ value?: string | null;
7
+ defaultValue?: string | null;
8
+ /** استان هم برمی‌گردد تا بدون انتخاب استان، از روی شهر پر شود؛ برای شهر خارج از فهرست null */
9
+ onChange?: (city: string | null, province: string | null) => void;
10
+ /** وقتی شهر در فهرست نیست، همان متن تایپ‌شده پذیرفته شود (شهرهای تازه‌تأسیس) @default true */
11
+ allowCustom?: boolean;
12
+ }
13
+ /** انتخاب شهر با جستجو؛ با استان فقط شهرهای همان استان، بدون آن همهٔ ۱۲۰۰+ شهر ایران با نام استان */
14
+ export declare const CitySelect: import("react").ForwardRefExoticComponent<CitySelectProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,39 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { forwardRef, useMemo, useState } from "react";
4
+ import { CITIES, getCities } from "@kashi-ui/persian";
5
+ import { Combobox, searchText } from "./Combobox.js";
6
+ const SEP = "|";
7
+ // «علی آباد»، «علی‌آباد» و «علیآباد» یکی‌اند
8
+ const loose = (s) => searchText(s).replace(/[\s‌]/g, "");
9
+ const filter = (o, q) => o.value.startsWith(`custom${SEP}`) || [o.label, o.description ?? ""].some((t) => loose(t).includes(loose(q)));
10
+ /** انتخاب شهر با جستجو؛ با استان فقط شهرهای همان استان، بدون آن همهٔ ۱۲۰۰+ شهر ایران با نام استان */
11
+ export const CitySelect = forwardRef(function CitySelect({ province, value, defaultValue = null, onChange, allowCustom = true, label = "شهر", placeholder, onInputChange, ...rest }, ref) {
12
+ const [query, setQuery] = useState("");
13
+ const [inner, setInner] = useState(defaultValue);
14
+ const city = value !== undefined ? value : inner;
15
+ const options = useMemo(() => {
16
+ const list = province
17
+ ? getCities(province).map((c) => ({ value: `${province}${SEP}${c}`, label: c }))
18
+ : Object.entries(CITIES).flatMap(([p, cities]) => cities.map((c) => ({ value: `${p}${SEP}${c}`, label: c, description: p })));
19
+ const q = query.trim();
20
+ const known = list.some((o) => o.label === city);
21
+ // شهر انتخاب‌شده‌ای که در فهرست نیست هم باید در فیلد بماند
22
+ if (city && !known)
23
+ list.unshift({ value: `custom${SEP}${city}`, label: city, description: "خارج از فهرست" });
24
+ if (allowCustom && q && q !== city && !list.some((o) => loose(o.label) === loose(q)))
25
+ list.push({ value: `custom${SEP}${q}`, label: q, description: "شهر دیگر؛ همین نام ثبت شود" });
26
+ return list;
27
+ }, [province, query, city, allowCustom]);
28
+ const selected = city ? options.find((o) => o.label === city && (!province || o.value.startsWith(`${province}${SEP}`) || o.value.startsWith(`custom${SEP}`)))?.value ?? null : null;
29
+ return (_jsx(Combobox, { ref: ref, label: label, placeholder: placeholder ?? (province ? "جستجوی شهر" : "نام شهر، مثلاً کاشان"), options: options, filter: filter, value: selected, onInputChange: (q) => {
30
+ setQuery(q);
31
+ onInputChange?.(q);
32
+ }, onChange: (v) => {
33
+ const [p, c] = v ? v.split(SEP) : [null, null];
34
+ const next = c ?? null;
35
+ if (value === undefined)
36
+ setInner(next);
37
+ onChange?.(next, p === "custom" ? null : p);
38
+ }, ...rest }));
39
+ });
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useRef, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
package/dist/Combobox.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useEffect, useId, useMemo, useRef, useState } from "react";
3
4
  import { normalizePersian, toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useMemo, useRef, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useRef, useState } from "react";
3
4
  import { MenuCtx, items, menuKeyDown } from "./DropdownMenu.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { useEffect, useRef, useState } from "react";
3
4
  import { Button } from "./Button.js";
@@ -7,7 +8,7 @@ const CheckIcon = () => (_jsx("svg", { viewBox: "0 0 20 20", fill: "none", strok
7
8
  export function CopyButton({ value, onCopy, iconOnly, timeout = 2000, labels = {}, variant = "secondary", size = "sm", ...rest }) {
8
9
  const { copy = "کپی", copied = "کپی شد", failed = "کپی نشد" } = labels;
9
10
  const [state, setState] = useState("idle");
10
- const timer = useRef();
11
+ const timer = useRef(undefined);
11
12
  useEffect(() => () => clearTimeout(timer.current), []);
12
13
  const run = async () => {
13
14
  try {
package/dist/Countdown.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useRef, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
package/dist/DataTable.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useMemo, useRef, useState } from "react";
3
4
  import { cx } from "./cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useEffect, useId, useRef, useState } from "react";
3
4
  import { formatJalali, parseJalali, toISODate } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useRef, useState } from "react";
3
4
  import { formatJalali, toGregorian, toISODate, toJalali } from "@kashi-ui/persian";
package/dist/DateTile.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { getIranHoliday, JALALI_MONTHS, jalaliWeekday, toFaDigits, toISODate, toJalali, WEEKDAYS } from "@kashi-ui/persian";
package/dist/Dialog.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useRef } from "react";
3
4
  import { cx } from "./cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { Children, cloneElement, createContext, isValidElement, useContext, useEffect, useId, useRef, useState, } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/Field.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cx } from "./cx.js";
3
4
  /** شناسهٔ متن‌های راهنما و خطا برای aria-describedby */
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useId, useRef, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
package/dist/IbanInput.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId, useState } from "react";
3
4
  import { formatIban, getBankByIban, isValidIban } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useRef, useState } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/Input.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { forwardRef, useId, useRef, useState, } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
package/dist/IranMap.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useRef, useState } from "react";
3
4
  import { PROVINCES, formatNumber } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef, useRef, useState } from "react";
3
4
  import { fixKeyboardLayout, looksLikeWrongLayout } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId, useState } from "react";
3
4
  import { formatLandline, getLandlineProvince, isValidLandline, normalizeLandline } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useState } from "react";
3
4
  import { isValidLegalId, onlyDigits, toFaDigits } from "@kashi-ui/persian";
package/dist/Meter.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { formatNumber, toFaDigits } from "@kashi-ui/persian";
3
4
  import { cx } from "./cx.js";
package/dist/Misc.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cx } from "./cx.js";
3
4
  export function Divider({ label, vertical, className, ...rest }) {
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId, useState } from "react";
3
4
  import { formatMobile, getMobileOperator, isValidMobile, normalizeMobile } from "@kashi-ui/persian";
package/dist/Money.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { formatMoney, numberToWords, rialToToman, tomanToRial } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useRef, useState } from "react";
3
4
  import { JALALI_MONTHS, toFaDigits, toJalali } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useId, useMemo, useRef, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useState } from "react";
3
4
  import { isValidNationalId, onlyDigits, toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId, useState } from "react";
3
4
  import { formatNumber, onlyDigits, toFaDigits } from "@kashi-ui/persian";
package/dist/OtpInput.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId, useRef, useState } from "react";
3
4
  import { onlyDigits, toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { toFaDigits } from "@kashi-ui/persian";
3
4
  import { cx } from "./cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId } from "react";
3
4
  import { formatJalali, formatTime, getBankByCard, numberToWords, onlyDigits, toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { CardNumberInput } from "./CardNumberInput.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useMemo, useState } from "react";
3
4
  import { fixPersianText, toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useId, useRef, useState } from "react";
3
4
  import { PLATE_LETTERS, formatPlate, isValidPlate, onlyDigits, plateType, toFaDigits } from "@kashi-ui/persian";
package/dist/Popover.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cloneElement, isValidElement, useEffect, useId, useRef, useState } from "react";
3
4
  import { cx } from "./cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useState } from "react";
3
4
  import { formatPostalCode, isValidPostalCode } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useState } from "react";
3
4
  import { formatNumber, numberToWords, toFaDigits } from "@kashi-ui/persian";
package/dist/Progress.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { toFaDigits } from "@kashi-ui/persian";
3
4
  import { cx } from "./cx.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { PROVINCES } from "@kashi-ui/persian";
package/dist/Radio.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { createContext, forwardRef, useContext, useId, useState } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/Rating.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useId, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { useEffect, useState } from "react";
3
4
  import { formatJalali, formatRelative } from "@kashi-ui/persian";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useId, useState } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/Select.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/SideNav.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useId, useState } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/Skeleton.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { cx } from "./cx.js";
3
4
  const size = (v) => (typeof v === "number" ? `${v}px` : v);
package/dist/Slider.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useId, useState } from "react";
3
4
  import { formatNumber } from "@kashi-ui/persian";
package/dist/Splitter.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useRef, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
package/dist/Stat.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
package/dist/Stepper.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { toFaDigits } from "@kashi-ui/persian";
3
4
  import { cx } from "./cx.js";
package/dist/Tabs.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { createContext, useContext, useId, useRef, useState } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/TagInput.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useId, useRef, useState } from "react";
3
4
  import { normalizePersian, toFaDigits } from "@kashi-ui/persian";
package/dist/TimeInput.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { forwardRef, useEffect, useState } from "react";
3
4
  import { formatTime, parseTime, toFaDigits } from "@kashi-ui/persian";
package/dist/Timeline.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cx } from "./cx.js";
3
4
  import { RelativeTime } from "./RelativeTime.js";
package/dist/Toast.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useRef, useState, useSyncExternalStore } from "react";
3
4
  import { isDev } from "./utils.js";
@@ -58,7 +59,7 @@ function ToastView({ t, closeLabel }) {
58
59
  remaining.current = duration;
59
60
  }, [t.version]);
60
61
  const started = useRef(0);
61
- const timer = useRef();
62
+ const timer = useRef(undefined);
62
63
  const [paused, setPaused] = useState(false);
63
64
  // زمان‌سنج با توقف هنگام hover یا فوکوس (WCAG 2.2.1)
64
65
  useEffect(() => {
package/dist/Tooltip.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cloneElement, isValidElement, useEffect, useId, useRef, useState } from "react";
3
4
  import { cx } from "./cx.js";
@@ -8,7 +9,7 @@ import { cx } from "./cx.js";
8
9
  export function Tooltip({ content, children, placement = "top", delay = 300 }) {
9
10
  const id = useId();
10
11
  const [open, setOpen] = useState(false);
11
- const timer = useRef();
12
+ const timer = useRef(undefined);
12
13
  const show = (wait) => {
13
14
  clearTimeout(timer.current);
14
15
  timer.current = setTimeout(() => setOpen(true), wait);
package/dist/Tour.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
3
4
  import { toFaDigits } from "@kashi-ui/persian";
package/dist/TreeView.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { useRef, useState } from "react";
3
4
  import { cx } from "./cx.js";
package/dist/icons.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  // آیکون‌های داخلی کوچک — همه aria-hidden هستند
3
4
  const base = {
package/dist/index.d.ts CHANGED
@@ -123,6 +123,10 @@ export type { InlineEditProps } from "./InlineEdit.js";
123
123
  export { IranMap } from "./IranMap.js";
124
124
  export type { IranMapProps } from "./IranMap.js";
125
125
  export { IRAN_PROVINCES, IRAN_VIEWBOX } from "./iranMapData.js";
126
+ export { CitySelect } from "./CitySelect.js";
127
+ export type { CitySelectProps } from "./CitySelect.js";
128
+ export { AddressForm } from "./AddressForm.js";
129
+ export type { AddressFormProps } from "./AddressForm.js";
126
130
  export { ProvinceSelect } from "./ProvinceSelect.js";
127
131
  export type { ProvinceSelectProps } from "./ProvinceSelect.js";
128
132
  export { Carousel } from "./Carousel.js";
package/dist/index.js CHANGED
@@ -62,6 +62,8 @@ export { ContextMenu } from "./ContextMenu.js";
62
62
  export { InlineEdit } from "./InlineEdit.js";
63
63
  export { IranMap } from "./IranMap.js";
64
64
  export { IRAN_PROVINCES, IRAN_VIEWBOX } from "./iranMapData.js";
65
+ export { CitySelect } from "./CitySelect.js";
66
+ export { AddressForm } from "./AddressForm.js";
65
67
  export { ProvinceSelect } from "./ProvinceSelect.js";
66
68
  export { Carousel } from "./Carousel.js";
67
69
  export { ColorPicker, contrastRatio } from "./ColorPicker.js";
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { useRef, useState } from "react";
2
3
  import { onlyDigits } from "@kashi-ui/persian";
3
4
  import { useIsomorphicLayoutEffect } from "./utils.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kashi-ui/react",
3
- "version": "0.22.0",
3
+ "version": "0.23.0",
4
4
  "description": "کامپوننت‌های React دیزاین‌سیستم کاشی",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -22,7 +22,7 @@
22
22
  "test": "node --test test/*.test.mjs"
23
23
  },
24
24
  "peerDependencies": {
25
- "@kashi-ui/css": "^0.22.0",
25
+ "@kashi-ui/css": "^0.23.0",
26
26
  "react": ">=18"
27
27
  },
28
28
  "devDependencies": {
@@ -59,7 +59,7 @@
59
59
  }
60
60
  },
61
61
  "dependencies": {
62
- "@kashi-ui/bank-logos": "^0.22.0",
63
- "@kashi-ui/persian": "^0.22.0"
62
+ "@kashi-ui/bank-logos": "^0.23.0",
63
+ "@kashi-ui/persian": "^0.23.0"
64
64
  }
65
65
  }