@pathscale/ui 0.0.83 → 0.0.85
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.
|
@@ -2,7 +2,10 @@ import { type JSX, type ParentComponent } from "solid-js";
|
|
|
2
2
|
import { IComponentBaseProps } from "../types";
|
|
3
3
|
import ValidatedForm, { useFormValidation } from "./ValidatedForm";
|
|
4
4
|
export { type ValidatedFormProps } from "./ValidatedForm";
|
|
5
|
-
export type FormProps = Omit<JSX.HTMLAttributes<HTMLFormElement>, "ref"> & IComponentBaseProps
|
|
5
|
+
export type FormProps = Omit<JSX.HTMLAttributes<HTMLFormElement>, "ref"> & IComponentBaseProps & {
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
cycleOnEnter?: boolean;
|
|
8
|
+
};
|
|
6
9
|
export { useFormValidation };
|
|
7
10
|
declare const _default: ParentComponent<FormProps> & {
|
|
8
11
|
Label: ParentComponent<import("./Label").LabelProps>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type JSX } from "solid-js";
|
|
2
|
+
export type StatCardProps = JSX.HTMLAttributes<HTMLDivElement> & {
|
|
3
|
+
dataTheme?: string;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: ((props: StatCardProps) => JSX.Element) & {
|
|
6
|
+
Figure: (props: JSX.HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
copyable?: boolean;
|
|
8
|
+
}) => JSX.Element;
|
|
9
|
+
Title: (props: JSX.HTMLAttributes<HTMLDivElement> & {
|
|
10
|
+
copyable?: boolean;
|
|
11
|
+
}) => JSX.Element;
|
|
12
|
+
Value: (props: JSX.HTMLAttributes<HTMLDivElement> & {
|
|
13
|
+
copyable?: boolean;
|
|
14
|
+
}) => JSX.Element;
|
|
15
|
+
Desc: (props: JSX.HTMLAttributes<HTMLDivElement> & {
|
|
16
|
+
copyable?: boolean;
|
|
17
|
+
}) => JSX.Element;
|
|
18
|
+
Actions: (props: JSX.HTMLAttributes<HTMLDivElement> & {
|
|
19
|
+
copyable?: boolean;
|
|
20
|
+
}) => JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./StatCard";
|
package/dist/index.d.ts
CHANGED
|
@@ -61,6 +61,7 @@ export { default as ShowcaseBlock } from "./components/showcase/ShowcaseBlock";
|
|
|
61
61
|
export { Sidenav, SidenavMenu, SidenavItem, SidenavGroup, SidenavLink, SidenavButton, } from "./components/sidenav";
|
|
62
62
|
export { default as Skeleton } from "./components/skeleton";
|
|
63
63
|
export { default as Stack } from "./components/stack";
|
|
64
|
+
export { default as StatCard } from "./components/stat-card";
|
|
64
65
|
export { default as Stats } from "./components/stats";
|
|
65
66
|
export { Status } from "./components/status";
|
|
66
67
|
export type { StatusProps } from "./components/status";
|
package/dist/index.js
CHANGED
|
@@ -7440,16 +7440,61 @@ function ValidatedForm(props) {
|
|
|
7440
7440
|
const form_ValidatedForm = ValidatedForm;
|
|
7441
7441
|
var Form_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<form role=form>");
|
|
7442
7442
|
const Form = (props)=>{
|
|
7443
|
-
const
|
|
7443
|
+
const merged = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.mergeProps)({
|
|
7444
|
+
autoFocus: true,
|
|
7445
|
+
cycleOnEnter: true
|
|
7446
|
+
}, props);
|
|
7447
|
+
const [local, others] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(merged, [
|
|
7444
7448
|
"children",
|
|
7445
7449
|
"dataTheme",
|
|
7446
7450
|
"class",
|
|
7447
|
-
"className"
|
|
7451
|
+
"className",
|
|
7452
|
+
"autoFocus",
|
|
7453
|
+
"cycleOnEnter"
|
|
7448
7454
|
]);
|
|
7449
7455
|
const resolvedChildren = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.children)(()=>local.children);
|
|
7450
7456
|
const classes = ()=>twMerge("form-control", local.class, local.className);
|
|
7457
|
+
let formRef;
|
|
7458
|
+
const getFocusableElements = ()=>{
|
|
7459
|
+
if (!formRef) return [];
|
|
7460
|
+
return Array.from(formRef.querySelectorAll('input:not([disabled]):not([type="hidden"]), textarea:not([disabled]), select:not([disabled])'));
|
|
7461
|
+
};
|
|
7462
|
+
const handleKeyDown = (e)=>{
|
|
7463
|
+
if (!local.cycleOnEnter || "Enter" !== e.key) return;
|
|
7464
|
+
const focusableElements = getFocusableElements();
|
|
7465
|
+
const activeElement = document.activeElement;
|
|
7466
|
+
if (!formRef?.contains(activeElement)) return;
|
|
7467
|
+
const currentIndex = focusableElements.indexOf(activeElement);
|
|
7468
|
+
if (-1 === currentIndex) return;
|
|
7469
|
+
e.preventDefault();
|
|
7470
|
+
if (currentIndex === focusableElements.length - 1) formRef?.dispatchEvent(new Event("submit", {
|
|
7471
|
+
bubbles: true,
|
|
7472
|
+
cancelable: true
|
|
7473
|
+
}));
|
|
7474
|
+
else {
|
|
7475
|
+
const nextElement = focusableElements[currentIndex + 1];
|
|
7476
|
+
nextElement?.focus();
|
|
7477
|
+
}
|
|
7478
|
+
};
|
|
7479
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onMount)(()=>{
|
|
7480
|
+
if (local.autoFocus && formRef) {
|
|
7481
|
+
const focusableElements = getFocusableElements();
|
|
7482
|
+
if (focusableElements.length > 0) {
|
|
7483
|
+
const firstElement = focusableElements[0];
|
|
7484
|
+
firstElement.focus();
|
|
7485
|
+
}
|
|
7486
|
+
}
|
|
7487
|
+
if (local.cycleOnEnter && formRef) {
|
|
7488
|
+
formRef.addEventListener("keydown", handleKeyDown);
|
|
7489
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.onCleanup)(()=>{
|
|
7490
|
+
formRef?.removeEventListener("keydown", handleKeyDown);
|
|
7491
|
+
});
|
|
7492
|
+
}
|
|
7493
|
+
});
|
|
7451
7494
|
return (()=>{
|
|
7452
7495
|
var _el$ = Form_tmpl$();
|
|
7496
|
+
var _ref$ = formRef;
|
|
7497
|
+
"function" == typeof _ref$ ? (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.use)(_ref$, _el$) : formRef = _el$;
|
|
7453
7498
|
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(others, {
|
|
7454
7499
|
get ["data-theme"] () {
|
|
7455
7500
|
return local.dataTheme;
|
|
@@ -9471,6 +9516,79 @@ const Stack_Stack = (props)=>{
|
|
|
9471
9516
|
}));
|
|
9472
9517
|
};
|
|
9473
9518
|
const Stack = Stack_Stack;
|
|
9519
|
+
var StatCardSection_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)('<div class="p-3 bg-primary/10 rounded-lg"><div class="flex items-center justify-center w-6 h-6 text-primary">'), StatCardSection_tmpl$2 = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
9520
|
+
const StatCardSection = (section)=>(props)=>{
|
|
9521
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
9522
|
+
"class",
|
|
9523
|
+
"children",
|
|
9524
|
+
"copyable"
|
|
9525
|
+
]);
|
|
9526
|
+
let content = local.children;
|
|
9527
|
+
if ("figure" === section) content = (()=>{
|
|
9528
|
+
var _el$ = StatCardSection_tmpl$(), _el$2 = _el$.firstChild;
|
|
9529
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$2, ()=>local.children);
|
|
9530
|
+
return _el$;
|
|
9531
|
+
})();
|
|
9532
|
+
if ("value" === section && local.copyable) content = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(CopyButton, {
|
|
9533
|
+
get text () {
|
|
9534
|
+
return String(local.children);
|
|
9535
|
+
},
|
|
9536
|
+
get children () {
|
|
9537
|
+
return local.children;
|
|
9538
|
+
}
|
|
9539
|
+
});
|
|
9540
|
+
const classes = "title" === section ? "text-sm text-base-content/60" : "value" === section ? "text-2xl font-bold text-base-content" : "desc" === section ? "text-sm text-base-content/50" : "actions" === section ? "flex items-center gap-2" : "";
|
|
9541
|
+
return (()=>{
|
|
9542
|
+
var _el$3 = StatCardSection_tmpl$2();
|
|
9543
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.spread)(_el$3, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(rest, {
|
|
9544
|
+
get ["class"] () {
|
|
9545
|
+
return twMerge(classes, local.class);
|
|
9546
|
+
}
|
|
9547
|
+
}), false, true);
|
|
9548
|
+
(0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.insert)(_el$3, content);
|
|
9549
|
+
return _el$3;
|
|
9550
|
+
})();
|
|
9551
|
+
};
|
|
9552
|
+
const stat_card_StatCardSection = StatCardSection;
|
|
9553
|
+
const StatCard = (props)=>{
|
|
9554
|
+
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
9555
|
+
"class",
|
|
9556
|
+
"children",
|
|
9557
|
+
"dataTheme",
|
|
9558
|
+
"style"
|
|
9559
|
+
]);
|
|
9560
|
+
const normalizedStyle = "object" == typeof local.style || void 0 === local.style ? local.style : void 0;
|
|
9561
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(card_Card, (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.mergeProps)(rest, {
|
|
9562
|
+
style: normalizedStyle,
|
|
9563
|
+
get ["class"] () {
|
|
9564
|
+
return twMerge("border border-base-300 bg-base-100 rounded-lg p-6", local.class);
|
|
9565
|
+
},
|
|
9566
|
+
get ["data-theme"] () {
|
|
9567
|
+
return local.dataTheme;
|
|
9568
|
+
},
|
|
9569
|
+
get children () {
|
|
9570
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.createComponent)(flex_Flex, {
|
|
9571
|
+
align: "center",
|
|
9572
|
+
gap: "md",
|
|
9573
|
+
get children () {
|
|
9574
|
+
return local.children;
|
|
9575
|
+
}
|
|
9576
|
+
});
|
|
9577
|
+
}
|
|
9578
|
+
}));
|
|
9579
|
+
};
|
|
9580
|
+
const StatCardFigure = stat_card_StatCardSection("figure");
|
|
9581
|
+
const StatCardTitle = stat_card_StatCardSection("title");
|
|
9582
|
+
const StatCardValue = stat_card_StatCardSection("value");
|
|
9583
|
+
const StatCardDesc = stat_card_StatCardSection("desc");
|
|
9584
|
+
const StatCardActions = stat_card_StatCardSection("actions");
|
|
9585
|
+
const stat_card_StatCard = Object.assign(StatCard, {
|
|
9586
|
+
Figure: StatCardFigure,
|
|
9587
|
+
Title: StatCardTitle,
|
|
9588
|
+
Value: StatCardValue,
|
|
9589
|
+
Desc: StatCardDesc,
|
|
9590
|
+
Actions: StatCardActions
|
|
9591
|
+
});
|
|
9474
9592
|
var StatSection_tmpl$ = /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_solid_js_web_35d951b7__.template)("<div>");
|
|
9475
9593
|
const StatSection_StatSection = (props)=>{
|
|
9476
9594
|
const [local, rest] = (0, __WEBPACK_EXTERNAL_MODULE_solid_js_aeefcc6d__.splitProps)(props, [
|
|
@@ -11135,4 +11253,4 @@ const WindowMockup = (props)=>{
|
|
|
11135
11253
|
})();
|
|
11136
11254
|
};
|
|
11137
11255
|
const windowmockup_WindowMockup = WindowMockup;
|
|
11138
|
-
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, 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_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, 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, 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, toggle_Toggle as Toggle, tooltip_Tooltip as Tooltip, windowmockup_WindowMockup as WindowMockup, useDesktop, useFormValidation };
|
|
11256
|
+
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, 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_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, 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, toggle_Toggle as Toggle, tooltip_Tooltip as Tooltip, windowmockup_WindowMockup as WindowMockup, useDesktop, useFormValidation };
|