@kashi-ui/react 0.12.0 → 0.14.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.
package/README.md CHANGED
@@ -20,7 +20,7 @@ export function SignUp() {
20
20
  }
21
21
  ```
22
22
 
23
- کامپوننت‌ها: Button · Input · Textarea · Select · Checkbox · RadioGroup · Switch · Badge · Card · Alert · Avatar · AvatarGroup · Tabs · Dialog · Toast · Tooltip · DropdownMenu · DataTable · Pagination · Breadcrumb · Accordion · Stepper · Progress · Spinner · Skeleton · EmptyState · Divider · Kbd · RelativeTime · Combobox · CommandPalette · TagInput · FileUpload · Slider · NumberInput · Popover · StatCard · Timeline · SideNav · SegmentedControl · CopyButton · Banner · Rating · TreeView · ButtonGroup · ChipGroup · PasswordStrength · BarChart · LineChart · ContextMenu · InlineEdit
23
+ کامپوننت‌ها: Button · Input · Textarea · Select · Checkbox · RadioGroup · Switch · Badge · Card · Alert · Avatar · AvatarGroup · Tabs · Dialog · Toast · Tooltip · DropdownMenu · DataTable · Pagination · Breadcrumb · Accordion · Stepper · Progress · Spinner · Skeleton · EmptyState · Divider · Kbd · RelativeTime · Combobox · MultiSelect · CommandPalette · TagInput · FileUpload · Slider · NumberInput · Popover · StatCard · Timeline · SideNav · SegmentedControl · CopyButton · Banner · Rating · TreeView · ButtonGroup · ChipGroup · PasswordStrength · BarChart · LineChart · ContextMenu · InlineEdit · PieChart · BarList · ProportionBar · Sparkline · Carousel · ColorPicker · Tour · Meter · Splitter
24
24
 
25
25
  فارسی: DatePicker و Calendar شمسی · DateRangePicker · TimeInput · PostalCodeInput · PlateInput · LandlineInput · MonthPicker · Countdown · ActivityHeatmap · ProvinceSelect · NationalIdInput · CardNumberInput · IbanInput · MobileInput · PriceInput · OtpInput
26
26
 
@@ -21,6 +21,11 @@ export interface CalendarProps {
21
21
  max?: Date;
22
22
  /** غیرفعال کردن روزهای خاص، مثلاً جمعه‌ها */
23
23
  isDateDisabled?: (date: Date) => boolean;
24
+ /**
25
+ * نمایش تعطیلات: true برای جمعه‌ها و تعطیلات ثابت ایران،
26
+ * یا تابعی که نام تعطیلی آن روز (یا null) را برمی‌گرداند، مثلاً با getIranHoliday و تعطیلات قمری همان سال
27
+ */
28
+ holidays?: boolean | ((date: Date) => string | null | false | undefined);
24
29
  /** @default "fa" */
25
30
  digits?: "fa" | "latin";
26
31
  /** فوکوس روی روز انتخاب‌شده (یا امروز) هنگام نمایش */
@@ -39,4 +44,4 @@ export interface CalendarProps {
39
44
  "aria-label"?: string;
40
45
  }
41
46
  /** تقویم شمسی با الگوی grid استاندارد WAI-ARIA و پیمایش کامل با کیبورد */
42
- export declare function Calendar({ value, defaultValue, onChange, min, max, isDateDisabled, digits, autoFocus, yearRange, labels, footer, range, className, "aria-label": ariaLabel, }: CalendarProps): import("react").JSX.Element;
47
+ export declare function Calendar({ value, defaultValue, onChange, min, max, isDateDisabled, holidays, digits, autoFocus, yearRange, labels, footer, range, className, "aria-label": ariaLabel, }: CalendarProps): import("react").JSX.Element;
package/dist/Calendar.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useId, useRef, useState } from "react";
3
- import { JALALI_MONTHS, WEEKDAYS, WEEKDAYS_SHORT, formatJalali, jalaliMonthLength, jalaliWeekday, toFaDigits, toGregorian, toJalali, } from "@kashi-ui/persian";
3
+ import { JALALI_MONTHS, WEEKDAYS, WEEKDAYS_SHORT, formatJalali, getIranHoliday, jalaliMonthLength, jalaliWeekday, toFaDigits, toGregorian, toJalali, } from "@kashi-ui/persian";
4
4
  import { cx } from "./cx.js";
5
5
  export const sameDay = (a, b) => !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();
6
6
  const startOfDay = (d) => new Date(d.getFullYear(), d.getMonth(), d.getDate());
@@ -22,7 +22,7 @@ function clamp(d, min, max) {
22
22
  return d;
23
23
  }
24
24
  /** تقویم شمسی با الگوی grid استاندارد WAI-ARIA و پیمایش کامل با کیبورد */
25
- export function Calendar({ value, defaultValue = null, onChange, min, max, isDateDisabled, digits = "fa", autoFocus = false, yearRange, labels = {}, footer, range, className, "aria-label": ariaLabel = "تقویم", }) {
25
+ export function Calendar({ value, defaultValue = null, onChange, min, max, isDateDisabled, holidays, digits = "fa", autoFocus = false, yearRange, labels = {}, footer, range, className, "aria-label": ariaLabel = "تقویم", }) {
26
26
  const id = useId();
27
27
  const [inner, setInner] = useState(defaultValue);
28
28
  const selected = value !== undefined ? value : inner;
@@ -106,7 +106,8 @@ export function Calendar({ value, defaultValue = null, onChange, min, max, isDat
106
106
  const [lo, hi] = rs && (re || previewEnd) ? [rs, (re ?? previewEnd)].sort((a, b) => +a - +b) : [null, null];
107
107
  const inRange = !!lo && !!hi && d >= lo && d <= hi;
108
108
  const isSelected = range ? inRange || sameDay(d, rs) : sameDay(d, selected);
109
- return (_jsx("td", { role: "gridcell", "aria-selected": isSelected, "data-in-range": range && inRange && re ? "" : undefined, "data-preview": range && inRange && !re ? "" : undefined, "data-range-start": range && (lo ? sameDay(d, lo) : sameDay(d, rs)) ? "" : undefined, "data-range-end": range && (hi ? sameDay(d, hi) : sameDay(d, rs)) ? "" : undefined, children: _jsx("button", { type: "button", className: "k-calendar__day", "data-day": dayKey(d), tabIndex: sameDay(d, focused) ? 0 : -1, "aria-label": formatJalali(d, { style: "full", digits }), "aria-current": sameDay(d, today) ? "date" : undefined, "aria-disabled": isDisabled || undefined, onClick: () => {
109
+ const holiday = holidays === true ? getIranHoliday(d) : holidays ? holidays(d) || null : null;
110
+ return (_jsx("td", { role: "gridcell", "aria-selected": isSelected, "data-in-range": range && inRange && re ? "" : undefined, "data-preview": range && inRange && !re ? "" : undefined, "data-range-start": range && (lo ? sameDay(d, lo) : sameDay(d, rs)) ? "" : undefined, "data-range-end": range && (hi ? sameDay(d, hi) : sameDay(d, rs)) ? "" : undefined, children: _jsx("button", { type: "button", className: "k-calendar__day", "data-day": dayKey(d), tabIndex: sameDay(d, focused) ? 0 : -1, "aria-label": formatJalali(d, { style: "full", digits }) + (holiday ? `، تعطیل${holiday === "جمعه" ? "" : `: ${holiday}`}` : ""), title: holiday && holiday !== "جمعه" ? holiday : undefined, "data-holiday": holiday ? "" : undefined, "aria-current": sameDay(d, today) ? "date" : undefined, "aria-disabled": isDisabled || undefined, onClick: () => {
110
111
  setFocused(d);
111
112
  select(d);
112
113
  }, onKeyDown: onKeyDown, onPointerEnter: range ? () => setHover(d) : undefined, onFocus: range ? () => setHover(d) : undefined, children: n(toJalali(d).jd) }) }, di));
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from "react";
2
+ export interface CarouselProps {
3
+ /** هر فرزند یک اسلاید */
4
+ children: ReactNode;
5
+ /** نام اسلایدر، مثل «محصولات پیشنهادی» (الزامی) */
6
+ label: string;
7
+ /** تعداد اسلاید در هر نما @default 1 */
8
+ perView?: number;
9
+ /** نمایش نقطه‌ها @default true */
10
+ dots?: boolean;
11
+ className?: string;
12
+ labels?: {
13
+ prev?: string;
14
+ next?: string;
15
+ slide?: (n: number, total: number) => string;
16
+ };
17
+ }
18
+ /**
19
+ * اسلایدر روی scroll-snap بومی: با کشیدن، چرخ موس، دکمه‌ها و کلیدهای جهت کار می‌کند.
20
+ * چرخش خودکار ندارد، چون خواندن را برای همه سخت می‌کند (WCAG 2.2.2).
21
+ */
22
+ export declare function Carousel({ children, label, perView, dots, className, labels }: CarouselProps): import("react").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Children, useEffect, useId, useRef, useState } from "react";
3
+ import { toFaDigits } from "@kashi-ui/persian";
4
+ import { cx } from "./cx.js";
5
+ const Arrow = ({ next }) => (_jsx("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 1.8, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", "data-k-mirror": "", children: _jsx("path", { d: next ? "m8 5 5 5-5 5" : "m12 5-5 5 5 5" }) }));
6
+ /**
7
+ * اسلایدر روی scroll-snap بومی: با کشیدن، چرخ موس، دکمه‌ها و کلیدهای جهت کار می‌کند.
8
+ * چرخش خودکار ندارد، چون خواندن را برای همه سخت می‌کند (WCAG 2.2.2).
9
+ */
10
+ export function Carousel({ children, label, perView = 1, dots = true, className, labels = {} }) {
11
+ const id = useId();
12
+ const { prev = "قبلی", next = "بعدی", slide = (n, t) => `${toFaDigits(n)} از ${toFaDigits(t)}` } = labels;
13
+ const slides = Children.toArray(children);
14
+ const track = useRef(null);
15
+ const [index, setIndex] = useState(0);
16
+ const pages = Math.max(1, slides.length - perView + 1);
17
+ // اسلاید فعال از روی موقعیت اسکرول
18
+ useEffect(() => {
19
+ const el = track.current;
20
+ if (!el)
21
+ return;
22
+ const items = [...el.children];
23
+ const io = new IntersectionObserver((entries) => {
24
+ const vis = entries.filter((e) => e.isIntersecting && e.intersectionRatio > 0.6).map((e) => items.indexOf(e.target));
25
+ if (vis.length)
26
+ setIndex(Math.min(...vis));
27
+ }, { root: el, threshold: [0.6, 1] });
28
+ items.forEach((s) => io.observe(s));
29
+ return () => io.disconnect();
30
+ }, [slides.length]);
31
+ const go = (i) => {
32
+ const n = Math.max(0, Math.min(pages - 1, i));
33
+ const el = track.current?.children[n];
34
+ if (!el || !track.current)
35
+ return;
36
+ // scrollIntoView صفحه را هم اسکرول می‌کند؛ فقط خود ریل را جابه‌جا می‌کنیم
37
+ const t = track.current;
38
+ const rtl = getComputedStyle(t).direction === "rtl";
39
+ const offset = rtl ? -(t.getBoundingClientRect().right - el.getBoundingClientRect().right) + t.scrollLeft : el.getBoundingClientRect().left - t.getBoundingClientRect().left + t.scrollLeft;
40
+ t.scrollTo({ left: offset });
41
+ setIndex(n);
42
+ };
43
+ return (_jsxs("section", { className: cx("k-carousel", className), "aria-roledescription": "\u0627\u0633\u0644\u0627\u06CC\u062F\u0631", "aria-label": label, style: { "--k-carousel-per-view": perView }, children: [_jsx("div", { ref: track, className: "k-carousel__track", tabIndex: 0, "aria-live": "polite", onKeyDown: (e) => {
44
+ const rtl = getComputedStyle(e.currentTarget).direction === "rtl";
45
+ const step = { ArrowLeft: rtl ? 1 : -1, ArrowRight: rtl ? -1 : 1 }[e.key];
46
+ if (step) {
47
+ e.preventDefault();
48
+ go(index + step);
49
+ }
50
+ else if (e.key === "Home")
51
+ go(0);
52
+ else if (e.key === "End")
53
+ go(pages - 1);
54
+ }, children: slides.map((s, i) => (_jsx("div", { className: "k-carousel__slide", role: "group", "aria-roledescription": "\u0627\u0633\u0644\u0627\u06CC\u062F", "aria-label": slide(i + 1, slides.length), id: `${id}-s${i}`, children: s }, i))) }), pages > 1 && (_jsxs("div", { className: "k-carousel__bar", children: [dots ? (_jsx("ul", { className: "k-carousel__dots", "aria-label": `اسلایدهای ${label}`, children: Array.from({ length: pages }, (_, i) => (_jsx("li", { children: _jsx("button", { type: "button", className: "k-carousel__dot", "aria-label": slide(i + 1, pages), "aria-current": i === index, "aria-controls": `${id}-s${i}`, onClick: () => go(i) }) }, i))) })) : _jsx("span", {}), _jsxs("div", { className: "k-carousel__nav", children: [_jsx("button", { type: "button", className: "k-btn k-btn--secondary k-btn--icon k-btn--sm", "aria-label": prev, disabled: index === 0, onClick: () => go(index - 1), children: _jsx(Arrow, {}) }), _jsx("button", { type: "button", className: "k-btn k-btn--secondary k-btn--icon k-btn--sm", "aria-label": next, disabled: index >= pages - 1, onClick: () => go(index + 1), children: _jsx(Arrow, { next: true }) })] })] }))] }));
55
+ }
@@ -0,0 +1,23 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ColorPickerProps {
3
+ label?: ReactNode;
4
+ hint?: ReactNode;
5
+ /** رنگ hex، مثل "#0fa89b" */
6
+ value?: string;
7
+ defaultValue?: string;
8
+ onChange?: (hex: string) => void;
9
+ /** رنگ‌های پیشنهادی؛ [] برای حذف */
10
+ swatches?: {
11
+ name: string;
12
+ value: string;
13
+ }[];
14
+ /** نمایش کنتراست با متن سفید و مشکی @default true */
15
+ showContrast?: boolean;
16
+ name?: string;
17
+ id?: string;
18
+ className?: string;
19
+ }
20
+ /** نسبت کنتراست WCAG */
21
+ export declare const contrastRatio: (a: string, b: string) => number;
22
+ /** انتخاب رنگ برند یا برچسب: نمونه‌رنگ‌ها، پنل انتخاب دلخواه و کد hex، با کنتراست متن روی آن */
23
+ export declare function ColorPicker({ label, hint, value, defaultValue, onChange, swatches, showContrast, name, id, className }: ColorPickerProps): import("react").JSX.Element;
@@ -0,0 +1,143 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useId, useRef, useState } from "react";
3
+ import { toFaDigits } from "@kashi-ui/persian";
4
+ import { Field } from "./Field.js";
5
+ const DEFAULT_SWATCHES = [
6
+ { name: "فیروزه‌ای", value: "#0b8077" },
7
+ { name: "لاجوردی", value: "#2740ed" },
8
+ { name: "بنفش", value: "#7c3aed" },
9
+ { name: "اناری", value: "#e51d2a" },
10
+ { name: "زعفرانی", value: "#dd5e02" },
11
+ { name: "پسته‌ای", value: "#518b25" },
12
+ { name: "شب", value: "#2a2f3d" },
13
+ ];
14
+ const HEX = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i;
15
+ const norm = (v) => {
16
+ const m = v.trim().match(HEX);
17
+ if (!m)
18
+ return null;
19
+ const h = m[1].length === 3 ? [...m[1]].map((c) => c + c).join("") : m[1];
20
+ return `#${h.toLowerCase()}`;
21
+ };
22
+ const lum = (hex) => {
23
+ const [r, g, b] = [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16) / 255).map((c) => (c <= 0.03928 ? c / 12.92 : ((c + 0.055) / 1.055) ** 2.4));
24
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
25
+ };
26
+ /** نسبت کنتراست WCAG */
27
+ export const contrastRatio = (a, b) => {
28
+ a = norm(a) ?? a;
29
+ b = norm(b) ?? b;
30
+ const [x, y] = [lum(a), lum(b)].sort((m, n) => n - m);
31
+ return (x + 0.05) / (y + 0.05);
32
+ };
33
+ const hexToRgb = (hex) => [1, 3, 5].map((i) => parseInt(hex.slice(i, i + 2), 16));
34
+ const rgbToHex = (r, g, b) => `#${[r, g, b].map((n) => Math.round(Math.min(255, Math.max(0, n))).toString(16).padStart(2, "0")).join("")}`;
35
+ function hexToHsv(hex) {
36
+ const [r, g, b] = hexToRgb(hex).map((n) => n / 255);
37
+ const max = Math.max(r, g, b), d = max - Math.min(r, g, b);
38
+ let h = 0;
39
+ if (d)
40
+ h = max === r ? ((g - b) / d) % 6 : max === g ? (b - r) / d + 2 : (r - g) / d + 4;
41
+ return { h: (h * 60 + 360) % 360, s: max ? d / max : 0, v: max };
42
+ }
43
+ function hsvToHex({ h, s, v }) {
44
+ const f = (n) => {
45
+ const k = (n + h / 60) % 6;
46
+ return (v - v * s * Math.max(0, Math.min(k, 4 - k, 1))) * 255;
47
+ };
48
+ return rgbToHex(f(5), f(3), f(1));
49
+ }
50
+ const Dropper = () => _jsx("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 1.7, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m11 5 4 4M13.5 2.5a2.1 2.1 0 0 1 3 3L15 7 13 5ZM12 6l-7.5 7.5L3 17l3.5-1.5L14 8" }) });
51
+ /** پنل انتخاب رنگ: سطح اشباع و روشنایی، نوار رنگ‌مایه، قطره‌چکان و کدها */
52
+ function ColorPanel({ hex, onChange, onClose }) {
53
+ const [hsv, setHsv] = useState(() => hexToHsv(hex));
54
+ const area = useRef(null);
55
+ const panel = useRef(null);
56
+ // تغییر از بیرون (نمونه‌رنگ یا فیلد hex) رنگ‌مایه را حفظ می‌کند وقتی رنگ خاکستری است
57
+ useEffect(() => {
58
+ if (hsvToHex(hsv) !== hex)
59
+ setHsv((p) => { const n = hexToHsv(hex); return n.s === 0 ? { ...n, h: p.h } : n; });
60
+ }, [hex]);
61
+ useEffect(() => {
62
+ area.current?.focus({ preventScroll: true });
63
+ const onDown = (e) => !panel.current?.parentElement?.contains(e.target) && onClose();
64
+ document.addEventListener("pointerdown", onDown);
65
+ return () => document.removeEventListener("pointerdown", onDown);
66
+ }, []);
67
+ const apply = (n) => {
68
+ setHsv(n);
69
+ onChange(hsvToHex(n));
70
+ };
71
+ const fromPointer = (e) => {
72
+ const r = area.current.getBoundingClientRect();
73
+ const x = Math.min(1, Math.max(0, (e.clientX - r.left) / r.width));
74
+ const y = Math.min(1, Math.max(0, (e.clientY - r.top) / r.height));
75
+ apply({ ...hsv, s: x, v: 1 - y });
76
+ };
77
+ const onAreaKey = (e) => {
78
+ const step = e.shiftKey ? 0.1 : 0.01;
79
+ const k = {
80
+ ArrowLeft: { s: Math.max(0, hsv.s - step) }, ArrowRight: { s: Math.min(1, hsv.s + step) },
81
+ ArrowUp: { v: Math.min(1, hsv.v + step) }, ArrowDown: { v: Math.max(0, hsv.v - step) },
82
+ };
83
+ if (k[e.key]) {
84
+ e.preventDefault();
85
+ apply({ ...hsv, ...k[e.key] });
86
+ }
87
+ };
88
+ const [r, g, b] = hexToRgb(hex);
89
+ const pct = (n) => `${toFaDigits(Math.round(n * 100))}٪`;
90
+ const eye = typeof window !== "undefined" && "EyeDropper" in window;
91
+ return (_jsxs("div", { ref: panel, className: "k-color__panel", role: "dialog", "aria-label": "\u0627\u0646\u062A\u062E\u0627\u0628 \u0631\u0646\u06AF \u062F\u0644\u062E\u0648\u0627\u0647", onKeyDown: (e) => {
92
+ if (e.key === "Escape") {
93
+ e.stopPropagation();
94
+ onClose();
95
+ }
96
+ }, children: [_jsx("div", { ref: area, className: "k-color__area", style: { "--_hue": `hsl(${hsv.h} 100% 50%)` }, role: "slider", tabIndex: 0, "aria-label": "\u0627\u0634\u0628\u0627\u0639 \u0648 \u0631\u0648\u0634\u0646\u0627\u06CC\u06CC", "aria-valuetext": `اشباع ${pct(hsv.s)}، روشنایی ${pct(hsv.v)}`, "aria-valuenow": Math.round(hsv.s * 100), onPointerDown: (e) => {
97
+ e.currentTarget.setPointerCapture(e.pointerId);
98
+ fromPointer(e);
99
+ }, onPointerMove: (e) => e.buttons === 1 && fromPointer(e), onKeyDown: onAreaKey, children: _jsx("span", { className: "k-color__thumb", style: { left: `${hsv.s * 100}%`, top: `${(1 - hsv.v) * 100}%` } }) }), _jsxs("div", { className: "k-color__tools", children: [eye && (_jsx("button", { type: "button", className: "k-btn k-btn--tertiary k-btn--icon k-btn--sm", "aria-label": "\u0628\u0631\u062F\u0627\u0634\u062A\u0646 \u0631\u0646\u06AF \u0627\u0632 \u0635\u0641\u062D\u0647", onClick: async () => {
100
+ try {
101
+ const res = await new window.EyeDropper().open();
102
+ const h = norm(res.sRGBHex);
103
+ if (h)
104
+ onChange(h);
105
+ }
106
+ catch { /* کاربر انصراف داد */ }
107
+ }, children: _jsx(Dropper, {}) })), _jsx("span", { className: "k-color__current", "aria-hidden": "true" }), _jsx("input", { type: "range", className: "k-color__hue", min: 0, max: 359, value: Math.round(hsv.h), "aria-label": "\u0631\u0646\u06AF\u200C\u0645\u0627\u06CC\u0647", "aria-valuetext": `${toFaDigits(Math.round(hsv.h))} درجه`, onChange: (e) => apply({ ...hsv, h: Number(e.target.value) }) })] }), _jsx("div", { className: "k-color__codes", dir: "ltr", children: ["R", "G", "B"].map((ch, i) => (_jsxs("label", { className: "k-color__code", children: [_jsx("input", { className: "k-color__num", inputMode: "numeric", value: [r, g, b][i], "aria-label": { R: "قرمز", G: "سبز", B: "آبی" }[ch], onChange: (e) => {
108
+ const n = Math.min(255, Math.max(0, Number(e.target.value.replace(/\D/g, "")) || 0));
109
+ const rgb = [r, g, b];
110
+ rgb[i] = n;
111
+ onChange(rgbToHex(rgb[0], rgb[1], rgb[2]));
112
+ } }), _jsx("span", { "aria-hidden": "true", children: ch })] }, ch))) })] }));
113
+ }
114
+ const Check = () => _jsx("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 2.2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m5 10.5 3.2 3L15 7" }) });
115
+ /** انتخاب رنگ برند یا برچسب: نمونه‌رنگ‌ها، پنل انتخاب دلخواه و کد hex، با کنتراست متن روی آن */
116
+ export function ColorPicker({ label, hint, value, defaultValue = "#0b8077", onChange, swatches = DEFAULT_SWATCHES, showContrast = true, name, id, className }) {
117
+ const autoId = useId();
118
+ const fieldId = id ?? autoId;
119
+ const [inner, setInner] = useState(norm(defaultValue) ?? "#000000");
120
+ const current = norm(value ?? "") ?? inner;
121
+ const [text, setText] = useState(null);
122
+ const [open, setOpen] = useState(false);
123
+ const trigger = useRef(null);
124
+ const set = (hex) => {
125
+ if (value === undefined)
126
+ setInner(hex);
127
+ setText(null);
128
+ onChange?.(hex);
129
+ };
130
+ const white = contrastRatio(current, "#ffffff"), black = contrastRatio(current, "#000000");
131
+ const ink = white >= black ? "#ffffff" : "#000000";
132
+ const fmt = (r) => toFaDigits((Math.round(r * 10) / 10).toFixed(1)).replace(".", "٫");
133
+ const invalid = text !== null && !norm(text);
134
+ return (_jsx(Field, { id: `${fieldId}-hex`, label: label, hint: hint, error: invalid ? "کد رنگ معتبر نیست؛ مثل ‎#0fa89b‎ وارد کنید." : undefined, className: className, children: _jsxs("div", { className: "k-color", style: { "--_sw": current, "--_ink": ink }, children: [swatches.length > 0 && (_jsx("div", { className: "k-color__swatches", role: "radiogroup", "aria-label": "\u0631\u0646\u06AF\u200C\u0647\u0627\u06CC \u067E\u06CC\u0634\u0646\u0647\u0627\u062F\u06CC", children: swatches.map((s) => (_jsxs("label", { className: "k-color__swatch", style: { "--_sw": s.value, "--_ink": contrastRatio(s.value, "#ffffff") >= 3 ? "#fff" : "#000" }, title: s.name, children: [_jsx("input", { type: "radio", className: "k-sr-only", name: `${fieldId}-sw`, checked: norm(s.value) === current, "aria-label": s.name, onChange: () => set(norm(s.value)) }), _jsx(Check, {})] }, s.value))) })), _jsxs("div", { className: "k-color__row", children: [_jsxs("span", { className: "k-color__anchor", children: [_jsx("button", { ref: trigger, type: "button", className: "k-color__preview", "aria-label": "\u0627\u0646\u062A\u062E\u0627\u0628 \u0631\u0646\u06AF \u062F\u0644\u062E\u0648\u0627\u0647", "aria-haspopup": "dialog", "aria-expanded": open, onClick: () => setOpen((o) => !o) }), open && _jsx(ColorPanel, { hex: current, onChange: set, onClose: () => { setOpen(false); trigger.current?.focus(); } })] }), _jsx("div", { className: "k-input", "data-state": invalid ? "invalid" : undefined, children: _jsx("input", { id: `${fieldId}-hex`, className: "k-input__control", dir: "ltr", spellCheck: false, autoComplete: "off", value: text ?? current, "aria-invalid": invalid || undefined, onChange: (e) => {
135
+ setText(e.target.value);
136
+ const h = norm(e.target.value);
137
+ if (h) {
138
+ if (value === undefined)
139
+ setInner(h);
140
+ onChange?.(h);
141
+ }
142
+ }, onBlur: () => !invalid && setText(null) }) })] }), showContrast && (_jsxs("p", { className: "k-color__contrast", "aria-live": "polite", children: [_jsx("span", { className: "k-color__sample", children: "\u0645\u062A\u0646 \u0646\u0645\u0648\u0646\u0647" }), _jsxs("span", { children: ["\u06A9\u0646\u062A\u0631\u0627\u0633\u062A \u0628\u0627 \u0645\u062A\u0646 ", ink === "#ffffff" ? "سفید" : "مشکی", ": ", fmt(Math.max(white, black)), " \u0628\u0647 \u06F1 ", Math.max(white, black) >= 4.5 ? "(AA)" : "(کمتر از AA)"] })] })), name && _jsx("input", { type: "hidden", name: name, value: current })] }) }));
143
+ }
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import { type CalendarLabels } from "./Calendar.js";
2
+ import { type CalendarLabels, type CalendarProps } from "./Calendar.js";
3
3
  import { type InputProps } from "./Input.js";
