@hashicorp/design-system-components 6.2.0 → 6.3.0-rc-20260507194626
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/declarations/components/hds/accordion/cds/index.d.ts +35 -0
- package/declarations/components/hds/accordion/cds/item/index.d.ts +61 -0
- package/declarations/components/hds/accordion/hds/index.d.ts +30 -0
- package/declarations/components/hds/accordion/{item → hds/item}/button.d.ts +1 -1
- package/declarations/components/hds/accordion/hds/item/index.d.ts +44 -0
- package/declarations/components/hds/accordion/index.d.ts +13 -6
- package/declarations/components/hds/accordion/item/index.d.ts +11 -14
- package/declarations/components/hds/badge/index.d.ts +8 -0
- package/declarations/components/hds/button/index.d.ts +12 -0
- package/declarations/components/hds/cds-accordion/index.d.ts +10 -0
- package/declarations/components/hds/cds-accordion/item.d.ts +7 -0
- package/declarations/components/hds/cds-badge/index.d.ts +28 -0
- package/declarations/components/hds/cds-button/index.d.ts +60 -0
- package/declarations/components/hds/cds-link/index.d.ts +9 -0
- package/declarations/components/hds/cds-modal/body-content.d.ts +15 -0
- package/declarations/components/hds/cds-modal/body.d.ts +15 -0
- package/declarations/components/hds/cds-modal/close-button.d.ts +17 -0
- package/declarations/components/hds/cds-modal/footer-button.d.ts +55 -0
- package/declarations/components/hds/cds-modal/footer.d.ts +15 -0
- package/declarations/components/hds/cds-modal/header.d.ts +15 -0
- package/declarations/components/hds/cds-modal/heading.d.ts +15 -0
- package/declarations/components/hds/cds-modal/index.d.ts +37 -0
- package/declarations/components/hds/cds-text-input/index.d.ts +12 -0
- package/declarations/components/hds/form/text-input/base.d.ts +12 -0
- package/declarations/components/hds/form/text-input/field.d.ts +4 -1
- package/declarations/components/hds/icon/index.d.ts +1 -1
- package/declarations/components/hds/link/inline.d.ts +13 -0
- package/declarations/components/hds/link/standalone.d.ts +10 -0
- package/declarations/components/hds/modal/cds/index.d.ts +106 -0
- package/declarations/components/hds/modal/hds/index.d.ts +52 -0
- package/declarations/components/hds/modal/index.d.ts +44 -28
- package/declarations/components/hds/modal/types.d.ts +5 -0
- package/declarations/components/hds/stepper/task/indicator.d.ts +1 -1
- package/declarations/components.d.ts +14 -0
- package/declarations/modifiers/hds-anchored-position.d.ts +1 -1
- package/declarations/template-registry.d.ts +0 -3
- package/declarations/utils/create-component.d.ts +23 -0
- package/dist/_app_/components/hds/accordion/cds/item.js +1 -0
- package/dist/_app_/components/hds/accordion/{item/button.js → cds.js} +1 -1
- package/dist/_app_/components/hds/accordion/hds/item/button.js +1 -0
- package/dist/_app_/components/hds/accordion/hds/item.js +1 -0
- package/dist/_app_/components/hds/accordion/hds.js +1 -0
- package/dist/_app_/components/hds/cds-accordion/item.js +1 -0
- package/dist/_app_/components/hds/cds-accordion.js +1 -0
- package/dist/_app_/components/hds/cds-badge.js +1 -0
- package/dist/_app_/components/hds/cds-button.js +1 -0
- package/dist/_app_/components/hds/cds-link.js +1 -0
- package/dist/_app_/components/hds/cds-modal/body-content.js +1 -0
- package/dist/_app_/components/hds/cds-modal/body.js +1 -0
- package/dist/_app_/components/hds/cds-modal/close-button.js +1 -0
- package/dist/_app_/components/hds/cds-modal/footer-button.js +1 -0
- package/dist/_app_/components/hds/cds-modal/footer.js +1 -0
- package/dist/_app_/components/hds/cds-modal/header.js +1 -0
- package/dist/_app_/components/hds/cds-modal/heading.js +1 -0
- package/dist/_app_/components/hds/cds-modal.js +1 -0
- package/dist/_app_/components/hds/cds-text-input.js +1 -0
- package/dist/_app_/components/hds/modal/cds.js +1 -0
- package/dist/_app_/components/hds/modal/hds.js +1 -0
- package/dist/components/hds/accordion/cds/index.js +58 -0
- package/dist/components/hds/accordion/cds/index.js.map +1 -0
- package/dist/components/hds/accordion/cds/item/index.js +142 -0
- package/dist/components/hds/accordion/cds/item/index.js.map +1 -0
- package/dist/components/hds/accordion/hds/index.js +51 -0
- package/dist/components/hds/accordion/hds/index.js.map +1 -0
- package/dist/components/hds/accordion/{item → hds/item}/button.js +2 -2
- package/dist/components/hds/accordion/hds/item/button.js.map +1 -0
- package/dist/components/hds/accordion/hds/item/index.js +101 -0
- package/dist/components/hds/accordion/hds/item/index.js.map +1 -0
- package/dist/components/hds/accordion/index.js +9 -29
- package/dist/components/hds/accordion/index.js.map +1 -1
- package/dist/components/hds/accordion/item/index.js +10 -81
- package/dist/components/hds/accordion/item/index.js.map +1 -1
- package/dist/components/hds/badge/index.js +35 -1
- package/dist/components/hds/badge/index.js.map +1 -1
- package/dist/components/hds/button/index.js +41 -2
- package/dist/components/hds/button/index.js.map +1 -1
- package/dist/components/hds/cds-accordion/index.js +14 -0
- package/dist/components/hds/cds-accordion/index.js.map +1 -0
- package/dist/components/hds/cds-accordion/item.js +11 -0
- package/dist/components/hds/cds-accordion/item.js.map +1 -0
- package/dist/components/hds/cds-badge/index.js +28 -0
- package/dist/components/hds/cds-badge/index.js.map +1 -0
- package/dist/components/hds/cds-button/index.js +26 -0
- package/dist/components/hds/cds-button/index.js.map +1 -0
- package/dist/components/hds/cds-link/index.js +12 -0
- package/dist/components/hds/cds-link/index.js.map +1 -0
- package/dist/components/hds/cds-modal/body-content.js +20 -0
- package/dist/components/hds/cds-modal/body-content.js.map +1 -0
- package/dist/components/hds/cds-modal/body.js +20 -0
- package/dist/components/hds/cds-modal/body.js.map +1 -0
- package/dist/components/hds/cds-modal/close-button.js +20 -0
- package/dist/components/hds/cds-modal/close-button.js.map +1 -0
- package/dist/components/hds/cds-modal/footer-button.js +21 -0
- package/dist/components/hds/cds-modal/footer-button.js.map +1 -0
- package/dist/components/hds/cds-modal/footer.js +20 -0
- package/dist/components/hds/cds-modal/footer.js.map +1 -0
- package/dist/components/hds/cds-modal/header.js +20 -0
- package/dist/components/hds/cds-modal/header.js.map +1 -0
- package/dist/components/hds/cds-modal/heading.js +20 -0
- package/dist/components/hds/cds-modal/heading.js.map +1 -0
- package/dist/components/hds/cds-modal/index.js +23 -0
- package/dist/components/hds/cds-modal/index.js.map +1 -0
- package/dist/components/hds/cds-text-input/index.js +16 -0
- package/dist/components/hds/cds-text-input/index.js.map +1 -0
- package/dist/components/hds/form/text-input/base.js +3 -1
- package/dist/components/hds/form/text-input/base.js.map +1 -1
- package/dist/components/hds/form/text-input/field.js +4 -3
- package/dist/components/hds/form/text-input/field.js.map +1 -1
- package/dist/components/hds/link/inline.js +20 -3
- package/dist/components/hds/link/inline.js.map +1 -1
- package/dist/components/hds/link/standalone.js +31 -3
- package/dist/components/hds/link/standalone.js.map +1 -1
- package/dist/components/hds/modal/cds/index.js +195 -0
- package/dist/components/hds/modal/cds/index.js.map +1 -0
- package/dist/components/hds/modal/hds/index.js +185 -0
- package/dist/components/hds/modal/hds/index.js.map +1 -0
- package/dist/components/hds/modal/index.js +15 -164
- package/dist/components/hds/modal/index.js.map +1 -1
- package/dist/components/hds/modal/types.js +10 -1
- package/dist/components/hds/modal/types.js.map +1 -1
- package/dist/components.js +15 -1
- package/dist/components.js.map +1 -1
- package/dist/styles/@hashicorp/design-system-components.css +12 -0
- package/dist/styles/@hashicorp/design-system-components.css.map +1 -1
- package/dist/styles/components/cds-badge.scss +12 -0
- package/dist/styles/components/cds-button.scss +12 -0
- package/dist/styles/components/cds-link.scss +12 -0
- package/dist/styles/components/index.scss +5 -0
- package/dist/utils/create-component.js +98 -0
- package/dist/utils/create-component.js.map +1 -0
- package/package.json +23 -2
- package/dist/components/hds/accordion/item/button.js.map +0 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import '@carbon/web-components/es/components/modal/modal-footer-button.js';
|
|
3
|
+
import '@carbon/web-components/es/components/button/defs.js';
|
|
4
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
|
+
import { setComponentTemplate } from '@ember/component';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright IBM Corp. 2021, 2025
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
// eslint-disable-next-line ember/no-empty-glimmer-component-classes
|
|
12
|
+
class HdsCdsModalFooterButton extends Component {
|
|
13
|
+
static {
|
|
14
|
+
setComponentTemplate(precompileTemplate("<cds-modal-footer-button autofocus={{@autofocus}} batch-action={{@batchAction}} button-class-name={{@buttonClassName}} danger-description={{@dangerDescription}} disabled={{@disabled}} download={{@download}} has-main-content={{@hasMainContent}} href={{@href}} hreflang={{@hreflang}} is-expressive={{@isExpressive}} is-selected={{@isSelected}} kind={{@kind}} link-role={{@linkRole}} open-tooltip={{@openTooltip}} ping={{@ping}} rel={{@rel}} size={{@size}} tabindex={{@tabIndex}} target={{@target}} tooltip-alignment={{@tooltipAlignment}} tooltip-position={{@tooltipPosition}} tooltip-text={{@tooltipText}} type={{@type}} ...attributes>\n {{yield}}\n</cds-modal-footer-button>", {
|
|
15
|
+
strictMode: true
|
|
16
|
+
}), this);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { HdsCdsModalFooterButton as default };
|
|
21
|
+
//# sourceMappingURL=footer-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer-button.js","sources":["../../../../src/components/hds/cds-modal/footer-button.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nimport '@carbon/web-components/es/components/modal/modal-footer-button.js';\n\nimport {\n BUTTON_KIND,\n BUTTON_SIZE,\n BUTTON_TOOLTIP_ALIGNMENT,\n BUTTON_TOOLTIP_POSITION,\n BUTTON_TYPE,\n} from '@carbon/web-components/es/components/button/defs.js';\n\ntype ButtonKind = `${BUTTON_KIND}`;\ntype ButtonSize = `${BUTTON_SIZE}`;\ntype ButtonTooltipAlignment = `${BUTTON_TOOLTIP_ALIGNMENT}`;\ntype ButtonTooltipPosition = `${BUTTON_TOOLTIP_POSITION}`;\ntype ButtonType = `${BUTTON_TYPE}`;\n\ntype ModalFooterButtonShadowRootOptions = {\n delegatesFocus: boolean;\n mode: ShadowRootMode;\n slotAssignment?: SlotAssignmentMode;\n customElements?: CustomElementRegistry;\n registry?: CustomElementRegistry;\n};\n\nexport interface HdsCdsModalFooterButtonSignature {\n Args: {\n autofocus?: boolean;\n batchAction?: boolean;\n buttonClassName?: string;\n dangerDescription?: string;\n disabled?: boolean;\n download?: string;\n hasMainContent?: boolean;\n href?: string;\n hreflang?: string;\n isExpressive?: boolean;\n isSelected?: boolean;\n kind?: ButtonKind;\n linkRole?: string;\n openTooltip?: boolean;\n ping?: string;\n rel?: string;\n size?: ButtonSize;\n tabIndex?: number;\n target?: string;\n tooltipAlignment?: ButtonTooltipAlignment;\n tooltipPosition?: ButtonTooltipPosition;\n tooltipText?: string;\n type?: ButtonType;\n shadowRootOptions?: ModalFooterButtonShadowRootOptions;\n styles?: unknown[];\n };\n Blocks: {\n default: [];\n };\n Element: Element;\n}\n\n// eslint-disable-next-line ember/no-empty-glimmer-component-classes\nexport default class HdsCdsModalFooterButton extends Component<HdsCdsModalFooterButtonSignature> {\n <template>\n <cds-modal-footer-button\n autofocus={{@autofocus}}\n batch-action={{@batchAction}}\n button-class-name={{@buttonClassName}}\n danger-description={{@dangerDescription}}\n disabled={{@disabled}}\n download={{@download}}\n has-main-content={{@hasMainContent}}\n href={{@href}}\n hreflang={{@hreflang}}\n is-expressive={{@isExpressive}}\n is-selected={{@isSelected}}\n kind={{@kind}}\n link-role={{@linkRole}}\n open-tooltip={{@openTooltip}}\n ping={{@ping}}\n rel={{@rel}}\n size={{@size}}\n tabindex={{@tabIndex}}\n target={{@target}}\n tooltip-alignment={{@tooltipAlignment}}\n tooltip-position={{@tooltipPosition}}\n tooltip-text={{@tooltipText}}\n type={{@type}}\n ...attributes\n >\n {{yield}}\n </cds-modal-footer-button>\n </template>\n}\n"],"names":["HdsCdsModalFooterButton","Component","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAAA;;;AAGC;AA8DD;AACe,MAAMA,gCAAgCC,SAAA,CAAU;AAC7D,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,oqBAAA,EA6BA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import '@carbon/web-components/es/components/modal/modal-footer.js';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Copyright IBM Corp. 2021, 2025
|
|
8
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line ember/no-empty-glimmer-component-classes
|
|
11
|
+
class HdsCdsModalFooter extends Component {
|
|
12
|
+
static {
|
|
13
|
+
setComponentTemplate(precompileTemplate("<cds-modal-footer ...attributes>\n {{yield}}\n</cds-modal-footer>", {
|
|
14
|
+
strictMode: true
|
|
15
|
+
}), this);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { HdsCdsModalFooter as default };
|
|
20
|
+
//# sourceMappingURL=footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"footer.js","sources":["../../../../src/components/hds/cds-modal/footer.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nimport '@carbon/web-components/es/components/modal/modal-footer.js';\n\nexport interface HdsCdsModalFooterSignature {\n Args: Record<string, never>;\n Blocks: {\n default: [];\n };\n Element: Element;\n}\n\n// eslint-disable-next-line ember/no-empty-glimmer-component-classes\nexport default class HdsCdsModalFooter extends Component<HdsCdsModalFooterSignature> {\n <template>\n <cds-modal-footer ...attributes>\n {{yield}}\n </cds-modal-footer>\n </template>\n}\n"],"names":["HdsCdsModalFooter","Component","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAAA;;;AAGC;AAcD;AACe,MAAMA,0BAA0BC,SAAA,CAAU;AACvD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,oEAAA,EAIA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import '@carbon/web-components/es/components/modal/modal-header.js';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Copyright IBM Corp. 2021, 2025
|
|
8
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line ember/no-empty-glimmer-component-classes
|
|
11
|
+
class HdsCdsModalHeader extends Component {
|
|
12
|
+
static {
|
|
13
|
+
setComponentTemplate(precompileTemplate("<cds-modal-header ...attributes>\n {{yield}}\n</cds-modal-header>", {
|
|
14
|
+
strictMode: true
|
|
15
|
+
}), this);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { HdsCdsModalHeader as default };
|
|
20
|
+
//# sourceMappingURL=header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.js","sources":["../../../../src/components/hds/cds-modal/header.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nimport '@carbon/web-components/es/components/modal/modal-header.js';\n\nexport interface HdsCdsModalHeaderSignature {\n Args: Record<string, never>;\n Blocks: {\n default: [];\n };\n Element: Element;\n}\n\n// eslint-disable-next-line ember/no-empty-glimmer-component-classes\nexport default class HdsCdsModalHeader extends Component<HdsCdsModalHeaderSignature> {\n <template>\n <cds-modal-header ...attributes>\n {{yield}}\n </cds-modal-header>\n </template>\n}\n"],"names":["HdsCdsModalHeader","Component","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAAA;;;AAGC;AAcD;AACe,MAAMA,0BAA0BC,SAAA,CAAU;AACvD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,oEAAA,EAIA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import '@carbon/web-components/es/components/modal/modal-heading.js';
|
|
3
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
4
|
+
import { setComponentTemplate } from '@ember/component';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Copyright IBM Corp. 2021, 2025
|
|
8
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line ember/no-empty-glimmer-component-classes
|
|
11
|
+
class HdsCdsModalHeading extends Component {
|
|
12
|
+
static {
|
|
13
|
+
setComponentTemplate(precompileTemplate("<cds-modal-heading ...attributes>\n {{yield}}\n</cds-modal-heading>", {
|
|
14
|
+
strictMode: true
|
|
15
|
+
}), this);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { HdsCdsModalHeading as default };
|
|
20
|
+
//# sourceMappingURL=heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heading.js","sources":["../../../../src/components/hds/cds-modal/heading.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nimport '@carbon/web-components/es/components/modal/modal-heading.js';\n\nexport interface HdsCdsModalHeadingSignature {\n Args: Record<string, never>;\n Blocks: {\n default: [];\n };\n Element: Element;\n}\n\n// eslint-disable-next-line ember/no-empty-glimmer-component-classes\nexport default class HdsCdsModalHeading extends Component<HdsCdsModalHeadingSignature> {\n <template>\n <cds-modal-heading ...attributes>\n {{yield}}\n </cds-modal-heading>\n </template>\n}\n"],"names":["HdsCdsModalHeading","Component","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;AAAA;;;AAGC;AAcD;AACe,MAAMA,2BAA2BC,SAAA,CAAU;AACxD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,sEAAA,EAIA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import '@carbon/web-components/es/components/modal/index.js';
|
|
3
|
+
import { MODAL_SIZE } from '@carbon/web-components/es/components/modal/defs.js';
|
|
4
|
+
import { precompileTemplate } from '@ember/template-compilation';
|
|
5
|
+
import { setComponentTemplate } from '@ember/component';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright IBM Corp. 2021, 2025
|
|
9
|
+
* SPDX-License-Identifier: MPL-2.0
|
|
10
|
+
*/
|
|
11
|
+
const CDS_MODAL_SIZE_OPTIONS = Object.values(MODAL_SIZE);
|
|
12
|
+
const CDS_MODAL_LOADING_STATUS_OPTIONS = ['inactive', 'active', 'finished', 'error'];
|
|
13
|
+
// eslint-disable-next-line ember/no-empty-glimmer-component-classes
|
|
14
|
+
class HdsCdsModal extends Component {
|
|
15
|
+
static {
|
|
16
|
+
setComponentTemplate(precompileTemplate("<cds-modal alert={{@alert}} aria-label={{@ariaLabel}} {{!-- container-class={{@containerClass}} --}} full-width={{@fullWidth}} has-scrolling-content={{@hasScrollingContent}} loading-description={{@loadingDescription}} loading-icon-description={{@loadingIconDescription}} loading-status={{@loadingStatus}} loading-success-delay={{@loadingSuccessDelay}} open={{@open}} prevent-close={{@preventClose}} prevent-close-on-click-outside={{@preventCloseOnClickOutside}} should-submit-on-enter={{@shouldSubmitOnEnter}} size={{@size}} {{!-- styles={{@styles}} --}} ...attributes>\n {{yield}}\n</cds-modal>", {
|
|
17
|
+
strictMode: true
|
|
18
|
+
}), this);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { CDS_MODAL_LOADING_STATUS_OPTIONS, CDS_MODAL_SIZE_OPTIONS, HdsCdsModal as default };
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/cds-modal/index.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nimport '@carbon/web-components/es/components/modal/index.js';\n\nimport { MODAL_SIZE } from '@carbon/web-components/es/components/modal/defs.js';\n\ntype ModalSize = `${MODAL_SIZE}`;\ntype ModalLoadingStatus = 'inactive' | 'active' | 'finished' | 'error';\n\nexport const CDS_MODAL_SIZE_OPTIONS = Object.values(MODAL_SIZE);\nexport const CDS_MODAL_LOADING_STATUS_OPTIONS: ModalLoadingStatus[] = [\n 'inactive',\n 'active',\n 'finished',\n 'error',\n];\n\nexport interface HdsCdsModalSignature {\n Args: {\n alert?: boolean;\n ariaLabel?: string;\n containerClass?: string;\n fullWidth?: boolean;\n hasScrollingContent?: boolean;\n loadingDescription?: string;\n loadingIconDescription?: string;\n loadingStatus?: ModalLoadingStatus;\n loadingSuccessDelay?: number;\n open?: boolean;\n preventClose?: boolean;\n preventCloseOnClickOutside?: boolean;\n shouldSubmitOnEnter?: boolean;\n size?: ModalSize;\n styles?: string;\n };\n Blocks: {\n default: [];\n };\n Element: Element;\n}\n\n// eslint-disable-next-line ember/no-empty-glimmer-component-classes\nexport default class HdsCdsModal extends Component<HdsCdsModalSignature> {\n <template>\n <cds-modal\n alert={{@alert}}\n aria-label={{@ariaLabel}}\n {{!-- container-class={{@containerClass}} --}}\n full-width={{@fullWidth}}\n has-scrolling-content={{@hasScrollingContent}}\n loading-description={{@loadingDescription}}\n loading-icon-description={{@loadingIconDescription}}\n loading-status={{@loadingStatus}}\n loading-success-delay={{@loadingSuccessDelay}}\n open={{@open}}\n prevent-close={{@preventClose}}\n prevent-close-on-click-outside={{@preventCloseOnClickOutside}}\n should-submit-on-enter={{@shouldSubmitOnEnter}}\n size={{@size}}\n {{!-- styles={{@styles}} --}}\n ...attributes\n >\n {{yield}}\n </cds-modal>\n </template>\n}\n"],"names":["CDS_MODAL_SIZE_OPTIONS","Object","values","MODAL_SIZE","CDS_MODAL_LOADING_STATUS_OPTIONS","HdsCdsModal","Component","setComponentTemplate","precompileTemplate","strictMode"],"mappings":";;;;;;AAAA;;;AAGC;AAWM,MAAMA,sBAAA,GAAyBC,MAAA,CAAOC,MAAM,CAACC,UAAA;AAC7C,MAAMC,gCAAkC,GAAuB,CACpE,UAAA,EACA,QAAA,EACA,UAAA,EACA,OAAA;AA2BF;AACe,MAAMC,oBAAoBC,SAAA,CAAU;AACjD,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,slBAAA,EAqBA;MAAAC,UAAA,EAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import CDSTextInput from '@carbon/web-components/es/components/text-input/text-input.js';
|
|
2
|
+
import { INPUT_SIZE, INPUT_TOOLTIP_ALIGNMENT, INPUT_TOOLTIP_DIRECTION, INPUT_TYPE } from '@carbon/web-components/es/components/text-input/defs.js';
|
|
3
|
+
import { createComponent } from '../../../utils/create-component.js';
|
|
4
|
+
|
|
5
|
+
const CDS_TEXT_INPUT_SIZE_OPTIONS = Object.values(INPUT_SIZE);
|
|
6
|
+
const CDS_TEXT_INPUT_TOOLTIP_ALIGNMENT_OPTIONS = Object.values(INPUT_TOOLTIP_ALIGNMENT);
|
|
7
|
+
const CDS_TEXT_INPUT_TOOLTIP_DIRECTION_OPTIONS = Object.values(INPUT_TOOLTIP_DIRECTION);
|
|
8
|
+
const CDS_TEXT_INPUT_TYPE_OPTIONS = Object.values(INPUT_TYPE);
|
|
9
|
+
var index = createComponent({
|
|
10
|
+
tagName: 'cds-text-input',
|
|
11
|
+
elementClass: CDSTextInput,
|
|
12
|
+
displayName: 'HdsCdsTextInput'
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export { CDS_TEXT_INPUT_SIZE_OPTIONS, CDS_TEXT_INPUT_TOOLTIP_ALIGNMENT_OPTIONS, CDS_TEXT_INPUT_TOOLTIP_DIRECTION_OPTIONS, CDS_TEXT_INPUT_TYPE_OPTIONS, index as default };
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/hds/cds-text-input/index.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2026\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport CDSTextInput from '@carbon/web-components/es/components/text-input/text-input.js';\n\nimport {\n INPUT_SIZE,\n INPUT_TOOLTIP_ALIGNMENT,\n INPUT_TOOLTIP_DIRECTION,\n INPUT_TYPE,\n} from '@carbon/web-components/es/components/text-input/defs.js';\n\nimport { createComponent } from '../../../utils/create-component.gts';\n\nexport const CDS_TEXT_INPUT_SIZE_OPTIONS = Object.values(INPUT_SIZE);\nexport const CDS_TEXT_INPUT_TOOLTIP_ALIGNMENT_OPTIONS = Object.values(\n INPUT_TOOLTIP_ALIGNMENT\n);\nexport const CDS_TEXT_INPUT_TOOLTIP_DIRECTION_OPTIONS = Object.values(\n INPUT_TOOLTIP_DIRECTION\n);\nexport const CDS_TEXT_INPUT_TYPE_OPTIONS = Object.values(INPUT_TYPE);\n\nexport default createComponent({\n tagName: 'cds-text-input',\n elementClass: CDSTextInput,\n displayName: 'HdsCdsTextInput',\n});\n"],"names":["CDS_TEXT_INPUT_SIZE_OPTIONS","Object","values","INPUT_SIZE","CDS_TEXT_INPUT_TOOLTIP_ALIGNMENT_OPTIONS","INPUT_TOOLTIP_ALIGNMENT","CDS_TEXT_INPUT_TOOLTIP_DIRECTION_OPTIONS","INPUT_TOOLTIP_DIRECTION","CDS_TEXT_INPUT_TYPE_OPTIONS","INPUT_TYPE","createComponent","tagName","elementClass","CDSTextInput","displayName"],"mappings":";;;;AAgBO,MAAMA,2BAAA,GAA8BC,MAAA,CAAOC,MAAM,CAACC,UAAA;AAClD,MAAMC,wCAAA,GAA2CH,MAAA,CAAOC,MAAM,CACnEG,uBAAA;AAEK,MAAMC,wCAAA,GAA2CL,MAAA,CAAOC,MAAM,CACnEK,uBAAA;AAEK,MAAMC,2BAAA,GAA8BP,MAAA,CAAOC,MAAM,CAACO,UAAA;AAEzD,YAAeC,eAAA,CAAgB;AAC7BC,EAAAA,OAAA,EAAS,gBAAA;AACTC,EAAAA,YAAA,EAAcC,YAAA;AACdC,EAAAA,WAAA,EAAa;AACf,CAAA,CAAA;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { assert } from '@ember/debug';
|
|
3
3
|
import style from 'ember-style-modifier';
|
|
4
|
+
import '@carbon/web-components/es/components/text-input/index.js';
|
|
5
|
+
import '@carbon/web-components/es/components/text-input/text-input.js';
|
|
4
6
|
import { HdsFormTextInputTypeValues } from './types.js';
|
|
5
7
|
import { precompileTemplate } from '@ember/template-compilation';
|
|
6
8
|
import { setComponentTemplate } from '@ember/component';
|
|
@@ -38,7 +40,7 @@ class HdsFormTextInputBase extends Component {
|
|
|
38
40
|
return classes.join(' ');
|
|
39
41
|
}
|
|
40
42
|
static {
|
|
41
|
-
setComponentTemplate(precompileTemplate("<input class={{this.classNames}} {{style width=@width}} id={{@id}} aria-describedby={{@ariaDescribedBy}} ...attributes value={{@value}} type={{this.type}}
|
|
43
|
+
setComponentTemplate(precompileTemplate("{{#if @useCds}}\n <cds-text-input aria-describedby={{@ariaDescribedBy}} size={{@size}} id={{@id}} show-password-visibility-toggle={{@hasVisibilityToggle}} label={{@label}} helper-text={{@helperText}} invalid-text={{@invalidText}} enable-counter={{@enableCounter}} max-count={{@maxCount}} ...attributes value={{@value}} type={{this.type}}>\n {{yield}}\n </cds-text-input>\n{{else}}\n <input class={{this.classNames}} {{style width=@width}} id={{@id}} aria-describedby={{@ariaDescribedBy}} ...attributes value={{@value}} type={{this.type}} />\n{{/if}}", {
|
|
42
44
|
strictMode: true,
|
|
43
45
|
scope: () => ({
|
|
44
46
|
style
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/text-input/base.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport style from 'ember-style-modifier';\n\nimport { HdsFormTextInputTypeValues } from './types.ts';\nimport type { HdsFormTextInputTypes } from './types.ts';\n\n// notice: we don't support all the possible HTML types, only a subset\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input\nexport const DEFAULT_TYPE = HdsFormTextInputTypeValues.Text;\nexport const TYPES: HdsFormTextInputTypes[] = Object.values(\n HdsFormTextInputTypeValues\n);\n\nexport interface HdsFormTextInputBaseSignature {\n Args: {\n hasVisibilityToggle?: boolean;\n isInvalid?: boolean;\n isLoading?: boolean;\n type?: HdsFormTextInputTypes;\n value?: string;\n width?: string;\n id?: string;\n ariaDescribedBy?: string;\n };\n Element: HTMLInputElement;\n}\n\nexport default class HdsFormTextInputBase extends Component<HdsFormTextInputBaseSignature> {\n get type(): HdsFormTextInputTypes {\n const { type = DEFAULT_TYPE } = this.args;\n\n assert(\n `@type for \"Hds::Form::TextInput\" must be one of the following: ${TYPES.join(\n ', '\n )}; received: ${type}`,\n TYPES.includes(type)\n );\n\n return type;\n }\n\n get classNames(): string {\n const classes = ['hds-form-text-input'];\n\n // add typographic classes\n classes.push('hds-typography-body-200', 'hds-font-weight-regular');\n\n // add a class based on the @isInvalid argument\n if (this.args.isInvalid) {\n classes.push(`hds-form-text-input--is-invalid`);\n }\n\n // add a class based on the @hasVisibilityToggle argument\n if (this.args.hasVisibilityToggle) {\n classes.push(`hds-form-text-input--has-visibility-toggle`);\n }\n\n // add a class based on the @isLoading argument\n if (this.args.isLoading) {\n classes.push(`hds-form-text-input--is-loading`);\n }\n\n return classes.join(' ');\n }\n\n <template>\n <input\n class={{this.classNames}}\n
|
|
1
|
+
{"version":3,"file":"base.js","sources":["../../../../../src/components/hds/form/text-input/base.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport style from 'ember-style-modifier';\nimport '@carbon/web-components/es/components/text-input/index.js';\nimport { INPUT_SIZE } from '@carbon/web-components/es/components/text-input/text-input.js';\n\nimport { HdsFormTextInputTypeValues } from './types.ts';\nimport type { HdsFormTextInputTypes } from './types.ts';\n\n// notice: we don't support all the possible HTML types, only a subset\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input\nexport const DEFAULT_TYPE = HdsFormTextInputTypeValues.Text;\nexport const TYPES: HdsFormTextInputTypes[] = Object.values(\n HdsFormTextInputTypeValues\n);\n\nexport interface HdsFormTextInputBaseSignature {\n Args: {\n hasVisibilityToggle?: boolean;\n isInvalid?: boolean;\n isLoading?: boolean;\n type?: HdsFormTextInputTypes;\n value?: string;\n width?: string;\n id?: string;\n ariaDescribedBy?: string;\n size?: INPUT_SIZE;\n label?: string;\n helperText?: string;\n enableCounter?: boolean;\n invalidText?: string;\n maxCount?: number;\n useCds?: boolean;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLInputElement;\n}\n\nexport default class HdsFormTextInputBase extends Component<HdsFormTextInputBaseSignature> {\n get type(): HdsFormTextInputTypes {\n const { type = DEFAULT_TYPE } = this.args;\n\n assert(\n `@type for \"Hds::Form::TextInput\" must be one of the following: ${TYPES.join(\n ', '\n )}; received: ${type}`,\n TYPES.includes(type)\n );\n\n return type;\n }\n\n get classNames(): string {\n const classes = ['hds-form-text-input'];\n\n // add typographic classes\n classes.push('hds-typography-body-200', 'hds-font-weight-regular');\n\n // add a class based on the @isInvalid argument\n if (this.args.isInvalid) {\n classes.push(`hds-form-text-input--is-invalid`);\n }\n\n // add a class based on the @hasVisibilityToggle argument\n if (this.args.hasVisibilityToggle) {\n classes.push(`hds-form-text-input--has-visibility-toggle`);\n }\n\n // add a class based on the @isLoading argument\n if (this.args.isLoading) {\n classes.push(`hds-form-text-input--is-loading`);\n }\n\n return classes.join(' ');\n }\n\n <template>\n {{#if @useCds}}\n <cds-text-input\n aria-describedby={{@ariaDescribedBy}}\n size={{@size}}\n id={{@id}}\n show-password-visibility-toggle={{@hasVisibilityToggle}}\n label={{@label}}\n helper-text={{@helperText}}\n invalid-text={{@invalidText}}\n enable-counter={{@enableCounter}}\n max-count={{@maxCount}}\n ...attributes\n value={{@value}}\n type={{this.type}}\n >\n {{yield}}\n </cds-text-input>\n {{else}}\n <input\n class={{this.classNames}}\n {{style width=@width}}\n id={{@id}}\n aria-describedby={{@ariaDescribedBy}}\n ...attributes\n value={{@value}}\n type={{this.type}}\n />\n {{/if}}\n </template>\n}\n"],"names":["DEFAULT_TYPE","HdsFormTextInputTypeValues","Text","TYPES","Object","values","HdsFormTextInputBase","Component","type","args","assert","join","includes","classNames","classes","push","isInvalid","hasVisibilityToggle","isLoading","setComponentTemplate","precompileTemplate","strictMode","scope","style"],"mappings":";;;;;;;;;AAAA;;;AAGC;AAaM,MAAMA,YAAA,GAAeC,0BAAA,CAA2BC;AAChD,MAAMC,KAAO,GAA0BC,MAAA,CAAOC,MAAM,CACzDJ,0BAAA;AA2Ba,MAAMK,6BAA6BC,SAAA,CAAU;EAC1D,IAAIC,OAA8B;IAChC,MAAM;AAAEA,MAAAA,IAAA,GAAOR;KAAc,GAAG,IAAI,CAACS,IAAI;AAEzCC,IAAAA,MAAA,CACE,CAAA,+DAAA,EAAkEP,KAAA,CAAMQ,IAAI,CAC1E,IAAA,CAAA,CAAA,YAAA,EACcH,IAAA,CAAA,CAAM,EACtBL,KAAA,CAAMS,QAAQ,CAACJ,IAAA,CAAA,CAAA;AAGjB,IAAA,OAAOA,IAAA;AACT,EAAA;EAEA,IAAIK,UAAAA,GAAqB;AACvB,IAAA,MAAMC,OAAA,GAAU,CAAC,qBAAA,CAAsB;AAEvC;AACAA,IAAAA,OAAA,CAAQC,IAAI,CAAC,yBAAA,EAA2B,yBAAA,CAAA;AAExC;AACA,IAAA,IAAI,IAAI,CAACN,IAAI,CAACO,SAAS,EAAE;AACvBF,MAAAA,OAAA,CAAQC,IAAI,CAAC,CAAA,+BAAA,CAAiC,CAAA;AAChD,IAAA;AAEA;AACA,IAAA,IAAI,IAAI,CAACN,IAAI,CAACQ,mBAAmB,EAAE;AACjCH,MAAAA,OAAA,CAAQC,IAAI,CAAC,CAAA,0CAAA,CAA4C,CAAA;AAC3D,IAAA;AAEA;AACA,IAAA,IAAI,IAAI,CAACN,IAAI,CAACS,SAAS,EAAE;AACvBJ,MAAAA,OAAA,CAAQC,IAAI,CAAC,CAAA,+BAAA,CAAiC,CAAA;AAChD,IAAA;AAEA,IAAA,OAAOD,OAAA,CAAQH,IAAI,CAAC,GAAA,CAAA;AACtB,EAAA;AAEA,EAAA;IAAAQ,oBAAA,CAAAC,kBAAA,CAAA,6iBAAA,EA6BA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { hash, concat } from '@ember/helper';
|
|
3
4
|
import { on } from '@ember/modifier';
|
|
4
|
-
import { hash } from '@ember/helper';
|
|
5
5
|
import style from 'ember-style-modifier';
|
|
6
6
|
import HdsFormField from '../field/index.js';
|
|
7
7
|
import HdsFormTextInputBase from './base.js';
|
|
@@ -59,13 +59,14 @@ class HdsFormTextInputField extends Component {
|
|
|
59
59
|
this.type = this._isPasswordMasked ? 'password' : 'text';
|
|
60
60
|
};
|
|
61
61
|
static {
|
|
62
|
-
setComponentTemplate(precompileTemplate("<HdsFormField @layout=\"vertical\" @extraAriaDescribedBy={{@extraAriaDescribedBy}} @isRequired={{@isRequired}} @isOptional={{@isOptional}} @id={{@id}} as |F|>\n
|
|
62
|
+
setComponentTemplate(precompileTemplate("{{#if @useCds}}\n <HdsFormTextInputBase @useCds={{@useCds}} @type={{this.type}} @value={{@value}} @isInvalid={{@isInvalid}} @isLoading={{@isLoading}} @hasVisibilityToggle={{this.showVisibilityToggle}} required={{@isRequired}} @enableCounter={{@enableCounter}} @maxCount={{@maxCount}} @label={{@label}} @helperText={{@helperText}} ...attributes @id={{@id}} @ariaDescribedBy={{concat @ariaDescribedBy @extraAriaDescribedBy}}>\n <span slot=\"label-text\">\n {{yield to=\"label\"}}\n </span>\n <span slot=\"helper-text\">\n {{yield to=\"helperText\"}}\n </span>\n <span slot=\"validity-message\">\n {{yield to=\"error\"}}\n </span>\n </HdsFormTextInputBase>\n{{else}}\n <HdsFormField @layout=\"vertical\" @extraAriaDescribedBy={{@extraAriaDescribedBy}} @isRequired={{@isRequired}} @isOptional={{@isOptional}} @id={{@id}} as |F|>\n {{!-- Notice: the order of the elements is not relevant here, because is controlled at \"HdsFormField\" component level --}}\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\n {{#if F.CharacterCount}}\n {{yield (hash CharacterCount=(component F.CharacterCount value=@value))}}\n {{/if}}\n <F.Control>\n <div class=\"hds-form-text-input__wrapper\" {{style width=@width}}>\n <HdsFormTextInputBase @type={{this.type}} @value={{@value}} @isInvalid={{@isInvalid}} @isLoading={{@isLoading}} @hasVisibilityToggle={{this.showVisibilityToggle}} required={{@isRequired}} ...attributes id={{F.id}} aria-describedby={{F.ariaDescribedBy}} />\n {{#if this.showVisibilityToggle}}\n <HdsFormVisibilityToggle @isVisible={{this._isPasswordMasked}} @ariaLabel={{this.visibilityToggleAriaLabel}} @ariaMessageText={{this.visibilityToggleAriaMessageText}} aria-controls={{F.id}} class=\"hds-form-text-input__visibility-toggle\" {{on \"click\" this.onClickTogglePasswordReadability}} />\n {{/if}}\n </div>\n </F.Control>\n </HdsFormField>\n{{/if}}", {
|
|
63
63
|
strictMode: true,
|
|
64
64
|
scope: () => ({
|
|
65
|
+
HdsFormTextInputBase,
|
|
66
|
+
concat,
|
|
65
67
|
HdsFormField,
|
|
66
68
|
hash,
|
|
67
69
|
style,
|
|
68
|
-
HdsFormTextInputBase,
|
|
69
70
|
HdsFormVisibilityToggle,
|
|
70
71
|
on
|
|
71
72
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/text-input/field.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport {
|
|
1
|
+
{"version":3,"file":"field.js","sources":["../../../../../src/components/hds/form/text-input/field.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { tracked } from '@glimmer/tracking';\nimport { concat, hash } from '@ember/helper';\nimport { on } from '@ember/modifier';\nimport style from 'ember-style-modifier';\n\nimport type { WithBoundArgs } from '@glint/template';\nimport type Owner from '@ember/owner';\n\nimport HdsFormField from '../field/index.gts';\nimport HdsFormTextInputBase from './base.gts';\nimport HdsFormVisibilityToggle from '../visibility-toggle/index.gts';\nimport HdsFormCharacterCount from '../character-count/index.gts';\n\nimport type { HdsFormFieldSignature } from '../field/index.gts';\nimport type { HdsFormTextInputBaseSignature } from './base.gts';\nimport type { HdsFormVisibilityToggleSignature } from '../visibility-toggle/index.gts';\n\nexport interface HdsFormTextInputFieldSignature {\n Args: Omit<HdsFormFieldSignature['Args'], 'contextualClass' | 'layout'> &\n HdsFormTextInputBaseSignature['Args'] & {\n visibilityToggleAriaLabel?: HdsFormVisibilityToggleSignature['Args']['ariaLabel'];\n visibilityToggleAriaMessageText?: HdsFormVisibilityToggleSignature['Args']['ariaMessageText'];\n enableCounter?: boolean;\n maxCount?: number;\n useCds?: boolean;\n };\n Blocks: {\n default: [\n {\n Label?: HdsFormFieldSignature['Blocks']['default'][0]['Label'];\n HelperText?: HdsFormFieldSignature['Blocks']['default'][0]['HelperText'];\n Error?: HdsFormFieldSignature['Blocks']['default'][0]['Error'];\n CharacterCount?: WithBoundArgs<typeof HdsFormCharacterCount, 'value'>;\n },\n ];\n };\n Element: HdsFormTextInputBaseSignature['Element'];\n}\n\nexport default class HdsFormTextInputField extends Component<HdsFormTextInputFieldSignature> {\n @tracked private _isPasswordMasked = true;\n @tracked type;\n\n constructor(owner: Owner, args: HdsFormTextInputFieldSignature['Args']) {\n super(owner, args);\n this.type = this.args.type ?? 'text';\n }\n\n get hasVisibilityToggle(): boolean {\n return this.args.hasVisibilityToggle ?? true;\n }\n\n get showVisibilityToggle(): boolean {\n return this.args.type === 'password' && this.hasVisibilityToggle;\n }\n\n get visibilityToggleAriaLabel(): string | undefined {\n if (this.args.visibilityToggleAriaLabel) {\n return this.args.visibilityToggleAriaLabel;\n } else if (this._isPasswordMasked) {\n return 'Show password';\n } else {\n return 'Hide password';\n }\n }\n\n get visibilityToggleAriaMessageText(): string | undefined {\n if (this.args.visibilityToggleAriaMessageText) {\n return this.args.visibilityToggleAriaMessageText;\n } else if (this._isPasswordMasked) {\n return 'Password is hidden';\n } else {\n return 'Password is visible';\n }\n }\n\n onClickTogglePasswordReadability = (): void => {\n this._isPasswordMasked = !this._isPasswordMasked;\n this.type = this._isPasswordMasked ? 'password' : 'text';\n };\n\n <template>\n {{#if @useCds}}\n <HdsFormTextInputBase\n @useCds={{@useCds}}\n @type={{this.type}}\n @value={{@value}}\n @isInvalid={{@isInvalid}}\n @isLoading={{@isLoading}}\n @hasVisibilityToggle={{this.showVisibilityToggle}}\n required={{@isRequired}}\n @enableCounter={{@enableCounter}}\n @maxCount={{@maxCount}}\n @label={{@label}}\n @helperText={{@helperText}}\n ...attributes\n @id={{@id}}\n @ariaDescribedBy={{concat @ariaDescribedBy @extraAriaDescribedBy}}\n >\n <span slot=\"label-text\">\n {{yield to=\"label\"}}\n </span>\n <span slot=\"helper-text\">\n {{yield to=\"helperText\"}}\n </span>\n <span slot=\"validity-message\">\n {{yield to=\"error\"}}\n </span>\n </HdsFormTextInputBase>\n {{else}}\n <HdsFormField\n @layout=\"vertical\"\n @extraAriaDescribedBy={{@extraAriaDescribedBy}}\n @isRequired={{@isRequired}}\n @isOptional={{@isOptional}}\n @id={{@id}}\n as |F|\n >\n {{! Notice: the order of the elements is not relevant here, because is controlled at \"HdsFormField\" component level }}\n {{yield (hash Label=F.Label HelperText=F.HelperText Error=F.Error)}}\n {{#if F.CharacterCount}}\n {{yield\n (hash CharacterCount=(component F.CharacterCount value=@value))\n }}\n {{/if}}\n <F.Control>\n <div class=\"hds-form-text-input__wrapper\" {{style width=@width}}>\n <HdsFormTextInputBase\n @type={{this.type}}\n @value={{@value}}\n @isInvalid={{@isInvalid}}\n @isLoading={{@isLoading}}\n @hasVisibilityToggle={{this.showVisibilityToggle}}\n required={{@isRequired}}\n ...attributes\n id={{F.id}}\n aria-describedby={{F.ariaDescribedBy}}\n />\n {{#if this.showVisibilityToggle}}\n <HdsFormVisibilityToggle\n @isVisible={{this._isPasswordMasked}}\n @ariaLabel={{this.visibilityToggleAriaLabel}}\n @ariaMessageText={{this.visibilityToggleAriaMessageText}}\n aria-controls={{F.id}}\n class=\"hds-form-text-input__visibility-toggle\"\n {{on \"click\" this.onClickTogglePasswordReadability}}\n />\n {{/if}}\n </div>\n </F.Control>\n </HdsFormField>\n {{/if}}\n </template>\n}\n"],"names":["HdsFormTextInputField","Component","g","prototype","tracked","i","constructor","owner","args","type","hasVisibilityToggle","showVisibilityToggle","visibilityToggleAriaLabel","_isPasswordMasked","visibilityToggleAriaMessageText","onClickTogglePasswordReadability","setComponentTemplate","precompileTemplate","strictMode","scope","HdsFormTextInputBase","concat","HdsFormField","hash","style","HdsFormVisibilityToggle","on"],"mappings":";;;;;;;;;;;;;AAAA;;;AAGC;AA0Cc,MAAMA,8BAA8BC,SAAA,CAAU;AAAA,EAAA;IAAAC,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,mBAAA,EAAA,CAC1DC,OAAA,CAAA,EAAA,YAAA;AAAA,MAAA,OAAoC,IAAA;AAAA,IAAA,CAAA,CAAA;AAAA;EAAA,kBAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,mBAAA,CAAA,EAAA,MAAA;AAAA,EAAA;IAAAH,CAAA,CAAA,IAAA,CAAAC,SAAA,EAAA,MAAA,EAAA,CACpCC,OAAA,CAAA,CAAA;AAAA;EAAA,KAAA,IAAAC,CAAA,CAAA,IAAA,EAAA,MAAA,CAAA,EAAA,MAAA;AAEDC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAA4C,EAAE;AACtE,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;IACb,IAAI,CAACC,IAAI,GAAG,IAAI,CAACD,IAAI,CAACC,IAAI,IAAI,MAAA;AAChC,EAAA;EAEA,IAAIC,mBAAAA,GAA+B;AACjC,IAAA,OAAO,IAAI,CAACF,IAAI,CAACE,mBAAmB,IAAI,IAAA;AAC1C,EAAA;EAEA,IAAIC,oBAAAA,GAAgC;IAClC,OAAO,IAAI,CAACH,IAAI,CAACC,IAAI,KAAK,UAAA,IAAc,IAAI,CAACC,mBAAmB;AAClE,EAAA;EAEA,IAAIE,yBAAAA,GAAgD;AAClD,IAAA,IAAI,IAAI,CAACJ,IAAI,CAACI,yBAAyB,EAAE;AACvC,MAAA,OAAO,IAAI,CAACJ,IAAI,CAACI,yBAAyB;AAC5C,IAAA,CAAA,MAAO,IAAI,IAAI,CAACC,iBAAiB,EAAE;AACjC,MAAA,OAAO,eAAA;AACT,IAAA,CAAA,MAAO;AACL,MAAA,OAAO,eAAA;AACT,IAAA;AACF,EAAA;EAEA,IAAIC,+BAAAA,GAAsD;AACxD,IAAA,IAAI,IAAI,CAACN,IAAI,CAACM,+BAA+B,EAAE;AAC7C,MAAA,OAAO,IAAI,CAACN,IAAI,CAACM,+BAA+B;AAClD,IAAA,CAAA,MAAO,IAAI,IAAI,CAACD,iBAAiB,EAAE;AACjC,MAAA,OAAO,oBAAA;AACT,IAAA,CAAA,MAAO;AACL,MAAA,OAAO,qBAAA;AACT,IAAA;AACF,EAAA;EAEAE,gCAAA,GAAmCA,MAAQ;AACzC,IAAA,IAAI,CAACF,iBAAiB,GAAG,CAAC,IAAI,CAACA,iBAAiB;IAChD,IAAI,CAACJ,IAAI,GAAG,IAAI,CAACI,iBAAiB,GAAG,UAAA,GAAa,MAAA;EACpD,CAAA;AAEA,EAAA;IAAAG,oBAAA,CAAAC,kBAAA,CAAA,u7DAAA,EAuEA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,oBAAA;QAAAC,MAAA;QAAAC,YAAA;QAAAC,IAAA;QAAAC,KAAA;QAAAC,uBAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
|
+
import '@carbon/web-components/es/components/link/index.js';
|
|
3
|
+
import '@carbon/web-components/es/components/link/link.js';
|
|
2
4
|
import { assert } from '@ember/debug';
|
|
3
5
|
import { eq } from 'ember-truth-helpers';
|
|
4
6
|
import { HdsLinkColorValues, HdsLinkIconPositionValues } from './types.js';
|
|
@@ -44,13 +46,28 @@ class HdsLinkInline extends Component {
|
|
|
44
46
|
classes.push(`hds-link-inline--icon-${this.iconPosition}`);
|
|
45
47
|
return classes.join(' ');
|
|
46
48
|
}
|
|
49
|
+
get shouldRenderCarbon() {
|
|
50
|
+
const {
|
|
51
|
+
models,
|
|
52
|
+
model,
|
|
53
|
+
query,
|
|
54
|
+
replace,
|
|
55
|
+
route,
|
|
56
|
+
isRouteExternal,
|
|
57
|
+
useCds
|
|
58
|
+
} = this.args;
|
|
59
|
+
if (models || model || query || replace || route || isRouteExternal || this.args['current-when'] || !useCds) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
47
64
|
static {
|
|
48
|
-
setComponentTemplate(precompileTemplate("{{!-- IMPORTANT: we need to add \"squishies\" here (~) because otherwise the whitespace added by Ember becomes visible in the link (being an inline element) - See https://handlebarsjs.com/guide/expressions.html#whitespace-control --}}\n<HdsInteractive class={{this.classNames}} @current-when={{@current-when}} @models={{@models}} @model={{@model}} @query={{@query}} @replace={{@replace}} @route={{@route}} @isRouteExternal={{@isRouteExternal}} @href={{@href}} @isHrefExternal={{@isHrefExternal}} ...attributes>\n
|
|
65
|
+
setComponentTemplate(precompileTemplate("{{#if this.shouldRenderCarbon}}\n <cds-link href={{@href}} inline={{true}} size={{@size}} target={{if (eq @isHrefExternal true) \"_blank\"}} rel={{if (eq @isHrefExternal true) \"noopener noreferrer\"}} ...attributes>\n {{~#if @icon~}}\n <span class=\"hds-link-inline__icon\" slot=\"icon\">\n <HdsIcon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </span>\n {{~/if~}}\n {{yield}}\n </cds-link>\n{{else}}\n {{!-- IMPORTANT: we need to add \"squishies\" here (~) because otherwise the whitespace added by Ember becomes visible in the link (being an inline element) - See https://handlebarsjs.com/guide/expressions.html#whitespace-control --}}\n <HdsInteractive class={{this.classNames}} @current-when={{@current-when}} @models={{@models}} @model={{@model}} @query={{@query}} @replace={{@replace}} @route={{@route}} @isRouteExternal={{@isRouteExternal}} @href={{@href}} @isHrefExternal={{@isHrefExternal}} ...attributes>\n {{~#if (eq this.iconPosition \"leading\")~}}\n {{~#if @icon~}}\n <span class=\"hds-link-inline__icon hds-link-inline__icon--leading\">\n <HdsIcon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </span>\n {{~/if~}}\n {{~/if~}}\n {{yield}}\n {{~#if (eq this.iconPosition \"trailing\")~}}\n {{~#if @icon~}}\n <span class=\"hds-link-inline__icon hds-link-inline__icon--trailing\">\n <HdsIcon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </span>\n {{~/if~}}\n {{~/if~}}\n </HdsInteractive>\n{{/if}}", {
|
|
49
66
|
strictMode: true,
|
|
50
67
|
scope: () => ({
|
|
51
|
-
HdsInteractive,
|
|
52
68
|
eq,
|
|
53
|
-
HdsIcon
|
|
69
|
+
HdsIcon,
|
|
70
|
+
HdsInteractive
|
|
54
71
|
})
|
|
55
72
|
}), this);
|
|
56
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inline.js","sources":["../../../../src/components/hds/link/inline.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { eq } from 'ember-truth-helpers';\n\nimport type Owner from '@ember/owner';\n\nimport { HdsLinkColorValues, HdsLinkIconPositionValues } from './types.ts';\nimport HdsInteractive from '../interactive/index.gts';\nimport HdsIcon from '../icon/index.gts';\n\nimport type { HdsInteractiveSignature } from '../interactive/index.gts';\nimport type { HdsIconSignature } from '../icon/index.gts';\nimport type { HdsLinkColors, HdsLinkIconPositions } from './types.ts';\n\nexport const DEFAULT_ICON_POSITION = HdsLinkIconPositionValues.Trailing;\nexport const DEFAULT_COLOR = HdsLinkColorValues.Primary;\nexport const ICON_POSITIONS: HdsLinkIconPositions[] = Object.values(\n HdsLinkIconPositionValues\n);\nexport const COLORS: HdsLinkColors[] = Object.values(HdsLinkColorValues);\n\nexport interface HdsLinkInlineSignature {\n Args: HdsInteractiveSignature['Args'] & {\n color?: HdsLinkColors;\n icon?: HdsIconSignature['Args']['name'];\n iconPosition?: HdsLinkIconPositions;\n };\n Blocks: {\n default: [];\n };\n Element: HdsInteractiveSignature['Element'];\n}\n\nexport default class HdsLinkInline extends Component<HdsLinkInlineSignature> {\n constructor(owner: Owner, args: HdsLinkInlineSignature['Args']) {\n super(owner, args);\n if (!(this.args.href || this.args.route)) {\n assert('@href or @route must be defined for <Hds::Link::Inline>');\n }\n }\n\n get color(): HdsLinkColors {\n const { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Link::Inline\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n get iconPosition(): HdsLinkIconPositions {\n const { iconPosition = DEFAULT_ICON_POSITION } = this.args;\n\n assert(\n `@iconPosition for \"Hds::Link::Inline\" must be one of the following: ${ICON_POSITIONS.join(\n ', '\n )}; received: ${iconPosition}`,\n ICON_POSITIONS.includes(iconPosition)\n );\n\n return iconPosition;\n }\n\n get classNames(): string {\n const classes = ['hds-link-inline'];\n\n // add a class based on the @color argument\n classes.push(`hds-link-inline--color-${this.color}`);\n\n // add a class based on the @iconPosition argument\n classes.push(`hds-link-inline--icon-${this.iconPosition}`);\n\n return classes.join(' ');\n }\n\n <template>\n {{! IMPORTANT: we need to add \"squishies\" here (~) because otherwise the whitespace added by Ember becomes visible in the link (being an inline element) - See https://handlebarsjs.com/guide/expressions.html#whitespace-control }}\n
|
|
1
|
+
{"version":3,"file":"inline.js","sources":["../../../../src/components/hds/link/inline.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport '@carbon/web-components/es/components/link/index.js';\nimport { LINK_SIZE } from '@carbon/web-components/es/components/link/link.js';\nimport { assert } from '@ember/debug';\nimport { eq } from 'ember-truth-helpers';\n\nimport type Owner from '@ember/owner';\n\nimport { HdsLinkColorValues, HdsLinkIconPositionValues } from './types.ts';\nimport HdsInteractive from '../interactive/index.gts';\nimport HdsIcon from '../icon/index.gts';\n\nimport type { HdsInteractiveSignature } from '../interactive/index.gts';\nimport type { HdsIconSignature } from '../icon/index.gts';\nimport type { HdsLinkColors, HdsLinkIconPositions } from './types.ts';\n\nexport const DEFAULT_ICON_POSITION = HdsLinkIconPositionValues.Trailing;\nexport const DEFAULT_COLOR = HdsLinkColorValues.Primary;\nexport const ICON_POSITIONS: HdsLinkIconPositions[] = Object.values(\n HdsLinkIconPositionValues\n);\nexport const COLORS: HdsLinkColors[] = Object.values(HdsLinkColorValues);\n\ntype size = (typeof LINK_SIZE)[keyof typeof LINK_SIZE];\n\nexport interface HdsLinkInlineSignature {\n Args: HdsInteractiveSignature['Args'] & {\n useCds?: boolean;\n /**\n * @deprecated Carbon doesnt allow other colors\n */\n color?: HdsLinkColors;\n icon?: HdsIconSignature['Args']['name'];\n /**\n * @deprecated Carbon doesnt allow leading icons for links\n */\n iconPosition?: HdsLinkIconPositions;\n size?: size;\n };\n Blocks: {\n default: [];\n };\n Element: HdsInteractiveSignature['Element'];\n}\n\nexport default class HdsLinkInline extends Component<HdsLinkInlineSignature> {\n constructor(owner: Owner, args: HdsLinkInlineSignature['Args']) {\n super(owner, args);\n if (!(this.args.href || this.args.route)) {\n assert('@href or @route must be defined for <Hds::Link::Inline>');\n }\n }\n\n get color(): HdsLinkColors {\n const { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Link::Inline\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n get iconPosition(): HdsLinkIconPositions {\n const { iconPosition = DEFAULT_ICON_POSITION } = this.args;\n\n assert(\n `@iconPosition for \"Hds::Link::Inline\" must be one of the following: ${ICON_POSITIONS.join(\n ', '\n )}; received: ${iconPosition}`,\n ICON_POSITIONS.includes(iconPosition)\n );\n\n return iconPosition;\n }\n\n get classNames(): string {\n const classes = ['hds-link-inline'];\n\n // add a class based on the @color argument\n classes.push(`hds-link-inline--color-${this.color}`);\n\n // add a class based on the @iconPosition argument\n classes.push(`hds-link-inline--icon-${this.iconPosition}`);\n\n return classes.join(' ');\n }\n\n get shouldRenderCarbon() {\n const { models, model, query, replace, route, isRouteExternal, useCds } =\n this.args;\n\n if (\n models ||\n model ||\n query ||\n replace ||\n route ||\n isRouteExternal ||\n this.args['current-when'] ||\n !useCds\n ) {\n return false;\n }\n\n return true;\n }\n\n <template>\n {{#if this.shouldRenderCarbon}}\n <cds-link\n href={{@href}}\n inline={{true}}\n size={{@size}}\n target={{if (eq @isHrefExternal true) \"_blank\"}}\n rel={{if (eq @isHrefExternal true) \"noopener noreferrer\"}}\n ...attributes\n >\n {{~#if @icon~}}\n <span class=\"hds-link-inline__icon\" slot=\"icon\">\n <HdsIcon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </span>\n {{~/if~}}\n {{yield}}\n </cds-link>\n {{else}}\n {{! IMPORTANT: we need to add \"squishies\" here (~) because otherwise the whitespace added by Ember becomes visible in the link (being an inline element) - See https://handlebarsjs.com/guide/expressions.html#whitespace-control }}\n <HdsInteractive\n class={{this.classNames}}\n @current-when={{@current-when}}\n @models={{@models}}\n @model={{@model}}\n @query={{@query}}\n @replace={{@replace}}\n @route={{@route}}\n @isRouteExternal={{@isRouteExternal}}\n @href={{@href}}\n @isHrefExternal={{@isHrefExternal}}\n ...attributes\n >\n {{~#if (eq this.iconPosition \"leading\")~}}\n {{~#if @icon~}}\n <span class=\"hds-link-inline__icon hds-link-inline__icon--leading\">\n <HdsIcon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </span>\n {{~/if~}}\n {{~/if~}}\n {{yield}}\n {{~#if (eq this.iconPosition \"trailing\")~}}\n {{~#if @icon~}}\n <span class=\"hds-link-inline__icon hds-link-inline__icon--trailing\">\n <HdsIcon @name={{@icon}} @size=\"16\" @stretched={{true}} />\n </span>\n {{~/if~}}\n {{~/if~}}\n </HdsInteractive>\n {{/if}}\n </template>\n}\n"],"names":["DEFAULT_ICON_POSITION","HdsLinkIconPositionValues","Trailing","DEFAULT_COLOR","HdsLinkColorValues","Primary","ICON_POSITIONS","Object","values","COLORS","HdsLinkInline","Component","constructor","owner","args","href","route","assert","color","join","includes","iconPosition","classNames","classes","push","shouldRenderCarbon","models","model","query","replace","isRouteExternal","useCds","setComponentTemplate","precompileTemplate","strictMode","scope","eq","HdsIcon","HdsInteractive"],"mappings":";;;;;;;;;;;AAAA;;;AAGC;AAkBM,MAAMA,qBAAA,GAAwBC,yBAAA,CAA0BC;AACxD,MAAMC,aAAA,GAAgBC,kBAAA,CAAmBC;AACzC,MAAMC,cAAgB,GAAyBC,MAAA,CAAOC,MAAM,CACjEP,yBAAA;AAEK,MAAMQ,MAAQ,GAAkBF,MAAA,CAAOC,MAAM,CAACJ,kBAAA;AAwBtC,MAAMM,sBAAsBC,SAAA,CAAU;AACnDC,EAAAA,WAAAA,CAAYC,KAAY,EAAEC,IAAoC,EAAE;AAC9D,IAAA,KAAK,CAACD,KAAA,EAAOC,IAAA,CAAA;AACb,IAAA,IAAI,EAAE,IAAI,CAACA,IAAI,CAACC,IAAI,IAAI,IAAI,CAACD,IAAI,CAACE,KAAK,CAAA,EAAG;MACxCC,MAAA,CAAO,yDAAA,CAAA;AACT,IAAA;AACF,EAAA;EAEA,IAAIC,QAAuB;IACzB,MAAM;AAAEA,MAAAA,KAAA,GAAQf;KAAe,GAAG,IAAI,CAACW,IAAI;AAE3CG,IAAAA,MAAA,CACE,CAAA,6DAAA,EAAgER,MAAA,CAAOU,IAAI,CACzE,IAAA,CAAA,CAAA,YAAA,EACcD,KAAA,CAAA,CAAO,EACvBT,MAAA,CAAOW,QAAQ,CAACF,KAAA,CAAA,CAAA;AAGlB,IAAA,OAAOA,KAAA;AACT,EAAA;EAEA,IAAIG,eAAqC;IACvC,MAAM;AAAEA,MAAAA,YAAA,GAAerB;KAAuB,GAAG,IAAI,CAACc,IAAI;AAE1DG,IAAAA,MAAA,CACE,CAAA,oEAAA,EAAuEX,cAAA,CAAea,IAAI,CACxF,IAAA,CAAA,CAAA,YAAA,EACcE,YAAA,CAAA,CAAc,EAC9Bf,cAAA,CAAec,QAAQ,CAACC,YAAA,CAAA,CAAA;AAG1B,IAAA,OAAOA,YAAA;AACT,EAAA;EAEA,IAAIC,UAAAA,GAAqB;AACvB,IAAA,MAAMC,OAAA,GAAU,CAAC,iBAAA,CAAkB;AAEnC;IACAA,OAAA,CAAQC,IAAI,CAAC,CAAA,uBAAA,EAA0B,IAAI,CAACN,KAAK,EAAE,CAAA;AAEnD;IACAK,OAAA,CAAQC,IAAI,CAAC,CAAA,sBAAA,EAAyB,IAAI,CAACH,YAAY,EAAE,CAAA;AAEzD,IAAA,OAAOE,OAAA,CAAQJ,IAAI,CAAC,GAAA,CAAA;AACtB,EAAA;EAEA,IAAIM,kBAAAA,GAAqB;IACvB,MAAM;MAAEC,MAAM;MAAEC,KAAK;MAAEC,KAAK;MAAEC,OAAO;MAAEb,KAAK;MAAEc,eAAe;AAAEC,MAAAA;KAAQ,GACrE,IAAI,CAACjB,IAAI;IAEX,IACEY,MAAA,IACAC,KAAA,IACAC,KAAA,IACAC,OAAA,IACAb,KAAA,IACAc,eAAA,IACA,IAAI,CAAChB,IAAI,CAAC,cAAA,CAAe,IACzB,CAACiB,MAAA,EACD;AACA,MAAA,OAAO,KAAA;AACT,IAAA;AAEA,IAAA,OAAO,IAAA;AACT,EAAA;AAEA,EAAA;IAAAC,oBAAA,CAAAC,kBAAA,CAAA,6gDAAA,EAiDA;MAAAC,UAAA,EAAA,IAAA;AAAAC,MAAAA,KAAA,EAAAA,OAAA;QAAAC,EAAA;QAAAC,OAAA;AAAAC,QAAAA;AAAA,OAAA;KAAU,CAAA,EAAV,IAAW,CAAA;AAAD;AACZ;;;;"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { assert } from '@ember/debug';
|
|
3
3
|
import { eq } from 'ember-truth-helpers';
|
|
4
|
+
import '@carbon/web-components/es/components/link/index.js';
|
|
5
|
+
import { LINK_SIZE } from '@carbon/web-components/es/components/link/link.js';
|
|
4
6
|
import { HdsLinkColorValues, HdsLinkIconPositionValues, HdsLinkStandaloneSizeValues } from './types.js';
|
|
5
7
|
import HdsInteractive from '../interactive/index.js';
|
|
6
8
|
import HdsIcon from '../icon/index.js';
|
|
@@ -76,13 +78,39 @@ class HdsLinkStandalone extends Component {
|
|
|
76
78
|
classes.push(`hds-link-standalone--icon-position-${this.iconPosition}`);
|
|
77
79
|
return classes.join(' ');
|
|
78
80
|
}
|
|
81
|
+
get shouldRenderCarbon() {
|
|
82
|
+
const {
|
|
83
|
+
models,
|
|
84
|
+
model,
|
|
85
|
+
query,
|
|
86
|
+
replace,
|
|
87
|
+
route,
|
|
88
|
+
isRouteExternal,
|
|
89
|
+
useCds
|
|
90
|
+
} = this.args;
|
|
91
|
+
if (models || model || query || replace || route || isRouteExternal || this.args['current-when'] || !useCds) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
get mappedCarbonSize() {
|
|
97
|
+
switch (this.size) {
|
|
98
|
+
case HdsLinkStandaloneSizeValues.Small:
|
|
99
|
+
return LINK_SIZE.SMALL;
|
|
100
|
+
case HdsLinkStandaloneSizeValues.Medium:
|
|
101
|
+
return LINK_SIZE.MEDIUM;
|
|
102
|
+
case HdsLinkStandaloneSizeValues.Large:
|
|
103
|
+
return LINK_SIZE.LARGE;
|
|
104
|
+
}
|
|
105
|
+
return LINK_SIZE.MEDIUM;
|
|
106
|
+
}
|
|
79
107
|
static {
|
|
80
|
-
setComponentTemplate(precompileTemplate("<HdsInteractive class={{this.classNames}} @current-when={{@current-when}} @models={{@models}} @model={{@model}} @query={{@query}} @replace={{@replace}} @route={{@route}} @isRouteExternal={{@isRouteExternal}} @href={{@href}} @isHrefExternal={{@isHrefExternal}} ...attributes>\n
|
|
108
|
+
setComponentTemplate(precompileTemplate("{{#if this.shouldRenderCarbon}}\n <cds-link href={{@href}} inline={{true}} size={{this.mappedCarbonSize}} target={{if (eq @isHrefExternal true) \"_blank\"}} rel={{if (eq @isHrefExternal true) \"noopener noreferrer\"}} ...attributes>\n <HdsIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} slot=\"icon\" />\n {{this.text}}\n </cds-link>\n{{else}}\n <HdsInteractive class={{this.classNames}} @current-when={{@current-when}} @models={{@models}} @model={{@model}} @query={{@query}} @replace={{@replace}} @route={{@route}} @isRouteExternal={{@isRouteExternal}} @href={{@href}} @isHrefExternal={{@isHrefExternal}} ...attributes>\n {{#if (eq this.iconPosition \"leading\")}}\n <span class=\"hds-link-standalone__icon\">\n <HdsIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />\n </span>\n <span class=\"hds-link-standalone__text\">\n {{this.text}}\n </span>\n {{else}}\n <span class=\"hds-link-standalone__text\">\n {{this.text}}\n </span>\n <span class=\"hds-link-standalone__icon\">\n <HdsIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />\n </span>\n {{/if}}\n </HdsInteractive>\n{{/if}}", {
|
|
81
109
|
strictMode: true,
|
|
82
110
|
scope: () => ({
|
|
83
|
-
HdsInteractive,
|
|
84
111
|
eq,
|
|
85
|
-
HdsIcon
|
|
112
|
+
HdsIcon,
|
|
113
|
+
HdsInteractive
|
|
86
114
|
})
|
|
87
115
|
}), this);
|
|
88
116
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standalone.js","sources":["../../../../src/components/hds/link/standalone.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { eq } from 'ember-truth-helpers';\n\nimport type Owner from '@ember/owner';\n\nimport {\n HdsLinkIconPositionValues,\n HdsLinkColorValues,\n HdsLinkStandaloneSizeValues,\n} from './types.ts';\nimport HdsInteractive from '../interactive/index.gts';\nimport HdsIcon from '../icon/index.gts';\n\nimport type { HdsInteractiveSignature } from '../interactive/index.gts';\nimport type {\n HdsLinkColors,\n HdsLinkIconPositions,\n HdsLinkStandaloneSizes,\n} from './types.ts';\nimport type { HdsIconSignature } from '../icon/index.gts';\n\nexport interface HdsLinkStandaloneSignature {\n Args: HdsInteractiveSignature['Args'] & {\n size?: HdsLinkStandaloneSizes;\n color?: HdsLinkColors;\n text: string;\n icon: HdsIconSignature['Args']['name'];\n iconPosition?: HdsLinkIconPositions;\n };\n Element: HdsInteractiveSignature['Element'];\n}\n\nexport const DEFAULT_ICON_POSITION = HdsLinkIconPositionValues.Leading;\nexport const DEFAULT_COLOR = HdsLinkColorValues.Primary;\nexport const DEFAULT_SIZE = HdsLinkStandaloneSizeValues.Medium;\nexport const ICON_POSITIONS: HdsLinkIconPositions[] = Object.values(\n HdsLinkIconPositionValues\n);\nexport const COLORS: HdsLinkColors[] = Object.values(HdsLinkColorValues);\nexport const SIZES: HdsLinkStandaloneSizes[] = Object.values(\n HdsLinkStandaloneSizeValues\n);\n\nexport default class HdsLinkStandalone extends Component<HdsLinkStandaloneSignature> {\n constructor(owner: Owner, args: HdsLinkStandaloneSignature['Args']) {\n super(owner, args);\n if (!(this.args.href || this.args.route)) {\n assert('@href or @route must be defined for <Hds::Link::Standalone>');\n }\n }\n\n get text(): string {\n const { text } = this.args;\n\n assert(\n '@text for \"Hds::Link::Standalone\" must have a valid value',\n text !== undefined\n );\n\n return text;\n }\n\n get color(): HdsLinkColors {\n const { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Link::Standalone\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n get icon(): HdsIconSignature['Args']['name'] {\n const { icon } = this.args;\n\n assert(\n '@icon for \"Hds::Link::Standalone\" must have a valid value',\n icon !== undefined\n );\n\n return icon;\n }\n\n get iconPosition(): HdsLinkIconPositions {\n const { iconPosition = DEFAULT_ICON_POSITION } = this.args;\n\n assert(\n `@iconPosition for \"Hds::Link::Standalone\" must be one of the following: ${ICON_POSITIONS.join(\n ', '\n )}; received: ${iconPosition}`,\n ICON_POSITIONS.includes(iconPosition)\n );\n\n return iconPosition;\n }\n\n get size(): HdsLinkStandaloneSizes {\n const { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Link::Standalone\" must be one of the following: ${SIZES.join(\n ', '\n )}; received: ${size}`,\n SIZES.includes(size)\n );\n\n return size;\n }\n\n get iconSize(): HdsIconSignature['Args']['size'] {\n if (this.args.size === 'large') {\n return '24';\n } else {\n return '16';\n }\n }\n\n get classNames(): string {\n const classes = ['hds-link-standalone'];\n\n // add a class based on the @size argument\n classes.push(`hds-link-standalone--size-${this.size}`);\n\n // add a class based on the @color argument\n classes.push(`hds-link-standalone--color-${this.color}`);\n\n // add a class based on the @iconPosition argument\n classes.push(`hds-link-standalone--icon-position-${this.iconPosition}`);\n\n return classes.join(' ');\n }\n\n <template>\n <HdsInteractive\n class={{this.classNames}}\n @current-when={{@current-when}}\n @models={{@models}}\n @model={{@model}}\n @query={{@query}}\n @replace={{@replace}}\n @route={{@route}}\n @isRouteExternal={{@isRouteExternal}}\n @href={{@href}}\n @isHrefExternal={{@isHrefExternal}}\n ...attributes\n >\n {{#if (eq this.iconPosition \"leading\")}}\n <span class=\"hds-link-standalone__icon\">\n <HdsIcon\n @name={{this.icon}}\n @size={{this.iconSize}}\n @stretched={{true}}\n />\n </span>\n <span class=\"hds-link-standalone__text\">\n {{this.text}}\n </span>\n {{else}}\n <span class=\"hds-link-standalone__text\">\n {{this.text}}\n </span>\n <span class=\"hds-link-standalone__icon\">\n <HdsIcon\n @name={{this.icon}}\n @size={{this.iconSize}}\n @stretched={{true}}\n />\n </span>\n {{/if}}\n </HdsInteractive>\n </template>\n}\n"],"names":["DEFAULT_ICON_POSITION","HdsLinkIconPositionValues","Leading","DEFAULT_COLOR","HdsLinkColorValues","Primary","DEFAULT_SIZE","HdsLinkStandaloneSizeValues","Medium","ICON_POSITIONS","Object","values","COLORS","SIZES","HdsLinkStandalone","Component","constructor","owner","args","href","route","assert","text","undefined","color","join","includes","icon","iconPosition","size","iconSize","classNames","classes","push","setComponentTemplate","precompileTemplate","strictMode","scope","HdsInteractive","eq","HdsIcon"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"standalone.js","sources":["../../../../src/components/hds/link/standalone.gts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2021, 2025\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { eq } from 'ember-truth-helpers';\nimport '@carbon/web-components/es/components/link/index.js';\nimport { LINK_SIZE } from '@carbon/web-components/es/components/link/link.js';\n\nimport type Owner from '@ember/owner';\n\nimport {\n HdsLinkIconPositionValues,\n HdsLinkColorValues,\n HdsLinkStandaloneSizeValues,\n} from './types.ts';\nimport HdsInteractive from '../interactive/index.gts';\nimport HdsIcon from '../icon/index.gts';\n\nimport type { HdsInteractiveSignature } from '../interactive/index.gts';\nimport type {\n HdsLinkColors,\n HdsLinkIconPositions,\n HdsLinkStandaloneSizes,\n} from './types.ts';\nimport type { HdsIconSignature } from '../icon/index.gts';\n\nexport interface HdsLinkStandaloneSignature {\n Args: HdsInteractiveSignature['Args'] & {\n useCds?: boolean;\n size?: HdsLinkStandaloneSizes;\n /**\n * @deprecated Carbon doesnt allow other colors\n */\n color?: HdsLinkColors;\n text: string;\n icon: HdsIconSignature['Args']['name'];\n /**\n * @deprecated Carbon doesnt allow leading icons for links\n */\n iconPosition?: HdsLinkIconPositions;\n };\n Element: HdsInteractiveSignature['Element'];\n}\n\nexport const DEFAULT_ICON_POSITION = HdsLinkIconPositionValues.Leading;\nexport const DEFAULT_COLOR = HdsLinkColorValues.Primary;\nexport const DEFAULT_SIZE = HdsLinkStandaloneSizeValues.Medium;\nexport const ICON_POSITIONS: HdsLinkIconPositions[] = Object.values(\n HdsLinkIconPositionValues\n);\nexport const COLORS: HdsLinkColors[] = Object.values(HdsLinkColorValues);\nexport const SIZES: HdsLinkStandaloneSizes[] = Object.values(\n HdsLinkStandaloneSizeValues\n);\n\nexport default class HdsLinkStandalone extends Component<HdsLinkStandaloneSignature> {\n constructor(owner: Owner, args: HdsLinkStandaloneSignature['Args']) {\n super(owner, args);\n if (!(this.args.href || this.args.route)) {\n assert('@href or @route must be defined for <Hds::Link::Standalone>');\n }\n }\n\n get text(): string {\n const { text } = this.args;\n\n assert(\n '@text for \"Hds::Link::Standalone\" must have a valid value',\n text !== undefined\n );\n\n return text;\n }\n\n get color(): HdsLinkColors {\n const { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Link::Standalone\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n get icon(): HdsIconSignature['Args']['name'] {\n const { icon } = this.args;\n\n assert(\n '@icon for \"Hds::Link::Standalone\" must have a valid value',\n icon !== undefined\n );\n\n return icon;\n }\n\n get iconPosition(): HdsLinkIconPositions {\n const { iconPosition = DEFAULT_ICON_POSITION } = this.args;\n\n assert(\n `@iconPosition for \"Hds::Link::Standalone\" must be one of the following: ${ICON_POSITIONS.join(\n ', '\n )}; received: ${iconPosition}`,\n ICON_POSITIONS.includes(iconPosition)\n );\n\n return iconPosition;\n }\n\n get size(): HdsLinkStandaloneSizes {\n const { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Link::Standalone\" must be one of the following: ${SIZES.join(\n ', '\n )}; received: ${size}`,\n SIZES.includes(size)\n );\n\n return size;\n }\n\n get iconSize(): HdsIconSignature['Args']['size'] {\n if (this.args.size === 'large') {\n return '24';\n } else {\n return '16';\n }\n }\n\n get classNames(): string {\n const classes = ['hds-link-standalone'];\n\n // add a class based on the @size argument\n classes.push(`hds-link-standalone--size-${this.size}`);\n\n // add a class based on the @color argument\n classes.push(`hds-link-standalone--color-${this.color}`);\n\n // add a class based on the @iconPosition argument\n classes.push(`hds-link-standalone--icon-position-${this.iconPosition}`);\n\n return classes.join(' ');\n }\n\n get shouldRenderCarbon() {\n const { models, model, query, replace, route, isRouteExternal, useCds } =\n this.args;\n\n if (\n models ||\n model ||\n query ||\n replace ||\n route ||\n isRouteExternal ||\n this.args['current-when'] ||\n !useCds\n ) {\n return false;\n }\n\n return true;\n }\n\n get mappedCarbonSize() {\n switch (this.size) {\n case HdsLinkStandaloneSizeValues.Small:\n return LINK_SIZE.SMALL;\n case HdsLinkStandaloneSizeValues.Medium:\n return LINK_SIZE.MEDIUM;\n case HdsLinkStandaloneSizeValues.Large:\n return LINK_SIZE.LARGE;\n }\n\n return LINK_SIZE.MEDIUM;\n }\n\n <template>\n {{#if this.shouldRenderCarbon}}\n <cds-link\n href={{@href}}\n inline={{true}}\n size={{this.mappedCarbonSize}}\n target={{if (eq @isHrefExternal true) \"_blank\"}}\n rel={{if (eq @isHrefExternal true) \"noopener noreferrer\"}}\n ...attributes\n >\n <HdsIcon\n @name={{this.icon}}\n @size={{this.iconSize}}\n @stretched={{true}}\n slot=\"icon\"\n />\n {{this.text}}\n </cds-link>\n {{else}}\n <HdsInteractive\n class={{this.classNames}}\n @current-when={{@current-when}}\n @models={{@models}}\n @model={{@model}}\n @query={{@query}}\n @replace={{@replace}}\n @route={{@route}}\n @isRouteExternal={{@isRouteExternal}}\n @href={{@href}}\n @isHrefExternal={{@isHrefExternal}}\n ...attributes\n >\n {{#if (eq this.iconPosition \"leading\")}}\n <span class=\"hds-link-standalone__icon\">\n <HdsIcon\n @name={{this.icon}}\n @size={{this.iconSize}}\n @stretched={{true}}\n />\n </span>\n <span class=\"hds-link-standalone__text\">\n {{this.text}}\n </span>\n {{else}}\n <span class=\"hds-link-standalone__text\">\n {{this.text}}\n </span>\n <span class=\"hds-link-standalone__icon\">\n <HdsIcon\n @name={{this.icon}}\n @size={{this.iconSize}}\n @stretched={{true}}\n />\n </span>\n {{/if}}\n </HdsInteractive>\n {{/if}}\n </template>\n}\n"],"names":["DEFAULT_ICON_POSITION","HdsLinkIconPositionValues","Leading","DEFAULT_COLOR","HdsLinkColorValues","Primary","DEFAULT_SIZE","HdsLinkStandaloneSizeValues","Medium","ICON_POSITIONS","Object","values","COLORS","SIZES","HdsLinkStandalone","Component","constructor","owner","args","href","route","assert","text","undefined","color","join","includes","icon","iconPosition","size","iconSize","classNames","classes","push","shouldRenderCarbon","models","model","query","replace","isRouteExternal","useCds","mappedCarbonSize","Small","LINK_SIZE","SMALL","MEDIUM","Large","LARGE","setComponentTemplate","precompileTemplate","strictMode","scope","eq","HdsIcon","HdsInteractive"],"mappings":"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"}
|