Skip to content

Commit 3106936

Browse files
authored
Add private positioning types to s-box checkout component (#4660)
1 parent 8acd748 commit 3106936

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/ui-extensions': patch
3+
---
4+
5+
Add private positioning types (`position`, `insetBlock`, `insetInline`, `transform`) to the `s-box` checkout component.

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

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/* eslint-disable import-x/namespace */
99
// eslint-disable-next-line @typescript-eslint/triple-slash-reference, spaced-comment
1010
/// <reference lib="DOM" />
11-
import type {BoxProps$1,MaybeAllValuesShorthandProperty,BorderSizeKeyword, BorderStyleKeyword,ColorKeyword} from './components-shared.d.ts';
11+
import type {BoxProps$1,MaybeAllValuesShorthandProperty,BorderSizeKeyword, BorderStyleKeyword, SizeUnits,ColorKeyword} from './components-shared.d.ts';
1212

1313
/**
1414
* The subset of border size values available for this component.
@@ -84,6 +84,61 @@ export interface BoxElementProps extends Pick<BoxProps$1, 'accessibilityLabel' |
8484
* @default 'none'
8585
*/
8686
borderRadius?: MaybeAllValuesShorthandProperty<Extract<BoxProps$1['borderRadius'], 'none' | 'small-100' | 'small' | 'base' | 'large' | 'large-100' | 'max'>>;
87+
/**
88+
* Sets the box's block position by specifying offsets from the box's
89+
* default position, following the CSS `inset-block` shorthand:
90+
* a block-start offset followed by a block-end offset, where only one
91+
* of the two can be a size so each axis is only offset once.
92+
*
93+
* When `position` is set to `absolute`, offsets are insets from the
94+
* nearest positioned ancestor. A percentage value refers to the block
95+
* size of that ancestor.
96+
*
97+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/inset-block
98+
*
99+
* @default 'auto'
100+
* @private
101+
*/
102+
insetBlock?: `auto ${SizeUnits}` | `${SizeUnits} auto` | 'auto';
103+
/**
104+
* Sets the box's inline position by specifying offsets from the box's
105+
* default position, following the CSS `inset-inline` shorthand:
106+
* an inline-start offset followed by an inline-end offset, where only
107+
* one of the two can be a size so each axis is only offset once.
108+
*
109+
* When `position` is set to `absolute`, offsets are insets from the
110+
* nearest positioned ancestor. A percentage value refers to the inline
111+
* size of that ancestor.
112+
*
113+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/inset-inline
114+
*
115+
* @default 'auto'
116+
* @private
117+
*/
118+
insetInline?: `auto ${SizeUnits}` | `${SizeUnits} auto` | 'auto';
119+
/**
120+
* Changes how the box is positioned.
121+
*
122+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/position
123+
*
124+
* @default 'relative'
125+
* @private
126+
*/
127+
position?: 'absolute' | 'relative';
128+
/**
129+
* Specifies a transformation of the box.
130+
*
131+
* Only two-dimensional translations are supported. The first value
132+
* translates along the inline axis and the second along the block axis;
133+
* inline translations are flipped in right-to-left writing modes.
134+
* A percentage value refers to the corresponding size of the box itself.
135+
*
136+
* @see https://developer.mozilla.org/en-US/docs/Web/CSS/transform
137+
*
138+
* @default 'none'
139+
* @private
140+
*/
141+
transform?: `translate(${SizeUnits})` | `translate(${SizeUnits}, ${SizeUnits})` | `translate(${SizeUnits},${SizeUnits})` | 'none';
87142
}
88143
export interface BoxElement extends BoxElementProps, Omit<HTMLElement, 'id'> {
89144
}

0 commit comments

Comments
 (0)