@lo-tek/interfaces 0.0.0-stage → 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 +129 -2
- 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 +404 -4
- 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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../../../src/components/css/tag/tag.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,EAAG,QAAiB,CAAA;AAE1C,eAAO,MAAM,WAAW,gCAAiC,CAAA;AAEzD,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAA;AACrD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC,UAAU,EAAE,SAAS,CAAC,CAAA;AAEjE,MAAM,MAAM,UAAU,GAAG;IACvB,oDAAoD;IACpD,OAAO,CAAC,EAAE,UAAU,CAAA;IACpB,mEAAmE;IACnE,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,OAAO,SAAS,CAAA;IACvB,cAAc,CAAC,EAAE,oBAAoB,CAAA;IACrC,iBAAiB,CAAC,EAAE,EAAE,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,GAAG,8BACwB,UAAU,KAAQ,aAAa;;;CAUtE,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js";
|
|
2
|
+
export const TAG_CLASS = "lt-tag";
|
|
3
|
+
export const tagVariants = ["outline", "filled"];
|
|
4
|
+
/**
|
|
5
|
+
* The attributes for a tag.
|
|
6
|
+
*
|
|
7
|
+
* A tag labels content: keywords on an article, selected filters above a
|
|
8
|
+
* list. If it says what state something is in, [Badge](../badge/badge.js)
|
|
9
|
+
* is right instead.
|
|
10
|
+
*
|
|
11
|
+
* `selectable` gives hover and a focus ring, but makes nothing pressable.
|
|
12
|
+
* The element must be a `<button>`, and you set `aria-pressed` yourself,
|
|
13
|
+
* since only you know whether the tag is selected.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* <button {...tag({ selectable: true })} aria-pressed="true">Housing benefit</button>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export const tag = Object.assign(({ variant = "outline", selectable } = {}) => attributes({
|
|
20
|
+
class: TAG_CLASS,
|
|
21
|
+
"data-variant": variant === "outline" ? undefined : variant,
|
|
22
|
+
"data-selectable": selectable ? "" : undefined,
|
|
23
|
+
}), {
|
|
24
|
+
variants: tagVariants,
|
|
25
|
+
isVariant: createGuard(tagVariants),
|
|
26
|
+
});
|
|
27
|
+
//# sourceMappingURL=tag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../../../src/components/css/tag/tag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAEtD,MAAM,CAAC,MAAM,SAAS,GAAG,QAAiB,CAAA;AAE1C,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAA;AAkBzD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAC9B,CAAC,EAAE,OAAO,GAAG,SAAS,EAAE,UAAU,KAAiB,EAAE,EAAiB,EAAE,CACtE,UAAU,CAAC;IACT,KAAK,EAAE,SAAS;IAChB,cAAc,EAAE,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO;IAC3D,iBAAiB,EAAE,UAAU,CAAC,CAAC,CAAE,EAAY,CAAC,CAAC,CAAC,SAAS;CAC1D,CAAC,EACJ;IACE,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,WAAW,CAAC,WAAW,CAAC;CACpC,CACF,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type FieldState, type NonDefaultFieldState } from "../shared.js";
|
|
2
|
+
export declare const TEXTAREA_CLASS: "lt-textarea";
|
|
3
|
+
export type TextareaOptions = {
|
|
4
|
+
/** Validation state. Default: `default`. */
|
|
5
|
+
state?: FieldState;
|
|
6
|
+
};
|
|
7
|
+
export type TextareaAttributes = {
|
|
8
|
+
class: typeof TEXTAREA_CLASS;
|
|
9
|
+
"data-state"?: NonDefaultFieldState;
|
|
10
|
+
"aria-invalid"?: "true";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The attributes for a multi-line text field.
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* <textarea {...textarea({ state: "invalid" })} />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare const textarea: (({ state }?: TextareaOptions) => TextareaAttributes) & {
|
|
20
|
+
states: readonly ["default", "invalid", "success"];
|
|
21
|
+
isState: (value: string) => value is "default" | "invalid" | "success";
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=textarea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.d.ts","sourceRoot":"","sources":["../../../../src/components/css/textarea/textarea.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EAGf,KAAK,oBAAoB,EAC1B,MAAM,cAAc,CAAA;AAErB,eAAO,MAAM,cAAc,EAAG,aAAsB,CAAA;AAEpD,MAAM,MAAM,eAAe,GAAG;IAC5B,4CAA4C;IAC5C,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,OAAO,cAAc,CAAA;IAC5B,YAAY,CAAC,EAAE,oBAAoB,CAAA;IACnC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,gBACK,eAAe,KAAQ,kBAAkB;;;CAUlE,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { attributes, fieldStates, isFieldState, } from "../shared.js";
|
|
2
|
+
export const TEXTAREA_CLASS = "lt-textarea";
|
|
3
|
+
/**
|
|
4
|
+
* The attributes for a multi-line text field.
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* <textarea {...textarea({ state: "invalid" })} />
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export const textarea = Object.assign(({ state = "default" } = {}) => attributes({
|
|
11
|
+
class: TEXTAREA_CLASS,
|
|
12
|
+
"data-state": state === "default" ? undefined : state,
|
|
13
|
+
"aria-invalid": state === "invalid" ? "true" : undefined,
|
|
14
|
+
}), {
|
|
15
|
+
states: fieldStates,
|
|
16
|
+
isState: isFieldState,
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=textarea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"textarea.js","sourceRoot":"","sources":["../../../../src/components/css/textarea/textarea.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAEV,WAAW,EACX,YAAY,GAEb,MAAM,cAAc,CAAA;AAErB,MAAM,CAAC,MAAM,cAAc,GAAG,aAAsB,CAAA;AAapD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CACnC,CAAC,EAAE,KAAK,GAAG,SAAS,KAAsB,EAAE,EAAsB,EAAE,CAClE,UAAU,CAAC;IACT,KAAK,EAAE,cAAc;IACrB,YAAY,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK;IACrD,cAAc,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAE,MAAgB,CAAC,CAAC,CAAC,SAAS;CACpE,CAAC,EACJ;IACE,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,YAAY;CACtB,CACF,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const TOGGLE_GROUP_CLASS: "lt-toggle-group";
|
|
2
|
+
/** The label around each option. */
|
|
3
|
+
export declare const TOGGLE_GROUP_OPTION_CLASS: "lt-toggle-group__option";
|
|
4
|
+
export type ToggleGroupAttributes = {
|
|
5
|
+
class: typeof TOGGLE_GROUP_CLASS;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The attributes for a group where one option is selected at a time.
|
|
9
|
+
*
|
|
10
|
+
* The group is radio buttons in disguise. Each option is a `<label>` with an
|
|
11
|
+
* `<input type="radio">` inside, visually shrunk away. You then keep the
|
|
12
|
+
* arrow keys, `FormData` and the screen reader saying "2 of 3" without
|
|
13
|
+
* writing any of it again.
|
|
14
|
+
*
|
|
15
|
+
* If the choices are actions rather than a setting, such as "bold, italic,
|
|
16
|
+
* underline", buttons with `aria-pressed` belong there instead.
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* <fieldset {...toggleGroup()}>
|
|
20
|
+
* <legend class="lt-sr-only">View</legend>
|
|
21
|
+
* <label class={toggleGroup.option}>
|
|
22
|
+
* <input type="radio" name="view" value="list" checked /> List
|
|
23
|
+
* </label>
|
|
24
|
+
* </fieldset>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const toggleGroup: (() => ToggleGroupAttributes) & {
|
|
28
|
+
/** The class on the label around each option. */
|
|
29
|
+
option: "lt-toggle-group__option";
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=toggle-group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.d.ts","sourceRoot":"","sources":["../../../../src/components/css/toggle-group/toggle-group.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,kBAAkB,EAAG,iBAA0B,CAAA;AAC5D,oCAAoC;AACpC,eAAO,MAAM,yBAAyB,EAAG,yBAAkC,CAAA;AAE3E,MAAM,MAAM,qBAAqB,GAAG;IAClC,KAAK,EAAE,OAAO,kBAAkB,CAAA;CACjC,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,WAAW,SAClB,qBAAqB;IAEvB,iDAAiD;;CAGpD,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { attributes } from "../shared.js";
|
|
2
|
+
export const TOGGLE_GROUP_CLASS = "lt-toggle-group";
|
|
3
|
+
/** The label around each option. */
|
|
4
|
+
export const TOGGLE_GROUP_OPTION_CLASS = "lt-toggle-group__option";
|
|
5
|
+
/**
|
|
6
|
+
* The attributes for a group where one option is selected at a time.
|
|
7
|
+
*
|
|
8
|
+
* The group is radio buttons in disguise. Each option is a `<label>` with an
|
|
9
|
+
* `<input type="radio">` inside, visually shrunk away. You then keep the
|
|
10
|
+
* arrow keys, `FormData` and the screen reader saying "2 of 3" without
|
|
11
|
+
* writing any of it again.
|
|
12
|
+
*
|
|
13
|
+
* If the choices are actions rather than a setting, such as "bold, italic,
|
|
14
|
+
* underline", buttons with `aria-pressed` belong there instead.
|
|
15
|
+
*
|
|
16
|
+
* ```ts
|
|
17
|
+
* <fieldset {...toggleGroup()}>
|
|
18
|
+
* <legend class="lt-sr-only">View</legend>
|
|
19
|
+
* <label class={toggleGroup.option}>
|
|
20
|
+
* <input type="radio" name="view" value="list" checked /> List
|
|
21
|
+
* </label>
|
|
22
|
+
* </fieldset>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export const toggleGroup = Object.assign(() => attributes({ class: TOGGLE_GROUP_CLASS }), {
|
|
26
|
+
/** The class on the label around each option. */
|
|
27
|
+
option: TOGGLE_GROUP_OPTION_CLASS,
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=toggle-group.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle-group.js","sourceRoot":"","sources":["../../../../src/components/css/toggle-group/toggle-group.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAA0B,CAAA;AAC5D,oCAAoC;AACpC,MAAM,CAAC,MAAM,yBAAyB,GAAG,yBAAkC,CAAA;AAM3E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CACtC,GAA0B,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,EACtE;IACE,iDAAiD;IACjD,MAAM,EAAE,yBAAyB;CAClC,CACF,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const TOOLTIP_CLASS: "lt-tooltip";
|
|
2
|
+
/** The bubble with the text. */
|
|
3
|
+
export declare const TOOLTIP_BUBBLE_CLASS: "lt-tooltip__bubble";
|
|
4
|
+
export type TooltipAttributes = {
|
|
5
|
+
class: typeof TOOLTIP_CLASS;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The attributes for the wrapper around a trigger and a tooltip bubble.
|
|
9
|
+
*
|
|
10
|
+
* The bubble shows on hover and on focus. The focus part is not optional: a
|
|
11
|
+
* bubble that only comes with the mouse does not exist for keyboard users.
|
|
12
|
+
*
|
|
13
|
+
* The text in the bubble must be connected to the trigger with
|
|
14
|
+
* `aria-describedby`. Without it the bubble is just something that appears
|
|
15
|
+
* on screen, and is never announced.
|
|
16
|
+
*
|
|
17
|
+
* Use it for something extra, never for something the user must have. On a
|
|
18
|
+
* touch screen there is neither hover nor focus before something is tapped.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* <span {...tooltip()}>
|
|
22
|
+
* <button aria-describedby="hint">Archive</button>
|
|
23
|
+
* <span class={tooltip.bubble} role="tooltip" id="hint">Moves it to the archive</span>
|
|
24
|
+
* </span>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare const tooltip: (() => TooltipAttributes) & {
|
|
28
|
+
/** The class on the bubble with the text. */
|
|
29
|
+
bubble: "lt-tooltip__bubble";
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/css/tooltip/tooltip.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAAG,YAAqB,CAAA;AAClD,gCAAgC;AAChC,eAAO,MAAM,oBAAoB,EAAG,oBAA6B,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,SACd,iBAAiB;IAEnB,6CAA6C;;CAGhD,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { attributes } from "../shared.js";
|
|
2
|
+
export const TOOLTIP_CLASS = "lt-tooltip";
|
|
3
|
+
/** The bubble with the text. */
|
|
4
|
+
export const TOOLTIP_BUBBLE_CLASS = "lt-tooltip__bubble";
|
|
5
|
+
/**
|
|
6
|
+
* The attributes for the wrapper around a trigger and a tooltip bubble.
|
|
7
|
+
*
|
|
8
|
+
* The bubble shows on hover and on focus. The focus part is not optional: a
|
|
9
|
+
* bubble that only comes with the mouse does not exist for keyboard users.
|
|
10
|
+
*
|
|
11
|
+
* The text in the bubble must be connected to the trigger with
|
|
12
|
+
* `aria-describedby`. Without it the bubble is just something that appears
|
|
13
|
+
* on screen, and is never announced.
|
|
14
|
+
*
|
|
15
|
+
* Use it for something extra, never for something the user must have. On a
|
|
16
|
+
* touch screen there is neither hover nor focus before something is tapped.
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* <span {...tooltip()}>
|
|
20
|
+
* <button aria-describedby="hint">Archive</button>
|
|
21
|
+
* <span class={tooltip.bubble} role="tooltip" id="hint">Moves it to the archive</span>
|
|
22
|
+
* </span>
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export const tooltip = Object.assign(() => attributes({ class: TOOLTIP_CLASS }), {
|
|
26
|
+
/** The class on the bubble with the text. */
|
|
27
|
+
bubble: TOOLTIP_BUBBLE_CLASS,
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=tooltip.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../../src/components/css/tooltip/tooltip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,MAAM,CAAC,MAAM,aAAa,GAAG,YAAqB,CAAA;AAClD,gCAAgC;AAChC,MAAM,CAAC,MAAM,oBAAoB,GAAG,oBAA6B,CAAA;AAMjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAClC,GAAsB,EAAE,CAAC,UAAU,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC,EAC7D;IACE,6CAA6C;IAC7C,MAAM,EAAE,oBAAoB;CAC7B,CACF,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every text the package itself writes into the page when nobody has given
|
|
3
|
+
* it another one.
|
|
4
|
+
*
|
|
5
|
+
* LO-TEK has almost no text: the renderer writes the text, in its own
|
|
6
|
+
* language. What is left here are the defaults for text a component creates
|
|
7
|
+
* itself, and each of them can be replaced. How is noted next to each one,
|
|
8
|
+
* and the same is in the table on the documentation page about translation.
|
|
9
|
+
*
|
|
10
|
+
* The texts live here and not in the components, so there is one place to
|
|
11
|
+
* read them. `scripts/check-texts.ts` fails the build on a user-facing text
|
|
12
|
+
* that is in a component and not here, and requires each of them to be in
|
|
13
|
+
* the table on the translation page.
|
|
14
|
+
*
|
|
15
|
+
* The texts in CSS, such as " (required)", cannot import anything. They are
|
|
16
|
+
* read from an `--lt-` variable with the text as the fallback, and
|
|
17
|
+
* `check-texts.ts` requires that.
|
|
18
|
+
*/
|
|
19
|
+
export declare const DEFAULT_TEXTS: {
|
|
20
|
+
/** `aria-label` on the `<lt-toast>` region. Replaced with `label`. */
|
|
21
|
+
readonly toastRegion: "Notifications";
|
|
22
|
+
/** The close button in each message. Replaced with `close-label`. */
|
|
23
|
+
readonly toastClose: "Close message";
|
|
24
|
+
/** `<lt-connection-status>` when the connection is lost. Replaced with `offline-text`. */
|
|
25
|
+
readonly connectionOffline: "No connection. What you type is not being saved.";
|
|
26
|
+
/** `<lt-connection-status>` when it comes back. Replaced with `online-text`. */
|
|
27
|
+
readonly connectionOnline: "Connection restored.";
|
|
28
|
+
/** The match count in `<lt-suggestion>` with no matches. Replaced with `count-none`. */
|
|
29
|
+
readonly suggestionNone: "No matches";
|
|
30
|
+
/** The match count with one match. Replaced with `count-one`. */
|
|
31
|
+
readonly suggestionOne: "One match";
|
|
32
|
+
/** The match count otherwise. `{n}` is the number. Replaced with `count-other`. */
|
|
33
|
+
readonly suggestionOther: "{n} matches";
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=default-texts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-texts.d.ts","sourceRoot":"","sources":["../../src/components/default-texts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,aAAa;IACxB,sEAAsE;;IAEtE,qEAAqE;;IAErE,0FAA0F;;IAE1F,gFAAgF;;IAEhF,wFAAwF;;IAExF,iEAAiE;;IAEjE,mFAAmF;;CAE3E,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every text the package itself writes into the page when nobody has given
|
|
3
|
+
* it another one.
|
|
4
|
+
*
|
|
5
|
+
* LO-TEK has almost no text: the renderer writes the text, in its own
|
|
6
|
+
* language. What is left here are the defaults for text a component creates
|
|
7
|
+
* itself, and each of them can be replaced. How is noted next to each one,
|
|
8
|
+
* and the same is in the table on the documentation page about translation.
|
|
9
|
+
*
|
|
10
|
+
* The texts live here and not in the components, so there is one place to
|
|
11
|
+
* read them. `scripts/check-texts.ts` fails the build on a user-facing text
|
|
12
|
+
* that is in a component and not here, and requires each of them to be in
|
|
13
|
+
* the table on the translation page.
|
|
14
|
+
*
|
|
15
|
+
* The texts in CSS, such as " (required)", cannot import anything. They are
|
|
16
|
+
* read from an `--lt-` variable with the text as the fallback, and
|
|
17
|
+
* `check-texts.ts` requires that.
|
|
18
|
+
*/
|
|
19
|
+
export const DEFAULT_TEXTS = {
|
|
20
|
+
/** `aria-label` on the `<lt-toast>` region. Replaced with `label`. */
|
|
21
|
+
toastRegion: "Notifications",
|
|
22
|
+
/** The close button in each message. Replaced with `close-label`. */
|
|
23
|
+
toastClose: "Close message",
|
|
24
|
+
/** `<lt-connection-status>` when the connection is lost. Replaced with `offline-text`. */
|
|
25
|
+
connectionOffline: "No connection. What you type is not being saved.",
|
|
26
|
+
/** `<lt-connection-status>` when it comes back. Replaced with `online-text`. */
|
|
27
|
+
connectionOnline: "Connection restored.",
|
|
28
|
+
/** The match count in `<lt-suggestion>` with no matches. Replaced with `count-none`. */
|
|
29
|
+
suggestionNone: "No matches",
|
|
30
|
+
/** The match count with one match. Replaced with `count-one`. */
|
|
31
|
+
suggestionOne: "One match",
|
|
32
|
+
/** The match count otherwise. `{n}` is the number. Replaced with `count-other`. */
|
|
33
|
+
suggestionOther: "{n} matches",
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=default-texts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-texts.js","sourceRoot":"","sources":["../../src/components/default-texts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,sEAAsE;IACtE,WAAW,EAAE,eAAe;IAC5B,qEAAqE;IACrE,UAAU,EAAE,eAAe;IAC3B,0FAA0F;IAC1F,iBAAiB,EAAE,kDAAkD;IACrE,gFAAgF;IAChF,gBAAgB,EAAE,sBAAsB;IACxC,wFAAwF;IACxF,cAAc,EAAE,YAAY;IAC5B,iEAAiE;IACjE,aAAa,EAAE,WAAW;IAC1B,mFAAmF;IACnF,eAAe,EAAE,aAAa;CACtB,CAAA"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { LtDialog } from "./frame/dialog/lt-dialog.js";
|
|
2
|
+
import type { LtErrorSummary } from "./frame/error-summary/lt-error-summary.js";
|
|
3
|
+
import type { LtField } from "./frame/field/lt-field.js";
|
|
4
|
+
import type { LtPopover } from "./frame/popover/lt-popover.js";
|
|
5
|
+
import type { LtSessionTimeout } from "./frame/session-timeout/lt-session-timeout.js";
|
|
6
|
+
import type { LtSuggestion } from "./frame/suggestion/lt-suggestion.js";
|
|
7
|
+
import type { LtTabs } from "./frame/tabs/lt-tabs.js";
|
|
8
|
+
import type { LtConnectionStatus } from "./standalone/connection-status/lt-connection-status.js";
|
|
9
|
+
import type { LtToast } from "./standalone/toast/lt-toast.js";
|
|
10
|
+
/**
|
|
11
|
+
* The events the web components dispatch, with `detail` as the component
|
|
12
|
+
* sends it. All of them bubble, and come out of a shadow root.
|
|
13
|
+
* `HTMLElementEventMap` and `DocumentEventMap` are extended with them, so
|
|
14
|
+
* `addEventListener("dialog-toggle", …)` gives `event.detail.open` as
|
|
15
|
+
* `boolean` on any element and on `document`.
|
|
16
|
+
*
|
|
17
|
+
* `HTMLElementTagNameMap` is extended with the elements, so
|
|
18
|
+
* `querySelector("lt-dialog")` gives `LtDialog | null`. The map is here,
|
|
19
|
+
* and not in each component, because every entry to the web components
|
|
20
|
+
* brings this file along: from `/register` alone,
|
|
21
|
+
* `querySelector("lt-dialog")` was otherwise an `Element`, and the listener
|
|
22
|
+
* on it got `Event` without `detail`.
|
|
23
|
+
*/
|
|
24
|
+
export interface LtEventMap {
|
|
25
|
+
/** `<lt-tabs>`: The user selected a tab. `index` counts from 0. */
|
|
26
|
+
"tab-select": CustomEvent<{
|
|
27
|
+
index: number;
|
|
28
|
+
}>;
|
|
29
|
+
/** `<lt-popover>`: The user opened or closed the panel, or `show()`, `hide()` or `toggle()` was called. Setting `open` as a property or attribute dispatches no event. */
|
|
30
|
+
"popover-toggle": CustomEvent<{
|
|
31
|
+
open: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
/** `<lt-suggestion>`: The user chose a suggestion. `label` is the text, `value` the code from `data-value`, or the text when the option has none. The field also gets `input` and `change`, as if the user had typed it. */
|
|
34
|
+
"suggestion-select": CustomEvent<{
|
|
35
|
+
value: string;
|
|
36
|
+
label: string;
|
|
37
|
+
}>;
|
|
38
|
+
/** `<lt-dialog>`: The dialog opened or closed. `returnValue` is the value of the button that closed it, or an empty string. */
|
|
39
|
+
"dialog-toggle": CustomEvent<{
|
|
40
|
+
open: boolean;
|
|
41
|
+
returnValue: string;
|
|
42
|
+
}>;
|
|
43
|
+
/** `<lt-toast>`: A message was closed, by the user, because its time ran out, or with `dismiss()`. `clear()` dispatches none. */
|
|
44
|
+
"toast-dismiss": CustomEvent<null>;
|
|
45
|
+
/** `<lt-session-timeout>`: The warning opened. */
|
|
46
|
+
"session-warn": CustomEvent<null>;
|
|
47
|
+
/** `<lt-session-timeout>`: The session continues: the user closed the warning with a button other than log out or with Escape, or the app called `extend()`. */
|
|
48
|
+
"session-extend": CustomEvent<null>;
|
|
49
|
+
/** `<lt-session-timeout>`: The user chose to log out. */
|
|
50
|
+
"session-logout": CustomEvent<null>;
|
|
51
|
+
/** `<lt-session-timeout>`: Time is up. */
|
|
52
|
+
"session-expired": CustomEvent<null>;
|
|
53
|
+
/** `<lt-session-timeout>`: The user is active. Dispatched at most once per `activity-interval`, so the app can keep the server session alive. */
|
|
54
|
+
"session-activity": CustomEvent<null>;
|
|
55
|
+
/** `<lt-connection-status>`: The connection is lost. */
|
|
56
|
+
"connection-lost": CustomEvent<null>;
|
|
57
|
+
/** `<lt-connection-status>`: The connection is back. */
|
|
58
|
+
"connection-restored": CustomEvent<null>;
|
|
59
|
+
}
|
|
60
|
+
declare global {
|
|
61
|
+
interface HTMLElementEventMap extends LtEventMap {
|
|
62
|
+
}
|
|
63
|
+
interface DocumentEventMap extends LtEventMap {
|
|
64
|
+
}
|
|
65
|
+
interface HTMLElementTagNameMap {
|
|
66
|
+
"lt-connection-status": LtConnectionStatus;
|
|
67
|
+
"lt-dialog": LtDialog;
|
|
68
|
+
"lt-error-summary": LtErrorSummary;
|
|
69
|
+
"lt-field": LtField;
|
|
70
|
+
"lt-popover": LtPopover;
|
|
71
|
+
"lt-session-timeout": LtSessionTimeout;
|
|
72
|
+
"lt-suggestion": LtSuggestion;
|
|
73
|
+
"lt-tabs": LtTabs;
|
|
74
|
+
"lt-toast": LtToast;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/components/events.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAA;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+CAA+C,CAAA;AACrF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AACrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAA;AAChG,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAE7D;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,UAAU;IACzB,mEAAmE;IACnE,YAAY,EAAE,WAAW,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC5C,0KAA0K;IAC1K,gBAAgB,EAAE,WAAW,CAAC;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC,CAAA;IAChD,4NAA4N;IAC5N,mBAAmB,EAAE,WAAW,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAClE,+HAA+H;IAC/H,eAAe,EAAE,WAAW,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpE,iIAAiI;IACjI,eAAe,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;IAClC,kDAAkD;IAClD,cAAc,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,gKAAgK;IAChK,gBAAgB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;IACnC,yDAAyD;IACzD,gBAAgB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;IACnC,0CAA0C;IAC1C,iBAAiB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;IACpC,iJAAiJ;IACjJ,kBAAkB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;IACrC,wDAAwD;IACxD,iBAAiB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;IACpC,wDAAwD;IACxD,qBAAqB,EAAE,WAAW,CAAC,IAAI,CAAC,CAAA;CACzC;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,mBAAoB,SAAQ,UAAU;KAAG;IACnD,UAAU,gBAAiB,SAAQ,UAAU;KAAG;IAChD,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAA;QAC1C,WAAW,EAAE,QAAQ,CAAA;QACrB,kBAAkB,EAAE,cAAc,CAAA;QAClC,UAAU,EAAE,OAAO,CAAA;QACnB,YAAY,EAAE,SAAS,CAAA;QACvB,oBAAoB,EAAE,gBAAgB,CAAA;QACtC,eAAe,EAAE,YAAY,CAAA;QAC7B,SAAS,EAAE,MAAM,CAAA;QACjB,UAAU,EAAE,OAAO,CAAA;KACpB;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/components/events.ts"],"names":[],"mappings":"AAAA,wFAAwF"}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
export declare const DIALOG_CLASS: "lt-dialog";
|
|
2
|
+
export declare const DIALOG_HEADER_CLASS: "lt-dialog__header";
|
|
3
|
+
export declare const DIALOG_TITLE_CLASS: "lt-dialog__title";
|
|
4
|
+
export declare const DIALOG_SUBTITLE_CLASS: "lt-dialog__subtitle";
|
|
5
|
+
export declare const DIALOG_BODY_CLASS: "lt-dialog__body";
|
|
6
|
+
export declare const DIALOG_FOOTER_CLASS: "lt-dialog__footer";
|
|
7
|
+
/**
|
|
8
|
+
* The colour of the header, and what it means.
|
|
9
|
+
*
|
|
10
|
+
* `neutral` is the default and gives no colour. The four status colours are
|
|
11
|
+
* the same ones the alert uses, and `brand` is the brand colour, for a header
|
|
12
|
+
* that says who is speaking rather than how it went.
|
|
13
|
+
*/
|
|
14
|
+
export declare const dialogColors: readonly ["neutral", "brand", "info", "success", "warning", "danger"];
|
|
15
|
+
export type DialogColor = (typeof dialogColors)[number];
|
|
16
|
+
export type DialogOptions = {
|
|
17
|
+
/** Id of the heading. The dialog takes its name from it with `aria-labelledby`. */
|
|
18
|
+
titleId: string;
|
|
19
|
+
/**
|
|
20
|
+
* The dialog is open. Default: closed.
|
|
21
|
+
*
|
|
22
|
+
* This is the server telling `<lt-dialog>` to show it. If you control the
|
|
23
|
+
* dialog from the browser yourself, with `showModal()`, leave it out: the
|
|
24
|
+
* call throws `InvalidStateError` on a dialog that is already open.
|
|
25
|
+
*/
|
|
26
|
+
open?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Colour of the header. Default: none.
|
|
29
|
+
*
|
|
30
|
+
* The colour applies to `header`, so the header must be in the markup for
|
|
31
|
+
* it to show: `<div {...box.header}>` around the heading. Without a header
|
|
32
|
+
* there is nothing to colour.
|
|
33
|
+
*/
|
|
34
|
+
color?: DialogColor;
|
|
35
|
+
};
|
|
36
|
+
export type DialogAttributes = {
|
|
37
|
+
host: {
|
|
38
|
+
open?: true;
|
|
39
|
+
};
|
|
40
|
+
dialog: {
|
|
41
|
+
class: typeof DIALOG_CLASS;
|
|
42
|
+
"aria-labelledby": string;
|
|
43
|
+
open?: true;
|
|
44
|
+
"data-color"?: Exclude<DialogColor, "neutral">;
|
|
45
|
+
};
|
|
46
|
+
/** The header, holding the heading and an optional subtitle. Optional. */
|
|
47
|
+
header: {
|
|
48
|
+
class: typeof DIALOG_HEADER_CLASS;
|
|
49
|
+
};
|
|
50
|
+
title: {
|
|
51
|
+
class: typeof DIALOG_TITLE_CLASS;
|
|
52
|
+
id: string;
|
|
53
|
+
};
|
|
54
|
+
/** A line below the heading, inside the header. Optional. */
|
|
55
|
+
subtitle: {
|
|
56
|
+
class: typeof DIALOG_SUBTITLE_CLASS;
|
|
57
|
+
};
|
|
58
|
+
body: {
|
|
59
|
+
class: typeof DIALOG_BODY_CLASS;
|
|
60
|
+
};
|
|
61
|
+
footer: {
|
|
62
|
+
class: typeof DIALOG_FOOTER_CLASS;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The attributes for a dialog.
|
|
67
|
+
*
|
|
68
|
+
* Opening a dialog is a call, not an attribute: only `showModal()` moves
|
|
69
|
+
* focus in, keeps focus inside the dialog, closes on Escape and makes the
|
|
70
|
+
* rest of the page inert. A `<dialog open>` in the markup is a box on the page.
|
|
71
|
+
*
|
|
72
|
+
* That is a problem for a server that only sends HTML, since it cannot call
|
|
73
|
+
* anything in the browser. So the server says the dialog is open, and
|
|
74
|
+
* `<lt-dialog>` makes the call.
|
|
75
|
+
*
|
|
76
|
+
* The two `open`s are not the same, and it is worth keeping them apart:
|
|
77
|
+
*
|
|
78
|
+
* - `open` on the **host** is the server saying the dialog should be shown.
|
|
79
|
+
* It is not preserved. If it were, the server could never open the dialog
|
|
80
|
+
* again after the user had closed it once. If the server sends the region
|
|
81
|
+
* again with `open` still set, the dialog opens again. For a dismissal to
|
|
82
|
+
* last, the app must tell the server.
|
|
83
|
+
* - `open` on the **`<dialog>`** is set by the browser itself when
|
|
84
|
+
* `showModal()` is called. It is not in the server's HTML, so a morph
|
|
85
|
+
* removes it, and the component puts it back. The server also writes it
|
|
86
|
+
* when it knows the dialog should be shown: without JavaScript a `<dialog>`
|
|
87
|
+
* without `open` is hidden, and its content does not exist for the reader.
|
|
88
|
+
* With the attribute it stands as a box on the page until the component
|
|
89
|
+
* turns it into a modal.
|
|
90
|
+
*
|
|
91
|
+
* ```ts
|
|
92
|
+
* const box = lt.dialog({ titleId: "delete-title", open: true })
|
|
93
|
+
* ```
|
|
94
|
+
* ```html
|
|
95
|
+
* <lt-dialog {...box.host}>
|
|
96
|
+
* <dialog {...box.dialog}>
|
|
97
|
+
* <h2 {...box.title}>Delete the application?</h2>
|
|
98
|
+
* <div {...box.body}>The application and its attachments will be gone.</div>
|
|
99
|
+
* <form method="dialog" {...box.footer}>
|
|
100
|
+
* <button class="lt-button" value="cancel">Cancel</button>
|
|
101
|
+
* </form>
|
|
102
|
+
* </dialog>
|
|
103
|
+
* </lt-dialog>
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare const dialog: (({ titleId: givenId, open, color, }: DialogOptions) => DialogAttributes) & {
|
|
107
|
+
/** The class on the `<dialog>` itself. */
|
|
108
|
+
dialog: "lt-dialog";
|
|
109
|
+
/** The class on the header, which `color` can colour. */
|
|
110
|
+
header: "lt-dialog__header";
|
|
111
|
+
/** The class on the heading in the dialog. */
|
|
112
|
+
title: "lt-dialog__title";
|
|
113
|
+
/** The class on the subtitle in the header. */
|
|
114
|
+
subtitle: "lt-dialog__subtitle";
|
|
115
|
+
/** The class on the content, which scrolls when the dialog gets too tall. */
|
|
116
|
+
body: "lt-dialog__body";
|
|
117
|
+
/** The class on the row of buttons at the bottom. */
|
|
118
|
+
footer: "lt-dialog__footer";
|
|
119
|
+
colors: readonly ["neutral", "brand", "info", "success", "warning", "danger"];
|
|
120
|
+
isColor: (value: string) => value is "warning" | "info" | "success" | "danger" | "neutral" | "brand";
|
|
121
|
+
};
|
|
122
|
+
//# sourceMappingURL=dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../src/components/frame/dialog/dialog.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,EAAG,WAAoB,CAAA;AAChD,eAAO,MAAM,mBAAmB,EAAG,mBAA4B,CAAA;AAC/D,eAAO,MAAM,kBAAkB,EAAG,kBAA2B,CAAA;AAC7D,eAAO,MAAM,qBAAqB,EAAG,qBAA8B,CAAA;AACnE,eAAO,MAAM,iBAAiB,EAAG,iBAA0B,CAAA;AAC3D,eAAO,MAAM,mBAAmB,EAAG,mBAA4B,CAAA;AAE/D;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,uEAOf,CAAA;AACV,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAA;AAEvD,MAAM,MAAM,aAAa,GAAG;IAC1B,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAA;IACf;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,OAAO,CAAA;IACd;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,WAAW,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE;QACJ,IAAI,CAAC,EAAE,IAAI,CAAA;KACZ,CAAA;IACD,MAAM,EAAE;QACN,KAAK,EAAE,OAAO,YAAY,CAAA;QAC1B,iBAAiB,EAAE,MAAM,CAAA;QACzB,IAAI,CAAC,EAAE,IAAI,CAAA;QACX,YAAY,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,SAAS,CAAC,CAAA;KAC/C,CAAA;IACD,0EAA0E;IAC1E,MAAM,EAAE;QAAE,KAAK,EAAE,OAAO,mBAAmB,CAAA;KAAE,CAAA;IAC7C,KAAK,EAAE;QACL,KAAK,EAAE,OAAO,kBAAkB,CAAA;QAChC,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;IACD,6DAA6D;IAC7D,QAAQ,EAAE;QAAE,KAAK,EAAE,OAAO,qBAAqB,CAAA;KAAE,CAAA;IACjD,IAAI,EAAE;QAAE,KAAK,EAAE,OAAO,iBAAiB,CAAA;KAAE,CAAA;IACzC,MAAM,EAAE;QAAE,KAAK,EAAE,OAAO,mBAAmB,CAAA;KAAE,CAAA;CAC9C,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,eAAO,MAAM,MAAM,wCAKd,aAAa,KAAG,gBAAgB;IAmCjC,0CAA0C;;IAE1C,yDAAyD;;IAEzD,8CAA8C;;IAE9C,+CAA+C;;IAE/C,6EAA6E;;IAE7E,qDAAqD;;;;CAKxD,CAAA"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { attributes, createGuard, idOrFallback } from "../../css/shared.js";
|
|
2
|
+
export const DIALOG_CLASS = "lt-dialog";
|
|
3
|
+
export const DIALOG_HEADER_CLASS = "lt-dialog__header";
|
|
4
|
+
export const DIALOG_TITLE_CLASS = "lt-dialog__title";
|
|
5
|
+
export const DIALOG_SUBTITLE_CLASS = "lt-dialog__subtitle";
|
|
6
|
+
export const DIALOG_BODY_CLASS = "lt-dialog__body";
|
|
7
|
+
export const DIALOG_FOOTER_CLASS = "lt-dialog__footer";
|
|
8
|
+
/**
|
|
9
|
+
* The colour of the header, and what it means.
|
|
10
|
+
*
|
|
11
|
+
* `neutral` is the default and gives no colour. The four status colours are
|
|
12
|
+
* the same ones the alert uses, and `brand` is the brand colour, for a header
|
|
13
|
+
* that says who is speaking rather than how it went.
|
|
14
|
+
*/
|
|
15
|
+
export const dialogColors = [
|
|
16
|
+
"neutral",
|
|
17
|
+
"brand",
|
|
18
|
+
"info",
|
|
19
|
+
"success",
|
|
20
|
+
"warning",
|
|
21
|
+
"danger",
|
|
22
|
+
];
|
|
23
|
+
/**
|
|
24
|
+
* The attributes for a dialog.
|
|
25
|
+
*
|
|
26
|
+
* Opening a dialog is a call, not an attribute: only `showModal()` moves
|
|
27
|
+
* focus in, keeps focus inside the dialog, closes on Escape and makes the
|
|
28
|
+
* rest of the page inert. A `<dialog open>` in the markup is a box on the page.
|
|
29
|
+
*
|
|
30
|
+
* That is a problem for a server that only sends HTML, since it cannot call
|
|
31
|
+
* anything in the browser. So the server says the dialog is open, and
|
|
32
|
+
* `<lt-dialog>` makes the call.
|
|
33
|
+
*
|
|
34
|
+
* The two `open`s are not the same, and it is worth keeping them apart:
|
|
35
|
+
*
|
|
36
|
+
* - `open` on the **host** is the server saying the dialog should be shown.
|
|
37
|
+
* It is not preserved. If it were, the server could never open the dialog
|
|
38
|
+
* again after the user had closed it once. If the server sends the region
|
|
39
|
+
* again with `open` still set, the dialog opens again. For a dismissal to
|
|
40
|
+
* last, the app must tell the server.
|
|
41
|
+
* - `open` on the **`<dialog>`** is set by the browser itself when
|
|
42
|
+
* `showModal()` is called. It is not in the server's HTML, so a morph
|
|
43
|
+
* removes it, and the component puts it back. The server also writes it
|
|
44
|
+
* when it knows the dialog should be shown: without JavaScript a `<dialog>`
|
|
45
|
+
* without `open` is hidden, and its content does not exist for the reader.
|
|
46
|
+
* With the attribute it stands as a box on the page until the component
|
|
47
|
+
* turns it into a modal.
|
|
48
|
+
*
|
|
49
|
+
* ```ts
|
|
50
|
+
* const box = lt.dialog({ titleId: "delete-title", open: true })
|
|
51
|
+
* ```
|
|
52
|
+
* ```html
|
|
53
|
+
* <lt-dialog {...box.host}>
|
|
54
|
+
* <dialog {...box.dialog}>
|
|
55
|
+
* <h2 {...box.title}>Delete the application?</h2>
|
|
56
|
+
* <div {...box.body}>The application and its attachments will be gone.</div>
|
|
57
|
+
* <form method="dialog" {...box.footer}>
|
|
58
|
+
* <button class="lt-button" value="cancel">Cancel</button>
|
|
59
|
+
* </form>
|
|
60
|
+
* </dialog>
|
|
61
|
+
* </lt-dialog>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export const dialog = Object.assign(({ titleId: givenId, open = false, color = "neutral", }) => {
|
|
65
|
+
// The fallback only matters to someone without a type check.
|
|
66
|
+
const titleId = idOrFallback("lt.dialog()", givenId, "titleId");
|
|
67
|
+
return {
|
|
68
|
+
host: attributes({
|
|
69
|
+
open: open ? true : undefined,
|
|
70
|
+
}),
|
|
71
|
+
dialog: attributes({
|
|
72
|
+
class: DIALOG_CLASS,
|
|
73
|
+
"aria-labelledby": titleId,
|
|
74
|
+
/*
|
|
75
|
+
* `open` is in both places when the dialog should be shown, on
|
|
76
|
+
* purpose.
|
|
77
|
+
*
|
|
78
|
+
* Without JavaScript a `<dialog>` without `open` is hidden, so the
|
|
79
|
+
* content the server wanted to show did not exist for the reader. With
|
|
80
|
+
* `open` it stands there as a box on the page, and the component turns
|
|
81
|
+
* it into a real modal with `showModal()` once it gets to run.
|
|
82
|
+
*
|
|
83
|
+
* In React it is also the only thing that matches: the component sets
|
|
84
|
+
* `open` on the `<dialog>` before React hydrates, and when it was not in
|
|
85
|
+
* the server's HTML, React reported a mismatch on every single page load.
|
|
86
|
+
*/
|
|
87
|
+
open: open ? true : undefined,
|
|
88
|
+
"data-color": color === "neutral" ? undefined : color,
|
|
89
|
+
}),
|
|
90
|
+
header: attributes({ class: DIALOG_HEADER_CLASS }),
|
|
91
|
+
title: attributes({ class: DIALOG_TITLE_CLASS, id: titleId }),
|
|
92
|
+
subtitle: attributes({ class: DIALOG_SUBTITLE_CLASS }),
|
|
93
|
+
body: attributes({ class: DIALOG_BODY_CLASS }),
|
|
94
|
+
footer: attributes({ class: DIALOG_FOOTER_CLASS }),
|
|
95
|
+
};
|
|
96
|
+
}, {
|
|
97
|
+
/** The class on the `<dialog>` itself. */
|
|
98
|
+
dialog: DIALOG_CLASS,
|
|
99
|
+
/** The class on the header, which `color` can colour. */
|
|
100
|
+
header: DIALOG_HEADER_CLASS,
|
|
101
|
+
/** The class on the heading in the dialog. */
|
|
102
|
+
title: DIALOG_TITLE_CLASS,
|
|
103
|
+
/** The class on the subtitle in the header. */
|
|
104
|
+
subtitle: DIALOG_SUBTITLE_CLASS,
|
|
105
|
+
/** The class on the content, which scrolls when the dialog gets too tall. */
|
|
106
|
+
body: DIALOG_BODY_CLASS,
|
|
107
|
+
/** The class on the row of buttons at the bottom. */
|
|
108
|
+
footer: DIALOG_FOOTER_CLASS,
|
|
109
|
+
colors: dialogColors,
|
|
110
|
+
isColor: createGuard(dialogColors),
|
|
111
|
+
});
|
|
112
|
+
//# sourceMappingURL=dialog.js.map
|