@mojawork/ui-docs 2.7.0 → 2.8.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.
Files changed (39) hide show
  1. package/README.md +2 -2
  2. package/catalog/atoms/image-grid.md +45 -1
  3. package/catalog/atoms/mosaic.md +1 -1
  4. package/catalog/guide.json +9 -4
  5. package/catalog/manifest.json +4 -4
  6. package/catalog/version.json +2 -2
  7. package/package.json +1 -1
  8. package/storybook/2621.2245d387.iframe.bundle.js +1 -0
  9. package/storybook/{4555.0f383313.iframe.bundle.js → 4555.525bbef9.iframe.bundle.js} +1 -1
  10. package/storybook/9045.46ed3f61.iframe.bundle.js +2 -0
  11. package/storybook/{_external-mwork-music-player-docs-mdx.6f943768.iframe.bundle.js → _external-mwork-music-player-docs-mdx.3d0f7156.iframe.bundle.js} +1 -1
  12. package/storybook/_external-mwork-music-player-mwork-music-player-stories.26c06b83.iframe.bundle.js +1 -0
  13. package/storybook/atoms-image-grid-docs-mdx.7cb6414e.iframe.bundle.js +1 -0
  14. package/storybook/atoms-image-grid-image-grid-component-stories.8290e900.iframe.bundle.js +1 -0
  15. package/storybook/{atoms-mosaic-mosaic-component-stories.0a6bc043.iframe.bundle.js → atoms-mosaic-mosaic-component-stories.c2ec95f2.iframe.bundle.js} +1 -1
  16. package/storybook/{atoms-thumb-docs-mdx.2143ad01.iframe.bundle.js → atoms-thumb-docs-mdx.7286b617.iframe.bundle.js} +1 -1
  17. package/storybook/{atoms-thumb-thumb-component-stories.06f51d03.iframe.bundle.js → atoms-thumb-thumb-component-stories.f7e9dbae.iframe.bundle.js} +1 -1
  18. package/storybook/{atoms-typewriter-docs-mdx.3b1088c0.iframe.bundle.js → atoms-typewriter-docs-mdx.993bc264.iframe.bundle.js} +1 -1
  19. package/storybook/atoms-typewriter-typewriter-component-stories.80f07c89.iframe.bundle.js +1 -0
  20. package/storybook/examples-image-grid-slider-docs-mdx.d3578699.iframe.bundle.js +1 -0
  21. package/storybook/examples-image-grid-slider-image-grid-slider-stories.cda91b79.iframe.bundle.js +1 -0
  22. package/storybook/{home-overview-mdx.3b40bdbd.iframe.bundle.js → home-overview-mdx.a2833e60.iframe.bundle.js} +1 -1
  23. package/storybook/iframe.html +3 -3
  24. package/storybook/index.json +1 -1
  25. package/storybook/{main.e33bfc7e33aad318b1d2.css → main.4530991c57c404682bbb.css} +16 -0
  26. package/storybook/main.5e4e255f.iframe.bundle.js +1 -0
  27. package/storybook/project.json +1 -1
  28. package/storybook/{runtime~main.4072cb65.iframe.bundle.js → runtime~main.a2ec52c2.iframe.bundle.js} +1 -1
  29. package/storybook/version.json +2 -2
  30. package/version.json +2 -2
  31. package/storybook/9045.a50616e9.iframe.bundle.js +0 -2
  32. package/storybook/_external-mwork-music-player-mwork-music-player-stories.08fbf651.iframe.bundle.js +0 -1
  33. package/storybook/atoms-image-grid-docs-mdx.18b4df2a.iframe.bundle.js +0 -1
  34. package/storybook/atoms-image-grid-image-grid-component-stories.a0a92d9e.iframe.bundle.js +0 -1
  35. package/storybook/atoms-typewriter-typewriter-component-stories.4fefc019.iframe.bundle.js +0 -1
  36. package/storybook/examples-image-grid-slider-docs-mdx.9e38157e.iframe.bundle.js +0 -1
  37. package/storybook/examples-image-grid-slider-image-grid-slider-stories.028c8c2b.iframe.bundle.js +0 -1
  38. package/storybook/main.4f406815.iframe.bundle.js +0 -1
  39. /package/storybook/{9045.a50616e9.iframe.bundle.js.LICENSE.txt → 9045.46ed3f61.iframe.bundle.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[1365,3260],{"./libs/ui/src/lib/_external/mwork-music-player/docs.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/_external/mwork-music-player/mwork-music-player.stories.ts");function _createMdxContent(props){const _components={code:"code",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.W8,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"external-mwork-music-player",children:"External: Mwork Music Player"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<mwork-music-player>"})," is a minimal music player as a framework-agnostic web component\n(Stencil, from the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"web-components"})," repo, published as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"@mojawork/web-components"}),"). It wraps\na native ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<audio>"})," element with playlist buttons, prev/next/play/pause controls and a\nmetadata section that fetches the active track and displays its ID3 tags — title, album,\nartist and embedded cover, plus the full format and generic tag tables (parsed with\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"music-metadata"}),", the package's only runtime dependency)."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The playlist is fully consumer-provided: the component ships without any built-in URLs.\nThe playlist below is a demo configured in this story."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__.Default}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"properties",children:"Properties"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"14rem"},children:"Property / attribute"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"10rem"},children:"Type"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"8rem"},children:"Default"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Description"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"tracks"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"string[] | string"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"[]"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The playlist. As a property a real string array; as an attribute a JSON array string\n(",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:'\'["a.mp3","b.mp3"]\''}),") or a comma/newline separated list of URLs."]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"show-meta"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"showMeta"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"boolean"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"true"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Show the metadata section (cover and tag tables) below the controls."})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"events",children:"Events"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"14rem"},children:"Event"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Payload"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"mworkTrackChange"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"{ index: number, url: string }"})," — fired whenever the active\ntrack changes, including the initial track."]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"mworkMusicMeta"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Essential metadata after a successful parse: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"title"}),", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"track"}),",\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"album"}),", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"artist"}),", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"image"})," (base64 data URL of the\ncover) and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"url"}),"."]})})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"methods",children:"Methods"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"14rem"},children:"Method"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Effect"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"play()"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"pause()"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Start or pause playback of the loaded track."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"prev()"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"next()"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Move through the playlist (no-ops at the first/last track)."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"selectTrack(index)"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Load and play the track at the given playlist index."})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"variants",children:"Variants"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Without the metadata section (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:'show-meta="false"'}),"):"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__.WithoutMeta}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A single track hides the playlist buttons:"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__.SingleTrack}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"theming",children:"Theming"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The player is styled exclusively through its own ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"--mwork-player-*"})," CSS custom\nproperties, each with a working default — it needs no surrounding design system and stays\nindependent of the ui library. Apps map their tokens onto them; this story maps the ui\ndesign tokens (theme-aware, so it follows light/dark):"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-css",children:"mwork-music-player {\n --mwork-player-color: var(--ui-c-default);\n --mwork-player-background: var(--ui-c-background);\n --mwork-player-spacer: var(--ui-spacer);\n --mwork-player-border-width: var(--ui-border-width);\n --mwork-player-border-color: var(--ui-c-fourthly);\n --mwork-player-border-radius: var(--ui-border-radius);\n --mwork-player-accent: var(--ui-c-primary);\n --mwork-player-accent-contrast: var(--ui-c-invert);\n --mwork-player-error-color: var(--ui-c-error);\n}\n"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__.UiThemed}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Additional knobs: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"--mwork-player-font-family"}),",\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"--mwork-player-button-background"})," and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"--mwork-player-cover-size"}),"\n(default ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"16rem"}),")."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"usage-in-an-app",children:"Usage in an app"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-bash",children:"npm i @mojawork/web-components\n"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-ts",children:"// main.ts — registers all mwork components once\nimport { defineCustomElements } from '@mojawork/web-components/loader';\ndefineCustomElements();\n"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<mwork-music-player\n tracks=\'["https://moja.work/one.mp3", "https://moja.work/two.mp3"]\'\n></mwork-music-player>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["In Angular templates, bind the playlist as a property (requires\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"CUSTOM_ELEMENTS_SCHEMA"}),"): ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:'[tracks]="trackUrls"'}),"."]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/src/lib/_external/mwork-music-player/mwork-music-player.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,SingleTrack:()=>SingleTrack,UiThemed:()=>UiThemed,WithoutMeta:()=>WithoutMeta,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _angular_core__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_storybook_angular__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),storybook_actions__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("storybook/actions");(0,__webpack_require__("../web-components/loader/index.js").u)();const DEMO_TRACKS=["https://moja.work/media/traks/mojawork-v1.mp3","https://moja.work/media/traks/mojawork-v2.mp3","https://moja.work/media/traks/mojawork-v3.mp3"],__WEBPACK_DEFAULT_EXPORT__={title:"External/Mwork Music Player",decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_1__.Iz)({schemas:[_angular_core__WEBPACK_IMPORTED_MODULE_0__.CkJ]})],argTypes:{tracks:{control:"object",description:"Playlist as an array of track URLs (property binding); as attribute also a JSON array string or a comma/newline separated list."},showMeta:{control:"boolean",description:"Show the ID3/format metadata section below the controls."},mworkTrackChange:{control:!1,description:"Emitted when the active track changes: { index, url }."},mworkMusicMeta:{control:!1,description:"Emitted after a successful metadata parse: title, track, album, artist, cover image, url."}},args:{tracks:DEMO_TRACKS,showMeta:!0},render:args=>({props:{...args,mworkTrackChange:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkTrackChange"),mworkMusicMeta:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkMusicMeta")},template:'\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n '})},Default={},WithoutMeta={args:{showMeta:!1}},SingleTrack={args:{tracks:[DEMO_TRACKS[0]]}},UiThemed={render:args=>({props:{...args,mworkTrackChange:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkTrackChange"),mworkMusicMeta:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkMusicMeta")},template:'\n <style>\n .ui-themed-music-player {\n --mwork-player-font-family: inherit;\n --mwork-player-color: var(--ui-c-default);\n --mwork-player-background: var(--ui-c-background);\n --mwork-player-spacer: var(--ui-spacer);\n --mwork-player-border-width: var(--ui-border-width);\n --mwork-player-border-color: var(--ui-c-fourthly);\n --mwork-player-border-radius: var(--ui-border-radius);\n --mwork-player-accent: var(--ui-c-primary);\n --mwork-player-accent-contrast: var(--ui-c-invert);\n --mwork-player-error-color: var(--ui-c-error);\n }\n </style>\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="ui-themed-music-player w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n '})},__namedExportsOrder=["Default","WithoutMeta","SingleTrack","UiThemed"];Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"{}",...Default.parameters?.docs?.source}}},WithoutMeta.parameters={...WithoutMeta.parameters,docs:{...WithoutMeta.parameters?.docs,source:{originalSource:"{\n args: {\n showMeta: false\n }\n}",...WithoutMeta.parameters?.docs?.source}}},SingleTrack.parameters={...SingleTrack.parameters,docs:{...SingleTrack.parameters?.docs,source:{originalSource:"{\n args: {\n tracks: [DEMO_TRACKS[0]]\n }\n}",...SingleTrack.parameters?.docs?.source}}},UiThemed.parameters={...UiThemed.parameters,docs:{...UiThemed.parameters?.docs,source:{originalSource:'{\n render: args => ({\n props: {\n ...args,\n mworkTrackChange: action(\'mworkTrackChange\'),\n mworkMusicMeta: action(\'mworkMusicMeta\')\n },\n template: `\n <style>\n .ui-themed-music-player {\n --mwork-player-font-family: inherit;\n --mwork-player-color: var(--ui-c-default);\n --mwork-player-background: var(--ui-c-background);\n --mwork-player-spacer: var(--ui-spacer);\n --mwork-player-border-width: var(--ui-border-width);\n --mwork-player-border-color: var(--ui-c-fourthly);\n --mwork-player-border-radius: var(--ui-border-radius);\n --mwork-player-accent: var(--ui-c-primary);\n --mwork-player-accent-contrast: var(--ui-c-invert);\n --mwork-player-error-color: var(--ui-c-error);\n }\n </style>\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="ui-themed-music-player w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n `\n })\n}',...UiThemed.parameters?.docs?.source},description:{story:"Maps the ui design tokens onto the component's own `--mwork-player-*`\ncustom properties — the pattern every ui app uses to theme the player.",...UiThemed.parameters?.docs?.description}}}}}]);
