@spark-web/columns 1.0.4 → 2.0.1

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
@@ -72,6 +72,26 @@ Columns can be collapsed into a single vertical stack responsively using the
72
72
  </Columns>
73
73
  ```
74
74
 
75
+ ### Template
76
+
77
+ If you need more control over how your columns are distributed, you can use the
78
+ `template` prop. `template` receives an array of numbers that represent the
79
+ relative width of each column.
80
+
81
+ ```jsx live
82
+ <Columns gap="small" template={[1, 3, 1]} collapseBelow="tablet">
83
+ <Box border="field" padding="small">
84
+ <Text>nav</Text>
85
+ </Box>
86
+ <Box border="field" padding="small">
87
+ <Text>main</Text>
88
+ </Box>
89
+ <Box border="field" padding="small">
90
+ <Text>aside</Text>
91
+ </Box>
92
+ </Columns>
93
+ ```
94
+
75
95
  ## Props
76
96
 
77
97
  | 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" | "clipPath" | "filter" | "mask" | "marker" | "text" | "circle" | "svg" | "animate" | "animateMotion" | "animateTransform" | "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" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap | "set" ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "clipPath" | "filter" | "mask" | "marker" | "text" | "circle" | "svg" | "animate" | "animateMotion" | "animateTransform" | "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" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "textPath" | "tspan" | "use" | "view" | "set">)[Comp] : Comp extends new (...args: any) => any ? InstanceType<Comp> : undefined> | undefined;
24
+ ref?: import("react").Ref<Comp extends "symbol" | "clipPath" | "filter" | "mask" | "marker" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "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" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | keyof HTMLElementTagNameMap | "set" ? (HTMLElementTagNameMap & Pick<SVGElementTagNameMap, "symbol" | "clipPath" | "filter" | "mask" | "marker" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "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" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "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<"bottom" | "top" | "stretch" | "center"> | undefined;
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<"bottom" | "top" | "stretch" | "center"> | undefined) => "stretch" | "center" | "end" | "start" | {
9
- mobile: "stretch" | "center" | "end" | "start" | undefined;
10
- tablet: "stretch" | "center" | "end" | "start" | undefined;
11
- desktop: "stretch" | "center" | "end" | "start" | undefined;
12
- wide: "stretch" | "center" | "end" | "start" | undefined;
8
+ export declare const alignYToAlignItems: (prop?: import("@spark-web/theme").ResponsiveProp<"bottom" | "top" | "center" | "stretch"> | undefined) => "center" | "stretch" | "start" | "end" | {
9
+ mobile: "center" | "stretch" | "start" | "end" | undefined;
10
+ tablet: "center" | "stretch" | "start" | "end" | undefined;
11
+ desktop: "center" | "stretch" | "start" | "end" | undefined;
12
+ wide: "center" | "stretch" | "start" | "end" | 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": "1.0.4",
3
+ "version": "2.0.1",
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.14.6",
12
- "@emotion/css": "^11.7.1",
13
- "@spark-web/box": "^1.0.4",
14
- "@spark-web/theme": "^3.0.0",
15
- "@spark-web/utils": "^1.1.2"
11
+ "@babel/runtime": "^7.18.3",
12
+ "@emotion/css": "^11.9.0",
13
+ "@spark-web/box": "^1.0.6",
14
+ "@spark-web/theme": "^3.0.2",
15
+ "@spark-web/utils": "^1.1.5"
16
16
  },
17
17
  "devDependencies": {
18
18
  "@types/react": "^17.0.12",