diff --git a/.changeset/dirty-parks-kick.md b/.changeset/dirty-parks-kick.md new file mode 100644 index 0000000000..fbe48528ca --- /dev/null +++ b/.changeset/dirty-parks-kick.md @@ -0,0 +1,5 @@ +--- +"@ultraviolet/ui": patch +--- + +`Alert`: add "size" prop diff --git a/packages/form/src/components/SubmitErrorAlert/__tests__/__snapshots__/index.test.tsx.snap b/packages/form/src/components/SubmitErrorAlert/__tests__/__snapshots__/index.test.tsx.snap index c66eed4296..360c91dd98 100644 --- a/packages/form/src/components/SubmitErrorAlert/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/form/src/components/SubmitErrorAlert/__tests__/__snapshots__/index.test.tsx.snap @@ -17,10 +17,10 @@ exports[`submitErrorAlert > should display an alert when submitError is present Submit
should display an alert when submitError is present />

render with alert 1`] = ` This summary provides a cost estimation based on your configuration, the amount of time you expect to use the resource for, and the scale of your expected usage. For the purposes of this calculation, we consider that 1 month equals to 730 hours.

render with alert 1`] = ` />
) => ( + <> + alert('Button clicked')} + title="title" + > + This is an Alert. + + + alert('Button clicked')} + size="small" + title="title" + > + This is a small alert + + alert('Button clicked')} + size="small" + title="title" + > + Small alert with long children. Lorem ipsum dolor sit amet, consectetur + adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore + magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco + laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa + qui officia deserunt mollit anim id est laborum., + + +) + +Size.decorators = [ + StoryComponent => ( + + + + ), +] as Decorator[] + +Size.parameters = { + docs: { + description: { + story: + 'Using `sentiment` prop you can change the sentiment of the component. Each sentiment has a default icon set.', + }, + }, +} diff --git a/packages/ui/src/components/Alert/__stories__/index.stories.tsx b/packages/ui/src/components/Alert/__stories__/index.stories.tsx index 373aa35200..b253b417f0 100644 --- a/packages/ui/src/components/Alert/__stories__/index.stories.tsx +++ b/packages/ui/src/components/Alert/__stories__/index.stories.tsx @@ -11,5 +11,6 @@ export { Title } from './Title.stories' export { Button } from './Button.stories' export { Link } from './Link.stories' export { Sentiments } from './Sentiments.stories' +export { Size } from './Size.stories' export { Closable } from './Closable.stories' export { LongChildren } from './LongChildren.stories' diff --git a/packages/ui/src/components/Alert/__tests__/__snapshots__/index.test.tsx.snap b/packages/ui/src/components/Alert/__tests__/__snapshots__/index.test.tsx.snap index ae3eb425b8..1335d8d030 100644 --- a/packages/ui/src/components/Alert/__tests__/__snapshots__/index.test.tsx.snap +++ b/packages/ui/src/components/Alert/__tests__/__snapshots__/index.test.tsx.snap @@ -1,15 +1,62 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html +exports[`alert > renders correctly small 1`] = ` + +
+
+
+
+ + + +
+ + title + +

+ Sample Alert +

+
+
+
+
+
+
+`; + exports[`alert > renders correctly with all sentiments > renders correctly sentiment 'danger' 1`] = `
renders correctly with all sentiments > renders correctly senti />

renders correctly with all sentiments > renders correctly senti data-testid="testing" >

renders correctly with all sentiments > renders correctly senti />

renders correctly with all sentiments > renders correctly senti data-testid="testing" >

renders correctly with all sentiments > renders correctly senti />

renders correctly with all sentiments > renders correctly senti data-testid="testing" >

renders correctly with all sentiments > renders correctly senti />

renders correctly with all sentiments > renders correctly senti data-testid="testing" >

renders correctly with all sentiments > renders correctly senti />

renders correctly with buttonText and onClickButton 1`] = ` data-testid="testing" >

renders correctly with buttonText and onClickButton 1`] = ` />

renders correctly with buttonText and onClickButton 1`] = `