@sebgroup/green-react 2.0.0 → 2.1.0
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/index.esm.js +89 -3
- package/package.json +3 -3
- package/src/index.d.ts +1 -0
- package/src/lib/icons/edit.d.ts +2 -0
- package/src/lib/icons/index.d.ts +1 -0
- package/src/lib/in-page-wizard/inPageWizardStepCard.d.ts +16 -0
- package/src/lib/in-page-wizard/index.d.ts +1 -0
- package/src/types/props/index.d.ts +2 -0
package/index.esm.js
CHANGED
|
@@ -1751,7 +1751,7 @@ const Check = ({
|
|
|
1751
1751
|
focusable: _focusable,
|
|
1752
1752
|
"aria-labelledby": id
|
|
1753
1753
|
}, {
|
|
1754
|
-
children: [
|
|
1754
|
+
children: [title && jsx("title", Object.assign({
|
|
1755
1755
|
id: id
|
|
1756
1756
|
}, {
|
|
1757
1757
|
children: title
|
|
@@ -1776,7 +1776,7 @@ const ChevronDown = ({
|
|
|
1776
1776
|
focusable: _focusable,
|
|
1777
1777
|
"aria-labelledby": id
|
|
1778
1778
|
}, {
|
|
1779
|
-
children: [
|
|
1779
|
+
children: [title && jsx("title", Object.assign({
|
|
1780
1780
|
id: id
|
|
1781
1781
|
}, {
|
|
1782
1782
|
children: title
|
|
@@ -1885,6 +1885,37 @@ const InfoCircle = _a => {
|
|
|
1885
1885
|
}));
|
|
1886
1886
|
};
|
|
1887
1887
|
|
|
1888
|
+
const Edit = _a => {
|
|
1889
|
+
var {
|
|
1890
|
+
focusable = false,
|
|
1891
|
+
title,
|
|
1892
|
+
fill = 'white',
|
|
1893
|
+
width = 24,
|
|
1894
|
+
height = 24
|
|
1895
|
+
} = _a,
|
|
1896
|
+
props = __rest(_a, ["focusable", "title", "fill", "width", "height"]);
|
|
1897
|
+
let id;
|
|
1898
|
+
if (title) id = randomId();
|
|
1899
|
+
return jsxs("svg", Object.assign({
|
|
1900
|
+
width: width,
|
|
1901
|
+
height: height,
|
|
1902
|
+
viewBox: "0 0 576 512",
|
|
1903
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1904
|
+
focusable: focusable,
|
|
1905
|
+
"aria-labelledby": id,
|
|
1906
|
+
"aria-hidden": props['aria-hidden']
|
|
1907
|
+
}, {
|
|
1908
|
+
children: [title && jsx("title", Object.assign({
|
|
1909
|
+
id: id
|
|
1910
|
+
}, {
|
|
1911
|
+
children: title
|
|
1912
|
+
})), jsx("path", {
|
|
1913
|
+
fill: fill,
|
|
1914
|
+
d: "M402.3 344.9l32-32c5-5 13.7-1.5 13.7 5.7V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h273.5c7.1 0 10.7 8.6 5.7 13.7l-32 32c-1.5 1.5-3.5 2.3-5.7 2.3H48v352h352V350.5c0-2.1.8-4.1 2.3-5.6zm156.6-201.8L296.3 405.7l-90.4 10c-26.2 2.9-48.5-19.2-45.6-45.6l10-90.4L432.9 17.1c22.9-22.9 59.9-22.9 82.7 0l43.2 43.2c22.9 22.9 22.9 60 .1 82.8zM460.1 174L402 115.9 216.2 301.8l-7.3 65.3 65.3-7.3L460.1 174zm64.8-79.7l-43.2-43.2c-4.1-4.1-10.8-4.1-14.8 0L436 82l58.1 58.1 30.9-30.9c4-4.2 4-10.8-.1-14.9z"
|
|
1915
|
+
})]
|
|
1916
|
+
}));
|
|
1917
|
+
};
|
|
1918
|
+
|
|
1888
1919
|
function AlertRibbon({
|
|
1889
1920
|
type,
|
|
1890
1921
|
header,
|
|
@@ -4254,6 +4285,61 @@ const Flexbox = _a => {
|
|
|
4254
4285
|
}));
|
|
4255
4286
|
};
|
|
4256
4287
|
|
|
4288
|
+
const InPageWizardStepCard = props => {
|
|
4289
|
+
return jsxs("section", Object.assign({
|
|
4290
|
+
className: `gds-in-page-wizard-step-card card ${props.stepStatus === 'IsActive' ? 'active' : ''} ${props.stepStatus === 'IsComplete' ? 'completed' : ''}`,
|
|
4291
|
+
"data-testid": props.dataTestid
|
|
4292
|
+
}, {
|
|
4293
|
+
children: [jsxs("header", Object.assign({
|
|
4294
|
+
className: "gds-in-page-wizard-step-card__header"
|
|
4295
|
+
}, {
|
|
4296
|
+
children: [jsx("div", Object.assign({
|
|
4297
|
+
className: "gds-in-page-wizard-step-card__header__icon"
|
|
4298
|
+
}, {
|
|
4299
|
+
children: jsx(Check, {})
|
|
4300
|
+
})), jsx("div", Object.assign({
|
|
4301
|
+
className: "gds-in-page-wizard-step-card__header__progress"
|
|
4302
|
+
}, {
|
|
4303
|
+
children: props.stepText
|
|
4304
|
+
})), jsx("div", Object.assign({
|
|
4305
|
+
className: "gds-in-page-wizard-step-card__header__title"
|
|
4306
|
+
}, {
|
|
4307
|
+
children: jsx("h2", Object.assign({
|
|
4308
|
+
className: "h4"
|
|
4309
|
+
}, {
|
|
4310
|
+
children: props.title
|
|
4311
|
+
}))
|
|
4312
|
+
})), props.stepStatus === 'IsComplete' && jsx("div", Object.assign({
|
|
4313
|
+
className: "gds-in-page-wizard-step-card__header__edit"
|
|
4314
|
+
}, {
|
|
4315
|
+
children: jsxs("button", Object.assign({
|
|
4316
|
+
className: "secondary small",
|
|
4317
|
+
onClick: props.onEditClick
|
|
4318
|
+
}, {
|
|
4319
|
+
children: [jsx(Edit, {
|
|
4320
|
+
fill: 'var(--color)',
|
|
4321
|
+
height: 16,
|
|
4322
|
+
width: 16
|
|
4323
|
+
}), props.editBtnText]
|
|
4324
|
+
}))
|
|
4325
|
+
}))]
|
|
4326
|
+
})), (props.stepStatus === 'IsActive' || props.stepStatus === 'IsComplete') && jsx("div", Object.assign({
|
|
4327
|
+
className: "gds-in-page-wizard-step-card__content"
|
|
4328
|
+
}, {
|
|
4329
|
+
children: props.children
|
|
4330
|
+
})), props.stepStatus === 'IsActive' && !props.hideFooter && jsx("footer", Object.assign({
|
|
4331
|
+
className: "gds-in-page-wizard-step-card__footer"
|
|
4332
|
+
}, {
|
|
4333
|
+
children: jsxs("button", Object.assign({
|
|
4334
|
+
className: "primary",
|
|
4335
|
+
onClick: props.onNextClick
|
|
4336
|
+
}, {
|
|
4337
|
+
children: [props.nextBtnText, props.nextBtnIcon]
|
|
4338
|
+
}))
|
|
4339
|
+
}))]
|
|
4340
|
+
}));
|
|
4341
|
+
};
|
|
4342
|
+
|
|
4257
4343
|
const Link = _a => {
|
|
4258
4344
|
var {
|
|
4259
4345
|
button,
|
|
@@ -5053,4 +5139,4 @@ const Modal = _a => {
|
|
|
5053
5139
|
return isOpen ? modalContent() : null;
|
|
5054
5140
|
};
|
|
5055
5141
|
|
|
5056
|
-
export { Accordion, AlertRibbon as Alert, AlertRibbon, Badge, Button, ButtonGroup, Card, Checkbox, CoreDropdown, CoreOption, Datepicker, Dropdown, EmailInput, Flexbox, Form, FormItem, FormItems, Group, Link, List$1 as List, Modal, Navbar, NumberInput, Option, OptionGroup, RadioButton, RadioGroup, RenderInput, Select, Slider, Stepper, Tab, Tabs, Text, TextInput, valueList$1 as ValueList };
|
|
5142
|
+
export { Accordion, AlertRibbon as Alert, AlertRibbon, Badge, Button, ButtonGroup, Card, Checkbox, CoreDropdown, CoreOption, Datepicker, Dropdown, EmailInput, Flexbox, Form, FormItem, FormItems, Group, InPageWizardStepCard, Link, List$1 as List, Modal, Navbar, NumberInput, Option, OptionGroup, RadioButton, RadioGroup, RenderInput, Select, Slider, Stepper, Tab, Tabs, Text, TextInput, valueList$1 as ValueList };
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sebgroup/green-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": "^17 || ^18",
|
|
6
6
|
"react-dom": "^17 || ^18"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@sebgroup/green-core": "^1.0.
|
|
10
|
-
"@sebgroup/chlorophyll": "^2.0
|
|
9
|
+
"@sebgroup/green-core": "^1.0.2",
|
|
10
|
+
"@sebgroup/chlorophyll": "^2.1.0",
|
|
11
11
|
"@sebgroup/extract": "^2.0.0",
|
|
12
12
|
"classnames": "^2.3.2"
|
|
13
13
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export * from './lib/dropdown/dropdown';
|
|
|
7
7
|
export * from './lib/form';
|
|
8
8
|
export * from './lib/formItem';
|
|
9
9
|
export * from './lib/layout';
|
|
10
|
+
export * from './lib/in-page-wizard';
|
|
10
11
|
export * from './lib/link/link';
|
|
11
12
|
export * from './lib/list';
|
|
12
13
|
export * from './lib/navbar/navbar';
|
package/src/lib/icons/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface InPageWizardStepCardProps {
|
|
3
|
+
stepText: string;
|
|
4
|
+
title: string;
|
|
5
|
+
editBtnText: string;
|
|
6
|
+
nextBtnText: string;
|
|
7
|
+
nextBtnIcon?: ReactNode;
|
|
8
|
+
stepStatus: WizardStepStatus;
|
|
9
|
+
hideFooter?: boolean;
|
|
10
|
+
children: React.ReactNode;
|
|
11
|
+
onNextClick: () => void;
|
|
12
|
+
onEditClick: () => void;
|
|
13
|
+
dataTestid?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare type WizardStepStatus = 'NotStarted' | 'IsActive' | 'IsComplete';
|
|
16
|
+
export declare const InPageWizardStepCard: (props: InPageWizardStepCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './inPageWizardStepCard';
|