@skyscanner/backpack-web 41.10.0-beta-v1 → 41.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -2
- package/bpk-component-layout/index.d.ts +0 -18
- package/bpk-component-layout/index.js +0 -29
- package/bpk-component-layout/src/BpkBox.d.ts +0 -3
- package/bpk-component-layout/src/BpkBox.js +0 -33
- package/bpk-component-layout/src/BpkFlex.d.ts +0 -3
- package/bpk-component-layout/src/BpkFlex.js +0 -51
- package/bpk-component-layout/src/BpkGrid.d.ts +0 -3
- package/bpk-component-layout/src/BpkGrid.js +0 -57
- package/bpk-component-layout/src/BpkGridItem.d.ts +0 -3
- package/bpk-component-layout/src/BpkGridItem.js +0 -45
- package/bpk-component-layout/src/BpkProvider.d.ts +0 -14
- package/bpk-component-layout/src/BpkProvider.js +0 -42
- package/bpk-component-layout/src/BpkStack.constant.d.ts +0 -2
- package/bpk-component-layout/src/BpkStack.constant.js +0 -22
- package/bpk-component-layout/src/BpkStack.d.ts +0 -5
- package/bpk-component-layout/src/BpkStack.js +0 -57
- package/bpk-component-layout/src/BpkVessel.d.ts +0 -46
- package/bpk-component-layout/src/BpkVessel.js +0 -70
- package/bpk-component-layout/src/commonProps.d.ts +0 -86
- package/bpk-component-layout/src/commonProps.js +0 -1
- package/bpk-component-layout/src/theme.d.ts +0 -36
- package/bpk-component-layout/src/theme.js +0 -229
- package/bpk-component-layout/src/tokenUtils.d.ts +0 -108
- package/bpk-component-layout/src/tokenUtils.js +0 -323
- package/bpk-component-layout/src/tokens.d.ts +0 -96
- package/bpk-component-layout/src/tokens.js +0 -138
- package/bpk-component-layout/src/types.d.ts +0 -236
- package/bpk-component-layout/src/types.js +0 -1
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Backpack Design Tokens for Layout Components
|
|
3
|
-
*
|
|
4
|
-
* This file provides token mappings from Backpack design tokens to Chakra UI theme.
|
|
5
|
-
* All tokens are sourced from @skyscanner/bpk-foundations-web
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Backpack Spacing Tokens
|
|
9
|
-
* Use these constants to ensure type safety when passing spacing props
|
|
10
|
-
*/
|
|
11
|
-
export declare const BpkSpacing: {
|
|
12
|
-
readonly None: "bpk-spacing-none";
|
|
13
|
-
readonly XS: "bpk-spacing-xs";
|
|
14
|
-
readonly SM: "bpk-spacing-sm";
|
|
15
|
-
readonly Base: "bpk-spacing-base";
|
|
16
|
-
readonly MD: "bpk-spacing-md";
|
|
17
|
-
readonly LG: "bpk-spacing-lg";
|
|
18
|
-
readonly XL: "bpk-spacing-xl";
|
|
19
|
-
readonly XXL: "bpk-spacing-xxl";
|
|
20
|
-
};
|
|
21
|
-
export type BpkSpacingToken = typeof BpkSpacing[keyof typeof BpkSpacing];
|
|
22
|
-
/**
|
|
23
|
-
* Backpack Breakpoint Tokens
|
|
24
|
-
* Use these constants to ensure type safety when defining responsive overrides
|
|
25
|
-
* These map to the simplified keys defined in the Chakra theme
|
|
26
|
-
*/
|
|
27
|
-
export declare const BpkBreakpoint: {
|
|
28
|
-
readonly SmallMobile: "small-mobile";
|
|
29
|
-
readonly Mobile: "mobile";
|
|
30
|
-
readonly SmallTablet: "small-tablet";
|
|
31
|
-
readonly Tablet: "tablet";
|
|
32
|
-
readonly Desktop: "desktop";
|
|
33
|
-
};
|
|
34
|
-
export type BpkBreakpointToken = typeof BpkBreakpoint[keyof typeof BpkBreakpoint];
|
|
35
|
-
export type ChakraBreakpointKey = 'base' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';
|
|
36
|
-
export declare const BpkBreakpointToChakraKey: Record<BpkBreakpointToken, ChakraBreakpointKey>;
|
|
37
|
-
/**
|
|
38
|
-
* Helper type for values that can be Backpack tokens or percentages
|
|
39
|
-
* but NOT px/rem values
|
|
40
|
-
*/
|
|
41
|
-
export type BpkSpacingValue = BpkSpacingToken | `${number}%`;
|
|
42
|
-
export type BpkBreakpointValue = BpkBreakpointToken;
|
|
43
|
-
/**
|
|
44
|
-
* Helper type for size props that can use rem, percentages or semantic values.
|
|
45
|
-
* This is intentionally separate from BpkSpacingValue to avoid encouraging
|
|
46
|
-
* spacing tokens for explicit sizes.
|
|
47
|
-
*/
|
|
48
|
-
export type BpkSizeValue = `${number}rem` | `${number}%` | 'auto' | 'full' | 'fit-content';
|
|
49
|
-
/**
|
|
50
|
-
* Helper type for position props that can use rem or percentages.
|
|
51
|
-
* We intentionally do not allow semantic values like 'auto' here.
|
|
52
|
-
*/
|
|
53
|
-
export type BpkPositionValue = `${number}rem` | `${number}%`;
|
|
54
|
-
/**
|
|
55
|
-
* Helper type for flex-basis prop that can use rem, percentages or semantic values.
|
|
56
|
-
* Excludes 'px' values to enforce design system constraints.
|
|
57
|
-
*/
|
|
58
|
-
export type BpkBasisValue = `${number}rem` | `${number}%` | 'auto' | 'content' | 'fit-content' | 'max-content' | 'min-content' | 'initial' | 'inherit';
|
|
59
|
-
/**
|
|
60
|
-
* Helper type for responsive values based on Backpack breakpoints.
|
|
61
|
-
*
|
|
62
|
-
* We intentionally only support:
|
|
63
|
-
* - a single scalar value (non-responsive)
|
|
64
|
-
* - an object keyed by Backpack breakpoint tokens (and optional base)
|
|
65
|
-
*
|
|
66
|
-
* We do NOT support array-based responsive values in the public API.
|
|
67
|
-
*/
|
|
68
|
-
export type BpkResponsiveValue<T> = T | Partial<Record<BpkBreakpointToken | 'base', T>>;
|
|
69
|
-
/**
|
|
70
|
-
* Validates if a value is a percentage string
|
|
71
|
-
*
|
|
72
|
-
* @param {string} value - The value to validate
|
|
73
|
-
* @returns {boolean} True if the value is a valid percentage string
|
|
74
|
-
*/
|
|
75
|
-
export declare function isPercentage(value: string): boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Validates if a spacing value is valid (token or percentage)
|
|
78
|
-
*
|
|
79
|
-
* @param {string} value - The spacing value to validate
|
|
80
|
-
* @returns {boolean} True if the value is a valid Backpack spacing token or percentage
|
|
81
|
-
*/
|
|
82
|
-
export declare function isValidSpacingValue(value: string): boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Validates if a size value is valid
|
|
85
|
-
*
|
|
86
|
-
* @param {string} value - The size value to validate
|
|
87
|
-
* @returns {boolean} True if the value is a valid rem/percentage/semantic size
|
|
88
|
-
*/
|
|
89
|
-
export declare function isValidSizeValue(value: string): boolean;
|
|
90
|
-
/**
|
|
91
|
-
* Validates if a position value is valid
|
|
92
|
-
*
|
|
93
|
-
* @param {string} value - The position value to validate
|
|
94
|
-
* @returns {boolean} True if the value is a valid rem or percentage
|
|
95
|
-
*/
|
|
96
|
-
export declare function isValidPositionValue(value: string): boolean;
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2016 Skyscanner Ltd
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this file except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Backpack Design Tokens for Layout Components
|
|
21
|
-
*
|
|
22
|
-
* This file provides token mappings from Backpack design tokens to Chakra UI theme.
|
|
23
|
-
* All tokens are sourced from @skyscanner/bpk-foundations-web
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Backpack Spacing Tokens
|
|
28
|
-
* Use these constants to ensure type safety when passing spacing props
|
|
29
|
-
*/
|
|
30
|
-
export const BpkSpacing = {
|
|
31
|
-
None: 'bpk-spacing-none',
|
|
32
|
-
XS: 'bpk-spacing-xs',
|
|
33
|
-
SM: 'bpk-spacing-sm',
|
|
34
|
-
Base: 'bpk-spacing-base',
|
|
35
|
-
MD: 'bpk-spacing-md',
|
|
36
|
-
LG: 'bpk-spacing-lg',
|
|
37
|
-
XL: 'bpk-spacing-xl',
|
|
38
|
-
XXL: 'bpk-spacing-xxl'
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* Backpack Breakpoint Tokens
|
|
42
|
-
* Use these constants to ensure type safety when defining responsive overrides
|
|
43
|
-
* These map to the simplified keys defined in the Chakra theme
|
|
44
|
-
*/
|
|
45
|
-
export const BpkBreakpoint = {
|
|
46
|
-
SmallMobile: 'small-mobile',
|
|
47
|
-
Mobile: 'mobile',
|
|
48
|
-
SmallTablet: 'small-tablet',
|
|
49
|
-
Tablet: 'tablet',
|
|
50
|
-
Desktop: 'desktop'
|
|
51
|
-
};
|
|
52
|
-
export const BpkBreakpointToChakraKey = {
|
|
53
|
-
// Keep this mapping in sync with the breakpoints configured in `theme.ts`.
|
|
54
|
-
// `base` is reserved for "default value" and is not a breakpoint token.
|
|
55
|
-
'small-mobile': 'sm',
|
|
56
|
-
mobile: 'md',
|
|
57
|
-
'small-tablet': 'lg',
|
|
58
|
-
tablet: 'xl',
|
|
59
|
-
desktop: '2xl'
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Helper type for values that can be Backpack tokens or percentages
|
|
64
|
-
* but NOT px/rem values
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Helper type for size props that can use rem, percentages or semantic values.
|
|
69
|
-
* This is intentionally separate from BpkSpacingValue to avoid encouraging
|
|
70
|
-
* spacing tokens for explicit sizes.
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Helper type for position props that can use rem or percentages.
|
|
75
|
-
* We intentionally do not allow semantic values like 'auto' here.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Helper type for flex-basis prop that can use rem, percentages or semantic values.
|
|
80
|
-
* Excludes 'px' values to enforce design system constraints.
|
|
81
|
-
*/
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Helper type for responsive values based on Backpack breakpoints.
|
|
85
|
-
*
|
|
86
|
-
* We intentionally only support:
|
|
87
|
-
* - a single scalar value (non-responsive)
|
|
88
|
-
* - an object keyed by Backpack breakpoint tokens (and optional base)
|
|
89
|
-
*
|
|
90
|
-
* We do NOT support array-based responsive values in the public API.
|
|
91
|
-
*/
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* Validates if a value is a percentage string
|
|
95
|
-
*
|
|
96
|
-
* @param {string} value - The value to validate
|
|
97
|
-
* @returns {boolean} True if the value is a valid percentage string
|
|
98
|
-
*/
|
|
99
|
-
export function isPercentage(value) {
|
|
100
|
-
return /^\d+(\.\d+)?%$/.test(value);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Validates if a spacing value is valid (token or percentage)
|
|
105
|
-
*
|
|
106
|
-
* @param {string} value - The spacing value to validate
|
|
107
|
-
* @returns {boolean} True if the value is a valid Backpack spacing token or percentage
|
|
108
|
-
*/
|
|
109
|
-
export function isValidSpacingValue(value) {
|
|
110
|
-
return Object.values(BpkSpacing).includes(value) || isPercentage(value);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Validates if a size value is valid
|
|
115
|
-
*
|
|
116
|
-
* @param {string} value - The size value to validate
|
|
117
|
-
* @returns {boolean} True if the value is a valid rem/percentage/semantic size
|
|
118
|
-
*/
|
|
119
|
-
export function isValidSizeValue(value) {
|
|
120
|
-
return /^-?\d+(\.\d+)?rem$/.test(value) ||
|
|
121
|
-
// rem values
|
|
122
|
-
isPercentage(value) ||
|
|
123
|
-
// percentage values
|
|
124
|
-
value === 'auto' || value === 'full' || value === 'fit-content';
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
* Validates if a position value is valid
|
|
129
|
-
*
|
|
130
|
-
* @param {string} value - The position value to validate
|
|
131
|
-
* @returns {boolean} True if the value is a valid rem or percentage
|
|
132
|
-
*/
|
|
133
|
-
export function isValidPositionValue(value) {
|
|
134
|
-
return /^-?\d+(\.\d+)?rem$/.test(value) ||
|
|
135
|
-
// rem values
|
|
136
|
-
isPercentage(value) // percentage values
|
|
137
|
-
;
|
|
138
|
-
}
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import type StackOptionKeys from './BpkStack.constant';
|
|
3
|
-
import type { BpkCommonLayoutProps } from './commonProps';
|
|
4
|
-
import type { BpkSpacingValue, BpkResponsiveValue, BpkBasisValue } from './tokens';
|
|
5
|
-
import type { BoxProps, FlexProps, GridProps, GridItemProps, StackProps } from '@chakra-ui/react';
|
|
6
|
-
/**
|
|
7
|
-
* Layout-level event props that should not be exposed on layout components
|
|
8
|
-
* by default. BpkBox will reintroduce a minimal subset (onClick, onFocus,
|
|
9
|
-
* onBlur) explicitly on its own props type.
|
|
10
|
-
*/
|
|
11
|
-
type LayoutEventProps = 'onClick' | 'onMouseEnter' | 'onMouseLeave' | 'onMouseOver' | 'onMouseOut' | 'onMouseDown' | 'onMouseUp' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'onKeyPress';
|
|
12
|
-
/**
|
|
13
|
-
* Shorthand props from the underlying layout system that we do NOT expose on
|
|
14
|
-
* Backpack layout components. These mostly mirror longer-form spacing,
|
|
15
|
-
* sizing and visual props that we already model explicitly via
|
|
16
|
-
* BpkCommonLayoutProps and BpkFlexGridProps.
|
|
17
|
-
*/
|
|
18
|
-
type DisallowedShorthandProps = 'p' | 'pt' | 'pr' | 'pb' | 'pl' | 'px' | 'py' | 'm' | 'mt' | 'mr' | 'mb' | 'ml' | 'mx' | 'my' | 'w' | 'h' | 'minW' | 'maxW' | 'minH' | 'maxH' | 'bg' | 'rounded' | 'shadow';
|
|
19
|
-
/**
|
|
20
|
-
* Flexbox & grid layout props that we explicitly support on Backpack layout
|
|
21
|
-
* components. These are a curated subset of the underlying Box flex/grid API
|
|
22
|
-
* that are useful for structural layout.
|
|
23
|
-
*/
|
|
24
|
-
export interface BpkFlexGridProps {
|
|
25
|
-
display?: BoxProps['display'];
|
|
26
|
-
flexDirection?: BoxProps['flexDirection'];
|
|
27
|
-
flexWrap?: BoxProps['flexWrap'];
|
|
28
|
-
justifyContent?: BoxProps['justifyContent'];
|
|
29
|
-
alignItems?: BoxProps['alignItems'];
|
|
30
|
-
alignContent?: BoxProps['alignContent'];
|
|
31
|
-
flex?: BoxProps['flex'];
|
|
32
|
-
flexGrow?: BoxProps['flexGrow'];
|
|
33
|
-
flexShrink?: BoxProps['flexShrink'];
|
|
34
|
-
flexBasis?: BoxProps['flexBasis'];
|
|
35
|
-
order?: BoxProps['order'];
|
|
36
|
-
alignSelf?: BoxProps['alignSelf'];
|
|
37
|
-
justifySelf?: BoxProps['justifySelf'];
|
|
38
|
-
gridTemplateColumns?: BoxProps['gridTemplateColumns'];
|
|
39
|
-
gridTemplateRows?: BoxProps['gridTemplateRows'];
|
|
40
|
-
gridTemplateAreas?: BoxProps['gridTemplateAreas'];
|
|
41
|
-
gridAutoFlow?: BoxProps['gridAutoFlow'];
|
|
42
|
-
gridAutoRows?: BoxProps['gridAutoRows'];
|
|
43
|
-
gridAutoColumns?: BoxProps['gridAutoColumns'];
|
|
44
|
-
rowGap?: BoxProps['rowGap'];
|
|
45
|
-
columnGap?: BoxProps['columnGap'];
|
|
46
|
-
}
|
|
47
|
-
export type FlexGridPropKeys = keyof BpkFlexGridProps;
|
|
48
|
-
/**
|
|
49
|
-
* Curated subset of Box layout props that support Backpack responsive values.
|
|
50
|
-
*
|
|
51
|
-
* NOTE:
|
|
52
|
-
* - These are structural layout props (flex/grid/display) that we want to allow
|
|
53
|
-
* on `BpkBox`, but using Backpack breakpoint keys rather than Chakra's
|
|
54
|
-
* array syntax or Chakra breakpoint keys.
|
|
55
|
-
* - Spacing/size/position props are handled separately via `BpkCommonLayoutProps`.
|
|
56
|
-
*/
|
|
57
|
-
type BpkBoxResponsiveLayoutProps = {
|
|
58
|
-
display?: BpkResponsiveValue<BoxProps['display']>;
|
|
59
|
-
flexDirection?: BpkResponsiveValue<BoxProps['flexDirection']>;
|
|
60
|
-
flexWrap?: BpkResponsiveValue<BoxProps['flexWrap']>;
|
|
61
|
-
justifyContent?: BpkResponsiveValue<BoxProps['justifyContent']>;
|
|
62
|
-
alignItems?: BpkResponsiveValue<BoxProps['alignItems']>;
|
|
63
|
-
alignContent?: BpkResponsiveValue<BoxProps['alignContent']>;
|
|
64
|
-
flex?: BpkResponsiveValue<BoxProps['flex']>;
|
|
65
|
-
flexGrow?: BpkResponsiveValue<BoxProps['flexGrow']>;
|
|
66
|
-
flexShrink?: BpkResponsiveValue<BoxProps['flexShrink']>;
|
|
67
|
-
flexBasis?: BpkResponsiveValue<BoxProps['flexBasis']>;
|
|
68
|
-
order?: BpkResponsiveValue<BoxProps['order']>;
|
|
69
|
-
alignSelf?: BpkResponsiveValue<BoxProps['alignSelf']>;
|
|
70
|
-
justifySelf?: BpkResponsiveValue<BoxProps['justifySelf']>;
|
|
71
|
-
gridTemplateColumns?: BpkResponsiveValue<BoxProps['gridTemplateColumns']>;
|
|
72
|
-
gridTemplateRows?: BpkResponsiveValue<BoxProps['gridTemplateRows']>;
|
|
73
|
-
gridTemplateAreas?: BpkResponsiveValue<BoxProps['gridTemplateAreas']>;
|
|
74
|
-
gridAutoFlow?: BpkResponsiveValue<BoxProps['gridAutoFlow']>;
|
|
75
|
-
gridAutoRows?: BpkResponsiveValue<BoxProps['gridAutoRows']>;
|
|
76
|
-
gridAutoColumns?: BpkResponsiveValue<BoxProps['gridAutoColumns']>;
|
|
77
|
-
gridColumn?: BpkResponsiveValue<BoxProps['gridColumn']>;
|
|
78
|
-
gridRow?: BpkResponsiveValue<BoxProps['gridRow']>;
|
|
79
|
-
};
|
|
80
|
-
type BpkBoxResponsiveLayoutPropKeys = keyof BpkBoxResponsiveLayoutProps;
|
|
81
|
-
/**
|
|
82
|
-
* Base type that removes common layout props, reserved props (className,
|
|
83
|
-
* children) and all layout-level event props from Chakra UI props.
|
|
84
|
-
*
|
|
85
|
-
* These will be replaced with Backpack-specific types.
|
|
86
|
-
*/
|
|
87
|
-
export type RemoveCommonProps<T> = Omit<T, keyof BpkCommonLayoutProps | 'className' | 'children' | LayoutEventProps | FlexGridPropKeys | DisallowedShorthandProps>;
|
|
88
|
-
/**
|
|
89
|
-
* Component-specific props for BpkBox
|
|
90
|
-
* Includes all Box props except those in BpkCommonLayoutProps
|
|
91
|
-
*/
|
|
92
|
-
export interface BpkBoxSpecificProps extends Omit<RemoveCommonProps<BoxProps>, BpkBoxResponsiveLayoutPropKeys>, BpkBoxResponsiveLayoutProps, Omit<BpkFlexGridProps, BpkBoxResponsiveLayoutPropKeys> {
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Props for BpkBox component
|
|
96
|
-
* Combines Box-specific props with Backpack common layout props
|
|
97
|
-
* and reintroduces a minimal set of interaction props.
|
|
98
|
-
*/
|
|
99
|
-
type BoxEventProps = Pick<BoxProps, 'onClick' | 'onFocus' | 'onBlur'>;
|
|
100
|
-
export interface BpkBoxProps extends BpkCommonLayoutProps, BpkBoxSpecificProps {
|
|
101
|
-
children?: ReactNode;
|
|
102
|
-
onClick?: BoxEventProps['onClick'];
|
|
103
|
-
onFocus?: BoxEventProps['onFocus'];
|
|
104
|
-
onBlur?: BoxEventProps['onBlur'];
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Valid HTML elements that can be used with BpkVessel
|
|
108
|
-
*/
|
|
109
|
-
export type VesselElement = 'div' | 'span' | 'section' | 'article' | 'nav' | 'main' | 'aside' | 'header' | 'footer';
|
|
110
|
-
/**
|
|
111
|
-
* Props for BpkVessel component.
|
|
112
|
-
*
|
|
113
|
-
* BpkVessel is a "migration hatch" that renders an HTML element
|
|
114
|
-
* and accepts all standard HTML attributes for maximum migration flexibility.
|
|
115
|
-
*
|
|
116
|
-
* Accepts all React.HTMLAttributes including:
|
|
117
|
-
* - Styling: className, style
|
|
118
|
-
* - Testing: data-testid, data-cy, data-*
|
|
119
|
-
* - Accessibility: aria-*, role, tabIndex
|
|
120
|
-
* - Basic HTML: id, title, dir, lang, hidden, etc.
|
|
121
|
-
* - All standard DOM events: onClick, onChange, onFocus, etc.
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* ```tsx
|
|
125
|
-
* <BpkVessel
|
|
126
|
-
* className="legacy-wrapper"
|
|
127
|
-
* style={{ padding: '16px', transition: 'opacity 0.3s' }}
|
|
128
|
-
* data-testid="migration-wrapper"
|
|
129
|
-
* onClick={handleClick}
|
|
130
|
-
* >
|
|
131
|
-
* Content
|
|
132
|
-
* </BpkVessel>
|
|
133
|
-
*
|
|
134
|
-
* <BpkVessel
|
|
135
|
-
* as="section"
|
|
136
|
-
* className="legacy-section"
|
|
137
|
-
* aria-label="Main content"
|
|
138
|
-
* role="region"
|
|
139
|
-
* dir="rtl"
|
|
140
|
-
* >
|
|
141
|
-
* Section Content
|
|
142
|
-
* </BpkVessel>
|
|
143
|
-
* ```
|
|
144
|
-
*/
|
|
145
|
-
export type BpkVesselProps = {
|
|
146
|
-
as?: VesselElement;
|
|
147
|
-
} & React.HTMLAttributes<HTMLElement>;
|
|
148
|
-
/**
|
|
149
|
-
* Component-specific props for BpkFlex
|
|
150
|
-
* Includes all Flex props except those in BpkCommonLayoutProps
|
|
151
|
-
*/
|
|
152
|
-
export interface BpkFlexSpecificProps extends RemoveCommonProps<FlexProps> {
|
|
153
|
-
direction?: BpkResponsiveValue<FlexProps['flexDirection']>;
|
|
154
|
-
justify?: BpkResponsiveValue<FlexProps['justifyContent']>;
|
|
155
|
-
align?: BpkResponsiveValue<FlexProps['alignItems']>;
|
|
156
|
-
wrap?: BpkResponsiveValue<FlexProps['flexWrap']>;
|
|
157
|
-
grow?: BpkResponsiveValue<FlexProps['flexGrow']>;
|
|
158
|
-
shrink?: BpkResponsiveValue<FlexProps['flexShrink']>;
|
|
159
|
-
basis?: BpkResponsiveValue<BpkBasisValue>;
|
|
160
|
-
inline?: boolean;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Props for BpkFlex component
|
|
164
|
-
* Combines Flex-specific props with Backpack common layout props
|
|
165
|
-
*/
|
|
166
|
-
export interface BpkFlexProps extends BpkCommonLayoutProps, BpkFlexSpecificProps {
|
|
167
|
-
children?: ReactNode;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Component-specific props for BpkGrid
|
|
171
|
-
* Includes all Grid props except those in BpkCommonLayoutProps
|
|
172
|
-
*/
|
|
173
|
-
export interface BpkGridSpecificProps extends RemoveCommonProps<GridProps> {
|
|
174
|
-
justify?: BpkResponsiveValue<GridProps['justifyContent']>;
|
|
175
|
-
align?: BpkResponsiveValue<GridProps['alignItems']>;
|
|
176
|
-
templateColumns?: BpkResponsiveValue<GridProps['gridTemplateColumns']>;
|
|
177
|
-
templateRows?: BpkResponsiveValue<GridProps['gridTemplateRows']>;
|
|
178
|
-
templateAreas?: BpkResponsiveValue<GridProps['gridTemplateAreas']>;
|
|
179
|
-
autoFlow?: BpkResponsiveValue<GridProps['gridAutoFlow']>;
|
|
180
|
-
autoRows?: BpkResponsiveValue<GridProps['gridAutoRows']>;
|
|
181
|
-
autoColumns?: BpkResponsiveValue<GridProps['gridAutoColumns']>;
|
|
182
|
-
rowGap?: BpkResponsiveValue<BpkSpacingValue>;
|
|
183
|
-
columnGap?: BpkResponsiveValue<BpkSpacingValue>;
|
|
184
|
-
column?: BpkResponsiveValue<GridProps['gridColumn']>;
|
|
185
|
-
row?: BpkResponsiveValue<GridProps['gridRow']>;
|
|
186
|
-
inline?: boolean;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Props for BpkGrid component
|
|
190
|
-
* Combines Grid-specific props with Backpack common layout props
|
|
191
|
-
*/
|
|
192
|
-
export interface BpkGridProps extends BpkCommonLayoutProps, BpkGridSpecificProps {
|
|
193
|
-
children?: ReactNode;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Component-specific props for BpkGridItem
|
|
197
|
-
* Includes all GridItem props except those in BpkCommonLayoutProps
|
|
198
|
-
*/
|
|
199
|
-
export interface BpkGridItemSpecificProps extends RemoveCommonProps<GridItemProps> {
|
|
200
|
-
area?: GridItemProps['area'];
|
|
201
|
-
colEnd?: GridItemProps['colEnd'];
|
|
202
|
-
colStart?: GridItemProps['colStart'];
|
|
203
|
-
colSpan?: GridItemProps['colSpan'];
|
|
204
|
-
rowEnd?: GridItemProps['rowEnd'];
|
|
205
|
-
rowStart?: GridItemProps['rowStart'];
|
|
206
|
-
rowSpan?: GridItemProps['rowSpan'];
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Props for BpkGridItem component
|
|
210
|
-
* Combines GridItem-specific props with Backpack common layout props
|
|
211
|
-
*/
|
|
212
|
-
export interface BpkGridItemProps extends BpkCommonLayoutProps, BpkGridItemSpecificProps {
|
|
213
|
-
children?: ReactNode;
|
|
214
|
-
}
|
|
215
|
-
type StackOptionKeysType = typeof StackOptionKeys[number];
|
|
216
|
-
/**
|
|
217
|
-
* Overrides StackOptions to support BpkResponsiveValue
|
|
218
|
-
*/
|
|
219
|
-
type BpkStackOptions = {
|
|
220
|
-
[K in StackOptionKeysType]?: K extends keyof StackProps ? BpkResponsiveValue<StackProps[K]> | StackProps[K] : never;
|
|
221
|
-
};
|
|
222
|
-
/**
|
|
223
|
-
* Component-specific props for BpkStack
|
|
224
|
-
* Includes all Stack props except those in BpkCommonLayoutProps
|
|
225
|
-
* Overrides StackOptions to support BpkResponsiveValue
|
|
226
|
-
*/
|
|
227
|
-
export interface BpkStackSpecificProps extends Omit<RemoveCommonProps<StackProps>, StackOptionKeysType>, BpkStackOptions, BpkFlexGridProps {
|
|
228
|
-
}
|
|
229
|
-
/**
|
|
230
|
-
* Props for BpkStack component
|
|
231
|
-
* Combines Stack-specific props with Backpack common layout props
|
|
232
|
-
*/
|
|
233
|
-
export interface BpkStackProps extends BpkCommonLayoutProps, BpkStackSpecificProps {
|
|
234
|
-
children?: ReactNode;
|
|
235
|
-
}
|
|
236
|
-
export type { BpkCommonLayoutProps };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|