@enyxs/wikex-components 0.11.47 → 0.11.49
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/README.md +8 -0
- package/dist/index.js +82 -50
- package/dist/index.mjs +82 -50
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -55,6 +55,14 @@ The package has React, Material UI and Emotion as peer dependencies, so the host
|
|
|
55
55
|
|
|
56
56
|
## Release
|
|
57
57
|
|
|
58
|
+
### 0.11.49
|
|
59
|
+
|
|
60
|
+
Desktop header submenus open smoothly when moving straight from one submenu to another: the menu that just opened no longer closes itself because focus returned to the previous trigger. Escape and clicking outside still return focus to the trigger. Submenus fade and slide in (180 ms) and fade out (120 ms), with no motion when reduced motion is requested. No CMS schema or manifest changes. Frontend and backend must pin the same published version.
|
|
61
|
+
|
|
62
|
+
### 0.11.48
|
|
63
|
+
|
|
64
|
+
Header submenu links now match the query string as well as the pathname. Siblings that share a path, such as `/thong-bao/?source=wikex` and `/thong-bao/?source=mxv`, are no longer highlighted together; only the most specific matching link is active, in both the desktop dropdown and the mobile drawer. A parent item stays active on any page under its children's paths. No CMS schema or manifest changes. Frontend and backend must pin the same published version.
|
|
65
|
+
|
|
58
66
|
### 0.11.47
|
|
59
67
|
|
|
60
68
|
Adds per-device CMS layout profiles and independent editable images for the three landing hero metrics. The partner hero includes the broker application form, shared validation, date and address inputs, and localized text. Runtime exports, types, embedded artwork, and the generated CMS manifest ship together. Frontend and backend must pin the same published version.
|
package/dist/index.js
CHANGED
|
@@ -8805,49 +8805,55 @@ var dropIn = (0, import_styled_components5.keyframes)([
|
|
|
8805
8805
|
var dropOut = (0, import_styled_components5.keyframes)([
|
|
8806
8806
|
`from{opacity:1;transform:translateY(0);}to{opacity:0;transform:translateY(-12px);}`
|
|
8807
8807
|
]);
|
|
8808
|
+
var submenuIn = (0, import_styled_components5.keyframes)([
|
|
8809
|
+
`from{opacity:0;transform:translateY(-6px) scale(0.98);}to{opacity:1;transform:translateY(0) scale(1);}`
|
|
8810
|
+
]);
|
|
8811
|
+
var submenuOut = (0, import_styled_components5.keyframes)([
|
|
8812
|
+
`from{opacity:1;transform:translateY(0) scale(1);}to{opacity:0;transform:translateY(-4px) scale(0.98);}`
|
|
8813
|
+
]);
|
|
8808
8814
|
var HeaderShell = import_styled_components5.default.header.withConfig({
|
|
8809
|
-
componentId: "sc-
|
|
8815
|
+
componentId: "sc-4641ea79-0"
|
|
8810
8816
|
})([
|
|
8811
8817
|
`position:sticky;top:0;z-index:100;display:flex;height:64px;padding:12px 20px;align-items:center;justify-content:center;background:`,
|
|
8812
8818
|
`;box-shadow:0 1px 12px rgb(0 0 0 / 4%);:root[data-theme="dark"] &{background:#18181a;}@media (max-width:768px){padding-inline:15px;}@media (max-width:620px){height:62px;padding:16px 16px 12px;box-shadow:0 1px 0 rgb(5 8 15 / 8%);}`
|
|
8813
8819
|
], ({ theme }) => theme.colors.background.canvas);
|
|
8814
8820
|
var HeaderInner = import_styled_components5.default.div.withConfig({
|
|
8815
|
-
componentId: "sc-
|
|
8821
|
+
componentId: "sc-4641ea79-1"
|
|
8816
8822
|
})([
|
|
8817
8823
|
`display:flex;width:100%;max-width:1560px;height:40px;margin:0 auto;align-items:center;gap:32px;@media (max-width:1279px){justify-content:space-between;}@media only screen and (max-width:767px){gap:0;}@media (max-width:620px){height:34px;justify-content:space-between;}`
|
|
8818
8824
|
]);
|
|
8819
8825
|
var BrandGroup = import_styled_components5.default.div.withConfig({
|
|
8820
|
-
componentId: "sc-
|
|
8826
|
+
componentId: "sc-4641ea79-2"
|
|
8821
8827
|
})([
|
|
8822
8828
|
`display:flex;flex:0 0 auto;align-items:center;gap:16px;`
|
|
8823
8829
|
]);
|
|
8824
8830
|
var WikiBrand = (0, import_styled_components5.default)(import_link.default).withConfig({
|
|
8825
|
-
componentId: "sc-
|
|
8831
|
+
componentId: "sc-4641ea79-3"
|
|
8826
8832
|
})([
|
|
8827
8833
|
`display:inline-flex;flex:0 0 auto;align-items:center;`
|
|
8828
8834
|
]);
|
|
8829
8835
|
var WikiLogo = (0, import_styled_components5.default)(import_image.default).withConfig({
|
|
8830
|
-
componentId: "sc-
|
|
8836
|
+
componentId: "sc-4641ea79-4"
|
|
8831
8837
|
})([
|
|
8832
8838
|
`display:block;width:142px;height:auto;@media (max-width:620px){width:84px;}`
|
|
8833
8839
|
]);
|
|
8834
8840
|
var PartnerBrand = import_styled_components5.default.a.withConfig({
|
|
8835
|
-
componentId: "sc-
|
|
8841
|
+
componentId: "sc-4641ea79-5"
|
|
8836
8842
|
})([
|
|
8837
8843
|
`display:inline-flex;align-items:center;gap:7.2px;color:#009ee3;@media (max-width:767px){display:inline-flex;}`
|
|
8838
8844
|
]);
|
|
8839
8845
|
var MxvLogo = (0, import_styled_components5.default)(import_image.default).withConfig({
|
|
8840
|
-
componentId: "sc-
|
|
8846
|
+
componentId: "sc-4641ea79-6"
|
|
8841
8847
|
})([
|
|
8842
8848
|
`display:block;width:95px;height:auto;:root[data-theme="dark"] &{filter:brightness(0) invert(1);}@media (max-width:620px){width:95px;}`
|
|
8843
8849
|
]);
|
|
8844
8850
|
var DesktopNavigation = import_styled_components5.default.nav.withConfig({
|
|
8845
|
-
componentId: "sc-
|
|
8851
|
+
componentId: "sc-4641ea79-7"
|
|
8846
8852
|
})([
|
|
8847
8853
|
`display:flex;align-items:center;gap:16px;@media (max-width:1279px){display:none;}`
|
|
8848
8854
|
]);
|
|
8849
8855
|
var NavigationLink = (0, import_styled_components5.default)(import_link.default).withConfig({
|
|
8850
|
-
componentId: "sc-
|
|
8856
|
+
componentId: "sc-4641ea79-8"
|
|
8851
8857
|
})([
|
|
8852
8858
|
`position:relative;color:`,
|
|
8853
8859
|
`;font-size:14px;font-weight:700;line-height:18px;white-space:nowrap;transition:color 160ms ease;&:hover,&:focus-visible{color:`,
|
|
@@ -8855,59 +8861,61 @@ var NavigationLink = (0, import_styled_components5.default)(import_link.default)
|
|
|
8855
8861
|
`;}@media (min-width:1280px) and (max-width:1439px){font-size:11px;}`
|
|
8856
8862
|
], ({ theme }) => theme.colors.text.secondary, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
|
|
8857
8863
|
var ProductsMenuTrigger = import_styled_components5.default.button.withConfig({
|
|
8858
|
-
componentId: "sc-
|
|
8864
|
+
componentId: "sc-4641ea79-9"
|
|
8859
8865
|
})([
|
|
8860
8866
|
`display:inline-flex;align-items:center;gap:4px;padding:0;border:0;color:`,
|
|
8861
8867
|
`;background:transparent;cursor:pointer;font-family:inherit;font-size:14px;font-weight:700;line-height:18px;white-space:nowrap;&[data-state="open"],&[data-active="true"],&:hover,&:focus-visible{color:`,
|
|
8862
8868
|
`;}&:focus-visible{outline:none;}&::after{content:"";border-inline:3px solid transparent;border-top:4px solid currentColor;transition:transform 160ms ease;}&[data-state="open"]::after{transform:rotate(180deg);}@media (min-width:1280px) and (max-width:1439px){font-size:11px;}@media (prefers-reduced-motion:reduce){&::after{transition:none;}}`
|
|
8863
8869
|
], ({ theme }) => theme.colors.text.secondary, ({ theme }) => theme.colors.accent.primary);
|
|
8864
8870
|
var ProductsMenuContent = (0, import_styled_components5.default)(import_radix_ui2.DropdownMenu.Content).withConfig({
|
|
8865
|
-
componentId: "sc-
|
|
8871
|
+
componentId: "sc-4641ea79-10"
|
|
8866
8872
|
})([
|
|
8867
8873
|
`z-index:300;width:206px;max-width:var(--radix-dropdown-menu-content-available-width);padding:8px;border:1px solid `,
|
|
8868
8874
|
`;border-radius:8px;color:`,
|
|
8869
8875
|
`;background:`,
|
|
8870
8876
|
`;box-shadow:0 4px 8px `,
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8877
|
+
`;transform-origin:var(--radix-dropdown-menu-content-transform-origin);will-change:opacity,transform;&[data-state="open"]{animation:`,
|
|
8878
|
+
` 180ms cubic-bezier(0.16,1,0.3,1);}&[data-state="closed"]{animation:`,
|
|
8879
|
+
` 120ms ease-in forwards;}:root[data-theme="dark"] &{border-color:`,
|
|
8880
|
+
`;}@media (prefers-reduced-motion:reduce){animation:none !important;}`
|
|
8881
|
+
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.popup, ({ theme }) => theme.colors.effect.popupShadow, submenuIn, submenuOut, ({ theme }) => theme.colors.border.subtle);
|
|
8874
8882
|
var ProductsMenuItem = (0, import_styled_components5.default)(import_radix_ui2.DropdownMenu.Item).withConfig({
|
|
8875
|
-
componentId: "sc-
|
|
8883
|
+
componentId: "sc-4641ea79-11"
|
|
8876
8884
|
})([
|
|
8877
8885
|
`display:flex;height:44px;align-items:center;padding:12px 8px;border-radius:4px;cursor:pointer;font-size:14px;font-weight:400;line-height:18px;outline:none;color:inherit;text-decoration:none;&[aria-current="page"],&[data-highlighted],&:focus-visible{color:`,
|
|
8878
8886
|
`;background:transparent;outline:none;}`
|
|
8879
8887
|
], ({ theme }) => theme.colors.accent.primary);
|
|
8880
8888
|
var MobileNavigation2 = import_styled_components5.default.div.withConfig({
|
|
8881
|
-
componentId: "sc-
|
|
8889
|
+
componentId: "sc-4641ea79-12"
|
|
8882
8890
|
})([
|
|
8883
8891
|
`position:relative;display:none;align-items:center;gap:8px;@media (max-width:1279px){display:flex;}@media (max-width:767px){order:3;margin-left:auto;}@media (max-width:620px){gap:2px;}`
|
|
8884
8892
|
]);
|
|
8885
8893
|
var MobileThemeToggle = import_styled_components5.default.div.withConfig({
|
|
8886
|
-
componentId: "sc-
|
|
8894
|
+
componentId: "sc-4641ea79-13"
|
|
8887
8895
|
})([
|
|
8888
8896
|
`display:none;align-items:center;@media (max-width:767px){display:flex;}@media (max-width:620px){&& .theme-toggle--header{border-radius:4px;svg{width:20px;height:20px;}}}`
|
|
8889
8897
|
]);
|
|
8890
8898
|
var MobileLanguageToggle = import_styled_components5.default.div.withConfig({
|
|
8891
|
-
componentId: "sc-
|
|
8899
|
+
componentId: "sc-4641ea79-14"
|
|
8892
8900
|
})([
|
|
8893
8901
|
`display:none;align-items:center;@media (max-width:767px){display:flex;}`
|
|
8894
8902
|
]);
|
|
8895
8903
|
var MobileMenuTrigger = import_styled_components5.default.button.withConfig({
|
|
8896
|
-
componentId: "sc-
|
|
8904
|
+
componentId: "sc-4641ea79-15"
|
|
8897
8905
|
})([
|
|
8898
8906
|
`display:inline-flex;width:42px;height:42px;align-items:center;justify-content:center;border:0;border-radius:9999px;color:`,
|
|
8899
8907
|
`;background:transparent;cursor:pointer;transition:background-color 160ms ease;&:hover,&[data-state="open"]{background:`,
|
|
8900
8908
|
`;}@media (max-width:620px){width:24px;height:24px;border-radius:4px;svg{flex-shrink:0;}}`
|
|
8901
8909
|
], ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.hover);
|
|
8902
8910
|
var MobileDrawerOverlay = (0, import_styled_components5.default)(import_radix_ui2.Dialog.Overlay).withConfig({
|
|
8903
|
-
componentId: "sc-
|
|
8911
|
+
componentId: "sc-4641ea79-16"
|
|
8904
8912
|
})([
|
|
8905
8913
|
`position:fixed;z-index:200;inset:0;background:rgb(0 0 0 / 48%);backdrop-filter:blur(2px);&[data-state="open"]{animation:`,
|
|
8906
8914
|
` 220ms ease-out;}&[data-state="closed"]{animation:`,
|
|
8907
8915
|
` 180ms ease-in;}@media (prefers-reduced-motion:reduce){animation:none;}@media (max-width:767px){top:var(--header-height);background:rgb(5 8 16 / 40%);backdrop-filter:blur(5px);}`
|
|
8908
8916
|
], fadeIn, fadeOut);
|
|
8909
8917
|
var MobileDrawerContent = (0, import_styled_components5.default)(import_radix_ui2.Dialog.Content).withConfig({
|
|
8910
|
-
componentId: "sc-
|
|
8918
|
+
componentId: "sc-4641ea79-17"
|
|
8911
8919
|
})([
|
|
8912
8920
|
`position:fixed;z-index:201;top:0;right:0;width:320px;max-width:calc(100% - 24px);height:100vh;padding:20px;overflow-y:auto;color:`,
|
|
8913
8921
|
`;background:`,
|
|
@@ -8918,29 +8926,29 @@ var MobileDrawerContent = (0, import_styled_components5.default)(import_radix_ui
|
|
|
8918
8926
|
` 180ms ease-in;}}`
|
|
8919
8927
|
], ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.canvas, slideIn, slideOut, dropIn, dropOut);
|
|
8920
8928
|
var MobileDrawerHeader = import_styled_components5.default.div.withConfig({
|
|
8921
|
-
componentId: "sc-
|
|
8929
|
+
componentId: "sc-4641ea79-18"
|
|
8922
8930
|
})([
|
|
8923
8931
|
`display:flex;min-height:44px;margin-bottom:24px;align-items:center;justify-content:space-between;gap:16px;@media (max-width:767px){display:none;}`
|
|
8924
8932
|
]);
|
|
8925
8933
|
var MobileDrawerTitle = (0, import_styled_components5.default)(import_radix_ui2.Dialog.Title).withConfig({
|
|
8926
|
-
componentId: "sc-
|
|
8934
|
+
componentId: "sc-4641ea79-19"
|
|
8927
8935
|
})([
|
|
8928
8936
|
`margin:0;font-size:20px;font-weight:700;line-height:28px;`
|
|
8929
8937
|
]);
|
|
8930
8938
|
var MobileDrawerClose = (0, import_styled_components5.default)(import_radix_ui2.Dialog.Close).withConfig({
|
|
8931
|
-
componentId: "sc-
|
|
8939
|
+
componentId: "sc-4641ea79-20"
|
|
8932
8940
|
})([
|
|
8933
8941
|
`display:inline-flex;width:40px;height:40px;flex:0 0 40px;align-items:center;justify-content:center;border:0;border-radius:50%;color:`,
|
|
8934
8942
|
`;background:transparent;cursor:pointer;&:hover{background:`,
|
|
8935
8943
|
`;}`
|
|
8936
8944
|
], ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.hover);
|
|
8937
8945
|
var MobileDrawerActions = import_styled_components5.default.div.withConfig({
|
|
8938
|
-
componentId: "sc-
|
|
8946
|
+
componentId: "sc-4641ea79-21"
|
|
8939
8947
|
})([
|
|
8940
8948
|
`display:none;@media (max-width:767px){display:grid;width:100%;margin-bottom:8px;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}`
|
|
8941
8949
|
]);
|
|
8942
8950
|
var MobileMenuPanel = import_styled_components5.default.nav.withConfig({
|
|
8943
|
-
componentId: "sc-
|
|
8951
|
+
componentId: "sc-4641ea79-22"
|
|
8944
8952
|
})([
|
|
8945
8953
|
`display:flex;flex-direction:column;gap:6px;a,button{width:100%;border:0;display:flex;border-radius:8px;padding:14px 12px;color:`,
|
|
8946
8954
|
`;background:transparent;cursor:pointer;font-family:inherit;font-size:14px;font-weight:600;text-align:left;transition:color 160ms ease,background-color 160ms ease;}a:hover,a:focus-visible,button:not(:disabled):hover,button:not(:disabled):focus-visible{color:`,
|
|
@@ -8949,72 +8957,72 @@ var MobileMenuPanel = import_styled_components5.default.nav.withConfig({
|
|
|
8949
8957
|
`;}.mobile-menu-submenu a{padding-left:28px;font-size:13px;font-weight:500;}.mobile-products-chevron{display:inline-flex;transition:transform 160ms ease;}.mobile-menu-accordion-trigger[aria-expanded="true"] .mobile-products-chevron{transform:rotate(180deg);}@media (max-width:767px){gap:0;a,button{display:flex;min-height:42px;align-items:center;justify-content:space-between;padding:12px;font-weight:700;line-height:18px;}a[data-accent="true"]{color:#f9bb3a;}.mobile-menu-submenu a{min-height:34px;padding:7px 12px 7px 28px;font-size:14px;font-weight:500;}.mobile-menu-login{display:none;}svg{width:18px;height:18px;flex:0 0 18px;}}@media (prefers-reduced-motion:reduce){.mobile-products-chevron{transition:none;}}`
|
|
8950
8958
|
], ({ theme }) => theme.colors.text.secondary, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.hover, ({ theme }) => theme.colors.accent.primary);
|
|
8951
8959
|
var RightActions = import_styled_components5.default.div.withConfig({
|
|
8952
|
-
componentId: "sc-
|
|
8960
|
+
componentId: "sc-4641ea79-23"
|
|
8953
8961
|
})([
|
|
8954
8962
|
`display:flex;margin-left:auto;align-items:center;gap:12px;& > div{display:flex;align-items:center;gap:8px;}@media (max-width:1279px){display:none;}`
|
|
8955
8963
|
]);
|
|
8956
8964
|
var IconButton2 = import_styled_components5.default.button.withConfig({
|
|
8957
|
-
componentId: "sc-
|
|
8965
|
+
componentId: "sc-4641ea79-24"
|
|
8958
8966
|
})([
|
|
8959
8967
|
`display:inline-flex;width:36px;height:36px;flex:0 0 auto;align-items:center;justify-content:center;border:0;border-radius:8px;color:`,
|
|
8960
8968
|
`;background:transparent;cursor:pointer;transition:background-color 160ms ease;svg{width:24px;height:24px;}&:hover{background:`,
|
|
8961
8969
|
`;}@media (max-width:480px){display:none;}`
|
|
8962
8970
|
], ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.hover);
|
|
8963
8971
|
var LanguageTrigger = (0, import_styled_components5.default)(IconButton2).withConfig({
|
|
8964
|
-
componentId: "sc-
|
|
8972
|
+
componentId: "sc-4641ea79-25"
|
|
8965
8973
|
})([
|
|
8966
8974
|
`&[data-state="open"]{color:#f9bb3a;background:`,
|
|
8967
8975
|
`;}@media (max-width:767px){display:inline-flex;}@media (max-width:620px){border-radius:4px;svg{width:20px;height:20px;flex-shrink:0;}}`
|
|
8968
8976
|
], ({ theme }) => theme.colors.background.hover);
|
|
8969
8977
|
var LanguageMenuContent = (0, import_styled_components5.default)(import_radix_ui2.DropdownMenu.Content).withConfig({
|
|
8970
|
-
componentId: "sc-
|
|
8978
|
+
componentId: "sc-4641ea79-26"
|
|
8971
8979
|
})([
|
|
8972
8980
|
`z-index:300;width:180px;padding:8px;border:1px solid #e6e7ea;border-radius:12px;color:#05080f;background:#f9fafb;box-shadow:0 4px 8px rgb(5 8 16 / 5%);outline:none;transform-origin:var(--radix-dropdown-menu-content-transform-origin);&[data-state="open"]{animation:`,
|
|
8973
8981
|
` 140ms ease-out;}&[data-state="closed"]{animation:`,
|
|
8974
8982
|
` 100ms ease-in;}:root[data-theme="dark"] &{border-color:#48484a;color:#f2f2f7;background:#2c2c2e;box-shadow:0 4px 12px rgb(0 0 0 / 24%);}&[data-compact="true"]{width:148px;padding:6px;}@media (prefers-reduced-motion:reduce){animation:none;}`
|
|
8975
8983
|
], fadeIn, fadeOut);
|
|
8976
8984
|
var LanguageMenuItem = (0, import_styled_components5.default)(import_radix_ui2.DropdownMenu.RadioItem).withConfig({
|
|
8977
|
-
componentId: "sc-
|
|
8985
|
+
componentId: "sc-4641ea79-27"
|
|
8978
8986
|
})([
|
|
8979
8987
|
`display:flex;width:100%;height:46px;padding:12px 8px;align-items:center;gap:8px;border-radius:8px;cursor:pointer;font-size:16px;font-weight:500;line-height:22px;outline:none;user-select:none;&[data-highlighted]{background:#f1f2f4;}:root[data-theme="dark"] &[data-highlighted]{background:#3a3a3c;}`,
|
|
8980
8988
|
`[data-compact="true"] &{height:40px;padding:10px 6px;font-size:14px;line-height:18px;}`
|
|
8981
8989
|
], LanguageMenuContent);
|
|
8982
8990
|
var LanguageFlag = import_styled_components5.default.span.withConfig({
|
|
8983
|
-
componentId: "sc-
|
|
8991
|
+
componentId: "sc-4641ea79-28"
|
|
8984
8992
|
})([
|
|
8985
8993
|
`display:inline-flex;width:20px;height:20px;flex:0 0 20px;overflow:hidden;align-items:center;justify-content:center;border-radius:50%;img{width:100%;height:100%;max-width:none;object-fit:cover;}`
|
|
8986
8994
|
]);
|
|
8987
8995
|
var LanguageItemIndicator = (0, import_styled_components5.default)(import_radix_ui2.DropdownMenu.ItemIndicator).withConfig({
|
|
8988
|
-
componentId: "sc-
|
|
8996
|
+
componentId: "sc-4641ea79-29"
|
|
8989
8997
|
})([
|
|
8990
8998
|
`display:inline-flex;width:18px;height:18px;margin-left:auto;flex:0 0 18px;align-items:center;justify-content:center;img{display:block;width:18px;height:18px;}`,
|
|
8991
8999
|
`[data-compact="true"] &,`,
|
|
8992
9000
|
`[data-compact="true"] & img{width:16px;height:16px;flex-basis:16px;}`
|
|
8993
9001
|
], LanguageMenuContent, LanguageMenuContent);
|
|
8994
9002
|
var ActionDivider = import_styled_components5.default.span.withConfig({
|
|
8995
|
-
componentId: "sc-
|
|
9003
|
+
componentId: "sc-4641ea79-30"
|
|
8996
9004
|
})([
|
|
8997
9005
|
`width:1px;height:16px;background:`,
|
|
8998
9006
|
`;@media (max-width:608px){display:none;}`
|
|
8999
9007
|
], ({ theme }) => theme.colors.border.line);
|
|
9000
9008
|
var LoginLink = import_styled_components5.default.a.withConfig({
|
|
9001
|
-
componentId: "sc-
|
|
9009
|
+
componentId: "sc-4641ea79-31"
|
|
9002
9010
|
})([
|
|
9003
9011
|
`display:inline-flex;text-decoration:none;height:40px;align-items:center;justify-content:center;border:1px solid #d2d5da;border-radius:6px;padding:0 16px;color:#05080f;background:transparent;font-size:14px;font-weight:700;line-height:18px;white-space:nowrap;transition:background-color 160ms ease,border-color 160ms ease;:root[data-theme="dark"] &{color:#fafafa;}&:not([aria-disabled="true"]):hover{background:`,
|
|
9004
9012
|
`;}&[aria-disabled="true"]{cursor:not-allowed;opacity:0.55;}@media (max-width:608px){display:none;}`
|
|
9005
9013
|
], ({ theme }) => theme.colors.background.hover);
|
|
9006
9014
|
var OpenAccountButton = (0, import_styled_components5.default)(Button_default2).withConfig({
|
|
9007
|
-
componentId: "sc-
|
|
9015
|
+
componentId: "sc-4641ea79-32"
|
|
9008
9016
|
})([
|
|
9009
9017
|
`width:120px;height:40px;min-height:40px;border-radius:6px;padding:0;box-shadow:0 1px 20px rgb(249 187 58 / 60%);font-family:var(--font-inter),sans-serif;font-size:14px;font-weight:600;line-height:22px;white-space:nowrap;&:hover{&::before{opacity:0.8;}}&::before{content:"";position:absolute;left:50%;bottom:0;margin-left:-49px;width:98px;height:22px;background:#ffe492;filter:blur(10px);pointer-events:none;opacity:0;transition:opacity 0.15s linear;}@media (max-width:767px){display:none;}`
|
|
9010
9018
|
]);
|
|
9011
9019
|
var MobileDrawerLoginButton = (0, import_styled_components5.default)(LoginLink).withConfig({
|
|
9012
|
-
componentId: "sc-
|
|
9020
|
+
componentId: "sc-4641ea79-33"
|
|
9013
9021
|
})([
|
|
9014
9022
|
`display:none;@media (max-width:767px){display:inline-flex;width:100%;min-width:0;padding-inline:12px;&:disabled{opacity:1;}}`
|
|
9015
9023
|
]);
|
|
9016
9024
|
var MobileDrawerOpenAccountButton = (0, import_styled_components5.default)(OpenAccountButton).withConfig({
|
|
9017
|
-
componentId: "sc-
|
|
9025
|
+
componentId: "sc-4641ea79-34"
|
|
9018
9026
|
})([
|
|
9019
9027
|
`display:none;@media (max-width:767px){display:flex;width:100%;min-width:0;}`
|
|
9020
9028
|
]);
|
|
@@ -16633,6 +16641,29 @@ function Footer() {
|
|
|
16633
16641
|
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Shell, { as: "div", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(LandingFooter, {}) });
|
|
16634
16642
|
}
|
|
16635
16643
|
|
|
16644
|
+
// src/commodity-original/components/Header/active-links.ts
|
|
16645
|
+
var normalizePath = (path) => path.replace(/\/+$/, "") || "/";
|
|
16646
|
+
function isRouteActive(pathname, href) {
|
|
16647
|
+
const route = normalizePath(href.split(/[?#]/)[0]);
|
|
16648
|
+
if (route === "/comming-soon") return false;
|
|
16649
|
+
const current = normalizePath(pathname);
|
|
16650
|
+
return current === route || current.startsWith(`${route}/`);
|
|
16651
|
+
}
|
|
16652
|
+
function linkMatchScore(pathname, searchParams, href) {
|
|
16653
|
+
if (!isRouteActive(pathname, href)) return -1;
|
|
16654
|
+
let score = 0;
|
|
16655
|
+
for (const [key, value4] of new URLSearchParams(href.split("#")[0].split("?")[1] ?? "")) {
|
|
16656
|
+
if (searchParams.get(key) !== value4) return -1;
|
|
16657
|
+
score += 1;
|
|
16658
|
+
}
|
|
16659
|
+
return score;
|
|
16660
|
+
}
|
|
16661
|
+
function activeChildIndexes(pathname, searchParams, children) {
|
|
16662
|
+
const scores = children.map((child) => child.linkDisabled ? -1 : linkMatchScore(pathname, searchParams, child.href));
|
|
16663
|
+
const best = Math.max(-1, ...scores);
|
|
16664
|
+
return new Set(best < 0 ? [] : scores.flatMap((score, index) => score === best ? [index] : []));
|
|
16665
|
+
}
|
|
16666
|
+
|
|
16636
16667
|
// src/commodity-original/components/Header/index.tsx
|
|
16637
16668
|
var import_react39 = require("react");
|
|
16638
16669
|
var import_image9 = __toESM(require("next/image.js"));
|
|
@@ -16786,12 +16817,9 @@ function LanguageSwitcher({
|
|
|
16786
16817
|
}
|
|
16787
16818
|
function Header() {
|
|
16788
16819
|
const pathname = (0, import_navigation3.usePathname)().replace(/\/+$/, "") || "/";
|
|
16789
|
-
const
|
|
16790
|
-
const
|
|
16791
|
-
|
|
16792
|
-
if (route === "/comming-soon") return false;
|
|
16793
|
-
return pathname === route || pathname.startsWith(`${route}/`);
|
|
16794
|
-
};
|
|
16820
|
+
const searchParams = (0, import_navigation3.useSearchParams)();
|
|
16821
|
+
const isRouteActive2 = (href) => isRouteActive(pathname, href);
|
|
16822
|
+
const activeChildIndexes2 = (children) => activeChildIndexes(pathname, searchParams, children);
|
|
16795
16823
|
const [portalContainer, setPortalContainer] = (0, import_react39.useState)(null);
|
|
16796
16824
|
const setHeaderRef = (0, import_react39.useCallback)((element) => {
|
|
16797
16825
|
setPortalContainer(element);
|
|
@@ -16863,8 +16891,7 @@ function Header() {
|
|
|
16863
16891
|
label: child.label ?? "",
|
|
16864
16892
|
href: chromeItemHref(child) ?? "#",
|
|
16865
16893
|
labelKey: `header.menuItems.${index}.children.${childIndex}.label`,
|
|
16866
|
-
index: childIndex
|
|
16867
|
-
category: new URL(chromeItemHref(child) || "/", "https://wikex.invalid").searchParams.get("category")
|
|
16894
|
+
index: childIndex
|
|
16868
16895
|
}))
|
|
16869
16896
|
}));
|
|
16870
16897
|
const scrollToPendingMobileSection = () => {
|
|
@@ -16937,7 +16964,8 @@ function Header() {
|
|
|
16937
16964
|
)
|
|
16938
16965
|
] }),
|
|
16939
16966
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(DesktopNavigation, { "aria-label": t("header.navigation"), children: resolvedNavigationItems.map((item) => {
|
|
16940
|
-
const isItemActive = item.children.length > 0 ? item.children.some((child) =>
|
|
16967
|
+
const isItemActive = item.children.length > 0 ? item.children.some((child) => isRouteActive2(child.href)) : isRouteActive2(item.href);
|
|
16968
|
+
const activeChildren = activeChildIndexes2(item.children);
|
|
16941
16969
|
if (item.children.length > 0) {
|
|
16942
16970
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
16943
16971
|
import_radix_ui5.DropdownMenu.Root,
|
|
@@ -16960,12 +16988,15 @@ function Header() {
|
|
|
16960
16988
|
ProductsMenuContent,
|
|
16961
16989
|
{
|
|
16962
16990
|
onInteractOutside: keepEditorToolbarOpen,
|
|
16991
|
+
onCloseAutoFocus: (event) => {
|
|
16992
|
+
if (isDesktopProductsOpen !== null) event.preventDefault();
|
|
16993
|
+
},
|
|
16963
16994
|
align: "center",
|
|
16964
16995
|
sideOffset: 10,
|
|
16965
16996
|
"aria-label": item.label,
|
|
16966
16997
|
children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ProductsMenuItem, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(ExactText, { cmsAs: import_link7.default, cmsField: child.labelKey, ...chromeItemAttributes(language, "header.menuItems", child.index, item.index), href: child.href, "aria-disabled": child.linkDisabled || void 0, onClick: (event) => {
|
|
16967
16998
|
if (child.linkDisabled) event.preventDefault();
|
|
16968
|
-
}, "aria-current":
|
|
16999
|
+
}, "aria-current": activeChildren.has(child.index) ? "page" : void 0, children: child.label }) }, child.labelKey))
|
|
16969
17000
|
}
|
|
16970
17001
|
) })
|
|
16971
17002
|
]
|
|
@@ -17095,7 +17126,8 @@ function Header() {
|
|
|
17095
17126
|
] }),
|
|
17096
17127
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(MobileMenuPanel, { "aria-label": t("header.mobileNavigation"), children: [
|
|
17097
17128
|
resolvedNavigationItems.map((item) => {
|
|
17098
|
-
const isItemActive = item.children.length > 0 ? item.children.some((child) =>
|
|
17129
|
+
const isItemActive = item.children.length > 0 ? item.children.some((child) => isRouteActive2(child.href)) : isRouteActive2(item.href);
|
|
17130
|
+
const activeChildren = activeChildIndexes2(item.children);
|
|
17099
17131
|
if (item.children.length > 0) {
|
|
17100
17132
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "mobile-menu-group", ...chromeItemAttributes(language, "header.menuItems", item.index), children: [
|
|
17101
17133
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
@@ -17148,7 +17180,7 @@ function Header() {
|
|
|
17148
17180
|
cmsField: child.labelKey,
|
|
17149
17181
|
...chromeItemAttributes(language, "header.menuItems", child.index, item.index),
|
|
17150
17182
|
href: child.href,
|
|
17151
|
-
"aria-current":
|
|
17183
|
+
"aria-current": activeChildren.has(child.index) ? "page" : void 0,
|
|
17152
17184
|
key: child.labelKey,
|
|
17153
17185
|
"aria-disabled": child.linkDisabled || void 0,
|
|
17154
17186
|
onClick: (event) => {
|
package/dist/index.mjs
CHANGED
|
@@ -8724,49 +8724,55 @@ var dropIn = keyframes([
|
|
|
8724
8724
|
var dropOut = keyframes([
|
|
8725
8725
|
`from{opacity:1;transform:translateY(0);}to{opacity:0;transform:translateY(-12px);}`
|
|
8726
8726
|
]);
|
|
8727
|
+
var submenuIn = keyframes([
|
|
8728
|
+
`from{opacity:0;transform:translateY(-6px) scale(0.98);}to{opacity:1;transform:translateY(0) scale(1);}`
|
|
8729
|
+
]);
|
|
8730
|
+
var submenuOut = keyframes([
|
|
8731
|
+
`from{opacity:1;transform:translateY(0) scale(1);}to{opacity:0;transform:translateY(-4px) scale(0.98);}`
|
|
8732
|
+
]);
|
|
8727
8733
|
var HeaderShell = styled5.header.withConfig({
|
|
8728
|
-
componentId: "sc-
|
|
8734
|
+
componentId: "sc-4641ea79-0"
|
|
8729
8735
|
})([
|
|
8730
8736
|
`position:sticky;top:0;z-index:100;display:flex;height:64px;padding:12px 20px;align-items:center;justify-content:center;background:`,
|
|
8731
8737
|
`;box-shadow:0 1px 12px rgb(0 0 0 / 4%);:root[data-theme="dark"] &{background:#18181a;}@media (max-width:768px){padding-inline:15px;}@media (max-width:620px){height:62px;padding:16px 16px 12px;box-shadow:0 1px 0 rgb(5 8 15 / 8%);}`
|
|
8732
8738
|
], ({ theme }) => theme.colors.background.canvas);
|
|
8733
8739
|
var HeaderInner = styled5.div.withConfig({
|
|
8734
|
-
componentId: "sc-
|
|
8740
|
+
componentId: "sc-4641ea79-1"
|
|
8735
8741
|
})([
|
|
8736
8742
|
`display:flex;width:100%;max-width:1560px;height:40px;margin:0 auto;align-items:center;gap:32px;@media (max-width:1279px){justify-content:space-between;}@media only screen and (max-width:767px){gap:0;}@media (max-width:620px){height:34px;justify-content:space-between;}`
|
|
8737
8743
|
]);
|
|
8738
8744
|
var BrandGroup = styled5.div.withConfig({
|
|
8739
|
-
componentId: "sc-
|
|
8745
|
+
componentId: "sc-4641ea79-2"
|
|
8740
8746
|
})([
|
|
8741
8747
|
`display:flex;flex:0 0 auto;align-items:center;gap:16px;`
|
|
8742
8748
|
]);
|
|
8743
8749
|
var WikiBrand = styled5(Link3).withConfig({
|
|
8744
|
-
componentId: "sc-
|
|
8750
|
+
componentId: "sc-4641ea79-3"
|
|
8745
8751
|
})([
|
|
8746
8752
|
`display:inline-flex;flex:0 0 auto;align-items:center;`
|
|
8747
8753
|
]);
|
|
8748
8754
|
var WikiLogo = styled5(Image).withConfig({
|
|
8749
|
-
componentId: "sc-
|
|
8755
|
+
componentId: "sc-4641ea79-4"
|
|
8750
8756
|
})([
|
|
8751
8757
|
`display:block;width:142px;height:auto;@media (max-width:620px){width:84px;}`
|
|
8752
8758
|
]);
|
|
8753
8759
|
var PartnerBrand = styled5.a.withConfig({
|
|
8754
|
-
componentId: "sc-
|
|
8760
|
+
componentId: "sc-4641ea79-5"
|
|
8755
8761
|
})([
|
|
8756
8762
|
`display:inline-flex;align-items:center;gap:7.2px;color:#009ee3;@media (max-width:767px){display:inline-flex;}`
|
|
8757
8763
|
]);
|
|
8758
8764
|
var MxvLogo = styled5(Image).withConfig({
|
|
8759
|
-
componentId: "sc-
|
|
8765
|
+
componentId: "sc-4641ea79-6"
|
|
8760
8766
|
})([
|
|
8761
8767
|
`display:block;width:95px;height:auto;:root[data-theme="dark"] &{filter:brightness(0) invert(1);}@media (max-width:620px){width:95px;}`
|
|
8762
8768
|
]);
|
|
8763
8769
|
var DesktopNavigation = styled5.nav.withConfig({
|
|
8764
|
-
componentId: "sc-
|
|
8770
|
+
componentId: "sc-4641ea79-7"
|
|
8765
8771
|
})([
|
|
8766
8772
|
`display:flex;align-items:center;gap:16px;@media (max-width:1279px){display:none;}`
|
|
8767
8773
|
]);
|
|
8768
8774
|
var NavigationLink = styled5(Link3).withConfig({
|
|
8769
|
-
componentId: "sc-
|
|
8775
|
+
componentId: "sc-4641ea79-8"
|
|
8770
8776
|
})([
|
|
8771
8777
|
`position:relative;color:`,
|
|
8772
8778
|
`;font-size:14px;font-weight:700;line-height:18px;white-space:nowrap;transition:color 160ms ease;&:hover,&:focus-visible{color:`,
|
|
@@ -8774,59 +8780,61 @@ var NavigationLink = styled5(Link3).withConfig({
|
|
|
8774
8780
|
`;}@media (min-width:1280px) and (max-width:1439px){font-size:11px;}`
|
|
8775
8781
|
], ({ theme }) => theme.colors.text.secondary, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.accent.primary);
|
|
8776
8782
|
var ProductsMenuTrigger = styled5.button.withConfig({
|
|
8777
|
-
componentId: "sc-
|
|
8783
|
+
componentId: "sc-4641ea79-9"
|
|
8778
8784
|
})([
|
|
8779
8785
|
`display:inline-flex;align-items:center;gap:4px;padding:0;border:0;color:`,
|
|
8780
8786
|
`;background:transparent;cursor:pointer;font-family:inherit;font-size:14px;font-weight:700;line-height:18px;white-space:nowrap;&[data-state="open"],&[data-active="true"],&:hover,&:focus-visible{color:`,
|
|
8781
8787
|
`;}&:focus-visible{outline:none;}&::after{content:"";border-inline:3px solid transparent;border-top:4px solid currentColor;transition:transform 160ms ease;}&[data-state="open"]::after{transform:rotate(180deg);}@media (min-width:1280px) and (max-width:1439px){font-size:11px;}@media (prefers-reduced-motion:reduce){&::after{transition:none;}}`
|
|
8782
8788
|
], ({ theme }) => theme.colors.text.secondary, ({ theme }) => theme.colors.accent.primary);
|
|
8783
8789
|
var ProductsMenuContent = styled5(DropdownMenu.Content).withConfig({
|
|
8784
|
-
componentId: "sc-
|
|
8790
|
+
componentId: "sc-4641ea79-10"
|
|
8785
8791
|
})([
|
|
8786
8792
|
`z-index:300;width:206px;max-width:var(--radix-dropdown-menu-content-available-width);padding:8px;border:1px solid `,
|
|
8787
8793
|
`;border-radius:8px;color:`,
|
|
8788
8794
|
`;background:`,
|
|
8789
8795
|
`;box-shadow:0 4px 8px `,
|
|
8790
|
-
|
|
8791
|
-
|
|
8792
|
-
|
|
8796
|
+
`;transform-origin:var(--radix-dropdown-menu-content-transform-origin);will-change:opacity,transform;&[data-state="open"]{animation:`,
|
|
8797
|
+
` 180ms cubic-bezier(0.16,1,0.3,1);}&[data-state="closed"]{animation:`,
|
|
8798
|
+
` 120ms ease-in forwards;}:root[data-theme="dark"] &{border-color:`,
|
|
8799
|
+
`;}@media (prefers-reduced-motion:reduce){animation:none !important;}`
|
|
8800
|
+
], ({ theme }) => theme.colors.border.line, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.popup, ({ theme }) => theme.colors.effect.popupShadow, submenuIn, submenuOut, ({ theme }) => theme.colors.border.subtle);
|
|
8793
8801
|
var ProductsMenuItem = styled5(DropdownMenu.Item).withConfig({
|
|
8794
|
-
componentId: "sc-
|
|
8802
|
+
componentId: "sc-4641ea79-11"
|
|
8795
8803
|
})([
|
|
8796
8804
|
`display:flex;height:44px;align-items:center;padding:12px 8px;border-radius:4px;cursor:pointer;font-size:14px;font-weight:400;line-height:18px;outline:none;color:inherit;text-decoration:none;&[aria-current="page"],&[data-highlighted],&:focus-visible{color:`,
|
|
8797
8805
|
`;background:transparent;outline:none;}`
|
|
8798
8806
|
], ({ theme }) => theme.colors.accent.primary);
|
|
8799
8807
|
var MobileNavigation2 = styled5.div.withConfig({
|
|
8800
|
-
componentId: "sc-
|
|
8808
|
+
componentId: "sc-4641ea79-12"
|
|
8801
8809
|
})([
|
|
8802
8810
|
`position:relative;display:none;align-items:center;gap:8px;@media (max-width:1279px){display:flex;}@media (max-width:767px){order:3;margin-left:auto;}@media (max-width:620px){gap:2px;}`
|
|
8803
8811
|
]);
|
|
8804
8812
|
var MobileThemeToggle = styled5.div.withConfig({
|
|
8805
|
-
componentId: "sc-
|
|
8813
|
+
componentId: "sc-4641ea79-13"
|
|
8806
8814
|
})([
|
|
8807
8815
|
`display:none;align-items:center;@media (max-width:767px){display:flex;}@media (max-width:620px){&& .theme-toggle--header{border-radius:4px;svg{width:20px;height:20px;}}}`
|
|
8808
8816
|
]);
|
|
8809
8817
|
var MobileLanguageToggle = styled5.div.withConfig({
|
|
8810
|
-
componentId: "sc-
|
|
8818
|
+
componentId: "sc-4641ea79-14"
|
|
8811
8819
|
})([
|
|
8812
8820
|
`display:none;align-items:center;@media (max-width:767px){display:flex;}`
|
|
8813
8821
|
]);
|
|
8814
8822
|
var MobileMenuTrigger = styled5.button.withConfig({
|
|
8815
|
-
componentId: "sc-
|
|
8823
|
+
componentId: "sc-4641ea79-15"
|
|
8816
8824
|
})([
|
|
8817
8825
|
`display:inline-flex;width:42px;height:42px;align-items:center;justify-content:center;border:0;border-radius:9999px;color:`,
|
|
8818
8826
|
`;background:transparent;cursor:pointer;transition:background-color 160ms ease;&:hover,&[data-state="open"]{background:`,
|
|
8819
8827
|
`;}@media (max-width:620px){width:24px;height:24px;border-radius:4px;svg{flex-shrink:0;}}`
|
|
8820
8828
|
], ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.hover);
|
|
8821
8829
|
var MobileDrawerOverlay = styled5(Dialog.Overlay).withConfig({
|
|
8822
|
-
componentId: "sc-
|
|
8830
|
+
componentId: "sc-4641ea79-16"
|
|
8823
8831
|
})([
|
|
8824
8832
|
`position:fixed;z-index:200;inset:0;background:rgb(0 0 0 / 48%);backdrop-filter:blur(2px);&[data-state="open"]{animation:`,
|
|
8825
8833
|
` 220ms ease-out;}&[data-state="closed"]{animation:`,
|
|
8826
8834
|
` 180ms ease-in;}@media (prefers-reduced-motion:reduce){animation:none;}@media (max-width:767px){top:var(--header-height);background:rgb(5 8 16 / 40%);backdrop-filter:blur(5px);}`
|
|
8827
8835
|
], fadeIn, fadeOut);
|
|
8828
8836
|
var MobileDrawerContent = styled5(Dialog.Content).withConfig({
|
|
8829
|
-
componentId: "sc-
|
|
8837
|
+
componentId: "sc-4641ea79-17"
|
|
8830
8838
|
})([
|
|
8831
8839
|
`position:fixed;z-index:201;top:0;right:0;width:320px;max-width:calc(100% - 24px);height:100vh;padding:20px;overflow-y:auto;color:`,
|
|
8832
8840
|
`;background:`,
|
|
@@ -8837,29 +8845,29 @@ var MobileDrawerContent = styled5(Dialog.Content).withConfig({
|
|
|
8837
8845
|
` 180ms ease-in;}}`
|
|
8838
8846
|
], ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.canvas, slideIn, slideOut, dropIn, dropOut);
|
|
8839
8847
|
var MobileDrawerHeader = styled5.div.withConfig({
|
|
8840
|
-
componentId: "sc-
|
|
8848
|
+
componentId: "sc-4641ea79-18"
|
|
8841
8849
|
})([
|
|
8842
8850
|
`display:flex;min-height:44px;margin-bottom:24px;align-items:center;justify-content:space-between;gap:16px;@media (max-width:767px){display:none;}`
|
|
8843
8851
|
]);
|
|
8844
8852
|
var MobileDrawerTitle = styled5(Dialog.Title).withConfig({
|
|
8845
|
-
componentId: "sc-
|
|
8853
|
+
componentId: "sc-4641ea79-19"
|
|
8846
8854
|
})([
|
|
8847
8855
|
`margin:0;font-size:20px;font-weight:700;line-height:28px;`
|
|
8848
8856
|
]);
|
|
8849
8857
|
var MobileDrawerClose = styled5(Dialog.Close).withConfig({
|
|
8850
|
-
componentId: "sc-
|
|
8858
|
+
componentId: "sc-4641ea79-20"
|
|
8851
8859
|
})([
|
|
8852
8860
|
`display:inline-flex;width:40px;height:40px;flex:0 0 40px;align-items:center;justify-content:center;border:0;border-radius:50%;color:`,
|
|
8853
8861
|
`;background:transparent;cursor:pointer;&:hover{background:`,
|
|
8854
8862
|
`;}`
|
|
8855
8863
|
], ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.hover);
|
|
8856
8864
|
var MobileDrawerActions = styled5.div.withConfig({
|
|
8857
|
-
componentId: "sc-
|
|
8865
|
+
componentId: "sc-4641ea79-21"
|
|
8858
8866
|
})([
|
|
8859
8867
|
`display:none;@media (max-width:767px){display:grid;width:100%;margin-bottom:8px;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;}`
|
|
8860
8868
|
]);
|
|
8861
8869
|
var MobileMenuPanel = styled5.nav.withConfig({
|
|
8862
|
-
componentId: "sc-
|
|
8870
|
+
componentId: "sc-4641ea79-22"
|
|
8863
8871
|
})([
|
|
8864
8872
|
`display:flex;flex-direction:column;gap:6px;a,button{width:100%;border:0;display:flex;border-radius:8px;padding:14px 12px;color:`,
|
|
8865
8873
|
`;background:transparent;cursor:pointer;font-family:inherit;font-size:14px;font-weight:600;text-align:left;transition:color 160ms ease,background-color 160ms ease;}a:hover,a:focus-visible,button:not(:disabled):hover,button:not(:disabled):focus-visible{color:`,
|
|
@@ -8868,72 +8876,72 @@ var MobileMenuPanel = styled5.nav.withConfig({
|
|
|
8868
8876
|
`;}.mobile-menu-submenu a{padding-left:28px;font-size:13px;font-weight:500;}.mobile-products-chevron{display:inline-flex;transition:transform 160ms ease;}.mobile-menu-accordion-trigger[aria-expanded="true"] .mobile-products-chevron{transform:rotate(180deg);}@media (max-width:767px){gap:0;a,button{display:flex;min-height:42px;align-items:center;justify-content:space-between;padding:12px;font-weight:700;line-height:18px;}a[data-accent="true"]{color:#f9bb3a;}.mobile-menu-submenu a{min-height:34px;padding:7px 12px 7px 28px;font-size:14px;font-weight:500;}.mobile-menu-login{display:none;}svg{width:18px;height:18px;flex:0 0 18px;}}@media (prefers-reduced-motion:reduce){.mobile-products-chevron{transition:none;}}`
|
|
8869
8877
|
], ({ theme }) => theme.colors.text.secondary, ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.hover, ({ theme }) => theme.colors.accent.primary);
|
|
8870
8878
|
var RightActions = styled5.div.withConfig({
|
|
8871
|
-
componentId: "sc-
|
|
8879
|
+
componentId: "sc-4641ea79-23"
|
|
8872
8880
|
})([
|
|
8873
8881
|
`display:flex;margin-left:auto;align-items:center;gap:12px;& > div{display:flex;align-items:center;gap:8px;}@media (max-width:1279px){display:none;}`
|
|
8874
8882
|
]);
|
|
8875
8883
|
var IconButton2 = styled5.button.withConfig({
|
|
8876
|
-
componentId: "sc-
|
|
8884
|
+
componentId: "sc-4641ea79-24"
|
|
8877
8885
|
})([
|
|
8878
8886
|
`display:inline-flex;width:36px;height:36px;flex:0 0 auto;align-items:center;justify-content:center;border:0;border-radius:8px;color:`,
|
|
8879
8887
|
`;background:transparent;cursor:pointer;transition:background-color 160ms ease;svg{width:24px;height:24px;}&:hover{background:`,
|
|
8880
8888
|
`;}@media (max-width:480px){display:none;}`
|
|
8881
8889
|
], ({ theme }) => theme.colors.text.primary, ({ theme }) => theme.colors.background.hover);
|
|
8882
8890
|
var LanguageTrigger = styled5(IconButton2).withConfig({
|
|
8883
|
-
componentId: "sc-
|
|
8891
|
+
componentId: "sc-4641ea79-25"
|
|
8884
8892
|
})([
|
|
8885
8893
|
`&[data-state="open"]{color:#f9bb3a;background:`,
|
|
8886
8894
|
`;}@media (max-width:767px){display:inline-flex;}@media (max-width:620px){border-radius:4px;svg{width:20px;height:20px;flex-shrink:0;}}`
|
|
8887
8895
|
], ({ theme }) => theme.colors.background.hover);
|
|
8888
8896
|
var LanguageMenuContent = styled5(DropdownMenu.Content).withConfig({
|
|
8889
|
-
componentId: "sc-
|
|
8897
|
+
componentId: "sc-4641ea79-26"
|
|
8890
8898
|
})([
|
|
8891
8899
|
`z-index:300;width:180px;padding:8px;border:1px solid #e6e7ea;border-radius:12px;color:#05080f;background:#f9fafb;box-shadow:0 4px 8px rgb(5 8 16 / 5%);outline:none;transform-origin:var(--radix-dropdown-menu-content-transform-origin);&[data-state="open"]{animation:`,
|
|
8892
8900
|
` 140ms ease-out;}&[data-state="closed"]{animation:`,
|
|
8893
8901
|
` 100ms ease-in;}:root[data-theme="dark"] &{border-color:#48484a;color:#f2f2f7;background:#2c2c2e;box-shadow:0 4px 12px rgb(0 0 0 / 24%);}&[data-compact="true"]{width:148px;padding:6px;}@media (prefers-reduced-motion:reduce){animation:none;}`
|
|
8894
8902
|
], fadeIn, fadeOut);
|
|
8895
8903
|
var LanguageMenuItem = styled5(DropdownMenu.RadioItem).withConfig({
|
|
8896
|
-
componentId: "sc-
|
|
8904
|
+
componentId: "sc-4641ea79-27"
|
|
8897
8905
|
})([
|
|
8898
8906
|
`display:flex;width:100%;height:46px;padding:12px 8px;align-items:center;gap:8px;border-radius:8px;cursor:pointer;font-size:16px;font-weight:500;line-height:22px;outline:none;user-select:none;&[data-highlighted]{background:#f1f2f4;}:root[data-theme="dark"] &[data-highlighted]{background:#3a3a3c;}`,
|
|
8899
8907
|
`[data-compact="true"] &{height:40px;padding:10px 6px;font-size:14px;line-height:18px;}`
|
|
8900
8908
|
], LanguageMenuContent);
|
|
8901
8909
|
var LanguageFlag = styled5.span.withConfig({
|
|
8902
|
-
componentId: "sc-
|
|
8910
|
+
componentId: "sc-4641ea79-28"
|
|
8903
8911
|
})([
|
|
8904
8912
|
`display:inline-flex;width:20px;height:20px;flex:0 0 20px;overflow:hidden;align-items:center;justify-content:center;border-radius:50%;img{width:100%;height:100%;max-width:none;object-fit:cover;}`
|
|
8905
8913
|
]);
|
|
8906
8914
|
var LanguageItemIndicator = styled5(DropdownMenu.ItemIndicator).withConfig({
|
|
8907
|
-
componentId: "sc-
|
|
8915
|
+
componentId: "sc-4641ea79-29"
|
|
8908
8916
|
})([
|
|
8909
8917
|
`display:inline-flex;width:18px;height:18px;margin-left:auto;flex:0 0 18px;align-items:center;justify-content:center;img{display:block;width:18px;height:18px;}`,
|
|
8910
8918
|
`[data-compact="true"] &,`,
|
|
8911
8919
|
`[data-compact="true"] & img{width:16px;height:16px;flex-basis:16px;}`
|
|
8912
8920
|
], LanguageMenuContent, LanguageMenuContent);
|
|
8913
8921
|
var ActionDivider = styled5.span.withConfig({
|
|
8914
|
-
componentId: "sc-
|
|
8922
|
+
componentId: "sc-4641ea79-30"
|
|
8915
8923
|
})([
|
|
8916
8924
|
`width:1px;height:16px;background:`,
|
|
8917
8925
|
`;@media (max-width:608px){display:none;}`
|
|
8918
8926
|
], ({ theme }) => theme.colors.border.line);
|
|
8919
8927
|
var LoginLink = styled5.a.withConfig({
|
|
8920
|
-
componentId: "sc-
|
|
8928
|
+
componentId: "sc-4641ea79-31"
|
|
8921
8929
|
})([
|
|
8922
8930
|
`display:inline-flex;text-decoration:none;height:40px;align-items:center;justify-content:center;border:1px solid #d2d5da;border-radius:6px;padding:0 16px;color:#05080f;background:transparent;font-size:14px;font-weight:700;line-height:18px;white-space:nowrap;transition:background-color 160ms ease,border-color 160ms ease;:root[data-theme="dark"] &{color:#fafafa;}&:not([aria-disabled="true"]):hover{background:`,
|
|
8923
8931
|
`;}&[aria-disabled="true"]{cursor:not-allowed;opacity:0.55;}@media (max-width:608px){display:none;}`
|
|
8924
8932
|
], ({ theme }) => theme.colors.background.hover);
|
|
8925
8933
|
var OpenAccountButton = styled5(Button_default2).withConfig({
|
|
8926
|
-
componentId: "sc-
|
|
8934
|
+
componentId: "sc-4641ea79-32"
|
|
8927
8935
|
})([
|
|
8928
8936
|
`width:120px;height:40px;min-height:40px;border-radius:6px;padding:0;box-shadow:0 1px 20px rgb(249 187 58 / 60%);font-family:var(--font-inter),sans-serif;font-size:14px;font-weight:600;line-height:22px;white-space:nowrap;&:hover{&::before{opacity:0.8;}}&::before{content:"";position:absolute;left:50%;bottom:0;margin-left:-49px;width:98px;height:22px;background:#ffe492;filter:blur(10px);pointer-events:none;opacity:0;transition:opacity 0.15s linear;}@media (max-width:767px){display:none;}`
|
|
8929
8937
|
]);
|
|
8930
8938
|
var MobileDrawerLoginButton = styled5(LoginLink).withConfig({
|
|
8931
|
-
componentId: "sc-
|
|
8939
|
+
componentId: "sc-4641ea79-33"
|
|
8932
8940
|
})([
|
|
8933
8941
|
`display:none;@media (max-width:767px){display:inline-flex;width:100%;min-width:0;padding-inline:12px;&:disabled{opacity:1;}}`
|
|
8934
8942
|
]);
|
|
8935
8943
|
var MobileDrawerOpenAccountButton = styled5(OpenAccountButton).withConfig({
|
|
8936
|
-
componentId: "sc-
|
|
8944
|
+
componentId: "sc-4641ea79-34"
|
|
8937
8945
|
})([
|
|
8938
8946
|
`display:none;@media (max-width:767px){display:flex;width:100%;min-width:0;}`
|
|
8939
8947
|
]);
|
|
@@ -16560,6 +16568,29 @@ function Footer() {
|
|
|
16560
16568
|
return /* @__PURE__ */ jsx57(Shell, { as: "div", children: /* @__PURE__ */ jsx57(LandingFooter, {}) });
|
|
16561
16569
|
}
|
|
16562
16570
|
|
|
16571
|
+
// src/commodity-original/components/Header/active-links.ts
|
|
16572
|
+
var normalizePath = (path) => path.replace(/\/+$/, "") || "/";
|
|
16573
|
+
function isRouteActive(pathname, href) {
|
|
16574
|
+
const route = normalizePath(href.split(/[?#]/)[0]);
|
|
16575
|
+
if (route === "/comming-soon") return false;
|
|
16576
|
+
const current = normalizePath(pathname);
|
|
16577
|
+
return current === route || current.startsWith(`${route}/`);
|
|
16578
|
+
}
|
|
16579
|
+
function linkMatchScore(pathname, searchParams, href) {
|
|
16580
|
+
if (!isRouteActive(pathname, href)) return -1;
|
|
16581
|
+
let score = 0;
|
|
16582
|
+
for (const [key, value4] of new URLSearchParams(href.split("#")[0].split("?")[1] ?? "")) {
|
|
16583
|
+
if (searchParams.get(key) !== value4) return -1;
|
|
16584
|
+
score += 1;
|
|
16585
|
+
}
|
|
16586
|
+
return score;
|
|
16587
|
+
}
|
|
16588
|
+
function activeChildIndexes(pathname, searchParams, children) {
|
|
16589
|
+
const scores = children.map((child) => child.linkDisabled ? -1 : linkMatchScore(pathname, searchParams, child.href));
|
|
16590
|
+
const best = Math.max(-1, ...scores);
|
|
16591
|
+
return new Set(best < 0 ? [] : scores.flatMap((score, index) => score === best ? [index] : []));
|
|
16592
|
+
}
|
|
16593
|
+
|
|
16563
16594
|
// src/commodity-original/components/Header/index.tsx
|
|
16564
16595
|
import { useCallback as useCallback3, useEffect as useEffect11, useRef as useRef12, useState as useState19 } from "react";
|
|
16565
16596
|
import Image9 from "next/image.js";
|
|
@@ -16713,12 +16744,9 @@ function LanguageSwitcher({
|
|
|
16713
16744
|
}
|
|
16714
16745
|
function Header() {
|
|
16715
16746
|
const pathname = usePathname2().replace(/\/+$/, "") || "/";
|
|
16716
|
-
const
|
|
16717
|
-
const
|
|
16718
|
-
|
|
16719
|
-
if (route === "/comming-soon") return false;
|
|
16720
|
-
return pathname === route || pathname.startsWith(`${route}/`);
|
|
16721
|
-
};
|
|
16747
|
+
const searchParams = useSearchParams();
|
|
16748
|
+
const isRouteActive2 = (href) => isRouteActive(pathname, href);
|
|
16749
|
+
const activeChildIndexes2 = (children) => activeChildIndexes(pathname, searchParams, children);
|
|
16722
16750
|
const [portalContainer, setPortalContainer] = useState19(null);
|
|
16723
16751
|
const setHeaderRef = useCallback3((element) => {
|
|
16724
16752
|
setPortalContainer(element);
|
|
@@ -16790,8 +16818,7 @@ function Header() {
|
|
|
16790
16818
|
label: child.label ?? "",
|
|
16791
16819
|
href: chromeItemHref(child) ?? "#",
|
|
16792
16820
|
labelKey: `header.menuItems.${index}.children.${childIndex}.label`,
|
|
16793
|
-
index: childIndex
|
|
16794
|
-
category: new URL(chromeItemHref(child) || "/", "https://wikex.invalid").searchParams.get("category")
|
|
16821
|
+
index: childIndex
|
|
16795
16822
|
}))
|
|
16796
16823
|
}));
|
|
16797
16824
|
const scrollToPendingMobileSection = () => {
|
|
@@ -16864,7 +16891,8 @@ function Header() {
|
|
|
16864
16891
|
)
|
|
16865
16892
|
] }),
|
|
16866
16893
|
/* @__PURE__ */ jsx58(DesktopNavigation, { "aria-label": t("header.navigation"), children: resolvedNavigationItems.map((item) => {
|
|
16867
|
-
const isItemActive = item.children.length > 0 ? item.children.some((child) =>
|
|
16894
|
+
const isItemActive = item.children.length > 0 ? item.children.some((child) => isRouteActive2(child.href)) : isRouteActive2(item.href);
|
|
16895
|
+
const activeChildren = activeChildIndexes2(item.children);
|
|
16868
16896
|
if (item.children.length > 0) {
|
|
16869
16897
|
return /* @__PURE__ */ jsxs46(
|
|
16870
16898
|
DropdownMenu2.Root,
|
|
@@ -16887,12 +16915,15 @@ function Header() {
|
|
|
16887
16915
|
ProductsMenuContent,
|
|
16888
16916
|
{
|
|
16889
16917
|
onInteractOutside: keepEditorToolbarOpen,
|
|
16918
|
+
onCloseAutoFocus: (event) => {
|
|
16919
|
+
if (isDesktopProductsOpen !== null) event.preventDefault();
|
|
16920
|
+
},
|
|
16890
16921
|
align: "center",
|
|
16891
16922
|
sideOffset: 10,
|
|
16892
16923
|
"aria-label": item.label,
|
|
16893
16924
|
children: item.children.map((child) => /* @__PURE__ */ jsx58(ProductsMenuItem, { asChild: true, children: /* @__PURE__ */ jsx58(ExactText, { cmsAs: Link9, cmsField: child.labelKey, ...chromeItemAttributes(language, "header.menuItems", child.index, item.index), href: child.href, "aria-disabled": child.linkDisabled || void 0, onClick: (event) => {
|
|
16894
16925
|
if (child.linkDisabled) event.preventDefault();
|
|
16895
|
-
}, "aria-current":
|
|
16926
|
+
}, "aria-current": activeChildren.has(child.index) ? "page" : void 0, children: child.label }) }, child.labelKey))
|
|
16896
16927
|
}
|
|
16897
16928
|
) })
|
|
16898
16929
|
]
|
|
@@ -17022,7 +17053,8 @@ function Header() {
|
|
|
17022
17053
|
] }),
|
|
17023
17054
|
/* @__PURE__ */ jsxs46(MobileMenuPanel, { "aria-label": t("header.mobileNavigation"), children: [
|
|
17024
17055
|
resolvedNavigationItems.map((item) => {
|
|
17025
|
-
const isItemActive = item.children.length > 0 ? item.children.some((child) =>
|
|
17056
|
+
const isItemActive = item.children.length > 0 ? item.children.some((child) => isRouteActive2(child.href)) : isRouteActive2(item.href);
|
|
17057
|
+
const activeChildren = activeChildIndexes2(item.children);
|
|
17026
17058
|
if (item.children.length > 0) {
|
|
17027
17059
|
return /* @__PURE__ */ jsxs46("div", { className: "mobile-menu-group", ...chromeItemAttributes(language, "header.menuItems", item.index), children: [
|
|
17028
17060
|
/* @__PURE__ */ jsxs46(
|
|
@@ -17075,7 +17107,7 @@ function Header() {
|
|
|
17075
17107
|
cmsField: child.labelKey,
|
|
17076
17108
|
...chromeItemAttributes(language, "header.menuItems", child.index, item.index),
|
|
17077
17109
|
href: child.href,
|
|
17078
|
-
"aria-current":
|
|
17110
|
+
"aria-current": activeChildren.has(child.index) ? "page" : void 0,
|
|
17079
17111
|
key: child.labelKey,
|
|
17080
17112
|
"aria-disabled": child.linkDisabled || void 0,
|
|
17081
17113
|
onClick: (event) => {
|