@adea-ai/ui 0.145.2 → 0.146.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,2 @@
1
+ export { PixelPane, type PixelPaneProps } from './pixel-pane';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/pixel-pane/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { PixelPane } from "./pixel-pane.js";
2
+ export { PixelPane };
@@ -0,0 +1,20 @@
1
+ import type { ComponentProps, JSX } from 'solid-js';
2
+ export type PixelPaneProps = ComponentProps<'div'> & {
3
+ /**
4
+ * The pane's width in CSS pixels, owned by the host. Without it the pane
5
+ * takes the space the fixed panes leave.
6
+ */
7
+ width?: number;
8
+ };
9
+ /**
10
+ * PixelPane.
11
+ *
12
+ * One pane of a row whose widths the host keeps (for example beside a
13
+ * `PixelResizeHandle`): a fixed pixel width, or the remaining space. It exists
14
+ * so a consumer can give a pane a computed width without a style attribute of
15
+ * its own, and so every such pane behaves the same way: it never grows past its
16
+ * width, clips what does not fit, and gives way before the row overflows if the
17
+ * host's widths briefly exceed the space (a window being resized).
18
+ */
19
+ export declare function PixelPane(props: PixelPaneProps): JSX.Element;
20
+ //# sourceMappingURL=pixel-pane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pixel-pane.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/pixel-pane/pixel-pane.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAInD,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACnD;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,eAe9C"}
@@ -0,0 +1,55 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { mergeProps, spread, template } from "solid-js/web";
3
+ import { splitProps } from "solid-js";
4
+ //#region src/components/layout/pixel-pane/pixel-pane.tsx
5
+ var _tmpl$ = /*#__PURE__*/ template(`<div data-slot=pixel-pane>`);
6
+ /**
7
+ * PixelPane.
8
+ *
9
+ * One pane of a row whose widths the host keeps (for example beside a
10
+ * `PixelResizeHandle`): a fixed pixel width, or the remaining space. It exists
11
+ * so a consumer can give a pane a computed width without a style attribute of
12
+ * its own, and so every such pane behaves the same way: it never grows past its
13
+ * width, clips what does not fit, and gives way before the row overflows if the
14
+ * host's widths briefly exceed the space (a window being resized).
15
+ */
16
+ function PixelPane(props) {
17
+ const [local, rest] = splitProps(props, [
18
+ "width",
19
+ "class",
20
+ "style"
21
+ ]);
22
+ return (() => {
23
+ var _el$ = _tmpl$();
24
+ spread(_el$, mergeProps(rest, {
25
+ get ["class"]() {
26
+ return cn("min-h-0 min-w-0 overflow-hidden", local.width === void 0 ? "flex-1" : "grow-0 shrink", local.class);
27
+ },
28
+ get style() {
29
+ return fixedStyle(local.style, local.width);
30
+ }
31
+ }), false, false);
32
+ return _el$;
33
+ })();
34
+ }
35
+ /**
36
+ * The pane's style with its width applied last, so the host's width wins over a
37
+ * `flex-basis` of the caller's own. A string style stays a string and an object
38
+ * style stays an object; both keep every declaration they came with.
39
+ */
40
+ function fixedStyle(style, width) {
41
+ if (width === void 0) return style;
42
+ const basis = `${Math.max(0, Math.round(width))}px`;
43
+ if (typeof style === "string") {
44
+ const declarations = style.trim();
45
+ return `${declarations}${declarations === "" || declarations.endsWith(";") ? "" : ";"}flex-basis:${basis}`;
46
+ }
47
+ return {
48
+ ...style,
49
+ "flex-basis": basis
50
+ };
51
+ }
52
+ //#endregion
53
+ export { PixelPane };
54
+
55
+ //# sourceMappingURL=pixel-pane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pixel-pane.js","names":["ComponentProps","JSX","splitProps","cn","PixelPaneProps","width","PixelPane","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","class","undefined","style","fixedStyle","CSSProperties","basis","Math","max","round","declarations","trim","separator","endsWith","_$mergeProps"],"sources":["../../../../src/components/layout/pixel-pane/pixel-pane.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\n\nexport type PixelPaneProps = ComponentProps<'div'> & {\n /**\n * The pane's width in CSS pixels, owned by the host. Without it the pane\n * takes the space the fixed panes leave.\n */\n width?: number\n}\n\n/**\n * PixelPane.\n *\n * One pane of a row whose widths the host keeps (for example beside a\n * `PixelResizeHandle`): a fixed pixel width, or the remaining space. It exists\n * so a consumer can give a pane a computed width without a style attribute of\n * its own, and so every such pane behaves the same way: it never grows past its\n * width, clips what does not fit, and gives way before the row overflows if the\n * host's widths briefly exceed the space (a window being resized).\n */\nexport function PixelPane(props: PixelPaneProps) {\n const [local, rest] = splitProps(props, ['width', 'class', 'style'])\n\n return (\n <div\n data-slot=\"pixel-pane\"\n {...rest}\n class={cn(\n 'min-h-0 min-w-0 overflow-hidden',\n local.width === undefined ? 'flex-1' : 'grow-0 shrink',\n local.class\n )}\n style={fixedStyle(local.style, local.width)}\n />\n )\n}\n\n/**\n * The pane's style with its width applied last, so the host's width wins over a\n * `flex-basis` of the caller's own. A string style stays a string and an object\n * style stays an object; both keep every declaration they came with.\n */\nfunction fixedStyle(\n style: JSX.CSSProperties | string | undefined,\n width: number | undefined\n): JSX.CSSProperties | string | undefined {\n if (width === undefined) return style\n const basis = `${Math.max(0, Math.round(width))}px`\n if (typeof style === 'string') {\n const declarations = style.trim()\n const separator = declarations === '' || declarations.endsWith(';') ? '' : ';'\n return `${declarations}${separator}flex-basis:${basis}`\n }\n return { ...style, 'flex-basis': basis }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsBA,SAAgBM,UAAUC,OAAuB;CAC/C,MAAM,CAACC,OAAOC,QAAQP,WAAWK,OAAO;EAAC;EAAS;EAAS;CAAO,CAAC;CAEnE,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAGQJ,MAAI;GAAA,KAAA,WAAA;IAAA,OACDN,GACL,mCACAK,MAAMH,UAAUU,KAAAA,IAAY,WAAW,iBACvCP,MAAMM,KACR;GAAC;GAAA,IACDE,QAAK;IAAA,OAAEC,WAAWT,MAAMQ,OAAOR,MAAMH,KAAK;GAAC;EAAA,CAAA,GAAA,OAAA,KAAA;EAAA,OAAAK;CAAA,EAAA,CAAA;AAGjD;;;;;;AAOA,SAASO,WACPD,OACAX,OACwC;CACxC,IAAIA,UAAUU,KAAAA,GAAW,OAAOC;CAChC,MAAMG,QAAQ,GAAGC,KAAKC,IAAI,GAAGD,KAAKE,MAAMjB,KAAK,CAAC,EAAC;CAC/C,IAAI,OAAOW,UAAU,UAAU;EAC7B,MAAMO,eAAeP,MAAMQ,KAAK;EAEhC,OAAO,GAAGD,eADQA,iBAAiB,MAAMA,aAAaG,SAAS,GAAG,IAAI,KAAK,IACzC,aAAcP;CAClD;CACA,OAAO;EAAE,GAAGH;EAAO,cAAcG;CAAM;AACzC"}
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "pixel-pane",
3
+ "type": "registry:ui",
4
+ "title": "Pixel Pane",
5
+ "description": "",
6
+ "dependencies": [],
7
+ "registryDependencies": [
8
+ "lib"
9
+ ],
10
+ "files": [
11
+ {
12
+ "path": "src/components/layout/pixel-pane/index.ts",
13
+ "type": "registry:ui",
14
+ "target": "components/layout/pixel-pane/index.ts"
15
+ },
16
+ {
17
+ "path": "src/components/layout/pixel-pane/pixel-pane.tsx",
18
+ "type": "registry:ui",
19
+ "target": "components/layout/pixel-pane/pixel-pane.tsx"
20
+ }
21
+ ]
22
+ }
@@ -1894,6 +1894,28 @@
1894
1894
  }
