@spaced-out/ui-design-system 0.1.40 → 0.1.42

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/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.42](https://github.com/spaced-out/ui-design-system/compare/v0.1.41...v0.1.42) (2023-08-04)
6
+
7
+
8
+ ### Features
9
+
10
+ * panel background interactivity and background for panel body ([#131](https://github.com/spaced-out/ui-design-system/issues/131)) ([223e692](https://github.com/spaced-out/ui-design-system/commit/223e6928d977cb326ac973fe9103415eeb86300a))
11
+
12
+ ### [0.1.41](https://github.com/spaced-out/ui-design-system/compare/v0.1.40...v0.1.41) (2023-08-02)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * card padding fixes ([6cd15dc](https://github.com/spaced-out/ui-design-system/commit/6cd15dc489d790c450d1e146d17a0ecd4ce69411))
18
+
5
19
  ### [0.1.40](https://github.com/spaced-out/ui-design-system/compare/v0.1.39...v0.1.40) (2023-08-02)
6
20
 
7
21
 
@@ -36,7 +36,8 @@
36
36
  min-height: size58;
37
37
  composes: subTitleSmall from '../../styles/typography.module.css';
38
38
  composes: borderBottomPrimary from '../../styles/border.module.css';
39
- padding: spaceSmall spaceXSmall spaceSmall spaceSmall;
39
+ padding: spaceSmall var(--card-padding-right) spaceSmall
40
+ var(--card-padding-left);
40
41
  gap: spaceXSmall;
41
42
  }
42
43
 
@@ -48,7 +49,8 @@
48
49
  min-height: size58;
49
50
  composes: subTitleSmall from '../../styles/typography.module.css';
50
51
  composes: borderTopPrimary from '../../styles/border.module.css';
51
- padding: spaceSmall spaceXSmall spaceSmall spaceSmall;
52
+ padding: spaceSmall var(--card-padding-right) spaceSmall
53
+ var(--card-padding-left);
52
54
  gap: spaceXSmall;
53
55
  margin-top: auto;
54
56
  }
@@ -3,16 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- Object.defineProperty(exports, "Card", {
7
- enumerable: true,
8
- get: function () {
9
- return _Card.Card;
10
- }
11
- });
12
- Object.defineProperty(exports, "ClickableCard", {
13
- enumerable: true,
14
- get: function () {
15
- return _Card.ClickableCard;
16
- }
17
- });
18
- var _Card = require("./Card");
6
+ var _Card = require("./Card");
7
+ Object.keys(_Card).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _Card[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _Card[key];
14
+ }
15
+ });
16
+ });
@@ -1,4 +1,3 @@
1
1
  // @flow strict
2
2
 
3
- export type {CardProps} from './Card';
4
- export {Card, ClickableCard} from './Card';
3
+ export * from './Card';
@@ -121,6 +121,7 @@ const Modal = _ref4 => {
121
121
  tapOutsideToClose = true,
122
122
  initialFocus = -1,
123
123
  customAnimation,
124
+ allowBackgroundInteraction = false,
124
125
  // Size is not set to default for backward compatibility. Don't change if you don't know this.
125
126
  size
126
127
  } = _ref4;
@@ -209,7 +210,7 @@ const Modal = _ref4 => {
209
210
  [_ModalModule.default.in]: isTransitioning,
210
211
  [_ModalModule.default.open]: isOpen
211
212
  }, classNames?.container)
