@medway-ui/native 1.9.2 → 1.10.1
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 +181 -80
- 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/src/components/Tag.tsx
CHANGED
|
@@ -14,51 +14,59 @@ const tagVariants = cva(
|
|
|
14
14
|
"flex-row items-center justify-center rounded-md px-2 py-1 gap-1.5 max-h-6 overflow-hidden shrink-0",
|
|
15
15
|
{
|
|
16
16
|
variants: {
|
|
17
|
+
size: {
|
|
18
|
+
sm: "",
|
|
19
|
+
md: "px-2.5 py-1.5 gap-2 max-h-8",
|
|
20
|
+
},
|
|
17
21
|
variant: {
|
|
18
22
|
regular: "bg-primary-background-fill",
|
|
19
23
|
"regular-soft": "bg-primary-background-soft",
|
|
20
|
-
"regular-basic": "bg-transparent",
|
|
24
|
+
"regular-basic": "bg-transparent p-0",
|
|
21
25
|
emphasis: "bg-secondary-background-fill",
|
|
22
26
|
"emphasis-soft": "bg-secondary-background-soft",
|
|
23
|
-
"emphasis-basic": "bg-transparent",
|
|
27
|
+
"emphasis-basic": "bg-transparent p-0",
|
|
24
28
|
gray: "bg-gray-background-fill",
|
|
25
29
|
"gray-soft": "bg-gray-background-soft",
|
|
26
|
-
"gray-basic": "bg-transparent",
|
|
27
|
-
success: "bg-
|
|
28
|
-
"success-soft": "bg-
|
|
29
|
-
"success-basic": "bg-transparent",
|
|
30
|
-
error: "bg-
|
|
31
|
-
"error-soft": "bg-
|
|
32
|
-
"error-basic": "bg-transparent",
|
|
33
|
-
warning: "bg-
|
|
34
|
-
"warning-soft": "bg-
|
|
35
|
-
"warning-basic": "bg-transparent",
|
|
30
|
+
"gray-basic": "bg-transparent p-0",
|
|
31
|
+
success: "bg-feedback-success-background-fill",
|
|
32
|
+
"success-soft": "bg-feedback-success-background-soft",
|
|
33
|
+
"success-basic": "bg-transparent p-0",
|
|
34
|
+
error: "bg-feedback-error-background-fill",
|
|
35
|
+
"error-soft": "bg-feedback-error-background-soft",
|
|
36
|
+
"error-basic": "bg-transparent p-0",
|
|
37
|
+
warning: "bg-feedback-warning-background-fill",
|
|
38
|
+
"warning-soft": "bg-feedback-warning-background-soft",
|
|
39
|
+
"warning-basic": "bg-transparent p-0",
|
|
36
40
|
cm: "bg-cm-background-fill",
|
|
37
41
|
"cm-soft": "bg-cm-background-soft",
|
|
38
|
-
"cm-basic": "bg-transparent",
|
|
42
|
+
"cm-basic": "bg-transparent p-0",
|
|
39
43
|
go: "bg-go-background-fill",
|
|
40
44
|
"go-soft": "bg-go-background-soft",
|
|
41
|
-
"go-basic": "bg-transparent",
|
|
45
|
+
"go-basic": "bg-transparent p-0",
|
|
42
46
|
cir: "bg-cir-background-fill",
|
|
43
47
|
"cir-soft": "bg-cir-background-soft",
|
|
44
|
-
"cir-basic": "bg-transparent",
|
|
48
|
+
"cir-basic": "bg-transparent p-0",
|
|
45
49
|
ped: "bg-ped-background-fill",
|
|
46
50
|
"ped-soft": "bg-ped-background-soft",
|
|
47
|
-
"ped-basic": "bg-transparent",
|
|
51
|
+
"ped-basic": "bg-transparent p-0",
|
|
48
52
|
prev: "bg-prev-background-fill",
|
|
49
53
|
"prev-soft": "bg-prev-background-soft",
|
|
50
|
-
"prev-basic": "bg-transparent",
|
|
54
|
+
"prev-basic": "bg-transparent p-0",
|
|
51
55
|
ia: "bg-secondary-background-fill",
|
|
52
56
|
"ia-soft": "bg-secondary-background-soft",
|
|
53
|
-
"ia-basic": "bg-transparent",
|
|
57
|
+
"ia-basic": "bg-transparent p-0",
|
|
54
58
|
},
|
|
55
59
|
},
|
|
56
|
-
defaultVariants: { variant: "regular" },
|
|
60
|
+
defaultVariants: { size: "sm", variant: "regular" },
|
|
57
61
|
}
|
|
58
62
|
);
|
|
59
63
|
|
|
60
64
|
const tagTextVariants = cva("text-xs font-semibold", {
|
|
61
65
|
variants: {
|
|
66
|
+
size: {
|
|
67
|
+
sm: "",
|
|
68
|
+
md: "text-sm leading-sm",
|
|
69
|
+
},
|
|
62
70
|
variant: {
|
|
63
71
|
regular: "text-primary-foreground-onfill",
|
|
64
72
|
"regular-soft": "text-primary-foreground",
|
|
@@ -69,15 +77,15 @@ const tagTextVariants = cva("text-xs font-semibold", {
|
|
|
69
77
|
gray: "text-gray-foreground-onfill",
|
|
70
78
|
"gray-soft": "text-gray-foreground",
|
|
71
79
|
"gray-basic": "text-gray-foreground",
|
|
72
|
-
success: "text-
|
|
73
|
-
"success-soft": "text-
|
|
74
|
-
"success-basic": "text-
|
|
75
|
-
error: "text-
|
|
76
|
-
"error-soft": "text-
|
|
77
|
-
"error-basic": "text-
|
|
78
|
-
warning: "text-
|
|
79
|
-
"warning-soft": "text-
|
|
80
|
-
"warning-basic": "text-
|
|
80
|
+
success: "text-feedback-success-foreground-onfill",
|
|
81
|
+
"success-soft": "text-feedback-success-foreground",
|
|
82
|
+
"success-basic": "text-feedback-success-foreground",
|
|
83
|
+
error: "text-feedback-error-foreground-onfill",
|
|
84
|
+
"error-soft": "text-feedback-error-foreground",
|
|
85
|
+
"error-basic": "text-feedback-error-foreground",
|
|
86
|
+
warning: "text-feedback-warning-foreground-onfill",
|
|
87
|
+
"warning-soft": "text-feedback-warning-foreground",
|
|
88
|
+
"warning-basic": "text-feedback-warning-foreground",
|
|
81
89
|
cm: "text-cm-foreground-onfill",
|
|
82
90
|
"cm-soft": "text-cm-foreground",
|
|
83
91
|
"cm-basic": "text-cm-foreground",
|
|
@@ -98,18 +106,31 @@ const tagTextVariants = cva("text-xs font-semibold", {
|
|
|
98
106
|
"ia-basic": "text-secondary-foreground",
|
|
99
107
|
},
|
|
100
108
|
},
|
|
101
|
-
defaultVariants: { variant: "regular" },
|
|
109
|
+
defaultVariants: { size: "sm", variant: "regular" },
|
|
102
110
|
});
|
|
103
111
|
|
|
104
|
-
|
|
105
|
-
|
|
112
|
+
type TagSize = NonNullable<VariantProps<typeof tagVariants>["size"]>;
|
|
113
|
+
|
|
114
|
+
const TAG_ICON_SIZE_CLASS_NAME: Record<TagSize, string> = {
|
|
115
|
+
sm: "w-3.5 h-3.5",
|
|
116
|
+
md: "w-5 h-5",
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
function TagIcon({ icon, size }: { icon?: ReactNode; size: TagSize }) {
|
|
120
|
+
return (
|
|
121
|
+
<View className={cn(TAG_ICON_SIZE_CLASS_NAME[size], "items-center justify-center")}>
|
|
122
|
+
{icon}
|
|
123
|
+
</View>
|
|
124
|
+
);
|
|
106
125
|
}
|
|
107
126
|
|
|
108
|
-
function Tag({ className, variant, icon, children, ...props }: TagProps) {
|
|
127
|
+
function Tag({ className, variant, size, icon, children, ...props }: TagProps) {
|
|
109
128
|
return (
|
|
110
|
-
<View className={cn(tagVariants({ variant }), className)} {...props}>
|
|
111
|
-
{icon && <TagIcon icon={icon} />}
|
|
112
|
-
<Text className={cn(tagTextVariants({ variant }))}>
|
|
129
|
+
<View className={cn(tagVariants({ size, variant }), className)} {...props}>
|
|
130
|
+
{icon && <TagIcon icon={icon} size={size ?? "sm"} />}
|
|
131
|
+
<Text numberOfLines={1} className={cn(tagTextVariants({ size, variant }))}>
|
|
132
|
+
{children}
|
|
133
|
+
</Text>
|
|
113
134
|
</View>
|
|
114
135
|
);
|
|
115
136
|
}
|
package/src/components/Toast.tsx
CHANGED
|
@@ -109,7 +109,6 @@ const GRADIENT_STYLES: Record<ToastGradientVariant, GradientStyle> = {
|
|
|
109
109
|
underlayClassName: "bg-white",
|
|
110
110
|
},
|
|
111
111
|
"gold-gradient": {
|
|
112
|
-
// Literal hex from Figma replaced by podium tokens on web (#72)
|
|
113
112
|
colorTokens: ["gold", "gold-lighten-6"],
|
|
114
113
|
locations: [0.29, 1],
|
|
115
114
|
angleDeg: 124,
|
|
@@ -318,9 +317,10 @@ function ToastClose({
|
|
|
318
317
|
);
|
|
319
318
|
}
|
|
320
319
|
|
|
320
|
+
const LinearGradient = loadLinearGradient();
|
|
321
|
+
|
|
321
322
|
function ToastGradientFill({ variant }: { variant: ToastGradientVariant }) {
|
|
322
323
|
const style = GRADIENT_STYLES[variant];
|
|
323
|
-
const LinearGradient = loadLinearGradient();
|
|
324
324
|
const borderRadius = useRadiusLg();
|
|
325
325
|
const color0 = useThemeColor(style.colorTokens[0]);
|
|
326
326
|
const color1 = useThemeColor(style.colorTokens[1]);
|
|
@@ -392,8 +392,8 @@ function ToastItem({
|
|
|
392
392
|
const [visible, setVisible] = useState(open);
|
|
393
393
|
const onOpenChangeRef = useRef(onOpenChange);
|
|
394
394
|
onOpenChangeRef.current = onOpenChange;
|
|
395
|
-
const translateY = useSharedValue(
|
|
396
|
-
const opacity = useSharedValue(
|
|
395
|
+
const translateY = useSharedValue(-80);
|
|
396
|
+
const opacity = useSharedValue(0);
|
|
397
397
|
const gradient = isGradientVariant(variant);
|
|
398
398
|
|
|
399
399
|
const animatedStyle = useAnimatedStyle(() => ({
|
|
@@ -433,7 +433,11 @@ function ToastItem({
|
|
|
433
433
|
return (
|
|
434
434
|
<Animated.View style={animatedStyle}>
|
|
435
435
|
<ToastContext.Provider value={{ variant, onOpenChange }}>
|
|
436
|
-
<View
|
|
436
|
+
<View
|
|
437
|
+
accessibilityLiveRegion="polite"
|
|
438
|
+
className={containerClassName}
|
|
439
|
+
{...props}
|
|
440
|
+
>
|
|
437
441
|
{gradient ? <ToastGradientFill variant={variant} /> : null}
|
|
438
442
|
{showIcon && resolvedIcon}
|
|
439
443
|
<View className="min-w-0 flex-1 flex-row items-center justify-between gap-4">
|
|
@@ -474,7 +478,7 @@ function ToastAction({
|
|
|
474
478
|
className,
|
|
475
479
|
variant: variantProp,
|
|
476
480
|
size = "sm",
|
|
477
|
-
altText
|
|
481
|
+
altText,
|
|
478
482
|
children,
|
|
479
483
|
loading,
|
|
480
484
|
iconLeft,
|