@abgov/react-components 4.0.0-alpha.4 → 4.0.0-alpha.5

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.
@@ -14,10 +14,11 @@ declare global {
14
14
  }
15
15
  }
16
16
  export interface Props {
17
- onDeleteIconClick?: () => void;
17
+ onClick?: () => void;
18
+ deletable?: boolean;
18
19
  leadingIcon?: string;
19
20
  error?: boolean;
20
21
  content: string;
21
22
  }
22
- export declare const GoAChip: ({ leadingIcon, error, content, onDeleteIconClick }: Props) => JSX.Element;
23
+ export declare const GoAChip: ({ leadingIcon, deletable, error, content, onClick }: Props) => JSX.Element;
23
24
  export default GoAChip;
@@ -6,6 +6,7 @@ interface WCProps {
6
6
  width?: string;
7
7
  closable?: boolean;
8
8
  scrollable?: boolean;
9
+ transition?: "fast" | "slow" | "none";
9
10
  }
10
11
  declare global {
11
12
  namespace JSX {
@@ -19,6 +20,7 @@ interface Props {
19
20
  width?: string;
20
21
  actions?: React.ReactElement;
21
22
  onClose?: () => void;
23
+ transition?: "fast" | "slow" | "none";
22
24
  open?: boolean;
23
25
  }
24
26
  export declare const GoAModal: FC<Props>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/react-components",
3
- "version": "4.0.0-alpha.4",
3
+ "version": "4.0.0-alpha.5",
4
4
  "description": "Government of Alberta - UI components for React",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -266,30 +266,31 @@ const GoACheckbox = ({
266
266
 
267
267
  const GoAChip = ({
268
268
  leadingIcon: _leadingIcon = "",
269
+ deletable: _deletable = false,
269
270
  error: _error = false,
270
271
  content,
271
- onDeleteIconClick
272
+ onClick
272
273
  }) => {
273
274
  const el = useRef(null);
274
275
  useEffect(() => {
275
276
  if (!el.current) return;
276
- if (!onDeleteIconClick) return;
277
+ if (!onClick) return;
277
278
  const current = el.current;
278
279
 
279
280
  const listener = e => {
280
- onDeleteIconClick();
281
+ onClick();
281
282
  };
282
283
 
283
- current.addEventListener('_onDeleteIconClick', listener);
284
+ current.addEventListener('_click', listener);
284
285
  return () => {
285
- current.removeEventListener('_onDeleteIconClick', listener);
286
+ current.removeEventListener('_click', listener);
286
287
  };
287
- }, [el, onDeleteIconClick]);
288
+ }, [el, onClick]);
288
289
  return jsx("goa-chip", {
289
290
  ref: el,
290
291
  leadingicon: _leadingIcon,
291
292
  error: _error,
292
- deletable: !!onDeleteIconClick,
293
+ deletable: _deletable,
293
294
  content: content
294
295
  }, void 0);
295
296
  };
@@ -674,6 +675,7 @@ const GoAModal = ({
674
675
  open,
675
676
  width,
676
677
  actions,
678
+ transition,
677
679
  onClose
678
680
  }) => {
679
681
  const el = useRef(null);
@@ -699,7 +701,8 @@ const GoAModal = ({
699
701
  open: open,
700
702
  closable: !!onClose,
701
703
  scrollable: true,
702
- width: width
704
+ width: width,
705
+ transition: transition
703
706
  }, {
704
707
  children: [actions && jsx("div", Object.assign({
705
708
  slot: "actions"
@@ -299,30 +299,32 @@
299
299
  var GoAChip = function GoAChip(_a) {
300
300
  var _b = _a.leadingIcon,
301
301
  leadingIcon = _b === void 0 ? "" : _b,
302
- _c = _a.error,
303
- error = _c === void 0 ? false : _c,
302
+ _c = _a.deletable,
303
+ deletable = _c === void 0 ? false : _c,
304
+ _d = _a.error,
305
+ error = _d === void 0 ? false : _d,
304
306
  content = _a.content,
305
- onDeleteIconClick = _a.onDeleteIconClick;
307
+ onClick = _a.onClick;
306
308
  var el = react.useRef(null);
307
309
  react.useEffect(function () {
308
310
  if (!el.current) return;
309
- if (!onDeleteIconClick) return;
311
+ if (!onClick) return;
310
312
  var current = el.current;
311
313
 
312
314
  var listener = function listener(e) {
313
- onDeleteIconClick();
315
+ onClick();
314
316
  };
315
317
 
316
- current.addEventListener('_onDeleteIconClick', listener);
318
+ current.addEventListener('_click', listener);
317
319
  return function () {
318
- current.removeEventListener('_onDeleteIconClick', listener);
320
+ current.removeEventListener('_click', listener);
319
321
  };
320
- }, [el, onDeleteIconClick]);
322
+ }, [el, onClick]);
321
323
  return jsxRuntime.jsx("goa-chip", {
322
324
  ref: el,
323
325
  leadingicon: leadingIcon,
324
326
  error: error,
325
- deletable: !!onDeleteIconClick,
327
+ deletable: deletable,
326
328
  content: content
327
329
  }, void 0);
328
330
  };
@@ -677,6 +679,7 @@
677
679
  open = _a.open,
678
680
  width = _a.width,
679
681
  actions = _a.actions,
682
+ transition = _a.transition,
680
683
  onClose = _a.onClose;
681
684
  var el = react.useRef(null);
682
685
  react.useEffect(function () {
@@ -701,7 +704,8 @@
701
704
  open: open,
702
705
  closable: !!onClose,
703
706
  scrollable: true,
704
- width: width
707
+ width: width,
708
+ transition: transition
705
709
  }, {
706
710
  children: [actions && jsxRuntime.jsx("div", __assign({
707
711
  slot: "actions"