Skip to content

Commit 88dafa7

Browse files
anveshmekalabenelan
authored andcommitted
feat(input-number): add component tokens (#11961)
**Related Issue:** #7180 ## Summary Adds the following tokens in input-number component `--calcite-input-actions-background-color`: Specifies the background color of the component's `clearable` and `number-button-type` elements. `--calcite-input-actions-background-color-hover`: Specifies the background color of the component's `clearable` and `number-button-type` elements when hovered. `--calcite-input-actions-background-color-press`: Specifies the background color of the component's `clearable` and `number-button-type` elements when pressed. `--calcite-input-actions-icon-color`: Specifies the icon color of the component's `clearable` and `number-button-type` elements. `--calcite-input-actions-icon-color-hover`: Specifies the icon color of the component's `clearable` and `number-button-type` elements when hovered. `--calcite-input-actions-icon-color-press`: Specifies the icon color of the component's `clearable` and `number-button-type` elements when pressed. `--calcite-input-loading-background-color`: Specifies the background color of the `loading` element. `--calcite-input-loading-fill-color`: Specifies the fill color of the `loading` element `--calcite-input-number-background-color`: Specifies the background color of the component. `--calcite-input-number-border-color`: Specifies the border color of the component. `--calcite-input-number-corner-radius`: Specifies the border radius of the component. `--calcite-input-number-height`: Specifies the height of the component. `--calcite-input-number-placeholder-text-color`: Specifies the text color of the placeholder in the component. `--calcite-input-number-text-color`: Specifies the text color of the component. `--calcite-input-number-text-color-focus`: Specifies the text color of the component when focused. `--calcite-input-prefix-background-color`: Specifies the background color of the prefix element. `--calcite-input-prefix-size`: Specifies the width of the prefix element. `--calcite-input-prefix-text-color`: Specifies the text color of the prefix element. `--calcite-input-suffix-background-color`: Specifies the background color of the suffix element. `--calcite-input-suffix-size`: Specifies the width of the suffix element. `--calcite-input-suffix-text-color`: Specifies the text color of the suffix element.
1 parent 39e43d6 commit 88dafa7

File tree

7 files changed

+441
-96
lines changed

7 files changed

+441
-96
lines changed

packages/calcite-components/src/components/input-number/input-number.e2e.ts

Lines changed: 170 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1959,24 +1959,177 @@ describe("calcite-input-number", () => {
19591959
});
19601960

19611961
describe("theme", () => {
1962-
themed(
1963-
html`
1964-
<calcite-input-number
1965-
placeholder="Placeholder text"
1966-
prefix-text="prefix"
1967-
suffix-text="suffix"
1968-
></calcite-input-number>
1969-
`,
1970-
{
1971-
"--calcite-input-prefix-size": {
1972-
shadowSelector: `.${CSS.prefix}`,
1973-
targetProp: "inlineSize",
1962+
describe("default", () => {
1963+
themed(
1964+
html`
1965+
<calcite-input-number
1966+
placeholder="Placeholder text"
1967+
prefix-text="prefix"
1968+
suffix-text="suffix"
1969+
value="2"
1970+
clearable
1971+
loading
1972+
></calcite-input-number>
1973+
`,
1974+
{
1975+
"--calcite-input-actions-background-color": [
1976+
{
1977+
shadowSelector: `.${CSS.numberButtonItem}`,
1978+
targetProp: "backgroundColor",
1979+
},
1980+
{
1981+
shadowSelector: `.${CSS.clearButton}`,
1982+
targetProp: "backgroundColor",
1983+
},
1984+
],
1985+
"--calcite-input-actions-background-color-hover": [
1986+
{
1987+
shadowSelector: `.${CSS.numberButtonItem}`,
1988+
targetProp: "backgroundColor",
1989+
state: "hover",
1990+
},
1991+
{
1992+
shadowSelector: `.${CSS.clearButton}`,
1993+
targetProp: "backgroundColor",
1994+
state: "hover",
1995+
},
1996+
],
1997+
"--calcite-input-actions-background-color-press": [
1998+
{
1999+
shadowSelector: `.${CSS.numberButtonItem}`,
2000+
targetProp: "backgroundColor",
2001+
state: { press: `calcite-input-number >>> .${CSS.numberButtonItem}` },
2002+
},
2003+
{
2004+
shadowSelector: `.${CSS.clearButton}`,
2005+
targetProp: "backgroundColor",
2006+
state: { press: `calcite-input-number >>> .${CSS.clearButton}` },
2007+
},
2008+
],
2009+
"--calcite-input-actions-icon-color": {
2010+
shadowSelector: `calcite-icon`,
2011+
targetProp: "color",
2012+
},
2013+
"--calcite-input-actions-icon-color-hover": {
2014+
shadowSelector: `calcite-icon`,
2015+
targetProp: "color",
2016+
state: "hover",
2017+
},
2018+
"--calcite-input-loading-background-color": {
2019+
shadowSelector: `calcite-progress`,
2020+
targetProp: "--calcite-progress-background-color",
2021+
},
2022+
"--calcite-input-loading-fill-color": {
2023+
shadowSelector: `calcite-progress`,
2024+
targetProp: "--calcite-progress-fill-color",
2025+
},
2026+
"--calcite-input-number-background-color": {
2027+
shadowSelector: `input`,
2028+
targetProp: "backgroundColor",
2029+
},
2030+
"--calcite-input-number-border-color": [
2031+
{
2032+
shadowSelector: `input`,
2033+
targetProp: "borderColor",
2034+
},
2035+
{
2036+
shadowSelector: `.${CSS.prefix}`,
2037+
targetProp: "borderColor",
2038+
},
2039+
{
2040+
shadowSelector: `.${CSS.suffix}`,
2041+
targetProp: "borderColor",
2042+
},
2043+
{
2044+
shadowSelector: `.${CSS.numberButtonItem}`,
2045+
targetProp: "borderColor",
2046+
},
2047+
],
2048+
"--calcite-input-number-corner-radius": [
2049+
{
2050+
shadowSelector: `.${CSS.prefix}`,
2051+
targetProp: "borderStartStartRadius",
2052+
},
2053+
{
2054+
shadowSelector: `.${CSS.prefix}`,
2055+
targetProp: "borderEndStartRadius",
2056+
},
2057+
{
2058+
shadowSelector: `[data-adjustment="up"]`,
2059+
targetProp: "borderStartEndRadius",
2060+
},
2061+
{
2062+
shadowSelector: `[data-adjustment="down"]`,
2063+
targetProp: "borderEndEndRadius",
2064+
},
2065+
],
2066+
"--calcite-input-number-height": [
2067+
{
2068+
shadowSelector: `input`,
2069+
targetProp: "blockSize",
2070+
},
2071+
{
2072+
shadowSelector: `.${CSS.prefix}`,
2073+
targetProp: "blockSize",
2074+
},
2075+
{
2076+
shadowSelector: `.${CSS.suffix}`,
2077+
targetProp: "blockSize",
2078+
},
2079+
{
2080+
shadowSelector: `.${CSS.numberButtonWrapper}`,
2081+
targetProp: "blockSize",
2082+
},
2083+
],
2084+
"--calcite-input-number-text-color": {
2085+
shadowSelector: `input`,
2086+
targetProp: "color",
2087+
},
2088+
"--calcite-input-number-text-color-focus": {
2089+
shadowSelector: `input`,
2090+
targetProp: "color",
2091+
state: "focus",
2092+
},
2093+
"--calcite-input-prefix-background-color": {
2094+
shadowSelector: `.${CSS.prefix}`,
2095+
targetProp: "backgroundColor",
2096+
},
2097+
"--calcite-input-prefix-size": {
2098+
shadowSelector: `.${CSS.prefix}`,
2099+
targetProp: "inlineSize",
2100+
},
2101+
"--calcite-input-prefix-text-color": {
2102+
shadowSelector: `.${CSS.prefix}`,
2103+
targetProp: "color",
2104+
},
2105+
"--calcite-input-suffix-background-color": {
2106+
shadowSelector: `.${CSS.suffix}`,
2107+
targetProp: "backgroundColor",
2108+
},
2109+
"--calcite-input-suffix-text-color": {
2110+
shadowSelector: `.${CSS.suffix}`,
2111+
targetProp: "color",
2112+
},
2113+
"--calcite-input-suffix-size": {
2114+
shadowSelector: `.${CSS.suffix}`,
2115+
targetProp: "inlineSize",
2116+
},
19742117
},
1975-
"--calcite-input-suffix-size": {
1976-
shadowSelector: `.${CSS.suffix}`,
1977-
targetProp: "inlineSize",
2118+
);
2119+
});
2120+
2121+
describe("readOnly", () => {
2122+
themed(html` <calcite-input-number read-only></calcite-input-number> `, {
2123+
"--calcite-input-number-background-color": {
2124+
shadowSelector: `input`,
2125+
targetProp: "backgroundColor",
19782126
},
1979-
},
1980-
);
2127+
"--calcite-input-number-text-color-focus": {
2128+
shadowSelector: `input`,
2129+
targetProp: "color",
2130+
state: "focus",
2131+
},
2132+
});
2133+
});
19812134
});
19822135
});

0 commit comments

Comments
 (0)