@cypress-design/vue-docmenu 0.1.0 → 0.2.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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +14 -0
- package/DocMenu.vue +1 -1
- package/ReadMe.md +0 -4
- package/_DocGroup.vue +4 -3
- package/_DocLink.vue +1 -1
- package/dist/{vue/DocMenu.vue.d.ts → DocMenu.vue.d.ts} +1 -1
- package/dist/DocMenu.vue.d.ts.map +1 -0
- package/dist/{vue/_DocGroup.vue.d.ts → _DocGroup.vue.d.ts} +1 -1
- package/dist/_DocGroup.vue.d.ts.map +1 -0
- package/dist/{vue/_DocLink.vue.d.ts → _DocLink.vue.d.ts} +1 -1
- package/dist/_DocLink.vue.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.es.mjs +24 -23
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/index.ts +1 -1
- package/package.json +25 -23
- package/tsconfig.build.json +1 -1
- package/dist/constants.d.ts +0 -17
- package/dist/constants.d.ts.map +0 -1
- package/dist/vue/DocMenu.vue.d.ts.map +0 -1
- package/dist/vue/_DocGroup.vue.d.ts.map +0 -1
- package/dist/vue/_DocLink.vue.d.ts.map +0 -1
- package/dist/vue/index.d.ts +0 -3
- package/dist/vue/index.d.ts.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
$ yarn build:module && yarn build:types
|
|
2
2
|
$ yarn vite build
|
|
3
3
|
$ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vite build
|
|
4
|
-
[36mvite v4.2.
|
|
4
|
+
[36mvite v4.2.2 [32mbuilding for production...[36m[39m
|
|
5
5
|
transforming...
|
|
6
6
|
[32m✓[39m 9 modules transformed.
|
|
7
7
|
rendering chunks...
|
|
8
8
|
computing gzip size...
|
|
9
|
-
[2mdist/[22m[36mindex.es.mjs [39m[1m[2m7.
|
|
10
|
-
[2mdist/[22m[36mindex.umd.js [39m[1m[2m6.
|
|
11
|
-
[32m✓[39m built in
|
|
9
|
+
[2mdist/[22m[36mindex.es.mjs [39m[1m[2m7.16 kB[22m[1m[22m[2m │ gzip: 2.53 kB[22m[2m │ map: 262.71 kB[22m
|
|
10
|
+
[2mdist/[22m[36mindex.umd.js [39m[1m[2m6.16 kB[22m[1m[22m[2m │ gzip: 2.31 kB[22m[2m │ map: 262.39 kB[22m
|
|
11
|
+
[32m✓[39m built in 5.71s
|
|
12
12
|
$ yarn vue-tsc --project ./tsconfig.build.json
|
|
13
13
|
$ /home/runner/work/cypress-design/cypress-design/node_modules/.bin/vue-tsc --project ./tsconfig.build.json
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @cypress-design/vue-docmenu
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#196](https://github.com/cypress-io/cypress-design/pull/196) [`fc6d9e4`](https://github.com/cypress-io/cypress-design/commit/fc6d9e4fedcc01fa8e01b868b0fa66d8895c37d0) Thanks [@elevatebart](https://github.com/elevatebart)! - refactor: avoid constants relative imports
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- [#203](https://github.com/cypress-io/cypress-design/pull/203) [`68f7726`](https://github.com/cypress-io/cypress-design/commit/68f77266223181ef479dc7ff77f8a7d32f3e5766) Thanks [@elevatebart](https://github.com/elevatebart)! - allow groups to be active
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`fc6d9e4`](https://github.com/cypress-io/cypress-design/commit/fc6d9e4fedcc01fa8e01b868b0fa66d8895c37d0)]:
|
|
14
|
+
- @cypress-design/constants-docmenu@0.1.0
|
|
15
|
+
- @cypress-design/vue-icon@0.21.0
|
|
16
|
+
|
|
3
17
|
## 0.1.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/DocMenu.vue
CHANGED
package/ReadMe.md
CHANGED
package/_DocGroup.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed, Ref, ref } from 'vue'
|
|
3
3
|
import { IconChevronDownSmall } from '@cypress-design/vue-icon'
|
|
4
|
-
import { NavGroup, classes } from '
|
|
4
|
+
import { NavGroup, classes } from '@cypress-design/constants-docmenu'
|
|
5
5
|
import DocLink from './_DocLink.vue'
|
|
6
6
|
import DocGroup from './_DocGroup.vue'
|
|
7
7
|
|
|
@@ -18,7 +18,7 @@ const props = withDefaults(
|
|
|
18
18
|
|
|
19
19
|
const open = ref(props.depth === 0)
|
|
20
20
|
|
|
21
|
-
const $groups = ref<
|
|
21
|
+
const $groups = ref<{ height: number }[]>([])
|
|
22
22
|
|
|
23
23
|
const height = computed(() => {
|
|
24
24
|
return $groups.value && open.value
|
|
@@ -68,6 +68,7 @@ const Head = computed(() =>
|
|
|
68
68
|
{
|
|
69
69
|
[classes.topButton]: depth === 0,
|
|
70
70
|
[classes.leafButton]: depth,
|
|
71
|
+
'text-indigo-500 dark:text-indigo-200': props.group.active,
|
|
71
72
|
},
|
|
72
73
|
]"
|
|
73
74
|
:href="props.group.href"
|
|
@@ -113,7 +114,7 @@ const Head = computed(() =>
|
|
|
113
114
|
}"
|
|
114
115
|
>
|
|
115
116
|
<template v-for="item in group.items">
|
|
116
|
-
<li class="relative list-none p-0" v-if="'items' in item">
|
|
117
|
+
<li class="relative list-none p-0" v-if="item && 'items' in item">
|
|
117
118
|
<DocGroup
|
|
118
119
|
ref="$groups"
|
|
119
120
|
:group="item"
|
package/_DocLink.vue
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NavGroup, NavItemLink } from '
|
|
1
|
+
import { NavGroup, NavItemLink } from '@cypress-design/constants-docmenu';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
items: (NavItemLink | NavGroup)[];
|
|
4
4
|
collapsible?: boolean | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DocMenu.vue.d.ts","sourceRoot":"","sources":["../DocMenu.vue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;;WAoB9D,CAAC,WAAW,GAAG,QAAQ,CAAC,EAAE;;;;;WAA1B,CAAC,WAAW,GAAG,QAAQ,CAAC,EAAE;;;;;iBACnB,OAAO;;AAjBzB,wBAiGc;AACd,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;QACzD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,GAAG,CAAC,CAAC,CAAC,CAAC;CACR,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
|
-
import { NavGroup } from '
|
|
2
|
+
import { NavGroup } from '@cypress-design/constants-docmenu';
|
|
3
3
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
group: NavGroup;
|
|
5
5
|
collapsible: boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_DocGroup.vue.d.ts","sourceRoot":"","sources":["../_DocGroup.vue.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,GAAG,EAAO,MAAM,KAAK,CAAA;AAExC,OAAO,EAAE,QAAQ,EAAW,MAAM,mCAAmC,CAAA;;WAgE1D,QAAQ;iBACF,OAAO;;;;;YAMd,IAAI,MAAM,CAAC;;WAPV,QAAQ;iBACF,OAAO;;;;;WACZ,MAAM;;AA9DlB,wBA8Nc;AACd,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;QACzD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,GAAG,CAAC,CAAC,CAAC,CAAC;CACR,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NavItemLink } from '
|
|
1
|
+
import type { NavItemLink } from '@cypress-design/constants-docmenu';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
3
3
|
item: NavItemLink;
|
|
4
4
|
depth?: number | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_DocLink.vue.d.ts","sourceRoot":"","sources":["../_DocLink.vue.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;;UAmB1D,WAAW;;iBAEJ,OAAO;;;;UAFd,WAAW;;iBAEJ,OAAO;;;;WADZ,MAAM;;AAlBlB,wBAqGc;AACd,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AACjE,KAAK,6BAA6B,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CAAE,CAAC;AAC9M,KAAK,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAI;KAE1B,CAAC,IAAI,MAAM,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG;QACzD,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;KACb,GAAG,CAAC,CAAC,CAAC,CAAC;CACR,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAA;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/index.es.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as I, defineComponent as C, openBlock as o, createElementBlock as i, normalizeClass as d, createElementVNode as z, normalizeStyle as B, createCommentVNode as y, createTextVNode as D, toDisplayString as O, ref as $, computed as v, Fragment as h, createBlock as
|
|
1
|
+
import { h as I, defineComponent as C, openBlock as o, createElementBlock as i, normalizeClass as d, createElementVNode as z, normalizeStyle as B, createCommentVNode as y, createTextVNode as D, toDisplayString as O, ref as $, computed as v, Fragment as h, createBlock as g, resolveDynamicComponent as L, unref as c, withCtx as M, withDirectives as V, renderList as N, createVNode as S, vShow as G } from "vue";
|
|
2
2
|
import * as H from "@cypress-design/icon-registry";
|
|
3
3
|
import { ICON_COLOR_PROP_NAMES as T } from "@cypress-design/icon-registry";
|
|
4
4
|
const A = ({
|
|
@@ -9,8 +9,8 @@ const A = ({
|
|
|
9
9
|
interactiveColorsOnGroup: p,
|
|
10
10
|
...m
|
|
11
11
|
}) => {
|
|
12
|
-
const
|
|
13
|
-
(
|
|
12
|
+
const x = Object.keys(m).reduce(
|
|
13
|
+
(s, n) => (!T.includes(n) && n !== "name" && (s[n] = m[n]), s),
|
|
14
14
|
{}
|
|
15
15
|
), f = {
|
|
16
16
|
width: t,
|
|
@@ -18,7 +18,7 @@ const A = ({
|
|
|
18
18
|
viewBox: `0 0 ${t} ${t}`,
|
|
19
19
|
fill: "none",
|
|
20
20
|
innerHTML: e,
|
|
21
|
-
...
|
|
21
|
+
...x
|
|
22
22
|
// add all standard attributes back to the svg tag
|
|
23
23
|
};
|
|
24
24
|
return a.length && (f.class = a.join(" ")), f;
|
|
@@ -85,32 +85,33 @@ const A = ({
|
|
|
85
85
|
},
|
|
86
86
|
setup(e, { expose: a }) {
|
|
87
87
|
const t = e, l = $(t.depth === 0), p = $([]), m = v(() => p.value && l.value ? p.value.reduce(
|
|
88
|
-
(
|
|
88
|
+
(s, { height: n }) => s + n,
|
|
89
89
|
t.group.items.length
|
|
90
90
|
) : 0);
|
|
91
91
|
a({
|
|
92
92
|
height: m
|
|
93
93
|
});
|
|
94
|
-
const
|
|
94
|
+
const x = v(() => {
|
|
95
95
|
var w;
|
|
96
|
-
const
|
|
96
|
+
const s = t.group.items.findIndex(
|
|
97
97
|
(u) => "href" in u && u.active
|
|
98
98
|
);
|
|
99
99
|
let n = t.group.items.filter(
|
|
100
|
-
(u, b) => !("href" in u) && b <
|
|
100
|
+
(u, b) => !("href" in u) && b < s
|
|
101
101
|
).length;
|
|
102
|
-
const
|
|
103
|
-
return (
|
|
102
|
+
const r = (w = p.value) == null ? void 0 : w.reduce((u, b) => n < -1 ? u : (n--, u + b.height), 0);
|
|
103
|
+
return (s + r) * 44;
|
|
104
104
|
}), f = v(
|
|
105
105
|
() => t.collapsible ? "button" : t.group.href ? "a" : "div"
|
|
106
106
|
);
|
|
107
|
-
return (
|
|
108
|
-
(o(),
|
|
107
|
+
return (s, n) => (o(), i(h, null, [
|
|
108
|
+
(o(), g(L(c(f)), {
|
|
109
109
|
class: d([
|
|
110
110
|
c(k).button,
|
|
111
111
|
{
|
|
112
112
|
[c(k).topButton]: e.depth === 0,
|
|
113
|
-
[c(k).leafButton]: e.depth
|
|
113
|
+
[c(k).leafButton]: e.depth,
|
|
114
|
+
"text-indigo-500 dark:text-indigo-200": t.group.active
|
|
114
115
|
}
|
|
115
116
|
]),
|
|
116
117
|
href: t.group.href,
|
|
@@ -119,7 +120,7 @@ const A = ({
|
|
|
119
120
|
})
|
|
120
121
|
}, {
|
|
121
122
|
default: M(() => [
|
|
122
|
-
t.collapsible ? (o(),
|
|
123
|
+
t.collapsible ? (o(), g(c(P), {
|
|
123
124
|
key: 0,
|
|
124
125
|
"stroke-color": "gray-400",
|
|
125
126
|
size: e.depth ? "8" : "16",
|
|
@@ -133,11 +134,11 @@ const A = ({
|
|
|
133
134
|
]),
|
|
134
135
|
_: 1
|
|
135
136
|
}, 8, ["class", "href"])),
|
|
136
|
-
t.collapsible && e.depth >= 0 && l.value && e.group.items.some((
|
|
137
|
+
t.collapsible && e.depth >= 0 && l.value && e.group.items.some((r) => "href" in r && r.active) ? (o(), i("div", {
|
|
137
138
|
key: 0,
|
|
138
139
|
class: "absolute h-[36px] w-[4px] z-10 rounded-full bg-indigo-500 transition-all duration-300 ml-[6px] mt-[48px]",
|
|
139
140
|
style: B({
|
|
140
|
-
top: `${c(
|
|
141
|
+
top: `${c(x)}px`,
|
|
141
142
|
left: `-${e.depth === 0 ? 0 : e.depth * 7.5 + 1}px`
|
|
142
143
|
})
|
|
143
144
|
}, null, 4)) : y("", !0),
|
|
@@ -146,19 +147,19 @@ const A = ({
|
|
|
146
147
|
"border-l border-gray-100": e.depth === 0 && t.collapsible
|
|
147
148
|
}])
|
|
148
149
|
}, [
|
|
149
|
-
(o(!0), i(h, null, N(e.group.items, (
|
|
150
|
-
"items" in
|
|
150
|
+
(o(!0), i(h, null, N(e.group.items, (r) => (o(), i(h, null, [
|
|
151
|
+
r && "items" in r ? (o(), i("li", F, [
|
|
151
152
|
S(E, {
|
|
152
153
|
ref_for: !0,
|
|
153
154
|
ref_key: "$groups",
|
|
154
155
|
ref: p,
|
|
155
|
-
group:
|
|
156
|
+
group: r,
|
|
156
157
|
depth: e.depth + 1,
|
|
157
158
|
collapsible: t.collapsible
|
|
158
159
|
}, null, 8, ["group", "depth", "collapsible"])
|
|
159
|
-
])) : (o(),
|
|
160
|
+
])) : (o(), g(j, {
|
|
160
161
|
key: 1,
|
|
161
|
-
item:
|
|
162
|
+
item: r,
|
|
162
163
|
depth: e.depth,
|
|
163
164
|
collapsible: e.collapsible
|
|
164
165
|
}, null, 8, ["item", "depth", "collapsible"]))
|
|
@@ -186,7 +187,7 @@ const A = ({
|
|
|
186
187
|
depth: 0,
|
|
187
188
|
collapsible: e.collapsible
|
|
188
189
|
}, null, 8, ["group", "collapsible"])
|
|
189
|
-
])) : (o(),
|
|
190
|
+
])) : (o(), g(j, {
|
|
190
191
|
key: 1,
|
|
191
192
|
item: l,
|
|
192
193
|
collapsible: e.collapsible
|
|
@@ -200,4 +201,4 @@ export {
|
|
|
200
201
|
};
|
|
201
202
|
//# sourceMappingURL=index.es.mjs.map
|
|
202
203
|
|
|
203
|
-
/* <windicss-keep class="overflow-y-hidden list-none p-0 relative absolute left-0 transform transition-transform rotate-0 -rotate-90 ml-[16px] h-[36px] w-[4px] z-10 rounded-full bg-indigo-500 transition-all duration-300 ml-[6px] mt-[48px] ml-[7.5px] border-l border-gray-100 icon-dark-gray-400 pl-[16px] block w-full pl-[24px]
|
|
204
|
+
/* <windicss-keep class="overflow-y-hidden list-none p-0 relative text-indigo-500 dark:text-indigo-200 absolute left-0 transform transition-transform rotate-0 -rotate-90 ml-[16px] h-[36px] w-[4px] z-10 rounded-full bg-indigo-500 transition-all duration-300 ml-[6px] mt-[48px] ml-[7.5px] border-l border-gray-100 icon-dark-gray-400 pl-[16px] block w-full pl-[24px] py-[8px] text-[16px] leading-[24px] leading-[20px] text-[14px] py-[12px] h-[80%] top-[10%] hidden group-hover:block bg-gray-300"> */
|