@tfdesign/b-end 1.0.16 → 1.0.18
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/skills/tfds/CHECKLIST.md +1 -1
- package/skills/tfds/GLOBAL_DESIGN_RULES.md +123 -4
- package/skills/tfds/LAYOUT_RECIPES.md +5 -2
- package/skills/tfds/LAYOUT_RULES.md +52 -29
- package/skills/tfds/components.index.json +33 -9
- package/skills/tfds/components.summary.json +12 -10
- package/src/_b_end_runtime/components/Filter.jsx +60 -27
- package/src/_b_end_runtime/components/NavBar.jsx +1 -1
- package/src/_b_end_runtime/components/NavBar.tokens.js +1 -0
- package/src/_b_end_runtime/components/Select.jsx +18 -12
- package/src/_b_end_runtime/components/Select.tokens.js +6 -2
- package/src/_b_end_runtime/components/Table.jsx +7 -7
- package/src/_b_end_runtime/components.js +17 -9
- package/src/_b_end_runtime/page-patterns/CopilotPagePattern.jsx +882 -83
- package/src/_b_end_runtime/preview-registry.jsx +27 -9
|
@@ -143,7 +143,6 @@ const FILTER_SAMPLE_OPTIONS = [
|
|
|
143
143
|
{ label: '选项一', value: 'option-1' },
|
|
144
144
|
{ label: '选项二', value: 'option-2' },
|
|
145
145
|
{ label: '选项三', value: 'option-3' },
|
|
146
|
-
{ label: '禁用项', value: 'option-4', disabled: true },
|
|
147
146
|
];
|
|
148
147
|
|
|
149
148
|
function FilterPreview({
|
|
@@ -617,12 +616,12 @@ const SELECT_DEMO_MANY = [
|
|
|
617
616
|
];
|
|
618
617
|
|
|
619
618
|
const SELECT_TAG_OPTIONS = [
|
|
620
|
-
{ value: 'brand', label: '
|
|
621
|
-
{ value: 'risk', label: '
|
|
622
|
-
{ value: 'service', label: '
|
|
623
|
-
{ value: 'quality', label: '
|
|
624
|
-
{ value: 'growth', label: '
|
|
625
|
-
{ value: 'content', label: '
|
|
619
|
+
{ value: 'brand', label: '品牌连锁', variant: 'grey' },
|
|
620
|
+
{ value: 'risk', label: '风险预警', variant: 'grey' },
|
|
621
|
+
{ value: 'service', label: '服务治理', variant: 'grey' },
|
|
622
|
+
{ value: 'quality', label: '品质提升', variant: 'grey' },
|
|
623
|
+
{ value: 'growth', label: '增长机会', variant: 'grey' },
|
|
624
|
+
{ value: 'content', label: '内容运营', variant: 'grey' },
|
|
626
625
|
];
|
|
627
626
|
|
|
628
627
|
const SELECT_AI_SINGLE_SUGGESTIONS = ['江苏省', '上海市', '浙江省'];
|
|
@@ -1579,6 +1578,12 @@ export const PREVIEW_REGISTRY = {
|
|
|
1579
1578
|
],
|
|
1580
1579
|
default: 'ola',
|
|
1581
1580
|
},
|
|
1581
|
+
{
|
|
1582
|
+
id: 'brandName',
|
|
1583
|
+
label: '平台名称',
|
|
1584
|
+
type: 'text',
|
|
1585
|
+
default: 'OLA',
|
|
1586
|
+
},
|
|
1582
1587
|
{
|
|
1583
1588
|
id: 'utilityActions',
|
|
1584
1589
|
label: '底部操作',
|
|
@@ -1591,11 +1596,21 @@ export const PREVIEW_REGISTRY = {
|
|
|
1591
1596
|
},
|
|
1592
1597
|
],
|
|
1593
1598
|
|
|
1599
|
+
normalizeControlValues: ({ changedControlId, nextControlValues, prevControlValues }) => {
|
|
1600
|
+
if (changedControlId !== 'platform') return nextControlValues;
|
|
1601
|
+
const prevDefaultBrandName = prevControlValues.platform === 'bytehi' ? 'ByteHi' : 'OLA';
|
|
1602
|
+
const nextDefaultBrandName = nextControlValues.platform === 'bytehi' ? 'ByteHi' : 'OLA';
|
|
1603
|
+
const shouldResetBrandName = !prevControlValues.brandName || prevControlValues.brandName === prevDefaultBrandName;
|
|
1604
|
+
return shouldResetBrandName
|
|
1605
|
+
? { ...nextControlValues, brandName: nextDefaultBrandName }
|
|
1606
|
+
: nextControlValues;
|
|
1607
|
+
},
|
|
1608
|
+
|
|
1594
1609
|
getVisibleEnumProps: ({ enumProps }) => enumProps.filter((prop) => prop.name !== 'avatarType' && prop.name !== 'platform' && prop.name !== 'promptText'),
|
|
1595
1610
|
|
|
1596
1611
|
mapProps: (cv, enums) => ({
|
|
1597
1612
|
platform: cv.platform || 'ola',
|
|
1598
|
-
brandName: cv.platform === 'bytehi' ? 'ByteHi' : 'OLA',
|
|
1613
|
+
brandName: cv.brandName || (cv.platform === 'bytehi' ? 'ByteHi' : 'OLA'),
|
|
1599
1614
|
showUtilityActions: cv.utilityActions === 'visible',
|
|
1600
1615
|
utilityItems: cv.utilityActions === 'visible'
|
|
1601
1616
|
? (cv.platform === 'bytehi'
|
|
@@ -1629,6 +1644,8 @@ export const PREVIEW_REGISTRY = {
|
|
|
1629
1644
|
generateUsage: (enums, cv = {}) => {
|
|
1630
1645
|
const avatarType = enums.avatarType || 'image';
|
|
1631
1646
|
const platform = cv.platform || 'ola';
|
|
1647
|
+
const defaultBrandName = platform === 'bytehi' ? 'ByteHi' : 'OLA';
|
|
1648
|
+
const brandName = cv.brandName || defaultBrandName;
|
|
1632
1649
|
const utilityActions = cv.utilityActions || 'hidden';
|
|
1633
1650
|
const lines = [`import NavBar from './components/NavBar';`];
|
|
1634
1651
|
|
|
@@ -1665,7 +1682,8 @@ export const PREVIEW_REGISTRY = {
|
|
|
1665
1682
|
lines.push('');
|
|
1666
1683
|
lines.push('<NavBar');
|
|
1667
1684
|
if (platform !== 'ola') lines.push(` platform="${platform}"`);
|
|
1668
|
-
if (
|
|
1685
|
+
if (brandName !== defaultBrandName) lines.push(` brandName="${brandName}"`);
|
|
1686
|
+
if (platform === 'bytehi' && brandName === defaultBrandName) lines.push(' brandName="ByteHi"');
|
|
1669
1687
|
if (avatarType !== 'image') lines.push(` avatarType="${avatarType}"`);
|
|
1670
1688
|
if (utilityActions === 'visible') lines.push(' showUtilityActions');
|
|
1671
1689
|
if (platform === 'ola') lines.push(' appBusinesses={appBusinesses}');
|