@ndlib/component-library 1.0.45 → 1.0.47
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/dist/components/composites/Card/Card.stories.js +7 -7
- package/dist/components/composites/Card/Card.test.js +1 -1
- package/dist/components/composites/Card/index.js +10 -10
- package/dist/components/composites/CardV2/CardV2.stories.js +14 -14
- package/dist/components/composites/CardV2/CardV2.test.js +1 -1
- package/dist/components/composites/CardV2/index.js +11 -11
- package/dist/components/composites/DragDropList/DragDrop.test.js +1 -1
- package/dist/components/composites/DragDropList/DragDropList.stories.d.ts +2 -3
- package/dist/components/composites/DragDropList/DragDropList.stories.js +2 -2
- package/dist/components/composites/DragDropList/index.d.ts +1 -2
- package/dist/components/composites/DragDropList/index.js +5 -5
- package/dist/components/composites/DropdownLinks/DropdownLinks.stories.js +3 -3
- package/dist/components/composites/DropdownLinks/DropdownLinks.test.js +1 -1
- package/dist/components/composites/DropdownLinks/index.js +2 -2
- package/dist/components/composites/DropdownLinksV2/DropdownLinksV2.stories.js +3 -3
- package/dist/components/composites/DropdownLinksV2/index.js +2 -2
- package/dist/components/composites/EmptyState/EmptyState.stories.js +1 -1
- package/dist/components/composites/EmptyState/index.js +2 -2
- package/dist/components/composites/EmptyStateV2/EmptyStateV2.module.css +10 -0
- package/dist/components/composites/EmptyStateV2/EmptyStateV2.stories.d.ts +10 -0
- package/dist/components/composites/EmptyStateV2/EmptyStateV2.stories.js +33 -0
- package/dist/components/composites/EmptyStateV2/index.d.ts +15 -0
- package/dist/components/composites/EmptyStateV2/index.js +36 -0
- package/dist/components/composites/Modal/Modal.stories.js +2 -2
- package/dist/components/composites/Modal/Modal.test.js +4 -4
- package/dist/components/composites/Modal/index.js +5 -5
- package/dist/components/composites/ModalV2/ModalV2.stories.js +2 -2
- package/dist/components/composites/ModalV2/ModalV2.test.js +4 -4
- package/dist/components/composites/ModalV2/index.js +5 -5
- package/dist/components/composites/NavMenu/demo.js +1 -1
- package/dist/components/composites/NavMenu/index.js +6 -6
- package/dist/components/composites/NavMenuV2/demoV2.js +2 -2
- package/dist/components/composites/NavMenuV2/index.js +3 -3
- package/dist/components/composites/Seo/SeoDataDisplay/index.js +1 -1
- package/dist/components/composites/Seo/index.js +1 -1
- package/dist/components/composites/SnackBar/examples.js +7 -7
- package/dist/components/composites/SnackBar/index.js +4 -4
- package/dist/components/composites/StructuredData/index.d.ts +0 -1
- package/dist/components/composites/StructuredData/index.js +1 -1
- package/dist/components/elements/Alerts/Alerts.stories.js +2 -2
- package/dist/components/elements/Alerts/index.js +2 -2
- package/dist/components/elements/AlertsV2/AlertsV2.stories.js +2 -2
- package/dist/components/elements/AlertsV2/index.js +1 -1
- package/dist/components/elements/ArrowLink/ArrowLink.stories.js +1 -1
- package/dist/components/elements/ArrowLink/ArrowLink.test.js +5 -5
- package/dist/components/elements/ArrowLink/index.d.ts +0 -1
- package/dist/components/elements/ArrowLink/index.js +3 -3
- package/dist/components/elements/ArrowLinkV2/ArrowLinkV2.stories.js +1 -1
- package/dist/components/elements/ArrowLinkV2/index.d.ts +0 -1
- package/dist/components/elements/ArrowLinkV2/index.js +1 -1
- package/dist/components/elements/AutoComplete/AutoComplete.stories.js +1 -1
- package/dist/components/elements/BoxV2/BoxV2.stories.js +1 -1
- package/dist/components/elements/BoxV2/index.d.ts +2 -2
- package/dist/components/elements/BrandingBar/index.d.ts +0 -1
- package/dist/components/elements/BrandingBar/index.js +4 -4
- package/dist/components/elements/BrandingBarV2/index.js +1 -1
- package/dist/components/elements/Button/Button.stories.js +9 -9
- package/dist/components/elements/Button/Button.test.js +1 -1
- package/dist/components/elements/Button/index.d.ts +14 -14
- package/dist/components/elements/Button/index.js +4 -4
- package/dist/components/elements/ButtonV2/ButtonV2.stories.js +9 -9
- package/dist/components/elements/ButtonV2/ButtonV2.test.js +1 -1
- package/dist/components/elements/ButtonV2/index.d.ts +15 -15
- package/dist/components/elements/ButtonV2/index.js +2 -2
- package/dist/components/elements/CheckboxGroup/index.js +2 -2
- package/dist/components/elements/CheckboxGroupV2/index.js +2 -2
- package/dist/components/elements/ColumnV2/index.d.ts +2 -2
- package/dist/components/elements/ColumnV2/index.js +1 -1
- package/dist/components/elements/ConsentBanner/ConsentBanner.stories.js +1 -1
- package/dist/components/elements/ConsentBanner/index.js +4 -4
- package/dist/components/elements/DatePicker/DatePicker.stories.js +3 -3
- package/dist/components/elements/DatePicker/index.d.ts +3 -3
- package/dist/components/elements/DatePickerV2/DatePickerV2.stories.js +3 -3
- package/dist/components/elements/DatePickerV2/index.d.ts +3 -3
- package/dist/components/elements/Dropdown/Dropdown.stories.js +3 -3
- package/dist/components/elements/Dropdown/index.js +2 -2
- package/dist/components/elements/DropdownV2/DropdownV2.stories.js +3 -3
- package/dist/components/elements/DropdownV2/index.js +2 -2
- package/dist/components/elements/Group/index.js +1 -1
- package/dist/components/elements/GroupV2/index.js +1 -1
- package/dist/components/elements/Heading/Heading.stories.js +3 -3
- package/dist/components/elements/Heading/Heading.test.js +2 -2
- package/dist/components/elements/HeadingV2/HeadingV2.stories.js +3 -3
- package/dist/components/elements/HeadingV2/HeadingV2.test.js +2 -2
- package/dist/components/elements/Icon/Icon.stories.js +1 -1
- package/dist/components/elements/IconV2/IconV2.stories.js +1 -1
- package/dist/components/elements/Label/Label.stories.js +1 -1
- package/dist/components/elements/Label/Label.test.js +5 -5
- package/dist/components/elements/LabelV2/LabelV2.stories.js +1 -1
- package/dist/components/elements/LabelV2/LabelV2.test.js +5 -5
- package/dist/components/elements/Link/Link.stories.js +1 -1
- package/dist/components/elements/Link/Link.test.js +7 -7
- package/dist/components/elements/List/List.stories.js +5 -5
- package/dist/components/elements/List/List.test.js +2 -2
- package/dist/components/elements/List/index.js +5 -5
- package/dist/components/elements/ListBox/index.d.ts +2 -17
- package/dist/components/elements/ListBox/index.js +3 -3
- package/dist/components/elements/ListBoxV2/index.d.ts +2 -18
- package/dist/components/elements/ListBoxV2/index.js +2 -2
- package/dist/components/elements/ListV2/ListV2.stories.js +5 -5
- package/dist/components/elements/ListV2/index.js +5 -5
- package/dist/components/elements/Markdown/index.d.ts +0 -1
- package/dist/components/elements/Markdown/index.js +2 -2
- package/dist/components/elements/MarkdownV2/index.d.ts +0 -1
- package/dist/components/elements/MarkdownV2/index.js +2 -2
- package/dist/components/elements/MonthPicker/MonthPicker.stories.js +2 -2
- package/dist/components/elements/MonthPickerV2/MonthPickerV2.stories.js +2 -2
- package/dist/components/elements/Paragraph/Paragraph.stories.js +2 -2
- package/dist/components/elements/ParagraphV2/ParagraphV2.stories.js +2 -2
- package/dist/components/elements/Pill/Pill.stories.js +3 -3
- package/dist/components/elements/Pill/index.d.ts +6 -6
- package/dist/components/elements/Pill/index.js +2 -2
- package/dist/components/elements/PillV2/PillV2.stories.js +3 -3
- package/dist/components/elements/PillV2/index.d.ts +6 -6
- package/dist/components/elements/PillV2/index.js +1 -1
- package/dist/components/elements/RadioGroup/index.js +2 -2
- package/dist/components/elements/RadioGroupV2/index.js +2 -2
- package/dist/components/elements/RawHtml/index.d.ts +0 -1
- package/dist/components/elements/ReadMore/ReadMore.stories.js +4 -4
- package/dist/components/elements/ReadMore/index.js +3 -3
- package/dist/components/elements/ReadMoreV2/ReadMoreV2.stories.js +4 -4
- package/dist/components/elements/ReadMoreV2/index.js +3 -3
- package/dist/components/elements/RowV2/index.d.ts +4 -4
- package/dist/components/elements/RowV2/index.js +1 -1
- package/dist/components/elements/Select/Select.stories.js +3 -3
- package/dist/components/elements/Select/index.js +7 -7
- package/dist/components/elements/SelectV2/SelectV2.stories.js +3 -3
- package/dist/components/elements/SelectV2/index.js +4 -4
- package/dist/components/elements/Spinner/Spinner.stories.js +1 -1
- package/dist/components/elements/Spinner/index.d.ts +0 -1
- package/dist/components/elements/SpinnerV2/SpinnerV2.stories.js +1 -1
- package/dist/components/elements/SpinnerV2/index.d.ts +0 -1
- package/dist/components/elements/TabList/example.js +2 -2
- package/dist/components/elements/TabList/index.js +2 -2
- package/dist/components/elements/TabListV2/example.js +2 -2
- package/dist/components/elements/TabListV2/index.js +2 -2
- package/dist/components/elements/Table/Table.stories.js +18 -18
- package/dist/components/elements/Table/Table.test.js +1 -1
- package/dist/components/elements/Table/index.d.ts +0 -1
- package/dist/components/elements/Table/index.js +8 -8
- package/dist/components/elements/TextInput/TextInput.stories.js +4 -4
- package/dist/components/elements/TextInput/TextInput.test.js +2 -2
- package/dist/components/elements/TextInput/index.d.ts +10 -10
- package/dist/components/elements/TextInput/index.js +7 -7
- package/dist/components/elements/TextInputV2/TextInputV2.stories.js +4 -4
- package/dist/components/elements/TextInputV2/TextInputV2.test.js +1 -1
- package/dist/components/elements/TextInputV2/index.d.ts +11 -11
- package/dist/components/elements/TextInputV2/index.js +4 -4
- package/dist/components/elements/layout/Box.d.ts +2 -2
- package/dist/components/elements/layout/Box.stories.js +1 -1
- package/dist/components/elements/layout/Column.d.ts +2 -2
- package/dist/components/elements/layout/Column.js +1 -1
- package/dist/components/elements/layout/Flex.stories.js +4 -4
- package/dist/components/elements/layout/Flex.test.js +2 -2
- package/dist/components/elements/layout/Row.d.ts +3 -3
- package/dist/components/elements/layout/Row.js +1 -1
- package/dist/components/elements/option.d.ts +0 -1
- package/dist/components/providers/alerts.js +1 -1
- package/dist/components/providers/componentConfig.js +1 -1
- package/dist/components/providers/componentConfigV2.js +1 -1
- package/dist/components/providers/dialogs.js +2 -2
- package/dist/components/providers/env.js +2 -2
- package/dist/components/providers/media.js +2 -2
- package/dist/components/providers/mediaV2.js +2 -2
- package/dist/components/providers/menu.js +1 -1
- package/dist/components/providers/snackBar.d.ts +0 -1
- package/dist/components/providers/snackBar.js +2 -2
- package/dist/components/providers/ui.js +1 -1
- package/dist/components/providers/uiV2.js +1 -1
- package/dist/components/providers/uniqueIds.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/theme/Color.stories.js +1 -1
- package/dist/theme/Typography.stories.js +1 -1
- package/dist/theme/colors.d.ts +2 -2
- package/dist/theme/colors.js +4 -2
- package/dist/theme/css-variables.css +2 -2
- package/dist/theme/index.d.ts +7 -90
- package/dist/theme/index.js +2 -2
- package/dist/theme/typography.d.ts +1 -1
- package/dist/utils/test.js +2 -2
- package/package.json +5 -5
|
@@ -20,13 +20,13 @@ const sizes = [
|
|
|
20
20
|
const p1 = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ultrices venenatis purus at porta. Etiam congue sapien leo, sed malesuada justo commodo in. Nunc consequat, massa non cursus posuere, magna eros lacinia lectus, eget lobortis mi erat ut justo. Maecenas nisi mi, mollis sed ornare vitae, pharetra sed augue. Curabitur mollis orci risus, sed imperdiet nisi aliquet et. Ut non elit nec magna rhoncus maximus sit amet ut dui. Mauris sit amet eleifend lectus. Aliquam consectetur posuere libero eu ultricies. Etiam rutrum non orci nec vulputate. Sed vel accumsan diam. Cras aliquet eros eros, sit amet pharetra eros tincidunt ut. Vestibulum est erat, eleifend dapibus eros vel, elementum vehicula risus. Etiam blandit condimentum sodales. Donec non libero in orci aliquam egestas fringilla eget purus. Suspendisse pellentesque at ligula ut accumsan.';
|
|
21
21
|
const p2 = 'Sed non lobortis mi, vitae dapibus arcu. Aenean at euismod arcu. Ut consectetur porttitor mattis. In eget vehicula augue. Ut at dolor posuere, tristique nisi finibus, posuere turpis. Etiam placerat, dui id lacinia volutpat, lorem turpis volutpat nisi, vel dapibus purus lorem at ante. Ut imperdiet enim nec arcu sagittis luctus.';
|
|
22
22
|
export const Default = {
|
|
23
|
-
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group,
|
|
23
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { type: GROUP_TYPE.REGION, children: [_jsx(Heading, { size: HEADING_SIZE.LG, underline: true, sx: { color: COLOR.PRIMARY }, children: size.label }), [p1, p2].map((content) => (_jsx(Paragraph, Object.assign({}, args, { size: size.size, children: content }))))] }))) })),
|
|
24
24
|
args: {
|
|
25
25
|
children: 'Heading',
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
export const LineClamp = {
|
|
29
|
-
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group,
|
|
29
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { type: GROUP_TYPE.REGION, children: [_jsx(Heading, { size: HEADING_SIZE.LG, underline: true, sx: { color: COLOR.PRIMARY }, children: size.label }), [p1, p2].map((content) => (_jsx(Paragraph, Object.assign({}, args, { size: size.size, clampLines: 2, children: content }))))] }))) })),
|
|
30
30
|
args: {
|
|
31
31
|
children: 'Heading',
|
|
32
32
|
},
|
|
@@ -20,13 +20,13 @@ const sizes = [
|
|
|
20
20
|
const p1 = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ultrices venenatis purus at porta. Etiam congue sapien leo, sed malesuada justo commodo in. Nunc consequat, massa non cursus posuere, magna eros lacinia lectus, eget lobortis mi erat ut justo. Maecenas nisi mi, mollis sed ornare vitae, pharetra sed augue. Curabitur mollis orci risus, sed imperdiet nisi aliquet et. Ut non elit nec magna rhoncus maximus sit amet ut dui. Mauris sit amet eleifend lectus. Aliquam consectetur posuere libero eu ultricies. Etiam rutrum non orci nec vulputate. Sed vel accumsan diam. Cras aliquet eros eros, sit amet pharetra eros tincidunt ut. Vestibulum est erat, eleifend dapibus eros vel, elementum vehicula risus. Etiam blandit condimentum sodales. Donec non libero in orci aliquam egestas fringilla eget purus. Suspendisse pellentesque at ligula ut accumsan.';
|
|
21
21
|
const p2 = 'Sed non lobortis mi, vitae dapibus arcu. Aenean at euismod arcu. Ut consectetur porttitor mattis. In eget vehicula augue. Ut at dolor posuere, tristique nisi finibus, posuere turpis. Etiam placerat, dui id lacinia volutpat, lorem turpis volutpat nisi, vel dapibus purus lorem at ante. Ut imperdiet enim nec arcu sagittis luctus.';
|
|
22
22
|
export const Default = {
|
|
23
|
-
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2,
|
|
23
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { type: GROUPV2_TYPE.REGION, children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.LG, underline: true, sx: { color: COLOR.PRIMARY }, children: size.label }), [p1, p2].map((content) => (_jsx(ParagraphV2, Object.assign({}, args, { size: size.size, children: content }))))] }))) })),
|
|
24
24
|
args: {
|
|
25
25
|
children: 'Heading',
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
export const LineClamp = {
|
|
29
|
-
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2,
|
|
29
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { type: GROUPV2_TYPE.REGION, children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.LG, underline: true, sx: { color: COLOR.PRIMARY }, children: size.label }), [p1, p2].map((content) => (_jsx(ParagraphV2, Object.assign({}, args, { size: size.size, clampLines: 2, children: content }))))] }))) })),
|
|
30
30
|
args: {
|
|
31
31
|
children: 'Heading',
|
|
32
32
|
},
|
|
@@ -18,7 +18,7 @@ const sizes = [
|
|
|
18
18
|
{ size: PILL_SIZE.SM, label: 'Small' },
|
|
19
19
|
];
|
|
20
20
|
export const Default = {
|
|
21
|
-
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group,
|
|
21
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { type: GROUP_TYPE.REGION, children: [_jsx(Heading, { size: HEADING_SIZE.MD, children: size.label }), _jsxs(Row, { sx: { mt: 2 }, children: [_jsx(Pill, Object.assign({}, args, { size: size.size, sx: { mr: 1 } })), _jsx(Pill, Object.assign({}, args, { size: size.size, type: PILL_TYPE.OUTLINE }))] })] }))) })),
|
|
22
22
|
args: {
|
|
23
23
|
type: PILL_TYPE.DEFAULT,
|
|
24
24
|
children: 'Virtual Event',
|
|
@@ -26,7 +26,7 @@ export const Default = {
|
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
export const Icon = {
|
|
29
|
-
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group,
|
|
29
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { type: GROUP_TYPE.REGION, children: [_jsx(Heading, { size: HEADING_SIZE.MD, children: size.label }), _jsxs(Row, { sx: { mt: 2 }, children: [_jsx(Pill, Object.assign({}, args, { size: size.size, sx: { mr: 1 }, icon: SearchIcon })), _jsx(Pill, Object.assign({}, args, { size: size.size, type: PILL_TYPE.OUTLINE, icon: SearchIcon }))] })] }))) })),
|
|
30
30
|
args: {
|
|
31
31
|
type: PILL_TYPE.DEFAULT,
|
|
32
32
|
children: 'Virtual Event',
|
|
@@ -34,7 +34,7 @@ export const Icon = {
|
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
36
|
export const NoAction = {
|
|
37
|
-
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group,
|
|
37
|
+
render: (args) => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { type: GROUP_TYPE.REGION, children: [_jsx(Heading, { size: HEADING_SIZE.MD, children: size.label }), _jsxs(Row, { sx: { mt: 2 }, children: [_jsx(Pill, Object.assign({}, args, { size: size.size, sx: { mr: 1 } })), _jsx(Pill, Object.assign({}, args, { size: size.size, type: PILL_TYPE.OUTLINE }))] })] }))) })),
|
|
38
38
|
args: {
|
|
39
39
|
type: PILL_TYPE.DEFAULT,
|
|
40
40
|
children: 'Virtual Event',
|
|
@@ -9,13 +9,13 @@ export declare enum PILL_TYPE {
|
|
|
9
9
|
OUTLINE = "outline"
|
|
10
10
|
}
|
|
11
11
|
export declare const Pill: React.ForwardRefExoticComponent<{
|
|
12
|
-
sx?: import("../../../theme").StylesProp
|
|
12
|
+
sx?: import("../../../theme").StylesProp;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
} & Omit<React.HTMLAttributes<HTMLButtonElement>, "children" | "onChange"> & {
|
|
15
|
-
size?: PILL_SIZE
|
|
16
|
-
type?: PILL_TYPE
|
|
17
|
-
color?: COLOR
|
|
18
|
-
icon?: React.FC<any
|
|
15
|
+
size?: PILL_SIZE;
|
|
16
|
+
type?: PILL_TYPE;
|
|
17
|
+
color?: COLOR;
|
|
18
|
+
icon?: React.FC<any>;
|
|
19
19
|
} & {
|
|
20
|
-
htmlFor?: string
|
|
20
|
+
htmlFor?: string;
|
|
21
21
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -107,12 +107,12 @@ export const Pill = React.forwardRef((_a, ref) => {
|
|
|
107
107
|
transform: hoverTransform,
|
|
108
108
|
textDecoration: hoverDecoration,
|
|
109
109
|
}
|
|
110
|
-
: undefined }), sx) }, rest, { children: [icon && (_jsx(Icon, { icon: icon, size: typographyStyles.fontSize, sx: { mr: iconMargin[size] }, color: hover ? hoverTextColor : textColor })), _jsx("div",
|
|
110
|
+
: undefined }), sx) }, rest, { children: [icon && (_jsx(Icon, { icon: icon, size: typographyStyles.fontSize, sx: { mr: iconMargin[size] }, color: hover ? hoverTextColor : textColor })), _jsx("div", { css: {
|
|
111
111
|
flexGrow: 1,
|
|
112
112
|
justifyContent: 'flex-start',
|
|
113
113
|
textOverflow: 'ellipsis',
|
|
114
114
|
whiteSpace: 'nowrap',
|
|
115
115
|
overflow: 'hidden',
|
|
116
116
|
textAlign: 'start',
|
|
117
|
-
}
|
|
117
|
+
}, children: body })] })));
|
|
118
118
|
});
|
|
@@ -18,7 +18,7 @@ const sizes = [
|
|
|
18
18
|
{ size: PILLV2_SIZE.SM, label: 'Small' },
|
|
19
19
|
];
|
|
20
20
|
export const Default = {
|
|
21
|
-
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2,
|
|
21
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { type: GROUPV2_TYPE.REGION, children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.MD, children: size.label }), _jsxs(RowV2, { sx: { mt: 2 }, children: [_jsx(PillV2, Object.assign({}, args, { size: size.size, sx: { mr: 1 } })), _jsx(PillV2, Object.assign({}, args, { size: size.size, type: PILLV2_TYPE.OUTLINE }))] })] }))) })),
|
|
22
22
|
args: {
|
|
23
23
|
type: PILLV2_TYPE.DEFAULT,
|
|
24
24
|
children: 'Virtual Event',
|
|
@@ -26,7 +26,7 @@ export const Default = {
|
|
|
26
26
|
},
|
|
27
27
|
};
|
|
28
28
|
export const Icon = {
|
|
29
|
-
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2,
|
|
29
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { type: GROUPV2_TYPE.REGION, children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.MD, children: size.label }), _jsxs(RowV2, { sx: { mt: 2 }, children: [_jsx(PillV2, Object.assign({}, args, { size: size.size, sx: { mr: 1 }, icon: SearchIcon })), _jsx(PillV2, Object.assign({}, args, { size: size.size, type: PILLV2_TYPE.OUTLINE, icon: SearchIcon }))] })] }))) })),
|
|
30
30
|
args: {
|
|
31
31
|
type: PILLV2_TYPE.DEFAULT,
|
|
32
32
|
children: 'Virtual Event',
|
|
@@ -34,7 +34,7 @@ export const Icon = {
|
|
|
34
34
|
},
|
|
35
35
|
};
|
|
36
36
|
export const NoAction = {
|
|
37
|
-
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2,
|
|
37
|
+
render: (args) => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { type: GROUPV2_TYPE.REGION, children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.MD, children: size.label }), _jsxs(RowV2, { sx: { mt: 2 }, children: [_jsx(PillV2, Object.assign({}, args, { size: size.size, sx: { mr: 1 } })), _jsx(PillV2, Object.assign({}, args, { size: size.size, type: PILLV2_TYPE.OUTLINE }))] })] }))) })),
|
|
38
38
|
args: {
|
|
39
39
|
type: PILLV2_TYPE.DEFAULT,
|
|
40
40
|
children: 'Virtual Event',
|
|
@@ -9,13 +9,13 @@ export declare enum PILLV2_TYPE {
|
|
|
9
9
|
OUTLINE = "outline"
|
|
10
10
|
}
|
|
11
11
|
export declare const PillV2: React.ForwardRefExoticComponent<{
|
|
12
|
-
sx?: import("../../../theme").StylesPropV2
|
|
12
|
+
sx?: import("../../../theme").StylesPropV2;
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
} & Omit<React.HTMLAttributes<HTMLButtonElement>, "children" | "onChange"> & {
|
|
15
|
-
size?: PILLV2_SIZE
|
|
16
|
-
type?: PILLV2_TYPE
|
|
17
|
-
color?: COLOR
|
|
18
|
-
icon?: React.FC<any
|
|
15
|
+
size?: PILLV2_SIZE;
|
|
16
|
+
type?: PILLV2_TYPE;
|
|
17
|
+
color?: COLOR;
|
|
18
|
+
icon?: React.FC<any>;
|
|
19
19
|
} & {
|
|
20
|
-
htmlFor?: string
|
|
20
|
+
htmlFor?: string;
|
|
21
21
|
} & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -75,5 +75,5 @@ export const PillV2 = React.forwardRef((_a, ref) => {
|
|
|
75
75
|
const processedSx = processSx(Object.assign(Object.assign({}, typographyStyles), sx));
|
|
76
76
|
return (_jsxs("button", Object.assign({ ref: ref, tabIndex: onClick ? 0 : -1, onClick: onClick, className: clsx(typeSafeStyles.pillButton, {
|
|
77
77
|
[typeSafeStyles.clickable]: clickable,
|
|
78
|
-
}), style: Object.assign(Object.assign({}, processedSx), { cursor, backgroundColor: colors[bg], color: colors[textColor], paddingLeft: paddingX, paddingRight: paddingX, height: height, borderColor: colors[borderColor] }) }, rest, { children: [icon && (_jsx(IconV2, { icon: icon, size: typographyStyles.fontSize, sx: { mr: iconMargin[size] }, color: textColor })), _jsx("div",
|
|
78
|
+
}), style: Object.assign(Object.assign({}, processedSx), { cursor, backgroundColor: colors[bg], color: colors[textColor], paddingLeft: paddingX, paddingRight: paddingX, height: height, borderColor: colors[borderColor] }) }, rest, { children: [icon && (_jsx(IconV2, { icon: icon, size: typographyStyles.fontSize, sx: { mr: iconMargin[size] }, color: textColor })), _jsx("div", { className: typeSafeStyles.pillContent, children: body })] })));
|
|
79
79
|
});
|
|
@@ -19,10 +19,10 @@ import { TYPOGRAPHY_TYPE, getTypographyStyles } from '../../../theme/typography'
|
|
|
19
19
|
import { Radio } from '../Radio';
|
|
20
20
|
export function RadioGroup(_a) {
|
|
21
21
|
var { options, checked, onChange, columnStyles, rowStyles } = _a, rest = __rest(_a, ["options", "checked", "onChange", "columnStyles", "rowStyles"]);
|
|
22
|
-
return (_jsx(Column, Object.assign({}, rest, { sx: columnStyles
|
|
22
|
+
return (_jsx(Column, Object.assign({}, rest, { sx: columnStyles, children: options.map((option) => (_jsx(Group, { type: GROUP_TYPE.RAW, children: ({ labelTargetId }) => (_jsxs(Row, { sx: Object.assign({ mb: 2, alignItems: 'center' }, rowStyles), children: [_jsx(Radio, { onChange: () => {
|
|
23
23
|
onChange(option.value);
|
|
24
24
|
}, checked: checked === option.value, id: labelTargetId, sx: {
|
|
25
25
|
mr: 2,
|
|
26
26
|
flexShrink: 0,
|
|
27
|
-
}, disabled: option.disabled }), _jsx(Label,
|
|
27
|
+
}, disabled: option.disabled }), _jsx(Label, { sx: Object.assign({ cursor: option.disabled ? 'not-allowed' : 'pointer' }, getTypographyStyles(TYPOGRAPHY_TYPE.PARAGRAPH_MEDIUM)), children: option.label })] })) }, option.value))) })));
|
|
28
28
|
}
|
|
@@ -18,10 +18,10 @@ import { TYPOGRAPHY_TYPE, getTypographyStyles } from '../../../theme/typography'
|
|
|
18
18
|
import { RadioV2 } from '../RadioV2';
|
|
19
19
|
export function RadioGroupV2(_a) {
|
|
20
20
|
var { options, checked, onChange, columnStyles, rowStyles } = _a, rest = __rest(_a, ["options", "checked", "onChange", "columnStyles", "rowStyles"]);
|
|
21
|
-
return (_jsx(ColumnV2, Object.assign({}, rest, { sx: columnStyles
|
|
21
|
+
return (_jsx(ColumnV2, Object.assign({}, rest, { sx: columnStyles, children: options.map((option) => (_jsx(GroupV2, { type: GROUPV2_TYPE.RAW, children: ({ labelTargetId }) => (_jsxs(RowV2, { sx: Object.assign({ mb: 2, alignItems: 'center' }, rowStyles), children: [_jsx(RadioV2, { onChange: () => {
|
|
22
22
|
onChange(option.value);
|
|
23
23
|
}, checked: checked === option.value, id: labelTargetId, sx: {
|
|
24
24
|
mr: 2,
|
|
25
25
|
flexShrink: 0,
|
|
26
|
-
}, disabled: option.disabled }), _jsx(LabelV2,
|
|
26
|
+
}, disabled: option.disabled }), _jsx(LabelV2, { htmlFor: labelTargetId, sx: Object.assign({ cursor: option.disabled ? 'not-allowed' : 'pointer' }, getTypographyStyles(TYPOGRAPHY_TYPE.PARAGRAPH_MEDIUM)), children: option.label })] })) }, option.value))) })));
|
|
27
27
|
}
|
|
@@ -14,15 +14,15 @@ export default meta;
|
|
|
14
14
|
const p1 = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ultrices venenatis purus at porta. Etiam congue sapien leo, sed malesuada justo commodo in. Nunc consequat, massa non cursus posuere, magna eros lacinia lectus, eget lobortis mi erat ut justo. Maecenas nisi mi, mollis sed ornare vitae, pharetra sed augue. Curabitur mollis orci risus, sed imperdiet nisi aliquet et. Ut non elit nec magna rhoncus maximus sit amet ut dui. Mauris sit amet eleifend lectus. Aliquam consectetur posuere libero eu ultricies. Etiam rutrum non orci nec vulputate. Sed vel accumsan diam. Cras aliquet eros eros, sit amet pharetra eros tincidunt ut. Vestibulum est erat, eleifend dapibus eros vel, elementum vehicula risus. Etiam blandit condimentum sodales. Donec non libero in orci aliquam egestas fringilla eget purus. Suspendisse pellentesque at ligula ut accumsan.';
|
|
15
15
|
const p2 = 'Lorem ipsum dolor sit';
|
|
16
16
|
export const Default = {
|
|
17
|
-
render: () => (_jsx(Column, { children: _jsx(ReadMore,
|
|
17
|
+
render: () => (_jsx(Column, { children: _jsx(ReadMore, { sx: { width: '250px' }, lines: 2, typography: TYPOGRAPHY_TYPE.PARAGRAPH_MEDIUM, children: p1 }) })),
|
|
18
18
|
};
|
|
19
19
|
export const NotTruncated = {
|
|
20
|
-
render: () => (_jsx(Column, { children: _jsx(ReadMore,
|
|
20
|
+
render: () => (_jsx(Column, { children: _jsx(ReadMore, { sx: { width: '250px' }, lines: 2, typography: TYPOGRAPHY_TYPE.PARAGRAPH_MEDIUM, children: p2 }) })),
|
|
21
21
|
};
|
|
22
22
|
export const CustomColor = {
|
|
23
|
-
render: () => (_jsx(Column, { children: _jsx(ReadMore,
|
|
23
|
+
render: () => (_jsx(Column, { children: _jsx(ReadMore, { lines: 2, typography: TYPOGRAPHY_TYPE.PARAGRAPH_MEDIUM, sx: {
|
|
24
24
|
color: COLOR.BACKGROUND,
|
|
25
25
|
bg: COLOR.PRIMARY,
|
|
26
26
|
width: '250px',
|
|
27
|
-
}
|
|
27
|
+
}, children: p1 }) })),
|
|
28
28
|
};
|
|
@@ -20,18 +20,18 @@ import { useManualRerender } from '../../../utils/hooks/useManualRerender';
|
|
|
20
20
|
const ReadMoreLink = (props) => {
|
|
21
21
|
const bg = colors[props.bg || COLOR.BACKGROUND];
|
|
22
22
|
const color = colors[props.color || COLOR.ND_BLUE_LIGHT];
|
|
23
|
-
return (_jsx("div",
|
|
23
|
+
return (_jsx("div", { css: {
|
|
24
24
|
whiteSpace: 'nowrap',
|
|
25
25
|
position: 'absolute',
|
|
26
26
|
right: 0,
|
|
27
27
|
bottom: 0,
|
|
28
28
|
paddingLeft: '3rem',
|
|
29
29
|
background: `linear-gradient(to right, ${bg}00, ${bg} 30%, ${bg} 100%)`,
|
|
30
|
-
}
|
|
30
|
+
}, children: _jsx("div", { "aria-hidden": "true", sx: {
|
|
31
31
|
color,
|
|
32
32
|
transform: 'scale(0.9)',
|
|
33
33
|
cursor: 'pointer',
|
|
34
|
-
}
|
|
34
|
+
}, children: "Read More..." }) }));
|
|
35
35
|
};
|
|
36
36
|
export const useLinesHeight = (args) => {
|
|
37
37
|
var _a, _b;
|
|
@@ -14,15 +14,15 @@ export default meta;
|
|
|
14
14
|
const p1 = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris ultrices venenatis purus at porta. Etiam congue sapien leo, sed malesuada justo commodo in. Nunc consequat, massa non cursus posuere, magna eros lacinia lectus, eget lobortis mi erat ut justo. Maecenas nisi mi, mollis sed ornare vitae, pharetra sed augue. Curabitur mollis orci risus, sed imperdiet nisi aliquet et. Ut non elit nec magna rhoncus maximus sit amet ut dui. Mauris sit amet eleifend lectus. Aliquam consectetur posuere libero eu ultricies. Etiam rutrum non orci nec vulputate. Sed vel accumsan diam. Cras aliquet eros eros, sit amet pharetra eros tincidunt ut. Vestibulum est erat, eleifend dapibus eros vel, elementum vehicula risus. Etiam blandit condimentum sodales. Donec non libero in orci aliquam egestas fringilla eget purus. Suspendisse pellentesque at ligula ut accumsan.';
|
|
15
15
|
const p2 = 'Lorem ipsum dolor sit';
|
|
16
16
|
export const Default = {
|
|
17
|
-
render: () => (_jsx(ColumnV2, { children: _jsx(ReadMoreV2,
|
|
17
|
+
render: () => (_jsx(ColumnV2, { children: _jsx(ReadMoreV2, { sx: { width: '250px' }, lines: 2, typography: TYPOGRAPHY_TYPE.PARAGRAPH_MEDIUM, children: p1 }) })),
|
|
18
18
|
};
|
|
19
19
|
export const NotTruncated = {
|
|
20
|
-
render: () => (_jsx(ColumnV2, { children: _jsx(ReadMoreV2,
|
|
20
|
+
render: () => (_jsx(ColumnV2, { children: _jsx(ReadMoreV2, { sx: { width: '250px' }, lines: 2, typography: TYPOGRAPHY_TYPE.PARAGRAPH_MEDIUM, children: p2 }) })),
|
|
21
21
|
};
|
|
22
22
|
export const CustomColor = {
|
|
23
|
-
render: () => (_jsx(ColumnV2, { children: _jsx(ReadMoreV2,
|
|
23
|
+
render: () => (_jsx(ColumnV2, { children: _jsx(ReadMoreV2, { lines: 2, typography: TYPOGRAPHY_TYPE.PARAGRAPH_MEDIUM, sx: {
|
|
24
24
|
color: COLOR.BACKGROUND,
|
|
25
25
|
bg: COLOR.PRIMARY,
|
|
26
26
|
width: '250px',
|
|
27
|
-
}
|
|
27
|
+
}, children: p1 }) })),
|
|
28
28
|
};
|
|
@@ -23,11 +23,11 @@ const typeSafeStyles = styles;
|
|
|
23
23
|
const ReadMoreLinkV2 = (props) => {
|
|
24
24
|
const bg = colors[props.bg || COLOR.BACKGROUND];
|
|
25
25
|
const color = props.color ? colors[props.color] : '';
|
|
26
|
-
return (_jsx("div",
|
|
26
|
+
return (_jsx("div", { className: typeSafeStyles.linkOuterWrapper, style: {
|
|
27
27
|
background: `linear-gradient(to right, ${bg}00, ${bg} 30%, ${bg} 100%)`,
|
|
28
|
-
}
|
|
28
|
+
}, children: _jsx("div", { className: typeSafeStyles.linkInnerWrapper, "aria-hidden": "true", style: {
|
|
29
29
|
color,
|
|
30
|
-
}
|
|
30
|
+
}, children: "Read More..." }) }));
|
|
31
31
|
};
|
|
32
32
|
export const useLinesHeightV2 = (args) => {
|
|
33
33
|
const styles = getTypographyStyles(args.typography);
|
|
@@ -10,11 +10,11 @@ export type FlexHelperPropsV2 = {
|
|
|
10
10
|
centered?: boolean;
|
|
11
11
|
};
|
|
12
12
|
export declare const RowV2: React.ForwardRefExoticComponent<{
|
|
13
|
-
sx?: import("../../../theme").StylesPropV2
|
|
13
|
+
sx?: import("../../../theme").StylesPropV2;
|
|
14
14
|
children?: React.ReactNode;
|
|
15
15
|
} & Omit<React.HTMLAttributes<HTMLDivElement>, "children" | "onChange"> & FlexHelperPropsV2 & {
|
|
16
|
-
breakpoint?: number
|
|
17
|
-
className?: string
|
|
16
|
+
breakpoint?: number;
|
|
17
|
+
className?: string;
|
|
18
18
|
} & {
|
|
19
|
-
htmlFor?: string
|
|
19
|
+
htmlFor?: string;
|
|
20
20
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -52,5 +52,5 @@ export const RowV2 = React.forwardRef((_a, ref) => {
|
|
|
52
52
|
return typeSafeStyles.flexRow;
|
|
53
53
|
};
|
|
54
54
|
const flexBreakpointClass = getBreakpointClass(breakpointParam);
|
|
55
|
-
return (_jsx("div", Object.assign({}, rest, { ref: ref, style: Object.assign(Object.assign({}, flexStyles), processedStyles), className: clsx(typeSafeStyles.row, flexBreakpointClass, className)
|
|
55
|
+
return (_jsx("div", Object.assign({}, rest, { ref: ref, style: Object.assign(Object.assign({}, flexStyles), processedStyles), className: clsx(typeSafeStyles.row, flexBreakpointClass, className), children: children })));
|
|
56
56
|
});
|
|
@@ -31,11 +31,11 @@ const StatefulSelect = (props) => {
|
|
|
31
31
|
return (_jsx(Select, Object.assign({ options: options }, props, { value: value, onSelectOption: setValue, placeholder: "Select A Fruit..." })));
|
|
32
32
|
};
|
|
33
33
|
export const Default = {
|
|
34
|
-
render: () => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading,
|
|
34
|
+
render: () => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, { size: HEADING_SIZE.MD, children: size.label }), _jsx(StatefulSelect, { size: size.size, leftIcon: AppleIcon, sx: { mt: 2 } })] }))) })),
|
|
35
35
|
};
|
|
36
36
|
export const WithLabel = {
|
|
37
|
-
render: () => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading,
|
|
37
|
+
render: () => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, { size: HEADING_SIZE.MD, children: size.label }), _jsx(StatefulSelect, { size: size.size, leftIcon: AppleIcon, sx: { mt: 2 }, label: "Fruit" })] }))) })),
|
|
38
38
|
};
|
|
39
39
|
export const InvertedColors = {
|
|
40
|
-
render: () => (_jsx(Column,
|
|
40
|
+
render: () => (_jsx(Column, { sx: { backgroundColor: COLOR.BLACK, p: 4 }, children: sizes.map((size) => (_jsxs(Group, { children: [_jsx(Heading, { size: HEADING_SIZE.MD, sx: { color: COLOR.WHITE }, children: size.label }), _jsx(StatefulSelect, { inverted: true, size: size.size, leftIcon: AppleIcon, sx: { mt: 2 }, label: "Fruit" })] }))) })),
|
|
41
41
|
};
|
|
@@ -118,7 +118,7 @@ export function Select({ size: sizeParam, placeholder, leftIcon, value, label, o
|
|
|
118
118
|
const focusStyles = {
|
|
119
119
|
boxShadow: inverted ? BOX_SHADOW.INVERTED : BOX_SHADOW.NORMAL,
|
|
120
120
|
};
|
|
121
|
-
return (_jsxs(Box,
|
|
121
|
+
return (_jsxs(Box, { sx: Object.assign({ width: DEFAULT_WIDTH, position: 'relative', borderRadius: '4px', backgroundColor: inverted ? COLOR.DARK_GRAY : COLOR.WHITE, ':hover fieldset': focusStyles, ':focus fieldset': focusStyles }, sx), children: [_jsx("fieldset", { sx: {
|
|
122
122
|
textAlign: 'left',
|
|
123
123
|
position: 'absolute',
|
|
124
124
|
inset: '-4px 0px 0px 0px',
|
|
@@ -132,7 +132,7 @@ export function Select({ size: sizeParam, placeholder, leftIcon, value, label, o
|
|
|
132
132
|
minWidth: '0%',
|
|
133
133
|
borderColor: inverted ? COLOR.WHITE : COLOR.LIGHT_GRAY,
|
|
134
134
|
zIndex: Z_INDEX.ELEVATED,
|
|
135
|
-
}
|
|
135
|
+
}, children: _jsx("legend", { style: {
|
|
136
136
|
width: 'auto',
|
|
137
137
|
float: 'unset',
|
|
138
138
|
overflow: 'hidden',
|
|
@@ -143,13 +143,13 @@ export function Select({ size: sizeParam, placeholder, leftIcon, value, label, o
|
|
|
143
143
|
fontSize: '0.75em',
|
|
144
144
|
visibility: 'hidden',
|
|
145
145
|
whiteSpace: 'nowrap',
|
|
146
|
-
}
|
|
146
|
+
}, children: label && (_jsx(Label, { standalone: true, sx: {
|
|
147
147
|
px: 1,
|
|
148
148
|
position: 'relative',
|
|
149
149
|
display: 'inline-flex',
|
|
150
150
|
opacity: '0',
|
|
151
151
|
visibility: 'hidden',
|
|
152
|
-
}, typography: labelTypographyMap[size]
|
|
152
|
+
}, typography: labelTypographyMap[size], children: label })) }) }), _jsx(Label, { id: inputId, typography: labelTypographyMap[size], sx: {
|
|
153
153
|
position: 'absolute',
|
|
154
154
|
left: '0.5rem',
|
|
155
155
|
lineHeight: 1,
|
|
@@ -157,7 +157,7 @@ export function Select({ size: sizeParam, placeholder, leftIcon, value, label, o
|
|
|
157
157
|
color: inverted ? COLOR.WHITE : COLOR.PRIMARY,
|
|
158
158
|
px: 1,
|
|
159
159
|
top: labelOffsetMap[size],
|
|
160
|
-
}
|
|
160
|
+
}, children: label }), _jsx(Button, { ref: refs.setReference, disableFocusStyles: true, role: "combobox", "aria-controls": listboxId, "aria-expanded": isOpen, "aria-labelledby": inputId, "aria-autocomplete": "none", "aria-activedescendant": isOpen && stagedOptionValue
|
|
161
161
|
? getOptionId(stagedOptionValue)
|
|
162
162
|
: undefined, type: BUTTON_TYPE.OUTLINE, size: buttonSize, onBlur: () => close(), onFocus: () => open(), onKeyDown: onKeyDown, onMouseDown: () => {
|
|
163
163
|
if (!isOpen) {
|
|
@@ -166,10 +166,10 @@ export function Select({ size: sizeParam, placeholder, leftIcon, value, label, o
|
|
|
166
166
|
else {
|
|
167
167
|
close();
|
|
168
168
|
}
|
|
169
|
-
}, color: inverted ? COLOR.WHITE : COLOR.TEXT, sx: Object.assign({ height, width: '100%', border: 'solid 0px', flexDirection: 'row', alignItems: 'center', position: 'relative', zIndex: Z_INDEX.NORMAL, background: 'none' }, typographyStyles), leftIcon: leftIcon, rightIcon: ArrowDropDownIcon
|
|
169
|
+
}, color: inverted ? COLOR.WHITE : COLOR.TEXT, sx: Object.assign({ height, width: '100%', border: 'solid 0px', flexDirection: 'row', alignItems: 'center', position: 'relative', zIndex: Z_INDEX.NORMAL, background: 'none' }, typographyStyles), leftIcon: leftIcon, rightIcon: ArrowDropDownIcon, children: currentOption ? renderOptionLabel(currentOption) : placeholder }), isOpen && (_jsx(ListBox, { id: listboxId, options: options, selected: value, focused: stagedOptionValue, selectOption: (option) => {
|
|
170
170
|
onSelectOption && onSelectOption(option.value);
|
|
171
171
|
close();
|
|
172
172
|
}, ref: refs.setFloating, renderOption: renderOption, sx: {
|
|
173
173
|
zIndex: Z_INDEX.DIALOG,
|
|
174
|
-
}, style: Object.assign(Object.assign({ minWidth: dropdownMinWidth }, floatingStyles), { boxShadow: inverted ? BOX_SHADOW.INVERTED : BOX_SHADOW.NORMAL }) }))] }))
|
|
174
|
+
}, style: Object.assign(Object.assign({ minWidth: dropdownMinWidth }, floatingStyles), { boxShadow: inverted ? BOX_SHADOW.INVERTED : BOX_SHADOW.NORMAL }) }))] }));
|
|
175
175
|
}
|
|
@@ -31,11 +31,11 @@ const StatefulSelect = (props) => {
|
|
|
31
31
|
return (_jsx(SelectV2, Object.assign({ options: options }, props, { value: value, onSelectOption: setValue, placeholder: "Select A Fruit..." })));
|
|
32
32
|
};
|
|
33
33
|
export const Default = {
|
|
34
|
-
render: () => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { children: [_jsx(HeadingV2,
|
|
34
|
+
render: () => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.MD, children: size.label }), _jsx(StatefulSelect, { size: size.size, leftIcon: AppleIcon, sx: { mt: 2 } })] }))) })),
|
|
35
35
|
};
|
|
36
36
|
export const WithLabel = {
|
|
37
|
-
render: () => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { children: [_jsx(HeadingV2,
|
|
37
|
+
render: () => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.MD, children: size.label }), _jsx(StatefulSelect, { size: size.size, leftIcon: AppleIcon, sx: { mt: 2 }, label: "Fruit" })] }))) })),
|
|
38
38
|
};
|
|
39
39
|
export const InvertedColors = {
|
|
40
|
-
render: () => (_jsx(ColumnV2,
|
|
40
|
+
render: () => (_jsx(ColumnV2, { sx: { backgroundColor: COLOR.BLACK, p: 4 }, children: sizes.map((size) => (_jsxs(GroupV2, { children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.MD, sx: { color: COLOR.WHITE }, children: size.label }), _jsx(StatefulSelect, { inverted: true, size: size.size, leftIcon: AppleIcon, sx: { mt: 2 }, label: "Fruit" })] }))) })),
|
|
41
41
|
};
|
|
@@ -130,13 +130,13 @@ export function SelectV2({ size: sizeParam, placeholder, leftIcon, value, label,
|
|
|
130
130
|
const fieldsetBorderColor = processSx({
|
|
131
131
|
borderColor: inverted ? COLOR.WHITE : COLOR.LIGHT_GRAY,
|
|
132
132
|
});
|
|
133
|
-
return (_jsxs(BoxV2, Object.assign({}, anchorElementProps, { className: className, sx: Object.assign(Object.assign(Object.assign({ width: DEFAULT_WIDTH, position: 'relative', borderRadius: '4px', backgroundColor: inverted ? COLOR.DARK_GRAY : COLOR.WHITE }, appliedHoverStyles), appliedFocusStyles), sx)
|
|
133
|
+
return (_jsxs(BoxV2, Object.assign({}, anchorElementProps, { className: className, sx: Object.assign(Object.assign(Object.assign({ width: DEFAULT_WIDTH, position: 'relative', borderRadius: '4px', backgroundColor: inverted ? COLOR.DARK_GRAY : COLOR.WHITE }, appliedHoverStyles), appliedFocusStyles), sx), children: [_jsx("fieldset", { className: typeSafeStyles.fieldset, style: Object.assign({}, fieldsetBorderColor), children: _jsx("legend", { className: typeSafeStyles.legend, children: label && (_jsx(LabelV2, { standalone: true, sx: {
|
|
134
134
|
px: 1,
|
|
135
135
|
position: 'relative',
|
|
136
136
|
display: 'inline-flex',
|
|
137
137
|
opacity: '0',
|
|
138
138
|
visibility: 'hidden',
|
|
139
|
-
}, typography: labelTypographyMapV2[size]
|
|
139
|
+
}, typography: labelTypographyMapV2[size], children: label })) }) }), _jsx(LabelV2, { id: inputId, typography: labelTypographyMapV2[size], sx: {
|
|
140
140
|
position: 'absolute',
|
|
141
141
|
left: '0.5rem',
|
|
142
142
|
lineHeight: 1,
|
|
@@ -144,7 +144,7 @@ export function SelectV2({ size: sizeParam, placeholder, leftIcon, value, label,
|
|
|
144
144
|
color: inverted ? COLOR.WHITE : COLOR.PRIMARY,
|
|
145
145
|
px: 1,
|
|
146
146
|
top: labelOffsetMapV2[size],
|
|
147
|
-
}
|
|
147
|
+
}, children: label }), _jsx(ButtonV2, { ref: refs.setReference, disableFocusStyles: true, role: "combobox", "aria-controls": listboxId, "aria-expanded": isOpen, "aria-labelledby": inputId, "aria-autocomplete": "none", "aria-activedescendant": isOpen && stagedOptionValue
|
|
148
148
|
? getOptionId(stagedOptionValue)
|
|
149
149
|
: undefined, type: BUTTONV2_TYPE.OUTLINE, size: buttonSize, onBlur: () => close(), onFocus: () => open(), onKeyDown: onKeyDown, onMouseDown: () => {
|
|
150
150
|
if (!isOpen) {
|
|
@@ -153,7 +153,7 @@ export function SelectV2({ size: sizeParam, placeholder, leftIcon, value, label,
|
|
|
153
153
|
else {
|
|
154
154
|
close();
|
|
155
155
|
}
|
|
156
|
-
}, color: inverted ? COLOR.WHITE : COLOR.TEXT, sx: Object.assign({ height, width: '100%', border: 'solid 0px', flexDirection: 'row', alignItems: 'center', position: 'relative', zIndex: Z_INDEX.NORMAL, background: 'none' }, typographyStyles), leftIcon: leftIcon, rightIcon: ArrowDropDownIcon
|
|
156
|
+
}, color: inverted ? COLOR.WHITE : COLOR.TEXT, sx: Object.assign({ height, width: '100%', border: 'solid 0px', flexDirection: 'row', alignItems: 'center', position: 'relative', zIndex: Z_INDEX.NORMAL, background: 'none' }, typographyStyles), leftIcon: leftIcon, rightIcon: ArrowDropDownIcon, children: currentOption ? renderOptionLabel(currentOption) : placeholder }), isOpen && (_jsx(ListBoxV2, { id: listboxId, options: options, selected: value, focused: stagedOptionValue, selectOption: (option) => {
|
|
157
157
|
onSelectOption && onSelectOption(option.value);
|
|
158
158
|
close();
|
|
159
159
|
}, ref: refs.setFloating, renderOption: renderOption, sx: {
|
|
@@ -17,7 +17,7 @@ const sizes = [
|
|
|
17
17
|
{ size: SPINNER_SIZE.SM, label: 'Small' },
|
|
18
18
|
];
|
|
19
19
|
export const Default = {
|
|
20
|
-
render: () => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group,
|
|
20
|
+
render: () => (_jsx(Column, { children: sizes.map((size) => (_jsxs(Group, { type: GROUP_TYPE.REGION, children: [_jsx(Heading, { size: HEADING_SIZE.SM, children: size.label }), _jsx(Spinner, { size: size.size })] }))) })),
|
|
21
21
|
args: {},
|
|
22
22
|
};
|
|
23
23
|
export const CustomColor = {
|
|
@@ -18,7 +18,7 @@ const sizes = [
|
|
|
18
18
|
{ size: SPINNERV2_SIZE.SM, label: 'Small' },
|
|
19
19
|
];
|
|
20
20
|
export const Default = {
|
|
21
|
-
render: () => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2,
|
|
21
|
+
render: () => (_jsx(ColumnV2, { children: sizes.map((size) => (_jsxs(GroupV2, { type: GROUPV2_TYPE.REGION, children: [_jsx(HeadingV2, { size: HEADINGV2_SIZE.SM, children: size.label }), _jsx(SpinnerV2, { size: size.size })] }))) })),
|
|
22
22
|
args: {},
|
|
23
23
|
};
|
|
24
24
|
export const CustomColor = {
|
|
@@ -31,6 +31,6 @@ const StateManager = ({ children }) => {
|
|
|
31
31
|
const [selected, setSelected] = React.useState('1');
|
|
32
32
|
return _jsx(_Fragment, { children: children({ selected, setSelected }) });
|
|
33
33
|
};
|
|
34
|
-
export const ExampleTabs = () => (_jsx(StateManager, { children: ({ selected, setSelected }) => (_jsx(TabList, { children: items.map((item) => (_jsx(Tab,
|
|
34
|
+
export const ExampleTabs = () => (_jsx(StateManager, { children: ({ selected, setSelected }) => (_jsx(TabList, { children: items.map((item) => (_jsx(Tab, { onClick: () => {
|
|
35
35
|
setSelected(item.id);
|
|
36
|
-
}, selected: selected === item.id
|
|
36
|
+
}, selected: selected === item.id, children: item.label }, item.id))) })) }));
|
|
@@ -21,10 +21,10 @@ export const Tab = (_a) => {
|
|
|
21
21
|
var { selected, children } = _a, rest = __rest(_a, ["selected", "children"]);
|
|
22
22
|
const typographyStyles = getTypographyStyles(TYPOGRAPHY_TYPE.CONDENSED_TEXT_LARGE);
|
|
23
23
|
const labelId = useUniqueId('tab-label');
|
|
24
|
-
return (_jsx("button", Object.assign({ role: "tab", sx: Object.assign({ height: '3.25rem', boxSizing: 'border-box', px: 4, bg: COLOR.WHITE, color: selected ? COLOR.DARK_GRAY : COLOR.GRAY, border: 'none', borderBottom: selected ? 'solid 3px' : 'solid 1px', borderColor: selected ? COLOR.ND_BLUE_BRIGHT : COLOR.LIGHT_GRAY, cursor: 'pointer' }, typographyStyles), "aria-labelledby": labelId, "aria-selected": selected ? 'true' : 'false' }, rest, { children: _jsx("div",
|
|
24
|
+
return (_jsx("button", Object.assign({ role: "tab", sx: Object.assign({ height: '3.25rem', boxSizing: 'border-box', px: 4, bg: COLOR.WHITE, color: selected ? COLOR.DARK_GRAY : COLOR.GRAY, border: 'none', borderBottom: selected ? 'solid 3px' : 'solid 1px', borderColor: selected ? COLOR.ND_BLUE_BRIGHT : COLOR.LIGHT_GRAY, cursor: 'pointer' }, typographyStyles), "aria-labelledby": labelId, "aria-selected": selected ? 'true' : 'false' }, rest, { children: _jsx("div", { id: labelId, sx: {
|
|
25
25
|
transform: selected ? 'scale(1.1)' : undefined,
|
|
26
26
|
':hover': {
|
|
27
27
|
transform: selected ? 'scale(1.1)' : 'scale(1.05)',
|
|
28
28
|
},
|
|
29
|
-
}
|
|
29
|
+
}, children: children }) })));
|
|
30
30
|
};
|
|
@@ -31,6 +31,6 @@ const StateManager = ({ children }) => {
|
|
|
31
31
|
const [selected, setSelected] = React.useState('1');
|
|
32
32
|
return _jsx(_Fragment, { children: children({ selected, setSelected }) });
|
|
33
33
|
};
|
|
34
|
-
export const ExampleTabsV2 = () => (_jsx(StateManager, { children: ({ selected, setSelected }) => (_jsx(TabListV2, { children: items.map((item) => (_jsx(TabV2,
|
|
34
|
+
export const ExampleTabsV2 = () => (_jsx(StateManager, { children: ({ selected, setSelected }) => (_jsx(TabListV2, { children: items.map((item) => (_jsx(TabV2, { onClick: () => {
|
|
35
35
|
setSelected(item.id);
|
|
36
|
-
}, selected: selected === item.id
|
|
36
|
+
}, selected: selected === item.id, children: item.label }, item.id))) })) }));
|
|
@@ -25,7 +25,7 @@ export const TabV2 = (_a) => {
|
|
|
25
25
|
const typographyStyles = getTypographyStyles(TYPOGRAPHY_TYPE.CONDENSED_TEXT_LARGE);
|
|
26
26
|
const processedSx = processSx(Object.assign(Object.assign({}, sx), typographyStyles));
|
|
27
27
|
const labelId = useUniqueId('tab-label');
|
|
28
|
-
return (_jsx("button", Object.assign({ role: "tab", className: typeSafeStyles.tabBtn, style: Object.assign({ color: selected ? 'var(--darkGray)' : 'var(--gray)', borderBottom: selected ? 'solid 3px' : 'solid 1px', borderColor: selected ? 'var(--ndBlueBright)' : 'var(--lightGray)' }, processedSx), "aria-labelledby": labelId, "aria-selected": selected ? 'true' : 'false' }, rest, { children: _jsx("div",
|
|
28
|
+
return (_jsx("button", Object.assign({ role: "tab", className: typeSafeStyles.tabBtn, style: Object.assign({ color: selected ? 'var(--darkGray)' : 'var(--gray)', borderBottom: selected ? 'solid 3px' : 'solid 1px', borderColor: selected ? 'var(--ndBlueBright)' : 'var(--lightGray)' }, processedSx), "aria-labelledby": labelId, "aria-selected": selected ? 'true' : 'false' }, rest, { children: _jsx("div", { id: labelId, className: selected
|
|
29
29
|
? typeSafeStyles.tabLabelSelected
|
|
30
|
-
: typeSafeStyles.tabLabelUnselected
|
|
30
|
+
: typeSafeStyles.tabLabelUnselected, children: children }) })));
|
|
31
31
|
};
|