@kuraykaraaslan/kui-react 1.0.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 (47) hide show
  1. package/LICENSE +17 -0
  2. package/README.md +168 -0
  3. package/dist/AdvancedDataTable-F3DNXDKX.mjs +11 -0
  4. package/dist/DataTable-2G27T4E6.mjs +11 -0
  5. package/dist/DateRangePicker-AL32QB6L.mjs +11 -0
  6. package/dist/DropdownMenu-f5yV9dzM.d.mts +22 -0
  7. package/dist/DropdownMenu-f5yV9dzM.d.ts +22 -0
  8. package/dist/MapView-FERKPCDB.mjs +10 -0
  9. package/dist/ServerDataTable-RZV3K6KQ.mjs +11 -0
  10. package/dist/Tooltip-Bof5GvOc.d.mts +248 -0
  11. package/dist/Tooltip-Bof5GvOc.d.ts +248 -0
  12. package/dist/VideoPlayer-P3I6ESXJ.mjs +9 -0
  13. package/dist/app.d.mts +620 -0
  14. package/dist/app.d.ts +620 -0
  15. package/dist/app.js +7061 -0
  16. package/dist/app.mjs +100 -0
  17. package/dist/chunk-24BCQSLI.mjs +1 -0
  18. package/dist/chunk-45I3EDB2.mjs +90 -0
  19. package/dist/chunk-4IWCD7ID.mjs +1450 -0
  20. package/dist/chunk-5E2HXWFI.mjs +105 -0
  21. package/dist/chunk-C7AYI4XM.mjs +402 -0
  22. package/dist/chunk-J4D44TUA.mjs +1267 -0
  23. package/dist/chunk-KTEWZKNE.mjs +1020 -0
  24. package/dist/chunk-LMUQHL4Z.mjs +3829 -0
  25. package/dist/chunk-MD5OQ4J2.mjs +527 -0
  26. package/dist/chunk-MPJRPYIZ.mjs +1 -0
  27. package/dist/chunk-MPWUEQ7J.mjs +2422 -0
  28. package/dist/chunk-MTT5TKAJ.mjs +93 -0
  29. package/dist/chunk-RBDK7MWQ.mjs +46 -0
  30. package/dist/chunk-SVFQZPNZ.mjs +3648 -0
  31. package/dist/chunk-TZWBBMSG.mjs +1 -0
  32. package/dist/chunk-XA7J6PVJ.mjs +1488 -0
  33. package/dist/chunk-ZLYBRYWQ.mjs +726 -0
  34. package/dist/common.d.mts +921 -0
  35. package/dist/common.d.ts +921 -0
  36. package/dist/common.js +4991 -0
  37. package/dist/common.mjs +172 -0
  38. package/dist/index.d.mts +10 -0
  39. package/dist/index.d.ts +10 -0
  40. package/dist/index.js +17563 -0
  41. package/dist/index.mjs +349 -0
  42. package/dist/ui.d.mts +937 -0
  43. package/dist/ui.d.ts +937 -0
  44. package/dist/ui.js +10095 -0
  45. package/dist/ui.mjs +163 -0
  46. package/package.json +114 -0
  47. package/styles/index.css +129 -0
