@comitor/ui 1.11.0 → 2.1.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/LICENSE +35 -0
- package/README.md +23 -7
- package/dist/components/ui/action-bar-constants.d.ts +31 -0
- package/dist/components/ui/action-bar-constants.js +9 -0
- package/dist/components/ui/action-bar-constants.js.map +1 -0
- package/dist/components/ui/action-bar.d.ts +67 -0
- package/dist/components/ui/action-bar.js +522 -0
- package/dist/components/ui/action-bar.js.map +1 -0
- package/dist/components/ui/badge-overflow.d.ts +30 -0
- package/dist/components/ui/badge-overflow.js +179 -0
- package/dist/components/ui/badge-overflow.js.map +1 -0
- package/dist/components/ui/banner.d.ts +79 -0
- package/dist/components/ui/banner.js +518 -0
- package/dist/components/ui/banner.js.map +1 -0
- package/dist/components/ui/circular-progress.d.ts +50 -0
- package/dist/components/ui/circular-progress.js +266 -0
- package/dist/components/ui/circular-progress.js.map +1 -0
- package/dist/components/ui/cropper-constants.d.ts +34 -0
- package/dist/components/ui/cropper-constants.js +10 -0
- package/dist/components/ui/cropper-constants.js.map +1 -0
- package/dist/components/ui/cropper.d.ts +106 -0
- package/dist/components/ui/cropper.js +1269 -0
- package/dist/components/ui/cropper.js.map +1 -0
- package/dist/components/ui/drawer.d.ts +1 -1
- package/dist/components/ui/drawer.js +2 -2
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/kanban-constants.d.ts +61 -0
- package/dist/components/ui/kanban-constants.js +21 -0
- package/dist/components/ui/kanban-constants.js.map +1 -0
- package/dist/components/ui/kanban.d.ts +72 -0
- package/dist/components/ui/kanban.js +787 -0
- package/dist/components/ui/kanban.js.map +1 -0
- package/dist/components/ui/key-value-constants.d.ts +33 -0
- package/dist/components/ui/key-value-constants.js +11 -0
- package/dist/components/ui/key-value-constants.js.map +1 -0
- package/dist/components/ui/key-value.d.ts +96 -0
- package/dist/components/ui/key-value.js +641 -0
- package/dist/components/ui/key-value.js.map +1 -0
- package/dist/components/ui/mask-input-constants.d.ts +99 -0
- package/dist/components/ui/mask-input-constants.js +601 -0
- package/dist/components/ui/mask-input-constants.js.map +1 -0
- package/dist/components/ui/mask-input.d.ts +36 -0
- package/dist/components/ui/mask-input.js +558 -0
- package/dist/components/ui/mask-input.js.map +1 -0
- package/dist/components/ui/mention.d.ts +31 -0
- package/dist/components/ui/mention.js +128 -0
- package/dist/components/ui/mention.js.map +1 -0
- package/dist/components/ui/phone-input-constants.d.ts +54 -0
- package/dist/components/ui/phone-input-constants.js +9 -0
- package/dist/components/ui/phone-input-constants.js.map +1 -0
- package/dist/components/ui/phone-input.d.ts +85 -0
- package/dist/components/ui/phone-input.js +743 -0
- package/dist/components/ui/phone-input.js.map +1 -0
- package/dist/components/ui/rating.d.ts +56 -0
- package/dist/components/ui/rating.js +646 -0
- package/dist/components/ui/rating.js.map +1 -0
- package/dist/components/ui/responsive-dialog.d.ts +35 -0
- package/dist/components/ui/responsive-dialog.js +193 -0
- package/dist/components/ui/responsive-dialog.js.map +1 -0
- package/dist/components/ui/scroll-spy.d.ts +42 -0
- package/dist/components/ui/scroll-spy.js +334 -0
- package/dist/components/ui/scroll-spy.js.map +1 -0
- package/dist/components/ui/stepper-constants.d.ts +29 -0
- package/dist/components/ui/stepper-constants.js +9 -0
- package/dist/components/ui/stepper-constants.js.map +1 -0
- package/dist/components/ui/stepper.d.ts +80 -0
- package/dist/components/ui/stepper.js +902 -0
- package/dist/components/ui/stepper.js.map +1 -0
- package/dist/components/ui/tags-input.d.ts +41 -0
- package/dist/components/ui/tags-input.js +127 -0
- package/dist/components/ui/tags-input.js.map +1 -0
- package/dist/components/ui/time-picker-constants.d.ts +48 -0
- package/dist/components/ui/time-picker-constants.js +14 -0
- package/dist/components/ui/time-picker-constants.js.map +1 -0
- package/dist/components/ui/time-picker.d.ts +115 -0
- package/dist/components/ui/time-picker.js +1620 -0
- package/dist/components/ui/time-picker.js.map +1 -0
- package/dist/components/ui/timeline.d.ts +32 -0
- package/dist/components/ui/timeline.js +559 -0
- package/dist/components/ui/timeline.js.map +1 -0
- package/dist/components/ui/tour-constants.d.ts +39 -0
- package/dist/components/ui/tour-constants.js +12 -0
- package/dist/components/ui/tour-constants.js.map +1 -0
- package/dist/components/ui/tour.d.ts +124 -0
- package/dist/components/ui/tour.js +1207 -0
- package/dist/components/ui/tour.js.map +1 -0
- package/dist/data-grid/data-grid-cell-variants.js +10 -6
- package/dist/data-grid/data-grid-cell-variants.js.map +1 -1
- package/dist/data-grid/data-grid-cell-wrapper.js +1 -1
- package/dist/data-grid/data-grid-cell-wrapper.js.map +1 -1
- package/dist/data-grid/data-grid-column-header.js +4 -2
- package/dist/data-grid/data-grid-column-header.js.map +1 -1
- package/dist/data-grid/data-grid-context-menu.js +5 -4
- package/dist/data-grid/data-grid-context-menu.js.map +1 -1
- package/dist/data-grid/data-grid-filter-menu.d.ts +12 -1
- package/dist/data-grid/data-grid-filter-menu.js +28 -17
- package/dist/data-grid/data-grid-filter-menu.js.map +1 -1
- package/dist/data-grid/data-grid-keyboard-shortcuts.d.ts +12 -1
- package/dist/data-grid/data-grid-keyboard-shortcuts.js +7 -5
- package/dist/data-grid/data-grid-keyboard-shortcuts.js.map +1 -1
- package/dist/data-grid/data-grid-locale.d.ts +24 -0
- package/dist/data-grid/data-grid-locale.js +25 -0
- package/dist/data-grid/data-grid-locale.js.map +1 -0
- package/dist/data-grid/data-grid-paste-dialog.js +3 -2
- package/dist/data-grid/data-grid-paste-dialog.js.map +1 -1
- package/dist/data-grid/data-grid-row-height-menu.d.ts +11 -1
- package/dist/data-grid/data-grid-row-height-menu.js +25 -28
- package/dist/data-grid/data-grid-row-height-menu.js.map +1 -1
- package/dist/data-grid/data-grid-row.js +1 -1
- package/dist/data-grid/data-grid-row.js.map +1 -1
- package/dist/data-grid/data-grid-search.js +6 -5
- package/dist/data-grid/data-grid-search.js.map +1 -1
- package/dist/data-grid/data-grid-select-column.js +3 -1
- package/dist/data-grid/data-grid-select-column.js.map +1 -1
- package/dist/data-grid/data-grid-sort-menu.d.ts +12 -1
- package/dist/data-grid/data-grid-sort-menu.js +25 -13
- package/dist/data-grid/data-grid-sort-menu.js.map +1 -1
- package/dist/data-grid/data-grid-view-menu.d.ts +12 -1
- package/dist/data-grid/data-grid-view-menu.js +12 -4
- package/dist/data-grid/data-grid-view-menu.js.map +1 -1
- package/dist/data-grid/data-grid.d.ts +14 -2
- package/dist/data-grid/data-grid.js +7 -4
- package/dist/data-grid/data-grid.js.map +1 -1
- package/dist/data-grid/filters.d.ts +17 -21
- package/dist/data-grid/filters.js +73 -52
- package/dist/data-grid/filters.js.map +1 -1
- package/dist/data-grid/index.d.ts +4 -1
- package/dist/data-grid/index.js +20 -2
- package/dist/data-grid/index.js.map +1 -1
- package/dist/data-grid/messages-en.d.ts +294 -0
- package/dist/data-grid/messages-en.js +279 -0
- package/dist/data-grid/messages-en.js.map +1 -0
- package/dist/data-grid/messages-vi.d.ts +12 -0
- package/dist/data-grid/messages-vi.js +279 -0
- package/dist/data-grid/messages-vi.js.map +1 -0
- package/dist/data-grid/messages.d.ts +549 -262
- package/dist/data-grid/messages.js +16 -275
- package/dist/data-grid/messages.js.map +1 -1
- package/dist/data-grid/sortable.js +1 -1
- package/dist/data-grid/sortable.js.map +1 -1
- package/dist/data-grid/use-data-grid-undo-redo.d.ts +13 -1
- package/dist/data-grid/use-data-grid-undo-redo.js +13 -10
- package/dist/data-grid/use-data-grid-undo-redo.js.map +1 -1
- package/dist/data-grid/use-data-grid.d.ts +281 -1
- package/dist/data-grid/use-data-grid.js +24 -19
- package/dist/data-grid/use-data-grid.js.map +1 -1
- package/dist/data-grid/utils.d.ts +9 -1
- package/dist/data-grid/utils.js +3 -2
- package/dist/data-grid/utils.js.map +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/compose-refs.js.map +1 -0
- package/dist/lib/use-as-ref.js.map +1 -0
- package/dist/lib/use-is-mobile.d.ts +10 -0
- package/dist/lib/use-is-mobile.js +21 -0
- package/dist/lib/use-is-mobile.js.map +1 -0
- package/dist/lib/use-isomorphic-layout-effect.js.map +1 -0
- package/dist/lib/use-lazy-ref.js.map +1 -0
- package/dist/lib/visually-hidden-input.d.ts +12 -0
- package/dist/lib/visually-hidden-input.js +105 -0
- package/dist/lib/visually-hidden-input.js.map +1 -0
- package/package.json +5 -1
- package/styles.css +19 -0
- package/dist/data-grid/compose-refs.js.map +0 -1
- package/dist/data-grid/use-as-ref.js.map +0 -1
- package/dist/data-grid/use-isomorphic-layout-effect.js.map +0 -1
- package/dist/data-grid/use-lazy-ref.js.map +0 -1
- /package/dist/{data-grid → lib}/compose-refs.d.ts +0 -0
- /package/dist/{data-grid → lib}/compose-refs.js +0 -0
- /package/dist/{data-grid → lib}/use-as-ref.d.ts +0 -0
- /package/dist/{data-grid → lib}/use-as-ref.js +0 -0
- /package/dist/{data-grid → lib}/use-isomorphic-layout-effect.d.ts +0 -0
- /package/dist/{data-grid → lib}/use-isomorphic-layout-effect.js +0 -0
- /package/dist/{data-grid → lib}/use-lazy-ref.d.ts +0 -0
- /package/dist/{data-grid → lib}/use-lazy-ref.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ui/tour-constants.ts"],"sourcesContent":["/**\n * Nhãn mặc định của `Tour`.\n *\n * Module **CỐ Ý không có `\"use client\"`**: mọi export của một file `\"use client\"` tới Server\n * Component là client-reference proxy, đọc ra `undefined` mà KHÔNG throw — xem\n * `src/chart/chart-colors.ts`. Barrel xuất module này TRỰC TIẾP; `tour.tsx` chỉ `import`.\n */\n\n/**\n * Chuỗi hiển thị và chuỗi a11y của `Tour` — truyền `labels` cho `Tour` để ghi đè từng khoá.\n *\n * ⚠ Thượng nguồn (Dice UI) chôn cứng chuỗi tiếng Anh trong từng nút (\"Previous\", \"Next\",\n * \"Finish\", \"Skip\", \"Close tour\") và bộ đếm `1 / 5`. Gói dùng chung cho MỌI app Comitor nên\n * chuỗi cứng là ngõ cụt cho app đa ngôn ngữ.\n *\n * Từng chỗ vẫn ghi đè riêng được: `children` của `TourPrev`/`TourNext`/`TourSkip`/`TourClose`,\n * `aria-label` của `TourClose`, `format` của `TourStepCounter`. `labels` là để đổi NGÔN NGỮ một\n * lần cho cả tour.\n */\nexport interface TourLabels {\n /** `aria-label` của `TourClose` — nút chỉ có icon X, nên đây là tên DUY NHẤT của nó. */\n close: string;\n /** Chữ mặc định của `TourPrev` khi không có `children`. */\n prev: string;\n /** Chữ mặc định của `TourNext` ở mọi bước trừ bước cuối. */\n next: string;\n /** Chữ mặc định của `TourNext` ở bước CUỐI — bấm là kết thúc tour. */\n finish: string;\n /** Chữ mặc định của `TourSkip` khi không có `children`. */\n skip: string;\n /**\n * Nội dung mặc định của `TourStepCounter`. `current` đếm từ 1.\n * Là HÀM vì có số chèn vào giữa câu.\n */\n stepCounter: (current: number, total: number) => string;\n}\n\n/** Nhãn tiếng Việt mặc định — mọi khoá đều ghi đè được qua prop `labels` của `Tour`. */\nexport const DEFAULT_TOUR_LABELS: TourLabels = {\n close: \"Đóng hướng dẫn\",\n prev: \"Quay lại\",\n next: \"Tiếp theo\",\n finish: \"Hoàn tất\",\n skip: \"Bỏ qua\",\n stepCounter: (current, total) => `Bước ${current}/${total}`\n};\n"],"mappings":"AAsCO,MAAM,sBAAkC;AAAA,EAC7C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,aAAa,CAAC,SAAS,UAAU,kBAAQ,OAAO,IAAI,KAAK;AAC3D;","names":[]}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { Button } from './button.js';
|
|
3
|
+
import { TourLabels } from './tour-constants.js';
|
|
4
|
+
import 'class-variance-authority/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
declare const SIDE_OPTIONS: readonly ["top", "right", "bottom", "left"];
|
|
8
|
+
declare const ALIGN_OPTIONS: readonly ["start", "center", "end"];
|
|
9
|
+
type Side = (typeof SIDE_OPTIONS)[number];
|
|
10
|
+
type Align = (typeof ALIGN_OPTIONS)[number];
|
|
11
|
+
type Direction = "ltr" | "rtl";
|
|
12
|
+
interface ScrollOffset {
|
|
13
|
+
top?: number;
|
|
14
|
+
bottom?: number;
|
|
15
|
+
left?: number;
|
|
16
|
+
right?: number;
|
|
17
|
+
}
|
|
18
|
+
type Boundary = Element | null;
|
|
19
|
+
type StepTarget = string | React.RefObject<HTMLElement | null> | HTMLElement;
|
|
20
|
+
interface DivProps extends React.ComponentProps<"div"> {
|
|
21
|
+
asChild?: boolean;
|
|
22
|
+
}
|
|
23
|
+
type PointerDownOutsideEvent = CustomEvent<{
|
|
24
|
+
originalEvent: PointerEvent;
|
|
25
|
+
}>;
|
|
26
|
+
type InteractOutsideEvent = CustomEvent<{
|
|
27
|
+
originalEvent: PointerEvent | FocusEvent;
|
|
28
|
+
}>;
|
|
29
|
+
type OpenAutoFocusEvent = CustomEvent<Record<string, never>>;
|
|
30
|
+
type CloseAutoFocusEvent = CustomEvent<Record<string, never>>;
|
|
31
|
+
interface TourProps extends DivProps {
|
|
32
|
+
open?: boolean;
|
|
33
|
+
defaultOpen?: boolean;
|
|
34
|
+
onOpenChange?: (open: boolean) => void;
|
|
35
|
+
value?: number;
|
|
36
|
+
defaultValue?: number;
|
|
37
|
+
onValueChange?: (step: number) => void;
|
|
38
|
+
onComplete?: () => void;
|
|
39
|
+
onSkip?: () => void;
|
|
40
|
+
onEscapeKeyDown?: (event: KeyboardEvent) => void;
|
|
41
|
+
onPointerDownOutside?: (event: PointerDownOutsideEvent) => void;
|
|
42
|
+
onInteractOutside?: (event: InteractOutsideEvent) => void;
|
|
43
|
+
onOpenAutoFocus?: (event: OpenAutoFocusEvent) => void;
|
|
44
|
+
onCloseAutoFocus?: (event: CloseAutoFocusEvent) => void;
|
|
45
|
+
dir?: Direction;
|
|
46
|
+
alignOffset?: number;
|
|
47
|
+
sideOffset?: number;
|
|
48
|
+
spotlightPadding?: number;
|
|
49
|
+
autoScroll?: boolean;
|
|
50
|
+
/** Mặc định `"smooth"`, hoặc `"auto"` khi người dùng bật `prefers-reduced-motion`. */
|
|
51
|
+
scrollBehavior?: ScrollBehavior;
|
|
52
|
+
scrollOffset?: ScrollOffset;
|
|
53
|
+
dismissible?: boolean;
|
|
54
|
+
modal?: boolean;
|
|
55
|
+
stepFooter?: React.ReactElement;
|
|
56
|
+
/**
|
|
57
|
+
* Ghi đè chuỗi hiển thị/a11y (mặc định tiếng Việt) — xem `TourLabels`.
|
|
58
|
+
* ⚠ Thêm so với thượng nguồn: bản gốc chôn cứng chuỗi tiếng Anh trong từng nút.
|
|
59
|
+
*/
|
|
60
|
+
labels?: Partial<TourLabels>;
|
|
61
|
+
}
|
|
62
|
+
declare function Tour(props: TourProps): React.JSX.Element;
|
|
63
|
+
interface TourStepProps extends DivProps {
|
|
64
|
+
target: StepTarget;
|
|
65
|
+
side?: Side;
|
|
66
|
+
sideOffset?: number;
|
|
67
|
+
align?: Align;
|
|
68
|
+
alignOffset?: number;
|
|
69
|
+
collisionBoundary?: Boundary | Boundary[];
|
|
70
|
+
collisionPadding?: number | Partial<Record<Side, number>>;
|
|
71
|
+
arrowPadding?: number;
|
|
72
|
+
sticky?: "partial" | "always";
|
|
73
|
+
hideWhenDetached?: boolean;
|
|
74
|
+
avoidCollisions?: boolean;
|
|
75
|
+
required?: boolean;
|
|
76
|
+
forceMount?: boolean;
|
|
77
|
+
onStepEnter?: () => void;
|
|
78
|
+
onStepLeave?: () => void;
|
|
79
|
+
}
|
|
80
|
+
declare function TourStep(props: TourStepProps): React.JSX.Element | null;
|
|
81
|
+
interface TourSpotlightProps extends DivProps {
|
|
82
|
+
forceMount?: boolean;
|
|
83
|
+
}
|
|
84
|
+
declare function TourSpotlight(props: TourSpotlightProps): React.JSX.Element | null;
|
|
85
|
+
interface TourSpotlightRingProps extends DivProps {
|
|
86
|
+
forceMount?: boolean;
|
|
87
|
+
}
|
|
88
|
+
declare function TourSpotlightRing(props: TourSpotlightRingProps): React.JSX.Element | null;
|
|
89
|
+
interface TourPortalProps {
|
|
90
|
+
children?: React.ReactNode;
|
|
91
|
+
container?: HTMLElement | null;
|
|
92
|
+
}
|
|
93
|
+
declare function TourPortal(props: TourPortalProps): React.ReactPortal | null;
|
|
94
|
+
interface TourArrowProps extends React.ComponentProps<"svg"> {
|
|
95
|
+
width?: number;
|
|
96
|
+
height?: number;
|
|
97
|
+
asChild?: boolean;
|
|
98
|
+
}
|
|
99
|
+
declare function TourArrow(props: TourArrowProps): React.JSX.Element;
|
|
100
|
+
type TourHeaderProps = DivProps;
|
|
101
|
+
declare function TourHeader(props: TourHeaderProps): React.JSX.Element;
|
|
102
|
+
type TourTitleProps = DivProps;
|
|
103
|
+
declare function TourTitle(props: TourTitleProps): React.JSX.Element;
|
|
104
|
+
type TourDescriptionProps = DivProps;
|
|
105
|
+
declare function TourDescription(props: TourDescriptionProps): React.JSX.Element;
|
|
106
|
+
interface TourCloseProps extends React.ComponentProps<"button"> {
|
|
107
|
+
asChild?: boolean;
|
|
108
|
+
}
|
|
109
|
+
declare function TourClose(props: TourCloseProps): React.JSX.Element;
|
|
110
|
+
type TourPrevProps = React.ComponentProps<typeof Button>;
|
|
111
|
+
declare function TourPrev(props: TourPrevProps): React.JSX.Element;
|
|
112
|
+
type TourNextProps = React.ComponentProps<typeof Button>;
|
|
113
|
+
declare function TourNext(props: TourNextProps): React.JSX.Element;
|
|
114
|
+
type TourSkipProps = React.ComponentProps<typeof Button>;
|
|
115
|
+
declare function TourSkip(props: TourSkipProps): React.JSX.Element;
|
|
116
|
+
interface TourStepCounterProps extends DivProps {
|
|
117
|
+
/** Mặc định `labels.stepCounter` của `Tour` — `Bước 2/5`. */
|
|
118
|
+
format?: (current: number, total: number) => string;
|
|
119
|
+
}
|
|
120
|
+
declare function TourStepCounter(props: TourStepCounterProps): React.JSX.Element;
|
|
121
|
+
type TourFooterProps = DivProps;
|
|
122
|
+
declare function TourFooter(props: TourFooterProps): React.JSX.Element;
|
|
123
|
+
|
|
124
|
+
export { Tour, TourArrow, type TourArrowProps, TourClose, type TourCloseProps, TourDescription, type TourDescriptionProps, TourFooter, type TourFooterProps, TourHeader, type TourHeaderProps, TourNext, type TourNextProps, TourPortal, type TourPortalProps, TourPrev, type TourPrevProps, type TourProps, TourSkip, type TourSkipProps, TourSpotlight, type TourSpotlightProps, TourSpotlightRing, type TourSpotlightRingProps, TourStep, TourStepCounter, type TourStepCounterProps, type TourStepProps, TourTitle, type TourTitleProps };
|