@sebgroup/green-react 3.36.0 → 4.0.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.js CHANGED
@@ -21,7 +21,6 @@ export { Flexbox } from './src/lib/layout/flexbox/flexbox.js';
21
21
  export { InPageWizardStepCard } from './src/lib/in-page-wizard/inPageWizardStepCard.js';
22
22
  export { Link } from './src/lib/link/link.js';
23
23
  export { List } from './src/lib/list/list.js';
24
- export { v as ValueList } from './valueList.js';
25
24
  export { GroupedList, ListItem } from './src/lib/grouped-list/grouped-list.js';
26
25
  export { Navbar } from './src/lib/navbar/navbar.js';
27
26
  export { Option, OptionGroup, Select } from './src/lib/select/select.js';
package/package.json CHANGED
@@ -2,14 +2,14 @@
2
2
  "name": "@sebgroup/green-react",
3
3
  "main": "./src/index.js",
4
4
  "module": "./src/index.js",
5
- "version": "3.36.0",
5
+ "version": "4.0.0",
6
6
  "peerDependencies": {
7
7
  "react": "^17 || ^18 || ^19",
8
8
  "react-dom": "^17 || ^18 || ^19"
9
9
  },
10
10
  "dependencies": {
11
11
  "@sebgroup/green-core": "^2.35.0",
12
- "@sebgroup/chlorophyll": "^3.6.16",
12
+ "@sebgroup/chlorophyll": "^4.0.0",
13
13
  "@sebgroup/extract": "^3.0.3",
14
14
  "@lit/react": "^1.0.2",
15
15
  "classnames": "^2.3.2",
package/src/index.js CHANGED
@@ -21,7 +21,6 @@ export { Flexbox } from './lib/layout/flexbox/flexbox.js';
21
21
  export { InPageWizardStepCard } from './lib/in-page-wizard/inPageWizardStepCard.js';
22
22
  export { Link } from './lib/link/link.js';
23
23
  export { List } from './lib/list/list.js';
24
- export { v as ValueList } from '../valueList.js';
25
24
  export { GroupedList, ListItem } from './lib/grouped-list/grouped-list.js';
26
25
  export { Navbar } from './lib/navbar/navbar.js';
27
26
  export { Option, OptionGroup, Select } from './lib/select/select.js';
@@ -14,7 +14,7 @@ var Accordion = function Accordion(_ref) {
14
14
  uuid = _React$useState2[0];
15
15
  _React$useState2[1];
16
16
  return jsx("div", {
17
- className: "accordion",
17
+ className: "gds-accordion",
18
18
  children: items && items.map(function (item, index) {
19
19
  return jsx(AccordionItem, {
20
20
  item: item,
@@ -32,11 +32,11 @@ function AlertRibbon(_ref) {
32
32
  setCloseButton(null);
33
33
  } else {
34
34
  if (closeText) setCloseButton(jsx("button", {
35
- className: "close",
35
+ className: "gds-close",
36
36
  "aria-label": closeText,
37
37
  children: jsx("i", {})
38
38
  }));else setCloseButton(jsx("button", {
39
- className: "close",
39
+ className: "gds-close",
40
40
  "aria-label": "Close",
41
41
  children: jsx("i", {})
42
42
  }));
@@ -69,7 +69,7 @@ function AlertRibbon(_ref) {
69
69
  });
70
70
  };
71
71
  return jsxs("div", {
72
- className: "alert-ribbon ".concat(type),
72
+ className: "gds-alert-ribbon ".concat(type),
73
73
  role: role,
74
74
  "aria-live": ariaLive,
75
75
  children: [jsx("i", {
@@ -81,7 +81,7 @@ function AlertRibbon(_ref) {
81
81
  children: children
82
82
  })]
83
83
  }), closeButton && jsx("button", {
84
- className: "close",
84
+ className: "gds-close",
85
85
  type: "button",
86
86
  "aria-label": (_a = closeAriaLabel !== null && closeAriaLabel !== void 0 ? closeAriaLabel : closeText) !== null && _a !== void 0 ? _a : 'Close alert',
87
87
  onClick: function onClick(event) {
@@ -41,7 +41,7 @@ function Badge(_a) {
41
41
  }
42
42
  }, [badgeType, customColor, customBackgroundColor]);
43
43
  return !isClosed ? jsxs("span", Object.assign({}, props, {
44
- className: "badge ".concat(type),
44
+ className: "gds-badge ".concat(type),
45
45
  style: {
46
46
  color: customColor,
47
47
  backgroundColor: customBackgroundColor
@@ -9,7 +9,7 @@ var Breadcrumb = function Breadcrumb(_ref) {
9
9
  var children = _ref.children,
10
10
  className = _ref.className;
11
11
  return jsx("ul", {
12
- className: classNames('breadcrumb', className),
12
+ className: classNames('gds-breadcrumb', className),
13
13
  children: React.Children.map(children, function (Child, childIndex) {
14
14
  return jsxs(React.Fragment, {
15
15
  children: [Child, childIndex !== React.Children.count(children) - 1 && jsx(BreadcrumbItem, {
@@ -8,7 +8,7 @@ function Card(_ref) {
8
8
  header = _ref.header,
9
9
  footer = _ref.footer;
10
10
  return jsxs("section", {
11
- className: "card",
11
+ className: "gds-card",
12
12
  children: [header && jsx("header", {
13
13
  children: header
14
14
  }), children, footer && jsx("footer", {
@@ -17,7 +17,7 @@ var Button = /*#__PURE__*/forwardRef(function (_a, ref) {
17
17
  size = _a.size,
18
18
  testId = _a.testId,
19
19
  props = __rest(_a, ["className", "variant", "active", "type", "size", "testId"]);
20
- var buttonClassName = classNames(className, variant, size, {
20
+ var buttonClassName = classNames('gds-button', className, variant, size, {
21
21
  active: active
22
22
  }) || undefined;
23
23
  return variant == 'close' ? jsx("button", Object.assign({
@@ -23,11 +23,11 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_a, ref) {
23
23
  _useState2 = _slicedToArray(_useState, 1),
24
24
  uuid = _useState2[0];
25
25
  var validationClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
26
- var labelClassNames = classNames('form-control', _defineProperty({}, validationClassName, validator));
26
+ var labelClassNames = classNames('gds-form-control', _defineProperty({}, validationClassName, validator));
27
27
  var inputClassNames = classNames(className, _defineProperty({}, validationClassName, validator));
28
28
  var describedBy = classNames(ariaDescribedBy, _defineProperty({}, "".concat(uuid, "_message"), (validator === null || validator === void 0 ? void 0 : validator.message) !== undefined && validator.message.length > 0));
29
29
  return jsxs("div", {
30
- className: "form-group",
30
+ className: "gds-form-group",
31
31
  children: [jsxs("label", {
32
32
  htmlFor: uuid,
33
33
  className: labelClassNames,
@@ -43,7 +43,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_a, ref) {
43
43
  ref: ref
44
44
  }, props)), jsx("i", {})]
45
45
  }), validator && jsxs("span", {
46
- className: "form-info",
46
+ className: "gds-form-info",
47
47
  id: "".concat(uuid, "_message"),
48
48
  style: {
49
49
  display: 'flex',
@@ -10,22 +10,22 @@ function Group(_ref) {
10
10
  groupBorder = _ref$groupBorder === void 0 ? false : _ref$groupBorder,
11
11
  _ref$groupFocus = _ref.groupFocus,
12
12
  groupFocus = _ref$groupFocus === void 0 ? false : _ref$groupFocus;
13
- var groupClassName = classNames('group', {
14
- 'group-border': groupBorder
13
+ var groupClassName = classNames('gds-group', {
14
+ 'gds-group-border': groupBorder
15
15
  }, {
16
- 'group-focus': groupFocus
16
+ 'gds-group-focus': groupFocus
17
17
  }, {
18
18
  'is-invalid': error
19
19
  }, className);
20
20
  var errorMessage = error ? error.message || error : '';
21
21
  return jsxs("div", {
22
- className: "form-group",
22
+ className: "gds-form-group",
23
23
  id: id,
24
24
  children: [jsx("div", {
25
25
  className: groupClassName,
26
26
  children: children
27
27
  }), error && jsx("span", {
28
- className: "form-info",
28
+ className: "gds-form-info",
29
29
  id: id && "".concat(id, "-message"),
30
30
  children: errorMessage
31
31
  })]
@@ -75,7 +75,7 @@ var Input = /*#__PURE__*/forwardRef(function (_a, ref) {
75
75
  }, [formatter, setLocalValue, onChange, onChangeInput]);
76
76
  var showSimpleInput = !label && !info && !expandableInfo;
77
77
  var describedBy = classNames(ariaDescribedBy, _defineProperty(_defineProperty({}, "".concat(uuid, "_info"), !showSimpleInput && info), "gds-expandable-info-".concat(uuid), !showSimpleInput && expandableInfo));
78
- var inputClassName = classNames(className, _defineProperty({}, validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator), validator));
78
+ var inputClassName = classNames('gds-input', className, _defineProperty({}, validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator), validator));
79
79
  var input = jsx("input", Object.assign({
80
80
  "aria-describedby": describedBy || undefined,
81
81
  "aria-invalid": (validator === null || validator === void 0 ? void 0 : validator.indicator) === 'error',
@@ -15,7 +15,7 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_a, ref) {
15
15
  var inputClassNames = classNames(validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator));
16
16
  return jsxs("label", {
17
17
  htmlFor: id,
18
- className: "form-control",
18
+ className: "gds-form-control",
19
19
  children: [jsx("input", Object.assign({
20
20
  id: id,
21
21
  type: "radio",
@@ -6,7 +6,7 @@ import { jsx } from 'react/jsx-runtime';
6
6
  var Text = function Text(_ref) {
7
7
  var children = _ref.children;
8
8
  return jsx("span", {
9
- className: "form-text",
9
+ className: "gds-form-text",
10
10
  children: children
11
11
  });
12
12
  };
@@ -55,7 +55,7 @@ var TextArea = /*#__PURE__*/forwardRef(function (_a, ref) {
55
55
  if (onChange) onChange(event);
56
56
  }, [setLocalValue, onChange]);
57
57
  var describedBy = classNames(ariaDescribedBy, _defineProperty(_defineProperty(_defineProperty({}, "gds-expandable-info-".concat(uuid), expandableInfo), "".concat(uuid, "_info"), info), "".concat(uuid, "_message"), (validator === null || validator === void 0 ? void 0 : validator.message) !== undefined && validator.message.length > 0));
58
- var inputClassName = classNames(className, _defineProperty({}, validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator), validator)) || undefined;
58
+ var inputClassName = classNames('gds-textarea', className, _defineProperty({}, validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator), validator)) || undefined;
59
59
  var rightAlignedFooterInfo = maxLength ? "".concat((localValue === null || localValue === void 0 ? void 0 : localValue.length) || 0, "/").concat(maxLength) : undefined;
60
60
  return jsx(FormItem, {
61
61
  "aria-live": ariaLive,
@@ -76,7 +76,7 @@ var FormItem = function FormItem(_ref) {
76
76
  htmlFor: role ? undefined : inputId,
77
77
  children: label
78
78
  }), labelInformation && jsx("div", {
79
- className: "form-info",
79
+ className: "gds-form-info",
80
80
  id: "".concat(inputId, "_info"),
81
81
  children: labelInformation
82
82
  })]
@@ -20,7 +20,7 @@ var InPageWizardStepCard = function InPageWizardStepCard(_ref) {
20
20
  _ref$nextBtnText = _ref.nextBtnText,
21
21
  nextBtnText = _ref$nextBtnText === void 0 ? 'Next' : _ref$nextBtnText,
22
22
  onEditClick = _ref.onEditClick;
23
- var sectionClassName = classNames('gds-in-page-wizard-step-card', 'card', {
23
+ var sectionClassName = classNames('gds-card', 'gds-in-page-wizard-step-card', {
24
24
  active: stepStatus === 'IsActive',
25
25
  completed: stepStatus === 'IsComplete'
26
26
  });
@@ -43,7 +43,7 @@ var InPageWizardStepCard = function InPageWizardStepCard(_ref) {
43
43
  }), stepStatus === 'IsComplete' && jsx("div", {
44
44
  className: "gds-in-page-wizard-step-card__header__edit",
45
45
  children: jsxs("button", {
46
- className: "secondary small",
46
+ className: "gds-button secondary small",
47
47
  onClick: onEditClick,
48
48
  children: [jsx(Edit, {
49
49
  fill: 'var(--color)',
@@ -58,14 +58,14 @@ var InPageWizardStepCard = function InPageWizardStepCard(_ref) {
58
58
  }), stepStatus === 'IsActive' && !hideFooter && jsx("footer", {
59
59
  className: "gds-in-page-wizard-step-card__footer",
60
60
  children: jsxs("button", {
61
- className: "primary",
61
+ className: "gds-button",
62
62
  onClick: onNextClick,
63
63
  children: [nextBtnText, nextBtnIcon]
64
64
  })
65
65
  }), stepStatus === 'IsComplete' && !hideFooter && jsx("footer", {
66
66
  className: "gds-in-page-wizard-step-card__footer gds-in-page-wizard-step-card__footer--edit",
67
67
  children: jsxs("button", {
68
- className: "secondary",
68
+ className: "gds-button secondary",
69
69
  onClick: onEditClick,
70
70
  children: [jsx(Edit, {
71
71
  fill: 'var(--color)',
@@ -1,11 +1,11 @@
1
1
  import { HTMLProps, PropsWithChildren } from 'react';
2
- import { ButtonVariant } from '@sebgroup/extract';
3
2
  interface LinkProps extends HTMLProps<HTMLAnchorElement> {
4
- button?: boolean | ButtonVariant;
3
+ button?: boolean | string;
5
4
  secondary?: boolean;
5
+ variant?: 'blue' | 'white' | 'black';
6
6
  }
7
7
  /**
8
8
  * @deprecated Please use the `gds-link` web component from green-core instead
9
9
  */
10
- export declare const Link: ({ button, secondary, children, className, role, ...otherProps }: PropsWithChildren<LinkProps>) => import("react/jsx-runtime").JSX.Element;
10
+ export declare const Link: ({ button, secondary, children, className, role, variant, ...props }: PropsWithChildren<LinkProps>) => import("react/jsx-runtime").JSX.Element;
11
11
  export default Link;
@@ -11,16 +11,20 @@ var Link = function Link(_a) {
11
11
  children = _a.children,
12
12
  className = _a.className,
13
13
  role = _a.role,
14
- otherProps = __rest(_a, ["button", "secondary", "children", "className", "role"]);
14
+ _a$variant = _a.variant,
15
+ variant = _a$variant === void 0 ? 'blue' : _a$variant,
16
+ props = __rest(_a, ["button", "secondary", "children", "className", "role", "variant"]);
15
17
  var linkClassName = classNames(className, {
16
- button: button
17
- }, button, {
18
- 'link gds-link-arrow': secondary
19
- });
18
+ 'gds-link': !button,
19
+ 'gds-button': button,
20
+ 'gds-link-arrow': secondary,
21
+ 'gds-link--white': variant === 'white',
22
+ 'gds-link--black': variant === 'black'
23
+ }, button);
20
24
  return jsx("a", Object.assign({
21
25
  className: linkClassName,
22
26
  role: button ? 'button' : role
23
- }, otherProps, {
27
+ }, props, {
24
28
  children: children
25
29
  }));
26
30
  };
@@ -1,2 +1 @@
1
1
  export * from './list';
2
- export * as ValueList from './valueList';
@@ -1,5 +1,4 @@
1
1
  export { List } from './list.js';
2
- export { v as ValueList } from '../../../valueList.js';
3
2
  import '../../../_tslib.js';
4
3
  import 'react/jsx-runtime';
5
4
  import './listItem.js';
@@ -103,9 +103,8 @@ var Modal = function Modal(_a) {
103
103
  enableBodyScrollLock = _a$enableBodyScrollLo === void 0 ? true : _a$enableBodyScrollLo,
104
104
  props = __rest(_a, ["type", "id", "isOpen", "size", "enableBodyScrollLock"]);
105
105
  var _useState = useState(id),
106
- _useState2 = _slicedToArray(_useState, 2),
106
+ _useState2 = _slicedToArray(_useState, 1),
107
107
  uuid = _useState2[0];
108
- _useState2[1];
109
108
  var _useState3 = useState(UNMOUNTED),
110
109
  _useState4 = _slicedToArray(_useState3, 2),
111
110
  status = _useState4[0],
@@ -1,6 +1,6 @@
1
1
  import { _ as _slicedToArray } from '../../../../../../_rollupPluginBabelHelpers.js';
2
2
  import { _ as __rest } from '../../../../../../_tslib.js';
3
- import { jsx } from 'react/jsx-runtime';
3
+ import { jsx, jsxs } from 'react/jsx-runtime';
4
4
  import React from 'react';
5
5
  import classNames from 'classnames';
6
6
  import { useTableContext } from '../../context/TableContextProvider.js';
@@ -78,15 +78,15 @@ var TableHeaderCell = /*#__PURE__*/React.forwardRef(function (_a, ref) {
78
78
  }, [sortable, sortedColumn]);
79
79
  return jsx("th", Object.assign({
80
80
  className: classNames(className, {
81
- 'sg-sortable': sortable
81
+ 'gds-sortable': sortable
82
82
  }),
83
83
  onClick: sortable ? onSort : onClick,
84
84
  ref: ref,
85
85
  "aria-sort": getCurrentSortValue()
86
86
  }, props, {
87
- children: sortable ? jsx("button", {
88
- className: "sg-table-sort",
89
- children: children
87
+ children: sortable ? jsxs("button", {
88
+ className: "gds-table-sort",
89
+ children: [" ", children]
90
90
  }) : children
91
91
  }));
92
92
  });
@@ -1,33 +0,0 @@
1
- import { ReactElement } from 'react';
2
- interface ValueListProps {
3
- children?: ReactElement<ValueListItemProps> | ReactElement<ValueListItemProps>[];
4
- inverted?: boolean;
5
- }
6
- interface ValueListItemProps {
7
- children: string;
8
- }
9
- /**
10
- * @deprecated
11
- * Use `GroupedList` instead.
12
- */
13
- export declare const Label: ({ children }: ValueListItemProps) => import("react/jsx-runtime").JSX.Element;
14
- /**
15
- * @deprecated
16
- * Use `GroupedList` instead.
17
- */
18
- export declare const Value: ({ children }: ValueListItemProps) => import("react/jsx-runtime").JSX.Element;
19
- /**
20
- * @deprecated
21
- * Use `GroupedList` instead.
22
- */
23
- export declare const List: ({ children, inverted }: ValueListProps) => import("react/jsx-runtime").JSX.Element;
24
- /**
25
- * @deprecated
26
- * Use `GroupedList` instead.
27
- */
28
- declare const _default: {
29
- List: ({ children, inverted }: ValueListProps) => import("react/jsx-runtime").JSX.Element;
30
- Label: ({ children }: ValueListItemProps) => import("react/jsx-runtime").JSX.Element;
31
- Value: ({ children }: ValueListItemProps) => import("react/jsx-runtime").JSX.Element;
32
- };
33
- export default _default;
@@ -1,2 +0,0 @@
1
- import 'react/jsx-runtime';
2
- export { L as Label, a as List, V as Value, b as default } from '../../../valueList.js';
package/valueList.js DELETED
@@ -1,55 +0,0 @@
1
- import { jsx } from 'react/jsx-runtime';
2
-
3
- /**
4
- * @deprecated
5
- * Use `GroupedList` instead.
6
- */
7
- var Label = function Label(_ref) {
8
- var children = _ref.children;
9
- return jsx("dt", {
10
- children: children
11
- });
12
- };
13
- /**
14
- * @deprecated
15
- * Use `GroupedList` instead.
16
- */
17
- var Value = function Value(_ref2) {
18
- var children = _ref2.children;
19
- return jsx("dd", {
20
- children: children
21
- });
22
- };
23
- /**
24
- * @deprecated
25
- * Use `GroupedList` instead.
26
- */
27
- var List = function List(_ref3) {
28
- var children = _ref3.children,
29
- inverted = _ref3.inverted;
30
- var classNames = 'gds-list';
31
- if (inverted) classNames += ' gds-list--inverted';
32
- return jsx("dl", {
33
- className: classNames,
34
- children: children
35
- });
36
- };
37
- /**
38
- * @deprecated
39
- * Use `GroupedList` instead.
40
- */
41
- var valueList = {
42
- List: List,
43
- Label: Label,
44
- Value: Value
45
- };
46
-
47
- var valueList$1 = /*#__PURE__*/Object.freeze({
48
- __proto__: null,
49
- Label: Label,
50
- List: List,
51
- Value: Value,
52
- default: valueList
53
- });
54
-
55
- export { Label as L, Value as V, List as a, valueList as b, valueList$1 as v };