@doist/reactist 10.0.0-beta.1 → 10.0.0-beta.10
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/dist/reactist.cjs.development.js +854 -537
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/components/{button/button.js → deprecated-button/deprecated-button.js} +5 -1
- package/es/components/deprecated-button/deprecated-button.js.map +1 -0
- package/es/components/{button → deprecated-button}/index.js +1 -1
- package/es/components/{button → deprecated-button}/index.js.map +0 -0
- package/es/components/{loading/loading.js → deprecated-loading/deprecated-loading.js} +3 -1
- package/es/components/deprecated-loading/deprecated-loading.js.map +1 -0
- package/es/components/{modal/modal.js → deprecated-modal/deprecated-modal.js} +6 -1
- package/es/components/deprecated-modal/deprecated-modal.js.map +1 -0
- package/es/components/{modal → deprecated-modal}/index.js +1 -1
- package/es/components/deprecated-modal/index.js.map +1 -0
- package/es/components/dropdown/dropdown.js +1 -1
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/menu/menu.js.map +1 -1
- package/es/index.js +7 -5
- package/es/index.js.map +1 -1
- package/es/new-components/base-button/base-button.js +70 -0
- package/es/new-components/base-button/base-button.js.map +1 -0
- package/es/new-components/base-button/base-button.module.css.js +4 -0
- package/es/new-components/base-button/base-button.module.css.js.map +1 -0
- package/es/new-components/base-field/base-field.js +1 -1
- package/es/new-components/base-field/base-field.js.map +1 -1
- package/es/new-components/base-field/base-field.module.css.js +1 -1
- package/es/new-components/box/box.js +6 -5
- package/es/new-components/box/box.js.map +1 -1
- package/es/new-components/box/box.module.css.js +1 -1
- package/es/new-components/button/button.js +40 -0
- package/es/new-components/button/button.js.map +1 -0
- package/es/new-components/button-link/button-link.js +20 -10
- package/es/new-components/button-link/button-link.js.map +1 -1
- package/es/new-components/checkbox-field/checkbox-field.js +2 -1
- package/es/new-components/checkbox-field/checkbox-field.js.map +1 -1
- package/es/new-components/checkbox-field/checkbox-field.module.css.js +1 -1
- package/es/new-components/columns/columns.js +2 -2
- package/es/new-components/columns/columns.js.map +1 -1
- package/es/new-components/columns/columns.module.css.js +1 -1
- package/es/new-components/divider/divider.js +2 -2
- package/es/new-components/divider/divider.js.map +1 -1
- package/es/new-components/divider/divider.module.css.js +1 -1
- package/es/new-components/heading/heading.js +7 -2
- package/es/new-components/heading/heading.js.map +1 -1
- package/es/new-components/heading/heading.module.css.js +1 -1
- package/es/new-components/loading/loading.js +33 -0
- package/es/new-components/loading/loading.js.map +1 -0
- package/es/new-components/modal/modal.js +201 -0
- package/es/new-components/modal/modal.js.map +1 -0
- package/es/new-components/modal/modal.module.css.js +4 -0
- package/es/new-components/modal/modal.module.css.js.map +1 -0
- package/es/new-components/password-field/password-field.js +1 -1
- package/es/new-components/responsive-props.js +0 -21
- package/es/new-components/responsive-props.js.map +1 -1
- package/es/new-components/select-field/select-field.module.css.js +1 -1
- package/es/new-components/spinner/spinner.js +26 -0
- package/es/new-components/spinner/spinner.js.map +1 -0
- package/es/new-components/spinner/spinner.module.css.js +4 -0
- package/es/new-components/spinner/spinner.module.css.js.map +1 -0
- package/es/new-components/stack/stack.js +6 -6
- package/es/new-components/stack/stack.js.map +1 -1
- package/es/new-components/switch-field/switch-field.js +3 -2
- package/es/new-components/switch-field/switch-field.js.map +1 -1
- package/es/new-components/switch-field/switch-field.module.css.js +1 -1
- package/es/new-components/tabs/tabs.js +11 -8
- package/es/new-components/tabs/tabs.js.map +1 -1
- package/es/new-components/tabs/tabs.module.css.js +1 -1
- package/es/new-components/text/text.js +6 -5
- package/es/new-components/text/text.js.map +1 -1
- package/es/new-components/text/text.module.css.js +1 -1
- package/es/new-components/text-area/text-area.module.css.js +1 -1
- package/es/new-components/text-field/text-field.module.css.js +1 -1
- package/es/utils/polymorphism.js.map +1 -1
- package/lib/components/{button/button.d.ts → deprecated-button/deprecated-button.d.ts} +7 -1
- package/lib/components/{button/button.js → deprecated-button/deprecated-button.js} +1 -1
- package/lib/components/deprecated-button/deprecated-button.js.map +1 -0
- package/lib/components/{button/button.test.d.ts → deprecated-button/deprecated-button.test.d.ts} +0 -0
- package/lib/components/deprecated-button/index.d.ts +4 -0
- package/lib/components/{loading → deprecated-button}/index.js +1 -1
- package/lib/components/{button → deprecated-button}/index.js.map +0 -0
- package/lib/components/{loading/loading.d.ts → deprecated-loading/deprecated-loading.d.ts} +2 -1
- package/lib/components/{loading/loading.js → deprecated-loading/deprecated-loading.js} +1 -1
- package/lib/components/deprecated-loading/deprecated-loading.js.map +1 -0
- package/lib/components/{loading/Loading.test.d.ts → deprecated-loading/deprecated-loading.test.d.ts} +0 -0
- package/lib/components/deprecated-loading/index.d.ts +1 -0
- package/lib/components/{modal/modal.d.ts → deprecated-modal/deprecated-modal.d.ts} +6 -1
- package/lib/components/{modal/modal.js → deprecated-modal/deprecated-modal.js} +1 -1
- package/lib/components/deprecated-modal/deprecated-modal.js.map +1 -0
- package/lib/components/{modal/modal.test.d.ts → deprecated-modal/deprecated-modal.test.d.ts} +0 -0
- package/lib/components/{modal → deprecated-modal}/index.d.ts +2 -2
- package/lib/components/deprecated-modal/index.js +2 -0
- package/lib/components/deprecated-modal/index.js.map +1 -0
- package/lib/components/dropdown/dropdown.js +1 -1
- package/lib/components/dropdown/dropdown.js.map +1 -1
- package/lib/components/menu/menu.d.ts +5 -9
- package/lib/components/menu/menu.js.map +1 -1
- package/lib/index.d.ts +6 -4
- package/lib/index.js +1 -1
- package/lib/new-components/base-button/base-button.d.ts +65 -0
- package/lib/new-components/base-button/base-button.js +2 -0
- package/lib/new-components/base-button/base-button.js.map +1 -0
- package/lib/new-components/base-button/base-button.module.css.js +2 -0
- package/lib/new-components/base-button/base-button.module.css.js.map +1 -0
- package/lib/new-components/base-button/index.d.ts +1 -0
- package/lib/new-components/base-field/base-field.js +1 -1
- package/lib/new-components/base-field/base-field.js.map +1 -1
- package/lib/new-components/base-field/base-field.module.css.js +1 -1
- package/lib/new-components/box/box.d.ts +8 -5
- package/lib/new-components/box/box.js +1 -1
- package/lib/new-components/box/box.js.map +1 -1
- package/lib/new-components/box/box.module.css.js +1 -1
- package/lib/new-components/button/button.d.ts +48 -0
- package/lib/new-components/button/button.js +2 -0
- package/lib/new-components/button/button.js.map +1 -0
- package/lib/new-components/button/button.test.d.ts +1 -0
- package/lib/new-components/button/index.d.ts +1 -0
- package/lib/new-components/button-link/button-link-story-wrapper.d.ts +7 -0
- package/lib/new-components/button-link/button-link.d.ts +14 -7
- package/lib/new-components/button-link/button-link.js +1 -1
- package/lib/new-components/button-link/button-link.js.map +1 -1
- package/lib/new-components/button-link/button-link.test.d.ts +1 -0
- package/lib/new-components/checkbox-field/checkbox-field.js +1 -1
- package/lib/new-components/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/new-components/checkbox-field/checkbox-field.module.css.js +1 -1
- package/lib/new-components/columns/columns.js +1 -1
- package/lib/new-components/columns/columns.js.map +1 -1
- package/lib/new-components/columns/columns.module.css.js +1 -1
- package/lib/new-components/common-types.d.ts +1 -0
- package/lib/new-components/divider/divider.d.ts +2 -2
- package/lib/new-components/divider/divider.js +1 -1
- package/lib/new-components/divider/divider.js.map +1 -1
- package/lib/new-components/divider/divider.module.css.js +1 -1
- package/lib/new-components/heading/heading.d.ts +101 -3
- package/lib/new-components/heading/heading.js +1 -1
- package/lib/new-components/heading/heading.js.map +1 -1
- package/lib/new-components/heading/heading.module.css.js +1 -1
- package/lib/new-components/heading/heading.test.d.ts +1 -0
- package/lib/new-components/loading/index.d.ts +1 -0
- package/lib/new-components/loading/loading.d.ts +26 -0
- package/lib/new-components/loading/loading.js +2 -0
- package/lib/new-components/loading/loading.js.map +1 -0
- package/lib/new-components/loading/loading.test.d.ts +1 -0
- package/lib/new-components/modal/index.d.ts +1 -0
- package/lib/new-components/modal/modal-stories-components.d.ts +35 -0
- package/lib/new-components/modal/modal.d.ts +151 -0
- package/lib/new-components/modal/modal.js +2 -0
- package/lib/new-components/modal/modal.js.map +1 -0
- package/lib/new-components/modal/modal.module.css.js +2 -0
- package/lib/new-components/modal/modal.module.css.js.map +1 -0
- package/lib/new-components/modal/modal.test.d.ts +1 -0
- package/lib/new-components/password-field/password-field.js +1 -1
- package/lib/new-components/responsive-props.d.ts +1 -1
- package/lib/new-components/responsive-props.js +1 -1
- package/lib/new-components/responsive-props.js.map +1 -1
- package/lib/new-components/select-field/select-field.module.css.js +1 -1
- package/lib/new-components/spinner/index.d.ts +1 -0
- package/lib/new-components/spinner/spinner.d.ts +5 -0
- package/lib/new-components/spinner/spinner.js +2 -0
- package/lib/new-components/spinner/spinner.js.map +1 -0
- package/lib/new-components/spinner/spinner.module.css.js +2 -0
- package/lib/new-components/spinner/spinner.module.css.js.map +1 -0
- package/lib/new-components/stack/stack.d.ts +5 -5
- package/lib/new-components/stack/stack.js +1 -1
- package/lib/new-components/stack/stack.js.map +1 -1
- package/lib/new-components/switch-field/switch-field.js +1 -1
- package/lib/new-components/switch-field/switch-field.js.map +1 -1
- package/lib/new-components/switch-field/switch-field.module.css.js +1 -1
- package/lib/new-components/tabs/tabs.d.ts +6 -6
- package/lib/new-components/tabs/tabs.js +1 -1
- package/lib/new-components/tabs/tabs.js.map +1 -1
- package/lib/new-components/tabs/tabs.module.css.js +1 -1
- package/lib/new-components/text/text.d.ts +36 -1
- package/lib/new-components/text/text.js +1 -1
- package/lib/new-components/text/text.js.map +1 -1
- package/lib/new-components/text/text.module.css.js +1 -1
- package/lib/new-components/text/text.test.d.ts +1 -0
- package/lib/new-components/text-area/text-area.module.css.js +1 -1
- package/lib/new-components/text-field/text-field.module.css.js +1 -1
- package/lib/utils/polymorphism.d.ts +1 -1
- package/lib/utils/polymorphism.js.map +1 -1
- package/package.json +3 -1
- package/styles/alert.css +2 -2
- package/styles/{button-link.css → base-button.css} +4 -2
- package/styles/base-button.module.css.css +1 -0
- package/styles/base-field.css +4 -4
- package/styles/base-field.module.css.css +1 -1
- package/styles/box.css +1 -1
- package/styles/box.module.css.css +1 -1
- package/styles/checkbox-field.css +3 -2
- package/styles/checkbox-field.module.css.css +1 -1
- package/styles/columns.css +2 -2
- package/styles/columns.module.css.css +1 -1
- package/styles/{button.css → deprecated-button.css} +0 -0
- package/styles/deprecated-loading.css +1 -0
- package/styles/deprecated-modal.css +1 -0
- package/styles/divider.css +2 -2
- package/styles/divider.module.css.css +1 -1
- package/styles/heading.css +2 -2
- package/styles/heading.module.css.css +1 -1
- package/styles/hidden-visually.css +1 -1
- package/styles/hidden.css +1 -1
- package/styles/inline.css +1 -1
- package/styles/loading.css +4 -1
- package/styles/modal.css +10 -1
- package/styles/modal.module.css.css +1 -0
- package/styles/notice.css +2 -2
- package/styles/password-field.css +5 -5
- package/styles/reactist.css +20 -19
- package/styles/select-field.css +5 -5
- package/styles/select-field.module.css.css +1 -1
- package/styles/spinner.module.css.css +1 -0
- package/styles/stack.css +2 -2
- package/styles/switch-field.css +5 -5
- package/styles/switch-field.module.css.css +1 -1
- package/styles/tabs.css +2 -2
- package/styles/tabs.module.css.css +1 -1
- package/styles/text-area.css +5 -5
- package/styles/text-area.module.css.css +1 -1
- package/styles/text-field.css +5 -5
- package/styles/text-field.module.css.css +1 -1
- package/styles/text-link.css +1 -1
- package/styles/text.css +2 -2
- package/styles/text.module.css.css +1 -1
- package/es/components/button/button.js.map +0 -1
- package/es/components/loading/index.js +0 -6
- package/es/components/loading/index.js.map +0 -1
- package/es/components/loading/loading.js.map +0 -1
- package/es/components/modal/index.js.map +0 -1
- package/es/components/modal/modal.js.map +0 -1
- package/es/new-components/button-link/button-link.module.css.js +0 -4
- package/es/new-components/button-link/button-link.module.css.js.map +0 -1
- package/es/new-components/loading-spinner/loading-spinner.js +0 -37
- package/es/new-components/loading-spinner/loading-spinner.js.map +0 -1
- package/es/new-components/loading-spinner/loading-spinner.module.css.js +0 -4
- package/es/new-components/loading-spinner/loading-spinner.module.css.js.map +0 -1
- package/lib/components/button/button.js.map +0 -1
- package/lib/components/button/index.d.ts +0 -4
- package/lib/components/button/index.js +0 -2
- package/lib/components/loading/index.d.ts +0 -2
- package/lib/components/loading/index.js.map +0 -1
- package/lib/components/loading/loading.js.map +0 -1
- package/lib/components/modal/index.js +0 -2
- package/lib/components/modal/index.js.map +0 -1
- package/lib/components/modal/modal.js.map +0 -1
- package/lib/new-components/button-link/button-link.module.css.js +0 -2
- package/lib/new-components/button-link/button-link.module.css.js.map +0 -1
- package/lib/new-components/loading-spinner/index.d.ts +0 -1
- package/lib/new-components/loading-spinner/loading-spinner.d.ts +0 -8
- package/lib/new-components/loading-spinner/loading-spinner.js +0 -2
- package/lib/new-components/loading-spinner/loading-spinner.js.map +0 -1
- package/lib/new-components/loading-spinner/loading-spinner.module.css.js +0 -2
- package/lib/new-components/loading-spinner/loading-spinner.module.css.js.map +0 -1
- package/styles/button-link.module.css.css +0 -1
- package/styles/loading-spinner.module.css.css +0 -1
|
@@ -8,9 +8,11 @@ var React = require('react');
|
|
|
8
8
|
var React__default = _interopDefault(React);
|
|
9
9
|
var classNames = _interopDefault(require('classnames'));
|
|
10
10
|
var flattenChildren = _interopDefault(require('react-keyed-flatten-children'));
|
|
11
|
-
var reakitUtils = require('reakit-utils');
|
|
12
11
|
var Tooltip$1 = require('reakit/Tooltip');
|
|
12
|
+
var reakitUtils = require('reakit-utils');
|
|
13
13
|
var Tab$1 = require('reakit/Tab');
|
|
14
|
+
var dialog = require('@reach/dialog');
|
|
15
|
+
var FocusLock = _interopDefault(require('react-focus-lock'));
|
|
14
16
|
var ReactDOM = _interopDefault(require('react-dom'));
|
|
15
17
|
var PropTypes = _interopDefault(require('prop-types'));
|
|
16
18
|
var dayjs = _interopDefault(require('dayjs'));
|
|
@@ -109,9 +111,6 @@ function polymorphicComponent(render) {
|
|
|
109
111
|
return /*#__PURE__*/React.forwardRef(render);
|
|
110
112
|
}
|
|
111
113
|
|
|
112
|
-
function isResponsivePropArray(responsiveProp) {
|
|
113
|
-
return Array.isArray(responsiveProp);
|
|
114
|
-
}
|
|
115
114
|
/**
|
|
116
115
|
* Builds a css module class name for a given prop + prop-value combination.
|
|
117
116
|
*
|
|
@@ -130,7 +129,6 @@ function isResponsivePropArray(responsiveProp) {
|
|
|
130
129
|
* @param value the given prop's value
|
|
131
130
|
*/
|
|
132
131
|
|
|
133
|
-
|
|
134
132
|
function getClassNames(styles, property, value) {
|
|
135
133
|
if (!value) {
|
|
136
134
|
return null;
|
|
@@ -138,14 +136,6 @@ function getClassNames(styles, property, value) {
|
|
|
138
136
|
|
|
139
137
|
var classList = [];
|
|
140
138
|
|
|
141
|
-
if (isResponsivePropArray(value)) {
|
|
142
|
-
value = {
|
|
143
|
-
mobile: value[0],
|
|
144
|
-
tablet: value[1],
|
|
145
|
-
desktop: value[2]
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
|
|
149
139
|
if (typeof value === 'string') {
|
|
150
140
|
classList.push(styles[property + "-" + value]);
|
|
151
141
|
} else {
|
|
@@ -186,14 +176,6 @@ function mapResponsiveProp(fromValue, mapper) {
|
|
|
186
176
|
return mapper(fromValue);
|
|
187
177
|
}
|
|
188
178
|
|
|
189
|
-
if (isResponsivePropArray(fromValue)) {
|
|
190
|
-
fromValue = {
|
|
191
|
-
mobile: fromValue[0],
|
|
192
|
-
tablet: fromValue[1],
|
|
193
|
-
desktop: fromValue[2]
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
|
|
197
179
|
return {
|
|
198
180
|
mobile: fromValue.mobile ? mapper(fromValue.mobile) : undefined,
|
|
199
181
|
tablet: fromValue.tablet ? mapper(fromValue.tablet) : undefined,
|
|
@@ -201,7 +183,7 @@ function mapResponsiveProp(fromValue, mapper) {
|
|
|
201
183
|
};
|
|
202
184
|
}
|
|
203
185
|
|
|
204
|
-
var modules_54d944f2 = {"box":"
|
|
186
|
+
var modules_54d944f2 = {"box":"_26c5201d","position-absolute":"_77c3d8d1","position-fixed":"_37cb98fb","position-relative":"df16028f","position-sticky":"_4205abac","tablet-position-absolute":"d6993b5e","tablet-position-fixed":"a015e0f5","tablet-position-relative":"_236dd3b1","tablet-position-sticky":"b7ac4837","desktop-position-absolute":"fd93a726","desktop-position-fixed":"_49228edc","desktop-position-relative":"d972b518","desktop-position-sticky":"b2a2baf3","display-block":"_22f1edd1","display-flex":"c23d2d6f","display-inline":"_5359896d","display-inlineBlock":"a54a41a6","display-inlineFlex":"d02f3d43","display-none":"_760c0710","tablet-display-block":"_64e2ebe6","tablet-display-flex":"_25274f78","tablet-display-inline":"_2077d063","tablet-display-inlineBlock":"aaed581f","tablet-display-inlineFlex":"_1d4a6eb5","tablet-display-none":"_66f24c78","desktop-display-block":"_145cca89","desktop-display-flex":"_1861c899","desktop-display-inline":"_96a720c8","desktop-display-inlineBlock":"_56acf5d5","desktop-display-inlineFlex":"_2a268e4b","desktop-display-none":"b4f30b9e","minWidth-0":"_0b071847","minWidth-xsmall":"_8b67f007","minWidth-small":"e3ec3474","minWidth-medium":"_5cccd4fc","minWidth-large":"_06eeac65","minWidth-xlarge":"ee1b6344","maxWidth-xsmall":"_2df097d0","maxWidth-small":"b771df2a","maxWidth-medium":"_00ad4e35","maxWidth-large":"_4a848dab","maxWidth-xlarge":"bf216b15","maxWidth-full":"a60a7855","flexDirection-column":"_4cf1b6c9","flexDirection-row":"e056fa5a","tablet-flexDirection-column":"b9aa8d99","tablet-flexDirection-row":"_2e8b3442","desktop-flexDirection-column":"_2162c612","desktop-flexDirection-row":"_279bf1e4","flexWrap-wrap":"_346d3a71","flexWrap-nowrap":"_786fd122","flexShrink-0":"_4b864fc2","flexGrow-0":"_795f552f","flexGrow-1":"a68bcd0f","alignItems-flexStart":"_34e24973","alignItems-center":"_648380f4","alignItems-flexEnd":"_18b4e1d6","alignItems-baseline":"_805c1b65","tablet-alignItems-flexStart":"fd4006c2","tablet-alignItems-center":"c3ba10a7","tablet-alignItems-flexEnd":"_984cd304","tablet-alignItems-baseline":"_696cc167","desktop-alignItems-flexStart":"_74133d54","desktop-alignItems-center":"_92ab46df","desktop-alignItems-flexEnd":"_177026d9","desktop-alignItems-baseline":"ebd2f31f","justifyContent-flexStart":"_4969235b","justifyContent-center":"_9594db58","justifyContent-flexEnd":"_6789fdd3","justifyContent-spaceAround":"b9902d94","justifyContent-spaceBetween":"_3c3ae41b","justifyContent-spaceEvenly":"_8dce8767","tablet-justifyContent-flexStart":"_6bd82354","tablet-justifyContent-center":"_3044c29a","tablet-justifyContent-flexEnd":"_13da8745","tablet-justifyContent-spaceAround":"_981fa9c8","tablet-justifyContent-spaceBetween":"d34811a6","tablet-justifyContent-spaceEvenly":"_53e07124","desktop-justifyContent-flexStart":"e709f277","desktop-justifyContent-center":"abc87cc4","desktop-justifyContent-flexEnd":"ce410292","desktop-justifyContent-spaceBetween":"_5ab1bc04","overflow-hidden":"_11a684c0","overflow-auto":"_2c024f85","overflow-visible":"_4d4892bd","overflow-scroll":"_22ffbb40","width-full":"_330d9b0b","height-full":"fb8deb05","bg-default":"_133f5c00","bg-aside":"b2be7ffe","bg-highlight":"a45e67ff","bg-selected":"b90226b5","borderRadius-standard":"_6e988219","borderRadius-full":"_14cf204e","border-primary":"a710cfdd","border-secondary":"_52263feb","border-tertiary":"_546ec3ef","textAlign-start":"_7fa90cb9","textAlign-center":"_54c80396","textAlign-end":"e4b1ea49","textAlign-justify":"_0eecd510","tablet-textAlign-start":"a309e75d","tablet-textAlign-center":"_67fb1a07","tablet-textAlign-end":"_0fa851ec","tablet-textAlign-justify":"_585a0e34","desktop-textAlign-start":"_5f909690","desktop-textAlign-center":"_13e03993","desktop-textAlign-end":"f142a1cb","desktop-textAlign-justify":"_2bba79a9"};
|
|
205
187
|
|
|
206
188
|
var modules_b537a8ee = {"paddingTop-xsmall":"c4803194","paddingTop-small":"_4e9ab24b","paddingTop-medium":"_1d226e27","paddingTop-large":"eb6097f1","paddingTop-xlarge":"d3229ba4","paddingTop-xxlarge":"_47978ba4","tablet-paddingTop-xsmall":"f987719c","tablet-paddingTop-small":"_8dbc4b4d","tablet-paddingTop-medium":"ae44fe07","tablet-paddingTop-large":"ffe9548d","tablet-paddingTop-xlarge":"f2b76a44","tablet-paddingTop-xxlarge":"c6eb8f43","desktop-paddingTop-xsmall":"_8699b560","desktop-paddingTop-small":"_02c374b7","desktop-paddingTop-medium":"_0dd0332f","desktop-paddingTop-large":"da55f1f6","desktop-paddingTop-xlarge":"_8ef2a278","desktop-paddingTop-xxlarge":"_8b493b28","paddingRight-xsmall":"_211eebc7","paddingRight-small":"ad0ccf15","paddingRight-medium":"a03e39af","paddingRight-large":"f0941ead","paddingRight-xlarge":"e47c5a43","paddingRight-xxlarge":"e849a5cf","tablet-paddingRight-xsmall":"_85374228","tablet-paddingRight-small":"_89df37b9","tablet-paddingRight-medium":"_1cc50ebe","tablet-paddingRight-large":"_1060982b","tablet-paddingRight-xlarge":"be58847d","tablet-paddingRight-xxlarge":"_45093484","desktop-paddingRight-xsmall":"f8d99d6a","desktop-paddingRight-small":"efa076d9","desktop-paddingRight-medium":"e59caa64","desktop-paddingRight-large":"da42f46a","desktop-paddingRight-xlarge":"b3ee2580","desktop-paddingRight-xxlarge":"_3ef94658","paddingBottom-xsmall":"b0e6eab4","paddingBottom-small":"_9510d053","paddingBottom-medium":"d7af60c9","paddingBottom-large":"b75f86cd","paddingBottom-xlarge":"fbd4ce29","paddingBottom-xxlarge":"_33e3ad63","tablet-paddingBottom-xsmall":"f0302da7","tablet-paddingBottom-small":"_4f9b8012","tablet-paddingBottom-medium":"_4333e20e","tablet-paddingBottom-large":"_30bbc76c","tablet-paddingBottom-xlarge":"ba5a4008","tablet-paddingBottom-xxlarge":"_423a3b1a","desktop-paddingBottom-xsmall":"b40139b7","desktop-paddingBottom-small":"f96071fa","desktop-paddingBottom-medium":"fe803c9a","desktop-paddingBottom-large":"_01686eb9","desktop-paddingBottom-xlarge":"afa763d8","desktop-paddingBottom-xxlarge":"a95785f1","paddingLeft-xsmall":"cad4e2ec","paddingLeft-small":"d70b3c17","paddingLeft-medium":"_8c851bd6","paddingLeft-large":"_078feb3c","paddingLeft-xlarge":"_76ab968c","paddingLeft-xxlarge":"aaca85d7","tablet-paddingLeft-xsmall":"_5eb0e5aa","tablet-paddingLeft-small":"_0384fb4f","tablet-paddingLeft-medium":"edffff6f","tablet-paddingLeft-large":"_873b9a46","tablet-paddingLeft-xlarge":"_89105db5","tablet-paddingLeft-xxlarge":"db1966fe","desktop-paddingLeft-xsmall":"b17f826b","desktop-paddingLeft-small":"_6dc83610","desktop-paddingLeft-medium":"_3421b8b2","desktop-paddingLeft-large":"_68cec7a6","desktop-paddingLeft-xlarge":"_94bde020","desktop-paddingLeft-xxlarge":"b94ee579"};
|
|
207
189
|
|
|
@@ -214,8 +196,7 @@ var Box = /*#__PURE__*/polymorphicComponent(function Box(_ref, ref) {
|
|
|
214
196
|
component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
215
197
|
_ref$position = _ref.position,
|
|
216
198
|
position = _ref$position === void 0 ? 'static' : _ref$position,
|
|
217
|
-
|
|
218
|
-
display = _ref$display === void 0 ? 'block' : _ref$display,
|
|
199
|
+
display = _ref.display,
|
|
219
200
|
_ref$flexDirection = _ref.flexDirection,
|
|
220
201
|
flexDirection = _ref$flexDirection === void 0 ? 'row' : _ref$flexDirection,
|
|
221
202
|
flexWrap = _ref.flexWrap,
|
|
@@ -231,6 +212,8 @@ var Box = /*#__PURE__*/polymorphicComponent(function Box(_ref, ref) {
|
|
|
231
212
|
borderRadius = _ref.borderRadius,
|
|
232
213
|
minWidth = _ref.minWidth,
|
|
233
214
|
maxWidth = _ref.maxWidth,
|
|
215
|
+
_ref$textAlign = _ref.textAlign,
|
|
216
|
+
textAlign = _ref$textAlign === void 0 ? 'start' : _ref$textAlign,
|
|
234
217
|
padding = _ref.padding,
|
|
235
218
|
paddingY = _ref.paddingY,
|
|
236
219
|
paddingX = _ref.paddingX,
|
|
@@ -247,7 +230,7 @@ var Box = /*#__PURE__*/polymorphicComponent(function Box(_ref, ref) {
|
|
|
247
230
|
marginLeft = _ref.marginLeft,
|
|
248
231
|
className = _ref.className,
|
|
249
232
|
children = _ref.children,
|
|
250
|
-
props = _objectWithoutPropertiesLoose(_ref, ["as", "position", "display", "flexDirection", "flexWrap", "flexGrow", "flexShrink", "alignItems", "justifyContent", "overflow", "width", "height", "background", "border", "borderRadius", "minWidth", "maxWidth", "padding", "paddingY", "paddingX", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "margin", "marginY", "marginX", "marginTop", "marginRight", "marginBottom", "marginLeft", "className", "children"]);
|
|
233
|
+
props = _objectWithoutPropertiesLoose(_ref, ["as", "position", "display", "flexDirection", "flexWrap", "flexGrow", "flexShrink", "alignItems", "justifyContent", "overflow", "width", "height", "background", "border", "borderRadius", "minWidth", "maxWidth", "textAlign", "padding", "paddingY", "paddingX", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "margin", "marginY", "marginX", "marginTop", "marginRight", "marginBottom", "marginLeft", "className", "children"]);
|
|
251
234
|
|
|
252
235
|
var resolvedPaddingTop = (_ref2 = paddingTop !== null && paddingTop !== void 0 ? paddingTop : paddingY) !== null && _ref2 !== void 0 ? _ref2 : padding;
|
|
253
236
|
var resolvedPaddingRight = (_ref3 = paddingRight !== null && paddingRight !== void 0 ? paddingRight : paddingX) !== null && _ref3 !== void 0 ? _ref3 : padding;
|
|
@@ -257,9 +240,9 @@ var Box = /*#__PURE__*/polymorphicComponent(function Box(_ref, ref) {
|
|
|
257
240
|
var resolvedMarginRight = (_ref7 = marginRight !== null && marginRight !== void 0 ? marginRight : marginX) !== null && _ref7 !== void 0 ? _ref7 : margin;
|
|
258
241
|
var resolvedMarginBottom = (_ref8 = marginBottom !== null && marginBottom !== void 0 ? marginBottom : marginY) !== null && _ref8 !== void 0 ? _ref8 : margin;
|
|
259
242
|
var resolvedMarginLeft = (_ref9 = marginLeft !== null && marginLeft !== void 0 ? marginLeft : marginX) !== null && _ref9 !== void 0 ? _ref9 : margin;
|
|
260
|
-
var omitFlex = typeof display === 'string' && display !== 'flex' && display !== 'inlineFlex';
|
|
243
|
+
var omitFlex = !display || typeof display === 'string' && display !== 'flex' && display !== 'inlineFlex';
|
|
261
244
|
return /*#__PURE__*/React.createElement(component, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
262
|
-
className: classNames(className, modules_54d944f2.box, getClassNames(modules_54d944f2, 'display', display), position !== 'static' ? getClassNames(modules_54d944f2, 'position', position) : null, minWidth != null ? getClassNames(modules_54d944f2, 'minWidth', String(minWidth)) : null, getClassNames(modules_54d944f2, 'maxWidth', maxWidth), // padding
|
|
245
|
+
className: classNames(className, modules_54d944f2.box, display ? getClassNames(modules_54d944f2, 'display', display) : null, position !== 'static' ? getClassNames(modules_54d944f2, 'position', position) : null, minWidth != null ? getClassNames(modules_54d944f2, 'minWidth', String(minWidth)) : null, getClassNames(modules_54d944f2, 'maxWidth', maxWidth), textAlign !== 'start' ? getClassNames(modules_54d944f2, 'textAlign', textAlign) : null, // padding
|
|
263
246
|
getClassNames(modules_b537a8ee, 'paddingTop', resolvedPaddingTop), getClassNames(modules_b537a8ee, 'paddingRight', resolvedPaddingRight), getClassNames(modules_b537a8ee, 'paddingBottom', resolvedPaddingBottom), getClassNames(modules_b537a8ee, 'paddingLeft', resolvedPaddingLeft), // margin
|
|
264
247
|
getClassNames(modules_131405ac, 'marginTop', resolvedMarginTop), getClassNames(modules_131405ac, 'marginRight', resolvedMarginRight), getClassNames(modules_131405ac, 'marginBottom', resolvedMarginBottom), getClassNames(modules_131405ac, 'marginLeft', resolvedMarginLeft), // flex props
|
|
265
248
|
omitFlex ? null : getClassNames(modules_54d944f2, 'flexDirection', flexDirection), omitFlex ? null : getClassNames(modules_54d944f2, 'flexWrap', flexWrap), omitFlex ? null : getClassNames(modules_54d944f2, 'alignItems', alignItems), omitFlex ? null : getClassNames(modules_54d944f2, 'justifyContent', justifyContent), flexShrink != null ? getClassNames(modules_54d944f2, 'flexShrink', String(flexShrink)) : null, flexGrow != null ? getClassNames(modules_54d944f2, 'flexGrow', String(flexGrow)) : null, // other props
|
|
@@ -268,7 +251,7 @@ var Box = /*#__PURE__*/polymorphicComponent(function Box(_ref, ref) {
|
|
|
268
251
|
}), children);
|
|
269
252
|
});
|
|
270
253
|
|
|
271
|
-
var modules_67f2d07a = {"space-xsmall":"
|
|
254
|
+
var modules_67f2d07a = {"space-xsmall":"_6f59c771","column":"_91e05f0f","space-small":"_5a55af26","space-medium":"fa261310","space-large":"_6ebd4e46","space-xlarge":"_55ce4aea","space-xxlarge":"_04c9c3ac","tablet-space-xsmall":"ab76d8cd","tablet-space-small":"_14629bfb","tablet-space-medium":"_5b4e39ea","tablet-space-large":"ba270182","tablet-space-xlarge":"b96e7ec7","tablet-space-xxlarge":"d276612c","desktop-space-xsmall":"d7a73106","desktop-space-small":"_8f5e0e9e","desktop-space-medium":"_3a168411","desktop-space-large":"_0abcc12e","desktop-space-xlarge":"e0bafc60","desktop-space-xxlarge":"d2df9afd","columnWidth-auto":"b18d0b47","columnWidth-1-2":"_102a6b27","columnWidth-1-3":"_829872fe","columnWidth-2-3":"cf5aef9a","columnWidth-1-4":"_931bf714","columnWidth-3-4":"b0303130","columnWidth-1-5":"f6589a6f","columnWidth-2-5":"_2823aed9","columnWidth-3-5":"d00ba3bb","columnWidth-4-5":"_338f2d7c","tablet-tablet-space-xsmall":"_06582234"};
|
|
272
255
|
|
|
273
256
|
var Column = /*#__PURE__*/polymorphicComponent(function Column(_ref, ref) {
|
|
274
257
|
var _ref$width = _ref.width,
|
|
@@ -281,6 +264,7 @@ var Column = /*#__PURE__*/polymorphicComponent(function Column(_ref, ref) {
|
|
|
281
264
|
className: [exceptionallySetClassName, modules_67f2d07a.column, width !== 'content' ? getClassNames(modules_67f2d07a, 'columnWidth', width.replace('/', '-')) : null],
|
|
282
265
|
minWidth: 0,
|
|
283
266
|
width: width !== 'content' ? 'full' : undefined,
|
|
267
|
+
height: "full",
|
|
284
268
|
flexShrink: width === 'content' ? 0 : undefined,
|
|
285
269
|
ref: ref
|
|
286
270
|
}), children);
|
|
@@ -298,6 +282,7 @@ var Columns = /*#__PURE__*/polymorphicComponent(function Columns(_ref2, ref) {
|
|
|
298
282
|
|
|
299
283
|
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
300
284
|
className: [exceptionallySetClassName, getClassNames(modules_67f2d07a, 'space', space)],
|
|
285
|
+
display: "flex",
|
|
301
286
|
flexDirection: collapseBelow === 'desktop' ? {
|
|
302
287
|
mobile: 'column',
|
|
303
288
|
tablet: 'column',
|
|
@@ -306,28 +291,26 @@ var Columns = /*#__PURE__*/polymorphicComponent(function Columns(_ref2, ref) {
|
|
|
306
291
|
mobile: 'column',
|
|
307
292
|
tablet: 'row'
|
|
308
293
|
} : 'row',
|
|
309
|
-
display: "flex",
|
|
310
294
|
alignItems: mapResponsiveProp(alignY, function (alignY) {
|
|
311
295
|
return alignY === 'top' ? 'flexStart' : alignY === 'bottom' ? 'flexEnd' : alignY;
|
|
312
296
|
}),
|
|
313
297
|
justifyContent: mapResponsiveProp(align, function (align) {
|
|
314
298
|
return align === 'left' ? 'flexStart' : align === 'right' ? 'flexEnd' : align;
|
|
315
299
|
}),
|
|
316
|
-
flexGrow: 1,
|
|
317
300
|
ref: ref
|
|
318
301
|
}), children);
|
|
319
302
|
});
|
|
320
303
|
|
|
321
|
-
var modules_c742c4d7 = {"
|
|
304
|
+
var modules_c742c4d7 = {"weight-primary":"_3f3a401c","weight-secondary":"_03b05b70","weight-tertiary":"b6f67ff8"};
|
|
322
305
|
|
|
323
306
|
function Divider(_ref) {
|
|
324
307
|
var _ref$weight = _ref.weight,
|
|
325
|
-
weight = _ref$weight === void 0 ? '
|
|
308
|
+
weight = _ref$weight === void 0 ? 'tertiary' : _ref$weight,
|
|
326
309
|
props = _objectWithoutPropertiesLoose(_ref, ["weight"]);
|
|
327
310
|
|
|
328
311
|
return /*#__PURE__*/React.createElement(Box, Object.assign({
|
|
329
312
|
as: "hr",
|
|
330
|
-
className:
|
|
313
|
+
className: getClassNames(modules_c742c4d7, 'weight', weight)
|
|
331
314
|
}, props));
|
|
332
315
|
}
|
|
333
316
|
|
|
@@ -365,28 +348,28 @@ var Stack = /*#__PURE__*/polymorphicComponent(function Stack(_ref, ref) {
|
|
|
365
348
|
var as = _ref.as,
|
|
366
349
|
space = _ref.space,
|
|
367
350
|
_ref$align = _ref.align,
|
|
368
|
-
align = _ref$align === void 0 ? '
|
|
351
|
+
align = _ref$align === void 0 ? 'start' : _ref$align,
|
|
369
352
|
_ref$dividers = _ref.dividers,
|
|
370
|
-
dividers = _ref$dividers === void 0 ?
|
|
353
|
+
dividers = _ref$dividers === void 0 ? 'none' : _ref$dividers,
|
|
371
354
|
children = _ref.children,
|
|
372
355
|
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
373
356
|
props = _objectWithoutPropertiesLoose(_ref, ["as", "space", "align", "dividers", "children", "exceptionallySetClassName"]);
|
|
374
357
|
|
|
375
|
-
var alignProps = align === '
|
|
358
|
+
var alignProps = align === 'start' ? undefined : {
|
|
376
359
|
width: 'full',
|
|
377
360
|
flexDirection: 'column',
|
|
378
361
|
display: 'flex',
|
|
379
362
|
alignItems: mapResponsiveProp(align, function (align) {
|
|
380
|
-
return align === '
|
|
363
|
+
return align === 'start' ? 'flexStart' : align === 'end' ? 'flexEnd' : 'center';
|
|
381
364
|
})
|
|
382
365
|
};
|
|
383
366
|
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, alignProps, {
|
|
384
367
|
as: as,
|
|
385
368
|
className: [exceptionallySetClassName, getClassNames(modules_3af3b7ac, 'space', space)],
|
|
386
369
|
ref: ref
|
|
387
|
-
}), dividers ? React.Children.map(flattenChildren(children), function (child, index) {
|
|
370
|
+
}), dividers !== 'none' ? React.Children.map(flattenChildren(children), function (child, index) {
|
|
388
371
|
return index > 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Divider, {
|
|
389
|
-
weight:
|
|
372
|
+
weight: dividers
|
|
390
373
|
}), child) : child;
|
|
391
374
|
}) : children);
|
|
392
375
|
});
|
|
@@ -568,7 +551,28 @@ function Alert(_ref) {
|
|
|
568
551
|
}, /*#__PURE__*/React.createElement(CloseIcon, null))) : null));
|
|
569
552
|
}
|
|
570
553
|
|
|
571
|
-
var
|
|
554
|
+
var modules_c7f5018f = {"svg":"_51539197","spinner":"_54fbe2b3","tint":"a0c466ed","fill":"_745b73d3"};
|
|
555
|
+
|
|
556
|
+
function Spinner(_ref) {
|
|
557
|
+
var _ref$size = _ref.size,
|
|
558
|
+
size = _ref$size === void 0 ? 24 : _ref$size;
|
|
559
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
560
|
+
"aria-hidden": true,
|
|
561
|
+
width: size,
|
|
562
|
+
height: size,
|
|
563
|
+
viewBox: "0 0 24 24",
|
|
564
|
+
className: modules_c7f5018f.svg
|
|
565
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
566
|
+
fill: "none",
|
|
567
|
+
fillRule: "nonzero"
|
|
568
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
569
|
+
className: modules_c7f5018f.tint,
|
|
570
|
+
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
571
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
572
|
+
className: modules_c7f5018f.fill,
|
|
573
|
+
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
574
|
+
})));
|
|
575
|
+
}
|
|
572
576
|
|
|
573
577
|
var sizeMapping = {
|
|
574
578
|
small: 24,
|
|
@@ -576,30 +580,24 @@ var sizeMapping = {
|
|
|
576
580
|
large: 48
|
|
577
581
|
};
|
|
578
582
|
|
|
579
|
-
function
|
|
583
|
+
function Loading(_ref) {
|
|
584
|
+
var _sizeMapping$size;
|
|
585
|
+
|
|
580
586
|
var _ref$size = _ref.size,
|
|
581
587
|
size = _ref$size === void 0 ? 'small' : _ref$size,
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
fillRule: "nonzero"
|
|
596
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
597
|
-
className: modules_aa6c8f31.spinner,
|
|
598
|
-
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
599
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
600
|
-
className: modules_aa6c8f31.spinnerBackground,
|
|
601
|
-
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
602
|
-
})))));
|
|
588
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
589
|
+
props = _objectWithoutPropertiesLoose(_ref, ["size", "exceptionallySetClassName"]);
|
|
590
|
+
|
|
591
|
+
var numericSize = (_sizeMapping$size = sizeMapping[size]) !== null && _sizeMapping$size !== void 0 ? _sizeMapping$size : sizeMapping.small;
|
|
592
|
+
return /*#__PURE__*/React__default.createElement(Box, Object.assign({}, props, {
|
|
593
|
+
className: exceptionallySetClassName,
|
|
594
|
+
display: "flex",
|
|
595
|
+
alignItems: "center",
|
|
596
|
+
justifyContent: "center",
|
|
597
|
+
role: "progressbar"
|
|
598
|
+
}), /*#__PURE__*/React__default.createElement(Spinner, {
|
|
599
|
+
size: numericSize
|
|
600
|
+
}));
|
|
603
601
|
}
|
|
604
602
|
|
|
605
603
|
var modules_1b547e7e = {"container":"_464500ae","tone-info":"_1abfe147","tone-positive":"_36ce9859","tone-caution":"f92214b7","tone-critical":"be6cf28e"};
|
|
@@ -623,7 +621,7 @@ function Notice(_ref) {
|
|
|
623
621
|
})), /*#__PURE__*/React.createElement(Column, null, children)));
|
|
624
622
|
}
|
|
625
623
|
|
|
626
|
-
var modules_949d2ff4 = {"heading":"
|
|
624
|
+
var modules_949d2ff4 = {"heading":"_2f45487c","weight-light":"a20cbde9","tone-secondary":"_75f44518","tone-danger":"_3952cc59","size-largest":"b71d22ef","size-larger":"f15346e2","size-smaller":"_3cae1428","lineClampMultipleLines":"_347f6fcd","lineClamp-1":"_895c0b16","lineClamp-2":"_2e4808bd","lineClamp-3":"_1bdb7bdc","lineClamp-4":"_159943ea","lineClamp-5":"e44e008d"};
|
|
627
625
|
|
|
628
626
|
var Heading = /*#__PURE__*/React.forwardRef(function Heading(_ref, ref) {
|
|
629
627
|
var level = _ref.level,
|
|
@@ -634,40 +632,46 @@ var Heading = /*#__PURE__*/React.forwardRef(function Heading(_ref, ref) {
|
|
|
634
632
|
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
635
633
|
children = _ref.children,
|
|
636
634
|
lineClamp = _ref.lineClamp,
|
|
635
|
+
align = _ref.align,
|
|
637
636
|
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
638
|
-
props = _objectWithoutPropertiesLoose(_ref, ["level", "weight", "size", "tone", "children", "lineClamp", "exceptionallySetClassName"]);
|
|
637
|
+
props = _objectWithoutPropertiesLoose(_ref, ["level", "weight", "size", "tone", "children", "lineClamp", "align", "exceptionallySetClassName"]);
|
|
639
638
|
|
|
640
639
|
// In TypeScript v4.1, this would be properly recognized without needing the type assertion
|
|
641
640
|
// https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#template-literal-types
|
|
642
641
|
var headingElementName = "h" + level;
|
|
643
642
|
var lineClampMultipleLines = typeof lineClamp === 'string' ? parseInt(lineClamp, 10) > 1 : (lineClamp || 0) > 1;
|
|
644
643
|
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
645
|
-
className: [exceptionallySetClassName, modules_949d2ff4.heading, weight !== 'regular' ? getClassNames(modules_949d2ff4, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_949d2ff4, 'tone', tone) : null, getClassNames(modules_949d2ff4, 'size', size), lineClampMultipleLines ? modules_949d2ff4.
|
|
644
|
+
className: [exceptionallySetClassName, modules_949d2ff4.heading, weight !== 'regular' ? getClassNames(modules_949d2ff4, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_949d2ff4, 'tone', tone) : null, getClassNames(modules_949d2ff4, 'size', size), lineClampMultipleLines ? modules_949d2ff4.lineClampMultipleLines : null, lineClamp ? getClassNames(modules_949d2ff4, 'lineClamp', lineClamp.toString()) : null],
|
|
645
|
+
textAlign: align,
|
|
646
|
+
// Prevents emojis from being cut-off
|
|
647
|
+
// See https://github.com/Doist/reactist/pull/528
|
|
648
|
+
paddingRight: lineClamp ? 'xsmall' : undefined,
|
|
646
649
|
as: headingElementName,
|
|
647
650
|
ref: ref
|
|
648
651
|
}), children);
|
|
649
652
|
});
|
|
650
653
|
|
|
651
|
-
var modules_a9637dd3 = {"text":"
|
|
654
|
+
var modules_a9637dd3 = {"text":"c12d1277","size-caption":"c88e1204","size-copy":"_426d67ec","size-subtitle":"f978d6c7","weight-semibold":"_0c31eccd","weight-bold":"aba17bdd","tone-secondary":"_2767b43d","tone-danger":"e8ae531e","lineClampMultipleLines":"dc839422","lineClamp-1":"e2d23135","lineClamp-2":"_7c778b7e","lineClamp-3":"_5ff41166","lineClamp-4":"b7a4998e","lineClamp-5":"_6a7f8803"};
|
|
652
655
|
|
|
653
656
|
var Text = /*#__PURE__*/polymorphicComponent(function Text(_ref, ref) {
|
|
654
|
-
var
|
|
655
|
-
as = _ref$as === void 0 ? 'span' : _ref$as,
|
|
657
|
+
var as = _ref.as,
|
|
656
658
|
_ref$size = _ref.size,
|
|
657
659
|
size = _ref$size === void 0 ? 'body' : _ref$size,
|
|
658
660
|
_ref$weight = _ref.weight,
|
|
659
661
|
weight = _ref$weight === void 0 ? 'regular' : _ref$weight,
|
|
660
662
|
_ref$tone = _ref.tone,
|
|
661
663
|
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
664
|
+
align = _ref.align,
|
|
662
665
|
children = _ref.children,
|
|
663
666
|
lineClamp = _ref.lineClamp,
|
|
664
667
|
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
665
|
-
props = _objectWithoutPropertiesLoose(_ref, ["as", "size", "weight", "tone", "children", "lineClamp", "exceptionallySetClassName"]);
|
|
668
|
+
props = _objectWithoutPropertiesLoose(_ref, ["as", "size", "weight", "tone", "align", "children", "lineClamp", "exceptionallySetClassName"]);
|
|
666
669
|
|
|
667
|
-
var lineClampMultipleLines = typeof lineClamp === 'string' ?
|
|
670
|
+
var lineClampMultipleLines = typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp !== null && lineClamp !== void 0 ? lineClamp : 1) > 1;
|
|
668
671
|
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
669
672
|
as: as,
|
|
670
|
-
className: [exceptionallySetClassName, modules_a9637dd3.text, size !== 'body' ? getClassNames(modules_a9637dd3, 'size', size) : null, weight !== 'regular' ? getClassNames(modules_a9637dd3, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_a9637dd3, 'tone', tone) : null, lineClampMultipleLines ? modules_a9637dd3.
|
|
673
|
+
className: [exceptionallySetClassName, modules_a9637dd3.text, size !== 'body' ? getClassNames(modules_a9637dd3, 'size', size) : null, weight !== 'regular' ? getClassNames(modules_a9637dd3, 'weight', weight) : null, tone !== 'normal' ? getClassNames(modules_a9637dd3, 'tone', tone) : null, lineClampMultipleLines ? modules_a9637dd3.lineClampMultipleLines : null, lineClamp ? getClassNames(modules_a9637dd3, 'lineClamp', lineClamp.toString()) : null],
|
|
674
|
+
textAlign: align,
|
|
671
675
|
// Prevents emojis from being cut-off
|
|
672
676
|
// See https://github.com/Doist/reactist/pull/528
|
|
673
677
|
paddingRight: lineClamp ? 'xsmall' : undefined,
|
|
@@ -675,26 +679,242 @@ var Text = /*#__PURE__*/polymorphicComponent(function Text(_ref, ref) {
|
|
|
675
679
|
}), children);
|
|
676
680
|
});
|
|
677
681
|
|
|
678
|
-
var
|
|
682
|
+
var SHOW_DELAY = 500;
|
|
683
|
+
var HIDE_DELAY = 100;
|
|
684
|
+
|
|
685
|
+
function useDelayedTooltipState(initialState) {
|
|
686
|
+
var tooltipState = Tooltip$1.useTooltipState(initialState);
|
|
687
|
+
var delay = useDelay();
|
|
688
|
+
return React__default.useMemo(function () {
|
|
689
|
+
return _objectSpread2(_objectSpread2({}, tooltipState), {}, {
|
|
690
|
+
show: delay(function () {
|
|
691
|
+
return tooltipState.show();
|
|
692
|
+
}, SHOW_DELAY),
|
|
693
|
+
hide: delay(function () {
|
|
694
|
+
return tooltipState.hide();
|
|
695
|
+
}, HIDE_DELAY)
|
|
696
|
+
});
|
|
697
|
+
}, [delay, tooltipState]);
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
function Tooltip(_ref) {
|
|
701
|
+
var children = _ref.children,
|
|
702
|
+
content = _ref.content,
|
|
703
|
+
_ref$position = _ref.position,
|
|
704
|
+
position = _ref$position === void 0 ? 'top' : _ref$position,
|
|
705
|
+
_ref$gapSize = _ref.gapSize,
|
|
706
|
+
gapSize = _ref$gapSize === void 0 ? 3 : _ref$gapSize,
|
|
707
|
+
className = _ref.className,
|
|
708
|
+
props = _objectWithoutPropertiesLoose(_ref, ["children", "content", "position", "gapSize", "className"]);
|
|
709
|
+
|
|
710
|
+
var tooltip = useDelayedTooltipState({
|
|
711
|
+
placement: position,
|
|
712
|
+
gutter: gapSize
|
|
713
|
+
});
|
|
714
|
+
var child = React__default.Children.only(children);
|
|
715
|
+
|
|
716
|
+
if (!content) {
|
|
717
|
+
return child;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* Prevents the tooltip from automatically firing on focus all the time. This is to prevent
|
|
721
|
+
* tooltips from showing when the trigger element is focused back after a popover or dialog that
|
|
722
|
+
* it opened was closed. See link below for more details.
|
|
723
|
+
* @see https://github.com/reakit/reakit/discussions/749
|
|
724
|
+
*/
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
function handleFocus(event) {
|
|
728
|
+
// If focus is not followed by a key up event, does it mean that it's not
|
|
729
|
+
// an intentional keyboard focus? Not sure but it seems to work.
|
|
730
|
+
// This may be resolved soon in an upcoming version of reakit:
|
|
731
|
+
// https://github.com/reakit/reakit/issues/750
|
|
732
|
+
function handleKeyUp(e) {
|
|
733
|
+
var eventKey = e.key;
|
|
734
|
+
|
|
735
|
+
if (eventKey !== 'Escape' && eventKey !== 'Enter' && eventKey !== 'Space') {
|
|
736
|
+
tooltip.show();
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
event.currentTarget.addEventListener('keyup', handleKeyUp, {
|
|
741
|
+
once: true
|
|
742
|
+
}); // Prevent tooltip.show from being called by TooltipReference
|
|
743
|
+
|
|
744
|
+
event.preventDefault(); // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
745
|
+
|
|
746
|
+
if (typeof child.props.onFocus === 'function') child.props.onFocus(event);
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Tooltip$1.TooltipReference, Object.assign({}, tooltip, {
|
|
750
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
|
751
|
+
ref: child.ref
|
|
752
|
+
}, child.props, {
|
|
753
|
+
onFocus: handleFocus
|
|
754
|
+
}), function (referenceProps) {
|
|
755
|
+
return /*#__PURE__*/React__default.cloneElement(child, referenceProps);
|
|
756
|
+
}), tooltip.visible ? /*#__PURE__*/React__default.createElement(Tooltip$1.Tooltip, Object.assign({}, tooltip, props, {
|
|
757
|
+
className: classNames('reactist_tooltip', className)
|
|
758
|
+
}), typeof content === 'function' ? content() : content) : null);
|
|
759
|
+
}
|
|
760
|
+
// Internal helpers
|
|
761
|
+
//
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* Returns a function offering the same interface as setTimeout, but cleans up on unmount.
|
|
765
|
+
*
|
|
766
|
+
* The timeout state is shared, and only one delayed function can be active at any given time. If
|
|
767
|
+
* a new delayed function is called while another one was waiting for its time to run, that older
|
|
768
|
+
* invocation is cleared and it never runs.
|
|
769
|
+
*
|
|
770
|
+
* This is suitable for our use case here, but probably not the most intuitive thing in general.
|
|
771
|
+
* That's why this is not made a shared util or something like it.
|
|
772
|
+
*/
|
|
773
|
+
|
|
774
|
+
function useDelay() {
|
|
775
|
+
var timeoutRef = React__default.useRef();
|
|
776
|
+
var clearTimeouts = React__default.useCallback(function clearTimeouts() {
|
|
777
|
+
if (timeoutRef.current != null) {
|
|
778
|
+
clearTimeout(timeoutRef.current);
|
|
779
|
+
}
|
|
780
|
+
}, []); // Runs clearTimeouts when the component is unmounted
|
|
781
|
+
|
|
782
|
+
React__default.useEffect(function () {
|
|
783
|
+
return clearTimeouts;
|
|
784
|
+
}, [clearTimeouts]);
|
|
785
|
+
return React__default.useCallback(function delay(fn, delay) {
|
|
786
|
+
return function () {
|
|
787
|
+
clearTimeouts();
|
|
788
|
+
timeoutRef.current = setTimeout(fn, delay);
|
|
789
|
+
};
|
|
790
|
+
}, [clearTimeouts]);
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
var modules_b9569bce = {"label":"_1f20c88a","baseButton":"_623015f3","size-small":"_062de645","size-normal":"_55e2a6a9","size-large":"cab32a7c","disabled":"e71c191a","iconButton":"_368efc16","startIcon":"d35389c1","endIcon":"_900d41d8","variant-primary":"_7c95e162","variant-secondary":"_9cb889aa","variant-tertiary":"_611b5b28","variant-quaternary":"_80c2bb84","tone-destructive":"ee13c455"};
|
|
794
|
+
|
|
795
|
+
function preventDefault(event) {
|
|
796
|
+
event.preventDefault();
|
|
797
|
+
}
|
|
798
|
+
/**
|
|
799
|
+
* The component that powers `Button` and `ButtonLink`, where the button styling logic and some
|
|
800
|
+
* common functionality resides. This component is internal to Reactist.
|
|
801
|
+
*
|
|
802
|
+
* 🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)
|
|
803
|
+
*
|
|
804
|
+
* @see Button
|
|
805
|
+
* @see ButtonLink
|
|
806
|
+
*/
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
var BaseButton = /*#__PURE__*/polymorphicComponent(function BaseButton(_ref, ref) {
|
|
810
|
+
var _ref$as = _ref.as,
|
|
811
|
+
as = _ref$as === void 0 ? 'div' : _ref$as,
|
|
812
|
+
variant = _ref.variant,
|
|
813
|
+
_ref$tone = _ref.tone,
|
|
814
|
+
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
815
|
+
_ref$size = _ref.size,
|
|
816
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
817
|
+
_ref$disabled = _ref.disabled,
|
|
818
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
819
|
+
_ref$loading = _ref.loading,
|
|
820
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
821
|
+
tooltip = _ref.tooltip,
|
|
822
|
+
onClick = _ref.onClick,
|
|
823
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
824
|
+
children = _ref.children,
|
|
825
|
+
startIcon = _ref.startIcon,
|
|
826
|
+
endIcon = _ref.endIcon,
|
|
827
|
+
icon = _ref.icon,
|
|
828
|
+
props = _objectWithoutPropertiesLoose(_ref, ["as", "variant", "tone", "size", "disabled", "loading", "tooltip", "onClick", "exceptionallySetClassName", "children", "startIcon", "endIcon", "icon"]);
|
|
829
|
+
|
|
830
|
+
var isDisabled = loading || disabled;
|
|
831
|
+
var buttonElement = /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
832
|
+
as: as,
|
|
833
|
+
ref: ref,
|
|
834
|
+
"aria-disabled": isDisabled,
|
|
835
|
+
onClick: isDisabled ? preventDefault : onClick,
|
|
836
|
+
className: [exceptionallySetClassName, modules_b9569bce.baseButton, modules_b9569bce["variant-" + variant], modules_b9569bce["tone-" + tone], modules_b9569bce["size-" + size], icon ? modules_b9569bce.iconButton : null, disabled ? modules_b9569bce.disabled : null]
|
|
837
|
+
}), icon ? loading && /*#__PURE__*/React.createElement(Spinner, null) || icon : /*#__PURE__*/React.createElement(React.Fragment, null, startIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
838
|
+
display: "flex",
|
|
839
|
+
className: modules_b9569bce.startIcon,
|
|
840
|
+
"aria-hidden": true
|
|
841
|
+
}, loading && !endIcon ? /*#__PURE__*/React.createElement(Spinner, null) : startIcon) : null, children ? /*#__PURE__*/React.createElement("span", {
|
|
842
|
+
className: modules_b9569bce.label
|
|
843
|
+
}, children) : null, endIcon || loading && !startIcon ? /*#__PURE__*/React.createElement(Box, {
|
|
844
|
+
display: "flex",
|
|
845
|
+
className: modules_b9569bce.endIcon,
|
|
846
|
+
"aria-hidden": true
|
|
847
|
+
}, loading ? /*#__PURE__*/React.createElement(Spinner, null) : endIcon) : null)); // If it's an icon-only button, make sure it uses the aria-label as tooltip if no tooltip was provided
|
|
848
|
+
|
|
849
|
+
var tooltipContent = icon ? tooltip !== null && tooltip !== void 0 ? tooltip : props['aria-label'] : tooltip;
|
|
850
|
+
return tooltipContent ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
851
|
+
content: tooltipContent
|
|
852
|
+
}, buttonElement) : buttonElement;
|
|
853
|
+
});
|
|
854
|
+
|
|
855
|
+
/**
|
|
856
|
+
* A semantic button that also looks like a button, and provides all the necessary visual variants.
|
|
857
|
+
* It follows the [WAI-ARIA Button Pattern](https://www.w3.org/TR/wai-aria-practices/#button).
|
|
858
|
+
*
|
|
859
|
+
* 🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)
|
|
860
|
+
*
|
|
861
|
+
* @see ButtonLink
|
|
862
|
+
*/
|
|
863
|
+
|
|
864
|
+
var Button = /*#__PURE__*/React.forwardRef(function Button(_ref, ref) {
|
|
865
|
+
var variant = _ref.variant,
|
|
866
|
+
_ref$tone = _ref.tone,
|
|
867
|
+
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
868
|
+
_ref$size = _ref.size,
|
|
869
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
870
|
+
_ref$type = _ref.type,
|
|
871
|
+
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
872
|
+
_ref$disabled = _ref.disabled,
|
|
873
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
874
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
875
|
+
props = _objectWithoutPropertiesLoose(_ref, ["variant", "tone", "size", "type", "disabled", "exceptionallySetClassName"]);
|
|
876
|
+
|
|
877
|
+
return /*#__PURE__*/React.createElement(BaseButton, Object.assign({}, props, {
|
|
878
|
+
as: "button",
|
|
879
|
+
ref: ref,
|
|
880
|
+
variant: variant,
|
|
881
|
+
tone: tone,
|
|
882
|
+
size: size,
|
|
883
|
+
type: type,
|
|
884
|
+
disabled: disabled,
|
|
885
|
+
exceptionallySetClassName: exceptionallySetClassName
|
|
886
|
+
}));
|
|
887
|
+
});
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* A semantic link that looks like a button, exactly matching the `Button` component in all visual
|
|
891
|
+
* aspects.
|
|
892
|
+
*
|
|
893
|
+
*🎨 [Figma](https://www.figma.com/file/LYlWNzvhMDh907l07mPPQk/Product-Web?node-id=4693%3A175143)
|
|
894
|
+
*
|
|
895
|
+
* @see Button
|
|
896
|
+
*/
|
|
679
897
|
|
|
680
898
|
var ButtonLink = /*#__PURE__*/polymorphicComponent(function ButtonLink(_ref, ref) {
|
|
681
899
|
var _ref$as = _ref.as,
|
|
682
900
|
as = _ref$as === void 0 ? 'a' : _ref$as,
|
|
683
901
|
variant = _ref.variant,
|
|
902
|
+
_ref$tone = _ref.tone,
|
|
903
|
+
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
684
904
|
_ref$size = _ref.size,
|
|
685
|
-
size = _ref$size === void 0 ? '
|
|
905
|
+
size = _ref$size === void 0 ? 'normal' : _ref$size,
|
|
906
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
686
907
|
_ref$openInNewTab = _ref.openInNewTab,
|
|
687
908
|
openInNewTab = _ref$openInNewTab === void 0 ? false : _ref$openInNewTab,
|
|
688
|
-
|
|
689
|
-
props = _objectWithoutPropertiesLoose(_ref, ["as", "variant", "size", "openInNewTab", "exceptionallySetClassName"]);
|
|
909
|
+
props = _objectWithoutPropertiesLoose(_ref, ["as", "variant", "tone", "size", "exceptionallySetClassName", "openInNewTab"]);
|
|
690
910
|
|
|
691
|
-
return /*#__PURE__*/React.createElement(
|
|
911
|
+
return /*#__PURE__*/React.createElement(BaseButton, Object.assign({}, props, {
|
|
692
912
|
as: as,
|
|
693
|
-
display: "inlineFlex",
|
|
694
|
-
alignItems: "center",
|
|
695
|
-
justifyContent: "center",
|
|
696
|
-
className: [exceptionallySetClassName, modules_b0eaa640.container, 'reactist_button', variant ? "reactist_button--" + variant : null, size !== 'default' ? "reactist_button--" + size : null],
|
|
697
913
|
ref: ref,
|
|
914
|
+
variant: variant,
|
|
915
|
+
tone: tone,
|
|
916
|
+
size: size,
|
|
917
|
+
exceptionallySetClassName: exceptionallySetClassName,
|
|
698
918
|
target: openInNewTab ? '_blank' : undefined,
|
|
699
919
|
rel: openInNewTab ? 'noopener noreferrer' : undefined
|
|
700
920
|
}));
|
|
@@ -775,7 +995,7 @@ function CheckboxIcon(_ref2) {
|
|
|
775
995
|
}));
|
|
776
996
|
}
|
|
777
997
|
|
|
778
|
-
var modules_664a6a80 = {"container":"
|
|
998
|
+
var modules_664a6a80 = {"container":"f9e0a1b8","disabled":"_01411889","checked":"ffdfd8fb"};
|
|
779
999
|
|
|
780
1000
|
var CheckboxField = /*#__PURE__*/React.forwardRef(function CheckboxField(_ref, ref) {
|
|
781
1001
|
var _ref2, _props$checked, _props$checked2;
|
|
@@ -834,124 +1054,13 @@ var CheckboxField = /*#__PURE__*/React.forwardRef(function CheckboxField(_ref, r
|
|
|
834
1054
|
checked: isChecked,
|
|
835
1055
|
indeterminate: indeterminate,
|
|
836
1056
|
disabled: disabled
|
|
837
|
-
}), label ? /*#__PURE__*/React.createElement(
|
|
1057
|
+
}), label ? /*#__PURE__*/React.createElement(Text, null, label) : null);
|
|
838
1058
|
});
|
|
839
1059
|
|
|
840
|
-
var
|
|
841
|
-
var HIDE_DELAY = 100;
|
|
1060
|
+
var uid = 0;
|
|
842
1061
|
|
|
843
|
-
function
|
|
844
|
-
|
|
845
|
-
var delay = useDelay();
|
|
846
|
-
return React__default.useMemo(function () {
|
|
847
|
-
return _objectSpread2(_objectSpread2({}, tooltipState), {}, {
|
|
848
|
-
show: delay(function () {
|
|
849
|
-
return tooltipState.show();
|
|
850
|
-
}, SHOW_DELAY),
|
|
851
|
-
hide: delay(function () {
|
|
852
|
-
return tooltipState.hide();
|
|
853
|
-
}, HIDE_DELAY)
|
|
854
|
-
});
|
|
855
|
-
}, [delay, tooltipState]);
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
function Tooltip(_ref) {
|
|
859
|
-
var children = _ref.children,
|
|
860
|
-
content = _ref.content,
|
|
861
|
-
_ref$position = _ref.position,
|
|
862
|
-
position = _ref$position === void 0 ? 'top' : _ref$position,
|
|
863
|
-
_ref$gapSize = _ref.gapSize,
|
|
864
|
-
gapSize = _ref$gapSize === void 0 ? 3 : _ref$gapSize,
|
|
865
|
-
className = _ref.className,
|
|
866
|
-
props = _objectWithoutPropertiesLoose(_ref, ["children", "content", "position", "gapSize", "className"]);
|
|
867
|
-
|
|
868
|
-
var tooltip = useDelayedTooltipState({
|
|
869
|
-
placement: position,
|
|
870
|
-
gutter: gapSize
|
|
871
|
-
});
|
|
872
|
-
var child = React__default.Children.only(children);
|
|
873
|
-
|
|
874
|
-
if (!content) {
|
|
875
|
-
return child;
|
|
876
|
-
}
|
|
877
|
-
/**
|
|
878
|
-
* Prevents the tooltip from automatically firing on focus all the time. This is to prevent
|
|
879
|
-
* tooltips from showing when the trigger element is focused back after a popover or dialog that
|
|
880
|
-
* it opened was closed. See link below for more details.
|
|
881
|
-
* @see https://github.com/reakit/reakit/discussions/749
|
|
882
|
-
*/
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
function handleFocus(event) {
|
|
886
|
-
// If focus is not followed by a key up event, does it mean that it's not
|
|
887
|
-
// an intentional keyboard focus? Not sure but it seems to work.
|
|
888
|
-
// This may be resolved soon in an upcoming version of reakit:
|
|
889
|
-
// https://github.com/reakit/reakit/issues/750
|
|
890
|
-
function handleKeyUp(e) {
|
|
891
|
-
var eventKey = e.key;
|
|
892
|
-
|
|
893
|
-
if (eventKey !== 'Escape' && eventKey !== 'Enter' && eventKey !== 'Space') {
|
|
894
|
-
tooltip.show();
|
|
895
|
-
}
|
|
896
|
-
}
|
|
897
|
-
|
|
898
|
-
event.currentTarget.addEventListener('keyup', handleKeyUp, {
|
|
899
|
-
once: true
|
|
900
|
-
}); // Prevent tooltip.show from being called by TooltipReference
|
|
901
|
-
|
|
902
|
-
event.preventDefault(); // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
|
903
|
-
|
|
904
|
-
if (typeof child.props.onFocus === 'function') child.props.onFocus(event);
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Tooltip$1.TooltipReference, Object.assign({}, tooltip, {
|
|
908
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment
|
|
909
|
-
ref: child.ref
|
|
910
|
-
}, child.props, {
|
|
911
|
-
onFocus: handleFocus
|
|
912
|
-
}), function (referenceProps) {
|
|
913
|
-
return /*#__PURE__*/React__default.cloneElement(child, referenceProps);
|
|
914
|
-
}), tooltip.visible ? /*#__PURE__*/React__default.createElement(Tooltip$1.Tooltip, Object.assign({}, tooltip, props, {
|
|
915
|
-
className: classNames('reactist_tooltip', className)
|
|
916
|
-
}), typeof content === 'function' ? content() : content) : null);
|
|
917
|
-
}
|
|
918
|
-
// Internal helpers
|
|
919
|
-
//
|
|
920
|
-
|
|
921
|
-
/**
|
|
922
|
-
* Returns a function offering the same interface as setTimeout, but cleans up on unmount.
|
|
923
|
-
*
|
|
924
|
-
* The timeout state is shared, and only one delayed function can be active at any given time. If
|
|
925
|
-
* a new delayed function is called while another one was waiting for its time to run, that older
|
|
926
|
-
* invocation is cleared and it never runs.
|
|
927
|
-
*
|
|
928
|
-
* This is suitable for our use case here, but probably not the most intuitive thing in general.
|
|
929
|
-
* That's why this is not made a shared util or something like it.
|
|
930
|
-
*/
|
|
931
|
-
|
|
932
|
-
function useDelay() {
|
|
933
|
-
var timeoutRef = React__default.useRef();
|
|
934
|
-
var clearTimeouts = React__default.useCallback(function clearTimeouts() {
|
|
935
|
-
if (timeoutRef.current != null) {
|
|
936
|
-
clearTimeout(timeoutRef.current);
|
|
937
|
-
}
|
|
938
|
-
}, []); // Runs clearTimeouts when the component is unmounted
|
|
939
|
-
|
|
940
|
-
React__default.useEffect(function () {
|
|
941
|
-
return clearTimeouts;
|
|
942
|
-
}, [clearTimeouts]);
|
|
943
|
-
return React__default.useCallback(function delay(fn, delay) {
|
|
944
|
-
return function () {
|
|
945
|
-
clearTimeouts();
|
|
946
|
-
timeoutRef.current = setTimeout(fn, delay);
|
|
947
|
-
};
|
|
948
|
-
}, [clearTimeouts]);
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
var uid = 0;
|
|
952
|
-
|
|
953
|
-
function uniqueId() {
|
|
954
|
-
return uid++;
|
|
1062
|
+
function uniqueId() {
|
|
1063
|
+
return uid++;
|
|
955
1064
|
}
|
|
956
1065
|
|
|
957
1066
|
function generateElementId(prefix) {
|
|
@@ -968,7 +1077,7 @@ function useId(providedId) {
|
|
|
968
1077
|
return ref.current;
|
|
969
1078
|
}
|
|
970
1079
|
|
|
971
|
-
var modules_540a88ff = {"primaryLabel":"
|
|
1080
|
+
var modules_540a88ff = {"container":"ed7d894c","primaryLabel":"_22213081","secondaryLabel":"be8637dd","auxiliaryLabel":"_72b46ad5"};
|
|
972
1081
|
|
|
973
1082
|
function FieldHint(props) {
|
|
974
1083
|
return /*#__PURE__*/React.createElement(Text, Object.assign({
|
|
@@ -995,7 +1104,7 @@ function BaseField(_ref) {
|
|
|
995
1104
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
996
1105
|
space: "small"
|
|
997
1106
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
998
|
-
className: className,
|
|
1107
|
+
className: [className, modules_540a88ff.container],
|
|
999
1108
|
maxWidth: maxWidth,
|
|
1000
1109
|
hidden: hidden
|
|
1001
1110
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
@@ -1071,7 +1180,7 @@ function PasswordHiddenIcon(props) {
|
|
|
1071
1180
|
|
|
1072
1181
|
var modules_3f03ead6 = {"inputWrapper":"_460d581b"};
|
|
1073
1182
|
|
|
1074
|
-
var modules_aaf25250 = {"inputWrapper":"
|
|
1183
|
+
var modules_aaf25250 = {"inputWrapper":"dd9ffeab"};
|
|
1075
1184
|
|
|
1076
1185
|
var PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref, ref) {
|
|
1077
1186
|
var label = _ref.label,
|
|
@@ -1134,7 +1243,7 @@ var PasswordField = /*#__PURE__*/React.forwardRef(function PasswordField(_ref, r
|
|
|
1134
1243
|
});
|
|
1135
1244
|
});
|
|
1136
1245
|
|
|
1137
|
-
var modules_1fa9b208 = {"selectWrapper":"
|
|
1246
|
+
var modules_1fa9b208 = {"selectWrapper":"_828e09c5"};
|
|
1138
1247
|
|
|
1139
1248
|
var SelectField = /*#__PURE__*/React.forwardRef(function SelectField(_ref, ref) {
|
|
1140
1249
|
var id = _ref.id,
|
|
@@ -1180,7 +1289,7 @@ function SelectChevron(props) {
|
|
|
1180
1289
|
}));
|
|
1181
1290
|
}
|
|
1182
1291
|
|
|
1183
|
-
var modules_8e05f7c9 = {"container":"
|
|
1292
|
+
var modules_8e05f7c9 = {"container":"_99a80509","disabled":"b5cf26ef","checked":"a63c43a2","toggle":"f318ae83","label":"_427926b9","handle":"_9fcd994c"};
|
|
1184
1293
|
|
|
1185
1294
|
var SwitchField = /*#__PURE__*/React.forwardRef(function SwitchField(_ref, ref) {
|
|
1186
1295
|
var _ref2, _props$checked, _props$checked2;
|
|
@@ -1236,14 +1345,14 @@ var SwitchField = /*#__PURE__*/React.forwardRef(function SwitchField(_ref, ref)
|
|
|
1236
1345
|
}
|
|
1237
1346
|
}))), /*#__PURE__*/React.createElement("span", {
|
|
1238
1347
|
className: modules_8e05f7c9.handle
|
|
1239
|
-
})), /*#__PURE__*/React.createElement(
|
|
1240
|
-
|
|
1348
|
+
})), /*#__PURE__*/React.createElement(Text, {
|
|
1349
|
+
exceptionallySetClassName: modules_8e05f7c9.label
|
|
1241
1350
|
}, label)), hint ? /*#__PURE__*/React.createElement(FieldHint, {
|
|
1242
1351
|
id: hintId
|
|
1243
1352
|
}, hint) : null);
|
|
1244
1353
|
});
|
|
1245
1354
|
|
|
1246
|
-
var modules_2728c236 = {"container":"
|
|
1355
|
+
var modules_2728c236 = {"container":"_5a579f96"};
|
|
1247
1356
|
|
|
1248
1357
|
function TextArea(_ref) {
|
|
1249
1358
|
var id = _ref.id,
|
|
@@ -1323,7 +1432,7 @@ function usePrevious(value) {
|
|
|
1323
1432
|
return ref.current;
|
|
1324
1433
|
}
|
|
1325
1434
|
|
|
1326
|
-
var modules_40c67f5b = {"tab":"
|
|
1435
|
+
var modules_40c67f5b = {"tab":"_7cdcd0b6","tab-normal":"af6705d0","tab-primary":"ad705020","tab-secondary":"_69a2043b","tab-tertiary":"_5b695667","tab-plain":"_88d3dc5e"};
|
|
1327
1436
|
|
|
1328
1437
|
var TabsContext = /*#__PURE__*/React.createContext(null);
|
|
1329
1438
|
/**
|
|
@@ -1365,7 +1474,6 @@ function Tabs(_ref) {
|
|
|
1365
1474
|
* Represents the individual tab elements within the group. Each `<Tab>` must have a corresponding `<TabPanel>` component.
|
|
1366
1475
|
*/
|
|
1367
1476
|
|
|
1368
|
-
|
|
1369
1477
|
function Tab(_ref2) {
|
|
1370
1478
|
var children = _ref2.children,
|
|
1371
1479
|
id = _ref2.id;
|
|
@@ -1388,7 +1496,6 @@ function Tab(_ref2) {
|
|
|
1388
1496
|
* A component used to group `<Tab>` elements together.
|
|
1389
1497
|
*/
|
|
1390
1498
|
|
|
1391
|
-
|
|
1392
1499
|
function TabList(_ref3) {
|
|
1393
1500
|
var children = _ref3.children,
|
|
1394
1501
|
_ref3$space = _ref3.space,
|
|
@@ -1411,12 +1518,14 @@ function TabList(_ref3) {
|
|
|
1411
1518
|
* Used to define the content to be rendered when a tab is active. Each `<TabPanel>` must have a corresponding `<Tab>` component.
|
|
1412
1519
|
*/
|
|
1413
1520
|
|
|
1414
|
-
|
|
1415
|
-
function TabPanel(_ref4) {
|
|
1521
|
+
var TabPanel = /*#__PURE__*/polymorphicComponent(function TabPanel(_ref4, ref) {
|
|
1416
1522
|
var children = _ref4.children,
|
|
1417
1523
|
id = _ref4.id,
|
|
1524
|
+
as = _ref4.as,
|
|
1418
1525
|
_ref4$render = _ref4.render,
|
|
1419
|
-
render = _ref4$render === void 0 ? 'always' : _ref4$render
|
|
1526
|
+
render = _ref4$render === void 0 ? 'always' : _ref4$render,
|
|
1527
|
+
props = _objectWithoutPropertiesLoose(_ref4, ["children", "id", "as", "render"]);
|
|
1528
|
+
|
|
1420
1529
|
var tabContextValue = React.useContext(TabsContext);
|
|
1421
1530
|
|
|
1422
1531
|
var _React$useState = React.useState(false),
|
|
@@ -1438,14 +1547,16 @@ function TabPanel(_ref4) {
|
|
|
1438
1547
|
|
|
1439
1548
|
return /*#__PURE__*/React.createElement(Tab$1.TabPanel, Object.assign({
|
|
1440
1549
|
tabId: id
|
|
1441
|
-
}, tabState
|
|
1442
|
-
|
|
1550
|
+
}, tabState, props, {
|
|
1551
|
+
as: as,
|
|
1552
|
+
ref: ref
|
|
1553
|
+
}), render === 'always' ? children : null, render === 'active' && tabIsActive ? children : null, render === 'lazy' && (tabIsActive || tabRendered) ? children : null);
|
|
1554
|
+
});
|
|
1443
1555
|
/**
|
|
1444
1556
|
* Allows content to be rendered based on the current tab being selected while outside of the TabPanel
|
|
1445
1557
|
* component. Can be placed freely within the main `<Tabs>` component.
|
|
1446
1558
|
*/
|
|
1447
1559
|
|
|
1448
|
-
|
|
1449
1560
|
function TabAwareSlot(_ref5) {
|
|
1450
1561
|
var children = _ref5.children;
|
|
1451
1562
|
var tabContextValue = React.useContext(TabsContext);
|
|
@@ -1454,6 +1565,194 @@ function TabAwareSlot(_ref5) {
|
|
|
1454
1565
|
}) : null;
|
|
1455
1566
|
}
|
|
1456
1567
|
|
|
1568
|
+
var modules_8f59d13b = {"reach-portal":"_72b0d072","fadein":"_3ef30abf","fitContent":"_99107d2f","container":"badff007","medium":"_3b39110c","small":"fc325d7b","large":"_5751d6d0","overlay":"_0091d9c5","expand":"_52207af6","buttonContainer":"b97b958d"};
|
|
1569
|
+
|
|
1570
|
+
var ModalContext = /*#__PURE__*/React.createContext({
|
|
1571
|
+
onDismiss: undefined,
|
|
1572
|
+
height: 'fitContent'
|
|
1573
|
+
});
|
|
1574
|
+
|
|
1575
|
+
function isNotInternalFrame(element) {
|
|
1576
|
+
return !(element.ownerDocument === document && element.tagName.toLowerCase() === 'iframe');
|
|
1577
|
+
}
|
|
1578
|
+
/**
|
|
1579
|
+
* Renders a modal that sits on top of the rest of the content in the entire page.
|
|
1580
|
+
*
|
|
1581
|
+
* Follows the WAI-ARIA Dialog (Modal) Pattern.
|
|
1582
|
+
*
|
|
1583
|
+
* @see ModalHeader
|
|
1584
|
+
* @see ModalFooter
|
|
1585
|
+
* @see ModalBody
|
|
1586
|
+
*/
|
|
1587
|
+
|
|
1588
|
+
|
|
1589
|
+
function Modal(_ref) {
|
|
1590
|
+
var isOpen = _ref.isOpen,
|
|
1591
|
+
onDismiss = _ref.onDismiss,
|
|
1592
|
+
_ref$height = _ref.height,
|
|
1593
|
+
height = _ref$height === void 0 ? 'fitContent' : _ref$height,
|
|
1594
|
+
_ref$width = _ref.width,
|
|
1595
|
+
width = _ref$width === void 0 ? 'medium' : _ref$width,
|
|
1596
|
+
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
1597
|
+
_ref$autoFocus = _ref.autoFocus,
|
|
1598
|
+
autoFocus = _ref$autoFocus === void 0 ? true : _ref$autoFocus,
|
|
1599
|
+
children = _ref.children,
|
|
1600
|
+
props = _objectWithoutPropertiesLoose(_ref, ["isOpen", "onDismiss", "height", "width", "exceptionallySetClassName", "autoFocus", "children"]);
|
|
1601
|
+
|
|
1602
|
+
var contextValue = React.useMemo(function () {
|
|
1603
|
+
return {
|
|
1604
|
+
onDismiss: onDismiss,
|
|
1605
|
+
height: height
|
|
1606
|
+
};
|
|
1607
|
+
}, [onDismiss, height]);
|
|
1608
|
+
return /*#__PURE__*/React.createElement(dialog.DialogOverlay, {
|
|
1609
|
+
isOpen: isOpen,
|
|
1610
|
+
onDismiss: onDismiss,
|
|
1611
|
+
dangerouslyBypassFocusLock // We're setting up our own focus lock below
|
|
1612
|
+
: true,
|
|
1613
|
+
className: classNames(modules_8f59d13b.overlay, modules_8f59d13b[height], modules_8f59d13b[width]),
|
|
1614
|
+
"data-testid": "modal-overlay"
|
|
1615
|
+
}, /*#__PURE__*/React.createElement(FocusLock, {
|
|
1616
|
+
autoFocus: autoFocus,
|
|
1617
|
+
whiteList: isNotInternalFrame
|
|
1618
|
+
}, /*#__PURE__*/React.createElement(dialog.DialogContent, Object.assign({}, props, {
|
|
1619
|
+
as: Box,
|
|
1620
|
+
borderRadius: "full",
|
|
1621
|
+
background: "default",
|
|
1622
|
+
display: "flex",
|
|
1623
|
+
flexDirection: "column",
|
|
1624
|
+
overflow: "hidden",
|
|
1625
|
+
height: height === 'expand' ? 'full' : undefined,
|
|
1626
|
+
flexGrow: height === 'expand' ? 1 : 0,
|
|
1627
|
+
className: [exceptionallySetClassName, modules_8f59d13b.container]
|
|
1628
|
+
}), /*#__PURE__*/React.createElement(ModalContext.Provider, {
|
|
1629
|
+
value: contextValue
|
|
1630
|
+
}, children))));
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* The close button rendered by ModalHeader. Provided independently so that consumers can customize
|
|
1634
|
+
* the button's label.
|
|
1635
|
+
*
|
|
1636
|
+
* @see ModalHeader
|
|
1637
|
+
*/
|
|
1638
|
+
|
|
1639
|
+
function ModalCloseButton(props) {
|
|
1640
|
+
var _React$useContext = React.useContext(ModalContext),
|
|
1641
|
+
onDismiss = _React$useContext.onDismiss;
|
|
1642
|
+
|
|
1643
|
+
return /*#__PURE__*/React.createElement(Button, Object.assign({}, props, {
|
|
1644
|
+
variant: "quaternary",
|
|
1645
|
+
onClick: onDismiss,
|
|
1646
|
+
icon: /*#__PURE__*/React.createElement(CloseIcon, null)
|
|
1647
|
+
}));
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* Renders a standard modal header area with an optional close button.
|
|
1651
|
+
*
|
|
1652
|
+
* @see Modal
|
|
1653
|
+
* @see ModalFooter
|
|
1654
|
+
* @see ModalBody
|
|
1655
|
+
*/
|
|
1656
|
+
|
|
1657
|
+
function ModalHeader(_ref2) {
|
|
1658
|
+
var children = _ref2.children,
|
|
1659
|
+
_ref2$button = _ref2.button,
|
|
1660
|
+
button = _ref2$button === void 0 ? true : _ref2$button,
|
|
1661
|
+
_ref2$withDivider = _ref2.withDivider,
|
|
1662
|
+
withDivider = _ref2$withDivider === void 0 ? false : _ref2$withDivider,
|
|
1663
|
+
exceptionallySetClassName = _ref2.exceptionallySetClassName,
|
|
1664
|
+
props = _objectWithoutPropertiesLoose(_ref2, ["children", "button", "withDivider", "exceptionallySetClassName"]);
|
|
1665
|
+
|
|
1666
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
1667
|
+
as: "header",
|
|
1668
|
+
paddingLeft: "large",
|
|
1669
|
+
paddingRight: "small",
|
|
1670
|
+
paddingY: "small",
|
|
1671
|
+
className: exceptionallySetClassName
|
|
1672
|
+
}), /*#__PURE__*/React.createElement(Columns, {
|
|
1673
|
+
space: "large",
|
|
1674
|
+
alignY: "center"
|
|
1675
|
+
}, /*#__PURE__*/React.createElement(Column, {
|
|
1676
|
+
width: "auto"
|
|
1677
|
+
}, children), /*#__PURE__*/React.createElement(Column, {
|
|
1678
|
+
width: "content",
|
|
1679
|
+
exceptionallySetClassName: modules_8f59d13b.buttonContainer
|
|
1680
|
+
}, typeof button !== 'boolean' ? button : button === true ? /*#__PURE__*/React.createElement(ModalCloseButton, {
|
|
1681
|
+
"aria-label": "Close modal"
|
|
1682
|
+
}) : null))), withDivider ? /*#__PURE__*/React.createElement(Divider, null) : null);
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Renders the body of a modal.
|
|
1686
|
+
*
|
|
1687
|
+
* Convenient to use alongside ModalHeader and/or ModalFooter as needed. It ensures, among other
|
|
1688
|
+
* things, that the contet of the modal body expands or contracts depending on the modal height
|
|
1689
|
+
* setting or the size of the content. The body content also automatically scrolls when it's too
|
|
1690
|
+
* large to fit the available space.
|
|
1691
|
+
*
|
|
1692
|
+
* @see Modal
|
|
1693
|
+
* @see ModalHeader
|
|
1694
|
+
* @see ModalFooter
|
|
1695
|
+
*/
|
|
1696
|
+
|
|
1697
|
+
function ModalBody(_ref3) {
|
|
1698
|
+
var exceptionallySetClassName = _ref3.exceptionallySetClassName,
|
|
1699
|
+
children = _ref3.children,
|
|
1700
|
+
props = _objectWithoutPropertiesLoose(_ref3, ["exceptionallySetClassName", "children"]);
|
|
1701
|
+
|
|
1702
|
+
var _React$useContext2 = React.useContext(ModalContext),
|
|
1703
|
+
height = _React$useContext2.height;
|
|
1704
|
+
|
|
1705
|
+
return /*#__PURE__*/React.createElement(Box, Object.assign({}, props, {
|
|
1706
|
+
className: exceptionallySetClassName,
|
|
1707
|
+
flexGrow: height === 'expand' ? 1 : 0,
|
|
1708
|
+
height: height === 'expand' ? 'full' : undefined,
|
|
1709
|
+
overflow: "auto"
|
|
1710
|
+
}), /*#__PURE__*/React.createElement(Box, {
|
|
1711
|
+
padding: "large",
|
|
1712
|
+
paddingBottom: "xxlarge"
|
|
1713
|
+
}, children));
|
|
1714
|
+
}
|
|
1715
|
+
/**
|
|
1716
|
+
* Renders a standard modal footer area.
|
|
1717
|
+
*
|
|
1718
|
+
* @see Modal
|
|
1719
|
+
* @see ModalHeader
|
|
1720
|
+
* @see ModalBody
|
|
1721
|
+
*/
|
|
1722
|
+
|
|
1723
|
+
function ModalFooter(_ref4) {
|
|
1724
|
+
var exceptionallySetClassName = _ref4.exceptionallySetClassName,
|
|
1725
|
+
_ref4$withDivider = _ref4.withDivider,
|
|
1726
|
+
withDivider = _ref4$withDivider === void 0 ? false : _ref4$withDivider,
|
|
1727
|
+
props = _objectWithoutPropertiesLoose(_ref4, ["exceptionallySetClassName", "withDivider"]);
|
|
1728
|
+
|
|
1729
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, withDivider ? /*#__PURE__*/React.createElement(Divider, null) : null, /*#__PURE__*/React.createElement(Box, Object.assign({
|
|
1730
|
+
as: "footer"
|
|
1731
|
+
}, props, {
|
|
1732
|
+
className: exceptionallySetClassName,
|
|
1733
|
+
padding: "large"
|
|
1734
|
+
})));
|
|
1735
|
+
} //
|
|
1736
|
+
// ModalActions
|
|
1737
|
+
//
|
|
1738
|
+
|
|
1739
|
+
/**
|
|
1740
|
+
* A specific version of the ModalFooter, tailored to showing an inline list of actions (buttons).
|
|
1741
|
+
* @see ModalFooter
|
|
1742
|
+
*/
|
|
1743
|
+
|
|
1744
|
+
function ModalActions(_ref5) {
|
|
1745
|
+
var children = _ref5.children,
|
|
1746
|
+
props = _objectWithoutPropertiesLoose(_ref5, ["children"]);
|
|
1747
|
+
|
|
1748
|
+
return /*#__PURE__*/React.createElement(ModalFooter, Object.assign({}, props), /*#__PURE__*/React.createElement(Inline, {
|
|
1749
|
+
align: "right",
|
|
1750
|
+
space: "large"
|
|
1751
|
+
}, React.Children.map(children, function (child) {
|
|
1752
|
+
return /*#__PURE__*/React.createElement("div", null, child);
|
|
1753
|
+
})));
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1457
1756
|
function getInitials(name) {
|
|
1458
1757
|
if (!name) {
|
|
1459
1758
|
return '';
|
|
@@ -1506,7 +1805,33 @@ function Avatar(_ref) {
|
|
|
1506
1805
|
|
|
1507
1806
|
Avatar.displayName = 'Avatar';
|
|
1508
1807
|
|
|
1509
|
-
|
|
1808
|
+
function Checkbox(_ref) {
|
|
1809
|
+
var label = _ref.label,
|
|
1810
|
+
disabled = _ref.disabled,
|
|
1811
|
+
_ref$checked = _ref.checked,
|
|
1812
|
+
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
1813
|
+
onChange = _ref.onChange;
|
|
1814
|
+
return /*#__PURE__*/React__default.createElement("label", {
|
|
1815
|
+
className: "reactist_checkbox"
|
|
1816
|
+
}, /*#__PURE__*/React__default.createElement("input", {
|
|
1817
|
+
className: "reactist_checkbox--input",
|
|
1818
|
+
value: label,
|
|
1819
|
+
checked: checked,
|
|
1820
|
+
disabled: disabled,
|
|
1821
|
+
onChange: disabled || !onChange ? undefined : function (event) {
|
|
1822
|
+
return onChange(event.target.checked);
|
|
1823
|
+
},
|
|
1824
|
+
type: "checkbox"
|
|
1825
|
+
}), label);
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
Checkbox.displayName = 'Checkbox';
|
|
1829
|
+
|
|
1830
|
+
/**
|
|
1831
|
+
* @deprecated
|
|
1832
|
+
*/
|
|
1833
|
+
|
|
1834
|
+
var Button$1 = /*#__PURE__*/React__default.forwardRef(function Button(_ref, ref) {
|
|
1510
1835
|
var _ref$type = _ref.type,
|
|
1511
1836
|
type = _ref$type === void 0 ? 'button' : _ref$type,
|
|
1512
1837
|
variant = _ref.variant,
|
|
@@ -1535,35 +1860,13 @@ var Button = /*#__PURE__*/React__default.forwardRef(function Button(_ref, ref) {
|
|
|
1535
1860
|
content: tooltip
|
|
1536
1861
|
}, button) : button;
|
|
1537
1862
|
});
|
|
1538
|
-
Button.displayName = 'Button';
|
|
1539
|
-
Button.defaultProps = {
|
|
1863
|
+
Button$1.displayName = 'Button';
|
|
1864
|
+
Button$1.defaultProps = {
|
|
1540
1865
|
size: 'default',
|
|
1541
1866
|
loading: false,
|
|
1542
1867
|
disabled: false
|
|
1543
1868
|
};
|
|
1544
1869
|
|
|
1545
|
-
function Checkbox(_ref) {
|
|
1546
|
-
var label = _ref.label,
|
|
1547
|
-
disabled = _ref.disabled,
|
|
1548
|
-
_ref$checked = _ref.checked,
|
|
1549
|
-
checked = _ref$checked === void 0 ? false : _ref$checked,
|
|
1550
|
-
onChange = _ref.onChange;
|
|
1551
|
-
return /*#__PURE__*/React__default.createElement("label", {
|
|
1552
|
-
className: "reactist_checkbox"
|
|
1553
|
-
}, /*#__PURE__*/React__default.createElement("input", {
|
|
1554
|
-
className: "reactist_checkbox--input",
|
|
1555
|
-
value: label,
|
|
1556
|
-
checked: checked,
|
|
1557
|
-
disabled: disabled,
|
|
1558
|
-
onChange: disabled || !onChange ? undefined : function (event) {
|
|
1559
|
-
return onChange(event.target.checked);
|
|
1560
|
-
},
|
|
1561
|
-
type: "checkbox"
|
|
1562
|
-
}), label);
|
|
1563
|
-
}
|
|
1564
|
-
|
|
1565
|
-
Checkbox.displayName = 'Checkbox';
|
|
1566
|
-
|
|
1567
1870
|
var Box$1 = /*#__PURE__*/function (_React$Component) {
|
|
1568
1871
|
_inheritsLoose(Box, _React$Component);
|
|
1569
1872
|
|
|
@@ -1722,7 +2025,7 @@ var Trigger = /*#__PURE__*/React__default.forwardRef(function Trigger(_ref, ref)
|
|
|
1722
2025
|
if (onClick) onClick(event);
|
|
1723
2026
|
}
|
|
1724
2027
|
|
|
1725
|
-
return /*#__PURE__*/React__default.createElement(Button, Object.assign({}, props, {
|
|
2028
|
+
return /*#__PURE__*/React__default.createElement(Button$1, Object.assign({}, props, {
|
|
1726
2029
|
className: classNames('trigger', className),
|
|
1727
2030
|
onClick: handleClick,
|
|
1728
2031
|
tooltip: tooltip,
|
|
@@ -2339,299 +2642,19 @@ function KeyCapturer(props) {
|
|
|
2339
2642
|
return /*#__PURE__*/React__default.cloneElement(children, _objectSpread2((_objectSpread2$1 = {}, _objectSpread2$1[eventName] = handleKeyEvent, _objectSpread2$1), composingEventHandlers));
|
|
2340
2643
|
}
|
|
2341
2644
|
|
|
2342
|
-
function
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
_ref$bgColor = _ref.bgColor,
|
|
2347
|
-
bgColor = _ref$bgColor === void 0 ? '#D9E6FB' : _ref$bgColor,
|
|
2348
|
-
_ref$size = _ref.size,
|
|
2349
|
-
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
2350
|
-
_ref$ariaLabel = _ref['aria-label'],
|
|
2351
|
-
ariaLabel = _ref$ariaLabel === void 0 ? 'Loading' : _ref$ariaLabel;
|
|
2352
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
2353
|
-
className: classNames('reactist_loading', className),
|
|
2354
|
-
"aria-label": ariaLabel,
|
|
2355
|
-
"aria-live": "assertive",
|
|
2356
|
-
role: "alert"
|
|
2357
|
-
}, /*#__PURE__*/React__default.createElement("span", {
|
|
2358
|
-
className: "reactist_loading--spinner"
|
|
2359
|
-
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
2360
|
-
width: size,
|
|
2361
|
-
height: size,
|
|
2362
|
-
viewBox: '0 0 24 24'
|
|
2363
|
-
}, /*#__PURE__*/React__default.createElement("g", {
|
|
2364
|
-
fill: "none",
|
|
2365
|
-
fillRule: "nonzero"
|
|
2366
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
2367
|
-
fill: spinnerColor,
|
|
2368
|
-
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
2369
|
-
}), /*#__PURE__*/React__default.createElement("path", {
|
|
2370
|
-
fill: bgColor,
|
|
2371
|
-
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
2372
|
-
})))));
|
|
2373
|
-
}
|
|
2645
|
+
var hasEnoughSpace = function hasEnoughSpace(windowDimensions, elementDimensions, wrapperDimensions, wrapperPosition, position, gap) {
|
|
2646
|
+
if (gap === void 0) {
|
|
2647
|
+
gap = 0;
|
|
2648
|
+
}
|
|
2374
2649
|
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
var
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
fill: "gray",
|
|
2384
|
-
fillRule: "evenodd",
|
|
2385
|
-
d: "M11.293 12L5.146 5.854a.5.5 0 1 1 .708-.708L12 11.293l6.146-6.147a.5.5 0 0 1 .708.708L12.707 12l6.147 6.146a.5.5 0 0 1-.708.708L12 12.707l-6.146 6.147a.5.5 0 0 1-.708-.708L11.293 12z"
|
|
2386
|
-
}));
|
|
2387
|
-
};
|
|
2388
|
-
|
|
2389
|
-
var Box$2 = /*#__PURE__*/function (_React$Component) {
|
|
2390
|
-
_inheritsLoose(Box, _React$Component);
|
|
2391
|
-
|
|
2392
|
-
function Box() {
|
|
2393
|
-
var _this;
|
|
2394
|
-
|
|
2395
|
-
_this = _React$Component.apply(this, arguments) || this;
|
|
2396
|
-
|
|
2397
|
-
_this._closeModal = function () {
|
|
2398
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2399
|
-
var modalElement = document.getElementById('modal_box');
|
|
2400
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
2401
|
-
};
|
|
2402
|
-
|
|
2403
|
-
_this._handleKeyDown = function (event) {
|
|
2404
|
-
if (event.keyCode === 27) {
|
|
2405
|
-
// ESC
|
|
2406
|
-
_this._closeModal();
|
|
2407
|
-
|
|
2408
|
-
if (event.preventDefault) event.preventDefault();
|
|
2409
|
-
}
|
|
2410
|
-
};
|
|
2411
|
-
|
|
2412
|
-
_this._handleOverlayClick = function (event) {
|
|
2413
|
-
if (event.target instanceof Element && (event.target.id === 'reactist-overlay' || event.target.id === 'reactist-overlay-inner')) {
|
|
2414
|
-
_this._closeModal();
|
|
2415
|
-
}
|
|
2416
|
-
};
|
|
2417
|
-
|
|
2418
|
-
return _this;
|
|
2419
|
-
}
|
|
2420
|
-
|
|
2421
|
-
var _proto = Box.prototype;
|
|
2422
|
-
|
|
2423
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
2424
|
-
window.addEventListener('keydown', this._handleKeyDown);
|
|
2425
|
-
};
|
|
2426
|
-
|
|
2427
|
-
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
2428
|
-
window.removeEventListener('keydown', this._handleKeyDown);
|
|
2429
|
-
};
|
|
2430
|
-
|
|
2431
|
-
_proto.render = function render() {
|
|
2432
|
-
var _this$props = this.props,
|
|
2433
|
-
large = _this$props.large,
|
|
2434
|
-
medium = _this$props.medium,
|
|
2435
|
-
style = _this$props.style,
|
|
2436
|
-
children = _this$props.children,
|
|
2437
|
-
closeOnOverlayClick = _this$props.closeOnOverlayClick;
|
|
2438
|
-
var className = classNames('reactist_modal_box', {
|
|
2439
|
-
large: large,
|
|
2440
|
-
medium: medium
|
|
2441
|
-
}, this.props.className);
|
|
2442
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
2443
|
-
className: "reactist_overlay",
|
|
2444
|
-
id: "reactist-overlay",
|
|
2445
|
-
onClick: closeOnOverlayClick ? this._handleOverlayClick : undefined
|
|
2446
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2447
|
-
className: "reactist_overlay_inner",
|
|
2448
|
-
id: "reactist-overlay-inner"
|
|
2449
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2450
|
-
style: style,
|
|
2451
|
-
className: className
|
|
2452
|
-
}, children)));
|
|
2453
|
-
};
|
|
2454
|
-
|
|
2455
|
-
return Box;
|
|
2456
|
-
}(React__default.Component);
|
|
2457
|
-
|
|
2458
|
-
Box$2.displayName = 'Modal.Box';
|
|
2459
|
-
Box$2.defaultProps = {
|
|
2460
|
-
large: false,
|
|
2461
|
-
closeOnOverlayClick: false
|
|
2462
|
-
};
|
|
2463
|
-
|
|
2464
|
-
var Header = /*#__PURE__*/function (_React$Component2) {
|
|
2465
|
-
_inheritsLoose(Header, _React$Component2);
|
|
2466
|
-
|
|
2467
|
-
function Header() {
|
|
2468
|
-
return _React$Component2.apply(this, arguments) || this;
|
|
2469
|
-
}
|
|
2470
|
-
|
|
2471
|
-
var _proto2 = Header.prototype;
|
|
2472
|
-
|
|
2473
|
-
_proto2._closeModal = function _closeModal(event) {
|
|
2474
|
-
event.preventDefault();
|
|
2475
|
-
|
|
2476
|
-
if (typeof this.props.beforeClose === 'function') {
|
|
2477
|
-
this.props.beforeClose();
|
|
2478
|
-
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
var modalElement = document.getElementById('modal_box');
|
|
2482
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
2483
|
-
};
|
|
2484
|
-
|
|
2485
|
-
_proto2.render = function render() {
|
|
2486
|
-
return (
|
|
2487
|
-
/*#__PURE__*/
|
|
2488
|
-
|
|
2489
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2490
|
-
React__default.createElement("div", {
|
|
2491
|
-
className: "reactist_modal_box__header"
|
|
2492
|
-
}, /*#__PURE__*/React__default.createElement("p", null, this.props.title && /*#__PURE__*/React__default.createElement("span", {
|
|
2493
|
-
className: "title"
|
|
2494
|
-
}, this.props.title), this.props.subtitle && /*#__PURE__*/React__default.createElement("span", {
|
|
2495
|
-
className: "subtitle"
|
|
2496
|
-
}, this.props.subtitle), this.props.children), /*#__PURE__*/React__default.createElement("a", {
|
|
2497
|
-
className: "close",
|
|
2498
|
-
onClick: this._closeModal.bind(this),
|
|
2499
|
-
href: "#"
|
|
2500
|
-
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)))
|
|
2501
|
-
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
2502
|
-
|
|
2503
|
-
);
|
|
2504
|
-
};
|
|
2505
|
-
|
|
2506
|
-
return Header;
|
|
2507
|
-
}(React__default.Component);
|
|
2508
|
-
|
|
2509
|
-
Header.displayName = 'Modal.Header';
|
|
2510
|
-
|
|
2511
|
-
var Body$1 = /*#__PURE__*/function (_React$Component3) {
|
|
2512
|
-
_inheritsLoose(Body, _React$Component3);
|
|
2513
|
-
|
|
2514
|
-
function Body() {
|
|
2515
|
-
return _React$Component3.apply(this, arguments) || this;
|
|
2516
|
-
}
|
|
2517
|
-
|
|
2518
|
-
var _proto3 = Body.prototype;
|
|
2519
|
-
|
|
2520
|
-
_proto3._closeModal = function _closeModal(event) {
|
|
2521
|
-
event.preventDefault(); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2522
|
-
|
|
2523
|
-
var modalElement = document.getElementById('modal_box');
|
|
2524
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
2525
|
-
};
|
|
2526
|
-
|
|
2527
|
-
_proto3.render = function render() {
|
|
2528
|
-
var _this$props2 = this.props,
|
|
2529
|
-
icon = _this$props2.icon,
|
|
2530
|
-
plain = _this$props2.plain,
|
|
2531
|
-
children = _this$props2.children,
|
|
2532
|
-
style = _this$props2.style,
|
|
2533
|
-
showCloseIcon = _this$props2.showCloseIcon;
|
|
2534
|
-
var className = classNames('reactist_modal_box__body', {
|
|
2535
|
-
plain: plain
|
|
2536
|
-
}, this.props.className);
|
|
2537
|
-
return (
|
|
2538
|
-
/*#__PURE__*/
|
|
2539
|
-
|
|
2540
|
-
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
2541
|
-
React__default.createElement("div", {
|
|
2542
|
-
className: className,
|
|
2543
|
-
style: style
|
|
2544
|
-
}, showCloseIcon && /*#__PURE__*/React__default.createElement("a", {
|
|
2545
|
-
className: "close",
|
|
2546
|
-
onClick: this._closeModal.bind(this),
|
|
2547
|
-
href: "#"
|
|
2548
|
-
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)), icon ? /*#__PURE__*/React__default.createElement("div", {
|
|
2549
|
-
className: "dialog"
|
|
2550
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
2551
|
-
className: "reactist_icon"
|
|
2552
|
-
}, icon), /*#__PURE__*/React__default.createElement("div", {
|
|
2553
|
-
className: "content"
|
|
2554
|
-
}, children)) : children)
|
|
2555
|
-
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
2556
|
-
|
|
2557
|
-
);
|
|
2558
|
-
};
|
|
2559
|
-
|
|
2560
|
-
return Body;
|
|
2561
|
-
}(React__default.Component);
|
|
2562
|
-
|
|
2563
|
-
Body$1.displayName = 'Modal.Body';
|
|
2564
|
-
Body$1.defaultProps = {
|
|
2565
|
-
showCloseIcon: false
|
|
2566
|
-
};
|
|
2567
|
-
|
|
2568
|
-
var Actions = /*#__PURE__*/function (_React$Component4) {
|
|
2569
|
-
_inheritsLoose(Actions, _React$Component4);
|
|
2570
|
-
|
|
2571
|
-
function Actions() {
|
|
2572
|
-
return _React$Component4.apply(this, arguments) || this;
|
|
2573
|
-
}
|
|
2574
|
-
|
|
2575
|
-
var _proto4 = Actions.prototype;
|
|
2576
|
-
|
|
2577
|
-
_proto4._onClick = function _onClick(onClick) {
|
|
2578
|
-
if (onClick) {
|
|
2579
|
-
onClick();
|
|
2580
|
-
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
var modalElement = document.getElementById('modal_box');
|
|
2584
|
-
ReactDOM.unmountComponentAtNode(modalElement);
|
|
2585
|
-
};
|
|
2586
|
-
|
|
2587
|
-
_proto4.render = function render() {
|
|
2588
|
-
var _this2 = this;
|
|
2589
|
-
|
|
2590
|
-
var children = React__default.Children.map( // see: https://github.com/microsoft/TypeScript/issues/21699
|
|
2591
|
-
// @ts-expect-error Children cannot be typed properly yet in React
|
|
2592
|
-
this.props.children, function (child) {
|
|
2593
|
-
var _child$props;
|
|
2594
|
-
|
|
2595
|
-
if (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.close) {
|
|
2596
|
-
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
2597
|
-
onClick: function onClick() {
|
|
2598
|
-
return _this2._onClick(child.props.onClick);
|
|
2599
|
-
}
|
|
2600
|
-
});
|
|
2601
|
-
} else {
|
|
2602
|
-
return child ? /*#__PURE__*/React__default.cloneElement(child) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
2603
|
-
}
|
|
2604
|
-
});
|
|
2605
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
2606
|
-
className: "reactist_modal_box__actions"
|
|
2607
|
-
}, children);
|
|
2608
|
-
};
|
|
2609
|
-
|
|
2610
|
-
return Actions;
|
|
2611
|
-
}(React__default.Component);
|
|
2612
|
-
|
|
2613
|
-
Actions.displayName = 'Modal.Actions';
|
|
2614
|
-
|
|
2615
|
-
var index = {
|
|
2616
|
-
Box: Box$2,
|
|
2617
|
-
Header: Header,
|
|
2618
|
-
Body: Body$1,
|
|
2619
|
-
Actions: Actions
|
|
2620
|
-
};
|
|
2621
|
-
|
|
2622
|
-
var hasEnoughSpace = function hasEnoughSpace(windowDimensions, elementDimensions, wrapperDimensions, wrapperPosition, position, gap) {
|
|
2623
|
-
if (gap === void 0) {
|
|
2624
|
-
gap = 0;
|
|
2625
|
-
}
|
|
2626
|
-
|
|
2627
|
-
var windowHeight = windowDimensions.height,
|
|
2628
|
-
windowWidth = windowDimensions.width;
|
|
2629
|
-
var elementHeight = elementDimensions.height,
|
|
2630
|
-
elementWidth = elementDimensions.width;
|
|
2631
|
-
var wrapperHeight = wrapperDimensions.height,
|
|
2632
|
-
wrapperWidth = wrapperDimensions.width;
|
|
2633
|
-
var wrapperX = wrapperPosition.x,
|
|
2634
|
-
wrapperY = wrapperPosition.y;
|
|
2650
|
+
var windowHeight = windowDimensions.height,
|
|
2651
|
+
windowWidth = windowDimensions.width;
|
|
2652
|
+
var elementHeight = elementDimensions.height,
|
|
2653
|
+
elementWidth = elementDimensions.width;
|
|
2654
|
+
var wrapperHeight = wrapperDimensions.height,
|
|
2655
|
+
wrapperWidth = wrapperDimensions.width;
|
|
2656
|
+
var wrapperX = wrapperPosition.x,
|
|
2657
|
+
wrapperY = wrapperPosition.y;
|
|
2635
2658
|
|
|
2636
2659
|
var verticalPosition = _calculateVerticalPosition(wrapperPosition, wrapperDimensions, elementDimensions);
|
|
2637
2660
|
|
|
@@ -3307,10 +3330,22 @@ Tip.defaultProps = {
|
|
|
3307
3330
|
top: false
|
|
3308
3331
|
};
|
|
3309
3332
|
|
|
3310
|
-
function
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3333
|
+
var CloseIcon$1 = function CloseIcon() {
|
|
3334
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
3335
|
+
width: "24",
|
|
3336
|
+
height: "24",
|
|
3337
|
+
viewBox: "0 0 24 24"
|
|
3338
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
3339
|
+
fill: "gray",
|
|
3340
|
+
fillRule: "evenodd",
|
|
3341
|
+
d: "M11.293 12L5.146 5.854a.5.5 0 1 1 .708-.708L12 11.293l6.146-6.147a.5.5 0 0 1 .708.708L12.707 12l6.147 6.146a.5.5 0 0 1-.708.708L12 12.707l-6.146 6.147a.5.5 0 0 1-.708-.708L11.293 12z"
|
|
3342
|
+
}));
|
|
3343
|
+
};
|
|
3344
|
+
|
|
3345
|
+
function Notification(_ref) {
|
|
3346
|
+
var id = _ref.id,
|
|
3347
|
+
icon = _ref.icon,
|
|
3348
|
+
title = _ref.title,
|
|
3314
3349
|
subtitle = _ref.subtitle,
|
|
3315
3350
|
children = _ref.children,
|
|
3316
3351
|
customCloseButton = _ref.customCloseButton,
|
|
@@ -3574,6 +3609,281 @@ var MenuGroup = /*#__PURE__*/polymorphicComponent(function MenuGroud(_ref7, ref)
|
|
|
3574
3609
|
}, label) : null, children);
|
|
3575
3610
|
});
|
|
3576
3611
|
|
|
3612
|
+
/** @deprecated */
|
|
3613
|
+
|
|
3614
|
+
var Box$2 = /*#__PURE__*/function (_React$Component) {
|
|
3615
|
+
_inheritsLoose(Box, _React$Component);
|
|
3616
|
+
|
|
3617
|
+
function Box() {
|
|
3618
|
+
var _this;
|
|
3619
|
+
|
|
3620
|
+
_this = _React$Component.apply(this, arguments) || this;
|
|
3621
|
+
|
|
3622
|
+
_this._closeModal = function () {
|
|
3623
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3624
|
+
var modalElement = document.getElementById('modal_box');
|
|
3625
|
+
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3626
|
+
};
|
|
3627
|
+
|
|
3628
|
+
_this._handleKeyDown = function (event) {
|
|
3629
|
+
if (event.keyCode === 27) {
|
|
3630
|
+
// ESC
|
|
3631
|
+
_this._closeModal();
|
|
3632
|
+
|
|
3633
|
+
if (event.preventDefault) event.preventDefault();
|
|
3634
|
+
}
|
|
3635
|
+
};
|
|
3636
|
+
|
|
3637
|
+
_this._handleOverlayClick = function (event) {
|
|
3638
|
+
if (event.target instanceof Element && (event.target.id === 'reactist-overlay' || event.target.id === 'reactist-overlay-inner')) {
|
|
3639
|
+
_this._closeModal();
|
|
3640
|
+
}
|
|
3641
|
+
};
|
|
3642
|
+
|
|
3643
|
+
return _this;
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
var _proto = Box.prototype;
|
|
3647
|
+
|
|
3648
|
+
_proto.componentDidMount = function componentDidMount() {
|
|
3649
|
+
window.addEventListener('keydown', this._handleKeyDown);
|
|
3650
|
+
};
|
|
3651
|
+
|
|
3652
|
+
_proto.componentWillUnmount = function componentWillUnmount() {
|
|
3653
|
+
window.removeEventListener('keydown', this._handleKeyDown);
|
|
3654
|
+
};
|
|
3655
|
+
|
|
3656
|
+
_proto.render = function render() {
|
|
3657
|
+
var _this$props = this.props,
|
|
3658
|
+
large = _this$props.large,
|
|
3659
|
+
medium = _this$props.medium,
|
|
3660
|
+
style = _this$props.style,
|
|
3661
|
+
children = _this$props.children,
|
|
3662
|
+
closeOnOverlayClick = _this$props.closeOnOverlayClick;
|
|
3663
|
+
var className = classNames('reactist_modal_box', {
|
|
3664
|
+
large: large,
|
|
3665
|
+
medium: medium
|
|
3666
|
+
}, this.props.className);
|
|
3667
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
3668
|
+
className: "reactist_overlay",
|
|
3669
|
+
id: "reactist-overlay",
|
|
3670
|
+
onClick: closeOnOverlayClick ? this._handleOverlayClick : undefined
|
|
3671
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3672
|
+
className: "reactist_overlay_inner",
|
|
3673
|
+
id: "reactist-overlay-inner"
|
|
3674
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3675
|
+
style: style,
|
|
3676
|
+
className: className
|
|
3677
|
+
}, children)));
|
|
3678
|
+
};
|
|
3679
|
+
|
|
3680
|
+
return Box;
|
|
3681
|
+
}(React__default.Component);
|
|
3682
|
+
|
|
3683
|
+
Box$2.displayName = 'Modal.Box';
|
|
3684
|
+
Box$2.defaultProps = {
|
|
3685
|
+
large: false,
|
|
3686
|
+
closeOnOverlayClick: false
|
|
3687
|
+
};
|
|
3688
|
+
/** @deprecated */
|
|
3689
|
+
|
|
3690
|
+
var Header = /*#__PURE__*/function (_React$Component2) {
|
|
3691
|
+
_inheritsLoose(Header, _React$Component2);
|
|
3692
|
+
|
|
3693
|
+
function Header() {
|
|
3694
|
+
return _React$Component2.apply(this, arguments) || this;
|
|
3695
|
+
}
|
|
3696
|
+
|
|
3697
|
+
var _proto2 = Header.prototype;
|
|
3698
|
+
|
|
3699
|
+
_proto2._closeModal = function _closeModal(event) {
|
|
3700
|
+
event.preventDefault();
|
|
3701
|
+
|
|
3702
|
+
if (typeof this.props.beforeClose === 'function') {
|
|
3703
|
+
this.props.beforeClose();
|
|
3704
|
+
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3705
|
+
|
|
3706
|
+
|
|
3707
|
+
var modalElement = document.getElementById('modal_box');
|
|
3708
|
+
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3709
|
+
};
|
|
3710
|
+
|
|
3711
|
+
_proto2.render = function render() {
|
|
3712
|
+
return (
|
|
3713
|
+
/*#__PURE__*/
|
|
3714
|
+
|
|
3715
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
3716
|
+
React__default.createElement("div", {
|
|
3717
|
+
className: "reactist_modal_box__header"
|
|
3718
|
+
}, /*#__PURE__*/React__default.createElement("p", null, this.props.title && /*#__PURE__*/React__default.createElement("span", {
|
|
3719
|
+
className: "title"
|
|
3720
|
+
}, this.props.title), this.props.subtitle && /*#__PURE__*/React__default.createElement("span", {
|
|
3721
|
+
className: "subtitle"
|
|
3722
|
+
}, this.props.subtitle), this.props.children), /*#__PURE__*/React__default.createElement("a", {
|
|
3723
|
+
className: "close",
|
|
3724
|
+
onClick: this._closeModal.bind(this),
|
|
3725
|
+
href: "#"
|
|
3726
|
+
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)))
|
|
3727
|
+
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
3728
|
+
|
|
3729
|
+
);
|
|
3730
|
+
};
|
|
3731
|
+
|
|
3732
|
+
return Header;
|
|
3733
|
+
}(React__default.Component);
|
|
3734
|
+
|
|
3735
|
+
Header.displayName = 'Modal.Header';
|
|
3736
|
+
/** @deprecated */
|
|
3737
|
+
|
|
3738
|
+
var Body$1 = /*#__PURE__*/function (_React$Component3) {
|
|
3739
|
+
_inheritsLoose(Body, _React$Component3);
|
|
3740
|
+
|
|
3741
|
+
function Body() {
|
|
3742
|
+
return _React$Component3.apply(this, arguments) || this;
|
|
3743
|
+
}
|
|
3744
|
+
|
|
3745
|
+
var _proto3 = Body.prototype;
|
|
3746
|
+
|
|
3747
|
+
_proto3._closeModal = function _closeModal(event) {
|
|
3748
|
+
event.preventDefault(); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3749
|
+
|
|
3750
|
+
var modalElement = document.getElementById('modal_box');
|
|
3751
|
+
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3752
|
+
};
|
|
3753
|
+
|
|
3754
|
+
_proto3.render = function render() {
|
|
3755
|
+
var _this$props2 = this.props,
|
|
3756
|
+
icon = _this$props2.icon,
|
|
3757
|
+
plain = _this$props2.plain,
|
|
3758
|
+
children = _this$props2.children,
|
|
3759
|
+
style = _this$props2.style,
|
|
3760
|
+
showCloseIcon = _this$props2.showCloseIcon;
|
|
3761
|
+
var className = classNames('reactist_modal_box__body', {
|
|
3762
|
+
plain: plain
|
|
3763
|
+
}, this.props.className);
|
|
3764
|
+
return (
|
|
3765
|
+
/*#__PURE__*/
|
|
3766
|
+
|
|
3767
|
+
/* eslint-disable jsx-a11y/anchor-is-valid */
|
|
3768
|
+
React__default.createElement("div", {
|
|
3769
|
+
className: className,
|
|
3770
|
+
style: style
|
|
3771
|
+
}, showCloseIcon && /*#__PURE__*/React__default.createElement("a", {
|
|
3772
|
+
className: "close",
|
|
3773
|
+
onClick: this._closeModal.bind(this),
|
|
3774
|
+
href: "#"
|
|
3775
|
+
}, /*#__PURE__*/React__default.createElement(CloseIcon$1, null)), icon ? /*#__PURE__*/React__default.createElement("div", {
|
|
3776
|
+
className: "dialog"
|
|
3777
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
3778
|
+
className: "reactist_icon"
|
|
3779
|
+
}, icon), /*#__PURE__*/React__default.createElement("div", {
|
|
3780
|
+
className: "content"
|
|
3781
|
+
}, children)) : children)
|
|
3782
|
+
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
3783
|
+
|
|
3784
|
+
);
|
|
3785
|
+
};
|
|
3786
|
+
|
|
3787
|
+
return Body;
|
|
3788
|
+
}(React__default.Component);
|
|
3789
|
+
|
|
3790
|
+
Body$1.displayName = 'Modal.Body';
|
|
3791
|
+
Body$1.defaultProps = {
|
|
3792
|
+
showCloseIcon: false
|
|
3793
|
+
};
|
|
3794
|
+
/** @deprecated */
|
|
3795
|
+
|
|
3796
|
+
var Actions = /*#__PURE__*/function (_React$Component4) {
|
|
3797
|
+
_inheritsLoose(Actions, _React$Component4);
|
|
3798
|
+
|
|
3799
|
+
function Actions() {
|
|
3800
|
+
return _React$Component4.apply(this, arguments) || this;
|
|
3801
|
+
}
|
|
3802
|
+
|
|
3803
|
+
var _proto4 = Actions.prototype;
|
|
3804
|
+
|
|
3805
|
+
_proto4._onClick = function _onClick(onClick) {
|
|
3806
|
+
if (onClick) {
|
|
3807
|
+
onClick();
|
|
3808
|
+
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
3809
|
+
|
|
3810
|
+
|
|
3811
|
+
var modalElement = document.getElementById('modal_box');
|
|
3812
|
+
ReactDOM.unmountComponentAtNode(modalElement);
|
|
3813
|
+
};
|
|
3814
|
+
|
|
3815
|
+
_proto4.render = function render() {
|
|
3816
|
+
var _this2 = this;
|
|
3817
|
+
|
|
3818
|
+
var children = React__default.Children.map( // see: https://github.com/microsoft/TypeScript/issues/21699
|
|
3819
|
+
// @ts-expect-error Children cannot be typed properly yet in React
|
|
3820
|
+
this.props.children, function (child) {
|
|
3821
|
+
var _child$props;
|
|
3822
|
+
|
|
3823
|
+
if (child === null || child === void 0 ? void 0 : (_child$props = child.props) === null || _child$props === void 0 ? void 0 : _child$props.close) {
|
|
3824
|
+
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
3825
|
+
onClick: function onClick() {
|
|
3826
|
+
return _this2._onClick(child.props.onClick);
|
|
3827
|
+
}
|
|
3828
|
+
});
|
|
3829
|
+
} else {
|
|
3830
|
+
return child ? /*#__PURE__*/React__default.cloneElement(child) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
3831
|
+
}
|
|
3832
|
+
});
|
|
3833
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
3834
|
+
className: "reactist_modal_box__actions"
|
|
3835
|
+
}, children);
|
|
3836
|
+
};
|
|
3837
|
+
|
|
3838
|
+
return Actions;
|
|
3839
|
+
}(React__default.Component);
|
|
3840
|
+
|
|
3841
|
+
Actions.displayName = 'Modal.Actions';
|
|
3842
|
+
|
|
3843
|
+
var index = {
|
|
3844
|
+
Box: Box$2,
|
|
3845
|
+
Header: Header,
|
|
3846
|
+
Body: Body$1,
|
|
3847
|
+
Actions: Actions
|
|
3848
|
+
};
|
|
3849
|
+
|
|
3850
|
+
/** @deprecated */
|
|
3851
|
+
|
|
3852
|
+
function Loading$1(_ref) {
|
|
3853
|
+
var className = _ref.className,
|
|
3854
|
+
_ref$spinnerColor = _ref.spinnerColor,
|
|
3855
|
+
spinnerColor = _ref$spinnerColor === void 0 ? '#3F82EF' : _ref$spinnerColor,
|
|
3856
|
+
_ref$bgColor = _ref.bgColor,
|
|
3857
|
+
bgColor = _ref$bgColor === void 0 ? '#D9E6FB' : _ref$bgColor,
|
|
3858
|
+
_ref$size = _ref.size,
|
|
3859
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
3860
|
+
_ref$ariaLabel = _ref['aria-label'],
|
|
3861
|
+
ariaLabel = _ref$ariaLabel === void 0 ? 'Loading' : _ref$ariaLabel;
|
|
3862
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
3863
|
+
className: classNames('reactist_loading', className),
|
|
3864
|
+
"aria-label": ariaLabel,
|
|
3865
|
+
"aria-live": "assertive",
|
|
3866
|
+
role: "alert"
|
|
3867
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
3868
|
+
className: "reactist_loading--spinner"
|
|
3869
|
+
}, /*#__PURE__*/React__default.createElement("svg", {
|
|
3870
|
+
width: size,
|
|
3871
|
+
height: size,
|
|
3872
|
+
viewBox: '0 0 24 24'
|
|
3873
|
+
}, /*#__PURE__*/React__default.createElement("g", {
|
|
3874
|
+
fill: "none",
|
|
3875
|
+
fillRule: "nonzero"
|
|
3876
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
3877
|
+
fill: spinnerColor,
|
|
3878
|
+
d: "M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z"
|
|
3879
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
3880
|
+
fill: bgColor,
|
|
3881
|
+
d: "M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z"
|
|
3882
|
+
})))));
|
|
3883
|
+
}
|
|
3884
|
+
|
|
3885
|
+
Loading$1.displayName = 'Loading';
|
|
3886
|
+
|
|
3577
3887
|
exports.Alert = Alert;
|
|
3578
3888
|
exports.Avatar = Avatar;
|
|
3579
3889
|
exports.Box = Box;
|
|
@@ -3585,6 +3895,9 @@ exports.CheckboxField = CheckboxField;
|
|
|
3585
3895
|
exports.ColorPicker = ColorPicker;
|
|
3586
3896
|
exports.Column = Column;
|
|
3587
3897
|
exports.Columns = Columns;
|
|
3898
|
+
exports.DeprecatedButton = Button$1;
|
|
3899
|
+
exports.DeprecatedLoading = Loading$1;
|
|
3900
|
+
exports.DeprecatedModal = index;
|
|
3588
3901
|
exports.Divider = Divider;
|
|
3589
3902
|
exports.Dropdown = Dropdown;
|
|
3590
3903
|
exports.ErrorMessage = ErrorMessage;
|
|
@@ -3597,13 +3910,17 @@ exports.Input = Input;
|
|
|
3597
3910
|
exports.KeyCapturer = KeyCapturer;
|
|
3598
3911
|
exports.KeyboardShortcut = KeyboardShortcut;
|
|
3599
3912
|
exports.Loading = Loading;
|
|
3600
|
-
exports.LoadingSpinner = LoadingSpinner;
|
|
3601
3913
|
exports.Menu = Menu;
|
|
3602
3914
|
exports.MenuButton = MenuButton;
|
|
3603
3915
|
exports.MenuGroup = MenuGroup;
|
|
3604
3916
|
exports.MenuItem = MenuItem;
|
|
3605
3917
|
exports.MenuList = MenuList;
|
|
3606
|
-
exports.Modal =
|
|
3918
|
+
exports.Modal = Modal;
|
|
3919
|
+
exports.ModalActions = ModalActions;
|
|
3920
|
+
exports.ModalBody = ModalBody;
|
|
3921
|
+
exports.ModalCloseButton = ModalCloseButton;
|
|
3922
|
+
exports.ModalFooter = ModalFooter;
|
|
3923
|
+
exports.ModalHeader = ModalHeader;
|
|
3607
3924
|
exports.Notice = Notice;
|
|
3608
3925
|
exports.Notification = Notification;
|
|
3609
3926
|
exports.PasswordField = PasswordField;
|