-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccddb18
commit 795effd
Showing
12 changed files
with
198 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
const App = () => { | ||
return (_jsx("div", { children: "App" })); | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var jsx_runtime_1 = require("react/jsx-runtime"); | ||
var App = function () { | ||
return ((0, jsx_runtime_1.jsx)("div", { children: "App" })); | ||
}; | ||
export default App; | ||
exports.default = App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,22 @@ | ||
import { jsx as _jsx } from "react/jsx-runtime"; | ||
import './MyLabel.css'; | ||
export const MyLabel = ({ allCaps = false, color = 'primary', label = 'No label ', size = 'normal', fontColor = '', backgroundColor = 'transparent' }) => { | ||
return (_jsx("span", Object.assign({ className: `label ${size} text-${color}`, style: { color: fontColor, backgroundColor } }, { children: allCaps ? label.toUpperCase() : label }))); | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
export default MyLabel; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.MyLabel = void 0; | ||
var jsx_runtime_1 = require("react/jsx-runtime"); | ||
require("./MyLabel.css"); | ||
var MyLabel = function (_a) { | ||
var _b = _a.allCaps, allCaps = _b === void 0 ? false : _b, _c = _a.color, color = _c === void 0 ? 'primary' : _c, _d = _a.label, label = _d === void 0 ? 'No label ' : _d, _e = _a.size, size = _e === void 0 ? 'normal' : _e, _f = _a.fontColor, fontColor = _f === void 0 ? '' : _f, _g = _a.backgroundColor, backgroundColor = _g === void 0 ? 'transparent' : _g; | ||
return ((0, jsx_runtime_1.jsx)("span", __assign({ className: "label ".concat(size, " text-").concat(color), style: { color: fontColor, backgroundColor: backgroundColor } }, { children: allCaps ? label.toUpperCase() : label }))); | ||
}; | ||
exports.MyLabel = MyLabel; | ||
exports.default = exports.MyLabel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
export { Button } from './stories/Button'; | ||
export { Header } from './stories/Header'; | ||
export { MyLabel } from './components/MyLabel'; | ||
export { Page } from './stories/Page'; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Page = exports.MyLabel = exports.Header = exports.Button = void 0; | ||
var Button_1 = require("./stories/Button"); | ||
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return Button_1.Button; } }); | ||
var Header_1 = require("./stories/Header"); | ||
Object.defineProperty(exports, "Header", { enumerable: true, get: function () { return Header_1.Header; } }); | ||
var MyLabel_1 = require("./components/MyLabel"); | ||
Object.defineProperty(exports, "MyLabel", { enumerable: true, get: function () { return MyLabel_1.MyLabel; } }); | ||
var Page_1 = require("./stories/Page"); | ||
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; | ||
import { Button } from './Button'; | ||
import './header.css'; | ||
export const Header = ({ user, onLogin, onLogout, onCreateAccount }) => (_jsx("header", { children: _jsxs("div", Object.assign({ className: "wrapper" }, { children: [_jsxs("div", { children: [_jsx("svg", Object.assign({ width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg" }, { children: _jsxs("g", Object.assign({ fill: "none", fillRule: "evenodd" }, { children: [_jsx("path", { d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z", fill: "#FFF" }), _jsx("path", { d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z", fill: "#555AB9" }), _jsx("path", { d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z", fill: "#91BAF8" })] })) })), _jsx("h1", { children: "Acme" })] }), _jsx("div", { children: user ? (_jsxs(_Fragment, { children: [_jsxs("span", Object.assign({ className: "welcome" }, { children: ["Welcome, ", _jsx("b", { children: user.name }), "!"] })), _jsx(Button, { size: "small", onClick: onLogout, label: "Log out" })] })) : (_jsxs(_Fragment, { children: [_jsx(Button, { size: "small", onClick: onLogin, label: "Log in" }), _jsx(Button, { primary: true, size: "small", onClick: onCreateAccount, label: "Sign up" })] })) })] })) })); | ||
export default Header; | ||
"use strict"; | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Header = void 0; | ||
var jsx_runtime_1 = require("react/jsx-runtime"); | ||
var Button_1 = require("./Button"); | ||
require("./header.css"); | ||
var Header = function (_a) { | ||
var user = _a.user, onLogin = _a.onLogin, onLogout = _a.onLogout, onCreateAccount = _a.onCreateAccount; | ||
return ((0, jsx_runtime_1.jsx)("header", { children: (0, jsx_runtime_1.jsxs)("div", __assign({ className: "wrapper" }, { children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("svg", __assign({ width: "32", height: "32", viewBox: "0 0 32 32", xmlns: "http://www.w3.org/2000/svg" }, { children: (0, jsx_runtime_1.jsxs)("g", __assign({ fill: "none", fillRule: "evenodd" }, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z", fill: "#FFF" }), (0, jsx_runtime_1.jsx)("path", { d: "M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z", fill: "#555AB9" }), (0, jsx_runtime_1.jsx)("path", { d: "M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z", fill: "#91BAF8" })] })) })), (0, jsx_runtime_1.jsx)("h1", { children: "Acme" })] }), (0, jsx_runtime_1.jsx)("div", { children: user ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("span", __assign({ className: "welcome" }, { children: ["Welcome, ", (0, jsx_runtime_1.jsx)("b", { children: user.name }), "!"] })), (0, jsx_runtime_1.jsx)(Button_1.Button, { size: "small", onClick: onLogout, label: "Log out" })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { size: "small", onClick: onLogin, label: "Log in" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { primary: true, size: "small", onClick: onCreateAccount, label: "Sign up" })] })) })] })) })); | ||
}; | ||
exports.Header = Header; | ||
exports.default = exports.Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import { Header } from './Header'; | ||
const meta = { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LoggedOut = exports.LoggedIn = void 0; | ||
var Header_1 = require("./Header"); | ||
var meta = { | ||
title: 'Example/Header', | ||
component: Header, | ||
component: Header_1.Header, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/react/writing-docs/autodocs | ||
tags: ['autodocs'], | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/react/configure/story-layout | ||
layout: 'fullscreen', | ||
}, | ||
}; | ||
export default meta; | ||
export const LoggedIn = { | ||
exports.default = meta; | ||
exports.LoggedIn = { | ||
args: { | ||
user: { | ||
name: 'Jane Doe', | ||
}, | ||
}, | ||
}; | ||
export const LoggedOut = {}; | ||
exports.LoggedOut = {}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.