@mhmo91/schmancy 0.10.16 → 0.10.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/active-host-BP0zy_Y9.js.map +1 -1
- package/dist/agent/flow-CvG1fLW5.js.map +1 -1
- package/dist/agent/schmancy.agent.js +3704 -3704
- package/dist/agent/schmancy.agent.js.map +1 -1
- package/dist/agent/vendor-material-color-DcL7ZPxx.js.map +1 -1
- package/dist/animation-DCznELuT.js.map +1 -1
- package/dist/area-ChxsDTu_.js.map +1 -1
- package/dist/area-Qt6yUnuA.cjs.map +1 -1
- package/dist/audio-DS43uoRA.js.map +1 -1
- package/dist/autocomplete-CXvUjMD-.js.map +1 -1
- package/dist/autocomplete-Ck2zbdF9.cjs.map +1 -1
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.js +1 -1
- package/dist/avatar.js.map +1 -1
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/boat-Bj0wVcZi.js.map +1 -1
- package/dist/breadcrumb.js.map +1 -1
- package/dist/busy-CyZSBnZP.js.map +1 -1
- package/dist/button.js.map +1 -1
- package/dist/card-nYZCKmOO.js.map +1 -1
- package/dist/checkbox-DiUrZiyc.js.map +1 -1
- package/dist/chips-CfPFXv7Z.js.map +1 -1
- package/dist/chips-DK6m-VCM.cjs.map +1 -1
- package/dist/connectivity.js.map +1 -1
- package/dist/content-drawer.cjs +1 -1
- package/dist/content-drawer.js +1 -1
- package/dist/cursor-glow-Cs2XLDB9.js.map +1 -1
- package/dist/date-range-DA6anfcF.cjs.map +1 -1
- package/dist/date-range-DjlF2u7o.js.map +1 -1
- package/dist/date-range-inline-BfYK795W.cjs.map +1 -1
- package/dist/date-range-inline-n7y_H6PJ.js.map +1 -1
- package/dist/delay.js.map +1 -1
- package/dist/details-BdAVsLl-.cjs.map +1 -1
- package/dist/details-CS_ToAOj.js.map +1 -1
- package/dist/directives.cjs.map +1 -1
- package/dist/directives.js.map +1 -1
- package/dist/discovery.js.map +1 -1
- package/dist/divider-COLK0RbT.js.map +1 -1
- package/dist/dropdown.js.map +1 -1
- package/dist/expand-D9LzmpoV.js.map +1 -1
- package/dist/expand-r2sATPUJ.cjs.map +1 -1
- package/dist/{form-DhjedCWm.js → form-D1iJOLVb.js} +9 -0
- package/dist/{form-DhjedCWm.js.map → form-D1iJOLVb.js.map} +1 -1
- package/dist/form-D9K1GhlP.cjs +42 -0
- package/dist/{form-g5c70rac.cjs.map → form-D9K1GhlP.cjs.map} +1 -1
- package/dist/form.cjs +1 -1
- package/dist/form.js +9 -2
- package/dist/handover/agent-runtime-followups.md +1 -1
- package/dist/handover/agent-runtime-v1.md +3 -3
- package/dist/hashContent-dJrI-9sc.js.map +1 -1
- package/dist/{icons-1HIENBco.cjs.map → icons-BXp4vbnW.cjs.map} +1 -1
- package/dist/{icons-3y0kr1aB.js.map → icons-COrlmBPB.js.map} +1 -1
- package/dist/icons.cjs +1 -1
- package/dist/icons.js +1 -1
- package/dist/{iframe-CjqYuZG5.cjs.map → iframe-BwXj6mLp.cjs.map} +1 -1
- package/dist/{iframe-Z5gTK-gd.js.map → iframe-CPNsIy7k.js.map} +1 -1
- package/dist/iframe.cjs +1 -1
- package/dist/iframe.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +32 -32
- package/dist/{input-BtcIhu0Q.cjs.map → input-BGrF2qVq.cjs.map} +1 -1
- package/dist/{input-B-fw6f_r.js.map → input-C1SnMNuQ.js.map} +1 -1
- package/dist/input-chip-CtQ0pH5b.js.map +1 -1
- package/dist/input-chip-DZktYohr.cjs.map +1 -1
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/json.cjs +1 -1
- package/dist/json.js +1 -1
- package/dist/json.js.map +1 -1
- package/dist/kbd.js.map +1 -1
- package/dist/layout-BH28sKGc.js.map +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/lazy-D-bO2r4m.js.map +1 -1
- package/dist/{lightbox-BL3LWp-P.js.map → lightbox-CLwpaiai.js.map} +1 -1
- package/dist/{lightbox-BHTZOn8K.cjs.map → lightbox-Ck6BpN5u.cjs.map} +1 -1
- package/dist/lightbox.cjs +1 -1
- package/dist/lightbox.js +1 -1
- package/dist/{list-DLJL1JQj.js.map → list-Bmce1Rb8.js.map} +1 -1
- package/dist/{list-CHYa5VGY.cjs.map → list-EmRwSpTU.cjs.map} +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/magnetic-DxvoEz8_.js.map +1 -1
- package/dist/{menu-BNq93w6X.js.map → menu-BA_B7QOG.js.map} +1 -1
- package/dist/{menu-DAikvkeV.cjs.map → menu-BTU3wGP6.cjs.map} +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/mixins-BOOu6q2n.cjs.map +1 -1
- package/dist/mixins-BWb9_e1s.js.map +1 -1
- package/dist/nav-drawer.cjs +1 -1
- package/dist/nav-drawer.js +1 -1
- package/dist/navigation-bar.cjs +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/navigation-rail.js.map +1 -1
- package/dist/{notification-Dy2azMyt.cjs → notification-CliGbcfU.cjs} +1 -1
- package/dist/{notification-Dy2azMyt.cjs.map → notification-CliGbcfU.cjs.map} +1 -1
- package/dist/{notification-CUmb9c3Y.js → notification-R2_Mf1HR.js} +1 -1
- package/dist/{notification-CUmb9c3Y.js.map → notification-R2_Mf1HR.js.map} +1 -1
- package/dist/notification.cjs +1 -1
- package/dist/notification.js +1 -1
- package/dist/{option-DFvQ551b.js.map → option-DU1X4SDu.js.map} +1 -1
- package/dist/{option-CDgIKifG.cjs.map → option-Db98Ndzv.cjs.map} +1 -1
- package/dist/option.cjs +1 -1
- package/dist/option.js +1 -1
- package/dist/overlay-stack-BR4iYivO.js.map +1 -1
- package/dist/overlay.cjs.map +1 -1
- package/dist/overlay.confirm-body-uFp-0Zfh.js.map +1 -1
- package/dist/overlay.js.map +1 -1
- package/dist/overlay.service-1YWfUD2S.cjs.map +1 -1
- package/dist/overlay.service-BcF12kGb.js.map +1 -1
- package/dist/page.cjs +1 -1
- package/dist/page.js +1 -1
- package/dist/page.js.map +1 -1
- package/dist/{progress-bLbGRuQ1.js.map → progress-C9Y2D5cm.js.map} +1 -1
- package/dist/{progress-C02sWkmE.cjs.map → progress-DiVTGAXa.cjs.map} +1 -1
- package/dist/progress.cjs +1 -1
- package/dist/progress.js +1 -1
- package/dist/{radio-group-DA4eIGCj.js.map → radio-group-CAzjBI2n.js.map} +1 -1
- package/dist/{radio-group-BA-jRct5.cjs.map → radio-group-DIRJyYv6.cjs.map} +1 -1
- package/dist/radio-group.cjs +1 -1
- package/dist/radio-group.js +1 -1
- package/dist/range.js.map +1 -1
- package/dist/reduced-motion-D7LqTUMn.js.map +1 -1
- package/dist/{rxjs-utils-kWPShgKu.cjs.map → rxjs-utils-BKB2UM_j.cjs.map} +1 -1
- package/dist/{rxjs-utils-D9U4MW0Q.js.map → rxjs-utils-Dv9T9IpA.js.map} +1 -1
- package/dist/rxjs-utils.cjs +1 -1
- package/dist/rxjs-utils.js +1 -1
- package/dist/{scroll-CG5up5oy.js.map → scroll-BFHUtZOa.js.map} +1 -1
- package/dist/{scroll-D8vBF_gY.cjs.map → scroll-nIZyoEMt.cjs.map} +1 -1
- package/dist/search-MvIBA93K.js.map +1 -1
- package/dist/{select-BrK1BJoU.js → select-7WqaUWBU.js} +1 -1
- package/dist/{select-BrK1BJoU.js.map → select-7WqaUWBU.js.map} +1 -1
- package/dist/{select-Dh2j7Qc-.cjs → select-DTuf6p6T.cjs} +1 -1
- package/dist/{select-Dh2j7Qc-.cjs.map → select-DTuf6p6T.cjs.map} +1 -1
- package/dist/select.cjs +1 -1
- package/dist/select.js +1 -1
- package/dist/skeleton.js.map +1 -1
- package/dist/skills/SKILL.md +3 -0
- package/dist/skills/schmancy/SKILL.md +3 -0
- package/dist/slider.js.map +1 -1
- package/dist/sound.service-BIN2W7Rv.js.map +1 -1
- package/dist/splash-screen-BcjjJSlK.js.map +1 -1
- package/dist/{src-B2-CU8fu.cjs → src-BbMJeLk9.cjs} +1 -1
- package/dist/{src-B2-CU8fu.cjs.map → src-BbMJeLk9.cjs.map} +1 -1
- package/dist/{src-DvywUq7l.js → src-DCu_mEk4.js} +18 -18
- package/dist/{src-DvywUq7l.js.map → src-DCu_mEk4.js.map} +1 -1
- package/dist/state-avic94Ft.cjs.map +1 -1
- package/dist/state-nm8yzMPp.js.map +1 -1
- package/dist/steps.js.map +1 -1
- package/dist/surface-BtMMHKol.js.map +1 -1
- package/dist/switch.js.map +1 -1
- package/dist/table.js.map +1 -1
- package/dist/{tabs-CikPr7by.js.map → tabs-81ADWQqa.js.map} +1 -1
- package/dist/{tabs-CitVls3_.cjs.map → tabs-DnG3K0bu.cjs.map} +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/teleport.cjs +1 -1
- package/dist/teleport.js +1 -1
- package/dist/{textarea-DVkwQSis.js.map → textarea-3mWewuAf.js.map} +1 -1
- package/dist/{textarea-CqV1wvmB.cjs.map → textarea-BenjiTXB.cjs.map} +1 -1
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{theme-BIWS4TOW.js → theme-CFPJW933.js} +1 -1
- package/dist/{theme-BIWS4TOW.js.map → theme-CFPJW933.js.map} +1 -1
- package/dist/{theme-DMgjiKda.cjs → theme-DNymrucy.cjs} +1 -1
- package/dist/{theme-DMgjiKda.cjs.map → theme-DNymrucy.cjs.map} +1 -1
- package/dist/theme-button-DC_shZ_7.js.map +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/{theme.interface-C8OHheXg.js.map → theme.interface-C2XNgsLB.js.map} +1 -1
- package/dist/{theme.interface-CYo4UpWK.cjs.map → theme.interface-D4NeufQA.cjs.map} +1 -1
- package/dist/theme.js +2 -2
- package/dist/theme.service-BOWIT_5k.js.map +1 -1
- package/dist/tooltip.js.map +1 -1
- package/dist/tree.js.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/typewriter.cjs.map +1 -1
- package/dist/typewriter.js.map +1 -1
- package/dist/typography.js.map +1 -1
- package/dist/utils-Cj_nRRyx.js.map +1 -1
- package/dist/visually-hidden.js.map +1 -1
- package/dist/window-BTecgE_U.js.map +1 -1
- package/package.json +1 -1
- package/skills/schmancy/SKILL.md +3 -0
- package/src/form/fields/index.ts +9 -0
- package/src/form/index.ts +1 -0
- package/types/src/form/fields/index.d.ts +9 -0
- package/types/src/form/index.d.ts +1 -0
- package/dist/form-g5c70rac.cjs +0 -42
- /package/dist/{icons-1HIENBco.cjs → icons-BXp4vbnW.cjs} +0 -0
- /package/dist/{icons-3y0kr1aB.js → icons-COrlmBPB.js} +0 -0
- /package/dist/{iframe-CjqYuZG5.cjs → iframe-BwXj6mLp.cjs} +0 -0
- /package/dist/{iframe-Z5gTK-gd.js → iframe-CPNsIy7k.js} +0 -0
- /package/dist/{input-BtcIhu0Q.cjs → input-BGrF2qVq.cjs} +0 -0
- /package/dist/{input-B-fw6f_r.js → input-C1SnMNuQ.js} +0 -0
- /package/dist/{lightbox-BL3LWp-P.js → lightbox-CLwpaiai.js} +0 -0
- /package/dist/{lightbox-BHTZOn8K.cjs → lightbox-Ck6BpN5u.cjs} +0 -0
- /package/dist/{list-DLJL1JQj.js → list-Bmce1Rb8.js} +0 -0
- /package/dist/{list-CHYa5VGY.cjs → list-EmRwSpTU.cjs} +0 -0
- /package/dist/{menu-BNq93w6X.js → menu-BA_B7QOG.js} +0 -0
- /package/dist/{menu-DAikvkeV.cjs → menu-BTU3wGP6.cjs} +0 -0
- /package/dist/{option-DFvQ551b.js → option-DU1X4SDu.js} +0 -0
- /package/dist/{option-CDgIKifG.cjs → option-Db98Ndzv.cjs} +0 -0
- /package/dist/{progress-bLbGRuQ1.js → progress-C9Y2D5cm.js} +0 -0
- /package/dist/{progress-C02sWkmE.cjs → progress-DiVTGAXa.cjs} +0 -0
- /package/dist/{radio-group-DA4eIGCj.js → radio-group-CAzjBI2n.js} +0 -0
- /package/dist/{radio-group-BA-jRct5.cjs → radio-group-DIRJyYv6.cjs} +0 -0
- /package/dist/{rxjs-utils-kWPShgKu.cjs → rxjs-utils-BKB2UM_j.cjs} +0 -0
- /package/dist/{rxjs-utils-D9U4MW0Q.js → rxjs-utils-Dv9T9IpA.js} +0 -0
- /package/dist/{scroll-CG5up5oy.js → scroll-BFHUtZOa.js} +0 -0
- /package/dist/{scroll-D8vBF_gY.cjs → scroll-nIZyoEMt.cjs} +0 -0
- /package/dist/{tabs-CikPr7by.js → tabs-81ADWQqa.js} +0 -0
- /package/dist/{tabs-CitVls3_.cjs → tabs-DnG3K0bu.cjs} +0 -0
- /package/dist/{textarea-DVkwQSis.js → textarea-3mWewuAf.js} +0 -0
- /package/dist/{textarea-CqV1wvmB.cjs → textarea-BenjiTXB.cjs} +0 -0
- /package/dist/{theme.interface-C8OHheXg.js → theme.interface-C2XNgsLB.js} +0 -0
- /package/dist/{theme.interface-CYo4UpWK.cjs → theme.interface-D4NeufQA.cjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-button-DC_shZ_7.js","names":[],"sources":["../src/theme-button/theme-button.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\n\n@customElement('schmancy-theme-button')\nexport default class SchmancyThemeButton extends SchmancyElement {\n\t@query('#color') color!: HTMLElement\n\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-button\n\t\t\t\t@click=${() => {\n\t\t\t\t\t// Trigger any other effects you have\n\t\t\t\t\t// $newSchmancyTheme.next(undefined)\n\n\t\t\t\t\t// Native Web Animations API usage:\n\t\t\t\t\tthis.color.animate([{ transform: 'rotate(0deg)' }, { transform: 'rotate(360deg)' }], {\n\t\t\t\t\t\tduration: 300,\n\t\t\t\t\t\t// fill: 'forwards', // Use if you want it to remain rotated at 360°\n\t\t\t\t\t\t// easing: 'ease-out', // Or another easing function\n\t\t\t\t\t})\n\t\t\t\t}}\n\t\t\t\tvariant=\"text\"\n\t\t\t>\n\t\t\t\t<schmancy-icon id=\"color\">palette</schmancy-icon>\n\t\t\t</schmancy-button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-theme-button': SchmancyThemeButton\n\t}\n}\n"],"mappings":";;;;AAKe,IAAA,IAAA,cAAkC,EAAA;CAGhD,SAAA;
|
|
1
|
+
{"version":3,"file":"theme-button-DC_shZ_7.js","names":[],"sources":["../src/theme-button/theme-button.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { html } from 'lit'\nimport { customElement, query } from 'lit/decorators.js'\n\n@customElement('schmancy-theme-button')\nexport default class SchmancyThemeButton extends SchmancyElement {\n\t@query('#color') color!: HTMLElement\n\n\tprotected render(): unknown {\n\t\treturn html`\n\t\t\t<schmancy-button\n\t\t\t\t@click=${() => {\n\t\t\t\t\t// Trigger any other effects you have\n\t\t\t\t\t// $newSchmancyTheme.next(undefined)\n\n\t\t\t\t\t// Native Web Animations API usage:\n\t\t\t\t\tthis.color.animate([{ transform: 'rotate(0deg)' }, { transform: 'rotate(360deg)' }], {\n\t\t\t\t\t\tduration: 300,\n\t\t\t\t\t\t// fill: 'forwards', // Use if you want it to remain rotated at 360°\n\t\t\t\t\t\t// easing: 'ease-out', // Or another easing function\n\t\t\t\t\t})\n\t\t\t\t}}\n\t\t\t\tvariant=\"text\"\n\t\t\t>\n\t\t\t\t<schmancy-icon id=\"color\">palette</schmancy-icon>\n\t\t\t</schmancy-button>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-theme-button': SchmancyThemeButton\n\t}\n}\n"],"mappings":";;;;AAKe,IAAA,IAAA,cAAkC,EAAA;CAGhD,SAAA;EACC,OAAO,CAAI;;;GAOR,KAAK,MAAM,QAAQ,CAAC,EAAE,WAAW,gBAAA,EAAkB,EAAE,WAAW,kBAAA,CAAA,EAAqB,EACpF,UAAU,KAAA,CAAA;IAAA;;;;;;;;GAXd,EAAM,SAAA,CAAA,EAAS,EAAA,WAAA,SAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAFhB,EAAc,wBAAA,CAAA,EAAwB,EAAA"}
|
package/dist/theme.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./mixins-BOOu6q2n.cjs`),t=require(`./theme.service-DkdH1t60.cjs`),n=require(`./theme.interface-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./mixins-BOOu6q2n.cjs`),t=require(`./theme.service-DkdH1t60.cjs`),n=require(`./theme.interface-D4NeufQA.cjs`),r=require(`./theme-DNymrucy.cjs`);exports.SchmancyGenerateMoodAudioEvent=r.n,exports.SchmancyTheme=n.t,Object.defineProperty(exports,`SchmancyThemeAudioPlayer`,{enumerable:!0,get:function(){return r.r}}),Object.defineProperty(exports,`SchmancyThemeComponent`,{enumerable:!0,get:function(){return r.a}}),Object.defineProperty(exports,`SchmancyThemeController`,{enumerable:!0,get:function(){return r.i}}),Object.defineProperty(exports,`SchmancyThemeControllerBoat`,{enumerable:!0,get:function(){return r.t}}),exports.ThemeHereIAm=t.r,exports.ThemeWhereAreYou=t.i,exports.createDarkTonalPaletteFromBaseColor=r.s,exports.createLightTonalPaletteFromBaseColor=r.c,exports.formatTheme=r.l,exports.schmancyTheme=t.t,exports.tailwindStyles=r.o,exports.theme=t.n,exports.themeContext=e.f;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.interface-C8OHheXg.js","names":[],"sources":["../src/theme/theme.interface.ts"],"sourcesContent":["/**\n * Material Design 3 Theme Definition\n * Complete theme system following Material Design 3 specifications\n * @see https://m3.material.io/foundations/customization\n *\n * @internal\n */\nconst ThemeDef = {\n\tsys: {\n\t\t// M3 Color System - Complete tonal palette support\n\t\tcolor: {\n\t\t\t// Neutral colors\n\t\t\tscrim: 'var(--schmancy-sys-color-scrim)',\n\t\t\toutline: 'var(--schmancy-sys-color-outline)',\n\t\t\toutlineVariant: 'var(--schmancy-sys-color-outlineVariant)',\n\t\t\tshadow: 'var(--schmancy-sys-color-shadow)',\n\n\t\t\t// Surface colors with complete tonal values\n\t\t\tsurface: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-surface-default)',\n\t\t\t\tdim: 'var(--schmancy-sys-color-surface-dim)',\n\t\t\t\tbright: 'var(--schmancy-sys-color-surface-bright)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-surface-container)',\n\t\t\t\tcontainerLow: 'var(--schmancy-sys-color-surface-containerLow)',\n\t\t\t\tcontainerLowest: 'var(--schmancy-sys-color-surface-containerLowest)',\n\t\t\t\tcontainerHigh: 'var(--schmancy-sys-color-surface-containerHigh)',\n\t\t\t\tcontainerHighest: 'var(--schmancy-sys-color-surface-containerHighest)',\n\t\t\t\ton: 'var(--schmancy-sys-color-surface-on)',\n\t\t\t\tonVariant: 'var(--schmancy-sys-color-surface-onVariant)',\n\t\t\t\ttint: 'var(--schmancy-sys-color-surface-tint)',\n\t\t\t\t// Inverse colors\n\t\t\t\tinverse: 'var(--schmancy-sys-color-inverse-surface)',\n\t\t\t\tinverseOn: 'var(--schmancy-sys-color-inverse-onSurface)',\n\t\t\t\t// Deprecated mappings for backward compatibility\n\t\t\t\tlow: 'var(--schmancy-sys-color-surface-containerLow)',\n\t\t\t\thigh: 'var(--schmancy-sys-color-surface-containerHigh)',\n\t\t\t\thighest: 'var(--schmancy-sys-color-surface-containerHighest)',\n\t\t\t\tlowest: 'var(--schmancy-sys-color-surface-containerLowest)',\n\t\t\t},\n\n\t\t\t// Primary color roles with fixed variants\n\t\t\tprimary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-primary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-primary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-primary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-primary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-primary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-primary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-primary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-primary-onFixedVariant)',\n\t\t\t\tinverse: 'var(--schmancy-sys-color-inverse-primary)',\n\t\t\t},\n\n\t\t\t// Secondary color roles with fixed variants\n\t\t\tsecondary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-secondary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-secondary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-secondary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-secondary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-secondary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-secondary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-secondary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-secondary-onFixedVariant)',\n\t\t\t},\n\n\t\t\t// Tertiary color roles with fixed variants\n\t\t\ttertiary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-tertiary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-tertiary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-tertiary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-tertiary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-tertiary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-tertiary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-tertiary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-tertiary-onFixedVariant)',\n\t\t\t},\n\n\t\t\t// Error color roles\n\t\t\terror: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-error-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-error-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-error-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-error-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Success\n\t\t\tsuccess: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-success-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-success-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-success-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-success-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Warning\n\t\t\twarning: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-warning-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-warning-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-warning-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-warning-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Info\n\t\t\tinfo: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-info-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-info-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-info-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-info-onContainer)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Typography System\n\t\ttypography: {\n\t\t\t// Display styles\n\t\t\tdisplay: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-display-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-display-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-display-small)',\n\t\t\t},\n\t\t\t// Headline styles\n\t\t\theadline: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-headline-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-headline-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-headline-small)',\n\t\t\t},\n\t\t\t// Title styles\n\t\t\ttitle: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-title-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-title-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-title-small)',\n\t\t\t},\n\t\t\t// Body styles\n\t\t\tbody: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-body-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-body-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-body-small)',\n\t\t\t},\n\t\t\t// Label styles\n\t\t\tlabel: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-label-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-label-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-label-small)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Shape System\n\t\tshape: {\n\t\t\tcorner: {\n\t\t\t\tnone: 'var(--schmancy-sys-shape-corner-none)',\n\t\t\t\textraSmall: 'var(--schmancy-sys-shape-corner-extraSmall)',\n\t\t\t\tsmall: 'var(--schmancy-sys-shape-corner-small)',\n\t\t\t\tmedium: 'var(--schmancy-sys-shape-corner-medium)',\n\t\t\t\tlarge: 'var(--schmancy-sys-shape-corner-large)',\n\t\t\t\textraLarge: 'var(--schmancy-sys-shape-corner-extraLarge)',\n\t\t\t\tfull: 'var(--schmancy-sys-shape-corner-full)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Elevation System with tinted shadows\n\t\televation: {\n\t\t\t0: 'var(--schmancy-sys-elevation-0)',\n\t\t\t1: 'var(--schmancy-sys-elevation-1)',\n\t\t\t2: 'var(--schmancy-sys-elevation-2)',\n\t\t\t3: 'var(--schmancy-sys-elevation-3)',\n\t\t\t4: 'var(--schmancy-sys-elevation-4)',\n\t\t\t5: 'var(--schmancy-sys-elevation-5)',\n\t\t},\n\n\t\t// M3 Motion System\n\t\tmotion: {\n\t\t\t// Easing tokens\n\t\t\teasing: {\n\t\t\t\temphasized: 'var(--schmancy-sys-motion-easing-emphasized)',\n\t\t\t\temphasizedDecelerate: 'var(--schmancy-sys-motion-easing-emphasized-decelerate)',\n\t\t\t\temphasizedAccelerate: 'var(--schmancy-sys-motion-easing-emphasized-accelerate)',\n\t\t\t\tstandard: 'var(--schmancy-sys-motion-easing-standard)',\n\t\t\t\tstandardDecelerate: 'var(--schmancy-sys-motion-easing-standard-decelerate)',\n\t\t\t\tstandardAccelerate: 'var(--schmancy-sys-motion-easing-standard-accelerate)',\n\t\t\t\tlegacy: 'var(--schmancy-sys-motion-easing-legacy)',\n\t\t\t\tlinear: 'var(--schmancy-sys-motion-easing-linear)',\n\t\t\t},\n\t\t\t// Duration tokens\n\t\t\tduration: {\n\t\t\t\tshort1: 'var(--schmancy-sys-motion-duration-short1)',\n\t\t\t\tshort2: 'var(--schmancy-sys-motion-duration-short2)',\n\t\t\t\tshort3: 'var(--schmancy-sys-motion-duration-short3)',\n\t\t\t\tshort4: 'var(--schmancy-sys-motion-duration-short4)',\n\t\t\t\tmedium1: 'var(--schmancy-sys-motion-duration-medium1)',\n\t\t\t\tmedium2: 'var(--schmancy-sys-motion-duration-medium2)',\n\t\t\t\tmedium3: 'var(--schmancy-sys-motion-duration-medium3)',\n\t\t\t\tmedium4: 'var(--schmancy-sys-motion-duration-medium4)',\n\t\t\t\tlong1: 'var(--schmancy-sys-motion-duration-long1)',\n\t\t\t\tlong2: 'var(--schmancy-sys-motion-duration-long2)',\n\t\t\t\tlong3: 'var(--schmancy-sys-motion-duration-long3)',\n\t\t\t\tlong4: 'var(--schmancy-sys-motion-duration-long4)',\n\t\t\t\textraLong1: 'var(--schmancy-sys-motion-duration-extraLong1)',\n\t\t\t\textraLong2: 'var(--schmancy-sys-motion-duration-extraLong2)',\n\t\t\t\textraLong3: 'var(--schmancy-sys-motion-duration-extraLong3)',\n\t\t\t\textraLong4: 'var(--schmancy-sys-motion-duration-extraLong4)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 State Layers\n\t\tstate: {\n\t\t\topacity: {\n\t\t\t\thover: 'var(--schmancy-sys-state-hover-opacity)',\n\t\t\t\tfocus: 'var(--schmancy-sys-state-focus-opacity)',\n\t\t\t\tpressed: 'var(--schmancy-sys-state-pressed-opacity)',\n\t\t\t\tdragged: 'var(--schmancy-sys-state-dragged-opacity)',\n\t\t\t\tdisabled: 'var(--schmancy-sys-state-disabled-opacity)',\n\t\t\t\tdisabledContainer: 'var(--schmancy-sys-state-disabled-container-opacity)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Spacing System\n\t\tspacing: {\n\t\t\t0: 'var(--schmancy-sys-spacing-0)',\n\t\t\t1: 'var(--schmancy-sys-spacing-1)',\n\t\t\t2: 'var(--schmancy-sys-spacing-2)',\n\t\t\t3: 'var(--schmancy-sys-spacing-3)',\n\t\t\t4: 'var(--schmancy-sys-spacing-4)',\n\t\t\t5: 'var(--schmancy-sys-spacing-5)',\n\t\t\t6: 'var(--schmancy-sys-spacing-6)',\n\t\t\t7: 'var(--schmancy-sys-spacing-7)',\n\t\t\t8: 'var(--schmancy-sys-spacing-8)',\n\t\t\t9: 'var(--schmancy-sys-spacing-9)',\n\t\t\t10: 'var(--schmancy-sys-spacing-10)',\n\t\t\t11: 'var(--schmancy-sys-spacing-11)',\n\t\t\t12: 'var(--schmancy-sys-spacing-12)',\n\t\t},\n\n\t\t// Legacy outline for backward compatibility\n\t\toutline: {\n\t\t\t1: 'var(--schmancy-sys-outline-1)',\n\t\t},\n\t},\n\n\t// Reference palette - complete tonal values\n\tref: {\n\t\tpalette: {\n\t\t\t// Primary tonal palette\n\t\t\tprimary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-primary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-primary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-primary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-primary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-primary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-primary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-primary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-primary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-primary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-primary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-primary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-primary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-primary-100)',\n\t\t\t},\n\t\t\t// Secondary tonal palette\n\t\t\tsecondary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-secondary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-secondary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-secondary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-secondary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-secondary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-secondary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-secondary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-secondary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-secondary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-secondary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-secondary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-secondary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-secondary-100)',\n\t\t\t},\n\t\t\t// Tertiary tonal palette\n\t\t\ttertiary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-tertiary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-tertiary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-tertiary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-tertiary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-tertiary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-tertiary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-tertiary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-tertiary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-tertiary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-tertiary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-tertiary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-tertiary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-tertiary-100)',\n\t\t\t},\n\t\t\t// Neutral tonal palette\n\t\t\tneutral: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-neutral-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-neutral-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-neutral-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-neutral-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-neutral-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-neutral-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-neutral-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-neutral-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-neutral-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-neutral-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-neutral-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-neutral-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-neutral-100)',\n\t\t\t},\n\t\t\t// Neutral variant tonal palette\n\t\t\tneutralVariant: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-neutralVariant-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-neutralVariant-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-neutralVariant-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-neutralVariant-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-neutralVariant-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-neutralVariant-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-neutralVariant-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-neutralVariant-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-neutralVariant-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-neutralVariant-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-neutralVariant-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-neutralVariant-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-neutralVariant-100)',\n\t\t\t},\n\t\t\t// Error tonal palette\n\t\t\terror: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-error-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-error-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-error-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-error-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-error-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-error-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-error-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-error-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-error-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-error-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-error-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-error-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-error-100)',\n\t\t\t},\n\t\t},\n\t},\n}\nconst theme = {\n\ttheme: ThemeDef,\n}\n\n/**\n * Type definition for the Schmancy Material Design 3 theme configuration.\n * Complete theme system with colors, typography, shape, motion, and state layers.\n *\n * @typedef {Object} TSchmancyTheme\n *\n * @example\n * ```typescript\n * import type { TSchmancyTheme } from '@schmancy/theme'\n *\n * const myTheme: Partial<TSchmancyTheme> = {\n * sys: {\n * color: {\n * primary: {\n * default: '#6750A4',\n * container: '#EADDFF'\n * }\n * },\n * shape: {\n * corner: {\n * medium: '12px'\n * }\n * }\n * }\n * }\n * ```\n */\nexport type TSchmancyTheme = (typeof theme)[keyof typeof theme] & {\n\t/**\n\t * Locale for number/date formatting (BCP 47 language tag).\n\t * Defaults to navigator.language, can be overridden via schmancy-theme locale attribute.\n\t * @example \"de-DE\", \"en-US\", \"ar-SA\"\n\t */\n\tlocale: string\n}\n\n/**\n * Default Schmancy theme configuration object.\n * Provides access to all theme CSS variables through JavaScript.\n *\n * @constant {TSchmancyTheme}\n *\n * @example\n * ```typescript\n * import { SchmancyTheme } from '@schmancy/theme'\n *\n * // Access primary color variable\n * const primaryColor = SchmancyTheme.sys.color.primary.default\n * // Returns: 'var(--schmancy-sys-color-primary-default)'\n * ```\n */\nconst SchmancyTheme: TSchmancyTheme = {\n\t...ThemeDef,\n\tlocale: typeof navigator !== 'undefined' ? navigator.language : 'de-DE',\n}\n\nexport { SchmancyTheme }\n"],"mappings":"AAyYA,IAAM,IAAgC;CAjYrC,KAAK;EAEJ,OAAO;GAEN,OAAO;GACP,SAAS;GACT,gBAAgB;GAChB,QAAQ;GAGR,SAAS;IACR,SAAS;IACT,KAAK;IACL,QAAQ;IACR,WAAW;IACX,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,IAAI;IACJ,WAAW;IACX,MAAM;IAEN,SAAS;IACT,WAAW;IAEX,KAAK;IACL,MAAM;IACN,SAAS;IACT,QAAQ;IAAA;GAIT,SAAS;IACR,SAAS;IACT,IAAI;IACJ,WAAW;IACX,aAAa;IACb,OAAO;IACP,UAAU;IACV,SAAS;IACT,gBAAgB;IAChB,SAAS;IAAA;GAIV,WAAW;IACV,SAAS;IACT,IAAI;IACJ,WAAW;IACX,aAAa;IACb,OAAO;IACP,UAAU;IACV,SAAS;IACT,gBAAgB;IAAA;GAIjB,UAAU;IACT,SAAS;IACT,IAAI;IACJ,WAAW;IACX,aAAa;IACb,OAAO;IACP,UAAU;IACV,SAAS;IACT,gBAAgB;IAAA;GAIjB,OAAO;IACN,SAAS;IACT,IAAI;IACJ,WAAW;IACX,aAAa;IAAA;GAId,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,"file":"theme.interface-C2XNgsLB.js","names":[],"sources":["../src/theme/theme.interface.ts"],"sourcesContent":["/**\n * Material Design 3 Theme Definition\n * Complete theme system following Material Design 3 specifications\n * @see https://m3.material.io/foundations/customization\n *\n * @internal\n */\nconst ThemeDef = {\n\tsys: {\n\t\t// M3 Color System - Complete tonal palette support\n\t\tcolor: {\n\t\t\t// Neutral colors\n\t\t\tscrim: 'var(--schmancy-sys-color-scrim)',\n\t\t\toutline: 'var(--schmancy-sys-color-outline)',\n\t\t\toutlineVariant: 'var(--schmancy-sys-color-outlineVariant)',\n\t\t\tshadow: 'var(--schmancy-sys-color-shadow)',\n\n\t\t\t// Surface colors with complete tonal values\n\t\t\tsurface: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-surface-default)',\n\t\t\t\tdim: 'var(--schmancy-sys-color-surface-dim)',\n\t\t\t\tbright: 'var(--schmancy-sys-color-surface-bright)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-surface-container)',\n\t\t\t\tcontainerLow: 'var(--schmancy-sys-color-surface-containerLow)',\n\t\t\t\tcontainerLowest: 'var(--schmancy-sys-color-surface-containerLowest)',\n\t\t\t\tcontainerHigh: 'var(--schmancy-sys-color-surface-containerHigh)',\n\t\t\t\tcontainerHighest: 'var(--schmancy-sys-color-surface-containerHighest)',\n\t\t\t\ton: 'var(--schmancy-sys-color-surface-on)',\n\t\t\t\tonVariant: 'var(--schmancy-sys-color-surface-onVariant)',\n\t\t\t\ttint: 'var(--schmancy-sys-color-surface-tint)',\n\t\t\t\t// Inverse colors\n\t\t\t\tinverse: 'var(--schmancy-sys-color-inverse-surface)',\n\t\t\t\tinverseOn: 'var(--schmancy-sys-color-inverse-onSurface)',\n\t\t\t\t// Deprecated mappings for backward compatibility\n\t\t\t\tlow: 'var(--schmancy-sys-color-surface-containerLow)',\n\t\t\t\thigh: 'var(--schmancy-sys-color-surface-containerHigh)',\n\t\t\t\thighest: 'var(--schmancy-sys-color-surface-containerHighest)',\n\t\t\t\tlowest: 'var(--schmancy-sys-color-surface-containerLowest)',\n\t\t\t},\n\n\t\t\t// Primary color roles with fixed variants\n\t\t\tprimary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-primary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-primary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-primary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-primary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-primary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-primary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-primary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-primary-onFixedVariant)',\n\t\t\t\tinverse: 'var(--schmancy-sys-color-inverse-primary)',\n\t\t\t},\n\n\t\t\t// Secondary color roles with fixed variants\n\t\t\tsecondary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-secondary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-secondary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-secondary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-secondary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-secondary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-secondary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-secondary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-secondary-onFixedVariant)',\n\t\t\t},\n\n\t\t\t// Tertiary color roles with fixed variants\n\t\t\ttertiary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-tertiary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-tertiary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-tertiary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-tertiary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-tertiary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-tertiary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-tertiary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-tertiary-onFixedVariant)',\n\t\t\t},\n\n\t\t\t// Error color roles\n\t\t\terror: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-error-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-error-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-error-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-error-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Success\n\t\t\tsuccess: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-success-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-success-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-success-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-success-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Warning\n\t\t\twarning: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-warning-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-warning-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-warning-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-warning-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Info\n\t\t\tinfo: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-info-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-info-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-info-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-info-onContainer)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Typography System\n\t\ttypography: {\n\t\t\t// Display styles\n\t\t\tdisplay: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-display-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-display-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-display-small)',\n\t\t\t},\n\t\t\t// Headline styles\n\t\t\theadline: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-headline-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-headline-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-headline-small)',\n\t\t\t},\n\t\t\t// Title styles\n\t\t\ttitle: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-title-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-title-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-title-small)',\n\t\t\t},\n\t\t\t// Body styles\n\t\t\tbody: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-body-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-body-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-body-small)',\n\t\t\t},\n\t\t\t// Label styles\n\t\t\tlabel: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-label-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-label-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-label-small)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Shape System\n\t\tshape: {\n\t\t\tcorner: {\n\t\t\t\tnone: 'var(--schmancy-sys-shape-corner-none)',\n\t\t\t\textraSmall: 'var(--schmancy-sys-shape-corner-extraSmall)',\n\t\t\t\tsmall: 'var(--schmancy-sys-shape-corner-small)',\n\t\t\t\tmedium: 'var(--schmancy-sys-shape-corner-medium)',\n\t\t\t\tlarge: 'var(--schmancy-sys-shape-corner-large)',\n\t\t\t\textraLarge: 'var(--schmancy-sys-shape-corner-extraLarge)',\n\t\t\t\tfull: 'var(--schmancy-sys-shape-corner-full)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Elevation System with tinted shadows\n\t\televation: {\n\t\t\t0: 'var(--schmancy-sys-elevation-0)',\n\t\t\t1: 'var(--schmancy-sys-elevation-1)',\n\t\t\t2: 'var(--schmancy-sys-elevation-2)',\n\t\t\t3: 'var(--schmancy-sys-elevation-3)',\n\t\t\t4: 'var(--schmancy-sys-elevation-4)',\n\t\t\t5: 'var(--schmancy-sys-elevation-5)',\n\t\t},\n\n\t\t// M3 Motion System\n\t\tmotion: {\n\t\t\t// Easing tokens\n\t\t\teasing: {\n\t\t\t\temphasized: 'var(--schmancy-sys-motion-easing-emphasized)',\n\t\t\t\temphasizedDecelerate: 'var(--schmancy-sys-motion-easing-emphasized-decelerate)',\n\t\t\t\temphasizedAccelerate: 'var(--schmancy-sys-motion-easing-emphasized-accelerate)',\n\t\t\t\tstandard: 'var(--schmancy-sys-motion-easing-standard)',\n\t\t\t\tstandardDecelerate: 'var(--schmancy-sys-motion-easing-standard-decelerate)',\n\t\t\t\tstandardAccelerate: 'var(--schmancy-sys-motion-easing-standard-accelerate)',\n\t\t\t\tlegacy: 'var(--schmancy-sys-motion-easing-legacy)',\n\t\t\t\tlinear: 'var(--schmancy-sys-motion-easing-linear)',\n\t\t\t},\n\t\t\t// Duration tokens\n\t\t\tduration: {\n\t\t\t\tshort1: 'var(--schmancy-sys-motion-duration-short1)',\n\t\t\t\tshort2: 'var(--schmancy-sys-motion-duration-short2)',\n\t\t\t\tshort3: 'var(--schmancy-sys-motion-duration-short3)',\n\t\t\t\tshort4: 'var(--schmancy-sys-motion-duration-short4)',\n\t\t\t\tmedium1: 'var(--schmancy-sys-motion-duration-medium1)',\n\t\t\t\tmedium2: 'var(--schmancy-sys-motion-duration-medium2)',\n\t\t\t\tmedium3: 'var(--schmancy-sys-motion-duration-medium3)',\n\t\t\t\tmedium4: 'var(--schmancy-sys-motion-duration-medium4)',\n\t\t\t\tlong1: 'var(--schmancy-sys-motion-duration-long1)',\n\t\t\t\tlong2: 'var(--schmancy-sys-motion-duration-long2)',\n\t\t\t\tlong3: 'var(--schmancy-sys-motion-duration-long3)',\n\t\t\t\tlong4: 'var(--schmancy-sys-motion-duration-long4)',\n\t\t\t\textraLong1: 'var(--schmancy-sys-motion-duration-extraLong1)',\n\t\t\t\textraLong2: 'var(--schmancy-sys-motion-duration-extraLong2)',\n\t\t\t\textraLong3: 'var(--schmancy-sys-motion-duration-extraLong3)',\n\t\t\t\textraLong4: 'var(--schmancy-sys-motion-duration-extraLong4)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 State Layers\n\t\tstate: {\n\t\t\topacity: {\n\t\t\t\thover: 'var(--schmancy-sys-state-hover-opacity)',\n\t\t\t\tfocus: 'var(--schmancy-sys-state-focus-opacity)',\n\t\t\t\tpressed: 'var(--schmancy-sys-state-pressed-opacity)',\n\t\t\t\tdragged: 'var(--schmancy-sys-state-dragged-opacity)',\n\t\t\t\tdisabled: 'var(--schmancy-sys-state-disabled-opacity)',\n\t\t\t\tdisabledContainer: 'var(--schmancy-sys-state-disabled-container-opacity)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Spacing System\n\t\tspacing: {\n\t\t\t0: 'var(--schmancy-sys-spacing-0)',\n\t\t\t1: 'var(--schmancy-sys-spacing-1)',\n\t\t\t2: 'var(--schmancy-sys-spacing-2)',\n\t\t\t3: 'var(--schmancy-sys-spacing-3)',\n\t\t\t4: 'var(--schmancy-sys-spacing-4)',\n\t\t\t5: 'var(--schmancy-sys-spacing-5)',\n\t\t\t6: 'var(--schmancy-sys-spacing-6)',\n\t\t\t7: 'var(--schmancy-sys-spacing-7)',\n\t\t\t8: 'var(--schmancy-sys-spacing-8)',\n\t\t\t9: 'var(--schmancy-sys-spacing-9)',\n\t\t\t10: 'var(--schmancy-sys-spacing-10)',\n\t\t\t11: 'var(--schmancy-sys-spacing-11)',\n\t\t\t12: 'var(--schmancy-sys-spacing-12)',\n\t\t},\n\n\t\t// Legacy outline for backward compatibility\n\t\toutline: {\n\t\t\t1: 'var(--schmancy-sys-outline-1)',\n\t\t},\n\t},\n\n\t// Reference palette - complete tonal values\n\tref: {\n\t\tpalette: {\n\t\t\t// Primary tonal palette\n\t\t\tprimary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-primary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-primary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-primary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-primary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-primary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-primary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-primary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-primary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-primary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-primary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-primary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-primary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-primary-100)',\n\t\t\t},\n\t\t\t// Secondary tonal palette\n\t\t\tsecondary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-secondary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-secondary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-secondary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-secondary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-secondary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-secondary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-secondary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-secondary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-secondary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-secondary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-secondary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-secondary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-secondary-100)',\n\t\t\t},\n\t\t\t// Tertiary tonal palette\n\t\t\ttertiary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-tertiary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-tertiary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-tertiary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-tertiary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-tertiary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-tertiary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-tertiary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-tertiary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-tertiary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-tertiary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-tertiary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-tertiary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-tertiary-100)',\n\t\t\t},\n\t\t\t// Neutral tonal palette\n\t\t\tneutral: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-neutral-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-neutral-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-neutral-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-neutral-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-neutral-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-neutral-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-neutral-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-neutral-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-neutral-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-neutral-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-neutral-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-neutral-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-neutral-100)',\n\t\t\t},\n\t\t\t// Neutral variant tonal palette\n\t\t\tneutralVariant: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-neutralVariant-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-neutralVariant-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-neutralVariant-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-neutralVariant-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-neutralVariant-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-neutralVariant-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-neutralVariant-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-neutralVariant-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-neutralVariant-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-neutralVariant-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-neutralVariant-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-neutralVariant-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-neutralVariant-100)',\n\t\t\t},\n\t\t\t// Error tonal palette\n\t\t\terror: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-error-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-error-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-error-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-error-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-error-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-error-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-error-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-error-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-error-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-error-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-error-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-error-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-error-100)',\n\t\t\t},\n\t\t},\n\t},\n}\nconst theme = {\n\ttheme: ThemeDef,\n}\n\n/**\n * Type definition for the Schmancy Material Design 3 theme configuration.\n * Complete theme system with colors, typography, shape, motion, and state layers.\n *\n * @typedef {Object} TSchmancyTheme\n *\n * @example\n * ```typescript\n * import type { TSchmancyTheme } from '@schmancy/theme'\n *\n * const myTheme: Partial<TSchmancyTheme> = {\n * sys: {\n * color: {\n * primary: {\n * default: '#6750A4',\n * container: '#EADDFF'\n * }\n * },\n * shape: {\n * corner: {\n * medium: '12px'\n * }\n * }\n * }\n * }\n * ```\n */\nexport type TSchmancyTheme = (typeof theme)[keyof typeof theme] & {\n\t/**\n\t * Locale for number/date formatting (BCP 47 language tag).\n\t * Defaults to navigator.language, can be overridden via schmancy-theme locale attribute.\n\t * @example \"de-DE\", \"en-US\", \"ar-SA\"\n\t */\n\tlocale: string\n}\n\n/**\n * Default Schmancy theme configuration object.\n * Provides access to all theme CSS variables through JavaScript.\n *\n * @constant {TSchmancyTheme}\n *\n * @example\n * ```typescript\n * import { SchmancyTheme } from '@schmancy/theme'\n *\n * // Access primary color variable\n * const primaryColor = SchmancyTheme.sys.color.primary.default\n * // Returns: 'var(--schmancy-sys-color-primary-default)'\n * ```\n */\nconst SchmancyTheme: TSchmancyTheme = {\n\t...ThemeDef,\n\tlocale: typeof navigator !== 'undefined' ? navigator.language : 'de-DE',\n}\n\nexport { SchmancyTheme }\n"],"mappings":"AAyYA,IAAM,IAAgC;CAjYrC,KAAK;EAEJ,OAAO;GAEN,OAAO;GACP,SAAS;GACT,gBAAgB;GAChB,QAAQ;GAGR,SAAS;IACR,SAAS;IACT,KAAK;IACL,QAAQ;IACR,WAAW;IACX,cAAc;IACd,iBAAiB;IACjB,eAAe;IACf,kBAAkB;IAClB,IAAI;IACJ,WAAW;IACX,MAAM;IAEN,SAAS;IACT,WAAW;IAEX,KAAK;IACL,MAAM;IACN,SAAS;IACT,QAAQ;IAAA;GAIT,SAAS;IACR,SAAS;IACT,IAAI;IACJ,WAAW;IACX,aAAa;IACb,OAAO;IACP,UAAU;IACV,SAAS;IACT,gBAAgB;IAChB,SAAS;IAAA;GAIV,WAAW;IACV,SAAS;IACT,IAAI;IACJ,WAAW;IACX,aAAa;IACb,OAAO;IACP,UAAU;IACV,SA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J,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,KAAK;GAAA;EAAA,EAAA;CA8DR,QAA6B,OAAd,YAAc,MAAc,UAAU,WAAW;CAAA;AAAA,SAAA,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.interface-CYo4UpWK.cjs","names":[],"sources":["../src/theme/theme.interface.ts"],"sourcesContent":["/**\n * Material Design 3 Theme Definition\n * Complete theme system following Material Design 3 specifications\n * @see https://m3.material.io/foundations/customization\n *\n * @internal\n */\nconst ThemeDef = {\n\tsys: {\n\t\t// M3 Color System - Complete tonal palette support\n\t\tcolor: {\n\t\t\t// Neutral colors\n\t\t\tscrim: 'var(--schmancy-sys-color-scrim)',\n\t\t\toutline: 'var(--schmancy-sys-color-outline)',\n\t\t\toutlineVariant: 'var(--schmancy-sys-color-outlineVariant)',\n\t\t\tshadow: 'var(--schmancy-sys-color-shadow)',\n\n\t\t\t// Surface colors with complete tonal values\n\t\t\tsurface: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-surface-default)',\n\t\t\t\tdim: 'var(--schmancy-sys-color-surface-dim)',\n\t\t\t\tbright: 'var(--schmancy-sys-color-surface-bright)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-surface-container)',\n\t\t\t\tcontainerLow: 'var(--schmancy-sys-color-surface-containerLow)',\n\t\t\t\tcontainerLowest: 'var(--schmancy-sys-color-surface-containerLowest)',\n\t\t\t\tcontainerHigh: 'var(--schmancy-sys-color-surface-containerHigh)',\n\t\t\t\tcontainerHighest: 'var(--schmancy-sys-color-surface-containerHighest)',\n\t\t\t\ton: 'var(--schmancy-sys-color-surface-on)',\n\t\t\t\tonVariant: 'var(--schmancy-sys-color-surface-onVariant)',\n\t\t\t\ttint: 'var(--schmancy-sys-color-surface-tint)',\n\t\t\t\t// Inverse colors\n\t\t\t\tinverse: 'var(--schmancy-sys-color-inverse-surface)',\n\t\t\t\tinverseOn: 'var(--schmancy-sys-color-inverse-onSurface)',\n\t\t\t\t// Deprecated mappings for backward compatibility\n\t\t\t\tlow: 'var(--schmancy-sys-color-surface-containerLow)',\n\t\t\t\thigh: 'var(--schmancy-sys-color-surface-containerHigh)',\n\t\t\t\thighest: 'var(--schmancy-sys-color-surface-containerHighest)',\n\t\t\t\tlowest: 'var(--schmancy-sys-color-surface-containerLowest)',\n\t\t\t},\n\n\t\t\t// Primary color roles with fixed variants\n\t\t\tprimary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-primary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-primary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-primary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-primary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-primary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-primary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-primary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-primary-onFixedVariant)',\n\t\t\t\tinverse: 'var(--schmancy-sys-color-inverse-primary)',\n\t\t\t},\n\n\t\t\t// Secondary color roles with fixed variants\n\t\t\tsecondary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-secondary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-secondary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-secondary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-secondary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-secondary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-secondary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-secondary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-secondary-onFixedVariant)',\n\t\t\t},\n\n\t\t\t// Tertiary color roles with fixed variants\n\t\t\ttertiary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-tertiary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-tertiary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-tertiary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-tertiary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-tertiary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-tertiary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-tertiary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-tertiary-onFixedVariant)',\n\t\t\t},\n\n\t\t\t// Error color roles\n\t\t\terror: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-error-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-error-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-error-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-error-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Success\n\t\t\tsuccess: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-success-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-success-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-success-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-success-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Warning\n\t\t\twarning: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-warning-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-warning-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-warning-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-warning-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Info\n\t\t\tinfo: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-info-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-info-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-info-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-info-onContainer)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Typography System\n\t\ttypography: {\n\t\t\t// Display styles\n\t\t\tdisplay: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-display-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-display-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-display-small)',\n\t\t\t},\n\t\t\t// Headline styles\n\t\t\theadline: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-headline-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-headline-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-headline-small)',\n\t\t\t},\n\t\t\t// Title styles\n\t\t\ttitle: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-title-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-title-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-title-small)',\n\t\t\t},\n\t\t\t// Body styles\n\t\t\tbody: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-body-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-body-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-body-small)',\n\t\t\t},\n\t\t\t// Label styles\n\t\t\tlabel: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-label-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-label-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-label-small)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Shape System\n\t\tshape: {\n\t\t\tcorner: {\n\t\t\t\tnone: 'var(--schmancy-sys-shape-corner-none)',\n\t\t\t\textraSmall: 'var(--schmancy-sys-shape-corner-extraSmall)',\n\t\t\t\tsmall: 'var(--schmancy-sys-shape-corner-small)',\n\t\t\t\tmedium: 'var(--schmancy-sys-shape-corner-medium)',\n\t\t\t\tlarge: 'var(--schmancy-sys-shape-corner-large)',\n\t\t\t\textraLarge: 'var(--schmancy-sys-shape-corner-extraLarge)',\n\t\t\t\tfull: 'var(--schmancy-sys-shape-corner-full)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Elevation System with tinted shadows\n\t\televation: {\n\t\t\t0: 'var(--schmancy-sys-elevation-0)',\n\t\t\t1: 'var(--schmancy-sys-elevation-1)',\n\t\t\t2: 'var(--schmancy-sys-elevation-2)',\n\t\t\t3: 'var(--schmancy-sys-elevation-3)',\n\t\t\t4: 'var(--schmancy-sys-elevation-4)',\n\t\t\t5: 'var(--schmancy-sys-elevation-5)',\n\t\t},\n\n\t\t// M3 Motion System\n\t\tmotion: {\n\t\t\t// Easing tokens\n\t\t\teasing: {\n\t\t\t\temphasized: 'var(--schmancy-sys-motion-easing-emphasized)',\n\t\t\t\temphasizedDecelerate: 'var(--schmancy-sys-motion-easing-emphasized-decelerate)',\n\t\t\t\temphasizedAccelerate: 'var(--schmancy-sys-motion-easing-emphasized-accelerate)',\n\t\t\t\tstandard: 'var(--schmancy-sys-motion-easing-standard)',\n\t\t\t\tstandardDecelerate: 'var(--schmancy-sys-motion-easing-standard-decelerate)',\n\t\t\t\tstandardAccelerate: 'var(--schmancy-sys-motion-easing-standard-accelerate)',\n\t\t\t\tlegacy: 'var(--schmancy-sys-motion-easing-legacy)',\n\t\t\t\tlinear: 'var(--schmancy-sys-motion-easing-linear)',\n\t\t\t},\n\t\t\t// Duration tokens\n\t\t\tduration: {\n\t\t\t\tshort1: 'var(--schmancy-sys-motion-duration-short1)',\n\t\t\t\tshort2: 'var(--schmancy-sys-motion-duration-short2)',\n\t\t\t\tshort3: 'var(--schmancy-sys-motion-duration-short3)',\n\t\t\t\tshort4: 'var(--schmancy-sys-motion-duration-short4)',\n\t\t\t\tmedium1: 'var(--schmancy-sys-motion-duration-medium1)',\n\t\t\t\tmedium2: 'var(--schmancy-sys-motion-duration-medium2)',\n\t\t\t\tmedium3: 'var(--schmancy-sys-motion-duration-medium3)',\n\t\t\t\tmedium4: 'var(--schmancy-sys-motion-duration-medium4)',\n\t\t\t\tlong1: 'var(--schmancy-sys-motion-duration-long1)',\n\t\t\t\tlong2: 'var(--schmancy-sys-motion-duration-long2)',\n\t\t\t\tlong3: 'var(--schmancy-sys-motion-duration-long3)',\n\t\t\t\tlong4: 'var(--schmancy-sys-motion-duration-long4)',\n\t\t\t\textraLong1: 'var(--schmancy-sys-motion-duration-extraLong1)',\n\t\t\t\textraLong2: 'var(--schmancy-sys-motion-duration-extraLong2)',\n\t\t\t\textraLong3: 'var(--schmancy-sys-motion-duration-extraLong3)',\n\t\t\t\textraLong4: 'var(--schmancy-sys-motion-duration-extraLong4)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 State Layers\n\t\tstate: {\n\t\t\topacity: {\n\t\t\t\thover: 'var(--schmancy-sys-state-hover-opacity)',\n\t\t\t\tfocus: 'var(--schmancy-sys-state-focus-opacity)',\n\t\t\t\tpressed: 'var(--schmancy-sys-state-pressed-opacity)',\n\t\t\t\tdragged: 'var(--schmancy-sys-state-dragged-opacity)',\n\t\t\t\tdisabled: 'var(--schmancy-sys-state-disabled-opacity)',\n\t\t\t\tdisabledContainer: 'var(--schmancy-sys-state-disabled-container-opacity)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Spacing System\n\t\tspacing: {\n\t\t\t0: 'var(--schmancy-sys-spacing-0)',\n\t\t\t1: 'var(--schmancy-sys-spacing-1)',\n\t\t\t2: 'var(--schmancy-sys-spacing-2)',\n\t\t\t3: 'var(--schmancy-sys-spacing-3)',\n\t\t\t4: 'var(--schmancy-sys-spacing-4)',\n\t\t\t5: 'var(--schmancy-sys-spacing-5)',\n\t\t\t6: 'var(--schmancy-sys-spacing-6)',\n\t\t\t7: 'var(--schmancy-sys-spacing-7)',\n\t\t\t8: 'var(--schmancy-sys-spacing-8)',\n\t\t\t9: 'var(--schmancy-sys-spacing-9)',\n\t\t\t10: 'var(--schmancy-sys-spacing-10)',\n\t\t\t11: 'var(--schmancy-sys-spacing-11)',\n\t\t\t12: 'var(--schmancy-sys-spacing-12)',\n\t\t},\n\n\t\t// Legacy outline for backward compatibility\n\t\toutline: {\n\t\t\t1: 'var(--schmancy-sys-outline-1)',\n\t\t},\n\t},\n\n\t// Reference palette - complete tonal values\n\tref: {\n\t\tpalette: {\n\t\t\t// Primary tonal palette\n\t\t\tprimary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-primary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-primary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-primary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-primary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-primary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-primary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-primary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-primary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-primary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-primary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-primary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-primary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-primary-100)',\n\t\t\t},\n\t\t\t// Secondary tonal palette\n\t\t\tsecondary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-secondary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-secondary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-secondary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-secondary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-secondary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-secondary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-secondary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-secondary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-secondary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-secondary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-secondary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-secondary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-secondary-100)',\n\t\t\t},\n\t\t\t// Tertiary tonal palette\n\t\t\ttertiary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-tertiary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-tertiary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-tertiary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-tertiary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-tertiary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-tertiary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-tertiary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-tertiary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-tertiary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-tertiary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-tertiary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-tertiary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-tertiary-100)',\n\t\t\t},\n\t\t\t// Neutral tonal palette\n\t\t\tneutral: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-neutral-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-neutral-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-neutral-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-neutral-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-neutral-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-neutral-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-neutral-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-neutral-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-neutral-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-neutral-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-neutral-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-neutral-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-neutral-100)',\n\t\t\t},\n\t\t\t// Neutral variant tonal palette\n\t\t\tneutralVariant: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-neutralVariant-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-neutralVariant-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-neutralVariant-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-neutralVariant-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-neutralVariant-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-neutralVariant-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-neutralVariant-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-neutralVariant-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-neutralVariant-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-neutralVariant-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-neutralVariant-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-neutralVariant-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-neutralVariant-100)',\n\t\t\t},\n\t\t\t// Error tonal palette\n\t\t\terror: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-error-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-error-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-error-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-error-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-error-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-error-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-error-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-error-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-error-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-error-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-error-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-error-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-error-100)',\n\t\t\t},\n\t\t},\n\t},\n}\nconst theme = {\n\ttheme: ThemeDef,\n}\n\n/**\n * Type definition for the Schmancy Material Design 3 theme configuration.\n * Complete theme system with colors, typography, shape, motion, and state layers.\n *\n * @typedef {Object} TSchmancyTheme\n *\n * @example\n * ```typescript\n * import type { TSchmancyTheme } from '@schmancy/theme'\n *\n * const myTheme: Partial<TSchmancyTheme> = {\n * sys: {\n * color: {\n * primary: {\n * default: '#6750A4',\n * container: '#EADDFF'\n * }\n * },\n * shape: {\n * corner: {\n * medium: '12px'\n * }\n * }\n * }\n * }\n * ```\n */\nexport type TSchmancyTheme = (typeof theme)[keyof typeof theme] & {\n\t/**\n\t * Locale for number/date formatting (BCP 47 language tag).\n\t * Defaults to navigator.language, can be overridden via schmancy-theme locale attribute.\n\t * @example \"de-DE\", \"en-US\", \"ar-SA\"\n\t */\n\tlocale: string\n}\n\n/**\n * Default Schmancy theme configuration object.\n * Provides access to all theme CSS variables through JavaScript.\n *\n * @constant {TSchmancyTheme}\n *\n * @example\n * ```typescript\n * import { SchmancyTheme } from '@schmancy/theme'\n *\n * // Access primary color variable\n * const primaryColor = SchmancyTheme.sys.color.primary.default\n * // Returns: 'var(--schmancy-sys-color-primary-default)'\n * ```\n */\nconst SchmancyTheme: TSchmancyTheme = {\n\t...ThemeDef,\n\tlocale: typeof navigator !== 'undefined' ? navigator.language : 'de-DE',\n}\n\nexport { SchmancyTheme }\n"],"mappings":"AAyYA,IAAM,EAAgC,CAjYrC,IAAK,CAEJ,MAAO,CAEN,MAAO,kCACP,QAAS,oCACT,eAAgB,2CAChB,OAAQ,mCAGR,QAAS,CACR,QAAS,4CACT,IAAK,wCACL,OAAQ,2CACR,UAAW,8CACX,aAAc,iDACd,gBAAiB,oDACjB,cAAe,kDACf,iBAAkB,qDAClB,GAAI,uCACJ,UAAW,8CACX,KAAM,yCAEN,QAAS,4CACT,UAAW,8CAEX,IAAK,i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,2CAAA,CAGN,QAAS,CACR,EAAG,wCACH,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,GAAI,yCACJ,IAAK,0CAAA,CAGN,eAAgB,CACf,EAAG,+CACH,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,GAAI,gDACJ,IAAK,iDAAA,CAGN,MAAO,CACN,EAAG,sCACH,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,GAAI,uCACJ,IAAK,wCAAA,CAAA,CAAA,CA8DR,OAA6B,OAAd,UAAc,IAAc,UAAU,SAAW,QAAA,CAAA,OAAA,eAAA,QAAA,IAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"theme.interface-D4NeufQA.cjs","names":[],"sources":["../src/theme/theme.interface.ts"],"sourcesContent":["/**\n * Material Design 3 Theme Definition\n * Complete theme system following Material Design 3 specifications\n * @see https://m3.material.io/foundations/customization\n *\n * @internal\n */\nconst ThemeDef = {\n\tsys: {\n\t\t// M3 Color System - Complete tonal palette support\n\t\tcolor: {\n\t\t\t// Neutral colors\n\t\t\tscrim: 'var(--schmancy-sys-color-scrim)',\n\t\t\toutline: 'var(--schmancy-sys-color-outline)',\n\t\t\toutlineVariant: 'var(--schmancy-sys-color-outlineVariant)',\n\t\t\tshadow: 'var(--schmancy-sys-color-shadow)',\n\n\t\t\t// Surface colors with complete tonal values\n\t\t\tsurface: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-surface-default)',\n\t\t\t\tdim: 'var(--schmancy-sys-color-surface-dim)',\n\t\t\t\tbright: 'var(--schmancy-sys-color-surface-bright)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-surface-container)',\n\t\t\t\tcontainerLow: 'var(--schmancy-sys-color-surface-containerLow)',\n\t\t\t\tcontainerLowest: 'var(--schmancy-sys-color-surface-containerLowest)',\n\t\t\t\tcontainerHigh: 'var(--schmancy-sys-color-surface-containerHigh)',\n\t\t\t\tcontainerHighest: 'var(--schmancy-sys-color-surface-containerHighest)',\n\t\t\t\ton: 'var(--schmancy-sys-color-surface-on)',\n\t\t\t\tonVariant: 'var(--schmancy-sys-color-surface-onVariant)',\n\t\t\t\ttint: 'var(--schmancy-sys-color-surface-tint)',\n\t\t\t\t// Inverse colors\n\t\t\t\tinverse: 'var(--schmancy-sys-color-inverse-surface)',\n\t\t\t\tinverseOn: 'var(--schmancy-sys-color-inverse-onSurface)',\n\t\t\t\t// Deprecated mappings for backward compatibility\n\t\t\t\tlow: 'var(--schmancy-sys-color-surface-containerLow)',\n\t\t\t\thigh: 'var(--schmancy-sys-color-surface-containerHigh)',\n\t\t\t\thighest: 'var(--schmancy-sys-color-surface-containerHighest)',\n\t\t\t\tlowest: 'var(--schmancy-sys-color-surface-containerLowest)',\n\t\t\t},\n\n\t\t\t// Primary color roles with fixed variants\n\t\t\tprimary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-primary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-primary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-primary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-primary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-primary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-primary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-primary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-primary-onFixedVariant)',\n\t\t\t\tinverse: 'var(--schmancy-sys-color-inverse-primary)',\n\t\t\t},\n\n\t\t\t// Secondary color roles with fixed variants\n\t\t\tsecondary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-secondary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-secondary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-secondary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-secondary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-secondary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-secondary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-secondary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-secondary-onFixedVariant)',\n\t\t\t},\n\n\t\t\t// Tertiary color roles with fixed variants\n\t\t\ttertiary: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-tertiary-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-tertiary-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-tertiary-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-tertiary-onContainer)',\n\t\t\t\tfixed: 'var(--schmancy-sys-color-tertiary-fixed)',\n\t\t\t\tfixedDim: 'var(--schmancy-sys-color-tertiary-fixedDim)',\n\t\t\t\tonFixed: 'var(--schmancy-sys-color-tertiary-onFixed)',\n\t\t\t\tonFixedVariant: 'var(--schmancy-sys-color-tertiary-onFixedVariant)',\n\t\t\t},\n\n\t\t\t// Error color roles\n\t\t\terror: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-error-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-error-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-error-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-error-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Success\n\t\t\tsuccess: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-success-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-success-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-success-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-success-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Warning\n\t\t\twarning: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-warning-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-warning-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-warning-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-warning-onContainer)',\n\t\t\t},\n\n\t\t\t// Extended color roles - Info\n\t\t\tinfo: {\n\t\t\t\tdefault: 'var(--schmancy-sys-color-info-default)',\n\t\t\t\ton: 'var(--schmancy-sys-color-info-on)',\n\t\t\t\tcontainer: 'var(--schmancy-sys-color-info-container)',\n\t\t\t\tonContainer: 'var(--schmancy-sys-color-info-onContainer)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Typography System\n\t\ttypography: {\n\t\t\t// Display styles\n\t\t\tdisplay: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-display-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-display-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-display-small)',\n\t\t\t},\n\t\t\t// Headline styles\n\t\t\theadline: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-headline-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-headline-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-headline-small)',\n\t\t\t},\n\t\t\t// Title styles\n\t\t\ttitle: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-title-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-title-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-title-small)',\n\t\t\t},\n\t\t\t// Body styles\n\t\t\tbody: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-body-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-body-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-body-small)',\n\t\t\t},\n\t\t\t// Label styles\n\t\t\tlabel: {\n\t\t\t\tlarge: 'var(--schmancy-sys-typescale-label-large)',\n\t\t\t\tmedium: 'var(--schmancy-sys-typescale-label-medium)',\n\t\t\t\tsmall: 'var(--schmancy-sys-typescale-label-small)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Shape System\n\t\tshape: {\n\t\t\tcorner: {\n\t\t\t\tnone: 'var(--schmancy-sys-shape-corner-none)',\n\t\t\t\textraSmall: 'var(--schmancy-sys-shape-corner-extraSmall)',\n\t\t\t\tsmall: 'var(--schmancy-sys-shape-corner-small)',\n\t\t\t\tmedium: 'var(--schmancy-sys-shape-corner-medium)',\n\t\t\t\tlarge: 'var(--schmancy-sys-shape-corner-large)',\n\t\t\t\textraLarge: 'var(--schmancy-sys-shape-corner-extraLarge)',\n\t\t\t\tfull: 'var(--schmancy-sys-shape-corner-full)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Elevation System with tinted shadows\n\t\televation: {\n\t\t\t0: 'var(--schmancy-sys-elevation-0)',\n\t\t\t1: 'var(--schmancy-sys-elevation-1)',\n\t\t\t2: 'var(--schmancy-sys-elevation-2)',\n\t\t\t3: 'var(--schmancy-sys-elevation-3)',\n\t\t\t4: 'var(--schmancy-sys-elevation-4)',\n\t\t\t5: 'var(--schmancy-sys-elevation-5)',\n\t\t},\n\n\t\t// M3 Motion System\n\t\tmotion: {\n\t\t\t// Easing tokens\n\t\t\teasing: {\n\t\t\t\temphasized: 'var(--schmancy-sys-motion-easing-emphasized)',\n\t\t\t\temphasizedDecelerate: 'var(--schmancy-sys-motion-easing-emphasized-decelerate)',\n\t\t\t\temphasizedAccelerate: 'var(--schmancy-sys-motion-easing-emphasized-accelerate)',\n\t\t\t\tstandard: 'var(--schmancy-sys-motion-easing-standard)',\n\t\t\t\tstandardDecelerate: 'var(--schmancy-sys-motion-easing-standard-decelerate)',\n\t\t\t\tstandardAccelerate: 'var(--schmancy-sys-motion-easing-standard-accelerate)',\n\t\t\t\tlegacy: 'var(--schmancy-sys-motion-easing-legacy)',\n\t\t\t\tlinear: 'var(--schmancy-sys-motion-easing-linear)',\n\t\t\t},\n\t\t\t// Duration tokens\n\t\t\tduration: {\n\t\t\t\tshort1: 'var(--schmancy-sys-motion-duration-short1)',\n\t\t\t\tshort2: 'var(--schmancy-sys-motion-duration-short2)',\n\t\t\t\tshort3: 'var(--schmancy-sys-motion-duration-short3)',\n\t\t\t\tshort4: 'var(--schmancy-sys-motion-duration-short4)',\n\t\t\t\tmedium1: 'var(--schmancy-sys-motion-duration-medium1)',\n\t\t\t\tmedium2: 'var(--schmancy-sys-motion-duration-medium2)',\n\t\t\t\tmedium3: 'var(--schmancy-sys-motion-duration-medium3)',\n\t\t\t\tmedium4: 'var(--schmancy-sys-motion-duration-medium4)',\n\t\t\t\tlong1: 'var(--schmancy-sys-motion-duration-long1)',\n\t\t\t\tlong2: 'var(--schmancy-sys-motion-duration-long2)',\n\t\t\t\tlong3: 'var(--schmancy-sys-motion-duration-long3)',\n\t\t\t\tlong4: 'var(--schmancy-sys-motion-duration-long4)',\n\t\t\t\textraLong1: 'var(--schmancy-sys-motion-duration-extraLong1)',\n\t\t\t\textraLong2: 'var(--schmancy-sys-motion-duration-extraLong2)',\n\t\t\t\textraLong3: 'var(--schmancy-sys-motion-duration-extraLong3)',\n\t\t\t\textraLong4: 'var(--schmancy-sys-motion-duration-extraLong4)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 State Layers\n\t\tstate: {\n\t\t\topacity: {\n\t\t\t\thover: 'var(--schmancy-sys-state-hover-opacity)',\n\t\t\t\tfocus: 'var(--schmancy-sys-state-focus-opacity)',\n\t\t\t\tpressed: 'var(--schmancy-sys-state-pressed-opacity)',\n\t\t\t\tdragged: 'var(--schmancy-sys-state-dragged-opacity)',\n\t\t\t\tdisabled: 'var(--schmancy-sys-state-disabled-opacity)',\n\t\t\t\tdisabledContainer: 'var(--schmancy-sys-state-disabled-container-opacity)',\n\t\t\t},\n\t\t},\n\n\t\t// M3 Spacing System\n\t\tspacing: {\n\t\t\t0: 'var(--schmancy-sys-spacing-0)',\n\t\t\t1: 'var(--schmancy-sys-spacing-1)',\n\t\t\t2: 'var(--schmancy-sys-spacing-2)',\n\t\t\t3: 'var(--schmancy-sys-spacing-3)',\n\t\t\t4: 'var(--schmancy-sys-spacing-4)',\n\t\t\t5: 'var(--schmancy-sys-spacing-5)',\n\t\t\t6: 'var(--schmancy-sys-spacing-6)',\n\t\t\t7: 'var(--schmancy-sys-spacing-7)',\n\t\t\t8: 'var(--schmancy-sys-spacing-8)',\n\t\t\t9: 'var(--schmancy-sys-spacing-9)',\n\t\t\t10: 'var(--schmancy-sys-spacing-10)',\n\t\t\t11: 'var(--schmancy-sys-spacing-11)',\n\t\t\t12: 'var(--schmancy-sys-spacing-12)',\n\t\t},\n\n\t\t// Legacy outline for backward compatibility\n\t\toutline: {\n\t\t\t1: 'var(--schmancy-sys-outline-1)',\n\t\t},\n\t},\n\n\t// Reference palette - complete tonal values\n\tref: {\n\t\tpalette: {\n\t\t\t// Primary tonal palette\n\t\t\tprimary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-primary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-primary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-primary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-primary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-primary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-primary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-primary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-primary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-primary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-primary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-primary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-primary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-primary-100)',\n\t\t\t},\n\t\t\t// Secondary tonal palette\n\t\t\tsecondary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-secondary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-secondary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-secondary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-secondary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-secondary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-secondary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-secondary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-secondary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-secondary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-secondary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-secondary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-secondary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-secondary-100)',\n\t\t\t},\n\t\t\t// Tertiary tonal palette\n\t\t\ttertiary: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-tertiary-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-tertiary-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-tertiary-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-tertiary-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-tertiary-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-tertiary-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-tertiary-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-tertiary-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-tertiary-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-tertiary-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-tertiary-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-tertiary-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-tertiary-100)',\n\t\t\t},\n\t\t\t// Neutral tonal palette\n\t\t\tneutral: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-neutral-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-neutral-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-neutral-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-neutral-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-neutral-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-neutral-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-neutral-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-neutral-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-neutral-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-neutral-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-neutral-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-neutral-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-neutral-100)',\n\t\t\t},\n\t\t\t// Neutral variant tonal palette\n\t\t\tneutralVariant: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-neutralVariant-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-neutralVariant-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-neutralVariant-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-neutralVariant-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-neutralVariant-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-neutralVariant-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-neutralVariant-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-neutralVariant-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-neutralVariant-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-neutralVariant-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-neutralVariant-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-neutralVariant-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-neutralVariant-100)',\n\t\t\t},\n\t\t\t// Error tonal palette\n\t\t\terror: {\n\t\t\t\t0: 'var(--schmancy-ref-palette-error-0)',\n\t\t\t\t10: 'var(--schmancy-ref-palette-error-10)',\n\t\t\t\t20: 'var(--schmancy-ref-palette-error-20)',\n\t\t\t\t30: 'var(--schmancy-ref-palette-error-30)',\n\t\t\t\t40: 'var(--schmancy-ref-palette-error-40)',\n\t\t\t\t50: 'var(--schmancy-ref-palette-error-50)',\n\t\t\t\t60: 'var(--schmancy-ref-palette-error-60)',\n\t\t\t\t70: 'var(--schmancy-ref-palette-error-70)',\n\t\t\t\t80: 'var(--schmancy-ref-palette-error-80)',\n\t\t\t\t90: 'var(--schmancy-ref-palette-error-90)',\n\t\t\t\t95: 'var(--schmancy-ref-palette-error-95)',\n\t\t\t\t99: 'var(--schmancy-ref-palette-error-99)',\n\t\t\t\t100: 'var(--schmancy-ref-palette-error-100)',\n\t\t\t},\n\t\t},\n\t},\n}\nconst theme = {\n\ttheme: ThemeDef,\n}\n\n/**\n * Type definition for the Schmancy Material Design 3 theme configuration.\n * Complete theme system with colors, typography, shape, motion, and state layers.\n *\n * @typedef {Object} TSchmancyTheme\n *\n * @example\n * ```typescript\n * import type { TSchmancyTheme } from '@schmancy/theme'\n *\n * const myTheme: Partial<TSchmancyTheme> = {\n * sys: {\n * color: {\n * primary: {\n * default: '#6750A4',\n * container: '#EADDFF'\n * }\n * },\n * shape: {\n * corner: {\n * medium: '12px'\n * }\n * }\n * }\n * }\n * ```\n */\nexport type TSchmancyTheme = (typeof theme)[keyof typeof theme] & {\n\t/**\n\t * Locale for number/date formatting (BCP 47 language tag).\n\t * Defaults to navigator.language, can be overridden via schmancy-theme locale attribute.\n\t * @example \"de-DE\", \"en-US\", \"ar-SA\"\n\t */\n\tlocale: string\n}\n\n/**\n * Default Schmancy theme configuration object.\n * Provides access to all theme CSS variables through JavaScript.\n *\n * @constant {TSchmancyTheme}\n *\n * @example\n * ```typescript\n * import { SchmancyTheme } from '@schmancy/theme'\n *\n * // Access primary color variable\n * const primaryColor = SchmancyTheme.sys.color.primary.default\n * // Returns: 'var(--schmancy-sys-color-primary-default)'\n * ```\n */\nconst SchmancyTheme: TSchmancyTheme = {\n\t...ThemeDef,\n\tlocale: typeof navigator !== 'undefined' ? navigator.language : 'de-DE',\n}\n\nexport { SchmancyTheme }\n"],"mappings":"AAyYA,IAAM,EAAgC,CAjYrC,IAAK,CAEJ,MAAO,CAEN,MAAO,kCACP,QAAS,oCACT,eAAgB,2CAChB,OAAQ,mCAGR,QAAS,CACR,QAAS,4CACT,IAAK,wCACL,OAAQ,2CACR,UAAW,8CACX,aAAc,iDACd,gBAAiB,oDACjB,cAAe,kDACf,iBAAkB,qDAClB,GAAI,uCACJ,UAAW,8CACX,KAAM,yCAEN,QAAS,4CACT,UAAW,8CAEX,IAAK,iDACL,KAAM,kDACN,QAAS,qDACT,OAAQ,oDAAA,CAIT,QAAS,CACR,QAAS,4CACT,GAAI,uCACJ,UAAW,8CACX,YAAa,gDACb,MAAO,0CACP,SAAU,6CACV,QAAS,4CACT,eAAgB,mDAChB,QAAS,4CAAA,CAIV,UAAW,CACV,QAAS,8CACT,GAAI,yCACJ,UAAW,gDACX,YAAa,kDACb,MAAO,4CACP,SAAU,+CACV,QAAS,8CACT,eAAgB,qDAAA,CAIjB,SAAU,CACT,QAAS,6CACT,GAAI,wCACJ,UAAW,+CACX,YAAa,iDACb,MAAO,2CACP,SAAU,8CACV,QAAS,6CACT,eAAgB,oDAAA,CAIjB,MAAO,CACN,QAAS,0CACT,GAAI,qCACJ,UAAW,4CACX,YAAa,8CAAA,CAId,QAAS,CACR,QAAS,4CACT,GAAI,uCACJ,UAAW,8CACX,YAAa,gDAAA,CAId,QAAS,CACR,QAAS,4CACT,GAAI,uCACJ,UAAW,8CACX,YAAa,gDAAA,CAId,KAAM,CACL,QAAS,yCACT,GAAI,oCACJ,UAAW,2CACX,YAAa,6CAAA,CAAA,CAKf,WAAY,CAEX,QAAS,CACR,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AA,GAAA,CAAA"}
|
package/dist/theme.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { f as e } from "./mixins-BWb9_e1s.js";
|
|
2
2
|
import { i as t, n, r, t as i } from "./theme.service-BOWIT_5k.js";
|
|
3
|
-
import { t as a } from "./theme.interface-
|
|
4
|
-
import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as m } from "./theme-
|
|
3
|
+
import { t as a } from "./theme.interface-C2XNgsLB.js";
|
|
4
|
+
import { a as o, c as s, i as c, l, n as u, o as d, r as f, s as p, t as m } from "./theme-CFPJW933.js";
|
|
5
5
|
export { u as SchmancyGenerateMoodAudioEvent, a as SchmancyTheme, f as SchmancyThemeAudioPlayer, o as SchmancyThemeComponent, c as SchmancyThemeController, m as SchmancyThemeControllerBoat, r as ThemeHereIAm, t as ThemeWhereAreYou, p as createDarkTonalPaletteFromBaseColor, s as createLightTonalPaletteFromBaseColor, l as formatTheme, i as schmancyTheme, d as tailwindStyles, n as theme, e as themeContext };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.service-BOWIT_5k.js","names":[],"sources":["../src/theme/theme.events.ts","../src/theme/theme.service.ts"],"sourcesContent":["/**\n * Theme discovery event system.\n *\n * These events facilitate communication between theme components and consumers,\n * allowing components to discover the nearest theme provider in the DOM hierarchy.\n */\n\n/**\n * Event dispatched by components to discover the nearest theme provider.\n * Theme components listen for this event and respond with ThemeHereIAmEvent.\n *\n * @event ThemeWhereAreYouEvent\n * @type {CustomEvent<void>}\n *\n * @example\n * ```typescript\n * // Dispatch discovery request\n * window.dispatchEvent(\n * new CustomEvent('theme-where-are-you', {\n * bubbles: true,\n * composed: true\n * })\n * )\n * ```\n */\nexport type ThemeWhereAreYouEvent = CustomEvent<void>\n\n/**\n * Event name constant for theme discovery request.\n * @const {string}\n */\nexport const ThemeWhereAreYou = 'theme-where-are-you'\n\n/**\n * Event dispatched by theme components in response to discovery requests.\n * Contains reference to the theme component element.\n *\n * @event ThemeHereIAmEvent\n * @type {CustomEvent<{theme: HTMLElement}>}\n * @property {HTMLElement} detail.theme - The theme component element\n *\n * @example\n * ```typescript\n * // Listen for theme response\n * window.addEventListener('theme-here-i-am', (event: ThemeHereIAmEvent) => {\n * const themeComponent = event.detail.theme\n * console.log('Found theme component:', themeComponent)\n * })\n * ```\n */\nexport type ThemeHereIAmEvent = CustomEvent<{\n\ttheme: HTMLElement\n}>\n\n/**\n * Event name constant for theme discovery response.\n * @const {string}\n */\nexport const ThemeHereIAm = 'theme-here-i-am'","import {\n BehaviorSubject,\n Observable,\n fromEvent,\n timer,\n map,\n takeUntil,\n defaultIfEmpty,\n distinctUntilChanged,\n shareReplay,\n tap,\n switchMap,\n of\n} from 'rxjs'\nimport { ThemeHereIAm, ThemeHereIAmEvent, ThemeWhereAreYou } from './theme.events'\nimport type { SchmancyThemeComponent } from './theme.component'\nimport type { TSchmancyTheme } from './theme.interface'\nimport { state } from '../state'\n\ninterface ThemeSettings {\n scheme: 'dark' | 'light' | 'auto'\n color: string\n}\n\n// Theme settings — persists to localStorage under namespace `schmancy/theme`.\nconst ThemeContext = state<ThemeSettings>('schmancy/theme').local({\n scheme: 'auto',\n color: '#6200ee',\n})\n\n/**\n * Theme Service - Provides centralized theme management for Schmancy components.\n *\n * This service acts as a singleton interface to interact with the theme system,\n * providing reactive observables for theme state and methods to control theming.\n *\n * @example\n * ```typescript\n * import { theme } from '@schmancy/theme'\n *\n * // Subscribe to theme changes\n * theme.scheme$.subscribe(scheme => {\n * console.log('Current scheme:', scheme) // 'light' | 'dark' | 'auto'\n * })\n *\n * // Get current values synchronously\n * const currentScheme = theme.scheme\n * const currentColor = theme.color\n *\n * // Toggle between light and dark mode\n * theme.toggleScheme()\n *\n * // Set specific scheme\n * theme.setScheme('dark')\n *\n * // Check if dark mode is active\n * theme.isDarkMode().subscribe(isDark => {\n * console.log('Is dark mode:', isDark)\n * })\n * ```\n */\nclass ThemeService {\n private static instance: ThemeService\n\n // Observable properties for theme values\n private _theme$ = new BehaviorSubject<Partial<TSchmancyTheme>>({})\n private _themeComponent$ = new BehaviorSubject<SchmancyThemeComponent | null>(null)\n private _fullscreen$ = new BehaviorSubject<boolean>(false)\n private _bottomOffset$ = new BehaviorSubject<number>(0)\n\n // Public observables derived from context\n public readonly scheme$ = ThemeContext.$.pipe(\n map(settings => settings.scheme),\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n public readonly color$ = ThemeContext.$.pipe(\n map(settings => settings.color),\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n public readonly theme$ = this._theme$.asObservable().pipe(\n distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)),\n shareReplay(1)\n )\n\n public readonly themeComponent$ = this._themeComponent$.asObservable().pipe(\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n public readonly fullscreen$ = this._fullscreen$.asObservable().pipe(\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n public readonly bottomOffset$ = this._bottomOffset$.asObservable().pipe(\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n // Getters for synchronous access to current values\n get scheme(): 'dark' | 'light' | 'auto' {\n return ThemeContext.value.scheme\n }\n\n get color(): string {\n return ThemeContext.value.color\n }\n\n get theme(): Partial<TSchmancyTheme> {\n return this._theme$.getValue()\n }\n\n get themeComponent(): SchmancyThemeComponent | null {\n return this._themeComponent$.getValue()\n }\n\n get fullscreen(): boolean {\n return this._fullscreen$.getValue()\n }\n\n get bottomOffset(): number {\n return this._bottomOffset$.getValue()\n }\n\n // Computed observable for actual scheme (resolving 'auto')\n public readonly resolvedScheme$ = this.scheme$.pipe(\n switchMap(scheme => {\n if (scheme === 'auto') {\n // Listen to system preference changes\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')\n return new Observable<'dark' | 'light'>(subscriber => {\n const handler = (e: MediaQueryListEvent) => {\n subscriber.next(e.matches ? 'dark' : 'light')\n }\n mediaQuery.addEventListener('change', handler)\n\n // Emit initial value\n subscriber.next(mediaQuery.matches ? 'dark' : 'light')\n\n // Cleanup\n return () => mediaQuery.removeEventListener('change', handler)\n })\n }\n return of(scheme as 'dark' | 'light')\n }),\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n constructor() {\n this.discoverTheme()\n }\n\n /**\n * Discover the nearest theme component in the DOM.\n * This method can be called to refresh the theme discovery process.\n *\n * @returns {Observable<SchmancyThemeComponent | null>} Observable that emits the discovered theme component or null\n *\n * @example\n * ```typescript\n * theme.discoverTheme().subscribe(component => {\n * if (component) {\n * console.log('Theme component found:', component)\n * } else {\n * console.log('No theme component found')\n * }\n * })\n * ```\n */\n public discoverTheme(): Observable<SchmancyThemeComponent | null> {\n // Dispatch discovery event and wait for response\n return fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n takeUntil(timer(100)), // Wait up to 100ms for response\n map(e => e.detail.theme as SchmancyThemeComponent),\n defaultIfEmpty(null),\n tap(themeComponent => {\n if (themeComponent) {\n this.registerThemeComponent(themeComponent)\n }\n })\n ).pipe(\n tap(() => {\n // Trigger theme discovery\n window.dispatchEvent(\n new CustomEvent(ThemeWhereAreYou, {\n bubbles: true,\n composed: true,\n })\n )\n }),\n switchMap(() =>\n fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n takeUntil(timer(100)),\n map(e => e.detail.theme as SchmancyThemeComponent),\n defaultIfEmpty(null),\n tap(themeComponent => {\n if (themeComponent) {\n this.registerThemeComponent(themeComponent)\n }\n })\n )\n )\n )\n }\n\n /**\n * Register a theme component and subscribe to its changes.\n * This is typically called internally by theme components when they mount or update.\n *\n * @param {SchmancyThemeComponent} component - The theme component to register\n *\n * @internal\n */\n public registerThemeComponent(component: SchmancyThemeComponent): void {\n this._themeComponent$.next(component)\n\n // Update values from the component\n ThemeContext.set({ scheme: component.scheme, color: component.color })\n this._theme$.next(component.theme)\n }\n\n /**\n * Update theme values. Usually called internally by theme components.\n *\n * @param {Object} values - Theme values to update\n * @param {'dark' | 'light' | 'auto'} [values.scheme] - Color scheme to set\n * @param {string} [values.color] - Primary color in hex format\n * @param {Partial<TSchmancyTheme>} [values.theme] - Theme configuration object\n *\n * @internal\n */\n public updateTheme(values: {\n scheme?: 'dark' | 'light' | 'auto'\n color?: string\n theme?: Partial<TSchmancyTheme>\n }): void {\n const updates: Partial<ThemeSettings> = {}\n if (values.scheme !== undefined) {\n updates.scheme = values.scheme\n }\n if (values.color !== undefined) {\n updates.color = values.color\n }\n if (Object.keys(updates).length > 0) {\n ThemeContext.set(updates)\n }\n if (values.theme !== undefined) {\n this._theme$.next(values.theme)\n }\n }\n\n /**\n * Set the color scheme for the application.\n *\n * @param {'dark' | 'light' | 'auto'} scheme - The color scheme to set\n *\n * @example\n * ```typescript\n * // Set to dark mode\n * theme.setScheme('dark')\n *\n * // Set to auto (follows system preference)\n * theme.setScheme('auto')\n * ```\n */\n public setScheme(scheme: 'dark' | 'light' | 'auto'): void {\n const component = this.themeComponent\n if (component) {\n component.scheme = scheme\n ThemeContext.set({ scheme })\n } else {\n console.warn('No theme component found. Scheme change may not persist.')\n ThemeContext.set({ scheme })\n }\n }\n\n /**\n * Set the primary color for the theme.\n *\n * @param {string} color - Primary color in hex format (e.g., '#6200ee')\n *\n * @example\n * ```typescript\n * // Set primary color to purple\n * theme.setColor('#6200ee')\n *\n * // Set primary color to blue\n * theme.setColor('#2196f3')\n * ```\n */\n public setColor(color: string): void {\n const component = this.themeComponent\n if (component) {\n component.color = color\n ThemeContext.set({ color })\n } else {\n console.warn('No theme component found. Color change may not persist.')\n ThemeContext.set({ color })\n }\n }\n\n /**\n * Check if dark mode is currently active.\n * This resolves 'auto' scheme to the actual value based on system preference.\n *\n * @returns {Observable<boolean>} Observable that emits true if dark mode is active, false otherwise\n *\n * @example\n * ```typescript\n * theme.isDarkMode().subscribe(isDark => {\n * if (isDark) {\n * console.log('Dark mode is active')\n * } else {\n * console.log('Light mode is active')\n * }\n * })\n * ```\n */\n public isDarkMode(): Observable<boolean> {\n return this.resolvedScheme$.pipe(\n map(scheme => scheme === 'dark')\n )\n }\n\n /**\n * Toggle between light and dark mode.\n * If currently in 'auto' mode, defaults to 'light'.\n *\n * @example\n * ```typescript\n * // Toggle theme on button click\n * button.addEventListener('click', () => {\n * theme.toggleScheme()\n * })\n * ```\n */\n public toggleScheme(): void {\n const currentScheme = this.scheme\n const newScheme = currentScheme === 'dark' ? 'light' :\n currentScheme === 'light' ? 'dark' :\n 'light' // If 'auto', default to 'light'\n this.setScheme(newScheme)\n }\n\n /**\n * Get the current value of a CSS variable from the theme.\n *\n * @param {string} variableName - Name of the CSS variable (without '--schmancy-' prefix)\n * @returns {string} The CSS variable value or empty string if not found\n *\n * @example\n * ```typescript\n * // Get primary color variable\n * const primaryColor = theme.getCSSVariable('color-primary')\n *\n * // Get surface color\n * const surfaceColor = theme.getCSSVariable('color-surface')\n * ```\n */\n public getCSSVariable(variableName: string): string {\n const component = this.themeComponent\n if (component) {\n const host = component.root ? document.body : (component.shadowRoot?.host as HTMLElement)\n if (host) {\n return getComputedStyle(host).getPropertyValue(`--schmancy-${variableName}`).trim()\n }\n }\n return ''\n }\n\n /**\n * Subscribe to changes of a specific CSS variable.\n *\n * @param {string} variableName - Name of the CSS variable to watch (without '--schmancy-' prefix)\n * @returns {Observable<string>} Observable that emits the CSS variable value when it changes\n *\n * @example\n * ```typescript\n * // Watch for primary color changes\n * theme.watchCSSVariable('color-primary').subscribe(color => {\n * console.log('Primary color changed to:', color)\n * })\n *\n * // Watch for surface color changes\n * theme.watchCSSVariable('color-surface').subscribe(color => {\n * console.log('Surface color changed to:', color)\n * })\n * ```\n */\n public watchCSSVariable(variableName: string): Observable<string> {\n return this.theme$.pipe(\n map(() => this.getCSSVariable(variableName)),\n distinctUntilChanged()\n )\n }\n\n /**\n * Set the fullscreen state for the application.\n * This emits a custom event that navigation components can listen to.\n *\n * @param {boolean} value - Whether fullscreen mode is active\n *\n * @example\n * ```typescript\n * // Enter fullscreen mode\n * theme.setFullscreen(true)\n *\n * // Exit fullscreen mode\n * theme.setFullscreen(false)\n * ```\n */\n public setFullscreen(value: boolean): void {\n this._fullscreen$.next(value)\n\n // Emit custom event for components to listen to\n window.dispatchEvent(\n new CustomEvent('fullscreen', {\n detail: value,\n bubbles: true,\n composed: true\n })\n )\n }\n\n /**\n * Toggle fullscreen mode.\n *\n * @example\n * ```typescript\n * // Toggle fullscreen mode on button click\n * button.addEventListener('click', () => {\n * theme.toggleFullscreen()\n * })\n * ```\n */\n public toggleFullscreen(): void {\n this.setFullscreen(!this.fullscreen)\n }\n\n /**\n * Set the bottom offset for viewport calculations.\n * Used by navigation bars to inform fullHeight directive of reserved space.\n *\n * @param {number} value - Bottom offset in pixels\n *\n * @example\n * ```typescript\n * // Set bottom offset when nav bar is visible\n * theme.setBottomOffset(80)\n *\n * // Clear bottom offset when nav bar is hidden\n * theme.setBottomOffset(0)\n * ```\n */\n public setBottomOffset(value: number): void {\n this._bottomOffset$.next(value)\n }\n\n /**\n * Convenience method to update theme state including fullscreen.\n * Can be called with next() like syntax for familiarity.\n *\n * @param {Object} values - Theme values to update\n * @param {boolean} [values.fullscreen] - Fullscreen state\n * @param {'dark' | 'light' | 'auto'} [values.scheme] - Color scheme\n * @param {string} [values.color] - Primary color\n *\n * @example\n * ```typescript\n * // Set fullscreen mode\n * theme.next({ fullscreen: true })\n *\n * // Update multiple values\n * theme.next({\n * fullscreen: true,\n * scheme: 'dark'\n * })\n * ```\n */\n public next(values: {\n fullscreen?: boolean\n scheme?: 'dark' | 'light' | 'auto'\n color?: string\n }): void {\n if (values.fullscreen !== undefined) {\n this.setFullscreen(values.fullscreen)\n }\n if (values.scheme !== undefined) {\n this.setScheme(values.scheme)\n }\n if (values.color !== undefined) {\n this.setColor(values.color)\n }\n }\n\n /**\n * Get the singleton instance of ThemeService.\n *\n * @returns {ThemeService} The singleton ThemeService instance\n *\n * @internal\n */\n static getInstance(): ThemeService {\n if (!ThemeService.instance) {\n ThemeService.instance = new ThemeService()\n }\n return ThemeService.instance\n }\n}\n\n/**\n * Theme singleton. Reads and mutates the active theme (scheme, source color,\n * locale); persists the user's scheme choice. Components subscribe via\n * `theme.theme$` for changes.\n *\n * @service\n * @summary Theme service — active scheme, source color, locale.\n * @method next({ scheme?, source?, locale? }) - Update theme state.\n * @method theme$ - Observable<TSchmancyTheme>; emits on every theme change.\n * @method toggle() - Toggle between light and dark schemes.\n */\nexport const theme = ThemeService.getInstance()\nexport const schmancyTheme = theme // Alias for convenience\nexport default theme"],"mappings":";;AA+BA,IAAa,IAAmB,uBA2BnB,IAAe,mBCjCtB,IAAe,EAAqB,iBAAA,CAAkB,MAAM;CAChE,QAAQ;CACR,OAAO;CAAA,CAAA,EAmfI,IAjdb,MAAM,EAAA;CA2CJ,IAAA,SAAI;AACF,SAAO,EAAa,MAAM;;CAG5B,IAAA,QAAI;AACF,SAAO,EAAa,MAAM;;CAG5B,IAAA,QAAI;AACF,SAAO,KAAK,QAAQ,UAAA;;CAGtB,IAAA,iBAAI;AACF,SAAO,KAAK,iBAAiB,UAAA;;CAG/B,IAAA,aAAI;AACF,SAAO,KAAK,aAAa,UAAA;;CAG3B,IAAA,eAAI;AACF,SAAO,KAAK,eAAe,UAAA;;CA4B7B,cAAA;AAAA,OAAA,UAxFkB,IAAI,EAAyC,EAAA,CAAA,EAAA,KAAA,mBACpC,IAAI,EAA+C,KAAA,EAAA,KAAA,eACvD,IAAI,EAAA,CAAyB,EAAA,EAAA,KAAA,iBAC3B,IAAI,EAAwB,EAAA,EAAA,KAAA,UAG3B,EAAa,EAAE,KACvC,GAAI,MAAY,EAAS,OAAA,EACzB,GAAA,EACA,EAAY,EAAA,CAAA,EAAA,KAAA,SAGW,EAAa,EAAE,KACtC,GAAI,MAAY,EAAS,MAAA,EACzB,GAAA,EACA,EAAY,EAAA,CAAA,EAAA,KAAA,SAGW,KAAK,QAAQ,cAAA,CAAe,KACnD,GAAsB,GAAG,MAAM,KAAK,UAAU,EAAA,KAAO,KAAK,UAAU,EAAA,CAAA,EACpE,EAAY,EAAA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,CAAS;GACT,UAAA,CAAU;GAAA,CAAA,CAAA;;CAgBhB,mBAAA;AACE,OAAK,cAAA,CAAe,KAAK,WAAA;;CAkB3B,gBAAuB,GAAA;AACrB,OAAK,eAAe,KAAK,EAAA;;CAwB3B,KAAY,GAAA;AAAA,EAKN,EAAO,eALD,KAKgB,KACxB,KAAK,cAAc,EAAO,WAAA,EAExB,EAAO,WAFiB,KAEN,KACpB,KAAK,UAAU,EAAO,OAAA,EAEpB,EAAO,UAFa,KAEH,KACnB,KAAK,SAAS,EAAO,MAAA;;CAWzB,OAAA,cAAO;AAIL,SAHK,AACH,EAAa,aAAW,IAAI,GAAA,EAEvB,EAAa;;EAeU,aAAA,EACrB,IAAgB;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"theme.service-BOWIT_5k.js","names":[],"sources":["../src/theme/theme.events.ts","../src/theme/theme.service.ts"],"sourcesContent":["/**\n * Theme discovery event system.\n *\n * These events facilitate communication between theme components and consumers,\n * allowing components to discover the nearest theme provider in the DOM hierarchy.\n */\n\n/**\n * Event dispatched by components to discover the nearest theme provider.\n * Theme components listen for this event and respond with ThemeHereIAmEvent.\n *\n * @event ThemeWhereAreYouEvent\n * @type {CustomEvent<void>}\n *\n * @example\n * ```typescript\n * // Dispatch discovery request\n * window.dispatchEvent(\n * new CustomEvent('theme-where-are-you', {\n * bubbles: true,\n * composed: true\n * })\n * )\n * ```\n */\nexport type ThemeWhereAreYouEvent = CustomEvent<void>\n\n/**\n * Event name constant for theme discovery request.\n * @const {string}\n */\nexport const ThemeWhereAreYou = 'theme-where-are-you'\n\n/**\n * Event dispatched by theme components in response to discovery requests.\n * Contains reference to the theme component element.\n *\n * @event ThemeHereIAmEvent\n * @type {CustomEvent<{theme: HTMLElement}>}\n * @property {HTMLElement} detail.theme - The theme component element\n *\n * @example\n * ```typescript\n * // Listen for theme response\n * window.addEventListener('theme-here-i-am', (event: ThemeHereIAmEvent) => {\n * const themeComponent = event.detail.theme\n * console.log('Found theme component:', themeComponent)\n * })\n * ```\n */\nexport type ThemeHereIAmEvent = CustomEvent<{\n\ttheme: HTMLElement\n}>\n\n/**\n * Event name constant for theme discovery response.\n * @const {string}\n */\nexport const ThemeHereIAm = 'theme-here-i-am'","import {\n BehaviorSubject,\n Observable,\n fromEvent,\n timer,\n map,\n takeUntil,\n defaultIfEmpty,\n distinctUntilChanged,\n shareReplay,\n tap,\n switchMap,\n of\n} from 'rxjs'\nimport { ThemeHereIAm, ThemeHereIAmEvent, ThemeWhereAreYou } from './theme.events'\nimport type { SchmancyThemeComponent } from './theme.component'\nimport type { TSchmancyTheme } from './theme.interface'\nimport { state } from '../state'\n\ninterface ThemeSettings {\n scheme: 'dark' | 'light' | 'auto'\n color: string\n}\n\n// Theme settings — persists to localStorage under namespace `schmancy/theme`.\nconst ThemeContext = state<ThemeSettings>('schmancy/theme').local({\n scheme: 'auto',\n color: '#6200ee',\n})\n\n/**\n * Theme Service - Provides centralized theme management for Schmancy components.\n *\n * This service acts as a singleton interface to interact with the theme system,\n * providing reactive observables for theme state and methods to control theming.\n *\n * @example\n * ```typescript\n * import { theme } from '@schmancy/theme'\n *\n * // Subscribe to theme changes\n * theme.scheme$.subscribe(scheme => {\n * console.log('Current scheme:', scheme) // 'light' | 'dark' | 'auto'\n * })\n *\n * // Get current values synchronously\n * const currentScheme = theme.scheme\n * const currentColor = theme.color\n *\n * // Toggle between light and dark mode\n * theme.toggleScheme()\n *\n * // Set specific scheme\n * theme.setScheme('dark')\n *\n * // Check if dark mode is active\n * theme.isDarkMode().subscribe(isDark => {\n * console.log('Is dark mode:', isDark)\n * })\n * ```\n */\nclass ThemeService {\n private static instance: ThemeService\n\n // Observable properties for theme values\n private _theme$ = new BehaviorSubject<Partial<TSchmancyTheme>>({})\n private _themeComponent$ = new BehaviorSubject<SchmancyThemeComponent | null>(null)\n private _fullscreen$ = new BehaviorSubject<boolean>(false)\n private _bottomOffset$ = new BehaviorSubject<number>(0)\n\n // Public observables derived from context\n public readonly scheme$ = ThemeContext.$.pipe(\n map(settings => settings.scheme),\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n public readonly color$ = ThemeContext.$.pipe(\n map(settings => settings.color),\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n public readonly theme$ = this._theme$.asObservable().pipe(\n distinctUntilChanged((a, b) => JSON.stringify(a) === JSON.stringify(b)),\n shareReplay(1)\n )\n\n public readonly themeComponent$ = this._themeComponent$.asObservable().pipe(\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n public readonly fullscreen$ = this._fullscreen$.asObservable().pipe(\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n public readonly bottomOffset$ = this._bottomOffset$.asObservable().pipe(\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n // Getters for synchronous access to current values\n get scheme(): 'dark' | 'light' | 'auto' {\n return ThemeContext.value.scheme\n }\n\n get color(): string {\n return ThemeContext.value.color\n }\n\n get theme(): Partial<TSchmancyTheme> {\n return this._theme$.getValue()\n }\n\n get themeComponent(): SchmancyThemeComponent | null {\n return this._themeComponent$.getValue()\n }\n\n get fullscreen(): boolean {\n return this._fullscreen$.getValue()\n }\n\n get bottomOffset(): number {\n return this._bottomOffset$.getValue()\n }\n\n // Computed observable for actual scheme (resolving 'auto')\n public readonly resolvedScheme$ = this.scheme$.pipe(\n switchMap(scheme => {\n if (scheme === 'auto') {\n // Listen to system preference changes\n const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)')\n return new Observable<'dark' | 'light'>(subscriber => {\n const handler = (e: MediaQueryListEvent) => {\n subscriber.next(e.matches ? 'dark' : 'light')\n }\n mediaQuery.addEventListener('change', handler)\n\n // Emit initial value\n subscriber.next(mediaQuery.matches ? 'dark' : 'light')\n\n // Cleanup\n return () => mediaQuery.removeEventListener('change', handler)\n })\n }\n return of(scheme as 'dark' | 'light')\n }),\n distinctUntilChanged(),\n shareReplay(1)\n )\n\n constructor() {\n this.discoverTheme()\n }\n\n /**\n * Discover the nearest theme component in the DOM.\n * This method can be called to refresh the theme discovery process.\n *\n * @returns {Observable<SchmancyThemeComponent | null>} Observable that emits the discovered theme component or null\n *\n * @example\n * ```typescript\n * theme.discoverTheme().subscribe(component => {\n * if (component) {\n * console.log('Theme component found:', component)\n * } else {\n * console.log('No theme component found')\n * }\n * })\n * ```\n */\n public discoverTheme(): Observable<SchmancyThemeComponent | null> {\n // Dispatch discovery event and wait for response\n return fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n takeUntil(timer(100)), // Wait up to 100ms for response\n map(e => e.detail.theme as SchmancyThemeComponent),\n defaultIfEmpty(null),\n tap(themeComponent => {\n if (themeComponent) {\n this.registerThemeComponent(themeComponent)\n }\n })\n ).pipe(\n tap(() => {\n // Trigger theme discovery\n window.dispatchEvent(\n new CustomEvent(ThemeWhereAreYou, {\n bubbles: true,\n composed: true,\n })\n )\n }),\n switchMap(() =>\n fromEvent<ThemeHereIAmEvent>(window, ThemeHereIAm).pipe(\n takeUntil(timer(100)),\n map(e => e.detail.theme as SchmancyThemeComponent),\n defaultIfEmpty(null),\n tap(themeComponent => {\n if (themeComponent) {\n this.registerThemeComponent(themeComponent)\n }\n })\n )\n )\n )\n }\n\n /**\n * Register a theme component and subscribe to its changes.\n * This is typically called internally by theme components when they mount or update.\n *\n * @param {SchmancyThemeComponent} component - The theme component to register\n *\n * @internal\n */\n public registerThemeComponent(component: SchmancyThemeComponent): void {\n this._themeComponent$.next(component)\n\n // Update values from the component\n ThemeContext.set({ scheme: component.scheme, color: component.color })\n this._theme$.next(component.theme)\n }\n\n /**\n * Update theme values. Usually called internally by theme components.\n *\n * @param {Object} values - Theme values to update\n * @param {'dark' | 'light' | 'auto'} [values.scheme] - Color scheme to set\n * @param {string} [values.color] - Primary color in hex format\n * @param {Partial<TSchmancyTheme>} [values.theme] - Theme configuration object\n *\n * @internal\n */\n public updateTheme(values: {\n scheme?: 'dark' | 'light' | 'auto'\n color?: string\n theme?: Partial<TSchmancyTheme>\n }): void {\n const updates: Partial<ThemeSettings> = {}\n if (values.scheme !== undefined) {\n updates.scheme = values.scheme\n }\n if (values.color !== undefined) {\n updates.color = values.color\n }\n if (Object.keys(updates).length > 0) {\n ThemeContext.set(updates)\n }\n if (values.theme !== undefined) {\n this._theme$.next(values.theme)\n }\n }\n\n /**\n * Set the color scheme for the application.\n *\n * @param {'dark' | 'light' | 'auto'} scheme - The color scheme to set\n *\n * @example\n * ```typescript\n * // Set to dark mode\n * theme.setScheme('dark')\n *\n * // Set to auto (follows system preference)\n * theme.setScheme('auto')\n * ```\n */\n public setScheme(scheme: 'dark' | 'light' | 'auto'): void {\n const component = this.themeComponent\n if (component) {\n component.scheme = scheme\n ThemeContext.set({ scheme })\n } else {\n console.warn('No theme component found. Scheme change may not persist.')\n ThemeContext.set({ scheme })\n }\n }\n\n /**\n * Set the primary color for the theme.\n *\n * @param {string} color - Primary color in hex format (e.g., '#6200ee')\n *\n * @example\n * ```typescript\n * // Set primary color to purple\n * theme.setColor('#6200ee')\n *\n * // Set primary color to blue\n * theme.setColor('#2196f3')\n * ```\n */\n public setColor(color: string): void {\n const component = this.themeComponent\n if (component) {\n component.color = color\n ThemeContext.set({ color })\n } else {\n console.warn('No theme component found. Color change may not persist.')\n ThemeContext.set({ color })\n }\n }\n\n /**\n * Check if dark mode is currently active.\n * This resolves 'auto' scheme to the actual value based on system preference.\n *\n * @returns {Observable<boolean>} Observable that emits true if dark mode is active, false otherwise\n *\n * @example\n * ```typescript\n * theme.isDarkMode().subscribe(isDark => {\n * if (isDark) {\n * console.log('Dark mode is active')\n * } else {\n * console.log('Light mode is active')\n * }\n * })\n * ```\n */\n public isDarkMode(): Observable<boolean> {\n return this.resolvedScheme$.pipe(\n map(scheme => scheme === 'dark')\n )\n }\n\n /**\n * Toggle between light and dark mode.\n * If currently in 'auto' mode, defaults to 'light'.\n *\n * @example\n * ```typescript\n * // Toggle theme on button click\n * button.addEventListener('click', () => {\n * theme.toggleScheme()\n * })\n * ```\n */\n public toggleScheme(): void {\n const currentScheme = this.scheme\n const newScheme = currentScheme === 'dark' ? 'light' :\n currentScheme === 'light' ? 'dark' :\n 'light' // If 'auto', default to 'light'\n this.setScheme(newScheme)\n }\n\n /**\n * Get the current value of a CSS variable from the theme.\n *\n * @param {string} variableName - Name of the CSS variable (without '--schmancy-' prefix)\n * @returns {string} The CSS variable value or empty string if not found\n *\n * @example\n * ```typescript\n * // Get primary color variable\n * const primaryColor = theme.getCSSVariable('color-primary')\n *\n * // Get surface color\n * const surfaceColor = theme.getCSSVariable('color-surface')\n * ```\n */\n public getCSSVariable(variableName: string): string {\n const component = this.themeComponent\n if (component) {\n const host = component.root ? document.body : (component.shadowRoot?.host as HTMLElement)\n if (host) {\n return getComputedStyle(host).getPropertyValue(`--schmancy-${variableName}`).trim()\n }\n }\n return ''\n }\n\n /**\n * Subscribe to changes of a specific CSS variable.\n *\n * @param {string} variableName - Name of the CSS variable to watch (without '--schmancy-' prefix)\n * @returns {Observable<string>} Observable that emits the CSS variable value when it changes\n *\n * @example\n * ```typescript\n * // Watch for primary color changes\n * theme.watchCSSVariable('color-primary').subscribe(color => {\n * console.log('Primary color changed to:', color)\n * })\n *\n * // Watch for surface color changes\n * theme.watchCSSVariable('color-surface').subscribe(color => {\n * console.log('Surface color changed to:', color)\n * })\n * ```\n */\n public watchCSSVariable(variableName: string): Observable<string> {\n return this.theme$.pipe(\n map(() => this.getCSSVariable(variableName)),\n distinctUntilChanged()\n )\n }\n\n /**\n * Set the fullscreen state for the application.\n * This emits a custom event that navigation components can listen to.\n *\n * @param {boolean} value - Whether fullscreen mode is active\n *\n * @example\n * ```typescript\n * // Enter fullscreen mode\n * theme.setFullscreen(true)\n *\n * // Exit fullscreen mode\n * theme.setFullscreen(false)\n * ```\n */\n public setFullscreen(value: boolean): void {\n this._fullscreen$.next(value)\n\n // Emit custom event for components to listen to\n window.dispatchEvent(\n new CustomEvent('fullscreen', {\n detail: value,\n bubbles: true,\n composed: true\n })\n )\n }\n\n /**\n * Toggle fullscreen mode.\n *\n * @example\n * ```typescript\n * // Toggle fullscreen mode on button click\n * button.addEventListener('click', () => {\n * theme.toggleFullscreen()\n * })\n * ```\n */\n public toggleFullscreen(): void {\n this.setFullscreen(!this.fullscreen)\n }\n\n /**\n * Set the bottom offset for viewport calculations.\n * Used by navigation bars to inform fullHeight directive of reserved space.\n *\n * @param {number} value - Bottom offset in pixels\n *\n * @example\n * ```typescript\n * // Set bottom offset when nav bar is visible\n * theme.setBottomOffset(80)\n *\n * // Clear bottom offset when nav bar is hidden\n * theme.setBottomOffset(0)\n * ```\n */\n public setBottomOffset(value: number): void {\n this._bottomOffset$.next(value)\n }\n\n /**\n * Convenience method to update theme state including fullscreen.\n * Can be called with next() like syntax for familiarity.\n *\n * @param {Object} values - Theme values to update\n * @param {boolean} [values.fullscreen] - Fullscreen state\n * @param {'dark' | 'light' | 'auto'} [values.scheme] - Color scheme\n * @param {string} [values.color] - Primary color\n *\n * @example\n * ```typescript\n * // Set fullscreen mode\n * theme.next({ fullscreen: true })\n *\n * // Update multiple values\n * theme.next({\n * fullscreen: true,\n * scheme: 'dark'\n * })\n * ```\n */\n public next(values: {\n fullscreen?: boolean\n scheme?: 'dark' | 'light' | 'auto'\n color?: string\n }): void {\n if (values.fullscreen !== undefined) {\n this.setFullscreen(values.fullscreen)\n }\n if (values.scheme !== undefined) {\n this.setScheme(values.scheme)\n }\n if (values.color !== undefined) {\n this.setColor(values.color)\n }\n }\n\n /**\n * Get the singleton instance of ThemeService.\n *\n * @returns {ThemeService} The singleton ThemeService instance\n *\n * @internal\n */\n static getInstance(): ThemeService {\n if (!ThemeService.instance) {\n ThemeService.instance = new ThemeService()\n }\n return ThemeService.instance\n }\n}\n\n/**\n * Theme singleton. Reads and mutates the active theme (scheme, source color,\n * locale); persists the user's scheme choice. Components subscribe via\n * `theme.theme$` for changes.\n *\n * @service\n * @summary Theme service — active scheme, source color, locale.\n * @method next({ scheme?, source?, locale? }) - Update theme state.\n * @method theme$ - Observable<TSchmancyTheme>; emits on every theme change.\n * @method toggle() - Toggle between light and dark schemes.\n */\nexport const theme = ThemeService.getInstance()\nexport const schmancyTheme = theme // Alias for convenience\nexport default theme"],"mappings":";;AA+BA,IAAa,IAAmB,uBA2BnB,IAAe,mBCjCtB,IAAe,EAAqB,iBAAA,CAAkB,MAAM;CAChE,QAAQ;CACR,OAAO;CAAA,CAAA,EAmfI,IAjdb,MAAM,EAAA;CA2CJ,IAAA,SAAI;EACF,OAAO,EAAa,MAAM;;CAG5B,IAAA,QAAI;EACF,OAAO,EAAa,MAAM;;CAG5B,IAAA,QAAI;EACF,OAAO,KAAK,QAAQ,UAAA;;CAGtB,IAAA,iBAAI;EACF,OAAO,KAAK,iBAAiB,UAAA;;CAG/B,IAAA,aAAI;EACF,OAAO,KAAK,aAAa,UAAA;;CAG3B,IAAA,eAAI;EACF,OAAO,KAAK,eAAe,UAAA;;CA4B7B,cAAA;EAAA,KAAA,UAxFkB,IAAI,EAAyC,EAAA,CAAA,EAAA,KAAA,mBACpC,IAAI,EAA+C,KAAA,EAAA,KAAA,eACvD,IAAI,EAAA,CAAyB,EAAA,EAAA,KAAA,iBAC3B,IAAI,EAAwB,EAAA,EAAA,KAAA,UAG3B,EAAa,EAAE,KACvC,GAAI,MAAY,EAAS,OAAA,EACzB,GAAA,EACA,EAAY,EAAA,CAAA,EAAA,KAAA,SAGW,EAAa,EAAE,KACtC,GAAI,MAAY,EAAS,MAAA,EACzB,GAAA,EACA,EAAY,EAAA,CAAA,EAAA,KAAA,SAGW,KAAK,QAAQ,cAAA,CAAe,KACnD,GAAsB,GAAG,MAAM,KAAK,UAAU,EAAA,KAAO,KAAK,UAAU,EAAA,CAAA,EACpE,EAAY,EAAA,CAAA,EAAA,KAAA,kBAGoB,KAAK,iBAAiB,cAAA,CAAe,KACrE,GAAA,EACA,EAAY,EAAA,CAAA,EAAA,KAAA,cAGgB,KAAK,aAAa,cAAA,CAAe,KAC7D,GAAA,EACA,EA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B3B,KAAY,GAAA;EAAA,AAKN,EAAO,eALD,KAKgB,KACxB,KAAK,cAAc,EAAO,WAAA,EAExB,EAAO,WAFiB,KAEN,KACpB,KAAK,UAAU,EAAO,OAAA,EAEpB,EAAO,UAFa,KAEH,KACnB,KAAK,SAAS,EAAO,MAAA;;CAWzB,OAAA,cAAO;EAIL,OAHK,AACH,EAAa,aAAW,IAAI,GAAA,EAEvB,EAAa;;EAeU,aAAA,EACrB,IAAgB;AAAA,SAAA,KAAA,GAAA,KAAA,GAAA,KAAA,GAAA,KAAA"}
|
package/dist/tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","names":[],"sources":["../src/tooltip/tooltip.directive.ts"],"sourcesContent":["import { arrow, autoUpdate, computePosition, flip, offset, Placement, shift, Strategy } from '@floating-ui/dom'\nimport { Directive, directive, ElementPart, ElementPartInfo, PartType } from 'lit/directive.js'\nimport { fromEvent, Subscription } from 'rxjs'\n\n// Store tooltip data for elements\nconst tooltipMap = new WeakMap<\n\tElement,\n\t{\n\t\ttooltipElement: HTMLElement\n\t\tarrowElement?: HTMLElement\n\t\tcleanup?: () => void\n\t\tshowTimeout?: number\n\t\tsubscriptions?: Subscription[]\n\t}\n>()\n\nclass TooltipDirective extends Directive {\n\tconstructor(partInfo: ElementPartInfo) {\n\t\tsuper(partInfo)\n\t\tif (partInfo.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('The tooltip directive can only be used on elements')\n\t\t}\n\t}\n\n\trender(\n\t\ttext: string,\n\t\toptions: {\n\t\t\tposition?: 'top' | 'right' | 'bottom' | 'left'\n\t\t\tdelay?: number\n\t\t\tshowArrow?: boolean\n\t\t} = {},\n\t) {\n\t\treturn { text, options }\n\t}\n\n\tupdate(part: ElementPart, [text, options = {}]: [string, any]) {\n\t\tconst element = part.element as HTMLElement\n\t\tconst position = options?.position || 'top'\n\t\tconst delay = options?.delay || 300\n\t\tconst showArrow = options?.showArrow !== false // Default to true\n\n\t\t// Get or create tooltip data\n\t\tlet tooltipData = tooltipMap.get(element)\n\n\t\tif (!tooltipData) {\n\t\t\t// Create tooltip element\n\t\t\tconst tooltipElement = document.createElement('div')\n\t\t\ttooltipElement.className = 'schmancy-tooltip'\n\n\t\t\t// Apply styles\n\t\t\tObject.assign(tooltipElement.style, {\n\t\t\t\tposition: 'absolute',\n\t\t\t\tzIndex: '10000',\n\t\t\t\tbackgroundColor: 'var(--schmancy-sys-color-surface-highest, #333)',\n\t\t\t\tcolor: 'var(--schmancy-sys-color-surface-on, white)',\n\t\t\t\tpadding: '8px 12px',\n\t\t\t\tborderRadius: '4px',\n\t\t\t\tfontSize: '14px',\n\t\t\t\tfontWeight: 'normal',\n\t\t\t\tmaxWidth: '300px',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\topacity: '0',\n\t\t\t\ttransition: 'opacity 150ms ease',\n\t\t\t\tboxShadow: 'var(--schmancy-sys-elevation-2)',\n\t\t\t\ttextAlign: 'center',\n\t\t\t\t// Important: start with visibility hidden to avoid flash\n\t\t\t\tvisibility: 'hidden',\n\t\t\t})\n\n\t\t\t// Create arrow element if needed\n\t\t\tlet arrowElement: HTMLElement | undefined\n\t\t\tif (showArrow) {\n\t\t\t\tarrowElement = document.createElement('div')\n\t\t\t\tarrowElement.className = 'schmancy-tooltip-arrow'\n\t\t\t\tObject.assign(arrowElement.style, {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\twidth: '8px',\n\t\t\t\t\theight: '8px',\n\t\t\t\t\tbackground: 'inherit',\n\t\t\t\t\tvisibility: 'hidden',\n\t\t\t\t\t// We'll rotate this to create an arrow\n\t\t\t\t\ttransform: 'rotate(45deg)',\n\t\t\t\t})\n\t\t\t\ttooltipElement.appendChild(arrowElement)\n\t\t\t}\n\n\t\t\t// Set ARIA attributes\n\t\t\ttooltipElement.setAttribute('role', 'tooltip')\n\n\t\t\t// Generate unique ID\n\t\t\tconst tooltipId = `tooltip-${Math.random().toString(36).slice(2, 9)}`\n\t\t\ttooltipElement.id = tooltipId\n\t\t\telement.setAttribute('aria-describedby', tooltipId)\n\n\t\t\t// Add to document\n\t\t\tdocument.body.appendChild(tooltipElement)\n\n\t\t\t// Create tooltip data\n\t\t\ttooltipData = {\n\t\t\t\ttooltipElement,\n\t\t\t\tarrowElement,\n\t\t\t}\n\n\t\t\ttooltipMap.set(element, tooltipData)\n\n\t\t\t// Define show handler\n\t\t\tconst showTooltip = () => {\n\t\t\t\tif (tooltipData?.showTimeout) {\n\t\t\t\t\tclearTimeout(tooltipData.showTimeout)\n\t\t\t\t}\n\n\t\t\t\ttooltipData.showTimeout = window.setTimeout(() => {\n\t\t\t\t\t// Set content\n\t\t\t\t\ttooltipData.tooltipElement.textContent = text\n\n\t\t\t\t\t// Add arrow back if it was removed\n\t\t\t\t\tif (showArrow && tooltipData.arrowElement && !tooltipData.tooltipElement.contains(tooltipData.arrowElement)) {\n\t\t\t\t\t\ttooltipData.tooltipElement.appendChild(tooltipData.arrowElement)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Make sure element is visible first\n\t\t\t\t\ttooltipData.tooltipElement.style.visibility = 'visible'\n\n\t\t\t\t\t// Clean up existing positioning\n\t\t\t\t\tif (tooltipData.cleanup) {\n\t\t\t\t\t\ttooltipData.cleanup()\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set up positioning\n\t\t\t\t\ttooltipData.cleanup = autoUpdate(element, tooltipData.tooltipElement, () =>\n\t\t\t\t\t\tupdatePosition(element, tooltipData, position, showArrow),\n\t\t\t\t\t)\n\n\t\t\t\t\t// Make opacity 1 after positioning is set up\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\ttooltipData.tooltipElement.style.opacity = '1'\n\t\t\t\t\t})\n\t\t\t\t}, delay)\n\t\t\t}\n\n\t\t\t// Define hide handler\n\t\t\tconst hideTooltip = () => {\n\t\t\t\tif (tooltipData?.showTimeout) {\n\t\t\t\t\tclearTimeout(tooltipData.showTimeout)\n\t\t\t\t}\n\n\t\t\t\ttooltipData.tooltipElement.style.opacity = '0'\n\n\t\t\t\t// Set visibility to hidden after fade out\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\ttooltipData.tooltipElement.style.visibility = 'hidden'\n\t\t\t\t}, 150) // Match transition time\n\n\t\t\t\t// Clean up positioning\n\t\t\t\tif (tooltipData?.cleanup) {\n\t\t\t\t\ttooltipData.cleanup()\n\t\t\t\t\ttooltipData.cleanup = undefined\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add event listeners using fromEvent\n\t\t\tconst subscriptions = [\n\t\t\t\tfromEvent(element, 'mouseenter').subscribe(showTooltip),\n\t\t\t\tfromEvent(element, 'focus').subscribe(showTooltip),\n\t\t\t\tfromEvent(element, 'mouseleave').subscribe(hideTooltip),\n\t\t\t\tfromEvent(element, 'blur').subscribe(hideTooltip),\n\t\t\t\tfromEvent<KeyboardEvent>(document, 'keydown').subscribe((e: KeyboardEvent) => {\n\t\t\t\t\tif (e.key === 'Escape' && tooltipData?.tooltipElement.style.opacity === '1') {\n\t\t\t\t\t\thideTooltip()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t]\n\n\t\t\t// Store subscriptions for cleanup\n\t\t\ttooltipData.subscriptions = subscriptions\n\t\t} else {\n\t\t\t// Update content for existing tooltip\n\t\t\ttooltipData.tooltipElement.textContent = text\n\n\t\t\t// Update arrow visibility if needed\n\t\t\tif (tooltipData.arrowElement) {\n\t\t\t\ttooltipData.arrowElement.style.visibility = showArrow ? 'visible' : 'hidden'\n\t\t\t}\n\t\t}\n\n\t\treturn { text, options }\n\t}\n\n\tdisconnected(part: ElementPart) {\n\t\tconst element = part.element\n\t\tconst tooltipData = tooltipMap.get(element)\n\n\t\tif (tooltipData) {\n\t\t\t// Clean up subscriptions\n\t\t\tif (tooltipData.subscriptions) {\n\t\t\t\ttooltipData.subscriptions.forEach(subscription => subscription.unsubscribe())\n\t\t\t}\n\n\t\t\t// Clean up timeouts and positioning\n\t\t\tif (tooltipData.showTimeout) {\n\t\t\t\tclearTimeout(tooltipData.showTimeout)\n\t\t\t}\n\n\t\t\tif (tooltipData.cleanup) {\n\t\t\t\ttooltipData.cleanup()\n\t\t\t}\n\n\t\t\t// Remove tooltip element\n\t\t\tif (document.body.contains(tooltipData.tooltipElement)) {\n\t\t\t\tdocument.body.removeChild(tooltipData.tooltipElement)\n\t\t\t}\n\n\t\t\t// Remove ARIA attributes\n\t\t\tif (element.hasAttribute('aria-describedby')) {\n\t\t\t\telement.removeAttribute('aria-describedby')\n\t\t\t}\n\n\t\t\t// Remove from WeakMap\n\t\t\ttooltipMap.delete(element)\n\t\t}\n\t}\n}\n\n// Separate positioning function for clarity and reuse\nasync function updatePosition(element: HTMLElement, tooltipData: any, position: string, showArrow: boolean) {\n\t// Use floating-ui to compute position\n\tconst middleware = [\n\t\toffset(8), // Distance from the element\n\t\tflip({\n\t\t\tfallbackPlacements: ['top', 'right', 'bottom', 'left'].filter(p => p !== position) as Placement[],\n\t\t\tpadding: 5, // How far from the edges before flipping\n\t\t}),\n\t\tshift({ padding: 5 }), // Keep it within viewport bounds\n\t]\n\n\t// Add arrow middleware if needed\n\tif (showArrow && tooltipData.arrowElement) {\n\t\tmiddleware.push(arrow({ element: tooltipData.arrowElement }))\n\t}\n\n\tconst { x, y, placement, middlewareData } = await computePosition(element, tooltipData.tooltipElement, {\n\t\tplacement: position as Placement,\n\t\tmiddleware,\n\t\tstrategy: 'fixed' as Strategy, // Fixed positioning works better across contexts\n\t})\n\n\t// Apply position\n\tObject.assign(tooltipData.tooltipElement.style, {\n\t\tleft: `${x}px`,\n\t\ttop: `${y}px`,\n\t\tposition: 'fixed',\n\t})\n\n\t// Position the arrow if it exists\n\tif (showArrow && tooltipData.arrowElement && middlewareData.arrow) {\n\t\tconst { x: arrowX, y: arrowY } = middlewareData.arrow\n\n\t\t// Determine which side the arrow should be on based on placement\n\t\tconst staticSide =\n\t\t\t{\n\t\t\t\ttop: 'bottom',\n\t\t\t\tright: 'left',\n\t\t\t\tbottom: 'top',\n\t\t\t\tleft: 'right',\n\t\t\t}[placement.split('-')[0]] || 'bottom'\n\n\t\t// Position the arrow\n\t\tObject.assign(tooltipData.arrowElement.style, {\n\t\t\tleft: arrowX != null ? `${arrowX}px` : '',\n\t\t\ttop: arrowY != null ? `${arrowY}px` : '',\n\t\t\t[staticSide]: '-4px', // Position the arrow on the correct side\n\t\t\tvisibility: 'visible',\n\t\t})\n\t}\n}\n\nexport const tooltip = directive(TooltipDirective)\n"],"mappings":";;;AAKA,IAAM,oBAAa,IAAI,SAAA,EA+QV,IAAU,EApQvB,cAA+B,EAAA;CAC9B,YAAY,GAAA;AAEX,MADA,MAAM,EAAA,EACF,EAAS,SAAS,EAAS,QAC9B,OAAU,MAAM,qDAAA;;CAIlB,OACC,GACA,IAII,EAAA,EAAA;AAEJ,SAAO;GAAE,MAAA;GAAM,SAAA;GAAA;;CAGhB,OAAO,GAAA,CAAoB,GAAM,IAAU,EAAA,GAAA;EAC1C,IAAM,IAAU,EAAK,SACf,IAAW,GAAS,YAAY,OAChC,IAAQ,GAAS,SAAS,KAC1B,IAAA,CAAmC,MAAvB,GAAS,WAGvB,IAAc,EAAW,IAAI,EAAA;AAEjC,MAAK,EAqIJ,GAAY,eAAe,cAAc,GAGrC,EAAY,iBACf,EAAY,aAAa,MAAM,aAAa,IAAY,YAAY;OAzIpD;GAEjB,IAAM,IAAiB,SAAS,cAAc,MAAA,EAwB1C;AAvBJ,KAAe,YAAY,oBAG3B,OAAO,OAAO,EAAe,OAAO;IACnC,UAAU;IACV,QAAQ;IACR,iBAAiB;IACjB,OAAO;IACP,SAAS;IACT,cAAc;IACd,UAAU;IACV,YAAY;IACZ,UAAU;IACV,eAAe;IACf,SAAS;IACT,YAAY;IACZ,WAAW;IACX,WAAW;IAEX,YAAY;IAAA,CAAA,EAKT,MACH,IAAe,SAAS,cAAc,MAAA,EACtC,EAAa,YAAY,0BACzB,OAAO,OAAO,EAAa,OAAO;IACjC,UAAU;IACV,O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AAA,EAIT,SAAS,KAAK,SAAS,EAAY,eAAA,IACtC,SAAS,KAAK,YAAY,EAAY,eAAA,EAInC,EAAQ,aAAa,mBAAA,IACxB,EAAQ,gBAAgB,mBAAA,EAIzB,EAAW,OAAO,EAAA;;EAAA;AAAA,SAAA,KAAA"}
|
|
1
|
+
{"version":3,"file":"tooltip.js","names":[],"sources":["../src/tooltip/tooltip.directive.ts"],"sourcesContent":["import { arrow, autoUpdate, computePosition, flip, offset, Placement, shift, Strategy } from '@floating-ui/dom'\nimport { Directive, directive, ElementPart, ElementPartInfo, PartType } from 'lit/directive.js'\nimport { fromEvent, Subscription } from 'rxjs'\n\n// Store tooltip data for elements\nconst tooltipMap = new WeakMap<\n\tElement,\n\t{\n\t\ttooltipElement: HTMLElement\n\t\tarrowElement?: HTMLElement\n\t\tcleanup?: () => void\n\t\tshowTimeout?: number\n\t\tsubscriptions?: Subscription[]\n\t}\n>()\n\nclass TooltipDirective extends Directive {\n\tconstructor(partInfo: ElementPartInfo) {\n\t\tsuper(partInfo)\n\t\tif (partInfo.type !== PartType.ELEMENT) {\n\t\t\tthrow new Error('The tooltip directive can only be used on elements')\n\t\t}\n\t}\n\n\trender(\n\t\ttext: string,\n\t\toptions: {\n\t\t\tposition?: 'top' | 'right' | 'bottom' | 'left'\n\t\t\tdelay?: number\n\t\t\tshowArrow?: boolean\n\t\t} = {},\n\t) {\n\t\treturn { text, options }\n\t}\n\n\tupdate(part: ElementPart, [text, options = {}]: [string, any]) {\n\t\tconst element = part.element as HTMLElement\n\t\tconst position = options?.position || 'top'\n\t\tconst delay = options?.delay || 300\n\t\tconst showArrow = options?.showArrow !== false // Default to true\n\n\t\t// Get or create tooltip data\n\t\tlet tooltipData = tooltipMap.get(element)\n\n\t\tif (!tooltipData) {\n\t\t\t// Create tooltip element\n\t\t\tconst tooltipElement = document.createElement('div')\n\t\t\ttooltipElement.className = 'schmancy-tooltip'\n\n\t\t\t// Apply styles\n\t\t\tObject.assign(tooltipElement.style, {\n\t\t\t\tposition: 'absolute',\n\t\t\t\tzIndex: '10000',\n\t\t\t\tbackgroundColor: 'var(--schmancy-sys-color-surface-highest, #333)',\n\t\t\t\tcolor: 'var(--schmancy-sys-color-surface-on, white)',\n\t\t\t\tpadding: '8px 12px',\n\t\t\t\tborderRadius: '4px',\n\t\t\t\tfontSize: '14px',\n\t\t\t\tfontWeight: 'normal',\n\t\t\t\tmaxWidth: '300px',\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\topacity: '0',\n\t\t\t\ttransition: 'opacity 150ms ease',\n\t\t\t\tboxShadow: 'var(--schmancy-sys-elevation-2)',\n\t\t\t\ttextAlign: 'center',\n\t\t\t\t// Important: start with visibility hidden to avoid flash\n\t\t\t\tvisibility: 'hidden',\n\t\t\t})\n\n\t\t\t// Create arrow element if needed\n\t\t\tlet arrowElement: HTMLElement | undefined\n\t\t\tif (showArrow) {\n\t\t\t\tarrowElement = document.createElement('div')\n\t\t\t\tarrowElement.className = 'schmancy-tooltip-arrow'\n\t\t\t\tObject.assign(arrowElement.style, {\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\twidth: '8px',\n\t\t\t\t\theight: '8px',\n\t\t\t\t\tbackground: 'inherit',\n\t\t\t\t\tvisibility: 'hidden',\n\t\t\t\t\t// We'll rotate this to create an arrow\n\t\t\t\t\ttransform: 'rotate(45deg)',\n\t\t\t\t})\n\t\t\t\ttooltipElement.appendChild(arrowElement)\n\t\t\t}\n\n\t\t\t// Set ARIA attributes\n\t\t\ttooltipElement.setAttribute('role', 'tooltip')\n\n\t\t\t// Generate unique ID\n\t\t\tconst tooltipId = `tooltip-${Math.random().toString(36).slice(2, 9)}`\n\t\t\ttooltipElement.id = tooltipId\n\t\t\telement.setAttribute('aria-describedby', tooltipId)\n\n\t\t\t// Add to document\n\t\t\tdocument.body.appendChild(tooltipElement)\n\n\t\t\t// Create tooltip data\n\t\t\ttooltipData = {\n\t\t\t\ttooltipElement,\n\t\t\t\tarrowElement,\n\t\t\t}\n\n\t\t\ttooltipMap.set(element, tooltipData)\n\n\t\t\t// Define show handler\n\t\t\tconst showTooltip = () => {\n\t\t\t\tif (tooltipData?.showTimeout) {\n\t\t\t\t\tclearTimeout(tooltipData.showTimeout)\n\t\t\t\t}\n\n\t\t\t\ttooltipData.showTimeout = window.setTimeout(() => {\n\t\t\t\t\t// Set content\n\t\t\t\t\ttooltipData.tooltipElement.textContent = text\n\n\t\t\t\t\t// Add arrow back if it was removed\n\t\t\t\t\tif (showArrow && tooltipData.arrowElement && !tooltipData.tooltipElement.contains(tooltipData.arrowElement)) {\n\t\t\t\t\t\ttooltipData.tooltipElement.appendChild(tooltipData.arrowElement)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Make sure element is visible first\n\t\t\t\t\ttooltipData.tooltipElement.style.visibility = 'visible'\n\n\t\t\t\t\t// Clean up existing positioning\n\t\t\t\t\tif (tooltipData.cleanup) {\n\t\t\t\t\t\ttooltipData.cleanup()\n\t\t\t\t\t}\n\n\t\t\t\t\t// Set up positioning\n\t\t\t\t\ttooltipData.cleanup = autoUpdate(element, tooltipData.tooltipElement, () =>\n\t\t\t\t\t\tupdatePosition(element, tooltipData, position, showArrow),\n\t\t\t\t\t)\n\n\t\t\t\t\t// Make opacity 1 after positioning is set up\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\ttooltipData.tooltipElement.style.opacity = '1'\n\t\t\t\t\t})\n\t\t\t\t}, delay)\n\t\t\t}\n\n\t\t\t// Define hide handler\n\t\t\tconst hideTooltip = () => {\n\t\t\t\tif (tooltipData?.showTimeout) {\n\t\t\t\t\tclearTimeout(tooltipData.showTimeout)\n\t\t\t\t}\n\n\t\t\t\ttooltipData.tooltipElement.style.opacity = '0'\n\n\t\t\t\t// Set visibility to hidden after fade out\n\t\t\t\tsetTimeout(() => {\n\t\t\t\t\ttooltipData.tooltipElement.style.visibility = 'hidden'\n\t\t\t\t}, 150) // Match transition time\n\n\t\t\t\t// Clean up positioning\n\t\t\t\tif (tooltipData?.cleanup) {\n\t\t\t\t\ttooltipData.cleanup()\n\t\t\t\t\ttooltipData.cleanup = undefined\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Add event listeners using fromEvent\n\t\t\tconst subscriptions = [\n\t\t\t\tfromEvent(element, 'mouseenter').subscribe(showTooltip),\n\t\t\t\tfromEvent(element, 'focus').subscribe(showTooltip),\n\t\t\t\tfromEvent(element, 'mouseleave').subscribe(hideTooltip),\n\t\t\t\tfromEvent(element, 'blur').subscribe(hideTooltip),\n\t\t\t\tfromEvent<KeyboardEvent>(document, 'keydown').subscribe((e: KeyboardEvent) => {\n\t\t\t\t\tif (e.key === 'Escape' && tooltipData?.tooltipElement.style.opacity === '1') {\n\t\t\t\t\t\thideTooltip()\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t]\n\n\t\t\t// Store subscriptions for cleanup\n\t\t\ttooltipData.subscriptions = subscriptions\n\t\t} else {\n\t\t\t// Update content for existing tooltip\n\t\t\ttooltipData.tooltipElement.textContent = text\n\n\t\t\t// Update arrow visibility if needed\n\t\t\tif (tooltipData.arrowElement) {\n\t\t\t\ttooltipData.arrowElement.style.visibility = showArrow ? 'visible' : 'hidden'\n\t\t\t}\n\t\t}\n\n\t\treturn { text, options }\n\t}\n\n\tdisconnected(part: ElementPart) {\n\t\tconst element = part.element\n\t\tconst tooltipData = tooltipMap.get(element)\n\n\t\tif (tooltipData) {\n\t\t\t// Clean up subscriptions\n\t\t\tif (tooltipData.subscriptions) {\n\t\t\t\ttooltipData.subscriptions.forEach(subscription => subscription.unsubscribe())\n\t\t\t}\n\n\t\t\t// Clean up timeouts and positioning\n\t\t\tif (tooltipData.showTimeout) {\n\t\t\t\tclearTimeout(tooltipData.showTimeout)\n\t\t\t}\n\n\t\t\tif (tooltipData.cleanup) {\n\t\t\t\ttooltipData.cleanup()\n\t\t\t}\n\n\t\t\t// Remove tooltip element\n\t\t\tif (document.body.contains(tooltipData.tooltipElement)) {\n\t\t\t\tdocument.body.removeChild(tooltipData.tooltipElement)\n\t\t\t}\n\n\t\t\t// Remove ARIA attributes\n\t\t\tif (element.hasAttribute('aria-describedby')) {\n\t\t\t\telement.removeAttribute('aria-describedby')\n\t\t\t}\n\n\t\t\t// Remove from WeakMap\n\t\t\ttooltipMap.delete(element)\n\t\t}\n\t}\n}\n\n// Separate positioning function for clarity and reuse\nasync function updatePosition(element: HTMLElement, tooltipData: any, position: string, showArrow: boolean) {\n\t// Use floating-ui to compute position\n\tconst middleware = [\n\t\toffset(8), // Distance from the element\n\t\tflip({\n\t\t\tfallbackPlacements: ['top', 'right', 'bottom', 'left'].filter(p => p !== position) as Placement[],\n\t\t\tpadding: 5, // How far from the edges before flipping\n\t\t}),\n\t\tshift({ padding: 5 }), // Keep it within viewport bounds\n\t]\n\n\t// Add arrow middleware if needed\n\tif (showArrow && tooltipData.arrowElement) {\n\t\tmiddleware.push(arrow({ element: tooltipData.arrowElement }))\n\t}\n\n\tconst { x, y, placement, middlewareData } = await computePosition(element, tooltipData.tooltipElement, {\n\t\tplacement: position as Placement,\n\t\tmiddleware,\n\t\tstrategy: 'fixed' as Strategy, // Fixed positioning works better across contexts\n\t})\n\n\t// Apply position\n\tObject.assign(tooltipData.tooltipElement.style, {\n\t\tleft: `${x}px`,\n\t\ttop: `${y}px`,\n\t\tposition: 'fixed',\n\t})\n\n\t// Position the arrow if it exists\n\tif (showArrow && tooltipData.arrowElement && middlewareData.arrow) {\n\t\tconst { x: arrowX, y: arrowY } = middlewareData.arrow\n\n\t\t// Determine which side the arrow should be on based on placement\n\t\tconst staticSide =\n\t\t\t{\n\t\t\t\ttop: 'bottom',\n\t\t\t\tright: 'left',\n\t\t\t\tbottom: 'top',\n\t\t\t\tleft: 'right',\n\t\t\t}[placement.split('-')[0]] || 'bottom'\n\n\t\t// Position the arrow\n\t\tObject.assign(tooltipData.arrowElement.style, {\n\t\t\tleft: arrowX != null ? `${arrowX}px` : '',\n\t\t\ttop: arrowY != null ? `${arrowY}px` : '',\n\t\t\t[staticSide]: '-4px', // Position the arrow on the correct side\n\t\t\tvisibility: 'visible',\n\t\t})\n\t}\n}\n\nexport const tooltip = directive(TooltipDirective)\n"],"mappings":";;;AAKA,IAAM,oBAAa,IAAI,SAAA,EA+QV,IAAU,EApQvB,cAA+B,EAAA;CAC9B,YAAY,GAAA;EAEX,IADA,MAAM,EAAA,EACF,EAAS,SAAS,EAAS,SAC9B,MAAU,MAAM,qDAAA;;CAIlB,OACC,GACA,IAII,EAAA,EAAA;EAEJ,OAAO;GAAE,MAAA;GAAM,SAAA;GAAA;;CAGhB,OAAO,GAAA,CAAoB,GAAM,IAAU,EAAA,GAAA;EAC1C,IAAM,IAAU,EAAK,SACf,IAAW,GAAS,YAAY,OAChC,IAAQ,GAAS,SAAS,KAC1B,IAAA,CAAmC,MAAvB,GAAS,WAGvB,IAAc,EAAW,IAAI,EAAA;EAEjC,IAAK,GAqIJ,EAAY,eAAe,cAAc,GAGrC,EAAY,iBACf,EAAY,aAAa,MAAM,aAAa,IAAY,YAAY;OAzIpD;GAEjB,IAAM,IAAiB,SAAS,cAAc,MAAA,EAwB1C;GAvBJ,EAAe,YAAY,oBAG3B,OAAO,OAAO,EAAe,OAAO;IACnC,UAAU;IACV,QAAQ;IACR,iBAAiB;IACjB,OAAO;IACP,SAAS;IACT,cAAc;IACd,UAAU;IACV,YAAY;IACZ,UAAU;IACV,eAAe;IACf,SAAS;IACT,YAAY;IACZ,WAAW;IACX,WAAW;IAEX,YAAY;IAAA,CAAA,EAKT,MACH,IAAe,SAAS,cAAc,MAAA,EACtC,EAAa,YAAY,0BACzB,OAAO,OAAO,EAAa,OAAO;IACjC,UAAU;IACV,OAAO;IACP,QAAQ;IACR,YAAY;IACZ,YAAY;IAEZ,WAAW;IAAA,CAAA,EAEZ,EAAe,YAAY,EAAA,GAI5B,EAAe,aAAa,QAAQ,UAAA;GAGpC,IAAM,IAAY,WAAW,KAAK,QAAA,CAAS,SAAS,GAAA,CAAI,MAAM,GAAG,EAAA;GACj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GED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","names":[],"sources":["../src/tree/tree.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, switchMap, takeUntil, tap, zip } from 'rxjs'\n\n/**\n * @element schmancy-tree\n * @slot root - The root element of the tree\n * @slot - The children of the tree\n */\n@customElement('schmancy-tree')\nexport class SchmancyTree extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tbackground-color: initial;\n\t}\n\t::slotted([slot='root']) {\n\t\twidth: 100%;\n\t\ttext-align: left;\n\t}\n\t::slotted([slot='root'] + *) {\n\t\tmargin-top: 0.5rem;\n\t}\n`];\n\t/**\n\t * Whether the tree’s children are visible\n\t */\n\t@property({ type: Boolean }) open = false\n\n\t@query('#toggler') toggler!: HTMLSlotElement\n\t@query('slot:not([name=\"root\"])') defaultSlot!: HTMLSlotElement\n\n\t// Since it's actually a <schmancy-button>, use HTMLElement or a custom type\n\t@query('#chevron') chevron!: HTMLElement\n\n\tprivate readonly _a11yId = `schmancy-tree-${Math.random().toString(36).slice(2, 10)}`\n\tprivate get _contentId() { return `${this._a11yId}-content` }\n\n\t/** ElementInternals — broadcasts `:state(open)` for consumer CSS. */\n\tprivate readonly _internals: ElementInternals | undefined = (() => {\n\t\ttry { return this.attachInternals() } catch { return undefined }\n\t})()\n\n\tupdated(changed: Map<string, unknown>) {\n\t\tsuper.updated?.(changed)\n\t\tif (changed.has('open')) {\n\t\t\tif (this.open) this._internals?.states.add('open')\n\t\t\telse this._internals?.states.delete('open')\n\t\t}\n\t}\n\n\tfirstUpdated() {\n\t\t// Hide or show the slot initially based on `open`\n\t\tif (!this.open) {\n\t\t\tthis.defaultSlot.hidden = true\n\t\t}\n\n\t\t// Root toggler\n\t\tconst toggleClick$ = fromEvent<MouseEvent>(this.toggler, 'click').pipe(\n\t\t\ttakeUntil(this.disconnecting),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(new CustomEvent('toggle', { bubbles: false, composed: true }))\n\t\t\t}),\n\t\t)\n\n\t\t// Chevron (the schmancy-button) click\n\t\tconst chevronClick$ = fromEvent<MouseEvent>(this.chevron, 'click')\n\n\t\tmerge(toggleClick$, chevronClick$)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(() => {\n\t\t\t\t\t// 1. Animate the chevron rotation\n\t\t\t\t\t// If `open` is true, rotate from 180 -> 0; if false, from 0 -> 180\n\t\t\t\t\tconst fromDeg = this.open ? 180 : 0\n\t\t\t\t\tconst toDeg = this.open ? 0 : 180\n\t\t\t\t\tconst chevronAnimation = this.chevron.animate(\n\t\t\t\t\t\t[{ transform: `rotate(${fromDeg}deg)` }, { transform: `rotate(${toDeg}deg)` }],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tduration: 150,\n\t\t\t\t\t\t\teasing: 'ease-in',\n\t\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\n\t\t\t\t\t// 2. Animate the slot’s height + opacity\n\t\t\t\t\tif (!this.open) {\n\t\t\t\t\t\t// We are about to open, so remove `hidden` to measure scrollHeight\n\t\t\t\t\t\tthis.defaultSlot.hidden = false\n\t\t\t\t\t}\n\n\t\t\t\t\tconst fromOpacity = this.open ? 1 : 0\n\t\t\t\t\tconst toOpacity = this.open ? 0 : 1\n\n\t\t\t\t\tconst slotAnimation = this.defaultSlot.animate([{ opacity: fromOpacity }, { opacity: toOpacity }], {\n\t\t\t\t\t\tduration: 150,\n\t\t\t\t\t\teasing: 'ease-out',\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t})\n\n\t\t\t\t\t// Hide the slot if we just closed it\n\t\t\t\t\tslotAnimation.onfinish = () => {\n\t\t\t\t\t\tif (this.open) {\n\t\t\t\t\t\t\tthis.defaultSlot.hidden = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.defaultSlot.style.height = 'auto'\n\t\t\t\t\t\t\tthis.defaultSlot.style.opacity = '1'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Return an Observable that completes when both animations finish\n\t\t\t\t\treturn zip(fromEvent(chevronAnimation, 'finish'), fromEvent(slotAnimation, 'finish')).pipe(\n\t\t\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t\ttap(() => {\n\t\t\t\t\t// Flip the open state\n\t\t\t\t\tthis.open = !this.open\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"flex content-center items-center justify-between\">\n\t\t\t\t<!-- Root toggler content -->\n\t\t\t\t<slot id=\"toggler\" name=\"root\"></slot>\n\n\t\t\t\t<!-- The chevron or arrow symbol -->\n\t\t\t\t<!-- Stop propagation on the schmancy-button itself just to avoid double triggers -->\n\t\t\t\t<schmancy-button\n\t\t\t\t\tslot=\"trailing\"\n\t\t\t\t\tid=\"chevron\"\n\t\t\t\t\taria-expanded=${this.open ? 'true' : 'false'}\n\t\t\t\t\taria-controls=${this._contentId}\n\t\t\t\t\taria-label=${this.open ? 'Collapse' : 'Expand'}\n\t\t\t\t\t@click=${(e: Event) => e.stopPropagation()}\n\t\t\t\t>\n\t\t\t\t\t⌅\n\t\t\t\t</schmancy-button>\n\t\t\t</div>\n\n\t\t\t<!-- The default slot: tree children -->\n\t\t\t<slot id=${this._contentId}></slot>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-tree': SchmancyTree\n\t}\n}\n"],"mappings":";;;;;AAWO,IAAA,IAAA,cAA2B,EAAA;CAAA,YAAA,GAAA,GAAA;
|
|
1
|
+
{"version":3,"file":"tree.js","names":[],"sources":["../src/tree/tree.ts"],"sourcesContent":["import { SchmancyElement } from '@mixins/index'\nimport { css, html } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\nimport { fromEvent, merge, switchMap, takeUntil, tap, zip } from 'rxjs'\n\n/**\n * @element schmancy-tree\n * @slot root - The root element of the tree\n * @slot - The children of the tree\n */\n@customElement('schmancy-tree')\nexport class SchmancyTree extends SchmancyElement {\n\tstatic styles = [css`\n\t:host {\n\t\tdisplay: block;\n\t\tposition: relative;\n\t\tbackground-color: initial;\n\t}\n\t::slotted([slot='root']) {\n\t\twidth: 100%;\n\t\ttext-align: left;\n\t}\n\t::slotted([slot='root'] + *) {\n\t\tmargin-top: 0.5rem;\n\t}\n`];\n\t/**\n\t * Whether the tree’s children are visible\n\t */\n\t@property({ type: Boolean }) open = false\n\n\t@query('#toggler') toggler!: HTMLSlotElement\n\t@query('slot:not([name=\"root\"])') defaultSlot!: HTMLSlotElement\n\n\t// Since it's actually a <schmancy-button>, use HTMLElement or a custom type\n\t@query('#chevron') chevron!: HTMLElement\n\n\tprivate readonly _a11yId = `schmancy-tree-${Math.random().toString(36).slice(2, 10)}`\n\tprivate get _contentId() { return `${this._a11yId}-content` }\n\n\t/** ElementInternals — broadcasts `:state(open)` for consumer CSS. */\n\tprivate readonly _internals: ElementInternals | undefined = (() => {\n\t\ttry { return this.attachInternals() } catch { return undefined }\n\t})()\n\n\tupdated(changed: Map<string, unknown>) {\n\t\tsuper.updated?.(changed)\n\t\tif (changed.has('open')) {\n\t\t\tif (this.open) this._internals?.states.add('open')\n\t\t\telse this._internals?.states.delete('open')\n\t\t}\n\t}\n\n\tfirstUpdated() {\n\t\t// Hide or show the slot initially based on `open`\n\t\tif (!this.open) {\n\t\t\tthis.defaultSlot.hidden = true\n\t\t}\n\n\t\t// Root toggler\n\t\tconst toggleClick$ = fromEvent<MouseEvent>(this.toggler, 'click').pipe(\n\t\t\ttakeUntil(this.disconnecting),\n\t\t\ttap(e => {\n\t\t\t\te.preventDefault()\n\t\t\t\te.stopPropagation()\n\t\t\t\tthis.dispatchEvent(new CustomEvent('toggle', { bubbles: false, composed: true }))\n\t\t\t}),\n\t\t)\n\n\t\t// Chevron (the schmancy-button) click\n\t\tconst chevronClick$ = fromEvent<MouseEvent>(this.chevron, 'click')\n\n\t\tmerge(toggleClick$, chevronClick$)\n\t\t\t.pipe(\n\t\t\t\tswitchMap(() => {\n\t\t\t\t\t// 1. Animate the chevron rotation\n\t\t\t\t\t// If `open` is true, rotate from 180 -> 0; if false, from 0 -> 180\n\t\t\t\t\tconst fromDeg = this.open ? 180 : 0\n\t\t\t\t\tconst toDeg = this.open ? 0 : 180\n\t\t\t\t\tconst chevronAnimation = this.chevron.animate(\n\t\t\t\t\t\t[{ transform: `rotate(${fromDeg}deg)` }, { transform: `rotate(${toDeg}deg)` }],\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tduration: 150,\n\t\t\t\t\t\t\teasing: 'ease-in',\n\t\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\n\t\t\t\t\t// 2. Animate the slot’s height + opacity\n\t\t\t\t\tif (!this.open) {\n\t\t\t\t\t\t// We are about to open, so remove `hidden` to measure scrollHeight\n\t\t\t\t\t\tthis.defaultSlot.hidden = false\n\t\t\t\t\t}\n\n\t\t\t\t\tconst fromOpacity = this.open ? 1 : 0\n\t\t\t\t\tconst toOpacity = this.open ? 0 : 1\n\n\t\t\t\t\tconst slotAnimation = this.defaultSlot.animate([{ opacity: fromOpacity }, { opacity: toOpacity }], {\n\t\t\t\t\t\tduration: 150,\n\t\t\t\t\t\teasing: 'ease-out',\n\t\t\t\t\t\tfill: 'forwards',\n\t\t\t\t\t})\n\n\t\t\t\t\t// Hide the slot if we just closed it\n\t\t\t\t\tslotAnimation.onfinish = () => {\n\t\t\t\t\t\tif (this.open) {\n\t\t\t\t\t\t\tthis.defaultSlot.hidden = true\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.defaultSlot.style.height = 'auto'\n\t\t\t\t\t\t\tthis.defaultSlot.style.opacity = '1'\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Return an Observable that completes when both animations finish\n\t\t\t\t\treturn zip(fromEvent(chevronAnimation, 'finish'), fromEvent(slotAnimation, 'finish')).pipe(\n\t\t\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t\ttap(() => {\n\t\t\t\t\t// Flip the open state\n\t\t\t\t\tthis.open = !this.open\n\t\t\t\t}),\n\t\t\t\ttakeUntil(this.disconnecting),\n\t\t\t)\n\t\t\t.subscribe()\n\t}\n\n\trender() {\n\t\treturn html`\n\t\t\t<div class=\"flex content-center items-center justify-between\">\n\t\t\t\t<!-- Root toggler content -->\n\t\t\t\t<slot id=\"toggler\" name=\"root\"></slot>\n\n\t\t\t\t<!-- The chevron or arrow symbol -->\n\t\t\t\t<!-- Stop propagation on the schmancy-button itself just to avoid double triggers -->\n\t\t\t\t<schmancy-button\n\t\t\t\t\tslot=\"trailing\"\n\t\t\t\t\tid=\"chevron\"\n\t\t\t\t\taria-expanded=${this.open ? 'true' : 'false'}\n\t\t\t\t\taria-controls=${this._contentId}\n\t\t\t\t\taria-label=${this.open ? 'Collapse' : 'Expand'}\n\t\t\t\t\t@click=${(e: Event) => e.stopPropagation()}\n\t\t\t\t>\n\t\t\t\t\t⌅\n\t\t\t\t</schmancy-button>\n\t\t\t</div>\n\n\t\t\t<!-- The default slot: tree children -->\n\t\t\t<slot id=${this._contentId}></slot>\n\t\t`\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'schmancy-tree': SchmancyTree\n\t}\n}\n"],"mappings":";;;;;AAWO,IAAA,IAAA,cAA2B,EAAA;CAAA,YAAA,GAAA,GAAA;EAAA,MAAA,GAAA,EAAA,EAAA,KAAA,OAAA,CAkBG,GAAA,KAAA,UAQT,iBAAiB,KAAK,QAAA,CAAS,SAAS,GAAA,CA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AAY,MAAM,SAAS,QAChC,KAAK,YAAY,MAAM,UAAU;MAK5B,EAAI,EAAU,GAAkB,SAAA,EAAW,EAAU,GAAe,SAAA,CAAA,CAAW,KACrF,EAAU,KAAK,cAAA,CAAA;IAAA,EAGjB,QAAA;GAEC,KAAK,OAAA,CAAQ,KAAK;IAAA,EAEnB,EAAU,KAAK,cAAA,CAAA,CAEf,WAAA;;CAGH,SAAA;EACC,OAAO,CAAI;;;;;;;;;;qBAUQ,KAAK,OAAO,SAAS,QAAA;qBACrB,KAAK,WAAA;kBACR,KAAK,OAAO,aAAa,SAAA;eAC5B,MAAa,EAAE,iBAAA,CAAA;;;;;;;cAOhB,KAAK,WAAA;;;;GAvHjB,EAAS,EAAE,MAAM,SAAA,CAAA,CAAA,EAAU,EAAA,WAAA,QAAA,KAAA,EAAA,EAAA,EAAA,CAE3B,EAAM,WAAA,CAAA,EAAW,EAAA,WAAA,WAAA,KAAA,EAAA,EAAA,EAAA,CACjB,EAAM,4BAAA,CAAA,EAA0B,EAAA,WAAA,eAAA,KAAA,EAAA,EAAA,EAAA,CAGhC,EAAM,WAAA,CAAA,EAAW,EAAA,WAAA,WAAA,KAAA,EAAA,EAAA,IAAA,EAAA,CAzBlB,EAAc,gBAAA,CAAA,EAAgB,EAAA;AAAA,SAAA,KAAA"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../src/types/events.ts"],"sourcesContent":["export enum SchmancyEvents {\n\tNavDrawer_toggle = 'SchmancytoggleSidebar',\n\tContentDrawerToggle = 'ContentDrawerToggle',\n\tContentDrawerResize = 'ContentDrawerResize',\n}\n"],"mappings":"AAAA,IAAY,IAAL,SAAA,GAAA;
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../src/types/events.ts"],"sourcesContent":["export enum SchmancyEvents {\n\tNavDrawer_toggle = 'SchmancytoggleSidebar',\n\tContentDrawerToggle = 'ContentDrawerToggle',\n\tContentDrawerResize = 'ContentDrawerResize',\n}\n"],"mappings":"AAAA,IAAY,IAAL,SAAA,GAAA;CAAA,OACN,EAAA,mBAAmB,yBACnB,EAAA,sBAAsB,uBACtB,EAAA,sBAAsB,uBAAA;EAHhB,EAAA,CAAA;AAAA,SAAA,KAAA"}
|
package/dist/typewriter.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typewriter.cjs","names":[],"sources":["../src/typewriter/typewriter.directive.ts"],"sourcesContent":["/**\n * Typewriter Directive - RxJS-based typing animation\n *\n * Creates a smooth typewriter effect with automatic cycling through phrases.\n * Uses RxJS for precise timing and clean reactive patterns.\n *\n * @example\n * ```ts\n * // Simple cycling through words\n * html`<div ${typewriter(['Trustless', 'Permissionless', 'Transparent'])}>\n * <span class=\"typed\"></span>\n * </div>`\n *\n * // Custom speeds and pauses\n * html`<div ${typewriter(['Fast', 'Typing'], { typeSpeed: 50, pauseDuration: 1000 })}>\n * <span class=\"typed\"></span>\n * </div>`\n *\n * // One-time typing (no loop)\n * html`<div ${typewriter(['Hello World'], { loop: false })}>\n * <span class=\"typed\"></span>\n * </div>`\n * ```\n */\n\nimport type { ElementPart } from 'lit'\nimport { noChange } from 'lit'\nimport { AsyncDirective, directive } from 'lit/async-directive.js'\nimport { concat, defer, EMPTY, interval, of, Subscription } from 'rxjs'\nimport { delay, repeat, take, tap } from 'rxjs/operators'\n\nexport interface TypewriterOptions {\n\ttypeSpeed?: number // Speed of typing (ms per character)\n\tdeleteSpeed?: number // Speed of deleting (ms per character)\n\tpauseDuration?: number // Pause after typing before deleting (ms)\n\tloop?: boolean // Whether to loop through phrases\n\tselector?: string // CSS selector for target element (default: '.typed')\n\tcursor?: boolean // Show cursor\n\tfinalMessage?: string // Message to display after cycling completes\n\tsound?: boolean // Play typewriter sounds (default: true)\n\tvolume?: number // Sound volume (0-1, default: 0.3)\n}\n\ninterface TypewriterState {\n\tphrases: string[]\n\toptions: Required<TypewriterOptions>\n\telement?: HTMLElement\n\ttargetElement?: HTMLElement\n\tsubscription?: Subscription\n\taudioContext?: AudioContext\n}\n\n// Typewriter sound generator using Web Audio API\nclass TypewriterSound {\n\tprivate audioContext: AudioContext\n\tprivate volume: number\n\n\tconstructor(volume: number = 0.3) {\n\t\tthis.audioContext = new AudioContext()\n\t\tthis.volume = Math.max(0, Math.min(1, volume))\n\t}\n\n\t// Generate cute, soft typing sound - like a gentle \"pop\"\n\tplayKeyPress() {\n\t\tconst now = this.audioContext.currentTime\n\n\t\t// Higher, softer main tone - more \"pop\" than \"clack\"\n\t\tconst osc = this.audioContext.createOscillator()\n\t\tconst gainNode = this.audioContext.createGain()\n\n\t\t// Higher base frequency for cute sound + randomness\n\t\tconst baseFreq = 800 + Math.random() * 200\n\t\tosc.frequency.setValueAtTime(baseFreq, now)\n\t\tosc.type = 'sine' // Smoother, rounder sound\n\n\t\t// Gentler attack, quick but soft\n\t\tgainNode.gain.setValueAtTime(0, now)\n\t\tgainNode.gain.linearRampToValueAtTime(this.volume * 0.2, now + 0.005)\n\t\tgainNode.gain.exponentialRampToValueAtTime(0.001, now + 0.03)\n\n\t\tosc.connect(gainNode)\n\t\tgainNode.connect(this.audioContext.destination)\n\n\t\tosc.start(now)\n\t\tosc.stop(now + 0.03)\n\n\t\t// Add a cute high \"bleep\" for character\n\t\tconst bleepOsc = this.audioContext.createOscillator()\n\t\tconst bleepGain = this.audioContext.createGain()\n\n\t\tbleepOsc.frequency.setValueAtTime(1800 + Math.random() * 400, now)\n\t\tbleepOsc.type = 'sine'\n\n\t\tbleepGain.gain.setValueAtTime(0, now)\n\t\tbleepGain.gain.linearRampToValueAtTime(this.volume * 0.08, now + 0.003)\n\t\tbleepGain.gain.exponentialRampToValueAtTime(0.001, now + 0.015)\n\n\t\tbleepOsc.connect(bleepGain)\n\t\tbleepGain.connect(this.audioContext.destination)\n\n\t\tbleepOsc.start(now)\n\t\tbleepOsc.stop(now + 0.015)\n\t}\n\n\t// Softer \"whoosh\" sound for deletion - like erasing\n\tplayDelete() {\n\t\tconst now = this.audioContext.currentTime\n\n\t\tconst osc = this.audioContext.createOscillator()\n\t\tconst gainNode = this.audioContext.createGain()\n\n\t\t// Descending pitch for \"erasing\" feel\n\t\tosc.frequency.setValueAtTime(600, now)\n\t\tosc.frequency.exponentialRampToValueAtTime(200, now + 0.04)\n\t\tosc.type = 'sine'\n\n\t\tgainNode.gain.setValueAtTime(0, now)\n\t\tgainNode.gain.linearRampToValueAtTime(this.volume * 0.12, now + 0.005)\n\t\tgainNode.gain.exponentialRampToValueAtTime(0.001, now + 0.04)\n\n\t\tosc.connect(gainNode)\n\t\tgainNode.connect(this.audioContext.destination)\n\n\t\tosc.start(now)\n\t\tosc.stop(now + 0.04)\n\t}\n\n\tcleanup() {\n\t\tthis.audioContext.close()\n\t}\n}\n\nclass TypewriterDirective extends AsyncDirective {\n\tprivate state: TypewriterState | null = null\n\tprivate soundEngine: TypewriterSound | null = null\n\n\trender(_phrases: string[], _options: TypewriterOptions = {}) {\n\t\treturn noChange\n\t}\n\n\toverride update(\n\t\tpart: ElementPart,\n\t\t[phrases, options = {}]: [string[], TypewriterOptions]\n\t) {\n\t\tconst element = part.element as HTMLElement\n\n\t\t// Clean up if params changed\n\t\tif (\n\t\t\tthis.state &&\n\t\t\t(JSON.stringify(this.state.phrases) !== JSON.stringify(phrases) ||\n\t\t\t\tJSON.stringify(this.state.options) !== JSON.stringify(options))\n\t\t) {\n\t\t\tthis.cleanup()\n\t\t}\n\n\t\t// Initialize state\n\t\tif (!this.state) {\n\t\t\tconst defaultOptions: Required<TypewriterOptions> = {\n\t\t\t\ttypeSpeed: 50,\n\t\t\t\tdeleteSpeed: 30,\n\t\t\t\tpauseDuration: 1500,\n\t\t\t\tloop: true,\n\t\t\t\tselector: '.typed',\n\t\t\t\tcursor: false,\n\t\t\t\tfinalMessage: '',\n\t\t\t\tsound: true,\n\t\t\t\tvolume: 0.08,\n\t\t\t}\n\n\t\t\tthis.state = {\n\t\t\t\tphrases,\n\t\t\t\toptions: { ...defaultOptions, ...options },\n\t\t\t\telement,\n\t\t\t}\n\n\t\t\t// Initialize sound engine if enabled\n\t\t\tif (this.state.options.sound) {\n\t\t\t\tthis.soundEngine = new TypewriterSound(this.state.options.volume)\n\t\t\t}\n\n\t\t\t// Find target element\n\t\t\tthis.state.targetElement = element.querySelector<HTMLElement>(\n\t\t\t\tthis.state.options.selector\n\t\t\t) ?? undefined\n\n\t\t\tif (!this.state.targetElement) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Typewriter: Target element \"${this.state.options.selector}\" not found`\n\t\t\t\t)\n\t\t\t\treturn noChange\n\t\t\t}\n\n\t\t\t// Add cursor if enabled\n\t\t\tif (this.state.options.cursor) {\n\t\t\t\tthis.state.targetElement.style.position = 'relative'\n\t\t\t\tthis.state.targetElement.style.display = 'inline-block'\n\t\t\t\tconst cursor = document.createElement('span')\n\t\t\t\tcursor.className = 'typewriter-cursor'\n\t\t\t\tcursor.textContent = '|'\n\t\t\t\tcursor.style.cssText = `\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tmargin-left: 2px;\n\t\t\t\t\tanimation: typewriter-blink 1s step-end infinite;\n\t\t\t\t`\n\t\t\t\tthis.state.targetElement.appendChild(cursor)\n\n\t\t\t\t// Add blink animation if not already present\n\t\t\t\tif (!document.getElementById('typewriter-styles')) {\n\t\t\t\t\tconst style = document.createElement('style')\n\t\t\t\t\tstyle.id = 'typewriter-styles'\n\t\t\t\t\tstyle.textContent = `\n\t\t\t\t\t\t@keyframes typewriter-blink {\n\t\t\t\t\t\t\t0%, 50% { opacity: 1; }\n\t\t\t\t\t\t\t51%, 100% { opacity: 0; }\n\t\t\t\t\t\t}\n\t\t\t\t\t`\n\t\t\t\t\tdocument.head.appendChild(style)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.startTyping()\n\t\t}\n\n\t\treturn noChange\n\t}\n\n\tprivate startTyping() {\n\t\tif (!this.state || !this.state.targetElement) return\n\n\t\tconst { phrases, options, targetElement } = this.state\n\n\t\t// Create typing observable for a single phrase\n\t\tconst typePhrase = (phrase: string, shouldDelete: boolean = true) => {\n\t\t\treturn concat(\n\t\t\t\t// Type each character\n\t\t\t\tdefer(() => {\n\t\t\t\t\tconst chars = phrase.split('')\n\t\t\t\t\treturn concat(\n\t\t\t\t\t\t...chars.map((char) =>\n\t\t\t\t\t\t\tof(char).pipe(\n\t\t\t\t\t\t\t\tdelay(options.typeSpeed),\n\t\t\t\t\t\t\t\ttap((c) => {\n\t\t\t\t\t\t\t\t\tconst textNode = this.getTextNode(targetElement)\n\t\t\t\t\t\t\t\t\tif (textNode) {\n\t\t\t\t\t\t\t\t\t\ttextNode.textContent += c\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Play key press sound\n\t\t\t\t\t\t\t\t\tif (this.soundEngine) {\n\t\t\t\t\t\t\t\t\t\tthis.soundEngine.playKeyPress()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t\t// Pause after typing\n\t\t\t\tof(null).pipe(delay(options.pauseDuration)),\n\t\t\t\t// Delete each character (only if shouldDelete is true)\n\t\t\t\tshouldDelete ? defer(() => {\n\t\t\t\t\tconst deleteCount = phrase.length\n\t\t\t\t\treturn interval(options.deleteSpeed).pipe(\n\t\t\t\t\t\ttake(deleteCount),\n\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\tconst textNode = this.getTextNode(targetElement)\n\t\t\t\t\t\t\tif (textNode && textNode.textContent) {\n\t\t\t\t\t\t\t\ttextNode.textContent = textNode.textContent.slice(0, -1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Play delete sound\n\t\t\t\t\t\t\tif (this.soundEngine) {\n\t\t\t\t\t\t\t\tthis.soundEngine.playDelete()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}) : EMPTY,\n\t\t\t\t// Small pause before next phrase\n\t\t\t\tshouldDelete ? of(null).pipe(delay(200)) : EMPTY\n\t\t\t)\n\t\t}\n\n\t\t// Create observable that cycles through all phrases\n\t\tconst phrasesSequence = concat(\n\t\t\t...phrases.map((phrase) => typePhrase(phrase))\n\t\t)\n\n\t\t// Add final message if provided\n\t\tconst typingSequence = options.finalMessage\n\t\t\t? concat(\n\t\t\t\t\tphrasesSequence,\n\t\t\t\t\ttypePhrase(options.finalMessage, false) // Don't delete final message\n\t\t\t\t)\n\t\t\t: phrasesSequence\n\n\t\t// Subscribe and optionally loop\n\t\tthis.state.subscription = (\n\t\t\toptions.loop ? phrasesSequence.pipe(repeat()) : typingSequence\n\t\t).subscribe({\n\t\t\terror: (err) => console.error('Typewriter error:', err),\n\t\t})\n\t}\n\n\tprivate getTextNode(targetElement: HTMLElement): Text | null {\n\t\t// Get or create text node (ignoring cursor element)\n\t\tfor (const child of Array.from(targetElement.childNodes)) {\n\t\t\tif (child.nodeType === Node.TEXT_NODE) {\n\t\t\t\treturn child as Text\n\t\t\t}\n\t\t}\n\t\t// Create text node if it doesn't exist\n\t\tconst textNode = document.createTextNode('')\n\t\ttargetElement.insertBefore(textNode, targetElement.firstChild)\n\t\treturn textNode\n\t}\n\n\tprivate cleanup() {\n\t\tif (!this.state) return\n\n\t\t// Unsubscribe from typing observable\n\t\tif (this.state.subscription) {\n\t\t\tthis.state.subscription.unsubscribe()\n\t\t}\n\n\t\t// Remove cursor if present\n\t\tif (this.state.targetElement) {\n\t\t\tconst cursor = this.state.targetElement.querySelector('.typewriter-cursor')\n\t\t\tcursor?.remove()\n\t\t}\n\n\t\t// Cleanup sound engine\n\t\tif (this.soundEngine) {\n\t\t\tthis.soundEngine.cleanup()\n\t\t\tthis.soundEngine = null\n\t\t}\n\n\t\tthis.state = null\n\t}\n\n\toverride disconnected() {\n\t\tthis.cleanup()\n\t}\n\n\toverride reconnected(): void {\n\t\t// Re-start typing if state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GAAY,EAAS,cACxB,EAAS,YAAc,EAAS,YAAY,MAAM,EAAA,GAAG,EAGlD,KAAK,aACR,KAAK,YAAY,YAAA,EAAA,CAAA,EAAA,CAIhB,EAAA,MAEL,GAAA,EAAA,EAAA,IAAkB,KAAA,CAAM,MAAA,EAAA,EAAA,OAAW,IAAA,CAAA,CAAQ,EAAA,MAAA,CAKvC,GAAA,EAAA,EAAA,QAAA,GACF,EAAQ,IAAK,GAAW,EAAW,EAAA,CAAA,CAAA,CAIjC,EAAiB,EAAQ,cAAA,EAAA,EAAA,QAE5B,EACA,EAAW,EAAQ,aAAA,CAAc,EAAA,CAAA,CAEjC,EAGH,KAAK,MAAM,cACV,EAAQ,KAAO,EAAgB,MAAA,EAAA,EAAA,SAAA,CAAA,CAAiB,GAC/C,UAAU,CACX,MAAQ,GAAA,GAAA,CAAA,CAIV,YAAoB,EAAA,CAEnB,IAAK,IAAM,KAAS,MAAM,KAAK,EAAc,WAAA,CAC5C,GAAI,EAAM,WAAa,KAAK,UAC3B,OAAO,EAIT,IAAM,EAAW,SAAS,eAAe,GAAA,CAEzC,OADA,EAAc,aAAa,EAAU,EAAc,WAAA,CAC5C,EAGR,SAAA,CACM,AAmBL,KAAK,SAhBD,KAAK,MAAM,cACd,KAAK,MAAM,aAAa,aAAA,CAIrB,KAAK,MAAM,eACC,KAAK,MAAM,cAAc,cAAc,qBAAA,EAC9C,QAAA,CAIL,AAEH,KAAK,eADL,KAAK,YAAY,SAAA,CACE,MAGP,MAGd,cAAA,CACC,KAAK,SAAA,CAGN,aAAA,CAEK,KAAK,OAAA,CAAU,KAAK,MAAM,cAC7B,KAAK,aAAA,GAKK,GAAA,EAAA,EAAA,WAAuB,EAAA,CAAA,QAAA,WAAA"}
|
|
1
|
+
{"version":3,"file":"typewriter.cjs","names":[],"sources":["../src/typewriter/typewriter.directive.ts"],"sourcesContent":["/**\n * Typewriter Directive - RxJS-based typing animation\n *\n * Creates a smooth typewriter effect with automatic cycling through phrases.\n * Uses RxJS for precise timing and clean reactive patterns.\n *\n * @example\n * ```ts\n * // Simple cycling through words\n * html`<div ${typewriter(['Trustless', 'Permissionless', 'Transparent'])}>\n * <span class=\"typed\"></span>\n * </div>`\n *\n * // Custom speeds and pauses\n * html`<div ${typewriter(['Fast', 'Typing'], { typeSpeed: 50, pauseDuration: 1000 })}>\n * <span class=\"typed\"></span>\n * </div>`\n *\n * // One-time typing (no loop)\n * html`<div ${typewriter(['Hello World'], { loop: false })}>\n * <span class=\"typed\"></span>\n * </div>`\n * ```\n */\n\nimport type { ElementPart } from 'lit'\nimport { noChange } from 'lit'\nimport { AsyncDirective, directive } from 'lit/async-directive.js'\nimport { concat, defer, EMPTY, interval, of, Subscription } from 'rxjs'\nimport { delay, repeat, take, tap } from 'rxjs/operators'\n\nexport interface TypewriterOptions {\n\ttypeSpeed?: number // Speed of typing (ms per character)\n\tdeleteSpeed?: number // Speed of deleting (ms per character)\n\tpauseDuration?: number // Pause after typing before deleting (ms)\n\tloop?: boolean // Whether to loop through phrases\n\tselector?: string // CSS selector for target element (default: '.typed')\n\tcursor?: boolean // Show cursor\n\tfinalMessage?: string // Message to display after cycling completes\n\tsound?: boolean // Play typewriter sounds (default: true)\n\tvolume?: number // Sound volume (0-1, default: 0.3)\n}\n\ninterface TypewriterState {\n\tphrases: string[]\n\toptions: Required<TypewriterOptions>\n\telement?: HTMLElement\n\ttargetElement?: HTMLElement\n\tsubscription?: Subscription\n\taudioContext?: AudioContext\n}\n\n// Typewriter sound generator using Web Audio API\nclass TypewriterSound {\n\tprivate audioContext: AudioContext\n\tprivate volume: number\n\n\tconstructor(volume: number = 0.3) {\n\t\tthis.audioContext = new AudioContext()\n\t\tthis.volume = Math.max(0, Math.min(1, volume))\n\t}\n\n\t// Generate cute, soft typing sound - like a gentle \"pop\"\n\tplayKeyPress() {\n\t\tconst now = this.audioContext.currentTime\n\n\t\t// Higher, softer main tone - more \"pop\" than \"clack\"\n\t\tconst osc = this.audioContext.createOscillator()\n\t\tconst gainNode = this.audioContext.createGain()\n\n\t\t// Higher base frequency for cute sound + randomness\n\t\tconst baseFreq = 800 + Math.random() * 200\n\t\tosc.frequency.setValueAtTime(baseFreq, now)\n\t\tosc.type = 'sine' // Smoother, rounder sound\n\n\t\t// Gentler attack, quick but soft\n\t\tgainNode.gain.setValueAtTime(0, now)\n\t\tgainNode.gain.linearRampToValueAtTime(this.volume * 0.2, now + 0.005)\n\t\tgainNode.gain.exponentialRampToValueAtTime(0.001, now + 0.03)\n\n\t\tosc.connect(gainNode)\n\t\tgainNode.connect(this.audioContext.destination)\n\n\t\tosc.start(now)\n\t\tosc.stop(now + 0.03)\n\n\t\t// Add a cute high \"bleep\" for character\n\t\tconst bleepOsc = this.audioContext.createOscillator()\n\t\tconst bleepGain = this.audioContext.createGain()\n\n\t\tbleepOsc.frequency.setValueAtTime(1800 + Math.random() * 400, now)\n\t\tbleepOsc.type = 'sine'\n\n\t\tbleepGain.gain.setValueAtTime(0, now)\n\t\tbleepGain.gain.linearRampToValueAtTime(this.volume * 0.08, now + 0.003)\n\t\tbleepGain.gain.exponentialRampToValueAtTime(0.001, now + 0.015)\n\n\t\tbleepOsc.connect(bleepGain)\n\t\tbleepGain.connect(this.audioContext.destination)\n\n\t\tbleepOsc.start(now)\n\t\tbleepOsc.stop(now + 0.015)\n\t}\n\n\t// Softer \"whoosh\" sound for deletion - like erasing\n\tplayDelete() {\n\t\tconst now = this.audioContext.currentTime\n\n\t\tconst osc = this.audioContext.createOscillator()\n\t\tconst gainNode = this.audioContext.createGain()\n\n\t\t// Descending pitch for \"erasing\" feel\n\t\tosc.frequency.setValueAtTime(600, now)\n\t\tosc.frequency.exponentialRampToValueAtTime(200, now + 0.04)\n\t\tosc.type = 'sine'\n\n\t\tgainNode.gain.setValueAtTime(0, now)\n\t\tgainNode.gain.linearRampToValueAtTime(this.volume * 0.12, now + 0.005)\n\t\tgainNode.gain.exponentialRampToValueAtTime(0.001, now + 0.04)\n\n\t\tosc.connect(gainNode)\n\t\tgainNode.connect(this.audioContext.destination)\n\n\t\tosc.start(now)\n\t\tosc.stop(now + 0.04)\n\t}\n\n\tcleanup() {\n\t\tthis.audioContext.close()\n\t}\n}\n\nclass TypewriterDirective extends AsyncDirective {\n\tprivate state: TypewriterState | null = null\n\tprivate soundEngine: TypewriterSound | null = null\n\n\trender(_phrases: string[], _options: TypewriterOptions = {}) {\n\t\treturn noChange\n\t}\n\n\toverride update(\n\t\tpart: ElementPart,\n\t\t[phrases, options = {}]: [string[], TypewriterOptions]\n\t) {\n\t\tconst element = part.element as HTMLElement\n\n\t\t// Clean up if params changed\n\t\tif (\n\t\t\tthis.state &&\n\t\t\t(JSON.stringify(this.state.phrases) !== JSON.stringify(phrases) ||\n\t\t\t\tJSON.stringify(this.state.options) !== JSON.stringify(options))\n\t\t) {\n\t\t\tthis.cleanup()\n\t\t}\n\n\t\t// Initialize state\n\t\tif (!this.state) {\n\t\t\tconst defaultOptions: Required<TypewriterOptions> = {\n\t\t\t\ttypeSpeed: 50,\n\t\t\t\tdeleteSpeed: 30,\n\t\t\t\tpauseDuration: 1500,\n\t\t\t\tloop: true,\n\t\t\t\tselector: '.typed',\n\t\t\t\tcursor: false,\n\t\t\t\tfinalMessage: '',\n\t\t\t\tsound: true,\n\t\t\t\tvolume: 0.08,\n\t\t\t}\n\n\t\t\tthis.state = {\n\t\t\t\tphrases,\n\t\t\t\toptions: { ...defaultOptions, ...options },\n\t\t\t\telement,\n\t\t\t}\n\n\t\t\t// Initialize sound engine if enabled\n\t\t\tif (this.state.options.sound) {\n\t\t\t\tthis.soundEngine = new TypewriterSound(this.state.options.volume)\n\t\t\t}\n\n\t\t\t// Find target element\n\t\t\tthis.state.targetElement = element.querySelector<HTMLElement>(\n\t\t\t\tthis.state.options.selector\n\t\t\t) ?? undefined\n\n\t\t\tif (!this.state.targetElement) {\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`Typewriter: Target element \"${this.state.options.selector}\" not found`\n\t\t\t\t)\n\t\t\t\treturn noChange\n\t\t\t}\n\n\t\t\t// Add cursor if enabled\n\t\t\tif (this.state.options.cursor) {\n\t\t\t\tthis.state.targetElement.style.position = 'relative'\n\t\t\t\tthis.state.targetElement.style.display = 'inline-block'\n\t\t\t\tconst cursor = document.createElement('span')\n\t\t\t\tcursor.className = 'typewriter-cursor'\n\t\t\t\tcursor.textContent = '|'\n\t\t\t\tcursor.style.cssText = `\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tmargin-left: 2px;\n\t\t\t\t\tanimation: typewriter-blink 1s step-end infinite;\n\t\t\t\t`\n\t\t\t\tthis.state.targetElement.appendChild(cursor)\n\n\t\t\t\t// Add blink animation if not already present\n\t\t\t\tif (!document.getElementById('typewriter-styles')) {\n\t\t\t\t\tconst style = document.createElement('style')\n\t\t\t\t\tstyle.id = 'typewriter-styles'\n\t\t\t\t\tstyle.textContent = `\n\t\t\t\t\t\t@keyframes typewriter-blink {\n\t\t\t\t\t\t\t0%, 50% { opacity: 1; }\n\t\t\t\t\t\t\t51%, 100% { opacity: 0; }\n\t\t\t\t\t\t}\n\t\t\t\t\t`\n\t\t\t\t\tdocument.head.appendChild(style)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.startTyping()\n\t\t}\n\n\t\treturn noChange\n\t}\n\n\tprivate startTyping() {\n\t\tif (!this.state || !this.state.targetElement) return\n\n\t\tconst { phrases, options, targetElement } = this.state\n\n\t\t// Create typing observable for a single phrase\n\t\tconst typePhrase = (phrase: string, shouldDelete: boolean = true) => {\n\t\t\treturn concat(\n\t\t\t\t// Type each character\n\t\t\t\tdefer(() => {\n\t\t\t\t\tconst chars = phrase.split('')\n\t\t\t\t\treturn concat(\n\t\t\t\t\t\t...chars.map((char) =>\n\t\t\t\t\t\t\tof(char).pipe(\n\t\t\t\t\t\t\t\tdelay(options.typeSpeed),\n\t\t\t\t\t\t\t\ttap((c) => {\n\t\t\t\t\t\t\t\t\tconst textNode = this.getTextNode(targetElement)\n\t\t\t\t\t\t\t\t\tif (textNode) {\n\t\t\t\t\t\t\t\t\t\ttextNode.textContent += c\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t// Play key press sound\n\t\t\t\t\t\t\t\t\tif (this.soundEngine) {\n\t\t\t\t\t\t\t\t\t\tthis.soundEngine.playKeyPress()\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t}),\n\t\t\t\t// Pause after typing\n\t\t\t\tof(null).pipe(delay(options.pauseDuration)),\n\t\t\t\t// Delete each character (only if shouldDelete is true)\n\t\t\t\tshouldDelete ? defer(() => {\n\t\t\t\t\tconst deleteCount = phrase.length\n\t\t\t\t\treturn interval(options.deleteSpeed).pipe(\n\t\t\t\t\t\ttake(deleteCount),\n\t\t\t\t\t\ttap(() => {\n\t\t\t\t\t\t\tconst textNode = this.getTextNode(targetElement)\n\t\t\t\t\t\t\tif (textNode && textNode.textContent) {\n\t\t\t\t\t\t\t\ttextNode.textContent = textNode.textContent.slice(0, -1)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Play delete sound\n\t\t\t\t\t\t\tif (this.soundEngine) {\n\t\t\t\t\t\t\t\tthis.soundEngine.playDelete()\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}) : EMPTY,\n\t\t\t\t// Small pause before next phrase\n\t\t\t\tshouldDelete ? of(null).pipe(delay(200)) : EMPTY\n\t\t\t)\n\t\t}\n\n\t\t// Create observable that cycles through all phrases\n\t\tconst phrasesSequence = concat(\n\t\t\t...phrases.map((phrase) => typePhrase(phrase))\n\t\t)\n\n\t\t// Add final message if provided\n\t\tconst typingSequence = options.finalMessage\n\t\t\t? concat(\n\t\t\t\t\tphrasesSequence,\n\t\t\t\t\ttypePhrase(options.finalMessage, false) // Don't delete final message\n\t\t\t\t)\n\t\t\t: phrasesSequence\n\n\t\t// Subscribe and optionally loop\n\t\tthis.state.subscription = (\n\t\t\toptions.loop ? phrasesSequence.pipe(repeat()) : typingSequence\n\t\t).subscribe({\n\t\t\terror: (err) => console.error('Typewriter error:', err),\n\t\t})\n\t}\n\n\tprivate getTextNode(targetElement: HTMLElement): Text | null {\n\t\t// Get or create text node (ignoring cursor element)\n\t\tfor (const child of Array.from(targetElement.childNodes)) {\n\t\t\tif (child.nodeType === Node.TEXT_NODE) {\n\t\t\t\treturn child as Text\n\t\t\t}\n\t\t}\n\t\t// Create text node if it doesn't exist\n\t\tconst textNode = document.createTextNode('')\n\t\ttargetElement.insertBefore(textNode, targetElement.firstChild)\n\t\treturn textNode\n\t}\n\n\tprivate cleanup() {\n\t\tif (!this.state) return\n\n\t\t// Unsubscribe from typing observable\n\t\tif (this.state.subscription) {\n\t\t\tthis.state.subscription.unsubscribe()\n\t\t}\n\n\t\t// Remove cursor if present\n\t\tif (this.state.targetElement) {\n\t\t\tconst cursor = this.state.targetElement.querySelector('.typewriter-cursor')\n\t\t\tcursor?.remove()\n\t\t}\n\n\t\t// Cleanup sound engine\n\t\tif (this.soundEngine) {\n\t\t\tthis.soundEngine.cleanup()\n\t\t\tthis.soundEngine = null\n\t\t}\n\n\t\tthis.state = null\n\t}\n\n\toverride disconnected() {\n\t\tthis.cleanup()\n\t}\n\n\toverride reconnected(): void {\n\t\t// Re-start typing if state exists\n\t\tif (this.state && !this.state.subscription) {\n\t\t\tthis.startTyping()\n\t\t}\n\t}\n}\n\nexport const typewriter = directive(TypewriterDirective)\n"],"mappings":"0MAqDA,IAAM,EAAN,KAAA,CAIC,YAAY,EAAiB,GAAA,CAC5B,KAAK,aAAe,IAAI,aACxB,KAAK,OAAS,KAAK,IAAI,EAAG,KAAK,IAAI,EAAG,EAAA,CAAA,CAIvC,cAAA,CACC,IAAM,EAAM,KAAK,aAAa,YAGxB,EAAM,KAAK,aAAa,kBAAA,CACxB,EAAW,KAAK,aAAa,YAAA,CAG7B,EAAW,IAAsB,IAAhB,KAAK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