@vonage/vivid 3.35.0 → 3.37.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.
- package/accordion/index.js +1 -2
- package/accordion-item/index.js +1 -0
- package/alert/index.js +1 -0
- package/badge/index.js +1 -0
- package/banner/index.js +1 -0
- package/breadcrumb/index.js +0 -1
- package/breadcrumb-item/index.js +1 -0
- package/button/index.js +1 -0
- package/card/index.js +0 -1
- package/checkbox/index.js +1 -2
- package/combobox/index.js +1 -2
- package/custom-elements.json +196 -76
- package/data-grid/index.js +1 -2
- package/date-picker/index.js +1 -2
- package/dialog/index.js +1 -2
- package/empty-state/index.js +0 -1
- package/fab/index.js +1 -0
- package/file-picker/index.js +1 -0
- package/index.js +1 -2
- package/lib/date-picker/date-picker.d.ts +12 -12
- package/lib/date-picker/date-picker.form-associated.d.ts +11 -0
- package/lib/menu-item/menu-item.d.ts +2 -0
- package/lib/menu-item/menu-item.template.d.ts +1 -1
- package/lib/number-field/number-field.d.ts +6 -2
- package/lib/tree-item/tree-item.template.d.ts +1 -1
- package/listbox/index.js +1 -2
- package/menu/index.js +1 -2
- package/menu-item/index.js +2 -2
- package/nav-disclosure/index.js +1 -0
- package/nav-item/index.js +1 -0
- package/note/index.js +1 -0
- package/number-field/index.js +1 -0
- package/option/index.js +1 -0
- package/package.json +1 -1
- package/pagination/index.js +1 -1
- package/popup/index.js +1 -0
- package/radio-group/index.js +1 -2
- package/select/index.js +1 -2
- package/shared/affix.js +16 -5
- package/shared/apply-mixins.js +1 -1
- package/shared/children.js +2 -2
- package/shared/definition.js +3 -3
- package/shared/definition10.js +1 -1
- package/shared/definition11.js +1 -1
- package/shared/definition12.js +1 -1
- package/shared/definition13.js +1 -1
- package/shared/definition14.js +1 -1
- package/shared/definition15.js +1 -1
- package/shared/definition16.js +3 -4
- package/shared/definition17.js +99 -45
- package/shared/definition18.js +1 -1
- package/shared/definition19.js +1 -1
- package/shared/definition2.js +2 -3
- package/shared/definition20.js +1 -1
- package/shared/definition21.js +6 -5
- package/shared/definition22.js +1 -1
- package/shared/definition23.js +1 -1
- package/shared/definition26.js +475 -54
- package/shared/definition27.js +7 -400
- package/shared/definition28.js +3 -3
- package/shared/definition29.js +1 -1
- package/shared/definition3.js +1 -1
- package/shared/definition31.js +1 -1
- package/shared/definition32.js +56 -9
- package/shared/definition33.js +4 -6
- package/shared/definition34.js +2 -2
- package/shared/definition35.js +1 -1
- package/shared/definition36.js +1 -1
- package/shared/definition37.js +2 -3
- package/shared/definition38.js +1 -1
- package/shared/definition39.js +5 -7
- package/shared/definition4.js +1 -1
- package/shared/definition40.js +1 -1
- package/shared/definition42.js +1 -1
- package/shared/definition43.js +1 -1
- package/shared/definition45.js +3 -3
- package/shared/definition46.js +1 -1
- package/shared/definition48.js +3 -3
- package/shared/definition49.js +1 -1
- package/shared/definition5.js +1 -1
- package/shared/definition51.js +1 -1
- package/shared/definition52.js +1 -1
- package/shared/definition53.js +5 -6
- package/shared/definition55.js +1 -1
- package/shared/definition6.js +4 -4
- package/shared/definition7.js +3 -3
- package/shared/definition8.js +1 -1
- package/shared/definition9.js +1 -2
- package/shared/icon.js +1 -1
- package/shared/index.js +1 -1
- package/shared/index2.js +66 -73
- package/shared/patterns/affix.d.ts +7 -1
- package/shared/patterns/form-elements/form-elements.d.ts +9 -7
- package/shared/ref.js +1 -1
- package/shared/slotted.js +73 -3
- package/shared/text-field.js +1 -1
- package/split-button/index.js +1 -0
- package/style.css +295 -281
- package/styles/core/all.css +44 -13
- package/styles/core/theme.css +1 -1
- package/styles/core/typography.css +44 -13
- package/styles/tokens/theme-dark.css +4 -4
- package/styles/tokens/theme-light.css +4 -4
- package/styles/tokens/vivid-2-compat.css +1 -1
- package/switch/index.js +1 -0
- package/tab/index.js +1 -0
- package/tabs/index.js +1 -2
- package/tag/index.js +1 -0
- package/text-anchor/index.js +1 -0
- package/text-area/index.js +1 -0
- package/text-field/index.js +1 -2
- package/toggletip/index.js +1 -0
- package/tooltip/index.js +1 -0
- package/tree-item/index.js +1 -2
- package/tree-view/index.js +0 -1
- package/shared/node-observation.js +0 -74
package/shared/index2.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { I as Icon } from './icon.js';
|
|
2
|
-
import { a as attr, o as observable,
|
|
2
|
+
import { a as attr, o as observable, h as html } from './index.js';
|
|
3
3
|
import { w as when } from './when.js';
|
|
4
4
|
import enUS from '../locales/en-US.js';
|
|
5
5
|
|
|
6
|
-
const messageStyles = "/**\n * Do not edit directly\n * Generated on
|
|
6
|
+
const messageStyles = "/**\n * Do not edit directly\n * Generated on Tue, 26 Sep 2023 13:00:58 GMT\n */\n.message {\n display: flex;\n contain: inline-size;\n font: var(--vvd-typography-base-condensed);\n gap: 4px;\n grid-column: 1/-1;\n}\n.message-text {\n color: var(--vvd-color-canvas-text);\n}\n.helper-message .message-text {\n color: var(--_low-ink-color);\n}\n.message-icon {\n font-size: 16px;\n}\n.success-message .message-icon {\n color: var(--vvd-color-success-500);\n}\n.error-message .message-icon {\n color: var(--vvd-color-alert-500);\n}";
|
|
7
7
|
|
|
8
8
|
var __defProp$1 = Object.defineProperty;
|
|
9
9
|
var __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor;
|
|
@@ -16,8 +16,6 @@ var __decorateClass$1 = (decorators, target, key, kind) => {
|
|
|
16
16
|
__defProp$1(target, key, result);
|
|
17
17
|
return result;
|
|
18
18
|
};
|
|
19
|
-
const ElementInternalsKey = "ElementInternals";
|
|
20
|
-
const supportsElementInternals = () => ElementInternalsKey in window && "setFormValue" in window[ElementInternalsKey].prototype;
|
|
21
19
|
class FormElementHelperText {
|
|
22
20
|
}
|
|
23
21
|
__decorateClass$1([
|
|
@@ -43,131 +41,126 @@ function formElements(constructor) {
|
|
|
43
41
|
class Decorated extends constructor {
|
|
44
42
|
constructor(...args) {
|
|
45
43
|
super(...args);
|
|
46
|
-
this.
|
|
47
|
-
this.#
|
|
44
|
+
this.errorValidationMessage = "";
|
|
45
|
+
this.#forceErrorDisplay = false;
|
|
46
|
+
this.#hasBeenTouched = false;
|
|
48
47
|
this.#handleInvalidEvent = () => {
|
|
49
|
-
|
|
50
|
-
return;
|
|
51
|
-
this.#blurred = true;
|
|
52
|
-
this.dirtyValue = true;
|
|
48
|
+
this.#forceErrorDisplay = true;
|
|
53
49
|
this.validate();
|
|
54
50
|
};
|
|
55
51
|
this.validate = () => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
super.validate();
|
|
60
|
-
}
|
|
61
|
-
this.userValid = !this.userValid;
|
|
62
|
-
if (this.proxy instanceof HTMLElement) {
|
|
63
|
-
this.userValid = this.#blurred && this.dirtyValue ? !this.validationMessage : true;
|
|
64
|
-
}
|
|
52
|
+
super.validate();
|
|
53
|
+
const shouldShowValidationError = this.#forceErrorDisplay || this.#hasBeenTouched && this.dirtyValue;
|
|
54
|
+
this.errorValidationMessage = shouldShowValidationError ? this.validationMessage : "";
|
|
65
55
|
};
|
|
66
56
|
this.addEventListener("blur", () => {
|
|
67
|
-
this.#
|
|
57
|
+
this.#hasBeenTouched = true;
|
|
58
|
+
this.#forceErrorDisplay = false;
|
|
68
59
|
this.validate();
|
|
69
60
|
});
|
|
70
61
|
this.addEventListener("focus", () => {
|
|
71
|
-
this.#
|
|
62
|
+
this.#hasBeenTouched = false;
|
|
72
63
|
});
|
|
73
64
|
this.addEventListener("invalid", () => {
|
|
74
65
|
this.proxy.dispatchEvent(new Event("invalid"));
|
|
75
66
|
});
|
|
76
67
|
}
|
|
77
|
-
#
|
|
78
|
-
|
|
79
|
-
return this.userValid ? "" : this.validationMessage;
|
|
80
|
-
}
|
|
68
|
+
#forceErrorDisplay;
|
|
69
|
+
#hasBeenTouched;
|
|
81
70
|
connectedCallback() {
|
|
82
|
-
super.connectedCallback
|
|
71
|
+
super.connectedCallback();
|
|
83
72
|
this.proxy.addEventListener("invalid", this.#handleInvalidEvent);
|
|
84
73
|
}
|
|
85
74
|
#handleInvalidEvent;
|
|
86
75
|
disconnectedCallback() {
|
|
87
|
-
super.disconnectedCallback
|
|
76
|
+
super.disconnectedCallback();
|
|
88
77
|
this.proxy.removeEventListener("invalid", this.#handleInvalidEvent);
|
|
89
78
|
}
|
|
79
|
+
formResetCallback() {
|
|
80
|
+
this.#forceErrorDisplay = false;
|
|
81
|
+
super.formResetCallback();
|
|
82
|
+
this.validate();
|
|
83
|
+
}
|
|
90
84
|
}
|
|
91
85
|
__decorateClass$1([
|
|
92
86
|
attr
|
|
93
87
|
], Decorated.prototype, "label", 2);
|
|
94
88
|
__decorateClass$1([
|
|
95
89
|
observable
|
|
96
|
-
], Decorated.prototype, "
|
|
97
|
-
__decorateClass$1([
|
|
98
|
-
volatile
|
|
99
|
-
], Decorated.prototype, "errorValidationMessage", 1);
|
|
90
|
+
], Decorated.prototype, "errorValidationMessage", 2);
|
|
100
91
|
return Decorated;
|
|
101
92
|
}
|
|
102
93
|
function getFeedbackTemplate(messageType, context) {
|
|
103
94
|
const MessageTypeMap = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
95
|
+
helper: {
|
|
96
|
+
messageProperty: "helperText",
|
|
97
|
+
className: "helper",
|
|
98
|
+
iconType: ""
|
|
108
99
|
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
100
|
+
error: {
|
|
101
|
+
messageProperty: "errorValidationMessage",
|
|
102
|
+
className: "error",
|
|
103
|
+
iconType: "info-line"
|
|
113
104
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
105
|
+
success: {
|
|
106
|
+
messageProperty: "successText",
|
|
107
|
+
className: "success",
|
|
108
|
+
iconType: "check-circle-line"
|
|
118
109
|
}
|
|
119
110
|
};
|
|
120
111
|
const iconTag = context.tagFor(Icon);
|
|
121
112
|
const messageTypeConfig = MessageTypeMap[messageType];
|
|
122
113
|
const iconType = messageTypeConfig.iconType;
|
|
123
|
-
return html`
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<${iconTag} class="message-icon" name="${iconType}"></${iconTag}>`
|
|
131
|
-
|
|
114
|
+
return html` <style>
|
|
115
|
+
${messageStyles}
|
|
116
|
+
</style>
|
|
117
|
+
<div class="message ${MessageTypeMap[messageType].className}-message">
|
|
118
|
+
${when(
|
|
119
|
+
() => iconType,
|
|
120
|
+
html`
|
|
121
|
+
<${iconTag} class="message-icon" name="${iconType}"></${iconTag}>`
|
|
122
|
+
)}
|
|
123
|
+
${feedbackMessage({
|
|
132
124
|
messageProperty: MessageTypeMap[messageType].messageProperty
|
|
133
125
|
})}
|
|
134
|
-
|
|
126
|
+
</div>`;
|
|
135
127
|
}
|
|
136
|
-
function feedbackMessage({
|
|
128
|
+
function feedbackMessage({
|
|
129
|
+
messageProperty
|
|
130
|
+
}) {
|
|
137
131
|
return html`
|
|
138
|
-
|
|
132
|
+
<span class="message-text">${(x) => x[messageProperty]}</span>
|
|
139
133
|
`;
|
|
140
134
|
}
|
|
141
135
|
function errorText(constructor) {
|
|
142
136
|
class Decorated extends constructor {
|
|
143
137
|
constructor(...args) {
|
|
144
138
|
super(...args);
|
|
145
|
-
this.#
|
|
146
|
-
this.#prevSuccessText = "";
|
|
139
|
+
this.#blockValidateCalls = false;
|
|
147
140
|
this._validate = this.validate;
|
|
148
141
|
this.validate = () => {
|
|
149
|
-
if (this.#
|
|
142
|
+
if (!this.#blockValidateCalls)
|
|
150
143
|
this._validate();
|
|
151
144
|
};
|
|
152
145
|
}
|
|
153
|
-
#
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this.setValidity({ customError: true }, newmsg, this.control);
|
|
158
|
-
this.#prevSuccessText = this.successText;
|
|
159
|
-
this.successText = "";
|
|
160
|
-
this.userValid = !this.userValid;
|
|
161
|
-
this.userValid = false;
|
|
162
|
-
this.#shouldValidate = false;
|
|
146
|
+
#blockValidateCalls;
|
|
147
|
+
errorTextChanged(_, newErrorText) {
|
|
148
|
+
if (newErrorText) {
|
|
149
|
+
this.#forceCustomError(newErrorText);
|
|
163
150
|
} else {
|
|
164
|
-
this
|
|
165
|
-
this.successText = this.#prevSuccessText;
|
|
166
|
-
this.userValid = true;
|
|
167
|
-
this.#shouldValidate = true;
|
|
168
|
-
this._validate();
|
|
151
|
+
this.#clearCustomErrorAndRevalidate();
|
|
169
152
|
}
|
|
170
153
|
}
|
|
154
|
+
#forceCustomError(errorMessage) {
|
|
155
|
+
this.setValidity({ customError: true }, errorMessage, this.control);
|
|
156
|
+
this.errorValidationMessage = errorMessage;
|
|
157
|
+
this.#blockValidateCalls = true;
|
|
158
|
+
}
|
|
159
|
+
#clearCustomErrorAndRevalidate() {
|
|
160
|
+
this.setValidity({ customError: false }, "", this.control);
|
|
161
|
+
this.#blockValidateCalls = false;
|
|
162
|
+
this.validate();
|
|
163
|
+
}
|
|
171
164
|
}
|
|
172
165
|
__decorateClass$1([
|
|
173
166
|
attr({ attribute: "error-text" })
|
|
@@ -6,4 +6,10 @@ export declare class AffixIcon {
|
|
|
6
6
|
export declare class AffixIconWithTrailing extends AffixIcon {
|
|
7
7
|
iconTrailing: boolean;
|
|
8
8
|
}
|
|
9
|
-
export declare const
|
|
9
|
+
export declare const IconWrapper: {
|
|
10
|
+
Slot: boolean;
|
|
11
|
+
Span: boolean;
|
|
12
|
+
};
|
|
13
|
+
type affixIconTemplateFactoryReturnType = (context: ElementDefinitionContext) => (icon?: string, slottedState?: boolean, iconSlottedContent?: string) => ViewTemplate<AffixIcon> | null;
|
|
14
|
+
export declare const affixIconTemplateFactory: affixIconTemplateFactoryReturnType;
|
|
15
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ElementDefinitionContext } from '@microsoft/fast-foundation';
|
|
2
2
|
export interface FormElement {
|
|
3
|
-
errorValidationMessage:
|
|
3
|
+
errorValidationMessage: string;
|
|
4
4
|
label: string;
|
|
5
5
|
userValid: boolean;
|
|
6
6
|
dirtyValue: boolean;
|
|
@@ -32,12 +32,13 @@ export declare function formElements<T extends {
|
|
|
32
32
|
new (...args: any[]): {
|
|
33
33
|
[x: string]: any;
|
|
34
34
|
label?: string | undefined;
|
|
35
|
-
|
|
36
|
-
"__#2@#
|
|
37
|
-
|
|
35
|
+
errorValidationMessage: string;
|
|
36
|
+
"__#2@#forceErrorDisplay": boolean;
|
|
37
|
+
"__#2@#hasBeenTouched": boolean;
|
|
38
38
|
connectedCallback(): void;
|
|
39
39
|
"__#2@#handleInvalidEvent": () => void;
|
|
40
40
|
disconnectedCallback(): void;
|
|
41
|
+
formResetCallback(): void;
|
|
41
42
|
validate: () => void;
|
|
42
43
|
};
|
|
43
44
|
} & T;
|
|
@@ -49,9 +50,10 @@ export declare function errorText<T extends {
|
|
|
49
50
|
new (...args: any[]): {
|
|
50
51
|
[x: string]: any;
|
|
51
52
|
errorText?: string | undefined;
|
|
52
|
-
"__#3@#
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
"__#3@#blockValidateCalls": boolean;
|
|
54
|
+
errorTextChanged(_: string, newErrorText: string | undefined): void;
|
|
55
|
+
"__#3@#forceCustomError"(errorMessage: string): void;
|
|
56
|
+
"__#3@#clearCustomErrorAndRevalidate"(): void;
|
|
55
57
|
};
|
|
56
58
|
} & T;
|
|
57
59
|
export {};
|
package/shared/ref.js
CHANGED
package/shared/slotted.js
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { O as Observable, e as emptyArray, b as AttachedBehaviorHTMLDirective } from './index.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Creates a function that can be used to filter a Node array, selecting only elements.
|
|
5
|
+
* @param selector - An optional selector to restrict the filter to.
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
function elements(selector) {
|
|
9
|
+
if (selector) {
|
|
10
|
+
return function (value, index, array) {
|
|
11
|
+
return value.nodeType === 1 && value.matches(selector);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
return function (value, index, array) {
|
|
15
|
+
return value.nodeType === 1;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A base class for node observation.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
class NodeObservationBehavior {
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of NodeObservationBehavior.
|
|
25
|
+
* @param target - The target to assign the nodes property on.
|
|
26
|
+
* @param options - The options to use in configuring node observation.
|
|
27
|
+
*/
|
|
28
|
+
constructor(target, options) {
|
|
29
|
+
this.target = target;
|
|
30
|
+
this.options = options;
|
|
31
|
+
this.source = null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Bind this behavior to the source.
|
|
35
|
+
* @param source - The source to bind to.
|
|
36
|
+
* @param context - The execution context that the binding is operating within.
|
|
37
|
+
*/
|
|
38
|
+
bind(source) {
|
|
39
|
+
const name = this.options.property;
|
|
40
|
+
this.shouldUpdate = Observable.getAccessors(source).some((x) => x.name === name);
|
|
41
|
+
this.source = source;
|
|
42
|
+
this.updateTarget(this.computeNodes());
|
|
43
|
+
if (this.shouldUpdate) {
|
|
44
|
+
this.observe();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Unbinds this behavior from the source.
|
|
49
|
+
* @param source - The source to unbind from.
|
|
50
|
+
*/
|
|
51
|
+
unbind() {
|
|
52
|
+
this.updateTarget(emptyArray);
|
|
53
|
+
this.source = null;
|
|
54
|
+
if (this.shouldUpdate) {
|
|
55
|
+
this.disconnect();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** @internal */
|
|
59
|
+
handleEvent() {
|
|
60
|
+
this.updateTarget(this.computeNodes());
|
|
61
|
+
}
|
|
62
|
+
computeNodes() {
|
|
63
|
+
let nodes = this.getNodes();
|
|
64
|
+
if (this.options.filter !== void 0) {
|
|
65
|
+
nodes = nodes.filter(this.options.filter);
|
|
66
|
+
}
|
|
67
|
+
return nodes;
|
|
68
|
+
}
|
|
69
|
+
updateTarget(value) {
|
|
70
|
+
this.source[this.options.property] = value;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
3
73
|
|
|
4
74
|
/**
|
|
5
75
|
* The runtime behavior for slotted node observation.
|
|
@@ -46,4 +116,4 @@ function slotted(propertyOrOptions) {
|
|
|
46
116
|
return new AttachedBehaviorHTMLDirective("fast-slotted", SlottedBehavior, propertyOrOptions);
|
|
47
117
|
}
|
|
48
118
|
|
|
49
|
-
export { slotted as s };
|
|
119
|
+
export { NodeObservationBehavior as N, elements as e, slotted as s };
|
package/shared/text-field.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const styles = "/**\n * Do not edit directly\n * Generated on
|
|
1
|
+
const styles = "/**\n * Do not edit directly\n * Generated on Tue, 26 Sep 2023 13:00:58 GMT\n */\n:host {\n display: inline-block;\n}\n\n.base {\n --_text-field-gutter: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2.5);\n --_text-field-icon-size: calc(calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2))) / 2);\n display: inline-grid;\n width: 100%;\n gap: 4px;\n grid-template-columns: min-content 1fr max-content;\n}\n.base {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-intermediate);\n}\n.base.appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--_connotation-color-backdrop);\n --_appearance-color-outline: var(--_connotation-color-firm);\n}\n.base:where(:hover, .hover):where(:not(:disabled, .disabled, .readonly)).appearance-ghost {\n --_appearance-color-text: var(--_connotation-color-primary);\n --_appearance-color-fill: var(--_connotation-color-faint);\n --_appearance-color-outline: transparent;\n}\n.base:where(:disabled, .disabled) {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: var(--vvd-color-neutral-100);\n --_appearance-color-outline: var(--vvd-color-neutral-300);\n}\n.base:where(:disabled, .disabled).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-300);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)) {\n --_appearance-color-text: var(--vvd-color-canvas-text);\n --_appearance-color-fill: var(--vvd-color-neutral-200);\n --_appearance-color-outline: var(--vvd-color-neutral-400);\n}\n.base:where(.readonly):where(:not(:disabled, .disabled)).appearance-ghost {\n --_appearance-color-text: var(--vvd-color-neutral-600);\n --_appearance-color-fill: transparent;\n --_appearance-color-outline: transparent;\n}\n.base.connotation-success {\n /* @cssprop [--vvd-text-field-success-primary=var(--vvd-color-success-500)] */\n --_connotation-color-primary: var(--vvd-text-field-success-primary, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-backdrop=var(--vvd-color-success-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-success-backdrop, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-intermediate=var(--vvd-color-success-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-success-intermediate, var(--vvd-color-success-500));\n /* @cssprop [--vvd-text-field-success-firm=var(--vvd-color-success-600)] */\n --_connotation-color-firm: var(--vvd-text-field-success-firm, var(--vvd-color-success-600));\n /* @cssprop [--vvd-text-field-success-faint=var(--vvd-color-success-50)] */\n --_connotation-color-faint: var(--vvd-text-field-success-faint, var(--vvd-color-success-50));\n /* @cssprop [--vvd-text-field-success-soft=var(--vvd-color-success-100)] */\n --_connotation-color-soft: var(--vvd-text-field-success-soft, var(--vvd-color-success-100));\n}\n.base.connotation-alert {\n /* @cssprop [--vvd-text-field-alert-primary=var(--vvd-color-alert-500)] */\n --_connotation-color-primary: var(--vvd-text-field-alert-primary, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-backdrop=var(--vvd-color-alert-50)] */\n --_connotation-color-backdrop: var(--vvd-text-field-alert-backdrop, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-intermediate=var(--vvd-color-alert-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-alert-intermediate, var(--vvd-color-alert-500));\n /* @cssprop [--vvd-text-field-alert-firm=var(--vvd-color-alert-600)] */\n --_connotation-color-firm: var(--vvd-text-field-alert-firm, var(--vvd-color-alert-600));\n /* @cssprop [--vvd-text-field-alert-faint=var(--vvd-color-alert-50)] */\n --_connotation-color-faint: var(--vvd-text-field-alert-faint, var(--vvd-color-alert-50));\n /* @cssprop [--vvd-text-field-alert-soft=var(--vvd-color-alert-100)] */\n --_connotation-color-soft: var(--vvd-text-field-alert-soft, var(--vvd-color-alert-100));\n}\n.base:not(.connotation-success, .connotation-alert) {\n /* @cssprop [--vvd-text-field-accent-primary=var(--vvd-color-canvas-text)] */\n --_connotation-color-primary: var(--vvd-text-field-accent-primary, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-backdrop=var(--vvd-color-canvas)] */\n --_connotation-color-backdrop: var(--vvd-text-field-accent-backdrop, var(--vvd-color-canvas));\n /* @cssprop [--vvd-text-field-accent-intermediate=var(--vvd-color-neutral-500)] */\n --_connotation-color-intermediate: var(--vvd-text-field-accent-intermediate, var(--vvd-color-neutral-500));\n /* @cssprop [--vvd-text-field-accent-firm=var(--vvd-color-canvas-text)] */\n --_connotation-color-firm: var(--vvd-text-field-accent-firm, var(--vvd-color-canvas-text));\n /* @cssprop [--vvd-text-field-accent-faint=var(--vvd-color-neutral-50)] */\n --_connotation-color-faint: var(--vvd-text-field-accent-faint, var(--vvd-color-neutral-50));\n /* @cssprop [--vvd-text-field-accent-soft=var(--vvd-color-neutral-100)] */\n --_connotation-color-soft: var(--vvd-text-field-accent-soft, var(--vvd-color-neutral-100));\n}\n@supports (user-select: none) {\n .base {\n user-select: none;\n }\n}\n.base:not(.disabled) {\n --_low-ink-color: var(--vvd-color-neutral-600);\n}\n.base.disabled {\n --_low-ink-color: var(--_appearance-color-text);\n}\n\n.label {\n color: var(--vvd-color-canvas-text);\n contain: inline-size;\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n grid-row: 1;\n}\n.char-count + .label {\n grid-column: 1/3;\n}\n\n.char-count {\n color: var(--_low-ink-color);\n font: var(--vvd-typography-base);\n grid-column: 3/4;\n}\n\n.fieldset {\n position: relative;\n display: flex;\n align-items: center;\n background-color: var(--_appearance-color-fill);\n font: var(--vvd-typography-base);\n grid-column: 1/4;\n padding-block: 0;\n transition: color 0.2s, background-color 0.2s;\n /* Shape */\n}\n.fieldset::after {\n position: absolute;\n display: block;\n block-size: 100%;\n border-radius: inherit;\n box-shadow: inset 0 0 0 1px var(--_appearance-color-outline);\n content: \"\";\n inline-size: 100%;\n pointer-events: none;\n transition: box-shadow 0.2s;\n}\n.fieldset:focus-visible {\n outline: none;\n}\n.base > .fieldset {\n block-size: calc(1px * (40 + 4 * clamp(-1, var(--vvd-size-density, 0), 2)));\n}\n.base:not(.shape-pill) .fieldset {\n border-radius: 6px;\n}\n.base.shape-pill .fieldset {\n border-radius: 24px;\n}\n\n.wrapper {\n block-size: 100%;\n border-radius: inherit;\n inline-size: 100%;\n}\n.wrapper:focus-visible {\n outline: none;\n}\n\n.control {\n width: 100%;\n box-sizing: border-box;\n border: 0 none;\n appearance: none; /* for box-shadow visibility on IOS */\n background-color: transparent;\n block-size: 100%;\n border-radius: inherit;\n color: inherit;\n font: inherit;\n padding-block: 0;\n padding-inline-end: var(--_text-field-gutter);\n padding-inline-start: var(--_text-field-gutter);\n}\n.control:disabled {\n cursor: not-allowed;\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_appearance-color-text); /* 1. sets text fill to current `color` for safari */\n}\n.control::placeholder, .control:disabled::placeholder {\n opacity: 1; /* 2. correct opacity on iOS */\n -webkit-text-fill-color: var(--_low-ink-color); /* 1. sets text fill to current `color` for safari */\n}\n.control:focus-visible {\n outline: none;\n}\n.has-icon .control {\n padding-inline-start: calc(var(--_text-field-icon-size) + var(--_text-field-gutter) * 2);\n}\n\n.icon {\n position: absolute;\n z-index: 1;\n color: var(--_low-ink-color);\n font-size: var(--_text-field-icon-size);\n inset-block-start: 50%;\n inset-inline-start: calc(100% + var(--_text-field-gutter));\n line-height: 1;\n transform: translateY(-50%);\n}\n\n.leading-items-wrapper {\n position: relative;\n}\n.base.no-leading .leading-items-wrapper {\n display: none;\n}\n\n.action-items-wrapper {\n margin-inline-end: 4px;\n}\n.base:not(.action-items) .action-items-wrapper {\n display: none;\n}\n\n.focus-indicator {\n --focus-stroke-gap-color: transparent;\n pointer-events: none;\n}\n.wrapper:not(:focus-visible, :focus-within) > .focus-indicator, .fieldset:not(:focus-visible, :focus-within) > .focus-indicator {\n display: none;\n}";
|
|
2
2
|
|
|
3
3
|
export { styles as s };
|
package/split-button/index.js
CHANGED