@dreamcommerce/aurora 3.0.0-112 → 3.0.0-113

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.
@@ -9,23 +9,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
9
9
 
10
10
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
11
 
12
+ var _excluded = ["children"];
12
13
  var BreadcrumbChild = function BreadcrumbChild(_ref) {
13
14
  var children = _ref.children,
14
- attributes = _ref.attributes;
15
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
15
16
  var breadcrumbRef = React__default['default'].useRef(null);
16
- React__default['default'].useEffect(function () {
17
- if (!breadcrumbRef.current || !attributes) return;
18
- Object.entries(attributes).forEach(function (_ref2) {
19
- var _breadcrumbRef$curren;
20
- var _ref3 = _rollupPluginBabelHelpers.slicedToArray(_ref2, 2),
21
- key = _ref3[0],
22
- value = _ref3[1];
23
- (_breadcrumbRef$curren = breadcrumbRef.current) === null || _breadcrumbRef$curren === void 0 ? void 0 : _breadcrumbRef$curren.setAttribute(key, value);
24
- });
25
- }, []);
26
- return /*#__PURE__*/React__default['default'].createElement("li", {
17
+ return /*#__PURE__*/React__default['default'].createElement("li", _rollupPluginBabelHelpers.objectSpread2({
27
18
  ref: breadcrumbRef
28
- }, children);
19
+ }, rest), children);
29
20
  };
30
21
 
31
22
  exports.BreadcrumbChild = BreadcrumbChild;
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -13,50 +13,39 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
13
13
 
14
14
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
15
 
