@pathscale/ui 0.0.88 → 0.0.89
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.
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Component } from "solid-js";
|
|
2
|
+
import type { IComponentBaseProps } from "../types";
|
|
3
|
+
export interface BottomSheetProps extends IComponentBaseProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
children?: any;
|
|
7
|
+
closeOnOverlayClick?: boolean;
|
|
8
|
+
closeOnSwipeDown?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const BottomSheet: Component<BottomSheetProps>;
|
|
11
|
+
export default BottomSheet;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,8 @@ export { default as Background } from "./components/background";
|
|
|
6
6
|
export { default as Badge } from "./components/badge";
|
|
7
7
|
export { Breadcrumbs, BreadcrumbsItem } from "./components/breadcrumbs";
|
|
8
8
|
export { default as BrowserMockup, type BrowserMockupProps, } from "./components/browsermockup";
|
|
9
|
+
export { default as BottomSheet } from "./components/bottom-sheet/BottomSheet";
|
|
10
|
+
export type { BottomSheetProps } from "./components/bottom-sheet/BottomSheet";
|
|
9
11
|
export { default as Button } from "./components/button";
|
|
10
12
|
export { default as Calendar, type CalendarProps } from "./components/calendar";
|
|
11
13
|
export { default as Card } from "./components/card";
|
package/dist/index.js
CHANGED
|
@@ -4119,6 +4119,110 @@ const BrowserMockup = (props)=>{
|
|
|
4119
4119
|
})();
|
|
4120
4120
|
};
|
|
4121
4121
|
const browsermockup_BrowserMockup = BrowserMockup;
|
|
4122
|
+
var BottomSheet_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>"), BottomSheet_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div><div class=p-4><div class="w-12 h-1 bg-base-content/30 rounded-full mx-auto mb-4">');
|
|
4123
|
+
const BottomSheet = (props)=>{
|
|
4124
|
+
const merged = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.mergeProps)({
|
|
4125
|
+
closeOnOverlayClick: true,
|
|
4126
|
+
closeOnSwipeDown: true
|
|
4127
|
+
}, props);
|
|
4128
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(merged, [
|
|
4129
|
+
"isOpen",
|
|
4130
|
+
"onClose",
|
|
4131
|
+
"children",
|
|
4132
|
+
"dataTheme",
|
|
4133
|
+
"class",
|
|
4134
|
+
"className",
|
|
4135
|
+
"style",
|
|
4136
|
+
"closeOnOverlayClick",
|
|
4137
|
+
"closeOnSwipeDown"
|
|
4138
|
+
]);
|
|
4139
|
+
const [isDragging, setIsDragging] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(false);
|
|
4140
|
+
const [startY, setStartY] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(0);
|
|
4141
|
+
const [currentY, setCurrentY] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.createSignal)(0);
|
|
4142
|
+
let sheetRef;
|
|
4143
|
+
let overlayRef;
|
|
4144
|
+
const handleTouchStart = (e)=>{
|
|
4145
|
+
if (!local.closeOnSwipeDown) return;
|
|
4146
|
+
const touchY = e.touches[0].clientY;
|
|
4147
|
+
const sheetTop = sheetRef?.getBoundingClientRect().top || 0;
|
|
4148
|
+
if (touchY - sheetTop < 50) {
|
|
4149
|
+
setIsDragging(true);
|
|
4150
|
+
setStartY(touchY);
|
|
4151
|
+
setCurrentY(touchY);
|
|
4152
|
+
}
|
|
4153
|
+
};
|
|
4154
|
+
const handleTouchMove = (e)=>{
|
|
4155
|
+
if (!isDragging()) return;
|
|
4156
|
+
const deltaY = e.touches[0].clientY - startY();
|
|
4157
|
+
const newY = Math.max(0, deltaY);
|
|
4158
|
+
setCurrentY(e.touches[0].clientY);
|
|
4159
|
+
if (sheetRef) sheetRef.style.transform = `translateY(${newY}px)`;
|
|
4160
|
+
e.preventDefault();
|
|
4161
|
+
};
|
|
4162
|
+
const handleTouchEnd = ()=>{
|
|
4163
|
+
if (!isDragging()) return;
|
|
4164
|
+
setIsDragging(false);
|
|
4165
|
+
const deltaY = currentY() - startY();
|
|
4166
|
+
if (deltaY > 100) local.onClose();
|
|
4167
|
+
else if (sheetRef) sheetRef.style.transform = "translateY(0)";
|
|
4168
|
+
};
|
|
4169
|
+
const handleOverlayClick = (e)=>{
|
|
4170
|
+
if (local.closeOnOverlayClick && e.target === overlayRef) local.onClose();
|
|
4171
|
+
};
|
|
4172
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
4173
|
+
if (sheetRef && local.closeOnSwipeDown) {
|
|
4174
|
+
sheetRef.addEventListener("touchstart", handleTouchStart, {
|
|
4175
|
+
passive: true
|
|
4176
|
+
});
|
|
4177
|
+
sheetRef.addEventListener("touchmove", handleTouchMove, {
|
|
4178
|
+
passive: false
|
|
4179
|
+
});
|
|
4180
|
+
sheetRef.addEventListener("touchend", handleTouchEnd, {
|
|
4181
|
+
passive: true
|
|
4182
|
+
});
|
|
4183
|
+
}
|
|
4184
|
+
});
|
|
4185
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
4186
|
+
if (sheetRef) {
|
|
4187
|
+
sheetRef.removeEventListener("touchstart", handleTouchStart);
|
|
4188
|
+
sheetRef.removeEventListener("touchmove", handleTouchMove);
|
|
4189
|
+
sheetRef.removeEventListener("touchend", handleTouchEnd);
|
|
4190
|
+
}
|
|
4191
|
+
});
|
|
4192
|
+
return [
|
|
4193
|
+
(()=>{
|
|
4194
|
+
var _el$ = BottomSheet_tmpl$();
|
|
4195
|
+
_el$.$$click = handleOverlayClick;
|
|
4196
|
+
var _ref$ = overlayRef;
|
|
4197
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : overlayRef = _el$;
|
|
4198
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.effect)(()=>(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.className)(_el$, clsx("fixed inset-0 bg-base-100 bg-opacity-60 z-40 transition-opacity duration-200", local.isOpen ? "opacity-100" : "opacity-0 pointer-events-none")));
|
|
4199
|
+
return _el$;
|
|
4200
|
+
})(),
|
|
4201
|
+
(()=>{
|
|
4202
|
+
var _el$2 = BottomSheet_tmpl$2(), _el$3 = _el$2.firstChild;
|
|
4203
|
+
_el$3.firstChild;
|
|
4204
|
+
var _ref$2 = sheetRef;
|
|
4205
|
+
"function" == typeof _ref$2 ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$2, _el$2) : sheetRef = _el$2;
|
|
4206
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$2, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
4207
|
+
get ["class"] () {
|
|
4208
|
+
return clsx("bg-base-300 text-base-content fixed bottom-0 left-0 right-0 rounded-t-2xl shadow-lg z-50 transition-transform duration-300 ease-out", local.isOpen ? "translate-y-0" : "translate-y-full");
|
|
4209
|
+
},
|
|
4210
|
+
get style () {
|
|
4211
|
+
return {
|
|
4212
|
+
transform: isDragging() ? `translateY(${Math.max(0, currentY() - startY())}px)` : void 0,
|
|
4213
|
+
...local.style
|
|
4214
|
+
};
|
|
4215
|
+
}
|
|
4216
|
+
}, others), false, true);
|
|
4217
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, ()=>local.children, null);
|
|
4218
|
+
return _el$2;
|
|
4219
|
+
})()
|
|
4220
|
+
];
|
|
4221
|
+
};
|
|
4222
|
+
const bottom_sheet_BottomSheet = BottomSheet;
|
|
4223
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.delegateEvents)([
|
|
4224
|
+
"click"
|
|
4225
|
+
]);
|
|
4122
4226
|
var Loading_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<span>");
|
|
4123
4227
|
const Loading = (props)=>{
|
|
4124
4228
|
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
@@ -4263,7 +4367,8 @@ const Button = (props)=>{
|
|
|
4263
4367
|
"btn-xs sm:btn-sm md:btn-md lg:btn-lg": local.responsive,
|
|
4264
4368
|
"no-animation": !local.animation,
|
|
4265
4369
|
"btn-active": local.active,
|
|
4266
|
-
"btn-disabled": local.disabled
|
|
4370
|
+
"btn-disabled": local.disabled,
|
|
4371
|
+
"cursor-not-allowed": local.disabled
|
|
4267
4372
|
}), local.class, local.className);
|
|
4268
4373
|
const Tag = local.as || "button";
|
|
4269
4374
|
if (Button_VoidElementList.includes(Tag)) return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(__WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.Dynamic, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)({
|
|
@@ -11915,4 +12020,4 @@ const WindowMockup = (props)=>{
|
|
|
11915
12020
|
})();
|
|
11916
12021
|
};
|
|
11917
12022
|
const windowmockup_WindowMockup = WindowMockup;
|
|
11918
|
-
export { accordion_Accordion as Accordion, alert_Alert as Alert, artboard_Artboard as Artboard, avatar as Avatar, background_Background as Background, Badge, Breadcrumbs, breadcrumbs_BreadcrumbsItem as BreadcrumbsItem, browsermockup_BrowserMockup as BrowserMockup, button_Button as Button, Calendar, card_Card as Card, carousel_Carousel as Carousel, chatbubble_ChatBubble as ChatBubble, checkbox_Checkbox as Checkbox, codemockup_CodeMockup as CodeMockup, CodeMockupLine, collapse_Collapse as Collapse, CollapseContent, CollapseDetails, CollapseTitle, connectionstatus_ConnectionStatus as ConnectionStatus, CopyButton, countdown_Countdown as Countdown, diff_Diff as Diff, divider as Divider, dock as Dock, Drawer, dropdown as Dropdown, FileInput, flex_Flex as Flex, footer_Footer as Footer, form_Form as Form, Grid, hero_Hero as Hero, icon_Icon as Icon, indicator_Indicator as Indicator, input as Input, join_Join as Join, kbd_Kbd as Kbd, link_Link as Link, loading_Loading as Loading, mask as Mask, menu_Menu as Menu, modal_Modal as Modal, navbar_Navbar as Navbar, pagination_Pagination as Pagination, phonemockup_PhoneMockup as PhoneMockup, Progress, props_table_PropsTable as PropsTable, radialprogress_RadialProgress as RadialProgress, radio_Radio as Radio, range_Range as Range, Rating, select_Select as Select, showcase_ShowcaseBlock as ShowcaseBlock, showcase_section_ShowcaseSection as ShowcaseSection, sidenav_Sidenav as Sidenav, sidenav_SidenavButton as SidenavButton, sidenav_SidenavGroup as SidenavGroup, sidenav_SidenavItem as SidenavItem, sidenav_SidenavLink as SidenavLink, sidenav_SidenavMenu as SidenavMenu, skeleton_Skeleton as Skeleton, Stack, stat_card_StatCard as StatCard, stats_Stats as Stats, status_Status as Status, steps as Steps, Summary, SvgBackground, Swap, table_Table as Table, tabs_Tabs as Tabs, textarea_Textarea as Textarea, Timeline, timeline_TimelineEnd as TimelineEnd, timeline_TimelineItem as TimelineItem, timeline_TimelineMiddle as TimelineMiddle, timeline_TimelineStart as TimelineStart, toast_Toast as Toast, ToastContainer, toggle_Toggle as Toggle, tooltip_Tooltip as Tooltip, windowmockup_WindowMockup as WindowMockup, connectionstatus_ConnectionStatus as default, toastStore, useDesktop, useFormValidation };
|
|
12023
|
+
export { accordion_Accordion as Accordion, alert_Alert as Alert, artboard_Artboard as Artboard, avatar as Avatar, background_Background as Background, Badge, bottom_sheet_BottomSheet as BottomSheet, Breadcrumbs, breadcrumbs_BreadcrumbsItem as BreadcrumbsItem, browsermockup_BrowserMockup as BrowserMockup, button_Button as Button, Calendar, card_Card as Card, carousel_Carousel as Carousel, chatbubble_ChatBubble as ChatBubble, checkbox_Checkbox as Checkbox, codemockup_CodeMockup as CodeMockup, CodeMockupLine, collapse_Collapse as Collapse, CollapseContent, CollapseDetails, CollapseTitle, connectionstatus_ConnectionStatus as ConnectionStatus, CopyButton, countdown_Countdown as Countdown, diff_Diff as Diff, divider as Divider, dock as Dock, Drawer, dropdown as Dropdown, FileInput, flex_Flex as Flex, footer_Footer as Footer, form_Form as Form, Grid, hero_Hero as Hero, icon_Icon as Icon, indicator_Indicator as Indicator, input as Input, join_Join as Join, kbd_Kbd as Kbd, link_Link as Link, loading_Loading as Loading, mask as Mask, menu_Menu as Menu, modal_Modal as Modal, navbar_Navbar as Navbar, pagination_Pagination as Pagination, phonemockup_PhoneMockup as PhoneMockup, Progress, props_table_PropsTable as PropsTable, radialprogress_RadialProgress as RadialProgress, radio_Radio as Radio, range_Range as Range, Rating, select_Select as Select, showcase_ShowcaseBlock as ShowcaseBlock, showcase_section_ShowcaseSection as ShowcaseSection, sidenav_Sidenav as Sidenav, sidenav_SidenavButton as SidenavButton, sidenav_SidenavGroup as SidenavGroup, sidenav_SidenavItem as SidenavItem, sidenav_SidenavLink as SidenavLink, sidenav_SidenavMenu as SidenavMenu, skeleton_Skeleton as Skeleton, Stack, stat_card_StatCard as StatCard, stats_Stats as Stats, status_Status as Status, steps as Steps, Summary, SvgBackground, Swap, table_Table as Table, tabs_Tabs as Tabs, textarea_Textarea as Textarea, Timeline, timeline_TimelineEnd as TimelineEnd, timeline_TimelineItem as TimelineItem, timeline_TimelineMiddle as TimelineMiddle, timeline_TimelineStart as TimelineStart, toast_Toast as Toast, ToastContainer, toggle_Toggle as Toggle, tooltip_Tooltip as Tooltip, windowmockup_WindowMockup as WindowMockup, connectionstatus_ConnectionStatus as default, toastStore, useDesktop, useFormValidation };
|