oneslash-design-system 2.21.0 → 2.23.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 +1 -1
- package/dist/DESIGN.md +12 -1
- package/dist/cases/admin-inbox/split.jsx +22 -10
- package/dist/cases/admin-inbox.md +28 -23
- package/dist/cases/api-keys.md +1 -1
- package/dist/cases/app-shell/top-tabs.jsx +10 -4
- package/dist/cases/app-shell.md +13 -5
- package/dist/cases/breadcrumb/back-link.d.ts +1 -0
- package/dist/cases/breadcrumb/back-link.jsx +23 -0
- package/dist/cases/breadcrumb/trail.d.ts +1 -0
- package/dist/cases/breadcrumb/trail.jsx +28 -0
- package/dist/cases/breadcrumb.md +105 -0
- package/dist/cases/date-field/calendar.d.ts +1 -0
- package/dist/cases/date-field/calendar.jsx +80 -0
- package/dist/cases/date-field/typed.d.ts +1 -0
- package/dist/cases/date-field/typed.jsx +58 -0
- package/dist/cases/date-field.md +232 -0
- package/dist/cases/docs-component-page/reference.jsx +11 -1
- package/dist/cases/docs-component-page.md +19 -8
- package/dist/cases/file-upload/files.d.ts +1 -0
- package/dist/cases/file-upload/files.jsx +118 -0
- package/dist/cases/file-upload/picture.d.ts +1 -0
- package/dist/cases/file-upload/picture.jsx +50 -0
- package/dist/cases/file-upload.md +270 -0
- package/dist/cases/filter-menu.md +1 -1
- package/dist/cases/image-viewer/with-video.d.ts +1 -0
- package/dist/cases/image-viewer/with-video.jsx +42 -0
- package/dist/cases/image-viewer.md +72 -4
- package/dist/cases/master-detail/split.jsx +17 -10
- package/dist/cases/master-detail.md +26 -24
- package/dist/cases/message-reactions/picker.d.ts +1 -0
- package/dist/cases/message-reactions/picker.jsx +145 -0
- package/dist/cases/message-reactions/quick-pick.jsx +1 -1
- package/dist/cases/message-reactions.md +184 -3
- package/dist/cases/page-header.md +1 -1
- package/dist/cases/people-row/names.d.ts +1 -0
- package/dist/cases/people-row/names.jsx +20 -0
- package/dist/cases/people-row/stack.d.ts +1 -0
- package/dist/cases/people-row/stack.jsx +33 -0
- package/dist/cases/people-row.md +110 -0
- package/dist/cases/pricing-section/cards.jsx +3 -2
- package/dist/cases/pricing-section.md +4 -2
- package/dist/cases/profile-form/form.jsx +21 -10
- package/dist/cases/profile-form.md +38 -9
- package/dist/cases/settings-page/top-tabs.jsx +9 -6
- package/dist/cases/settings-page.md +13 -7
- package/dist/cases.json +312 -29
- package/dist/components/avatarStack.d.ts +22 -0
- package/dist/components/avatarStack.jsx +32 -0
- package/dist/components/breadcrumb.d.ts +12 -0
- package/dist/components/breadcrumb.jsx +24 -0
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.jsx +2 -2
- package/dist/components/calendar.d.ts +19 -0
- package/dist/components/calendar.jsx +126 -0
- package/dist/components/dateField.d.ts +35 -0
- package/dist/components/dateField.jsx +76 -0
- package/dist/components/dropZone.d.ts +53 -0
- package/dist/components/dropZone.jsx +136 -0
- package/dist/components/emojiPicker.d.ts +22 -0
- package/dist/components/emojiPicker.jsx +161 -0
- package/dist/components/itemList.d.ts +31 -0
- package/dist/components/itemList.jsx +81 -0
- package/dist/components/lightbox.d.ts +35 -8
- package/dist/components/lightbox.jsx +99 -23
- package/dist/components/menuItem.d.ts +1 -1
- package/dist/components/menuItem.jsx +4 -4
- package/dist/components/siteHeader.d.ts +13 -2
- package/dist/components/siteHeader.jsx +21 -12
- package/dist/components/tag.d.ts +6 -1
- package/dist/components/tag.jsx +10 -5
- package/dist/internal/date.d.ts +35 -0
- package/dist/internal/date.js +122 -0
- package/dist/internal/dropZone.d.ts +28 -0
- package/dist/internal/dropZone.js +42 -0
- package/dist/internal/emoji.d.ts +13 -0
- package/dist/internal/emoji.js +182 -0
- package/dist/internal/overlayStack.js +1 -1
- package/dist/internal/people.d.ts +1 -0
- package/dist/internal/people.js +12 -0
- package/dist/native-mapping.json +45 -3
- package/dist/stories/AvatarStack.stories.d.ts +7 -0
- package/dist/stories/AvatarStack.stories.jsx +46 -0
- package/dist/stories/Breadcrumb.stories.d.ts +7 -0
- package/dist/stories/Breadcrumb.stories.jsx +26 -0
- package/dist/stories/Button.stories.jsx +12 -8
- package/dist/stories/Calendar.stories.d.ts +6 -0
- package/dist/stories/Calendar.stories.jsx +15 -0
- package/dist/stories/Cases.generated.stories.d.ts +10 -0
- package/dist/stories/Cases.generated.stories.jsx +20 -0
- package/dist/stories/DateField.stories.d.ts +10 -0
- package/dist/stories/DateField.stories.jsx +132 -0
- package/dist/stories/DropZone.stories.d.ts +12 -0
- package/dist/stories/DropZone.stories.jsx +151 -0
- package/dist/stories/EmojiPicker.stories.d.ts +6 -0
- package/dist/stories/EmojiPicker.stories.jsx +92 -0
- package/dist/stories/ItemList.stories.d.ts +9 -0
- package/dist/stories/ItemList.stories.jsx +86 -0
- package/dist/stories/Lightbox.stories.d.ts +7 -0
- package/dist/stories/Lightbox.stories.jsx +88 -1
- package/dist/stories/MenuItem.stories.d.ts +1 -0
- package/dist/stories/MenuItem.stories.jsx +8 -0
- package/dist/stories/SiteHeader.stories.d.ts +4 -0
- package/dist/stories/SiteHeader.stories.jsx +89 -0
- package/package.json +3 -2
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import React, { useState } from "react";
|
|
38
|
+
import DropZone from "../components/dropZone";
|
|
39
|
+
import FormField from "../components/formField";
|
|
40
|
+
import Paragraph from "../components/paragraph";
|
|
41
|
+
import UserImage from "../components/userImage";
|
|
42
|
+
import { Stack } from "../components/layout";
|
|
43
|
+
var meta = {
|
|
44
|
+
title: "Components/DropZone",
|
|
45
|
+
component: DropZone,
|
|
46
|
+
};
|
|
47
|
+
export default meta;
|
|
48
|
+
var MB = 1024 * 1024;
|
|
49
|
+
// The caller turns each reason into words and shows them under the zone
|
|
50
|
+
function say(rejections) {
|
|
51
|
+
var first = rejections[0];
|
|
52
|
+
if (first.reason === "type")
|
|
53
|
+
return "".concat(first.name, " is not a JPG, PNG or WebP picture.");
|
|
54
|
+
if (first.reason === "size")
|
|
55
|
+
return "".concat(first.name, " is over 5 MB.");
|
|
56
|
+
return "Choose one picture at a time.";
|
|
57
|
+
}
|
|
58
|
+
function PictureBox() {
|
|
59
|
+
var _a = useState(), error = _a[0], setError = _a[1];
|
|
60
|
+
var _b = useState(), name = _b[0], setName = _b[1];
|
|
61
|
+
return (<div style={{ maxWidth: "420px" }}>
|
|
62
|
+
<FormField id="picture" label="Profile picture" error={error} help={name ? "Chosen: ".concat(name) : undefined}>
|
|
63
|
+
{function (f) { return (<DropZone id="picture-zone" aria-describedby={f['aria-describedby']} aria-invalid={f['aria-invalid']} status={error} label="Drop a picture here" hint="JPG, PNG or WebP, up to 5 MB" accept={["image/jpeg", "image/png", "image/webp"]} maxBytes={5 * MB} onFiles={function (files) {
|
|
64
|
+
setError(undefined);
|
|
65
|
+
setName(files[0].name);
|
|
66
|
+
}} onReject={function (r) { return setError(say(r)); }}/>); }}
|
|
67
|
+
</FormField>
|
|
68
|
+
</div>);
|
|
69
|
+
}
|
|
70
|
+
// One picture. A drop or the Choose File button; a wrong file shows its reason under the zone.
|
|
71
|
+
export var Picture = {
|
|
72
|
+
tags: ["shell"],
|
|
73
|
+
render: function () { return <PictureBox />; },
|
|
74
|
+
};
|
|
75
|
+
// Several files, up to five
|
|
76
|
+
export var Files = {
|
|
77
|
+
tags: ["shell"],
|
|
78
|
+
render: function () { return (<div style={{ maxWidth: "420px" }}>
|
|
79
|
+
<DropZone id="files-zone" label="Drop files here" hint="PDF or text, up to 10 MB each, five at most" accept={[".pdf", ".txt"]} maxBytes={10 * MB} multiple maxFiles={5} onFiles={function () { }}/>
|
|
80
|
+
</div>); },
|
|
81
|
+
};
|
|
82
|
+
// A row with the current picture, the Button and the hint. The whole row takes a drop.
|
|
83
|
+
export var Compact = {
|
|
84
|
+
tags: ["shell"],
|
|
85
|
+
render: function () { return (<div style={{ maxWidth: "420px" }}>
|
|
86
|
+
<DropZone id="compact-zone" label="Profile picture" size="compact" hint="JPG or PNG, up to 5 MB" accept={["image/jpeg", "image/png"]} maxBytes={5 * MB} onFiles={function () { }}>
|
|
87
|
+
<UserImage userHandle="Dana Lee" size={48} decorative/>
|
|
88
|
+
</DropZone>
|
|
89
|
+
</div>); },
|
|
90
|
+
};
|
|
91
|
+
export var Disabled = {
|
|
92
|
+
render: function () { return (<div style={{ maxWidth: "420px" }}>
|
|
93
|
+
<DropZone id="disabled-zone" label="Drop a picture here" hint="Uploads are paused" disabled onFiles={function () { }}/>
|
|
94
|
+
</div>); },
|
|
95
|
+
};
|
|
96
|
+
// The play drags a file over the zone, so the shot shows the drag state
|
|
97
|
+
var dragOver = function (canvasElement, selector) {
|
|
98
|
+
var _a;
|
|
99
|
+
var transfer = new DataTransfer();
|
|
100
|
+
transfer.items.add(new File(["x"], "photo.png", { type: "image/png" }));
|
|
101
|
+
(_a = canvasElement.querySelector(selector)) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new DragEvent("dragenter", { bubbles: true, cancelable: true, dataTransfer: transfer }));
|
|
102
|
+
};
|
|
103
|
+
export var Dragging = {
|
|
104
|
+
tags: ["shell"],
|
|
105
|
+
render: function () { return (<div style={{ maxWidth: "420px" }}>
|
|
106
|
+
<DropZone id="drag-zone" label="Drop a picture here" hint="JPG, PNG or WebP, up to 5 MB" accept={["image/*"]} onFiles={function () { }}/>
|
|
107
|
+
</div>); },
|
|
108
|
+
play: function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
109
|
+
var canvasElement = _b.canvasElement;
|
|
110
|
+
return __generator(this, function (_c) {
|
|
111
|
+
return [2 /*return*/, dragOver(canvasElement, "#drag-zone")];
|
|
112
|
+
});
|
|
113
|
+
}); },
|
|
114
|
+
};
|
|
115
|
+
export var DraggingCompact = {
|
|
116
|
+
render: function () { return (<div style={{ maxWidth: "420px" }}>
|
|
117
|
+
<DropZone id="drag-compact" label="Profile picture" size="compact" hint="JPG or PNG, up to 5 MB" onFiles={function () { }}>
|
|
118
|
+
<UserImage userHandle="Dana Lee" size={48} decorative/>
|
|
119
|
+
</DropZone>
|
|
120
|
+
</div>); },
|
|
121
|
+
play: function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
122
|
+
var canvasElement = _b.canvasElement;
|
|
123
|
+
return __generator(this, function (_c) {
|
|
124
|
+
return [2 /*return*/, dragOver(canvasElement, "#drag-compact")];
|
|
125
|
+
});
|
|
126
|
+
}); },
|
|
127
|
+
};
|
|
128
|
+
// Test-only: prints the last call of each callback. Args (`multiple:!true`, `disabled:!true`) come from the URL.
|
|
129
|
+
function Probe(_a) {
|
|
130
|
+
var multiple = _a.multiple, disabled = _a.disabled;
|
|
131
|
+
var _b = useState("(none)"), files = _b[0], setFiles = _b[1];
|
|
132
|
+
var _c = useState("(none)"), rejected = _c[0], setRejected = _c[1];
|
|
133
|
+
var _d = useState(0), calls = _d[0], setCalls = _d[1];
|
|
134
|
+
return (<Stack gap="large">
|
|
135
|
+
<DropZone id="probe" label="Drop a picture here" hint="PNG, up to 1 KB" accept={["image/png"]} maxBytes={1024} multiple={multiple} maxFiles={multiple ? 5 : undefined} disabled={disabled} onFiles={function (f) {
|
|
136
|
+
setCalls(function (c) { return c + 1; });
|
|
137
|
+
setFiles(f.map(function (x) { return x.name; }).join(", "));
|
|
138
|
+
}} onReject={function (r) { return setRejected(r.map(function (x) { return "".concat(x.name, ":").concat(x.reason); }).join(", ")); }}/>
|
|
139
|
+
<Paragraph>
|
|
140
|
+
Files: <span data-testid="files">{files}</span>. Calls: <span data-testid="calls">{calls}</span>. Rejected: <span data-testid="rejected">{rejected}</span>
|
|
141
|
+
</Paragraph>
|
|
142
|
+
</Stack>);
|
|
143
|
+
}
|
|
144
|
+
export var DropZoneProbe = {
|
|
145
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
146
|
+
render: function (_args, _a) {
|
|
147
|
+
var args = _a.args;
|
|
148
|
+
return <Probe {...args}/>;
|
|
149
|
+
},
|
|
150
|
+
args: { multiple: false, disabled: false },
|
|
151
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
+
if (ar || !(i in from)) {
|
|
40
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
+
ar[i] = from[i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
+
};
|
|
46
|
+
import React, { useState } from "react";
|
|
47
|
+
import EmojiPicker from "../components/emojiPicker";
|
|
48
|
+
import IconButton from "../components/iconButton";
|
|
49
|
+
import Popover from "../components/popover";
|
|
50
|
+
import Paragraph from "../components/paragraph";
|
|
51
|
+
import { Cluster } from "../components/layout";
|
|
52
|
+
var meta = {
|
|
53
|
+
title: "Components/EmojiPicker",
|
|
54
|
+
component: EmojiPicker,
|
|
55
|
+
};
|
|
56
|
+
export default meta;
|
|
57
|
+
// An 'Add reaction' button opens the picker in a Popover; a pick closes it and focus returns to the button.
|
|
58
|
+
// The line beside it counts the picks.
|
|
59
|
+
function ReactionBox() {
|
|
60
|
+
var _a = useState(null), anchor = _a[0], setAnchor = _a[1];
|
|
61
|
+
var _b = useState(false), open = _b[0], setOpen = _b[1];
|
|
62
|
+
var _c = useState([]), picks = _c[0], setPicks = _c[1];
|
|
63
|
+
var last = picks[picks.length - 1];
|
|
64
|
+
return (<Cluster gap="small">
|
|
65
|
+
<IconButton id="add-reaction" color="iconOnly" state={open ? "selected" : "enabled"} size="medium" iconName="SmilePlus" ariaLabel="Add reaction" aria-haspopup="dialog" aria-expanded={open} onClick={function (e) {
|
|
66
|
+
setAnchor(e.currentTarget);
|
|
67
|
+
setOpen(!open);
|
|
68
|
+
}}/>
|
|
69
|
+
<Paragraph>
|
|
70
|
+
Picks: <span data-testid="picks">{picks.length}</span>. Last: <span data-testid="last">{last ? last.name : "none"}</span>
|
|
71
|
+
</Paragraph>
|
|
72
|
+
<Popover open={open} anchorEl={anchor} onClose={function () { return setOpen(false); }} returnFocus>
|
|
73
|
+
<EmojiPicker id="reaction" selected={["👍"]} onPick={function (emoji) {
|
|
74
|
+
setPicks(function (p) { return __spreadArray(__spreadArray([], p, true), [emoji], false); });
|
|
75
|
+
setOpen(false);
|
|
76
|
+
}}/>
|
|
77
|
+
</Popover>
|
|
78
|
+
</Cluster>);
|
|
79
|
+
}
|
|
80
|
+
// The play opens the picker, so the shots show it open (also at 375px)
|
|
81
|
+
export var InPopover = {
|
|
82
|
+
tags: ["shell"],
|
|
83
|
+
render: function () { return <ReactionBox />; },
|
|
84
|
+
play: function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
85
|
+
var _c;
|
|
86
|
+
var canvasElement = _b.canvasElement;
|
|
87
|
+
return __generator(this, function (_d) {
|
|
88
|
+
(_c = canvasElement.querySelector("#add-reaction")) === null || _c === void 0 ? void 0 : _c.click();
|
|
89
|
+
return [2 /*return*/];
|
|
90
|
+
});
|
|
91
|
+
}); },
|
|
92
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import ItemList from "../components/itemList";
|
|
3
|
+
declare const meta: Meta<typeof ItemList>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ItemList>;
|
|
6
|
+
export declare const Inbox: Story;
|
|
7
|
+
export declare const InboxProbe: Story;
|
|
8
|
+
export declare const RemoveProbe: Story;
|
|
9
|
+
export declare const LinkProbe: Story;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from "react";
|
|
13
|
+
import ItemList from "../components/itemList";
|
|
14
|
+
import { SettingsLayout } from "../components/settingsSection";
|
|
15
|
+
import Button from "../components/button";
|
|
16
|
+
import Paragraph from "../components/paragraph";
|
|
17
|
+
import TitleBar from "../components/titleBar";
|
|
18
|
+
import TextField from "../components/textField";
|
|
19
|
+
var meta = {
|
|
20
|
+
title: "Components/ItemList",
|
|
21
|
+
component: ItemList,
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
var mail = [
|
|
25
|
+
{ id: "launch", label: "Ben Carter", secondLabel: "Launch plan is ready" },
|
|
26
|
+
{ id: "screens", label: "Omar Reyes", secondLabel: "New screens for Friday" },
|
|
27
|
+
{ id: "invoice", label: "Mia Park", secondLabel: "Invoice for October" },
|
|
28
|
+
{ id: "offsite", label: "Ana Silva", secondLabel: "Team offsite in March" },
|
|
29
|
+
{ id: "pricing", label: "Ben Carter", secondLabel: "Pricing table copy" },
|
|
30
|
+
{ id: "hiring", label: "Omar Reyes", secondLabel: "Two new designers" },
|
|
31
|
+
{ id: "budget", label: "Mia Park", secondLabel: "Budget for next year" },
|
|
32
|
+
{ id: "survey", label: "Leo Grant", secondLabel: "Survey results are in" },
|
|
33
|
+
{ id: "travel", label: "Ana Silva", secondLabel: "Travel for the offsite" },
|
|
34
|
+
{ id: "logo", label: "Ben Carter", secondLabel: "Logo files" },
|
|
35
|
+
{ id: "notes", label: "Omar Reyes", secondLabel: "Notes from Monday" },
|
|
36
|
+
{ id: "review", label: "Mia Park", secondLabel: "Review of the new home page" },
|
|
37
|
+
];
|
|
38
|
+
function InboxBox(_a) {
|
|
39
|
+
var rows = _a.rows, _b = _a.field, field = _b === void 0 ? false : _b, _c = _a.archive, archive = _c === void 0 ? false : _c, _d = _a.links, links = _d === void 0 ? false : _d;
|
|
40
|
+
var _e = React.useState(rows), list = _e[0], setList = _e[1];
|
|
41
|
+
var _f = React.useState(rows[0].id), current = _f[0], setCurrent = _f[1];
|
|
42
|
+
var _g = React.useState(false), open = _g[0], setOpen = _g[1];
|
|
43
|
+
var _h = React.useState(""), reply = _h[0], setReply = _h[1];
|
|
44
|
+
var item = list.find(function (m) { return m.id === current; });
|
|
45
|
+
var onArchive = function () {
|
|
46
|
+
var at = list.findIndex(function (m) { return m.id === current; });
|
|
47
|
+
var next = list.filter(function (m) { return m.id !== current; });
|
|
48
|
+
setList(next);
|
|
49
|
+
if (next.length)
|
|
50
|
+
setCurrent(next[Math.min(at, next.length - 1)].id);
|
|
51
|
+
};
|
|
52
|
+
return (<SettingsLayout navWidth="wide" showContent={open} back={<Button type="tertiary" size="small" state="enabled" label="Back to Inbox" decoIcon="ChevronLeft" onClickButton={function () { return setOpen(false); }}/>} nav={<ItemList id="inbox" aria-label="Inbox" items={links ? list.map(function (m) { return (__assign(__assign({}, m), { href: "#".concat(m.id) })); }) : list} selectedId={current} onSelect={function (id, how) {
|
|
53
|
+
setCurrent(id);
|
|
54
|
+
setOpen(true);
|
|
55
|
+
// An app replaces the address on a keyboard move, so Back does not step through each row. A click's link pushes it.
|
|
56
|
+
if (links && how === "keyboard")
|
|
57
|
+
window.history.replaceState(null, "", "#".concat(id));
|
|
58
|
+
}}/>}>
|
|
59
|
+
{item && (<>
|
|
60
|
+
<TitleBar title={item.secondLabel}/>
|
|
61
|
+
<Paragraph>{item.label}: the details are in the brief. Reply here when you have read it.</Paragraph>
|
|
62
|
+
{field && <TextField id="inbox-reply" label="Reply" value={reply} onChange={function (e) { return setReply(e.target.value); }}/>}
|
|
63
|
+
{archive && <Button type="secondary" size="small" state="enabled" label="Archive" decoIcon="Archive" onClickButton={onArchive}/>}
|
|
64
|
+
</>)}
|
|
65
|
+
</SettingsLayout>);
|
|
66
|
+
}
|
|
67
|
+
// Also shot at 375px, where the list is the whole screen until a row is opened
|
|
68
|
+
export var Inbox = {
|
|
69
|
+
tags: ["shell"],
|
|
70
|
+
render: function () { return <InboxBox rows={mail.slice(0, 5)}/>; },
|
|
71
|
+
};
|
|
72
|
+
// Test-only: twelve rows and a field in the detail.
|
|
73
|
+
export var InboxProbe = {
|
|
74
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
75
|
+
render: function () { return <InboxBox rows={mail} field/>; },
|
|
76
|
+
};
|
|
77
|
+
// Test-only: an Archive Button removes the open row.
|
|
78
|
+
export var RemoveProbe = {
|
|
79
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
80
|
+
render: function () { return <InboxBox rows={mail.slice(0, 4)} archive/>; },
|
|
81
|
+
};
|
|
82
|
+
// Test-only: link rows, as an app with an address per item has.
|
|
83
|
+
export var LinkProbe = {
|
|
84
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
85
|
+
render: function () { return <InboxBox rows={mail.slice(0, 5)} links/>; },
|
|
86
|
+
};
|
|
@@ -6,3 +6,10 @@ type Story = StoryObj<typeof Lightbox>;
|
|
|
6
6
|
export declare const Gallery: Story;
|
|
7
7
|
export declare const One: Story;
|
|
8
8
|
export declare const Broken: Story;
|
|
9
|
+
export declare const BrokenThumbnail: Story;
|
|
10
|
+
export declare const WithVideo: Story;
|
|
11
|
+
export declare const BrokenPosterProbe: Story;
|
|
12
|
+
export declare const BrokenVideoProbe: Story;
|
|
13
|
+
export declare const OneVideoProbe: Story;
|
|
14
|
+
export declare const ThumbnailHydrateProbe: Story;
|
|
15
|
+
export declare const ThumbnailHydrateGoodProbe: Story;
|
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
13
|
+
import { renderToString } from "react-dom/server";
|
|
14
|
+
import { hydrateRoot } from "react-dom/client";
|
|
2
15
|
import Lightbox, { LightboxThumbnail } from "../components/lightbox";
|
|
3
16
|
var meta = {
|
|
4
17
|
title: "Components/Lightbox",
|
|
@@ -38,3 +51,77 @@ export var One = {
|
|
|
38
51
|
export var Broken = {
|
|
39
52
|
render: function () { return (<GalleryDemo images={[{ src: "data:image/png;base64,bm90IGFuIGltYWdl", alt: "The launch checklist pinned to a board" }, images[0], images[1]]} open/>); },
|
|
40
53
|
};
|
|
54
|
+
var brokenFirst = [{ src: "data:image/png;base64,bm90IGFuIGltYWdl", alt: "The launch checklist pinned to a board" }, images[0], images[1]];
|
|
55
|
+
// Closed, with a first thumbnail that fails: its tile is the size of the others and still opens the viewer.
|
|
56
|
+
export var BrokenThumbnail = {
|
|
57
|
+
tags: ["shell"],
|
|
58
|
+
render: function () { return <GalleryDemo images={brokenFirst}/>; },
|
|
59
|
+
};
|
|
60
|
+
// A short clip made for this repo (a ball rolling along the hillside, no sound) and its captions, from stories/assets,
|
|
61
|
+
// which Storybook serves at /media. The poster is the clip's first frame drawn again as an SVG.
|
|
62
|
+
var clip = "/media/hillside-ball.webm";
|
|
63
|
+
var clipCaptions = "/media/hillside-ball.vtt";
|
|
64
|
+
var clipPoster = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 240'%3E%3Crect width='320' height='240' fill='%23dfe9f2'/%3E%3Ccircle cx='240' cy='64' r='28' fill='%23f2c46d'/%3E%3Cpath d='M0 180 100 120l80 44 60-36 80 48v64H0z' fill='%232f6b4f'/%3E%3Ccircle cx='20' cy='200' r='14' fill='%23e08a5b'/%3E%3C/svg%3E";
|
|
65
|
+
var video = {
|
|
66
|
+
kind: "video",
|
|
67
|
+
src: clip,
|
|
68
|
+
poster: clipPoster,
|
|
69
|
+
alt: "A ball rolls along the foot of a green hillside",
|
|
70
|
+
captions: { src: clipCaptions, srclang: "en", label: "English" },
|
|
71
|
+
};
|
|
72
|
+
// Two images and a video between them. The video uses the browser's controls, never starts by itself and shows its
|
|
73
|
+
// captions; it pauses when the viewer steps away or closes.
|
|
74
|
+
export var WithVideo = {
|
|
75
|
+
tags: ["shell"],
|
|
76
|
+
render: function () { return <GalleryDemo images={[images[0], video, images[1]]}/>; },
|
|
77
|
+
};
|
|
78
|
+
// Test-only: closed, with a video whose poster fails (a data URL that is not an image).
|
|
79
|
+
export var BrokenPosterProbe = {
|
|
80
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
81
|
+
render: function () { return <GalleryDemo images={[images[0], __assign(__assign({}, video), { poster: "data:image/png;base64,bm90IGFuIGltYWdl" }), images[1]]}/>; },
|
|
82
|
+
};
|
|
83
|
+
// Test-only: open on a video that fails (a data URL that is not a video), with images after it.
|
|
84
|
+
export var BrokenVideoProbe = {
|
|
85
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
86
|
+
render: function () { return (<GalleryDemo images={[__assign(__assign({}, video), { src: "data:video/webm;base64,bm90IGEgdmlkZW8=" }), images[0], images[1]]} open/>); },
|
|
87
|
+
};
|
|
88
|
+
// Test-only: open on a lone video, so the viewer has no arrows and Close is the only button.
|
|
89
|
+
export var OneVideoProbe = {
|
|
90
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
91
|
+
render: function () { return <GalleryDemo images={[video]} open/>; },
|
|
92
|
+
};
|
|
93
|
+
// Test-only: the thumbnail's server markup is put on the page, its image fails (or, with a good image, loads), and
|
|
94
|
+
// only then does React hydrate it.
|
|
95
|
+
function HydrateProbe(_a) {
|
|
96
|
+
var _b = _a.image, image = _b === void 0 ? brokenFirst[0] : _b, _c = _a.after, after = _c === void 0 ? "error" : _c;
|
|
97
|
+
var ref = useRef(null);
|
|
98
|
+
useEffect(function () {
|
|
99
|
+
var el = ref.current;
|
|
100
|
+
if (!el)
|
|
101
|
+
return;
|
|
102
|
+
var thumb = <LightboxThumbnail image={image} onOpen={function () { }}/>;
|
|
103
|
+
el.innerHTML = renderToString(thumb);
|
|
104
|
+
var img = el.querySelector("img");
|
|
105
|
+
var root = null;
|
|
106
|
+
var hydrate = function () {
|
|
107
|
+
root = hydrateRoot(el, thumb);
|
|
108
|
+
};
|
|
109
|
+
img === null || img === void 0 ? void 0 : img.addEventListener(after, hydrate, { once: true });
|
|
110
|
+
return function () {
|
|
111
|
+
img === null || img === void 0 ? void 0 : img.removeEventListener(after, hydrate);
|
|
112
|
+
var r = root;
|
|
113
|
+
if (r)
|
|
114
|
+
setTimeout(function () { return r.unmount(); });
|
|
115
|
+
};
|
|
116
|
+
}, []);
|
|
117
|
+
return <div ref={ref} style={{ width: 160 }}/>;
|
|
118
|
+
}
|
|
119
|
+
export var ThumbnailHydrateProbe = {
|
|
120
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
121
|
+
render: function () { return <HydrateProbe />; },
|
|
122
|
+
};
|
|
123
|
+
// Test-only: a good thumbnail that has loaded before React hydrates it.
|
|
124
|
+
export var ThumbnailHydrateGoodProbe = {
|
|
125
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
126
|
+
render: function () { return <HydrateProbe image={images[0]} after="load"/>; },
|
|
127
|
+
};
|
|
@@ -96,3 +96,11 @@ export var Danger = {
|
|
|
96
96
|
isSelected: false,
|
|
97
97
|
},
|
|
98
98
|
};
|
|
99
|
+
export var SelectedWithTags = {
|
|
100
|
+
render: function () { return (<div style={{ width: 280 }} className="flex flex-col gap-1">
|
|
101
|
+
<MenuItem label="Inbox" iconName="Inbox" isSelected tag={{ label: "3", variant: "textOnly" }}/>
|
|
102
|
+
<MenuItem label="Online" iconName="Users" isSelected tag={{ label: "Live", variant: "dot", color: "success" }}/>
|
|
103
|
+
<MenuItem label="Drafts" iconName="File" tag={{ label: "3", variant: "textOnly" }}/>
|
|
104
|
+
<MenuItem label="Offline" iconName="Users" tag={{ label: "Away", variant: "dot", color: "warning" }}/>
|
|
105
|
+
</div>); },
|
|
106
|
+
};
|
|
@@ -6,5 +6,9 @@ type Story = StoryObj<typeof SiteHeader>;
|
|
|
6
6
|
export declare const Links: Story;
|
|
7
7
|
export declare const Phone: Story;
|
|
8
8
|
export declare const LongLabels: Story;
|
|
9
|
+
export declare const SectionLinks: Story;
|
|
10
|
+
export declare const SectionLinksOpen: Story;
|
|
11
|
+
export declare const SectionsOnlyProbe: Story;
|
|
12
|
+
export declare const EmptySectionProbe: Story;
|
|
9
13
|
export declare const Probe: Story;
|
|
10
14
|
export declare const UnmountProbe: Story;
|
|
@@ -1,7 +1,45 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
1
37
|
import React, { useEffect, useState } from "react";
|
|
2
38
|
import SiteHeader from "../components/siteHeader";
|
|
3
39
|
import Button from "../components/button";
|
|
4
40
|
import Paragraph from "../components/paragraph";
|
|
41
|
+
import TabsContainer from "../components/tabsContainer";
|
|
42
|
+
import Tab from "../components/tab";
|
|
5
43
|
var meta = {
|
|
6
44
|
title: "Components/SiteHeader",
|
|
7
45
|
component: SiteHeader,
|
|
@@ -71,6 +109,57 @@ export var LongLabels = {
|
|
|
71
109
|
<Page />
|
|
72
110
|
</Bleed>); },
|
|
73
111
|
};
|
|
112
|
+
var sectionLinks = {
|
|
113
|
+
title: "Components",
|
|
114
|
+
links: [
|
|
115
|
+
{ label: "Button", href: "#button" },
|
|
116
|
+
{ label: "Tag", href: "#tag", current: true },
|
|
117
|
+
{ label: "Tooltip", href: "#tooltip" },
|
|
118
|
+
],
|
|
119
|
+
};
|
|
120
|
+
// Also shot at 375px (the "shell" tag): the section's pages are only in the menu, so the bar is the same as in Links
|
|
121
|
+
export var SectionLinks = {
|
|
122
|
+
tags: ["shell"],
|
|
123
|
+
render: function () { return (<Bleed>
|
|
124
|
+
<SiteHeader brand={brand} links={links.slice(0, 3)} actions={actions} phoneAction={phoneAction} sectionLinks={sectionLinks}/>
|
|
125
|
+
<Page />
|
|
126
|
+
</Bleed>); },
|
|
127
|
+
};
|
|
128
|
+
// Shot at 375px only (the "phone" tag): the menu open, the main links, then the section's pages, titled
|
|
129
|
+
export var SectionLinksOpen = {
|
|
130
|
+
tags: ["phone", "!autodocs"],
|
|
131
|
+
render: SectionLinks.render,
|
|
132
|
+
play: function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
|
|
133
|
+
var _c;
|
|
134
|
+
var canvasElement = _b.canvasElement;
|
|
135
|
+
return __generator(this, function (_d) {
|
|
136
|
+
(_c = canvasElement.querySelector('button[aria-label="Menu"]')) === null || _c === void 0 ? void 0 : _c.click();
|
|
137
|
+
return [2 /*return*/];
|
|
138
|
+
});
|
|
139
|
+
}); },
|
|
140
|
+
};
|
|
141
|
+
// For tests/interactions.spec.ts only: a docs bar with section tabs as `nav`, no links and no actions, and the section's pages
|
|
142
|
+
export var SectionsOnlyProbe = {
|
|
143
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
144
|
+
render: function Render() {
|
|
145
|
+
var _a = useState("components"), tab = _a[0], setTab = _a[1];
|
|
146
|
+
return (<Bleed>
|
|
147
|
+
<SiteHeader brand={brand} links={[]} sectionLinks={sectionLinks} nav={<TabsContainer fill>
|
|
148
|
+
<Tab label="Guides" isSelected={tab === "guides"} onClickTab={function () { return setTab("guides"); }}/>
|
|
149
|
+
<Tab label="Components" isSelected={tab === "components"} onClickTab={function () { return setTab("components"); }}/>
|
|
150
|
+
</TabsContainer>}/>
|
|
151
|
+
<Page />
|
|
152
|
+
</Bleed>);
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
// For tests/interactions.spec.ts only: no links, one action and a section with no pages, so the menu is as without `sectionLinks`
|
|
156
|
+
export var EmptySectionProbe = {
|
|
157
|
+
tags: ["!dev", "!autodocs", "test-only"],
|
|
158
|
+
render: function () { return (<Bleed>
|
|
159
|
+
<SiteHeader brand={brand} links={[]} actions={actions} phoneAction={phoneAction} sectionLinks={{ title: "Components", links: [] }}/>
|
|
160
|
+
<Page />
|
|
161
|
+
</Bleed>); },
|
|
162
|
+
};
|
|
74
163
|
// For tests/interactions.spec.ts only: five links with long labels and two actions, checked at 375px and 768px
|
|
75
164
|
export var Probe = {
|
|
76
165
|
tags: ["!dev", "!autodocs", "test-only"],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oneslash-design-system",
|
|
3
3
|
"description": "A design system for the Oneslash projects",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.23.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -53,7 +53,8 @@
|
|
|
53
53
|
"storybook": "storybook dev -p 6006",
|
|
54
54
|
"build-storybook": "storybook build",
|
|
55
55
|
"pretest": "npm run build",
|
|
56
|
-
"test": "node --test scripts/*.test.js scripts/tokens/*.test.js scripts/cases/*.test.js",
|
|
56
|
+
"test": "node --test scripts/*.test.js scripts/tokens/*.test.js scripts/cases/*.test.js && npm run test:dates",
|
|
57
|
+
"test:dates": "TZ=America/New_York node --test scripts/date.test.js && TZ=Pacific/Auckland node --test scripts/date.test.js",
|
|
57
58
|
"check:contrast": "node scripts/check-contrast.js",
|
|
58
59
|
"test:visual": "playwright test tests/stories.spec.ts",
|
|
59
60
|
"test:visual:update": "playwright test tests/stories.spec.ts --update-snapshots",
|