@synergy-design-system/components 1.8.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{chunk.23HTU3YE.js → chunk.2EI3TNL7.js} +1 -16
- package/dist/chunks/chunk.2EI3TNL7.js.map +7 -0
- package/dist/chunks/{chunk.RSONAU45.js → chunk.2RF7KO5I.js} +1 -12
- package/dist/chunks/chunk.2RF7KO5I.js.map +7 -0
- package/dist/chunks/{chunk.CUU2VBEZ.js → chunk.2ZSYEFTP.js} +2 -2
- package/dist/chunks/{chunk.5TFG753C.js → chunk.3B2AQAU2.js} +2 -2
- package/dist/chunks/{chunk.G66TSLVT.js → chunk.3DUJKCD2.js} +23 -13
- package/dist/chunks/chunk.3DUJKCD2.js.map +7 -0
- package/dist/chunks/{chunk.HW5TASOL.js → chunk.3RA2P64H.js} +3 -3
- package/dist/chunks/{chunk.4CBN5LPQ.js → chunk.3STW62TA.js} +1 -12
- package/dist/chunks/chunk.3STW62TA.js.map +7 -0
- package/dist/chunks/{chunk.EKOK7YPB.js → chunk.4QS5IWYB.js} +1 -16
- package/dist/chunks/chunk.4QS5IWYB.js.map +7 -0
- package/dist/chunks/{chunk.KA7L2PMA.js → chunk.67GSZBK7.js} +20 -13
- package/dist/chunks/chunk.67GSZBK7.js.map +7 -0
- package/dist/chunks/{chunk.UG5FC6UD.js → chunk.7HMAYWNS.js} +2 -2
- package/dist/chunks/{chunk.6PWB7EUW.js → chunk.7N42OBRZ.js} +2 -2
- package/dist/chunks/{chunk.JRXQK6LG.js → chunk.7UVCYUNR.js} +2 -2
- package/dist/chunks/{chunk.4ZURABYO.js → chunk.A7IIJ2LL.js} +1 -7
- package/dist/chunks/{chunk.O7USYXBT.js.map → chunk.A7IIJ2LL.js.map} +3 -3
- package/dist/chunks/{chunk.PGCXJ2PT.js → chunk.ACTJFDNK.js} +1 -12
- package/dist/chunks/chunk.ACTJFDNK.js.map +7 -0
- package/dist/chunks/{chunk.MNMITYTH.js → chunk.ADRKUQGR.js} +1 -12
- package/dist/chunks/chunk.ADRKUQGR.js.map +7 -0
- package/dist/chunks/{chunk.RS4Z4KDT.js → chunk.AYTANJEE.js} +10 -6
- package/dist/chunks/chunk.AYTANJEE.js.map +7 -0
- package/dist/chunks/{chunk.4ZGN7AEC.js → chunk.BF2Z2XBN.js} +18 -10
- package/dist/chunks/chunk.BF2Z2XBN.js.map +7 -0
- package/dist/chunks/{chunk.QHFGD6WW.js → chunk.BGHK4NQA.js} +1 -12
- package/dist/chunks/chunk.BGHK4NQA.js.map +7 -0
- package/dist/chunks/{chunk.2IBWQADW.js → chunk.BI7J7YNX.js} +2 -2
- package/dist/chunks/{chunk.F3YEAZYJ.js → chunk.BOO4VTHX.js} +2 -2
- package/dist/chunks/{chunk.HNRD7DBS.js → chunk.CBR46SD4.js} +6 -5
- package/dist/chunks/chunk.CBR46SD4.js.map +7 -0
- package/dist/chunks/{chunk.W6V7TPGK.js → chunk.CFIQXXMW.js} +1 -12
- package/dist/chunks/chunk.CFIQXXMW.js.map +7 -0
- package/dist/chunks/chunk.CJZHKDBQ.js +12 -0
- package/dist/chunks/chunk.CJZHKDBQ.js.map +7 -0
- package/dist/chunks/{chunk.DAROCSFO.js → chunk.DIXHBM5G.js} +10 -6
- package/dist/chunks/chunk.DIXHBM5G.js.map +7 -0
- package/dist/chunks/{chunk.WP6T5CG2.js → chunk.FAKWK5NS.js} +2 -2
- package/dist/chunks/{chunk.UVYPEAQZ.js → chunk.GQY3KJDK.js} +23 -8
- package/dist/chunks/chunk.GQY3KJDK.js.map +7 -0
- package/dist/chunks/{chunk.2KKPNUPU.js → chunk.GTSRMEPE.js} +2 -4
- package/dist/chunks/chunk.GTSRMEPE.js.map +7 -0
- package/dist/chunks/{chunk.MRAXEK5D.js → chunk.H5ZKCFYO.js} +2 -2
- package/dist/chunks/{chunk.JBHQJWOB.js → chunk.HELY6MCO.js} +71 -33
- package/dist/chunks/chunk.HELY6MCO.js.map +7 -0
- package/dist/chunks/{chunk.NWWHBSV7.js → chunk.HUHPPFDX.js} +2 -2
- package/dist/chunks/chunk.JDXKGJ63.js +99 -0
- package/dist/chunks/chunk.JDXKGJ63.js.map +7 -0
- package/dist/chunks/chunk.JMP6V7XJ.js +80 -0
- package/dist/chunks/chunk.JMP6V7XJ.js.map +7 -0
- package/dist/chunks/{chunk.K4ELZCXB.js → chunk.JORZ3DML.js} +2 -2
- package/dist/chunks/{chunk.JSO3PKB4.js → chunk.KUO3KJOC.js} +2 -2
- package/dist/chunks/{chunk.A2WGLZOL.js → chunk.LIRQO322.js} +2 -2
- package/dist/chunks/{chunk.2FN5DTS6.js → chunk.LJQ7LEPV.js} +1 -12
- package/dist/chunks/chunk.LJQ7LEPV.js.map +7 -0
- package/dist/chunks/{chunk.COKV3ZN7.js → chunk.M6D7QVXC.js} +2 -2
- package/dist/chunks/{chunk.JN7CLMQZ.js → chunk.MIMALEWP.js} +21 -7
- package/dist/chunks/chunk.MIMALEWP.js.map +7 -0
- package/dist/chunks/{chunk.Y4QKFZLK.js → chunk.MZBIDOMW.js} +84 -46
- package/dist/chunks/chunk.MZBIDOMW.js.map +7 -0
- package/dist/chunks/{chunk.5AAIHRMI.js → chunk.N4VSEIRQ.js} +3 -1
- package/dist/chunks/{chunk.5AAIHRMI.js.map → chunk.N4VSEIRQ.js.map} +2 -2
- package/dist/chunks/{chunk.35PHCFSV.js → chunk.NII3J5OF.js} +12 -8
- package/dist/chunks/chunk.NII3J5OF.js.map +7 -0
- package/dist/chunks/{chunk.NAAFLDZ3.js → chunk.OPP7D6NX.js} +2 -2
- package/dist/chunks/{chunk.N2I6HVX3.js → chunk.OSBC36KQ.js} +4 -9
- package/dist/chunks/chunk.OSBC36KQ.js.map +7 -0
- package/dist/chunks/{chunk.NV7W5R6V.js → chunk.PHSJD47V.js} +1 -12
- package/dist/chunks/chunk.PHSJD47V.js.map +7 -0
- package/dist/chunks/{chunk.JBYBQ5TQ.js → chunk.PKO6FEOM.js} +1 -12
- package/dist/chunks/chunk.PKO6FEOM.js.map +7 -0
- package/dist/chunks/{chunk.GZVDP7WZ.js → chunk.QF4AQCX3.js} +137 -42
- package/dist/chunks/chunk.QF4AQCX3.js.map +7 -0
- package/dist/chunks/{chunk.6XU6OLZ3.js → chunk.QNQNR3RY.js} +1 -16
- package/dist/chunks/chunk.QNQNR3RY.js.map +7 -0
- package/dist/chunks/{chunk.XI6MSNHF.js → chunk.QRXBA3TE.js} +83 -5
- package/dist/chunks/chunk.QRXBA3TE.js.map +7 -0
- package/dist/chunks/{chunk.B75SET3J.js → chunk.RRQEMHEV.js} +6 -5
- package/dist/chunks/chunk.RRQEMHEV.js.map +7 -0
- package/dist/chunks/{chunk.ERNEIORV.js → chunk.SHI4PSGX.js} +9 -5
- package/dist/chunks/chunk.SHI4PSGX.js.map +7 -0
- package/dist/chunks/{chunk.OJ4KOC7R.js → chunk.SJMMPKWP.js} +1 -12
- package/dist/chunks/chunk.SJMMPKWP.js.map +7 -0
- package/dist/chunks/{chunk.2Z2GYRLO.js → chunk.SZCGMXW5.js} +2 -2
- package/dist/chunks/chunk.SZCGMXW5.js.map +7 -0
- package/dist/chunks/{chunk.MB3YZTYP.js → chunk.TGVTAWOV.js} +6 -5
- package/dist/chunks/chunk.TGVTAWOV.js.map +7 -0
- package/dist/chunks/{chunk.JHXCBOUD.js → chunk.TTL762VF.js} +57 -60
- package/dist/chunks/chunk.TTL762VF.js.map +7 -0
- package/dist/chunks/{chunk.OJUBVHIK.js → chunk.UCMAXFGL.js} +2 -2
- package/dist/chunks/{chunk.2XCLA4MQ.js → chunk.UX22QVVR.js} +2 -2
- package/dist/chunks/{chunk.RVFNEWM3.js → chunk.UXDU44Q3.js} +2 -2
- package/dist/chunks/{chunk.AFEABUNX.js → chunk.W5JK7V7K.js} +6 -1
- package/dist/chunks/chunk.W5JK7V7K.js.map +7 -0
- package/dist/chunks/{chunk.BGPAHVPK.js → chunk.WEX3I4KA.js} +2 -2
- package/dist/chunks/{chunk.GUQN6XL4.js → chunk.WUFFQJJF.js} +10 -6
- package/dist/chunks/chunk.WUFFQJJF.js.map +7 -0
- package/dist/chunks/{chunk.4I6M5V6O.js → chunk.XIUSSERX.js} +1 -16
- package/dist/chunks/chunk.XIUSSERX.js.map +7 -0
- package/dist/chunks/{chunk.WDX7XUUK.js → chunk.XVNL6NRN.js} +22 -2
- package/dist/chunks/chunk.XVNL6NRN.js.map +7 -0
- package/dist/chunks/{chunk.AWZ4FSAL.js → chunk.YDMQ766U.js} +15 -11
- package/dist/chunks/chunk.YDMQ766U.js.map +7 -0
- package/dist/chunks/{chunk.AJWDVZRI.js → chunk.ZGFM7UKE.js} +45 -19
- package/dist/chunks/chunk.ZGFM7UKE.js.map +7 -0
- package/dist/chunks/{chunk.IKKMWFWH.js → chunk.ZIQXX272.js} +2 -2
- package/dist/components/button/button.component.js +12 -13
- package/dist/components/button/button.js +13 -14
- package/dist/components/button/button.styles.js +1 -3
- package/dist/components/button-group/button-group.component.js +3 -4
- package/dist/components/button-group/button-group.js +4 -5
- package/dist/components/button-group/button-group.styles.js +1 -2
- package/dist/components/checkbox/checkbox.component.d.ts +5 -0
- package/dist/components/checkbox/checkbox.component.js +11 -10
- package/dist/components/checkbox/checkbox.js +12 -11
- package/dist/components/checkbox/checkbox.styles.js +1 -3
- package/dist/components/divider/divider.component.js +3 -4
- package/dist/components/divider/divider.js +4 -5
- package/dist/components/divider/divider.styles.js +1 -3
- package/dist/components/drawer/drawer.component.d.ts +1 -0
- package/dist/components/drawer/drawer.component.js +12 -13
- package/dist/components/drawer/drawer.js +13 -14
- package/dist/components/drawer/drawer.styles.js +1 -3
- package/dist/components/header/header.component.d.ts +36 -0
- package/dist/components/header/header.component.js +20 -0
- package/dist/components/header/header.component.js.map +7 -0
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/header.js +21 -0
- package/dist/components/header/header.js.map +7 -0
- package/dist/components/header/header.styles.d.ts +2 -0
- package/dist/components/header/header.styles.js +8 -0
- package/dist/components/header/header.styles.js.map +7 -0
- package/dist/components/icon/icon.component.js +6 -7
- package/dist/components/icon/icon.js +7 -8
- package/dist/components/icon/icon.styles.js +1 -3
- package/dist/components/icon/library.js +2 -2
- package/dist/components/icon/library.system.js +1 -1
- package/dist/components/icon-button/icon-button.component.js +8 -9
- package/dist/components/icon-button/icon-button.js +9 -10
- package/dist/components/icon-button/icon-button.styles.js +1 -3
- package/dist/components/input/input.component.js +13 -14
- package/dist/components/input/input.js +14 -15
- package/dist/components/input/input.styles.js +1 -4
- package/dist/components/optgroup/optgroup.component.js +4 -5
- package/dist/components/optgroup/optgroup.js +5 -6
- package/dist/components/option/option.component.js +8 -9
- package/dist/components/option/option.js +9 -10
- package/dist/components/option/option.styles.js +1 -3
- package/dist/components/popup/popup.component.d.ts +9 -0
- package/dist/components/popup/popup.component.js +3 -4
- package/dist/components/popup/popup.styles.js +1 -2
- package/dist/components/radio/radio.component.js +8 -9
- package/dist/components/radio/radio.js +9 -10
- package/dist/components/radio/radio.styles.js +1 -3
- package/dist/components/radio-button/radio-button.component.js +4 -6
- package/dist/components/radio-button/radio-button.js +5 -7
- package/dist/components/radio-button/radio-button.styles.js +2 -4
- package/dist/components/radio-group/radio-group.component.d.ts +1 -0
- package/dist/components/radio-group/radio-group.component.js +7 -8
- package/dist/components/radio-group/radio-group.js +8 -9
- package/dist/components/radio-group/radio-group.styles.js +1 -4
- package/dist/components/select/select.component.d.ts +1 -0
- package/dist/components/select/select.component.js +18 -19
- package/dist/components/select/select.js +19 -20
- package/dist/components/select/select.styles.js +1 -4
- package/dist/components/spinner/spinner.component.js +3 -4
- package/dist/components/spinner/spinner.styles.js +1 -2
- package/dist/components/switch/switch.component.d.ts +5 -0
- package/dist/components/switch/switch.component.js +7 -6
- package/dist/components/switch/switch.custom.styles.js +1 -1
- package/dist/components/switch/switch.js +8 -7
- package/dist/components/switch/switch.styles.js +1 -3
- package/dist/components/tag/tag.component.js +10 -11
- package/dist/components/tag/tag.js +11 -12
- package/dist/components/tag/tag.styles.js +1 -3
- package/dist/components/textarea/textarea.component.js +5 -6
- package/dist/components/textarea/textarea.js +6 -7
- package/dist/components/textarea/textarea.styles.js +1 -4
- package/dist/custom-elements.json +379 -147
- package/dist/internal/longpress.d.ts +2 -2
- package/dist/internal/modal.d.ts +3 -0
- package/dist/synergy.d.ts +1 -0
- package/dist/synergy.js +84 -79
- package/dist/utilities/form.js +2 -2
- package/dist/utilities/icon-library.js +2 -2
- package/dist/vscode.html-custom-data.json +53 -21
- package/package.json +2 -4
- package/dist/chunks/chunk.23HTU3YE.js.map +0 -7
- package/dist/chunks/chunk.2FN5DTS6.js.map +0 -7
- package/dist/chunks/chunk.2KKPNUPU.js.map +0 -7
- package/dist/chunks/chunk.2Z2GYRLO.js.map +0 -7
- package/dist/chunks/chunk.35PHCFSV.js.map +0 -7
- package/dist/chunks/chunk.4CBN5LPQ.js.map +0 -7
- package/dist/chunks/chunk.4I6M5V6O.js.map +0 -7
- package/dist/chunks/chunk.4ZGN7AEC.js.map +0 -7
- package/dist/chunks/chunk.4ZURABYO.js.map +0 -7
- package/dist/chunks/chunk.6XU6OLZ3.js.map +0 -7
- package/dist/chunks/chunk.AFEABUNX.js.map +0 -7
- package/dist/chunks/chunk.AJWDVZRI.js.map +0 -7
- package/dist/chunks/chunk.AWZ4FSAL.js.map +0 -7
- package/dist/chunks/chunk.B75SET3J.js.map +0 -7
- package/dist/chunks/chunk.DAROCSFO.js.map +0 -7
- package/dist/chunks/chunk.EKOK7YPB.js.map +0 -7
- package/dist/chunks/chunk.ERNEIORV.js.map +0 -7
- package/dist/chunks/chunk.G66TSLVT.js.map +0 -7
- package/dist/chunks/chunk.GUQN6XL4.js.map +0 -7
- package/dist/chunks/chunk.GZVDP7WZ.js.map +0 -7
- package/dist/chunks/chunk.HNRD7DBS.js.map +0 -7
- package/dist/chunks/chunk.JBHQJWOB.js.map +0 -7
- package/dist/chunks/chunk.JBYBQ5TQ.js.map +0 -7
- package/dist/chunks/chunk.JHXCBOUD.js.map +0 -7
- package/dist/chunks/chunk.JN7CLMQZ.js.map +0 -7
- package/dist/chunks/chunk.KA7L2PMA.js.map +0 -7
- package/dist/chunks/chunk.MB3YZTYP.js.map +0 -7
- package/dist/chunks/chunk.MNMITYTH.js.map +0 -7
- package/dist/chunks/chunk.N2I6HVX3.js.map +0 -7
- package/dist/chunks/chunk.NV7W5R6V.js.map +0 -7
- package/dist/chunks/chunk.O7USYXBT.js +0 -23
- package/dist/chunks/chunk.OJ4KOC7R.js.map +0 -7
- package/dist/chunks/chunk.PGCXJ2PT.js.map +0 -7
- package/dist/chunks/chunk.QHFGD6WW.js.map +0 -7
- package/dist/chunks/chunk.RS4Z4KDT.js.map +0 -7
- package/dist/chunks/chunk.RSONAU45.js.map +0 -7
- package/dist/chunks/chunk.UVYPEAQZ.js.map +0 -7
- package/dist/chunks/chunk.W6V7TPGK.js.map +0 -7
- package/dist/chunks/chunk.WDX7XUUK.js.map +0 -7
- package/dist/chunks/chunk.XI6MSNHF.js.map +0 -7
- package/dist/chunks/chunk.Y4QKFZLK.js.map +0 -7
- package/dist/web-types.json +0 -2580
- /package/dist/chunks/{chunk.CUU2VBEZ.js.map → chunk.2ZSYEFTP.js.map} +0 -0
- /package/dist/chunks/{chunk.5TFG753C.js.map → chunk.3B2AQAU2.js.map} +0 -0
- /package/dist/chunks/{chunk.HW5TASOL.js.map → chunk.3RA2P64H.js.map} +0 -0
- /package/dist/chunks/{chunk.UG5FC6UD.js.map → chunk.7HMAYWNS.js.map} +0 -0
- /package/dist/chunks/{chunk.6PWB7EUW.js.map → chunk.7N42OBRZ.js.map} +0 -0
- /package/dist/chunks/{chunk.JRXQK6LG.js.map → chunk.7UVCYUNR.js.map} +0 -0
- /package/dist/chunks/{chunk.2IBWQADW.js.map → chunk.BI7J7YNX.js.map} +0 -0
- /package/dist/chunks/{chunk.F3YEAZYJ.js.map → chunk.BOO4VTHX.js.map} +0 -0
- /package/dist/chunks/{chunk.WP6T5CG2.js.map → chunk.FAKWK5NS.js.map} +0 -0
- /package/dist/chunks/{chunk.MRAXEK5D.js.map → chunk.H5ZKCFYO.js.map} +0 -0
- /package/dist/chunks/{chunk.NWWHBSV7.js.map → chunk.HUHPPFDX.js.map} +0 -0
- /package/dist/chunks/{chunk.K4ELZCXB.js.map → chunk.JORZ3DML.js.map} +0 -0
- /package/dist/chunks/{chunk.JSO3PKB4.js.map → chunk.KUO3KJOC.js.map} +0 -0
- /package/dist/chunks/{chunk.A2WGLZOL.js.map → chunk.LIRQO322.js.map} +0 -0
- /package/dist/chunks/{chunk.COKV3ZN7.js.map → chunk.M6D7QVXC.js.map} +0 -0
- /package/dist/chunks/{chunk.NAAFLDZ3.js.map → chunk.OPP7D6NX.js.map} +0 -0
- /package/dist/chunks/{chunk.OJUBVHIK.js.map → chunk.UCMAXFGL.js.map} +0 -0
- /package/dist/chunks/{chunk.2XCLA4MQ.js.map → chunk.UX22QVVR.js.map} +0 -0
- /package/dist/chunks/{chunk.RVFNEWM3.js.map → chunk.UXDU44Q3.js.map} +0 -0
- /package/dist/chunks/{chunk.BGPAHVPK.js.map → chunk.WEX3I4KA.js.map} +0 -0
- /package/dist/chunks/{chunk.IKKMWFWH.js.map → chunk.ZIQXX272.js.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/popup/popup.component.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { arrow, autoUpdate, computePosition, flip, offset, platform, shift, size } from '@floating-ui/dom';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html } from 'lit';\nimport { offsetParent } from 'composed-offset-position';\nimport { property, query } from 'lit/decorators.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport styles from './popup.styles.js';\nimport type { CSSResultGroup } from 'lit';\n\nexport interface VirtualElement {\n getBoundingClientRect: () => DOMRect;\n}\n\nfunction isVirtualElement(e: unknown): e is VirtualElement {\n return e !== null && typeof e === 'object' && 'getBoundingClientRect' in e;\n}\n\n/**\n * @summary Popup is a utility that lets you declaratively anchor \"popup\" containers to another element.\n * @documentation https://synergy.style/components/popup\n * @status stable\n * @since 2.0\n *\n * @event syn-reposition - Emitted when the popup is repositioned. This event can fire a lot, so avoid putting expensive\n * operations in your listener or consider debouncing it.\n *\n * @slot - The popup's content.\n * @slot anchor - The element the popup will be anchored to. If the anchor lives outside of the popup, you can use the\n * `anchor` attribute or property instead.\n *\n * @csspart arrow - The arrow's container. Avoid setting `top|bottom|left|right` properties, as these values are\n * assigned dynamically as the popup moves. This is most useful for applying a background color to match the popup, and\n * maybe a border or box shadow.\n * @csspart popup - The popup's container. Useful for setting a background color, box shadow, etc.\n * @csspart hover-bridge - The hover bridge element. Only available when the `hover-bridge` option is enabled.\n *\n * @cssproperty [--arrow-size=6px] - The size of the arrow. Note that an arrow won't be shown unless the `arrow`\n * attribute is used.\n * @cssproperty [--arrow-color=var(--syn-color-neutral-0)] - The color of the arrow.\n * @cssproperty [--auto-size-available-width] - A read-only custom property that determines the amount of width the\n * popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only\n * available when using `auto-size`.\n * @cssproperty [--auto-size-available-height] - A read-only custom property that determines the amount of height the\n * popup can be before overflowing. Useful for positioning child elements that need to overflow. This property is only\n * available when using `auto-size`.\n */\nexport default class SynPopup extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles];\n\n private anchorEl: Element | VirtualElement | null;\n private cleanup: ReturnType<typeof autoUpdate> | undefined;\n\n /** A reference to the internal popup container. Useful for animating and styling the popup with JavaScript. */\n @query('.popup') popup: HTMLElement;\n @query('.popup__arrow') private arrowEl: HTMLElement;\n\n /**\n * The element the popup will be anchored to. If the anchor lives outside of the popup, you can provide the anchor\n * element `id`, a DOM element reference, or a `VirtualElement`. If the anchor lives inside the popup, use the\n * `anchor` slot instead.\n */\n @property() anchor: Element | string | VirtualElement;\n\n /**\n * Activates the positioning logic and shows the popup. When this attribute is removed, the positioning logic is torn\n * down and the popup will be hidden.\n */\n @property({ type: Boolean, reflect: true }) active = false;\n\n /**\n * The preferred placement of the popup. Note that the actual placement will vary as configured to keep the\n * panel inside of the viewport.\n */\n @property({ reflect: true }) placement:\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n | 'left'\n | 'left-start'\n | 'left-end' = 'top';\n\n /**\n * Determines how the popup is positioned. The `absolute` strategy works well in most cases, but if overflow is\n * clipped, using a `fixed` position strategy can often workaround it.\n */\n @property({ reflect: true }) strategy: 'absolute' | 'fixed' = 'absolute';\n\n /** The distance in pixels from which to offset the panel away from its anchor. */\n @property({ type: Number }) distance = 0;\n\n /** The distance in pixels from which to offset the panel along its anchor. */\n @property({ type: Number }) skidding = 0;\n\n /**\n * Attaches an arrow to the popup. The arrow's size and color can be customized using the `--arrow-size` and\n * `--arrow-color` custom properties. For additional customizations, you can also target the arrow using\n * `::part(arrow)` in your stylesheet.\n */\n @property({ type: Boolean }) arrow = false;\n\n /**\n * The placement of the arrow. The default is `anchor`, which will align the arrow as close to the center of the\n * anchor as possible, considering available space and `arrow-padding`. A value of `start`, `end`, or `center` will\n * align the arrow to the start, end, or center of the popover instead.\n */\n @property({ attribute: 'arrow-placement' }) arrowPlacement: 'start' | 'end' | 'center' | 'anchor' = 'anchor';\n\n /**\n * The amount of padding between the arrow and the edges of the popup. If the popup has a border-radius, for example,\n * this will prevent it from overflowing the corners.\n */\n @property({ attribute: 'arrow-padding', type: Number }) arrowPadding = 10;\n\n /**\n * When set, placement of the popup will flip to the opposite site to keep it in view. You can use\n * `flipFallbackPlacements` to further configure how the fallback placement is determined.\n */\n @property({ type: Boolean }) flip = false;\n\n /**\n * If the preferred placement doesn't fit, popup will be tested in these fallback placements until one fits. Must be a\n * string of any number of placements separated by a space, e.g. \"top bottom left\". If no placement fits, the flip\n * fallback strategy will be used instead.\n * */\n @property({\n attribute: 'flip-fallback-placements',\n converter: {\n fromAttribute: (value: string) => {\n return value\n .split(' ')\n .map(p => p.trim())\n .filter(p => p !== '');\n },\n toAttribute: (value: []) => {\n return value.join(' ');\n }\n }\n })\n flipFallbackPlacements = '';\n\n /**\n * When neither the preferred placement nor the fallback placements fit, this value will be used to determine whether\n * the popup should be positioned using the best available fit based on available space or as it was initially\n * preferred.\n */\n @property({ attribute: 'flip-fallback-strategy' }) flipFallbackStrategy: 'best-fit' | 'initial' = 'best-fit';\n\n /**\n * The flip boundary describes clipping element(s) that overflow will be checked relative to when flipping. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) flipBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the flip behavior will occur. */\n @property({ attribute: 'flip-padding', type: Number }) flipPadding = 0;\n\n /** Moves the popup along the axis to keep it in view when clipped. */\n @property({ type: Boolean }) shift = false;\n\n /**\n * The shift boundary describes clipping element(s) that overflow will be checked relative to when shifting. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) shiftBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the shift behavior will occur. */\n @property({ attribute: 'shift-padding', type: Number }) shiftPadding = 0;\n\n /** When set, this will cause the popup to automatically resize itself to prevent it from overflowing. */\n @property({ attribute: 'auto-size' }) autoSize: 'horizontal' | 'vertical' | 'both';\n\n /** Syncs the popup's width or height to that of the anchor element. */\n @property() sync: 'width' | 'height' | 'both';\n\n /**\n * The auto-size boundary describes clipping element(s) that overflow will be checked relative to when resizing. By\n * default, the boundary includes overflow ancestors that will cause the element to be clipped. If needed, you can\n * change the boundary by passing a reference to one or more elements to this property.\n */\n @property({ type: Object }) autoSizeBoundary: Element | Element[];\n\n /** The amount of padding, in pixels, to exceed before the auto-size behavior will occur. */\n @property({ attribute: 'auto-size-padding', type: Number }) autoSizePadding = 0;\n\n /**\n * When a gap exists between the anchor and the popup element, this option will add a \"hover bridge\" that fills the\n * gap using an invisible element. This makes listening for events such as `mouseenter` and `mouseleave` more sane\n * because the pointer never technically leaves the element. The hover bridge will only be drawn when the popover is\n * active.\n */\n @property({ attribute: 'hover-bridge', type: Boolean }) hoverBridge = false;\n\n async connectedCallback() {\n super.connectedCallback();\n\n // Start the positioner after the first update\n await this.updateComplete;\n this.start();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.stop();\n }\n\n async updated(changedProps: Map<string, unknown>) {\n super.updated(changedProps);\n\n // Start or stop the positioner when active changes\n if (changedProps.has('active')) {\n if (this.active) {\n this.start();\n } else {\n this.stop();\n }\n }\n\n // Update the anchor when anchor changes\n if (changedProps.has('anchor')) {\n this.handleAnchorChange();\n }\n\n // All other properties will trigger a reposition when active\n if (this.active) {\n await this.updateComplete;\n this.reposition();\n }\n }\n\n private async handleAnchorChange() {\n await this.stop();\n\n if (this.anchor && typeof this.anchor === 'string') {\n // Locate the anchor by id\n const root = this.getRootNode() as Document | ShadowRoot;\n this.anchorEl = root.getElementById(this.anchor);\n } else if (this.anchor instanceof Element || isVirtualElement(this.anchor)) {\n // Use the anchor's reference\n this.anchorEl = this.anchor;\n } else {\n // Look for a slotted anchor\n this.anchorEl = this.querySelector<HTMLElement>('[slot=\"anchor\"]');\n }\n\n // If the anchor is a <slot>, we'll use the first assigned element as the target since slots use `display: contents`\n // and positioning can't be calculated on them\n if (this.anchorEl instanceof HTMLSlotElement) {\n this.anchorEl = this.anchorEl.assignedElements({ flatten: true })[0] as HTMLElement;\n }\n\n // If the anchor is valid, start it up\n if (this.anchorEl) {\n this.start();\n }\n }\n\n private start() {\n // We can't start the positioner without an anchor\n if (!this.anchorEl) {\n return;\n }\n\n this.cleanup = autoUpdate(this.anchorEl, this.popup, () => {\n this.reposition();\n });\n }\n\n private async stop(): Promise<void> {\n return new Promise(resolve => {\n if (this.cleanup) {\n this.cleanup();\n this.cleanup = undefined;\n this.removeAttribute('data-current-placement');\n this.style.removeProperty('--auto-size-available-width');\n this.style.removeProperty('--auto-size-available-height');\n requestAnimationFrame(() => resolve());\n } else {\n resolve();\n }\n });\n }\n\n /** Forces the popup to recalculate and reposition itself. */\n reposition() {\n // Nothing to do if the popup is inactive or the anchor doesn't exist\n if (!this.active || !this.anchorEl) {\n return;\n }\n\n //\n // NOTE: Floating UI middlewares are order dependent: https://floating-ui.com/docs/middleware\n //\n const middleware = [\n // The offset middleware goes first\n offset({ mainAxis: this.distance, crossAxis: this.skidding })\n ];\n\n // First we sync width/height\n if (this.sync) {\n middleware.push(\n size({\n apply: ({ rects }) => {\n const syncWidth = this.sync === 'width' || this.sync === 'both';\n const syncHeight = this.sync === 'height' || this.sync === 'both';\n this.popup.style.width = syncWidth ? `${rects.reference.width}px` : '';\n this.popup.style.height = syncHeight ? `${rects.reference.height}px` : '';\n }\n })\n );\n } else {\n // Cleanup styles if we're not matching width/height\n this.popup.style.width = '';\n this.popup.style.height = '';\n }\n\n // Then we flip\n if (this.flip) {\n middleware.push(\n flip({\n boundary: this.flipBoundary,\n // @ts-expect-error - We're converting a string attribute to an array here\n fallbackPlacements: this.flipFallbackPlacements,\n fallbackStrategy: this.flipFallbackStrategy === 'best-fit' ? 'bestFit' : 'initialPlacement',\n padding: this.flipPadding\n })\n );\n }\n\n // Then we shift\n if (this.shift) {\n middleware.push(\n shift({\n boundary: this.shiftBoundary,\n padding: this.shiftPadding\n })\n );\n }\n\n // Now we adjust the size as needed\n if (this.autoSize) {\n middleware.push(\n size({\n boundary: this.autoSizeBoundary,\n padding: this.autoSizePadding,\n apply: ({ availableWidth, availableHeight }) => {\n if (this.autoSize === 'vertical' || this.autoSize === 'both') {\n this.style.setProperty('--auto-size-available-height', `${availableHeight}px`);\n } else {\n this.style.removeProperty('--auto-size-available-height');\n }\n\n if (this.autoSize === 'horizontal' || this.autoSize === 'both') {\n this.style.setProperty('--auto-size-available-width', `${availableWidth}px`);\n } else {\n this.style.removeProperty('--auto-size-available-width');\n }\n }\n })\n );\n } else {\n // Cleanup styles if we're no longer using auto-size\n this.style.removeProperty('--auto-size-available-width');\n this.style.removeProperty('--auto-size-available-height');\n }\n\n // Finally, we add an arrow\n if (this.arrow) {\n middleware.push(\n arrow({\n element: this.arrowEl,\n padding: this.arrowPadding\n })\n );\n }\n\n //\n // Use custom positioning logic if the strategy is absolute. Otherwise, fall back to the default logic.\n //\n // More info: https://github.com/synergy-design-system/synergy/issues/1135\n //\n const getOffsetParent =\n this.strategy === 'absolute'\n ? (element: Element) => platform.getOffsetParent(element, offsetParent)\n : platform.getOffsetParent;\n\n computePosition(this.anchorEl, this.popup, {\n placement: this.placement,\n middleware,\n strategy: this.strategy,\n platform: {\n ...platform,\n getOffsetParent\n }\n }).then(({ x, y, middlewareData, placement }) => {\n //\n // Even though we have our own localization utility, it uses different heuristics to determine RTL. Because of\n // that, we'll use the same approach that Floating UI uses.\n //\n // Source: https://github.com/floating-ui/floating-ui/blob/cb3b6ab07f95275730d3e6e46c702f8d4908b55c/packages/dom/src/utils/getDocumentRect.ts#L31\n //\n const isRtl = getComputedStyle(this).direction === 'rtl';\n const staticSide = { top: 'bottom', right: 'left', bottom: 'top', left: 'right' }[placement.split('-')[0]]!;\n\n this.setAttribute('data-current-placement', placement);\n\n Object.assign(this.popup.style, {\n left: `${x}px`,\n top: `${y}px`\n });\n\n if (this.arrow) {\n const arrowX = middlewareData.arrow!.x;\n const arrowY = middlewareData.arrow!.y;\n let top = '';\n let right = '';\n let bottom = '';\n let left = '';\n\n if (this.arrowPlacement === 'start') {\n // Start\n const value = typeof arrowX === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n top = typeof arrowY === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n right = isRtl ? value : '';\n left = isRtl ? '' : value;\n } else if (this.arrowPlacement === 'end') {\n // End\n const value = typeof arrowX === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n right = isRtl ? '' : value;\n left = isRtl ? value : '';\n bottom = typeof arrowY === 'number' ? `calc(${this.arrowPadding}px - var(--arrow-padding-offset))` : '';\n } else if (this.arrowPlacement === 'center') {\n // Center\n left = typeof arrowX === 'number' ? `calc(50% - var(--arrow-size-diagonal))` : '';\n top = typeof arrowY === 'number' ? `calc(50% - var(--arrow-size-diagonal))` : '';\n } else {\n // Anchor (default)\n left = typeof arrowX === 'number' ? `${arrowX}px` : '';\n top = typeof arrowY === 'number' ? `${arrowY}px` : '';\n }\n\n Object.assign(this.arrowEl.style, {\n top,\n right,\n bottom,\n left,\n [staticSide]: 'calc(var(--arrow-size-diagonal) * -1)'\n });\n }\n });\n\n // Wait until the new position is drawn before updating the hover bridge, otherwise it can get out of sync\n requestAnimationFrame(() => this.updateHoverBridge());\n\n this.emit('syn-reposition');\n }\n\n private updateHoverBridge = () => {\n if (this.hoverBridge && this.anchorEl) {\n const anchorRect = this.anchorEl.getBoundingClientRect();\n const popupRect = this.popup.getBoundingClientRect();\n const isVertical = this.placement.includes('top') || this.placement.includes('bottom');\n let topLeftX = 0;\n let topLeftY = 0;\n let topRightX = 0;\n let topRightY = 0;\n let bottomLeftX = 0;\n let bottomLeftY = 0;\n let bottomRightX = 0;\n let bottomRightY = 0;\n\n if (isVertical) {\n if (anchorRect.top < popupRect.top) {\n // Anchor is above\n topLeftX = anchorRect.left;\n topLeftY = anchorRect.bottom;\n topRightX = anchorRect.right;\n topRightY = anchorRect.bottom;\n\n bottomLeftX = popupRect.left;\n bottomLeftY = popupRect.top;\n bottomRightX = popupRect.right;\n bottomRightY = popupRect.top;\n } else {\n // Anchor is below\n topLeftX = popupRect.left;\n topLeftY = popupRect.bottom;\n topRightX = popupRect.right;\n topRightY = popupRect.bottom;\n\n bottomLeftX = anchorRect.left;\n bottomLeftY = anchorRect.top;\n bottomRightX = anchorRect.right;\n bottomRightY = anchorRect.top;\n }\n } else {\n if (anchorRect.left < popupRect.left) {\n // Anchor is on the left\n topLeftX = anchorRect.right;\n topLeftY = anchorRect.top;\n topRightX = popupRect.left;\n topRightY = popupRect.top;\n\n bottomLeftX = anchorRect.right;\n bottomLeftY = anchorRect.bottom;\n bottomRightX = popupRect.left;\n bottomRightY = popupRect.bottom;\n } else {\n // Anchor is on the right\n topLeftX = popupRect.right;\n topLeftY = popupRect.top;\n topRightX = anchorRect.left;\n topRightY = anchorRect.top;\n\n bottomLeftX = popupRect.right;\n bottomLeftY = popupRect.bottom;\n bottomRightX = anchorRect.left;\n bottomRightY = anchorRect.bottom;\n }\n }\n\n this.style.setProperty('--hover-bridge-top-left-x', `${topLeftX}px`);\n this.style.setProperty('--hover-bridge-top-left-y', `${topLeftY}px`);\n this.style.setProperty('--hover-bridge-top-right-x', `${topRightX}px`);\n this.style.setProperty('--hover-bridge-top-right-y', `${topRightY}px`);\n this.style.setProperty('--hover-bridge-bottom-left-x', `${bottomLeftX}px`);\n this.style.setProperty('--hover-bridge-bottom-left-y', `${bottomLeftY}px`);\n this.style.setProperty('--hover-bridge-bottom-right-x', `${bottomRightX}px`);\n this.style.setProperty('--hover-bridge-bottom-right-y', `${bottomRightY}px`);\n }\n };\n\n render() {\n return html`\n <slot name=\"anchor\" @slotchange=${this.handleAnchorChange}></slot>\n\n <span\n part=\"hover-bridge\"\n class=${classMap({\n 'popup-hover-bridge': true,\n 'popup-hover-bridge--visible': this.hoverBridge && this.active\n })}\n ></span>\n\n <div\n part=\"popup\"\n class=${classMap({\n popup: true,\n 'popup--active': this.active,\n 'popup--fixed': this.strategy === 'fixed',\n 'popup--has-arrow': this.arrow\n })}\n >\n <slot></slot>\n ${this.arrow ? html`<div part=\"arrow\" class=\"popup__arrow\" role=\"presentation\"></div>` : ''}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;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from "./chunk.AVTU2BGE.js";
|
|
10
10
|
import {
|
|
11
|
-
SynergyElement
|
|
12
|
-
|
|
11
|
+
SynergyElement,
|
|
12
|
+
component_styles_default
|
|
13
|
+
} from "./chunk.XVNL6NRN.js";
|
|
13
14
|
import {
|
|
14
15
|
__decorateClass
|
|
15
16
|
} from "./chunk.QNDC5KWA.js";
|
|
@@ -95,7 +96,7 @@ var SynRadioButton = class extends SynergyElement {
|
|
|
95
96
|
`;
|
|
96
97
|
}
|
|
97
98
|
};
|
|
98
|
-
SynRadioButton.styles = radio_button_styles_default;
|
|
99
|
+
SynRadioButton.styles = [component_styles_default, radio_button_styles_default];
|
|
99
100
|
__decorateClass([
|
|
100
101
|
query(".button")
|
|
101
102
|
], SynRadioButton.prototype, "input", 2);
|
|
@@ -124,4 +125,4 @@ __decorateClass([
|
|
|
124
125
|
export {
|
|
125
126
|
SynRadioButton
|
|
126
127
|
};
|
|
127
|
-
//# sourceMappingURL=chunk.
|
|
128
|
+
//# sourceMappingURL=chunk.RRQEMHEV.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/radio-button/radio-button.component.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { classMap } from 'lit/directives/class-map.js';\nimport { HasSlotController } from '../../internal/slot.js';\nimport { html } from 'lit/static-html.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { property, query, state } from 'lit/decorators.js';\nimport { watch } from '../../internal/watch.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport styles from './radio-button.styles.js';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Radios buttons allow the user to select a single option from a group using a button-like control.\n * @documentation https://synergy.style/components/radio-button\n * @status stable\n * @since 2.0\n *\n * @slot - The radio button's label.\n * @slot prefix - A presentational prefix icon or similar element.\n * @slot suffix - A presentational suffix icon or similar element.\n *\n * @event syn-blur - Emitted when the button loses focus.\n * @event syn-focus - Emitted when the button gains focus.\n *\n * @csspart base - The component's base wrapper.\n * @csspart button - The internal `<button>` element.\n * @csspart button--checked - The internal button element when the radio button is checked.\n * @csspart prefix - The container that wraps the prefix.\n * @csspart label - The container that wraps the radio button's label.\n * @csspart suffix - The container that wraps the suffix.\n */\nexport default class SynRadioButton extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles];\n\n private readonly hasSlotController = new HasSlotController(this, '[default]', 'prefix', 'suffix');\n\n @query('.button') input: HTMLInputElement;\n @query('.hidden-input') hiddenInput: HTMLInputElement;\n\n @state() protected hasFocus = false;\n\n /**\n * @internal The radio button's checked state. This is exposed as an \"internal\" attribute so we can reflect it, making\n * it easier to style in button groups.\n */\n @property({ type: Boolean, reflect: true }) checked = false;\n\n /** The radio's value. When selected, the radio group will receive this value. */\n @property() value: string;\n\n /** Disables the radio button. */\n @property({ type: Boolean, reflect: true }) disabled = false;\n\n /**\n * The radio button's size. When used inside a radio group, the size will be determined by the radio group's size so\n * this attribute can typically be omitted.\n */\n @property({ reflect: true }) size: 'small' | 'medium' | 'large' = 'medium';\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'presentation');\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.emit('syn-blur');\n }\n\n private handleClick(e: MouseEvent) {\n if (this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n this.checked = true;\n }\n\n private handleFocus() {\n this.hasFocus = true;\n this.emit('syn-focus');\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n handleDisabledChange() {\n this.setAttribute('aria-disabled', this.disabled ? 'true' : 'false');\n }\n\n /** Sets focus on the radio button. */\n focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the radio button. */\n blur() {\n this.input.blur();\n }\n\n render() {\n return html`\n <div part=\"base\" role=\"presentation\">\n <button\n part=\"${`button${this.checked ? ' button--checked' : ''}`}\"\n role=\"radio\"\n aria-checked=\"${this.checked}\"\n class=${classMap({\n button: true,\n 'button--small': this.size === 'small',\n 'button--medium': this.size === 'medium',\n 'button--large': this.size === 'large',\n 'button--checked': this.checked,\n 'button--disabled': this.disabled,\n 'button--focused': this.hasFocus,\n 'button--outline': true,\n 'button--has-label': this.hasSlotController.test('[default]'),\n 'button--has-prefix': this.hasSlotController.test('prefix'),\n 'button--has-suffix': this.hasSlotController.test('suffix')\n })}\n aria-disabled=${this.disabled}\n type=\"button\"\n value=${ifDefined(this.value)}\n tabindex=\"${this.checked ? '0' : '-1'}\"\n @blur=${this.handleBlur}\n @focus=${this.handleFocus}\n @click=${this.handleClick}\n >\n <slot name=\"prefix\" part=\"prefix\" class=\"button__prefix\"></slot>\n <slot part=\"label\" class=\"button__label\"></slot>\n <slot name=\"suffix\" part=\"suffix\" class=\"button__suffix\"></slot>\n </button>\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAMA,SAAS,gBAAgB;AAEzB,SAAS,YAAY;AACrB,SAAS,iBAAiB;AAC1B,SAAS,UAAU,OAAO,aAAa;AA2BvC,IAAqB,iBAArB,cAA4C,eAAe;AAAA,EAA3D;AAAA;AAGE,SAAiB,oBAAoB,IAAI,kBAAkB,MAAM,aAAa,UAAU,QAAQ;AAKvF,SAAU,WAAW;AAMc,mBAAU;AAMV,oBAAW;AAM1B,gBAAqC;AAAA;AAAA,EAElE,oBAAoB;AAClB,UAAM,kBAAkB;AACxB,SAAK,aAAa,QAAQ,cAAc;AAAA,EAC1C;AAAA,EAEQ,aAAa;AACnB,SAAK,WAAW;AAChB,SAAK,KAAK,UAAU;AAAA,EACtB;AAAA,EAEQ,YAAY,GAAe;AACjC,QAAI,KAAK,UAAU;AACjB,QAAE,eAAe;AACjB,QAAE,gBAAgB;AAClB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A,GANH,eAMK;AAEL;AAAA,EAAlB,MAAM;AAAA,GARY,eAQA;AAMyB;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAdvB,eAcyB;AAGhC;AAAA,EAAX,SAAS;AAAA,GAjBS,eAiBP;AAGgC;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GApBvB,eAoByB;AAMf;AAAA,EAA5B,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GA1BR,eA0BU;AA4B7B;AAAA,EADC,MAAM,YAAY,EAAE,sBAAsB,KAAK,CAAC;AAAA,GArD9B,eAsDnB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
+
import {
|
|
2
|
+
divider_custom_styles_default
|
|
3
|
+
} from "./chunk.FA6V2WD6.js";
|
|
1
4
|
import {
|
|
2
5
|
divider_styles_default
|
|
3
|
-
} from "./chunk.
|
|
6
|
+
} from "./chunk.ACTJFDNK.js";
|
|
4
7
|
import {
|
|
5
8
|
watch
|
|
6
9
|
} from "./chunk.AVTU2BGE.js";
|
|
7
10
|
import {
|
|
8
|
-
SynergyElement
|
|
9
|
-
|
|
11
|
+
SynergyElement,
|
|
12
|
+
component_styles_default
|
|
13
|
+
} from "./chunk.XVNL6NRN.js";
|
|
10
14
|
import {
|
|
11
15
|
__decorateClass
|
|
12
16
|
} from "./chunk.QNDC5KWA.js";
|
|
@@ -26,7 +30,7 @@ var SynDivider = class extends SynergyElement {
|
|
|
26
30
|
this.setAttribute("aria-orientation", this.vertical ? "vertical" : "horizontal");
|
|
27
31
|
}
|
|
28
32
|
};
|
|
29
|
-
SynDivider.styles = divider_styles_default;
|
|
33
|
+
SynDivider.styles = [component_styles_default, divider_styles_default, divider_custom_styles_default];
|
|
30
34
|
__decorateClass([
|
|
31
35
|
property({ type: Boolean, reflect: true })
|
|
32
36
|
], SynDivider.prototype, "vertical", 2);
|
|
@@ -37,4 +41,4 @@ __decorateClass([
|
|
|
37
41
|
export {
|
|
38
42
|
SynDivider
|
|
39
43
|
};
|
|
40
|
-
//# sourceMappingURL=chunk.
|
|
44
|
+
//# sourceMappingURL=chunk.SHI4PSGX.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/divider/divider.component.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { property } from 'lit/decorators.js';\nimport { watch } from '../../internal/watch.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport styles from './divider.styles.js';\nimport customStyles from './divider.custom.styles.js';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Dividers are used to visually separate or group elements.\n * @documentation https://synergy.style/components/divider\n * @status stable\n * @since 2.0\n *\n * @cssproperty --color - The color of the divider.\n * @cssproperty --width - The width of the divider.\n * @cssproperty --spacing - The spacing of the divider.\n */\nexport default class SynDivider extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles, customStyles];\n\n /** Draws the divider in a vertical orientation. */\n @property({ type: Boolean, reflect: true }) vertical = false;\n\n connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'separator');\n }\n\n @watch('vertical')\n handleVerticalChange() {\n this.setAttribute('aria-orientation', this.vertical ? 'vertical' : 'horizontal');\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAMA,SAAS,gBAAgB;AAkBzB,IAAqB,aAArB,cAAwC,eAAe;AAAA,EAAvD;AAAA;AAI8C,oBAAW;AAAA;AAAA,EAEvD,oBAAoB;AAClB,UAAM,kBAAkB;AACxB,SAAK,aAAa,QAAQ,WAAW;AAAA,EACvC;AAAA,EAGA,uBAAuB;AACrB,SAAK,aAAa,oBAAoB,KAAK,WAAW,aAAa,YAAY;AAAA,EACjF;AACF;AAfqB,WACZ,SAAyB,CAAC,0BAAiB,wBAAQ,6BAAY;AAG1B;AAAA,EAA3C,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GAJvB,WAIyB;AAQ5C;AAAA,EADC,MAAM,UAAU;AAAA,GAXE,WAYnB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
button_custom_styles_default
|
|
3
|
-
} from "./chunk.K55MKNUR.js";
|
|
4
|
-
import {
|
|
5
|
-
component_styles_default
|
|
6
|
-
} from "./chunk.O7USYXBT.js";
|
|
7
|
-
|
|
8
1
|
// src/components/button/button.styles.ts
|
|
9
2
|
import { css } from "lit";
|
|
10
3
|
var button_styles_default = css`
|
|
11
4
|
/* stylelint-disable */
|
|
12
|
-
${component_styles_default}
|
|
13
|
-
|
|
14
5
|
:host {
|
|
15
6
|
display: inline-block;
|
|
16
7
|
position: relative;
|
|
@@ -366,11 +357,9 @@ var button_styles_default = css`
|
|
|
366
357
|
:host(.syn-button-group__button[checked]) {
|
|
367
358
|
z-index: 2;
|
|
368
359
|
}
|
|
369
|
-
|
|
370
|
-
${button_custom_styles_default}
|
|
371
360
|
`;
|
|
372
361
|
|
|
373
362
|
export {
|
|
374
363
|
button_styles_default
|
|
375
364
|
};
|
|
376
|
-
//# sourceMappingURL=chunk.
|
|
365
|
+
//# sourceMappingURL=chunk.SJMMPKWP.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/button/button.styles.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { css } from 'lit';\n\nexport default css`\n\t/* stylelint-disable */\n :host {\n display: inline-block;\n position: relative;\n width: auto;\n cursor: pointer;\n }\n\n .button {\n display: inline-flex;\n align-items: stretch;\n justify-content: center;\n width: 100%;\n border-style: solid;\n border-width: var(--syn-input-border-width);\n font-family: var(--syn-input-font-family);\n font-weight: var(--syn-font-weight-semibold);\n text-decoration: none;\n user-select: none;\n -webkit-user-select: none;\n white-space: nowrap;\n vertical-align: middle;\n padding: 0;\n transition:\n var(--syn-transition-x-fast) background-color,\n var(--syn-transition-x-fast) color,\n var(--syn-transition-x-fast) border,\n var(--syn-transition-x-fast) box-shadow;\n cursor: inherit;\n }\n\n .button::-moz-focus-inner {\n border: 0;\n }\n\n .button:focus {\n outline: none;\n }\n\n .button:focus-visible {\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n .button--disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n /* When disabled, prevent mouse events from bubbling up from children */\n .button--disabled * {\n pointer-events: none;\n }\n\n .button__prefix,\n .button__suffix {\n flex: 0 0 auto;\n display: flex;\n align-items: center;\n pointer-events: none;\n }\n\n .button__label {\n display: inline-block;\n }\n\n .button__label::slotted(syn-icon) {\n vertical-align: -2px;\n }\n\n /*\n * Standard buttons\n */\n\n /* Primary */\n .button--filled.button--primary {\n background-color: var(--syn-color-primary-600);\n border-color: var(--syn-color-primary-600);\n color: var(--syn-color-neutral-0);\n }\n\n .button--filled.button--primary:hover:not(.button--disabled) {\n background-color: var(--syn-color-primary-500);\n border-color: var(--syn-color-primary-500);\n color: var(--syn-color-neutral-0);\n }\n\n .button--filled.button--primary:active:not(.button--disabled) {\n background-color: var(--syn-color-primary-600);\n border-color: var(--syn-color-primary-600);\n color: var(--syn-color-neutral-0);\n }\n\n /*\n * Outline buttons\n */\n\n .button--outline {\n background: none;\n border: solid 1px;\n }\n\n /* Primary */\n .button--outline.button--primary {\n border-color: var(--syn-color-primary-600);\n color: var(--syn-color-primary-600);\n }\n\n .button--outline.button--primary:hover:not(.button--disabled),\n .button--outline.button--primary.button--checked:not(.button--disabled) {\n background-color: var(--syn-color-primary-600);\n color: var(--syn-color-neutral-0);\n }\n\n .button--outline.button--primary:active:not(.button--disabled) {\n border-color: var(--syn-color-primary-700);\n background-color: var(--syn-color-primary-700);\n color: var(--syn-color-neutral-0);\n }\n\n /*\n * Text buttons\n */\n\n .button--text {\n background-color: transparent;\n border-color: transparent;\n color: var(--syn-color-primary-600);\n }\n\n .button--text:hover:not(.button--disabled) {\n background-color: transparent;\n border-color: transparent;\n color: var(--syn-color-primary-500);\n }\n\n .button--text:focus-visible:not(.button--disabled) {\n background-color: transparent;\n border-color: transparent;\n color: var(--syn-color-primary-500);\n }\n\n .button--text:active:not(.button--disabled) {\n background-color: transparent;\n border-color: transparent;\n color: var(--syn-color-primary-700);\n }\n\n /*\n * Size modifiers\n */\n\n .button--small {\n height: auto;\n min-height: var(--syn-input-height-small);\n font-size: var(--syn-button-font-size-small);\n line-height: calc(var(--syn-input-height-small) - var(--syn-input-border-width) * 2);\n border-radius: var(--syn-input-border-radius-small);\n }\n\n .button--medium {\n height: auto;\n min-height: var(--syn-input-height-medium);\n font-size: var(--syn-button-font-size-medium);\n line-height: calc(var(--syn-input-height-medium) - var(--syn-input-border-width) * 2);\n border-radius: var(--syn-input-border-radius-medium);\n }\n\n .button--large {\n height: auto;\n min-height: var(--syn-input-height-large);\n font-size: var(--syn-button-font-size-large);\n line-height: calc(var(--syn-input-height-large) - var(--syn-input-border-width) * 2);\n border-radius: var(--syn-input-border-radius-large);\n }\n\n /*\n * Caret modifier\n */\n\n .button--caret .button__suffix {\n display: none;\n }\n\n .button--caret .button__caret {\n height: auto;\n }\n\n /*\n * Loading modifier\n */\n\n .button--loading {\n position: relative;\n cursor: wait;\n }\n\n .button--loading .button__prefix,\n .button--loading .button__label,\n .button--loading .button__suffix,\n .button--loading .button__caret {\n visibility: hidden;\n }\n\n .button--loading syn-spinner {\n --indicator-color: currentColor;\n position: absolute;\n font-size: 1em;\n height: 1em;\n width: 1em;\n top: calc(50% - 0.5em);\n left: calc(50% - 0.5em);\n }\n\n /*\n * Badges\n */\n\n .button ::slotted(syn-badge) {\n position: absolute;\n top: 0;\n right: 0;\n translate: 50% -50%;\n pointer-events: none;\n }\n\n .button--rtl ::slotted(syn-badge) {\n right: auto;\n left: 0;\n translate: -50% -50%;\n }\n\n /*\n * Button spacing\n */\n\n .button--has-label.button--small .button__label {\n padding: 0 var(--syn-spacing-small);\n }\n\n .button--has-label.button--medium .button__label {\n padding: 0 var(--syn-spacing-medium);\n }\n\n .button--has-label.button--large .button__label {\n padding: 0 var(--syn-spacing-large);\n }\n\n .button--has-prefix.button--small {\n padding-inline-start: var(--syn-spacing-x-small);\n }\n\n .button--has-prefix.button--small .button__label {\n padding-inline-start: var(--syn-spacing-x-small);\n }\n\n .button--has-prefix.button--medium {\n padding-inline-start: var(--syn-spacing-small);\n }\n\n .button--has-prefix.button--medium .button__label {\n padding-inline-start: var(--syn-spacing-small);\n }\n\n .button--has-prefix.button--large {\n padding-inline-start: var(--syn-spacing-small);\n }\n\n .button--has-prefix.button--large .button__label {\n padding-inline-start: var(--syn-spacing-small);\n }\n\n .button--has-suffix.button--small,\n .button--caret.button--small {\n padding-inline-end: var(--syn-spacing-x-small);\n }\n\n .button--has-suffix.button--small .button__label,\n .button--caret.button--small .button__label {\n padding-inline-end: var(--syn-spacing-x-small);\n }\n\n .button--has-suffix.button--medium,\n .button--caret.button--medium {\n padding-inline-end: var(--syn-spacing-small);\n }\n\n .button--has-suffix.button--medium .button__label,\n .button--caret.button--medium .button__label {\n padding-inline-end: var(--syn-spacing-small);\n }\n\n .button--has-suffix.button--large,\n .button--caret.button--large {\n padding-inline-end: var(--syn-spacing-small);\n }\n\n .button--has-suffix.button--large .button__label,\n .button--caret.button--large .button__label {\n padding-inline-end: var(--syn-spacing-small);\n }\n\n /*\n * Button groups support a variety of button types (e.g. buttons with tooltips, buttons as dropdown triggers, etc.).\n * This means buttons aren't always direct descendants of the button group, thus we can't target them with the\n * ::slotted selector. To work around this, the button group component does some magic to add these special classes to\n * buttons and we style them here instead.\n */\n\n :host(.syn-button-group__button--first:not(.syn-button-group__button--last)) .button {\n border-start-end-radius: 0;\n border-end-end-radius: 0;\n }\n\n :host(.syn-button-group__button--inner) .button {\n border-radius: 0;\n }\n\n :host(.syn-button-group__button--last:not(.syn-button-group__button--first)) .button {\n border-start-start-radius: 0;\n border-end-start-radius: 0;\n }\n\n /* All except the first */\n :host(.syn-button-group__button:not(.syn-button-group__button--first)) {\n margin-inline-start: calc(-1 * var(--syn-input-border-width));\n }\n\n /* Add a visual separator between solid buttons */\n :host(\n .syn-button-group__button:not(\n .syn-button-group__button--first,\n .syn-button-group__button--radio,\n [variant='filled']\n ):not(:hover)\n )\n .button:after {\n content: '';\n position: absolute;\n top: 0;\n inset-inline-start: 0;\n bottom: 0;\n border-left: solid 1px rgb(128 128 128 / 33%);\n mix-blend-mode: multiply;\n }\n\n /* Bump hovered, focused, and checked buttons up so their focus ring isn't clipped */\n :host(.syn-button-group__button--hover) {\n z-index: 1;\n }\n\n /* Focus and checked are always on top */\n :host(.syn-button-group__button--focus),\n :host(.syn-button-group__button[checked]) {\n z-index: 2;\n }\n`;\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,WAAW;AAEpB,IAAO,wBAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -16,7 +16,7 @@ var FormControlController = class {
|
|
|
16
16
|
const name = this.options.name(this.host);
|
|
17
17
|
const value = this.options.value(this.host);
|
|
18
18
|
const isButton = this.host.tagName.toLowerCase() === "syn-button";
|
|
19
|
-
if (!disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
|
|
19
|
+
if (this.host.isConnected && !disabled && !isButton && typeof name === "string" && name.length > 0 && typeof value !== "undefined") {
|
|
20
20
|
if (Array.isArray(value)) {
|
|
21
21
|
value.forEach((val) => {
|
|
22
22
|
event.formData.append(name, val.toString());
|
|
@@ -301,4 +301,4 @@ export {
|
|
|
301
301
|
valueMissingValidityState,
|
|
302
302
|
customErrorValidityState
|
|
303
303
|
};
|
|
304
|
-
//# sourceMappingURL=chunk.
|
|
304
|
+
//# sourceMappingURL=chunk.SZCGMXW5.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/internal/form.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport type { ReactiveController, ReactiveControllerHost } from 'lit';\nimport type { SynergyFormControl } from '../internal/synergy-element.js';\nimport type SynButton from '../components/button/button.js';\n\n//\n// We store a WeakMap of forms + controls so we can keep references to all Synergy controls within a given form. As\n// elements connect and disconnect to/from the DOM, their containing form is used as the key and the form control is\n// added and removed from the form's set, respectively.\n//\nexport const formCollections: WeakMap<HTMLFormElement, Set<SynergyFormControl>> = new WeakMap();\n\n//\n// We store a WeakMap of reportValidity() overloads so we can override it when form controls connect to the DOM and\n// restore the original behavior when they disconnect.\n//\nconst reportValidityOverloads: WeakMap<HTMLFormElement, () => boolean> = new WeakMap();\nconst checkValidityOverloads: WeakMap<HTMLFormElement, () => boolean> = new WeakMap();\n\n//\n// We store a Set of controls that users have interacted with. This allows us to determine the interaction state\n// without littering the DOM with additional data attributes.\n//\nconst userInteractedControls: WeakSet<SynergyFormControl> = new WeakSet();\n\n//\n// We store a WeakMap of interactions for each form control so we can track when all conditions are met for validation.\n//\nconst interactions = new WeakMap<SynergyFormControl, string[]>();\n\nexport interface FormControlControllerOptions {\n /** A function that returns the form containing the form control. */\n form: (input: SynergyFormControl) => HTMLFormElement | null;\n /** A function that returns the form control's name, which will be submitted with the form data. */\n name: (input: SynergyFormControl) => string;\n /** A function that returns the form control's current value. */\n value: (input: SynergyFormControl) => unknown | unknown[];\n /** A function that returns the form control's default value. */\n defaultValue: (input: SynergyFormControl) => unknown | unknown[];\n /** A function that returns the form control's current disabled state. If disabled, the value won't be submitted. */\n disabled: (input: SynergyFormControl) => boolean;\n /**\n * A function that maps to the form control's reportValidity() function. When the control is invalid, this will\n * prevent submission and trigger the browser's constraint violation warning.\n */\n reportValidity: (input: SynergyFormControl) => boolean;\n\n /**\n * A function that maps to the form control's `checkValidity()` function. When the control is invalid, this will return false.\n * this is helpful is you want to check validation without triggering the native browser constraint violation warning.\n */\n checkValidity: (input: SynergyFormControl) => boolean;\n /** A function that sets the form control's value */\n setValue: (input: SynergyFormControl, value: unknown) => void;\n /**\n * An array of event names to listen to. When all events in the list are emitted, the control will receive validity\n * states such as user-valid and user-invalid.user interacted validity states. */\n assumeInteractionOn: string[];\n}\n\n/** A reactive controller to allow form controls to participate in form submission, validation, etc. */\nexport class FormControlController implements ReactiveController {\n host: SynergyFormControl & ReactiveControllerHost;\n form?: HTMLFormElement | null;\n options: FormControlControllerOptions;\n\n constructor(host: ReactiveControllerHost & SynergyFormControl, options?: Partial<FormControlControllerOptions>) {\n (this.host = host).addController(this);\n this.options = {\n form: input => {\n // If there's a form attribute, use it to find the target form by id\n // Controls may not always reflect the 'form' property. For example, `<syn-button>` doesn't reflect.\n const formId = input.form;\n\n if (formId) {\n const root = input.getRootNode() as Document | ShadowRoot;\n\n const form = root.getElementById(formId);\n\n if (form) {\n return form as HTMLFormElement;\n }\n }\n\n return input.closest('form');\n },\n name: input => input.name,\n value: input => input.value,\n defaultValue: input => input.defaultValue,\n disabled: input => input.disabled ?? false,\n reportValidity: input => (typeof input.reportValidity === 'function' ? input.reportValidity() : true),\n checkValidity: input => (typeof input.checkValidity === 'function' ? input.checkValidity() : true),\n setValue: (input, value: string) => (input.value = value),\n assumeInteractionOn: ['syn-input'],\n ...options\n };\n }\n\n hostConnected() {\n const form = this.options.form(this.host);\n\n if (form) {\n this.attachForm(form);\n }\n\n // Listen for interactions\n interactions.set(this.host, []);\n this.options.assumeInteractionOn.forEach(event => {\n this.host.addEventListener(event, this.handleInteraction);\n });\n }\n\n hostDisconnected() {\n this.detachForm();\n\n // Clean up interactions\n interactions.delete(this.host);\n this.options.assumeInteractionOn.forEach(event => {\n this.host.removeEventListener(event, this.handleInteraction);\n });\n }\n\n hostUpdated() {\n const form = this.options.form(this.host);\n\n // Detach if the form no longer exists\n if (!form) {\n this.detachForm();\n }\n\n // If the form has changed, reattach it\n if (form && this.form !== form) {\n this.detachForm();\n this.attachForm(form);\n }\n\n if (this.host.hasUpdated) {\n this.setValidity(this.host.validity.valid);\n }\n }\n\n private attachForm(form?: HTMLFormElement) {\n if (form) {\n this.form = form;\n\n // Add this element to the form's collection\n if (formCollections.has(this.form)) {\n formCollections.get(this.form)!.add(this.host);\n } else {\n formCollections.set(this.form, new Set<SynergyFormControl>([this.host]));\n }\n\n this.form.addEventListener('formdata', this.handleFormData);\n this.form.addEventListener('submit', this.handleFormSubmit);\n this.form.addEventListener('reset', this.handleFormReset);\n\n // Overload the form's reportValidity() method so it looks at Synergy form controls\n if (!reportValidityOverloads.has(this.form)) {\n reportValidityOverloads.set(this.form, this.form.reportValidity);\n this.form.reportValidity = () => this.reportFormValidity();\n }\n\n // Overload the form's checkValidity() method so it looks at Synergy form controls\n if (!checkValidityOverloads.has(this.form)) {\n checkValidityOverloads.set(this.form, this.form.checkValidity);\n this.form.checkValidity = () => this.checkFormValidity();\n }\n } else {\n this.form = undefined;\n }\n }\n\n private detachForm() {\n if (!this.form) return;\n\n const formCollection = formCollections.get(this.form);\n\n if (!formCollection) {\n return;\n }\n\n // Remove this host from the form's collection\n formCollection.delete(this.host);\n\n // Check to make sure there's no other form controls in the collection. If we do this\n // without checking if any other controls are still in the collection, then we will wipe out the\n // validity checks for all other elements.\n // see: https://github.com/synergy-design-system/synergy/issues/1703\n if (formCollection.size <= 0) {\n this.form.removeEventListener('formdata', this.handleFormData);\n this.form.removeEventListener('submit', this.handleFormSubmit);\n this.form.removeEventListener('reset', this.handleFormReset);\n\n // Remove the overload and restore the original method\n if (reportValidityOverloads.has(this.form)) {\n this.form.reportValidity = reportValidityOverloads.get(this.form)!;\n reportValidityOverloads.delete(this.form);\n }\n\n if (checkValidityOverloads.has(this.form)) {\n this.form.checkValidity = checkValidityOverloads.get(this.form)!;\n checkValidityOverloads.delete(this.form);\n }\n\n // So it looks weird here to not always set the form to undefined. But I _think_ if we unattach this.form here,\n // we end up in this fun spot where future validity checks don't have a reference to the form validity handler.\n // First form element in sets the validity handler. So we can't clean up `this.form` until there are no other form elements in the form.\n this.form = undefined;\n }\n }\n\n private handleFormData = (event: FormDataEvent) => {\n const disabled = this.options.disabled(this.host);\n const name = this.options.name(this.host);\n const value = this.options.value(this.host);\n\n // For buttons, we only submit the value if they were the submitter. This is currently done in doAction() by\n // injecting the name/value on a temporary button, so we can just skip them here.\n const isButton = this.host.tagName.toLowerCase() === 'syn-button';\n\n if (\n this.host.isConnected &&\n !disabled &&\n !isButton &&\n typeof name === 'string' &&\n name.length > 0 &&\n typeof value !== 'undefined'\n ) {\n if (Array.isArray(value)) {\n (value as unknown[]).forEach(val => {\n event.formData.append(name, (val as string | number | boolean).toString());\n });\n } else {\n event.formData.append(name, (value as string | number | boolean).toString());\n }\n }\n };\n\n private handleFormSubmit = (event: Event) => {\n const disabled = this.options.disabled(this.host);\n const reportValidity = this.options.reportValidity;\n\n // Update the interacted state for all controls when the form is submitted\n if (this.form && !this.form.noValidate) {\n formCollections.get(this.form)?.forEach(control => {\n this.setUserInteracted(control, true);\n });\n }\n\n if (this.form && !this.form.noValidate && !disabled && !reportValidity(this.host)) {\n event.preventDefault();\n event.stopImmediatePropagation();\n }\n };\n\n private handleFormReset = () => {\n this.options.setValue(this.host, this.options.defaultValue(this.host));\n this.setUserInteracted(this.host, false);\n interactions.set(this.host, []);\n };\n\n private handleInteraction = (event: Event) => {\n const emittedEvents = interactions.get(this.host)!;\n\n if (!emittedEvents.includes(event.type)) {\n emittedEvents.push(event.type);\n }\n\n // Mark it as user-interacted as soon as all associated events have been emitted\n if (emittedEvents.length === this.options.assumeInteractionOn.length) {\n this.setUserInteracted(this.host, true);\n }\n };\n\n private checkFormValidity = () => {\n //\n // This is very similar to the `reportFormValidity` function, but it does not trigger native constraint validation\n // Allow the user to simply check if the form is valid and handling validity in their own way.\n //\n // We preserve the original method in a WeakMap, but we don't call it from the overload because that would trigger\n // validations in an unexpected order. When the element disconnects, we revert to the original behavior. This won't\n // be necessary once we can use ElementInternals.\n //\n // Note that we're also honoring the form's novalidate attribute.\n //\n if (this.form && !this.form.noValidate) {\n // This seems sloppy, but checking all elements will cover native inputs, Synergy inputs, and other custom\n // elements that support the constraint validation API.\n const elements = this.form.querySelectorAll<HTMLInputElement>('*');\n\n for (const element of elements) {\n if (typeof element.checkValidity === 'function') {\n if (!element.checkValidity()) {\n return false;\n }\n }\n }\n }\n\n return true;\n };\n\n private reportFormValidity = () => {\n //\n // Synergy form controls work hard to act like regular form controls. They support the Constraint Validation API\n // and its associated methods such as setCustomValidity() and reportValidity(). However, the HTMLFormElement also\n // has a reportValidity() method that will trigger validation on all child controls. Since we're not yet using\n // ElementInternals, we need to overload this method so it looks for any element with the reportValidity() method.\n //\n // We preserve the original method in a WeakMap, but we don't call it from the overload because that would trigger\n // validations in an unexpected order. When the element disconnects, we revert to the original behavior. This won't\n // be necessary once we can use ElementInternals.\n //\n // Note that we're also honoring the form's novalidate attribute.\n //\n if (this.form && !this.form.noValidate) {\n // This seems sloppy, but checking all elements will cover native inputs, Synergy inputs, and other custom\n // elements that support the constraint validation API.\n const elements = this.form.querySelectorAll<HTMLInputElement>('*');\n\n for (const element of elements) {\n if (typeof element.reportValidity === 'function') {\n if (!element.reportValidity()) {\n return false;\n }\n }\n }\n }\n\n return true;\n };\n\n private setUserInteracted(el: SynergyFormControl, hasInteracted: boolean) {\n if (hasInteracted) {\n userInteractedControls.add(el);\n } else {\n userInteractedControls.delete(el);\n }\n\n el.requestUpdate();\n }\n\n private doAction(type: 'submit' | 'reset', submitter?: HTMLInputElement | SynButton) {\n if (this.form) {\n const button = document.createElement('button');\n button.type = type;\n button.style.position = 'absolute';\n button.style.width = '0';\n button.style.height = '0';\n button.style.clipPath = 'inset(50%)';\n button.style.overflow = 'hidden';\n button.style.whiteSpace = 'nowrap';\n\n // Pass name, value, and form attributes through to the temporary button\n if (submitter) {\n button.name = submitter.name;\n button.value = submitter.value;\n\n ['formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget'].forEach(attr => {\n if (submitter.hasAttribute(attr)) {\n button.setAttribute(attr, submitter.getAttribute(attr)!);\n }\n });\n }\n\n this.form.append(button);\n button.click();\n button.remove();\n }\n }\n\n /** Returns the associated `<form>` element, if one exists. */\n getForm() {\n return this.form ?? null;\n }\n\n /** Resets the form, restoring all the control to their default value */\n reset(submitter?: HTMLInputElement | SynButton) {\n this.doAction('reset', submitter);\n }\n\n /** Submits the form, triggering validation and form data injection. */\n submit(submitter?: HTMLInputElement | SynButton) {\n // Calling form.submit() bypasses the submit event and constraint validation. To prevent this, we can inject a\n // native submit button into the form, \"click\" it, then remove it to simulate a standard form submission.\n this.doAction('submit', submitter);\n }\n\n /**\n * Synchronously sets the form control's validity. Call this when you know the future validity but need to update\n * the host element immediately, i.e. before Lit updates the component in the next update.\n */\n setValidity(isValid: boolean) {\n const host = this.host;\n const hasInteracted = Boolean(userInteractedControls.has(host));\n const required = Boolean(host.required);\n\n //\n // We're mapping the following \"states\" to data attributes. In the future, we can use ElementInternals.states to\n // create a similar mapping, but instead of [data-invalid] it will look like :--invalid.\n //\n // See this RFC for more details: https://github.com/synergy-design-system/synergy/issues/1011\n //\n host.toggleAttribute('data-required', required);\n host.toggleAttribute('data-optional', !required);\n host.toggleAttribute('data-invalid', !isValid);\n host.toggleAttribute('data-valid', isValid);\n host.toggleAttribute('data-user-invalid', !isValid && hasInteracted);\n host.toggleAttribute('data-user-valid', isValid && hasInteracted);\n }\n\n /**\n * Updates the form control's validity based on the current value of `host.validity.valid`. Call this when anything\n * that affects constraint validation changes so the component receives the correct validity states.\n */\n updateValidity() {\n const host = this.host;\n this.setValidity(host.validity.valid);\n }\n\n /**\n * Dispatches a non-bubbling, cancelable custom event of type `syn-invalid`.\n * If the `syn-invalid` event will be cancelled then the original `invalid`\n * event (which may have been passed as argument) will also be cancelled.\n * If no original `invalid` event has been passed then the `syn-invalid`\n * event will be cancelled before being dispatched.\n */\n emitInvalidEvent(originalInvalidEvent?: Event) {\n const slInvalidEvent = new CustomEvent<Record<PropertyKey, never>>('syn-invalid', {\n bubbles: false,\n composed: false,\n cancelable: true,\n detail: {}\n });\n\n if (!originalInvalidEvent) {\n slInvalidEvent.preventDefault();\n }\n\n if (!this.host.dispatchEvent(slInvalidEvent)) {\n originalInvalidEvent?.preventDefault();\n }\n }\n}\n\n/*\n * Predefined common validity states.\n * All of them are read-only.\n */\n\n// A validity state object that represents `valid`\nexport const validValidityState: ValidityState = Object.freeze({\n badInput: false,\n customError: false,\n patternMismatch: false,\n rangeOverflow: false,\n rangeUnderflow: false,\n stepMismatch: false,\n tooLong: false,\n tooShort: false,\n typeMismatch: false,\n valid: true,\n valueMissing: false\n});\n\n// A validity state object that represents `value missing`\nexport const valueMissingValidityState: ValidityState = Object.freeze({\n ...validValidityState,\n valid: false,\n valueMissing: true\n});\n\n// A validity state object that represents a custom error\nexport const customErrorValidityState: ValidityState = Object.freeze({\n ...validValidityState,\n valid: false,\n customError: true\n});\n"],
|
|
5
|
+
"mappings": ";;;;;;AAeO,IAAM,kBAAqE,oBAAI,QAAQ;AAM9F,IAAM,0BAAmE,oBAAI,QAAQ;AACrF,IAAM,yBAAkE,oBAAI,QAAQ;AAMpF,IAAM,yBAAsD,oBAAI,QAAQ;AAKxE,IAAM,eAAe,oBAAI,QAAsC;AAiCxD,IAAM,wBAAN,MAA0D;AAAA,EAK/D,YAAY,MAAmD,SAAiD;AAiJhH,SAAQ,iBAAiB,CAAC,UAAyB;AACjD,YAAM,WAAW,KAAK,QAAQ,SAAS,KAAK,IAAI;AAChD,YAAM,OAAO,KAAK,QAAQ,KAAK,KAAK,IAAI;AACxC,YAAM,QAAQ,KAAK,QAAQ,MAAM,KAAK,IAAI;AAI1C,YAAM,WAAW,KAAK,KAAK,QAAQ,YAAY,MAAM;AAErD,UACE,KAAK,KAAK,eACV,CAAC,YACD,CAAC,YACD,OAAO,SAAS,YAChB,KAAK,SAAS,KACd,OAAO,UAAU,aACjB;AACA,YAAI,MAAM,QAAQ,KAAK,GAAG;AACxB,UAAC,MAAoB,QAAQ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AM,OAAO,KAAK;AAClB,SAAK,YAAY,KAAK,SAAS,KAAK;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,iBAAiB,sBAA8B;AAC7C,UAAM,iBAAiB,IAAI,YAAwC,eAAe;AAAA,MAChF,SAAS;AAAA,MACT,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,QAAQ,CAAC;AAAA,IACX,CAAC;AAED,QAAI,CAAC,sBAAsB;AACzB,qBAAe,eAAe;AAAA,IAChC;AAEA,QAAI,CAAC,KAAK,KAAK,cAAc,cAAc,GAAG;AAC5C,mEAAsB;AAAA,IACxB;AAAA,EACF;AACF;AAQO,IAAM,qBAAoC,OAAO,OAAO;AAAA,EAC7D,UAAU;AAAA,EACV,aAAa;AAAA,EACb,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,UAAU;AAAA,EACV,cAAc;AAAA,EACd,OAAO;AAAA,EACP,cAAc;AAChB,CAAC;AAGM,IAAM,4BAA2C,OAAO,OAAO,iCACjE,qBADiE;AAAA,EAEpE,OAAO;AAAA,EACP,cAAc;AAChB,EAAC;AAGM,IAAM,2BAA0C,OAAO,OAAO,iCAChE,qBADgE;AAAA,EAEnE,OAAO;AAAA,EACP,aAAa;AACf,EAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
SynergyElement
|
|
3
|
-
|
|
2
|
+
SynergyElement,
|
|
3
|
+
component_styles_default
|
|
4
|
+
} from "./chunk.XVNL6NRN.js";
|
|
4
5
|
import {
|
|
5
6
|
button_group_styles_default
|
|
6
|
-
} from "./chunk.
|
|
7
|
+
} from "./chunk.A7IIJ2LL.js";
|
|
7
8
|
import {
|
|
8
9
|
__decorateClass
|
|
9
10
|
} from "./chunk.QNDC5KWA.js";
|
|
@@ -64,7 +65,7 @@ var SynButtonGroup = class extends SynergyElement {
|
|
|
64
65
|
`;
|
|
65
66
|
}
|
|
66
67
|
};
|
|
67
|
-
SynButtonGroup.styles = button_group_styles_default;
|
|
68
|
+
SynButtonGroup.styles = [component_styles_default, button_group_styles_default];
|
|
68
69
|
__decorateClass([
|
|
69
70
|
query("slot")
|
|
70
71
|
], SynButtonGroup.prototype, "defaultSlot", 2);
|
|
@@ -83,4 +84,4 @@ function findButton(el) {
|
|
|
83
84
|
export {
|
|
84
85
|
SynButtonGroup
|
|
85
86
|
};
|
|
86
|
-
//# sourceMappingURL=chunk.
|
|
87
|
+
//# sourceMappingURL=chunk.TGVTAWOV.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/button-group/button-group.component.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { html } from 'lit';\nimport { property, query, state } from 'lit/decorators.js';\nimport componentStyles from '../../styles/component.styles.js';\nimport SynergyElement from '../../internal/synergy-element.js';\nimport styles from './button-group.styles.js';\nimport type { CSSResultGroup } from 'lit';\n\n/**\n * @summary Button groups can be used to group related buttons into sections.\n * @documentation https://synergy.style/components/button-group\n * @status stable\n * @since 2.0\n *\n * @slot - One or more `<syn-button>` elements to display in the button group.\n *\n * @csspart base - The component's base wrapper.\n */\nexport default class SynButtonGroup extends SynergyElement {\n static styles: CSSResultGroup = [componentStyles, styles];\n\n @query('slot') defaultSlot: HTMLSlotElement;\n\n @state() disableRole = false;\n\n /**\n * A label to use for the button group. This won't be displayed on the screen, but it will be announced by assistive\n * devices when interacting with the control and is strongly recommended.\n */\n @property() label = '';\n\n private handleFocus(event: Event) {\n const button = findButton(event.target as HTMLElement);\n button?.classList.add('syn-button-group__button--focus');\n }\n\n private handleBlur(event: Event) {\n const button = findButton(event.target as HTMLElement);\n button?.classList.remove('syn-button-group__button--focus');\n }\n\n private handleMouseOver(event: Event) {\n const button = findButton(event.target as HTMLElement);\n button?.classList.add('syn-button-group__button--hover');\n }\n\n private handleMouseOut(event: Event) {\n const button = findButton(event.target as HTMLElement);\n button?.classList.remove('syn-button-group__button--hover');\n }\n\n private handleSlotChange() {\n const slottedElements = [...this.defaultSlot.assignedElements({ flatten: true })] as HTMLElement[];\n\n slottedElements.forEach(el => {\n const index = slottedElements.indexOf(el);\n const button = findButton(el);\n\n if (button) {\n button.classList.add('syn-button-group__button');\n button.classList.toggle('syn-button-group__button--first', index === 0);\n button.classList.toggle('syn-button-group__button--inner', index > 0 && index < slottedElements.length - 1);\n button.classList.toggle('syn-button-group__button--last', index === slottedElements.length - 1);\n button.classList.toggle('syn-button-group__button--radio', button.tagName.toLowerCase() === 'syn-radio-button');\n }\n });\n }\n\n render() {\n // eslint-disable-next-line lit-a11y/mouse-events-have-key-events\n return html`\n <div\n part=\"base\"\n class=\"button-group\"\n role=\"${this.disableRole ? 'presentation' : 'group'}\"\n aria-label=${this.label}\n @focusout=${this.handleBlur}\n @focusin=${this.handleFocus}\n @mouseover=${this.handleMouseOver}\n @mouseout=${this.handleMouseOut}\n >\n <slot @slotchange=${this.handleSlotChange}></slot>\n </div>\n `;\n }\n}\n\nfunction findButton(el: HTMLElement) {\n const selector = 'syn-button, syn-radio-button';\n\n // The button could be the target element or a child of it (e.g. a dropdown or tooltip anchor)\n return el.closest(selector) ?? el.querySelector(selector);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAMA,SAAS,YAAY;AACrB,SAAS,UAAU,OAAO,aAAa;AAgBvC,IAAqB,iBAArB,cAA4C,eAAe;AAAA,EAA3D;AAAA;AAKW,uBAAc;AAMX,iBAAQ;AAAA;AAAA,EAEZ,YAAY,OAAc;AAChC,UAAM,SAAS,WAAW,MAAM,MAAqB;AACrD,qCAAQ,UAAU,IAAI;AAAA,EACxB;AAA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AAR,MAAM;AAAA,GALY,eAKV;AAMG;AAAA,EAAX,SAAS;AAAA,GAXS,eAWP;AA0Dd,SAAS,WAAW,IAAiB;AA5FrC;AA6FE,QAAM,WAAW;AAGjB,UAAO,QAAG,QAAQ,QAAQ,MAAnB,YAAwB,GAAG,cAAc,QAAQ;AAC1D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,62 +1,6 @@
|
|
|
1
1
|
// src/styles/form-control.styles.ts
|
|
2
|
-
import { css as css2 } from "lit";
|
|
3
|
-
|
|
4
|
-
// src/styles/form-control.custom.styles.ts
|
|
5
2
|
import { css } from "lit";
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
/* Label */
|
|
9
|
-
.form-control--has-label .form-control__label {
|
|
10
|
-
font-weight: var(--syn-font-weight-semibold);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.form-control--has-label.form-control--small .form-control__label {
|
|
14
|
-
margin-bottom: var(--syn-spacing-x-small);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
.form-control--has-label.form-control--medium .form-control__label {
|
|
18
|
-
margin-bottom: var(--syn-input-spacing-small);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.form-control--has-label.form-control--large .form-control__label {
|
|
22
|
-
margin-bottom: var(--syn-input-spacing-medium);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/* Help text */
|
|
26
|
-
.form-control--has-help-text .form-control__help-text {
|
|
27
|
-
margin-top: var(--syn-spacing-x-small);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.form-control--small.form-control--has-prefix .input__control {
|
|
31
|
-
padding: var(--syn-spacing-3x-small) 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.form-control--has-prefix.form-control--medium .input__control {
|
|
35
|
-
padding: var(--syn-spacing-x-small) 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.form-control--large.form-control--has-prefix .input__control {
|
|
39
|
-
padding: var(--syn-input-spacing-small) 0;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/* ERROR */
|
|
43
|
-
|
|
44
|
-
:host([data-user-invalid]) .form-control__help-text {
|
|
45
|
-
color: var(--syn-input-help-text-color-error);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/* DISABLED */
|
|
49
|
-
|
|
50
|
-
:host([disabled]) .form-control--has-label .form-control__label,
|
|
51
|
-
:host([disabled]) .form-control--has-help-text .form-control__help-text {
|
|
52
|
-
cursor: not-allowed;
|
|
53
|
-
opacity: 0.5;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
`;
|
|
57
|
-
|
|
58
|
-
// src/styles/form-control.styles.ts
|
|
59
|
-
var form_control_styles_default = css2`
|
|
3
|
+
var form_control_styles_default = css`
|
|
60
4
|
/* stylelint-disable */
|
|
61
5
|
.form-control .form-control__label {
|
|
62
6
|
display: none;
|
|
@@ -113,11 +57,64 @@ var form_control_styles_default = css2`
|
|
|
113
57
|
.form-control--has-help-text.form-control--radio-group .form-control__help-text {
|
|
114
58
|
margin-top: var(--syn-spacing-2x-small);
|
|
115
59
|
}
|
|
60
|
+
`;
|
|
61
|
+
|
|
62
|
+
// src/styles/form-control.custom.styles.ts
|
|
63
|
+
import { css as css2 } from "lit";
|
|
64
|
+
var form_control_custom_styles_default = css2`
|
|
65
|
+
|
|
66
|
+
/* Label */
|
|
67
|
+
.form-control--has-label .form-control__label {
|
|
68
|
+
font-weight: var(--syn-font-weight-semibold);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.form-control--has-label.form-control--small .form-control__label {
|
|
72
|
+
margin-bottom: var(--syn-spacing-x-small);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.form-control--has-label.form-control--medium .form-control__label {
|
|
76
|
+
margin-bottom: var(--syn-input-spacing-small);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.form-control--has-label.form-control--large .form-control__label {
|
|
80
|
+
margin-bottom: var(--syn-input-spacing-medium);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* Help text */
|
|
84
|
+
.form-control--has-help-text .form-control__help-text {
|
|
85
|
+
margin-top: var(--syn-spacing-x-small);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.form-control--small.form-control--has-prefix .input__control {
|
|
89
|
+
padding: var(--syn-spacing-3x-small) 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.form-control--has-prefix.form-control--medium .input__control {
|
|
93
|
+
padding: var(--syn-spacing-x-small) 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.form-control--large.form-control--has-prefix .input__control {
|
|
97
|
+
padding: var(--syn-input-spacing-small) 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/* ERROR */
|
|
101
|
+
|
|
102
|
+
:host([data-user-invalid]) .form-control__help-text {
|
|
103
|
+
color: var(--syn-input-help-text-color-error);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/* DISABLED */
|
|
107
|
+
|
|
108
|
+
:host([disabled]) .form-control--has-label .form-control__label,
|
|
109
|
+
:host([disabled]) .form-control--has-help-text .form-control__help-text {
|
|
110
|
+
cursor: not-allowed;
|
|
111
|
+
opacity: 0.5;
|
|
112
|
+
}
|
|
116
113
|
|
|
117
|
-
${form_control_custom_styles_default}
|
|
118
114
|
`;
|
|
119
115
|
|
|
120
116
|
export {
|
|
121
|
-
form_control_styles_default
|
|
117
|
+
form_control_styles_default,
|
|
118
|
+
form_control_custom_styles_default
|
|
122
119
|
};
|
|
123
|
-
//# sourceMappingURL=chunk.
|
|
120
|
+
//# sourceMappingURL=chunk.TTL762VF.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/styles/form-control.styles.ts", "../../src/styles/form-control.custom.styles.ts"],
|
|
4
|
+
"sourcesContent": ["// ---------------------------------------------------------------------\n// \uD83D\uDD12 AUTOGENERATED BY VENDORISM\n// Removing this comment will prevent it from being managed by it.\n// ---------------------------------------------------------------------\n\n/* eslint-disable */\nimport { css } from 'lit';\n\nexport default css`\n\t/* stylelint-disable */\n .form-control .form-control__label {\n display: none;\n }\n\n .form-control .form-control__help-text {\n display: none;\n }\n\n /* Label */\n .form-control--has-label .form-control__label {\n display: inline-block;\n color: var(--syn-input-label-color);\n margin-bottom: var(--syn-spacing-3x-small);\n }\n\n .form-control--has-label.form-control--small .form-control__label {\n font-size: var(--syn-input-label-font-size-small);\n }\n\n .form-control--has-label.form-control--medium .form-control__label {\n font-size: var(--syn-input-label-font-size-medium);\n }\n\n .form-control--has-label.form-control--large .form-control__label {\n font-size: var(--syn-input-label-font-size-large);\n }\n\n :host([required]) .form-control--has-label .form-control__label::after {\n content: var(--syn-input-required-content);\n margin-inline-start: var(--syn-input-required-content-offset);\n color: var(--syn-input-required-content-color);\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n display: block;\n color: var(--syn-input-help-text-color);\n margin-top: var(--syn-spacing-3x-small);\n }\n\n .form-control--has-help-text.form-control--small .form-control__help-text {\n font-size: var(--syn-input-help-text-font-size-small);\n }\n\n .form-control--has-help-text.form-control--medium .form-control__help-text {\n font-size: var(--syn-input-help-text-font-size-medium);\n }\n\n .form-control--has-help-text.form-control--large .form-control__help-text {\n font-size: var(--syn-input-help-text-font-size-large);\n }\n\n .form-control--has-help-text.form-control--radio-group .form-control__help-text {\n margin-top: var(--syn-spacing-2x-small);\n }\n`;\n", "import { css } from 'lit';\n\nexport default css` \n\n /* Label */\n .form-control--has-label .form-control__label {\n font-weight: var(--syn-font-weight-semibold);\n }\n\n .form-control--has-label.form-control--small .form-control__label {\n margin-bottom: var(--syn-spacing-x-small);\n }\n \n .form-control--has-label.form-control--medium .form-control__label {\n margin-bottom: var(--syn-input-spacing-small);\n }\n\n .form-control--has-label.form-control--large .form-control__label {\n margin-bottom: var(--syn-input-spacing-medium);\n }\n\n /* Help text */\n .form-control--has-help-text .form-control__help-text {\n margin-top: var(--syn-spacing-x-small);\n }\n\n .form-control--small.form-control--has-prefix .input__control {\n padding: var(--syn-spacing-3x-small) 0;\n }\n\n .form-control--has-prefix.form-control--medium .input__control {\n padding: var(--syn-spacing-x-small) 0;\n }\n\n .form-control--large.form-control--has-prefix .input__control {\n padding: var(--syn-input-spacing-small) 0;\n }\n\n /* ERROR */\n \n :host([data-user-invalid]) .form-control__help-text {\n color: var(--syn-input-help-text-color-error);\n }\n\n /* DISABLED */\n\n :host([disabled]) .form-control--has-label .form-control__label,\n :host([disabled]) .form-control--has-help-text .form-control__help-text {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n`;\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,WAAW;AAEpB,IAAO,8BAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACRf,SAAS,OAAAA,YAAW;AAEpB,IAAO,qCAAQA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": ["css"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynSelect
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.ZGFM7UKE.js";
|
|
4
4
|
|
|
5
5
|
// src/components/select/select.ts
|
|
6
6
|
var select_default = SynSelect;
|
|
@@ -9,4 +9,4 @@ SynSelect.define("syn-select");
|
|
|
9
9
|
export {
|
|
10
10
|
select_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.UCMAXFGL.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynButton
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.YDMQ766U.js";
|
|
4
4
|
|
|
5
5
|
// src/components/button/button.ts
|
|
6
6
|
var button_default = SynButton;
|
|
@@ -9,4 +9,4 @@ SynButton.define("syn-button");
|
|
|
9
9
|
export {
|
|
10
10
|
button_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.UX22QVVR.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynSwitch
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.HELY6MCO.js";
|
|
4
4
|
|
|
5
5
|
// src/components/switch/switch.ts
|
|
6
6
|
var switch_default = SynSwitch;
|
|
@@ -9,4 +9,4 @@ SynSwitch.define("syn-switch");
|
|
|
9
9
|
export {
|
|
10
10
|
switch_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.UXDU44Q3.js.map
|
|
@@ -31,6 +31,11 @@ var switch_custom_styles_default = css`
|
|
|
31
31
|
padding: var(--syn-spacing-3x-small) 0;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/* Hint: can be removed, if the padding stylings for sizes from above are removed */
|
|
35
|
+
.form-control--has-help-text .switch {
|
|
36
|
+
padding-bottom: 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
34
39
|
.switch__control {
|
|
35
40
|
background-color: var(--syn-color-neutral-600);
|
|
36
41
|
border: solid var(--syn-border-width-medium) var(--syn-color-neutral-600);
|
|
@@ -104,4 +109,4 @@ var switch_custom_styles_default = css`
|
|
|
104
109
|
export {
|
|
105
110
|
switch_custom_styles_default
|
|
106
111
|
};
|
|
107
|
-
//# sourceMappingURL=chunk.
|
|
112
|
+
//# sourceMappingURL=chunk.W5JK7V7K.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/switch/switch.custom.styles.ts"],
|
|
4
|
+
"sourcesContent": ["import { css } from 'lit';\n\nexport default css`\n:host([size='small']) {\n --height: calc(var(--syn-font-size-medium) + 2px);\n --thumb-size: var(--syn-font-size-small);\n --width: calc((var(--height) * 2) - 6px);\n }\n\n :host([size='medium']) {\n --height: var(--syn-font-size-large);\n --thumb-size: var(--syn-font-size-medium);\n --width: calc((var(--height) * 2) - 6px);\n }\n\n :host([size='large']) {\n --height: calc(var(--syn-toggle-size-large) + 4px);\n --thumb-size: var(--syn-toggle-size-large);\n --width: calc((var(--height) * 2) - 6px);\n }\n\n .switch.switch--small {\n padding: var(--syn-spacing-2x-small) 0;\n }\n\n .switch.switch--medium {\n padding: var(--syn-spacing-2x-small) 0;\n }\n\n .switch.switch--large {\n padding: var(--syn-spacing-3x-small) 0;\n }\n\n /* Hint: can be removed, if the padding stylings for sizes from above are removed */\n .form-control--has-help-text .switch {\n padding-bottom: 0;\n }\n\n .switch__control {\n background-color: var(--syn-color-neutral-600);\n border: solid var(--syn-border-width-medium) var(--syn-color-neutral-600);\n }\n\n .switch__control .switch__thumb {\n border: none;\n }\n\n /* Hover */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-neutral-900);\n border-color: var(--syn-color-neutral-900);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n }\n\n /* Checked + hover */\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-primary-900);\n border-color: var(--syn-color-primary-900);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__control:hover .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n }\n\n /* Focus */\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--syn-color-neutral-600);\n border-color: var(--syn-color-neutral-600);\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n .switch:not(.switch--checked):not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n outline: none;\n }\n\n /* Checked + focus */\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control {\n background-color: var(--syn-color-primary-900);\n border-color: var(--syn-color-primary-900);\n outline: var(--syn-focus-ring);\n outline-offset: var(--syn-focus-ring-offset);\n }\n\n .switch.switch--checked:not(.switch--disabled) .switch__input:focus-visible ~ .switch__control .switch__thumb {\n background-color: var(--syn-color-neutral-0);\n outline: none;\n }\n\n .switch__label {\n margin-inline-start: var(--syn-spacing-x-small);\n }\n \n :host([data-user-invalid]) .switch:not(.switch--checked):not(.switch--disabled) .switch__control {\n background-color: var(--syn-color-error-700);\n border-color: var(--syn-color-error-700);\n }\n\n :host([data-user-invalid]) .switch:not(.switch--checked):not(.switch--disabled) .switch__control:hover {\n background-color: var(--syn-color-error-900);\n border-color: var(--syn-color-error-900);\n }\n `;\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,WAAW;AAEpB,IAAO,+BAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SynTextarea
|
|
3
|
-
} from "./chunk.
|
|
3
|
+
} from "./chunk.67GSZBK7.js";
|
|
4
4
|
|
|
5
5
|
// src/components/textarea/textarea.ts
|
|
6
6
|
var textarea_default = SynTextarea;
|
|
@@ -9,4 +9,4 @@ SynTextarea.define("syn-textarea");
|
|
|
9
9
|
export {
|
|
10
10
|
textarea_default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=chunk.
|
|
12
|
+
//# sourceMappingURL=chunk.WEX3I4KA.js.map
|