@plitzi/sdk-elements 0.38.24 → 0.39.1
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 +170 -1
- package/dist/Element/RootElement.d.ts +1 -1
- package/dist/Element/RootElement.mjs +62 -61
- package/dist/Element/RowAnchor.d.ts +15 -0
- package/dist/Element/RowAnchor.mjs +8 -0
- package/dist/Element/helpers/elementConstants.mjs +12 -0
- package/dist/Element/hocs/withElement.d.ts +1 -1
- package/dist/Element/hocs/withElement.mjs +96 -88
- package/dist/Element/hooks/useEditableContent.d.ts +11 -0
- package/dist/Element/hooks/useEditableContent.mjs +11 -10
- package/dist/Element/hooks/useElement.mjs +1 -1
- package/dist/Element/hooks/useElementDataSource.mjs +11 -10
- package/dist/Element/hooks/useFocusInteractions.d.ts +12 -0
- package/dist/Element/hooks/useFocusInteractions.mjs +9 -0
- package/dist/Element/hooks/useInternalClassName.mjs +22 -21
- package/dist/Element/hooks/useRootElementInteractions.mjs +48 -42
- package/dist/Element/hooks/useScrollInteractions.d.ts +1 -1
- package/dist/Element/hooks/useScrollInteractions.mjs +61 -30
- package/dist/dataSource/PluginSource.d.ts +22 -0
- package/dist/dataSource/PluginSource.mjs +27 -0
- package/dist/dataSource/index.d.ts +2 -0
- package/dist/dataSource/index.mjs +5 -4
- package/dist/elements/advanced/BlockHtml/BlockHtml.d.ts +1 -1
- package/dist/elements/advanced/BlockHtml/index.d.ts +1 -1
- package/dist/elements/advanced/BlockJsx/BlockJsx.d.ts +1 -1
- package/dist/elements/advanced/BlockJsx/index.d.ts +1 -1
- package/dist/elements/advanced/Custom/Custom.d.ts +1 -1
- package/dist/elements/advanced/Custom/index.d.ts +1 -1
- package/dist/elements/advanced/NodeHtml/NodeHtml.d.ts +1 -1
- package/dist/elements/advanced/NodeHtml/declaration.d.ts +3 -3
- package/dist/elements/advanced/NodeHtml/index.d.ts +4 -4
- package/dist/elements/advanced/Reference/Reference.d.ts +2 -2
- package/dist/elements/advanced/Reference/Reference.mjs +1 -1
- package/dist/elements/advanced/Reference/index.d.ts +1 -1
- package/dist/elements/basic/Button/Button.d.ts +7 -2
- package/dist/elements/basic/Button/Button.mjs +27 -25
- package/dist/elements/basic/Button/Settings.mjs +1 -1
- package/dist/elements/basic/Button/declaration.d.ts +8 -1
- package/dist/elements/basic/Button/declaration.mjs +3 -0
- package/dist/elements/basic/Button/index.d.ts +9 -2
- package/dist/elements/basic/Dropdown/Dropdown.d.ts +9 -2
- package/dist/elements/basic/Dropdown/Dropdown.mjs +93 -74
- package/dist/elements/basic/Dropdown/DropdownPopup/DropdownPopup.d.ts +1 -1
- package/dist/elements/basic/Dropdown/DropdownPopup/index.d.ts +1 -1
- package/dist/elements/basic/Dropdown/declaration.d.ts +31 -0
- package/dist/elements/basic/Dropdown/declaration.mjs +38 -6
- package/dist/elements/basic/Dropdown/index.d.ts +33 -2
- package/dist/elements/basic/Dropdown/useDropdown.d.ts +2 -0
- package/dist/elements/basic/Heading/Heading.d.ts +1 -1
- package/dist/elements/basic/Heading/Heading.mjs +3 -2
- package/dist/elements/basic/Heading/declaration.d.ts +2 -0
- package/dist/elements/basic/Heading/declaration.mjs +2 -0
- package/dist/elements/basic/Heading/index.d.ts +3 -1
- package/dist/elements/basic/Link/Link.d.ts +1 -1
- package/dist/elements/basic/Link/Link.mjs +46 -45
- package/dist/elements/basic/Link/declaration.d.ts +1 -0
- package/dist/elements/basic/Link/declaration.mjs +5 -0
- package/dist/elements/basic/Link/index.d.ts +2 -1
- package/dist/elements/basic/Markdown/Markdown.d.ts +1 -1
- package/dist/elements/basic/Markdown/declaration.d.ts +2 -0
- package/dist/elements/basic/Markdown/declaration.mjs +2 -0
- package/dist/elements/basic/Markdown/index.d.ts +3 -1
- package/dist/elements/basic/Paragraph/Paragraph.d.ts +1 -1
- package/dist/elements/basic/Paragraph/Paragraph.mjs +3 -2
- package/dist/elements/basic/Paragraph/Settings.mjs +1 -1
- package/dist/elements/basic/Paragraph/declaration.d.ts +2 -0
- package/dist/elements/basic/Paragraph/declaration.mjs +2 -0
- package/dist/elements/basic/Paragraph/index.d.ts +3 -1
- package/dist/elements/basic/RichText/RichText.d.ts +1 -1
- package/dist/elements/basic/RichText/declaration.d.ts +1 -0
- package/dist/elements/basic/RichText/declaration.mjs +1 -0
- package/dist/elements/basic/RichText/index.d.ts +2 -1
- package/dist/elements/basic/Text/Settings.mjs +1 -1
- package/dist/elements/basic/Text/Text.d.ts +1 -1
- package/dist/elements/basic/Text/Text.mjs +3 -2
- package/dist/elements/basic/Text/declaration.d.ts +2 -0
- package/dist/elements/basic/Text/declaration.mjs +2 -0
- package/dist/elements/basic/Text/index.d.ts +3 -1
- package/dist/elements/basic/ThemeToggle/ThemeToggle.d.ts +2 -2
- package/dist/elements/basic/ThemeToggle/declaration.d.ts +1 -0
- package/dist/elements/basic/ThemeToggle/declaration.mjs +5 -0
- package/dist/elements/basic/ThemeToggle/index.d.ts +2 -1
- package/dist/elements/declarations/index.d.ts +399 -13
- package/dist/elements/declarations/index.mjs +48 -44
- package/dist/elements/form/Form/Form.d.ts +10 -3
- package/dist/elements/form/Form/Form.mjs +102 -79
- package/dist/elements/form/Form/declaration.d.ts +21 -3
- package/dist/elements/form/Form/declaration.mjs +28 -11
- package/dist/elements/form/Form/index.d.ts +17 -2
- package/dist/elements/form/FormControl/FormControl.d.ts +14 -10
- package/dist/elements/form/FormControl/FormControl.mjs +114 -104
- package/dist/elements/form/FormControl/Settings.d.ts +9 -2
- package/dist/elements/form/FormControl/Settings.mjs +132 -159
- package/dist/elements/form/FormControl/declaration.d.ts +52 -1
- package/dist/elements/form/FormControl/declaration.mjs +27 -20
- package/dist/elements/form/FormControl/helpers/useBlurValidation.d.ts +12 -0
- package/dist/elements/form/FormControl/helpers/useBlurValidation.mjs +20 -0
- package/dist/elements/form/FormControl/helpers/validateField.d.ts +8 -0
- package/dist/elements/form/FormControl/helpers/validateField.mjs +8 -2
- package/dist/elements/form/FormControl/hocs/withFieldValue.d.ts +6 -1
- package/dist/elements/form/FormControl/hocs/withFieldValue.mjs +52 -41
- package/dist/elements/form/FormControl/index.d.ts +53 -2
- package/dist/elements/form/FormControl/inputs/Checkbox.mjs +2 -2
- package/dist/elements/form/FormControl/inputs/FileInput.d.ts +21 -0
- package/dist/elements/form/FormControl/inputs/FileInput.mjs +29 -0
- package/dist/elements/form/FormControl/inputs/Input.d.ts +5 -1
- package/dist/elements/form/FormControl/inputs/Input.mjs +42 -38
- package/dist/elements/form/FormControl/inputs/Select.d.ts +5 -1
- package/dist/elements/form/FormControl/inputs/Select.mjs +33 -28
- package/dist/elements/form/FormControl/inputs/Textarea.mjs +27 -26
- package/dist/elements/form/FormControl/inputs/useFocusWhenShown.d.ts +1 -1
- package/dist/elements/form/FormControl/subTypes.d.ts +17 -0
- package/dist/elements/form/FormControl/subTypes.mjs +58 -0
- package/dist/elements/index.d.ts +5 -1
- package/dist/elements/index.mjs +34 -30
- package/dist/elements/internal/LayoutContainer/LayoutContainer.d.ts +1 -1
- package/dist/elements/internal/LayoutContainer/LayoutContainer.mjs +30 -30
- package/dist/elements/internal/LayoutContainer/index.d.ts +1 -1
- package/dist/elements/internal/LayoutContainer/mask.d.ts +13 -0
- package/dist/elements/internal/LayoutContainer/mask.mjs +16 -1
- package/dist/elements/internal/Loading/Loading.d.ts +1 -1
- package/dist/elements/internal/Loading/index.d.ts +1 -1
- package/dist/elements/internal/NotFound/NotFound.d.ts +1 -1
- package/dist/elements/internal/NotFound/index.d.ts +1 -1
- package/dist/elements/internal/Page/Page.d.ts +17 -3
- package/dist/elements/internal/Page/Page.mjs +32 -25
- package/dist/elements/internal/Page/PageHead.d.ts +11 -4
- package/dist/elements/internal/Page/PageHead.mjs +41 -19
- package/dist/elements/internal/Page/PageWithheld.d.ts +3 -2
- package/dist/elements/internal/Page/PageWithheld.mjs +41 -18
- package/dist/elements/internal/Page/Settings.d.ts +5 -1
- package/dist/elements/internal/Page/Settings.mjs +160 -121
- package/dist/elements/internal/Page/SharePreview.d.ts +13 -0
- package/dist/elements/internal/Page/SharePreview.mjs +53 -0
- package/dist/elements/internal/Page/declaration.d.ts +9 -1
- package/dist/elements/internal/Page/declaration.mjs +11 -4
- package/dist/elements/internal/Page/index.d.ts +9 -2
- package/dist/elements/media/Chart/Chart.d.ts +33 -0
- package/dist/elements/media/Chart/Chart.mjs +195 -0
- package/dist/elements/media/Chart/Settings.d.ts +6 -0
- package/dist/elements/media/Chart/Settings.mjs +92 -0
- package/dist/elements/media/Chart/chartGeometry.d.ts +37 -0
- package/dist/elements/media/Chart/chartGeometry.mjs +47 -0
- package/dist/elements/media/Chart/declaration.d.ts +144 -0
- package/dist/elements/media/Chart/declaration.mjs +107 -0
- package/dist/elements/media/Chart/index.d.ts +145 -0
- package/dist/elements/media/Chart/index.mjs +6 -0
- package/dist/elements/media/Embed/Embed.d.ts +1 -1
- package/dist/elements/media/Embed/Embed.mjs +25 -21
- package/dist/elements/media/Embed/declaration.d.ts +1 -0
- package/dist/elements/media/Embed/declaration.mjs +1 -0
- package/dist/elements/media/Embed/index.d.ts +2 -1
- package/dist/elements/media/FontAwesome/FontAwesome.d.ts +1 -1
- package/dist/elements/media/FontAwesome/index.d.ts +1 -1
- package/dist/elements/media/Image/Image.d.ts +1 -1
- package/dist/elements/media/Image/Image.mjs +35 -34
- package/dist/elements/media/Image/declaration.d.ts +2 -1
- package/dist/elements/media/Image/declaration.mjs +1 -0
- package/dist/elements/media/Image/index.d.ts +3 -2
- package/dist/elements/media/Svg/Svg.d.ts +1 -1
- package/dist/elements/media/Svg/declaration.d.ts +1 -0
- package/dist/elements/media/Svg/declaration.mjs +1 -0
- package/dist/elements/media/Svg/index.d.ts +2 -1
- package/dist/elements/media/Video/Video.d.ts +1 -1
- package/dist/elements/media/Video/declaration.d.ts +1 -0
- package/dist/elements/media/Video/declaration.mjs +1 -0
- package/dist/elements/media/Video/index.d.ts +2 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.d.ts +1 -1
- package/dist/elements/provider/ApiContainer/ApiContainer.mjs +215 -185
- package/dist/elements/provider/ApiContainer/declaration.d.ts +9 -0
- package/dist/elements/provider/ApiContainer/declaration.mjs +10 -1
- package/dist/elements/provider/ApiContainer/hooks/useInputRefresh.d.ts +4 -4
- package/dist/elements/provider/ApiContainer/hooks/useProviderPagination.d.ts +2 -1
- package/dist/elements/provider/ApiContainer/index.d.ts +10 -1
- package/dist/elements/provider/Channel/Channel.d.ts +1 -1
- package/dist/elements/provider/Channel/declaration.d.ts +9 -0
- package/dist/elements/provider/Channel/declaration.mjs +11 -2
- package/dist/elements/provider/Channel/index.d.ts +10 -1
- package/dist/elements/settings.mjs +44 -40
- package/dist/elements/structure/Carousel/Carousel.d.ts +1 -1
- package/dist/elements/structure/Carousel/Carousel.mjs +147 -130
- package/dist/elements/structure/Carousel/CarouselContext.d.ts +3 -3
- package/dist/elements/structure/Carousel/CarouselTrack/CarouselTrack.d.ts +1 -1
- package/dist/elements/structure/Carousel/CarouselTrack/components/ScrollTrack/ScrollTrack.d.ts +6 -2
- package/dist/elements/structure/Carousel/CarouselTrack/components/ScrollTrack/ScrollTrack.mjs +32 -20
- package/dist/elements/structure/Carousel/CarouselTrack/index.d.ts +1 -1
- package/dist/elements/structure/Carousel/carouselIndex.d.ts +17 -0
- package/dist/elements/structure/Carousel/carouselIndex.mjs +17 -5
- package/dist/elements/structure/Carousel/declaration.d.ts +49 -2
- package/dist/elements/structure/Carousel/declaration.mjs +26 -4
- package/dist/elements/structure/Carousel/index.d.ts +51 -4
- package/dist/elements/structure/Container/Container.d.ts +5 -3
- package/dist/elements/structure/Container/Container.mjs +6 -5
- package/dist/elements/structure/Container/Settings.d.ts +4 -2
- package/dist/elements/structure/Container/Settings.mjs +19 -5
- package/dist/elements/structure/Container/declaration.d.ts +3 -2
- package/dist/elements/structure/Container/declaration.mjs +3 -1
- package/dist/elements/structure/Container/index.d.ts +4 -3
- package/dist/elements/structure/DialogContainer/DialogContainer.d.ts +1 -1
- package/dist/elements/structure/DialogContainer/declaration.d.ts +1 -0
- package/dist/elements/structure/DialogContainer/declaration.mjs +5 -0
- package/dist/elements/structure/DialogContainer/index.d.ts +2 -1
- package/dist/elements/structure/FocusGroup/FocusGroup.d.ts +24 -0
- package/dist/elements/structure/FocusGroup/FocusGroup.mjs +27 -0
- package/dist/elements/structure/FocusGroup/Settings.d.ts +8 -0
- package/dist/elements/structure/FocusGroup/Settings.mjs +39 -0
- package/dist/elements/structure/FocusGroup/arrowFocus.d.ts +12 -0
- package/dist/elements/structure/FocusGroup/arrowFocus.mjs +30 -0
- package/dist/elements/structure/FocusGroup/declaration.d.ts +36 -0
- package/dist/elements/structure/FocusGroup/declaration.mjs +28 -0
- package/dist/elements/structure/FocusGroup/index.d.ts +37 -0
- package/dist/elements/structure/FocusGroup/index.mjs +6 -0
- package/dist/elements/structure/List/List.d.ts +1 -1
- package/dist/elements/structure/List/ListItem/ListItem.d.ts +1 -1
- package/dist/elements/structure/List/ListItem/index.d.ts +1 -1
- package/dist/elements/structure/List/declaration.d.ts +5 -0
- package/dist/elements/structure/List/declaration.mjs +5 -0
- package/dist/elements/structure/List/index.d.ts +7 -2
- package/dist/elements/structure/List/modes/ListControlled/ListControlled.mjs +1 -0
- package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.d.ts +3 -1
- package/dist/elements/structure/List/modes/ListControlled/ListControlledItem.mjs +33 -25
- package/dist/elements/structure/ModalContainer/ModalContainer.d.ts +1 -1
- package/dist/elements/structure/ModalContainer/declaration.d.ts +2 -0
- package/dist/elements/structure/ModalContainer/declaration.mjs +2 -0
- package/dist/elements/structure/ModalContainer/index.d.ts +3 -1
- package/dist/elements/structure/Pagination/Pagination.d.ts +1 -1
- package/dist/elements/structure/Pagination/declaration.d.ts +1 -0
- package/dist/elements/structure/Pagination/declaration.mjs +5 -0
- package/dist/elements/structure/Pagination/index.d.ts +2 -1
- package/dist/elements/structure/TabContainer/TabContainer.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerBody/TabContainerBody.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerBody/index.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerHeader/TabContainerHeader.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerHeader/index.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/TabContainerItem.d.ts +1 -1
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.d.ts +6 -0
- package/dist/elements/structure/TabContainer/TabContainerItem/declaration.mjs +6 -0
- package/dist/elements/structure/TabContainer/TabContainerItem/index.d.ts +7 -1
- package/dist/elements/structure/TabContainer/index.d.ts +10 -4
- package/dist/index.d.ts +297 -52
- package/dist/index.mjs +41 -37
- package/package.json +8 -8
- package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.d.ts +0 -16
- package/dist/elements/provider/ApiContainer/helpers/isEmptyAnswer.mjs +0 -4
|
@@ -4,7 +4,18 @@ import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
|
4
4
|
export type CarouselAttributes = AuthorableAttributes<CarouselProps>;
|
|
5
5
|
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
6
|
readonly type: "carousel";
|
|
7
|
+
readonly contentAttributes: readonly ["label"];
|
|
7
8
|
readonly sourceType: "carousel";
|
|
9
|
+
readonly publishes: {
|
|
10
|
+
readonly items: "Every item it shows, one slide each";
|
|
11
|
+
readonly count: "How many items it has";
|
|
12
|
+
readonly index: "The slide it stands at, from 0 (a `scroll` row: the first in view)";
|
|
13
|
+
readonly item: "The item of that slide";
|
|
14
|
+
readonly playing: "Whether it moves on by itself now (autoplay, not paused)";
|
|
15
|
+
readonly atStart: "At its first slide — a `scroll` row at the start of its box; one that loops never is";
|
|
16
|
+
readonly atEnd: "At its last — a `scroll` row at the end of its box, however many it shows; one that loops never is";
|
|
17
|
+
readonly shown: "How many slides it shows whole (1 but for a `scroll` row)";
|
|
18
|
+
};
|
|
8
19
|
readonly triggers: {
|
|
9
20
|
readonly onChange: {
|
|
10
21
|
readonly action: "onChange";
|
|
@@ -22,14 +33,50 @@ declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElemen
|
|
|
22
33
|
readonly action: "next";
|
|
23
34
|
readonly title: "Next Slide";
|
|
24
35
|
readonly type: "callback";
|
|
25
|
-
readonly params: {
|
|
36
|
+
readonly params: {
|
|
37
|
+
readonly by: {
|
|
38
|
+
canBind?: boolean;
|
|
39
|
+
label?: string;
|
|
40
|
+
when?: boolean | ((params: Record<string, unknown>) => boolean) | undefined;
|
|
41
|
+
credentialProvider?: import('@plitzi/sdk-shared').SpaceCredentialProvider;
|
|
42
|
+
required?: boolean;
|
|
43
|
+
} & {
|
|
44
|
+
type: "select";
|
|
45
|
+
defaultValue?: string;
|
|
46
|
+
options: {
|
|
47
|
+
label: string;
|
|
48
|
+
value: string;
|
|
49
|
+
}[] | ((params: Record<string, unknown>) => {
|
|
50
|
+
label: string;
|
|
51
|
+
value: string;
|
|
52
|
+
}[]);
|
|
53
|
+
};
|
|
54
|
+
};
|
|
26
55
|
readonly preview: {};
|
|
27
56
|
};
|
|
28
57
|
readonly previous: {
|
|
29
58
|
readonly action: "previous";
|
|
30
59
|
readonly title: "Previous Slide";
|
|
31
60
|
readonly type: "callback";
|
|
32
|
-
readonly params: {
|
|
61
|
+
readonly params: {
|
|
62
|
+
readonly by: {
|
|
63
|
+
canBind?: boolean;
|
|
64
|
+
label?: string;
|
|
65
|
+
when?: boolean | ((params: Record<string, unknown>) => boolean) | undefined;
|
|
66
|
+
credentialProvider?: import('@plitzi/sdk-shared').SpaceCredentialProvider;
|
|
67
|
+
required?: boolean;
|
|
68
|
+
} & {
|
|
69
|
+
type: "select";
|
|
70
|
+
defaultValue?: string;
|
|
71
|
+
options: {
|
|
72
|
+
label: string;
|
|
73
|
+
value: string;
|
|
74
|
+
}[] | ((params: Record<string, unknown>) => {
|
|
75
|
+
label: string;
|
|
76
|
+
value: string;
|
|
77
|
+
}[]);
|
|
78
|
+
};
|
|
79
|
+
};
|
|
33
80
|
readonly preview: {};
|
|
34
81
|
};
|
|
35
82
|
readonly goTo: {
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
import { elementDeclaration as e } from "@plitzi/sdk-shared/authoring";
|
|
2
2
|
//#region src/elements/structure/Carousel/declaration.ts
|
|
3
|
-
var t =
|
|
3
|
+
var t = {
|
|
4
|
+
type: "select",
|
|
5
|
+
label: "How far",
|
|
6
|
+
defaultValue: "slide",
|
|
7
|
+
options: [{
|
|
8
|
+
label: "One slide",
|
|
9
|
+
value: "slide"
|
|
10
|
+
}, {
|
|
11
|
+
label: "A page — as many as it shows",
|
|
12
|
+
value: "page"
|
|
13
|
+
}]
|
|
14
|
+
}, n = e()({
|
|
4
15
|
type: "carousel",
|
|
16
|
+
contentAttributes: ["label"],
|
|
5
17
|
sourceType: "carousel",
|
|
18
|
+
publishes: {
|
|
19
|
+
items: "Every item it shows, one slide each",
|
|
20
|
+
count: "How many items it has",
|
|
21
|
+
index: "The slide it stands at, from 0 (a `scroll` row: the first in view)",
|
|
22
|
+
item: "The item of that slide",
|
|
23
|
+
playing: "Whether it moves on by itself now (autoplay, not paused)",
|
|
24
|
+
atStart: "At its first slide — a `scroll` row at the start of its box; one that loops never is",
|
|
25
|
+
atEnd: "At its last — a `scroll` row at the end of its box, however many it shows; one that loops never is",
|
|
26
|
+
shown: "How many slides it shows whole (1 but for a `scroll` row)"
|
|
27
|
+
},
|
|
6
28
|
triggers: { onChange: {
|
|
7
29
|
action: "onChange",
|
|
8
30
|
title: "On Slide Change",
|
|
@@ -18,14 +40,14 @@ var t = e()({
|
|
|
18
40
|
action: "next",
|
|
19
41
|
title: "Next Slide",
|
|
20
42
|
type: "callback",
|
|
21
|
-
params: {},
|
|
43
|
+
params: { by: t },
|
|
22
44
|
preview: {}
|
|
23
45
|
},
|
|
24
46
|
previous: {
|
|
25
47
|
action: "previous",
|
|
26
48
|
title: "Previous Slide",
|
|
27
49
|
type: "callback",
|
|
28
|
-
params: {},
|
|
50
|
+
params: { by: t },
|
|
29
51
|
preview: {}
|
|
30
52
|
},
|
|
31
53
|
goTo: {
|
|
@@ -80,4 +102,4 @@ var t = e()({
|
|
|
80
102
|
initialItems: ["carouselTrack"]
|
|
81
103
|
});
|
|
82
104
|
//#endregion
|
|
83
|
-
export {
|
|
105
|
+
export { n as default };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare const Carousel: {
|
|
2
|
-
(props: import('../../..').WithElementProps<import('./Carousel').CarouselProps>): import('react').JSX.Element;
|
|
2
|
+
(props: import('../../..').WithElementProps<import('./Carousel').CarouselProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
plugins: {
|
|
6
6
|
carouselTrack: {
|
|
7
|
-
(props: import('../../..').WithElementProps<import('./CarouselTrack/CarouselTrack').CarouselTrackProps>): import('react').JSX.Element;
|
|
7
|
+
(props: import('../../..').WithElementProps<import('./CarouselTrack/CarouselTrack').CarouselTrackProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
8
8
|
displayName: string;
|
|
9
9
|
} & {
|
|
10
10
|
readonly type: "carouselTrack";
|
|
@@ -39,7 +39,18 @@ declare const Carousel: {
|
|
|
39
39
|
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<unknown>;
|
|
40
40
|
};
|
|
41
41
|
type: "carousel";
|
|
42
|
+
contentAttributes: readonly ["label"];
|
|
42
43
|
sourceType: "carousel";
|
|
44
|
+
publishes: {
|
|
45
|
+
readonly items: "Every item it shows, one slide each";
|
|
46
|
+
readonly count: "How many items it has";
|
|
47
|
+
readonly index: "The slide it stands at, from 0 (a `scroll` row: the first in view)";
|
|
48
|
+
readonly item: "The item of that slide";
|
|
49
|
+
readonly playing: "Whether it moves on by itself now (autoplay, not paused)";
|
|
50
|
+
readonly atStart: "At its first slide — a `scroll` row at the start of its box; one that loops never is";
|
|
51
|
+
readonly atEnd: "At its last — a `scroll` row at the end of its box, however many it shows; one that loops never is";
|
|
52
|
+
readonly shown: "How many slides it shows whole (1 but for a `scroll` row)";
|
|
53
|
+
};
|
|
43
54
|
triggers: {
|
|
44
55
|
readonly onChange: {
|
|
45
56
|
readonly action: "onChange";
|
|
@@ -57,14 +68,50 @@ declare const Carousel: {
|
|
|
57
68
|
readonly action: "next";
|
|
58
69
|
readonly title: "Next Slide";
|
|
59
70
|
readonly type: "callback";
|
|
60
|
-
readonly params: {
|
|
71
|
+
readonly params: {
|
|
72
|
+
readonly by: {
|
|
73
|
+
canBind?: boolean;
|
|
74
|
+
label?: string;
|
|
75
|
+
when?: boolean | ((params: Record<string, unknown>) => boolean) | undefined;
|
|
76
|
+
credentialProvider?: import('@plitzi/sdk-shared').SpaceCredentialProvider;
|
|
77
|
+
required?: boolean;
|
|
78
|
+
} & {
|
|
79
|
+
type: "select";
|
|
80
|
+
defaultValue?: string;
|
|
81
|
+
options: {
|
|
82
|
+
label: string;
|
|
83
|
+
value: string;
|
|
84
|
+
}[] | ((params: Record<string, unknown>) => {
|
|
85
|
+
label: string;
|
|
86
|
+
value: string;
|
|
87
|
+
}[]);
|
|
88
|
+
};
|
|
89
|
+
};
|
|
61
90
|
readonly preview: {};
|
|
62
91
|
};
|
|
63
92
|
readonly previous: {
|
|
64
93
|
readonly action: "previous";
|
|
65
94
|
readonly title: "Previous Slide";
|
|
66
95
|
readonly type: "callback";
|
|
67
|
-
readonly params: {
|
|
96
|
+
readonly params: {
|
|
97
|
+
readonly by: {
|
|
98
|
+
canBind?: boolean;
|
|
99
|
+
label?: string;
|
|
100
|
+
when?: boolean | ((params: Record<string, unknown>) => boolean) | undefined;
|
|
101
|
+
credentialProvider?: import('@plitzi/sdk-shared').SpaceCredentialProvider;
|
|
102
|
+
required?: boolean;
|
|
103
|
+
} & {
|
|
104
|
+
type: "select";
|
|
105
|
+
defaultValue?: string;
|
|
106
|
+
options: {
|
|
107
|
+
label: string;
|
|
108
|
+
value: string;
|
|
109
|
+
}[] | ((params: Record<string, unknown>) => {
|
|
110
|
+
label: string;
|
|
111
|
+
value: string;
|
|
112
|
+
}[]);
|
|
113
|
+
};
|
|
114
|
+
};
|
|
68
115
|
readonly preview: {};
|
|
69
116
|
};
|
|
70
117
|
readonly goTo: {
|
|
@@ -2,7 +2,9 @@ import { ReactNode, RefObject } from 'react';
|
|
|
2
2
|
export type ContainerProps = {
|
|
3
3
|
ref?: RefObject<HTMLElement>;
|
|
4
4
|
className?: string;
|
|
5
|
-
subType?: 'div' | 'header' | 'footer' | 'nav' | 'main' | 'section' | 'article' | 'aside' | 'address' | 'figure' | 'dl' | 'dt' | 'dd' | 'li' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span';
|
|
5
|
+
subType?: 'div' | 'header' | 'footer' | 'nav' | 'main' | 'section' | 'article' | 'aside' | 'address' | 'figure' | 'dl' | 'dt' | 'dd' | 'li' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'details' | 'summary';
|
|
6
|
+
/** A `details` shown open from the start; closed when left out. Read by no other tag. */
|
|
7
|
+
open?: boolean;
|
|
6
8
|
/**
|
|
7
9
|
* The name of the part of the page this is — "Main navigation", "Search results", "Your cart" — for screen readers
|
|
8
10
|
* and browser agents, which list the page by its landmarks and regions and jump between them.
|
|
@@ -30,9 +32,9 @@ export type ContainerProps = {
|
|
|
30
32
|
title?: string;
|
|
31
33
|
children?: ReactNode;
|
|
32
34
|
};
|
|
33
|
-
declare const Container: ({ ref, className, subType, label, decorative, live, title, children }: ContainerProps) => import('react').JSX.Element;
|
|
35
|
+
declare const Container: ({ ref, className, subType, label, decorative, live, title, open, children }: ContainerProps) => import('react').JSX.Element;
|
|
34
36
|
declare const _default: {
|
|
35
|
-
(props: import('../../..').WithElementProps<ContainerProps>): import('react').JSX.Element;
|
|
37
|
+
(props: import('../../..').WithElementProps<ContainerProps>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
36
38
|
displayName: string;
|
|
37
39
|
};
|
|
38
40
|
export default _default;
|
|
@@ -4,20 +4,21 @@ import { RootElement as n } from "../../../Element/RootElement.mjs";
|
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
import i from "clsx";
|
|
6
6
|
//#region src/elements/structure/Container/Container.tsx
|
|
7
|
-
var a = ({ ref: t, className: a = "", subType: o = "div", label: s = "", decorative: c = !1, live: l = "", title: u = "",
|
|
8
|
-
let
|
|
7
|
+
var a = ({ ref: t, className: a = "", subType: o = "div", label: s = "", decorative: c = !1, live: l = "", title: u = "", open: d = !1, children: f }) => {
|
|
8
|
+
let p = !c && s && e.includes(o) ? {
|
|
9
9
|
"aria-label": s,
|
|
10
10
|
...o === "div" ? { role: "group" } : {}
|
|
11
|
-
} : {},
|
|
11
|
+
} : {}, m = c ? { "aria-hidden": !0 } : {}, h = l ? { "aria-live": l } : {}, g = o === "details" && d ? { open: !0 } : {};
|
|
12
12
|
return /* @__PURE__ */ r(n, {
|
|
13
13
|
ref: t,
|
|
14
14
|
tag: o,
|
|
15
15
|
className: i(`plitzi-component__container plitzi-component__container-${o}`, a),
|
|
16
16
|
title: u || void 0,
|
|
17
|
-
...f,
|
|
18
17
|
...p,
|
|
19
18
|
...m,
|
|
20
|
-
|
|
19
|
+
...h,
|
|
20
|
+
...g,
|
|
21
|
+
children: f
|
|
21
22
|
});
|
|
22
23
|
}, o = t(a);
|
|
23
24
|
//#endregion
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { ContainerProps } from './Container';
|
|
1
2
|
type SettingsProps = {
|
|
2
|
-
subType?: '
|
|
3
|
+
subType?: ContainerProps['subType'];
|
|
3
4
|
label?: string;
|
|
4
5
|
decorative?: boolean;
|
|
6
|
+
open?: boolean;
|
|
5
7
|
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
6
8
|
};
|
|
7
|
-
declare const Settings: ({ subType, label, decorative, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
9
|
+
declare const Settings: ({ subType, label, decorative, open, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
8
10
|
export default Settings;
|
|
@@ -5,15 +5,15 @@ import i from "@plitzi/plitzi-ui/Checkbox";
|
|
|
5
5
|
import a from "@plitzi/plitzi-ui/Input";
|
|
6
6
|
import o from "@plitzi/plitzi-ui/Select";
|
|
7
7
|
//#region src/elements/structure/Container/Settings.tsx
|
|
8
|
-
var s = ({ subType: s = "div", label: c = "", decorative: l = !1,
|
|
9
|
-
let
|
|
8
|
+
var s = ({ subType: s = "div", label: c = "", decorative: l = !1, open: u = !1, onUpdate: d }) => {
|
|
9
|
+
let f = e(d), p = t((e) => d?.("decorative", e.target.checked), [d]), m = t((e) => d?.("open", e.target.checked), [d]);
|
|
10
10
|
return /* @__PURE__ */ r("div", {
|
|
11
11
|
className: "flex flex-col gap-4 py-2",
|
|
12
12
|
children: [
|
|
13
13
|
/* @__PURE__ */ r(o, {
|
|
14
14
|
label: "ContainerTag",
|
|
15
15
|
value: s,
|
|
16
|
-
onChange:
|
|
16
|
+
onChange: f.text("subType"),
|
|
17
17
|
size: "xs",
|
|
18
18
|
children: [
|
|
19
19
|
/* @__PURE__ */ n("option", {
|
|
@@ -99,6 +99,14 @@ var s = ({ subType: s = "div", label: c = "", decorative: l = !1, onUpdate: u })
|
|
|
99
99
|
/* @__PURE__ */ n("option", {
|
|
100
100
|
value: "span",
|
|
101
101
|
children: "Span (inline)"
|
|
102
|
+
}),
|
|
103
|
+
/* @__PURE__ */ n("option", {
|
|
104
|
+
value: "details",
|
|
105
|
+
children: "Details (opens and closes)"
|
|
106
|
+
}),
|
|
107
|
+
/* @__PURE__ */ n("option", {
|
|
108
|
+
value: "summary",
|
|
109
|
+
children: "Summary (what opens a details)"
|
|
102
110
|
})
|
|
103
111
|
]
|
|
104
112
|
}),
|
|
@@ -106,13 +114,19 @@ var s = ({ subType: s = "div", label: c = "", decorative: l = !1, onUpdate: u })
|
|
|
106
114
|
value: c,
|
|
107
115
|
label: "Region Name",
|
|
108
116
|
placeholder: "e.g. Main navigation, Search results",
|
|
109
|
-
onChange:
|
|
117
|
+
onChange: f.text("label"),
|
|
110
118
|
size: "xs"
|
|
111
119
|
}),
|
|
112
120
|
/* @__PURE__ */ n(i, {
|
|
113
121
|
checked: l,
|
|
114
122
|
label: "Decorative (hidden from screen readers)",
|
|
115
|
-
onChange:
|
|
123
|
+
onChange: p,
|
|
124
|
+
size: "xs"
|
|
125
|
+
}),
|
|
126
|
+
s === "details" && /* @__PURE__ */ n(i, {
|
|
127
|
+
checked: u,
|
|
128
|
+
label: "Open at start",
|
|
129
|
+
onChange: m,
|
|
116
130
|
size: "xs"
|
|
117
131
|
})
|
|
118
132
|
]
|
|
@@ -37,9 +37,10 @@ declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElemen
|
|
|
37
37
|
};
|
|
38
38
|
};
|
|
39
39
|
}, Partial<{
|
|
40
|
-
label?: string | undefined;
|
|
41
40
|
title?: string | undefined;
|
|
42
|
-
|
|
41
|
+
label?: string | undefined;
|
|
42
|
+
open?: boolean | undefined;
|
|
43
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "details" | "summary" | undefined;
|
|
43
44
|
live?: "polite" | "assertive" | "" | undefined;
|
|
44
45
|
decorative?: boolean | undefined;
|
|
45
46
|
}>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
declare const Container: {
|
|
2
|
-
(props: import('../../..').WithElementProps<import('./Container').ContainerProps>): import('react').JSX.Element;
|
|
2
|
+
(props: import('../../..').WithElementProps<import('./Container').ContainerProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "container";
|
|
@@ -32,9 +32,10 @@ declare const Container: {
|
|
|
32
32
|
} & {
|
|
33
33
|
content: import('@plitzi/sdk-shared/authoring').ElementContentDefaults;
|
|
34
34
|
} & import('@plitzi/sdk-shared/authoring').ElementAttributesBrand<Partial<{
|
|
35
|
-
label?: string | undefined;
|
|
36
35
|
title?: string | undefined;
|
|
37
|
-
|
|
36
|
+
label?: string | undefined;
|
|
37
|
+
open?: boolean | undefined;
|
|
38
|
+
subType?: "div" | "header" | "footer" | "nav" | "main" | "section" | "article" | "aside" | "address" | "figure" | "dl" | "dt" | "dd" | "li" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "p" | "span" | "details" | "summary" | undefined;
|
|
38
39
|
live?: "polite" | "assertive" | "" | undefined;
|
|
39
40
|
decorative?: boolean | undefined;
|
|
40
41
|
}>>;
|
|
@@ -11,7 +11,7 @@ export type DialogContainerProps = {
|
|
|
11
11
|
};
|
|
12
12
|
declare const DialogContainer: ({ ref, className, children, headerLabel, acceptButtonLabel, acceptButtonLabelLoading, rejectButtonLabel, autoHideAfterClick }: DialogContainerProps) => import('react').JSX.Element;
|
|
13
13
|
declare const _default: {
|
|
14
|
-
(props: import('../../..').WithElementProps<DialogContainerProps>): import('react').JSX.Element;
|
|
14
|
+
(props: import('../../..').WithElementProps<DialogContainerProps>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
15
15
|
displayName: string;
|
|
16
16
|
};
|
|
17
17
|
export default _default;
|
|
@@ -4,6 +4,7 @@ import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
|
4
4
|
export type DialogContainerAttributes = AuthorableAttributes<DialogContainerProps>;
|
|
5
5
|
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
6
|
readonly type: "dialogContainer";
|
|
7
|
+
readonly contentAttributes: readonly ["headerLabel", "acceptButtonLabel", "rejectButtonLabel"];
|
|
7
8
|
readonly sourceType: "dialogContainer";
|
|
8
9
|
readonly triggers: {
|
|
9
10
|
readonly onDialogAccept: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
declare const DialogContainer: {
|
|
2
|
-
(props: import('../../..').WithElementProps<import('./DialogContainer').DialogContainerProps>): import('react').JSX.Element;
|
|
2
|
+
(props: import('../../..').WithElementProps<import('./DialogContainer').DialogContainerProps>): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
3
3
|
displayName: string;
|
|
4
4
|
} & {
|
|
5
5
|
readonly type: "dialogContainer";
|
|
6
|
+
readonly contentAttributes: readonly ["headerLabel", "acceptButtonLabel", "rejectButtonLabel"];
|
|
6
7
|
readonly sourceType: "dialogContainer";
|
|
7
8
|
readonly triggers: {
|
|
8
9
|
readonly onDialogAccept: {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
export type FocusGroupProps = {
|
|
3
|
+
ref?: RefObject<HTMLElement>;
|
|
4
|
+
className?: string;
|
|
5
|
+
subType?: 'div' | 'nav' | 'section';
|
|
6
|
+
/**
|
|
7
|
+
* What the controls inside are, for screen readers and browser agents — "Search results", "Filters" — announced as a
|
|
8
|
+
* group (a `nav` or a `section` as that landmark).
|
|
9
|
+
*/
|
|
10
|
+
label?: string;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A box whose controls the arrow keys move through — a search palette's results, a menu, a set of options: ↑ and ↓
|
|
15
|
+
* through them, ← and → to the first of the next or the previous list, Home and End to the ends. From a text field
|
|
16
|
+
* inside it, ↓ goes down into them (the other arrows stay the caret's) and ↑ from the first comes back.
|
|
17
|
+
*/
|
|
18
|
+
declare const FocusGroup: ({ ref, className, subType, label, children }: FocusGroupProps) => import('react').JSX.Element;
|
|
19
|
+
declare const _default: {
|
|
20
|
+
(props: import('../../..').WithElementProps<FocusGroupProps>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import('react').JSX.Element | null | undefined;
|
|
21
|
+
displayName: string;
|
|
22
|
+
};
|
|
23
|
+
export default _default;
|
|
24
|
+
export { FocusGroup };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import e from "../../../Element/hocs/withElement.mjs";
|
|
2
|
+
import { RootElement as t } from "../../../Element/RootElement.mjs";
|
|
3
|
+
import { arrowTarget as n, isArrowKey as r } from "./arrowFocus.mjs";
|
|
4
|
+
import { useCallback as i } from "react";
|
|
5
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
6
|
+
import o from "clsx";
|
|
7
|
+
//#region src/elements/structure/FocusGroup/FocusGroup.tsx
|
|
8
|
+
var s = ({ ref: e, className: s = "", subType: c = "div", label: l = "", children: u }) => {
|
|
9
|
+
let d = i((e) => {
|
|
10
|
+
if (!r(e.key) || e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;
|
|
11
|
+
let t = n(e.currentTarget, e.target, e.key);
|
|
12
|
+
t && (e.preventDefault(), t.focus());
|
|
13
|
+
}, []), f = l ? {
|
|
14
|
+
"aria-label": l,
|
|
15
|
+
...c === "div" ? { role: "group" } : {}
|
|
16
|
+
} : {};
|
|
17
|
+
return /* @__PURE__ */ a(t, {
|
|
18
|
+
ref: e,
|
|
19
|
+
tag: c,
|
|
20
|
+
className: o("plitzi-component__focus-group", s),
|
|
21
|
+
onKeyDown: d,
|
|
22
|
+
...f,
|
|
23
|
+
children: u
|
|
24
|
+
});
|
|
25
|
+
}, c = e(s);
|
|
26
|
+
//#endregion
|
|
27
|
+
export { s as FocusGroup, c as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FocusGroupProps } from './FocusGroup';
|
|
2
|
+
type SettingsProps = {
|
|
3
|
+
subType?: FocusGroupProps['subType'];
|
|
4
|
+
label?: string;
|
|
5
|
+
onUpdate?: (key: string, value: string | boolean | number) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const Settings: ({ subType, label, onUpdate }: SettingsProps) => import('react').JSX.Element;
|
|
8
|
+
export default Settings;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import e from "../../useSettingsUpdate.mjs";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import r from "@plitzi/plitzi-ui/Input";
|
|
4
|
+
import i from "@plitzi/plitzi-ui/Select";
|
|
5
|
+
//#region src/elements/structure/FocusGroup/Settings.tsx
|
|
6
|
+
var a = ({ subType: a = "div", label: o = "", onUpdate: s }) => {
|
|
7
|
+
let c = e(s);
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
className: "flex flex-col gap-4 py-2",
|
|
10
|
+
children: [/* @__PURE__ */ n(i, {
|
|
11
|
+
label: "Tag",
|
|
12
|
+
value: a,
|
|
13
|
+
onChange: c.text("subType"),
|
|
14
|
+
size: "xs",
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ t("option", {
|
|
17
|
+
value: "div",
|
|
18
|
+
children: "Div"
|
|
19
|
+
}),
|
|
20
|
+
/* @__PURE__ */ t("option", {
|
|
21
|
+
value: "nav",
|
|
22
|
+
children: "Nav"
|
|
23
|
+
}),
|
|
24
|
+
/* @__PURE__ */ t("option", {
|
|
25
|
+
value: "section",
|
|
26
|
+
children: "Section"
|
|
27
|
+
})
|
|
28
|
+
]
|
|
29
|
+
}), /* @__PURE__ */ t(r, {
|
|
30
|
+
value: o,
|
|
31
|
+
label: "Group Name",
|
|
32
|
+
placeholder: "e.g. Search results, Filters",
|
|
33
|
+
onChange: c.text("label"),
|
|
34
|
+
size: "xs"
|
|
35
|
+
})]
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { a as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
declare const ARROW_KEYS: readonly ["ArrowDown", "ArrowUp", "ArrowLeft", "ArrowRight", "Home", "End"];
|
|
2
|
+
export type ArrowKey = (typeof ARROW_KEYS)[number];
|
|
3
|
+
export declare const isArrowKey: (key: string) => key is ArrowKey;
|
|
4
|
+
/**
|
|
5
|
+
* Where an arrow key moves the focus inside `container`, from `from` (what holds it), or nothing when it stays.
|
|
6
|
+
*
|
|
7
|
+
* ↑ and ↓ go through the controls in the order they are read; ←/→ to the first control of the next or the previous
|
|
8
|
+
* list; Home and End to the first and the last. From a text field, ↓ goes to the first control and the rest are the
|
|
9
|
+
* field's own (the caret); ↑ from the first control goes back to the field.
|
|
10
|
+
*/
|
|
11
|
+
export declare const arrowTarget: (container: Element, from: Element, key: ArrowKey) => HTMLElement | undefined;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region src/elements/structure/FocusGroup/arrowFocus.ts
|
|
2
|
+
var e = "input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"button\"]):not([type=\"submit\"]), textarea", t = [
|
|
3
|
+
"ArrowDown",
|
|
4
|
+
"ArrowUp",
|
|
5
|
+
"ArrowLeft",
|
|
6
|
+
"ArrowRight",
|
|
7
|
+
"Home",
|
|
8
|
+
"End"
|
|
9
|
+
], n = (e) => t.includes(e), r = (e) => e.getClientRects().length > 0, i = (e, t) => {
|
|
10
|
+
let n = e.parentElement?.closest("ul, ol, [role=\"listbox\"], [role=\"group\"]");
|
|
11
|
+
return n && t.contains(n) ? n : e;
|
|
12
|
+
}, a = (t, n, a) => {
|
|
13
|
+
let o = n.matches(e) ? n : void 0, s = [...t.querySelectorAll("a[href], button:not([disabled]), [tabindex]:not([tabindex=\"-1\"]):not(input):not(textarea):not(select)")].filter(r);
|
|
14
|
+
if (s.length === 0) return;
|
|
15
|
+
if (o) return a === "ArrowDown" ? s[0] : void 0;
|
|
16
|
+
let c = s.indexOf(n);
|
|
17
|
+
if (c !== -1) switch (a) {
|
|
18
|
+
case "ArrowDown": return s[c + 1];
|
|
19
|
+
case "ArrowUp": return c > 0 ? s[c - 1] : [...t.querySelectorAll(e)].find(r);
|
|
20
|
+
case "Home": return s[0];
|
|
21
|
+
case "End": return s[s.length - 1];
|
|
22
|
+
case "ArrowRight":
|
|
23
|
+
case "ArrowLeft": {
|
|
24
|
+
let e = [...new Set(s.map((e) => i(e, t)))], r = e.indexOf(i(n, t)) + (a === "ArrowRight" ? 1 : -1);
|
|
25
|
+
return r < 0 || r >= e.length ? void 0 : s.find((n) => i(n, t) === e[r]);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
//#endregion
|
|
30
|
+
export { a as arrowTarget, n as isArrowKey };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FocusGroupProps } from './FocusGroup';
|
|
2
|
+
import { AuthorableAttributes } from '@plitzi/sdk-shared/authoring';
|
|
3
|
+
/** What this element can be authored with — its component's own props, minus what the runtime supplies. */
|
|
4
|
+
export type FocusGroupAttributes = AuthorableAttributes<FocusGroupProps>;
|
|
5
|
+
declare const declaration: import('@plitzi/sdk-shared/authoring').DeclaredElement<{
|
|
6
|
+
readonly type: "focusGroup";
|
|
7
|
+
readonly attributeValues: {
|
|
8
|
+
readonly subType: readonly string[];
|
|
9
|
+
};
|
|
10
|
+
readonly content: {
|
|
11
|
+
readonly attributes: {
|
|
12
|
+
readonly subType: "div";
|
|
13
|
+
};
|
|
14
|
+
readonly definition: {
|
|
15
|
+
readonly label: "Focus Group";
|
|
16
|
+
readonly description: string;
|
|
17
|
+
readonly items: [];
|
|
18
|
+
};
|
|
19
|
+
readonly market: {
|
|
20
|
+
readonly category: "structure";
|
|
21
|
+
readonly icon: "fa-solid fa-arrows-up-down";
|
|
22
|
+
};
|
|
23
|
+
readonly defaultStyle: {
|
|
24
|
+
readonly style: {
|
|
25
|
+
readonly base: {
|
|
26
|
+
readonly default: {};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
readonly subTypes: {};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
}, Partial<{
|
|
33
|
+
label?: string | undefined;
|
|
34
|
+
subType?: "div" | "nav" | "section" | undefined;
|
|
35
|
+
}>>;
|
|
36
|
+
export default declaration;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { elementDeclaration as e, valuesOf as t } from "@plitzi/sdk-shared/authoring";
|
|
2
|
+
//#region src/elements/structure/FocusGroup/declaration.ts
|
|
3
|
+
var n = e()({
|
|
4
|
+
type: "focusGroup",
|
|
5
|
+
attributeValues: { subType: t()([
|
|
6
|
+
"div",
|
|
7
|
+
"nav",
|
|
8
|
+
"section"
|
|
9
|
+
]) },
|
|
10
|
+
content: {
|
|
11
|
+
attributes: { subType: "div" },
|
|
12
|
+
definition: {
|
|
13
|
+
label: "Focus Group",
|
|
14
|
+
description: "A box whose controls the arrow keys move through: up and down between them, left and right to the first of the next or previous list, down from a text field inside into them. For a search palette, a menu, a set of options — what someone goes through with the keyboard, which Tab alone took a stop at a time.",
|
|
15
|
+
items: []
|
|
16
|
+
},
|
|
17
|
+
market: {
|
|
18
|
+
category: "structure",
|
|
19
|
+
icon: "fa-solid fa-arrows-up-down"
|
|
20
|
+
},
|
|
21
|
+
defaultStyle: {
|
|
22
|
+
style: { base: { default: {} } },
|
|
23
|
+
subTypes: {}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { n as default };
|