@lo-tek/interfaces 0.0.0 → 0.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3389 -0
- package/LICENSE +21 -0
- package/README.md +129 -1
- package/agent/astro.md +400 -0
- package/agent/bundles.md +429 -0
- package/agent/datastar.md +409 -0
- package/agent/html.md +388 -0
- package/agent/react.md +440 -0
- package/agent/templates.md +472 -0
- package/core/lotek-core.wasm +0 -0
- package/core/lotek.wasm +0 -0
- package/dist/cli.d.ts +12 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -0
- package/dist/components/css/accordion/accordion.d.ts +37 -0
- package/dist/components/css/accordion/accordion.d.ts.map +1 -0
- package/dist/components/css/accordion/accordion.js +31 -0
- package/dist/components/css/accordion/accordion.js.map +1 -0
- package/dist/components/css/alert/alert.d.ts +35 -0
- package/dist/components/css/alert/alert.d.ts.map +1 -0
- package/dist/components/css/alert/alert.js +29 -0
- package/dist/components/css/alert/alert.js.map +1 -0
- package/dist/components/css/avatar/avatar.d.ts +40 -0
- package/dist/components/css/avatar/avatar.d.ts.map +1 -0
- package/dist/components/css/avatar/avatar.js +30 -0
- package/dist/components/css/avatar/avatar.js.map +1 -0
- package/dist/components/css/badge/badge.d.ts +24 -0
- package/dist/components/css/badge/badge.d.ts.map +1 -0
- package/dist/components/css/badge/badge.js +24 -0
- package/dist/components/css/badge/badge.js.map +1 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts +26 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.d.ts.map +1 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.js +24 -0
- package/dist/components/css/breadcrumbs/breadcrumbs.js.map +1 -0
- package/dist/components/css/button/button.d.ts +26 -0
- package/dist/components/css/button/button.d.ts.map +1 -0
- package/dist/components/css/button/button.js +25 -0
- package/dist/components/css/button/button.js.map +1 -0
- package/dist/components/css/card/card.d.ts +36 -0
- package/dist/components/css/card/card.d.ts.map +1 -0
- package/dist/components/css/card/card.js +28 -0
- package/dist/components/css/card/card.js.map +1 -0
- package/dist/components/css/checkbox/checkbox.d.ts +32 -0
- package/dist/components/css/checkbox/checkbox.d.ts.map +1 -0
- package/dist/components/css/checkbox/checkbox.js +27 -0
- package/dist/components/css/checkbox/checkbox.js.map +1 -0
- package/dist/components/css/divider/divider.d.ts +29 -0
- package/dist/components/css/divider/divider.d.ts.map +1 -0
- package/dist/components/css/divider/divider.js +23 -0
- package/dist/components/css/divider/divider.js.map +1 -0
- package/dist/components/css/error-text/error-text.d.ts +24 -0
- package/dist/components/css/error-text/error-text.d.ts.map +1 -0
- package/dist/components/css/error-text/error-text.js +18 -0
- package/dist/components/css/error-text/error-text.js.map +1 -0
- package/dist/components/css/fieldset/fieldset.d.ts +55 -0
- package/dist/components/css/fieldset/fieldset.d.ts.map +1 -0
- package/dist/components/css/fieldset/fieldset.js +39 -0
- package/dist/components/css/fieldset/fieldset.js.map +1 -0
- package/dist/components/css/file-upload/file-upload.d.ts +41 -0
- package/dist/components/css/file-upload/file-upload.d.ts.map +1 -0
- package/dist/components/css/file-upload/file-upload.js +32 -0
- package/dist/components/css/file-upload/file-upload.js.map +1 -0
- package/dist/components/css/heading/heading.d.ts +29 -0
- package/dist/components/css/heading/heading.d.ts.map +1 -0
- package/dist/components/css/heading/heading.js +23 -0
- package/dist/components/css/heading/heading.js.map +1 -0
- package/dist/components/css/help-text/help-text.d.ts +24 -0
- package/dist/components/css/help-text/help-text.d.ts.map +1 -0
- package/dist/components/css/help-text/help-text.js +23 -0
- package/dist/components/css/help-text/help-text.js.map +1 -0
- package/dist/components/css/icon/icon.d.ts +34 -0
- package/dist/components/css/icon/icon.d.ts.map +1 -0
- package/dist/components/css/icon/icon.js +25 -0
- package/dist/components/css/icon/icon.js.map +1 -0
- package/dist/components/css/input/input.d.ts +40 -0
- package/dist/components/css/input/input.d.ts.map +1 -0
- package/dist/components/css/input/input.js +45 -0
- package/dist/components/css/input/input.js.map +1 -0
- package/dist/components/css/label/label.d.ts +33 -0
- package/dist/components/css/label/label.d.ts.map +1 -0
- package/dist/components/css/label/label.js +23 -0
- package/dist/components/css/label/label.js.map +1 -0
- package/dist/components/css/link/link.d.ts +28 -0
- package/dist/components/css/link/link.d.ts.map +1 -0
- package/dist/components/css/link/link.js +20 -0
- package/dist/components/css/link/link.js.map +1 -0
- package/dist/components/css/list/list.d.ts +31 -0
- package/dist/components/css/list/list.d.ts.map +1 -0
- package/dist/components/css/list/list.js +25 -0
- package/dist/components/css/list/list.js.map +1 -0
- package/dist/components/css/pagination/pagination.d.ts +27 -0
- package/dist/components/css/pagination/pagination.d.ts.map +1 -0
- package/dist/components/css/pagination/pagination.js +25 -0
- package/dist/components/css/pagination/pagination.js.map +1 -0
- package/dist/components/css/paragraph/paragraph.d.ts +36 -0
- package/dist/components/css/paragraph/paragraph.d.ts.map +1 -0
- package/dist/components/css/paragraph/paragraph.js +26 -0
- package/dist/components/css/paragraph/paragraph.js.map +1 -0
- package/dist/components/css/progress/progress.d.ts +53 -0
- package/dist/components/css/progress/progress.d.ts.map +1 -0
- package/dist/components/css/progress/progress.js +38 -0
- package/dist/components/css/progress/progress.js.map +1 -0
- package/dist/components/css/radio/radio.d.ts +32 -0
- package/dist/components/css/radio/radio.d.ts.map +1 -0
- package/dist/components/css/radio/radio.js +27 -0
- package/dist/components/css/radio/radio.js.map +1 -0
- package/dist/components/css/search/search.d.ts +34 -0
- package/dist/components/css/search/search.d.ts.map +1 -0
- package/dist/components/css/search/search.js +32 -0
- package/dist/components/css/search/search.js.map +1 -0
- package/dist/components/css/select/select.d.ts +40 -0
- package/dist/components/css/select/select.d.ts.map +1 -0
- package/dist/components/css/select/select.js +31 -0
- package/dist/components/css/select/select.js.map +1 -0
- package/dist/components/css/shared.d.ts +90 -0
- package/dist/components/css/shared.d.ts.map +1 -0
- package/dist/components/css/shared.js +167 -0
- package/dist/components/css/shared.js.map +1 -0
- package/dist/components/css/skeleton/skeleton.d.ts +29 -0
- package/dist/components/css/skeleton/skeleton.d.ts.map +1 -0
- package/dist/components/css/skeleton/skeleton.js +23 -0
- package/dist/components/css/skeleton/skeleton.js.map +1 -0
- package/dist/components/css/skip-link/skip-link.d.ts +18 -0
- package/dist/components/css/skip-link/skip-link.d.ts.map +1 -0
- package/dist/components/css/skip-link/skip-link.js +16 -0
- package/dist/components/css/skip-link/skip-link.js.map +1 -0
- package/dist/components/css/spinner/spinner.d.ts +33 -0
- package/dist/components/css/spinner/spinner.d.ts.map +1 -0
- package/dist/components/css/spinner/spinner.js +25 -0
- package/dist/components/css/spinner/spinner.js.map +1 -0
- package/dist/components/css/sr-only/sr-only.d.ts +17 -0
- package/dist/components/css/sr-only/sr-only.d.ts.map +1 -0
- package/dist/components/css/sr-only/sr-only.js +15 -0
- package/dist/components/css/sr-only/sr-only.js.map +1 -0
- package/dist/components/css/switch/switch.d.ts +37 -0
- package/dist/components/css/switch/switch.d.ts.map +1 -0
- package/dist/components/css/switch/switch.js +29 -0
- package/dist/components/css/switch/switch.js.map +1 -0
- package/dist/components/css/table/table.d.ts +76 -0
- package/dist/components/css/table/table.d.ts.map +1 -0
- package/dist/components/css/table/table.js +59 -0
- package/dist/components/css/table/table.js.map +1 -0
- package/dist/components/css/tag/tag.d.ts +35 -0
- package/dist/components/css/tag/tag.d.ts.map +1 -0
- package/dist/components/css/tag/tag.js +27 -0
- package/dist/components/css/tag/tag.js.map +1 -0
- package/dist/components/css/textarea/textarea.d.ts +23 -0
- package/dist/components/css/textarea/textarea.d.ts.map +1 -0
- package/dist/components/css/textarea/textarea.js +18 -0
- package/dist/components/css/textarea/textarea.js.map +1 -0
- package/dist/components/css/toggle-group/toggle-group.d.ts +31 -0
- package/dist/components/css/toggle-group/toggle-group.d.ts.map +1 -0
- package/dist/components/css/toggle-group/toggle-group.js +29 -0
- package/dist/components/css/toggle-group/toggle-group.js.map +1 -0
- package/dist/components/css/tooltip/tooltip.d.ts +31 -0
- package/dist/components/css/tooltip/tooltip.d.ts.map +1 -0
- package/dist/components/css/tooltip/tooltip.js +29 -0
- package/dist/components/css/tooltip/tooltip.js.map +1 -0
- package/dist/components/default-texts.d.ts +41 -0
- package/dist/components/default-texts.d.ts.map +1 -0
- package/dist/components/default-texts.js +41 -0
- package/dist/components/default-texts.js.map +1 -0
- package/dist/components/events.d.ts +77 -0
- package/dist/components/events.d.ts.map +1 -0
- package/dist/components/events.js +3 -0
- package/dist/components/events.js.map +1 -0
- package/dist/components/frame/dialog/dialog.d.ts +122 -0
- package/dist/components/frame/dialog/dialog.d.ts.map +1 -0
- package/dist/components/frame/dialog/dialog.js +112 -0
- package/dist/components/frame/dialog/dialog.js.map +1 -0
- package/dist/components/frame/dialog/lt-dialog.d.ts +104 -0
- package/dist/components/frame/dialog/lt-dialog.d.ts.map +1 -0
- package/dist/components/frame/dialog/lt-dialog.js +434 -0
- package/dist/components/frame/dialog/lt-dialog.js.map +1 -0
- package/dist/components/frame/error-summary/error-summary.d.ts +53 -0
- package/dist/components/frame/error-summary/error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/error-summary.js +54 -0
- package/dist/components/frame/error-summary/error-summary.js.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts +93 -0
- package/dist/components/frame/error-summary/lt-error-summary.d.ts.map +1 -0
- package/dist/components/frame/error-summary/lt-error-summary.js +408 -0
- package/dist/components/frame/error-summary/lt-error-summary.js.map +1 -0
- package/dist/components/frame/field/field-core.d.ts +92 -0
- package/dist/components/frame/field/field-core.d.ts.map +1 -0
- package/dist/components/frame/field/field-core.js +63 -0
- package/dist/components/frame/field/field-core.js.map +1 -0
- package/dist/components/frame/field/lt-field.d.ts +173 -0
- package/dist/components/frame/field/lt-field.d.ts.map +1 -0
- package/dist/components/frame/field/lt-field.js +600 -0
- package/dist/components/frame/field/lt-field.js.map +1 -0
- package/dist/components/frame/popover/lt-popover.d.ts +136 -0
- package/dist/components/frame/popover/lt-popover.d.ts.map +1 -0
- package/dist/components/frame/popover/lt-popover.js +520 -0
- package/dist/components/frame/popover/lt-popover.js.map +1 -0
- package/dist/components/frame/popover/popover.d.ts +49 -0
- package/dist/components/frame/popover/popover.d.ts.map +1 -0
- package/dist/components/frame/popover/popover.js +64 -0
- package/dist/components/frame/popover/popover.js.map +1 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts +198 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.d.ts.map +1 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.js +610 -0
- package/dist/components/frame/session-timeout/lt-session-timeout.js.map +1 -0
- package/dist/components/frame/session-timeout/session-timeout.d.ts +113 -0
- package/dist/components/frame/session-timeout/session-timeout.d.ts.map +1 -0
- package/dist/components/frame/session-timeout/session-timeout.js +101 -0
- package/dist/components/frame/session-timeout/session-timeout.js.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts +367 -0
- package/dist/components/frame/suggestion/lt-suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/lt-suggestion.js +1171 -0
- package/dist/components/frame/suggestion/lt-suggestion.js.map +1 -0
- package/dist/components/frame/suggestion/suggestion.d.ts +143 -0
- package/dist/components/frame/suggestion/suggestion.d.ts.map +1 -0
- package/dist/components/frame/suggestion/suggestion.js +127 -0
- package/dist/components/frame/suggestion/suggestion.js.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts +426 -0
- package/dist/components/frame/tabs/lt-tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/lt-tabs.js +1265 -0
- package/dist/components/frame/tabs/lt-tabs.js.map +1 -0
- package/dist/components/frame/tabs/tabs.d.ts +112 -0
- package/dist/components/frame/tabs/tabs.d.ts.map +1 -0
- package/dist/components/frame/tabs/tabs.js +107 -0
- package/dist/components/frame/tabs/tabs.js.map +1 -0
- package/dist/components/host-element.d.ts +184 -0
- package/dist/components/host-element.d.ts.map +1 -0
- package/dist/components/host-element.js +440 -0
- package/dist/components/host-element.js.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts +32 -0
- package/dist/components/standalone/connection-status/connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/connection-status.js +26 -0
- package/dist/components/standalone/connection-status/connection-status.js.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts +86 -0
- package/dist/components/standalone/connection-status/lt-connection-status.d.ts.map +1 -0
- package/dist/components/standalone/connection-status/lt-connection-status.js +240 -0
- package/dist/components/standalone/connection-status/lt-connection-status.js.map +1 -0
- package/dist/components/standalone/toast/lt-toast.d.ts +109 -0
- package/dist/components/standalone/toast/lt-toast.d.ts.map +1 -0
- package/dist/components/standalone/toast/lt-toast.js +256 -0
- package/dist/components/standalone/toast/lt-toast.js.map +1 -0
- package/dist/components/standalone/toast/toast.d.ts +52 -0
- package/dist/components/standalone/toast/toast.d.ts.map +1 -0
- package/dist/components/standalone/toast/toast.js +42 -0
- package/dist/components/standalone/toast/toast.js.map +1 -0
- package/dist/diagnostics/core.d.ts +171 -0
- package/dist/diagnostics/core.d.ts.map +1 -0
- package/dist/diagnostics/core.js +84 -0
- package/dist/diagnostics/core.js.map +1 -0
- package/dist/diagnostics/default-core.d.ts +10 -0
- package/dist/diagnostics/default-core.d.ts.map +1 -0
- package/dist/diagnostics/default-core.js +72 -0
- package/dist/diagnostics/default-core.js.map +1 -0
- package/dist/diagnostics/index.d.ts +84 -0
- package/dist/diagnostics/index.d.ts.map +1 -0
- package/dist/diagnostics/index.js +106 -0
- package/dist/diagnostics/index.js.map +1 -0
- package/dist/dom.d.ts +55 -0
- package/dist/dom.d.ts.map +1 -0
- package/dist/dom.js +162 -0
- package/dist/dom.js.map +1 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/jsx/react.d.ts +180 -0
- package/dist/jsx/react.d.ts.map +1 -0
- package/dist/jsx/react.js +2 -0
- package/dist/jsx/react.js.map +1 -0
- package/dist/lotek.css +3617 -0
- package/dist/lt.d.ts +325 -0
- package/dist/lt.d.ts.map +1 -0
- package/dist/lt.js +183 -0
- package/dist/lt.js.map +1 -0
- package/dist/react.d.ts +494 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +296 -0
- package/dist/react.js.map +1 -0
- package/dist/register.d.ts +17 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +35 -0
- package/dist/register.js.map +1 -0
- package/dist/tokens/color.d.ts +43 -0
- package/dist/tokens/color.d.ts.map +1 -0
- package/dist/tokens/color.js +123 -0
- package/dist/tokens/color.js.map +1 -0
- package/dist/tokens/contract.d.ts +18 -0
- package/dist/tokens/contract.d.ts.map +1 -0
- package/dist/tokens/contract.js +18 -0
- package/dist/tokens/contract.js.map +1 -0
- package/dist/tokens/matrix-cells.d.ts +30 -0
- package/dist/tokens/matrix-cells.d.ts.map +1 -0
- package/dist/tokens/matrix-cells.js +273 -0
- package/dist/tokens/matrix-cells.js.map +1 -0
- package/dist/tokens/matrix.d.ts +18 -0
- package/dist/tokens/matrix.d.ts.map +1 -0
- package/dist/tokens/matrix.js +21 -0
- package/dist/tokens/matrix.js.map +1 -0
- package/dist/tokens/theme-check.d.ts +42 -0
- package/dist/tokens/theme-check.d.ts.map +1 -0
- package/dist/tokens/theme-check.js +10 -0
- package/dist/tokens/theme-check.js.map +1 -0
- package/dist/tokens/theme.d.ts +94 -0
- package/dist/tokens/theme.d.ts.map +1 -0
- package/dist/tokens/theme.js +14 -0
- package/dist/tokens/theme.js.map +1 -0
- package/dist/tokens/tokens.d.ts +122 -0
- package/dist/tokens/tokens.d.ts.map +1 -0
- package/dist/tokens/tokens.js +158 -0
- package/dist/tokens/tokens.js.map +1 -0
- package/dist/vocabulary/classes.d.ts +3 -0
- package/dist/vocabulary/classes.d.ts.map +1 -0
- package/dist/vocabulary/classes.js +1354 -0
- package/dist/vocabulary/classes.js.map +1 -0
- package/dist/vocabulary/elements.d.ts +3 -0
- package/dist/vocabulary/elements.d.ts.map +1 -0
- package/dist/vocabulary/elements.js +490 -0
- package/dist/vocabulary/elements.js.map +1 -0
- package/dist/vocabulary/types.d.ts +229 -0
- package/dist/vocabulary/types.d.ts.map +1 -0
- package/dist/vocabulary/types.js +11 -0
- package/dist/vocabulary/types.js.map +1 -0
- package/dist/wasi-host.d.ts +24 -0
- package/dist/wasi-host.d.ts.map +1 -0
- package/dist/wasi-host.js +140 -0
- package/dist/wasi-host.js.map +1 -0
- package/live-templates.xml +63 -0
- package/manifest/files.json +373 -0
- package/manifest/manifest.json +5090 -0
- package/manifest/manifest.schema.json +586 -0
- package/package.json +399 -5
- package/src/cli.ts +21 -0
- package/src/components/css/accordion/accordion.css +102 -0
- package/src/components/css/accordion/accordion.ts +50 -0
- package/src/components/css/alert/alert.css +53 -0
- package/src/components/css/alert/alert.ts +48 -0
- package/src/components/css/avatar/avatar.css +96 -0
- package/src/components/css/avatar/avatar.ts +57 -0
- package/src/components/css/badge/badge.css +42 -0
- package/src/components/css/badge/badge.ts +43 -0
- package/src/components/css/breadcrumbs/breadcrumbs.css +62 -0
- package/src/components/css/breadcrumbs/breadcrumbs.ts +30 -0
- package/src/components/css/button/button.css +128 -0
- package/src/components/css/button/button.ts +44 -0
- package/src/components/css/card/card.css +65 -0
- package/src/components/css/card/card.ts +50 -0
- package/src/components/css/checkbox/checkbox.css +114 -0
- package/src/components/css/checkbox/checkbox.ts +50 -0
- package/src/components/css/divider/divider.css +38 -0
- package/src/components/css/divider/divider.ts +42 -0
- package/src/components/css/error-text/error-text.css +21 -0
- package/src/components/css/error-text/error-text.ts +37 -0
- package/src/components/css/fieldset/fieldset.css +72 -0
- package/src/components/css/fieldset/fieldset.ts +87 -0
- package/src/components/css/file-upload/file-upload.css +102 -0
- package/src/components/css/file-upload/file-upload.ts +65 -0
- package/src/components/css/heading/heading.css +33 -0
- package/src/components/css/heading/heading.ts +42 -0
- package/src/components/css/help-text/help-text.css +24 -0
- package/src/components/css/help-text/help-text.ts +42 -0
- package/src/components/css/icon/icon.css +20 -0
- package/src/components/css/icon/icon.ts +44 -0
- package/src/components/css/input/input.css +145 -0
- package/src/components/css/input/input.ts +77 -0
- package/src/components/css/label/label.css +42 -0
- package/src/components/css/label/label.ts +51 -0
- package/src/components/css/link/link.css +38 -0
- package/src/components/css/link/link.ts +38 -0
- package/src/components/css/list/list.css +53 -0
- package/src/components/css/list/list.ts +44 -0
- package/src/components/css/pagination/pagination.css +95 -0
- package/src/components/css/pagination/pagination.ts +33 -0
- package/src/components/css/paragraph/paragraph.css +31 -0
- package/src/components/css/paragraph/paragraph.ts +53 -0
- package/src/components/css/progress/progress.css +161 -0
- package/src/components/css/progress/progress.ts +78 -0
- package/src/components/css/radio/radio.css +94 -0
- package/src/components/css/radio/radio.ts +50 -0
- package/src/components/css/search/search.css +50 -0
- package/src/components/css/search/search.ts +56 -0
- package/src/components/css/select/select.css +321 -0
- package/src/components/css/select/select.ts +63 -0
- package/src/components/css/shared.ts +199 -0
- package/src/components/css/skeleton/skeleton.css +62 -0
- package/src/components/css/skeleton/skeleton.ts +43 -0
- package/src/components/css/skip-link/skip-link.css +41 -0
- package/src/components/css/skip-link/skip-link.ts +22 -0
- package/src/components/css/spinner/spinner.css +48 -0
- package/src/components/css/spinner/spinner.ts +48 -0
- package/src/components/css/sr-only/sr-only.css +16 -0
- package/src/components/css/sr-only/sr-only.ts +21 -0
- package/src/components/css/switch/switch.css +105 -0
- package/src/components/css/switch/switch.ts +50 -0
- package/src/components/css/table/table.css +159 -0
- package/src/components/css/table/table.ts +107 -0
- package/src/components/css/tag/tag.css +58 -0
- package/src/components/css/tag/tag.ts +49 -0
- package/src/components/css/textarea/textarea.css +83 -0
- package/src/components/css/textarea/textarea.ts +40 -0
- package/src/components/css/toggle-group/toggle-group.css +92 -0
- package/src/components/css/toggle-group/toggle-group.ts +37 -0
- package/src/components/css/tooltip/tooltip.css +89 -0
- package/src/components/css/tooltip/tooltip.ts +37 -0
- package/src/components/default-texts.ts +41 -0
- package/src/components/events.ts +68 -0
- package/src/components/frame/dialog/dialog.css +306 -0
- package/src/components/frame/dialog/dialog.ts +166 -0
- package/src/components/frame/dialog/lt-dialog.ts +513 -0
- package/src/components/frame/error-summary/error-summary.css +47 -0
- package/src/components/frame/error-summary/error-summary.ts +90 -0
- package/src/components/frame/error-summary/lt-error-summary.ts +458 -0
- package/src/components/frame/field/field-core.ts +152 -0
- package/src/components/frame/field/field.css +17 -0
- package/src/components/frame/field/lt-field.ts +790 -0
- package/src/components/frame/popover/lt-popover.ts +586 -0
- package/src/components/frame/popover/popover.css +50 -0
- package/src/components/frame/popover/popover.ts +102 -0
- package/src/components/frame/session-timeout/lt-session-timeout.ts +715 -0
- package/src/components/frame/session-timeout/session-timeout.css +50 -0
- package/src/components/frame/session-timeout/session-timeout.ts +156 -0
- package/src/components/frame/suggestion/lt-suggestion.ts +1379 -0
- package/src/components/frame/suggestion/suggestion.css +132 -0
- package/src/components/frame/suggestion/suggestion.ts +172 -0
- package/src/components/frame/tabs/lt-tabs.ts +1395 -0
- package/src/components/frame/tabs/tabs.css +128 -0
- package/src/components/frame/tabs/tabs.ts +188 -0
- package/src/components/host-element.ts +493 -0
- package/src/components/standalone/connection-status/connection-status.css +41 -0
- package/src/components/standalone/connection-status/connection-status.ts +47 -0
- package/src/components/standalone/connection-status/lt-connection-status.ts +268 -0
- package/src/components/standalone/toast/lt-toast.ts +300 -0
- package/src/components/standalone/toast/toast.css +78 -0
- package/src/components/standalone/toast/toast.ts +70 -0
- package/src/diagnostics/core.ts +227 -0
- package/src/diagnostics/default-core.ts +81 -0
- package/src/diagnostics/index.ts +150 -0
- package/src/dom.ts +185 -0
- package/src/index.ts +218 -0
- package/src/jsx/react.ts +212 -0
- package/src/lt.ts +192 -0
- package/src/react.ts +411 -0
- package/src/register.ts +43 -0
- package/src/tailwind/tailwind.css +169 -0
- package/src/tokens/boundary.css +104 -0
- package/src/tokens/color-contract.json +231 -0
- package/src/tokens/color.ts +150 -0
- package/src/tokens/contract.ts +24 -0
- package/src/tokens/matrix-cells.ts +375 -0
- package/src/tokens/matrix.ts +32 -0
- package/src/tokens/theme-check.ts +51 -0
- package/src/tokens/theme.ts +104 -0
- package/src/tokens/tokens.css +569 -0
- package/src/tokens/tokens.ts +223 -0
- package/src/vocabulary/classes.ts +1356 -0
- package/src/vocabulary/elements.ts +492 -0
- package/src/vocabulary/types.ts +228 -0
- package/src/wasi-host.ts +155 -0
- package/web-types.json +800 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const ALERT_CLASS = "lt-alert" as const
|
|
4
|
+
/** The heading inside the message. */
|
|
5
|
+
export const ALERT_TITLE_CLASS = "lt-alert__title" as const
|
|
6
|
+
|
|
7
|
+
export const alertColors = ["info", "success", "warning", "danger"] as const
|
|
8
|
+
|
|
9
|
+
export type AlertColor = (typeof alertColors)[number]
|
|
10
|
+
export type NonNeutralAlertColor = AlertColor
|
|
11
|
+
|
|
12
|
+
export type AlertOptions = {
|
|
13
|
+
/** What the message means. Left out, it is the neutral one. */
|
|
14
|
+
color?: AlertColor
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export type AlertAttributes = {
|
|
18
|
+
class: typeof ALERT_CLASS
|
|
19
|
+
"data-color"?: AlertColor
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The attributes for a message about the whole page or a whole form.
|
|
24
|
+
*
|
|
25
|
+
* The role is not set here, because it depends on when the message comes.
|
|
26
|
+
* If it is in the markup from the start, it should have no role. If it
|
|
27
|
+
* appears while the page is idle, it needs `role="status"`, or
|
|
28
|
+
* `role="alert"` if the user must stop.
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* <div {...alert({ color: "warning" })}>
|
|
32
|
+
* <p class={alert.title}>The application has not been sent</p>
|
|
33
|
+
* </div>
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export const alert = Object.assign(
|
|
37
|
+
({ color }: AlertOptions = {}): AlertAttributes =>
|
|
38
|
+
attributes({
|
|
39
|
+
class: ALERT_CLASS,
|
|
40
|
+
"data-color": color,
|
|
41
|
+
}),
|
|
42
|
+
{
|
|
43
|
+
/** The class on the heading inside the message. */
|
|
44
|
+
title: ALERT_TITLE_CLASS,
|
|
45
|
+
colors: alertColors,
|
|
46
|
+
isColor: createGuard(alertColors),
|
|
47
|
+
},
|
|
48
|
+
)
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-avatar {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: inline-flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
inline-size: var(--lt-avatar-size, var(--lt-spacing-10));
|
|
8
|
+
block-size: var(--lt-avatar-size, var(--lt-spacing-10));
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
font-family: inherit;
|
|
11
|
+
font-size: var(--lt-font-size-s);
|
|
12
|
+
font-weight: var(--lt-font-weight-semibold);
|
|
13
|
+
line-height: 1;
|
|
14
|
+
color: var(--lt-color-accent-text);
|
|
15
|
+
background: var(--lt-color-accent-surface);
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
/* The image can be anything. The ring keeps the shape clear also against
|
|
18
|
+
a light area in the image. An inward `outline` and not a `box-shadow`:
|
|
19
|
+
an inset shadow is painted under the content, and the image covered
|
|
20
|
+
it completely. The longhands, since the shorthand with `solid` is
|
|
21
|
+
reserved for `--lt-focus-ring`. */
|
|
22
|
+
outline-width: 1px;
|
|
23
|
+
outline-style: solid;
|
|
24
|
+
outline-color: var(--lt-color-neutral-border-subtle);
|
|
25
|
+
outline-offset: -1px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* The ring above is an `outline` in the layer, and it beats the browser's
|
|
29
|
+
own focus indicator. An avatar that is a button, for example for a
|
|
30
|
+
profile menu, therefore gets its focus ring from here. */
|
|
31
|
+
.lt-avatar:focus-visible {
|
|
32
|
+
outline: var(--lt-focus-ring);
|
|
33
|
+
outline-offset: 2px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.lt-avatar img {
|
|
37
|
+
inline-size: 100%;
|
|
38
|
+
block-size: 100%;
|
|
39
|
+
object-fit: cover;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.lt-avatar[data-size="small"] {
|
|
43
|
+
inline-size: var(--lt-spacing-6);
|
|
44
|
+
block-size: var(--lt-spacing-6);
|
|
45
|
+
font-size: var(--lt-font-size-xs);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.lt-avatar[data-size="large"] {
|
|
49
|
+
inline-size: var(--lt-spacing-16);
|
|
50
|
+
block-size: var(--lt-spacing-16);
|
|
51
|
+
font-size: var(--lt-font-size-l);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.lt-avatar[data-variant="square"] {
|
|
55
|
+
border-radius: var(--lt-avatar-radius, var(--lt-spacing-1));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Several profile pictures that overlap. The order is reversed in CSS: the
|
|
59
|
+
first element in the markup sits furthest to the right. */
|
|
60
|
+
.lt-avatar-stack {
|
|
61
|
+
display: inline-flex;
|
|
62
|
+
flex-direction: row-reverse;
|
|
63
|
+
justify-content: flex-end;
|
|
64
|
+
margin: 0;
|
|
65
|
+
padding: 0;
|
|
66
|
+
list-style: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.lt-avatar-stack > * + * {
|
|
70
|
+
margin-inline-end: var(
|
|
71
|
+
--lt-avatar-stack-overlap,
|
|
72
|
+
calc(var(--lt-spacing-2) * -1)
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* The inward ring comes from the `outline` above. The shadow outside
|
|
77
|
+
separates the overlapping pictures. An `outline` is painted after all
|
|
78
|
+
the content in the stacking context, so without a separate context per
|
|
79
|
+
avatar the ring of the one behind lay on top of the picture of the one
|
|
80
|
+
in front, like an arc through it. With `isolation` each avatar is
|
|
81
|
+
painted by itself, in order, and the one in front covers the one
|
|
82
|
+
behind, ring and all. */
|
|
83
|
+
.lt-avatar-stack .lt-avatar {
|
|
84
|
+
box-shadow: 0 0 0 2px var(--lt-color-neutral-canvas);
|
|
85
|
+
isolation: isolate;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/* The separate context also applies to the focus ring: an avatar that is a
|
|
89
|
+
button and sits behind another had its ring covered where the
|
|
90
|
+
neighbour overlaps. The one with focus is lifted above its neighbours
|
|
91
|
+
so the ring shows in full. */
|
|
92
|
+
.lt-avatar-stack .lt-avatar:focus-visible {
|
|
93
|
+
position: relative;
|
|
94
|
+
z-index: 1;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const AVATAR_CLASS = "lt-avatar" as const
|
|
4
|
+
/** Several profile pictures that overlap. */
|
|
5
|
+
export const AVATAR_STACK_CLASS = "lt-avatar-stack" as const
|
|
6
|
+
|
|
7
|
+
export const avatarSizes = ["small", "medium", "large"] as const
|
|
8
|
+
export const avatarVariants = ["circle", "square"] as const
|
|
9
|
+
|
|
10
|
+
export type AvatarSize = (typeof avatarSizes)[number]
|
|
11
|
+
export type AvatarVariant = (typeof avatarVariants)[number]
|
|
12
|
+
export type NonDefaultAvatarSize = Exclude<AvatarSize, "medium">
|
|
13
|
+
export type NonDefaultAvatarVariant = Exclude<AvatarVariant, "circle">
|
|
14
|
+
|
|
15
|
+
export type AvatarOptions = {
|
|
16
|
+
/** Size. Default: `medium`. */
|
|
17
|
+
size?: AvatarSize
|
|
18
|
+
/** Round or rounded square. Default: `circle`. */
|
|
19
|
+
variant?: AvatarVariant
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type AvatarAttributes = {
|
|
23
|
+
class: typeof AVATAR_CLASS
|
|
24
|
+
"data-size"?: NonDefaultAvatarSize
|
|
25
|
+
"data-variant"?: NonDefaultAvatarVariant
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The attributes for a profile picture or initials.
|
|
30
|
+
*
|
|
31
|
+
* If the name is already next to it, the picture is decoration: set
|
|
32
|
+
* `aria-hidden="true"` on it, or the name is announced twice. If the
|
|
33
|
+
* picture stands alone, it must have a text that says who it is.
|
|
34
|
+
*
|
|
35
|
+
* ```ts
|
|
36
|
+
* <span {...avatar({ size: "small" })} aria-hidden="true">ON</span>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export const avatar = Object.assign(
|
|
40
|
+
({
|
|
41
|
+
size = "medium",
|
|
42
|
+
variant = "circle",
|
|
43
|
+
}: AvatarOptions = {}): AvatarAttributes =>
|
|
44
|
+
attributes({
|
|
45
|
+
class: AVATAR_CLASS,
|
|
46
|
+
"data-size": size === "medium" ? undefined : size,
|
|
47
|
+
"data-variant": variant === "circle" ? undefined : variant,
|
|
48
|
+
}),
|
|
49
|
+
{
|
|
50
|
+
/** The class on the list of overlapping profile pictures. */
|
|
51
|
+
stack: AVATAR_STACK_CLASS,
|
|
52
|
+
sizes: avatarSizes,
|
|
53
|
+
isSize: createGuard(avatarSizes),
|
|
54
|
+
variants: avatarVariants,
|
|
55
|
+
isVariant: createGuard(avatarVariants),
|
|
56
|
+
},
|
|
57
|
+
)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-badge {
|
|
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
|
+
element becomes wider than the box it sits in. */
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--lt-spacing-1);
|
|
11
|
+
padding: var(--lt-badge-padding, var(--lt-spacing-0-5) var(--lt-spacing-2));
|
|
12
|
+
font-family: inherit;
|
|
13
|
+
font-size: var(--lt-font-size-xs);
|
|
14
|
+
font-weight: var(--lt-font-weight-semibold);
|
|
15
|
+
line-height: var(--lt-line-height-default);
|
|
16
|
+
border-radius: var(--lt-badge-radius, var(--lt-spacing-4));
|
|
17
|
+
white-space: nowrap;
|
|
18
|
+
user-select: none;
|
|
19
|
+
background: var(--lt-color-accent-surface);
|
|
20
|
+
color: var(--lt-color-accent-text);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.lt-badge[data-color="success"] {
|
|
24
|
+
background: var(--lt-color-success-surface);
|
|
25
|
+
color: var(--lt-color-success-text);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.lt-badge[data-color="warning"] {
|
|
29
|
+
background: var(--lt-color-warning-surface);
|
|
30
|
+
color: var(--lt-color-warning-text);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.lt-badge[data-color="danger"] {
|
|
34
|
+
background: var(--lt-color-danger-surface);
|
|
35
|
+
color: var(--lt-color-danger-text);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.lt-badge[data-color="neutral"] {
|
|
39
|
+
background: var(--lt-color-neutral-surface);
|
|
40
|
+
color: var(--lt-color-neutral-text);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const BADGE_CLASS = "lt-badge" as const
|
|
4
|
+
|
|
5
|
+
export const badgeColors = [
|
|
6
|
+
"info",
|
|
7
|
+
"success",
|
|
8
|
+
"warning",
|
|
9
|
+
"danger",
|
|
10
|
+
"neutral",
|
|
11
|
+
] as const
|
|
12
|
+
|
|
13
|
+
export type BadgeColor = (typeof badgeColors)[number]
|
|
14
|
+
export type NonInfoBadgeColor = Exclude<BadgeColor, "info">
|
|
15
|
+
|
|
16
|
+
export type BadgeOptions = {
|
|
17
|
+
/** What the status means. Default: `info`. */
|
|
18
|
+
color?: BadgeColor
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type BadgeAttributes = {
|
|
22
|
+
class: typeof BADGE_CLASS
|
|
23
|
+
"data-color"?: NonInfoBadgeColor
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The attributes for a status badge.
|
|
28
|
+
*
|
|
29
|
+
* ```ts
|
|
30
|
+
* <span {...badge({ color: "success" })}>Approved</span>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const badge = Object.assign(
|
|
34
|
+
({ color = "info" }: BadgeOptions = {}): BadgeAttributes =>
|
|
35
|
+
attributes({
|
|
36
|
+
class: BADGE_CLASS,
|
|
37
|
+
"data-color": color === "info" ? undefined : color,
|
|
38
|
+
}),
|
|
39
|
+
{
|
|
40
|
+
colors: badgeColors,
|
|
41
|
+
isColor: createGuard(badgeColors),
|
|
42
|
+
},
|
|
43
|
+
)
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-breadcrumbs {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: var(--lt-breadcrumbs-gap, var(--lt-spacing-2));
|
|
8
|
+
margin: 0;
|
|
9
|
+
padding: 0;
|
|
10
|
+
list-style: none;
|
|
11
|
+
font-family: inherit;
|
|
12
|
+
font-size: var(--lt-font-size-s);
|
|
13
|
+
line-height: var(--lt-line-height-default);
|
|
14
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.lt-breadcrumbs li {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
gap: var(--lt-breadcrumbs-gap, var(--lt-spacing-2));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* The separator is decoration. Generated content is still announced, so
|
|
24
|
+
it gets an empty alternative text after the slash. Browsers that do not
|
|
25
|
+
know that form discard the whole declaration, and the separator
|
|
26
|
+
disappeared: so it sits behind `@supports`, and those browsers keep the
|
|
27
|
+
slash without silencing it. */
|
|
28
|
+
.lt-breadcrumbs li + li::before {
|
|
29
|
+
content: "/";
|
|
30
|
+
color: var(--lt-color-neutral-text-subtle);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@supports (content: "/" / "") {
|
|
34
|
+
.lt-breadcrumbs li + li::before {
|
|
35
|
+
content: "/" / "";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.lt-breadcrumbs a {
|
|
40
|
+
color: var(--lt-color-accent-text);
|
|
41
|
+
text-decoration: underline;
|
|
42
|
+
text-underline-offset: 0.14em;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/* The current step is excluded. Without `:not()` this rule won on
|
|
46
|
+
specificity over `[aria-current="page"]`, and the last step turned blue
|
|
47
|
+
under the mouse even though it is not a place to go. */
|
|
48
|
+
.lt-breadcrumbs a:not([aria-current="page"]):hover {
|
|
49
|
+
color: var(--lt-color-accent-text-strong);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.lt-breadcrumbs a:focus-visible {
|
|
53
|
+
outline: var(--lt-focus-ring);
|
|
54
|
+
outline-offset: 2px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.lt-breadcrumbs [aria-current="page"] {
|
|
58
|
+
color: var(--lt-color-neutral-text-strong);
|
|
59
|
+
font-weight: var(--lt-font-weight-semibold);
|
|
60
|
+
text-decoration: none;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { attributes } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const BREADCRUMBS_CLASS = "lt-breadcrumbs" as const
|
|
4
|
+
|
|
5
|
+
export type BreadcrumbsAttributes = {
|
|
6
|
+
class: typeof BREADCRUMBS_CLASS
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The attributes for a breadcrumb trail.
|
|
11
|
+
*
|
|
12
|
+
* The class goes on an `<ol>` inside a `<nav>` with a text that says what
|
|
13
|
+
* the navigation is, for example `aria-label="You are here"`. The order
|
|
14
|
+
* matters, so the list must be numbered even though the numbers are not
|
|
15
|
+
* shown.
|
|
16
|
+
*
|
|
17
|
+
* The separator between the steps is added with CSS. Had it been in the
|
|
18
|
+
* markup, screen readers would have read "slash" between every step.
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* <nav aria-label="You are here">
|
|
22
|
+
* <ol {...breadcrumbs()}>
|
|
23
|
+
* <li><a href="/">Home</a></li>
|
|
24
|
+
* <li><a href="/cases" aria-current="page">My cases</a></li>
|
|
25
|
+
* </ol>
|
|
26
|
+
* </nav>
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export const breadcrumbs = (): BreadcrumbsAttributes =>
|
|
30
|
+
attributes({ class: BREADCRUMBS_CLASS })
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-button {
|
|
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
|
+
element becomes wider than the box it sits in. */
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
|
|
8
|
+
display: inline-flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: var(--lt-spacing-2);
|
|
11
|
+
padding: var(--lt-button-padding, var(--lt-spacing-2) var(--lt-spacing-4));
|
|
12
|
+
font-family: inherit;
|
|
13
|
+
font-size: var(--lt-font-size-m);
|
|
14
|
+
/* Weight, line height and border width are shape, and shape is read from
|
|
15
|
+
a component variable with the token value as the fallback. A theme
|
|
16
|
+
that wants bold buttons with a thick border, as some design systems
|
|
17
|
+
have, sets them without overriding a single selector. */
|
|
18
|
+
font-weight: var(--lt-button-font-weight, var(--lt-font-weight-medium));
|
|
19
|
+
line-height: var(--lt-button-line-height, var(--lt-line-height-default));
|
|
20
|
+
border: var(--lt-button-border-width, 1px) solid var(--lt-color-accent-fill);
|
|
21
|
+
border-radius: var(--lt-button-radius, var(--lt-spacing-1));
|
|
22
|
+
background: var(--lt-color-accent-fill);
|
|
23
|
+
color: var(--lt-color-accent-content);
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
text-decoration: none;
|
|
26
|
+
user-select: none;
|
|
27
|
+
|
|
28
|
+
/* The text may wrap. With `white-space: nowrap` a button with a long
|
|
29
|
+
label burst its box on a phone, and then the whole page scrolls
|
|
30
|
+
sideways. The button must never become wider than the room it gets.
|
|
31
|
+
|
|
32
|
+
`normal` is explicit because `white-space` is inherited: a consumer
|
|
33
|
+
with `nowrap` on something around it would otherwise get the problem
|
|
34
|
+
back. Checked in Chromium, `text-wrap: balance` alone is enough, since
|
|
35
|
+
it sets `text-wrap-mode: wrap` and so beats the inherited value, but
|
|
36
|
+
the explicit line also applies where `text-wrap` is not supported. */
|
|
37
|
+
white-space: normal;
|
|
38
|
+
max-inline-size: 100%;
|
|
39
|
+
text-align: center;
|
|
40
|
+
text-wrap: balance;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* Hover moves away from `content`: darker in the light theme, lighter in
|
|
44
|
+
the dark one. `text` is the role that sits there, and since the
|
|
45
|
+
lightness belongs to the role and not the brand colour, the text on the
|
|
46
|
+
button keeps its contrast whatever the hue. `content on text` is a
|
|
47
|
+
promise in the contract. */
|
|
48
|
+
.lt-button:hover {
|
|
49
|
+
background: var(--lt-color-accent-text);
|
|
50
|
+
border-color: var(--lt-color-accent-text);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.lt-button:focus-visible {
|
|
54
|
+
outline: var(--lt-focus-ring);
|
|
55
|
+
outline-offset: 2px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/* Secondary: outline, transparent background */
|
|
59
|
+
.lt-button[data-variant="secondary"] {
|
|
60
|
+
background: transparent;
|
|
61
|
+
color: var(--lt-color-accent-text);
|
|
62
|
+
border-color: var(--lt-color-accent-border);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.lt-button[data-variant="secondary"]:hover:not(
|
|
66
|
+
:disabled,
|
|
67
|
+
[aria-disabled="true"]
|
|
68
|
+
) {
|
|
69
|
+
background: var(--lt-color-accent-surface);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* Ghost: no border, no background */
|
|
73
|
+
.lt-button[data-variant="ghost"] {
|
|
74
|
+
background: transparent;
|
|
75
|
+
color: var(--lt-color-accent-text);
|
|
76
|
+
border-color: transparent;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.lt-button[data-variant="ghost"]:hover:not(
|
|
80
|
+
:disabled,
|
|
81
|
+
[aria-disabled="true"]
|
|
82
|
+
) {
|
|
83
|
+
background: var(--lt-color-accent-surface);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Danger */
|
|
87
|
+
.lt-button[data-variant="danger"] {
|
|
88
|
+
background: var(--lt-color-danger-surface);
|
|
89
|
+
color: var(--lt-color-danger-text);
|
|
90
|
+
border-color: var(--lt-color-danger-text);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.lt-button[data-variant="danger"]:hover:not(
|
|
94
|
+
:disabled,
|
|
95
|
+
[aria-disabled="true"]
|
|
96
|
+
) {
|
|
97
|
+
background: var(--lt-color-danger-fill);
|
|
98
|
+
border-color: var(--lt-color-danger-fill);
|
|
99
|
+
color: var(--lt-color-danger-content);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/*
|
|
103
|
+
* Disabled comes last.
|
|
104
|
+
*
|
|
105
|
+
* When the rule was above the variants, they won on order: a disabled
|
|
106
|
+
* secondary, ghost or danger button looked like an active one. The
|
|
107
|
+
* variants' hover is more specific than this wherever it stands, and a
|
|
108
|
+
* disabled button is still matched by `:hover`. So each of them excludes
|
|
109
|
+
* the disabled state itself.
|
|
110
|
+
*/
|
|
111
|
+
.lt-button:disabled,
|
|
112
|
+
.lt-button[aria-disabled="true"] {
|
|
113
|
+
background: var(--lt-color-disabled-surface);
|
|
114
|
+
color: var(--lt-color-disabled-text);
|
|
115
|
+
border-color: var(--lt-color-disabled-surface);
|
|
116
|
+
/* No pointer-events: none here. The browser already blocks a disabled
|
|
117
|
+
field, and pointer-events would only stop the cursor from showing. The
|
|
118
|
+
element is then not hit by the mouse at all. */
|
|
119
|
+
cursor: not-allowed;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/* aria-disabled is only information for screen readers; the element still
|
|
123
|
+
works. Here pointer-events stops the mouse, at the cost of the cursor.
|
|
124
|
+
If the field should really be off, use `disabled` or `readonly`. */
|
|
125
|
+
.lt-button[aria-disabled="true"] {
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const BUTTON_CLASS = "lt-button" as const
|
|
4
|
+
|
|
5
|
+
export const buttonVariants = [
|
|
6
|
+
"primary",
|
|
7
|
+
"secondary",
|
|
8
|
+
"ghost",
|
|
9
|
+
"danger",
|
|
10
|
+
] as const
|
|
11
|
+
|
|
12
|
+
export type ButtonVariant = (typeof buttonVariants)[number]
|
|
13
|
+
export type NonPrimaryButtonVariant = Exclude<ButtonVariant, "primary">
|
|
14
|
+
|
|
15
|
+
export type ButtonOptions = {
|
|
16
|
+
/** How weighty the action is. Default: `primary`. */
|
|
17
|
+
variant?: ButtonVariant
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type ButtonAttributes = {
|
|
21
|
+
class: typeof BUTTON_CLASS
|
|
22
|
+
"data-variant"?: NonPrimaryButtonVariant
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The attributes for a button.
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* <button {...button({ variant: "secondary" })}>Save draft</button>
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export const button = Object.assign(
|
|
33
|
+
({ variant = "primary" }: ButtonOptions = {}): ButtonAttributes =>
|
|
34
|
+
attributes({
|
|
35
|
+
class: BUTTON_CLASS,
|
|
36
|
+
"data-variant": variant === "primary" ? undefined : variant,
|
|
37
|
+
}),
|
|
38
|
+
{
|
|
39
|
+
/** The valid variants, for lookup and branching. */
|
|
40
|
+
variants: buttonVariants,
|
|
41
|
+
/** Checks whether a string from outside is a valid variant. */
|
|
42
|
+
isVariant: createGuard(buttonVariants),
|
|
43
|
+
},
|
|
44
|
+
)
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
@layer lotek {
|
|
2
|
+
.lt-card {
|
|
3
|
+
box-sizing: border-box;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
gap: var(--lt-spacing-2);
|
|
7
|
+
padding: var(--lt-card-padding, var(--lt-spacing-4));
|
|
8
|
+
/* The whole `font`, not just the family: a card that is a <button>
|
|
9
|
+
otherwise inherited the browser's button font, 13 pixels. */
|
|
10
|
+
font: inherit;
|
|
11
|
+
color: var(--lt-color-neutral-text-strong);
|
|
12
|
+
background: var(--lt-color-neutral-canvas);
|
|
13
|
+
border: 1px solid var(--lt-color-neutral-border-subtle);
|
|
14
|
+
border-radius: var(--lt-card-radius, var(--lt-spacing-2));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/*
|
|
18
|
+
* The card is a flex column, and a child is then stretched to the full
|
|
19
|
+
* width. A badge, a label, a button or a link should keep its natural
|
|
20
|
+
* width, or "Approved" became a band across the card. The rule asks for
|
|
21
|
+
* the element type and not the class: if other components' classes were
|
|
22
|
+
* here, the vocabulary would count them as the card's. Paragraphs, lists
|
|
23
|
+
* and images stretch as before.
|
|
24
|
+
*/
|
|
25
|
+
.lt-card > :where(span, a, button) {
|
|
26
|
+
align-self: flex-start;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.lt-card__title {
|
|
30
|
+
margin: 0;
|
|
31
|
+
font-size: var(--lt-font-size-l);
|
|
32
|
+
font-weight: var(--lt-font-weight-semibold);
|
|
33
|
+
line-height: var(--lt-line-height-compact);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/* Only the element counts, so a class on the paragraph wins: `lt-paragraph`
|
|
37
|
+
with its line height, `lt-help-text`, `lt-error-text` and an
|
|
38
|
+
`lt-card__title` that is a <p>. With `.lt-card p` the card beat them. */
|
|
39
|
+
:where(.lt-card) p {
|
|
40
|
+
margin: 0;
|
|
41
|
+
line-height: var(--lt-line-height-article);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.lt-card[data-variant="filled"] {
|
|
45
|
+
background: var(--lt-color-neutral-surface);
|
|
46
|
+
border-color: transparent;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* The whole card is clickable. The element is then an <a> or a <button>,
|
|
50
|
+
and the focus ring comes from there, not from here. */
|
|
51
|
+
.lt-card[data-interactive] {
|
|
52
|
+
text-align: start;
|
|
53
|
+
text-decoration: none;
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.lt-card[data-interactive]:hover {
|
|
58
|
+
border-color: var(--lt-color-accent-border);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.lt-card[data-interactive]:focus-visible {
|
|
62
|
+
outline: var(--lt-focus-ring);
|
|
63
|
+
outline-offset: 2px;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { attributes, createGuard } from "../shared.js"
|
|
2
|
+
|
|
3
|
+
export const CARD_CLASS = "lt-card" as const
|
|
4
|
+
/** The heading inside the card. */
|
|
5
|
+
export const CARD_TITLE_CLASS = "lt-card__title" as const
|
|
6
|
+
|
|
7
|
+
export const cardVariants = ["outline", "filled"] as const
|
|
8
|
+
|
|
9
|
+
export type CardVariant = (typeof cardVariants)[number]
|
|
10
|
+
export type NonDefaultCardVariant = Exclude<CardVariant, "outline">
|
|
11
|
+
|
|
12
|
+
export type CardOptions = {
|
|
13
|
+
/** Surface or outline. Default: `outline`. */
|
|
14
|
+
variant?: CardVariant
|
|
15
|
+
/** The whole card is clickable. Use only on `<a>` or `<button>`. */
|
|
16
|
+
interactive?: boolean
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type CardAttributes = {
|
|
20
|
+
class: typeof CARD_CLASS
|
|
21
|
+
"data-variant"?: NonDefaultCardVariant
|
|
22
|
+
"data-interactive"?: ""
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The attributes for a card.
|
|
27
|
+
*
|
|
28
|
+
* `interactive` gives hover and a focus ring, but makes nothing clickable by
|
|
29
|
+
* itself. If the whole card should be pressable, the element must be an
|
|
30
|
+
* `<a>` or a `<button>`. A `<div>` with a click listener can neither be
|
|
31
|
+
* reached with the keyboard nor be announced as something to press.
|
|
32
|
+
*
|
|
33
|
+
* ```ts
|
|
34
|
+
* <a {...card({ interactive: true })} href="/case/481">…</a>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export const card = Object.assign(
|
|
38
|
+
({ variant = "outline", interactive }: CardOptions = {}): CardAttributes =>
|
|
39
|
+
attributes({
|
|
40
|
+
class: CARD_CLASS,
|
|
41
|
+
"data-variant": variant === "outline" ? undefined : variant,
|
|
42
|
+
"data-interactive": interactive ? ("" as const) : undefined,
|
|
43
|
+
}),
|
|
44
|
+
{
|
|
45
|
+
/** The class on the heading inside the card. */
|
|
46
|
+
title: CARD_TITLE_CLASS,
|
|
47
|
+
variants: cardVariants,
|
|
48
|
+
isVariant: createGuard(cardVariants),
|
|
49
|
+
},
|
|
50
|
+
)
|