@atlaskit/ds-explorations 0.1.2 → 0.1.4
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 +12 -0
- package/dist/cjs/components/text.partial.js +1 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/components/text.partial.js +1 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/components/text.partial.js +1 -3
- package/dist/esm/version.json +1 -1
- package/dist/types-ts4.0/components/box.partial.d.ts +213 -0
- package/dist/types-ts4.0/components/inline.partial.d.ts +52 -0
- package/dist/types-ts4.0/components/interaction-surface.partial.d.ts +45 -0
- package/dist/types-ts4.0/components/stack.partial.d.ts +47 -0
- package/dist/types-ts4.0/components/surface-provider.d.ts +15 -0
- package/dist/types-ts4.0/components/text.partial.d.ts +132 -0
- package/dist/types-ts4.0/components/types.d.ts +13 -0
- package/dist/types-ts4.0/constants.d.ts +15 -0
- package/dist/types-ts4.0/index.d.ts +8 -0
- package/dist/types-ts4.0/internal/color-map.d.ts +34 -0
- package/dist/types-ts4.0/internal/role-to-element.d.ts +32 -0
- package/package.json +12 -5
- package/report.api.md +232 -269
- package/scripts/__tests__/__snapshots__/codegen.test.tsx.snap +18 -0
- package/src/components/interaction-surface.partial.tsx +19 -1
- package/src/components/text.partial.tsx +1 -2
|
@@ -69,7 +69,7 @@ export default InteractionSurface;
|
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* THIS SECTION WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}
|
|
72
|
-
* @codegen <<SignedSource::
|
|
72
|
+
* @codegen <<SignedSource::6d0e1f52b0e3002ea607eb6a00d90b03>>
|
|
73
73
|
* @codegenId interactions
|
|
74
74
|
* @codegenCommand yarn codegen-styles
|
|
75
75
|
* @codegenParams ["background"]
|
|
@@ -151,6 +151,15 @@ const backgroundActiveColorMap = {
|
|
|
151
151
|
backgroundColor: token('color.background.information.bold.pressed'),
|
|
152
152
|
},
|
|
153
153
|
}),
|
|
154
|
+
'elevation.surface': css({
|
|
155
|
+
':active': { backgroundColor: token('elevation.surface.pressed') },
|
|
156
|
+
}),
|
|
157
|
+
'elevation.surface.raised': css({
|
|
158
|
+
':active': { backgroundColor: token('elevation.surface.raised.pressed') },
|
|
159
|
+
}),
|
|
160
|
+
'elevation.surface.overlay': css({
|
|
161
|
+
':active': { backgroundColor: token('elevation.surface.overlay.pressed') },
|
|
162
|
+
}),
|
|
154
163
|
};
|
|
155
164
|
|
|
156
165
|
const backgroundHoverColorMap = {
|
|
@@ -228,6 +237,15 @@ const backgroundHoverColorMap = {
|
|
|
228
237
|
backgroundColor: token('color.background.information.bold.hovered'),
|
|
229
238
|
},
|
|
230
239
|
}),
|
|
240
|
+
'elevation.surface': css({
|
|
241
|
+
':hover': { backgroundColor: token('elevation.surface.hovered') },
|
|
242
|
+
}),
|
|
243
|
+
'elevation.surface.raised': css({
|
|
244
|
+
':hover': { backgroundColor: token('elevation.surface.raised.hovered') },
|
|
245
|
+
}),
|
|
246
|
+
'elevation.surface.overlay': css({
|
|
247
|
+
':hover': { backgroundColor: token('elevation.surface.overlay.hovered') },
|
|
248
|
+
}),
|
|
231
249
|
};
|
|
232
250
|
|
|
233
251
|
type InteractionBackgroundColor = keyof typeof backgroundHoverColorMap;
|
|
@@ -142,8 +142,7 @@ const Text: FC<TextProps> = ({
|
|
|
142
142
|
}: TextProps) => {
|
|
143
143
|
const surface = useSurface();
|
|
144
144
|
// @ts-ignore
|
|
145
|
-
const [color = colorMap[surface]
|
|
146
|
-
colorTuple || [];
|
|
145
|
+
const [color = colorMap[surface], fallback] = colorTuple || [];
|
|
147
146
|
invariant(
|
|
148
147
|
asAllowlist.includes(Component),
|
|
149
148
|
`@atlaskit/ds-explorations: Text received an invalid "as" value of "${Component}"`,
|