@vertexvis/ui 0.1.2-canary.0 → 0.1.2-canary.1

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 (100) hide show
  1. package/dist/components/auto-resize-textarea.js +157 -0
  2. package/dist/components/color-swatch.js +124 -0
  3. package/dist/components/dom.js +13 -0
  4. package/dist/components/expandable.js +100 -0
  5. package/dist/components/icon-button.js +63 -0
  6. package/dist/components/icon-helper.js +722 -0
  7. package/dist/components/icon.js +43 -0
  8. package/dist/components/index.d.ts +71 -0
  9. package/dist/components/index.js +52 -0
  10. package/dist/components/index2.js +89 -0
  11. package/dist/components/menu.js +89 -0
  12. package/dist/components/popover.js +1737 -0
  13. package/dist/components/result-list.js +565 -0
  14. package/dist/components/slots.js +26 -0
  15. package/dist/components/text-field.js +171 -0
  16. package/dist/components/tooltip.js +360 -0
  17. package/dist/components/tslib.es6.js +65 -0
  18. package/dist/components/vertex-auto-resize-textarea.d.ts +11 -0
  19. package/dist/components/vertex-auto-resize-textarea.js +6 -0
  20. package/dist/components/vertex-avatar-group.d.ts +11 -0
  21. package/dist/components/vertex-avatar-group.js +34 -0
  22. package/dist/components/vertex-avatar.d.ts +11 -0
  23. package/dist/components/vertex-avatar.js +68 -0
  24. package/dist/components/vertex-badge.d.ts +11 -0
  25. package/dist/components/vertex-badge.js +43 -0
  26. package/dist/components/vertex-banner.d.ts +11 -0
  27. package/dist/components/vertex-banner.js +141 -0
  28. package/dist/components/vertex-button.d.ts +11 -0
  29. package/dist/components/vertex-button.js +96 -0
  30. package/dist/components/vertex-card-group.d.ts +11 -0
  31. package/dist/components/vertex-card-group.js +51 -0
  32. package/dist/components/vertex-card.d.ts +11 -0
  33. package/dist/components/vertex-card.js +49 -0
  34. package/dist/components/vertex-chip.d.ts +11 -0
  35. package/dist/components/vertex-chip.js +45 -0
  36. package/dist/components/vertex-click-to-edit-textfield.d.ts +11 -0
  37. package/dist/components/vertex-click-to-edit-textfield.js +156 -0
  38. package/dist/components/vertex-collapsible.d.ts +11 -0
  39. package/dist/components/vertex-collapsible.js +63 -0
  40. package/dist/components/vertex-color-circle-picker.d.ts +11 -0
  41. package/dist/components/vertex-color-circle-picker.js +104 -0
  42. package/dist/components/vertex-color-picker.d.ts +11 -0
  43. package/dist/components/vertex-color-picker.js +75 -0
  44. package/dist/components/vertex-color-swatch.d.ts +11 -0
  45. package/dist/components/vertex-color-swatch.js +6 -0
  46. package/dist/components/vertex-context-menu.d.ts +11 -0
  47. package/dist/components/vertex-context-menu.js +125 -0
  48. package/dist/components/vertex-dialog.d.ts +11 -0
  49. package/dist/components/vertex-dialog.js +263 -0
  50. package/dist/components/vertex-draggable-popover.d.ts +11 -0
  51. package/dist/components/vertex-draggable-popover.js +119 -0
  52. package/dist/components/vertex-dropdown-menu.d.ts +11 -0
  53. package/dist/components/vertex-dropdown-menu.js +64 -0
  54. package/dist/components/vertex-expandable.d.ts +11 -0
  55. package/dist/components/vertex-expandable.js +6 -0
  56. package/dist/components/vertex-help-tooltip.d.ts +11 -0
  57. package/dist/components/vertex-help-tooltip.js +67 -0
  58. package/dist/components/vertex-icon-button.d.ts +11 -0
  59. package/dist/components/vertex-icon-button.js +6 -0
  60. package/dist/components/vertex-icon.d.ts +11 -0
  61. package/dist/components/vertex-icon.js +6 -0
  62. package/dist/components/vertex-logo-loading.d.ts +11 -0
  63. package/dist/components/vertex-logo-loading.js +34 -0
  64. package/dist/components/vertex-menu-divider.d.ts +11 -0
  65. package/dist/components/vertex-menu-divider.js +34 -0
  66. package/dist/components/vertex-menu-item.d.ts +11 -0
  67. package/dist/components/vertex-menu-item.js +44 -0
  68. package/dist/components/vertex-menu.d.ts +11 -0
  69. package/dist/components/vertex-menu.js +6 -0
  70. package/dist/components/vertex-popover.d.ts +11 -0
  71. package/dist/components/vertex-popover.js +6 -0
  72. package/dist/components/vertex-radio-group.d.ts +11 -0
  73. package/dist/components/vertex-radio-group.js +88 -0
  74. package/dist/components/vertex-radio.d.ts +11 -0
  75. package/dist/components/vertex-radio.js +56 -0
  76. package/dist/components/vertex-resizable.d.ts +11 -0
  77. package/dist/components/vertex-resizable.js +445 -0
  78. package/dist/components/vertex-result-list.d.ts +11 -0
  79. package/dist/components/vertex-result-list.js +6 -0
  80. package/dist/components/vertex-search-bar.d.ts +11 -0
  81. package/dist/components/vertex-search-bar.js +568 -0
  82. package/dist/components/vertex-select.d.ts +11 -0
  83. package/dist/components/vertex-select.js +200 -0
  84. package/dist/components/vertex-slider.d.ts +11 -0
  85. package/dist/components/vertex-slider.js +81 -0
  86. package/dist/components/vertex-spinner.d.ts +11 -0
  87. package/dist/components/vertex-spinner.js +49 -0
  88. package/dist/components/vertex-tab.d.ts +11 -0
  89. package/dist/components/vertex-tab.js +46 -0
  90. package/dist/components/vertex-tabs.d.ts +11 -0
  91. package/dist/components/vertex-tabs.js +133 -0
  92. package/dist/components/vertex-textfield.d.ts +11 -0
  93. package/dist/components/vertex-textfield.js +6 -0
  94. package/dist/components/vertex-toast.d.ts +11 -0
  95. package/dist/components/vertex-toast.js +127 -0
  96. package/dist/components/vertex-toggle.d.ts +11 -0
  97. package/dist/components/vertex-toggle.js +67 -0
  98. package/dist/components/vertex-tooltip.d.ts +11 -0
  99. package/dist/components/vertex-tooltip.js +6 -0
  100. package/package.json +2 -2
