@ponchia/ui 0.6.3 → 0.6.5
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/CHANGELOG.md +53 -0
- package/README.md +7 -7
- package/behaviors/glyph.d.ts +7 -0
- package/behaviors/glyph.d.ts.map +1 -1
- package/behaviors/glyph.js +58 -4
- package/behaviors/index.d.ts +2 -0
- package/behaviors/index.d.ts.map +1 -1
- package/behaviors/index.js +2 -0
- package/behaviors/sources.d.ts +28 -0
- package/behaviors/sources.d.ts.map +1 -0
- package/behaviors/sources.js +158 -0
- package/classes/classes.json +210 -4
- package/classes/index.d.ts +75 -1
- package/classes/index.js +95 -1
- package/css/dots.css +210 -3
- package/css/report.css +359 -7
- package/css/skins.css +9 -0
- package/css/sources.css +18 -0
- package/css/spark.css +14 -0
- package/css/table.css +7 -1
- package/css/tokens.css +8 -1
- package/dist/bronto.css +1 -1
- package/dist/css/dots.css +1 -1
- package/dist/css/report.css +1 -1
- package/dist/css/skins.css +1 -1
- package/dist/css/sources.css +1 -1
- package/dist/css/spark.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/tokens.css +1 -1
- package/docs/dots.md +146 -0
- package/docs/frontier-primitives.md +262 -0
- package/docs/glyphs.md +114 -0
- package/docs/package-contract.md +263 -0
- package/docs/reference.md +115 -1
- package/docs/reporting.md +296 -16
- package/docs/sources.md +32 -0
- package/docs/stability.md +6 -3
- package/glyphs/glyphs.d.ts +61 -0
- package/glyphs/glyphs.js +593 -30
- package/llms.txt +79 -25
- package/package.json +13 -3
- package/qwik/index.d.ts +1 -0
- package/qwik/index.d.ts.map +1 -1
- package/qwik/index.js +5 -0
- package/react/index.d.ts +1 -0
- package/react/index.d.ts.map +1 -1
- package/react/index.js +3 -0
- package/solid/index.d.ts +2 -0
- package/solid/index.d.ts.map +1 -1
- package/solid/index.js +3 -0
- package/tokens/skins.js +22 -9
package/glyphs/glyphs.js
CHANGED
|
@@ -22,8 +22,12 @@
|
|
|
22
22
|
export const GLYPH_SIZE = 16;
|
|
23
23
|
|
|
24
24
|
// Raw bitmaps. Each is GLYPH_SIZE rows of GLYPH_SIZE chars over [.#*]:
|
|
25
|
-
// `.` off · `#` hot · `*` accent.
|
|
26
|
-
//
|
|
25
|
+
// `.` off · `#` hot · `*` accent. The curated two-tone glyphs (`spark`,
|
|
26
|
+
// `warning`, `info`) lift one feature onto the accent colour; every other
|
|
27
|
+
// glyph is monotone. test/glyphs.test.mjs pins that exact set.
|
|
28
|
+
//
|
|
29
|
+
// `digit-0`..`digit-9` + `colon`/`comma`/`period`/`percent` are the readout
|
|
30
|
+
// face — composed into multi-digit numerics by renderReadout().
|
|
27
31
|
const RAW = {
|
|
28
32
|
circle: [
|
|
29
33
|
'................',
|
|
@@ -387,21 +391,21 @@ const RAW = {
|
|
|
387
391
|
],
|
|
388
392
|
'eye-off': [
|
|
389
393
|
'................',
|
|
390
|
-
'
|
|
391
|
-
'
|
|
392
|
-
'
|
|
393
|
-
'
|
|
394
|
-
'
|
|
395
|
-
'
|
|
396
|
-
'
|
|
397
|
-
'
|
|
398
|
-
'
|
|
399
|
-
'
|
|
400
|
-
'
|
|
401
|
-
'
|
|
402
|
-
'
|
|
403
|
-
'
|
|
404
|
-
'
|
|
394
|
+
'.#..............',
|
|
395
|
+
'.##.............',
|
|
396
|
+
'..##....###.....',
|
|
397
|
+
'...##.##...##...',
|
|
398
|
+
'..#.###.....##..',
|
|
399
|
+
'.##...##.##..##.',
|
|
400
|
+
'##.....####...#.',
|
|
401
|
+
'.##...##.##..##.',
|
|
402
|
+
'..##.##....###..',
|
|
403
|
+
'...##...###.##..',
|
|
404
|
+
'....##.....##...',
|
|
405
|
+
'.....##...##....',
|
|
406
|
+
'......##.##.....',
|
|
407
|
+
'.......###......',
|
|
408
|
+
'........##......',
|
|
405
409
|
],
|
|
406
410
|
file: [
|
|
407
411
|
'................',
|
|
@@ -513,10 +517,10 @@ const RAW = {
|
|
|
513
517
|
],
|
|
514
518
|
info: [
|
|
515
519
|
'................',
|
|
516
|
-
'
|
|
517
|
-
'
|
|
518
|
-
'
|
|
519
|
-
'
|
|
520
|
+
'......****......',
|
|
521
|
+
'.....******.....',
|
|
522
|
+
'.....******.....',
|
|
523
|
+
'......****......',
|
|
520
524
|
'................',
|
|
521
525
|
'....######......',
|
|
522
526
|
'......####......',
|
|
@@ -874,19 +878,433 @@ const RAW = {
|
|
|
874
878
|
warning: [
|
|
875
879
|
'................',
|
|
876
880
|
'.......##.......',
|
|
877
|
-
'.......##.......',
|
|
878
881
|
'......####......',
|
|
879
882
|
'......####......',
|
|
883
|
+
'.....##**##.....',
|
|
884
|
+
'.....##**##.....',
|
|
885
|
+
'....###**###....',
|
|
886
|
+
'....###**###....',
|
|
887
|
+
'...####**####...',
|
|
888
|
+
'...####**####...',
|
|
889
|
+
'..#####**#####..',
|
|
890
|
+
'..#####..#####..',
|
|
891
|
+
'.######**######.',
|
|
892
|
+
'.##############.',
|
|
893
|
+
'.##############.',
|
|
894
|
+
'................',
|
|
895
|
+
],
|
|
896
|
+
'bar-chart': [
|
|
897
|
+
'................',
|
|
898
|
+
'................',
|
|
899
|
+
'............##..',
|
|
900
|
+
'............##..',
|
|
901
|
+
'.......##...##..',
|
|
902
|
+
'.......##...##..',
|
|
903
|
+
'.......##...##..',
|
|
904
|
+
'..##...##...##..',
|
|
905
|
+
'..##...##...##..',
|
|
906
|
+
'..##...##...##..',
|
|
907
|
+
'..##...##...##..',
|
|
908
|
+
'..##...##...##..',
|
|
909
|
+
'..############..',
|
|
910
|
+
'..############..',
|
|
911
|
+
'................',
|
|
912
|
+
'................',
|
|
913
|
+
],
|
|
914
|
+
calendar: [
|
|
915
|
+
'................',
|
|
916
|
+
'...#......#.....',
|
|
917
|
+
'...#......#.....',
|
|
918
|
+
'..############..',
|
|
919
|
+
'..############..',
|
|
920
|
+
'..#..........#..',
|
|
921
|
+
'..#.##.##.##.#..',
|
|
922
|
+
'..#..........#..',
|
|
923
|
+
'..#.##.##.##.#..',
|
|
924
|
+
'..#..........#..',
|
|
925
|
+
'..#.##.##....#..',
|
|
926
|
+
'..############..',
|
|
927
|
+
'................',
|
|
928
|
+
'................',
|
|
929
|
+
'................',
|
|
930
|
+
'................',
|
|
931
|
+
],
|
|
932
|
+
colon: [
|
|
933
|
+
'................',
|
|
934
|
+
'................',
|
|
935
|
+
'................',
|
|
936
|
+
'................',
|
|
937
|
+
'......####......',
|
|
938
|
+
'......####......',
|
|
939
|
+
'......####......',
|
|
940
|
+
'................',
|
|
941
|
+
'................',
|
|
942
|
+
'......####......',
|
|
943
|
+
'......####......',
|
|
944
|
+
'......####......',
|
|
945
|
+
'................',
|
|
946
|
+
'................',
|
|
947
|
+
'................',
|
|
948
|
+
'................',
|
|
949
|
+
],
|
|
950
|
+
comma: [
|
|
951
|
+
'................',
|
|
952
|
+
'................',
|
|
953
|
+
'................',
|
|
954
|
+
'................',
|
|
955
|
+
'................',
|
|
956
|
+
'................',
|
|
957
|
+
'................',
|
|
958
|
+
'................',
|
|
959
|
+
'................',
|
|
960
|
+
'................',
|
|
961
|
+
'......####......',
|
|
962
|
+
'......####......',
|
|
963
|
+
'......####......',
|
|
964
|
+
'.......###......',
|
|
965
|
+
'......###.......',
|
|
966
|
+
'.....##.........',
|
|
967
|
+
],
|
|
968
|
+
copy: [
|
|
969
|
+
'................',
|
|
970
|
+
'......#######...',
|
|
971
|
+
'......#.....#...',
|
|
972
|
+
'...#######..#...',
|
|
973
|
+
'...#.....#..#...',
|
|
974
|
+
'...#.....#..#...',
|
|
975
|
+
'...#.....####...',
|
|
976
|
+
'...#.....#......',
|
|
977
|
+
'...#.....#......',
|
|
978
|
+
'...#######......',
|
|
979
|
+
'................',
|
|
980
|
+
'................',
|
|
981
|
+
'................',
|
|
982
|
+
'................',
|
|
983
|
+
'................',
|
|
984
|
+
'................',
|
|
985
|
+
],
|
|
986
|
+
database: [
|
|
987
|
+
'................',
|
|
988
|
+
'...########.....',
|
|
989
|
+
'..##########....',
|
|
990
|
+
'..#........#....',
|
|
991
|
+
'..##########....',
|
|
992
|
+
'...########.....',
|
|
993
|
+
'..#........#....',
|
|
994
|
+
'..##########....',
|
|
995
|
+
'...########.....',
|
|
996
|
+
'..#........#....',
|
|
997
|
+
'..##########....',
|
|
998
|
+
'...########.....',
|
|
999
|
+
'................',
|
|
1000
|
+
'................',
|
|
1001
|
+
'................',
|
|
1002
|
+
'................',
|
|
1003
|
+
],
|
|
1004
|
+
'digit-0': [
|
|
1005
|
+
'................',
|
|
1006
|
+
'.....######.....',
|
|
1007
|
+
'.....######.....',
|
|
1008
|
+
'...##......##...',
|
|
1009
|
+
'...##......##...',
|
|
1010
|
+
'...##....####...',
|
|
1011
|
+
'...##....####...',
|
|
1012
|
+
'...##..##..##...',
|
|
1013
|
+
'...##..##..##...',
|
|
1014
|
+
'...####....##...',
|
|
1015
|
+
'...####....##...',
|
|
1016
|
+
'...##......##...',
|
|
1017
|
+
'...##......##...',
|
|
1018
|
+
'.....######.....',
|
|
1019
|
+
'.....######.....',
|
|
1020
|
+
'................',
|
|
1021
|
+
],
|
|
1022
|
+
'digit-1': [
|
|
1023
|
+
'................',
|
|
1024
|
+
'.......##.......',
|
|
1025
|
+
'.......##.......',
|
|
1026
|
+
'.....####.......',
|
|
1027
|
+
'.....####.......',
|
|
1028
|
+
'.......##.......',
|
|
1029
|
+
'.......##.......',
|
|
1030
|
+
'.......##.......',
|
|
1031
|
+
'.......##.......',
|
|
1032
|
+
'.......##.......',
|
|
1033
|
+
'.......##.......',
|
|
1034
|
+
'.......##.......',
|
|
1035
|
+
'.......##.......',
|
|
1036
|
+
'.....######.....',
|
|
1037
|
+
'.....######.....',
|
|
1038
|
+
'................',
|
|
1039
|
+
],
|
|
1040
|
+
'digit-2': [
|
|
1041
|
+
'................',
|
|
1042
|
+
'.....######.....',
|
|
1043
|
+
'.....######.....',
|
|
1044
|
+
'...##......##...',
|
|
1045
|
+
'...##......##...',
|
|
1046
|
+
'...........##...',
|
|
1047
|
+
'...........##...',
|
|
1048
|
+
'.........##.....',
|
|
1049
|
+
'.........##.....',
|
|
1050
|
+
'.......##.......',
|
|
1051
|
+
'.......##.......',
|
|
1052
|
+
'.....##.........',
|
|
1053
|
+
'.....##.........',
|
|
1054
|
+
'...##########...',
|
|
1055
|
+
'...##########...',
|
|
1056
|
+
'................',
|
|
1057
|
+
],
|
|
1058
|
+
'digit-3': [
|
|
1059
|
+
'................',
|
|
1060
|
+
'...##########...',
|
|
1061
|
+
'...##########...',
|
|
1062
|
+
'.........##.....',
|
|
1063
|
+
'.........##.....',
|
|
1064
|
+
'.......##.......',
|
|
1065
|
+
'.......##.......',
|
|
1066
|
+
'.........##.....',
|
|
1067
|
+
'.........##.....',
|
|
1068
|
+
'...........##...',
|
|
1069
|
+
'...........##...',
|
|
1070
|
+
'...##......##...',
|
|
1071
|
+
'...##......##...',
|
|
1072
|
+
'.....######.....',
|
|
1073
|
+
'.....######.....',
|
|
1074
|
+
'................',
|
|
1075
|
+
],
|
|
1076
|
+
'digit-4': [
|
|
1077
|
+
'................',
|
|
1078
|
+
'.........##.....',
|
|
1079
|
+
'.........##.....',
|
|
1080
|
+
'.......####.....',
|
|
1081
|
+
'.......####.....',
|
|
880
1082
|
'.....##..##.....',
|
|
881
1083
|
'.....##..##.....',
|
|
882
|
-
'
|
|
883
|
-
'
|
|
884
|
-
'
|
|
885
|
-
'
|
|
886
|
-
'
|
|
887
|
-
'
|
|
888
|
-
'
|
|
889
|
-
'
|
|
1084
|
+
'...##....##.....',
|
|
1085
|
+
'...##....##.....',
|
|
1086
|
+
'...##########...',
|
|
1087
|
+
'...##########...',
|
|
1088
|
+
'.........##.....',
|
|
1089
|
+
'.........##.....',
|
|
1090
|
+
'.........##.....',
|
|
1091
|
+
'.........##.....',
|
|
1092
|
+
'................',
|
|
1093
|
+
],
|
|
1094
|
+
'digit-5': [
|
|
1095
|
+
'................',
|
|
1096
|
+
'...##########...',
|
|
1097
|
+
'...##########...',
|
|
1098
|
+
'...##...........',
|
|
1099
|
+
'...##...........',
|
|
1100
|
+
'...########.....',
|
|
1101
|
+
'...########.....',
|
|
1102
|
+
'...........##...',
|
|
1103
|
+
'...........##...',
|
|
1104
|
+
'...........##...',
|
|
1105
|
+
'...........##...',
|
|
1106
|
+
'...##......##...',
|
|
1107
|
+
'...##......##...',
|
|
1108
|
+
'.....######.....',
|
|
1109
|
+
'.....######.....',
|
|
1110
|
+
'................',
|
|
1111
|
+
],
|
|
1112
|
+
'digit-6': [
|
|
1113
|
+
'................',
|
|
1114
|
+
'.......####.....',
|
|
1115
|
+
'.......####.....',
|
|
1116
|
+
'.....##.........',
|
|
1117
|
+
'.....##.........',
|
|
1118
|
+
'...##...........',
|
|
1119
|
+
'...##...........',
|
|
1120
|
+
'...########.....',
|
|
1121
|
+
'...########.....',
|
|
1122
|
+
'...##......##...',
|
|
1123
|
+
'...##......##...',
|
|
1124
|
+
'...##......##...',
|
|
1125
|
+
'...##......##...',
|
|
1126
|
+
'.....######.....',
|
|
1127
|
+
'.....######.....',
|
|
1128
|
+
'................',
|
|
1129
|
+
],
|
|
1130
|
+
'digit-7': [
|
|
1131
|
+
'................',
|
|
1132
|
+
'...##########...',
|
|
1133
|
+
'...##########...',
|
|
1134
|
+
'...........##...',
|
|
1135
|
+
'...........##...',
|
|
1136
|
+
'.........##.....',
|
|
1137
|
+
'.........##.....',
|
|
1138
|
+
'.......##.......',
|
|
1139
|
+
'.......##.......',
|
|
1140
|
+
'.....##.........',
|
|
1141
|
+
'.....##.........',
|
|
1142
|
+
'.....##.........',
|
|
1143
|
+
'.....##.........',
|
|
1144
|
+
'.....##.........',
|
|
1145
|
+
'.....##.........',
|
|
1146
|
+
'................',
|
|
1147
|
+
],
|
|
1148
|
+
'digit-8': [
|
|
1149
|
+
'................',
|
|
1150
|
+
'.....######.....',
|
|
1151
|
+
'.....######.....',
|
|
1152
|
+
'...##......##...',
|
|
1153
|
+
'...##......##...',
|
|
1154
|
+
'...##......##...',
|
|
1155
|
+
'...##......##...',
|
|
1156
|
+
'.....######.....',
|
|
1157
|
+
'.....######.....',
|
|
1158
|
+
'...##......##...',
|
|
1159
|
+
'...##......##...',
|
|
1160
|
+
'...##......##...',
|
|
1161
|
+
'...##......##...',
|
|
1162
|
+
'.....######.....',
|
|
1163
|
+
'.....######.....',
|
|
1164
|
+
'................',
|
|
1165
|
+
],
|
|
1166
|
+
'digit-9': [
|
|
1167
|
+
'................',
|
|
1168
|
+
'.....######.....',
|
|
1169
|
+
'.....######.....',
|
|
1170
|
+
'...##......##...',
|
|
1171
|
+
'...##......##...',
|
|
1172
|
+
'...##......##...',
|
|
1173
|
+
'...##......##...',
|
|
1174
|
+
'.....########...',
|
|
1175
|
+
'.....########...',
|
|
1176
|
+
'...........##...',
|
|
1177
|
+
'...........##...',
|
|
1178
|
+
'.........##.....',
|
|
1179
|
+
'.........##.....',
|
|
1180
|
+
'.....####.......',
|
|
1181
|
+
'.....####.......',
|
|
1182
|
+
'................',
|
|
1183
|
+
],
|
|
1184
|
+
filter: [
|
|
1185
|
+
'................',
|
|
1186
|
+
'..############..',
|
|
1187
|
+
'..############..',
|
|
1188
|
+
'...##########...',
|
|
1189
|
+
'....########....',
|
|
1190
|
+
'.....######.....',
|
|
1191
|
+
'......####......',
|
|
1192
|
+
'......####......',
|
|
1193
|
+
'......####......',
|
|
1194
|
+
'......####......',
|
|
1195
|
+
'......####......',
|
|
1196
|
+
'......####......',
|
|
1197
|
+
'................',
|
|
1198
|
+
'................',
|
|
1199
|
+
'................',
|
|
1200
|
+
'................',
|
|
1201
|
+
],
|
|
1202
|
+
hash: [
|
|
1203
|
+
'................',
|
|
1204
|
+
'................',
|
|
1205
|
+
'....#...#.......',
|
|
1206
|
+
'....#...#.......',
|
|
1207
|
+
'..#########.....',
|
|
1208
|
+
'..#########.....',
|
|
1209
|
+
'....#...#.......',
|
|
1210
|
+
'....#...#.......',
|
|
1211
|
+
'..#########.....',
|
|
1212
|
+
'..#########.....',
|
|
1213
|
+
'....#...#.......',
|
|
1214
|
+
'....#...#.......',
|
|
1215
|
+
'................',
|
|
1216
|
+
'................',
|
|
1217
|
+
'................',
|
|
1218
|
+
'................',
|
|
1219
|
+
],
|
|
1220
|
+
percent: [
|
|
1221
|
+
'................',
|
|
1222
|
+
'...###......#...',
|
|
1223
|
+
'..#...#....#....',
|
|
1224
|
+
'..#...#...#.....',
|
|
1225
|
+
'..#...#..#......',
|
|
1226
|
+
'...###..#.......',
|
|
1227
|
+
'.......#........',
|
|
1228
|
+
'......#.........',
|
|
1229
|
+
'.....#..###.....',
|
|
1230
|
+
'....#..#...#....',
|
|
1231
|
+
'...#...#...#....',
|
|
1232
|
+
'..#....#...#....',
|
|
1233
|
+
'.#......###.....',
|
|
1234
|
+
'................',
|
|
1235
|
+
'................',
|
|
1236
|
+
'................',
|
|
1237
|
+
],
|
|
1238
|
+
period: [
|
|
1239
|
+
'................',
|
|
1240
|
+
'................',
|
|
1241
|
+
'................',
|
|
1242
|
+
'................',
|
|
1243
|
+
'................',
|
|
1244
|
+
'................',
|
|
1245
|
+
'................',
|
|
1246
|
+
'................',
|
|
1247
|
+
'................',
|
|
1248
|
+
'................',
|
|
1249
|
+
'................',
|
|
1250
|
+
'......####......',
|
|
1251
|
+
'......####......',
|
|
1252
|
+
'......####......',
|
|
1253
|
+
'................',
|
|
1254
|
+
'................',
|
|
1255
|
+
],
|
|
1256
|
+
share: [
|
|
1257
|
+
'................',
|
|
1258
|
+
'...........###..',
|
|
1259
|
+
'..........#####.',
|
|
1260
|
+
'...........###..',
|
|
1261
|
+
'.........#.#....',
|
|
1262
|
+
'.......##.......',
|
|
1263
|
+
'...###.#........',
|
|
1264
|
+
'..#####.........',
|
|
1265
|
+
'...###.#........',
|
|
1266
|
+
'.......##.......',
|
|
1267
|
+
'.........#.#....',
|
|
1268
|
+
'...........###..',
|
|
1269
|
+
'..........#####.',
|
|
1270
|
+
'...........###..',
|
|
1271
|
+
'................',
|
|
1272
|
+
'................',
|
|
1273
|
+
],
|
|
1274
|
+
sliders: [
|
|
1275
|
+
'................',
|
|
1276
|
+
'................',
|
|
1277
|
+
'....#...........',
|
|
1278
|
+
'...###..........',
|
|
1279
|
+
'..#####.########',
|
|
1280
|
+
'...###..........',
|
|
1281
|
+
'....#...........',
|
|
1282
|
+
'................',
|
|
1283
|
+
'...........#....',
|
|
1284
|
+
'..........###...',
|
|
1285
|
+
'########.#####..',
|
|
1286
|
+
'..........###...',
|
|
1287
|
+
'...........#....',
|
|
1288
|
+
'................',
|
|
1289
|
+
'................',
|
|
1290
|
+
'................',
|
|
1291
|
+
],
|
|
1292
|
+
sort: [
|
|
1293
|
+
'................',
|
|
1294
|
+
'......#.........',
|
|
1295
|
+
'.....###........',
|
|
1296
|
+
'....#####.......',
|
|
1297
|
+
'...#######......',
|
|
1298
|
+
'......#.........',
|
|
1299
|
+
'......#.........',
|
|
1300
|
+
'......#.........',
|
|
1301
|
+
'......#.........',
|
|
1302
|
+
'......#.........',
|
|
1303
|
+
'...#######......',
|
|
1304
|
+
'....#####.......',
|
|
1305
|
+
'.....###........',
|
|
1306
|
+
'......#.........',
|
|
1307
|
+
'................',
|
|
890
1308
|
'................',
|
|
891
1309
|
],
|
|
892
1310
|
};
|
|
@@ -903,6 +1321,79 @@ export const GLYPHS = Object.freeze(
|
|
|
903
1321
|
/** Every glyph name, frozen and sorted (mirrors GLYPHS keys). */
|
|
904
1322
|
export const GLYPH_NAMES = Object.freeze(Object.keys(GLYPHS));
|
|
905
1323
|
|
|
1324
|
+
/**
|
|
1325
|
+
* Intent → glyph search aliases. A small hand-curated set so a name search can
|
|
1326
|
+
* resolve the *word a consumer thinks of* to the glyph that depicts it (the
|
|
1327
|
+
* "depict, don't name the purpose" convention: `delete` → `trash`, `settings`
|
|
1328
|
+
* → `gear`). Keys are real glyph names (gated by check-glyphs.mjs); values are
|
|
1329
|
+
* extra search terms beyond the name itself. Not every glyph needs an entry —
|
|
1330
|
+
* findGlyphs() always also matches the name substring.
|
|
1331
|
+
*/
|
|
1332
|
+
export const GLYPH_TAGS = Object.freeze({
|
|
1333
|
+
trash: ['delete', 'remove', 'bin'],
|
|
1334
|
+
gear: ['settings', 'config', 'options', 'cog', 'preferences'],
|
|
1335
|
+
search: ['find', 'magnify', 'zoom', 'lookup'],
|
|
1336
|
+
'bar-chart': ['analytics', 'graph', 'stats', 'report', 'metrics'],
|
|
1337
|
+
database: ['db', 'storage', 'data', 'server', 'table'],
|
|
1338
|
+
sliders: ['filter', 'settings', 'controls', 'adjust', 'tune'],
|
|
1339
|
+
filter: ['funnel', 'refine', 'facet'],
|
|
1340
|
+
sort: ['order', 'arrange', 'rank'],
|
|
1341
|
+
mail: ['email', 'envelope', 'message', 'inbox'],
|
|
1342
|
+
bell: ['notification', 'alert', 'remind'],
|
|
1343
|
+
user: ['person', 'account', 'profile', 'member'],
|
|
1344
|
+
home: ['house', 'dashboard', 'start'],
|
|
1345
|
+
file: ['document', 'page', 'doc'],
|
|
1346
|
+
folder: ['directory', 'group'],
|
|
1347
|
+
lock: ['secure', 'private', 'password', 'locked'],
|
|
1348
|
+
eye: ['view', 'show', 'visible', 'preview'],
|
|
1349
|
+
'eye-off': ['hide', 'hidden', 'invisible', 'mask'],
|
|
1350
|
+
star: ['favorite', 'bookmark', 'rate'],
|
|
1351
|
+
heart: ['like', 'love', 'favorite'],
|
|
1352
|
+
refresh: ['reload', 'sync', 'update', 'retry'],
|
|
1353
|
+
close: ['cancel', 'dismiss', 'remove'],
|
|
1354
|
+
'x-circle': ['cancel', 'error', 'fail', 'dismiss'],
|
|
1355
|
+
check: ['done', 'ok', 'complete', 'confirm', 'tick'],
|
|
1356
|
+
'check-circle': ['done', 'success', 'ok', 'verified'],
|
|
1357
|
+
warning: ['caution', 'alert', 'attention'],
|
|
1358
|
+
info: ['about', 'help', 'note', 'details'],
|
|
1359
|
+
plus: ['add', 'new', 'create'],
|
|
1360
|
+
'plus-circle': ['add', 'new', 'create'],
|
|
1361
|
+
minus: ['subtract', 'collapse'],
|
|
1362
|
+
link: ['url', 'hyperlink', 'external', 'chain'],
|
|
1363
|
+
download: ['save', 'export', 'fetch'],
|
|
1364
|
+
upload: ['import', 'send'],
|
|
1365
|
+
grid: ['layout', 'apps', 'dashboard', 'tiles'],
|
|
1366
|
+
menu: ['hamburger', 'nav', 'list'],
|
|
1367
|
+
clock: ['time', 'schedule', 'history', 'recent'],
|
|
1368
|
+
calendar: ['date', 'schedule', 'event', 'day'],
|
|
1369
|
+
copy: ['duplicate', 'clipboard', 'clone'],
|
|
1370
|
+
share: ['send', 'export', 'network', 'distribute'],
|
|
1371
|
+
hash: ['number', 'tag', 'pound', 'count'],
|
|
1372
|
+
moon: ['dark', 'night', 'theme'],
|
|
1373
|
+
sun: ['light', 'day', 'theme', 'bright'],
|
|
1374
|
+
edit: ['pencil', 'write', 'modify', 'rename'],
|
|
1375
|
+
});
|
|
1376
|
+
|
|
1377
|
+
/**
|
|
1378
|
+
* Glyph names whose name OR a search alias contains `query` (case-insensitive),
|
|
1379
|
+
* sorted. `findGlyphs('')` returns every name. For discovery — a CMS field, an
|
|
1380
|
+
* icon picker, an LLM resolving an intent word to a real glyph.
|
|
1381
|
+
*
|
|
1382
|
+
* @param {string} query
|
|
1383
|
+
* @returns {GlyphName[]}
|
|
1384
|
+
*/
|
|
1385
|
+
export function findGlyphs(query) {
|
|
1386
|
+
const q = String(query ?? '')
|
|
1387
|
+
.trim()
|
|
1388
|
+
.toLowerCase();
|
|
1389
|
+
if (!q) return [...GLYPH_NAMES];
|
|
1390
|
+
return GLYPH_NAMES.filter(
|
|
1391
|
+
(name) =>
|
|
1392
|
+
name.toLowerCase().includes(q) ||
|
|
1393
|
+
(GLYPH_TAGS[name] ?? []).some((t) => t.toLowerCase().includes(q)),
|
|
1394
|
+
);
|
|
1395
|
+
}
|
|
1396
|
+
|
|
906
1397
|
const TONE = { '#': 'hot', '*': 'accent' };
|
|
907
1398
|
|
|
908
1399
|
/** The raw bitmap rows for a glyph, or `undefined` if the name is unknown. */
|
|
@@ -924,6 +1415,20 @@ export function glyphCells(name) {
|
|
|
924
1415
|
return cells;
|
|
925
1416
|
}
|
|
926
1417
|
|
|
1418
|
+
/**
|
|
1419
|
+
* The CSS `mask-image` `url()` for a glyph's lit cells — the value of
|
|
1420
|
+
* `--icon-mask` on a `.ui-icon` element (the one-node, currentColor,
|
|
1421
|
+
* scales-with-text icon path). `''` if the name is unknown. Single-tone:
|
|
1422
|
+
* accent `*` cells become opaque mask regions, like hot `#`.
|
|
1423
|
+
*
|
|
1424
|
+
* @param {GlyphNameInput} name
|
|
1425
|
+
* @returns {string}
|
|
1426
|
+
*/
|
|
1427
|
+
export function glyphMask(name) {
|
|
1428
|
+
const rows = GLYPHS[name];
|
|
1429
|
+
return rows ? maskUrl(rows) : '';
|
|
1430
|
+
}
|
|
1431
|
+
|
|
927
1432
|
const CELL = 'ui-dotmatrix__cell';
|
|
928
1433
|
|
|
929
1434
|
function cellClass(cell) {
|
|
@@ -1069,3 +1574,61 @@ export function renderGlyph(name, options = {}) {
|
|
|
1069
1574
|
// inline-icon use. `.ui-dotmatrix`'s `display: grid` works on a span.
|
|
1070
1575
|
return `<span class="${cls}" style="${style.join(';')}" ${a11y}>${inner}</span>`;
|
|
1071
1576
|
}
|
|
1577
|
+
|
|
1578
|
+
// Character → glyph name for renderReadout. Punctuation reuses the readout face
|
|
1579
|
+
// (digit-0..9 + colon/comma/period/percent) plus the existing minus/plus.
|
|
1580
|
+
const READOUT_CHARS = {
|
|
1581
|
+
0: 'digit-0',
|
|
1582
|
+
1: 'digit-1',
|
|
1583
|
+
2: 'digit-2',
|
|
1584
|
+
3: 'digit-3',
|
|
1585
|
+
4: 'digit-4',
|
|
1586
|
+
5: 'digit-5',
|
|
1587
|
+
6: 'digit-6',
|
|
1588
|
+
7: 'digit-7',
|
|
1589
|
+
8: 'digit-8',
|
|
1590
|
+
9: 'digit-9',
|
|
1591
|
+
':': 'colon',
|
|
1592
|
+
',': 'comma',
|
|
1593
|
+
'.': 'period',
|
|
1594
|
+
'%': 'percent',
|
|
1595
|
+
'-': 'minus',
|
|
1596
|
+
'+': 'plus',
|
|
1597
|
+
};
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Compose a string of digits/punctuation into a row of dot-matrix glyphs — the
|
|
1601
|
+
* Nothing-style big numeric readout for a hero KPI, clock, countdown, or
|
|
1602
|
+
* percentage. Every character is a decorative glyph; the readout's *value* is
|
|
1603
|
+
* carried by the accessible name, so a `label` is STRONGLY recommended (it
|
|
1604
|
+
* defaults to the raw `text` when omitted — fine for "12:48", but pass a
|
|
1605
|
+
* fuller label like "Revenue: 12,480 USD" when the digits alone are ambiguous).
|
|
1606
|
+
*
|
|
1607
|
+
* Recognised characters: `0-9 : , . % - +` and space (a blank advance).
|
|
1608
|
+
* Anything else is skipped. The per-glyph options (`solid`, `render: 'mask'`,
|
|
1609
|
+
* `dot`, `gap`, `anim`) pass straight through to renderGlyph for each character,
|
|
1610
|
+
* so a mask-mode readout is one node per glyph (lightest) and a cell-mode one is
|
|
1611
|
+
* the full dot-display look. Returns `''` for empty input. Needs
|
|
1612
|
+
* `@ponchia/ui/css` (the `.ui-readout` + `.ui-dotmatrix`/`.ui-icon` rules).
|
|
1613
|
+
*
|
|
1614
|
+
* @param {string} text
|
|
1615
|
+
* @param {RenderReadoutOptions} [options]
|
|
1616
|
+
* @returns {string}
|
|
1617
|
+
*/
|
|
1618
|
+
export function renderReadout(text, options = {}) {
|
|
1619
|
+
const str = String(text ?? '');
|
|
1620
|
+
if (!str) return '';
|
|
1621
|
+
const { label, gap, ...glyphOpts } = options;
|
|
1622
|
+
const a11y = `role="img" aria-label="${esc(label ?? str)}"`;
|
|
1623
|
+
// The glyphs inside are always decorative — the wrapper carries the name.
|
|
1624
|
+
const inner = [...str]
|
|
1625
|
+
.map((ch) => {
|
|
1626
|
+
if (ch === ' ') return '<span class="ui-readout__spacer" aria-hidden="true"></span>';
|
|
1627
|
+
const name = READOUT_CHARS[ch];
|
|
1628
|
+
if (!name) return '';
|
|
1629
|
+
return renderGlyph(name, glyphOpts);
|
|
1630
|
+
})
|
|
1631
|
+
.join('');
|
|
1632
|
+
const style = gap && cssLen(gap) ? ` style="--readout-gap:${cssLen(gap)}"` : '';
|
|
1633
|
+
return `<span class="ui-readout"${style} ${a11y}>${inner}</span>`;
|
|
1634
|
+
}
|