File tree Expand file tree Collapse file tree 4 files changed +80
-139
lines changed Expand file tree Collapse file tree 4 files changed +80
-139
lines changed Original file line number Diff line number Diff line change 1+ from typing import Annotated , Literal
2+
3+ from pydantic import StringConstraints
4+
5+ VendorIconName = Annotated [str , StringConstraints (pattern = r"^vendor:" )]
6+
7+ IconName = (
8+ Literal [
9+ "agent" ,
10+ "analytics" ,
11+ "atom" ,
12+ "batch" ,
13+ "bolt" ,
14+ "book-open" ,
15+ "book-closed" ,
16+ "book-clock" ,
17+ "bug" ,
18+ "calendar" ,
19+ "chart" ,
20+ "check" ,
21+ "check-circle" ,
22+ "check-circle-filled" ,
23+ "chevron-left" ,
24+ "chevron-right" ,
25+ "circle-question" ,
26+ "compass" ,
27+ "confetti" ,
28+ "cube" ,
29+ "desktop" ,
30+ "document" ,
31+ "dot" ,
32+ "dots-horizontal" ,
33+ "dots-vertical" ,
34+ "empty-circle" ,
35+ "external-link" ,
36+ "globe" ,
37+ "keys" ,
38+ "lab" ,
39+ "images" ,
40+ "info" ,
41+ "lifesaver" ,
42+ "lightbulb" ,
43+ "mail" ,
44+ "map-pin" ,
45+ "maps" ,
46+ "mobile" ,
47+ "name" ,
48+ "notebook" ,
49+ "notebook-pencil" ,
50+ "page-blank" ,
51+ "phone" ,
52+ "play" ,
53+ "plus" ,
54+ "profile" ,
55+ "profile-card" ,
56+ "reload" ,
57+ "star" ,
58+ "star-filled" ,
59+ "search" ,
60+ "sparkle" ,
61+ "sparkle-double" ,
62+ "square-code" ,
63+ "square-image" ,
64+ "square-text" ,
65+ "suitcase" ,
66+ "settings-slider" ,
67+ "user" ,
68+ "wreath" ,
69+ "write" ,
70+ "write-alt" ,
71+ "write-alt2" ,
72+ ]
73+ | VendorIconName
74+ )
Original file line number Diff line number Diff line change 33from datetime import datetime
44from typing import Any , Generic , Literal
55
6- from pydantic import AnyUrl , BaseModel , Field , StringConstraints
6+ from pydantic import AnyUrl , BaseModel , Field
77from typing_extensions import Annotated , TypeIs , TypeVar
88
99from chatkit .errors import ErrorCode
1010
1111from .actions import Action
12+ from .icons import IconName
1213from .widgets import WidgetComponent , WidgetRoot
1314
1415T = TypeVar ("T" )
@@ -828,74 +829,3 @@ class EntitySource(SourceBase):
828829
829830FeedbackKind = Literal ["positive" , "negative" ]
830831"""Literal type for feedback sentiment."""
831-
832- VendorIconName = Annotated [str , StringConstraints (pattern = r"^vendor:" )]
833-
834- IconName = (
835- Literal [
836- "agent" ,
837- "analytics" ,
838- "atom" ,
839- "batch" ,
840- "bolt" ,
841- "book-open" ,
842- "book-closed" ,
843- "book-clock" ,
844- "bug" ,
845- "calendar" ,
846- "chart" ,
847- "check" ,
848- "check-circle" ,
849- "check-circle-filled" ,
850- "chevron-left" ,
851- "chevron-right" ,
852- "circle-question" ,
853- "compass" ,
854- "confetti" ,
855- "cube" ,
856- "desktop" ,
857- "document" ,
858- "dot" ,
859- "dots-horizontal" ,
860- "dots-vertical" ,
861- "empty-circle" ,
862- "external-link" ,
863- "globe" ,
864- "keys" ,
865- "lab" ,
866- "images" ,
867- "info" ,
868- "lifesaver" ,
869- "lightbulb" ,
870- "mail" ,
871- "map-pin" ,
872- "maps" ,
873- "mobile" ,
874- "name" ,
875- "notebook" ,
876- "notebook-pencil" ,
877- "page-blank" ,
878- "phone" ,
879- "play" ,
880- "plus" ,
881- "profile" ,
882- "profile-card" ,
883- "reload" ,
884- "star" ,
885- "star-filled" ,
886- "search" ,
887- "sparkle" ,
888- "sparkle-double" ,
889- "square-code" ,
890- "square-image" ,
891- "square-text" ,
892- "suitcase" ,
893- "settings-slider" ,
894- "user" ,
895- "wreath" ,
896- "write" ,
897- "write-alt" ,
898- "write-alt2" ,
899- ]
900- | VendorIconName
901- )
Original file line number Diff line number Diff line change 1414)
1515from typing_extensions import NotRequired , TypedDict
1616
17- from chatkit .actions import ActionConfig
17+ from .actions import ActionConfig
18+ from .icons import IconName
1819
1920
2021class ThemeColor (TypedDict ):
@@ -1039,69 +1040,5 @@ class LineSeries(BaseModel):
10391040"""Union of all renderable widget components."""
10401041
10411042
1042- WidgetIcon = Literal [
1043- "agent" ,
1044- "analytics" ,
1045- "atom" ,
1046- "batch" ,
1047- "bolt" ,
1048- "book-open" ,
1049- "book-clock" ,
1050- "book-closed" ,
1051- "bug" ,
1052- "calendar" ,
1053- "chart" ,
1054- "check" ,
1055- "check-circle" ,
1056- "check-circle-filled" ,
1057- "chevron-left" ,
1058- "chevron-right" ,
1059- "circle-question" ,
1060- "compass" ,
1061- "confetti" ,
1062- "cube" ,
1063- "desktop" ,
1064- "document" ,
1065- "dot" ,
1066- "dots-horizontal" ,
1067- "dots-vertical" ,
1068- "empty-circle" ,
1069- "external-link" ,
1070- "globe" ,
1071- "keys" ,
1072- "lab" ,
1073- "images" ,
1074- "info" ,
1075- "lifesaver" ,
1076- "lightbulb" ,
1077- "mail" ,
1078- "map-pin" ,
1079- "maps" ,
1080- "mobile" ,
1081- "name" ,
1082- "notebook" ,
1083- "notebook-pencil" ,
1084- "page-blank" ,
1085- "phone" ,
1086- "play" ,
1087- "plus" ,
1088- "profile" ,
1089- "profile-card" ,
1090- "reload" ,
1091- "star" ,
1092- "star-filled" ,
1093- "search" ,
1094- "sparkle" ,
1095- "sparkle-double" ,
1096- "square-code" ,
1097- "square-image" ,
1098- "square-text" ,
1099- "suitcase" ,
1100- "settings-slider" ,
1101- "user" ,
1102- "wreath" ,
1103- "write" ,
1104- "write-alt" ,
1105- "write-alt2" ,
1106- ]
1043+ WidgetIcon = IconName
11071044"""Icon names accepted by widgets that render icons."""
Original file line number Diff line number Diff line change 11import pytest
22from pydantic import TypeAdapter , ValidationError
33
4- from chatkit .types import IconName
4+ from chatkit .icons import IconName
55
66
77def test_vendor_icon_names_are_valid ():
You can’t perform that action at this time.
0 commit comments