@hashicorp/design-system-components 4.1.0 → 4.1.2

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/hds/button/index.hbs","../../../../src/components/hds/button/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Interactive\\n class={{this.classNames}}\\n @current-when={{@current-when}}\\n @models={{hds-link-to-models @model @models}}\\n @query={{hds-link-to-query @query}}\\n @replace={{@replace}}\\n @route={{@route}}\\n @isRouteExternal={{@isRouteExternal}}\\n @href={{@href}}\\n @isHrefExternal={{@isHrefExternal}}\\n ...attributes\\n aria-label={{if this.isIconOnly this.text null}}\\n>\\n {{#if this.isIconOnly}}\\n <span class=\\\"hds-button__icon\\\">\\n <FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />\\n </span>\\n {{else}}\\n {{#if this.icon}}\\n {{#if (eq this.iconPosition \\\"leading\\\")}}\\n <span class=\\\"hds-button__icon\\\">\\n <FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />\\n </span>\\n <span class=\\\"hds-button__text\\\">\\n {{this.text}}\\n </span>\\n {{else}}\\n <span class=\\\"hds-button__text\\\">\\n {{this.text}}\\n </span>\\n <span class=\\\"hds-button__icon\\\">\\n <FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />\\n </span>\\n {{/if}}\\n {{else}}\\n <span class=\\\"hds-button__text\\\">\\n {{this.text}}\\n </span>\\n {{/if}}\\n {{/if}}\\n</Hds::Interactive>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { type HdsInteractiveSignature } from '../interactive';\n\nexport const DEFAULT_SIZE = 'medium';\nexport const DEFAULT_COLOR = 'primary';\nexport const DEFAULT_ICONPOSITION = 'leading';\nexport const SIZES = ['small', 'medium', 'large'] as const;\nexport const COLORS = ['primary', 'secondary', 'tertiary', 'critical'] as const;\nexport const ICONPOSITIONS = ['leading', 'trailing'] as const;\n\nexport type HdsButtonSize = typeof SIZES[number];\nexport type HdsButtonColor = typeof COLORS[number];\nexport type HdsButtonIconPosition = typeof ICONPOSITIONS[number];\n\nexport interface HdsButtonSignature {\n Args: HdsInteractiveSignature['Args'] & {\n size?: HdsButtonSize;\n color?: HdsButtonColor;\n text: string;\n icon?: string;\n iconPosition?: HdsButtonIconPosition;\n isIconOnly?: boolean;\n isInline?: boolean;\n isFullWidth?: boolean;\n };\n Element: HdsInteractiveSignature['Element'];\n}\n\nexport default class HdsButtonIndexComponent extends Component<HdsButtonSignature> {\n /**\n * @param text\n * @type {string}\n * @description The text of the button or value of `aria-label` if `isIconOnly` is set to `true`. If no text value is defined an error will be thrown.\n */\n get text() {\n let { text } = this.args;\n\n assert(\n '@text for \"Hds::Button\" must have a valid value',\n text !== undefined\n );\n\n return text;\n }\n\n /**\n * @param size\n * @type {string}\n * @default medium\n * @description The size of the button; acceptable values are `small`, `medium`, and `large`\n */\n get size() {\n let { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Button\" must be one of the following: ${SIZES.join(\n ', '\n )}; received: ${size}`,\n SIZES.includes(size)\n );\n\n return size;\n }\n\n /**\n * @param color\n * @type {string}\n * @default primary\n * @description Determines the color of button to be used; acceptable values are `primary`, `secondary`, and `critical`\n */\n get color() {\n let { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Button\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n /**\n * @param icon\n * @type {string}\n * @default null\n * @description The name of the icon to be used.\n */\n get icon() {\n assert(\n `when the \"Hds::Button\" @color is \"tertiary\" an @icon is required`,\n !(this.color === 'tertiary' && !this.args.icon)\n );\n\n return this.args.icon ?? null;\n }\n\n /**\n * @param isIconOnly\n * @type {boolean}\n * @default false\n * @description Indicates if the button will only contain an icon; component will also ensure that accessible text is still applied to the component.\n */\n get isIconOnly() {\n if (this.icon) {\n return this.args.isIconOnly ?? false;\n }\n return false;\n }\n\n /**\n * @param iconPosition\n * @type {string}\n * @default leading\n * @description Positions the icon before or after the text; allowed values are `leading` or `trailing`\n */\n get iconPosition() {\n let { iconPosition = DEFAULT_ICONPOSITION } = this.args;\n\n assert(\n `@iconPosition for \"Hds::Button\" must be one of the following: ${ICONPOSITIONS.join(\n ', '\n )}; received: ${iconPosition}`,\n ICONPOSITIONS.includes(iconPosition)\n );\n\n return iconPosition;\n }\n\n /**\n * @param iconSize\n * @type {string}\n * @default 16\n * @description ensures that the correct icon size is used. Automatically calculated.\n */\n get iconSize() {\n if (this.args.size === 'large') {\n return '24';\n } else {\n return '16';\n }\n }\n\n /**\n * @param isFullWidth\n * @type {boolean}\n * @default false\n * @description Indicates that a button should take up the full width of the parent container. The default is false.\n */\n get isFullWidth() {\n return this.args.isFullWidth ?? false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method Button#classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n let classes = ['hds-button'];\n\n // add a class based on the @color argument\n classes.push(`hds-button--color-${this.color}`);\n\n // add a class based on the @isFullWidth argument\n if (this.isFullWidth) {\n classes.push('hds-button--width-full');\n }\n\n // add a class based on isIconOnly argument\n if (this.isIconOnly) {\n classes.push('hds-button--is-icon-only');\n }\n\n // add a class based on the @isInline argument\n if (this.args.isInline) {\n classes.push('hds-button--is-inline');\n }\n\n // add a class based on the @size argument\n classes.push(`hds-button--size-${this.size}`);\n\n return classes.join(' ');\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Hds::Button': typeof HdsButtonIndexComponent;\n 'hds/button': typeof HdsButtonIndexComponent;\n }\n}\n"],"names":["DEFAULT_SIZE","DEFAULT_COLOR","DEFAULT_ICONPOSITION","SIZES","COLORS","ICONPOSITIONS","HdsButtonIndexComponent","Component","text","args","assert","undefined","size","join","includes","color","icon","isIconOnly","iconPosition","iconSize","isFullWidth","classNames","classes","push","isInline","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,20CAA20C;;ACD72C;AACA;AACA;AACA;;AAMO,MAAMA,YAAY,GAAG,SAAQ;AAC7B,MAAMC,aAAa,GAAG,UAAS;AAC/B,MAAMC,oBAAoB,GAAG,UAAS;AACtC,MAAMC,KAAK,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAU;AACnD,MAAMC,MAAM,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAU;MAClEC,aAAa,GAAG,CAAC,SAAS,EAAE,UAAU,EAAU;AAoB9C,MAAMC,uBAAuB,SAASC,SAAS,CAAqB;AACjF;AACF;AACA;AACA;AACA;EACE,IAAIC,IAAIA,GAAG;IACT,IAAI;AAAEA,MAAAA,IAAAA;KAAM,GAAG,IAAI,CAACC,IAAI,CAAA;AAExBC,IAAAA,MAAM,CACJ,iDAAiD,EACjDF,IAAI,KAAKG,SACX,CAAC,CAAA;AAED,IAAA,OAAOH,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,IAAII,IAAIA,GAAG;IACT,IAAI;AAAEA,MAAAA,IAAI,GAAGZ,YAAAA;KAAc,GAAG,IAAI,CAACS,IAAI,CAAA;AAEvCC,IAAAA,MAAM,CACH,CAAwDP,sDAAAA,EAAAA,KAAK,CAACU,IAAI,CACjE,IACF,CAAE,CAAA,YAAA,EAAcD,IAAK,CAAA,CAAC,EACtBT,KAAK,CAACW,QAAQ,CAACF,IAAI,CACrB,CAAC,CAAA;AAED,IAAA,OAAOA,IAAI,CAAA;AACb,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE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A,GAAG;AACb,IAAA,IAAI,IAAI,CAACV,IAAI,CAACG,IAAI,KAAK,OAAO,EAAE;AAC9B,MAAA,OAAO,IAAI,CAAA;AACb,KAAC,MAAM;AACL,MAAA,OAAO,IAAI,CAAA;AACb,KAAA;AACF,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;EACE,IAAIQ,WAAWA,GAAG;AAChB,IAAA,OAAO,IAAI,CAACX,IAAI,CAACW,WAAW,IAAI,KAAK,CAAA;AACvC,GAAA;;AAEA;AACF;AACA;AACA;AACA;EACE,IAAIC,UAAUA,GAAG;AACf,IAAA,IAAIC,OAAO,GAAG,CAAC,YAAY,CAAC,CAAA;;AAE5B;IACAA,OAAO,CAACC,IAAI,CAAE,CAAA,kBAAA,EAAoB,IAAI,CAACR,KAAM,EAAC,CAAC,CAAA;;AAE/C;IACA,IAAI,IAAI,CAACK,WAAW,EAAE;AACpBE,MAAAA,OAAO,CAACC,IAAI,CAAC,wBAAwB,CAAC,CAAA;AACxC,KAAA;;AAEA;IACA,IAAI,IAAI,CAACN,UAAU,EAAE;AACnBK,MAAAA,OAAO,CAACC,IAAI,CAAC,0BAA0B,CAAC,CAAA;AAC1C,KAAA;;AAEA;AACA,IAAA,IAAI,IAAI,CAACd,IAAI,CAACe,QAAQ,EAAE;AACtBF,MAAAA,OAAO,CAACC,IAAI,CAAC,uBAAuB,CAAC,CAAA;AACvC,KAAA;;AAEA;IACAD,OAAO,CAACC,IAAI,CAAE,CAAA,iBAAA,EAAmB,IAAI,CAACX,IAAK,EAAC,CAAC,CAAA;AAE7C,IAAA,OAAOU,OAAO,CAACT,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACY,oBAAA,CAAAC,QAAA,EA7JoBpB,uBAAuB,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/hds/button/index.hbs","../../../../src/components/hds/button/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<Hds::Interactive\\n class={{this.classNames}}\\n @current-when={{@current-when}}\\n @models={{hds-link-to-models @model @models}}\\n @query={{hds-link-to-query @query}}\\n @replace={{@replace}}\\n @route={{@route}}\\n @isRouteExternal={{@isRouteExternal}}\\n @href={{@href}}\\n @isHrefExternal={{@isHrefExternal}}\\n ...attributes\\n aria-label={{if this.isIconOnly this.text null}}\\n>\\n {{#if this.isIconOnly}}\\n <span class=\\\"hds-button__icon\\\">\\n <FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />\\n </span>\\n {{else}}\\n {{#if this.icon}}\\n {{#if (eq this.iconPosition \\\"leading\\\")}}\\n <span class=\\\"hds-button__icon\\\">\\n <FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />\\n </span>\\n <span class=\\\"hds-button__text\\\">\\n {{this.text}}\\n </span>\\n {{else}}\\n <span class=\\\"hds-button__text\\\">\\n {{this.text}}\\n </span>\\n <span class=\\\"hds-button__icon\\\">\\n <FlightIcon @name={{this.icon}} @size={{this.iconSize}} @stretched={{true}} />\\n </span>\\n {{/if}}\\n {{else}}\\n <span class=\\\"hds-button__text\\\">\\n {{this.text}}\\n </span>\\n {{/if}}\\n {{/if}}\\n</Hds::Interactive>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\nimport { type HdsInteractiveSignature } from '../interactive';\n\nexport const DEFAULT_SIZE = 'medium';\nexport const DEFAULT_COLOR = 'primary';\nexport const DEFAULT_ICONPOSITION = 'leading';\nexport const SIZES = ['small', 'medium', 'large'] as const;\nexport const COLORS = ['primary', 'secondary', 'tertiary', 'critical'] as const;\nexport const ICONPOSITIONS = ['leading', 'trailing'] as const;\n\nexport type HdsButtonSize = typeof SIZES[number];\nexport type HdsButtonColor = typeof COLORS[number];\nexport type HdsButtonIconPosition = typeof ICONPOSITIONS[number];\n\nexport interface HdsButtonSignature {\n Args: HdsInteractiveSignature['Args'] & {\n size?: HdsButtonSize;\n color?: HdsButtonColor;\n text: string;\n icon?: string;\n iconPosition?: HdsButtonIconPosition;\n isIconOnly?: boolean;\n isInline?: boolean;\n isFullWidth?: boolean;\n };\n Element: HdsInteractiveSignature['Element'];\n}\n\nexport default class HdsButtonIndexComponent extends Component<HdsButtonSignature> {\n /**\n * @param text\n * @type {string}\n * @description The text of the button or value of `aria-label` if `isIconOnly` is set to `true`. If no text value is defined an error will be thrown.\n */\n get text() {\n let { text } = this.args;\n\n assert(\n '@text for \"Hds::Button\" must have a valid value',\n text !== undefined\n );\n\n return text;\n }\n\n /**\n * @param size\n * @type {string}\n * @default medium\n * @description The size of the button; acceptable values are `small`, `medium`, and `large`\n */\n get size() {\n let { size = DEFAULT_SIZE } = this.args;\n\n assert(\n `@size for \"Hds::Button\" must be one of the following: ${SIZES.join(\n ', '\n )}; received: ${size}`,\n SIZES.includes(size)\n );\n\n return size;\n }\n\n /**\n * @param color\n * @type {string}\n * @default primary\n * @description Determines the color of button to be used; acceptable values are `primary`, `secondary`, and `critical`\n */\n get color() {\n let { color = DEFAULT_COLOR } = this.args;\n\n assert(\n `@color for \"Hds::Button\" must be one of the following: ${COLORS.join(\n ', '\n )}; received: ${color}`,\n COLORS.includes(color)\n );\n\n return color;\n }\n\n /**\n * @param icon\n * @type {string}\n * @default null\n * @description The name of the icon to be used.\n */\n get icon() {\n assert(\n `when the \"Hds::Button\" @color is \"tertiary\" an @icon is required`,\n !(this.color === 'tertiary' && !this.args.icon)\n );\n\n return this.args.icon ?? null;\n }\n\n /**\n * @param isIconOnly\n * @type {boolean}\n * @default false\n * @description Indicates if the button will only contain an icon; component will also ensure that accessible text is still applied to the component.\n */\n get isIconOnly() {\n if (this.icon) {\n return this.args.isIconOnly ?? false;\n }\n return false;\n }\n\n /**\n * @param iconPosition\n * @type {string}\n * @default leading\n * @description Positions the icon before or after the text; allowed values are `leading` or `trailing`\n */\n get iconPosition() {\n let { iconPosition = DEFAULT_ICONPOSITION } = this.args;\n\n assert(\n `@iconPosition for \"Hds::Button\" must be one of the following: ${ICONPOSITIONS.join(\n ', '\n )}; received: ${iconPosition}`,\n ICONPOSITIONS.includes(iconPosition)\n );\n\n return iconPosition;\n }\n\n /**\n * @param iconSize\n * @type {string}\n * @default 16\n * @description ensures that the correct icon size is used. Automatically calculated.\n */\n get iconSize() {\n if (this.args.size === 'large') {\n return '24';\n } else {\n return '16';\n }\n }\n\n /**\n * @param isFullWidth\n * @type {boolean}\n * @default false\n * @description Indicates that a button should take up the full width of the parent container. The default is false.\n */\n get isFullWidth() {\n return this.args.isFullWidth ?? false;\n }\n\n /**\n * Get the class names to apply to the component.\n * @method Button#classNames\n * @return {string} The \"class\" attribute to apply to the component.\n */\n get classNames() {\n let classes = ['hds-button'];\n\n // add a class based on the @color argument\n classes.push(`hds-button--color-${this.color}`);\n\n // add a class based on the @isFullWidth argument\n if (this.isFullWidth) {\n classes.push('hds-button--width-full');\n }\n\n // add a class based on isIconOnly argument\n if (this.isIconOnly) {\n classes.push('hds-button--is-icon-only');\n }\n\n // add a class based on the @isInline argument\n if (this.args.isInline) {\n classes.push('hds-button--is-inline');\n }\n\n // add a class based on the @size argument\n classes.push(`hds-button--size-${this.size}`);\n\n return classes.join(' ');\n }\n}\n"],"names":["DEFAULT_SIZE","DEFAULT_COLOR","DEFAULT_ICONPOSITION","SIZES","COLORS","ICONPOSITIONS","HdsButtonIndexComponent","Component","text","args","assert","undefined","size","join","includes","color","icon","isIconOnly","iconPosition","iconSize","isFullWidth","classNames","classes","push","isInline","setComponentTemplate","TEMPLATE"],"mappings":";;;;;AACA,eAAe,kBAAkB,CAAC,20CAA20C;;ACD72C;AACA;AACA;AACA;;AAMO,MAAMA,YAAY,GAAG,SAAQ;AAC7B,MAAMC,aAAa,GAAG,UAAS;AAC/B,MAAMC,oBAAoB,GAAG,UAAS;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AAA,IAAIC,OAAO,GAAG,CAAC,YAAY,CAAC,CAAA;;AAE5B;IACAA,OAAO,CAACC,IAAI,CAAE,CAAA,kBAAA,EAAoB,IAAI,CAACR,KAAM,EAAC,CAAC,CAAA;;AAE/C;IACA,IAAI,IAAI,CAACK,WAAW,EAAE;AACpBE,MAAAA,OAAO,CAACC,IAAI,CAAC,wBAAwB,CAAC,CAAA;AACxC,KAAA;;AAEA;IACA,IAAI,IAAI,CAACN,UAAU,EAAE;AACnBK,MAAAA,OAAO,CAACC,IAAI,CAAC,0BAA0B,CAAC,CAAA;AAC1C,KAAA;;AAEA;AACA,IAAA,IAAI,IAAI,CAACd,IAAI,CAACe,QAAQ,EAAE;AACtBF,MAAAA,OAAO,CAACC,IAAI,CAAC,uBAAuB,CAAC,CAAA;AACvC,KAAA;;AAEA;IACAD,OAAO,CAACC,IAAI,CAAE,CAAA,iBAAA,EAAmB,IAAI,CAACX,IAAK,EAAC,CAAC,CAAA;AAE7C,IAAA,OAAOU,OAAO,CAACT,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1B,GAAA;AACF,CAAA;AAACY,oBAAA,CAAAC,QAAA,EA7JoBpB,uBAAuB,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/hds/dismiss-button/index.hbs","../../../../src/components/hds/dismiss-button/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<button class=\\\"hds-dismiss-button\\\" type=\\\"button\\\" aria-label={{this.ariaLabel}} ...attributes>\\n <FlightIcon @name=\\\"x\\\" @size=\\\"16\\\" @isInlineBlock={{false}} />\\n</button>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport interface HdsDismissButtonSignature {\n Args: {\n ariaLabel?: string;\n },\n Element: HTMLButtonElement;\n}\n\nexport default class HdsDismissButtonIndexComponent extends Component<HdsDismissButtonSignature> {\n /**\n * @param ariaLabel\n * @type {string}\n * @default 'Dismiss'\n */\n get ariaLabel() {\n return this.args.ariaLabel ?? 'Dismiss';\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Hds::DismissButton': typeof HdsDismissButtonIndexComponent;\n 'hds/dismiss-button': typeof HdsDismissButtonIndexComponent;\n 'HdsDismissButton': typeof HdsDismissButtonIndexComponent;\n }\n}\n"],"names":["HdsDismissButtonIndexComponent","Component","ariaLabel","args","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,ySAAyS;;ACD3U;AACA;AACA;AACA;;AAWe,MAAMA,8BAA8B,SAASC,SAAS,CAA4B;AAC/F;AACF;AACA;AACA;AACA;EACE,IAAIC,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,SAAS,IAAI,SAAS,CAAA;AACzC,GAAA;AACF,CAAA;AAACE,oBAAA,CAAAC,QAAA,EAToBL,8BAA8B,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/hds/dismiss-button/index.hbs","../../../../src/components/hds/dismiss-button/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! @glint-nocheck: not typesafe yet }}\\n{{!\\n Copyright (c) HashiCorp, Inc.\\n SPDX-License-Identifier: MPL-2.0\\n}}\\n<button class=\\\"hds-dismiss-button\\\" type=\\\"button\\\" aria-label={{this.ariaLabel}} ...attributes>\\n <FlightIcon @name=\\\"x\\\" @size=\\\"16\\\" @isInlineBlock={{false}} />\\n</button>\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\n\nexport interface HdsDismissButtonSignature {\n Args: {\n ariaLabel?: string;\n },\n Element: HTMLButtonElement;\n}\n\nexport default class HdsDismissButtonIndexComponent extends Component<HdsDismissButtonSignature> {\n /**\n * @param ariaLabel\n * @type {string}\n * @default 'Dismiss'\n */\n get ariaLabel() {\n return this.args.ariaLabel ?? 'Dismiss';\n }\n}\n"],"names":["HdsDismissButtonIndexComponent","Component","ariaLabel","args","setComponentTemplate","TEMPLATE"],"mappings":";;;;AACA,eAAe,kBAAkB,CAAC,ySAAyS;;ACD3U;AACA;AACA;AACA;;AAWe,MAAMA,8BAA8B,SAASC,SAAS,CAA4B;AAC/F;AACF;AACA;AACA;AACA;EACE,IAAIC,SAASA,GAAG;AACd,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,SAAS,IAAI,SAAS,CAAA;AACzC,GAAA;AACF,CAAA;AAACE,oBAAA,CAAAC,QAAA,EAToBL,8BAA8B,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/hds/interactive/index.hbs","../../../../src/components/hds/interactive/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! IMPORTANT: we removed the newlines before/after the yield to reduce the issues with unexpected whitespaces (see https://github.com/hashicorp/design-system/pull/231#issuecomment-1123502499) }}\\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{{! NOTICE: we can\\'t support the direct use of the \\\"href\\\" HTML attribute via ...attributes in the <a> elements, because we need to rely on the \\\"@href\\\" Ember argument to differentiate between different types of generated output }}\\n{{~#if @route~}}\\n {{~#if this.isRouteExternal~}}\\n <LinkToExternal\\n @current-when={{@current-when}}\\n @models={{hds-link-to-models @model @models}}\\n @query={{hds-link-to-query @query}}\\n @replace={{@replace}}\\n @route={{@route}}\\n ...attributes\\n >{{yield}}</LinkToExternal>\\n {{~else~}}\\n <LinkTo\\n @current-when={{@current-when}}\\n @models={{hds-link-to-models @model @models}}\\n @query={{hds-link-to-query @query}}\\n @replace={{@replace}}\\n @route={{@route}}\\n ...attributes\\n >{{yield}}</LinkTo>\\n {{~/if~}}\\n{{~else if @href~}}\\n {{~#if this.isHrefExternal~}}\\n <a target=\\\"_blank\\\" rel=\\\"noopener noreferrer\\\" ...attributes href={{@href}} {{on \\\"keyup\\\" this.onKeyUp}}>{{yield}}</a>\\n {{~else~}}\\n <a ...attributes href={{@href}} {{on \\\"keyup\\\" this.onKeyUp}}>{{yield}}</a>\\n {{~/if~}}\\n{{~else~}}\\n <button type=\\\"button\\\" ...attributes>{{yield}}</button>\\n{{~/if~}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport interface HdsInteractiveSignature {\n Args: {\n href?: string;\n isHrefExternal?: boolean;\n isRouteExternal?: boolean;\n route?: string;\n models?: unknown;\n model?: unknown;\n query?: unknown;\n 'current-when'?: string;\n replace?: boolean;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLAnchorElement | HTMLButtonElement;\n}\n\nexport default class HdsInteractiveIndexComponent extends Component<HdsInteractiveSignature> {\n /**\n * Determines if a @href value is \"external\" (it adds target=\"_blank\" rel=\"noopener noreferrer\")\n *\n * @param isHrefExternal\n * @type boolean\n * @default true\n */\n get isHrefExternal() {\n return this.args.isHrefExternal ?? true;\n }\n\n /**\n * Determines if a @route value is \"external\" (uses the LinkToExternal component instead of LinkTo)\n *\n * @param isRouteExternal\n * @type boolean\n * @default false\n */\n get isRouteExternal() {\n return this.args.isRouteExternal ?? false;\n }\n\n @action\n onKeyUp(event: KeyboardEvent) {\n if (event.key === ' ' || event.code === 'Space') {\n (event.target as HTMLElement).click();\n }\n }\n}\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'Hds::Interactive': typeof HdsInteractiveIndexComponent;\n 'hds/interactive': typeof HdsInteractiveIndexComponent;\n }\n}\n"],"names":["HdsInteractiveIndexComponent","_class","Component","isHrefExternal","args","isRouteExternal","onKeyUp","event","key","code","target","click","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AACA,eAAe,kBAAkB,CAAC,4lDAA4lD;;;ACyBzmDA,IAAAA,4BAA4B,IAAAC,MAAA,GAAlC,MAAMD,4BAA4B,SAASE,SAAS,CAA0B;AAC3F;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIC,cAAcA,GAAG;AACnB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,cAAc,IAAI,IAAI,CAAA;AACzC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIE,eAAeA,GAAG;AACpB,IAAA,OAAO,IAAI,CAACD,IAAI,CAACC,eAAe,IAAI,KAAK,CAAA;AAC3C,GAAA;EAGAC,OAAOA,CAACC,KAAoB,EAAE;IAC5B,IAAIA,KAAK,CAACC,GAAG,KAAK,GAAG,IAAID,KAAK,CAACE,IAAI,KAAK,OAAO,EAAE;AAC9CF,MAAAA,KAAK,CAACG,MAAM,CAAiBC,KAAK,EAAE,CAAA;AACvC,KAAA;AACF,GAAA;AACF,CAAC,GAAAC,yBAAA,CAAAX,MAAA,CAAAY,SAAA,EAAA,SAAA,EAAA,CANEC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAf,MAAA,CAAAY,SAAA,cAAAZ,MAAA,CAAAY,SAAA,CAAA,GAAAZ,MAAA,EAAA;AAvBwCgB,oBAAA,CAAAC,QAAA,EAAAlB,4BAAA,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/hds/interactive/index.hbs","../../../../src/components/hds/interactive/index.ts"],"sourcesContent":["import { precompileTemplate } from \"@ember/template-compilation\";\nexport default precompileTemplate(\"{{! IMPORTANT: we removed the newlines before/after the yield to reduce the issues with unexpected whitespaces (see https://github.com/hashicorp/design-system/pull/231#issuecomment-1123502499) }}\\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{{! NOTICE: we can\\'t support the direct use of the \\\"href\\\" HTML attribute via ...attributes in the <a> elements, because we need to rely on the \\\"@href\\\" Ember argument to differentiate between different types of generated output }}\\n{{~#if @route~}}\\n {{~#if this.isRouteExternal~}}\\n <LinkToExternal\\n @current-when={{@current-when}}\\n @models={{hds-link-to-models @model @models}}\\n @query={{hds-link-to-query @query}}\\n @replace={{@replace}}\\n @route={{@route}}\\n ...attributes\\n >{{yield}}</LinkToExternal>\\n {{~else~}}\\n <LinkTo\\n @current-when={{@current-when}}\\n @models={{hds-link-to-models @model @models}}\\n @query={{hds-link-to-query @query}}\\n @replace={{@replace}}\\n @route={{@route}}\\n ...attributes\\n >{{yield}}</LinkTo>\\n {{~/if~}}\\n{{~else if @href~}}\\n {{~#if this.isHrefExternal~}}\\n <a target=\\\"_blank\\\" rel=\\\"noopener noreferrer\\\" ...attributes href={{@href}} {{on \\\"keyup\\\" this.onKeyUp}}>{{yield}}</a>\\n {{~else~}}\\n <a ...attributes href={{@href}} {{on \\\"keyup\\\" this.onKeyUp}}>{{yield}}</a>\\n {{~/if~}}\\n{{~else~}}\\n <button type=\\\"button\\\" ...attributes>{{yield}}</button>\\n{{~/if~}}\")","/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { action } from '@ember/object';\n\nexport interface HdsInteractiveSignature {\n Args: {\n href?: string;\n isHrefExternal?: boolean;\n isRouteExternal?: boolean;\n route?: string;\n models?: Array<string | number>;\n model?: string | number;\n query?: Record<string, string>;\n 'current-when'?: string;\n replace?: boolean;\n };\n Blocks: {\n default: [];\n };\n Element: HTMLAnchorElement | HTMLButtonElement;\n}\n\nexport default class HdsInteractiveIndexComponent extends Component<HdsInteractiveSignature> {\n /**\n * Determines if a @href value is \"external\" (it adds target=\"_blank\" rel=\"noopener noreferrer\")\n *\n * @param isHrefExternal\n * @type boolean\n * @default true\n */\n get isHrefExternal() {\n return this.args.isHrefExternal ?? true;\n }\n\n /**\n * Determines if a @route value is \"external\" (uses the LinkToExternal component instead of LinkTo)\n *\n * @param isRouteExternal\n * @type boolean\n * @default false\n */\n get isRouteExternal() {\n return this.args.isRouteExternal ?? false;\n }\n\n @action\n onKeyUp(event: KeyboardEvent) {\n if (event.key === ' ' || event.code === 'Space') {\n (event.target as HTMLElement).click();\n }\n }\n}\n"],"names":["HdsInteractiveIndexComponent","_class","Component","isHrefExternal","args","isRouteExternal","onKeyUp","event","key","code","target","click","_applyDecoratedDescriptor","prototype","action","Object","getOwnPropertyDescriptor","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;AACA,eAAe,kBAAkB,CAAC,4lDAA4lD;;;ACyBzmDA,IAAAA,4BAA4B,IAAAC,MAAA,GAAlC,MAAMD,4BAA4B,SAASE,SAAS,CAA0B;AAC3F;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIC,cAAcA,GAAG;AACnB,IAAA,OAAO,IAAI,CAACC,IAAI,CAACD,cAAc,IAAI,IAAI,CAAA;AACzC,GAAA;;AAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,IAAIE,eAAeA,GAAG;AACpB,IAAA,OAAO,IAAI,CAACD,IAAI,CAACC,eAAe,IAAI,KAAK,CAAA;AAC3C,GAAA;EAGAC,OAAOA,CAACC,KAAoB,EAAE;IAC5B,IAAIA,KAAK,CAACC,GAAG,KAAK,GAAG,IAAID,KAAK,CAACE,IAAI,KAAK,OAAO,EAAE;AAC9CF,MAAAA,KAAK,CAACG,MAAM,CAAiBC,KAAK,EAAE,CAAA;AACvC,KAAA;AACF,GAAA;AACF,CAAC,GAAAC,yBAAA,CAAAX,MAAA,CAAAY,SAAA,EAAA,SAAA,EAAA,CANEC,MAAM,CAAAC,EAAAA,MAAA,CAAAC,wBAAA,CAAAf,MAAA,CAAAY,SAAA,cAAAZ,MAAA,CAAAY,SAAA,CAAA,GAAAZ,MAAA,EAAA;AAvBwCgB,oBAAA,CAAAC,QAAA,EAAAlB,4BAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hds-link-to-models.js","sources":["../../src/helpers/hds-link-to-models.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport { helper } from '@ember/component/helper';\nimport { assert } from '@ember/debug';\n\n/*\n * This helper can be used to support both @model and @models arguments when wrapping\n * the `<LinkTo>` component without it triggering assertions or having to use the component helper.\n *\n * The result of this helper should be passed into the `@models` argument of the `<LinkTo>` component:\n *\n * ```hbs\n * <LinkTo @models={{hds-link-to-models @model @models}} />\n * ```\n */\n\nexport function hdsLinkToModels<T>([model, models]: [T, T[]]) {\n assert(\n 'You cannot provide both the `@model` and `@models` arguments to the component.',\n !model || !models\n );\n\n if (model) {\n return [model];\n } else if (models) {\n return models;\n } else {\n return [];\n }\n}\n\nconst hdsLinkToModelsHelper = helper(hdsLinkToModels);\nexport default hdsLinkToModelsHelper;\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'hds-link-to-models': typeof hdsLinkToModelsHelper;\n }\n}\n \n"],"names":["hdsLinkToModels","model","models","assert","hdsLinkToModelsHelper","helper"],"mappings":";;;AAAA;AACA;AACA;AACA;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASA,eAAeA,CAAI,CAACC,KAAK,EAAEC,MAAM,CAAW,EAAE;EAC5DC,MAAM,CACJ,gFAAgF,EAChF,CAACF,KAAK,IAAI,CAACC,MACb,CAAC,CAAA;AAED,EAAA,IAAID,KAAK,EAAE;IACT,OAAO,CAACA,KAAK,CAAC,CAAA;GACf,MAAM,IAAIC,MAAM,EAAE;AACjB,IAAA,OAAOA,MAAM,CAAA;AACf,GAAC,MAAM;AACL,IAAA,OAAO,EAAE,CAAA;AACX,GAAA;AACF,CAAA;AAEA,MAAME,qBAAqB,GAAGC,MAAM,CAACL,eAAe;;;;"}
1
+ {"version":3,"file":"hds-link-to-models.js","sources":["../../src/helpers/hds-link-to-models.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport { helper } from '@ember/component/helper';\nimport { assert } from '@ember/debug';\n\n/*\n * This helper can be used to support both @model and @models arguments when wrapping\n * the `<LinkTo>` component without it triggering assertions or having to use the component helper.\n *\n * The result of this helper should be passed into the `@models` argument of the `<LinkTo>` component:\n *\n * ```hbs\n * <LinkTo @models={{hds-link-to-models @model @models}} />\n * ```\n */\n\nexport function hdsLinkToModels<T>([model, models]: [T | undefined, T[] | undefined]) {\n assert(\n 'You cannot provide both the `@model` and `@models` arguments to the component.',\n !model || !models\n );\n\n if (model) {\n return [model];\n } else if (models) {\n return models;\n } else {\n return [];\n }\n}\n\nconst hdsLinkToModelsHelper = helper(hdsLinkToModels);\nexport default hdsLinkToModelsHelper;\n"],"names":["hdsLinkToModels","model","models","assert","hdsLinkToModelsHelper","helper"],"mappings":";;;AAAA;AACA;AACA;AACA;;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEO,SAASA,eAAeA,CAAI,CAACC,KAAK,EAAEC,MAAM,CAAmC,EAAE;EACpFC,MAAM,CACJ,gFAAgF,EAChF,CAACF,KAAK,IAAI,CAACC,MACb,CAAC,CAAA;AAED,EAAA,IAAID,KAAK,EAAE;IACT,OAAO,CAACA,KAAK,CAAC,CAAA;GACf,MAAM,IAAIC,MAAM,EAAE;AACjB,IAAA,OAAOA,MAAM,CAAA;AACf,GAAC,MAAM;AACL,IAAA,OAAO,EAAE,CAAA;AACX,GAAA;AACF,CAAA;AAEA,MAAME,qBAAqB,GAAGC,MAAM,CAACL,eAAe;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"hds-link-to-query.js","sources":["../../src/helpers/hds-link-to-query.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport { helper } from '@ember/component/helper';\n\n/*\n * This helper can be used to safely pass a @query argument to the `<LinkTo>` component\n * without the risk of triggering an assertion if the argument is undefined\n *\n * The result of this helper should be passed into the `@query` argument of the `<LinkTo>` component:\n *\n * ```hbs\n * <LinkTo @query={{hds-link-to-query @query}} />\n * ```\n */\n\n// this is a workaround for https://github.com/emberjs/ember.js/issues/19693\n// don't remove until we drop support for ember 3.27 and 3.28\n\nexport function hdsLinkToQuery([query]: [Record<string, string> | undefined]) {\n return query ?? {};\n}\n\nconst hdsLinkToQueryHelper = helper(hdsLinkToQuery);\nexport default hdsLinkToQueryHelper;\n\ndeclare module '@glint/environment-ember-loose/registry' {\n export default interface Registry {\n 'hds-link-to-query': typeof hdsLinkToQueryHelper;\n }\n}\n"],"names":["hdsLinkToQuery","query","hdsLinkToQueryHelper","helper"],"mappings":";;AAAA;AACA;AACA;AACA;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO,SAASA,cAAcA,CAAC,CAACC,KAAK,CAAuC,EAAE;EAC5E,OAAOA,KAAK,IAAI,EAAE,CAAA;AACpB,CAAA;AAEA,MAAMC,oBAAoB,GAAGC,MAAM,CAACH,cAAc;;;;"}
1
+ {"version":3,"file":"hds-link-to-query.js","sources":["../../src/helpers/hds-link-to-query.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport { helper } from '@ember/component/helper';\n\n/*\n * This helper can be used to safely pass a @query argument to the `<LinkTo>` component\n * without the risk of triggering an assertion if the argument is undefined\n *\n * The result of this helper should be passed into the `@query` argument of the `<LinkTo>` component:\n *\n * ```hbs\n * <LinkTo @query={{hds-link-to-query @query}} />\n * ```\n */\n\n// this is a workaround for https://github.com/emberjs/ember.js/issues/19693\n// don't remove until we drop support for ember 3.27 and 3.28\n\nexport function hdsLinkToQuery([query]: [Record<string, string> | undefined]) {\n return query ?? {};\n}\n\nconst hdsLinkToQueryHelper = helper(hdsLinkToQuery);\nexport default hdsLinkToQueryHelper;\n"],"names":["hdsLinkToQuery","query","hdsLinkToQueryHelper","helper"],"mappings":";;AAAA;AACA;AACA;AACA;;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEO,SAASA,cAAcA,CAAC,CAACC,KAAK,CAAuC,EAAE;EAC5E,OAAOA,KAAK,IAAI,EAAE,CAAA;AACpB,CAAA;AAEA,MAAMC,oBAAoB,GAAGC,MAAM,CAACH,cAAc;;;;"}
@@ -10,11 +10,11 @@
10
10
  $hds-flyout-max-width: calc(100vw - var(--hds-app-sidenav-width-minimized) / 2 );
11
11
 
12
12
  @mixin hds-flyout-position($size) {
13
- width: min($size, #{$hds-flyout-max-width});
13
+ width: min(#{$size}, #{$hds-flyout-max-width});
14
14
  max-width: $hds-flyout-max-width;
15
15
 
16
16
  &[open] {
17
- margin-left: calc(100% - min($size, #{$hds-flyout-max-width}));
17
+ margin-left: calc(100% - min(#{$size}, #{$hds-flyout-max-width}));
18
18
  }
19
19
  }
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",
@@ -14,6 +14,7 @@
14
14
  "url": "https://github.com/hashicorp/design-system.git",
15
15
  "directory": "packages/components"
16
16
  },
17
+ "types": "dist/index.d.ts",
17
18
  "license": "MPL-2.0",
18
19
  "author": "HashiCorp Design Systems <design-systems@hashicorp.com>",
19
20
  "scripts": {
@@ -256,8 +257,14 @@
256
257
  }
257
258
  },
258
259
  "exports": {
259
- ".": "./dist/index.js",
260
- "./*": "./dist/*",
260
+ ".": {
261
+ "types": "./dist/index.d.ts",
262
+ "default": "./dist/index.js"
263
+ },
264
+ "./*": {
265
+ "types": "./dist/*.d.ts",
266
+ "default": "./dist/*"
267
+ },
261
268
  "./addon-main.js": "./addon-main.js"
262
269
  },
263
270
  "files": [
@@ -1,2 +0,0 @@
1
-
2
- //# sourceMappingURL=flight-icon.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flight-icon.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- import '@glint/environment-ember-loose';
2
- //# sourceMappingURL=global.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"global.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}