@quartzds/core 1.0.0-beta.26 → 1.0.0-beta.27

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.
@@ -23,6 +23,8 @@ export { Radio as QdsRadio } from '../dist/types/components/radio/radio';
23
23
  export { defineCustomElement as defineCustomElementQdsRadio } from './qds-radio';
24
24
  export { Select as QdsSelect } from '../dist/types/components/select/select';
25
25
  export { defineCustomElement as defineCustomElementQdsSelect } from './qds-select';
26
+ export { StandaloneLink as QdsStandaloneLink } from '../dist/types/components/standalone-link/standalone-link';
27
+ export { defineCustomElement as defineCustomElementQdsStandaloneLink } from './qds-standalone-link';
26
28
  export { Switch as QdsSwitch } from '../dist/types/components/switch/switch';
27
29
  export { defineCustomElement as defineCustomElementQdsSwitch } from './qds-switch';
28
30
  export { Table as QdsTable } from '../dist/types/components/table/table';
@@ -17,6 +17,7 @@ export { QdsInput, defineCustomElement as defineCustomElementQdsInput } from './
17
17
  export { QdsLabel, defineCustomElement as defineCustomElementQdsLabel } from './qds-label.js';
18
18
  export { QdsRadio, defineCustomElement as defineCustomElementQdsRadio } from './qds-radio.js';
19
19
  export { QdsSelect, defineCustomElement as defineCustomElementQdsSelect } from './qds-select.js';
20
+ export { QdsStandaloneLink, defineCustomElement as defineCustomElementQdsStandaloneLink } from './qds-standalone-link.js';
20
21
  export { QdsSwitch, defineCustomElement as defineCustomElementQdsSwitch } from './qds-switch.js';
21
22
  export { QdsTable, defineCustomElement as defineCustomElementQdsTable } from './qds-table.js';
22
23
  export { QdsTableBody, defineCustomElement as defineCustomElementQdsTableBody } from './qds-table-body.js';
