@corenel/ui-kit 0.7.0 → 0.8.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.
@@ -0,0 +1,20 @@
1
+ import { type ComponentType, type ReactNode } from 'react';
2
+ export interface HostSheetProps {
3
+ /** Accessible name; the sheet is a dialog. */
4
+ label: string;
5
+ onClose: () => void;
6
+ children: ReactNode;
7
+ className?: string;
8
+ /** Resting heights as fractions of the viewport, ascending. */
9
+ detents?: number[];
10
+ /** Index into `detents`. Controlled. */
11
+ detent?: number;
12
+ onDetentChange?: (index: number) => void;
13
+ }
14
+ export declare function SheetHostProvider({ Sheet, children }: {
15
+ Sheet: ComponentType<HostSheetProps>;
16
+ children: ReactNode;
17
+ }): ReactNode;
18
+ /** The host's phone sheet, or null when the host lends none. */
19
+ export declare function useHostSheet(): ComponentType<HostSheetProps> | null;
20
+ //# sourceMappingURL=sheetHost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheetHost.d.ts","sourceRoot":"","sources":["../sheetHost.ts"],"names":[],"mappings":"AAOA,OAAO,EAA4C,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAErG,MAAM,WAAW,cAAc;IAC7B,8CAA8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,wCAAwC;IACxC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAID,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;IAAE,KAAK,EAAE,aAAa,CAAC,cAAc,CAAC,CAAC;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAE/H;AAED,gEAAgE;AAChE,wBAAgB,YAAY,IAAI,aAAa,CAAC,cAAc,CAAC,GAAG,IAAI,CAEnE"}
@@ -0,0 +1,17 @@
1
+ /* The phone sheet a host lends to Corenel's components.
2
+ *
3
+ * web-ui renders dialogs but must not import a host's own components; the
4
+ * app's draggable bottom sheet (src/components/BottomSheet.tsx) lives in the
5
+ * app. A host provides it here once and a component asks for it on a phone;
6
+ * with no provider the component keeps its own fallback. A .ts file built
7
+ * with createElement, so the package's "./*" export covers it. */
8
+ import { createContext, createElement, useContext } from 'react';
9
+ const SheetContext = createContext(null);
10
+ export function SheetHostProvider({ Sheet, children }) {
11
+ return createElement(SheetContext.Provider, { value: Sheet }, children);
12
+ }
13
+ /** The host's phone sheet, or null when the host lends none. */
14
+ export function useHostSheet() {
15
+ return useContext(SheetContext);
16
+ }
17
+ //# sourceMappingURL=sheetHost.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sheetHost.js","sourceRoot":"","sources":["../sheetHost.ts"],"names":[],"mappings":"AAAA;;;;;;kEAMkE;AAClE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,UAAU,EAAsC,MAAM,OAAO,CAAC;AAerG,MAAM,YAAY,GAAG,aAAa,CAAuC,IAAI,CAAC,CAAC;AAE/E,MAAM,UAAU,iBAAiB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAiE;IAClH,OAAO,aAAa,CAAC,YAAY,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,CAAC;AAC1E,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,YAAY;IAC1B,OAAO,UAAU,CAAC,YAAY,CAAC,CAAC;AAClC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corenel/ui-kit",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "license": "Elastic-2.0",
5
5
  "type": "module",
6
6
  "description": "Corenel shared UI primitives — icons, theme, token-usage helpers, small UI helpers, monaco colorizer. Consumed by @corenel/web-ui and the prompd app alike.",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "gpt-tokenizer": "^3.4.0",
27
- "@corenel/protocol": "0.10.0"
27
+ "@corenel/protocol": "0.11.0"
28
28
  },
29
29
  "peerDependencies": {
30
30
  "monaco-editor": "*",