1895
1895
  ]
1896
1896
  },
1897
+ {
1898
+ "name": "pixel-pane",
1899
+ "type": "registry:ui",
1900
+ "title": "Pixel Pane",
1901
+ "description": "",
1902
+ "dependencies": [],
1903
+ "registryDependencies": [
1904
+ "lib"
1905
+ ],
1906
+ "files": [
1907
+ {
1908
+ "path": "src/components/layout/pixel-pane/index.ts",
1909
+ "type": "registry:ui",
1910
+ "target": "components/layout/pixel-pane/index.ts"
1911
+ },
1912
+ {
1913
+ "path": "src/components/layout/pixel-pane/pixel-pane.tsx",
1914
+ "type": "registry:ui",
1915
+ "target": "components/layout/pixel-pane/pixel-pane.tsx"
1916
+ }
1917
+ ]
1918
+ },
1897
1919
  {
1898
1920
  "name": "pixel-resize-handle",
1899
1921
  "type": "registry:ui",
@@ -0,0 +1 @@
1
+ export { PixelPane, type PixelPaneProps } from './pixel-pane'
@@ -0,0 +1,57 @@
1
+ import type { ComponentProps, JSX } from 'solid-js'
2
+ import { splitProps } from 'solid-js'
3
+ import { cn } from '../../../lib/utils'
4
+
5
+ export type PixelPaneProps = ComponentProps<'div'> & {
6
+ /**
7
+ * The pane's width in CSS pixels, owned by the host. Without it the pane
8
+ * takes the space the fixed panes leave.
9
+ */
10
+ width?: number
11
+ }
12
+
13
+ /**
14
+ * PixelPane.
15
+ *
16
+ * One pane of a row whose widths the host keeps (for example beside a
17
+ * `PixelResizeHandle`): a fixed pixel width, or the remaining space. It exists
18
+ * so a consumer can give a pane a computed width without a style attribute of
19
+ * its own, and so every such pane behaves the same way: it never grows past its
20
+ * width, clips what does not fit, and gives way before the row overflows if the
21
+ * host's widths briefly exceed the space (a window being resized).
22
+ */
23
+ export function PixelPane(props: PixelPaneProps) {
24
+ const [local, rest] = splitProps(props, ['width', 'class', 'style'])
25
+
26
+ return (
27
+ <div
28
+ data-slot="pixel-pane"
29
+ {...rest}
30
+ class={cn(
31
+ 'min-h-0 min-w-0 overflow-hidden',
32
+ local.width === undefined ? 'flex-1' : 'grow-0 shrink',
33
+ local.class
34
+ )}
35
+ style={fixedStyle(local.style, local.width)}
36
+ />
37
+ )
38
+ }
39
+
40
+ /**
41
+ * The pane's style with its width applied last, so the host's width wins over a
42
+ * `flex-basis` of the caller's own. A string style stays a string and an object
43
+ * style stays an object; both keep every declaration they came with.
44
+ */
45
+ function fixedStyle(
46
+ style: JSX.CSSProperties | string | undefined,
47
+ width: number | undefined
48
+ ): JSX.CSSProperties | string | undefined {
49
+ if (width === undefined) return style
50
+ const basis = `${Math.max(0, Math.round(width))}px`
51
+ if (typeof style === 'string') {
52
+ const declarations = style.trim()
53
+ const separator = declarations === '' || declarations.endsWith(';') ? '' : ';'
54
+ return `${declarations}${separator}flex-basis:${basis}`
55
+ }
56
+ return { ...style, 'flex-basis': basis }
57
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adea-ai/ui",
3
- "version": "0.145.2",
3
+ "version": "0.146.0",
4
4
  "description": "The Adea design system: Kobalte-backed Solid components, semantic OKLCH tokens, and the app-shell layout primitives shared by Adea and Cortana.",
5
5
  "keywords": [
6
6
  "adea",
package/registry.json CHANGED
@@ -1894,6 +1894,28 @@
1894
1894
  }
1895
1895
  ]
1896
1896
  },