@@ -1 +1 @@
1
- {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA,MAAM,WAAW,GAAG,CAAC,KAAwB;IAC3C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAA;IAClE,IAAI,OAAO,K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Q,GAAG,CACtB,OAAyB,KACF,UAAU,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,EAAC;AAElE;;;;;;;;;;;;;;;MAea,QAAQ,GAAG,CAKtB,KAAkB,EAClB,OAAyB;IAEzB,UAAU,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;AACrC;;;;","names":[],"sources":["src/utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nconst toClassList = (value?: Element | string): DOMTokenList | undefined => {\n if (value === undefined) return document.documentElement.classList\n if (typeof value === 'string')\n return document.querySelector(value)?.classList ?? undefined\n return value.classList\n}\n\nconst getVariant = (\n type: string,\n classList?: DOMTokenList | undefined,\n): string | undefined => {\n if (!classList) return undefined\n\n const prefix = `qds-${type}-`\n\n return [...classList]\n .find((value: string): value is string => value.startsWith(prefix))\n ?.replace(prefix, '')\n}\n\nconst setVariant = (\n type: string,\n value: string,\n element?: Element | string,\n): void => {\n const classList = toClassList(element)\n if (classList === undefined) return\n\n const prefix = `qds-${type}-`\n\n const currentVariant = getVariant(type, classList)\n if (currentVariant !== undefined)\n classList.remove(`${prefix}${currentVariant}`)\n classList.add(`${prefix}${value}`)\n}\n\ntype NonEmpty<T extends string = string> = T extends '' ? never : T\n\n/**\n * Get the currently set platform.\n *\n * @param element The element where the platform will be retrieved from. Can be\n * either:\n *\n * - A non-empty CSS selector string\n * - A reference to an\n * [`Element`](https://developer.mozilla.org/docs/Web/API/Element)\n *\n * By default, this is the root node of the current document.\n *\n * @returns The currently set platform if one is set, `undefined` otherwise.\n */\nexport const getPlatform = <S extends string, E extends Element = Element>(\n element?: E | NonEmpty<S>,\n): string | undefined => getVariant('platform', toClassList(element))\n\n/**\n * Sets the current platform.\n *\n * The current platform represented by a `qds-platform-`-prefixed CSS class\n * will be removed.\n *\n * @param platform The platform to set. Must be a non-empty value.\n * @param element The element where the platform will be set. Can be either:\n *\n * - A non-empty CSS selector string\n * - A reference to an\n * [`Element`](https://developer.mozilla.org/docs/Web/API/Element)\n *\n * By default, this is the root node of the current document.\n */\nexport const setPlatform = <\n P extends string,\n S extends string = string,\n E extends Element = Element,\n>(\n platform: NonEmpty<P>,\n element?: E | NonEmpty<S>,\n): void => {\n setVariant('platform', platform, element)\n}\n\n/**\n * Get the currently set theme.\n *\n * @param element The element where the theme will be retrieved from. Can be\n * either:\n *\n * - A non-empty CSS selector string\n * - A reference to an\n * [`Element`](https://developer.mozilla.org/docs/Web/API/Element)\n *\n * By default, this is the root node of the current document.\n *\n * @returns The currently set theme if one is set, `undefined` otherwise.\n */\nexport const getTheme = <S extends string, E extends Element = Element>(\n element?: E | NonEmpty<S>,\n): string | undefined => getVariant('theme', toClassList(element))\n\n/**\n * Sets the current theme.\n *\n * The current theme represented by a `qds-theme-`-prefixed CSS class will be\n * removed.\n *\n * @param theme The theme to set. Must be a non-empty value.\n * @param element The element where the theme will be set. Can be either:\n *\n * - A non-empty CSS selector string\n * - A reference to an\n * [`Element`](https://developer.mozilla.org/docs/Web/API/Element)\n *\n * By default, this is the root node of the current document.\n */\nexport const setTheme = <\n T extends string,\n S extends string = string,\n E extends Element = Element,\n>(\n theme: NonEmpty<T>,\n element?: E | NonEmpty<S>,\n): void => {\n setVariant('theme', theme, element)\n}\n"],"version":3}
1
+ {"file":"index.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAEA,MAAM,WAAW,GAAG,CAAC,KAAwB;IAC3C,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC,eAAe,CAAC,SAAS,CAAA;IAClE,IAAI,OAAO,KAAK,KAAK,QAAQ;QAC3B,OAAO,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,SAAS,IAAI,SAAS,CAAA;IAC9D,OAAO,KAAK,CAAC,SAAS,CAAA;AACxB,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,CACjB,IAAY,EACZ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,OAAO,CAAC,CAAA;AACrC;;;;","names":[],"sources":["src/utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nconst toClassList = (value?: Element | string): DOMTokenList | undefined => {\n if (value === undefined) return document.documentElement.classList\n if (typeof value === 'string')\n return document.querySelector(value)?.classList ?? undefined\n return value.classList\n}\n\nconst getVariant = (\n type: string,\n classList?: DOMTokenList | undefined,\n): string | undefined => {\n if (!classList) return undefined\n\n const prefix = `qds-${type}-`\n\n return [...classList]\n .find((value: string): value is string => value.startsWith(prefix))\n ?.replace(prefix, '')\n}\n\nconst setVariant = (\n type: string,\n value: string,\n element?: Element | string,\n): void => {\n const classList = toClassList(element)\n if (classList === undefined) return\n\n const prefix = `qds-${type}-`\n\n const currentVariant = getVariant(type, classList)\n if (currentVariant !== undefined)\n classList.remove(`${prefix}${currentVariant}`)\n classList.add(`${prefix}${value}`)\n}\n\ntype NonEmpty<T extends string = string> = T extends '' ? never : T\n\n/**\n * Get the currently set platform.\n *\n * @param element The element where the platform will be retrieved from. Can be\n * either:\n *\n * - A non-empty CSS selector string\n * - A reference to an\n * [`Element`](https://developer.mozilla.org/docs/Web/API/Element)\n *\n * By default, this is the root node of the current document.\n *\n * @returns The currently set platform if one is set, `undefined` otherwise.\n */\nexport const getPlatform = <S extends string, E extends Element = Element>(\n element?: E | NonEmpty<S>,\n): string | undefined => getVariant('platform', toClassList(element))\n\n/**\n * Sets the current platform.\n *\n * The current platform represented by a `qds-platform-`-prefixed CSS class\n * will be removed.\n *\n * @param platform The platform to set. Must be a non-empty value.\n * @param element The element where the platform will be set. Can be either:\n *\n * - A non-empty CSS selector string\n * - A reference to an\n * [`Element`](https://developer.mozilla.org/docs/Web/API/Element)\n *\n * By default, this is the root node of the current document.\n */\nexport const setPlatform = <\n P extends string,\n S extends string = string,\n E extends Element = Element,\n>(\n platform: NonEmpty<P>,\n element?: E | NonEmpty<S>,\n): void => {\n setVariant('platform', platform, element)\n}\n\n/**\n * Get the currently set theme.\n *\n * @param element The element where the theme will be retrieved from. Can be\n * either:\n *\n * - A non-empty CSS selector string\n * - A reference to an\n * [`Element`](https://developer.mozilla.org/docs/Web/API/Element)\n *\n * By default, this is the root node of the current document.\n *\n * @returns The currently set theme if one is set, `undefined` otherwise.\n */\nexport const getTheme = <S extends string, E extends Element = Element>(\n element?: E | NonEmpty<S>,\n): string | undefined => getVariant('theme', toClassList(element))\n\n/**\n * Sets the current theme.\n *\n * The current theme represented by a `qds-theme-`-prefixed CSS class will be\n * removed.\n *\n * @param theme The theme to set. Must be a non-empty value.\n * @param element The element where the theme will be set. Can be either:\n *\n * - A non-empty CSS selector string\n * - A reference to an\n * [`Element`](https://developer.mozilla.org/docs/Web/API/Element)\n *\n * By default, this is the root node of the current document.\n */\nexport const setTheme = <\n T extends string,\n S extends string = string,\n E extends Element = Element,\n>(\n theme: NonEmpty<T>,\n element?: E | NonEmpty<S>,\n): void => {\n setVariant('theme', theme, element)\n}\n"],"version":3}
@@ -1 +1 @@
1
- {"file":"qds-inline-link.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,ysEAAysE;;MCmCltE,UAAU;;;;;;;QA0Mb,wBAAmB,GAAe,EAAE,CAAA;QA6D3B,WAAM,GAAG,CAAC,KAAiB;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,CAAA;QAEgB,YAAO,GAAG,CAAC,KAAiB;YAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,CAAA;wBAxQ2C,KAAK;0BAKC,UAAU;;;;;;sBAgLG,OAAO;;IAkBtE,IAAY,kBAAkB;QAC5B,QAAQ,IAAI,CAAC,UAAU;YACrB,KAAK,SAAS,CAAC;YACf,KAAK,YAAY,EAAE;gBACjB,OAAO,IAAI,CAAC,UAAU,CAAA;aACvB;Y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EACL;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/inline-link/inline-link.css?tag=qds-inline-link&encapsulation=shadow","src/components/inline-link/inline-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-external {\n display: none;\n height: 1.25em;\n margin-inline-start: var(--qds-text-icon-gap);\n vertical-align: text-top;\n width: 1.25em;\n}\n\n.qds-inline-link {\n border-radius: var(--qds-focus-border-radius);\n box-sizing: border-box;\n\n &[rel~='external'] > .qds-external {\n display: inline-block;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-importance='subdued'] {\n &.qds-inline-link {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited {\n color: var(--qds-theme-link-subdued-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-subdued-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-subdued-visited-pressed);\n }\n }\n}\n\n[data-importance='standard'] {\n &.qds-inline-link {\n color: var(--qds-theme-link-standard-default);\n\n &:visited {\n color: var(--qds-theme-link-standard-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-standard-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-standard-visited-pressed);\n }\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited {\n color: var(--qds-theme-link-emphasized-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-emphasized-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-emphasized-visited-pressed);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Listen, Prop } from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance } from '../shared'\n\nexport type Target = '_blank' | '_parent' | '_self' | '_top'\n\n/**\n * `<qds-inline-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-inline-link>` *should* indicate the inline link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-inline-link>` element will activate it.\n *\n * @slot Content to display for the inline link.\n * @see https://quartz.se.com/build/components/inline-link\n */\n@Component({\n tag: 'qds-inline-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'inline-link.css',\n})\nexport class InlineLink implements ComponentInterface {\n /**\n * Prevents the inline link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The inline link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the inline link points to. Inline links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the inline link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target: LiteralUnion<Target, string> = '_self'\n\n /**\n * Emitted when the inline link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the inline link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsInlineLinkElement\n\n private inheritedAttributes: Attributes = {}\n\n private get computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n private get computedTabIndex(): number {\n const parsedValue = Number.parseInt(\n this.inheritedAttributes.tabindex ?? '0',\n 10,\n )\n return Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.element),\n ...inheritAttributes(this.element, ['tabindex']),\n }\n }\n\n public render() {\n return (\n <a\n aria-disabled={this.disabled.toString()}\n class=\"qds-inline-link\"\n data-importance={this.computedImportance}\n download={this.download}\n href={this.href}\n hrefLang={this.hreflang}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n target={this.target}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n tabIndex={this.disabled ? -1 : this.computedTabIndex}\n >\n <slot />\n <qds-icon class=\"qds-external\" library=\"core\" name=\"external-link\" />\n </a>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
1
+ {"file":"qds-inline-link.js","mappings":";;;;;;;;;AAAA,MAAM,aAAa,GAAG,ysEAAysE;;MCiCltE,UAAU;;;;;;;QA0Mb,wBAAmB,GAAe,EAAE,CAAA;QA6D3B,WAAM,GAAG,CAAC,KAAiB;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,CAAA;QAEgB,YAAO,GAAG,CAAC,KAAiB;YAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,CAAA;wBAxQ2C,KAAK;0BAKC,UAAU;;;;;;sBAgLG,OAAO;;IAkBtE,IAAY,kBAAkB;QAC5B,QAAQ,IAAI,CAAC,UAAU;YACrB,KAAK,SAAS,CAAC;YACf,KAAK,YAAY,EAAE;gBACjB,OAAO,IAAI,CAAC,UAAU,CAAA;aACvB;YACD,SAAS;gBACP,OAAO,UAAU,CAAA;aAClB;SACF;KACF;IAED,IAAY,gBAAgB;QAC1B,MAAM,WAAW,GAAG,MAAM,CAAC,QAAQ,CACjC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,IAAI,GAAG,EACxC,EAAE,CACH,CAAA;QACD,OAAO,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAA;KACnD;IAGS,OAAO,CAAC,KAAiB;QACjC,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,KAAK,CAAC,cAAc,EAAE,CAAA;YACtB,KAAK,CAAC,eAAe,EAAE,CAAA;SACxB;KACF;IAEM,iBAAiB;QACtB,IAAI,CAAC,mBAAmB,GAAG;YACzB,GAAG,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC;YACtC,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,UAAU,CAAC,CAAC;SACjD,CAAA;KACF;IAEM,MAAM;QACX,QACE,0BACiB,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,EACvC,KAAK,EAAC,iBAAiB,qBACN,IAAI,CAAC,kBAAkB,EACxC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,MAAM,EAAE,IAAI,CAAC,MAAM,KAEf,IAAI,CAAC,mBAAmB,EAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,gBAAgB,IAEpD,eAAQ,EACR,gBAAU,KAAK,EAAC,cAAc,EAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,eAAe,GAAG,CACnE,EACL;KACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/inline-link/inline-link.css?tag=qds-inline-link&encapsulation=shadow","src/components/inline-link/inline-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-external {\n display: none;\n height: 1.25em;\n margin-inline-start: var(--qds-text-icon-gap);\n vertical-align: text-top;\n width: 1.25em;\n}\n\n.qds-inline-link {\n border-radius: var(--qds-focus-border-radius);\n box-sizing: border-box;\n\n &[rel~='external'] > .qds-external {\n display: inline-block;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-importance='subdued'] {\n &.qds-inline-link {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited {\n color: var(--qds-theme-link-subdued-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-subdued-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-subdued-visited-pressed);\n }\n }\n}\n\n[data-importance='standard'] {\n &.qds-inline-link {\n color: var(--qds-theme-link-standard-default);\n\n &:visited {\n color: var(--qds-theme-link-standard-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-standard-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-standard-visited-pressed);\n }\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited {\n color: var(--qds-theme-link-emphasized-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-emphasized-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-emphasized-visited-pressed);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Listen, Prop } from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, Target } from '../shared'\n\n/**\n * `<qds-inline-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-inline-link>` *should* indicate the inline link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-inline-link>` element will activate it.\n *\n * @slot Content to display for the inline link.\n * @see https://quartz.se.com/build/components/inline-link\n */\n@Component({\n tag: 'qds-inline-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'inline-link.css',\n})\nexport class InlineLink implements ComponentInterface {\n /**\n * Prevents the inline link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The inline link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the inline link points to. Inline links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the inline link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target: LiteralUnion<Target, string> = '_self'\n\n /**\n * Emitted when the inline link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the inline link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsInlineLinkElement\n\n private inheritedAttributes: Attributes = {}\n\n private get computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n private get computedTabIndex(): number {\n const parsedValue = Number.parseInt(\n this.inheritedAttributes.tabindex ?? '0',\n 10,\n )\n return Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.element),\n ...inheritAttributes(this.element, ['tabindex']),\n }\n }\n\n public render() {\n return (\n <a\n aria-disabled={this.disabled.toString()}\n class=\"qds-inline-link\"\n data-importance={this.computedImportance}\n download={this.download}\n href={this.href}\n hrefLang={this.hreflang}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n target={this.target}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n tabIndex={this.disabled ? -1 : this.computedTabIndex}\n >\n <slot />\n <qds-icon class=\"qds-external\" library=\"core\" name=\"external-link\" />\n </a>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../dist/types/components";
2
+
3
+ interface QdsStandaloneLink extends Components.QdsStandaloneLink, HTMLElement {}
4
+ export const QdsStandaloneLink: {
5
+ prototype: QdsStandaloneLink;
6
+ new (): QdsStandaloneLink;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,120 @@
1
+ /*!
2
+ * SPDX-FileCopyrightText: © 2024 Schneider Electric
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
7
+ import { p as pickFocusEventAttributes, i as inheritAriaAttributes, a as inheritAttributes } from './helpers.js';
8
+ import { d as defineCustomElement$2 } from './icon.js';
9
+
10
+ const standaloneLinkCss = ":host([hidden]){display:none !important}:host{display:inline-block}.qds-chevron,.qds-icon,.qds-external{vertical-align:text-bottom}.qds-external{display:none}.qds-standalone-link{align-items:center;border-radius:var(--qds-focus-border-radius);box-sizing:border-box;display:inline-flex;justify-content:center;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-text-decoration:none;text-decoration:none;white-space:nowrap;width:100%}.qds-standalone-link[rel~='external']>.qds-external{display:inline-block}.qds-standalone-link:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-standalone-link[data-importance='emphasized'],.qds-standalone-link:hover,.qds-standalone-link:active,.qds-standalone-link:visited{-webkit-text-decoration:underline;text-decoration:underline}.qds-standalone-link[data-importance='subdued']{color:var(--qds-theme-link-subdued-default)}.qds-standalone-link[data-importance='subdued']:hover{color:var(--qds-theme-link-subdued-hover)}.qds-standalone-link[data-importance='subdued']:active{color:var(--qds-theme-link-subdued-pressed)}.qds-standalone-link[data-importance='subdued']:visited{color:var(--qds-theme-link-subdued-visited)}.qds-standalone-link[data-importance='subdued']:visited:hover{color:var(\n --qds-theme-link-subdued-visited-hover,\n var(--qds-theme-link-subdued-visited)\n )}.qds-standalone-link[data-importance='subdued']:visited:active{color:var(\n --qds-theme-link-subdued-visited-pressed,\n var(--qds-theme-link-subdued-visited)\n )}.qds-standalone-link[data-importance='standard']{color:var(--qds-theme-link-standard-default)}.qds-standalone-link[data-importance='standard']:hover{color:var(--qds-theme-link-standard-hover)}.qds-standalone-link[data-importance='standard']:active{color:var(--qds-theme-link-standard-pressed)}.qds-standalone-link[data-importance='standard']:visited{color:var(--qds-theme-link-standard-visited)}.qds-standalone-link[data-importance='standard']:visited:hover{color:var(\n --qds-theme-link-standard-visited-hover,\n var(--qds-theme-link-standard-visited)\n )}.qds-standalone-link[data-importance='standard']:visited:active{color:var(\n --qds-theme-link-standard-visited-pressed,\n var(--qds-theme-link-standard-visited)\n )}.qds-standalone-link[data-importance='emphasized']{color:var(--qds-theme-link-emphasized-default)}.qds-standalone-link[data-importance='emphasized']:hover{color:var(--qds-theme-link-emphasized-hover)}.qds-standalone-link[data-importance='emphasized']:active{color:var(--qds-theme-link-emphasized-pressed)}.qds-standalone-link[data-importance='emphasized']:visited{color:var(--qds-theme-link-emphasized-visited)}.qds-standalone-link[data-importance='emphasized']:visited:hover{color:var(\n --qds-theme-link-emphasized-visited-hover,\n var(--qds-theme-link-emphasized-visited)\n )}.qds-standalone-link[data-importance='emphasized']:visited:active{color:var(\n --qds-theme-link-emphasized-visited-pressed,\n var(--qds-theme-link-emphasized-visited)\n )}[aria-disabled='true']{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-chevron[data-size='small'],.qds-external[data-size='small'],.qds-icon[data-size='small']{height:var(--qds-control-small-icon-size);margin-inline-start:var(--qds-control-small-icon-gap);width:var(--qds-control-small-icon-size)}.qds-standalone-link[data-size='small']{font:var(--qds-control-small-text);gap:var(--qds-control-small-icon-gap);height:var(--qds-control-small-height)}.qds-chevron[data-size='standard'],.qds-external[data-size='standard'],.qds-icon[data-size='standard']{height:var(--qds-control-standard-icon-size);margin-inline-start:var(--qds-control-standard-icon-gap);width:var(--qds-control-standard-icon-size)}.qds-standalone-link[data-size='standard']{font:var(--qds-control-standard-text);gap:var(--qds-control-standard-icon-gap);height:var(--qds-control-standard-height)}.qds-chevron[data-size='large'],.qds-external[data-size='large'],.qds-icon[data-size='large']{height:var(--qds-control-large-icon-size);margin-inline-start:var(--qds-control-large-icon-gap);width:var(--qds-control-large-icon-size)}.qds-standalone-link[data-size='large']{font:var(--qds-control-large-text);gap:var(--qds-control-large-icon-gap);height:var(--qds-control-large-height)}";
11
+
12
+ const StandaloneLink = /*@__PURE__*/ proxyCustomElement(class StandaloneLink extends HTMLElement {
13
+ constructor() {
14
+ super();
15
+ this.__registerHost();
16
+ this.__attachShadow();
17
+ this.blurEmitter = createEvent(this, "qdsBlur", 2);
18
+ this.focusEmitter = createEvent(this, "qdsFocus", 2);
19
+ this.inheritedAttributes = {};
20
+ this.onBlur = (event) => {
21
+ this.blurEmitter.emit(pickFocusEventAttributes(event));
22
+ };
23
+ this.onFocus = (event) => {
24
+ this.focusEmitter.emit(pickFocusEventAttributes(event));
25
+ };
26
+ this.disabled = false;
27
+ this.iconName = undefined;
28
+ this.iconLibrary = 'default';
29
+ this.importance = 'standard';
30
+ this.size = 'standard';
31
+ this.download = undefined;
32
+ this.href = undefined;
33
+ this.hreflang = undefined;
34
+ this.referrerPolicy = undefined;
35
+ this.rel = undefined;
36
+ this.target = '_self';
37
+ }
38
+ get computedImportance() {
39
+ switch (this.importance) {
40
+ case 'subdued':
41
+ case 'emphasized': {
42
+ return this.importance;
43
+ }
44
+ default: {
45
+ return 'standard';
46
+ }
47
+ }
48
+ }
49
+ get computedSize() {
50
+ switch (this.size) {
51
+ case 'standard':
52
+ case 'small':
53
+ case 'large': {
54
+ return this.size;
55
+ }
56
+ default: {
57
+ return 'standard';
58
+ }
59
+ }
60
+ }
61
+ get computedTabIndex() {
62
+ const parsedValue = Number.parseInt(this.inheritedAttributes.tabindex ?? '0', 10);
63
+ return Number.isNaN(parsedValue) ? 0 : parsedValue;
64
+ }
65
+ onClick(event) {
66
+ if (this.disabled) {
67
+ event.preventDefault();
68
+ event.stopPropagation();
69
+ }
70
+ }
71
+ componentWillLoad() {
72
+ this.inheritedAttributes = {
73
+ ...inheritAriaAttributes(this.element),
74
+ ...inheritAttributes(this.element, ['tabindex']),
75
+ };
76
+ }
77
+ render() {
78
+ return (h("a", { "aria-disabled": this.disabled.toString(), class: "qds-standalone-link", "data-importance": this.computedImportance, "data-size": this.computedSize, download: this.download, href: this.href, hrefLang: this.hreflang, onBlur: this.onBlur, onFocus: this.onFocus, referrerPolicy: this.referrerPolicy, rel: this.rel, target: this.target, ...this.inheritedAttributes, tabIndex: this.disabled ? -1 : this.computedTabIndex }, this.iconName !== undefined && this.iconName !== '' && (h("qds-icon", { class: "qds-icon", "data-size": this.computedSize, library: this.iconLibrary, name: this.iconName })), h("slot", null), h("qds-icon", { class: "qds-external", library: "core", name: "external-link" }), h("qds-icon", { class: "qds-chevron", library: "core", name: "next" })));
79
+ }
80
+ static get delegatesFocus() { return true; }
81
+ get element() { return this; }
82
+ static get style() { return standaloneLinkCss; }
83
+ }, [17, "qds-standalone-link", {
84
+ "disabled": [4],
85
+ "iconName": [1, "icon-name"],
86
+ "iconLibrary": [1, "icon-library"],
87
+ "importance": [1],
88
+ "size": [1],
89
+ "download": [8],
90
+ "href": [1],
91
+ "hreflang": [1],
92
+ "referrerPolicy": [1, "referrerpolicy"],
93
+ "rel": [1],
94
+ "target": [1]
95
+ }, [[0, "click", "onClick"]]]);
96
+ function defineCustomElement$1() {
97
+ if (typeof customElements === "undefined") {
98
+ return;
99
+ }
100
+ const components = ["qds-standalone-link", "qds-icon"];
101
+ components.forEach(tagName => { switch (tagName) {
102
+ case "qds-standalone-link":
103
+ if (!customElements.get(tagName)) {
104
+ customElements.define(tagName, StandaloneLink);
105
+ }
106
+ break;
107
+ case "qds-icon":
108
+ if (!customElements.get(tagName)) {
109
+ defineCustomElement$2();
110
+ }
111
+ break;
112
+ } });
113
+ }
114
+
115
+ const QdsStandaloneLink = StandaloneLink;
116
+ const defineCustomElement = defineCustomElement$1;
117
+
118
+ export { QdsStandaloneLink, defineCustomElement };
119
+
120
+ //# sourceMapp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;;;;;;;;;;;;","names":[],"sources":["src/components/standalone-link/standalone-link.css?tag=qds-standalone-link&encapsulation=shadow","src/components/standalone-link/standalone-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-chevron,\n.qds-icon,\n.qds-external {\n vertical-align: text-bottom;\n}\n\n.qds-external {\n display: none;\n}\n\n.qds-standalone-link {\n align-items: center;\n border-radius: var(--qds-focus-border-radius);\n box-sizing: border-box;\n display: inline-flex;\n justify-content: center;\n print-color-adjust: exact;\n text-decoration: none;\n white-space: nowrap;\n width: 100%;\n\n &[rel~='external'] > .qds-external {\n display: inline-block;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n }\n\n &[data-importance='emphasized'],\n &:hover,\n &:active,\n &:visited {\n text-decoration: underline;\n }\n\n &[data-importance='subdued'] {\n color: var(--qds-theme-link-subdued-default);\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited {\n color: var(--qds-theme-link-subdued-visited);\n }\n\n &:visited:hover {\n color: var(\n --qds-theme-link-subdued-visited-hover,\n var(--qds-theme-link-subdued-visited)\n );\n }\n\n &:visited:active {\n color: var(\n --qds-theme-link-subdued-visited-pressed,\n var(--qds-theme-link-subdued-visited)\n );\n }\n }\n\n &[data-importance='standard'] {\n color: var(--qds-theme-link-standard-default);\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited {\n color: var(--qds-theme-link-standard-visited);\n }\n\n &:visited:hover {\n color: var(\n --qds-theme-link-standard-visited-hover,\n var(--qds-theme-link-standard-visited)\n );\n }\n\n &:visited:active {\n color: var(\n --qds-theme-link-standard-visited-pressed,\n var(--qds-theme-link-standard-visited)\n );\n }\n }\n\n &[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited {\n color: var(--qds-theme-link-emphasized-visited);\n }\n\n &:visited:hover {\n color: var(\n --qds-theme-link-emphasized-visited-hover,\n var(--qds-theme-link-emphasized-visited)\n );\n }\n\n &:visited:active {\n color: var(\n --qds-theme-link-emphasized-visited-pressed,\n var(--qds-theme-link-emphasized-visited)\n );\n }\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-size='small'] {\n &.qds-chevron,\n &.qds-external,\n &.qds-icon {\n height: var(--qds-control-small-icon-size);\n margin-inline-start: var(--qds-control-small-icon-gap);\n width: var(--qds-control-small-icon-size);\n }\n\n &.qds-standalone-link {\n font: var(--qds-control-small-text);\n gap: var(--qds-control-small-icon-gap);\n height: var(--qds-control-small-height);\n }\n}\n\n[data-size='standard'] {\n &.qds-chevron,\n &.qds-external,\n &.qds-icon {\n height: var(--qds-control-standard-icon-size);\n margin-inline-start: var(--qds-control-standard-icon-gap);\n width: var(--qds-control-standard-icon-size);\n }\n\n &.qds-standalone-link {\n font: var(--qds-control-standard-text);\n gap: var(--qds-control-standard-icon-gap);\n height: var(--qds-control-standard-height);\n }\n}\n\n[data-size='large'] {\n &.qds-chevron,\n &.qds-external,\n &.qds-icon {\n height: var(--qds-control-large-icon-size);\n margin-inline-start: var(--qds-control-large-icon-gap);\n width: var(--qds-control-large-icon-size);\n }\n\n &.qds-standalone-link {\n font: var(--qds-control-large-text);\n gap: var(--qds-control-large-icon-gap);\n height: var(--qds-control-large-height);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Listen, Prop } from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, Size, Target } from '../shared'\n\n/**\n * `<qds-standalone-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-standalone-link>` *should* indicate the standalone link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-standalone-link>` element will activate it.\n *\n * @slot Content to display for the standalone link.\n * @see https://quartz.se.com/build/components/standalone-link\n */\n@Component({\n tag: 'qds-standalone-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'standalone-link.css',\n})\nexport class StandaloneLink implements ComponentInterface {\n /**\n * Prevents the standalone link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The name of the icon to render.\n *\n * Available names depend on the icon library being used.\n */\n @Prop() public readonly iconName?: string\n\n /**\n * The name of a registered icon library.\n */\n @Prop() public readonly iconLibrary: string = 'default'\n\n /**\n * The standalone link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * The standalone link's size.\n */\n @Prop() public readonly size?: Size = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the standalone link points to. Standalone links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the standalone link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target: LiteralUnion<Target, string> = '_self'\n\n /**\n * Emitted when the standalone link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the standalone link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsStandaloneLinkElement\n\n private inheritedAttributes: Attributes = {}\n\n private get computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n private get computedSize(): Size | undefined {\n switch (this.size) {\n case 'standard':\n case 'small':\n case 'large': {\n return this.size\n }\n default: {\n return 'standard'\n }\n }\n }\n\n private get computedTabIndex(): number {\n const parsedValue = Number.parseInt(\n this.inheritedAttributes.tabindex ?? '0',\n 10,\n )\n return Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.element),\n ...inheritAttributes(this.element, ['tabindex']),\n }\n }\n\n public render() {\n return (\n <a\n aria-disabled={this.disabled.toString()}\n class=\"qds-standalone-link\"\n data-importance={this.computedImportance}\n data-size={this.computedSize}\n download={this.download}\n href={this.href}\n hrefLang={this.hreflang}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n target={this.target}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n tabIndex={this.disabled ? -1 : this.computedTabIndex}\n >\n {this.iconName !== undefined && this.iconName !== '' && (\n <qds-icon\n class=\"qds-icon\"\n data-size={this.computedSize}\n library={this.iconLibrary}\n name={this.iconName}\n />\n )}\n <slot />\n <qds-icon class=\"qds-external\" library=\"core\" name=\"external-link\" />\n <qds-icon class=\"qds-chevron\" library=\"core\" name=\"next\" />\n </a>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
@@ -11,7 +11,7 @@ const index = require('./index-b70242ec.js');
11
11
 
12
12
  const defineCustomElements = (win, options) => {
13
13
  if (typeof window === 'undefined') return undefined;
14
- return index.bootstrapLazy([["qds-checkbox.cjs",[[81,"qds-checkbox",{"inline":[4],"size":[1],"text":[1],"autoFocus":[4,"autofocus"],"checked":[1028],"disabled":[4],"form":[1],"indeterminate":[1028],"name":[1],"required":[4],"validationMessage":[1,"validation-message"],"validity":[16],"value":[8],"willValidate":[4,"will-validate"],"inheritedAttributes":[32]},[[0,"click","onClick"]],{"checked":["checkedChanged"],"disabled":["disabledChanged"],"tabindex":["tabindexChanged"],"value":["valueChanged"]}]]],["qds-radio.cjs",[[2,"qds-radio",{"inline":[4],"size":[1],"text":[1],"checked":[1028],"disabled":[4],"form":[1],"name":[1],"required":[4],"value":[1032]},[[0,"click","onClick"]]]]],["qds-switch.cjs",[[2,"qds-switch",{"inline":[4],"iconCheckedName":[1,"icon-checked-name"],"iconCheckedLibrary":[1,"icon-checked-library"],"iconUncheckedName":[1,"icon-unchecked-name"],"iconUncheckedLibrary":[1,"icon-unchecked-library"],"size":[1],"textChecked":[1,"text-checked"],"textUnchecked":[1,"text-unchecked"],"autoFocus":[4,"autofocus"],"checked":[1028],"disabled":[4],"form":[1],"name":[1],"value":[8]},[[0,"click","onClick"]]]]],["qds-button.cjs",[[17,"qds-button",{"action":[1],"iconName":[1,"icon-name"],"iconLibrary":[1,"icon-library"],"importance":[1],"size":[1],"text":[1],"variant":[1],"disabled":[4],"download":[1],"form":[1],"formAction":[1,"formaction"],"formMethod":[1,"formmethod"],"formNoValidate":[4,"formnovalidate"],"formTarget":[1,"formtarget"],"href":[1],"name":[1],"target":[1],"type":[1],"value":[1]},[[0,"click","onClick"]]]]],["qds-form-message.cjs",[[1,"qds-form-message",{"inline":[4],"size":[1],"status":[1],"text":[1]}]]],["qds-inline-link.cjs",[[17,"qds-inline-link",{"disabled":[4],"importance":[1],"download":[8],"href":[1],"hreflang":[1],"referrerPolicy":[1,"referrerpolicy"],"rel":[1],"target":[1]},[[0,"click","onClick"]]]]],["qds-select.cjs",[[70,"qds-select",{"size":[1],"autoComplete":[1,"autocomplete"],"autoFocus":[4,"autofocus"],"disabled":[4],"form":[1],"length":[2],"multiple":[4],"name":[1],"options":[16],"required":[4],"selectedIndex":[1026,"selected-index"],"selectedOptions":[16],"type":[1],"validationMessage":[1,"validation-message"],"validity":[16],"value":[1025],"willValidate":[4,"will-validate"],"inheritedAttributes":[32]},null,{"disabled":["disabledChanged"],"selectedIndex":["selectedIndexChanged"],"tabindex":["tabindexChanged"],"required":["validationChanged"],"value":["validationChanged","valueChanged"]}]]],["qds-title.cjs",[[1,"qds-title",{"iconName":[1,"icon-name"],"iconLibrary":[1,"icon-library"],"kicker":[1],"layer":[1],"level":[1],"subtitle":[1],"tag":[1]}]]],["qds-dialog.cjs",[[1,"qds-dialog",{"open":[1540],"show":[64],"close":[64]},null,{"open":["openChanged"]}]]],["qds-divider.cjs",[[1,"qds-divider",{"importance":[1]}]]],["qds-dropdown.cjs",[[1,"qds-dropdown",{"autoUpdateOptions":[16],"disabled":[4],"flipOptions":[16],"noFlip":[4,"no-flip"],"noShift":[4,"no-shift"],"offsetOptions":[16],"placement":[1],"shiftOptions":[16],"strategy":[1],"target":[1],"hostAriaLabelledBy":[32],"hostDisplay":[32],"hostPosition":[32],"hostTransform":[32],"show":[64],"close":[64],"update":[64]},[[4,"click","handleMouseDown"]],{"target":["updateReferenceElement"],"flipOptions":["updateMiddleware"],"noFlip":["updateMiddleware"],"noShift":["updateMiddleware"],"offsetOptions":["updateMiddleware"],"shiftOptions":["updateMiddleware"],"placement":["updatePosition"],"strategy":["updatePosition"],"autoUpdateOptions":["startAutoUpdate"]}]]],["qds-input.cjs",[[81,"qds-input",{"size":[1],"autoCapitalize":[1,"autocapitalize"],"autoComplete":[1,"autocomplete"],"autoFocus":[4,"autofocus"],"disabled":[4],"enterkeyhint":[1],"form":[1],"inputmode":[1],"labels":[16],"max":[8],"maxLength":[2,"maxlength"],"min":[8],"minLength":[2,"minlength"],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"required":[4],"selectionDirection":[1025,"selection-direction"],"selectionEnd":[1026,"selection-end"],"selectionStart":[1026,"selection-start"],"spellCheck":[4,"spellcheck"],"step":[8],"type":[1],"validationMessage":[1,"validation-message"],"validity":[16],"value":[1032],"willValidate":[4,"will-validate"],"inheritedAttributes":[32]},null,{"disabled":["disabledChanged"],"selectionDirection":["selectionDirectionChanged"],"selectionEnd":["selectionEndChanged"],"selectionStart":["selectionStartChanged"],"tabindex":["tabindexChanged"],"max":["validationChanged"],"maxLength":["validationChanged"],"min":["validationChanged"],"minLength":["validationChanged"],"pattern":["validationChanged"],"required":["validationChanged"],"step":["validationChanged"],"type":["validationChanged"],"value":["validationChanged","valueChanged"]}]]],["qds-table.cjs",[[1,"qds-table"]]],["qds-table-body.cjs",[[1,"qds-table-body"]]],["qds-table-cell.cjs",[[1,"qds-table-cell",{"colSpan":[2,"colspan"],"rowSpan":[2,"rowspan"]}]]],["qds-table-head.cjs",[[1,"qds-table-head"]]],["qds-table-head-cell.cjs",[[1,"qds-table-head-cell",{"abbr":[1],"colSpan":[2,"colspan"],"rowSpan":[2,"rowspan"],"scope":[1]}]]],["qds-table-row.cjs",[[1,"qds-table-row"]]],["qds-textarea.cjs",[[70,"qds-textarea",{"size":[1],"autoCapitalize":[1,"autocapitalize"],"autoComplete":[1,"autocomplete"],"autoFocus":[4,"autofocus"],"cols":[2],"disabled":[4],"enterkeyhint":[1],"form":[1],"inputmode":[1],"labels":[16],"maxLength":[2,"maxlength"],"minLength":[2,"minlength"],"name":[1],"placeholder":[1],"required":[4],"rows":[2],"selectionDirection":[1025,"selection-direction"],"selectionEnd":[1026,"selection-end"],"selectionStart":[1026,"selection-start"],"spellCheck":[4,"spellcheck"],"validationMessage":[1,"validation-message"],"validity":[16],"value":[1032],"willValidate":[4,"will-validate"],"wrap":[1],"inheritedAttributes":[32]},null,{"disabled":["disabledChanged"],"selectionDirection":["selectionDirectionChanged"],"selectionEnd":["selectionEndChanged"],"selectionStart":["selectionStartChanged"],"tabindex":["tabindexChanged"],"maxLength":["validationChanged"],"minLength":["validationChanged"],"required":["validationChanged"],"value":["validationChanged","valueChanged"]}]]],["qds-tooltip.cjs",[[1,"qds-tooltip",{"autoUpdateOptions":[16],"disabled":[4],"flipOptions":[16],"noFlip":[4,"no-flip"],"noShift":[4,"no-shift"],"offsetOptions":[16],"placement":[1],"shiftOptions":[16],"strategy":[1],"target":[1],"hostPosition":[32],"hostTransform":[32],"open":[32],"middleware":[32],"aDisplay":[32],"side":[32],"aShape":[32],"aViewbox":[32],"aHeight":[32],"aWidth":[32],"aGap":[32],"aX":[32],"aY":[32],"show":[64],"close":[64],"updateArrow":[64]},[[5,"mousedown","handleMouseDown"]],{"aGap":["updateMiddleware"],"aHeight":["updateMiddleware"],"flipOptions":["updateMiddleware"],"noFlip":["updateMiddleware"],"noShift":["updateMiddleware"],"offsetOptions":["updateMiddleware"],"shiftOptions":["updateMiddleware"],"target":["updateReferenceElement"],"middleware":["updatePosition"],"placement":["updatePosition"],"strategy":["updatePosition"],"autoUpdateOptions":["startAutoUpdate"]}]]],["qds-label.cjs",[[1,"qds-label",{"inline":[4],"required":[4],"size":[1],"text":[1]}]]],["qds-icon.cjs",[[1,"qds-icon",{"name":[1],"library":[1],"svg":[32]},null,{"name":["setIcon"],"library":["setIcon"]}]]]], options);
14
+ return index.bootstrapLazy([["qds-checkbox.cjs",[[81,"qds-checkbox",{"inline":[4],"size":[1],"text":[1],"autoFocus":[4,"autofocus"],"checked":[1028],"disabled":[4],"form":[1],"indeterminate":[1028],"name":[1],"required":[4],"validationMessage":[1,"validation-message"],"validity":[16],"value":[8],"willValidate":[4,"will-validate"],"inheritedAttributes":[32]},[[0,"click","onClick"]],{"checked":["checkedChanged"],"disabled":["disabledChanged"],"tabindex":["tabindexChanged"],"value":["valueChanged"]}]]],["qds-radio.cjs",[[2,"qds-radio",{"inline":[4],"size":[1],"text":[1],"checked":[1028],"disabled":[4],"form":[1],"name":[1],"required":[4],"value":[1032]},[[0,"click","onClick"]]]]],["qds-switch.cjs",[[2,"qds-switch",{"inline":[4],"iconCheckedName":[1,"icon-checked-name"],"iconCheckedLibrary":[1,"icon-checked-library"],"iconUncheckedName":[1,"icon-unchecked-name"],"iconUncheckedLibrary":[1,"icon-unchecked-library"],"size":[1],"textChecked":[1,"text-checked"],"textUnchecked":[1,"text-unchecked"],"autoFocus":[4,"autofocus"],"checked":[1028],"disabled":[4],"form":[1],"name":[1],"value":[8]},[[0,"click","onClick"]]]]],["qds-button.cjs",[[17,"qds-button",{"action":[1],"iconName":[1,"icon-name"],"iconLibrary":[1,"icon-library"],"importance":[1],"size":[1],"text":[1],"variant":[1],"disabled":[4],"download":[1],"form":[1],"formAction":[1,"formaction"],"formMethod":[1,"formmethod"],"formNoValidate":[4,"formnovalidate"],"formTarget":[1,"formtarget"],"href":[1],"name":[1],"target":[1],"type":[1],"value":[1]},[[0,"click","onClick"]]]]],["qds-form-message.cjs",[[1,"qds-form-message",{"inline":[4],"size":[1],"status":[1],"text":[1]}]]],["qds-inline-link.cjs",[[17,"qds-inline-link",{"disabled":[4],"importance":[1],"download":[8],"href":[1],"hreflang":[1],"referrerPolicy":[1,"referrerpolicy"],"rel":[1],"target":[1]},[[0,"click","onClick"]]]]],["qds-select.cjs",[[70,"qds-select",{"size":[1],"autoComplete":[1,"autocomplete"],"autoFocus":[4,"autofocus"],"disabled":[4],"form":[1],"length":[2],"multiple":[4],"name":[1],"options":[16],"required":[4],"selectedIndex":[1026,"selected-index"],"selectedOptions":[16],"type":[1],"validationMessage":[1,"validation-message"],"validity":[16],"value":[1025],"willValidate":[4,"will-validate"],"inheritedAttributes":[32]},null,{"disabled":["disabledChanged"],"selectedIndex":["selectedIndexChanged"],"tabindex":["tabindexChanged"],"required":["validationChanged"],"value":["validationChanged","valueChanged"]}]]],["qds-standalone-link.cjs",[[17,"qds-standalone-link",{"disabled":[4],"iconName":[1,"icon-name"],"iconLibrary":[1,"icon-library"],"importance":[1],"size":[1],"download":[8],"href":[1],"hreflang":[1],"referrerPolicy":[1,"referrerpolicy"],"rel":[1],"target":[1]},[[0,"click","onClick"]]]]],["qds-title.cjs",[[1,"qds-title",{"iconName":[1,"icon-name"],"iconLibrary":[1,"icon-library"],"kicker":[1],"layer":[1],"level":[1],"subtitle":[1],"tag":[1]}]]],["qds-dialog.cjs",[[1,"qds-dialog",{"open":[1540],"show":[64],"close":[64]},null,{"open":["openChanged"]}]]],["qds-divider.cjs",[[1,"qds-divider",{"importance":[1]}]]],["qds-dropdown.cjs",[[1,"qds-dropdown",{"autoUpdateOptions":[16],"disabled":[4],"flipOptions":[16],"noFlip":[4,"no-flip"],"noShift":[4,"no-shift"],"offsetOptions":[16],"placement":[1],"shiftOptions":[16],"strategy":[1],"target":[1],"hostAriaLabelledBy":[32],"hostDisplay":[32],"hostPosition":[32],"hostTransform":[32],"show":[64],"close":[64],"update":[64]},[[4,"click","handleMouseDown"]],{"target":["updateReferenceElement"],"flipOptions":["updateMiddleware"],"noFlip":["updateMiddleware"],"noShift":["updateMiddleware"],"offsetOptions":["updateMiddleware"],"shiftOptions":["updateMiddleware"],"placement":["updatePosition"],"strategy":["updatePosition"],"autoUpdateOptions":["startAutoUpdate"]}]]],["qds-input.cjs",[[81,"qds-input",{"size":[1],"autoCapitalize":[1,"autocapitalize"],"autoComplete":[1,"autocomplete"],"autoFocus":[4,"autofocus"],"disabled":[4],"enterkeyhint":[1],"form":[1],"inputmode":[1],"labels":[16],"max":[8],"maxLength":[2,"maxlength"],"min":[8],"minLength":[2,"minlength"],"multiple":[4],"name":[1],"pattern":[1],"placeholder":[1],"required":[4],"selectionDirection":[1025,"selection-direction"],"selectionEnd":[1026,"selection-end"],"selectionStart":[1026,"selection-start"],"spellCheck":[4,"spellcheck"],"step":[8],"type":[1],"validationMessage":[1,"validation-message"],"validity":[16],"value":[1032],"willValidate":[4,"will-validate"],"inheritedAttributes":[32]},null,{"disabled":["disabledChanged"],"selectionDirection":["selectionDirectionChanged"],"selectionEnd":["selectionEndChanged"],"selectionStart":["selectionStartChanged"],"tabindex":["tabindexChanged"],"max":["validationChanged"],"maxLength":["validationChanged"],"min":["validationChanged"],"minLength":["validationChanged"],"pattern":["validationChanged"],"required":["validationChanged"],"step":["validationChanged"],"type":["validationChanged"],"value":["validationChanged","valueChanged"]}]]],["qds-table.cjs",[[1,"qds-table"]]],["qds-table-body.cjs",[[1,"qds-table-body"]]],["qds-table-cell.cjs",[[1,"qds-table-cell",{"colSpan":[2,"colspan"],"rowSpan":[2,"rowspan"]}]]],["qds-table-head.cjs",[[1,"qds-table-head"]]],["qds-table-head-cell.cjs",[[1,"qds-table-head-cell",{"abbr":[1],"colSpan":[2,"colspan"],"rowSpan":[2,"rowspan"],"scope":[1]}]]],["qds-table-row.cjs",[[1,"qds-table-row"]]],["qds-textarea.cjs",[[70,"qds-textarea",{"size":[1],"autoCapitalize":[1,"autocapitalize"],"autoComplete":[1,"autocomplete"],"autoFocus":[4,"autofocus"],"cols":[2],"disabled":[4],"enterkeyhint":[1],"form":[1],"inputmode":[1],"labels":[16],"maxLength":[2,"maxlength"],"minLength":[2,"minlength"],"name":[1],"placeholder":[1],"required":[4],"rows":[2],"selectionDirection":[1025,"selection-direction"],"selectionEnd":[1026,"selection-end"],"selectionStart":[1026,"selection-start"],"spellCheck":[4,"spellcheck"],"validationMessage":[1,"validation-message"],"validity":[16],"value":[1032],"willValidate":[4,"will-validate"],"wrap":[1],"inheritedAttributes":[32]},null,{"disabled":["disabledChanged"],"selectionDirection":["selectionDirectionChanged"],"selectionEnd":["selectionEndChanged"],"selectionStart":["selectionStartChanged"],"tabindex":["tabindexChanged"],"maxLength":["validationChanged"],"minLength":["validationChanged"],"required":["validationChanged"],"value":["validationChanged","valueChanged"]}]]],["qds-tooltip.cjs",[[1,"qds-tooltip",{"autoUpdateOptions":[16],"disabled":[4],"flipOptions":[16],"noFlip":[4,"no-flip"],"noShift":[4,"no-shift"],"offsetOptions":[16],"placement":[1],"shiftOptions":[16],"strategy":[1],"target":[1],"hostPosition":[32],"hostTransform":[32],"open":[32],"middleware":[32],"aDisplay":[32],"side":[32],"aShape":[32],"aViewbox":[32],"aHeight":[32],"aWidth":[32],"aGap":[32],"aX":[32],"aY":[32],"show":[64],"close":[64],"updateArrow":[64]},[[5,"mousedown","handleMouseDown"]],{"aGap":["updateMiddleware"],"aHeight":["updateMiddleware"],"flipOptions":["updateMiddleware"],"noFlip":["updateMiddleware"],"noShift":["updateMiddleware"],"offsetOptions":["updateMiddleware"],"shiftOptions":["updateMiddleware"],"target":["updateReferenceElement"],"middleware":["updatePosition"],"placement":["updatePosition"],"strategy":["updatePosition"],"autoUpdateOptions":["startAutoUpdate"]}]]],["qds-label.cjs",[[1,"qds-label",{"inline":[4],"required":[4],"size":[1],"text":[1]}]]],["qds-icon.cjs",[[1,"qds-icon",{"name":[1],"library":[1],"svg":[32]},null,{"name":["setIcon"],"library":["setIcon"]}]]]], options);
15
15
  };
16
16
 
17
17
  exports.setNonce = index.setNonce;
@@ -1 +1 @@
1
- {"file":"qds-inline-link.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,aAAa,GAAG,ysEAAysE;;MCmCltE,UAAU;;;;;QA0Mb,wBAAmB,GAAe,EA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vB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,cAAc,EAAE,IAAI,CAAC,cAAc,EACnC,GAAG,EAAE,IAAI,CAAC,GAAG,EACb,MAAM,EAAE,IAAI,CAAC,MAAM,KAEf,IAAI,CAAC,mBAAmB,EAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,gBAAgB,IAEpDA,qBAAQ,EACRA,sBAAU,KAAK,EAAC,cAAc,EAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,eAAe,GAAG,CACnE,EACL;KACF;;;;;;;;","names":["pickFocusEventAttributes","inheritAriaAttributes","inheritAttributes","h"],"sources":["src/components/inline-link/inline-link.css?tag=qds-inline-link&encapsulation=shadow","src/components/inline-link/inline-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-external {\n display: none;\n height: 1.25em;\n margin-inline-start: var(--qds-text-icon-gap);\n vertical-align: text-top;\n width: 1.25em;\n}\n\n.qds-inline-link {\n border-radius: var(--qds-focus-border-radius);\n box-sizing: border-box;\n\n &[rel~='external'] > .qds-external {\n display: inline-block;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-importance='subdued'] {\n &.qds-inline-link {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited {\n color: var(--qds-theme-link-subdued-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-subdued-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-subdued-visited-pressed);\n }\n }\n}\n\n[data-importance='standard'] {\n &.qds-inline-link {\n color: var(--qds-theme-link-standard-default);\n\n &:visited {\n color: var(--qds-theme-link-standard-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-standard-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-standard-visited-pressed);\n }\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited {\n color: var(--qds-theme-link-emphasized-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-emphasized-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-emphasized-visited-pressed);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Listen, Prop } from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance } from '../shared'\n\nexport type Target = '_blank' | '_parent' | '_self' | '_top'\n\n/**\n * `<qds-inline-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-inline-link>` *should* indicate the inline link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-inline-link>` element will activate it.\n *\n * @slot Content to display for the inline link.\n * @see https://quartz.se.com/build/components/inline-link\n */\n@Component({\n tag: 'qds-inline-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'inline-link.css',\n})\nexport class InlineLink implements ComponentInterface {\n /**\n * Prevents the inline link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The inline link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the inline link points to. Inline links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the inline link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target: LiteralUnion<Target, string> = '_self'\n\n /**\n * Emitted when the inline link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the inline link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsInlineLinkElement\n\n private inheritedAttributes: Attributes = {}\n\n private get computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n private get computedTabIndex(): number {\n const parsedValue = Number.parseInt(\n this.inheritedAttributes.tabindex ?? '0',\n 10,\n )\n return Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.element),\n ...inheritAttributes(this.element, ['tabindex']),\n }\n }\n\n public render() {\n return (\n <a\n aria-disabled={this.disabled.toString()}\n class=\"qds-inline-link\"\n data-importance={this.computedImportance}\n download={this.download}\n href={this.href}\n hrefLang={this.hreflang}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n target={this.target}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n tabIndex={this.disabled ? -1 : this.computedTabIndex}\n >\n <slot />\n <qds-icon class=\"qds-external\" library=\"core\" name=\"external-link\" />\n </a>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
1
+ {"file":"qds-inline-link.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,aAAa,GAAG,ysEAAysE;;MCiCltE,UAAU;;;;;QA0Mb,wBAAmB,GAAe,EAAE,CAAA;QA6D3B,WAAM,GAAG,CAAC,KAAiB;YAC1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAACA,gCAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACvD,CAAA;QAEgB,YAAO,GAAG,CAAC,KAAiB;YAC3C,IAAI,CAAC,YAAY,CAAC,IAAI,CAACA,gCAAwB,CAAC,KAAK,CAAC,CAAC,CAAA;SACxD,CAAA;wBAxQ2C,KAAK;0BAKC,UAAU;;;;;;sBAgLG,OAAO;;IAkBtE,IAAY,kBAAkB;QA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IAAI,CAAC,gBAAgB,IAEpDA,qBAAQ,EACRA,sBAAU,KAAK,EAAC,cAAc,EAAC,OAAO,EAAC,MAAM,EAAC,IAAI,EAAC,eAAe,GAAG,CACnE,EACL;KACF;;;;;;;;","names":["pickFocusEventAttributes","inheritAriaAttributes","inheritAttributes","h"],"sources":["src/components/inline-link/inline-link.css?tag=qds-inline-link&encapsulation=shadow","src/components/inline-link/inline-link.tsx"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: © 2024 Schneider Electric\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n@import url('../shared.css');\n\n:host {\n display: inline-block;\n}\n\n.qds-external {\n display: none;\n height: 1.25em;\n margin-inline-start: var(--qds-text-icon-gap);\n vertical-align: text-top;\n width: 1.25em;\n}\n\n.qds-inline-link {\n border-radius: var(--qds-focus-border-radius);\n box-sizing: border-box;\n\n &[rel~='external'] > .qds-external {\n display: inline-block;\n }\n\n &:focus-visible {\n outline: var(--qds-theme-focus-border) solid var(--qds-focus-border-width);\n }\n}\n\n[aria-disabled='true'] {\n opacity: var(--qds-theme-disabled);\n pointer-events: none;\n}\n\n[data-importance='subdued'] {\n &.qds-inline-link {\n color: var(--qds-theme-link-subdued-default);\n\n &:visited {\n color: var(--qds-theme-link-subdued-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-subdued-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-subdued-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-subdued-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-subdued-visited-pressed);\n }\n }\n}\n\n[data-importance='standard'] {\n &.qds-inline-link {\n color: var(--qds-theme-link-standard-default);\n\n &:visited {\n color: var(--qds-theme-link-standard-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-standard-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-standard-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-standard-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-standard-visited-pressed);\n }\n }\n}\n\n[data-importance='emphasized'] {\n color: var(--qds-theme-link-emphasized-default);\n\n &:visited {\n color: var(--qds-theme-link-emphasized-visited);\n }\n\n &:hover {\n color: var(--qds-theme-link-emphasized-hover);\n }\n\n &:active {\n color: var(--qds-theme-link-emphasized-pressed);\n }\n\n &:visited:hover {\n color: var(--qds-theme-link-emphasized-visited-hover);\n }\n\n &:visited:active {\n color: var(--qds-theme-link-emphasized-visited-pressed);\n }\n}\n","// SPDX-FileCopyrightText: © 2024 Schneider Electric\n//\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ComponentInterface, EventEmitter } from '@stencil/core'\nimport { Component, Element, Event, h, Listen, Prop } from '@stencil/core'\nimport type { LiteralUnion } from 'type-fest'\n\nimport type { Attributes, QdsFocusEventDetail } from '../../helpers'\nimport {\n inheritAriaAttributes,\n inheritAttributes,\n pickFocusEventAttributes,\n} from '../../helpers'\nimport type { Importance, Target } from '../shared'\n\n/**\n * `<qds-inline-link>` elements, with their `href` property, create a hyperlink\n * to web pages, files, email addresses, locations in the same page, or\n * anything else a URL can address.\n *\n * Content within each `<qds-inline-link>` *should* indicate the inline link's\n * destination. If the `href` property is present, pressing the enter key while\n * focused on the `<qds-inline-link>` element will activate it.\n *\n * @slot Content to display for the inline link.\n * @see https://quartz.se.com/build/components/inline-link\n */\n@Component({\n tag: 'qds-inline-link',\n shadow: { delegatesFocus: true },\n styleUrl: 'inline-link.css',\n})\nexport class InlineLink implements ComponentInterface {\n /**\n * Prevents the inline link from being interacted with: it cannot be pressed\n * or focused.\n */\n @Prop() public readonly disabled: boolean = false\n\n /**\n * The inline link's importance.\n */\n @Prop() public readonly importance?: Importance = 'standard'\n\n /**\n * Causes the browser to treat the linked URL as a download. Can be used with\n * or without a `filename` value:\n *\n * - Without a value, the browser will suggest a filename/extension,\n * generated from various sources:\n *\n * - The\n * [`Content-Disposition`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Disposition)\n * HTTP header\n * - The final segment in the URL\n * [path](https://developer.mozilla.org/docs/Web/API/URL/pathname)\n * - The\n * [media type](https://developer.mozilla.org/docs/Glossary/MIME_type)\n * (from the\n * [`Content-Type`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Type)\n * header, the start of a\n * [`data:` URL](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URLs),\n * or\n * [`Blob.type`](https://developer.mozilla.org/docs/Web/API/Blob/type)\n * for a\n * [`blob:` URL](https://developer.mozilla.org/docs/Web/API/URL/createObjectURL))\n * - `filename`: defining a value suggests it as the filename. `/` and `\\`\n * characters are converted to underscores (`_`). Filesystems may forbid\n * other characters in filenames, so browsers will adjust the suggested name\n * if necessary.\n *\n * @webnative\n */\n @Prop() public readonly download?: boolean | string\n\n /**\n * The URL that the inline link points to. Inline links are not restricted to\n * HTTP-based URLs — they can use any URL scheme supported by browsers:\n *\n * - Sections of a page with document fragments\n * - Specific text portions with\n * [text fragments](https://developer.mozilla.org/docs/Web/Text_fragments)\n * - Pieces of media files with media fragments\n * - Telephone numbers with `tel:` URLs\n * - Email addresses with `mailto:` URLs\n * - While web browsers may not support other URL schemes, websites can with\n * [`registerProtocolHandler()`](https://developer.mozilla.org/docs/Web/API/Navigator/registerProtocolHandler)\n *\n * @webnative\n */\n @Prop() public readonly href?: string\n\n /**\n * Hints at the human language of the linked URL. No built-in functionality.\n * Allowed values are the same as\n * [the global `lang` attribute](https://developer.mozilla.org/docs/Web/HTML/Global_attributes/lang).\n *\n * @webnative\n */\n @Prop() public readonly hreflang?: string\n\n /**\n * How much of the\n * [referrer](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * to send when following the inline link.\n *\n * - `no-referrer`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent.\n * - `no-referrer-when-downgrade`: The\n * [`Referer`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referer)\n * header will not be sent to\n * [origin](https://developer.mozilla.org/docs/Glossary/Origin)s\n * without [TLS](https://developer.mozilla.org/docs/Glossary/TLS)\n * ([HTTPS](https://developer.mozilla.org/docs/Glossary/HTTPS)).\n * - `origin`: The sent referrer will be limited to the origin of the\n * referring page: its\n * [scheme](https://developer.mozilla.org/docs/Learn/Common_questions/What_is_a_URL),\n * [host](https://developer.mozilla.org/docs/Glossary/Host), and\n * [port](https://developer.mozilla.org/docs/Glossary/Port).\n * - `origin-when-cross-origin`: The referrer sent to other origins will be\n * limited to the scheme, the host, and the port. Navigations on the same\n * origin will still include the path.\n * - `same-origin`: A referrer will be sent for\n * [same origin](https://developer.mozilla.org/docs/Glossary/Same-origin_policy),\n * but cross-origin requests will contain no referrer information.\n * - `strict-origin`: Only send the origin of the document as the referrer\n * when the protocol security level stays the same (HTTPS→HTTPS), but don't\n * send it to a less secure destination (HTTPS→HTTP).\n * - `strict-origin-when-cross-origin` (default): Send a full URL when\n * performing a same-origin request, only send the origin when the protocol\n * security level stays the same (HTTPS→HTTPS), and send no header to a less\n * secure destination (HTTPS→HTTP).\n * - `unsafe-url`: The referrer will include the origin and the path (but not the\n * [fragment](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/hash),\n * [password](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/password),\n * or [username](https://developer.mozilla.org/docs/Web/API/HTMLAnchorElement/username)).\n * **This value is unsafe** because it leaks origins and paths from\n * TLS-protected resources to insecure origins.\n *\n * @webnative\n */\n @Prop({ attribute: 'referrerpolicy' })\n public readonly referrerPolicy?: ReferrerPolicy\n\n /**\n * The relationship of the linked URL as space-separated\n * [link types](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel).\n *\n * The following list includes some of the most important existing keywords.\n * Every keyword within a space-separated value should be unique within that\n * value.\n *\n * - [`alternate`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-alternate):\n * Alternate representations of the current document.\n * - [`author`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-author):\n * Author of the current document or article.\n * - [`bookmark`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-bookmark):\n * Permalink for the nearest ancestor section.\n * - [`external`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-external):\n * The referenced document is not part of the same site as the current\n * document. An icon will be rendered next to the text if this value is\n * specified.\n * - [`help`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-help):\n * Link to context-sensitive help.\n * - [`license`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-license):\n * Indicates that the main content of the current document is covered by the\n * copyright license described by the referenced document.\n * - [`me`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/me):\n * Indicates that the current document represents the person who owns the\n * linked content.\n * - [`next`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-next):\n * Indicates that the current document is a part of a series and that the\n * next document in the series is the referenced document.\n * - [`nofollow`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-nofollow):\n * Indicates that the current document's original author or publisher does\n * not endorse the referenced document.\n * - [`noopener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel/noopener):\n * Creates a top-level browsing context that is not an auxiliary browsing\n * context if the hyperlink would create either of those, to begin with (i.e.,\n * has an appropriate `target` attribute value).\n * - [`noreferrer`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-noreferrer):\n * No `Referer` header will be included. Additionally, has the same effect as\n * `noopener`.\n * - [`opener`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-opener):\n * Creates an auxiliary browsing context if the hyperlink would otherwise\n * create a top-level browsing context that is not an auxiliary browsing\n * context (i.e., has \"`_blank`\" as `target` attribute value).\n * - [`prev`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-prev):\n * Indicates that the current document is a part of a series and that the\n * previous document in the series is the referenced document.\n * - [`search`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-search):\n * Gives a link to a resource that can be used to search through the current\n * document and its related pages.\n * - [`tag`](https://developer.mozilla.org/docs/Web/HTML/Attributes/rel#attr-tag):\n * Gives a tag (identified by the given address) that applies to the current\n * document.\n *\n * @webnative\n */\n @Prop() public readonly rel?: string\n\n /**\n * Where to display the linked URL, as the name for a browsing context (a\n * tab, window, or\n * [`<iframe>`](https://developer.mozilla.org/docs/Web/HTML/Element/iframe).\n * The following keywords have special meanings for where to load the URL:\n *\n * - `_blank`: usually a new tab, but users can configure browsers to open a new\n * window instead.\n * - `_parent`: the parent browsing context of the current one. If no parent,\n * behaves as `_self`.\n * - `_self`: the current browsing context.\n * - `_top`: the topmost browsing context (the \"highest\" context that's an\n * ancestor of the current one). If no ancestors, behaves as `_self`.\n *\n * @webnative\n */\n @Prop() public readonly target: LiteralUnion<Target, string> = '_self'\n\n /**\n * Emitted when the inline link loses focus.\n */\n @Event({ eventName: 'qdsBlur', bubbles: false, cancelable: false })\n private readonly blurEmitter!: EventEmitter<QdsFocusEventDetail>\n\n /**\n * Emitted when the inline link gains focus.\n */\n @Event({ eventName: 'qdsFocus', bubbles: false, cancelable: false })\n private readonly focusEmitter!: EventEmitter<QdsFocusEventDetail>\n\n @Element() private readonly element!: HTMLQdsInlineLinkElement\n\n private inheritedAttributes: Attributes = {}\n\n private get computedImportance(): Importance {\n switch (this.importance) {\n case 'subdued':\n case 'emphasized': {\n return this.importance\n }\n default: {\n return 'standard'\n }\n }\n }\n\n private get computedTabIndex(): number {\n const parsedValue = Number.parseInt(\n this.inheritedAttributes.tabindex ?? '0',\n 10,\n )\n return Number.isNaN(parsedValue) ? 0 : parsedValue\n }\n\n @Listen('click')\n protected onClick(event: MouseEvent): void {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n }\n\n public componentWillLoad(): void {\n this.inheritedAttributes = {\n ...inheritAriaAttributes(this.element),\n ...inheritAttributes(this.element, ['tabindex']),\n }\n }\n\n public render() {\n return (\n <a\n aria-disabled={this.disabled.toString()}\n class=\"qds-inline-link\"\n data-importance={this.computedImportance}\n download={this.download}\n href={this.href}\n hrefLang={this.hreflang}\n onBlur={this.onBlur}\n onFocus={this.onFocus}\n referrerPolicy={this.referrerPolicy}\n rel={this.rel}\n target={this.target}\n // eslint-disable-next-line react/jsx-props-no-spreading\n {...this.inheritedAttributes}\n tabIndex={this.disabled ? -1 : this.computedTabIndex}\n >\n <slot />\n <qds-icon class=\"qds-external\" library=\"core\" name=\"external-link\" />\n </a>\n )\n }\n\n private readonly onBlur = (event: FocusEvent): void => {\n this.blurEmitter.emit(pickFocusEventAttributes(event))\n }\n\n private readonly onFocus = (event: FocusEvent): void => {\n this.focusEmitter.emit(pickFocusEventAttributes(event))\n }\n}\n"],"version":3}
@@ -0,0 +1,88 @@
1
+ /*!
2
+ * SPDX-FileCopyrightText: © 2024 Schneider Electric
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ 'use strict';
7
+
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+
10
+ const index = require('./index-b70242ec.js');
11
+ const helpers = require('./helpers-cc2fda81.js');
12
+
13
+ const standaloneLinkCss = ":host([hidden]){display:none !important}:host{display:inline-block}.qds-chevron,.qds-icon,.qds-external{vertical-align:text-bottom}.qds-external{display:none}.qds-standalone-link{align-items:center;border-radius:var(--qds-focus-border-radius);box-sizing:border-box;display:inline-flex;justify-content:center;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-text-decoration:none;text-decoration:none;white-space:nowrap;width:100%}.qds-standalone-link[rel~='external']>.qds-external{display:inline-block}.qds-standalone-link:focus-visible{outline:var(--qds-theme-focus-border) solid var(--qds-focus-border-width)}.qds-standalone-link[data-importance='emphasized'],.qds-standalone-link:hover,.qds-standalone-link:active,.qds-standalone-link:visited{-webkit-text-decoration:underline;text-decoration:underline}.qds-standalone-link[data-importance='subdued']{color:var(--qds-theme-link-subdued-default)}.qds-standalone-link[data-importance='subdued']:hover{color:var(--qds-theme-link-subdued-hover)}.qds-standalone-link[data-importance='subdued']:active{color:var(--qds-theme-link-subdued-pressed)}.qds-standalone-link[data-importance='subdued']:visited{color:var(--qds-theme-link-subdued-visited)}.qds-standalone-link[data-importance='subdued']:visited:hover{color:var(\n --qds-theme-link-subdued-visited-hover,\n var(--qds-theme-link-subdued-visited)\n )}.qds-standalone-link[data-importance='subdued']:visited:active{color:var(\n --qds-theme-link-subdued-visited-pressed,\n var(--qds-theme-link-subdued-visited)\n )}.qds-standalone-link[data-importance='standard']{color:var(--qds-theme-link-standard-default)}.qds-standalone-link[data-importance='standard']:hover{color:var(--qds-theme-link-standard-hover)}.qds-standalone-link[data-importance='standard']:active{color:var(--qds-theme-link-standard-pressed)}.qds-standalone-link[data-importance='standard']:visited{color:var(--qds-theme-link-standard-visited)}.qds-standalone-link[data-importance='standard']:visited:hover{color:var(\n --qds-theme-link-standard-visited-hover,\n var(--qds-theme-link-standard-visited)\n )}.qds-standalone-link[data-importance='standard']:visited:active{color:var(\n --qds-theme-link-standard-visited-pressed,\n var(--qds-theme-link-standard-visited)\n )}.qds-standalone-link[data-importance='emphasized']{color:var(--qds-theme-link-emphasized-default)}.qds-standalone-link[data-importance='emphasized']:hover{color:var(--qds-theme-link-emphasized-hover)}.qds-standalone-link[data-importance='emphasized']:active{color:var(--qds-theme-link-emphasized-pressed)}.qds-standalone-link[data-importance='emphasized']:visited{color:var(--qds-theme-link-emphasized-visited)}.qds-standalone-link[data-importance='emphasized']:visited:hover{color:var(\n --qds-theme-link-emphasized-visited-hover,\n var(--qds-theme-link-emphasized-visited)\n )}.qds-standalone-link[data-importance='emphasized']:visited:active{color:var(\n --qds-theme-link-emphasized-visited-pressed,\n var(--qds-theme-link-emphasized-visited)\n )}[aria-disabled='true']{opacity:var(--qds-theme-disabled);pointer-events:none}.qds-chevron[data-size='small'],.qds-external[data-size='small'],.qds-icon[data-size='small']{height:var(--qds-control-small-icon-size);margin-inline-start:var(--qds-control-small-icon-gap);width:var(--qds-control-small-icon-size)}.qds-standalone-link[data-size='small']{font:var(--qds-control-small-text);gap:var(--qds-control-small-icon-gap);height:var(--qds-control-small-height)}.qds-chevron[data-size='standard'],.qds-external[data-size='standard'],.qds-icon[data-size='standard']{height:var(--qds-control-standard-icon-size);margin-inline-start:var(--qds-control-standard-icon-gap);width:var(--qds-control-standard-icon-size)}.qds-standalone-link[data-size='standard']{font:var(--qds-control-standard-text);gap:var(--qds-control-standard-icon-gap);height:var(--qds-control-standard-height)}.qds-chevron[data-size='large'],.qds-external[data-size='large'],.qds-icon[data-size='large']{height:var(--qds-control-large-icon-size);margin-inline-start:var(--qds-control-large-icon-gap);width:var(--qds-control-large-icon-size)}.qds-standalone-link[data-size='large']{font:var(--qds-control-large-text);gap:var(--qds-control-large-icon-gap);height:var(--qds-control-large-height)}";
14
+
15
+ const StandaloneLink = class {
16
+ constructor(hostRef) {
17
+ index.registerInstance(this, hostRef);
18
+ this.blurEmitter = index.createEvent(this, "qdsBlur", 2);
19
+ this.focusEmitter = index.createEvent(this, "qdsFocus", 2);
20
+ this.inheritedAttributes = {};
21
+ this.onBlur = (event) => {
22
+ this.blurEmitter.emit(helpers.pickFocusEventAttributes(event));
23
+ };
24
+ this.onFocus = (event) => {
25
+ this.focusEmitter.emit(helpers.pickFocusEventAttributes(event));
26
+ };
27
+ this.disabled = false;
28
+ this.iconName = undefined;
29
+ this.iconLibrary = 'default';
30
+ this.importance = 'standard';
31
+ this.size = 'standard';
32
+ this.download = undefined;
33
+ this.href = undefined;
34
+ this.hreflang = undefined;
35
+ this.referrerPolicy = undefined;
36
+ this.rel = undefined;
37
+ this.target = '_self';
38
+ }
39
+ get computedImportance() {
40
+ switch (this.importance) {
41
+ case 'subdued':
42
+ case 'emphasized': {
43
+ return this.importance;
44
+ }
45
+ default: {
46
+ return 'standard';
47
+ }
48
+ }
49
+ }
50
+ get computedSize() {
51
+ switch (this.size) {
52
+ case 'standard':
53
+ case 'small':
54
+ case 'large': {
55
+ return this.size;
56
+ }
57
+ default: {
58
+ return 'standard';
59
+ }
60
+ }
61
+ }
62
+ get computedTabIndex() {
63
+ const parsedValue = Number.parseInt(this.inheritedAttributes.tabindex ?? '0', 10);
64
+ return Number.isNaN(parsedValue) ? 0 : parsedValue;
65
+ }
66
+ onClick(event) {
67
+ if (this.disabled) {
68
+ event.preventDefault();
69
+ event.stopPropagation();
70
+ }
71
+ }
72
+ componentWillLoad() {
73
+ this.inheritedAttributes = {
74
+ ...helpers.inheritAriaAttributes(this.element),
75
+ ...helpers.inheritAttributes(this.element, ['tabindex']),
76
+ };
77
+ }
78
+ render() {
79
+ return (index.h("a", { "aria-disabled": this.disabled.toString(), class: "qds-standalone-link", "data-importance": this.computedImportance, "data-size": this.computedSize, download: this.download, href: this.href, hrefLang: this.hreflang, onBlur: this.onBlur, onFocus: this.onFocus, referrerPolicy: this.referrerPolicy, rel: this.rel, target: this.target, ...this.inheritedAttributes, tabIndex: this.disabled ? -1 : this.computedTabIndex }, this.iconName !== undefined && this.iconName !== '' && (index.h("qds-icon", { class: "qds-icon", "data-size": this.computedSize, library: this.iconLibrary, name: this.iconName })), index.h("slot", null), index.h("qds-icon", { class: "qds-external", library: "core", name: "external-link" }), index.h("qds-icon", { class: "qds-chevron", library: "core", name: "next" })));
80
+ }
81
+ static get delegatesFocus() { return true; }
82
+ get element() { return index.getElement(this); }
83
+ };
84
+ StandaloneLink.style = standaloneLinkCss;
85
+
86
+ exports.qds_standalone_link = StandaloneLink;
87
+
88
+ //# sourceMappingURL=qds-standalone-link.cjs.entry.js.map