@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,252 @@
|
|
|
1
|
+
### Clock
|
|
2
|
+
|
|
3
|
+
A digital seven-segment clock with faintly glowing ghost segments, a blinking
|
|
4
|
+
colon and a solid, borderless casing.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
### What it does, and what it does not
|
|
9
|
+
|
|
10
|
+
A seven-segment digital clock drawn in CSS: the current system time, or a fixed
|
|
11
|
+
`time` handed in, with ghost segments, a blinking colon and a visually hidden
|
|
12
|
+
`<time>` for assistive technology. It shows time and does nothing with it — no
|
|
13
|
+
alarms, no time zones, no formats beyond 12/24 hours and the optional seconds.
|
|
14
|
+
Its size is a `scale` transform, so the layout box keeps the base size.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
> **Guide:** recommendations for `ui-clock` — use for, not for, instead, shown in — are served by `get_guide` (name: `ui-clock`). The section above is the truth; the guide is the offer.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### Overview
|
|
23
|
+
|
|
24
|
+
The `UiClockComponent` renders the current system time (or a fixed time passed
|
|
25
|
+
via `time`) as CSS-drawn seven-segment digits. Every segment is always
|
|
26
|
+
rendered: unlit segments shine faintly (the classic `88:88` LCD ghost look),
|
|
27
|
+
lit segments are drawn in full color on top.
|
|
28
|
+
|
|
29
|
+
The clock has a fixed base size; the `scale` input scales the whole component
|
|
30
|
+
via CSS `transform`. Note that a transform does not affect layout — the
|
|
31
|
+
reserved layout box keeps the base size. Colors fall back to theme-aware ui
|
|
32
|
+
tokens when no inputs are set, so the component works in light and dark themes
|
|
33
|
+
out of the box.
|
|
34
|
+
|
|
35
|
+
For accessibility the time is additionally rendered as a visually hidden
|
|
36
|
+
`<time>` element with a machine-readable 24h `datetime` attribute; the segment
|
|
37
|
+
display itself is `aria-hidden`.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
### Properties
|
|
42
|
+
|
|
43
|
+
<table>
|
|
44
|
+
<thead>
|
|
45
|
+
<tr>
|
|
46
|
+
<th>Property</th>
|
|
47
|
+
<th>Type</th>
|
|
48
|
+
<th>Description</th>
|
|
49
|
+
</tr>
|
|
50
|
+
</thead>
|
|
51
|
+
<tbody>
|
|
52
|
+
<tr>
|
|
53
|
+
<td>time</td>
|
|
54
|
+
<td>Input<Date | null></td>
|
|
55
|
+
<td>Fixed time to display; `null` (default) shows the live system time, ticking every second.</td>
|
|
56
|
+
</tr>
|
|
57
|
+
<tr>
|
|
58
|
+
<td>showSeconds</td>
|
|
59
|
+
<td>Input<boolean></td>
|
|
60
|
+
<td>Display seconds (`HH:MM:SS` instead of `HH:MM`, default: `false`).</td>
|
|
61
|
+
</tr>
|
|
62
|
+
<tr>
|
|
63
|
+
<td>format</td>
|
|
64
|
+
<td>Input<12 | 24></td>
|
|
65
|
+
<td>Hour format of the display (default: `24`). The `datetime` attribute always stays 24h.</td>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<td>blink</td>
|
|
69
|
+
<td>Input<boolean></td>
|
|
70
|
+
<td>Blink the colon separators once per second (default: `true`).</td>
|
|
71
|
+
</tr>
|
|
72
|
+
<tr>
|
|
73
|
+
<td>scale</td>
|
|
74
|
+
<td>Input<number></td>
|
|
75
|
+
<td>Scale factor applied to the whole component via CSS transform (default: `2`).</td>
|
|
76
|
+
</tr>
|
|
77
|
+
</tbody>
|
|
78
|
+
</table>
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
### Live Clock
|
|
83
|
+
|
|
84
|
+
The default story shows the live system time with the blinking colon.
|
|
85
|
+
|
|
86
|
+
#### Story: Default
|
|
87
|
+
|
|
88
|
+
```ts
|
|
89
|
+
export const Default: Story = {};
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
### Fixed Time
|
|
95
|
+
|
|
96
|
+
A fixed `time` stops the live interval — useful for deterministic displays and
|
|
97
|
+
tests.
|
|
98
|
+
|
|
99
|
+
#### Story: FixedTime
|
|
100
|
+
|
|
101
|
+
```ts
|
|
102
|
+
export const FixedTime: Story = {
|
|
103
|
+
argTypes: withoutColors,
|
|
104
|
+
args: {
|
|
105
|
+
time: new Date(2026, 6, 21, 13, 37),
|
|
106
|
+
blink: false,
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
### Seconds
|
|
114
|
+
|
|
115
|
+
#### Story: Seconds
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
export const Seconds: Story = {
|
|
119
|
+
argTypes: withoutColors,
|
|
120
|
+
args: {
|
|
121
|
+
showSeconds: true,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
### Twelve Hour Format
|
|
129
|
+
|
|
130
|
+
The display shows `01:37`, while the hidden `datetime` attribute keeps the
|
|
131
|
+
machine-readable 24h value `13:37`.
|
|
132
|
+
|
|
133
|
+
#### Story: TwelveHour
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
export const TwelveHour: Story = {
|
|
137
|
+
argTypes: withoutColors,
|
|
138
|
+
args: {
|
|
139
|
+
time: new Date(2026, 6, 21, 13, 37),
|
|
140
|
+
format: 12,
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Colors are the subject of this example (classic LCD look), hence allowed.
|
|
145
|
+
/**
|
|
146
|
+
* The colours are the subject here, so their controls are switched back on for
|
|
147
|
+
* this story alone. They are CSS variables on the outside — `--ui-clock-bg`
|
|
148
|
+
* and `--ui-clock-color` — not component inputs.
|
|
149
|
+
*/
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
### CSS variables
|
|
155
|
+
|
|
156
|
+
Colours are CSS variables, not inputs — set them from the outside, each
|
|
157
|
+
defaulting to its `--ui-c-*` token:
|
|
158
|
+
|
|
159
|
+
- `--ui-clock-bg`: the solid casing. Default `var(--ui-c-secondary)`.
|
|
160
|
+
- `--ui-clock-color`: the lit segments. Default `var(--ui-c-default)`.
|
|
161
|
+
- `--ui-clock-off`: the unlit ghost segments. Unset, they are the lit colour at
|
|
162
|
+
10% (via `color-mix`); set it to any colour for full-strength segments.
|
|
163
|
+
|
|
164
|
+
### Custom Colors
|
|
165
|
+
|
|
166
|
+
`--ui-clock-bg` and `--ui-clock-color` accept any CSS colour value; the ghost
|
|
167
|
+
segments derive from `--ui-clock-color` automatically. The story sets them, so
|
|
168
|
+
the colours are the example.
|
|
169
|
+
|
|
170
|
+
#### Story: CustomColors
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
export const CustomColors: Story = {
|
|
174
|
+
args: {
|
|
175
|
+
background: '#101010',
|
|
176
|
+
color: '#7dffb3',
|
|
177
|
+
},
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/** Same again, with the unlit ghost segments given a colour of their own. */
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
### Custom Off Color
|
|
186
|
+
|
|
187
|
+
Setting `--ui-clock-off` replaces the derived ghost colour with a full-strength
|
|
188
|
+
one.
|
|
189
|
+
|
|
190
|
+
#### Story: CustomOffColor
|
|
191
|
+
|
|
192
|
+
```ts
|
|
193
|
+
export const CustomOffColor: Story = {
|
|
194
|
+
args: {
|
|
195
|
+
time: new Date(2026, 6, 21, 8, 8),
|
|
196
|
+
background: '#1c1c1c',
|
|
197
|
+
color: '#ff5533',
|
|
198
|
+
offColor: '#3a2a26',
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
### Sizing
|
|
206
|
+
|
|
207
|
+
The clock has a fixed base size; the `scale` input scales the whole component
|
|
208
|
+
via CSS transform.
|
|
209
|
+
|
|
210
|
+
#### Story: Sizing
|
|
211
|
+
|
|
212
|
+
```ts
|
|
213
|
+
export const Sizing: Story = {
|
|
214
|
+
// The three clocks carry their scale in the template, so the panel would
|
|
215
|
+
// only mislead here.
|
|
216
|
+
parameters: { controls: { disable: true } },
|
|
217
|
+
render: () => ({
|
|
218
|
+
template: `
|
|
219
|
+
<div class="flex flex-col items-start gap-4 p-4">
|
|
220
|
+
<ui-clock class="origin-top-left" [scale]="0.5"></ui-clock>
|
|
221
|
+
<ui-clock class="origin-top-left" [scale]="1"></ui-clock>
|
|
222
|
+
<ui-clock class="origin-top-left" [scale]="2"></ui-clock>
|
|
223
|
+
</div>
|
|
224
|
+
`,
|
|
225
|
+
}),
|
|
226
|
+
};
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
---
|
|
230
|
+
|
|
231
|
+
**Usage**
|
|
232
|
+
|
|
233
|
+
```html
|
|
234
|
+
<ui-clock></ui-clock>
|
|
235
|
+
|
|
236
|
+
<ui-clock
|
|
237
|
+
style="--ui-clock-bg: #101010; --ui-clock-color: #7dffb3"
|
|
238
|
+
[time]="someDate"
|
|
239
|
+
[showSeconds]="true"
|
|
240
|
+
[format]="12"
|
|
241
|
+
[blink]="false"
|
|
242
|
+
[scale]="0.5"
|
|
243
|
+
></ui-clock>
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
### Component Details
|
|
249
|
+
|
|
250
|
+
- **Selector:** `ui-clock`
|
|
251
|
+
- **Encapsulation:** `ViewEncapsulation.None` (styles scoped via a nested `ui-clock` block)
|
|
252
|
+
- **State:** Angular Signals; the live interval is cleared on destroy
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
### Copy Value
|
|
2
|
+
|
|
3
|
+
Wraps anything and makes it copy a value on click.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### What it does, and what it does not
|
|
8
|
+
|
|
9
|
+
What is **shown** and what is **copied** have nothing to do with each other. A
|
|
10
|
+
colour swatch shows a colour and copies `var(--ui-c-…)`. A barcode shows bars
|
|
11
|
+
and copies digits. A truncated label shows three dots and copies the whole
|
|
12
|
+
string.
|
|
13
|
+
|
|
14
|
+
So the component brings no appearance — the content does that — and no opinion
|
|
15
|
+
about what the value means. What it does bring is the part that is tedious to
|
|
16
|
+
write again every time: the clipboard call, a confirmation that does not move
|
|
17
|
+
the layout, and keyboard access.
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<ui-copy-value [value]="'var(--ui-c-focus)'">
|
|
21
|
+
<div class="my-swatch"></div>
|
|
22
|
+
</ui-copy-value>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
#### Story: Default
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
export const Default: Story = {
|
|
29
|
+
render: (args) => ({
|
|
30
|
+
props: { ...args },
|
|
31
|
+
template: `
|
|
32
|
+
<ui-copy-value [value]="value" [copiedLabel]="copiedLabel" [copiedIcon]="copiedIcon">
|
|
33
|
+
<ui-placeholder class="h-24 w-64"></ui-placeholder>
|
|
34
|
+
</ui-copy-value>
|
|
35
|
+
`,
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Shown and copied are two different things. Each square shows a colour and
|
|
41
|
+
* copies the token behind it — which is the whole reason the value is an input
|
|
42
|
+
* rather than something read off the content.
|
|
43
|
+
*/
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
> **Guide:** recommendations for `ui-copy-value` — use for, not for, instead, shown in — are served by `get_guide` (name: `ui-copy-value`). The section above is the truth; the guide is the offer.
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
### Shown and copied are separate
|
|
53
|
+
|
|
54
|
+
#### Story: Swatches
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
export const Swatches: Story = {
|
|
58
|
+
// Five values are named in the template, so neither control would move
|
|
59
|
+
// anything here — the interactive one is the story above.
|
|
60
|
+
parameters: { controls: { disable: true } },
|
|
61
|
+
render: () => ({
|
|
62
|
+
props: {
|
|
63
|
+
// A tick, because the target is 40px wide and "Copied!" is 63. The
|
|
64
|
+
// confirmation has to fit the thing it lies on, and only the caller
|
|
65
|
+
// knows how big that is — the library deliberately does not shorten
|
|
66
|
+
// anything on its own, it cannot tell a word that is too long from one
|
|
67
|
+
// that is meant. A single letter would fit too and say nothing; an icon
|
|
68
|
+
// fits AND is read without being learned.
|
|
69
|
+
copiedIcon: 'done',
|
|
70
|
+
},
|
|
71
|
+
template: `
|
|
72
|
+
<section class="flex gap-2">
|
|
73
|
+
<ui-copy-value class="rounded" [value]="'var(--ui-c-primary)'" [copiedIcon]="copiedIcon">
|
|
74
|
+
<div class="h-16 w-16 rounded border bg-c-primary"></div>
|
|
75
|
+
</ui-copy-value>
|
|
76
|
+
<ui-copy-value class="rounded" [value]="'var(--ui-c-secondary)'" [copiedIcon]="copiedIcon">
|
|
77
|
+
<div class="h-16 w-16 rounded border bg-c-secondary"></div>
|
|
78
|
+
</ui-copy-value>
|
|
79
|
+
<ui-copy-value class="rounded" [value]="'var(--ui-c-success)'" [copiedIcon]="copiedIcon">
|
|
80
|
+
<div class="h-16 w-16 rounded border bg-c-success"></div>
|
|
81
|
+
</ui-copy-value>
|
|
82
|
+
<ui-copy-value class="rounded" [value]="'var(--ui-c-warn)'" [copiedIcon]="copiedIcon">
|
|
83
|
+
<div class="h-16 w-16 rounded border bg-c-warn"></div>
|
|
84
|
+
</ui-copy-value>
|
|
85
|
+
<ui-copy-value class="rounded" [value]="'var(--ui-c-error)'" [copiedIcon]="copiedIcon">
|
|
86
|
+
<div class="h-16 w-16 rounded border bg-c-error"></div>
|
|
87
|
+
</ui-copy-value>
|
|
88
|
+
</section>
|
|
89
|
+
`,
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A wording of its own, for cases where "copied" is not what happened in the
|
|
95
|
+
* reader's head.
|
|
96
|
+
*/
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Click one: the confirmation is a tick, not "Copied!". These targets are 40px
|
|
100
|
+
wide and the default wording is 63 — it used to hang over both edges and paint
|
|
101
|
+
on the neighbours. That is what `copiedIcon` and `copiedLabel` are for. The
|
|
102
|
+
component does not shorten anything on its own: it cannot tell a word that is
|
|
103
|
+
too long from one that is meant, and only the caller knows how much room there
|
|
104
|
+
is. Where even a short word does not fit, an icon does — and unlike an
|
|
105
|
+
abbreviation it is read without being learned.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
### Own confirmation
|
|
110
|
+
|
|
111
|
+
#### Story: OwnConfirmation
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
export const OwnConfirmation: Story = {
|
|
115
|
+
args: { value: '9783462033748', copiedLabel: 'ISBN taken' },
|
|
116
|
+
render: (args) => ({
|
|
117
|
+
props: { ...args },
|
|
118
|
+
template: `
|
|
119
|
+
<ui-copy-value [value]="value" [copiedLabel]="copiedLabel">
|
|
120
|
+
<ui-placeholder class="h-16 w-72" [label]="value"></ui-placeholder>
|
|
121
|
+
</ui-copy-value>
|
|
122
|
+
`,
|
|
123
|
+
}),
|
|
124
|
+
};
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### Notes
|
|
130
|
+
|
|
131
|
+
- The host is a **button while it has a value**: `role`, `tabindex`, and
|
|
132
|
+
Enter/Space act like a click. A clickable wrapper without that simply does
|
|
133
|
+
not exist for anyone who does not use a mouse. With an **empty value** the
|
|
134
|
+
component removes role and tabindex entirely — it leaves the tab order and
|
|
135
|
+
stops presenting itself as a control, so a host can render it
|
|
136
|
+
unconditionally and switch it on by simply supplying a value.
|
|
137
|
+
- The confirmation lies **over** the content (`position: absolute`), so nothing
|
|
138
|
+
jumps while it shows — a list of copyable things would otherwise twitch on
|
|
139
|
+
every click. It ignores pointer events, so a click meant for the content
|
|
140
|
+
never lands on the message.
|
|
141
|
+
- An **empty value copies nothing and confirms nothing**. A confirmation for a
|
|
142
|
+
blank clipboard is a lie the reader would only discover on pasting.
|
|
143
|
+
- The host is `inline-block`, not `contents`: the confirmation needs a box to
|
|
144
|
+
position against, and wrapping something must not silently turn it into a
|
|
145
|
+
full-width block.
|
|
146
|
+
- **The confirmation takes its corner radius from the host** (`border-radius:
|
|
147
|
+
inherit`), because it cannot know how the content it covers is rounded. Give
|
|
148
|
+
the tag the same radius as the thing inside it — `class="rounded"` in the
|
|
149
|
+
swatches above — or the covered corners peek out from behind the message. It
|
|
150
|
+
also carries a border in its own fill colour, so a border on the content does
|
|
151
|
+
not show through the translucent background as a grey line.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### Properties
|
|
156
|
+
|
|
157
|
+
<table>
|
|
158
|
+
<thead>
|
|
159
|
+
<tr>
|
|
160
|
+
<th>Name</th>
|
|
161
|
+
<th>Type</th>
|
|
162
|
+
<th>Default</th>
|
|
163
|
+
<th>Description</th>
|
|
164
|
+
</tr>
|
|
165
|
+
</thead>
|
|
166
|
+
<tbody>
|
|
167
|
+
<tr>
|
|
168
|
+
<td><code>value</code></td>
|
|
169
|
+
<td><code>string</code></td>
|
|
170
|
+
<td><code>''</code></td>
|
|
171
|
+
<td>The text placed in the clipboard. Independent of what is displayed.</td>
|
|
172
|
+
</tr>
|
|
173
|
+
<tr>
|
|
174
|
+
<td><code>copiedLabel</code></td>
|
|
175
|
+
<td><code>string | null</code></td>
|
|
176
|
+
<td><code>null</code></td>
|
|
177
|
+
<td>
|
|
178
|
+
Wording of the confirmation — keep it short where the target is
|
|
179
|
+
small. Without one the library's own translated
|
|
180
|
+
wording is used (<code>actions.copied</code>), so it speaks the
|
|
181
|
+
reader's language without the caller doing anything.
|
|
182
|
+
</td>
|
|
183
|
+
</tr>
|
|
184
|
+
<tr>
|
|
185
|
+
<td><code>copiedIcon</code></td>
|
|
186
|
+
<td><code>string | null</code></td>
|
|
187
|
+
<td><code>null</code></td>
|
|
188
|
+
<td>
|
|
189
|
+
Confirmation as a classic Material icon ligature
|
|
190
|
+
(<code>done</code>, <code>check</code>), rendered with the
|
|
191
|
+
<code>.ui-icon</code> class. Wins over <code>copiedLabel</code>. It is
|
|
192
|
+
an input of its own because a label is a string and can carry no
|
|
193
|
+
class — nothing could turn it into an icon from outside.
|
|
194
|
+
</td>
|
|
195
|
+
</tr>
|
|
196
|
+
<tr>
|
|
197
|
+
<td><code>ariaLabel</code></td>
|
|
198
|
+
<td><code>string | null</code></td>
|
|
199
|
+
<td><code>null</code></td>
|
|
200
|
+
<td>Accessible name of the button.</td>
|
|
201
|
+
</tr>
|
|
202
|
+
</tbody>
|
|
203
|
+
</table>
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
#### Atoms: Image Grid
|
|
2
|
+
|
|
3
|
+
The `UiImageGridComponent` is a versatile and responsive grid-based image display component. It allows for dynamic configuration of columns, gaps, and heights, making it suitable for galleries, portfolios, or any grouped image presentation.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
### What it does, and what it does not
|
|
8
|
+
|
|
9
|
+
Lays pictures out in a fixed number of columns, with a gap, a height and an
|
|
10
|
+
optional overlay per tile, and reports which tile is selected or clicked. It
|
|
11
|
+
shares an index with `ui-image-slider` (`setIndex`/`currentIndex`) so grid and
|
|
12
|
+
slider can point at the same picture. It opens nothing itself: a click emits
|
|
13
|
+
`clickIndex`, and what follows — a slider in zoom, a route — is the host's
|
|
14
|
+
decision. `cols` must be set; the default `0` draws no columns.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
> **Guide:** recommendations for `ui-image-grid` — use for, not for, instead, shown in — are served by `get_guide` (name: `ui-image-grid`). The section above is the truth; the guide is the offer.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
### [Image Grid](?path=/story/atoms-image-grid--image-grid)
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
#### Features
|
|
27
|
+
|
|
28
|
+
- **Responsive Grid**: Automatically adjusts to its container and supports configurable column counts.
|
|
29
|
+
- **Lazy Loading Support**: Integrated `loaded` state to manage image rendering.
|
|
30
|
+
- **Interactive Overlays**: Supports different overlay types (e.g., 'default', 'doors') for enhanced user interaction.
|
|
31
|
+
- **Click Area**: An `<ng-template uiImageGridClickArea>` projected into the tag is stamped into every tile as the active tile's overlay — with the tile's item and index as context.
|
|
32
|
+
- **Action Mode**: Enable interactive selection with event emitting for current and clicked indices.
|
|
33
|
+
- **Dynamic Styling**: Configure gap, height, and image scaling per item.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
#### Inputs
|
|
38
|
+
|
|
39
|
+
<table class="ui">
|
|
40
|
+
<tr>
|
|
41
|
+
<th>@Input</th>
|
|
42
|
+
<th>Type</th>
|
|
43
|
+
<th>Default</th>
|
|
44
|
+
<th>Description</th>
|
|
45
|
+
</tr>
|
|
46
|
+
<tr>
|
|
47
|
+
<td>data</td>
|
|
48
|
+
<td><code>UiImageDisplayItemDataType[] | null</code></td>
|
|
49
|
+
<td>null</td>
|
|
50
|
+
<td>Array of image objects containing source, alt text, and scaling info.</td>
|
|
51
|
+
</tr>
|
|
52
|
+
<tr>
|
|
53
|
+
<td>cols</td>
|
|
54
|
+
<td>number</td>
|
|
55
|
+
<td>0</td>
|
|
56
|
+
<td>Number of columns in the grid. The default <code>0</code> renders no columns — always set it.</td>
|
|
57
|
+
</tr>
|
|
58
|
+
<tr>
|
|
59
|
+
<td>gap</td>
|
|
60
|
+
<td>number</td>
|
|
61
|
+
<td>0</td>
|
|
62
|
+
<td>Gap between grid items in pixels.</td>
|
|
63
|
+
</tr>
|
|
64
|
+
<tr>
|
|
65
|
+
<td>height</td>
|
|
66
|
+
<td>number</td>
|
|
67
|
+
<td>undefined</td>
|
|
68
|
+
<td>Height of the grid container. If <code>singleRow</code> is false, this is the total height. If <code>singleRow</code> is true, this value is divided by <code>cols</code> to determine the row height. Falls back to 200px when no height is given.</td>
|
|
69
|
+
</tr>
|
|
70
|
+
<tr>
|
|
71
|
+
<td>singleRow</td>
|
|
72
|
+
<td>boolean</td>
|
|
73
|
+
<td>false</td>
|
|
74
|
+
<td>If true, the grid renders as a single row with horizontal scrolling. The row height is calculated as <code>height / cols</code>.</td>
|
|
75
|
+
</tr>
|
|
76
|
+
<tr>
|
|
77
|
+
<td>setIndex</td>
|
|
78
|
+
<td>number</td>
|
|
79
|
+
<td>0</td>
|
|
80
|
+
<td>Programmatically set the active/scrolled-to image index.</td>
|
|
81
|
+
</tr>
|
|
82
|
+
<tr>
|
|
83
|
+
<td>action</td>
|
|
84
|
+
<td>boolean</td>
|
|
85
|
+
<td>false</td>
|
|
86
|
+
<td>Enables click interactions and active state highlighting.</td>
|
|
87
|
+
</tr>
|
|
88
|
+
<tr>
|
|
89
|
+
<td>loaded</td>
|
|
90
|
+
<td>boolean</td>
|
|
91
|
+
<td>false</td>
|
|
92
|
+
<td>Flag to trigger image rendering (useful for deferred loading). While it is false, every tile shows its title instead of its picture — the same branch a tile without a <code>src</code> falls into, see "A tile without a picture".</td>
|
|
93
|
+
</tr>
|
|
94
|
+
<tr>
|
|
95
|
+
<td>overlayType</td>
|
|
96
|
+
<td><code>'default' | 'doors'</code></td>
|
|
97
|
+
<td>'default'</td>
|
|
98
|
+
<td>Visual style of the hover/active overlay.</td>
|
|
99
|
+
</tr>
|
|
100
|
+
<tr>
|
|
101
|
+
<td>debug</td>
|
|
102
|
+
<td>boolean</td>
|
|
103
|
+
<td>false</td>
|
|
104
|
+
<td>Shows internal state information (cols, indices, src) for debugging.</td>
|
|
105
|
+
</tr>
|
|
106
|
+
</table>
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
#### A tile without a picture
|
|
111
|
+
|
|
112
|
+
A tile without a source draws **no image at all**: it shows an icon with the
|
|
113
|
+
item's `title` underneath, gets the modifier class `._-no-image`, and is left
|
|
114
|
+
out of the click area. Nothing is broken — this is what the component does
|
|
115
|
+
when it has nothing to show.
|
|
116
|
+
|
|
117
|
+
In the story above, the fourth tile is that case, and it says so: the entry
|
|
118
|
+
carries the title *"no image on purpose"*. Give it whatever wording fits your
|
|
119
|
+
case — the component supplies the space, never the words.
|
|
120
|
+
|
|
121
|
+
Two things worth knowing about that state:
|
|
122
|
+
|
|
123
|
+
- **It is the same branch as `loaded: false`.** Turn `loaded` off and *every*
|
|
124
|
+
tile shows its title. The component does not distinguish "not there yet" from
|
|
125
|
+
"not there at all" — both mean "no picture to draw", and both look the same.
|
|
126
|
+
- **The grid pads to a square.** `gridColsInternal` squares the column count,
|
|
127
|
+
so a data set that does not fill the last row leaves empty tiles behind. With
|
|
128
|
+
the story's 25 items that is 49 tiles: 24 of them carry no data and render as
|
|
129
|
+
the same empty state.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
#### Grid Logic
|
|
134
|
+
|
|
135
|
+
The component uses internal computed signals to determine the grid layout and height.
|
|
136
|
+
|
|
137
|
+
##### Column Calculation (`gridColsInternal`)
|
|
138
|
+
|
|
139
|
+
The number of columns is determined by the `cols` input and the total number of items (`dataCount`):
|
|
140
|
+
- If `dataCount / cols > cols`, the grid becomes "square-ish" or expands to fit items, calculating columns as `Math.ceil(dataCount / cols)`.
|
|
141
|
+
- Otherwise, it uses the fixed `cols` value provided.
|
|
142
|
+
- With `cols` at `0` (the default) no expansion happens and the grid gets zero columns — a column count is part of using the component.
|
|
143
|
+
|
|
144
|
+
##### Height Calculation (`scrollerHeight`)
|
|
145
|
+
|
|
146
|
+
The height of the grid container is dynamically calculated:
|
|
147
|
+
- **Standard Mode (`singleRow` is false)**: Uses the `height` input value in pixels. Falls back to `200px` when no `height` is given.
|
|
148
|
+
- **Single Row Mode (`singleRow` is true)**: The height is calculated as `height / cols` (both must be set; otherwise the same `height`-or-`200px` fallback applies). This ensures that even in a horizontal scroll scenario, the items maintain a consistent aspect ratio based on the intended column count.
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
#### Outputs
|
|
153
|
+
|
|
154
|
+
<table class="ui">
|
|
155
|
+
<tr>
|
|
156
|
+
<th>@Output</th>
|
|
157
|
+
<th>Type</th>
|
|
158
|
+
<th>Description</th>
|
|
159
|
+
</tr>
|
|
160
|
+
<tr>
|
|
161
|
+
<td>currentIndex</td>
|
|
162
|
+
<td><code>output<number></code></td>
|
|
163
|
+
<td>Emitted when a new item becomes active or is clicked.</td>
|
|
164
|
+
</tr>
|
|
165
|
+
<tr>
|
|
166
|
+
<td>clickIndex</td>
|
|
167
|
+
<td><code>output<number></code></td>
|
|
168
|
+
<td>Emitted when an already active item is clicked (only when a click-area template is projected).</td>
|
|
169
|
+
</tr>
|
|
170
|
+
</table>
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
#### The click area
|
|
175
|
+
|
|
176
|
+
The overlay that appears on the **active** tile, and whose second click
|
|
177
|
+
emits `clickIndex`. It is an `<ng-template uiImageGridClickArea>` projected
|
|
178
|
+
into the tag: the grid stamps it into every tile, so everything Angular can
|
|
179
|
+
do inside a template works here — bindings, pipes, `(click)` handlers — and
|
|
180
|
+
the template is handed the tile's item (`let-item`) and index
|
|
181
|
+
(`let-index="index"`).
|
|
182
|
+
|
|
183
|
+
A template rather than projected content, because content can be projected
|
|
184
|
+
once and the grid needs the area in every tile. It used to clone a projected
|
|
185
|
+
element's innerHTML per tile, which ran the markup through the sanitizer and
|
|
186
|
+
left a dead copy without events; a stamped template keeps all of that alive.
|
|
187
|
+
|
|
188
|
+
The marker is the directive `UiImageGridClickAreaDirective` — import it next
|
|
189
|
+
to the grid. It is a marker and nothing else, so the grid finds the click
|
|
190
|
+
area by name rather than taking the first template it meets; a caller may
|
|
191
|
+
project other templates (`*ngIf`, a structural directive of their own)
|
|
192
|
+
without one of those ending up in every tile.
|
|
193
|
+
|
|
194
|
+
```html
|
|
195
|
+
<ui-image-grid [data]="myData" [action]="true" (clickIndex)="open($event)">
|
|
196
|
+
<ng-template uiImageGridClickArea let-item let-index="index">
|
|
197
|
+
<div class="my-overlay">{{ index + 1 }}: {{ item.title }}</div>
|
|
198
|
+
</ng-template>
|
|
199
|
+
</ui-image-grid>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
### Sizing
|
|
205
|
+
|
|
206
|
+
The host fills its container (`100%` / `100%`) by default. Give it a fixed size
|
|
207
|
+
without a cascade fight through the named hooks `--ui-image-grid-width` and
|
|
208
|
+
`--ui-image-grid-height`.
|