4
4
  type Base = Omit<InputProps, "value" | "defaultValue" | "onChange" | "type" | "addonEnd" | "min" | "max">;
5
5
  export interface DatePickerProps extends Base {
@@ -19,6 +19,8 @@ export interface DatePickerProps extends Base {
19
19
  /** @default "امروز" */
20
20
  todayLabel?: string;
21
21
  calendarLabels?: CalendarLabels;
22
+ /** تعطیلات در تقویم؛ مثل Calendar */
23
+ holidays?: CalendarProps["holidays"];
22
24
  }
23
25
  /**
24
26
  * انتخاب تاریخ شمسی: تایپ مستقیم (۱۴۰۳/۰۵/۱۲) یا انتخاب از تقویم.
@@ -8,7 +8,7 @@ import { mergeRefs, useIsomorphicLayoutEffect } from "./utils.js";
8
8
  * انتخاب تاریخ شمسی: تایپ مستقیم (۱۴۰۳/۰۵/۱۲) یا انتخاب از تقویم.
9
9
  * با name، مقدار میلادی به شکل YYYY-MM-DD در فرم ارسال می‌شود.
10
10
  */
11
- export const DatePicker = forwardRef(function DatePicker({ value, defaultValue = null, onChange, min, max, isDateDisabled, digits = "fa", yearRange, invalidMessage = "این تاریخ معتبر نیست؛ آن را به شکل ۱۴۰۳/۰۵/۱۲ وارد کنید.", openLabel = "انتخاب تاریخ از تقویم", todayLabel = "امروز", calendarLabels, error, name, onBlur, placeholder, ...rest }, ref) {
11
+ export const DatePicker = forwardRef(function DatePicker({ value, defaultValue = null, onChange, min, max, isDateDisabled, holidays, digits = "fa", yearRange, invalidMessage = "این تاریخ معتبر نیست؛ آن را به شکل ۱۴۰۳/۰۵/۱۲ وارد کنید.", openLabel = "انتخاب تاریخ از تقویم", todayLabel = "امروز", calendarLabels, error, name, onBlur, placeholder, ...rest }, ref) {
12
12
  const id = useId();
13
13
  const popoverId = `${id}-calendar`;
14
14
  const [inner, setInner] = useState(defaultValue);
@@ -82,7 +82,7 @@ export const DatePicker = forwardRef(function DatePicker({ value, defaultValue =
82
82
  }, children: _jsx(Calendar, { value: selected, onChange: (d) => {
83
83
  commit(d);
84
84
  close();
85
- }, min: min, max: max, isDateDisabled: isDateDisabled, digits: digits, yearRange: yearRange, labels: calendarLabels, autoFocus: true, footer: _jsx("button", { type: "button", className: "k-btn k-btn--link", onClick: () => {
85
+ }, min: min, max: max, isDateDisabled: isDateDisabled, holidays: holidays, digits: digits, yearRange: yearRange, labels: calendarLabels, autoFocus: true, footer: _jsx("button", { type: "button", className: "k-btn k-btn--link", onClick: () => {
86
86
  const t = new Date();
87
87
  commit(new Date(t.getFullYear(), t.getMonth(), t.getDate()));
88
88
  close();
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from "react";
2
- import { type CalendarLabels } from "./Calendar.js";
2
+ import { type CalendarLabels, type CalendarProps } from "./Calendar.js";
3
3
  export interface DateRange {
4
4
  start: Date | null;
5
5
  end: Date | null;
@@ -34,6 +34,8 @@ export interface DateRangePickerProps {
34
34
  id?: string;
35
35
  className?: string;
36
36
  calendarLabels?: CalendarLabels;
37
+ /** تعطیلات در تقویم؛ مثل Calendar */
38
+ holidays?: CalendarProps["holidays"];
37
39
  labels?: {
38
40
  placeholder?: string;
39
41
  separator?: string;
@@ -47,4 +49,4 @@ export interface DateRangePickerProps {
47
49
  * انتخاب بازهٔ تاریخ شمسی: کلیک اول شروع، کلیک دوم پایان؛ پیش از تأیید، بازه با حرکت موس پیش‌نمایش می‌شود.
48
50
  * تغییرها فقط با «تأیید» ثبت می‌شوند.
49
51
  */
50
- export declare function DateRangePicker({ label, hint, error, value, defaultValue, onChange, min, max, isDateDisabled, presets, digits, name, disabled, id, className, calendarLabels, labels, }: DateRangePickerProps): import("react").JSX.Element;
52
+ export declare function DateRangePicker({ label, hint, error, value, defaultValue, onChange, min, max, isDateDisabled, holidays, presets, digits, name, disabled, id, className, calendarLabels, labels, }: DateRangePickerProps): import("react").JSX.Element;
@@ -29,7 +29,7 @@ export const defaultRangePresets = [
29
29
  * انتخاب بازهٔ تاریخ شمسی: کلیک اول شروع، کلیک دوم پایان؛ پیش از تأیید، بازه با حرکت موس پیش‌نمایش می‌شود.
30
30
  * تغییرها فقط با «تأیید» ثبت می‌شوند.
31
31
  */
32
- export function DateRangePicker({ label, hint, error, value, defaultValue = { start: null, end: null }, onChange, min, max, isDateDisabled, presets = defaultRangePresets, digits = "fa", name, disabled, id, className, calendarLabels, labels = {}, }) {
32
+ export function DateRangePicker({ label, hint, error, value, defaultValue = { start: null, end: null }, onChange, min, max, isDateDisabled, holidays, presets = defaultRangePresets, digits = "fa", name, disabled, id, className, calendarLabels, labels = {}, }) {
33
33
  const autoId = useId();
34
34
  const triggerId = id ?? autoId;
35
35
  const popoverId = `${triggerId}-popover`;
@@ -90,5 +90,5 @@ export function DateRangePicker({ label, hint, error, value, defaultValue = { st
90
90
  }, children: [presets.length > 0 && (_jsx("ul", { className: "k-daterange__presets", role: "list", "aria-label": presetsLabel, children: presets.map((p, i) => (_jsx("li", { children: _jsx("button", { type: "button", className: "k-daterange__preset", "aria-pressed": i === activePreset, onClick: () => {
91
91
  setDraft(p.range(today));
92
92
  setNav((n) => n + 1);
93
- }, children: p.label }) }, p.label))) })), _jsxs("div", { className: "k-daterange__main", children: [_jsx(Calendar, { range: draft, value: draft.end ?? draft.start, onChange: pick, min: min, max: max, isDateDisabled: isDateDisabled, digits: digits, labels: calendarLabels, autoFocus: true }, nav), _jsxs("div", { className: "k-daterange__footer", children: [_jsx("span", { className: "k-daterange__summary", "aria-live": "polite", children: draft.start && draft.end ? `${fmt(draft.start)}${separator}${fmt(draft.end)}` : draft.start ? pickEnd : "" }), _jsx("button", { type: "button", className: "k-btn k-btn--secondary k-btn--sm", onClick: () => close(), children: cancel }), _jsx("button", { type: "button", className: cx("k-btn k-btn--primary k-btn--sm"), disabled: !draft.start || !draft.end, onClick: () => commit(draft), children: apply })] })] })] }))] }) }));
93
+ }, children: p.label }) }, p.label))) })), _jsxs("div", { className: "k-daterange__main", children: [_jsx(Calendar, { range: draft, value: draft.end ?? draft.start, onChange: pick, min: min, max: max, isDateDisabled: isDateDisabled, holidays: holidays, digits: digits, labels: calendarLabels, autoFocus: true }, nav), _jsxs("div", { className: "k-daterange__footer", children: [_jsx("span", { className: "k-daterange__summary", "aria-live": "polite", children: draft.start && draft.end ? `${fmt(draft.start)}${separator}${fmt(draft.end)}` : draft.start ? pickEnd : "" }), _jsx("button", { type: "button", className: "k-btn k-btn--secondary k-btn--sm", onClick: () => close(), children: cancel }), _jsx("button", { type: "button", className: cx("k-btn k-btn--primary k-btn--sm"), disabled: !draft.start || !draft.end, onClick: () => commit(draft), children: apply })] })] })] }))] }) }));
94
94
  }