1
+ "use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[1365,3260],{"./libs/ui/src/lib/_external/mwork-music-player/docs.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/_external/mwork-music-player/mwork-music-player.stories.ts");function _createMdxContent(props){const _components={code:"code",h3:"h3",h4:"h4",hr:"hr",p:"p",pre:"pre",...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.W8,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"external-mwork-music-player",children:"External: Mwork Music Player"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<mwork-music-player>"})," is a minimal music player as a framework-agnostic web component\n(Stencil, from the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"web-components"})," repo, published as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"@mojawork/web-components"}),"). It wraps\na native ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<audio>"})," element with playlist buttons, prev/next/play/pause controls and a\nmetadata section that fetches the active track and displays its ID3 tags — title, album,\nartist and embedded cover, plus the full format and generic tag tables (parsed with\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"music-metadata"}),", the package's only runtime dependency)."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The playlist is fully consumer-provided: the component ships without any built-in URLs.\nThe playlist below is a demo configured in this story."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__.Default}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"properties",children:"Properties"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"14rem"},children:"Property / attribute"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"10rem"},children:"Type"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"8rem"},children:"Default"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Description"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"tracks"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"string[] | string"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"[]"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The playlist. As a property a real string array; as an attribute a JSON array string\n(",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:'\'["a.mp3","b.mp3"]\''}),") or a comma/newline separated list of URLs."]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"show-meta"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"showMeta"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"boolean"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"true"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Show the metadata section (cover and tag tables) below the controls."})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"events",children:"Events"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"14rem"},children:"Event"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Payload"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"mworkTrackChange"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"{ index: number, url: string }"})," — fired whenever the active\ntrack changes, including the initial track."]})})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"mworkMusicMeta"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Essential metadata after a successful parse: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"title"}),", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"track"}),",\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"album"}),", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"artist"}),", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"image"})," (base64 data URL of the\ncover) and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"url"}),"."]})})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"methods",children:"Methods"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{style:{width:"14rem"},children:"Method"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Effect"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"play()"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"pause()"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Start or pause playback of the loaded track."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"prev()"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"next()"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Move through the playlist (no-ops at the first/last track)."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"selectTrack(index)"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Load and play the track at the given playlist index."})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"variants",children:"Variants"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Without the metadata section (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:'show-meta="false"'}),"):"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__.WithoutMeta}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A single track hides the playlist buttons:"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__.SingleTrack}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"theming",children:"Theming"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The player is styled exclusively through its own ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"--mwork-player-*"})," CSS custom\nproperties, each with a working default — it needs no surrounding design system and stays\nindependent of the ui library. Apps map their tokens onto them; this story maps the ui\ndesign tokens (theme-aware, so it follows light/dark):"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-css",children:"mwork-music-player {\n --mwork-player-color: var(--ui-c-default);\n --mwork-player-background: var(--ui-c-background);\n --mwork-player-spacer: var(--ui-spacer);\n --mwork-player-border-width: var(--ui-border-width);\n --mwork-player-border-color: var(--ui-c-fourthly);\n --mwork-player-border-radius: var(--ui-border-radius);\n --mwork-player-accent: var(--ui-c-primary);\n --mwork-player-accent-contrast: var(--ui-c-invert);\n --mwork-player-error-color: var(--ui-c-error);\n}\n"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.Hl,{of:_mwork_music_player_stories__WEBPACK_IMPORTED_MODULE_4__.UiThemed}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Additional knobs: ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"--mwork-player-font-family"}),",\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"--mwork-player-button-background"})," and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"--mwork-player-cover-size"}),"\n(default ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"16rem"}),")."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"usage-in-an-app",children:"Usage in an app"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-bash",children:"npm i @mojawork/web-components\n"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-ts",children:"// main.ts — registers all mwork components once\nimport { defineCustomElements } from '@mojawork/web-components/loader';\ndefineCustomElements();\n"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<mwork-music-player\n tracks=\'["https://moja.work/one.mp3", "https://moja.work/two.mp3"]\'\n></mwork-music-player>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["In Angular templates, bind the playlist as a property (requires\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"CUSTOM_ELEMENTS_SCHEMA"}),"): ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:'[tracks]="trackUrls"'}),"."]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/src/lib/_external/mwork-music-player/mwork-music-player.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,SingleTrack:()=>SingleTrack,UiThemed:()=>UiThemed,WithoutMeta:()=>WithoutMeta,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _angular_core__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_storybook_angular__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),storybook_actions__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("storybook/actions");(0,__webpack_require__("../web-components/loader/index.js").u)();const DEMO_TRACKS=["https://moja.work/content/_assets/traks/mojawork-v1.mp3","https://moja.work/content/_assets/traks/mojawork-v2.mp3","https://moja.work/content/_assets/traks/mojawork-v3.mp3"],__WEBPACK_DEFAULT_EXPORT__={title:"External/Mwork Music Player",decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_1__.Iz)({schemas:[_angular_core__WEBPACK_IMPORTED_MODULE_0__.CkJ]})],argTypes:{tracks:{control:"object",description:"Playlist as an array of track URLs (property binding); as attribute also a JSON array string or a comma/newline separated list."},showMeta:{control:"boolean",description:"Show the ID3/format metadata section below the controls."},mworkTrackChange:{control:!1,description:"Emitted when the active track changes: { index, url }."},mworkMusicMeta:{control:!1,description:"Emitted after a successful metadata parse: title, track, album, artist, cover image, url."}},args:{tracks:DEMO_TRACKS,showMeta:!0},render:args=>({props:{...args,mworkTrackChange:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkTrackChange"),mworkMusicMeta:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkMusicMeta")},template:'\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n '})},Default={},WithoutMeta={args:{showMeta:!1}},SingleTrack={args:{tracks:[DEMO_TRACKS[0]]}},UiThemed={render:args=>({props:{...args,mworkTrackChange:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkTrackChange"),mworkMusicMeta:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkMusicMeta")},template:'\n <style>\n .ui-themed-music-player {\n --mwork-player-font-family: inherit;\n --mwork-player-color: var(--ui-c-default);\n --mwork-player-background: var(--ui-c-background);\n --mwork-player-spacer: var(--ui-spacer);\n --mwork-player-border-width: var(--ui-border-width);\n --mwork-player-border-color: var(--ui-c-fourthly);\n --mwork-player-border-radius: var(--ui-border-radius);\n --mwork-player-accent: var(--ui-c-primary);\n --mwork-player-accent-contrast: var(--ui-c-invert);\n --mwork-player-error-color: var(--ui-c-error);\n }\n </style>\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="ui-themed-music-player w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n '})},__namedExportsOrder=["Default","WithoutMeta","SingleTrack","UiThemed"];Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"{}",...Default.parameters?.docs?.source}}},WithoutMeta.parameters={...WithoutMeta.parameters,docs:{...WithoutMeta.parameters?.docs,source:{originalSource:"{\n args: {\n showMeta: false\n }\n}",...WithoutMeta.parameters?.docs?.source}}},SingleTrack.parameters={...SingleTrack.parameters,docs:{...SingleTrack.parameters?.docs,source:{originalSource:"{\n args: {\n tracks: [DEMO_TRACKS[0]]\n }\n}",...SingleTrack.parameters?.docs?.source}}},UiThemed.parameters={...UiThemed.parameters,docs:{...UiThemed.parameters?.docs,source:{originalSource:'{\n render: args => ({\n props: {\n ...args,\n mworkTrackChange: action(\'mworkTrackChange\'),\n mworkMusicMeta: action(\'mworkMusicMeta\')\n },\n template: `\n <style>\n .ui-themed-music-player {\n --mwork-player-font-family: inherit;\n --mwork-player-color: var(--ui-c-default);\n --mwork-player-background: var(--ui-c-background);\n --mwork-player-spacer: var(--ui-spacer);\n --mwork-player-border-width: var(--ui-border-width);\n --mwork-player-border-color: var(--ui-c-fourthly);\n --mwork-player-border-radius: var(--ui-border-radius);\n --mwork-player-accent: var(--ui-c-primary);\n --mwork-player-accent-contrast: var(--ui-c-invert);\n --mwork-player-error-color: var(--ui-c-error);\n }\n </style>\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="ui-themed-music-player w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n `\n })\n}',...UiThemed.parameters?.docs?.source},description:{story:"Maps the ui design tokens onto the component's own `--mwork-player-*`\ncustom properties — the pattern every ui app uses to theme the player.",...UiThemed.parameters?.docs?.description}}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[1365],{"./libs/ui/src/lib/_external/mwork-music-player/mwork-music-player.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Default:()=>Default,SingleTrack:()=>SingleTrack,UiThemed:()=>UiThemed,WithoutMeta:()=>WithoutMeta,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _angular_core__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_storybook_angular__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),storybook_actions__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("storybook/actions");(0,__webpack_require__("../web-components/loader/index.js").u)();const DEMO_TRACKS=["https://moja.work/content/_assets/traks/mojawork-v1.mp3","https://moja.work/content/_assets/traks/mojawork-v2.mp3","https://moja.work/content/_assets/traks/mojawork-v3.mp3"],__WEBPACK_DEFAULT_EXPORT__={title:"External/Mwork Music Player",decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_1__.Iz)({schemas:[_angular_core__WEBPACK_IMPORTED_MODULE_0__.CkJ]})],argTypes:{tracks:{control:"object",description:"Playlist as an array of track URLs (property binding); as attribute also a JSON array string or a comma/newline separated list."},showMeta:{control:"boolean",description:"Show the ID3/format metadata section below the controls."},mworkTrackChange:{control:!1,description:"Emitted when the active track changes: { index, url }."},mworkMusicMeta:{control:!1,description:"Emitted after a successful metadata parse: title, track, album, artist, cover image, url."}},args:{tracks:DEMO_TRACKS,showMeta:!0},render:args=>({props:{...args,mworkTrackChange:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkTrackChange"),mworkMusicMeta:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkMusicMeta")},template:'\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n '})},Default={},WithoutMeta={args:{showMeta:!1}},SingleTrack={args:{tracks:[DEMO_TRACKS[0]]}},UiThemed={render:args=>({props:{...args,mworkTrackChange:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkTrackChange"),mworkMusicMeta:(0,storybook_actions__WEBPACK_IMPORTED_MODULE_2__.action)("mworkMusicMeta")},template:'\n <style>\n .ui-themed-music-player {\n --mwork-player-font-family: inherit;\n --mwork-player-color: var(--ui-c-default);\n --mwork-player-background: var(--ui-c-background);\n --mwork-player-spacer: var(--ui-spacer);\n --mwork-player-border-width: var(--ui-border-width);\n --mwork-player-border-color: var(--ui-c-fourthly);\n --mwork-player-border-radius: var(--ui-border-radius);\n --mwork-player-accent: var(--ui-c-primary);\n --mwork-player-accent-contrast: var(--ui-c-invert);\n --mwork-player-error-color: var(--ui-c-error);\n }\n </style>\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="ui-themed-music-player w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n '})},__namedExportsOrder=["Default","WithoutMeta","SingleTrack","UiThemed"];Default.parameters={...Default.parameters,docs:{...Default.parameters?.docs,source:{originalSource:"{}",...Default.parameters?.docs?.source}}},WithoutMeta.parameters={...WithoutMeta.parameters,docs:{...WithoutMeta.parameters?.docs,source:{originalSource:"{\n args: {\n showMeta: false\n }\n}",...WithoutMeta.parameters?.docs?.source}}},SingleTrack.parameters={...SingleTrack.parameters,docs:{...SingleTrack.parameters?.docs,source:{originalSource:"{\n args: {\n tracks: [DEMO_TRACKS[0]]\n }\n}",...SingleTrack.parameters?.docs?.source}}},UiThemed.parameters={...UiThemed.parameters,docs:{...UiThemed.parameters?.docs,source:{originalSource:'{\n render: args => ({\n props: {\n ...args,\n mworkTrackChange: action(\'mworkTrackChange\'),\n mworkMusicMeta: action(\'mworkMusicMeta\')\n },\n template: `\n <style>\n .ui-themed-music-player {\n --mwork-player-font-family: inherit;\n --mwork-player-color: var(--ui-c-default);\n --mwork-player-background: var(--ui-c-background);\n --mwork-player-spacer: var(--ui-spacer);\n --mwork-player-border-width: var(--ui-border-width);\n --mwork-player-border-color: var(--ui-c-fourthly);\n --mwork-player-border-radius: var(--ui-border-radius);\n --mwork-player-accent: var(--ui-c-primary);\n --mwork-player-accent-contrast: var(--ui-c-invert);\n --mwork-player-error-color: var(--ui-c-error);\n }\n </style>\n <div class="flex justify-center p-4">\n <mwork-music-player\n class="ui-themed-music-player w-full max-w-3xl"\n [tracks]="tracks"\n [showMeta]="showMeta"\n (mworkTrackChange)="mworkTrackChange($event)"\n (mworkMusicMeta)="mworkMusicMeta($event)"\n ></mwork-music-player>\n </div>\n `\n })\n}',...UiThemed.parameters?.docs?.source},description:{story:"Maps the ui design tokens onto the component's own `--mwork-player-*`\ncustom properties — the pattern every ui app uses to theme the player.",...UiThemed.parameters?.docs?.description}}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[3146,8039],{"./libs/ui/.storybook/blocks/guide.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{Ay:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_guide_entries__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/.storybook/blocks/guide.entries.js"),_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.model.mjs");const Link=({href,children})=>href?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.zE,{href,children}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children}),Sentences=({items})=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("ul",{children:items.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("li",{children:s},i))}),Block=({of,entry})=>{const m=(0,_guide_model_mjs__WEBPACK_IMPORTED_MODULE_5__.Cc)(entry,_guide_entries__WEBPACK_IMPORTED_MODULE_4__.H,of);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("section",{className:"ui-guide",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("h4",{children:["Guide — a recommendation, not the truth",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[" · reviewed ",m.reviewed]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:["Written by an agent from the sources below, only for what runs in the house."," ","component"===m.kind?"The section above is what the component does; this is what to reach for it for.":"The pages of the parts say what each does; this is what they are for together."," ","Where the two disagree, the page wins."]}),m.uses.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Builds on"})," ",m.uses.map((u,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:u.href,children:u.selector})]},u.selector))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Use it for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.useFor}),m.notFor.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Not for"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Sentences,{items:m.notFor})]}),m.instead.length>0&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Instead"})," ",m.instead.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&", ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.selector})]},s.selector))]}),m.note&&(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Note"})," ",m.note]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("p",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Shown in"})," ",m.shownIn.map((s,i)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("span",{children:[i>0&&" · ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Link,{href:s.href,children:s.label})]},s.label))]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("small",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("strong",{children:"Sources"})," ",m.sources.join(" · ")]})})]})};function _createMdxContent(props){return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:["\n","\n","\n","\n","\n","\n","\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(Block,{of:props.of,entry:props.entry})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/src/lib/atoms/image-grid/docs.mdx"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:()=>MDXContent});__webpack_require__("./node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/react/jsx-runtime.js"),file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@mdx-js/react/lib/index.js"),_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@storybook/addon-docs/dist/blocks.js"),_image_grid_component_stories__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.stories.ts"),_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/.storybook/blocks/guide.mdx"),_guide_ui_image_grid_json__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./libs/ui/guide/ui-image-grid.json");function _createMdxContent(props){const _components={a:"a",code:"code",em:"em",h3:"h3",h4:"h4",h5:"h5",hr:"hr",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_addon_docs_blocks__WEBPACK_IMPORTED_MODULE_3__.W8,{of:_image_grid_component_stories__WEBPACK_IMPORTED_MODULE_4__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"atoms-image-grid",children:"Atoms: Image Grid"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"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."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"what-it-does-and-what-it-does-not",children:"What it does, and what it does not"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["Lays pictures out in a fixed number of columns, with a gap, a height and an\noptional overlay per tile, and reports which tile is selected or clicked. It\nshares an index with ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"ui-image-slider"})," (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"setIndex"}),"/",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"currentIndex"}),") so grid and\nslider can point at the same picture. It opens nothing itself: a click emits\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"clickIndex"}),", and what follows — a slider in zoom, a route — is the host's\ndecision. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," must be set; the default ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"0"})," draws no columns."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["As a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"strip"})," (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"singleRow"})," with a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"tileHeight"}),") it is one row of equally\nsized tiles that scrolls sideways once there are more than fit — a row of\nepisode stills, a row of posters. Then ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," plays no part, nothing is\npadded, and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"tileAspect"})," gives the tile its shape. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"imageFit"})," decides how\na tile holds its picture in either mode: at its own size (the default), or\nfilling the tile, or fitted whole."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_storybook_blocks_guide_mdx__WEBPACK_IMPORTED_MODULE_5__.Ay,{of:"ui-image-grid",entry:_guide_ui_image_grid_json__WEBPACK_IMPORTED_MODULE_6__}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"image-grid",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/atoms-image-grid--image-grid",children:"Image Grid"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"strip",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/atoms-image-grid--strip",children:"Strip"})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["One row of fixed-size tiles that scrolls sideways — an episode strip, a row\nof posters. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"singleRow"})," with a ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"tileHeight"}),": every tile is that tall and\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"tileHeight × tileAspect"})," wide, the row holds exactly its items, and once\nthey are wider than the container it scrolls instead of shrinking them.\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," is not read. The pictures fill their tiles (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"imageFit: 'cover'"}),"), and\nthe click area names the tile — the story writes the item's ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"alt"})," into it."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"features",children:"Features"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Responsive Grid"}),": Automatically adjusts to its container and supports configurable column counts."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Lazy Loading Support"}),": Integrated ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"loaded"})," state to manage image rendering."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Interactive Overlays"}),": Supports different overlay types (e.g., 'default', 'doors') for enhanced user interaction."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Click Area"}),": An ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<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."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Action Mode"}),": Enable interactive selection with event emitting for current and clicked indices."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"Dynamic Styling"}),": Configure gap, height, and image scaling per item."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"inputs",children:"Inputs"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"@Input"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Type"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Default"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Description"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"data"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"UiImageDisplayItemDataType[] | null"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"null"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Array of image objects containing source, alt text, and scaling info."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"cols"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"0"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Number of columns in the grid. The default ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"0"})," renders no columns — always set it."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"gap"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"0"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Gap between grid items in pixels."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"height"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"undefined"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Height of the grid container. If ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"singleRow"})," is false, this is the total height. If ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"singleRow"})," is true, this value is divided by ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"cols"})," to determine the row height. Falls back to 200px when no height is given."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"tileHeight"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"undefined"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["Strip mode, with ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"singleRow"}),": the fixed tile height in pixels. The row then holds exactly its items at that size and scrolls sideways when they do not fit; ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"cols"})," and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"height"})," are not read. Without it the single row keeps its ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"height / cols"})," sizing."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"tileAspect"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"string"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"'1/1'"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["The strip tile's shape as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"width/height"})," — ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'16/9'"})," for stills, ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'2/3'"})," for posters. Read only together with ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"tileHeight"}),"."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"imageFit"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'none' | 'cover' | 'contain'"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"'none'"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["How a tile holds its picture. ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"none"})," draws it at its own size and lets the tile crop it; ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"cover"})," fills the tile and crops what does not fit; ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"contain"})," shows the whole picture with bars where the shapes differ."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"singleRow"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["If true, the grid renders as a single row with horizontal scrolling. The row height is calculated as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"height / cols"}),"."]})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"setIndex"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"number"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"0"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Programmatically set the active/scrolled-to image index."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"action"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Enables click interactions and active state highlighting."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"loaded"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("td",{children:["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 ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"src"}),' falls into, see "A tile without a picture".']})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"overlayType"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"'default' | 'doors'"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"'default'"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Visual style of the hover/active overlay."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"debug"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"boolean"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"false"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Shows internal state information (cols, indices, src) for debugging."})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"a-tile-without-a-picture",children:"A tile without a picture"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["A tile without a source draws ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"no image at all"}),": it shows an icon with the\nitem's ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"title"})," underneath, gets the modifier class ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"._-no-image"}),", and is left\nout of the click area. Nothing is broken — this is what the component does\nwhen it has nothing to show."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["In the story above, the fourth tile is that case, and it says so: the entry\ncarries the title ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:'"no image on purpose"'}),". Give it whatever wording fits your\ncase — the component supplies the space, never the words."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"A picture that fails to load"})," is the other case, and it ends in the same\npicture: the tile keeps its surface and shows the item's ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"alt"})," text, centred,\nwhatever the fit mode — a sized ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<img>"})," that failed would otherwise draw the\nbrowser's broken-image icon in a corner. The grid marks the tile on the\nimage's ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"error"})," event; new data clears the marks."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"Two things worth knowing about the empty state:"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.strong,{children:["It is the same branch as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"loaded: false"}),"."]})," Turn ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"loaded"})," off and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.em,{children:"every"}),'\ntile shows its title. The component does not distinguish "not there yet" from\n"not there at all" — both mean "no picture to draw", and both look the same.']}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"The grid pads to a square."})," ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"gridColsInternal"})," squares the column count,\nso a data set that does not fill the last row leaves empty tiles behind. With\nthe story's 25 items that is 49 tiles: 24 of them carry no data and render as\nthe same empty state."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"grid-logic",children:"Grid Logic"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The component uses internal computed signals to determine the grid layout and height."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.h5,{id:"column-calculation-gridcolsinternal",children:["Column Calculation (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"gridColsInternal"}),")"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The number of columns is determined by the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," input and the total number of items (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"dataCount"}),"):"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:["If ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"dataCount / cols > cols"}),', the grid becomes "square-ish" or expands to fit items, calculating columns as ',(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"Math.ceil(dataCount / cols)"}),"."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:["Otherwise, it uses the fixed ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," value provided."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:["With ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"cols"})," at ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"0"})," (the default) no expansion happens and the grid gets zero columns — a column count is part of using the component."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:["A ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"single row never expands and never pads"}),": it holds exactly its items. The square is the two-dimensional grid's shape, and a row has no second dimension to fill."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.h5,{id:"height-calculation-scrollerheight",children:["Height Calculation (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"scrollerHeight"}),")"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"The height of the grid container is dynamically calculated:"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.ul,{children:["\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.strong,{children:["Standard Mode (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"singleRow"})," is false)"]}),": Uses the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"height"})," input value in pixels. Falls back to ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"200px"})," when no ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"height"})," is given."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.strong,{children:["Single Row Mode (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"singleRow"})," is true)"]}),": The height is calculated as ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"height / cols"})," (both must be set; otherwise the same ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"height"}),"-or-",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"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."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.li,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.strong,{children:["Strip Mode (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"singleRow"})," with ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"tileHeight"}),")"]}),": The height IS ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"tileHeight"}),"; each tile is ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"tileHeight"})," tall and ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"tileHeight × tileAspect"})," wide, and the row's tracks are that width, so the row overflows and scrolls instead of shrinking the tiles to fit. See the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.a,{href:"?path=/story/atoms-image-grid--strip",children:"Strip"})," story."]}),"\n"]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"outputs",children:"Outputs"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("table",{class:"ui",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"@Output"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Type"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("th",{children:"Description"})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"currentIndex"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"output<number>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Emitted when a new item becomes active or is clicked."})]}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("tr",{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"clickIndex"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("code",{children:"output<number>"})}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("td",{children:"Emitted when an already active item is clicked (only when a click-area template is projected)."})]})]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h4,{id:"the-click-area",children:"The click area"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The overlay that appears on the ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.strong,{children:"active"})," tile, and whose second click\nemits ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"clickIndex"}),". It is an ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"<ng-template uiImageGridClickArea>"})," projected\ninto the tag: the grid stamps it into every tile, so everything Angular can\ndo inside a template works here — bindings, pipes, ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"(click)"})," handlers — and\nthe template is handed the tile's item (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"let-item"}),") and index\n(",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:'let-index="index"'}),")."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.p,{children:"A template rather than projected content, because content can be projected\nonce and the grid needs the area in every tile. It used to clone a projected\nelement's innerHTML per tile, which ran the markup through the sanitizer and\nleft a dead copy without events; a stamped template keeps all of that alive."}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The marker is the directive ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"UiImageGridClickAreaDirective"})," — import it next\nto the grid. It is a marker and nothing else, so the grid finds the click\narea by name rather than taking the first template it meets; a caller may\nproject other templates (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"*ngIf"}),", a structural directive of their own)\nwithout one of those ending up in every tile."]}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.pre,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{className:"language-html",children:'<ui-image-grid [data]="myData" [action]="true" (clickIndex)="open($event)">\n <ng-template uiImageGridClickArea let-item let-index="index">\n <div class="my-overlay">{{ index + 1 }}: {{ item.title }}</div>\n </ng-template>\n</ui-image-grid>\n'})}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.hr,{}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.h3,{id:"sizing",children:"Sizing"}),"\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_components.p,{children:["The host fills its container (",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"100%"})," / ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"100%"}),") by default. Give it a fixed size\nwithout a cascade fight through the named hooks ",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"--ui-image-grid-width"})," and\n",(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_components.code,{children:"--ui-image-grid-height"}),"."]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={...(0,file_Users_moja_projects_mojawork_mono_node_modules_storybook_addon_docs_dist_mdx_react_shim_js__WEBPACK_IMPORTED_MODULE_2__.R)(),...props.components};return MDXLayout?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(MDXLayout,{...props,children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_createMdxContent,{...props})}):_createMdxContent(props)}},"./libs/ui/src/lib/atoms/image-grid/image-grid.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ImageGrid:()=>ImageGrid,Strip:()=>Strip,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _angular_forms__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@angular/forms/fesm2022/forms.mjs"),_storybook_angular__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),_storybook_demos_header_header_component__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts"),_image_mock__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./libs/ui/src/lib/atoms/image.mock.ts"),_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts"),_image_grid_component__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.ts");const meta={title:"Atoms/Image Grid",component:_image_grid_component__WEBPACK_IMPORTED_MODULE_5__.p,decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_1__.Iz)({providers:[_angular_forms__WEBPACK_IMPORTED_MODULE_0__.vS],imports:[_storybook_demos_header_header_component__WEBPACK_IMPORTED_MODULE_2__.b,_angular_forms__WEBPACK_IMPORTED_MODULE_0__.YN,_image_grid_component__WEBPACK_IMPORTED_MODULE_5__.p,_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_4__.u]})],argTypes:{cols:{control:{type:"range",min:1,max:16,step:1}},gap:{control:{type:"range",min:0,max:64,step:1}},height:{control:{type:"range",min:100,max:1e3,step:10}},setIndex:{control:{type:"range",min:0,max:24,step:1}},tileHeight:{control:{type:"range",min:40,max:300,step:10}},tileAspect:{control:"select",options:["1/1","16/9","4/3","2/3"]},imageFit:{control:"select",options:["none","cover","contain"]},action:{control:"boolean"},loaded:{control:"boolean"},singleRow:{control:"boolean"},overlayType:{control:"select",options:["default","doors"]},currentIndex:{table:{disable:!0}},clickIndex:{table:{disable:!0}},data:{control:"object"}},parameters:{docs:{canvas:{sourceState:"none"},source:{code:null}}},args:{cols:4,gap:4,height:520,setIndex:0,action:!0,loaded:!0,singleRow:!1,overlayType:"default",tileHeight:void 0,tileAspect:"1/1",imageFit:"none",data:(0,_image_mock__WEBPACK_IMPORTED_MODULE_3__.W)()}},hideAll=Object.fromEntries(["cols","gap","height","setIndex","action","loaded","singleRow","data","debug"].map(key=>[key,{table:{disable:!0}}])),__WEBPACK_DEFAULT_EXPORT__=meta,ImageGrid={render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [setIndex]="setIndex"\n (currentIndex)="currentIndex=$event"\n (clickIndex)="clickIndex=$event"\n [data]="data"\n [action]="action"\n [height]="height"\n [singleRow]="singleRow"\n [loaded]="loaded"\n [cols]="cols"\n [gap]="gap"\n [tileHeight]="tileHeight"\n [tileAspect]="tileAspect"\n [imageFit]="imageFit"\n [overlayType]="overlayType">\n <ng-template uiImageGridClickArea let-item let-index="index">\n <div class="bg-c-background p-2">{{ index + 1 }}: {{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n '})},Strip={argTypes:hideAll,args:{tileHeight:100,tileAspect:"16/9",imageFit:"cover",overlayType:"default"},render:args=>({props:{...args,strip:(0,_image_mock__WEBPACK_IMPORTED_MODULE_3__.W)().slice(0,12)},template:'\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex w-full flex-col">\n <ui-image-grid\n class="w-full"\n [data]="strip"\n [singleRow]="true"\n [tileHeight]="tileHeight"\n [tileAspect]="tileAspect"\n [imageFit]="imageFit"\n [overlayType]="overlayType"\n [gap]="4"\n [action]="true"\n [loaded]="true">\n <ng-template uiImageGridClickArea let-item>\n <div class="bg-c-background px-2 py-1 font-bold">{{ item.alt }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n '})},__namedExportsOrder=["ImageGrid","Strip"];ImageGrid.parameters={...ImageGrid.parameters,docs:{...ImageGrid.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [setIndex]="setIndex"\n (currentIndex)="currentIndex=$event"\n (clickIndex)="clickIndex=$event"\n [data]="data"\n [action]="action"\n [height]="height"\n [singleRow]="singleRow"\n [loaded]="loaded"\n [cols]="cols"\n [gap]="gap"\n [tileHeight]="tileHeight"\n [tileAspect]="tileAspect"\n [imageFit]="imageFit"\n [overlayType]="overlayType">\n <ng-template uiImageGridClickArea let-item let-index="index">\n <div class="bg-c-background p-2">{{ index + 1 }}: {{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n `\n };\n }\n}',...ImageGrid.parameters?.docs?.source}}},Strip.parameters={...Strip.parameters,docs:{...Strip.parameters?.docs,source:{originalSource:'{\n argTypes: hideAll,\n args: {\n tileHeight: 100,\n tileAspect: \'16/9\',\n imageFit: \'cover\',\n overlayType: \'default\'\n },\n render: args => ({\n props: {\n ...args,\n strip: uiImageMock().slice(0, 12)\n },\n template: `\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex w-full flex-col">\n <ui-image-grid\n class="w-full"\n [data]="strip"\n [singleRow]="true"\n [tileHeight]="tileHeight"\n [tileAspect]="tileAspect"\n [imageFit]="imageFit"\n [overlayType]="overlayType"\n [gap]="4"\n [action]="true"\n [loaded]="true">\n <ng-template uiImageGridClickArea let-item>\n <div class="bg-c-background px-2 py-1 font-bold">{{ item.alt }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n `\n })\n}',...Strip.parameters?.docs?.source},description:{story:"One row of fixed-size tiles that scrolls sideways — an episode strip. The\ntiles keep their height and shape whatever the container's width; with\nmore of them than fit, the row overflows and scrolls instead of shrinking\nthem. `cols` is not read here, and nothing is padded: twelve pictures are\ntwelve tiles. The pictures fill their tiles (`imageFit: 'cover'`).",...Strip.parameters?.docs?.description}}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[8039],{"./libs/ui/src/lib/atoms/image-grid/image-grid.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{ImageGrid:()=>ImageGrid,Strip:()=>Strip,__namedExportsOrder:()=>__namedExportsOrder,default:()=>__WEBPACK_DEFAULT_EXPORT__});var _angular_forms__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/@angular/forms/fesm2022/forms.mjs"),_storybook_angular__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),_storybook_demos_header_header_component__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts"),_image_mock__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./libs/ui/src/lib/atoms/image.mock.ts"),_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid-click-area.directive.ts"),_image_grid_component__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./libs/ui/src/lib/atoms/image-grid/image-grid.component.ts");const meta={title:"Atoms/Image Grid",component:_image_grid_component__WEBPACK_IMPORTED_MODULE_5__.p,decorators:[(0,_storybook_angular__WEBPACK_IMPORTED_MODULE_1__.Iz)({providers:[_angular_forms__WEBPACK_IMPORTED_MODULE_0__.vS],imports:[_storybook_demos_header_header_component__WEBPACK_IMPORTED_MODULE_2__.b,_angular_forms__WEBPACK_IMPORTED_MODULE_0__.YN,_image_grid_component__WEBPACK_IMPORTED_MODULE_5__.p,_image_grid_click_area_directive__WEBPACK_IMPORTED_MODULE_4__.u]})],argTypes:{cols:{control:{type:"range",min:1,max:16,step:1}},gap:{control:{type:"range",min:0,max:64,step:1}},height:{control:{type:"range",min:100,max:1e3,step:10}},setIndex:{control:{type:"range",min:0,max:24,step:1}},tileHeight:{control:{type:"range",min:40,max:300,step:10}},tileAspect:{control:"select",options:["1/1","16/9","4/3","2/3"]},imageFit:{control:"select",options:["none","cover","contain"]},action:{control:"boolean"},loaded:{control:"boolean"},singleRow:{control:"boolean"},overlayType:{control:"select",options:["default","doors"]},currentIndex:{table:{disable:!0}},clickIndex:{table:{disable:!0}},data:{control:"object"}},parameters:{docs:{canvas:{sourceState:"none"},source:{code:null}}},args:{cols:4,gap:4,height:520,setIndex:0,action:!0,loaded:!0,singleRow:!1,overlayType:"default",tileHeight:void 0,tileAspect:"1/1",imageFit:"none",data:(0,_image_mock__WEBPACK_IMPORTED_MODULE_3__.W)()}},hideAll=Object.fromEntries(["cols","gap","height","setIndex","action","loaded","singleRow","data","debug"].map(key=>[key,{table:{disable:!0}}])),__WEBPACK_DEFAULT_EXPORT__=meta,ImageGrid={render:args=>({props:{...args},template:'\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [setIndex]="setIndex"\n (currentIndex)="currentIndex=$event"\n (clickIndex)="clickIndex=$event"\n [data]="data"\n [action]="action"\n [height]="height"\n [singleRow]="singleRow"\n [loaded]="loaded"\n [cols]="cols"\n [gap]="gap"\n [tileHeight]="tileHeight"\n [tileAspect]="tileAspect"\n [imageFit]="imageFit"\n [overlayType]="overlayType">\n <ng-template uiImageGridClickArea let-item let-index="index">\n <div class="bg-c-background p-2">{{ index + 1 }}: {{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n '})},Strip={argTypes:hideAll,args:{tileHeight:100,tileAspect:"16/9",imageFit:"cover",overlayType:"default"},render:args=>({props:{...args,strip:(0,_image_mock__WEBPACK_IMPORTED_MODULE_3__.W)().slice(0,12)},template:'\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex w-full flex-col">\n <ui-image-grid\n class="w-full"\n [data]="strip"\n [singleRow]="true"\n [tileHeight]="tileHeight"\n [tileAspect]="tileAspect"\n [imageFit]="imageFit"\n [overlayType]="overlayType"\n [gap]="4"\n [action]="true"\n [loaded]="true">\n <ng-template uiImageGridClickArea let-item>\n <div class="bg-c-background px-2 py-1 font-bold">{{ item.alt }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n '})},__namedExportsOrder=["ImageGrid","Strip"];ImageGrid.parameters={...ImageGrid.parameters,docs:{...ImageGrid.parameters?.docs,source:{originalSource:'{\n render: args => {\n return {\n props: {\n ...args\n },\n template: `\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex flex-col">\n <ui-image-grid\n [setIndex]="setIndex"\n (currentIndex)="currentIndex=$event"\n (clickIndex)="clickIndex=$event"\n [data]="data"\n [action]="action"\n [height]="height"\n [singleRow]="singleRow"\n [loaded]="loaded"\n [cols]="cols"\n [gap]="gap"\n [tileHeight]="tileHeight"\n [tileAspect]="tileAspect"\n [imageFit]="imageFit"\n [overlayType]="overlayType">\n <ng-template uiImageGridClickArea let-item let-index="index">\n <div class="bg-c-background p-2">{{ index + 1 }}: {{ item.title }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n `\n };\n }\n}',...ImageGrid.parameters?.docs?.source}}},Strip.parameters={...Strip.parameters,docs:{...Strip.parameters?.docs,source:{originalSource:'{\n argTypes: hideAll,\n args: {\n tileHeight: 100,\n tileAspect: \'16/9\',\n imageFit: \'cover\',\n overlayType: \'default\'\n },\n render: args => ({\n props: {\n ...args,\n strip: uiImageMock().slice(0, 12)\n },\n template: `\n <ui-intern-header theme="theme-light" [onTop]="true" [display]="true"></ui-intern-header>\n <section class="relative flex w-full flex-col">\n <ui-image-grid\n class="w-full"\n [data]="strip"\n [singleRow]="true"\n [tileHeight]="tileHeight"\n [tileAspect]="tileAspect"\n [imageFit]="imageFit"\n [overlayType]="overlayType"\n [gap]="4"\n [action]="true"\n [loaded]="true">\n <ng-template uiImageGridClickArea let-item>\n <div class="bg-c-background px-2 py-1 font-bold">{{ item.alt }}</div>\n </ng-template>\n </ui-image-grid>\n </section>\n `\n })\n}',...Strip.parameters?.docs?.source},description:{story:"One row of fixed-size tiles that scrolls sideways — an episode strip. The\ntiles keep their height and shape whatever the container's width; with\nmore of them than fit, the row overflows and scrolls instead of shrinking\nthem. `cols` is not read here, and nothing is padded: twelve pictures are\ntwelve tiles. The pictures fill their tiles (`imageFit: 'cover'`).",...Strip.parameters?.docs?.description}}}}}]);
@@ -1 +1 @@
1
- (self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[2831],{"./libs/ui/.storybook/demos/header/header.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{b:()=>UiInternHeaderComponent});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var header_componentngResource=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.css?ngResource"),header_componentngResource_default=__webpack_require__.n(header_componentngResource),_common_module_chunk=__webpack_require__("./node_modules/@angular/common/fesm2022/_common_module-chunk.mjs"),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),ui_config_types=__webpack_require__("./libs/ui/src/config/ui-config.types.ts"),layout_service=__webpack_require__("./libs/ui/src/lib/layout/_service/layout.service.ts");let UiInternHeaderComponent=class UiInternHeaderComponent{layoutService=(0,_effect_chunk2.WQX)(layout_service.u);theme=(0,core.input)(null);display=(0,core.input)(!1,{transform:core.booleanAttribute});onTop=(0,core.input)(!1,{transform:core.booleanAttribute});ngOnInit(){this.layoutService.handleTheme(this.theme(),ui_config_types.Q)}ngOnDestroy(){this.layoutService.handleTheme("theme-light",ui_config_types.Q)}setTheme(){this.layoutService.handleTheme(null,ui_config_types.Q)}static propDecorators={theme:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"theme",required:!1,transform:void 0}]}],display:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"display",required:!1,transform:void 0}]}],onTop:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"onTop",required:!1,transform:void 0}]}]}};UiInternHeaderComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-intern-header",template:'@if (display()) {\n <button class="ui" [class._on-top]="onTop()" (click)="setTheme()">\n switch Theme\n </button>\n}\n',encapsulation:_debug_node_chunk.gXe.Emulated,standalone:!0,imports:[_common_module_chunk.MD],styles:[header_componentngResource_default()]})],UiInternHeaderComponent)},"./libs/ui/src/config/ui-config.types.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Q:()=>uiConfigStorybookCssPrefix,y:()=>uiConfigTypes});const uiConfigStorybookCssPrefix="ui-storybook ",uiConfigTypes={mainID:"ui-main",mainClass:"ui-main",storeName:"ui-layout"}},"./libs/ui/src/lib/atoms/placeholder/placeholder.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{F:()=>UiPlaceholderComponent});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var placeholder_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/placeholder/placeholder.component.css?ngResource"),placeholder_componentngResource_default=__webpack_require__.n(placeholder_componentngResource),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),ngneat_transloco=__webpack_require__("./node_modules/@ngneat/transloco/fesm2022/ngneat-transloco.mjs");let UiPlaceholderComponent=class UiPlaceholderComponent{label=(0,core.input)(null);static propDecorators={label:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"label",required:!1,transform:void 0}]}]}};UiPlaceholderComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-placeholder",template:"<span class=\"_label\">{{ label() ?? ('placeholder.label' | transloco) }}</span>\n",encapsulation:_debug_node_chunk.gXe.None,imports:[ngneat_transloco.Kj],styles:[placeholder_componentngResource_default()]})],UiPlaceholderComponent)},"./libs/ui/src/lib/layout/_service/layout.service.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{u:()=>UiLayoutService});var tslib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/tslib/tslib.es6.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),_ngx_pwa_local_storage__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@ngx-pwa/local-storage/fesm2022/ngx-pwa-local-storage.mjs"),_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/config/ui-config.types.ts");let UiLayoutService=class UiLayoutService{storage=(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.WQX)(_ngx_pwa_local_storage__WEBPACK_IMPORTED_MODULE_3__.AX);settings={cssPrefix:"",theme:null,zoom:null,fullscreen:null,direction:"center",layoutSize:null};setStorage(){this.storage.set(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName,this.settings).subscribe()}handleInit(config){this.settings.cssPrefix=config.cssPrefix,this.settings.theme=config.theme,this.settings.zoom=config.zoom?"zoom":"x-zoom",this.settings.fullscreen=config.fullscreen?"fullscreen":"x-fullscreen",this.handleFullScreen(this.settings.fullscreen),this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data),this.setStorage(),this.setTheme(null)})}setTheme(theme){document.body.className=theme?`${this.settings.cssPrefix} ${theme}`:`${this.settings.cssPrefix} ${this.settings.theme}`}getTheme(){return this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data)}),this.settings.theme}getMainClass(){return`${_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.mainClass} ${this.settings.zoom} ${this.settings.fullscreen}`}handleFullScreen(init){init?this.settings.fullscreen=init:"fullscreen"===this.settings.fullscreen?this.settings.fullscreen="x-fullscreen":this.settings.fullscreen="fullscreen",this.setStorage()}handleZoom(init){init?this.settings.zoom=init:"zoom"===this.settings.zoom?this.settings.zoom="x-zoom":this.settings.zoom="zoom",this.setStorage()}handleTheme(theme,prefix){return prefix&&(this.settings.cssPrefix=prefix),theme?(this.setTheme(theme),this.settings.theme=theme):(this.settings.theme="theme-light"===this.settings.theme?"theme-dark":"theme-light",this.setTheme(null)),this.setStorage(),this.settings.theme}handleDirection(type){this.settings.direction=type,this.setStorage()}setLayoutSize(sizes){this.settings.layoutSize=sizes,this.storage.set(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName,this.settings).subscribe()}getLayoutSize(){return this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data)}),this.settings.layoutSize}};UiLayoutService=(0,tslib__WEBPACK_IMPORTED_MODULE_0__.Cg)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__._qm)({providedIn:"root"})],UiLayoutService)},"./libs/ui/src/lib/atoms/mosaic/mosaic.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Colors:()=>Colors,Images:()=>Images,OverImage:()=>OverImage,OverText:()=>OverText,__namedExportsOrder:()=>__namedExportsOrder,default:()=>mosaic_component_stories});var _effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),dist=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),header_component=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts"),placeholder_component=__webpack_require__("./libs/ui/src/lib/atoms/placeholder/placeholder.component.ts"),tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var mosaic_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/mosaic/mosaic.component.css?ngResource"),mosaic_componentngResource_default=__webpack_require__.n(mosaic_componentngResource),mosaic_animationsngResource=__webpack_require__("./libs/ui/src/lib/atoms/mosaic/mosaic.animations.css?ngResource"),mosaic_animationsngResource_default=__webpack_require__.n(mosaic_animationsngResource),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_resource_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_resource-chunk.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs");const ANIMATION_CLASS={infinity:"_-grow",pulse:"_-pulse",flip:"_-flip",fade:"_-fade",wave:"_-wave"};let UiMosaicComponent=class UiMosaicComponent{images=(0,core.input)(null);colors=(0,core.input)(null);mainImage=(0,core.input)(null);mainColor=(0,core.input)(null);mode=(0,core.input)("image");tileMinWidth=(0,core.input)(120);fallDelay=(0,core.input)(200);fallDuration=(0,core.input)(1200);animationType=(0,core.input)("falldown");border=(0,core.input)(!1,{transform:core.booleanAttribute});hostSize=(0,_effect_chunk2.vPA)({width:0,height:0});fallen=(0,_effect_chunk2.vPA)(new Set);animating=(0,_effect_chunk2.vPA)(new Set);animationClass=(0,_resource_chunk.EW)(()=>ANIMATION_CLASS[this.animationType()]??null);loadedImages=(0,_effect_chunk2.vPA)(0);onImageSettled(){this.loadedImages.update(count=>count+1)}allTilesSettled=(0,_resource_chunk.EW)(()=>{const tileCount=this.tiles().length;return 0!==tileCount&&("color"===this.mode()||this.loadedImages()>=tileCount)});cols=(0,_resource_chunk.EW)(()=>{const tileWidth=Math.max(1,this.tileMinWidth());return Math.max(1,Math.floor(this.hostSize().width/tileWidth))});tiles=(0,_resource_chunk.EW)(()=>{const source="color"===this.mode()?this.colors():this.images(),{width,height}=this.hostSize();if(!source?.length||width<=0||height<=0)return[];const cols=this.cols(),tileHeight=width/cols*(3/4),rows=Math.max(1,Math.ceil(height/tileHeight));return Array.from({length:cols*rows},(_,index)=>source[index%source.length])});tileImage(tile){return"string"==typeof tile?null:tile}tileColor(tile){return"string"==typeof tile?tile:null}constructor(){const host=(0,_effect_chunk2.WQX)(_debug_node_chunk.aKT).nativeElement,observer=new ResizeObserver(entries=>{const box=entries[0]?.contentRect;box&&this.hostSize.set({width:box.width,height:box.height})});observer.observe(host),(0,_effect_chunk2.WQX)(_effect_chunk2.abz).onDestroy(()=>observer.disconnect()),(0,_effect_chunk2.QZP)(onCleanup=>{const tileCount=this.tiles().length,cols=this.cols(),delay=this.fallDelay(),duration=this.fallDuration(),animationType=this.animationType(),ready=this.allTilesSettled();if((0,_resource_chunk.O8)(()=>{this.fallen.set(new Set),this.animating.set(new Set)}),0===tileCount||delay<=0||!ready)return;const timers=new Set,schedule=(handler,ms)=>{const timer=setTimeout(()=>{timers.delete(timer),handler()},ms);timers.add(timer)};if(onCleanup(()=>timers.forEach(timer=>clearTimeout(timer))),"falldown"!==animationType){const waveOrder="wave"===animationType?function diagonalOrder(tileCount,cols){return Array.from({length:tileCount},(_,index)=>index).sort((a,b)=>Math.floor(a/cols)+a%cols-(Math.floor(b/cols)+b%cols)||a%cols-b%cols)}(tileCount,cols):null;let pointer=0;const tick=()=>{const pick=waveOrder?waveOrder[pointer++%waveOrder.length]:Math.floor(Math.random()*tileCount);(0,_resource_chunk.O8)(this.animating).has(pick)||(this.animating.update(animating=>new Set(animating).add(pick)),schedule(()=>{this.animating.update(animating=>{const next=new Set(animating);return next.delete(pick),next})},duration)),schedule(tick,delay)};return void schedule(tick,1e3)}const order=function shuffle(values){for(let i=values.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[values[i],values[j]]=[values[j],values[i]]}return values}(Array.from({length:tileCount},(_,index)=>index)),tick=()=>{const next=order.shift();void 0!==next&&(this.fallen.update(fallen=>new Set(fallen).add(next)),schedule(tick,delay))};schedule(tick,1e3)})}static ctorParameters=()=>[];static propDecorators={images:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"images",required:!1,transform:void 0}]}],colors:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"colors",required:!1,transform:void 0}]}],mainImage:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"mainImage",required:!1,transform:void 0}]}],mainColor:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"mainColor",required:!1,transform:void 0}]}],mode:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"mode",required:!1,transform:void 0}]}],tileMinWidth:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"tileMinWidth",required:!1,transform:void 0}]}],fallDelay:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"fallDelay",required:!1,transform:void 0}]}],fallDuration:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"fallDuration",required:!1,transform:void 0}]}],animationType:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"animationType",required:!1,transform:void 0}]}],border:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"border",required:!1,transform:void 0}]}]}};UiMosaicComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-mosaic",template:'@if (mode() === \'color\') {\n @if (mainColor(); as color) {\n <div class="_main-color" [style.background-color]="color"></div>\n }\n} @else if (mainImage(); as image) {\n <div\n class="_main-image"\n role="img"\n [attr.aria-label]="image.alt"\n [style.background-image]="\'url(\' + image.src + \')\'"\n ></div>\n}\n<div\n class="_grid"\n [style.grid-template-columns]="\'repeat(\' + cols() + \', 1fr)\'"\n>\n @for (tile of tiles(); track $index) {\n <div\n class="_tile"\n [class._-fallen]="fallen().has($index)"\n [class]="\n animationClass() && animating().has($index) ? animationClass() : \'\'\n "\n [style.background-color]="tileColor(tile)"\n >\n @if (tileImage(tile); as image) {\n <img\n [src]="image.src"\n [alt]="image.alt"\n decoding="async"\n (load)="onImageSettled()"\n (error)="onImageSettled()"\n />\n }\n </div>\n }\n</div>\n',encapsulation:_debug_node_chunk.gXe.Emulated,host:{"[style.--ui-mosaic-fall.ms]":"fallDuration()","[class._-border]":"border()"},styles:[mosaic_componentngResource_default(),mosaic_animationsngResource_default()]}),(0,tslib_es6.Sn)("design:paramtypes",[])],UiMosaicComponent);const mosaic_component_stories={title:"Atoms/Mosaic",component:UiMosaicComponent,decorators:[(0,dist.Iz)({imports:[header_component.b,placeholder_component.F,UiMosaicComponent]})],argTypes:{animationType:{control:"radio",options:["falldown","infinity","pulse","flip","fade","wave"]},mode:{control:"radio",options:["image","color"]},mainColor:{control:"color"},tileMinWidth:{control:{type:"range",min:8,max:400,step:2}},fallDelay:{control:{type:"range",min:0,max:1e3,step:5}},fallDuration:{control:{type:"range",min:0,max:3e3,step:50}},border:{control:"boolean"},images:{control:"object"},colors:{control:"object"},mainImage:{control:"object"}},args:{animationType:"falldown",border:!1,mode:"image",colors:["#ff00ff","#00e5ff","#ffe000","#7c4dff","#00c853","#ff3d00"],mainColor:"#101014",tileMinWidth:120,fallDelay:200,fallDuration:1200,images:function uiMosaicMock(){return Array.from({length:120},()=>{const number=String(Math.floor(25*Math.random())+1).padStart(2,"0");return{src:`https://moja.work/media/pictures/numbers/25/numbers-0${number}.png`,alt:`number-${number}`}})}(),mainImage:{src:"https://moja.work/media/pictures/numbers/50/numbers-007.png",alt:"number-07"}},parameters:{docs:{canvas:{sourceState:"none"}}}},mosaic=hostClass=>`\n <ui-mosaic\n class="${hostClass}"\n [mode]="mode"\n [images]="images"\n [colors]="colors"\n [mainImage]="mainImage"\n [mainColor]="mainColor"\n [tileMinWidth]="tileMinWidth"\n [fallDelay]="fallDelay"\n [fallDuration]="fallDuration"\n [animationType]="animationType"\n [border]="border"\n ></ui-mosaic>`,replayProps=()=>{const shown=(0,_effect_chunk2.vPA)(!0);return{shown,replay:()=>{shown.set(!1),setTimeout(()=>shown.set(!0),60)}}},replayButton='\n <button class="ui fixed bottom-4 left-4 z-20" type="button" (click)="replay()">replay</button>',Images={render:args=>({props:{...args,...replayProps()},template:`\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col">\n @if (shown()) { ${mosaic("fixed inset-0 -z-10")} }\n ${replayButton}\n </section>`})},Colors={args:{mode:"color",images:[]},render:args=>({props:{...args,...replayProps()},template:`\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col">\n @if (shown()) { ${mosaic("fixed inset-0 -z-10")} }\n ${replayButton}\n </section>`})},OverText={args:{mode:"color",images:[],mainImage:null,mainColor:null,tileMinWidth:48,fallDelay:40},render:args=>({props:{...args,...replayProps()},template:`\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative m-4 w-full max-w-2xl">\n <ui-placeholder class="block h-64 w-full"></ui-placeholder>\n @if (shown()) { ${mosaic("absolute inset-0 z-10")} }\n </section>\n ${replayButton}`})},OverImage={args:{mode:"color",images:[],mainImage:null,mainColor:null,tileMinWidth:48,fallDelay:40},render:args=>({props:{...args,...replayProps()},template:`\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative m-4 h-96 w-[36rem]">\n <img\n class="h-full w-full object-cover"\n src="https://moja.work/media/pictures/numbers/50/numbers-007.png"\n alt="number-07"\n />\n @if (shown()) { ${mosaic("absolute inset-0 z-10")} }\n </section>\n ${replayButton}`})},__namedExportsOrder=["Images","Colors","OverText","OverImage"];Images.parameters={...Images.parameters,docs:{...Images.parameters?.docs,source:{originalSource:'{\n render: args => ({\n props: {\n ...args,\n ...replayProps()\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col">\n @if (shown()) { ${mosaic(\'fixed inset-0 -z-10\')} }\n ${replayButton}\n </section>`\n })\n}',...Images.parameters?.docs?.source},description:{story:"Pinned behind the page, which is what the component used to do on its own.\nThe three declarations that were burned into `:host` now sit on the tag,\nwhere a consumer can see and change them.",...Images.parameters?.docs?.description}}},Colors.parameters={...Colors.parameters,docs:{...Colors.parameters?.docs,source:{originalSource:"{\n args: {\n mode: 'color',\n // Empty on purpose: this story is about the colors, and a control still\n // holding 120 images would suggest they are part of the example.\n images: []\n },\n render: args => ({\n props: {\n ...args,\n ...replayProps()\n },\n template: `\n <ui-intern-header theme=\"theme-light\"></ui-intern-header>\n <section class=\"relative flex flex-col\">\n @if (shown()) { ${mosaic('fixed inset-0 -z-10')} }\n ${replayButton}\n </section>`\n })\n}",...Colors.parameters?.docs?.source},description:{story:"The same host, filled with plain colors instead of images.",...Colors.parameters?.docs?.description}}},OverText.parameters={...OverText.parameters,docs:{...OverText.parameters?.docs,source:{originalSource:'{\n args: {\n mode: \'color\',\n images: [],\n mainImage: null,\n mainColor: null,\n tileMinWidth: 48,\n fallDelay: 40\n },\n render: args => ({\n props: {\n ...args,\n ...replayProps()\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative m-4 w-full max-w-2xl">\n <ui-placeholder class="block h-64 w-full"></ui-placeholder>\n @if (shown()) { ${mosaic(\'absolute inset-0 z-10\')} }\n </section>\n ${replayButton}`\n })\n}',...OverText.parameters?.docs?.source},description:{story:"Not a background at all: the same tag inside a `relative` box, stacked ON\nTOP of what it covers. Both backdrops are empty here on purpose — what the\nfalling tiles reveal is the content underneath, not a picture the mosaic\nbrought along.",...OverText.parameters?.docs?.description}}},OverImage.parameters={...OverImage.parameters,docs:{...OverImage.parameters?.docs,source:{originalSource:'{\n args: {\n mode: \'color\',\n images: [],\n mainImage: null,\n mainColor: null,\n tileMinWidth: 48,\n fallDelay: 40\n },\n render: args => ({\n props: {\n ...args,\n ...replayProps()\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative m-4 h-96 w-[36rem]">\n <img\n class="h-full w-full object-cover"\n src="https://moja.work/media/pictures/numbers/50/numbers-007.png"\n alt="number-07"\n />\n @if (shown()) { ${mosaic(\'absolute inset-0 z-10\')} }\n </section>\n ${replayButton}`\n })\n}',...OverImage.parameters?.docs?.source},description:{story:"The same again over a picture — the host is the only difference.",...OverImage.parameters?.docs?.description}}}},"./libs/ui/.storybook/demos/header/header.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"/* The intern header is reduced to just the theme switch button, pinned to the */\n/* bottom-left corner of the Storybook canvas. */\nbutton {\n position: fixed;\n bottom: calc(var(--ui-spacer) * 0.5);\n left: calc(var(--ui-spacer) * 0.5);\n z-index: 1000;\n\n &._on-top {\n z-index: 10000;\n }\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()},"./libs/ui/src/lib/atoms/mosaic/mosaic.animations.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n/* Animations of the background grid, separated from the layout styles.\n Each endless mode applies its modifier class to a picked tile and removes\n it after the animation finished (timer-driven), so tiles can replay. */\n\n/* infinity: a randomly picked tile pops from tiny to its full size. */\n._tile._-grow {\n animation: ui-mosaic-grow var(--ui-mosaic-fall, 1200ms)\n ease-out;\n}\n\n@keyframes ui-mosaic-grow {\n from {\n transform: scale(0);\n }\n\n to {\n transform: scale(1);\n }\n}\n\n/* pulse: a randomly picked tile takes a soft breath. */\n._tile._-pulse {\n animation: ui-mosaic-pulse var(--ui-mosaic-fall, 1200ms)\n ease-in-out;\n}\n\n@keyframes ui-mosaic-pulse {\n 0%,\n 100% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(1.12);\n }\n}\n\n/* flip: a randomly picked tile turns once around its Y axis. */\n._tile._-flip {\n animation: ui-mosaic-flip var(--ui-mosaic-fall, 1200ms)\n ease-in-out;\n}\n\n@keyframes ui-mosaic-flip {\n from {\n transform: perspective(60rem) rotateY(0deg);\n }\n\n to {\n transform: perspective(60rem) rotateY(360deg);\n }\n}\n\n/* fade: a randomly picked tile blinks out and back in. */\n._tile._-fade {\n animation: ui-mosaic-fade var(--ui-mosaic-fall, 1200ms)\n ease-in-out;\n}\n\n@keyframes ui-mosaic-fade {\n 0%,\n 100% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0;\n }\n}\n\n/* wave: tiles lift briefly while a diagonal sweep crosses the grid. */\n._tile._-wave {\n animation: ui-mosaic-wave var(--ui-mosaic-fall, 1200ms)\n ease-in-out;\n}\n\n@keyframes ui-mosaic-wave {\n 0%,\n 100% {\n transform: translateY(0) scale(1);\n }\n\n 50% {\n transform: translateY(-8%) scale(1.06);\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()},"./libs/ui/src/lib/atoms/mosaic/mosaic.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n:host {\n /* No position, no z-index, no size: WHERE the mosaic sits — pinned behind\n the page, inside a box, over a picture — is the caller's decision, and so\n is how big it is. It fills the box it is given and brings nothing else.\n Given no box, it renders nothing; that is a wiring mistake, not a fault\n of the component. `pointer-events: none` stays: it is decoration, and\n decoration never takes a click away from what it lies on. */\n display: block;\n overflow: hidden;\n pointer-events: none;\n}\n\n._grid {\n /* Positioned so it paints ABOVE the absolutely positioned backdrop —\n unpositioned flow content would be covered by it regardless of DOM\n order. */\n position: relative;\n display: grid;\n width: 100%;\n height: 100%;\n}\n\n/* The backdrop behind the tiles — an image in `image` mode, a plain color in\n `color` mode. Both fill the host; what the falling tiles reveal is whichever\n one is present (and the page itself when neither is). */\n._main-image,\n._main-color {\n position: absolute;\n inset: 0;\n}\n\n._main-image {\n background-size: cover;\n background-position: center center;\n}\n\n/* In `color` mode the tile IS the surface — the color is bound straight onto\n this element, so a colored tile needs no child at all and falls, flips and\n pulses exactly like an image tile. */\n._tile {\n aspect-ratio: 4 / 3;\n overflow: hidden;\n transform-origin: center center;\n}\n\n/* Optional tile border (border input). */\n:host(._-border) ._tile {\n box-sizing: border-box;\n border: var(--ui-border-width) solid var(--ui-c-secondary);\n}\n\n/* A fallen tile: shrunk to nothing around its center, fully transparent —\n it stays gone and reveals the main image behind the grid. The transition\n lives ONLY on the fallen state: shrinking animates, reappearing (state\n resets, infinity rounds) snaps instantly — tiles never grow into view. */\n._tile._-fallen {\n transform: scale(0);\n opacity: 0;\n transition:\n transform var(--ui-mosaic-fall, 1200ms) ease-in,\n opacity var(--ui-mosaic-fall, 1200ms) ease-in;\n}\n\n._tile img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()},"./libs/ui/src/lib/atoms/placeholder/placeholder.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n/* Encapsulation.None — one nested block anchored on the tag, so the rules\n cannot leak while the host itself stays styleable from outside. */\nui-placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* A floor, not a size: width and height come from wherever it is used.\n Without one an empty stand-in collapses to a text line and stops being\n the mass it exists to be. The floor is a named hook with a fallback, so a\n consumer who deliberately wants a smaller stand-in can set\n `--ui-placeholder-min-width` / `--ui-placeholder-min-height` without a\n cascade fight — an unlayered host rule otherwise beats a width utility in\n `@layer utilities` (tickets#241, tickets#251, tickets#253). */\n min-width: var(--ui-placeholder-min-width, calc(var(--ui-spacer) * 3));\n min-height: var(--ui-placeholder-min-height, calc(var(--ui-spacer) * 3));\n padding: calc(var(--ui-spacer) * 0.25);\n\n /* The overlay header's pair: filled enough to read as chrome rather than\n content, and theme-aware through the tokens. */\n background-color: var(--ui-c-primary);\n color: var(--ui-c-default);\n border: var(--ui-border-width) solid var(--ui-c-fourthly);\n border-radius: var(--ui-border-radius);\n\n /* It is scenery, never the subject: nothing here should invite a click or\n land in a text selection. */\n -webkit-user-select: none;\n user-select: none;\n\n ._label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);
1
+ (self.webpackChunkmoja_work=self.webpackChunkmoja_work||[]).push([[2831],{"./libs/ui/.storybook/demos/header/header.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{b:()=>UiInternHeaderComponent});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var header_componentngResource=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.css?ngResource"),header_componentngResource_default=__webpack_require__.n(header_componentngResource),_common_module_chunk=__webpack_require__("./node_modules/@angular/common/fesm2022/_common_module-chunk.mjs"),_effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),ui_config_types=__webpack_require__("./libs/ui/src/config/ui-config.types.ts"),layout_service=__webpack_require__("./libs/ui/src/lib/layout/_service/layout.service.ts");let UiInternHeaderComponent=class UiInternHeaderComponent{layoutService=(0,_effect_chunk2.WQX)(layout_service.u);theme=(0,core.input)(null);display=(0,core.input)(!1,{transform:core.booleanAttribute});onTop=(0,core.input)(!1,{transform:core.booleanAttribute});ngOnInit(){this.layoutService.handleTheme(this.theme(),ui_config_types.Q)}ngOnDestroy(){this.layoutService.handleTheme("theme-light",ui_config_types.Q)}setTheme(){this.layoutService.handleTheme(null,ui_config_types.Q)}static propDecorators={theme:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"theme",required:!1,transform:void 0}]}],display:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"display",required:!1,transform:void 0}]}],onTop:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"onTop",required:!1,transform:void 0}]}]}};UiInternHeaderComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-intern-header",template:'@if (display()) {\n <button class="ui" [class._on-top]="onTop()" (click)="setTheme()">\n switch Theme\n </button>\n}\n',encapsulation:_debug_node_chunk.gXe.Emulated,standalone:!0,imports:[_common_module_chunk.MD],styles:[header_componentngResource_default()]})],UiInternHeaderComponent)},"./libs/ui/src/config/ui-config.types.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{Q:()=>uiConfigStorybookCssPrefix,y:()=>uiConfigTypes});const uiConfigStorybookCssPrefix="ui-storybook ",uiConfigTypes={mainID:"ui-main",mainClass:"ui-main",storeName:"ui-layout"}},"./libs/ui/src/lib/atoms/placeholder/placeholder.component.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{F:()=>UiPlaceholderComponent});var tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var placeholder_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/placeholder/placeholder.component.css?ngResource"),placeholder_componentngResource_default=__webpack_require__.n(placeholder_componentngResource),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),ngneat_transloco=__webpack_require__("./node_modules/@ngneat/transloco/fesm2022/ngneat-transloco.mjs");let UiPlaceholderComponent=class UiPlaceholderComponent{label=(0,core.input)(null);static propDecorators={label:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"label",required:!1,transform:void 0}]}]}};UiPlaceholderComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-placeholder",template:"<span class=\"_label\">{{ label() ?? ('placeholder.label' | transloco) }}</span>\n",encapsulation:_debug_node_chunk.gXe.None,imports:[ngneat_transloco.Kj],styles:[placeholder_componentngResource_default()]})],UiPlaceholderComponent)},"./libs/ui/src/lib/layout/_service/layout.service.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.d(__webpack_exports__,{u:()=>UiLayoutService});var tslib__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/tslib/tslib.es6.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs"),_angular_core__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),_ngx_pwa_local_storage__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./node_modules/@ngx-pwa/local-storage/fesm2022/ngx-pwa-local-storage.mjs"),_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./libs/ui/src/config/ui-config.types.ts");let UiLayoutService=class UiLayoutService{storage=(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.WQX)(_ngx_pwa_local_storage__WEBPACK_IMPORTED_MODULE_3__.AX);settings={cssPrefix:"",theme:null,zoom:null,fullscreen:null,direction:"center",layoutSize:null};setStorage(){this.storage.set(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName,this.settings).subscribe()}handleInit(config){this.settings.cssPrefix=config.cssPrefix,this.settings.theme=config.theme,this.settings.zoom=config.zoom?"zoom":"x-zoom",this.settings.fullscreen=config.fullscreen?"fullscreen":"x-fullscreen",this.handleFullScreen(this.settings.fullscreen),this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data),this.setStorage(),this.setTheme(null)})}setTheme(theme){document.body.className=theme?`${this.settings.cssPrefix} ${theme}`:`${this.settings.cssPrefix} ${this.settings.theme}`}getTheme(){return this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data)}),this.settings.theme}getMainClass(){return`${_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.mainClass} ${this.settings.zoom} ${this.settings.fullscreen}`}handleFullScreen(init){init?this.settings.fullscreen=init:"fullscreen"===this.settings.fullscreen?this.settings.fullscreen="x-fullscreen":this.settings.fullscreen="fullscreen",this.setStorage()}handleZoom(init){init?this.settings.zoom=init:"zoom"===this.settings.zoom?this.settings.zoom="x-zoom":this.settings.zoom="zoom",this.setStorage()}handleTheme(theme,prefix){return prefix&&(this.settings.cssPrefix=prefix),theme?(this.setTheme(theme),this.settings.theme=theme):(this.settings.theme="theme-light"===this.settings.theme?"theme-dark":"theme-light",this.setTheme(null)),this.setStorage(),this.settings.theme}handleDirection(type){this.settings.direction=type,this.setStorage()}setLayoutSize(sizes){this.settings.layoutSize=sizes,this.storage.set(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName,this.settings).subscribe()}getLayoutSize(){return this.storage.get(_config_ui_config_types__WEBPACK_IMPORTED_MODULE_4__.y.storeName).subscribe(data=>{data&&(this.settings=data)}),this.settings.layoutSize}};UiLayoutService=(0,tslib__WEBPACK_IMPORTED_MODULE_0__.Cg)([(0,_angular_core__WEBPACK_IMPORTED_MODULE_1__._qm)({providedIn:"root"})],UiLayoutService)},"./libs/ui/src/lib/atoms/mosaic/mosaic.component.stories.ts"(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{Colors:()=>Colors,Images:()=>Images,OverImage:()=>OverImage,OverText:()=>OverText,__namedExportsOrder:()=>__namedExportsOrder,default:()=>mosaic_component_stories});var _effect_chunk2=__webpack_require__("./node_modules/@angular/core/fesm2022/_effect-chunk2.mjs"),dist=__webpack_require__("./node_modules/@storybook/angular/dist/index.js"),header_component=__webpack_require__("./libs/ui/.storybook/demos/header/header.component.ts"),placeholder_component=__webpack_require__("./libs/ui/src/lib/atoms/placeholder/placeholder.component.ts"),tslib_es6=__webpack_require__("./node_modules/tslib/tslib.es6.mjs");var mosaic_componentngResource=__webpack_require__("./libs/ui/src/lib/atoms/mosaic/mosaic.component.css?ngResource"),mosaic_componentngResource_default=__webpack_require__.n(mosaic_componentngResource),mosaic_animationsngResource=__webpack_require__("./libs/ui/src/lib/atoms/mosaic/mosaic.animations.css?ngResource"),mosaic_animationsngResource_default=__webpack_require__.n(mosaic_animationsngResource),core=__webpack_require__("./node_modules/@angular/core/fesm2022/core.mjs"),_resource_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_resource-chunk.mjs"),_debug_node_chunk=__webpack_require__("./node_modules/@angular/core/fesm2022/_debug_node-chunk.mjs");const ANIMATION_CLASS={infinity:"_-grow",pulse:"_-pulse",flip:"_-flip",fade:"_-fade",wave:"_-wave"};let UiMosaicComponent=class UiMosaicComponent{images=(0,core.input)(null);colors=(0,core.input)(null);mainImage=(0,core.input)(null);mainColor=(0,core.input)(null);mode=(0,core.input)("image");tileMinWidth=(0,core.input)(120);fallDelay=(0,core.input)(200);fallDuration=(0,core.input)(1200);animationType=(0,core.input)("falldown");border=(0,core.input)(!1,{transform:core.booleanAttribute});hostSize=(0,_effect_chunk2.vPA)({width:0,height:0});fallen=(0,_effect_chunk2.vPA)(new Set);animating=(0,_effect_chunk2.vPA)(new Set);animationClass=(0,_resource_chunk.EW)(()=>ANIMATION_CLASS[this.animationType()]??null);loadedImages=(0,_effect_chunk2.vPA)(0);onImageSettled(){this.loadedImages.update(count=>count+1)}allTilesSettled=(0,_resource_chunk.EW)(()=>{const tileCount=this.tiles().length;return 0!==tileCount&&("color"===this.mode()||this.loadedImages()>=tileCount)});cols=(0,_resource_chunk.EW)(()=>{const tileWidth=Math.max(1,this.tileMinWidth());return Math.max(1,Math.floor(this.hostSize().width/tileWidth))});tiles=(0,_resource_chunk.EW)(()=>{const source="color"===this.mode()?this.colors():this.images(),{width,height}=this.hostSize();if(!source?.length||width<=0||height<=0)return[];const cols=this.cols(),tileHeight=width/cols*(3/4),rows=Math.max(1,Math.ceil(height/tileHeight));return Array.from({length:cols*rows},(_,index)=>source[index%source.length])});tileImage(tile){return"string"==typeof tile?null:tile}tileColor(tile){return"string"==typeof tile?tile:null}constructor(){const host=(0,_effect_chunk2.WQX)(_debug_node_chunk.aKT).nativeElement,observer=new ResizeObserver(entries=>{const box=entries[0]?.contentRect;box&&this.hostSize.set({width:box.width,height:box.height})});observer.observe(host),(0,_effect_chunk2.WQX)(_effect_chunk2.abz).onDestroy(()=>observer.disconnect()),(0,_effect_chunk2.QZP)(onCleanup=>{const tileCount=this.tiles().length,cols=this.cols(),delay=this.fallDelay(),duration=this.fallDuration(),animationType=this.animationType(),ready=this.allTilesSettled();if((0,_resource_chunk.O8)(()=>{this.fallen.set(new Set),this.animating.set(new Set)}),0===tileCount||delay<=0||!ready)return;const timers=new Set,schedule=(handler,ms)=>{const timer=setTimeout(()=>{timers.delete(timer),handler()},ms);timers.add(timer)};if(onCleanup(()=>timers.forEach(timer=>clearTimeout(timer))),"falldown"!==animationType){const waveOrder="wave"===animationType?function diagonalOrder(tileCount,cols){return Array.from({length:tileCount},(_,index)=>index).sort((a,b)=>Math.floor(a/cols)+a%cols-(Math.floor(b/cols)+b%cols)||a%cols-b%cols)}(tileCount,cols):null;let pointer=0;const tick=()=>{const pick=waveOrder?waveOrder[pointer++%waveOrder.length]:Math.floor(Math.random()*tileCount);(0,_resource_chunk.O8)(this.animating).has(pick)||(this.animating.update(animating=>new Set(animating).add(pick)),schedule(()=>{this.animating.update(animating=>{const next=new Set(animating);return next.delete(pick),next})},duration)),schedule(tick,delay)};return void schedule(tick,1e3)}const order=function shuffle(values){for(let i=values.length-1;i>0;i--){const j=Math.floor(Math.random()*(i+1));[values[i],values[j]]=[values[j],values[i]]}return values}(Array.from({length:tileCount},(_,index)=>index)),tick=()=>{const next=order.shift();void 0!==next&&(this.fallen.update(fallen=>new Set(fallen).add(next)),schedule(tick,delay))};schedule(tick,1e3)})}static ctorParameters=()=>[];static propDecorators={images:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"images",required:!1,transform:void 0}]}],colors:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"colors",required:!1,transform:void 0}]}],mainImage:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"mainImage",required:!1,transform:void 0}]}],mainColor:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"mainColor",required:!1,transform:void 0}]}],mode:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"mode",required:!1,transform:void 0}]}],tileMinWidth:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"tileMinWidth",required:!1,transform:void 0}]}],fallDelay:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"fallDelay",required:!1,transform:void 0}]}],fallDuration:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"fallDuration",required:!1,transform:void 0}]}],animationType:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"animationType",required:!1,transform:void 0}]}],border:[{type:_debug_node_chunk.pde,args:[{isSignal:!0,alias:"border",required:!1,transform:void 0}]}]}};UiMosaicComponent=(0,tslib_es6.Cg)([(0,_debug_node_chunk.uAl)({selector:"ui-mosaic",template:'@if (mode() === \'color\') {\n @if (mainColor(); as color) {\n <div class="_main-color" [style.background-color]="color"></div>\n }\n} @else if (mainImage(); as image) {\n <div\n class="_main-image"\n role="img"\n [attr.aria-label]="image.alt"\n [style.background-image]="\'url(\' + image.src + \')\'"\n ></div>\n}\n<div\n class="_grid"\n [style.grid-template-columns]="\'repeat(\' + cols() + \', 1fr)\'"\n>\n @for (tile of tiles(); track $index) {\n <div\n class="_tile"\n [class._-fallen]="fallen().has($index)"\n [class]="\n animationClass() && animating().has($index) ? animationClass() : \'\'\n "\n [style.background-color]="tileColor(tile)"\n >\n @if (tileImage(tile); as image) {\n <img\n [src]="image.src"\n [alt]="image.alt"\n decoding="async"\n (load)="onImageSettled()"\n (error)="onImageSettled()"\n />\n }\n </div>\n }\n</div>\n',encapsulation:_debug_node_chunk.gXe.Emulated,host:{"[style.--ui-mosaic-fall.ms]":"fallDuration()","[class._-border]":"border()"},styles:[mosaic_componentngResource_default(),mosaic_animationsngResource_default()]}),(0,tslib_es6.Sn)("design:paramtypes",[])],UiMosaicComponent);const mosaic_component_stories={title:"Atoms/Mosaic",component:UiMosaicComponent,decorators:[(0,dist.Iz)({imports:[header_component.b,placeholder_component.F,UiMosaicComponent]})],argTypes:{animationType:{control:"radio",options:["falldown","infinity","pulse","flip","fade","wave"]},mode:{control:"radio",options:["image","color"]},mainColor:{control:"color"},tileMinWidth:{control:{type:"range",min:8,max:400,step:2}},fallDelay:{control:{type:"range",min:0,max:1e3,step:5}},fallDuration:{control:{type:"range",min:0,max:3e3,step:50}},border:{control:"boolean"},images:{control:"object"},colors:{control:"object"},mainImage:{control:"object"}},args:{animationType:"falldown",border:!1,mode:"image",colors:["#ff00ff","#00e5ff","#ffe000","#7c4dff","#00c853","#ff3d00"],mainColor:"#101014",tileMinWidth:120,fallDelay:200,fallDuration:1200,images:function uiMosaicMock(){return Array.from({length:120},()=>{const number=String(Math.floor(25*Math.random())+1).padStart(2,"0");return{src:`https://moja.work/content/_assets/pictures/numbers/25/numbers-0${number}.png`,alt:`number-${number}`}})}(),mainImage:{src:"https://moja.work/content/_assets/pictures/numbers/50/numbers-007.png",alt:"number-07"}},parameters:{docs:{canvas:{sourceState:"none"}}}},mosaic=hostClass=>`\n <ui-mosaic\n class="${hostClass}"\n [mode]="mode"\n [images]="images"\n [colors]="colors"\n [mainImage]="mainImage"\n [mainColor]="mainColor"\n [tileMinWidth]="tileMinWidth"\n [fallDelay]="fallDelay"\n [fallDuration]="fallDuration"\n [animationType]="animationType"\n [border]="border"\n ></ui-mosaic>`,replayProps=()=>{const shown=(0,_effect_chunk2.vPA)(!0);return{shown,replay:()=>{shown.set(!1),setTimeout(()=>shown.set(!0),60)}}},replayButton='\n <button class="ui fixed bottom-4 left-4 z-20" type="button" (click)="replay()">replay</button>',Images={render:args=>({props:{...args,...replayProps()},template:`\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col">\n @if (shown()) { ${mosaic("fixed inset-0 -z-10")} }\n ${replayButton}\n </section>`})},Colors={args:{mode:"color",images:[]},render:args=>({props:{...args,...replayProps()},template:`\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col">\n @if (shown()) { ${mosaic("fixed inset-0 -z-10")} }\n ${replayButton}\n </section>`})},OverText={args:{mode:"color",images:[],mainImage:null,mainColor:null,tileMinWidth:48,fallDelay:40},render:args=>({props:{...args,...replayProps()},template:`\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative m-4 w-full max-w-2xl">\n <ui-placeholder class="block h-64 w-full"></ui-placeholder>\n @if (shown()) { ${mosaic("absolute inset-0 z-10")} }\n </section>\n ${replayButton}`})},OverImage={args:{mode:"color",images:[],mainImage:null,mainColor:null,tileMinWidth:48,fallDelay:40},render:args=>({props:{...args,...replayProps()},template:`\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative m-4 h-96 w-[36rem]">\n <img\n class="h-full w-full object-cover"\n src="https://moja.work/content/_assets/pictures/numbers/50/numbers-007.png"\n alt="number-07"\n />\n @if (shown()) { ${mosaic("absolute inset-0 z-10")} }\n </section>\n ${replayButton}`})},__namedExportsOrder=["Images","Colors","OverText","OverImage"];Images.parameters={...Images.parameters,docs:{...Images.parameters?.docs,source:{originalSource:'{\n render: args => ({\n props: {\n ...args,\n ...replayProps()\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative flex flex-col">\n @if (shown()) { ${mosaic(\'fixed inset-0 -z-10\')} }\n ${replayButton}\n </section>`\n })\n}',...Images.parameters?.docs?.source},description:{story:"Pinned behind the page, which is what the component used to do on its own.\nThe three declarations that were burned into `:host` now sit on the tag,\nwhere a consumer can see and change them.",...Images.parameters?.docs?.description}}},Colors.parameters={...Colors.parameters,docs:{...Colors.parameters?.docs,source:{originalSource:"{\n args: {\n mode: 'color',\n // Empty on purpose: this story is about the colors, and a control still\n // holding 120 images would suggest they are part of the example.\n images: []\n },\n render: args => ({\n props: {\n ...args,\n ...replayProps()\n },\n template: `\n <ui-intern-header theme=\"theme-light\"></ui-intern-header>\n <section class=\"relative flex flex-col\">\n @if (shown()) { ${mosaic('fixed inset-0 -z-10')} }\n ${replayButton}\n </section>`\n })\n}",...Colors.parameters?.docs?.source},description:{story:"The same host, filled with plain colors instead of images.",...Colors.parameters?.docs?.description}}},OverText.parameters={...OverText.parameters,docs:{...OverText.parameters?.docs,source:{originalSource:'{\n args: {\n mode: \'color\',\n images: [],\n mainImage: null,\n mainColor: null,\n tileMinWidth: 48,\n fallDelay: 40\n },\n render: args => ({\n props: {\n ...args,\n ...replayProps()\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative m-4 w-full max-w-2xl">\n <ui-placeholder class="block h-64 w-full"></ui-placeholder>\n @if (shown()) { ${mosaic(\'absolute inset-0 z-10\')} }\n </section>\n ${replayButton}`\n })\n}',...OverText.parameters?.docs?.source},description:{story:"Not a background at all: the same tag inside a `relative` box, stacked ON\nTOP of what it covers. Both backdrops are empty here on purpose — what the\nfalling tiles reveal is the content underneath, not a picture the mosaic\nbrought along.",...OverText.parameters?.docs?.description}}},OverImage.parameters={...OverImage.parameters,docs:{...OverImage.parameters?.docs,source:{originalSource:'{\n args: {\n mode: \'color\',\n images: [],\n mainImage: null,\n mainColor: null,\n tileMinWidth: 48,\n fallDelay: 40\n },\n render: args => ({\n props: {\n ...args,\n ...replayProps()\n },\n template: `\n <ui-intern-header theme="theme-light"></ui-intern-header>\n <section class="relative m-4 h-96 w-[36rem]">\n <img\n class="h-full w-full object-cover"\n src="https://moja.work/content/_assets/pictures/numbers/50/numbers-007.png"\n alt="number-07"\n />\n @if (shown()) { ${mosaic(\'absolute inset-0 z-10\')} }\n </section>\n ${replayButton}`\n })\n}',...OverImage.parameters?.docs?.source},description:{story:"The same again over a picture — the host is the only difference.",...OverImage.parameters?.docs?.description}}}},"./libs/ui/.storybook/demos/header/header.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"/* The intern header is reduced to just the theme switch button, pinned to the */\n/* bottom-left corner of the Storybook canvas. */\nbutton {\n position: fixed;\n bottom: calc(var(--ui-spacer) * 0.5);\n left: calc(var(--ui-spacer) * 0.5);\n z-index: 1000;\n\n &._on-top {\n z-index: 10000;\n }\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()},"./libs/ui/src/lib/atoms/mosaic/mosaic.animations.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n/* Animations of the background grid, separated from the layout styles.\n Each endless mode applies its modifier class to a picked tile and removes\n it after the animation finished (timer-driven), so tiles can replay. */\n\n/* infinity: a randomly picked tile pops from tiny to its full size. */\n._tile._-grow {\n animation: ui-mosaic-grow var(--ui-mosaic-fall, 1200ms)\n ease-out;\n}\n\n@keyframes ui-mosaic-grow {\n from {\n transform: scale(0);\n }\n\n to {\n transform: scale(1);\n }\n}\n\n/* pulse: a randomly picked tile takes a soft breath. */\n._tile._-pulse {\n animation: ui-mosaic-pulse var(--ui-mosaic-fall, 1200ms)\n ease-in-out;\n}\n\n@keyframes ui-mosaic-pulse {\n 0%,\n 100% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(1.12);\n }\n}\n\n/* flip: a randomly picked tile turns once around its Y axis. */\n._tile._-flip {\n animation: ui-mosaic-flip var(--ui-mosaic-fall, 1200ms)\n ease-in-out;\n}\n\n@keyframes ui-mosaic-flip {\n from {\n transform: perspective(60rem) rotateY(0deg);\n }\n\n to {\n transform: perspective(60rem) rotateY(360deg);\n }\n}\n\n/* fade: a randomly picked tile blinks out and back in. */\n._tile._-fade {\n animation: ui-mosaic-fade var(--ui-mosaic-fall, 1200ms)\n ease-in-out;\n}\n\n@keyframes ui-mosaic-fade {\n 0%,\n 100% {\n opacity: 1;\n }\n\n 50% {\n opacity: 0;\n }\n}\n\n/* wave: tiles lift briefly while a diagonal sweep crosses the grid. */\n._tile._-wave {\n animation: ui-mosaic-wave var(--ui-mosaic-fall, 1200ms)\n ease-in-out;\n}\n\n@keyframes ui-mosaic-wave {\n 0%,\n 100% {\n transform: translateY(0) scale(1);\n }\n\n 50% {\n transform: translateY(-8%) scale(1.06);\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()},"./libs/ui/src/lib/atoms/mosaic/mosaic.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n:host {\n /* No position, no z-index, no size: WHERE the mosaic sits — pinned behind\n the page, inside a box, over a picture — is the caller's decision, and so\n is how big it is. It fills the box it is given and brings nothing else.\n Given no box, it renders nothing; that is a wiring mistake, not a fault\n of the component. `pointer-events: none` stays: it is decoration, and\n decoration never takes a click away from what it lies on. */\n display: block;\n overflow: hidden;\n pointer-events: none;\n}\n\n._grid {\n /* Positioned so it paints ABOVE the absolutely positioned backdrop —\n unpositioned flow content would be covered by it regardless of DOM\n order. */\n position: relative;\n display: grid;\n width: 100%;\n height: 100%;\n}\n\n/* The backdrop behind the tiles — an image in `image` mode, a plain color in\n `color` mode. Both fill the host; what the falling tiles reveal is whichever\n one is present (and the page itself when neither is). */\n._main-image,\n._main-color {\n position: absolute;\n inset: 0;\n}\n\n._main-image {\n background-size: cover;\n background-position: center center;\n}\n\n/* In `color` mode the tile IS the surface — the color is bound straight onto\n this element, so a colored tile needs no child at all and falls, flips and\n pulses exactly like an image tile. */\n._tile {\n aspect-ratio: 4 / 3;\n overflow: hidden;\n transform-origin: center center;\n}\n\n/* Optional tile border (border input). */\n:host(._-border) ._tile {\n box-sizing: border-box;\n border: var(--ui-border-width) solid var(--ui-c-secondary);\n}\n\n/* A fallen tile: shrunk to nothing around its center, fully transparent —\n it stays gone and reveals the main image behind the grid. The transition\n lives ONLY on the fallen state: shrinking animates, reappearing (state\n resets, infinity rounds) snaps instantly — tiles never grow into view. */\n._tile._-fallen {\n transform: scale(0);\n opacity: 0;\n transition:\n transform var(--ui-mosaic-fall, 1200ms) ease-in,\n opacity var(--ui-mosaic-fall, 1200ms) ease-in;\n}\n\n._tile img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n object-position: center center;\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()},"./libs/ui/src/lib/atoms/placeholder/placeholder.component.css?ngResource"(module,__unused_webpack_exports,__webpack_require__){var ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/noSourceMaps.js"),___CSS_LOADER_EXPORT___=__webpack_require__("./node_modules/css-loader/dist/runtime/api.js")(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);___CSS_LOADER_EXPORT___.push([module.id,"@layer ui.base, ui.components;\n@layer ui.components {\n/* Encapsulation.None — one nested block anchored on the tag, so the rules\n cannot leak while the host itself stays styleable from outside. */\nui-placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n\n /* A floor, not a size: width and height come from wherever it is used.\n Without one an empty stand-in collapses to a text line and stops being\n the mass it exists to be. The floor is a named hook with a fallback, so a\n consumer who deliberately wants a smaller stand-in can set\n `--ui-placeholder-min-width` / `--ui-placeholder-min-height` without a\n cascade fight — an unlayered host rule otherwise beats a width utility in\n `@layer utilities` (tickets#241, tickets#251, tickets#253). */\n min-width: var(--ui-placeholder-min-width, calc(var(--ui-spacer) * 3));\n min-height: var(--ui-placeholder-min-height, calc(var(--ui-spacer) * 3));\n padding: calc(var(--ui-spacer) * 0.25);\n\n /* The overlay header's pair: filled enough to read as chrome rather than\n content, and theme-aware through the tokens. */\n background-color: var(--ui-c-primary);\n color: var(--ui-c-default);\n border: var(--ui-border-width) solid var(--ui-c-fourthly);\n border-radius: var(--ui-border-radius);\n\n /* It is scenery, never the subject: nothing here should invite a click or\n land in a text selection. */\n -webkit-user-select: none;\n user-select: none;\n\n ._label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n}\n}\n",""]),module.exports=___CSS_LOADER_EXPORT___.toString()}}]);