@ndlib/component-library 0.0.7-9.1
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/README.md +101 -0
- package/dist/FontLoader.d.ts +1 -0
- package/dist/FontLoader.js +4 -0
- package/dist/components/composites/Card/Card.stories.d.ts +13 -0
- package/dist/components/composites/Card/Card.stories.js +122 -0
- package/dist/components/composites/Card/Card.test.d.ts +1 -0
- package/dist/components/composites/Card/Card.test.js +37 -0
- package/dist/components/composites/Card/index.d.ts +36 -0
- package/dist/components/composites/Card/index.js +89 -0
- package/dist/components/composites/DragDropList/DragDropList.stories.d.ts +7 -0
- package/dist/components/composites/DragDropList/DragDropList.stories.js +32 -0
- package/dist/components/composites/DragDropList/index.d.ts +25 -0
- package/dist/components/composites/DragDropList/index.js +48 -0
- package/dist/components/composites/DropdownLinks/DropdownLinks.stories.d.ts +8 -0
- package/dist/components/composites/DropdownLinks/DropdownLinks.stories.js +25 -0
- package/dist/components/composites/DropdownLinks/DropdownLinks.test.d.ts +1 -0
- package/dist/components/composites/DropdownLinks/DropdownLinks.test.js +27 -0
- package/dist/components/composites/DropdownLinks/index.d.ts +15 -0
- package/dist/components/composites/DropdownLinks/index.js +28 -0
- package/dist/components/composites/EmptyState/EmptyState.stories.d.ts +10 -0
- package/dist/components/composites/EmptyState/EmptyState.stories.js +31 -0
- package/dist/components/composites/EmptyState/EmptyState.test.d.ts +1 -0
- package/dist/components/composites/EmptyState/EmptyState.test.js +20 -0
- package/dist/components/composites/EmptyState/index.d.ts +15 -0
- package/dist/components/composites/EmptyState/index.js +32 -0
- package/dist/components/composites/Modal/Modal.stories.d.ts +6 -0
- package/dist/components/composites/Modal/Modal.stories.js +40 -0
- package/dist/components/composites/Modal/index.d.ts +21 -0
- package/dist/components/composites/Modal/index.js +64 -0
- package/dist/components/composites/NavMenu/NavMenu.stories.d.ts +6 -0
- package/dist/components/composites/NavMenu/NavMenu.stories.js +12 -0
- package/dist/components/composites/NavMenu/NavMenu.test.d.ts +1 -0
- package/dist/components/composites/NavMenu/NavMenu.test.js +96 -0
- package/dist/components/composites/NavMenu/demo.d.ts +1 -0
- package/dist/components/composites/NavMenu/demo.js +172 -0
- package/dist/components/composites/NavMenu/index.d.ts +5 -0
- package/dist/components/composites/NavMenu/index.js +52 -0
- package/dist/components/composites/Seo/SeoDataDisplay/index.d.ts +2 -0
- package/dist/components/composites/Seo/SeoDataDisplay/index.js +9 -0
- package/dist/components/composites/Seo/index.d.ts +11 -0
- package/dist/components/composites/Seo/index.js +16 -0
- package/dist/components/composites/Seo/seo.stories.d.ts +6 -0
- package/dist/components/composites/Seo/seo.stories.js +12 -0
- package/dist/components/composites/Seo/seo.test.d.ts +1 -0
- package/dist/components/composites/Seo/seo.test.js +56 -0
- package/dist/components/composites/Seo/siteMetadata.d.ts +9 -0
- package/dist/components/composites/Seo/siteMetadata.js +16 -0
- package/dist/components/composites/SnackBar/SnackBar.stories.d.ts +8 -0
- package/dist/components/composites/SnackBar/SnackBar.stories.js +20 -0
- package/dist/components/composites/SnackBar/SnackBar.test.d.ts +1 -0
- package/dist/components/composites/SnackBar/SnackBar.test.js +75 -0
- package/dist/components/composites/SnackBar/examples.d.ts +3 -0
- package/dist/components/composites/SnackBar/examples.js +35 -0
- package/dist/components/composites/SnackBar/index.d.ts +1 -0
- package/dist/components/composites/SnackBar/index.js +45 -0
- package/dist/components/composites/StructuredData/StructuredData.stories.d.ts +6 -0
- package/dist/components/composites/StructuredData/StructuredData.stories.js +12 -0
- package/dist/components/composites/StructuredData/StructuredData.test.d.ts +1 -0
- package/dist/components/composites/StructuredData/StructuredData.test.js +48 -0
- package/dist/components/composites/StructuredData/StructuredDataDisplay/index.d.ts +2 -0
- package/dist/components/composites/StructuredData/StructuredDataDisplay/index.js +37 -0
- package/dist/components/composites/StructuredData/index.d.ts +38 -0
- package/dist/components/composites/StructuredData/index.js +58 -0
- package/dist/components/composites/StructuredData/sdEvent/index.d.ts +13 -0
- package/dist/components/composites/StructuredData/sdEvent/index.js +16 -0
- package/dist/components/composites/StructuredData/sdEvent/makeEventSchema.d.ts +15 -0
- package/dist/components/composites/StructuredData/sdEvent/makeEventSchema.js +16 -0
- package/dist/components/composites/StructuredData/sdNews/index.d.ts +11 -0
- package/dist/components/composites/StructuredData/sdNews/index.js +14 -0
- package/dist/components/composites/StructuredData/sdNews/makeNewsSchema.d.ts +12 -0
- package/dist/components/composites/StructuredData/sdNews/makeNewsSchema.js +11 -0
- package/dist/components/composites/StructuredData/sdWebsite/index.d.ts +8 -0
- package/dist/components/composites/StructuredData/sdWebsite/index.js +11 -0
- package/dist/components/composites/StructuredData/sdWebsite/makeWebPageSchema.d.ts +9 -0
- package/dist/components/composites/StructuredData/sdWebsite/makeWebPageSchema.js +9 -0
- package/dist/components/composites/StructuredData/siteMetadata.d.ts +9 -0
- package/dist/components/composites/StructuredData/siteMetadata.js +12 -0
- package/dist/components/elements/Alerts/Alert.stories.d.ts +9 -0
- package/dist/components/elements/Alerts/Alert.stories.js +41 -0
- package/dist/components/elements/Alerts/Alerts.stories.d.ts +6 -0
- package/dist/components/elements/Alerts/Alerts.stories.js +12 -0
- package/dist/components/elements/Alerts/Alerts.test.d.ts +1 -0
- package/dist/components/elements/Alerts/Alerts.test.js +61 -0
- package/dist/components/elements/Alerts/index.d.ts +14 -0
- package/dist/components/elements/Alerts/index.js +64 -0
- package/dist/components/elements/ArrowLink/ArrowLink.stories.d.ts +6 -0
- package/dist/components/elements/ArrowLink/ArrowLink.stories.js +12 -0
- package/dist/components/elements/ArrowLink/ArrowLink.test.d.ts +1 -0
- package/dist/components/elements/ArrowLink/ArrowLink.test.js +34 -0
- package/dist/components/elements/ArrowLink/index.d.ts +7 -0
- package/dist/components/elements/ArrowLink/index.js +39 -0
- package/dist/components/elements/BrandingBar/BrandingBar.stories.d.ts +6 -0
- package/dist/components/elements/BrandingBar/BrandingBar.stories.js +11 -0
- package/dist/components/elements/BrandingBar/index.d.ts +2 -0
- package/dist/components/elements/BrandingBar/index.js +52 -0
- package/dist/components/elements/Button/Button.stories.d.ts +15 -0
- package/dist/components/elements/Button/Button.stories.js +88 -0
- package/dist/components/elements/Button/Button.test.d.ts +1 -0
- package/dist/components/elements/Button/Button.test.js +39 -0
- package/dist/components/elements/Button/index.d.ts +49 -0
- package/dist/components/elements/Button/index.js +138 -0
- package/dist/components/elements/Dropdown/Dropdown.stories.d.ts +7 -0
- package/dist/components/elements/Dropdown/Dropdown.stories.js +20 -0
- package/dist/components/elements/Dropdown/index.d.ts +24 -0
- package/dist/components/elements/Dropdown/index.js +87 -0
- package/dist/components/elements/Fields/AutoComplete/AutoComplete.stories.d.ts +6 -0
- package/dist/components/elements/Fields/AutoComplete/AutoComplete.stories.js +60 -0
- package/dist/components/elements/Fields/AutoComplete/index.d.ts +11 -0
- package/dist/components/elements/Fields/AutoComplete/index.js +26 -0
- package/dist/components/elements/Fields/Checkbox/Checkbox.stories.d.ts +6 -0
- package/dist/components/elements/Fields/Checkbox/Checkbox.stories.js +17 -0
- package/dist/components/elements/Fields/Checkbox/index.d.ts +8 -0
- package/dist/components/elements/Fields/Checkbox/index.js +22 -0
- package/dist/components/elements/Fields/CheckboxGroup/CheckboxGroup.stories.d.ts +7 -0
- package/dist/components/elements/Fields/CheckboxGroup/CheckboxGroup.stories.js +26 -0
- package/dist/components/elements/Fields/CheckboxGroup/index.d.ts +16 -0
- package/dist/components/elements/Fields/CheckboxGroup/index.js +49 -0
- package/dist/components/elements/Fields/DatePicker/DatePicker.stories.d.ts +8 -0
- package/dist/components/elements/Fields/DatePicker/DatePicker.stories.js +31 -0
- package/dist/components/elements/Fields/DatePicker/index.d.ts +20 -0
- package/dist/components/elements/Fields/DatePicker/index.js +48 -0
- package/dist/components/elements/Fields/MonthPicker/MonthPicker.stories.d.ts +7 -0
- package/dist/components/elements/Fields/MonthPicker/MonthPicker.stories.js +20 -0
- package/dist/components/elements/Fields/MonthPicker/index.d.ts +13 -0
- package/dist/components/elements/Fields/MonthPicker/index.js +24 -0
- package/dist/components/elements/Fields/Radio/Radio.stories.d.ts +6 -0
- package/dist/components/elements/Fields/Radio/Radio.stories.js +17 -0
- package/dist/components/elements/Fields/Radio/index.d.ts +8 -0
- package/dist/components/elements/Fields/Radio/index.js +22 -0
- package/dist/components/elements/Fields/RadioGroup/RadioGroup.stories.d.ts +6 -0
- package/dist/components/elements/Fields/RadioGroup/RadioGroup.stories.js +23 -0
- package/dist/components/elements/Fields/RadioGroup/index.d.ts +14 -0
- package/dist/components/elements/Fields/RadioGroup/index.js +28 -0
- package/dist/components/elements/Fields/Select/Select.stories.d.ts +8 -0
- package/dist/components/elements/Fields/Select/Select.stories.js +39 -0
- package/dist/components/elements/Fields/Select/index.d.ts +18 -0
- package/dist/components/elements/Fields/Select/index.js +178 -0
- package/dist/components/elements/Fields/TextInput/TextInput.stories.d.ts +9 -0
- package/dist/components/elements/Fields/TextInput/TextInput.stories.js +35 -0
- package/dist/components/elements/Fields/TextInput/index.d.ts +45 -0
- package/dist/components/elements/Fields/TextInput/index.js +119 -0
- package/dist/components/elements/Fields/option.d.ts +16 -0
- package/dist/components/elements/Fields/option.js +3 -0
- package/dist/components/elements/Group/index.d.ts +22 -0
- package/dist/components/elements/Group/index.js +69 -0
- package/dist/components/elements/Icon/Icon.stories.d.ts +7 -0
- package/dist/components/elements/Icon/Icon.stories.js +29 -0
- package/dist/components/elements/Icon/Icon.test.d.ts +1 -0
- package/dist/components/elements/Icon/Icon.test.js +26 -0
- package/dist/components/elements/Icon/index.d.ts +10 -0
- package/dist/components/elements/Icon/index.js +34 -0
- package/dist/components/elements/Link/Link.stories.d.ts +6 -0
- package/dist/components/elements/Link/Link.stories.js +21 -0
- package/dist/components/elements/Link/Link.test.d.ts +1 -0
- package/dist/components/elements/Link/Link.test.js +58 -0
- package/dist/components/elements/Link/index.d.ts +14 -0
- package/dist/components/elements/Link/index.js +41 -0
- package/dist/components/elements/List/List.stories.d.ts +10 -0
- package/dist/components/elements/List/List.stories.js +37 -0
- package/dist/components/elements/List/List.test.d.ts +1 -0
- package/dist/components/elements/List/List.test.js +24 -0
- package/dist/components/elements/List/index.d.ts +27 -0
- package/dist/components/elements/List/index.js +103 -0
- package/dist/components/elements/ListBox/Listbox.stories.d.ts +6 -0
- package/dist/components/elements/ListBox/Listbox.stories.js +17 -0
- package/dist/components/elements/ListBox/index.d.ts +33 -0
- package/dist/components/elements/ListBox/index.js +51 -0
- package/dist/components/elements/Markdown/Markdown.stories.d.ts +10 -0
- package/dist/components/elements/Markdown/Markdown.stories.js +97 -0
- package/dist/components/elements/Markdown/Markdown.test.d.ts +1 -0
- package/dist/components/elements/Markdown/Markdown.test.js +91 -0
- package/dist/components/elements/Markdown/index.d.ts +21 -0
- package/dist/components/elements/Markdown/index.js +75 -0
- package/dist/components/elements/Pill/Pill.stories.d.ts +8 -0
- package/dist/components/elements/Pill/Pill.stories.js +40 -0
- package/dist/components/elements/Pill/Pill.test.d.ts +1 -0
- package/dist/components/elements/Pill/Pill.test.js +18 -0
- package/dist/components/elements/Pill/index.d.ts +21 -0
- package/dist/components/elements/Pill/index.js +117 -0
- package/dist/components/elements/Spinner/Spinner.stories.d.ts +7 -0
- package/dist/components/elements/Spinner/Spinner.stories.js +26 -0
- package/dist/components/elements/Spinner/Spinner.test.d.ts +1 -0
- package/dist/components/elements/Spinner/Spinner.test.js +9 -0
- package/dist/components/elements/Spinner/index.d.ts +14 -0
- package/dist/components/elements/Spinner/index.js +49 -0
- package/dist/components/elements/TabList/TabList.stories.d.ts +6 -0
- package/dist/components/elements/TabList/TabList.stories.js +12 -0
- package/dist/components/elements/TabList/TabList.test.d.ts +1 -0
- package/dist/components/elements/TabList/TabList.test.js +19 -0
- package/dist/components/elements/TabList/example.d.ts +7 -0
- package/dist/components/elements/TabList/example.js +36 -0
- package/dist/components/elements/TabList/index.d.ts +10 -0
- package/dist/components/elements/TabList/index.js +30 -0
- package/dist/components/elements/Table/Table.stories.d.ts +10 -0
- package/dist/components/elements/Table/Table.stories.js +96 -0
- package/dist/components/elements/Table/Table.test.d.ts +1 -0
- package/dist/components/elements/Table/Table.test.js +36 -0
- package/dist/components/elements/Table/index.d.ts +30 -0
- package/dist/components/elements/Table/index.js +100 -0
- package/dist/components/elements/layout/Box.d.ts +9 -0
- package/dist/components/elements/layout/Box.js +3 -0
- package/dist/components/elements/layout/Box.stories.d.ts +6 -0
- package/dist/components/elements/layout/Box.stories.js +12 -0
- package/dist/components/elements/layout/Column.d.ts +8 -0
- package/dist/components/elements/layout/Column.js +19 -0
- package/dist/components/elements/layout/Flex.stories.d.ts +10 -0
- package/dist/components/elements/layout/Flex.stories.js +26 -0
- package/dist/components/elements/layout/Flex.test.d.ts +1 -0
- package/dist/components/elements/layout/Flex.test.js +34 -0
- package/dist/components/elements/layout/Row.d.ts +20 -0
- package/dist/components/elements/layout/Row.js +52 -0
- package/dist/components/elements/text/Heading/Heading.stories.d.ts +8 -0
- package/dist/components/elements/text/Heading/Heading.stories.js +35 -0
- package/dist/components/elements/text/Heading/Heading.test.d.ts +1 -0
- package/dist/components/elements/text/Heading/Heading.test.js +51 -0
- package/dist/components/elements/text/Heading/index.d.ts +20 -0
- package/dist/components/elements/text/Heading/index.js +62 -0
- package/dist/components/elements/text/Inline/Inline.stories.d.ts +6 -0
- package/dist/components/elements/text/Inline/Inline.stories.js +12 -0
- package/dist/components/elements/text/Inline/index.d.ts +6 -0
- package/dist/components/elements/text/Inline/index.js +21 -0
- package/dist/components/elements/text/Label/Label.stories.d.ts +6 -0
- package/dist/components/elements/text/Label/Label.stories.js +20 -0
- package/dist/components/elements/text/Label/Label.test.d.ts +1 -0
- package/dist/components/elements/text/Label/Label.test.js +56 -0
- package/dist/components/elements/text/Label/index.d.ts +20 -0
- package/dist/components/elements/text/Label/index.js +38 -0
- package/dist/components/elements/text/Paragraph/Paragraph.stories.d.ts +6 -0
- package/dist/components/elements/text/Paragraph/Paragraph.stories.js +25 -0
- package/dist/components/elements/text/Paragraph/Paragraph.test.d.ts +1 -0
- package/dist/components/elements/text/Paragraph/Paragraph.test.js +9 -0
- package/dist/components/elements/text/Paragraph/index.d.ts +14 -0
- package/dist/components/elements/text/Paragraph/index.js +29 -0
- package/dist/components/elements/text/ReadMore/ReadMore.stories.d.ts +8 -0
- package/dist/components/elements/text/ReadMore/ReadMore.stories.js +26 -0
- package/dist/components/elements/text/ReadMore/index.d.ts +12 -0
- package/dist/components/elements/text/ReadMore/index.js +71 -0
- package/dist/components/providers/alerts.d.ts +41 -0
- package/dist/components/providers/alerts.js +133 -0
- package/dist/components/providers/componentConfig.d.ts +25 -0
- package/dist/components/providers/componentConfig.js +37 -0
- package/dist/components/providers/dialogs.d.ts +9 -0
- package/dist/components/providers/dialogs.js +32 -0
- package/dist/components/providers/env.d.ts +14 -0
- package/dist/components/providers/env.js +25 -0
- package/dist/components/providers/media.d.ts +8 -0
- package/dist/components/providers/media.js +43 -0
- package/dist/components/providers/menu.d.ts +46 -0
- package/dist/components/providers/menu.js +304 -0
- package/dist/components/providers/snackBar.d.ts +23 -0
- package/dist/components/providers/snackBar.js +53 -0
- package/dist/components/providers/ui.d.ts +18 -0
- package/dist/components/providers/ui.js +16 -0
- package/dist/components/providers/uniqueIds.d.ts +3 -0
- package/dist/components/providers/uniqueIds.js +23 -0
- package/dist/components/providers/uniqueIds.test.d.ts +1 -0
- package/dist/components/providers/uniqueIds.test.js +26 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +51 -0
- package/dist/theme/Color.stories.d.ts +5 -0
- package/dist/theme/Color.stories.js +63 -0
- package/dist/theme/GlobalStyles.d.ts +1 -0
- package/dist/theme/GlobalStyles.js +167 -0
- package/dist/theme/Typography.stories.d.ts +5 -0
- package/dist/theme/Typography.stories.js +44 -0
- package/dist/theme/colors.d.ts +51 -0
- package/dist/theme/colors.js +97 -0
- package/dist/theme/custom.d.ts +11 -0
- package/dist/theme/custom.js +13 -0
- package/dist/theme/index.d.ts +185 -0
- package/dist/theme/index.js +25 -0
- package/dist/theme/spacing.d.ts +0 -0
- package/dist/theme/spacing.js +1 -0
- package/dist/theme/typography.d.ts +100 -0
- package/dist/theme/typography.js +206 -0
- package/dist/utils/hooks/useCheckMidClick.d.ts +8 -0
- package/dist/utils/hooks/useCheckMidClick.js +17 -0
- package/dist/utils/hooks/useCheckMidKeyPress.d.ts +9 -0
- package/dist/utils/hooks/useCheckMidKeyPress.js +23 -0
- package/dist/utils/hooks/useHover.d.ts +7 -0
- package/dist/utils/hooks/useHover.js +12 -0
- package/dist/utils/hooks/useStorage.d.ts +14 -0
- package/dist/utils/hooks/useStorage.js +37 -0
- package/dist/utils/misc.d.ts +14 -0
- package/dist/utils/misc.js +19 -0
- package/dist/utils/sortByKey.d.ts +12 -0
- package/dist/utils/sortByKey.js +20 -0
- package/dist/utils/test.d.ts +2 -0
- package/dist/utils/test.js +9 -0
- package/package.json +98 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const makeNewsSchema = (params) => {
|
|
2
|
+
return {
|
|
3
|
+
'@type': 'NewsArticle',
|
|
4
|
+
name: params.title,
|
|
5
|
+
creator: params.author,
|
|
6
|
+
abstract: params.abstract,
|
|
7
|
+
image: params.image,
|
|
8
|
+
url: params.siteUrl + '/news/' + params.url,
|
|
9
|
+
datePublished: params.publishedDate,
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { makeWebPageSchema } from './makeWebPageSchema';
|
|
2
|
+
export const stringifyWebpageSchema = ({ lang, name, description, url, }) => {
|
|
3
|
+
const webpageSchema = makeWebPageSchema({
|
|
4
|
+
lang: lang,
|
|
5
|
+
name: name,
|
|
6
|
+
description: description,
|
|
7
|
+
url: url,
|
|
8
|
+
});
|
|
9
|
+
return JSON.stringify(webpageSchema, null, 2);
|
|
10
|
+
};
|
|
11
|
+
export default stringifyWebpageSchema;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export const siteMetadata = () => {
|
|
2
|
+
const data = {
|
|
3
|
+
title: 'Hesburgh Component Library',
|
|
4
|
+
image: '/images/fakeimage.png',
|
|
5
|
+
description: 'Component library for the Hesburgh Libraries',
|
|
6
|
+
twitterUsername: 'hlibraries',
|
|
7
|
+
siteUrl: 'https://www.library.nd.edu',
|
|
8
|
+
nofollow: false,
|
|
9
|
+
noindex: false,
|
|
10
|
+
};
|
|
11
|
+
return data;
|
|
12
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Alert } from '.';
|
|
3
|
+
declare const meta: Meta<typeof Alert>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Alert>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const InformationalAlert: Story;
|
|
8
|
+
export declare const YellowAlert: Story;
|
|
9
|
+
export declare const WarningAlert: Story;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Alert } from '.';
|
|
3
|
+
import { ALERT_TYPE } from '../../providers/alerts';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Elements/Alert',
|
|
6
|
+
component: Alert,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: (args) => _jsx(Alert, Object.assign({}, args)),
|
|
12
|
+
args: {
|
|
13
|
+
title: 'Informational Alert',
|
|
14
|
+
type: ALERT_TYPE.INFORMATIONAL,
|
|
15
|
+
description: 'This is an informational alert',
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
export const InformationalAlert = {
|
|
19
|
+
render: (args) => _jsx(Alert, Object.assign({}, args)),
|
|
20
|
+
args: {
|
|
21
|
+
title: 'Informational Alert',
|
|
22
|
+
type: ALERT_TYPE.INFORMATIONAL,
|
|
23
|
+
description: 'This is an informational alert',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export const YellowAlert = {
|
|
27
|
+
render: (args) => _jsx(Alert, Object.assign({}, args)),
|
|
28
|
+
args: {
|
|
29
|
+
title: 'Informational - Yellow Alert',
|
|
30
|
+
type: ALERT_TYPE.INFORMATIONAL_YELLOW,
|
|
31
|
+
description: 'This is an informational yellow alert',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
export const WarningAlert = {
|
|
35
|
+
render: (args) => _jsx(Alert, Object.assign({}, args)),
|
|
36
|
+
args: {
|
|
37
|
+
title: 'Warning Alert',
|
|
38
|
+
type: ALERT_TYPE.WARNING,
|
|
39
|
+
description: 'This is a warning alert',
|
|
40
|
+
},
|
|
41
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Alerts } from '.';
|
|
3
|
+
import { AlertsProvider } from '../../providers/alerts';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Elements/Alerts',
|
|
6
|
+
component: Alerts,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: () => (_jsx(AlertsProvider, Object.assign({ startTime: new Date('2022-01-01').toISOString(), endTime: new Date('2022-01-01').toISOString(), endpoint: "http://localhost:1337/graphql" }, { children: _jsx(Alerts, {}) }))),
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
import { vi } from 'vitest';
|
|
12
|
+
import { render } from '../../../utils/test';
|
|
13
|
+
import { useAlerts } from '../../providers/alerts';
|
|
14
|
+
import { Alerts } from '.';
|
|
15
|
+
import { useState } from 'react';
|
|
16
|
+
vi.mock('../../providers/alerts', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
+
const actual = yield vi.importActual('../../providers/alerts');
|
|
18
|
+
return Object.assign(Object.assign({}, actual), { useAlerts: vi.fn() });
|
|
19
|
+
}));
|
|
20
|
+
const MOCK_ALERTS = [
|
|
21
|
+
{
|
|
22
|
+
uuid: 'bcb7a31c-4d67-45fa-9ad8-314fac1eace6',
|
|
23
|
+
domains: ['library'],
|
|
24
|
+
startTime: '2020-09-06T04:00:00.000Z',
|
|
25
|
+
endTime: '2020-09-09T04:00:00.000Z',
|
|
26
|
+
title: 'Aleph API down due to DNS problem',
|
|
27
|
+
description: 'Test 1',
|
|
28
|
+
type: 'Warning',
|
|
29
|
+
global: true,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
uuid: 'bcb7a31c-4d67-45fa-9ad8-314fac1eace6',
|
|
33
|
+
domains: ['library'],
|
|
34
|
+
startTime: '2020-09-06T04:00:00.000Z',
|
|
35
|
+
endTime: '2020-09-09T04:00:00.000Z',
|
|
36
|
+
title: 'Aleph API down due to DNS problem',
|
|
37
|
+
description: '__bold__ [Test 2 Link](https://onesearch.library.nd.edu/)',
|
|
38
|
+
type: 'Warning',
|
|
39
|
+
global: true,
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
describe('Alerts', () => {
|
|
43
|
+
const mockUseAlerts = useAlerts;
|
|
44
|
+
beforeEach(() => {
|
|
45
|
+
mockUseAlerts.mockImplementation(() => {
|
|
46
|
+
const [alerts, setAlerts] = useState(MOCK_ALERTS);
|
|
47
|
+
const dismiss = (uuid) => {
|
|
48
|
+
setAlerts(alerts.filter((alert) => alert.uuid !== uuid));
|
|
49
|
+
};
|
|
50
|
+
return { alerts, dismiss };
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
afterEach(() => {
|
|
54
|
+
vi.resetAllMocks();
|
|
55
|
+
});
|
|
56
|
+
it('renders alert content', () => {
|
|
57
|
+
const { getByText, getByRole } = render(_jsx(Alerts, {}));
|
|
58
|
+
expect(getByText('Test 1')).toBeInTheDocument();
|
|
59
|
+
expect(getByRole('link')).toBeInTheDocument();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ALERT_TYPE } from '../../providers/alerts';
|
|
3
|
+
import { StyledElementProps } from '../../../theme';
|
|
4
|
+
type AlertsProps = StyledElementProps<HTMLDivElement, {
|
|
5
|
+
pageAlerts?: string[];
|
|
6
|
+
}>;
|
|
7
|
+
export declare const Alerts: React.FC<AlertsProps>;
|
|
8
|
+
type AlertProps = StyledElementProps<HTMLDivElement, {
|
|
9
|
+
type: ALERT_TYPE;
|
|
10
|
+
description: string;
|
|
11
|
+
dismiss: () => void;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const Alert: React.FC<AlertProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
13
|
+
import _WarningIcon from '@mui/icons-material/Warning';
|
|
14
|
+
import _InfoIcon from '@mui/icons-material/Info';
|
|
15
|
+
import { COLOR } from '../../../theme/colors';
|
|
16
|
+
import { Markdown } from '../Markdown';
|
|
17
|
+
import { Row } from '../layout/Row';
|
|
18
|
+
import { Icon } from '../Icon';
|
|
19
|
+
import { FONT_SIZE } from '../../../theme/typography';
|
|
20
|
+
import { useAlerts, ALERT_TYPE } from '../../providers/alerts';
|
|
21
|
+
import { useTheme } from '../../../theme';
|
|
22
|
+
import { BUTTON_TYPE, Button } from '../Button';
|
|
23
|
+
import { importedDefaultComponentShim } from '../../../utils/misc';
|
|
24
|
+
const WarningIcon = importedDefaultComponentShim(_WarningIcon);
|
|
25
|
+
const InfoIcon = importedDefaultComponentShim(_InfoIcon);
|
|
26
|
+
export const Alerts = (_a) => {
|
|
27
|
+
var { pageAlerts } = _a, rest = __rest(_a, ["pageAlerts"]);
|
|
28
|
+
const { alerts, dismiss } = useAlerts(pageAlerts);
|
|
29
|
+
return (_jsx("div", Object.assign({}, rest, { children: alerts.map((alert, i) => {
|
|
30
|
+
const { type, description } = alert;
|
|
31
|
+
return (_jsx(Alert, { type: type, description: description, css: {
|
|
32
|
+
marginTop: i ? '4px' : 0,
|
|
33
|
+
}, dismiss: () => {
|
|
34
|
+
dismiss(alert.uuid);
|
|
35
|
+
} }, i));
|
|
36
|
+
}) })));
|
|
37
|
+
};
|
|
38
|
+
export const Alert = (_a) => {
|
|
39
|
+
var { type = ALERT_TYPE.INFORMATIONAL, description = '', dismiss } = _a, rest = __rest(_a, ["type", "description", "dismiss"]);
|
|
40
|
+
const theme = useTheme();
|
|
41
|
+
const style = {
|
|
42
|
+
backgroundColor: COLOR.ALERT_INFORMATIONAL_BG,
|
|
43
|
+
boxShadow: theme.boxShadow.NORMAL,
|
|
44
|
+
border: '2px solid',
|
|
45
|
+
borderRadius: '4px',
|
|
46
|
+
borderColor: COLOR.ALERT_INFORMATIONAL_BORDER,
|
|
47
|
+
m: 0,
|
|
48
|
+
p: '1rem',
|
|
49
|
+
};
|
|
50
|
+
if (type === ALERT_TYPE.INFORMATIONAL_YELLOW) {
|
|
51
|
+
style.backgroundColor = COLOR.ALERT_INFORMATIONAL_YELLOW_BG;
|
|
52
|
+
style.borderColor = COLOR.ALERT_INFORMATIONAL_YELLOW_BORDER;
|
|
53
|
+
}
|
|
54
|
+
else if (type === ALERT_TYPE.WARNING) {
|
|
55
|
+
style.backgroundColor = COLOR.ALERT_WARNING_BG;
|
|
56
|
+
style.borderColor = COLOR.ALERT_WARNING_BORDER;
|
|
57
|
+
}
|
|
58
|
+
const icon = {
|
|
59
|
+
[ALERT_TYPE.WARNING]: WarningIcon,
|
|
60
|
+
[ALERT_TYPE.INFORMATIONAL_YELLOW]: InfoIcon,
|
|
61
|
+
[ALERT_TYPE.INFORMATIONAL]: InfoIcon,
|
|
62
|
+
}[type];
|
|
63
|
+
return (_jsxs(Row, Object.assign({ sx: Object.assign({}, style) }, rest, { children: [icon && _jsx(Icon, { icon: icon, sx: { mr: 4 }, size: FONT_SIZE.LG }), _jsx(Markdown, { content: description, sx: { mt: 1, flexGrow: 1 } }), _jsx(Button, Object.assign({ type: BUTTON_TYPE.TEXT, onClick: dismiss, sx: { ml: 4 } }, { children: "Dismiss" }))] })));
|
|
64
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowLink } from '.';
|
|
3
|
+
import { Column } from '../layout/Column';
|
|
4
|
+
import { Box } from '../layout/Box';
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Elements/ArrowLink',
|
|
7
|
+
component: ArrowLink,
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
export const Default = {
|
|
11
|
+
render: () => (_jsx(Column, { children: _jsx(Box, { children: _jsx(ArrowLink, Object.assign({ to: "/" }, { children: "Click Me" })) }) })),
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { render } from '../../../utils/test';
|
|
3
|
+
import { ArrowLink } from '.';
|
|
4
|
+
import { DefaultLink } from '../../providers/componentConfig';
|
|
5
|
+
const CUSTOM_INTERNAL_TEST_ID = 'internal-link-test-id';
|
|
6
|
+
const CUSTOM_EXTERNAL_TEST_ID = 'external-link-test-id';
|
|
7
|
+
const CustomInternalLink = (props) => {
|
|
8
|
+
return _jsx(DefaultLink, Object.assign({ "data-testid": CUSTOM_INTERNAL_TEST_ID }, props));
|
|
9
|
+
};
|
|
10
|
+
const CustomExternalLink = (props) => {
|
|
11
|
+
return _jsx(DefaultLink, Object.assign({ "data-testid": CUSTOM_EXTERNAL_TEST_ID }, props));
|
|
12
|
+
};
|
|
13
|
+
describe('ArrowLink', () => {
|
|
14
|
+
it('renders default external link component without throwing', () => {
|
|
15
|
+
const { getByRole } = render(_jsx(ArrowLink, Object.assign({ to: "https://google.com" }, { children: "Foo" })));
|
|
16
|
+
expect(getByRole('link')).toBeInTheDocument();
|
|
17
|
+
});
|
|
18
|
+
it('renders default internal link component without throwing', () => {
|
|
19
|
+
const { getByRole } = render(_jsx(ArrowLink, Object.assign({ to: "/test/path" }, { children: "Foo" })));
|
|
20
|
+
expect(getByRole('link')).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
|
+
it('passes styles to custom component', () => {
|
|
23
|
+
const { getByTestId } = render(_jsxs(_Fragment, { children: [_jsx(ArrowLink, Object.assign({ to: "https://google.com", sx: { mt: 1 } }, { children: "Foo" })), _jsx(ArrowLink, Object.assign({ to: "/test/route", sx: { mt: 1 } }, { children: "Foo" }))] }), {
|
|
24
|
+
components: {
|
|
25
|
+
link: {
|
|
26
|
+
externalLinkComponent: CustomExternalLink,
|
|
27
|
+
internalLinkComponent: CustomInternalLink,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
expect(getByTestId(CUSTOM_EXTERNAL_TEST_ID)).toHaveStyle(`margin-top: 0.25rem`);
|
|
32
|
+
expect(getByTestId(CUSTOM_INTERNAL_TEST_ID)).toHaveStyle(`margin-top: 0.25rem`);
|
|
33
|
+
});
|
|
34
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
13
|
+
import { COLOR } from '../../../theme/colors';
|
|
14
|
+
import { Link } from '../Link';
|
|
15
|
+
export const ArrowLink = (_a) => {
|
|
16
|
+
var { to, children, sx } = _a, rest = __rest(_a, ["to", "children", "sx"]);
|
|
17
|
+
return (_jsxs(Link, Object.assign({ to: to }, rest, { sx: Object.assign({ display: 'inline-flex', whiteSpace: 'nowrap', padding: 0, flexGrow: 0, position: 'relative', boxSizing: 'border-box', bg: COLOR.WHITE, color: COLOR.PRIMARY, ':hover': {
|
|
18
|
+
transform: 'scale(1.02)',
|
|
19
|
+
bg: COLOR.EXTRA_EXTRA_LIGHT_GRAY,
|
|
20
|
+
}, ':hover>svg': {
|
|
21
|
+
fill: COLOR.EXTRA_EXTRA_LIGHT_GRAY,
|
|
22
|
+
}, '>svg': {
|
|
23
|
+
fill: COLOR.WHITE,
|
|
24
|
+
} }, sx) }, { children: [_jsx("div", Object.assign({ sx: {
|
|
25
|
+
position: 'relative',
|
|
26
|
+
border: '1px solid #a7a7a7',
|
|
27
|
+
'border-width': '1px 0 2px 1px',
|
|
28
|
+
boxSizing: 'border-box',
|
|
29
|
+
padding: '0.125rem 1.5rem 0.125rem 0.5rem',
|
|
30
|
+
height: '100%',
|
|
31
|
+
flex: '1 1 auto',
|
|
32
|
+
} }, { children: children })), _jsxs("svg", Object.assign({ viewBox: "0 0 16 1", preserveAspectRatio: "none", sx: {
|
|
33
|
+
width: '16px',
|
|
34
|
+
right: '-16px',
|
|
35
|
+
top: '0px',
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
height: '100%',
|
|
38
|
+
} }, { children: [_jsx("path", { d: "M0,0 0,0 16,0.5 0,1 0,1z" }), _jsx("line", { x1: "0", x2: "16", y1: "0", y2: "0.5", stroke: "#a7a7a7", strokeWidth: "0.05", strokeLinecap: "butt" }), _jsx("line", { x1: "0", x2: "16", y1: "1", y2: "0.5", stroke: "#a7a7a7", strokeWidth: "0.1", strokeLinecap: "butt" })] }))] })));
|
|
39
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BrandingBar } from '.';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Elements/BrandingBar',
|
|
5
|
+
component: BrandingBar,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export const Default = {
|
|
10
|
+
render: () => _jsx(BrandingBar, {}),
|
|
11
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
|
|
2
|
+
import { COLOR } from '../../../theme/colors';
|
|
3
|
+
const ProvostImage = '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BQAAADNQTFRF////////////////////////////////////////////////////////////AAAA////FbWC9gAAABB0Uk5TcI+vUM8w358gYO8Qf0C/AK6MYRQAAAmFSURBVHja7ZzrlqyqDoVVFOVavv/TbgFFLlGxu/qMM/ae80+v0hJD+AghWqv7QND31cEFELiCwBUEriAIXEHgCgJXEASuIHAFgSsIAlcQuILAFQSBKwhcQeAKgsAVBK4gcAVB4AoCVxC4giBwBYErCFxBELiCwBUEriAIXEHgCgJXEASuIHAFgSsIAlcQuPq/09R1C7wArr5MlR36VQKsfyFXyhjzPLCi/Ar7BgyT3JzVr/rnDRgz/c+s/Zl71de4WuyuwX3U+4fzTuHzvH8cwsc+mcPp5cEtxyH2SZqMvhI2k0iM0Xrej2pB+VaMqxOfk2N9fjcvK/N7jGscz6OD1sRrh0afS+cVQ8Sr3WiV36G03XrbVyvKsbux9iP00b++m+r4mam/sf307KDFdPm1sW5jqRtn1cj1uSWTi1dsdt2VwezFd3825yWml+48OxIMHr8bTNkv789Lls67kO8OXLqtgZmp84rBnR6dAVtjKSMz9xdaj09f+l9tzQ7GiO1LJk15eBiuZLw3e/z4uOObtj9nd7TvDtfq+DCLNq6GMNwLlXV5E3bXBxcm/vC3dT1lxt+Qs/zyG2s/nT8s/dHVlvc2ffBXuJxf274MfG/Hytj7OsZIqo19gDNPlA5fRDTf3UCEdZCfTvGf5mKm+XYPSxZ/War88nhoTByXt6hcg8HverXVhduZZcwa2KnbsPKX89wCb1/qqGUdPTXrPkQiHanP4jw7REsaqdpau4lry3p26cqF4Ua+Z+LTbK3rtVt6lftbx8oxnA3X367BMTgYx6hkxHec86lYNieB5Ri+EkB2mP9Rg7PIcWWjcT4slxmE7/E5ylm0+FSXn0M9xQ9SlTM0NlKsF3Y/4wdKV2NndoN0ZV/exyk/PmSntTu+7P9sXARdG+zmrHdRHPbShSLpzCQLsBqs1ceol4tr6nt9y1Xqcz86gkaPWky9w+Z8cO2HgORIGEiudMmNWWXasF0/j1wpmVwwVKlu2seR5MrH2vxUd04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KAlcQBK4gcAWBKwgCVxC4gsAVBIErCFxB4AqCwBUEriBwBYEruAACVxC4gsAVBIErCFxB/0n9A/6wliZWAPp5AAAAAElFTkSuQmCC';
|
|
5
|
+
const sharedLinkStyle = {
|
|
6
|
+
backgroundSize: 'cover',
|
|
7
|
+
backgroundRepeat: 'no-repeat',
|
|
8
|
+
display: 'block',
|
|
9
|
+
height: '50px',
|
|
10
|
+
lineHeight: '50px',
|
|
11
|
+
overflow: 'hidden',
|
|
12
|
+
textIndent: '-9999px',
|
|
13
|
+
};
|
|
14
|
+
const universityLogo = Object.assign(Object.assign({}, sharedLinkStyle), { backgroundImage: `url(${UniversityLogo})`, margin: '0 auto', position: 'relative', width: '300px', '@media screen and (min-width: 800px)': {
|
|
15
|
+
left: '12px',
|
|
16
|
+
margin: '0',
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
}, '@media screen and (min-width: 1212px)': {
|
|
19
|
+
left: '0',
|
|
20
|
+
} });
|
|
21
|
+
const provostLogo = Object.assign(Object.assign({}, sharedLinkStyle), { backgroundImage: `url(${ProvostImage})`, display: 'none', '@media screen and (min-width: 800px)': {
|
|
22
|
+
display: 'block',
|
|
23
|
+
position: 'absolute',
|
|
24
|
+
right: '12px',
|
|
25
|
+
width: '227px',
|
|
26
|
+
}, '@media screen and (min-width: 1212px)': {
|
|
27
|
+
right: '0',
|
|
28
|
+
} });
|
|
29
|
+
export const BrandingBar = () => {
|
|
30
|
+
return (_jsx("hgroup", Object.assign({ sx: {
|
|
31
|
+
backgroundColor: COLOR.ND_PROVOST_BLUE,
|
|
32
|
+
height: '50px',
|
|
33
|
+
display: 'block',
|
|
34
|
+
a: {
|
|
35
|
+
color: COLOR.TEXT_ON_PRIMARY,
|
|
36
|
+
textDecoration: 'none',
|
|
37
|
+
},
|
|
38
|
+
} }, { children: _jsx("div", Object.assign({ sx: {
|
|
39
|
+
display: 'block',
|
|
40
|
+
margin: '0 auto',
|
|
41
|
+
maxWidth: '1200px',
|
|
42
|
+
padding: '0',
|
|
43
|
+
position: 'relative',
|
|
44
|
+
} }, { children: _jsxs("nav", Object.assign({ "aria-label": "University of Notre Dame", sx: {
|
|
45
|
+
boxSizing: 'border-box',
|
|
46
|
+
display: 'block',
|
|
47
|
+
height: '50px',
|
|
48
|
+
position: 'relative',
|
|
49
|
+
overflow: 'hidden',
|
|
50
|
+
width: '100%',
|
|
51
|
+
} }, { children: [_jsxs("a", Object.assign({ sx: universityLogo, href: "http://nd.edu" }, { children: ["University ", _jsx("i", { children: "of" }), " Notre Dame"] })), _jsxs("a", Object.assign({ sx: provostLogo, href: "http://provost.nd.edu" }, { children: ["Office ", _jsx("i", { children: "of the" }), " Provost"] }))] })) })) })));
|
|
52
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Button } from '.';
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const CustomColor: Story;
|
|
8
|
+
export declare const Link: Story;
|
|
9
|
+
export declare const OutlineButton: Story;
|
|
10
|
+
export declare const TextButton: Story;
|
|
11
|
+
export declare const IconButton: Story;
|
|
12
|
+
export declare const LeftIcon: Story;
|
|
13
|
+
export declare const RightIcon: Story;
|
|
14
|
+
export declare const Loading: Story;
|
|
15
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import SearchIcon from '@mui/icons-material/Search';
|
|
3
|
+
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
4
|
+
import SettingsIcon from '@mui/icons-material/Settings';
|
|
5
|
+
import { BUTTON_SIZE, BUTTON_TYPE, Button, LinkButton } from '.';
|
|
6
|
+
import { GROUP_TYPE, Group } from '../Group';
|
|
7
|
+
import { HEADING_SIZE, Heading } from '../text/Heading';
|
|
8
|
+
import { Column } from '../layout/Column';
|
|
9
|
+
import { Row } from '../layout/Row';
|
|
10
|
+
import { Paragraph } from '../text/Paragraph';
|
|
11
|
+
import { COLOR } from '../../../theme/colors';
|
|
12
|
+
const meta = {
|
|
13
|
+
title: 'Elements/Button',
|
|
14
|
+
component: Button,
|
|
15
|
+
tags: ['autodocs'],
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
const sizes = [
|
|
19
|
+
{ size: BUTTON_SIZE.LG, label: 'Large' },
|
|
20
|
+
{ size: BUTTON_SIZE.MD, label: 'Medium' },
|
|
21
|
+
{ size: BUTTON_SIZE.SM, label: 'Small' },
|
|
22
|
+
];
|
|
23
|
+
export const Default = {
|
|
24
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, Object.assign({ type: GROUP_TYPE.REGION }, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(Button, Object.assign({}, args, { size: size.size, sx: { mt: 1 } }))] })))) })),
|
|
25
|
+
args: {
|
|
26
|
+
type: BUTTON_TYPE.DEFAULT,
|
|
27
|
+
children: 'Click Me',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const facebookBlue = '#4267B2';
|
|
31
|
+
export const CustomColor = {
|
|
32
|
+
render: (args) => (_jsxs(Column, { children: [_jsx(Paragraph, { children: "Use customColor prop for colors not in theme" }), _jsx(Row, { children: _jsx(Button, Object.assign({}, args, { customColor: facebookBlue, textColor: COLOR.WHITE, sx: { mt: 1 } })) })] })),
|
|
33
|
+
args: {
|
|
34
|
+
type: BUTTON_TYPE.DEFAULT,
|
|
35
|
+
children: 'Click Me',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
export const Link = {
|
|
39
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, Object.assign({ type: GROUP_TYPE.REGION }, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(LinkButton, Object.assign({}, args, { sx: { mt: 1 } }))] })))) })),
|
|
40
|
+
args: {
|
|
41
|
+
type: BUTTON_TYPE.DEFAULT,
|
|
42
|
+
children: 'Click Me',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export const OutlineButton = {
|
|
46
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, Object.assign({ type: GROUP_TYPE.REGION }, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(Button, Object.assign({}, args, { size: size.size, sx: { mt: 1 } }))] })))) })),
|
|
47
|
+
args: {
|
|
48
|
+
type: BUTTON_TYPE.OUTLINE,
|
|
49
|
+
children: 'Click Me',
|
|
50
|
+
onClick: () => { },
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export const TextButton = {
|
|
54
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, Object.assign({ type: GROUP_TYPE.REGION }, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(Button, Object.assign({}, args, { size: size.size, sx: { mt: 1 } }))] })))) })),
|
|
55
|
+
args: {
|
|
56
|
+
type: BUTTON_TYPE.TEXT,
|
|
57
|
+
onClick: () => { },
|
|
58
|
+
children: 'Click Me',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export const IconButton = {
|
|
62
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, Object.assign({ type: GROUP_TYPE.REGION }, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(Button, Object.assign({}, args, { size: size.size, sx: { mt: 1 }, primaryIcon: SettingsIcon }))] })))) })),
|
|
63
|
+
args: {
|
|
64
|
+
type: BUTTON_TYPE.TEXT,
|
|
65
|
+
children: 'Click Me',
|
|
66
|
+
onClick: () => { },
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export const LeftIcon = {
|
|
70
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, Object.assign({ type: GROUP_TYPE.REGION }, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(Button, Object.assign({}, args, { size: size.size, sx: { mt: 1 }, leftIcon: SearchIcon }))] })))) })),
|
|
71
|
+
args: {
|
|
72
|
+
onClick: () => { },
|
|
73
|
+
children: 'Search',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
export const RightIcon = {
|
|
77
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, Object.assign({ type: GROUP_TYPE.REGION }, { children: [_jsx(Heading, Object.assign({ size: HEADING_SIZE.MD }, { children: size.label })), _jsx(Button, Object.assign({}, args, { size: size.size, sx: { mt: 1 }, rightIcon: ArrowDropDownIcon }))] })))) })),
|
|
78
|
+
args: {
|
|
79
|
+
onClick: () => { },
|
|
80
|
+
children: 'Select',
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
export const Loading = {
|
|
84
|
+
render: () => (_jsxs(Column, { children: [_jsx(Row, { children: _jsx(Button, Object.assign({ loading: true }, { children: "Click Me" })) }), _jsx(Row, Object.assign({ sx: { mt: 1 } }, { children: _jsx(Button, Object.assign({ type: BUTTON_TYPE.OUTLINE, loading: true }, { children: "Click Me" })) })), _jsx(Row, Object.assign({ sx: { mt: 1 } }, { children: _jsx(Button, Object.assign({ type: BUTTON_TYPE.TEXT, loading: true }, { children: "Click Me" })) }))] })),
|
|
85
|
+
};
|
|
86
|
+
export const Disabled = {
|
|
87
|
+
render: () => (_jsxs(Column, { children: [_jsx(Row, { children: _jsx(Button, Object.assign({ disabled: true }, { children: "Click Me" })) }), _jsx(Row, Object.assign({ sx: { mt: 1 } }, { children: _jsx(Button, Object.assign({ type: BUTTON_TYPE.OUTLINE, disabled: true }, { children: "Click Me" })) })), _jsx(Row, Object.assign({ sx: { mt: 1 } }, { children: _jsx(Button, Object.assign({ type: BUTTON_TYPE.TEXT, disabled: true }, { children: "Click Me" })) }))] })),
|
|
88
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|