@kashi-ui/react 0.21.0 → 0.22.1

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/Alert.js +1 -0
  4. package/dist/Avatar.js +1 -0
  5. package/dist/Badge.js +1 -0
  6. package/dist/BankBadge.js +1 -0
  7. package/dist/BankCard.js +1 -0
  8. package/dist/Banner.js +1 -0
  9. package/dist/Breadcrumb.js +1 -0
  10. package/dist/Button.js +1 -0
  11. package/dist/ButtonGroup.js +1 -0
  12. package/dist/Calendar.js +1 -0
  13. package/dist/Card.js +1 -0
  14. package/dist/CardNumberInput.js +1 -0
  15. package/dist/Carousel.js +1 -0
  16. package/dist/Chart.js +1 -0
  17. package/dist/Checkbox.js +1 -0
  18. package/dist/ChipGroup.js +1 -0
  19. package/dist/ColorPicker.js +1 -0
  20. package/dist/Combobox.js +1 -0
  21. package/dist/CommandPalette.js +1 -0
  22. package/dist/ContextMenu.js +1 -0
  23. package/dist/CopyButton.js +2 -1
  24. package/dist/Countdown.js +1 -0
  25. package/dist/DataTable.js +1 -0
  26. package/dist/DatePicker.js +1 -0
  27. package/dist/DateRangePicker.js +1 -0
  28. package/dist/DateTile.js +1 -0
  29. package/dist/Dialog.js +1 -0
  30. package/dist/DropdownMenu.js +1 -0
  31. package/dist/Field.js +1 -0
  32. package/dist/FileUpload.js +1 -0
  33. package/dist/IbanInput.js +1 -0
  34. package/dist/InlineEdit.js +1 -0
  35. package/dist/Input.js +1 -0
  36. package/dist/IranMap.d.ts +40 -0
  37. package/dist/IranMap.js +99 -0
  38. package/dist/KeyboardFixInput.js +1 -0
  39. package/dist/LandlineInput.js +1 -0
  40. package/dist/LegalIdInput.js +1 -0
  41. package/dist/Meter.js +1 -0
  42. package/dist/Misc.js +1 -0
  43. package/dist/MobileInput.js +1 -0
  44. package/dist/Money.js +1 -0
  45. package/dist/MonthPicker.js +1 -0
  46. package/dist/MultiSelect.js +1 -0
  47. package/dist/NationalIdInput.js +1 -0
  48. package/dist/NumberInput.js +1 -0
  49. package/dist/OtpInput.js +1 -0
  50. package/dist/Pagination.js +1 -0
  51. package/dist/PasswordStrength.js +1 -0
  52. package/dist/PaymentReceipt.js +1 -0
  53. package/dist/PersianInput.js +1 -0
  54. package/dist/PersianTextarea.js +1 -0
  55. package/dist/PlateInput.js +1 -0
  56. package/dist/Popover.js +1 -0
  57. package/dist/PostalCodeInput.js +1 -0
  58. package/dist/PriceInput.js +1 -0
  59. package/dist/Progress.js +1 -0
  60. package/dist/ProvinceSelect.js +1 -0
  61. package/dist/Radio.js +1 -0
  62. package/dist/Rating.js +1 -0
  63. package/dist/RelativeTime.js +1 -0
  64. package/dist/SegmentedControl.js +1 -0
  65. package/dist/Select.js +1 -0
  66. package/dist/SideNav.js +1 -0
  67. package/dist/Skeleton.js +1 -0
  68. package/dist/Slider.d.ts +3 -1
  69. package/dist/Slider.js +1 -0
  70. package/dist/Splitter.js +1 -0
  71. package/dist/Stat.js +1 -0
  72. package/dist/Stepper.js +1 -0
  73. package/dist/Tabs.js +1 -0
  74. package/dist/TagInput.js +1 -0
  75. package/dist/TimeInput.js +1 -0
  76. package/dist/Timeline.js +1 -0
  77. package/dist/Toast.js +2 -1
  78. package/dist/Tooltip.js +2 -1
  79. package/dist/Tour.js +1 -0
  80. package/dist/TreeView.js +1 -0
  81. package/dist/icons.js +1 -0
  82. package/dist/index.d.ts +3 -0
  83. package/dist/index.js +2 -0
  84. package/dist/iranMapData.d.ts +6 -0
  85. package/dist/iranMapData.js +37 -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";
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";
@@ -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";
@@ -0,0 +1,40 @@
1
+ interface IranMapBase {
2
+ /** داده برای نقشهٔ رنگی: نام استان ← عدد؛ استان‌های بدون داده خاکستری می‌مانند */
3
+ data?: Record<string, number>;
4
+ /** نام دسترس‌پذیر @default «نقشهٔ استان‌های ایران» */
5
+ label?: string;
6
+ /** واحد در راهنما و جدول، مثل «سفارش» */
7
+ unit?: string;
8
+ /** قالب عدد @default ارقام فارسی با جداکنندهٔ هزارگان */
9
+ format?: (n: number) => string;
10
+ /** تعداد پله‌های رنگ @default 5 */
11
+ steps?: number;
12
+ /**
13
+ * تقسیم داده بین پله‌ها: "quantile" هر پله تقریباً تعداد برابری استان می‌گیرد (وقتی یک استان مثل تهران خیلی بزرگ‌تر است،
14
+ * بقیه هم از هم جدا دیده می‌شوند)؛ "linear" بازهٔ کمینه تا بیشینه را مساوی تقسیم می‌کند @default "quantile"
15
+ */
16
+ scale?: "quantile" | "linear";
17
+ /** راهنمای رنگ زیر نقشه @default true وقتی data دارد */
18
+ legend?: boolean;
19
+ /** خط اضافه در راهنمای هر استان، مثل «۱۲٪ رشد» */
20
+ tooltip?: (province: string, value: number | undefined) => string;
21
+ className?: string;
22
+ }
23
+ /** انتخاب یک استان؛ با دادن value، defaultValue یا onChange نقشه قابل انتخاب می‌شود */
24
+ interface IranMapSingle extends IranMapBase {
25
+ multiple?: false;
26
+ value?: string | null;
27
+ defaultValue?: string | null;
28
+ onChange?: (value: string | null) => void;
29
+ }
30
+ /** انتخاب چند استان */
31
+ interface IranMapMultiple extends IranMapBase {
32
+ multiple: true;
33
+ value?: string[];
34
+ defaultValue?: string[];
35
+ onChange?: (value: string[]) => void;
36
+ }
37
+ export type IranMapProps = IranMapSingle | IranMapMultiple;
38
+ /** نقشهٔ ۳۱ استان ایران؛ نقشهٔ رنگی برای داده و/یا انتخاب یک یا چند استان، با صفحه‌کلید و جدول هم‌ارز */
39
+ export declare function IranMap(props: IranMapProps): import("react").JSX.Element;
40
+ export {};
@@ -0,0 +1,99 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRef, useState } from "react";
4
+ import { PROVINCES, formatNumber } from "@kashi-ui/persian";
5
+ import { cx } from "./cx.js";
6
+ import { ChartTip } from "./Chart.js";
7
+ import { IRAN_PROVINCES, IRAN_VIEWBOX } from "./iranMapData.js";
8
+ const NAMES = PROVINCES.map((p) => p.name);
9
+ const CAPITAL = Object.fromEntries(PROVINCES.map((p) => [p.name, p.capital]));
10
+ const [, , VW, VH] = IRAN_VIEWBOX.split(" ").map(Number);
11
+ /** نقشهٔ ۳۱ استان ایران؛ نقشهٔ رنگی برای داده و/یا انتخاب یک یا چند استان، با صفحه‌کلید و جدول هم‌ارز */
12
+ export function IranMap(props) {
13
+ const { data, value, defaultValue, multiple = false, label = "نقشهٔ استان‌های ایران", unit, format = (n) => formatNumber(n), steps = 5, scale = "quantile", legend, tooltip, className, } = props;
14
+ const onChange = props.onChange;
15
+ const selectable = value !== undefined || defaultValue !== undefined || onChange !== undefined;
16
+ const [inner, setInner] = useState(defaultValue ?? (multiple ? [] : null));
17
+ const selected = value !== undefined ? value : inner;
18
+ const isSelected = (n) => (Array.isArray(selected) ? selected.includes(n) : selected === n);
19
+ const [active, setActive] = useState(0);
20
+ const [inside, setInside] = useState(false);
21
+ // ورود با Tab روی استان انتخاب‌شده؛ داخل نقشه همان استانی که جهت‌نماها رویش رفته‌اند
22
+ const firstSelected = NAMES.findIndex((n) => isSelected(n));
23
+ const tabStop = inside || firstSelected < 0 ? active : firstSelected;
24
+ const [tip, setTip] = useState(null);
25
+ const box = useRef(null);
26
+ const refs = useRef([]);
27
+ const values = data ? NAMES.map((n) => data[n]).filter((v) => typeof v === "number") : [];
28
+ const min = values.length ? Math.min(...values) : 0;
29
+ const max = values.length ? Math.max(...values) : 0;
30
+ const sorted = [...values].sort((a, b) => a - b);
31
+ const level = (n) => {
32
+ const v = data?.[n];
33
+ if (typeof v !== "number")
34
+ return undefined;
35
+ if (max === min)
36
+ return steps;
37
+ // رتبهٔ اولین مقدار برابر، تا استان‌های هم‌مقدار یک رنگ بگیرند
38
+ // کمترین همیشه پلهٔ اول و بیشترین همیشه پلهٔ آخر؛ بقیه بر اساس رتبه بینشان پخش می‌شوند
39
+ if (scale === "quantile")
40
+ return 1 + Math.round((sorted.indexOf(v) * (steps - 1)) / (sorted.length - 1));
41
+ return Math.min(steps, 1 + Math.floor(((v - min) / (max - min)) * steps));
42
+ };
43
+ // شدت رنگ هر پله؛ کم‌رنگ‌ترین پله هم از خاکستری «بدون داده» جدا دیده شود
44
+ const shade = (l) => `${Math.round(12 + (88 * l) / steps)}%`;
45
+ const toggle = (n) => {
46
+ let next;
47
+ if (multiple) {
48
+ const list = Array.isArray(selected) ? selected : [];
49
+ next = list.includes(n) ? list.filter((x) => x !== n) : [...list, n];
50
+ }
51
+ else
52
+ next = selected === n ? null : n;
53
+ if (value === undefined)
54
+ setInner(next);
55
+ onChange?.(next);
56
+ };
57
+ const describe = (n) => {
58
+ const v = data?.[n];
59
+ return typeof v === "number" ? `${n}: ${format(v)}${unit ? ` ${unit}` : ""}` : n;
60
+ };
61
+ // فوکوس گردشی: یک استان در ترتیب Tab است و جهت‌نماها بین استان‌ها جابه‌جا می‌شوند
62
+ const onKey = (e, i) => {
63
+ const move = { ArrowLeft: 1, ArrowDown: 1, ArrowRight: -1, ArrowUp: -1 }[e.key];
64
+ let next = i;
65
+ if (move)
66
+ next = (i + move + NAMES.length) % NAMES.length;
67
+ else if (e.key === "Home")
68
+ next = 0;
69
+ else if (e.key === "End")
70
+ next = NAMES.length - 1;
71
+ else if (e.key === "Enter" || e.key === " ") {
72
+ e.preventDefault();
73
+ toggle(NAMES[i]);
74
+ return;
75
+ }
76
+ else
77
+ return;
78
+ e.preventDefault();
79
+ setActive(next);
80
+ setTip(NAMES[next]);
81
+ refs.current[next]?.focus();
82
+ };
83
+ const tipProvince = tip ? IRAN_PROVINCES[tip] : null;
84
+ const tipValue = tip ? data?.[tip] : undefined;
85
+ const showLegend = legend ?? Boolean(data);
86
+ const ratio = (VH / VW) * 100;
87
+ return (_jsxs("figure", { ref: box, className: cx("k-iran-map", selectable && "k-iran-map--selectable", className), onPointerLeave: () => setTip(null), children: [_jsxs("div", { className: "k-iran-map__canvas", style: { paddingBlockEnd: `${ratio}%` }, children: [_jsx("svg", { viewBox: IRAN_VIEWBOX, className: "k-iran-map__svg", role: selectable ? (multiple ? "group" : "radiogroup") : "img", onFocus: () => setInside(true), onBlur: (e) => { if (!e.currentTarget.contains(e.relatedTarget))
88
+ setInside(false); }, "aria-label": selectable ? label : `${label}${data ? `؛ جدول داده در ادامه` : ""}`, children: NAMES.map((n, i) => {
89
+ const p = IRAN_PROVINCES[n];
90
+ const on = isSelected(n);
91
+ return (_jsx("path", { ref: (el) => { refs.current[i] = el; }, d: p.d, className: "k-iran-map__province", "data-l": level(n), style: level(n) ? { "--_p": shade(level(n)) } : undefined, "data-selected": on ? "" : undefined, "data-active": tip === n ? "" : undefined, role: selectable ? (multiple ? "checkbox" : "radio") : undefined, "aria-checked": selectable ? on : undefined, "aria-label": selectable ? describe(n) : undefined, tabIndex: selectable ? (i === tabStop ? 0 : -1) : undefined, onPointerEnter: () => setTip(n), onFocus: () => { setActive(i); setTip(n); }, onBlur: () => setTip(null), onClick: selectable ? () => { setActive(i); toggle(n); } : undefined, onKeyDown: selectable ? (e) => onKey(e, i) : undefined }, n));
92
+ }) }), tipProvince && (_jsx(ChartTip, { x: (tipProvince.x / VW) * (box.current?.clientWidth ?? VW),
93
+ // راهنمای استان‌های شمالی بالای نقشه بیرون نزند (زیر سربرگ چسبان نرود)
94
+ y: Math.max(64, (tipProvince.y / VH) * ((box.current?.clientWidth ?? VW) * (VH / VW)) - 6), width: box.current?.clientWidth, title: tip, rows: [
95
+ ...(typeof tipValue === "number" ? [{ value: `${format(tipValue)}${unit ? ` ${unit}` : ""}` }] : []),
96
+ ...(tooltip ? [{ value: tooltip(tip, tipValue) }] : []),
97
+ ...(typeof tipValue !== "number" && !tooltip ? [{ value: `مرکز: ${CAPITAL[tip]}` }] : []),
98
+ ] }))] }), showLegend && values.length > 0 && (_jsxs("figcaption", { className: "k-iran-map__legend", children: [_jsx("span", { children: format(min) }), _jsx("span", { className: "k-iran-map__scale", "aria-hidden": "true", children: Array.from({ length: steps }, (_, i) => _jsx("i", { style: { "--_p": shade(i + 1) } }, i)) }), _jsxs("span", { children: [format(max), unit ? ` ${unit}` : ""] })] })), data && (_jsxs("table", { className: "k-sr-only", children: [_jsx("caption", { children: label }), _jsx("tbody", { children: NAMES.filter((n) => typeof data[n] === "number").sort((a, b) => data[b] - data[a]).map((n) => (_jsxs("tr", { children: [_jsx("th", { scope: "row", children: n }), _jsxs("td", { children: [format(data[n]), unit ? ` ${unit}` : ""] })] }, n))) })] }))] }));
99
+ }
@@ -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.d.ts CHANGED
@@ -1,11 +1,13 @@
1
1
  import { type ReactNode } from "react";
