@coze-arch/cli 0.0.1-alpha.f626fa → 0.0.1-alpha.f91253

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.
@@ -1,63 +1,35 @@
1
- import { Platform, StyleSheet } from "react-native";
2
-
3
1
  export const Colors = {
4
2
  light: {
5
3
  textPrimary: "#1C1917",
6
4
  textSecondary: "#78716c",
7
5
  textMuted: "#9CA3AF",
8
- textDisabled: "#D1D5DB",
9
- placeholder: "#9CA3AF",
10
- tabIconDefault: "#9CA3AF",
11
- tabIconSelected: "#1C1917",
12
- primary: "#1C1917",
13
- accent: "#000000",
14
- link: "#1C1917",
15
- success: "#16A34A",
16
- warning: "#F59E0B",
17
- error: "#DC2626",
18
- info: "#2563EB",
19
- backgroundRoot: "#FFF",
20
- backgroundDefault: "#F9FAFB",
21
- backgroundSecondary: "#F3F4F6",
22
- backgroundTertiary: "#E5E7EB",
6
+ primary: "#4F46E5", // Indigo-600 - 品牌主色,代表科技与智能
7
+ accent: "#8B5CF6", // Violet-500 - 辅助色,代表创造力
8
+ success: "#10B981", // Emerald-500
9
+ error: "#EF4444",
10
+ backgroundRoot: "#FAFAFA",
11
+ backgroundDefault: "#FFFFFF",
12
+ backgroundTertiary: "#F9FAFB", // 更浅的背景色,用于去线留白
13
+ buttonPrimaryText: "#FFFFFF",
14
+ tabIconSelected: "#4F46E5",
23
15
  border: "#E5E7EB",
24
16
  borderLight: "#F3F4F6",
25
- divider: "#F3F4F6",
26
- overlay: "rgba(0, 0, 0, 0.4)",
27
- chartBackground: "rgba(249, 250, 251, 0.5)",
28
- buttonPrimaryBackground: "#1C1917",
29
- buttonPrimaryText: "#FFFFFF",
30
- buttonSecondaryBackground: "#F3F4F6",
31
- buttonSecondaryText: "#1C1917",
32
17
  },
33
18
  dark: {
34
19
  textPrimary: "#FAFAF9",
35
20
  textSecondary: "#A8A29E",
36
21
  textMuted: "#6F767E",
37
- textDisabled: "#4A4D50",
38
- placeholder: "#6F767E",
39
- tabIconDefault: "#6F767E",
40
- tabIconSelected: "#FAFAF9",
41
- primary: "#FAFAF9",
42
- accent: "#FFFFFF",
43
- link: "#FAFAF9",
44
- success: "#30D158",
45
- warning: "#FF9F0A",
46
- error: "#FF453A",
47
- info: "#64D2FF",
48
- backgroundRoot: "#0C0A09",
22
+ primary: "#818CF8", // Indigo-400 - 暗色模式品牌主色
23
+ accent: "#A78BFA", // Violet-400
24
+ success: "#34D399",
25
+ error: "#F87171",
26
+ backgroundRoot: "#09090B", // 更深的背景色
49
27
  backgroundDefault: "#1C1C1E",
50
- backgroundSecondary: "#2C2C2E",
51
- backgroundTertiary: "#3A3A3C",
52
- border: "#3A3A3C",
53
- borderLight: "#2C2C2E",
54
- divider: "#2C2C2E",
55
- overlay: "rgba(0, 0, 0, 0.6)",
56
- chartBackground: "rgba(28, 28, 30, 0.5)",
57
- buttonPrimaryBackground: "#FAFAF9",
58
- buttonPrimaryText: "#0C0A09",
59
- buttonSecondaryBackground: "#2C2C2E",
60
- buttonSecondaryText: "#FAFAF9",
28
+ backgroundTertiary: "#1F1F22", // 暗色模式去线留白背景
29
+ buttonPrimaryText: "#09090B",
30
+ tabIconSelected: "#818CF8",
31
+ border: "#3F3F46",
32
+ borderLight: "#27272A",
61
33
  },
62
34
  };