212
- }, /*#__PURE__*/React.createElement("div", {
213
+ }, !allowBackgroundInteraction && /*#__PURE__*/React.createElement("div", {
213
214
  className: (0, _classify.default)(_ModalModule.default.backdrop, {
214
215
  [_ModalModule.default.darkBackdrop]: !hideBackdrop
215
216
  }, classNames?.backdrop),
@@ -52,6 +52,7 @@ export type ModalProps = {
52
52
  onClose?: ?(SyntheticEvent<HTMLElement>) => mixed,
53
53
  hideBackdrop?: boolean,
54
54
  tapOutsideToClose?: boolean,
55
+ allowBackgroundInteraction?: boolean,
55
56
  initialFocus?: number,
56
57
  customAnimation?: UseTransitionStylesProps,
57
58
  };
@@ -194,6 +195,7 @@ export const Modal = ({
194
195
  tapOutsideToClose = true,
195
196
  initialFocus = -1,
196
197
  customAnimation,
198
+ allowBackgroundInteraction = false,
197
199
  // Size is not set to default for backward compatibility. Don't change if you don't know this.
198
200
  size,
199
201
  }: BaseModalProps): React.Node => {
@@ -296,16 +298,19 @@ export const Modal = ({
296
298
  classNames?.container,
297
299
  )}
298
300
  >
299
- <div
300
- className={classify(
301
- css.backdrop,
302
- {
303
- [css.darkBackdrop]: !hideBackdrop,
304
- },
305
- classNames?.backdrop,
306
- )}
307
- onClick={onBackdropClick}
308
- />
301
+ {!allowBackgroundInteraction && (
302
+ <div
303
+ className={classify(
304
+ css.backdrop,
305
+ {
306
+ [css.darkBackdrop]: !hideBackdrop,
307
+ },
308
+ classNames?.backdrop,
309
+ )}
310
+ onClick={onBackdropClick}
311
+ />
312
+ )}
313
+
309
314
  {isMounted && (
310
315
  <div
311
316
  className={classify(
@@ -86,6 +86,8 @@ const Panel = _ref4 => {
86
86
  hideBackdrop = true,
87
87
  classNames,
88
88
  customAnimation,
89
+ tapOutsideToClose = true,
90
+ allowBackgroundInteraction,
89
91
  ...restPanelProps
90
92
  } = _ref4;
91
93
  const isTransitioning = (0, _useMountTransition.default)(isOpen, parseInt(_motion.motionDurationNormal));
@@ -93,7 +95,9 @@ const Panel = _ref4 => {
93
95
  return /*#__PURE__*/React.createElement(_Modal.Modal, _extends({
94
96
  isOpen: isOpen,
95
97
  onClose: onClose,
96
- hideBackdrop: hideBackdrop
98
+ hideBackdrop: hideBackdrop,
99
+ tapOutsideToClose: allowBackgroundInteraction ? false : tapOutsideToClose,
100
+ allowBackgroundInteraction: allowBackgroundInteraction
97
101
  }, restPanelProps, {
98
102
  classNames: {
99
103
  container: (0, _classify.default)(_PanelModule.default.panelContainer, {
@@ -49,6 +49,7 @@ export type PanelBodyProps = {
49
49
 
50
50
  export type PanelProps = {
51
51
  ...ModalProps,
52
+ allowBackgroundInteraction?: boolean,
52
53
  size?: PanelSize,
53
54
  anchor?: PanelAnchor,
54
55
  };
@@ -128,6 +129,8 @@ export const Panel = ({
128
129
  hideBackdrop = true,
129
130
  classNames,
130
131
  customAnimation,
132
+ tapOutsideToClose = true,
133
+ allowBackgroundInteraction,
131
134
  ...restPanelProps
132
135
  }: PanelProps): React.Node => {
133
136
  const isTransitioning = useMountTransition(
@@ -142,6 +145,8 @@ export const Panel = ({
142
145
  isOpen={isOpen}
143
146
  onClose={onClose}
144
147
  hideBackdrop={hideBackdrop}
148
+ tapOutsideToClose={allowBackgroundInteraction ? false : tapOutsideToClose}
149
+ allowBackgroundInteraction={allowBackgroundInteraction}
145
150
  {...restPanelProps}
146
151
  classNames={{
147
152
  container: classify(
@@ -1,7 +1,7 @@
1
1
  @value (spaceNegFluid, spaceNone, spaceMedium, spaceSmall, spaceFluid) from '../../styles/variables/_space.css';
2
2
  @value (size4, size60, size480, size580, size720, sizeFluid) from '../../styles/variables/_size.css';
3
3
  @value (motionDurationNormal, motionEaseInEaseOut) from '../../styles/variables/_motion.css';
4
- @value (colorBackgroundTertiary, colorBackgroundPrimary) from '../../styles/variables/_color.css';
4
+ @value (colorBackgroundTertiary, colorBackgroundPrimary, colorBackgroundSecondary) from '../../styles/variables/_color.css';
5
5
  @value (borderRadiusNone) from '../../styles/variables/_border.css';
6
6
 
7
7
  .panel {
@@ -51,6 +51,7 @@
51
51
  justify-content: space-between;
52
52
  align-items: center;
53
53
  gap: spaceMedium;
54
+ background-color: colorBackgroundTertiary;
54
55
  }
55
56
 
56
57
  .headerContent {
@@ -61,11 +62,12 @@
61
62
  padding: spaceMedium;
62
63
  height: sizeFluid;
63
64
  overflow: auto;
65
+ background-color: colorBackgroundSecondary;
64
66
  }
65
67
 
66
68
  .panelFooter {
67
69
  composes: borderTopPrimary from '../../styles/border.module.css';
68
- background-color: colorBackgroundPrimary;
70
+ background-color: colorBackgroundTertiary;
69
71
  margin-top: auto;
70
72
  padding: spaceMedium;
71
73
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spaced-out/ui-design-system",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "main": "index.js",
5
5
  "description": "Sense UI components library",
6
6
  "author": {