Skip to content

Commit 23890ae

Browse files
committed
Improve descriptions for layout and structure components
1 parent 45466e5 commit 23890ae

File tree

13 files changed

+591
-241
lines changed

13 files changed

+591
-241
lines changed

packages/ui-extensions/src/surfaces/checkout/components/Box.d.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export type ReducedBorderSizeKeyword = Extract<BorderSizeKeyword, 'none' | 'base
2626
* - `base`: The standard border color for most contexts.
2727
*/
2828
export type ReducedColorKeyword = Extract<ColorKeyword, 'base'>;
29+
/**
30+
* A shorthand string for specifying border properties. Accepts a size alone (`'base'`), size with color (`'base base'`), or size with color and style (`'base base dashed'`). Omitted values use their defaults.
31+
*/
2932
export type BorderShorthand = ReducedBorderSizeKeyword | `${ReducedBorderSizeKeyword} ${ReducedColorKeyword}` | `${ReducedBorderSizeKeyword} ${ReducedColorKeyword} ${BorderStyleKeyword}`;
3033
/**
3134
* Used when an element does not have children.
@@ -44,13 +47,44 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement> extends Base
4447

4548
declare const tagName = "s-box";
4649
/**
47-
* The element props interface for the Box component.
4850
* @publicDocs
4951
*/
5052
export interface BoxElementProps extends Pick<BoxProps$1, 'accessibilityLabel' | 'accessibilityRole' | 'accessibilityVisibility' | 'background' | 'blockSize' | 'border' | 'borderRadius' | 'borderStyle' | 'borderWidth' | 'display' | 'id' | 'inlineSize' | 'maxBlockSize' | 'maxInlineSize' | 'minBlockSize' | 'minInlineSize' | 'overflow' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart'> {
53+
/**
54+
* The background color of the box.
55+
*
56+
* - `base`: The standard background color for general content areas.
57+
* - `subdued`: A muted background for secondary or supporting content.
58+
* - `transparent`: No background color (the default).
59+
*
60+
* @default 'transparent'
61+
*/
5162
background?: Extract<BoxProps$1['background'], 'transparent' | 'subdued' | 'base'>;
63+
/**
64+
* A shorthand for setting the border width, color, and style in a single property. Individual border properties (`borderWidth`, `borderStyle`) can override values set here.
65+
*
66+
* @default 'none'
67+
*/
5268
border?: BorderShorthand;
69+
/**
70+
* The thickness of the border on all sides. Supports 1-to-4-value shorthand syntax for specifying different widths per side. Overrides the width value set by `border`.
71+
*
72+
* @default '' - meaning no override
73+
*/
5374
borderWidth?: MaybeAllValuesShorthandProperty<ReducedBorderSizeKeyword> | '';
75+
/**
76+
* The roundedness of the box's corners.
77+
*
78+
* - `none`: Sharp corners with no rounding.
79+
* - `small-100` / `small`: Subtle rounding for compact elements.
80+
* - `base`: Standard rounding for most use cases.
81+
* - `large` / `large-100`: More pronounced rounding for prominent containers.
82+
* - `max`: Maximum rounding, creating a pill or circular shape.
83+
*
84+
* Supports 1-to-4-value shorthand syntax for specifying different radii per corner.
85+
*
86+
* @default 'none'
87+
*/
5488
borderRadius?: MaybeAllValuesShorthandProperty<Extract<BoxProps$1['borderRadius'], 'none' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'max'>>;
5589
}
5690
export interface BoxElement extends BoxElementProps, Omit<HTMLElement, 'id'> {

packages/ui-extensions/src/surfaces/checkout/components/Divider.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement> extends Base
2626
}
2727