@@ -0,0 +1,22 @@
1
+ import type { ReactNode } from "react";
2
+ export interface MeterProps {
3
+ label: ReactNode;
4
+ value: number;
5
+ /** @default 100 */
6
+ max?: number;
7
+ /** از این مقدار به بعد هشدار (زرد) @default ۸۰٪ max */
8
+ warning?: number;
9
+ /** از این مقدار به بعد بحرانی (قرمز) @default ۹۵٪ max */
10
+ critical?: number;
11
+ /** قالب مقدار، مثل «۴٫۲ گیگابایت» */
12
+ format?: (n: number) => string;
13
+ className?: string;
14
+ labels?: {
15
+ ok?: string;
16
+ warning?: string;
17
+ critical?: string;
18
+ of?: string;
19
+ };
20
+ }
21
+ /** سنجهٔ یک مقدار در برابر سقف، مثل فضای ذخیره یا سهمیهٔ پیامک؛ وضعیت با متن و آیکون، نه فقط رنگ */
22
+ export declare function Meter({ label, value, max, warning, critical, format, className, labels }: MeterProps): import("react").JSX.Element;
package/dist/Meter.js ADDED
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { formatNumber, toFaDigits } from "@kashi-ui/persian";
3
+ import { cx } from "./cx.js";
4
+ const Icon = ({ d }) => _jsx("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 1.8, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: d }) });
5
+ /** سنجهٔ یک مقدار در برابر سقف، مثل فضای ذخیره یا سهمیهٔ پیامک؛ وضعیت با متن و آیکون، نه فقط رنگ */
6
+ export function Meter({ label, value, max = 100, warning = max * 0.8, critical = max * 0.95, format = (n) => formatNumber(n), className, labels = {} }) {
7
+ const { ok = "در محدودهٔ مجاز", warning: warnText = "نزدیک به سقف", critical: critText = "سقف تقریباً پر شده", of = "از" } = labels;
8
+ const v = Math.min(max, Math.max(0, value));
9
+ const status = v >= critical ? "critical" : v >= warning ? "warning" : "ok";
10
+ const pct = Math.round((v / max) * 100);
11
+ const text = { ok, warning: warnText, critical: critText }[status];
12
+ return (_jsxs("div", { className: cx("k-meter", className), "data-status": status, children: [_jsxs("div", { className: "k-meter__head", children: [_jsx("span", { className: "k-meter__label", children: label }), _jsxs("span", { className: "k-meter__value", children: [format(v), " ", _jsxs("span", { children: [of, " ", format(max)] })] })] }), _jsxs("div", { className: "k-meter__track", role: "meter", "aria-valuenow": v, "aria-valuemin": 0, "aria-valuemax": max, "aria-valuetext": `${format(v)} ${of} ${format(max)}، ${toFaDigits(pct)}٪، ${text}`, "aria-label": typeof label === "string" ? label : undefined, children: [_jsx("span", { className: "k-meter__fill", style: { inlineSize: `${pct}%` } }), _jsx("span", { className: "k-meter__mark", style: { insetInlineStart: `${(warning / max) * 100}%` }, "aria-hidden": "true" })] }), _jsxs("p", { className: "k-meter__status", "aria-hidden": "true", children: [_jsx(Icon, { d: status === "ok" ? "m5 10.5 3.2 3L15 7" : "M10 3 2.5 16.5h15ZM10 8v4M10 14.5h.01" }), text, " \u00B7 ", toFaDigits(pct), "\u066A"] })] }));
13
+ }
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from "react";
2
+ import { type ComboboxOption } from "./Combobox.js";
3
+ export interface MultiSelectProps {
4
+ label?: ReactNode;
5
+ hint?: ReactNode;
6
+ error?: ReactNode;
7
+ options: ComboboxOption[];
8
+ value?: string[];
9
+ defaultValue?: string[];
10
+ onChange?: (value: string[]) => void;
11
+ placeholder?: string;
12
+ /** بیشترین تعداد انتخاب */
13
+ max?: number;
14
+ filter?: (option: ComboboxOption, query: string) => boolean;
15
+ /** @default "نتیجه‌ای پیدا نشد." */
16
+ emptyMessage?: ReactNode;
17
+ disabled?: boolean;
18
+ /** با name، یک فیلد پنهان برای هر مقدار */
19
+ name?: string;
20
+ id?: string;
21
+ className?: string;
22
+ labels?: {
23
+ remove?: (label: string) => string;
24
+ selected?: (n: number) => string;
25
+ max?: (n: number) => string;
26
+ clear?: string;
27
+ };
28
+ }
29
+ /**
30
+ * انتخاب چند گزینه با جستجو؛ انتخاب‌ها به‌شکل برچسب داخل فیلد.
31
+ * ↑↓ حرکت، Enter انتخاب یا لغو انتخاب، Backspace در فیلد خالی آخرین برچسب را حذف می‌کند، Esc بستن.
32
+ */
33
+ export declare function MultiSelect({ label, hint, error, options, value, defaultValue, onChange, placeholder, max, filter, emptyMessage, disabled, name, id, className, labels, }: MultiSelectProps): import("react").JSX.Element;
@@ -0,0 +1,82 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId, useMemo, useRef, useState } from "react";
3
+ import { toFaDigits } from "@kashi-ui/persian";
4
+ import { Badge } from "./Badge.js";
5
+ import { defaultFilter, highlight } from "./Combobox.js";
6
+ import { Field, describedBy } from "./Field.js";
7
+ const Check = () => _jsx("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "m5 10.5 3.2 3L15 7" }) });
8
+ /**
9
+ * انتخاب چند گزینه با جستجو؛ انتخاب‌ها به‌شکل برچسب داخل فیلد.
10
+ * ↑↓ حرکت، Enter انتخاب یا لغو انتخاب، Backspace در فیلد خالی آخرین برچسب را حذف می‌کند، Esc بستن.
11
+ */
12
+ export function MultiSelect({ label, hint, error, options, value, defaultValue = [], onChange, placeholder, max, filter = defaultFilter, emptyMessage = "نتیجه‌ای پیدا نشد.", disabled, name, id, className, labels = {}, }) {
13
+ const { remove = (l) => `حذف ${l}`, selected: selectedLabel = (n) => `${toFaDigits(n)} مورد انتخاب شده`, max: maxLabel = (n) => `حداکثر ${toFaDigits(n)} مورد`, clear = "پاک کردن همه", } = labels;
14
+ const autoId = useId();
15
+ const inputId = id ?? autoId;
16
+ const listId = `${inputId}-list`;
17
+ const [inner, setInner] = useState(defaultValue);
18
+ const chosen = value ?? inner;
19
+ const [query, setQuery] = useState("");
20
+ const [open, setOpen] = useState(false);
21
+ const [active, setActive] = useState(-1);
22
+ const [announce, setAnnounce] = useState("");
23
+ const input = useRef(null);
24
+ const wrap = useRef(null);
25
+ const filtered = useMemo(() => options.filter((o) => filter(o, query)), [options, query, filter]);
26
+ const full = max !== undefined && chosen.length >= max;
27
+ const set = (next) => {
28
+ if (value === undefined)
29
+ setInner(next);
30
+ onChange?.(next);
31
+ };
32
+ const toggle = (o) => {
33
+ if (o.disabled)
34
+ return;
35
+ const on = chosen.includes(o.value);
36
+ if (!on && full)
37
+ return setAnnounce(maxLabel(max));
38
+ set(on ? chosen.filter((v) => v !== o.value) : [...chosen, o.value]);
39
+ setAnnounce(`${o.label} ${on ? "حذف شد" : "انتخاب شد"}`);
40
+ setQuery("");
41
+ };
42
+ const move = (d) => {
43
+ const en = filtered.map((o, i) => (o.disabled ? -1 : i)).filter((i) => i >= 0);
44
+ if (!en.length)
45
+ return;
46
+ const p = en.indexOf(active);
47
+ setActive(en[(p + d + en.length) % en.length]);
48
+ };
49
+ const onKey = (e) => {
50
+ if (e.key === "ArrowDown") {
51
+ e.preventDefault();
52
+ open ? move(1) : (setOpen(true), setActive(0));
53
+ }
54
+ else if (e.key === "ArrowUp") {
55
+ e.preventDefault();
56
+ open ? move(-1) : setOpen(true);
57
+ }
58
+ else if (e.key === "Enter" && open && filtered[active]) {
59
+ e.preventDefault();
60
+ toggle(filtered[active]);
61
+ }
62
+ else if (e.key === "Escape" && open) {
63
+ e.preventDefault();
64
+ setOpen(false);
65
+ }
66
+ else if (e.key === "Backspace" && !query && chosen.length) {
67
+ const last = options.find((o) => o.value === chosen[chosen.length - 1]);
68
+ set(chosen.slice(0, -1));
69
+ if (last)
70
+ setAnnounce(`${last.label} حذف شد`);
71
+ }
72
+ };
73
+ const labelOf = (v) => options.find((o) => o.value === v)?.label ?? v;
74
+ return (_jsx(Field, { id: inputId, label: label, hint: hint, error: error, className: className, children: _jsxs("div", { ref: wrap, className: "k-combobox k-multiselect", "data-open": open ? "" : undefined, onBlur: (e) => !wrap.current?.contains(e.relatedTarget) && setOpen(false), children: [_jsxs("div", { className: "k-tag-input", "data-invalid": error ? "" : undefined, onClick: () => input.current?.focus(), children: [chosen.map((v) => (_jsx(Badge, { tone: "brand", onRemove: disabled ? undefined : () => set(chosen.filter((x) => x !== v)), removeLabel: remove(labelOf(v)), children: labelOf(v) }, v))), _jsx("input", { ref: input, id: inputId, className: "k-tag-input__control", role: "combobox", "aria-autocomplete": "list", "aria-expanded": open, "aria-controls": listId, "aria-activedescendant": open && active >= 0 ? `${listId}-${active}` : undefined, "aria-describedby": describedBy(inputId, hint, error, `${inputId}-count`), "aria-invalid": error ? true : undefined, autoComplete: "off", placeholder: chosen.length ? undefined : placeholder, disabled: disabled, value: query, onChange: (e) => {
75
+ setQuery(e.target.value);
76
+ setOpen(true);
77
+ setActive(0);
78
+ }, onFocus: () => setOpen(true), onKeyDown: onKey }), chosen.length > 1 && !disabled && (_jsx("button", { type: "button", className: "k-input__action", "aria-label": clear, onClick: () => { set([]); input.current?.focus(); }, children: _jsx("svg", { viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 1.7, strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "m6 6 8 8M14 6l-8 8" }) }) }))] }), _jsxs("ul", { id: listId, role: "listbox", "aria-multiselectable": "true", "aria-label": typeof label === "string" ? label : undefined, className: "k-listbox", hidden: !open, style: { insetBlockStart: "calc(100% + 6px)" }, children: [filtered.length === 0 && _jsx("li", { className: "k-listbox__empty", role: "presentation", children: emptyMessage }), filtered.map((o, i) => {
79
+ const on = chosen.includes(o.value);
80
+ return (_jsxs("li", { id: `${listId}-${i}`, role: "option", "aria-selected": on, "aria-disabled": o.disabled || (!on && full) || undefined, "data-active": i === active ? "" : undefined, className: "k-option k-option--check", onPointerDown: (e) => e.preventDefault(), onClick: () => toggle(o), onPointerMove: () => active !== i && setActive(i), children: [_jsx("span", { className: "k-multiselect__box", "aria-hidden": "true", children: on && _jsx(Check, {}) }), o.icon, _jsxs("span", { className: "k-option__body", children: [_jsx("span", { children: highlight(o.label, query) }), o.description && _jsx("span", { className: "k-option__desc", children: o.description })] })] }, o.value));
81
+ })] }), _jsx("span", { id: `${inputId}-count`, className: "k-sr-only", children: selectedLabel(chosen.length) }), _jsx("span", { className: "k-sr-only", "aria-live": "polite", children: announce }), name && chosen.map((v) => _jsx("input", { type: "hidden", name: name, value: v }, v))] }) }));
82
+ }
@@ -1,4 +1,4 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  /** صفحه‌هایی که نمایش داده می‌شوند؛ null یعنی «…» */
3
3
  export declare function pageRange(page: number, total: number, siblings?: number): (number | null)[];
