@torpor/ui 0.3.3 → 0.3.4
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 +8 -0
- package/dist/Accordion/Accordion.torp +7 -3
- package/dist/Accordion/AccordionContent.torp +7 -3
- package/dist/Accordion/AccordionHeader.torp +7 -3
- package/dist/Accordion/AccordionItem.torp +7 -3
- package/dist/Accordion/AccordionTrigger.torp +7 -3
- package/dist/Accordion/index.d.ts +20 -10
- package/dist/Breadcrumb/Breadcrumb.torp +7 -3
- package/dist/Breadcrumb/BreadcrumbItem.torp +7 -3
- package/dist/Breadcrumb/BreadcrumbSeparator.torp +7 -3
- package/dist/Breadcrumb/index.d.ts +12 -6
- package/dist/Calendar/Calendar.torp +9 -4
- package/dist/Calendar/CalendarDay.torp +5 -2
- package/dist/Calendar/index.d.ts +8 -4
- package/dist/Contextual/Contextual.torp +7 -3
- package/dist/Contextual/ContextualContent.torp +7 -4
- package/dist/Contextual/ContextualTrigger.torp +7 -3
- package/dist/Contextual/index.d.ts +12 -6
- package/dist/Dialog/Dialog.torp +7 -3
- package/dist/Dialog/DialogBody.torp +7 -3
- package/dist/Dialog/DialogButton.torp +7 -3
- package/dist/Dialog/DialogFooter.torp +7 -3
- package/dist/Dialog/DialogHeader.torp +7 -3
- package/dist/Dialog/index.d.ts +20 -10
- package/dist/Disclosure/Disclosure.torp +7 -3
- package/dist/Disclosure/DisclosureContent.torp +7 -3
- package/dist/Disclosure/DisclosureHeader.torp +7 -3
- package/dist/Disclosure/DisclosureTrigger.torp +7 -3
- package/dist/Disclosure/index.d.ts +16 -8
- package/dist/Drawer/Drawer.torp +7 -3
- package/dist/Drawer/DrawerContent.torp +7 -4
- package/dist/Drawer/DrawerOverlay.torp +7 -3
- package/dist/Drawer/DrawerTrigger.torp +7 -3
- package/dist/Drawer/index.d.ts +16 -8
- package/dist/Form/CheckBox.torp +5 -2
- package/dist/Form/Field.torp +7 -3
- package/dist/Form/File.torp +7 -3
- package/dist/Form/Form.torp +7 -3
- package/dist/Form/Input.torp +7 -3
- package/dist/Form/Label.torp +7 -3
- package/dist/Form/Message.torp +7 -3
- package/dist/Form/Option.torp +8 -4
- package/dist/Form/Select.torp +7 -3
- package/dist/Form/TextArea.torp +7 -3
- package/dist/Form/index.d.ts +40 -20
- package/dist/Menu/Menu.torp +7 -3
- package/dist/Menu/MenuButton.torp +7 -3
- package/dist/Menu/MenuCheck.torp +7 -3
- package/dist/Menu/MenuGroup.torp +7 -3
- package/dist/Menu/MenuIndicator.torp +7 -3
- package/dist/Menu/MenuPopout.torp +7 -3
- package/dist/Menu/MenuPopoutContent.torp +7 -4
- package/dist/Menu/MenuPopoutTrigger.torp +7 -3
- package/dist/Menu/MenuRadio.torp +7 -3
- package/dist/Menu/MenuRadioGroup.torp +7 -3
- package/dist/Menu/MenuSeparator.torp +7 -3
- package/dist/Menu/index.d.ts +44 -22
- package/dist/MenuBar/MenuBar.torp +7 -3
- package/dist/MenuBar/MenuBarItem.torp +7 -3
- package/dist/MenuBar/MenuBarItemContent.torp +7 -3
- package/dist/MenuBar/MenuBarItemTrigger.torp +7 -3
- package/dist/MenuBar/index.d.ts +16 -8
- package/dist/Modal/Modal.torp +7 -3
- package/dist/Modal/ModalContent.torp +7 -3
- package/dist/Modal/ModalOverlay.torp +7 -3
- package/dist/Modal/ModalTrigger.torp +7 -3
- package/dist/Modal/index.d.ts +16 -8
- package/dist/NavMenu/NavMenu.torp +7 -3
- package/dist/NavMenu/NavMenuButton.torp +7 -3
- package/dist/NavMenu/NavMenuElement.torp +7 -3
- package/dist/NavMenu/NavMenuGroup.torp +7 -3
- package/dist/NavMenu/NavMenuGroupHeader.torp +7 -3
- package/dist/NavMenu/NavMenuLink.torp +7 -4
- package/dist/NavMenu/NavMenuPopout.torp +7 -3
- package/dist/NavMenu/NavMenuPopoutButton.torp +7 -3
- package/dist/NavMenu/NavMenuPopoutContent.torp +7 -4
- package/dist/NavMenu/NavMenuSeparator.torp +5 -2
- package/dist/NavMenu/index.d.ts +40 -20
- package/dist/Notification/Notification.torp +7 -3
- package/dist/Notification/NotificationClose.torp +7 -3
- package/dist/Notification/NotificationContainer.torp +7 -3
- package/dist/Notification/NotificationContent.torp +7 -3
- package/dist/Notification/index.d.ts +16 -8
- package/dist/Popover/Popover.torp +7 -3
- package/dist/Popover/PopoverContent.torp +7 -3
- package/dist/Popover/PopoverTrigger.torp +7 -3
- package/dist/Popover/index.d.ts +8 -4
- package/dist/TabGroup/TabContent.torp +7 -3
- package/dist/TabGroup/TabGroup.torp +7 -3
- package/dist/TabGroup/TabHeader.torp +5 -2
- package/dist/TabGroup/TabList.torp +7 -3
- package/dist/TabGroup/TabTrigger.torp +7 -3
- package/dist/TabGroup/index.d.ts +20 -10
- package/dist/icons/ArrowDown.torp +2 -1
- package/dist/icons/ArrowLeft.torp +2 -1
- package/dist/icons/ArrowRight.torp +2 -1
- package/dist/icons/ArrowUp.torp +2 -1
- package/dist/icons/Bars.torp +2 -1
- package/dist/icons/Check.torp +2 -1
- package/dist/icons/ChevronDown.torp +2 -1
- package/dist/icons/ChevronLeft.torp +2 -1
- package/dist/icons/ChevronRight.torp +2 -1
- package/dist/icons/ChevronUp.torp +2 -1
- package/dist/icons/Cross.torp +2 -1
- package/dist/icons/IconTypes.ts +6 -2
- package/dist/icons/Loading.torp +2 -1
- package/dist/icons/Minus.torp +2 -1
- package/dist/icons/Plus.torp +2 -1
- package/dist/icons/index.d.ts +28 -14
- package/dist/metafile-esm.json +1 -1
- package/package.json +2 -2
- package/src/Accordion/Accordion.torp +7 -3
- package/src/Accordion/AccordionContent.torp +7 -3
- package/src/Accordion/AccordionHeader.torp +7 -3
- package/src/Accordion/AccordionItem.torp +7 -3
- package/src/Accordion/AccordionTrigger.torp +7 -3
- package/src/Breadcrumb/Breadcrumb.torp +7 -3
- package/src/Breadcrumb/BreadcrumbItem.torp +7 -3
- package/src/Breadcrumb/BreadcrumbSeparator.torp +7 -3
- package/src/Calendar/Calendar.torp +9 -4
- package/src/Calendar/CalendarDay.torp +5 -2
- package/src/Contextual/Contextual.torp +7 -3
- package/src/Contextual/ContextualContent.torp +7 -4
- package/src/Contextual/ContextualTrigger.torp +7 -3
- package/src/Dialog/Dialog.torp +7 -3
- package/src/Dialog/DialogBody.torp +7 -3
- package/src/Dialog/DialogButton.torp +7 -3
- package/src/Dialog/DialogFooter.torp +7 -3
- package/src/Dialog/DialogHeader.torp +7 -3
- package/src/Disclosure/Disclosure.torp +7 -3
- package/src/Disclosure/DisclosureContent.torp +7 -3
- package/src/Disclosure/DisclosureHeader.torp +7 -3
- package/src/Disclosure/DisclosureTrigger.torp +7 -3
- package/src/Drawer/Drawer.torp +7 -3
- package/src/Drawer/DrawerContent.torp +7 -4
- package/src/Drawer/DrawerOverlay.torp +7 -3
- package/src/Drawer/DrawerTrigger.torp +7 -3
- package/src/Form/CheckBox.torp +5 -2
- package/src/Form/Field.torp +7 -3
- package/src/Form/File.torp +7 -3
- package/src/Form/Form.torp +7 -3
- package/src/Form/Input.torp +7 -3
- package/src/Form/Label.torp +7 -3
- package/src/Form/Message.torp +7 -3
- package/src/Form/Option.torp +8 -4
- package/src/Form/Select.torp +7 -3
- package/src/Form/TextArea.torp +7 -3
- package/src/Menu/Menu.torp +7 -3
- package/src/Menu/MenuButton.torp +7 -3
- package/src/Menu/MenuCheck.torp +7 -3
- package/src/Menu/MenuGroup.torp +7 -3
- package/src/Menu/MenuIndicator.torp +7 -3
- package/src/Menu/MenuPopout.torp +7 -3
- package/src/Menu/MenuPopoutContent.torp +7 -4
- package/src/Menu/MenuPopoutTrigger.torp +7 -3
- package/src/Menu/MenuRadio.torp +7 -3
- package/src/Menu/MenuRadioGroup.torp +7 -3
- package/src/Menu/MenuSeparator.torp +7 -3
- package/src/MenuBar/MenuBar.torp +7 -3
- package/src/MenuBar/MenuBarItem.torp +7 -3
- package/src/MenuBar/MenuBarItemContent.torp +7 -3
- package/src/MenuBar/MenuBarItemTrigger.torp +7 -3
- package/src/Modal/Modal.torp +7 -3
- package/src/Modal/ModalContent.torp +7 -3
- package/src/Modal/ModalOverlay.torp +7 -3
- package/src/Modal/ModalTrigger.torp +7 -3
- package/src/NavMenu/NavMenu.torp +7 -3
- package/src/NavMenu/NavMenuButton.torp +7 -3
- package/src/NavMenu/NavMenuElement.torp +7 -3
- package/src/NavMenu/NavMenuGroup.torp +7 -3
- package/src/NavMenu/NavMenuGroupHeader.torp +7 -3
- package/src/NavMenu/NavMenuLink.torp +7 -4
- package/src/NavMenu/NavMenuPopout.torp +7 -3
- package/src/NavMenu/NavMenuPopoutButton.torp +7 -3
- package/src/NavMenu/NavMenuPopoutContent.torp +7 -4
- package/src/NavMenu/NavMenuSeparator.torp +5 -2
- package/src/Notification/Notification.torp +7 -3
- package/src/Notification/NotificationClose.torp +7 -3
- package/src/Notification/NotificationContainer.torp +7 -3
- package/src/Notification/NotificationContent.torp +7 -3
- package/src/Popover/Popover.torp +7 -3
- package/src/Popover/PopoverContent.torp +7 -3
- package/src/Popover/PopoverTrigger.torp +7 -3
- package/src/Slider/Slider.torp +2 -1
- package/src/TabGroup/TabContent.torp +7 -3
- package/src/TabGroup/TabGroup.torp +7 -3
- package/src/TabGroup/TabHeader.torp +5 -2
- package/src/TabGroup/TabList.torp +7 -3
- package/src/TabGroup/TabTrigger.torp +7 -3
- package/src/icons/ArrowDown.torp +2 -1
- package/src/icons/ArrowLeft.torp +2 -1
- package/src/icons/ArrowRight.torp +2 -1
- package/src/icons/ArrowUp.torp +2 -1
- package/src/icons/Bars.torp +2 -1
- package/src/icons/Check.torp +2 -1
- package/src/icons/ChevronDown.torp +2 -1
- package/src/icons/ChevronLeft.torp +2 -1
- package/src/icons/ChevronRight.torp +2 -1
- package/src/icons/ChevronUp.torp +2 -1
- package/src/icons/Cross.torp +2 -1
- package/src/icons/IconTypes.ts +6 -2
- package/src/icons/Loading.torp +2 -1
- package/src/icons/Minus.torp +2 -1
- package/src/icons/Plus.torp +2 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { addDocumentEvent, removeDocumentEvent } from "../utils/documentEvents";
|
|
2
3
|
import setPopoverPosition from "../utils/setPopoverPosition";
|
|
3
4
|
import {
|
|
@@ -10,8 +11,10 @@ import {
|
|
|
10
11
|
interface MenuBarItemContentProps {
|
|
11
12
|
/** An ID for the root element */
|
|
12
13
|
id?: string;
|
|
13
|
-
/**
|
|
14
|
-
class?:
|
|
14
|
+
/** Classes for the root element */
|
|
15
|
+
class?: ClassValue,
|
|
16
|
+
/** Styles for the root element */
|
|
17
|
+
style?: StyleValue,
|
|
15
18
|
/** Where the popout will be shown, relative to the popout button */
|
|
16
19
|
side?: "top" | "right" | "bottom" | "left",
|
|
17
20
|
/** How the popout will be aligned, relative to the popout button */
|
|
@@ -104,7 +107,8 @@ export default function MenuBarItemContent($props: MenuBarItemContentProps | und
|
|
|
104
107
|
@if ($state.visible) {
|
|
105
108
|
<div
|
|
106
109
|
{$props?.id}
|
|
107
|
-
class={
|
|
110
|
+
class={["torp-menu-bar-item-content", $props?.class]}
|
|
111
|
+
{$props?.style}
|
|
108
112
|
&ref={div}
|
|
109
113
|
onmount={show}
|
|
110
114
|
>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
MenuBarContextName,
|
|
3
4
|
MenuBarItemContextName,
|
|
@@ -8,8 +9,10 @@ import {
|
|
|
8
9
|
interface MenuBarItemTriggerProps {
|
|
9
10
|
/** An ID for the root element */
|
|
10
11
|
id?: string;
|
|
11
|
-
/**
|
|
12
|
-
class?:
|
|
12
|
+
/** Classes for the root element */
|
|
13
|
+
class?: ClassValue,
|
|
14
|
+
/** Styles for the root element */
|
|
15
|
+
style?: StyleValue,
|
|
13
16
|
/** Whether this button is disabled */
|
|
14
17
|
disabled?: boolean,
|
|
15
18
|
}
|
|
@@ -74,7 +77,8 @@ export default function MenuBarItemTrigger($props: MenuBarItemTriggerProps | und
|
|
|
74
77
|
@render {
|
|
75
78
|
<button
|
|
76
79
|
{$props?.id}
|
|
77
|
-
class={
|
|
80
|
+
class={["torp-menu-bar-item-button", $props?.class]}
|
|
81
|
+
{$props?.style}
|
|
78
82
|
type="button"
|
|
79
83
|
{$props?.disabled}
|
|
80
84
|
role="menuitem"
|
package/dist/MenuBar/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
|
|
|
4
4
|
interface MenuBarProps {
|
|
5
5
|
/** An ID for the root element */
|
|
6
6
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
9
11
|
/** An ARIA label for describing the menu to screen readers */
|
|
10
12
|
ariaLabel?: string,
|
|
11
13
|
/** The orientation of the menu, which affects keyboard navigation */
|
|
@@ -43,8 +45,10 @@ declare function MenuBar(
|
|
|
43
45
|
interface MenuBarItemProps {
|
|
44
46
|
/** An ID for the root element */
|
|
45
47
|
id?: string;
|
|
46
|
-
/**
|
|
47
|
-
class?:
|
|
48
|
+
/** Classes for the root element */
|
|
49
|
+
class?: ClassValue,
|
|
50
|
+
/** Styles for the root element */
|
|
51
|
+
style?: StyleValue,
|
|
48
52
|
/** Whether the item is visible */
|
|
49
53
|
visible?: boolean,
|
|
50
54
|
/** Raised when the item is opened or closed */
|
|
@@ -80,8 +84,10 @@ declare function MenuBarItem(
|
|
|
80
84
|
interface MenuBarItemContentProps {
|
|
81
85
|
/** An ID for the root element */
|
|
82
86
|
id?: string;
|
|
83
|
-
/**
|
|
84
|
-
class?:
|
|
87
|
+
/** Classes for the root element */
|
|
88
|
+
class?: ClassValue,
|
|
89
|
+
/** Styles for the root element */
|
|
90
|
+
style?: StyleValue,
|
|
85
91
|
/** Where the popout will be shown, relative to the popout button */
|
|
86
92
|
side?: "top" | "right" | "bottom" | "left",
|
|
87
93
|
/** How the popout will be aligned, relative to the popout button */
|
|
@@ -104,8 +110,10 @@ declare function MenuBarItemContent(
|
|
|
104
110
|
interface MenuBarItemTriggerProps {
|
|
105
111
|
/** An ID for the root element */
|
|
106
112
|
id?: string;
|
|
107
|
-
/**
|
|
108
|
-
class?:
|
|
113
|
+
/** Classes for the root element */
|
|
114
|
+
class?: ClassValue,
|
|
115
|
+
/** Styles for the root element */
|
|
116
|
+
style?: StyleValue,
|
|
109
117
|
/** Whether this button is disabled */
|
|
110
118
|
disabled?: boolean,
|
|
111
119
|
}
|
package/dist/Modal/Modal.torp
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { ModalContextName, type ModalContext, type ModalState } from "./ModalTypes";
|
|
2
3
|
|
|
3
4
|
interface ModalProps {
|
|
4
5
|
/** An ID for the root element */
|
|
5
6
|
id?: string;
|
|
6
|
-
/**
|
|
7
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
8
11
|
/** Whether the modal is visible */
|
|
9
12
|
visible?: boolean,
|
|
10
13
|
/** A function to be called when the user selects a response */
|
|
@@ -110,7 +113,8 @@ export default function Modal($props: ModalProps | undefined) {
|
|
|
110
113
|
@render {
|
|
111
114
|
<div
|
|
112
115
|
{$props?.id}
|
|
113
|
-
class={
|
|
116
|
+
class={["torp-modal", $props?.class]}
|
|
117
|
+
{$props?.style}
|
|
114
118
|
>
|
|
115
119
|
<slot />
|
|
116
120
|
</div>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { addDocumentEvent, removeDocumentEvent } from "../utils/documentEvents";
|
|
2
3
|
import { ModalContextName, type ModalContext } from "./ModalTypes";
|
|
3
4
|
|
|
4
5
|
interface ModalContentProps {
|
|
5
6
|
/** An ID for the root element */
|
|
6
7
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
class?:
|
|
8
|
+
/** Classes for the root element */
|
|
9
|
+
class?: ClassValue,
|
|
10
|
+
/** Styles for the root element */
|
|
11
|
+
style?: StyleValue,
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
/**
|
|
@@ -66,7 +69,8 @@ export default function ModalContent($props: ModalContentProps | undefined) {
|
|
|
66
69
|
@if ($state.visible) {
|
|
67
70
|
<div
|
|
68
71
|
{$props?.id}
|
|
69
|
-
class={
|
|
72
|
+
class={["torp-modal-content", $props?.class]}
|
|
73
|
+
{$props?.style}
|
|
70
74
|
&ref={div}
|
|
71
75
|
onmount={show}
|
|
72
76
|
>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { disableScroll } from "../mount/disableScroll";
|
|
2
3
|
import { ModalContextName, type ModalContext } from "./ModalTypes";
|
|
3
4
|
|
|
4
5
|
interface ModalOverlayProps {
|
|
5
6
|
/** An ID for the root element */
|
|
6
7
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
class?:
|
|
8
|
+
/** Classes for the root element */
|
|
9
|
+
class?: ClassValue,
|
|
10
|
+
/** Styles for the root element */
|
|
11
|
+
style?: StyleValue,
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
/**
|
|
@@ -27,7 +30,8 @@ export default function ModalOverlay($props: ModalOverlayProps | undefined) {
|
|
|
27
30
|
@if ($state.visible) {
|
|
28
31
|
<div
|
|
29
32
|
{$props?.id}
|
|
30
|
-
class={
|
|
33
|
+
class={["torp-modal-overlay", $props?.class]}
|
|
34
|
+
{$props?.style}
|
|
31
35
|
tabindex="-1"
|
|
32
36
|
onmount={(el) => disableScroll(el)}
|
|
33
37
|
>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { ModalContextName, type ModalContext } from "./ModalTypes";
|
|
2
3
|
import hoverTrigger from "../mount/hoverTrigger";
|
|
3
4
|
|
|
4
5
|
interface ModalTriggerProps {
|
|
5
6
|
/** An ID for the root element */
|
|
6
7
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
class?:
|
|
8
|
+
/** Classes for the root element */
|
|
9
|
+
class?: ClassValue,
|
|
10
|
+
/** Styles for the root element */
|
|
11
|
+
style?: StyleValue,
|
|
9
12
|
/** Whether the modal is activated by click/press or by hover **/
|
|
10
13
|
activation?: "press" | "hover"
|
|
11
14
|
}
|
|
@@ -39,7 +42,8 @@ export default function ModalTrigger($props: ModalTriggerProps | undefined) {
|
|
|
39
42
|
<button
|
|
40
43
|
type="button"
|
|
41
44
|
{$props?.id}
|
|
42
|
-
class={
|
|
45
|
+
class={["torp-modal-trigger", $props?.class]}
|
|
46
|
+
{$props?.style}
|
|
43
47
|
onclick={handleClick}
|
|
44
48
|
onmount={(el) => hoverTrigger(el, { onHover: handleHover, onExit: handleHover })}
|
|
45
49
|
&ref={context.anchorElement}
|
package/dist/Modal/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
|
|
|
4
4
|
interface ModalProps {
|
|
5
5
|
/** An ID for the root element */
|
|
6
6
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
9
11
|
/** Whether the modal is visible */
|
|
10
12
|
visible?: boolean,
|
|
11
13
|
/** A function to be called when the user selects a response */
|
|
@@ -46,8 +48,10 @@ declare function Modal(
|
|
|
46
48
|
interface ModalContentProps {
|
|
47
49
|
/** An ID for the root element */
|
|
48
50
|
id?: string;
|
|
49
|
-
/**
|
|
50
|
-
class?:
|
|
51
|
+
/** Classes for the root element */
|
|
52
|
+
class?: ClassValue,
|
|
53
|
+
/** Styles for the root element */
|
|
54
|
+
style?: StyleValue,
|
|
51
55
|
}
|
|
52
56
|
|
|
53
57
|
/**
|
|
@@ -67,8 +71,10 @@ declare function ModalContent(
|
|
|
67
71
|
interface ModalOverlayProps {
|
|
68
72
|
/** An ID for the root element */
|
|
69
73
|
id?: string;
|
|
70
|
-
/**
|
|
71
|
-
class?:
|
|
74
|
+
/** Classes for the root element */
|
|
75
|
+
class?: ClassValue,
|
|
76
|
+
/** Styles for the root element */
|
|
77
|
+
style?: StyleValue,
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
/**
|
|
@@ -88,8 +94,10 @@ declare function ModalOverlay(
|
|
|
88
94
|
interface ModalTriggerProps {
|
|
89
95
|
/** An ID for the root element */
|
|
90
96
|
id?: string;
|
|
91
|
-
/**
|
|
92
|
-
class?:
|
|
97
|
+
/** Classes for the root element */
|
|
98
|
+
class?: ClassValue,
|
|
99
|
+
/** Styles for the root element */
|
|
100
|
+
style?: StyleValue,
|
|
93
101
|
/** Whether the modal is activated by click/press or by hover **/
|
|
94
102
|
activation?: "press" | "hover"
|
|
95
103
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
NavMenuContextName,
|
|
3
4
|
type NavMenuContext,
|
|
@@ -9,8 +10,10 @@ import {
|
|
|
9
10
|
interface NavMenuProps {
|
|
10
11
|
/** An ID for the root element */
|
|
11
12
|
id?: string;
|
|
12
|
-
/**
|
|
13
|
-
class?:
|
|
13
|
+
/** Classes for the root element */
|
|
14
|
+
class?: ClassValue,
|
|
15
|
+
/** Styles for the root element */
|
|
16
|
+
style?: StyleValue,
|
|
14
17
|
/** An ARIA label for describing the menu to screen readers */
|
|
15
18
|
ariaLabel?: string | undefined,
|
|
16
19
|
/** The orientation of the menu, which affects keyboard navigation */
|
|
@@ -173,7 +176,8 @@ export default function NavMenu($props: NavMenuProps | undefined) {
|
|
|
173
176
|
@render {
|
|
174
177
|
<nav
|
|
175
178
|
{$props?.id}
|
|
176
|
-
class={
|
|
179
|
+
class={["torp-nav-menu", $props?.class]}
|
|
180
|
+
{$props?.style}
|
|
177
181
|
tabindex="0"
|
|
178
182
|
role="menubar"
|
|
179
183
|
aria-label={$props?.ariaLabel}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { NavMenuContextName, type NavMenuContext } from "./NavMenuTypes";
|
|
2
3
|
|
|
3
4
|
interface NavMenuButtonProps {
|
|
4
5
|
/** An ID for the root element */
|
|
5
6
|
id?: string;
|
|
6
|
-
/**
|
|
7
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
8
11
|
/** Whether this button is disabled */
|
|
9
12
|
disabled?: boolean,
|
|
10
13
|
}
|
|
@@ -33,7 +36,8 @@ export default function NavMenuButton($props: NavMenuButtonProps | undefined) {
|
|
|
33
36
|
@render {
|
|
34
37
|
<button
|
|
35
38
|
{$props?.id}
|
|
36
|
-
class={
|
|
39
|
+
class={["torp-nav-menu-button", $props?.class]}
|
|
40
|
+
{$props?.style}
|
|
37
41
|
type="button"
|
|
38
42
|
{$props?.disabled}
|
|
39
43
|
role="menuitem"
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { NavMenuContextName, type NavMenuContext } from "./NavMenuTypes";
|
|
2
3
|
|
|
3
4
|
interface NavMenuElementProps {
|
|
4
5
|
/** An ID for the root element */
|
|
5
6
|
id?: string;
|
|
6
|
-
/**
|
|
7
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
8
11
|
/** Whether this button is disabled */
|
|
9
12
|
disabled?: boolean,
|
|
10
13
|
/** An element that can be focused via keyboard navigation */
|
|
@@ -35,7 +38,8 @@ export default function NavMenuElement($props: NavMenuElementProps | undefined)
|
|
|
35
38
|
@render {
|
|
36
39
|
<div
|
|
37
40
|
{$props?.id}
|
|
38
|
-
class={
|
|
41
|
+
class={["torp-nav-menu-div", $props?.class]}
|
|
42
|
+
{$props?.style}
|
|
39
43
|
type="div"
|
|
40
44
|
role="menuitem"
|
|
41
45
|
aria-disabled={$props?.disabled ? "true" : undefined}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { NavMenuGroupContextName, type NavMenuGroupContext } from "./NavMenuTypes";
|
|
2
3
|
|
|
3
4
|
interface NavMenuGroupProps {
|
|
4
5
|
/** An ID for the root element */
|
|
5
6
|
id?: string;
|
|
6
|
-
/**
|
|
7
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
8
11
|
/** An ARIA label for describing the group to screen readers */
|
|
9
12
|
ariaLabel?: string,
|
|
10
13
|
}
|
|
@@ -26,7 +29,8 @@ export default function NavMenuGroup($props: NavMenuGroupProps | undefined) {
|
|
|
26
29
|
@render {
|
|
27
30
|
<div
|
|
28
31
|
{$props?.id}
|
|
29
|
-
class={
|
|
32
|
+
class={["torp-nav-menu-group", $props?.class]}
|
|
33
|
+
{$props?.style}
|
|
30
34
|
role="group"
|
|
31
35
|
aria-label={$props?.ariaLabel}
|
|
32
36
|
aria-labelledby={$state.headerId}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import getId from "../utils/getId";
|
|
2
3
|
import { NavMenuGroupContextName, type NavMenuGroupContext } from "./NavMenuTypes";
|
|
3
4
|
|
|
4
5
|
interface NavMenuGroupHeaderProps {
|
|
5
6
|
/** An ID for the root element */
|
|
6
7
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
class?:
|
|
8
|
+
/** Classes for the root element */
|
|
9
|
+
class?: ClassValue,
|
|
10
|
+
/** Styles for the root element */
|
|
11
|
+
style?: StyleValue,
|
|
9
12
|
/** The type of HTML header to use */
|
|
10
13
|
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6",
|
|
11
14
|
}
|
|
@@ -29,7 +32,8 @@ export default function NavMenuGroupHeader($props: NavMenuGroupHeaderProps | und
|
|
|
29
32
|
@// TODO: self={$props.as}
|
|
30
33
|
<h4
|
|
31
34
|
id={$props?.id ?? defaultId}
|
|
32
|
-
class={
|
|
35
|
+
class={["torp-nav-menu-group-header", $props?.class]}
|
|
36
|
+
{$props?.style}
|
|
33
37
|
>
|
|
34
38
|
<slot />
|
|
35
39
|
</h4>
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
2
2
|
import { NavMenuContextName, type NavMenuContext } from "./NavMenuTypes";
|
|
3
3
|
|
|
4
4
|
interface NavMenuLinkProps {
|
|
5
5
|
/** An ID for the root element */
|
|
6
6
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
9
11
|
/** The URL for the menu link */
|
|
10
12
|
href: string,
|
|
11
13
|
/** Whether the menu link should open in a new tab/window */
|
|
@@ -38,7 +40,8 @@ export default function NavMenuLink($props: NavMenuLinkProps | undefined) {
|
|
|
38
40
|
@render {
|
|
39
41
|
<a
|
|
40
42
|
{$props?.id}
|
|
41
|
-
class={
|
|
43
|
+
class={["torp-nav-menu-link", $props?.class]}
|
|
44
|
+
{$props?.style}
|
|
42
45
|
{$props?.href}
|
|
43
46
|
{$props?.disabled}
|
|
44
47
|
target={$props?.newWindow ? "_blank" : undefined}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { NavMenuPopoutContextName, type NavMenuPopoutContext } from "./NavMenuTypes";
|
|
2
3
|
|
|
3
4
|
interface NavMenuPopoutProps {
|
|
4
5
|
/** An ID for the root element */
|
|
5
6
|
id?: string;
|
|
6
|
-
/**
|
|
7
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
8
11
|
/** Whether the popout is visible */
|
|
9
12
|
visible?: boolean,
|
|
10
13
|
/** Raised when the popout is opened or closed */
|
|
@@ -76,7 +79,8 @@ export default function NavMenuPopout($props: NavMenuPopoutProps | undefined) {
|
|
|
76
79
|
@render {
|
|
77
80
|
<div
|
|
78
81
|
{$props?.id}
|
|
79
|
-
class={
|
|
82
|
+
class={["torp-nav-menu-popout", $props?.class]}
|
|
83
|
+
{$props?.style}
|
|
80
84
|
onmouseleave={handleMouseLeave}
|
|
81
85
|
>
|
|
82
86
|
<slot />
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
NavMenuContextName,
|
|
3
4
|
NavMenuPopoutContextName,
|
|
@@ -8,8 +9,10 @@ import {
|
|
|
8
9
|
interface NavMenuPopoutButtonProps {
|
|
9
10
|
/** An ID for the root element */
|
|
10
11
|
id?: string;
|
|
11
|
-
/**
|
|
12
|
-
class?:
|
|
12
|
+
/** Classes for the root element */
|
|
13
|
+
class?: ClassValue,
|
|
14
|
+
/** Styles for the root element */
|
|
15
|
+
style?: StyleValue,
|
|
13
16
|
/** The delay before showing the popout, in milliseconds */
|
|
14
17
|
hoverDelay?: number,
|
|
15
18
|
/** Whether this button is disabled */
|
|
@@ -102,7 +105,8 @@ export default function NavMenuPopoutButton($props: NavMenuPopoutButtonProps | u
|
|
|
102
105
|
@render {
|
|
103
106
|
<button
|
|
104
107
|
{$props?.id}
|
|
105
|
-
class={
|
|
108
|
+
class={["torp-nav-menu-popout-button", $props?.class]}
|
|
109
|
+
{$props?.style}
|
|
106
110
|
type="button"
|
|
107
111
|
{$props?.disabled}
|
|
108
112
|
role="menuitem"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
2
2
|
import getScrollParent from "../utils/getScrollParent";
|
|
3
3
|
import setPopoverPosition from "../utils/setPopoverPosition";
|
|
4
4
|
import { NavMenuPopoutContextName, type NavMenuPopoutContext } from "./NavMenuTypes";
|
|
@@ -6,8 +6,10 @@ import { NavMenuPopoutContextName, type NavMenuPopoutContext } from "./NavMenuTy
|
|
|
6
6
|
interface NavMenuPopoutContentProps {
|
|
7
7
|
/** An ID for the root element */
|
|
8
8
|
id?: string;
|
|
9
|
-
/**
|
|
10
|
-
class?:
|
|
9
|
+
/** Classes for the root element */
|
|
10
|
+
class?: ClassValue,
|
|
11
|
+
/** Styles for the root element */
|
|
12
|
+
style?: StyleValue,
|
|
11
13
|
/** Where the popout will be shown, relative to the popout button */
|
|
12
14
|
side?: "top" | "right" | "bottom" | "left",
|
|
13
15
|
/** How the popout will be aligned, relative to the popout button */
|
|
@@ -78,7 +80,8 @@ export default function NavMenuPopoutContent($props: NavMenuPopoutContentProps |
|
|
|
78
80
|
@if ($state.visible) {
|
|
79
81
|
<div
|
|
80
82
|
{$props?.id}
|
|
81
|
-
class={
|
|
83
|
+
class={["torp-nav-menu-popout-content", $props?.class]}
|
|
84
|
+
{$props?.style}
|
|
82
85
|
&ref={div}
|
|
83
86
|
onmount={show}
|
|
84
87
|
>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
|
|
2
3
|
interface NavMenuSeparatorProps {
|
|
3
4
|
/** An ID for the root element */
|
|
4
5
|
id?: string;
|
|
5
|
-
/**
|
|
6
|
-
class?:
|
|
6
|
+
/** Classes for the root element */
|
|
7
|
+
class?: ClassValue,
|
|
8
|
+
/** Styles for the root element */
|
|
9
|
+
style?: StyleValue,
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
/**
|
package/dist/NavMenu/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
|
|
|
4
4
|
interface NavMenuProps {
|
|
5
5
|
/** An ID for the root element */
|
|
6
6
|
id?: string;
|
|
7
|
-
/**
|
|
8
|
-
class?:
|
|
7
|
+
/** Classes for the root element */
|
|
8
|
+
class?: ClassValue,
|
|
9
|
+
/** Styles for the root element */
|
|
10
|
+
style?: StyleValue,
|
|
9
11
|
/** An ARIA label for describing the menu to screen readers */
|
|
10
12
|
ariaLabel?: string | undefined,
|
|
11
13
|
/** The orientation of the menu, which affects keyboard navigation */
|
|
@@ -41,8 +43,10 @@ declare function NavMenu(
|
|
|
41
43
|
interface NavMenuButtonProps {
|
|
42
44
|
/** An ID for the root element */
|
|
43
45
|
id?: string;
|
|
44
|
-
/**
|
|
45
|
-
class?:
|
|
46
|
+
/** Classes for the root element */
|
|
47
|
+
class?: ClassValue,
|
|
48
|
+
/** Styles for the root element */
|
|
49
|
+
style?: StyleValue,
|
|
46
50
|
/** Whether this button is disabled */
|
|
47
51
|
disabled?: boolean,
|
|
48
52
|
}
|
|
@@ -64,8 +68,10 @@ declare function NavMenuButton(
|
|
|
64
68
|
interface NavMenuElementProps {
|
|
65
69
|
/** An ID for the root element */
|
|
66
70
|
id?: string;
|
|
67
|
-
/**
|
|
68
|
-
class?:
|
|
71
|
+
/** Classes for the root element */
|
|
72
|
+
class?: ClassValue,
|
|
73
|
+
/** Styles for the root element */
|
|
74
|
+
style?: StyleValue,
|
|
69
75
|
/** Whether this button is disabled */
|
|
70
76
|
disabled?: boolean,
|
|
71
77
|
/** An element that can be focused via keyboard navigation */
|
|
@@ -89,8 +95,10 @@ declare function NavMenuElement(
|
|
|
89
95
|
interface NavMenuGroupProps {
|
|
90
96
|
/** An ID for the root element */
|
|
91
97
|
id?: string;
|
|
92
|
-
/**
|
|
93
|
-
class?:
|
|
98
|
+
/** Classes for the root element */
|
|
99
|
+
class?: ClassValue,
|
|
100
|
+
/** Styles for the root element */
|
|
101
|
+
style?: StyleValue,
|
|
94
102
|
/** An ARIA label for describing the group to screen readers */
|
|
95
103
|
ariaLabel?: string,
|
|
96
104
|
}
|
|
@@ -111,8 +119,10 @@ declare function NavMenuGroup(
|
|
|
111
119
|
interface NavMenuGroupHeaderProps {
|
|
112
120
|
/** An ID for the root element */
|
|
113
121
|
id?: string;
|
|
114
|
-
/**
|
|
115
|
-
class?:
|
|
122
|
+
/** Classes for the root element */
|
|
123
|
+
class?: ClassValue,
|
|
124
|
+
/** Styles for the root element */
|
|
125
|
+
style?: StyleValue,
|
|
116
126
|
/** The type of HTML header to use */
|
|
117
127
|
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6",
|
|
118
128
|
}
|
|
@@ -133,8 +143,10 @@ declare function NavMenuGroupHeader(
|
|
|
133
143
|
interface NavMenuLinkProps {
|
|
134
144
|
/** An ID for the root element */
|
|
135
145
|
id?: string;
|
|
136
|
-
/**
|
|
137
|
-
class?:
|
|
146
|
+
/** Classes for the root element */
|
|
147
|
+
class?: ClassValue,
|
|
148
|
+
/** Styles for the root element */
|
|
149
|
+
style?: StyleValue,
|
|
138
150
|
/** The URL for the menu link */
|
|
139
151
|
href: string,
|
|
140
152
|
/** Whether the menu link should open in a new tab/window */
|
|
@@ -160,8 +172,10 @@ declare function NavMenuLink(
|
|
|
160
172
|
interface NavMenuPopoutProps {
|
|
161
173
|
/** An ID for the root element */
|
|
162
174
|
id?: string;
|
|
163
|
-
/**
|
|
164
|
-
class?:
|
|
175
|
+
/** Classes for the root element */
|
|
176
|
+
class?: ClassValue,
|
|
177
|
+
/** Styles for the root element */
|
|
178
|
+
style?: StyleValue,
|
|
165
179
|
/** Whether the popout is visible */
|
|
166
180
|
visible?: boolean,
|
|
167
181
|
/** Raised when the popout is opened or closed */
|
|
@@ -197,8 +211,10 @@ declare function NavMenuPopout(
|
|
|
197
211
|
interface NavMenuPopoutButtonProps {
|
|
198
212
|
/** An ID for the root element */
|
|
199
213
|
id?: string;
|
|
200
|
-
/**
|
|
201
|
-
class?:
|
|
214
|
+
/** Classes for the root element */
|
|
215
|
+
class?: ClassValue,
|
|
216
|
+
/** Styles for the root element */
|
|
217
|
+
style?: StyleValue,
|
|
202
218
|
/** The delay before showing the popout, in milliseconds */
|
|
203
219
|
hoverDelay?: number,
|
|
204
220
|
/** Whether this button is disabled */
|
|
@@ -222,8 +238,10 @@ declare function NavMenuPopoutButton(
|
|
|
222
238
|
interface NavMenuPopoutContentProps {
|
|
223
239
|
/** An ID for the root element */
|
|
224
240
|
id?: string;
|
|
225
|
-
/**
|
|
226
|
-
class?:
|
|
241
|
+
/** Classes for the root element */
|
|
242
|
+
class?: ClassValue,
|
|
243
|
+
/** Styles for the root element */
|
|
244
|
+
style?: StyleValue,
|
|
227
245
|
/** Where the popout will be shown, relative to the popout button */
|
|
228
246
|
side?: "top" | "right" | "bottom" | "left",
|
|
229
247
|
/** How the popout will be aligned, relative to the popout button */
|
|
@@ -247,8 +265,10 @@ declare function NavMenuPopoutContent(
|
|
|
247
265
|
interface NavMenuSeparatorProps {
|
|
248
266
|
/** An ID for the root element */
|
|
249
267
|
id?: string;
|
|
250
|
-
/**
|
|
251
|
-
class?:
|
|
268
|
+
/** Classes for the root element */
|
|
269
|
+
class?: ClassValue,
|
|
270
|
+
/** Styles for the root element */
|
|
271
|
+
style?: StyleValue,
|
|
252
272
|
}
|
|
253
273
|
|
|
254
274
|
/**
|