16
+ var _excluded = ["classname", "as", "children", "separator", "withoutSeparator"];
16
17
  var Breadcrumbs = function Breadcrumbs(_ref) {
17
18
  var classname = _ref.classname,
18
19
  _ref$as = _ref.as,
19
20
  as = _ref$as === void 0 ? 'nav' : _ref$as,
20
21
  children = _ref.children,
21
- attributes = _ref.attributes,
22
+ separator = _ref.separator,
22
23
  _ref$withoutSeparator = _ref.withoutSeparator,
23
- withoutSeparator = _ref$withoutSeparator === void 0 ? false : _ref$withoutSeparator;
24
+ withoutSeparator = _ref$withoutSeparator === void 0 ? false : _ref$withoutSeparator,
25
+ rest = _rollupPluginBabelHelpers.objectWithoutProperties(_ref, _excluded);
24
26
  var breadcrumbRef = React.useRef(null);
25
27
  var allItems = React__default['default'].Children.toArray(children).map(function (child, index) {
26
28
  return /*#__PURE__*/React__default['default'].createElement(breadcrumb_child.BreadcrumbChild, {
27
- attributes: {
28
- 'data-test-breadcrumb-index': index
29
- },
29
+ "data-test-breadcrumb-index": index,
30
30
  key: "child-".concat(index)
31
31
  }, child);
32
32
  });
33
- React.useEffect(function () {
34
- if (!breadcrumbRef.current || !attributes) return;
35
- Object.entries(attributes).forEach(function (_ref2) {
36
- var _breadcrumbRef$curren;
37
- var _ref3 = _rollupPluginBabelHelpers.slicedToArray(_ref2, 2),
38
- key = _ref3[0],
39
- value = _ref3[1];
40
- (_breadcrumbRef$curren = breadcrumbRef.current) === null || _breadcrumbRef$curren === void 0 ? void 0 : _breadcrumbRef$curren.setAttribute(key, value);
41
- });
42
- }, []);
43
33
  return /*#__PURE__*/React__default['default'].createElement(as, {
44
34
  className: classname
45
- }, /*#__PURE__*/React__default['default'].createElement(stack.Stack, {
35
+ }, /*#__PURE__*/React__default['default'].createElement(stack.Stack, _rollupPluginBabelHelpers.objectSpread2({
46
36
  ref: breadcrumbRef,
47
- attributes: {
48
- 'aria-label': 'breadcrumbs'
49
- },
37
+ "aria-label": "breadcrumbs",
50
38
  align: "center",
51
39
  as: "ol",
52
40
  spacing: "1"
53
- }, withoutSeparator ? allItems : allItems.map(function (item, index) {
41
+ }, rest), withoutSeparator ? allItems : allItems.map(function (item, index) {
54
42
  if (index === allItems.length - 1) return item;
55
43
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, {
56
44
  key: index
57
45
  }, item, /*#__PURE__*/React__default['default'].createElement("li", {
58
- "aria-hidden": "true"
59
- }, /*#__PURE__*/React__default['default'].createElement(arrow_right_s_line_icon.ArrowRightSLineIcon, {
46
+ "aria-hidden": "true",
47
+ className: "-aurora-mx-0.5"
48
+ }, separator ? separator : /*#__PURE__*/React__default['default'].createElement(arrow_right_s_line_icon.ArrowRightSLineIcon, {
60
49
  size: 16,
61
50
  color: css_icon_color_tokens.CSS_ICON_COLOR_TOKENS_VALUES.subtle
62
51
  })));
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { TBreadcrumbChildProps } from './breadcrumbs_types';
3
- export declare const BreadcrumbChild: ({ children, attributes }: TBreadcrumbChildProps) => React.JSX.Element;
3
+ export declare const BreadcrumbChild: ({ children, ...rest }: TBreadcrumbChildProps) => React.JSX.Element;
@@ -1,23 +1,14 @@
1
1
  import React from 'react';
2
- import { slicedToArray as _slicedToArray } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
2
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
3
 
4
+ var _excluded = ["children"];
4
5
  var BreadcrumbChild = function BreadcrumbChild(_ref) {
5
6
  var children = _ref.children,
6
- attributes = _ref.attributes;
7
+ rest = _objectWithoutProperties(_ref, _excluded);
7
8
  var breadcrumbRef = React.useRef(null);
8
- React.useEffect(function () {
9
- if (!breadcrumbRef.current || !attributes) return;
10
- Object.entries(attributes).forEach(function (_ref2) {
11
- var _breadcrumbRef$curren;
12
- var _ref3 = _slicedToArray(_ref2, 2),
13
- key = _ref3[0],
14
- value = _ref3[1];
15
- (_breadcrumbRef$curren = breadcrumbRef.current) === null || _breadcrumbRef$curren === void 0 ? void 0 : _breadcrumbRef$curren.setAttribute(key, value);
16
- });
17
- }, []);
18
- return /*#__PURE__*/React.createElement("li", {
9
+ return /*#__PURE__*/React.createElement("li", _objectSpread2({
19
10
  ref: breadcrumbRef
20
- }, children);
11
+ }, rest), children);
21
12
  };
22
13
 
23
14
  export { BreadcrumbChild };
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TBreadcrumbsProps } from './breadcrumbs_types';
3
- export declare const Breadcrumbs: ({ classname, as, children, attributes, withoutSeparator }: TBreadcrumbsProps) => React.ReactElement<{
3
+ export declare const Breadcrumbs: ({ classname, as, children, separator, withoutSeparator, ...rest }: TBreadcrumbsProps) => React.ReactElement<{
4
4
  className: string | undefined;
5
5
  }, string | React.JSXElementConstructor<any>>;
6
6
  export default Breadcrumbs;
@@ -1,54 +1,43 @@
1
- import React, { useRef, useEffect } from 'react';
2
- import { slicedToArray as _slicedToArray } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import React, { useRef } from 'react';
2
+ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../../../../_virtual/_rollupPluginBabelHelpers.js';
3
3
  import { CSS_ICON_COLOR_TOKENS_VALUES } from '../../constants/css_tokens/css_icon_color_tokens.js';
4
4
  import { Stack } from '../stack/stack.js';
5
5
  import { BreadcrumbChild } from './breadcrumb_child.js';
6
6
  import { ArrowRightSLineIcon } from '../../assets/icons/arrow_right_s_line_icon.js';
7
7
 
8
+ var _excluded = ["classname", "as", "children", "separator", "withoutSeparator"];
8
9
  var Breadcrumbs = function Breadcrumbs(_ref) {
9
10
  var classname = _ref.classname,
10
11
  _ref$as = _ref.as,
11
12
  as = _ref$as === void 0 ? 'nav' : _ref$as,
12
13
  children = _ref.children,
13
- attributes = _ref.attributes,
14
+ separator = _ref.separator,
14
15
  _ref$withoutSeparator = _ref.withoutSeparator,
15
- withoutSeparator = _ref$withoutSeparator === void 0 ? false : _ref$withoutSeparator;
16
+ withoutSeparator = _ref$withoutSeparator === void 0 ? false : _ref$withoutSeparator,
17
+ rest = _objectWithoutProperties(_ref, _excluded);
16
18
  var breadcrumbRef = useRef(null);
17
19
  var allItems = React.Children.toArray(children).map(function (child, index) {
18
20
  return /*#__PURE__*/React.createElement(BreadcrumbChild, {
19
- attributes: {
20
- 'data-test-breadcrumb-index': index
21
- },
21
+ "data-test-breadcrumb-index": index,
22
22
  key: "child-".concat(index)
23
23
  }, child);
24
24
  });
25
- useEffect(function () {
26
- if (!breadcrumbRef.current || !attributes) return;
27
- Object.entries(attributes).forEach(function (_ref2) {
28
- var _breadcrumbRef$curren;
29
- var _ref3 = _slicedToArray(_ref2, 2),
30
- key = _ref3[0],
31
- value = _ref3[1];
32
- (_breadcrumbRef$curren = breadcrumbRef.current) === null || _breadcrumbRef$curren === void 0 ? void 0 : _breadcrumbRef$curren.setAttribute(key, value);
33
- });
34
- }, []);
35
25
  return /*#__PURE__*/React.createElement(as, {
36
26
  className: classname
37
- }, /*#__PURE__*/React.createElement(Stack, {
27
+ }, /*#__PURE__*/React.createElement(Stack, _objectSpread2({
38
28
  ref: breadcrumbRef,
39
- attributes: {
40
- 'aria-label': 'breadcrumbs'
41
- },
29
+ "aria-label": "breadcrumbs",
42
30
  align: "center",
43
31
  as: "ol",
44
32
  spacing: "1"
45
- }, withoutSeparator ? allItems : allItems.map(function (item, index) {
33
+ }, rest), withoutSeparator ? allItems : allItems.map(function (item, index) {
46
34
  if (index === allItems.length - 1) return item;
47
35
  return /*#__PURE__*/React.createElement(React.Fragment, {
48
36
  key: index
49
37
  }, item, /*#__PURE__*/React.createElement("li", {
50
- "aria-hidden": "true"
51
- }, /*#__PURE__*/React.createElement(ArrowRightSLineIcon, {
38
+ "aria-hidden": "true",
39
+ className: "-aurora-mx-0.5"
40
+ }, separator ? separator : /*#__PURE__*/React.createElement(ArrowRightSLineIcon, {
52
41
  size: 16,
53
42
  color: CSS_ICON_COLOR_TOKENS_VALUES.subtle
54
43
  })));
@@ -1 +1 @@
1
- {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
1
+ {"version":3,"file":null,"sources":[null],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;"}
@@ -4,7 +4,6 @@ export declare type TBreadcrumbsProps = React.PropsWithChildren<{
4
4
  classname?: string;
5
5
  as?: string;
6
6
  attributes?: Record<string, any>;
7
- }>;
8
- export declare type TBreadcrumbChildProps = React.PropsWithChildren<{
9
- attributes?: Record<string, any>;
10
- }>;
7
+ separator?: React.ReactNode;
8
+ } & React.HTMLAttributes<HTMLElement>>;
9
+ export declare type TBreadcrumbChildProps = React.PropsWithChildren<React.HTMLAttributes<HTMLElement>>;