Skip to content

Commit c7c1499

Browse files
committed
refactor(NumberInput): vanilla extract (#5627)
* refactor: number input vanilla extract * fix: feedback
1 parent f8ee5e6 commit c7c1499

File tree

8 files changed

+7325
-19176
lines changed

8 files changed

+7325
-19176
lines changed

packages/form/src/components/NumberInputField/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 14 additions & 404 deletions
Large diffs are not rendered by default.

packages/form/src/components/SliderField/__tests__/__snapshots__/index.test.tsx.snap

Lines changed: 23 additions & 193 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,173 +1591,6 @@ exports[`sliderField > should trigger events correctly 1`] = `
15911591
}
15921592
15931593
.emotion-4 {
1594-
display: -webkit-box;
1595-
display: -webkit-flex;
1596-
display: -ms-flexbox;
1597-
display: flex;
1598-
-webkit-align-items: center;
1599-
-webkit-box-align: center;
1600-
-ms-flex-align: center;
1601-
align-items: center;
1602-
-webkit-box-pack: justify;
1603-
-webkit-justify-content: space-between;
1604-
justify-content: space-between;
1605-
-webkit-flex-direction: row;
1606-
-ms-flex-direction: row;
1607-
flex-direction: row;
1608-
border: 1px solid #d9dadd;
1609-
border-radius: 0.25rem;
1610-
}
1611-
1612-
.emotion-4:focus-within {
1613-
border-color: #792dd4;
1614-
box-shadow: 0px 0px 0px 3px #8c40ef40;
1615-
}
1616-
1617-
.emotion-4[data-success='true'] {
1618-
border-color: #22674e;
1619-
}
1620-
1621-
.emotion-4[data-error='true'] {
1622-
border-color: #b3144d;
1623-
}
1624-
1625-
.emotion-4:hover {
1626-
border-color: #792dd4;
1627-
}
1628-
1629-
.emotion-4[data-readonly='true'] {
1630-
border-color: #d9dadd;
1631-
background: #f9f9fa;
1632-
cursor: not-allowed;
1633-
}
1634-
1635-
.emotion-4[data-disabled='true'] {
1636-
border-color: #e9eaeb;
1637-
background: #f3f3f4;
1638-
cursor: not-allowed;
1639-
}
1640-
1641-
.emotion-4[data-controls='false']>.emotion-7 {
1642-
border-width: 0;
1643-
}
1644-
1645-
.emotion-4[data-size='small'] {
1646-
height: 2rem;
1647-
}
1648-
1649-
.emotion-4[data-size='medium'] {
1650-
height: 2.5rem;
1651-
}
1652-
1653-
.emotion-4[data-size='large'] {
1654-
height: 3rem;
1655-
}
1656-
1657-
.emotion-6 {
1658-
border-width: 0 1px 0 1px;
1659-
border-style: solid;
1660-
border-color: inherit;
1661-
background: inherit;
1662-
width: 100%;
1663-
}
1664-
1665-
.emotion-8 {
1666-
outline: none;
1667-
border: none;
1668-
padding: 0;
1669-
width: 100%;
1670-
color: #3f4250;
1671-
font-size: 0.875rem;
1672-
font-family: Inter,sans-serif;
1673-
font-weight: Regular;
1674-
line-height: 1.25rem;
1675-
text-align: center;
1676-
padding: 0.5rem;
1677-
background: none;
1678-
}
1679-
1680-
.emotion-8[data-has-unit='true'] {
1681-
text-align: left;
1682-
padding: 0.5rem 0 0.5rem 0.5rem;
1683-
}
1684-
1685-
.emotion-8::-webkit-outer-spin-button,
1686-
.emotion-8::-webkit-inner-spin-button {
1687-
-webkit-appearance: none;
1688-
margin: 0;
1689-
}
1690-
1691-
.emotion-8 {
1692-
-moz-appearance: textfield;
1693-
-webkit-appearance: textfield;
1694-
-moz-appearance: textfield;
1695-
-ms-appearance: textfield;
1696-
appearance: textfield;
1697-
}
1698-
1699-
.emotion-8[data-size='small'] {
1700-
height: 2rem;
1701-
}
1702-
1703-
.emotion-8[data-size='medium'] {
1704-
height: 2.5rem;
1705-
}
1706-
1707-
.emotion-8[data-size='large'] {
1708-
height: 3rem;
1709-
font-size: 1rem;
1710-
font-family: Inter,sans-serif;
1711-
font-weight: Regular;
1712-
line-height: 1.5rem;
1713-
}
1714-
1715-
.emotion-8:-moz-read-only {
1716-
color: #3f4250;
1717-
background: #f9f9fa;
1718-
border-block: 1px solid #d9dadd;
1719-
}
1720-
1721-
.emotion-8:read-only {
1722-
color: #3f4250;
1723-
background: #f9f9fa;
1724-
border-block: 1px solid #d9dadd;
1725-
}
1726-
1727-
.emotion-8:-moz-read-only~.exvap482 {
1728-
background: #f9f9fa;
1729-
}
1730-
1731-
.emotion-8:read-only~.exvap482 {
1732-
background: #f9f9fa;
1733-
}
1734-
1735-
.emotion-8:disabled {
1736-
color: #b5b7bd;
1737-
background: #f3f3f4;
1738-
cursor: not-allowed;
1739-
border-block: 1px solid #e9eaeb;
1740-
}
1741-
1742-
.emotion-8:disabled~.exvap482 {
1743-
background: #f3f3f4;
1744-
cursor: not-allowed;
1745-
-webkit-user-select: none;
1746-
-moz-user-select: none;
1747-
-ms-user-select: none;
1748-
user-select: none;
1749-
}
1750-
1751-
.emotion-8:placeholder-shown~.exvap482 {
1752-
color: #727683;
1753-
font-size: 1rem;
1754-
}
1755-
1756-
.emotion-8[data-controls='false'] {
1757-
text-align: left;
1758-
}
1759-
1760-
.emotion-10 {
17611594
-webkit-appearance: none;
17621595
-moz-appearance: none;
17631596
-ms-appearance: none;
@@ -1775,31 +1608,31 @@ exports[`sliderField > should trigger events correctly 1`] = `
17751608
outline: none;
17761609
}
17771610
1778-
.emotion-10:focus::-moz-range-thumb {
1611+
.emotion-4:focus::-moz-range-thumb {
17791612
border: 1.5px solid #8c40ef;
17801613
box-shadow: 0px 0px 0px 3px #8c40ef40;
17811614
}
17821615
1783-
.emotion-10:focus::-webkit-slider-thumb {
1616+
.emotion-4:focus::-webkit-slider-thumb {
17841617
border: 1.5px solid #8c40ef;
17851618
box-shadow: 0px 0px 0px 3px #8c40ef40;
17861619
}
17871620
1788-
.emotion-10[data-error='true'] {
1621+
.emotion-4[data-error='true'] {
17891622
background-image: linear-gradient(#e51963, #e51963);
17901623
}
17911624
1792-
.emotion-10[data-direction='column'] {
1625+
.emotion-4[data-direction='column'] {
17931626
-webkit-align-self: baseline;
17941627
-ms-flex-item-align: baseline;
17951628
align-self: baseline;
17961629
}
17971630
1798-
.emotion-10[aria-disabled='true'] {
1631+
.emotion-4[aria-disabled='true'] {
17991632
background-image: linear-gradient(#d8c5fc, #d8c5fc);
18001633
}
18011634
1802-
.emotion-10::-moz-range-track {
1635+
.emotion-4::-moz-range-track {
18031636
-webkit-appearance: none;
18041637
-moz-appearance: none;
18051638
-ms-appearance: none;
@@ -1810,7 +1643,7 @@ exports[`sliderField > should trigger events correctly 1`] = `
18101643
background: transparent;
18111644
}
18121645
1813-
.emotion-10::-moz-range-thumb {
1646+
.emotion-4::-moz-range-thumb {
18141647
-webkit-appearance: none;
18151648
-webkit-appearance: none;
18161649
-moz-appearance: none;
@@ -1832,20 +1665,20 @@ exports[`sliderField > should trigger events correctly 1`] = `
18321665
top: -4px;
18331666
}
18341667
1835-
.emotion-10::-moz-range-thumb:hover,
1836-
.emotion-10::-moz-range-thumb:active,
1837-
.emotion-10::-moz-range-thumb:focus {
1668+
.emotion-4::-moz-range-thumb:hover,
1669+
.emotion-4::-moz-range-thumb:active,
1670+
.emotion-4::-moz-range-thumb:focus {
18381671
border: 1.5px solid #8c40ef;
18391672
}
18401673
1841-
.emotion-10::-moz-range-thumb:active,
1842-
.emotion-10::-moz-range-thumb:focus {
1674+
.emotion-4::-moz-range-thumb:active,
1675+
.emotion-4::-moz-range-thumb:focus {
18431676
box-shadow: 0px 0px 0px 3px #8c40ef40;
18441677
cursor: -webkit-grabbing;
18451678
cursor: grabbing;
18461679
}
18471680
1848-
.emotion-10::-webkit-slider-runnable-track {
1681+
.emotion-4::-webkit-slider-runnable-track {
18491682
-webkit-appearance: none;
18501683
-moz-appearance: none;
18511684
-ms-appearance: none;
@@ -1856,7 +1689,7 @@ exports[`sliderField > should trigger events correctly 1`] = `
18561689
background: transparent;
18571690
}
18581691
1859-
.emotion-10::-webkit-slider-thumb {
1692+
.emotion-4::-webkit-slider-thumb {
18601693
-webkit-appearance: none;
18611694
-webkit-appearance: none;
18621695
-moz-appearance: none;
@@ -1878,14 +1711,14 @@ exports[`sliderField > should trigger events correctly 1`] = `
18781711
top: -4px;
18791712
}
18801713
1881-
.emotion-10::-webkit-slider-thumb:hover,
1882-
.emotion-10::-webkit-slider-thumb:active,
1883-
.emotion-10::-webkit-slider-thumb:focus {
1714+
.emotion-4::-webkit-slider-thumb:hover,
1715+
.emotion-4::-webkit-slider-thumb:active,
1716+
.emotion-4::-webkit-slider-thumb:focus {
18841717
border: 1.5px solid #8c40ef;
18851718
}
18861719
1887-
.emotion-10::-webkit-slider-thumb:active,
1888-
.emotion-10::-webkit-slider-thumb:focus {
1720+
.emotion-4::-webkit-slider-thumb:active,
1721+
.emotion-4::-webkit-slider-thumb:focus {
18891722
box-shadow: 0px 0px 0px 3px #8c40ef40;
18901723
cursor: -webkit-grabbing;
18911724
cursor: grabbing;
@@ -1928,7 +1761,7 @@ exports[`sliderField > should trigger events correctly 1`] = `
19281761
>
19291762
<div>
19301763
<div
1931-
class="emotion-4 emotion-5"
1764+
class="uv_1ce7gb6h uv_1ce7gb6n uv_1ce7gb6i"
19321765
data-controls="false"
19331766
data-disabled="false"
19341767
data-error="false"
@@ -1937,15 +1770,12 @@ exports[`sliderField > should trigger events correctly 1`] = `
19371770
data-unit="false"
19381771
>
19391772
<div
1940-
class="emotion-6 emotion-7 uv_x6hyh50 uv_x6hyh52p uv_x6hyh561"
1773+
class="uv_1ce7gb63 uv_1ce7gb64 uv_x6hyh50 uv_x6hyh52p uv_x6hyh561"
19411774
style="--uv_3mg8xe0: 1fr auto; --uv_3mg8xe1: 1fr auto; --uv_3mg8xe2: 1fr auto; --uv_3mg8xe3: 1fr auto; --uv_3mg8xe4: 1fr auto; --uv_3mg8xe5: 1fr auto;"
19421775
>
19431776
<input
19441777
aria-label="input"
1945-
class="emotion-8 emotion-9"
1946-
data-controls="false"
1947-
data-has-unit="false"
1948-
data-size="small"
1778+
class="uv_1ce7gb6b uv_1ce7gb6d uv_1ce7gb6g"
19491779
data-testid="slider-input"
19501780
id="_r_10_"
19511781
max="10"
@@ -1969,7 +1799,7 @@ exports[`sliderField > should trigger events correctly 1`] = `
19691799
>
19701800
<input
19711801
aria-label="test"
1972-
class="emotion-10 emotion-11"
1802+
class="emotion-4 emotion-5"
19731803
data-direction="column"
19741804
data-error="false"
19751805
id="_r_t_"

0 commit comments

Comments
 (0)