@torpor/ui 0.3.2 → 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 +14 -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 +11 -15
- package/dist/Form/Form.torp +7 -3
- package/dist/Form/Hidden.torp +1 -1
- 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 +43 -25
- 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 +11 -15
- package/src/Form/Form.torp +7 -3
- package/src/Form/Hidden.torp +1 -1
- 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,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import getId from "../utils/getId";
|
|
2
3
|
import { DialogContextName, type DialogContext } from "./DialogTypes";
|
|
3
4
|
|
|
4
5
|
interface DialogHeaderProps {
|
|
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 header will be announced by screen readers when the Dialog is opened */
|
|
10
13
|
ariaAnnounce?: boolean,
|
|
11
14
|
}
|
|
@@ -33,7 +36,8 @@ export default function DialogHeader($props: DialogHeaderProps | undefined) {
|
|
|
33
36
|
@render {
|
|
34
37
|
<div
|
|
35
38
|
id={$props?.id ?? defaultId}
|
|
36
|
-
class={
|
|
39
|
+
class={["torp-dialog-footer", $props?.class]}
|
|
40
|
+
{$props?.style}
|
|
37
41
|
>
|
|
38
42
|
<slot />
|
|
39
43
|
</div>
|
package/dist/Dialog/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
|
|
|
4
4
|
interface DialogProps {
|
|
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 popover to screen readers */
|
|
10
12
|
ariaLabel?: string,
|
|
11
13
|
/** Whether the dialog should alert the user via the screen reader */
|
|
@@ -46,8 +48,10 @@ declare function Dialog(
|
|
|
46
48
|
interface DialogBodyProps {
|
|
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
|
/** Whether the body content will be announced by screen readers when the Dialog is opened */
|
|
52
56
|
ariaAnnounce?: boolean,
|
|
53
57
|
}
|
|
@@ -69,8 +73,10 @@ declare function DialogBody(
|
|
|
69
73
|
interface DialogButtonProps {
|
|
70
74
|
/** An ID for the root element */
|
|
71
75
|
id?: string;
|
|
72
|
-
/**
|
|
73
|
-
class?:
|
|
76
|
+
/** Classes for the root element */
|
|
77
|
+
class?: ClassValue,
|
|
78
|
+
/** Styles for the root element */
|
|
79
|
+
style?: StyleValue,
|
|
74
80
|
/** The value that should be returned when this button is pressed and the Dialog was invoked by calling showContextual, showPrompt or showPopover */
|
|
75
81
|
value?: any,
|
|
76
82
|
/** "confirm" if the button should respond to the Enter key or "cancel" if the button should respond to the Escape key */
|
|
@@ -98,8 +104,10 @@ declare function DialogButton(
|
|
|
98
104
|
interface DialogFooterProps {
|
|
99
105
|
/** An ID for the root element */
|
|
100
106
|
id?: string;
|
|
101
|
-
/**
|
|
102
|
-
class?:
|
|
107
|
+
/** Classes for the root element */
|
|
108
|
+
class?: ClassValue,
|
|
109
|
+
/** Styles for the root element */
|
|
110
|
+
style?: StyleValue,
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
/**
|
|
@@ -118,8 +126,10 @@ declare function DialogFooter(
|
|
|
118
126
|
interface DialogHeaderProps {
|
|
119
127
|
/** An ID for the root element */
|
|
120
128
|
id?: string;
|
|
121
|
-
/**
|
|
122
|
-
class?:
|
|
129
|
+
/** Classes for the root element */
|
|
130
|
+
class?: ClassValue,
|
|
131
|
+
/** Styles for the root element */
|
|
132
|
+
style?: StyleValue,
|
|
123
133
|
/** Whether the header will be announced by screen readers when the Dialog is opened */
|
|
124
134
|
ariaAnnounce?: boolean,
|
|
125
135
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { DisclosureContextName, type DisclosureContext, type DisclosureState } from "./DisclosureTypes";
|
|
2
3
|
|
|
3
4
|
interface DisclosureProps {
|
|
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 disclosure is expanded and its content visible */
|
|
9
12
|
expanded?: boolean,
|
|
10
13
|
/** If set to true, the user cannot interact with this disclosure */
|
|
@@ -68,7 +71,8 @@ export default function Disclosure($props: DisclosureProps | undefined) {
|
|
|
68
71
|
@render {
|
|
69
72
|
<div
|
|
70
73
|
{$props?.id}
|
|
71
|
-
class={
|
|
74
|
+
class={["torp-disclosure-item", $props?.class]}
|
|
75
|
+
{$props?.style}
|
|
72
76
|
data-state={$state.expanded ? "open" : "closed"}
|
|
73
77
|
data-disabled={$state.disabled ? "true" : undefined}
|
|
74
78
|
>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import getId from "../utils/getId";
|
|
2
3
|
import { DisclosureContextName, type DisclosureContext } from "./DisclosureTypes";
|
|
3
4
|
|
|
4
5
|
interface DisclosureContentProps {
|
|
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 this content should act as a region. Set this when the content contains heading elements or a nested Disclosure */
|
|
10
13
|
ariaRegion?: boolean,
|
|
11
14
|
}
|
|
@@ -28,7 +31,8 @@ export default function DisclosureContent($props: DisclosureContentProps | undef
|
|
|
28
31
|
@render {
|
|
29
32
|
<div
|
|
30
33
|
id={$props?.id ?? defaultId}
|
|
31
|
-
class={
|
|
34
|
+
class={["torp-disclosure-content", $props?.class]}
|
|
35
|
+
{$props?.style}
|
|
32
36
|
role={$props?.ariaRegion ? "region" : undefined}
|
|
33
37
|
aria-labelledby={$state.headerId}
|
|
34
38
|
data-state={$state.expanded ? "open" : "closed"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { DisclosureContextName, type DisclosureContext } from "./DisclosureTypes";
|
|
2
3
|
|
|
3
4
|
interface DisclosureHeaderProps {
|
|
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
|
/** The type of HTML header to use */
|
|
9
12
|
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6",
|
|
10
13
|
}
|
|
@@ -31,7 +34,8 @@ export default function DisclosureHeader($props: DisclosureHeaderProps | undefin
|
|
|
31
34
|
@// TODO: $props.as
|
|
32
35
|
<h4
|
|
33
36
|
{$props?.id}
|
|
34
|
-
class={
|
|
37
|
+
class={["torp-disclosure-header", $props?.class]}
|
|
38
|
+
{$props?.style}
|
|
35
39
|
data-state={$state.expanded ? "open" : "closed"}
|
|
36
40
|
data-disabled={$state.disabled ? "true" : undefined}
|
|
37
41
|
>
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import getId from "../utils/getId";
|
|
2
3
|
import { DisclosureContextName, type DisclosureContext } from "./DisclosureTypes";
|
|
3
4
|
|
|
4
5
|
interface DisclosureTriggerProps {
|
|
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
|
/**
|
|
@@ -28,7 +31,8 @@ export default function DisclosureTrigger($props: DisclosureTriggerProps | undef
|
|
|
28
31
|
<button
|
|
29
32
|
type="button"
|
|
30
33
|
id={$props?.id ?? defaultId}
|
|
31
|
-
class={
|
|
34
|
+
class={["torp-disclosure-trigger", $props?.class]}
|
|
35
|
+
{$props?.style}
|
|
32
36
|
disabled={$state.disabled}
|
|
33
37
|
aria-expanded={$state.expanded.toString()}
|
|
34
38
|
aria-disabled={$state.disabled}
|
|
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
|
|
|
4
4
|
interface DisclosureProps {
|
|
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 disclosure is expanded and its content visible */
|
|
10
12
|
expanded?: boolean,
|
|
11
13
|
/** If set to true, the user cannot interact with this disclosure */
|
|
@@ -43,8 +45,10 @@ declare function Disclosure(
|
|
|
43
45
|
interface DisclosureContentProps {
|
|
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 this content should act as a region. Set this when the content contains heading elements or a nested Disclosure */
|
|
49
53
|
ariaRegion?: boolean,
|
|
50
54
|
}
|
|
@@ -65,8 +69,10 @@ declare function DisclosureContent(
|
|
|
65
69
|
interface DisclosureHeaderProps {
|
|
66
70
|
/** An ID for the root element */
|
|
67
71
|
id?: string;
|
|
68
|
-
/**
|
|
69
|
-
class?:
|
|
72
|
+
/** Classes for the root element */
|
|
73
|
+
class?: ClassValue,
|
|
74
|
+
/** Styles for the root element */
|
|
75
|
+
style?: StyleValue,
|
|
70
76
|
/** The type of HTML header to use */
|
|
71
77
|
as?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6",
|
|
72
78
|
}
|
|
@@ -95,8 +101,10 @@ declare function DisclosureHeader(
|
|
|
95
101
|
interface DisclosureTriggerProps {
|
|
96
102
|
/** An ID for the root element */
|
|
97
103
|
id?: string;
|
|
98
|
-
/**
|
|
99
|
-
class?:
|
|
104
|
+
/** Classes for the root element */
|
|
105
|
+
class?: ClassValue,
|
|
106
|
+
/** Styles for the root element */
|
|
107
|
+
style?: StyleValue,
|
|
100
108
|
}
|
|
101
109
|
|
|
102
110
|
/**
|
package/dist/Drawer/Drawer.torp
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { DrawerContextName, type DrawerContext, type DrawerState } from "./DrawerTypes";
|
|
2
3
|
|
|
3
4
|
interface DrawerProps {
|
|
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 drawer is modal. If true, an overlay should be supplied to obscure outside content, and only the drawer content will be visible to screen readers */
|
|
9
12
|
modal?: boolean,
|
|
10
13
|
/** Whether the drawer is visible */
|
|
@@ -115,7 +118,8 @@ export default function Drawer($props: DrawerProps | undefined) {
|
|
|
115
118
|
@render {
|
|
116
119
|
<div
|
|
117
120
|
{$props?.id}
|
|
118
|
-
class={
|
|
121
|
+
class={["torp-drawer", $props?.class]}
|
|
122
|
+
{$props?.style}
|
|
119
123
|
>
|
|
120
124
|
<slot />
|
|
121
125
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
2
2
|
import { slide } from "../motion";
|
|
3
3
|
import { addDocumentEvent, removeDocumentEvent } from "../utils/documentEvents";
|
|
4
4
|
import { DrawerContextName, type DrawerContext } from "./DrawerTypes";
|
|
@@ -6,8 +6,10 @@ import { DrawerContextName, type DrawerContext } from "./DrawerTypes";
|
|
|
6
6
|
interface DrawerContentProps {
|
|
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
|
}
|
|
12
14
|
|
|
13
15
|
/**
|
|
@@ -67,7 +69,8 @@ export default function DrawerContent($props: DrawerContentProps | undefined) {
|
|
|
67
69
|
@if ($state.visible) {
|
|
68
70
|
<div
|
|
69
71
|
{$props?.id}
|
|
70
|
-
class={
|
|
72
|
+
class={["torp-drawer-content", $props?.class]}
|
|
73
|
+
{$props?.style}
|
|
71
74
|
style="position: fixed;"
|
|
72
75
|
transition={(e) => slide(e, { side: $state.position })}
|
|
73
76
|
&ref={drawer}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { disableScroll } from "../mount/disableScroll";
|
|
2
3
|
import { DrawerContextName, type DrawerContext } from "./DrawerTypes";
|
|
3
4
|
|
|
4
5
|
interface DrawerOverlayProps {
|
|
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 DrawerOverlay($props: DrawerOverlayProps | undefined) {
|
|
|
27
30
|
@if ($state.visible) {
|
|
28
31
|
<div
|
|
29
32
|
{$props?.id}
|
|
30
|
-
class={
|
|
33
|
+
class={["torp-drawer-overlay", $props?.class]}
|
|
34
|
+
{$props?.style}
|
|
31
35
|
tabindex="-1"
|
|
32
36
|
onmount={(el) => disableScroll(el)}
|
|
33
37
|
>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { DrawerContextName, type DrawerContext } from "./DrawerTypes";
|
|
2
3
|
|
|
3
4
|
interface DrawerTriggerProps {
|
|
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
|
}
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -26,7 +29,8 @@ export default function DrawerTrigger($props: DrawerTriggerProps | undefined) {
|
|
|
26
29
|
<button
|
|
27
30
|
type="button"
|
|
28
31
|
{$props?.id}
|
|
29
|
-
class={
|
|
32
|
+
class={["torp-drawer-trigger", $props?.class]}
|
|
33
|
+
{$props?.style}
|
|
30
34
|
onclick={handleClick}
|
|
31
35
|
>
|
|
32
36
|
<slot />
|
package/dist/Drawer/index.d.ts
CHANGED
|
@@ -4,8 +4,10 @@ import { type SlotRender } from "@torpor/view";
|
|
|
4
4
|
interface DrawerProps {
|
|
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 drawer is modal. If true, an overlay should be supplied to obscure outside content, and only the drawer content will be visible to screen readers */
|
|
10
12
|
modal?: boolean,
|
|
11
13
|
/** Whether the drawer is visible */
|
|
@@ -49,8 +51,10 @@ declare function Drawer(
|
|
|
49
51
|
interface DrawerContentProps {
|
|
50
52
|
/** An ID for the root element */
|
|
51
53
|
id?: string;
|
|
52
|
-
/**
|
|
53
|
-
class?:
|
|
54
|
+
/** Classes for the root element */
|
|
55
|
+
class?: ClassValue,
|
|
56
|
+
/** Styles for the root element */
|
|
57
|
+
style?: StyleValue,
|
|
54
58
|
}
|
|
55
59
|
|
|
56
60
|
/**
|
|
@@ -69,8 +73,10 @@ declare function DrawerContent(
|
|
|
69
73
|
interface DrawerOverlayProps {
|
|
70
74
|
/** An ID for the root element */
|
|
71
75
|
id?: string;
|
|
72
|
-
/**
|
|
73
|
-
class?:
|
|
76
|
+
/** Classes for the root element */
|
|
77
|
+
class?: ClassValue,
|
|
78
|
+
/** Styles for the root element */
|
|
79
|
+
style?: StyleValue,
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
/**
|
|
@@ -90,8 +96,10 @@ declare function DrawerOverlay(
|
|
|
90
96
|
interface DrawerTriggerProps {
|
|
91
97
|
/** An ID for the root element */
|
|
92
98
|
id?: string;
|
|
93
|
-
/**
|
|
94
|
-
class?:
|
|
99
|
+
/** Classes for the root element */
|
|
100
|
+
class?: ClassValue,
|
|
101
|
+
/** Styles for the root element */
|
|
102
|
+
style?: StyleValue,
|
|
95
103
|
}
|
|
96
104
|
|
|
97
105
|
/**
|
package/dist/Form/CheckBox.torp
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import getId from "../utils/getId";
|
|
2
3
|
import { FormContextName, FieldContextName, type FormContext, type FieldContext } from "./FormTypes";
|
|
3
4
|
|
|
4
5
|
interface CheckBoxProps {
|
|
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 name of the checkbox's form data field */
|
|
10
13
|
name?: string,
|
|
11
14
|
/** Whether the checkbox is checked */
|
package/dist/Form/Field.torp
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
FormContextName,
|
|
3
4
|
FieldContextName,
|
|
@@ -10,8 +11,10 @@ import { StandardSchemaV1 } from "./StandardSchemaV1"
|
|
|
10
11
|
interface FieldProps {
|
|
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
|
/** The name of the data that this field contains */
|
|
16
19
|
name: string,
|
|
17
20
|
/** The data value that this field is bound to */
|
|
@@ -82,7 +85,8 @@ export default function Field($props: FieldProps) {
|
|
|
82
85
|
@render {
|
|
83
86
|
<div
|
|
84
87
|
{$props?.id}
|
|
85
|
-
class={
|
|
88
|
+
class={["torp-field", $props?.class]}
|
|
89
|
+
{$props?.style}
|
|
86
90
|
data-valid={$state.valid ? "valid" : "invalid"}
|
|
87
91
|
>
|
|
88
92
|
<slot />
|
package/dist/Form/File.torp
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import getId from "../utils/getId";
|
|
2
3
|
import { FormContextName, FieldContextName, type FormContext, type FieldContext } from "./FormTypes";
|
|
3
4
|
|
|
4
5
|
interface FileProps {
|
|
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 name of the input's form data field */
|
|
10
13
|
name?: string,
|
|
11
14
|
/** The type of files that this input accepts e.g. `image/*` */
|
|
12
|
-
|
|
13
|
-
/** The data value that this field is bound to */
|
|
14
|
-
value?: any,
|
|
15
|
+
accept?: string,
|
|
15
16
|
/** Text to display when the input value is empty */
|
|
16
17
|
placeholder?: string,
|
|
17
18
|
/** Whether the input should be readonly */
|
|
@@ -51,19 +52,13 @@ export default function File($props: FileProps | undefined) {
|
|
|
51
52
|
// Use the FieldContext's state, or create a new one
|
|
52
53
|
let $state = fieldContext?.state ?? $watch({
|
|
53
54
|
inputId: $props?.id ?? defaultId,
|
|
54
|
-
value
|
|
55
|
+
// You can't use value with a file input
|
|
56
|
+
value: null,
|
|
55
57
|
errors: {} as Record<string, string>,
|
|
56
58
|
valid: false,
|
|
57
59
|
message: "",
|
|
58
60
|
});
|
|
59
61
|
|
|
60
|
-
// Binding
|
|
61
|
-
$run(() => {
|
|
62
|
-
if ($props !== undefined) {
|
|
63
|
-
$props.value = $state.value;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
62
|
// Set the input ID now that we know it and it will get linked with the associated label
|
|
68
63
|
$state.inputId = $props?.id ?? defaultId;
|
|
69
64
|
|
|
@@ -89,10 +84,11 @@ export default function File($props: FileProps | undefined) {
|
|
|
89
84
|
@render {
|
|
90
85
|
<input
|
|
91
86
|
id={$props?.id ?? defaultId}
|
|
92
|
-
class={
|
|
87
|
+
class={["torp-file", $props?.class]}
|
|
88
|
+
{$props?.style}
|
|
93
89
|
type="file"
|
|
94
90
|
{name}
|
|
95
|
-
|
|
91
|
+
{$props?.accept}
|
|
96
92
|
{$props?.placeholder}
|
|
97
93
|
{$props?.readonly}
|
|
98
94
|
{$props?.maxlength}
|
package/dist/Form/Form.torp
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { FormContextName, type ValidationIssue, type FormContext } from "./FormTypes";
|
|
2
3
|
import { StandardSchemaV1 } from "./StandardSchemaV1"
|
|
3
4
|
|
|
4
5
|
interface FormProps {
|
|
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 data to display in the form */
|
|
10
13
|
data?: any,
|
|
11
14
|
/** Where to post the form's data **/
|
|
@@ -129,7 +132,8 @@ export default function Form($props: FormProps | undefined) {
|
|
|
129
132
|
@render {
|
|
130
133
|
<form
|
|
131
134
|
{$props?.id}
|
|
132
|
-
class={
|
|
135
|
+
class={["torp-form", $props?.class]}
|
|
136
|
+
{$props?.style}
|
|
133
137
|
method={$props?.method ?? "POST"}
|
|
134
138
|
enctype={$props?.enctype ?? ($state.hasFile ? "multipart/form-data" : undefined)}
|
|
135
139
|
onsubmit={handleSubmit}
|
package/dist/Form/Hidden.torp
CHANGED
package/dist/Form/Input.torp
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import getId from "../utils/getId";
|
|
2
3
|
import { FormContextName, FieldContextName, type FormContext, type FieldContext } from "./FormTypes";
|
|
3
4
|
|
|
4
5
|
interface InputProps {
|
|
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 input type */
|
|
10
13
|
type?: string, // TODO: "text" | "number" | "password" | "email" | "url" | "tel",
|
|
11
14
|
/** The name of the input's form data field */
|
|
@@ -90,7 +93,8 @@ export default function Input($props: InputProps | undefined) {
|
|
|
90
93
|
@render {
|
|
91
94
|
<input
|
|
92
95
|
id={$props?.id ?? defaultId}
|
|
93
|
-
class={
|
|
96
|
+
class={["torp-input", $props?.class]}
|
|
97
|
+
{$props?.style}
|
|
94
98
|
{type}
|
|
95
99
|
{name}
|
|
96
100
|
&value={$state.value}
|
package/dist/Form/Label.torp
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { FieldContextName, type FieldContext } from "./FormTypes";
|
|
2
3
|
|
|
3
4
|
interface LabelProps {
|
|
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
|
}
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -21,7 +24,8 @@ export default function Label($props: LabelProps | undefined) {
|
|
|
21
24
|
@render {
|
|
22
25
|
<label
|
|
23
26
|
{$props?.id}
|
|
24
|
-
class={
|
|
27
|
+
class={["torp-label", $props?.class]}
|
|
28
|
+
{$props?.style}
|
|
25
29
|
for={$state.inputId}
|
|
26
30
|
data-valid={$state.valid ? "valid" : "invalid"}
|
|
27
31
|
>
|
package/dist/Form/Message.torp
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { FieldContextName, type FieldContext } from "./FormTypes";
|
|
2
3
|
|
|
3
4
|
interface MessageProps {
|
|
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
|
}
|
|
9
12
|
|
|
10
13
|
/**
|
|
@@ -23,7 +26,8 @@ export default function Message($props: MessageProps | undefined) {
|
|
|
23
26
|
@if ($state.message) {
|
|
24
27
|
<div
|
|
25
28
|
{$props?.id}
|
|
26
|
-
class={
|
|
29
|
+
class={["torp-message", $props?.class]}
|
|
30
|
+
{$props?.style}
|
|
27
31
|
data-valid={$state.valid ? "valid" : "invalid"}
|
|
28
32
|
>
|
|
29
33
|
<slot name="message">
|
package/dist/Form/Option.torp
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import getId from "../utils/getId";
|
|
2
3
|
import { FormContextName, FieldContextName, type FormContext, type FieldContext } from "./FormTypes";
|
|
3
4
|
|
|
4
5
|
interface OptionProps {
|
|
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 data value that this option has */
|
|
10
13
|
value?: any,
|
|
11
14
|
};
|
|
@@ -17,8 +20,9 @@ export default function Option($props: OptionProps | undefined) {
|
|
|
17
20
|
@render {
|
|
18
21
|
<option
|
|
19
22
|
{$props?.id}
|
|
20
|
-
class={
|
|
21
|
-
|
|
23
|
+
class={["torp-option", $props?.class]}
|
|
24
|
+
{$props?.style}
|
|
25
|
+
&value={$props.value}
|
|
22
26
|
/>
|
|
23
27
|
}
|
|
24
28
|
}
|