@squadbase/vantage 0.6.2-dev1.25d59a0 → 0.6.2-dev1.26a3cce
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/dist/{build-X5NVCQKT.js → build-U7GO26HR.js} +7 -7
- package/dist/{build-X5NVCQKT.js.map → build-U7GO26HR.js.map} +1 -1
- package/dist/{check-ZBIH422T.js → check-MRVAIHG5.js} +5 -5
- package/dist/{check-ZBIH422T.js.map → check-MRVAIHG5.js.map} +1 -1
- package/dist/chunk-2IAPIOPS.js +152 -0
- package/dist/chunk-2IAPIOPS.js.map +1 -0
- package/dist/chunk-57GHR5LN.js +163 -0
- package/dist/chunk-57GHR5LN.js.map +1 -0
- package/dist/chunk-6OTTGAPO.js +44 -0
- package/dist/chunk-6OTTGAPO.js.map +1 -0
- package/dist/{chunk-XPQSTZUU.js → chunk-7S52M2SL.js} +4 -3
- package/dist/chunk-7S52M2SL.js.map +1 -0
- package/dist/{chunk-V3LF7BE7.js → chunk-ANZLVSEP.js} +4 -5
- package/dist/chunk-ANZLVSEP.js.map +1 -0
- package/dist/{chunk-XQUSGIDG.js → chunk-CKWPK4RO.js} +10 -3
- package/dist/chunk-CKWPK4RO.js.map +1 -0
- package/dist/chunk-JXFCSF3K.js +673 -0
- package/dist/chunk-JXFCSF3K.js.map +1 -0
- package/dist/{chunk-7DZGJQ3P.js → chunk-PJ4SPXHS.js} +23 -6
- package/dist/chunk-PJ4SPXHS.js.map +1 -0
- package/dist/{chunk-HKSVYMYJ.js → chunk-QOXXOFGL.js} +61 -929
- package/dist/chunk-QOXXOFGL.js.map +1 -0
- package/dist/{chunk-CEXAQQ5W.js → chunk-S5MDTHH7.js} +180 -18
- package/dist/chunk-S5MDTHH7.js.map +1 -0
- package/dist/{chunk-2ICNHUG6.js → chunk-SDJTTMLK.js} +64 -7
- package/dist/chunk-SDJTTMLK.js.map +1 -0
- package/dist/{chunk-WAMZWZJB.js → chunk-SHZM3EXB.js} +19 -8
- package/dist/chunk-SHZM3EXB.js.map +1 -0
- package/dist/{chunk-JKLLFVEU.js → chunk-UWSQUHX6.js} +4 -99
- package/dist/chunk-UWSQUHX6.js.map +1 -0
- package/dist/cli.js +6 -6
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +8 -2
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +11 -247
- package/dist/components/index.js +5 -2
- package/dist/delta-text-CvwBGJ95.d.ts +15 -0
- package/dist/{dev-4XEDTELV.js → dev-O42JFQ64.js} +7 -7
- package/dist/{dev-4XEDTELV.js.map → dev-O42JFQ64.js.map} +1 -1
- package/dist/doc/index.d.ts +215 -2
- package/dist/doc/index.js +307 -3
- package/dist/doc/index.js.map +1 -1
- package/dist/{doctor-5E2VEZPK.js → doctor-YD3XAAOT.js} +5 -5
- package/dist/{doctor-5E2VEZPK.js.map → doctor-YD3XAAOT.js.map} +1 -1
- package/dist/format-U0cQl069.d.ts +243 -0
- package/dist/query/index.js +2 -2
- package/dist/{routes-3SGAFDMC.js → routes-PVKNT777.js} +4 -4
- package/dist/{routes-3SGAFDMC.js.map → routes-PVKNT777.js.map} +1 -1
- package/dist/slide/index.d.ts +272 -1
- package/dist/slide/index.js +972 -2
- package/dist/slide/index.js.map +1 -1
- package/dist/table/index.js +7 -4
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +4 -1
- package/dist/ui/index.js +3 -3
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-JHXZBGQS.js → upgrade-6DT7ADRP.js} +4 -4
- package/dist/{upgrade-JHXZBGQS.js.map → upgrade-6DT7ADRP.js.map} +1 -1
- package/dist/vite/index.js +3 -3
- package/docs/en/agent-skills.md +1 -1
- package/docs/en/changelog.md +2 -0
- package/docs/en/components.md +13 -2
- package/docs/en/doc/delta-text.md +40 -0
- package/docs/en/doc/doc-action-items.md +49 -0
- package/docs/en/doc/doc-callout.md +38 -0
- package/docs/en/doc/doc-data-table.md +60 -0
- package/docs/en/doc/doc-executive-summary.md +64 -0
- package/docs/en/doc/doc-figure.md +56 -0
- package/docs/en/doc/doc-key-findings.md +61 -0
- package/docs/en/doc/doc-kpi-scorecard.md +80 -0
- package/docs/en/doc/doc-notes-and-sources.md +43 -0
- package/docs/en/doc/doc-report-header.md +46 -0
- package/docs/en/pages-and-metadata.md +15 -0
- package/docs/en/parts/area-chart.md +99 -0
- package/docs/en/parts/bar-chart.md +91 -0
- package/docs/en/parts/bar-list.md +50 -0
- package/docs/en/parts/category-bar.md +37 -0
- package/docs/en/parts/chart-frame.md +39 -0
- package/docs/en/parts/delta.md +4 -3
- package/docs/en/parts/donut-chart.md +72 -0
- package/docs/en/parts/funnel-steps.md +2 -1
- package/docs/en/parts/heatmap.md +53 -0
- package/docs/en/parts/kpi-card.md +2 -1
- package/docs/en/parts/legend.md +35 -0
- package/docs/en/parts/line-chart.md +94 -0
- package/docs/en/parts/progress-circle.md +33 -0
- package/docs/en/parts/sample-data.md +39 -0
- package/docs/en/parts/scatter-chart.md +56 -0
- package/docs/en/parts/tracker.md +36 -0
- package/docs/en/parts/updated-at.md +30 -0
- package/docs/en/parts/waterfall-chart.md +56 -0
- package/docs/en/slide/slide-chart-full.md +48 -0
- package/docs/en/slide/slide-chart-insight.md +52 -0
- package/docs/en/slide/slide-columns.md +46 -0
- package/docs/en/slide/slide-comparison.md +68 -0
- package/docs/en/slide/slide-cover.md +39 -0
- package/docs/en/slide/slide-exec-summary.md +47 -0
- package/docs/en/slide/slide-heading.md +38 -0
- package/docs/en/slide/slide-kpi-grid.md +55 -0
- package/docs/en/slide/slide-kpi-hero.md +58 -0
- package/docs/en/slide/slide-next-actions.md +49 -0
- package/docs/en/slide/slide-scorecard-table.md +54 -0
- package/docs/en/slide/slide-section.md +44 -0
- package/docs/en/slide/slide-source-line.md +34 -0
- package/docs/en/ui/alert-dialog.md +42 -0
- package/docs/en/ui/avatar.md +31 -0
- package/docs/en/ui/combobox.md +74 -0
- package/docs/en/ui/drawer.md +41 -0
- package/docs/en/ui/empty.md +1 -1
- package/docs/en/ui/error-state.md +4 -3
- package/docs/en/ui/field.md +42 -0
- package/docs/en/ui/hover-card.md +21 -0
- package/docs/en/ui/kbd.md +17 -0
- package/docs/en/ui/loading.md +1 -1
- package/docs/en/ui/pagination.md +36 -0
- package/docs/en/ui/radio-group.md +21 -0
- package/docs/en/ui/toast.md +44 -0
- package/docs/en/ui/toggle-group.md +4 -3
- package/docs/index.json +857 -77
- package/docs/ja/agent-skills.md +1 -1
- package/docs/ja/changelog.md +2 -0
- package/docs/ja/components.md +12 -1
- package/docs/ja/doc/delta-text.md +40 -0
- package/docs/ja/doc/doc-action-items.md +49 -0
- package/docs/ja/doc/doc-callout.md +38 -0
- package/docs/ja/doc/doc-data-table.md +60 -0
- package/docs/ja/doc/doc-executive-summary.md +64 -0
- package/docs/ja/doc/doc-figure.md +56 -0
- package/docs/ja/doc/doc-key-findings.md +61 -0
- package/docs/ja/doc/doc-kpi-scorecard.md +80 -0
- package/docs/ja/doc/doc-notes-and-sources.md +43 -0
- package/docs/ja/doc/doc-report-header.md +46 -0
- package/docs/ja/page-types/slide.md +1 -0
- package/docs/ja/pages-and-metadata.md +15 -0
- package/docs/ja/parts/area-chart.md +49 -25
- package/docs/ja/parts/bar-chart.md +50 -24
- package/docs/ja/parts/bar-list.md +31 -8
- package/docs/ja/parts/chart-frame.md +36 -0
- package/docs/ja/parts/delta.md +5 -4
- package/docs/ja/parts/donut-chart.md +45 -26
- package/docs/ja/parts/funnel-steps.md +27 -8
- package/docs/ja/parts/heatmap.md +45 -0
- package/docs/ja/parts/kpi-card.md +2 -1
- package/docs/ja/parts/legend.md +36 -0
- package/docs/ja/parts/line-chart.md +48 -22
- package/docs/ja/parts/sample-data.md +61 -0
- package/docs/ja/parts/scatter-chart.md +69 -0
- package/docs/ja/parts/updated-at.md +27 -0
- package/docs/ja/parts/waterfall-chart.md +61 -0
- package/docs/ja/slide/slide-chart-full.md +48 -0
- package/docs/ja/slide/slide-chart-insight.md +52 -0
- package/docs/ja/slide/slide-columns.md +46 -0
- package/docs/ja/slide/slide-comparison.md +68 -0
- package/docs/ja/slide/slide-cover.md +39 -0
- package/docs/ja/slide/slide-exec-summary.md +47 -0
- package/docs/ja/slide/slide-heading.md +38 -0
- package/docs/ja/slide/slide-kpi-grid.md +55 -0
- package/docs/ja/slide/slide-kpi-hero.md +58 -0
- package/docs/ja/slide/slide-next-actions.md +49 -0
- package/docs/ja/slide/slide-scorecard-table.md +54 -0
- package/docs/ja/slide/slide-section.md +44 -0
- package/docs/ja/slide/slide-source-line.md +34 -0
- package/docs/ja/ui/empty.md +1 -1
- package/docs/ja/ui/error-state.md +4 -3
- package/docs/ja/ui/loading.md +1 -1
- package/docs/ja/ui/toggle-group.md +4 -3
- package/package.json +2 -2
- package/registry/ui/area-chart.tsx +45 -19
- package/registry/ui/bar-chart.tsx +45 -19
- package/registry/ui/bar-list.tsx +44 -17
- package/registry/ui/box-plot-chart.tsx +45 -19
- package/registry/ui/category-bar.tsx +44 -17
- package/registry/ui/chart-frame.tsx +44 -17
- package/registry/ui/delta.tsx +11 -8
- package/registry/ui/donut-chart.tsx +46 -19
- package/registry/ui/echart.tsx +171 -54
- package/registry/ui/heatmap.tsx +45 -19
- package/registry/ui/histogram-chart.tsx +45 -19
- package/registry/ui/kpi-card.tsx +9 -4
- package/registry/ui/legend.tsx +44 -17
- package/registry/ui/line-chart.tsx +45 -19
- package/registry/ui/page-shell.tsx +7 -7
- package/registry/ui/paired-chart.tsx +45 -19
- package/registry/ui/sample-data.tsx +1 -1
- package/registry/ui/scatter-chart.tsx +45 -19
- package/registry/ui/slider.tsx +1 -1
- package/registry/ui/status-badge.tsx +8 -8
- package/registry/ui/tooltip.tsx +6 -2
- package/registry/ui/tracker.tsx +9 -3
- package/registry/ui/trend-indicator.tsx +2 -2
- package/registry/ui/waterfall-chart.tsx +45 -19
- package/skills/vantage-design/SKILL.md +54 -54
- package/skills/vantage-design/references/extract.md +26 -27
- package/skills/vantage-design/references/format.md +12 -172
- package/skills/vantage-design/references/presets.md +50 -110
- package/skills/vantage-pitfalls/SKILL.md +5 -0
- package/skills/vantage-slide/SKILL.md +54 -36
- package/templates/AGENTS.md +32 -16
- package/templates/agents/doc.md +48 -0
- package/templates/agents/page.md +23 -2
- package/templates/agents/slide.md +77 -3
- package/theme.css +23 -19
- package/dist/chunk-2ICNHUG6.js.map +0 -1
- package/dist/chunk-7DZGJQ3P.js.map +0 -1
- package/dist/chunk-CEXAQQ5W.js.map +0 -1
- package/dist/chunk-HKSVYMYJ.js.map +0 -1
- package/dist/chunk-JKLLFVEU.js.map +0 -1
- package/dist/chunk-V3LF7BE7.js.map +0 -1
- package/dist/chunk-WAMZWZJB.js.map +0 -1
- package/dist/chunk-XPQSTZUU.js.map +0 -1
- package/dist/chunk-XQUSGIDG.js.map +0 -1
package/registry/ui/tooltip.tsx
CHANGED
|
@@ -34,14 +34,18 @@ function TooltipContent({
|
|
|
34
34
|
align = "center",
|
|
35
35
|
alignOffset = 0,
|
|
36
36
|
children,
|
|
37
|
+
container,
|
|
37
38
|
...props
|
|
38
39
|
}: TooltipPrimitive.Popup.Props &
|
|
39
40
|
Pick<
|
|
40
41
|
TooltipPrimitive.Positioner.Props,
|
|
41
42
|
"align" | "alignOffset" | "side" | "sideOffset"
|
|
42
|
-
>
|
|
43
|
+
> & {
|
|
44
|
+
/** ポータルの親要素。ローカルテーマ内の要素を渡すと、その CSS 変数を継承する。省略時は body。 */
|
|
45
|
+
container?: TooltipPrimitive.Portal.Props["container"]
|
|
46
|
+
}) {
|
|
43
47
|
return (
|
|
44
|
-
<TooltipPrimitive.Portal>
|
|
48
|
+
<TooltipPrimitive.Portal container={container} className={container ? "contents" : undefined}>
|
|
45
49
|
<TooltipPrimitive.Positioner
|
|
46
50
|
align={align}
|
|
47
51
|
alignOffset={alignOffset}
|
package/registry/ui/tracker.tsx
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* never carries the meaning alone: put the date and the state in `tooltip`
|
|
12
12
|
* (also the block's accessible name).
|
|
13
13
|
*/
|
|
14
|
-
import { forwardRef, type ComponentProps } from "react"
|
|
14
|
+
import { forwardRef, useCallback, useRef, type ComponentProps } from "react"
|
|
15
15
|
|
|
16
16
|
import { cn } from "@squadbase/vantage/ui"
|
|
17
17
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@squadbase/vantage/ui"
|
|
@@ -816,9 +816,15 @@ export const Tracker = forwardRef<HTMLDivElement, TrackerProps>(function Tracker
|
|
|
816
816
|
{ data = NO_ROWS, defaultColor, hoverEffect = true, className, ...props },
|
|
817
817
|
ref,
|
|
818
818
|
) {
|
|
819
|
+
const containerRef = useRef<HTMLDivElement>(null)
|
|
820
|
+
const setRef = useCallback((node: HTMLDivElement | null) => {
|
|
821
|
+
containerRef.current = node
|
|
822
|
+
if (typeof ref === "function") return ref(node)
|
|
823
|
+
if (ref) ref.current = node
|
|
824
|
+
}, [ref])
|
|
819
825
|
const fallback = defaultColor ? blockColorToCss(defaultColor) : DEFAULT_BLOCK_COLOR
|
|
820
826
|
return (
|
|
821
|
-
<div ref={
|
|
827
|
+
<div ref={setRef} data-slot="tracker" className={cn("flex h-6 w-full gap-0.5", className)} {...props}>
|
|
822
828
|
{data.map((block, i) => {
|
|
823
829
|
const blockClass = cn(
|
|
824
830
|
"h-full min-w-0 flex-1 rounded-[2px]",
|
|
@@ -831,7 +837,7 @@ export const Tracker = forwardRef<HTMLDivElement, TrackerProps>(function Tracker
|
|
|
831
837
|
delay={0}
|
|
832
838
|
render={<div data-slot="tracker-block" role="img" tabIndex={0} aria-label={block.tooltip} className={blockClass} style={style} />}
|
|
833
839
|
/>
|
|
834
|
-
<TooltipContent>{block.tooltip}</TooltipContent>
|
|
840
|
+
<TooltipContent container={containerRef}>{block.tooltip}</TooltipContent>
|
|
835
841
|
</Tooltip>
|
|
836
842
|
) : (
|
|
837
843
|
<div key={block.key ?? i} data-slot="tracker-block" className={blockClass} style={style} />
|
|
@@ -19,8 +19,8 @@ import type { TrendDirection } from "@squadbase/vantage/components"
|
|
|
19
19
|
const trendIndicatorVariants = cva("inline-flex items-center gap-0.5 text-sm font-medium", {
|
|
20
20
|
variants: {
|
|
21
21
|
sentiment: {
|
|
22
|
-
positive: "text-
|
|
23
|
-
negative: "text-
|
|
22
|
+
positive: "text-positive",
|
|
23
|
+
negative: "text-negative",
|
|
24
24
|
neutral: "text-muted-foreground",
|
|
25
25
|
},
|
|
26
26
|
},
|
|
@@ -32,7 +32,7 @@ import { EChart } from "@squadbase/vantage/components"
|
|
|
32
32
|
import type { Polarity } from "@squadbase/vantage/components"
|
|
33
33
|
import { EMPTY_VALUE, MINUS_SIGN } from "@squadbase/vantage/components"
|
|
34
34
|
import type { ChartCommonProps, NumericKeys, ValueFormatter } from "@squadbase/vantage/components"
|
|
35
|
-
import { createContext, useCallback, useEffect, useRef, useState } from "react"
|
|
35
|
+
import { createContext, useCallback, useEffect, useRef, useState, type RefObject } from "react"
|
|
36
36
|
import type { ChartTone } from "@squadbase/vantage/components"
|
|
37
37
|
import { type ReactNode } from "react"
|
|
38
38
|
import { computeComparison, defaultChangeDisplay, formatChange, toneForValue, type ComparisonKind, type PeriodGrain } from "@squadbase/vantage/components"
|
|
@@ -75,10 +75,23 @@ interface ChartTokens {
|
|
|
75
75
|
border: string | null
|
|
76
76
|
/** Tooltip surface. */
|
|
77
77
|
popover: string | null
|
|
78
|
+
/** Semantic and surface dependencies used by typed chart options. Optional for hand-built tokens. */
|
|
79
|
+
colors?: Record<string, string>
|
|
80
|
+
/** Actual inherited painting surface (may change without a token changing). */
|
|
81
|
+
surface?: string | null
|
|
78
82
|
/** Tooltip text. */
|
|
79
83
|
popoverForeground: string | null
|
|
80
84
|
}
|
|
81
85
|
|
|
86
|
+
// Keep scope out of the public token shape. A resolved snapshot remembers where arbitrary
|
|
87
|
+
// var(--token) expressions must be read, without retaining unmounted charts globally.
|
|
88
|
+
const tokenScopes = new WeakMap<ChartTokens, Element>()
|
|
89
|
+
const OPTION_COLOR_TOKENS = [
|
|
90
|
+
"--background", "--card", "--muted", "--primary", "--destructive",
|
|
91
|
+
...["positive", "negative", "warning", "neutral", "info"].flatMap((tone) =>
|
|
92
|
+
["", "-fill", "-subtle"].map((suffix) => `--${tone}${suffix}`)),
|
|
93
|
+
]
|
|
94
|
+
|
|
82
95
|
let normalizeContext: CanvasRenderingContext2D | null | undefined
|
|
83
96
|
|
|
84
97
|
/** The forms `fillStyle` serializes legacy colours to, and zrender can parse. */
|
|
@@ -134,8 +147,10 @@ function readChartTokens(el?: Element | null): ChartTokens | null {
|
|
|
134
147
|
const color = read(token)
|
|
135
148
|
if (color) series.push(color)
|
|
136
149
|
}
|
|
137
|
-
|
|
150
|
+
const tokens: ChartTokens = {
|
|
138
151
|
series,
|
|
152
|
+
colors: Object.fromEntries(OPTION_COLOR_TOKENS.map((name) => [name, styles.getPropertyValue(name).trim()])),
|
|
153
|
+
surface: readChartSurface(target),
|
|
139
154
|
...(styles.fontFamily ? { fontFamily: styles.fontFamily } : {}),
|
|
140
155
|
foreground: read("--foreground"),
|
|
141
156
|
mutedForeground: read("--muted-foreground"),
|
|
@@ -143,6 +158,8 @@ function readChartTokens(el?: Element | null): ChartTokens | null {
|
|
|
143
158
|
popover: read("--popover"),
|
|
144
159
|
popoverForeground: read("--popover-foreground"),
|
|
145
160
|
}
|
|
161
|
+
tokenScopes.set(tokens, target)
|
|
162
|
+
return tokens
|
|
146
163
|
}
|
|
147
164
|
|
|
148
165
|
/** Structural equality, so a theme toggle that changes nothing doesn't re-init. */
|
|
@@ -150,6 +167,10 @@ function sameChartTokens(a: ChartTokens | null, b: ChartTokens | null): boolean
|
|
|
150
167
|
if (a === b) return true
|
|
151
168
|
if (!a || !b) return false
|
|
152
169
|
return (
|
|
170
|
+
tokenScopes.get(a) === tokenScopes.get(b) &&
|
|
171
|
+
a.surface === b.surface &&
|
|
172
|
+
Object.keys(a.colors ?? {}).length === Object.keys(b.colors ?? {}).length &&
|
|
173
|
+
Object.entries(a.colors ?? {}).every(([name, value]) => b.colors?.[name] === value) &&
|
|
153
174
|
a.series.length === b.series.length &&
|
|
154
175
|
a.series.every((color, i) => color === b.series[i]) &&
|
|
155
176
|
a.fontFamily === b.fontFamily &&
|
|
@@ -175,7 +196,7 @@ function sameChartTokens(a: ChartTokens | null, b: ChartTokens | null): boolean
|
|
|
175
196
|
* attributes alone leaves the chart painted in the previous palette until a
|
|
176
197
|
* reload — the tokens in the DOM are new, the canvas is not.
|
|
177
198
|
*/
|
|
178
|
-
function watchChartTokens(onChange: () => void): () => void {
|
|
199
|
+
function watchChartTokens(onChange: () => void, scope?: Element | null): () => void {
|
|
179
200
|
if (typeof document === "undefined") return () => {}
|
|
180
201
|
// Style edits arrive as bursts of mutations; coalesce them into one read, and
|
|
181
202
|
// take it after the next frame so a swapped stylesheet has been applied.
|
|
@@ -190,8 +211,11 @@ function watchChartTokens(onChange: () => void): () => void {
|
|
|
190
211
|
|
|
191
212
|
const themeObserver = new MutationObserver(schedule)
|
|
192
213
|
const attributeFilter = ["class", "style", "data-theme"]
|
|
193
|
-
|
|
194
|
-
|
|
214
|
+
// Only the chart and its ancestors can change its inherited theme. Never observe
|
|
215
|
+
// the document subtree: canvas/tooltip/rendering mutations would trigger every chart.
|
|
216
|
+
for (let node: Element | null = scope ?? document.body ?? document.documentElement; node; node = node.parentElement) {
|
|
217
|
+
themeObserver.observe(node, { attributes: true, attributeFilter })
|
|
218
|
+
}
|
|
195
219
|
|
|
196
220
|
const styleObserver = new MutationObserver(schedule)
|
|
197
221
|
if (document.head) {
|
|
@@ -279,22 +303,23 @@ function buildChartTheme(tokens: ChartTokens): Record<string, unknown> {
|
|
|
279
303
|
* components that build an ECharts option from token colours themselves (the
|
|
280
304
|
* typed charts), so their palette follows light/dark like `EChart`'s theme.
|
|
281
305
|
*/
|
|
282
|
-
function useChartTokens(): ChartTokens | null {
|
|
306
|
+
function useChartTokens(scope?: Element | null | RefObject<Element | null>): ChartTokens | null {
|
|
283
307
|
const [tokens, setTokens] = useState<ChartTokens | null>(() => readChartTokens())
|
|
284
308
|
// Compared here, not inside a `setTokens` updater: an updater that reads the DOM is
|
|
285
309
|
// replayed by React on every rebase and returns a fresh object each time, so the state
|
|
286
310
|
// never settles ("Maximum update depth exceeded" once the tokens change after mount).
|
|
287
311
|
const tokensRef = useRef(tokens)
|
|
288
312
|
useEffect(() => {
|
|
313
|
+
const target = scope && "current" in scope ? scope.current : scope
|
|
289
314
|
const sync = () => {
|
|
290
|
-
const next = readChartTokens()
|
|
315
|
+
const next = readChartTokens(target)
|
|
291
316
|
if (sameChartTokens(tokensRef.current, next)) return
|
|
292
317
|
tokensRef.current = next
|
|
293
318
|
setTokens(next)
|
|
294
319
|
}
|
|
295
320
|
sync()
|
|
296
|
-
return watchChartTokens(sync)
|
|
297
|
-
}, [])
|
|
321
|
+
return watchChartTokens(sync, target)
|
|
322
|
+
}, [scope])
|
|
298
323
|
return tokens
|
|
299
324
|
}
|
|
300
325
|
|
|
@@ -306,7 +331,7 @@ const EMBEDDED_VAR_RE = /var\(\s*(--[\w-]+)\s*\)/g
|
|
|
306
331
|
/**
|
|
307
332
|
* Turn chart colours into canvas-safe strings. `"chart-1"`〜`"chart-5"` come from
|
|
308
333
|
* the resolved series tokens; `"positive"` / `"warning"` / `"negative"` / `"neutral"` (and the area
|
|
309
|
-
* variants `"positive-fill"`, …) are read
|
|
334
|
+
* variants `"positive-fill"`, …) are read in the snapshot's inherited scope (`--positive`, …); `var(--token)` uses the same scope; any
|
|
310
335
|
* other CSS colour is normalized like the tokens are. A colour that can't be
|
|
311
336
|
* resolved comes back as `""`, which ECharts treats as "use the palette".
|
|
312
337
|
*/
|
|
@@ -317,12 +342,13 @@ function resolveChartColors(colors: readonly string[], tokens: ChartTokens | nul
|
|
|
317
342
|
// Meaning colours are the theme tokens of the same name: same path as `var(--positive)`.
|
|
318
343
|
if (TONE_NAME_RE.test(color.trim())) {
|
|
319
344
|
if (typeof document === "undefined") return ""
|
|
320
|
-
|
|
345
|
+
const target = (tokens && tokenScopes.get(tokens)) ?? document.documentElement
|
|
346
|
+
return toCanvasColor(getComputedStyle(target).getPropertyValue(`--${color.trim()}`)) ?? ""
|
|
321
347
|
}
|
|
322
348
|
if (typeof document === "undefined") return color
|
|
323
349
|
let value = color.trim()
|
|
324
350
|
const cssVar = CSS_VAR_RE.exec(value)
|
|
325
|
-
const styles = getComputedStyle(document.documentElement)
|
|
351
|
+
const styles = getComputedStyle((tokens && tokenScopes.get(tokens)) ?? document.documentElement)
|
|
326
352
|
if (cssVar) {
|
|
327
353
|
value = styles.getPropertyValue(cssVar[1]!).trim() || (cssVar[2] ?? "").trim()
|
|
328
354
|
} else if (value.includes("var(")) {
|
|
@@ -368,7 +394,7 @@ function readChartSurface(el: Element | null): string | null {
|
|
|
368
394
|
if (color) return color
|
|
369
395
|
}
|
|
370
396
|
}
|
|
371
|
-
return toCanvasColor(getComputedStyle(document.documentElement).getPropertyValue("--background"))
|
|
397
|
+
return toCanvasColor(getComputedStyle(el ?? document.documentElement).getPropertyValue("--background"))
|
|
372
398
|
}
|
|
373
399
|
|
|
374
400
|
/** Widths are bucketed so a resize only rebuilds the option when the label budget can change. */
|
|
@@ -382,9 +408,10 @@ const WIDTH_BUCKET = 40
|
|
|
382
408
|
*/
|
|
383
409
|
function useChartSurface<E extends Element>(
|
|
384
410
|
forwarded: ForwardedRef<E>,
|
|
385
|
-
tokens
|
|
386
|
-
): { ref: (el: E | null) => void; surface: string | undefined; width: number | undefined } {
|
|
411
|
+
tokens?: ChartTokens | null,
|
|
412
|
+
): { ref: (el: E | null) => void; surface: string | undefined; width: number | undefined; tokens: ChartTokens | null } {
|
|
387
413
|
const [node, setNode] = useState<E | null>(null)
|
|
414
|
+
const scopedTokens = useChartTokens(node)
|
|
388
415
|
const [surface, setSurface] = useState<string | undefined>(undefined)
|
|
389
416
|
const [width, setWidth] = useState<number | undefined>(undefined)
|
|
390
417
|
const ref = useCallback(
|
|
@@ -398,7 +425,7 @@ function useChartSurface<E extends Element>(
|
|
|
398
425
|
useEffect(() => {
|
|
399
426
|
if (!node) return
|
|
400
427
|
setSurface(readChartSurface(node) ?? undefined)
|
|
401
|
-
}, [node, tokens])
|
|
428
|
+
}, [node, tokens, scopedTokens])
|
|
402
429
|
useEffect(() => {
|
|
403
430
|
if (!node || typeof ResizeObserver === "undefined") return
|
|
404
431
|
const update = (w: number) => setWidth(Math.floor(w / WIDTH_BUCKET) * WIDTH_BUCKET)
|
|
@@ -407,7 +434,7 @@ function useChartSurface<E extends Element>(
|
|
|
407
434
|
observer.observe(node)
|
|
408
435
|
return () => observer.disconnect()
|
|
409
436
|
}, [node])
|
|
410
|
-
return { ref, surface, width }
|
|
437
|
+
return { ref, surface, width, tokens: scopedTokens }
|
|
411
438
|
}
|
|
412
439
|
|
|
413
440
|
/* ---------- inlined from @squadbase/squadkit registry/lib/chart-options.ts (internal to @squadbase/vantage) ---------- */
|
|
@@ -4141,8 +4168,7 @@ function WaterfallChartImpl<T extends Record<string, unknown>>(
|
|
|
4141
4168
|
ref: ForwardedRef<HTMLDivElement>,
|
|
4142
4169
|
) {
|
|
4143
4170
|
const valueKey: string = categories[0] ?? ""
|
|
4144
|
-
const tokens =
|
|
4145
|
-
const { ref: frameRef, width: plotWidth } = useChartSurface(ref, tokens)
|
|
4171
|
+
const { ref: frameRef, width: plotWidth, tokens } = useChartSurface(ref)
|
|
4146
4172
|
// Value labels and the tooltip read in full (as `format` says); ticks read short.
|
|
4147
4173
|
const valueFormatter = useMemo(() => resolveValueFormatter(valueFormatterProp, format), [valueFormatterProp, format])
|
|
4148
4174
|
const axisFormatter = useMemo(() => resolveAxisFormatter(valueFormatterProp, format), [valueFormatterProp, format])
|
|
@@ -1,71 +1,76 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: vantage-design
|
|
3
|
-
description: Vantage(@squadbase/vantage)
|
|
3
|
+
description: Vantage(@squadbase/vantage)アプリのテーマ(色・チャートの色・書体・角丸)を、`styles.css` とテーマコマンドで作る / 更新する手順。配色・ブランドカラー・テーマ・チャートの色・フォント・角丸・トーンを変えたいとき、既存サイトやロゴ・資料に合わせたいとき、プロジェクト作成時の初期デザイン(テーマ neutral / ocean / forest / sunset / violet / rose / mono)を決めるときに使う。「色を変えて」「ブランドに合わせて」「このサイトに合わせて」「落ち着いた感じに」「フォントを変えて」「テーマを作って」、"change the colors", "match our brand", "match this website", "theme", "color palette", "font", "design system" で起動。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
#
|
|
6
|
+
# テーマと styles.css を更新する
|
|
7
7
|
|
|
8
|
-
Vantage
|
|
8
|
+
Vantage アプリの色・書体・角丸の値と色の割り当ては、SquadKit のテーマだけが持つ。
|
|
9
9
|
|
|
10
|
-
|
|
|
11
|
-
| --- | --- |
|
|
12
|
-
| `
|
|
13
|
-
| `styles.css`(ページと同じ側。通常 `src/styles.css`)
|
|
10
|
+
| 手段 | 何を決めるか |
|
|
11
|
+
| --- | --- |
|
|
12
|
+
| ThemeDialog / `theme <id>` / `chart <preset>`(CLI) | 出発点のテーマとチャートの配色 |
|
|
13
|
+
| `styles.css`(ページと同じ側。通常 `src/styles.css`)の `/* squadkit-theme:end */` より後ろ | ブランド色・書体など、テーマに無い値の上書き |
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
デザイン変更の依頼(「もっと落ち着いた色に」など)は、**テーマの切り替えかスタイルシートの上書きで完結させる。**
|
|
16
|
+
`DESIGN.md` へは記録しない。今のテーマ名は `styles.css` の `/* theme: <name> */` マーカーから読む。
|
|
17
|
+
ページ単位の `className` 修正で済ませない。
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
見た目の規則(意味トークンの使い分け・カードで包む・KPI → チャート → 表など)は `AGENTS.md` の
|
|
20
|
+
「見た目の規約」節が正本。ここでは手順だけを扱い、規則は重複させない。
|
|
21
|
+
任意の `DESIGN.md`(ユーザー固有の意図を書くファイル)は、ユーザーが望んだときだけ扱う(`references/format.md`)。
|
|
19
22
|
|
|
20
23
|
## リファレンス
|
|
21
24
|
|
|
22
25
|
| ファイル | 読む場面 |
|
|
23
26
|
| --- | --- |
|
|
24
|
-
| `references/format.md` | `DESIGN.md`
|
|
25
|
-
| `references/extract.md` | URL・画像・pptx/pdf
|
|
26
|
-
| `references/presets.md` |
|
|
27
|
+
| `references/format.md` | ユーザーが任意の `DESIGN.md` を望んだとき(位置づけと優先順位) |
|
|
28
|
+
| `references/extract.md` | URL・画像・pptx/pdf・言葉から色と書体を取り出すとき |
|
|
29
|
+
| `references/presets.md` | テーマ(`neutral` / `ocean` / `forest` / `sunset` / `violet` / `rose` / `mono`)の選び方と `theme` コマンド。旧プリセット id の読み替え |
|
|
27
30
|
| `scripts/contrast.mjs` | 文字色と背景色のコントラスト比を確かめるとき |
|
|
28
31
|
|
|
29
32
|
## 手順
|
|
30
33
|
|
|
31
34
|
### 1. 入力を集める
|
|
32
35
|
|
|
33
|
-
- 何に合わせるのか(URL
|
|
36
|
+
- 何に合わせるのか(URL・ロゴ画像・資料・言葉)を確認し、
|
|
34
37
|
`references/extract.md` の該当する節の手順で色・書体・トーンを取り出す。
|
|
35
|
-
- 既存の `
|
|
38
|
+
- 既存の `styles.css` を読み、マーカーから今のテーマ名を確かめる。今回触らない上書きは残す。
|
|
39
|
+
- プロジェクトルートに `DESIGN.md` があれば読む(ユーザー所有。書き換えない)。色の割り当てはテーマが優先。
|
|
36
40
|
- スライド(`*.slide.tsx`)があるかを `ls` / `vantage routes` で確認しておく。
|
|
37
41
|
|
|
38
42
|
### 2. 提案して確認を取る
|
|
39
43
|
|
|
40
44
|
書き込む前に、次の 2 つをユーザーに見せて確認を取る。
|
|
41
45
|
|
|
42
|
-
- **役割 → トークンの対応表**(
|
|
46
|
+
- **役割 → トークンの対応表**(主色・背景の段階・文字・チャート 5 色・書体。良い/悪い/注意/情報/中立はテーマの意味トークンに任せる)。
|
|
43
47
|
各行に「何に合わせてその色にしたか」を 1 語添える。
|
|
44
|
-
- **トーンの説明**(2〜3
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### 3. styles.css
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
|
|
54
|
-
`/*
|
|
55
|
-
|
|
56
|
-
- チャートの 5
|
|
57
|
-
(`blue` / `ocean` / `sunset` / `forest` / `berry` / `mono
|
|
58
|
-
|
|
59
|
-
|
|
48
|
+
- **トーンの説明**(2〜3 行)。
|
|
49
|
+
|
|
50
|
+
テーマで足りる場合はテーマ id(`references/presets.md`)で提案してよい。旧プリセット id(`default` / `calm` / `vivid` / `mono`)で頼まれたら新 id に読み替える。
|
|
51
|
+
|
|
52
|
+
### 3. テーマを当て、styles.css を書く
|
|
53
|
+
|
|
54
|
+
- **テーマ範囲・チャート範囲のマーカーの中は手で編集しない。** 色・角丸・書体の出発点は 7 テーマ
|
|
55
|
+
(`neutral` / `ocean` / `forest` / `sunset` / `violet` / `rose` / `mono`)から選び、コマンドで当てる:
|
|
56
|
+
`npx @squadbase/vantage-template theme <id>`(プロジェクトルートで実行。`--dry-run` で書き込まずに
|
|
57
|
+
結果を見られる)。``/* squadkit-theme — regenerated by `theme`; edits here are lost */`` 〜
|
|
58
|
+
`/* squadkit-theme:end */` の間はコマンドが丸ごと書き換える生成物で、手で直した値は次の適用で消える。
|
|
59
|
+
旧プリセット id(`default` → `neutral` / `calm` → `ocean` / `vivid` → `sunset` / `mono`)もコマンドが受ける。
|
|
60
|
+
- チャートの 5 色はテーマが持つ。テーマと別の配色にしたいときだけ
|
|
61
|
+
`npx @squadbase/vantage-template chart <preset>`(`blue` / `ocean` / `sunset` / `forest` / `berry` / `mono`)を使う。
|
|
62
|
+
``/* vantage-template:chart-preset … */`` 〜 `/* vantage-template:chart-preset:end */` の間が置き換わり、
|
|
63
|
+
テーマのチャート色より優先される。テーマに揃え直すには `theme <id> --reset-chart`。
|
|
64
|
+
- プリセットに無いチャート色(ブランド色を `--chart-1` にしたいなど)は、**マーカーブロックの後ろ**に
|
|
60
65
|
別の `:root { --chart-1: …; }` と `.dark, [data-theme="dark"] { --chart-1: …; }` を足して上書きする
|
|
61
|
-
(後に書いた方が勝つ)
|
|
62
|
-
- `--primary` / `--primary-foreground` / `--radius`
|
|
63
|
-
(
|
|
64
|
-
|
|
65
|
-
(`var(--color-sky-600)`)で書く。
|
|
66
|
-
-
|
|
67
|
-
(
|
|
68
|
-
|
|
66
|
+
(後に書いた方が勝つ)。上書きするのは変えたい番号だけにし、残りはテーマに任せる。
|
|
67
|
+
- `--primary` / `--primary-foreground` / `--radius` などテーマに無い値・ブランド色の上書きも、
|
|
68
|
+
**マーカーブロックの後ろ**(ファイル末尾)に書く。マーカーより前に書いた値はテーマに負ける。
|
|
69
|
+
色は `:root` と `.dark, [data-theme="dark"]` の**両方**に書く。片方だけだとダークモードでテーマの値に
|
|
70
|
+
戻る。値は `oklch()` か Tailwind のパレット変数(`var(--color-sky-600)`)で書く。
|
|
71
|
+
- 書体は既定でシステムフォント。**ページの書体は `--font-sans`**(`styles.css` の `body` が
|
|
72
|
+
`font-family: var(--font-sans)` で参照する。テーマ範囲も `--font-sans` を持つので、書体を変えるには
|
|
73
|
+
マーカーブロックの後ろで `:root { --font-sans: …; }` を上書きする)。スライドの書体は `:root` の
|
|
69
74
|
`--slide-font-display`(見出し)/ `--slide-font-body`(本文)で決まる。Web フォントを使うときの
|
|
70
75
|
レシピ:
|
|
71
76
|
1. Google Fonts の CSS
|
|
@@ -73,13 +78,11 @@ Vantage アプリの見た目は 2 つのファイルで決まる。
|
|
|
73
78
|
から使う subset の `@font-face` ブロックだけを `styles.css` の先頭に貼る。
|
|
74
79
|
**`@import url(...)` は使わない** ― `styles.css` はテーマの後ろに連結されるので
|
|
75
80
|
「@import rules must precede all rules」の警告とともにビルドで捨てられる。
|
|
76
|
-
2.
|
|
81
|
+
2. マーカーブロックの後ろに次を書く(フォールバックは `theme.css` の既定と同じ並び):
|
|
77
82
|
|
|
78
83
|
```css
|
|
79
|
-
body {
|
|
80
|
-
font-family: "<Font>", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, ui-sans-serif, system-ui, sans-serif;
|
|
81
|
-
}
|
|
82
84
|
:root {
|
|
85
|
+
--font-sans: "<Font>", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, ui-sans-serif, system-ui, sans-serif;
|
|
83
86
|
--slide-font-display: "<Font>", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, system-ui, sans-serif;
|
|
84
87
|
--slide-font-body: var(--slide-font-display);
|
|
85
88
|
}
|
|
@@ -90,18 +93,15 @@ Vantage アプリの見た目は 2 つのファイルで決まる。
|
|
|
90
93
|
`ui-sans-serif` / `system-ui` は日本語の face より**後ろ**に置く。日本語の Windows ではどちらも
|
|
91
94
|
Yu Gothic UI(UI のリサイズを避けるために字幅を詰めた書体)に解決され、カナがここで決まって
|
|
92
95
|
半角風に見える。macOS の Chrome は `-apple-system` を解釈しないので `BlinkMacSystemFont` も並べる。
|
|
93
|
-
既存アプリの `styles.css` に `
|
|
94
|
-
|
|
96
|
+
既存アプリの `styles.css` の `body` に `font-family` が直書きされている(`var(--font-sans)` ではない)、
|
|
97
|
+
または `ui-sans-serif, system-ui, …` が先頭にある、`"Yu Gothic UI"` が残っているときは、
|
|
98
|
+
`body { font-family: var(--font-sans); }` に直し、書体は `--font-sans` に上の並びで書く。
|
|
95
99
|
日本語の Web フォントは face が 100 を超えるので原則使わない(pptx 書き出しも壊れる。
|
|
96
100
|
`vantage-slide` の `references/tokens.md` 参照)。
|
|
97
101
|
|
|
98
102
|
長い表(ダッシュボード): カードに `max-h-*` + `overflow-y-auto` の縦スクロール領域を作らず、
|
|
99
103
|
ページング付きの `DataTablePreset`(`enablePagination`)にする(ホイールや End キーがページに届かなくなるため)。
|
|
100
104
|
|
|
101
|
-
`DESIGN.md`: `references/format.md` の書式で書く。**色コードを書かない**(トークン名だけ)。
|
|
102
|
-
150 行を超えない(超えると `vantage check` が `DESIGN_MD_TOO_LONG` を出す)。ロゴなどの素材は
|
|
103
|
-
`public/brand/logo.svg` のように `public/` 配下のパスで「ブランド素材」行に書く。
|
|
104
|
-
|
|
105
105
|
### 4. コントラストを確かめる
|
|
106
106
|
|
|
107
107
|
主な文字色 / 背景色の組を、**ライトとダークの両方で**確かめる。
|
|
@@ -131,11 +131,11 @@ node <このスキルの場所>/scripts/contrast.mjs '<文字色>' '<背景色>'
|
|
|
131
131
|
npx vantage check
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
-
`HARDCODED_COLOR`(ページ内の色コード)
|
|
134
|
+
`HARDCODED_COLOR`(ページ内の色コード)などが出たらその場で直す。
|
|
135
135
|
|
|
136
136
|
### 7. 完了を報告する
|
|
137
137
|
|
|
138
|
-
報告には、更新したファイル(`
|
|
138
|
+
報告には、更新したファイル(`styles.css` など)と当てたテーマ名に加えて次を**必ず**入れる。
|
|
139
139
|
|
|
140
140
|
- プレビューページのパスと URL(`src/design-preview.tsx` → `/design-preview`)。
|
|
141
141
|
- 「ホームなど既存の画面は一部の色しか使っていないので、変更が見えないことがある。配色はプレビュー
|
|
@@ -143,5 +143,5 @@ npx vantage check
|
|
|
143
143
|
|
|
144
144
|
## 会話中の指示との関係
|
|
145
145
|
|
|
146
|
-
- 会話中の個別の指示(「このグラフだけ赤で」)
|
|
147
|
-
- 同じ指示が 2 回以上出たら、`
|
|
146
|
+
- 会話中の個別の指示(「このグラフだけ赤で」)はテーマより優先する。そのページだけ直せばよい。
|
|
147
|
+
- 同じ指示が 2 回以上出たら、`styles.css` の上書きへ反映することを提案する(この手順の 2 から)。
|
|
@@ -7,12 +7,13 @@
|
|
|
7
7
|
3. **書体**(見出しと本文の `font-family`。システムフォントで足りるか)
|
|
8
8
|
4. **トーン**(2〜3 語: 「落ち着いた」「明るい」「堅い」…)
|
|
9
9
|
|
|
10
|
-
チャートの 5
|
|
11
|
-
`npx @squadbase/vantage-template
|
|
12
|
-
配慮が済んでいる)
|
|
10
|
+
チャートの 5 色は、主色から直接作るより**主色に最も近いテーマ**を選び、
|
|
11
|
+
`npx @squadbase/vantage-template theme <id>` で適用する方が安全(5 色の明度差・色覚多様性への
|
|
12
|
+
配慮が済んでいる)。テーマと別のチャート配色が要るときは `chart <preset>`。`styles.css` の
|
|
13
|
+
`squadkit-theme` / `vantage-template:chart-preset` のマーカーブロックの中は
|
|
13
14
|
**手で編集しない**(次の適用で消える)。主色を `--chart-1` に入れたいときだけ、マーカーブロックの
|
|
14
15
|
**後ろ**に `:root` と `.dark, [data-theme="dark"]` の `--chart-1` 上書きを足し、残り 4 色は
|
|
15
|
-
プリセットに任せる。`--primary` や `--radius`
|
|
16
|
+
プリセットに任せる。`--primary` や `--radius` はマーカーブロックの後ろに書く。
|
|
16
17
|
|
|
17
18
|
## URL(既存サイトに合わせる)
|
|
18
19
|
|
|
@@ -36,14 +37,14 @@ grep -oE 'font-family:[^;]+' /tmp/site.css | sort | uniq -c | sort -rn | head
|
|
|
36
37
|
3. **ボタン・リンクの色**: `a {` `.btn` `button` `[class*=primary]` のセレクタの `color` /
|
|
37
38
|
`background-color`。出現回数の多い有彩色が主色。
|
|
38
39
|
4. **背景**: `body` / `html` の `background`。暗ければ「暗い基調」。
|
|
39
|
-
5. **書体**: `body` の `font-family
|
|
40
|
+
5. **書体**: `body` の `font-family`(書き込み先は `--font-sans`)。Google Fonts の `<link>` があればその family 名。
|
|
40
41
|
|
|
41
42
|
注意:
|
|
42
43
|
|
|
43
44
|
- SPA で HTML がほぼ空のときは、`<script>` より先に CSS の `<link>` を探す。それも無ければ
|
|
44
45
|
ユーザーにスクリーンショットかブランドカラーを聞く(推測で埋めない)。
|
|
45
46
|
- 取得できない(認証・ボット対策)ときは、その旨を伝えてスクリーンショットをもらう。
|
|
46
|
-
- ロゴを使うなら `public/brand/`
|
|
47
|
+
- ロゴを使うなら `public/brand/` に保存する。
|
|
47
48
|
|
|
48
49
|
## 画像・ロゴ
|
|
49
50
|
|
|
@@ -66,27 +67,26 @@ grep -oE 'font-family:[^;]+' /tmp/site.css | sort | uniq -c | sort -rn | head
|
|
|
66
67
|
|
|
67
68
|
## 言葉だけ(「落ち着いた感じに」)
|
|
68
69
|
|
|
69
|
-
形容詞を `presets.md` の
|
|
70
|
+
形容詞を `presets.md` の 7 テーマに寄せ、そのうえで主色だけを調整する。
|
|
70
71
|
|
|
71
72
|
| 言われたこと | 出発点 |
|
|
72
73
|
| --- | --- |
|
|
73
|
-
| 落ち着いた・信頼感・堅い・経営向け・青系 | `
|
|
74
|
-
| 明るい・元気・勢い・暖かい・営業向け | `
|
|
74
|
+
| 落ち着いた・信頼感・堅い・経営向け・青系 | `ocean` |
|
|
75
|
+
| 明るい・元気・勢い・暖かい・営業向け | `sunset` |
|
|
75
76
|
| シンプル・モノクロ・印刷する・資料に貼る | `mono` |
|
|
76
|
-
| 特に無し・標準・おまかせ | `
|
|
77
|
-
| 自然・環境・緑 | `
|
|
78
|
-
|
|
|
77
|
+
| 特に無し・標準・おまかせ | `neutral` |
|
|
78
|
+
| 自然・環境・緑 | `forest` |
|
|
79
|
+
| 華やか・ポップ・紫 | `violet` |
|
|
80
|
+
| 華やか・ポップ・ピンク | `rose` |
|
|
79
81
|
|
|
80
|
-
当てはまらない言葉は、2 案(例: `
|
|
82
|
+
当てはまらない言葉は、2 案(例: `ocean` と `neutral`)を並べて選んでもらう。
|
|
81
83
|
|
|
82
84
|
## 外部の DESIGN.md(Stitch などが書いたもの)
|
|
83
85
|
|
|
84
|
-
外部の DESIGN.md
|
|
85
|
-
Vantage
|
|
86
|
-
書き直す**。
|
|
86
|
+
外部の DESIGN.md が値(hex・px・フォント名)を持っているときは、値だけを拾って**テーマ側**へ移す。
|
|
87
|
+
Vantage に `DESIGN.md` は作らない。
|
|
87
88
|
|
|
88
|
-
1. 値を拾う: primary / secondary / surface / background / on-* / error
|
|
89
|
-
フォント、角丸。
|
|
89
|
+
1. 値を拾う: primary / secondary / surface / background / on-* / error、フォント、角丸。
|
|
90
90
|
2. 対応づける:
|
|
91
91
|
|
|
92
92
|
| 外部の名前 | Vantage のトークン |
|
|
@@ -96,15 +96,14 @@ Vantage の `DESIGN.md` は値を持たないので、**値を `styles.css` へ
|
|
|
96
96
|
| background / surface / surface-container | `--background` / `--card` / `--muted` |
|
|
97
97
|
| on-background / on-surface / on-surface-variant | `--foreground` / `--card-foreground` / `--muted-foreground` |
|
|
98
98
|
| outline | `--border` |
|
|
99
|
-
| error | `--destructive` |
|
|
100
|
-
| success / warning |
|
|
99
|
+
| error | `--destructive`(意味トークンの negative) |
|
|
100
|
+
| success / warning | テーマの意味トークン(positive / warning)に任せる。チャートの色には割り当てない |
|
|
101
101
|
| radius / corner | `--radius` |
|
|
102
|
-
| display / headline font | `--slide-font-display`(+ ページの見出しなら
|
|
103
|
-
| body font |
|
|
102
|
+
| display / headline font | `--slide-font-display`(+ ページの見出しなら `--font-sans`) |
|
|
103
|
+
| body font | `--font-sans`(ページ本文)と `--slide-font-body` |
|
|
104
104
|
|
|
105
105
|
3. `styles.css` のマーカーブロックの外に、`:root` と `.dark, [data-theme="dark"]` の両方で書く
|
|
106
|
-
(チャート色・書体の書き方は SKILL.md の手順 3)
|
|
107
|
-
|
|
108
|
-
4. `DESIGN.md`
|
|
109
|
-
|
|
110
|
-
5. 元のファイルは消さずに残すか(例: `docs/design-source.md`)、ユーザーに確認して削除する。
|
|
106
|
+
(チャート色・書体の書き方は SKILL.md の手順 3)。外部にダークの値が無ければ、ライトの色相を保って
|
|
107
|
+
明度だけ反転した値を作り、コントラストを確かめる。
|
|
108
|
+
4. 外部のトーン・Do/Don't・コンポーネントのルールは、ユーザーが望んだときだけ任意の `DESIGN.md`
|
|
109
|
+
(`format.md`)に要約して残す。値は書かない。
|