@lo-tek/interfaces 0.0.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3254 -0
- package/LICENSE +21 -0
- package/README.md +128 -1
- package/agent/astro.md +400 -0
- package/agent/bundles.md +429 -0
- package/agent/datastar.md +409 -0
- package/agent/html.md +388 -0
- package/agent/react.md +440 -0
- package/agent/templates.md +472 -0
- package/core/lotek-core.wasm +0 -0
- package/core/lotek.wasm +0 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/css/accordion/accordion.d.ts +37 -0
- package/dist/components/css/accordion/accordion.d.ts.map +1 -0
- package/dist/components/css/accordion/accordion.js +31 -0
- package/dist/components/css/accordion/accordion.js.map +1 -0
- package/dist/components/css/alert/alert.d.ts +35 -0
- package/dist/components/css/alert/alert.d.ts.map +1 -0
- package/dist/components/css/alert/alert.js +29 -0
- package/dist/components/css/alert/alert.js.map +1 -0
- package/dist/components/css/avatar/avatar.d.ts +40 -0
- package/dist/components/css/avatar/avatar.d.ts.map +1 -0
- package/dist/components/css/avatar/avatar.js +30 -0
- package/dist/components/css/avatar/avatar.js.map +1 -0
- package/dist/components/css/badge/badge.d.ts +24 -0
- package/dist/components/css/badge/badge.d.ts.map +1 -0
- package/dist/components/css/badge/badge.js +24 -0
- package/dist/components/css/badge/badge.js.map +1 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts +26 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.js +24 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/components/css/button/button.d.ts +26 -0
- package/dist/components/css/button/button.d.ts.map +1 -0
- package/dist/components/css/button/button.js +25 -0
- package/dist/components/css/button/button.js.map +1 -0
- package/dist/components/css/card/card.d.ts +36 -0
- package/dist/components/css/card/card.d.ts.map +1 -0
- package/dist/components/css/card/card.js +28 -0
- package/dist/components/css/card/card.js.map +1 -0
- package/dist/components/css/checkbox/checkbox.d.ts +32 -0
- package/dist/components/css/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/css/checkbox/checkbox.js +27 -0
- package/dist/components/css/checkbox/checkbox.js.map +1 -0
- package/dist/components/css/divider/divider.d.ts +29 -0
- package/dist/components/css/divider/divider.d.ts.map +1 -0
- package/dist/components/css/divider/divider.js +23 -0
- package/dist/components/css/divider/divider.js.map +1 -0
- package/dist/components/css/error-text/error-text.d.ts +24 -0
- package/dist/components/css/error-text/error-text.d.ts.map +1 -0
- package/dist/components/css/error-text/error-text.js +18 -0
- package/dist/components/css/error-text/error-text.js.map +1 -0
- package/dist/components/css/fieldset/fieldset.d.ts +55 -0
- package/dist/components/css/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/css/fieldset/fieldset.js +39 -0
- package/dist/components/css/fieldset/fieldset.js.map +1 -0
- package/dist/components/css/file-upload/file-upload.d.ts +41 -0
- package/dist/components/css/file-upload/file-upload.d.ts.map +1 -0
- package/dist/components/css/file-upload/file-upload.js +32 -0
- package/dist/components/css/file-upload/file-upload.js.map +1 -0
- package/dist/components/css/heading/heading.d.ts +29 -0
- package/dist/components/css/heading/heading.d.ts.map +1 -0
- package/dist/components/css/heading/heading.js +23 -0
- package/dist/components/css/heading/heading.js.map +1 -0
- package/dist/components/css/help-text/help-text.d.ts +24 -0
- package/dist/components/css/help-text/help-text.d.ts.map +1 -0
- package/dist/components/css/help-text/help-text.js +23 -0
- package/dist/components/css/help-text/help-text.js.map +1 -0
- package/dist/components/css/icon/icon.d.ts +34 -0
- package/dist/components/css/icon/icon.d.ts.map +1 -0
- package/dist/components/css/icon/icon.js +25 -0
- package/dist/components/css/icon/icon.js.map +1 -0
- package/dist/components/css/input/input.d.ts +40 -0
- package/dist/components/css/input/input.d.ts.map +1 -0
- package/dist/components/css/input/input.js +45 -0
- package/dist/components/css/input/input.js.map +1 -0
- package/dist/components/css/label/label.d.ts +33 -0
- package/dist/components/css/label/label.d.ts.map +1 -0
- package/dist/components/css/label/label.js +23 -0
- package/dist/components/css/label/label.js.map +1 -0
- package/dist/components/css/link/link.d.ts +28 -0
- package/dist/components/css/link/link.d.ts.map +1 -0
- package/dist/components/css/link/link.js +20 -0
- package/dist/components/css/link/link.js.map +1 -0
- package/dist/components/css/list/list.d.ts +31 -0
- package/dist/components/css/list/list.d.ts.map +1 -0
- package/dist/components/css/list/list.js +25 -0
- package/dist/components/css/list/list.js.map +1 -0
- package/dist/components/css/pagination/pagination.d.ts +27 -0
- package/dist/components/css/pagination/pagination.d.ts.map +1 -0
- package/dist/components/css/pagination/pagination.js +25 -0
- package/dist/components/css/pagination/pagination.js.map +1 -0
- package/dist/components/css/paragraph/paragraph.d.ts +36 -0
- package/dist/components/css/paragraph/paragraph.d.ts.map +1 -0
- package/dist/components/css/paragraph/paragraph.js +26 -0
- package/dist/components/css/paragraph/paragraph.js.map +1 -0
- package/dist/components/css/progress/progress.d.ts +53 -0
- package/dist/components/css/progress/progress.d.ts.map +1 -0
- package/dist/components/css/progress/progress.js +38 -0
- package/dist/components/css/progress/progress.js.map +1 -0
- package/dist/components/css/radio/radio.d.ts +32 -0
- package/dist/components/css/radio/radio.d.ts.map +1 -0
- package/dist/components/css/radio/radio.js +27 -0
- package/dist/components/css/radio/radio.js.map +1 -0
- package/dist/components/css/search/search.d.ts +34 -0
- package/dist/components/css/search/search.d.ts.map +1 -0
- package/dist/components/css/search/search.js +32 -0
- package/dist/components/css/search/search.js.map +1 -0
- package/dist/components/css/select/select.d.ts +40 -0
- package/dist/components/css/select/select.d.ts.map +1 -0
- package/dist/components/css/select/select.js +31 -0
- package/dist/components/css/select/select.js.map +1 -0
- package/dist/components/css/shared.d.ts +90 -0
- package/dist/components/css/shared.d.ts.map +1 -0
- package/dist/components/css/shared.js +167 -0
- package/dist/components/css/shared.js.map +1 -0
- package/dist/components/css/skeleton/skeleton.d.ts +29 -0
- package/dist/components/css/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/css/skeleton/skeleton.js +23 -0
- package/dist/components/css/skeleton/skeleton.js.map +1 -0
- package/dist/components/css/skip-link/skip-link.d.ts +18 -0
- package/dist/components/css/skip-link/skip-link.d.ts.map +1 -0
- package/dist/components/css/skip-link/skip-link.js +16 -0
- package/dist/components/css/skip-link/skip-link.js.map +1 -0
- package/dist/components/css/spinner/spinner.d.ts +33 -0
- package/dist/components/css/spinner/spinner.d.ts.map +1 -0
- package/dist/components/css/spinner/spinner.js +25 -0
- package/dist/components/css/spinner/spinner.js.map +1 -0
- package/dist/components/css/sr-only/sr-only.d.ts +17 -0
- package/dist/components/css/sr-only/sr-only.d.ts.map +1 -0
- package/dist/components/css/sr-only/sr-only.js +15 -0
- package/dist/components/css/sr-only/sr-only.js.map +1 -0
- package/dist/components/css/switch/switch.d.ts +37 -0
- package/dist/components/css/switch/switch.d.ts.map +1 -0
- package/dist/components/css/switch/switch.js +29 -0
- package/dist/components/css/switch/switch.js.map +1 -0
- package/dist/components/css/table/table.d.ts +76 -0
- package/dist/components/css/table/table.d.ts.map +1 -0
- package/dist/components/css/table/table.js +59 -0
- package/dist/components/css/table/table.js.map +1 -0
- package/dist/components/css/tag/tag.d.ts +35 -0
- package/dist/components/css/tag/tag.d.ts.map +1 -0
- package/dist/components/css/tag/tag.js +27 -0
- package/dist/components/css/tag/tag.js.map +1 -0
- package/dist/components/css/textarea/textarea.d.ts +23 -0
- package/dist/components/css/textarea/textarea.d.ts.map +1 -0
- package/dist/components/css/textarea/textarea.js +18 -0
- package/dist/components/css/textarea/textarea.js.map +1 -0
- package/dist/components/css/toggle-group/toggle-group.d.ts +31 -0
- package/dist/components/css/toggle-group/toggle-group.d.ts.map +1 -0
- package/dist/components/css/toggle-group/toggle-group.js +29 -0
- package/dist/components/css/toggle-group/toggle-group.js.map +1 -0
- package/dist/components/css/tooltip/tooltip.d.ts +31 -0
- package/dist/components/css/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/css/tooltip/tooltip.js +29 -0
- package/dist/components/css/tooltip/tooltip.js.map +1 -0
- package/dist/components/default-texts.d.ts +35 -0
- package/dist/components/default-texts.d.ts.map +1 -0
- package/dist/components/default-texts.js +35 -0
- package/dist/components/default-texts.js.map +1 -0
- package/dist/components/events.d.ts +77 -0
- package/dist/components/events.d.ts.map +1 -0
- package/dist/components/events.js +3 -0
- package/dist/components/events.js.map +1 -0
- package/dist/components/frame/dialog/dialog.d.ts +122 -0
- package/dist/components/frame/dialog/dialog.d.ts.map +1 -0
- package/dist/components/frame/dialog/dialog.js +112 -0
- package/dist/components/frame/dialog/dialog.js.map +1 -0
- package/dist/components/frame/dialog/lt-dialog.d.ts +104 -0
- package/dist/components/frame/dialog/lt-dialog.d.ts.map +1 -0
- package/dist/components/frame/dialog/lt-dialog.js +431 -0
- package/dist/components/frame/dialog/lt-dialog.js.map +1 -0
- package/dist/components/frame/error-summary/error-summary.d.ts +40 -0
- package/dist/components/frame/error-summary/error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/error-summary.js +32 -0
- package/dist/components/frame/error-summary/error-summary.js.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts +82 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.js +302 -0
- package/dist/components/frame/error-summary/lt-error-summary.js.map +1 -0
- package/dist/components/frame/field/field-core.d.ts +92 -0
- package/dist/components/frame/field/field-core.d.ts.map +1 -0
- package/dist/components/frame/field/field-core.js +63 -0
- package/dist/components/frame/field/field-core.js.map +1 -0
- package/dist/components/frame/field/lt-field.d.ts +173 -0
- package/dist/components/frame/field/lt-field.d.ts.map +1 -0
- package/dist/components/frame/field/lt-field.js +580 -0
- package/dist/components/frame/field/lt-field.js.map +1 -0
- package/dist/components/frame/popover/lt-popover.d.ts +132 -0
- package/dist/components/frame/popover/lt-popover.d.ts.map +1 -0
- package/dist/components/frame/popover/lt-popover.js +490 -0
- package/dist/components/frame/popover/lt-popover.js.map +1 -0
- package/dist/components/frame/popover/popover.d.ts +49 -0
- package/dist/components/frame/popover/popover.d.ts.map +1 -0
- package/dist/components/frame/popover/popover.js +64 -0
- package/dist/components/frame/popover/popover.js.map +1 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +198 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts.map +1 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.js +573 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.js.map +1 -0
- package/dist/components/frame/session-timeout/session-timeout.d.ts +113 -0
- package/dist/components/frame/session-timeout/session-timeout.d.ts.map +1 -0
- package/dist/components/frame/session-timeout/session-timeout.js +101 -0
- package/dist/components/frame/session-timeout/session-timeout.js.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts +361 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.js +1152 -0
- package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -0
- package/dist/components/frame/suggestion/suggestion.d.ts +143 -0
- package/dist/components/frame/suggestion/suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/suggestion.js +127 -0
- package/dist/components/frame/suggestion/suggestion.js.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts +404 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.js +1201 -0
- package/dist/components/frame/tabs/lt-tabs.js.map +1 -0
- package/dist/components/frame/tabs/tabs.d.ts +112 -0
- package/dist/components/frame/tabs/tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/tabs.js +107 -0
- package/dist/components/frame/tabs/tabs.js.map +1 -0
- package/dist/components/host-element.d.ts +135 -0
- package/dist/components/host-element.d.ts.map +1 -0
- package/dist/components/host-element.js +366 -0
- package/dist/components/host-element.js.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts +28 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.js +22 -0
- package/dist/components/standalone/connection-status/connection-status.js.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts +81 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.js +216 -0
- package/dist/components/standalone/connection-status/lt-connection-status.js.map +1 -0
- package/dist/components/standalone/toast/lt-toast.d.ts +109 -0
- package/dist/components/standalone/toast/lt-toast.d.ts.map +1 -0
- package/dist/components/standalone/toast/lt-toast.js +256 -0
- package/dist/components/standalone/toast/lt-toast.js.map +1 -0
- package/dist/components/standalone/toast/toast.d.ts +52 -0
- package/dist/components/standalone/toast/toast.d.ts.map +1 -0
- package/dist/components/standalone/toast/toast.js +42 -0
- package/dist/components/standalone/toast/toast.js.map +1 -0
- package/dist/diagnostics/core.d.ts +137 -0
- package/dist/diagnostics/core.d.ts.map +1 -0
- package/dist/diagnostics/core.js +72 -0
- package/dist/diagnostics/core.js.map +1 -0
- package/dist/diagnostics/default-core.d.ts +10 -0
- package/dist/diagnostics/default-core.d.ts.map +1 -0
- package/dist/diagnostics/default-core.js +72 -0
- package/dist/diagnostics/default-core.js.map +1 -0
- package/dist/diagnostics/index.d.ts +84 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +106 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/dom.d.ts +55 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +162 -0
- package/dist/dom.js.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx/react.d.ts +180 -0
- package/dist/jsx/react.d.ts.map +1 -0
- package/dist/jsx/react.js +2 -0
- package/dist/jsx/react.js.map +1 -0
- package/dist/lotek.css +3617 -0
- package/dist/lt.d.ts +325 -0
- package/dist/lt.d.ts.map +1 -0
- package/dist/lt.js +183 -0
- package/dist/lt.js.map +1 -0
- package/dist/react.d.ts +492 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +296 -0
- package/dist/react.js.map +1 -0
- package/dist/register.d.ts +17 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +35 -0
- package/dist/register.js.map +1 -0
- package/dist/tokens/color.d.ts +43 -0
- package/dist/tokens/color.d.ts.map +1 -0
- package/dist/tokens/color.js +123 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/contract.d.ts +18 -0
- package/dist/tokens/contract.d.ts.map +1 -0
- package/dist/tokens/contract.js +18 -0
- package/dist/tokens/contract.js.map +1 -0
- package/dist/tokens/matrix-cells.d.ts +30 -0
- package/dist/tokens/matrix-cells.d.ts.map +1 -0
- package/dist/tokens/matrix-cells.js +273 -0
- package/dist/tokens/matrix-cells.js.map +1 -0
- package/dist/tokens/matrix.d.ts +18 -0
- package/dist/tokens/matrix.d.ts.map +1 -0
- package/dist/tokens/matrix.js +21 -0
- package/dist/tokens/matrix.js.map +1 -0
- package/dist/tokens/theme-check.d.ts +42 -0
- package/dist/tokens/theme-check.d.ts.map +1 -0
- package/dist/tokens/theme-check.js +10 -0
- package/dist/tokens/theme-check.js.map +1 -0
- package/dist/tokens/theme.d.ts +94 -0
- package/dist/tokens/theme.d.ts.map +1 -0
- package/dist/tokens/theme.js +14 -0
- package/dist/tokens/theme.js.map +1 -0
- package/dist/tokens/tokens.d.ts +122 -0
- package/dist/tokens/tokens.d.ts.map +1 -0
- package/dist/tokens/tokens.js +158 -0
- package/dist/tokens/tokens.js.map +1 -0
- package/dist/vocabulary/classes.d.ts +3 -0
- package/dist/vocabulary/classes.d.ts.map +1 -0
- package/dist/vocabulary/classes.js +1320 -0
- package/dist/vocabulary/classes.js.map +1 -0
- package/dist/vocabulary/elements.d.ts +3 -0
- package/dist/vocabulary/elements.d.ts.map +1 -0
- package/dist/vocabulary/elements.js +410 -0
- package/dist/vocabulary/elements.js.map +1 -0
- package/dist/vocabulary/types.d.ts +175 -0
- package/dist/vocabulary/types.d.ts.map +1 -0
- package/dist/vocabulary/types.js +11 -0
- package/dist/vocabulary/types.js.map +1 -0
- package/dist/wasi-host.d.ts +24 -0
- package/dist/wasi-host.d.ts.map +1 -0
- package/dist/wasi-host.js +140 -0
- package/dist/wasi-host.js.map +1 -0
- package/live-templates.xml +62 -0
- package/manifest/files.json +373 -0
- package/manifest/manifest.json +4965 -0
- package/manifest/manifest.schema.json +513 -0
- package/package.json +398 -5
- package/src/cli.ts +21 -0
- package/src/components/css/accordion/accordion.css +102 -0
- package/src/components/css/accordion/accordion.ts +50 -0
- package/src/components/css/alert/alert.css +53 -0
- package/src/components/css/alert/alert.ts +48 -0
- package/src/components/css/avatar/avatar.css +96 -0
- package/src/components/css/avatar/avatar.ts +57 -0
- package/src/components/css/badge/badge.css +42 -0
- package/src/components/css/badge/badge.ts +43 -0
- package/src/components/css/breadcrumbs/breadcrumbs.css +62 -0
- package/src/components/css/breadcrumbs/breadcrumbs.ts +30 -0
- package/src/components/css/button/button.css +128 -0
- package/src/components/css/button/button.ts +44 -0
- package/src/components/css/card/card.css +65 -0
- package/src/components/css/card/card.ts +50 -0
- package/src/components/css/checkbox/checkbox.css +114 -0
- package/src/components/css/checkbox/checkbox.ts +50 -0
- package/src/components/css/divider/divider.css +38 -0
- package/src/components/css/divider/divider.ts +42 -0
- package/src/components/css/error-text/error-text.css +21 -0
- package/src/components/css/error-text/error-text.ts +37 -0
- package/src/components/css/fieldset/fieldset.css +72 -0
- package/src/components/css/fieldset/fieldset.ts +87 -0
- package/src/components/css/file-upload/file-upload.css +102 -0
- package/src/components/css/file-upload/file-upload.ts +65 -0
- package/src/components/css/heading/heading.css +33 -0
- package/src/components/css/heading/heading.ts +42 -0
- package/src/components/css/help-text/help-text.css +24 -0
- package/src/components/css/help-text/help-text.ts +42 -0
- package/src/components/css/icon/icon.css +20 -0
- package/src/components/css/icon/icon.ts +44 -0
- package/src/components/css/input/input.css +145 -0
- package/src/components/css/input/input.ts +77 -0
- package/src/components/css/label/label.css +42 -0
- package/src/components/css/label/label.ts +51 -0
- package/src/components/css/link/link.css +38 -0
- package/src/components/css/link/link.ts +38 -0
- package/src/components/css/list/list.css +53 -0
- package/src/components/css/list/list.ts +44 -0
- package/src/components/css/pagination/pagination.css +95 -0
- package/src/components/css/pagination/pagination.ts +33 -0
- package/src/components/css/paragraph/paragraph.css +31 -0
- package/src/components/css/paragraph/paragraph.ts +53 -0
- package/src/components/css/progress/progress.css +161 -0
- package/src/components/css/progress/progress.ts +78 -0
- package/src/components/css/radio/radio.css +94 -0
- package/src/components/css/radio/radio.ts +50 -0
- package/src/components/css/search/search.css +50 -0
- package/src/components/css/search/search.ts +56 -0
- package/src/components/css/select/select.css +321 -0
- package/src/components/css/select/select.ts +63 -0
- package/src/components/css/shared.ts +199 -0
- package/src/components/css/skeleton/skeleton.css +62 -0
- package/src/components/css/skeleton/skeleton.ts +43 -0
- package/src/components/css/skip-link/skip-link.css +41 -0
- package/src/components/css/skip-link/skip-link.ts +22 -0
- package/src/components/css/spinner/spinner.css +48 -0
- package/src/components/css/spinner/spinner.ts +48 -0
- package/src/components/css/sr-only/sr-only.css +16 -0
- package/src/components/css/sr-only/sr-only.ts +21 -0
- package/src/components/css/switch/switch.css +105 -0
- package/src/components/css/switch/switch.ts +50 -0
- package/src/components/css/table/table.css +159 -0
- package/src/components/css/table/table.ts +107 -0
- package/src/components/css/tag/tag.css +58 -0
- package/src/components/css/tag/tag.ts +49 -0
- package/src/components/css/textarea/textarea.css +83 -0
- package/src/components/css/textarea/textarea.ts +40 -0
- package/src/components/css/toggle-group/toggle-group.css +92 -0
- package/src/components/css/toggle-group/toggle-group.ts +37 -0
- package/src/components/css/tooltip/tooltip.css +89 -0
- package/src/components/css/tooltip/tooltip.ts +37 -0
- package/src/components/default-texts.ts +34 -0
- package/src/components/events.ts +68 -0
- package/src/components/frame/dialog/dialog.css +306 -0
- package/src/components/frame/dialog/dialog.ts +166 -0
- package/src/components/frame/dialog/lt-dialog.ts +510 -0
- package/src/components/frame/error-summary/error-summary.css +47 -0
- package/src/components/frame/error-summary/error-summary.ts +56 -0
- package/src/components/frame/error-summary/lt-error-summary.ts +344 -0
- package/src/components/frame/field/field-core.ts +152 -0
- package/src/components/frame/field/field.css +17 -0
- package/src/components/frame/field/lt-field.ts +753 -0
- package/src/components/frame/popover/lt-popover.ts +555 -0
- package/src/components/frame/popover/popover.css +50 -0
- package/src/components/frame/popover/popover.ts +102 -0
- package/src/components/frame/session-timeout/lt-session-timeout.ts +681 -0
- package/src/components/frame/session-timeout/session-timeout.css +50 -0
- package/src/components/frame/session-timeout/session-timeout.ts +156 -0
- package/src/components/frame/suggestion/lt-suggestion.ts +1358 -0
- package/src/components/frame/suggestion/suggestion.css +132 -0
- package/src/components/frame/suggestion/suggestion.ts +172 -0
- package/src/components/frame/tabs/lt-tabs.ts +1319 -0
- package/src/components/frame/tabs/tabs.css +128 -0
- package/src/components/frame/tabs/tabs.ts +188 -0
- package/src/components/host-element.ts +400 -0
- package/src/components/standalone/connection-status/connection-status.css +41 -0
- package/src/components/standalone/connection-status/connection-status.ts +41 -0
- package/src/components/standalone/connection-status/lt-connection-status.ts +242 -0
- package/src/components/standalone/toast/lt-toast.ts +300 -0
- package/src/components/standalone/toast/toast.css +78 -0
- package/src/components/standalone/toast/toast.ts +70 -0
- package/src/diagnostics/core.ts +210 -0
- package/src/diagnostics/default-core.ts +81 -0
- package/src/diagnostics/index.ts +150 -0
- package/src/dom.ts +185 -0
- package/src/index.ts +218 -0
- package/src/jsx/react.ts +212 -0
- package/src/lt.ts +192 -0
- package/src/react.ts +411 -0
- package/src/register.ts +43 -0
- package/src/tailwind/tailwind.css +169 -0
- package/src/tokens/boundary.css +104 -0
- package/src/tokens/color-contract.json +231 -0
- package/src/tokens/color.ts +150 -0
- package/src/tokens/contract.ts +24 -0
- package/src/tokens/matrix-cells.ts +375 -0
- package/src/tokens/matrix.ts +32 -0
- package/src/tokens/theme-check.ts +51 -0
- package/src/tokens/theme.ts +104 -0
- package/src/tokens/tokens.css +569 -0
- package/src/tokens/tokens.ts +223 -0
- package/src/vocabulary/classes.ts +1322 -0
- package/src/vocabulary/elements.ts +412 -0
- package/src/vocabulary/types.ts +178 -0
- package/src/wasi-host.ts +155 -0
- package/web-types.json +800 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-pagination {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: var(--lt-pagination-gap, var(--lt-spacing-1));
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
list-style: none;
|
|
11
|
+
font-family: inherit;
|
|
12
|
+
font-size: var(--lt-font-size-m);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/* `span[aria-disabled]` is "Next" on the last page: not a link, but it
|
|
16
|
+
must have the same box, or the row jumps when it is swapped in. */
|
|
17
|
+
.lt-pagination a,
|
|
18
|
+
.lt-pagination button,
|
|
19
|
+
.lt-pagination span[aria-disabled="true"] {
|
|
20
|
+
box-sizing: border-box;
|
|
21
|
+
display: inline-flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
/* 40 pixels in both directions. WCAG 2.2 requires 24, and a number in a
|
|
25
|
+
long row is easy to miss with a finger. */
|
|
26
|
+
min-inline-size: var(--lt-pagination-size, var(--lt-spacing-10));
|
|
27
|
+
min-block-size: var(--lt-pagination-size, var(--lt-spacing-10));
|
|
28
|
+
padding-inline: var(--lt-spacing-2);
|
|
29
|
+
font-family: inherit;
|
|
30
|
+
font-size: inherit;
|
|
31
|
+
line-height: 1;
|
|
32
|
+
color: var(--lt-color-accent-text);
|
|
33
|
+
background: transparent;
|
|
34
|
+
border: 1px solid transparent;
|
|
35
|
+
border-radius: var(--lt-pagination-radius, var(--lt-spacing-1));
|
|
36
|
+
text-decoration: none;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* The current page is excluded, and has its own hover below. Without
|
|
41
|
+
`:not()` this rule won on specificity, and the page number the user is
|
|
42
|
+
on stayed `accent-content` on `accent-surface`, that is 1.09:1. */
|
|
43
|
+
.lt-pagination a:not([aria-current="page"]):hover,
|
|
44
|
+
.lt-pagination button:hover:not(:disabled):not([aria-current="page"]) {
|
|
45
|
+
background: var(--lt-color-accent-surface);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.lt-pagination a:focus-visible,
|
|
49
|
+
.lt-pagination button:focus-visible {
|
|
50
|
+
outline: var(--lt-focus-ring);
|
|
51
|
+
outline-offset: 2px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.lt-pagination [aria-current="page"] {
|
|
55
|
+
color: var(--lt-color-accent-content);
|
|
56
|
+
background: var(--lt-color-accent-fill);
|
|
57
|
+
border-color: var(--lt-color-accent-fill);
|
|
58
|
+
font-weight: var(--lt-font-weight-semibold);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* Like the button: away from `content`, so darker in the light theme and
|
|
62
|
+
lighter in the dark one, and the text on top stays readable. */
|
|
63
|
+
.lt-pagination [aria-current="page"]:hover {
|
|
64
|
+
background: var(--lt-color-accent-text);
|
|
65
|
+
border-color: var(--lt-color-accent-text);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.lt-pagination button:disabled,
|
|
69
|
+
.lt-pagination [aria-disabled="true"],
|
|
70
|
+
.lt-pagination span[aria-disabled="true"] {
|
|
71
|
+
color: var(--lt-color-disabled-text);
|
|
72
|
+
cursor: not-allowed;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* The gap in the row of numbers, as in "1 2 ... 9 10". */
|
|
76
|
+
.lt-pagination__gap {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
justify-content: center;
|
|
80
|
+
min-inline-size: var(--lt-pagination-size, var(--lt-spacing-10));
|
|
81
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* High contrast: the current page differs only by colour. */
|
|
85
|
+
@media (forced-colors: active) {
|
|
86
|
+
/* `:hover` included, or the hover rule beat this one on specificity, and
|
|
87
|
+
the background was forced to `Canvas` under `HighlightText`: white on
|
|
88
|
+
white, or black on black. */
|
|
89
|
+
.lt-pagination [aria-current="page"],
|
|
90
|
+
.lt-pagination [aria-current="page"]:hover {
|
|
91
|
+
background-color: Highlight;
|
|
92
|
+
color: HighlightText;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { attributes } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const PAGINATION_CLASS = "lt-pagination" as const
|
|
4
|
+
/** The gap in the row of numbers, as in "1 2 … 9 10". */
|
|
5
|
+
export const PAGINATION_GAP_CLASS = "lt-pagination__gap" as const
|
|
6
|
+
|
|
7
|
+
export type PaginationAttributes = {
|
|
8
|
+
class: typeof PAGINATION_CLASS
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The attributes for pagination.
|
|
13
|
+
*
|
|
14
|
+
* The class goes on a `<ul>` inside a `<nav aria-label="Pagination">`. Each
|
|
15
|
+
* page is a link with its own address, not a button: the user can then open
|
|
16
|
+
* page three in a new tab, and come back with the back button.
|
|
17
|
+
*
|
|
18
|
+
* The current page is marked with `aria-current="page"`, which both gives
|
|
19
|
+
* the colour and is what the screen reader announces.
|
|
20
|
+
*
|
|
21
|
+
* ```ts
|
|
22
|
+
* <nav aria-label="Pagination">
|
|
23
|
+
* <ul {...pagination()}>…</ul>
|
|
24
|
+
* </nav>
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export const pagination = Object.assign(
|
|
28
|
+
(): PaginationAttributes => attributes({ class: PAGINATION_CLASS }),
|
|
29
|
+
{
|
|
30
|
+
/** The class on the gap in the row of numbers. */
|
|
31
|
+
gap: PAGINATION_GAP_CLASS,
|
|
32
|
+
},
|
|
33
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-paragraph {
|
|
3
|
+
margin: 0;
|
|
4
|
+
font-family: inherit;
|
|
5
|
+
font-size: var(--lt-font-size-m);
|
|
6
|
+
line-height: var(--lt-paragraph-line-height, var(--lt-line-height-article));
|
|
7
|
+
color: var(--lt-color-neutral-text-strong);
|
|
8
|
+
/* Under 75 characters per line. Longer lines make it hard to find the
|
|
9
|
+
start of the next one. */
|
|
10
|
+
max-inline-size: var(--lt-paragraph-width, 70ch);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.lt-paragraph + .lt-paragraph {
|
|
14
|
+
margin-block-start: var(--lt-paragraph-gap, var(--lt-spacing-3));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.lt-paragraph[data-size="small"] {
|
|
18
|
+
font-size: var(--lt-font-size-s);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.lt-paragraph[data-size="large"] {
|
|
22
|
+
font-size: var(--lt-font-size-l);
|
|
23
|
+
line-height: 1.55;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.lt-paragraph[data-variant="lead"] {
|
|
27
|
+
font-size: var(--lt-font-size-l);
|
|
28
|
+
line-height: 1.55;
|
|
29
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const PARAGRAPH_CLASS = "lt-paragraph" as const
|
|
4
|
+
|
|
5
|
+
export const paragraphSizes = ["small", "medium", "large"] as const
|
|
6
|
+
export const paragraphVariants = ["default", "lead"] as const
|
|
7
|
+
|
|
8
|
+
export type ParagraphSize = (typeof paragraphSizes)[number]
|
|
9
|
+
export type ParagraphVariant = (typeof paragraphVariants)[number]
|
|
10
|
+
export type NonDefaultParagraphSize = Exclude<ParagraphSize, "medium">
|
|
11
|
+
export type NonDefaultParagraphVariant = Exclude<ParagraphVariant, "default">
|
|
12
|
+
|
|
13
|
+
export type ParagraphOptions = {
|
|
14
|
+
/** Text size. Default: `medium`. */
|
|
15
|
+
size?: ParagraphSize
|
|
16
|
+
/** `lead` is the introduction right below the heading. Default: `default`. */
|
|
17
|
+
variant?: ParagraphVariant
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ParagraphAttributes = {
|
|
21
|
+
class: typeof PARAGRAPH_CLASS
|
|
22
|
+
"data-size"?: NonDefaultParagraphSize
|
|
23
|
+
"data-variant"?: NonDefaultParagraphVariant
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The attributes for a paragraph.
|
|
28
|
+
*
|
|
29
|
+
* The width is limited to 70 characters. Longer lines make it hard to find
|
|
30
|
+
* the start of the next one, and that is the most common reason a text is
|
|
31
|
+
* hard to read even when the type is large enough.
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* <p {...paragraph({ variant: "lead" })}>A short summary of what the page is about.</p>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const paragraph = Object.assign(
|
|
38
|
+
({
|
|
39
|
+
size = "medium",
|
|
40
|
+
variant = "default",
|
|
41
|
+
}: ParagraphOptions = {}): ParagraphAttributes =>
|
|
42
|
+
attributes({
|
|
43
|
+
class: PARAGRAPH_CLASS,
|
|
44
|
+
"data-size": size === "medium" ? undefined : size,
|
|
45
|
+
"data-variant": variant === "default" ? undefined : variant,
|
|
46
|
+
}),
|
|
47
|
+
{
|
|
48
|
+
sizes: paragraphSizes,
|
|
49
|
+
isSize: createGuard(paragraphSizes),
|
|
50
|
+
variants: paragraphVariants,
|
|
51
|
+
isVariant: createGuard(paragraphVariants),
|
|
52
|
+
},
|
|
53
|
+
)
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
/*
|
|
3
|
+
* The fill colour is carried by `color` on the host, and the filled part
|
|
4
|
+
* reads `currentColor`.
|
|
5
|
+
*
|
|
6
|
+
* The reason is that the filled part has two names,
|
|
7
|
+
* `::-webkit-progress-value` in Chromium and WebKit and
|
|
8
|
+
* `::-moz-progress-bar` in Gecko, and they cannot be in the same selector
|
|
9
|
+
* list: a pseudo-element the engine does not know makes the whole rule
|
|
10
|
+
* invalid. The colour must therefore be decided in one place and
|
|
11
|
+
* inherited, and `currentColor` is the built-in way to do that.
|
|
12
|
+
*
|
|
13
|
+
* `<progress>` has no text, so `color` is free for the job.
|
|
14
|
+
* `data-color` changes `--lt-progress-fill`, which `color` reads.
|
|
15
|
+
*/
|
|
16
|
+
.lt-progress {
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
appearance: none;
|
|
19
|
+
display: block;
|
|
20
|
+
inline-size: 100%;
|
|
21
|
+
block-size: var(--lt-progress-height, var(--lt-spacing-2));
|
|
22
|
+
border: 0;
|
|
23
|
+
/* The track alone is 1.12:1 against the page, and without an edge nobody
|
|
24
|
+
could see how far the bar goes. `neutral-border` holds 3:1. An inward
|
|
25
|
+
`outline` and not a `border`: with `border-box` the border took 2
|
|
26
|
+
pixels of the height, and a 2 pixel bar lost its fill entirely. */
|
|
27
|
+
/* The longhands, since this is not a focus ring: the shorthand with
|
|
28
|
+
`solid` is reserved for `--lt-focus-ring`, and
|
|
29
|
+
`package-css.browser.test.ts` rejects it. */
|
|
30
|
+
outline-width: 1px;
|
|
31
|
+
outline-style: solid;
|
|
32
|
+
outline-color: var(--lt-progress-border, var(--lt-color-neutral-border));
|
|
33
|
+
outline-offset: -1px;
|
|
34
|
+
border-radius: var(--lt-progress-radius, var(--lt-spacing-1));
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
background: var(--lt-progress-track, var(--lt-color-neutral-surface));
|
|
37
|
+
color: var(--lt-progress-fill, var(--lt-color-accent-fill));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.lt-progress[data-color="success"] {
|
|
41
|
+
--lt-progress-fill: var(--lt-color-success-fill);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.lt-progress[data-color="warning"] {
|
|
45
|
+
--lt-progress-fill: var(--lt-color-warning-fill);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.lt-progress[data-color="danger"] {
|
|
49
|
+
--lt-progress-fill: var(--lt-color-danger-fill);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* The track behind, in Chromium and WebKit. */
|
|
53
|
+
.lt-progress::-webkit-progress-bar {
|
|
54
|
+
background: var(--lt-progress-track, var(--lt-color-neutral-surface));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* The filled part. One rule per engine, for the reason at the top. */
|
|
58
|
+
.lt-progress::-webkit-progress-value {
|
|
59
|
+
background: currentColor;
|
|
60
|
+
transition: inline-size 200ms ease-out;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.lt-progress::-moz-progress-bar {
|
|
64
|
+
background: currentColor;
|
|
65
|
+
transition: inline-size 200ms ease-out;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/*
|
|
69
|
+
* Indeterminate: a bar without `value`. We then do not know how far it has
|
|
70
|
+
* come, and a stripe sweeping across it says "in progress" without
|
|
71
|
+
* promising a number.
|
|
72
|
+
*/
|
|
73
|
+
.lt-progress:indeterminate {
|
|
74
|
+
background:
|
|
75
|
+
linear-gradient(90deg, transparent 0%, currentColor 50%, transparent 100%)
|
|
76
|
+
no-repeat,
|
|
77
|
+
var(--lt-progress-track, var(--lt-color-neutral-surface));
|
|
78
|
+
background-size: 40% 100%;
|
|
79
|
+
animation: lt-progress-slide 1400ms ease-in-out infinite;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Without this Chromium and WebKit draw their own track on top of the gradient. */
|
|
83
|
+
.lt-progress:indeterminate::-webkit-progress-bar {
|
|
84
|
+
background: transparent;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.lt-progress:indeterminate::-moz-progress-bar {
|
|
88
|
+
background: transparent;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@keyframes lt-progress-slide {
|
|
92
|
+
from {
|
|
93
|
+
background-position: -40% 0;
|
|
94
|
+
}
|
|
95
|
+
to {
|
|
96
|
+
background-position: 140% 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* As in the spinner: slower rather than still. An indicator that stands
|
|
101
|
+
still no longer says that something is going on. */
|
|
102
|
+
@media (prefers-reduced-motion: reduce) {
|
|
103
|
+
.lt-progress:indeterminate {
|
|
104
|
+
animation-duration: 4200ms;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.lt-progress::-webkit-progress-value {
|
|
108
|
+
transition: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.lt-progress::-moz-progress-bar {
|
|
112
|
+
transition: none;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/*
|
|
117
|
+
* High contrast: custom colours are overridden, so the filled part must
|
|
118
|
+
* take its colour from the system colours. `Highlight` is the same as
|
|
119
|
+
* selection elsewhere in the system, and the edge brings back the shape
|
|
120
|
+
* when the background becomes `Canvas`.
|
|
121
|
+
*/
|
|
122
|
+
@media (forced-colors: active) {
|
|
123
|
+
.lt-progress,
|
|
124
|
+
.lt-progress[data-color] {
|
|
125
|
+
--lt-progress-fill: Highlight;
|
|
126
|
+
|
|
127
|
+
/* The same inward edge as otherwise, in the system text colour. A
|
|
128
|
+
`border` would have taken 2 pixels of the height, see above. */
|
|
129
|
+
outline-color: CanvasText;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/*
|
|
133
|
+
* The variable above is not enough for the filled part. It reads
|
|
134
|
+
* `currentColor`, and the mode forces the background back to `Canvas`
|
|
135
|
+
* when the value is not a system colour, so the bar looked empty
|
|
136
|
+
* whatever the `value`. The system colour must be on the pseudo-element
|
|
137
|
+
* itself.
|
|
138
|
+
*/
|
|
139
|
+
.lt-progress::-webkit-progress-value {
|
|
140
|
+
background: Highlight;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.lt-progress::-moz-progress-bar {
|
|
144
|
+
background: Highlight;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/*
|
|
148
|
+
* The stripe in an indeterminate bar is a gradient, and the mode removes
|
|
149
|
+
* gradients. Without the exception an empty frame was left, and nothing
|
|
150
|
+
* said that something was going on. The colours are the system's, so
|
|
151
|
+
* the user's choice still applies.
|
|
152
|
+
*/
|
|
153
|
+
.lt-progress:indeterminate {
|
|
154
|
+
forced-color-adjust: none;
|
|
155
|
+
background:
|
|
156
|
+
linear-gradient(90deg, Canvas 0%, Highlight 50%, Canvas 100%) no-repeat,
|
|
157
|
+
Canvas;
|
|
158
|
+
background-size: 40% 100%;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const PROGRESS_CLASS = "lt-progress" as const
|
|
4
|
+
|
|
5
|
+
export const progressColors = ["success", "warning", "danger"] as const
|
|
6
|
+
|
|
7
|
+
export type ProgressColor = (typeof progressColors)[number]
|
|
8
|
+
|
|
9
|
+
export type ProgressOptions = {
|
|
10
|
+
/** How far it has come. Leave it out, and the bar is indeterminate. */
|
|
11
|
+
value?: number
|
|
12
|
+
/** What counts as full. Default: `100`. */
|
|
13
|
+
max?: number
|
|
14
|
+
/** What the number means. The default is the accent colour, meaning "this is in progress". */
|
|
15
|
+
color?: ProgressColor
|
|
16
|
+
/** What is in progress. Becomes `aria-label`, so the bar has a name. */
|
|
17
|
+
label?: string
|
|
18
|
+
/**
|
|
19
|
+
* How far it has come, in words. Becomes `aria-valuetext`, which the
|
|
20
|
+
* screen reader reads instead of the percentage: "Step 3 of 7" says more
|
|
21
|
+
* than "43 percent", and `max` is rarely announced.
|
|
22
|
+
*/
|
|
23
|
+
valueText?: string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type ProgressAttributes = {
|
|
27
|
+
class: typeof PROGRESS_CLASS
|
|
28
|
+
value?: string
|
|
29
|
+
max: string
|
|
30
|
+
"data-color"?: ProgressColor
|
|
31
|
+
"aria-label"?: string
|
|
32
|
+
"aria-valuetext"?: string
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* The attributes for a progress bar on a `<progress>`.
|
|
37
|
+
*
|
|
38
|
+
* The element has the semantics built in: the browser exposes it as
|
|
39
|
+
* `role="progressbar"` and announces how far it has come. You need neither a
|
|
40
|
+
* role, `aria-valuenow` nor `aria-valuemax`.
|
|
41
|
+
*
|
|
42
|
+
* Leave out `value`, and the bar becomes indeterminate: "something is going
|
|
43
|
+
* on, we do not know for how long". That is the same as `lt.spinner()` says,
|
|
44
|
+
* so choose one of them.
|
|
45
|
+
*
|
|
46
|
+
* ```ts
|
|
47
|
+
* <progress {...progress({ value: 3, max: 7, label: "Step 3 of 7" })} />
|
|
48
|
+
* ```
|
|
49
|
+
*
|
|
50
|
+
* `max` defaults to 100 and is always written out, against the rule that a
|
|
51
|
+
* default gives no attribute. The reason is that the rule is about
|
|
52
|
+
* appearance, where the CSS already has the answer. `max` is semantics, and
|
|
53
|
+
* HTML's own default is `1`: a `<progress value="40">` without `max` shows a
|
|
54
|
+
* full bar, without anything saying so.
|
|
55
|
+
*/
|
|
56
|
+
export const progress = Object.assign(
|
|
57
|
+
({
|
|
58
|
+
value,
|
|
59
|
+
max = 100,
|
|
60
|
+
color,
|
|
61
|
+
label,
|
|
62
|
+
valueText,
|
|
63
|
+
}: ProgressOptions = {}): ProgressAttributes =>
|
|
64
|
+
attributes({
|
|
65
|
+
class: PROGRESS_CLASS,
|
|
66
|
+
// The numbers are sent out as strings, like the rest of the return
|
|
67
|
+
// values: that is the HTML form, and it is what `setAttributes` accepts.
|
|
68
|
+
value: value === undefined ? undefined : String(value),
|
|
69
|
+
max: String(max),
|
|
70
|
+
"data-color": color,
|
|
71
|
+
"aria-label": label,
|
|
72
|
+
"aria-valuetext": valueText,
|
|
73
|
+
}),
|
|
74
|
+
{
|
|
75
|
+
colors: progressColors,
|
|
76
|
+
isColor: createGuard(progressColors),
|
|
77
|
+
},
|
|
78
|
+
)
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-radio {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
appearance: none;
|
|
5
|
+
flex: none;
|
|
6
|
+
display: inline-block;
|
|
7
|
+
inline-size: var(--lt-radio-size, var(--lt-spacing-5));
|
|
8
|
+
block-size: var(--lt-radio-size, var(--lt-spacing-5));
|
|
9
|
+
margin: 0;
|
|
10
|
+
background-color: var(--lt-color-neutral-canvas);
|
|
11
|
+
border: 1px solid var(--lt-color-neutral-border);
|
|
12
|
+
border-radius: 50%;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Without `:not(:disabled)`. It raised the specificity above the states
|
|
17
|
+
below, so the mouse removed both the error border and the border of a
|
|
18
|
+
selected button. The rules for selected, disabled and invalid come
|
|
19
|
+
after this one and win on order. */
|
|
20
|
+
.lt-radio:hover {
|
|
21
|
+
border-color: var(--lt-color-neutral-border-strong);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.lt-radio:focus-visible {
|
|
25
|
+
outline: var(--lt-focus-ring);
|
|
26
|
+
outline-offset: 2px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* The dot is a gradient and not an image, so it takes its colour from the
|
|
30
|
+
token directly and needs no separate variant for the dark theme. */
|
|
31
|
+
.lt-radio:checked {
|
|
32
|
+
background-color: var(--lt-color-accent-fill);
|
|
33
|
+
border-color: var(--lt-color-accent-fill);
|
|
34
|
+
background-image: radial-gradient(
|
|
35
|
+
circle at center,
|
|
36
|
+
var(--lt-color-accent-content) 0 32%,
|
|
37
|
+
transparent 34%
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.lt-radio:disabled {
|
|
42
|
+
background-color: var(--lt-color-disabled-surface);
|
|
43
|
+
border-color: var(--lt-color-disabled-surface);
|
|
44
|
+
cursor: not-allowed;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.lt-radio:disabled:checked {
|
|
48
|
+
background-color: var(--lt-color-disabled-text);
|
|
49
|
+
border-color: var(--lt-color-disabled-text);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.lt-radio[data-state="invalid"] {
|
|
53
|
+
border-color: var(--lt-color-danger-text);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.lt-radio[data-state="invalid"]:focus-visible {
|
|
57
|
+
outline-color: var(--lt-color-danger-text);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.lt-radio[data-state="success"] {
|
|
61
|
+
border-color: var(--lt-color-success-text);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Disabled wins over a state. `[data-state]` used to come after
|
|
65
|
+
`:disabled` with the same specificity, and an invalid field in a form
|
|
66
|
+
that was disabled during submission looked red, not disabled. */
|
|
67
|
+
.lt-radio:disabled[data-state] {
|
|
68
|
+
background-color: var(--lt-color-disabled-surface);
|
|
69
|
+
border-color: var(--lt-color-disabled-surface);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.lt-radio:disabled:checked[data-state] {
|
|
73
|
+
background-color: var(--lt-color-disabled-text);
|
|
74
|
+
border-color: var(--lt-color-disabled-text);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.lt-radio-row {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: flex-start;
|
|
80
|
+
gap: var(--lt-spacing-2);
|
|
81
|
+
line-height: var(--lt-line-height-default);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/* High contrast: the dot is a gradient, and gradients are removed in the
|
|
85
|
+
mode. The browser's own radio button is drawn correctly in every
|
|
86
|
+
theme. */
|
|
87
|
+
@media (forced-colors: active) {
|
|
88
|
+
.lt-radio,
|
|
89
|
+
.lt-radio:checked {
|
|
90
|
+
appearance: auto;
|
|
91
|
+
background-image: none;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import {
|
|
2
|
+
attributes,
|
|
3
|
+
type FieldState,
|
|
4
|
+
fieldStates,
|
|
5
|
+
isFieldState,
|
|
6
|
+
type NonDefaultFieldState,
|
|
7
|
+
} from "../shared.js"
|
|
8
|
+
|
|
9
|
+
export const RADIO_CLASS = "lt-radio" as const
|
|
10
|
+
/** The row that holds the button and the text next to each other. */
|
|
11
|
+
export const RADIO_ROW_CLASS = "lt-radio-row" as const
|
|
12
|
+
|
|
13
|
+
export type RadioOptions = {
|
|
14
|
+
/** Validation state. Default: `default`. */
|
|
15
|
+
state?: FieldState
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export type RadioAttributes = {
|
|
19
|
+
class: typeof RADIO_CLASS
|
|
20
|
+
type: "radio"
|
|
21
|
+
"data-state"?: NonDefaultFieldState
|
|
22
|
+
"aria-invalid"?: "true"
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The attributes for a radio button.
|
|
27
|
+
*
|
|
28
|
+
* All the buttons in a group must have the same `name`. That connection is
|
|
29
|
+
* what lets only one be selected, and lets the arrow keys move between them.
|
|
30
|
+
* You set `name` yourself, since only you know what the group is called.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* <input {...radio()} name="delivery" value="post" />
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export const radio = Object.assign(
|
|
37
|
+
({ state = "default" }: RadioOptions = {}): RadioAttributes =>
|
|
38
|
+
attributes({
|
|
39
|
+
class: RADIO_CLASS,
|
|
40
|
+
type: "radio" as const,
|
|
41
|
+
"data-state": state === "default" ? undefined : state,
|
|
42
|
+
"aria-invalid": state === "invalid" ? ("true" as const) : undefined,
|
|
43
|
+
}),
|
|
44
|
+
{
|
|
45
|
+
/** The class on the row around the button and the text. */
|
|
46
|
+
row: RADIO_ROW_CLASS,
|
|
47
|
+
states: fieldStates,
|
|
48
|
+
isState: isFieldState,
|
|
49
|
+
},
|
|
50
|
+
)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
@import "../input/input.css";
|
|
2
|
+
|
|
3
|
+
@layer lotek {
|
|
4
|
+
/*
|
|
5
|
+
* Both classes in the selector, not just .lt-search.
|
|
6
|
+
*
|
|
7
|
+
* .lt-input sets padding with the shorthand, and .lt-search only
|
|
8
|
+
* padding-inline-start. With equal specificity the order the stylesheets
|
|
9
|
+
* load in decides, and if the consumer imports input.css last, the room
|
|
10
|
+
* for the icon disappears. With both classes the rule wins in any order.
|
|
11
|
+
*/
|
|
12
|
+
.lt-input.lt-search {
|
|
13
|
+
padding-inline-start: var(--lt-search-icon-space, var(--lt-spacing-10));
|
|
14
|
+
background-image: var(--lt-icon-search);
|
|
15
|
+
background-repeat: no-repeat;
|
|
16
|
+
background-position: left var(--lt-spacing-3) center;
|
|
17
|
+
background-size: var(--lt-search-icon-size, var(--lt-spacing-5));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.lt-search:dir(rtl) {
|
|
21
|
+
background-position: right var(--lt-spacing-3) center;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/* The browser's own cross in a type="search" field. Safari and Chrome draw
|
|
25
|
+
it differently, and Firefox not at all. */
|
|
26
|
+
.lt-search::-webkit-search-cancel-button {
|
|
27
|
+
cursor: pointer;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.lt-search-row {
|
|
31
|
+
display: flex;
|
|
32
|
+
align-items: stretch;
|
|
33
|
+
gap: var(--lt-spacing-2);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.lt-search-row .lt-search {
|
|
37
|
+
flex: 1 1 auto;
|
|
38
|
+
min-inline-size: 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/* High contrast: the magnifying glass is painted into the image with a
|
|
42
|
+
fixed colour, and can become invisible. It is better to remove it and
|
|
43
|
+
give the room back. */
|
|
44
|
+
@media (forced-colors: active) {
|
|
45
|
+
.lt-input.lt-search {
|
|
46
|
+
background-image: none;
|
|
47
|
+
padding-inline-start: var(--lt-spacing-3);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|