nightshade 1.5.0 → 2.0.0-dev.3

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.
Files changed (47) hide show
  1. package/package.json +11 -38
  2. package/dist/ListNavController-drNtDwz9.js +0 -307
  3. package/dist/ThemeManager-DzxPhS21.js +0 -57
  4. package/dist/bundle.js +0 -31
  5. package/dist/components.css +0 -1
  6. package/dist/components.js +0 -19
  7. package/dist/index-DZX8JG-_.js +0 -1063
  8. package/dist/lib/components/Btn.vue.d.ts +0 -173
  9. package/dist/lib/components/Bubble.vue.d.ts +0 -23
  10. package/dist/lib/components/Circle.vue.d.ts +0 -14
  11. package/dist/lib/components/ContextMenu.vue.d.ts +0 -81
  12. package/dist/lib/components/ContextPopup.vue.d.ts +0 -86
  13. package/dist/lib/components/HGroup.vue.d.ts +0 -47
  14. package/dist/lib/components/HStack.vue.d.ts +0 -2
  15. package/dist/lib/components/InputBase.vue.d.ts +0 -121
  16. package/dist/lib/components/InputSelect.vue.d.ts +0 -20
  17. package/dist/lib/components/InputText.vue.d.ts +0 -11
  18. package/dist/lib/components/InputTextarea.vue.d.ts +0 -11
  19. package/dist/lib/components/Sizer.vue.d.ts +0 -2
  20. package/dist/lib/components/Switch.vue.d.ts +0 -77
  21. package/dist/lib/components/Tab.vue.d.ts +0 -22
  22. package/dist/lib/components/TabCap.vue.d.ts +0 -23
  23. package/dist/lib/components/VGroup.vue.d.ts +0 -38
  24. package/dist/lib/components/index.d.ts +0 -17
  25. package/dist/lib/index.d.ts +0 -4
  26. package/dist/lib/utils/ExpanderController.d.ts +0 -11
  27. package/dist/lib/utils/ListNavController.d.ts +0 -92
  28. package/dist/lib/utils/SelectionController.d.ts +0 -16
  29. package/dist/lib/utils/ThemeManager.d.ts +0 -15
  30. package/dist/lib/utils/dom.d.ts +0 -4
  31. package/dist/lib/utils/event-proxy.d.ts +0 -22
  32. package/dist/lib/utils/icons.d.ts +0 -3
  33. package/dist/lib/utils/index.d.ts +0 -8
  34. package/dist/lib/utils/point.d.ts +0 -4
  35. package/dist/utils.js +0 -13
  36. package/stylesheets/baseline.css +0 -50
  37. package/stylesheets/full.css +0 -7
  38. package/stylesheets/modules/article.css +0 -37
  39. package/stylesheets/modules/kbd.css +0 -34
  40. package/stylesheets/modules/transitions.css +0 -106
  41. package/stylesheets/modules/utils.css +0 -44
  42. package/stylesheets/variables/color-tokens.css +0 -168
  43. package/stylesheets/variables/commons.css +0 -37
  44. package/stylesheets/variables/spacing.css +0 -20
  45. package/stylesheets/variables/type-tokens.css +0 -18
  46. package/stylesheets/variables/typography.css +0 -16
  47. package/stylesheets/variables.css +0 -5
