@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.
@@ -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
- vite v4.2.1 building for production...
4
+ vite v4.2.2 building for production...
5
5
  transforming...
6
6
  ✓ 9 modules transformed.
7
7
  rendering chunks...
8
8
  computing gzip size...
9
- dist/index.es.mjs 7.14 kB │ gzip: 2.53 kB │ map: 262.85 kB
10
- dist/index.umd.js 6.15 kB │ gzip: 2.31 kB │ map: 262.53 kB
11
- ✓ built in 6.20s
9
+ dist/index.es.mjs 7.16 kB │ gzip: 2.53 kB │ map: 262.71 kB
10
+ dist/index.umd.js 6.16 kB │ gzip: 2.31 kB │ map: 262.39 kB
11
+ ✓ 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
@@ -1,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import { NavGroup, NavItemLink } from '../constants'
2
+ import { NavGroup, NavItemLink } from '@cypress-design/constants-docmenu'
3
3
  import DocGroup from './_DocGroup.vue'
4
4
  import DocLink from './_DocLink.vue'
5
5
 
package/ReadMe.md CHANGED
@@ -1,9 +1,5 @@
1
1
  # DocMenu
2
2
 
3
- ## Summary
4
-
5
- Describe your component here.
6
-
7
3
  ## Install
8
4
 
9
5
  ```bash
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 '../constants'
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<(typeof DocGroup)[]>([])
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,5 +1,5 @@
1
1
  <script lang="ts" setup>
2
- import type { NavItemLink } from '../constants'
2
+ import type { NavItemLink } from '@cypress-design/constants-docmenu'
3
3
 
4
4
  withDefaults(
5
5
  defineProps<{
@@ -1,4 +1,4 @@
1
- import { NavGroup, NavItemLink } from '../constants';
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 '../constants';
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 '../constants';
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"}
@@ -0,0 +1,3 @@
1
+ export type { NavItemLink, NavGroup } from '@cypress-design/constants-docmenu';
2
+ export { default } from './DocMenu.vue';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -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 x, resolveDynamicComponent as L, unref as c, withCtx as M, withDirectives as V, renderList as N, createVNode as S, vShow as G } from "vue";
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 g = Object.keys(m).reduce(
13
- (r, n) => (!T.includes(n) && n !== "name" && (r[n] = m[n]), r),
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
- ...g
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
- (r, { height: n }) => r + n,
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 g = v(() => {
94
+ const x = v(() => {
95
95
  var w;
96
- const r = t.group.items.findIndex(
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 < r
100
+ (u, b) => !("href" in u) && b < s
101
101
  ).length;
102
- const s = (w = p.value) == null ? void 0 : w.reduce((u, b) => n < -1 ? u : (n--, u + b.height), 0);
103
- return (r + s) * 44;
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 (r, n) => (o(), i(h, null, [
108
- (o(), x(L(c(f)), {
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(), x(c(P), {
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((s) => "href" in s && s.active) ? (o(), i("div", {
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(g)}px`,
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, (s) => (o(), i(h, null, [
150
- "items" in s ? (o(), i("li", F, [
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: s,
156
+ group: r,
156
157
  depth: e.depth + 1,
157
158
  collapsible: t.collapsible
158
159
  }, null, 8, ["group", "depth", "collapsible"])
159
- ])) : (o(), x(j, {
160
+ ])) : (o(), g(j, {
160
161
  key: 1,
161
- item: s,
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(), x(j, {
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] text-indigo-500 dark:text-indigo-200 py-[8px] text-[16px] leading-[24px] leading-[20px] text-[14px] py-[12px] h-[80%] top-[10%] hidden group-hover:block bg-gray-300 flex py-[10px] items-center font-medium pl-[40px]"> */
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"> */