2828
declare const tagName = "s-divider";
29-
/**
30-
* The element props interface for the Divider component.
31-
* @publicDocs
32-
*/
29+
/** @publicDocs */
3330
export interface DividerElementProps extends Pick<DividerProps$1, 'direction' | 'id'> {
3431
}
3532
export interface DividerElement extends DividerElementProps, Omit<HTMLElement, 'id'> {

packages/ui-extensions/src/surfaces/checkout/components/Grid.d.ts

Lines changed: 122 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,61 @@
1010
/// <reference lib="DOM" />
1111
import type {GridProps$1,MaybeResponsive, MaybeAllValuesShorthandProperty,BorderSizeKeyword, BorderStyleKeyword,AlignContentKeyword, AlignItemsKeyword, JustifyContentKeyword, JustifyItemsKeyword,ColorKeyword} from './components-shared.d.ts';
1212

13+
/**
14+
* The subset of `align-content` values available for the grid component.
15+
*
16+
* - `center`: Packs rows toward the center of the grid.
17+
* - `start`: Packs rows toward the start of the block axis.
18+
* - `end`: Packs rows toward the end of the block axis.
19+
* - `normal`: Default browser behavior.
20+
* - `space-between`: Distributes rows evenly with no space at the edges.
21+
* - `space-around`: Distributes rows evenly with equal space around each.
22+
* - `space-evenly`: Distributes rows with equal space between and at the edges.
23+
* - `stretch`: Stretches rows to fill the available space.
24+
*
25+
* @publicDocs
26+
*/
1327
export type ReducedAlignContentKeyword = Extract<AlignContentKeyword, 'normal' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'center' | 'start' | 'end'>;
28+
/**
29+
* The subset of `align-items` values available for the grid component.
30+
*
31+
* - `center`: Centers items along the block axis.
32+
* - `start`: Aligns items to the start of the block axis.
33+
* - `end`: Aligns items to the end of the block axis.
34+
* - `normal`: Default browser behavior.
35+
* - `baseline`: Aligns items along their text baseline.
36+
* - `stretch`: Stretches items to fill the cell along the block axis.
37+
*
38+
* @publicDocs
39+
*/
1440
export type ReducedAlignItemsKeyword = Extract<AlignItemsKeyword, 'normal' | 'stretch' | 'baseline' | 'center' | 'start' | 'end'>;
41+
/**
42+
* The subset of `justify-content` values available for the grid component.
43+
*
44+
* - `center`: Packs columns toward the center of the grid.
45+
* - `start`: Packs columns toward the start of the inline axis.
46+
* - `end`: Packs columns toward the end of the inline axis.
47+
* - `normal`: Default browser behavior.
48+
* - `space-between`: Distributes columns evenly with no space at the edges.
49+
* - `space-around`: Distributes columns evenly with equal space around each.
50+
* - `space-evenly`: Distributes columns with equal space between and at the edges.
51+
* - `stretch`: Stretches columns to fill the available space.
52+
*
53+
* @publicDocs
54+
*/
1555
export type ReducedJustifyContentKeyword = Extract<JustifyContentKeyword, 'normal' | 'space-between' | 'space-around' | 'space-evenly' | 'stretch' | 'center' | 'start' | 'end'>;
56+
/**
57+
* The subset of `justify-items` values available for the grid component.
58+
*
59+
* - `center`: Centers items along the inline axis.
60+
* - `start`: Aligns items to the start of the inline axis.
61+
* - `end`: Aligns items to the end of the inline axis.
62+
* - `normal`: Default browser behavior.
63+
* - `baseline`: Aligns items along their text baseline.
64+
* - `stretch`: Stretches items to fill the cell along the inline axis.
65+
*
66+
* @publicDocs
67+
*/
1668
export type ReducedJustifyItemsKeyword = Extract<JustifyItemsKeyword, 'normal' | 'stretch' | 'baseline' | 'center' | 'start' | 'end'>;
1769
/**
1870
* The subset of border size values available for this component.
@@ -30,6 +82,9 @@ export type ReducedBorderSizeKeyword = Extract<BorderSizeKeyword, 'none' | 'base
3082
* - `base`: The standard border color for most contexts.
3183
*/
3284
export type ReducedColorKeyword = Extract<ColorKeyword, 'base'>;
85+
/**
86+
* A shorthand string for specifying border properties. Accepts a size alone (`'base'`), size with color (`'base base'`), or size with color and style (`'base base dashed'`). Omitted values use their defaults.
87+
*/
3388
export type BorderShorthand = ReducedBorderSizeKeyword | `${ReducedBorderSizeKeyword} ${ReducedColorKeyword}` | `${ReducedBorderSizeKeyword} ${ReducedColorKeyword} ${BorderStyleKeyword}`;
3489
/**
3590
* Used when an element does not have children.
@@ -48,20 +103,86 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement> extends Base
48103

49104
declare const tagName = "s-grid";
50105
/**
51-
* The element props interface for the Grid component.
52106
* @publicDocs
53107
*/
54108
export interface GridElementProps extends Pick<GridProps$1, 'accessibilityLabel' | 'accessibilityRole' | 'accessibilityVisibility' | 'alignContent' | 'alignItems' | 'background' | 'blockSize' | 'border' | 'borderColor' | 'borderRadius' | 'borderStyle' | 'borderWidth' | 'columnGap' | 'display' | 'gap' | 'gridTemplateColumns' | 'gridTemplateRows' | 'id' | 'inlineSize' | 'justifyContent' | 'justifyItems' | 'maxBlockSize' | 'maxInlineSize' | 'minBlockSize' | 'minInlineSize' | 'overflow' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart' | 'placeContent' | 'placeItems' | 'rowGap'> {
109+
/**
110+
* Controls how the grid's rows are distributed along the block (column) axis when there is extra space. Set to an empty string to use the default.
111+
*
112+
* @default '' - meaning no override
113+
*/
55114
alignContent?: MaybeResponsive<ReducedAlignContentKeyword | ''>;
115+
/**
116+
* Aligns grid items along the block (column) axis. Set to an empty string to use the default.
117+
*
118+
* @default '' - meaning no override
119+
*/
56120
alignItems?: MaybeResponsive<ReducedAlignItemsKeyword | ''>;
121+
/**
122+
* The background color of the grid.
123+
*
124+
* - `base`: The standard background color for general content areas.
125+
* - `subdued`: A muted background for secondary or supporting content.
126+
* - `transparent`: No background color (the default).
127+
*
128+
* @default 'transparent'
129+
*/
57130
background?: Extract<GridProps$1['background'], 'transparent' | 'subdued' | 'base'>;
131+
/**
132+
* A shorthand for setting the border width, color, and style in a single property. Individual border properties (`borderWidth`, `borderStyle`, `borderColor`) can override values set here.
133+
*
134+
* @default 'none'
135+
*/
58136
border?: BorderShorthand;
137+
/**
138+
* The color of the border using the design system's color scale. Overrides the color value set by `border`.
139+
*
140+
* @default '' - meaning no override
141+
*/
59142
borderColor?: ReducedColorKeyword | '';
143+
/**
144+
* The thickness of the border on all sides. Supports 1-to-4-value shorthand syntax for specifying different widths per side. Overrides the width value set by `border`.
145+
*
146+
* @default '' - meaning no override
147+
*/
60148
borderWidth?: MaybeAllValuesShorthandProperty<ReducedBorderSizeKeyword> | '';
149+
/**
150+
* The roundedness of the grid's corners.
151+
*
152+
* - `none`: Sharp corners with no rounding.
153+
* - `small-100` / `small`: Subtle rounding for compact elements.
154+
* - `base`: Standard rounding for most use cases.
155+
* - `large` / `large-100`: More pronounced rounding for prominent containers.
156+
* - `max`: Maximum rounding, creating a pill or circular shape.
157+
*
158+
* Supports 1-to-4-value shorthand syntax for specifying different radii per corner.
159+
*
160+
* @default 'none'
161+
*/
61162
borderRadius?: MaybeAllValuesShorthandProperty<Extract<GridProps$1['borderRadius'], 'none' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'max'>>;
163+
/**
164+
* Controls how the grid's columns are distributed along the inline (row) axis when there is extra space. Set to an empty string to use the default.
165+
*
166+
* @default '' - meaning no override
167+
*/
62168
justifyContent?: MaybeResponsive<ReducedJustifyContentKeyword | ''>;
169+
/**
170+
* Aligns grid items along the inline (row) axis. Set to an empty string to use the default.
171+
*
172+
* @default '' - meaning no override
173+
*/
63174
justifyItems?: MaybeResponsive<ReducedJustifyItemsKeyword | ''>;
175+
/**
176+
* A shorthand for `justifyContent` and `alignContent` that sets both distribution axes at once.
177+
*
178+
* @default 'normal normal'
179+
*/
64180
placeContent?: MaybeResponsive<`${ReducedAlignContentKeyword} ${ReducedJustifyContentKeyword}` | ReducedAlignContentKeyword>;
181+
/**
182+
* A shorthand for `justifyItems` and `alignItems` that sets both alignment axes at once.
183+
*
184+
* @default 'normal normal'
185+
*/
65186
placeItems?: MaybeResponsive<`${ReducedAlignItemsKeyword} ${ReducedJustifyItemsKeyword}` | ReducedAlignItemsKeyword>;
66187
}
67188
export interface GridElement extends GridElementProps, Omit<HTMLElement, 'id'> {

packages/ui-extensions/src/surfaces/checkout/components/GridItem.d.ts

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export type ReducedBorderSizeKeyword = Extract<BorderSizeKeyword, 'none' | 'base
2626
* - `base`: The standard border color for most contexts.
2727
*/
2828
export type ReducedColorKeyword = Extract<ColorKeyword, 'base'>;
29+
/**
30+
* A shorthand string for specifying border properties. Accepts a size alone (`'base'`), size with color (`'base base'`), or size with color and style (`'base base dashed'`). Omitted values use their defaults.
31+
*/
2932
export type BorderShorthand = ReducedBorderSizeKeyword | `${ReducedBorderSizeKeyword} ${ReducedColorKeyword}` | `${ReducedBorderSizeKeyword} ${ReducedColorKeyword} ${BorderStyleKeyword}`;
3033
/**
3134
* Used when an element does not have children.
@@ -44,14 +47,50 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement> extends Base
4447

4548
declare const tagName = "s-grid-item";
4649
/**
47-
* The element props interface for the GridItem component.
4850
* @publicDocs
4951
*/
5052
export interface GridItemElementProps extends Pick<GridItemProps$1, 'accessibilityLabel' | 'accessibilityRole' | 'accessibilityVisibility' | 'background' | 'blockSize' | 'border' | 'borderColor' | 'borderRadius' | 'borderStyle' | 'borderWidth' | 'display' | 'gridColumn' | 'gridRow' | 'id' | 'inlineSize' | 'maxBlockSize' | 'maxInlineSize' | 'minBlockSize' | 'minInlineSize' | 'overflow' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart'> {
53+
/**
54+
* The background color of the grid item.
55+
*
56+
* - `base`: The standard background color for general content areas.
57+
* - `subdued`: A muted background for secondary or supporting content.
58+
* - `transparent`: No background color (the default).
59+
*
60+
* @default 'transparent'
61+
*/
5162
background?: Extract<GridItemProps$1['background'], 'transparent' | 'subdued' | 'base'>;
63+
/**
64+
* A shorthand for setting the border width, color, and style in a single property. Individual border properties (`borderWidth`, `borderStyle`, `borderColor`) can override values set here.
65+
*
66+
* @default 'none'
67+
*/
5268
border?: BorderShorthand;
69+
/**
70+
* The color of the border using the design system's color scale. Overrides the color value set by `border`.
71+
*
72+
* @default '' - meaning no override
73+
*/
5374
borderColor?: ReducedColorKeyword | '';
75+
/**
76+
* The thickness of the border on all sides. Supports 1-to-4-value shorthand syntax for specifying different widths per side. Overrides the width value set by `border`.
77+
*
78+
* @default '' - meaning no override
79+
*/
5480
borderWidth?: MaybeAllValuesShorthandProperty<ReducedBorderSizeKeyword> | '';
81+
/**
82+
* The roundedness of the grid item's corners.
83+
*
84+
* - `none`: Sharp corners with no rounding.
85+
* - `small-100` / `small`: Subtle rounding for compact elements.
86+
* - `base`: Standard rounding for most use cases.
87+
* - `large` / `large-100`: More pronounced rounding for prominent containers.
88+
* - `max`: Maximum rounding, creating a pill or circular shape.
89+
*
90+
* Supports 1-to-4-value shorthand syntax for specifying different radii per corner.
91+
*
92+
* @default 'none'
93+
*/
5594
borderRadius?: MaybeAllValuesShorthandProperty<Extract<GridItemProps$1['borderRadius'], 'none' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'max'>>;
5695
}
5796
export interface GridItemElement extends GridItemElementProps, Omit<HTMLElement, 'id'> {

packages/ui-extensions/src/surfaces/checkout/components/QueryContainer.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement> extends Base
2626
}
2727