@@ -1,22 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- dir: {
3
- type: StringConstructor;
4
- default: string;
5
- };
6
- label: {
7
- type: StringConstructor;
8
- };
9
- }>, {}, {}, {
10
- orientation(): "v" | "h";
11
- }, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
12
- dir: {
13
- type: StringConstructor;
14
- default: string;
15
- };
16
- label: {
17
- type: StringConstructor;
18
- };
19
- }>> & Readonly<{}>, {
20
- dir: string;
21
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
22
- export default _default;
@@ -1,23 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- dir: {
3
- type: StringConstructor;
4
- default: string;
5
- };
6
- type: {
7
- type: StringConstructor;
8
- default: string;
9
- };
10
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
11
- dir: {
12
- type: StringConstructor;
13
- default: string;
14
- };
15
- type: {
16
- type: StringConstructor;
17
- default: string;
18
- };
19
- }>> & Readonly<{}>, {
20
- type: string;
21
- dir: string;
22
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
23
- export default _default;
@@ -1,38 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
- tagName: {
3
- type: StringConstructor;
4
- default: string;
5
- };
6
- align: {
7
- type: StringConstructor;
8
- default: string;
9
- };
10
- justify: {
11
- type: StringConstructor;
12
- };
13
- gap: {
14
- type: StringConstructor;
15
- default: string;
16
- };
17
- }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
18
- tagName: {
19
- type: StringConstructor;
20
- default: string;
21
- };
22
- align: {
23
- type: StringConstructor;
24
- default: string;
25
- };
26
- justify: {
27
- type: StringConstructor;
28
- };
29
- gap: {
30
- type: StringConstructor;
31
- default: string;
32
- };
33
- }>> & Readonly<{}>, {
34
- tagName: string;
35
- align: string;
36
- gap: string;
37
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
38
- export default _default;
@@ -1,17 +0,0 @@
1
- import { default as Btn } from './Btn.vue';
2
- import { default as Bubble } from './Bubble.vue';
3
- import { default as Circle } from './Circle.vue';
4
- import { default as ContextMenu } from './ContextMenu.vue';
5
- import { default as ContextPopup } from './ContextPopup.vue';
6
- import { default as HGroup } from './HGroup.vue';
7
- import { default as HStack } from './HStack.vue';
8
- import { default as InputBase } from './InputBase.vue';
9
- import { default as InputSelect } from './InputSelect.vue';
10
- import { default as InputText } from './InputText.vue';
11
- import { default as InputTextarea } from './InputTextarea.vue';
12
- import { default as Sizer } from './Sizer.vue';
13
- import { default as Switch } from './Switch.vue';
14
- import { default as Tab } from './Tab.vue';
15
- import { default as TabCap } from './TabCap.vue';
16
- import { default as VGroup } from './VGroup.vue';
17
- export { Btn, Bubble, Circle, ContextMenu, ContextPopup, HGroup, HStack, InputBase, InputSelect, InputText, InputTextarea, Sizer, Switch, Tab, TabCap, VGroup, };
@@ -1,4 +0,0 @@
1
- import * as components from './components/index.js';
2
- export * from './components/index.js';
3
- export * from './utils/index.js';
4
- export { components, };
@@ -1,11 +0,0 @@
1
- import { Event } from 'nanoevent';
2
- export declare class ExpanderController {
3
- expandedIds: Set<string>;
4
- changed: Event<void>;
5
- setExpandedIds(ids: Iterable<string>): void;
6
- isExpanded(id: string): boolean;
7
- toggle(id: string): void;
8
- expand(id: string): void;
9
- collapse(id: string): void;
10
- collapseAll(): void;
11
- }
@@ -1,92 +0,0 @@
1
- import { Event } from 'nanoevent';
2
- import { DomEventProxy } from './event-proxy.js';
3
- import { ExpanderController } from './ExpanderController.js';
4
- import { SelectionController } from './SelectionController.js';
5
- export interface ListNavConfig {
6
- selector: string;
7
- selection?: SelectionController;
8
- expander?: ExpanderController;
9
- multiSelect?: boolean;
10
- selectOnFocus?: boolean;
11
- allowDrag?: boolean;
12
- canExpand?: (id: string) => boolean;
13
- resolveId?: (el: HTMLElement) => string;
14
- }
15
- /**
16
- * Facilitates keyboard + mouse navigation:
17
- *
18
- * - Up/Down keys move selection visually (i.e. in the order the visible elements appear in DOM)
19
- * - Shift + Up/Down keys extend the selection
20
- * - Click selects a single item
21
- * - Shift+Click extends the selection
22
- * - Meta+Click adds/removes the selection
23
- *
24
- * Selection extension is implemented using _anchor_ and _focus_, following a widespread UX pattern,
25
- * which is also similar to how text selection is implemented in modern editors.
26
- * Anchor is defined when selected without extension; focus is the most recently selected element.
27
- * When selection extension is made, the selection "revolves" around anchor.
28
- *
29
- * Usage:
30
- *
31
- * - Create a listNav instance either on the component or in one of the managers/controllers.
32
- * - Component level is good for short-lived components like popups that don't need
33
- * to persist or reuse/restore the selection state.
34
- * - Decorate list items with a data- attribute containing item id. Use that as a selector.
35
- * - Create a container arount list items.
36
- * - Call `.mount(container)` and `.destroy()` in `mounted` and `unmounted` hooks respectively.
37
- * - (optional) Make sure the list items are focusable, this allows moving focus with Tab as well as arrow keys.
38
- * - (optional) Apply styling based on selected state. Use `:focus-within` on container/wrapper
39
- * to emphasize/deemphasize the selected items.
40
- */
41
- export declare class ListNavController {
42
- selector: string;
43
- selection: SelectionController;
44
- expander: ExpanderController;
45
- multiSelect: boolean;
46
- selectOnFocus: boolean;
47
- allowDrag: boolean;
48
- canExpand: (id: string) => boolean;
49
- resolveId: (el: HTMLElement) => string;
50
- protected container: HTMLElement | null;
51
- protected containerEvents: DomEventProxy | null;
52
- protected windowEvents: DomEventProxy | null;
53
- protected anchorId: string;
54
- protected focusId: string;
55
- protected snapshotIds: string[];
56
- protected snapshotEls: HTMLElement[];
57
- protected dragging: boolean;
58
- dragStart: Event<MouseEvent>;
59
- dragEnd: Event<MouseEvent>;
60
- constructor(config: ListNavConfig);
61
- mount(container: HTMLElement): void;
62
- destroy(): void;
63
- isDragging(): boolean;
64
- /**
65
- * Manages keyboard navigation. Note: ev.preventDefault is required to avoid
66
- * arrow keys messing with scroll bars.
67
- */
68
- protected onKeyDown(ev: KeyboardEvent): void;
69
- protected onMouseDown(ev: MouseEvent): void;
70
- protected onMouseUp(ev: MouseEvent): void;
71
- protected onClickIntent(ev: MouseEvent): void;
72
- protected onDragStart(ev: MouseEvent): void;
73
- protected onFocus(ev: FocusEvent): void;
74
- queryEls(): HTMLElement[];
75
- protected appendSelection(targetId: string): void;
76
- protected toggleSelection(targetId: string): void;
77
- protected extendSelection(targetId: string): void;
78
- protected replaceSelection(targetId: string): void;
79
- deselect(targetId: string): void;
80
- moveSelection(increment: number, extend: boolean): void;
81
- selectFirst(): void;
82
- isFirstSelected(): boolean;
83
- collapse(): void;
84
- expand(): void;
85
- snapshot(): void;
86
- protected getTargetId(eventTarget: EventTarget | null): string;
87
- /**
88
- * Get the ids between `from` and `to`, both inclusive.
89
- */
90
- protected findRange(ids: string[], from: string, to: string): string[];
91
- protected updateFocus(): void;
92
- }
@@ -1,16 +0,0 @@
1
- import { Event } from 'nanoevent';
2
- export declare class SelectionController {
3
- selectedIds: Set<string>;
4
- changed: Event<void>;
5
- get size(): number;
6
- getSelectedIds(): string[];
7
- getFirst(): string | null;
8
- isSelected(id: string): boolean;
9
- isSingleSelected(id: string): boolean;
10
- setSelectedIds(ids: Iterable<string>): void;
11
- selectSingle(id: string): void;
12
- addToSelection(...ids: string[]): void;
13
- removeFromSelection(...ids: string[]): void;
14
- toggleSelection(id: string): void;
15
- deselectAll(): void;
16
- }
@@ -1,15 +0,0 @@
1
- import { Plugin } from 'vue';
2
- export type ThemeToken = 'light' | 'dark' | 'auto';
3
- export declare const themePlugin: Plugin;
4
- export declare class ThemeManager {
5
- currentTheme: ThemeToken;
6
- init(): void;
7
- setTheme(theme: ThemeToken): void;
8
- toggleTheme(): void;
9
- protected applyTheme(): void;
10
- protected loadTheme(): void;
11
- protected saveTheme(): void;
12
- protected listenForSystemThemeChanges(): void;
13
- protected getLocalStorageTheme(): ThemeToken;
14
- protected getSystemTheme(): ThemeToken;
15
- }
@@ -1,4 +0,0 @@
1
- import { Point } from './point.js';
2
- export type AnchorDir = 'middle' | 'top' | 'bottom' | 'left' | 'right';
3
- export declare function getAnchorPoint(el: HTMLElement, dir: AnchorDir): Point;
4
- export declare function isInputElement(el: any): boolean;
@@ -1,22 +0,0 @@
1
- type EventListener = (ev: any) => void;
2
- interface EventListenerDesc {
3
- eventName: string;
4
- listener: EventListener;
5
- options?: boolean | AddEventListenerOptions;
6
- }
7
- /**
8
- * A helper to effortlessly bind and unbind events to DOM elements.
9
- * This class keeps track of event listeners bound by using `add` method
10
- * and then allows quickly unbind by event name or all of them.
11
- *
12
- * Note: exactly 1 event listener can be bound to each type of event.
13
- */
14
- export declare class DomEventProxy {
15
- readonly target: EventTarget;
16
- listeners: Map<string, EventListenerDesc>;
17
- constructor(target: EventTarget);
18
- add(eventName: string, listener: EventListener, options?: boolean | AddEventListenerOptions): void;
19
- remove(eventName: string): void;
20
- removeAll(): void;
21
- }
22
- export {};
@@ -1,3 +0,0 @@
1
- import { Plugin } from 'vue';
2
- export type IconOptions = Record<string, string | undefined>;
3
- export declare const iconsPlugin: Plugin<IconOptions>;
@@ -1,8 +0,0 @@
1
- export * from './dom.js';
2
- export * from './event-proxy.js';
3
- export * from './ExpanderController.js';
4
- export * from './icons.js';
5
- export * from './ListNavController.js';
6
- export * from './point.js';
7
- export * from './SelectionController.js';
8
- export * from './ThemeManager.js';
@@ -1,4 +0,0 @@
1
- export interface Point {
2
- x: number;
3
- y: number;
4
- }
package/dist/utils.js DELETED
@@ -1,13 +0,0 @@
1
- import { D as n, E as r, L as t, S as a, g as s, i as l } from "./ListNavController-drNtDwz9.js";
2
- import { T as m, i as g, t as p } from "./ThemeManager-DzxPhS21.js";
3
- export {
4
- n as DomEventProxy,
5
- r as ExpanderController,
6
- t as ListNavController,
7
- a as SelectionController,
8
- m as ThemeManager,
9
- s as getAnchorPoint,
10
- g as iconsPlugin,
11
- l as isInputElement,
12
- p as themePlugin
13
- };
@@ -1,50 +0,0 @@
1
- * {
2
- box-sizing: border-box;
3
- }
4
-
5
- html,
6
- body,
7
- img,
8
- form {
9
- margin: 0;
10
- padding: 0;
11
- border: 0;
12
- }
13
-
14
- html {
15
- font-size: var(--font-size);
16
- font-family: var(--font-main);
17
- font-weight: var(--font-weight);
18
- line-height: var(--line-height);
19
-
20
- color: var(--text-color);
21
- background: var(--background-color);
22
-
23
- text-rendering: optimizeLegibility;
24
- }
25
-
26
- a {
27
- color: currentColor;
28
- text-decoration: none;
29
- cursor: pointer;
30
- }
31
-
32
- button,
33
- input,
34
- textarea {
35
- font-family: inherit;
36
- font-size: inherit;
37
- }
38
-
39
- input[type="checkbox"],
40
- input[type="radio"],
41
- input[type="range"],
42
- input[type="button"],
43
- input[type="submit"],
44
- button {
45
- cursor: pointer;
46
- }
47
-
48
- b, strong {
49
- font-weight: var(--font-weight-bold);
50
- }
@@ -1,7 +0,0 @@
1
- @import './variables.css';
2
- @import './baseline.css';
3
-
4
- @import './modules/article.css';
5
- @import './modules/kbd.css';
6
- @import './modules/transitions.css';
7
- @import './modules/utils.css';
@@ -1,37 +0,0 @@
1
- article {
2
-
3
- a {
4
- color: var(--link-color);
5
- }
6
-
7
- a:hover {
8
- color: var(--link-color-hover);
9
- }
10
-
11
- code {
12
- font: 12px/1.4 var(--font-monospace)
13
- }
14
-
15
- :not(pre) > code {
16
- color: var(--code-color);
17
- white-space: nowrap;
18
- }
19
-
20
- pre {
21
- line-height: 1.2em;
22
- white-space: pre-wrap;
23
- }
24
-
25
- p, ul, ol, dl {
26
- margin: 1em 0;
27
- }
28
-
29
- h1, h2, h3, h4, h5, h6 {
30
- margin: 1.5em 0 .5em;
31
- }
32
-
33
- li {
34
- margin: .5em 0;
35
- }
36
-
37
- }
@@ -1,34 +0,0 @@
1
- kbd {
2
- position: relative;
3
-
4
- display: inline-block;
5
- text-align: center;
6
-
7
- border: 1px solid var(--color-base-2);
8
- border-bottom-width: 2px;
9
- border-bottom-color: var(--color-base-3);
10
- height: 1.5em;
11
- min-width: 1.5em;
12
- padding: 0 .25em;
13
- margin: 0 2px;
14
- border-radius: 4px;
15
-
16
- font: inherit;
17
- background: var(--color-base-0);
18
- background: radial-gradient(
19
- 100% 100% at 100% 0%,
20
- var(--color-base-0) 0%,
21
- var(--color-base-1) 100%);
22
- }
23
-
24
- kbd::after {
25
- content: '';
26
- position: absolute;
27
- z-index: -1;
28
- top: 2px;
29
- bottom: -4px;
30
- left: -3px;
31
- right: -3px;
32
- border-radius: 4px;
33
- border: 1px solid var(--color-base-4);
34
- }
@@ -1,106 +0,0 @@
1
- /* Fade */
2
-
3
- .fade-enter-active,
4
- .fade-leave-active {
5
- transition: opacity .3s;
6
- }
7
-
8
- .fade-enter-from,
9
- .fade-leave-to {
10
- opacity: 0;
11
- }
12
-
13
- /* Fade Scale */
14
-
15
- .fade-scale-enter-active,
16
- .fade-scale-leave-active {
17
- transition: opacity .5s, transform .5s;
18
- }
19
-
20
- .fade-scale-enter-from {
21
- transform: scale(.75);
22
- opacity: 0;
23
- }
24
-
25
- .fade-scale-leave-to {
26
- transform: scale(1.25);
27
- opacity: 0;
28
- }
29
-
30
- /* Fade Squash */
31
-
32
- .fade-squash-enter-active,
33
- .fade-squash-leave-active {
34
- transition: opacity .25s, transform .25s;
35
- }
36
-
37
- .fade-squash-enter-from,
38
- .fade-squash-leave-to {
39
- transform: scale(10, .1);
40
- opacity: 0;
41
- }
42
-
43
- /* Fade Swipe */
44
-
45
- .fade-swipe-enter-active,
46
- .fade-swipe-leave-active {
47
- transition: opacity .25s, transform .25s;
48
- }
49
-
50
- .fade-swipe-enter-from {
51
- transform: translate(-96px, -32px);
52
- opacity: 0;
53
- }
54
-
55
- .fade-swipe-leave-to {
56
- transform: translate(96px, -32px);
57
- opacity: 0;
58
- }
59
-
60
- /* Fade Shove */
61
-
62
- .fade-shove-enter-active,
63
- .fade-shove-leave-active {
64
- transition: opacity .3s, transform .3s;
65
- }
66
-
67
- .fade-shove-enter-from {
68
- opacity: 0;
69
- }
70
-
71
- .fade-shove-leave-to {
72
- transform: translate(16px, -16px) scale(.95);
73
- opacity: 0;
74
- }
75
-
76
- /* Fade + Directional slide */
77
-
78
- .fade-left-enter-active, .fade-left-leave-active,
79
- .fade-right-enter-active, .fade-right-leave-active,
80
- .fade-top-enter-active, .fade-top-leave-active,
81
- .fade-bottom-enter-active, .fade-bottom-leave-active {
82
- transition: opacity .25s, transform .25s;
83
- }
84
-
85
- .fade-left-enter-from, .fade-left-leave-to,
86
- .fade-right-enter-from, .fade-right-leave-to,
87
- .fade-top-enter-from, .fade-top-leave-to,
88
- .fade-bottom-enter-from , .fade-bottom-leave-to {
89
- opacity: 0;
90
- }
91
-
92
- .fade-left-enter-from, .fade-left-leave-to {
93
- transform: translate(16px, 0);
94
- }
95
-
96
- .fade-right-enter-from, .fade-right-leave-to {
97
- transform: translate(-16px, 0);
98
- }
99
-
100
- .fade-top-enter-from, .fade-top-leave-to {
101
- transform: translate(0, 16px);
102
- }
103
-
104
- .fade-bottom-enter-from, .fade-bottom-leave-to {
105
- transform: translate(0, -16px);
106
- }
@@ -1,44 +0,0 @@
1
- .color-primary { color: var(--color-primary) }
2
- .color-secondary { color: var(--color-secondary) }
3
- .color-tertiary { color: var(--color-tertiary) }
4
- .color-success { color: var(--color-success) }
5
- .color-warning { color: var(--color-warning) }
6
- .color-danger { color: var(--color-danger) }
7
- .color-subtle { color: var(--color-subtle) }
8
- .color-sublime { color: var(--color-sublime) }
9
-
10
- .flex-1 { flex: 1 }
11
- .flex-2 { flex: 2 }
12
- .flex-3 { flex: 3 }
13
- .flex-4 { flex: 4 }
14
- .flex-5 { flex: 5 }
15
- .flex-6 { flex: 6 }
16
- .flex-7 { flex: 7 }
17
- .flex-8 { flex: 8 }
18
- .flex-9 { flex: 9 }
19
- .flex-10 { flex: 10 }
20
- .flex-11 { flex: 11 }
21
- .flex-12 { flex: 12 }
22
-
23
- .input-clear {
24
- display: block;
25
- width: 100%;
26
- border: 0;
27
- outline: 0;
28
- background: none;
29
- }
30
-
31
- .input-mono {
32
- font: 12px/1.4 var(--font-monospace);
33
- }
34
-
35
- .text-small { font-size: var(--font-size-small) }
36
- .text-smaller { font-size: var(--font-size-smaller) }
37
- .text-large { font-size: var(--font-size-large) }
38
- .text-larger { font-size: var(--font-size-larger) }
39
-
40
- .nowrap {
41
- white-space: nowrap;
42
- overflow: hidden;
43
- text-overflow: ellipsis;
44
- }