@telia/teddy 0.4.12 → 0.4.14
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/carousel/carousel-root.cjs +4 -4
- package/dist/components/carousel/carousel-root.js +4 -4
- package/dist/components/navigation-menu/global-navigation/global-navigation-root.d.ts +4 -2
- package/dist/components/radio-card-group/radio-card-group-item-title.cjs +11 -2
- package/dist/components/radio-card-group/radio-card-group-item-title.js +11 -2
- package/dist/style.css +33 -33
- package/package.json +1 -1
|
@@ -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 = ({
|
|
@@ -21,6 +21,8 @@ export type RootProps = React.ComponentPropsWithoutRef<'div'> & {
|
|
|
21
21
|
currentPath: string | undefined;
|
|
22
22
|
onSearchInputChange?: (e: React.ChangeEvent<HTMLInputElement>, value?: string) => void;
|
|
23
23
|
onSearchKeyDown?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
24
|
+
searchValue?: string;
|
|
25
|
+
onClear?: () => void;
|
|
24
26
|
};
|
|
25
27
|
type RootContext = {
|
|
26
28
|
selectedMenuItem: string | undefined;
|
|
@@ -31,9 +33,9 @@ type RootContext = {
|
|
|
31
33
|
setPathname: (v: string) => void;
|
|
32
34
|
specifiedLink?: string;
|
|
33
35
|
setSpecifiedLink: (v: string) => void;
|
|
34
|
-
} & Pick<RootProps, 'onSearchSubmit' | 'additionalSearchContent' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize' | "onSearchInputChange" | 'onSearchKeyDown'>;
|
|
36
|
+
} & Pick<RootProps, 'onSearchSubmit' | 'additionalSearchContent' | 'shoppingCart' | 'shoppingCartNumberOfItems' | 'loggedInUser' | 'appKey' | 'onLogoutClick' | 'linkComponent' | 'isCartOpen' | 'onCartOpenChange' | 'drawerSize' | "onSearchInputChange" | 'onSearchKeyDown' | 'searchValue' | 'onClear'>;
|
|
35
37
|
export declare const RootContext: React.Context<RootContext | null>;
|
|
36
|
-
export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, additionalSearchContent, isCartOpen, onCartOpenChange, drawerSize, isSimplified, currentPath, onSearchInputChange, onSearchKeyDown, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare function Root({ className, appKey, loggedInUser, linkComponent, onLogoutClick, shoppingCart, shoppingCartNumberOfItems, onSearchSubmit, additionalSearchContent, isCartOpen, onCartOpenChange, drawerSize, isSimplified, currentPath, onSearchInputChange, onSearchKeyDown, searchValue, onClear, ...props }: RootProps): import("react/jsx-runtime").JSX.Element;
|
|
37
39
|
export declare namespace Root {
|
|
38
40
|
var displayName: string;
|
|
39
41
|
}
|
|
@@ -690,6 +690,7 @@ const SearchField = React.forwardRef(
|
|
|
690
690
|
components_textField_index.TextField.Input,
|
|
691
691
|
{
|
|
692
692
|
ref: composedRef,
|
|
693
|
+
value: context == null ? void 0 : context.searchValue,
|
|
693
694
|
onChange: (e) => {
|
|
694
695
|
var _a, _b;
|
|
695
696
|
if (((_a = ref.current) == null ? void 0 : _a.value) && (context == null ? void 0 : context.onSearchInputChange)) {
|
|
@@ -704,7 +705,11 @@ const SearchField = React.forwardRef(
|
|
|
704
705
|
placeholder: "Søk her"
|
|
705
706
|
}
|
|
706
707
|
),
|
|
707
|
-
/* @__PURE__ */ jsxRuntime.jsx(components_textField_index.TextField.ClearButton, {
|
|
708
|
+
/* @__PURE__ */ jsxRuntime.jsx(components_textField_index.TextField.ClearButton, { onClick: () => {
|
|
709
|
+
if (context == null ? void 0 : context.onClear) {
|
|
710
|
+
context.onClear();
|
|
711
|
+
}
|
|
712
|
+
} })
|
|
708
713
|
] }),
|
|
709
714
|
/* @__PURE__ */ jsxRuntime.jsx(components_textField_index.TextField.Button, { variant: "separated", children: "Søk" })
|
|
710
715
|
] })
|
|
@@ -1215,6 +1220,8 @@ function Root({
|
|
|
1215
1220
|
currentPath,
|
|
1216
1221
|
onSearchInputChange,
|
|
1217
1222
|
onSearchKeyDown,
|
|
1223
|
+
searchValue,
|
|
1224
|
+
onClear,
|
|
1218
1225
|
...props
|
|
1219
1226
|
}) {
|
|
1220
1227
|
const [selectedMenuItem, setSelectedMenuItem] = React.useState(getInitialMenuItem(currentPath));
|
|
@@ -1261,7 +1268,9 @@ function Root({
|
|
|
1261
1268
|
specifiedLink,
|
|
1262
1269
|
setSpecifiedLink,
|
|
1263
1270
|
onSearchInputChange,
|
|
1264
|
-
onSearchKeyDown
|
|
1271
|
+
onSearchKeyDown,
|
|
1272
|
+
searchValue,
|
|
1273
|
+
onClear
|
|
1265
1274
|
},
|
|
1266
1275
|
children: /* @__PURE__ */ jsxRuntime.jsx(components_box_box.Box, { ...props, className: classes, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1267
1276
|
NavigationMenu,
|
|
@@ -669,6 +669,7 @@ const SearchField = React__default.forwardRef(
|
|
|
669
669
|
TextField.Input,
|
|
670
670
|
{
|
|
671
671
|
ref: composedRef,
|
|
672
|
+
value: context == null ? void 0 : context.searchValue,
|
|
672
673
|
onChange: (e) => {
|
|
673
674
|
var _a, _b;
|
|
674
675
|
if (((_a = ref.current) == null ? void 0 : _a.value) && (context == null ? void 0 : context.onSearchInputChange)) {
|
|
@@ -683,7 +684,11 @@ const SearchField = React__default.forwardRef(
|
|
|
683
684
|
placeholder: "Søk her"
|
|
684
685
|
}
|
|
685
686
|
),
|
|
686
|
-
/* @__PURE__ */ jsx(TextField.ClearButton, {
|
|
687
|
+
/* @__PURE__ */ jsx(TextField.ClearButton, { onClick: () => {
|
|
688
|
+
if (context == null ? void 0 : context.onClear) {
|
|
689
|
+
context.onClear();
|
|
690
|
+
}
|
|
691
|
+
} })
|
|
687
692
|
] }),
|
|
688
693
|
/* @__PURE__ */ jsx(TextField.Button, { variant: "separated", children: "Søk" })
|
|
689
694
|
] })
|
|
@@ -1194,6 +1199,8 @@ function Root({
|
|
|
1194
1199
|
currentPath,
|
|
1195
1200
|
onSearchInputChange,
|
|
1196
1201
|
onSearchKeyDown,
|
|
1202
|
+
searchValue,
|
|
1203
|
+
onClear,
|
|
1197
1204
|
...props
|
|
1198
1205
|
}) {
|
|
1199
1206
|
const [selectedMenuItem, setSelectedMenuItem] = React__default.useState(getInitialMenuItem(currentPath));
|
|
@@ -1240,7 +1247,9 @@ function Root({
|
|
|
1240
1247
|
specifiedLink,
|
|
1241
1248
|
setSpecifiedLink,
|
|
1242
1249
|
onSearchInputChange,
|
|
1243
|
-
onSearchKeyDown
|
|
1250
|
+
onSearchKeyDown,
|
|
1251
|
+
searchValue,
|
|
1252
|
+
onClear
|
|
1244
1253
|
},
|
|
1245
1254
|
children: /* @__PURE__ */ jsx(Box, { ...props, className: classes, children: /* @__PURE__ */ jsxs(
|
|
1246
1255
|
NavigationMenu,
|
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 {
|