63
35
 
@@ -72,16 +44,6 @@ export const Spacing = {
72
44
  "4xl": 40,
73
45
  "5xl": 48,
74
46
  "6xl": 64,
75
- inputHeight: 48,
76
- buttonHeight: 48,
77
- avatarSize: 40,
78
- iconButtonSize: 32,
79
- contentPaddingHorizontal: 32,
80
- sectionGap: 40,
81
- sectionGapLarge: 48,
82
- itemGap: 8,
83
- detailGap: 48,
84
- chartHeight: 128,
85
47
  };
86
48
 
87
49
  export const BorderRadius = {
@@ -91,7 +53,8 @@ export const BorderRadius = {
91
53
  lg: 16,
92
54
  xl: 20,
93
55
  "2xl": 24,
94
- "3xl": 40,
56
+ "3xl": 28,
57
+ "4xl": 32,
95
58
  full: 9999,
96
59
  };
97
60
 
@@ -211,644 +174,4 @@ export const Typography = {
211
174
  },
212
175
  };
213
176
 
214
- export const Fonts = Platform.select({
215
- ios: {
216
- sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
217
- },
218
- android: {
219
- sans: "Roboto, 'Segoe UI', Helvetica, Arial, sans-serif",
220
- },
221
- default: {
222
- sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif",
223
- },
224
- });
225
-
226
- export const Shadow = {
227
- none: {},
228
- minimal: Platform.select({
229
- ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.05, shadowRadius: 2 },
230
- android: { elevation: 1 },
231
- default: {},
232
- }),
233
- sm: Platform.select({
234
- ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 1 }, shadowOpacity: 0.05, shadowRadius: 2 },
235
- android: { elevation: 1 },
236
- default: {},
237
- }),
238
- md: Platform.select({
239
- ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 2 }, shadowOpacity: 0.1, shadowRadius: 4 },
240
- android: { elevation: 3 },
241
- default: {},
242
- }),
243
- lg: Platform.select({
244
- ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.15, shadowRadius: 8 },
245
- android: { elevation: 6 },
246
- default: {},
247
- }),
248
- island: Platform.select({
249
- ios: { shadowColor: "#000", shadowOffset: { width: 0, height: 4 }, shadowOpacity: 0.1, shadowRadius: 20 },
250
- android: { elevation: 8 },
251
- default: {},
252
- }),
253
- };
254
-
255
- export const Duration = {
256
- fast: 150,
257
- normal: 250,
258
- slow: 400,
259
- };
260
-
261
- export const ZIndex = {
262
- base: 0,
263
- dropdown: 100,
264
- sticky: 200,
265
- modal: 300,
266
- toast: 400,
267
- overlay: 500,
268
- };
269
-
270
177
  export type Theme = typeof Colors.light;
