@cloudflare/style-container 7.9.0 → 7.12.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 7.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d2309ba7da: Add gridTemplateColumns property to createStyledComponent
|
|
8
|
+
|
|
9
|
+
## 7.11.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 0aca3a096c: added role to ariaAttributes on style-container
|
|
14
|
+
|
|
15
|
+
## 7.10.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- 77059b4a95: Add grid properties to components created with createStyledComponent
|
|
20
|
+
|
|
3
21
|
## 7.9.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
|
@@ -25,7 +25,7 @@ declare const colorProps: readonly ["color", "backgroundColor", "borderColor", "
|
|
|
25
25
|
declare const borderStyleProps: readonly ["borderStyle", "borderTopStyle", "borderBottomStyle", "borderLeftStyle", "borderRightStyle"];
|
|
26
26
|
declare const borderWidthProps: readonly ["borderWidth", "borderTopWidth", "borderBottomWidth", "borderLeftWidth", "borderRightWidth"];
|
|
27
27
|
declare const borderRadiusProps: readonly ["borderRadius", "borderTopLeftRadius", "borderTopRightRadius", "borderBottomLeftRadius", "borderbottomRightRadius"];
|
|
28
|
-
export declare const styleRuleProps: ("p" | "color" | "height" | "width" | "cursor" | "display" | "fontSize" | "fontWeight" | "textDecoration" | "borderColor" | "margin" | "marginLeft" | "marginRight" | "marginTop" | "marginBottom" | "padding" | "paddingLeft" | "paddingRight" | "paddingTop" | "paddingBottom" | "gap" | "m" | "ml" | "mr" | "mt" | "mb" | "mx" | "my" | "pl" | "pr" | "pt" | "pb" | "px" | "py" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "backgroundColor" | "borderLeftColor" | "borderRightColor" | "borderTopColor" | "borderBottomColor" | "borderStyle" | "borderTopStyle" | "borderBottomStyle" | "borderLeftStyle" | "borderRightStyle" | "borderWidth" | "borderTopWidth" | "borderBottomWidth" | "borderLeftWidth" | "borderRightWidth" | "borderRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderBottomLeftRadius" | "borderbottomRightRadius" | "textAlign" | "verticalAlign" | "alignItems" | "alignSelf" | "justifyContent" | "textTransform" | "boxSizing" | "flexDirection" | "flexBasis" | "flexGrow")[];
|
|
28
|
+
export declare const styleRuleProps: ("p" | "color" | "height" | "width" | "cursor" | "display" | "fontSize" | "fontWeight" | "textDecoration" | "borderColor" | "margin" | "marginLeft" | "marginRight" | "marginTop" | "marginBottom" | "padding" | "paddingLeft" | "paddingRight" | "paddingTop" | "paddingBottom" | "gap" | "m" | "ml" | "mr" | "mt" | "mb" | "mx" | "my" | "pl" | "pr" | "pt" | "pb" | "px" | "py" | "minWidth" | "minHeight" | "maxWidth" | "maxHeight" | "backgroundColor" | "borderLeftColor" | "borderRightColor" | "borderTopColor" | "borderBottomColor" | "borderStyle" | "borderTopStyle" | "borderBottomStyle" | "borderLeftStyle" | "borderRightStyle" | "borderWidth" | "borderTopWidth" | "borderBottomWidth" | "borderLeftWidth" | "borderRightWidth" | "borderRadius" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderBottomLeftRadius" | "borderbottomRightRadius" | "textAlign" | "verticalAlign" | "alignItems" | "alignSelf" | "justifyContent" | "textTransform" | "boxSizing" | "flexDirection" | "flexBasis" | "flexGrow" | "gridTemplateColumns")[];
|
|
29
29
|
export declare function filterStyleProps<Type extends {}>(props: Type): Type;
|
|
30
30
|
declare type StyleRuleProp = typeof styleRuleProps[number];
|
|
31
31
|
declare type ExpandedCSSProperty<P extends StyleRuleProp> = P extends ShorthandSpacingProp ? ShorthandToLonghandMap[P][0] : P;
|
|
@@ -34,7 +34,16 @@ declare type BreakpointStyle<V> = V | [V, V] | [V, V, V];
|
|
|
34
34
|
declare type StyleProps = {
|
|
35
35
|
[P in StyleRuleProp]?: BreakpointStyle<CSSPropertyValue<ExpandedCSSProperty<P>>>;
|
|
36
36
|
};
|
|
37
|
-
declare
|
|
38
|
-
declare
|
|
37
|
+
declare type GridAlignment = 'start' | 'end' | 'center' | 'stretch';
|
|
38
|
+
declare type GridProps = {
|
|
39
|
+
gridColumnSpan?: number | number[] | 'all' | 'end';
|
|
40
|
+
gridColumnPad?: number | number[];
|
|
41
|
+
gridRowSpan?: number | number[];
|
|
42
|
+
gridRowPad?: number | number[];
|
|
43
|
+
gridAlign?: GridAlignment;
|
|
44
|
+
gridJustify?: GridAlignment;
|
|
45
|
+
};
|
|
46
|
+
declare function createStyledComponent<AdditionalStyleProps = {}>(rule: StyleFn<ForceInference<'div'>, StyleProps & AdditionalStyleProps>): ComponentType<Compute<InferProps<'div'> & StyleProps & AdditionalStyleProps & InnerRefProp<'div'> & GridProps>>;
|
|
47
|
+
declare function createStyledComponent<Base extends BaseType, AdditionalStyleProps = {}>(rule: StyleFn<ForceInference<Base>, StyleProps & AdditionalStyleProps>, type?: Base, passthroughProps?: string[]): ComponentType<Compute<InferProps<Base> & StyleProps & AdditionalStyleProps & InnerRefProp<Base> & GridProps>>;
|
|
39
48
|
export default createStyledComponent;
|
|
40
49
|
export { colorProps, spacingProps, sizeProps, borderStyleProps, borderWidthProps, borderRadiusProps };
|
|
@@ -36,7 +36,7 @@ var colorProps = ['color', 'backgroundColor', 'borderColor', 'borderLeftColor',
|
|
|
36
36
|
var borderStyleProps = ['borderStyle', 'borderTopStyle', 'borderBottomStyle', 'borderLeftStyle', 'borderRightStyle'];
|
|
37
37
|
var borderWidthProps = ['borderWidth', 'borderTopWidth', 'borderBottomWidth', 'borderLeftWidth', 'borderRightWidth'];
|
|
38
38
|
var borderRadiusProps = ['borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomLeftRadius', 'borderbottomRightRadius'];
|
|
39
|
-
var additionalProps = ['fontSize', 'fontWeight', 'textAlign', 'display', 'width', 'verticalAlign', 'alignItems', 'alignSelf', 'justifyContent', 'textDecoration', 'textTransform', 'boxSizing', 'cursor', 'flexDirection', 'flexBasis', 'flexGrow'];
|
|
39
|
+
var additionalProps = ['fontSize', 'fontWeight', 'textAlign', 'display', 'width', 'verticalAlign', 'alignItems', 'alignSelf', 'justifyContent', 'textDecoration', 'textTransform', 'boxSizing', 'cursor', 'flexDirection', 'flexBasis', 'flexGrow', 'gridTemplateColumns'];
|
|
40
40
|
export var styleRuleProps = [...spacingProps, ...sizeProps, ...colorProps, ...borderStyleProps, ...borderWidthProps, ...borderRadiusProps, ...additionalProps];
|
|
41
41
|
var stylesRulePropsSet = new Set(styleRuleProps); // Function to remove styling attributes from a Props object
|
|
42
42
|
|
package/es/isValidElementProp.js
CHANGED
|
@@ -22,7 +22,7 @@ var globalAttributes = [
|
|
|
22
22
|
'autoCapitalize', 'autoCorrect', 'autoSave', // 'color', probably best to not allow this attribute
|
|
23
23
|
'itemProp', 'itemScope', 'itemType', 'itemID', 'itemRef', 'results', 'security', 'unselectable'];
|
|
24
24
|
var htmlElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'];
|
|
25
|
-
export var ariaAttributes = ['aria-activedescendant', 'aria-atomic', 'aria-autocomplete', 'aria-busy', 'aria-checked', 'aria-colcount', 'aria-colindex', 'aria-colspan', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-errormessage', 'aria-expanded', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-level', 'aria-live', 'aria-modal', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed', 'aria-readonly', 'aria-relevant', 'aria-required', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-setsize', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext'];
|
|
25
|
+
export var ariaAttributes = ['aria-activedescendant', 'aria-atomic', 'aria-autocomplete', 'aria-busy', 'aria-checked', 'aria-colcount', 'aria-colindex', 'aria-colspan', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-errormessage', 'aria-expanded', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-level', 'aria-live', 'aria-modal', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed', 'aria-readonly', 'aria-relevant', 'aria-required', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-setsize', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', 'role'];
|
|
26
26
|
var extendedAttributes = {
|
|
27
27
|
a: ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type', 'referrerPolicy'],
|
|
28
28
|
area: ['alt', 'coords', 'download', 'href', 'hrefLang', 'media', 'rel', 'shape', 'target'],
|
|
@@ -76,7 +76,7 @@ var borderWidthProps = ['borderWidth', 'borderTopWidth', 'borderBottomWidth', 'b
|
|
|
76
76
|
exports.borderWidthProps = borderWidthProps;
|
|
77
77
|
var borderRadiusProps = ['borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomLeftRadius', 'borderbottomRightRadius'];
|
|
78
78
|
exports.borderRadiusProps = borderRadiusProps;
|
|
79
|
-
var additionalProps = ['fontSize', 'fontWeight', 'textAlign', 'display', 'width', 'verticalAlign', 'alignItems', 'alignSelf', 'justifyContent', 'textDecoration', 'textTransform', 'boxSizing', 'cursor', 'flexDirection', 'flexBasis', 'flexGrow'];
|
|
79
|
+
var additionalProps = ['fontSize', 'fontWeight', 'textAlign', 'display', 'width', 'verticalAlign', 'alignItems', 'alignSelf', 'justifyContent', 'textDecoration', 'textTransform', 'boxSizing', 'cursor', 'flexDirection', 'flexBasis', 'flexGrow', 'gridTemplateColumns'];
|
|
80
80
|
var styleRuleProps = [].concat(_toConsumableArray(spacingProps), sizeProps, colorProps, borderStyleProps, borderWidthProps, borderRadiusProps, additionalProps);
|
|
81
81
|
exports.styleRuleProps = styleRuleProps;
|
|
82
82
|
var stylesRulePropsSet = new Set(styleRuleProps); // Function to remove styling attributes from a Props object
|
|
@@ -45,7 +45,7 @@ var globalAttributes = [
|
|
|
45
45
|
'autoCapitalize', 'autoCorrect', 'autoSave', // 'color', probably best to not allow this attribute
|
|
46
46
|
'itemProp', 'itemScope', 'itemType', 'itemID', 'itemRef', 'results', 'security', 'unselectable'];
|
|
47
47
|
var htmlElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'];
|
|
48
|
-
var ariaAttributes = ['aria-activedescendant', 'aria-atomic', 'aria-autocomplete', 'aria-busy', 'aria-checked', 'aria-colcount', 'aria-colindex', 'aria-colspan', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-errormessage', 'aria-expanded', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-level', 'aria-live', 'aria-modal', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed', 'aria-readonly', 'aria-relevant', 'aria-required', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-setsize', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext'];
|
|
48
|
+
var ariaAttributes = ['aria-activedescendant', 'aria-atomic', 'aria-autocomplete', 'aria-busy', 'aria-checked', 'aria-colcount', 'aria-colindex', 'aria-colspan', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-errormessage', 'aria-expanded', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-level', 'aria-live', 'aria-modal', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed', 'aria-readonly', 'aria-relevant', 'aria-required', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-setsize', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', 'role'];
|
|
49
49
|
exports.ariaAttributes = ariaAttributes;
|
|
50
50
|
var extendedAttributes = {
|
|
51
51
|
a: ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type', 'referrerPolicy'],
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/style-container",
|
|
3
3
|
"description": "Cloudflare Style Container",
|
|
4
|
-
"version": "7.
|
|
5
|
-
"types": "./dist/index.d.ts",
|
|
4
|
+
"version": "7.12.0",
|
|
6
5
|
"main": "lib/index.js",
|
|
7
6
|
"module": "es/index.js",
|
|
8
7
|
"author": "Vojtech Miksu <vojtech@cloudflare.com>",
|
|
@@ -10,7 +9,8 @@
|
|
|
10
9
|
"publishConfig": {
|
|
11
10
|
"access": "public",
|
|
12
11
|
"main": "lib/index.js",
|
|
13
|
-
"module": "es/index.js"
|
|
12
|
+
"module": "es/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@cloudflare/types": "^6.15.15",
|
|
@@ -34,5 +34,6 @@
|
|
|
34
34
|
"test": "stratus test",
|
|
35
35
|
"test-coverage": "stratus test --coverage",
|
|
36
36
|
"test-watch": "stratus test --watch"
|
|
37
|
-
}
|
|
37
|
+
},
|
|
38
|
+
"types": "./dist/index.d.ts"
|
|
38
39
|
}
|