4
4
  export interface PaginationProps {
@@ -13,13 +13,22 @@ export interface PaginationProps {
13
13
  summary?: ReactNode;
14
14
  /** @default "fa" */
15
15
  digits?: "fa" | "latin";
16
+ /** تعداد ردیف در هر صفحه؛ با onPageSizeChange فهرست انتخاب نمایش داده می‌شود */
17
+ pageSize?: number;
18
+ /** @default [10, 20, 50, 100] */
19
+ pageSizes?: number[];
20
+ onPageSizeChange?: (size: number) => void;
21
+ /** فیلد «برو به صفحه» برای فهرست‌های طولانی */
22
+ jumper?: boolean;
16
23
  labels?: {
17
24
  nav?: string;
18
25
  prev?: string;
19
26
  next?: string;
20
27
  page?: (n: string) => string;
28
+ perPage?: string;
29
+ jump?: string;
21
30
  };
22
31
  className?: string;
23
32
  }
24
33
  /** صفحه‌بندی با ارقام فارسی؛ صفحهٔ فعلی با aria-current="page" */
25
- export declare function Pagination({ page, total, onChange, getHref, siblings, summary, digits, labels, className }: PaginationProps): import("react").JSX.Element;
34
+ export declare function Pagination({ page, total, onChange, getHref, siblings, summary, digits, pageSize, pageSizes, onPageSizeChange, jumper, labels, className, }: PaginationProps): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
2
3
  import { toFaDigits } from "@kashi-ui/persian";
3
4
  import { cx } from "./cx.js";
4
5
  /** صفحه‌هایی که نمایش داده می‌شوند؛ null یعنی «…» */
@@ -19,10 +20,17 @@ export function pageRange(page, total, siblings = 1) {
19
20
  }
20
21
  const Chevron = ({ dir }) => (_jsx("svg", { "data-k-mirror": "", viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", strokeWidth: 1.7, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: dir === "prev" ? "m12 5-5 5 5 5" : "m8 5 5 5-5 5" }) }));
21
22
  /** صفحه‌بندی با ارقام فارسی؛ صفحهٔ فعلی با aria-current="page" */
22
- export function Pagination({ page, total, onChange, getHref, siblings = 1, summary, digits = "fa", labels = {}, className }) {
23
+ export function Pagination({ page, total, onChange, getHref, siblings = 1, summary, digits = "fa", pageSize, pageSizes = [10, 20, 50, 100], onPageSizeChange, jumper, labels = {}, className, }) {
23
24
  const n = (v) => (digits === "fa" ? toFaDigits(v) : String(v));
24
- const { nav = "صفحه‌بندی", prev = "قبلی", next = "بعدی", page: pageLabel = (x) => `صفحهٔ ${x}` } = labels;
25
+ const { nav = "صفحه‌بندی", prev = "قبلی", next = "بعدی", page: pageLabel = (x) => `صفحهٔ ${x}`, perPage = "در هر صفحه", jump = "برو به صفحه" } = labels;
26
+ const [jumpText, setJumpText] = useState("");
25
27
  // تابع معمولی، نه کامپوننت: تا دکمه‌ها با هر رندر دوباره ساخته نشوند و فوکوس کیبورد حفظ شود
26
28
  const item = ({ to, children, current, disabled, aria, className: c }) => getHref && !disabled ? (_jsx("a", { className: c, href: getHref(to), "aria-current": current ? "page" : undefined, "aria-label": aria, children: children })) : (_jsx("button", { type: "button", className: c, disabled: disabled, "aria-current": current ? "page" : undefined, "aria-label": aria, onClick: () => onChange?.(to), children: children }));
27
- return (_jsxs("nav", { className: cx("k-pagination", className), "aria-label": nav, children: [item({ to: page - 1, disabled: page <= 1, className: "k-btn k-btn--secondary k-btn--sm", children: _jsxs(_Fragment, { children: [_jsx(Chevron, { dir: "prev" }), prev] }) }), summary && _jsx("span", { className: "k-pagination__summary", children: summary }), _jsx("ul", { className: "k-pagination__pages", role: "list", children: pageRange(page, total, siblings).map((p, i) => (_jsx("li", { children: p === null ? (_jsx("span", { className: "k-pagination__ellipsis", "aria-hidden": "true", children: "\u2026" })) : (item({ to: p, current: p === page, aria: pageLabel(n(p)), className: "k-pagination__page", children: n(p) })) }, i))) }), item({ to: page + 1, disabled: page >= total, className: "k-btn k-btn--secondary k-btn--sm", children: _jsxs(_Fragment, { children: [next, _jsx(Chevron, { dir: "next" })] }) })] }));
29
+ return (_jsxs("nav", { className: cx("k-pagination", className), "aria-label": nav, children: [item({ to: page - 1, disabled: page <= 1, className: "k-btn k-btn--secondary k-btn--sm", children: _jsxs(_Fragment, { children: [_jsx(Chevron, { dir: "prev" }), prev] }) }), summary && _jsx("span", { className: "k-pagination__summary", children: summary }), _jsx("ul", { className: "k-pagination__pages", role: "list", children: pageRange(page, total, siblings).map((p, i) => (_jsx("li", { children: p === null ? (_jsx("span", { className: "k-pagination__ellipsis", "aria-hidden": "true", children: "\u2026" })) : (item({ to: p, current: p === page, aria: pageLabel(n(p)), className: "k-pagination__page", children: n(p) })) }, i))) }), item({ to: page + 1, disabled: page >= total, className: "k-btn k-btn--secondary k-btn--sm", children: _jsxs(_Fragment, { children: [next, _jsx(Chevron, { dir: "next" })] }) }), (onPageSizeChange || (jumper && onChange)) && (_jsxs("div", { className: "k-pagination__tools", children: [onPageSizeChange && (_jsxs("label", { className: "k-pagination__tool", children: [_jsx("span", { className: "k-select k-select--sm", children: _jsx("select", { className: "k-select__control", value: pageSize, onChange: (e) => onPageSizeChange(Number(e.target.value)), children: pageSizes.map((sz) => _jsx("option", { value: sz, children: n(sz) }, sz)) }) }), _jsx("span", { children: perPage })] })), jumper && onChange && (_jsx("form", { className: "k-pagination__tool", onSubmit: (e) => {
30
+ e.preventDefault();
31
+ const to = Number(jumpText.replace(/[۰-۹]/g, (d) => String("۰۱۲۳۴۵۶۷۸۹".indexOf(d))).replace(/\D/g, ""));
32
+ if (to >= 1 && to <= total)
33
+ onChange(to);
34
+ setJumpText("");
35
+ }, children: _jsxs("label", { className: "k-pagination__tool", children: [_jsx("span", { children: jump }), _jsx("span", { className: "k-input k-input--sm k-pagination__jump", children: _jsx("input", { className: "k-input__control", inputMode: "numeric", dir: "ltr", value: jumpText, placeholder: n(page), "aria-label": `${jump}، از ${n(1)} تا ${n(total)}`, onChange: (e) => setJumpText(e.target.value) }) })] }) }))] }))] }));
28
36
  }
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from "react";
2
+ export interface SplitterProps {
3
+ /** دقیقاً دو فرزند: پنل ابتدا و پنل انتها */
4
+ children: [ReactNode, ReactNode];
5
+ /** «horizontal» کنار هم، «vertical» زیر هم @default "horizontal" */
6
+ orientation?: "horizontal" | "vertical";
7
+ /** اندازهٔ پنل اول به درصد */
8
+ size?: number;
9
+ defaultSize?: number;
10
+ onSizeChange?: (percent: number) => void;
11
+ /** @default 15 */
12
+ min?: number;
13
+ /** @default 85 */
14
+ max?: number;
15
+ /** نام دستگیره، مثل «اندازهٔ فهرست فایل‌ها» @default «تغییر اندازهٔ پنل‌ها» */
16
+ label?: string;
17
+ /** ارتفاع ظرف در حالت افقی */
18
+ height?: string;
19
+ className?: string;
20
+ }
21
+ /** دو پنل با مرز قابل‌کشیدن؛ با کیبورد: ←→ (یا ↑↓) پنج درصد، Home/End کمینه و بیشینه */
22
+ export declare function Splitter({ children, orientation, size, defaultSize, onSizeChange, min, max, label, height, className }: SplitterProps): import("react").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useRef, useState } from "react";
3
+ import { toFaDigits } from "@kashi-ui/persian";
4
+ import { cx } from "./cx.js";
5
+ /** دو پنل با مرز قابل‌کشیدن؛ با کیبورد: ←→ (یا ↑↓) پنج درصد، Home/End کمینه و بیشینه */
6
+ export function Splitter({ children, orientation = "horizontal", size, defaultSize = 40, onSizeChange, min = 15, max = 85, label = "تغییر اندازهٔ پنل‌ها", height, className }) {
7
+ const [inner, setInner] = useState(defaultSize);
8
+ const current = size ?? inner;
9
+ const [dragging, setDragging] = useState(false);
10
+ const box = useRef(null);
11
+ const vertical = orientation === "vertical";
12
+ const set = (p) => {
13
+ const v = Math.round(Math.min(max, Math.max(min, p)) * 10) / 10;
14
+ if (size === undefined)
15
+ setInner(v);
16
+ onSizeChange?.(v);
17
+ };
18
+ const fromPointer = (e) => {
19
+ const r = box.current.getBoundingClientRect();
20
+ if (vertical)
21
+ return set(((e.clientY - r.top) / r.height) * 100);
22
+ // در RTL پنل اول سمت راست است
23
+ const rtl = getComputedStyle(box.current).direction === "rtl";
24
+ set(((rtl ? r.right - e.clientX : e.clientX - r.left) / r.width) * 100);
25
+ };
26
+ const onKey = (e) => {
27
+ const rtl = getComputedStyle(e.currentTarget).direction === "rtl";
28
+ const keys = vertical
29
+ ? { ArrowUp: -5, ArrowDown: 5 }
30
+ : { ArrowLeft: rtl ? 5 : -5, ArrowRight: rtl ? -5 : 5 };
31
+ if (e.key in keys)
32
+ set(current + keys[e.key]);
33
+ else if (e.key === "Home")
34
+ set(min);
35
+ else if (e.key === "End")
36
+ set(max);
37
+ else
38
+ return;
39
+ e.preventDefault();
40
+ };
41
+ return (_jsxs("div", { ref: box, className: cx("k-splitter", vertical && "k-splitter--vertical", className), "data-dragging": dragging ? "" : undefined, style: { blockSize: height }, children: [_jsx("div", { className: "k-splitter__pane", style: vertical ? { blockSize: `${current}%` } : { inlineSize: `${current}%` }, children: children[0] }), _jsx("div", { className: "k-splitter__handle", role: "separator", tabIndex: 0, "aria-orientation": vertical ? "horizontal" : "vertical", "aria-valuenow": current, "aria-valuemin": min, "aria-valuemax": max, "aria-valuetext": `${toFaDigits(Math.round(current))}٪`, "aria-label": label, "data-dragging": dragging ? "" : undefined, onKeyDown: onKey, onPointerDown: (e) => {
42
+ e.currentTarget.setPointerCapture(e.pointerId);
43
+ setDragging(true);
44
+ }, onPointerMove: (e) => dragging && fromPointer(e), onPointerUp: () => setDragging(false), onPointerCancel: () => setDragging(false), onDoubleClick: () => set(defaultSize) }), _jsx("div", { className: "k-splitter__pane", children: children[1] })] }));
45
+ }
package/dist/Tabs.js CHANGED
@@ -1,6 +1,7 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { createContext, useContext, useId, useRef, useState } from "react";
3
3
  import { cx } from "./cx.js";
4
+ import { useIsomorphicLayoutEffect } from "./utils.js";
4
5
  const TabsCtx = createContext(null);
5
6
  const useTabs = () => {
6
7
  const ctx = useContext(TabsCtx);
@@ -26,7 +27,24 @@ export function Tabs({ value, defaultValue = "", onChange, variant = "line", blo
26
27
  }
27
28
  export function TabList({ className, children, ...rest }) {
28
29
  const ref = useRef(null);
29
- const { orientation } = useTabs();
30
+ const { orientation, selected } = useTabs();
31
+ // نشانگر زبانهٔ فعال که با تغییر زبانه می‌لغزد؛ تا اندازه‌گیری نشده، سبک ایستای CSS نمایش داده می‌شود
32
+ const [box, setBox] = useState(null);
33
+ useIsomorphicLayoutEffect(() => {
34
+ const list = ref.current;
35
+ if (!list)
36
+ return;
37
+ const measure = () => {
38
+ const tab = list.querySelector('[role="tab"][aria-selected="true"]');
39
+ if (!tab)
40
+ return setBox(null);
41
+ setBox({ x: tab.offsetLeft, y: tab.offsetTop, w: tab.offsetWidth, h: tab.offsetHeight });
42
+ };
43
+ measure();
44
+ const ro = new ResizeObserver(measure);
45
+ ro.observe(list);
46
+ return () => ro.disconnect();
47
+ }, [selected]);
30
48
  const onKeyDown = (e) => {
31
49
  const tabs = [...(ref.current?.querySelectorAll('[role="tab"]:not(:disabled)') ?? [])];
32
50
  const i = tabs.indexOf(document.activeElement);
@@ -43,7 +61,7 @@ export function TabList({ className, children, ...rest }) {
43
61
  next.focus();
44
62
  next.click(); // فعال‌سازی خودکار با فوکوس
45
63
  };
46
- return (_jsx("div", { ref: ref, role: "tablist", "aria-orientation": orientation, className: cx("k-tabs__list", className), onKeyDown: onKeyDown, ...rest, children: children }));
64
+ return (_jsxs("div", { ref: ref, role: "tablist", "aria-orientation": orientation, className: cx("k-tabs__list", className), "data-indicator": box ? "" : undefined, style: box ? { "--_ix": `${box.x}px`, "--_iy": `${box.y}px`, "--_iw": `${box.w}px`, "--_ih": `${box.h}px` } : undefined, onKeyDown: onKeyDown, ...rest, children: [children, box && _jsx("span", { className: "k-tabs__indicator", "aria-hidden": "true" })] }));
47
65
  }
48
66
  export function Tab({ value, className, children, disabled, ...rest }) {
49
67
  const { id, selected, select } = useTabs();
package/dist/Tour.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ import { type ReactNode } from "react";
2
+ export interface TourStep {
3
+ /** CSS selector عنصری که این مرحله دربارهٔ آن است، مثل "#export-btn" */
4
+ target: string;
5
+ title: ReactNode;
6
+ content: ReactNode;
7
+ }
8
+ export interface TourProps {
9
+ steps: TourStep[];
10
+ open: boolean;
11
+ onOpenChange: (open: boolean) => void;
12
+ /** پس از آخرین مرحله */
13
+ onFinish?: () => void;
14
+ labels?: {
15
+ next?: string;
16
+ prev?: string;
17
+ done?: string;
18
+ skip?: string;
19
+ step?: (n: number, total: number) => string;
20
+ };
21
+ }
22
+ /**
23
+ * راهنمای قدم‌به‌قدم برای آشنایی با محصول: بخش هر مرحله روشن و بقیه کم‌رنگ می‌شود.
24
+ * Esc می‌بندد، ←→ بین مرحله‌ها و فوکوس پس از پایان به جای قبلی برمی‌گردد.
25
+ */
26
+ export declare function Tour({ steps, open, onOpenChange, onFinish, labels }: TourProps): import("react").JSX.Element | null;
package/dist/Tour.js ADDED
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useId, useLayoutEffect, useRef, useState } from "react";
3
+ import { toFaDigits } from "@kashi-ui/persian";
4
+ /**
5
+ * راهنمای قدم‌به‌قدم برای آشنایی با محصول: بخش هر مرحله روشن و بقیه کم‌رنگ می‌شود.
6
+ * Esc می‌بندد، ←→ بین مرحله‌ها و فوکوس پس از پایان به جای قبلی برمی‌گردد.
7
+ */
8
+ export function Tour({ steps, open, onOpenChange, onFinish, labels = {} }) {
9
+ const id = useId();
10
+ const { next = "بعدی", prev = "قبلی", done = "تمام", skip = "رد کردن", step: stepLabel = (n, t) => `مرحلهٔ ${toFaDigits(n)} از ${toFaDigits(t)}` } = labels;
11
+ const [i, setI] = useState(0);
12
+ const [rect, setRect] = useState(null);
13
+ const card = useRef(null);
14
+ const [cardPos, setCardPos] = useState({ top: 0, left: 0 });
15
+ const returnTo = useRef(null);
16
+ const s = steps[i];
17
+ useEffect(() => {
18
+ if (open) {
19
+ returnTo.current = document.activeElement;
20
+ setI(0);
21
+ }
22
+ else
23
+ returnTo.current?.focus?.();
24
+ }, [open]);
25
+ // جای عنصر هدف را دنبال می‌کند
26
+ useLayoutEffect(() => {
27
+ if (!open || !s)
28
+ return;
29
+ const el = document.querySelector(s.target);
30
+ if (!el)
31
+ return setRect(null);
32
+ el.scrollIntoView({ block: "center", behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth" });
33
+ const update = () => setRect(el.getBoundingClientRect());
34
+ update();
35
+ const t = setTimeout(update, 400);
36
+ addEventListener("scroll", update, { passive: true });
37
+ addEventListener("resize", update);
38
+ return () => {
39
+ clearTimeout(t);
40
+ removeEventListener("scroll", update);
41
+ removeEventListener("resize", update);
42
+ };
43
+ }, [open, i, s?.target]);
44
+ // کارت زیر عنصر، یا بالای آن اگر جا نباشد
45
+ useLayoutEffect(() => {
46
+ if (!open || !card.current)
47
+ return;
48
+ const c = card.current.getBoundingClientRect();
49
+ if (!rect)
50
+ return setCardPos({ top: innerHeight / 2 - c.height / 2, left: innerWidth / 2 - c.width / 2 });
51
+ const below = rect.bottom + 12 + c.height < innerHeight;
52
+ const top = below ? rect.bottom + 12 : Math.max(12, rect.top - 12 - c.height);
53
+ const left = Math.min(innerWidth - c.width - 12, Math.max(12, rect.left + rect.width / 2 - c.width / 2));
54
+ setCardPos({ top, left });
55
+ card.current.focus({ preventScroll: true });
56
+ }, [rect, open, i]);
57
+ if (!open || !s)
58
+ return null;
59
+ const last = i === steps.length - 1;
60
+ const finish = () => {
61
+ onOpenChange(false);
62
+ onFinish?.();
63
+ };
64
+ return (_jsxs(_Fragment, { children: [rect && _jsx("div", { className: "k-tour__spot", "aria-hidden": "true", style: { top: rect.top - 6, left: rect.left - 6, inlineSize: rect.width + 12, blockSize: rect.height + 12 } }), _jsxs("div", { ref: card, className: "k-tour__card", role: "dialog", "aria-modal": "false", "aria-labelledby": `${id}-t`, "aria-describedby": `${id}-b`, tabIndex: -1, style: { top: cardPos.top, left: cardPos.left }, onKeyDown: (e) => {
65
+ if (e.key === "Escape")
66
+ onOpenChange(false);
67
+ const rtl = getComputedStyle(e.currentTarget).direction === "rtl";
68
+ if (e.key === (rtl ? "ArrowLeft" : "ArrowRight") && !last)
69
+ setI(i + 1);
70
+ if (e.key === (rtl ? "ArrowRight" : "ArrowLeft") && i > 0)
71
+ setI(i - 1);
72
+ }, children: [_jsx("span", { className: "k-tour__step", children: stepLabel(i + 1, steps.length) }), _jsx("p", { className: "k-tour__title", id: `${id}-t`, children: s.title }), _jsx("p", { className: "k-tour__body", id: `${id}-b`, children: s.content }), _jsxs("div", { className: "k-tour__actions", children: [_jsx("button", { type: "button", className: "k-btn k-btn--link k-tour__skip", onClick: () => onOpenChange(false), children: skip }), _jsx("span", { className: "k-tour__progress", "aria-hidden": "true", children: steps.map((_, k) => _jsx("span", { "data-on": k <= i ? "" : undefined }, k)) }), i > 0 && _jsx("button", { type: "button", className: "k-btn k-btn--secondary k-btn--sm", onClick: () => setI(i - 1), children: prev }), _jsx("button", { type: "button", className: "k-btn k-btn--primary k-btn--sm", onClick: () => (last ? finish() : setI(i + 1)), children: last ? done : next })] })] })] }));
73
+ }
package/dist/index.d.ts CHANGED
@@ -122,3 +122,15 @@ export { InlineEdit } from "./InlineEdit.js";
122
122
  export type { InlineEditProps } from "./InlineEdit.js";
123
123
  export { ProvinceSelect } from "./ProvinceSelect.js";
124
124
  export type { ProvinceSelectProps } from "./ProvinceSelect.js";
125
+ export { Carousel } from "./Carousel.js";
126
+ export type { CarouselProps } from "./Carousel.js";
127
+ export { ColorPicker, contrastRatio } from "./ColorPicker.js";
128
+ export type { ColorPickerProps } from "./ColorPicker.js";
129
+ export { Meter } from "./Meter.js";
130
+ export type { MeterProps } from "./Meter.js";
131
+ export { Splitter } from "./Splitter.js";
132
+ export type { SplitterProps } from "./Splitter.js";
133
+ export { Tour } from "./Tour.js";
134
+ export type { TourProps, TourStep } from "./Tour.js";
135
+ export { MultiSelect } from "./MultiSelect.js";
136
+ export type { MultiSelectProps } from "./MultiSelect.js";
package/dist/index.js CHANGED
@@ -61,3 +61,9 @@ export { ActivityHeatmap } from "./ActivityHeatmap.js";
61
61
  export { ContextMenu } from "./ContextMenu.js";
62
62
  export { InlineEdit } from "./InlineEdit.js";
63
63
  export { ProvinceSelect } from "./ProvinceSelect.js";
64
+ export { Carousel } from "./Carousel.js";
65
+ export { ColorPicker, contrastRatio } from "./ColorPicker.js";
66
+ export { Meter } from "./Meter.js";
67
+ export { Splitter } from "./Splitter.js";
68
+ export { Tour } from "./Tour.js";
69
+ export { MultiSelect } from "./MultiSelect.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kashi-ui/react",
3
- "version": "0.12.0",
3
+ "version": "0.14.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.12.0",
25
+ "@kashi-ui/css": "^0.14.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.12.0",
63
- "@kashi-ui/persian": "^0.12.0"
62
+ "@kashi-ui/bank-logos": "^0.14.0",
63
+ "@kashi-ui/persian": "^0.14.0"
64
64
  }
65
65
  }