@c2n/side-nav 0.0.6 → 0.0.8
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/side-nav.js +2 -1
- package/package.json +18 -6
- package/react.d.ts +24 -0
- package/react.js +3 -0
- package/types/src/side-nav.d.ts +9 -0
- package/types/src/side-nav.d.ts.map +1 -1
- package/vue.d.ts +36 -0
- package/vue.js +3 -0
package/dist/side-nav.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement, html, nothing, unsafeCSS } from "lit";
|
|
2
|
-
import {
|
|
2
|
+
import { property, query, state } from "lit/decorators.js";
|
|
3
|
+
import { customElement } from "@c2n/core/element-helper.js";
|
|
3
4
|
import { isServer } from "lit-html/is-server.js";
|
|
4
5
|
import { classMap } from "lit/directives/class-map.js";
|
|
5
6
|
import { BreakpointsObserver } from "@c2n/core/controllers/breakpoints-observer.js";
|
package/package.json
CHANGED
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@c2n/side-nav",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/side-nav.js",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"types": "./types/src/side-nav.d.ts",
|
|
9
|
+
"default": "./dist/side-nav.js"
|
|
10
|
+
},
|
|
11
|
+
"./react": {
|
|
12
|
+
"types": "./react.d.ts",
|
|
13
|
+
"default": "./react.js"
|
|
14
|
+
},
|
|
15
|
+
"./vue": {
|
|
16
|
+
"types": "./vue.d.ts",
|
|
17
|
+
"default": "./vue.js"
|
|
10
18
|
},
|
|
11
19
|
"./custom-elements.json": "./custom-elements.json"
|
|
12
20
|
},
|
|
13
21
|
"files": [
|
|
14
22
|
"dist",
|
|
15
|
-
"types"
|
|
23
|
+
"types",
|
|
24
|
+
"react.d.ts",
|
|
25
|
+
"react.js",
|
|
26
|
+
"vue.d.ts",
|
|
27
|
+
"vue.js"
|
|
16
28
|
],
|
|
17
29
|
"keywords": [
|
|
18
30
|
"side-nav",
|
|
@@ -49,12 +61,12 @@
|
|
|
49
61
|
}
|
|
50
62
|
},
|
|
51
63
|
"dependencies": {
|
|
52
|
-
"@c2n/core": "0.0.
|
|
64
|
+
"@c2n/core": "0.0.8",
|
|
53
65
|
"lit": "3.3.3"
|
|
54
66
|
},
|
|
55
67
|
"devDependencies": {
|
|
56
68
|
"@c2n/config": "*"
|
|
57
69
|
},
|
|
58
70
|
"customElements": "custom-elements.json",
|
|
59
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "be59cbccee1d33ca248e39f69b05c0b595ec6c6d"
|
|
60
72
|
}
|
package/react.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// GENERATED by @c2n/framework-types. Do not edit by hand.
|
|
2
|
+
//
|
|
3
|
+
// JSX types for the custom elements of @c2n/side-nav. Import once, anywhere in the program:
|
|
4
|
+
//
|
|
5
|
+
// import '@c2n/side-nav/react'
|
|
6
|
+
//
|
|
7
|
+
// Register the elements at module scope before React renders, or React writes an object prop as an
|
|
8
|
+
// attribute and it stringifies.
|
|
9
|
+
|
|
10
|
+
import type { DetailedHTMLProps, HTMLAttributes } from 'react'
|
|
11
|
+
import type { SideNav } from '@c2n/side-nav'
|
|
12
|
+
|
|
13
|
+
/** Standard React host-element attributes plus the element's own public properties. */
|
|
14
|
+
type C2Props<T> = DetailedHTMLProps<HTMLAttributes<T>, T> & Partial<Omit<T, keyof HTMLElement>>
|
|
15
|
+
|
|
16
|
+
declare module 'react' {
|
|
17
|
+
namespace JSX {
|
|
18
|
+
interface IntrinsicElements {
|
|
19
|
+
'c2-side-nav': C2Props<SideNav>
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export {}
|
package/react.js
ADDED
package/types/src/side-nav.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { LitElement, type PropertyValues } from 'lit';
|
|
2
|
+
import type { TypedAddEventListener, TypedRemoveEventListener } from '@c2n/core/event-helper.js';
|
|
2
3
|
export type DisplayMode = 'over' | 'side';
|
|
3
4
|
export type SideNavPosition = 'start' | 'end';
|
|
4
5
|
export type SideNavBreakpoint = 'phone' | 'tablet' | 'desktop';
|
|
5
6
|
export interface OpenedChangeEventDetail {
|
|
6
7
|
opened: boolean;
|
|
7
8
|
}
|
|
9
|
+
/** Events fired by {@link SideNav}, keyed for `addEventListener`. */
|
|
10
|
+
export interface SideNavEventMap {
|
|
11
|
+
'opened-change': CustomEvent<OpenedChangeEventDetail>;
|
|
12
|
+
}
|
|
13
|
+
export interface SideNav {
|
|
14
|
+
addEventListener: TypedAddEventListener<SideNav, SideNavEventMap>;
|
|
15
|
+
removeEventListener: TypedRemoveEventListener<SideNav, SideNavEventMap>;
|
|
16
|
+
}
|
|
8
17
|
/**
|
|
9
18
|
* A layout shell with a navigation drawer beside the page content. The drawer goes in the `side-nav-content` slot, the
|
|
10
19
|
* page in the default slot, and the host stretches both to its own height. In `side` mode the drawer collapses in the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"side-nav.d.ts","sourceRoot":"","sources":["../../src/side-nav.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"side-nav.d.ts","sourceRoot":"","sources":["../../src/side-nav.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,KAAK,cAAc,EAAE,MAAM,KAAK,CAAA;AAG/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAOhG,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAA;AACzC,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,KAAK,CAAA;A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IAMtB,OAAO,CAAC,gBAAgB;IAqBxB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,mBAAmB,CAE1B;IAED,OAAO,CAAC,aAAa,CAKpB;IAED,uGAAuG;IACvG,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,UAAU;IAQlB,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,WAAW;IAYnB,wGAAwG;IACxG,OAAO,KAAK,WAAW,GAMtB;cAEkB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI;IAYhD,MAAM;CAwBhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,OAAO,CAAA;KACvB;CACF"}
|
package/vue.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// GENERATED by @c2n/framework-types. Do not edit by hand.
|
|
2
|
+
//
|
|
3
|
+
// Vue template types for the custom elements of @c2n/side-nav. Import once, anywhere in the program:
|
|
4
|
+
//
|
|
5
|
+
// import '@c2n/side-nav/vue'
|
|
6
|
+
//
|
|
7
|
+
// Tell the compiler about the tags as well, or every c2-* tag is resolved as a Vue component and renders
|
|
8
|
+
// nothing: template.compilerOptions.isCustomElement = (tag) => tag.startsWith('c2-') in vite.config.ts.
|
|
9
|
+
|
|
10
|
+
import type { DefineComponent, HTMLAttributes } from 'vue'
|
|
11
|
+
import type { SideNav, SideNavEventMap } from '@c2n/side-nav'
|
|
12
|
+
|
|
13
|
+
/** The element's own public properties, plus every attribute Vue understands on a host element. */
|
|
14
|
+
type C2Props<T> = Partial<Omit<T, keyof HTMLElement>> & HTMLAttributes
|
|
15
|
+
|
|
16
|
+
declare module 'vue' {
|
|
17
|
+
interface GlobalComponents {
|
|
18
|
+
'c2-side-nav': DefineComponent<
|
|
19
|
+
C2Props<SideNav> & {
|
|
20
|
+
'desktop-mode'?: unknown
|
|
21
|
+
'tablet-mode'?: unknown
|
|
22
|
+
'responsive-tablet'?: unknown
|
|
23
|
+
onOpenedChange?: (event: SideNavEventMap['opened-change']) => void
|
|
24
|
+
}
|
|
25
|
+
>
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare module '@vue/runtime-dom' {
|
|
30
|
+
interface HTMLAttributes {
|
|
31
|
+
/** Vue's own definition omits it, and slotting a plain element into a component needs it. */
|
|
32
|
+
slot?: string
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export {}
|
package/vue.js
ADDED