@spunto/brand-kit 0.6.0 → 0.8.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/package.json +1 -1
- package/src/home/check.ts +14 -0
- package/src/home/editions/ci.json +2 -2
- package/src/home/editions/cms.json +394 -0
- package/src/home/editions.ts +2 -2
- package/src/home/guide.ts +16 -0
- package/src/home/home.tsx +45 -0
- package/src/home/index.ts +2 -0
- package/src/home/showcase/catalog.ts +62 -0
- package/src/home/showcase/cms/board.tsx +162 -0
- package/src/home/showcase/cms/page.tsx +169 -0
- package/src/home/showcase/cms/parts.tsx +130 -0
- package/src/home/showcase/cms/sample.ts +172 -0
- package/src/home/showcase/cms/table.tsx +207 -0
- package/src/home/showcase/cms/views.tsx +166 -0
- package/src/home/showcase/stage.tsx +328 -0
- package/src/home/showcase/view.tsx +30 -0
- package/src/home/types.ts +17 -0
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react"
|
|
4
|
+
import { AppWindow, Cursor, Float, Icon, INK, LINE, MUTED, Stage, u, useStage, WASH, type IconId, type StageColors } from "../stage"
|
|
5
|
+
import { Avatar, CardTitle, Chip, ListHead, SIDE, StatusChip, TOP, WIN, type Lang } from "./parts"
|
|
6
|
+
import { article, FIELDS, PEOPLE, STATUS, STATUSES, TAGS, TINT, TOPICS, UI, type Article, type StatusKey } from "./sample"
|
|
7
|
+
|
|
8
|
+
/* The table: the same list, a cell edited where it is — a status picked in its cell, a tag added to a
|
|
9
|
+
card — and, floating beside it, the list's properties with the type each was declared with. */
|
|
10
|
+
|
|
11
|
+
const H = 560
|
|
12
|
+
const STILL = 9
|
|
13
|
+
/* 0 rest · 1 to a status cell · 2 its options open · 3 to « Prêt » · 4 picked · 5 to a tags cell · 6 its options open ·
|
|
14
|
+
7 to « équipe » · 8 picked · 9 rest · 10 fade · 11 rewind */
|
|
15
|
+
const LENGTHS = [900, 700, 650, 600, 1000, 750, 650, 600, 1300, 1700, 450, 90] as const
|
|
16
|
+
|
|
17
|
+
/** The view's sort: by publish date. */
|
|
18
|
+
export const ROWS = [10, 6, 3, 2, 1, 7, 4, 5, 8, 9]
|
|
19
|
+
export const ROW = 30
|
|
20
|
+
export const HEAD = 30
|
|
21
|
+
export const COLUMNS = { title: 236, status: 104, topic: 114, author: 132, tags: 118, date: 96 }
|
|
22
|
+
|
|
23
|
+
/** The row whose status is changed (review → ready), and the one that gets a tag (team). */
|
|
24
|
+
const STATUS_ROW = 3
|
|
25
|
+
const TAGS_ROW = 1
|
|
26
|
+
const NEW_STATUS: StatusKey = "ready"
|
|
27
|
+
const NEW_TAG = 4
|
|
28
|
+
|
|
29
|
+
const x = { status: SIDE + COLUMNS.title, tags: SIDE + COLUMNS.title + COLUMNS.status + COLUMNS.topic + COLUMNS.author }
|
|
30
|
+
const rowTop = (i: number) => TOP + HEAD + i * ROW
|
|
31
|
+
|
|
32
|
+
const HEADS: { icon: IconId; label: (lang: Lang) => string; w: number }[] = [
|
|
33
|
+
{ icon: "text", label: (l) => UI.title[l], w: COLUMNS.title },
|
|
34
|
+
{ icon: "status", label: (l) => UI.status[l], w: COLUMNS.status },
|
|
35
|
+
{ icon: "select", label: (l) => FIELDS.topic.name[l], w: COLUMNS.topic },
|
|
36
|
+
{ icon: "person", label: (l) => FIELDS.author.name[l], w: COLUMNS.author },
|
|
37
|
+
{ icon: "tag", label: (l) => FIELDS.tags.name[l], w: COLUMNS.tags },
|
|
38
|
+
{ icon: "calendar", label: (l) => FIELDS.date.name[l], w: COLUMNS.date },
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
function Cell({ w, focus, tone, children }: { w: number; focus?: boolean; tone: string; children: ReactNode }) {
|
|
42
|
+
return (
|
|
43
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(4), flexShrink: 0, width: u(w), height: "100%", padding: `0 ${u(9)}`, overflow: "hidden", boxShadow: focus ? `inset 0 0 0 ${u(1.5)} ${tone}` : "none", transition: "box-shadow 0.2s ease" }}>{children}</div>
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** The table's head: a column per property, with the icon of its type. */
|
|
48
|
+
export function TableHead({ lang }: { lang: Lang }) {
|
|
49
|
+
return (
|
|
50
|
+
<div style={{ display: "flex", height: u(HEAD), background: WASH, borderBottom: `1px solid ${LINE}`, fontSize: u(10.5), color: MUTED }}>
|
|
51
|
+
{HEADS.map((h) => (
|
|
52
|
+
<div key={h.icon} style={{ display: "flex", alignItems: "center", gap: u(6), flexShrink: 0, width: u(h.w), padding: `0 ${u(9)}`, whiteSpace: "nowrap", overflow: "hidden" }}>
|
|
53
|
+
<Icon id={h.icon} size={11} />
|
|
54
|
+
{h.label(lang)}
|
|
55
|
+
</div>
|
|
56
|
+
))}
|
|
57
|
+
</div>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function TitleCell({ a, lang }: { a: Article; lang: Lang }) {
|
|
62
|
+
return (
|
|
63
|
+
<div style={{ flexShrink: 0, width: u(COLUMNS.title), padding: `0 ${u(10)}`, borderRight: `1px solid ${LINE}`, height: "100%", display: "flex", alignItems: "center" }}>
|
|
64
|
+
<CardTitle a={a} lang={lang} style={{ width: "100%" }} />
|
|
65
|
+
</div>
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** A row's cells after its title — a table row here, and a card of the views screen while it is a row. */
|
|
70
|
+
export function Cells({ a, lang, tone, status = a.status, tags = a.tags, focus }: { a: Article; lang: Lang; tone: string; status?: StatusKey; tags?: number[]; focus?: "status" | "tags" }) {
|
|
71
|
+
return (
|
|
72
|
+
<>
|
|
73
|
+
<Cell w={COLUMNS.status} tone={tone} focus={focus === "status"}>
|
|
74
|
+
<StatusChip status={status} lang={lang} />
|
|
75
|
+
</Cell>
|
|
76
|
+
<Cell w={COLUMNS.topic} tone={tone}>
|
|
77
|
+
<Chip tint={TOPICS[a.topic].tint}>{TOPICS[a.topic].label[lang]}</Chip>
|
|
78
|
+
</Cell>
|
|
79
|
+
<Cell w={COLUMNS.author} tone={tone}>
|
|
80
|
+
<Avatar person={a.author} lang={lang} size={16} />
|
|
81
|
+
<span style={{ marginLeft: u(3), fontSize: u(11), whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>{PEOPLE[a.author].name[lang]}</span>
|
|
82
|
+
</Cell>
|
|
83
|
+
<Cell w={COLUMNS.tags} tone={tone} focus={focus === "tags"}>
|
|
84
|
+
{tags.map((t) => (
|
|
85
|
+
<Chip key={t} tint={TAGS[t].tint}>
|
|
86
|
+
{TAGS[t].label[lang]}
|
|
87
|
+
</Chip>
|
|
88
|
+
))}
|
|
89
|
+
</Cell>
|
|
90
|
+
<Cell w={COLUMNS.date} tone={tone}>
|
|
91
|
+
<span style={{ fontSize: u(10.5), color: MUTED, fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap" }}>{a.date}</span>
|
|
92
|
+
</Cell>
|
|
93
|
+
</>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function Options({ left, top, open, children }: { left: number; top: number; open: boolean; children: ReactNode }) {
|
|
98
|
+
return (
|
|
99
|
+
<div
|
|
100
|
+
style={{
|
|
101
|
+
position: "absolute",
|
|
102
|
+
left: u(left),
|
|
103
|
+
top: u(top),
|
|
104
|
+
width: u(132),
|
|
105
|
+
zIndex: 3,
|
|
106
|
+
padding: u(4),
|
|
107
|
+
borderRadius: u(7),
|
|
108
|
+
border: `1px solid ${LINE}`,
|
|
109
|
+
background: "#ffffff",
|
|
110
|
+
boxShadow: `0 ${u(14)} ${u(30)} ${u(-10)} rgba(18,27,23,0.35)`,
|
|
111
|
+
opacity: open ? 1 : 0,
|
|
112
|
+
transform: open ? "none" : `translateY(${u(-5)})`,
|
|
113
|
+
transition: "opacity 0.2s ease, transform 0.2s ease",
|
|
114
|
+
}}
|
|
115
|
+
>
|
|
116
|
+
{children}
|
|
117
|
+
</div>
|
|
118
|
+
)
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function Option({ hover, picked, tone, children }: { hover: boolean; picked: boolean; tone: string; children: ReactNode }) {
|
|
122
|
+
return (
|
|
123
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(7), height: u(24), padding: `0 ${u(7)}`, borderRadius: u(4), background: hover ? WASH : "transparent", transition: "background 0.2s ease" }}>
|
|
124
|
+
{children}
|
|
125
|
+
<Icon id="check" size={11} color={tone} width={2.4} style={{ marginLeft: "auto", opacity: picked ? 1 : 0, transition: "opacity 0.2s ease" }} />
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export function TableScreen({ lang, colors, night, label }: { lang: Lang; colors: StageColors; night: boolean; label: string }) {
|
|
131
|
+
const { ref, step } = useStage(LENGTHS, STILL)
|
|
132
|
+
const statusDone = step >= 4 && step <= 10
|
|
133
|
+
const tagDone = step >= 8 && step <= 10
|
|
134
|
+
const pointer =
|
|
135
|
+
step === 0 || step >= 11
|
|
136
|
+
? { x: 420, y: 420 }
|
|
137
|
+
: step <= 2
|
|
138
|
+
? { x: x.status + 62, y: rowTop(STATUS_ROW) + 17 }
|
|
139
|
+
: step <= 4
|
|
140
|
+
? { x: x.status + 70, y: rowTop(STATUS_ROW) + ROW + 8 + STATUSES.indexOf(NEW_STATUS) * 24 + 13 }
|
|
141
|
+
: step <= 6
|
|
142
|
+
? { x: x.tags + 76, y: rowTop(TAGS_ROW) + 17 }
|
|
143
|
+
: { x: x.tags + 70, y: rowTop(TAGS_ROW) + ROW + 8 + NEW_TAG * 24 + 13 }
|
|
144
|
+
const registry = Object.values(FIELDS)
|
|
145
|
+
const registryIcons: IconId[] = ["select", "person", "calendar", "tag", "people", "number"]
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<Stage stageRef={ref} colors={colors} night={night} height={H} label={label}>
|
|
149
|
+
<AppWindow {...WIN} h={H} address="cms.spunto.net">
|
|
150
|
+
<ListHead view={1} lang={lang} tone={colors.tone} />
|
|
151
|
+
<div style={{ position: "absolute", left: u(SIDE), top: u(TOP), width: u(800), borderRadius: u(7), border: `1px solid ${LINE}`, background: "#ffffff", overflow: "hidden", opacity: step >= 10 ? 0 : 1, transition: "opacity 0.4s ease" }}>
|
|
152
|
+
<TableHead lang={lang} />
|
|
153
|
+
{ROWS.map((n, i) => {
|
|
154
|
+
const a = article(n)
|
|
155
|
+
return (
|
|
156
|
+
<div key={n} style={{ display: "flex", alignItems: "center", height: u(ROW), borderBottom: i < ROWS.length - 1 ? `1px solid ${LINE}` : "none" }}>
|
|
157
|
+
<TitleCell a={a} lang={lang} />
|
|
158
|
+
<Cells
|
|
159
|
+
a={a}
|
|
160
|
+
lang={lang}
|
|
161
|
+
tone={colors.tone}
|
|
162
|
+
status={i === STATUS_ROW && statusDone ? NEW_STATUS : a.status}
|
|
163
|
+
tags={i === TAGS_ROW && tagDone ? [...a.tags, NEW_TAG] : a.tags}
|
|
164
|
+
focus={i === STATUS_ROW && step >= 2 && step <= 3 ? "status" : i === TAGS_ROW && step >= 6 && step <= 8 ? "tags" : undefined}
|
|
165
|
+
/>
|
|
166
|
+
</div>
|
|
167
|
+
)
|
|
168
|
+
})}
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
<Options left={x.status + 4} top={rowTop(STATUS_ROW) + ROW + 3} open={step === 2 || step === 3}>
|
|
172
|
+
{STATUSES.map((key) => (
|
|
173
|
+
<Option key={key} hover={step === 3 && key === NEW_STATUS} picked={key === article(ROWS[STATUS_ROW]).status} tone={colors.tone}>
|
|
174
|
+
<span style={{ width: u(7), height: u(7), borderRadius: "50%", background: TINT[STATUS[key].tint].dot }} />
|
|
175
|
+
<span style={{ fontSize: u(11), color: INK }}>{STATUS[key].label[lang]}</span>
|
|
176
|
+
</Option>
|
|
177
|
+
))}
|
|
178
|
+
</Options>
|
|
179
|
+
<Options left={x.tags + 4} top={rowTop(TAGS_ROW) + ROW + 3} open={step >= 6 && step <= 8}>
|
|
180
|
+
{TAGS.map((tag, t) => (
|
|
181
|
+
<Option key={t} hover={step === 7 && t === NEW_TAG} picked={article(ROWS[TAGS_ROW]).tags.includes(t) || (t === NEW_TAG && tagDone)} tone={colors.tone}>
|
|
182
|
+
<Chip tint={tag.tint}>{tag.label[lang]}</Chip>
|
|
183
|
+
</Option>
|
|
184
|
+
))}
|
|
185
|
+
</Options>
|
|
186
|
+
<Cursor {...pointer} down={step === 4 || step === 8} hidden={step === 0 || step >= 9} />
|
|
187
|
+
</AppWindow>
|
|
188
|
+
|
|
189
|
+
<Float x={598} y={356} w={300} depth={150} style={{ background: "#ffffff" }}>
|
|
190
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(7), padding: `${u(9)} ${u(13)}`, borderBottom: `1px solid ${LINE}`, fontSize: u(11), fontWeight: 650 }}>
|
|
191
|
+
<Icon id="columns" size={12} color={colors.tone} />
|
|
192
|
+
{UI.properties[lang]}
|
|
193
|
+
<span style={{ marginLeft: "auto", fontSize: u(9.5), fontWeight: 500, color: MUTED }}>{registry.length}</span>
|
|
194
|
+
</div>
|
|
195
|
+
<div style={{ padding: `${u(5)} 0 ${u(7)}` }}>
|
|
196
|
+
{registry.map((f, i) => (
|
|
197
|
+
<div key={i} style={{ display: "flex", alignItems: "center", gap: u(8), height: u(25), padding: `0 ${u(13)}`, fontSize: u(11) }}>
|
|
198
|
+
<Icon id={registryIcons[i]} size={12} color={MUTED} />
|
|
199
|
+
<span style={{ fontWeight: 520, whiteSpace: "nowrap" }}>{f.name[lang]}</span>
|
|
200
|
+
<span style={{ marginLeft: "auto", padding: `${u(1)} ${u(6)}`, borderRadius: u(4), background: WASH, fontSize: u(9.5), color: MUTED, whiteSpace: "nowrap" }}>{f.type[lang]}</span>
|
|
201
|
+
</div>
|
|
202
|
+
))}
|
|
203
|
+
</div>
|
|
204
|
+
</Float>
|
|
205
|
+
</Stage>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import { AppWindow, CodeCard, Cursor, Float, Icon, LINE, MUTED, Stage, u, useStage, WASH, type StageColors } from "../stage"
|
|
4
|
+
import { Avatar, CardTitle, Chip, Labels, ListHead, SIDE, StatusChip, tabPoint, TOP, WIN, type Lang } from "./parts"
|
|
5
|
+
import { article, ARTICLES, CAPTION, FIELDS, STATUS, STATUSES, TAGS, TINT, TOPICS } from "./sample"
|
|
6
|
+
import { Cells, HEAD, ROW, ROWS, TableHead, TitleCell } from "./table"
|
|
7
|
+
|
|
8
|
+
/* One list, three saved views: the pointer goes from tab to tab and the same ten cards rearrange — a
|
|
9
|
+
board grouped by status, a table, a list grouped by topic. All three are the seed's views, sorted by
|
|
10
|
+
publish date; beside them, the definition each one sends to the API (content/docs/api/querying.mdx),
|
|
11
|
+
where only the grouping changes. */
|
|
12
|
+
|
|
13
|
+
const H = 580
|
|
14
|
+
const STILL = 6
|
|
15
|
+
/* 0 the board · 1 to the second tab · 2 click · 3 the table · 4 to the third tab · 5 click · 6 the list · 7 back to the first · 8 click */
|
|
16
|
+
const LENGTHS = [2300, 700, 200, 2700, 700, 200, 2900, 700, 200] as const
|
|
17
|
+
|
|
18
|
+
const WIDTH = 800
|
|
19
|
+
const COL = { w: 191, gap: 12, head: 38, inset: 7, between: 8, card: 72 }
|
|
20
|
+
const GROUP = { head: 26, row: 28, gap: 8 }
|
|
21
|
+
|
|
22
|
+
type Rect = { x: number; y: number; w: number; h: number }
|
|
23
|
+
|
|
24
|
+
const byDate = (a: number, b: number) => article(a).date.localeCompare(article(b).date)
|
|
25
|
+
const numbers = ARTICLES.map((a) => a.n)
|
|
26
|
+
|
|
27
|
+
const COLUMNS = STATUSES.map((key) => numbers.filter((n) => article(n).status === key).sort(byDate))
|
|
28
|
+
const GROUPS = TOPICS.map((_, t) => numbers.filter((n) => article(n).topic === t).sort(byDate))
|
|
29
|
+
const GROUP_TOP = GROUPS.map((_, g) => GROUPS.slice(0, g).reduce((y, rows) => y + GROUP.head + rows.length * GROUP.row + GROUP.gap, TOP))
|
|
30
|
+
|
|
31
|
+
/** Where each card sits in each view: on the board, in the table, in the list. */
|
|
32
|
+
const PLACES: Record<number, Rect>[] = [{}, {}, {}]
|
|
33
|
+
COLUMNS.forEach((column, c) =>
|
|
34
|
+
column.forEach((n, i) => {
|
|
35
|
+
PLACES[0][n] = { x: SIDE + c * (COL.w + COL.gap) + COL.inset, y: TOP + COL.head + i * (COL.card + COL.between), w: COL.w - COL.inset * 2, h: COL.card }
|
|
36
|
+
}),
|
|
37
|
+
)
|
|
38
|
+
ROWS.forEach((n, i) => {
|
|
39
|
+
PLACES[1][n] = { x: SIDE, y: TOP + HEAD + i * ROW, w: WIDTH, h: ROW }
|
|
40
|
+
})
|
|
41
|
+
GROUPS.forEach((rows, g) =>
|
|
42
|
+
rows.forEach((n, i) => {
|
|
43
|
+
PLACES[2][n] = { x: SIDE, y: GROUP_TOP[g] + GROUP.head + i * GROUP.row, w: WIDTH, h: GROUP.row }
|
|
44
|
+
}),
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
const EASE = "cubic-bezier(0.3, 0.7, 0.2, 1)"
|
|
48
|
+
const layer = (on: boolean) => ({ opacity: on ? 1 : 0, transition: `opacity 0.45s ease ${on ? "0.15s" : "0s"}` })
|
|
49
|
+
|
|
50
|
+
export function ViewsScreen({ lang, colors, night, label }: { lang: Lang; colors: StageColors; night: boolean; label: string }) {
|
|
51
|
+
const { ref, step } = useStage(LENGTHS, STILL)
|
|
52
|
+
const view = step < 3 ? 0 : step < 6 ? 1 : 2
|
|
53
|
+
const target = step === 0 ? 0 : step <= 3 ? 1 : step <= 6 ? 2 : 0
|
|
54
|
+
const tab = tabPoint(target)
|
|
55
|
+
const date = `"<${FIELDS.date.name[lang]}>"`
|
|
56
|
+
// The table has no grouping: its line folds away still saying what the board grouped by.
|
|
57
|
+
const grouping = view === 2 ? `"<${FIELDS.topic.name[lang]}>"` : '"sys:status"'
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<Stage stageRef={ref} colors={colors} night={night} height={H} label={label}>
|
|
61
|
+
<AppWindow {...WIN} h={H} address="cms.spunto.net">
|
|
62
|
+
<ListHead view={view} lang={lang} tone={colors.tone} />
|
|
63
|
+
|
|
64
|
+
<div style={layer(view === 0)}>
|
|
65
|
+
{STATUSES.map((key, c) => (
|
|
66
|
+
<div key={key} style={{ position: "absolute", left: u(SIDE + c * (COL.w + COL.gap)), top: u(TOP), width: u(COL.w), height: u(H), borderRadius: u(7), border: `1px solid ${LINE}`, background: WASH }}>
|
|
67
|
+
<div style={{ margin: `${u(7)} ${u(8)} 0`, height: u(3), borderRadius: u(2), background: TINT[STATUS[key].tint].dot }} />
|
|
68
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(7), padding: `${u(7)} ${u(9)}`, fontSize: u(11.5), fontWeight: 650 }}>
|
|
69
|
+
{STATUS[key].label[lang]}
|
|
70
|
+
<span style={{ minWidth: u(16), padding: `0 ${u(4)}`, borderRadius: u(8), border: `1px solid ${LINE}`, background: "#ffffff", fontSize: u(9.5), fontWeight: 500, color: MUTED, textAlign: "center" }}>{COLUMNS[c].length}</span>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
))}
|
|
74
|
+
</div>
|
|
75
|
+
|
|
76
|
+
<div style={layer(view === 1)}>
|
|
77
|
+
<div style={{ position: "absolute", left: u(SIDE), top: u(TOP), width: u(WIDTH), height: u(HEAD + ROWS.length * ROW), borderRadius: u(7), border: `1px solid ${LINE}`, background: "#ffffff", overflow: "hidden" }}>
|
|
78
|
+
<TableHead lang={lang} />
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div style={layer(view === 2)}>
|
|
83
|
+
{GROUPS.map((rows, g) => (
|
|
84
|
+
<div key={g} style={{ position: "absolute", left: u(SIDE), top: u(GROUP_TOP[g]), width: u(WIDTH), height: u(GROUP.head + rows.length * GROUP.row), borderRadius: u(7), border: `1px solid ${LINE}`, background: "#ffffff", overflow: "hidden" }}>
|
|
85
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(8), height: u(GROUP.head), padding: `0 ${u(10)}`, background: WASH, borderBottom: `1px solid ${LINE}`, fontSize: u(11.5), fontWeight: 650 }}>
|
|
86
|
+
<Icon id="chevron" size={11} color={MUTED} />
|
|
87
|
+
<span style={{ width: u(7), height: u(7), borderRadius: "50%", background: TINT[TOPICS[g].tint].dot }} />
|
|
88
|
+
{TOPICS[g].label[lang]}
|
|
89
|
+
<span style={{ minWidth: u(16), padding: `0 ${u(4)}`, borderRadius: u(8), border: `1px solid ${LINE}`, background: "#ffffff", fontSize: u(9.5), fontWeight: 500, color: MUTED, textAlign: "center" }}>{rows.length}</span>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
))}
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
{numbers.map((n) => {
|
|
96
|
+
const a = article(n)
|
|
97
|
+
const at = PLACES[view][n]
|
|
98
|
+
const card = view === 0
|
|
99
|
+
return (
|
|
100
|
+
<div
|
|
101
|
+
key={n}
|
|
102
|
+
style={{
|
|
103
|
+
position: "absolute",
|
|
104
|
+
left: 0,
|
|
105
|
+
top: 0,
|
|
106
|
+
width: u(at.w),
|
|
107
|
+
height: u(at.h),
|
|
108
|
+
overflow: "hidden",
|
|
109
|
+
borderRadius: u(card ? 6 : 0),
|
|
110
|
+
border: `1px solid ${card ? LINE : "rgba(220,225,222,0)"}`,
|
|
111
|
+
background: card ? "#ffffff" : "rgba(255,255,255,0)",
|
|
112
|
+
boxShadow: card ? `0 ${u(1)} ${u(2)} rgba(18,27,23,0.06)` : `inset 0 -1px 0 ${LINE}`,
|
|
113
|
+
transform: `translate(${u(at.x)}, ${u(at.y)})`,
|
|
114
|
+
transition: `transform 0.8s ${EASE}, width 0.8s ${EASE}, height 0.8s ${EASE}, border-radius 0.5s ease, border-color 0.5s ease, background 0.5s ease, box-shadow 0.5s ease`,
|
|
115
|
+
transitionDelay: `${(n % 5) * 30}ms`,
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
<div style={{ position: "absolute", left: 0, top: 0, width: u(COL.w - COL.inset * 2), padding: `${u(8)} ${u(10)}`, ...layer(view === 0) }}>
|
|
119
|
+
<CardTitle a={a} lang={lang} lines={2} style={{ height: u(31) }} />
|
|
120
|
+
<div style={{ display: "flex", alignItems: "center", gap: u(4), marginTop: u(6), overflow: "hidden" }}>
|
|
121
|
+
<Labels a={a} lang={lang} />
|
|
122
|
+
<Avatar person={a.author} lang={lang} size={16} style={{ marginLeft: "auto" }} />
|
|
123
|
+
</div>
|
|
124
|
+
</div>
|
|
125
|
+
<div style={{ position: "absolute", left: -1, top: -1, width: u(WIDTH), height: u(ROW), display: "flex", alignItems: "center", ...layer(view === 1) }}>
|
|
126
|
+
<TitleCell a={a} lang={lang} />
|
|
127
|
+
<Cells a={a} lang={lang} tone={colors.tone} />
|
|
128
|
+
</div>
|
|
129
|
+
<div style={{ position: "absolute", left: -1, top: -1, width: u(WIDTH), height: u(GROUP.row), display: "flex", alignItems: "center", gap: u(6), padding: `0 ${u(10)}`, ...layer(view === 2) }}>
|
|
130
|
+
<CardTitle a={a} lang={lang} style={{ flex: 1, minWidth: 0 }} />
|
|
131
|
+
<StatusChip status={a.status} lang={lang} />
|
|
132
|
+
<span style={{ display: "flex", alignItems: "center", gap: u(4), padding: `${u(1.5)} ${u(6)}`, borderRadius: u(4), border: `1px solid ${LINE}`, fontSize: u(9.6), color: MUTED, fontVariantNumeric: "tabular-nums", whiteSpace: "nowrap" }}>
|
|
133
|
+
<Icon id="calendar" size={9.5} />
|
|
134
|
+
{a.date}
|
|
135
|
+
</span>
|
|
136
|
+
{a.tags.map((t) => (
|
|
137
|
+
<Chip key={t} tint={TAGS[t].tint}>
|
|
138
|
+
{TAGS[t].label[lang]}
|
|
139
|
+
</Chip>
|
|
140
|
+
))}
|
|
141
|
+
<Avatar person={a.author} lang={lang} size={16} style={{ marginLeft: u(4) }} />
|
|
142
|
+
</div>
|
|
143
|
+
</div>
|
|
144
|
+
)
|
|
145
|
+
})}
|
|
146
|
+
<Cursor x={tab.x + 14} y={tab.y + 3} down={step === 2 || step === 5 || step === 8} />
|
|
147
|
+
</AppWindow>
|
|
148
|
+
|
|
149
|
+
<Float x={552} y={410} w={352} depth={160}>
|
|
150
|
+
<CodeCard
|
|
151
|
+
title={CAPTION.definition[lang]}
|
|
152
|
+
meta="POST"
|
|
153
|
+
signal={colors.signal}
|
|
154
|
+
lines={[
|
|
155
|
+
{ text: view === 1 ? "…/collections/{collectionId}/query" : "…/collections/{collectionId}/grouped-query", hot: true },
|
|
156
|
+
{ text: '{ "definition": {' },
|
|
157
|
+
{ text: ` "groupBy": { "fieldId": ${grouping} },`, hidden: view === 1, hot: true },
|
|
158
|
+
{ text: ` "sort": [{ "field": { "fieldId": ${date} },` },
|
|
159
|
+
{ text: ' "direction": "asc" }]' },
|
|
160
|
+
{ text: "} }" },
|
|
161
|
+
]}
|
|
162
|
+
/>
|
|
163
|
+
</Float>
|
|
164
|
+
</Stage>
|
|
165
|
+
)
|
|
166
|
+
}
|