@@ -0,0 +1,127 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { c as classnames } from './index2.js';
3
+ import { d as defineCustomElement$3 } from './icon-button.js';
4
+ import { d as defineCustomElement$2 } from './popover.js';
5
+
6
+ const toastCss = ":host{--toast-width:auto;--toast-min-width:17rem;--toast-max-width:25rem;--toast-white-space:normal}.anchor{position:fixed}.bottom-left{left:1rem;bottom:1rem}.bottom{left:50vw;bottom:1rem}.bottom-right{right:1rem;bottom:1rem}.top-left{left:1rem;top:1rem}.top{left:50vw;top:1rem}.top-right{right:1rem;top:1rem}.popover{position:fixed;--open-animation-name:open-fade-in;--close-animation-name:close-fade-out}.actions{display:flex;align-items:center;margin-left:auto}.close{cursor:pointer;padding-left:1rem}.close:hover{color:var(--vertex-ui-neutral-300)}.toast{position:relative;display:flex;align-items:center;width:var(--toast-width);min-width:var(--toast-min-width);max-width:var(--toast-max-width);padding:1rem 1rem 1rem 1.5rem;font-family:var(--vertex-ui-font-family);font-size:var(--vertex-ui-text-base);background-color:var(--vertex-ui-neutral-800);color:var(--vertex-ui-white);border-radius:4px;white-space:var(--toast-white-space);user-select:none}.toast.hidden{pointer-events:none}.warn{background-color:var(--vertex-ui-orange-100);color:var(--vertex-ui-neutral-800)}.error{background-color:var(--vertex-ui-red-700);color:white}";
7
+
8
+ const DEFAULT_TOAST_DURATION = 3000;
9
+ const Toast = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
10
+ constructor() {
11
+ super();
12
+ this.__registerHost();
13
+ this.__attachShadow();
14
+ this.closed = createEvent(this, "closed", 7);
15
+ this.content = undefined;
16
+ this.placement = 'bottom-left';
17
+ this.duration = DEFAULT_TOAST_DURATION;
18
+ this.animated = true;
19
+ this.open = false;
20
+ this.type = 'info';
21
+ this.isOpen = undefined;
22
+ this.handleClose = this.handleClose.bind(this);
23
+ this.startCloseTimeout = this.startCloseTimeout.bind(this);
24
+ this.clearCloseTimeout = this.clearCloseTimeout.bind(this);
25
+ this.restartCloseTimeout = this.restartCloseTimeout.bind(this);
26
+ }
27
+ componentDidLoad() {
28
+ // This allows the component to render once initially to correctly
29
+ // place the popover anchor.
30
+ this.isOpen = this.open;
31
+ if (this.isOpen) {
32
+ this.restartCloseTimeout();
33
+ }
34
+ }
35
+ async handleOpenChanged(open) {
36
+ if (open) {
37
+ this.restartCloseTimeout();
38
+ this.isOpen = open;
39
+ }
40
+ }
41
+ render() {
42
+ return (h("vertex-popover", { class: "popover", open: this.isOpen, resizeBehavior: "fixed", backdrop: false, placement: this.getPopoverPlacement(), animated: this.animated }, h("div", { slot: "anchor", class: classnames('anchor', this.placement) }), h("div", { class: classnames('toast', {
43
+ hidden: !this.isOpen,
44
+ warn: this.type === 'warn',
45
+ error: this.type === 'error',
46
+ }) }, this.content ? h("div", { class: "content" }, this.content) : h("slot", null), h("div", { class: "actions" }, h("slot", { name: "action" }), h("vertex-icon-button", { class: "close", iconName: "close", iconSize: "sm", variant: "plain", onClick: this.handleClose })))));
47
+ }
48
+ handleClose() {
49
+ this.clearCloseTimeout();
50
+ this.isOpen = false;
51
+ this.closed.emit();
52
+ }
53
+ startCloseTimeout() {
54
+ if (this.closeTimeout == null && this.duration > 0) {
55
+ this.closeTimeout = setTimeout(() => {
56
+ this.handleClose();
57
+ }, this.duration);
58
+ }
59
+ }
60
+ clearCloseTimeout() {
61
+ if (this.closeTimeout != null) {
62
+ clearTimeout(this.closeTimeout);
63
+ this.closeTimeout = undefined;
64
+ }
65
+ }
66
+ restartCloseTimeout() {
67
+ this.clearCloseTimeout();
68
+ this.startCloseTimeout();
69
+ }
70
+ getPopoverPlacement() {
71
+ switch (this.placement) {
72
+ case 'bottom-left':
73
+ return 'top-start';
74
+ case 'bottom':
75
+ return 'top';
76
+ case 'bottom-right':
77
+ return 'top-end';
78
+ case 'top-left':
79
+ return 'bottom-start';
80
+ case 'top':
81
+ return 'bottom';
82
+ case 'top-right':
83
+ return 'bottom-end';
84
+ }
85
+ }
86
+ static get watchers() { return {
87
+ "open": ["handleOpenChanged"]
88
+ }; }
89
+ static get style() { return toastCss; }
90
+ }, [1, "vertex-toast", {
91
+ "content": [1],
92
+ "placement": [1],
93
+ "duration": [2],
94
+ "animated": [4],
95
+ "open": [4],
96
+ "type": [1],
97
+ "isOpen": [32]
98
+ }]);
99
+ function defineCustomElement$1() {
100
+ if (typeof customElements === "undefined") {
101
+ return;
102
+ }
103
+ const components = ["vertex-toast", "vertex-icon-button", "vertex-popover"];
104
+ components.forEach(tagName => { switch (tagName) {
105
+ case "vertex-toast":
106
+ if (!customElements.get(tagName)) {
107
+ customElements.define(tagName, Toast);
108
+ }
109
+ break;
110
+ case "vertex-icon-button":
111
+ if (!customElements.get(tagName)) {
112
+ defineCustomElement$3();
113
+ }
114
+ break;
115
+ case "vertex-popover":
116
+ if (!customElements.get(tagName)) {
117
+ defineCustomElement$2();
118
+ }
119
+ break;
120
+ } });
121
+ }
122
+ defineCustomElement$1();
123
+
124
+ const VertexToast = Toast;
125
+ const defineCustomElement = defineCustomElement$1;
126
+
127
+ export { Toast as T, VertexToast, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VertexToggle extends Components.VertexToggle, HTMLElement {}
4
+ export const VertexToggle: {
5
+ prototype: VertexToggle;
6
+ new (): VertexToggle;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,67 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
+ import { c as classnames } from './index2.js';
3
+ import { d as defineCustomElement$2 } from './icon.js';
4
+
5
+ const toggleCss = "button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}:host{display:flex}.check{border:1px solid var(--vertex-ui-neutral-400);box-shadow:0 0 2px var(--vertex-ui-neutral-400);border-radius:4px;width:1rem;height:1rem;padding:0}.check:not(.disabled){cursor:pointer}.check.disabled{border:1px solid var(--vertex-ui-neutral-200);box-shadow:0 0 2px var(--vertex-ui-neutral-200)}.check:focus-visible:not(.disabled){outline:none;border:1px solid var(--vertex-ui-neutral-600);box-shadow:0 0 2px var(--vertex-ui-neutral-600)}.check:focus-visible:not(.disabled)>.checked-content.checked{background-color:var(--vertex-ui-blue-800);box-shadow:0 0 2px var(--vertex-ui-blue-800)}.check:hover:not(.disabled){border:1px solid var(--vertex-ui-neutral-500);box-shadow:0 0 2px var(--vertex-ui-neutral-500)}.check.checked:not(.disabled){border:none;box-shadow:none}.check:hover:not(.disabled)>.checked-content.checked{background-color:var(--vertex-ui-blue-500);box-shadow:0 0 2px var(--vertex-ui-blue-500)}.checked-content{width:100%;height:100%;border-radius:4px}.checked-content.disabled{background-color:var(--vertex-ui-neutral-050);color:var(--vertex-ui-neutral-500)}.checked-content.checked:not(.disabled){background-color:var(--vertex-ui-blue-700);box-shadow:0 0 2px var(--vertex-ui-blue-700);color:var(--vertex-ui-white)}.switch{position:relative;width:2.25rem;height:1.25rem;padding:0;display:inline-block}.switch:not(.disabled){cursor:pointer}.track{position:absolute;top:0;background-color:var(--vertex-ui-neutral-300);width:2rem;padding:0 0.125rem;margin:0.1875rem 0;height:0.875rem;border-radius:7rem}.track.disabled{background-color:var(--vertex-ui-neutral-200)}.track.disabled.checked{background-color:var(--vertex-ui-blue-200)}.handle{position:absolute;top:0;left:0;background-color:var(--vertex-ui-neutral-100);box-shadow:-1px 1px rgba(0, 0, 0, 0.15);width:1.25rem;height:1.25rem;border-radius:100%;display:flex;transition:left 0.25s}.handle.disabled{box-shadow:none}.track:not(.disabled).checked{background-color:var(--vertex-ui-blue-300)}.handle.checked{left:1rem}.handle.checked:not(.disabled){background-color:var(--vertex-ui-blue-600)}.handle.checked.disabled{background-color:var(--vertex-ui-blue-300)}";
6
+
7
+ const Toggle = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
+ constructor() {
9
+ super();
10
+ this.__registerHost();
11
+ this.__attachShadow();
12
+ this.valueChanged = createEvent(this, "valueChanged", 7);
13
+ this.variant = 'check';
14
+ this.disabled = false;
15
+ this.checked = false;
16
+ }
17
+ render() {
18
+ const flipValue = () => {
19
+ if (!this.disabled) {
20
+ this.checked = !this.checked;
21
+ this.valueChanged.emit(this.checked);
22
+ }
23
+ };
24
+ return (h("button", { class: classnames(this.variant, {
25
+ checked: this.checked,
26
+ disabled: this.disabled,
27
+ }), onClick: flipValue, onSubmit: flipValue }, this.variant === 'check' && (h("div", { class: classnames('checked-content', {
28
+ checked: this.checked,
29
+ disabled: this.disabled,
30
+ }) }, this.checked && h("vertex-icon", { name: "check", size: "md" }))), this.variant === 'switch' && (h("div", { class: classnames('track', {
31
+ disabled: this.disabled,
32
+ checked: this.checked,
33
+ }) })), this.variant === 'switch' && (h("div", { class: classnames('handle', {
34
+ disabled: this.disabled,
35
+ checked: this.checked,
36
+ }) }))));
37
+ }
38
+ static get style() { return toggleCss; }
39
+ }, [1, "vertex-toggle", {
40
+ "variant": [1],
41
+ "disabled": [4],
42
+ "checked": [1540]
43
+ }]);
44
+ function defineCustomElement$1() {
45
+ if (typeof customElements === "undefined") {
46
+ return;
47
+ }
48
+ const components = ["vertex-toggle", "vertex-icon"];
49
+ components.forEach(tagName => { switch (tagName) {
50
+ case "vertex-toggle":
51
+ if (!customElements.get(tagName)) {
52
+ customElements.define(tagName, Toggle);
53
+ }
54
+ break;
55
+ case "vertex-icon":
56
+ if (!customElements.get(tagName)) {
57
+ defineCustomElement$2();
58
+ }
59
+ break;
60
+ } });
61
+ }
62
+ defineCustomElement$1();
63
+
64
+ const VertexToggle = Toggle;
65
+ const defineCustomElement = defineCustomElement$1;
66
+
67
+ export { Toggle as T, VertexToggle, defineCustomElement };
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface VertexTooltip extends Components.VertexTooltip, HTMLElement {}
4
+ export const VertexTooltip: {
5
+ prototype: VertexTooltip;
6
+ new (): VertexTooltip;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,6 @@
1
+ import { T as Tooltip, d as defineCustomElement$1 } from './tooltip.js';
2
+
3
+ const VertexTooltip = Tooltip;
4
+ const defineCustomElement = defineCustomElement$1;
5
+
6
+ export { VertexTooltip, defineCustomElement };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vertexvis/ui",
3
- "version": "0.1.2-canary.0",
3
+ "version": "0.1.2-canary.1",
4
4
  "description": "The Vertex UI component library.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -87,5 +87,5 @@
87
87
  "@vertexvis/utils": "^0.23.2",
88
88
  "fast-deep-equal": "^3.1.3"
89
89
  },
90
- "gitHead": "104f2e757e89345ed44420a8413f0d4e466b63ec"
90
+ "gitHead": "c20a026c205520462f54e883b08564003c8fa98e"
91
91
  }