@ndlib/component-library 1.0.21 → 1.0.22
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 +26 -8
- package/dist/assets/index-3cfb730f.js +1 -0
- package/dist/components/composites/Card/Card.stories.js +2 -0
- package/dist/components/composites/Card/index.js +4 -3
- package/dist/components/composites/CardV2/CardV2.module.css +74 -0
- package/dist/components/composites/CardV2/CardV2.stories.d.ts +19 -0
- package/dist/components/composites/CardV2/CardV2.stories.js +187 -0
- package/dist/components/composites/CardV2/CardV2.test.js +67 -0
- package/dist/components/composites/CardV2/index.d.ts +42 -0
- package/dist/components/composites/CardV2/index.js +97 -0
- package/dist/components/composites/DragDropList/DragDropList.stories.js +3 -1
- package/dist/components/composites/DropdownLinks/DropdownLinks.stories.js +2 -0
- package/dist/components/composites/DropdownLinks/index.d.ts +1 -1
- package/dist/components/composites/EmptyState/EmptyState.stories.js +2 -0
- package/dist/components/composites/EmptyState/index.js +1 -1
- package/dist/components/composites/Modal/Modal.stories.js +5 -2
- package/dist/components/composites/Modal/index.js +3 -2
- package/dist/components/composites/ModalV2/ModalV2.stories.d.ts +6 -0
- package/dist/components/composites/ModalV2/ModalV2.stories.js +41 -0
- package/dist/components/composites/ModalV2/ModalV2.test.js +37 -0
- package/dist/components/composites/ModalV2/index.d.ts +20 -0
- package/dist/components/composites/ModalV2/index.js +65 -0
- package/dist/components/composites/NavMenu/NavMenu.stories.js +2 -0
- package/dist/components/composites/NavMenu/index.js +1 -1
- package/dist/components/composites/Seo/seo.stories.js +2 -0
- package/dist/components/composites/SnackBar/SnackBar.stories.js +2 -0
- package/dist/components/composites/StructuredData/StructuredData.stories.js +2 -0
- package/dist/components/elements/Alerts/Alert.stories.js +2 -0
- package/dist/components/elements/Alerts/Alerts.stories.js +2 -0
- package/dist/components/elements/Alerts/index.js +2 -1
- package/dist/components/elements/ArrowLink/ArrowLink.stories.js +2 -0
- package/dist/components/elements/{Fields/AutoComplete → AutoComplete}/AutoComplete.stories.js +6 -4
- package/dist/components/elements/{Fields/AutoComplete → AutoComplete}/AutoComplete.test.js +1 -1
- package/dist/components/elements/{Fields/AutoComplete → AutoComplete}/index.js +3 -3
- package/dist/components/elements/BrandingBar/BrandingBar.stories.js +2 -0
- package/dist/components/elements/Button/Button.stories.js +4 -2
- package/dist/components/elements/ButtonV2/ButtonV2.module.css +25 -0
- package/dist/components/elements/ButtonV2/ButtonV2.stories.d.ts +15 -0
- package/dist/components/elements/ButtonV2/ButtonV2.stories.js +90 -0
- package/dist/components/elements/ButtonV2/ButtonV2.test.js +45 -0
- package/dist/components/elements/ButtonV2/index.d.ts +49 -0
- package/dist/components/elements/ButtonV2/index.js +136 -0
- package/dist/components/elements/{Fields/Checkbox → Checkbox}/Checkbox.stories.js +3 -1
- package/dist/components/elements/{Fields/Checkbox → Checkbox}/Checkbox.test.js +1 -1
- package/dist/components/elements/{Fields/Checkbox → Checkbox}/index.d.ts +1 -1
- package/dist/components/elements/{Fields/Checkbox → Checkbox}/index.js +2 -2
- package/dist/components/elements/{Fields/CheckboxGroup → CheckboxGroup}/CheckboxGroup.stories.js +3 -1
- package/dist/components/elements/{Fields/CheckboxGroup → CheckboxGroup}/CheckboxGroup.test.js +1 -1
- package/dist/components/elements/{Fields/CheckboxGroup → CheckboxGroup}/index.d.ts +1 -1
- package/dist/components/elements/{Fields/CheckboxGroup → CheckboxGroup}/index.js +7 -7
- package/dist/components/elements/CheckboxGroupV2/CheckboxGroupV2.stories.d.ts +8 -0
- package/dist/components/elements/CheckboxGroupV2/CheckboxGroupV2.stories.js +31 -0
- package/dist/components/elements/CheckboxGroupV2/CheckboxGroupV2.test.js +34 -0
- package/dist/components/elements/CheckboxGroupV2/index.d.ts +17 -0
- package/dist/components/elements/CheckboxGroupV2/index.js +50 -0
- package/dist/components/elements/CheckboxV2/CheckboxV2.module.css +5 -0
- package/dist/components/elements/CheckboxV2/CheckboxV2.stories.d.ts +6 -0
- package/dist/components/elements/CheckboxV2/CheckboxV2.stories.js +19 -0
- package/dist/components/elements/CheckboxV2/CheckboxV2.test.js +35 -0
- package/dist/components/elements/CheckboxV2/index.d.ts +9 -0
- package/dist/components/elements/CheckboxV2/index.js +22 -0
- package/dist/components/elements/{Fields/DatePicker → DatePicker}/DatePicker.stories.js +3 -1
- package/dist/components/elements/{Fields/DatePicker → DatePicker}/DatePicker.test.js +1 -1
- package/dist/components/elements/{Fields/DatePicker → DatePicker}/index.d.ts +1 -1
- package/dist/components/elements/{Fields/DatePicker → DatePicker}/index.js +2 -2
- package/dist/components/elements/Dropdown/Dropdown.stories.js +3 -1
- package/dist/components/elements/Dropdown/index.js +1 -1
- package/dist/components/elements/GroupV2/index.d.ts +22 -0
- package/dist/components/elements/GroupV2/index.js +71 -0
- package/dist/components/elements/{text/Heading → Heading}/Heading.stories.js +5 -3
- package/dist/components/elements/{text/Heading → Heading}/Heading.test.js +3 -3
- package/dist/components/elements/{text/Heading → Heading}/index.d.ts +3 -3
- package/dist/components/elements/{text/Heading → Heading}/index.js +10 -9
- package/dist/components/elements/HeadingV2/HeadingV2.module.css +8 -0
- package/dist/components/elements/HeadingV2/HeadingV2.stories.d.ts +8 -0
- package/dist/components/elements/HeadingV2/HeadingV2.stories.js +37 -0
- package/dist/components/elements/HeadingV2/HeadingV2.test.js +51 -0
- package/dist/components/elements/HeadingV2/index.d.ts +22 -0
- package/dist/components/elements/HeadingV2/index.js +100 -0
- package/dist/components/elements/Icon/Icon.stories.js +3 -1
- package/dist/components/elements/IconV2/IconV2.module.css +10 -0
- package/dist/components/elements/IconV2/IconV2.stories.d.ts +7 -0
- package/dist/components/elements/IconV2/IconV2.stories.js +31 -0
- package/dist/components/elements/IconV2/IconV2.test.js +62 -0
- package/dist/components/elements/IconV2/index.d.ts +10 -0
- package/dist/components/elements/IconV2/index.js +33 -0
- package/dist/components/elements/{text/Inline → Inline}/Inline.stories.js +2 -0
- package/dist/components/elements/{text/Inline → Inline}/index.d.ts +1 -1
- package/dist/components/elements/{text/Inline → Inline}/index.js +1 -1
- package/dist/components/elements/{text/Label → Label}/Label.stories.js +4 -2
- package/dist/components/elements/Label/Label.test.d.ts +1 -0
- package/dist/components/elements/{text/Label → Label}/Label.test.js +3 -3
- package/dist/components/elements/{text/Label → Label}/index.d.ts +2 -2
- package/dist/components/elements/{text/Label → Label}/index.js +3 -3
- package/dist/components/elements/LabelV2/LabelV2.stories.d.ts +6 -0
- package/dist/components/elements/LabelV2/LabelV2.stories.js +22 -0
- package/dist/components/elements/LabelV2/LabelV2.test.d.ts +1 -0
- package/dist/components/elements/LabelV2/LabelV2.test.js +56 -0
- package/dist/components/elements/LabelV2/index.d.ts +20 -0
- package/dist/components/elements/LabelV2/index.js +41 -0
- package/dist/components/elements/Link/Link.stories.js +3 -1
- package/dist/components/elements/List/List.stories.js +3 -1
- package/dist/components/elements/List/index.js +1 -1
- package/dist/components/elements/ListBox/Listbox.stories.js +2 -0
- package/dist/components/elements/ListBox/index.d.ts +1 -1
- package/dist/components/elements/ListBox/index.js +1 -1
- package/dist/components/elements/ListBoxV2/ListBoxV2.module.css +33 -0
- package/dist/components/elements/ListBoxV2/ListBoxV2.stories.d.ts +6 -0
- package/dist/components/elements/ListBoxV2/ListBoxV2.stories.js +19 -0
- package/dist/components/elements/ListBoxV2/index.d.ts +33 -0
- package/dist/components/elements/ListBoxV2/index.js +35 -0
- package/dist/components/elements/Markdown/Markdown.stories.js +2 -0
- package/dist/components/elements/Markdown/index.js +4 -4
- package/dist/components/elements/{Fields/MonthPicker → MonthPicker}/MonthPicker.stories.js +3 -1
- package/dist/components/elements/MonthPicker/MonthPicker.test.d.ts +1 -0
- package/dist/components/elements/{Fields/MonthPicker → MonthPicker}/MonthPicker.test.js +1 -1
- package/dist/components/elements/{Fields/MonthPicker → MonthPicker}/index.d.ts +1 -1
- package/dist/components/elements/{Fields/MonthPicker → MonthPicker}/index.js +2 -2
- package/dist/components/elements/{text/Paragraph → Paragraph}/Paragraph.stories.js +5 -3
- package/dist/components/elements/Paragraph/Paragraph.test.d.ts +1 -0
- package/dist/components/elements/{text/Paragraph → Paragraph}/Paragraph.test.js +1 -1
- package/dist/components/elements/{text/Paragraph → Paragraph}/index.d.ts +2 -2
- package/dist/components/elements/{text/Paragraph → Paragraph}/index.js +6 -5
- package/dist/components/elements/ParagraphV2/ParagraphV2.stories.d.ts +7 -0
- package/dist/components/elements/ParagraphV2/ParagraphV2.stories.js +33 -0
- package/dist/components/elements/ParagraphV2/ParagraphV2.test.d.ts +1 -0
- package/dist/components/elements/ParagraphV2/ParagraphV2.test.js +9 -0
- package/dist/components/elements/ParagraphV2/index.d.ts +15 -0
- package/dist/components/elements/ParagraphV2/index.js +39 -0
- package/dist/components/elements/Pill/Pill.stories.js +3 -1
- package/dist/components/elements/Pill/index.js +2 -1
- package/dist/components/elements/{Fields/Radio → Radio}/Radio.stories.js +3 -1
- package/dist/components/elements/Radio/Radio.test.d.ts +1 -0
- package/dist/components/elements/{Fields/Radio → Radio}/Radio.test.js +3 -3
- package/dist/components/elements/{Fields/Radio → Radio}/index.d.ts +1 -1
- package/dist/components/elements/{Fields/Radio → Radio}/index.js +1 -1
- package/dist/components/elements/{Fields/RadioGroup → RadioGroup}/RadioGroup.stories.js +3 -1
- package/dist/components/elements/{Fields/RadioGroup → RadioGroup}/RadioGroup.test.js +1 -1
- package/dist/components/elements/{Fields/RadioGroup → RadioGroup}/index.d.ts +1 -1
- package/dist/components/elements/{Fields/RadioGroup → RadioGroup}/index.js +6 -6
- package/dist/components/elements/{text/ReadMore → ReadMore}/ReadMore.stories.js +5 -3
- package/dist/components/elements/ReadMore/ReadMore.test.d.ts +1 -0
- package/dist/components/elements/{text/ReadMore → ReadMore}/ReadMore.test.js +4 -9
- package/dist/components/elements/{text/ReadMore → ReadMore}/index.d.ts +2 -2
- package/dist/components/elements/{text/ReadMore → ReadMore}/index.js +10 -9
- package/dist/components/elements/ReadMoreV2/ReadMoreV2.module.css +19 -0
- package/dist/components/elements/ReadMoreV2/ReadMoreV2.stories.d.ts +8 -0
- package/dist/components/elements/ReadMoreV2/ReadMoreV2.stories.js +28 -0
- package/dist/components/elements/ReadMoreV2/ReadMoreV2.test.d.ts +1 -0
- package/dist/components/elements/ReadMoreV2/ReadMoreV2.test.js +30 -0
- package/dist/components/elements/ReadMoreV2/index.d.ts +12 -0
- package/dist/components/elements/ReadMoreV2/index.js +81 -0
- package/dist/components/elements/{Fields/Select → Select}/Select.stories.js +6 -4
- package/dist/components/elements/Select/Select.test.d.ts +1 -0
- package/dist/components/elements/{Fields/Select → Select}/Select.test.js +1 -1
- package/dist/components/elements/{Fields/Select → Select}/index.d.ts +1 -1
- package/dist/components/elements/{Fields/Select → Select}/index.js +9 -9
- package/dist/components/elements/SelectV2/SelectV2.module.css +27 -0
- package/dist/components/elements/SelectV2/SelectV2.stories.d.ts +8 -0
- package/dist/components/elements/SelectV2/SelectV2.stories.js +41 -0
- package/dist/components/elements/SelectV2/SelectV2.test.d.ts +1 -0
- package/dist/components/elements/SelectV2/SelectV2.test.js +52 -0
- package/dist/components/elements/SelectV2/index.d.ts +18 -0
- package/dist/components/elements/SelectV2/index.js +164 -0
- package/dist/components/elements/Spinner/Spinner.stories.js +2 -0
- package/dist/components/elements/Spinner/index.js +1 -1
- package/dist/components/elements/SpinnerV2/SpinnerV2.module.css +12 -0
- package/dist/components/elements/SpinnerV2/SpinnerV2.stories.d.ts +7 -0
- package/dist/components/elements/SpinnerV2/SpinnerV2.stories.js +29 -0
- package/dist/components/elements/SpinnerV2/SpinnerV2.test.d.ts +1 -0
- package/dist/components/elements/SpinnerV2/SpinnerV2.test.js +9 -0
- package/dist/components/elements/SpinnerV2/index.d.ts +14 -0
- package/dist/components/elements/SpinnerV2/index.js +35 -0
- package/dist/components/elements/TabList/TabList.stories.js +2 -0
- package/dist/components/elements/Table/Table.stories.js +2 -0
- package/dist/components/elements/{Fields/TextInput → TextInput}/TextInput.stories.js +6 -4
- package/dist/components/elements/TextInput/TextInput.test.d.ts +1 -0
- package/dist/components/elements/{Fields/TextInput → TextInput}/TextInput.test.js +2 -2
- package/dist/components/elements/{Fields/TextInput → TextInput}/index.d.ts +3 -3
- package/dist/components/elements/{Fields/TextInput → TextInput}/index.js +9 -8
- package/dist/components/elements/TextInputV2/TextInputV2.module.css +71 -0
- package/dist/components/elements/TextInputV2/TextInputV2.stories.d.ts +9 -0
- package/dist/components/elements/TextInputV2/TextInputV2.stories.js +37 -0
- package/dist/components/elements/TextInputV2/TextInputV2.test.d.ts +1 -0
- package/dist/components/elements/TextInputV2/TextInputV2.test.js +59 -0
- package/dist/components/elements/TextInputV2/index.d.ts +45 -0
- package/dist/components/elements/TextInputV2/index.js +97 -0
- package/dist/components/elements/layout/Box.stories.js +2 -0
- package/dist/components/elements/layout/Flex.stories.js +3 -1
- package/dist/components/elements/layoutV2/BoxV2.d.ts +9 -0
- package/dist/components/elements/layoutV2/BoxV2.js +19 -0
- package/dist/components/elements/layoutV2/BoxV2.stories.d.ts +6 -0
- package/dist/components/elements/layoutV2/BoxV2.stories.js +14 -0
- package/dist/components/elements/layoutV2/ColumnV2.d.ts +8 -0
- package/dist/components/elements/layoutV2/ColumnV2.js +21 -0
- package/dist/components/elements/layoutV2/RowV2.d.ts +19 -0
- package/dist/components/elements/layoutV2/RowV2.js +54 -0
- package/dist/components/providers/alerts.js +0 -1
- package/dist/components/providers/alerts.test.d.ts +1 -0
- package/dist/components/providers/alerts.test.js +115 -0
- package/dist/components/providers/componentConfigV2.d.ts +25 -0
- package/dist/components/providers/componentConfigV2.js +37 -0
- package/dist/components/providers/media.js +1 -1
- package/dist/components/providers/mediaV2.d.ts +11 -0
- package/dist/components/providers/mediaV2.js +48 -0
- package/dist/components/providers/uiV2.d.ts +20 -0
- package/dist/components/providers/uiV2.js +16 -0
- package/dist/index.d.ts +34 -14
- package/dist/index.html +14 -0
- package/dist/index.js +33 -13
- package/dist/theme/Color.stories.js +3 -1
- package/dist/theme/GlobalStylesV2.d.ts +2 -0
- package/dist/theme/GlobalStylesV2.js +212 -0
- package/dist/theme/Typography.stories.js +3 -1
- package/dist/theme/css-variables.css +57 -0
- package/dist/theme/index.d.ts +127 -1
- package/dist/theme/index.js +14 -0
- package/dist/theme/typography.js +2 -2
- package/dist/utils/decorators/UIVersion1.d.ts +2 -0
- package/dist/utils/decorators/UIVersion1.js +7 -0
- package/dist/utils/decorators/UIVersion2.d.ts +2 -0
- package/dist/utils/decorators/UIVersion2.js +7 -0
- package/dist/utils/hooks/useFocus.d.ts +7 -0
- package/dist/utils/hooks/useFocus.js +12 -0
- package/dist/utils/processSx.d.ts +3 -0
- package/dist/utils/processSx.js +135 -0
- package/package.json +7 -4
- /package/dist/components/{elements/Fields/Checkbox/Checkbox.test.d.ts → composites/CardV2/CardV2.test.d.ts} +0 -0
- /package/dist/components/{elements/Fields/CheckboxGroup/CheckboxGroup.test.d.ts → composites/ModalV2/ModalV2.test.d.ts} +0 -0
- /package/dist/components/elements/{Fields/AutoComplete → AutoComplete}/AutoComplete.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/AutoComplete → AutoComplete}/AutoComplete.test.d.ts +0 -0
- /package/dist/components/elements/{Fields/AutoComplete → AutoComplete}/index.d.ts +0 -0
- /package/dist/components/elements/{Fields/DatePicker/DatePicker.test.d.ts → ButtonV2/ButtonV2.test.d.ts} +0 -0
- /package/dist/components/elements/{text/Caption → Caption}/index.d.ts +0 -0
- /package/dist/components/elements/{text/Caption → Caption}/index.js +0 -0
- /package/dist/components/elements/{Fields/Checkbox → Checkbox}/Checkbox.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/MonthPicker/MonthPicker.test.d.ts → Checkbox/Checkbox.test.d.ts} +0 -0
- /package/dist/components/elements/{Fields/CheckboxGroup → CheckboxGroup}/CheckboxGroup.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/Radio/Radio.test.d.ts → CheckboxGroup/CheckboxGroup.test.d.ts} +0 -0
- /package/dist/components/elements/{Fields/Select/Select.test.d.ts → CheckboxGroupV2/CheckboxGroupV2.test.d.ts} +0 -0
- /package/dist/components/elements/{text/Heading/Heading.test.d.ts → CheckboxV2/CheckboxV2.test.d.ts} +0 -0
- /package/dist/components/elements/{Fields/DatePicker → DatePicker}/DatePicker.stories.d.ts +0 -0
- /package/dist/components/elements/{text/Label/Label.test.d.ts → DatePicker/DatePicker.test.d.ts} +0 -0
- /package/dist/components/elements/{text/Heading → Heading}/Heading.stories.d.ts +0 -0
- /package/dist/components/elements/{text/Paragraph/Paragraph.test.d.ts → Heading/Heading.test.d.ts} +0 -0
- /package/dist/components/elements/{text/ReadMore/ReadMore.test.d.ts → HeadingV2/HeadingV2.test.d.ts} +0 -0
- /package/dist/components/elements/{Fields/RadioGroup/RadioGroup.test.d.ts → IconV2/IconV2.test.d.ts} +0 -0
- /package/dist/components/elements/{text/Inline → Inline}/Inline.stories.d.ts +0 -0
- /package/dist/components/elements/{text/Label → Label}/Label.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/MonthPicker → MonthPicker}/MonthPicker.stories.d.ts +0 -0
- /package/dist/components/elements/{text/Paragraph → Paragraph}/Paragraph.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/Radio → Radio}/Radio.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/RadioGroup → RadioGroup}/RadioGroup.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/TextInput/TextInput.test.d.ts → RadioGroup/RadioGroup.test.d.ts} +0 -0
- /package/dist/components/elements/{text/ReadMore → ReadMore}/ReadMore.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/Select → Select}/Select.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/TextInput → TextInput}/TextInput.stories.d.ts +0 -0
- /package/dist/components/elements/{Fields/option.d.ts → option.d.ts} +0 -0
- /package/dist/components/elements/{Fields/option.js → option.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { BasicOption, RenderOption } from '../../elements/
|
|
2
|
+
import { BasicOption, RenderOption } from '../../elements/option';
|
|
3
3
|
import { StyledElementProps } from '../../../theme';
|
|
4
4
|
type AnchorProps = Omit<React.HTMLAttributes<HTMLButtonElement>, 'color'>;
|
|
5
5
|
type LinkOption = BasicOption<string>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { EMPTY_STATE_SIZE, EmptyState } from '.';
|
|
3
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
3
4
|
import NotInterestedIcon from '@mui/icons-material/NotInterested';
|
|
4
5
|
import { Link } from '../../elements/Link';
|
|
5
6
|
import { FONT_SIZE } from '../../../theme/typography';
|
|
@@ -7,6 +8,7 @@ const meta = {
|
|
|
7
8
|
title: 'Composites/EmptyState',
|
|
8
9
|
component: EmptyState,
|
|
9
10
|
tags: ['autodocs'],
|
|
11
|
+
decorators: [UIVersion1],
|
|
10
12
|
};
|
|
11
13
|
export default meta;
|
|
12
14
|
export const Default = {
|
|
@@ -13,7 +13,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
13
13
|
import _SearchOffIcon from '@mui/icons-material/SearchOff';
|
|
14
14
|
import { Row } from '../../elements/layout/Row';
|
|
15
15
|
import { Column } from '../../elements/layout/Column';
|
|
16
|
-
import { PARAGRAPH_SIZE, Paragraph } from '../../elements/
|
|
16
|
+
import { PARAGRAPH_SIZE, Paragraph } from '../../elements/Paragraph';
|
|
17
17
|
import { COLOR } from '../../../theme/colors';
|
|
18
18
|
import { Icon } from '../../elements/Icon';
|
|
19
19
|
import { FONT_SIZE } from '../../../theme/typography';
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Modal } from '.';
|
|
3
3
|
import { Button } from '../../elements/Button';
|
|
4
|
-
import { Paragraph } from '../../elements/
|
|
4
|
+
import { Paragraph } from '../../elements/Paragraph';
|
|
5
5
|
import { useDialog } from '../../providers/dialogs';
|
|
6
6
|
import { useTheme } from '../../../theme';
|
|
7
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
7
8
|
const meta = {
|
|
8
9
|
title: 'Composites/Modal',
|
|
9
10
|
component: Modal,
|
|
10
11
|
tags: ['autodocs'],
|
|
12
|
+
decorators: [UIVersion1],
|
|
11
13
|
};
|
|
12
14
|
export default meta;
|
|
13
15
|
const ModalExample = () => {
|
|
16
|
+
var _a;
|
|
14
17
|
const modalId = 'modal-example';
|
|
15
18
|
const { open, close, state } = useDialog(modalId);
|
|
16
19
|
const theme = useTheme();
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ onClick: open, sx: { position: 'relative', zIndex: theme.zIndex.DIALOG } }, { children: "Open Modal" })), _jsx(Modal, Object.assign({ isOpen: state.isOpen, heading: "Heading", close: close, actions: [
|
|
20
|
+
return (_jsxs(_Fragment, { children: [_jsx(Button, Object.assign({ onClick: open, sx: { position: 'relative', zIndex: (_a = theme.zIndex) === null || _a === void 0 ? void 0 : _a.DIALOG } }, { children: "Open Modal" })), _jsx(Modal, Object.assign({ isOpen: state.isOpen, heading: "Heading", close: close, actions: [
|
|
18
21
|
{
|
|
19
22
|
label: 'Secondary',
|
|
20
23
|
isPrimary: false,
|
|
@@ -15,7 +15,7 @@ import { importedDefaultComponentShim } from '../../../utils/misc';
|
|
|
15
15
|
import { ThemeProvider, useTheme, } from '../../../theme';
|
|
16
16
|
import { GROUP_TYPE, Group } from '../../elements/Group';
|
|
17
17
|
import { Row } from '../../elements/layout/Row';
|
|
18
|
-
import { HEADING_SIZE, Heading } from '../../elements/
|
|
18
|
+
import { HEADING_SIZE, Heading } from '../../elements/Heading';
|
|
19
19
|
import { BUTTON_TYPE, Button } from '../../elements/Button';
|
|
20
20
|
import { COLOR } from '../../../theme/colors';
|
|
21
21
|
import { TYPOGRAPHY_TYPE } from '../../../theme/typography';
|
|
@@ -23,6 +23,7 @@ import { useMediaQuery } from '../../providers/media';
|
|
|
23
23
|
import { useComponentConfig } from '../../providers/componentConfig';
|
|
24
24
|
const ReactModal = importedDefaultComponentShim(_ReactModal);
|
|
25
25
|
export const Modal = (_a) => {
|
|
26
|
+
var _b;
|
|
26
27
|
var { children, heading, hideHeading, isOpen, footer, actions, wrapWithTheme, close, zIndex, bodyStyles } = _a, props = __rest(_a, ["children", "heading", "hideHeading", "isOpen", "footer", "actions", "wrapWithTheme", "close", "zIndex", "bodyStyles"]);
|
|
27
28
|
const { breakpoint } = useMediaQuery();
|
|
28
29
|
const { modal } = useComponentConfig();
|
|
@@ -48,7 +49,7 @@ export const Modal = (_a) => {
|
|
|
48
49
|
} }, props, { style: {
|
|
49
50
|
overlay: {
|
|
50
51
|
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
51
|
-
zIndex: zIndex || theme.zIndex.MODAL,
|
|
52
|
+
zIndex: zIndex || ((_b = theme.zIndex) === null || _b === void 0 ? void 0 : _b.MODAL),
|
|
52
53
|
},
|
|
53
54
|
content: {
|
|
54
55
|
padding: 0,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ModalV2 } from '.';
|
|
3
|
+
import { ButtonV2 } from '../../elements/ButtonV2';
|
|
4
|
+
import { ParagraphV2 } from '../../elements/ParagraphV2';
|
|
5
|
+
import { useDialog } from '../../providers/dialogs';
|
|
6
|
+
import { Z_INDEX } from '../../../theme';
|
|
7
|
+
import { UIVersion2 } from '../../../utils/decorators/UIVersion2';
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Composites/ModalV2',
|
|
10
|
+
component: ModalV2,
|
|
11
|
+
tags: ['autodocs'],
|
|
12
|
+
decorators: [UIVersion2],
|
|
13
|
+
};
|
|
14
|
+
export default meta;
|
|
15
|
+
const ModalV2Example = () => {
|
|
16
|
+
const modalId = 'modal-example';
|
|
17
|
+
const { open, close, state } = useDialog(modalId);
|
|
18
|
+
return (_jsxs(_Fragment, { children: [_jsx(ButtonV2, Object.assign({ onClick: open, sx: { position: 'relative', zIndex: Z_INDEX.DIALOG } }, { children: "Open Modal" })), _jsx(ModalV2, Object.assign({ isOpen: state.isOpen, heading: "Heading", close: close, actions: [
|
|
19
|
+
{
|
|
20
|
+
label: 'Secondary',
|
|
21
|
+
isPrimary: false,
|
|
22
|
+
onClick: () => { },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: 'Customized',
|
|
26
|
+
onClick: () => { },
|
|
27
|
+
buttonProps: {
|
|
28
|
+
loading: true,
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
label: 'Primary',
|
|
33
|
+
isPrimary: true,
|
|
34
|
+
onClick: () => { },
|
|
35
|
+
},
|
|
36
|
+
] }, { children: _jsx(ParagraphV2, { children: "Modal body goes here" }) }))] }));
|
|
37
|
+
};
|
|
38
|
+
export const Default = {
|
|
39
|
+
render: () => _jsx(ModalV2Example, {}),
|
|
40
|
+
args: {},
|
|
41
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { fireEvent } from '@testing-library/react';
|
|
3
|
+
import { render } from '../../../utils/test';
|
|
4
|
+
import { vi } from 'vitest';
|
|
5
|
+
import { ModalV2 } from './';
|
|
6
|
+
describe('ModalV2', () => {
|
|
7
|
+
const handleClose = vi.fn();
|
|
8
|
+
const mockActions = [
|
|
9
|
+
{ label: 'Action 1', onClick: vi.fn() },
|
|
10
|
+
{ label: 'Action 2', onClick: vi.fn() },
|
|
11
|
+
];
|
|
12
|
+
it('renders modal with heading and content', () => {
|
|
13
|
+
const { getByText } = render(_jsx(ModalV2, Object.assign({ isOpen: true, close: handleClose, heading: "Test Heading" }, { children: _jsx("div", { children: "Modal Content" }) })));
|
|
14
|
+
expect(getByText('Test Heading')).toBeInTheDocument();
|
|
15
|
+
expect(getByText('Modal Content')).toBeInTheDocument();
|
|
16
|
+
});
|
|
17
|
+
it('calls close handler when close button is clicked', () => {
|
|
18
|
+
const { getByText } = render(_jsx(ModalV2, Object.assign({ isOpen: true, close: handleClose, heading: "Test Heading" }, { children: _jsx("div", { children: "Modal Content" }) })));
|
|
19
|
+
const closeButton = getByText('Close');
|
|
20
|
+
fireEvent.click(closeButton);
|
|
21
|
+
expect(handleClose).toHaveBeenCalledTimes(1);
|
|
22
|
+
});
|
|
23
|
+
it('renders actions correctly', () => {
|
|
24
|
+
const { getByText } = render(_jsx(ModalV2, Object.assign({ isOpen: true, close: handleClose, heading: "Test Heading", actions: mockActions }, { children: _jsx("div", { children: "Modal Content" }) })));
|
|
25
|
+
expect(getByText('Action 1')).toBeInTheDocument();
|
|
26
|
+
expect(getByText('Action 2')).toBeInTheDocument();
|
|
27
|
+
});
|
|
28
|
+
it('calls action handler when action button is clicked', () => {
|
|
29
|
+
const { getByText } = render(_jsx(ModalV2, Object.assign({ isOpen: true, close: handleClose, heading: "Test Heading", actions: mockActions }, { children: _jsx("div", { children: "Modal Content" }) })));
|
|
30
|
+
const actionButton1 = getByText('Action 1');
|
|
31
|
+
fireEvent.click(actionButton1);
|
|
32
|
+
expect(mockActions[0].onClick).toHaveBeenCalledTimes(1);
|
|
33
|
+
const actionButton2 = getByText('Action 2');
|
|
34
|
+
fireEvent.click(actionButton2);
|
|
35
|
+
expect(mockActions[1].onClick).toHaveBeenCalledTimes(1);
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { StyledElementPropsV2, StylesPropV2 } from '../../../theme';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ButtonV2Props } from '../../elements/ButtonV2';
|
|
4
|
+
export type ModalV2Props = StyledElementPropsV2<HTMLDivElement, {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
close: (e: React.MouseEvent) => void;
|
|
7
|
+
heading: string;
|
|
8
|
+
hideHeading?: boolean;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
footer?: React.ReactNode;
|
|
11
|
+
actions?: ModalV2Action[];
|
|
12
|
+
bodyStyles?: StylesPropV2;
|
|
13
|
+
}>;
|
|
14
|
+
export type ModalV2Action = {
|
|
15
|
+
label: string;
|
|
16
|
+
isPrimary?: boolean;
|
|
17
|
+
buttonProps?: Partial<ButtonV2Props>;
|
|
18
|
+
onClick: (e: React.MouseEvent) => void;
|
|
19
|
+
};
|
|
20
|
+
export declare const ModalV2: React.FC<ModalV2Props>;
|
|
@@ -0,0 +1,65 @@
|
|
|
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 "react/jsx-runtime";
|
|
13
|
+
import _ReactModal from 'react-modal';
|
|
14
|
+
import { importedDefaultComponentShim } from '../../../utils/misc';
|
|
15
|
+
import { Z_INDEX } from '../../../theme';
|
|
16
|
+
import { GROUPV2_TYPE, GroupV2 } from '../../elements/GroupV2';
|
|
17
|
+
import { RowV2 } from '../../elements/layoutV2/RowV2';
|
|
18
|
+
import { HEADINGV2_SIZE, HeadingV2 } from '../../elements/HeadingV2';
|
|
19
|
+
import { BUTTONV2_TYPE, ButtonV2 } from '../../elements/ButtonV2';
|
|
20
|
+
import { COLOR } from '../../../theme/colors';
|
|
21
|
+
import { TYPOGRAPHY_TYPE } from '../../../theme/typography';
|
|
22
|
+
import { useMediaQueryV2 } from '../../providers/mediaV2';
|
|
23
|
+
import { useComponentConfig } from '../../providers/componentConfig';
|
|
24
|
+
const ReactModal = importedDefaultComponentShim(_ReactModal);
|
|
25
|
+
export const ModalV2 = (_a) => {
|
|
26
|
+
var { children, heading, hideHeading, isOpen, footer, actions, close, zIndex, bodyStyles } = _a, props = __rest(_a, ["children", "heading", "hideHeading", "isOpen", "footer", "actions", "close", "zIndex", "bodyStyles"]);
|
|
27
|
+
const { breakpoint } = useMediaQueryV2();
|
|
28
|
+
const { modal } = useComponentConfig();
|
|
29
|
+
const shouldShowFooter = footer !== undefined || (actions !== undefined && actions.length > 0);
|
|
30
|
+
const modalBody = (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION, sx: { my: 0 } }, { children: [!hideHeading && (_jsxs(RowV2, Object.assign({ justify: "space-between", align: "center", sx: {
|
|
31
|
+
p: 3,
|
|
32
|
+
borderBottom: 'solid 1px',
|
|
33
|
+
borderColor: COLOR.LIGHT_GRAY,
|
|
34
|
+
} }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.SM, typography: TYPOGRAPHY_TYPE.CONTROL_MEDIUM, sx: { mt: 0 } }, { children: heading })), _jsx(ButtonV2, Object.assign({ type: BUTTONV2_TYPE.TEXT, onClick: (e) => {
|
|
35
|
+
e.preventDefault();
|
|
36
|
+
e.stopPropagation();
|
|
37
|
+
close(e);
|
|
38
|
+
} }, { children: "Close" }))] }))), _jsx(RowV2, Object.assign({ sx: Object.assign({ p: 3 }, bodyStyles) }, { children: children })), shouldShowFooter && (_jsxs(RowV2, Object.assign({ sx: { borderTop: 'solid 1px', borderColor: COLOR.LIGHT_GRAY, p: 3 } }, { children: [footer, actions !== undefined && (_jsx(RowV2, Object.assign({ sx: { width: '100%', justifyContent: 'flex-end' } }, { children: actions.map((action, index) => (_jsx(ButtonV2, Object.assign({ type: action.isPrimary
|
|
39
|
+
? BUTTONV2_TYPE.DEFAULT
|
|
40
|
+
: BUTTONV2_TYPE.OUTLINE, onClick: (e) => {
|
|
41
|
+
action.onClick(e);
|
|
42
|
+
}, sx: {
|
|
43
|
+
mr: index < actions.length - 1 ? 1 : 0,
|
|
44
|
+
} }, action.buttonProps, { children: action.label }), index))) })))] })))] })));
|
|
45
|
+
return (_jsx(ReactModal, Object.assign({ isOpen: isOpen, shouldFocusAfterRender: true, appElement: modal.appElement, onRequestClose: (e) => {
|
|
46
|
+
e.preventDefault();
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
close(e);
|
|
49
|
+
} }, props, { style: {
|
|
50
|
+
overlay: {
|
|
51
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
52
|
+
zIndex: zIndex || Z_INDEX.MODAL,
|
|
53
|
+
},
|
|
54
|
+
content: {
|
|
55
|
+
padding: 0,
|
|
56
|
+
minWidth: breakpoint === 0 ? 'calc(100% - 1rem)' : '500px',
|
|
57
|
+
top: '50%',
|
|
58
|
+
left: '50%',
|
|
59
|
+
right: 'auto',
|
|
60
|
+
bottom: 'auto',
|
|
61
|
+
marginRight: '-50%',
|
|
62
|
+
transform: 'translate(-50%, -50%)',
|
|
63
|
+
},
|
|
64
|
+
} }, { children: modalBody })));
|
|
65
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
2
3
|
import { NavMenu } from './';
|
|
3
4
|
import { DemoMenuImplementation } from './demo';
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Composites/NavMenu',
|
|
6
7
|
component: NavMenu,
|
|
8
|
+
decorators: [UIVersion1],
|
|
7
9
|
};
|
|
8
10
|
export default meta;
|
|
9
11
|
export const Default = {
|
|
@@ -16,7 +16,7 @@ import { List, ListItem } from '../../elements/List';
|
|
|
16
16
|
import { MENU_ACTION_TYPE, useMenu } from '../../providers/menu';
|
|
17
17
|
import { Row } from '../../elements/layout/Row';
|
|
18
18
|
import { Column } from '../../elements/layout/Column';
|
|
19
|
-
import { HEADING_SIZE, Heading } from '../../elements/
|
|
19
|
+
import { HEADING_SIZE, Heading } from '../../elements/Heading';
|
|
20
20
|
import { Link } from '../../elements/Link';
|
|
21
21
|
import { FONT_SIZE, FONT_WEIGHT } from '../../../theme/typography';
|
|
22
22
|
import { COLOR } from '../../../theme/colors';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import SeoDataDisplay from './SeoDataDisplay';
|
|
3
3
|
import Seo from './index';
|
|
4
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Composites/Seo',
|
|
6
7
|
component: Seo,
|
|
7
8
|
tags: ['autodocs'],
|
|
9
|
+
decorators: [UIVersion1],
|
|
8
10
|
};
|
|
9
11
|
export default meta;
|
|
10
12
|
export const Default = {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { SnackBar } from './';
|
|
3
3
|
import { BasicExample, ReplaceMessageExample, WipeMessagesExample, } from './examples';
|
|
4
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Composites/SnackBar',
|
|
6
7
|
component: SnackBar,
|
|
8
|
+
decorators: [UIVersion1],
|
|
7
9
|
};
|
|
8
10
|
export default meta;
|
|
9
11
|
export const Default = {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import StructuredDataDisplay from './StructuredDataDisplay';
|
|
3
3
|
import StructuredData from './index';
|
|
4
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Composites/StructuredData',
|
|
6
7
|
component: StructuredData,
|
|
7
8
|
tags: ['autodocs'],
|
|
9
|
+
decorators: [UIVersion1],
|
|
8
10
|
};
|
|
9
11
|
export default meta;
|
|
10
12
|
export const Default = {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Alert } from '.';
|
|
3
3
|
import { ALERT_TYPE } from '../../providers/alerts';
|
|
4
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Elements/Alert',
|
|
6
7
|
component: Alert,
|
|
7
8
|
tags: ['autodocs'],
|
|
9
|
+
decorators: [UIVersion1],
|
|
8
10
|
};
|
|
9
11
|
export default meta;
|
|
10
12
|
export const Default = {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Alerts } from '.';
|
|
3
3
|
import { AlertsProvider } from '../../providers/alerts';
|
|
4
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Elements/Alerts',
|
|
6
7
|
component: Alerts,
|
|
7
8
|
tags: ['autodocs'],
|
|
9
|
+
decorators: [UIVersion1],
|
|
8
10
|
};
|
|
9
11
|
export default meta;
|
|
10
12
|
export const Default = {
|
|
@@ -37,11 +37,12 @@ export const Alerts = (_a) => {
|
|
|
37
37
|
}) })));
|
|
38
38
|
};
|
|
39
39
|
export const Alert = (_a) => {
|
|
40
|
+
var _b;
|
|
40
41
|
var { type = ALERT_TYPE.INFORMATIONAL, description = '', dismiss, sx } = _a, rest = __rest(_a, ["type", "description", "dismiss", "sx"]);
|
|
41
42
|
const theme = useTheme();
|
|
42
43
|
const style = {
|
|
43
44
|
backgroundColor: COLOR.ALERT_INFORMATIONAL_BG,
|
|
44
|
-
boxShadow: theme.boxShadow.NORMAL,
|
|
45
|
+
boxShadow: (_b = theme.boxShadow) === null || _b === void 0 ? void 0 : _b.NORMAL,
|
|
45
46
|
border: '2px solid',
|
|
46
47
|
borderColor: COLOR.ALERT_INFORMATIONAL_BORDER,
|
|
47
48
|
m: 0,
|
|
@@ -2,9 +2,11 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { ArrowLink } from '.';
|
|
3
3
|
import { Column } from '../layout/Column';
|
|
4
4
|
import { Box } from '../layout/Box';
|
|
5
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
5
6
|
const meta = {
|
|
6
7
|
title: 'Elements/ArrowLink',
|
|
7
8
|
component: ArrowLink,
|
|
9
|
+
decorators: [UIVersion1],
|
|
8
10
|
};
|
|
9
11
|
export default meta;
|
|
10
12
|
export const Default = {
|
package/dist/components/elements/{Fields/AutoComplete → AutoComplete}/AutoComplete.stories.js
RENAMED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { AutoComplete } from '.';
|
|
3
|
-
import { Paragraph, PARAGRAPH_SIZE } from '
|
|
4
|
-
import { HEADING_SIZE, Heading } from '
|
|
5
|
-
import { Column } from '
|
|
6
|
-
import { Row } from '
|
|
3
|
+
import { Paragraph, PARAGRAPH_SIZE } from '../Paragraph';
|
|
4
|
+
import { HEADING_SIZE, Heading } from '../Heading';
|
|
5
|
+
import { Column } from '../layout/Column';
|
|
6
|
+
import { Row } from '../layout/Row';
|
|
7
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
7
8
|
const options = [
|
|
8
9
|
{
|
|
9
10
|
label: 'Cucumber',
|
|
@@ -53,6 +54,7 @@ const meta = {
|
|
|
53
54
|
title: 'Elements/Fields/AutoComplete',
|
|
54
55
|
component: AutoComplete,
|
|
55
56
|
tags: ['autodocs'],
|
|
57
|
+
decorators: [UIVersion1],
|
|
56
58
|
};
|
|
57
59
|
export default meta;
|
|
58
60
|
export const Default = {
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
3
|
import '@testing-library/jest-dom';
|
|
4
4
|
import { describe, it, expect, vi } from 'vitest';
|
|
5
|
-
import { AutoComplete } from '
|
|
5
|
+
import { AutoComplete } from '.';
|
|
6
6
|
describe('AutoComplete Component', () => {
|
|
7
7
|
const options = [
|
|
8
8
|
{ label: 'Apple', value: 'apple' },
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
|
-
import { COLOR } from '
|
|
4
|
-
import { ListBox } from '
|
|
5
|
-
import { TextInput } from '
|
|
3
|
+
import { COLOR } from '../../../theme/colors';
|
|
4
|
+
import { ListBox } from '../ListBox';
|
|
5
|
+
import { TextInput } from '../TextInput';
|
|
6
6
|
export const AutoComplete = ({ value, options, onSelect, }) => {
|
|
7
7
|
const [inputValue, setInputValue] = useState(value);
|
|
8
8
|
const [filteredOptions, setFilteredOptions] = useState(options);
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { BrandingBar } from '.';
|
|
3
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
3
4
|
const meta = {
|
|
4
5
|
title: 'Elements/BrandingBar',
|
|
5
6
|
component: BrandingBar,
|
|
6
7
|
tags: ['autodocs'],
|
|
8
|
+
decorators: [UIVersion1],
|
|
7
9
|
};
|
|
8
10
|
export default meta;
|
|
9
11
|
export const Default = {
|
|
@@ -4,15 +4,17 @@ import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
|
4
4
|
import SettingsIcon from '@mui/icons-material/Settings';
|
|
5
5
|
import { BUTTON_SIZE, BUTTON_TYPE, Button, LinkButton } from '.';
|
|
6
6
|
import { GROUP_TYPE, Group } from '../Group';
|
|
7
|
-
import { HEADING_SIZE, Heading } from '../
|
|
7
|
+
import { HEADING_SIZE, Heading } from '../Heading';
|
|
8
8
|
import { Column } from '../layout/Column';
|
|
9
9
|
import { Row } from '../layout/Row';
|
|
10
|
-
import { Paragraph } from '../
|
|
10
|
+
import { Paragraph } from '../Paragraph';
|
|
11
11
|
import { COLOR } from '../../../theme/colors';
|
|
12
|
+
import { UIVersion1 } from '../../../utils/decorators/UIVersion1';
|
|
12
13
|
const meta = {
|
|
13
14
|
title: 'Elements/Button',
|
|
14
15
|
component: Button,
|
|
15
16
|
tags: ['autodocs'],
|
|
17
|
+
decorators: [UIVersion1],
|
|
16
18
|
};
|
|
17
19
|
export default meta;
|
|
18
20
|
const sizes = [
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.spinnerWrapper {
|
|
2
|
+
position: relative;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.button {
|
|
9
|
+
border-radius: 4px;
|
|
10
|
+
border-width: 1px;
|
|
11
|
+
border-style: solid;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: row;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.bodyWrapper {
|
|
19
|
+
flex-grow: 1;
|
|
20
|
+
justify-content: flex-start;
|
|
21
|
+
text-overflow: ellipsis;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-align: start;
|
|
25
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ButtonV2 } from '.';
|
|
3
|
+
declare const meta: Meta<typeof ButtonV2>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ButtonV2>;
|
|
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,90 @@
|
|
|
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 { BUTTONV2_SIZE, BUTTONV2_TYPE, ButtonV2, LinkButtonV2 } from '.';
|
|
6
|
+
import { GROUPV2_TYPE, GroupV2 } from '../GroupV2';
|
|
7
|
+
import { HEADINGV2_SIZE, HeadingV2 } from '../HeadingV2';
|
|
8
|
+
import { ColumnV2 } from '../layoutV2/ColumnV2';
|
|
9
|
+
import { RowV2 } from '../layoutV2/RowV2';
|
|
10
|
+
import { ParagraphV2 } from '../ParagraphV2';
|
|
11
|
+
import { COLOR } from '../../../theme/colors';
|
|
12
|
+
import { UIVersion2 } from '../../../utils/decorators/UIVersion2';
|
|
13
|
+
const meta = {
|
|
14
|
+
title: 'Elements/ButtonV2',
|
|
15
|
+
component: ButtonV2,
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
decorators: [UIVersion2],
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
const sizes = [
|
|
21
|
+
{ size: BUTTONV2_SIZE.LG, label: 'Large' },
|
|
22
|
+
{ size: BUTTONV2_SIZE.MD, label: 'Medium' },
|
|
23
|
+
{ size: BUTTONV2_SIZE.SM, label: 'Small' },
|
|
24
|
+
];
|
|
25
|
+
export const Default = {
|
|
26
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.MD }, { children: size.label })), _jsx(ButtonV2, Object.assign({}, args, { size: size.size, sx: { mt: 1 } }))] })))) })),
|
|
27
|
+
args: {
|
|
28
|
+
type: BUTTONV2_TYPE.DEFAULT,
|
|
29
|
+
children: 'Click Me',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const facebookBlue = '#4267B2';
|
|
33
|
+
export const CustomColor = {
|
|
34
|
+
render: (args) => (_jsxs(ColumnV2, { children: [_jsx(ParagraphV2, { children: "Use customColor prop for colors not in theme" }), _jsx(RowV2, { children: _jsx(ButtonV2, Object.assign({}, args, { customColor: facebookBlue, textColor: COLOR.WHITE, sx: { mt: 1 } })) })] })),
|
|
35
|
+
args: {
|
|
36
|
+
type: BUTTONV2_TYPE.DEFAULT,
|
|
37
|
+
children: 'Click Me',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const Link = {
|
|
41
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.MD }, { children: size.label })), _jsx(LinkButtonV2, Object.assign({}, args, { sx: { mt: 1 } }))] })))) })),
|
|
42
|
+
args: {
|
|
43
|
+
type: BUTTONV2_TYPE.DEFAULT,
|
|
44
|
+
children: 'Click Me',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
export const OutlineButton = {
|
|
48
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.MD }, { children: size.label })), _jsx(ButtonV2, Object.assign({}, args, { size: size.size, sx: { mt: 1 } }))] })))) })),
|
|
49
|
+
args: {
|
|
50
|
+
type: BUTTONV2_TYPE.OUTLINE,
|
|
51
|
+
children: 'Click Me',
|
|
52
|
+
onClick: () => { },
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
export const TextButton = {
|
|
56
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.MD }, { children: size.label })), _jsx(ButtonV2, Object.assign({}, args, { size: size.size, sx: { mt: 1 } }))] })))) })),
|
|
57
|
+
args: {
|
|
58
|
+
type: BUTTONV2_TYPE.TEXT,
|
|
59
|
+
onClick: () => { },
|
|
60
|
+
children: 'Click Me',
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
export const IconButton = {
|
|
64
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.MD }, { children: size.label })), _jsx(ButtonV2, Object.assign({}, args, { size: size.size, sx: { mt: 1 }, primaryIcon: SettingsIcon }))] })))) })),
|
|
65
|
+
args: {
|
|
66
|
+
type: BUTTONV2_TYPE.TEXT,
|
|
67
|
+
children: 'Click Me',
|
|
68
|
+
onClick: () => { },
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
export const LeftIcon = {
|
|
72
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.MD }, { children: size.label })), _jsx(ButtonV2, Object.assign({}, args, { size: size.size, sx: { mt: 1 }, leftIcon: SearchIcon }))] })))) })),
|
|
73
|
+
args: {
|
|
74
|
+
onClick: () => { },
|
|
75
|
+
children: 'Search',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
export const RightIcon = {
|
|
79
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.MD }, { children: size.label })), _jsx(ButtonV2, Object.assign({}, args, { size: size.size, sx: { mt: 1 }, rightIcon: ArrowDropDownIcon }))] })))) })),
|
|
80
|
+
args: {
|
|
81
|
+
onClick: () => { },
|
|
82
|
+
children: 'Select',
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
export const Loading = {
|
|
86
|
+
render: () => (_jsxs(ColumnV2, { children: [_jsx(RowV2, { children: _jsx(ButtonV2, Object.assign({ loading: true }, { children: "Click Me" })) }), _jsx(RowV2, Object.assign({ sx: { mt: 1 } }, { children: _jsx(ButtonV2, Object.assign({ type: BUTTONV2_TYPE.OUTLINE, loading: true }, { children: "Click Me" })) })), _jsx(RowV2, Object.assign({ sx: { mt: 1 } }, { children: _jsx(ButtonV2, Object.assign({ type: BUTTONV2_TYPE.TEXT, loading: true }, { children: "Click Me" })) }))] })),
|
|
87
|
+
};
|
|
88
|
+
export const Disabled = {
|
|
89
|
+
render: () => (_jsxs(ColumnV2, { children: [_jsx(RowV2, { children: _jsx(ButtonV2, Object.assign({ disabled: true }, { children: "Click Me" })) }), _jsx(RowV2, Object.assign({ sx: { mt: 1 } }, { children: _jsx(ButtonV2, Object.assign({ type: BUTTONV2_TYPE.OUTLINE, disabled: true }, { children: "Click Me" })) })), _jsx(RowV2, Object.assign({ sx: { mt: 1 } }, { children: _jsx(ButtonV2, Object.assign({ type: BUTTONV2_TYPE.TEXT, disabled: true }, { children: "Click Me" })) }))] })),
|
|
90
|
+
};
|