@mojawork/ui-docs 2.3.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/README.md +22 -0
- package/bin/serve.mjs +73 -0
- package/catalog/atoms/background.md +130 -0
- package/catalog/atoms/barcode.md +285 -0
- package/catalog/atoms/buzzer.md +210 -0
- package/catalog/atoms/card.md +174 -0
- package/catalog/atoms/chart.md +236 -0
- package/catalog/atoms/clock.md +252 -0
- package/catalog/atoms/copy-value.md +203 -0
- package/catalog/atoms/image-grid.md +208 -0
- package/catalog/atoms/image-slider.md +216 -0
- package/catalog/atoms/lang-selector.md +237 -0
- package/catalog/atoms/mosaic.md +366 -0
- package/catalog/atoms/placeholder.md +157 -0
- package/catalog/atoms/qr-code.md +334 -0
- package/catalog/atoms/rating.md +176 -0
- package/catalog/atoms/reader-doc.md +404 -0
- package/catalog/atoms/text-animate.md +122 -0
- package/catalog/atoms/thumb.md +153 -0
- package/catalog/atoms/timer.md +111 -0
- package/catalog/atoms/typewriter.md +132 -0
- package/catalog/cdk/splitter.md +63 -0
- package/catalog/cdk/table.md +188 -0
- package/catalog/forms/autocomplete.md +304 -0
- package/catalog/forms/checkbox.md +218 -0
- package/catalog/forms/input.md +193 -0
- package/catalog/forms/slider.md +142 -0
- package/catalog/forms/switch.md +188 -0
- package/catalog/guide.json +1209 -0
- package/catalog/layout/header.md +167 -0
- package/catalog/layout/main.md +158 -0
- package/catalog/layout/media-screen.md +163 -0
- package/catalog/layout/nav.md +181 -0
- package/catalog/layout/overlay.md +256 -0
- package/catalog/layout/spinner.md +94 -0
- package/catalog/layout/splitter.md +331 -0
- package/catalog/layout/tabs.md +144 -0
- package/catalog/layout/top-scroll-bottom.md +98 -0
- package/catalog/manifest.json +482 -0
- package/catalog/mcp.json +44 -0
- package/catalog/molecules/image-editor.md +285 -0
- package/catalog/usage.md +137 -0
- package/catalog/version.json +4 -0
- package/package.json +10 -0
- package/storybook/1183.da25800b.iframe.bundle.js +1 -0
- package/storybook/1255.2abec879.iframe.bundle.js +2 -0
- package/storybook/1255.2abec879.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/1516.52d2dae7.iframe.bundle.js +2 -0
- package/storybook/1516.52d2dae7.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/2033.c705a7ce.iframe.bundle.js +1 -0
- package/storybook/2089.32694489.iframe.bundle.js +1 -0
- package/storybook/2096.431fc8f5.iframe.bundle.js +1 -0
- package/storybook/2127.29f153d2.iframe.bundle.js +2 -0
- package/storybook/2127.29f153d2.iframe.bundle.js.LICENSE.txt +7 -0
- package/storybook/2228.77650ef1.iframe.bundle.js +2 -0
- package/storybook/2228.77650ef1.iframe.bundle.js.LICENSE.txt +1 -0
- package/storybook/2249.6e6782ab.iframe.bundle.js +1 -0
- package/storybook/2639.29baa8af.iframe.bundle.js +1 -0
- package/storybook/2844.c9f47654.iframe.bundle.js +1 -0
- package/storybook/2971.edb202b4.iframe.bundle.js +1 -0
- package/storybook/3899.55560628.iframe.bundle.js +2 -0
- package/storybook/3899.55560628.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/3968.69b812e4.iframe.bundle.js +1 -0
- package/storybook/4255.eeeaf087.iframe.bundle.js +111 -0
- package/storybook/4255.eeeaf087.iframe.bundle.js.LICENSE.txt +49 -0
- package/storybook/4255.eeeaf087.iframe.bundle.js.map +1 -0
- package/storybook/4425.368129b3.iframe.bundle.js +2 -0
- package/storybook/4425.368129b3.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/4476.f8e4115f.iframe.bundle.js +1 -0
- package/storybook/4495.d1c8cc8d.iframe.bundle.js +1 -0
- package/storybook/4555.066c242d.iframe.bundle.js +1 -0
- package/storybook/4755.e4656207.iframe.bundle.js +23 -0
- package/storybook/4755.e4656207.iframe.bundle.js.LICENSE.txt +14 -0
- package/storybook/4755.e4656207.iframe.bundle.js.map +1 -0
- package/storybook/4935.8959522b.iframe.bundle.js +1 -0
- package/storybook/5568.c6172f92.iframe.bundle.js +1 -0
- package/storybook/5944.810cb147.iframe.bundle.js +1 -0
- package/storybook/6115.7f1470ef.iframe.bundle.js +1 -0
- package/storybook/6169.eaeed989.iframe.bundle.js +2 -0
- package/storybook/6169.eaeed989.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/6202.b8ca0e90.iframe.bundle.js +2 -0
- package/storybook/6202.b8ca0e90.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/660.18f0458e.iframe.bundle.js +1 -0
- package/storybook/6824.f5eb8bb7.iframe.bundle.js +1 -0
- package/storybook/7316.5b024e94.iframe.bundle.js +1 -0
- package/storybook/7749.2a853795.iframe.bundle.js +1 -0
- package/storybook/8051.719eb790.iframe.bundle.js +1 -0
- package/storybook/813.805c1e5f.iframe.bundle.js +1 -0
- package/storybook/8448.1baeb046.iframe.bundle.js +1 -0
- package/storybook/871.428deceb.iframe.bundle.js +1 -0
- package/storybook/8819.220ca21d.iframe.bundle.js +1 -0
- package/storybook/9045.a50616e9.iframe.bundle.js +2 -0
- package/storybook/9045.a50616e9.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/9560.668052f3.iframe.bundle.js +7 -0
- package/storybook/9560.668052f3.iframe.bundle.js.map +1 -0
- package/storybook/973.67f44bb0.iframe.bundle.js +1 -0
- package/storybook/9850.28367747.iframe.bundle.js +1 -0
- package/storybook/9946.36014b4e.iframe.bundle.js +1 -0
- package/storybook/MaterialIcons-Regular.woff2 +0 -0
- package/storybook/MaterialIconsOutlined-Regular.woff2 +0 -0
- package/storybook/PetMe64.ttf +0 -0
- package/storybook/_external-mwork-banner-docs-mdx.0d5549a0.iframe.bundle.js +1 -0
- package/storybook/_external-mwork-banner-mwork-banner-stories.d44f6917.iframe.bundle.js +1 -0
- package/storybook/_external-mwork-basic-interpreter-docs-mdx.03c6205c.iframe.bundle.js +1 -0
- package/storybook/_external-mwork-basic-interpreter-mwork-basic-interpreter-stories.3252a9b8.iframe.bundle.js +1 -0
- package/storybook/_external-mwork-music-player-docs-mdx.6f943768.iframe.bundle.js +1 -0
- package/storybook/_external-mwork-music-player-mwork-music-player-stories.08fbf651.iframe.bundle.js +1 -0
- package/storybook/assets/fonts/PETME64-LICENSE.txt +20 -0
- package/storybook/assets/fonts/PetMe64.ttf +0 -0
- package/storybook/assets/fonts/icons/MaterialIcons-Regular.woff2 +0 -0
- package/storybook/assets/fonts/icons/MaterialIconsOutlined-Regular.woff2 +0 -0
- package/storybook/assets/ui/documents/demo.pdf +42 -0
- package/storybook/assets/ui/i18n/de-DE.json +1 -0
- package/storybook/assets/ui/i18n/en-EN.json +2 -0
- package/storybook/assets/ui/i18n/ui/de-DE.json +95 -0
- package/storybook/assets/ui/i18n/ui/en-EN.json +95 -0
- package/storybook/assets/ui/images/600x600.png +0 -0
- package/storybook/assets/ui/images/600x800.png +0 -0
- package/storybook/assets/ui/images/800x600.png +0 -0
- package/storybook/assets/ui/images/unknown.gif +0 -0
- package/storybook/atoms-_electrons-form-error-message-docs-mdx.5b9e78fe.iframe.bundle.js +1 -0
- package/storybook/atoms-_electrons-form-error-message-form-error-message-component-stories.7f749acc.iframe.bundle.js +1 -0
- package/storybook/atoms-background-background-component-stories.b6b50c0c.iframe.bundle.js +1 -0
- package/storybook/atoms-background-docs-mdx.4f102c17.iframe.bundle.js +1 -0
- package/storybook/atoms-barcode-barcode-component-stories.dc462559.iframe.bundle.js +1 -0
- package/storybook/atoms-barcode-docs-mdx.b74c501b.iframe.bundle.js +1 -0
- package/storybook/atoms-buzzer-buzzer-component-stories.13ee130d.iframe.bundle.js +1 -0
- package/storybook/atoms-buzzer-docs-mdx.23eb1913.iframe.bundle.js +1 -0
- package/storybook/atoms-card-card-component-stories.065b34e9.iframe.bundle.js +1 -0
- package/storybook/atoms-card-docs-mdx.7d276114.iframe.bundle.js +1 -0
- package/storybook/atoms-chart-chart-component-stories.5247b7cb.iframe.bundle.js +1 -0
- package/storybook/atoms-chart-docs-mdx.204609d4.iframe.bundle.js +1 -0
- package/storybook/atoms-clock-clock-component-stories.d1464731.iframe.bundle.js +1 -0
- package/storybook/atoms-clock-docs-mdx.501e6780.iframe.bundle.js +1 -0
- package/storybook/atoms-copy-value-copy-value-component-stories.58d3956a.iframe.bundle.js +1 -0
- package/storybook/atoms-copy-value-docs-mdx.f404dcd2.iframe.bundle.js +1 -0
- package/storybook/atoms-image-grid-docs-mdx.18b4df2a.iframe.bundle.js +1 -0
- package/storybook/atoms-image-grid-image-grid-component-stories.a0a92d9e.iframe.bundle.js +1 -0
- package/storybook/atoms-image-slider-docs-mdx.c616bb37.iframe.bundle.js +1 -0
- package/storybook/atoms-image-slider-image-slider-component-stories.484b9c41.iframe.bundle.js +1 -0
- package/storybook/atoms-lang-selector-docs-mdx.a327a27f.iframe.bundle.js +2 -0
- package/storybook/atoms-lang-selector-docs-mdx.a327a27f.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/atoms-lang-selector-lang-selector-component-stories.41d7efd1.iframe.bundle.js +2 -0
- package/storybook/atoms-lang-selector-lang-selector-component-stories.41d7efd1.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/atoms-mosaic-docs-mdx.1aebfbdf.iframe.bundle.js +1 -0
- package/storybook/atoms-mosaic-mosaic-component-stories.0a6bc043.iframe.bundle.js +1 -0
- package/storybook/atoms-placeholder-docs-mdx.cd2f3976.iframe.bundle.js +1 -0
- package/storybook/atoms-placeholder-placeholder-component-stories.bc221534.iframe.bundle.js +1 -0
- package/storybook/atoms-qr-code-docs-mdx.4202568d.iframe.bundle.js +1 -0
- package/storybook/atoms-qr-code-qr-code-component-stories.5018e2b0.iframe.bundle.js +1 -0
- package/storybook/atoms-rating-docs-mdx.32fa4104.iframe.bundle.js +1 -0
- package/storybook/atoms-rating-rating-component-stories.982db47d.iframe.bundle.js +1 -0
- package/storybook/atoms-reader-doc-docs-mdx.0688c3b9.iframe.bundle.js +1 -0
- package/storybook/atoms-reader-doc-reader-doc-component-stories.a6fec57d.iframe.bundle.js +1 -0
- package/storybook/atoms-text-animate-docs-mdx.05e1baf4.iframe.bundle.js +1 -0
- package/storybook/atoms-text-animate-text-animate-component-stories.8041c0f1.iframe.bundle.js +1 -0
- package/storybook/atoms-thumb-docs-mdx.2143ad01.iframe.bundle.js +1 -0
- package/storybook/atoms-thumb-thumb-component-stories.06f51d03.iframe.bundle.js +1 -0
- package/storybook/atoms-timer-docs-mdx.6f724cc8.iframe.bundle.js +1 -0
- package/storybook/atoms-timer-timer-component-stories.9bee1037.iframe.bundle.js +1 -0
- package/storybook/atoms-typewriter-docs-mdx.3b1088c0.iframe.bundle.js +1 -0
- package/storybook/atoms-typewriter-typewriter-component-stories.4fefc019.iframe.bundle.js +1 -0
- package/storybook/cdk-components-drag-and-drop-splitter-docs-mdx.f12088fd.iframe.bundle.js +1 -0
- package/storybook/cdk-components-drag-and-drop-splitter-splitter-component-stories.286b5171.iframe.bundle.js +1 -0
- package/storybook/cdk-components-table-docs-mdx.cc2c11e7.iframe.bundle.js +1 -0
- package/storybook/cdk-components-table-table-component-stories.db9212fd.iframe.bundle.js +1 -0
- package/storybook/examples-burger-menu-stories.0a083a75.iframe.bundle.js +1 -0
- package/storybook/examples-docs-mdx.3111f2c6.iframe.bundle.js +1 -0
- package/storybook/examples-image-grid-slider-docs-mdx.9e38157e.iframe.bundle.js +1 -0
- package/storybook/examples-image-grid-slider-image-grid-slider-stories.028c8c2b.iframe.bundle.js +1 -0
- package/storybook/examples-layout-docs-mdx.bbacdfd2.iframe.bundle.js +1 -0
- package/storybook/examples-layout-layout-stories.05cd891f.iframe.bundle.js +1 -0
- package/storybook/examples-table-edit-focus-docs-mdx.3c0d1611.iframe.bundle.js +1 -0
- package/storybook/examples-table-edit-focus-table-edit-focus-stories.c79e214a.iframe.bundle.js +1 -0
- package/storybook/examples-transloco-docs-mdx.97df7022.iframe.bundle.js +2 -0
- package/storybook/examples-transloco-docs-mdx.97df7022.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/examples-transloco-transloco-component-stories.5baea2e2.iframe.bundle.js +2 -0
- package/storybook/examples-transloco-transloco-component-stories.5baea2e2.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/favicon-wrapper.svg +46 -0
- package/storybook/favicon.svg +1 -0
- package/storybook/forms-autocomplete-autocomplete-component-stories.443544e0.iframe.bundle.js +2 -0
- package/storybook/forms-autocomplete-autocomplete-component-stories.443544e0.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/forms-autocomplete-docs-mdx.09beba1b.iframe.bundle.js +2 -0
- package/storybook/forms-autocomplete-docs-mdx.09beba1b.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/forms-autofocus-autofocus-stories.2e94d887.iframe.bundle.js +1 -0
- package/storybook/forms-autofocus-docs-mdx.39611362.iframe.bundle.js +1 -0
- package/storybook/forms-checkbox-checkbox-component-stories.d45b4f0d.iframe.bundle.js +1 -0
- package/storybook/forms-checkbox-docs-mdx.74036eb7.iframe.bundle.js +1 -0
- package/storybook/forms-input-docs-mdx.72d0e99a.iframe.bundle.js +1 -0
- package/storybook/forms-input-input-component-stories.609db3f0.iframe.bundle.js +1 -0
- package/storybook/forms-slider-docs-mdx.120cefc6.iframe.bundle.js +1 -0
- package/storybook/forms-slider-slider-component-stories.058fb9b1.iframe.bundle.js +1 -0
- package/storybook/forms-switch-docs-mdx.9d58a341.iframe.bundle.js +1 -0
- package/storybook/forms-switch-switch-component-stories.bf67d7c9.iframe.bundle.js +1 -0
- package/storybook/forms-validators-docs-mdx.ebb47a43.iframe.bundle.js +1 -0
- package/storybook/forms-validators-validators-component-stories.9525f97b.iframe.bundle.js +1 -0
- package/storybook/home-guide-mdx.1a176b15.iframe.bundle.js +1 -0
- package/storybook/home-overview-mdx.d0cf448a.iframe.bundle.js +1 -0
- package/storybook/home-tips-mdx.26df81d8.iframe.bundle.js +1 -0
- package/storybook/home-usage-mdx.7ba89dd0.iframe.bundle.js +1 -0
- package/storybook/iframe.html +558 -0
- package/storybook/index.html +155 -0
- package/storybook/index.json +1 -0
- package/storybook/layout-main-docs-mdx.4c9208c5.iframe.bundle.js +1 -0
- package/storybook/layout-main-main-component-stories.788c0c54.iframe.bundle.js +1 -0
- package/storybook/layout-media-screen-docs-mdx.b0ca9a06.iframe.bundle.js +2 -0
- package/storybook/layout-media-screen-docs-mdx.b0ca9a06.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/layout-media-screen-media-screen-component-stories.7941c064.iframe.bundle.js +2 -0
- package/storybook/layout-media-screen-media-screen-component-stories.7941c064.iframe.bundle.js.LICENSE.txt +5 -0
- package/storybook/layout-nav-docs-mdx.cc919f94.iframe.bundle.js +1 -0
- package/storybook/layout-nav-nav-component-stories.766738fc.iframe.bundle.js +1 -0
- package/storybook/layout-overlay-docs-mdx.823351e0.iframe.bundle.js +1 -0
- package/storybook/layout-overlay-header-docs-mdx.394033ca.iframe.bundle.js +1 -0
- package/storybook/layout-overlay-header-header-component-stories.5eaef192.iframe.bundle.js +1 -0
- package/storybook/layout-overlay-overlay-component-stories.01f6cd84.iframe.bundle.js +1 -0
- package/storybook/layout-spinner-docs-mdx.4be572c0.iframe.bundle.js +1 -0
- package/storybook/layout-spinner-spinner-component-stories.ab8245c6.iframe.bundle.js +1 -0
- package/storybook/layout-splitter-docs-mdx.bf161b39.iframe.bundle.js +1 -0
- package/storybook/layout-splitter-splitter-component-stories.46b8b112.iframe.bundle.js +1 -0
- package/storybook/layout-tabs-docs-mdx.89d83606.iframe.bundle.js +1 -0
- package/storybook/layout-tabs-tabs-component-stories.8602cefa.iframe.bundle.js +1 -0
- package/storybook/layout-top-scroll-bottom-docs-mdx.ddc061f8.iframe.bundle.js +1 -0
- package/storybook/layout-top-scroll-bottom-top-scroll-bottom-component-stories.9ee7055f.iframe.bundle.js +1 -0
- package/storybook/main.2d116a57.iframe.bundle.js +1 -0
- package/storybook/main.a402659c6a0734088d14.css +2101 -0
- package/storybook/mocker-runtime-injected.js +1 -0
- package/storybook/molecules-image-editor-docs-mdx.119ea12a.iframe.bundle.js +1 -0
- package/storybook/molecules-image-editor-image-editor-component-stories.56467f17.iframe.bundle.js +1 -0
- package/storybook/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook/nunito-sans-bold.woff2 +0 -0
- package/storybook/nunito-sans-italic.woff2 +0 -0
- package/storybook/nunito-sans-regular.woff2 +0 -0
- package/storybook/project.json +1 -0
- package/storybook/runtime~main.a9b8ab83.iframe.bundle.js +1 -0
- package/storybook/sb-addons/docs-1/manager-bundle.js +3 -0
- package/storybook/sb-addons/libs-ui-storybook-2/manager-bundle.js +3 -0
- package/storybook/sb-addons/storybook-core-server-presets-0/common-manager-bundle.js +630 -0
- package/storybook/sb-common-assets/favicon-wrapper.svg +46 -0
- package/storybook/sb-common-assets/favicon.svg +1 -0
- package/storybook/sb-common-assets/nunito-sans-bold-italic.woff2 +0 -0
- package/storybook/sb-common-assets/nunito-sans-bold.woff2 +0 -0
- package/storybook/sb-common-assets/nunito-sans-italic.woff2 +0 -0
- package/storybook/sb-common-assets/nunito-sans-regular.woff2 +0 -0
- package/storybook/sb-manager/globals-runtime.js +76714 -0
- package/storybook/sb-manager/globals.js +24 -0
- package/storybook/sb-manager/manager-stores.js +23 -0
- package/storybook/sb-manager/runtime.js +27451 -0
- package/storybook/sb-preview/globals.js +20 -0
- package/storybook/sb-preview/runtime.js +35491 -0
- package/storybook/styling-colors-colors-component-stories.58031f40.iframe.bundle.js +1 -0
- package/storybook/styling-colors-docs-mdx.95c504e4.iframe.bundle.js +1 -0
- package/storybook/styling-css-variables-docs-mdx.48afb4f3.iframe.bundle.js +1 -0
- package/storybook/styling-forms-docs-mdx.943e72f2.iframe.bundle.js +1 -0
- package/storybook/styling-forms-forms-component-stories.8af76278.iframe.bundle.js +1 -0
- package/storybook/styling-icons-docs-mdx.e1001dfd.iframe.bundle.js +1 -0
- package/storybook/styling-icons-icons-component-stories.2dd8c6f8.iframe.bundle.js +1 -0
- package/storybook/styling-layers-docs-mdx.5039dc45.iframe.bundle.js +1 -0
- package/storybook/styling-tags-docs-mdx.23ab2316.iframe.bundle.js +1 -0
- package/storybook/styling-tags-tags-component-stories.7a64bd20.iframe.bundle.js +1 -0
- package/storybook/styling-ui-tags-docs-mdx.8f75631d.iframe.bundle.js +1 -0
- package/storybook/styling-ui-tags-ui-tags-component-stories.2ec3109b.iframe.bundle.js +1 -0
- package/storybook/version.json +4 -0
- package/version.json +4 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
### QR Code
|
|
2
|
+
|
|
3
|
+
Draws a value as an inline SVG QR code.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### What it does, and what it does not
|
|
8
|
+
|
|
9
|
+
It encodes and draws, and nothing else. The generator is written out rather
|
|
10
|
+
than pulled in: byte mode only, UTF-8, versions 1 to 40, all four error
|
|
11
|
+
correction levels. Numeric and alphanumeric modes would save space on
|
|
12
|
+
digit-only payloads and buy nothing for the URLs this is built for; kanji mode
|
|
13
|
+
and ECI are out entirely.
|
|
14
|
+
|
|
15
|
+
Adjacent dark modules in a row are merged into single rects, so a large code
|
|
16
|
+
costs a few hundred elements rather than a few thousand.
|
|
17
|
+
|
|
18
|
+
#### Story: Default
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
export const Default: Story = {
|
|
22
|
+
args: { value: 'https://moja.work', level: 'M' },
|
|
23
|
+
render: (args) => ({
|
|
24
|
+
props: { ...args },
|
|
25
|
+
template: `<ui-qr-code [value]="value" [level]="level"></ui-qr-code>`,
|
|
26
|
+
}),
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The four error correction levels at the same payload. Higher correction
|
|
31
|
+
* survives more damage and costs modules: L recovers about 7% of the code,
|
|
32
|
+
* H about 30%, and the grid grows accordingly.
|
|
33
|
+
*/
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
> **Guide:** recommendations for `ui-qr-code` — use for, not for, instead, shown in — are served by `get_guide` (name: `ui-qr-code`). The section above is the truth; the guide is the offer.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
### Error correction
|
|
43
|
+
|
|
44
|
+
Higher correction survives more damage and costs modules: `L` recovers roughly
|
|
45
|
+
7% of the code, `H` roughly 30%, and the grid grows to pay for it. `M` is the
|
|
46
|
+
ordinary choice and the default.
|
|
47
|
+
|
|
48
|
+
Worth raising when the code will be printed small, on something that creases,
|
|
49
|
+
or on a surface that gets handled.
|
|
50
|
+
|
|
51
|
+
#### Story: Levels
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
export const Levels: Story = {
|
|
55
|
+
// The four levels are named in the template, so the level control would sit
|
|
56
|
+
// there offering a setting this story does not read. The value control stays
|
|
57
|
+
// — it moves all four at once, which is exactly the comparison.
|
|
58
|
+
argTypes: { level: { table: { disable: true } } },
|
|
59
|
+
args: { value: 'https://moja.work' },
|
|
60
|
+
render: (args) => ({
|
|
61
|
+
props: { ...args },
|
|
62
|
+
template: `
|
|
63
|
+
<section class="grid grid-cols-4 gap-4">
|
|
64
|
+
<ui-qr-code class="w-full" [value]="value" [level]="'L'"></ui-qr-code>
|
|
65
|
+
<ui-qr-code class="w-full" [value]="value" [level]="'M'"></ui-qr-code>
|
|
66
|
+
<ui-qr-code class="w-full" [value]="value" [level]="'Q'"></ui-qr-code>
|
|
67
|
+
<ui-qr-code class="w-full" [value]="value" [level]="'H'"></ui-qr-code>
|
|
68
|
+
</section>
|
|
69
|
+
`,
|
|
70
|
+
}),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Size comes from the outside. `shape-rendering: crispEdges` keeps the
|
|
75
|
+
* modules meeting edge to edge at every size — without it a browser leaves
|
|
76
|
+
* hairlines between them and a scanner reading off the screen sees a grid
|
|
77
|
+
* that is not quite solid.
|
|
78
|
+
*/
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
### Size
|
|
84
|
+
|
|
85
|
+
Size comes from the outside; the SVG fills the width it is given. The component
|
|
86
|
+
brings a default width so it is visible without any styling at all.
|
|
87
|
+
|
|
88
|
+
`shape-rendering: crispEdges` keeps the modules meeting edge to edge at every
|
|
89
|
+
size. Without it a browser that antialiases the rect borders leaves hairlines
|
|
90
|
+
between them, and a scanner reading off a screen sees a grid that is not quite
|
|
91
|
+
solid.
|
|
92
|
+
|
|
93
|
+
#### Story: Sizes
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
export const Sizes: Story = {
|
|
97
|
+
args: { value: 'https://moja.work', level: 'M' },
|
|
98
|
+
render: (args) => ({
|
|
99
|
+
props: { ...args },
|
|
100
|
+
template: `
|
|
101
|
+
<section class="flex flex-wrap items-start gap-4">
|
|
102
|
+
<ui-qr-code class="w-24" [value]="value" [level]="level"></ui-qr-code>
|
|
103
|
+
<ui-qr-code class="w-40" [value]="value" [level]="level"></ui-qr-code>
|
|
104
|
+
<ui-qr-code class="w-64" [value]="value" [level]="level"></ui-qr-code>
|
|
105
|
+
</section>
|
|
106
|
+
`,
|
|
107
|
+
}),
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Black on white in both themes, on purpose — same reason as the barcode.
|
|
112
|
+
*/
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### Always black on white
|
|
118
|
+
|
|
119
|
+
Same reason as the barcode: this is meant to be scanned, and a scanner has no
|
|
120
|
+
opinion about dark mode.
|
|
121
|
+
|
|
122
|
+
#### Story: OnDarkSurface
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
export const OnDarkSurface: Story = {
|
|
126
|
+
args: { value: 'https://moja.work', level: 'M' },
|
|
127
|
+
render: (args) => ({
|
|
128
|
+
props: { ...args },
|
|
129
|
+
template: `
|
|
130
|
+
<section class="flex gap-4 bg-black p-8">
|
|
131
|
+
<ui-qr-code class="w-48" [value]="value" [level]="level"></ui-qr-code>
|
|
132
|
+
</section>
|
|
133
|
+
`,
|
|
134
|
+
}),
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Nothing given at all. That is not a failure and does not read like one — the
|
|
139
|
+
* component states it quietly and reports `null` rather than `true`, so a form
|
|
140
|
+
* does not accuse a field nobody has filled in yet.
|
|
141
|
+
*/
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
### There is exactly one way to fail
|
|
147
|
+
|
|
148
|
+
A value is refused when it is past the capacity of version 40 at the chosen
|
|
149
|
+
level. Nothing else: the version grows to fit, so everything short of that
|
|
150
|
+
resolves itself without anyone noticing.
|
|
151
|
+
|
|
152
|
+
How much fits depends on the level — 2953 bytes at `L`, 2331 at `M`, 1663 at
|
|
153
|
+
`Q`, 1273 at `H`. Bytes, not characters: an umlaut costs two, an emoji four.
|
|
154
|
+
These four numbers are pinned to `qrFits` by `qr-code.capacity.spec.ts` — if
|
|
155
|
+
the capacity tables ever change, the test fails and this sentence follows.
|
|
156
|
+
|
|
157
|
+
Long before that limit the practical one arrives. Version 40 is a grid of
|
|
158
|
+
177×177 modules, and printed on a label that is no longer scannable — which is
|
|
159
|
+
why the level is never quietly lowered to make something fit. A code that is
|
|
160
|
+
technically drawn and practically unreadable is worse than a sentence saying it
|
|
161
|
+
does not fit.
|
|
162
|
+
|
|
163
|
+
#### Story: OverCapacity
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
export const OverCapacity: Story = {
|
|
167
|
+
// Both the payload and the two levels come from the story itself; neither
|
|
168
|
+
// control would move anything here.
|
|
169
|
+
parameters: { controls: { disable: true } },
|
|
170
|
+
render: () => ({
|
|
171
|
+
props: { long: 'x'.repeat(2500) },
|
|
172
|
+
template: `
|
|
173
|
+
<section class="flex flex-col items-start gap-4">
|
|
174
|
+
<ui-qr-code class="w-48" [value]="long" [level]="'H'"></ui-qr-code>
|
|
175
|
+
<ui-qr-code class="w-48" [value]="long" [level]="'L'"></ui-qr-code>
|
|
176
|
+
</section>
|
|
177
|
+
`,
|
|
178
|
+
}),
|
|
179
|
+
};
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
### An empty value is not a failure
|
|
185
|
+
|
|
186
|
+
Nothing given means nothing was asked. The component says so quietly and reports
|
|
187
|
+
`null` instead of `true`, so a form does not accuse a field nobody has filled in
|
|
188
|
+
yet.
|
|
189
|
+
|
|
190
|
+
The text is a statement, not a request: only whoever supplies the value knows
|
|
191
|
+
what is missing, and whether there is a field to type it into at all.
|
|
192
|
+
|
|
193
|
+
#### Story: EmptyValue
|
|
194
|
+
|
|
195
|
+
```ts
|
|
196
|
+
export const EmptyValue: Story = {
|
|
197
|
+
args: { value: '', level: 'M' },
|
|
198
|
+
render: (args) => ({
|
|
199
|
+
props: { ...args },
|
|
200
|
+
template: `<ui-qr-code [value]="value" [level]="level"></ui-qr-code>`,
|
|
201
|
+
}),
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The one way a value can fail: past the capacity of version 40. Everything
|
|
206
|
+
* short of that resolves itself, because the version grows to fit.
|
|
207
|
+
*
|
|
208
|
+
* The same payload changes sides with the level — `H` keeps a third of the
|
|
209
|
+
* code recoverable and pays for it in space, so it runs out first.
|
|
210
|
+
*/
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### Properties
|
|
216
|
+
|
|
217
|
+
<table>
|
|
218
|
+
<thead>
|
|
219
|
+
<tr>
|
|
220
|
+
<th>Name</th>
|
|
221
|
+
<th>Type</th>
|
|
222
|
+
<th>Default</th>
|
|
223
|
+
<th>Description</th>
|
|
224
|
+
</tr>
|
|
225
|
+
</thead>
|
|
226
|
+
<tbody>
|
|
227
|
+
<tr>
|
|
228
|
+
<td><code>value</code></td>
|
|
229
|
+
<td><code>string</code></td>
|
|
230
|
+
<td>— (required)</td>
|
|
231
|
+
<td>The payload — a URL, an identifier, any text.</td>
|
|
232
|
+
</tr>
|
|
233
|
+
<tr>
|
|
234
|
+
<td><code>level</code></td>
|
|
235
|
+
<td><code>UiQrErrorCorrectionLevel</code></td>
|
|
236
|
+
<td><code>'M'</code></td>
|
|
237
|
+
<td>
|
|
238
|
+
Error correction level: <code>'L'</code>, <code>'M'</code>,{' '}
|
|
239
|
+
<code>'Q'</code> or <code>'H'</code>.
|
|
240
|
+
</td>
|
|
241
|
+
</tr>
|
|
242
|
+
</tbody>
|
|
243
|
+
</table>
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
### Outputs
|
|
248
|
+
|
|
249
|
+
<table>
|
|
250
|
+
<thead>
|
|
251
|
+
<tr>
|
|
252
|
+
<th>Name</th>
|
|
253
|
+
<th>Type</th>
|
|
254
|
+
<th>Description</th>
|
|
255
|
+
</tr>
|
|
256
|
+
</thead>
|
|
257
|
+
<tbody>
|
|
258
|
+
<tr>
|
|
259
|
+
<td><code>overCapacity</code></td>
|
|
260
|
+
<td><code>boolean | null</code></td>
|
|
261
|
+
<td>
|
|
262
|
+
Whether a value that was given is too large to encode.{' '}
|
|
263
|
+
<code>null</code> means nothing was asked of the component: an empty
|
|
264
|
+
value is not a failure, it is simply nothing to encode.
|
|
265
|
+
<br />
|
|
266
|
+
<br />
|
|
267
|
+
It reports a <strong>state</strong>, not an event, and therefore fires
|
|
268
|
+
once on init and again on every change — including the one that puts
|
|
269
|
+
things right. A form bound to a changing value is told when the trouble
|
|
270
|
+
is over as well as when it starts.
|
|
271
|
+
</td>
|
|
272
|
+
</tr>
|
|
273
|
+
</tbody>
|
|
274
|
+
</table>
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
### Exported functions
|
|
279
|
+
|
|
280
|
+
<table>
|
|
281
|
+
<thead>
|
|
282
|
+
<tr>
|
|
283
|
+
<th>Name</th>
|
|
284
|
+
<th>Signature</th>
|
|
285
|
+
<th>Description</th>
|
|
286
|
+
</tr>
|
|
287
|
+
</thead>
|
|
288
|
+
<tbody>
|
|
289
|
+
<tr>
|
|
290
|
+
<td><code>qrFits</code></td>
|
|
291
|
+
<td>
|
|
292
|
+
<code>(value: string, level) => boolean</code>
|
|
293
|
+
</td>
|
|
294
|
+
<td>
|
|
295
|
+
Whether a value still fits — the question the component asks before it
|
|
296
|
+
encodes anything, so a defect in the generator stays a defect instead of
|
|
297
|
+
being reported as "too much text".
|
|
298
|
+
</td>
|
|
299
|
+
</tr>
|
|
300
|
+
<tr>
|
|
301
|
+
<td><code>qrCodeMatrix</code></td>
|
|
302
|
+
<td>
|
|
303
|
+
<code>(value: string, level?) => boolean[][]</code>
|
|
304
|
+
</td>
|
|
305
|
+
<td>
|
|
306
|
+
The finished module grid, <code>true</code> is dark. Throws on an empty
|
|
307
|
+
value and on one past capacity.
|
|
308
|
+
</td>
|
|
309
|
+
</tr>
|
|
310
|
+
<tr>
|
|
311
|
+
<td>
|
|
312
|
+
<code>qrDataCodewords</code>, <code>qrVersionFor</code>,{' '}
|
|
313
|
+
<code>qrSize</code>
|
|
314
|
+
</td>
|
|
315
|
+
<td>—</td>
|
|
316
|
+
<td>
|
|
317
|
+
The capacity arithmetic, exported so a caller that wants numbers in its
|
|
318
|
+
own message can ask rather than reimplement the tables.
|
|
319
|
+
</td>
|
|
320
|
+
</tr>
|
|
321
|
+
</tbody>
|
|
322
|
+
</table>
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
### Sizing
|
|
327
|
+
|
|
328
|
+
The host renders at `12rem` by default. Size it from the outside either with a
|
|
329
|
+
width utility, or — with no dependence on cascade-layer order — through the
|
|
330
|
+
named hook `--ui-qr-code-size`:
|
|
331
|
+
|
|
332
|
+
```html
|
|
333
|
+
<ui-qr-code value="…" style="--ui-qr-code-size: 20rem"></ui-qr-code>
|
|
334
|
+
```
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
### Rating
|
|
2
|
+
|
|
3
|
+
A CSS-only rating display: a horizontal 0–100% bar shines through an icon
|
|
4
|
+
mask. The Material icon glyphs clip a two-stop gradient
|
|
5
|
+
(`background-clip: text`), so the fill is visible only inside the icon
|
|
6
|
+
shapes — five stars at 70% read as 3.5 filled stars. Works with any
|
|
7
|
+
Material glyph; colours and size are CSS variables, so they take any CSS
|
|
8
|
+
color, including `var(--ui-c-*)` tokens (theme aware).
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
### What it does, and what it does not
|
|
13
|
+
|
|
14
|
+
Shows a 0–100 % fill through a row of icon-shaped masks — five stars at 70 %
|
|
15
|
+
read as three and a half. It is a display, not a control: it takes nothing from
|
|
16
|
+
the reader, emits nothing and holds no form state. Values outside the range are
|
|
17
|
+
clamped; what the number means and where it comes from stays with the host.
|
|
18
|
+
Colours and size are CSS variables, not inputs.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
> **Guide:** recommendations for `ui-rating` — use for, not for, instead, shown in — are served by `get_guide` (name: `ui-rating`). The section above is the truth; the guide is the offer.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
### Properties
|
|
27
|
+
|
|
28
|
+
<table class="ui">
|
|
29
|
+
<thead>
|
|
30
|
+
<tr>
|
|
31
|
+
<th>Input</th>
|
|
32
|
+
<th>Type</th>
|
|
33
|
+
<th>Default</th>
|
|
34
|
+
<th>Description</th>
|
|
35
|
+
</tr>
|
|
36
|
+
</thead>
|
|
37
|
+
<tbody>
|
|
38
|
+
<tr>
|
|
39
|
+
<td><code>value</code></td>
|
|
40
|
+
<td><code>number</code></td>
|
|
41
|
+
<td><code>0</code></td>
|
|
42
|
+
<td>Fill level in percent (0–100); out-of-range values are clamped.</td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td><code>icon</code></td>
|
|
46
|
+
<td><code>string</code></td>
|
|
47
|
+
<td><code>'star'</code></td>
|
|
48
|
+
<td>Material icon glyph used as the mask shape.</td>
|
|
49
|
+
</tr>
|
|
50
|
+
<tr>
|
|
51
|
+
<td><code>count</code></td>
|
|
52
|
+
<td><code>number</code></td>
|
|
53
|
+
<td><code>5</code></td>
|
|
54
|
+
<td>Number of icons in the row.</td>
|
|
55
|
+
</tr>
|
|
56
|
+
</tbody>
|
|
57
|
+
</table>
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
### CSS variables
|
|
62
|
+
|
|
63
|
+
Colours and size are CSS variables, not inputs — set them from the outside,
|
|
64
|
+
on the tag or once on a container; each defaults to a library token:
|
|
65
|
+
|
|
66
|
+
- `--ui-rating-color`: the filled part. Default `var(--ui-c-focus)`.
|
|
67
|
+
- `--ui-rating-track`: the unfilled part. Default `var(--ui-c-fourthly)`.
|
|
68
|
+
- `--ui-rating-size`: the icon size. Default `var(--ui-icon-size)`.
|
|
69
|
+
- `--ui-icon-font`: the glyph font, shared with `.ui-icon` — swap it once and
|
|
70
|
+
the rating follows (see the icons page).
|
|
71
|
+
|
|
72
|
+
The component writes none of these itself, so a value you set in a stylesheet
|
|
73
|
+
is never overruled from inside the library. The only custom property it does
|
|
74
|
+
write is the fill position, and that one is read from `value`.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
### Accessibility
|
|
79
|
+
|
|
80
|
+
The glyph row is hidden from assistive technology — read aloud it would be
|
|
81
|
+
"star star star star star". The tag itself is a **meter** from 0 to 100 and
|
|
82
|
+
reports the clamped `value` as `aria-valuenow`.
|
|
83
|
+
|
|
84
|
+
Two things the component cannot know, so the tag has to bring them:
|
|
85
|
+
|
|
86
|
+
- **A name.** A meter without one is an error, not a silent gap — write
|
|
87
|
+
`aria-label` on the tag.
|
|
88
|
+
- **The words for the value**, if "70 percent" is not what you would say.
|
|
89
|
+
`aria-valuetext="7 of 10"` replaces the percentage in what is announced.
|
|
90
|
+
|
|
91
|
+
```html
|
|
92
|
+
<ui-rating [value]="70" aria-label="Rating" aria-valuetext="7 of 10"></ui-rating>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
### Basic Example
|
|
98
|
+
|
|
99
|
+
70% over five stars — 3.5 filled stars. The three colour and size knobs
|
|
100
|
+
in the panel bind the CSS variables on the tag:
|
|
101
|
+
|
|
102
|
+
#### Story: Rating
|
|
103
|
+
|
|
104
|
+
```ts
|
|
105
|
+
export const Rating: Story = {};
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
### Variants
|
|
111
|
+
|
|
112
|
+
Different glyphs, counts, sizes and token colours, each set through the
|
|
113
|
+
variables:
|
|
114
|
+
|
|
115
|
+
#### Story: RatingOverview
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
export const RatingOverview: Story = {
|
|
119
|
+
// Every row binds from its own list, not from the args — a panel here would
|
|
120
|
+
// offer settings that move nothing.
|
|
121
|
+
parameters: { controls: { disable: true } },
|
|
122
|
+
render: () => ({
|
|
123
|
+
props: {
|
|
124
|
+
// colors ARE the demonstrated example here (allowed per story rules)
|
|
125
|
+
variants: [
|
|
126
|
+
{ value: 70, color: null, trackColor: null, icon: 'star', count: 5, size: null },
|
|
127
|
+
{ value: 50, color: 'var(--ui-c-warn)', trackColor: null, icon: 'star', count: 5, size: null },
|
|
128
|
+
{ value: 88, color: 'var(--ui-c-error)', trackColor: null, icon: 'favorite', count: 5, size: '6rem' },
|
|
129
|
+
{ value: 30, color: 'var(--ui-c-success)', trackColor: 'var(--ui-c-secondary)', icon: 'pets', count: 8, size: '4rem' },
|
|
130
|
+
{ value: 100, color: 'var(--ui-c-focus)', trackColor: null, icon: 'bolt', count: 3, size: '8rem' },
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
template: `
|
|
134
|
+
<section class="relative flex flex-col gap-4 p-4">
|
|
135
|
+
@for (variant of variants; track $index) {
|
|
136
|
+
<ui-rating
|
|
137
|
+
aria-label="Rating"
|
|
138
|
+
[value]="variant.value"
|
|
139
|
+
[icon]="variant.icon"
|
|
140
|
+
[count]="variant.count"
|
|
141
|
+
[style.--ui-rating-color]="variant.color"
|
|
142
|
+
[style.--ui-rating-track]="variant.trackColor"
|
|
143
|
+
[style.--ui-rating-size]="variant.size"
|
|
144
|
+
></ui-rating>
|
|
145
|
+
}
|
|
146
|
+
</section>
|
|
147
|
+
`,
|
|
148
|
+
}),
|
|
149
|
+
};
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### Usage
|
|
155
|
+
|
|
156
|
+
```html
|
|
157
|
+
<ui-rating [value]="70" aria-label="Rating"></ui-rating>
|
|
158
|
+
|
|
159
|
+
<ui-rating
|
|
160
|
+
[value]="ratingSignal()"
|
|
161
|
+
icon="favorite"
|
|
162
|
+
[count]="5"
|
|
163
|
+
[style.--ui-rating-color]="'var(--ui-c-warn)'"
|
|
164
|
+
[style.--ui-rating-size]="'1.6rem'"
|
|
165
|
+
aria-label="Rating"
|
|
166
|
+
></ui-rating>
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Or from a stylesheet, for every rating below a container:
|
|
170
|
+
|
|
171
|
+
```css
|
|
172
|
+
.reviews {
|
|
173
|
+
--ui-rating-color: var(--ui-c-warn);
|
|
174
|
+
--ui-rating-size: 1.6rem;
|
|
175
|
+
}
|
|
176
|
+
```
|