@keystone-sites/marketing-design-system 1.0.20 → 1.0.21
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/icons.tsx +22 -0
- package/index.css +4 -0
- package/lib/phone.ts +294 -0
- package/package.json +10 -1
- package/primitives/business-picker.css +120 -0
- package/primitives/business-picker.tsx +234 -0
- package/primitives/buttons.css +16 -0
- package/primitives/buttons.tsx +11 -4
- package/primitives/chip.css +121 -0
- package/primitives/chip.tsx +45 -0
- package/primitives/field.css +54 -0
- package/primitives/field.tsx +111 -1
- package/primitives/glyph-toggle.css +62 -0
- package/primitives/glyph-toggle.tsx +42 -0
- package/primitives/grader.css +4 -0
- package/primitives/modal.css +41 -3
- package/primitives/modal.tsx +18 -5
- package/primitives/tooltip.css +56 -0
- package/primitives/tooltip.tsx +103 -0
- package/tokens/semantic.css +4 -0
package/icons.tsx
CHANGED
|
@@ -1251,6 +1251,28 @@ export function IconSend(props: Props) {
|
|
|
1251
1251
|
);
|
|
1252
1252
|
}
|
|
1253
1253
|
|
|
1254
|
+
/** A storefront: the business that is the reader's own. */
|
|
1255
|
+
export function IconStorefront(props: Props) {
|
|
1256
|
+
return (
|
|
1257
|
+
<LineGlyph {...props}>
|
|
1258
|
+
<path d="M3 9.5 4.6 4.5h14.8L21 9.5" />
|
|
1259
|
+
<path d="M3 9.5a3 3 0 0 0 6 0 3 3 0 0 0 6 0 3 3 0 0 0 6 0" />
|
|
1260
|
+
<path d="M5 12v8h14v-8" />
|
|
1261
|
+
<path d="M10 20v-5h4v5" />
|
|
1262
|
+
</LineGlyph>
|
|
1263
|
+
);
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
/** An eye: a business the reader keeps watch on. */
|
|
1267
|
+
export function IconEye(props: Props) {
|
|
1268
|
+
return (
|
|
1269
|
+
<LineGlyph {...props}>
|
|
1270
|
+
<path d="M2.5 12s3.5-6.5 9.5-6.5 9.5 6.5 9.5 6.5-3.5 6.5-9.5 6.5S2.5 12 2.5 12Z" />
|
|
1271
|
+
<circle cx="12" cy="12" r="3" />
|
|
1272
|
+
</LineGlyph>
|
|
1273
|
+
);
|
|
1274
|
+
}
|
|
1275
|
+
|
|
1254
1276
|
export function IconStop(props: Props) {
|
|
1255
1277
|
return (
|
|
1256
1278
|
<LineGlyph {...props}>
|
package/index.css
CHANGED
|
@@ -55,6 +55,10 @@
|
|
|
55
55
|
@import "./primitives/status.css" layer(primitives);
|
|
56
56
|
@import "./primitives/skeleton.css" layer(primitives);
|
|
57
57
|
@import "./primitives/tag.css" layer(primitives);
|
|
58
|
+
@import "./primitives/chip.css" layer(primitives);
|
|
59
|
+
@import "./primitives/tooltip.css" layer(primitives);
|
|
60
|
+
@import "./primitives/glyph-toggle.css" layer(primitives);
|
|
61
|
+
@import "./primitives/business-picker.css" layer(primitives);
|
|
58
62
|
@import "./primitives/tabs.css" layer(primitives);
|
|
59
63
|
@import "./primitives/report.css" layer(primitives);
|
|
60
64
|
@import "./primitives/report-nav.css" layer(primitives);
|
package/lib/phone.ts
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/** Phone numbers as the login sheet takes them: a country's calling code
|
|
2
|
+
* and a national number typed against that country's grouping, joined
|
|
3
|
+
* into E.164 for the API.
|
|
4
|
+
*
|
|
5
|
+
* The table is [name, ISO 3166-1 alpha-2, calling code digits, national
|
|
6
|
+
* mask]; `#` is one digit, every other character a literal the field
|
|
7
|
+
* draws as the digits arrive. A NANP country ("1" and the "1xxx" area
|
|
8
|
+
* codes of the Caribbean) keeps its parentheses; everyone else groups
|
|
9
|
+
* with spaces and hyphens. An empty mask leaves the digits as typed. The
|
|
10
|
+
* flag is the country's regional-indicator pair, so it renders from the
|
|
11
|
+
* system's emoji font with no image to fetch. */
|
|
12
|
+
|
|
13
|
+
export interface Country {
|
|
14
|
+
name: string;
|
|
15
|
+
/** ISO 3166-1 alpha-2. */
|
|
16
|
+
code: string;
|
|
17
|
+
/** Calling code digits, e.g. "1", "44", "1268". */
|
|
18
|
+
dial: string;
|
|
19
|
+
/** National grouping; `#` per digit. */
|
|
20
|
+
mask: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
type Row = readonly [name: string, code: string, dial: string, mask: string];
|
|
24
|
+
|
|
25
|
+
const ROWS: readonly Row[] = [
|
|
26
|
+
["Afghanistan", "AF", "93", "##-###-####"],
|
|
27
|
+
["Albania", "AL", "355", "### ###-###"],
|
|
28
|
+
["Algeria", "DZ", "213", "##-###-####"],
|
|
29
|
+
["Andorra", "AD", "376", "###-###"],
|
|
30
|
+
["Angola", "AO", "244", "### ###-###"],
|
|
31
|
+
["Antigua and Barbuda", "AG", "1268", "###-####"],
|
|
32
|
+
["Argentina", "AR", "54", "### ###-####"],
|
|
33
|
+
["Armenia", "AM", "374", "##-###-###"],
|
|
34
|
+
["Australia", "AU", "61", "#-####-####"],
|
|
35
|
+
["Austria", "AT", "43", "### ###-####"],
|
|
36
|
+
["Azerbaijan", "AZ", "994", "##-###-##-##"],
|
|
37
|
+
["Bahamas", "BS", "1242", "###-####"],
|
|
38
|
+
["Bahrain", "BH", "973", "####-####"],
|
|
39
|
+
["Bangladesh", "BD", "880", "##-###-###"],
|
|
40
|
+
["Barbados", "BB", "1246", "###-####"],
|
|
41
|
+
["Belarus", "BY", "375", "## ###-##-##"],
|
|
42
|
+
["Belgium", "BE", "32", "### ###-###"],
|
|
43
|
+
["Belize", "BZ", "501", "###-####"],
|
|
44
|
+
["Benin", "BJ", "229", "##-##-####"],
|
|
45
|
+
["Bhutan", "BT", "975", "#-###-###"],
|
|
46
|
+
["Bolivia", "BO", "591", "#-###-####"],
|
|
47
|
+
["Bosnia and Herzegovina", "BA", "387", "##-####"],
|
|
48
|
+
["Botswana", "BW", "267", "##-###-###"],
|
|
49
|
+
["Brazil", "BR", "55", "## ####-####"],
|
|
50
|
+
["Brunei", "BN", "673", "###-####"],
|
|
51
|
+
["Bulgaria", "BG", "359", "### ###-###"],
|
|
52
|
+
["Burkina Faso", "BF", "226", "##-##-####"],
|
|
53
|
+
["Burundi", "BI", "257", "##-##-####"],
|
|
54
|
+
["Cambodia", "KH", "855", "##-###-###"],
|
|
55
|
+
["Cameroon", "CM", "237", "####-####"],
|
|
56
|
+
["Canada", "CA", "1", "(###) ###-####"],
|
|
57
|
+
["Central African Republic", "CF", "236", "##-##-####"],
|
|
58
|
+
["Chad", "TD", "235", "##-##-##-##"],
|
|
59
|
+
["Chile", "CL", "56", "#-####-####"],
|
|
60
|
+
["China", "CN", "86", "##-#####-#####"],
|
|
61
|
+
["Colombia", "CO", "57", "### ###-####"],
|
|
62
|
+
["Comoros", "KM", "269", "##-#####"],
|
|
63
|
+
["Costa Rica", "CR", "506", "####-####"],
|
|
64
|
+
["Croatia", "HR", "385", "##-###-###"],
|
|
65
|
+
["Cuba", "CU", "53", "#-###-####"],
|
|
66
|
+
["Cyprus", "CY", "357", "##-###-###"],
|
|
67
|
+
["Czech Republic", "CZ", "420", "### ###-###"],
|
|
68
|
+
["Democratic Republic of the Congo", "CD", "243", "### ###-###"],
|
|
69
|
+
["Denmark", "DK", "45", "##-##-##-##"],
|
|
70
|
+
["Djibouti", "DJ", "253", "##-##-##-##"],
|
|
71
|
+
["Dominica", "DM", "1767", "###-####"],
|
|
72
|
+
["Dominican Republic", "DO", "1809", "###-####"],
|
|
73
|
+
["East Timor", "TL", "670", "#-#####"],
|
|
74
|
+
["Ecuador", "EC", "593", "#-###-####"],
|
|
75
|
+
["Egypt", "EG", "20", "### ###-####"],
|
|
76
|
+
["El Salvador", "SV", "503", "##-##-####"],
|
|
77
|
+
["Equatorial Guinea", "GQ", "240", "##-###-####"],
|
|
78
|
+
["Eritrea", "ER", "291", "#-###-###"],
|
|
79
|
+
["Estonia", "EE", "372", "###-####"],
|
|
80
|
+
["Eswatini", "SZ", "268", "##-##-####"],
|
|
81
|
+
["Ethiopia", "ET", "251", "##-###-####"],
|
|
82
|
+
["Fiji", "FJ", "679", "##-#####"],
|
|
83
|
+
["Finland", "FI", "358", "### ###-##-##"],
|
|
84
|
+
["France", "FR", "33", "# ## ## ## ##"],
|
|
85
|
+
["Gabon", "GA", "241", "#-##-##-##"],
|
|
86
|
+
["Gambia", "GM", "220", "### ##-##"],
|
|
87
|
+
["Georgia", "GE", "995", "### ###-###"],
|
|
88
|
+
["Germany", "DE", "49", "###-###"],
|
|
89
|
+
["Ghana", "GH", "233", "### ###-###"],
|
|
90
|
+
["Greece", "GR", "30", "### ###-####"],
|
|
91
|
+
["Grenada", "GD", "1473", "###-####"],
|
|
92
|
+
["Guatemala", "GT", "502", "#-###-####"],
|
|
93
|
+
["Guinea", "GN", "224", "##-###-###"],
|
|
94
|
+
["Guinea-Bissau", "GW", "245", "#-######"],
|
|
95
|
+
["Guyana", "GY", "592", "###-####"],
|
|
96
|
+
["Haiti", "HT", "509", "##-##-####"],
|
|
97
|
+
["Honduras", "HN", "504", "####-####"],
|
|
98
|
+
["Hungary", "HU", "36", "### ###-###"],
|
|
99
|
+
["Iceland", "IS", "354", "###-####"],
|
|
100
|
+
["India", "IN", "91", "#### ###-###"],
|
|
101
|
+
["Indonesia", "ID", "62", "## ###-##-###"],
|
|
102
|
+
["Iran", "IR", "98", "### ###-####"],
|
|
103
|
+
["Iraq", "IQ", "964", "### ###-####"],
|
|
104
|
+
["Ireland", "IE", "353", "### ###-###"],
|
|
105
|
+
["Israel", "IL", "972", "#-###-####"],
|
|
106
|
+
["Italy", "IT", "39", "### ####-###"],
|
|
107
|
+
["Jamaica", "JM", "1876", "###-####"],
|
|
108
|
+
["Japan", "JP", "81", "### ###-###"],
|
|
109
|
+
["Jordan", "JO", "962", "#-####-####"],
|
|
110
|
+
["Kazakhstan", "KZ", "7", "## ###-##-##"],
|
|
111
|
+
["Kenya", "KE", "254", "###-######"],
|
|
112
|
+
["Kiribati", "KI", "686", "##-###"],
|
|
113
|
+
["Kuwait", "KW", "965", "####-####"],
|
|
114
|
+
["Kyrgyzstan", "KG", "996", "### ###-###"],
|
|
115
|
+
["Laos", "LA", "856", "##-###-###"],
|
|
116
|
+
["Latvia", "LV", "371", "##-###-###"],
|
|
117
|
+
["Lebanon", "LB", "961", "#-###-###"],
|
|
118
|
+
["Lesotho", "LS", "266", "#-###-####"],
|
|
119
|
+
["Liberia", "LR", "231", "##-###-###"],
|
|
120
|
+
["Libya", "LY", "218", "###-####"],
|
|
121
|
+
["Liechtenstein", "LI", "423", "### ###-####"],
|
|
122
|
+
["Lithuania", "LT", "370", "### ##-###"],
|
|
123
|
+
["Luxembourg", "LU", "352", "### ###-###"],
|
|
124
|
+
["Madagascar", "MG", "261", "##-##-#####"],
|
|
125
|
+
["Malawi", "MW", "265", "#-####-####"],
|
|
126
|
+
["Malaysia", "MY", "60", "#-###-###"],
|
|
127
|
+
["Maldives", "MV", "960", "###-####"],
|
|
128
|
+
["Mali", "ML", "223", "##-##-####"],
|
|
129
|
+
["Malta", "MT", "356", "####-####"],
|
|
130
|
+
["Marshall Islands", "MH", "692", "###-####"],
|
|
131
|
+
["Mauritania", "MR", "222", "##-##-####"],
|
|
132
|
+
["Mauritius", "MU", "230", "###-####"],
|
|
133
|
+
["Mexico", "MX", "52", "##-##-####"],
|
|
134
|
+
["Micronesia", "FM", "691", "###-####"],
|
|
135
|
+
["Moldova", "MD", "373", "####-####"],
|
|
136
|
+
["Monaco", "MC", "377", "##-###-###"],
|
|
137
|
+
["Mongolia", "MN", "976", "##-##-####"],
|
|
138
|
+
["Montenegro", "ME", "382", "##-###-###"],
|
|
139
|
+
["Morocco", "MA", "212", "##-####-###"],
|
|
140
|
+
["Mozambique", "MZ", "258", "##-###-###"],
|
|
141
|
+
["Myanmar", "MM", "95", "###-###"],
|
|
142
|
+
["Namibia", "NA", "264", "##-###-####"],
|
|
143
|
+
["Nauru", "NR", "674", "###-####"],
|
|
144
|
+
["Nepal", "NP", "977", "##-###-###"],
|
|
145
|
+
["Netherlands", "NL", "31", "##-###-####"],
|
|
146
|
+
["New Zealand", "NZ", "64", "### ###-####"],
|
|
147
|
+
["Nicaragua", "NI", "505", "####-####"],
|
|
148
|
+
["Niger", "NE", "227", "##-##-####"],
|
|
149
|
+
["Nigeria", "NG", "234", "### ###-####"],
|
|
150
|
+
["North Korea", "KP", "850", "####-#############"],
|
|
151
|
+
["North Macedonia", "MK", "389", "##-###-###"],
|
|
152
|
+
["Norway", "NO", "47", "### ##-###"],
|
|
153
|
+
["Oman", "OM", "968", "##-###-###"],
|
|
154
|
+
["Pakistan", "PK", "92", "### ###-####"],
|
|
155
|
+
["Palau", "PW", "680", "###-####"],
|
|
156
|
+
["Panama", "PA", "507", "###-####"],
|
|
157
|
+
["Papua New Guinea", "PG", "675", "### ##-###"],
|
|
158
|
+
["Paraguay", "PY", "595", "### ###-###"],
|
|
159
|
+
["Peru", "PE", "51", "### ###-###"],
|
|
160
|
+
["Philippines", "PH", "63", "### ###-####"],
|
|
161
|
+
["Poland", "PL", "48", "### ###-###"],
|
|
162
|
+
["Portugal", "PT", "351", "##-###-####"],
|
|
163
|
+
["Qatar", "QA", "974", "####-####"],
|
|
164
|
+
["Romania", "RO", "40", "##-###-####"],
|
|
165
|
+
["Russia", "RU", "7", "### ###-##-##"],
|
|
166
|
+
["Rwanda", "RW", "250", "### ###-###"],
|
|
167
|
+
["Saint Kitts and Nevis", "KN", "1869", "###-####"],
|
|
168
|
+
["Saint Lucia", "LC", "1758", "###-####"],
|
|
169
|
+
["Saint Vincent and the Grenadines", "VC", "1784", "###-####"],
|
|
170
|
+
["Samoa", "WS", "685", "##-####"],
|
|
171
|
+
["San Marino", "SM", "378", "####-######"],
|
|
172
|
+
["Sao Tome and Principe", "ST", "239", "##-#####"],
|
|
173
|
+
["Saudi Arabia", "SA", "966", "#-###-####"],
|
|
174
|
+
["Senegal", "SN", "221", "##-###-####"],
|
|
175
|
+
["Serbia", "RS", "381", "##-###-####"],
|
|
176
|
+
["Seychelles", "SC", "248", "#-###-###"],
|
|
177
|
+
["Sierra Leone", "SL", "232", "##-######"],
|
|
178
|
+
["Singapore", "SG", "65", "####-####"],
|
|
179
|
+
["Slovakia", "SK", "421", "### ###-###"],
|
|
180
|
+
["Slovenia", "SI", "386", "##-###-###"],
|
|
181
|
+
["Solomon Islands", "SB", "677", "#####"],
|
|
182
|
+
["Somalia", "SO", "252", "#-###-###"],
|
|
183
|
+
["South Africa", "ZA", "27", "##-###-####"],
|
|
184
|
+
["South Korea", "KR", "82", "##-###-####"],
|
|
185
|
+
["South Sudan", "SS", "211", "##-###-####"],
|
|
186
|
+
["Spain", "ES", "34", "### ###-###"],
|
|
187
|
+
["Sri Lanka", "LK", "94", "##-###-####"],
|
|
188
|
+
["Suriname", "SR", "597", "###-###"],
|
|
189
|
+
["Sweden", "SE", "46", "##-###-####"],
|
|
190
|
+
["Switzerland", "CH", "41", "##-###-####"],
|
|
191
|
+
["Syria", "SY", "963", "##-####-###"],
|
|
192
|
+
["Tajikistan", "TJ", "992", "##-###-####"],
|
|
193
|
+
["Tanzania", "TZ", "255", "##-###-####"],
|
|
194
|
+
["Thailand", "TH", "66", "##-###-###"],
|
|
195
|
+
["Togo", "TG", "228", "##-###-###"],
|
|
196
|
+
["Tonga", "TO", "676", "#####"],
|
|
197
|
+
["Trinidad and Tobago", "TT", "1868", "###-####"],
|
|
198
|
+
["Tunisia", "TN", "216", "##-###-###"],
|
|
199
|
+
["Turkey", "TR", "90", "### ###-####"],
|
|
200
|
+
["Turkmenistan", "TM", "993", "#-###-####"],
|
|
201
|
+
["Tuvalu", "TV", "688", "####"],
|
|
202
|
+
["Uganda", "UG", "256", "### ###-###"],
|
|
203
|
+
["Ukraine", "UA", "380", "## ###-##-##"],
|
|
204
|
+
["United Arab Emirates", "AE", "971", "#-###-####"],
|
|
205
|
+
["United Kingdom", "GB", "44", "#### ######"],
|
|
206
|
+
["United States", "US", "1", "(###) ###-####"],
|
|
207
|
+
["Uruguay", "UY", "598", "#-###-##-##"],
|
|
208
|
+
["Uzbekistan", "UZ", "998", "##-###-####"],
|
|
209
|
+
["Vanuatu", "VU", "678", "#####"],
|
|
210
|
+
["Venezuela", "VE", "58", "### ###-####"],
|
|
211
|
+
["Vietnam", "VN", "84", "### ####-###"],
|
|
212
|
+
["Yemen", "YE", "967", "##-###-###"],
|
|
213
|
+
["Zambia", "ZM", "260", "##-###-####"],
|
|
214
|
+
["Zimbabwe", "ZW", "263", "#-######"],
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
export const COUNTRIES: readonly Country[] = ROWS.map(([name, code, dial, mask]) => ({
|
|
218
|
+
name,
|
|
219
|
+
code,
|
|
220
|
+
dial,
|
|
221
|
+
mask,
|
|
222
|
+
}));
|
|
223
|
+
|
|
224
|
+
export const DEFAULT_COUNTRY = "US";
|
|
225
|
+
|
|
226
|
+
export function countryOf(code: string): Country | undefined {
|
|
227
|
+
return COUNTRIES.find((c) => c.code === code);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/** The calling code as dialled: "+1", "+1 268". */
|
|
231
|
+
export function dialCode(country: Country | undefined): string {
|
|
232
|
+
const dial = country?.dial || "1";
|
|
233
|
+
return dial.length > 1 && dial.startsWith("1") ? `+1 ${dial.slice(1)}` : `+${dial}`;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/** The country's flag from its two regional-indicator symbols. */
|
|
237
|
+
export function flagOf(code: string): string {
|
|
238
|
+
return String.fromCodePoint(
|
|
239
|
+
...[...code.toUpperCase()].map((ch) => 0x1f1e6 + ch.charCodeAt(0) - 65),
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** The mask with its digit slots shown as zeros, for the placeholder. */
|
|
244
|
+
export function maskPlaceholder(country: Country | undefined): string {
|
|
245
|
+
return (country?.mask || "###-###-####").replace(/#/g, "0");
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function capacity(mask: string): number {
|
|
249
|
+
return (mask.match(/#/g) ?? []).length;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/** Drop a calling code typed again in front of the national number — a
|
|
253
|
+
* paste of "+1 415…" into a US field — but only when the digits run past
|
|
254
|
+
* the country's local length, so a local number that merely starts with
|
|
255
|
+
* those digits (a French number beginning 33) is left alone. An unknown
|
|
256
|
+
* local length is never guessed. */
|
|
257
|
+
function stripRepeatedDial(digits: string, country: Country | undefined): string {
|
|
258
|
+
const dial = country?.dial ?? "";
|
|
259
|
+
const max = capacity(country?.mask ?? "");
|
|
260
|
+
if (!digits || !dial || !max) return digits;
|
|
261
|
+
let out = digits;
|
|
262
|
+
while (out.startsWith(dial) && out.length > max && out.length > dial.length) {
|
|
263
|
+
out = out.slice(dial.length);
|
|
264
|
+
}
|
|
265
|
+
return out;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/** Digits laid into the mask; no trailing literal, so backspace works. */
|
|
269
|
+
function masked(digits: string, mask: string): string {
|
|
270
|
+
let out = "";
|
|
271
|
+
let i = 0;
|
|
272
|
+
for (const ch of mask) {
|
|
273
|
+
if (i >= digits.length) break;
|
|
274
|
+
if (ch === "#") out += digits[i++];
|
|
275
|
+
else out += ch;
|
|
276
|
+
}
|
|
277
|
+
return out;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** What the field shows for what was typed: national digits only, a
|
|
281
|
+
* repeated calling code dropped, the country's grouping applied. */
|
|
282
|
+
export function formatNational(raw: string, country: Country | undefined): string {
|
|
283
|
+
const digits = stripRepeatedDial(raw.replace(/\D/g, ""), country);
|
|
284
|
+
return country?.mask ? masked(digits, country.mask) : digits;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/** The number the API takes, or null while the national part is empty
|
|
288
|
+
* or, where the country's grouping is known, still short of it. */
|
|
289
|
+
export function toE164(country: Country | undefined, national: string): string | null {
|
|
290
|
+
const digits = national.replace(/\D/g, "");
|
|
291
|
+
const expected = capacity(country?.mask ?? "");
|
|
292
|
+
if (!digits || (expected && digits.length < expected)) return null;
|
|
293
|
+
return `+${country?.dial || "1"}${digits}`;
|
|
294
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystone-sites/marketing-design-system",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Keystone's marketing design system: tokens, the tick grid, type, primitives, site chrome, and the landing kit. Source-shipped CSS and TSX for Next.js consumers.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -101,6 +101,8 @@
|
|
|
101
101
|
"./grid/region": "./grid/region.tsx",
|
|
102
102
|
"./primitives/breadcrumb.css": "./primitives/breadcrumb.css",
|
|
103
103
|
"./primitives/breadcrumb": "./primitives/breadcrumb.tsx",
|
|
104
|
+
"./primitives/business-picker.css": "./primitives/business-picker.css",
|
|
105
|
+
"./primitives/business-picker": "./primitives/business-picker.tsx",
|
|
104
106
|
"./primitives/button-inline.css": "./primitives/button-inline.css",
|
|
105
107
|
"./primitives/button-inline": "./primitives/button-inline.tsx",
|
|
106
108
|
"./primitives/buttons.css": "./primitives/buttons.css",
|
|
@@ -109,6 +111,8 @@
|
|
|
109
111
|
"./primitives/case-study-button": "./primitives/case-study-button.tsx",
|
|
110
112
|
"./primitives/case-study-card.css": "./primitives/case-study-card.css",
|
|
111
113
|
"./primitives/case-study-card": "./primitives/case-study-card.tsx",
|
|
114
|
+
"./primitives/chip.css": "./primitives/chip.css",
|
|
115
|
+
"./primitives/chip": "./primitives/chip.tsx",
|
|
112
116
|
"./primitives/closer-row.css": "./primitives/closer-row.css",
|
|
113
117
|
"./primitives/closer-row": "./primitives/closer-row.tsx",
|
|
114
118
|
"./primitives/cta-row.css": "./primitives/cta-row.css",
|
|
@@ -121,6 +125,8 @@
|
|
|
121
125
|
"./primitives/field": "./primitives/field.tsx",
|
|
122
126
|
"./primitives/footer-item.css": "./primitives/footer-item.css",
|
|
123
127
|
"./primitives/footer-item": "./primitives/footer-item.tsx",
|
|
128
|
+
"./primitives/glyph-toggle.css": "./primitives/glyph-toggle.css",
|
|
129
|
+
"./primitives/glyph-toggle": "./primitives/glyph-toggle.tsx",
|
|
124
130
|
"./primitives/grader-menu": "./primitives/grader-menu.tsx",
|
|
125
131
|
"./primitives/grader.css": "./primitives/grader.css",
|
|
126
132
|
"./primitives/grader": "./primitives/grader.tsx",
|
|
@@ -165,6 +171,8 @@
|
|
|
165
171
|
"./primitives/text.css": "./primitives/text.css",
|
|
166
172
|
"./primitives/toc.css": "./primitives/toc.css",
|
|
167
173
|
"./primitives/toc": "./primitives/toc.tsx",
|
|
174
|
+
"./primitives/tooltip.css": "./primitives/tooltip.css",
|
|
175
|
+
"./primitives/tooltip": "./primitives/tooltip.tsx",
|
|
168
176
|
"./sections/faq-island": "./sections/faq-island.tsx",
|
|
169
177
|
"./sections/faq.css": "./sections/faq.css",
|
|
170
178
|
"./sections/faq": "./sections/faq.tsx",
|
|
@@ -205,6 +213,7 @@
|
|
|
205
213
|
"./lib/legal-data": "./lib/legal-data.ts",
|
|
206
214
|
"./lib/legal": "./lib/legal.ts",
|
|
207
215
|
"./lib/noise": "./lib/noise.tsx",
|
|
216
|
+
"./lib/phone": "./lib/phone.ts",
|
|
208
217
|
"./lib/render-boundary": "./lib/render-boundary.tsx",
|
|
209
218
|
"./lib/scroll-lock": "./lib/scroll-lock.ts",
|
|
210
219
|
"./lib/swipe": "./lib/swipe.ts",
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/* Business picker: the label, a box field holding the chosen chips with
|
|
2
|
+
the search entry on its own row beneath them, the search menu floating
|
|
3
|
+
over whatever follows, then the offers row and the error line. The
|
|
4
|
+
field restates the grader's teal state language on the ks-field's box
|
|
5
|
+
radius. */
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--picker-h: 48px;
|
|
9
|
+
--picker-entry-h: 32px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.picker {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--space-md);
|
|
16
|
+
--_border: var(--color-border-000);
|
|
17
|
+
--_ring: var(--color-bg-200);
|
|
18
|
+
--_ph: var(--color-text-500);
|
|
19
|
+
--_ink: var(--color-text-200);
|
|
20
|
+
}
|
|
21
|
+
.picker-label {
|
|
22
|
+
color: var(--color-text-200);
|
|
23
|
+
}
|
|
24
|
+
.picker-box {
|
|
25
|
+
position: relative;
|
|
26
|
+
}
|
|
27
|
+
.picker-field {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
box-sizing: border-box;
|
|
31
|
+
gap: var(--space-sm);
|
|
32
|
+
min-height: var(--picker-h);
|
|
33
|
+
padding: var(--space-sm) var(--space-lg);
|
|
34
|
+
background: var(--color-bg-000);
|
|
35
|
+
border: 1px solid var(--_border);
|
|
36
|
+
border-radius: var(--radius-lg);
|
|
37
|
+
box-shadow: 0 0 0 var(--ring-w) var(--_ring);
|
|
38
|
+
cursor: text;
|
|
39
|
+
transition-property: border-color, box-shadow;
|
|
40
|
+
transition-duration: var(--motion-hover-duration);
|
|
41
|
+
transition-timing-function: var(--motion-hover-ease);
|
|
42
|
+
}
|
|
43
|
+
.picker-chips {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-wrap: wrap;
|
|
46
|
+
gap: var(--space-sm);
|
|
47
|
+
}
|
|
48
|
+
.picker-entry {
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: var(--space-md);
|
|
52
|
+
min-height: var(--picker-entry-h);
|
|
53
|
+
}
|
|
54
|
+
.picker-glyph {
|
|
55
|
+
flex: none;
|
|
56
|
+
color: var(--_ph);
|
|
57
|
+
transition-property: color;
|
|
58
|
+
transition-duration: var(--motion-hover-duration);
|
|
59
|
+
transition-timing-function: var(--motion-hover-ease);
|
|
60
|
+
}
|
|
61
|
+
.picker-entry input {
|
|
62
|
+
flex: 1;
|
|
63
|
+
min-width: 0;
|
|
64
|
+
border: 0;
|
|
65
|
+
padding: var(--space-none);
|
|
66
|
+
background: none;
|
|
67
|
+
outline: none;
|
|
68
|
+
color: var(--_ink);
|
|
69
|
+
--font: var(--ts-text-md-light-font);
|
|
70
|
+
--ls: var(--ts-text-md-light-ls);
|
|
71
|
+
--opsz: var(--ts-text-md-light-opsz);
|
|
72
|
+
}
|
|
73
|
+
.picker-entry input::placeholder {
|
|
74
|
+
color: var(--_ph);
|
|
75
|
+
opacity: 1;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media (hover: hover) and (pointer: fine) {
|
|
79
|
+
.picker-field:hover {
|
|
80
|
+
--_border: var(--color-teal-250);
|
|
81
|
+
--_ring: var(--color-teal-200);
|
|
82
|
+
--_ph: var(--color-text-400);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.picker-field:focus-within {
|
|
86
|
+
--_border: var(--color-teal-400);
|
|
87
|
+
--_ring: var(--color-teal-300);
|
|
88
|
+
--_ph: var(--color-text-400);
|
|
89
|
+
}
|
|
90
|
+
.picker-field:focus-within:has(input:not(:placeholder-shown)),
|
|
91
|
+
.picker[data-open] .picker-field {
|
|
92
|
+
--_border: var(--color-teal-300);
|
|
93
|
+
--_ring: var(--color-teal-200);
|
|
94
|
+
}
|
|
95
|
+
.picker[data-invalid] .picker-field,
|
|
96
|
+
.picker[data-invalid] .picker-field:hover,
|
|
97
|
+
.picker[data-invalid] .picker-field:focus-within {
|
|
98
|
+
--_border: var(--color-red-400);
|
|
99
|
+
--_ring: var(--color-red-300);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.picker-offers {
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
gap: var(--space-md);
|
|
106
|
+
margin-top: var(--space-xs);
|
|
107
|
+
}
|
|
108
|
+
.picker-offers-label {
|
|
109
|
+
color: var(--color-text-400);
|
|
110
|
+
}
|
|
111
|
+
.picker-offers-row {
|
|
112
|
+
display: flex;
|
|
113
|
+
flex-wrap: wrap;
|
|
114
|
+
gap: var(--space-sm);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.picker-error {
|
|
118
|
+
margin: var(--space-none);
|
|
119
|
+
color: var(--color-red-500);
|
|
120
|
+
}
|