@makinbakin/sdk 0.0.1-rc.35 → 0.0.1-rc.37
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/_internal/app/components/drawer.d.ts +1 -3
- package/_internal/app/hooks/use-available-models.d.ts +24 -4
- package/_internal/app/hooks/use-runtime-status.d.ts +22 -6
- package/_internal/app/hooks/use-toast.d.ts +10 -0
- package/_internal/core/adapters/runtime/concepts.d.ts +87 -0
- package/_internal/core/adapters/runtime/index.d.ts +1 -1
- package/_internal/core/adapters/runtime/testing.d.ts +21 -1
- package/_internal/core/plugin-types.d.ts +12 -0
- package/_internal/core/routing/define.d.ts +6 -0
- package/_internal/host/ui/resize.d.ts +2 -0
- package/_internal/ui/{conversation → behaviors}/resize-handle.d.ts +4 -2
- package/_internal/ui/behaviors/use-persisted-leading-edge-resize.d.ts +2 -0
- package/_internal/ui/charts/composition-bar.d.ts +7 -2
- package/_internal/ui/conversation/conversation-panel.d.ts +5 -3
- package/_internal/ui/conversation/conversation.d.ts +3 -1
- package/_internal/ui/forms/field.d.ts +7 -2
- package/_internal/ui/index.d.ts +3 -0
- package/_internal/ui/patterns/data-table.d.ts +7 -1
- package/_internal/ui/patterns/guide-card.d.ts +33 -0
- package/_internal/ui/patterns/index.d.ts +2 -0
- package/_internal/ui/patterns/search-input.d.ts +1 -1
- package/_internal/ui/primitives/card.d.ts +9 -1
- package/_internal/ui/primitives/combobox.d.ts +40 -0
- package/_internal/ui/primitives/control-styles.d.ts +10 -0
- package/_internal/ui/primitives/input-group.d.ts +11 -5
- package/_internal/ui/primitives/input.d.ts +7 -2
- package/_internal/ui/primitives/select.d.ts +14 -4
- package/_internal/ui/primitives/textarea.d.ts +19 -3
- package/_internal/ui/primitives/use-textarea-autosize.d.ts +3 -0
- package/bin/bakin-plugin-test-ui.js +28 -7
- package/charts/index.js +1 -1
- package/content/index.js +8 -10
- package/content/markdown-comparison.d.ts +12 -0
- package/content/markdown-content.d.ts +3 -1
- package/content/markdown-document.d.ts +4 -0
- package/conversation/index.js +2 -2
- package/hooks/index.d.ts +2 -1
- package/hooks/index.js +1 -1
- package/navigation/index.js +1 -1
- package/package.json +2 -1
- package/patterns/agent-patterns.d.ts +4 -2
- package/patterns/index.d.ts +2 -2
- package/patterns/index.js +3 -3
- package/patterns/picker-patterns.d.ts +12 -0
- package/styles.css +1 -1
- package/testing/ui/conformance/index.js +2 -2
- package/testing/ui/index.js +1 -1
- package/types/health.d.ts +3 -1
- package/types/services.d.ts +19 -0
- package/ui/index.d.ts +3 -0
- package/ui/index.js +4 -4
- package/utils/index.d.ts +2 -0
- package/utils/index.js +1 -1
- package/utils/plugin-fetch.d.ts +21 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { Input as InputPrimitive } from '@base-ui/react/input';
|
|
2
|
-
|
|
2
|
+
import { type ControlSize, type ControlVariant } from './control-styles';
|
|
3
|
+
export type InputProps = Omit<InputPrimitive.Props, 'size'> & {
|
|
4
|
+
size?: ControlSize;
|
|
5
|
+
variant?: ControlVariant;
|
|
6
|
+
htmlSize?: number;
|
|
7
|
+
};
|
|
3
8
|
/** Shared internally by FieldControl when it renders its default input. */
|
|
4
9
|
export declare const inputClasses: string;
|
|
5
|
-
export declare function Input({ className, type, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function Input({ className, type, size, variant, htmlSize, ...props }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,25 +1,35 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Select as SelectPrimitive } from '@base-ui/react/select';
|
|
3
|
+
import { type ControlSize, type ControlVariant } from './control-styles';
|
|
3
4
|
export type SelectProps<Value, Multiple extends boolean | undefined = false> = SelectPrimitive.Root.Props<Value, Multiple>;
|
|
4
5
|
export type SelectGroupProps = SelectPrimitive.Group.Props;
|
|
5
6
|
export type SelectValueProps = SelectPrimitive.Value.Props;
|
|
6
|
-
export type SelectTriggerSize =
|
|
7
|
+
export type SelectTriggerSize = ControlSize;
|
|
7
8
|
export type SelectTriggerProps = SelectPrimitive.Trigger.Props & {
|
|
8
9
|
size?: SelectTriggerSize;
|
|
10
|
+
variant?: ControlVariant;
|
|
11
|
+
width?: 'full' | 'auto';
|
|
9
12
|
};
|
|
10
13
|
export type SelectContentProps = SelectPrimitive.Popup.Props & Pick<SelectPrimitive.Positioner.Props, 'align' | 'alignOffset' | 'side' | 'sideOffset' | 'alignItemWithTrigger'>;
|
|
11
14
|
export type SelectLabelProps = SelectPrimitive.GroupLabel.Props;
|
|
12
|
-
export type SelectItemProps = SelectPrimitive.Item.Props
|
|
15
|
+
export type SelectItemProps = SelectPrimitive.Item.Props & {
|
|
16
|
+
/**
|
|
17
|
+
* Secondary text under the item's label — the reason a disabled option
|
|
18
|
+
* cannot be chosen. Exposed as the option's accessible DESCRIPTION
|
|
19
|
+
* (`aria-describedby`), never as part of its name.
|
|
20
|
+
*/
|
|
21
|
+
description?: React.ReactNode;
|
|
22
|
+
};
|
|
13
23
|
export type SelectSeparatorProps = SelectPrimitive.Separator.Props;
|
|
14
24
|
export type SelectScrollUpButtonProps = React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>;
|
|
15
25
|
export type SelectScrollDownButtonProps = React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>;
|
|
16
26
|
export declare const Select: typeof SelectPrimitive.Root;
|
|
17
27
|
export declare function SelectGroup({ className, ...props }: SelectGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
18
28
|
export declare function SelectValue({ className, ...props }: SelectValueProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export declare function SelectTrigger({ className, size, children, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export declare function SelectTrigger({ className, size, variant, width, children, ...props }: SelectTriggerProps): import("react/jsx-runtime").JSX.Element;
|
|
20
30
|
export declare function SelectContent({ className, children, side, sideOffset, align, alignOffset, alignItemWithTrigger, ...props }: SelectContentProps): import("react/jsx-runtime").JSX.Element;
|
|
21
31
|
export declare function SelectLabel({ className, ...props }: SelectLabelProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export declare function SelectItem({ className, children, ...props }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function SelectItem({ className, children, description, ...props }: SelectItemProps): import("react/jsx-runtime").JSX.Element;
|
|
23
33
|
export declare function SelectSeparator({ className, ...props }: SelectSeparatorProps): import("react/jsx-runtime").JSX.Element;
|
|
24
34
|
export declare function SelectScrollUpButton({ className, ...props }: SelectScrollUpButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
25
35
|
export declare function SelectScrollDownButton({ className, ...props }: SelectScrollDownButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type ComponentProps } from 'react';
|
|
2
|
+
import { type ControlSize, type ControlVariant } from './control-styles';
|
|
3
|
+
type TextareaHeight = {
|
|
4
|
+
autoSize?: false;
|
|
5
|
+
rows?: number;
|
|
6
|
+
minRows?: never;
|
|
7
|
+
maxRows?: never;
|
|
8
|
+
} | {
|
|
9
|
+
autoSize: true;
|
|
10
|
+
rows?: never;
|
|
11
|
+
minRows?: number;
|
|
12
|
+
maxRows?: number;
|
|
13
|
+
};
|
|
14
|
+
export type TextareaProps = Omit<ComponentProps<'textarea'>, 'rows'> & TextareaHeight & {
|
|
15
|
+
size?: ControlSize;
|
|
16
|
+
variant?: ControlVariant;
|
|
17
|
+
};
|
|
18
|
+
export declare function Textarea({ className, size, variant, autoSize, rows, minRows, maxRows, ref, onInput, ...props }: TextareaProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -6436,13 +6436,14 @@ async function inspectBrowserPage(page) {
|
|
|
6436
6436
|
"input",
|
|
6437
6437
|
"select",
|
|
6438
6438
|
"textarea",
|
|
6439
|
+
"details > summary:first-of-type",
|
|
6439
6440
|
'[contenteditable="true"]',
|
|
6440
6441
|
"[tabindex]"
|
|
6441
6442
|
].join(",");
|
|
6442
6443
|
const visible = (element) => {
|
|
6443
6444
|
const style = getComputedStyle(element);
|
|
6444
6445
|
const rect = element.getBoundingClientRect();
|
|
6445
|
-
return style.display !== "none" && style.visibility !== "hidden" && rect.width > 0 && rect.height > 0;
|
|
6446
|
+
return style.display !== "none" && style.visibility !== "hidden" && rect.width > 0 && rect.height > 0 && !element.closest("details:not([open]) > :not(summary:first-of-type)");
|
|
6446
6447
|
};
|
|
6447
6448
|
const label = (element) => {
|
|
6448
6449
|
const id = element.id ? `#${element.id}` : "";
|
|
@@ -6477,15 +6478,25 @@ async function inspectBrowserPage(page) {
|
|
|
6477
6478
|
}
|
|
6478
6479
|
async function keyboardFocusFindings(page, viewport) {
|
|
6479
6480
|
const targets = await page.evaluate(() => {
|
|
6481
|
+
const hiddenInClosedDetails = (element) => {
|
|
6482
|
+
for (let node = element;node; node = node.parentElement) {
|
|
6483
|
+
const parent = node.parentElement;
|
|
6484
|
+
if (!parent || parent.tagName !== "DETAILS" || parent.hasAttribute("open"))
|
|
6485
|
+
continue;
|
|
6486
|
+
if (node.tagName !== "SUMMARY")
|
|
6487
|
+
return true;
|
|
6488
|
+
}
|
|
6489
|
+
return false;
|
|
6490
|
+
};
|
|
6480
6491
|
if (document.activeElement instanceof HTMLElement)
|
|
6481
6492
|
document.activeElement.blur();
|
|
6482
6493
|
document.body.tabIndex = -1;
|
|
6483
6494
|
document.body.focus();
|
|
6484
|
-
const selector = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
6495
|
+
const selector = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), details > summary:first-of-type, [contenteditable="true"], [tabindex]:not([tabindex="-1"])';
|
|
6485
6496
|
const visibleElements = [...document.querySelectorAll(selector)].filter((element) => {
|
|
6486
6497
|
const style = getComputedStyle(element);
|
|
6487
6498
|
const rect = element.getBoundingClientRect();
|
|
6488
|
-
return style.display !== "none" && style.visibility !== "hidden" && rect.width > 0 && rect.height > 0 && !element.matches(":disabled") && element.tabIndex >= 0 && !element.closest('[inert], [aria-hidden="true"]');
|
|
6499
|
+
return style.display !== "none" && style.visibility !== "hidden" && rect.width > 0 && rect.height > 0 && !element.closest("details:not([open]) > :not(summary:first-of-type)") && !element.matches(":disabled") && element.tabIndex >= 0 && !element.closest('[inert], [aria-hidden="true"]') && !hiddenInClosedDetails(element);
|
|
6489
6500
|
});
|
|
6490
6501
|
const radioGroups = new Map;
|
|
6491
6502
|
for (const element of visibleElements) {
|
|
@@ -6540,7 +6551,7 @@ ${element.name}`) ?? [element];
|
|
|
6540
6551
|
const focus = await page.evaluate(async (restingById) => {
|
|
6541
6552
|
await new Promise((resolveFrame) => requestAnimationFrame(() => resolveFrame()));
|
|
6542
6553
|
const element = document.activeElement;
|
|
6543
|
-
if (!(element instanceof HTMLElement) || element === document.body) {
|
|
6554
|
+
if (!(element instanceof HTMLElement || element instanceof SVGElement) || element === document.body) {
|
|
6544
6555
|
return { reached: false, visible: false, id: "", label: "document body", diagnostic: "" };
|
|
6545
6556
|
}
|
|
6546
6557
|
const id = element.getAttribute("data-bakin-ui-test-focus-id") ?? "";
|
|
@@ -6569,6 +6580,7 @@ ${element.name}`) ?? [element];
|
|
|
6569
6580
|
"transform"
|
|
6570
6581
|
].some((property) => focused[property] !== resting[property]);
|
|
6571
6582
|
const focusVisible = element.matches(":focus-visible");
|
|
6583
|
+
const chartPointDescribed = element instanceof SVGElement && element.getAttribute("role") === "img" && Boolean(element.getAttribute("aria-describedby"));
|
|
6572
6584
|
const group = element.matches('[data-slot="input-group-control"]') ? element.closest('[data-slot="input-group"]') : null;
|
|
6573
6585
|
const groupStyle = group ? getComputedStyle(group) : null;
|
|
6574
6586
|
const groupResting = resting?.groupOutline;
|
|
@@ -6576,20 +6588,29 @@ ${element.name}`) ?? [element];
|
|
|
6576
6588
|
const label = element.getAttribute("aria-label") || element.textContent?.trim() || element.tagName.toLowerCase();
|
|
6577
6589
|
return {
|
|
6578
6590
|
reached: Boolean(id),
|
|
6579
|
-
visible: focusVisible && (visibleOutline && outlineChanged || shadowChanged || surfaceChanged || groupRingChanged),
|
|
6591
|
+
visible: focusVisible && (visibleOutline && outlineChanged || shadowChanged || surfaceChanged || groupRingChanged || chartPointDescribed),
|
|
6580
6592
|
id,
|
|
6581
6593
|
label: label.slice(0, 80),
|
|
6582
6594
|
diagnostic: `focus-visible=${focusVisible}; outline=${style.outlineStyle} ${style.outlineWidth}; shadow=${style.boxShadow}`
|
|
6583
6595
|
};
|
|
6584
6596
|
}, Object.fromEntries(targets.map((target) => [target.id, target.resting])));
|
|
6585
6597
|
if (!focus.reached) {
|
|
6586
|
-
const
|
|
6598
|
+
const missingTargets = targets.filter((target) => !reached.has(target.id));
|
|
6599
|
+
const why = await page.evaluate((ids) => ids.map((id) => {
|
|
6600
|
+
const element = document.querySelector(`[data-bakin-ui-test-focus-id="${id}"]`);
|
|
6601
|
+
if (!element)
|
|
6602
|
+
return "gone";
|
|
6603
|
+
const rect = element.getBoundingClientRect();
|
|
6604
|
+
const style = getComputedStyle(element);
|
|
6605
|
+
return `display=${style.display} size=${Math.round(rect.width)}x${Math.round(rect.height)} tabindex=${element.tabIndex}${element.closest("details:not([open])") ? " inside-closed-details" : ""}`;
|
|
6606
|
+
}), missingTargets.map((target) => target.id));
|
|
6607
|
+
const missing = missingTargets.map((target, index2) => `${target.label} [${why[index2]}]`).join(", ");
|
|
6587
6608
|
findings.push({
|
|
6588
6609
|
rule: "keyboard-focus",
|
|
6589
6610
|
enforcement: "conformance",
|
|
6590
6611
|
fixture: FIXTURE_NAME,
|
|
6591
6612
|
viewport,
|
|
6592
|
-
message: `Tab left the visible fixture controls after reaching ${reached.size} of ${targets.length}. Missing: ${missing}.`,
|
|
6613
|
+
message: `Tab left the visible fixture controls after reaching ${reached.size} of ${targets.length} (focus landed on ${focus.label}). Missing: ${missing}.`,
|
|
6593
6614
|
repair: "Use native interactive elements or a documented SDK control and preserve its complete tab order."
|
|
6594
6615
|
});
|
|
6595
6616
|
break;
|