@fluid-topics/ft-text-area 0.3.11 → 0.3.13
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/build/ft-text-area.css.d.ts +14 -0
- package/build/ft-text-area.css.js +121 -0
- package/build/ft-text-area.d.ts +1 -20
- package/build/ft-text-area.js +7 -119
- package/build/ft-text-area.light.js +445 -445
- package/build/ft-text-area.min.js +448 -448
- package/build/ft-text-area.properties.d.ts +9 -0
- package/build/ft-text-area.properties.js +2 -0
- package/build/index.d.ts +2 -0
- package/build/index.js +2 -0
- package/package.json +5 -5
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const FtTextAreaCssVariables: {
|
|
2
|
+
fontSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
3
|
+
labelSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
4
|
+
verticalSpacing: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
5
|
+
horizontalSpacing: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
6
|
+
helperColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
7
|
+
colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
8
|
+
colorOnSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
9
|
+
colorOnSurfaceDisabled: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
10
|
+
borderRadiusS: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
11
|
+
colorError: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
12
|
+
};
|
|
13
|
+
export declare const styles: import("lit").CSSResult;
|
|
14
|
+
//# sourceMappingURL=ft-text-area.css.d.ts.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { designSystemVariables, FtCssVariableFactory, setVariable } from "@fluid-topics/ft-wc-utils";
|
|
3
|
+
import { FtTypographyBody1CssVariables } from "@fluid-topics/ft-typography/build/ft-typography.css";
|
|
4
|
+
import { FtInputLabelCssVariables } from "@fluid-topics/ft-input-label/build/ft-input-label.css";
|
|
5
|
+
import { FtRippleCssVariables } from "@fluid-topics/ft-ripple/build/ft-ripple.css";
|
|
6
|
+
export const FtTextAreaCssVariables = {
|
|
7
|
+
fontSize: FtCssVariableFactory.create("--ft-text-area-font-size", "SIZE", "14px"),
|
|
8
|
+
labelSize: FtCssVariableFactory.create("--ft-text-area-label-size", "SIZE", "11px"),
|
|
9
|
+
verticalSpacing: FtCssVariableFactory.create("--ft-text-area-vertical-spacing", "SIZE", "4px"),
|
|
10
|
+
horizontalSpacing: FtCssVariableFactory.create("--ft-text-area-horizontal-spacing", "SIZE", "16px"),
|
|
11
|
+
helperColor: FtCssVariableFactory.extend("--ft-text-area-helper-color", designSystemVariables.colorOnSurfaceMedium),
|
|
12
|
+
colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
|
|
13
|
+
colorOnSurface: FtCssVariableFactory.external(designSystemVariables.colorOnSurface, "Design system"),
|
|
14
|
+
colorOnSurfaceDisabled: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
|
|
15
|
+
borderRadiusS: FtCssVariableFactory.external(designSystemVariables.borderRadiusS, "Design system"),
|
|
16
|
+
colorError: FtCssVariableFactory.external(designSystemVariables.colorError, "Design system"),
|
|
17
|
+
};
|
|
18
|
+
// language=CSS
|
|
19
|
+
export const styles = css `
|
|
20
|
+
*:focus {
|
|
21
|
+
outline: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ft-text-area {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
align-items: stretch;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
ft-input-label {
|
|
31
|
+
${setVariable(FtInputLabelCssVariables.fontSize, FtTextAreaCssVariables.fontSize)};
|
|
32
|
+
${setVariable(FtInputLabelCssVariables.raisedFontSize, FtTextAreaCssVariables.labelSize)};
|
|
33
|
+
${setVariable(FtInputLabelCssVariables.verticalSpacing, FtTextAreaCssVariables.verticalSpacing)};
|
|
34
|
+
${setVariable(FtInputLabelCssVariables.horizontalSpacing, css `calc(${FtTextAreaCssVariables.horizontalSpacing} - 4px)`)};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ft-text-area--main-panel {
|
|
38
|
+
position: relative;
|
|
39
|
+
display: flex;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ft-text-area--input-panel {
|
|
43
|
+
flex-grow: 1;
|
|
44
|
+
position: relative;
|
|
45
|
+
display: flex;
|
|
46
|
+
align-items: center;
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
gap: 8px;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ft-text-area--input-panel ft-ripple {
|
|
52
|
+
${setVariable(FtRippleCssVariables.opacityContentOnSurfaceHover, "0.08")};
|
|
53
|
+
${setVariable(FtRippleCssVariables.opacityContentOnSurfacePressed, "0.04")};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.ft-text-area--input {
|
|
57
|
+
display: block;
|
|
58
|
+
position: relative;
|
|
59
|
+
flex-grow: 1;
|
|
60
|
+
flex-shrink: 1;
|
|
61
|
+
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
62
|
+
align-self: stretch;
|
|
63
|
+
resize: none;
|
|
64
|
+
|
|
65
|
+
${setVariable(FtTypographyBody1CssVariables.fontSize, FtTextAreaCssVariables.fontSize)};
|
|
66
|
+
${setVariable(FtTypographyBody1CssVariables.lineHeight, FtTextAreaCssVariables.fontSize)};
|
|
67
|
+
color: ${FtTextAreaCssVariables.colorOnSurface};
|
|
68
|
+
|
|
69
|
+
padding: 0 ${FtTextAreaCssVariables.horizontalSpacing};
|
|
70
|
+
margin: calc(${FtTextAreaCssVariables.verticalSpacing} + ${FtTextAreaCssVariables.labelSize} / 2) 0 ${FtTextAreaCssVariables.verticalSpacing} 0;
|
|
71
|
+
|
|
72
|
+
border: none;
|
|
73
|
+
background: none;
|
|
74
|
+
|
|
75
|
+
line-height: 1.4;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.ft-text-area--disabled .ft-text-area--input {
|
|
79
|
+
color: ${FtTextAreaCssVariables.colorOnSurfaceDisabled};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
83
|
+
cursor: pointer;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
87
|
+
${setVariable(FtInputLabelCssVariables.borderColor, FtTextAreaCssVariables.colorPrimary)};
|
|
88
|
+
${setVariable(FtInputLabelCssVariables.textColor, FtTextAreaCssVariables.colorPrimary)};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ft-text-area--filled .ft-text-area--input-panel {
|
|
92
|
+
border-radius: ${FtTextAreaCssVariables.borderRadiusS} ${FtTextAreaCssVariables.borderRadiusS} 0 0;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
96
|
+
align-self: stretch;
|
|
97
|
+
margin-bottom: ${FtTextAreaCssVariables.verticalSpacing};
|
|
98
|
+
margin-top: calc(${FtTextAreaCssVariables.labelSize} + 2 * ${FtTextAreaCssVariables.verticalSpacing});
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
102
|
+
border-radius: ${FtTextAreaCssVariables.borderRadiusS};
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ft-text-area--helper-text {
|
|
106
|
+
padding: 0 12px 0 ${FtTextAreaCssVariables.horizontalSpacing};
|
|
107
|
+
color: ${FtTextAreaCssVariables.helperColor};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.ft-text-area--in-error .ft-text-area--input,
|
|
111
|
+
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
112
|
+
color: ${FtTextAreaCssVariables.colorError};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
ft-resizer {
|
|
116
|
+
position: absolute;
|
|
117
|
+
right: 0;
|
|
118
|
+
bottom: 0;
|
|
119
|
+
}
|
|
120
|
+
`;
|
|
121
|
+
//# sourceMappingURL=ft-text-area.css.js.map
|
package/build/ft-text-area.d.ts
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
import { PropertyValues } from "lit";
|
|
2
2
|
import { ElementDefinitionsMap, FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
3
|
-
|
|
4
|
-
label: string;
|
|
5
|
-
value?: string;
|
|
6
|
-
helper?: string;
|
|
7
|
-
outlined?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
error?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const FtTextAreaCssVariables: {
|
|
12
|
-
fontSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
13
|
-
labelSize: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
14
|
-
verticalSpacing: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
15
|
-
horizontalSpacing: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
16
|
-
helperColor: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
17
|
-
colorPrimary: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
18
|
-
colorOnSurface: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
19
|
-
colorOnSurfaceDisabled: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
20
|
-
borderRadiusS: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
21
|
-
colorError: import("@fluid-topics/ft-wc-utils").FtCssVariable;
|
|
22
|
-
};
|
|
3
|
+
import { FtTextAreaProperties } from "./ft-text-area.properties";
|
|
23
4
|
export declare class FtTextArea extends FtLitElement implements FtTextAreaProperties {
|
|
24
5
|
static elementDefinitions: ElementDefinitionsMap;
|
|
25
6
|
static styles: import("lit").CSSResult[];
|
package/build/ft-text-area.js
CHANGED
|
@@ -4,26 +4,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
-
import {
|
|
7
|
+
import { html } from "lit";
|
|
8
8
|
import { property, query, state } from "lit/decorators.js";
|
|
9
9
|
import { classMap } from "lit/directives/class-map.js";
|
|
10
|
-
import {
|
|
11
|
-
import { FtTypography, FtTypographyBody1
|
|
10
|
+
import { FtLitElement } from "@fluid-topics/ft-wc-utils";
|
|
11
|
+
import { FtTypography, FtTypographyBody1 } from "@fluid-topics/ft-typography";
|
|
12
12
|
import { FtResizer } from "@fluid-topics/ft-resizer";
|
|
13
|
-
import { FtInputLabel
|
|
14
|
-
import { FtRipple
|
|
15
|
-
|
|
16
|
-
fontSize: FtCssVariableFactory.create("--ft-text-area-font-size", "SIZE", "14px"),
|
|
17
|
-
labelSize: FtCssVariableFactory.create("--ft-text-area-label-size", "SIZE", "11px"),
|
|
18
|
-
verticalSpacing: FtCssVariableFactory.create("--ft-text-area-vertical-spacing", "SIZE", "4px"),
|
|
19
|
-
horizontalSpacing: FtCssVariableFactory.create("--ft-text-area-horizontal-spacing", "SIZE", "16px"),
|
|
20
|
-
helperColor: FtCssVariableFactory.extend("--ft-text-area-helper-color", designSystemVariables.colorOnSurfaceMedium),
|
|
21
|
-
colorPrimary: FtCssVariableFactory.external(designSystemVariables.colorPrimary, "Design system"),
|
|
22
|
-
colorOnSurface: FtCssVariableFactory.external(designSystemVariables.colorOnSurface, "Design system"),
|
|
23
|
-
colorOnSurfaceDisabled: FtCssVariableFactory.external(designSystemVariables.colorOnSurfaceDisabled, "Design system"),
|
|
24
|
-
borderRadiusS: FtCssVariableFactory.external(designSystemVariables.borderRadiusS, "Design system"),
|
|
25
|
-
colorError: FtCssVariableFactory.external(designSystemVariables.colorError, "Design system"),
|
|
26
|
-
};
|
|
13
|
+
import { FtInputLabel } from "@fluid-topics/ft-input-label";
|
|
14
|
+
import { FtRipple } from "@fluid-topics/ft-ripple";
|
|
15
|
+
import { FtTextAreaCssVariables, styles } from "./ft-text-area.css";
|
|
27
16
|
export class FtTextArea extends FtLitElement {
|
|
28
17
|
constructor() {
|
|
29
18
|
super(...arguments);
|
|
@@ -119,108 +108,7 @@ FtTextArea.elementDefinitions = {
|
|
|
119
108
|
// language=CSS
|
|
120
109
|
FtTextArea.styles = [
|
|
121
110
|
FtTypographyBody1,
|
|
122
|
-
|
|
123
|
-
*:focus {
|
|
124
|
-
outline: none;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
.ft-text-area {
|
|
128
|
-
display: flex;
|
|
129
|
-
flex-direction: column;
|
|
130
|
-
align-items: stretch;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
ft-input-label {
|
|
134
|
-
${setVariable(FtInputLabelCssVariables.fontSize, FtTextAreaCssVariables.fontSize)};
|
|
135
|
-
${setVariable(FtInputLabelCssVariables.raisedFontSize, FtTextAreaCssVariables.labelSize)};
|
|
136
|
-
${setVariable(FtInputLabelCssVariables.verticalSpacing, FtTextAreaCssVariables.verticalSpacing)};
|
|
137
|
-
${setVariable(FtInputLabelCssVariables.horizontalSpacing, css `calc(${FtTextAreaCssVariables.horizontalSpacing} - 4px)`)};
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.ft-text-area--main-panel {
|
|
141
|
-
position: relative;
|
|
142
|
-
display: flex;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.ft-text-area--input-panel {
|
|
146
|
-
flex-grow: 1;
|
|
147
|
-
position: relative;
|
|
148
|
-
display: flex;
|
|
149
|
-
align-items: center;
|
|
150
|
-
overflow: hidden;
|
|
151
|
-
gap: 8px;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.ft-text-area--input-panel ft-ripple {
|
|
155
|
-
${setVariable(FtRippleCssVariables.opacityContentOnSurfaceHover, "0.08")};
|
|
156
|
-
${setVariable(FtRippleCssVariables.opacityContentOnSurfacePressed, "0.04")};
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
.ft-text-area--input {
|
|
160
|
-
display: block;
|
|
161
|
-
position: relative;
|
|
162
|
-
flex-grow: 1;
|
|
163
|
-
flex-shrink: 1;
|
|
164
|
-
min-width: 0; /* flex sets this to auto an prevents input from shrinking properly */
|
|
165
|
-
align-self: stretch;
|
|
166
|
-
resize: none;
|
|
167
|
-
|
|
168
|
-
${setVariable(FtTypographyBody1CssVariables.fontSize, FtTextAreaCssVariables.fontSize)};
|
|
169
|
-
${setVariable(FtTypographyBody1CssVariables.lineHeight, FtTextAreaCssVariables.fontSize)};
|
|
170
|
-
color: ${FtTextAreaCssVariables.colorOnSurface};
|
|
171
|
-
|
|
172
|
-
padding: 0 ${FtTextAreaCssVariables.horizontalSpacing};
|
|
173
|
-
margin: calc(${FtTextAreaCssVariables.verticalSpacing} + ${FtTextAreaCssVariables.labelSize} / 2) 0 ${FtTextAreaCssVariables.verticalSpacing} 0;
|
|
174
|
-
|
|
175
|
-
border: none;
|
|
176
|
-
background: none;
|
|
177
|
-
|
|
178
|
-
line-height: 1.4;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
.ft-text-area--disabled .ft-text-area--input {
|
|
182
|
-
color: ${FtTextAreaCssVariables.colorOnSurfaceDisabled};
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
.ft-text-area:not(.ft-text-area--disabled) .ft-text-area--input-panel {
|
|
186
|
-
cursor: pointer;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
.ft-text-area:not(.ft-text-area--disabled):focus-within ft-input-label {
|
|
190
|
-
${setVariable(FtInputLabelCssVariables.borderColor, FtTextAreaCssVariables.colorPrimary)};
|
|
191
|
-
${setVariable(FtInputLabelCssVariables.textColor, FtTextAreaCssVariables.colorPrimary)};
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
.ft-text-area--filled .ft-text-area--input-panel {
|
|
195
|
-
border-radius: ${FtTextAreaCssVariables.borderRadiusS} ${FtTextAreaCssVariables.borderRadiusS} 0 0;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
.ft-text-area--filled:not(.ft-text-area--no-label) .ft-text-area--input {
|
|
199
|
-
align-self: stretch;
|
|
200
|
-
margin-bottom: ${FtTextAreaCssVariables.verticalSpacing};
|
|
201
|
-
margin-top: calc(${FtTextAreaCssVariables.labelSize} + 2 * ${FtTextAreaCssVariables.verticalSpacing});
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
.ft-text-area--outlined .ft-text-area--input-panel {
|
|
205
|
-
border-radius: ${FtTextAreaCssVariables.borderRadiusS};
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.ft-text-area--helper-text {
|
|
209
|
-
padding: 0 12px 0 ${FtTextAreaCssVariables.horizontalSpacing};
|
|
210
|
-
color: ${FtTextAreaCssVariables.helperColor};
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
.ft-text-area--in-error .ft-text-area--input,
|
|
214
|
-
.ft-text-area--in-error .ft-text-area--helper-text {
|
|
215
|
-
color: ${FtTextAreaCssVariables.colorError};
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
ft-resizer {
|
|
219
|
-
position: absolute;
|
|
220
|
-
right: 0;
|
|
221
|
-
bottom: 0;
|
|
222
|
-
}
|
|
223
|
-
`
|
|
111
|
+
styles
|
|
224
112
|
];
|
|
225
113
|
__decorate([
|
|
226
114
|
property({ type: String })
|