@spark-web/columns 1.0.5 → 2.0.2
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/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Columns
|
|
3
3
|
storybookPath: page-layout-columns--default
|
|
4
|
+
isExperimentalPackage: false
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
Use the columns primitive to layout content in configurable columns.
|
|
@@ -72,6 +73,26 @@ Columns can be collapsed into a single vertical stack responsively using the
|
|
|
72
73
|
</Columns>
|
|
73
74
|
```
|
|
74
75
|
|
|
76
|
+
### Template
|
|
77
|
+
|
|
78
|
+
If you need more control over how your columns are distributed, you can use the
|
|
79
|
+
`template` prop. `template` receives an array of numbers that represent the
|
|
80
|
+
relative width of each column.
|
|
81
|
+
|
|
82
|
+
```jsx live
|
|
83
|
+
<Columns gap="small" template={[1, 3, 1]} collapseBelow="tablet">
|
|
84
|
+
<Box border="field" padding="small">
|
|
85
|
+
<Text>nav</Text>
|
|
86
|
+
</Box>
|
|
87
|
+
<Box border="field" padding="small">
|
|
88
|
+
<Text>main</Text>
|
|
89
|
+
</Box>
|
|
90
|
+
<Box border="field" padding="small">
|
|
91
|
+
<Text>aside</Text>
|
|
92
|
+
</Box>
|
|
93
|
+
</Columns>
|
|
94
|
+
```
|
|
95
|
+
|
|
75
96
|
## Props
|
|
76
97
|
|
|
77
98
|
| Prop | Type | Default | Description |
|
|
@@ -4,7 +4,7 @@ import type { DataAttributeMap } from '@spark-web/utils/internal';
|
|
|
4
4
|
import type { ReactNode } from 'react';
|
|
5
5
|
import type { AlignY } from './alignment';
|
|
6
6
|
declare type Gap = ResponsiveProp<keyof Omit<BrighteTheme['spacing'], 'none'>>;
|
|
7
|
-
declare type ValidBoxProps = Omit<BoxProps, 'display' | 'alignItems' | 'gap' | 'flexDirection' | 'justifyContent' | 'flexWrap'>;
|
|
7
|
+
declare type ValidBoxProps = Omit<BoxProps, 'display' | 'alignItems' | 'gap' | 'flexDirection' | 'justifyContent' | 'flexWrap' | 'dangerouslySetInnerHTML'>;
|
|
8
8
|
export declare type ColumnsProps = {
|
|
9
9
|
/** Vertically align items within the container. */
|
|
10
10
|
alignY?: ResponsiveProp<AlignY>;
|
|
@@ -21,10 +21,10 @@ export declare type ColumnsProps = {
|
|
|
21
21
|
} & ValidBoxProps;
|
|
22
22
|
export declare const Columns: <Comp extends import("react").ElementType<any> = "div">(props: {
|
|
23
23
|
as?: Comp | undefined;
|
|
24
|
-
ref?: import("react").Ref<Comp extends "symbol" | "
|
|
24
|
+
ref?: import("react").Ref<Comp extends "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "set" | keyof HTMLElementTagNameMap ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | "set">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
|
|
25
25
|
} & Omit<import("react").PropsWithoutRef<import("react").ComponentProps<Comp>>, "as"> & {
|
|
26
26
|
/** Vertically align items within the container. */
|
|
27
|
-
alignY?: ResponsiveProp<"
|
|
27
|
+
alignY?: ResponsiveProp<"bottom" | "top" | "center" | "stretch"> | undefined;
|
|
28
28
|
/** Elements representing each column. */
|
|
29
29
|
children: ReactNode;
|
|
30
30
|
/** At which breakpoint, if any, should the columns collapse. */
|
|
@@ -5,10 +5,10 @@ declare const alignYLookup: {
|
|
|
5
5
|
readonly stretch: "stretch";
|
|
6
6
|
};
|
|
7
7
|
export declare type AlignY = keyof typeof alignYLookup;
|
|
8
|
-
export declare const alignYToAlignItems: (prop?: import("@spark-web/theme").ResponsiveProp<"
|
|
9
|
-
mobile: "
|
|
10
|
-
tablet: "
|
|
11
|
-
desktop: "
|
|
12
|
-
wide: "
|
|
8
|
+
export declare const alignYToAlignItems: (prop?: import("@spark-web/theme").ResponsiveProp<"bottom" | "top" | "center" | "stretch"> | undefined) => "start" | "center" | "end" | "stretch" | {
|
|
9
|
+
mobile: "start" | "center" | "end" | "stretch" | undefined;
|
|
10
|
+
tablet: "start" | "center" | "end" | "stretch" | undefined;
|
|
11
|
+
desktop: "start" | "center" | "end" | "stretch" | undefined;
|
|
12
|
+
wide: "start" | "center" | "end" | "stretch" | undefined;
|
|
13
13
|
} | undefined;
|
|
14
14
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@spark-web/columns",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/spark-web-columns.cjs.js",
|
|
6
6
|
"module": "dist/spark-web-columns.esm.js",
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@babel/runtime": "^7.18.
|
|
11
|
+
"@babel/runtime": "^7.18.9",
|
|
12
12
|
"@emotion/css": "^11.9.0",
|
|
13
|
-
"@spark-web/box": "^1.0.
|
|
14
|
-
"@spark-web/theme": "^3.0.
|
|
15
|
-
"@spark-web/utils": "^1.
|
|
13
|
+
"@spark-web/box": "^1.0.7",
|
|
14
|
+
"@spark-web/theme": "^3.0.3",
|
|
15
|
+
"@spark-web/utils": "^1.2.0"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"@types/react": "^17.0.12",
|