@telia/teddy 0.4.13 → 0.4.15
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/dist/components/card/card-button.cjs +12 -0
- package/dist/components/card/card-button.js +12 -0
- package/dist/components/card/card-heading.cjs +3 -0
- package/dist/components/card/card-heading.js +3 -0
- package/dist/components/card/card-price.cjs +1 -2
- package/dist/components/card/card-price.js +1 -2
- package/dist/components/carousel/carousel-root.cjs +4 -4
- package/dist/components/carousel/carousel-root.js +4 -4
- package/dist/style.css +33 -33
- package/package.json +1 -1
|
@@ -16,6 +16,17 @@ function getButtonVariant(variant) {
|
|
|
16
16
|
return "primary";
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
+
const getButtonSize = (layout) => {
|
|
20
|
+
switch (layout) {
|
|
21
|
+
case "navigation-vertical":
|
|
22
|
+
case "navigation-horizontal-small":
|
|
23
|
+
case "navigation-horizontal-small-centered":
|
|
24
|
+
case "navigation-horizontal-large":
|
|
25
|
+
return "sm";
|
|
26
|
+
default:
|
|
27
|
+
return "md";
|
|
28
|
+
}
|
|
29
|
+
};
|
|
19
30
|
const Button = React.forwardRef(
|
|
20
31
|
({ className, iconOnly, disclaimer, ...props }, forwardRef) => {
|
|
21
32
|
const context = React.useContext(components_card_card.RootContext);
|
|
@@ -37,6 +48,7 @@ const Button = React.forwardRef(
|
|
|
37
48
|
ref,
|
|
38
49
|
...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
|
|
39
50
|
variant: getButtonVariant(context == null ? void 0 : context.variant),
|
|
51
|
+
size: getButtonSize(context == null ? void 0 : context.layout),
|
|
40
52
|
...props,
|
|
41
53
|
className: classes
|
|
42
54
|
}
|
|
@@ -14,6 +14,17 @@ function getButtonVariant(variant) {
|
|
|
14
14
|
return "primary";
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
const getButtonSize = (layout) => {
|
|
18
|
+
switch (layout) {
|
|
19
|
+
case "navigation-vertical":
|
|
20
|
+
case "navigation-horizontal-small":
|
|
21
|
+
case "navigation-horizontal-small-centered":
|
|
22
|
+
case "navigation-horizontal-large":
|
|
23
|
+
return "sm";
|
|
24
|
+
default:
|
|
25
|
+
return "md";
|
|
26
|
+
}
|
|
27
|
+
};
|
|
17
28
|
const Button = React__default.forwardRef(
|
|
18
29
|
({ className, iconOnly, disclaimer, ...props }, forwardRef) => {
|
|
19
30
|
const context = React__default.useContext(RootContext);
|
|
@@ -35,6 +46,7 @@ const Button = React__default.forwardRef(
|
|
|
35
46
|
ref,
|
|
36
47
|
...!iconOnly || !props["aria-label"] ? { iconOnly: false, "aria-label": void 0 } : { iconOnly: true, "aria-label": props["aria-label"] },
|
|
37
48
|
variant: getButtonVariant(context == null ? void 0 : context.variant),
|
|
49
|
+
size: getButtonSize(context == null ? void 0 : context.layout),
|
|
38
50
|
...props,
|
|
39
51
|
className: classes
|
|
40
52
|
}
|
|
@@ -14,13 +14,12 @@ const Price = React.forwardRef(
|
|
|
14
14
|
return /* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { flexGrow: "1", mt: "auto", mb: "100", ref: forwardRef, className: classes, direction: "column", gap: "10", children: [
|
|
15
15
|
textAbovePrice ? /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "additional-100", as: "p", faded: true, children: textAbovePrice }) : null,
|
|
16
16
|
/* @__PURE__ */ jsxRuntime.jsxs(components_flex_flex.Flex, { direction: "row", align: "baseline", flexGrow: "1", wrap: "nowrap", children: [
|
|
17
|
-
pricePrefix && /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-200", as: "p", faded: true, children: pricePrefix }),
|
|
17
|
+
pricePrefix && /* @__PURE__ */ jsxRuntime.jsx(components_text_text.Text, { variant: "paragraph-200", as: "p", faded: true, mr: "100", children: pricePrefix }),
|
|
18
18
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
19
19
|
components_text_text.Text,
|
|
20
20
|
{
|
|
21
21
|
variant: "paragraph-100-bold",
|
|
22
22
|
as: "span",
|
|
23
|
-
ml: "100",
|
|
24
23
|
mr: "100",
|
|
25
24
|
color: variant === "purple" ? tokens_color_variables.teddyColorBrandCorePurple : void 0,
|
|
26
25
|
className: components_card_card.styles[`${rootColorDotsClass}--big`],
|
|
@@ -12,13 +12,12 @@ const Price = React__default.forwardRef(
|
|
|
12
12
|
return /* @__PURE__ */ jsxs(Flex, { flexGrow: "1", mt: "auto", mb: "100", ref: forwardRef, className: classes, direction: "column", gap: "10", children: [
|
|
13
13
|
textAbovePrice ? /* @__PURE__ */ jsx(Text, { variant: "additional-100", as: "p", faded: true, children: textAbovePrice }) : null,
|
|
14
14
|
/* @__PURE__ */ jsxs(Flex, { direction: "row", align: "baseline", flexGrow: "1", wrap: "nowrap", children: [
|
|
15
|
-
pricePrefix && /* @__PURE__ */ jsx(Text, { variant: "paragraph-200", as: "p", faded: true, children: pricePrefix }),
|
|
15
|
+
pricePrefix && /* @__PURE__ */ jsx(Text, { variant: "paragraph-200", as: "p", faded: true, mr: "100", children: pricePrefix }),
|
|
16
16
|
/* @__PURE__ */ jsx(
|
|
17
17
|
Text,
|
|
18
18
|
{
|
|
19
19
|
variant: "paragraph-100-bold",
|
|
20
20
|
as: "span",
|
|
21
|
-
ml: "100",
|
|
22
21
|
mr: "100",
|
|
23
22
|
color: variant === "purple" ? teddyColorBrandCorePurple : void 0,
|
|
24
23
|
className: styles[`${rootColorDotsClass}--big`],
|
|
@@ -7,10 +7,10 @@ const Slider = require("react-slick");
|
|
|
7
7
|
require("../../assets/sprite.1321fab0-teddy.svg");
|
|
8
8
|
const components_icon_icon = require("../icon/icon.cjs");
|
|
9
9
|
const styles = {
|
|
10
|
-
"teddy-carousel": "_teddy-
|
|
11
|
-
"teddy-carousel__arrow": "_teddy-
|
|
12
|
-
"teddy-carousel__item": "_teddy-
|
|
13
|
-
"teddy-carousel--sm": "_teddy-carousel--
|
|
10
|
+
"teddy-carousel": "_teddy-carousel_8pf7z_2",
|
|
11
|
+
"teddy-carousel__arrow": "_teddy-carousel__arrow_8pf7z_9",
|
|
12
|
+
"teddy-carousel__item": "_teddy-carousel__item_8pf7z_21",
|
|
13
|
+
"teddy-carousel--sm": "_teddy-carousel--sm_8pf7z_99"
|
|
14
14
|
};
|
|
15
15
|
const rootClassName = "teddy-carousel";
|
|
16
16
|
const CustomArrow = ({
|
|
@@ -5,10 +5,10 @@ import Slider from "react-slick";
|
|
|
5
5
|
import "../../assets/sprite.1321fab0-teddy.svg";
|
|
6
6
|
import { Icon } from "../icon/icon.js";
|
|
7
7
|
const styles = {
|
|
8
|
-
"teddy-carousel": "_teddy-
|
|
9
|
-
"teddy-carousel__arrow": "_teddy-
|
|
10
|
-
"teddy-carousel__item": "_teddy-
|
|
11
|
-
"teddy-carousel--sm": "_teddy-carousel--
|
|
8
|
+
"teddy-carousel": "_teddy-carousel_8pf7z_2",
|
|
9
|
+
"teddy-carousel__arrow": "_teddy-carousel__arrow_8pf7z_9",
|
|
10
|
+
"teddy-carousel__item": "_teddy-carousel__item_8pf7z_21",
|
|
11
|
+
"teddy-carousel--sm": "_teddy-carousel--sm_8pf7z_99"
|
|
12
12
|
};
|
|
13
13
|
const rootClassName = "teddy-carousel";
|
|
14
14
|
const CustomArrow = ({
|
package/dist/style.css
CHANGED
|
@@ -1806,41 +1806,41 @@
|
|
|
1806
1806
|
--teddy-color-brand-core-purple: var(--teddy-color-purple-550);
|
|
1807
1807
|
--teddy-color-brand-deep-purple: var(--teddy-color-purple-900);
|
|
1808
1808
|
}
|
|
1809
|
-
._teddy-
|
|
1809
|
+
._teddy-carousel_8pf7z_2 {
|
|
1810
1810
|
width: 100%;
|
|
1811
1811
|
min-width: 10rem;
|
|
1812
1812
|
max-width: 15rem;
|
|
1813
1813
|
height: 288px;
|
|
1814
1814
|
margin: 0 auto 2rem;
|
|
1815
1815
|
}
|
|
1816
|
-
._teddy-
|
|
1816
|
+
._teddy-carousel__arrow_8pf7z_9 {
|
|
1817
1817
|
display: flex;
|
|
1818
1818
|
justify-content: center;
|
|
1819
1819
|
align-items: center;
|
|
1820
1820
|
z-index: 2;
|
|
1821
|
-
width: 3rem;
|
|
1822
|
-
height: 3rem;
|
|
1821
|
+
width: 3rem !important;
|
|
1822
|
+
height: 3rem !important;
|
|
1823
1823
|
border-radius: 2rem;
|
|
1824
1824
|
transition-duration: var(--teddy-motion-duration-100);
|
|
1825
1825
|
transition-timing-function: var(--teddy-motion-easing-ease-in-out);
|
|
1826
1826
|
transition-property: background-color, color;
|
|
1827
1827
|
}
|
|
1828
|
-
._teddy-
|
|
1828
|
+
._teddy-carousel__item_8pf7z_21 {
|
|
1829
1829
|
display: flex !important;
|
|
1830
1830
|
justify-content: center;
|
|
1831
1831
|
}
|
|
1832
|
-
._teddy-
|
|
1833
|
-
._teddy-
|
|
1832
|
+
._teddy-carousel_8pf7z_2 .slick-prev:before,
|
|
1833
|
+
._teddy-carousel_8pf7z_2 .slick-next:before {
|
|
1834
1834
|
content: "";
|
|
1835
1835
|
}
|
|
1836
|
-
._teddy-
|
|
1836
|
+
._teddy-carousel_8pf7z_2 .slick-disabled {
|
|
1837
1837
|
cursor: initial;
|
|
1838
1838
|
opacity: 0.3;
|
|
1839
1839
|
}
|
|
1840
|
-
._teddy-
|
|
1840
|
+
._teddy-carousel_8pf7z_2 .slick-track {
|
|
1841
1841
|
display: flex;
|
|
1842
1842
|
}
|
|
1843
|
-
._teddy-
|
|
1843
|
+
._teddy-carousel_8pf7z_2 .slick-slide > div {
|
|
1844
1844
|
display: grid;
|
|
1845
1845
|
place-items: center;
|
|
1846
1846
|
width: 80%;
|
|
@@ -1848,82 +1848,82 @@
|
|
|
1848
1848
|
height: 260px;
|
|
1849
1849
|
padding: 0px;
|
|
1850
1850
|
}
|
|
1851
|
-
._teddy-
|
|
1851
|
+
._teddy-carousel_8pf7z_2 .slick-slide img {
|
|
1852
1852
|
max-width: 10rem;
|
|
1853
1853
|
max-height: 12.5rem;
|
|
1854
1854
|
object-fit: contain;
|
|
1855
1855
|
width: 100%;
|
|
1856
1856
|
height: 100%;
|
|
1857
1857
|
}
|
|
1858
|
-
._teddy-
|
|
1858
|
+
._teddy-carousel_8pf7z_2 .slick-next {
|
|
1859
1859
|
right: 0;
|
|
1860
1860
|
color: var(--teddy-color-purple-700);
|
|
1861
1861
|
}
|
|
1862
|
-
._teddy-
|
|
1862
|
+
._teddy-carousel_8pf7z_2 .slick-prev {
|
|
1863
1863
|
left: 0;
|
|
1864
1864
|
color: var(--teddy-color-purple-700);
|
|
1865
1865
|
}
|
|
1866
|
-
._teddy-
|
|
1867
|
-
._teddy-
|
|
1868
|
-
._teddy-
|
|
1869
|
-
._teddy-
|
|
1866
|
+
._teddy-carousel_8pf7z_2 .slick-prev:focus-visible,
|
|
1867
|
+
._teddy-carousel_8pf7z_2 .slick-prev:active,
|
|
1868
|
+
._teddy-carousel_8pf7z_2 .slick-next:active,
|
|
1869
|
+
._teddy-carousel_8pf7z_2 .slick-next:focus-visible {
|
|
1870
1870
|
color: var(--teddy-color-text-interactive-primary-active);
|
|
1871
1871
|
background-color: var(--teddy-color-border-interactive-primary-negative-hover);
|
|
1872
1872
|
}
|
|
1873
|
-
._teddy-
|
|
1874
|
-
._teddy-
|
|
1873
|
+
._teddy-carousel_8pf7z_2 .slick-prev:hover,
|
|
1874
|
+
._teddy-carousel_8pf7z_2 .slick-next:hover {
|
|
1875
1875
|
color: var(--teddy-color-text-interactive-primary-hover);
|
|
1876
1876
|
background-color: var(--teddy-color-background-interactive-transparent-hover);
|
|
1877
1877
|
}
|
|
1878
|
-
._teddy-
|
|
1878
|
+
._teddy-carousel_8pf7z_2 .slick-dots {
|
|
1879
1879
|
bottom: -2rem;
|
|
1880
1880
|
margin: 0;
|
|
1881
1881
|
padding: 0;
|
|
1882
1882
|
}
|
|
1883
|
-
._teddy-
|
|
1883
|
+
._teddy-carousel_8pf7z_2 .slick-dots button {
|
|
1884
1884
|
width: 24px;
|
|
1885
1885
|
height: 24px;
|
|
1886
1886
|
}
|
|
1887
|
-
._teddy-
|
|
1887
|
+
._teddy-carousel_8pf7z_2 .slick-dots button:before {
|
|
1888
1888
|
width: 24px;
|
|
1889
1889
|
height: 24px;
|
|
1890
1890
|
}
|
|
1891
|
-
._teddy-
|
|
1891
|
+
._teddy-carousel_8pf7z_2 .slick-dots button:hover:before {
|
|
1892
1892
|
color: var(--teddy-color-purple-700);
|
|
1893
1893
|
}
|
|
1894
|
-
._teddy-
|
|
1894
|
+
._teddy-carousel_8pf7z_2 .slick-dots .slick-active button:before {
|
|
1895
1895
|
color: var(--teddy-color-purple-700);
|
|
1896
1896
|
}
|
|
1897
|
-
._teddy-
|
|
1897
|
+
._teddy-carousel_8pf7z_2 .slick-dots li {
|
|
1898
1898
|
width: 24px;
|
|
1899
1899
|
height: 24px;
|
|
1900
1900
|
margin: 0;
|
|
1901
1901
|
padding: 0;
|
|
1902
1902
|
}
|
|
1903
|
-
._teddy-
|
|
1903
|
+
._teddy-carousel_8pf7z_2 .slick-dots li button:before {
|
|
1904
1904
|
font-size: 1rem;
|
|
1905
1905
|
}
|
|
1906
|
-
._teddy-carousel--
|
|
1906
|
+
._teddy-carousel--sm_8pf7z_99 {
|
|
1907
1907
|
height: 180px;
|
|
1908
1908
|
}
|
|
1909
|
-
._teddy-carousel--
|
|
1909
|
+
._teddy-carousel--sm_8pf7z_99 .slick-slide > div {
|
|
1910
1910
|
height: 170px;
|
|
1911
1911
|
}
|
|
1912
|
-
._teddy-carousel--
|
|
1912
|
+
._teddy-carousel--sm_8pf7z_99 .slick-slide img {
|
|
1913
1913
|
max-width: 8rem;
|
|
1914
1914
|
max-height: 10rem;
|
|
1915
1915
|
}
|
|
1916
|
-
._teddy-carousel--
|
|
1916
|
+
._teddy-carousel--sm_8pf7z_99 .slick-next {
|
|
1917
1917
|
right: -0.5rem;
|
|
1918
1918
|
}
|
|
1919
|
-
._teddy-carousel--
|
|
1919
|
+
._teddy-carousel--sm_8pf7z_99 .slick-prev {
|
|
1920
1920
|
left: -0.5rem;
|
|
1921
1921
|
}
|
|
1922
1922
|
@media (min-width: 600px) {
|
|
1923
|
-
._teddy-carousel--
|
|
1923
|
+
._teddy-carousel--sm_8pf7z_99 .slick-next {
|
|
1924
1924
|
right: 0rem;
|
|
1925
1925
|
}
|
|
1926
|
-
._teddy-carousel--
|
|
1926
|
+
._teddy-carousel--sm_8pf7z_99 .slick-prev {
|
|
1927
1927
|
left: 0rem;
|
|
1928
1928
|
}
|
|
1929
1929
|
}._teddy-scroll-area_1r6mf_1 {
|