@hashicorp/design-system-components 4.21.0 → 4.22.0-rc-20250711180943

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.
@@ -5,12 +5,13 @@
5
5
  import Component from '@glimmer/component';
6
6
  import type { ComponentLike } from '@glint/template';
7
7
  import type { HdsLayoutFlexItemSignature } from './item.ts';
8
- import { HdsLayoutFlexDirectionValues } from './types.ts';
8
+ import { HdsLayoutFlexDirectionValues, HdsLayoutFlexGapValues } from './types.ts';
9
9
  import type { HdsLayoutFlexDirections, HdsLayoutFlexJustifys, HdsLayoutFlexAligns, HdsLayoutFlexGaps, AvailableTagNames, AvailableElements } from './types.ts';
10
10
  export declare const DEFAULT_DIRECTION = HdsLayoutFlexDirectionValues.Row;
11
11
  export declare const DIRECTIONS: string[];
12
12
  export declare const JUSTIFYS: string[];
13
13
  export declare const ALIGNS: string[];
14
+ export declare const DEFAULT_GAP = HdsLayoutFlexGapValues['Zero'];
14
15
  export declare const GAPS: string[];
15
16
  export interface HdsLayoutFlexSignature {
16
17
  Args: {
@@ -24,6 +24,7 @@ export declare enum HdsLayoutFlexAlignValues {
24
24
  }
25
25
  export type HdsLayoutFlexAligns = `${HdsLayoutFlexAlignValues}`;
26
26
  export declare enum HdsLayoutFlexGapValues {
27
+ 'Zero' = "0",
27
28
  'Four' = "4",
28
29
  'Eight' = "8",
29
30
  'Twelve' = "12",
@@ -5,8 +5,10 @@
5
5
  import Component from '@glimmer/component';
6
6
  import type { ComponentLike } from '@glint/template';
7
7
  import type { HdsLayoutGridItemSignature } from '../grid/item.ts';
8
+ import { HdsLayoutGridGapValues } from './types.ts';
8
9
  import type { HdsLayoutGridAligns, HdsLayoutGridGaps, AvailableTagNames, AvailableElements } from './types.ts';
9
10
  export declare const ALIGNS: string[];
11
+ export declare const DEFAULT_GAP = HdsLayoutGridGapValues['Zero'];
10
12
  export declare const GAPS: string[];
11
13
  export interface HdsLayoutGridSignature {
12
14
  Args: {
@@ -10,6 +10,7 @@ export declare enum HdsLayoutGridAlignValues {
10
10
  }
11
11
  export type HdsLayoutGridAligns = `${HdsLayoutGridAlignValues}`;
12
12
  export declare enum HdsLayoutGridGapValues {
13
+ 'Zero' = "0",
13
14
  'Four' = "4",
14
15
  'Eight' = "8",
15
16
  'Twelve' = "12",
@@ -3,7 +3,7 @@ import { modifier } from 'ember-modifier';
3
3
  import { precompileTemplate } from '@ember/template-compilation';
4
4
  import { setComponentTemplate } from '@ember/component';
5
5
 
6
- var TEMPLATE = precompileTemplate("<div class=\"hds-form-key-value-inputs__generic-container\" {{this._onInsert}} ...attributes>\n {{yield}}\n</div>");
6
+ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-License-Identifier: MPL-2.0\n}}\n\n<div class=\"hds-form-key-value-inputs__generic-container\" {{this._onInsert}} ...attributes>\n {{yield}}\n</div>");
7
7
 
8
8
  /**
9
9
  * Copyright (c) HashiCorp, Inc.
@@ -1,6 +1,6 @@
1
1
  import Component from '@glimmer/component';
2
2
  import { assert } from '@ember/debug';
3
- import { HdsLayoutFlexDirectionValues, HdsLayoutFlexJustifyValues, HdsLayoutFlexAlignValues, HdsLayoutFlexGapValues } from './types.js';
3
+ import { HdsLayoutFlexDirectionValues, HdsLayoutFlexGapValues, HdsLayoutFlexJustifyValues, HdsLayoutFlexAlignValues } from './types.js';
4
4
  import { precompileTemplate } from '@ember/template-compilation';
5
5
  import { setComponentTemplate } from '@ember/component';
6
6
 
@@ -15,6 +15,7 @@ const DEFAULT_DIRECTION = HdsLayoutFlexDirectionValues.Row;
15
15
  const DIRECTIONS = Object.values(HdsLayoutFlexDirectionValues);
16
16
  const JUSTIFYS = Object.values(HdsLayoutFlexJustifyValues);
17
17
  const ALIGNS = Object.values(HdsLayoutFlexAlignValues);
18
+ const DEFAULT_GAP = HdsLayoutFlexGapValues.Zero;
18
19
  const GAPS = Object.values(HdsLayoutFlexGapValues);
19
20
  class HdsLayoutFlex extends Component {
20
21
  get componentTag() {
@@ -47,7 +48,7 @@ class HdsLayoutFlex extends Component {
47
48
  }
48
49
  get gap() {
49
50
  const {
50
- gap
51
+ gap = DEFAULT_GAP
51
52
  } = this.args;
52
53
  if (gap) {
53
54
  assert(`@gap for "Hds::Layout::Flex" must be a single value or an array of two values of one of the following: ${GAPS.join(', '
@@ -99,5 +100,5 @@ class HdsLayoutFlex extends Component {
99
100
  }
100
101
  setComponentTemplate(TEMPLATE, HdsLayoutFlex);
101
102
 
102
- export { ALIGNS, DEFAULT_DIRECTION, DIRECTIONS, GAPS, JUSTIFYS, HdsLayoutFlex as default };
103
+ export { ALIGNS, DEFAULT_DIRECTION, DEFAULT_GAP, DIRECTIONS, GAPS, JUSTIFYS, HdsLayoutFlex as default };
103
104
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/layout/flex/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\n\nimport type { ComponentLike } from '@glint/template';\n\nimport type { HdsLayoutFlexItemSignature } from './item.ts';\n\nimport {\n HdsLayoutFlexDirectionValues,\n HdsLayoutFlexJustifyValues,\n HdsLayoutFlexAlignValues,\n HdsLayoutFlexGapValues,\n} from './types.ts';\n\nimport type {\n HdsLayoutFlexDirections,\n HdsLayoutFlexJustifys,\n HdsLayoutFlexAligns,\n HdsLayoutFlexGaps,\n AvailableTagNames,\n AvailableElements,\n} from './types.ts';\n\nexport const DEFAULT_DIRECTION = HdsLayoutFlexDirectionValues.Row;\nexport const DIRECTIONS: string[] = Object.values(HdsLayoutFlexDirectionValues);\nexport const JUSTIFYS: string[] = Object.values(HdsLayoutFlexJustifyValues);\nexport const ALIGNS: string[] = Object.values(HdsLayoutFlexAlignValues);\nexport const GAPS: string[] = Object.values(HdsLayoutFlexGapValues);\n\nexport interface HdsLayoutFlexSignature {\n Args: {\n tag?: AvailableTagNames;\n direction?: HdsLayoutFlexDirections;\n justify?: HdsLayoutFlexJustifys;\n align?: HdsLayoutFlexAligns;\n wrap?: boolean;\n gap?: HdsLayoutFlexGaps | [HdsLayoutFlexGaps, HdsLayoutFlexGaps];\n isInline?: boolean;\n };\n Blocks: {\n default: [\n {\n Item?: ComponentLike<HdsLayoutFlexItemSignature>;\n },\n ];\n };\n Element: AvailableElements;\n}\n\nexport default class HdsLayoutFlex extends Component<HdsLayoutFlexSignature> {\n get componentTag(): AvailableTagNames {\n return this.args.tag ?? 'div';\n }\n\n get direction(): HdsLayoutFlexDirections {\n const { direction = DEFAULT_DIRECTION } = this.args;\n\n assert(\n `@direction for \"Hds::Layout::Flex\" must be one of the following: ${DIRECTIONS.join(\n ', '\n )}; received: ${direction}`,\n DIRECTIONS.includes(direction)\n );\n\n return direction;\n }\n\n get justify(): HdsLayoutFlexJustifys | undefined {\n const { justify } = this.args;\n\n if (justify) {\n assert(\n `@justify for \"Hds::Layout::Flex\" must be one of the following: ${JUSTIFYS.join(\n ', '\n )}; received: ${justify}`,\n JUSTIFYS.includes(justify)\n );\n }\n\n return justify;\n }\n\n get align(): HdsLayoutFlexAligns | undefined {\n const { align } = this.args;\n\n if (align) {\n assert(\n `@align for \"Hds::Layout::Flex\" must be one of the following: ${ALIGNS.join(\n ', '\n )}; received: ${align}`,\n ALIGNS.includes(align)\n );\n }\n\n return align;\n }\n\n get gap():\n | [HdsLayoutFlexGaps]\n | [HdsLayoutFlexGaps, HdsLayoutFlexGaps]\n | undefined {\n const { gap } = this.args;\n\n if (gap) {\n assert(\n `@gap for \"Hds::Layout::Flex\" must be a single value or an array of two values of one of the following: ${GAPS.join(\n ', '\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n )}; received: ${gap}`,\n (!Array.isArray(gap) && GAPS.includes(gap)) ||\n (Array.isArray(gap) &&\n gap.length === 2 &&\n GAPS.includes(gap[0]) &&\n GAPS.includes(gap[1]))\n );\n return Array.isArray(gap) ? gap : [gap];\n } else {\n return undefined;\n }\n }\n\n get classNames() {\n const classes = ['hds-layout-flex'];\n\n // add a class based on the @direction argument\n classes.push(`hds-layout-flex--direction-${this.direction}`);\n\n // add a class based on the @justify argument\n if (this.justify) {\n classes.push(`hds-layout-flex--justify-content-${this.justify}`);\n }\n\n // add a class based on the @align argument\n if (this.align) {\n classes.push(`hds-layout-flex--align-items-${this.align}`);\n }\n\n // add a class based on the @gap argument\n if (this.gap) {\n if (this.gap.length === 2) {\n classes.push(`hds-layout-flex--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-flex--column-gap-${this.gap[1]}`);\n } else if (this.gap.length === 1) {\n classes.push(`hds-layout-flex--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-flex--column-gap-${this.gap[0]}`);\n }\n }\n\n // add a class based on the @wrap argument\n if (this.args.wrap) {\n classes.push('hds-layout-flex--has-wrapping');\n }\n\n // add a class based on the @isInline argument\n if (this.args.isInline) {\n classes.push('hds-layout-flex--is-inline');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["DEFAULT_DIRECTION","HdsLayoutFlexDirectionValues","Row","DIRECTIONS","Object","values","JUSTIFYS","HdsLayoutFlexJustifyValues","ALIGNS","HdsLayoutFlexAlignValues","GAPS","HdsLayoutFlexGapValues","HdsLayoutFlex","Component","componentTag","args","tag","direction","assert","join","includes","justify","align","gap","Array","isArray","length","undefined","classNames","classes","push","wrap","isInline","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AAyBaA,MAAAA,iBAAiB,GAAGC,4BAA4B,CAACC;AACvD,MAAMC,UAAoB,GAAGC,MAAM,CAACC,MAAM,CAACJ,4BAA4B;AACvE,MAAMK,QAAkB,GAAGF,MAAM,CAACC,MAAM,CAACE,0BAA0B;AACnE,MAAMC,MAAgB,GAAGJ,MAAM,CAACC,MAAM,CAACI,wBAAwB;AAC/D,MAAMC,IAAc,GAAGN,MAAM,CAACC,MAAM,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,CAAC,CAA+B,4BAAA,EAAA,IAAI,CAACP,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;OAC3D,MAAM,IAAI,IAAI,CAACA,GAAG,CAACG,MAAM,KAAK,CAAC,EAAE;QAChCG,OAAO,CAACC,IAAI,CAAC,CAA4B,yBAAA,EAAA,IAAI,CAACP,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;QACvDM,OAAO,CAACC,IAAI,CAAC,CAA+B,4BAAA,EAAA,IAAI,CAACP,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;AAC5D;AACF;;AAEA;AACA,IAAA,IAAI,IAAI,CAACR,IAAI,CAACgB,IAAI,EAAE;AAClBF,MAAAA,OAAO,CAACC,IAAI,CAAC,+BAA+B,CAAC;AAC/C;;AAEA;AACA,IAAA,IAAI,IAAI,CAACf,IAAI,CAACiB,QAAQ,EAAE;AACtBH,MAAAA,OAAO,CAACC,IAAI,CAAC,4BAA4B,CAAC;AAC5C;AAEA,IAAA,OAAOD,OAAO,CAACV,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACc,oBAAA,CAAAC,QAAA,EA/GoBtB,aAAa,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/layout/flex/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\n\nimport type { ComponentLike } from '@glint/template';\n\nimport type { HdsLayoutFlexItemSignature } from './item.ts';\n\nimport {\n HdsLayoutFlexDirectionValues,\n HdsLayoutFlexJustifyValues,\n HdsLayoutFlexAlignValues,\n HdsLayoutFlexGapValues,\n} from './types.ts';\n\nimport type {\n HdsLayoutFlexDirections,\n HdsLayoutFlexJustifys,\n HdsLayoutFlexAligns,\n HdsLayoutFlexGaps,\n AvailableTagNames,\n AvailableElements,\n} from './types.ts';\n\nexport const DEFAULT_DIRECTION = HdsLayoutFlexDirectionValues.Row;\nexport const DIRECTIONS: string[] = Object.values(HdsLayoutFlexDirectionValues);\nexport const JUSTIFYS: string[] = Object.values(HdsLayoutFlexJustifyValues);\nexport const ALIGNS: string[] = Object.values(HdsLayoutFlexAlignValues);\nexport const DEFAULT_GAP = HdsLayoutFlexGapValues.Zero;\nexport const GAPS: string[] = Object.values(HdsLayoutFlexGapValues);\n\nexport interface HdsLayoutFlexSignature {\n Args: {\n tag?: AvailableTagNames;\n direction?: HdsLayoutFlexDirections;\n justify?: HdsLayoutFlexJustifys;\n align?: HdsLayoutFlexAligns;\n wrap?: boolean;\n gap?: HdsLayoutFlexGaps | [HdsLayoutFlexGaps, HdsLayoutFlexGaps];\n isInline?: boolean;\n };\n Blocks: {\n default: [\n {\n Item?: ComponentLike<HdsLayoutFlexItemSignature>;\n },\n ];\n };\n Element: AvailableElements;\n}\n\nexport default class HdsLayoutFlex extends Component<HdsLayoutFlexSignature> {\n get componentTag(): AvailableTagNames {\n return this.args.tag ?? 'div';\n }\n\n get direction(): HdsLayoutFlexDirections {\n const { direction = DEFAULT_DIRECTION } = this.args;\n\n assert(\n `@direction for \"Hds::Layout::Flex\" must be one of the following: ${DIRECTIONS.join(\n ', '\n )}; received: ${direction}`,\n DIRECTIONS.includes(direction)\n );\n\n return direction;\n }\n\n get justify(): HdsLayoutFlexJustifys | undefined {\n const { justify } = this.args;\n\n if (justify) {\n assert(\n `@justify for \"Hds::Layout::Flex\" must be one of the following: ${JUSTIFYS.join(\n ', '\n )}; received: ${justify}`,\n JUSTIFYS.includes(justify)\n );\n }\n\n return justify;\n }\n\n get align(): HdsLayoutFlexAligns | undefined {\n const { align } = this.args;\n\n if (align) {\n assert(\n `@align for \"Hds::Layout::Flex\" must be one of the following: ${ALIGNS.join(\n ', '\n )}; received: ${align}`,\n ALIGNS.includes(align)\n );\n }\n\n return align;\n }\n\n get gap():\n | [HdsLayoutFlexGaps]\n | [HdsLayoutFlexGaps, HdsLayoutFlexGaps]\n | undefined {\n const { gap = DEFAULT_GAP } = this.args;\n\n if (gap) {\n assert(\n `@gap for \"Hds::Layout::Flex\" must be a single value or an array of two values of one of the following: ${GAPS.join(\n ', '\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n )}; received: ${gap}`,\n (!Array.isArray(gap) && GAPS.includes(gap)) ||\n (Array.isArray(gap) &&\n gap.length === 2 &&\n GAPS.includes(gap[0]) &&\n GAPS.includes(gap[1]))\n );\n return Array.isArray(gap) ? gap : [gap];\n } else {\n return undefined;\n }\n }\n\n get classNames(): string {\n const classes = ['hds-layout-flex'];\n\n // add a class based on the @direction argument\n classes.push(`hds-layout-flex--direction-${this.direction}`);\n\n // add a class based on the @justify argument\n if (this.justify) {\n classes.push(`hds-layout-flex--justify-content-${this.justify}`);\n }\n\n // add a class based on the @align argument\n if (this.align) {\n classes.push(`hds-layout-flex--align-items-${this.align}`);\n }\n\n // add a class based on the @gap argument\n if (this.gap) {\n if (this.gap.length === 2) {\n classes.push(`hds-layout-flex--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-flex--column-gap-${this.gap[1]}`);\n } else if (this.gap.length === 1) {\n classes.push(`hds-layout-flex--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-flex--column-gap-${this.gap[0]}`);\n }\n }\n\n // add a class based on the @wrap argument\n if (this.args.wrap) {\n classes.push('hds-layout-flex--has-wrapping');\n }\n\n // add a class based on the @isInline argument\n if (this.args.isInline) {\n classes.push('hds-layout-flex--is-inline');\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["DEFAULT_DIRECTION","HdsLayoutFlexDirectionValues","Row","DIRECTIONS","Object","values","JUSTIFYS","HdsLayoutFlexJustifyValues","ALIGNS","HdsLayoutFlexAlignValues","DEFAULT_GAP","HdsLayoutFlexGapValues","Zero","GAPS","HdsLayoutFlex","Component","componentTag","args","tag","direction","assert","join","includes","justify","align","gap","Array","isArray","length","undefined","classNames","classes","push","wrap","isInline","setComponentTemplate","TEMPLATE"],"mappings":";;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sLayoutFlexGapValues = /*#__PURE__*/function (HdsLayoutFlexGapValues) {
28
+ HdsLayoutFlexGapValues["Zero"] = "0";
28
29
  HdsLayoutFlexGapValues["Four"] = "4";
29
30
  HdsLayoutFlexGapValues["Eight"] = "8";
30
31
  HdsLayoutFlexGapValues["Twelve"] = "12";
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../src/components/hds/layout/flex/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsLayoutFlexDirectionValues {\n Row = 'row',\n Column = 'column',\n}\n\nexport type HdsLayoutFlexDirections = `${HdsLayoutFlexDirectionValues}`;\n\nexport enum HdsLayoutFlexJustifyValues {\n Start = 'start',\n Center = 'center',\n End = 'end',\n SpaceBetween = 'space-between',\n SpaceAround = 'space-around',\n SpaceEvenly = 'space-evenly',\n}\n\nexport type HdsLayoutFlexJustifys = `${HdsLayoutFlexJustifyValues}`;\n\nexport enum HdsLayoutFlexAlignValues {\n Start = 'start',\n Center = 'center',\n End = 'end',\n Stretch = 'stretch',\n}\n\nexport type HdsLayoutFlexAligns = `${HdsLayoutFlexAlignValues}`;\n\nexport enum HdsLayoutFlexGapValues {\n 'Four' = '4',\n 'Eight' = '8',\n 'Twelve' = '12',\n 'Sixteen' = '16',\n 'TwentyFour' = '24',\n 'ThirtyTwo' = '32',\n 'FortyEight' = '48',\n}\n\nexport type HdsLayoutFlexGaps = `${HdsLayoutFlexGapValues}`;\n\n// A list of all existing tag names in the HTMLElementTagNameMap interface\nexport type AvailableTagNames = keyof HTMLElementTagNameMap;\n// A union of all types in the HTMLElementTagNameMap interface\nexport type AvailableElements =\n HTMLElementTagNameMap[keyof HTMLElementTagNameMap];\n"],"names":["HdsLayoutFlexDirectionValues","HdsLayoutFlexJustifyValues","HdsLayoutFlexAlignValues","HdsLayoutFlexGapValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,4BAA4B,0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tBA,sBAAsB;AAAA,CAAA,CAAA,EAAA;;AAYlC;;AAEA;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../src/components/hds/layout/flex/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsLayoutFlexDirectionValues {\n Row = 'row',\n Column = 'column',\n}\n\nexport type HdsLayoutFlexDirections = `${HdsLayoutFlexDirectionValues}`;\n\nexport enum HdsLayoutFlexJustifyValues {\n Start = 'start',\n Center = 'center',\n End = 'end',\n SpaceBetween = 'space-between',\n SpaceAround = 'space-around',\n SpaceEvenly = 'space-evenly',\n}\n\nexport type HdsLayoutFlexJustifys = `${HdsLayoutFlexJustifyValues}`;\n\nexport enum HdsLayoutFlexAlignValues {\n Start = 'start',\n Center = 'center',\n End = 'end',\n Stretch = 'stretch',\n}\n\nexport type HdsLayoutFlexAligns = `${HdsLayoutFlexAlignValues}`;\n\nexport enum HdsLayoutFlexGapValues {\n 'Zero' = '0',\n 'Four' = '4',\n 'Eight' = '8',\n 'Twelve' = '12',\n 'Sixteen' = '16',\n 'TwentyFour' = '24',\n 'ThirtyTwo' = '32',\n 'FortyEight' = '48',\n}\n\nexport type HdsLayoutFlexGaps = `${HdsLayoutFlexGapValues}`;\n\n// A list of all existing tag names in the HTMLElementTagNameMap interface\nexport type AvailableTagNames = keyof HTMLElementTagNameMap;\n// A union of all types in the HTMLElementTagNameMap interface\nexport type AvailableElements =\n HTMLElementTagNameMap[keyof HTMLElementTagNameMap];\n"],"names":["HdsLayoutFlexDirectionValues","HdsLayoutFlexJustifyValues","HdsLayoutFlexAlignValues","HdsLayoutFlexGapValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,4BAA4B,0BAA5BA,4BAA4B,EAAA;EAA5BA,4BAA4B,CAAA,KAAA,CAAA,GAAA,KAAA;EAA5BA,4BAA4B,CAAA,QAAA,CAAA,GAAA,QAAA;AAAA,EAAA,OAA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Component from '@glimmer/component';
2
2
  import { assert } from '@ember/debug';
3
- import { HdsLayoutGridAlignValues, HdsLayoutGridGapValues } from './types.js';
3
+ import { HdsLayoutGridGapValues, HdsLayoutGridAlignValues } from './types.js';
4
4
  import { precompileTemplate } from '@ember/template-compilation';
5
5
  import { setComponentTemplate } from '@ember/component';
6
6
 
@@ -12,6 +12,7 @@ var TEMPLATE = precompileTemplate("{{!\n Copyright (c) HashiCorp, Inc.\n SPDX-
12
12
  */
13
13
 
14
14
  const ALIGNS = Object.values(HdsLayoutGridAlignValues);
15
+ const DEFAULT_GAP = HdsLayoutGridGapValues.Zero;
15
16
  const GAPS = Object.values(HdsLayoutGridGapValues);
16
17
  class HdsLayoutGrid extends Component {
17
18
  get componentTag() {
@@ -28,7 +29,7 @@ class HdsLayoutGrid extends Component {
28
29
  }
29
30
  get gap() {
30
31
  const {
31
- gap
32
+ gap = DEFAULT_GAP
32
33
  } = this.args;
33
34
  if (gap) {
34
35
  assert(`@gap for "Hds::Layout::Grid" must be a single value or an array of two values of one of the following: ${GAPS.join(', '
@@ -87,5 +88,5 @@ class HdsLayoutGrid extends Component {
87
88
  }
88
89
  setComponentTemplate(TEMPLATE, HdsLayoutGrid);
89
90
 
90
- export { ALIGNS, GAPS, HdsLayoutGrid as default };
91
+ export { ALIGNS, DEFAULT_GAP, GAPS, HdsLayoutGrid as default };
91
92
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/layout/grid/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsLayoutGridItemSignature } from '../grid/item.ts';\n\nimport { HdsLayoutGridAlignValues, HdsLayoutGridGapValues } from './types.ts';\n\nimport type {\n HdsLayoutGridAligns,\n HdsLayoutGridGaps,\n AvailableTagNames,\n AvailableElements,\n} from './types.ts';\n\nexport const ALIGNS: string[] = Object.values(HdsLayoutGridAlignValues);\nexport const GAPS: string[] = Object.values(HdsLayoutGridGapValues);\n\nexport interface HdsLayoutGridSignature {\n Args: {\n tag?: AvailableTagNames;\n columnMinWidth?: string;\n columnWidth?: string;\n align?: HdsLayoutGridAligns;\n gap?: HdsLayoutGridGaps | [HdsLayoutGridGaps, HdsLayoutGridGaps];\n };\n Blocks: {\n default: [\n {\n Item?: ComponentLike<HdsLayoutGridItemSignature>;\n },\n ];\n };\n Element: AvailableElements;\n}\n\nexport default class HdsLayoutGrid extends Component<HdsLayoutGridSignature> {\n get componentTag(): AvailableTagNames {\n return this.args.tag ?? 'div';\n }\n\n get align(): HdsLayoutGridAligns | undefined {\n const { align } = this.args;\n\n if (align) {\n assert(\n `@align for \"Hds::Layout::Grid\" must be one of the following: ${ALIGNS.join(\n ', '\n )}; received: ${align}`,\n ALIGNS.includes(align)\n );\n }\n\n return align;\n }\n\n get gap():\n | [HdsLayoutGridGaps]\n | [HdsLayoutGridGaps, HdsLayoutGridGaps]\n | undefined {\n const { gap } = this.args;\n\n if (gap) {\n assert(\n `@gap for \"Hds::Layout::Grid\" must be a single value or an array of two values of one of the following: ${GAPS.join(\n ', '\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n )}; received: ${gap}`,\n (!Array.isArray(gap) && GAPS.includes(gap)) ||\n (Array.isArray(gap) &&\n gap.length === 2 &&\n GAPS.includes(gap[0]) &&\n GAPS.includes(gap[1]))\n );\n return Array.isArray(gap) ? gap : [gap];\n } else {\n return undefined;\n }\n }\n\n /*\n LOGIC:\n\n If columnMinWidth is passed in:\n 1) we set --hds-layout-grid-column-min-width to the passed in value\n 2) We use the fallback value of \"auto-fit\" for --hds-layout-grid-column-fill-type (reults in a more fluid layout)\n\n If columnWidth is passed in:\n 1) we set --hds-layout-grid-column-min-width to the passed in value\n 2) we set --hds-layout-grid-column-fill-type to \"auto-fill\" (results in a more fixed layout)\n\n If both columnMinWidth & columnWidth are passed in:\n 1) We throw an error, as it doesn't make sense in the context of a CSS grid layout (too complex to determine which to use & desired behavior)\n */\n get inlineStyles(): Record<string, unknown> {\n const inlineStyles: {\n '--hds-layout-grid-column-min-width'?: string;\n '--hds-layout-grid-column-fill-type'?: string;\n } = {};\n\n // if both columnMinWidth and columnWidth are passed in, we throw an error\n assert(\n `@columnMinWidth and @columnWidth for \"Hds::Layout::Grid\" cannot be used together`,\n !(this.args.columnMinWidth && this.args.columnWidth)\n );\n\n if (this.args.columnMinWidth) {\n inlineStyles['--hds-layout-grid-column-min-width'] =\n this.args.columnMinWidth;\n } else if (this.args.columnWidth) {\n inlineStyles['--hds-layout-grid-column-min-width'] =\n this.args.columnWidth;\n inlineStyles['--hds-layout-grid-column-fill-type'] = 'auto-fill';\n }\n\n return inlineStyles;\n }\n\n get classNames(): string {\n const classes = ['hds-layout-grid'];\n\n // add a class based on the @align argument\n if (this.align) {\n classes.push(`hds-layout-grid--align-items-${this.align}`);\n }\n\n // add a class based on the @gap argument\n if (this.gap) {\n if (this.gap.length === 2) {\n classes.push(`hds-layout-grid--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-grid--column-gap-${this.gap[1]}`);\n } else if (this.gap.length === 1) {\n classes.push(`hds-layout-grid--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-grid--column-gap-${this.gap[0]}`);\n }\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ALIGNS","Object","values","HdsLayoutGridAlignValues","GAPS","HdsLayoutGridGapValues","HdsLayoutGrid","Component","componentTag","args","tag","align","assert","join","includes","gap","Array","isArray","length","undefined","inlineStyles","columnMinWidth","columnWidth","classNames","classes","push","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AAiBO,MAAMA,MAAgB,GAAGC,MAAM,CAACC,MAAM,CAACC,wBAAwB;AAC/D,MAAMC,IAAc,GAAGH,MAAM,CAACC,MAAM,CAACG,sBAAsB;AAoBnD,MA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AC,CAA+B,4BAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;AAC5D;AACF;AAEA,IAAA,OAAOS,OAAO,CAACX,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACa,oBAAA,CAAAC,QAAA,EAvGoBrB,aAAa,CAAA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../../../src/components/hds/layout/grid/index.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nimport Component from '@glimmer/component';\nimport { assert } from '@ember/debug';\n\nimport type { ComponentLike } from '@glint/template';\nimport type { HdsLayoutGridItemSignature } from '../grid/item.ts';\n\nimport { HdsLayoutGridAlignValues, HdsLayoutGridGapValues } from './types.ts';\n\nimport type {\n HdsLayoutGridAligns,\n HdsLayoutGridGaps,\n AvailableTagNames,\n AvailableElements,\n} from './types.ts';\n\nexport const ALIGNS: string[] = Object.values(HdsLayoutGridAlignValues);\nexport const DEFAULT_GAP = HdsLayoutGridGapValues.Zero;\nexport const GAPS: string[] = Object.values(HdsLayoutGridGapValues);\n\nexport interface HdsLayoutGridSignature {\n Args: {\n tag?: AvailableTagNames;\n columnMinWidth?: string;\n columnWidth?: string;\n align?: HdsLayoutGridAligns;\n gap?: HdsLayoutGridGaps | [HdsLayoutGridGaps, HdsLayoutGridGaps];\n };\n Blocks: {\n default: [\n {\n Item?: ComponentLike<HdsLayoutGridItemSignature>;\n },\n ];\n };\n Element: AvailableElements;\n}\n\nexport default class HdsLayoutGrid extends Component<HdsLayoutGridSignature> {\n get componentTag(): AvailableTagNames {\n return this.args.tag ?? 'div';\n }\n\n get align(): HdsLayoutGridAligns | undefined {\n const { align } = this.args;\n\n if (align) {\n assert(\n `@align for \"Hds::Layout::Grid\" must be one of the following: ${ALIGNS.join(\n ', '\n )}; received: ${align}`,\n ALIGNS.includes(align)\n );\n }\n\n return align;\n }\n\n get gap():\n | [HdsLayoutGridGaps]\n | [HdsLayoutGridGaps, HdsLayoutGridGaps]\n | undefined {\n const { gap = DEFAULT_GAP } = this.args;\n\n if (gap) {\n assert(\n `@gap for \"Hds::Layout::Grid\" must be a single value or an array of two values of one of the following: ${GAPS.join(\n ', '\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n )}; received: ${gap}`,\n (!Array.isArray(gap) && GAPS.includes(gap)) ||\n (Array.isArray(gap) &&\n gap.length === 2 &&\n GAPS.includes(gap[0]) &&\n GAPS.includes(gap[1]))\n );\n return Array.isArray(gap) ? gap : [gap];\n } else {\n return undefined;\n }\n }\n\n /*\n LOGIC:\n\n If columnMinWidth is passed in:\n 1) we set --hds-layout-grid-column-min-width to the passed in value\n 2) We use the fallback value of \"auto-fit\" for --hds-layout-grid-column-fill-type (reults in a more fluid layout)\n\n If columnWidth is passed in:\n 1) we set --hds-layout-grid-column-min-width to the passed in value\n 2) we set --hds-layout-grid-column-fill-type to \"auto-fill\" (results in a more fixed layout)\n\n If both columnMinWidth & columnWidth are passed in:\n 1) We throw an error, as it doesn't make sense in the context of a CSS grid layout (too complex to determine which to use & desired behavior)\n */\n get inlineStyles(): Record<string, unknown> {\n const inlineStyles: {\n '--hds-layout-grid-column-min-width'?: string;\n '--hds-layout-grid-column-fill-type'?: string;\n } = {};\n\n // if both columnMinWidth and columnWidth are passed in, we throw an error\n assert(\n `@columnMinWidth and @columnWidth for \"Hds::Layout::Grid\" cannot be used together`,\n !(this.args.columnMinWidth && this.args.columnWidth)\n );\n\n if (this.args.columnMinWidth) {\n inlineStyles['--hds-layout-grid-column-min-width'] =\n this.args.columnMinWidth;\n } else if (this.args.columnWidth) {\n inlineStyles['--hds-layout-grid-column-min-width'] =\n this.args.columnWidth;\n inlineStyles['--hds-layout-grid-column-fill-type'] = 'auto-fill';\n }\n\n return inlineStyles;\n }\n\n get classNames(): string {\n const classes = ['hds-layout-grid'];\n\n // add a class based on the @align argument\n if (this.align) {\n classes.push(`hds-layout-grid--align-items-${this.align}`);\n }\n\n // add a class based on the @gap argument\n if (this.gap) {\n if (this.gap.length === 2) {\n classes.push(`hds-layout-grid--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-grid--column-gap-${this.gap[1]}`);\n } else if (this.gap.length === 1) {\n classes.push(`hds-layout-grid--row-gap-${this.gap[0]}`);\n classes.push(`hds-layout-grid--column-gap-${this.gap[0]}`);\n }\n }\n\n return classes.join(' ');\n }\n}\n"],"names":["ALIGNS","Object","values","HdsLayoutGridAlignValues","DEFAULT_GAP","HdsLayoutGridGapValues","Zero","GAPS","HdsLayoutGrid","Component","componentTag","args","tag","align","assert","join","includes","gap","Array","isArray","length","undefined","inlineStyles","columnMinWidth","columnWidth","classNames","classes","push","setComponentTemplate","TEMPLATE"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;;AAiBO,MAAMA,MAAgB,GAAGC,MAAM,CAACC,MAAM,CAACC,wBAAwB;AACzDC,MAAAA,WAAW,GAAGC,sBAAsB,CAACC;AAC3C,MAAMC,IAAc,GAAGN,MAAM,CAACC,MAAM,CAACG,sBAAsB;AAoBnD,MAAMG,aAAa,SAASC,SAAS,CAAyB;EAC3E,IAAIC,YAAYA,GAAsB;AACpC,IAAA,OAAO,IAAI,CAACC,IAAI,CAACC,GAAG,IAAI,KAAK;AAC/B;EAEA,IAAIC,KAAKA,GAAoC;IAC3C,MAAM;AAAEA,MAAAA;KAAO,GAAG,IAAI,CAACF,IAAI;AAE3B,IAAA,IAAIE,KAAK,EAAE;AACTC,MAAAA,MAAM,CACJ,CAAgEd,6DAAAA,EAAAA,MAAM,CAACe,IAAI,CACzE,IACF,CAAC,CAAA,YAAA,EAAeF,KAAK,CAAA,CAAE,EACvBb,MAAM,CAACgB,QAAQ,CAACH,KAAK,CACvB,CAAC;AACH;AAEA,IAAA,OAAOA,KAAK;AACd;EAEA,IAAII,GAAGA,GAGO;IACZ,MAAM;AAAEA,MAAAA,GAAG,GAAGb;KAAa,GAAG,IAAI,CAACO,IAAI;AAEvC,IA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AAMC,OAAO,GAAG,CAAC,iBAAiB,CAAC;;AAEnC;IACA,IAAI,IAAI,CAACb,KAAK,EAAE;MACda,OAAO,CAACC,IAAI,CAAC,CAAA,6BAAA,EAAgC,IAAI,CAACd,KAAK,EAAE,CAAC;AAC5D;;AAEA;IACA,IAAI,IAAI,CAACI,GAAG,EAAE;AACZ,MAAA,IAAI,IAAI,CAACA,GAAG,CAACG,MAAM,KAAK,CAAC,EAAE;QACzBM,OAAO,CAACC,IAAI,CAAC,CAA4B,yBAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;QACvDS,OAAO,CAACC,IAAI,CAAC,CAA+B,4BAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;OAC3D,MAAM,IAAI,IAAI,CAACA,GAAG,CAACG,MAAM,KAAK,CAAC,EAAE;QAChCM,OAAO,CAACC,IAAI,CAAC,CAA4B,yBAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;QACvDS,OAAO,CAACC,IAAI,CAAC,CAA+B,4BAAA,EAAA,IAAI,CAACV,GAAG,CAAC,CAAC,CAAC,CAAA,CAAE,CAAC;AAC5D;AACF;AAEA,IAAA,OAAOS,OAAO,CAACX,IAAI,CAAC,GAAG,CAAC;AAC1B;AACF;AAACa,oBAAA,CAAAC,QAAA,EAvGoBrB,aAAa,CAAA;;;;"}
@@ -11,6 +11,7 @@ let HdsLayoutGridAlignValues = /*#__PURE__*/function (HdsLayoutGridAlignValues)
11
11
  return HdsLayoutGridAlignValues;
12
12
  }({});
13
13
  let HdsLayoutGridGapValues = /*#__PURE__*/function (HdsLayoutGridGapValues) {
14
+ HdsLayoutGridGapValues["Zero"] = "0";
14
15
  HdsLayoutGridGapValues["Four"] = "4";
15
16
  HdsLayoutGridGapValues["Eight"] = "8";
16
17
  HdsLayoutGridGapValues["Twelve"] = "12";
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sources":["../../../../../src/components/hds/layout/grid/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsLayoutGridAlignValues {\n Start = 'start',\n Center = 'center',\n End = 'end',\n Stretch = 'stretch',\n}\n\nexport type HdsLayoutGridAligns = `${HdsLayoutGridAlignValues}`;\n\nexport enum HdsLayoutGridGapValues {\n 'Four' = '4',\n 'Eight' = '8',\n 'Twelve' = '12',\n 'Sixteen' = '16',\n 'TwentyFour' = '24',\n 'ThirtyTwo' = '32',\n 'FortyEight' = '48',\n}\n\nexport type HdsLayoutGridGaps = `${HdsLayoutGridGapValues}`;\n\n// A list of all existing tag names in the HTMLElementTagNameMap interface\nexport type AvailableTagNames = keyof HTMLElementTagNameMap;\n// A union of all types in the HTMLElementTagNameMap interface\nexport type AvailableElements =\n HTMLElementTagNameMap[keyof HTMLElementTagNameMap];\n"],"names":["HdsLayoutGridAlignValues","HdsLayoutGridGapValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,wBAAwB,0BAAxBA,wBAAwB,EAAA;EAAxBA,wBAAwB,CAAA,OAAA,CAAA,GAAA,OAAA;EAAxBA,wBAAwB,CAAA,QAAA,CAAA,GAAA,QAAA;EAAxBA,wBAAwB,CAAA,KAAA,CAAA,GAAA,KAAA;EAAxBA,wBAAwB,CAAA,SAAA,CAAA,GAAA,SAAA;AAAA,EAAA,OAAxBA,wBAAwB;AAAA,CAAA,CAAA,EAAA;AASxBC,IAAAA,sBAAsB,0BAAtBA,sBAAsB,EAAA;EAAtBA,sBAAsB,CAAA,MAAA,CAAA,GAAA,GAAA;EAAtBA,sBAAsB,CAAA,OAAA,CAAA,GAAA,GAAA;EAAtBA,sBAAsB,CAAA,QAAA,CAAA,GAAA,IAAA;EAAtBA,sBAAsB,CAAA,SAAA,CAAA,GAAA,IAAA;EAAtBA,sBAAsB,CAAA,YAAA,CAAA,GAAA,IAAA;EAAtBA,sBAAsB,CAAA,WAAA,CAAA,GAAA,IAAA;EAAtBA,sBAAsB,CAAA,YAAA,CAAA,GAAA,IAAA;AAAA,EAAA,OAAtBA,sBAAsB;AAAA,CAAA,CAAA,EAAA;;AAYlC;;AAEA;;;;"}
1
+ {"version":3,"file":"types.js","sources":["../../../../../src/components/hds/layout/grid/types.ts"],"sourcesContent":["/**\n * Copyright (c) HashiCorp, Inc.\n * SPDX-License-Identifier: MPL-2.0\n */\n\nexport enum HdsLayoutGridAlignValues {\n Start = 'start',\n Center = 'center',\n End = 'end',\n Stretch = 'stretch',\n}\n\nexport type HdsLayoutGridAligns = `${HdsLayoutGridAlignValues}`;\n\nexport enum HdsLayoutGridGapValues {\n 'Zero' = '0',\n 'Four' = '4',\n 'Eight' = '8',\n 'Twelve' = '12',\n 'Sixteen' = '16',\n 'TwentyFour' = '24',\n 'ThirtyTwo' = '32',\n 'FortyEight' = '48',\n}\n\nexport type HdsLayoutGridGaps = `${HdsLayoutGridGapValues}`;\n\n// A list of all existing tag names in the HTMLElementTagNameMap interface\nexport type AvailableTagNames = keyof HTMLElementTagNameMap;\n// A union of all types in the HTMLElementTagNameMap interface\nexport type AvailableElements =\n HTMLElementTagNameMap[keyof HTMLElementTagNameMap];\n"],"names":["HdsLayoutGridAlignValues","HdsLayoutGridGapValues"],"mappings":"AAAA;AACA;AACA;AACA;;AAEYA,IAAAA,wBAAwB,0BAAxBA,wBAAwB,EAAA;EAAxBA,wBAAwB,CAAA,OAAA,CAAA,GAAA,OAAA;EAAxBA,wBAAwB,CAAA,QAAA,CAAA,GAAA,QAAA;EAAxBA,wBAAwB,CAAA,KAAA,CAAA,GAAA,KAAA;EAAxBA,wBAAwB,CAAA,SAAA,CAAA,GAAA,SAAA;AAAA,EAAA,OAAxBA,wBAAwB;AAAA,CAAA,CAAA,EAAA;AASxBC,IAAAA,sBAAsB,0BAAtBA,sBAAsB,EAAA;EAAtBA,sBAAsB,CAAA,MAAA,CAAA,GAAA,GAAA;EAAtBA,sBAAsB,CAAA,MAAA,CAAA,GAAA,GAAA;EAAtBA,sBAAsB,CAAA,OAAA,CAAA,GAAA,GAAA;EAAtBA,sBAAsB,CAAA,QAAA,CAAA,GAAA,IAAA;EAAtBA,sBAAsB,CAAA,SAAA,CAAA,GAAA,IAAA;EAAtBA,sBAAsB,CAAA,YAAA,CAAA,GAAA,IAAA;EAAtBA,sBAAsB,CAAA,WAAA,CAAA,GAAA,IAAA;EAAtBA,sBAAsB,CAAA,YAAA,CAAA,GAAA,IAAA;AAAA,EAAA,OAAtBA,sBAAsB;AAAA,CAAA,CAAA,EAAA;;AAalC;;AAEA;;;;"}
@@ -6705,7 +6705,7 @@ button.hds-button[href]::after {
6705
6705
  */
6706
6706
  .hds-layout-flex {
6707
6707
  display: flex;
6708
- gap: var(--hds-layout-flex-row-gap, 0) var(--hds-layout-flex-column-gap, 0);
6708
+ gap: var(--hds-layout-flex-row-gap) var(--hds-layout-flex-column-gap);
6709
6709
  }
6710
6710
 
6711
6711
  .hds-layout-flex--is-inline {
@@ -6768,6 +6768,10 @@ button.hds-button[href]::after {
6768
6768
  align-items: stretch;
6769
6769
  }
6770
6770
 
6771
+ .hds-layout-flex--row-gap-0 {
6772
+ --hds-layout-flex-row-gap: 0px;
6773
+ }
6774
+
6771
6775
  .hds-layout-flex--row-gap-4 {
6772
6776
  --hds-layout-flex-row-gap: 4px;
6773
6777
  }
@@ -6796,6 +6800,10 @@ button.hds-button[href]::after {
6796
6800
  --hds-layout-flex-row-gap: 48px;
6797
6801
  }
6798
6802
 
6803
+ .hds-layout-flex--column-gap-0 {
6804
+ --hds-layout-flex-column-gap: 0px;
6805
+ }
6806
+
6799
6807
  .hds-layout-flex--column-gap-4 {
6800
6808
  --hds-layout-flex-column-gap: 4px;
6801
6809
  }
@@ -6853,9 +6861,10 @@ button.hds-button[href]::after {
6853
6861
  * SPDX-License-Identifier: MPL-2.0
6854
6862
  */
6855
6863
  .hds-layout-grid {
6864
+ --hds-layout-grid-column-min-width: 0px;
6856
6865
  display: grid;
6857
- grid-template-columns: repeat(var(--hds-layout-grid-column-fill-type, auto-fit), minmax(calc(var(--hds-layout-grid-column-min-width, 0px) - var(--hds-layout-grid-column-gap, 0px)), 1fr));
6858
- gap: var(--hds-layout-grid-row-gap, 0) var(--hds-layout-grid-column-gap, 0);
6866
+ grid-template-columns: repeat(var(--hds-layout-grid-column-fill-type, auto-fit), minmax(calc(var(--hds-layout-grid-column-min-width) - var(--hds-layout-grid-column-gap)), 1fr));
6867
+ gap: var(--hds-layout-grid-row-gap) var(--hds-layout-grid-column-gap);
6859
6868
  }
6860
6869
 
6861
6870
  .hds-layout-grid--align-items-start {
@@ -6874,6 +6883,10 @@ button.hds-button[href]::after {
6874
6883
  align-items: stretch;
6875
6884
  }
6876
6885
 
6886
+ .hds-layout-grid--row-gap-0 {
6887
+ --hds-layout-grid-row-gap: 0px;
6888
+ }
6889
+
6877
6890
  .hds-layout-grid--row-gap-4 {
6878
6891
  --hds-layout-grid-row-gap: 4px;
6879
6892
  }
@@ -6902,6 +6915,10 @@ button.hds-button[href]::after {
6902
6915
  --hds-layout-grid-row-gap: 48px;
6903
6916
  }
6904
6917
 
6918
+ .hds-layout-grid--column-gap-0 {
6919
+ --hds-layout-grid-column-gap: 0px;
6920
+ }
6921
+
6905
6922
  .hds-layout-grid--column-gap-4 {
6906
6923
  --hds-layout-grid-column-gap: 4px;
6907
6924
  }
@@ -13,7 +13,7 @@
13
13
  // Note: The gap style is defined here to avoid setting it repeatedly for the gap size variants defined below.
14
14
  // For the gap size variants, we override the value of the gap custom properties to set the desired sizes.
15
15
  // These variables can be used by the consumers as an escape hatch if they need to set non-standard gap values (but adds a bit of friction to it)
16
- gap: var(--hds-layout-flex-row-gap, 0) var(--hds-layout-flex-column-gap, 0);
16
+ gap: var(--hds-layout-flex-row-gap) var(--hds-layout-flex-column-gap);
17
17
  }
18
18
 
19
19
  // inline
@@ -88,6 +88,11 @@
88
88
 
89
89
  // gap
90
90
 
91
+ // row
92
+ .hds-layout-flex--row-gap-0 {
93
+ --hds-layout-flex-row-gap: 0px;
94
+ }
95
+
91
96
  .hds-layout-flex--row-gap-4 {
92
97
  --hds-layout-flex-row-gap: 4px;
93
98
  }
@@ -116,6 +121,11 @@
116
121
  --hds-layout-flex-row-gap: 48px;
117
122
  }
118
123
 
124
+ // column
125
+ .hds-layout-flex--column-gap-0 {
126
+ --hds-layout-flex-column-gap: 0px;
127
+ }
128
+
119
129
  .hds-layout-flex--column-gap-4 {
120
130
  --hds-layout-flex-column-gap: 4px;
121
131
  }
@@ -8,20 +8,23 @@
8
8
  //
9
9
 
10
10
  .hds-layout-grid {
11
+ // Note: "Unitless 0" <length>s aren’t supported in math functions so we use 0px as a default value within calc()
12
+ // https://drafts.csswg.org/css-values/#calc-type-checking
13
+ // We initialize the variable here to prevent inheritance issues in nested grids
14
+ --hds-layout-grid-column-min-width: 0px;
15
+
11
16
  display: grid;
12
- // The column gap value is subtracted from the column-min-width to prevent overflow & simplify API for consumers
13
17
 
14
- // Note: "Unitless 0" <length>s aren’t supported in math functions so we use 0px as a fallback value within calc()
15
- // https://drafts.csswg.org/css-values/#calc-type-checking
18
+ // The column gap value is subtracted from the column-min-width to prevent overflow & simplify API for consumers
16
19
  grid-template-columns: repeat(
17
20
  var(--hds-layout-grid-column-fill-type, auto-fit),
18
- minmax(calc(var(--hds-layout-grid-column-min-width, 0px) - var(--hds-layout-grid-column-gap, 0px)), 1fr)
21
+ minmax(calc(var(--hds-layout-grid-column-min-width) - var(--hds-layout-grid-column-gap)), 1fr)
19
22
  );
20
23
 
21
24
  // Note: The gap style is defined here to avoid setting it repeatedly for the gap size variants defined below.
22
25
  // For the gap size variants, we override the value of the gap custom properties to set the desired sizes.
23
26
  // These variables can be used by the consumers as an escape hatch if they need to set non-standard gap values (but adds a bit of friction to it)
24
- gap: var(--hds-layout-grid-row-gap, 0) var(--hds-layout-grid-column-gap, 0);
27
+ gap: var(--hds-layout-grid-row-gap) var(--hds-layout-grid-column-gap);
25
28
  }
26
29
 
27
30
  // align
@@ -46,6 +49,11 @@
46
49
 
47
50
  // We set the values of the gap custom properties overriding the default value of 0
48
51
 
52
+ // row
53
+ .hds-layout-grid--row-gap-0 {
54
+ --hds-layout-grid-row-gap: 0px;
55
+ }
56
+
49
57
  .hds-layout-grid--row-gap-4 {
50
58
  --hds-layout-grid-row-gap: 4px;
51
59
  }
@@ -74,6 +82,11 @@
74
82
  --hds-layout-grid-row-gap: 48px;
75
83
  }
76
84
 
85
+ // column
86
+ .hds-layout-grid--column-gap-0 {
87
+ --hds-layout-grid-column-gap: 0px;
88
+ }
89
+
77
90
  .hds-layout-grid--column-gap-4 {
78
91
  --hds-layout-grid-column-gap: 4px;
79
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashicorp/design-system-components",
3
- "version": "4.21.0",
3
+ "version": "4.22.0-rc-20250711180943",
4
4
  "description": "Helios Design System Components",
5
5
  "keywords": [
6
6
  "hashicorp",