271
-
272
- export const CommonStyles = StyleSheet.create({
273
- container: {
274
- flex: 1,
275
- },
276
- scrollContent: {
277
- paddingHorizontal: Spacing.contentPaddingHorizontal,
278
- },
279
- centerContent: {
280
- justifyContent: "center",
281
- alignItems: "center",
282
- },
283
- row: {
284
- flexDirection: "row",
285
- alignItems: "center",
286
- },
287
- rowGap: {
288
- flexDirection: "row",
289
- alignItems: "center",
290
- gap: Spacing.sm,
291
- },
292
- rowBetween: {
293
- flexDirection: "row",
294
- justifyContent: "space-between",
295
- alignItems: "center",
296
- },
297
- rowBetweenEnd: {
298
- flexDirection: "row",
299
- justifyContent: "space-between",
300
- alignItems: "flex-end",
301
- },
302
- rowBetweenStart: {
303
- flexDirection: "row",
304
- justifyContent: "space-between",
305
- alignItems: "flex-start",
306
- },
307
- rowCenter: {
308
- flexDirection: "row",
309
- justifyContent: "center",
310
- alignItems: "center",
311
- },
312
- rowCenterGap: {
313
- flexDirection: "row",
314
- justifyContent: "center",
315
- alignItems: "center",
316
- gap: Spacing.detailGap,
317
- },
318
- column: {
319
- flexDirection: "column",
320
- },
321
- columnCenter: {
322
- flexDirection: "column",
323
- alignItems: "center",
324
- },
325
- flex1: {
326
- flex: 1,
327
- },
328
- textCenter: {
329
- textAlign: "center",
330
- },
331
- avatar: {
332
- width: Spacing.avatarSize,
333
- height: Spacing.avatarSize,
334
- borderRadius: Spacing.avatarSize / 2,
335
- borderWidth: 1,
336
- justifyContent: "center",
337
- alignItems: "center",
338
- },
339
- iconButton: {
340
- width: Spacing.iconButtonSize,
341
- height: Spacing.iconButtonSize,
342
- borderRadius: Spacing.iconButtonSize / 2,
343
- justifyContent: "center",
344
- alignItems: "center",
345
- },
346
- button: {
347
- flexDirection: "row",
348
- alignItems: "center",
349
- justifyContent: "center",
350
- gap: Spacing.sm,
351
- paddingHorizontal: Spacing.contentPaddingHorizontal,
352
- paddingVertical: Spacing.md,
353
- borderWidth: 1,
354
- borderRadius: BorderRadius.full,
355
- },
356
- buttonSmall: {
357
- flexDirection: "row",
358
- alignItems: "center",
359
- justifyContent: "center",
360
- gap: Spacing.sm,
361
- paddingHorizontal: Spacing.lg,
362
- paddingVertical: Spacing.sm,
363
- borderRadius: BorderRadius.sm,
364
- },
365
- card: {
366
- borderRadius: BorderRadius.xl,
367
- padding: Spacing.sm,
368
- },
369
- chartContainer: {
370
- height: Spacing.chartHeight,
371
- borderRadius: BorderRadius.xl,
372
- padding: Spacing.sm,
373
- borderWidth: 1,
374
- position: "relative",
375
- },
376
- chartGrid: {
377
- position: "absolute",
378
- top: 0,
379
- left: 0,
380
- right: 0,
381
- bottom: 0,
382
- padding: Spacing.lg,
383
- justifyContent: "space-between",
384
- },
385
- chartEmpty: {
386
- flex: 1,
387
- justifyContent: "center",
388
- alignItems: "center",
389
- },
390
- progressBar: {
391
- width: "100%",
392
- height: 2,
393
- borderRadius: 1,
394
- overflow: "hidden",
395
- marginTop: Spacing.sm,
396
- },
397
- progressFill: {
398
- height: "100%",
399
- borderRadius: 1,
400
- },
401
- divider: {
402
- height: 1,
403
- width: "100%",
404
- },
405
- dividerVertical: {
406
- width: 1,
407
- height: "100%",
408
- },
409
- dot: {
410
- width: 4,
411
- height: 4,
412
- borderRadius: 2,
413
- },
414
- absoluteFill: {
415
- position: "absolute",
416
- top: 0,
417
- left: 0,
418
- right: 0,
419
- bottom: 0,
420
- },
421
- tooltip: {
422
- paddingHorizontal: Spacing.sm,
423
- paddingVertical: Spacing.xs,
424
- borderRadius: BorderRadius.xs,
425
- },
426
- emptyState: {
427
- alignItems: "center",
428
- paddingVertical: Spacing["2xl"],
429
- },
430
- section: {
431
- marginBottom: Spacing.sectionGap,
432
- },
433
- sectionLarge: {
434
- marginBottom: Spacing.sectionGapLarge,
435
- },
436
- sectionHeader: {
437
- flexDirection: "row",
438
- justifyContent: "space-between",
439
- alignItems: "flex-end",
440
- marginBottom: Spacing["2xl"],
441
- },
442
- gridLine: {
443
- width: "100%",
444
- height: 1,
445
- borderTopWidth: 1,
446
- borderStyle: "dashed",
447
- },
448
- statsGrid: {
449
- flexDirection: "row",
450
- },
451
- statsColumn: {
452
- flex: 1,
453
- },
454
- statsColumnLeft: {
455
- paddingRight: Spacing.lg,
456
- },
457
- statsColumnRight: {
458
- paddingLeft: Spacing.contentPaddingHorizontal,
459
- borderLeftWidth: 1,
460
- },
461
- statsHeader: {
462
- flexDirection: "row",
463
- justifyContent: "space-between",
464
- alignItems: "flex-start",
465
- marginBottom: Spacing.lg,
466
- },
467
- detailItem: {
468
- alignItems: "center",
469
- },
470
- header: {
471
- flexDirection: "row",
472
- justifyContent: "space-between",
473
- alignItems: "flex-end",
474
- paddingBottom: Spacing.lg,
475
- },
476
- loadingContainer: {
477
- flex: 1,
478
- justifyContent: "center",
479
- alignItems: "center",
480
- },
481
- glucoseSection: {
482
- marginTop: Spacing["2xl"],
483
- marginBottom: Spacing.sectionGap,
484
- alignItems: "center",
485
- },
486
- glucoseHeader: {
487
- flexDirection: "row",
488
- alignItems: "center",
489
- gap: Spacing.sm,
490
- marginBottom: Spacing.sm,
491
- },
492
- glucoseUnit: {
493
- flexDirection: "row",
494
- alignItems: "center",
495
- gap: Spacing.sm,
496
- marginTop: Spacing.sm,
497
- },
498
- glucoseDetails: {
499
- flexDirection: "row",
500
- justifyContent: "center",
501
- gap: Spacing.detailGap,
502
- marginTop: Spacing["2xl"],
503
- },
504
- });
505
-
506
- export const createThemedStyles = (theme: Theme) => {
507
- return StyleSheet.create({
508
- container: {
509
- ...CommonStyles.container,
510
- backgroundColor: theme.backgroundRoot,
511
- },
512
- scrollContent: {
513
- ...CommonStyles.scrollContent,
514
- },
515
- text: {
516
- color: theme.textPrimary,
517
- },
518
- textPrimary: {
519
- color: theme.textPrimary,
520
- },
521
- textSecondary: {
522
- color: theme.textSecondary,
523
- },
524
- textMuted: {
525
- color: theme.textMuted,
526
- },
527
- textDisabled: {
528
- color: theme.textDisabled,
529
- },
530
- textSuccess: {
531
- color: theme.success,
532
- },
533
- textError: {
534
- color: theme.error,
535
- },
536
- textInfo: {
537
- color: theme.info,
538
- },
539
- textButton: {
540
- color: theme.buttonPrimaryText,
541
- },
542
- avatar: {
543
- ...CommonStyles.avatar,
544
- borderColor: theme.border,
545
- backgroundColor: theme.backgroundRoot,
546
- },
547
- avatarText: {
548
- ...Typography.small,
549
- fontFamily: "serif",
550
- color: theme.textPrimary,
551
- },
552
- iconButton: {
553
- ...CommonStyles.iconButton,
554
- backgroundColor: theme.backgroundSecondary,
555
- },
556
- iconButtonText: {
557
- ...Typography.caption,
558
- color: theme.textMuted,
559
- },
560
- button: {
561
- ...CommonStyles.button,
562
- borderColor: theme.border,
563
- backgroundColor: theme.backgroundRoot,
564
- ...Shadow.minimal,
565
- },
566
- buttonText: {
567
- ...Typography.smallMedium,
568
- letterSpacing: 0.5,
569
- color: theme.textPrimary,
570
- },
571
- buttonOutline: {
572
- ...CommonStyles.buttonSmall,
573
- backgroundColor: theme.backgroundSecondary,
574
- },
575
- buttonOutlineText: {
576
- ...Typography.small,
577
- color: theme.textSecondary,
578
- },
579
- buttonSmall: {
580
- ...CommonStyles.buttonSmall,
581
- backgroundColor: theme.backgroundSecondary,
582
- },
583
- buttonSmallText: {
584
- ...Typography.small,
585
- color: theme.textSecondary,
586
- },
587
- card: {
588
- ...CommonStyles.card,
589
- backgroundColor: theme.backgroundRoot,
590
- },
591
- chartContainer: {
592
- ...CommonStyles.chartContainer,
593
- backgroundColor: theme.chartBackground,
594
- borderColor: theme.backgroundSecondary,
595
- },
596
- chartGrid: {
597
- ...CommonStyles.chartGrid,
598
- },
599
- chartEmpty: {
600
- ...CommonStyles.chartEmpty,
601
- },
602
- chartEmptyText: {
603
- ...Typography.small,
604
- color: theme.textMuted,
605
- },
606
- chartTooltip: {
607
- position: "absolute",
608
- right: 0,
609
- top: "55%",
610
- backgroundColor: theme.accent,
611
- paddingHorizontal: Spacing.sm,
612
- paddingVertical: Spacing.xs,
613
- borderRadius: BorderRadius.xs,
614
- ...Shadow.lg,
615
- },
616
- chartTooltipText: {
617
- ...Typography.tiny,
618
- color: theme.backgroundRoot,
619
- },
620
- progressBar: {
621
- ...CommonStyles.progressBar,
622
- backgroundColor: theme.backgroundSecondary,
623
- },
624
- progressFill: {
625
- ...CommonStyles.progressFill,
626
- backgroundColor: theme.accent,
627
- },
628
- progressFillMuted: {
629
- ...CommonStyles.progressFill,
630
- backgroundColor: theme.textMuted,
631
- },
632
- divider: {
633
- ...CommonStyles.divider,
634
- backgroundColor: theme.divider,
635
- },
636
- dividerVertical: {
637
- ...CommonStyles.dividerVertical,
638
- backgroundColor: theme.borderLight,
639
- },
640
- dot: {
641
- ...CommonStyles.dot,
642
- backgroundColor: theme.textDisabled,
643
- },
644
- tooltip: {
645
- ...CommonStyles.tooltip,
646
- backgroundColor: theme.accent,
647
- ...Shadow.lg,
648
- },
649
- tooltipText: {
650
- color: theme.backgroundRoot,
651
- },
652
- gridLine: {
653
- ...CommonStyles.gridLine,
654
- borderTopColor: theme.border,
655
- },
656
- emptyState: {
657
- ...CommonStyles.emptyState,
658
- },
659
- emptyText: {
660
- ...Typography.small,
661
- color: theme.textMuted,
662
- marginBottom: Spacing.lg,
663
- },
664
- section: {
665
- ...CommonStyles.section,
666
- },
667
- sectionLarge: {
668
- ...CommonStyles.sectionLarge,
669
- },
670
- sectionHeader: {
671
- ...CommonStyles.sectionHeader,
672
- },
673
- statsGrid: {
674
- ...CommonStyles.statsGrid,
675
- marginBottom: Spacing.sectionGap,
676
- },
677
- statsColumn: {
678
- ...CommonStyles.statsColumn,
679
- },
680
- statsColumnLeft: {
681
- ...CommonStyles.statsColumnLeft,
682
- },
683
- statsColumnRight: {
684
- ...CommonStyles.statsColumnRight,
685
- borderLeftColor: theme.borderLight,
686
- },
687
- statsHeader: {
688
- ...CommonStyles.statsHeader,
689
- },
690
- statsTitle: {
691
- ...Typography.title,
692
- color: theme.textPrimary,
693
- },
694
- statsValue: {
695
- ...Typography.stat,
696
- color: theme.textPrimary,
697
- },
698
- statsUnit: {
699
- ...Typography.caption,
700
- color: theme.textMuted,
701
- },
702
- statsSubtext: {
703
- ...Typography.caption,
704
- color: theme.textMuted,
705
- marginTop: Spacing.sm,
706
- },
707
- detailItem: {
708
- ...CommonStyles.detailItem,
709
- },
710
- detailLabel: {
711
- ...Typography.caption,
712
- color: theme.textMuted,
713
- marginBottom: Spacing.xs,
714
- },
715
- detailValue: {
716
- ...Typography.bodyMedium,
717
- color: theme.textPrimary,
718
- },
719
- header: {
720
- ...CommonStyles.header,
721
- },
722
- dateText: {
723
- ...Typography.captionMedium,
724
- color: theme.textMuted,
725
- letterSpacing: 1,
726
- textTransform: "uppercase",
727
- marginBottom: Spacing.xs,
728
- },
729
- greetingText: {
730
- ...Typography.h3,
731
- color: theme.textPrimary,
732
- },
733
- greetingName: {
734
- fontWeight: "700",
735
- },
736
- label: {
737
- ...Typography.label,
738
- color: theme.textMuted,
739
- },
740
- labelSmall: {
741
- ...Typography.labelSmall,
742
- color: theme.textMuted,
743
- },
744
- labelTitle: {
745
- ...Typography.labelTitle,
746
- color: theme.textPrimary,
747
- },
748
- loadingContainer: {
749
- ...CommonStyles.loadingContainer,
750
- backgroundColor: theme.backgroundRoot,
751
- },
752
- statusNormal: {
753
- ...Typography.smallMedium,
754
- color: theme.success,
755
- },
756
- statusHigh: {
757
- ...Typography.smallMedium,
758
- color: theme.error,
759
- },
760
- statusLow: {
761
- ...Typography.smallMedium,
762
- color: theme.info,
763
- },
764
- unitText: {
765
- ...Typography.smallMedium,
766
- color: theme.textMuted,
767
- },
768
- glucoseSection: {
769
- ...CommonStyles.glucoseSection,
770
- },
771
- glucoseHeader: {
772
- ...CommonStyles.glucoseHeader,
773
- },
774
- glucoseLabel: {
775
- ...Typography.label,
776
- color: theme.textMuted,
777
- },
778
- glucoseValue: {
779
- ...Typography.displayLarge,
780
- color: theme.textPrimary,
781
- },
782
- glucoseEmptyValue: {
783
- ...Typography.displayMedium,
784
- color: theme.textMuted,
785
- },
786
- glucoseUnit: {
787
- ...CommonStyles.glucoseUnit,
788
- },
789
- glucoseDetails: {
790
- ...CommonStyles.glucoseDetails,
791
- },
792
- trendLink: {
793
- flexDirection: "row",
794
- alignItems: "center",
795
- gap: Spacing.xs,
796
- },
797
- trendLinkText: {
798
- ...Typography.caption,
799
- color: theme.textMuted,
800
- },
801
- refreshButton: {
802
- ...CommonStyles.buttonSmall,
803
- backgroundColor: theme.backgroundSecondary,
804
- },
805
- refreshButtonText: {
806
- ...Typography.small,
807
- color: theme.textSecondary,
808
- },
809
- input: {
810
- height: Spacing.inputHeight,
811
- backgroundColor: theme.backgroundRoot,
812
- borderRadius: BorderRadius.sm,
813
- borderWidth: 1,
814
- borderColor: theme.border,
815
- paddingHorizontal: Spacing.lg,
816
- ...Typography.body,
817
- color: theme.textPrimary,
818
- },
819
- inputPlaceholder: {
820
- color: theme.placeholder,
821
- },
822
- link: {
823
- ...Typography.link,
824
- color: theme.link,
825
- },
826
- navItem: {
827
- flex: 1,
828
- alignItems: "center",
829
- justifyContent: "center",
830
- paddingVertical: Spacing.sm,
831
- },
832
- navIcon: {
833
- fontSize: 20,
834
- marginBottom: Spacing.xs,
835
- },
836
- navLabel: {
837
- ...Typography.navLabel,
838
- },
839
- navActive: {
840
- color: theme.textPrimary,
841
- },
842
- navInactive: {
843
- color: theme.textMuted,
844
- },
845
- navIndicator: {
846
- width: 4,
847
- height: 4,
848
- borderRadius: 2,
849
- backgroundColor: theme.textPrimary,
850
- position: "absolute",
851
- bottom: -8,
852
- },
853
- });
854
- };