2828
declare const tagName = "s-query-container";
29-
/**
30-
* The element props interface for the QueryContainer component.
31-
* @publicDocs
32-
*/
29+
/** @publicDocs */
3330
export interface QueryContainerElementProps extends Pick<QueryContainerProps$1, 'containerName' | 'id'> {
3431
}
3532
export interface QueryContainerElement extends QueryContainerElementProps, Omit<HTMLElement, 'id'> {

packages/ui-extensions/src/surfaces/checkout/components/ScrollBox.d.ts

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ export type ReducedBorderSizeKeyword = Extract<BorderSizeKeyword, 'none' | 'base
2626
* - `base`: The standard border color for most contexts.
2727
*/
2828
export type ReducedColorKeyword = Extract<ColorKeyword, 'base'>;
29+
/**
30+
* A shorthand string for specifying border properties. Accepts a size alone (`'base'`), size with color (`'base base'`), or size with color and style (`'base base dashed'`). Omitted values use their defaults.
31+
*/
2932
export type BorderShorthand = ReducedBorderSizeKeyword | `${ReducedBorderSizeKeyword} ${ReducedColorKeyword}` | `${ReducedBorderSizeKeyword} ${ReducedColorKeyword} ${BorderStyleKeyword}`;
3033
/**
3134
* Used when an element does not have children.
@@ -44,14 +47,50 @@ export interface BaseElementPropsWithChildren<TClass = HTMLElement> extends Base
4447

4548
declare const tagName = "s-scroll-box";
4649
/**
47-
* The element props interface for the ScrollBox component.
4850
* @publicDocs
4951
*/
5052
export interface ScrollBoxElementProps extends Pick<ScrollBoxProps$1, 'accessibilityLabel' | 'accessibilityRole' | 'accessibilityVisibility' | 'background' | 'blockSize' | 'border' | 'borderColor' | 'borderRadius' | 'borderStyle' | 'borderWidth' | 'display' | 'id' | 'inlineSize' | 'maxBlockSize' | 'maxInlineSize' | 'minBlockSize' | 'minInlineSize' | 'overflow' | 'padding' | 'paddingBlock' | 'paddingBlockEnd' | 'paddingBlockStart' | 'paddingInline' | 'paddingInlineEnd' | 'paddingInlineStart'> {
53+
/**
54+
* The background color of the scroll box.
55+
*
56+
* - `base`: The standard background color for general content areas.
57+
* - `subdued`: A muted background for secondary or supporting content.
58+
* - `transparent`: No background color (the default).
59+
*
60+
* @default 'transparent'
61+
*/
5162
background?: Extract<ScrollBoxProps$1['background'], 'transparent' | 'subdued' | 'base'>;
63+
/**
64+
* A shorthand for setting the border width, color, and style in a single property. Individual border properties (`borderWidth`, `borderStyle`, `borderColor`) can override values set here.
65+
*
66+
* @default 'none'
67+
*/
5268
border?: BorderShorthand;
69+
/**
70+
* The color of the border using the design system's color scale. Overrides the color value set by `border`.
71+
*
72+
* @default '' - meaning no override
73+
*/
5374
borderColor?: ReducedColorKeyword | '';
75+
/**
76+
* The roundedness of the scroll box's corners.
77+
*
78+
* - `none`: Sharp corners with no rounding.
79+
* - `small-100` / `small`: Subtle rounding for compact elements.
80+
* - `base`: Standard rounding for most use cases.
81+
* - `large` / `large-100`: More pronounced rounding for prominent containers.
82+
* - `max`: Maximum rounding, creating a pill or circular shape.
83+
*
84+
* Supports 1-to-4-value shorthand syntax for specifying different radii per corner.
85+
*
86+
* @default 'none'
87+
*/
5488
borderRadius?: MaybeAllValuesShorthandProperty<Extract<ScrollBoxProps$1['borderRadius'], 'none' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'max'>>;
89+
/**
90+
* The thickness of the border on all sides. Supports 1-to-4-value shorthand syntax for specifying different widths per side. Overrides the width value set by `border`.
91+
*
92+
* @default '' - meaning no override
93+
*/
5594
borderWidth?: MaybeAllValuesShorthandProperty<ReducedBorderSizeKeyword> | '';
5695
}
5796
export interface ScrollBoxElement extends ScrollBoxElementProps, Omit<HTMLElement, 'id'> {

0 commit comments

Comments
 (0)