@sps-woodland/page-title 7.0.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/README.md +3 -0
- package/lib/PageTitle.examples.d.ts +2 -0
- package/lib/index.cjs.js +54 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.es.js +134 -0
- package/lib/manifest.d.ts +2 -0
- package/lib/page-subtitle/PageSubtitle.css.d.ts +2 -0
- package/lib/page-subtitle/PageSubtitle.d.ts +3 -0
- package/lib/page-title/PageTitle.css.d.ts +3 -0
- package/lib/page-title/PageTitle.d.ts +3 -0
- package/lib/style.css +1 -0
- package/package.json +38 -0
- package/vite.config.js +21 -0
package/README.md
ADDED
package/lib/index.cjs.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react"),t=require("@sps-woodland/core"),r=require("@spscommerce/utils");function m(e){if(e&&e.__esModule)return e;const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(o,a,i.get?i:{enumerable:!0,get:()=>e[a]})}}return o.default=e,Object.freeze(o)}const n=m(d);var g="_14vazzb0",p="_14vazzb2",b="_14vazzb1";function c({children:e,className:o,...a}){const[[i],l]=t.selectChildren(e,[{type:t.Icon}]),u=i?t.addClassName(i,p):"";return n.createElement("div",{className:t.cl(g,o),...a},u,n.createElement("div",{className:b},l))}t.Metadata.set(c,{name:"Page Title"});var P="_30pzwb0",T="_30pzwb1";function s({children:e,className:o,...a}){const i=t.modChildren(e,l=>l.type===t.Icon?[{className:t.cl(l.props.className,T)}]:[]);return n.createElement("div",{className:t.cl(P,o),...a},i)}t.Metadata.set(s,{name:"Page Subtitle"});const S={components:[c,s],examples:{basic:{label:"Basic",examples:{basic:{react:r.code`
|
|
2
|
+
import { PageTitle } from "@sps-woodland/page-title";
|
|
3
|
+
|
|
4
|
+
function Component() {
|
|
5
|
+
return (
|
|
6
|
+
<PageTitle>
|
|
7
|
+
Cabela's Purchase Order #123456789012
|
|
8
|
+
</PageTitle>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
`}}},withIcon:{label:"With Icon",examples:{withIcon:{react:r.code`
|
|
12
|
+
import { PageTitle } from "@sps-woodland/page-title";
|
|
13
|
+
import { Icon } from "@sps-woodland/core";
|
|
14
|
+
|
|
15
|
+
function Component() {
|
|
16
|
+
return (
|
|
17
|
+
<PageTitle>
|
|
18
|
+
<Icon icon="status-error" color="red-medium" />
|
|
19
|
+
Cabela's Purchase Order #123456789012
|
|
20
|
+
</PageTitle>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
`}}},withSubtitle:{label:"With Subtitle",examples:{withSubtitle:{react:r.code`
|
|
24
|
+
import { PageTitle, PageSubtitle } from "@sps-woodland/page-title";
|
|
25
|
+
import { Icon } from "@sps-woodland/core;
|
|
26
|
+
|
|
27
|
+
function Component() {
|
|
28
|
+
return (
|
|
29
|
+
<PageTitle>
|
|
30
|
+
Cabela's Purchase Order #123456789012
|
|
31
|
+
<PageSubtitle>Cabela's
|
|
32
|
+
<Icon icon="outgoing" />
|
|
33
|
+
MacNeil Automotive Parts
|
|
34
|
+
</PageSubtitle>
|
|
35
|
+
</PageTitle>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
`}}},withSubtitleAndIcon:{label:"With Subtitle And Icon",examples:{withSubtitleAndIcon:{react:r.code`
|
|
39
|
+
import { PageTitle, PageSubtitle } from "@sps-woodland/page-title";
|
|
40
|
+
import { Icon } from "@sps-woodland/core;
|
|
41
|
+
|
|
42
|
+
function Component() {
|
|
43
|
+
return (
|
|
44
|
+
<PageTitle>
|
|
45
|
+
<Icon aria-hidden="true" icon="status-error" color="red-medium" size="lg"/>
|
|
46
|
+
Cabela's Purchase Order #123456789012
|
|
47
|
+
<PageSubtitle>
|
|
48
|
+
Cabela's <Icon aria-hidden="true" icon="outgoing" />
|
|
49
|
+
MacNeil Automotive Parts
|
|
50
|
+
</PageSubtitle>
|
|
51
|
+
</PageTitle>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
`}}}}},f={"Page Title":S};exports.MANIFEST=f;exports.PageSubtitle=s;exports.PageTitle=c;
|
package/lib/index.d.ts
ADDED
package/lib/index.es.js
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { Metadata as s, selectChildren as u, Icon as c, addClassName as g, cl as r, modChildren as b } from "@sps-woodland/core";
|
|
3
|
+
import { code as a } from "@spscommerce/utils";
|
|
4
|
+
var P = "_14vazzb0", T = "_14vazzb2", h = "_14vazzb1";
|
|
5
|
+
function m({
|
|
6
|
+
children: o,
|
|
7
|
+
className: i,
|
|
8
|
+
...l
|
|
9
|
+
}) {
|
|
10
|
+
const [[e], t] = u(o, [{ type: c }]), p = e ? g(e, T) : "";
|
|
11
|
+
return /* @__PURE__ */ n.createElement("div", {
|
|
12
|
+
className: r(P, i),
|
|
13
|
+
...l
|
|
14
|
+
}, p, /* @__PURE__ */ n.createElement("div", {
|
|
15
|
+
className: h
|
|
16
|
+
}, t));
|
|
17
|
+
}
|
|
18
|
+
s.set(m, {
|
|
19
|
+
name: "Page Title"
|
|
20
|
+
});
|
|
21
|
+
var I = "_30pzwb0", S = "_30pzwb1";
|
|
22
|
+
function d({
|
|
23
|
+
children: o,
|
|
24
|
+
className: i,
|
|
25
|
+
...l
|
|
26
|
+
}) {
|
|
27
|
+
const e = b(o, (t) => t.type === c ? [{
|
|
28
|
+
className: r(t.props.className, S)
|
|
29
|
+
}] : []);
|
|
30
|
+
return /* @__PURE__ */ n.createElement("div", {
|
|
31
|
+
className: r(I, i),
|
|
32
|
+
...l
|
|
33
|
+
}, e);
|
|
34
|
+
}
|
|
35
|
+
s.set(d, {
|
|
36
|
+
name: "Page Subtitle"
|
|
37
|
+
});
|
|
38
|
+
const f = {
|
|
39
|
+
components: [m, d],
|
|
40
|
+
examples: {
|
|
41
|
+
basic: {
|
|
42
|
+
label: "Basic",
|
|
43
|
+
examples: {
|
|
44
|
+
basic: {
|
|
45
|
+
react: a`
|
|
46
|
+
import { PageTitle } from "@sps-woodland/page-title";
|
|
47
|
+
|
|
48
|
+
function Component() {
|
|
49
|
+
return (
|
|
50
|
+
<PageTitle>
|
|
51
|
+
Cabela's Purchase Order #123456789012
|
|
52
|
+
</PageTitle>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
`
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
withIcon: {
|
|
60
|
+
label: "With Icon",
|
|
61
|
+
examples: {
|
|
62
|
+
withIcon: {
|
|
63
|
+
react: a`
|
|
64
|
+
import { PageTitle } from "@sps-woodland/page-title";
|
|
65
|
+
import { Icon } from "@sps-woodland/core";
|
|
66
|
+
|
|
67
|
+
function Component() {
|
|
68
|
+
return (
|
|
69
|
+
<PageTitle>
|
|
70
|
+
<Icon icon="status-error" color="red-medium" />
|
|
71
|
+
Cabela's Purchase Order #123456789012
|
|
72
|
+
</PageTitle>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
`
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
withSubtitle: {
|
|
80
|
+
label: "With Subtitle",
|
|
81
|
+
examples: {
|
|
82
|
+
withSubtitle: {
|
|
83
|
+
react: a`
|
|
84
|
+
import { PageTitle, PageSubtitle } from "@sps-woodland/page-title";
|
|
85
|
+
import { Icon } from "@sps-woodland/core;
|
|
86
|
+
|
|
87
|
+
function Component() {
|
|
88
|
+
return (
|
|
89
|
+
<PageTitle>
|
|
90
|
+
Cabela's Purchase Order #123456789012
|
|
91
|
+
<PageSubtitle>Cabela's
|
|
92
|
+
<Icon icon="outgoing" />
|
|
93
|
+
MacNeil Automotive Parts
|
|
94
|
+
</PageSubtitle>
|
|
95
|
+
</PageTitle>
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
`
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
withSubtitleAndIcon: {
|
|
103
|
+
label: "With Subtitle And Icon",
|
|
104
|
+
examples: {
|
|
105
|
+
withSubtitleAndIcon: {
|
|
106
|
+
react: a`
|
|
107
|
+
import { PageTitle, PageSubtitle } from "@sps-woodland/page-title";
|
|
108
|
+
import { Icon } from "@sps-woodland/core;
|
|
109
|
+
|
|
110
|
+
function Component() {
|
|
111
|
+
return (
|
|
112
|
+
<PageTitle>
|
|
113
|
+
<Icon aria-hidden="true" icon="status-error" color="red-medium" size="lg"/>
|
|
114
|
+
Cabela's Purchase Order #123456789012
|
|
115
|
+
<PageSubtitle>
|
|
116
|
+
Cabela's <Icon aria-hidden="true" icon="outgoing" />
|
|
117
|
+
MacNeil Automotive Parts
|
|
118
|
+
</PageSubtitle>
|
|
119
|
+
</PageTitle>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
`
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, C = {
|
|
128
|
+
"Page Title": f
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
C as MANIFEST,
|
|
132
|
+
d as PageSubtitle,
|
|
133
|
+
m as PageTitle
|
|
134
|
+
};
|
package/lib/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._14vazzb0{display:flex;flex-direction:row}._14vazzb1{color:#1f282c;display:flex;flex-direction:column;font-size:1.5rem;line-height:1.5rem}._14vazzb2{align-self:flex-start;font-size:1.125rem;line-height:1.5rem;margin-right:.25rem}._30pzwb0{color:#4b5356;font-size:1.125rem;line-height:1.125rem;margin-top:.25rem}._30pzwb1{font-size:.75rem;line-height:1.125rem;margin-left:.25rem;margin-right:.25rem}
|
package/package.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sps-woodland/page-title",
|
|
3
|
+
"description": "SPS Woodland Design System page title component",
|
|
4
|
+
"version": "7.0.0",
|
|
5
|
+
"author": "SPS Commerce",
|
|
6
|
+
"license": "UNLICENSED",
|
|
7
|
+
"repository": "https://github.com/SPSCommerce/woodland/tree/main/packages/@sps-woodland/page-title",
|
|
8
|
+
"homepage": "https://github.com/SPSCommerce/woodland/tree/master/packages/@sps-woodland/page-title#readme",
|
|
9
|
+
"main": "./lib/index.es.js",
|
|
10
|
+
"module": "./lib/index.es.js",
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"@sps-woodland/core": "7.0.0",
|
|
17
|
+
"@sps-woodland/tokens": "7.0.0",
|
|
18
|
+
"@spscommerce/utils": "^6.12.1",
|
|
19
|
+
"react": "^16.9.0",
|
|
20
|
+
"react-dom": "^16.9.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@sps-woodland/core": "7.0.0",
|
|
24
|
+
"@sps-woodland/tokens": "7.0.0",
|
|
25
|
+
"@spscommerce/utils": "^6.12.1",
|
|
26
|
+
"@vanilla-extract/css": "^1.9.1",
|
|
27
|
+
"react": "^16.9.0",
|
|
28
|
+
"react-dom": "^16.9.0"
|
|
29
|
+
},
|
|
30
|
+
"scripts": {
|
|
31
|
+
"build": "pnpm run build:js && pnpm run build:types",
|
|
32
|
+
"build:js": "vite build",
|
|
33
|
+
"build:types": "tsc --emitDeclarationOnly --declaration --declarationDir lib",
|
|
34
|
+
"watch": "vite build --watch",
|
|
35
|
+
"clean": "git clean -fdX",
|
|
36
|
+
"pub": "node ../../../scripts/publish-package.js"
|
|
37
|
+
}
|
|
38
|
+
}
|
package/vite.config.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { vanillaExtractPlugin } from "@vanilla-extract/vite-plugin";
|
|
3
|
+
import { defineConfig } from "vite";
|
|
4
|
+
|
|
5
|
+
import pkg from "./package.json";
|
|
6
|
+
|
|
7
|
+
export default defineConfig({
|
|
8
|
+
plugins: [vanillaExtractPlugin()],
|
|
9
|
+
build: {
|
|
10
|
+
lib: {
|
|
11
|
+
entry: path.resolve(__dirname, "src/index.ts"),
|
|
12
|
+
formats: ["es", "cjs"],
|
|
13
|
+
fileName: (format) => `index.${format}.js`,
|
|
14
|
+
},
|
|
15
|
+
outDir: path.resolve(__dirname, "./lib"),
|
|
16
|
+
emptyOutDir: false,
|
|
17
|
+
rollupOptions: {
|
|
18
|
+
external: pkg.peerDependencies ? Object.keys(pkg.peerDependencies) : [],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
});
|