@medway-ui/native 1.9.2 → 1.10.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/README.md +2 -2
- package/lib/commonjs/components/Alert.js +36 -25
- package/lib/commonjs/components/Alert.js.map +1 -1
- package/lib/commonjs/components/AlertDialog.js +22 -23
- package/lib/commonjs/components/AlertDialog.js.map +1 -1
- package/lib/commonjs/components/Avatar.js +4 -4
- package/lib/commonjs/components/Badge.js +22 -15
- package/lib/commonjs/components/Badge.js.map +1 -1
- package/lib/commonjs/components/Button.js +56 -42
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/CardNews.js +18 -13
- package/lib/commonjs/components/CardNews.js.map +1 -1
- package/lib/commonjs/components/Carousel.js +12 -8
- package/lib/commonjs/components/Carousel.js.map +1 -1
- package/lib/commonjs/components/Checkbox.js +5 -5
- package/lib/commonjs/components/Checkbox.js.map +1 -1
- package/lib/commonjs/components/Chip.js +52 -23
- package/lib/commonjs/components/Chip.js.map +1 -1
- package/lib/commonjs/components/Choice.js +26 -12
- package/lib/commonjs/components/Choice.js.map +1 -1
- package/lib/commonjs/components/Dialog.js +16 -8
- package/lib/commonjs/components/Dialog.js.map +1 -1
- package/lib/commonjs/components/DropdownMenu.js +35 -14
- package/lib/commonjs/components/DropdownMenu.js.map +1 -1
- package/lib/commonjs/components/EmptyState.js +5 -5
- package/lib/commonjs/components/EmptyState.js.map +1 -1
- package/lib/commonjs/components/FallbackImage.js +42 -35
- package/lib/commonjs/components/FallbackImage.js.map +1 -1
- package/lib/commonjs/components/Feed.js +6 -5
- package/lib/commonjs/components/Feed.js.map +1 -1
- package/lib/commonjs/components/FeedNotice.js +3 -3
- package/lib/commonjs/components/Feedback.js +2 -4
- package/lib/commonjs/components/Feedback.js.map +1 -1
- package/lib/commonjs/components/Filter.js +6 -9
- package/lib/commonjs/components/Filter.js.map +1 -1
- package/lib/commonjs/components/IndexLevel.js +4 -4
- package/lib/commonjs/components/Input.js +25 -20
- package/lib/commonjs/components/Input.js.map +1 -1
- package/lib/commonjs/components/InvitePopover.js +19 -8
- package/lib/commonjs/components/InvitePopover.js.map +1 -1
- package/lib/commonjs/components/Label.js +2 -2
- package/lib/commonjs/components/LeaderboardCard.js +3 -2
- package/lib/commonjs/components/LeaderboardCard.js.map +1 -1
- package/lib/commonjs/components/Loading.js +18 -15
- package/lib/commonjs/components/Loading.js.map +1 -1
- package/lib/commonjs/components/LoadingOverlay.js +36 -43
- package/lib/commonjs/components/LoadingOverlay.js.map +1 -1
- package/lib/commonjs/components/MemberRow.js +7 -6
- package/lib/commonjs/components/MemberRow.js.map +1 -1
- package/lib/commonjs/components/PageHeader.js +3 -2
- package/lib/commonjs/components/PageHeader.js.map +1 -1
- package/lib/commonjs/components/Popover.js +1 -1
- package/lib/commonjs/components/PostForm.js +38 -24
- package/lib/commonjs/components/PostForm.js.map +1 -1
- package/lib/commonjs/components/PrizeCollection.js +5 -5
- package/lib/commonjs/components/PrizeCollection.js.map +1 -1
- package/lib/commonjs/components/RadioGroup.js +65 -15
- package/lib/commonjs/components/RadioGroup.js.map +1 -1
- package/lib/commonjs/components/SectionHeader.js +3 -2
- package/lib/commonjs/components/SectionHeader.js.map +1 -1
- package/lib/commonjs/components/SegmentControl.js +4 -4
- package/lib/commonjs/components/Select.js +7 -6
- package/lib/commonjs/components/Select.js.map +1 -1
- package/lib/commonjs/components/Separator.js +2 -2
- package/lib/commonjs/components/Separator.js.map +1 -1
- package/lib/commonjs/components/Sheet.js +17 -11
- package/lib/commonjs/components/Sheet.js.map +1 -1
- package/lib/commonjs/components/Skeleton.js +2 -2
- package/lib/commonjs/components/Skeleton.js.map +1 -1
- package/lib/commonjs/components/Switch.js +3 -3
- package/lib/commonjs/components/Tabs.js +3 -2
- package/lib/commonjs/components/Tabs.js.map +1 -1
- package/lib/commonjs/components/Tag.js +52 -32
- package/lib/commonjs/components/Tag.js.map +1 -1
- package/lib/commonjs/components/Text.js +1 -1
- package/lib/commonjs/components/ThemedIcon.js +1 -1
- package/lib/commonjs/components/Toast.js +12 -12
- package/lib/commonjs/components/Toast.js.map +1 -1
- package/lib/commonjs/components/Tooltip.js +2 -2
- package/lib/commonjs/editor/NoteEditor.js +190 -67
- package/lib/commonjs/editor/NoteEditor.js.map +1 -1
- package/lib/commonjs/editor/editorHtml.generated.js +1 -1
- package/lib/commonjs/editor/editorHtml.generated.js.map +1 -1
- package/lib/commonjs/editor/index.js.map +1 -1
- package/lib/commonjs/editor/protocol.js +1 -2
- package/lib/commonjs/editor/protocol.js.map +1 -1
- package/lib/commonjs/hooks/useThemeColor.js +41 -19
- package/lib/commonjs/hooks/useThemeColor.js.map +1 -1
- package/lib/commonjs/index.js +46 -46
- package/lib/commonjs/lib/backdrop.js +18 -0
- package/lib/commonjs/lib/backdrop.js.map +1 -0
- package/lib/commonjs/lib/overlay-host.js +5 -3
- package/lib/commonjs/lib/overlay-host.js.map +1 -1
- package/lib/commonjs/lib/raised-surface.js +1 -1
- package/lib/module/components/Alert.js +36 -25
- package/lib/module/components/Alert.js.map +1 -1
- package/lib/module/components/AlertDialog.js +21 -22
- package/lib/module/components/AlertDialog.js.map +1 -1
- package/lib/module/components/Avatar.js +4 -4
- package/lib/module/components/Badge.js +22 -15
- package/lib/module/components/Badge.js.map +1 -1
- package/lib/module/components/Button.js +56 -42
- package/lib/module/components/Button.js.map +1 -1
- package/lib/module/components/CardNews.js +18 -13
- package/lib/module/components/CardNews.js.map +1 -1
- package/lib/module/components/Carousel.js +12 -8
- package/lib/module/components/Carousel.js.map +1 -1
- package/lib/module/components/Checkbox.js +5 -5
- package/lib/module/components/Checkbox.js.map +1 -1
- package/lib/module/components/Chip.js +52 -23
- package/lib/module/components/Chip.js.map +1 -1
- package/lib/module/components/Choice.js +26 -12
- package/lib/module/components/Choice.js.map +1 -1
- package/lib/module/components/Dialog.js +16 -8
- package/lib/module/components/Dialog.js.map +1 -1
- package/lib/module/components/DropdownMenu.js +36 -15
- package/lib/module/components/DropdownMenu.js.map +1 -1
- package/lib/module/components/EmptyState.js +5 -5
- package/lib/module/components/EmptyState.js.map +1 -1
- package/lib/module/components/FallbackImage.js +42 -35
- package/lib/module/components/FallbackImage.js.map +1 -1
- package/lib/module/components/Feed.js +6 -5
- package/lib/module/components/Feed.js.map +1 -1
- package/lib/module/components/FeedNotice.js +3 -3
- package/lib/module/components/Feedback.js +2 -4
- package/lib/module/components/Feedback.js.map +1 -1
- package/lib/module/components/Filter.js +6 -9
- package/lib/module/components/Filter.js.map +1 -1
- package/lib/module/components/IndexLevel.js +4 -4
- package/lib/module/components/Input.js +24 -18
- package/lib/module/components/Input.js.map +1 -1
- package/lib/module/components/InvitePopover.js +20 -9
- package/lib/module/components/InvitePopover.js.map +1 -1
- package/lib/module/components/Label.js +2 -2
- package/lib/module/components/LeaderboardCard.js +3 -2
- package/lib/module/components/LeaderboardCard.js.map +1 -1
- package/lib/module/components/Loading.js +18 -15
- package/lib/module/components/Loading.js.map +1 -1
- package/lib/module/components/LoadingOverlay.js +37 -44
- package/lib/module/components/LoadingOverlay.js.map +1 -1
- package/lib/module/components/MemberRow.js +7 -6
- package/lib/module/components/MemberRow.js.map +1 -1
- package/lib/module/components/PageHeader.js +3 -2
- package/lib/module/components/PageHeader.js.map +1 -1
- package/lib/module/components/Popover.js +1 -1
- package/lib/module/components/PostForm.js +38 -24
- package/lib/module/components/PostForm.js.map +1 -1
- package/lib/module/components/PrizeCollection.js +5 -5
- package/lib/module/components/PrizeCollection.js.map +1 -1
- package/lib/module/components/RadioGroup.js +65 -15
- package/lib/module/components/RadioGroup.js.map +1 -1
- package/lib/module/components/SectionHeader.js +3 -2
- package/lib/module/components/SectionHeader.js.map +1 -1
- package/lib/module/components/SegmentControl.js +4 -4
- package/lib/module/components/Select.js +6 -5
- package/lib/module/components/Select.js.map +1 -1
- package/lib/module/components/Separator.js +2 -2
- package/lib/module/components/Separator.js.map +1 -1
- package/lib/module/components/Sheet.js +17 -11
- package/lib/module/components/Sheet.js.map +1 -1
- package/lib/module/components/Skeleton.js +2 -2
- package/lib/module/components/Skeleton.js.map +1 -1
- package/lib/module/components/Switch.js +3 -3
- package/lib/module/components/Tabs.js +3 -2
- package/lib/module/components/Tabs.js.map +1 -1
- package/lib/module/components/Tag.js +52 -32
- package/lib/module/components/Tag.js.map +1 -1
- package/lib/module/components/Text.js +1 -1
- package/lib/module/components/ThemedIcon.js +1 -1
- package/lib/module/components/Toast.js +12 -12
- package/lib/module/components/Toast.js.map +1 -1
- package/lib/module/components/Tooltip.js +2 -2
- package/lib/module/editor/NoteEditor.js +193 -69
- package/lib/module/editor/NoteEditor.js.map +1 -1
- package/lib/module/editor/editorHtml.generated.js +1 -1
- package/lib/module/editor/editorHtml.generated.js.map +1 -1
- package/lib/module/editor/index.js.map +1 -1
- package/lib/module/editor/protocol.js +1 -2
- package/lib/module/editor/protocol.js.map +1 -1
- package/lib/module/hooks/useThemeColor.js +41 -19
- package/lib/module/hooks/useThemeColor.js.map +1 -1
- package/lib/module/index.js +46 -46
- package/lib/module/lib/backdrop.js +15 -0
- package/lib/module/lib/backdrop.js.map +1 -0
- package/lib/module/lib/overlay-host.js +6 -4
- package/lib/module/lib/overlay-host.js.map +1 -1
- package/lib/module/lib/raised-surface.js +1 -1
- package/lib/typescript/components/Alert.d.ts +1 -1
- package/lib/typescript/components/Alert.d.ts.map +1 -1
- package/lib/typescript/components/AlertDialog.d.ts +1 -1
- package/lib/typescript/components/AlertDialog.d.ts.map +1 -1
- package/lib/typescript/components/Badge.d.ts.map +1 -1
- package/lib/typescript/components/Button.d.ts +1 -0
- package/lib/typescript/components/Button.d.ts.map +1 -1
- package/lib/typescript/components/CardNews.d.ts +7 -2
- package/lib/typescript/components/CardNews.d.ts.map +1 -1
- package/lib/typescript/components/Checkbox.d.ts +3 -1
- package/lib/typescript/components/Checkbox.d.ts.map +1 -1
- package/lib/typescript/components/Chip.d.ts.map +1 -1
- package/lib/typescript/components/Choice.d.ts +4 -1
- package/lib/typescript/components/Choice.d.ts.map +1 -1
- package/lib/typescript/components/Dialog.d.ts +2 -1
- package/lib/typescript/components/Dialog.d.ts.map +1 -1
- package/lib/typescript/components/DropdownMenu.d.ts +3 -2
- package/lib/typescript/components/DropdownMenu.d.ts.map +1 -1
- package/lib/typescript/components/FallbackImage.d.ts.map +1 -1
- package/lib/typescript/components/Feed.d.ts.map +1 -1
- package/lib/typescript/components/Feedback.d.ts.map +1 -1
- package/lib/typescript/components/Filter.d.ts.map +1 -1
- package/lib/typescript/components/IndexLevel.d.ts +1 -1
- package/lib/typescript/components/Input.d.ts +5 -5
- package/lib/typescript/components/Input.d.ts.map +1 -1
- package/lib/typescript/components/InvitePopover.d.ts +1 -1
- package/lib/typescript/components/InvitePopover.d.ts.map +1 -1
- package/lib/typescript/components/LeaderboardCard.d.ts.map +1 -1
- package/lib/typescript/components/Loading.d.ts +1 -1
- package/lib/typescript/components/Loading.d.ts.map +1 -1
- package/lib/typescript/components/LoadingOverlay.d.ts +9 -9
- package/lib/typescript/components/LoadingOverlay.d.ts.map +1 -1
- package/lib/typescript/components/PageHeader.d.ts.map +1 -1
- package/lib/typescript/components/PostForm.d.ts.map +1 -1
- package/lib/typescript/components/RadioGroup.d.ts +4 -2
- package/lib/typescript/components/RadioGroup.d.ts.map +1 -1
- package/lib/typescript/components/SectionHeader.d.ts.map +1 -1
- package/lib/typescript/components/SegmentControl.d.ts +1 -1
- package/lib/typescript/components/Select.d.ts +2 -1
- package/lib/typescript/components/Select.d.ts.map +1 -1
- package/lib/typescript/components/Separator.d.ts.map +1 -1
- package/lib/typescript/components/Sheet.d.ts +2 -1
- package/lib/typescript/components/Sheet.d.ts.map +1 -1
- package/lib/typescript/components/Tabs.d.ts +4 -3
- package/lib/typescript/components/Tabs.d.ts.map +1 -1
- package/lib/typescript/components/Tag.d.ts +3 -1
- package/lib/typescript/components/Tag.d.ts.map +1 -1
- package/lib/typescript/components/ThemedIcon.d.ts +1 -1
- package/lib/typescript/components/Toast.d.ts +1 -1
- package/lib/typescript/components/Toast.d.ts.map +1 -1
- package/lib/typescript/editor/NoteEditor.d.ts +28 -8
- package/lib/typescript/editor/NoteEditor.d.ts.map +1 -1
- package/lib/typescript/editor/editorHtml.generated.d.ts.map +1 -1
- package/lib/typescript/editor/index.d.ts +1 -1
- package/lib/typescript/editor/index.d.ts.map +1 -1
- package/lib/typescript/editor/protocol.d.ts +4 -14
- package/lib/typescript/editor/protocol.d.ts.map +1 -1
- package/lib/typescript/hooks/use-toast.d.ts +1 -1
- package/lib/typescript/hooks/useThemeColor.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +91 -91
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/lib/backdrop.d.ts +4 -0
- package/lib/typescript/lib/backdrop.d.ts.map +1 -0
- package/lib/typescript/lib/overlay-host.d.ts +1 -0
- package/lib/typescript/lib/overlay-host.d.ts.map +1 -1
- package/package.json +9 -14
- package/setup/tailwind.js +16 -8
- package/setup/tokens.native.css +51 -20
- package/src/components/Alert.tsx +37 -20
- package/src/components/AlertDialog.tsx +18 -19
- package/src/components/Badge.tsx +16 -15
- package/src/components/Button.tsx +64 -31
- package/src/components/CardNews.tsx +17 -6
- package/src/components/Carousel.tsx +5 -5
- package/src/components/Checkbox.tsx +17 -7
- package/src/components/Chip.tsx +49 -21
- package/src/components/Choice.tsx +34 -14
- package/src/components/Dialog.tsx +15 -5
- package/src/components/DropdownMenu.tsx +62 -14
- package/src/components/EmptyState.tsx +3 -3
- package/src/components/FallbackImage.tsx +32 -23
- package/src/components/Feed.tsx +2 -1
- package/src/components/Feedback.tsx +0 -1
- package/src/components/Filter.tsx +2 -3
- package/src/components/Input.tsx +83 -64
- package/src/components/InvitePopover.tsx +11 -3
- package/src/components/LeaderboardCard.tsx +4 -1
- package/src/components/Loading.tsx +17 -14
- package/src/components/LoadingOverlay.tsx +33 -50
- package/src/components/MemberRow.tsx +3 -3
- package/src/components/PageHeader.tsx +4 -1
- package/src/components/PostForm.tsx +28 -16
- package/src/components/PrizeCollection.tsx +3 -3
- package/src/components/RadioGroup.tsx +69 -12
- package/src/components/SectionHeader.tsx +4 -1
- package/src/components/Select.tsx +4 -3
- package/src/components/Separator.tsx +2 -2
- package/src/components/Sheet.tsx +15 -8
- package/src/components/Skeleton.tsx +1 -1
- package/src/components/Tabs.tsx +5 -4
- package/src/components/Tag.tsx +56 -35
- package/src/components/Toast.tsx +10 -6
- package/src/editor/NoteEditor.tsx +246 -72
- package/src/editor/editorHtml.generated.ts +1 -1
- package/src/editor/index.ts +8 -4
- package/src/editor/protocol.ts +4 -12
- package/src/hooks/useThemeColor.ts +41 -19
- package/src/index.ts +1 -1
- package/src/lib/backdrop.ts +16 -0
- package/src/lib/overlay-host.tsx +5 -5
package/setup/tokens.native.css
CHANGED
|
@@ -387,6 +387,7 @@
|
|
|
387
387
|
--color-state-focus: var(--color-gray-70);
|
|
388
388
|
--color-state-active: var(--color-primary-16);
|
|
389
389
|
--color-state-error: var(--color-red-16);
|
|
390
|
+
--color-state-success: var(--color-green-16);
|
|
390
391
|
|
|
391
392
|
/* === Base feedback success colors === */
|
|
392
393
|
--color-feedback-success-foreground: var(--color-green-darken-3);
|
|
@@ -628,25 +629,39 @@
|
|
|
628
629
|
--color-gradient-prev-bg-2: var(--color-gray-10);
|
|
629
630
|
|
|
630
631
|
/* === Base gradient r1 === */
|
|
631
|
-
--color-gradient-r1-blur-1: var(--color-secondary);
|
|
632
|
-
--color-gradient-r1-blur-2: var(--color-
|
|
632
|
+
--color-gradient-r1-blur-1: var(--color-secondary-lighten-1);
|
|
633
|
+
--color-gradient-r1-blur-2: var(--color-cm);
|
|
633
634
|
--color-gradient-r1-blur-3: var(--color-primary-lighten-5);
|
|
634
|
-
--color-gradient-r1-bg-1: var(--color-primary);
|
|
635
|
-
--color-gradient-r1-bg-2: var(--color-primary-lighten-
|
|
635
|
+
--color-gradient-r1-bg-1: var(--color-primary-lighten-2);
|
|
636
|
+
--color-gradient-r1-bg-2: var(--color-primary-lighten-6);
|
|
636
637
|
|
|
637
638
|
/* === Base gradient rplus === */
|
|
638
|
-
--color-gradient-rplus-blur-1: var(--color-
|
|
639
|
+
--color-gradient-rplus-blur-1: var(--color-prev);
|
|
639
640
|
--color-gradient-rplus-blur-2: var(--color-primary-lighten-3);
|
|
640
641
|
--color-gradient-rplus-blur-3: var(--color-primary-lighten-5);
|
|
641
|
-
--color-gradient-rplus-bg-1: var(--color-primary-lighten-
|
|
642
|
-
--color-gradient-rplus-bg-2: var(--color-
|
|
642
|
+
--color-gradient-rplus-bg-1: var(--color-primary-lighten-4);
|
|
643
|
+
--color-gradient-rplus-bg-2: var(--color-prev-lighten-3);
|
|
643
644
|
|
|
644
645
|
/* === Base gradient pt === */
|
|
645
|
-
--color-gradient-pt-blur-1: var(--color-
|
|
646
|
-
--color-gradient-pt-blur-2: var(--color-secondary-darken-
|
|
647
|
-
--color-gradient-pt-blur-3: var(--color-secondary-darken-
|
|
646
|
+
--color-gradient-pt-blur-1: var(--color-cir);
|
|
647
|
+
--color-gradient-pt-blur-2: var(--color-secondary-darken-1);
|
|
648
|
+
--color-gradient-pt-blur-3: var(--color-secondary-darken-2);
|
|
648
649
|
--color-gradient-pt-bg-1: var(--color-gray-600);
|
|
649
|
-
--color-gradient-pt-bg-2: var(--color-gray-
|
|
650
|
+
--color-gradient-pt-bg-2: var(--color-gray-300);
|
|
651
|
+
|
|
652
|
+
/* === Base gradient default === */
|
|
653
|
+
--color-gradient-default-blur-1: var(--color-gray-10);
|
|
654
|
+
--color-gradient-default-blur-2: var(--color-secondary-lighten-5);
|
|
655
|
+
--color-gradient-default-blur-3: var(--color-primary-lighten-6);
|
|
656
|
+
--color-gradient-default-bg-1: var(--color-gray-150);
|
|
657
|
+
--color-gradient-default-bg-2: var(--color-gray-50);
|
|
658
|
+
|
|
659
|
+
/* === Base gradient neutral === */
|
|
660
|
+
--color-gradient-neutral-blur-1: var(--color-white);
|
|
661
|
+
--color-gradient-neutral-blur-2: var(--color-gray-70);
|
|
662
|
+
--color-gradient-neutral-blur-3: var(--color-gray-150);
|
|
663
|
+
--color-gradient-neutral-bg-1: var(--color-gray-50);
|
|
664
|
+
--color-gradient-neutral-bg-2: var(--color-gray-30);
|
|
650
665
|
|
|
651
666
|
/* === Typography fontfamily === */
|
|
652
667
|
/* RN: single family name (loaded via expo-font as "Montserrat"). */
|
|
@@ -662,7 +677,7 @@
|
|
|
662
677
|
--font-weight-medium: 500;
|
|
663
678
|
--font-weight-semibold: 600;
|
|
664
679
|
--font-weight-bold: 700;
|
|
665
|
-
--font-weight-extrabold:
|
|
680
|
+
--font-weight-extrabold: 800;
|
|
666
681
|
|
|
667
682
|
/* === Typography size === */
|
|
668
683
|
--text-xxs: 10px;
|
|
@@ -702,6 +717,7 @@
|
|
|
702
717
|
--radius-sm: 4px;
|
|
703
718
|
--radius-md: 8px;
|
|
704
719
|
--radius-lg: 16px;
|
|
720
|
+
--radius-xl: 32px;
|
|
705
721
|
--radius-pill: 320px;
|
|
706
722
|
--radius-circular: 1600px;
|
|
707
723
|
--radius-full: 9999px;
|
|
@@ -745,6 +761,7 @@
|
|
|
745
761
|
--color-state-focus: var(--color-gray-700);
|
|
746
762
|
--color-state-active: var(--color-white-16);
|
|
747
763
|
--color-state-error: var(--color-red-16);
|
|
764
|
+
--color-state-success: var(--color-green-16);
|
|
748
765
|
|
|
749
766
|
/* === Base feedback success colors === */
|
|
750
767
|
--color-feedback-success-foreground: var(--color-green-lighten-4);
|
|
@@ -794,7 +811,7 @@
|
|
|
794
811
|
/* === Dark surface colors === */
|
|
795
812
|
--color-surface-elevated: var(--color-gray-800);
|
|
796
813
|
--color-surface-card: var(--color-gray-850);
|
|
797
|
-
--color-surface-navigation: var(--color-gray-
|
|
814
|
+
--color-surface-navigation: var(--color-gray-900);
|
|
798
815
|
--color-surface-section: var(--color-gray-850);
|
|
799
816
|
--color-surface-page: var(--color-gray-950);
|
|
800
817
|
--color-surface-disable: var(--color-black-8);
|
|
@@ -1000,23 +1017,37 @@
|
|
|
1000
1017
|
|
|
1001
1018
|
/* === Dark gradient r1 === */
|
|
1002
1019
|
--color-gradient-r1-blur-1: var(--color-secondary);
|
|
1003
|
-
--color-gradient-r1-blur-2: var(--color-primary-lighten-
|
|
1020
|
+
--color-gradient-r1-blur-2: var(--color-primary-lighten-2);
|
|
1004
1021
|
--color-gradient-r1-blur-3: var(--color-primary-lighten-2);
|
|
1005
1022
|
--color-gradient-r1-bg-1: var(--color-primary);
|
|
1006
|
-
--color-gradient-r1-bg-2: var(--color-primary-darken-
|
|
1023
|
+
--color-gradient-r1-bg-2: var(--color-primary-darken-1);
|
|
1007
1024
|
|
|
1008
1025
|
/* === Dark gradient rplus === */
|
|
1009
|
-
--color-gradient-rplus-blur-1: var(--color-
|
|
1026
|
+
--color-gradient-rplus-blur-1: var(--color-prev-darken-1);
|
|
1010
1027
|
--color-gradient-rplus-blur-2: var(--color-primary-lighten-3);
|
|
1011
1028
|
--color-gradient-rplus-blur-3: var(--color-primary-lighten-1);
|
|
1012
1029
|
--color-gradient-rplus-bg-1: var(--color-primary);
|
|
1013
|
-
--color-gradient-rplus-bg-2: var(--color-
|
|
1030
|
+
--color-gradient-rplus-bg-2: var(--color-prev-darken-6);
|
|
1014
1031
|
|
|
1015
1032
|
/* === Dark gradient pt === */
|
|
1016
|
-
--color-gradient-pt-blur-1: var(--color-
|
|
1017
|
-
--color-gradient-pt-blur-2: var(--color-secondary-darken-
|
|
1018
|
-
--color-gradient-pt-blur-3: var(--color-secondary-darken-
|
|
1033
|
+
--color-gradient-pt-blur-1: var(--color-cir-darken-1);
|
|
1034
|
+
--color-gradient-pt-blur-2: var(--color-secondary-darken-2);
|
|
1035
|
+
--color-gradient-pt-blur-3: var(--color-secondary-darken-4);
|
|
1019
1036
|
--color-gradient-pt-bg-1: var(--color-gray-800);
|
|
1020
1037
|
--color-gradient-pt-bg-2: var(--color-gray-900);
|
|
1038
|
+
|
|
1039
|
+
/* === Dark gradient default === */
|
|
1040
|
+
--color-gradient-default-blur-1: var(--color-primary-lighten-1);
|
|
1041
|
+
--color-gradient-default-blur-2: var(--color-secondary-lighten-2);
|
|
1042
|
+
--color-gradient-default-blur-3: var(--color-primary-lighten-3);
|
|
1043
|
+
--color-gradient-default-bg-1: var(--color-gray-850);
|
|
1044
|
+
--color-gradient-default-bg-2: var(--color-gray-900);
|
|
1045
|
+
|
|
1046
|
+
/* === Dark gradient neutral === */
|
|
1047
|
+
--color-gradient-neutral-blur-1: var(--color-gray-900);
|
|
1048
|
+
--color-gradient-neutral-blur-2: var(--color-gray-850);
|
|
1049
|
+
--color-gradient-neutral-blur-3: var(--color-gray-800);
|
|
1050
|
+
--color-gradient-neutral-bg-1: var(--color-gray-850);
|
|
1051
|
+
--color-gradient-neutral-bg-2: var(--color-gray-950);
|
|
1021
1052
|
}
|
|
1022
1053
|
}
|
package/src/components/Alert.tsx
CHANGED
|
@@ -29,15 +29,17 @@ const AlertContext = createContext<{
|
|
|
29
29
|
onClose?: () => void;
|
|
30
30
|
} | null>(null);
|
|
31
31
|
|
|
32
|
+
const alertBackgroundClassName: Record<AlertVariant, string> = {
|
|
33
|
+
regular: "bg-primary-background-soft",
|
|
34
|
+
emphasis: "bg-secondary-background-soft",
|
|
35
|
+
success: "bg-feedback-success-background-soft",
|
|
36
|
+
warning: "bg-feedback-warning-background-soft",
|
|
37
|
+
error: "bg-feedback-error-background-soft",
|
|
38
|
+
};
|
|
39
|
+
|
|
32
40
|
const alertVariants = cva("relative w-full rounded-md px-4 py-3 flex-col gap-1", {
|
|
33
41
|
variants: {
|
|
34
|
-
variant:
|
|
35
|
-
regular: "bg-primary-background-soft",
|
|
36
|
-
emphasis: "bg-secondary-background-soft",
|
|
37
|
-
success: "bg-green-background-soft",
|
|
38
|
-
warning: "bg-yellow-background-soft",
|
|
39
|
-
error: "bg-red-background-soft",
|
|
40
|
-
},
|
|
42
|
+
variant: alertBackgroundClassName,
|
|
41
43
|
},
|
|
42
44
|
defaultVariants: { variant: "regular" },
|
|
43
45
|
});
|
|
@@ -47,30 +49,45 @@ const alertTextColorVariants = cva("", {
|
|
|
47
49
|
variant: {
|
|
48
50
|
regular: "text-primary-foreground",
|
|
49
51
|
emphasis: "text-secondary-foreground",
|
|
50
|
-
success: "text-
|
|
51
|
-
warning: "text-
|
|
52
|
-
error: "text-
|
|
52
|
+
success: "text-feedback-success-foreground",
|
|
53
|
+
warning: "text-feedback-warning-foreground",
|
|
54
|
+
error: "text-feedback-error-foreground",
|
|
53
55
|
},
|
|
54
56
|
},
|
|
55
57
|
defaultVariants: { variant: "regular" },
|
|
56
58
|
});
|
|
57
59
|
|
|
60
|
+
const alertDescriptionColorClassName: Record<AlertVariant, string> = {
|
|
61
|
+
regular: "text-primary-foreground-emphasis",
|
|
62
|
+
emphasis: "text-secondary-foreground-emphasis",
|
|
63
|
+
success: "text-feedback-success-foreground-emphasis",
|
|
64
|
+
warning: "text-feedback-warning-foreground-emphasis",
|
|
65
|
+
error: "text-feedback-error-foreground-emphasis",
|
|
66
|
+
};
|
|
67
|
+
|
|
58
68
|
const alertButtonVariants = cva(
|
|
59
|
-
"flex-row items-center justify-center rounded-pill px-3 min-h-10",
|
|
69
|
+
"flex-row items-center justify-center rounded-pill px-3 min-h-10 disabled:opacity-50",
|
|
60
70
|
{
|
|
61
71
|
variants: {
|
|
62
72
|
variant: {
|
|
63
73
|
regular: "",
|
|
64
|
-
basic: "
|
|
74
|
+
basic: "",
|
|
65
75
|
},
|
|
66
76
|
alertVariant: {
|
|
67
|
-
regular: "bg-primary-background-soft",
|
|
68
|
-
emphasis: "bg-secondary-background-soft",
|
|
69
|
-
success: "bg-
|
|
70
|
-
warning: "bg-
|
|
71
|
-
error: "bg-
|
|
77
|
+
regular: "active:bg-primary-background-soft-emphasis",
|
|
78
|
+
emphasis: "active:bg-secondary-background-soft-emphasis",
|
|
79
|
+
success: "active:bg-feedback-success-background-soft-emphasis",
|
|
80
|
+
warning: "active:bg-feedback-warning-background-soft-emphasis",
|
|
81
|
+
error: "active:bg-feedback-error-background-soft-emphasis",
|
|
72
82
|
},
|
|
73
83
|
},
|
|
84
|
+
compoundVariants: (Object.keys(alertBackgroundClassName) as AlertVariant[]).map(
|
|
85
|
+
(alertVariant) => ({
|
|
86
|
+
variant: "regular" as const,
|
|
87
|
+
alertVariant,
|
|
88
|
+
className: alertBackgroundClassName[alertVariant],
|
|
89
|
+
})
|
|
90
|
+
),
|
|
74
91
|
defaultVariants: { variant: "regular", alertVariant: "regular" },
|
|
75
92
|
}
|
|
76
93
|
);
|
|
@@ -89,7 +106,7 @@ function Alert({ className, variant = "regular", onClose, children, ...props }:
|
|
|
89
106
|
<AlertContext.Provider value={ctx}>
|
|
90
107
|
<View
|
|
91
108
|
accessibilityRole="alert"
|
|
92
|
-
className={cn(alertVariants({ variant }), className)}
|
|
109
|
+
className={cn(alertVariants({ variant }), onClose && "pr-12", className)}
|
|
93
110
|
{...props}
|
|
94
111
|
>
|
|
95
112
|
{children}
|
|
@@ -131,7 +148,7 @@ function AlertTitle({ className, children, ...props }: ViewProps & { children?:
|
|
|
131
148
|
<View className={cn("", className)} {...props}>
|
|
132
149
|
<Text
|
|
133
150
|
numberOfLines={1}
|
|
134
|
-
className={cn("text-md font-
|
|
151
|
+
className={cn("text-md font-semibold", alertTextColorVariants({ variant }))}
|
|
135
152
|
>
|
|
136
153
|
{children}
|
|
137
154
|
</Text>
|
|
@@ -145,7 +162,7 @@ function AlertDescription({ className, children, ...props }: ViewProps & { child
|
|
|
145
162
|
<View className={cn("", className)} {...props}>
|
|
146
163
|
<Text
|
|
147
164
|
numberOfLines={3}
|
|
148
|
-
className={cn("text-sm font-medium leading-
|
|
165
|
+
className={cn("text-sm font-medium leading-sm", alertDescriptionColorClassName[variant])}
|
|
149
166
|
>
|
|
150
167
|
{children}
|
|
151
168
|
</Text>
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { createContext, useContext, useMemo, type ReactNode } from "react";
|
|
2
|
-
import { View,
|
|
2
|
+
import { View, type ViewProps } from "react-native";
|
|
3
3
|
import * as AlertDialogPrimitive from "@rn-primitives/alert-dialog";
|
|
4
4
|
import { cva } from "class-variance-authority";
|
|
5
5
|
import { CloseMd } from "@medway-ui/icons/native";
|
|
6
6
|
import { useThemeColor } from "@/hooks/useThemeColor";
|
|
7
|
+
import { useBackdropStyle } from "@/lib/backdrop";
|
|
7
8
|
import { cn } from "@/lib/utils";
|
|
9
|
+
import { Text } from "@/components/Text";
|
|
8
10
|
import { Button, type ButtonProps } from "@/components/Button";
|
|
9
11
|
import { Tag, type TagProps } from "@/components/Tag";
|
|
10
12
|
|
|
@@ -66,9 +68,9 @@ const alertDialogIconContainerVariants = cva(
|
|
|
66
68
|
variant: {
|
|
67
69
|
regular: "bg-primary-background-fill",
|
|
68
70
|
emphasis: "bg-secondary-background-fill",
|
|
69
|
-
warning: "bg-
|
|
70
|
-
error: "bg-
|
|
71
|
-
success: "bg-
|
|
71
|
+
warning: "bg-feedback-warning-background-fill",
|
|
72
|
+
error: "bg-feedback-error-background-fill",
|
|
73
|
+
success: "bg-feedback-success-background-fill",
|
|
72
74
|
},
|
|
73
75
|
},
|
|
74
76
|
defaultVariants: { variant: DEFAULT_VARIANT },
|
|
@@ -80,9 +82,9 @@ const alertDialogIconTextVariants = cva("", {
|
|
|
80
82
|
variant: {
|
|
81
83
|
regular: "text-primary-foreground-onfill",
|
|
82
84
|
emphasis: "text-secondary-foreground-onfill",
|
|
83
|
-
warning: "text-
|
|
84
|
-
error: "text-
|
|
85
|
-
success: "text-
|
|
85
|
+
warning: "text-feedback-warning-foreground-onfill",
|
|
86
|
+
error: "text-feedback-error-foreground-onfill",
|
|
87
|
+
success: "text-feedback-success-foreground-onfill",
|
|
86
88
|
},
|
|
87
89
|
},
|
|
88
90
|
defaultVariants: { variant: DEFAULT_VARIANT },
|
|
@@ -96,14 +98,6 @@ const alertDialogTagVariantMap: Record<AlertDialogVariant, TagProps["variant"]>
|
|
|
96
98
|
success: "success-soft",
|
|
97
99
|
};
|
|
98
100
|
|
|
99
|
-
const actionVariantMap: Record<AlertDialogVariant, NonNullable<ButtonProps["variant"]>> = {
|
|
100
|
-
regular: "regular",
|
|
101
|
-
emphasis: "emphasis",
|
|
102
|
-
warning: "warning",
|
|
103
|
-
error: "error",
|
|
104
|
-
success: "success",
|
|
105
|
-
};
|
|
106
|
-
|
|
107
101
|
function AlertDialog({ variant = DEFAULT_VARIANT, ...props }: AlertDialogProps) {
|
|
108
102
|
const ctx = useMemo(() => ({ variant }), [variant]);
|
|
109
103
|
return (
|
|
@@ -122,9 +116,12 @@ function AlertDialogPortal({ ...props }: AlertDialogPrimitive.PortalProps) {
|
|
|
122
116
|
}
|
|
123
117
|
|
|
124
118
|
function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.OverlayProps) {
|
|
119
|
+
const backdropStyle = useBackdropStyle(className);
|
|
120
|
+
|
|
125
121
|
return (
|
|
126
122
|
<AlertDialogPrimitive.Overlay
|
|
127
|
-
className={cn("absolute inset-0
|
|
123
|
+
className={cn("absolute inset-0", className)}
|
|
124
|
+
style={backdropStyle}
|
|
128
125
|
{...props}
|
|
129
126
|
/>
|
|
130
127
|
);
|
|
@@ -138,11 +135,13 @@ function AlertDialogContent({
|
|
|
138
135
|
...props
|
|
139
136
|
}: AlertDialogContentProps) {
|
|
140
137
|
const closeIconColor = useThemeColor("gray-foreground");
|
|
138
|
+
const backdropStyle = useBackdropStyle(overlayClassName);
|
|
141
139
|
|
|
142
140
|
return (
|
|
143
141
|
<AlertDialogPrimitive.Portal>
|
|
144
142
|
<AlertDialogPrimitive.Overlay
|
|
145
|
-
className={cn("absolute inset-0
|
|
143
|
+
className={cn("absolute inset-0", overlayClassName)}
|
|
144
|
+
style={backdropStyle}
|
|
146
145
|
/>
|
|
147
146
|
<AlertDialogPrimitive.Content
|
|
148
147
|
className="absolute inset-0 items-center justify-center px-4"
|
|
@@ -150,7 +149,7 @@ function AlertDialogContent({
|
|
|
150
149
|
>
|
|
151
150
|
<View
|
|
152
151
|
className={cn(
|
|
153
|
-
"relative flex-col w-full rounded-
|
|
152
|
+
"relative flex-col w-full rounded-lg bg-surface-elevated shadow-lg overflow-hidden",
|
|
154
153
|
className
|
|
155
154
|
)}
|
|
156
155
|
>
|
|
@@ -247,7 +246,7 @@ function AlertDialogAction({
|
|
|
247
246
|
}: AlertDialogActionProps) {
|
|
248
247
|
const ctx = useContext(AlertDialogContext);
|
|
249
248
|
const primitiveCtx = AlertDialogPrimitive.useRootContext();
|
|
250
|
-
const resolvedVariant = variant ??
|
|
249
|
+
const resolvedVariant = variant ?? ctx?.variant ?? DEFAULT_VARIANT;
|
|
251
250
|
|
|
252
251
|
return (
|
|
253
252
|
<View className={cn("flex-1", className)}>
|
package/src/components/Badge.tsx
CHANGED
|
@@ -57,13 +57,13 @@ const badgeVariants = cva("flex-row items-center justify-center rounded-pill", {
|
|
|
57
57
|
cir: "bg-cir-background-fill",
|
|
58
58
|
"cir-soft": "bg-surface-card",
|
|
59
59
|
// The design paints pediatrics with the warning tokens, all but the filled label.
|
|
60
|
-
ped: "bg-
|
|
60
|
+
ped: "bg-feedback-warning-background-fill",
|
|
61
61
|
"ped-soft": "bg-surface-card",
|
|
62
62
|
prev: "bg-prev-background-fill",
|
|
63
63
|
"prev-soft": "bg-surface-card",
|
|
64
64
|
freemium: "bg-primary",
|
|
65
|
-
error: "bg-
|
|
66
|
-
warning: "bg-
|
|
65
|
+
error: "bg-feedback-error-background-soft",
|
|
66
|
+
warning: "bg-feedback-warning-background-soft",
|
|
67
67
|
neutral: "bg-gray-background-soft",
|
|
68
68
|
},
|
|
69
69
|
size: {
|
|
@@ -93,7 +93,7 @@ const SOFT_TINT: Partial<Record<BadgeVariant, string>> = {
|
|
|
93
93
|
"cm-soft": "bg-cm-background-soft",
|
|
94
94
|
"go-soft": "bg-go-background-soft",
|
|
95
95
|
"cir-soft": "bg-cir-background-soft",
|
|
96
|
-
"ped-soft": "bg-
|
|
96
|
+
"ped-soft": "bg-feedback-warning-background-soft",
|
|
97
97
|
"prev-soft": "bg-prev-background-soft",
|
|
98
98
|
};
|
|
99
99
|
|
|
@@ -112,13 +112,13 @@ const badgeTextVariants = cva("font-bold", {
|
|
|
112
112
|
cir: "text-cir-foreground-onfill",
|
|
113
113
|
"cir-soft": "text-cir-foreground",
|
|
114
114
|
ped: "text-ped-foreground-onfill",
|
|
115
|
-
"ped-soft": "text-
|
|
115
|
+
"ped-soft": "text-feedback-warning-foreground",
|
|
116
116
|
prev: "text-prev-foreground-onfill",
|
|
117
117
|
"prev-soft": "text-prev-foreground",
|
|
118
118
|
// White, not the design's onfill token: that one turns dark in dark mode, on a fill that stays navy.
|
|
119
119
|
freemium: "font-semibold text-white",
|
|
120
|
-
error: "text-
|
|
121
|
-
warning: "text-
|
|
120
|
+
error: "text-feedback-error-foreground",
|
|
121
|
+
warning: "text-feedback-warning-foreground",
|
|
122
122
|
neutral: "text-primary-foreground",
|
|
123
123
|
},
|
|
124
124
|
size: {
|
|
@@ -151,13 +151,13 @@ const badgeDotVariants = cva("rounded-circular", {
|
|
|
151
151
|
"go-soft": "bg-go-background-fill",
|
|
152
152
|
cir: "bg-cir-background-fill",
|
|
153
153
|
"cir-soft": "bg-cir-background-fill",
|
|
154
|
-
ped: "bg-
|
|
155
|
-
"ped-soft": "bg-
|
|
154
|
+
ped: "bg-feedback-warning-background-fill",
|
|
155
|
+
"ped-soft": "bg-feedback-warning-background-fill",
|
|
156
156
|
prev: "bg-prev-background-fill",
|
|
157
157
|
"prev-soft": "bg-prev-background-fill",
|
|
158
158
|
freemium: "bg-primary",
|
|
159
|
-
error: "bg-
|
|
160
|
-
warning: "bg-
|
|
159
|
+
error: "bg-feedback-error-background-fill",
|
|
160
|
+
warning: "bg-feedback-warning-background-fill",
|
|
161
161
|
neutral: "bg-gray-background-fill",
|
|
162
162
|
},
|
|
163
163
|
size: {
|
|
@@ -197,6 +197,8 @@ const FREEMIUM_GRADIENT: ViewStyle = {
|
|
|
197
197
|
|
|
198
198
|
const SHINE_DURATION_MS = 2000;
|
|
199
199
|
|
|
200
|
+
const SHINE_BAND_FRAME: ViewStyle = { position: "absolute", top: 0, bottom: 0 };
|
|
201
|
+
|
|
200
202
|
function BadgeShine() {
|
|
201
203
|
const progress = useSharedValue(0);
|
|
202
204
|
const width = useSharedValue(0);
|
|
@@ -234,10 +236,9 @@ function BadgeShine() {
|
|
|
234
236
|
className="absolute inset-0 overflow-hidden rounded-pill"
|
|
235
237
|
onLayout={handleLayout}
|
|
236
238
|
>
|
|
237
|
-
<Animated.View
|
|
238
|
-
className="
|
|
239
|
-
|
|
240
|
-
/>
|
|
239
|
+
<Animated.View style={[SHINE_BAND_FRAME, bandStyle]}>
|
|
240
|
+
<View className="flex-1 bg-white-24" />
|
|
241
|
+
</Animated.View>
|
|
241
242
|
</View>
|
|
242
243
|
);
|
|
243
244
|
}
|
|
@@ -91,23 +91,23 @@ const buttonVariants = cva(
|
|
|
91
91
|
"emphasis-basic":
|
|
92
92
|
"bg-transparent active:bg-secondary-background-soft-emphasis disabled:bg-transparent",
|
|
93
93
|
error:
|
|
94
|
-
"bg-
|
|
94
|
+
"bg-feedback-error-background-fill active:bg-feedback-error-background-fill-emphasis disabled:bg-gray-background-fill-muted",
|
|
95
95
|
"error-soft":
|
|
96
|
-
"bg-
|
|
96
|
+
"bg-feedback-error-background-soft active:bg-feedback-error-background-soft-emphasis disabled:bg-gray-background-soft-muted",
|
|
97
97
|
"error-basic":
|
|
98
|
-
"bg-transparent active:bg-
|
|
98
|
+
"bg-transparent active:bg-feedback-error-background-soft-emphasis disabled:bg-transparent",
|
|
99
99
|
warning:
|
|
100
|
-
"bg-
|
|
100
|
+
"bg-feedback-warning-background-fill active:bg-feedback-warning-background-fill-emphasis disabled:bg-gray-background-fill-muted",
|
|
101
101
|
"warning-soft":
|
|
102
|
-
"bg-
|
|
102
|
+
"bg-feedback-warning-background-soft active:bg-feedback-warning-background-soft-emphasis disabled:bg-gray-background-soft-muted",
|
|
103
103
|
"warning-basic":
|
|
104
|
-
"bg-transparent active:bg-
|
|
104
|
+
"bg-transparent active:bg-feedback-warning-background-soft-emphasis disabled:bg-transparent",
|
|
105
105
|
success:
|
|
106
|
-
"bg-
|
|
106
|
+
"bg-feedback-success-background-fill active:bg-feedback-success-background-fill-emphasis disabled:bg-gray-background-fill-muted",
|
|
107
107
|
"success-soft":
|
|
108
|
-
"bg-
|
|
108
|
+
"bg-feedback-success-background-soft active:bg-feedback-success-background-soft-emphasis disabled:bg-gray-background-soft-muted",
|
|
109
109
|
"success-basic":
|
|
110
|
-
"bg-transparent active:bg-
|
|
110
|
+
"bg-transparent active:bg-feedback-success-background-soft-emphasis disabled:bg-transparent",
|
|
111
111
|
outlined:
|
|
112
112
|
"border border-gray-stroke-muted bg-transparent active:bg-state-hover disabled:border-gray-stroke-muted",
|
|
113
113
|
gradient:
|
|
@@ -132,24 +132,24 @@ const buttonVariants = cva(
|
|
|
132
132
|
const buttonTextVariants = cva("font-semibold shrink-0", {
|
|
133
133
|
variants: {
|
|
134
134
|
variant: {
|
|
135
|
-
regular: "text-primary-foreground-onfill
|
|
136
|
-
"regular-soft": "text-primary-foreground
|
|
137
|
-
"regular-basic": "text-primary-foreground
|
|
138
|
-
emphasis: "text-secondary-foreground-onfill
|
|
139
|
-
"emphasis-soft": "text-secondary-foreground
|
|
140
|
-
"emphasis-basic": "text-secondary-foreground
|
|
141
|
-
error: "text-
|
|
142
|
-
"error-soft": "text-
|
|
143
|
-
"error-basic": "text-
|
|
144
|
-
warning: "text-
|
|
145
|
-
"warning-soft": "text-
|
|
146
|
-
"warning-basic": "text-
|
|
147
|
-
success: "text-
|
|
148
|
-
"success-soft": "text-
|
|
149
|
-
"success-basic": "text-
|
|
150
|
-
outlined: "text-foreground
|
|
151
|
-
gradient: "text-white
|
|
152
|
-
medbrain: "text-secondary
|
|
135
|
+
regular: "text-primary-foreground-onfill",
|
|
136
|
+
"regular-soft": "text-primary-foreground",
|
|
137
|
+
"regular-basic": "text-primary-foreground",
|
|
138
|
+
emphasis: "text-secondary-foreground-onfill",
|
|
139
|
+
"emphasis-soft": "text-secondary-foreground",
|
|
140
|
+
"emphasis-basic": "text-secondary-foreground",
|
|
141
|
+
error: "text-feedback-error-foreground-onfill",
|
|
142
|
+
"error-soft": "text-feedback-error-foreground",
|
|
143
|
+
"error-basic": "text-feedback-error-foreground",
|
|
144
|
+
warning: "text-feedback-warning-foreground-onfill",
|
|
145
|
+
"warning-soft": "text-feedback-warning-foreground",
|
|
146
|
+
"warning-basic": "text-feedback-warning-foreground",
|
|
147
|
+
success: "text-feedback-success-foreground-onfill",
|
|
148
|
+
"success-soft": "text-feedback-success-foreground",
|
|
149
|
+
"success-basic": "text-feedback-success-foreground",
|
|
150
|
+
outlined: "text-foreground",
|
|
151
|
+
gradient: "text-white",
|
|
152
|
+
medbrain: "text-secondary",
|
|
153
153
|
},
|
|
154
154
|
size: {
|
|
155
155
|
sm: "text-xs",
|
|
@@ -157,10 +157,39 @@ const buttonTextVariants = cva("font-semibold shrink-0", {
|
|
|
157
157
|
lg: "text-md",
|
|
158
158
|
xl: "text-lg",
|
|
159
159
|
},
|
|
160
|
+
disabled: {
|
|
161
|
+
true: "",
|
|
162
|
+
false: "",
|
|
163
|
+
},
|
|
160
164
|
},
|
|
165
|
+
compoundVariants: [
|
|
166
|
+
{
|
|
167
|
+
variant: ["regular", "emphasis", "error", "warning", "success", "gradient", "medbrain"],
|
|
168
|
+
disabled: true,
|
|
169
|
+
className: "text-gray-foreground-onfill",
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
variant: [
|
|
173
|
+
"regular-soft",
|
|
174
|
+
"regular-basic",
|
|
175
|
+
"emphasis-soft",
|
|
176
|
+
"emphasis-basic",
|
|
177
|
+
"error-soft",
|
|
178
|
+
"error-basic",
|
|
179
|
+
"warning-soft",
|
|
180
|
+
"warning-basic",
|
|
181
|
+
"success-soft",
|
|
182
|
+
"success-basic",
|
|
183
|
+
"outlined",
|
|
184
|
+
],
|
|
185
|
+
disabled: true,
|
|
186
|
+
className: "text-gray-foreground-muted",
|
|
187
|
+
},
|
|
188
|
+
],
|
|
161
189
|
defaultVariants: {
|
|
162
190
|
variant: "regular",
|
|
163
191
|
size: "md",
|
|
192
|
+
disabled: false,
|
|
164
193
|
},
|
|
165
194
|
});
|
|
166
195
|
|
|
@@ -185,6 +214,10 @@ function Button({
|
|
|
185
214
|
const resolvedSize = size ?? "md";
|
|
186
215
|
const resolvedVariant = variant ?? "regular";
|
|
187
216
|
const isIconOnly = !children && !alert && (!!iconLeft || !!iconRight);
|
|
217
|
+
const isDisabled = !!disabled || loading;
|
|
218
|
+
const textClassName = cn(
|
|
219
|
+
buttonTextVariants({ variant: resolvedVariant, size, disabled: isDisabled })
|
|
220
|
+
);
|
|
188
221
|
|
|
189
222
|
return (
|
|
190
223
|
<View style={[{ position: "relative" }, containerStyle]}>
|
|
@@ -197,9 +230,9 @@ function Button({
|
|
|
197
230
|
)}
|
|
198
231
|
|
|
199
232
|
<Pressable
|
|
200
|
-
disabled={
|
|
233
|
+
disabled={isDisabled}
|
|
201
234
|
accessibilityRole="button"
|
|
202
|
-
accessibilityState={{ disabled:
|
|
235
|
+
accessibilityState={{ disabled: isDisabled, busy: loading }}
|
|
203
236
|
className={cn(
|
|
204
237
|
buttonVariants({ variant, size }),
|
|
205
238
|
isIconOnly && ICON_ONLY_SIZES[resolvedSize],
|
|
@@ -218,7 +251,7 @@ function Button({
|
|
|
218
251
|
<View className="opacity-0 flex-row items-center gap-2">
|
|
219
252
|
{iconLeft}
|
|
220
253
|
{children != null && (
|
|
221
|
-
<Text className={
|
|
254
|
+
<Text className={textClassName}>
|
|
222
255
|
{children}
|
|
223
256
|
</Text>
|
|
224
257
|
)}
|
|
@@ -242,7 +275,7 @@ function Button({
|
|
|
242
275
|
iconLeft
|
|
243
276
|
)}
|
|
244
277
|
{children != null && (
|
|
245
|
-
<Text className={
|
|
278
|
+
<Text className={textClassName}>
|
|
246
279
|
{children}
|
|
247
280
|
</Text>
|
|
248
281
|
)}
|
|
@@ -54,6 +54,11 @@ interface CardNewsAuthorProps extends Omit<ViewProps, "role"> {
|
|
|
54
54
|
src?: string;
|
|
55
55
|
alt?: string;
|
|
56
56
|
name?: string;
|
|
57
|
+
jobTitle?: string;
|
|
58
|
+
/**
|
|
59
|
+
* @deprecated Use `jobTitle` para o cargo. Sem `jobTitle`, `role` ainda é
|
|
60
|
+
* exibido como cargo; com `jobTitle`, vira o papel de acessibilidade da View.
|
|
61
|
+
*/
|
|
57
62
|
role?: string;
|
|
58
63
|
children?: ReactNode;
|
|
59
64
|
}
|
|
@@ -177,8 +182,8 @@ function CardNewsImage({
|
|
|
177
182
|
}: CardNewsImageProps) {
|
|
178
183
|
const { orientation } = useContext(CardNewsContext);
|
|
179
184
|
const { width } = useWindowDimensions();
|
|
180
|
-
const [
|
|
181
|
-
const showImage = !!src &&
|
|
185
|
+
const [failedSrc, setFailedSrc] = useState<string>();
|
|
186
|
+
const showImage = !!src && failedSrc !== src;
|
|
182
187
|
const showHorizontalImage =
|
|
183
188
|
orientation !== "horizontal" || width >= HORIZONTAL_IMAGE_MIN_WIDTH;
|
|
184
189
|
|
|
@@ -206,11 +211,11 @@ function CardNewsImage({
|
|
|
206
211
|
{...imageProps}
|
|
207
212
|
onError={(event) => {
|
|
208
213
|
imageProps?.onError?.(event);
|
|
209
|
-
|
|
214
|
+
setFailedSrc(src);
|
|
210
215
|
}}
|
|
211
216
|
/>
|
|
212
217
|
) : (
|
|
213
|
-
children ?? <FallbackImage className="absolute inset-0" />
|
|
218
|
+
children ?? <FallbackImage className="absolute inset-0" label={alt} />
|
|
214
219
|
)}
|
|
215
220
|
</View>
|
|
216
221
|
);
|
|
@@ -310,12 +315,18 @@ function CardNewsAuthor({
|
|
|
310
315
|
src,
|
|
311
316
|
alt,
|
|
312
317
|
name,
|
|
318
|
+
jobTitle,
|
|
313
319
|
role,
|
|
314
320
|
children,
|
|
315
321
|
...props
|
|
316
322
|
}: CardNewsAuthorProps) {
|
|
323
|
+
const title = jobTitle ?? role;
|
|
324
|
+
const accessibilityRole =
|
|
325
|
+
jobTitle === undefined ? undefined : (role as ViewProps["role"]);
|
|
326
|
+
|
|
317
327
|
return (
|
|
318
328
|
<View
|
|
329
|
+
role={accessibilityRole}
|
|
319
330
|
className={cn("flex-row items-center gap-2", className)}
|
|
320
331
|
{...props}
|
|
321
332
|
>
|
|
@@ -328,9 +339,9 @@ function CardNewsAuthor({
|
|
|
328
339
|
</AvatarFallback>
|
|
329
340
|
</Avatar>
|
|
330
341
|
<View className="flex flex-col gap-0.5">
|
|
331
|
-
{
|
|
342
|
+
{title ? (
|
|
332
343
|
<Text className="text-xs font-medium leading-xs text-secondary-foreground">
|
|
333
|
-
{
|
|
344
|
+
{title}
|
|
334
345
|
</Text>
|
|
335
346
|
) : null}
|
|
336
347
|
{name ? (
|