@pathscale/ui 0.0.127 → 0.0.129
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.
|
@@ -3,6 +3,7 @@ import type { IComponentBaseProps } from "../types";
|
|
|
3
3
|
export interface UseImmersiveLandingOptions {
|
|
4
4
|
pages: readonly string[];
|
|
5
5
|
initialPage?: string;
|
|
6
|
+
currentPage?: Accessor<string>;
|
|
6
7
|
transitionDuration?: number;
|
|
7
8
|
onNavigate?: (fromPage: string, toPage: string) => void;
|
|
8
9
|
onNavigationComplete?: (page: string) => void;
|
|
@@ -37,6 +38,7 @@ export interface ImmersiveLandingContextValue {
|
|
|
37
38
|
export interface ImmersiveLandingProps extends IComponentBaseProps {
|
|
38
39
|
pages: readonly string[];
|
|
39
40
|
initialPage?: string;
|
|
41
|
+
currentPage?: Accessor<string>;
|
|
40
42
|
transitionDuration?: number;
|
|
41
43
|
onNavigate?: (fromPage: string, toPage: string) => void;
|
|
42
44
|
onNavigationComplete?: (page: string) => void;
|
|
@@ -26,10 +26,6 @@ export interface LanguageSwitcherProps extends IComponentBaseProps {
|
|
|
26
26
|
* Callback when language changes
|
|
27
27
|
*/
|
|
28
28
|
onLanguageChange?: (lang: string) => void;
|
|
29
|
-
/**
|
|
30
|
-
* Show compact version (language code instead of full name in toggle)
|
|
31
|
-
*/
|
|
32
|
-
compact?: boolean;
|
|
33
29
|
}
|
|
34
30
|
declare const LanguageSwitcher: Component<LanguageSwitcherProps>;
|
|
35
31
|
export default LanguageSwitcher;
|
package/dist/index.js
CHANGED
|
@@ -10623,13 +10623,34 @@ const HeroNamespaces = Object.assign(Hero, {
|
|
|
10623
10623
|
});
|
|
10624
10624
|
const hero_Hero = HeroNamespaces;
|
|
10625
10625
|
function useImmersiveLanding(options) {
|
|
10626
|
-
const { pages, initialPage = pages[0], transitionDuration = 400, onNavigate, onNavigationComplete, enableScrollNavigation = true } = options;
|
|
10627
|
-
const
|
|
10626
|
+
const { pages, initialPage = pages[0], currentPage: controlledPage, transitionDuration = 400, onNavigate, onNavigationComplete, enableScrollNavigation = true } = options;
|
|
10627
|
+
const isControlled = !!controlledPage;
|
|
10628
|
+
const [internalPage, setInternalPage] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(initialPage);
|
|
10628
10629
|
const [isTransitioning, setIsTransitioning] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
10629
10630
|
const [direction, setDirection] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(null);
|
|
10631
|
+
const activePage = isControlled ? controlledPage : internalPage;
|
|
10630
10632
|
const currentIndex = ()=>pages.indexOf(activePage());
|
|
10631
10633
|
const isFirstPage = ()=>0 === currentIndex();
|
|
10632
10634
|
const isLastPage = ()=>currentIndex() === pages.length - 1;
|
|
10635
|
+
if (isControlled) {
|
|
10636
|
+
let prevPage = controlledPage();
|
|
10637
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createEffect)(()=>{
|
|
10638
|
+
const next = controlledPage();
|
|
10639
|
+
if (next !== prevPage && !isTransitioning()) {
|
|
10640
|
+
const fromIndex = pages.indexOf(prevPage);
|
|
10641
|
+
const toIndex = pages.indexOf(next);
|
|
10642
|
+
if (toIndex >= 0) {
|
|
10643
|
+
setDirection(toIndex > fromIndex ? "next" : "prev");
|
|
10644
|
+
setIsTransitioning(true);
|
|
10645
|
+
setTimeout(()=>{
|
|
10646
|
+
setIsTransitioning(false);
|
|
10647
|
+
setDirection(null);
|
|
10648
|
+
}, transitionDuration);
|
|
10649
|
+
}
|
|
10650
|
+
prevPage = next;
|
|
10651
|
+
}
|
|
10652
|
+
});
|
|
10653
|
+
}
|
|
10633
10654
|
const navigateToInternal = (pageId)=>{
|
|
10634
10655
|
if (isTransitioning() || !pages.includes(pageId)) return;
|
|
10635
10656
|
if (pageId === activePage()) return;
|
|
@@ -10638,7 +10659,7 @@ function useImmersiveLanding(options) {
|
|
|
10638
10659
|
const toIndex = pages.indexOf(pageId);
|
|
10639
10660
|
setDirection(toIndex > fromIndex ? "next" : "prev");
|
|
10640
10661
|
setIsTransitioning(true);
|
|
10641
|
-
|
|
10662
|
+
if (!isControlled) setInternalPage(pageId);
|
|
10642
10663
|
if (onNavigate) onNavigate(fromPage, pageId);
|
|
10643
10664
|
setTimeout(()=>{
|
|
10644
10665
|
setIsTransitioning(false);
|
|
@@ -10945,6 +10966,7 @@ const ImmersiveLanding = (props)=>{
|
|
|
10945
10966
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
10946
10967
|
"pages",
|
|
10947
10968
|
"initialPage",
|
|
10969
|
+
"currentPage",
|
|
10948
10970
|
"transitionDuration",
|
|
10949
10971
|
"onNavigate",
|
|
10950
10972
|
"onNavigationComplete",
|
|
@@ -10961,6 +10983,7 @@ const ImmersiveLanding = (props)=>{
|
|
|
10961
10983
|
const navigation = useImmersiveLanding({
|
|
10962
10984
|
pages: local.pages,
|
|
10963
10985
|
initialPage: local.initialPage,
|
|
10986
|
+
currentPage: local.currentPage,
|
|
10964
10987
|
transitionDuration: local.transitionDuration,
|
|
10965
10988
|
onNavigate: local.onNavigate,
|
|
10966
10989
|
onNavigationComplete: local.onNavigationComplete,
|
|
@@ -11636,7 +11659,7 @@ const LiveChatBubble = (props)=>{
|
|
|
11636
11659
|
];
|
|
11637
11660
|
};
|
|
11638
11661
|
const live_chat_LiveChatBubble = LiveChatBubble;
|
|
11639
|
-
var LanguageSwitcher_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)(
|
|
11662
|
+
var LanguageSwitcher_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<span class="text-xs font-bold uppercase"aria-hidden=true>');
|
|
11640
11663
|
const LanguageSwitcher = (props)=>{
|
|
11641
11664
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
11642
11665
|
"i18n",
|
|
@@ -11647,8 +11670,7 @@ const LanguageSwitcher = (props)=>{
|
|
|
11647
11670
|
"currentLanguageLabel",
|
|
11648
11671
|
"optionsLabel",
|
|
11649
11672
|
"loadingLabel",
|
|
11650
|
-
"onLanguageChange"
|
|
11651
|
-
"compact"
|
|
11673
|
+
"onLanguageChange"
|
|
11652
11674
|
]);
|
|
11653
11675
|
const currentLanguageName = ()=>local.i18n.languageNames[local.i18n.locale];
|
|
11654
11676
|
const isSelected = (lang)=>local.i18n.locale === lang;
|
|
@@ -11656,7 +11678,7 @@ const LanguageSwitcher = (props)=>{
|
|
|
11656
11678
|
await local.i18n.setLocale(lang);
|
|
11657
11679
|
local.onLanguageChange?.(lang);
|
|
11658
11680
|
};
|
|
11659
|
-
const classes = ()=>twMerge(
|
|
11681
|
+
const classes = ()=>twMerge(clsx(local.class, local.className));
|
|
11660
11682
|
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
11661
11683
|
get ["class"] () {
|
|
11662
11684
|
return classes();
|
|
@@ -11678,62 +11700,31 @@ const LanguageSwitcher = (props)=>{
|
|
|
11678
11700
|
return `${local.currentLanguageLabel ?? "Current language"}: ${currentLanguageName()}`;
|
|
11679
11701
|
},
|
|
11680
11702
|
get children () {
|
|
11681
|
-
return
|
|
11682
|
-
(
|
|
11683
|
-
|
|
11684
|
-
|
|
11685
|
-
|
|
11686
|
-
|
|
11687
|
-
|
|
11688
|
-
|
|
11689
|
-
|
|
11690
|
-
|
|
11691
|
-
|
|
11692
|
-
|
|
11693
|
-
|
|
11694
|
-
|
|
11695
|
-
|
|
11696
|
-
|
|
11697
|
-
|
|
11698
|
-
|
|
11699
|
-
|
|
11700
|
-
|
|
11701
|
-
|
|
11702
|
-
get ["aria-label"] () {
|
|
11703
|
-
return local.loadingLabel ?? "Loading language";
|
|
11704
|
-
}
|
|
11705
|
-
});
|
|
11706
|
-
},
|
|
11707
|
-
get children () {
|
|
11708
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
11709
|
-
get when () {
|
|
11710
|
-
return !local.compact;
|
|
11711
|
-
},
|
|
11712
|
-
get fallback () {
|
|
11713
|
-
return (()=>{
|
|
11714
|
-
var _el$2 = LanguageSwitcher_tmpl$2();
|
|
11715
|
-
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, ()=>local.i18n.locale.toUpperCase());
|
|
11716
|
-
return _el$2;
|
|
11717
|
-
})();
|
|
11718
|
-
},
|
|
11719
|
-
get children () {
|
|
11720
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(icon_Icon, {
|
|
11721
|
-
name: "icon-[mdi--chevron-down]",
|
|
11722
|
-
width: 16,
|
|
11723
|
-
height: 16,
|
|
11724
|
-
"aria-hidden": "true"
|
|
11725
|
-
});
|
|
11726
|
-
}
|
|
11727
|
-
});
|
|
11728
|
-
}
|
|
11729
|
-
})
|
|
11730
|
-
];
|
|
11703
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.Show, {
|
|
11704
|
+
get when () {
|
|
11705
|
+
return !local.i18n.isLoading;
|
|
11706
|
+
},
|
|
11707
|
+
get fallback () {
|
|
11708
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(icon_Icon, {
|
|
11709
|
+
name: "icon-[mdi--loading]",
|
|
11710
|
+
class: "animate-spin",
|
|
11711
|
+
width: 16,
|
|
11712
|
+
height: 16,
|
|
11713
|
+
get ["aria-label"] () {
|
|
11714
|
+
return local.loadingLabel ?? "Loading language";
|
|
11715
|
+
}
|
|
11716
|
+
});
|
|
11717
|
+
},
|
|
11718
|
+
get children () {
|
|
11719
|
+
var _el$ = LanguageSwitcher_tmpl$();
|
|
11720
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$, ()=>local.i18n.locale.toUpperCase());
|
|
11721
|
+
return _el$;
|
|
11722
|
+
}
|
|
11723
|
+
});
|
|
11731
11724
|
}
|
|
11732
11725
|
}),
|
|
11733
11726
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(dropdown.Menu, {
|
|
11734
|
-
|
|
11735
|
-
return local.compact ? "min-w-32" : "w-full";
|
|
11736
|
-
},
|
|
11727
|
+
class: "min-w-32",
|
|
11737
11728
|
get ["aria-label"] () {
|
|
11738
11729
|
return local.optionsLabel ?? "Language options";
|
|
11739
11730
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.iconify{background-color:currentColor;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%}.iconify,.iconify-color{display:inline-block;height:1em;width:1em}.iconify-color{background-repeat:no-repeat;background-size:100% 100%}.icon-[mdi--
|
|
1
|
+
.iconify{background-color:currentColor;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%}.iconify,.iconify-color{display:inline-block;height:1em;width:1em}.iconify-color{background-repeat:no-repeat;background-size:100% 100%}.icon-[mdi--loading]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M12 4V2A10 10 0 0 0 2 12h2a8 8 0 0 1 8-8'/%3E%3C/svg%3E")}.icon-[mdi--loading].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi--loading].iconify-color{background-image:var(--svg)}.icon-[mdi--palette]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M17.5 12a1.5 1.5 0 0 1-1.5-1.5A1.5 1.5 0 0 1 17.5 9a1.5 1.5 0 0 1 1.5 1.5 1.5 1.5 0 0 1-1.5 1.5m-3-4A1.5 1.5 0 0 1 13 6.5 1.5 1.5 0 0 1 14.5 5 1.5 1.5 0 0 1 16 6.5 1.5 1.5 0 0 1 14.5 8m-5 0A1.5 1.5 0 0 1 8 6.5 1.5 1.5 0 0 1 9.5 5 1.5 1.5 0 0 1 11 6.5 1.5 1.5 0 0 1 9.5 8m-3 4A1.5 1.5 0 0 1 5 10.5 1.5 1.5 0 0 1 6.5 9 1.5 1.5 0 0 1 8 10.5 1.5 1.5 0 0 1 6.5 12M12 3a9 9 0 0 0-9 9 9 9 0 0 0 9 9 1.5 1.5 0 0 0 1.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 0 1 1.5-1.5H16a5 5 0 0 0 5-5c0-4.42-4.03-8-9-8'/%3E%3C/svg%3E")}.icon-[mdi--palette].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi--palette].iconify-color{background-image:var(--svg)}.icon-[mdi-light--chevron-down]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='m5.84 9.59 5.66 5.66 5.66-5.66-.71-.7-4.95 4.95-4.95-4.95z'/%3E%3C/svg%3E")}.icon-[mdi-light--chevron-down].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi-light--chevron-down].iconify-color{background-image:var(--svg)}.icon-[mdi-light--chevron-left]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M14.41 18.16 8.75 12.5l5.66-5.66.7.71-4.95 4.95 4.95 4.95z'/%3E%3C/svg%3E")}.icon-[mdi-light--chevron-left].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi-light--chevron-left].iconify-color{background-image:var(--svg)}.icon-[mdi-light--chevron-right]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='m8.59 18.16 5.66-5.66-5.66-5.66-.7.71 4.95 4.95-4.95 4.95z'/%3E%3C/svg%3E")}.icon-[mdi-light--chevron-right].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi-light--chevron-right].iconify-color{background-image:var(--svg)}.icon-[mdi-light--chevron-up]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='m5.84 15.41 5.66-5.66 5.66 5.66-.71.7-4.95-4.95-4.95 4.95z'/%3E%3C/svg%3E")}.icon-[mdi-light--chevron-up].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi-light--chevron-up].iconify-color{background-image:var(--svg)}.icon-[mdi-light--eye]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M11.5 18c4 0 7.46-2.22 9.24-5.5C18.96 9.22 15.5 7 11.5 7s-7.46 2.22-9.24 5.5C4.04 15.78 7.5 18 11.5 18m0-12c4.56 0 8.5 2.65 10.36 6.5C20 16.35 16.06 19 11.5 19S3 16.35 1.14 12.5C3 8.65 6.94 6 11.5 6m0 2C14 8 16 10 16 12.5S14 17 11.5 17 7 15 7 12.5 9 8 11.5 8m0 1A3.5 3.5 0 0 0 8 12.5a3.5 3.5 0 0 0 3.5 3.5 3.5 3.5 0 0 0 3.5-3.5A3.5 3.5 0 0 0 11.5 9'/%3E%3C/svg%3E")}.icon-[mdi-light--eye].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi-light--eye].iconify-color{background-image:var(--svg)}.icon-[mdi-light--eye-off]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='M2.54 4.71 3.25 4 20 20.75l-.71.71-3.34-3.35c-1.37.57-2.87.89-4.45.89-4.56 0-8.5-2.65-10.36-6.5.97-2 2.49-3.67 4.36-4.82zM11.5 18c1.29 0 2.53-.23 3.67-.66l-1.12-1.13c-.73.5-1.6.79-2.55.79C9 17 7 15 7 12.5c0-.95.29-1.82.79-2.55L6.24 8.41a10.64 10.64 0 0 0-3.98 4.09C4.04 15.78 7.5 18 11.5 18m9.24-5.5C18.96 9.22 15.5 7 11.5 7c-1.15 0-2.27.19-3.31.53l-.78-.78C8.68 6.26 10.06 6 11.5 6c4.56 0 8.5 2.65 10.36 6.5a11.47 11.47 0 0 1-4.07 4.63l-.72-.73c1.53-.96 2.8-2.3 3.67-3.9M11.5 8C14 8 16 10 16 12.5c0 .82-.22 1.58-.6 2.24l-.74-.74c.22-.46.34-.96.34-1.5A3.5 3.5 0 0 0 11.5 9c-.54 0-1.04.12-1.5.34l-.74-.74c.66-.38 1.42-.6 2.24-.6M8 12.5a3.5 3.5 0 0 0 3.5 3.5c.67 0 1.29-.19 1.82-.5L8.5 10.68c-.31.53-.5 1.15-.5 1.82'/%3E%3C/svg%3E")}.icon-[mdi-light--eye-off].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi-light--eye-off].iconify-color{background-image:var(--svg)}.icon-[mdi-light--unfold-more-horizontal]{--svg:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='currentColor' d='m15.74 8.83-.7.71L11.5 6 7.96 9.54l-.7-.71 4.24-4.24zm0 7.34-4.24 4.24-4.24-4.24.7-.71L11.5 19l3.54-3.54z'/%3E%3C/svg%3E")}.icon-[mdi-light--unfold-more-horizontal].iconify{-webkit-mask-image:var(--svg);mask-image:var(--svg)}.icon-[mdi-light--unfold-more-horizontal].iconify-color{background-image:var(--svg)}
|