carbon-react 117.1.2 → 117.2.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.
Files changed (51) hide show
  1. package/esm/components/advanced-color-picker/advanced-color-picker.component.js +20 -2
  2. package/esm/components/advanced-color-picker/advanced-color-picker.style.d.ts +6 -1
  3. package/esm/components/advanced-color-picker/advanced-color-picker.style.js +8 -1
  4. package/esm/components/breadcrumbs/breadcrumbs.component.d.ts +8 -0
  5. package/esm/components/breadcrumbs/breadcrumbs.component.js +28 -0
  6. package/esm/components/breadcrumbs/breadcrumbs.style.d.ts +2 -0
  7. package/esm/components/breadcrumbs/breadcrumbs.style.js +9 -0
  8. package/esm/components/breadcrumbs/crumb/crumb.component.d.ts +11 -0
  9. package/esm/components/breadcrumbs/crumb/crumb.component.js +80 -0
  10. package/esm/components/breadcrumbs/crumb/crumb.style.d.ts +18 -0
  11. package/esm/components/breadcrumbs/crumb/crumb.style.js +33 -0
  12. package/esm/components/breadcrumbs/crumb/index.d.ts +2 -0
  13. package/esm/components/breadcrumbs/crumb/index.js +1 -0
  14. package/esm/components/breadcrumbs/index.d.ts +4 -0
  15. package/esm/components/breadcrumbs/index.js +2 -0
  16. package/esm/components/definition-list/dl.component.d.ts +2 -0
  17. package/esm/components/definition-list/dl.component.js +1 -0
  18. package/esm/components/i18n-provider/i18n-provider.component.js +8 -0
  19. package/esm/components/show-edit-pod/show-edit-pod.component.js +7 -0
  20. package/esm/locales/en-gb.js +8 -0
  21. package/esm/locales/locale.d.ts +8 -0
  22. package/esm/locales/pl-pl.js +49 -0
  23. package/esm/style/utils/visually-hidden.d.ts +2 -0
  24. package/esm/style/utils/visually-hidden.js +10 -0
  25. package/lib/components/advanced-color-picker/advanced-color-picker.component.js +22 -1
  26. package/lib/components/advanced-color-picker/advanced-color-picker.style.d.ts +6 -1
  27. package/lib/components/advanced-color-picker/advanced-color-picker.style.js +11 -1
  28. package/lib/components/breadcrumbs/breadcrumbs.component.d.ts +8 -0
  29. package/lib/components/breadcrumbs/breadcrumbs.component.js +44 -0
  30. package/lib/components/breadcrumbs/breadcrumbs.style.d.ts +2 -0
  31. package/lib/components/breadcrumbs/breadcrumbs.style.js +20 -0
  32. package/lib/components/breadcrumbs/crumb/crumb.component.d.ts +11 -0
  33. package/lib/components/breadcrumbs/crumb/crumb.component.js +95 -0
  34. package/lib/components/breadcrumbs/crumb/crumb.style.d.ts +18 -0
  35. package/lib/components/breadcrumbs/crumb/crumb.style.js +51 -0
  36. package/lib/components/breadcrumbs/crumb/index.d.ts +2 -0
  37. package/lib/components/breadcrumbs/crumb/index.js +15 -0
  38. package/lib/components/breadcrumbs/crumb/package.json +6 -0
  39. package/lib/components/breadcrumbs/index.d.ts +4 -0
  40. package/lib/components/breadcrumbs/index.js +23 -0
  41. package/lib/components/breadcrumbs/package.json +6 -0
  42. package/lib/components/definition-list/dl.component.d.ts +2 -0
  43. package/lib/components/definition-list/dl.component.js +1 -0
  44. package/lib/components/i18n-provider/i18n-provider.component.js +8 -0
  45. package/lib/components/show-edit-pod/show-edit-pod.component.js +9 -0
  46. package/lib/locales/en-gb.js +8 -0
  47. package/lib/locales/locale.d.ts +8 -0
  48. package/lib/locales/pl-pl.js +49 -0
  49. package/lib/style/utils/visually-hidden.d.ts +2 -0
  50. package/lib/style/utils/visually-hidden.js +20 -0
  51. package/package.json +1 -1
@@ -2,10 +2,13 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
2
2
 
3
3
  import React, { useState, useEffect, useCallback, useRef } from "react";
4
4
  import PropTypes from "prop-types";
5
- import { StyledAdvancedColorPickerWrapper, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle } from "./advanced-color-picker.style";
5
+ import { StyledAdvancedColorPickerWrapper, HiddenCurrentColorList, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle } from "./advanced-color-picker.style";
6
6
  import { SimpleColorPicker, SimpleColor } from "../simple-color-picker";
7
7
  import Events from "../../__internal__/utils/helpers/events";
8
8
  import { filterStyledSystemMarginProps } from "../../style/utils";
9
+ import guid from "../../__internal__/utils/helpers/guid";
10
+ import useLocale from "../../hooks/__internal__/useLocale";
11
+ import { Dt, Dd } from "../definition-list";
9
12
 
