@codecademy/gamut 67.6.4-alpha.d8f776.0 → 67.6.4-alpha.dab391.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/dist/Anchor/index.d.ts +6 -30
- package/dist/Badge/index.d.ts +6 -30
- package/dist/Box/props.d.ts +6 -30
- package/dist/Button/shared/styles.d.ts +6 -30
- package/dist/Card/elements.d.ts +18 -90
- package/dist/ConnectedForm/ConnectedFormGroup.d.ts +8 -2
- package/dist/ConnectedForm/ConnectedFormGroup.js +1 -1
- package/dist/Form/elements/Form.d.ts +6 -30
- package/dist/Form/elements/FormGroupLabel.d.ts +2 -2
- package/dist/Form/elements/FormGroupLabel.js +14 -3
- package/dist/GridForm/GridFormInputGroup/GridFormRadioGroupInput/index.js +19 -11
- package/dist/GridForm/GridFormInputGroup/__fixtures__/renderers.d.ts +4 -0
- package/dist/GridForm/types.d.ts +7 -2
- package/dist/Layout/Column.d.ts +6 -30
- package/dist/Layout/LayoutGrid.d.ts +6 -30
- package/dist/List/elements.d.ts +12 -60
- package/dist/Menu/elements.d.ts +6 -30
- package/dist/Pagination/AnimatedPaginationButtons.d.ts +6 -30
- package/dist/Pagination/utils.d.ts +6 -30
- package/dist/Tabs/props.d.ts +6 -30
- package/dist/Tag/types.d.ts +6 -30
- package/dist/Tip/InfoTip/InfoTipButton.js +5 -2
- package/dist/Tip/InfoTip/index.d.ts +34 -2
- package/dist/Tip/InfoTip/index.js +46 -68
- package/dist/Tip/InfoTip/utils.d.ts +13 -0
- package/dist/Tip/InfoTip/utils.js +47 -0
- package/dist/Tip/__tests__/helpers.d.ts +5 -26
- package/dist/Tip/shared/FloatingTip.js +3 -3
- package/dist/Tip/shared/InlineTip.js +4 -1
- package/dist/Tip/shared/types.d.ts +1 -1
- package/dist/Tip/shared/utils.d.ts +19 -0
- package/dist/Tip/shared/utils.js +104 -0
- package/dist/Toggle/elements.d.ts +12 -60
- package/dist/Typography/Text.d.ts +6 -30
- package/package.json +7 -7
- package/dist/Tip/InfoTip/elements.d.ts +0 -12
- package/dist/Tip/InfoTip/elements.js +0 -9
package/dist/Anchor/index.d.ts
CHANGED
|
@@ -131,53 +131,29 @@ declare const anchorProps: import("@codecademy/variance/dist/types/config").Pars
|
|
|
131
131
|
};
|
|
132
132
|
readonly mx: {
|
|
133
133
|
readonly property: "margin";
|
|
134
|
-
readonly properties:
|
|
135
|
-
readonly physical: readonly ["marginLeft", "marginRight"];
|
|
136
|
-
readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
|
|
137
|
-
};
|
|
138
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
134
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
139
135
|
readonly scale: "spacing";
|
|
140
136
|
};
|
|
141
137
|
readonly my: {
|
|
142
138
|
readonly property: "margin";
|
|
143
|
-
readonly properties:
|
|
144
|
-
readonly physical: readonly ["marginTop", "marginBottom"];
|
|
145
|
-
readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
|
|
146
|
-
};
|
|
147
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
139
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
148
140
|
readonly scale: "spacing";
|
|
149
141
|
};
|
|
150
142
|
readonly mt: {
|
|
151
|
-
readonly property:
|
|
152
|
-
readonly physical: "marginTop";
|
|
153
|
-
readonly logical: "marginBlockStart";
|
|
154
|
-
};
|
|
143
|
+
readonly property: "marginTop";
|
|
155
144
|
readonly scale: "spacing";
|
|
156
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
157
145
|
};
|
|
158
146
|
readonly mb: {
|
|
159
|
-
readonly property:
|
|
160
|
-
readonly physical: "marginBottom";
|
|
161
|
-
readonly logical: "marginBlockEnd";
|
|
162
|
-
};
|
|
147
|
+
readonly property: "marginBottom";
|
|
163
148
|
readonly scale: "spacing";
|
|
164
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
165
149
|
};
|
|
166
150
|
readonly mr: {
|
|
167
|
-
readonly property:
|
|
168
|
-
readonly physical: "marginRight";
|
|
169
|
-
readonly logical: "marginInlineEnd";
|
|
170
|
-
};
|
|
151
|
+
readonly property: "marginRight";
|
|
171
152
|
readonly scale: "spacing";
|
|
172
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
173
153
|
};
|
|
174
154
|
readonly ml: {
|
|
175
|
-
readonly property:
|
|
176
|
-
readonly physical: "marginLeft";
|
|
177
|
-
readonly logical: "marginInlineStart";
|
|
178
|
-
};
|
|
155
|
+
readonly property: "marginLeft";
|
|
179
156
|
readonly scale: "spacing";
|
|
180
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
181
157
|
};
|
|
182
158
|
}>>, import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
|
|
183
159
|
readonly fontFamily: {
|
package/dist/Badge/index.d.ts
CHANGED
|
@@ -45,53 +45,29 @@ declare const badgeProps: import("@codecademy/variance/dist/types/config").Parse
|
|
|
45
45
|
};
|
|
46
46
|
readonly mx: {
|
|
47
47
|
readonly property: "margin";
|
|
48
|
-
readonly properties:
|
|
49
|
-
readonly physical: readonly ["marginLeft", "marginRight"];
|
|
50
|
-
readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
|
|
51
|
-
};
|
|
52
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
48
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
53
49
|
readonly scale: "spacing";
|
|
54
50
|
};
|
|
55
51
|
readonly my: {
|
|
56
52
|
readonly property: "margin";
|
|
57
|
-
readonly properties:
|
|
58
|
-
readonly physical: readonly ["marginTop", "marginBottom"];
|
|
59
|
-
readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
|
|
60
|
-
};
|
|
61
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
53
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
62
54
|
readonly scale: "spacing";
|
|
63
55
|
};
|
|
64
56
|
readonly mt: {
|
|
65
|
-
readonly property:
|
|
66
|
-
readonly physical: "marginTop";
|
|
67
|
-
readonly logical: "marginBlockStart";
|
|
68
|
-
};
|
|
57
|
+
readonly property: "marginTop";
|
|
69
58
|
readonly scale: "spacing";
|
|
70
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
71
59
|
};
|
|
72
60
|
readonly mb: {
|
|
73
|
-
readonly property:
|
|
74
|
-
readonly physical: "marginBottom";
|
|
75
|
-
readonly logical: "marginBlockEnd";
|
|
76
|
-
};
|
|
61
|
+
readonly property: "marginBottom";
|
|
77
62
|
readonly scale: "spacing";
|
|
78
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
79
63
|
};
|
|
80
64
|
readonly mr: {
|
|
81
|
-
readonly property:
|
|
82
|
-
readonly physical: "marginRight";
|
|
83
|
-
readonly logical: "marginInlineEnd";
|
|
84
|
-
};
|
|
65
|
+
readonly property: "marginRight";
|
|
85
66
|
readonly scale: "spacing";
|
|
86
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
87
67
|
};
|
|
88
68
|
readonly ml: {
|
|
89
|
-
readonly property:
|
|
90
|
-
readonly physical: "marginLeft";
|
|
91
|
-
readonly logical: "marginInlineStart";
|
|
92
|
-
};
|
|
69
|
+
readonly property: "marginLeft";
|
|
93
70
|
readonly scale: "spacing";
|
|
94
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
95
71
|
};
|
|
96
72
|
}>>, import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
|
|
97
73
|
readonly flexBasis: {
|
package/dist/Box/props.d.ts
CHANGED
|
@@ -37,53 +37,29 @@ export declare const boxProps: import("@codecademy/variance/dist/types/config").
|
|
|
37
37
|
};
|
|
38
38
|
readonly mx: {
|
|
39
39
|
readonly property: "margin";
|
|
40
|
-
readonly properties:
|
|
41
|
-
readonly physical: readonly ["marginLeft", "marginRight"];
|
|
42
|
-
readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
|
|
43
|
-
};
|
|
44
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
40
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
45
41
|
readonly scale: "spacing";
|
|
46
42
|
};
|
|
47
43
|
readonly my: {
|
|
48
44
|
readonly property: "margin";
|
|
49
|
-
readonly properties:
|
|
50
|
-
readonly physical: readonly ["marginTop", "marginBottom"];
|
|
51
|
-
readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
|
|
52
|
-
};
|
|
53
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
45
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
54
46
|
readonly scale: "spacing";
|
|
55
47
|
};
|
|
56
48
|
readonly mt: {
|
|
57
|
-
readonly property:
|
|
58
|
-
readonly physical: "marginTop";
|
|
59
|
-
readonly logical: "marginBlockStart";
|
|
60
|
-
};
|
|
49
|
+
readonly property: "marginTop";
|
|
61
50
|
readonly scale: "spacing";
|
|
62
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
63
51
|
};
|
|
64
52
|
readonly mb: {
|
|
65
|
-
readonly property:
|
|
66
|
-
readonly physical: "marginBottom";
|
|
67
|
-
readonly logical: "marginBlockEnd";
|
|
68
|
-
};
|
|
53
|
+
readonly property: "marginBottom";
|
|
69
54
|
readonly scale: "spacing";
|
|
70
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
71
55
|
};
|
|
72
56
|
readonly mr: {
|
|
73
|
-
readonly property:
|
|
74
|
-
readonly physical: "marginRight";
|
|
75
|
-
readonly logical: "marginInlineEnd";
|
|
76
|
-
};
|
|
57
|
+
readonly property: "marginRight";
|
|
77
58
|
readonly scale: "spacing";
|
|
78
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
79
59
|
};
|
|
80
60
|
readonly ml: {
|
|
81
|
-
readonly property:
|
|
82
|
-
readonly physical: "marginLeft";
|
|
83
|
-
readonly logical: "marginInlineStart";
|
|
84
|
-
};
|
|
61
|
+
readonly property: "marginLeft";
|
|
85
62
|
readonly scale: "spacing";
|
|
86
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
87
63
|
};
|
|
88
64
|
}>>, import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
|
|
89
65
|
readonly border: {
|
|
@@ -159,53 +159,29 @@ export declare const buttonProps: import("@codecademy/variance/dist/types/config
|
|
|
159
159
|
};
|
|
160
160
|
readonly mx: {
|
|
161
161
|
readonly property: "margin";
|
|
162
|
-
readonly properties:
|
|
163
|
-
readonly physical: readonly ["marginLeft", "marginRight"];
|
|
164
|
-
readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
|
|
165
|
-
};
|
|
166
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
162
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
167
163
|
readonly scale: "spacing";
|
|
168
164
|
};
|
|
169
165
|
readonly my: {
|
|
170
166
|
readonly property: "margin";
|
|
171
|
-
readonly properties:
|
|
172
|
-
readonly physical: readonly ["marginTop", "marginBottom"];
|
|
173
|
-
readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
|
|
174
|
-
};
|
|
175
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
167
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
176
168
|
readonly scale: "spacing";
|
|
177
169
|
};
|
|
178
170
|
readonly mt: {
|
|
179
|
-
readonly property:
|
|
180
|
-
readonly physical: "marginTop";
|
|
181
|
-
readonly logical: "marginBlockStart";
|
|
182
|
-
};
|
|
171
|
+
readonly property: "marginTop";
|
|
183
172
|
readonly scale: "spacing";
|
|
184
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
185
173
|
};
|
|
186
174
|
readonly mb: {
|
|
187
|
-
readonly property:
|
|
188
|
-
readonly physical: "marginBottom";
|
|
189
|
-
readonly logical: "marginBlockEnd";
|
|
190
|
-
};
|
|
175
|
+
readonly property: "marginBottom";
|
|
191
176
|
readonly scale: "spacing";
|
|
192
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
193
177
|
};
|
|
194
178
|
readonly mr: {
|
|
195
|
-
readonly property:
|
|
196
|
-
readonly physical: "marginRight";
|
|
197
|
-
readonly logical: "marginInlineEnd";
|
|
198
|
-
};
|
|
179
|
+
readonly property: "marginRight";
|
|
199
180
|
readonly scale: "spacing";
|
|
200
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
201
181
|
};
|
|
202
182
|
readonly ml: {
|
|
203
|
-
readonly property:
|
|
204
|
-
readonly physical: "marginLeft";
|
|
205
|
-
readonly logical: "marginInlineStart";
|
|
206
|
-
};
|
|
183
|
+
readonly property: "marginLeft";
|
|
207
184
|
readonly scale: "spacing";
|
|
208
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
209
185
|
};
|
|
210
186
|
}>>, import("@codecademy/variance/dist/types/config").Parser<import("@codecademy/variance/dist/types/config").TransformerMap<{
|
|
211
187
|
readonly border: {
|
package/dist/Card/elements.d.ts
CHANGED
|
@@ -530,53 +530,29 @@ export declare const MotionBox: import("react").ComponentType<{
|
|
|
530
530
|
}>;
|
|
531
531
|
mx?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
532
532
|
readonly property: "margin";
|
|
533
|
-
readonly properties:
|
|
534
|
-
readonly physical: readonly ["marginLeft", "marginRight"];
|
|
535
|
-
readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
|
|
536
|
-
};
|
|
537
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
533
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
538
534
|
readonly scale: "spacing";
|
|
539
535
|
}>;
|
|
540
536
|
my?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
541
537
|
readonly property: "margin";
|
|
542
|
-
readonly properties:
|
|
543
|
-
readonly physical: readonly ["marginTop", "marginBottom"];
|
|
544
|
-
readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
|
|
545
|
-
};
|
|
546
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
538
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
547
539
|
readonly scale: "spacing";
|
|
548
540
|
}>;
|
|
549
541
|
mt?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
550
|
-
readonly property:
|
|
551
|
-
readonly physical: "marginTop";
|
|
552
|
-
readonly logical: "marginBlockStart";
|
|
553
|
-
};
|
|
542
|
+
readonly property: "marginTop";
|
|
554
543
|
readonly scale: "spacing";
|
|
555
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
556
544
|
}>;
|
|
557
545
|
mb?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
558
|
-
readonly property:
|
|
559
|
-
readonly physical: "marginBottom";
|
|
560
|
-
readonly logical: "marginBlockEnd";
|
|
561
|
-
};
|
|
546
|
+
readonly property: "marginBottom";
|
|
562
547
|
readonly scale: "spacing";
|
|
563
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
564
548
|
}>;
|
|
565
549
|
mr?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
566
|
-
readonly property:
|
|
567
|
-
readonly physical: "marginRight";
|
|
568
|
-
readonly logical: "marginInlineEnd";
|
|
569
|
-
};
|
|
550
|
+
readonly property: "marginRight";
|
|
570
551
|
readonly scale: "spacing";
|
|
571
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
572
552
|
}>;
|
|
573
553
|
ml?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
574
|
-
readonly property:
|
|
575
|
-
readonly physical: "marginLeft";
|
|
576
|
-
readonly logical: "marginInlineStart";
|
|
577
|
-
};
|
|
554
|
+
readonly property: "marginLeft";
|
|
578
555
|
readonly scale: "spacing";
|
|
579
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
580
556
|
}>;
|
|
581
557
|
borderX?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
582
558
|
readonly property: "border";
|
|
@@ -1239,53 +1215,29 @@ export declare const DynamicCardWrapper: import("@emotion/styled").StyledCompone
|
|
|
1239
1215
|
}>;
|
|
1240
1216
|
mx?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1241
1217
|
readonly property: "margin";
|
|
1242
|
-
readonly properties:
|
|
1243
|
-
readonly physical: readonly ["marginLeft", "marginRight"];
|
|
1244
|
-
readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
|
|
1245
|
-
};
|
|
1246
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1218
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
1247
1219
|
readonly scale: "spacing";
|
|
1248
1220
|
}>;
|
|
1249
1221
|
my?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1250
1222
|
readonly property: "margin";
|
|
1251
|
-
readonly properties:
|
|
1252
|
-
readonly physical: readonly ["marginTop", "marginBottom"];
|
|
1253
|
-
readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
|
|
1254
|
-
};
|
|
1255
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1223
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
1256
1224
|
readonly scale: "spacing";
|
|
1257
1225
|
}>;
|
|
1258
1226
|
mt?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1259
|
-
readonly property:
|
|
1260
|
-
readonly physical: "marginTop";
|
|
1261
|
-
readonly logical: "marginBlockStart";
|
|
1262
|
-
};
|
|
1227
|
+
readonly property: "marginTop";
|
|
1263
1228
|
readonly scale: "spacing";
|
|
1264
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1265
1229
|
}>;
|
|
1266
1230
|
mb?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1267
|
-
readonly property:
|
|
1268
|
-
readonly physical: "marginBottom";
|
|
1269
|
-
readonly logical: "marginBlockEnd";
|
|
1270
|
-
};
|
|
1231
|
+
readonly property: "marginBottom";
|
|
1271
1232
|
readonly scale: "spacing";
|
|
1272
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1273
1233
|
}>;
|
|
1274
1234
|
mr?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1275
|
-
readonly property:
|
|
1276
|
-
readonly physical: "marginRight";
|
|
1277
|
-
readonly logical: "marginInlineEnd";
|
|
1278
|
-
};
|
|
1235
|
+
readonly property: "marginRight";
|
|
1279
1236
|
readonly scale: "spacing";
|
|
1280
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1281
1237
|
}>;
|
|
1282
1238
|
ml?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1283
|
-
readonly property:
|
|
1284
|
-
readonly physical: "marginLeft";
|
|
1285
|
-
readonly logical: "marginInlineStart";
|
|
1286
|
-
};
|
|
1239
|
+
readonly property: "marginLeft";
|
|
1287
1240
|
readonly scale: "spacing";
|
|
1288
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1289
1241
|
}>;
|
|
1290
1242
|
borderX?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1291
1243
|
readonly property: "border";
|
|
@@ -1932,53 +1884,29 @@ export declare const StaticCardWrapper: import("@emotion/styled").StyledComponen
|
|
|
1932
1884
|
}>;
|
|
1933
1885
|
mx?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1934
1886
|
readonly property: "margin";
|
|
1935
|
-
readonly properties:
|
|
1936
|
-
readonly physical: readonly ["marginLeft", "marginRight"];
|
|
1937
|
-
readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
|
|
1938
|
-
};
|
|
1939
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1887
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
1940
1888
|
readonly scale: "spacing";
|
|
1941
1889
|
}>;
|
|
1942
1890
|
my?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1943
1891
|
readonly property: "margin";
|
|
1944
|
-
readonly properties:
|
|
1945
|
-
readonly physical: readonly ["marginTop", "marginBottom"];
|
|
1946
|
-
readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
|
|
1947
|
-
};
|
|
1948
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1892
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
1949
1893
|
readonly scale: "spacing";
|
|
1950
1894
|
}>;
|
|
1951
1895
|
mt?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1952
|
-
readonly property:
|
|
1953
|
-
readonly physical: "marginTop";
|
|
1954
|
-
readonly logical: "marginBlockStart";
|
|
1955
|
-
};
|
|
1896
|
+
readonly property: "marginTop";
|
|
1956
1897
|
readonly scale: "spacing";
|
|
1957
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1958
1898
|
}>;
|
|
1959
1899
|
mb?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1960
|
-
readonly property:
|
|
1961
|
-
readonly physical: "marginBottom";
|
|
1962
|
-
readonly logical: "marginBlockEnd";
|
|
1963
|
-
};
|
|
1900
|
+
readonly property: "marginBottom";
|
|
1964
1901
|
readonly scale: "spacing";
|
|
1965
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1966
1902
|
}>;
|
|
1967
1903
|
mr?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1968
|
-
readonly property:
|
|
1969
|
-
readonly physical: "marginRight";
|
|
1970
|
-
readonly logical: "marginInlineEnd";
|
|
1971
|
-
};
|
|
1904
|
+
readonly property: "marginRight";
|
|
1972
1905
|
readonly scale: "spacing";
|
|
1973
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1974
1906
|
}>;
|
|
1975
1907
|
ml?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1976
|
-
readonly property:
|
|
1977
|
-
readonly physical: "marginLeft";
|
|
1978
|
-
readonly logical: "marginInlineStart";
|
|
1979
|
-
};
|
|
1908
|
+
readonly property: "marginLeft";
|
|
1980
1909
|
readonly scale: "spacing";
|
|
1981
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
1982
1910
|
}>;
|
|
1983
1911
|
borderX?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
1984
1912
|
readonly property: "border";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { FormGroupProps
|
|
2
|
+
import { FormGroupProps } from '..';
|
|
3
|
+
import { InfoTipPropsWithoutAria } from '../Tip/InfoTip/utils';
|
|
3
4
|
import { ConnectedField, FieldProps, SubmitContextProps } from './types';
|
|
4
5
|
export interface ConnectedFormGroupBaseProps extends Omit<FormGroupProps, 'label' | 'disabled' | 'description' | 'htmlFor'> {
|
|
5
6
|
customError?: string;
|
|
@@ -8,7 +9,12 @@ export interface ConnectedFormGroupBaseProps extends Omit<FormGroupProps, 'label
|
|
|
8
9
|
name: string;
|
|
9
10
|
label: React.ReactNode;
|
|
10
11
|
required?: boolean;
|
|
11
|
-
|
|
12
|
+
/**
|
|
13
|
+
* InfoTip to display next to the field label. The InfoTip button is
|
|
14
|
+
* automatically labelled by the field label. To override this behavior,
|
|
15
|
+
* provide `ariaLabel` or `ariaLabelledby`.
|
|
16
|
+
*/
|
|
17
|
+
infotip?: InfoTipPropsWithoutAria;
|
|
12
18
|
}
|
|
13
19
|
export interface ConnectedFormGroupProps<T extends ConnectedField> extends SubmitContextProps, ConnectedFormGroupBaseProps {
|
|
14
20
|
/**
|
|
@@ -13,7 +13,7 @@ const ErrorAnchor = /*#__PURE__*/_styled(Anchor, {
|
|
|
13
13
|
label: "ErrorAnchor"
|
|
14
14
|
})(css({
|
|
15
15
|
color: 'feedback-error'
|
|
16
|
-
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
16
|
+
}), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Db25uZWN0ZWRGb3JtL0Nvbm5lY3RlZEZvcm1Hcm91cC50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYW9CIiwiZmlsZSI6Ii4uLy4uL3NyYy9Db25uZWN0ZWRGb3JtL0Nvbm5lY3RlZEZvcm1Hcm91cC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tICdAY29kZWNhZGVteS9nYW11dC1zdHlsZXMnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IHsgdXNlRWZmZWN0IH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0ICogYXMgUmVhY3QgZnJvbSAncmVhY3QnO1xuXG5pbXBvcnQgeyBGb3JtRXJyb3IsIEZvcm1Hcm91cCwgRm9ybUdyb3VwTGFiZWwsIEZvcm1Hcm91cFByb3BzIH0gZnJvbSAnLi4nO1xuaW1wb3J0IHsgQW5jaG9yIH0gZnJvbSAnLi4vQW5jaG9yJztcbmltcG9ydCB7IEhpZGRlblRleHQgfSBmcm9tICcuLi9IaWRkZW5UZXh0JztcbmltcG9ydCB7IE1hcmtkb3duIH0gZnJvbSAnLi4vTWFya2Rvd24nO1xuaW1wb3J0IHsgSW5mb1RpcFByb3BzV2l0aG91dEFyaWEgfSBmcm9tICcuLi9UaXAvSW5mb1RpcC91dGlscyc7XG5pbXBvcnQgeyBDb25uZWN0ZWRGaWVsZCwgRmllbGRQcm9wcywgU3VibWl0Q29udGV4dFByb3BzIH0gZnJvbSAnLi90eXBlcyc7XG5pbXBvcnQgeyBnZXRFcnJvck1lc3NhZ2UsIHVzZUZpZWxkIH0gZnJvbSAnLi91dGlscyc7XG5cbmNvbnN0I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gICAgIG5hbWU9e25hbWV9XG4gICAgICAvPlxuICAgICAge2NoaWxkcmVufVxuICAgICAge3Nob3dFcnJvciAmJiAoXG4gICAgICAgIDxGb3JtRXJyb3JcbiAgICAgICAgICBhcmlhLWxpdmU9e2lzRmlyc3RFcnJvciA/ICdhc3NlcnRpdmUnIDogJ29mZid9XG4gICAgICAgICAgaWQ9e2Vycm9ySWR9XG4gICAgICAgICAgcm9sZT17aXNGaXJzdEVycm9yID8gJ2FsZXJ0JyA6ICdzdGF0dXMnfVxuICAgICAgICAgIHZhcmlhbnQ9e2Vycm9yVHlwZX1cbiAgICAgICAgPlxuICAgICAgICAgIDxNYXJrZG93blxuICAgICAgICAgICAgaW5saW5lXG4gICAgICAgICAgICBvdmVycmlkZXM9e3tcbiAgICAgICAgICAgICAgYToge1xuICAgICAgICAgICAgICAgIGFsbG93ZWRBdHRyaWJ1dGVzOiBbJ2hyZWYnLCAndGFyZ2V0J10sXG4gICAgICAgICAgICAgICAgY29tcG9uZW50OiBFcnJvckFuY2hvcixcbiAgICAgICAgICAgICAgICBwcm9jZXNzTm9kZTogKFxuICAgICAgICAgICAgICAgICAgbm9kZTogdW5rbm93bixcbiAgICAgICAgICAgICAgICAgIHByb3BzOiB7IG9uQ2xpY2s/OiAoKSA9PiB2b2lkIH1cbiAgICAgICAgICAgICAgICApID0+IDxFcnJvckFuY2hvciB7Li4ucHJvcHN9IC8+LFxuICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfX1cbiAgICAgICAgICAgIHNraXBEZWZhdWx0T3ZlcnJpZGVzPXt7IGE6IHRydWUgfX1cbiAgICAgICAgICAgIHNwYWNpbmc9XCJub25lXCJcbiAgICAgICAgICAgIHRleHQ9e3RleHRFcnJvcn1cbiAgICAgICAgICAvPlxuICAgICAgICA8L0Zvcm1FcnJvcj5cbiAgICAgICl9XG4gICAgPC9Gb3JtR3JvdXA+XG4gICk7XG59XG4iXX0= */");
|
|
17
17
|
export function ConnectedFormGroup({
|
|
18
18
|
customError,
|
|
19
19
|
children,
|
|
@@ -198,53 +198,29 @@ declare const StyledForm: import("@emotion/styled").StyledComponent<{
|
|
|
198
198
|
}>;
|
|
199
199
|
mx?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
200
200
|
readonly property: "margin";
|
|
201
|
-
readonly properties:
|
|
202
|
-
readonly physical: readonly ["marginLeft", "marginRight"];
|
|
203
|
-
readonly logical: readonly ["marginInlineStart", "marginInlineEnd"];
|
|
204
|
-
};
|
|
205
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
201
|
+
readonly properties: readonly ["marginLeft", "marginRight"];
|
|
206
202
|
readonly scale: "spacing";
|
|
207
203
|
}>;
|
|
208
204
|
my?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
209
205
|
readonly property: "margin";
|
|
210
|
-
readonly properties:
|
|
211
|
-
readonly physical: readonly ["marginTop", "marginBottom"];
|
|
212
|
-
readonly logical: readonly ["marginBlockStart", "marginBlockEnd"];
|
|
213
|
-
};
|
|
214
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
206
|
+
readonly properties: readonly ["marginTop", "marginBottom"];
|
|
215
207
|
readonly scale: "spacing";
|
|
216
208
|
}>;
|
|
217
209
|
mt?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
218
|
-
readonly property:
|
|
219
|
-
readonly physical: "marginTop";
|
|
220
|
-
readonly logical: "marginBlockStart";
|
|
221
|
-
};
|
|
210
|
+
readonly property: "marginTop";
|
|
222
211
|
readonly scale: "spacing";
|
|
223
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
224
212
|
}>;
|
|
225
213
|
mb?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
226
|
-
readonly property:
|
|
227
|
-
readonly physical: "marginBottom";
|
|
228
|
-
readonly logical: "marginBlockEnd";
|
|
229
|
-
};
|
|
214
|
+
readonly property: "marginBottom";
|
|
230
215
|
readonly scale: "spacing";
|
|
231
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
232
216
|
}>;
|
|
233
217
|
mr?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
234
|
-
readonly property:
|
|
235
|
-
readonly physical: "marginRight";
|
|
236
|
-
readonly logical: "marginInlineEnd";
|
|
237
|
-
};
|
|
218
|
+
readonly property: "marginRight";
|
|
238
219
|
readonly scale: "spacing";
|
|
239
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
240
220
|
}>;
|
|
241
221
|
ml?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
242
|
-
readonly property:
|
|
243
|
-
readonly physical: "marginLeft";
|
|
244
|
-
readonly logical: "marginInlineStart";
|
|
245
|
-
};
|
|
222
|
+
readonly property: "marginLeft";
|
|
246
223
|
readonly scale: "spacing";
|
|
247
|
-
readonly resolveProperty: (useLogicalProperties: boolean) => import("@codecademy/variance/dist/types/properties").PropertyMode;
|
|
248
224
|
}>;
|
|
249
225
|
borderX?: import("@codecademy/variance/dist/types/config").Scale<{
|
|
250
226
|
readonly property: "border";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StyleProps } from '@codecademy/variance';
|
|
2
2
|
import { HTMLAttributes } from 'react';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import {
|
|
4
|
+
import { InfoTipPropsWithoutAria } from '../../Tip/InfoTip/utils';
|
|
5
5
|
import { BaseInputProps } from '../types';
|
|
6
6
|
declare const labelSizeVariants: (props: import("@codecademy/variance/dist/types/config").VariantProps<"size", false | "small" | "large"> & {
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
@@ -15,7 +15,7 @@ export type FormGroupLabelProps = HTMLAttributes<HTMLDivElement> & HTMLAttribute
|
|
|
15
15
|
/**
|
|
16
16
|
* [The for/id string of a label or labelable form-related element](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/htmlFor). The outer FormGroup or FormLabel should have an identical string as the inner FormElement for accessibility purposes.
|
|
17
17
|
*/
|
|
18
|
-
infotip?:
|
|
18
|
+
infotip?: InfoTipPropsWithoutAria;
|
|
19
19
|
size?: 'small' | 'large';
|
|
20
20
|
/**
|
|
21
21
|
* Solo fields should always be required and have no optional/required text
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import _styled from "@emotion/styled/base";
|
|
2
2
|
import { states, variant } from '@codecademy/gamut-styles';
|
|
3
|
+
import { useId } from 'react';
|
|
3
4
|
import * as React from 'react';
|
|
4
5
|
import { FlexBox } from '../..';
|
|
5
6
|
import { InfoTip } from '../../Tip/InfoTip';
|
|
7
|
+
import { createInfoTipProps } from '../../Tip/InfoTip/utils';
|
|
6
8
|
import { Text } from '../../Typography/Text';
|
|
7
9
|
import { formBaseStyles, formFieldTextDisabledStyles } from '../styles';
|
|
8
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -30,7 +32,7 @@ const labelStates = states({
|
|
|
30
32
|
const Label = /*#__PURE__*/_styled("label", {
|
|
31
33
|
target: "e1t0n89n0",
|
|
32
34
|
label: "Label"
|
|
33
|
-
})(labelSizeVariants, labelStates, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
35
|
+
})(labelSizeVariants, labelStates, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9Gb3JtL2VsZW1lbnRzL0Zvcm1Hcm91cExhYmVsLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1RGMiLCJmaWxlIjoiLi4vLi4vLi4vc3JjL0Zvcm0vZWxlbWVudHMvRm9ybUdyb3VwTGFiZWwudHN4Iiwic291cmNl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Gb3IgPyAnbGFiZWwnIDogJ2Rpdid9XG4gICAgICAgIGNsYXNzTmFtZT17Y2xhc3NOYW1lfVxuICAgICAgICBkaXNhYmxlZD17ZGlzYWJsZWR9XG4gICAgICAgIGh0bWxGb3I9e2h0bWxGb3J9XG4gICAgICAgIGlkPXtpbmZvdGlwICYmIHNob3VsZExhYmVsSW5mb1RpcCA/IGxhYmVsSWQgOiB1bmRlZmluZWR9XG4gICAgICAgIHNpemU9e3NpemV9XG4gICAgICA+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgICAgeyFpc1NvbG9GaWVsZCAmJlxuICAgICAgICAgIChyZXF1aXJlZCA/IChcbiAgICAgICAgICAgIDxUZXh0IGFyaWEtaGlkZGVuIGFzPVwic3BhblwiPlxuICAgICAgICAgICAgICAqXG4gICAgICAgICAgICA8L1RleHQ+XG4gICAgICAgICAgKSA6IChcbiAgICAgICAgICAgICdcXHUwMEEwKG9wdGlvbmFsKSdcbiAgICAgICAgICApKX1cbiAgICAgIDwvTGFiZWw+XG4gICAgICB7aW5mb3RpcFByb3BzICYmIDxJbmZvVGlwIHsuLi5pbmZvdGlwUHJvcHN9IC8+fVxuICAgIDwvRmxleEJveD5cbiAgKTtcbn07XG4iXX0= */");
|
|
34
36
|
export const FormGroupLabel = ({
|
|
35
37
|
children,
|
|
36
38
|
className,
|
|
@@ -42,6 +44,14 @@ export const FormGroupLabel = ({
|
|
|
42
44
|
size,
|
|
43
45
|
...rest
|
|
44
46
|
}) => {
|
|
47
|
+
const labelId = useId();
|
|
48
|
+
const {
|
|
49
|
+
infotipProps,
|
|
50
|
+
shouldLabelInfoTip
|
|
51
|
+
} = infotip ? createInfoTipProps(infotip, labelId) : {
|
|
52
|
+
infotipProps: undefined,
|
|
53
|
+
shouldLabelInfoTip: false
|
|
54
|
+
};
|
|
45
55
|
return /*#__PURE__*/_jsxs(FlexBox, {
|
|
46
56
|
justifyContent: "space-between",
|
|
47
57
|
mb: 4,
|
|
@@ -51,14 +61,15 @@ export const FormGroupLabel = ({
|
|
|
51
61
|
className: className,
|
|
52
62
|
disabled: disabled,
|
|
53
63
|
htmlFor: htmlFor,
|
|
64
|
+
id: infotip && shouldLabelInfoTip ? labelId : undefined,
|
|
54
65
|
size: size,
|
|
55
66
|
children: [children, !isSoloField && (required ? /*#__PURE__*/_jsx(Text, {
|
|
56
67
|
"aria-hidden": true,
|
|
57
68
|
as: "span",
|
|
58
69
|
children: "*"
|
|
59
70
|
}) : '\u00A0(optional)')]
|
|
60
|
-
}),
|
|
61
|
-
...
|
|
71
|
+
}), infotipProps && /*#__PURE__*/_jsx(InfoTip, {
|
|
72
|
+
...infotipProps
|
|
62
73
|
})]
|
|
63
74
|
});
|
|
64
75
|
};
|