@kitnai/chat 0.8.0 → 0.8.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kitnai/chat",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Framework-agnostic, Shadow-DOM web components for building AI chat interfaces — works in React, Vue, Angular, Svelte, or plain HTML. Authored in SolidJS.",
|
|
6
6
|
"keywords": [
|
|
@@ -50,6 +50,8 @@ export function CheckpointIcon(props: CheckpointIconProps) {
|
|
|
50
50
|
|
|
51
51
|
export interface CheckpointTriggerProps {
|
|
52
52
|
tooltip?: string;
|
|
53
|
+
/** Accessible name for the button — required when it has no visible text (icon-only). */
|
|
54
|
+
'aria-label'?: string;
|
|
53
55
|
onClick?: () => void;
|
|
54
56
|
children?: JSX.Element;
|
|
55
57
|
class?: string;
|
|
@@ -70,6 +72,7 @@ export function CheckpointTrigger(props: CheckpointTriggerProps) {
|
|
|
70
72
|
variant={variant()}
|
|
71
73
|
size={size()}
|
|
72
74
|
type="button"
|
|
75
|
+
aria-label={props['aria-label']}
|
|
73
76
|
onClick={props.onClick}
|
|
74
77
|
class={props.class}
|
|
75
78
|
>
|
|
@@ -65,15 +65,18 @@ function CodeBlockCode(props: CodeBlockCodeProps) {
|
|
|
65
65
|
);
|
|
66
66
|
|
|
67
67
|
return (
|
|
68
|
+
// `tabindex={0}` makes the horizontally-scrollable region reachable by
|
|
69
|
+
// keyboard (axe `scrollable-region-focusable`); `{...rest}` lets a consumer
|
|
70
|
+
// override it. No `role="region"` — that would demand an accessible name.
|
|
68
71
|
<Show
|
|
69
72
|
when={highlighted()}
|
|
70
73
|
fallback={
|
|
71
|
-
<div class={classNames()} {...rest}>
|
|
74
|
+
<div class={classNames()} tabindex={0} {...rest}>
|
|
72
75
|
<pre><code>{local.code}</code></pre>
|
|
73
76
|
</div>
|
|
74
77
|
}
|
|
75
78
|
>
|
|
76
|
-
<div class={classNames()} innerHTML={highlighted()} {...rest} />
|
|
79
|
+
<div class={classNames()} tabindex={0} innerHTML={highlighted()} {...rest} />
|
|
77
80
|
</Show>
|
|
78
81
|
);
|
|
79
82
|
}
|
|
@@ -631,6 +631,14 @@
|
|
|
631
631
|
"scalar": true,
|
|
632
632
|
"description": ""
|
|
633
633
|
},
|
|
634
|
+
{
|
|
635
|
+
"name": "aria-label",
|
|
636
|
+
"type": "undefined | string",
|
|
637
|
+
"displayType": "undefined | string",
|
|
638
|
+
"optional": true,
|
|
639
|
+
"scalar": true,
|
|
640
|
+
"description": "Accessible name for the button — required when it has no visible text (icon-only)."
|
|
641
|
+
},
|
|
634
642
|
{
|
|
635
643
|
"name": "variant",
|
|
636
644
|
"type": "undefined | \"default\" | \"ghost\" | \"outline\"",
|
|
@@ -32,6 +32,10 @@ defineWebComponent<Props, Events>('kc-checkpoint', {
|
|
|
32
32
|
<Checkpoint>
|
|
33
33
|
<CheckpointTrigger
|
|
34
34
|
tooltip={props.tooltip}
|
|
35
|
+
// Icon-only (no visible label) needs an accessible name: prefer the
|
|
36
|
+
// tooltip text, else a sensible default. With a visible label, the text
|
|
37
|
+
// is the name — leave aria-label unset so it isn't duplicated.
|
|
38
|
+
aria-label={props.label ? undefined : (props.tooltip ?? 'Checkpoint')}
|
|
35
39
|
variant={props.variant}
|
|
36
40
|
size={props.size}
|
|
37
41
|
onClick={() => dispatch('select')}
|