@ndlib/component-library 1.0.41 → 1.0.43
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/NavMenu2/NavMenuV2.stories.d.ts +6 -0
- package/dist/components/composites/NavMenu2/NavMenuV2.stories.js +14 -0
- package/dist/components/composites/NavMenu2/demoV2.d.ts +1 -0
- package/dist/components/composites/NavMenu2/demoV2.js +189 -0
- package/dist/components/composites/NavMenu2/index.d.ts +5 -0
- package/dist/components/composites/NavMenu2/index.js +56 -0
- package/dist/components/composites/NavMenuV2/NavMenuV2.module.css +24 -0
- package/dist/components/elements/AlertsV2/AlertV2.stories.d.ts +10 -0
- package/dist/components/elements/AlertsV2/AlertV2.stories.js +51 -0
- package/dist/components/elements/AlertsV2/AlertsV2.module.css +49 -0
- package/dist/components/elements/AlertsV2/AlertsV2.stories.d.ts +7 -0
- package/dist/components/elements/AlertsV2/AlertsV2.stories.js +17 -0
- package/dist/components/elements/AlertsV2/index.d.ts +15 -0
- package/dist/components/elements/AlertsV2/index.js +50 -0
- package/dist/components/elements/ArrowLinkV2/ArrowLinkV2.module.css +47 -0
- package/dist/components/elements/ArrowLinkV2/ArrowLinkV2.stories.d.ts +6 -0
- package/dist/components/elements/ArrowLinkV2/ArrowLinkV2.stories.js +14 -0
- package/dist/components/elements/ArrowLinkV2/index.d.ts +7 -0
- package/dist/components/elements/ArrowLinkV2/index.js +21 -0
- package/dist/components/elements/BlockQuoteV2/BlockQuoteV2.module.css +6 -0
- package/dist/components/elements/BlockQuoteV2/index.d.ts +4 -0
- package/dist/components/elements/BlockQuoteV2/index.js +21 -0
- package/dist/components/elements/BrandingBarV2/BrandingBarV2.module.css +68 -0
- package/dist/components/elements/BrandingBarV2/BrandingBarV2.stories.d.ts +6 -0
- package/dist/components/elements/BrandingBarV2/BrandingBarV2.stories.js +13 -0
- package/dist/components/elements/BrandingBarV2/index.d.ts +2 -0
- package/dist/components/elements/BrandingBarV2/index.js +10 -0
- package/dist/components/elements/CaptionV2/index.d.ts +2 -0
- package/dist/components/elements/CaptionV2/index.js +22 -0
- package/dist/components/elements/DatePickerV2/DatePickerV2.stories.d.ts +8 -0
- package/dist/components/elements/DatePickerV2/DatePickerV2.stories.js +53 -0
- package/dist/components/elements/DatePickerV2/index.d.ts +23 -0
- package/dist/components/elements/DatePickerV2/index.js +57 -0
- package/dist/components/elements/DropdownV2/DropdownV2.stories.d.ts +8 -0
- package/dist/components/elements/DropdownV2/DropdownV2.stories.js +26 -0
- package/dist/components/elements/DropdownV2/index.d.ts +26 -0
- package/dist/components/elements/DropdownV2/index.js +81 -0
- package/dist/components/elements/InlineV2/InlineV2.stories.d.ts +6 -0
- package/dist/components/elements/InlineV2/InlineV2.stories.js +14 -0
- package/dist/components/elements/InlineV2/index.d.ts +6 -0
- package/dist/components/elements/InlineV2/index.js +23 -0
- package/dist/components/elements/ListV2/ListV2.stories.d.ts +10 -0
- package/dist/components/elements/ListV2/ListV2.stories.js +39 -0
- package/dist/components/elements/ListV2/index.d.ts +27 -0
- package/dist/components/elements/ListV2/index.js +102 -0
- package/dist/components/elements/MarkdownV2/MarkdownV2.module.css +39 -0
- package/dist/components/elements/MarkdownV2/MarkdownV2.stories.d.ts +10 -0
- package/dist/components/elements/MarkdownV2/MarkdownV2.stories.js +130 -0
- package/dist/components/elements/MarkdownV2/index.d.ts +11 -0
- package/dist/components/elements/MarkdownV2/index.js +123 -0
- package/dist/components/elements/MonthPickerV2/MonthPickerV2.stories.d.ts +7 -0
- package/dist/components/elements/MonthPickerV2/MonthPickerV2.stories.js +33 -0
- package/dist/components/elements/MonthPickerV2/index.d.ts +14 -0
- package/dist/components/elements/MonthPickerV2/index.js +26 -0
- package/dist/components/elements/PillV2/PillV2.module.css +29 -0
- package/dist/components/elements/PillV2/PillV2.stories.d.ts +8 -0
- package/dist/components/elements/PillV2/PillV2.stories.js +42 -0
- package/dist/components/elements/PillV2/index.d.ts +21 -0
- package/dist/components/elements/PillV2/index.js +79 -0
- package/dist/components/elements/RadioGroupV2/RadioGroupV2.stories.d.ts +7 -0
- package/dist/components/elements/RadioGroupV2/RadioGroupV2.stories.js +28 -0
- package/dist/components/elements/RadioGroupV2/index.d.ts +16 -0
- package/dist/components/elements/RadioGroupV2/index.js +27 -0
- package/dist/components/elements/RadioV2/RadioV2.module.css +17 -0
- package/dist/components/elements/RadioV2/RadioV2.stories.d.ts +6 -0
- package/dist/components/elements/RadioV2/RadioV2.stories.js +19 -0
- package/dist/components/elements/RadioV2/index.d.ts +8 -0
- package/dist/components/elements/RadioV2/index.js +23 -0
- package/dist/components/elements/TabListV2/TabListV2.module.css +21 -0
- package/dist/components/elements/TabListV2/TabListV2.stories.d.ts +6 -0
- package/dist/components/elements/TabListV2/TabListV2.stories.js +14 -0
- package/dist/components/elements/TabListV2/example.d.ts +7 -0
- package/dist/components/elements/TabListV2/example.js +36 -0
- package/dist/components/elements/TabListV2/index.d.ts +10 -0
- package/dist/components/elements/TabListV2/index.js +31 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
.sharedLink {
|
|
2
|
+
background-size: cover;
|
|
3
|
+
background-repeat: no-repeat;
|
|
4
|
+
display: block;
|
|
5
|
+
height: 50px;
|
|
6
|
+
line-height: 50px;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
text-indent: -9999px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.universityLogo {
|
|
12
|
+
margin: 0 auto;
|
|
13
|
+
position: relative;
|
|
14
|
+
width: 300px;
|
|
15
|
+
|
|
16
|
+
@media screen and (min-width: 800px) {
|
|
17
|
+
left: 12px;
|
|
18
|
+
margin: 0;
|
|
19
|
+
position: absolute;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
@media screen and (min-width: 1212px) {
|
|
23
|
+
left: 0;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.provostLogo {
|
|
28
|
+
display: none;
|
|
29
|
+
|
|
30
|
+
@media screen and (min-width: 800px) {
|
|
31
|
+
display: block;
|
|
32
|
+
position: absolute;
|
|
33
|
+
right: 12px;
|
|
34
|
+
width: 227px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@media screen and (min-width: 1212px) {
|
|
38
|
+
right: 0;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.hGroup {
|
|
43
|
+
background-color: var(--ndProvostBlue);
|
|
44
|
+
height: 50px;
|
|
45
|
+
display: block;
|
|
46
|
+
|
|
47
|
+
a {
|
|
48
|
+
color: var(--white);
|
|
49
|
+
text-decoration: none;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.navWrapper {
|
|
54
|
+
display: block;
|
|
55
|
+
margin: 0 auto;
|
|
56
|
+
max-width: 1200px;
|
|
57
|
+
padding: 0;
|
|
58
|
+
position: relative;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.nav {
|
|
62
|
+
box-sizing: border-box;
|
|
63
|
+
display: block;
|
|
64
|
+
height: 50px;
|
|
65
|
+
position: relative;
|
|
66
|
+
overflow: hidden;
|
|
67
|
+
width: 100%;
|
|
68
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { BrandingBarV2 } from '.';
|
|
3
|
+
import { UIVersion2 } from '../../../utils/decorators/UIVersion2';
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Elements/BrandingBarV2',
|
|
6
|
+
component: BrandingBarV2,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
decorators: [UIVersion2],
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
export const Default = {
|
|
12
|
+
render: () => _jsx(BrandingBarV2, {}),
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BoxV2 } from '../BoxV2';
|
|
3
|
+
import * as styles from './BrandingBarV2.module.css';
|
|
4
|
+
import clsx from 'clsx';
|
|
5
|
+
const typeSafeStyles = styles;
|
|
6
|
+
const ProvostImage = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAABkBAMAAADu741LAAAABGdBTUEAALGPC/xhBQAAABJQTFRFgJWu////////////AAAA////Uq//MQAAAAV0Uk5TFYlGxgATjWZIAAAFmklEQVR42u2YyZKjOBBAvYh7YZt7FaB7uQx3EPhuwPr/X+lMbUgCh909HTMTjuQEJJLy5Sqx6d//2hAjMRIjMRIjMRIjMRIjMRIjMRIjMRIjMRIjMRIjMRIjMRIjMRIjMRIjMRIjMRLjX76+PoPH5uv9GIvjFDxn03/D2OSfvzsuz9lL34mxr0v/RTf+gZa7/GWhyM1ywir4iYzbWsqzVaS4qOtH6aPvz2oI3p3MRzhCnpl774mii5/6Y/Dielv7LMUpDkar9Og94BKw2vSh7/daH1y1XAhRM1DsRxtzMpqNG3x9zgs5mDl3tQShVNYWGd7XKrqaYjbEXg55Xkv99CUlTCSrVcTmwqJ04KsfHkHR2uoADxf3AHPUE66mjbjLpPxQ2vywhRA0lmNusuEKaqFq8r7Br+DrTH5bJeQdKHREdXKAcXpMI6WNAnUn7MRqBX5fZWyH+E1Wrn6YyaqprQ5gPnionEIndISZqZUS4dppTdgnoJkRJd+oKGq2Aafc1NCJeYzCY+wvWuAYufZy5jO264zLyJTsESOGh2MEbQdr0Un5y5gUTI033W1NqCtarbUsNWMHjJmSm6GWsfcZjyGjdWjnMza39XT0I7NF7w/9Q8YWVbKMnTSe6rRFjWFRWM0Tx0I1iOuI7zWjuG8a7XtY5OYz9h5jHzK2ZnVReowPrqCmgmX7dnzMKOwKyOiAuQ5ax6x5TMjHQhdrNqlU77Aac4ujGHOPsWXh+ESGvkDGZompmksQmRjz13vflEFpf8ZoTNha4RWXb6Z1YS3HFUbrqutsp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ESIzESIzESIzESIzESIzESIzESIzESIzE+LeuX++EVHL5zn/fAAAAAElFTkSuQmCC';
|
|
7
|
+
const UniversityLogo = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlcAAABkCAMAAACclOWcAAAABGdBTUEAALGPC/xhBQAAADNQTFRF////////////////////////////////////////////////////////////AAAA////FbWC9gAAABB0Uk5TcI+vUM8w358gYO8Qf0C/AK6MYRQAAAmFSURBVHja7ZzrlqyqDoVVFOVavv/TbgFFLlGxu/qMM/ae80+v0hJD+AghWqv7QND31cEFELiCwBUEriAIXEHgCgJXEASuIHAFgSsIAlcQuILAFQSBKwhcQeAKgsAVBK4gcAVB4AoCVxC4giBwBYErCFxBELiCwBUEriAIXEHgCgJXEASuIHAFgSsIAlcQuPq/09R1C7wArr5MlR36VQKsfyFXyhjzPLCi/Ar7BgyT3JzVr/rnDRgz/c+s/Zl71de4WuyuwX3U+4fzTuHzvH8cwsc+mcPp5cEtxyH2SZqMvhI2k0iM0Xrej2pB+VaMqxOfk2N9fjcvK/N7jGscz6OD1sRrh0afS+cVQ8Sr3WiV36G03XrbVyvKsbux9iP00b++m+r4mam/sf307KDFdPm1sW5jqRtn1cj1uSWTi1dsdt2VwezFd3825yWml+48OxIMHr8bTNkv789Lls67kO8OXLqtgZmp84rBnR6dAVtjKSMz9xdaj09f+l9tzQ7GiO1LJk15eBiuZLw3e/z4uOObtj9nd7TvDtfq+DCLNq6GMNwLlXV5E3bXBxcm/vC3dT1lxt+Qs/zyG2s/nT8s/dHVlvc2ffBXuJxf274MfG/Hytj7OsZIqo19gDNPlA5fRDTf3UCEdZCfTvGf5mKm+XYPSxZ/War88nhoTByXt6hcg8HverXVhduZZcwa2KnbsPKX89wCb1/qqGUdPTXrPkQiHanP4jw7REsaqdpau4lry3p26cqF4Ua+Z+LTbK3rtVt6lftbx8oxnA3X367BMTgYx6hkxHec86lYNieB5Ri+EkB2mP9Rg7PIcWWjcT4slxmE7/E5ylm0+FSXn0M9xQ9SlTM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b31nfmdKVu8+ZU/f3e9bv9ZBX7n9axhneCEt3MRLniU5PABuPq6TPNvKyBw1aTJv+mDcAWuvp1ZWdZJZFfg6rty9aEB/yEDuPq2FgOqwBUEriBwBUHgCgJXELiCIHAFgSsIXEEQuILAFQSuIAhcQeAKAlcQBK4gcAWBKwgCVxC4gsAVBIErCFxB4AqCwBUEriBwBYEruAACVxC4gsAVBIErCFxB/0n9A/6wliZWAPp5AAAAAElFTkSuQmCC';
|
|
8
|
+
export const BrandingBarV2 = () => {
|
|
9
|
+
return (_jsx("hgroup", Object.assign({ className: typeSafeStyles.hGroup }, { children: _jsx(BoxV2, Object.assign({ className: typeSafeStyles.navWrapper }, { children: _jsxs("nav", Object.assign({ "aria-label": "University of Notre Dame", className: typeSafeStyles.nav }, { children: [_jsxs("a", Object.assign({ className: clsx(typeSafeStyles.universityLogo, typeSafeStyles.sharedLink), style: { backgroundImage: `url(${UniversityLogo})` }, href: "http://nd.edu" }, { children: ["University ", _jsx("i", { children: "of" }), " Notre Dame"] })), _jsxs("a", Object.assign({ className: clsx(typeSafeStyles.provostLogo, typeSafeStyles.sharedLink), style: { backgroundImage: `url(${ProvostImage})` }, href: "http://provost.nd.edu" }, { children: ["Office ", _jsx("i", { children: "of the" }), " Provost"] }))] })) })) })));
|
|
10
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
export const CaptionV2 = (_a) => {
|
|
14
|
+
var rest = __rest(_a, []);
|
|
15
|
+
return (_jsx("caption", Object.assign({ style: {
|
|
16
|
+
display: 'block',
|
|
17
|
+
fontStyle: 'italic',
|
|
18
|
+
fontWeight: 400,
|
|
19
|
+
fontFamily: '"Libre Franklin","Helvetica Neue",Helvetica,Arial,Verdana,sans-serif',
|
|
20
|
+
fontSize: '0.8rem',
|
|
21
|
+
} }, rest)));
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DatePickerV2 } from '.';
|
|
3
|
+
declare const meta: Meta<typeof DatePickerV2>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DatePickerV2>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Inline: Story;
|
|
8
|
+
export declare const HighlightedDates: Story;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { DatePickerV2 } from '.';
|
|
4
|
+
import { BoxV2 } from '../BoxV2';
|
|
5
|
+
import { UIVersion2 } from '../../../utils/decorators/UIVersion2';
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Elements/Fields/DatePickerV2',
|
|
8
|
+
component: DatePickerV2,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
decorators: [UIVersion2],
|
|
11
|
+
};
|
|
12
|
+
export default meta;
|
|
13
|
+
const StatefulDatePickerV2 = (props) => {
|
|
14
|
+
const [date, setDate] = useState(new Date());
|
|
15
|
+
return (_jsx(DatePickerV2, Object.assign({}, props, { value: date, onChange: (d) => {
|
|
16
|
+
setDate(d);
|
|
17
|
+
} })));
|
|
18
|
+
};
|
|
19
|
+
export const Default = {
|
|
20
|
+
render: () => (_jsx(BoxV2, Object.assign({ sx: { height: '500px' } }, { children: _jsx(StatefulDatePickerV2, { placeholder: "test" }) }))),
|
|
21
|
+
};
|
|
22
|
+
export const Inline = {
|
|
23
|
+
argTypes: {
|
|
24
|
+
backgroundColor: {
|
|
25
|
+
options: ['blue', 'gold', 'green', 'red'],
|
|
26
|
+
control: {
|
|
27
|
+
type: 'select',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
render: (args) => {
|
|
32
|
+
const { backgroundColor } = args;
|
|
33
|
+
return (_jsx(BoxV2, Object.assign({ sx: { height: '500px' } }, { children: _jsx(StatefulDatePickerV2, { backgroundColor: backgroundColor, inline: true }) })));
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export const HighlightedDates = {
|
|
37
|
+
argTypes: {
|
|
38
|
+
backgroundColor: {
|
|
39
|
+
options: ['blue', 'gold', 'green', 'red'],
|
|
40
|
+
control: {
|
|
41
|
+
type: 'select',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
render: (args) => {
|
|
46
|
+
const { backgroundColor } = args;
|
|
47
|
+
const highlightedDate1 = new Date();
|
|
48
|
+
highlightedDate1.setDate(highlightedDate1.getDate() + 1);
|
|
49
|
+
const highlightedDate2 = new Date();
|
|
50
|
+
highlightedDate2.setDate(highlightedDate2.getDate() - 1);
|
|
51
|
+
return (_jsx(BoxV2, Object.assign({ sx: { height: '500px' } }, { children: _jsx(StatefulDatePickerV2, { inline: true, backgroundColor: backgroundColor, highlightDates: [highlightedDate1, highlightedDate2] }) })));
|
|
52
|
+
},
|
|
53
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'react-datepicker/dist/react-datepicker.css';
|
|
3
|
+
import { TextInputV2Props } from '../TextInputV2';
|
|
4
|
+
import { BoxV2Props } from '../BoxV2';
|
|
5
|
+
export declare const InputWrapperV2: React.ForwardRefExoticComponent<{
|
|
6
|
+
onChange?: ((e: React.ChangeEvent) => void) | undefined;
|
|
7
|
+
onClick?: ((e: React.MouseEvent) => void) | undefined;
|
|
8
|
+
value?: string | undefined;
|
|
9
|
+
children: React.ReactElement;
|
|
10
|
+
} & React.RefAttributes<any>>;
|
|
11
|
+
export declare const areDatesEqual: (d1: Date, d2: Date) => boolean;
|
|
12
|
+
export declare const isDateInThePast: (d1: Date, d2: Date) => boolean;
|
|
13
|
+
export declare const DatePickerV2: React.FC<{
|
|
14
|
+
value: Date;
|
|
15
|
+
onChange: (date: Date) => void;
|
|
16
|
+
minDate?: Date;
|
|
17
|
+
maxDate?: Date;
|
|
18
|
+
inline?: boolean;
|
|
19
|
+
backgroundColor?: string;
|
|
20
|
+
highlightDates?: Date[];
|
|
21
|
+
wrapperProps?: BoxV2Props;
|
|
22
|
+
inputProps?: Partial<TextInputV2Props>;
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,57 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import _ReactDatePicker from 'react-datepicker';
|
|
15
|
+
import 'react-datepicker/dist/react-datepicker.css';
|
|
16
|
+
import { TextInputV2 } from '../TextInputV2';
|
|
17
|
+
import _CalendarIcon from '@mui/icons-material/CalendarMonth';
|
|
18
|
+
import { BoxV2 } from '../BoxV2';
|
|
19
|
+
import { importedDefaultComponentShim } from '../../../utils/misc';
|
|
20
|
+
const CalendarIcon = importedDefaultComponentShim(_CalendarIcon);
|
|
21
|
+
const ReactDatePicker = importedDefaultComponentShim(_ReactDatePicker);
|
|
22
|
+
export const InputWrapperV2 = React.forwardRef(({ onChange, value, children, onClick }, ref) => {
|
|
23
|
+
return React.cloneElement(children, {
|
|
24
|
+
value: value,
|
|
25
|
+
onChangeRaw: onChange,
|
|
26
|
+
ref: ref,
|
|
27
|
+
leftIcon: CalendarIcon,
|
|
28
|
+
onClick,
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
const PermissiveTextInputV2 = TextInputV2;
|
|
32
|
+
export const areDatesEqual = (d1, d2) => {
|
|
33
|
+
const serializeDate = (d) => `${d.getFullYear()} ${d.getMonth()} ${d.getDate()}`;
|
|
34
|
+
return serializeDate(d1) === serializeDate(d2);
|
|
35
|
+
};
|
|
36
|
+
export const isDateInThePast = (d1, d2) => {
|
|
37
|
+
const serializeDate = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
38
|
+
return serializeDate(d1) < serializeDate(d2);
|
|
39
|
+
};
|
|
40
|
+
export const DatePickerV2 = (_a) => {
|
|
41
|
+
var { value, wrapperProps, inputProps, backgroundColor, highlightDates } = _a, rest = __rest(_a, ["value", "wrapperProps", "inputProps", "backgroundColor", "highlightDates"]);
|
|
42
|
+
const highlightDateSet = new Set(highlightDates === null || highlightDates === void 0 ? void 0 : highlightDates.map((d) => d.toDateString()));
|
|
43
|
+
if (!backgroundColor)
|
|
44
|
+
backgroundColor = 'blue';
|
|
45
|
+
return (_jsx(BoxV2, Object.assign({}, wrapperProps, { children: _jsx(ReactDatePicker, Object.assign({ calendarClassName: `ndlib-date-picker ndlib-date-picker-${backgroundColor}`, selected: value, dayClassName: (date) => {
|
|
46
|
+
if (areDatesEqual(date, value)) {
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
49
|
+
if (isDateInThePast(date, value)) {
|
|
50
|
+
return 'ndlib-date-picker-pastdate';
|
|
51
|
+
}
|
|
52
|
+
if (highlightDateSet.has(date.toDateString())) {
|
|
53
|
+
return 'ndlib-date-picker-highlight';
|
|
54
|
+
}
|
|
55
|
+
return '';
|
|
56
|
+
}, customInput: _jsx(InputWrapperV2, { children: _jsx(PermissiveTextInputV2, Object.assign({}, inputProps)) }) }, rest)) })));
|
|
57
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DropdownV2 } from '.';
|
|
3
|
+
declare const meta: Meta<typeof DropdownV2>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DropdownV2>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const MatchWidth: Story;
|
|
8
|
+
export declare const ForcePlacement: Story;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
|
|
3
|
+
import { ButtonV2 } from '../ButtonV2';
|
|
4
|
+
import { BoxV2 } from '../BoxV2';
|
|
5
|
+
import { DropdownV2 } from '.';
|
|
6
|
+
import { ParagraphV2 } from '../ParagraphV2';
|
|
7
|
+
import { ColumnV2 } from '../ColumnV2';
|
|
8
|
+
import { UIVersion2 } from '../../../utils/decorators/UIVersion2';
|
|
9
|
+
const meta = {
|
|
10
|
+
title: 'Elements/DropdownV2',
|
|
11
|
+
component: DropdownV2,
|
|
12
|
+
tags: ['autodocs'],
|
|
13
|
+
decorators: [UIVersion2],
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
const lorem = `Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
17
|
+
Nullam id nunc vitae magna aliquam aliquet. In hac habitasse platea dictumst.`;
|
|
18
|
+
export const Default = {
|
|
19
|
+
render: () => (_jsx(BoxV2, Object.assign({ sx: { width: '200px', height: '200px' } }, { children: _jsx(DropdownV2, { renderAnchor: ({ anchorProps }) => (_jsx(ButtonV2, Object.assign({}, anchorProps, { rightIcon: ArrowDropDownIcon }, { children: "Open Dropdown" }))), renderDropdown: () => _jsx(ParagraphV2, { children: lorem }) }) }))),
|
|
20
|
+
};
|
|
21
|
+
export const MatchWidth = {
|
|
22
|
+
render: () => (_jsx(BoxV2, Object.assign({ sx: { width: '200px', height: '200px' } }, { children: _jsx(DropdownV2, { matchWidth: true, renderAnchor: ({ anchorProps }) => (_jsx(ButtonV2, Object.assign({}, anchorProps, { rightIcon: ArrowDropDownIcon }, { children: "Open Dropdown" }))), renderDropdown: () => _jsx(ParagraphV2, { children: lorem }) }) }))),
|
|
23
|
+
};
|
|
24
|
+
export const ForcePlacement = {
|
|
25
|
+
render: () => (_jsx(ColumnV2, Object.assign({ sx: { width: '200x', height: '100vh' }, justify: "flex-end" }, { children: _jsx(DropdownV2, { allowedPlacements: ['bottom-start'], renderAnchor: ({ anchorProps }) => (_jsx(ButtonV2, Object.assign({}, anchorProps, { rightIcon: ArrowDropDownIcon }, { children: "Open Dropdown" }))), renderDropdown: () => _jsx(ParagraphV2, { children: lorem }) }) }))),
|
|
26
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledElementPropsV2 } from '../../../theme';
|
|
3
|
+
type AnchorProps = Omit<React.HTMLAttributes<HTMLButtonElement>, 'color'>;
|
|
4
|
+
type AnchorRenderFn = (params: {
|
|
5
|
+
anchorProps: AnchorProps;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
8
|
+
}) => React.ReactNode;
|
|
9
|
+
type DropdownRenderFn = (params: {
|
|
10
|
+
styles: React.CSSProperties;
|
|
11
|
+
ref: React.Ref<any>;
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
setIsOpen: (isOpen: boolean) => void;
|
|
14
|
+
id: string;
|
|
15
|
+
}) => React.ReactNode;
|
|
16
|
+
type Placement = 'top-start' | 'bottom-start' | 'top-end' | 'bottom-end';
|
|
17
|
+
type DropdownV2Props = StyledElementPropsV2<HTMLDivElement, {
|
|
18
|
+
renderAnchor: AnchorRenderFn;
|
|
19
|
+
renderDropdown: DropdownRenderFn;
|
|
20
|
+
shouldRenderDropdownContainer?: boolean;
|
|
21
|
+
matchWidth?: boolean;
|
|
22
|
+
allowedPlacements?: Placement[];
|
|
23
|
+
}>;
|
|
24
|
+
export declare const OverlayV2: React.FC<StyledElementPropsV2<HTMLDivElement>>;
|
|
25
|
+
export declare const DropdownV2: React.FC<DropdownV2Props>;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
14
|
+
import { BOX_SHADOW } from '../../../theme';
|
|
15
|
+
import { autoPlacement, offset, size, useFloating } from '@floating-ui/react';
|
|
16
|
+
import { BoxV2 } from '../BoxV2';
|
|
17
|
+
import { useUniqueId } from '../../providers/uniqueIds';
|
|
18
|
+
import { Z_INDEX } from '../../../theme/custom';
|
|
19
|
+
import { COLOR, colors } from '../../../theme/colors';
|
|
20
|
+
export const OverlayV2 = (props) => (_jsx(BoxV2, Object.assign({}, props, { sx: {
|
|
21
|
+
position: 'fixed',
|
|
22
|
+
top: 0,
|
|
23
|
+
left: 0,
|
|
24
|
+
width: '100vw',
|
|
25
|
+
height: '100vh',
|
|
26
|
+
zIndex: Z_INDEX.ELEVATED,
|
|
27
|
+
} })));
|
|
28
|
+
export const DropdownV2 = (_a) => {
|
|
29
|
+
var { renderAnchor, renderDropdown, matchWidth, shouldRenderDropdownContainer = true, allowedPlacements = ['top-start', 'bottom-start', 'top-end', 'bottom-end'], sx } = _a, rest = __rest(_a, ["renderAnchor", "renderDropdown", "matchWidth", "shouldRenderDropdownContainer", "allowedPlacements", "sx"]);
|
|
30
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
31
|
+
const [dropdownMinWidth, setDropdownMinWidth] = useState('0px');
|
|
32
|
+
const [dropdownMaxWidth, setDropdownMaxWidth] = useState();
|
|
33
|
+
const dropdownId = useUniqueId('dropdown');
|
|
34
|
+
const anchorId = useUniqueId('dropdown-anchor');
|
|
35
|
+
const { refs, floatingStyles } = useFloating({
|
|
36
|
+
placement: 'bottom-start',
|
|
37
|
+
middleware: [
|
|
38
|
+
offset(2),
|
|
39
|
+
size({
|
|
40
|
+
apply({ rects }) {
|
|
41
|
+
setDropdownMinWidth(`${rects.reference.width}px`);
|
|
42
|
+
if (matchWidth) {
|
|
43
|
+
setDropdownMaxWidth(`${rects.reference.width}px`);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
47
|
+
autoPlacement({
|
|
48
|
+
allowedPlacements,
|
|
49
|
+
}),
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
const dropdownBoxStyles = Object.assign(Object.assign({}, floatingStyles), { minWidth: dropdownMinWidth, maxWidth: dropdownMaxWidth, zIndex: Z_INDEX.DIALOG, backgroundColor: colors[COLOR.WHITE], boxShadow: BOX_SHADOW.NORMAL });
|
|
53
|
+
const onClick = useCallback(() => {
|
|
54
|
+
setIsOpen(!isOpen);
|
|
55
|
+
}, [isOpen]);
|
|
56
|
+
const dropdownAnchorProps = useMemo(() => ({
|
|
57
|
+
id: anchorId,
|
|
58
|
+
'aria-haspopup': true,
|
|
59
|
+
'aria-expanded': isOpen,
|
|
60
|
+
'aria-owns': dropdownId,
|
|
61
|
+
ref: refs.setReference,
|
|
62
|
+
onClick,
|
|
63
|
+
}), [refs, onClick, anchorId, isOpen, dropdownId]);
|
|
64
|
+
return (_jsxs(BoxV2, Object.assign({ sx: sx }, rest, { children: [renderAnchor({
|
|
65
|
+
anchorProps: dropdownAnchorProps,
|
|
66
|
+
isOpen,
|
|
67
|
+
setIsOpen,
|
|
68
|
+
}), isOpen && (_jsxs(_Fragment, { children: [shouldRenderDropdownContainer ? (_jsx("div", Object.assign({ id: dropdownId, ref: refs.setFloating, style: dropdownBoxStyles }, { children: renderDropdown({
|
|
69
|
+
styles: dropdownBoxStyles,
|
|
70
|
+
ref: refs.setFloating,
|
|
71
|
+
setIsOpen,
|
|
72
|
+
isOpen,
|
|
73
|
+
id: dropdownId,
|
|
74
|
+
}) }))) : (renderDropdown({
|
|
75
|
+
styles: dropdownBoxStyles,
|
|
76
|
+
ref: refs.setFloating,
|
|
77
|
+
isOpen,
|
|
78
|
+
setIsOpen,
|
|
79
|
+
id: dropdownId,
|
|
80
|
+
})), _jsx(OverlayV2, { onClick: () => setIsOpen(false) })] }))] })));
|
|
81
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { BoldV2, ItalicV2 } from '.';
|
|
3
|
+
import { ParagraphV2 } from '../ParagraphV2';
|
|
4
|
+
import { UIVersion2 } from '../../../utils/decorators/UIVersion2';
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Elements/InlineV2',
|
|
7
|
+
component: BoldV2,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
decorators: [UIVersion2],
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const Default = {
|
|
13
|
+
render: () => (_jsxs(ParagraphV2, { children: ["Text with ", _jsx(BoldV2, { children: "bold content" }), " and", ' ', _jsx(ItalicV2, { children: "italic content" })] })),
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledElementPropsV2 } from '../../../theme';
|
|
3
|
+
type InlineV2Props = StyledElementPropsV2<HTMLSpanElement>;
|
|
4
|
+
export declare const BoldV2: React.FC<InlineV2Props>;
|
|
5
|
+
export declare const ItalicV2: React.FC<InlineV2Props>;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
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 } from "react/jsx-runtime";
|
|
13
|
+
import { processSx } from '../../../utils/processSx';
|
|
14
|
+
export const BoldV2 = (_a) => {
|
|
15
|
+
var { sx } = _a, rest = __rest(_a, ["sx"]);
|
|
16
|
+
const processedStyles = processSx(sx);
|
|
17
|
+
return (_jsx("span", Object.assign({ style: Object.assign({ fontWeight: 'bold' }, processedStyles) }, rest)));
|
|
18
|
+
};
|
|
19
|
+
export const ItalicV2 = (_a) => {
|
|
20
|
+
var { sx } = _a, rest = __rest(_a, ["sx"]);
|
|
21
|
+
const processedStyles = processSx(sx);
|
|
22
|
+
return (_jsx("span", Object.assign({ style: Object.assign({ fontStyle: 'italic' }, processedStyles) }, rest)));
|
|
23
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { ListV2 } from '.';
|
|
3
|
+
declare const meta: Meta<typeof ListV2>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof ListV2>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Ordered: Story;
|
|
9
|
+
export declare const CustomIcon: Story;
|
|
10
|
+
export declare const CustomIconPerItem: Story;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
3
|
+
import BookmarkIcon from '@mui/icons-material/Bookmark';
|
|
4
|
+
import BookmarkBorderIcon from '@mui/icons-material/BookmarkBorder';
|
|
5
|
+
import { LISTV2_SIZE, ListV2, ListItemV2 } from '.';
|
|
6
|
+
import { RowV2 } from '../RowV2';
|
|
7
|
+
import { ColumnV2 } from '../ColumnV2';
|
|
8
|
+
import { HEADINGV2_SIZE, HeadingV2 } from '../HeadingV2';
|
|
9
|
+
import { GROUPV2_TYPE, GroupV2 } from '../GroupV2';
|
|
10
|
+
import { COLOR } from '../../../theme/colors';
|
|
11
|
+
import { FONT_SIZE } from '../../../theme/typography';
|
|
12
|
+
import { UIVersion2 } from '../../../utils/decorators/UIVersion2';
|
|
13
|
+
const meta = {
|
|
14
|
+
title: 'Elements/ListV2',
|
|
15
|
+
component: ListV2,
|
|
16
|
+
tags: ['autodocs'],
|
|
17
|
+
decorators: [UIVersion2],
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
export const Default = {
|
|
21
|
+
render: () => (_jsx(RowV2, { children: _jsxs(ListV2, { children: [_jsx(ListItemV2, Object.assign({ index: 0 }, { children: "List Item 1" })), _jsx(ListItemV2, Object.assign({ index: 1 }, { children: "List Item 2" })), _jsxs(ListItemV2, Object.assign({ index: 2 }, { children: ["List Item 3", _jsxs(ListV2, { children: [_jsx(ListItemV2, Object.assign({ index: 0 }, { children: "List Item 3.1" })), _jsx(ListItemV2, Object.assign({ index: 1 }, { children: "List Item 3.2" }))] })] }))] }) })),
|
|
22
|
+
};
|
|
23
|
+
const sizes = [
|
|
24
|
+
{ size: LISTV2_SIZE.LG, label: 'Large' },
|
|
25
|
+
{ size: LISTV2_SIZE.MD, label: 'Medium' },
|
|
26
|
+
{ size: LISTV2_SIZE.SM, label: 'Small' },
|
|
27
|
+
];
|
|
28
|
+
export const Sizes = {
|
|
29
|
+
render: () => (_jsx(ColumnV2, { children: sizes.map((size, i) => (_jsxs(GroupV2, Object.assign({ type: GROUPV2_TYPE.REGION, sx: { mt: 3 } }, { children: [_jsx(HeadingV2, Object.assign({ size: HEADINGV2_SIZE.MD }, { children: size.label })), _jsx(RowV2, Object.assign({ sx: { mt: 2 } }, { children: _jsxs(ListV2, Object.assign({ size: size.size }, { children: [_jsx(ListItemV2, Object.assign({ index: 0 }, { children: "List Item 1" })), _jsx(ListItemV2, Object.assign({ index: 1 }, { children: "List Item 2" })), _jsx(ListItemV2, Object.assign({ index: 2 }, { children: "List Item 3" }))] })) }))] }), i))) })),
|
|
30
|
+
};
|
|
31
|
+
export const Ordered = {
|
|
32
|
+
render: () => (_jsx(RowV2, { children: _jsxs(ListV2, Object.assign({ icon: ChevronRightIcon, ordered: true }, { children: [_jsx(ListItemV2, Object.assign({ index: 0 }, { children: "List Item 1" })), _jsx(ListItemV2, Object.assign({ index: 1 }, { children: "List Item 2" })), _jsx(ListItemV2, Object.assign({ index: 2 }, { children: "List Item 3" }))] })) })),
|
|
33
|
+
};
|
|
34
|
+
export const CustomIcon = {
|
|
35
|
+
render: () => (_jsx(RowV2, { children: _jsxs(ListV2, Object.assign({ icon: ChevronRightIcon, iconColor: COLOR.PRIMARY }, { children: [_jsx(ListItemV2, Object.assign({ index: 0 }, { children: "List Item 1" })), _jsx(ListItemV2, Object.assign({ index: 1 }, { children: "List Item 2" })), _jsx(ListItemV2, Object.assign({ index: 2 }, { children: "List Item 3" }))] })) })),
|
|
36
|
+
};
|
|
37
|
+
export const CustomIconPerItem = {
|
|
38
|
+
render: () => (_jsx(RowV2, { children: _jsxs(ListV2, Object.assign({ iconSize: FONT_SIZE.ML }, { children: [_jsx(ListItemV2, Object.assign({ index: 0, icon: BookmarkIcon, onIconClick: () => { }, iconLabel: "Unfavorite" }, { children: "Favorite 1" })), _jsx(ListItemV2, Object.assign({ index: 1, icon: BookmarkIcon, onIconClick: () => { }, iconLabel: "Favorite" }, { children: "Favorited 2" })), _jsx(ListItemV2, Object.assign({ index: 2, icon: BookmarkBorderIcon, onIconClick: () => { }, iconLabel: "Favorite" }, { children: "Not Favorited" }))] })) })),
|
|
39
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyledElementPropsV2 } from '../../../theme';
|
|
3
|
+
import { COLOR } from '../../../theme/colors';
|
|
4
|
+
import { FONT_SIZE } from '../../../theme/typography';
|
|
5
|
+
type ListV2Props = StyledElementPropsV2<HTMLUListElement, {
|
|
6
|
+
ordered?: boolean;
|
|
7
|
+
size?: LISTV2_SIZE;
|
|
8
|
+
icon?: React.FC<any>;
|
|
9
|
+
iconColor?: COLOR;
|
|
10
|
+
iconSize?: FONT_SIZE;
|
|
11
|
+
}>;
|
|
12
|
+
export declare enum LISTV2_SIZE {
|
|
13
|
+
SM = "sm",
|
|
14
|
+
MD = "md",
|
|
15
|
+
LG = "lg"
|
|
16
|
+
}
|
|
17
|
+
export declare const ListV2: React.FC<ListV2Props>;
|
|
18
|
+
type ListItemV2Props = StyledElementPropsV2<HTMLLIElement, {
|
|
19
|
+
index: number;
|
|
20
|
+
icon?: React.FC<any>;
|
|
21
|
+
iconSize?: FONT_SIZE;
|
|
22
|
+
iconColor?: COLOR;
|
|
23
|
+
iconLabel?: string;
|
|
24
|
+
onIconClick?: () => void;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const ListItemV2: React.FC<ListItemV2Props>;
|
|
27
|
+
export {};
|