@lo-tek/interfaces 0.0.0-stage → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3254 -0
- package/LICENSE +21 -0
- package/README.md +129 -2
- package/agent/astro.md +400 -0
- package/agent/bundles.md +429 -0
- package/agent/datastar.md +409 -0
- package/agent/html.md +388 -0
- package/agent/react.md +440 -0
- package/agent/templates.md +472 -0
- package/core/lotek-core.wasm +0 -0
- package/core/lotek.wasm +0 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/css/accordion/accordion.d.ts +37 -0
- package/dist/components/css/accordion/accordion.d.ts.map +1 -0
- package/dist/components/css/accordion/accordion.js +31 -0
- package/dist/components/css/accordion/accordion.js.map +1 -0
- package/dist/components/css/alert/alert.d.ts +35 -0
- package/dist/components/css/alert/alert.d.ts.map +1 -0
- package/dist/components/css/alert/alert.js +29 -0
- package/dist/components/css/alert/alert.js.map +1 -0
- package/dist/components/css/avatar/avatar.d.ts +40 -0
- package/dist/components/css/avatar/avatar.d.ts.map +1 -0
- package/dist/components/css/avatar/avatar.js +30 -0
- package/dist/components/css/avatar/avatar.js.map +1 -0
- package/dist/components/css/badge/badge.d.ts +24 -0
- package/dist/components/css/badge/badge.d.ts.map +1 -0
- package/dist/components/css/badge/badge.js +24 -0
- package/dist/components/css/badge/badge.js.map +1 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts +26 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.js +24 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/components/css/button/button.d.ts +26 -0
- package/dist/components/css/button/button.d.ts.map +1 -0
- package/dist/components/css/button/button.js +25 -0
- package/dist/components/css/button/button.js.map +1 -0
- package/dist/components/css/card/card.d.ts +36 -0
- package/dist/components/css/card/card.d.ts.map +1 -0
- package/dist/components/css/card/card.js +28 -0
- package/dist/components/css/card/card.js.map +1 -0
- package/dist/components/css/checkbox/checkbox.d.ts +32 -0
- package/dist/components/css/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/css/checkbox/checkbox.js +27 -0
- package/dist/components/css/checkbox/checkbox.js.map +1 -0
- package/dist/components/css/divider/divider.d.ts +29 -0
- package/dist/components/css/divider/divider.d.ts.map +1 -0
- package/dist/components/css/divider/divider.js +23 -0
- package/dist/components/css/divider/divider.js.map +1 -0
- package/dist/components/css/error-text/error-text.d.ts +24 -0
- package/dist/components/css/error-text/error-text.d.ts.map +1 -0
- package/dist/components/css/error-text/error-text.js +18 -0
- package/dist/components/css/error-text/error-text.js.map +1 -0
- package/dist/components/css/fieldset/fieldset.d.ts +55 -0
- package/dist/components/css/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/css/fieldset/fieldset.js +39 -0
- package/dist/components/css/fieldset/fieldset.js.map +1 -0
- package/dist/components/css/file-upload/file-upload.d.ts +41 -0
- package/dist/components/css/file-upload/file-upload.d.ts.map +1 -0
- package/dist/components/css/file-upload/file-upload.js +32 -0
- package/dist/components/css/file-upload/file-upload.js.map +1 -0
- package/dist/components/css/heading/heading.d.ts +29 -0
- package/dist/components/css/heading/heading.d.ts.map +1 -0
- package/dist/components/css/heading/heading.js +23 -0
- package/dist/components/css/heading/heading.js.map +1 -0
- package/dist/components/css/help-text/help-text.d.ts +24 -0
- package/dist/components/css/help-text/help-text.d.ts.map +1 -0
- package/dist/components/css/help-text/help-text.js +23 -0
- package/dist/components/css/help-text/help-text.js.map +1 -0
- package/dist/components/css/icon/icon.d.ts +34 -0
- package/dist/components/css/icon/icon.d.ts.map +1 -0
- package/dist/components/css/icon/icon.js +25 -0
- package/dist/components/css/icon/icon.js.map +1 -0
- package/dist/components/css/input/input.d.ts +40 -0
- package/dist/components/css/input/input.d.ts.map +1 -0
- package/dist/components/css/input/input.js +45 -0
- package/dist/components/css/input/input.js.map +1 -0
- package/dist/components/css/label/label.d.ts +33 -0
- package/dist/components/css/label/label.d.ts.map +1 -0
- package/dist/components/css/label/label.js +23 -0
- package/dist/components/css/label/label.js.map +1 -0
- package/dist/components/css/link/link.d.ts +28 -0
- package/dist/components/css/link/link.d.ts.map +1 -0
- package/dist/components/css/link/link.js +20 -0
- package/dist/components/css/link/link.js.map +1 -0
- package/dist/components/css/list/list.d.ts +31 -0
- package/dist/components/css/list/list.d.ts.map +1 -0
- package/dist/components/css/list/list.js +25 -0
- package/dist/components/css/list/list.js.map +1 -0
- package/dist/components/css/pagination/pagination.d.ts +27 -0
- package/dist/components/css/pagination/pagination.d.ts.map +1 -0
- package/dist/components/css/pagination/pagination.js +25 -0
- package/dist/components/css/pagination/pagination.js.map +1 -0
- package/dist/components/css/paragraph/paragraph.d.ts +36 -0
- package/dist/components/css/paragraph/paragraph.d.ts.map +1 -0
- package/dist/components/css/paragraph/paragraph.js +26 -0
- package/dist/components/css/paragraph/paragraph.js.map +1 -0
- package/dist/components/css/progress/progress.d.ts +53 -0
- package/dist/components/css/progress/progress.d.ts.map +1 -0
- package/dist/components/css/progress/progress.js +38 -0
- package/dist/components/css/progress/progress.js.map +1 -0
- package/dist/components/css/radio/radio.d.ts +32 -0
- package/dist/components/css/radio/radio.d.ts.map +1 -0
- package/dist/components/css/radio/radio.js +27 -0
- package/dist/components/css/radio/radio.js.map +1 -0
- package/dist/components/css/search/search.d.ts +34 -0
- package/dist/components/css/search/search.d.ts.map +1 -0
- package/dist/components/css/search/search.js +32 -0
- package/dist/components/css/search/search.js.map +1 -0
- package/dist/components/css/select/select.d.ts +40 -0
- package/dist/components/css/select/select.d.ts.map +1 -0
- package/dist/components/css/select/select.js +31 -0
- package/dist/components/css/select/select.js.map +1 -0
- package/dist/components/css/shared.d.ts +90 -0
- package/dist/components/css/shared.d.ts.map +1 -0
- package/dist/components/css/shared.js +167 -0
- package/dist/components/css/shared.js.map +1 -0
- package/dist/components/css/skeleton/skeleton.d.ts +29 -0
- package/dist/components/css/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/css/skeleton/skeleton.js +23 -0
- package/dist/components/css/skeleton/skeleton.js.map +1 -0
- package/dist/components/css/skip-link/skip-link.d.ts +18 -0
- package/dist/components/css/skip-link/skip-link.d.ts.map +1 -0
- package/dist/components/css/skip-link/skip-link.js +16 -0
- package/dist/components/css/skip-link/skip-link.js.map +1 -0
- package/dist/components/css/spinner/spinner.d.ts +33 -0
- package/dist/components/css/spinner/spinner.d.ts.map +1 -0
- package/dist/components/css/spinner/spinner.js +25 -0
- package/dist/components/css/spinner/spinner.js.map +1 -0
- package/dist/components/css/sr-only/sr-only.d.ts +17 -0
- package/dist/components/css/sr-only/sr-only.d.ts.map +1 -0
- package/dist/components/css/sr-only/sr-only.js +15 -0
- package/dist/components/css/sr-only/sr-only.js.map +1 -0
- package/dist/components/css/switch/switch.d.ts +37 -0
- package/dist/components/css/switch/switch.d.ts.map +1 -0
- package/dist/components/css/switch/switch.js +29 -0
- package/dist/components/css/switch/switch.js.map +1 -0
- package/dist/components/css/table/table.d.ts +76 -0
- package/dist/components/css/table/table.d.ts.map +1 -0
- package/dist/components/css/table/table.js +59 -0
- package/dist/components/css/table/table.js.map +1 -0
- package/dist/components/css/tag/tag.d.ts +35 -0
- package/dist/components/css/tag/tag.d.ts.map +1 -0
- package/dist/components/css/tag/tag.js +27 -0
- package/dist/components/css/tag/tag.js.map +1 -0
- package/dist/components/css/textarea/textarea.d.ts +23 -0
- package/dist/components/css/textarea/textarea.d.ts.map +1 -0
- package/dist/components/css/textarea/textarea.js +18 -0
- package/dist/components/css/textarea/textarea.js.map +1 -0
- package/dist/components/css/toggle-group/toggle-group.d.ts +31 -0
- package/dist/components/css/toggle-group/toggle-group.d.ts.map +1 -0
- package/dist/components/css/toggle-group/toggle-group.js +29 -0
- package/dist/components/css/toggle-group/toggle-group.js.map +1 -0
- package/dist/components/css/tooltip/tooltip.d.ts +31 -0
- package/dist/components/css/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/css/tooltip/tooltip.js +29 -0
- package/dist/components/css/tooltip/tooltip.js.map +1 -0
- package/dist/components/default-texts.d.ts +35 -0
- package/dist/components/default-texts.d.ts.map +1 -0
- package/dist/components/default-texts.js +35 -0
- package/dist/components/default-texts.js.map +1 -0
- package/dist/components/events.d.ts +77 -0
- package/dist/components/events.d.ts.map +1 -0
- package/dist/components/events.js +3 -0
- package/dist/components/events.js.map +1 -0
- package/dist/components/frame/dialog/dialog.d.ts +122 -0
- package/dist/components/frame/dialog/dialog.d.ts.map +1 -0
- package/dist/components/frame/dialog/dialog.js +112 -0
- package/dist/components/frame/dialog/dialog.js.map +1 -0
- package/dist/components/frame/dialog/lt-dialog.d.ts +104 -0
- package/dist/components/frame/dialog/lt-dialog.d.ts.map +1 -0
- package/dist/components/frame/dialog/lt-dialog.js +431 -0
- package/dist/components/frame/dialog/lt-dialog.js.map +1 -0
- package/dist/components/frame/error-summary/error-summary.d.ts +40 -0
- package/dist/components/frame/error-summary/error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/error-summary.js +32 -0
- package/dist/components/frame/error-summary/error-summary.js.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts +82 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.js +302 -0
- package/dist/components/frame/error-summary/lt-error-summary.js.map +1 -0
- package/dist/components/frame/field/field-core.d.ts +92 -0
- package/dist/components/frame/field/field-core.d.ts.map +1 -0
- package/dist/components/frame/field/field-core.js +63 -0
- package/dist/components/frame/field/field-core.js.map +1 -0
- package/dist/components/frame/field/lt-field.d.ts +173 -0
- package/dist/components/frame/field/lt-field.d.ts.map +1 -0
- package/dist/components/frame/field/lt-field.js +580 -0
- package/dist/components/frame/field/lt-field.js.map +1 -0
- package/dist/components/frame/popover/lt-popover.d.ts +132 -0
- package/dist/components/frame/popover/lt-popover.d.ts.map +1 -0
- package/dist/components/frame/popover/lt-popover.js +490 -0
- package/dist/components/frame/popover/lt-popover.js.map +1 -0
- package/dist/components/frame/popover/popover.d.ts +49 -0
- package/dist/components/frame/popover/popover.d.ts.map +1 -0
- package/dist/components/frame/popover/popover.js +64 -0
- package/dist/components/frame/popover/popover.js.map +1 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +198 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts.map +1 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.js +573 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.js.map +1 -0
- package/dist/components/frame/session-timeout/session-timeout.d.ts +113 -0
- package/dist/components/frame/session-timeout/session-timeout.d.ts.map +1 -0
- package/dist/components/frame/session-timeout/session-timeout.js +101 -0
- package/dist/components/frame/session-timeout/session-timeout.js.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts +361 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.js +1152 -0
- package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -0
- package/dist/components/frame/suggestion/suggestion.d.ts +143 -0
- package/dist/components/frame/suggestion/suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/suggestion.js +127 -0
- package/dist/components/frame/suggestion/suggestion.js.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts +404 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.js +1201 -0
- package/dist/components/frame/tabs/lt-tabs.js.map +1 -0
- package/dist/components/frame/tabs/tabs.d.ts +112 -0
- package/dist/components/frame/tabs/tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/tabs.js +107 -0
- package/dist/components/frame/tabs/tabs.js.map +1 -0
- package/dist/components/host-element.d.ts +135 -0
- package/dist/components/host-element.d.ts.map +1 -0
- package/dist/components/host-element.js +366 -0
- package/dist/components/host-element.js.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts +28 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.js +22 -0
- package/dist/components/standalone/connection-status/connection-status.js.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts +81 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.js +216 -0
- package/dist/components/standalone/connection-status/lt-connection-status.js.map +1 -0
- package/dist/components/standalone/toast/lt-toast.d.ts +109 -0
- package/dist/components/standalone/toast/lt-toast.d.ts.map +1 -0
- package/dist/components/standalone/toast/lt-toast.js +256 -0
- package/dist/components/standalone/toast/lt-toast.js.map +1 -0
- package/dist/components/standalone/toast/toast.d.ts +52 -0
- package/dist/components/standalone/toast/toast.d.ts.map +1 -0
- package/dist/components/standalone/toast/toast.js +42 -0
- package/dist/components/standalone/toast/toast.js.map +1 -0
- package/dist/diagnostics/core.d.ts +137 -0
- package/dist/diagnostics/core.d.ts.map +1 -0
- package/dist/diagnostics/core.js +72 -0
- package/dist/diagnostics/core.js.map +1 -0
- package/dist/diagnostics/default-core.d.ts +10 -0
- package/dist/diagnostics/default-core.d.ts.map +1 -0
- package/dist/diagnostics/default-core.js +72 -0
- package/dist/diagnostics/default-core.js.map +1 -0
- package/dist/diagnostics/index.d.ts +84 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +106 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/dom.d.ts +55 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +162 -0
- package/dist/dom.js.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx/react.d.ts +180 -0
- package/dist/jsx/react.d.ts.map +1 -0
- package/dist/jsx/react.js +2 -0
- package/dist/jsx/react.js.map +1 -0
- package/dist/lotek.css +3617 -0
- package/dist/lt.d.ts +325 -0
- package/dist/lt.d.ts.map +1 -0
- package/dist/lt.js +183 -0
- package/dist/lt.js.map +1 -0
- package/dist/react.d.ts +492 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +296 -0
- package/dist/react.js.map +1 -0
- package/dist/register.d.ts +17 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +35 -0
- package/dist/register.js.map +1 -0
- package/dist/tokens/color.d.ts +43 -0
- package/dist/tokens/color.d.ts.map +1 -0
- package/dist/tokens/color.js +123 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/contract.d.ts +18 -0
- package/dist/tokens/contract.d.ts.map +1 -0
- package/dist/tokens/contract.js +18 -0
- package/dist/tokens/contract.js.map +1 -0
- package/dist/tokens/matrix-cells.d.ts +30 -0
- package/dist/tokens/matrix-cells.d.ts.map +1 -0
- package/dist/tokens/matrix-cells.js +273 -0
- package/dist/tokens/matrix-cells.js.map +1 -0
- package/dist/tokens/matrix.d.ts +18 -0
- package/dist/tokens/matrix.d.ts.map +1 -0
- package/dist/tokens/matrix.js +21 -0
- package/dist/tokens/matrix.js.map +1 -0
- package/dist/tokens/theme-check.d.ts +42 -0
- package/dist/tokens/theme-check.d.ts.map +1 -0
- package/dist/tokens/theme-check.js +10 -0
- package/dist/tokens/theme-check.js.map +1 -0
- package/dist/tokens/theme.d.ts +94 -0
- package/dist/tokens/theme.d.ts.map +1 -0
- package/dist/tokens/theme.js +14 -0
- package/dist/tokens/theme.js.map +1 -0
- package/dist/tokens/tokens.d.ts +122 -0
- package/dist/tokens/tokens.d.ts.map +1 -0
- package/dist/tokens/tokens.js +158 -0
- package/dist/tokens/tokens.js.map +1 -0
- package/dist/vocabulary/classes.d.ts +3 -0
- package/dist/vocabulary/classes.d.ts.map +1 -0
- package/dist/vocabulary/classes.js +1320 -0
- package/dist/vocabulary/classes.js.map +1 -0
- package/dist/vocabulary/elements.d.ts +3 -0
- package/dist/vocabulary/elements.d.ts.map +1 -0
- package/dist/vocabulary/elements.js +410 -0
- package/dist/vocabulary/elements.js.map +1 -0
- package/dist/vocabulary/types.d.ts +175 -0
- package/dist/vocabulary/types.d.ts.map +1 -0
- package/dist/vocabulary/types.js +11 -0
- package/dist/vocabulary/types.js.map +1 -0
- package/dist/wasi-host.d.ts +24 -0
- package/dist/wasi-host.d.ts.map +1 -0
- package/dist/wasi-host.js +140 -0
- package/dist/wasi-host.js.map +1 -0
- package/live-templates.xml +62 -0
- package/manifest/files.json +373 -0
- package/manifest/manifest.json +4965 -0
- package/manifest/manifest.schema.json +513 -0
- package/package.json +404 -4
- package/src/cli.ts +21 -0
- package/src/components/css/accordion/accordion.css +102 -0
- package/src/components/css/accordion/accordion.ts +50 -0
- package/src/components/css/alert/alert.css +53 -0
- package/src/components/css/alert/alert.ts +48 -0
- package/src/components/css/avatar/avatar.css +96 -0
- package/src/components/css/avatar/avatar.ts +57 -0
- package/src/components/css/badge/badge.css +42 -0
- package/src/components/css/badge/badge.ts +43 -0
- package/src/components/css/breadcrumbs/breadcrumbs.css +62 -0
- package/src/components/css/breadcrumbs/breadcrumbs.ts +30 -0
- package/src/components/css/button/button.css +128 -0
- package/src/components/css/button/button.ts +44 -0
- package/src/components/css/card/card.css +65 -0
- package/src/components/css/card/card.ts +50 -0
- package/src/components/css/checkbox/checkbox.css +114 -0
- package/src/components/css/checkbox/checkbox.ts +50 -0
- package/src/components/css/divider/divider.css +38 -0
- package/src/components/css/divider/divider.ts +42 -0
- package/src/components/css/error-text/error-text.css +21 -0
- package/src/components/css/error-text/error-text.ts +37 -0
- package/src/components/css/fieldset/fieldset.css +72 -0
- package/src/components/css/fieldset/fieldset.ts +87 -0
- package/src/components/css/file-upload/file-upload.css +102 -0
- package/src/components/css/file-upload/file-upload.ts +65 -0
- package/src/components/css/heading/heading.css +33 -0
- package/src/components/css/heading/heading.ts +42 -0
- package/src/components/css/help-text/help-text.css +24 -0
- package/src/components/css/help-text/help-text.ts +42 -0
- package/src/components/css/icon/icon.css +20 -0
- package/src/components/css/icon/icon.ts +44 -0
- package/src/components/css/input/input.css +145 -0
- package/src/components/css/input/input.ts +77 -0
- package/src/components/css/label/label.css +42 -0
- package/src/components/css/label/label.ts +51 -0
- package/src/components/css/link/link.css +38 -0
- package/src/components/css/link/link.ts +38 -0
- package/src/components/css/list/list.css +53 -0
- package/src/components/css/list/list.ts +44 -0
- package/src/components/css/pagination/pagination.css +95 -0
- package/src/components/css/pagination/pagination.ts +33 -0
- package/src/components/css/paragraph/paragraph.css +31 -0
- package/src/components/css/paragraph/paragraph.ts +53 -0
- package/src/components/css/progress/progress.css +161 -0
- package/src/components/css/progress/progress.ts +78 -0
- package/src/components/css/radio/radio.css +94 -0
- package/src/components/css/radio/radio.ts +50 -0
- package/src/components/css/search/search.css +50 -0
- package/src/components/css/search/search.ts +56 -0
- package/src/components/css/select/select.css +321 -0
- package/src/components/css/select/select.ts +63 -0
- package/src/components/css/shared.ts +199 -0
- package/src/components/css/skeleton/skeleton.css +62 -0
- package/src/components/css/skeleton/skeleton.ts +43 -0
- package/src/components/css/skip-link/skip-link.css +41 -0
- package/src/components/css/skip-link/skip-link.ts +22 -0
- package/src/components/css/spinner/spinner.css +48 -0
- package/src/components/css/spinner/spinner.ts +48 -0
- package/src/components/css/sr-only/sr-only.css +16 -0
- package/src/components/css/sr-only/sr-only.ts +21 -0
- package/src/components/css/switch/switch.css +105 -0
- package/src/components/css/switch/switch.ts +50 -0
- package/src/components/css/table/table.css +159 -0
- package/src/components/css/table/table.ts +107 -0
- package/src/components/css/tag/tag.css +58 -0
- package/src/components/css/tag/tag.ts +49 -0
- package/src/components/css/textarea/textarea.css +83 -0
- package/src/components/css/textarea/textarea.ts +40 -0
- package/src/components/css/toggle-group/toggle-group.css +92 -0
- package/src/components/css/toggle-group/toggle-group.ts +37 -0
- package/src/components/css/tooltip/tooltip.css +89 -0
- package/src/components/css/tooltip/tooltip.ts +37 -0
- package/src/components/default-texts.ts +34 -0
- package/src/components/events.ts +68 -0
- package/src/components/frame/dialog/dialog.css +306 -0
- package/src/components/frame/dialog/dialog.ts +166 -0
- package/src/components/frame/dialog/lt-dialog.ts +510 -0
- package/src/components/frame/error-summary/error-summary.css +47 -0
- package/src/components/frame/error-summary/error-summary.ts +56 -0
- package/src/components/frame/error-summary/lt-error-summary.ts +344 -0
- package/src/components/frame/field/field-core.ts +152 -0
- package/src/components/frame/field/field.css +17 -0
- package/src/components/frame/field/lt-field.ts +753 -0
- package/src/components/frame/popover/lt-popover.ts +555 -0
- package/src/components/frame/popover/popover.css +50 -0
- package/src/components/frame/popover/popover.ts +102 -0
- package/src/components/frame/session-timeout/lt-session-timeout.ts +681 -0
- package/src/components/frame/session-timeout/session-timeout.css +50 -0
- package/src/components/frame/session-timeout/session-timeout.ts +156 -0
- package/src/components/frame/suggestion/lt-suggestion.ts +1358 -0
- package/src/components/frame/suggestion/suggestion.css +132 -0
- package/src/components/frame/suggestion/suggestion.ts +172 -0
- package/src/components/frame/tabs/lt-tabs.ts +1319 -0
- package/src/components/frame/tabs/tabs.css +128 -0
- package/src/components/frame/tabs/tabs.ts +188 -0
- package/src/components/host-element.ts +400 -0
- package/src/components/standalone/connection-status/connection-status.css +41 -0
- package/src/components/standalone/connection-status/connection-status.ts +41 -0
- package/src/components/standalone/connection-status/lt-connection-status.ts +242 -0
- package/src/components/standalone/toast/lt-toast.ts +300 -0
- package/src/components/standalone/toast/toast.css +78 -0
- package/src/components/standalone/toast/toast.ts +70 -0
- package/src/diagnostics/core.ts +210 -0
- package/src/diagnostics/default-core.ts +81 -0
- package/src/diagnostics/index.ts +150 -0
- package/src/dom.ts +185 -0
- package/src/index.ts +218 -0
- package/src/jsx/react.ts +212 -0
- package/src/lt.ts +192 -0
- package/src/react.ts +411 -0
- package/src/register.ts +43 -0
- package/src/tailwind/tailwind.css +169 -0
- package/src/tokens/boundary.css +104 -0
- package/src/tokens/color-contract.json +231 -0
- package/src/tokens/color.ts +150 -0
- package/src/tokens/contract.ts +24 -0
- package/src/tokens/matrix-cells.ts +375 -0
- package/src/tokens/matrix.ts +32 -0
- package/src/tokens/theme-check.ts +51 -0
- package/src/tokens/theme.ts +104 -0
- package/src/tokens/tokens.css +569 -0
- package/src/tokens/tokens.ts +223 -0
- package/src/vocabulary/classes.ts +1322 -0
- package/src/vocabulary/elements.ts +412 -0
- package/src/vocabulary/types.ts +178 -0
- package/src/wasi-host.ts +155 -0
- package/web-types.json +800 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const HEADING_CLASS = "lt-heading" as const
|
|
4
|
+
|
|
5
|
+
export const headingSizes = ["xs", "s", "m", "l", "xl", "mega"] as const
|
|
6
|
+
|
|
7
|
+
export type HeadingSize = (typeof headingSizes)[number]
|
|
8
|
+
export type NonDefaultHeadingSize = Exclude<HeadingSize, "l">
|
|
9
|
+
|
|
10
|
+
export type HeadingOptions = {
|
|
11
|
+
/** Visual size. Default: `l`. */
|
|
12
|
+
size?: HeadingSize
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type HeadingAttributes = {
|
|
16
|
+
class: typeof HEADING_CLASS
|
|
17
|
+
"data-size"?: NonDefaultHeadingSize
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The attributes for a heading.
|
|
22
|
+
*
|
|
23
|
+
* Size and level are two different things. The level is `<h1>` to `<h6>`
|
|
24
|
+
* and sets the structure screen readers navigate by; `size` only sets how
|
|
25
|
+
* large the text looks. An `<h2>` that should look small is correct; an
|
|
26
|
+
* `<h4>` chosen because it was small enough skips a level in the structure.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* <h2 {...heading({ size: "m" })}>Attachments</h2>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const heading = Object.assign(
|
|
33
|
+
({ size = "l" }: HeadingOptions = {}): HeadingAttributes =>
|
|
34
|
+
attributes({
|
|
35
|
+
class: HEADING_CLASS,
|
|
36
|
+
"data-size": size === "l" ? undefined : size,
|
|
37
|
+
}),
|
|
38
|
+
{
|
|
39
|
+
sizes: headingSizes,
|
|
40
|
+
isSize: createGuard(headingSizes),
|
|
41
|
+
},
|
|
42
|
+
)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-help-text {
|
|
3
|
+
display: block;
|
|
4
|
+
/* The whole margin is set, not just the top: without it a <p> inherits
|
|
5
|
+
the browser's 1em at the bottom for consumers without a reset. */
|
|
6
|
+
margin: var(--lt-spacing-1) 0 0;
|
|
7
|
+
font-family: inherit;
|
|
8
|
+
font-size: var(--lt-font-size-xs);
|
|
9
|
+
line-height: var(--lt-line-height-compact);
|
|
10
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.lt-help-text[data-variant="strong"] {
|
|
14
|
+
color: var(--lt-color-neutral-text-strong);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.lt-help-text[data-variant="success"] {
|
|
18
|
+
color: var(--lt-color-success-text);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.lt-help-text[data-variant="warning"] {
|
|
22
|
+
color: var(--lt-color-warning-text);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const HELP_TEXT_CLASS = "lt-help-text" as const
|
|
4
|
+
|
|
5
|
+
export const helpTextVariants = [
|
|
6
|
+
"muted",
|
|
7
|
+
"strong",
|
|
8
|
+
"success",
|
|
9
|
+
"warning",
|
|
10
|
+
] as const
|
|
11
|
+
|
|
12
|
+
export type HelpTextVariant = (typeof helpTextVariants)[number]
|
|
13
|
+
export type NonDefaultHelpTextVariant = Exclude<HelpTextVariant, "muted">
|
|
14
|
+
|
|
15
|
+
export type HelpTextOptions = {
|
|
16
|
+
/** How loudly the text should speak. Default: `muted`. */
|
|
17
|
+
variant?: HelpTextVariant
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type HelpTextAttributes = {
|
|
21
|
+
class: typeof HELP_TEXT_CLASS
|
|
22
|
+
"data-variant"?: NonDefaultHelpTextVariant
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The attributes for help text below a field.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* <p {...helpText({ variant: "warning" })}>…</p>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const helpText = Object.assign(
|
|
33
|
+
({ variant = "muted" }: HelpTextOptions = {}): HelpTextAttributes =>
|
|
34
|
+
attributes({
|
|
35
|
+
class: HELP_TEXT_CLASS,
|
|
36
|
+
"data-variant": variant === "muted" ? undefined : variant,
|
|
37
|
+
}),
|
|
38
|
+
{
|
|
39
|
+
variants: helpTextVariants,
|
|
40
|
+
isVariant: createGuard(helpTextVariants),
|
|
41
|
+
},
|
|
42
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
/* The icon is an svg from the app's icon set. It is as large as the text
|
|
3
|
+
around it, and sits in the middle of the line with it, slightly below
|
|
4
|
+
the baseline, as icon sets are drawn for.
|
|
5
|
+
|
|
6
|
+
The size has no component variable. `--lt-icon-*` are the tokens for the
|
|
7
|
+
icons in the stylesheets, and `font-size` on the icon does the same job.
|
|
8
|
+
|
|
9
|
+
The colour comes from the svg, and with `currentColor` it follows the
|
|
10
|
+
text, also in high contrast. The stylesheet does not set `fill`, because
|
|
11
|
+
an icon drawn with strokes has `fill="none"`, and a rule here would have
|
|
12
|
+
filled it. */
|
|
13
|
+
.lt-icon {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
inline-size: 1em;
|
|
16
|
+
block-size: 1em;
|
|
17
|
+
flex-shrink: 0;
|
|
18
|
+
vertical-align: -0.125em;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { attributes } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const ICON_CLASS = "lt-icon" as const
|
|
4
|
+
|
|
5
|
+
export type IconOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* What the icon means, when it stands alone and means something, such as a
|
|
8
|
+
* warning sign with no text next to it. Becomes `aria-label` with
|
|
9
|
+
* `role="img"`. Without it the icon is decoration, and is hidden from
|
|
10
|
+
* screen readers.
|
|
11
|
+
*/
|
|
12
|
+
label?: string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type IconAttributes = {
|
|
16
|
+
class: typeof ICON_CLASS
|
|
17
|
+
role?: "img"
|
|
18
|
+
"aria-label"?: string
|
|
19
|
+
"aria-hidden"?: "true"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The attributes for an icon. The class goes on an `<svg>`, and the svg comes
|
|
24
|
+
* from the app's icon set: LO-TEK ships no icons.
|
|
25
|
+
*
|
|
26
|
+
* The icon is as large as the text around it, and is drawn in the colour the
|
|
27
|
+
* svg says, which should be `currentColor`. Without `label` it is decoration,
|
|
28
|
+
* and if it stands alone in a button, the button must get its name somewhere
|
|
29
|
+
* else: `aria-label` on the button, or a text with `lt-sr-only`. The core
|
|
30
|
+
* reports a button that lacks one.
|
|
31
|
+
*
|
|
32
|
+
* ```ts
|
|
33
|
+
* <button {...button()} aria-label="Delete the application">
|
|
34
|
+
* <svg {...icon()} viewBox="0 0 24 24">…</svg>
|
|
35
|
+
* </button>
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
export const icon = ({ label }: IconOptions = {}): IconAttributes =>
|
|
39
|
+
attributes({
|
|
40
|
+
class: ICON_CLASS,
|
|
41
|
+
role: label ? ("img" as const) : undefined,
|
|
42
|
+
"aria-label": label || undefined,
|
|
43
|
+
"aria-hidden": label ? undefined : ("true" as const),
|
|
44
|
+
})
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-input {
|
|
3
|
+
/* The design system cannot assume the consumer has a CSS reset. Without
|
|
4
|
+
border-box, padding and border are added outside the width, and the
|
|
5
|
+
field becomes wider than the box it sits in. */
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
|
|
8
|
+
display: block;
|
|
9
|
+
width: var(--lt-input-width, 100%);
|
|
10
|
+
padding: var(--lt-input-padding, var(--lt-spacing-2) var(--lt-spacing-3));
|
|
11
|
+
font-family: inherit;
|
|
12
|
+
font-size: var(--lt-font-size-m);
|
|
13
|
+
line-height: var(--lt-line-height-default);
|
|
14
|
+
color: var(--lt-color-neutral-text-strong);
|
|
15
|
+
background: var(--lt-color-neutral-canvas);
|
|
16
|
+
border: 1px solid var(--lt-color-neutral-border);
|
|
17
|
+
border-radius: var(--lt-input-radius, var(--lt-spacing-1));
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.lt-input::placeholder {
|
|
21
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.lt-input:hover {
|
|
25
|
+
border-color: var(--lt-color-neutral-border-strong);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.lt-input:focus-visible {
|
|
29
|
+
outline: var(--lt-focus-ring);
|
|
30
|
+
outline-offset: 2px;
|
|
31
|
+
border-color: var(--lt-color-accent-border);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.lt-input:disabled,
|
|
35
|
+
.lt-input[aria-disabled="true"] {
|
|
36
|
+
/* `background-color` and not the shorthand, here and in the states
|
|
37
|
+
below. The shorthand resets `background-image`, and a search field
|
|
38
|
+
lost its magnifying glass when `input.css` was loaded after
|
|
39
|
+
`search.css`. */
|
|
40
|
+
background-color: var(--lt-color-disabled-surface);
|
|
41
|
+
color: var(--lt-color-disabled-text);
|
|
42
|
+
border-color: var(--lt-color-disabled-surface);
|
|
43
|
+
/* No pointer-events: none here. The browser already blocks a disabled
|
|
44
|
+
field, and pointer-events would only stop the cursor from showing. The
|
|
45
|
+
element is then not hit by the mouse at all. */
|
|
46
|
+
cursor: not-allowed;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* aria-disabled is only information for screen readers; the element still
|
|
50
|
+
works. Here pointer-events stops the mouse, at the cost of the cursor.
|
|
51
|
+
If the field should really be off, use `disabled` or `readonly`. */
|
|
52
|
+
.lt-input[aria-disabled="true"] {
|
|
53
|
+
pointer-events: none;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.lt-input[data-state="invalid"] {
|
|
57
|
+
border-color: var(--lt-color-danger-text);
|
|
58
|
+
background-color: var(--lt-color-danger-surface);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.lt-input[data-state="invalid"]:focus-visible {
|
|
62
|
+
outline-color: var(--lt-color-danger-text);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.lt-input[data-state="success"] {
|
|
66
|
+
border-color: var(--lt-color-success-text);
|
|
67
|
+
background-color: var(--lt-color-success-surface);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.lt-input[data-state="success"]:focus-visible {
|
|
71
|
+
outline-color: var(--lt-color-success-text);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/* Disabled wins over a state. `[data-state]` used to come after
|
|
75
|
+
`:disabled` with the same specificity, and an invalid field in a form
|
|
76
|
+
that was disabled during submission looked red, not disabled. */
|
|
77
|
+
.lt-input:is(:disabled, [aria-disabled="true"])[data-state] {
|
|
78
|
+
background-color: var(--lt-color-disabled-surface);
|
|
79
|
+
color: var(--lt-color-disabled-text);
|
|
80
|
+
border-color: var(--lt-color-disabled-surface);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.lt-input[data-variant="date"],
|
|
84
|
+
.lt-input[data-variant="time"],
|
|
85
|
+
.lt-input[data-variant="datetime-local"] {
|
|
86
|
+
position: relative;
|
|
87
|
+
min-height: calc(var(--lt-spacing-4) * 2.5);
|
|
88
|
+
font-variant-numeric: tabular-nums;
|
|
89
|
+
letter-spacing: 0.01em;
|
|
90
|
+
padding-inline-end: calc(var(--lt-spacing-6) + var(--lt-spacing-2));
|
|
91
|
+
background-repeat: no-repeat;
|
|
92
|
+
background-position: right var(--lt-spacing-2) center;
|
|
93
|
+
background-size: 0.95rem 0.95rem;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/* background-position has no logical variant, so the direction must be
|
|
97
|
+
flipped by hand. Everything else here is logical properties, which flip
|
|
98
|
+
by themselves. */
|
|
99
|
+
.lt-input[data-variant="date"]:dir(rtl),
|
|
100
|
+
.lt-input[data-variant="time"]:dir(rtl),
|
|
101
|
+
.lt-input[data-variant="datetime-local"]:dir(rtl) {
|
|
102
|
+
background-position: left var(--lt-spacing-2) center;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.lt-input[data-variant="date"],
|
|
106
|
+
.lt-input[data-variant="datetime-local"] {
|
|
107
|
+
background-image: var(--lt-icon-calendar);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.lt-input[data-variant="time"] {
|
|
111
|
+
background-image: var(--lt-icon-clock);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.lt-input[data-variant="date"]::-webkit-calendar-picker-indicator,
|
|
115
|
+
.lt-input[data-variant="time"]::-webkit-calendar-picker-indicator,
|
|
116
|
+
.lt-input[data-variant="datetime-local"]::-webkit-calendar-picker-indicator {
|
|
117
|
+
position: absolute;
|
|
118
|
+
inset-inline-end: var(--lt-spacing-2);
|
|
119
|
+
top: 50%;
|
|
120
|
+
transform: translateY(-50%);
|
|
121
|
+
opacity: 0;
|
|
122
|
+
width: var(--lt-spacing-6);
|
|
123
|
+
height: var(--lt-spacing-6);
|
|
124
|
+
min-width: var(--lt-spacing-6);
|
|
125
|
+
min-height: var(--lt-spacing-6);
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* High contrast: the icon is painted into the image with a fixed colour,
|
|
130
|
+
and can become invisible in a dark theme. The browser's own button is
|
|
131
|
+
hidden behind our icon, and is brought back here. */
|
|
132
|
+
@media (forced-colors: active) {
|
|
133
|
+
.lt-input[data-variant="date"],
|
|
134
|
+
.lt-input[data-variant="time"],
|
|
135
|
+
.lt-input[data-variant="datetime-local"] {
|
|
136
|
+
background-image: none;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.lt-input[data-variant="date"]::-webkit-calendar-picker-indicator,
|
|
140
|
+
.lt-input[data-variant="time"]::-webkit-calendar-picker-indicator,
|
|
141
|
+
.lt-input[data-variant="datetime-local"]::-webkit-calendar-picker-indicator {
|
|
142
|
+
opacity: 1;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import {
|
|
2
|
+
attributes,
|
|
3
|
+
createGuard,
|
|
4
|
+
type FieldState,
|
|
5
|
+
fieldStates,
|
|
6
|
+
isFieldState,
|
|
7
|
+
type NonDefaultFieldState,
|
|
8
|
+
} from "../shared.js"
|
|
9
|
+
|
|
10
|
+
export const INPUT_CLASS = "lt-input" as const
|
|
11
|
+
|
|
12
|
+
export const inputTypes = [
|
|
13
|
+
"text",
|
|
14
|
+
"password",
|
|
15
|
+
"email",
|
|
16
|
+
"number",
|
|
17
|
+
"date",
|
|
18
|
+
"datetime-local",
|
|
19
|
+
"week",
|
|
20
|
+
"month",
|
|
21
|
+
"tel",
|
|
22
|
+
"url",
|
|
23
|
+
"search",
|
|
24
|
+
"time",
|
|
25
|
+
] as const
|
|
26
|
+
|
|
27
|
+
export type InputType = (typeof inputTypes)[number]
|
|
28
|
+
|
|
29
|
+
/** The types that get an icon in the field, and that open the browser's own picker. */
|
|
30
|
+
const TYPES_WITH_ICON = ["date", "time", "datetime-local"] as const
|
|
31
|
+
type TypeWithIcon = (typeof TYPES_WITH_ICON)[number]
|
|
32
|
+
|
|
33
|
+
export type InputOptions = {
|
|
34
|
+
/** The HTML type. Set as `type`, and decides the icon. Default: `text`. */
|
|
35
|
+
type?: InputType
|
|
36
|
+
/** Validation state. Default: `default`. */
|
|
37
|
+
state?: FieldState
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export type InputAttributes = {
|
|
41
|
+
class: typeof INPUT_CLASS
|
|
42
|
+
type: InputType
|
|
43
|
+
"data-variant"?: TypeWithIcon
|
|
44
|
+
"data-state"?: NonDefaultFieldState
|
|
45
|
+
"aria-invalid"?: "true"
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The attributes for a text field.
|
|
50
|
+
*
|
|
51
|
+
* `type` sets both the HTML type and the icon variant, so the two cannot get
|
|
52
|
+
* out of step. Write them by hand, and it is easy to get a date field that
|
|
53
|
+
* looks like a date field, but where nothing happens when the user presses
|
|
54
|
+
* the icon.
|
|
55
|
+
*
|
|
56
|
+
* ```ts
|
|
57
|
+
* <input {...input({ type: "date", state: "invalid" })} />
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export const input = Object.assign(
|
|
61
|
+
({ type = "text", state = "default" }: InputOptions = {}): InputAttributes =>
|
|
62
|
+
attributes({
|
|
63
|
+
class: INPUT_CLASS,
|
|
64
|
+
type,
|
|
65
|
+
"data-variant": (TYPES_WITH_ICON as readonly string[]).includes(type)
|
|
66
|
+
? (type as TypeWithIcon)
|
|
67
|
+
: undefined,
|
|
68
|
+
"data-state": state === "default" ? undefined : state,
|
|
69
|
+
"aria-invalid": state === "invalid" ? ("true" as const) : undefined,
|
|
70
|
+
}),
|
|
71
|
+
{
|
|
72
|
+
types: inputTypes,
|
|
73
|
+
isType: createGuard(inputTypes),
|
|
74
|
+
states: fieldStates,
|
|
75
|
+
isState: isFieldState,
|
|
76
|
+
},
|
|
77
|
+
)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-label {
|
|
3
|
+
display: block;
|
|
4
|
+
font-family: inherit;
|
|
5
|
+
font-size: var(--lt-font-size-s);
|
|
6
|
+
font-weight: var(--lt-font-weight-semibold);
|
|
7
|
+
line-height: var(--lt-line-height-default);
|
|
8
|
+
color: var(--lt-color-neutral-text-strong);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.lt-label[data-required]::after {
|
|
12
|
+
content: var(--lt-label-required-symbol, " *");
|
|
13
|
+
color: var(--lt-color-danger-text);
|
|
14
|
+
font-weight: var(--lt-font-weight-bold);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.lt-label[data-required="text"]::after {
|
|
18
|
+
/* Keep the fallback ASCII. A stylesheet without `@charset` inherits the
|
|
19
|
+
page's encoding, and a non-ASCII fallback came out garbled when the
|
|
20
|
+
page lacked `<meta charset>` and the server sent no charset. Write any
|
|
21
|
+
other character as an escape, such as `\e5`. */
|
|
22
|
+
content: var(--lt-label-required-text, " (required)");
|
|
23
|
+
color: var(--lt-color-danger-text);
|
|
24
|
+
font-weight: var(--lt-font-weight-regular);
|
|
25
|
+
font-size: var(--lt-font-size-xs);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Not when the field is also marked required: the builder function picks
|
|
29
|
+
required, and hand-written markup with both must give the same result.
|
|
30
|
+
The colour is not `disabled-text`: the text is not disabled, and that
|
|
31
|
+
colour gave 4.37:1. */
|
|
32
|
+
.lt-label[data-optional]:not([data-required])::after {
|
|
33
|
+
content: var(--lt-label-optional-text, " (optional)");
|
|
34
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
35
|
+
font-weight: var(--lt-font-weight-regular);
|
|
36
|
+
font-size: var(--lt-font-size-xs);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.lt-label[aria-disabled="true"] {
|
|
40
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
attributes,
|
|
3
|
+
createGuard,
|
|
4
|
+
type RequiredMarker,
|
|
5
|
+
requiredMarkers,
|
|
6
|
+
} from "../shared.js"
|
|
7
|
+
|
|
8
|
+
export const LABEL_CLASS = "lt-label" as const
|
|
9
|
+
|
|
10
|
+
export type { RequiredMarker }
|
|
11
|
+
export { requiredMarkers }
|
|
12
|
+
|
|
13
|
+
export type LabelOptions = {
|
|
14
|
+
/** Marks the field as required, with an asterisk or with the word "(required)". */
|
|
15
|
+
required?: RequiredMarker
|
|
16
|
+
/** Marks the field as optional. Choose one of `required` and `optional`. */
|
|
17
|
+
optional?: boolean
|
|
18
|
+
/** Mutes the text when the control is disabled. */
|
|
19
|
+
disabled?: boolean
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type LabelAttributes = {
|
|
23
|
+
class: typeof LABEL_CLASS
|
|
24
|
+
"data-required"?: RequiredMarker
|
|
25
|
+
"data-optional"?: ""
|
|
26
|
+
"aria-disabled"?: "true"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The attributes for a label.
|
|
31
|
+
*
|
|
32
|
+
* The marker is only visual, so set `required` on the field itself as well,
|
|
33
|
+
* or the screen reader is not told that it must be filled in.
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* <label {...label({ required: "symbol" })} htmlFor="email">Email address</label>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export const label = Object.assign(
|
|
40
|
+
({ required, optional, disabled }: LabelOptions = {}): LabelAttributes =>
|
|
41
|
+
attributes({
|
|
42
|
+
class: LABEL_CLASS,
|
|
43
|
+
"data-required": required,
|
|
44
|
+
"data-optional": optional && !required ? ("" as const) : undefined,
|
|
45
|
+
"aria-disabled": disabled ? ("true" as const) : undefined,
|
|
46
|
+
}),
|
|
47
|
+
{
|
|
48
|
+
markers: requiredMarkers,
|
|
49
|
+
isMarker: createGuard(requiredMarkers),
|
|
50
|
+
},
|
|
51
|
+
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-link {
|
|
3
|
+
color: var(--lt-color-accent-text);
|
|
4
|
+
font-family: inherit;
|
|
5
|
+
font-size: inherit;
|
|
6
|
+
line-height: var(--lt-line-height-default);
|
|
7
|
+
text-decoration-line: underline;
|
|
8
|
+
text-decoration-thickness: 0.08em;
|
|
9
|
+
text-underline-offset: 0.14em;
|
|
10
|
+
text-decoration-color: currentColor;
|
|
11
|
+
transition:
|
|
12
|
+
color 120ms ease,
|
|
13
|
+
text-decoration-color 120ms ease;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/* Before `:hover`, with the same specificity: the last one wins, and a
|
|
17
|
+
visited link should also change colour under the mouse. */
|
|
18
|
+
.lt-link:visited {
|
|
19
|
+
color: var(--lt-color-visited-text);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.lt-link:hover {
|
|
23
|
+
color: var(--lt-color-accent-text-strong);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.lt-link:focus-visible {
|
|
27
|
+
outline: var(--lt-focus-ring);
|
|
28
|
+
outline-offset: 2px;
|
|
29
|
+
border-radius: var(--lt-spacing-0-5);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.lt-link[aria-disabled="true"] {
|
|
33
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
cursor: not-allowed;
|
|
36
|
+
pointer-events: none;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { attributes } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const LINK_CLASS = "lt-link" as const
|
|
4
|
+
|
|
5
|
+
export type LinkOptions = {
|
|
6
|
+
/**
|
|
7
|
+
* The link cannot be clicked yet. Gives `aria-disabled`, `role="link"` and
|
|
8
|
+
* `tabindex="0"`, so screen readers still find it as a link and can say
|
|
9
|
+
* so. Remove `href` as well: otherwise Enter follows it.
|
|
10
|
+
*/
|
|
11
|
+
disabled?: boolean
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type LinkAttributes = {
|
|
15
|
+
class: typeof LINK_CLASS
|
|
16
|
+
role?: "link"
|
|
17
|
+
tabindex?: "0"
|
|
18
|
+
"aria-disabled"?: "true"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The attributes for a link.
|
|
23
|
+
*
|
|
24
|
+
* ```ts
|
|
25
|
+
* <a {...link()} href="/receipt">See receipt</a>
|
|
26
|
+
* <a {...link({ disabled: true })}>See annual statement</a>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* An `<a>` without `href` is no link to a screen reader and is not in the
|
|
30
|
+
* tab order. `role` and `tabindex` give it both back while it is disabled.
|
|
31
|
+
*/
|
|
32
|
+
export const link = ({ disabled = false }: LinkOptions = {}): LinkAttributes =>
|
|
33
|
+
attributes({
|
|
34
|
+
class: LINK_CLASS,
|
|
35
|
+
role: disabled ? ("link" as const) : undefined,
|
|
36
|
+
tabindex: disabled ? ("0" as const) : undefined,
|
|
37
|
+
"aria-disabled": disabled ? ("true" as const) : undefined,
|
|
38
|
+
})
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-list {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding-inline-start: var(--lt-spacing-5);
|
|
6
|
+
/* The bullets and numbers are the browser's own, and are set here because
|
|
7
|
+
a layer declared before `lotek`, such as Tailwind's Preflight in
|
|
8
|
+
`base`, sets `list-style: none` on all lists. Without this rule
|
|
9
|
+
`lotek` said nothing about the bullets, and Preflight won. `revert`
|
|
10
|
+
goes back to the browser's stylesheet, so <ul> gets bullets, <ol>
|
|
11
|
+
numbers, and a nested list circles and squares, as without Tailwind.
|
|
12
|
+
Only the type, because the type is what Preflight takes; a
|
|
13
|
+
`list-style-position` the consumer has set in an earlier layer still
|
|
14
|
+
goes through. The variants below set `none` themselves, with higher
|
|
15
|
+
specificity. */
|
|
16
|
+
list-style-type: revert;
|
|
17
|
+
font-family: inherit;
|
|
18
|
+
font-size: var(--lt-font-size-m);
|
|
19
|
+
line-height: var(--lt-line-height-article);
|
|
20
|
+
color: var(--lt-color-neutral-text-strong);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.lt-list li + li {
|
|
24
|
+
margin-block-start: var(--lt-list-gap, var(--lt-spacing-1));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.lt-list .lt-list {
|
|
28
|
+
margin-block-start: var(--lt-list-gap, var(--lt-spacing-1));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Without bullets and indentation, for lists that carry their own
|
|
32
|
+
structure, such as rows of cards. The list stays a list for screen
|
|
33
|
+
readers, except a <ul> in Safari, which can need role="list". See the
|
|
34
|
+
component page. */
|
|
35
|
+
.lt-list[data-variant="plain"] {
|
|
36
|
+
list-style: none;
|
|
37
|
+
padding-inline-start: 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.lt-list[data-variant="divided"] {
|
|
41
|
+
list-style: none;
|
|
42
|
+
padding-inline-start: 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.lt-list[data-variant="divided"] li + li {
|
|
46
|
+
margin-block-start: 0;
|
|
47
|
+
border-block-start: 1px solid var(--lt-color-neutral-border-subtle);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.lt-list[data-variant="divided"] li {
|
|
51
|
+
padding-block: var(--lt-list-gap, var(--lt-spacing-2));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const LIST_CLASS = "lt-list" as const
|
|
4
|
+
|
|
5
|
+
export const listVariants = ["default", "plain", "divided"] as const
|
|
6
|
+
|
|
7
|
+
export type ListVariant = (typeof listVariants)[number]
|
|
8
|
+
export type NonDefaultListVariant = Exclude<ListVariant, "default">
|
|
9
|
+
|
|
10
|
+
export type ListOptions = {
|
|
11
|
+
/** Bullets, plain rows, or rows with a line between them. Default: `default`. */
|
|
12
|
+
variant?: ListVariant
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export type ListAttributes = {
|
|
16
|
+
class: typeof LIST_CLASS
|
|
17
|
+
"data-variant"?: NonDefaultListVariant
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The attributes for a list.
|
|
22
|
+
*
|
|
23
|
+
* The class goes on `<ul>` or `<ol>`. `plain` and `divided` remove the
|
|
24
|
+
* bullets visually, but the list stays a list, so the screen reader still
|
|
25
|
+
* says how many items it has. That is why the variant exists: without it
|
|
26
|
+
* people would use `<div>` to get rid of the bullets. The exception is
|
|
27
|
+
* Safari, where a `<ul>` without visible bullets can need `role="list"`. See
|
|
28
|
+
* the component page.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* <ul {...list({ variant: "divided" })}>…</ul>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export const list = Object.assign(
|
|
35
|
+
({ variant = "default" }: ListOptions = {}): ListAttributes =>
|
|
36
|
+
attributes({
|
|
37
|
+
class: LIST_CLASS,
|
|
38
|
+
"data-variant": variant === "default" ? undefined : variant,
|
|
39
|
+
}),
|
|
40
|
+
{
|
|
41
|
+
variants: listVariants,
|
|
42
|
+
isVariant: createGuard(listVariants),
|
|
43
|
+
},
|
|
44
|
+
)
|