@torpor/ui 0.1.7 → 0.2.0
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/CHANGELOG.md +35 -0
- package/dist/Accordion/Accordion.torp +2 -2
- package/dist/Accordion/AccordionContent.torp +2 -2
- package/dist/Accordion/AccordionHeader.torp +2 -2
- package/dist/Accordion/AccordionItem.torp +2 -2
- package/dist/Accordion/AccordionTrigger.torp +2 -2
- package/dist/Accordion/index.d.ts +92 -0
- package/dist/Breadcrumb/Breadcrumb.torp +33 -0
- package/dist/Breadcrumb/BreadcrumbItem.torp +19 -0
- package/dist/Breadcrumb/BreadcrumbSeparator.torp +16 -0
- package/dist/Breadcrumb/index.d.ts +56 -0
- package/dist/Breadcrumb/index.js +14 -0
- package/dist/Calendar/Calendar.torp +265 -0
- package/dist/Calendar/CalendarDay.torp +67 -0
- package/dist/Calendar/CalendarTypes.ts +22 -0
- package/dist/Calendar/index.d.ts +38 -0
- package/dist/Calendar/index.js +10 -0
- package/dist/Calendar/index.js.map +1 -0
- package/dist/Dialog/Dialog.torp +3 -3
- package/dist/Dialog/DialogBody.torp +2 -2
- package/dist/Dialog/DialogButton.torp +2 -2
- package/dist/Dialog/DialogFooter.torp +2 -2
- package/dist/Dialog/DialogHeader.torp +2 -2
- package/dist/Dialog/index.d.ts +92 -0
- package/dist/Disclosure/Disclosure.torp +69 -0
- package/dist/Disclosure/DisclosureContent.torp +36 -0
- package/dist/Disclosure/DisclosureHeader.torp +34 -0
- package/dist/Disclosure/DisclosureTrigger.torp +36 -0
- package/dist/Disclosure/DisclosureTypes.ts +14 -0
- package/dist/Disclosure/index.d.ts +74 -0
- package/dist/Disclosure/index.js +18 -0
- package/dist/Disclosure/index.js.map +1 -0
- package/{src/Offscreen/Offscreen.torp → dist/Drawer/Drawer.torp} +10 -19
- package/dist/Drawer/index.d.ts +20 -0
- package/dist/Drawer/index.js +6 -0
- package/dist/Drawer/index.js.map +1 -0
- package/dist/Menu/Menu.torp +160 -0
- package/dist/Menu/MenuButton.torp +53 -0
- package/dist/Menu/MenuCheck.torp +70 -0
- package/dist/Menu/MenuGroup.torp +19 -0
- package/dist/Menu/MenuIndicator.torp +29 -0
- package/dist/Menu/MenuPopout.torp +71 -0
- package/dist/Menu/MenuPopoutContent.torp +74 -0
- package/dist/Menu/MenuPopoutTrigger.torp +117 -0
- package/dist/Menu/MenuRadio.torp +88 -0
- package/dist/Menu/MenuRadioGroup.torp +86 -0
- package/dist/Menu/MenuSeparator.torp +14 -0
- package/dist/Menu/MenuTypes.ts +58 -0
- package/dist/Menu/index.d.ts +200 -0
- package/dist/Menu/index.js +46 -0
- package/dist/Menu/index.js.map +1 -0
- package/dist/MenuBar/MenuBar.torp +150 -0
- package/dist/MenuBar/MenuBarItem.torp +104 -0
- package/dist/MenuBar/MenuBarItemContent.torp +108 -0
- package/dist/MenuBar/MenuBarItemTrigger.torp +89 -0
- package/dist/MenuBar/MenuBarTypes.ts +36 -0
- package/dist/MenuBar/index.d.ts +74 -0
- package/dist/MenuBar/index.js +18 -0
- package/dist/MenuBar/index.js.map +1 -0
- package/dist/NavMenu/NavMenu.torp +2 -2
- package/dist/NavMenu/NavMenuButton.torp +2 -2
- package/dist/NavMenu/NavMenuElement.torp +2 -2
- package/dist/NavMenu/NavMenuGroup.torp +2 -2
- package/dist/NavMenu/NavMenuGroupHeader.torp +2 -2
- package/dist/NavMenu/NavMenuLink.torp +2 -2
- package/dist/NavMenu/NavMenuPopout.torp +2 -2
- package/dist/NavMenu/NavMenuPopoutButton.torp +3 -3
- package/dist/NavMenu/NavMenuPopoutContent.torp +29 -27
- package/dist/NavMenu/NavMenuSeparator.torp +2 -2
- package/dist/NavMenu/index.d.ts +182 -0
- package/dist/Notification/Notification.torp +48 -0
- package/dist/Notification/NotificationClose.torp +28 -0
- package/dist/Notification/NotificationContainer.torp +14 -0
- package/dist/Notification/NotificationContent.torp +13 -0
- package/dist/Notification/NotificationTypes.ts +5 -0
- package/dist/Notification/index.d.ts +74 -0
- package/dist/Notification/index.js +36 -0
- package/dist/Notification/index.js.map +1 -0
- package/dist/Notification/showNotification.ts +30 -0
- package/dist/Popover/Popover.torp +2 -2
- package/dist/Popover/PopoverContent.torp +31 -28
- package/dist/Popover/PopoverContentAnchored.torp +39 -38
- package/dist/Popover/PopoverContentContextual.torp +39 -36
- package/dist/Popover/PopoverOverlay.torp +3 -3
- package/dist/Popover/PopoverTrigger.torp +2 -2
- package/dist/Popover/PopoverTriggerContextual.torp +2 -2
- package/dist/Popover/PopoverTriggerHover.torp +3 -3
- package/dist/Popover/index.d.ts +146 -0
- package/dist/TabGroup/TabContent.torp +2 -2
- package/dist/TabGroup/TabGroup.torp +2 -2
- package/dist/TabGroup/TabHeader.torp +2 -2
- package/dist/TabGroup/TabList.torp +2 -2
- package/dist/TabGroup/TabTrigger.torp +2 -2
- package/dist/TabGroup/index.d.ts +92 -0
- package/dist/icons/ArrowDown.torp +15 -0
- package/dist/icons/ArrowLeft.torp +15 -0
- package/dist/icons/ArrowRight.torp +15 -0
- package/dist/icons/ArrowUp.torp +15 -0
- package/dist/icons/Bars.torp +17 -0
- package/dist/icons/Check.torp +15 -0
- package/dist/icons/ChevronDown.torp +15 -0
- package/dist/icons/ChevronLeft.torp +15 -0
- package/dist/icons/ChevronRight.torp +15 -0
- package/dist/icons/ChevronUp.torp +15 -0
- package/dist/icons/Cross.torp +16 -0
- package/dist/icons/Loading.torp +16 -0
- package/dist/icons/Minus.torp +15 -0
- package/dist/icons/Plus.torp +16 -0
- package/dist/icons/index.d.ts +254 -0
- package/dist/icons/index.js +58 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/{motion.d.cts → index.d.ts} +2 -2
- package/dist/metafile-esm.json +1 -1
- package/dist/motion/fade.ts +7 -0
- package/dist/motion/index.d.ts +2 -0
- package/dist/{motion.js → motion/index.js} +1 -1
- package/dist/motion/index.js.map +1 -0
- package/dist/mount/index.d.ts +2 -0
- package/dist/utils/dateUtils.ts +244 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/setPopoverPosition.ts +4 -0
- package/package.json +50 -34
- package/scripts/postbuild.ts +42 -5
- package/src/Accordion/Accordion.torp +2 -2
- package/src/Accordion/AccordionContent.torp +2 -2
- package/src/Accordion/AccordionHeader.torp +2 -2
- package/src/Accordion/AccordionItem.torp +2 -2
- package/src/Accordion/AccordionTrigger.torp +2 -2
- package/src/Breadcrumb/Breadcrumb.torp +33 -0
- package/src/Breadcrumb/BreadcrumbItem.torp +19 -0
- package/src/Breadcrumb/BreadcrumbSeparator.torp +16 -0
- package/src/Breadcrumb/index.ts +5 -0
- package/src/Calendar/Calendar.torp +265 -0
- package/src/Calendar/CalendarDay.torp +67 -0
- package/src/Calendar/CalendarTypes.ts +22 -0
- package/src/Calendar/index.ts +4 -0
- package/src/Dialog/Dialog.torp +3 -3
- package/src/Dialog/DialogBody.torp +2 -2
- package/src/Dialog/DialogButton.torp +2 -2
- package/src/Dialog/DialogFooter.torp +2 -2
- package/src/Dialog/DialogHeader.torp +2 -2
- package/src/Disclosure/Disclosure.torp +69 -0
- package/src/Disclosure/DisclosureContent.torp +36 -0
- package/src/Disclosure/DisclosureHeader.torp +34 -0
- package/src/Disclosure/DisclosureTrigger.torp +36 -0
- package/src/Disclosure/DisclosureTypes.ts +14 -0
- package/src/Disclosure/index.ts +6 -0
- package/{dist/Offscreen/Offscreen.torp → src/Drawer/Drawer.torp} +10 -19
- package/src/Drawer/index.ts +3 -0
- package/src/Menu/Menu.torp +160 -0
- package/src/Menu/MenuButton.torp +53 -0
- package/src/Menu/MenuCheck.torp +70 -0
- package/src/Menu/MenuGroup.torp +19 -0
- package/src/Menu/MenuIndicator.torp +29 -0
- package/src/Menu/MenuPopout.torp +71 -0
- package/src/Menu/MenuPopoutContent.torp +74 -0
- package/src/Menu/MenuPopoutTrigger.torp +117 -0
- package/src/Menu/MenuRadio.torp +88 -0
- package/src/Menu/MenuRadioGroup.torp +86 -0
- package/src/Menu/MenuSeparator.torp +14 -0
- package/src/Menu/MenuTypes.ts +58 -0
- package/src/Menu/index.ts +25 -0
- package/src/MenuBar/MenuBar.torp +150 -0
- package/src/MenuBar/MenuBarItem.torp +104 -0
- package/src/MenuBar/MenuBarItemContent.torp +108 -0
- package/src/MenuBar/MenuBarItemTrigger.torp +89 -0
- package/src/MenuBar/MenuBarTypes.ts +36 -0
- package/src/MenuBar/index.ts +6 -0
- package/src/NavMenu/NavMenu.torp +2 -2
- package/src/NavMenu/NavMenuButton.torp +2 -2
- package/src/NavMenu/NavMenuElement.torp +2 -2
- package/src/NavMenu/NavMenuGroup.torp +2 -2
- package/src/NavMenu/NavMenuGroupHeader.torp +2 -2
- package/src/NavMenu/NavMenuLink.torp +2 -2
- package/src/NavMenu/NavMenuPopout.torp +2 -2
- package/src/NavMenu/NavMenuPopoutButton.torp +3 -3
- package/src/NavMenu/NavMenuPopoutContent.torp +29 -27
- package/src/NavMenu/NavMenuSeparator.torp +2 -2
- package/src/Notification/Notification.torp +48 -0
- package/src/Notification/NotificationClose.torp +28 -0
- package/src/Notification/NotificationContainer.torp +14 -0
- package/src/Notification/NotificationContent.torp +13 -0
- package/src/Notification/NotificationTypes.ts +5 -0
- package/src/Notification/index.ts +13 -0
- package/src/Notification/showNotification.ts +30 -0
- package/src/Popover/Popover.torp +2 -2
- package/src/Popover/PopoverContent.torp +31 -28
- package/src/Popover/PopoverContentAnchored.torp +39 -38
- package/src/Popover/PopoverContentContextual.torp +39 -36
- package/src/Popover/PopoverOverlay.torp +3 -3
- package/src/Popover/PopoverTrigger.torp +2 -2
- package/src/Popover/PopoverTriggerContextual.torp +2 -2
- package/src/Popover/PopoverTriggerHover.torp +3 -3
- package/src/Slider/Slider.torp +83 -0
- package/src/Slider/index.ts +3 -0
- package/src/TabGroup/TabContent.torp +2 -2
- package/src/TabGroup/TabGroup.torp +2 -2
- package/src/TabGroup/TabHeader.torp +2 -2
- package/src/TabGroup/TabList.torp +2 -2
- package/src/TabGroup/TabTrigger.torp +2 -2
- package/src/icons/ArrowDown.torp +15 -0
- package/src/icons/ArrowLeft.torp +15 -0
- package/src/icons/ArrowRight.torp +15 -0
- package/src/icons/ArrowUp.torp +15 -0
- package/src/icons/Bars.torp +17 -0
- package/src/icons/Check.torp +15 -0
- package/src/icons/ChevronDown.torp +15 -0
- package/src/icons/ChevronLeft.torp +15 -0
- package/src/icons/ChevronRight.torp +15 -0
- package/src/icons/ChevronUp.torp +15 -0
- package/src/icons/Cross.torp +16 -0
- package/src/icons/Loading.torp +16 -0
- package/src/icons/Minus.torp +15 -0
- package/src/icons/Plus.torp +16 -0
- package/src/icons/index.ts +31 -0
- package/src/motion/fade.ts +2 -2
- package/src/motion/index.ts +3 -0
- package/src/utils/dateUtils.ts +244 -0
- package/src/utils/setPopoverPosition.ts +4 -0
- package/test/Breadcrumb/accessibility.test.ts +29 -0
- package/test/Breadcrumb/basic.test.ts +17 -0
- package/test/Breadcrumb/components/BreadcrumbTest.torp +15 -0
- package/test/Calendar/components/CalendarTest.torp +9 -0
- package/test/Calendar/default.test.ts +18 -0
- package/test/Dialog/components/DialogAccessibility.torp +5 -5
- package/test/Disclosure/accessibility.test.ts +30 -0
- package/test/Disclosure/components/DisclosureTest.torp +17 -0
- package/test/Disclosure/default.test.ts +15 -0
- package/test/Disclosure/toggle.test.ts +19 -0
- package/test/Menu/accessibility.test.ts +82 -0
- package/test/Menu/basic.test.ts +57 -0
- package/test/Menu/components/MenuAccessibility.torp +59 -0
- package/test/Menu/components/MenuBasic.torp +58 -0
- package/test/MenuBar/accessibility.test.ts +86 -0
- package/test/MenuBar/basic.test.ts +21 -0
- package/test/MenuBar/components/MenuBarAccessibility.torp +34 -0
- package/test/MenuBar/components/MenuBarBasic.torp +25 -0
- package/test/Notification/accessibility.test.ts +21 -0
- package/test/Notification/components/CustomNotification.torp +14 -0
- package/test/Notification/components/NotificationAccessibility.torp +14 -0
- package/test/Notification/components/NotificationFunction.torp +20 -0
- package/test/Notification/components/NotificationVariable.torp +22 -0
- package/test/Notification/function.test.ts +25 -0
- package/test/Notification/variable.test.ts +25 -0
- package/test/Popover/components/CustomDialog.torp +25 -0
- package/test/Popover/components/PromptFunction.torp +19 -0
- package/test/Popover/components/PromptVariable.torp +38 -0
- package/test/Popover/function.test.ts +26 -0
- package/test/Popover/variable.test.ts +27 -0
- package/tsup.config.ts +12 -4
- package/dist/Accordion/index.cjs +0 -53
- package/dist/Accordion/index.cjs.map +0 -1
- package/dist/Dialog/index.cjs +0 -53
- package/dist/Dialog/index.cjs.map +0 -1
- package/dist/NavMenu/index.cjs +0 -78
- package/dist/NavMenu/index.cjs.map +0 -1
- package/dist/Offscreen/index.cjs +0 -33
- package/dist/Offscreen/index.cjs.map +0 -1
- package/dist/Offscreen/index.js +0 -6
- package/dist/Popover/index.cjs +0 -222
- package/dist/Popover/index.cjs.map +0 -1
- package/dist/TabGroup/index.cjs +0 -53
- package/dist/TabGroup/index.cjs.map +0 -1
- package/dist/metafile-cjs.json +0 -1
- package/dist/motion.cjs +0 -34
- package/dist/motion.cjs.map +0 -1
- package/dist/motion.d.ts +0 -6
- package/dist/motion.js.map +0 -1
- package/src/Accordion.ts +0 -7
- package/src/Dialog.ts +0 -7
- package/src/NavMenu.ts +0 -23
- package/src/Offscreen/index.ts +0 -3
- package/src/Popover.ts +0 -29
- package/src/TabGroup.ts +0 -7
- package/src/motion.ts +0 -3
- /package/dist/{Offscreen → Breadcrumb}/index.js.map +0 -0
|
@@ -10,7 +10,7 @@ import { PopoverContextName, type PopoverContext } from "./PopoverTypes";
|
|
|
10
10
|
*/
|
|
11
11
|
export default function PopoverContentContextual($props: any) {
|
|
12
12
|
let div: HTMLDivElement;
|
|
13
|
-
|
|
13
|
+
let shown = false;
|
|
14
14
|
let closeOnClick = false;
|
|
15
15
|
|
|
16
16
|
// Get stuff out of the PopoverContext
|
|
@@ -20,42 +20,45 @@ export default function PopoverContentContextual($props: any) {
|
|
|
20
20
|
}
|
|
21
21
|
let $state = context.state;
|
|
22
22
|
|
|
23
|
-
let first = true;
|
|
24
23
|
$run(() => {
|
|
25
|
-
|
|
24
|
+
if (!$state.visible) {
|
|
25
|
+
hide();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function show() {
|
|
30
|
+
shown = true;
|
|
31
|
+
|
|
32
|
+
// HACK: Because this Contextual could be shown with a click, we need to wait for another mousedown
|
|
33
|
+
// before we close on click. Otherwise the click immediately bubbles to the document
|
|
34
|
+
closeOnClick = false;
|
|
35
|
+
addDocumentEvent("mousedown", handleDocumentMouseDown);
|
|
36
|
+
addDocumentEvent("click", handleDocumentClick);
|
|
26
37
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
// Set the position and listen for window resize and scroll to reset the position
|
|
39
|
+
setPosition();
|
|
40
|
+
const scrollParent = getScrollParent(context.anchorElement)
|
|
41
|
+
scrollParent.addEventListener("resize", setPosition);
|
|
42
|
+
scrollParent.addEventListener("scroll", setPosition);
|
|
43
|
+
if (context.focusFirstElement) {
|
|
44
|
+
context.focusFirstElement();
|
|
30
45
|
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function hide() {
|
|
49
|
+
if (!shown) return;
|
|
50
|
+
|
|
51
|
+
removeDocumentEvent("mousedown", handleDocumentMouseDown);
|
|
52
|
+
removeDocumentEvent("click", handleDocumentClick);
|
|
31
53
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// Wait for the content div to be shown, set its position, and listen for window resize to re-position
|
|
39
|
-
//await tick();
|
|
40
|
-
setPosition();
|
|
41
|
-
if (context.focusFirstElement) {
|
|
42
|
-
context.focusFirstElement();
|
|
43
|
-
}
|
|
44
|
-
const scrollParent = getScrollParent(context.anchorElement)
|
|
45
|
-
scrollParent.addEventListener("resize", setPosition);
|
|
46
|
-
scrollParent.addEventListener("scroll", setPosition);
|
|
47
|
-
} else {
|
|
48
|
-
removeDocumentEvent("mousedown", handleDocumentMouseDown);
|
|
49
|
-
removeDocumentEvent("click", handleDocumentClick);
|
|
50
|
-
// Stop listening for window resize and focus the anchor element per WAI guidelines
|
|
51
|
-
const scrollParent = getScrollParent(context.anchorElement)
|
|
52
|
-
scrollParent.removeEventListener("resize", setPosition);
|
|
53
|
-
scrollParent.removeEventListener("scroll", setPosition);
|
|
54
|
-
if (context.anchorElement?.focus) {
|
|
55
|
-
context.anchorElement.focus();
|
|
56
|
-
}
|
|
54
|
+
// Stop listening for window resize and focus the anchor element per WAI guidelines
|
|
55
|
+
const scrollParent = getScrollParent(context.anchorElement)
|
|
56
|
+
scrollParent.removeEventListener("resize", setPosition);
|
|
57
|
+
scrollParent.removeEventListener("scroll", setPosition);
|
|
58
|
+
if (context.anchorElement?.focus) {
|
|
59
|
+
context.anchorElement.focus();
|
|
57
60
|
}
|
|
58
|
-
}
|
|
61
|
+
}
|
|
59
62
|
|
|
60
63
|
function handleDocumentMouseDown() {
|
|
61
64
|
closeOnClick = true;
|
|
@@ -77,7 +80,7 @@ export default function PopoverContentContextual($props: any) {
|
|
|
77
80
|
throw new Error("ContextualContent must have an anchor element");
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
if (
|
|
83
|
+
if ($state.position) {
|
|
81
84
|
setContextPosition(context.anchorElement, div, $state.position);
|
|
82
85
|
}
|
|
83
86
|
}
|
|
@@ -85,12 +88,12 @@ export default function PopoverContentContextual($props: any) {
|
|
|
85
88
|
@render {
|
|
86
89
|
@if ($state.visible) {
|
|
87
90
|
<div
|
|
88
|
-
|
|
91
|
+
{$props.id}
|
|
89
92
|
class={`torp-popover-content-contextual ${$props.class ?? ""}`.trim()}
|
|
90
93
|
&ref={div}
|
|
91
|
-
|
|
94
|
+
onmount={show}
|
|
92
95
|
>
|
|
93
|
-
|
|
96
|
+
<slot />
|
|
94
97
|
</div>
|
|
95
98
|
}
|
|
96
99
|
}
|
|
@@ -18,12 +18,12 @@ export default function PopoverOverlay($props: any) {
|
|
|
18
18
|
@render {
|
|
19
19
|
@if ($state.visible) {
|
|
20
20
|
<div
|
|
21
|
-
|
|
21
|
+
{$props.id}
|
|
22
22
|
class={`torp-popover-overlay ${$props.class ?? ""}`.trim()}
|
|
23
23
|
tabindex="-1"
|
|
24
|
-
|
|
24
|
+
onmount={(el) => disableScroll(el)}
|
|
25
25
|
>
|
|
26
|
-
|
|
26
|
+
<slot />
|
|
27
27
|
</div>
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -18,12 +18,12 @@ export default function PopoverTrigger($props: any) {
|
|
|
18
18
|
@render {
|
|
19
19
|
<button
|
|
20
20
|
type="button"
|
|
21
|
-
|
|
21
|
+
{$props.id}
|
|
22
22
|
class={`torp-popover-trigger ${$props.class ?? ""}`.trim()}
|
|
23
23
|
onclick={handleClick}
|
|
24
24
|
&ref={context.anchorElement}
|
|
25
25
|
>
|
|
26
|
-
|
|
26
|
+
<slot />
|
|
27
27
|
</button>
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -26,12 +26,12 @@ export default function PopoverTriggerContextual($props: any) {
|
|
|
26
26
|
|
|
27
27
|
@render {
|
|
28
28
|
<div
|
|
29
|
-
|
|
29
|
+
{$props.id}
|
|
30
30
|
class={`torp-popover-trigger-contextual ${$props.class ?? ""}`.trim()}
|
|
31
31
|
oncontextmenu={handleContextual}
|
|
32
32
|
&ref={context.anchorElement}
|
|
33
33
|
>
|
|
34
|
-
|
|
34
|
+
<slot />
|
|
35
35
|
</div>
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -27,12 +27,12 @@ export default function PopoverTriggerHover($props: any) {
|
|
|
27
27
|
|
|
28
28
|
@render {
|
|
29
29
|
<div
|
|
30
|
-
|
|
30
|
+
{$props.id}
|
|
31
31
|
class={`torp-popover-trigger-hover ${$props.class ?? ""}`.trim()}
|
|
32
|
-
|
|
32
|
+
onmount={(el) => hoverTrigger(el, { onHover: handleHover, onExit: handleHover })}
|
|
33
33
|
&ref={context.anchorElement}
|
|
34
34
|
>
|
|
35
|
-
|
|
35
|
+
<slot />
|
|
36
36
|
</div>
|
|
37
37
|
}
|
|
38
38
|
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type SlotRender } from "@torpor/view";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
6
|
+
* @param $parent -- The parent node.
|
|
7
|
+
* @param $anchor -- The node to mount the component before.
|
|
8
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
9
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
10
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
11
|
+
*/
|
|
12
|
+
declare function Popover(
|
|
13
|
+
$parent: ParentNode,
|
|
14
|
+
$anchor: Node | null,
|
|
15
|
+
$props: any,
|
|
16
|
+
$context?: Record<PropertyKey, any>,
|
|
17
|
+
$slots?: Record<string, SlotRender>,
|
|
18
|
+
): void;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
24
|
+
* @param $parent -- The parent node.
|
|
25
|
+
* @param $anchor -- The node to mount the component before.
|
|
26
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
27
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
28
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
29
|
+
*/
|
|
30
|
+
declare function PopoverContent(
|
|
31
|
+
$parent: ParentNode,
|
|
32
|
+
$anchor: Node | null,
|
|
33
|
+
$props: any,
|
|
34
|
+
$context?: Record<PropertyKey, any>,
|
|
35
|
+
$slots?: Record<string, SlotRender>,
|
|
36
|
+
): void;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
42
|
+
* @param $parent -- The parent node.
|
|
43
|
+
* @param $anchor -- The node to mount the component before.
|
|
44
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
45
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
46
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
47
|
+
*/
|
|
48
|
+
declare function PopoverContentAnchored(
|
|
49
|
+
$parent: ParentNode,
|
|
50
|
+
$anchor: Node | null,
|
|
51
|
+
$props: any,
|
|
52
|
+
$context?: Record<PropertyKey, any>,
|
|
53
|
+
$slots?: Record<string, SlotRender>,
|
|
54
|
+
): void;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
60
|
+
* @param $parent -- The parent node.
|
|
61
|
+
* @param $anchor -- The node to mount the component before.
|
|
62
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
63
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
64
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
65
|
+
*/
|
|
66
|
+
declare function PopoverContentContextual(
|
|
67
|
+
$parent: ParentNode,
|
|
68
|
+
$anchor: Node | null,
|
|
69
|
+
$props: any,
|
|
70
|
+
$context?: Record<PropertyKey, any>,
|
|
71
|
+
$slots?: Record<string, SlotRender>,
|
|
72
|
+
): void;
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
78
|
+
* @param $parent -- The parent node.
|
|
79
|
+
* @param $anchor -- The node to mount the component before.
|
|
80
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
81
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
82
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
83
|
+
*/
|
|
84
|
+
declare function PopoverOverlay(
|
|
85
|
+
$parent: ParentNode,
|
|
86
|
+
$anchor: Node | null,
|
|
87
|
+
$props: any,
|
|
88
|
+
$context?: Record<PropertyKey, any>,
|
|
89
|
+
$slots?: Record<string, SlotRender>,
|
|
90
|
+
): void;
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
96
|
+
* @param $parent -- The parent node.
|
|
97
|
+
* @param $anchor -- The node to mount the component before.
|
|
98
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
99
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
100
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
101
|
+
*/
|
|
102
|
+
declare function PopoverTrigger(
|
|
103
|
+
$parent: ParentNode,
|
|
104
|
+
$anchor: Node | null,
|
|
105
|
+
$props: any,
|
|
106
|
+
$context?: Record<PropertyKey, any>,
|
|
107
|
+
$slots?: Record<string, SlotRender>,
|
|
108
|
+
): void;
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
114
|
+
* @param $parent -- The parent node.
|
|
115
|
+
* @param $anchor -- The node to mount the component before.
|
|
116
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
117
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
118
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
119
|
+
*/
|
|
120
|
+
declare function PopoverTriggerContextual(
|
|
121
|
+
$parent: ParentNode,
|
|
122
|
+
$anchor: Node | null,
|
|
123
|
+
$props: any,
|
|
124
|
+
$context?: Record<PropertyKey, any>,
|
|
125
|
+
$slots?: Record<string, SlotRender>,
|
|
126
|
+
): void;
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
132
|
+
* @param $parent -- The parent node.
|
|
133
|
+
* @param $anchor -- The node to mount the component before.
|
|
134
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
135
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
136
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
137
|
+
*/
|
|
138
|
+
declare function PopoverTriggerHover(
|
|
139
|
+
$parent: ParentNode,
|
|
140
|
+
$anchor: Node | null,
|
|
141
|
+
$props: any,
|
|
142
|
+
$context?: Record<PropertyKey, any>,
|
|
143
|
+
$slots?: Record<string, SlotRender>,
|
|
144
|
+
): void;
|
|
145
|
+
|
|
146
|
+
export { Popover, PopoverContent, PopoverContentAnchored, PopoverContentContextual, PopoverOverlay, PopoverTrigger, PopoverTriggerContextual, PopoverTriggerHover };
|
|
@@ -20,7 +20,7 @@ export default function TabContent($props: any) {
|
|
|
20
20
|
|
|
21
21
|
@render {
|
|
22
22
|
<div
|
|
23
|
-
|
|
23
|
+
{$props.id}
|
|
24
24
|
class={`torp-tab-content ${$props.class ?? ""}`.trim()}
|
|
25
25
|
role="tabpanel"
|
|
26
26
|
aria-labelledby={$state.headerId}
|
|
@@ -29,7 +29,7 @@ export default function TabContent($props: any) {
|
|
|
29
29
|
data-disabled={$state.dataDisabled}
|
|
30
30
|
>
|
|
31
31
|
@if ($state.active) {
|
|
32
|
-
|
|
32
|
+
<slot />
|
|
33
33
|
}
|
|
34
34
|
</div>
|
|
35
35
|
}
|
|
@@ -218,11 +218,11 @@ export default function TabGroup($props: any) {
|
|
|
218
218
|
|
|
219
219
|
@render {
|
|
220
220
|
<div
|
|
221
|
-
|
|
221
|
+
{$props.id}
|
|
222
222
|
class={`torp-tab-group ${$props.class ?? ""}`.trim()}
|
|
223
223
|
data-orientation={$props.orientation}
|
|
224
224
|
>
|
|
225
|
-
|
|
225
|
+
<slot />
|
|
226
226
|
</div>
|
|
227
227
|
}
|
|
228
228
|
}
|
|
@@ -37,7 +37,7 @@ export default function TabHeader($props: any) {
|
|
|
37
37
|
@render {
|
|
38
38
|
@// TODO: $props.as
|
|
39
39
|
<h4
|
|
40
|
-
|
|
40
|
+
{$props.id}
|
|
41
41
|
class={[
|
|
42
42
|
"torp-tab-header",
|
|
43
43
|
$props.class,
|
|
@@ -46,7 +46,7 @@ export default function TabHeader($props: any) {
|
|
|
46
46
|
data-state={$state.dataState}
|
|
47
47
|
data-disabled={$state.dataDisabled}
|
|
48
48
|
>
|
|
49
|
-
|
|
49
|
+
<slot />
|
|
50
50
|
</h4>
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -35,7 +35,7 @@ export default function TabList($props: any) {
|
|
|
35
35
|
|
|
36
36
|
@render {
|
|
37
37
|
<div
|
|
38
|
-
|
|
38
|
+
{$props.id}
|
|
39
39
|
class={`torp-tab-list ${$props.class ?? ""}`.trim()}
|
|
40
40
|
role="tablist"
|
|
41
41
|
aria-label={$props.ariaLabel}
|
|
@@ -44,7 +44,7 @@ export default function TabList($props: any) {
|
|
|
44
44
|
tabindex="0"
|
|
45
45
|
onfocus={handleFocus}
|
|
46
46
|
>
|
|
47
|
-
|
|
47
|
+
<slot />
|
|
48
48
|
</div>
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -44,7 +44,7 @@ export default function TabTrigger() {
|
|
|
44
44
|
@render {
|
|
45
45
|
<button
|
|
46
46
|
type="button"
|
|
47
|
-
|
|
47
|
+
{$props.id}
|
|
48
48
|
class={`torp-tab-trigger ${$props.class ?? ""}`.trim()}
|
|
49
49
|
role="tab"
|
|
50
50
|
tabindex="-1"
|
|
@@ -59,7 +59,7 @@ export default function TabTrigger() {
|
|
|
59
59
|
onclick={handleClick}
|
|
60
60
|
onkeydown={handleKey}
|
|
61
61
|
>
|
|
62
|
-
|
|
62
|
+
<slot />
|
|
63
63
|
</button>
|
|
64
64
|
}
|
|
65
65
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { type SlotRender } from "@torpor/view";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
6
|
+
* @param $parent -- The parent node.
|
|
7
|
+
* @param $anchor -- The node to mount the component before.
|
|
8
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
9
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
10
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
11
|
+
*/
|
|
12
|
+
declare function TabContent(
|
|
13
|
+
$parent: ParentNode,
|
|
14
|
+
$anchor: Node | null,
|
|
15
|
+
$props: any,
|
|
16
|
+
$context?: Record<PropertyKey, any>,
|
|
17
|
+
$slots?: Record<string, SlotRender>,
|
|
18
|
+
): void;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
24
|
+
* @param $parent -- The parent node.
|
|
25
|
+
* @param $anchor -- The node to mount the component before.
|
|
26
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
27
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
28
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
29
|
+
*/
|
|
30
|
+
declare function TabGroup(
|
|
31
|
+
$parent: ParentNode,
|
|
32
|
+
$anchor: Node | null,
|
|
33
|
+
$props: any,
|
|
34
|
+
$context?: Record<PropertyKey, any>,
|
|
35
|
+
$slots?: Record<string, SlotRender>,
|
|
36
|
+
): void;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
42
|
+
* @param $parent -- The parent node.
|
|
43
|
+
* @param $anchor -- The node to mount the component before.
|
|
44
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
45
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
46
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
47
|
+
*/
|
|
48
|
+
declare function TabHeader(
|
|
49
|
+
$parent: ParentNode,
|
|
50
|
+
$anchor: Node | null,
|
|
51
|
+
$props: any,
|
|
52
|
+
$context?: Record<PropertyKey, any>,
|
|
53
|
+
$slots?: Record<string, SlotRender>,
|
|
54
|
+
): void;
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
60
|
+
* @param $parent -- The parent node.
|
|
61
|
+
* @param $anchor -- The node to mount the component before.
|
|
62
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
63
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
64
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
65
|
+
*/
|
|
66
|
+
declare function TabList(
|
|
67
|
+
$parent: ParentNode,
|
|
68
|
+
$anchor: Node | null,
|
|
69
|
+
$props: any,
|
|
70
|
+
$context?: Record<PropertyKey, any>,
|
|
71
|
+
$slots?: Record<string, SlotRender>,
|
|
72
|
+
): void;
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Mounts or hydrates the component into the supplied parent node.
|
|
78
|
+
* @param $parent -- The parent node.
|
|
79
|
+
* @param $anchor -- The node to mount the component before.
|
|
80
|
+
* @param $props -- The values that have been passed into the component as properties.
|
|
81
|
+
* @param $context -- Values that have been passed into the component from its ancestors.
|
|
82
|
+
* @param $slots -- Functions for rendering children into slot nodes within the component.
|
|
83
|
+
*/
|
|
84
|
+
declare function TabTrigger(
|
|
85
|
+
$parent: ParentNode,
|
|
86
|
+
$anchor: Node | null,
|
|
87
|
+
$props?: Record<PropertyKey, any>,
|
|
88
|
+
$context?: Record<PropertyKey, any>,
|
|
89
|
+
$slots?: Record<string, SlotRender>,
|
|
90
|
+
): void;
|
|
91
|
+
|
|
92
|
+
export { TabContent, TabGroup, TabHeader, TabList, TabTrigger };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function ArrowDown() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<polygon points="25,40 50,70 75,40" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function ArrowLeft() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<polygon points="60,25 30,50 60,75" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function ArrowRight() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<polygon points="40,25 70,50 40,75" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function ArrowUp() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<polygon points="25,60 50,30 75,60" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default function Bars() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<path d="M10,25 L90,25" />
|
|
12
|
+
<path d="M10,50 L90,50" />
|
|
13
|
+
<path d="M10,75 L90,75" />
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function Check() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<path d="M10,55 L35,80 L90,25" fill="none" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function ChevronDown() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<path d="M10,30 L50,70 L90,30" fill="none" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function ChevronLeft() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<path d="M70,10 L30,50 L70,90" fill="none" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function ChevronRight() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<path d="M30,10 L70,50 L30,90" fill="none" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export default function ChevronUp() {
|
|
2
|
+
@render {
|
|
3
|
+
<svg
|
|
4
|
+
{$props.id}
|
|
5
|
+
class={`torp-icon ${$props.class ?? ""}`.trim()}
|
|
6
|
+
viewBox="0 0 100 100"
|
|
7
|
+
stroke-linejoin="round"
|
|
8
|
+
stroke-width="12"
|
|
9
|
+
>
|
|
10
|
+
<g>
|
|
11
|
+
<path d="M10,70 L50,30 L90,70" fill="none" />
|
|
12
|
+
</g>
|
|
13
|
+
</svg>
|
|
14
|
+
}
|
|
15
|
+
}
|