@torpor/ui 0.3.3 → 0.3.5
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 +7 -3
- package/dist/Form/Form.torp +8 -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 +9 -9
- 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 +8 -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
- package/vitest.config.ts +2 -2
package/src/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/src/Form/File.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 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/*` */
|
|
@@ -81,7 +84,8 @@ export default function File($props: FileProps | undefined) {
|
|
|
81
84
|
@render {
|
|
82
85
|
<input
|
|
83
86
|
id={$props?.id ?? defaultId}
|
|
84
|
-
class={
|
|
87
|
+
class={["torp-file", $props?.class]}
|
|
88
|
+
{$props?.style}
|
|
85
89
|
type="file"
|
|
86
90
|
{name}
|
|
87
91
|
{$props?.accept}
|
package/src/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,9 @@ 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}
|
|
137
|
+
{$props?.action}
|
|
133
138
|
method={$props?.method ?? "POST"}
|
|
134
139
|
enctype={$props?.enctype ?? ($state.hasFile ? "multipart/form-data" : undefined)}
|
|
135
140
|
onsubmit={handleSubmit}
|
package/src/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/src/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/src/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/src/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
|
}
|
package/src/Form/Select.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 SelectProps {
|
|
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 data value that this field is bound to */
|
|
@@ -80,7 +83,8 @@ export default function Select($props: SelectProps | undefined) {
|
|
|
80
83
|
@render {
|
|
81
84
|
<select
|
|
82
85
|
id={$props?.id ?? defaultId}
|
|
83
|
-
class={
|
|
86
|
+
class={["torp-select", $props?.class]}
|
|
87
|
+
{$props?.style}
|
|
84
88
|
{name}
|
|
85
89
|
&value={$state.value}
|
|
86
90
|
{$props?.placeholder}
|
package/src/Form/TextArea.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 TextAreaProps {
|
|
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 data value that this field is bound to */
|
|
@@ -84,7 +87,8 @@ export default function TextArea($props: TextAreaProps | undefined) {
|
|
|
84
87
|
@render {
|
|
85
88
|
<textarea
|
|
86
89
|
id={$props?.id ?? defaultId}
|
|
87
|
-
class={
|
|
90
|
+
class={["torp-text-area", $props?.class]}
|
|
91
|
+
{$props?.style}
|
|
88
92
|
{name}
|
|
89
93
|
&value={$state.value}
|
|
90
94
|
{$props?.rows}
|
package/src/Menu/Menu.torp
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { ContextualContextName } from "../Contextual/ContextualTypes";
|
|
2
3
|
import { ModalContextName } from "../Modal/ModalTypes";
|
|
3
4
|
import { PopoverContextName, type PopoverContext } from "../Popover/PopoverTypes";
|
|
@@ -12,8 +13,10 @@ import {
|
|
|
12
13
|
interface MenuProps {
|
|
13
14
|
/** An ID for the root element */
|
|
14
15
|
id?: string;
|
|
15
|
-
/**
|
|
16
|
-
class?:
|
|
16
|
+
/** Classes for the root element */
|
|
17
|
+
class?: ClassValue,
|
|
18
|
+
/** Styles for the root element */
|
|
19
|
+
style?: StyleValue,
|
|
17
20
|
/** An ARIA label for describing the menu to screen readers */
|
|
18
21
|
ariaLabel?: string,
|
|
19
22
|
}
|
|
@@ -158,7 +161,8 @@ export default function Menu($props: MenuProps | undefined) {
|
|
|
158
161
|
@render {
|
|
159
162
|
<div
|
|
160
163
|
{$props?.id}
|
|
161
|
-
class={
|
|
164
|
+
class={["torp-menu", $props?.class]}
|
|
165
|
+
{$props?.style}
|
|
162
166
|
tabindex="-1"
|
|
163
167
|
role="menu"
|
|
164
168
|
aria-label={$props?.ariaLabel}
|
package/src/Menu/MenuButton.torp
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { MenuContextName, type MenuContext } from "./MenuTypes";
|
|
2
3
|
|
|
3
4
|
interface MenuButtonProps {
|
|
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 value that should be returned when this button is pressed and the Dialog was invoked by calling showContextual, showPrompt or showPopover */
|
|
9
12
|
value?: any,
|
|
10
13
|
/** Whether this button is disabled */
|
|
@@ -53,7 +56,8 @@ export default function MenuButton($props: MenuButtonProps | undefined) {
|
|
|
53
56
|
@render {
|
|
54
57
|
<button
|
|
55
58
|
{$props?.id}
|
|
56
|
-
class={
|
|
59
|
+
class={["torp-menu-button", $props?.class]}
|
|
60
|
+
{$props?.style}
|
|
57
61
|
type="button"
|
|
58
62
|
{$props?.disabled}
|
|
59
63
|
role="menuitem"
|
package/src/Menu/MenuCheck.torp
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
MenuButtonContextName,
|
|
3
4
|
MenuContextName,
|
|
@@ -8,8 +9,10 @@ import {
|
|
|
8
9
|
interface MenuCheckProps {
|
|
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 item is checked */
|
|
14
17
|
checked?: boolean,
|
|
15
18
|
/** Whether this item is disabled */
|
|
@@ -66,7 +69,8 @@ export default function MenuCheck($props: MenuCheckProps | undefined) {
|
|
|
66
69
|
@render {
|
|
67
70
|
<button
|
|
68
71
|
{$props?.id}
|
|
69
|
-
class={
|
|
72
|
+
class={["torp-menu-check", $props?.class]}
|
|
73
|
+
{$props?.style}
|
|
70
74
|
type="button"
|
|
71
75
|
{$props?.disabled}
|
|
72
76
|
role="menuitemcheckbox"
|
package/src/Menu/MenuGroup.torp
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
|
|
2
3
|
interface MenuGroupProps {
|
|
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
|
/** An ARIA label for describing the group to screen readers */
|
|
8
11
|
ariaLabel?: string,
|
|
9
12
|
}
|
|
@@ -17,7 +20,8 @@ export default function MenuGroup($props: MenuGroupProps | undefined) {
|
|
|
17
20
|
@render {
|
|
18
21
|
<div
|
|
19
22
|
{$props?.id}
|
|
20
|
-
class={
|
|
23
|
+
class={["torp-menu-group", $props?.class]}
|
|
24
|
+
{$props?.style}
|
|
21
25
|
role="group"
|
|
22
26
|
aria-label={$props?.ariaLabel}
|
|
23
27
|
>
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { MenuButtonContextName, type MenuButtonContext } from "./MenuTypes";
|
|
2
3
|
|
|
3
4
|
interface MenuIndicatorProps {
|
|
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 item is disabled */
|
|
9
12
|
disabled?: boolean,
|
|
10
13
|
}
|
|
@@ -25,7 +28,8 @@ export default function MenuIndicator($props: MenuIndicatorProps | undefined) {
|
|
|
25
28
|
@if ($state.checked) {
|
|
26
29
|
<div
|
|
27
30
|
{$props?.id}
|
|
28
|
-
class={
|
|
31
|
+
class={["torp-menu-indicator", $props?.class]}
|
|
32
|
+
{$props?.style}
|
|
29
33
|
aria-disabled={$props?.disabled ? "true" : undefined}
|
|
30
34
|
data-disabled={$props?.disabled ? "true" : undefined}
|
|
31
35
|
>
|
package/src/Menu/MenuPopout.torp
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { MenuPopoutContextName, type MenuPopoutContext } from "./MenuTypes";
|
|
2
3
|
|
|
3
4
|
interface MenuPopoutProps {
|
|
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 */
|
|
@@ -70,7 +73,8 @@ export default function MenuPopout($props: MenuPopoutProps | undefined) {
|
|
|
70
73
|
@render {
|
|
71
74
|
<div
|
|
72
75
|
{$props?.id}
|
|
73
|
-
class={
|
|
76
|
+
class={["torp-menu-popout", $props?.class]}
|
|
77
|
+
{$props?.style}
|
|
74
78
|
onmouseleave={handleMouseLeave}
|
|
75
79
|
>
|
|
76
80
|
<slot />
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
2
2
|
import setPopoverPosition from "../utils/setPopoverPosition";
|
|
3
3
|
import { MenuPopoutContextName, type MenuPopoutContext } from "./MenuTypes";
|
|
4
4
|
|
|
5
5
|
interface MenuPopoutContentProps {
|
|
6
6
|
/** An ID for the root element */
|
|
7
7
|
id?: string;
|
|
8
|
-
/**
|
|
9
|
-
class?:
|
|
8
|
+
/** Classes for the root element */
|
|
9
|
+
class?: ClassValue,
|
|
10
|
+
/** Styles for the root element */
|
|
11
|
+
style?: StyleValue,
|
|
10
12
|
/** Where the popout will be shown, relative to the popout button */
|
|
11
13
|
side?: "top" | "right" | "bottom" | "left",
|
|
12
14
|
/** How the popout will be aligned, relative to the popout button */
|
|
@@ -70,7 +72,8 @@ export default function MenuPopoutContent($props: MenuPopoutContentProps | undef
|
|
|
70
72
|
@if ($state.visible) {
|
|
71
73
|
<div
|
|
72
74
|
{$props?.id}
|
|
73
|
-
class={
|
|
75
|
+
class={["torp-menu-popout-content", $props?.class]}
|
|
76
|
+
{$props?.style}
|
|
74
77
|
&ref={div}
|
|
75
78
|
onmount={show}
|
|
76
79
|
>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
MenuContextName,
|
|
3
4
|
MenuPopoutContextName,
|
|
@@ -8,8 +9,10 @@ import {
|
|
|
8
9
|
interface MenuPopoutTriggerProps {
|
|
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 */
|
|
@@ -101,7 +104,8 @@ export default function MenuPopoutTrigger($props: MenuPopoutTriggerProps | undef
|
|
|
101
104
|
@render {
|
|
102
105
|
<button
|
|
103
106
|
{$props?.id}
|
|
104
|
-
class={
|
|
107
|
+
class={["torp-menu-popout-trigger", $props?.class]}
|
|
108
|
+
{$props?.style}
|
|
105
109
|
type="button"
|
|
106
110
|
{$props?.disabled}
|
|
107
111
|
role="menuitem"
|
package/src/Menu/MenuRadio.torp
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
MenuButtonContextName,
|
|
3
4
|
MenuContextName,
|
|
@@ -10,8 +11,10 @@ import {
|
|
|
10
11
|
interface MenuRadioProps {
|
|
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 value of the item */
|
|
16
19
|
value?: string,
|
|
17
20
|
/** Whether this item is checked */
|
|
@@ -80,7 +83,8 @@ export default function MenuRadio($props: MenuRadioProps | undefined) {
|
|
|
80
83
|
@render {
|
|
81
84
|
<button
|
|
82
85
|
{$props?.id}
|
|
83
|
-
class={
|
|
86
|
+
class={["torp-menu-radio", $props?.class]}
|
|
87
|
+
{$props?.style}
|
|
84
88
|
type="button"
|
|
85
89
|
{$props?.disabled}
|
|
86
90
|
role="menuitemradio"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
type MenuRadioGroupContext,
|
|
3
4
|
MenuRadioGroupContextName,
|
|
@@ -7,8 +8,10 @@ import {
|
|
|
7
8
|
interface MenuRadioGroupProps {
|
|
8
9
|
/** An ID for the root element */
|
|
9
10
|
id?: string;
|
|
10
|
-
/**
|
|
11
|
-
class?:
|
|
11
|
+
/** Classes for the root element */
|
|
12
|
+
class?: ClassValue,
|
|
13
|
+
/** Styles for the root element */
|
|
14
|
+
style?: StyleValue,
|
|
12
15
|
/** An ARIA label for describing the menu to screen readers */
|
|
13
16
|
ariaLabel?: string,
|
|
14
17
|
/** The value of the checked MenuRadio */
|
|
@@ -95,7 +98,8 @@ export default function MenuRadioGroup($props: MenuRadioGroupProps | undefined)
|
|
|
95
98
|
@render {
|
|
96
99
|
<div
|
|
97
100
|
{$props?.id}
|
|
98
|
-
class={
|
|
101
|
+
class={["torp-menu-radio-group", $props?.class]}
|
|
102
|
+
{$props?.style}
|
|
99
103
|
role="group"
|
|
100
104
|
aria-label={$props?.ariaLabel}
|
|
101
105
|
>
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
|
|
2
3
|
interface MenuSeparatorProps {
|
|
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
|
/**
|
|
@@ -13,7 +16,8 @@ export default function MenuSeparator($props: MenuSeparatorProps | undefined) {
|
|
|
13
16
|
@render {
|
|
14
17
|
<div
|
|
15
18
|
{$props?.id}
|
|
16
|
-
class={
|
|
19
|
+
class={["torp-menu-separator", $props?.class]}
|
|
20
|
+
{$props?.style}
|
|
17
21
|
role="separator"
|
|
18
22
|
>
|
|
19
23
|
<slot />
|
package/src/MenuBar/MenuBar.torp
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import { MenuBarContextName, type MenuBarContext, type ItemState } from "./MenuBarTypes";
|
|
2
3
|
|
|
3
4
|
interface MenuBarProps {
|
|
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 menu to screen readers */
|
|
9
12
|
ariaLabel?: string,
|
|
10
13
|
/** The orientation of the menu, which affects keyboard navigation */
|
|
@@ -146,7 +149,8 @@ export default function MenuBar($props: MenuBarProps | undefined) {
|
|
|
146
149
|
@render {
|
|
147
150
|
<div
|
|
148
151
|
{$props?.id}
|
|
149
|
-
class={
|
|
152
|
+
class={["torp-menu-bar", $props?.class]}
|
|
153
|
+
{$props?.style}
|
|
150
154
|
tabindex="-1"
|
|
151
155
|
role="menubar"
|
|
152
156
|
aria-label={$props?.ariaLabel}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ClassValue, StyleValue } from "@torpor/view";
|
|
1
2
|
import {
|
|
2
3
|
MenuBarContextName,
|
|
3
4
|
MenuBarItemContextName,
|
|
@@ -9,8 +10,10 @@ import { PopoverContextName, type PopoverContext } from "../Popover/PopoverTypes
|
|
|
9
10
|
interface MenuBarItemProps {
|
|
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
|
/** Whether the item is visible */
|
|
15
18
|
visible?: boolean,
|
|
16
19
|
/** Raised when the item is opened or closed */
|
|
@@ -104,7 +107,8 @@ export default function MenuBarItem($props: MenuBarItemProps | undefined) {
|
|
|
104
107
|
@render {
|
|
105
108
|
<div
|
|
106
109
|
{$props?.id}
|
|
107
|
-
class={
|
|
110
|
+
class={["torp-menu-bar-item", $props?.class]}
|
|
111
|
+
{$props?.style}
|
|
108
112
|
>
|
|
109
113
|
<slot />
|
|
110
114
|
</div>
|
|
@@ -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"
|