@vertexvis/ui 0.1.1-canary.0 → 0.1.1-canary.2
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/cjs/banner-8612b10b.js +104 -0
- package/dist/cjs/button-e63d25b1.js +70 -0
- package/dist/cjs/color-picker-000b8ca6.js +47 -0
- package/dist/cjs/components.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +5 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/vertex-banner.cjs.entry.js +12 -0
- package/dist/cjs/vertex-button.cjs.entry.js +1 -1
- package/dist/cjs/vertex-color-picker.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/banner/banner.css +135 -0
- package/dist/collection/components/banner/banner.js +251 -0
- package/dist/collection/components/button/button.css +99 -13
- package/dist/collection/components/button/button.js +4 -1
- package/dist/collection/components/color-picker/color-picker.css +5 -0
- package/dist/collection/components/color-picker/color-picker.js +24 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js +1 -1
- package/dist/collection/components/index.js +1 -0
- package/dist/components/components.esm.js +1 -1
- package/dist/components/index.esm.js +1 -1
- package/dist/components/p-06f217b4.entry.js +1 -0
- package/dist/components/p-1e645c1f.js +1 -0
- package/dist/components/p-70c6c194.entry.js +1 -0
- package/dist/components/p-7a527151.js +1 -0
- package/dist/components/p-e5ce8d66.js +1 -0
- package/dist/components/p-f6f2bc86.entry.js +1 -0
- package/dist/esm/banner-38e7885a.js +102 -0
- package/dist/esm/button-81207236.js +68 -0
- package/dist/esm/color-picker-16b97934.js +45 -0
- package/dist/esm/components.js +1 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/vertex-banner.entry.js +4 -0
- package/dist/esm/vertex-button.entry.js +1 -1
- package/dist/esm/vertex-color-picker.entry.js +1 -1
- package/dist/types/components/banner/banner.d.ts +55 -0
- package/dist/types/components/button/button.d.ts +1 -1
- package/dist/types/components/color-picker/color-picker.d.ts +9 -0
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/components.d.ts +79 -1
- package/package.json +2 -2
- package/dist/cjs/button-edd366d8.js +0 -67
- package/dist/cjs/color-picker-2a4820fa.js +0 -46
- package/dist/components/p-2b4aedaa.entry.js +0 -1
- package/dist/components/p-64e8b92c.js +0 -1
- package/dist/components/p-655053df.js +0 -1
- package/dist/components/p-fca52578.entry.js +0 -1
- package/dist/esm/button-547336b8.js +0 -65
- package/dist/esm/color-picker-1d67effe.js +0 -44
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
8
|
import { AvatarVariant } from "./components/avatar/avatar";
|
|
9
9
|
import { BadgeIconColor } from "./components/badge/badge";
|
|
10
|
+
import { BannerPlacement, BannerType } from "./components/banner/banner";
|
|
10
11
|
import { ButtonColor, ButtonExpand, ButtonSize, ButtonType, ButtonVariant } from "./components/button/button";
|
|
11
12
|
import { CardMode } from "./components/card/card";
|
|
12
13
|
import { ChipColor, ChipVariant } from "./components/chip/chip";
|
|
13
14
|
import { InputChangeEventDetail, TextSize } from "./components/text-field/text-field";
|
|
14
15
|
import { SelectionChangedDetails } from "./components/color-circle-picker/color-circle-picker";
|
|
15
16
|
import { ColorSwatchSize } from "./components/color-swatch/color-swatch";
|
|
16
|
-
import { ColorPickerVariant } from "./components/color-picker/color-picker";
|
|
17
|
+
import { ColorPickerExpand, ColorPickerVariant } from "./components/color-picker/color-picker";
|
|
17
18
|
import { ColorSwatchSize as ColorSwatchSize1, ColorSwatchTheme, ColorSwatchVariant } from "./components/color-swatch/color-swatch";
|
|
18
19
|
import { Point } from "./types/point";
|
|
19
20
|
import { Popover, PopoverPlacement } from "./components/popover/popover";
|
|
@@ -84,6 +85,32 @@ export namespace Components {
|
|
|
84
85
|
*/
|
|
85
86
|
"badgeText"?: string;
|
|
86
87
|
}
|
|
88
|
+
interface VertexBanner {
|
|
89
|
+
/**
|
|
90
|
+
* Whether this banner should be animated. Defaults to true.
|
|
91
|
+
*/
|
|
92
|
+
"animated": boolean;
|
|
93
|
+
/**
|
|
94
|
+
* The content to display in this banner. This can also be provided by inserting an element with the `content` slot to support additional elements.
|
|
95
|
+
*/
|
|
96
|
+
"content"?: string;
|
|
97
|
+
/**
|
|
98
|
+
* The duration this banner will appear for. Can be set to `0` to display the banner until explicitly dismissed, and defaults to 3000ms.
|
|
99
|
+
*/
|
|
100
|
+
"duration": number;
|
|
101
|
+
/**
|
|
102
|
+
* Whether this banner is visible. Updating this property to `true` will restart the timer to hide the banner. Defaults to false.
|
|
103
|
+
*/
|
|
104
|
+
"open": boolean;
|
|
105
|
+
/**
|
|
106
|
+
* The placement of the banner. This can be any of the following values: 'top', 'top-left', or 'top-right'.
|
|
107
|
+
*/
|
|
108
|
+
"placement": BannerPlacement;
|
|
109
|
+
/**
|
|
110
|
+
* The type of banner. This will change the styling of the banner
|
|
111
|
+
*/
|
|
112
|
+
"type": BannerType;
|
|
113
|
+
}
|
|
87
114
|
interface VertexButton {
|
|
88
115
|
/**
|
|
89
116
|
* The color of this <vertex-button>. Can be "primary", "secondary", or "danger" and defaults to "secondary".
|
|
@@ -235,6 +262,10 @@ export namespace Components {
|
|
|
235
262
|
* Whether this color picker is disabled.
|
|
236
263
|
*/
|
|
237
264
|
"disabled": boolean;
|
|
265
|
+
/**
|
|
266
|
+
* The expansion behavior of this <vertex-color-picker>. Can be set to "full" to cause the color picker to stretch to fill its container, or "block" to cause the color picker to be sized based on its contents. Defaults to "block".
|
|
267
|
+
*/
|
|
268
|
+
"expand": ColorPickerExpand;
|
|
238
269
|
/**
|
|
239
270
|
* The size of the swatch displayed for this color picker. Can be `sm`, `md`, `lg`, or `xl`, and defaults to `md`. If the `variant` is `full`, this value will also increase the size of the associated hexadecimal value.
|
|
240
271
|
*/
|
|
@@ -836,6 +867,10 @@ export namespace Components {
|
|
|
836
867
|
"placement": PopoverPlacement;
|
|
837
868
|
}
|
|
838
869
|
}
|
|
870
|
+
export interface VertexBannerCustomEvent<T> extends CustomEvent<T> {
|
|
871
|
+
detail: T;
|
|
872
|
+
target: HTMLVertexBannerElement;
|
|
873
|
+
}
|
|
839
874
|
export interface VertexCardCustomEvent<T> extends CustomEvent<T> {
|
|
840
875
|
detail: T;
|
|
841
876
|
target: HTMLVertexCardElement;
|
|
@@ -957,6 +992,12 @@ declare global {
|
|
|
957
992
|
prototype: HTMLVertexBadgeElement;
|
|
958
993
|
new (): HTMLVertexBadgeElement;
|
|
959
994
|
};
|
|
995
|
+
interface HTMLVertexBannerElement extends Components.VertexBanner, HTMLStencilElement {
|
|
996
|
+
}
|
|
997
|
+
var HTMLVertexBannerElement: {
|
|
998
|
+
prototype: HTMLVertexBannerElement;
|
|
999
|
+
new (): HTMLVertexBannerElement;
|
|
1000
|
+
};
|
|
960
1001
|
interface HTMLVertexButtonElement extends Components.VertexButton, HTMLStencilElement {
|
|
961
1002
|
}
|
|
962
1003
|
var HTMLVertexButtonElement: {
|
|
@@ -1178,6 +1219,7 @@ declare global {
|
|
|
1178
1219
|
"vertex-avatar": HTMLVertexAvatarElement;
|
|
1179
1220
|
"vertex-avatar-group": HTMLVertexAvatarGroupElement;
|
|
1180
1221
|
"vertex-badge": HTMLVertexBadgeElement;
|
|
1222
|
+
"vertex-banner": HTMLVertexBannerElement;
|
|
1181
1223
|
"vertex-button": HTMLVertexButtonElement;
|
|
1182
1224
|
"vertex-card": HTMLVertexCardElement;
|
|
1183
1225
|
"vertex-card-group": HTMLVertexCardGroupElement;
|
|
@@ -1269,6 +1311,36 @@ declare namespace LocalJSX {
|
|
|
1269
1311
|
*/
|
|
1270
1312
|
"badgeText"?: string;
|
|
1271
1313
|
}
|
|
1314
|
+
interface VertexBanner {
|
|
1315
|
+
/**
|
|
1316
|
+
* Whether this banner should be animated. Defaults to true.
|
|
1317
|
+
*/
|
|
1318
|
+
"animated"?: boolean;
|
|
1319
|
+
/**
|
|
1320
|
+
* The content to display in this banner. This can also be provided by inserting an element with the `content` slot to support additional elements.
|
|
1321
|
+
*/
|
|
1322
|
+
"content"?: string;
|
|
1323
|
+
/**
|
|
1324
|
+
* The duration this banner will appear for. Can be set to `0` to display the banner until explicitly dismissed, and defaults to 3000ms.
|
|
1325
|
+
*/
|
|
1326
|
+
"duration"?: number;
|
|
1327
|
+
/**
|
|
1328
|
+
* An event that is dispatched when this banner is closed.
|
|
1329
|
+
*/
|
|
1330
|
+
"onClosed"?: (event: VertexBannerCustomEvent<void>) => void;
|
|
1331
|
+
/**
|
|
1332
|
+
* Whether this banner is visible. Updating this property to `true` will restart the timer to hide the banner. Defaults to false.
|
|
1333
|
+
*/
|
|
1334
|
+
"open"?: boolean;
|
|
1335
|
+
/**
|
|
1336
|
+
* The placement of the banner. This can be any of the following values: 'top', 'top-left', or 'top-right'.
|
|
1337
|
+
*/
|
|
1338
|
+
"placement"?: BannerPlacement;
|
|
1339
|
+
/**
|
|
1340
|
+
* The type of banner. This will change the styling of the banner
|
|
1341
|
+
*/
|
|
1342
|
+
"type"?: BannerType;
|
|
1343
|
+
}
|
|
1272
1344
|
interface VertexButton {
|
|
1273
1345
|
/**
|
|
1274
1346
|
* The color of this <vertex-button>. Can be "primary", "secondary", or "danger" and defaults to "secondary".
|
|
@@ -1445,6 +1517,10 @@ declare namespace LocalJSX {
|
|
|
1445
1517
|
* Whether this color picker is disabled.
|
|
1446
1518
|
*/
|
|
1447
1519
|
"disabled"?: boolean;
|
|
1520
|
+
/**
|
|
1521
|
+
* The expansion behavior of this <vertex-color-picker>. Can be set to "full" to cause the color picker to stretch to fill its container, or "block" to cause the color picker to be sized based on its contents. Defaults to "block".
|
|
1522
|
+
*/
|
|
1523
|
+
"expand"?: ColorPickerExpand;
|
|
1448
1524
|
/**
|
|
1449
1525
|
* Emitted when the value has changed.
|
|
1450
1526
|
*/
|
|
@@ -2170,6 +2246,7 @@ declare namespace LocalJSX {
|
|
|
2170
2246
|
"vertex-avatar": VertexAvatar;
|
|
2171
2247
|
"vertex-avatar-group": VertexAvatarGroup;
|
|
2172
2248
|
"vertex-badge": VertexBadge;
|
|
2249
|
+
"vertex-banner": VertexBanner;
|
|
2173
2250
|
"vertex-button": VertexButton;
|
|
2174
2251
|
"vertex-card": VertexCard;
|
|
2175
2252
|
"vertex-card-group": VertexCardGroup;
|
|
@@ -2216,6 +2293,7 @@ declare module "@stencil/core" {
|
|
|
2216
2293
|
"vertex-avatar": LocalJSX.VertexAvatar & JSXBase.HTMLAttributes<HTMLVertexAvatarElement>;
|
|
2217
2294
|
"vertex-avatar-group": LocalJSX.VertexAvatarGroup & JSXBase.HTMLAttributes<HTMLVertexAvatarGroupElement>;
|
|
2218
2295
|
"vertex-badge": LocalJSX.VertexBadge & JSXBase.HTMLAttributes<HTMLVertexBadgeElement>;
|
|
2296
|
+
"vertex-banner": LocalJSX.VertexBanner & JSXBase.HTMLAttributes<HTMLVertexBannerElement>;
|
|
2219
2297
|
"vertex-button": LocalJSX.VertexButton & JSXBase.HTMLAttributes<HTMLVertexButtonElement>;
|
|
2220
2298
|
"vertex-card": LocalJSX.VertexCard & JSXBase.HTMLAttributes<HTMLVertexCardElement>;
|
|
2221
2299
|
"vertex-card-group": LocalJSX.VertexCardGroup & JSXBase.HTMLAttributes<HTMLVertexCardGroupElement>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vertexvis/ui",
|
|
3
|
-
"version": "0.1.1-canary.
|
|
3
|
+
"version": "0.1.1-canary.2",
|
|
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.21.0",
|
|
88
88
|
"fast-deep-equal": "^3.1.3"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "37339dbab45685958909e3593794af7f6ca28ccb"
|
|
91
91
|
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-6a92256c.js');
|
|
4
|
-
const index$1 = require('./index-e1b40fa6.js');
|
|
5
|
-
|
|
6
|
-
const buttonCss = "button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}a{text-decoration:none;font-family:var(--vertex-ui-font-family)}:host{--enabled-cursor:pointer;--disabled-cursor:not-allowed}:host([type]){-webkit-appearance:none !important}:host([disabled=\"\"]){pointer-events:none}.btn{display:flex;align-items:center;justify-content:center;border-radius:0.25rem;box-sizing:border-box;text-decoration:none;cursor:var(--enabled-cursor)}.btn-full{width:100%}.btn.disabled,.btn:not(.disabled):focus,.btn:not(.disabled):active{outline:none}.btn.disabled{cursor:var(--disabled-cursor)}.btn-sm{font-size:var(--vertex-ui-text-sm)}.btn-sm:not(.btn-plaintext){padding:0 0.25rem}.btn-md{font-size:var(--vertex-ui-text-base)}.btn-md:not(.btn-plaintext){padding:0.5rem 1rem}.btn-lg{font-size:var(--vertex-ui-text-lg)}.btn-lg:not(.btn-plaintext){padding:0.75rem 0.75rem}.btn-plaintext{color:var(--vertex-ui-neutral-800)}.btn-primary{color:white;background-color:var(--vertex-ui-blue-700)}.btn-primary:not(.disabled):hover{background-color:var(--vertex-ui-blue-500)}.btn-primary:not(.disabled):focus,.btn-primary:not(.disabled):active{background-color:var(--vertex-ui-blue-600)}.btn-primary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-blue-900)}.btn-primary:not(.disabled):active{box-shadow:none}.btn-primary.disabled{background-color:var(--vertex-ui-blue-200);cursor:var(--disabled-cursor)}.btn-secondary{color:var(--vertex-ui-neutral-800);background-color:var(--vertex-ui-neutral-300)}.btn-secondary:not(.disabled):hover{box-shadow:0 2px 2px rgb(0 0 0 / 20%)}.btn-secondary:not(.disabled):focus,.btn-secondary:not(.disabled):active{background-color:var(--vertex-ui-neutral-400)}.btn-secondary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-neutral-900)}.btn-secondary:not(.disabled):active{box-shadow:none}.btn-secondary.disabled{background-color:var(--vertex-ui-neutral-200);color:var(--vertex-ui-neutral-400)}.btn-danger{color:white;background-color:var(--vertex-ui-red-600)}.btn-danger:not(.disabled):hover{background-color:var(--vertex-ui-red-400)}.btn-danger:not(.disabled):focus{background-color:var(--vertex-ui-red-500);box-shadow:0 0 0 1px var(--vertex-ui-red-900)}.btn-danger:not(.disabled):active{background-color:var(--vertex-ui-red-600);box-shadow:none}.btn-danger.disabled{background-color:var(--vertex-ui-red-200);box-shadow:none}.btn-txt-primary{color:var(--vertex-ui-blue-600)}.btn-txt-primary:not(.disabled):hover{color:var(--vertex-ui-blue-800);background-color:var(--vertex-ui-blue-200)}.btn-txt-primary:not(.disabled):focus,.btn-txt-primary:not(.disabled):active{color:var(--vertex-ui-blue-800);background-color:var(--vertex-ui-blue-300)}.btn-txt-primary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-blue-900)}.btn-txt-primary:not(.disabled):active{box-shadow:none}.btn-txt-primary.disabled{color:var(--vertex-ui-blue-300);box-shadow:none}.btn-txt-secondary{color:var(--vertex-ui-neutral-700)}.btn-txt-secondary:not(.disabled):hover,.btn-txt-secondary:not(.disabled):active,.btn-txt-secondary:not(.disabled):focus{color:var(--vertex-ui-neutral-800);background-color:var(--vertex-ui-neutral-300)}.btn-txt-secondary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-neutral-900)}.btn-txt-secondary.disabled{color:var(--vertex-ui-neutral-300);box-shadow:none}.btn-txt-danger{color:var(--vertex-ui-red-600)}.btn-txt-danger:not(.disabled):focus,.btn-txt-danger:not(.disabled):active,.btn-txt-danger:not(.disabled):hover{color:var(--vertex-ui-red-800)}.btn-txt-danger:not(.disabled):hover{background-color:var(--vertex-ui-red-200)}.btn-txt-danger:not(.disabled):focus,.btn-txt-danger:not(.disabled):active{background-color:var(--vertex-ui-red-300)}.btn-txt-danger:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-red-900)}.btn-txt-danger:not(.disabled):active{box-shadow:none}.btn-txt-danger.disabled{color:var(--vertex-ui-red-300);box-shadow:none}";
|
|
7
|
-
|
|
8
|
-
const Button = class {
|
|
9
|
-
constructor(hostRef) {
|
|
10
|
-
index.registerInstance(this, hostRef);
|
|
11
|
-
this.type = undefined;
|
|
12
|
-
this.color = 'secondary';
|
|
13
|
-
this.variant = 'solid';
|
|
14
|
-
this.size = 'md';
|
|
15
|
-
this.expand = 'block';
|
|
16
|
-
this.href = undefined;
|
|
17
|
-
this.target = undefined;
|
|
18
|
-
this.disabled = undefined;
|
|
19
|
-
}
|
|
20
|
-
connectedCallback() {
|
|
21
|
-
if (this.hostElement != null && this.type === 'submit') {
|
|
22
|
-
const form = this.hostElement.closest('form');
|
|
23
|
-
if (form != null) {
|
|
24
|
-
this.fakeButton = document.createElement('button');
|
|
25
|
-
this.fakeButton.setAttribute('type', this.type);
|
|
26
|
-
this.fakeButton.setAttribute('style', 'display: none');
|
|
27
|
-
this.fakeButton.setAttribute('data-testid', 'vertex-fake-button');
|
|
28
|
-
form.appendChild(this.fakeButton);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
disconnectedCallback() {
|
|
33
|
-
if (this.hostElement != null && this.fakeButton != null) {
|
|
34
|
-
this.fakeButton.remove();
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
render() {
|
|
38
|
-
const classes = index$1.classnames('btn', {
|
|
39
|
-
'btn-full': this.expand === 'full',
|
|
40
|
-
'btn-sm': this.size === 'sm',
|
|
41
|
-
'btn-md': this.size === 'md',
|
|
42
|
-
'btn-lg': this.size === 'lg',
|
|
43
|
-
'btn-primary': this.color === 'primary' && this.variant === 'solid',
|
|
44
|
-
'btn-secondary': this.color === 'secondary' && this.variant === 'solid',
|
|
45
|
-
'btn-danger': this.color === 'danger' && this.variant === 'solid',
|
|
46
|
-
'btn-txt-primary': this.color === 'primary' && this.variant === 'text',
|
|
47
|
-
'btn-txt-secondary': this.color === 'secondary' && this.variant === 'text',
|
|
48
|
-
'btn-txt-danger': this.color === 'danger' && this.variant === 'text',
|
|
49
|
-
'btn-plaintext': this.variant === 'plaintext',
|
|
50
|
-
disabled: this.disabled,
|
|
51
|
-
});
|
|
52
|
-
if (this.href != null && this.type != null) {
|
|
53
|
-
console.warn('The type attribute is ignored when href is provided');
|
|
54
|
-
}
|
|
55
|
-
return (index.h(index.Host, { style: { pointerEvents: this.disabled ? 'none' : undefined } }, this.href != null && this.href !== '' ? (index.h("a", { href: this.href, target: this.target, class: classes, tabIndex: this.disabled ? -1 : 0 }, index.h("slot", null))) : (index.h("button", { class: classes, disabled: this.disabled, type: this.type, onClick: (event) => this.handleClick(event) }, index.h("slot", { name: "left" }), index.h("slot", null)))));
|
|
56
|
-
}
|
|
57
|
-
handleClick(event) {
|
|
58
|
-
if (this.fakeButton != null) {
|
|
59
|
-
event.preventDefault();
|
|
60
|
-
this.fakeButton.click();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
get hostElement() { return index.getElement(this); }
|
|
64
|
-
};
|
|
65
|
-
Button.style = buttonCss;
|
|
66
|
-
|
|
67
|
-
exports.Button = Button;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const index = require('./index-6a92256c.js');
|
|
4
|
-
const index$1 = require('./index-e1b40fa6.js');
|
|
5
|
-
const lib = require('./lib-1bd1e383.js');
|
|
6
|
-
|
|
7
|
-
const colorPickerCss = ":host{display:flex;--selected-color-width:initial;--selected-color-height:initial}.wrapper{display:inline-flex;align-items:center}.wrapper.full{padding:0.375rem 0.5rem;border:1px solid var(--vertex-ui-neutral-300);border-radius:4px}.color-picker{display:inline-flex;position:relative;cursor:pointer}.color-picker.disabled{opacity:0.5;cursor:default}.selected-wrapper{position:relative;display:flex;align-items:center}.wrapper.full .selected-wrapper{gap:0.75rem}.selected{position:relative}.wrapper.sm .selected{width:var(--selected-color-width, 1rem);height:var(--selected-color-height, 1rem)}.wrapper.md .selected{width:var(--selected-color-width, 1.25rem);height:var(--selected-color-height, 1.25rem)}.wrapper.lg .selected{width:var(--selected-color-width, 1.5rem);height:var(--selected-color-height, 1.5rem)}.text-wrapper{position:relative}.selected-text{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;color:var(--vertex-ui-neutral-700);text-align:center;font-family:var(--vertex-ui-font-family)}.hidden-text{visibility:hidden;pointer-events:none;font-family:var(--vertex-ui-font-family-monospace)}.wrapper.sm .selected-text,.wrapper.sm .hidden-text{font-size:var(--vertex-ui-text-xs)}.wrapper.md .selected-text,.wrapper.md .hidden-text{font-size:var(--vertex-ui-text-xs)}.wrapper.lg .selected-text,.wrapper.lg .hidden-text{font-size:var(--vertex-ui-text-xs)}.no-value{width:100%;height:100%;stroke:var(--vertex-ui-red-400)}.right-gutter{display:flex;align-items:center;margin-left:auto}slot[name=\"right-gutter\"]::slotted(*){padding:0}.input{display:flex;position:absolute;pointer-events:none;height:100%;width:100%;left:0;top:0;opacity:0}";
|
|
8
|
-
|
|
9
|
-
const ColorPicker = class {
|
|
10
|
-
constructor(hostRef) {
|
|
11
|
-
index.registerInstance(this, hostRef);
|
|
12
|
-
this.valueInput = index.createEvent(this, "valueInput", 7);
|
|
13
|
-
this.valueChanged = index.createEvent(this, "valueChanged", 7);
|
|
14
|
-
this.handleInput = (event) => {
|
|
15
|
-
const input = event.target;
|
|
16
|
-
this.value = input.value || '';
|
|
17
|
-
};
|
|
18
|
-
this.handleChange = (event) => {
|
|
19
|
-
this.valueChanged.emit(this.value);
|
|
20
|
-
};
|
|
21
|
-
this.value = undefined;
|
|
22
|
-
this.size = 'md';
|
|
23
|
-
this.variant = 'full';
|
|
24
|
-
this.disabled = false;
|
|
25
|
-
}
|
|
26
|
-
valueChange() {
|
|
27
|
-
this.valueInput.emit(this.value);
|
|
28
|
-
}
|
|
29
|
-
render() {
|
|
30
|
-
var _a;
|
|
31
|
-
return (index.h(index.Host, null, index.h("div", { class: index$1.classnames('wrapper', this.variant, this.size) }, index.h("label", { class: index$1.classnames('color-picker', { disabled: this.disabled }) }, index.h("input", { type: "color", class: "input", "data-testid": "input", disabled: this.disabled, value: this.value, onInput: this.handleInput, onChange: this.handleChange }), index.h("div", { class: index$1.classnames('selected-wrapper', this.variant) }, index.h("div", { class: "selected", title: this.value }, index.h("vertex-color-swatch", { class: "selected-color", supplementalColor: "var(--vertex-ui-neutral-400)", color: this.value, variant: "square", size: this.size }, index.h("slot", { name: "overlay", slot: "overlay" }, (this.value == null || this.value === '') && (index.h("svg", { class: "no-value", slot: "overlay", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" }, index.h("path", { d: "M16,0L0,16" })))))), this.variant === 'full' && (index.h("div", { class: "text-wrapper" }, index.h("div", { class: "hidden-text" }, "#FFFFFF"), index.h("div", { class: "selected-text" }, (_a = this.getDisplayedValue()) !== null && _a !== void 0 ? _a : 'Default'))))), index.h("div", { class: "right-gutter" }, index.h("slot", { name: "right-gutter" })))));
|
|
32
|
-
}
|
|
33
|
-
getDisplayedValue() {
|
|
34
|
-
var _a;
|
|
35
|
-
if (this.value != null && lib.isValidHexColor(this.value)) {
|
|
36
|
-
return (_a = this.value) === null || _a === void 0 ? void 0 : _a.toLocaleUpperCase();
|
|
37
|
-
}
|
|
38
|
-
return undefined;
|
|
39
|
-
}
|
|
40
|
-
static get watchers() { return {
|
|
41
|
-
"value": ["valueChange"]
|
|
42
|
-
}; }
|
|
43
|
-
};
|
|
44
|
-
ColorPicker.style = colorPickerCss;
|
|
45
|
-
|
|
46
|
-
exports.ColorPicker = ColorPicker;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{C as vertex_color_picker}from"./p-655053df.js";import"./p-6834631c.js";import"./p-fe062eb0.js";import"./p-3438c441.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,h as e,H as r,g as n}from"./p-6834631c.js";import{c as o}from"./p-fe062eb0.js";const a=class{constructor(e){t(this,e),this.type=void 0,this.color="secondary",this.variant="solid",this.size="md",this.expand="block",this.href=void 0,this.target=void 0,this.disabled=void 0}connectedCallback(){if(null!=this.hostElement&&"submit"===this.type){const t=this.hostElement.closest("form");null!=t&&(this.fakeButton=document.createElement("button"),this.fakeButton.setAttribute("type",this.type),this.fakeButton.setAttribute("style","display: none"),this.fakeButton.setAttribute("data-testid","vertex-fake-button"),t.appendChild(this.fakeButton))}}disconnectedCallback(){null!=this.hostElement&&null!=this.fakeButton&&this.fakeButton.remove()}render(){const t=o("btn",{"btn-full":"full"===this.expand,"btn-sm":"sm"===this.size,"btn-md":"md"===this.size,"btn-lg":"lg"===this.size,"btn-primary":"primary"===this.color&&"solid"===this.variant,"btn-secondary":"secondary"===this.color&&"solid"===this.variant,"btn-danger":"danger"===this.color&&"solid"===this.variant,"btn-txt-primary":"primary"===this.color&&"text"===this.variant,"btn-txt-secondary":"secondary"===this.color&&"text"===this.variant,"btn-txt-danger":"danger"===this.color&&"text"===this.variant,"btn-plaintext":"plaintext"===this.variant,disabled:this.disabled});return null!=this.href&&null!=this.type&&console.warn("The type attribute is ignored when href is provided"),e(r,{style:{pointerEvents:this.disabled?"none":void 0}},null!=this.href&&""!==this.href?e("a",{href:this.href,target:this.target,class:t,tabIndex:this.disabled?-1:0},e("slot",null)):e("button",{class:t,disabled:this.disabled,type:this.type,onClick:t=>this.handleClick(t)},e("slot",{name:"left"}),e("slot",null)))}handleClick(t){null!=this.fakeButton&&(t.preventDefault(),this.fakeButton.click())}get hostElement(){return n(this)}};a.style='button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}a{text-decoration:none;font-family:var(--vertex-ui-font-family)}:host{--enabled-cursor:pointer;--disabled-cursor:not-allowed}:host([type]){-webkit-appearance:none !important}:host([disabled=""]){pointer-events:none}.btn{display:flex;align-items:center;justify-content:center;border-radius:0.25rem;box-sizing:border-box;text-decoration:none;cursor:var(--enabled-cursor)}.btn-full{width:100%}.btn.disabled,.btn:not(.disabled):focus,.btn:not(.disabled):active{outline:none}.btn.disabled{cursor:var(--disabled-cursor)}.btn-sm{font-size:var(--vertex-ui-text-sm)}.btn-sm:not(.btn-plaintext){padding:0 0.25rem}.btn-md{font-size:var(--vertex-ui-text-base)}.btn-md:not(.btn-plaintext){padding:0.5rem 1rem}.btn-lg{font-size:var(--vertex-ui-text-lg)}.btn-lg:not(.btn-plaintext){padding:0.75rem 0.75rem}.btn-plaintext{color:var(--vertex-ui-neutral-800)}.btn-primary{color:white;background-color:var(--vertex-ui-blue-700)}.btn-primary:not(.disabled):hover{background-color:var(--vertex-ui-blue-500)}.btn-primary:not(.disabled):focus,.btn-primary:not(.disabled):active{background-color:var(--vertex-ui-blue-600)}.btn-primary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-blue-900)}.btn-primary:not(.disabled):active{box-shadow:none}.btn-primary.disabled{background-color:var(--vertex-ui-blue-200);cursor:var(--disabled-cursor)}.btn-secondary{color:var(--vertex-ui-neutral-800);background-color:var(--vertex-ui-neutral-300)}.btn-secondary:not(.disabled):hover{box-shadow:0 2px 2px rgb(0 0 0 / 20%)}.btn-secondary:not(.disabled):focus,.btn-secondary:not(.disabled):active{background-color:var(--vertex-ui-neutral-400)}.btn-secondary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-neutral-900)}.btn-secondary:not(.disabled):active{box-shadow:none}.btn-secondary.disabled{background-color:var(--vertex-ui-neutral-200);color:var(--vertex-ui-neutral-400)}.btn-danger{color:white;background-color:var(--vertex-ui-red-600)}.btn-danger:not(.disabled):hover{background-color:var(--vertex-ui-red-400)}.btn-danger:not(.disabled):focus{background-color:var(--vertex-ui-red-500);box-shadow:0 0 0 1px var(--vertex-ui-red-900)}.btn-danger:not(.disabled):active{background-color:var(--vertex-ui-red-600);box-shadow:none}.btn-danger.disabled{background-color:var(--vertex-ui-red-200);box-shadow:none}.btn-txt-primary{color:var(--vertex-ui-blue-600)}.btn-txt-primary:not(.disabled):hover{color:var(--vertex-ui-blue-800);background-color:var(--vertex-ui-blue-200)}.btn-txt-primary:not(.disabled):focus,.btn-txt-primary:not(.disabled):active{color:var(--vertex-ui-blue-800);background-color:var(--vertex-ui-blue-300)}.btn-txt-primary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-blue-900)}.btn-txt-primary:not(.disabled):active{box-shadow:none}.btn-txt-primary.disabled{color:var(--vertex-ui-blue-300);box-shadow:none}.btn-txt-secondary{color:var(--vertex-ui-neutral-700)}.btn-txt-secondary:not(.disabled):hover,.btn-txt-secondary:not(.disabled):active,.btn-txt-secondary:not(.disabled):focus{color:var(--vertex-ui-neutral-800);background-color:var(--vertex-ui-neutral-300)}.btn-txt-secondary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-neutral-900)}.btn-txt-secondary.disabled{color:var(--vertex-ui-neutral-300);box-shadow:none}.btn-txt-danger{color:var(--vertex-ui-red-600)}.btn-txt-danger:not(.disabled):focus,.btn-txt-danger:not(.disabled):active,.btn-txt-danger:not(.disabled):hover{color:var(--vertex-ui-red-800)}.btn-txt-danger:not(.disabled):hover{background-color:var(--vertex-ui-red-200)}.btn-txt-danger:not(.disabled):focus,.btn-txt-danger:not(.disabled):active{background-color:var(--vertex-ui-red-300)}.btn-txt-danger:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-red-900)}.btn-txt-danger:not(.disabled):active{box-shadow:none}.btn-txt-danger.disabled{color:var(--vertex-ui-red-300);box-shadow:none}';export{a as B}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,e as t,h as i,H as r}from"./p-6834631c.js";import{c as s}from"./p-fe062eb0.js";import{i as l}from"./p-3438c441.js";const a=class{constructor(i){e(this,i),this.valueInput=t(this,"valueInput",7),this.valueChanged=t(this,"valueChanged",7),this.handleInput=e=>{this.value=e.target.value||""},this.handleChange=()=>{this.valueChanged.emit(this.value)},this.value=void 0,this.size="md",this.variant="full",this.disabled=!1}valueChange(){this.valueInput.emit(this.value)}render(){var e;return i(r,null,i("div",{class:s("wrapper",this.variant,this.size)},i("label",{class:s("color-picker",{disabled:this.disabled})},i("input",{type:"color",class:"input","data-testid":"input",disabled:this.disabled,value:this.value,onInput:this.handleInput,onChange:this.handleChange}),i("div",{class:s("selected-wrapper",this.variant)},i("div",{class:"selected",title:this.value},i("vertex-color-swatch",{class:"selected-color",supplementalColor:"var(--vertex-ui-neutral-400)",color:this.value,variant:"square",size:this.size},i("slot",{name:"overlay",slot:"overlay"},(null==this.value||""===this.value)&&i("svg",{class:"no-value",slot:"overlay",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16"},i("path",{d:"M16,0L0,16"}))))),"full"===this.variant&&i("div",{class:"text-wrapper"},i("div",{class:"hidden-text"},"#FFFFFF"),i("div",{class:"selected-text"},null!==(e=this.getDisplayedValue())&&void 0!==e?e:"Default")))),i("div",{class:"right-gutter"},i("slot",{name:"right-gutter"}))))}getDisplayedValue(){var e;if(null!=this.value&&l(this.value))return null===(e=this.value)||void 0===e?void 0:e.toLocaleUpperCase()}static get watchers(){return{value:["valueChange"]}}};a.style=':host{display:flex;--selected-color-width:initial;--selected-color-height:initial}.wrapper{display:inline-flex;align-items:center}.wrapper.full{padding:0.375rem 0.5rem;border:1px solid var(--vertex-ui-neutral-300);border-radius:4px}.color-picker{display:inline-flex;position:relative;cursor:pointer}.color-picker.disabled{opacity:0.5;cursor:default}.selected-wrapper{position:relative;display:flex;align-items:center}.wrapper.full .selected-wrapper{gap:0.75rem}.selected{position:relative}.wrapper.sm .selected{width:var(--selected-color-width, 1rem);height:var(--selected-color-height, 1rem)}.wrapper.md .selected{width:var(--selected-color-width, 1.25rem);height:var(--selected-color-height, 1.25rem)}.wrapper.lg .selected{width:var(--selected-color-width, 1.5rem);height:var(--selected-color-height, 1.5rem)}.text-wrapper{position:relative}.selected-text{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;color:var(--vertex-ui-neutral-700);text-align:center;font-family:var(--vertex-ui-font-family)}.hidden-text{visibility:hidden;pointer-events:none;font-family:var(--vertex-ui-font-family-monospace)}.wrapper.sm .selected-text,.wrapper.sm .hidden-text{font-size:var(--vertex-ui-text-xs)}.wrapper.md .selected-text,.wrapper.md .hidden-text{font-size:var(--vertex-ui-text-xs)}.wrapper.lg .selected-text,.wrapper.lg .hidden-text{font-size:var(--vertex-ui-text-xs)}.no-value{width:100%;height:100%;stroke:var(--vertex-ui-red-400)}.right-gutter{display:flex;align-items:center;margin-left:auto}slot[name="right-gutter"]::slotted(*){padding:0}.input{display:flex;position:absolute;pointer-events:none;height:100%;width:100%;left:0;top:0;opacity:0}';export{a as C}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{B as vertex_button}from"./p-64e8b92c.js";import"./p-6834631c.js";import"./p-fe062eb0.js";
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-72f28b71.js';
|
|
2
|
-
import { c as classnames } from './index-9c609209.js';
|
|
3
|
-
|
|
4
|
-
const buttonCss = "button{border:none;background-color:transparent;font-family:var(--vertex-ui-font-family);font-size:0.875rem;padding:0}a{text-decoration:none;font-family:var(--vertex-ui-font-family)}:host{--enabled-cursor:pointer;--disabled-cursor:not-allowed}:host([type]){-webkit-appearance:none !important}:host([disabled=\"\"]){pointer-events:none}.btn{display:flex;align-items:center;justify-content:center;border-radius:0.25rem;box-sizing:border-box;text-decoration:none;cursor:var(--enabled-cursor)}.btn-full{width:100%}.btn.disabled,.btn:not(.disabled):focus,.btn:not(.disabled):active{outline:none}.btn.disabled{cursor:var(--disabled-cursor)}.btn-sm{font-size:var(--vertex-ui-text-sm)}.btn-sm:not(.btn-plaintext){padding:0 0.25rem}.btn-md{font-size:var(--vertex-ui-text-base)}.btn-md:not(.btn-plaintext){padding:0.5rem 1rem}.btn-lg{font-size:var(--vertex-ui-text-lg)}.btn-lg:not(.btn-plaintext){padding:0.75rem 0.75rem}.btn-plaintext{color:var(--vertex-ui-neutral-800)}.btn-primary{color:white;background-color:var(--vertex-ui-blue-700)}.btn-primary:not(.disabled):hover{background-color:var(--vertex-ui-blue-500)}.btn-primary:not(.disabled):focus,.btn-primary:not(.disabled):active{background-color:var(--vertex-ui-blue-600)}.btn-primary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-blue-900)}.btn-primary:not(.disabled):active{box-shadow:none}.btn-primary.disabled{background-color:var(--vertex-ui-blue-200);cursor:var(--disabled-cursor)}.btn-secondary{color:var(--vertex-ui-neutral-800);background-color:var(--vertex-ui-neutral-300)}.btn-secondary:not(.disabled):hover{box-shadow:0 2px 2px rgb(0 0 0 / 20%)}.btn-secondary:not(.disabled):focus,.btn-secondary:not(.disabled):active{background-color:var(--vertex-ui-neutral-400)}.btn-secondary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-neutral-900)}.btn-secondary:not(.disabled):active{box-shadow:none}.btn-secondary.disabled{background-color:var(--vertex-ui-neutral-200);color:var(--vertex-ui-neutral-400)}.btn-danger{color:white;background-color:var(--vertex-ui-red-600)}.btn-danger:not(.disabled):hover{background-color:var(--vertex-ui-red-400)}.btn-danger:not(.disabled):focus{background-color:var(--vertex-ui-red-500);box-shadow:0 0 0 1px var(--vertex-ui-red-900)}.btn-danger:not(.disabled):active{background-color:var(--vertex-ui-red-600);box-shadow:none}.btn-danger.disabled{background-color:var(--vertex-ui-red-200);box-shadow:none}.btn-txt-primary{color:var(--vertex-ui-blue-600)}.btn-txt-primary:not(.disabled):hover{color:var(--vertex-ui-blue-800);background-color:var(--vertex-ui-blue-200)}.btn-txt-primary:not(.disabled):focus,.btn-txt-primary:not(.disabled):active{color:var(--vertex-ui-blue-800);background-color:var(--vertex-ui-blue-300)}.btn-txt-primary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-blue-900)}.btn-txt-primary:not(.disabled):active{box-shadow:none}.btn-txt-primary.disabled{color:var(--vertex-ui-blue-300);box-shadow:none}.btn-txt-secondary{color:var(--vertex-ui-neutral-700)}.btn-txt-secondary:not(.disabled):hover,.btn-txt-secondary:not(.disabled):active,.btn-txt-secondary:not(.disabled):focus{color:var(--vertex-ui-neutral-800);background-color:var(--vertex-ui-neutral-300)}.btn-txt-secondary:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-neutral-900)}.btn-txt-secondary.disabled{color:var(--vertex-ui-neutral-300);box-shadow:none}.btn-txt-danger{color:var(--vertex-ui-red-600)}.btn-txt-danger:not(.disabled):focus,.btn-txt-danger:not(.disabled):active,.btn-txt-danger:not(.disabled):hover{color:var(--vertex-ui-red-800)}.btn-txt-danger:not(.disabled):hover{background-color:var(--vertex-ui-red-200)}.btn-txt-danger:not(.disabled):focus,.btn-txt-danger:not(.disabled):active{background-color:var(--vertex-ui-red-300)}.btn-txt-danger:not(.disabled):focus{box-shadow:0 0 0 1px var(--vertex-ui-red-900)}.btn-txt-danger:not(.disabled):active{box-shadow:none}.btn-txt-danger.disabled{color:var(--vertex-ui-red-300);box-shadow:none}";
|
|
5
|
-
|
|
6
|
-
const Button = class {
|
|
7
|
-
constructor(hostRef) {
|
|
8
|
-
registerInstance(this, hostRef);
|
|
9
|
-
this.type = undefined;
|
|
10
|
-
this.color = 'secondary';
|
|
11
|
-
this.variant = 'solid';
|
|
12
|
-
this.size = 'md';
|
|
13
|
-
this.expand = 'block';
|
|
14
|
-
this.href = undefined;
|
|
15
|
-
this.target = undefined;
|
|
16
|
-
this.disabled = undefined;
|
|
17
|
-
}
|
|
18
|
-
connectedCallback() {
|
|
19
|
-
if (this.hostElement != null && this.type === 'submit') {
|
|
20
|
-
const form = this.hostElement.closest('form');
|
|
21
|
-
if (form != null) {
|
|
22
|
-
this.fakeButton = document.createElement('button');
|
|
23
|
-
this.fakeButton.setAttribute('type', this.type);
|
|
24
|
-
this.fakeButton.setAttribute('style', 'display: none');
|
|
25
|
-
this.fakeButton.setAttribute('data-testid', 'vertex-fake-button');
|
|
26
|
-
form.appendChild(this.fakeButton);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
disconnectedCallback() {
|
|
31
|
-
if (this.hostElement != null && this.fakeButton != null) {
|
|
32
|
-
this.fakeButton.remove();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
render() {
|
|
36
|
-
const classes = classnames('btn', {
|
|
37
|
-
'btn-full': this.expand === 'full',
|
|
38
|
-
'btn-sm': this.size === 'sm',
|
|
39
|
-
'btn-md': this.size === 'md',
|
|
40
|
-
'btn-lg': this.size === 'lg',
|
|
41
|
-
'btn-primary': this.color === 'primary' && this.variant === 'solid',
|
|
42
|
-
'btn-secondary': this.color === 'secondary' && this.variant === 'solid',
|
|
43
|
-
'btn-danger': this.color === 'danger' && this.variant === 'solid',
|
|
44
|
-
'btn-txt-primary': this.color === 'primary' && this.variant === 'text',
|
|
45
|
-
'btn-txt-secondary': this.color === 'secondary' && this.variant === 'text',
|
|
46
|
-
'btn-txt-danger': this.color === 'danger' && this.variant === 'text',
|
|
47
|
-
'btn-plaintext': this.variant === 'plaintext',
|
|
48
|
-
disabled: this.disabled,
|
|
49
|
-
});
|
|
50
|
-
if (this.href != null && this.type != null) {
|
|
51
|
-
console.warn('The type attribute is ignored when href is provided');
|
|
52
|
-
}
|
|
53
|
-
return (h(Host, { style: { pointerEvents: this.disabled ? 'none' : undefined } }, this.href != null && this.href !== '' ? (h("a", { href: this.href, target: this.target, class: classes, tabIndex: this.disabled ? -1 : 0 }, h("slot", null))) : (h("button", { class: classes, disabled: this.disabled, type: this.type, onClick: (event) => this.handleClick(event) }, h("slot", { name: "left" }), h("slot", null)))));
|
|
54
|
-
}
|
|
55
|
-
handleClick(event) {
|
|
56
|
-
if (this.fakeButton != null) {
|
|
57
|
-
event.preventDefault();
|
|
58
|
-
this.fakeButton.click();
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
get hostElement() { return getElement(this); }
|
|
62
|
-
};
|
|
63
|
-
Button.style = buttonCss;
|
|
64
|
-
|
|
65
|
-
export { Button as B };
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { r as registerInstance, e as createEvent, h, H as Host } from './index-72f28b71.js';
|
|
2
|
-
import { c as classnames } from './index-9c609209.js';
|
|
3
|
-
import { i as isValidHexColor } from './lib-73fbca8b.js';
|
|
4
|
-
|
|
5
|
-
const colorPickerCss = ":host{display:flex;--selected-color-width:initial;--selected-color-height:initial}.wrapper{display:inline-flex;align-items:center}.wrapper.full{padding:0.375rem 0.5rem;border:1px solid var(--vertex-ui-neutral-300);border-radius:4px}.color-picker{display:inline-flex;position:relative;cursor:pointer}.color-picker.disabled{opacity:0.5;cursor:default}.selected-wrapper{position:relative;display:flex;align-items:center}.wrapper.full .selected-wrapper{gap:0.75rem}.selected{position:relative}.wrapper.sm .selected{width:var(--selected-color-width, 1rem);height:var(--selected-color-height, 1rem)}.wrapper.md .selected{width:var(--selected-color-width, 1.25rem);height:var(--selected-color-height, 1.25rem)}.wrapper.lg .selected{width:var(--selected-color-width, 1.5rem);height:var(--selected-color-height, 1.5rem)}.text-wrapper{position:relative}.selected-text{position:absolute;left:0;top:0;right:0;bottom:0;display:flex;color:var(--vertex-ui-neutral-700);text-align:center;font-family:var(--vertex-ui-font-family)}.hidden-text{visibility:hidden;pointer-events:none;font-family:var(--vertex-ui-font-family-monospace)}.wrapper.sm .selected-text,.wrapper.sm .hidden-text{font-size:var(--vertex-ui-text-xs)}.wrapper.md .selected-text,.wrapper.md .hidden-text{font-size:var(--vertex-ui-text-xs)}.wrapper.lg .selected-text,.wrapper.lg .hidden-text{font-size:var(--vertex-ui-text-xs)}.no-value{width:100%;height:100%;stroke:var(--vertex-ui-red-400)}.right-gutter{display:flex;align-items:center;margin-left:auto}slot[name=\"right-gutter\"]::slotted(*){padding:0}.input{display:flex;position:absolute;pointer-events:none;height:100%;width:100%;left:0;top:0;opacity:0}";
|
|
6
|
-
|
|
7
|
-
const ColorPicker = class {
|
|
8
|
-
constructor(hostRef) {
|
|
9
|
-
registerInstance(this, hostRef);
|
|
10
|
-
this.valueInput = createEvent(this, "valueInput", 7);
|
|
11
|
-
this.valueChanged = createEvent(this, "valueChanged", 7);
|
|
12
|
-
this.handleInput = (event) => {
|
|
13
|
-
const input = event.target;
|
|
14
|
-
this.value = input.value || '';
|
|
15
|
-
};
|
|
16
|
-
this.handleChange = (event) => {
|
|
17
|
-
this.valueChanged.emit(this.value);
|
|
18
|
-
};
|
|
19
|
-
this.value = undefined;
|
|
20
|
-
this.size = 'md';
|
|
21
|
-
this.variant = 'full';
|
|
22
|
-
this.disabled = false;
|
|
23
|
-
}
|
|
24
|
-
valueChange() {
|
|
25
|
-
this.valueInput.emit(this.value);
|
|
26
|
-
}
|
|
27
|
-
render() {
|
|
28
|
-
var _a;
|
|
29
|
-
return (h(Host, null, h("div", { class: classnames('wrapper', this.variant, this.size) }, h("label", { class: classnames('color-picker', { disabled: this.disabled }) }, h("input", { type: "color", class: "input", "data-testid": "input", disabled: this.disabled, value: this.value, onInput: this.handleInput, onChange: this.handleChange }), h("div", { class: classnames('selected-wrapper', this.variant) }, h("div", { class: "selected", title: this.value }, h("vertex-color-swatch", { class: "selected-color", supplementalColor: "var(--vertex-ui-neutral-400)", color: this.value, variant: "square", size: this.size }, h("slot", { name: "overlay", slot: "overlay" }, (this.value == null || this.value === '') && (h("svg", { class: "no-value", slot: "overlay", xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 16 16" }, h("path", { d: "M16,0L0,16" })))))), this.variant === 'full' && (h("div", { class: "text-wrapper" }, h("div", { class: "hidden-text" }, "#FFFFFF"), h("div", { class: "selected-text" }, (_a = this.getDisplayedValue()) !== null && _a !== void 0 ? _a : 'Default'))))), h("div", { class: "right-gutter" }, h("slot", { name: "right-gutter" })))));
|
|
30
|
-
}
|
|
31
|
-
getDisplayedValue() {
|
|
32
|
-
var _a;
|
|
33
|
-
if (this.value != null && isValidHexColor(this.value)) {
|
|
34
|
-
return (_a = this.value) === null || _a === void 0 ? void 0 : _a.toLocaleUpperCase();
|
|
35
|
-
}
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
static get watchers() { return {
|
|
39
|
-
"value": ["valueChange"]
|
|
40
|
-
}; }
|
|
41
|
-
};
|
|
42
|
-
ColorPicker.style = colorPickerCss;
|
|
43
|
-
|
|
44
|
-
export { ColorPicker as C };
|