Skip to content

Commit f0233e0

Browse files
authored
Merge pull request #3703 from GCWing/gcwing/project-default-settings
feat(workspace): add project defaults and refine settings controls
2 parents 8ed7ad2 + e8d933e commit f0233e0

58 files changed

Lines changed: 1482 additions & 162 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎design-system/AGENTS.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ pnpm --dir src/web-ui exec vitest run src/shared/ui/Select.test.tsx
6666

6767
These package and DOM checks do not establish native rendering or live remote behavior.
6868

69+
For Spinner presentations, FlowChat integration and decorative playback:
70+
71+
```bash
72+
pnpm --dir design-system run build:ui && node --test design-system/packages/ui/tests/spinner.test.mjs design-system/packages/ui/tests/brand.test.mjs design-system/packages/ui/tests/registry.test.mjs
73+
```
74+
6975
For ColorPicker HEX drafts, flower selection, curved lightness dragging and keyboard input:
7076

7177
```bash

‎design-system/apps/design-lab/src/i18n/messages.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export const enUSMessages = {
198198
"component.SessionControlToolCard.description": "An ambient session-lifecycle card with semantic detail fields and session rows.",
199199
"component.SessionMessageToolCard.description": "An ambient cross-session message card with target details and message content.",
200200
"component.SkillToolCard.description": "An ambient trace for skill loading progress and outcomes.",
201-
"component.Spinner.description": "A compact activity indicator with matrix and bar presentations.",
201+
"component.Spinner.description": "A compact activity indicator with a breathing, rotating double-hexagon logo and a bar presentation.",
202202
"component.Switch.description": "Toggles a single setting between on and off with native checkbox semantics.",
203203
"component.TabGroup.description": "A compact single-selection tab list with leading icons, glass end actions over intact labels, and automatic keyboard activation.",
204204
"component.RollingText.description": "Vertical text replacement with coordinated width, interruption handling, and reduced-motion support. Try repeated clicks in the replacement specimen.",
@@ -1022,7 +1022,7 @@ export const zhCNMessages = {
10221022
"component.SessionControlToolCard.description": "低关注会话生命周期卡片,包含语义详情字段与会话行。",
10231023
"component.SessionMessageToolCard.description": "低关注跨会话消息卡片,包含目标详情与消息内容。",
10241024
"component.SkillToolCard.description": "低关注 Skill 轨迹,用于呈现加载进度和执行结果。",
1025-
"component.Spinner.description": "提供点阵与条形样式的紧凑活动指示器。",
1025+
"component.Spinner.description": "提供双六边形呼吸旋转与条形样式的紧凑活动指示器。",
10261026
"component.Switch.description": "通过原生复选框语义在开启与关闭之间切换单项设置。",
10271027
"component.TabGroup.description": "紧凑的单选标签组,支持前置图标、悬浮于完整标签上的毛玻璃尾部操作与方向键自动切换。",
10281028
"component.RollingText.description": "垂直滚动替换文本,宽度同步过渡,支持连续切换与减少动态效果。可在替换示例中连续点击体验。",
@@ -1887,7 +1887,7 @@ export const zhTWMessages = {
18871887
"component.SessionControlToolCard.description": "低關注工作階段生命週期卡片,包含語意詳情欄位與工作階段列。",
18881888
"component.SessionMessageToolCard.description": "低關注跨工作階段訊息卡片,包含目標詳情與訊息內容。",
18891889
"component.SkillToolCard.description": "低關注 Skill 軌跡,用於呈現載入進度和執行結果。",
1890-
"component.Spinner.description": "提供點陣與條形樣式的緊湊活動指示器。",
1890+
"component.Spinner.description": "提供雙六邊形呼吸旋轉與條形樣式的緊湊活動指示器。",
18911891
"component.Switch.description": "以原生核取方塊語意在開啟與關閉之間切換單一設定。",
18921892
"component.TabGroup.description": "緊湊的單選標籤群組,支援前置圖示、懸浮於完整標籤上的毛玻璃尾端操作與方向鍵自動切換。",
18931893
"component.RollingText.description": "垂直捲動替換文字,寬度同步過渡,支援連續切換與減少動態效果。可在替換範例中連續點擊體驗。",

‎design-system/apps/design-lab/src/i18n/previewMessages.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const previewEn = {
2727
"preview.state.on": "On", "preview.state.off": "Off", "preview.state.unselected": "Unselected",
2828
"preview.state.indicator": "Indicator", "preview.state.with-label": "With label",
2929
"preview.state.with-title": "With title", "preview.state.with-actions": "With actions",
30-
"preview.state.matrix": "Matrix", "preview.state.bars": "Bars", "preview.state.reduced-motion": "Reduced motion",
30+
"preview.state.logo": "Breathing logo", "preview.state.bars": "Bars", "preview.state.reduced-motion": "Reduced motion",
3131
"preview.state.counter-rotate": "Counter-rotating hexagons",
3232
"preview.state.construction": "Engineering drawing",
3333
"preview.state.secondary": "Secondary", "preview.state.elevated": "Elevated", "preview.state.floating": "Floating",
@@ -70,7 +70,7 @@ export const previewZhCN: Record<keyof typeof previewEn, string> = {
7070
"preview.state.on": "开", "preview.state.off": "关", "preview.state.unselected": "未选中",
7171
"preview.state.indicator": "指示器", "preview.state.with-label": "附带文字",
7272
"preview.state.with-title": "附带标题", "preview.state.with-actions": "附带操作",
73-
"preview.state.matrix": "点阵", "preview.state.bars": "条形", "preview.state.reduced-motion": "减少动态效果",
73+
"preview.state.logo": "Logo 呼吸", "preview.state.bars": "条形", "preview.state.reduced-motion": "减少动态效果",
7474
"preview.state.counter-rotate": "双六边形对转",
7575
"preview.state.construction": "工程制图",
7676
"preview.state.secondary": "次要", "preview.state.elevated": "浮起表面", "preview.state.floating": "悬浮",
@@ -108,7 +108,7 @@ export const previewZhTW: Record<keyof typeof previewEn, string> = {
108108
"preview.state.fallback": "預設頭像", "preview.state.grouped": "頭像群組", "preview.state.indeterminate": "部分選取", "preview.state.checked": "選取",
109109
"preview.state.on": "開", "preview.state.off": "關", "preview.state.unselected": "未選取",
110110
"preview.state.indicator": "指示器", "preview.state.with-label": "附帶文字", "preview.state.with-title": "附帶標題", "preview.state.with-actions": "附帶操作",
111-
"preview.state.matrix": "點陣", "preview.state.bars": "條形", "preview.state.reduced-motion": "減少動態效果",
111+
"preview.state.logo": "Logo 呼吸", "preview.state.bars": "條形", "preview.state.reduced-motion": "減少動態效果",
112112
"preview.state.counter-rotate": "雙六邊形對轉",
113113
"preview.state.construction": "工程製圖",
114114
"preview.state.floating": "懸浮", "preview.state.floating-footer": "懸浮頁尾", "preview.state.alert": "提醒對話框",

‎design-system/apps/design-lab/src/pages/ComponentDetailPage.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ export function ComponentDetailPage({
668668
return `import { Combobox } from "@openbitfun/ui";\n\n<Combobox\n aria-label="Mode"\n onValueChange={setMode}\n options={[\n { label: "Ask", value: "ask" },\n { label: "Plan", value: "plan" },\n { disabled: true, label: "Agent", value: "agent" },\n ]}\n value={mode}\n/>`;
669669
}
670670
if (component.name === "Spinner") {
671-
return `import { Spinner } from "@openbitfun/ui";\n\n<Spinner aria-label="${t("detail.loading")}" size="${size}" variant="${previewState === "bars" ? "bars" : "matrix"}" />`;
671+
return `import { Spinner } from "@openbitfun/ui";\n\n<Spinner aria-label="${t("detail.loading")}" size="${size}" variant="${previewState === "bars" ? "bars" : "logo"}"${previewState === "reduced-motion" ? " active={false}" : ""} />`;
672672
}
673673
if (component.name === "MultiSelect") {
674674
return `import { MultiSelect } from "@openbitfun/ui";\n\n<MultiSelect\n aria-label="Modes"\n onValueChange={setModes}\n options={[\n { label: "Ask", value: "ask" },\n { label: "Plan", value: "plan" },\n { disabled: true, label: "Agent", value: "agent" },\n ]}\n value={modes}\n/>`;
@@ -1884,9 +1884,9 @@ export function ComponentDetailPage({
18841884
return (
18851885
<Spinner
18861886
aria-label={t("detail.loading")}
1887-
className={state === "reduced-motion" ? "design-preview-reduced-motion" : undefined}
1887+
active={state !== "reduced-motion"}
18881888
size={size}
1889-
variant={state === "bars" ? "bars" : "matrix"}
1889+
variant={state === "bars" ? "bars" : "logo"}
18901890
/>
18911891
);
18921892
}

‎design-system/apps/design-lab/src/preview/ComponentShowcase.css‎

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎design-system/packages/ui/README.md‎

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,31 @@ export function Example() {
1818

1919
The package owns component anatomy, behavior, accessibility, and stable variants. It does not own theme selection persistence, product state, routes, locale resources, or platform APIs.
2020

21+
## Loading indicators
22+
23+
Use `Spinner` for the shared loading indicator. Its default `logo` presentation
24+
uses the double-hexagon silhouette with a continuous 1.8-second cycle coupling
25+
rotation, whole-mark defocus, opacity and a subtle scale pulse. Both contours
26+
move together. Color follows `currentColor`; `xs`, `sm`, `md` and `lg` retain
27+
the existing 11, 14, 22 and 28 px allocation. Existing `Spinner` consumers use
28+
this presentation automatically. FlowChat's runtime status selects `md` so the
29+
visible mark is approximately 16–18 px beside its text, allowing for the logo's
30+
internal padding. Its leading slot follows the indicator's intrinsic width.
31+
32+
```tsx
33+
import { Spinner } from "@openbitfun/ui";
34+
35+
<Spinner size="sm" aria-label="Loading" />
36+
```
37+
38+
The host supplies localized accessible text. Omit `aria-label` when adjacent
39+
copy already describes the activity. `active={false}` shows a still mark.
40+
Playback pauses offscreen or when the document is hidden and respects reduced
41+
motion. `LoadingState` composes the same indicator with optional support copy.
42+
The legacy `variant="matrix"` value resolves to `logo` for existing callers;
43+
`variant="bars"` selects the bar presentation. The legacy matrix layout tokens
44+
continue to define the established size allocations.
45+
2146
## Color selection
2247

2348
`ColorPicker` combines a round swatch, an editable HEX pill, an expandable flower
@@ -633,7 +658,24 @@ inline platform or scope selectors. Set `showGroupLabels={false}` to hide group
633658
headings while retaining the standard section spacing, and `showGroupDividers`
634659
to separate option groups with a themed border. `Combobox` adds searchable single
635660
selection, grouped options, explicit custom-value creation and async loading
636-
states. `MultiSelect` owns multiple selection, removable tags and select-all.
661+
states. Both `Select` and `Combobox` support `variant="pill"` for a filled capsule
662+
trigger and `bordered={false}` to omit its border while retaining keyboard focus
663+
feedback. `bordered="hover"` reveals the border only while hovering, without
664+
changing layout or removing keyboard focus feedback. Pill hover states retain
665+
the neutral surface. Expanded menus keep
666+
their standard surface. `MultiSelect` owns multiple
667+
selection, removable tags and select-all.
668+
`valuePrefix` places a caller-localized field name inside the closed trigger,
669+
so the label and selected value share one hit target. It does not alter option
670+
labels. Expanded surfaces match the complete trigger width by default.
671+
`hitArea="expanded"` extends the closed trigger's pointer target beyond its
672+
visual bounds using system spacing, without changing layout or popup geometry.
673+
`showIndicator={false}` removes the closed arrow and its reserved space. Pill
674+
controls then keep symmetric system padding around their visible content.
675+
Combobox `popupWidth="content"` fits the list to its options, using the trigger
676+
width as a minimum and the viewport as a maximum. Plain descriptions stay on
677+
one line so narrow viewports do not make rows grow. Filtering retains the
678+
measured width until the list closes.
637679
Controlled values are authoritative; option discovery remains host-owned.
638680
Wrap the product once in `DesignSystemProvider` to supply translated messages,
639681
the portal host, theme facts and the shared overlay layer stack.
Lines changed: 3 additions & 0 deletions
Loading

‎design-system/packages/ui/src/components/Combobox/Combobox.meta.ts‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ export const comboboxMeta = {
1212
{ name: "onCreateValue", type: "(input: string) => ComboboxValue | void" },
1313
{ defaultValue: "false", name: "clearable", type: "boolean" },
1414
{ defaultValue: "md", name: "size", type: "sm | md | lg" },
15+
{ defaultValue: "field", name: "variant", type: "field | pill" },
16+
{ defaultValue: "true", name: "bordered", type: "boolean | 'hover'" },
17+
{ name: "valuePrefix", type: "ReactNode" },
18+
{ defaultValue: "default", name: "hitArea", type: "default | expanded" },
19+
{ defaultValue: "true", name: "showIndicator", type: "boolean" },
20+
{ defaultValue: "trigger", name: "popupWidth", type: "trigger | content" },
1521
],
1622
states: ["default", "open", "searching", "custom", "invalid", "disabled", "loading", "empty"],
1723
tokens: [
@@ -27,6 +33,7 @@ export const comboboxMeta = {
2733
"color.control.highlight.background",
2834
"color.action.neutral.content",
2935
"color.action.neutral.surface",
36+
"color.action.neutral.surfaceHover",
3037
"color.border.subtle",
3138
"color.border.default",
3239
"color.surface.panel",
@@ -41,6 +48,14 @@ export const comboboxMeta = {
4148
"control.select.contentGap",
4249
"control.select.trailingInset",
4350
"control.iconButton.xsSize",
51+
"control.statusPill.paddingInline",
52+
"control.statusPill.gap",
53+
"control.statusPill.radius",
54+
"type.meta.fontFamily",
55+
"type.meta.fontSize",
56+
"type.meta.fontWeight",
57+
"type.meta.letterSpacing",
58+
"type.statusPill.lineHeight",
4459
"overlay.menu.inlineSize",
4560
"overlay.menu.surfacePadding",
4661
"overlay.menu.surfaceRadius",

‎design-system/packages/ui/src/components/Combobox/Combobox.module.css‎

Lines changed: 72 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
}
2727

2828
.root {
29+
--_combobox-trailing-width: calc(
30+
var(--openbitfun-control-select-trailing-inset)
31+
+ var(--openbitfun-control-select-indicator-size)
32+
+ var(--openbitfun-control-select-content-gap)
33+
);
2934
position: relative;
3035
display: flex;
3136
inline-size: 100%;
@@ -35,6 +40,14 @@
3540
color: var(--openbitfun-color-content-primary);
3641
}
3742

43+
.root[data-show-indicator="false"] {
44+
--_combobox-trailing-width: var(--openbitfun-control-select-padding-inline);
45+
}
46+
47+
.root[data-show-indicator="false"][data-variant="pill"] {
48+
--_combobox-trailing-width: var(--openbitfun-control-status-pill-padding-inline);
49+
}
50+
3851
.root[data-size="sm"],
3952
.popover[data-size="sm"] {
4053
--_combobox-height: var(--openbitfun-control-height-sm);
@@ -83,11 +96,7 @@
8396
margin: 0;
8497
padding-block: 0;
8598
padding-inline-start: var(--openbitfun-control-select-padding-inline);
86-
padding-inline-end: calc(
87-
var(--openbitfun-control-select-trailing-inset)
88-
+ var(--openbitfun-control-select-indicator-size)
89-
+ var(--openbitfun-control-select-content-gap)
90-
);
99+
padding-inline-end: var(--_combobox-trailing-width);
91100
border: var(--openbitfun-border-width-default) solid var(--openbitfun-color-field-border);
92101
border-radius: var(--openbitfun-control-select-radius);
93102
outline: 0;
@@ -106,20 +115,50 @@
106115
box-shadow var(--openbitfun-motion-duration-fast) var(--openbitfun-motion-easing-standard);
107116
}
108117

118+
.root[data-variant="pill"] .trigger {
119+
padding-inline-start: var(--openbitfun-control-status-pill-padding-inline);
120+
border-radius: var(--openbitfun-control-status-pill-radius);
121+
background: var(--openbitfun-color-action-neutral-surface);
122+
font-family: var(--openbitfun-type-meta-font-family);
123+
font-size: var(--openbitfun-type-meta-font-size);
124+
font-weight: var(--openbitfun-type-meta-font-weight);
125+
line-height: var(--openbitfun-type-status-pill-line-height);
126+
letter-spacing: var(--openbitfun-type-meta-letter-spacing);
127+
}
128+
109129
.root:has(.clear) .trigger {
110-
padding-inline-end: calc(
111-
var(--openbitfun-control-select-trailing-inset)
112-
+ var(--openbitfun-control-select-indicator-size)
113-
+ var(--openbitfun-control-select-content-gap)
114-
+ var(--openbitfun-control-height-sm)
115-
);
130+
padding-inline-end: calc(var(--_combobox-trailing-width) + var(--openbitfun-control-height-sm));
131+
}
132+
133+
.root[data-bordered="false"] .trigger {
134+
border: 0;
135+
}
136+
137+
.root[data-bordered="hover"] .trigger {
138+
border-color: transparent;
139+
}
140+
141+
.root[data-hit-area="expanded"] .trigger {
142+
position: relative;
143+
}
144+
145+
.root[data-hit-area="expanded"]:not([data-open="true"]) .trigger::after {
146+
content: "";
147+
position: absolute;
148+
inset-block: calc(-1 * var(--openbitfun-space-1));
149+
inset-inline: calc(-1 * var(--openbitfun-space-2));
150+
border-radius: inherit;
116151
}
117152

118153
.trigger:not(:disabled):hover {
119154
border-color: var(--openbitfun-color-field-border-hover);
120155
background: var(--openbitfun-color-field-background-hover);
121156
}
122157

158+
.root[data-variant="pill"] .trigger:not(:disabled):hover {
159+
background: var(--openbitfun-color-action-neutral-surface-hover);
160+
}
161+
123162
.root[data-field-surface="ambient"] .trigger,
124163
.root[data-field-surface="ambient"] .trigger:not(:disabled):hover {
125164
background: transparent;
@@ -162,6 +201,23 @@
162201
gap: var(--openbitfun-control-select-content-gap);
163202
}
164203

204+
.root[data-has-value-prefix="true"] .value {
205+
gap: var(--openbitfun-control-select-content-gap);
206+
}
207+
208+
.root[data-has-value-prefix="true"][data-variant="pill"] .value {
209+
gap: var(--openbitfun-control-status-pill-gap);
210+
}
211+
212+
.root[data-has-value-prefix="true"] .singleValue {
213+
flex: 0 1 auto;
214+
}
215+
216+
.valuePrefix {
217+
flex: 0 0 auto;
218+
white-space: nowrap;
219+
}
220+
165221
.valueLeading {
166222
display: inline-flex;
167223
flex: 0 0 var(--openbitfun-control-select-indicator-size);
@@ -249,11 +305,7 @@
249305
}
250306

251307
.clear {
252-
margin-inline-end: calc(
253-
var(--openbitfun-control-select-trailing-inset)
254-
+ var(--openbitfun-control-select-indicator-size)
255-
+ var(--openbitfun-control-select-content-gap)
256-
);
308+
margin-inline-end: var(--_combobox-trailing-width);
257309
}
258310

259311
.indicator {
@@ -300,6 +352,10 @@
300352
flex-direction: column-reverse;
301353
}
302354

355+
.popover[data-popup-width="content"] {
356+
inline-size: max-content;
357+
}
358+
303359
.popover:focus-within {
304360
border-color: var(--openbitfun-color-border-default);
305361
}

0 commit comments

Comments
 (0)