@fluid-topics/ftds-input-label 2.1.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/README.md +19 -0
- package/build/define.d.ts +1 -0
- package/build/define.js +3 -0
- package/build/definitions.d.ts +5 -0
- package/build/definitions.js +4 -0
- package/build/ftds-input-label.d.ts +13 -0
- package/build/ftds-input-label.js +50 -0
- package/build/ftds-input-label.light.js +221 -0
- package/build/ftds-input-label.min.js +355 -0
- package/build/ftds-input-label.properties.d.ts +4 -0
- package/build/ftds-input-label.properties.js +1 -0
- package/build/ftds-input-label.styles.d.ts +17 -0
- package/build/ftds-input-label.styles.js +106 -0
- package/build/index.d.ts +4 -0
- package/build/index.js +4 -0
- package/package.json +30 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const FtdsInputLabelCssVariables: {
|
|
2
|
+
fontSize: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
3
|
+
fontSizeRaised: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
4
|
+
lineHeight: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
5
|
+
color: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
6
|
+
largeFieldHeight: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
7
|
+
largeFieldVerticalGap: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
8
|
+
largeFieldHorizontalPadding: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
9
|
+
mediumFieldHeight: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
10
|
+
mediumFieldVerticalGap: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
11
|
+
mediumFieldHorizontalPadding: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
12
|
+
additionalPaddingLeft: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
13
|
+
additionalPaddingRight: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
14
|
+
verticalSpacing: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
15
|
+
horizontalSpacing: import("@fluid-topics/design-system-variables").FtCssVariable;
|
|
16
|
+
};
|
|
17
|
+
export declare const styles: any;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { css } from "lit";
|
|
2
|
+
import { foundation, typographyBody2Medium, typographyCaption2Medium, } from "@fluid-topics/design-system-variables";
|
|
3
|
+
import { FtTypographyCaptionCssVariables } from "@fluid-topics/ft-typography/build/ft-typography.styles";
|
|
4
|
+
import { FtCssVariableFactory, semantic, setVariable, } from "@fluid-topics/ft-wc-utils";
|
|
5
|
+
export const FtdsInputLabelCssVariables = {
|
|
6
|
+
fontSize: FtCssVariableFactory.extend("--ftds-input-label-font-size", "", typographyBody2Medium.fontSize),
|
|
7
|
+
fontSizeRaised: FtCssVariableFactory.extend("--ftds-input-label-font-size-raised", "", typographyCaption2Medium.fontSize),
|
|
8
|
+
lineHeight: FtCssVariableFactory.extend("--ftds-input-label-line-height", "", typographyCaption2Medium.lineHeight),
|
|
9
|
+
color: FtCssVariableFactory.extend("--ftds-input-label-color", "", semantic.contentGlobalSubtle),
|
|
10
|
+
largeFieldHeight: FtCssVariableFactory.create("--ftds-input-label-large-height", "", "SIZE", "50px"),
|
|
11
|
+
largeFieldVerticalGap: FtCssVariableFactory.extend("--ftds-input-label-large-field-vertical-gap", "", foundation.spacing05),
|
|
12
|
+
largeFieldHorizontalPadding: FtCssVariableFactory.extend("--ftds-input-label-large-field-horizontal-padding", "", foundation.spacing4),
|
|
13
|
+
mediumFieldHeight: FtCssVariableFactory.create("--ftds-input-label-medium-height", "", "SIZE", "40px"),
|
|
14
|
+
mediumFieldVerticalGap: FtCssVariableFactory.create("--ftds-input-label-medium-field-vertical-gap", "", "SIZE", "0px"),
|
|
15
|
+
mediumFieldHorizontalPadding: FtCssVariableFactory.extend("--ftds-input-label-medium-field-horizontal-padding", "", foundation.spacing4),
|
|
16
|
+
additionalPaddingLeft: FtCssVariableFactory.create("--ftds-input-label-additional-padding-left", "", "SIZE", "0px"),
|
|
17
|
+
additionalPaddingRight: FtCssVariableFactory.create("--ftds-input-label-additional-padding-right", "", "SIZE", "0px"),
|
|
18
|
+
verticalSpacing: FtCssVariableFactory.create("--ftds-input-label-vertical-spacing", "", "SIZE", "4px"),
|
|
19
|
+
horizontalSpacing: FtCssVariableFactory.create("--ftds-input-label-horizontal-spacing", "", "SIZE", "12px"),
|
|
20
|
+
};
|
|
21
|
+
// language=css
|
|
22
|
+
export const styles = [
|
|
23
|
+
css `
|
|
24
|
+
|
|
25
|
+
:root {
|
|
26
|
+
--field-height: ${FtdsInputLabelCssVariables.largeFieldHeight};
|
|
27
|
+
--field-vertical-gap: ${FtdsInputLabelCssVariables.largeFieldVerticalGap};
|
|
28
|
+
--field-horizontal-padding: ${FtdsInputLabelCssVariables.largeFieldHorizontalPadding};
|
|
29
|
+
|
|
30
|
+
--typo-caption-height: calc(${typographyCaption2Medium.lineHeight} * ${typographyCaption2Medium.fontSize});
|
|
31
|
+
--typo-body-height: calc(${typographyBody2Medium.lineHeight} * ${typographyBody2Medium.fontSize});
|
|
32
|
+
--caption-label-and-value-combined-height: calc(var(--field-vertical-gap) + var(--typo-caption-height) + var(--typo-body-height));
|
|
33
|
+
--input-content-vertical-padding: calc((var(--field-height) - var(--caption-label-and-value-combined-height)) / 2);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.ftds-input-label {
|
|
37
|
+
position: absolute;
|
|
38
|
+
inset: 0;
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
align-items: center;
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ftds-input-label.ftds--size-large {
|
|
46
|
+
--field-height: ${FtdsInputLabelCssVariables.largeFieldHeight};
|
|
47
|
+
--field-vertical-gap: ${FtdsInputLabelCssVariables.largeFieldVerticalGap};
|
|
48
|
+
--field-horizontal-padding: ${FtdsInputLabelCssVariables.largeFieldHorizontalPadding};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.ftds-input-label.ftds--size-medium {
|
|
52
|
+
--field-height: ${FtdsInputLabelCssVariables.mediumFieldHeight};
|
|
53
|
+
--field-vertical-gap: ${FtdsInputLabelCssVariables.mediumFieldVerticalGap};
|
|
54
|
+
--field-horizontal-padding: ${FtdsInputLabelCssVariables.mediumFieldHorizontalPadding};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.ftds-input-label--text {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-shrink: 1;
|
|
60
|
+
position: relative;
|
|
61
|
+
text-overflow: ellipsis;
|
|
62
|
+
z-index: 10;
|
|
63
|
+
width: 100%;
|
|
64
|
+
transition: font-size 250ms, line-height 250ms, color 250ms;
|
|
65
|
+
${setVariable(FtTypographyCaptionCssVariables.fontSize, FtdsInputLabelCssVariables.fontSize)};
|
|
66
|
+
${setVariable(FtTypographyCaptionCssVariables.lineHeight, FtdsInputLabelCssVariables.lineHeight)};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ftds-input-label--hidden-text {
|
|
70
|
+
padding: 0 4px;
|
|
71
|
+
opacity: 0;
|
|
72
|
+
max-width: 100%;
|
|
73
|
+
box-sizing: border-box;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.ftds-input-label--floating-text {
|
|
77
|
+
position: absolute;
|
|
78
|
+
box-sizing: border-box;
|
|
79
|
+
transition: top 250ms;
|
|
80
|
+
width: 100%;
|
|
81
|
+
|
|
82
|
+
top: calc((var(--field-height) - var(--typo-body-height)) / 2);
|
|
83
|
+
overflow: hidden;
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
text-overflow: ellipsis;
|
|
86
|
+
|
|
87
|
+
padding-top: ${FtdsInputLabelCssVariables.verticalSpacing};
|
|
88
|
+
padding-bottom: ${FtdsInputLabelCssVariables.verticalSpacing};
|
|
89
|
+
padding-left: calc(var(--field-horizontal-padding) + ${FtdsInputLabelCssVariables.additionalPaddingLeft});
|
|
90
|
+
padding-right: calc(var(--field-horizontal-padding) + ${FtdsInputLabelCssVariables.additionalPaddingRight});
|
|
91
|
+
|
|
92
|
+
margin: calc(${FtdsInputLabelCssVariables.verticalSpacing} * -1) 0;
|
|
93
|
+
color: ${FtdsInputLabelCssVariables.color};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.ftds-input-label--raised .ftds-input-label--text {
|
|
97
|
+
${setVariable(FtTypographyCaptionCssVariables.fontSize, FtdsInputLabelCssVariables.fontSizeRaised)};
|
|
98
|
+
${setVariable(FtTypographyCaptionCssVariables.lineHeight, FtdsInputLabelCssVariables.lineHeight)};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ftds-input-label--raised .ftds-input-label--floating-text {
|
|
102
|
+
top: var(--input-content-vertical-padding);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
`,
|
|
106
|
+
];
|
package/build/index.d.ts
ADDED
package/build/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fluid-topics/ftds-input-label",
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "The design system input label component",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"Lit"
|
|
7
|
+
],
|
|
8
|
+
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"main": "build/index.js",
|
|
11
|
+
"web": "build/ftds-input-label.min.js",
|
|
12
|
+
"typings": "build/index",
|
|
13
|
+
"files": [
|
|
14
|
+
"build/**/*.js",
|
|
15
|
+
"build/**/*.ts"
|
|
16
|
+
],
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@fluid-topics/ft-typography": "2.1.0",
|
|
23
|
+
"@fluid-topics/ft-wc-utils": "2.1.0",
|
|
24
|
+
"lit": "3.1.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@fluid-topics/ft-wc-test-utils": "2.1.0"
|
|
28
|
+
},
|
|
29
|
+
"gitHead": "4727cf19d04236ad1d2b2cb43ce1c46298834c7e"
|
|
30
|
+
}
|