@progress/kendo-themes-html 14.4.0-dev.2 → 14.4.0-dev.3
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/dist/cjs/agent-response/agent-step.js +1 -0
- package/dist/cjs/agent-response/chain-of-thought.spec.js +1 -0
- package/dist/cjs/agent-response/reasoning.spec.js +1 -0
- package/dist/cjs/agent-response/templates/chain-of-thought-expanded.js +1 -0
- package/dist/cjs/agent-response/templates/chain-of-thought-normal.js +1 -0
- package/dist/cjs/agent-response/templates/reasoning-expanded.js +1 -0
- package/dist/cjs/agent-response/templates/reasoning-normal.js +1 -0
- package/dist/cjs/agent-response/templates/tool-call-expanded.js +1 -0
- package/dist/cjs/agent-response/templates/tool-call-normal.js +1 -0
- package/dist/cjs/agent-response/thought.spec.js +1 -0
- package/dist/cjs/agent-response/tool-call.spec.js +1 -0
- package/dist/cjs/checkpoint/checkpoint.spec.js +1 -0
- package/dist/cjs/checkpoint/templates/checkpoint-normal.js +1 -0
- package/dist/cjs/citation/citation-popover.spec.js +1 -0
- package/dist/cjs/citation/citation.spec.js +1 -0
- package/dist/cjs/citation/templates/citation-normal.js +1 -0
- package/dist/cjs/citation/templates/citation-opened.js +1 -0
- package/dist/cjs/datetime-selector/datetime-selector.spec.js +1 -1
- package/dist/cjs/datetimepicker/datetimepicker.spec.js +1 -1
- package/dist/cjs/datetimepicker/demos/datetimepicker.js +1 -1
- package/dist/cjs/datetimepicker/templates/datetimepicker-adaptive.js +1 -1
- package/dist/cjs/datetimepicker/templates/datetimepicker-disabled.js +1 -1
- package/dist/cjs/datetimepicker/templates/datetimepicker-invalid.js +1 -1
- package/dist/cjs/datetimepicker/templates/datetimepicker-normal.js +1 -1
- package/dist/cjs/datetimepicker/templates/datetimepicker-popup.js +1 -1
- package/dist/cjs/gantt/demos/gantt.js +1 -1
- package/dist/cjs/gantt/templates/gantt-normal.js +1 -1
- package/dist/cjs/gantt/templates/gantt-row-reordering.js +1 -1
- package/dist/cjs/gantt/templates/gantt-with-tooltip.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-crop.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-normal.js +1 -1
- package/dist/cjs/imageeditor/templates/imageeditor-resize.js +1 -1
- package/dist/cjs/index.js +8 -8
- package/dist/cjs/popover/popover.spec.js +1 -1
- package/dist/cjs/scheduler/demos/scheduler.js +1 -1
- package/dist/cjs/scheduler/scheduler-toolbar.spec.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-agenda.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-day.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-flex-agenda.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-flex-day.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-flex-horizontal-grouping.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-flex-month.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-flex-timeline.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-flex-vertical-grouping.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-flex-week.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-flex-year.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-horizontal-grouping.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-month.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-timeline.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-vertical-grouping.js +1 -1
- package/dist/cjs/scheduler/templates/scheduler-week.js +1 -1
- package/dist/cjs/segmented-control/segmented-control-button.spec.js +1 -1
- package/dist/cjs/segmented-control/templates/segmented-control-disabled.js +1 -1
- package/dist/cjs/segmented-control/templates/segmented-control-icons.js +1 -1
- package/dist/cjs/segmented-control/templates/segmented-control-normal.js +1 -1
- package/dist/cjs/segmented-control/templates/segmented-control-stretched.js +1 -1
- package/dist/cjs/segmented-control/templates/segmented-control-text.js +1 -1
- package/dist/esm/agent-response/agent-step.mjs +1 -0
- package/dist/esm/agent-response/chain-of-thought.spec.mjs +1 -0
- package/dist/esm/agent-response/reasoning.spec.mjs +1 -0
- package/dist/esm/agent-response/templates/chain-of-thought-expanded.mjs +1 -0
- package/dist/esm/agent-response/templates/chain-of-thought-normal.mjs +1 -0
- package/dist/esm/agent-response/templates/reasoning-expanded.mjs +1 -0
- package/dist/esm/agent-response/templates/reasoning-normal.mjs +1 -0
- package/dist/esm/agent-response/templates/tool-call-expanded.mjs +1 -0
- package/dist/esm/agent-response/templates/tool-call-normal.mjs +1 -0
- package/dist/esm/agent-response/thought.spec.mjs +1 -0
- package/dist/esm/agent-response/tool-call.spec.mjs +1 -0
- package/dist/esm/checkpoint/checkpoint.spec.mjs +1 -0
- package/dist/esm/checkpoint/templates/checkpoint-normal.mjs +1 -0
- package/dist/esm/citation/citation-popover.spec.mjs +1 -0
- package/dist/esm/citation/citation.spec.mjs +1 -0
- package/dist/esm/citation/templates/citation-normal.mjs +1 -0
- package/dist/esm/citation/templates/citation-opened.mjs +1 -0
- package/dist/esm/datetime-selector/datetime-selector.spec.mjs +1 -1
- package/dist/esm/datetimepicker/datetimepicker.spec.mjs +1 -1
- package/dist/esm/datetimepicker/demos/datetimepicker.mjs +1 -1
- package/dist/esm/datetimepicker/templates/datetimepicker-adaptive.mjs +1 -1
- package/dist/esm/datetimepicker/templates/datetimepicker-disabled.mjs +1 -1
- package/dist/esm/datetimepicker/templates/datetimepicker-invalid.mjs +1 -1
- package/dist/esm/datetimepicker/templates/datetimepicker-normal.mjs +1 -1
- package/dist/esm/datetimepicker/templates/datetimepicker-popup.mjs +1 -1
- package/dist/esm/gantt/demos/gantt.mjs +1 -1
- package/dist/esm/gantt/templates/gantt-normal.mjs +1 -1
- package/dist/esm/gantt/templates/gantt-row-reordering.mjs +1 -1
- package/dist/esm/gantt/templates/gantt-with-tooltip.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-crop.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-normal.mjs +1 -1
- package/dist/esm/imageeditor/templates/imageeditor-resize.mjs +1 -1
- package/dist/esm/index.mjs +8 -8
- package/dist/esm/popover/demos/popover.mjs +1 -1
- package/dist/esm/popover/popover.spec.mjs +1 -1
- package/dist/esm/popover/templates/popover-normal.mjs +1 -1
- package/dist/esm/scheduler/demos/scheduler.mjs +1 -1
- package/dist/esm/scheduler/scheduler-toolbar.spec.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-agenda.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-day.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-flex-agenda.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-flex-day.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-flex-horizontal-grouping.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-flex-month.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-flex-timeline.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-flex-vertical-grouping.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-flex-week.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-flex-year.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-horizontal-grouping.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-month.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-timeline.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-vertical-grouping.mjs +1 -1
- package/dist/esm/scheduler/templates/scheduler-week.mjs +1 -1
- package/dist/esm/segmented-control/segmented-control-button.spec.mjs +1 -1
- package/dist/esm/segmented-control/templates/segmented-control-disabled.mjs +1 -1
- package/dist/esm/segmented-control/templates/segmented-control-icons.mjs +1 -1
- package/dist/esm/segmented-control/templates/segmented-control-normal.mjs +1 -1
- package/dist/esm/segmented-control/templates/segmented-control-stretched.mjs +1 -1
- package/dist/esm/segmented-control/templates/segmented-control-text.mjs +1 -1
- package/dist/types/agent-response/agent-step.d.ts +48 -0
- package/dist/types/agent-response/chain-of-thought.spec.d.ts +20 -0
- package/dist/types/agent-response/constants.d.ts +2 -0
- package/dist/types/agent-response/index.d.ts +10 -0
- package/dist/types/agent-response/reasoning.spec.d.ts +20 -0
- package/dist/types/agent-response/templates/chain-of-thought-expanded.d.ts +1 -0
- package/dist/types/agent-response/templates/chain-of-thought-normal.d.ts +1 -0
- package/dist/types/agent-response/templates/reasoning-expanded.d.ts +1 -0
- package/dist/types/agent-response/templates/reasoning-normal.d.ts +1 -0
- package/dist/types/agent-response/templates/tool-call-expanded.d.ts +1 -0
- package/dist/types/agent-response/templates/tool-call-normal.d.ts +1 -0
- package/dist/types/agent-response/thought.spec.d.ts +33 -0
- package/dist/types/agent-response/tool-call.spec.d.ts +21 -0
- package/dist/types/checkpoint/checkpoint.spec.d.ts +18 -0
- package/dist/types/checkpoint/constants.d.ts +2 -0
- package/dist/types/checkpoint/index.d.ts +2 -0
- package/dist/types/checkpoint/templates/checkpoint-normal.d.ts +1 -0
- package/dist/types/citation/citation-popover.spec.d.ts +22 -0
- package/dist/types/citation/citation.spec.d.ts +16 -0
- package/dist/types/citation/constants.d.ts +2 -0
- package/dist/types/citation/index.d.ts +4 -0
- package/dist/types/citation/templates/citation-normal.d.ts +1 -0
- package/dist/types/citation/templates/citation-opened.d.ts +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/popover/popover.spec.d.ts +2 -2
- package/dist/types/segmented-control/segmented-control-button.spec.d.ts +1 -0
- package/dist/types/segmented-control/segmented-control.spec.d.ts +5 -3
- package/package.json +1 -1
- package/src/agent-response/agent-step.tsx +113 -0
- package/src/agent-response/chain-of-thought.spec.tsx +45 -0
- package/src/agent-response/constants.ts +2 -0
- package/src/agent-response/index.ts +10 -0
- package/src/agent-response/reasoning.spec.tsx +46 -0
- package/src/agent-response/templates/chain-of-thought-expanded.tsx +9 -0
- package/src/agent-response/templates/chain-of-thought-normal.tsx +3 -0
- package/src/agent-response/templates/reasoning-expanded.tsx +7 -0
- package/src/agent-response/templates/reasoning-normal.tsx +3 -0
- package/src/agent-response/templates/tool-call-expanded.tsx +15 -0
- package/src/agent-response/templates/tool-call-normal.tsx +3 -0
- package/src/agent-response/tests/chain-of-thought.tsx +46 -0
- package/src/agent-response/tests/reasoning.tsx +21 -0
- package/src/agent-response/tests/tool-call.tsx +69 -0
- package/src/agent-response/thought.spec.tsx +96 -0
- package/src/agent-response/tool-call.spec.tsx +46 -0
- package/src/checkpoint/checkpoint.spec.tsx +52 -0
- package/src/checkpoint/constants.ts +2 -0
- package/src/checkpoint/index.ts +2 -0
- package/src/checkpoint/templates/checkpoint-normal.tsx +8 -0
- package/src/checkpoint/tests/checkpoint.tsx +42 -0
- package/src/citation/citation-popover.spec.tsx +71 -0
- package/src/citation/citation.spec.tsx +45 -0
- package/src/citation/constants.ts +2 -0
- package/src/citation/index.ts +4 -0
- package/src/citation/templates/citation-normal.tsx +3 -0
- package/src/citation/templates/citation-opened.tsx +20 -0
- package/src/citation/tests/citation.tsx +53 -0
- package/src/index.ts +3 -0
- package/src/popover/popover.spec.tsx +3 -3
- package/src/segmented-control/segmented-control-button.spec.tsx +2 -0
- package/src/segmented-control/segmented-control.spec.tsx +5 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Checkpoint } from "..";
|
|
2
|
+
import { Button } from "../../button";
|
|
3
|
+
import { Chat, ChatMessageGroup, ChatMessage } from "../../chat";
|
|
4
|
+
|
|
5
|
+
export default () => (
|
|
6
|
+
<div id="test-area" className="k-d-flex k-flex-col k-gap-6" style={{ maxWidth: "480px" }}>
|
|
7
|
+
<Checkpoint visible>
|
|
8
|
+
<Button text="Restore Checkpoint" fillMode="flat" size="xsmall" />
|
|
9
|
+
</Checkpoint>
|
|
10
|
+
|
|
11
|
+
<Checkpoint visible>
|
|
12
|
+
<span className="k-checkpoint-stamp">Checkpoint Restored</span>
|
|
13
|
+
<span>·</span>
|
|
14
|
+
<Button text="Redo" fillMode="flat" size="xsmall" />
|
|
15
|
+
</Checkpoint>
|
|
16
|
+
|
|
17
|
+
<Checkpoint visible>
|
|
18
|
+
<Button text="Restore Checkpoint" fillMode="flat" size="xsmall" />
|
|
19
|
+
<span>·</span>
|
|
20
|
+
<Button icon="arrows-swap" fillMode="flat" size="xsmall" aria-label="Swap direction" />
|
|
21
|
+
</Checkpoint>
|
|
22
|
+
|
|
23
|
+
<section>
|
|
24
|
+
<Chat>
|
|
25
|
+
<ChatMessageGroup avatar="" author="" fullWidth>
|
|
26
|
+
<ChatMessage text="Very long message text that tests message overflowing behavior. Very long message text that tests message overflowing behavior." />
|
|
27
|
+
</ChatMessageGroup>
|
|
28
|
+
<Checkpoint visible>
|
|
29
|
+
<span className="k-checkpoint-stamp">Restore Checkpoint</span>
|
|
30
|
+
<span>·</span>
|
|
31
|
+
<Button icon="arrow-rotate-ccw" fillMode="flat" size="xsmall" />
|
|
32
|
+
</Checkpoint>
|
|
33
|
+
<ChatMessageGroup avatar="" author="" type="sender">
|
|
34
|
+
<ChatMessage text="Lets create together" />
|
|
35
|
+
</ChatMessageGroup>
|
|
36
|
+
<ChatMessageGroup avatar="" author="" fullWidth>
|
|
37
|
+
<ChatMessage text="Very long message text that tests message overflowing behavior. Very long message text that tests message overflowing behavior." />
|
|
38
|
+
</ChatMessageGroup>
|
|
39
|
+
</Chat>
|
|
40
|
+
</section>
|
|
41
|
+
</div>
|
|
42
|
+
);
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { classNames } from "../misc";
|
|
3
|
+
import { IconButton } from "../button";
|
|
4
|
+
import { ButtonGroup } from "../button-group";
|
|
5
|
+
import { KendoComponent } from "../_types/component";
|
|
6
|
+
import { CITATION_FOLDER_NAME, CITATION_MODULE_NAME } from "./constants";
|
|
7
|
+
import { Popover } from "../popover";
|
|
8
|
+
|
|
9
|
+
export const CITATION_POPOVER_CLASSNAME = "k-citation-popover";
|
|
10
|
+
|
|
11
|
+
const states = [] as const;
|
|
12
|
+
const options = {};
|
|
13
|
+
|
|
14
|
+
export type KendoCitationPopoverProps = {
|
|
15
|
+
pageIndex?: number;
|
|
16
|
+
totalPages?: number;
|
|
17
|
+
body?: React.JSX.Element;
|
|
18
|
+
currentView?: number;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const defaultOptions = {
|
|
22
|
+
currentView: 1,
|
|
23
|
+
pageIndex: 1,
|
|
24
|
+
totalPages: 6,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @aria {aria-label} Accessible name applied to the Previous and Next pagination icon buttons.
|
|
29
|
+
* @ux {Paged navigation} Displays a "current/total" page indicator with Previous/Next buttons to move between citation pages.
|
|
30
|
+
* @ux {Sliding views} Slides between page views using the --kendo-citation-popover-view-current CSS variable instead of unmounting content.
|
|
31
|
+
*/
|
|
32
|
+
export const CitationPopover: KendoComponent<KendoCitationPopoverProps & React.HTMLAttributes<HTMLDivElement>> = (props: KendoCitationPopoverProps & React.HTMLAttributes<HTMLDivElement>) => {
|
|
33
|
+
const { body, currentView = defaultOptions.currentView, pageIndex = defaultOptions.pageIndex, totalPages = defaultOptions.totalPages, className, children, ...other } = props;
|
|
34
|
+
return (
|
|
35
|
+
<Popover
|
|
36
|
+
{...other}
|
|
37
|
+
className={classNames(className, CITATION_POPOVER_CLASSNAME)}
|
|
38
|
+
style={{ "--kendo-citation-popover-view-current": currentView } as React.CSSProperties}
|
|
39
|
+
title={
|
|
40
|
+
<>
|
|
41
|
+
<span className="k-citation-pages">
|
|
42
|
+
{pageIndex}/{totalPages}
|
|
43
|
+
</span>
|
|
44
|
+
<ButtonGroup fillMode="flat">
|
|
45
|
+
<IconButton icon="arrow-left" fillMode="flat" size="small" aria-label="Previous" />
|
|
46
|
+
<IconButton icon="arrow-right" fillMode="flat" size="small" aria-label="Next" />
|
|
47
|
+
</ButtonGroup>
|
|
48
|
+
</>
|
|
49
|
+
}
|
|
50
|
+
body={body}
|
|
51
|
+
>
|
|
52
|
+
{children}
|
|
53
|
+
</Popover>
|
|
54
|
+
);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
CitationPopover.states = states;
|
|
58
|
+
CitationPopover.options = options;
|
|
59
|
+
CitationPopover.className = CITATION_POPOVER_CLASSNAME;
|
|
60
|
+
CitationPopover.defaultOptions = defaultOptions;
|
|
61
|
+
CitationPopover.moduleName = CITATION_MODULE_NAME;
|
|
62
|
+
CitationPopover.folderName = CITATION_FOLDER_NAME;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @keyboard {Enter or Space} Triggers the focused Previous/Next icon button.
|
|
66
|
+
* @keyboard {Escape} Dismisses the popover (inherited from Popover).
|
|
67
|
+
*
|
|
68
|
+
* @see https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/ WAI-ARIA Authoring Practices: Dialog (Modal) Pattern
|
|
69
|
+
*/
|
|
70
|
+
|
|
71
|
+
export default CitationPopover;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { classNames } from "../misc";
|
|
3
|
+
import { Chip, KendoChipProps, KendoChipState } from "../chip";
|
|
4
|
+
import { KendoComponent } from "../_types/component";
|
|
5
|
+
import { CITATION_FOLDER_NAME, CITATION_MODULE_NAME } from "./constants";
|
|
6
|
+
|
|
7
|
+
export const CITATION_CLASSNAME = "k-citation";
|
|
8
|
+
|
|
9
|
+
const states = [] as const;
|
|
10
|
+
const options = {};
|
|
11
|
+
|
|
12
|
+
export type KendoCitationProps = {
|
|
13
|
+
/** Source domain/name shown as the chip label, e.g. "some-link.com" */
|
|
14
|
+
domain?: string;
|
|
15
|
+
/** Number of additional sources not shown individually, renders as a "+N" suffix */
|
|
16
|
+
count?: number;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
const defaultOptions = {
|
|
20
|
+
icon: "globe",
|
|
21
|
+
size: "small",
|
|
22
|
+
fillMode: "outline",
|
|
23
|
+
rounded: "full",
|
|
24
|
+
} as const;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @ux {Inline citation} Displays a source domain as a small, pill-shaped chip inline within AI-generated content.
|
|
28
|
+
* @ux {Additional sources} An optional count renders as a "+N" suffix indicating further uncited sources.
|
|
29
|
+
*/
|
|
30
|
+
export const Citation: KendoComponent<KendoCitationProps & KendoChipProps & KendoChipState & React.HTMLAttributes<HTMLDivElement>> = (props: KendoCitationProps & KendoChipProps & KendoChipState & React.HTMLAttributes<HTMLDivElement>) => {
|
|
31
|
+
const { domain, count, text, icon = defaultOptions.icon, size = defaultOptions.size, fillMode = defaultOptions.fillMode, rounded = defaultOptions.rounded, className, ...other } = props;
|
|
32
|
+
|
|
33
|
+
const label = text ?? [domain, count ? `+${count}` : undefined].filter(Boolean).join(" ");
|
|
34
|
+
|
|
35
|
+
return <Chip {...other} text={label} icon={icon} size={size} fillMode={fillMode} rounded={rounded} className={classNames(className, CITATION_CLASSNAME)} />;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
Citation.states = states;
|
|
39
|
+
Citation.options = options;
|
|
40
|
+
Citation.className = CITATION_CLASSNAME;
|
|
41
|
+
Citation.defaultOptions = defaultOptions;
|
|
42
|
+
Citation.moduleName = CITATION_MODULE_NAME;
|
|
43
|
+
Citation.folderName = CITATION_FOLDER_NAME;
|
|
44
|
+
|
|
45
|
+
export default Citation;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Citation from "../citation.spec";
|
|
2
|
+
import CitationPopover from "../citation-popover.spec";
|
|
3
|
+
|
|
4
|
+
export const CitationOpened = (props: any) => (
|
|
5
|
+
<>
|
|
6
|
+
<Citation domain="some-link.com" count={5} selected {...props} />
|
|
7
|
+
<CitationPopover
|
|
8
|
+
body={
|
|
9
|
+
<>
|
|
10
|
+
<div className="k-citation-popover-view">
|
|
11
|
+
<div>View 1</div>
|
|
12
|
+
</div>
|
|
13
|
+
<div className="k-citation-popover-view">
|
|
14
|
+
<div>View 2</div>
|
|
15
|
+
</div>
|
|
16
|
+
</>
|
|
17
|
+
}
|
|
18
|
+
/>
|
|
19
|
+
</>
|
|
20
|
+
);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Citation } from "../citation.spec";
|
|
2
|
+
import CitationPopover from "../citation-popover.spec";
|
|
3
|
+
import Icon from "../../icon/icon.spec";
|
|
4
|
+
|
|
5
|
+
const styles = `
|
|
6
|
+
.k-animation-container {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
export default () => (
|
|
12
|
+
<>
|
|
13
|
+
<style>{styles}</style>
|
|
14
|
+
<div id="test-area" className="k-d-flex k-flex-col k-gap-8" style={{ maxWidth: "680px" }}>
|
|
15
|
+
<section>
|
|
16
|
+
<p>Inline Citation</p>
|
|
17
|
+
<div className="k-d-flex k-flex-wrap k-gap-2 k-align-items-center">
|
|
18
|
+
<Citation domain="some-link.com" count={5} />
|
|
19
|
+
<Citation domain="some-link.com" count={5} selected />
|
|
20
|
+
</div>
|
|
21
|
+
</section>
|
|
22
|
+
|
|
23
|
+
<section>
|
|
24
|
+
<p>Inline Citation + Popover</p>
|
|
25
|
+
<p>
|
|
26
|
+
An inline citation component is an interactive UI element that embeds clickable reference badges, like [1] or source names, directly into text. <Citation domain="some-link.com" count={5} selected /> When users hover over or click these badges, the component displays full source details, such as titles, domains, URLs.
|
|
27
|
+
</p>
|
|
28
|
+
<CitationPopover
|
|
29
|
+
body={
|
|
30
|
+
<>
|
|
31
|
+
<div className="k-citation-popover-view">
|
|
32
|
+
<div className="k-font-weight-bold">Advances in Natural Language Processing</div>
|
|
33
|
+
<span className="k-color-subtle k-font-size-sm k-mt-2">A comprehensive study on the recent developments in natural language processing technologies and their...</span>
|
|
34
|
+
<a href="#" className="k-d-flex k-align-items-center k-font-size-sm k-mt-1 k-gap-1">
|
|
35
|
+
<Icon icon="globe" />
|
|
36
|
+
https://example.com/nlp-advances
|
|
37
|
+
</a>
|
|
38
|
+
</div>
|
|
39
|
+
<div className="k-citation-popover-view">
|
|
40
|
+
<div className="k-font-weight-bold">Advances in Natural Language Processing</div>
|
|
41
|
+
<span className="k-color-subtle k-font-size-sm k-mt-2">A comprehensive study on the recent developments in natural language processing technologies and their...</span>
|
|
42
|
+
<a href="#" className="k-d-flex k-align-items-center k-font-size-sm k-mt-1 k-gap-1">
|
|
43
|
+
<Icon icon="globe" />
|
|
44
|
+
https://example.com/nlp-advances
|
|
45
|
+
</a>
|
|
46
|
+
</div>
|
|
47
|
+
</>
|
|
48
|
+
}
|
|
49
|
+
/>
|
|
50
|
+
</section>
|
|
51
|
+
</div>
|
|
52
|
+
</>
|
|
53
|
+
);
|
package/src/index.ts
CHANGED
|
@@ -122,6 +122,9 @@ export * from './context-menu/index';
|
|
|
122
122
|
|
|
123
123
|
// Misc
|
|
124
124
|
// export * from './adaptive/index''
|
|
125
|
+
export * from './agent-response/index';
|
|
126
|
+
export * from './citation/index';
|
|
127
|
+
export * from './checkpoint/index';
|
|
125
128
|
export * from './chat/index';
|
|
126
129
|
export * from './mediaplayer/index';
|
|
127
130
|
export * from './timeline/index';
|
|
@@ -13,7 +13,7 @@ const defaultOptions = {};
|
|
|
13
13
|
|
|
14
14
|
export type KendoPopoverProps = {
|
|
15
15
|
callout?: null | 'top' | 'bottom' | 'left' | 'right';
|
|
16
|
-
title?:
|
|
16
|
+
title?: React.ReactNode;
|
|
17
17
|
body?: React.JSX.Element | React.JSX.Element[];
|
|
18
18
|
id?: string;
|
|
19
19
|
};
|
|
@@ -28,9 +28,9 @@ export type KendoPopoverProps = {
|
|
|
28
28
|
* @ux {Dismiss} Closes when clicking outside the popover or pressing Escape.
|
|
29
29
|
* @ux {Arrow} An optional pointer arrow visually connects the popover to its trigger.
|
|
30
30
|
*/
|
|
31
|
-
export const Popover: KendoComponent<KendoPopoverProps & React.HTMLAttributes<HTMLDivElement>> = (
|
|
31
|
+
export const Popover: KendoComponent<KendoPopoverProps & Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>> = (
|
|
32
32
|
props: KendoPopoverProps &
|
|
33
|
-
React.HTMLAttributes<HTMLDivElement>
|
|
33
|
+
Omit<React.HTMLAttributes<HTMLDivElement>, 'title'>
|
|
34
34
|
) => {
|
|
35
35
|
const {
|
|
36
36
|
callout,
|
|
@@ -31,6 +31,7 @@ const defaultOptions = {};
|
|
|
31
31
|
* @aria {role="button"} Each button must have the appropriate button role.
|
|
32
32
|
* @aria {aria-pressed="true"} Only the selected button within the group will have this attribute set to true.
|
|
33
33
|
* @aria {aria-disabled="true"} Indicates that the button is disabled and cannot be interacted with.
|
|
34
|
+
* @aria {tabindex} Roving tabindex: the selected button has tabindex="0"; all others have tabindex="-1".
|
|
34
35
|
* @ux {Selection} Clicking this button selects it and automatically deselects the others.
|
|
35
36
|
* @ux {Disabled state} When disabled, this segment cannot be activated.
|
|
36
37
|
*/
|
|
@@ -65,6 +66,7 @@ export const SegmentedControlButton: KendoComponent<KendoSegmentedControlButtonP
|
|
|
65
66
|
)}
|
|
66
67
|
aria-pressed={selected ? 'true' : 'false'}
|
|
67
68
|
aria-disabled={disabled ? 'true' : undefined}
|
|
69
|
+
tabIndex={selected ? 0 : -1}
|
|
68
70
|
>
|
|
69
71
|
{icon && (
|
|
70
72
|
<Icon
|
|
@@ -71,9 +71,11 @@ SegmentedControl.moduleName = SEGMENTED_CONTROL_MODULE_NAME;
|
|
|
71
71
|
SegmentedControl.folderName = SEGMENTED_CONTROL_FOLDER_NAME;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
|
-
* @keyboard {Tab}
|
|
75
|
-
* @keyboard {Shift + Tab}
|
|
76
|
-
* @keyboard {
|
|
74
|
+
* @keyboard {Tab} Moves focus into the Segmented Control to the selected button. Pressing Tab again moves focus out of the control to the next focusable element on the page.
|
|
75
|
+
* @keyboard {Shift + Tab} Moves focus out of the Segmented Control to the previous focusable element on the page.
|
|
76
|
+
* @keyboard {ArrowLeft} Moves focus to the previous button.
|
|
77
|
+
* @keyboard {ArrowRight} Moves focus to the next button.
|
|
78
|
+
* @keyboard {Enter or Space} Selects the focused button.
|
|
77
79
|
*
|
|
78
80
|
* @see https://www.w3.org/TR/wai-aria-1.2/#button WAI-ARIA `button` Role Specification
|
|
79
81
|
* @see https://www.w3.org/TR/wai-aria-1.2/#group WAI-ARIA `group` Role Specification
|