@jini-ai/ui 0.6.23 → 0.7.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/CHANGELOG.md +23 -0
- package/dist/features/admin-widgets/components/ImagePreviewModal.d.ts +3 -3
- package/dist/features/admin-widgets/components/ImagePreviewModal.js +3 -1
- package/dist/features/admin-widgets/components/InfoTip.d.ts +2 -2
- package/dist/features/admin-widgets/components/InfoTip.js +3 -1
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.d.ts +2 -2
- package/dist/features/admin-widgets/components/SeeMore/SeeMore.js +3 -1
- package/dist/features/admin-widgets/components/Select/Select.d.ts +2 -2
- package/dist/features/admin-widgets/components/Select/Select.js +12 -8
- package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.d.ts +2 -2
- package/dist/features/admin-widgets/components/SuggestInput/SuggestInput.js +3 -1
- package/dist/features/execution/react/components/SearchableModelSelect.d.ts +5 -5
- package/dist/features/execution/react/components/SearchableModelSelect.js +4 -2
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.d.ts +3 -2
- package/dist/features/interactive-ui/providers/shadcn/checkbox-field.js +5 -2
- package/dist/features/interactive-ui/providers/shadcn/select-field.d.ts +4 -2
- package/dist/features/interactive-ui/providers/shadcn/select-field.js +9 -2
- package/dist/features/interactive-ui/providers/shadcn/select.d.ts +5 -3
- package/dist/features/interactive-ui/providers/shadcn/select.js +9 -4
- package/dist/features/mcp-ui/cards.d.ts +12 -0
- package/dist/features/mcp-ui/cards.js +8 -0
- package/dist/features/mcp-ui/credential-card.d.ts +34 -0
- package/dist/features/mcp-ui/credential-card.js +42 -0
- package/dist/features/mcp-ui/secret-card.d.ts +2 -16
- package/dist/features/mcp-ui/sign-in-card.d.ts +57 -0
- package/dist/features/mcp-ui/sign-in-card.js +67 -0
- package/dist/features/mcp-ui/surfaces/access-approval.d.ts +15 -0
- package/dist/features/mcp-ui/surfaces/access-approval.js +17 -0
- package/dist/features/mcp-ui/surfaces/bridge.d.ts +2 -8
- package/dist/features/mcp-ui/surfaces/confirmation.d.ts +9 -8
- package/dist/features/mcp-ui/surfaces/confirmation.js +23 -8
- package/dist/features/mcp-ui/surfaces/document.d.ts +3 -22
- package/dist/features/mcp-ui/surfaces/document.js +4 -0
- package/dist/features/mcp-ui/surfaces/fields.d.ts +2 -74
- package/dist/features/mcp-ui/surfaces/form.d.ts +2 -42
- package/dist/features/mcp-ui/surfaces/index.d.ts +1 -0
- package/dist/features/mcp-ui/surfaces/index.js +1 -0
- package/dist/features/mcp-ui/surfaces/outcome.d.ts +2 -39
- package/dist/features/mcp-ui/surfaces/outcome.js +25 -2
- package/dist/features/mcp-ui/surfaces/select.d.ts +2 -7
- package/dist/features/mcp-ui/surfaces/structured-details.d.ts +2 -19
- package/dist/features/mcp-ui/surfaces/text-input.d.ts +2 -5
- package/dist/features/mcp-ui/surfaces/tokens.d.ts +2 -2
- package/dist/features/panel-kit/failure-channel.d.ts +25 -0
- package/dist/features/panel-kit/failure-channel.js +36 -0
- package/dist/features/panel-kit/index.d.ts +2 -0
- package/dist/features/panel-kit/index.js +1 -0
- package/dist/features/site-card/SiteCard.d.ts +40 -0
- package/dist/features/site-card/SiteCard.js +15 -0
- package/dist/features/site-card/SiteListToolbar.d.ts +28 -0
- package/dist/features/site-card/SiteListToolbar.js +15 -0
- package/dist/features/site-card/index.d.ts +5 -0
- package/dist/features/site-card/index.js +5 -0
- package/dist/features/site-card/site-card.css +136 -0
- package/dist/features/site-card/site-list-view.d.ts +53 -0
- package/dist/features/site-card/site-list-view.js +62 -0
- package/dist/features/site-card/use-site-list-view.hooks.d.ts +24 -0
- package/dist/features/site-card/use-site-list-view.hooks.js +26 -0
- package/dist/features/tab-strip/react/components/TabStrip.d.ts +3 -2
- package/dist/features/tab-strip/react/components/TabStrip.js +5 -2
- package/dist/features/tab-strip/react/components/TabStripItem.d.ts +3 -2
- package/dist/features/tab-strip/react/components/TabStripItem.js +5 -2
- package/dist/index.d.ts +2 -0
- package/dist/index.js +3 -0
- package/dist/react/components/CustomSelect.d.ts +5 -3
- package/dist/react/components/CustomSelect.js +18 -11
- package/dist/react/components/PillButton.d.ts +3 -2
- package/dist/react/components/PillButton.js +5 -2
- package/dist/react/components/PopoverItem.d.ts +3 -2
- package/dist/react/components/PopoverItem.js +5 -2
- package/dist/react/components/PopoverMenu.d.ts +3 -2
- package/dist/react/components/PopoverMenu.js +5 -2
- package/dist/react/components/select-popover.d.ts +8 -2
- package/dist/react/components/select-popover.js +8 -3
- package/dist/react/hooks/useAgentHandle.d.ts +17 -0
- package/dist/react/hooks/useAgentHandle.js +17 -0
- package/dist/styles/admin.css +1 -0
- package/package.json +38 -12
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { agentHandleProps } from '@jini-ai/agentic';
|
|
3
|
+
import { useAgentHandle } from '../../../../react/hooks/useAgentHandle.js';
|
|
2
4
|
import { useT } from '../../../i18n/index.js';
|
|
3
5
|
import { TAB_STRIP_ITEM_ID_ATTRIBUTE } from '../../constants.js';
|
|
4
6
|
import { isTabClosable } from '../../rules.js';
|
|
@@ -14,7 +16,8 @@ import { isTabClosable } from '../../rules.js';
|
|
|
14
16
|
* purpose is redundant once the outer element itself is focusable/
|
|
15
17
|
* keyboard-activatable, so this follows the simpler of the two shapes).
|
|
16
18
|
*/
|
|
17
|
-
export function TabStripItem({ tab, active, dragging, dragOverEdge, dragProps, onActivate, onClose, closeLabel, closeIcon, }) {
|
|
19
|
+
export function TabStripItem({ tab, active, dragging, dragOverEdge, dragProps, onActivate, onClose, closeLabel, closeIcon, ...agentProps }) {
|
|
20
|
+
const base = useAgentHandle(agentProps);
|
|
18
21
|
const t = useT();
|
|
19
22
|
const resolvedCloseLabel = closeLabel ?? t('Close tab');
|
|
20
23
|
const showClose = isTabClosable(tab, Boolean(onClose));
|
|
@@ -43,6 +46,6 @@ export function TabStripItem({ tab, active, dragging, dragOverEdge, dragProps, o
|
|
|
43
46
|
]
|
|
44
47
|
.filter(Boolean)
|
|
45
48
|
.join(' ');
|
|
46
|
-
return (_jsxs("div", { className: className, [TAB_STRIP_ITEM_ID_ATTRIBUTE]: tab.id, role: "tab", "aria-selected": active, tabIndex: 0, title: tab.title, draggable: dragProps.draggable, onDragStart: dragProps.onDragStart, onDragEnd: dragProps.onDragEnd, onClick: handleClick, onKeyDown: handleKeyDown, children: [_jsx("div", { className: "jini-tab-strip-item__content", children: tab.content }), showClose ? (_jsx("button", { type: "button", className: "jini-tab-strip-item__close", "aria-label": resolvedCloseLabel, title: resolvedCloseLabel, onClick: handleClose, children: closeIcon ?? '×' })) : null] }));
|
|
49
|
+
return (_jsxs("div", { className: className, ...agentHandleProps({}, { base, role: 'button', ...(tab.title === undefined ? {} : { label: tab.title }) }), "data-agent-private": agentProps['data-agent-private'], "data-agent-page": agentProps['data-agent-page'], [TAB_STRIP_ITEM_ID_ATTRIBUTE]: tab.id, role: "tab", "aria-selected": active, tabIndex: 0, title: tab.title, draggable: dragProps.draggable, onDragStart: dragProps.onDragStart, onDragEnd: dragProps.onDragEnd, onClick: handleClick, onKeyDown: handleKeyDown, children: [_jsx("div", { className: "jini-tab-strip-item__content", children: tab.content }), showClose ? (_jsx("button", { ...agentHandleProps({}, { base, action: 'close', role: 'button', label: resolvedCloseLabel }), type: "button", className: "jini-tab-strip-item__close", "aria-label": resolvedCloseLabel, title: resolvedCloseLabel, onClick: handleClose, children: closeIcon ?? '×' })) : null] }));
|
|
47
50
|
}
|
|
48
51
|
//# sourceMappingURL=TabStripItem.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ export * from './utils/scroll-tabs-with-wheel.js';
|
|
|
94
94
|
export * from './utils/color-math.js';
|
|
95
95
|
export * from './utils/design-md.js';
|
|
96
96
|
export * from './utils/file-system-errors.js';
|
|
97
|
+
export { useAgentHandle, type AgentControlProps } from './react/hooks/useAgentHandle.js';
|
|
97
98
|
export * from './react/hooks/useInView.js';
|
|
98
99
|
export * from './react/hooks/useCoalescedCallback.js';
|
|
99
100
|
export * from './react/hooks/useStableHandler.js';
|
|
@@ -137,4 +138,5 @@ export * from './react/components/EditorIcon.js';
|
|
|
137
138
|
export * from './react/components/TokenChip.js';
|
|
138
139
|
export * from './react/components/ValueChip.js';
|
|
139
140
|
export * from './react/components/ComponentKitPreview.js';
|
|
141
|
+
export { useOverlayContainer } from '@jini-ai/ui-kit/react';
|
|
140
142
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -98,6 +98,7 @@ export * from './utils/design-md.js';
|
|
|
98
98
|
// import. `@jini-ai/chat`'s `./react` subpath needs `FILE_SYSTEM_READ_ERROR_MESSAGE` for a test
|
|
99
99
|
// assertion now that it's an external package rather than living inside `ui`.
|
|
100
100
|
export * from './utils/file-system-errors.js';
|
|
101
|
+
export { useAgentHandle } from './react/hooks/useAgentHandle.js';
|
|
101
102
|
export * from './react/hooks/useInView.js';
|
|
102
103
|
export * from './react/hooks/useCoalescedCallback.js';
|
|
103
104
|
export * from './react/hooks/useStableHandler.js';
|
|
@@ -144,4 +145,6 @@ export * from './react/components/EditorIcon.js';
|
|
|
144
145
|
export * from './react/components/TokenChip.js';
|
|
145
146
|
export * from './react/components/ValueChip.js';
|
|
146
147
|
export * from './react/components/ComponentKitPreview.js';
|
|
148
|
+
// Share the existing kit overlay context with consumers of these React primitives.
|
|
149
|
+
export { useOverlayContainer } from '@jini-ai/ui-kit/react';
|
|
147
150
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { KeyboardEvent, MutableRefObject, ReactNode } from 'react';
|
|
2
|
+
import { type AgentControlProps } from '../hooks/useAgentHandle.js';
|
|
2
3
|
export interface CustomSelectOption {
|
|
3
4
|
value: string;
|
|
4
5
|
label: string;
|
|
@@ -9,7 +10,7 @@ export interface CustomSelectGroup {
|
|
|
9
10
|
options: CustomSelectOption[];
|
|
10
11
|
}
|
|
11
12
|
export type CustomSelectItem = CustomSelectOption | CustomSelectGroup;
|
|
12
|
-
export interface CustomSelectProps {
|
|
13
|
+
export interface CustomSelectProps extends AgentControlProps {
|
|
13
14
|
value: string;
|
|
14
15
|
options: CustomSelectItem[];
|
|
15
16
|
onChange: (value: string) => void;
|
|
@@ -200,10 +201,11 @@ export declare function useCustomSelectOriginTheme({ buttonRef, open, portal }:
|
|
|
200
201
|
* {@link useCustomSelect}; this component only wires the hook's state to the
|
|
201
202
|
* trigger button and the listbox menu.
|
|
202
203
|
*/
|
|
203
|
-
export declare function CustomSelect({ value, options, onChange, ariaLabel, labelledBy, className, triggerClassName, menuClassName, disabled, placeholder, portal, portalContainer, title, onFocus, menuHeader, onOpenChange, useCustomSelect: useCustomSelectHook, }: CustomSelectProps): import("react").JSX.Element;
|
|
204
|
+
export declare function CustomSelect({ value, options, onChange, ariaLabel, labelledBy, className, triggerClassName, menuClassName, disabled, placeholder, portal, portalContainer, title, onFocus, menuHeader, onOpenChange, useCustomSelect: useCustomSelectHook, ...agentProps }: CustomSelectProps): import("react").JSX.Element;
|
|
204
205
|
/** One row in the listbox: a selectable option button that reports hover
|
|
205
206
|
* (activation) and click (choice) back to {@link CustomSelect}. */
|
|
206
|
-
export declare function CustomSelectOptionButton({ option, selected, active, id, onChoose, onActive, }: {
|
|
207
|
+
export declare function CustomSelectOptionButton({ option, selected, active, id, onChoose, onActive, agentHandle, }: {
|
|
208
|
+
agentHandle?: string | false | undefined;
|
|
207
209
|
option: CustomSelectOption;
|
|
208
210
|
selected: boolean;
|
|
209
211
|
active: boolean;
|
|
@@ -10,8 +10,11 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
10
10
|
// `CustomSelectOptionButton` leaf, and the dumb `CustomSelect` render.
|
|
11
11
|
import { useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|
12
12
|
import { createPortal } from 'react-dom';
|
|
13
|
-
import {
|
|
13
|
+
import { useOverlayContainer } from '@jini-ai/ui-kit/react';
|
|
14
|
+
import { useSelectPopover, isSelectEventInside, openSelectOnKey, applySelectNavigationKey, resolveSelectPortalContainer, resolveSelectOriginPage } from './select-popover.js';
|
|
14
15
|
import { Icon } from './Icon.js';
|
|
16
|
+
import { agentHandleProps, agentHandleSegment } from '@jini-ai/agentic';
|
|
17
|
+
import { useAgentHandle } from '../hooks/useAgentHandle.js';
|
|
15
18
|
/** Space between the trigger and the menu. */
|
|
16
19
|
export const CUSTOM_SELECT_MENU_GAP = 4;
|
|
17
20
|
/** Minimum distance the menu keeps from any viewport edge. */
|
|
@@ -262,14 +265,14 @@ function customSelectMenuStyle({ portal, position }) {
|
|
|
262
265
|
: undefined;
|
|
263
266
|
}
|
|
264
267
|
/** Where an open menu renders: inline, or portalled only after its first measurement. */
|
|
265
|
-
function mountCustomSelectMenu({ menu, portal, position, trigger }, { container } = {}) {
|
|
268
|
+
function mountCustomSelectMenu({ menu, portal, position, trigger }, { container, fallbackContainer } = {}) {
|
|
266
269
|
if (!portal)
|
|
267
270
|
return menu;
|
|
268
|
-
return position ? createPortal(menu, resolveSelectPortalContainer({ trigger }, { container })) : null;
|
|
271
|
+
return position ? createPortal(menu, resolveSelectPortalContainer({ trigger }, { container, fallbackContainer })) : null;
|
|
269
272
|
}
|
|
270
273
|
/** The listbox rows: groups render a labelled block of option buttons, flat options render directly. */
|
|
271
|
-
function CustomSelectMenuOptions({ options, value, activeValue, optionIdByValue, onChoose, onActive }) {
|
|
272
|
-
const renderOption = (option) => (_jsx(CustomSelectOptionButton, { option: option, selected: option.value === value, active: option.value === activeValue, id: optionIdByValue.get(option.value), onChoose: onChoose, onActive: onActive }, option.value));
|
|
274
|
+
function CustomSelectMenuOptions({ options, value, activeValue, optionIdByValue, onChoose, onActive, base }) {
|
|
275
|
+
const renderOption = (option) => (_jsx(CustomSelectOptionButton, { option: option, agentHandle: base ? `${base}-option-${agentHandleSegment({ value: option.value })}` : false, selected: option.value === value, active: option.value === activeValue, id: optionIdByValue.get(option.value), onChoose: onChoose, onActive: onActive }, option.value));
|
|
273
276
|
return (_jsx(_Fragment, { children: options.map((item) => (isCustomSelectGroup(item) ? (_jsxs("div", { className: "jini-select-group", children: [_jsx("div", { className: "jini-select-group-label", children: item.label }), item.options.map(renderOption)] }, `group:${item.label}`)) : renderOption(item))) }));
|
|
274
277
|
}
|
|
275
278
|
/**
|
|
@@ -278,20 +281,24 @@ function CustomSelectMenuOptions({ options, value, activeValue, optionIdByValue,
|
|
|
278
281
|
* {@link useCustomSelect}; this component only wires the hook's state to the
|
|
279
282
|
* trigger button and the listbox menu.
|
|
280
283
|
*/
|
|
281
|
-
export function CustomSelect({ value, options, onChange, ariaLabel, labelledBy, className, triggerClassName, menuClassName, disabled = false, placeholder, portal = true, portalContainer, title, onFocus, menuHeader, onOpenChange, useCustomSelect: useCustomSelectHook = useCustomSelect, }) {
|
|
284
|
+
export function CustomSelect({ value, options, onChange, ariaLabel, labelledBy, className, triggerClassName, menuClassName, disabled = false, placeholder, portal = true, portalContainer, title, onFocus, menuHeader, onOpenChange, useCustomSelect: useCustomSelectHook = useCustomSelect, ...agentProps }) {
|
|
282
285
|
const { idBase, buttonRef, menuRef, open, activeValue, position, selectedLabel, optionIdByValue, activeOptionId, choose, setActiveValue, toggleOpen, onButtonKeyDown, onMenuKeyDown, } = useCustomSelectHook({ value, options, onChange, portal, placeholder, onOpenChange });
|
|
286
|
+
const base = useAgentHandle(agentProps);
|
|
287
|
+
const overlayContainer = useOverlayContainer({});
|
|
288
|
+
const originPage = agentProps['data-agent-page'] ?? resolveSelectOriginPage({ trigger: buttonRef.current });
|
|
283
289
|
const originTheme = useCustomSelectOriginTheme({ buttonRef, open, portal });
|
|
284
|
-
const menu = (_jsxs("div", { ref: menuRef, id: `${idBase}-menu`, onKeyDown: onMenuKeyDown, ...originTheme, className: [
|
|
290
|
+
const menu = (_jsxs("div", { ref: menuRef, id: `${idBase}-menu`, onKeyDown: onMenuKeyDown, ...originTheme, "data-agent-page": originPage, "data-agent-private": agentProps['data-agent-private'], className: [
|
|
285
291
|
'jini-select-menu',
|
|
286
292
|
portal ? 'portal' : 'inline',
|
|
287
293
|
menuClassName,
|
|
288
|
-
].filter(Boolean).join(' '), role: "listbox", "aria-label": ariaLabel, style: customSelectMenuStyle({ portal, position }), children: [menuHeader, _jsx(CustomSelectMenuOptions, { options: options, value: value, activeValue: activeValue, optionIdByValue: optionIdByValue, onChoose: choose, onActive: setActiveValue })] }));
|
|
289
|
-
return (_jsxs("div", { className: ['jini-select', className].filter(Boolean).join(' '), children: [_jsxs("button", { ref: buttonRef, type: "button", className: ['jini-select-trigger', triggerClassName].filter(Boolean).join(' '), role: "combobox", value: value, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": `${idBase}-menu`, "aria-activedescendant": activeOptionId, "aria-describedby": labelledBy, "aria-label": `${ariaLabel}: ${selectedLabel}`, disabled: disabled, title: title, onClick: toggleOpen, onKeyDown: onButtonKeyDown, onFocus: onFocus, children: [_jsx("span", { id: `${idBase}-value`, className: "jini-select-value", children: selectedLabel }), _jsx(Icon, { name: "chevron-down", size: 14 })] }), open ? mountCustomSelectMenu({ menu, portal, position, trigger: buttonRef.current }, { container: portalContainer }) : null] }));
|
|
294
|
+
].filter(Boolean).join(' '), role: "listbox", "aria-label": ariaLabel, style: customSelectMenuStyle({ portal, position }), children: [menuHeader, _jsx(CustomSelectMenuOptions, { base: base, options: options, value: value, activeValue: activeValue, optionIdByValue: optionIdByValue, onChoose: choose, onActive: setActiveValue })] }));
|
|
295
|
+
return (_jsxs("div", { className: ['jini-select', className].filter(Boolean).join(' '), children: [_jsxs("button", { ref: buttonRef, ...agentHandleProps({}, { base, role: 'field', label: ariaLabel }), "data-agent-private": agentProps['data-agent-private'], "data-agent-page": agentProps['data-agent-page'], type: "button", className: ['jini-select-trigger', triggerClassName].filter(Boolean).join(' '), role: "combobox", value: value, "aria-haspopup": "listbox", "aria-expanded": open, "aria-controls": `${idBase}-menu`, "aria-activedescendant": activeOptionId, "aria-describedby": labelledBy, "aria-label": `${ariaLabel}: ${selectedLabel}`, disabled: disabled, title: title, onClick: toggleOpen, onKeyDown: onButtonKeyDown, onFocus: onFocus, children: [_jsx("span", { id: `${idBase}-value`, className: "jini-select-value", children: selectedLabel }), _jsx(Icon, { name: "chevron-down", size: 14 })] }), open ? mountCustomSelectMenu({ menu, portal, position, trigger: buttonRef.current }, { container: portalContainer, fallbackContainer: overlayContainer }) : null] }));
|
|
290
296
|
}
|
|
291
297
|
/** One row in the listbox: a selectable option button that reports hover
|
|
292
298
|
* (activation) and click (choice) back to {@link CustomSelect}. */
|
|
293
|
-
export function CustomSelectOptionButton({ option, selected, active, id, onChoose, onActive, }) {
|
|
294
|
-
|
|
299
|
+
export function CustomSelectOptionButton({ option, selected, active, id, onChoose, onActive, agentHandle, }) {
|
|
300
|
+
const base = useAgentHandle({ agentHandle });
|
|
301
|
+
return (_jsxs("button", { ...agentHandleProps({}, { base, role: 'button', label: option.label }), id: id, type: "button", className: [
|
|
295
302
|
'jini-select-option',
|
|
296
303
|
selected ? 'selected' : '',
|
|
297
304
|
active ? 'active' : '',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { type AgentControlProps } from '../hooks/useAgentHandle.js';
|
|
3
|
+
export interface PillButtonProps extends AgentControlProps {
|
|
3
4
|
/** Rendered before the label. Any host-supplied icon element. */
|
|
4
5
|
icon?: ReactNode;
|
|
5
6
|
/** Pill label. Usually plain text, but accepts a node so a caller can
|
|
@@ -29,5 +30,5 @@ export interface PillButtonProps {
|
|
|
29
30
|
* Origin: `PillButton` from the vendored schedule/mention god-component
|
|
30
31
|
* (recon r6 §1.19) — generic popover-trigger chrome, no product types.
|
|
31
32
|
*/
|
|
32
|
-
export declare function PillButton({ icon, label, active, 'aria-label': ariaLabel, trailingIcon, onClick, disabled, className, children, }: PillButtonProps): import("react").JSX.Element;
|
|
33
|
+
export declare function PillButton({ icon, label, active, 'aria-label': ariaLabel, trailingIcon, onClick, disabled, className, children, agentHandle, 'data-agent-element': suppliedHandle, 'data-agent-private': privateControl, 'data-agent-page': page, }: PillButtonProps): import("react").JSX.Element;
|
|
33
34
|
//# sourceMappingURL=PillButton.d.ts.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { agentHandleProps } from '@jini-ai/agentic';
|
|
3
|
+
import { useAgentHandle } from '../hooks/useAgentHandle.js';
|
|
2
4
|
import { withClassName } from '../../utils/class-names.js';
|
|
3
5
|
/**
|
|
4
6
|
* Generic labeled trigger pill: icon + label (+ optional trailing icon),
|
|
@@ -9,7 +11,8 @@ import { withClassName } from '../../utils/class-names.js';
|
|
|
9
11
|
* Origin: `PillButton` from the vendored schedule/mention god-component
|
|
10
12
|
* (recon r6 §1.19) — generic popover-trigger chrome, no product types.
|
|
11
13
|
*/
|
|
12
|
-
export function PillButton({ icon, label, active = false, 'aria-label': ariaLabel, trailingIcon, onClick, disabled = false, className, children, }) {
|
|
13
|
-
|
|
14
|
+
export function PillButton({ icon, label, active = false, 'aria-label': ariaLabel, trailingIcon, onClick, disabled = false, className, children, agentHandle, 'data-agent-element': suppliedHandle, 'data-agent-private': privateControl, 'data-agent-page': page, }) {
|
|
15
|
+
const base = useAgentHandle({ agentHandle, 'data-agent-element': suppliedHandle, 'data-agent-private': privateControl });
|
|
16
|
+
return (_jsxs("div", { className: withClassName('jini-pill-wrap', className), children: [_jsxs("button", { ...agentHandleProps({}, { base, role: 'button', label: ariaLabel ?? (typeof label === 'string' ? label : 'Action') }), "data-agent-private": privateControl, "data-agent-page": page, type: "button", className: `jini-pill${active ? ' is-active' : ''}`, "aria-label": ariaLabel, "aria-expanded": children ? active : undefined, onClick: onClick, disabled: disabled, children: [icon, _jsx("span", { className: "jini-pill__label", children: label }), trailingIcon] }), children] }));
|
|
14
17
|
}
|
|
15
18
|
//# sourceMappingURL=PillButton.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import { type AgentControlProps } from '../hooks/useAgentHandle.js';
|
|
3
|
+
export interface PopoverItemProps extends AgentControlProps {
|
|
3
4
|
selected?: boolean;
|
|
4
5
|
/** Rendered when `selected` — typically a check icon. Omit for a plain
|
|
5
6
|
* text-only item with no selection affordance. */
|
|
@@ -20,5 +21,5 @@ export interface PopoverItemProps {
|
|
|
20
21
|
* Origin: `PopoverItem` from the vendored schedule/mention god-component
|
|
21
22
|
* (recon r6 §1.19) — generic, no product types.
|
|
22
23
|
*/
|
|
23
|
-
export declare function PopoverItem({ selected, selectedIcon, label, hint, onClick, title }: PopoverItemProps): import("react").JSX.Element;
|
|
24
|
+
export declare function PopoverItem({ selected, selectedIcon, label, hint, onClick, title, ...agentProps }: PopoverItemProps): import("react").JSX.Element;
|
|
24
25
|
//# sourceMappingURL=PopoverItem.d.ts.map
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { agentHandleProps } from '@jini-ai/agentic';
|
|
3
|
+
import { useAgentHandle } from '../hooks/useAgentHandle.js';
|
|
2
4
|
/**
|
|
3
5
|
* Generic single-select-style menu row: an optional selected-check slot,
|
|
4
6
|
* a label, and an optional secondary hint line. Props in, JSX out.
|
|
@@ -6,7 +8,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
6
8
|
* Origin: `PopoverItem` from the vendored schedule/mention god-component
|
|
7
9
|
* (recon r6 §1.19) — generic, no product types.
|
|
8
10
|
*/
|
|
9
|
-
export function PopoverItem({ selected = false, selectedIcon, label, hint, onClick, title }) {
|
|
10
|
-
|
|
11
|
+
export function PopoverItem({ selected = false, selectedIcon, label, hint, onClick, title, ...agentProps }) {
|
|
12
|
+
const base = useAgentHandle(agentProps);
|
|
13
|
+
return (_jsxs("button", { ...agentHandleProps({}, { base, role: 'button', label }), "data-agent-private": agentProps['data-agent-private'], "data-agent-page": agentProps['data-agent-page'], type: "button", className: `jini-popover__item${selected ? ' is-selected' : ''}`, onClick: onClick, title: title, children: [_jsx("span", { className: "jini-popover__check", children: selected ? selectedIcon : null }), _jsxs("span", { className: "jini-popover__body", children: [_jsx("span", { className: "jini-popover__label", children: label }), hint ? _jsx("span", { className: "jini-popover__hint", children: hint }) : null] })] }));
|
|
11
14
|
}
|
|
12
15
|
//# sourceMappingURL=PopoverItem.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
|
|
2
|
+
import type { AgentControlProps } from '../hooks/useAgentHandle.js';
|
|
3
|
+
export interface PopoverMenuProps extends AgentControlProps {
|
|
3
4
|
children?: ReactNode;
|
|
4
5
|
className?: string;
|
|
5
6
|
}
|
|
@@ -11,5 +12,5 @@ export interface PopoverMenuProps {
|
|
|
11
12
|
* Origin: `PopoverMenu` from the vendored schedule/mention god-component
|
|
12
13
|
* (recon r6 §1.19) — generic, no product types.
|
|
13
14
|
*/
|
|
14
|
-
export declare function PopoverMenu({ children, className }: PopoverMenuProps): import("react").JSX.Element;
|
|
15
|
+
export declare function PopoverMenu({ children, className, ...agentProps }: PopoverMenuProps): import("react").JSX.Element;
|
|
15
16
|
//# sourceMappingURL=PopoverMenu.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { agentHandleProps } from '@jini-ai/agentic';
|
|
2
3
|
import { withClassName } from '../../utils/class-names.js';
|
|
3
4
|
/**
|
|
4
5
|
* Generic popover panel shell: a plain positioned wrapper around a list of
|
|
@@ -8,7 +9,9 @@ import { withClassName } from '../../utils/class-names.js';
|
|
|
8
9
|
* Origin: `PopoverMenu` from the vendored schedule/mention god-component
|
|
9
10
|
* (recon r6 §1.19) — generic, no product types.
|
|
10
11
|
*/
|
|
11
|
-
export function PopoverMenu({ children, className }) {
|
|
12
|
-
|
|
12
|
+
export function PopoverMenu({ children, className, ...agentProps }) {
|
|
13
|
+
const base = agentProps.agentHandle === false || agentProps['data-agent-private'] !== undefined
|
|
14
|
+
? undefined : agentProps.agentHandle ?? agentProps['data-agent-element'];
|
|
15
|
+
return _jsx("div", { ...agentHandleProps({}, { base, role: 'region' }), "data-agent-private": agentProps['data-agent-private'], "data-agent-page": agentProps['data-agent-page'], className: withClassName('jini-popover', className), children: children });
|
|
13
16
|
}
|
|
14
17
|
//# sourceMappingURL=PopoverMenu.js.map
|
|
@@ -11,12 +11,18 @@ export declare function resolveTabTarget({ panel, trigger, shiftKey }: {
|
|
|
11
11
|
trigger: HTMLElement | null;
|
|
12
12
|
shiftKey: boolean;
|
|
13
13
|
}, _optional?: Record<string, never>): HTMLElement | null;
|
|
14
|
-
/**
|
|
14
|
+
/** Explicit destinations win; otherwise keep native-dialog ownership before a host kit overlay. */
|
|
15
15
|
export declare function resolveSelectPortalContainer({ trigger }: {
|
|
16
16
|
trigger: HTMLElement | null;
|
|
17
|
-
}, { container }?: {
|
|
17
|
+
}, { container, fallbackContainer }?: {
|
|
18
18
|
container?: Element | DocumentFragment | null | undefined;
|
|
19
|
+
fallbackContainer?: Element | DocumentFragment | null | undefined;
|
|
19
20
|
}): Element | DocumentFragment;
|
|
21
|
+
/** Keep a portalled menu associated with the nearest page that owns its trigger.
|
|
22
|
+
* @complexity O(d) time and O(1) space in ancestor depth; a DOM read only. */
|
|
23
|
+
export declare function resolveSelectOriginPage({ trigger }: {
|
|
24
|
+
trigger: HTMLElement | null;
|
|
25
|
+
}, _optional?: Record<string, never>): string | undefined;
|
|
20
26
|
/** Pure containment decision; outside clicks must neither select an option nor steal focus. */
|
|
21
27
|
export declare function isSelectEventInside({ target, trigger, panel }: {
|
|
22
28
|
target: Node;
|
|
@@ -24,9 +24,14 @@ export function resolveTabTarget({ panel, trigger, shiftKey }, _optional = {}) {
|
|
|
24
24
|
const nextIndex = triggerIndex + (shiftKey ? -1 : 1);
|
|
25
25
|
return nodes[modalDialog ? (nextIndex + nodes.length) % nodes.length : nextIndex] ?? null;
|
|
26
26
|
}
|
|
27
|
-
/**
|
|
28
|
-
export function resolveSelectPortalContainer({ trigger }, { container } = {}) {
|
|
29
|
-
return container ?? trigger?.closest('dialog') ?? document.body;
|
|
27
|
+
/** Explicit destinations win; otherwise keep native-dialog ownership before a host kit overlay. */
|
|
28
|
+
export function resolveSelectPortalContainer({ trigger }, { container, fallbackContainer } = {}) {
|
|
29
|
+
return container ?? trigger?.closest('dialog') ?? fallbackContainer ?? document.body;
|
|
30
|
+
}
|
|
31
|
+
/** Keep a portalled menu associated with the nearest page that owns its trigger.
|
|
32
|
+
* @complexity O(d) time and O(1) space in ancestor depth; a DOM read only. */
|
|
33
|
+
export function resolveSelectOriginPage({ trigger }, _optional = {}) {
|
|
34
|
+
return trigger?.closest('[data-agent-page]')?.getAttribute('data-agent-page') ?? undefined;
|
|
30
35
|
}
|
|
31
36
|
/** Pure containment decision; outside clicks must neither select an option nor steal focus. */
|
|
32
37
|
export function isSelectEventInside({ target, trigger, panel }, _optional = {}) {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Shared controls preserve explicit names; `false` suppresses automatic addressing. */
|
|
2
|
+
export interface AgentControlProps {
|
|
3
|
+
readonly agentHandle?: string | false | undefined;
|
|
4
|
+
readonly 'data-agent-element'?: string | undefined;
|
|
5
|
+
readonly 'data-agent-private'?: string | boolean | undefined;
|
|
6
|
+
readonly 'data-agent-page'?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a mounted control's stable address without using labels or list positions.
|
|
10
|
+
* React instance identity distinguishes roots and survives rerenders/keyed reordering;
|
|
11
|
+
* remounts may receive a new address. Semantic privacy and opt-out take precedence.
|
|
12
|
+
* @param required - Explicit handle/markup or opt-out; private controls never get a handle.
|
|
13
|
+
* @returns The supplied name, a bounded automatic name, or undefined when excluded.
|
|
14
|
+
* @complexity O(n) in the React instance id; no I/O or DOM effects.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useAgentHandle(required: AgentControlProps, _optional?: Record<string, never>): string | undefined;
|
|
17
|
+
//# sourceMappingURL=useAgentHandle.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useId } from 'react';
|
|
2
|
+
import { agentHandleSegment } from '@jini-ai/agentic';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves a mounted control's stable address without using labels or list positions.
|
|
5
|
+
* React instance identity distinguishes roots and survives rerenders/keyed reordering;
|
|
6
|
+
* remounts may receive a new address. Semantic privacy and opt-out take precedence.
|
|
7
|
+
* @param required - Explicit handle/markup or opt-out; private controls never get a handle.
|
|
8
|
+
* @returns The supplied name, a bounded automatic name, or undefined when excluded.
|
|
9
|
+
* @complexity O(n) in the React instance id; no I/O or DOM effects.
|
|
10
|
+
*/
|
|
11
|
+
export function useAgentHandle(required, _optional = {}) {
|
|
12
|
+
const id = useId();
|
|
13
|
+
if (required.agentHandle === false || required['data-agent-private'] !== undefined)
|
|
14
|
+
return undefined;
|
|
15
|
+
return required.agentHandle ?? required['data-agent-element'] ?? `ui-${agentHandleSegment({ value: id })}`;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=useAgentHandle.js.map
|
package/dist/styles/admin.css
CHANGED
|
@@ -247,6 +247,7 @@
|
|
|
247
247
|
.jini-scroll-jump__btn:hover { opacity: 1; color: var(--jini-text); }
|
|
248
248
|
.jini-scroll-jump__btn:focus-visible { opacity: 1; outline: 2px solid var(--jini-accent); outline-offset: 2px; }
|
|
249
249
|
@media (prefers-reduced-motion: reduce) { .jini-scroll-jump__btn { transition: none; } }
|
|
250
|
+
@media (max-width: 640px) { .jini-scroll-jump__btn { width: 44px; height: 44px; } }
|
|
250
251
|
|
|
251
252
|
.tab-bar { display: flex; flex-wrap: wrap; gap: 0.3rem; border-bottom: 1px solid var(--jini-border); margin-bottom: 1.3rem; }
|
|
252
253
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jini-ai/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Generic, product-neutral React UI primitives and feature domains. Framework-free types, decision rules, catalogs, and host port contracts live behind ./core (no React, no DOM). The Excalidraw and Lexical editors live behind ./sketch-editor and ./lexical-rich-text-editor; the GrapesJS-backed inline HTML editor lives behind ./html-editor.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -22,6 +22,8 @@
|
|
|
22
22
|
"./mcp-ui": "browser",
|
|
23
23
|
"./mcp-ui/surfaces": "universal",
|
|
24
24
|
"./mcp-ui/secret-card": "universal",
|
|
25
|
+
"./mcp-ui/sign-in-card": "universal",
|
|
26
|
+
"./mcp-ui/cards": "universal",
|
|
25
27
|
"./interactive-ui": "browser",
|
|
26
28
|
"./interactive-ui/manifests": "universal",
|
|
27
29
|
"./a2ui": "browser",
|
|
@@ -36,12 +38,15 @@
|
|
|
36
38
|
"./fetch-query": "browser",
|
|
37
39
|
"./fetch-query/tanstack": "browser",
|
|
38
40
|
"./tab-strip": "browser",
|
|
41
|
+
"./site-card": "browser",
|
|
42
|
+
"./site-card.css": "browser",
|
|
39
43
|
"./admin-widgets.css": "browser",
|
|
40
44
|
"./theme": "browser",
|
|
41
45
|
"./styles/*": "browser",
|
|
42
46
|
"./charts": "universal",
|
|
43
47
|
"./charts/browser": "browser",
|
|
44
|
-
"./charts/react": "browser"
|
|
48
|
+
"./charts/react": "browser",
|
|
49
|
+
"./mcp-ui/credential-card": "universal"
|
|
45
50
|
},
|
|
46
51
|
"isolation": {
|
|
47
52
|
"entries": {
|
|
@@ -132,6 +137,16 @@
|
|
|
132
137
|
"import": "./dist/features/mcp-ui/secret-card.js",
|
|
133
138
|
"default": "./dist/features/mcp-ui/secret-card.js"
|
|
134
139
|
},
|
|
140
|
+
"./mcp-ui/sign-in-card": {
|
|
141
|
+
"types": "./dist/features/mcp-ui/sign-in-card.d.ts",
|
|
142
|
+
"import": "./dist/features/mcp-ui/sign-in-card.js",
|
|
143
|
+
"default": "./dist/features/mcp-ui/sign-in-card.js"
|
|
144
|
+
},
|
|
145
|
+
"./mcp-ui/cards": {
|
|
146
|
+
"types": "./dist/features/mcp-ui/cards.d.ts",
|
|
147
|
+
"import": "./dist/features/mcp-ui/cards.js",
|
|
148
|
+
"default": "./dist/features/mcp-ui/cards.js"
|
|
149
|
+
},
|
|
135
150
|
"./interactive-ui": {
|
|
136
151
|
"types": "./dist/features/interactive-ui/index.d.ts",
|
|
137
152
|
"import": "./dist/features/interactive-ui/index.js",
|
|
@@ -186,6 +201,12 @@
|
|
|
186
201
|
"import": "./dist/features/panel-kit/fetch-query/tanstack.js",
|
|
187
202
|
"default": "./dist/features/panel-kit/fetch-query/tanstack.js"
|
|
188
203
|
},
|
|
204
|
+
"./site-card": {
|
|
205
|
+
"types": "./dist/features/site-card/index.d.ts",
|
|
206
|
+
"import": "./dist/features/site-card/index.js",
|
|
207
|
+
"default": "./dist/features/site-card/index.js"
|
|
208
|
+
},
|
|
209
|
+
"./site-card.css": "./dist/features/site-card/site-card.css",
|
|
189
210
|
"./tab-strip": {
|
|
190
211
|
"types": "./dist/features/tab-strip/index.d.ts",
|
|
191
212
|
"import": "./dist/features/tab-strip/index.js",
|
|
@@ -212,6 +233,11 @@
|
|
|
212
233
|
"types": "./dist/features/charts/react.d.ts",
|
|
213
234
|
"import": "./dist/features/charts/react.js",
|
|
214
235
|
"default": "./dist/features/charts/react.js"
|
|
236
|
+
},
|
|
237
|
+
"./mcp-ui/credential-card": {
|
|
238
|
+
"types": "./dist/features/mcp-ui/credential-card.d.ts",
|
|
239
|
+
"import": "./dist/features/mcp-ui/credential-card.js",
|
|
240
|
+
"default": "./dist/features/mcp-ui/credential-card.js"
|
|
215
241
|
}
|
|
216
242
|
},
|
|
217
243
|
"files": [
|
|
@@ -263,19 +289,19 @@
|
|
|
263
289
|
"shiki": "^1.24.4",
|
|
264
290
|
"tailwind-merge": "^2.6.0",
|
|
265
291
|
"zod": "^3.25.76",
|
|
266
|
-
"@jini-ai/
|
|
267
|
-
"@jini-ai/
|
|
268
|
-
"@jini-ai/
|
|
269
|
-
"@jini-ai/
|
|
270
|
-
"@jini-ai/
|
|
292
|
+
"@jini-ai/platform": "^0.7.0",
|
|
293
|
+
"@jini-ai/core": "^0.7.0",
|
|
294
|
+
"@jini-ai/agentic": "^0.7.0",
|
|
295
|
+
"@jini-ai/integrations": "^0.7.0",
|
|
296
|
+
"@jini-ai/agent-runtime": "^0.7.0"
|
|
271
297
|
},
|
|
272
298
|
"dependencies": {
|
|
273
299
|
"micromark": "^4.0.0",
|
|
274
300
|
"micromark-extension-gfm": "^3.0.0",
|
|
275
|
-
"@jini-ai/ui-kit": "^0.
|
|
276
|
-
"@jini-ai/core": "^0.
|
|
277
|
-
"@jini-ai/platform": "^0.
|
|
278
|
-
"@jini-ai/agentic": "^0.
|
|
301
|
+
"@jini-ai/ui-kit": "^0.7.0",
|
|
302
|
+
"@jini-ai/core": "^0.7.0",
|
|
303
|
+
"@jini-ai/platform": "^0.7.0",
|
|
304
|
+
"@jini-ai/agentic": "^0.7.0"
|
|
279
305
|
},
|
|
280
306
|
"peerDependencies": {
|
|
281
307
|
"@tanstack/react-query": "^5.0.0",
|
|
@@ -356,7 +382,7 @@
|
|
|
356
382
|
}
|
|
357
383
|
},
|
|
358
384
|
"scripts": {
|
|
359
|
-
"build": "node scripts/generate-agent-icon-data-uris.mjs && tsc -p tsconfig.json && mkdir -p dist/react/components/remixicon-font dist/features/settings/dialog/styles dist/features/tabbed-dialog/styles && cp src/react/components/remixicon-font/remixicon.css src/react/components/remixicon-font/remixicon.woff2 dist/react/components/remixicon-font/ && cp src/features/settings/dialog/styles/settings-dialog.css dist/features/settings/dialog/styles/ && cp src/features/tabbed-dialog/styles/tabbed-dialog.css dist/features/tabbed-dialog/styles/ && npx @tailwindcss/cli -i src/features/interactive-ui/styles.css -o dist/features/interactive-ui/interactive-ui.css --minify && mkdir -p dist/features/admin-widgets/styles && cp src/features/admin-widgets/styles/admin-widgets.css dist/features/admin-widgets/styles/ && mkdir -p dist/styles && cp src/styles/*.css dist/styles/",
|
|
385
|
+
"build": "node scripts/generate-agent-icon-data-uris.mjs && tsc -p tsconfig.json && mkdir -p dist/react/components/remixicon-font dist/features/settings/dialog/styles dist/features/tabbed-dialog/styles && cp src/react/components/remixicon-font/remixicon.css src/react/components/remixicon-font/remixicon.woff2 dist/react/components/remixicon-font/ && cp src/features/settings/dialog/styles/settings-dialog.css dist/features/settings/dialog/styles/ && cp src/features/tabbed-dialog/styles/tabbed-dialog.css dist/features/tabbed-dialog/styles/ && npx @tailwindcss/cli -i src/features/interactive-ui/styles.css -o dist/features/interactive-ui/interactive-ui.css --minify && mkdir -p dist/features/admin-widgets/styles && cp src/features/admin-widgets/styles/admin-widgets.css dist/features/admin-widgets/styles/ && mkdir -p dist/styles && cp src/styles/*.css dist/styles/ && mkdir -p dist/features/site-card && cp src/features/site-card/site-card.css dist/features/site-card/",
|
|
360
386
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
361
387
|
"test": "vitest run",
|
|
362
388
|
"test:coverage": "vitest run --coverage"
|