@ekanos/sdk 0.28.0 → 0.30.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/api-report.md +3 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/lazy-component.d.ts +27 -0
- package/dist/components/lazy-component.js +35 -0
- package/dist/components/lazy-component.js.map +1 -0
- package/dist/components/widgets/ai-prompt-chip.d.ts +1 -1
- package/dist/components/widgets/ai-prompt-chip.js +4 -4
- package/dist/components/widgets/ai-prompt-chip.js.map +1 -1
- package/dist/components/widgets/widget-ask-bar.js +1 -1
- package/dist/components/widgets/widget-ask-bar.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/eslint.design-rules.mjs +42 -6
- package/package.json +8 -8
package/api-report.md
CHANGED
|
@@ -9,7 +9,7 @@ This is the complete surface of every entrypoint. The authoring guide
|
|
|
9
9
|
for these symbols is README.md. Entrypoints marked WORKSPACE-ONLY are
|
|
10
10
|
not reachable from a published install — see the note in each section.
|
|
11
11
|
|
|
12
|
-
Total exported names: **
|
|
12
|
+
Total exported names: **377** across 12 entrypoints.
|
|
13
13
|
|
|
14
14
|
## `@ekanos/sdk` (39 exports)
|
|
15
15
|
|
|
@@ -55,7 +55,7 @@ Total exported names: **376** across 12 entrypoints.
|
|
|
55
55
|
| `WidgetVerdictTone` | type alias |
|
|
56
56
|
| `WorkspaceTargetDefinition` | interface |
|
|
57
57
|
|
|
58
|
-
## `@ekanos/sdk/components` (
|
|
58
|
+
## `@ekanos/sdk/components` (46 exports)
|
|
59
59
|
|
|
60
60
|
| Export | Kind |
|
|
61
61
|
| --- | --- |
|
|
@@ -101,6 +101,7 @@ Total exported names: **376** across 12 entrypoints.
|
|
|
101
101
|
| `WidgetState` | interface |
|
|
102
102
|
| `WidgetStateAction` | interface |
|
|
103
103
|
| `currentReturnPath` | function |
|
|
104
|
+
| `lazyComponent` | function |
|
|
104
105
|
| `useWidgetVerdict` | function |
|
|
105
106
|
| `widgetQueryState` | function |
|
|
106
107
|
| `widgetQueryStatus` | function |
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
export { Widget, useWidgetVerdict, type WidgetDataStatus, type WidgetHeaderTrailing, } from './widgets/widget.js';
|
|
29
29
|
export { widgetQueryState, widgetQueryStatus, type WidgetConnectionGate, type WidgetQuery, type WidgetQueryState, } from './widgets/widget-query-state.js';
|
|
30
30
|
export { WidgetContext, type WidgetActions, type WidgetContextValue, type WidgetData, type WidgetHealth, type WidgetMeta, type WidgetRenderState, type WidgetSource, type WidgetState, } from './widgets/widget-context.js';
|
|
31
|
+
export { lazyComponent } from './lazy-component.js';
|
|
31
32
|
export { WidgetPreviewProvider } from './widgets/widget-preview-provider.js';
|
|
32
33
|
export type { WidgetPreviewProviderProps } from './widgets/widget-preview-provider.js';
|
|
33
34
|
export { AiPromptChip } from './widgets/ai-prompt-chip.js';
|
package/dist/components/index.js
CHANGED
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
export { Widget, useWidgetVerdict, } from './widgets/widget.js';
|
|
29
29
|
export { widgetQueryState, widgetQueryStatus, } from './widgets/widget-query-state.js';
|
|
30
30
|
export { WidgetContext, } from './widgets/widget-context.js';
|
|
31
|
+
export { lazyComponent } from './lazy-component.js';
|
|
31
32
|
export { WidgetPreviewProvider } from './widgets/widget-preview-provider.js';
|
|
32
33
|
export { AiPromptChip } from './widgets/ai-prompt-chip.js';
|
|
33
34
|
export { AskIcon } from './widgets/ask-icon.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,MAAM,EACN,gBAAgB,GAGjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,GAIlB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,aAAa,GASd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,6BAA6B,GAE9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iBAAiB,EAEjB,mBAAmB,GAKpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAK5E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/**\n * @ekanos/sdk/components — client-side building blocks.\n *\n * Import from client components only. `Widget` is the compound API every\n * dashboard widget renders through; the activation forms are the two\n * sanctioned activation UX bases (credential-style and OAuth-style), and\n * `BaseMarketplaceTile` is the matching base for the marketplace tile.\n *\n * The SDK OWNS these implementations — the pre-inversion re-exports through\n * `@kit/integrations-core/components/*` are gone; core now re-exports FROM\n * here for first-party code (one source of truth, two consumption paths —\n * one source of truth with two consumption paths. UI primitives come from\n * `@ekanos/ui`\n * (the published slice of the host design system), never `@kit/ui`.\n *\n * Server seam: nothing here imports a server module. `OAuthActivationForm`\n * performs activation through the host-injected actions seam\n * (`IntegrationActivationProvider`, @ekanos/sdk/hooks) — a server-action\n * REFERENCE bound by the host, not server code shipped to the browser.\n *\n * `WidgetContext` is the single context identity both sides share: the\n * host's `DashboardWidgetProvider` (host chrome — persistence callbacks,\n * config hierarchy) provides it, the SDK's `Widget.*` reads it.\n *\n * Surface discipline: additions require an entry in\n * api-report.md, regenerated by `pnpm --filter @ekanos/sdk api-report`.\n */\n\nexport {\n Widget,\n useWidgetVerdict,\n type WidgetDataStatus,\n type WidgetHeaderTrailing,\n} from './widgets/widget';\nexport {\n widgetQueryState,\n widgetQueryStatus,\n type WidgetConnectionGate,\n type WidgetQuery,\n type WidgetQueryState,\n} from './widgets/widget-query-state';\nexport {\n WidgetContext,\n type WidgetActions,\n type WidgetContextValue,\n type WidgetData,\n type WidgetHealth,\n type WidgetMeta,\n type WidgetRenderState,\n type WidgetSource,\n type WidgetState,\n} from './widgets/widget-context';\nexport { WidgetPreviewProvider } from './widgets/widget-preview-provider';\n\nexport type { WidgetPreviewProviderProps } from './widgets/widget-preview-provider';\nexport { AiPromptChip } from './widgets/ai-prompt-chip';\nexport { AskIcon } from './widgets/ask-icon';\nexport { WidgetAskBar } from './widgets/widget-ask-bar';\nexport {\n WidgetAskPresentationProvider,\n type WidgetAskPresentation,\n} from './widgets/widget-ask-presentation';\nexport {\n WidgetDataLoading,\n type WidgetEmptyStateProps,\n WidgetInactiveState,\n type WidgetInactiveReason,\n type WidgetInactiveStateProps,\n type WidgetSkeletonVariant,\n type WidgetStateAction,\n} from './widgets/widget-state-components';\n\nexport { ActivationForm, BaseActivationForm } from './base-activation-form';\nexport type {\n ActivationFormComponentProps,\n BaseActivationFormProps,\n} from './base-activation-form';\nexport {\n ActivationDialog,\n ActivationInline,\n BaseActivationDialog,\n} from './base-activation-dialog';\n\nexport { BaseMarketplaceTile } from './base-marketplace-tile';\nexport type { BaseMarketplaceTileProps } from './base-marketplace-tile';\n\nexport { OAuthActivationForm } from './oauth-activation-form';\nexport type { OAuthActivationFormConfig } from './oauth-activation-form';\n\nexport { FIRST_CONNECT_PARAM, currentReturnPath } from './current-return-path';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,MAAM,EACN,gBAAgB,GAGjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,GAIlB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,aAAa,GASd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EACL,6BAA6B,GAE9B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iBAAiB,EAEjB,mBAAmB,GAKpB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAK5E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC","sourcesContent":["/**\n * @ekanos/sdk/components — client-side building blocks.\n *\n * Import from client components only. `Widget` is the compound API every\n * dashboard widget renders through; the activation forms are the two\n * sanctioned activation UX bases (credential-style and OAuth-style), and\n * `BaseMarketplaceTile` is the matching base for the marketplace tile.\n *\n * The SDK OWNS these implementations — the pre-inversion re-exports through\n * `@kit/integrations-core/components/*` are gone; core now re-exports FROM\n * here for first-party code (one source of truth, two consumption paths —\n * one source of truth with two consumption paths. UI primitives come from\n * `@ekanos/ui`\n * (the published slice of the host design system), never `@kit/ui`.\n *\n * Server seam: nothing here imports a server module. `OAuthActivationForm`\n * performs activation through the host-injected actions seam\n * (`IntegrationActivationProvider`, @ekanos/sdk/hooks) — a server-action\n * REFERENCE bound by the host, not server code shipped to the browser.\n *\n * `WidgetContext` is the single context identity both sides share: the\n * host's `DashboardWidgetProvider` (host chrome — persistence callbacks,\n * config hierarchy) provides it, the SDK's `Widget.*` reads it.\n *\n * Surface discipline: additions require an entry in\n * api-report.md, regenerated by `pnpm --filter @ekanos/sdk api-report`.\n */\n\nexport {\n Widget,\n useWidgetVerdict,\n type WidgetDataStatus,\n type WidgetHeaderTrailing,\n} from './widgets/widget';\nexport {\n widgetQueryState,\n widgetQueryStatus,\n type WidgetConnectionGate,\n type WidgetQuery,\n type WidgetQueryState,\n} from './widgets/widget-query-state';\nexport {\n WidgetContext,\n type WidgetActions,\n type WidgetContextValue,\n type WidgetData,\n type WidgetHealth,\n type WidgetMeta,\n type WidgetRenderState,\n type WidgetSource,\n type WidgetState,\n} from './widgets/widget-context';\nexport { lazyComponent } from './lazy-component';\nexport { WidgetPreviewProvider } from './widgets/widget-preview-provider';\n\nexport type { WidgetPreviewProviderProps } from './widgets/widget-preview-provider';\nexport { AiPromptChip } from './widgets/ai-prompt-chip';\nexport { AskIcon } from './widgets/ask-icon';\nexport { WidgetAskBar } from './widgets/widget-ask-bar';\nexport {\n WidgetAskPresentationProvider,\n type WidgetAskPresentation,\n} from './widgets/widget-ask-presentation';\nexport {\n WidgetDataLoading,\n type WidgetEmptyStateProps,\n WidgetInactiveState,\n type WidgetInactiveReason,\n type WidgetInactiveStateProps,\n type WidgetSkeletonVariant,\n type WidgetStateAction,\n} from './widgets/widget-state-components';\n\nexport { ActivationForm, BaseActivationForm } from './base-activation-form';\nexport type {\n ActivationFormComponentProps,\n BaseActivationFormProps,\n} from './base-activation-form';\nexport {\n ActivationDialog,\n ActivationInline,\n BaseActivationDialog,\n} from './base-activation-dialog';\n\nexport { BaseMarketplaceTile } from './base-marketplace-tile';\nexport type { BaseMarketplaceTileProps } from './base-marketplace-tile';\n\nexport { OAuthActivationForm } from './oauth-activation-form';\nexport type { OAuthActivationFormConfig } from './oauth-activation-form';\n\nexport { FIRST_CONNECT_PARAM, currentReturnPath } from './current-return-path';\n"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ComponentType, type FunctionComponent } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A component whose code loads only when it renders.
|
|
4
|
+
*
|
|
5
|
+
* The host loads every integration's definition on the server for every page,
|
|
6
|
+
* and a component imported statically by `integration.ts` ships to the
|
|
7
|
+
* browser on every page with it. Declare each widget, page, activation form
|
|
8
|
+
* and marketplace tile through this instead, from a `'use client'` file of
|
|
9
|
+
* your own, so its code is fetched when it is on screen:
|
|
10
|
+
*
|
|
11
|
+
* ```tsx
|
|
12
|
+
* // src/components/lazy.tsx
|
|
13
|
+
* 'use client';
|
|
14
|
+
*
|
|
15
|
+
* import { lazyComponent } from '@ekanos/sdk/components';
|
|
16
|
+
*
|
|
17
|
+
* export const ForecastWidget = lazyComponent(() =>
|
|
18
|
+
* import(
|
|
19
|
+
* './widgets/forecast-widget'
|
|
20
|
+
* ).then((m) => m.ForecastWidget),
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* The `'use client'` line and the literal `import()` path are both required:
|
|
25
|
+
* without either, the bundler cannot split the component out.
|
|
26
|
+
*/
|
|
27
|
+
export declare function lazyComponent<Props extends object>(load: () => Promise<ComponentType<Props>>): FunctionComponent<Props>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { Suspense, lazy, createElement, } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* A component whose code loads only when it renders.
|
|
5
|
+
*
|
|
6
|
+
* The host loads every integration's definition on the server for every page,
|
|
7
|
+
* and a component imported statically by `integration.ts` ships to the
|
|
8
|
+
* browser on every page with it. Declare each widget, page, activation form
|
|
9
|
+
* and marketplace tile through this instead, from a `'use client'` file of
|
|
10
|
+
* your own, so its code is fetched when it is on screen:
|
|
11
|
+
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* // src/components/lazy.tsx
|
|
14
|
+
* 'use client';
|
|
15
|
+
*
|
|
16
|
+
* import { lazyComponent } from '@ekanos/sdk/components';
|
|
17
|
+
*
|
|
18
|
+
* export const ForecastWidget = lazyComponent(() =>
|
|
19
|
+
* import(
|
|
20
|
+
* './widgets/forecast-widget'
|
|
21
|
+
* ).then((m) => m.ForecastWidget),
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* The `'use client'` line and the literal `import()` path are both required:
|
|
26
|
+
* without either, the bundler cannot split the component out.
|
|
27
|
+
*/
|
|
28
|
+
export function lazyComponent(load) {
|
|
29
|
+
const Loaded = lazy(() => load().then((component) => ({ default: component })));
|
|
30
|
+
function LazyComponent(props) {
|
|
31
|
+
return createElement(Suspense, { fallback: null }, createElement(Loaded, props));
|
|
32
|
+
}
|
|
33
|
+
return LazyComponent;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=lazy-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-component.js","sourceRoot":"","sources":["../../src/components/lazy-component.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAIL,QAAQ,EACR,IAAI,EACJ,aAAa,GACd,MAAM,OAAO,CAAC;AAEf;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAyC;IAEzC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,EAAE,CACvB,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CACrD,CAAC;IAEF,SAAS,aAAa,CAAC,KAAY;QACjC,OAAO,aAAa,CAClB,QAAQ,EACR,EAAE,QAAQ,EAAE,IAAI,EAAE,EAClB,aAAa,CAAC,MAA8B,EAAE,KAAK,CAAC,CACrD,CAAC;IACJ,CAAC;IAED,OAAO,aAAa,CAAC;AACvB,CAAC","sourcesContent":["'use client';\n\nimport {\n type ComponentType,\n type FunctionComponent,\n type JSX,\n Suspense,\n lazy,\n createElement,\n} from 'react';\n\n/**\n * A component whose code loads only when it renders.\n *\n * The host loads every integration's definition on the server for every page,\n * and a component imported statically by `integration.ts` ships to the\n * browser on every page with it. Declare each widget, page, activation form\n * and marketplace tile through this instead, from a `'use client'` file of\n * your own, so its code is fetched when it is on screen:\n *\n * ```tsx\n * // src/components/lazy.tsx\n * 'use client';\n *\n * import { lazyComponent } from '@ekanos/sdk/components';\n *\n * export const ForecastWidget = lazyComponent(() =>\n * import(\n * './widgets/forecast-widget'\n * ).then((m) => m.ForecastWidget),\n * );\n * ```\n *\n * The `'use client'` line and the literal `import()` path are both required:\n * without either, the bundler cannot split the component out.\n */\nexport function lazyComponent<Props extends object>(\n load: () => Promise<ComponentType<Props>>,\n): FunctionComponent<Props> {\n const Loaded = lazy(() =>\n load().then((component) => ({ default: component })),\n );\n\n function LazyComponent(props: Props): JSX.Element {\n return createElement(\n Suspense,\n { fallback: null },\n createElement(Loaded as ComponentType<Props>, props),\n );\n }\n\n return LazyComponent;\n}\n"]}
|
|
@@ -24,7 +24,7 @@ type AiPromptChipProps = {
|
|
|
24
24
|
*
|
|
25
25
|
* Variants:
|
|
26
26
|
* - header (Type A): Compact icon button for widget headers
|
|
27
|
-
* - inline (Type B): Chip with
|
|
27
|
+
* - inline (Type B): Chip with a chat icon + text, below data sections
|
|
28
28
|
* - footer (Type C): Full-width chip in drawer footers
|
|
29
29
|
*/
|
|
30
30
|
export declare function AiPromptChip({ label, prompt, context, sourceWidget, title, onAfterAsk, variant, className, }: AiPromptChipProps): import("react").JSX.Element;
|
|
@@ -12,7 +12,7 @@ import { useAskAssistant } from '../../hooks/ask-assistant-context.js';
|
|
|
12
12
|
*
|
|
13
13
|
* Variants:
|
|
14
14
|
* - header (Type A): Compact icon button for widget headers
|
|
15
|
-
* - inline (Type B): Chip with
|
|
15
|
+
* - inline (Type B): Chip with a chat icon + text, below data sections
|
|
16
16
|
* - footer (Type C): Full-width chip in drawer footers
|
|
17
17
|
*/
|
|
18
18
|
export function AiPromptChip({ label, prompt, context, sourceWidget, title, onAfterAsk, variant = 'inline', className, }) {
|
|
@@ -27,12 +27,12 @@ export function AiPromptChip({ label, prompt, context, sourceWidget, title, onAf
|
|
|
27
27
|
onAfterAsk === null || onAfterAsk === void 0 ? void 0 : onAfterAsk();
|
|
28
28
|
};
|
|
29
29
|
if (variant === 'header') {
|
|
30
|
-
return (_jsx(Button, { variant: "ghost", size: "icon-sm", className: cn('p-0', className), onClick: handleClick, "aria-label": `Ask AI: ${label}`, children: _jsx(Icon, { name: "
|
|
30
|
+
return (_jsx(Button, { variant: "ghost", size: "icon-sm", className: cn('p-0', className), onClick: handleClick, "aria-label": `Ask AI: ${label}`, children: _jsx(Icon, { name: "chat-circle-text", className: "h-4 w-4" }) }));
|
|
31
31
|
}
|
|
32
32
|
if (variant === 'footer') {
|
|
33
|
-
return (_jsxs(Button, { type: "button", variant: "outline", onClick: handleClick, className: cn('h-auto w-full justify-start rounded-lg px-4 py-3 whitespace-normal', className), "aria-label": label, children: [_jsx(Icon, { name: "
|
|
33
|
+
return (_jsxs(Button, { type: "button", variant: "outline", onClick: handleClick, className: cn('h-auto w-full justify-start rounded-lg px-4 py-3 whitespace-normal', className), "aria-label": label, children: [_jsx(Icon, { name: "chat-circle-text", className: "h-4 w-4 shrink-0" }), _jsx("span", { className: "text-left", children: label })] }));
|
|
34
34
|
}
|
|
35
35
|
// inline (Type B)
|
|
36
|
-
return (_jsxs(Button, { type: "button", variant: "outline", size: "xs", onClick: handleClick, className: cn('px-3', className), "aria-label": label, children: [_jsx(Icon, { name: "
|
|
36
|
+
return (_jsxs(Button, { type: "button", variant: "outline", size: "xs", onClick: handleClick, className: cn('px-3', className), "aria-label": label, children: [_jsx(Icon, { name: "chat-circle-text", className: "h-3.5 w-3.5 shrink-0" }), _jsx("span", { children: label })] }));
|
|
37
37
|
}
|
|
38
38
|
//# sourceMappingURL=ai-prompt-chip.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-prompt-chip.js","sourceRoot":"","sources":["../../../src/components/widgets/ai-prompt-chip.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAqBpE;;;;;;;;;;GAUG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,MAAM,EACN,OAAO,EACP,YAAY,EACZ,KAAK,EACL,UAAU,EACV,OAAO,GAAG,QAAQ,EAClB,SAAS,GACS;IAClB,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,MAAM,WAAW,GAAG,GAAG,EAAE;QACvB,YAAY,CAAC;YACX,QAAQ,EAAE,YAAY;YACtB,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,KAAK;YACrB,QAAQ,EAAE,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE;YACvB,eAAe,EAAE,MAAM;SACxB,CAAC,CAAC;QACH,UAAU,aAAV,UAAU,uBAAV,UAAU,EAAI,CAAC;IACjB,CAAC,CAAC;IAEF,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,CACL,KAAC,MAAM,IACL,OAAO,EAAC,OAAO,EACf,IAAI,EAAC,SAAS,EACd,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,S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GAC7C,CACV,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,OAAO,CACL,MAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,EAAE,CACX,oEAAoE,EACpE,SAAS,CACV,gBACW,KAAK,aAEjB,KAAC,IAAI,IAAC,IAAI,EAAC,kBAAkB,EAAC,SAAS,EAAC,kBAAkB,GAAG,EAC7D,eAAM,SAAS,EAAC,WAAW,YAAE,KAAK,GAAQ,IACnC,CACV,CAAC;IACJ,CAAC;IAED,kBAAkB;IAClB,OAAO,CACL,MAAC,MAAM,IACL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,WAAW,EACpB,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,gBACpB,KAAK,aAEjB,KAAC,IAAI,IAAC,IAAI,EAAC,kBAAkB,EAAC,SAAS,EAAC,sBAAsB,GAAG,EACjE,yBAAO,KAAK,GAAQ,IACb,CACV,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { Button } from '@ekanos/ui/button';\nimport { Icon } from '@ekanos/ui/icon';\nimport { cn } from '@ekanos/ui/utils';\n\nimport { useAskAssistant } from '../../hooks/ask-assistant-context';\n\ntype AiPromptChipProps = {\n label: string;\n prompt: string;\n context?: Record<string, unknown>;\n sourceWidget: string;\n /**\n * Human-readable label for the dock's ArrivalChip (\"Asking about …\").\n * Falls back to the chip's display label when omitted.\n */\n title?: string;\n /**\n * Fires after the assistant has been invoked. Drawers pass their close\n * handler here so the dock takes over the screen on click.\n */\n onAfterAsk?: () => void;\n variant?: 'header' | 'inline' | 'footer';\n className?: string;\n};\n\n/**\n * AI handoff chip that opens the assistant dock pre-seeded with this\n * widget/drawer's snapshot. Routes through `useAskAssistant` so the dock\n * receives the standard `{widgetId, title, snapshot, suggestedPrompt}`\n * shape used by all AI handoffs in the app.\n *\n * Variants:\n * - header (Type A): Compact icon button for widget headers\n * - inline (Type B): Chip with a chat icon + text, below data sections\n * - footer (Type C): Full-width chip in drawer footers\n */\nexport function AiPromptChip({\n label,\n prompt,\n context,\n sourceWidget,\n title,\n onAfterAsk,\n variant = 'inline',\n className,\n}: AiPromptChipProps) {\n const askAssistant = useAskAssistant();\n\n const handleClick = () => {\n askAssistant({\n widgetId: sourceWidget,\n title: title ?? label,\n snapshot: context ?? {},\n suggestedPrompt: prompt,\n });\n onAfterAsk?.();\n };\n\n if (variant === 'header') {\n return (\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n className={cn('p-0', className)}\n onClick={handleClick}\n aria-label={`Ask AI: ${label}`}\n >\n <Icon name=\"chat-circle-text\" className=\"h-4 w-4\" />\n </Button>\n );\n }\n\n if (variant === 'footer') {\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n onClick={handleClick}\n className={cn(\n 'h-auto w-full justify-start rounded-lg px-4 py-3 whitespace-normal',\n className,\n )}\n aria-label={label}\n >\n <Icon name=\"chat-circle-text\" className=\"h-4 w-4 shrink-0\" />\n <span className=\"text-left\">{label}</span>\n </Button>\n );\n }\n\n // inline (Type B)\n return (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"xs\"\n onClick={handleClick}\n className={cn('px-3', className)}\n aria-label={label}\n >\n <Icon name=\"chat-circle-text\" className=\"h-3.5 w-3.5 shrink-0\" />\n <span>{label}</span>\n </Button>\n );\n}\n"]}
|
|
@@ -53,7 +53,7 @@ export function WidgetAskBar({ context }) {
|
|
|
53
53
|
}, [dismiss, isActive]);
|
|
54
54
|
return (_jsxs("div", { ref: containerRef, className: "border-border shrink-0 border-t", "data-test": "widget-ask-bar", "data-write-action": true, children: [_jsxs(Button, { type: "button", variant: "ghost", onClick: () => (isActive ? dismiss() : setIsActive(true)), "aria-expanded": isActive, "aria-label": isActive
|
|
55
55
|
? `Close ask input for ${context.title}`
|
|
56
|
-
: `Ask about ${context.title}`, "data-test": "widget-ask-bar-toggle", className: "group/tag h-auto w-full justify-start gap-2.5 rounded-none px-4 py-2.5 text-left sm:px-5", children: [_jsx(AskIcon, { className: cn('text-muted-foreground h-5 w-5 shrink-0 transition-transform duration-200', isActive && 'scale-110') }), _jsx("span", { className: "text-muted-foreground group-hover/tag:text-foreground flex-1 text-base font-medium transition-colors", children: "Ask about this" }), _jsx(Icon, { name: "caret-up", className: cn('text-muted-foreground group-hover/tag:text-muted-foreground h-3.5 w-3.5 shrink-0 transition-transform duration-200', isActive && 'rotate-180') })] }), isActive && (_jsxs("div", { className: "border-border space-y-3 border-t p-3 sm:px-5", "data-test": "widget-ask-bar-input", children: [suggestions.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2", "data-test": "widget-ask-bar-suggestions", children: suggestions.map((s) => (
|
|
56
|
+
: `Ask about ${context.title}`, "data-test": "widget-ask-bar-toggle", className: "group/tag h-auto w-full justify-start gap-2.5 rounded-none px-4 py-2.5 text-left sm:px-5", children: [_jsx(AskIcon, { className: cn('text-muted-foreground h-5 w-5 shrink-0 transition-transform duration-200', isActive && 'scale-110') }), _jsx("span", { className: "text-muted-foreground group-hover/tag:text-foreground flex-1 text-base font-medium transition-colors", children: "Ask about this" }), _jsx(Icon, { name: "caret-up", className: cn('text-muted-foreground group-hover/tag:text-muted-foreground h-3.5 w-3.5 shrink-0 transition-transform duration-200', isActive && 'rotate-180') })] }), isActive && (_jsxs("div", { className: "border-border space-y-3 border-t p-3 sm:px-5", "data-test": "widget-ask-bar-input", children: [suggestions.length > 0 && (_jsx("div", { className: "flex flex-wrap gap-2", "data-test": "widget-ask-bar-suggestions", children: suggestions.map((s) => (_jsx(Button, { type: "button", variant: "outline", size: "xs", onClick: () => handleSuggestion(s.prompt), className: "px-3", "aria-label": s.label, children: _jsx("span", { className: "text-left", children: s.label }) }, s.label))) })), _jsxs(PromptInput, { onSubmit: handleSubmit, children: [_jsx(PromptInputBody, { children: _jsx(PromptInputTextarea, { autoFocus: true, placeholder: `Ask about ${context.title.toLowerCase()}…`, "aria-label": `Ask about ${context.title}`, onKeyDown: (e) => {
|
|
57
57
|
if (e.key === 'Escape') {
|
|
58
58
|
e.preventDefault();
|
|
59
59
|
dismiss();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-ask-bar.js","sourceRoot":"","sources":["../../../src/components/widgets/widget-ask-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EACL,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAMrC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,OAAO,EAAS;;IAC7C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAClD,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,MAAM,OAAO,GAAG,WAAW,CAAC,GAAG,EAAE;QAC/B,WAAW,CAAC,KAAK,CAAC,CAAC;IACrB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,YAAY,GAAG,WAAW,CAC9B,CAAC,OAAyB,EAAE,EAAE;QAC5B,MAAM,MAAM,GAAG,OAAO,C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,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,mBAC1C,QAAQ,gBAErB,QAAQ;oBACN,CAAC,CAAC,uBAAuB,OAAO,CAAC,KAAK,EAAE;oBACxC,CAAC,CAAC,aAAa,OAAO,CAAC,KAAK,EAAE,eAExB,uBAAuB,EACjC,SAAS,EAAC,0FAA0F,aAEpG,KAAC,OAAO,IACN,SAAS,EAAE,EAAE,CACX,0EAA0E,EAC1E,QAAQ,IAAI,WAAW,CACxB,GACD,EACF,eAAM,SAAS,EAAC,sGAAsG,+BAE/G,EACP,KAAC,IAAI,IACH,IAAI,EAAC,UAAU,EACf,SAAS,EAAE,EAAE,CACX,oHAAoH,EACpH,QAAQ,IAAI,YAAY,CACzB,GACD,IACK,EAER,QAAQ,IAAI,CACX,eACE,SAAS,EAAC,8CAA8C,eAC9C,sBAAsB,aAE/B,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,CACzB,cACE,SAAS,EAAC,sBAAsB,eACtB,4BAA4B,YAErC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACtB,
|
|
1
|
+
{"version":3,"file":"widget-ask-bar.js","sourceRoot":"","sources":["../../../src/components/widgets/widget-ask-bar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjE,OAAO,EACL,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,C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ACtB,KAAC,MAAM,IAEL,IAAI,EAAC,QAAQ,EACb,OAAO,EAAC,SAAS,EACjB,IAAI,EAAC,IAAI,EACT,OAAO,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,EACzC,SAAS,EAAC,MAAM,gBACJ,CAAC,CAAC,KAAK,YAEnB,eAAM,SAAS,EAAC,WAAW,YAAE,CAAC,CAAC,KAAK,GAAQ,IARvC,CAAC,CAAC,KAAK,CASL,CACV,CAAC,GACE,CACP,EACD,MAAC,WAAW,IAAC,QAAQ,EAAE,YAAY,aACjC,KAAC,eAAe,cACd,KAAC,mBAAmB,IAClB,SAAS,QACT,WAAW,EAAE,aAAa,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE,GAAG,gBAC5C,aAAa,OAAO,CAAC,KAAK,EAAE,EACxC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;wCACf,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,EAAE,CAAC;4CACvB,CAAC,CAAC,cAAc,EAAE,CAAC;4CACnB,OAAO,EAAE,CAAC;wCACZ,CAAC;oCACH,CAAC,GACD,GACc,EAClB,MAAC,iBAAiB,eAChB,KAAC,gBAAgB,KAAG,EACpB,KAAC,iBAAiB,iBAAW,qBAAqB,GAAG,IACnC,IACR,IACV,CACP,IACG,CACP,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\n\nimport {\n PromptInput,\n PromptInputBody,\n PromptInputFooter,\n PromptInputSubmit,\n PromptInputTextarea,\n PromptInputTools,\n} from '@ekanos/ui/ai-prompt-input';\nimport { Button } from '@ekanos/ui/button';\nimport { Icon } from '@ekanos/ui/icon';\nimport { cn } from '@ekanos/ui/utils';\n\nimport { useAskAssistant } from '../../hooks/ask-assistant-context';\nimport type { WidgetAskContext } from '../../types/widget-ask-context';\nimport { AskIcon } from './ask-icon';\n\ninterface Props {\n context: WidgetAskContext;\n}\n\n/**\n * Widget footer tag + expanding prompt input.\n *\n * - closed: a quiet, always-visible tag row at the bottom of the widget\n * (\"Aperture icon · Ask about this · chevron up\")\n * - open: clicking the tag reveals an inline `PromptInput` (the canonical\n * AI input component) below it. The tag itself doubles as the\n * close affordance (chevron rotates).\n *\n * Dismisses on click-outside or Escape. Submitting sends the user's typed\n * question (or the widget's suggestedPrompt fallback) to the assistant dock.\n */\nexport function WidgetAskBar({ context }: Props) {\n const [isActive, setIsActive] = useState(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const askAssistant = useAskAssistant();\n\n const dismiss = useCallback(() => {\n setIsActive(false);\n }, []);\n\n const handleSubmit = useCallback(\n (message: { text: string }) => {\n const prompt = message.text.trim() || context.suggestedPrompt;\n askAssistant({ ...context, suggestedPrompt: prompt });\n dismiss();\n },\n [askAssistant, context, dismiss],\n );\n\n const handleSuggestion = useCallback(\n (prompt: string) => {\n askAssistant({ ...context, suggestedPrompt: prompt });\n dismiss();\n },\n [askAssistant, context, dismiss],\n );\n\n const suggestions = context.suggestedPrompts ?? [];\n\n useEffect(() => {\n if (!isActive) return;\n const onPointerDown = (e: PointerEvent) => {\n const el = containerRef.current;\n if (!el) return;\n if (el.contains(e.target as Node)) return;\n dismiss();\n };\n document.addEventListener('pointerdown', onPointerDown);\n return () => document.removeEventListener('pointerdown', onPointerDown);\n }, [dismiss, isActive]);\n\n return (\n <div\n ref={containerRef}\n className=\"border-border shrink-0 border-t\"\n data-test=\"widget-ask-bar\"\n data-write-action\n >\n <Button\n type=\"button\"\n variant=\"ghost\"\n onClick={() => (isActive ? dismiss() : setIsActive(true))}\n aria-expanded={isActive}\n aria-label={\n isActive\n ? `Close ask input for ${context.title}`\n : `Ask about ${context.title}`\n }\n data-test=\"widget-ask-bar-toggle\"\n className=\"group/tag h-auto w-full justify-start gap-2.5 rounded-none px-4 py-2.5 text-left sm:px-5\"\n >\n <AskIcon\n className={cn(\n 'text-muted-foreground h-5 w-5 shrink-0 transition-transform duration-200',\n isActive && 'scale-110',\n )}\n />\n <span className=\"text-muted-foreground group-hover/tag:text-foreground flex-1 text-base font-medium transition-colors\">\n Ask about this\n </span>\n <Icon\n name=\"caret-up\"\n className={cn(\n 'text-muted-foreground group-hover/tag:text-muted-foreground h-3.5 w-3.5 shrink-0 transition-transform duration-200',\n isActive && 'rotate-180',\n )}\n />\n </Button>\n\n {isActive && (\n <div\n className=\"border-border space-y-3 border-t p-3 sm:px-5\"\n data-test=\"widget-ask-bar-input\"\n >\n {suggestions.length > 0 && (\n <div\n className=\"flex flex-wrap gap-2\"\n data-test=\"widget-ask-bar-suggestions\"\n >\n {suggestions.map((s) => (\n <Button\n key={s.label}\n type=\"button\"\n variant=\"outline\"\n size=\"xs\"\n onClick={() => handleSuggestion(s.prompt)}\n className=\"px-3\"\n aria-label={s.label}\n >\n <span className=\"text-left\">{s.label}</span>\n </Button>\n ))}\n </div>\n )}\n <PromptInput onSubmit={handleSubmit}>\n <PromptInputBody>\n <PromptInputTextarea\n autoFocus\n placeholder={`Ask about ${context.title.toLowerCase()}…`}\n aria-label={`Ask about ${context.title}`}\n onKeyDown={(e) => {\n if (e.key === 'Escape') {\n e.preventDefault();\n dismiss();\n }\n }}\n />\n </PromptInputBody>\n <PromptInputFooter>\n <PromptInputTools />\n <PromptInputSubmit data-test=\"widget-ask-bar-send\" />\n </PromptInputFooter>\n </PromptInput>\n </div>\n )}\n </div>\n );\n}\n"]}
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["/**\n * This package's own version, for diagnostics that must name which copy of\n * `@ekanos/sdk` is loaded. `src/__tests__/version.test.ts` fails when it drifts\n * from `package.json#version`; after `changeset version`, copy the new version\n * here.\n */\nexport const SDK_VERSION = '0.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,CAAC","sourcesContent":["/**\n * This package's own version, for diagnostics that must name which copy of\n * `@ekanos/sdk` is loaded. `src/__tests__/version.test.ts` fails when it drifts\n * from `package.json#version`; after `changeset version`, copy the new version\n * here.\n */\nexport const SDK_VERSION = '0.30.0';\n"]}
|
package/eslint.design-rules.mjs
CHANGED
|
@@ -118,6 +118,13 @@ function stringVisitors(test, message) {
|
|
|
118
118
|
const FONT_AWESOME_ICON =
|
|
119
119
|
/(?:^|[\s'"`])fa-(?:solid|regular|light|thin|duotone|brands|sharp)\s+fa-[a-z0-9]/;
|
|
120
120
|
|
|
121
|
+
/**
|
|
122
|
+
* The sparkle glyph as an icon value (`sparkle`, `sparkles`). No generic
|
|
123
|
+
* glyph stands in for AI (owner, 2026-11-17): where the assistant is, its own
|
|
124
|
+
* mark shows; elsewhere an AI control carries the icon of what it does.
|
|
125
|
+
*/
|
|
126
|
+
const SPARKLE_ICON = /^sparkles?(?::[a-z]+)?$/;
|
|
127
|
+
|
|
121
128
|
const BADGE_TONES = new Set(['success', 'warning', 'info']);
|
|
122
129
|
|
|
123
130
|
const TONE_BADGE_MESSAGE =
|
|
@@ -178,8 +185,19 @@ const SIZED_CONTROLS = new Set([
|
|
|
178
185
|
'Toggle',
|
|
179
186
|
'ToggleGroup',
|
|
180
187
|
'Badge',
|
|
188
|
+
'Avatar',
|
|
181
189
|
]);
|
|
182
190
|
|
|
191
|
+
/**
|
|
192
|
+
* Controls whose text size comes with their `size` step, so a text class at a
|
|
193
|
+
* call site sets one select or badge apart from the row it sits in.
|
|
194
|
+
*/
|
|
195
|
+
const SIZED_TEXT_CONTROLS = new Set(['SelectTrigger', 'Badge']);
|
|
196
|
+
|
|
197
|
+
/** `text-xs`, `sm:text-base`, `text-[13px]`; never a colour (`text-primary`). */
|
|
198
|
+
const CONTROL_TEXT_SIZE =
|
|
199
|
+
/^(?:(?:[\w-]+|[\w-]*\[[^\]&]*\][\w-]*)+:)*text-(?:xs|sm|base|lg|xl|[2-9]xl|\[[\d.]+(?:px|rem|em)\])$/;
|
|
200
|
+
|
|
183
201
|
/**
|
|
184
202
|
* `h-8`, `sm:h-7`, `min-h-11`, `size-8`, `h-[30px]`… but not `h-full`,
|
|
185
203
|
* `h-auto`, `h-fit`, `min-h-0`, and never a child selector (`[&_svg]:size-4`,
|
|
@@ -189,7 +207,7 @@ const CONTROL_HEIGHT =
|
|
|
189
207
|
/^(?:(?:[\w-]+|[\w-]*\[[^\]&]*\][\w-]*)+:)*(?:h|min-h|size)-(?!(?:full|auto|fit|min|max|0|px|screen|svh|dvh|lvh)$)\S+$/;
|
|
190
208
|
|
|
191
209
|
const CONTROL_HEIGHT_MESSAGE =
|
|
192
|
-
'A kit control takes its height from size, never a class: Button xs|sm|default|lg (icon-xs|icon-sm|icon|icon-lg), Input/SelectTrigger/InputGroup/ComboboxInput/TabsList/Toggle sm|default|lg (24/32/36/40px), Badge sm|default|lg; a phone hit area is Button touch (design-system sizes rule, Ekanos design system § Sizes).';
|
|
210
|
+
'A kit control takes its height from size, never a class: Button xs|sm|default|lg (icon-xs|icon-sm|icon|icon-lg), Input/SelectTrigger/InputGroup/ComboboxInput/TabsList/Toggle sm|default|lg (24/32/36/40px), Badge sm|default|lg, Avatar xs|sm|default|lg|xl (20/24/32/40/48px); a SelectTrigger or Badge takes its text size from size too; a phone hit area is Button touch (design-system sizes rule, Ekanos design system § Sizes).';
|
|
193
211
|
|
|
194
212
|
/**
|
|
195
213
|
* Every string literal in a className value, including inside `cn(...)`.
|
|
@@ -376,8 +394,7 @@ const RAW_SHADOW =
|
|
|
376
394
|
|
|
377
395
|
/**
|
|
378
396
|
* The words a steady, healthy state is labelled with. "Healthy" is the
|
|
379
|
-
* `clear` tone
|
|
380
|
-
* `success` is green and stays for an action that just finished ("Saved",
|
|
397
|
+
* `clear` tone; `success` stays for an action that just finished ("Saved",
|
|
381
398
|
* "Sent", "Paid"), which none of these words describe. `on` and `live` only
|
|
382
399
|
* count as the label's first word, so "Saved on Friday" is not a health label.
|
|
383
400
|
*/
|
|
@@ -433,7 +450,7 @@ const STATUS_ENTRY_KEYS = new Set([
|
|
|
433
450
|
]);
|
|
434
451
|
|
|
435
452
|
const SUCCESS_HEALTH_MESSAGE =
|
|
436
|
-
'A healthy state is tone="clear", not "success"
|
|
453
|
+
'A healthy state is tone="clear", not "success". Keep success for an action that just finished ("Saved", "Sent", "Paid").';
|
|
437
454
|
|
|
438
455
|
/**
|
|
439
456
|
* The text a JSX element's children spell, or null when any child is not a
|
|
@@ -795,6 +812,19 @@ export default {
|
|
|
795
812
|
'Write the Phosphor name (`house`, not `fa-solid fa-house`): icons are Phosphor, every one draws in the theme’s icon style, and a filled state glyph is `star:fill` (phosphoricons.com).',
|
|
796
813
|
),
|
|
797
814
|
},
|
|
815
|
+
'no-sparkle-icon': {
|
|
816
|
+
meta: {
|
|
817
|
+
type: 'problem',
|
|
818
|
+
docs: {
|
|
819
|
+
description:
|
|
820
|
+
'Disallow the sparkle icon; no generic glyph stands in for AI.',
|
|
821
|
+
},
|
|
822
|
+
},
|
|
823
|
+
create: stringVisitors(
|
|
824
|
+
SPARKLE_ICON,
|
|
825
|
+
'The sparkle says "magic", not who answers. Where the assistant is (it speaks, wrote this, or takes this), the host draws its own mark; inside its own space (prompt chips, follow-ups) use no icon; a control that runs a model takes the icon of what it makes (file-plus, pencil-simple, magnifying-glass); a row or section takes a plain object icon (Ekanos design system § AI prompt chip).',
|
|
826
|
+
),
|
|
827
|
+
},
|
|
798
828
|
'no-overlay-width-class': {
|
|
799
829
|
meta: {
|
|
800
830
|
type: 'problem',
|
|
@@ -848,7 +878,9 @@ export default {
|
|
|
848
878
|
return {
|
|
849
879
|
/** @param {JsxElement} node */
|
|
850
880
|
JSXOpeningElement(node) {
|
|
851
|
-
|
|
881
|
+
const name = jsxName(node.name) ?? '';
|
|
882
|
+
if (!SIZED_CONTROLS.has(name)) return;
|
|
883
|
+
const checksText = SIZED_TEXT_CONTROLS.has(name);
|
|
852
884
|
|
|
853
885
|
for (const attribute of node.attributes ?? []) {
|
|
854
886
|
if (
|
|
@@ -863,7 +895,11 @@ export default {
|
|
|
863
895
|
typeof literal.value === 'string' &&
|
|
864
896
|
literal.value
|
|
865
897
|
.split(/\s+/)
|
|
866
|
-
.some(
|
|
898
|
+
.some(
|
|
899
|
+
(token) =>
|
|
900
|
+
CONTROL_HEIGHT.test(token) ||
|
|
901
|
+
(checksText && CONTROL_TEXT_SIZE.test(token)),
|
|
902
|
+
),
|
|
867
903
|
);
|
|
868
904
|
|
|
869
905
|
if (flagged) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ekanos/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The official SDK for building Ekanos integrations.",
|
|
6
6
|
"homepage": "https://sdk.ekanos.dev/sdk/overview",
|
|
@@ -114,23 +114,23 @@
|
|
|
114
114
|
"access": "public"
|
|
115
115
|
},
|
|
116
116
|
"dependencies": {
|
|
117
|
-
"@ekanos/integration-schema": "0.
|
|
118
|
-
"@ekanos/ui": "0.
|
|
117
|
+
"@ekanos/integration-schema": "0.30.0",
|
|
118
|
+
"@ekanos/ui": "0.30.0",
|
|
119
119
|
"@supabase/supabase-js": "2.119.0",
|
|
120
120
|
"server-only": "^0.0.1",
|
|
121
121
|
"zod-to-json-schema": "3.25.2"
|
|
122
122
|
},
|
|
123
123
|
"devDependencies": {
|
|
124
|
-
"@hookform/resolvers": "^7.0.
|
|
124
|
+
"@hookform/resolvers": "^7.0.6",
|
|
125
125
|
"@kit/tsconfig": "0.1.0",
|
|
126
|
-
"@tanstack/react-query": "5.
|
|
126
|
+
"@tanstack/react-query": "5.107.1",
|
|
127
127
|
"@types/react": "19.3.0",
|
|
128
128
|
"@types/react-dom": "19.3.0",
|
|
129
|
-
"eslint": "^10.
|
|
130
|
-
"next": "16.4.
|
|
129
|
+
"eslint": "^10.15.0",
|
|
130
|
+
"next": "16.4.6",
|
|
131
131
|
"react": "19.3.1",
|
|
132
132
|
"react-dom": "19.3.1",
|
|
133
|
-
"react-hook-form": "^7.
|
|
133
|
+
"react-hook-form": "^7.92.0",
|
|
134
134
|
"typescript": "^7.0.2",
|
|
135
135
|
"vitest": "5.1.0",
|
|
136
136
|
"zod": "4.6.7"
|