@pingux/astro 1.15.0-alpha.2 → 1.15.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.
@@ -133,9 +133,9 @@ var Button = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
133
133
  alignItems: 'center'
134
134
  },
135
135
  variant: variant
136
- }, others, (0, _utils.mergeProps)(hoverProps, focusProps, _objectSpread(_objectSpread({}, buttonProps), {}, {
136
+ }, others, (0, _utils.mergeProps)(_objectSpread(_objectSpread({}, buttonProps), {}, {
137
137
  tabIndex: tabIndex
138
- }))), isLoading ? (0, _react2.jsx)("span", {
138
+ }), hoverProps, focusProps)), isLoading ? (0, _react2.jsx)("span", {
139
139
  style: {
140
140
  visibility: 'hidden'
141
141
  }
@@ -127,7 +127,7 @@ var IconButton = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
127
127
  fill: chipBg
128
128
  }
129
129
  }
130
- }, (0, _utils.mergeProps)(hoverProps, focusProps, buttonProps, others)), children);
130
+ }, (0, _utils.mergeProps)(buttonProps, others, hoverProps, focusProps)), children);
131
131
 
132
132
  if (title) {
133
133
  return (0, _react2.jsx)(_TooltipTrigger["default"], {
@@ -18,6 +18,8 @@ var _react = _interopRequireDefault(require("react"));
18
18
 
19
19
  var _index = require("../index");
20
20
 
21
+ var _useModalState = _interopRequireDefault(require("../hooks/useModalState"));
22
+
21
23
  var _react2 = require("@emotion/react");
22
24
 
23
25
  var _default = {
@@ -615,7 +617,7 @@ var realtySVG = function realtySVG(props) {
615
617
  }))));
616
618
  };
617
619
 
618
- var Buttons = [{
620
+ var buttons = [{
619
621
  name: 'Retail',
620
622
  icon: retailSVG
621
623
  }, {
@@ -648,8 +650,13 @@ var Buttons = [{
648
650
  }];
649
651
 
650
652
  var Default = function Default() {
651
- return (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Modal, {
652
- isOpen: true,
653
+ var state = (0, _useModalState["default"])();
654
+ return (0, _react2.jsx)(_index.OverlayProvider, null, (0, _react2.jsx)(_index.Button, {
655
+ onPress: state.open,
656
+ "aria-label": "Open modal"
657
+ }, "Open Modal"), state.isOpen && (0, _react2.jsx)(_index.Modal, {
658
+ isOpen: state.isOpen,
659
+ onClose: state.close,
653
660
  hasCloseButton: true,
654
661
  contentProps: {
655
662
  maxWidth: '880px',
@@ -666,7 +673,7 @@ var Default = function Default() {
666
673
  }, "To further customize your experience, choose an industry that most resembles your own."), (0, _react2.jsx)(_index.Box, {
667
674
  isRow: true,
668
675
  sx: gridContainerStyles
669
- }, (0, _map["default"])(Buttons).call(Buttons, function (button) {
676
+ }, (0, _map["default"])(buttons).call(buttons, function (button) {
670
677
  return (0, _react2.jsx)(_index.Button, {
671
678
  sx: buttonStyle,
672
679
  key: button.name
@@ -95,9 +95,9 @@ var Button = /*#__PURE__*/forwardRef(function (props, ref) {
95
95
  alignItems: 'center'
96
96
  },
97
97
  variant: variant
98
- }, others, mergeProps(hoverProps, focusProps, _objectSpread(_objectSpread({}, buttonProps), {}, {
98
+ }, others, mergeProps(_objectSpread(_objectSpread({}, buttonProps), {}, {
99
99
  tabIndex: tabIndex
100
- }))), isLoading ? ___EmotionJSX("span", {
100
+ }), hoverProps, focusProps)), isLoading ? ___EmotionJSX("span", {
101
101
  style: {
102
102
  visibility: 'hidden'
103
103
  }
@@ -90,7 +90,7 @@ var IconButton = /*#__PURE__*/forwardRef(function (props, ref) {
90
90
  fill: chipBg
91
91
  }
92
92
  }
93
- }, mergeProps(hoverProps, focusProps, buttonProps, others)), children);
93
+ }, mergeProps(buttonProps, others, hoverProps, focusProps)), children);
94
94
 
95
95
  if (title) {
96
96
  return ___EmotionJSX(TooltipTrigger, {
@@ -2,6 +2,7 @@ import _mapInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance
2
2
  import _extends from "@babel/runtime-corejs3/helpers/esm/extends";
3
3
  import React from 'react';
4
4
  import { Box, Button, HelpHint, Icon, Modal, OverlayProvider, Text } from '../index';
5
+ import useModalState from '../hooks/useModalState';
5
6
  import { jsx as ___EmotionJSX } from "@emotion/react";
6
7
  export default {
7
8
  title: 'Recipes/TrialExperienceButtons'
@@ -597,7 +598,7 @@ var realtySVG = function realtySVG(props) {
597
598
  }))));
598
599
  };
599
600
 
600
- var Buttons = [{
601
+ var buttons = [{
601
602
  name: 'Retail',
602
603
  icon: retailSVG
603
604
  }, {
@@ -629,8 +630,13 @@ var Buttons = [{
629
630
  icon: hotelSVG
630
631
  }];
631
632
  export var Default = function Default() {
632
- return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Modal, {
633
- isOpen: true,
633
+ var state = useModalState();
634
+ return ___EmotionJSX(OverlayProvider, null, ___EmotionJSX(Button, {
635
+ onPress: state.open,
636
+ "aria-label": "Open modal"
637
+ }, "Open Modal"), state.isOpen && ___EmotionJSX(Modal, {
638
+ isOpen: state.isOpen,
639
+ onClose: state.close,
634
640
  hasCloseButton: true,
635
641
  contentProps: {
636
642
  maxWidth: '880px',
@@ -647,7 +653,7 @@ export var Default = function Default() {
647
653
  }, "To further customize your experience, choose an industry that most resembles your own."), ___EmotionJSX(Box, {
648
654
  isRow: true,
649
655
  sx: gridContainerStyles
650
- }, _mapInstanceProperty(Buttons).call(Buttons, function (button) {
656
+ }, _mapInstanceProperty(buttons).call(buttons, function (button) {
651
657
  return ___EmotionJSX(Button, {
652
658
  sx: buttonStyle,
653
659
  key: button.name
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pingux/astro",
3
- "version": "1.15.0-alpha.2",
3
+ "version": "1.15.0-alpha.5",
4
4
  "description": "PingUX themeable React component library",
5
5
  "author": "ux-development@pingidentity.com",
6
6
  "license": "Apache-2.0",