@sebgroup/green-react 3.3.0 → 3.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,12 @@
1
- # `@sebgroup/green-react`
1
+ <div align="center">
2
+ <img width="600" alt="green-react" src="https://github.com/sebgroup/green/assets/11420341/ad4c9fe3-137f-4230-9ea7-a4de87752aa9">
3
+ <h1>@sebgroup/green-react</h1>
4
+ <p>
5
+ React components with SEB's look and feel.
6
+ </p>
7
+ </div>
2
8
 
3
- > TODO: description
4
-
5
- ## Install \*
9
+ ## Install
6
10
 
7
11
  ```bash
8
12
  npm install --save @sebgroup/green-react
@@ -12,17 +16,18 @@ npm install --save @sebgroup/green-react
12
16
  yarn add @sebgroup/green-react
13
17
  ```
14
18
 
15
- ## Usage \*
19
+ ## Use
16
20
 
17
- ```
18
- const greenReact = require('@sebgroup/green-react');
21
+ ```tsx
22
+ import { Button } from '@sebgroup/green-react'
19
23
 
20
- // TODO: DEMONSTRATE API
24
+ // Use in your JSX
25
+ <Button>A Green React Button!</Button>
21
26
  ```
22
27
 
23
28
  ### Components
24
29
 
25
- View all components in the Storybook
30
+ View all components in the [React Storybook](https://sebgroup.github.io/green/latest/react/)
26
31
 
27
32
  ## Develop \*
28
33
 
@@ -57,5 +62,3 @@ yarn test react --watch
57
62
  1. Test
58
63
  2. Code
59
64
  3. Refactor
60
-
61
- ## Commands \*
package/index.esm.js CHANGED
@@ -2,7 +2,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
2
2
  import React, { useState, useEffect, useRef, useLayoutEffect, useMemo, forwardRef, useCallback, useId } from 'react';
3
3
  import { randomId, validateClassName, debounce, delay, sliderColors, getSliderTrackBackground } from '@sebgroup/extract';
4
4
  import { createComponent } from '@lit/react';
5
- import { getScopedTagName, GdsDatepicker, GdsContextMenu, GdsMenuItem, GdsMenuHeading, GdsDropdown, GdsOption } from '@sebgroup/green-core';
5
+ import { getScopedTagName, GdsDatepicker, GdsContextMenu, GdsMenuItem, GdsMenuHeading, GdsDropdown, GdsOption, GdsGroupedList } from '@sebgroup/green-core';
6
6
  import { registerTransitionalStyles } from '@sebgroup/green-core/transitional-styles';
7
7
  import classNames from 'classnames';
8
8
 
@@ -2315,8 +2315,7 @@ const Dropdown = _a => {
2315
2315
  } = _a,
2316
2316
  props = __rest(_a, ["compareWith", "display", "id", "informationLabel", "label", "multiSelect", "onChange", "options", "searchFilter", "searchable", "texts", "useValue", "validator", "value", "syncPopoverWidth"]);
2317
2317
  const handleOnChange = e => {
2318
- var _a;
2319
- if ((_a = e.detail) === null || _a === void 0 ? void 0 : _a.value) {
2318
+ if ('value' in e.detail) {
2320
2319
  onChange === null || onChange === void 0 ? void 0 : onChange(e.detail.value);
2321
2320
  }
2322
2321
  };
@@ -4446,7 +4445,7 @@ const Link = _a => {
4446
4445
  }));
4447
4446
  };
4448
4447
 
4449
- const ListItem = _a => {
4448
+ const ListItem$1 = _a => {
4450
4449
  var {
4451
4450
  listType,
4452
4451
  tableRowData,
@@ -4480,7 +4479,7 @@ const List$1 = _a => {
4480
4479
  props = __rest(_a, ["listType", "tableCaption", "tableData", "children"]);
4481
4480
  if (listType === 'ordered') {
4482
4481
  return jsx("ol", Object.assign({}, props, {
4483
- children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
4482
+ children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem$1, {
4484
4483
  children: child
4485
4484
  }, index))
4486
4485
  }));
@@ -4488,7 +4487,7 @@ const List$1 = _a => {
4488
4487
  return jsx("ul", Object.assign({}, props, {
4489
4488
  className: listType
4490
4489
  }, {
4491
- children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
4490
+ children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem$1, {
4492
4491
  children: child
4493
4492
  }, index))
4494
4493
  }));
@@ -4499,7 +4498,7 @@ const List$1 = _a => {
4499
4498
  }, {
4500
4499
  children: tableCaption
4501
4500
  })), jsx("dl", {
4502
- children: tableData === null || tableData === void 0 ? void 0 : tableData.map((data, index) => jsx(ListItem, {
4501
+ children: tableData === null || tableData === void 0 ? void 0 : tableData.map((data, index) => jsx(ListItem$1, {
4503
4502
  listType: listType,
4504
4503
  tableRowData: data
4505
4504
  }, index))
@@ -4548,6 +4547,18 @@ var valueList$1 = /*#__PURE__*/Object.freeze({
4548
4547
  'default': valueList
4549
4548
  });
4550
4549
 
4550
+ registerTransitionalStyles();
4551
+ const GroupedList = createComponent({
4552
+ tagName: getScopedTagName('gds-grouped-list'),
4553
+ elementClass: GdsGroupedList,
4554
+ react: React
4555
+ });
4556
+ const ListItem = createComponent({
4557
+ tagName: getScopedTagName('gds-list-item'),
4558
+ elementClass: GdsGroupedList,
4559
+ react: React
4560
+ });
4561
+
4551
4562
  //TODO: Add variants
4552
4563
  const Navbar = ({
4553
4564
  children,
@@ -6494,4 +6505,4 @@ const Table = /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef((_a, ref) =
6494
6505
  }));
6495
6506
  }));
6496
6507
 
6497
- export { Accordion, AlertRibbon as Alert, AlertRibbon, Badge, Button, ButtonGroup, Card, Checkbox, ContextMenu, CoreDatepicker, CoreDropdown, CoreMenuHeading, CoreOption, Datepicker, Dropdown, EmailInput, Flexbox, Form, FormItem, FormItems, Group, IconButton, InPageWizardStepCard, Input, Link, List$1 as List, MenuItem, Modal, Navbar, NumberInput, Option, OptionGroup, RadioButton, RadioGroup, Select, Slider, SortDirection, Stepper, Tab, Table, TableBody, TableCell, TableContext, TableHeader, TableHeaderCell, TableRow, Tabs, Text, TextArea, TextInput, valueList$1 as ValueList, filterArrayByColumns, onRowSelect, paginate, searchTextByColumns, sortArray, sumCols, useTableContext };
6508
+ export { Accordion, AlertRibbon as Alert, AlertRibbon, Badge, Button, ButtonGroup, Card, Checkbox, ContextMenu, CoreDatepicker, CoreDropdown, CoreMenuHeading, CoreOption, Datepicker, Dropdown, EmailInput, Flexbox, Form, FormItem, FormItems, Group, GroupedList, IconButton, InPageWizardStepCard, Input, Link, List$1 as List, ListItem, MenuItem, Modal, Navbar, NumberInput, Option, OptionGroup, RadioButton, RadioGroup, Select, Slider, SortDirection, Stepper, Tab, Table, TableBody, TableCell, TableContext, TableHeader, TableHeaderCell, TableRow, Tabs, Text, TextArea, TextInput, valueList$1 as ValueList, filterArrayByColumns, onRowSelect, paginate, searchTextByColumns, sortArray, sumCols, useTableContext };
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sebgroup/green-react",
3
- "version": "3.3.0",
3
+ "version": "3.4.1",
4
4
  "peerDependencies": {
5
5
  "react": "^17 || ^18",
6
6
  "react-dom": "^17 || ^18"
7
7
  },
8
8
  "dependencies": {
9
- "@sebgroup/green-core": "^1.7.0",
10
- "@sebgroup/chlorophyll": "^3.1.0",
9
+ "@sebgroup/green-core": "^1.8.0",
10
+ "@sebgroup/chlorophyll": "^3.1.1",
11
11
  "@sebgroup/extract": "^3.0.1",
12
12
  "@lit/react": "^1.0.2",
13
13
  "classnames": "^2.3.2"
package/src/index.d.ts CHANGED
@@ -10,6 +10,7 @@ export * from './lib/layout';
10
10
  export * from './lib/in-page-wizard';
11
11
  export * from './lib/link/link';
12
12
  export * from './lib/list';
13
+ export * from './lib/grouped-list/grouped-list';
13
14
  export * from './lib/navbar/navbar';
14
15
  export * from './lib/select';
15
16
  export * from './lib/slider';
@@ -0,0 +1,3 @@
1
+ import { GdsGroupedList } from '@sebgroup/green-core';
2
+ export declare const GroupedList: import("@lit/react").ReactWebComponent<GdsGroupedList, {}>;
3
+ export declare const ListItem: import("@lit/react").ReactWebComponent<GdsGroupedList, {}>;