@mhmo91/schmancy 0.9.16 → 0.9.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/custom-elements.json +26 -5
- package/dist/agent/schmancy.agent.js +119 -15
- package/dist/agent/schmancy.agent.js.map +1 -1
- package/dist/agent/schmancy.manifest.json +134 -7
- package/dist/card-BslSqOsf.cjs.map +1 -1
- package/dist/card-CEdgK9nb.js.map +1 -1
- package/dist/details-B8p62xmR.cjs.map +1 -1
- package/dist/details-CCW52lzz.js.map +1 -1
- package/dist/divider-CbEWg3G_.js.map +1 -1
- package/dist/divider-JyyFw_3J.cjs.map +1 -1
- package/dist/expand-BmwIPNjq.cjs.map +1 -1
- package/dist/expand-bFa_qVDT.js.map +1 -1
- package/dist/handover/agent-runtime-followups.md +1 -1
- package/dist/handover/agent-runtime-v1.md +3 -3
- package/dist/page.cjs.map +1 -1
- package/dist/page.js.map +1 -1
- package/dist/scroll-CdmXRXh2.js.map +1 -1
- package/dist/scroll-V1rAZ9fK.cjs.map +1 -1
- package/dist/surface-0XM4DBaT.js.map +1 -1
- package/dist/surface-B6DA01kL.cjs.map +1 -1
- package/dist/theme-Cq_c9IO3.js.map +1 -1
- package/dist/theme-DU5yXaV-.cjs.map +1 -1
- package/dist/tree.cjs.map +1 -1
- package/dist/tree.js.map +1 -1
- package/package.json +1 -1
- package/src/card/actions.ts +9 -0
- package/src/card/card.ts +18 -0
- package/src/card/content.ts +9 -0
- package/src/card/media.ts +6 -0
- package/src/details/details.ts +12 -0
- package/src/divider/divider.ts +11 -0
- package/src/expand/expand-root.component.ts +12 -0
- package/src/expand/expand.component.ts +14 -0
- package/src/layout/scroll/scroll.ts +5 -1
- package/src/page/page.ts +8 -11
- package/src/surface/surface.ts +4 -10
- package/src/theme/theme.component.ts +10 -15
- package/src/tree/tree.ts +12 -0
- package/types/src/card/actions.d.ts +9 -0
- package/types/src/card/card.d.ts +18 -0
- package/types/src/card/content.d.ts +9 -0
- package/types/src/card/media.d.ts +6 -0
- package/types/src/details/details.d.ts +12 -0
- package/types/src/divider/divider.d.ts +11 -0
- package/types/src/expand/expand-root.component.d.ts +12 -0
- package/types/src/expand/expand.component.d.ts +14 -0
- package/types/src/layout/scroll/scroll.d.ts +5 -1
- package/types/src/page/page.d.ts +8 -11
- package/types/src/surface/surface.d.ts +4 -10
- package/types/src/theme/theme.component.d.ts +10 -15
- package/types/src/tree/tree.d.ts +12 -0
package/dist/tree.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.cjs","names":[],"sources":["../src/tree/tree.ts"],"sourcesContent":["import { TailwindElement } 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 TailwindElement(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":"
|
|
1
|
+
{"version":3,"file":"tree.cjs","names":[],"sources":["../src/tree/tree.ts"],"sourcesContent":["import { TailwindElement } 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 * Expandable tree node — a recursive disclosure widget. One root slot, one default slot for child nodes. Each node can itself contain schmancy-tree children.\n *\n * @element schmancy-tree\n * @summary Use for hierarchical navigation / file-explorer layouts. Each level is a schmancy-tree with a `root` slot (the parent label) and default slot (the children, which may be more schmancy-trees).\n * @example\n * <schmancy-tree>\n * <schmancy-list-item slot=\"root\">src/</schmancy-list-item>\n * <schmancy-tree>\n * <schmancy-list-item slot=\"root\">components/</schmancy-list-item>\n * <schmancy-list-item>button.ts</schmancy-list-item>\n * </schmancy-tree>\n * </schmancy-tree>\n * @platform details toggle - Recursive `<details>`-like disclosure. Degrades to a plain nested list if the tag never registers — loses expand/collapse but stays navigable.\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 TailwindElement(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":"uRAuBO,IAAA,EAAA,cAA2B,EAAA,EAAgB,EAAA,GAAG;;;;;;;;;;;;;4CAiBhB,EAAA,KAAA,QAQT,iBAAiB,KAAK,QAAA,CAAS,SAAS,GAAA,CAAI,MAAM,EAAG,GAAA,GAAA,KAAA,gBAAA,CAK/E,GAAA,CAAM,OAAO,KAAK,iBAAA,MAAA,CAA4B,WAAA,CAJ/C,IAAA,YAAY,CAAe,MAAO,GAAG,KAAK,QAAA,UAO1C,QAAQ,EAAA,CACP,MAAM,UAAU,EAAA,CACZ,EAAQ,IAAI,OAAA,GACX,KAAK,KAAM,KAAK,YAAY,OAAO,IAAI,OAAA,CACtC,KAAK,YAAY,OAAO,OAAO,OAAA,EAItC,cAAA,CAEM,KAAK,OACT,KAAK,YAAY,OAAA,CAAS,IAgB3B,EAAA,EAAA,QAAA,EAAA,EAAA,WAZ2C,KAAK,QAAS,QAAA,CAAS,MAAA,EAAA,EAAA,WACvD,KAAK,cAAA,EAAc,EAAA,EAAA,KACzB,GAAA,CACH,EAAE,gBAAA,CACF,EAAE,iBAAA,CACF,KAAK,cAAc,IAAI,YAAY,SAAU,CAAE,QAAA,CAAS,EAAO,SAAA,CAAU,EAAA,CAAA,CAAA,EAAA,CAAA,EAOrE,EAAA,EAAA,WAFsC,KAAK,QAAS,QAAA,CAAA,CAGxD,MAAA,EAAA,EAAA,eAAA,CAIC,IAAM,EAAU,KAAK,KAAO,IAAM,EAC5B,EAAQ,KAAK,KAAO,EAAI,IACxB,EAAmB,KAAK,QAAQ,QACrC,CAAC,CAAE,UAAW,UAAU,EAAA,MAAA,CAAiB,CAAE,UAAW,UAAU,EAAA,MAAA,CAAA,CAChE,CACC,SAAU,IACV,OAAQ,UACR,KAAM,WAAA,CAAA,CAKH,KAAK,OAET,KAAK,YAAY,OAAA,CAAS,GAG3B,IAAM,EAAc,QAAK,KACnB,EAAY,OAAK,KAEjB,EAAgB,KAAK,YAAY,QAAQ,CAAC,CAAE,QAAS,EAAA,CAAe,CAAE,QAAS,EAAA,CAAA,CAAc,CAClG,SAAU,IACV,OAAQ,WACR,KAAM,WAAA,CAAA,CAcP,MAVA,GAAc,aAAA,CACT,KAAK,KACR,KAAK,YAAY,OAAA,CAAS,GAE1B,KAAK,YAAY,MAAM,OAAS,OAChC,KAAK,YAAY,MAAM,QAAU,OAKnC,EAAA,EAAA,MAAA,EAAA,EAAA,WAAqB,EAAkB,SAAA,EAAS,EAAA,EAAA,WAAY,EAAe,SAAA,CAAA,CAAW,MAAA,EAAA,EAAA,WAC3E,KAAK,cAAA,CAAA,EAAA,EAEf,EAAA,EAAA,SAAA,CAGD,KAAK,KAAA,CAAQ,KAAK,MAAA,EACjB,EAAA,EAAA,WACQ,KAAK,cAAA,CAAA,CAEf,WAAA,CAGH,QAAA,CACC,MAAO,GAAA,IAAI;;;;;;;;;;qBAUQ,KAAK,KAAO,OAAS,QAAA;qBACrB,KAAK,WAAA;kBACR,KAAK,KAAO,WAAa,SAAA;cAC5B,GAAa,EAAE,iBAAA,CAAA;;;;;;;cAOhB,KAAK,WAAA;0BAvHR,CAAE,KAAM,QAAA,CAAA,CAAA,CAAU,EAAA,UAAA,OAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAErB,WAAA,CAAA,CAAW,EAAA,UAAA,UAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OACX,0BAAA,CAAA,CAA0B,EAAA,UAAA,cAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,OAG1B,WAAA,CAAA,CAAW,EAAA,UAAA,UAAA,IAAA,GAAA,CAAA,EAAA,EAAA,EAAA,EAAA,EAAA,EAAA,eAxBJ,gBAAA,CAAA,CAAgB,EAAA,CAAA,OAAA,eAAA,QAAA,eAAA,CAAA,WAAA,CAAA,EAAA,IAAA,UAAA,CAAA,OAAA,GAAA,CAAA"}
|
package/dist/tree.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","names":[],"sources":["../src/tree/tree.ts"],"sourcesContent":["import { TailwindElement } 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 TailwindElement(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":";;;;;;
|
|
1
|
+
{"version":3,"file":"tree.js","names":[],"sources":["../src/tree/tree.ts"],"sourcesContent":["import { TailwindElement } 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 * Expandable tree node — a recursive disclosure widget. One root slot, one default slot for child nodes. Each node can itself contain schmancy-tree children.\n *\n * @element schmancy-tree\n * @summary Use for hierarchical navigation / file-explorer layouts. Each level is a schmancy-tree with a `root` slot (the parent label) and default slot (the children, which may be more schmancy-trees).\n * @example\n * <schmancy-tree>\n * <schmancy-list-item slot=\"root\">src/</schmancy-list-item>\n * <schmancy-tree>\n * <schmancy-list-item slot=\"root\">components/</schmancy-list-item>\n * <schmancy-list-item>button.ts</schmancy-list-item>\n * </schmancy-tree>\n * </schmancy-tree>\n * @platform details toggle - Recursive `<details>`-like disclosure. Degrades to a plain nested list if the tag never registers — loses expand/collapse but stays navigable.\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 TailwindElement(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":";;;;;;AAuBO,IAAA,IAAA,cAA2B,EAAgB,CAAG;;;;;;;;;;;;;;;4BAiBhB,GAAA,KAAA,UAQT,iBAAiB,KAAK,QAAA,CAAS,SAAS,GAAA,CAAI,MAAM,GAAG,GAAA,IAAA,KAAA,oBAAA;AAK/E,OAAA;AAAM,WAAO,KAAK,iBAAA;WAAA;AAA4B;;MAAA;;CAJ/C,IAAA,aAAY;AAAe,SAAO,GAAG,KAAK,QAAA;;CAO1C,QAAQ,GAAA;AACP,QAAM,UAAU,EAAA,EACZ,EAAQ,IAAI,OAAA,KACX,KAAK,OAAM,KAAK,YAAY,OAAO,IAAI,OAAA,GACtC,KAAK,YAAY,OAAO,OAAO,OAAA;;CAItC,eAAA;AAEM,OAAK,SACT,KAAK,YAAY,SAAA,CAAS,IAgB3B,EAZqB,EAAsB,KAAK,SAAS,QAAA,CAAS,KACjE,EAAU,KAAK,cAAA,EACf,GAAI,MAAA;AACH,KAAE,gBAAA,EACF,EAAE,iBAAA,EACF,KAAK,cAAc,IAAI,YAAY,UAAU;IAAE,SAAA,CAAS;IAAO,UAAA,CAAU;IAAA,CAAA,CAAA;IAAA,CAAA,EAKrD,EAAsB,KAAK,SAAS,QAAA,CAAA,CAGxD,KACA,QAAA;GAGC,IAAM,IAAU,KAAK,OAAO,MAAM,GAC5B,IAAQ,KAAK,OAAO,IAAI,KACxB,IAAmB,KAAK,QAAQ,QACrC,CAAC,EAAE,WAAW,UAAU,EAAA,OAAA,EAAiB,EAAE,WAAW,UAAU,EAAA,OAAA,CAAA,EAChE;IACC,UAAU;IACV,QAAQ;IACR,MAAM;IAAA,CAAA;AAKH,QAAK,SAET,KAAK,YAAY,SAAA,CAAS;GAG3B,IAAM,IAAc,QAAK,MACnB,IAAY,OAAK,MAEjB,IAAgB,KAAK,YAAY,QAAQ,CAAC,EAAE,SAAS,GAAA,EAAe,EAAE,SAAS,GAAA,CAAA,EAAc;IAClG,UAAU;IACV,QAAQ;IACR,MAAM;IAAA,CAAA;AAcP,UAVA,EAAc,iBAAA;AACT,SAAK,OACR,KAAK,YAAY,SAAA,CAAS,KAE1B,KAAK,YAAY,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;AAEC,QAAK,OAAA,CAAQ,KAAK;IAAA,EAEnB,EAAU,KAAK,cAAA,CAAA,CAEf,WAAA;;CAGH,SAAA;AACC,SAAO,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,CAxBlB,EAAc,gBAAA,CAAA,EAAgB,EAAA;AAAA,SAAA,KAAA"}
|
package/package.json
CHANGED
package/src/card/actions.ts
CHANGED
|
@@ -3,7 +3,16 @@ import { css, html } from 'lit'
|
|
|
3
3
|
import { customElement } from 'lit/decorators.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Action row of a schmancy-card — holds the card's buttons / links (typically aligned bottom-right).
|
|
7
|
+
*
|
|
6
8
|
* @element schmancy-card-action
|
|
9
|
+
* @summary Always nested inside schmancy-card. Holds the primary + secondary CTAs for the card.
|
|
10
|
+
* @example
|
|
11
|
+
* <schmancy-card-action>
|
|
12
|
+
* <schmancy-button variant="text">Cancel</schmancy-button>
|
|
13
|
+
* <schmancy-button variant="filled">Save</schmancy-button>
|
|
14
|
+
* </schmancy-card-action>
|
|
15
|
+
* @platform div - Styled flex container. Degrades to a plain div if the tag never registers.
|
|
7
16
|
* @slot - The content of the action
|
|
8
17
|
*/
|
|
9
18
|
@customElement('schmancy-card-action')
|
package/src/card/card.ts
CHANGED
|
@@ -4,6 +4,24 @@ import { customElement, property, state } from 'lit/decorators.js'
|
|
|
4
4
|
import { cursorGlow } from '../directives/cursor-glow'
|
|
5
5
|
import { ifDefined } from 'lit/directives/if-defined.js'
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Material Design card — a surface-level container for grouping related content with media / content / actions slots.
|
|
9
|
+
*
|
|
10
|
+
* @element schmancy-card
|
|
11
|
+
* @summary Use for discrete pieces of content that appear in a list (a product, a note, a message). Combine with schmancy-card-media / schmancy-card-content / schmancy-card-action children.
|
|
12
|
+
* @example
|
|
13
|
+
* <schmancy-card type="elevated" href="/items/42">
|
|
14
|
+
* <schmancy-card-media src="/thumb.jpg" alt="Thumbnail"></schmancy-card-media>
|
|
15
|
+
* <schmancy-card-content>
|
|
16
|
+
* <h3>Title</h3>
|
|
17
|
+
* <p>One-line description of the card's content.</p>
|
|
18
|
+
* </schmancy-card-content>
|
|
19
|
+
* <schmancy-card-action>
|
|
20
|
+
* <schmancy-button variant="text">Open</schmancy-button>
|
|
21
|
+
* </schmancy-card-action>
|
|
22
|
+
* </schmancy-card>
|
|
23
|
+
* @platform div - Styled `<div>`; becomes an `<a>` when `href` is set so the whole card is a single interactive surface. Degrades to a plain div/a if the tag never registers.
|
|
24
|
+
*/
|
|
7
25
|
@customElement('schmancy-card')
|
|
8
26
|
export default class SchmancyCard extends TailwindElement(css`
|
|
9
27
|
:host {
|
package/src/card/content.ts
CHANGED
|
@@ -3,7 +3,16 @@ import { css, html } from 'lit'
|
|
|
3
3
|
import { customElement } from 'lit/decorators.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Content region of a schmancy-card — holds the card's headline, supporting text, and inline controls.
|
|
7
|
+
*
|
|
6
8
|
* @element schmancy-card-content
|
|
9
|
+
* @summary Always nested inside schmancy-card. The padded content block between the media and action rows.
|
|
10
|
+
* @example
|
|
11
|
+
* <schmancy-card-content>
|
|
12
|
+
* <h3>Card title</h3>
|
|
13
|
+
* <p>Supporting text that describes the card's subject.</p>
|
|
14
|
+
* </schmancy-card-content>
|
|
15
|
+
* @platform div - Styled `<div>` with padding. Degrades to a plain div if the tag never registers.
|
|
7
16
|
*/
|
|
8
17
|
@customElement('schmancy-card-content')
|
|
9
18
|
export default class SchmancyCardContent extends TailwindElement(css`
|
package/src/card/media.ts
CHANGED
|
@@ -3,7 +3,13 @@ import { css, html } from 'lit'
|
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Media region of a schmancy-card — the image / thumbnail at the top of the card.
|
|
7
|
+
*
|
|
6
8
|
* @element schmancy-card-media
|
|
9
|
+
* @summary Always nested inside schmancy-card. Pass `src` + `alt` props or slot an `<img>` / `<video>` for custom media.
|
|
10
|
+
* @example
|
|
11
|
+
* <schmancy-card-media src="/thumb.jpg" alt="Product photo"></schmancy-card-media>
|
|
12
|
+
* @platform img - Renders an `<img>` (or wraps a slotted media element). Degrades to a styled `<img>` if the tag never registers.
|
|
7
13
|
*/
|
|
8
14
|
@customElement('schmancy-card-media')
|
|
9
15
|
export default class SchmancyCardMedia extends TailwindElement(css`
|
package/src/details/details.ts
CHANGED
|
@@ -9,6 +9,18 @@ import { distinctUntilChanged, filter, take, takeUntil, tap } from 'rxjs/operato
|
|
|
9
9
|
import { SPRING_SNAPPY } from '../utils/animation.js'
|
|
10
10
|
import { reducedMotion$ } from '../directives/reduced-motion'
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Expandable disclosure panel — a styled `<details>` / `<summary>` pair with animated expand + overlay options.
|
|
14
|
+
*
|
|
15
|
+
* @element schmancy-details
|
|
16
|
+
* @summary Use for progressive-disclosure content: FAQs, collapsible settings sections, accordion-style lists. Prefer schmancy-expand for full-page accordions where only one section can be open at a time.
|
|
17
|
+
* @example
|
|
18
|
+
* <schmancy-details summary="Shipping details">
|
|
19
|
+
* <p>Order ships in 2 business days.</p>
|
|
20
|
+
* </schmancy-details>
|
|
21
|
+
* @platform details toggle - Wraps native `<details>`/`<summary>`. Degrades to the native element if the tag never registers — same keyboard accessibility, just no animation.
|
|
22
|
+
* @fires toggle - When the open state changes (bubbles from the native `<details>`).
|
|
23
|
+
*/
|
|
12
24
|
@customElement('schmancy-details')
|
|
13
25
|
export default class SchmancyDetails extends SurfaceMixin(
|
|
14
26
|
TailwindElement(css`
|
package/src/divider/divider.ts
CHANGED
|
@@ -3,6 +3,17 @@ import { $LitElement } from '@mixins/index'
|
|
|
3
3
|
import { css, html } from 'lit'
|
|
4
4
|
import { customElement, property } from 'lit/decorators.js'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Thin horizontal (or vertical) separator rule between sections of content.
|
|
8
|
+
*
|
|
9
|
+
* @element schmancy-divider
|
|
10
|
+
* @summary Semantic separator between groups — list items, menu sections, content blocks. Uses outline theme token.
|
|
11
|
+
* @example
|
|
12
|
+
* <schmancy-list-item>First</schmancy-list-item>
|
|
13
|
+
* <schmancy-divider></schmancy-divider>
|
|
14
|
+
* <schmancy-list-item>Second</schmancy-list-item>
|
|
15
|
+
* @platform hr - Styled horizontal rule. Degrades to a native `<hr>` if the tag never registers.
|
|
16
|
+
*/
|
|
6
17
|
@customElement('schmancy-divider')
|
|
7
18
|
export default class SchmancyDivider extends $LitElement(css`
|
|
8
19
|
:host {
|
|
@@ -7,6 +7,18 @@ import { SPRING_SMOOTH } from '../utils/animation.js'
|
|
|
7
7
|
import { reducedMotion$ } from '../directives/reduced-motion'
|
|
8
8
|
import '../surface/surface.js'
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Container for schmancy-expand children — coordinates mutual-exclusion so only one child is open at a time. Also renders the portal panel that the active child expands into.
|
|
12
|
+
*
|
|
13
|
+
* @element schmancy-expand-root
|
|
14
|
+
* @summary Always wrap a group of schmancy-expand children. Without a root, each schmancy-expand behaves independently (which is usually not what you want — prefer schmancy-details for that).
|
|
15
|
+
* @example
|
|
16
|
+
* <schmancy-expand-root>
|
|
17
|
+
* <schmancy-expand summary="Step 1">…</schmancy-expand>
|
|
18
|
+
* <schmancy-expand summary="Step 2">…</schmancy-expand>
|
|
19
|
+
* </schmancy-expand-root>
|
|
20
|
+
* @platform div - Coordinating wrapper. Degrades to a plain div if the tag never registers — children fall back to independent `<details>` behavior.
|
|
21
|
+
*/
|
|
10
22
|
@customElement('schmancy-expand-root')
|
|
11
23
|
export class SchmancyExpandRoot extends SurfaceMixin(TailwindElement(css`
|
|
12
24
|
:host {
|
|
@@ -12,6 +12,20 @@ import { SchmancyExpandRoot } from './expand-root.component.js'
|
|
|
12
12
|
/** Dispatch this event on window to close whichever schmancy-expand is currently open */
|
|
13
13
|
export const SCHMANCY_EXPAND_REQUEST_CLOSE = 'schmancy-expand-request-close'
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Accordion-style section — expands on click, coordinates with siblings via schmancy-expand-root to close any sibling when a new one opens. Only one schmancy-expand can be open at a time within the same root.
|
|
17
|
+
*
|
|
18
|
+
* @element schmancy-expand
|
|
19
|
+
* @summary Use for grouped progressive-disclosure where only one section should be open at a time. Prefer schmancy-details when sections should be independent.
|
|
20
|
+
* @example
|
|
21
|
+
* <schmancy-expand-root>
|
|
22
|
+
* <schmancy-expand summary="Billing">Billing form…</schmancy-expand>
|
|
23
|
+
* <schmancy-expand summary="Shipping">Shipping form…</schmancy-expand>
|
|
24
|
+
* <schmancy-expand summary="Review">Order review…</schmancy-expand>
|
|
25
|
+
* </schmancy-expand-root>
|
|
26
|
+
* @platform details toggle - Schmancy-skinned accordion section. Degrades to `<details>` if the tag never registers — loses mutual-exclusion behavior but stays functional.
|
|
27
|
+
* @fires toggle - When the open state changes.
|
|
28
|
+
*/
|
|
15
29
|
@customElement('schmancy-expand')
|
|
16
30
|
export default class SchmancyExpand extends TailwindElement(css`
|
|
17
31
|
:host {
|
|
@@ -49,7 +49,11 @@ declare global {
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* Scrollable container with debounced scroll events, horizontal/vertical direction, optional hidden scrollbar, and programmatic scrollTo via command events or refs.
|
|
53
|
+
*
|
|
54
|
+
* @element schmancy-scroll
|
|
55
|
+
* @summary Use anywhere you'd reach for `overflow: auto` but also need debounced scroll events (for sticky headers, scroll spies, virtualization triggers) or the ability to drive scroll from elsewhere in the app by dispatching a schmancy-scroll-command event.
|
|
56
|
+
* @platform div - Styled scrollable `<div>`. Degrades to a plain scrollable div if the tag never registers — loses the debounced scroll event and the command-bus integration.
|
|
53
57
|
*
|
|
54
58
|
* @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)
|
|
55
59
|
* @slot - Default slot for content to be scrolled
|
package/src/page/page.ts
CHANGED
|
@@ -8,20 +8,17 @@ import { theme } from '../theme/theme.service'
|
|
|
8
8
|
import { fromResizeObserver } from '../directives/layout'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* Prevents double-tap zoom, pull-to-refresh, rubber-banding.
|
|
13
|
-
* Automatically fills remaining viewport height.
|
|
11
|
+
* Mobile-first page container — fills remaining viewport height, suppresses double-tap zoom / pull-to-refresh / rubber-banding. Lays children in a CSS grid whose row template is `rows`.
|
|
14
12
|
*
|
|
15
13
|
* @element schmancy-page
|
|
16
|
-
*
|
|
14
|
+
* @summary The root of any app view — wraps header / main / footer children in a full-viewport grid. Use rows="auto_1fr_auto" to make the middle child scroll while header/footer stay pinned.
|
|
17
15
|
* @example
|
|
18
|
-
*
|
|
19
|
-
* <schmancy-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* `
|
|
16
|
+
* <schmancy-page rows="auto_1fr_auto">
|
|
17
|
+
* <schmancy-nav-drawer-appbar>Title</schmancy-nav-drawer-appbar>
|
|
18
|
+
* <main>Scrollable content</main>
|
|
19
|
+
* <schmancy-navigation-bar></schmancy-navigation-bar>
|
|
20
|
+
* </schmancy-page>
|
|
21
|
+
* @platform div - Full-height CSS-grid container. Degrades to a plain div if the tag never registers — children still flow vertically but without the height fill and gesture suppression.
|
|
25
22
|
*/
|
|
26
23
|
@customElement('schmancy-page')
|
|
27
24
|
export class SchmancyPage extends $LitElement(css`
|
package/src/surface/surface.ts
CHANGED
|
@@ -11,22 +11,16 @@ export const SchmancySurfaceTypeContext = createContext<TSurfaceColor>('surface'
|
|
|
11
11
|
export type { SchmancySurfaceFill, SchmancySurfaceRounded, SchmancySurfaceElevation } from '@mixins/surface.mixin'
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* This component renders a styled container that adapts its dimensions based on the `fill` property.
|
|
17
|
-
* It supports various rounding options, elevation levels, and applies background and text color classes
|
|
18
|
-
* based on the specified surface variant. Additionally, when the `scroller` property is true, the component
|
|
19
|
-
* enables internal scrolling by applying overflow and scroll-behavior styles.
|
|
20
|
-
*
|
|
21
|
-
* SurfaceMixin automatically provides surfaceStyles CSS.
|
|
14
|
+
* Themed container — the root surface primitive. Sets background, text color, rounding, elevation, and (optionally) internal scroll. Provides a `SchmancySurfaceTypeContext` so descendants can adapt to the enclosing surface variant.
|
|
22
15
|
*
|
|
23
16
|
* @element schmancy-surface
|
|
24
|
-
* @
|
|
25
|
-
*
|
|
17
|
+
* @summary Wrap a region of a page when you need it to pick up theme tokens (background + on-color + elevation). Nest surfaces to express Material Design's hierarchical color stacking.
|
|
26
18
|
* @example
|
|
27
19
|
* <schmancy-surface fill="all" rounded="all" elevation="3" type="surfaceBright" scroller>
|
|
28
20
|
* <p>Your scrollable content here</p>
|
|
29
21
|
* </schmancy-surface>
|
|
22
|
+
* @platform div - Styled `<div>` with theme-driven background/color/elevation. Degrades to a plain `<div>` if the tag never registers — text stays readable, just loses theming.
|
|
23
|
+
* @slot - Default slot for projecting child content.
|
|
30
24
|
*/
|
|
31
25
|
@customElement('schmancy-surface')
|
|
32
26
|
export class SchmancySurface extends SurfaceMixin(
|
|
@@ -27,28 +27,23 @@ const $colorScheme = new Observable<string>(subscriber => {
|
|
|
27
27
|
})
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* This component manages color schemes, primary colors, and theme distribution
|
|
33
|
-
* throughout the component tree. It can be used at the root level or nested
|
|
34
|
-
* to provide different themes to different parts of the application.
|
|
30
|
+
* Theme provider — generates a Material 3 palette from a seed color, resolves light/dark scheme, and publishes the token set to descendants as CSS custom properties (var(--schmancy-sys-color-…)).
|
|
35
31
|
*
|
|
36
32
|
* @element schmancy-theme
|
|
37
|
-
*
|
|
33
|
+
* @summary Always wrap your app root in a `<schmancy-theme root scheme="auto" color="#…">`. Nest additional `<schmancy-theme>` blocks to override theming for a subtree.
|
|
38
34
|
* @example
|
|
39
|
-
* ```html
|
|
40
35
|
* <!-- Root theme provider -->
|
|
41
|
-
* <schmancy-theme
|
|
36
|
+
* <schmancy-theme root scheme="auto" color="#6200ee">
|
|
42
37
|
* <your-app></your-app>
|
|
43
38
|
* </schmancy-theme>
|
|
44
|
-
*
|
|
45
|
-
* <!-- Nested theme for specific section -->
|
|
46
|
-
* <schmancy-theme
|
|
47
|
-
* <
|
|
48
|
-
* <!-- Components here
|
|
49
|
-
* </
|
|
39
|
+
* @example
|
|
40
|
+
* <!-- Nested theme for a specific section -->
|
|
41
|
+
* <schmancy-theme scheme="dark" color="#2196f3">
|
|
42
|
+
* <schmancy-surface fill="all">
|
|
43
|
+
* <!-- Components here use the blue dark theme -->
|
|
44
|
+
* </schmancy-surface>
|
|
50
45
|
* </schmancy-theme>
|
|
51
|
-
*
|
|
46
|
+
* @platform div - Styled `<div>` that publishes theme tokens via inline `--schmancy-sys-color-*` custom properties. Degrades to a plain div if the tag never registers — children lose theming and fall back to browser defaults.
|
|
52
47
|
*/
|
|
53
48
|
@customElement('schmancy-theme')
|
|
54
49
|
export class SchmancyThemeComponent extends $LitElement(tailwindStyles) {
|
package/src/tree/tree.ts
CHANGED
|
@@ -4,7 +4,19 @@ import { customElement, property, query } from 'lit/decorators.js'
|
|
|
4
4
|
import { fromEvent, merge, switchMap, takeUntil, tap, zip } from 'rxjs'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Expandable tree node — a recursive disclosure widget. One root slot, one default slot for child nodes. Each node can itself contain schmancy-tree children.
|
|
8
|
+
*
|
|
7
9
|
* @element schmancy-tree
|
|
10
|
+
* @summary Use for hierarchical navigation / file-explorer layouts. Each level is a schmancy-tree with a `root` slot (the parent label) and default slot (the children, which may be more schmancy-trees).
|
|
11
|
+
* @example
|
|
12
|
+
* <schmancy-tree>
|
|
13
|
+
* <schmancy-list-item slot="root">src/</schmancy-list-item>
|
|
14
|
+
* <schmancy-tree>
|
|
15
|
+
* <schmancy-list-item slot="root">components/</schmancy-list-item>
|
|
16
|
+
* <schmancy-list-item>button.ts</schmancy-list-item>
|
|
17
|
+
* </schmancy-tree>
|
|
18
|
+
* </schmancy-tree>
|
|
19
|
+
* @platform details toggle - Recursive `<details>`-like disclosure. Degrades to a plain nested list if the tag never registers — loses expand/collapse but stays navigable.
|
|
8
20
|
* @slot root - The root element of the tree
|
|
9
21
|
* @slot - The children of the tree
|
|
10
22
|
*/
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
declare const SchmancyCardAction_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
2
2
|
/**
|
|
3
|
+
* Action row of a schmancy-card — holds the card's buttons / links (typically aligned bottom-right).
|
|
4
|
+
*
|
|
3
5
|
* @element schmancy-card-action
|
|
6
|
+
* @summary Always nested inside schmancy-card. Holds the primary + secondary CTAs for the card.
|
|
7
|
+
* @example
|
|
8
|
+
* <schmancy-card-action>
|
|
9
|
+
* <schmancy-button variant="text">Cancel</schmancy-button>
|
|
10
|
+
* <schmancy-button variant="filled">Save</schmancy-button>
|
|
11
|
+
* </schmancy-card-action>
|
|
12
|
+
* @platform div - Styled flex container. Degrades to a plain div if the tag never registers.
|
|
4
13
|
* @slot - The content of the action
|
|
5
14
|
*/
|
|
6
15
|
export default class SchmancyCardAction extends SchmancyCardAction_base {
|
package/types/src/card/card.d.ts
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
declare const SchmancyCard_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
3
|
+
/**
|
|
4
|
+
* Material Design card — a surface-level container for grouping related content with media / content / actions slots.
|
|
5
|
+
*
|
|
6
|
+
* @element schmancy-card
|
|
7
|
+
* @summary Use for discrete pieces of content that appear in a list (a product, a note, a message). Combine with schmancy-card-media / schmancy-card-content / schmancy-card-action children.
|
|
8
|
+
* @example
|
|
9
|
+
* <schmancy-card type="elevated" href="/items/42">
|
|
10
|
+
* <schmancy-card-media src="/thumb.jpg" alt="Thumbnail"></schmancy-card-media>
|
|
11
|
+
* <schmancy-card-content>
|
|
12
|
+
* <h3>Title</h3>
|
|
13
|
+
* <p>One-line description of the card's content.</p>
|
|
14
|
+
* </schmancy-card-content>
|
|
15
|
+
* <schmancy-card-action>
|
|
16
|
+
* <schmancy-button variant="text">Open</schmancy-button>
|
|
17
|
+
* </schmancy-card-action>
|
|
18
|
+
* </schmancy-card>
|
|
19
|
+
* @platform div - Styled `<div>`; becomes an `<a>` when `href` is set so the whole card is a single interactive surface. Degrades to a plain div/a if the tag never registers.
|
|
20
|
+
*/
|
|
3
21
|
export default class SchmancyCard extends SchmancyCard_base {
|
|
4
22
|
protected static shadowRootOptions: {
|
|
5
23
|
mode: string;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
declare const SchmancyCardContent_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
2
2
|
/**
|
|
3
|
+
* Content region of a schmancy-card — holds the card's headline, supporting text, and inline controls.
|
|
4
|
+
*
|
|
3
5
|
* @element schmancy-card-content
|
|
6
|
+
* @summary Always nested inside schmancy-card. The padded content block between the media and action rows.
|
|
7
|
+
* @example
|
|
8
|
+
* <schmancy-card-content>
|
|
9
|
+
* <h3>Card title</h3>
|
|
10
|
+
* <p>Supporting text that describes the card's subject.</p>
|
|
11
|
+
* </schmancy-card-content>
|
|
12
|
+
* @platform div - Styled `<div>` with padding. Degrades to a plain div if the tag never registers.
|
|
4
13
|
*/
|
|
5
14
|
export default class SchmancyCardContent extends SchmancyCardContent_base {
|
|
6
15
|
protected render(): unknown;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
declare const SchmancyCardMedia_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
2
2
|
/**
|
|
3
|
+
* Media region of a schmancy-card — the image / thumbnail at the top of the card.
|
|
4
|
+
*
|
|
3
5
|
* @element schmancy-card-media
|
|
6
|
+
* @summary Always nested inside schmancy-card. Pass `src` + `alt` props or slot an `<img>` / `<video>` for custom media.
|
|
7
|
+
* @example
|
|
8
|
+
* <schmancy-card-media src="/thumb.jpg" alt="Product photo"></schmancy-card-media>
|
|
9
|
+
* @platform img - Renders an `<img>` (or wraps a slotted media element). Degrades to a styled `<img>` if the tag never registers.
|
|
4
10
|
*/
|
|
5
11
|
export default class SchmancyCardMedia extends SchmancyCardMedia_base {
|
|
6
12
|
src: string;
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
declare const SchmancyDetails_base: import("@mixins/index").Constructor<import("@mixins/index").ISurfaceMixin> & import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
3
|
+
/**
|
|
4
|
+
* Expandable disclosure panel — a styled `<details>` / `<summary>` pair with animated expand + overlay options.
|
|
5
|
+
*
|
|
6
|
+
* @element schmancy-details
|
|
7
|
+
* @summary Use for progressive-disclosure content: FAQs, collapsible settings sections, accordion-style lists. Prefer schmancy-expand for full-page accordions where only one section can be open at a time.
|
|
8
|
+
* @example
|
|
9
|
+
* <schmancy-details summary="Shipping details">
|
|
10
|
+
* <p>Order ships in 2 business days.</p>
|
|
11
|
+
* </schmancy-details>
|
|
12
|
+
* @platform details toggle - Wraps native `<details>`/`<summary>`. Degrades to the native element if the tag never registers — same keyboard accessibility, just no animation.
|
|
13
|
+
* @fires toggle - When the open state changes (bubbles from the native `<details>`).
|
|
14
|
+
*/
|
|
3
15
|
export default class SchmancyDetails extends SchmancyDetails_base {
|
|
4
16
|
protected static shadowRootOptions: {
|
|
5
17
|
mode: "open";
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
declare const SchmancyDivider_base: CustomElementConstructor & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
2
|
+
/**
|
|
3
|
+
* Thin horizontal (or vertical) separator rule between sections of content.
|
|
4
|
+
*
|
|
5
|
+
* @element schmancy-divider
|
|
6
|
+
* @summary Semantic separator between groups — list items, menu sections, content blocks. Uses outline theme token.
|
|
7
|
+
* @example
|
|
8
|
+
* <schmancy-list-item>First</schmancy-list-item>
|
|
9
|
+
* <schmancy-divider></schmancy-divider>
|
|
10
|
+
* <schmancy-list-item>Second</schmancy-list-item>
|
|
11
|
+
* @platform hr - Styled horizontal rule. Degrades to a native `<hr>` if the tag never registers.
|
|
12
|
+
*/
|
|
2
13
|
export default class SchmancyDivider extends SchmancyDivider_base {
|
|
3
14
|
outline: 'default' | 'variant';
|
|
4
15
|
vertical: boolean;
|
|
@@ -2,6 +2,18 @@ import { nothing } from 'lit';
|
|
|
2
2
|
import type { TSurfaceColor } from '@schmancy/types';
|
|
3
3
|
import '../surface/surface.js';
|
|
4
4
|
declare const SchmancyExpandRoot_base: import("@mixins/index").Constructor<import("@mixins/index").ISurfaceMixin> & import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
5
|
+
/**
|
|
6
|
+
* Container for schmancy-expand children — coordinates mutual-exclusion so only one child is open at a time. Also renders the portal panel that the active child expands into.
|
|
7
|
+
*
|
|
8
|
+
* @element schmancy-expand-root
|
|
9
|
+
* @summary Always wrap a group of schmancy-expand children. Without a root, each schmancy-expand behaves independently (which is usually not what you want — prefer schmancy-details for that).
|
|
10
|
+
* @example
|
|
11
|
+
* <schmancy-expand-root>
|
|
12
|
+
* <schmancy-expand summary="Step 1">…</schmancy-expand>
|
|
13
|
+
* <schmancy-expand summary="Step 2">…</schmancy-expand>
|
|
14
|
+
* </schmancy-expand-root>
|
|
15
|
+
* @platform div - Coordinating wrapper. Degrades to a plain div if the tag never registers — children fall back to independent `<details>` behavior.
|
|
16
|
+
*/
|
|
5
17
|
export declare class SchmancyExpandRoot extends SchmancyExpandRoot_base {
|
|
6
18
|
type: TSurfaceColor;
|
|
7
19
|
isOpen: boolean;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
/** Dispatch this event on window to close whichever schmancy-expand is currently open */
|
|
2
2
|
export declare const SCHMANCY_EXPAND_REQUEST_CLOSE = "schmancy-expand-request-close";
|
|
3
3
|
declare const SchmancyExpand_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
4
|
+
/**
|
|
5
|
+
* Accordion-style section — expands on click, coordinates with siblings via schmancy-expand-root to close any sibling when a new one opens. Only one schmancy-expand can be open at a time within the same root.
|
|
6
|
+
*
|
|
7
|
+
* @element schmancy-expand
|
|
8
|
+
* @summary Use for grouped progressive-disclosure where only one section should be open at a time. Prefer schmancy-details when sections should be independent.
|
|
9
|
+
* @example
|
|
10
|
+
* <schmancy-expand-root>
|
|
11
|
+
* <schmancy-expand summary="Billing">Billing form…</schmancy-expand>
|
|
12
|
+
* <schmancy-expand summary="Shipping">Shipping form…</schmancy-expand>
|
|
13
|
+
* <schmancy-expand summary="Review">Order review…</schmancy-expand>
|
|
14
|
+
* </schmancy-expand-root>
|
|
15
|
+
* @platform details toggle - Schmancy-skinned accordion section. Degrades to `<details>` if the tag never registers — loses mutual-exclusion behavior but stays functional.
|
|
16
|
+
* @fires toggle - When the open state changes.
|
|
17
|
+
*/
|
|
4
18
|
export default class SchmancyExpand extends SchmancyExpand_base {
|
|
5
19
|
summary: string;
|
|
6
20
|
open: boolean;
|
|
@@ -41,7 +41,11 @@ declare global {
|
|
|
41
41
|
}
|
|
42
42
|
declare const SchmancyScroll_base: import("@mixins/index").Constructor<CustomElementConstructor> & import("@mixins/index").Constructor<import("@mixins/index").ITailwindElementMixin> & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Scrollable container with debounced scroll events, horizontal/vertical direction, optional hidden scrollbar, and programmatic scrollTo via command events or refs.
|
|
45
|
+
*
|
|
46
|
+
* @element schmancy-scroll
|
|
47
|
+
* @summary Use anywhere you'd reach for `overflow: auto` but also need debounced scroll events (for sticky headers, scroll spies, virtualization triggers) or the ability to drive scroll from elsewhere in the app by dispatching a schmancy-scroll-command event.
|
|
48
|
+
* @platform div - Styled scrollable `<div>`. Degrades to a plain scrollable div if the tag never registers — loses the debounced scroll event and the command-bus integration.
|
|
45
49
|
*
|
|
46
50
|
* @fires {SchmancyScrollEvent} scroll - Fired when scrolling occurs (with a configurable debounce)
|
|
47
51
|
* @slot - Default slot for content to be scrolled
|
package/types/src/page/page.d.ts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import '../layout/scroll/scroll';
|
|
2
2
|
declare const SchmancyPage_base: CustomElementConstructor & import("@mixins/index").Constructor<import("lit").LitElement> & import("@mixins/index").Constructor<import("@mixins/index").IBaseMixin>;
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* Prevents double-tap zoom, pull-to-refresh, rubber-banding.
|
|
6
|
-
* Automatically fills remaining viewport height.
|
|
4
|
+
* Mobile-first page container — fills remaining viewport height, suppresses double-tap zoom / pull-to-refresh / rubber-banding. Lays children in a CSS grid whose row template is `rows`.
|
|
7
5
|
*
|
|
8
6
|
* @element schmancy-page
|
|
9
|
-
*
|
|
7
|
+
* @summary The root of any app view — wraps header / main / footer children in a full-viewport grid. Use rows="auto_1fr_auto" to make the middle child scroll while header/footer stay pinned.
|
|
10
8
|
* @example
|
|
11
|
-
*
|
|
12
|
-
* <schmancy-
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `
|
|
9
|
+
* <schmancy-page rows="auto_1fr_auto">
|
|
10
|
+
* <schmancy-nav-drawer-appbar>Title</schmancy-nav-drawer-appbar>
|
|
11
|
+
* <main>Scrollable content</main>
|
|
12
|
+
* <schmancy-navigation-bar></schmancy-navigation-bar>
|
|
13
|
+
* </schmancy-page>
|
|
14
|
+
* @platform div - Full-height CSS-grid container. Degrades to a plain div if the tag never registers — children still flow vertically but without the height fill and gesture suppression.
|
|
18
15
|
*/
|
|
19
16
|
export declare class SchmancyPage extends SchmancyPage_base {
|
|
20
17
|
/** Custom grid-template-rows using underscores (e.g. "1fr_2fr_auto") */
|
|
@@ -5,22 +5,16 @@ export declare const SchmancySurfaceTypeContext: {
|
|
|
5
5
|
export type { SchmancySurfaceFill, SchmancySurfaceRounded, SchmancySurfaceElevation } from '@mixins/surface.mixin';
|
|
6
6
|
declare const SchmancySurface_base: import("../../mixins").Constructor<import("@mixins/surface.mixin").ISurfaceMixin> & import("../../mixins").Constructor<CustomElementConstructor> & import("../../mixins").Constructor<import("@mixins/tailwind.mixin").ITailwindElementMixin> & import("../../mixins").Constructor<import("lit").LitElement> & import("../../mixins").Constructor<import("../../mixins").IBaseMixin>;
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* This component renders a styled container that adapts its dimensions based on the `fill` property.
|
|
11
|
-
* It supports various rounding options, elevation levels, and applies background and text color classes
|
|
12
|
-
* based on the specified surface variant. Additionally, when the `scroller` property is true, the component
|
|
13
|
-
* enables internal scrolling by applying overflow and scroll-behavior styles.
|
|
14
|
-
*
|
|
15
|
-
* SurfaceMixin automatically provides surfaceStyles CSS.
|
|
8
|
+
* Themed container — the root surface primitive. Sets background, text color, rounding, elevation, and (optionally) internal scroll. Provides a `SchmancySurfaceTypeContext` so descendants can adapt to the enclosing surface variant.
|
|
16
9
|
*
|
|
17
10
|
* @element schmancy-surface
|
|
18
|
-
* @
|
|
19
|
-
*
|
|
11
|
+
* @summary Wrap a region of a page when you need it to pick up theme tokens (background + on-color + elevation). Nest surfaces to express Material Design's hierarchical color stacking.
|
|
20
12
|
* @example
|
|
21
13
|
* <schmancy-surface fill="all" rounded="all" elevation="3" type="surfaceBright" scroller>
|
|
22
14
|
* <p>Your scrollable content here</p>
|
|
23
15
|
* </schmancy-surface>
|
|
16
|
+
* @platform div - Styled `<div>` with theme-driven background/color/elevation. Degrades to a plain `<div>` if the tag never registers — text stays readable, just loses theming.
|
|
17
|
+
* @slot - Default slot for projecting child content.
|
|
24
18
|
*/
|
|
25
19
|
export declare class SchmancySurface extends SchmancySurface_base {
|
|
26
20
|
/**
|