@@ -0,0 +1,248 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ type DateValue = Date | null;
6
+ type DateRange = {
7
+ start: Date | null;
8
+ end: Date | null;
9
+ };
10
+ type LocaleCode = 'tr' | 'en';
11
+ type DisabledDates = Date[] | ((d: Date) => boolean);
12
+ type DatePickerMessages = {
13
+ /** Trigger placeholder when no date selected. */
14
+ placeholder: string;
15
+ /** Aria-label for the chevron-left (previous month) button. */
16
+ prevMonth: string;
17
+ /** Aria-label for the chevron-right (next month) button. */
18
+ nextMonth: string;
19
+ /** Button label that jumps to today. */
20
+ today: string;
21
+ /** Aria-label for the clear (×) button on the trigger. */
22
+ clear: string;
23
+ /** Aria-label for the calendar dialog. */
24
+ dialogLabel: string;
25
+ /** Visible label when the user reaches a disabled day via keyboard. */
26
+ disabledDate: string;
27
+ };
28
+ type CommonPickerProps = {
29
+ id?: string;
30
+ label?: string;
31
+ hint?: string;
32
+ error?: string;
33
+ disabled?: boolean;
34
+ required?: boolean;
35
+ min?: Date;
36
+ max?: Date;
37
+ disabledDates?: DisabledDates;
38
+ /** Locale code — defaults to 'tr'. */
39
+ locale?: LocaleCode;
40
+ /** Override the locale-default display format. */
41
+ format?: string;
42
+ /** Override individual messages (placeholder, today, …). */
43
+ messages?: Partial<DatePickerMessages>;
44
+ /** Popover (default) is the only M1 variant. */
45
+ variant?: 'popover';
46
+ className?: string;
47
+ /** Pass-through name attribute for native form submission. */
48
+ name?: string;
49
+ };
50
+ type DatePickerProps = CommonPickerProps & {
51
+ value: DateValue;
52
+ onChange: (d: Date | null) => void;
53
+ };
54
+ type DateRangePickerProps = CommonPickerProps & {
55
+ value: DateRange | null;
56
+ onChange: (r: DateRange) => void;
57
+ };
58
+
59
+ type SelectOption = {
60
+ value: string;
61
+ label: string;
62
+ icon?: React.ReactNode;
63
+ };
64
+ type BaseProps = {
65
+ id: string;
66
+ label: string;
67
+ options: SelectOption[];
68
+ placeholder?: string;
69
+ hint?: string;
70
+ error?: string;
71
+ disabled?: boolean;
72
+ required?: boolean;
73
+ searchable?: boolean;
74
+ className?: string;
75
+ };
76
+ declare const Select: react.ForwardRefExoticComponent<BaseProps & Omit<react.SelectHTMLAttributes<HTMLSelectElement>, "id"> & react.RefAttributes<HTMLSelectElement>>;
77
+
78
+ declare function SkipLink({ href, label, className, }: {
79
+ href?: string;
80
+ label?: string;
81
+ className?: string;
82
+ }): react_jsx_runtime.JSX.Element;
83
+ declare function LiveRegion({ message, politeness, className, }: {
84
+ message?: string;
85
+ politeness?: 'polite' | 'assertive';
86
+ className?: string;
87
+ }): react_jsx_runtime.JSX.Element;
88
+ declare function Announcer({ message, politeness, }: {
89
+ message: string;
90
+ politeness?: 'polite' | 'assertive';
91
+ }): react_jsx_runtime.JSX.Element;
92
+
93
+ type BreadcrumbItem = {
94
+ label: string;
95
+ href?: string;
96
+ };
97
+ declare function Breadcrumb({ items, separator, maxItems, className, }: {
98
+ items: BreadcrumbItem[];
99
+ separator?: React.ReactNode;
100
+ maxItems?: number;
101
+ className?: string;
102
+ }): react_jsx_runtime.JSX.Element;
103
+
104
+ type ComboBoxOption = {
105
+ value: string;
106
+ label: string;
107
+ description?: string;
108
+ icon?: React.ReactNode;
109
+ disabled?: boolean;
110
+ };
111
+ type LoadMoreFn = () => Promise<ComboBoxOption[]>;
112
+ type ComboBoxProps = {
113
+ id: string;
114
+ label: string;
115
+ options: ComboBoxOption[];
116
+ value?: string;
117
+ onChange?: (value: string) => void;
118
+ onSearch?: (query: string, signal?: AbortSignal) => ComboBoxOption[] | Promise<ComboBoxOption[]>;
119
+ onLoadMore?: LoadMoreFn;
120
+ placeholder?: string;
121
+ hint?: string;
122
+ error?: string;
123
+ disabled?: boolean;
124
+ required?: boolean;
125
+ clearable?: boolean;
126
+ noResultsText?: string;
127
+ className?: string;
128
+ debounceMs?: number;
129
+ virtualize?: boolean | number;
130
+ };
131
+
132
+ type MultiSelectOption = ComboBoxOption;
133
+ type MultiSelectProps = {
134
+ id: string;
135
+ label: string;
136
+ options: MultiSelectOption[];
137
+ value?: string[];
138
+ onChange?: (values: string[]) => void;
139
+ placeholder?: string;
140
+ hint?: string;
141
+ error?: string;
142
+ disabled?: boolean;
143
+ searchable?: boolean;
144
+ className?: string;
145
+ onSearch?: (q: string, signal?: AbortSignal) => MultiSelectOption[] | Promise<MultiSelectOption[]>;
146
+ onLoadMore?: () => Promise<MultiSelectOption[]>;
147
+ debounceMs?: number;
148
+ };
149
+ declare function MultiSelect({ id, label, options, value, onChange, placeholder, hint, error, disabled, searchable, className, onSearch, onLoadMore, debounceMs, }: MultiSelectProps): react_jsx_runtime.JSX.Element;
150
+
151
+ type ToastVariant = 'success' | 'warning' | 'error' | 'info' | 'loading';
152
+ type ToastPosition = 'top-right' | 'top-left' | 'top-center' | 'bottom-right' | 'bottom-left' | 'bottom-center';
153
+ type ToastItemAction = {
154
+ label: string;
155
+ /** Receives a `dismiss` callback so actions can optionally close the toast. */
156
+ onClick: (dismiss: () => void) => void;
157
+ variant?: 'default' | 'danger';
158
+ };
159
+ type ToastItem = {
160
+ id: string;
161
+ variant: ToastVariant;
162
+ message: string;
163
+ title?: string;
164
+ icon?: ReactNode;
165
+ /** ms — undefined = variant default; 0 = persistent */
166
+ duration?: number;
167
+ actions?: ToastItemAction[];
168
+ /** Show the × close button (default: true) */
169
+ closeButton?: boolean;
170
+ /** Per-toast position override (M1) — falls back to <Toaster position>. */
171
+ position?: ToastPosition;
172
+ };
173
+ /** Options accepted by `toast(message, opts)` and `toast.success(...)` etc. */
174
+ type ToastOptions = Partial<Omit<ToastItem, 'id' | 'variant' | 'message'>>;
175
+ /** Customisable copy strings for built-in toaster UI (M2+ extends this). */
176
+ type ToastMessages = {
177
+ dismiss?: string;
178
+ };
179
+ /** Imperative API surface — keep in sync with `toast` object. */
180
+ type ToastApi = {
181
+ (message: string, opts?: ToastOptions): string;
182
+ success: (message: string, opts?: ToastOptions) => string;
183
+ error: (message: string, opts?: ToastOptions) => string;
184
+ warning: (message: string, opts?: ToastOptions) => string;
185
+ info: (message: string, opts?: ToastOptions) => string;
186
+ loading: (message: string, opts?: ToastOptions) => string;
187
+ promise: <T>(promise: Promise<T>, messages: {
188
+ loading: string;
189
+ success: string | ((data: T) => string);
190
+ error: string | ((err: unknown) => string);
191
+ }, opts?: ToastOptions) => string;
192
+ update: (id: string, patch: Partial<Omit<ToastItem, 'id'>>) => void;
193
+ dismiss: (id: string) => void;
194
+ clear: () => void;
195
+ };
196
+ /** @deprecated Pre-directory-split alias. Prefer ToastItemAction. */
197
+ type ToastAction = {
198
+ label: string;
199
+ onClick: () => void;
200
+ };
201
+
202
+ declare const toast: ToastApi;
203
+ type ToasterProps = {
204
+ /** Default position for toasts that don't specify their own. */
205
+ position?: ToastPosition;
206
+ /** Maximum concurrent toasts (default 5). Older toasts dismiss FIFO. */
207
+ max?: number;
208
+ /** Tailwind gap unit between stacked toasts (default 2 = 0.5rem). */
209
+ gap?: number;
210
+ /** Skip enter/exit animation. M3 will auto-detect `prefers-reduced-motion`. */
211
+ reducedMotion?: boolean;
212
+ /** Localisable copy. TODO M2: pipe into close button / action labels. */
213
+ messages?: ToastMessages;
214
+ };
215
+ declare function Toaster({ position, max, gap, reducedMotion, messages: _messages, }?: ToasterProps): react_jsx_runtime.JSX.Element;
216
+ /** @deprecated Use `<Toaster />` — kept for back-compat with the pre-split API. */
217
+ declare const ToastProvider: typeof Toaster;
218
+ /** @deprecated Use `<Toaster />` instead. Static region without store wiring. */
219
+ declare function ToastRegion({ children, position, className, }: {
220
+ children?: React.ReactNode;
221
+ position?: ToastPosition;
222
+ className?: string;
223
+ }): react_jsx_runtime.JSX.Element;
224
+ /** @deprecated Mount `<Toaster />` and call `toast.success(...)` instead. */
225
+ declare function Toast({ variant, message, duration, onDismiss, action, }: {
226
+ variant?: ToastItem['variant'];
227
+ message: string;
228
+ duration?: number;
229
+ onDismiss?: () => void;
230
+ action?: {
231
+ label: string;
232
+ onClick: () => void;
233
+ };
234
+ }): null;
235
+
236
+ type TooltipTheme = 'default' | 'dark' | 'light';
237
+ type TooltipPlacement = 'top' | 'bottom' | 'left' | 'right';
238
+ declare function Tooltip({ content, placement, theme, arrow, delay, children, className, }: {
239
+ content: React.ReactNode;
240
+ placement?: TooltipPlacement;
241
+ theme?: TooltipTheme;
242
+ arrow?: boolean;
243
+ delay?: number;
244
+ children: React.ReactNode;
245
+ className?: string;
246
+ }): react_jsx_runtime.JSX.Element;
247
+
248
+ export { Announcer as A, Breadcrumb as B, type ComboBoxOption as C, type DateRange as D, LiveRegion as L, MultiSelect as M, Select as S, Toast as T, type BreadcrumbItem as a, type MultiSelectOption as b, type SelectOption as c, SkipLink as d, type ToastAction as e, type ToastItem as f, type ToastItemAction as g, type ToastPosition as h, ToastProvider as i, ToastRegion as j, type ToastVariant as k, Tooltip as l, type DatePickerProps as m, type DateRangePickerProps as n, type ComboBoxProps as o, toast as t };
@@ -0,0 +1,9 @@
1
+ "use client";
2
+ "use client";
3
+ import {
4
+ VideoPlayer
5
+ } from "./chunk-J4D44TUA.mjs";
6
+ import "./chunk-RBDK7MWQ.mjs";
7
+ export {
8
+ VideoPlayer
9
+ };