@lo-tek/interfaces 0.0.0 → 0.37.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 +3254 -0
- package/LICENSE +21 -0
- package/README.md +128 -1
- package/agent/astro.md +400 -0
- package/agent/bundles.md +429 -0
- package/agent/datastar.md +409 -0
- package/agent/html.md +388 -0
- package/agent/react.md +440 -0
- package/agent/templates.md +472 -0
- package/core/lotek-core.wasm +0 -0
- package/core/lotek.wasm +0 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/css/accordion/accordion.d.ts +37 -0
- package/dist/components/css/accordion/accordion.d.ts.map +1 -0
- package/dist/components/css/accordion/accordion.js +31 -0
- package/dist/components/css/accordion/accordion.js.map +1 -0
- package/dist/components/css/alert/alert.d.ts +35 -0
- package/dist/components/css/alert/alert.d.ts.map +1 -0
- package/dist/components/css/alert/alert.js +29 -0
- package/dist/components/css/alert/alert.js.map +1 -0
- package/dist/components/css/avatar/avatar.d.ts +40 -0
- package/dist/components/css/avatar/avatar.d.ts.map +1 -0
- package/dist/components/css/avatar/avatar.js +30 -0
- package/dist/components/css/avatar/avatar.js.map +1 -0
- package/dist/components/css/badge/badge.d.ts +24 -0
- package/dist/components/css/badge/badge.d.ts.map +1 -0
- package/dist/components/css/badge/badge.js +24 -0
- package/dist/components/css/badge/badge.js.map +1 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts +26 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.js +24 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/components/css/button/button.d.ts +26 -0
- package/dist/components/css/button/button.d.ts.map +1 -0
- package/dist/components/css/button/button.js +25 -0
- package/dist/components/css/button/button.js.map +1 -0
- package/dist/components/css/card/card.d.ts +36 -0
- package/dist/components/css/card/card.d.ts.map +1 -0
- package/dist/components/css/card/card.js +28 -0
- package/dist/components/css/card/card.js.map +1 -0
- package/dist/components/css/checkbox/checkbox.d.ts +32 -0
- package/dist/components/css/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/css/checkbox/checkbox.js +27 -0
- package/dist/components/css/checkbox/checkbox.js.map +1 -0
- package/dist/components/css/divider/divider.d.ts +29 -0
- package/dist/components/css/divider/divider.d.ts.map +1 -0
- package/dist/components/css/divider/divider.js +23 -0
- package/dist/components/css/divider/divider.js.map +1 -0
- package/dist/components/css/error-text/error-text.d.ts +24 -0
- package/dist/components/css/error-text/error-text.d.ts.map +1 -0
- package/dist/components/css/error-text/error-text.js +18 -0
- package/dist/components/css/error-text/error-text.js.map +1 -0
- package/dist/components/css/fieldset/fieldset.d.ts +55 -0
- package/dist/components/css/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/css/fieldset/fieldset.js +39 -0
- package/dist/components/css/fieldset/fieldset.js.map +1 -0
- package/dist/components/css/file-upload/file-upload.d.ts +41 -0
- package/dist/components/css/file-upload/file-upload.d.ts.map +1 -0
- package/dist/components/css/file-upload/file-upload.js +32 -0
- package/dist/components/css/file-upload/file-upload.js.map +1 -0
- package/dist/components/css/heading/heading.d.ts +29 -0
- package/dist/components/css/heading/heading.d.ts.map +1 -0
- package/dist/components/css/heading/heading.js +23 -0
- package/dist/components/css/heading/heading.js.map +1 -0
- package/dist/components/css/help-text/help-text.d.ts +24 -0
- package/dist/components/css/help-text/help-text.d.ts.map +1 -0
- package/dist/components/css/help-text/help-text.js +23 -0
- package/dist/components/css/help-text/help-text.js.map +1 -0
- package/dist/components/css/icon/icon.d.ts +34 -0
- package/dist/components/css/icon/icon.d.ts.map +1 -0
- package/dist/components/css/icon/icon.js +25 -0
- package/dist/components/css/icon/icon.js.map +1 -0
- package/dist/components/css/input/input.d.ts +40 -0
- package/dist/components/css/input/input.d.ts.map +1 -0
- package/dist/components/css/input/input.js +45 -0
- package/dist/components/css/input/input.js.map +1 -0
- package/dist/components/css/label/label.d.ts +33 -0
- package/dist/components/css/label/label.d.ts.map +1 -0
- package/dist/components/css/label/label.js +23 -0
- package/dist/components/css/label/label.js.map +1 -0
- package/dist/components/css/link/link.d.ts +28 -0
- package/dist/components/css/link/link.d.ts.map +1 -0
- package/dist/components/css/link/link.js +20 -0
- package/dist/components/css/link/link.js.map +1 -0
- package/dist/components/css/list/list.d.ts +31 -0
- package/dist/components/css/list/list.d.ts.map +1 -0
- package/dist/components/css/list/list.js +25 -0
- package/dist/components/css/list/list.js.map +1 -0
- package/dist/components/css/pagination/pagination.d.ts +27 -0
- package/dist/components/css/pagination/pagination.d.ts.map +1 -0
- package/dist/components/css/pagination/pagination.js +25 -0
- package/dist/components/css/pagination/pagination.js.map +1 -0
- package/dist/components/css/paragraph/paragraph.d.ts +36 -0
- package/dist/components/css/paragraph/paragraph.d.ts.map +1 -0
- package/dist/components/css/paragraph/paragraph.js +26 -0
- package/dist/components/css/paragraph/paragraph.js.map +1 -0
- package/dist/components/css/progress/progress.d.ts +53 -0
- package/dist/components/css/progress/progress.d.ts.map +1 -0
- package/dist/components/css/progress/progress.js +38 -0
- package/dist/components/css/progress/progress.js.map +1 -0
- package/dist/components/css/radio/radio.d.ts +32 -0
- package/dist/components/css/radio/radio.d.ts.map +1 -0
- package/dist/components/css/radio/radio.js +27 -0
- package/dist/components/css/radio/radio.js.map +1 -0
- package/dist/components/css/search/search.d.ts +34 -0
- package/dist/components/css/search/search.d.ts.map +1 -0
- package/dist/components/css/search/search.js +32 -0
- package/dist/components/css/search/search.js.map +1 -0
- package/dist/components/css/select/select.d.ts +40 -0
- package/dist/components/css/select/select.d.ts.map +1 -0
- package/dist/components/css/select/select.js +31 -0
- package/dist/components/css/select/select.js.map +1 -0
- package/dist/components/css/shared.d.ts +90 -0
- package/dist/components/css/shared.d.ts.map +1 -0
- package/dist/components/css/shared.js +167 -0
- package/dist/components/css/shared.js.map +1 -0
- package/dist/components/css/skeleton/skeleton.d.ts +29 -0
- package/dist/components/css/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/css/skeleton/skeleton.js +23 -0
- package/dist/components/css/skeleton/skeleton.js.map +1 -0
- package/dist/components/css/skip-link/skip-link.d.ts +18 -0
- package/dist/components/css/skip-link/skip-link.d.ts.map +1 -0
- package/dist/components/css/skip-link/skip-link.js +16 -0
- package/dist/components/css/skip-link/skip-link.js.map +1 -0
- package/dist/components/css/spinner/spinner.d.ts +33 -0
- package/dist/components/css/spinner/spinner.d.ts.map +1 -0
- package/dist/components/css/spinner/spinner.js +25 -0
- package/dist/components/css/spinner/spinner.js.map +1 -0
- package/dist/components/css/sr-only/sr-only.d.ts +17 -0
- package/dist/components/css/sr-only/sr-only.d.ts.map +1 -0
- package/dist/components/css/sr-only/sr-only.js +15 -0
- package/dist/components/css/sr-only/sr-only.js.map +1 -0
- package/dist/components/css/switch/switch.d.ts +37 -0
- package/dist/components/css/switch/switch.d.ts.map +1 -0
- package/dist/components/css/switch/switch.js +29 -0
- package/dist/components/css/switch/switch.js.map +1 -0
- package/dist/components/css/table/table.d.ts +76 -0
- package/dist/components/css/table/table.d.ts.map +1 -0
- package/dist/components/css/table/table.js +59 -0
- package/dist/components/css/table/table.js.map +1 -0
- package/dist/components/css/tag/tag.d.ts +35 -0
- package/dist/components/css/tag/tag.d.ts.map +1 -0
- package/dist/components/css/tag/tag.js +27 -0
- package/dist/components/css/tag/tag.js.map +1 -0
- package/dist/components/css/textarea/textarea.d.ts +23 -0
- package/dist/components/css/textarea/textarea.d.ts.map +1 -0
- package/dist/components/css/textarea/textarea.js +18 -0
- package/dist/components/css/textarea/textarea.js.map +1 -0
- package/dist/components/css/toggle-group/toggle-group.d.ts +31 -0
- package/dist/components/css/toggle-group/toggle-group.d.ts.map +1 -0
- package/dist/components/css/toggle-group/toggle-group.js +29 -0
- package/dist/components/css/toggle-group/toggle-group.js.map +1 -0
- package/dist/components/css/tooltip/tooltip.d.ts +31 -0
- package/dist/components/css/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/css/tooltip/tooltip.js +29 -0
- package/dist/components/css/tooltip/tooltip.js.map +1 -0
- package/dist/components/default-texts.d.ts +35 -0
- package/dist/components/default-texts.d.ts.map +1 -0
- package/dist/components/default-texts.js +35 -0
- package/dist/components/default-texts.js.map +1 -0
- package/dist/components/events.d.ts +77 -0
- package/dist/components/events.d.ts.map +1 -0
- package/dist/components/events.js +3 -0
- package/dist/components/events.js.map +1 -0
- package/dist/components/frame/dialog/dialog.d.ts +122 -0
- package/dist/components/frame/dialog/dialog.d.ts.map +1 -0
- package/dist/components/frame/dialog/dialog.js +112 -0
- package/dist/components/frame/dialog/dialog.js.map +1 -0
- package/dist/components/frame/dialog/lt-dialog.d.ts +104 -0
- package/dist/components/frame/dialog/lt-dialog.d.ts.map +1 -0
- package/dist/components/frame/dialog/lt-dialog.js +431 -0
- package/dist/components/frame/dialog/lt-dialog.js.map +1 -0
- package/dist/components/frame/error-summary/error-summary.d.ts +40 -0
- package/dist/components/frame/error-summary/error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/error-summary.js +32 -0
- package/dist/components/frame/error-summary/error-summary.js.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts +82 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.js +302 -0
- package/dist/components/frame/error-summary/lt-error-summary.js.map +1 -0
- package/dist/components/frame/field/field-core.d.ts +92 -0
- package/dist/components/frame/field/field-core.d.ts.map +1 -0
- package/dist/components/frame/field/field-core.js +63 -0
- package/dist/components/frame/field/field-core.js.map +1 -0
- package/dist/components/frame/field/lt-field.d.ts +173 -0
- package/dist/components/frame/field/lt-field.d.ts.map +1 -0
- package/dist/components/frame/field/lt-field.js +580 -0
- package/dist/components/frame/field/lt-field.js.map +1 -0
- package/dist/components/frame/popover/lt-popover.d.ts +132 -0
- package/dist/components/frame/popover/lt-popover.d.ts.map +1 -0
- package/dist/components/frame/popover/lt-popover.js +490 -0
- package/dist/components/frame/popover/lt-popover.js.map +1 -0
- package/dist/components/frame/popover/popover.d.ts +49 -0
- package/dist/components/frame/popover/popover.d.ts.map +1 -0
- package/dist/components/frame/popover/popover.js +64 -0
- package/dist/components/frame/popover/popover.js.map +1 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +198 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts.map +1 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.js +573 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.js.map +1 -0
- package/dist/components/frame/session-timeout/session-timeout.d.ts +113 -0
- package/dist/components/frame/session-timeout/session-timeout.d.ts.map +1 -0
- package/dist/components/frame/session-timeout/session-timeout.js +101 -0
- package/dist/components/frame/session-timeout/session-timeout.js.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts +361 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.js +1152 -0
- package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -0
- package/dist/components/frame/suggestion/suggestion.d.ts +143 -0
- package/dist/components/frame/suggestion/suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/suggestion.js +127 -0
- package/dist/components/frame/suggestion/suggestion.js.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts +404 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.js +1201 -0
- package/dist/components/frame/tabs/lt-tabs.js.map +1 -0
- package/dist/components/frame/tabs/tabs.d.ts +112 -0
- package/dist/components/frame/tabs/tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/tabs.js +107 -0
- package/dist/components/frame/tabs/tabs.js.map +1 -0
- package/dist/components/host-element.d.ts +135 -0
- package/dist/components/host-element.d.ts.map +1 -0
- package/dist/components/host-element.js +366 -0
- package/dist/components/host-element.js.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts +28 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.js +22 -0
- package/dist/components/standalone/connection-status/connection-status.js.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts +81 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.js +216 -0
- package/dist/components/standalone/connection-status/lt-connection-status.js.map +1 -0
- package/dist/components/standalone/toast/lt-toast.d.ts +109 -0
- package/dist/components/standalone/toast/lt-toast.d.ts.map +1 -0
- package/dist/components/standalone/toast/lt-toast.js +256 -0
- package/dist/components/standalone/toast/lt-toast.js.map +1 -0
- package/dist/components/standalone/toast/toast.d.ts +52 -0
- package/dist/components/standalone/toast/toast.d.ts.map +1 -0
- package/dist/components/standalone/toast/toast.js +42 -0
- package/dist/components/standalone/toast/toast.js.map +1 -0
- package/dist/diagnostics/core.d.ts +137 -0
- package/dist/diagnostics/core.d.ts.map +1 -0
- package/dist/diagnostics/core.js +72 -0
- package/dist/diagnostics/core.js.map +1 -0
- package/dist/diagnostics/default-core.d.ts +10 -0
- package/dist/diagnostics/default-core.d.ts.map +1 -0
- package/dist/diagnostics/default-core.js +72 -0
- package/dist/diagnostics/default-core.js.map +1 -0
- package/dist/diagnostics/index.d.ts +84 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +106 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/dom.d.ts +55 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +162 -0
- package/dist/dom.js.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx/react.d.ts +180 -0
- package/dist/jsx/react.d.ts.map +1 -0
- package/dist/jsx/react.js +2 -0
- package/dist/jsx/react.js.map +1 -0
- package/dist/lotek.css +3617 -0
- package/dist/lt.d.ts +325 -0
- package/dist/lt.d.ts.map +1 -0
- package/dist/lt.js +183 -0
- package/dist/lt.js.map +1 -0
- package/dist/react.d.ts +492 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +296 -0
- package/dist/react.js.map +1 -0
- package/dist/register.d.ts +17 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +35 -0
- package/dist/register.js.map +1 -0
- package/dist/tokens/color.d.ts +43 -0
- package/dist/tokens/color.d.ts.map +1 -0
- package/dist/tokens/color.js +123 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/contract.d.ts +18 -0
- package/dist/tokens/contract.d.ts.map +1 -0
- package/dist/tokens/contract.js +18 -0
- package/dist/tokens/contract.js.map +1 -0
- package/dist/tokens/matrix-cells.d.ts +30 -0
- package/dist/tokens/matrix-cells.d.ts.map +1 -0
- package/dist/tokens/matrix-cells.js +273 -0
- package/dist/tokens/matrix-cells.js.map +1 -0
- package/dist/tokens/matrix.d.ts +18 -0
- package/dist/tokens/matrix.d.ts.map +1 -0
- package/dist/tokens/matrix.js +21 -0
- package/dist/tokens/matrix.js.map +1 -0
- package/dist/tokens/theme-check.d.ts +42 -0
- package/dist/tokens/theme-check.d.ts.map +1 -0
- package/dist/tokens/theme-check.js +10 -0
- package/dist/tokens/theme-check.js.map +1 -0
- package/dist/tokens/theme.d.ts +94 -0
- package/dist/tokens/theme.d.ts.map +1 -0
- package/dist/tokens/theme.js +14 -0
- package/dist/tokens/theme.js.map +1 -0
- package/dist/tokens/tokens.d.ts +122 -0
- package/dist/tokens/tokens.d.ts.map +1 -0
- package/dist/tokens/tokens.js +158 -0
- package/dist/tokens/tokens.js.map +1 -0
- package/dist/vocabulary/classes.d.ts +3 -0
- package/dist/vocabulary/classes.d.ts.map +1 -0
- package/dist/vocabulary/classes.js +1320 -0
- package/dist/vocabulary/classes.js.map +1 -0
- package/dist/vocabulary/elements.d.ts +3 -0
- package/dist/vocabulary/elements.d.ts.map +1 -0
- package/dist/vocabulary/elements.js +410 -0
- package/dist/vocabulary/elements.js.map +1 -0
- package/dist/vocabulary/types.d.ts +175 -0
- package/dist/vocabulary/types.d.ts.map +1 -0
- package/dist/vocabulary/types.js +11 -0
- package/dist/vocabulary/types.js.map +1 -0
- package/dist/wasi-host.d.ts +24 -0
- package/dist/wasi-host.d.ts.map +1 -0
- package/dist/wasi-host.js +140 -0
- package/dist/wasi-host.js.map +1 -0
- package/live-templates.xml +62 -0
- package/manifest/files.json +373 -0
- package/manifest/manifest.json +4965 -0
- package/manifest/manifest.schema.json +513 -0
- package/package.json +398 -5
- package/src/cli.ts +21 -0
- package/src/components/css/accordion/accordion.css +102 -0
- package/src/components/css/accordion/accordion.ts +50 -0
- package/src/components/css/alert/alert.css +53 -0
- package/src/components/css/alert/alert.ts +48 -0
- package/src/components/css/avatar/avatar.css +96 -0
- package/src/components/css/avatar/avatar.ts +57 -0
- package/src/components/css/badge/badge.css +42 -0
- package/src/components/css/badge/badge.ts +43 -0
- package/src/components/css/breadcrumbs/breadcrumbs.css +62 -0
- package/src/components/css/breadcrumbs/breadcrumbs.ts +30 -0
- package/src/components/css/button/button.css +128 -0
- package/src/components/css/button/button.ts +44 -0
- package/src/components/css/card/card.css +65 -0
- package/src/components/css/card/card.ts +50 -0
- package/src/components/css/checkbox/checkbox.css +114 -0
- package/src/components/css/checkbox/checkbox.ts +50 -0
- package/src/components/css/divider/divider.css +38 -0
- package/src/components/css/divider/divider.ts +42 -0
- package/src/components/css/error-text/error-text.css +21 -0
- package/src/components/css/error-text/error-text.ts +37 -0
- package/src/components/css/fieldset/fieldset.css +72 -0
- package/src/components/css/fieldset/fieldset.ts +87 -0
- package/src/components/css/file-upload/file-upload.css +102 -0
- package/src/components/css/file-upload/file-upload.ts +65 -0
- package/src/components/css/heading/heading.css +33 -0
- package/src/components/css/heading/heading.ts +42 -0
- package/src/components/css/help-text/help-text.css +24 -0
- package/src/components/css/help-text/help-text.ts +42 -0
- package/src/components/css/icon/icon.css +20 -0
- package/src/components/css/icon/icon.ts +44 -0
- package/src/components/css/input/input.css +145 -0
- package/src/components/css/input/input.ts +77 -0
- package/src/components/css/label/label.css +42 -0
- package/src/components/css/label/label.ts +51 -0
- package/src/components/css/link/link.css +38 -0
- package/src/components/css/link/link.ts +38 -0
- package/src/components/css/list/list.css +53 -0
- package/src/components/css/list/list.ts +44 -0
- package/src/components/css/pagination/pagination.css +95 -0
- package/src/components/css/pagination/pagination.ts +33 -0
- package/src/components/css/paragraph/paragraph.css +31 -0
- package/src/components/css/paragraph/paragraph.ts +53 -0
- package/src/components/css/progress/progress.css +161 -0
- package/src/components/css/progress/progress.ts +78 -0
- package/src/components/css/radio/radio.css +94 -0
- package/src/components/css/radio/radio.ts +50 -0
- package/src/components/css/search/search.css +50 -0
- package/src/components/css/search/search.ts +56 -0
- package/src/components/css/select/select.css +321 -0
- package/src/components/css/select/select.ts +63 -0
- package/src/components/css/shared.ts +199 -0
- package/src/components/css/skeleton/skeleton.css +62 -0
- package/src/components/css/skeleton/skeleton.ts +43 -0
- package/src/components/css/skip-link/skip-link.css +41 -0
- package/src/components/css/skip-link/skip-link.ts +22 -0
- package/src/components/css/spinner/spinner.css +48 -0
- package/src/components/css/spinner/spinner.ts +48 -0
- package/src/components/css/sr-only/sr-only.css +16 -0
- package/src/components/css/sr-only/sr-only.ts +21 -0
- package/src/components/css/switch/switch.css +105 -0
- package/src/components/css/switch/switch.ts +50 -0
- package/src/components/css/table/table.css +159 -0
- package/src/components/css/table/table.ts +107 -0
- package/src/components/css/tag/tag.css +58 -0
- package/src/components/css/tag/tag.ts +49 -0
- package/src/components/css/textarea/textarea.css +83 -0
- package/src/components/css/textarea/textarea.ts +40 -0
- package/src/components/css/toggle-group/toggle-group.css +92 -0
- package/src/components/css/toggle-group/toggle-group.ts +37 -0
- package/src/components/css/tooltip/tooltip.css +89 -0
- package/src/components/css/tooltip/tooltip.ts +37 -0
- package/src/components/default-texts.ts +34 -0
- package/src/components/events.ts +68 -0
- package/src/components/frame/dialog/dialog.css +306 -0
- package/src/components/frame/dialog/dialog.ts +166 -0
- package/src/components/frame/dialog/lt-dialog.ts +510 -0
- package/src/components/frame/error-summary/error-summary.css +47 -0
- package/src/components/frame/error-summary/error-summary.ts +56 -0
- package/src/components/frame/error-summary/lt-error-summary.ts +344 -0
- package/src/components/frame/field/field-core.ts +152 -0
- package/src/components/frame/field/field.css +17 -0
- package/src/components/frame/field/lt-field.ts +753 -0
- package/src/components/frame/popover/lt-popover.ts +555 -0
- package/src/components/frame/popover/popover.css +50 -0
- package/src/components/frame/popover/popover.ts +102 -0
- package/src/components/frame/session-timeout/lt-session-timeout.ts +681 -0
- package/src/components/frame/session-timeout/session-timeout.css +50 -0
- package/src/components/frame/session-timeout/session-timeout.ts +156 -0
- package/src/components/frame/suggestion/lt-suggestion.ts +1358 -0
- package/src/components/frame/suggestion/suggestion.css +132 -0
- package/src/components/frame/suggestion/suggestion.ts +172 -0
- package/src/components/frame/tabs/lt-tabs.ts +1319 -0
- package/src/components/frame/tabs/tabs.css +128 -0
- package/src/components/frame/tabs/tabs.ts +188 -0
- package/src/components/host-element.ts +400 -0
- package/src/components/standalone/connection-status/connection-status.css +41 -0
- package/src/components/standalone/connection-status/connection-status.ts +41 -0
- package/src/components/standalone/connection-status/lt-connection-status.ts +242 -0
- package/src/components/standalone/toast/lt-toast.ts +300 -0
- package/src/components/standalone/toast/toast.css +78 -0
- package/src/components/standalone/toast/toast.ts +70 -0
- package/src/diagnostics/core.ts +210 -0
- package/src/diagnostics/default-core.ts +81 -0
- package/src/diagnostics/index.ts +150 -0
- package/src/dom.ts +185 -0
- package/src/index.ts +218 -0
- package/src/jsx/react.ts +212 -0
- package/src/lt.ts +192 -0
- package/src/react.ts +411 -0
- package/src/register.ts +43 -0
- package/src/tailwind/tailwind.css +169 -0
- package/src/tokens/boundary.css +104 -0
- package/src/tokens/color-contract.json +231 -0
- package/src/tokens/color.ts +150 -0
- package/src/tokens/contract.ts +24 -0
- package/src/tokens/matrix-cells.ts +375 -0
- package/src/tokens/matrix.ts +32 -0
- package/src/tokens/theme-check.ts +51 -0
- package/src/tokens/theme.ts +104 -0
- package/src/tokens/tokens.css +569 -0
- package/src/tokens/tokens.ts +223 -0
- package/src/vocabulary/classes.ts +1322 -0
- package/src/vocabulary/elements.ts +412 -0
- package/src/vocabulary/types.ts +178 -0
- package/src/wasi-host.ts +155 -0
- package/web-types.json +800 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
export type {
|
|
2
|
+
AccordionAttributes,
|
|
3
|
+
AccordionOptions,
|
|
4
|
+
AccordionVariant,
|
|
5
|
+
} from "./components/css/accordion/accordion.js"
|
|
6
|
+
export { accordion } from "./components/css/accordion/accordion.js"
|
|
7
|
+
export type {
|
|
8
|
+
AlertAttributes,
|
|
9
|
+
AlertColor,
|
|
10
|
+
AlertOptions,
|
|
11
|
+
} from "./components/css/alert/alert.js"
|
|
12
|
+
export { alert } from "./components/css/alert/alert.js"
|
|
13
|
+
export type {
|
|
14
|
+
AvatarAttributes,
|
|
15
|
+
AvatarOptions,
|
|
16
|
+
AvatarSize,
|
|
17
|
+
AvatarVariant,
|
|
18
|
+
} from "./components/css/avatar/avatar.js"
|
|
19
|
+
export { avatar } from "./components/css/avatar/avatar.js"
|
|
20
|
+
export type {
|
|
21
|
+
BadgeAttributes,
|
|
22
|
+
BadgeColor,
|
|
23
|
+
BadgeOptions,
|
|
24
|
+
} from "./components/css/badge/badge.js"
|
|
25
|
+
export { badge } from "./components/css/badge/badge.js"
|
|
26
|
+
export type { BreadcrumbsAttributes } from "./components/css/breadcrumbs/breadcrumbs.js"
|
|
27
|
+
export { breadcrumbs } from "./components/css/breadcrumbs/breadcrumbs.js"
|
|
28
|
+
export type {
|
|
29
|
+
ButtonAttributes,
|
|
30
|
+
ButtonOptions,
|
|
31
|
+
ButtonVariant,
|
|
32
|
+
} from "./components/css/button/button.js"
|
|
33
|
+
export { button } from "./components/css/button/button.js"
|
|
34
|
+
export type {
|
|
35
|
+
CardAttributes,
|
|
36
|
+
CardOptions,
|
|
37
|
+
CardVariant,
|
|
38
|
+
} from "./components/css/card/card.js"
|
|
39
|
+
export { card } from "./components/css/card/card.js"
|
|
40
|
+
export type {
|
|
41
|
+
CheckboxAttributes,
|
|
42
|
+
CheckboxOptions,
|
|
43
|
+
} from "./components/css/checkbox/checkbox.js"
|
|
44
|
+
export { checkbox } from "./components/css/checkbox/checkbox.js"
|
|
45
|
+
export type {
|
|
46
|
+
DividerAttributes,
|
|
47
|
+
DividerOptions,
|
|
48
|
+
DividerVariant,
|
|
49
|
+
} from "./components/css/divider/divider.js"
|
|
50
|
+
export { divider } from "./components/css/divider/divider.js"
|
|
51
|
+
export type {
|
|
52
|
+
ErrorTextAttributes,
|
|
53
|
+
ErrorTextOptions,
|
|
54
|
+
ErrorTextVariant,
|
|
55
|
+
} from "./components/css/error-text/error-text.js"
|
|
56
|
+
export { errorText } from "./components/css/error-text/error-text.js"
|
|
57
|
+
export type {
|
|
58
|
+
FieldsetAttributes,
|
|
59
|
+
FieldsetOptions,
|
|
60
|
+
LegendAttributes,
|
|
61
|
+
LegendOptions,
|
|
62
|
+
} from "./components/css/fieldset/fieldset.js"
|
|
63
|
+
export { fieldset, legend } from "./components/css/fieldset/fieldset.js"
|
|
64
|
+
export type {
|
|
65
|
+
FileUploadAttributes,
|
|
66
|
+
FileUploadOptions,
|
|
67
|
+
} from "./components/css/file-upload/file-upload.js"
|
|
68
|
+
export { fileUpload } from "./components/css/file-upload/file-upload.js"
|
|
69
|
+
export type {
|
|
70
|
+
HeadingAttributes,
|
|
71
|
+
HeadingOptions,
|
|
72
|
+
HeadingSize,
|
|
73
|
+
} from "./components/css/heading/heading.js"
|
|
74
|
+
export { heading } from "./components/css/heading/heading.js"
|
|
75
|
+
export type {
|
|
76
|
+
HelpTextAttributes,
|
|
77
|
+
HelpTextOptions,
|
|
78
|
+
HelpTextVariant,
|
|
79
|
+
} from "./components/css/help-text/help-text.js"
|
|
80
|
+
export { helpText } from "./components/css/help-text/help-text.js"
|
|
81
|
+
export type {
|
|
82
|
+
IconAttributes,
|
|
83
|
+
IconOptions,
|
|
84
|
+
} from "./components/css/icon/icon.js"
|
|
85
|
+
export { icon } from "./components/css/icon/icon.js"
|
|
86
|
+
export type {
|
|
87
|
+
InputAttributes,
|
|
88
|
+
InputOptions,
|
|
89
|
+
InputType,
|
|
90
|
+
} from "./components/css/input/input.js"
|
|
91
|
+
export { input } from "./components/css/input/input.js"
|
|
92
|
+
export type {
|
|
93
|
+
LabelAttributes,
|
|
94
|
+
LabelOptions,
|
|
95
|
+
} from "./components/css/label/label.js"
|
|
96
|
+
export { label } from "./components/css/label/label.js"
|
|
97
|
+
export type { LinkAttributes, LinkOptions } from "./components/css/link/link.js"
|
|
98
|
+
export { link } from "./components/css/link/link.js"
|
|
99
|
+
export type {
|
|
100
|
+
ListAttributes,
|
|
101
|
+
ListOptions,
|
|
102
|
+
ListVariant,
|
|
103
|
+
} from "./components/css/list/list.js"
|
|
104
|
+
export { list } from "./components/css/list/list.js"
|
|
105
|
+
export type { PaginationAttributes } from "./components/css/pagination/pagination.js"
|
|
106
|
+
export { pagination } from "./components/css/pagination/pagination.js"
|
|
107
|
+
export type {
|
|
108
|
+
ParagraphAttributes,
|
|
109
|
+
ParagraphOptions,
|
|
110
|
+
ParagraphSize,
|
|
111
|
+
ParagraphVariant,
|
|
112
|
+
} from "./components/css/paragraph/paragraph.js"
|
|
113
|
+
export { paragraph } from "./components/css/paragraph/paragraph.js"
|
|
114
|
+
export type {
|
|
115
|
+
ProgressAttributes,
|
|
116
|
+
ProgressColor,
|
|
117
|
+
ProgressOptions,
|
|
118
|
+
} from "./components/css/progress/progress.js"
|
|
119
|
+
export { progress } from "./components/css/progress/progress.js"
|
|
120
|
+
export type {
|
|
121
|
+
RadioAttributes,
|
|
122
|
+
RadioOptions,
|
|
123
|
+
} from "./components/css/radio/radio.js"
|
|
124
|
+
export { radio } from "./components/css/radio/radio.js"
|
|
125
|
+
export type {
|
|
126
|
+
SearchAttributes,
|
|
127
|
+
SearchOptions,
|
|
128
|
+
} from "./components/css/search/search.js"
|
|
129
|
+
export { search } from "./components/css/search/search.js"
|
|
130
|
+
export type {
|
|
131
|
+
NonDefaultSelectPicker,
|
|
132
|
+
SelectAttributes,
|
|
133
|
+
SelectOptions,
|
|
134
|
+
SelectPicker,
|
|
135
|
+
} from "./components/css/select/select.js"
|
|
136
|
+
export {
|
|
137
|
+
isSelectPicker,
|
|
138
|
+
select,
|
|
139
|
+
selectPickers,
|
|
140
|
+
} from "./components/css/select/select.js"
|
|
141
|
+
export * from "./components/css/shared.js"
|
|
142
|
+
export type {
|
|
143
|
+
SkeletonAttributes,
|
|
144
|
+
SkeletonOptions,
|
|
145
|
+
SkeletonVariant,
|
|
146
|
+
} from "./components/css/skeleton/skeleton.js"
|
|
147
|
+
export { skeleton } from "./components/css/skeleton/skeleton.js"
|
|
148
|
+
export type { SkipLinkAttributes } from "./components/css/skip-link/skip-link.js"
|
|
149
|
+
export { skipLink } from "./components/css/skip-link/skip-link.js"
|
|
150
|
+
export type {
|
|
151
|
+
SpinnerAttributes,
|
|
152
|
+
SpinnerOptions,
|
|
153
|
+
SpinnerSize,
|
|
154
|
+
} from "./components/css/spinner/spinner.js"
|
|
155
|
+
export { spinner } from "./components/css/spinner/spinner.js"
|
|
156
|
+
export type { SrOnlyAttributes } from "./components/css/sr-only/sr-only.js"
|
|
157
|
+
export { srOnly } from "./components/css/sr-only/sr-only.js"
|
|
158
|
+
export type {
|
|
159
|
+
SwitchAttributes,
|
|
160
|
+
SwitchOptions,
|
|
161
|
+
} from "./components/css/switch/switch.js"
|
|
162
|
+
export { switchControl } from "./components/css/switch/switch.js"
|
|
163
|
+
export type {
|
|
164
|
+
TableAttributes,
|
|
165
|
+
TableOptions,
|
|
166
|
+
TableSortAttributes,
|
|
167
|
+
TableSortDirection,
|
|
168
|
+
TableSortOptions,
|
|
169
|
+
TableVariant,
|
|
170
|
+
} from "./components/css/table/table.js"
|
|
171
|
+
export {
|
|
172
|
+
table,
|
|
173
|
+
tableSort,
|
|
174
|
+
tableSortDirections,
|
|
175
|
+
} from "./components/css/table/table.js"
|
|
176
|
+
export type {
|
|
177
|
+
TagAttributes,
|
|
178
|
+
TagOptions,
|
|
179
|
+
TagVariant,
|
|
180
|
+
} from "./components/css/tag/tag.js"
|
|
181
|
+
export { tag } from "./components/css/tag/tag.js"
|
|
182
|
+
export type {
|
|
183
|
+
TextareaAttributes,
|
|
184
|
+
TextareaOptions,
|
|
185
|
+
} from "./components/css/textarea/textarea.js"
|
|
186
|
+
export { textarea } from "./components/css/textarea/textarea.js"
|
|
187
|
+
export type { ToggleGroupAttributes } from "./components/css/toggle-group/toggle-group.js"
|
|
188
|
+
export { toggleGroup } from "./components/css/toggle-group/toggle-group.js"
|
|
189
|
+
export type { TooltipAttributes } from "./components/css/tooltip/tooltip.js"
|
|
190
|
+
export { tooltip } from "./components/css/tooltip/tooltip.js"
|
|
191
|
+
export type { LtEventMap } from "./components/events.js"
|
|
192
|
+
export type {
|
|
193
|
+
DialogAttributes,
|
|
194
|
+
DialogOptions,
|
|
195
|
+
} from "./components/frame/dialog/dialog.js"
|
|
196
|
+
export { dialog } from "./components/frame/dialog/dialog.js"
|
|
197
|
+
export * from "./components/frame/dialog/lt-dialog.js"
|
|
198
|
+
export * from "./components/frame/error-summary/error-summary.js"
|
|
199
|
+
export * from "./components/frame/error-summary/lt-error-summary.js"
|
|
200
|
+
export * from "./components/frame/field/field-core.js"
|
|
201
|
+
export * from "./components/frame/field/lt-field.js"
|
|
202
|
+
export * from "./components/frame/popover/lt-popover.js"
|
|
203
|
+
export * from "./components/frame/popover/popover.js"
|
|
204
|
+
export * from "./components/frame/session-timeout/lt-session-timeout.js"
|
|
205
|
+
export * from "./components/frame/session-timeout/session-timeout.js"
|
|
206
|
+
export * from "./components/frame/suggestion/lt-suggestion.js"
|
|
207
|
+
export * from "./components/frame/suggestion/suggestion.js"
|
|
208
|
+
export * from "./components/frame/tabs/lt-tabs.js"
|
|
209
|
+
export * from "./components/frame/tabs/tabs.js"
|
|
210
|
+
export * from "./components/standalone/connection-status/connection-status.js"
|
|
211
|
+
export * from "./components/standalone/connection-status/lt-connection-status.js"
|
|
212
|
+
export * from "./components/standalone/toast/lt-toast.js"
|
|
213
|
+
export * from "./components/standalone/toast/toast.js"
|
|
214
|
+
export type { Attributes } from "./dom.js"
|
|
215
|
+
export { setAttributes } from "./dom.js"
|
|
216
|
+
export type { Lt } from "./lt.js"
|
|
217
|
+
export { lt } from "./lt.js"
|
|
218
|
+
export * from "./tokens/tokens.js"
|
package/src/jsx/react.ts
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { HTMLAttributes, RefAttributes } from "react"
|
|
2
|
+
|
|
3
|
+
// The types of the events and tag names, so `querySelector("lt-dialog")` and
|
|
4
|
+
// `addEventListener` are typed also for someone who only imports this entry
|
|
5
|
+
// point. The file has no other import from the components, so without the
|
|
6
|
+
// line neither `HTMLElementEventMap` nor `HTMLElementTagNameMap` was extended.
|
|
7
|
+
export type { LtEventMap } from "../components/events.js"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Types for the LO-TEK web components in JSX.
|
|
11
|
+
*
|
|
12
|
+
* Without them TypeScript does not know `<lt-field>` at all, and says
|
|
13
|
+
* "Property 'lt-field' does not exist on type JSX.IntrinsicElements". And the
|
|
14
|
+
* attributes are hyphenated strings without completion, so `described-by`
|
|
15
|
+
* and `server-controlled` are exactly where a typo is easy to make and hard
|
|
16
|
+
* to spot.
|
|
17
|
+
*
|
|
18
|
+
* Import once in the project, preferably from a `.d.ts` file so it does not
|
|
19
|
+
* end up in the bundle:
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* // src/lotek.d.ts
|
|
23
|
+
* import "@lo-tek/interfaces/react-jsx"
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* Astro does not need this: there `<lt-field>` is plain HTML, and no type
|
|
27
|
+
* check looks at the element name.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Boolean attributes on web components.
|
|
32
|
+
*
|
|
33
|
+
* The type is `true | undefined`, not `boolean` and not `""`, and that is
|
|
34
|
+
* deliberate. React treats web components differently between versions, and
|
|
35
|
+
* only one pattern is right in both:
|
|
36
|
+
*
|
|
37
|
+
* React 18 sets attributes React 19 sets properties
|
|
38
|
+
* open="" works never open
|
|
39
|
+
* open={true} works works
|
|
40
|
+
* open={false} ALWAYS open works
|
|
41
|
+
* open={undefined} works works
|
|
42
|
+
*
|
|
43
|
+
* React 18 stringifies to `open="false"`. The attribute then exists, and is
|
|
44
|
+
* therefore true. React 19 sets the property to `""`, which is falsy, and
|
|
45
|
+
* the setter in the component removes the attribute again.
|
|
46
|
+
*
|
|
47
|
+
* That is why the builder functions send `true` for a boolean attribute on a
|
|
48
|
+
* host, not the empty string. `data-*` is different: React passes those on
|
|
49
|
+
* as attributes in both versions, and there `""` is the canonical form.
|
|
50
|
+
*
|
|
51
|
+
* When you write it by hand, write `open={isOpen || undefined}`. The type
|
|
52
|
+
* here makes the two other variants compile errors instead of something you
|
|
53
|
+
* have to remember.
|
|
54
|
+
*/
|
|
55
|
+
type Flag = true | undefined
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The server decides the state in this element.
|
|
59
|
+
*
|
|
60
|
+
* The components set back what the user has done when a patch tears it away:
|
|
61
|
+
* the selected tab, the open popover, the expanded suggestion list. With this
|
|
62
|
+
* they do not, and each patch decides. Use it when the server should be able
|
|
63
|
+
* to move the tab itself, as in "go on to step 2".
|
|
64
|
+
*/
|
|
65
|
+
type ServerControlled = {
|
|
66
|
+
"server-controlled"?: Flag
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The base shape of a web component in JSX.
|
|
71
|
+
*
|
|
72
|
+
* `HTMLAttributes` alone has no `ref`. It is in `RefAttributes`, and without
|
|
73
|
+
* it `<lt-toast ref={queue} />` was a type error, which is exactly the
|
|
74
|
+
* pattern the documentation recommends for calling `.show()` and `.hide()`.
|
|
75
|
+
* `key` comes the same way.
|
|
76
|
+
*/
|
|
77
|
+
type Host = HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>
|
|
78
|
+
|
|
79
|
+
type LtFieldAttributes = Host & {
|
|
80
|
+
disabled?: Flag
|
|
81
|
+
optional?: Flag
|
|
82
|
+
"described-by"?: string
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* `<lt-tabs>` has `server-controlled` and `activation`, and no `selected`.
|
|
87
|
+
*
|
|
88
|
+
* Which tab is selected is in the markup the server sent, as `aria-selected`
|
|
89
|
+
* on the tab and `hidden` on the panels. The component reads it from there
|
|
90
|
+
* instead of keeping a `selected` of its own, so the two can never disagree.
|
|
91
|
+
*/
|
|
92
|
+
type LtTabsAttributes = Host &
|
|
93
|
+
ServerControlled & {
|
|
94
|
+
/**
|
|
95
|
+
* `manual`: the arrow keys only move focus, and Enter or Space selects.
|
|
96
|
+
* Default: the arrow keys select straight away.
|
|
97
|
+
*/
|
|
98
|
+
activation?: "manual" | "automatic"
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
type LtErrorSummaryAttributes = Host & {
|
|
102
|
+
/**
|
|
103
|
+
* The box is hidden until there are errors to show.
|
|
104
|
+
*
|
|
105
|
+
* `HTMLAttributes` already has `hidden` as `boolean`, but on a web
|
|
106
|
+
* component the rule for `open` applies: React 18 writes `hidden={false}`
|
|
107
|
+
* as the attribute `hidden="false"`, and the box is then always hidden. So
|
|
108
|
+
* the type is `Flag` here too, and `hidden={hasErrors ? undefined : true}`
|
|
109
|
+
* is what compiles. `lt.errorSummary().host` sends it that way.
|
|
110
|
+
*/
|
|
111
|
+
hidden?: Flag
|
|
112
|
+
/**
|
|
113
|
+
* Move focus here when the box appears. Default: on.
|
|
114
|
+
* Set `"false"` to turn it off.
|
|
115
|
+
*/
|
|
116
|
+
"data-autofocus"?: "false" | "true"
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
type LtSuggestionAttributes = Host & {
|
|
120
|
+
/**
|
|
121
|
+
* Someone else has already filtered, so the component should not.
|
|
122
|
+
*
|
|
123
|
+
* The component hides an option when its text does not contain what is in
|
|
124
|
+
* the field. If you filter on something else, the two disagree, and then
|
|
125
|
+
* your filter should win. A React app that renders only the matches of a
|
|
126
|
+
* search that ignores diacritics is the most common case, alongside a
|
|
127
|
+
* Datastar app where the server sends the list again.
|
|
128
|
+
*
|
|
129
|
+
* The number of matches is announced whoever did the filtering.
|
|
130
|
+
*/
|
|
131
|
+
prefiltered?: Flag
|
|
132
|
+
/** The announcement for zero matches, such as "No matches". */
|
|
133
|
+
"count-none"?: string
|
|
134
|
+
/** The announcement in the form `Intl.PluralRules` calls `zero`. `{n}` is the number. */
|
|
135
|
+
"count-zero"?: string
|
|
136
|
+
/** The announcement for one match, such as "{n} match". `{n}` is the number. */
|
|
137
|
+
"count-one"?: string
|
|
138
|
+
/** The announcement in the form `two`. `{n}` is the number. */
|
|
139
|
+
"count-two"?: string
|
|
140
|
+
/** The announcement in the form `few`. `{n}` is the number. */
|
|
141
|
+
"count-few"?: string
|
|
142
|
+
/** The announcement in the form `many`. `{n}` is the number. */
|
|
143
|
+
"count-many"?: string
|
|
144
|
+
/** The announcement for every other count, and the fallback. `{n}` is the number. */
|
|
145
|
+
"count-other"?: string
|
|
146
|
+
} & ServerControlled
|
|
147
|
+
|
|
148
|
+
type LtDialogAttributes = Host &
|
|
149
|
+
ServerControlled & {
|
|
150
|
+
/** The dialog is open. The component calls `showModal()`. */
|
|
151
|
+
open?: Flag
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
type LtPopoverAttributes = Host &
|
|
155
|
+
ServerControlled & {
|
|
156
|
+
open?: Flag
|
|
157
|
+
/** Which edge the panel hangs from. */
|
|
158
|
+
placement?: "bottom-start" | "bottom-end" | "top-start" | "top-end"
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
type LtSessionTimeoutAttributes = Host & {
|
|
162
|
+
/** Seconds without activity before the warning appears. */
|
|
163
|
+
"warn-at"?: number | string
|
|
164
|
+
/** Seconds without activity before the session expires. */
|
|
165
|
+
"expires-at"?: number | string
|
|
166
|
+
/** Seconds between each `session-activity` while the user is active. */
|
|
167
|
+
"activity-interval"?: number | string
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
type LtConnectionStatusAttributes = Host & {
|
|
171
|
+
/** The text when the connection is lost. */
|
|
172
|
+
"offline-text"?: string
|
|
173
|
+
/** The text when it comes back. */
|
|
174
|
+
"online-text"?: string
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
type LtToastAttributes = Host & {
|
|
178
|
+
/** Milliseconds before the messages disappear. */
|
|
179
|
+
duration?: number
|
|
180
|
+
/** Text that says what the region is. */
|
|
181
|
+
label?: string
|
|
182
|
+
/** The screen reader name of the close button in each message. */
|
|
183
|
+
"close-label"?: string
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
declare module "react" {
|
|
187
|
+
namespace JSX {
|
|
188
|
+
interface IntrinsicElements {
|
|
189
|
+
"lt-dialog": LtDialogAttributes
|
|
190
|
+
"lt-error-summary": LtErrorSummaryAttributes
|
|
191
|
+
"lt-field": LtFieldAttributes
|
|
192
|
+
"lt-popover": LtPopoverAttributes
|
|
193
|
+
"lt-suggestion": LtSuggestionAttributes
|
|
194
|
+
"lt-tabs": LtTabsAttributes
|
|
195
|
+
"lt-session-timeout": LtSessionTimeoutAttributes
|
|
196
|
+
"lt-connection-status": LtConnectionStatusAttributes
|
|
197
|
+
"lt-toast": LtToastAttributes
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type {
|
|
203
|
+
LtConnectionStatusAttributes,
|
|
204
|
+
LtDialogAttributes,
|
|
205
|
+
LtErrorSummaryAttributes,
|
|
206
|
+
LtFieldAttributes,
|
|
207
|
+
LtPopoverAttributes,
|
|
208
|
+
LtSessionTimeoutAttributes,
|
|
209
|
+
LtSuggestionAttributes,
|
|
210
|
+
LtTabsAttributes,
|
|
211
|
+
LtToastAttributes,
|
|
212
|
+
}
|
package/src/lt.ts
ADDED
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { accordion } from "./components/css/accordion/accordion.js"
|
|
2
|
+
import { alert } from "./components/css/alert/alert.js"
|
|
3
|
+
import { avatar } from "./components/css/avatar/avatar.js"
|
|
4
|
+
import { badge } from "./components/css/badge/badge.js"
|
|
5
|
+
import { breadcrumbs } from "./components/css/breadcrumbs/breadcrumbs.js"
|
|
6
|
+
import { button } from "./components/css/button/button.js"
|
|
7
|
+
import { card } from "./components/css/card/card.js"
|
|
8
|
+
import { checkbox } from "./components/css/checkbox/checkbox.js"
|
|
9
|
+
import { divider } from "./components/css/divider/divider.js"
|
|
10
|
+
import { errorText } from "./components/css/error-text/error-text.js"
|
|
11
|
+
import { fieldset, legend } from "./components/css/fieldset/fieldset.js"
|
|
12
|
+
import { fileUpload } from "./components/css/file-upload/file-upload.js"
|
|
13
|
+
import { heading } from "./components/css/heading/heading.js"
|
|
14
|
+
import { helpText } from "./components/css/help-text/help-text.js"
|
|
15
|
+
import { icon } from "./components/css/icon/icon.js"
|
|
16
|
+
import { input } from "./components/css/input/input.js"
|
|
17
|
+
import { label } from "./components/css/label/label.js"
|
|
18
|
+
import { link } from "./components/css/link/link.js"
|
|
19
|
+
import { list } from "./components/css/list/list.js"
|
|
20
|
+
import { pagination } from "./components/css/pagination/pagination.js"
|
|
21
|
+
import { paragraph } from "./components/css/paragraph/paragraph.js"
|
|
22
|
+
import { progress } from "./components/css/progress/progress.js"
|
|
23
|
+
import { radio } from "./components/css/radio/radio.js"
|
|
24
|
+
import { search } from "./components/css/search/search.js"
|
|
25
|
+
import { select } from "./components/css/select/select.js"
|
|
26
|
+
import {
|
|
27
|
+
fieldStates,
|
|
28
|
+
isFieldState,
|
|
29
|
+
isRequiredMarker,
|
|
30
|
+
requiredMarkers,
|
|
31
|
+
} from "./components/css/shared.js"
|
|
32
|
+
import { skeleton } from "./components/css/skeleton/skeleton.js"
|
|
33
|
+
import { skipLink } from "./components/css/skip-link/skip-link.js"
|
|
34
|
+
import { spinner } from "./components/css/spinner/spinner.js"
|
|
35
|
+
import { srOnly } from "./components/css/sr-only/sr-only.js"
|
|
36
|
+
import { switchControl } from "./components/css/switch/switch.js"
|
|
37
|
+
import { table, tableSort } from "./components/css/table/table.js"
|
|
38
|
+
import { tag } from "./components/css/tag/tag.js"
|
|
39
|
+
import { textarea } from "./components/css/textarea/textarea.js"
|
|
40
|
+
import { toggleGroup } from "./components/css/toggle-group/toggle-group.js"
|
|
41
|
+
import { tooltip } from "./components/css/tooltip/tooltip.js"
|
|
42
|
+
import { dialog } from "./components/frame/dialog/dialog.js"
|
|
43
|
+
import { errorSummary } from "./components/frame/error-summary/error-summary.js"
|
|
44
|
+
import { computeFieldAttributes } from "./components/frame/field/field-core.js"
|
|
45
|
+
import { popover } from "./components/frame/popover/popover.js"
|
|
46
|
+
import { sessionTimeout } from "./components/frame/session-timeout/session-timeout.js"
|
|
47
|
+
import { suggestion } from "./components/frame/suggestion/suggestion.js"
|
|
48
|
+
import { tabs } from "./components/frame/tabs/tabs.js"
|
|
49
|
+
import { connectionStatus } from "./components/standalone/connection-status/connection-status.js"
|
|
50
|
+
import { toast } from "./components/standalone/toast/toast.js"
|
|
51
|
+
import { setAttributes } from "./dom.js"
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The whole component API in one place.
|
|
55
|
+
*
|
|
56
|
+
* Each component is a function that takes an object of options and returns
|
|
57
|
+
* the attributes you spread onto the element:
|
|
58
|
+
*
|
|
59
|
+
* ```ts
|
|
60
|
+
* import { lt } from "@lo-tek/interfaces"
|
|
61
|
+
*
|
|
62
|
+
* <button {...lt.button({ variant: "secondary" })}>Save draft</button>
|
|
63
|
+
* <input {...lt.input({ type: "email", state: "invalid" })} />
|
|
64
|
+
* <span {...lt.badge({ color: "success" })}>Approved</span>
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* The shape is the same for all of them, so you learn it once. Type `lt.` in
|
|
68
|
+
* the editor to see what exists; type `lt.button.` to see the allowed
|
|
69
|
+
* variants and the guard that validates values from outside.
|
|
70
|
+
*
|
|
71
|
+
* The return values are plain objects. That is why the same API works in
|
|
72
|
+
* React, Astro, Datastar and plain HTML.
|
|
73
|
+
*/
|
|
74
|
+
export const lt = {
|
|
75
|
+
accordion,
|
|
76
|
+
alert,
|
|
77
|
+
avatar,
|
|
78
|
+
badge,
|
|
79
|
+
breadcrumbs,
|
|
80
|
+
button,
|
|
81
|
+
card,
|
|
82
|
+
checkbox,
|
|
83
|
+
/**
|
|
84
|
+
* The bar that says the connection to the server is lost. The server
|
|
85
|
+
* cannot report that itself, so `<lt-connection-status>` creates the
|
|
86
|
+
* content.
|
|
87
|
+
*/
|
|
88
|
+
connectionStatus,
|
|
89
|
+
dialog,
|
|
90
|
+
divider,
|
|
91
|
+
errorText,
|
|
92
|
+
/**
|
|
93
|
+
* The error summary above a form. The server writes the whole box, heading
|
|
94
|
+
* included, and `<lt-error-summary>` only moves focus.
|
|
95
|
+
*/
|
|
96
|
+
errorSummary,
|
|
97
|
+
/**
|
|
98
|
+
* Connects the label, field, help text and error text.
|
|
99
|
+
*
|
|
100
|
+
* ```ts
|
|
101
|
+
* const field = lt.field({ id: "email", required: "text", help: true, error: true, invalid })
|
|
102
|
+
*
|
|
103
|
+
* <label {...field.label}>Email address</label>
|
|
104
|
+
* <input {...lt.input({ type: "email", state: field.state })} {...field.control} />
|
|
105
|
+
* <p {...lt.helpText()} {...field.help}>We send the receipt here.</p>
|
|
106
|
+
* <p {...lt.errorText()} {...field.error}>Enter a valid address.</p>
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* The same calculation `<lt-field>` does, but as data, for markup created
|
|
110
|
+
* with JavaScript. Then no web component is needed.
|
|
111
|
+
*/
|
|
112
|
+
field: computeFieldAttributes,
|
|
113
|
+
/** A group of controls that belong together. Its label is `lt.legend`. */
|
|
114
|
+
fieldset,
|
|
115
|
+
heading,
|
|
116
|
+
fileUpload,
|
|
117
|
+
helpText,
|
|
118
|
+
icon,
|
|
119
|
+
input,
|
|
120
|
+
label,
|
|
121
|
+
legend,
|
|
122
|
+
link,
|
|
123
|
+
list,
|
|
124
|
+
pagination,
|
|
125
|
+
paragraph,
|
|
126
|
+
/**
|
|
127
|
+
* The button and panel of a popover. `<lt-popover>` calculates the
|
|
128
|
+
* position, the server writes the wiring.
|
|
129
|
+
*/
|
|
130
|
+
popover,
|
|
131
|
+
radio,
|
|
132
|
+
search,
|
|
133
|
+
select,
|
|
134
|
+
/**
|
|
135
|
+
* The warning that a signed-in session is about to expire. The countdown
|
|
136
|
+
* runs on the client's clock, so `<lt-session-timeout>` is responsible for
|
|
137
|
+
* the content.
|
|
138
|
+
*/
|
|
139
|
+
sessionTimeout,
|
|
140
|
+
skeleton,
|
|
141
|
+
skipLink,
|
|
142
|
+
progress,
|
|
143
|
+
spinner,
|
|
144
|
+
/** Text only screen readers get. Requires `sr-only.css`. */
|
|
145
|
+
srOnly,
|
|
146
|
+
/**
|
|
147
|
+
* The field and the suggestion list. `<lt-suggestion>` handles the
|
|
148
|
+
* keyboard and the filtering, the server writes the markup.
|
|
149
|
+
*/
|
|
150
|
+
suggestion,
|
|
151
|
+
/** On and off. Named `switchControl` when you import it directly. */
|
|
152
|
+
switch: switchControl,
|
|
153
|
+
/**
|
|
154
|
+
* A tab list with panels. The server writes the links, ids and classes;
|
|
155
|
+
* `<lt-tabs>` adds the roles, the selection and the arrow keys.
|
|
156
|
+
*/
|
|
157
|
+
tabs,
|
|
158
|
+
/**
|
|
159
|
+
* The toast region. Sets `data-ignore-morph`, because `<lt-toast>` creates
|
|
160
|
+
* and removes its messages inside it.
|
|
161
|
+
*/
|
|
162
|
+
toast,
|
|
163
|
+
toggleGroup,
|
|
164
|
+
tooltip,
|
|
165
|
+
table,
|
|
166
|
+
/**
|
|
167
|
+
* The header and button in a sortable column. `aria-sort` on the `<th>` is
|
|
168
|
+
* the state, and the arrow is drawn from it. The sorting is up to the app.
|
|
169
|
+
*/
|
|
170
|
+
tableSort,
|
|
171
|
+
tag,
|
|
172
|
+
textarea,
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Applies an attribute set to an element in the plain DOM.
|
|
176
|
+
*
|
|
177
|
+
* In JSX you spread the object. Without JSX this function does the job,
|
|
178
|
+
* and cleans up what the builder function manages from the previous state.
|
|
179
|
+
* Several sets are passed separately:
|
|
180
|
+
* `lt.setAttributes(field, lt.input(), wiring.control)`.
|
|
181
|
+
*/
|
|
182
|
+
setAttributes,
|
|
183
|
+
|
|
184
|
+
/** The validation states shared by input, textarea and select. */
|
|
185
|
+
states: fieldStates,
|
|
186
|
+
isState: isFieldState,
|
|
187
|
+
/** The ways a required field can be marked. */
|
|
188
|
+
markers: requiredMarkers,
|
|
189
|
+
isMarker: isRequiredMarker,
|
|
190
|
+
} as const
|
|
191
|
+
|
|
192
|
+
export type Lt = typeof lt
|