@derelicious/ds 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +147 -2
- package/dist/a2ui/Surface.css +140 -0
- package/dist/a2ui/Surface.css.d.ts +22 -0
- package/dist/a2ui/Surface.css.js +29 -0
- package/dist/a2ui/Surface.d.ts +56 -0
- package/dist/a2ui/Surface.js +1411 -0
- package/dist/a2ui/catalog.d.ts +93 -0
- package/dist/a2ui/catalog.js +1666 -0
- package/dist/a2ui/clientMessages.d.ts +36 -0
- package/dist/a2ui/clientMessages.js +65 -0
- package/dist/a2ui/examples.d.ts +8 -0
- package/dist/a2ui/examples.js +877 -0
- package/dist/a2ui/functions.d.ts +55 -0
- package/dist/a2ui/functions.js +341 -0
- package/dist/a2ui/ids.d.ts +5 -0
- package/dist/a2ui/ids.js +7 -0
- package/dist/a2ui/index.d.ts +16 -0
- package/dist/a2ui/index.js +12 -0
- package/dist/a2ui/jsonl.d.ts +41 -0
- package/dist/a2ui/jsonl.js +127 -0
- package/dist/a2ui/links.d.ts +17 -0
- package/dist/a2ui/links.js +29 -0
- package/dist/a2ui/pointer.d.ts +22 -0
- package/dist/a2ui/pointer.js +85 -0
- package/dist/a2ui/processor.d.ts +126 -0
- package/dist/a2ui/processor.js +497 -0
- package/dist/a2ui/react.d.ts +2 -0
- package/dist/a2ui/react.js +1 -0
- package/dist/a2ui/toTsx.d.ts +9 -0
- package/dist/a2ui/toTsx.js +1389 -0
- package/dist/a2ui/types.d.ts +96 -0
- package/dist/a2ui/validate.d.ts +90 -0
- package/dist/a2ui/validate.js +750 -0
- package/dist/a2ui-catalog.json +4369 -0
- package/dist/a2ui-conformance.json +71 -0
- package/dist/components/Accordion/Accordion.css +58 -0
- package/dist/components/Accordion/Accordion.css.d.ts +5 -0
- package/dist/components/Accordion/Accordion.css.js +10 -0
- package/dist/components/Accordion/Accordion.d.ts +23 -0
- package/dist/components/Accordion/Accordion.docs.d.ts +19 -0
- package/dist/components/Accordion/Accordion.docs.js +43 -0
- package/dist/components/Accordion/Accordion.js +55 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/index.js +1 -0
- package/dist/components/AiLabel/AiLabel.css +70 -0
- package/dist/components/AiLabel/AiLabel.css.d.ts +8 -0
- package/dist/components/AiLabel/AiLabel.css.js +11 -0
- package/dist/components/AiLabel/AiLabel.d.ts +29 -0
- package/dist/components/AiLabel/AiLabel.docs.d.ts +19 -0
- package/dist/components/AiLabel/AiLabel.docs.js +51 -0
- package/dist/components/AiLabel/AiLabel.js +41 -0
- package/dist/components/AiLabel/index.d.ts +1 -0
- package/dist/components/AiLabel/index.js +1 -0
- package/dist/components/Alert/Alert.css +76 -0
- package/dist/components/Alert/Alert.css.d.ts +9 -0
- package/dist/components/Alert/Alert.css.js +23 -0
- package/dist/components/Alert/Alert.d.ts +21 -0
- package/dist/components/Alert/Alert.docs.d.ts +19 -0
- package/dist/components/Alert/Alert.docs.js +57 -0
- package/dist/components/Alert/Alert.js +55 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/Alert/index.js +1 -0
- package/dist/components/Avatar/Avatar.css +42 -0
- package/dist/components/Avatar/Avatar.css.d.ts +3 -0
- package/dist/components/Avatar/Avatar.css.js +12 -0
- package/dist/components/Avatar/Avatar.d.ts +13 -0
- package/dist/components/Avatar/Avatar.docs.d.ts +19 -0
- package/dist/components/Avatar/Avatar.docs.js +43 -0
- package/dist/components/Avatar/Avatar.js +31 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +1 -0
- package/dist/components/Avatar/initials.d.ts +2 -0
- package/dist/components/Avatar/initials.js +8 -0
- package/dist/components/Badge/Badge.css +63 -0
- package/dist/components/Badge/Badge.css.d.ts +5 -0
- package/dist/components/Badge/Badge.css.js +16 -0
- package/dist/components/Badge/Badge.d.ts +15 -0
- package/dist/components/Badge/Badge.docs.d.ts +19 -0
- package/dist/components/Badge/Badge.docs.js +52 -0
- package/dist/components/Badge/Badge.js +24 -0
- package/dist/components/Badge/index.d.ts +1 -0
- package/dist/components/Badge/index.js +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.css +40 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.css.d.ts +5 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.css.js +10 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +17 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.docs.d.ts +19 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.docs.js +38 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +48 -0
- package/dist/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/components/Breadcrumbs/index.js +1 -0
- package/dist/components/Button/Button.css +101 -0
- package/dist/components/Button/Button.css.d.ts +72 -0
- package/dist/components/Button/Button.css.js +35 -0
- package/dist/components/Button/Button.d.ts +53 -0
- package/dist/components/Button/Button.docs.d.ts +19 -0
- package/dist/components/Button/Button.docs.js +71 -0
- package/dist/components/Button/Button.js +68 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.js +1 -0
- package/dist/components/Card/Card.css +122 -0
- package/dist/components/Card/Card.css.d.ts +12 -0
- package/dist/components/Card/Card.css.js +25 -0
- package/dist/components/Card/Card.d.ts +306 -0
- package/dist/components/Card/Card.docs.d.ts +19 -0
- package/dist/components/Card/Card.docs.js +65 -0
- package/dist/components/Card/Card.js +53 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Card/index.js +1 -0
- package/dist/components/ChatMessage/ChatMessage.css +56 -0
- package/dist/components/ChatMessage/ChatMessage.css.d.ts +7 -0
- package/dist/components/ChatMessage/ChatMessage.css.js +15 -0
- package/dist/components/ChatMessage/ChatMessage.d.ts +35 -0
- package/dist/components/ChatMessage/ChatMessage.docs.d.ts +19 -0
- package/dist/components/ChatMessage/ChatMessage.docs.js +45 -0
- package/dist/components/ChatMessage/ChatMessage.js +49 -0
- package/dist/components/ChatMessage/index.d.ts +1 -0
- package/dist/components/ChatMessage/index.js +1 -0
- package/dist/components/Checkbox/Checkbox.css +70 -0
- package/dist/components/Checkbox/Checkbox.css.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.css.js +6 -0
- package/dist/components/Checkbox/Checkbox.d.ts +28 -0
- package/dist/components/Checkbox/Checkbox.docs.d.ts +19 -0
- package/dist/components/Checkbox/Checkbox.docs.js +53 -0
- package/dist/components/Checkbox/Checkbox.js +63 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.js +1 -0
- package/dist/components/Code/Code.css +12 -0
- package/dist/components/Code/Code.css.d.ts +1 -0
- package/dist/components/Code/Code.css.js +5 -0
- package/dist/components/Code/Code.d.ts +7 -0
- package/dist/components/Code/Code.docs.d.ts +19 -0
- package/dist/components/Code/Code.docs.js +26 -0
- package/dist/components/Code/Code.js +12 -0
- package/dist/components/Code/index.d.ts +1 -0
- package/dist/components/Code/index.js +1 -0
- package/dist/components/CodeBlock/CodeBlock.css +76 -0
- package/dist/components/CodeBlock/CodeBlock.css.d.ts +12 -0
- package/dist/components/CodeBlock/CodeBlock.css.js +21 -0
- package/dist/components/CodeBlock/CodeBlock.d.ts +19 -0
- package/dist/components/CodeBlock/CodeBlock.docs.d.ts +19 -0
- package/dist/components/CodeBlock/CodeBlock.docs.js +47 -0
- package/dist/components/CodeBlock/CodeBlock.js +82 -0
- package/dist/components/CodeBlock/highlight.d.ts +28 -0
- package/dist/components/CodeBlock/highlight.js +118 -0
- package/dist/components/CodeBlock/index.d.ts +1 -0
- package/dist/components/CodeBlock/index.js +1 -0
- package/dist/components/Container/Container.css +21 -0
- package/dist/components/Container/Container.css.d.ts +3 -0
- package/dist/components/Container/Container.css.js +12 -0
- package/dist/components/Container/Container.d.ts +295 -0
- package/dist/components/Container/Container.docs.d.ts +19 -0
- package/dist/components/Container/Container.docs.js +31 -0
- package/dist/components/Container/Container.js +12 -0
- package/dist/components/Container/index.d.ts +1 -0
- package/dist/components/Container/index.js +1 -0
- package/dist/components/Dialog/Dialog.css +94 -0
- package/dist/components/Dialog/Dialog.css.d.ts +9 -0
- package/dist/components/Dialog/Dialog.css.js +17 -0
- package/dist/components/Dialog/Dialog.d.ts +29 -0
- package/dist/components/Dialog/Dialog.docs.d.ts +19 -0
- package/dist/components/Dialog/Dialog.docs.js +50 -0
- package/dist/components/Dialog/Dialog.js +90 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +1 -0
- package/dist/components/Divider/Divider.css +41 -0
- package/dist/components/Divider/Divider.css.d.ts +6 -0
- package/dist/components/Divider/Divider.css.js +16 -0
- package/dist/components/Divider/Divider.d.ts +11 -0
- package/dist/components/Divider/Divider.docs.d.ts +19 -0
- package/dist/components/Divider/Divider.docs.js +43 -0
- package/dist/components/Divider/Divider.js +30 -0
- package/dist/components/Divider/index.d.ts +1 -0
- package/dist/components/Divider/index.js +1 -0
- package/dist/components/Grid/Grid.css +11 -0
- package/dist/components/Grid/Grid.css.d.ts +8 -0
- package/dist/components/Grid/Grid.css.js +8 -0
- package/dist/components/Grid/Grid.d.ts +18 -0
- package/dist/components/Grid/Grid.docs.d.ts +19 -0
- package/dist/components/Grid/Grid.docs.js +41 -0
- package/dist/components/Grid/Grid.js +22 -0
- package/dist/components/Grid/index.d.ts +1 -0
- package/dist/components/Grid/index.js +1 -0
- package/dist/components/Heading/Heading.css +44 -0
- package/dist/components/Heading/Heading.css.d.ts +3 -0
- package/dist/components/Heading/Heading.css.js +17 -0
- package/dist/components/Heading/Heading.d.ts +298 -0
- package/dist/components/Heading/Heading.docs.d.ts +19 -0
- package/dist/components/Heading/Heading.docs.js +48 -0
- package/dist/components/Heading/Heading.js +20 -0
- package/dist/components/Heading/index.d.ts +1 -0
- package/dist/components/Heading/index.js +1 -0
- package/dist/components/Icon/Icon.css +25 -0
- package/dist/components/Icon/Icon.css.d.ts +4 -0
- package/dist/components/Icon/Icon.css.js +13 -0
- package/dist/components/Icon/Icon.d.ts +16 -0
- package/dist/components/Icon/Icon.docs.d.ts +19 -0
- package/dist/components/Icon/Icon.docs.js +56 -0
- package/dist/components/Icon/Icon.js +25 -0
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/index.js +1 -0
- package/dist/components/IconButton/IconButton.css +70 -0
- package/dist/components/IconButton/IconButton.css.d.ts +57 -0
- package/dist/components/IconButton/IconButton.css.js +27 -0
- package/dist/components/IconButton/IconButton.d.ts +46 -0
- package/dist/components/IconButton/IconButton.docs.d.ts +19 -0
- package/dist/components/IconButton/IconButton.docs.js +48 -0
- package/dist/components/IconButton/IconButton.js +44 -0
- package/dist/components/IconButton/index.d.ts +1 -0
- package/dist/components/IconButton/index.js +1 -0
- package/dist/components/Image/Image.css +53 -0
- package/dist/components/Image/Image.css.d.ts +7 -0
- package/dist/components/Image/Image.css.js +18 -0
- package/dist/components/Image/Image.d.ts +23 -0
- package/dist/components/Image/Image.docs.d.ts +19 -0
- package/dist/components/Image/Image.docs.js +48 -0
- package/dist/components/Image/Image.js +75 -0
- package/dist/components/Image/index.d.ts +1 -0
- package/dist/components/Image/index.js +1 -0
- package/dist/components/Inline/Inline.css +38 -0
- package/dist/components/Inline/Inline.css.d.ts +4 -0
- package/dist/components/Inline/Inline.css.js +18 -0
- package/dist/components/Inline/Inline.d.ts +300 -0
- package/dist/components/Inline/Inline.docs.d.ts +19 -0
- package/dist/components/Inline/Inline.docs.js +48 -0
- package/dist/components/Inline/Inline.js +13 -0
- package/dist/components/Inline/index.d.ts +1 -0
- package/dist/components/Inline/index.js +1 -0
- package/dist/components/Link/Link.css +57 -0
- package/dist/components/Link/Link.css.d.ts +5 -0
- package/dist/components/Link/Link.css.js +14 -0
- package/dist/components/Link/Link.d.ts +19 -0
- package/dist/components/Link/Link.docs.d.ts +19 -0
- package/dist/components/Link/Link.docs.js +51 -0
- package/dist/components/Link/Link.js +39 -0
- package/dist/components/Link/index.d.ts +1 -0
- package/dist/components/Link/index.js +1 -0
- package/dist/components/List/List.css +39 -0
- package/dist/components/List/List.css.d.ts +5 -0
- package/dist/components/List/List.css.js +14 -0
- package/dist/components/List/List.d.ts +294 -0
- package/dist/components/List/List.docs.d.ts +19 -0
- package/dist/components/List/List.docs.js +43 -0
- package/dist/components/List/List.js +25 -0
- package/dist/components/List/index.d.ts +1 -0
- package/dist/components/List/index.js +1 -0
- package/dist/components/Menu/Menu.css +65 -0
- package/dist/components/Menu/Menu.css.d.ts +5 -0
- package/dist/components/Menu/Menu.css.js +9 -0
- package/dist/components/Menu/Menu.d.ts +60 -0
- package/dist/components/Menu/Menu.docs.d.ts +19 -0
- package/dist/components/Menu/Menu.docs.js +53 -0
- package/dist/components/Menu/Menu.js +192 -0
- package/dist/components/Menu/index.d.ts +1 -0
- package/dist/components/Menu/index.js +1 -0
- package/dist/components/NavBar/NavBar.css +187 -0
- package/dist/components/NavBar/NavBar.css.d.ts +16 -0
- package/dist/components/NavBar/NavBar.css.js +19 -0
- package/dist/components/NavBar/NavBar.d.ts +31 -0
- package/dist/components/NavBar/NavBar.docs.d.ts +19 -0
- package/dist/components/NavBar/NavBar.docs.js +53 -0
- package/dist/components/NavBar/NavBar.js +110 -0
- package/dist/components/NavBar/index.d.ts +1 -0
- package/dist/components/NavBar/index.js +1 -0
- package/dist/components/Popover/Popover.css +28 -0
- package/dist/components/Popover/Popover.css.d.ts +3 -0
- package/dist/components/Popover/Popover.css.js +8 -0
- package/dist/components/Popover/Popover.d.ts +40 -0
- package/dist/components/Popover/Popover.docs.d.ts +19 -0
- package/dist/components/Popover/Popover.docs.js +50 -0
- package/dist/components/Popover/Popover.js +69 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Popover/index.js +1 -0
- package/dist/components/Progress/Progress.css +106 -0
- package/dist/components/Progress/Progress.css.d.ts +10 -0
- package/dist/components/Progress/Progress.css.js +24 -0
- package/dist/components/Progress/Progress.d.ts +23 -0
- package/dist/components/Progress/Progress.docs.d.ts +19 -0
- package/dist/components/Progress/Progress.docs.js +43 -0
- package/dist/components/Progress/Progress.js +54 -0
- package/dist/components/Progress/index.d.ts +1 -0
- package/dist/components/Progress/index.js +1 -0
- package/dist/components/PromptInput/PromptInput.css +25 -0
- package/dist/components/PromptInput/PromptInput.css.d.ts +5 -0
- package/dist/components/PromptInput/PromptInput.css.js +8 -0
- package/dist/components/PromptInput/PromptInput.d.ts +65 -0
- package/dist/components/PromptInput/PromptInput.docs.d.ts +19 -0
- package/dist/components/PromptInput/PromptInput.docs.js +45 -0
- package/dist/components/PromptInput/PromptInput.js +91 -0
- package/dist/components/PromptInput/index.d.ts +1 -0
- package/dist/components/PromptInput/index.js +1 -0
- package/dist/components/Quote/Quote.css +31 -0
- package/dist/components/Quote/Quote.css.d.ts +5 -0
- package/dist/components/Quote/Quote.css.js +9 -0
- package/dist/components/Quote/Quote.d.ts +13 -0
- package/dist/components/Quote/Quote.docs.d.ts +19 -0
- package/dist/components/Quote/Quote.docs.js +30 -0
- package/dist/components/Quote/Quote.js +26 -0
- package/dist/components/Quote/index.d.ts +1 -0
- package/dist/components/Quote/index.js +1 -0
- package/dist/components/RadioGroup/RadioGroup.css +70 -0
- package/dist/components/RadioGroup/RadioGroup.css.d.ts +4 -0
- package/dist/components/RadioGroup/RadioGroup.css.js +12 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +32 -0
- package/dist/components/RadioGroup/RadioGroup.docs.d.ts +19 -0
- package/dist/components/RadioGroup/RadioGroup.docs.js +47 -0
- package/dist/components/RadioGroup/RadioGroup.js +85 -0
- package/dist/components/RadioGroup/index.d.ts +1 -0
- package/dist/components/RadioGroup/index.js +1 -0
- package/dist/components/Select/Select.css +17 -0
- package/dist/components/Select/Select.css.d.ts +3 -0
- package/dist/components/Select/Select.css.js +7 -0
- package/dist/components/Select/Select.d.ts +26 -0
- package/dist/components/Select/Select.docs.d.ts +19 -0
- package/dist/components/Select/Select.docs.js +35 -0
- package/dist/components/Select/Select.js +57 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +1 -0
- package/dist/components/SideNav/SideNav.css +74 -0
- package/dist/components/SideNav/SideNav.css.d.ts +7 -0
- package/dist/components/SideNav/SideNav.css.js +12 -0
- package/dist/components/SideNav/SideNav.d.ts +23 -0
- package/dist/components/SideNav/SideNav.docs.d.ts +19 -0
- package/dist/components/SideNav/SideNav.docs.js +43 -0
- package/dist/components/SideNav/SideNav.js +55 -0
- package/dist/components/SideNav/index.d.ts +1 -0
- package/dist/components/SideNav/index.js +1 -0
- package/dist/components/Skeleton/Skeleton.css +45 -0
- package/dist/components/Skeleton/Skeleton.css.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.css.js +11 -0
- package/dist/components/Skeleton/Skeleton.d.ts +25 -0
- package/dist/components/Skeleton/Skeleton.docs.d.ts +19 -0
- package/dist/components/Skeleton/Skeleton.docs.js +43 -0
- package/dist/components/Skeleton/Skeleton.js +27 -0
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/Skeleton/index.js +1 -0
- package/dist/components/Spinner/Spinner.css +46 -0
- package/dist/components/Spinner/Spinner.css.d.ts +5 -0
- package/dist/components/Spinner/Spinner.css.js +13 -0
- package/dist/components/Spinner/Spinner.d.ts +24 -0
- package/dist/components/Spinner/Spinner.docs.d.ts +19 -0
- package/dist/components/Spinner/Spinner.docs.js +44 -0
- package/dist/components/Spinner/Spinner.js +46 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Spinner/index.js +1 -0
- package/dist/components/Stack/Stack.css +21 -0
- package/dist/components/Stack/Stack.css.d.ts +2 -0
- package/dist/components/Stack/Stack.css.js +10 -0
- package/dist/components/Stack/Stack.d.ts +296 -0
- package/dist/components/Stack/Stack.docs.d.ts +19 -0
- package/dist/components/Stack/Stack.docs.js +48 -0
- package/dist/components/Stack/Stack.js +13 -0
- package/dist/components/Stack/index.d.ts +1 -0
- package/dist/components/Stack/index.js +1 -0
- package/dist/components/Stat/Stat.css +59 -0
- package/dist/components/Stat/Stat.css.d.ts +13 -0
- package/dist/components/Stat/Stat.css.js +18 -0
- package/dist/components/Stat/Stat.d.ts +20 -0
- package/dist/components/Stat/Stat.docs.d.ts +19 -0
- package/dist/components/Stat/Stat.docs.js +52 -0
- package/dist/components/Stat/Stat.js +49 -0
- package/dist/components/Stat/index.d.ts +1 -0
- package/dist/components/Stat/index.js +1 -0
- package/dist/components/StreamingIndicator/StreamingIndicator.css +46 -0
- package/dist/components/StreamingIndicator/StreamingIndicator.css.d.ts +5 -0
- package/dist/components/StreamingIndicator/StreamingIndicator.css.js +13 -0
- package/dist/components/StreamingIndicator/StreamingIndicator.d.ts +22 -0
- package/dist/components/StreamingIndicator/StreamingIndicator.docs.d.ts +19 -0
- package/dist/components/StreamingIndicator/StreamingIndicator.docs.js +43 -0
- package/dist/components/StreamingIndicator/StreamingIndicator.js +31 -0
- package/dist/components/StreamingIndicator/index.d.ts +1 -0
- package/dist/components/StreamingIndicator/index.js +1 -0
- package/dist/components/Switch/Switch.css +89 -0
- package/dist/components/Switch/Switch.css.d.ts +4 -0
- package/dist/components/Switch/Switch.css.js +9 -0
- package/dist/components/Switch/Switch.d.ts +21 -0
- package/dist/components/Switch/Switch.docs.d.ts +19 -0
- package/dist/components/Switch/Switch.docs.js +36 -0
- package/dist/components/Switch/Switch.js +51 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/index.js +1 -0
- package/dist/components/TabBar/TabBar.css +94 -0
- package/dist/components/TabBar/TabBar.css.d.ts +7 -0
- package/dist/components/TabBar/TabBar.css.js +12 -0
- package/dist/components/TabBar/TabBar.d.ts +23 -0
- package/dist/components/TabBar/TabBar.docs.d.ts +19 -0
- package/dist/components/TabBar/TabBar.docs.js +43 -0
- package/dist/components/TabBar/TabBar.js +50 -0
- package/dist/components/TabBar/index.d.ts +1 -0
- package/dist/components/TabBar/index.js +1 -0
- package/dist/components/Table/Table.css +75 -0
- package/dist/components/Table/Table.css.d.ts +10 -0
- package/dist/components/Table/Table.css.js +22 -0
- package/dist/components/Table/Table.d.ts +32 -0
- package/dist/components/Table/Table.docs.d.ts +19 -0
- package/dist/components/Table/Table.docs.js +49 -0
- package/dist/components/Table/Table.js +69 -0
- package/dist/components/Table/index.d.ts +1 -0
- package/dist/components/Table/index.js +1 -0
- package/dist/components/Tabs/Tabs.css +79 -0
- package/dist/components/Tabs/Tabs.css.d.ts +6 -0
- package/dist/components/Tabs/Tabs.css.js +14 -0
- package/dist/components/Tabs/Tabs.d.ts +33 -0
- package/dist/components/Tabs/Tabs.docs.d.ts +19 -0
- package/dist/components/Tabs/Tabs.docs.js +56 -0
- package/dist/components/Tabs/Tabs.js +90 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +1 -0
- package/dist/components/Tag/Tag.css +63 -0
- package/dist/components/Tag/Tag.css.d.ts +5 -0
- package/dist/components/Tag/Tag.css.js +10 -0
- package/dist/components/Tag/Tag.d.ts +13 -0
- package/dist/components/Tag/Tag.docs.d.ts +19 -0
- package/dist/components/Tag/Tag.docs.js +39 -0
- package/dist/components/Tag/Tag.js +35 -0
- package/dist/components/Tag/index.d.ts +1 -0
- package/dist/components/Tag/index.js +1 -0
- package/dist/components/Text/Text.css +86 -0
- package/dist/components/Text/Text.css.d.ts +6 -0
- package/dist/components/Text/Text.css.js +39 -0
- package/dist/components/Text/Text.d.ts +310 -0
- package/dist/components/Text/Text.docs.d.ts +19 -0
- package/dist/components/Text/Text.docs.js +52 -0
- package/dist/components/Text/Text.js +12 -0
- package/dist/components/Text/index.d.ts +1 -0
- package/dist/components/Text/index.js +1 -0
- package/dist/components/TextArea/TextArea.css +8 -0
- package/dist/components/TextArea/TextArea.css.d.ts +1 -0
- package/dist/components/TextArea/TextArea.css.js +5 -0
- package/dist/components/TextArea/TextArea.d.ts +15 -0
- package/dist/components/TextArea/TextArea.docs.d.ts +19 -0
- package/dist/components/TextArea/TextArea.docs.js +31 -0
- package/dist/components/TextArea/TextArea.js +33 -0
- package/dist/components/TextArea/index.d.ts +1 -0
- package/dist/components/TextArea/index.js +1 -0
- package/dist/components/TextField/TextField.d.ts +14 -0
- package/dist/components/TextField/TextField.docs.d.ts +19 -0
- package/dist/components/TextField/TextField.docs.js +59 -0
- package/dist/components/TextField/TextField.js +32 -0
- package/dist/components/TextField/index.d.ts +1 -0
- package/dist/components/TextField/index.js +1 -0
- package/dist/components/Timeline/Timeline.css +100 -0
- package/dist/components/Timeline/Timeline.css.d.ts +10 -0
- package/dist/components/Timeline/Timeline.css.js +15 -0
- package/dist/components/Timeline/Timeline.d.ts +22 -0
- package/dist/components/Timeline/Timeline.docs.d.ts +19 -0
- package/dist/components/Timeline/Timeline.docs.js +39 -0
- package/dist/components/Timeline/Timeline.js +42 -0
- package/dist/components/Timeline/index.d.ts +1 -0
- package/dist/components/Timeline/index.js +1 -0
- package/dist/components/Toast/Toast.css +106 -0
- package/dist/components/Toast/Toast.css.d.ts +11 -0
- package/dist/components/Toast/Toast.css.js +25 -0
- package/dist/components/Toast/Toast.d.ts +30 -0
- package/dist/components/Toast/Toast.docs.d.ts +19 -0
- package/dist/components/Toast/Toast.docs.js +49 -0
- package/dist/components/Toast/Toast.js +68 -0
- package/dist/components/Toast/ToastProvider.d.ts +12 -0
- package/dist/components/Toast/ToastProvider.js +140 -0
- package/dist/components/Toast/index.d.ts +3 -0
- package/dist/components/Toast/index.js +4 -0
- package/dist/components/Toast/toast-context.d.ts +21 -0
- package/dist/components/Toast/toast-context.js +11 -0
- package/dist/components/Tooltip/Tooltip.css +18 -0
- package/dist/components/Tooltip/Tooltip.css.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.css.js +5 -0
- package/dist/components/Tooltip/Tooltip.d.ts +45 -0
- package/dist/components/Tooltip/Tooltip.docs.d.ts +19 -0
- package/dist/components/Tooltip/Tooltip.docs.js +47 -0
- package/dist/components/Tooltip/Tooltip.js +93 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +1 -0
- package/dist/icons/index.d.ts +293 -0
- package/dist/icons/index.js +395 -0
- package/dist/index.d.ts +66 -0
- package/dist/index.js +59 -0
- package/dist/internal/Field.d.ts +31 -0
- package/dist/internal/Field.js +54 -0
- package/dist/internal/field-ids.d.ts +7 -0
- package/dist/internal/field-ids.js +18 -0
- package/dist/internal/field.css +131 -0
- package/dist/internal/field.css.d.ts +16 -0
- package/dist/internal/field.css.js +22 -0
- package/dist/internal/floating-geometry.d.ts +42 -0
- package/dist/internal/floating-geometry.js +55 -0
- package/dist/internal/floating.css +36 -0
- package/dist/internal/floating.css.d.ts +8 -0
- package/dist/internal/floating.css.js +6 -0
- package/dist/internal/floating.d.ts +27 -0
- package/dist/internal/floating.js +118 -0
- package/dist/internal/useControllableState.d.ts +16 -0
- package/dist/internal/useControllableState.js +28 -0
- package/dist/internal/useOverflow.d.ts +7 -0
- package/dist/internal/useOverflow.js +24 -0
- package/dist/internal/usePopover.d.ts +28 -0
- package/dist/internal/usePopover.js +91 -0
- package/dist/manifest.json +12308 -0
- package/dist/patterns/dashboard-overview.docs.d.ts +22 -0
- package/dist/patterns/dashboard-overview.docs.js +80 -0
- package/dist/patterns/empty-state.docs.d.ts +22 -0
- package/dist/patterns/empty-state.docs.js +60 -0
- package/dist/patterns/index.d.ts +6 -0
- package/dist/patterns/index.js +14 -0
- package/dist/patterns/profile-card.docs.d.ts +22 -0
- package/dist/patterns/profile-card.docs.js +72 -0
- package/dist/patterns/settings-page.docs.d.ts +22 -0
- package/dist/patterns/settings-page.docs.js +76 -0
- package/dist/patterns/sign-in-form.docs.d.ts +22 -0
- package/dist/patterns/sign-in-form.docs.js +84 -0
- package/dist/primitives/VisuallyHidden.d.ts +13 -0
- package/dist/primitives/VisuallyHidden.js +18 -0
- package/dist/providers/LinkProvider.d.ts +18 -0
- package/dist/providers/LinkProvider.js +23 -0
- package/dist/providers/StringsProvider.d.ts +14 -0
- package/dist/providers/StringsProvider.js +25 -0
- package/dist/providers/link-context.d.ts +12 -0
- package/dist/providers/link-context.js +15 -0
- package/dist/providers/strings.d.ts +64 -0
- package/dist/providers/strings.js +38 -0
- package/dist/registry/gaps.d.ts +30 -0
- package/dist/registry/gaps.js +208 -0
- package/dist/registry/generated.d.ts +5 -0
- package/dist/registry/generated.js +2821 -0
- package/dist/registry/index.d.ts +36 -0
- package/dist/registry/index.js +201 -0
- package/dist/registry/types.d.ts +84 -0
- package/dist/styles/base.css +9 -0
- package/dist/styles/base.css.d.ts +1 -0
- package/dist/styles/base.css.js +1 -0
- package/dist/styles/layout.css +33 -0
- package/dist/styles/layout.css.d.ts +1 -0
- package/dist/styles/layout.css.js +17 -0
- package/dist/styles/shared.css +16 -0
- package/dist/styles/shared.css.d.ts +35 -0
- package/dist/styles/shared.css.js +5 -0
- package/dist/styles.css +3406 -0
- package/dist/themes/blueprint.css +115 -0
- package/dist/themes/contrast.d.ts +26 -0
- package/dist/themes/contrast.js +114 -0
- package/dist/themes/define.d.ts +9 -0
- package/dist/themes/define.js +29 -0
- package/dist/themes/dtcg.d.ts +126 -0
- package/dist/themes/dtcg.js +268 -0
- package/dist/themes/index.d.ts +19 -0
- package/dist/themes/index.js +21 -0
- package/dist/themes/letterpress.css +115 -0
- package/dist/themes/letterpress.d.ts +7 -0
- package/dist/themes/letterpress.js +187 -0
- package/dist/themes/presets/blueprint.d.ts +6 -0
- package/dist/themes/presets/blueprint.js +183 -0
- package/dist/themes/runtime/browser.d.ts +47 -0
- package/dist/themes/runtime/browser.js +164 -0
- package/dist/themes/runtime/cache.d.ts +43 -0
- package/dist/themes/runtime/cache.js +87 -0
- package/dist/themes/runtime/css.d.ts +43 -0
- package/dist/themes/runtime/css.js +89 -0
- package/dist/themes/runtime/diff.d.ts +22 -0
- package/dist/themes/runtime/diff.js +43 -0
- package/dist/themes/types.d.ts +59 -0
- package/dist/themes/values.d.ts +12 -0
- package/dist/themes/values.js +40 -0
- package/dist/tokens/blueprint.dark.tokens.json +1361 -0
- package/dist/tokens/blueprint.light.tokens.json +1361 -0
- package/dist/tokens/contract.d.ts +252 -0
- package/dist/tokens/contract.js +249 -0
- package/dist/tokens/index.d.ts +6 -0
- package/dist/tokens/index.js +1 -0
- package/dist/tokens/letterpress.dark.tokens.json +1391 -0
- package/dist/tokens/letterpress.light.tokens.json +1391 -0
- package/dist/tokens/tokens.css +117 -0
- package/dist/tokens/tokens.css.d.ts +128 -0
- package/dist/tokens/tokens.css.js +121 -0
- package/dist/utils/cx.d.ts +7 -0
- package/dist/utils/cx.js +14 -0
- package/dist/utils/space.d.ts +5 -0
- package/dist/utils/space.js +7 -0
- package/package.json +104 -3
|
@@ -0,0 +1,1666 @@
|
|
|
1
|
+
import { iconNames } from "../icons/index.js";
|
|
2
|
+
import { basicCatalogId, catalogId, catalogPath } from "./ids.js";
|
|
3
|
+
import { A2UI_VERSION } from "./validate.js";
|
|
4
|
+
// src/a2ui/catalog.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Derelicious A2UI catalog. It extends the A2UI v0.9 basic catalog: every
|
|
7
|
+
* basic type renders with the closest Derelicious component, a few basic types
|
|
8
|
+
* gain optional Derelicious props, and Derelicious-only types come from the
|
|
9
|
+
* registry. Plain data, importable from Node.
|
|
10
|
+
*
|
|
11
|
+
* `buildCatalogJson()` turns this file into the catalog document that
|
|
12
|
+
* `pnpm ds:manifest` writes to `generated/a2ui-catalog.json` and
|
|
13
|
+
* `public/derelicious-ds/a2ui/v0.9/catalog.json`. The validator, the
|
|
14
|
+
* processor, the renderer, the server, and the MCP server all read that
|
|
15
|
+
* document, so a type added here shows up everywhere.
|
|
16
|
+
*
|
|
17
|
+
* Not in the catalog, on purpose:
|
|
18
|
+
* - Stack, Inline: the basic Column and Row render them.
|
|
19
|
+
* - Container: a surface fills the slot it is rendered in.
|
|
20
|
+
* - Checkbox, RadioGroup, TextArea, Dialog, Tabs, Image, Icon, Divider, Card,
|
|
21
|
+
* Button, List: the basic CheckBox, ChoicePicker, TextField (longText),
|
|
22
|
+
* Modal, Tabs, Image, Icon, Divider, Card, Button, and List render them.
|
|
23
|
+
* - Code: Text supports `backticks` for inline code.
|
|
24
|
+
* - Video, AudioPlayer: kept for basic-catalog compatibility, but they render
|
|
25
|
+
* a plain link. The system has no media player.
|
|
26
|
+
*/
|
|
27
|
+
var ref = (name, description) => description ? {
|
|
28
|
+
$ref: `#/$defs/${name}`,
|
|
29
|
+
description
|
|
30
|
+
} : { $ref: `#/$defs/${name}` };
|
|
31
|
+
var text = (description) => ref("DynamicString", description);
|
|
32
|
+
var number = (description) => ref("DynamicNumber", description);
|
|
33
|
+
var bool = (description) => ref("DynamicBoolean", description);
|
|
34
|
+
var id = (description) => ref("ComponentId", description);
|
|
35
|
+
var children = (description) => ref("ChildList", description);
|
|
36
|
+
var choice = (values, description, fallback) => ({
|
|
37
|
+
type: typeof values[0] === "number" ? "integer" : "string",
|
|
38
|
+
enum: [...values],
|
|
39
|
+
description,
|
|
40
|
+
...fallback === void 0 ? {} : { default: fallback }
|
|
41
|
+
});
|
|
42
|
+
var flag = (description, fallback = false) => ({
|
|
43
|
+
type: "boolean",
|
|
44
|
+
description,
|
|
45
|
+
default: fallback
|
|
46
|
+
});
|
|
47
|
+
var list = (item, description, max = 50, min = 0) => ({
|
|
48
|
+
type: "array",
|
|
49
|
+
description,
|
|
50
|
+
items: item,
|
|
51
|
+
...min ? { minItems: min } : {},
|
|
52
|
+
maxItems: max
|
|
53
|
+
});
|
|
54
|
+
var object = (properties, required = []) => ({
|
|
55
|
+
type: "object",
|
|
56
|
+
properties,
|
|
57
|
+
...required.length ? { required } : {},
|
|
58
|
+
additionalProperties: false
|
|
59
|
+
});
|
|
60
|
+
var spaceSteps = [
|
|
61
|
+
0,
|
|
62
|
+
1,
|
|
63
|
+
2,
|
|
64
|
+
3,
|
|
65
|
+
4,
|
|
66
|
+
6,
|
|
67
|
+
8
|
|
68
|
+
];
|
|
69
|
+
var gap = (fallback) => choice(spaceSteps, "Space between children, as a step of the space scale (3 is 0.75rem, 4 is 1rem). Derelicious extension.", fallback);
|
|
70
|
+
var textTones = [
|
|
71
|
+
"default",
|
|
72
|
+
"muted",
|
|
73
|
+
"accent",
|
|
74
|
+
"positive",
|
|
75
|
+
"warning",
|
|
76
|
+
"danger",
|
|
77
|
+
"info"
|
|
78
|
+
];
|
|
79
|
+
var statusTones = [
|
|
80
|
+
"neutral",
|
|
81
|
+
"accent",
|
|
82
|
+
"positive",
|
|
83
|
+
"warning",
|
|
84
|
+
"danger",
|
|
85
|
+
"info"
|
|
86
|
+
];
|
|
87
|
+
/** Icon names from the A2UI basic catalog, mapped to Derelicious icons. */
|
|
88
|
+
var basicIconMap = {
|
|
89
|
+
accountCircle: "user",
|
|
90
|
+
add: "plus",
|
|
91
|
+
arrowBack: "arrow-left",
|
|
92
|
+
arrowForward: "arrow-right",
|
|
93
|
+
attachFile: "file",
|
|
94
|
+
calendarToday: "calendar",
|
|
95
|
+
call: "phone",
|
|
96
|
+
camera: "image",
|
|
97
|
+
check: "check",
|
|
98
|
+
close: "close",
|
|
99
|
+
delete: "trash",
|
|
100
|
+
download: "download",
|
|
101
|
+
edit: "edit",
|
|
102
|
+
event: "calendar",
|
|
103
|
+
error: "error",
|
|
104
|
+
fastForward: "skip-forward",
|
|
105
|
+
favorite: "heart",
|
|
106
|
+
favoriteOff: "heart",
|
|
107
|
+
folder: "folder",
|
|
108
|
+
help: "info",
|
|
109
|
+
home: "home",
|
|
110
|
+
info: "info",
|
|
111
|
+
locationOn: "map-pin",
|
|
112
|
+
lock: "lock",
|
|
113
|
+
lockOpen: "unlock",
|
|
114
|
+
mail: "mail",
|
|
115
|
+
menu: "menu",
|
|
116
|
+
moreVert: "more",
|
|
117
|
+
moreHoriz: "more",
|
|
118
|
+
notificationsOff: "bell-off",
|
|
119
|
+
notifications: "bell",
|
|
120
|
+
pause: "pause",
|
|
121
|
+
payment: "credit-card",
|
|
122
|
+
person: "user",
|
|
123
|
+
phone: "phone",
|
|
124
|
+
photo: "image",
|
|
125
|
+
play: "play",
|
|
126
|
+
print: "file",
|
|
127
|
+
refresh: "refresh",
|
|
128
|
+
rewind: "skip-back",
|
|
129
|
+
search: "search",
|
|
130
|
+
send: "send",
|
|
131
|
+
settings: "settings",
|
|
132
|
+
share: "external",
|
|
133
|
+
shoppingCart: "cart",
|
|
134
|
+
skipNext: "skip-forward",
|
|
135
|
+
skipPrevious: "skip-back",
|
|
136
|
+
star: "star",
|
|
137
|
+
starHalf: "star",
|
|
138
|
+
starOff: "star",
|
|
139
|
+
stop: "stop",
|
|
140
|
+
upload: "upload",
|
|
141
|
+
visibility: "eye",
|
|
142
|
+
visibilityOff: "eye-off",
|
|
143
|
+
volumeDown: "volume",
|
|
144
|
+
volumeMute: "volume-off",
|
|
145
|
+
volumeOff: "volume-off",
|
|
146
|
+
volumeUp: "volume",
|
|
147
|
+
warning: "warning"
|
|
148
|
+
};
|
|
149
|
+
/** Built-in functions. The basic catalog's set, plus `now`. */
|
|
150
|
+
var catalogFunctions = [
|
|
151
|
+
{
|
|
152
|
+
name: "required",
|
|
153
|
+
origin: "basic",
|
|
154
|
+
description: "True when the value is not null, undefined, or empty.",
|
|
155
|
+
returns: "boolean",
|
|
156
|
+
args: { value: ref("DynamicValue", "The value to check.") },
|
|
157
|
+
required: ["value"]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "regex",
|
|
161
|
+
origin: "basic",
|
|
162
|
+
description: "True when the value matches a regular expression.",
|
|
163
|
+
returns: "boolean",
|
|
164
|
+
args: {
|
|
165
|
+
value: text("The text to test."),
|
|
166
|
+
pattern: {
|
|
167
|
+
type: "string",
|
|
168
|
+
format: "regex",
|
|
169
|
+
maxLength: 200,
|
|
170
|
+
description: "The regular expression. Keep it simple: repeated groups that repeat or alternate inside, like \"(a+)+\", and backreferences are refused."
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
required: ["value", "pattern"]
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "length",
|
|
177
|
+
origin: "basic",
|
|
178
|
+
description: "True when the text length is within min and max.",
|
|
179
|
+
returns: "boolean",
|
|
180
|
+
args: {
|
|
181
|
+
value: text("The text to measure."),
|
|
182
|
+
min: {
|
|
183
|
+
type: "integer",
|
|
184
|
+
minimum: 0,
|
|
185
|
+
description: "Shortest allowed."
|
|
186
|
+
},
|
|
187
|
+
max: {
|
|
188
|
+
type: "integer",
|
|
189
|
+
minimum: 0,
|
|
190
|
+
description: "Longest allowed."
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
required: ["value"]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
name: "numeric",
|
|
197
|
+
origin: "basic",
|
|
198
|
+
description: "True when the number is within min and max.",
|
|
199
|
+
returns: "boolean",
|
|
200
|
+
args: {
|
|
201
|
+
value: number("The number to check."),
|
|
202
|
+
min: {
|
|
203
|
+
type: "number",
|
|
204
|
+
description: "Smallest allowed."
|
|
205
|
+
},
|
|
206
|
+
max: {
|
|
207
|
+
type: "number",
|
|
208
|
+
description: "Largest allowed."
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
required: ["value"]
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: "email",
|
|
215
|
+
origin: "basic",
|
|
216
|
+
description: "True when the value looks like an email address.",
|
|
217
|
+
returns: "boolean",
|
|
218
|
+
args: { value: text("The text to check.") },
|
|
219
|
+
required: ["value"]
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "formatString",
|
|
223
|
+
origin: "basic",
|
|
224
|
+
description: "Fills ${/absolute/path}, ${relative/path}, and ${fn(name: value)} expressions in the text. Escape a literal ${ as \\${.",
|
|
225
|
+
returns: "string",
|
|
226
|
+
args: { value: text("The template text.") },
|
|
227
|
+
required: ["value"]
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: "formatNumber",
|
|
231
|
+
origin: "basic",
|
|
232
|
+
description: "Formats a number with grouping and fixed decimals.",
|
|
233
|
+
returns: "string",
|
|
234
|
+
args: {
|
|
235
|
+
value: number("The number."),
|
|
236
|
+
decimals: number("Decimal places."),
|
|
237
|
+
grouping: bool("Use thousands separators. Defaults to true.")
|
|
238
|
+
},
|
|
239
|
+
required: ["value"]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "formatCurrency",
|
|
243
|
+
origin: "basic",
|
|
244
|
+
description: "Formats a number as money.",
|
|
245
|
+
returns: "string",
|
|
246
|
+
args: {
|
|
247
|
+
value: number("The amount."),
|
|
248
|
+
currency: text("ISO 4217 code, like \"USD\"."),
|
|
249
|
+
decimals: number("Decimal places."),
|
|
250
|
+
grouping: bool("Use thousands separators. Defaults to true.")
|
|
251
|
+
},
|
|
252
|
+
required: ["value", "currency"]
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
name: "formatDate",
|
|
256
|
+
origin: "basic",
|
|
257
|
+
description: "Formats a date with a Unicode pattern: yyyy, yy, MMMM, MMM, MM, M, dd, d, EEEE, E, HH, H, hh, h, mm, ss, a, and 'quoted' literals.",
|
|
258
|
+
returns: "string",
|
|
259
|
+
args: {
|
|
260
|
+
value: ref("DynamicValue", "An ISO 8601 date or a timestamp."),
|
|
261
|
+
format: text("The pattern, like \"MMM d, yyyy\".")
|
|
262
|
+
},
|
|
263
|
+
required: ["value", "format"]
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
name: "pluralize",
|
|
267
|
+
origin: "basic",
|
|
268
|
+
description: "Picks text by the plural category of a count. For English, give one and other.",
|
|
269
|
+
returns: "string",
|
|
270
|
+
args: {
|
|
271
|
+
value: number("The count."),
|
|
272
|
+
zero: text("Text for zero."),
|
|
273
|
+
one: text("Text for one."),
|
|
274
|
+
two: text("Text for two."),
|
|
275
|
+
few: text("Text for few."),
|
|
276
|
+
many: text("Text for many."),
|
|
277
|
+
other: text("Text for everything else.")
|
|
278
|
+
},
|
|
279
|
+
required: ["value", "other"]
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: "openUrl",
|
|
283
|
+
origin: "basic",
|
|
284
|
+
description: "Opens a URL. Use it as a Button action.",
|
|
285
|
+
returns: "void",
|
|
286
|
+
args: { url: ref("Href", "A site path or an https URL.") },
|
|
287
|
+
required: ["url"]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
name: "and",
|
|
291
|
+
origin: "basic",
|
|
292
|
+
description: "True when every value is true.",
|
|
293
|
+
returns: "boolean",
|
|
294
|
+
args: { values: list(ref("DynamicBoolean"), "Two or more values.", 20, 2) },
|
|
295
|
+
required: ["values"]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
name: "or",
|
|
299
|
+
origin: "basic",
|
|
300
|
+
description: "True when any value is true.",
|
|
301
|
+
returns: "boolean",
|
|
302
|
+
args: { values: list(ref("DynamicBoolean"), "Two or more values.", 20, 2) },
|
|
303
|
+
required: ["values"]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
name: "not",
|
|
307
|
+
origin: "basic",
|
|
308
|
+
description: "Negates a value.",
|
|
309
|
+
returns: "boolean",
|
|
310
|
+
args: { value: bool("The value to negate.") },
|
|
311
|
+
required: ["value"]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: "now",
|
|
315
|
+
origin: "derelicious",
|
|
316
|
+
description: "The current date and time as an ISO 8601 string.",
|
|
317
|
+
returns: "string",
|
|
318
|
+
args: {}
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: "showToast",
|
|
322
|
+
origin: "derelicious",
|
|
323
|
+
description: "Shows a short message in a toast, like \"Saved.\" Use it as a button action: {\"functionCall\": {\"call\": \"showToast\", \"args\": {\"message\": \"Saved.\"}}}.",
|
|
324
|
+
returns: "void",
|
|
325
|
+
args: {
|
|
326
|
+
message: text("One short sentence."),
|
|
327
|
+
tone: choice([
|
|
328
|
+
"info",
|
|
329
|
+
"positive",
|
|
330
|
+
"warning",
|
|
331
|
+
"danger"
|
|
332
|
+
], "Meaning and color.", "info"),
|
|
333
|
+
action: object({
|
|
334
|
+
label: {
|
|
335
|
+
type: "string",
|
|
336
|
+
minLength: 1,
|
|
337
|
+
maxLength: 40,
|
|
338
|
+
description: "Button text, like \"Undo\"."
|
|
339
|
+
},
|
|
340
|
+
event: {
|
|
341
|
+
type: "object",
|
|
342
|
+
description: "The event the button sends, like a Button action event.",
|
|
343
|
+
properties: {
|
|
344
|
+
name: {
|
|
345
|
+
type: "string",
|
|
346
|
+
minLength: 1,
|
|
347
|
+
maxLength: 100
|
|
348
|
+
},
|
|
349
|
+
context: {
|
|
350
|
+
type: "object",
|
|
351
|
+
additionalProperties: { $ref: "#/$defs/DynamicValue" }
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
required: ["name"],
|
|
355
|
+
additionalProperties: false
|
|
356
|
+
}
|
|
357
|
+
}, ["label", "event"])
|
|
358
|
+
},
|
|
359
|
+
required: ["message"]
|
|
360
|
+
}
|
|
361
|
+
];
|
|
362
|
+
var tabItem = object({
|
|
363
|
+
title: text("The tab label."),
|
|
364
|
+
child: id("The component shown when the tab is selected.")
|
|
365
|
+
}, ["title", "child"]);
|
|
366
|
+
var option = object({
|
|
367
|
+
label: text("What the person sees."),
|
|
368
|
+
value: {
|
|
369
|
+
type: "string",
|
|
370
|
+
description: "The stable value stored."
|
|
371
|
+
}
|
|
372
|
+
}, ["label", "value"]);
|
|
373
|
+
var placement = choice([
|
|
374
|
+
"bottom",
|
|
375
|
+
"top",
|
|
376
|
+
"start",
|
|
377
|
+
"end"
|
|
378
|
+
], "Which side of the trigger it opens on. It flips when there is no room.", "bottom");
|
|
379
|
+
var align = choice([
|
|
380
|
+
"start",
|
|
381
|
+
"center",
|
|
382
|
+
"end"
|
|
383
|
+
], "How it lines up with the trigger along that side.", "start");
|
|
384
|
+
var cssLength = (description) => ({
|
|
385
|
+
type: "string",
|
|
386
|
+
pattern: "^\\d+(\\.\\d+)?(rem|em|ch|px|%)$",
|
|
387
|
+
maxLength: 12,
|
|
388
|
+
description
|
|
389
|
+
});
|
|
390
|
+
var navLink = object({
|
|
391
|
+
label: {
|
|
392
|
+
type: "string",
|
|
393
|
+
description: "Link text."
|
|
394
|
+
},
|
|
395
|
+
href: ref("Href", "Where it goes."),
|
|
396
|
+
current: flag("The page the person is on.")
|
|
397
|
+
}, ["label", "href"]);
|
|
398
|
+
var catalogComponents = [
|
|
399
|
+
{
|
|
400
|
+
type: "Text",
|
|
401
|
+
origin: "basic",
|
|
402
|
+
renders: ["Text", "Heading"],
|
|
403
|
+
description: "Body text, a caption, a small label, or a heading. The text supports simple Markdown: **bold**, *italic*, `code`, and lines that start with \"- \".",
|
|
404
|
+
props: {
|
|
405
|
+
text: text("The text to show."),
|
|
406
|
+
variant: choice([
|
|
407
|
+
"h1",
|
|
408
|
+
"h2",
|
|
409
|
+
"h3",
|
|
410
|
+
"h4",
|
|
411
|
+
"h5",
|
|
412
|
+
"caption",
|
|
413
|
+
"body",
|
|
414
|
+
"lede",
|
|
415
|
+
"eyebrow"
|
|
416
|
+
], "h1 to h5 are headings; levels are relative to where the surface sits. caption is small muted text. lede is a larger intro line and eyebrow a small uppercase label (Derelicious additions).", "body"),
|
|
417
|
+
tone: choice(textTones, "Text color. Derelicious extension.")
|
|
418
|
+
},
|
|
419
|
+
required: ["text"],
|
|
420
|
+
usage: ["Use one heading per surface or per card, then body text.", "Keep body text to one or two short sentences. Put longer explanations in the chat reply, not the surface."]
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
type: "Image",
|
|
424
|
+
origin: "basic",
|
|
425
|
+
renders: ["Image"],
|
|
426
|
+
description: "An image with alt text, framed to a size variant.",
|
|
427
|
+
props: {
|
|
428
|
+
url: ref("DynamicImageUrl", "A site path or an https URL."),
|
|
429
|
+
description: text("Alt text: what the image shows. Leave empty only for decoration."),
|
|
430
|
+
fit: choice([
|
|
431
|
+
"contain",
|
|
432
|
+
"cover",
|
|
433
|
+
"fill",
|
|
434
|
+
"none",
|
|
435
|
+
"scaleDown"
|
|
436
|
+
], "How the image fills its frame, like CSS object-fit.", "fill"),
|
|
437
|
+
variant: choice([
|
|
438
|
+
"icon",
|
|
439
|
+
"avatar",
|
|
440
|
+
"smallFeature",
|
|
441
|
+
"mediumFeature",
|
|
442
|
+
"largeFeature",
|
|
443
|
+
"header"
|
|
444
|
+
], "Size and shape: icon is tiny, avatar is a circle, header is a wide banner.", "mediumFeature")
|
|
445
|
+
},
|
|
446
|
+
required: ["url"],
|
|
447
|
+
usage: ["Only use image URLs you were given. Never invent one."]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
type: "Icon",
|
|
451
|
+
origin: "basic",
|
|
452
|
+
renders: ["Icon"],
|
|
453
|
+
description: "A small outline icon. Takes a Derelicious icon name like \"check\" or \"arrow-right\", a basic-catalog name like \"calendarToday\", or {\"svgPath\": \"...\"}.",
|
|
454
|
+
props: { name: ref("IconName", "Which icon.") },
|
|
455
|
+
required: ["name"],
|
|
456
|
+
usage: ["Icons are decorative unless accessibility.label is set. Pair them with text."]
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
type: "Video",
|
|
460
|
+
origin: "basic",
|
|
461
|
+
status: "fallback",
|
|
462
|
+
renders: ["Link"],
|
|
463
|
+
description: "A video. Derelicious has no player, so this renders a link to the file.",
|
|
464
|
+
props: { url: ref("DynamicImageUrl", "An https URL to the video.") },
|
|
465
|
+
required: ["url"],
|
|
466
|
+
usage: ["Avoid. Use a Link to the page that hosts the video."]
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
type: "AudioPlayer",
|
|
470
|
+
origin: "basic",
|
|
471
|
+
status: "fallback",
|
|
472
|
+
renders: ["Link"],
|
|
473
|
+
description: "Audio. Derelicious has no player, so this renders a link to the file.",
|
|
474
|
+
props: {
|
|
475
|
+
url: ref("DynamicImageUrl", "An https URL to the audio."),
|
|
476
|
+
description: text("A title or summary.")
|
|
477
|
+
},
|
|
478
|
+
required: ["url"],
|
|
479
|
+
usage: ["Avoid. Use a Link to the page that hosts the audio."]
|
|
480
|
+
},
|
|
481
|
+
{
|
|
482
|
+
type: "Row",
|
|
483
|
+
origin: "basic",
|
|
484
|
+
renders: ["Inline"],
|
|
485
|
+
description: "Children side by side. Rows wrap onto new lines when space runs out, so they work on phones.",
|
|
486
|
+
props: {
|
|
487
|
+
children: children("The components in the row."),
|
|
488
|
+
justify: choice([
|
|
489
|
+
"center",
|
|
490
|
+
"end",
|
|
491
|
+
"spaceAround",
|
|
492
|
+
"spaceBetween",
|
|
493
|
+
"spaceEvenly",
|
|
494
|
+
"start",
|
|
495
|
+
"stretch"
|
|
496
|
+
], "Horizontal distribution. spaceBetween pushes the first and last child apart.", "start"),
|
|
497
|
+
align: choice([
|
|
498
|
+
"start",
|
|
499
|
+
"center",
|
|
500
|
+
"end",
|
|
501
|
+
"stretch"
|
|
502
|
+
], "Vertical alignment of children.", "stretch"),
|
|
503
|
+
gap: gap(3),
|
|
504
|
+
wrap: flag("Wrap onto new lines when space runs out. Derelicious extension.", true)
|
|
505
|
+
},
|
|
506
|
+
required: ["children"],
|
|
507
|
+
usage: [
|
|
508
|
+
"Use a Row for a few small things: tags, badges, buttons, or an icon and its label.",
|
|
509
|
+
"For equal columns of cards or stats, use Grid instead.",
|
|
510
|
+
"Set weight on a child to let it take the remaining space."
|
|
511
|
+
]
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
type: "Column",
|
|
515
|
+
origin: "basic",
|
|
516
|
+
renders: ["Stack"],
|
|
517
|
+
description: "Children stacked vertically with even space between them.",
|
|
518
|
+
props: {
|
|
519
|
+
children: children("The components in the column."),
|
|
520
|
+
justify: choice([
|
|
521
|
+
"start",
|
|
522
|
+
"center",
|
|
523
|
+
"end",
|
|
524
|
+
"spaceBetween",
|
|
525
|
+
"spaceAround",
|
|
526
|
+
"spaceEvenly",
|
|
527
|
+
"stretch"
|
|
528
|
+
], "Vertical distribution when the column is taller than its children.", "start"),
|
|
529
|
+
align: choice([
|
|
530
|
+
"center",
|
|
531
|
+
"end",
|
|
532
|
+
"start",
|
|
533
|
+
"stretch"
|
|
534
|
+
], "Horizontal alignment of children.", "stretch"),
|
|
535
|
+
gap: gap(3)
|
|
536
|
+
},
|
|
537
|
+
required: ["children"],
|
|
538
|
+
usage: ["The usual root: a Column holding the parts of the answer."]
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
type: "List",
|
|
542
|
+
origin: "basic",
|
|
543
|
+
renders: ["List", "Inline"],
|
|
544
|
+
description: "A list of components, usually built from a template over data.",
|
|
545
|
+
props: {
|
|
546
|
+
children: children("The list items."),
|
|
547
|
+
direction: choice(["vertical", "horizontal"], "Stack items or lay them in a row.", "vertical"),
|
|
548
|
+
align: choice([
|
|
549
|
+
"start",
|
|
550
|
+
"center",
|
|
551
|
+
"end",
|
|
552
|
+
"stretch"
|
|
553
|
+
], "Cross-axis alignment.", "stretch"),
|
|
554
|
+
marker: choice([
|
|
555
|
+
"none",
|
|
556
|
+
"bullet",
|
|
557
|
+
"number",
|
|
558
|
+
"check"
|
|
559
|
+
], "Item markers for vertical lists. Derelicious extension.", "none"),
|
|
560
|
+
gap: gap(2)
|
|
561
|
+
},
|
|
562
|
+
required: ["children"],
|
|
563
|
+
usage: ["Use a template child list for repeated items: {\"path\": \"/items\", \"componentId\": \"item\"}."]
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
type: "Card",
|
|
567
|
+
origin: "basic",
|
|
568
|
+
renders: ["Card"],
|
|
569
|
+
description: "A bordered surface that groups related content. Derelicious adds a title, an eyebrow, and href, which makes the whole card a link.",
|
|
570
|
+
props: {
|
|
571
|
+
child: id("The one component inside. Use a Column for several."),
|
|
572
|
+
title: text("Card heading. Derelicious extension."),
|
|
573
|
+
eyebrow: text("Small label above the title. Derelicious extension."),
|
|
574
|
+
href: ref("DynamicHref", "Make the card a link. Needs a title, which becomes the link text. Derelicious extension."),
|
|
575
|
+
variant: choice([
|
|
576
|
+
"outlined",
|
|
577
|
+
"filled",
|
|
578
|
+
"elevated"
|
|
579
|
+
], "outlined has a border, filled a muted fill, elevated a shadow. Derelicious extension.", "outlined")
|
|
580
|
+
},
|
|
581
|
+
required: ["child"],
|
|
582
|
+
usage: ["Give each card a title and put the details in its child Column.", "A card that links to a page should set href and title instead of holding a separate Link."]
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
type: "Tabs",
|
|
586
|
+
origin: "basic",
|
|
587
|
+
renders: ["Tabs"],
|
|
588
|
+
description: "Related views that share one space. One tab shows at a time.",
|
|
589
|
+
props: {
|
|
590
|
+
tabs: list(tabItem, "The tabs, in order.", 8, 1),
|
|
591
|
+
label: {
|
|
592
|
+
type: "string",
|
|
593
|
+
description: "Names the tab list for screen readers. Derelicious extension."
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
required: ["tabs"],
|
|
597
|
+
usage: ["Use two to five short tab titles."]
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
type: "Modal",
|
|
601
|
+
origin: "basic",
|
|
602
|
+
renders: ["Dialog"],
|
|
603
|
+
description: "A dialog that opens when its trigger is pressed. The trigger is usually a Button.",
|
|
604
|
+
props: {
|
|
605
|
+
trigger: id("The component that opens the dialog, usually a Button."),
|
|
606
|
+
content: id("The component shown inside the dialog."),
|
|
607
|
+
title: text("Dialog heading. Derelicious extension.")
|
|
608
|
+
},
|
|
609
|
+
required: ["trigger", "content"],
|
|
610
|
+
usage: ["Give it a title. Keep dialog content short."]
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
type: "Divider",
|
|
614
|
+
origin: "basic",
|
|
615
|
+
renders: ["Divider"],
|
|
616
|
+
description: "A thin rule between groups of content.",
|
|
617
|
+
props: {
|
|
618
|
+
axis: choice(["horizontal", "vertical"], "Orientation.", "horizontal"),
|
|
619
|
+
label: {
|
|
620
|
+
type: "string",
|
|
621
|
+
description: "Short text in the middle. Derelicious extension."
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
usage: ["Use sparingly. Space usually separates groups well enough."]
|
|
625
|
+
},
|
|
626
|
+
{
|
|
627
|
+
type: "Button",
|
|
628
|
+
origin: "basic",
|
|
629
|
+
renders: ["Button", "IconButton"],
|
|
630
|
+
description: "Does something when pressed: sends an event, opens a URL, or, with href, navigates.",
|
|
631
|
+
props: {
|
|
632
|
+
child: id("A Text for the label, or an Icon for an icon-only button (then set accessibility.label)."),
|
|
633
|
+
variant: choice([
|
|
634
|
+
"default",
|
|
635
|
+
"primary",
|
|
636
|
+
"borderless"
|
|
637
|
+
], "primary is the main action. borderless looks like a link.", "default"),
|
|
638
|
+
action: ref("Action", "What pressing it does."),
|
|
639
|
+
checks: ref("Checks", "Conditions that must all be true for the button to be enabled."),
|
|
640
|
+
href: ref("DynamicHref", "Make the button a link to this site path or URL. Derelicious extension."),
|
|
641
|
+
icon: ref("DsIconName", "Icon before the label. Derelicious extension."),
|
|
642
|
+
loading: bool("While true, shows a spinner and ignores presses, like after a form is sent. Bind it to a path. Derelicious extension.")
|
|
643
|
+
},
|
|
644
|
+
required: ["child"],
|
|
645
|
+
requireOneOf: [["action", "href"]],
|
|
646
|
+
usage: [
|
|
647
|
+
"Needs an action or an href.",
|
|
648
|
+
"One primary button per surface.",
|
|
649
|
+
"Use href for navigation, and an event action for anything the app should handle."
|
|
650
|
+
]
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
type: "TextField",
|
|
654
|
+
origin: "basic",
|
|
655
|
+
renders: ["TextField", "TextArea"],
|
|
656
|
+
description: "A labeled text input. Bind value to the data model to read what was typed.",
|
|
657
|
+
props: {
|
|
658
|
+
label: text("Visible label. Placeholders are not labels."),
|
|
659
|
+
value: text("The value. Bind it, like {\"path\": \"/form/name\"}."),
|
|
660
|
+
variant: choice([
|
|
661
|
+
"longText",
|
|
662
|
+
"number",
|
|
663
|
+
"shortText",
|
|
664
|
+
"obscured"
|
|
665
|
+
], "longText is a multi-line area. obscured hides the text, for passwords.", "shortText"),
|
|
666
|
+
validationRegexp: {
|
|
667
|
+
type: "string",
|
|
668
|
+
format: "regex",
|
|
669
|
+
maxLength: 200,
|
|
670
|
+
description: "A regular expression the value must match. Repeated groups that repeat or alternate inside, like \"(a+)+\", are refused."
|
|
671
|
+
},
|
|
672
|
+
checks: ref("Checks", "Rules with messages shown when they fail."),
|
|
673
|
+
hint: text("Help text under the label. Derelicious extension.")
|
|
674
|
+
},
|
|
675
|
+
required: ["label"],
|
|
676
|
+
usage: ["Always bind value to a path so the input keeps what was typed."]
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
type: "CheckBox",
|
|
680
|
+
origin: "basic",
|
|
681
|
+
renders: ["Checkbox"],
|
|
682
|
+
description: "A labeled checkbox for one yes or no choice.",
|
|
683
|
+
props: {
|
|
684
|
+
label: text("The label."),
|
|
685
|
+
value: bool("Checked state. Bind it to a path."),
|
|
686
|
+
checks: ref("Checks", "Rules with messages shown when they fail.")
|
|
687
|
+
},
|
|
688
|
+
required: ["label", "value"],
|
|
689
|
+
usage: ["For an instant on/off setting, use Switch instead."]
|
|
690
|
+
},
|
|
691
|
+
{
|
|
692
|
+
type: "ChoicePicker",
|
|
693
|
+
origin: "basic",
|
|
694
|
+
renders: ["RadioGroup", "Checkbox"],
|
|
695
|
+
description: "Pick one option (radio buttons) or several (checkboxes) from a short list.",
|
|
696
|
+
props: {
|
|
697
|
+
label: text("The question, shown as the legend."),
|
|
698
|
+
variant: choice(["multipleSelection", "mutuallyExclusive"], "Allow several choices, or exactly one.", "mutuallyExclusive"),
|
|
699
|
+
options: list(option, "The choices.", 30, 1),
|
|
700
|
+
value: ref("DynamicStringList", "Selected values. Bind it to a string array."),
|
|
701
|
+
displayStyle: choice(["checkbox", "chips"], "chips lays the options in a row.", "checkbox"),
|
|
702
|
+
filterable: flag("Show a filter field above long lists."),
|
|
703
|
+
checks: ref("Checks", "Rules with messages shown when they fail.")
|
|
704
|
+
},
|
|
705
|
+
required: ["options", "value"],
|
|
706
|
+
usage: ["For more than about seven single choices, use Select."]
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
type: "Slider",
|
|
710
|
+
origin: "basic",
|
|
711
|
+
renders: [],
|
|
712
|
+
description: "Pick a number in a range by dragging. Renders a native range input with a label and the current value.",
|
|
713
|
+
props: {
|
|
714
|
+
label: text("The label."),
|
|
715
|
+
min: {
|
|
716
|
+
type: "number",
|
|
717
|
+
description: "Smallest value.",
|
|
718
|
+
default: 0
|
|
719
|
+
},
|
|
720
|
+
max: {
|
|
721
|
+
type: "number",
|
|
722
|
+
description: "Largest value."
|
|
723
|
+
},
|
|
724
|
+
step: {
|
|
725
|
+
type: "number",
|
|
726
|
+
description: "Step between values. Derelicious extension."
|
|
727
|
+
},
|
|
728
|
+
value: number("The value. Bind it to a path."),
|
|
729
|
+
checks: ref("Checks", "Rules with messages shown when they fail.")
|
|
730
|
+
},
|
|
731
|
+
required: ["value", "max"],
|
|
732
|
+
usage: ["Always set a label."]
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
type: "DateTimeInput",
|
|
736
|
+
origin: "basic",
|
|
737
|
+
renders: ["TextField"],
|
|
738
|
+
description: "A labeled date, time, or date and time input.",
|
|
739
|
+
props: {
|
|
740
|
+
value: text("ISO 8601 value. Bind it to a path."),
|
|
741
|
+
enableDate: flag("Let people pick a date."),
|
|
742
|
+
enableTime: flag("Let people pick a time."),
|
|
743
|
+
min: text("Earliest allowed, ISO 8601."),
|
|
744
|
+
max: text("Latest allowed, ISO 8601."),
|
|
745
|
+
label: text("The label."),
|
|
746
|
+
checks: ref("Checks", "Rules with messages shown when they fail.")
|
|
747
|
+
},
|
|
748
|
+
required: ["value"],
|
|
749
|
+
usage: ["Set enableDate, enableTime, or both."]
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
type: "Heading",
|
|
753
|
+
origin: "derelicious",
|
|
754
|
+
renders: ["Heading"],
|
|
755
|
+
description: "A title in the display face.",
|
|
756
|
+
props: {
|
|
757
|
+
text: text("The heading text."),
|
|
758
|
+
level: choice([
|
|
759
|
+
1,
|
|
760
|
+
2,
|
|
761
|
+
3,
|
|
762
|
+
4
|
|
763
|
+
], "Outline level relative to where the surface sits. 1 is the top level of the surface.", 1),
|
|
764
|
+
size: choice([
|
|
765
|
+
"display",
|
|
766
|
+
"3xl",
|
|
767
|
+
"2xl",
|
|
768
|
+
"xl",
|
|
769
|
+
"lg",
|
|
770
|
+
"md"
|
|
771
|
+
], "Visual size. Defaults follow the level."),
|
|
772
|
+
tone: choice(["default", "accent"], "accent colors the heading.")
|
|
773
|
+
},
|
|
774
|
+
required: ["text"],
|
|
775
|
+
usage: ["Never skip levels."]
|
|
776
|
+
},
|
|
777
|
+
{
|
|
778
|
+
type: "Stat",
|
|
779
|
+
origin: "derelicious",
|
|
780
|
+
renders: ["Stat"],
|
|
781
|
+
description: "One headline number with a label and an optional change.",
|
|
782
|
+
props: {
|
|
783
|
+
label: text("What is measured."),
|
|
784
|
+
value: text("The formatted number, like \"50%\" or \"5% → 50%\"."),
|
|
785
|
+
delta: text("Change, like \"+12%\"."),
|
|
786
|
+
trend: choice([
|
|
787
|
+
"up",
|
|
788
|
+
"down",
|
|
789
|
+
"flat"
|
|
790
|
+
], "Direction of the change."),
|
|
791
|
+
tone: choice([
|
|
792
|
+
"positive",
|
|
793
|
+
"danger",
|
|
794
|
+
"neutral"
|
|
795
|
+
], "Whether the change is good."),
|
|
796
|
+
description: text("A short note, like the time frame."),
|
|
797
|
+
variant: choice(["card", "plain"], "card is a bordered tile.", "card")
|
|
798
|
+
},
|
|
799
|
+
required: ["label", "value"],
|
|
800
|
+
usage: ["Put two to four Stats in a Grid with min \"10rem\".", "Copy numbers exactly as given. Never round or invent them."]
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
type: "Badge",
|
|
804
|
+
origin: "derelicious",
|
|
805
|
+
renders: ["Badge"],
|
|
806
|
+
description: "A short status label.",
|
|
807
|
+
props: {
|
|
808
|
+
text: text("One or two words."),
|
|
809
|
+
tone: choice(statusTones, "Meaning and color.", "neutral"),
|
|
810
|
+
variant: choice(["soft", "outline"], "Fill style.", "soft"),
|
|
811
|
+
dot: flag("Status dot before the label."),
|
|
812
|
+
icon: ref("DsIconName", "Icon before the label.")
|
|
813
|
+
},
|
|
814
|
+
required: ["text"],
|
|
815
|
+
usage: ["Use for status, like \"Current\" or \"Beta\". Use Tag for keywords."]
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
type: "Tag",
|
|
819
|
+
origin: "derelicious",
|
|
820
|
+
renders: ["Tag"],
|
|
821
|
+
description: "A keyword chip, optionally a link.",
|
|
822
|
+
props: {
|
|
823
|
+
text: text("The keyword."),
|
|
824
|
+
href: ref("DynamicHref", "Make the tag a link.")
|
|
825
|
+
},
|
|
826
|
+
required: ["text"],
|
|
827
|
+
usage: ["Group tags in a Row with gap 2."]
|
|
828
|
+
},
|
|
829
|
+
{
|
|
830
|
+
type: "Avatar",
|
|
831
|
+
origin: "derelicious",
|
|
832
|
+
renders: ["Avatar"],
|
|
833
|
+
description: "A person's photo or initials in a circle.",
|
|
834
|
+
props: {
|
|
835
|
+
name: text("Full name. Initials come from it."),
|
|
836
|
+
src: ref("DynamicImageUrl", "Photo URL. Only use one you were given."),
|
|
837
|
+
size: choice([
|
|
838
|
+
"sm",
|
|
839
|
+
"md",
|
|
840
|
+
"lg",
|
|
841
|
+
"xl"
|
|
842
|
+
], "Size.", "md")
|
|
843
|
+
},
|
|
844
|
+
required: ["name"],
|
|
845
|
+
usage: ["Without a photo URL, the initials show."]
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
type: "Quote",
|
|
849
|
+
origin: "derelicious",
|
|
850
|
+
renders: ["Quote"],
|
|
851
|
+
description: "A pull quote with attribution.",
|
|
852
|
+
props: {
|
|
853
|
+
text: text("The quoted words, without quotation marks."),
|
|
854
|
+
attribution: text("Who said it."),
|
|
855
|
+
source: text("Their role, or where it was said.")
|
|
856
|
+
},
|
|
857
|
+
required: ["text"],
|
|
858
|
+
usage: ["Only quote words that appear in your sources."]
|
|
859
|
+
},
|
|
860
|
+
{
|
|
861
|
+
type: "Timeline",
|
|
862
|
+
origin: "derelicious",
|
|
863
|
+
renders: ["Timeline"],
|
|
864
|
+
description: "Events in order along a vertical rail, like a career.",
|
|
865
|
+
props: { items: {
|
|
866
|
+
title: "a list of {title, meta, description, current} or a binding",
|
|
867
|
+
description: "Events, newest first, or a {\"path\"} binding to a list.",
|
|
868
|
+
oneOf: [list(object({
|
|
869
|
+
title: text("The event, like a role and company."),
|
|
870
|
+
meta: text("When, like \"2021 – 2024\"."),
|
|
871
|
+
description: text("One sentence."),
|
|
872
|
+
current: flag("Marks the current item.")
|
|
873
|
+
}, ["title"]), "Events.", 30, 1), ref("DataBinding")]
|
|
874
|
+
} },
|
|
875
|
+
required: ["items"],
|
|
876
|
+
usage: ["Use for a career or a sequence of steps."]
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
type: "Table",
|
|
880
|
+
origin: "derelicious",
|
|
881
|
+
renders: ["Table"],
|
|
882
|
+
description: "A data table with a caption, columns, and rows.",
|
|
883
|
+
props: {
|
|
884
|
+
caption: text("Names the table."),
|
|
885
|
+
columns: list(object({
|
|
886
|
+
key: {
|
|
887
|
+
type: "string",
|
|
888
|
+
description: "The row field this column shows."
|
|
889
|
+
},
|
|
890
|
+
header: text("Column heading."),
|
|
891
|
+
align: choice([
|
|
892
|
+
"start",
|
|
893
|
+
"center",
|
|
894
|
+
"end"
|
|
895
|
+
], "Cell alignment.")
|
|
896
|
+
}, ["key", "header"]), "Columns, in order.", 8, 1),
|
|
897
|
+
rows: {
|
|
898
|
+
title: "a list of row objects or a binding",
|
|
899
|
+
description: "One object per row with a value for each column key, or a {\"path\"} binding to such a list.",
|
|
900
|
+
oneOf: [list({
|
|
901
|
+
type: "object",
|
|
902
|
+
additionalProperties: { type: [
|
|
903
|
+
"string",
|
|
904
|
+
"number",
|
|
905
|
+
"boolean",
|
|
906
|
+
"null"
|
|
907
|
+
] }
|
|
908
|
+
}, "Rows.", 50), ref("DataBinding")]
|
|
909
|
+
},
|
|
910
|
+
rowHeader: {
|
|
911
|
+
type: "string",
|
|
912
|
+
description: "Column key whose cells name each row."
|
|
913
|
+
},
|
|
914
|
+
density: choice(["comfortable", "compact"], "Cell padding.", "comfortable"),
|
|
915
|
+
striped: flag("Tint every other row."),
|
|
916
|
+
hideCaption: flag("Hide the caption visually.")
|
|
917
|
+
},
|
|
918
|
+
required: [
|
|
919
|
+
"caption",
|
|
920
|
+
"columns",
|
|
921
|
+
"rows"
|
|
922
|
+
],
|
|
923
|
+
usage: ["Keep it to four columns or fewer so it fits a phone.", "Use for comparisons. Use Stats or a List for a few values."]
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
type: "Alert",
|
|
927
|
+
origin: "derelicious",
|
|
928
|
+
renders: ["Alert"],
|
|
929
|
+
description: "A short message about a state, with a tone.",
|
|
930
|
+
props: {
|
|
931
|
+
tone: choice([
|
|
932
|
+
"info",
|
|
933
|
+
"positive",
|
|
934
|
+
"warning",
|
|
935
|
+
"danger"
|
|
936
|
+
], "Meaning, color, and icon.", "info"),
|
|
937
|
+
title: text("One line that says what happened."),
|
|
938
|
+
text: text("Details or next steps.")
|
|
939
|
+
},
|
|
940
|
+
usage: ["Set a title, a text, or both."],
|
|
941
|
+
requireOneOf: [["title", "text"]]
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
type: "Progress",
|
|
945
|
+
origin: "derelicious",
|
|
946
|
+
renders: ["Progress"],
|
|
947
|
+
description: "A labeled progress bar.",
|
|
948
|
+
props: {
|
|
949
|
+
label: text("What is in progress."),
|
|
950
|
+
value: number("Current value. Omit for indeterminate."),
|
|
951
|
+
max: {
|
|
952
|
+
type: "number",
|
|
953
|
+
description: "Value that means done.",
|
|
954
|
+
default: 100
|
|
955
|
+
},
|
|
956
|
+
tone: choice([
|
|
957
|
+
"accent",
|
|
958
|
+
"positive",
|
|
959
|
+
"warning",
|
|
960
|
+
"danger"
|
|
961
|
+
], "Bar color.", "accent"),
|
|
962
|
+
valueText: text("Spoken value, like \"3 of 5 steps\"."),
|
|
963
|
+
description: text("Detail under the bar."),
|
|
964
|
+
showValue: flag("Show the percentage.", true)
|
|
965
|
+
},
|
|
966
|
+
required: ["label"],
|
|
967
|
+
usage: ["Use for real progress toward a known total."]
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
type: "Link",
|
|
971
|
+
origin: "derelicious",
|
|
972
|
+
renders: ["Link"],
|
|
973
|
+
description: "A text link. Site paths navigate inside the site; https URLs open in a new tab.",
|
|
974
|
+
props: {
|
|
975
|
+
text: text("Link text that says where it goes."),
|
|
976
|
+
href: ref("DynamicHref", "A site path like \"/work/anvil2\" or an https URL."),
|
|
977
|
+
variant: choice(["inline", "standalone"], "standalone stands on its own line with an arrow.", "standalone"),
|
|
978
|
+
icon: ref("DsIconName", "Icon after the text.")
|
|
979
|
+
},
|
|
980
|
+
required: ["text", "href"],
|
|
981
|
+
usage: ["Only link to paths and URLs you were given."]
|
|
982
|
+
},
|
|
983
|
+
{
|
|
984
|
+
type: "Grid",
|
|
985
|
+
origin: "derelicious",
|
|
986
|
+
renders: ["Grid"],
|
|
987
|
+
description: "Equal columns that adapt to the width: as many as fit, then they wrap.",
|
|
988
|
+
props: {
|
|
989
|
+
children: children("The cells."),
|
|
990
|
+
min: choice([
|
|
991
|
+
"8rem",
|
|
992
|
+
"10rem",
|
|
993
|
+
"12rem",
|
|
994
|
+
"14rem",
|
|
995
|
+
"16rem",
|
|
996
|
+
"20rem"
|
|
997
|
+
], "Narrowest a column may get.", "16rem"),
|
|
998
|
+
maxColumns: {
|
|
999
|
+
type: "integer",
|
|
1000
|
+
minimum: 1,
|
|
1001
|
+
maximum: 6,
|
|
1002
|
+
description: "Most columns however wide it gets."
|
|
1003
|
+
},
|
|
1004
|
+
gap: gap(4)
|
|
1005
|
+
},
|
|
1006
|
+
required: ["children"],
|
|
1007
|
+
usage: ["Use for Stats (min \"10rem\") and Cards (min \"14rem\" or wider)."]
|
|
1008
|
+
},
|
|
1009
|
+
{
|
|
1010
|
+
type: "Accordion",
|
|
1011
|
+
origin: "derelicious",
|
|
1012
|
+
renders: ["Accordion"],
|
|
1013
|
+
description: "Sections that expand and collapse.",
|
|
1014
|
+
props: {
|
|
1015
|
+
items: list(object({
|
|
1016
|
+
title: text("The section title."),
|
|
1017
|
+
child: id("The component shown when open."),
|
|
1018
|
+
open: flag("Start open.")
|
|
1019
|
+
}, ["title", "child"]), "Sections, in order.", 12, 1),
|
|
1020
|
+
exclusive: flag("Only one section open at a time.")
|
|
1021
|
+
},
|
|
1022
|
+
required: ["items"],
|
|
1023
|
+
usage: ["Use for details people may skip."]
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
type: "CodeBlock",
|
|
1027
|
+
origin: "derelicious",
|
|
1028
|
+
renders: ["CodeBlock"],
|
|
1029
|
+
description: "A block of code with a copy button.",
|
|
1030
|
+
props: {
|
|
1031
|
+
code: text("The code, as plain text."),
|
|
1032
|
+
language: {
|
|
1033
|
+
type: "string",
|
|
1034
|
+
description: "Language label, like \"tsx\"."
|
|
1035
|
+
},
|
|
1036
|
+
title: {
|
|
1037
|
+
type: "string",
|
|
1038
|
+
description: "File name or caption."
|
|
1039
|
+
}
|
|
1040
|
+
},
|
|
1041
|
+
required: ["code"],
|
|
1042
|
+
usage: ["Keep it short."]
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
type: "Switch",
|
|
1046
|
+
origin: "derelicious",
|
|
1047
|
+
renders: ["Switch"],
|
|
1048
|
+
description: "An on/off setting that takes effect right away.",
|
|
1049
|
+
props: {
|
|
1050
|
+
label: text("What the switch turns on."),
|
|
1051
|
+
value: bool("On or off. Bind it to a path."),
|
|
1052
|
+
hint: text("Help text.")
|
|
1053
|
+
},
|
|
1054
|
+
required: ["label", "value"],
|
|
1055
|
+
usage: ["For a choice that is submitted later, use CheckBox."]
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
type: "Select",
|
|
1059
|
+
origin: "derelicious",
|
|
1060
|
+
renders: ["Select"],
|
|
1061
|
+
description: "A labeled dropdown for one choice from a longer list.",
|
|
1062
|
+
props: {
|
|
1063
|
+
label: text("Visible label."),
|
|
1064
|
+
options: list(option, "The choices.", 100, 1),
|
|
1065
|
+
value: text("Selected value. Bind it to a path."),
|
|
1066
|
+
placeholder: {
|
|
1067
|
+
type: "string",
|
|
1068
|
+
description: "Empty first option."
|
|
1069
|
+
},
|
|
1070
|
+
hint: text("Help text.")
|
|
1071
|
+
},
|
|
1072
|
+
required: ["label", "options"],
|
|
1073
|
+
usage: ["For two to five choices, use ChoicePicker."]
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
type: "IconButton",
|
|
1077
|
+
origin: "derelicious",
|
|
1078
|
+
renders: ["IconButton"],
|
|
1079
|
+
description: "A round button with only an icon and a required label.",
|
|
1080
|
+
props: {
|
|
1081
|
+
icon: ref("DsIconName", "The icon."),
|
|
1082
|
+
label: {
|
|
1083
|
+
type: "string",
|
|
1084
|
+
minLength: 1,
|
|
1085
|
+
description: "What it does."
|
|
1086
|
+
},
|
|
1087
|
+
action: ref("Action", "What pressing it does."),
|
|
1088
|
+
href: ref("DynamicHref", "Make it a link."),
|
|
1089
|
+
tone: choice([
|
|
1090
|
+
"neutral",
|
|
1091
|
+
"ghost",
|
|
1092
|
+
"primary",
|
|
1093
|
+
"danger"
|
|
1094
|
+
], "Style.", "neutral")
|
|
1095
|
+
},
|
|
1096
|
+
required: ["icon", "label"],
|
|
1097
|
+
requireOneOf: [["action", "href"]],
|
|
1098
|
+
usage: ["Use in a NavBar or toolbar. Needs an action or an href."]
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
type: "NavBar",
|
|
1102
|
+
origin: "derelicious",
|
|
1103
|
+
renders: ["NavBar"],
|
|
1104
|
+
description: "An app top bar with a brand, up to five links, and actions. It collapses to a menu when narrow.",
|
|
1105
|
+
props: {
|
|
1106
|
+
brand: {
|
|
1107
|
+
type: "string",
|
|
1108
|
+
minLength: 1,
|
|
1109
|
+
description: "Product name."
|
|
1110
|
+
},
|
|
1111
|
+
mark: {
|
|
1112
|
+
type: "string",
|
|
1113
|
+
maxLength: 3,
|
|
1114
|
+
description: "Short mark in an accent square, like \"DW\"."
|
|
1115
|
+
},
|
|
1116
|
+
links: list(navLink, "Primary destinations.", 5),
|
|
1117
|
+
actions: children("IconButtons on the right.")
|
|
1118
|
+
},
|
|
1119
|
+
required: ["brand"],
|
|
1120
|
+
usage: ["Use only as the first child of a full screen."]
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
type: "TabBar",
|
|
1124
|
+
origin: "derelicious",
|
|
1125
|
+
renders: ["TabBar"],
|
|
1126
|
+
description: "Bottom navigation for phone screens.",
|
|
1127
|
+
props: { items: list(object({
|
|
1128
|
+
label: {
|
|
1129
|
+
type: "string",
|
|
1130
|
+
description: "Link text."
|
|
1131
|
+
},
|
|
1132
|
+
href: ref("Href", "Where it goes."),
|
|
1133
|
+
icon: ref("DsIconName", "The icon."),
|
|
1134
|
+
current: flag("The screen the person is on.")
|
|
1135
|
+
}, [
|
|
1136
|
+
"label",
|
|
1137
|
+
"href",
|
|
1138
|
+
"icon"
|
|
1139
|
+
]), "Three to five destinations.", 5, 2) },
|
|
1140
|
+
required: ["items"],
|
|
1141
|
+
usage: ["Use only as the last child of a phone screen."]
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
type: "SideNav",
|
|
1145
|
+
origin: "derelicious",
|
|
1146
|
+
renders: ["SideNav"],
|
|
1147
|
+
description: "Vertical navigation grouped into titled sections.",
|
|
1148
|
+
props: {
|
|
1149
|
+
label: {
|
|
1150
|
+
type: "string",
|
|
1151
|
+
minLength: 1,
|
|
1152
|
+
description: "Names the navigation."
|
|
1153
|
+
},
|
|
1154
|
+
sections: list(object({
|
|
1155
|
+
title: {
|
|
1156
|
+
type: "string",
|
|
1157
|
+
description: "Section title."
|
|
1158
|
+
},
|
|
1159
|
+
items: list(navLink, "Links.", 12, 1)
|
|
1160
|
+
}, ["items"]), "Groups of links.", 8, 1)
|
|
1161
|
+
},
|
|
1162
|
+
required: ["label", "sections"],
|
|
1163
|
+
usage: ["Use for wide screens with many destinations."]
|
|
1164
|
+
},
|
|
1165
|
+
{
|
|
1166
|
+
type: "Breadcrumbs",
|
|
1167
|
+
origin: "derelicious",
|
|
1168
|
+
renders: ["Breadcrumbs"],
|
|
1169
|
+
description: "The path from the top of a site to the current page.",
|
|
1170
|
+
props: { items: list(object({
|
|
1171
|
+
label: {
|
|
1172
|
+
type: "string",
|
|
1173
|
+
description: "Page name."
|
|
1174
|
+
},
|
|
1175
|
+
href: ref("Href", "Link. Omit for the current page.")
|
|
1176
|
+
}, ["label"]), "Top level first; the last item is the current page.", 8, 1) },
|
|
1177
|
+
required: ["items"],
|
|
1178
|
+
usage: ["Use at the top of a page that sits inside a hierarchy."]
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
type: "Menu",
|
|
1182
|
+
origin: "derelicious",
|
|
1183
|
+
renders: [
|
|
1184
|
+
"Menu",
|
|
1185
|
+
"Button",
|
|
1186
|
+
"IconButton"
|
|
1187
|
+
],
|
|
1188
|
+
description: "A button that opens a short list of actions or links, like \"More\" on a row. Arrow keys move through the items.",
|
|
1189
|
+
props: {
|
|
1190
|
+
trigger: id("The Button or IconButton that opens the menu. Its own action is ignored."),
|
|
1191
|
+
label: {
|
|
1192
|
+
type: "string",
|
|
1193
|
+
maxLength: 80,
|
|
1194
|
+
description: "Names the menu. Defaults to the trigger text."
|
|
1195
|
+
},
|
|
1196
|
+
items: list(object({
|
|
1197
|
+
label: {
|
|
1198
|
+
type: "string",
|
|
1199
|
+
minLength: 1,
|
|
1200
|
+
maxLength: 60,
|
|
1201
|
+
description: "What the item does."
|
|
1202
|
+
},
|
|
1203
|
+
icon: ref("DsIconName", "Icon before the label."),
|
|
1204
|
+
tone: choice(["default", "danger"], "danger for destructive items.", "default"),
|
|
1205
|
+
disabled: flag("Shown but not available."),
|
|
1206
|
+
href: ref("Href", "Make the item a link."),
|
|
1207
|
+
action: ref("Action", "What choosing it does.")
|
|
1208
|
+
}, ["label"]), "The items, in order. Give each an action or an href.", 12, 1),
|
|
1209
|
+
placement,
|
|
1210
|
+
align
|
|
1211
|
+
},
|
|
1212
|
+
required: ["trigger", "items"],
|
|
1213
|
+
usage: ["Use for three to eight secondary actions. Put the main action on its own Button.", "Put destructive items last, with tone \"danger\"."]
|
|
1214
|
+
},
|
|
1215
|
+
{
|
|
1216
|
+
type: "Popover",
|
|
1217
|
+
origin: "derelicious",
|
|
1218
|
+
renders: [
|
|
1219
|
+
"Popover",
|
|
1220
|
+
"Button",
|
|
1221
|
+
"IconButton"
|
|
1222
|
+
],
|
|
1223
|
+
description: "A small panel that opens next to a button, for details or a short form that should not leave the page.",
|
|
1224
|
+
props: {
|
|
1225
|
+
trigger: id("The Button or IconButton that opens it. Its own action is ignored."),
|
|
1226
|
+
title: text("Panel heading."),
|
|
1227
|
+
label: {
|
|
1228
|
+
type: "string",
|
|
1229
|
+
maxLength: 80,
|
|
1230
|
+
description: "Names the panel when it has no title."
|
|
1231
|
+
},
|
|
1232
|
+
child: id("The component inside. Use a Column for several."),
|
|
1233
|
+
placement,
|
|
1234
|
+
align
|
|
1235
|
+
},
|
|
1236
|
+
required: ["trigger", "child"],
|
|
1237
|
+
usage: ["Keep the content short. Use Modal for anything that needs focus."]
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
type: "Tooltip",
|
|
1241
|
+
origin: "derelicious",
|
|
1242
|
+
renders: ["Tooltip"],
|
|
1243
|
+
description: "A short hint that shows when a button is hovered or focused, like what an icon button does.",
|
|
1244
|
+
props: {
|
|
1245
|
+
content: {
|
|
1246
|
+
type: "string",
|
|
1247
|
+
minLength: 1,
|
|
1248
|
+
maxLength: 160,
|
|
1249
|
+
description: "The hint, a few words."
|
|
1250
|
+
},
|
|
1251
|
+
child: id("The Button or IconButton it describes. Other types show without the hint."),
|
|
1252
|
+
placement
|
|
1253
|
+
},
|
|
1254
|
+
required: ["content", "child"],
|
|
1255
|
+
usage: ["Never put information only in a tooltip. Touch screens may not show it."]
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
type: "Spinner",
|
|
1259
|
+
origin: "derelicious",
|
|
1260
|
+
renders: ["Spinner"],
|
|
1261
|
+
description: "A small turning ring that says something is loading.",
|
|
1262
|
+
props: {
|
|
1263
|
+
label: text("What is loading, read by screen readers, like \"Loading invoices\"."),
|
|
1264
|
+
size: choice([
|
|
1265
|
+
"sm",
|
|
1266
|
+
"md",
|
|
1267
|
+
"lg"
|
|
1268
|
+
], "Size.", "md")
|
|
1269
|
+
},
|
|
1270
|
+
usage: ["Use for a wait of a few seconds. Use Progress when the total is known, and Skeleton where content will appear."]
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
type: "Skeleton",
|
|
1274
|
+
origin: "derelicious",
|
|
1275
|
+
renders: ["Skeleton"],
|
|
1276
|
+
description: "A gray placeholder in the shape of content that is still loading, so the layout does not jump.",
|
|
1277
|
+
props: {
|
|
1278
|
+
variant: choice([
|
|
1279
|
+
"text",
|
|
1280
|
+
"rect",
|
|
1281
|
+
"circle"
|
|
1282
|
+
], "Lines of text, a block, or a circle like an avatar.", "text"),
|
|
1283
|
+
lines: {
|
|
1284
|
+
type: "integer",
|
|
1285
|
+
minimum: 1,
|
|
1286
|
+
maximum: 12,
|
|
1287
|
+
description: "Lines, for text."
|
|
1288
|
+
},
|
|
1289
|
+
width: cssLength("Width, like \"12rem\" or \"60%\"."),
|
|
1290
|
+
height: cssLength("Height, for rect and circle, like \"8rem\".")
|
|
1291
|
+
},
|
|
1292
|
+
usage: ["Match the size of the content it stands in for."]
|
|
1293
|
+
}
|
|
1294
|
+
];
|
|
1295
|
+
/** Protocol rules, written for a model generating messages. */
|
|
1296
|
+
var protocolRules = [
|
|
1297
|
+
`Every message is one JSON object: {"version": "${A2UI_VERSION}"} plus exactly one of createSurface, updateComponents, updateDataModel, or deleteSurface.`,
|
|
1298
|
+
`Start a surface with createSurface: {"surfaceId": "...", "catalogId": "${catalogId}"}.`,
|
|
1299
|
+
"updateComponents sends a flat list of components. Each has a unique \"id\" and a \"component\" type from this catalog. Exactly one component has the id \"root\".",
|
|
1300
|
+
"Parents point at children by id, never by nesting objects: \"children\": [\"a\", \"b\"] for lists, and \"child\", \"trigger\", or \"content\" for one id.",
|
|
1301
|
+
"For repeated items, use a template child list: \"children\": {\"path\": \"/items\", \"componentId\": \"item\"}. The template renders once per item in the list at that path.",
|
|
1302
|
+
"Bind any dynamic value to the data model with {\"path\": \"/json/pointer\"}. Inside a template, a path without a leading slash, like {\"path\": \"title\"}, reads from the current item.",
|
|
1303
|
+
"updateDataModel sets data: {\"surfaceId\": \"...\", \"path\": \"/items\", \"value\": [...]}. Omit path to replace the whole model.",
|
|
1304
|
+
"Inputs bind their value to a path, and edits write back to it.",
|
|
1305
|
+
"Buttons act with \"action\": {\"event\": {\"name\": \"...\", \"context\": {...}}} or {\"functionCall\": {\"call\": \"openUrl\", \"args\": {\"url\": \"...\"}}}. Context values can be bindings.",
|
|
1306
|
+
"Use only the types and props in this catalog. Unknown types and props are rejected.",
|
|
1307
|
+
"Links and image URLs must be site paths like \"/work/anvil2\" or https URLs you were given.",
|
|
1308
|
+
"Components may arrive before their children. The client shows a placeholder until each one arrives."
|
|
1309
|
+
];
|
|
1310
|
+
var iconEnum = [.../* @__PURE__ */ new Set([...iconNames, ...Object.keys(basicIconMap)])];
|
|
1311
|
+
var hrefPattern = "^(?:/(?!/)\\S*|https://\\S+|mailto:\\S+|#[\\w-]*)$";
|
|
1312
|
+
var imagePattern = "^(?:/(?!/)\\S*|https://\\S+)$";
|
|
1313
|
+
/** Shared definitions, referenced from component props as `#/$defs/<name>`. */
|
|
1314
|
+
function catalogDefs() {
|
|
1315
|
+
return {
|
|
1316
|
+
ComponentId: {
|
|
1317
|
+
title: "a component id",
|
|
1318
|
+
type: "string",
|
|
1319
|
+
minLength: 1,
|
|
1320
|
+
maxLength: 100,
|
|
1321
|
+
description: "The id of another component in the same surface."
|
|
1322
|
+
},
|
|
1323
|
+
ChildList: {
|
|
1324
|
+
title: "a list of component ids or a template {\"path\": \"/list\", \"componentId\": \"id\"}",
|
|
1325
|
+
oneOf: [{
|
|
1326
|
+
type: "array",
|
|
1327
|
+
items: { $ref: "#/$defs/ComponentId" },
|
|
1328
|
+
maxItems: 60
|
|
1329
|
+
}, {
|
|
1330
|
+
type: "object",
|
|
1331
|
+
properties: {
|
|
1332
|
+
componentId: { $ref: "#/$defs/ComponentId" },
|
|
1333
|
+
path: {
|
|
1334
|
+
type: "string",
|
|
1335
|
+
description: "Path to a list in the data model."
|
|
1336
|
+
}
|
|
1337
|
+
},
|
|
1338
|
+
required: ["componentId", "path"],
|
|
1339
|
+
additionalProperties: false
|
|
1340
|
+
}]
|
|
1341
|
+
},
|
|
1342
|
+
DataBinding: {
|
|
1343
|
+
title: "a {\"path\": \"/json/pointer\"} binding",
|
|
1344
|
+
type: "object",
|
|
1345
|
+
properties: { path: {
|
|
1346
|
+
type: "string",
|
|
1347
|
+
maxLength: 300,
|
|
1348
|
+
description: "A JSON Pointer into the data model. Relative inside templates."
|
|
1349
|
+
} },
|
|
1350
|
+
required: ["path"],
|
|
1351
|
+
additionalProperties: false
|
|
1352
|
+
},
|
|
1353
|
+
FunctionCall: {
|
|
1354
|
+
title: "a function call {\"call\", \"args\"}",
|
|
1355
|
+
type: "object",
|
|
1356
|
+
properties: {
|
|
1357
|
+
call: {
|
|
1358
|
+
type: "string",
|
|
1359
|
+
enum: catalogFunctions.map((fn) => fn.name),
|
|
1360
|
+
description: "The function name."
|
|
1361
|
+
},
|
|
1362
|
+
args: {
|
|
1363
|
+
type: "object",
|
|
1364
|
+
description: "Named arguments."
|
|
1365
|
+
},
|
|
1366
|
+
returnType: {
|
|
1367
|
+
type: "string",
|
|
1368
|
+
enum: [
|
|
1369
|
+
"string",
|
|
1370
|
+
"number",
|
|
1371
|
+
"boolean",
|
|
1372
|
+
"array",
|
|
1373
|
+
"object",
|
|
1374
|
+
"any",
|
|
1375
|
+
"void"
|
|
1376
|
+
],
|
|
1377
|
+
description: "The expected return type."
|
|
1378
|
+
}
|
|
1379
|
+
},
|
|
1380
|
+
required: ["call"],
|
|
1381
|
+
additionalProperties: false
|
|
1382
|
+
},
|
|
1383
|
+
DynamicString: {
|
|
1384
|
+
title: "text, a {\"path\"} binding, or a function call",
|
|
1385
|
+
oneOf: [
|
|
1386
|
+
{
|
|
1387
|
+
type: "string",
|
|
1388
|
+
maxLength: 4e3
|
|
1389
|
+
},
|
|
1390
|
+
{ type: "number" },
|
|
1391
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
1392
|
+
{ $ref: "#/$defs/FunctionCall" }
|
|
1393
|
+
]
|
|
1394
|
+
},
|
|
1395
|
+
DynamicNumber: {
|
|
1396
|
+
title: "a number, a {\"path\"} binding, or a function call",
|
|
1397
|
+
oneOf: [
|
|
1398
|
+
{ type: "number" },
|
|
1399
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
1400
|
+
{ $ref: "#/$defs/FunctionCall" }
|
|
1401
|
+
]
|
|
1402
|
+
},
|
|
1403
|
+
DynamicBoolean: {
|
|
1404
|
+
title: "true or false, a {\"path\"} binding, or a function call",
|
|
1405
|
+
oneOf: [
|
|
1406
|
+
{ type: "boolean" },
|
|
1407
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
1408
|
+
{ $ref: "#/$defs/FunctionCall" }
|
|
1409
|
+
]
|
|
1410
|
+
},
|
|
1411
|
+
DynamicStringList: {
|
|
1412
|
+
title: "a list of strings, a {\"path\"} binding, or a function call",
|
|
1413
|
+
oneOf: [
|
|
1414
|
+
{
|
|
1415
|
+
type: "array",
|
|
1416
|
+
items: { type: "string" },
|
|
1417
|
+
maxItems: 100
|
|
1418
|
+
},
|
|
1419
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
1420
|
+
{ $ref: "#/$defs/FunctionCall" }
|
|
1421
|
+
]
|
|
1422
|
+
},
|
|
1423
|
+
DynamicValue: {
|
|
1424
|
+
title: "a literal value, a {\"path\"} binding, or a function call",
|
|
1425
|
+
oneOf: [
|
|
1426
|
+
{
|
|
1427
|
+
type: "string",
|
|
1428
|
+
maxLength: 4e3
|
|
1429
|
+
},
|
|
1430
|
+
{ type: "number" },
|
|
1431
|
+
{ type: "boolean" },
|
|
1432
|
+
{
|
|
1433
|
+
type: "array",
|
|
1434
|
+
maxItems: 100
|
|
1435
|
+
},
|
|
1436
|
+
{ $ref: "#/$defs/DataBinding" },
|
|
1437
|
+
{ $ref: "#/$defs/FunctionCall" }
|
|
1438
|
+
]
|
|
1439
|
+
},
|
|
1440
|
+
Href: {
|
|
1441
|
+
title: "a site path like \"/work/anvil2\" or an https URL",
|
|
1442
|
+
type: "string",
|
|
1443
|
+
maxLength: 2e3,
|
|
1444
|
+
pattern: hrefPattern
|
|
1445
|
+
},
|
|
1446
|
+
DynamicHref: {
|
|
1447
|
+
title: "a site path, an https URL, or a {\"path\"} binding",
|
|
1448
|
+
oneOf: [{ $ref: "#/$defs/Href" }, { $ref: "#/$defs/DataBinding" }]
|
|
1449
|
+
},
|
|
1450
|
+
DynamicImageUrl: {
|
|
1451
|
+
title: "a site path, an https URL, or a {\"path\"} binding",
|
|
1452
|
+
oneOf: [{
|
|
1453
|
+
title: "a site path or an https URL",
|
|
1454
|
+
type: "string",
|
|
1455
|
+
maxLength: 2e3,
|
|
1456
|
+
pattern: imagePattern
|
|
1457
|
+
}, { $ref: "#/$defs/DataBinding" }]
|
|
1458
|
+
},
|
|
1459
|
+
DsIconName: {
|
|
1460
|
+
title: "a Derelicious icon name",
|
|
1461
|
+
type: "string",
|
|
1462
|
+
enum: [...iconNames]
|
|
1463
|
+
},
|
|
1464
|
+
IconName: {
|
|
1465
|
+
title: "an icon name, {\"svgPath\": \"...\"}, or a {\"path\"} binding",
|
|
1466
|
+
oneOf: [
|
|
1467
|
+
{
|
|
1468
|
+
type: "string",
|
|
1469
|
+
enum: iconEnum
|
|
1470
|
+
},
|
|
1471
|
+
{
|
|
1472
|
+
type: "object",
|
|
1473
|
+
properties: { svgPath: {
|
|
1474
|
+
type: "string",
|
|
1475
|
+
maxLength: 4e3,
|
|
1476
|
+
pattern: "^[MmLlHhVvCcSsQqTtAaZz0-9eE.,\\s+-]+$"
|
|
1477
|
+
} },
|
|
1478
|
+
required: ["svgPath"],
|
|
1479
|
+
additionalProperties: false
|
|
1480
|
+
},
|
|
1481
|
+
{ $ref: "#/$defs/DataBinding" }
|
|
1482
|
+
]
|
|
1483
|
+
},
|
|
1484
|
+
Action: {
|
|
1485
|
+
title: "an action {\"event\": {\"name\", \"context\"}} or {\"functionCall\": {...}}",
|
|
1486
|
+
oneOf: [{
|
|
1487
|
+
type: "object",
|
|
1488
|
+
properties: { event: {
|
|
1489
|
+
type: "object",
|
|
1490
|
+
properties: {
|
|
1491
|
+
name: {
|
|
1492
|
+
type: "string",
|
|
1493
|
+
minLength: 1,
|
|
1494
|
+
maxLength: 100,
|
|
1495
|
+
description: "The event name."
|
|
1496
|
+
},
|
|
1497
|
+
context: {
|
|
1498
|
+
type: "object",
|
|
1499
|
+
description: "Values sent with the event. Literals or bindings.",
|
|
1500
|
+
additionalProperties: { $ref: "#/$defs/DynamicValue" }
|
|
1501
|
+
}
|
|
1502
|
+
},
|
|
1503
|
+
required: ["name"],
|
|
1504
|
+
additionalProperties: false
|
|
1505
|
+
} },
|
|
1506
|
+
required: ["event"],
|
|
1507
|
+
additionalProperties: false
|
|
1508
|
+
}, {
|
|
1509
|
+
type: "object",
|
|
1510
|
+
properties: { functionCall: { $ref: "#/$defs/FunctionCall" } },
|
|
1511
|
+
required: ["functionCall"],
|
|
1512
|
+
additionalProperties: false
|
|
1513
|
+
}]
|
|
1514
|
+
},
|
|
1515
|
+
CheckRule: {
|
|
1516
|
+
title: "a check {\"condition\", \"message\"}",
|
|
1517
|
+
type: "object",
|
|
1518
|
+
properties: {
|
|
1519
|
+
condition: { $ref: "#/$defs/DynamicBoolean" },
|
|
1520
|
+
message: {
|
|
1521
|
+
type: "string",
|
|
1522
|
+
maxLength: 200
|
|
1523
|
+
}
|
|
1524
|
+
},
|
|
1525
|
+
required: ["condition", "message"],
|
|
1526
|
+
additionalProperties: false
|
|
1527
|
+
},
|
|
1528
|
+
Checks: {
|
|
1529
|
+
title: "a list of checks",
|
|
1530
|
+
type: "array",
|
|
1531
|
+
items: { $ref: "#/$defs/CheckRule" },
|
|
1532
|
+
maxItems: 10
|
|
1533
|
+
},
|
|
1534
|
+
AccessibilityAttributes: {
|
|
1535
|
+
title: "accessibility attributes {\"label\", \"description\"}",
|
|
1536
|
+
type: "object",
|
|
1537
|
+
properties: {
|
|
1538
|
+
label: {
|
|
1539
|
+
$ref: "#/$defs/DynamicString",
|
|
1540
|
+
description: "A short accessible name."
|
|
1541
|
+
},
|
|
1542
|
+
description: {
|
|
1543
|
+
$ref: "#/$defs/DynamicString",
|
|
1544
|
+
description: "Extra information for assistive technology."
|
|
1545
|
+
}
|
|
1546
|
+
},
|
|
1547
|
+
additionalProperties: false
|
|
1548
|
+
},
|
|
1549
|
+
theme: {
|
|
1550
|
+
type: "object",
|
|
1551
|
+
description: "Derelicious surfaces follow the page theme, so theme values are ignored.",
|
|
1552
|
+
properties: {
|
|
1553
|
+
primaryColor: {
|
|
1554
|
+
type: "string",
|
|
1555
|
+
pattern: "^#[0-9a-fA-F]{6}$"
|
|
1556
|
+
},
|
|
1557
|
+
iconUrl: { type: "string" },
|
|
1558
|
+
agentDisplayName: { type: "string" }
|
|
1559
|
+
},
|
|
1560
|
+
additionalProperties: true
|
|
1561
|
+
},
|
|
1562
|
+
anyComponent: { oneOf: catalogComponents.map((entry) => ({ $ref: `#/components/${entry.type}` })) },
|
|
1563
|
+
anyFunction: { oneOf: catalogFunctions.map((fn) => ({ $ref: `#/functions/${fn.name}` })) }
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
function componentSchema(entry) {
|
|
1567
|
+
return {
|
|
1568
|
+
type: "object",
|
|
1569
|
+
description: entry.description,
|
|
1570
|
+
"x-derelicious": {
|
|
1571
|
+
origin: entry.origin,
|
|
1572
|
+
renders: entry.renders,
|
|
1573
|
+
status: entry.status ?? "stable",
|
|
1574
|
+
usage: entry.usage,
|
|
1575
|
+
...entry.requireOneOf ? { requireOneOf: entry.requireOneOf } : {}
|
|
1576
|
+
},
|
|
1577
|
+
properties: {
|
|
1578
|
+
id: { $ref: "#/$defs/ComponentId" },
|
|
1579
|
+
component: { const: entry.type },
|
|
1580
|
+
accessibility: { $ref: "#/$defs/AccessibilityAttributes" },
|
|
1581
|
+
weight: {
|
|
1582
|
+
type: "number",
|
|
1583
|
+
minimum: 0,
|
|
1584
|
+
description: "Share of the remaining space in a Row or Column, like CSS flex-grow. Only on direct children of a Row or Column."
|
|
1585
|
+
},
|
|
1586
|
+
...entry.props
|
|
1587
|
+
},
|
|
1588
|
+
required: [
|
|
1589
|
+
"id",
|
|
1590
|
+
"component",
|
|
1591
|
+
...entry.required ?? []
|
|
1592
|
+
],
|
|
1593
|
+
additionalProperties: false
|
|
1594
|
+
};
|
|
1595
|
+
}
|
|
1596
|
+
function functionSchema(fn) {
|
|
1597
|
+
return {
|
|
1598
|
+
type: "object",
|
|
1599
|
+
description: fn.description,
|
|
1600
|
+
"x-derelicious": { origin: fn.origin },
|
|
1601
|
+
properties: {
|
|
1602
|
+
call: { const: fn.name },
|
|
1603
|
+
args: {
|
|
1604
|
+
type: "object",
|
|
1605
|
+
properties: fn.args,
|
|
1606
|
+
...fn.required?.length ? { required: fn.required } : {},
|
|
1607
|
+
additionalProperties: false
|
|
1608
|
+
},
|
|
1609
|
+
returnType: { const: fn.returns }
|
|
1610
|
+
},
|
|
1611
|
+
required: fn.required?.length ? ["call", "args"] : ["call"],
|
|
1612
|
+
additionalProperties: false
|
|
1613
|
+
};
|
|
1614
|
+
}
|
|
1615
|
+
/** The catalog as one JSON Schema document, in the shape of an A2UI catalog. */
|
|
1616
|
+
function buildCatalogJson() {
|
|
1617
|
+
return {
|
|
1618
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
1619
|
+
$id: catalogId,
|
|
1620
|
+
title: "Derelicious A2UI catalog",
|
|
1621
|
+
description: "The A2UI v0.9 basic catalog rendered with Derelicious components, plus Derelicious types. Common types are copied into $defs, so the document validates offline.",
|
|
1622
|
+
catalogId,
|
|
1623
|
+
extends: basicCatalogId,
|
|
1624
|
+
version: A2UI_VERSION,
|
|
1625
|
+
rules: protocolRules,
|
|
1626
|
+
components: Object.fromEntries(catalogComponents.map((entry) => [entry.type, componentSchema(entry)])),
|
|
1627
|
+
functions: Object.fromEntries(catalogFunctions.map((fn) => [fn.name, functionSchema(fn)])),
|
|
1628
|
+
$defs: catalogDefs()
|
|
1629
|
+
};
|
|
1630
|
+
}
|
|
1631
|
+
/** What the manifest stores, for the MCP server and the docs site. */
|
|
1632
|
+
function catalogSummary() {
|
|
1633
|
+
const defs = catalogDefs();
|
|
1634
|
+
delete defs.anyComponent;
|
|
1635
|
+
delete defs.anyFunction;
|
|
1636
|
+
return {
|
|
1637
|
+
catalogId,
|
|
1638
|
+
extends: basicCatalogId,
|
|
1639
|
+
version: A2UI_VERSION,
|
|
1640
|
+
path: catalogPath,
|
|
1641
|
+
rules: protocolRules,
|
|
1642
|
+
components: catalogComponents.map((entry) => ({
|
|
1643
|
+
type: entry.type,
|
|
1644
|
+
origin: entry.origin,
|
|
1645
|
+
status: entry.status ?? "stable",
|
|
1646
|
+
renders: entry.renders,
|
|
1647
|
+
description: entry.description,
|
|
1648
|
+
required: entry.required ?? [],
|
|
1649
|
+
props: entry.props,
|
|
1650
|
+
usage: entry.usage
|
|
1651
|
+
})),
|
|
1652
|
+
functions: catalogFunctions.map((fn) => ({
|
|
1653
|
+
name: fn.name,
|
|
1654
|
+
origin: fn.origin,
|
|
1655
|
+
description: fn.description,
|
|
1656
|
+
returns: fn.returns,
|
|
1657
|
+
required: fn.required ?? [],
|
|
1658
|
+
args: fn.args
|
|
1659
|
+
})),
|
|
1660
|
+
defs
|
|
1661
|
+
};
|
|
1662
|
+
}
|
|
1663
|
+
function getCatalogComponent(type) {
|
|
1664
|
+
return catalogComponents.find((entry) => entry.type === type);
|
|
1665
|
+
}
|
|
1666
|
+
export { A2UI_VERSION, basicCatalogId, basicIconMap, buildCatalogJson, catalogComponents, catalogDefs, catalogFunctions, catalogId, catalogPath, catalogSummary, getCatalogComponent, protocolRules };
|