@positronic/gen-ui-components 0.0.61 → 0.0.63
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/dist/src/components/Link.js +57 -0
- package/dist/src/components/index.js +1 -0
- package/dist/src/index.js +4 -2
- package/dist/types/components/Link.d.ts +22 -0
- package/dist/types/components/Link.d.ts.map +1 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/types/components/index.d.ts.map +1 -1
- package/dist/types/index.d.ts +9 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
14
|
+
function _object_spread(target) {
|
|
15
|
+
for(var i = 1; i < arguments.length; i++){
|
|
16
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
17
|
+
var ownKeys = Object.keys(source);
|
|
18
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
19
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
20
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
ownKeys.forEach(function(key) {
|
|
24
|
+
_define_property(target, key, source[key]);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
}
|
|
29
|
+
import { z } from 'zod';
|
|
30
|
+
var LinkPropsSchema = z.object({
|
|
31
|
+
href: z.string().describe('URL to navigate to (absolute or relative)'),
|
|
32
|
+
label: z.string().describe('Text displayed in the link'),
|
|
33
|
+
variant: z.enum([
|
|
34
|
+
'default',
|
|
35
|
+
'muted'
|
|
36
|
+
]).optional().describe('Visual style - default (blue underline), muted (subtle gray)'),
|
|
37
|
+
external: z.boolean().optional().describe('If true, opens in new tab and adds security attributes (noopener, noreferrer)')
|
|
38
|
+
});
|
|
39
|
+
var variantClasses = {
|
|
40
|
+
default: 'text-blue-600 hover:text-blue-800 underline hover:no-underline',
|
|
41
|
+
muted: 'text-gray-500 hover:text-gray-700 underline'
|
|
42
|
+
};
|
|
43
|
+
var LinkComponent = function(param) {
|
|
44
|
+
var href = param.href, label = param.label, _param_variant = param.variant, variant = _param_variant === void 0 ? 'default' : _param_variant, _param_external = param.external, external = _param_external === void 0 ? false : _param_external;
|
|
45
|
+
return /*#__PURE__*/ React.createElement("a", _object_spread({
|
|
46
|
+
href: href,
|
|
47
|
+
className: "transition-colors ".concat(variantClasses[variant])
|
|
48
|
+
}, external && {
|
|
49
|
+
target: '_blank',
|
|
50
|
+
rel: 'noopener noreferrer'
|
|
51
|
+
}), label);
|
|
52
|
+
};
|
|
53
|
+
export var Link = {
|
|
54
|
+
component: LinkComponent,
|
|
55
|
+
description: 'A hyperlink for navigation. Use for linking to external resources, documentation, or other pages. Set external=true for links that should open in a new tab (automatically adds security attributes). Use variant="muted" for less prominent links.',
|
|
56
|
+
propsSchema: LinkPropsSchema
|
|
57
|
+
};
|
package/dist/src/index.js
CHANGED
|
@@ -9,6 +9,7 @@ import { Heading } from './components/Heading.js';
|
|
|
9
9
|
import { Container } from './components/Container.js';
|
|
10
10
|
import { Form } from './components/Form.js';
|
|
11
11
|
import { HiddenInput } from './components/HiddenInput.js';
|
|
12
|
+
import { Link } from './components/Link.js';
|
|
12
13
|
/**
|
|
13
14
|
* Default UI components for Positronic generative UI.
|
|
14
15
|
* Pass these to your Brain via .withComponents() to enable UI generation.
|
|
@@ -35,7 +36,8 @@ import { HiddenInput } from './components/HiddenInput.js';
|
|
|
35
36
|
Heading: Heading,
|
|
36
37
|
Container: Container,
|
|
37
38
|
Form: Form,
|
|
38
|
-
HiddenInput: HiddenInput
|
|
39
|
+
HiddenInput: HiddenInput,
|
|
40
|
+
Link: Link
|
|
39
41
|
};
|
|
40
42
|
// Re-export individual components for custom composition
|
|
41
|
-
export { Input, TextArea, Checkbox, Select, MultiTextInput, Button, Text, Heading, Container, Form, HiddenInput };
|
|
43
|
+
export { Input, TextArea, Checkbox, Select, MultiTextInput, Button, Text, Heading, Container, Form, HiddenInput, Link };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { UIComponent } from '@positronic/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
declare const LinkPropsSchema: z.ZodObject<{
|
|
4
|
+
href: z.ZodString;
|
|
5
|
+
label: z.ZodString;
|
|
6
|
+
variant: z.ZodOptional<z.ZodEnum<["default", "muted"]>>;
|
|
7
|
+
external: z.ZodOptional<z.ZodBoolean>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
label: string;
|
|
10
|
+
href: string;
|
|
11
|
+
variant?: "muted" | "default" | undefined;
|
|
12
|
+
external?: boolean | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
label: string;
|
|
15
|
+
href: string;
|
|
16
|
+
variant?: "muted" | "default" | undefined;
|
|
17
|
+
external?: boolean | undefined;
|
|
18
|
+
}>;
|
|
19
|
+
export type LinkProps = z.infer<typeof LinkPropsSchema>;
|
|
20
|
+
export declare const Link: UIComponent<LinkProps>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;EAWnB,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAsBxD,eAAO,MAAM,IAAI,EAAE,WAAW,CAAC,SAAS,CAIvC,CAAC"}
|
|
@@ -20,4 +20,6 @@ export { Form } from './Form.js';
|
|
|
20
20
|
export type { FormProps } from './Form.js';
|
|
21
21
|
export { HiddenInput } from './HiddenInput.js';
|
|
22
22
|
export type { HiddenInputProps } from './HiddenInput.js';
|
|
23
|
+
export { Link } from './Link.js';
|
|
24
|
+
export type { LinkProps } from './Link.js';
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,YAAY,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,YAAY,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EA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EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { Heading } from './components/Heading.js';
|
|
|
9
9
|
import { Container } from './components/Container.js';
|
|
10
10
|
import { Form } from './components/Form.js';
|
|
11
11
|
import { HiddenInput } from './components/HiddenInput.js';
|
|
12
|
+
import { Link } from './components/Link.js';
|
|
12
13
|
/**
|
|
13
14
|
* Default UI components for Positronic generative UI.
|
|
14
15
|
* Pass these to your Brain via .withComponents() to enable UI generation.
|
|
@@ -80,7 +81,13 @@ export declare const components: {
|
|
|
80
81
|
name: string;
|
|
81
82
|
value: string;
|
|
82
83
|
}>;
|
|
84
|
+
Link: import("@positronic/core").UIComponent<{
|
|
85
|
+
label: string;
|
|
86
|
+
href: string;
|
|
87
|
+
variant?: "muted" | "default" | undefined;
|
|
88
|
+
external?: boolean | undefined;
|
|
89
|
+
}>;
|
|
83
90
|
};
|
|
84
|
-
export { Input, TextArea, Checkbox, Select, MultiTextInput, Button, Text, Heading, Container, Form, HiddenInput, };
|
|
85
|
-
export type { InputProps, TextAreaProps, CheckboxProps, SelectProps, MultiTextInputProps, ButtonProps, TextProps, HeadingProps, ContainerProps, FormProps, HiddenInputProps, } from './components/index.js';
|
|
91
|
+
export { Input, TextArea, Checkbox, Select, MultiTextInput, Button, Text, Heading, Container, Form, HiddenInput, Link, };
|
|
92
|
+
export type { InputProps, TextAreaProps, CheckboxProps, SelectProps, MultiTextInputProps, ButtonProps, TextProps, HeadingProps, ContainerProps, FormProps, HiddenInputProps, LinkProps, } from './components/index.js';
|
|
86
93
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAE5C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAatB,CAAC;AAGF,OAAO,EACL,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,cAAc,EACd,MAAM,EACN,IAAI,EACJ,OAAO,EACP,SAAS,EACT,IAAI,EACJ,WAAW,EACX,IAAI,GACL,CAAC;AAGF,YAAY,EACV,UAAU,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,SAAS,EACT,YAAY,EACZ,cAAc,EACd,SAAS,EACT,gBAAgB,EAChB,SAAS,GACV,MAAM,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@positronic/gen-ui-components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.63",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"clean": "rm -rf tsconfig.tsbuildinfo dist node_modules"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@positronic/core": "^0.0.
|
|
23
|
+
"@positronic/core": "^0.0.63",
|
|
24
24
|
"zod": "^3.24.1"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|