@digital-b2c/coreui-kit 0.15.0 → 0.15.2
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 +33 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +29 -89
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +33 -19
- package/dist/index.mjs.map +1 -1
- package/dist/types/global.d.ts +25 -25
- package/package.json +101 -100
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
|
@@ -3175,7 +3175,7 @@ var useIsAtTop = () => {
|
|
|
3175
3175
|
|
|
3176
3176
|
// src/widgets/Navigation/Navigation.module.scss
|
|
3177
3177
|
var Navigation_module_default = {
|
|
3178
|
-
|
|
3178
|
+
dropdownTitle: "Navigation_module_dropdownTitle",
|
|
3179
3179
|
mobileItemLink: "Navigation_module_mobileItemLink",
|
|
3180
3180
|
mobileItemTrigger: "Navigation_module_mobileItemTrigger",
|
|
3181
3181
|
mobileSubLink: "Navigation_module_mobileSubLink",
|
|
@@ -3203,6 +3203,7 @@ var Navigation_module_default = {
|
|
|
3203
3203
|
Navigation: "Navigation_module_Navigation",
|
|
3204
3204
|
mainBar: "Navigation_module_mainBar",
|
|
3205
3205
|
navTabLink: "Navigation_module_navTabLink",
|
|
3206
|
+
navTabActive: "Navigation_module_navTabActive",
|
|
3206
3207
|
inner: "Navigation_module_inner",
|
|
3207
3208
|
topRow: "Navigation_module_topRow",
|
|
3208
3209
|
logoLink: "Navigation_module_logoLink",
|
|
@@ -3213,15 +3214,14 @@ var Navigation_module_default = {
|
|
|
3213
3214
|
navTab: "Navigation_module_navTab",
|
|
3214
3215
|
navTabTrigger: "Navigation_module_navTabTrigger",
|
|
3215
3216
|
navTabTriggerOpen: "Navigation_module_navTabTriggerOpen",
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3219
|
-
internalDropdownLinks: "Navigation_module_internalDropdownLinks",
|
|
3217
|
+
dropdownPanel: "Navigation_module_dropdownPanel",
|
|
3218
|
+
dropdownInner: "Navigation_module_dropdownInner",
|
|
3219
|
+
dropdownLinks: "Navigation_module_dropdownLinks",
|
|
3220
3220
|
dropdownLinkItem: "Navigation_module_dropdownLinkItem",
|
|
3221
|
-
|
|
3221
|
+
dropdownLink: "Navigation_module_dropdownLink",
|
|
3222
3222
|
dropdownDivider: "Navigation_module_dropdownDivider",
|
|
3223
|
-
|
|
3224
|
-
|
|
3223
|
+
dropdownInfo: "Navigation_module_dropdownInfo",
|
|
3224
|
+
dropdownDescription: "Navigation_module_dropdownDescription",
|
|
3225
3225
|
brandBars: "Navigation_module_brandBars",
|
|
3226
3226
|
brandBar: "Navigation_module_brandBar",
|
|
3227
3227
|
brandBarsUnfolded: "Navigation_module_brandBarsUnfolded",
|
|
@@ -3411,11 +3411,11 @@ var NavigationDropdown = ({
|
|
|
3411
3411
|
"div",
|
|
3412
3412
|
{
|
|
3413
3413
|
id: panelId,
|
|
3414
|
-
className: clsx47__default.default(Navigation_module_default.
|
|
3414
|
+
className: clsx47__default.default(Navigation_module_default.dropdownPanel, Navigation_module_default.dropdownPanelOpen),
|
|
3415
3415
|
onMouseEnter,
|
|
3416
3416
|
onMouseLeave,
|
|
3417
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.
|
|
3418
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.
|
|
3417
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.dropdownInner, children: [
|
|
3418
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: Navigation_module_default.dropdownLinks, children: links.map((sub, i) => {
|
|
3419
3419
|
var _a, _b, _c, _d;
|
|
3420
3420
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3421
3421
|
"li",
|
|
@@ -3427,7 +3427,7 @@ var NavigationDropdown = ({
|
|
|
3427
3427
|
"a",
|
|
3428
3428
|
{
|
|
3429
3429
|
href: (_a = sub.cta) == null ? void 0 : _a.url,
|
|
3430
|
-
className: Navigation_module_default.
|
|
3430
|
+
className: Navigation_module_default.dropdownLink,
|
|
3431
3431
|
target: ((_b = sub.cta) == null ? void 0 : _b.isExternal) ? "_blank" : void 0,
|
|
3432
3432
|
rel: ((_c = sub.cta) == null ? void 0 : _c.isExternal) ? "noopener noreferrer" : void 0,
|
|
3433
3433
|
onKeyDown: (e) => handleLinkKeyDown(e, i === 0, i === links.length - 1),
|
|
@@ -3439,9 +3439,9 @@ var NavigationDropdown = ({
|
|
|
3439
3439
|
);
|
|
3440
3440
|
}) }),
|
|
3441
3441
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: Navigation_module_default.dropdownDivider, "aria-hidden": "true" }),
|
|
3442
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.
|
|
3443
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: Navigation_module_default.
|
|
3444
|
-
description && /* @__PURE__ */ jsxRuntime.jsx("
|
|
3442
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.dropdownInfo, children: [
|
|
3443
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: Navigation_module_default.dropdownTitle, children: title }),
|
|
3444
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: Navigation_module_default.dropdownDescription, children: description })
|
|
3445
3445
|
] })
|
|
3446
3446
|
] })
|
|
3447
3447
|
}
|
|
@@ -3468,6 +3468,20 @@ var NavigationMobile = ({
|
|
|
3468
3468
|
const toggleExpanded = (index) => {
|
|
3469
3469
|
setExpanded((prev) => prev.includes(index) ? prev.filter((i) => i !== index) : [...prev, index]);
|
|
3470
3470
|
};
|
|
3471
|
+
const expandItem = (index) => {
|
|
3472
|
+
setExpanded((prev) => prev.includes(index) ? prev : [...prev, index]);
|
|
3473
|
+
};
|
|
3474
|
+
const collapseItem = (index) => {
|
|
3475
|
+
setExpanded((prev) => prev.filter((i) => i !== index));
|
|
3476
|
+
};
|
|
3477
|
+
const hoverFocusProps = (index) => ({
|
|
3478
|
+
onMouseEnter: () => expandItem(index),
|
|
3479
|
+
onMouseLeave: () => collapseItem(index),
|
|
3480
|
+
onFocus: () => expandItem(index),
|
|
3481
|
+
onBlur: (e) => {
|
|
3482
|
+
if (!e.currentTarget.contains(e.relatedTarget)) collapseItem(index);
|
|
3483
|
+
}
|
|
3484
|
+
});
|
|
3471
3485
|
const logo = mainLogo ? /* @__PURE__ */ jsxRuntime.jsx(Picture, { className: Navigation_module_default.logoMobile, src: mainLogo, alt: logoAlt }) : null;
|
|
3472
3486
|
if (isExternal) {
|
|
3473
3487
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3506,7 +3520,7 @@ var NavigationMobile = ({
|
|
|
3506
3520
|
var _a, _b;
|
|
3507
3521
|
const subMenuId = `${baseId}-submenu-${index}`;
|
|
3508
3522
|
const isExpanded = expanded.includes(index);
|
|
3509
|
-
return item.type === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsxs("li", { className: Navigation_module_default.mobileItem, children: [
|
|
3523
|
+
return item.type === "dropdown" ? /* @__PURE__ */ jsxRuntime.jsxs("li", __spreadProps(__spreadValues({ className: Navigation_module_default.mobileItem }, hoverFocusProps(index)), { children: [
|
|
3510
3524
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3511
3525
|
"button",
|
|
3512
3526
|
{
|
|
@@ -3552,7 +3566,7 @@ var NavigationMobile = ({
|
|
|
3552
3566
|
) })
|
|
3553
3567
|
}
|
|
3554
3568
|
)
|
|
3555
|
-
] }, index) : /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: (_a = item.cta) == null ? void 0 : _a.url, className: Navigation_module_default.mobileItemLink, onClick: onClose, children: (_b = item.cta) == null ? void 0 : _b.label }) }, index);
|
|
3569
|
+
] }), index) : /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsx("a", { href: (_a = item.cta) == null ? void 0 : _a.url, className: Navigation_module_default.mobileItemLink, onClick: onClose, children: (_b = item.cta) == null ? void 0 : _b.label }) }, index);
|
|
3556
3570
|
}) }),
|
|
3557
3571
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3558
3572
|
NavigationCtas,
|
|
@@ -3614,7 +3628,7 @@ var NavigationMobile = ({
|
|
|
3614
3628
|
}
|
|
3615
3629
|
) }, index);
|
|
3616
3630
|
}
|
|
3617
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("li", { className: Navigation_module_default.internalMobileItem, children: [
|
|
3631
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("li", __spreadProps(__spreadValues({ className: Navigation_module_default.internalMobileItem }, hoverFocusProps(index)), { children: [
|
|
3618
3632
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
3619
3633
|
"button",
|
|
3620
3634
|
{
|
|
@@ -3665,7 +3679,7 @@ var NavigationMobile = ({
|
|
|
3665
3679
|
) })
|
|
3666
3680
|
}
|
|
3667
3681
|
)
|
|
3668
|
-
] }, index);
|
|
3682
|
+
] }), index);
|
|
3669
3683
|
}) }),
|
|
3670
3684
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: Navigation_module_default.mobileFooter, children: [
|
|
3671
3685
|
/* @__PURE__ */ jsxRuntime.jsx(
|