baseui 18.1.0 → 18.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baseui",
3
- "version": "18.1.0",
3
+ "version": "18.2.0",
4
4
  "description": "A React Component library implementing the Base design language",
5
5
  "keywords": [
6
6
  "react",
@@ -351,7 +351,8 @@ const Root = exports.Root = (0, _styles.styled)('span', props => {
351
351
  $closeable,
352
352
  $isFocusVisible,
353
353
  $color,
354
- $size = _constants.SIZE.small
354
+ $size = _constants.SIZE.small,
355
+ $noMargin
355
356
  } = props;
356
357
  const borderRadius = $size === _constants.SIZE.small || $size === _constants.SIZE.xSmall ? $theme.borders.radius200 : $theme.borders.radius300;
357
358
  const paddingMagnitude = {
@@ -418,10 +419,10 @@ const Root = exports.Root = (0, _styles.styled)('span', props => {
418
419
  [_constants.SIZE.large]: '40px'
419
420
  }[$size],
420
421
  justifyContent: 'space-between',
421
- marginTop: '5px',
422
- marginBottom: '5px',
423
- marginLeft: '5px',
424
- marginRight: '5px',
422
+ marginTop: $noMargin ? 0 : '5px',
423
+ marginBottom: $noMargin ? 0 : '5px',
424
+ marginLeft: $noMargin ? 0 : '5px',
425
+ marginRight: $noMargin ? 0 : '5px',
425
426
  paddingTop: paddingLongitude,
426
427
  paddingBottom: paddingLongitude,
427
428
  paddingLeft: paddingMagnitude,
package/tag/tag.js CHANGED
@@ -36,6 +36,7 @@ const Tag = /*#__PURE__*/React.forwardRef((props, ref) => {
36
36
  isFocused = false,
37
37
  isHovered = false,
38
38
  kind = _constants.KIND.gray,
39
+ noMargin = false,
39
40
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
40
41
  onActionClick = event => {},
41
42
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -104,7 +105,8 @@ const Tag = /*#__PURE__*/React.forwardRef((props, ref) => {
104
105
  $kind: kind,
105
106
  $hierarchy: hierarchy,
106
107
  $isFocusVisible: focusVisible,
107
- $size: size
108
+ $size: size,
109
+ $noMargin: noMargin
108
110
  };
109
111
  const titleText = title || (0, _utils.getTextFromChildren)(children);
110
112
  const isButton = (clickable || closeable) && !disabled;
package/tag/types.d.ts CHANGED
@@ -75,6 +75,8 @@ export type TagProps = {
75
75
  size?: number | string;
76
76
  }>;
77
77
  contentMaxWidth?: string | null;
78
+ /** Removes the Tag's default margin. Useful when composing tags in a custom layout. */
79
+ noMargin?: boolean;
78
80
  };
79
81
  export type SharedPropsArg = {
80
82
  $clickable?: boolean;
@@ -89,4 +91,5 @@ export type SharedPropsArg = {
89
91
  $isFocusVisible?: boolean;
90
92
  $size?: string;
91
93
  $contentMaxWidth?: string | null;
94
+ $noMargin?: boolean;
92
95
  };
@@ -42,11 +42,11 @@ const TagGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
42
42
  onClick: undefined,
43
43
  onKeyDown: undefined,
44
44
  closeable: false,
45
+ // Single Tag has default margin, reset it to 0 in TagGroup
46
+ noMargin: true,
45
47
  overrides: {
46
48
  Root: {
47
49
  style: {
48
- // Single Tag has default margin, reset it to 0 in TagGroup
49
- margin: 0,
50
50
  ...(wrap ? {
51
51
  maxWidth: '100%'
52
52
  } : {}),