diff --git a/.changeset/gorgeous-pants-check.md b/.changeset/gorgeous-pants-check.md new file mode 100644 index 00000000000..2bec590f021 --- /dev/null +++ b/.changeset/gorgeous-pants-check.md @@ -0,0 +1,9 @@ +--- +"@aws-amplify/ui-react": patch +--- + +feat(primitives): adds support inert prop on all React primitives + +```jsx + +``` diff --git a/docs/src/data/test/__snapshots__/props-table.test.ts.snap b/docs/src/data/test/__snapshots__/props-table.test.ts.snap index ab981788292..d91d2cfea5f 100644 --- a/docs/src/data/test/__snapshots__/props-table.test.ts.snap +++ b/docs/src/data/test/__snapshots__/props-table.test.ts.snap @@ -27,6 +27,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -277,6 +284,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -730,6 +744,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -889,6 +910,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"form\\": { \\"name\\": \\"form\\", \\"type\\": \\"string\\", @@ -1209,6 +1237,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -1361,6 +1396,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -1716,6 +1758,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"type\\": { \\"name\\": \\"type\\", \\"type\\": \\"'list' | 'grid' | 'table'\\", @@ -1980,6 +2029,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"string\\", @@ -2146,6 +2202,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -2338,6 +2401,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -2504,6 +2574,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -2754,6 +2831,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"area\\": { \\"name\\": \\"area\\", \\"type\\": \\"ResponsiveStyle\\", @@ -3088,6 +3172,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -3254,6 +3345,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -3413,6 +3511,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -3600,6 +3705,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -3801,6 +3913,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -3974,6 +4093,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -4168,6 +4294,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -4409,6 +4542,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -4657,6 +4797,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"children\\": { \\"name\\": \\"children\\", \\"type\\": \\"React.ReactNode\\", @@ -4921,6 +5068,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -5143,6 +5297,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -5554,6 +5715,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -5986,6 +6154,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -6145,6 +6320,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -6498,6 +6680,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -6755,6 +6944,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -7005,6 +7201,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -7157,6 +7360,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -7568,6 +7778,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -7895,6 +8112,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -8369,6 +8593,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -8794,6 +9025,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -9184,6 +9422,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"caption\\": { \\"name\\": \\"caption\\", \\"type\\": \\"React.ReactNode\\", @@ -9376,6 +9621,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -9519,6 +9771,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -9676,6 +9935,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -9819,6 +10085,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -9962,6 +10235,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -10107,6 +10387,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -10348,6 +10635,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"title\\": { \\"name\\": \\"title\\", \\"type\\": \\"React.ReactNode\\", @@ -10500,6 +10794,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -10659,6 +10960,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -10986,6 +11294,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"label\\": { \\"name\\": \\"label\\", \\"type\\": \\"React.ReactNode\\", @@ -11404,6 +11719,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -11680,6 +12002,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", @@ -11951,6 +12280,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"Base\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\n https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"Base\\", + \\"isOptional\\": true + }, \\"ariaLabel\\": { \\"name\\": \\"ariaLabel\\", \\"type\\": \\"AriaAttributes['aria-label']\\", @@ -12477,6 +12813,13 @@ exports[`Props Table 1`] = ` \\"category\\": \\"BaseComponentProps\\", \\"isOptional\\": true }, + \\"inert\\": { + \\"name\\": \\"inert\\", + \\"type\\": \\"boolean\\", + \\"description\\": \\"Support for the HTML \`inert\` attribute\\\\nhttps://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert\\", + \\"category\\": \\"BaseComponentProps\\", + \\"isOptional\\": true + }, \\"style\\": { \\"name\\": \\"style\\", \\"type\\": \\"React.CSSProperties\\", diff --git a/packages/react/__tests__/__snapshots__/exports.ts.snap b/packages/react/__tests__/__snapshots__/exports.ts.snap index 3f386ee419a..14f1546de2e 100644 --- a/packages/react/__tests__/__snapshots__/exports.ts.snap +++ b/packages/react/__tests__/__snapshots__/exports.ts.snap @@ -422,6 +422,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -1013,6 +1016,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "innerEndComponent": Object { "type": "string", }, @@ -1594,6 +1600,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -2138,6 +2147,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -2684,6 +2696,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -3195,6 +3210,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -3764,6 +3782,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -4164,6 +4185,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "isDisabled": Object { "type": "boolean", }, @@ -4609,6 +4633,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -5122,6 +5149,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -5633,6 +5663,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -6135,6 +6168,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -6661,6 +6697,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -7193,6 +7232,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -7721,6 +7763,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -8233,6 +8278,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -8739,6 +8787,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -9456,6 +9507,9 @@ Object { "in2": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "intercept": Object { "type": "string", }, @@ -10357,6 +10411,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -10886,6 +10943,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -11628,6 +11688,9 @@ Object { "in2": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "intercept": Object { "type": "string", }, @@ -12547,6 +12610,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -13106,6 +13172,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -13470,6 +13539,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "isDisabled": Object { "type": "boolean", }, @@ -13928,6 +14000,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -14518,6 +14593,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "innerEndComponent": Object { "type": "string", }, @@ -15198,6 +15276,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "innerEndComponent": Object { "type": "string", }, @@ -15781,6 +15862,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -16332,6 +16416,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -16922,6 +17009,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -17480,6 +17570,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -17997,6 +18090,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -18575,6 +18671,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "innerEndComponent": Object { "type": "string", }, @@ -19198,6 +19297,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -19778,6 +19880,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "innerEndComponent": Object { "type": "string", }, @@ -20432,6 +20537,9 @@ Object { "increaseButtonLabel": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "innerEndComponent": Object { "type": "string", }, @@ -21053,6 +21161,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -21632,6 +21743,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -22149,6 +22263,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -22654,6 +22771,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -23162,6 +23282,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -23661,6 +23784,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -24157,6 +24283,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -24653,6 +24782,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -25173,6 +25305,9 @@ Object { "indicatorPosition": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -25685,6 +25820,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -26230,6 +26368,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -26856,6 +26997,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "innerEndComponent": Object { "type": "string", }, @@ -27481,6 +27625,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -28028,6 +28175,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, @@ -28555,6 +28705,9 @@ Object { "id": Object { "type": "string", }, + "inert": Object { + "type": "boolean", + }, "inputMode": Object { "type": "string", }, diff --git a/packages/react/src/primitives/View/View.tsx b/packages/react/src/primitives/View/View.tsx index 725a7b88d9b..8cf29d59b6d 100644 --- a/packages/react/src/primitives/View/View.tsx +++ b/packages/react/src/primitives/View/View.tsx @@ -15,6 +15,7 @@ const ViewPrimitive = ( ariaLabel, isDisabled, style, + inert, ...rest }: PrimitivePropsWithRef, ref?: React.ForwardedRef> @@ -28,6 +29,7 @@ const ViewPrimitive = ( 'data-testid': testId, disabled: isDisabled, ref, + inert: inert ? '' : null, style: propStyles, ...nonStyleProps, }, diff --git a/packages/react/src/primitives/View/__tests__/View.test.tsx b/packages/react/src/primitives/View/__tests__/View.test.tsx index a5817451002..75b1c1d7f68 100644 --- a/packages/react/src/primitives/View/__tests__/View.test.tsx +++ b/packages/react/src/primitives/View/__tests__/View.test.tsx @@ -135,4 +135,11 @@ describe('View: ', () => { ) ).toBe('blue'); }); + + it('should work with inert', async () => { + const testId = 'inertTest'; + render(); + const view = await screen.findByTestId(testId); + expect(view).toHaveAttribute('inert'); + }); }); diff --git a/packages/react/src/primitives/types/base.ts b/packages/react/src/primitives/types/base.ts index 3d29a1215e0..6a84653ff7e 100644 --- a/packages/react/src/primitives/types/base.ts +++ b/packages/react/src/primitives/types/base.ts @@ -19,6 +19,13 @@ export interface BaseComponentProps { * Used to provide a `data-testid` attribute for testing purposes */ testId?: string; + + /** + * @description + * Support for the HTML `inert` attribute + * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert + */ + inert?: boolean; } export interface AriaProps {