@digital-b2c/coreui-kit 0.17.11 → 0.17.13
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/LICENSE.txt +21 -21
- package/README.md +52 -52
- package/dist/index.cjs +52 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +19 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +11 -3
- package/dist/index.d.ts +11 -3
- package/dist/index.mjs +53 -34
- package/dist/index.mjs.map +1 -1
- package/dist/types/global.d.ts +25 -25
- package/package.json +100 -101
package/LICENSE.txt
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Luxottica
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Luxottica
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
# CoreUI Kit
|
|
2
|
-
|
|
3
|
-
A React‑based design system and component library.
|
|
4
|
-
|
|
5
|
-
## 🚀 Getting Started
|
|
6
|
-
|
|
7
|
-
Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Development
|
|
14
|
-
|
|
15
|
-
- Run the build in watch mode
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm run dev
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Start Storybook
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm run storybook
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
Run tests
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
npm test
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Lint/format
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
npm run lint
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## 🛠️ Usage
|
|
40
|
-
|
|
41
|
-
Import components in other projects:
|
|
42
|
-
|
|
43
|
-
```ts
|
|
44
|
-
import '@digital-b2c/coreui-kit/styles.css'
|
|
45
|
-
|
|
46
|
-
import { MiniSectionCta } from '@digital-b2c/coreui-kit'
|
|
47
|
-
|
|
48
|
-
<MiniSectionCta>
|
|
49
|
-
<MiniSectionCta.Title>Header</MiniSectionCta.Title>
|
|
50
|
-
<MiniSectionCta.Subtitle>Description</MiniSectionCta.Subtitle>
|
|
51
|
-
</MiniSectionCta>
|
|
52
|
-
```
|
|
1
|
+
# CoreUI Kit
|
|
2
|
+
|
|
3
|
+
A React‑based design system and component library.
|
|
4
|
+
|
|
5
|
+
## 🚀 Getting Started
|
|
6
|
+
|
|
7
|
+
Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Development
|
|
14
|
+
|
|
15
|
+
- Run the build in watch mode
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm run dev
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Start Storybook
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm run storybook
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Run tests
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm test
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Lint/format
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm run lint
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 🛠️ Usage
|
|
40
|
+
|
|
41
|
+
Import components in other projects:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import '@digital-b2c/coreui-kit/styles.css'
|
|
45
|
+
|
|
46
|
+
import { MiniSectionCta } from '@digital-b2c/coreui-kit'
|
|
47
|
+
|
|
48
|
+
<MiniSectionCta>
|
|
49
|
+
<MiniSectionCta.Title>Header</MiniSectionCta.Title>
|
|
50
|
+
<MiniSectionCta.Subtitle>Description</MiniSectionCta.Subtitle>
|
|
51
|
+
</MiniSectionCta>
|
|
52
|
+
```
|
package/dist/index.cjs
CHANGED
|
@@ -1798,9 +1798,11 @@ var NewsCard_module_default = {
|
|
|
1798
1798
|
"news-card-description": "NewsCard_module_news-card-description",
|
|
1799
1799
|
"news-card-cta-wrapper": "NewsCard_module_news-card-cta-wrapper",
|
|
1800
1800
|
"news-card--vertical": "NewsCard_module_news-card--vertical",
|
|
1801
|
-
"news-card--horizontal": "NewsCard_module_news-card--horizontal"
|
|
1801
|
+
"news-card--horizontal": "NewsCard_module_news-card--horizontal",
|
|
1802
|
+
restricted: "NewsCard_module_restricted"
|
|
1802
1803
|
};
|
|
1803
1804
|
var NewsCard = ({
|
|
1805
|
+
type,
|
|
1804
1806
|
className,
|
|
1805
1807
|
image,
|
|
1806
1808
|
date,
|
|
@@ -1811,13 +1813,19 @@ var NewsCard = ({
|
|
|
1811
1813
|
direction = "vertical",
|
|
1812
1814
|
renderLink
|
|
1813
1815
|
}) => {
|
|
1814
|
-
const
|
|
1816
|
+
const id = React71.useId();
|
|
1817
|
+
const isRestricted = type === "restricted";
|
|
1818
|
+
const linkProps = cta && cta.url ? __spreadProps(__spreadValues({
|
|
1815
1819
|
href: cta.url,
|
|
1816
1820
|
target: cta.isExternal ? "_blank" : void 0,
|
|
1817
1821
|
rel: cta.isExternal ? "noopener noreferrer" : void 0,
|
|
1818
1822
|
className: clsx49__default.default("news-card-link", NewsCard_module_default["news-card-link"]),
|
|
1819
1823
|
"aria-label": `${title}${cta.label ? ` \u2014 ${cta.label}` : ""}`
|
|
1820
|
-
}
|
|
1824
|
+
}, isRestricted && {
|
|
1825
|
+
"aria-disabled": true
|
|
1826
|
+
}), {
|
|
1827
|
+
tabIndex: isRestricted ? -1 : 0
|
|
1828
|
+
}) : null;
|
|
1821
1829
|
const cardLink = linkProps ? renderLink ? renderLink(__spreadProps(__spreadValues({}, linkProps), { children: null })) : /* @__PURE__ */ jsxRuntime.jsx("a", __spreadValues({}, linkProps)) : null;
|
|
1822
1830
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1823
1831
|
"article",
|
|
@@ -1825,9 +1833,12 @@ var NewsCard = ({
|
|
|
1825
1833
|
className: clsx49__default.default(
|
|
1826
1834
|
"news-card",
|
|
1827
1835
|
NewsCard_module_default["news-card"],
|
|
1836
|
+
type && NewsCard_module_default[type],
|
|
1828
1837
|
NewsCard_module_default[`news-card--${direction}`],
|
|
1829
1838
|
className
|
|
1830
1839
|
),
|
|
1840
|
+
"aria-labelledby": `title-${id}`,
|
|
1841
|
+
"aria-describedby": isRestricted ? `restricted-${id}` : void 0,
|
|
1831
1842
|
children: [
|
|
1832
1843
|
cardLink,
|
|
1833
1844
|
image && /* @__PURE__ */ jsxRuntime.jsx(Picture, __spreadProps(__spreadValues({}, image), { className: clsx49__default.default("news-card-image", NewsCard_module_default["news-card-image"]) })),
|
|
@@ -1845,7 +1856,8 @@ var NewsCard = ({
|
|
|
1845
1856
|
] }),
|
|
1846
1857
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx49__default.default("news-card-main-content", NewsCard_module_default["news-card-main-content"]), children: [
|
|
1847
1858
|
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: clsx49__default.default("news-card-title", NewsCard_module_default["news-card-title"]), children: title }),
|
|
1848
|
-
typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: clsx49__default.default("news-card-description", NewsCard_module_default["news-card-description"]), children: description }) : description
|
|
1859
|
+
typeof description === "string" ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: clsx49__default.default("news-card-description", NewsCard_module_default["news-card-description"]), children: description }) : description,
|
|
1860
|
+
isRestricted && /* @__PURE__ */ jsxRuntime.jsx("p", { id: `restricted-${id}`, className: "sr-only", children: "This resource is restricted. You do not have permission to access it." })
|
|
1849
1861
|
] }),
|
|
1850
1862
|
cta && cta.url && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx49__default.default("news-card-cta-wrapper", NewsCard_module_default["news-card-cta-wrapper"]), children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1851
1863
|
Button,
|
|
@@ -2648,7 +2660,7 @@ var HeroBanner = ({
|
|
|
2648
2660
|
__spreadValues({
|
|
2649
2661
|
className: HeroBanner_module_default.brandsStrip,
|
|
2650
2662
|
variant: "light",
|
|
2651
|
-
size: isTabletBelow
|
|
2663
|
+
size: !isTabletBelow && vMainHeroBanner ? void 0 : "small"
|
|
2652
2664
|
}, brands)
|
|
2653
2665
|
),
|
|
2654
2666
|
backgroundImage && !vBannerPodcast && /* @__PURE__ */ jsxRuntime.jsx(Picture, __spreadValues({ className: HeroBanner_module_default.backgroundImage }, backgroundImage))
|
|
@@ -3225,6 +3237,9 @@ var MiniSectionCta2 = Object.assign(MiniSectionCta, {
|
|
|
3225
3237
|
Title: MiniSectionCtaTitle,
|
|
3226
3238
|
Subtitle: MiniSectionCtaSubtitle
|
|
3227
3239
|
});
|
|
3240
|
+
var NavigationUserMenuFallback = ({ children }) => {
|
|
3241
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
3242
|
+
};
|
|
3228
3243
|
var useIsAtTop = () => {
|
|
3229
3244
|
const [isAtTop, setIsAtTop] = React71.useState(true);
|
|
3230
3245
|
React71.useEffect(() => {
|
|
@@ -3839,6 +3854,10 @@ var Navigation2 = (props) => {
|
|
|
3839
3854
|
brandLogos
|
|
3840
3855
|
} = props;
|
|
3841
3856
|
const isExternal = variant !== "internal";
|
|
3857
|
+
const slots = resolveCompoundSlots(props.children, {
|
|
3858
|
+
userMenuFallback: NavigationUserMenuFallback
|
|
3859
|
+
});
|
|
3860
|
+
const userMenuFallbackNode = slots.userMenuFallback;
|
|
3842
3861
|
const [isHovered, setIsHovered] = React71.useState(false);
|
|
3843
3862
|
const [openIndex, setOpenIndex] = React71.useState(null);
|
|
3844
3863
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = React71.useState(false);
|
|
@@ -3983,7 +4002,9 @@ var Navigation2 = (props) => {
|
|
|
3983
4002
|
rightButton,
|
|
3984
4003
|
loginVariant: isTransparent ? "ghost" : "nofillblack"
|
|
3985
4004
|
}
|
|
3986
|
-
) : user
|
|
4005
|
+
) : user ? /* @__PURE__ */ jsxRuntime.jsx(UserMenu, { user }) : userMenuFallbackNode ? React71.cloneElement(userMenuFallbackNode, {
|
|
4006
|
+
className: clsx49__default.default("userMenuFallback", Navigation_module_default["userMenuFallback"])
|
|
4007
|
+
}) : null
|
|
3987
4008
|
] }),
|
|
3988
4009
|
!isTabletBelow && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.bottomRow, children: [
|
|
3989
4010
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4051,6 +4072,11 @@ var Navigation2 = (props) => {
|
|
|
4051
4072
|
)
|
|
4052
4073
|
] });
|
|
4053
4074
|
};
|
|
4075
|
+
|
|
4076
|
+
// src/widgets/Navigation/index.ts
|
|
4077
|
+
var Navigation3 = Object.assign(Navigation2, {
|
|
4078
|
+
UserMenuFallback: NavigationUserMenuFallback
|
|
4079
|
+
});
|
|
4054
4080
|
var PracticePathCardsFooter = ({ children }) => {
|
|
4055
4081
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children });
|
|
4056
4082
|
};
|
|
@@ -4863,8 +4889,7 @@ var BlogCardGrid = ({
|
|
|
4863
4889
|
}
|
|
4864
4890
|
) })
|
|
4865
4891
|
] }),
|
|
4866
|
-
/* @__PURE__ */ jsxRuntime.jsx(Grid, __spreadProps(__spreadValues({ role: "list", columns: 3 }, gridProps), { children: items.map((item
|
|
4867
|
-
var _a2;
|
|
4892
|
+
/* @__PURE__ */ jsxRuntime.jsx(Grid, __spreadProps(__spreadValues({ role: "list", columns: 3 }, gridProps), { children: items.map((item) => {
|
|
4868
4893
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4869
4894
|
GridItem,
|
|
4870
4895
|
__spreadProps(__spreadValues({
|
|
@@ -4873,7 +4898,7 @@ var BlogCardGrid = ({
|
|
|
4873
4898
|
}, gridItemProps), {
|
|
4874
4899
|
children: /* @__PURE__ */ jsxRuntime.jsx(NewsCard, __spreadProps(__spreadValues({}, item), { renderLink }))
|
|
4875
4900
|
}),
|
|
4876
|
-
|
|
4901
|
+
`${item == null ? void 0 : item.title}-${item == null ? void 0 : item.id}`
|
|
4877
4902
|
);
|
|
4878
4903
|
}) }))
|
|
4879
4904
|
] });
|
|
@@ -4955,17 +4980,14 @@ var FeaturedNewsHighlights = ({
|
|
|
4955
4980
|
wrapperClass: clsx49__default.default(FeaturedNewsHighlights_module_default["carousel-wrapper"]),
|
|
4956
4981
|
slideClass: FeaturedNewsHighlights_module_default["carousel-list-item"],
|
|
4957
4982
|
spaceBetween: 16,
|
|
4958
|
-
slides: items.map((item
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
(_a2 = item == null ? void 0 : item.title) != null ? _a2 : index
|
|
4967
|
-
);
|
|
4968
|
-
})
|
|
4983
|
+
slides: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4984
|
+
NewsCard,
|
|
4985
|
+
__spreadProps(__spreadValues({}, item), {
|
|
4986
|
+
direction: "vertical",
|
|
4987
|
+
className: clsx49__default.default("carousel-news-card", FeaturedNewsHighlights_module_default["carousel-news-card"])
|
|
4988
|
+
}),
|
|
4989
|
+
`${item == null ? void 0 : item.title}-${item == null ? void 0 : item.id}`
|
|
4990
|
+
))
|
|
4969
4991
|
}
|
|
4970
4992
|
),
|
|
4971
4993
|
(!isVariantHome || isVariantHome && !isBelowTablet) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx49__default.default("content-wrapper", FeaturedNewsHighlights_module_default["content-wrapper"]), children: [
|
|
@@ -4976,18 +4998,15 @@ var FeaturedNewsHighlights = ({
|
|
|
4976
4998
|
renderLink
|
|
4977
4999
|
})
|
|
4978
5000
|
),
|
|
4979
|
-
sideCards && sideCards.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx49__default.default("side-content", FeaturedNewsHighlights_module_default["side-content"]), children: sideCards.map((card
|
|
4980
|
-
|
|
4981
|
-
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
(_a2 = card == null ? void 0 : card.title) != null ? _a2 : index
|
|
4989
|
-
);
|
|
4990
|
-
}) })
|
|
5001
|
+
sideCards && sideCards.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx49__default.default("side-content", FeaturedNewsHighlights_module_default["side-content"]), children: sideCards.map((card) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5002
|
+
NewsCard,
|
|
5003
|
+
__spreadProps(__spreadValues({}, card), {
|
|
5004
|
+
className: clsx49__default.default("side-cards", FeaturedNewsHighlights_module_default["side-cards"]),
|
|
5005
|
+
direction: "horizontal",
|
|
5006
|
+
renderLink
|
|
5007
|
+
}),
|
|
5008
|
+
`${card == null ? void 0 : card.title}-${card == null ? void 0 : card.id}`
|
|
5009
|
+
)) })
|
|
4991
5010
|
] })
|
|
4992
5011
|
] });
|
|
4993
5012
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5568,7 +5587,7 @@ exports.InternalBrandsTab = InternalBrandsTab2;
|
|
|
5568
5587
|
exports.Loader = Loader;
|
|
5569
5588
|
exports.MiniBanner = MiniBanner2;
|
|
5570
5589
|
exports.MiniSectionCta = MiniSectionCta2;
|
|
5571
|
-
exports.Navigation =
|
|
5590
|
+
exports.Navigation = Navigation3;
|
|
5572
5591
|
exports.NewsCard = NewsCard;
|
|
5573
5592
|
exports.NewsCardList = NewsCardList2;
|
|
5574
5593
|
exports.PageLoader = PageLoader2;
|