1897
+ {
1898
+ "name": "pixel-pane",
1899
+ "type": "registry:ui",
1900
+ "title": "Pixel Pane",
1901
+ "description": "",
1902
+ "dependencies": [],
1903
+ "registryDependencies": [
1904
+ "lib"
1905
+ ],
1906
+ "files": [
1907
+ {
1908
+ "path": "src/components/layout/pixel-pane/index.ts",
1909
+ "type": "registry:ui",
1910
+ "target": "components/layout/pixel-pane/index.ts"
1911
+ },
1912
+ {
1913
+ "path": "src/components/layout/pixel-pane/pixel-pane.tsx",
1914
+ "type": "registry:ui",
1915
+ "target": "components/layout/pixel-pane/pixel-pane.tsx"
1916
+ }
1917
+ ]
1918
+ },
1897
1919
  {
1898
1920
  "name": "pixel-resize-handle",
1899
1921
  "type": "registry:ui",
@@ -0,0 +1 @@
1
+ export { PixelPane, type PixelPaneProps } from './pixel-pane'
@@ -0,0 +1,57 @@
1
+ import type { ComponentProps, JSX } from 'solid-js'
2
+ import { splitProps } from 'solid-js'
3
+ import { cn } from '#lib/utils'
4
+
5
+ export type PixelPaneProps = ComponentProps<'div'> & {
6
+ /**
7
+ * The pane's width in CSS pixels, owned by the host. Without it the pane
8
+ * takes the space the fixed panes leave.
9
+ */
10
+ width?: number
11
+ }
12
+
13
+ /**
14
+ * PixelPane.
15
+ *
16
+ * One pane of a row whose widths the host keeps (for example beside a
17
+ * `PixelResizeHandle`): a fixed pixel width, or the remaining space. It exists
18
+ * so a consumer can give a pane a computed width without a style attribute of
19
+ * its own, and so every such pane behaves the same way: it never grows past its
20
+ * width, clips what does not fit, and gives way before the row overflows if the
21
+ * host's widths briefly exceed the space (a window being resized).
22
+ */
23
+ export function PixelPane(props: PixelPaneProps) {
24
+ const [local, rest] = splitProps(props, ['width', 'class', 'style'])
25
+
26
+ return (
27
+ <div
28
+ data-slot="pixel-pane"
29
+ {...rest}
30
+ class={cn(
31
+ 'min-h-0 min-w-0 overflow-hidden',
32
+ local.width === undefined ? 'flex-1' : 'grow-0 shrink',
33
+ local.class
34
+ )}
35
+ style={fixedStyle(local.style, local.width)}
36
+ />
37
+ )
38
+ }
39
+
40
+ /**
41
+ * The pane's style with its width applied last, so the host's width wins over a
42
+ * `flex-basis` of the caller's own. A string style stays a string and an object
43
+ * style stays an object; both keep every declaration they came with.
44
+ */
45
+ function fixedStyle(
46
+ style: JSX.CSSProperties | string | undefined,
47
+ width: number | undefined
48
+ ): JSX.CSSProperties | string | undefined {
49
+ if (width === undefined) return style
50
+ const basis = `${Math.max(0, Math.round(width))}px`
51
+ if (typeof style === 'string') {
52
+ const declarations = style.trim()
53
+ const separator = declarations === '' || declarations.endsWith(';') ? '' : ';'
54
+ return `${declarations}${separator}flex-basis:${basis}`
55
+ }
56
+ return { ...style, 'flex-basis': basis }
57
+ }