@lo-tek/interfaces 0.0.0 → 0.38.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 +3389 -0
- package/LICENSE +21 -0
- package/README.md +129 -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 +41 -0
- package/dist/components/default-texts.d.ts.map +1 -0
- package/dist/components/default-texts.js +41 -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 +434 -0
- package/dist/components/frame/dialog/lt-dialog.js.map +1 -0
- package/dist/components/frame/error-summary/error-summary.d.ts +53 -0
- package/dist/components/frame/error-summary/error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/error-summary.js +54 -0
- package/dist/components/frame/error-summary/error-summary.js.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts +93 -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 +408 -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 +600 -0
- package/dist/components/frame/field/lt-field.js.map +1 -0
- package/dist/components/frame/popover/lt-popover.d.ts +136 -0
- package/dist/components/frame/popover/lt-popover.d.ts.map +1 -0
- package/dist/components/frame/popover/lt-popover.js +520 -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 +610 -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 +367 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.js +1171 -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 +426 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.js +1265 -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 +184 -0
- package/dist/components/host-element.d.ts.map +1 -0
- package/dist/components/host-element.js +440 -0
- package/dist/components/host-element.js.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts +32 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.js +26 -0
- package/dist/components/standalone/connection-status/connection-status.js.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts +86 -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 +240 -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 +171 -0
- package/dist/diagnostics/core.d.ts.map +1 -0
- package/dist/diagnostics/core.js +84 -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 +494 -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 +1354 -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 +490 -0
- package/dist/vocabulary/elements.js.map +1 -0
- package/dist/vocabulary/types.d.ts +229 -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 +63 -0
- package/manifest/files.json +373 -0
- package/manifest/manifest.json +5090 -0
- package/manifest/manifest.schema.json +586 -0
- package/package.json +399 -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 +41 -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 +513 -0
- package/src/components/frame/error-summary/error-summary.css +47 -0
- package/src/components/frame/error-summary/error-summary.ts +90 -0
- package/src/components/frame/error-summary/lt-error-summary.ts +458 -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 +790 -0
- package/src/components/frame/popover/lt-popover.ts +586 -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 +715 -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 +1379 -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 +1395 -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 +493 -0
- package/src/components/standalone/connection-status/connection-status.css +41 -0
- package/src/components/standalone/connection-status/connection-status.ts +47 -0
- package/src/components/standalone/connection-status/lt-connection-status.ts +268 -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 +227 -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 +1356 -0
- package/src/vocabulary/elements.ts +492 -0
- package/src/vocabulary/types.ts +228 -0
- package/src/wasi-host.ts +155 -0
- package/web-types.json +800 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { FieldState, RequiredMarker } from "../../css/shared.js";
|
|
2
|
+
import { createFieldId } from "../../css/shared.js";
|
|
3
|
+
export { createFieldId };
|
|
4
|
+
/**
|
|
5
|
+
* Computes the wiring between label, field, help text and error text.
|
|
6
|
+
*
|
|
7
|
+
* This is the one implementation of the accessibility contract in the system.
|
|
8
|
+
* `<lt-field>` applies it to elements already in the DOM, and `lt.field()`
|
|
9
|
+
* returns the same result as data, for whoever writes the markup with
|
|
10
|
+
* JavaScript. Without sharing it, the contract would exist in two places and
|
|
11
|
+
* could drift apart.
|
|
12
|
+
*/
|
|
13
|
+
export type FieldOptions = {
|
|
14
|
+
/**
|
|
15
|
+
* The id of the control. Required.
|
|
16
|
+
*
|
|
17
|
+
* In React it comes from `useId()`. Otherwise the field's name is usually
|
|
18
|
+
* the obvious choice. If you know for certain that the markup is rendered
|
|
19
|
+
* once, call `createFieldId()` yourself.
|
|
20
|
+
*
|
|
21
|
+
* It used to be optional, and the function created one when it was
|
|
22
|
+
* missing. That id is random, so two runs give two different ones, and if
|
|
23
|
+
* the same field is rendered on a server and then in the browser, `for`
|
|
24
|
+
* and `aria-describedby` point to something other than what is there.
|
|
25
|
+
* React reports a mismatch on hydration, and the warning itself says the
|
|
26
|
+
* mismatch is not repaired.
|
|
27
|
+
*
|
|
28
|
+
* The type requires it, and that is not enough on its own: a consumer
|
|
29
|
+
* without TypeScript sees no type. If the id is left out anyway, the
|
|
30
|
+
* function creates one and says so in the console. The field then works,
|
|
31
|
+
* and the developer learns why the id should be given anyway. Without the
|
|
32
|
+
* fallback they got `for=""`, `aria-describedby="undefined-help"` and no
|
|
33
|
+
* wiring at all, which is worse than the unstable id the requirement was
|
|
34
|
+
* meant to remove.
|
|
35
|
+
*/
|
|
36
|
+
id: string;
|
|
37
|
+
/** The field has a help text to connect with `aria-describedby`. */
|
|
38
|
+
help?: boolean;
|
|
39
|
+
/** The field has an error text. It is hidden until the field is invalid. */
|
|
40
|
+
error?: boolean;
|
|
41
|
+
/** A separate id for the help text. Derived from `id` if left out. */
|
|
42
|
+
helpId?: string;
|
|
43
|
+
/** A separate id for the error text. Derived from `id` if left out. */
|
|
44
|
+
errorId?: string;
|
|
45
|
+
/** Marks the label as required. */
|
|
46
|
+
required?: RequiredMarker;
|
|
47
|
+
/** Marks the label as optional. */
|
|
48
|
+
optional?: boolean;
|
|
49
|
+
/** The field is invalid: shows the error text and sets `aria-invalid`. */
|
|
50
|
+
invalid?: boolean;
|
|
51
|
+
/** The control is disabled. */
|
|
52
|
+
disabled?: boolean;
|
|
53
|
+
/** Extra ids to include in `aria-describedby`. */
|
|
54
|
+
describedBy?: string[];
|
|
55
|
+
};
|
|
56
|
+
export type FieldAttributes = {
|
|
57
|
+
label: {
|
|
58
|
+
class: "lt-label";
|
|
59
|
+
for: string;
|
|
60
|
+
"data-required"?: RequiredMarker;
|
|
61
|
+
"data-optional"?: "";
|
|
62
|
+
"aria-disabled"?: "true";
|
|
63
|
+
};
|
|
64
|
+
control: {
|
|
65
|
+
id: string;
|
|
66
|
+
"aria-describedby"?: string;
|
|
67
|
+
"aria-invalid"?: "true";
|
|
68
|
+
"data-state"?: "invalid";
|
|
69
|
+
disabled?: true;
|
|
70
|
+
};
|
|
71
|
+
help: {
|
|
72
|
+
id: string;
|
|
73
|
+
};
|
|
74
|
+
error: {
|
|
75
|
+
id: string;
|
|
76
|
+
hidden?: true;
|
|
77
|
+
};
|
|
78
|
+
/** The state the control should have, for `input()`, `textarea()` and `select()`. */
|
|
79
|
+
state: FieldState;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Joins `aria-describedby` from the help text, the error text and whatever
|
|
83
|
+
* the caller added.
|
|
84
|
+
*
|
|
85
|
+
* The error text is only included when the field is actually invalid.
|
|
86
|
+
* Otherwise `aria-describedby` would point to a hidden element, and screen
|
|
87
|
+
* readers then announce either nothing or something that is not on the
|
|
88
|
+
* screen.
|
|
89
|
+
*/
|
|
90
|
+
export declare function joinDescribedBy(ids: Array<string | undefined | false>): string | undefined;
|
|
91
|
+
export declare function computeFieldAttributes(options: FieldOptions): FieldAttributes;
|
|
92
|
+
//# sourceMappingURL=field-core.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-core.d.ts","sourceRoot":"","sources":["../../../../src/components/frame/field/field-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAc,aAAa,EAAgB,MAAM,qBAAqB,CAAA;AAI7E,OAAO,EAAE,aAAa,EAAE,CAAA;AAExB;;;;;;;;GAQG;AAEH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,EAAE,EAAE,MAAM,CAAA;IACV,oEAAoE;IACpE,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,4EAA4E;IAC5E,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,cAAc,CAAA;IACzB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,kDAAkD;IAClD,WAAW,CAAC,EAAE,MAAM,EAAE,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,EAAE;QACL,KAAK,EAAE,UAAU,CAAA;QACjB,GAAG,EAAE,MAAM,CAAA;QACX,eAAe,CAAC,EAAE,cAAc,CAAA;QAChC,eAAe,CAAC,EAAE,EAAE,CAAA;QACpB,eAAe,CAAC,EAAE,MAAM,CAAA;KACzB,CAAA;IACD,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAA;QACV,kBAAkB,CAAC,EAAE,MAAM,CAAA;QAC3B,cAAc,CAAC,EAAE,MAAM,CAAA;QACvB,YAAY,CAAC,EAAE,SAAS,CAAA;QACxB,QAAQ,CAAC,EAAE,IAAI,CAAA;KAChB,CAAA;IACD,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAA;IACpB,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,IAAI,CAAA;KAAE,CAAA;IACpC,qFAAqF;IACrF,KAAK,EAAE,UAAU,CAAA;CAClB,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC,GACrC,MAAM,GAAG,SAAS,CASpB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,eAAe,CA+C7E"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { attributes, createFieldId, idOrFallback } from "../../css/shared.js";
|
|
2
|
+
// Re-exported here, where it used to live, so consumers that import from
|
|
3
|
+
// `./field-core` do not notice the move.
|
|
4
|
+
export { createFieldId };
|
|
5
|
+
/**
|
|
6
|
+
* Joins `aria-describedby` from the help text, the error text and whatever
|
|
7
|
+
* the caller added.
|
|
8
|
+
*
|
|
9
|
+
* The error text is only included when the field is actually invalid.
|
|
10
|
+
* Otherwise `aria-describedby` would point to a hidden element, and screen
|
|
11
|
+
* readers then announce either nothing or something that is not on the
|
|
12
|
+
* screen.
|
|
13
|
+
*/
|
|
14
|
+
export function joinDescribedBy(ids) {
|
|
15
|
+
const unique = new Set();
|
|
16
|
+
for (const id of ids) {
|
|
17
|
+
if (!id)
|
|
18
|
+
continue;
|
|
19
|
+
for (const part of id.split(/\s+/)) {
|
|
20
|
+
if (part)
|
|
21
|
+
unique.add(part);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return unique.size > 0 ? [...unique].join(" ") : undefined;
|
|
25
|
+
}
|
|
26
|
+
export function computeFieldAttributes(options) {
|
|
27
|
+
const { id: givenId, help = false, error = false, required, optional, invalid = false, disabled = false, describedBy = [], } = options;
|
|
28
|
+
// The fallback is only for callers without a type check. See `idOrFallback`.
|
|
29
|
+
const id = idOrFallback("lt.field()", givenId);
|
|
30
|
+
const helpId = options.helpId ?? `${id}-help`;
|
|
31
|
+
const errorId = options.errorId ?? `${id}-error`;
|
|
32
|
+
return {
|
|
33
|
+
label: attributes({
|
|
34
|
+
class: "lt-label",
|
|
35
|
+
for: id,
|
|
36
|
+
"data-required": required,
|
|
37
|
+
"data-optional": optional && !required ? "" : undefined,
|
|
38
|
+
"aria-disabled": disabled ? "true" : undefined,
|
|
39
|
+
}),
|
|
40
|
+
control: attributes({
|
|
41
|
+
id,
|
|
42
|
+
"aria-describedby": joinDescribedBy([
|
|
43
|
+
help && helpId,
|
|
44
|
+
invalid && error && errorId,
|
|
45
|
+
...describedBy,
|
|
46
|
+
]),
|
|
47
|
+
"aria-invalid": invalid ? "true" : undefined,
|
|
48
|
+
// The colour comes from here, not from input()/textarea()/select().
|
|
49
|
+
// Otherwise both would set aria-invalid, and in templates that write
|
|
50
|
+
// the attributes out literally, such as Astro and plain HTML, it
|
|
51
|
+
// appeared twice.
|
|
52
|
+
"data-state": invalid ? "invalid" : undefined,
|
|
53
|
+
disabled: disabled ? true : undefined,
|
|
54
|
+
}),
|
|
55
|
+
help: attributes({ id: helpId }),
|
|
56
|
+
error: attributes({
|
|
57
|
+
id: errorId,
|
|
58
|
+
hidden: invalid ? undefined : true,
|
|
59
|
+
}),
|
|
60
|
+
state: invalid ? "invalid" : "default",
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=field-core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-core.js","sourceRoot":"","sources":["../../../../src/components/frame/field/field-core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAE7E,yEAAyE;AACzE,yCAAyC;AACzC,OAAO,EAAE,aAAa,EAAE,CAAA;AA6ExB;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC7B,GAAsC;IAEtC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAA;IAChC,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,EAAE;YAAE,SAAQ;QACjB,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,IAAI,IAAI;gBAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC5D,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAAqB;IAC1D,MAAM,EACJ,EAAE,EAAE,OAAO,EACX,IAAI,GAAG,KAAK,EACZ,KAAK,GAAG,KAAK,EACb,QAAQ,EACR,QAAQ,EACR,OAAO,GAAG,KAAK,EACf,QAAQ,GAAG,KAAK,EAChB,WAAW,GAAG,EAAE,GACjB,GAAG,OAAO,CAAA;IAEX,6EAA6E;IAC7E,MAAM,EAAE,GAAG,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAA;IAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,GAAG,EAAE,OAAO,CAAA;IAC7C,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,GAAG,EAAE,QAAQ,CAAA;IAEhD,OAAO;QACL,KAAK,EAAE,UAAU,CAAC;YAChB,KAAK,EAAE,UAAmB;YAC1B,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,QAAQ;YACzB,eAAe,EAAE,QAAQ,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAE,EAAY,CAAC,CAAC,CAAC,SAAS;YAClE,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAE,MAAgB,CAAC,CAAC,CAAC,SAAS;SAC1D,CAAC;QACF,OAAO,EAAE,UAAU,CAAC;YAClB,EAAE;YACF,kBAAkB,EAAE,eAAe,CAAC;gBAClC,IAAI,IAAI,MAAM;gBACd,OAAO,IAAI,KAAK,IAAI,OAAO;gBAC3B,GAAG,WAAW;aACf,CAAC;YACF,cAAc,EAAE,OAAO,CAAC,CAAC,CAAE,MAAgB,CAAC,CAAC,CAAC,SAAS;YACvD,oEAAoE;YACpE,qEAAqE;YACrE,iEAAiE;YACjE,kBAAkB;YAClB,YAAY,EAAE,OAAO,CAAC,CAAC,CAAE,SAAmB,CAAC,CAAC,CAAC,SAAS;YACxD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAE,IAAc,CAAC,CAAC,CAAC,SAAS;SACjD,CAAC;QACF,IAAI,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC;QAChC,KAAK,EAAE,UAAU,CAAC;YAChB,EAAE,EAAE,OAAO;YACX,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,IAAc;SAC9C,CAAC;QACF,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;KACvC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { HostElement } from "../../host-element.js";
|
|
2
|
+
export declare const LT_FIELD_TAG: "lt-field";
|
|
3
|
+
/**
|
|
4
|
+
* The parts the field looks for, as selectors relative to the element. The
|
|
5
|
+
* component finds its parts with these, and the manifest describes them for
|
|
6
|
+
* whoever assembles the markup by hand, so the two cannot say different
|
|
7
|
+
* things.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LT_FIELD_PARTS: {
|
|
10
|
+
readonly label: "label";
|
|
11
|
+
readonly control: "input:not([type='hidden']), textarea, select";
|
|
12
|
+
readonly help: ".lt-help-text";
|
|
13
|
+
readonly error: ".lt-error-text";
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Connects label, control, help text and error text in plain DOM.
|
|
17
|
+
*
|
|
18
|
+
* The component is for markup produced without JavaScript: a Go template, a
|
|
19
|
+
* PHP file, a Razor view or handwritten HTML. When the markup is written with
|
|
20
|
+
* JavaScript, wherever the code runs, `lt.field()` should write the
|
|
21
|
+
* attributes instead, and this element is not needed.
|
|
22
|
+
*
|
|
23
|
+
* The component renders nothing. It used to insert a `<slot>` element into
|
|
24
|
+
* plain DOM, and since the server did not know about it, Datastar's morph
|
|
25
|
+
* removed it on every patch.
|
|
26
|
+
*
|
|
27
|
+
* The template writes what HTML requires for the field to work without
|
|
28
|
+
* JavaScript: `for` on the label and `id` on the control, or the label
|
|
29
|
+
* wrapping the control. The component writes the rest: the ids of the help
|
|
30
|
+
* text and the error text, `aria-describedby`, `aria-invalid` and the
|
|
31
|
+
* classes. If a morph removes them, the component sees it and sets them back.
|
|
32
|
+
*
|
|
33
|
+
* The component never writes an id on the control. Datastar and idiomorph
|
|
34
|
+
* recognise a node by its id, and a control with an id the server did not
|
|
35
|
+
* send is replaced on the next update, along with focus and what the user
|
|
36
|
+
* has typed.
|
|
37
|
+
*
|
|
38
|
+
* The field is invalid when the error text is visible, that is when it has
|
|
39
|
+
* no `hidden`, or when the server has written `aria-invalid` on the control.
|
|
40
|
+
* There is no separate state on the host: a template renders the error text
|
|
41
|
+
* when the field is invalid, and client code toggles `hidden`.
|
|
42
|
+
*/
|
|
43
|
+
export declare class LtField extends HostElement {
|
|
44
|
+
static observedAttributes: readonly ["disabled", "optional", "described-by"];
|
|
45
|
+
private observer?;
|
|
46
|
+
/**
|
|
47
|
+
* The ids the help text and the error text last had, whether they came
|
|
48
|
+
* from the markup or from here, so a patch that removes them gets the same
|
|
49
|
+
* one back and not a new one. `managedIds` is every id the component has
|
|
50
|
+
* ever managed. Together with whether the id still points to an element,
|
|
51
|
+
* that tells them apart from the ids the server put in `aria-describedby`.
|
|
52
|
+
*/
|
|
53
|
+
private lastHelpId?;
|
|
54
|
+
private lastErrorId?;
|
|
55
|
+
private readonly managedIds;
|
|
56
|
+
/**
|
|
57
|
+
* What the component wrote on each control, keyed on the control itself.
|
|
58
|
+
*
|
|
59
|
+
* A `WeakMap` and not a "previous control" property. The memory has to
|
|
60
|
+
* survive the host being disconnected and connected again, as when React
|
|
61
|
+
* moves a field, and the control disappearing and coming back in a patch.
|
|
62
|
+
* A property that was reset in `disconnectedCallback` made the component
|
|
63
|
+
* read its own `aria-invalid="true"` as the server's word after a move, and
|
|
64
|
+
* the field could never become valid again. A `WeakMap` also keeps no
|
|
65
|
+
* detached node alive: when the control is gone for good, so is the memory.
|
|
66
|
+
*/
|
|
67
|
+
private readonly memory;
|
|
68
|
+
private readonly labelMemory;
|
|
69
|
+
/** The `for` the component itself wrote on the label. */
|
|
70
|
+
private readonly forByMe;
|
|
71
|
+
/**
|
|
72
|
+
* Labels where the server wrote a `for` pointing to a different id than
|
|
73
|
+
* the control's. The component rewrites it, but without JavaScript the
|
|
74
|
+
* field had no label, so it must be reported, once. The memory is not
|
|
75
|
+
* reset: after the rewrite the right value is there, and it cannot be told
|
|
76
|
+
* apart from a server that corrected itself.
|
|
77
|
+
*/
|
|
78
|
+
private readonly wrongFor;
|
|
79
|
+
/**
|
|
80
|
+
* The control last time.
|
|
81
|
+
*
|
|
82
|
+
* Enough to see that a server update replaced it because the id changed:
|
|
83
|
+
* Datastar and idiomorph recognise a node by its id, and a new id from the
|
|
84
|
+
* server is a new node to them. That happens when the template builds the
|
|
85
|
+
* id from something that changes between renders, such as a random number
|
|
86
|
+
* or a counter.
|
|
87
|
+
*
|
|
88
|
+
* A reference, not just an entry in `memory`: the replacement is detected
|
|
89
|
+
* by comparing it with the control that is there now, and what the old one
|
|
90
|
+
* contained must be readable after it has left the tree. It keeps one
|
|
91
|
+
* detached node alive until the next `sync()`, on purpose.
|
|
92
|
+
*/
|
|
93
|
+
private lastControl?;
|
|
94
|
+
/** The controls where `data-state` was written by the component. */
|
|
95
|
+
private readonly stateByMe;
|
|
96
|
+
/**
|
|
97
|
+
* The properties mirror the attributes.
|
|
98
|
+
*
|
|
99
|
+
* The state lives in the attribute and not in a field on the class, so what
|
|
100
|
+
* the server sent and what the component thinks are always the same.
|
|
101
|
+
*/
|
|
102
|
+
get disabled(): boolean;
|
|
103
|
+
set disabled(value: boolean);
|
|
104
|
+
get optional(): boolean;
|
|
105
|
+
set optional(value: boolean);
|
|
106
|
+
get describedBy(): string | undefined;
|
|
107
|
+
set describedBy(value: string | undefined);
|
|
108
|
+
connectedCallback(): void;
|
|
109
|
+
disconnectedCallback(): void;
|
|
110
|
+
attributeChangedCallback(): void;
|
|
111
|
+
/**
|
|
112
|
+
* The label the field belongs with.
|
|
113
|
+
*
|
|
114
|
+
* Usually it is inside the element. If it is outside, with `for` pointing
|
|
115
|
+
* to the control, the field is just as well named, and the component
|
|
116
|
+
* connects it the same way. One difference is worth knowing: a label
|
|
117
|
+
* outside is not in what the component observes, so if a patch removes its
|
|
118
|
+
* class, the class does not come back by itself.
|
|
119
|
+
*/
|
|
120
|
+
/**
|
|
121
|
+
* Remembers whether the server wrote a `for` that was not the control's
|
|
122
|
+
* id. What the component itself wrote last does not count.
|
|
123
|
+
*/
|
|
124
|
+
private noteFor;
|
|
125
|
+
private resolveLabel;
|
|
126
|
+
/**
|
|
127
|
+
* The server's word about the control, derived from what is there now
|
|
128
|
+
* compared with what the component itself wrote last.
|
|
129
|
+
*
|
|
130
|
+
* A control the component has never written on holds only the server's
|
|
131
|
+
* word. Otherwise each attribute is the server's if it differs from what
|
|
132
|
+
* the component wrote, and unchanged if it is the same.
|
|
133
|
+
*/
|
|
134
|
+
private serverLabelWord;
|
|
135
|
+
private serverWord;
|
|
136
|
+
/**
|
|
137
|
+
* The parts that belong to this field, and not to a field further down.
|
|
138
|
+
*
|
|
139
|
+
* A field can be inside another: a search field in a popover inside the
|
|
140
|
+
* field, or an `<lt-field>` in an `<lt-field>`. `querySelector` over the
|
|
141
|
+
* whole subtree then found the innermost field's control first, and the
|
|
142
|
+
* outer field wrote its wiring on it. The scoping is the same as the one
|
|
143
|
+
* `derivedParts()` in `host-element.ts` uses for the other components.
|
|
144
|
+
*/
|
|
145
|
+
private ownParts;
|
|
146
|
+
private ownPart;
|
|
147
|
+
/**
|
|
148
|
+
* Reports when an update replaced the control because the id from the
|
|
149
|
+
* server changed.
|
|
150
|
+
*
|
|
151
|
+
* The message only comes when the user had something to lose: the old
|
|
152
|
+
* control has left the tree, both had an id from the server, the ids
|
|
153
|
+
* differ, and the old one contained something other than the new one. A
|
|
154
|
+
* server that sends a different field on purpose usually also has a
|
|
155
|
+
* different label or a different `name`; then it stays silent. The
|
|
156
|
+
* comparison is with the new control, not with the old one's
|
|
157
|
+
* `defaultValue`: a `<select>` always has a selected option without any
|
|
158
|
+
* being `defaultSelected`, and a server that sends back the text the user
|
|
159
|
+
* typed has lost nothing.
|
|
160
|
+
*/
|
|
161
|
+
private warnAboutReplacedControl;
|
|
162
|
+
/**
|
|
163
|
+
* Did the old control contain something other than the new one?
|
|
164
|
+
*
|
|
165
|
+
* A checkbox and a radio button have the same `value` either way, so there
|
|
166
|
+
* the checked state is what counts. A `<select>` is compared on the
|
|
167
|
+
* selected options, since `value` is only the first of them.
|
|
168
|
+
*/
|
|
169
|
+
private differs;
|
|
170
|
+
private sync;
|
|
171
|
+
}
|
|
172
|
+
export declare function defineLtField(tagName?: string): void;
|
|
173
|
+
//# sourceMappingURL=lt-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lt-field.d.ts","sourceRoot":"","sources":["../../../../src/components/frame/field/lt-field.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,WAAW,EASZ,MAAM,uBAAuB,CAAA;AAG9B,eAAO,MAAM,YAAY,EAAG,UAAmB,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,cAAc;;;;;CAKjB,CAAA;AA6FV;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,OAAQ,SAAQ,WAAW;IACtC,MAAM,CAAC,kBAAkB,oDAAoD;IAE7E,OAAO,CAAC,QAAQ,CAAC,CAAkB;IACnC;;;;;;OAMG;IACH,OAAO,CAAC,UAAU,CAAC,CAAQ;IAC3B,OAAO,CAAC,WAAW,CAAC,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAoB;IAC/C;;;;;;;;;;OAUG;IACH,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,yDAAyD;IACzD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;IACzD;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;IAClD;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,WAAW,CAAC,CAAa;IACjC,oEAAoE;IACpE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IAEnD;;;;;OAKG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAE1B;IAED,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAE1B;IAED,IAAI,WAAW,IAAI,MAAM,GAAG,SAAS,CAEpC;IAED,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAExC;IAED,iBAAiB,IAAI,IAAI;IAyCzB,oBAAoB,IAAI,IAAI;IAK5B,wBAAwB,IAAI,IAAI;IAIhC;;;;;;;;OAQG;IACH;;;OAGG;IACH,OAAO,CAAC,OAAO;IAMf,OAAO,CAAC,YAAY;IAYpB;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,UAAU;IA2BlB;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ;IAMhB,OAAO,CAAC,OAAO;IAIf;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,wBAAwB;IAyBhC;;;;;;OAMG;IACH,OAAO,CAAC,OAAO;IAqBf,OAAO,CAAC,IAAI;CAsUb;AAED,wBAAgB,aAAa,CAAC,OAAO,GAAE,MAAqB,GAAG,IAAI,CAElE"}
|