2
2
  type Val = number | [number, number];
3
+ /** نوع مقدار فقط از value/defaultValue حدس زده شود، نه از onChange؛ وگرنه setState (که تابع هم می‌پذیرد) خطای نوع می‌دهد. با همهٔ نسخه‌های TypeScript کار می‌کند */
4
+ type NoInferVal<T> = [T][T extends unknown ? 0 : never];
3
5
  export interface SliderProps<V extends Val = Val> {
4
6
  label?: ReactNode;
5
7
  /** یک عدد، یا [از، تا] برای بازه */
6
8
  value?: V;
7
9
  defaultValue?: V;
8
- onChange?: (value: V) => void;
10
+ onChange?: (value: NoInferVal<V>) => void;
9
11
  /** @default 0 */
10
12
  min?: number;
11
13
  /** @default 100 */
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
@@ -120,6 +120,9 @@ export { ContextMenu } from "./ContextMenu.js";
120
120
  export type { ContextMenuProps } from "./ContextMenu.js";
121
121
  export { InlineEdit } from "./InlineEdit.js";
122
122
  export type { InlineEditProps } from "./InlineEdit.js";
123
+ export { IranMap } from "./IranMap.js";
124
+ export type { IranMapProps } from "./IranMap.js";
125
+ export { IRAN_PROVINCES, IRAN_VIEWBOX } from "./iranMapData.js";
123
126
  export { ProvinceSelect } from "./ProvinceSelect.js";
124
127
  export type { ProvinceSelectProps } from "./ProvinceSelect.js";
125
128
  export { Carousel } from "./Carousel.js";
package/dist/index.js CHANGED
@@ -60,6 +60,8 @@ export { BarChart, BarList, LineChart, PieChart, ProportionBar, Sparkline } from
60
60
  export { ActivityHeatmap } from "./ActivityHeatmap.js";
61
61
  export { ContextMenu } from "./ContextMenu.js";
62
62
  export { InlineEdit } from "./InlineEdit.js";
63
+ export { IranMap } from "./IranMap.js";
64
+ export { IRAN_PROVINCES, IRAN_VIEWBOX } from "./iranMapData.js";
63
65
  export { ProvinceSelect } from "./ProvinceSelect.js";
64
66
  export { Carousel } from "./Carousel.js";
65
67
  export { ColorPicker, contrastRatio } from "./ColorPicker.js";
@@ -0,0 +1,6 @@
1
+ export declare const IRAN_VIEWBOX = "0 0 1000 907";
2
+ export declare const IRAN_PROVINCES: Record<string, {
3
+ d: string;
4
+ x: number;
5
+ y: number;
6
+ }>;
@@ -0,0 +1,37 @@
1
+ // مرز ۳۱ استان ایران برای IranMap — این فایل خودکار ساخته شده است.
2
+ // منبع: Natural Earth (۱:۱۰ میلیون، مالکیت عمومی / public domain)، ساده‌شده با mapshaper و تصویر مرکاتور.
3
+ // کلید هر استان همان نام فارسی PROVINCES در @kashi-ui/persian است؛ x و y نقطهٔ درونی برای راهنما.
4
+ export const IRAN_VIEWBOX = "0 0 1000 907";
5
+ export const IRAN_PROVINCES = {
6
+ "آذربایجان شرقی": { x: 123, y: 128, d: "M163 199l1-7l10-12l11-8l17-2l20 2l7-4l-13-8l-2-7l-12-7l-1-7l2-10l-8-10l-5-17l-15 0l-10-6l10-13l7 0l2-16l-6-22l-13 8l-12 19l-8-2l-10 4l-5-5l5-9l5 1l12-6l6-7l-4-9l-8 1l-15 18l-10-1l-13 4l-33-8l-6 6l-3 10l0 14l-9 9l-3 10l5 7l4 34l4 7l2 15l16 10l12 1l8 8l11 7l5-7l13-5l8 5l2 13l7 3z" },
7
+ "آذربایجان غربی": { x: 39, y: 59, d: "M75 53l-8-13l-9-3l-6-11l-5-4l-4-11l-17-11l-5 5l-3 17l-7 4l-11-1l1 13l6 4l-3 10l7 10l-1 8l2 7l0 15l7 1l-5 18l-6 9l0 6l8 1l4 6l8 3l-2 18l13 10l-3 12l7 5l-3 16l9 3l2 6l-3 7l7 9l6 0l6 20l1 7l7-2l12-15l8-3l4-8l4-2l13 2l27-3l6 6l11 2l10-11l-7-16l-12 1l-7-3l-2-13l-8-5l-13 5l-5 7l-11-7l-8-8l-12-1l-16-10l-2-15l-4-7l-4-34l-5-7l3-10l9-9l0-14l3-10z" },
8
+ "اردبیل": { x: 202, y: 87, d: "M229 168l7 5l3-4l12 1l-1-10l-8-8l-8-13l-5-13l3-13l12-14l-7-7l-9-12l-7-2l-5-9l-10-6l2-8l10-2l3-5l-8-9l-1-8l11-5l-15-18l-11-3l-29 21l-10 5l-4 8l4 9l-6 7l-12 6l-5-1l-5 9l5 5l10-4l8 2l12-19l13-8l6 22l-2 16l-7 0l-10 13l10 6l15 0l5 17l8 10l-2 10l1 7l12 7l2 7z" },
9
+ "اصفهان": { x: 414, y: 418, d: "M296 467l10-6l9-1l6 4l10 0l6-4l15-2l6 10l1 10l15 12l4 11l-4 7l-1 18l5 16l0 7l3 11l14 12l5-1l0-11l7-21l-9-7l6-6l17-11l4 10l16 2l18-5l-3-9l5-25l-2-19l15-11l9-2l16 4l55-19l9-6l6-19l3-4l12-5l6-12l-1-42l-4-3l-125 4l-25-8l-23 0l-10-6l-17 5l-15 1l-8 6l-2 12l3 3l-7 19l-12 5l-22 6l-13 8l-1 9l-7 14l-8 2l-4 11l-8 7l2 6l13 3z" },
10
+ "البرز": { x: 353, y: 249, d: "M351 227l-12-1l-8 2l11 9l-5 13l-12 7l-3 7l2 5l16 1l11 3l13-13l4-11l12-3l0-6l-3-4l-14-6z" },
11
+ "ایلام": { x: 143, y: 429, d: "M87 397l8 0l8 16l6 7l1 6l-4 13l9 0l11 4l12 8l21 18l12 1l3 7l9 14l9-7l-1-7l9-16l-10-20l-13-15l-11-5l-22-20l7-9l18-5l6-6l-2-9l-11 1l1 12l-24 1l-13-4l-7-5l-16-5l-11 1z" },
12
+ "بوشهر": { x: 387, y: 698, d: "M312 606l4 5l1 11l5 5l8 12l13 12l0 19l10 0l4 4l-5 9l3 5l9 6l1 10l4 10l6 7l0 7l6 10l11 8l7 1l15 0l12 9l9 2l8 6l2 11l4 2l2-3l13-1l-10-7l-14-15l-7-16l-9-8l-9-27l-24-44l-8-6l-14-19l-21-5l-6-9l-1-7l-9-4l-11-2z" },
13
+ "تهران": { x: 384, y: 274, d: "M380 240l0 6l-12 3l-4 11l-13 13l4 10l-5 14l15 1l13 3l29 18l5-16l-8-12l2-15l6 1l13 8l24 5l11-5l8-7l2-6l-3-14l-11-2l-22-7l-11 12l-12-1l-10-13l-15-4z" },
14
+ "چهارمحال و بختیاری": { x: 346, y: 499, d: "M323 529l12 6l5 0l19 17l8 1l11-4l0-7l-5-16l1-18l4-7l-4-11l-15-12l-1-10l-6-10l-15 2l-6 4l-10 0l-6-4l-9 1l-10 6l1 5l9 17l6 4l6 14l8 9l1 6z" },
15
+ "خراسان جنوبی": { x: 802, y: 473, d: "M734 452l-3 11l7 13l-3 13l-7 9l-11 22l59 27l8 5l21 30l40-12l18 10l12 15l10-4l-3-12l1-20l6-17l0-11l-16-2l-3-33l3-14l-13-45l0-10l13-16l3-9l-12 0l-7-5l0-13l-2-15l-36 1l-7-3l-8-10l-10 4l-16 3l-2 2l-14-2l-3 22l-2 6l4 8l8 6l-7 11l-16 11l-7 11z" },
16
+ "خراسان رضوی": { x: 784, y: 272, d: "M657 206l6 6l-4 10l0 19l4 12l15 14l0 4l-13 22l-11 4l-13 10l-8 10l21-5l21-10l13-4l6 2l15 12l1 8l-5 5l-21 14l-3 6l-7 20l0 11l3 18l2 4l11 1l13-3l4 7l4 26l3 7l14 8l6 8l5-13l7-11l16-11l7-11l-8-6l-4-8l2-6l3-22l14 2l2-2l16-3l10-4l8 10l7 3l36-1l2-7l7-7l12-1l-9-14l12-6l6-11l3-16l0-13l9-18l-3-7l1-14l-4-8l3-7l-4-19l2-11l-6-4l-38 1l-17-26l-27-10l-7-9l-1-11l-7-2l-9-6l-9-4l-8 2l-10-3l-8 4l-8-3l-2-7l-23-8l-8 6l0 9l24 1l7 11l-1 9l-7 21l11 9l-4 5l1 9l-5 3l-15-2l-34-20l-9 0l-12 10z" },
17
+ "خراسان شمالی": { x: 674, y: 152, d: "M712 124l-20-4l0-8l-7-12l-9 5l-16-5l-8 2l-8-1l-14 11l0 21l7 5l-2 8l-15 6l-5 8l12 16l-2 15l13 14l11 3l8-2l3-11l12-10l9 0l34 20l15 2l5-3l-1-9l4-5l-11-9l7-21l1-9l-7-11l-24-1l0-9z" },
18
+ "خوزستان": { x: 253, y: 524, d: "M183 491l13 21l-8 22l0 25l18 1l0 31l7 2l13 12l3 14l8 2l1-5l13 1l3-3l-1-10l-3-6l6-10l10 0l-9 12l13 9l12 0l6 8l17-11l7 0l9-2l11 2l-4-19l2-10l-8-5l-6-7l-9 2l0-9l-2-9l2-7l6-3l10-10l4-7l-1-6l-8-9l-6-14l-6-4l-9-17l-1-5l0-10l-13-3l-2-6l-11 0l-12-8l-12-1l-11-5l-22 2l-3 2l-10 23l-9 16l1 7z" },
19
+ "زنجان": { x: 228, y: 211, d: "M170 215l2 1l26 6l4 7l1 15l-3 11l14 8l3 4l4 5l11 0l9 4l6-5l-11-12l10-5l13-3l9-6l9-3l0-8l-4-11l-8-3l-6-11l1-9l10-5l-3-11l-8-9l-8-5l-12-1l-3 4l-7-5l-7 4l-20-2l-17 2l-11 8l-10 12l-1 7z" },
20
+ "سمنان": { x: 554, y: 286, d: "M615 160l-12 17l-10 22l-18-3l-14 6l-12 11l-7 3l-18 0l-10 4l-6 8l-2 9l-10 12l-6 4l-8 1l-15 4l3 14l-2 6l-8 7l-11 5l-24-5l-13-8l-6-1l-2 15l8 12l-5 16l1 8l-6 13l10 6l23 0l25 8l125-4l4 3l19-1l6-3l19-32l8-10l13-10l11-4l13-22l0-4l-15-14l-4-12l0-19l4-10l-6-6l-8 2l-11-3l-13-14l2-15z" },
21
+ "سیستان و بلوچستان": { x: 863, y: 770, d: "M805 582l-11 50l0 5l5 8l2 12l-2 11l-4 7l0 13l2 7l-16 11l-9 3l8 10l-7 13l-1 27l-6 23l3 21l6 10l-3 7l0 9l3 8l-4 16l-2 4l13 11l9 14l0 4l11-2l4 4l12 0l7 4l9-2l7 2l8 0l3-5l7-2l4 10l21 4l8 5l12 3l4-8l6-5l2-27l6-4l2-19l3-5l20-6l2-9l7-3l9-1l8-4l21 1l2-12l4-3l-2-10l1-9l-4-3l-13 3l-6-1l-2-7l3-8l-2-20l-3-10l2-12l-10-1l-11-12l-16-3l-8-4l-13-12l-4-7l-5-13l-7-10l-3-9l-23-27l49-58l2-13l-4-16l-5-5l-27-4l0 11l-6 17l-1 20l3 12l-10 4l-12-15l-18-10z" },
22
+ "فارس": { x: 473, y: 666, d: "M464 773l5 7l12 1l8 5l5-1l16 2l5-2l3-13l8-5l27-2l14 2l9-5l4-8l17-6l2-5l-7-8l2-14l0-10l-16-15l1-6l-3-9l-10-26l-17-4l-9-20l-19-11l-3-17l-11-14l-8-16l-12-30l-15-16l-13-5l-18 5l-16-2l-4-10l-17 11l-6 6l9 7l-7 21l0 11l-5 1l0 13l-6 2l-16-7l-5-1l4 16l-1 6l-14 8l-16 1l1 7l6 9l21 5l14 19l8 6l24 44l9 27l9 8l7 16l14 15z" },
23
+ "قزوین": { x: 304, y: 239, d: "M270 195l-10 5l-1 9l6 11l8 3l4 11l0 8l-9 3l-9 6l-13 3l-10 5l11 12l8-1l8 10l17 3l9 0l4-5l31-9l-2-5l3-7l12-7l5-13l-11-9l8-2l12 1l-1-3l-25-20l-11 1l-15 6l-17-4z" },
24
+ "قم": { x: 368, y: 323, d: "M407 319l-29-18l-13-3l-15-1l-3 7l-2 13l-28 8l1 7l-6 6l13 9l1 7l6 6l14 1l17 6l-3-3l2-12l8-6l15-1l17-5l6-13z" },
25
+ "کردستان": { x: 152, y: 265, d: "M75 247l16 13l13-3l9 9l-10 1l-4 13l8 13l12 8l12 17l5 9l14-1l4-8l12-5l1-5l7-1l1-5l11 3l8 9l3 0l13-1l3-8l-1-6l-8-7l-9-18l8 1l14-8l-3-4l-14-8l3-11l-1-15l-4-7l-26-6l-2-1l-10 11l-11-2l-6-6l-27 3l-13-2l-4 2l-4 8l-8 3z" },
26
+ "کرمان": { x: 697, y: 622, d: "M717 520l-56-24l-6-1l-4 4l-14 10l-28 15l-2 4l-2 24l-9 4l-9 1l-11-1l-30 5l-7 10l-1 7l11 23l-1 19l2 8l-10 3l9 20l17 4l10 26l14 3l7 7l7 2l11-8l9-1l1 33l4 6l10 7l6 1l10-4l10-9l8 3l2 16l6 4l8 11l-2 6l5 10l3 25l21 11l9-5l11 9l-3 3l-4 30l16-1l7 2l5 8l7-2l7 5l4-16l-3-8l0-9l3-7l-6-10l-3-21l6-23l1-27l7-13l-8-10l9-3l16-11l-2-7l0-13l4-7l2-11l-2-12l-5-8l0-5l11-50l-21-30l-8-5z" },
27
+ "کرمانشاه": { x: 139, y: 357, d: "M107 293l3 6l-9 8l-7 3l-2 8l-8 5l-2 6l3 11l-10-3l-3 14l6 4l-1 11l-6 8l12 20l4 3l5-24l11-1l16 5l7 5l13 4l24-1l-1-12l11-1l1-8l9-3l0-8l6-1l3-4l13-1l0-7l-19-6l11-20l-3 0l-8-9l-11-3l-1 5l-7 1l-1 5l-12 5l-4 8l-14 1l-5-9l-12-17z" },
28
+ "کهگیلویه و بویراحمد": { x: 348, y: 570, d: "M332 606l9 4l16-1l14-8l1-6l-4-16l5 1l16 7l6-2l0-13l-14-12l-3-11l-11 4l-8-1l-19-17l-5 0l-12-6l-10 10l-6 3l-2 7l2 9l0 9l9-2l6 7l8 5l-2 10z" },
29
+ "گلستان": { x: 577, y: 168, d: "M630 112l-9 1l-14-3l-15 3l-16 8l-14 12l-3 8l-1 8l-8 6l-23 7l-14-1l6 25l-1 9l-16 0l3 6l11 6l8 9l18 0l7-3l12-11l14-6l18 3l10-22l12-17l5-8l15-6l2-8l-7-5z" },
30
+ "گیلان": { x: 295, y: 181, d: "M251 170l8 5l8 9l3 11l12 12l17 4l15-6l11-1l7-12l7-8l-13-11l-9-16l-11-4l-26-2l-16-9l-6-7l-6-23l-1-23l-14 3l7 7l-12 14l-3 13l5 13l8 13l8 8z" },
31
+ "لرستان": { x: 221, y: 403, d: "M173 372l2 9l-6 6l-18 5l-7 9l22 20l11 5l13 15l10 20l10-23l3-2l22-2l11 5l12 1l12 8l11 0l8-7l4-11l8-2l7-14l1-9l-9-10l-4 6l-9-8l1-6l-7-6l-7 4l-7 9l-14-4l3-15l-15-6l-10 3l-15-2l-27-18l-6 1l0 8l-9 3z" },
32
+ "مازندران": { x: 467, y: 227, d: "M325 204l25 20l1 3l12 3l14 6l3 4l6 3l15 4l10 13l12 1l11-12l22 7l11 2l15-4l8-1l6-4l10-12l2-9l6-8l10-4l-8-9l-11-6l-3-6l-2-4l-9-1l-20 5l-17 5l-45 10l-43-10l-27-16l-7 8z" },
33
+ "مرکزی": { x: 294, y: 357, d: "M280 283l2 8l-8 0l4 11l-7 7l11 4l5 13l-8-2l-1-7l-14 0l-2 10l0 9l-7 2l1 11l4 7l2 11l-6 8l-3 15l14 4l7-9l7-4l7 6l-1 6l9 8l4-6l9 10l13-8l22-6l12-5l7-19l-17-6l-14-1l-6-6l-1-7l-13-9l6-6l-1-7l28-8l2-13l3-7l5-14l-4-10l-11-3l-16-1l-31 9l-4 5z" },
34
+ "هرمزگان": { x: 651, y: 758, d: "M771 853l-7-5l-7 2l-5-8l-7-2l-16 1l4-30l3-3l-11-9l-9 5l-21-11l-3-25l-5-10l2-6l-8-11l-6-4l-2-16l-8-3l-10 9l-10 4l-6-1l-10-7l-4-6l-1-33l-9 1l-11 8l-7-2l-7-7l-14-3l3 9l-1 6l16 15l0 10l-2 14l7 8l-2 5l-17 6l-4 8l-9 5l-14-2l-27 2l-8 5l-3 13l-5 2l-16-2l-5 1l-8-5l-12-1l-5-7l-13 1l-2 3l20 13l18 6l4 8l12 8l14-2l17 2l4 6l9 2l3 4l9 1l25-17l6 1l8-2l3-9l4-3l14-1l9-8l12-2l12 3l12 0l8 10l6 21l0 10l3 10l4 6l-3 4l9 18l23 3l1 5l9-3l6 7l24-1l14 1l10 9l6 1l7-2l0-4l-9-14l-13-11zM633 795l-9 2l-13 8l-3 3l-20 8l8 3l10-6l9-3l4 3l7-5z" },
35
+ "همدان": { x: 235, y: 319, d: "M197 314l-11 20l19 6l0 7l-13 1l-3 4l27 18l15 2l10-3l15 6l6-8l-2-11l-4-7l-1-11l7-2l0-9l2-10l14 0l1 7l8 2l-5-13l-11-4l7-7l-4-11l8 0l-2-8l-17-3l-8-10l-8 1l-6 5l-9-4l-11 0l-4-5l-14 8l-8-1l9 18l8 7l1 6l-3 8z" },
36
+ "یزد": { x: 615, y: 452, d: "M633 317l-19 32l-6 3l-19 1l1 42l-6 12l-12 5l-3 4l-6 19l-9 6l-55 19l-16-4l-9 2l-15 11l2 19l-5 25l3 9l13 5l15 16l12 30l8 16l11 14l3 17l19 11l10-3l-2-8l1-19l-11-23l1-7l7-10l30-5l11 1l9-1l9-4l2-24l2-4l28-15l14-10l4-4l6 1l56 24l11-22l7-9l3-13l-7-13l3-11l-6-8l-14-8l-3-7l-4-26l-4-7l-13 3l-11-1l-2-4l-3-18l0-11l7-20l3-6l21-14l5-5l-1-8l-15-12l-6-2l-13 4l-21 10z" },
37
+ };
@@ -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.21.0",
3
+ "version": "0.22.1",
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.21.0",
25
+ "@kashi-ui/css": "^0.22.1",
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.21.0",
63
- "@kashi-ui/persian": "^0.21.0"
62
+ "@kashi-ui/bank-logos": "^0.22.1",
63
+ "@kashi-ui/persian": "^0.22.1"
64
64
  }
65
65
  }