10
13
  const AdvancedColorPicker = ({
11
14
  "aria-describedby": ariaDescribedBy,
@@ -26,6 +29,8 @@ const AdvancedColorPicker = ({
26
29
  const [dialogOpen, setDialogOpen] = useState();
27
30
  const currentColor = selectedColor || defaultColor;
28
31
  const [selectedColorRef, setSelectedColorRef] = useState(null);
32
+ const descriptionId = useRef(guid());
33
+ const l = useLocale();
29
34
  const simpleColorPickerData = useRef(null);
30
35
  const colors = availableColors.map(({
31
36
  value,
@@ -41,6 +46,14 @@ const AdvancedColorPicker = ({
41
46
  simpleColorPickerData.current ? simpleColorPickerData.current.gridItemRefs[index] : null
42
47
  };
43
48
  });
49
+
50
+ const currentSelectedColor = () => {
51
+ var _availableColors$find;
52
+
53
+ const returnedColor = (_availableColors$find = availableColors.find(color => color.value === currentColor)) === null || _availableColors$find === void 0 ? void 0 : _availableColors$find.label;
54
+ return returnedColor || currentColor;
55
+ };
56
+
44
57
  useEffect(() => {
45
58
  if (dialogOpen || open) {
46
59
  const newColor = colors === null || colors === void 0 ? void 0 : colors.find(c => currentColor === c.value);
@@ -114,11 +127,16 @@ const AdvancedColorPicker = ({
114
127
  m: "15px auto auto 15px"
115
128
  }, filterStyledSystemMarginProps(props)), /*#__PURE__*/React.createElement(StyledAdvancedColorPickerCell, {
116
129
  "data-element": "color-picker-cell",
130
+ "aria-label": l.advancedColorPicker.ariaLabel(),
131
+ "aria-describedby": descriptionId.current,
117
132
  onClick: handleOnOpen,
118
133
  onKeyDown: handleOnKeyDown,
119
134
  color: currentColor,
120
135
  tabIndex: 0
121
- }), /*#__PURE__*/React.createElement(DialogStyle, {
136
+ }), /*#__PURE__*/React.createElement(HiddenCurrentColorList, {
137
+ id: descriptionId.current,
138
+ "data-element": "current-color-description"
139
+ }, /*#__PURE__*/React.createElement(Dt, null, l.advancedColorPicker.currentColorDescriptionTerm(currentSelectedColor())), /*#__PURE__*/React.createElement(Dd, null, l.advancedColorPicker.currentColorAssigned(currentSelectedColor()))), /*#__PURE__*/React.createElement(DialogStyle, {
122
140
  "aria-describedby": ariaDescribedBy,
123
141
  "aria-label": ariaLabel,
124
142
  "aria-labelledby": ariaLabelledBy,
@@ -1,6 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import StyledAdvancedColorPickerCell from "./advanced-color-picker-cell.style";
3
3
  declare const StyledAdvancedColorPickerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ /** To be replaced by accessibly hidden class added in FE-5503 */
5
+ declare const HiddenCurrentColorList: import("styled-components").StyledComponent<{
6
+ ({ children, w, dtTextAlign, ddTextAlign, asSingleColumn, ...rest }: import("../definition-list").DlProps): JSX.Element;
7
+ displayName: string;
8
+ }, any, {}, never>;
4
9
  declare const StyledAdvancedColorPickerPreview: import("styled-components").StyledComponent<"div", any, {}, never>;
5
10
  declare const DialogStyle: import("styled-components").StyledComponent<({ className, children, open, height, size, title, disableEscKey, subtitle, disableAutoFocus, focusFirstElement, focusableSelectors, onCancel, showCloseIcon, bespokeFocusTrap, disableClose, help, role, contentPadding, focusableContainers, ...rest }: import("../dialog/dialog.component").DialogProps) => JSX.Element, any, {}, never>;
6
- export { StyledAdvancedColorPickerWrapper, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle, };
11
+ export { StyledAdvancedColorPickerWrapper, HiddenCurrentColorList, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle, };
@@ -8,10 +8,17 @@ import Dialog from "../dialog/dialog.component";
8
8
  import StyledIconButton from "../icon-button/icon-button.style";
9
9
  import checkerBoardSvg from "../simple-color-picker/simple-color/checker-board.svg";
10
10
  import baseTheme from "../../style/themes/base";
11
+ import visuallyHiddenStyles from "../../style/utils/visually-hidden";
12
+ import { Dl } from "../definition-list";
11
13
  const StyledAdvancedColorPickerWrapper = styled.div`
12
14
  ${margin}
13
15
  display: inline-block;
14
16
  `;
17
+ /** To be replaced by accessibly hidden class added in FE-5503 */
18
+
19
+ const HiddenCurrentColorList = styled(Dl)`
20
+ ${visuallyHiddenStyles}
21
+ `;
15
22
  StyledAdvancedColorPickerWrapper.defaultProps = {
16
23
  theme: baseTheme
17
24
  };
@@ -75,4 +82,4 @@ const DialogStyle = styled(Dialog)`
75
82
  color: var(--colorsActionMinor500);
76
83
  }
77
84
  `;
78
- export { StyledAdvancedColorPickerWrapper, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle };
85
+ export { StyledAdvancedColorPickerWrapper, HiddenCurrentColorList, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { TagProps } from "../../__internal__/utils/helpers/tags";
3
+ export interface BreadcrumbsProps extends TagProps {
4
+ /** Child crumbs to display */
5
+ children: React.ReactNode;
6
+ }
7
+ export declare const Breadcrumbs: React.ForwardRefExoticComponent<BreadcrumbsProps & React.RefAttributes<HTMLElement>>;
8
+ export default Breadcrumbs;
@@ -0,0 +1,28 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from "react";
4
+ import PropTypes from "prop-types";
5
+ import tagComponent from "../../__internal__/utils/helpers/tags";
6
+ import StyledBreadcrumbs from "./breadcrumbs.style";
7
+ import useLocale from "../../hooks/__internal__/useLocale";
8
+ const Breadcrumbs = /*#__PURE__*/React.forwardRef(({
9
+ children,
10
+ ...rest
11
+ }, ref) => {
12
+ const l = useLocale();
13
+ return /*#__PURE__*/React.createElement(StyledBreadcrumbs, _extends({
14
+ ref: ref,
15
+ role: "navigation"
16
+ }, tagComponent("breadcrumbs", rest), {
17
+ "aria-label": l.breadcrumbs.ariaLabel()
18
+ }), /*#__PURE__*/React.createElement("ol", null, children));
19
+ });
20
+ Breadcrumbs.propTypes = {
21
+ "children": PropTypes.node,
22
+ "data-component": PropTypes.string,
23
+ "data-element": PropTypes.string,
24
+ "data-role": PropTypes.string
25
+ };
26
+ export { Breadcrumbs };
27
+ Breadcrumbs.displayName = "Breadcrumbs";
28
+ export default Breadcrumbs;
@@ -0,0 +1,2 @@
1
+ declare const StyledBreadcrumbs: import("styled-components").StyledComponent<"nav", any, {}, never>;
2
+ export default StyledBreadcrumbs;
@@ -0,0 +1,9 @@
1
+ import styled from "styled-components";
2
+ const StyledBreadcrumbs = styled.nav`
3
+ ol {
4
+ list-style: none;
5
+ display: flex;
6
+ flex-wrap: wrap;
7
+ }
8
+ `;
9
+ export default StyledBreadcrumbs;
@@ -0,0 +1,11 @@
1
+ import { LinkProps } from "components/link/link.component";
2
+ import React from "react";
3
+ import { TagProps } from "../../../__internal__/utils/helpers/tags";
4
+ export interface CrumbProps extends Omit<LinkProps, "tooltipMessage" | "tooltipPosition" | "iconType" | "iconAlign" | "isSkipLink" | "isDarkBackground" | "ariaLabel" | "className" | "variant" | "target" | "rel" | "icon" | "disabled">, TagProps {
5
+ /** This sets the Crumb to current, does not render Link */
6
+ isCurrent?: boolean;
7
+ /** The href string for Crumb Link */
8
+ href: string;
9
+ }
10
+ declare const Crumb: React.ForwardRefExoticComponent<CrumbProps & React.RefAttributes<HTMLLinkElement>>;
11
+ export default Crumb;
@@ -0,0 +1,80 @@
1
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ import React from "react";
4
+ import PropTypes from "prop-types";
5
+ import tagComponent from "../../../__internal__/utils/helpers/tags";
6
+ import { StyledCrumb, Divider } from "./crumb.style";
7
+ const Crumb = /*#__PURE__*/React.forwardRef(({
8
+ href,
9
+ isCurrent,
10
+ children,
11
+ ...rest
12
+ }, ref) => /*#__PURE__*/React.createElement("li", null, /*#__PURE__*/React.createElement(StyledCrumb, _extends({
13
+ ref: ref,
14
+ isCurrent: isCurrent,
15
+ "aria-current": isCurrent ? "page" : undefined
16
+ }, tagComponent("crumb", rest), !isCurrent && {
17
+ href
18
+ }), children), !isCurrent && /*#__PURE__*/React.createElement(Divider, null)));
19
+ Crumb.propTypes = {
20
+ "aria-activedescendant": PropTypes.string,
21
+ "aria-atomic": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
22
+ "aria-autocomplete": PropTypes.oneOf(["both", "inline", "list", "none"]),
23
+ "aria-busy": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
24
+ "aria-checked": PropTypes.oneOfType([PropTypes.oneOf(["false", "mixed", "true"]), PropTypes.bool]),
25
+ "aria-colcount": PropTypes.number,
26
+ "aria-colindex": PropTypes.number,
27
+ "aria-colspan": PropTypes.number,
28
+ "aria-controls": PropTypes.string,
29
+ "aria-current": PropTypes.oneOfType([PropTypes.oneOf(["date", "false", "location", "page", "step", "time", "true"]), PropTypes.bool]),
30
+ "aria-describedby": PropTypes.string,
31
+ "aria-details": PropTypes.string,
32
+ "aria-disabled": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
33
+ "aria-dropeffect": PropTypes.oneOf(["copy", "execute", "link", "move", "none", "popup"]),
34
+ "aria-errormessage": PropTypes.string,
35
+ "aria-expanded": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
36
+ "aria-flowto": PropTypes.string,
37
+ "aria-grabbed": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
38
+ "aria-haspopup": PropTypes.oneOfType([PropTypes.oneOf(["dialog", "false", "grid", "listbox", "menu", "tree", "true"]), PropTypes.bool]),
39
+ "aria-hidden": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
40
+ "aria-invalid": PropTypes.oneOfType([PropTypes.oneOf(["false", "grammar", "spelling", "true"]), PropTypes.bool]),
41
+ "aria-keyshortcuts": PropTypes.string,
42
+ "aria-label": PropTypes.string,
43
+ "aria-labelledby": PropTypes.string,
44
+ "aria-level": PropTypes.number,
45
+ "aria-live": PropTypes.oneOf(["assertive", "off", "polite"]),
46
+ "aria-modal": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
47
+ "aria-multiline": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
48
+ "aria-multiselectable": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
49
+ "aria-orientation": PropTypes.oneOf(["horizontal", "vertical"]),
50
+ "aria-owns": PropTypes.string,
51
+ "aria-placeholder": PropTypes.string,
52
+ "aria-posinset": PropTypes.number,
53
+ "aria-pressed": PropTypes.oneOfType([PropTypes.oneOf(["false", "mixed", "true"]), PropTypes.bool]),
54
+ "aria-readonly": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
55
+ "aria-relevant": PropTypes.oneOf(["additions removals", "additions text", "additions", "all", "removals additions", "removals text", "removals", "text additions", "text removals", "text"]),
56
+ "aria-required": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
57
+ "aria-roledescription": PropTypes.string,
58
+ "aria-rowcount": PropTypes.number,
59
+ "aria-rowindex": PropTypes.number,
60
+ "aria-rowspan": PropTypes.number,
61
+ "aria-selected": PropTypes.oneOfType([PropTypes.oneOf(["false", "true"]), PropTypes.bool]),
62
+ "aria-setsize": PropTypes.number,
63
+ "aria-sort": PropTypes.oneOf(["ascending", "descending", "none", "other"]),
64
+ "aria-valuemax": PropTypes.number,
65
+ "aria-valuemin": PropTypes.number,
66
+ "aria-valuenow": PropTypes.number,
67
+ "aria-valuetext": PropTypes.string,
68
+ "children": PropTypes.node,
69
+ "data-component": PropTypes.string,
70
+ "data-element": PropTypes.string,
71
+ "data-role": PropTypes.string,
72
+ "href": PropTypes.string.isRequired,
73
+ "isCurrent": PropTypes.bool,
74
+ "onClick": PropTypes.func,
75
+ "onKeyDown": PropTypes.func,
76
+ "onMouseDown": PropTypes.func,
77
+ "placeholderTabIndex": PropTypes.bool
78
+ };
79
+ Crumb.displayName = "Crumb";
80
+ export default Crumb;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { LinkProps } from "../../link";
3
+ interface StyleCrumbProps extends LinkProps {
4
+ isCurrent?: boolean;
5
+ }
6
+ export declare const StyledCrumb: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLButtonElement | HTMLLinkElement>>, any, StyleCrumbProps, never>;
7
+ export declare const Divider: import("styled-components").StyledComponent<"span", any, {
8
+ children: "/";
9
+ "aria-hidden": "true";
10
+ }, "aria-hidden" | "children">;
11
+ declare const _default: {
12
+ StyledCrumb: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLButtonElement | HTMLLinkElement>>, any, StyleCrumbProps, never>;
13
+ Divider: import("styled-components").StyledComponent<"span", any, {
14
+ children: "/";
15
+ "aria-hidden": "true";
16
+ }, "aria-hidden" | "children">;
17
+ };
18
+ export default _default;
@@ -0,0 +1,33 @@
1
+ import styled, { css } from "styled-components";
2
+ import Link from "../../link";
3
+ export const StyledCrumb = styled(Link)`
4
+ font: var(--typographyLinkTextM);
5
+ ${({
6
+ isCurrent
7
+ }) => isCurrent && css`
8
+ a {
9
+ color: var(--colorsUtilityYin090);
10
+ text-decoration: none;
11
+ font: var(--typographyBreadcrumbCurrentPageM);
12
+ cursor: text;
13
+ :hover {
14
+ color: var(--colorsUtilityYin090);
15
+ text-decoration: none;
16
+ cursor: text;
17
+ }
18
+ }
19
+ `}
20
+ `;
21
+ export const Divider = styled.span.attrs({
22
+ children: "/",
23
+ "aria-hidden": "true"
24
+ })`
25
+ margin: 0px var(--spacing050) 0px var(--spacing100);
26
+ line-height: 16px;
27
+ font: var(--typographyBreadcrumbSeparatorM);
28
+ color: var(--colorsUtilityYin055);
29
+ `;
30
+ export default {
31
+ StyledCrumb,
32
+ Divider
33
+ };
@@ -0,0 +1,2 @@
1
+ export { default as Crumb } from "./crumb.component";
2
+ export type { CrumbProps } from "./crumb.component";
@@ -0,0 +1 @@
1
+ export { default as Crumb } from "./crumb.component";
@@ -0,0 +1,4 @@
1
+ export { default as Breadcrumbs } from "./breadcrumbs.component";
2
+ export { Crumb } from "./crumb";
3
+ export type { BreadcrumbsProps } from "./breadcrumbs.component";
4
+ export type { CrumbProps } from "./crumb";
@@ -0,0 +1,2 @@
1
+ export { default as Breadcrumbs } from "./breadcrumbs.component";
2
+ export { Crumb } from "./crumb";
@@ -2,6 +2,8 @@ import React from "react";
2
2
  import { SpaceProps } from "styled-system";
3
3
  import { StyledDtDivProps, StyledDdDivProps, StyledDlProps } from "./definition-list.style";
4
4
  export interface DlProps extends SpaceProps, StyledDlProps, StyledDtDivProps, StyledDdDivProps {
5
+ /** HTML id attribute of the input */
6
+ id?: string;
5
7
  /** prop to render children. */
6
8
  children: React.ReactNode;
7
9
  }
@@ -75,6 +75,7 @@ Dl.propTypes = {
75
75
  "children": PropTypes.node,
76
76
  "ddTextAlign": PropTypes.oneOf(["center", "left", "right"]),
77
77
  "dtTextAlign": PropTypes.oneOf(["center", "left", "right"]),
78
+ "id": PropTypes.string,
78
79
  "m": PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.oneOf([null]), PropTypes.number, PropTypes.shape({
79
80
  "__@toStringTag": PropTypes.string.isRequired,
80
81
  "description": PropTypes.string,
@@ -21,9 +21,17 @@ I18nProvider.propTypes = {
21
21
  "delete": PropTypes.func.isRequired,
22
22
  "edit": PropTypes.func.isRequired
23
23
  }),
24
+ "advancedColorPicker": PropTypes.shape({
25
+ "ariaLabel": PropTypes.func.isRequired,
26
+ "currentColorAssigned": PropTypes.func.isRequired,
27
+ "currentColorDescriptionTerm": PropTypes.func.isRequired
28
+ }),
24
29
  "batchSelection": PropTypes.shape({
25
30
  "selected": PropTypes.func.isRequired
26
31
  }),
32
+ "breadcrumbs": PropTypes.shape({
33
+ "ariaLabel": PropTypes.func.isRequired
34
+ }),
27
35
  "characterCount": PropTypes.shape({
28
36
  "charactersLeft": PropTypes.func.isRequired,
29
37
  "hintString": PropTypes.func.isRequired,
@@ -9,7 +9,9 @@ import Events from "../../__internal__/utils/helpers/events";
9
9
  import tagComponent from "../../__internal__/utils/helpers/tags/tags";
10
10
  import LocaleContext from "../../__internal__/i18n-context";
11
11
  import StyledPod from "./show-edit-pod.style";
12
+ import Logger from "../../__internal__/utils/logger";
12
13
  const marginPropTypes = filterStyledSystemMarginProps(styledSystemPropTypes.space);
14
+ let deprecateWarnTriggered = false;
13
15
 
14
16
  const ShowEditPod = ({
15
17
  border = false,
@@ -35,6 +37,11 @@ const ShowEditPod = ({
35
37
  variant = "transparent",
36
38
  ...rest
37
39
  }) => {
40
+ if (!deprecateWarnTriggered) {
41
+ deprecateWarnTriggered = true;
42
+ Logger.deprecate("The ShowEditPod component is deprecated and will soon be removed. Please use alternatives such as the Fieldset, Form or Pod components instead.");
43
+ }
44
+
38
45
  const locale = useContext(LocaleContext);
39
46
  const ref = useRef();
40
47
  const editModeNodeRef = useRef();
@@ -11,9 +11,17 @@ const enGB = {
11
11
  actionPopover: {
12
12
  ariaLabel: () => "actions"
13
13
  },
14
+ advancedColorPicker: {
15
+ ariaLabel: () => "Change colour",
16
+ currentColorDescriptionTerm: () => "Current color assigned: ",
17
+ currentColorAssigned: currentColor => currentColor
18
+ },
14
19
  batchSelection: {
15
20
  selected: count => `${count} selected`
16
21
  },
22
+ breadcrumbs: {
23
+ ariaLabel: () => "breadcrumbs"
24
+ },
17
25
  confirm: {
18
26
  no: () => "No",
19
27
  yes: () => "Yes"
@@ -8,9 +8,17 @@ interface Locale {
8
8
  actionPopover: {
9
9
  ariaLabel: () => string;
10
10
  };
11
+ advancedColorPicker: {
12
+ ariaLabel: () => string;
13
+ currentColorDescriptionTerm: (currentColor: string) => string;
14
+ currentColorAssigned: (currentColor: string) => string;
15
+ };
11
16
  batchSelection: {
12
17
  selected: (count: number | string) => string;
13
18
  };
19
+ breadcrumbs: {
20
+ ariaLabel: () => string;
21
+ };
14
22
  characterCount: {
15
23
  hintString: () => string;
16
24
  tooManyCharacters: (count: number, formattedCount: string) => string;
@@ -13,6 +13,47 @@ export const PolishPlural = (singularNominativ, pluralNominativ, pluralGenitive,
13
13
 
14
14
  return pluralGenitive;
15
15
  };
16
+
17
+ const translateColor = color => {
18
+ switch (color.toLowerCase()) {
19
+ case "white":
20
+ return "biały";
21
+
22
+ case "transparent":
23
+ return "przezroczysty";
24
+
25
+ case "black":
26
+ return "czarny";
27
+
28
+ case "blue":
29
+ return "niebieski";
30
+
31
+ case "pink":
32
+ return "różowy";
33
+
34
+ case "purple":
35
+ return "fioletowy";
36
+
37
+ case "goldenrod":
38
+ return "złoty";
39
+
40
+ case "orchid":
41
+ return "ciemny róż";
42
+
43
+ case "desert":
44
+ return "pustynny";
45
+
46
+ case "turquoise":
47
+ return "turkusowy";
48
+
49
+ case "mint":
50
+ return "miętowy";
51
+
52
+ default:
53
+ return color;
54
+ }
55
+ };
56
+
16
57
  const plPL = {
17
58
  locale: () => "pl-PL",
18
59
  actions: {
@@ -22,9 +63,17 @@ const plPL = {
22
63
  actionPopover: {
23
64
  ariaLabel: () => "akcje"
24
65
  },
66
+ advancedColorPicker: {
67
+ ariaLabel: () => "Zmień kolor",
68
+ currentColorDescriptionTerm: currentColor => translateColor(currentColor) === "biały" ? "Aktualny przypisany kolor: " : "Aktualnie przypisany kolor: ",
69
+ currentColorAssigned: currentColor => translateColor(currentColor)
70
+ },
25
71
  batchSelection: {
26
72
  selected: count => `${count} wybrano`
27
73
  },
74
+ breadcrumbs: {
75
+ ariaLabel: () => "okruszki"
76
+ },
28
77
  confirm: {
29
78
  no: () => "Nie",
30
79
  yes: () => "Tak"
@@ -0,0 +1,2 @@
1
+ declare const _default: import("styled-components").FlattenSimpleInterpolation;
2
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { css } from "styled-components";
2
+ export default css`
3
+ border: 0;
4
+ height: 1px;
5
+ margin: -1px;
6
+ overflow: hidden;
7
+ padding: 0;
8
+ position: absolute;
9
+ width: 1px;
10
+ `;
@@ -17,6 +17,12 @@ var _events = _interopRequireDefault(require("../../__internal__/utils/helpers/e
17
17
 
18
18
  var _utils = require("../../style/utils");
19
19
 
20
+ var _guid = _interopRequireDefault(require("../../__internal__/utils/helpers/guid"));
21
+
22
+ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
23
+
24
+ var _definitionList = require("../definition-list");
25
+
20
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
27
 
22
28
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -44,6 +50,8 @@ const AdvancedColorPicker = ({
44
50
  const [dialogOpen, setDialogOpen] = (0, _react.useState)();
45
51
  const currentColor = selectedColor || defaultColor;
46
52
  const [selectedColorRef, setSelectedColorRef] = (0, _react.useState)(null);
53
+ const descriptionId = (0, _react.useRef)((0, _guid.default)());
54
+ const l = (0, _useLocale.default)();
47
55
  const simpleColorPickerData = (0, _react.useRef)(null);
48
56
  const colors = availableColors.map(({
49
57
  value,
@@ -59,6 +67,14 @@ const AdvancedColorPicker = ({
59
67
  simpleColorPickerData.current ? simpleColorPickerData.current.gridItemRefs[index] : null
60
68
  };
61
69
  });
70
+
71
+ const currentSelectedColor = () => {
72
+ var _availableColors$find;
73
+
74
+ const returnedColor = (_availableColors$find = availableColors.find(color => color.value === currentColor)) === null || _availableColors$find === void 0 ? void 0 : _availableColors$find.label;
75
+ return returnedColor || currentColor;
76
+ };
77
+
62
78
  (0, _react.useEffect)(() => {
63
79
  if (dialogOpen || open) {
64
80
  const newColor = colors === null || colors === void 0 ? void 0 : colors.find(c => currentColor === c.value);
@@ -132,11 +148,16 @@ const AdvancedColorPicker = ({
132
148
  m: "15px auto auto 15px"
133
149
  }, (0, _utils.filterStyledSystemMarginProps)(props)), /*#__PURE__*/_react.default.createElement(_advancedColorPicker.StyledAdvancedColorPickerCell, {
134
150
  "data-element": "color-picker-cell",
151
+ "aria-label": l.advancedColorPicker.ariaLabel(),
152
+ "aria-describedby": descriptionId.current,
135
153
  onClick: handleOnOpen,
136
154
  onKeyDown: handleOnKeyDown,
137
155
  color: currentColor,
138
156
  tabIndex: 0
139
- }), /*#__PURE__*/_react.default.createElement(_advancedColorPicker.DialogStyle, {
157
+ }), /*#__PURE__*/_react.default.createElement(_advancedColorPicker.HiddenCurrentColorList, {
158
+ id: descriptionId.current,
159
+ "data-element": "current-color-description"
160
+ }, /*#__PURE__*/_react.default.createElement(_definitionList.Dt, null, l.advancedColorPicker.currentColorDescriptionTerm(currentSelectedColor())), /*#__PURE__*/_react.default.createElement(_definitionList.Dd, null, l.advancedColorPicker.currentColorAssigned(currentSelectedColor()))), /*#__PURE__*/_react.default.createElement(_advancedColorPicker.DialogStyle, {
140
161
  "aria-describedby": ariaDescribedBy,
141
162
  "aria-label": ariaLabel,
142
163
  "aria-labelledby": ariaLabelledBy,
@@ -1,6 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import StyledAdvancedColorPickerCell from "./advanced-color-picker-cell.style";
3
3
  declare const StyledAdvancedColorPickerWrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
4
+ /** To be replaced by accessibly hidden class added in FE-5503 */
5
+ declare const HiddenCurrentColorList: import("styled-components").StyledComponent<{
6
+ ({ children, w, dtTextAlign, ddTextAlign, asSingleColumn, ...rest }: import("../definition-list").DlProps): JSX.Element;
7
+ displayName: string;
8
+ }, any, {}, never>;
4
9
  declare const StyledAdvancedColorPickerPreview: import("styled-components").StyledComponent<"div", any, {}, never>;
5
10
  declare const DialogStyle: import("styled-components").StyledComponent<({ className, children, open, height, size, title, disableEscKey, subtitle, disableAutoFocus, focusFirstElement, focusableSelectors, onCancel, showCloseIcon, bespokeFocusTrap, disableClose, help, role, contentPadding, focusableContainers, ...rest }: import("../dialog/dialog.component").DialogProps) => JSX.Element, any, {}, never>;
6
- export { StyledAdvancedColorPickerWrapper, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle, };
11
+ export { StyledAdvancedColorPickerWrapper, HiddenCurrentColorList, StyledAdvancedColorPickerCell, StyledAdvancedColorPickerPreview, DialogStyle, };
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "StyledAdvancedColorPickerCell", {
9
9
  return _advancedColorPickerCell.default;
10
10
  }
11
11
  });
12
- exports.DialogStyle = exports.StyledAdvancedColorPickerPreview = exports.StyledAdvancedColorPickerWrapper = void 0;
12
+ exports.DialogStyle = exports.StyledAdvancedColorPickerPreview = exports.HiddenCurrentColorList = exports.StyledAdvancedColorPickerWrapper = void 0;
13
13
 
14
14
  var _styledComponents = _interopRequireWildcard(require("styled-components"));
15
15
 
@@ -31,6 +31,10 @@ var _checkerBoard = _interopRequireDefault(require("../simple-color-picker/simpl
31
31
 
32
32
  var _base = _interopRequireDefault(require("../../style/themes/base"));
33
33
 
34
+ var _visuallyHidden = _interopRequireDefault(require("../../style/utils/visually-hidden"));
35
+
36
+ var _definitionList = require("../definition-list");
37
+
34
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
35
39
 
36
40
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -41,7 +45,13 @@ const StyledAdvancedColorPickerWrapper = _styledComponents.default.div`
41
45
  ${_styledSystem.margin}
42
46
  display: inline-block;
43
47
  `;
48
+ /** To be replaced by accessibly hidden class added in FE-5503 */
49
+
44
50
  exports.StyledAdvancedColorPickerWrapper = StyledAdvancedColorPickerWrapper;
51
+ const HiddenCurrentColorList = (0, _styledComponents.default)(_definitionList.Dl)`
52
+ ${_visuallyHidden.default}
53
+ `;
54
+ exports.HiddenCurrentColorList = HiddenCurrentColorList;
45
55
  StyledAdvancedColorPickerWrapper.defaultProps = {
46
56
  theme: _base.default
47
57
  };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ import { TagProps } from "../../__internal__/utils/helpers/tags";
3
+ export interface BreadcrumbsProps extends TagProps {
4
+ /** Child crumbs to display */
5
+ children: React.ReactNode;
6
+ }
7
+ export declare const Breadcrumbs: React.ForwardRefExoticComponent<BreadcrumbsProps & React.RefAttributes<HTMLElement>>;
8
+ export default Breadcrumbs;
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Breadcrumbs = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _tags = _interopRequireDefault(require("../../__internal__/utils/helpers/tags"));
13
+
14
+ var _breadcrumbs = _interopRequireDefault(require("./breadcrumbs.style"));
15
+
16
+ var _useLocale = _interopRequireDefault(require("../../hooks/__internal__/useLocale"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
20
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
+
22
+ const Breadcrumbs = /*#__PURE__*/_react.default.forwardRef(({
23
+ children,
24
+ ...rest
25
+ }, ref) => {
26
+ const l = (0, _useLocale.default)();
27
+ return /*#__PURE__*/_react.default.createElement(_breadcrumbs.default, _extends({
28
+ ref: ref,
29
+ role: "navigation"
30
+ }, (0, _tags.default)("breadcrumbs", rest), {
31
+ "aria-label": l.breadcrumbs.ariaLabel()
32
+ }), /*#__PURE__*/_react.default.createElement("ol", null, children));
33
+ });
34
+
35
+ exports.Breadcrumbs = Breadcrumbs;
36
+ Breadcrumbs.propTypes = {
37
+ "children": _propTypes.default.node,
38
+ "data-component": _propTypes.default.string,
39
+ "data-element": _propTypes.default.string,
40
+ "data-role": _propTypes.default.string
41
+ };
42
+ Breadcrumbs.displayName = "Breadcrumbs";
43
+ var _default = Breadcrumbs;
44
+ exports.default = _default;
@@ -0,0 +1,2 @@
1
+ declare const StyledBreadcrumbs: import("styled-components").StyledComponent<"nav", any, {}, never>;
2
+ export default StyledBreadcrumbs;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ const StyledBreadcrumbs = _styledComponents.default.nav`
13
+ ol {
14
+ list-style: none;
15
+ display: flex;
16
+ flex-wrap: wrap;
17
+ }
18
+ `;
19
+ var _default = StyledBreadcrumbs;
20
+ exports.default = _default;
@@ -0,0 +1,11 @@
1
+ import { LinkProps } from "components/link/link.component";
2
+ import React from "react";
3
+ import { TagProps } from "../../../__internal__/utils/helpers/tags";
4
+ export interface CrumbProps extends Omit<LinkProps, "tooltipMessage" | "tooltipPosition" | "iconType" | "iconAlign" | "isSkipLink" | "isDarkBackground" | "ariaLabel" | "className" | "variant" | "target" | "rel" | "icon" | "disabled">, TagProps {
5
+ /** This sets the Crumb to current, does not render Link */
6
+ isCurrent?: boolean;
7
+ /** The href string for Crumb Link */
8
+ href: string;
9
+ }
10
+ declare const Crumb: React.ForwardRefExoticComponent<CrumbProps & React.RefAttributes<HTMLLinkElement>>;
11
+ export default Crumb;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _react = _interopRequireDefault(require("react"));
9
+
10
+ var _propTypes = _interopRequireDefault(require("prop-types"));
11
+
12
+ var _tags = _interopRequireDefault(require("../../../__internal__/utils/helpers/tags"));
13
+
14
+ var _crumb = require("./crumb.style");
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
19
+
20
+ const Crumb = /*#__PURE__*/_react.default.forwardRef(({
21
+ href,
22
+ isCurrent,
23
+ children,
24
+ ...rest
25
+ }, ref) => /*#__PURE__*/_react.default.createElement("li", null, /*#__PURE__*/_react.default.createElement(_crumb.StyledCrumb, _extends({
26
+ ref: ref,
27
+ isCurrent: isCurrent,
28
+ "aria-current": isCurrent ? "page" : undefined
29
+ }, (0, _tags.default)("crumb", rest), !isCurrent && {
30
+ href
31
+ }), children), !isCurrent && /*#__PURE__*/_react.default.createElement(_crumb.Divider, null)));
32
+
33
+ Crumb.propTypes = {
34
+ "aria-activedescendant": _propTypes.default.string,
35
+ "aria-atomic": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
36
+ "aria-autocomplete": _propTypes.default.oneOf(["both", "inline", "list", "none"]),
37
+ "aria-busy": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
38
+ "aria-checked": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "mixed", "true"]), _propTypes.default.bool]),
39
+ "aria-colcount": _propTypes.default.number,
40
+ "aria-colindex": _propTypes.default.number,
41
+ "aria-colspan": _propTypes.default.number,
42
+ "aria-controls": _propTypes.default.string,
43
+ "aria-current": _propTypes.default.oneOfType([_propTypes.default.oneOf(["date", "false", "location", "page", "step", "time", "true"]), _propTypes.default.bool]),
44
+ "aria-describedby": _propTypes.default.string,
45
+ "aria-details": _propTypes.default.string,
46
+ "aria-disabled": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
47
+ "aria-dropeffect": _propTypes.default.oneOf(["copy", "execute", "link", "move", "none", "popup"]),
48
+ "aria-errormessage": _propTypes.default.string,
49
+ "aria-expanded": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
50
+ "aria-flowto": _propTypes.default.string,
51
+ "aria-grabbed": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
52
+ "aria-haspopup": _propTypes.default.oneOfType([_propTypes.default.oneOf(["dialog", "false", "grid", "listbox", "menu", "tree", "true"]), _propTypes.default.bool]),
53
+ "aria-hidden": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
54
+ "aria-invalid": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "grammar", "spelling", "true"]), _propTypes.default.bool]),
55
+ "aria-keyshortcuts": _propTypes.default.string,
56
+ "aria-label": _propTypes.default.string,
57
+ "aria-labelledby": _propTypes.default.string,
58
+ "aria-level": _propTypes.default.number,
59
+ "aria-live": _propTypes.default.oneOf(["assertive", "off", "polite"]),
60
+ "aria-modal": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
61
+ "aria-multiline": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
62
+ "aria-multiselectable": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
63
+ "aria-orientation": _propTypes.default.oneOf(["horizontal", "vertical"]),
64
+ "aria-owns": _propTypes.default.string,
65
+ "aria-placeholder": _propTypes.default.string,
66
+ "aria-posinset": _propTypes.default.number,
67
+ "aria-pressed": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "mixed", "true"]), _propTypes.default.bool]),
68
+ "aria-readonly": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
69
+ "aria-relevant": _propTypes.default.oneOf(["additions removals", "additions text", "additions", "all", "removals additions", "removals text", "removals", "text additions", "text removals", "text"]),
70
+ "aria-required": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
71
+ "aria-roledescription": _propTypes.default.string,
72
+ "aria-rowcount": _propTypes.default.number,
73
+ "aria-rowindex": _propTypes.default.number,
74
+ "aria-rowspan": _propTypes.default.number,
75
+ "aria-selected": _propTypes.default.oneOfType([_propTypes.default.oneOf(["false", "true"]), _propTypes.default.bool]),
76
+ "aria-setsize": _propTypes.default.number,
77
+ "aria-sort": _propTypes.default.oneOf(["ascending", "descending", "none", "other"]),
78
+ "aria-valuemax": _propTypes.default.number,
79
+ "aria-valuemin": _propTypes.default.number,
80
+ "aria-valuenow": _propTypes.default.number,
81
+ "aria-valuetext": _propTypes.default.string,
82
+ "children": _propTypes.default.node,
83
+ "data-component": _propTypes.default.string,
84
+ "data-element": _propTypes.default.string,
85
+ "data-role": _propTypes.default.string,
86
+ "href": _propTypes.default.string.isRequired,
87
+ "isCurrent": _propTypes.default.bool,
88
+ "onClick": _propTypes.default.func,
89
+ "onKeyDown": _propTypes.default.func,
90
+ "onMouseDown": _propTypes.default.func,
91
+ "placeholderTabIndex": _propTypes.default.bool
92
+ };
93
+ Crumb.displayName = "Crumb";
94
+ var _default = Crumb;
95
+ exports.default = _default;
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { LinkProps } from "../../link";
3
+ interface StyleCrumbProps extends LinkProps {
4
+ isCurrent?: boolean;
5
+ }
6
+ export declare const StyledCrumb: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLButtonElement | HTMLLinkElement>>, any, StyleCrumbProps, never>;
7
+ export declare const Divider: import("styled-components").StyledComponent<"span", any, {
8
+ children: "/";
9
+ "aria-hidden": "true";
10
+ }, "aria-hidden" | "children">;
11
+ declare const _default: {
12
+ StyledCrumb: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<LinkProps & import("react").RefAttributes<HTMLButtonElement | HTMLLinkElement>>, any, StyleCrumbProps, never>;
13
+ Divider: import("styled-components").StyledComponent<"span", any, {
14
+ children: "/";
15
+ "aria-hidden": "true";
16
+ }, "aria-hidden" | "children">;
17
+ };
18
+ export default _default;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = exports.Divider = exports.StyledCrumb = void 0;
7
+
8
+ var _styledComponents = _interopRequireWildcard(require("styled-components"));
9
+
10
+ var _link = _interopRequireDefault(require("../../link"));
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
15
+
16
+ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
17
+
18
+ const StyledCrumb = (0, _styledComponents.default)(_link.default)`
19
+ font: var(--typographyLinkTextM);
20
+ ${({
21
+ isCurrent
22
+ }) => isCurrent && (0, _styledComponents.css)`
23
+ a {
24
+ color: var(--colorsUtilityYin090);
25
+ text-decoration: none;
26
+ font: var(--typographyBreadcrumbCurrentPageM);
27
+ cursor: text;
28
+ :hover {
29
+ color: var(--colorsUtilityYin090);
30
+ text-decoration: none;
31
+ cursor: text;
32
+ }
33
+ }
34
+ `}
35
+ `;
36
+ exports.StyledCrumb = StyledCrumb;
37
+ const Divider = _styledComponents.default.span.attrs({
38
+ children: "/",
39
+ "aria-hidden": "true"
40
+ })`
41
+ margin: 0px var(--spacing050) 0px var(--spacing100);
42
+ line-height: 16px;
43
+ font: var(--typographyBreadcrumbSeparatorM);
44
+ color: var(--colorsUtilityYin055);
45
+ `;
46
+ exports.Divider = Divider;
47
+ var _default = {
48
+ StyledCrumb,
49
+ Divider
50
+ };
51
+ exports.default = _default;
@@ -0,0 +1,2 @@
1
+ export { default as Crumb } from "./crumb.component";
2
+ export type { CrumbProps } from "./crumb.component";
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Crumb", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _crumb.default;
10
+ }
11
+ });
12
+
13
+ var _crumb = _interopRequireDefault(require("./crumb.component"));
14
+
15
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../../../../esm/components/breadcrumbs/crumb/index.js",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -0,0 +1,4 @@
1
+ export { default as Breadcrumbs } from "./breadcrumbs.component";
2
+ export { Crumb } from "./crumb";
3
+ export type { BreadcrumbsProps } from "./breadcrumbs.component";
4
+ export type { CrumbProps } from "./crumb";
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "Breadcrumbs", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _breadcrumbs.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "Crumb", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _crumb.Crumb;
16
+ }
17
+ });
18
+
19
+ var _breadcrumbs = _interopRequireDefault(require("./breadcrumbs.component"));
20
+
21
+ var _crumb = require("./crumb");
22
+
23
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -0,0 +1,6 @@
1
+ {
2
+ "sideEffects": false,
3
+ "module": "../../../esm/components/breadcrumbs/index.js",
4
+ "main": "./index.js",
5
+ "types": "./index.d.ts"
6
+ }
@@ -2,6 +2,8 @@ import React from "react";
2
2
  import { SpaceProps } from "styled-system";
3
3
  import { StyledDtDivProps, StyledDdDivProps, StyledDlProps } from "./definition-list.style";
4
4
  export interface DlProps extends SpaceProps, StyledDlProps, StyledDtDivProps, StyledDdDivProps {
5
+ /** HTML id attribute of the input */
6
+ id?: string;
5
7
  /** prop to render children. */
6
8
  children: React.ReactNode;
7
9
  }
@@ -94,6 +94,7 @@ Dl.propTypes = {
94
94
  "children": _propTypes.default.node,
95
95
  "ddTextAlign": _propTypes.default.oneOf(["center", "left", "right"]),
96
96
  "dtTextAlign": _propTypes.default.oneOf(["center", "left", "right"]),
97
+ "id": _propTypes.default.string,
97
98
  "m": _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.oneOf([null]), _propTypes.default.number, _propTypes.default.shape({
98
99
  "__@toStringTag": _propTypes.default.string.isRequired,
99
100
  "description": _propTypes.default.string,
@@ -35,9 +35,17 @@ I18nProvider.propTypes = {
35
35
  "delete": _propTypes.default.func.isRequired,
36
36
  "edit": _propTypes.default.func.isRequired
37
37
  }),
38
+ "advancedColorPicker": _propTypes.default.shape({
39
+ "ariaLabel": _propTypes.default.func.isRequired,
40
+ "currentColorAssigned": _propTypes.default.func.isRequired,
41
+ "currentColorDescriptionTerm": _propTypes.default.func.isRequired
42
+ }),
38
43
  "batchSelection": _propTypes.default.shape({
39
44
  "selected": _propTypes.default.func.isRequired
40
45
  }),
46
+ "breadcrumbs": _propTypes.default.shape({
47
+ "ariaLabel": _propTypes.default.func.isRequired
48
+ }),
41
49
  "characterCount": _propTypes.default.shape({
42
50
  "charactersLeft": _propTypes.default.func.isRequired,
43
51
  "hintString": _propTypes.default.func.isRequired,
@@ -27,6 +27,8 @@ var _i18nContext = _interopRequireDefault(require("../../__internal__/i18n-conte
27
27
 
28
28
  var _showEditPod = _interopRequireDefault(require("./show-edit-pod.style"));
29
29
 
30
+ var _logger = _interopRequireDefault(require("../../__internal__/utils/logger"));
31
+
30
32
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
33
 
32
34
  function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function () { return cache; }; return cache; }
@@ -34,6 +36,7 @@ function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return
34
36
  function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
37
 
36
38
  const marginPropTypes = (0, _utils.filterStyledSystemMarginProps)(_propTypes2.default.space);
39
+ let deprecateWarnTriggered = false;
37
40
 
38
41
  const ShowEditPod = ({
39
42
  border = false,
@@ -59,6 +62,12 @@ const ShowEditPod = ({
59
62
  variant = "transparent",
60
63
  ...rest
61
64
  }) => {
65
+ if (!deprecateWarnTriggered) {
66
+ deprecateWarnTriggered = true;
67
+
68
+ _logger.default.deprecate("The ShowEditPod component is deprecated and will soon be removed. Please use alternatives such as the Fieldset, Form or Pod components instead.");
69
+ }
70
+
62
71
  const locale = (0, _react.useContext)(_i18nContext.default);
63
72
  const ref = (0, _react.useRef)();
64
73
  const editModeNodeRef = (0, _react.useRef)();
@@ -18,9 +18,17 @@ const enGB = {
18
18
  actionPopover: {
19
19
  ariaLabel: () => "actions"
20
20
  },
21
+ advancedColorPicker: {
22
+ ariaLabel: () => "Change colour",
23
+ currentColorDescriptionTerm: () => "Current color assigned: ",
24
+ currentColorAssigned: currentColor => currentColor
25
+ },
21
26
  batchSelection: {
22
27
  selected: count => `${count} selected`
23
28
  },
29
+ breadcrumbs: {
30
+ ariaLabel: () => "breadcrumbs"
31
+ },
24
32
  confirm: {
25
33
  no: () => "No",
26
34
  yes: () => "Yes"
@@ -8,9 +8,17 @@ interface Locale {
8
8
  actionPopover: {
9
9
  ariaLabel: () => string;
10
10
  };
11
+ advancedColorPicker: {
12
+ ariaLabel: () => string;
13
+ currentColorDescriptionTerm: (currentColor: string) => string;
14
+ currentColorAssigned: (currentColor: string) => string;
15
+ };
11
16
  batchSelection: {
12
17
  selected: (count: number | string) => string;
13
18
  };
19
+ breadcrumbs: {
20
+ ariaLabel: () => string;
21
+ };
14
22
  characterCount: {
15
23
  hintString: () => string;
16
24
  tooManyCharacters: (count: number, formattedCount: string) => string;
@@ -22,6 +22,47 @@ const PolishPlural = (singularNominativ, pluralNominativ, pluralGenitive, value)
22
22
  };
23
23
 
24
24
  exports.PolishPlurals = exports.PolishPlural = PolishPlural;
25
+
26
+ const translateColor = color => {
27
+ switch (color.toLowerCase()) {
28
+ case "white":
29
+ return "biały";
30
+
31
+ case "transparent":
32
+ return "przezroczysty";
33
+
34
+ case "black":
35
+ return "czarny";
36
+
37
+ case "blue":
38
+ return "niebieski";
39
+
40
+ case "pink":
41
+ return "różowy";
42
+
43
+ case "purple":
44
+ return "fioletowy";
45
+
46
+ case "goldenrod":
47
+ return "złoty";
48
+
49
+ case "orchid":
50
+ return "ciemny róż";
51
+
52
+ case "desert":
53
+ return "pustynny";
54
+
55
+ case "turquoise":
56
+ return "turkusowy";
57
+
58
+ case "mint":
59
+ return "miętowy";
60
+
61
+ default:
62
+ return color;
63
+ }
64
+ };
65
+
25
66
  const plPL = {
26
67
  locale: () => "pl-PL",
27
68
  actions: {
@@ -31,9 +72,17 @@ const plPL = {
31
72
  actionPopover: {
32
73
  ariaLabel: () => "akcje"
33
74
  },
75
+ advancedColorPicker: {
76
+ ariaLabel: () => "Zmień kolor",
77
+ currentColorDescriptionTerm: currentColor => translateColor(currentColor) === "biały" ? "Aktualny przypisany kolor: " : "Aktualnie przypisany kolor: ",
78
+ currentColorAssigned: currentColor => translateColor(currentColor)
79
+ },
34
80
  batchSelection: {
35
81
  selected: count => `${count} wybrano`
36
82
  },
83
+ breadcrumbs: {
84
+ ariaLabel: () => "okruszki"
85
+ },
37
86
  confirm: {
38
87
  no: () => "Nie",
39
88
  yes: () => "Tak"
@@ -0,0 +1,2 @@
1
+ declare const _default: import("styled-components").FlattenSimpleInterpolation;
2
+ export default _default;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _styledComponents = require("styled-components");
9
+
10
+ var _default = (0, _styledComponents.css)`
11
+ border: 0;
12
+ height: 1px;
13
+ margin: -1px;
14
+ overflow: hidden;
15
+ padding: 0;
16
+ position: absolute;
17
+ width: 1px;
18
+ `;
19
+
20
+ exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "carbon-react",
3
- "version": "117.1.2",
3
+ "version": "117.2.1",
4
4
  "description": "A library of reusable React components for easily building user interfaces.",
5
5
  "files": [
6
6
  "lib",