@devtools-ui/navigation 0.0.2--canary.11.588

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,71 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/index.ts
31
+ var src_exports = {};
32
+ __export(src_exports, {
33
+ Navigation: () => Navigation,
34
+ NavigationComponent: () => NavigationComponent
35
+ });
36
+ module.exports = __toCommonJS(src_exports);
37
+
38
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx
39
+ var import_react = __toESM(require("react"));
40
+ var import_react2 = require("@chakra-ui/react");
41
+ var import_react3 = require("@player-ui/react");
42
+ var NavigationComponent = (props) => {
43
+ const { values, ...rest } = props;
44
+ return /* @__PURE__ */ import_react.default.createElement(import_react2.Stack, { direction: "row", spacing: 4, ...rest }, values?.map((a) => /* @__PURE__ */ import_react.default.createElement(import_react3.ReactAsset, { key: a.asset.id, ...a })));
45
+ };
46
+
47
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx
48
+ var import_react4 = __toESM(require("react"));
49
+ var import_dsl = require("@player-tools/dsl");
50
+ var import_text = require("@devtools-ui/text");
51
+ var import_collection = require("@devtools-ui/collection");
52
+ var Navigation = (props) => {
53
+ const { children, ...rest } = props;
54
+ return /* @__PURE__ */ import_react4.default.createElement(import_dsl.Asset, { type: "navigation", ...rest }, children);
55
+ };
56
+ var CollectionComp = (props) => {
57
+ return /* @__PURE__ */ import_react4.default.createElement(import_collection.Collection, null, /* @__PURE__ */ import_react4.default.createElement(import_collection.Collection.Values, null, props.children));
58
+ };
59
+ Navigation.Values = (0, import_dsl.createSlot)({
60
+ name: "values",
61
+ TextComp: import_text.Text,
62
+ CollectionComp,
63
+ isArray: true,
64
+ wrapInAsset: true
65
+ });
66
+ // Annotate the CommonJS export names for ESM import in node:
67
+ 0 && (module.exports = {
68
+ Navigation,
69
+ NavigationComponent
70
+ });
71
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/index.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx"],"sourcesContent":["export * from \"./types\";\nexport * from \"./components\";\nexport * from \"./dsl\";\n","import React from \"react\";\nimport { NavigationAsset } from \"../types\";\nimport { Stack } from \"@chakra-ui/react\";\nimport { ReactAsset } from \"@player-ui/react\";\n\nexport const NavigationComponent = (props: NavigationAsset) => {\n const { values, ...rest } = props;\n\n return (\n <Stack direction=\"row\" spacing={4} {...rest}>\n {values?.map((a) => (\n <ReactAsset key={a.asset.id} {...a} />\n ))}\n </Stack>\n );\n};\n","import React from \"react\";\nimport { AssetPropsWithChildren, Asset, createSlot } from \"@player-tools/dsl\";\nimport type { Asset as AssetType } from \"@player-ui/player\";\nimport { Text } from \"@devtools-ui/text\";\nimport { Collection } from \"@devtools-ui/collection\";\nimport { NavigationAsset } from \"../types\";\n\nexport const Navigation = (props: AssetPropsWithChildren<NavigationAsset>) => {\n const { children, ...rest } = props;\n return (\n <Asset type=\"navigation\" {...rest}>\n {children}\n </Asset>\n );\n};\n\nconst CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {\n return (\n <Collection>\n <Collection.Values>{props.children}</Collection.Values>\n </Collection>\n );\n};\n\nNavigation.Values = createSlot({\n name: \"values\",\n TextComp: Text,\n CollectionComp,\n isArray: true,\n wrapInAsset: true,\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,mBAAkB;AAElB,IAAAA,gBAAsB;AACtB,IAAAA,gBAA2B;AAEpB,IAAM,sBAAsB,CAAC,UAA2B;AAC7D,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAE5B,SACE,6BAAAC,QAAA,cAAC,uBAAM,WAAU,OAAM,SAAS,GAAI,GAAG,QACpC,QAAQ,IAAI,CAAC,MACZ,6BAAAA,QAAA,cAAC,4BAAW,KAAK,EAAE,MAAM,IAAK,GAAG,GAAG,CACrC,CACH;AAEJ;;;ACfA,IAAAC,gBAAkB;AAClB,iBAA0D;AAE1D,kBAAqB;AACrB,wBAA2B;AAGpB,IAAM,aAAa,CAAC,UAAmD;AAC5E,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI;AAC9B,SACE,8BAAAC,QAAA,cAAC,oBAAM,MAAK,cAAc,GAAG,QAC1B,QACH;AAEJ;AAEA,IAAM,iBAAiB,CAAC,UAA6C;AACnE,SACE,8BAAAA,QAAA,cAAC,oCACC,8BAAAA,QAAA,cAAC,6BAAW,QAAX,MAAmB,MAAM,QAAS,CACrC;AAEJ;AAEA,WAAW,aAAS,uBAAW;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACf,CAAC;","names":["import_react","React","import_react","React"]}
@@ -0,0 +1,33 @@
1
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx
2
+ import React from "react";
3
+ import { Stack } from "@chakra-ui/react";
4
+ import { ReactAsset } from "@player-ui/react";
5
+ var NavigationComponent = (props) => {
6
+ const { values, ...rest } = props;
7
+ return /* @__PURE__ */ React.createElement(Stack, { direction: "row", spacing: 4, ...rest }, values?.map((a) => /* @__PURE__ */ React.createElement(ReactAsset, { key: a.asset.id, ...a })));
8
+ };
9
+
10
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx
11
+ import React2 from "react";
12
+ import { Asset, createSlot } from "@player-tools/dsl";
13
+ import { Text } from "@devtools-ui/text";
14
+ import { Collection } from "@devtools-ui/collection";
15
+ var Navigation = (props) => {
16
+ const { children, ...rest } = props;
17
+ return /* @__PURE__ */ React2.createElement(Asset, { type: "navigation", ...rest }, children);
18
+ };
19
+ var CollectionComp = (props) => {
20
+ return /* @__PURE__ */ React2.createElement(Collection, null, /* @__PURE__ */ React2.createElement(Collection.Values, null, props.children));
21
+ };
22
+ Navigation.Values = createSlot({
23
+ name: "values",
24
+ TextComp: Text,
25
+ CollectionComp,
26
+ isArray: true,
27
+ wrapInAsset: true
28
+ });
29
+ export {
30
+ Navigation,
31
+ NavigationComponent
32
+ };
33
+ //# sourceMappingURL=index.mjs.map
package/dist/index.mjs ADDED
@@ -0,0 +1,33 @@
1
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx
2
+ import React from "react";
3
+ import { Stack } from "@chakra-ui/react";
4
+ import { ReactAsset } from "@player-ui/react";
5
+ var NavigationComponent = (props) => {
6
+ const { values, ...rest } = props;
7
+ return /* @__PURE__ */ React.createElement(Stack, { direction: "row", spacing: 4, ...rest }, values?.map((a) => /* @__PURE__ */ React.createElement(ReactAsset, { key: a.asset.id, ...a })));
8
+ };
9
+
10
+ // ../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx
11
+ import React2 from "react";
12
+ import { Asset, createSlot } from "@player-tools/dsl";
13
+ import { Text } from "@devtools-ui/text";
14
+ import { Collection } from "@devtools-ui/collection";
15
+ var Navigation = (props) => {
16
+ const { children, ...rest } = props;
17
+ return /* @__PURE__ */ React2.createElement(Asset, { type: "navigation", ...rest }, children);
18
+ };
19
+ var CollectionComp = (props) => {
20
+ return /* @__PURE__ */ React2.createElement(Collection, null, /* @__PURE__ */ React2.createElement(Collection.Values, null, props.children));
21
+ };
22
+ Navigation.Values = createSlot({
23
+ name: "values",
24
+ TextComp: Text,
25
+ CollectionComp,
26
+ isArray: true,
27
+ wrapInAsset: true
28
+ });
29
+ export {
30
+ Navigation,
31
+ NavigationComponent
32
+ };
33
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/components/NavigationComponent.tsx","../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/navigation/src/dsl/Navigation.tsx"],"sourcesContent":["import React from \"react\";\nimport { NavigationAsset } from \"../types\";\nimport { Stack } from \"@chakra-ui/react\";\nimport { ReactAsset } from \"@player-ui/react\";\n\nexport const NavigationComponent = (props: NavigationAsset) => {\n const { values, ...rest } = props;\n\n return (\n <Stack direction=\"row\" spacing={4} {...rest}>\n {values?.map((a) => (\n <ReactAsset key={a.asset.id} {...a} />\n ))}\n </Stack>\n );\n};\n","import React from \"react\";\nimport { AssetPropsWithChildren, Asset, createSlot } from \"@player-tools/dsl\";\nimport type { Asset as AssetType } from \"@player-ui/player\";\nimport { Text } from \"@devtools-ui/text\";\nimport { Collection } from \"@devtools-ui/collection\";\nimport { NavigationAsset } from \"../types\";\n\nexport const Navigation = (props: AssetPropsWithChildren<NavigationAsset>) => {\n const { children, ...rest } = props;\n return (\n <Asset type=\"navigation\" {...rest}>\n {children}\n </Asset>\n );\n};\n\nconst CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {\n return (\n <Collection>\n <Collection.Values>{props.children}</Collection.Values>\n </Collection>\n );\n};\n\nNavigation.Values = createSlot({\n name: \"values\",\n TextComp: Text,\n CollectionComp,\n isArray: true,\n wrapInAsset: true,\n});\n"],"mappings":";AAAA,OAAO,WAAW;AAElB,SAAS,aAAa;AACtB,SAAS,kBAAkB;AAEpB,IAAM,sBAAsB,CAAC,UAA2B;AAC7D,QAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAE5B,SACE,oCAAC,SAAM,WAAU,OAAM,SAAS,GAAI,GAAG,QACpC,QAAQ,IAAI,CAAC,MACZ,oCAAC,cAAW,KAAK,EAAE,MAAM,IAAK,GAAG,GAAG,CACrC,CACH;AAEJ;;;ACfA,OAAOA,YAAW;AAClB,SAAiC,OAAO,kBAAkB;AAE1D,SAAS,YAAY;AACrB,SAAS,kBAAkB;AAGpB,IAAM,aAAa,CAAC,UAAmD;AAC5E,QAAM,EAAE,UAAU,GAAG,KAAK,IAAI;AAC9B,SACE,gBAAAA,OAAA,cAAC,SAAM,MAAK,cAAc,GAAG,QAC1B,QACH;AAEJ;AAEA,IAAM,iBAAiB,CAAC,UAA6C;AACnE,SACE,gBAAAA,OAAA,cAAC,kBACC,gBAAAA,OAAA,cAAC,WAAW,QAAX,MAAmB,MAAM,QAAS,CACrC;AAEJ;AAEA,WAAW,SAAS,WAAW;AAAA,EAC7B,MAAM;AAAA,EACN,UAAU;AAAA,EACV;AAAA,EACA,SAAS;AAAA,EACT,aAAa;AACf,CAAC;","names":["React"]}
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@devtools-ui/navigation",
3
+ "version": "0.0.2--canary.11.588",
4
+ "main": "dist/cjs/index.cjs",
5
+ "dependencies": {
6
+ "@devtools-ui/collection": "0.0.2--canary.11.588",
7
+ "@devtools-ui/text": "0.0.2--canary.11.588",
8
+ "@chakra-ui/react": "^2.8.2",
9
+ "@emotion/react": "^11.11.4",
10
+ "@emotion/styled": "^11.11.0",
11
+ "@player-tools/dsl": "0.5.2--canary.87.2261",
12
+ "@player-ui/types": "0.7.1",
13
+ "@types/react": "^18.2.51",
14
+ "framer-motion": "^11.0.8",
15
+ "react": "^18.2.0",
16
+ "dlv": "^1.1.3",
17
+ "@player-ui/player": "0.7.1",
18
+ "@player-ui/react": "^0.7.1",
19
+ "eslint-plugin-storybook": "^0.8.0",
20
+ "tslib": "^2.6.2"
21
+ },
22
+ "module": "dist/index.legacy-esm.js",
23
+ "types": "types/index.d.ts",
24
+ "sideEffects": false,
25
+ "exports": {
26
+ "./package.json": "./package.json",
27
+ ".": {
28
+ "types": "./types/index.d.ts",
29
+ "import": "./dist/index.mjs",
30
+ "default": "./dist/cjs/index.cjs"
31
+ }
32
+ },
33
+ "files": [
34
+ "dist",
35
+ "src",
36
+ "types"
37
+ ],
38
+ "peerDependencies": {}
39
+ }
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { NavigationAsset } from "../types";
3
+ import { Stack } from "@chakra-ui/react";
4
+ import { ReactAsset } from "@player-ui/react";
5
+
6
+ export const NavigationComponent = (props: NavigationAsset) => {
7
+ const { values, ...rest } = props;
8
+
9
+ return (
10
+ <Stack direction="row" spacing={4} {...rest}>
11
+ {values?.map((a) => (
12
+ <ReactAsset key={a.asset.id} {...a} />
13
+ ))}
14
+ </Stack>
15
+ );
16
+ };
@@ -0,0 +1 @@
1
+ export { NavigationComponent } from "./NavigationComponent";
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ import { AssetPropsWithChildren, Asset, createSlot } from "@player-tools/dsl";
3
+ import type { Asset as AssetType } from "@player-ui/player";
4
+ import { Text } from "@devtools-ui/text";
5
+ import { Collection } from "@devtools-ui/collection";
6
+ import { NavigationAsset } from "../types";
7
+
8
+ export const Navigation = (props: AssetPropsWithChildren<NavigationAsset>) => {
9
+ const { children, ...rest } = props;
10
+ return (
11
+ <Asset type="navigation" {...rest}>
12
+ {children}
13
+ </Asset>
14
+ );
15
+ };
16
+
17
+ const CollectionComp = (props: AssetPropsWithChildren<AssetType>) => {
18
+ return (
19
+ <Collection>
20
+ <Collection.Values>{props.children}</Collection.Values>
21
+ </Collection>
22
+ );
23
+ };
24
+
25
+ Navigation.Values = createSlot({
26
+ name: "values",
27
+ TextComp: Text,
28
+ CollectionComp,
29
+ isArray: true,
30
+ wrapInAsset: true,
31
+ });
@@ -0,0 +1,45 @@
1
+ import React from "react";
2
+ import { describe, expect, test } from "vitest";
3
+ import { Asset, render } from "@player-tools/dsl";
4
+ import { Navigation } from "../index";
5
+
6
+ describe("DSL: Navigation", () => {
7
+ test("Renders navigation", async () => {
8
+ const rendered = await render(<Navigation></Navigation>);
9
+
10
+ expect(rendered.jsonValue).toStrictEqual({
11
+ id: "root",
12
+ type: "navigation",
13
+ });
14
+ });
15
+
16
+ test("Renders navigation with an action", async () => {
17
+ const rendered = await render(
18
+ <Navigation>
19
+ <Navigation.Values>
20
+ <Asset type="action" />
21
+ <Asset type="action" />
22
+ </Navigation.Values>
23
+ </Navigation>
24
+ );
25
+
26
+ expect(rendered.jsonValue).toStrictEqual({
27
+ id: "root",
28
+ type: "navigation",
29
+ values: [
30
+ {
31
+ asset: {
32
+ id: "values-0",
33
+ type: "action",
34
+ },
35
+ },
36
+ {
37
+ asset: {
38
+ id: "values-1",
39
+ type: "action",
40
+ },
41
+ },
42
+ ],
43
+ });
44
+ });
45
+ });
@@ -0,0 +1 @@
1
+ export { Navigation } from "./Navigation";
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./types";
2
+ export * from "./components";
3
+ export * from "./dsl";
@@ -0,0 +1,6 @@
1
+ import { Asset, AssetWrapper } from "@player-ui/types";
2
+
3
+ /** Navigation between flow's views */
4
+ export interface NavigationAsset extends Asset<"navigation"> {
5
+ values?: Array<AssetWrapper>;
6
+ }
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { NavigationAsset } from "../types";
3
+ export declare const NavigationComponent: (props: NavigationAsset) => React.JSX.Element;
4
+ //# sourceMappingURL=NavigationComponent.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { NavigationComponent } from "./NavigationComponent";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { AssetPropsWithChildren } from "@player-tools/dsl";
3
+ import { NavigationAsset } from "../types";
4
+ export declare const Navigation: {
5
+ (props: AssetPropsWithChildren<NavigationAsset>): React.JSX.Element;
6
+ Values: (props: {
7
+ children?: React.ReactNode;
8
+ }) => React.JSX.Element;
9
+ };
10
+ //# sourceMappingURL=Navigation.d.ts.map
@@ -0,0 +1,2 @@
1
+ export { Navigation } from "./Navigation";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,4 @@
1
+ export * from "./types";
2
+ export * from "./components";
3
+ export * from "./dsl";
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ import { Asset, AssetWrapper } from "@player-ui/types";
2
+ /** Navigation between flow's views */
3
+ export interface NavigationAsset extends Asset<"navigation"> {
4
+ values?: Array<AssetWrapper>;
5
+ }
6
+ //# sourceMappingURL=index.d.ts.map