@sps-woodland/matrix 8.21.0 → 8.21.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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"
|
|
1
|
+
(function(l,t){typeof exports=="object"&&typeof module<"u"?t(exports,require("react"),require("@sps-woodland/core"),require("@spscommerce/utils")):typeof define=="function"&&define.amd?define(["exports","react","@sps-woodland/core","@spscommerce/utils"],t):(l=typeof globalThis<"u"?globalThis:l||self,t(l.Matrix={},l.React,l.core,l.utils))})(this,function(l,t,n,s){"use strict";function p(a){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const r in a)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(a,r);Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:()=>a[r]})}}return i.default=a,Object.freeze(i)}const e=p(t);var u="_67ajyb0",d="_67ajyb2",b="_67ajyb1",g="_67ajyb3";function c({title:a,children:i,"data-testid":r,...o}){return t.createElement("div",{className:n.cl(u),"data-testid":"matrix"},t.createElement(n.Title,{size:"lg"},a),t.createElement("table",{className:n.cl(u),"data-testid":`${r}`,...o},i))}n.Metadata.set(c,{name:"Matrix",props:{title:"string"}});function x({children:a,"data-testid":i,...r}){return t.createElement(t.Fragment,null,t.createElement("thead",{"data-testid":`${i}`,...r},a))}n.Metadata.set(x,{name:"Matrix Head"});function m({icon:a,tooltip:i,width:r,className:o,children:y,"data-testid":H,...E}){return t.createElement(t.Fragment,null,t.createElement("th",{className:n.cl(b),style:{width:`${r}`},"data-testid":`${H}`,...E},y,t.createElement("div",{className:n.cl(g)},a,i)))}n.Metadata.set(m,{name:"Matrix Header",props:{icon:"Icon",tooltip:"SpsTooltip",width:"string"}});function h({children:a,"data-testid":i,...r}){return t.createElement(t.Fragment,null,t.createElement("tbody",{"data-testid":`${i}`,...r},a))}n.Metadata.set(h,{name:"Matrix Body"});function M({children:a,"data-testid":i,...r}){return t.createElement(t.Fragment,null,t.createElement("tr",{"data-testid":`${i}`,...r},a))}n.Metadata.set(M,{name:"Matrix Row"});function f({className:a,children:i,"data-testid":r,...o}){return i!==void 0?i===null?t.createElement("td",{className:n.cl(d),"data-testid":`${r}`,...o},"null"):t.createElement("td",{className:n.cl(d),"data-testid":`${r}`,...o},i):t.createElement("td",{className:n.cl(d),"data-testid":`${r}`,...o},"—")}n.Metadata.set(f,{name:"Matrix Cell"});const w={Matrix:{components:[c,m],description:({NavigateTo:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"The Matrix component displays a grid of information utilizing a title on both the X- and Y-axes. It is an alternate to the ",e.createElement(a,{to:"tables"},"Table")," or ",e.createElement(a,{to:"description-lists"},"Description List")," for displaying a list of information where the value in each cell corresponds to both of its parent headers.")),examples:{general:{label:"General Usage",description:({NavigateTo:a})=>e.createElement(e.Fragment,null,e.createElement("p",null,"The decision to use a Matrix to visualize a grid of information, as opposed to a traditional Table or Description List, is largely subjective. The following guidelines provide a reliable framework for making the correct choice."),e.createElement("h5",null," When to Use "),e.createElement("ul",null,e.createElement("li",null," If the data set requires an identifier on both the X-axis and a Y-axis. "),e.createElement("li",null," If the data set requires six (6) or fewer columns (including the header column). "),e.createElement("li",null," If the data set is small, or if using a matrix is more aesthetically pleasing (without sacrificing functionality) than a table or description list. ")),e.createElement("h5",null," When Not to Use "),e.createElement("ul",null,e.createElement("li",null," If form elements are required, consider a ",e.createElement(a,{to:"tables"},"Table")," or ",e.createElement(a,{to:"description-lists"},"Description List"),". "),e.createElement("li",null," If the data set requires more than six (6) columns (including the header column), use a ",e.createElement(a,{to:"tables"},"Table")," instead. "),e.createElement("li",null," If the data needs to be searchable, filterable or sortable, use a ",e.createElement(a,{to:"tables"},"Table")," instead. ")),e.createElement("h5",null," Avoid Over-Crowding "),e.createElement("p",null," Use the following guidelines to determine the ideal maximum number of columns based on container width. Following these guidelines will preserve content readability. ")),examples:{general:{react:s.code`
|
|
2
2
|
import {
|
|
3
3
|
Matrix,
|
|
4
4
|
MatrixHead,
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
</Matrix>
|
|
34
34
|
)
|
|
35
35
|
}
|
|
36
|
-
`}}},basic:{label:"Basic Matrix",description:e.createElement(e.Fragment,null,e.createElement("h5",null,"Matrix Characteristics"),e.createElement("ul",null,e.createElement("li",null," A header row across the top horizontal axis (X-axis). "),e.createElement("li",null," A header “column” along the left-most vertical axis (Y-axis). "),e.createElement("ul",null,e.createElement("li",null," A header row across the top horizontal axis (X-axis). "))),e.createElement("h5",null,"Matrix Rules"),e.createElement("ul",null,e.createElement("li",null," Non-header cells can contain any type of content. "),e.createElement("li",null," Text and content should remain left-aligned. "),e.createElement("li",null," Column widths are evenly divided amongst the horizontal space. "),e.createElement("li",null," A title describing the contents of the matrix is suggested but not required. "),e.createElement("ul",null,e.createElement("li",null,e.createElement("i",null,"Note: for accessibility reasons, a Matrix without a visible title should still include an HTML description for identification."))))),examples:{basic:{react:
|
|
36
|
+
`}}},basic:{label:"Basic Matrix",description:e.createElement(e.Fragment,null,e.createElement("h5",null,"Matrix Characteristics"),e.createElement("ul",null,e.createElement("li",null," A header row across the top horizontal axis (X-axis). "),e.createElement("li",null," A header “column” along the left-most vertical axis (Y-axis). "),e.createElement("ul",null,e.createElement("li",null," A header row across the top horizontal axis (X-axis). "))),e.createElement("h5",null,"Matrix Rules"),e.createElement("ul",null,e.createElement("li",null," Non-header cells can contain any type of content. "),e.createElement("li",null," Text and content should remain left-aligned. "),e.createElement("li",null," Column widths are evenly divided amongst the horizontal space. "),e.createElement("li",null," A title describing the contents of the matrix is suggested but not required. "),e.createElement("ul",null,e.createElement("li",null,e.createElement("i",null,"Note: for accessibility reasons, a Matrix without a visible title should still include an HTML description for identification."))))),examples:{basic:{react:s.code`
|
|
37
37
|
import {
|
|
38
38
|
Matrix,
|
|
39
39
|
MatrixHead,
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
</Matrix>
|
|
147
147
|
);
|
|
148
148
|
}
|
|
149
|
-
`}}},variations:{label:"Matrix Variations",examples:{customColumn:{description:e.createElement(e.Fragment,null,e.createElement("h5",null," Customizable Column Widths "),e.createElement("p",null,"Individual columns can be set to custom widths if desired. This can be done to one or all columns in the Matrix. Any columns without a specified custom width will divide the remaining horizontal space evenly.")),react:
|
|
149
|
+
`}}},variations:{label:"Matrix Variations",examples:{customColumn:{description:e.createElement(e.Fragment,null,e.createElement("h5",null," Customizable Column Widths "),e.createElement("p",null,"Individual columns can be set to custom widths if desired. This can be done to one or all columns in the Matrix. Any columns without a specified custom width will divide the remaining horizontal space evenly.")),react:s.code`
|
|
150
150
|
import {
|
|
151
151
|
Matrix,
|
|
152
152
|
MatrixHead,
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
</Matrix>
|
|
203
203
|
);
|
|
204
204
|
}
|
|
205
|
-
`},omitHeaderColumn:{description:e.createElement(e.Fragment,null,e.createElement("h5",null," Optional Left-hand Header Column "),e.createElement("p",null,"The left-hand Header Column can be omitted if desired. This option can apply to default- or customizable-width Matrix components.")),react:
|
|
205
|
+
`},omitHeaderColumn:{description:e.createElement(e.Fragment,null,e.createElement("h5",null," Optional Left-hand Header Column "),e.createElement("p",null,"The left-hand Header Column can be omitted if desired. This option can apply to default- or customizable-width Matrix components.")),react:s.code`
|
|
206
206
|
import {
|
|
207
207
|
Matrix,
|
|
208
208
|
MatrixHead,
|
|
@@ -258,4 +258,4 @@
|
|
|
258
258
|
</Matrix>
|
|
259
259
|
);
|
|
260
260
|
}
|
|
261
|
-
`}}}}}
|
|
261
|
+
`}}}}}};l.MANIFEST=w,l.Matrix=c,l.MatrixBody=h,l.MatrixCell=f,l.MatrixHead=x,l.MatrixHeader=m,l.MatrixRow=M,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sps-woodland/matrix",
|
|
3
3
|
"description": "SPS Woodland Design System Matrix component",
|
|
4
|
-
"version": "8.21.
|
|
4
|
+
"version": "8.21.2",
|
|
5
5
|
"author": "SPS Commerce",
|
|
6
6
|
"license": "UNLICENSED",
|
|
7
7
|
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/matrix",
|
|
8
8
|
"homepage": "https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/matrix#readme",
|
|
9
9
|
"type": "module",
|
|
10
|
-
"module": "./lib/index.
|
|
11
|
-
"main": "./lib/index.cjs
|
|
10
|
+
"module": "./lib/index.js",
|
|
11
|
+
"main": "./lib/index.umd.cjs",
|
|
12
12
|
"types": "./lib/index.d.ts",
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"default": "./lib/index.
|
|
15
|
+
"require": "./lib/index.umd.cjs",
|
|
16
|
+
"import": "./lib/index.js",
|
|
17
|
+
"default": "./lib/index.js",
|
|
18
18
|
"types": "./lib/index.d.ts"
|
|
19
19
|
},
|
|
20
20
|
"./lib/style.css": {
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@spscommerce/utils": "^7.0.0",
|
|
30
30
|
"react": "^16.14.0",
|
|
31
31
|
"react-dom": "^16.14.0",
|
|
32
|
-
"@sps-woodland/core": "8.21.
|
|
33
|
-
"@sps-woodland/tokens": "8.21.
|
|
32
|
+
"@sps-woodland/core": "8.21.2",
|
|
33
|
+
"@sps-woodland/tokens": "8.21.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@react-stately/collections": "^3.6.0",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"@vanilla-extract/css": "^1.9.3",
|
|
39
39
|
"react": "^16.14.0",
|
|
40
40
|
"react-dom": "^16.14.0",
|
|
41
|
-
"@sps-woodland/core": "8.21.
|
|
42
|
-
"@sps-woodland/tabs": "8.21.
|
|
43
|
-
"@sps-woodland/tokens": "8.21.
|
|
41
|
+
"@sps-woodland/core": "8.21.2",
|
|
42
|
+
"@sps-woodland/tabs": "8.21.2",
|
|
43
|
+
"@sps-woodland/tokens": "8.21.2"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@spscommerce/ds-react": "^8.16.1",
|
package/vite.config.mjs
CHANGED
|
@@ -9,8 +9,8 @@ export default defineConfig({
|
|
|
9
9
|
build: {
|
|
10
10
|
lib: {
|
|
11
11
|
entry: path.resolve(__dirname, "src/index.ts"),
|
|
12
|
-
|
|
13
|
-
fileName:
|
|
12
|
+
name: "Matrix",
|
|
13
|
+
fileName: "index",
|
|
14
14
|
},
|
|
15
15
|
outDir: path.resolve(__dirname, "./lib"),
|
|
16
16
|
emptyOutDir: false,
|
|
File without changes
|