@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var modules_40c67f5b = {"tab":"
|
|
1
|
+
var modules_40c67f5b = {"tab":"_7cdcd0b6","tab-normal":"af6705d0","tab-primary":"ad705020","tab-secondary":"_69a2043b","tab-tertiary":"_5b695667","tab-plain":"_88d3dc5e"};
|
|
2
2
|
|
|
3
3
|
export default modules_40c67f5b;
|
|
4
4
|
//# sourceMappingURL=tabs.module.css.js.map
|
|
@@ -6,23 +6,24 @@ import { Box } from '../box/box.js';
|
|
|
6
6
|
import styles from './text.module.css.js';
|
|
7
7
|
|
|
8
8
|
var Text = /*#__PURE__*/polymorphicComponent(function Text(_ref, ref) {
|
|
9
|
-
var
|
|
10
|
-
as = _ref$as === void 0 ? 'span' : _ref$as,
|
|
9
|
+
var as = _ref.as,
|
|
11
10
|
_ref$size = _ref.size,
|
|
12
11
|
size = _ref$size === void 0 ? 'body' : _ref$size,
|
|
13
12
|
_ref$weight = _ref.weight,
|
|
14
13
|
weight = _ref$weight === void 0 ? 'regular' : _ref$weight,
|
|
15
14
|
_ref$tone = _ref.tone,
|
|
16
15
|
tone = _ref$tone === void 0 ? 'normal' : _ref$tone,
|
|
16
|
+
align = _ref.align,
|
|
17
17
|
children = _ref.children,
|
|
18
18
|
lineClamp = _ref.lineClamp,
|
|
19
19
|
exceptionallySetClassName = _ref.exceptionallySetClassName,
|
|
20
|
-
props = _objectWithoutPropertiesLoose(_ref, ["as", "size", "weight", "tone", "children", "lineClamp", "exceptionallySetClassName"]);
|
|
20
|
+
props = _objectWithoutPropertiesLoose(_ref, ["as", "size", "weight", "tone", "align", "children", "lineClamp", "exceptionallySetClassName"]);
|
|
21
21
|
|
|
22
|
-
var lineClampMultipleLines = typeof lineClamp === 'string' ?
|
|
22
|
+
var lineClampMultipleLines = typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp !== null && lineClamp !== void 0 ? lineClamp : 1) > 1;
|
|
23
23
|
return /*#__PURE__*/createElement(Box, Object.assign({}, props, {
|
|
24
24
|
as: as,
|
|
25
|
-
className: [exceptionallySetClassName, styles.text, size !== 'body' ? getClassNames(styles, 'size', size) : null, weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null, tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null, lineClampMultipleLines ? styles.
|
|
25
|
+
className: [exceptionallySetClassName, styles.text, size !== 'body' ? getClassNames(styles, 'size', size) : null, weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null, tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null, lineClampMultipleLines ? styles.lineClampMultipleLines : null, lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null],
|
|
26
|
+
textAlign: align,
|
|
26
27
|
// Prevents emojis from being cut-off
|
|
27
28
|
// See https://github.com/Doist/reactist/pull/528
|
|
28
29
|
paddingRight: lineClamp ? 'xsmall' : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sources":["../../../src/new-components/text/text.tsx"],"sourcesContent":["import * as React from 'react'\nimport { getClassNames } from '../responsive-props'\nimport { Box } from '../box'\
|
|
1
|
+
{"version":3,"file":"text.js","sources":["../../../src/new-components/text/text.tsx"],"sourcesContent":["import * as React from 'react'\nimport { getClassNames } from '../responsive-props'\nimport { Box } from '../box'\nimport { polymorphicComponent } from '../../utils/polymorphism'\n\nimport type { Tone } from '../common-types'\nimport type { BoxProps } from '../box'\n\nimport styles from './text.module.css'\n\ntype TextProps = {\n children: React.ReactNode\n /**\n * The size of the text.\n *\n * The supported values, from smaller size to larger size, are:\n * 'caption', 'copy', 'body', and 'subtitle'\n *\n * @default 'body'\n */\n size?: 'caption' | 'copy' | 'body' | 'subtitle'\n /**\n * The weight of the text font.\n *\n * @default 'regular'\n */\n weight?: 'regular' | 'semibold' | 'bold'\n /**\n * The tone (semantic color) of the text.\n *\n * @default 'normal'\n */\n tone?: Tone\n /**\n * Used to truncate the text to a given number of lines.\n *\n * It will add an ellipsis (`…`) to the text at the end of the last line, only if the text was\n * truncated. If the text fits without it being truncated, no ellipsis is added.\n *\n * By default, the text is not truncated at all, no matter how many lines it takes to render it.\n *\n * @default undefined\n */\n lineClamp?: 1 | 2 | 3 | 4 | 5 | '1' | '2' | '3' | '4' | '5'\n /**\n * How to align the text horizontally.\n *\n * @default 'start'\n */\n align?: BoxProps['textAlign']\n}\n\nconst Text = polymorphicComponent<'div', TextProps>(function Text(\n {\n as,\n size = 'body',\n weight = 'regular',\n tone = 'normal',\n align,\n children,\n lineClamp,\n exceptionallySetClassName,\n ...props\n },\n ref,\n) {\n const lineClampMultipleLines =\n typeof lineClamp === 'string' ? Number(lineClamp) > 1 : (lineClamp ?? 1) > 1\n\n return (\n <Box\n {...props}\n as={as}\n className={[\n exceptionallySetClassName,\n styles.text,\n size !== 'body' ? getClassNames(styles, 'size', size) : null,\n weight !== 'regular' ? getClassNames(styles, 'weight', weight) : null,\n tone !== 'normal' ? getClassNames(styles, 'tone', tone) : null,\n lineClampMultipleLines ? styles.lineClampMultipleLines : null,\n lineClamp ? getClassNames(styles, 'lineClamp', lineClamp.toString()) : null,\n ]}\n textAlign={align}\n // Prevents emojis from being cut-off\n // See https://github.com/Doist/reactist/pull/528\n paddingRight={lineClamp ? 'xsmall' : undefined}\n ref={ref}\n >\n {children}\n </Box>\n )\n})\n\nexport type { TextProps }\nexport { Text }\n"],"names":["Text","polymorphicComponent","ref","as","size","weight","tone","align","children","lineClamp","exceptionallySetClassName","props","lineClampMultipleLines","Number","React","Box","className","styles","text","getClassNames","toString","textAlign","paddingRight","undefined"],"mappings":";;;;;;;IAoDMA,IAAI,gBAAGC,oBAAoB,CAAmB,SAASD,IAAT,OAYhDE,GAZgD;MAE5CC,UAAAA;uBACAC;MAAAA,8BAAO;yBACPC;MAAAA,kCAAS;uBACTC;MAAAA,8BAAO;MACPC,aAAAA;MACAC,gBAAAA;MACAC,iBAAAA;MACAC,iCAAAA;MACGC;;AAIP,MAAMC,sBAAsB,GACxB,OAAOH,SAAP,KAAqB,QAArB,GAAgCI,MAAM,CAACJ,SAAD,CAAN,GAAoB,CAApD,GAAwD,CAACA,SAAD,aAACA,SAAD,cAACA,SAAD,GAAc,CAAd,IAAmB,CAD/E;AAGA,sBACIK,aAAA,CAACC,GAAD,oBACQJ;AACJR,IAAAA,EAAE,EAAEA;AACJa,IAAAA,SAAS,EAAE,CACPN,yBADO,EAEPO,MAAM,CAACC,IAFA,EAGPd,IAAI,KAAK,MAAT,GAAkBe,aAAa,CAACF,MAAD,EAAS,MAAT,EAAiBb,IAAjB,CAA/B,GAAwD,IAHjD,EAIPC,MAAM,KAAK,SAAX,GAAuBc,aAAa,CAACF,MAAD,EAAS,QAAT,EAAmBZ,MAAnB,CAApC,GAAiE,IAJ1D,EAKPC,IAAI,KAAK,QAAT,GAAoBa,aAAa,CAACF,MAAD,EAAS,MAAT,EAAiBX,IAAjB,CAAjC,GAA0D,IALnD,EAMPM,sBAAsB,GAAGK,MAAM,CAACL,sBAAV,GAAmC,IANlD,EAOPH,SAAS,GAAGU,aAAa,CAACF,MAAD,EAAS,WAAT,EAAsBR,SAAS,CAACW,QAAV,EAAtB,CAAhB,GAA8D,IAPhE;AASXC,IAAAA,SAAS,EAAEd;AACX;AACA;AACAe,IAAAA,YAAY,EAAEb,SAAS,GAAG,QAAH,GAAcc;AACrCrB,IAAAA,GAAG,EAAEA;IAhBT,EAkBKM,QAlBL,CADJ;AAsBH,CAvCgC;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var modules_a9637dd3 = {"text":"
|
|
1
|
+
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"};
|
|
2
2
|
|
|
3
3
|
export default modules_a9637dd3;
|
|
4
4
|
//# sourceMappingURL=text.module.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polymorphism.js","sources":["../../src/utils/polymorphism.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport * as React from 'react'\n\ntype Merge<P1, P2> = Omit<P1, keyof P2> & P2\n\ntype EmptyObject = {\n [K in any]: never\n}\n\ntype ObfuscateClassNameMode = 'keepClassName' | 'obfuscateClassName' | 'omitClassName'\n\ntype ObfuscatedClassName = {\n /**\n * Used internally to set the `className` prop of the main container element for this component.\n *\n * Aside from the different name, the prop behaves the same as the native `className`. The only\n * reason for the name change is to discourage applying custom CSS to the design system\n * components, which are supposed to _eventually_ provide all the styling features we may need.\n *\n * This prop is meant to be used only in certain circumstances, when you really need a escape\n * hatch to apply custom styles to a component. Before reaching for this feature, try harder to\n * see if you can solve your needs with what the design system provides.\n *\n * For instance, instead of applying layout-related styles to a non-layout component, consider\n * wrapping it inside a layout component.\n *\n * @see PolymorphicComponent\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This can be customized via the second generic parameter, as there are cases where it may be\n * needed to omit this behaviour and keep the `className`. You can also instruct it to remove the\n * `className` prop while not replacing it with the `exceptionallySetClassName` one.\n *\n * @see ObfuscatedClassName['exceptionallySetClassName'] for details about this prop\n * @see PolymorphicComponent for details about this feature\n */\ntype WithObfuscatedClassName<\n Props,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = 'className' extends keyof Props\n ? ShouldObfuscateClassName extends 'obfuscateClassName'\n ? Omit<Props, 'className'> & ObfuscatedClassName\n : ShouldObfuscateClassName extends 'omitClassName'\n ? Omit<Props, 'className'>\n : ShouldObfuscateClassName extends 'keepClassName'\n ? Props\n : never\n : Props\n\ntype PolymorphicProp<ComponentType extends React.ElementType> = {\n /**\n * Used to instruct this component what React element to render as. It can be both a string\n * representing a HTML tag name, or a React component.\n *\n * When using this prop, the component you apply it to will also recognize in its props types\n * all the props from the component or HTML element you are rendering it as.\n *\n * Some uses for this feature:\n *\n * - Using some of our layout components, while at the same time being able to set them to use\n * semantic HTML elements needed for accessibility purposes (e.g. `nav`, `main`, etc).\n * - Using a design system link component, but have it internally use a client-side router link\n * implemented via a React component (e.g. react-router's `Link`).\n *\n * Keep in mind that not all compositions of this kind may work well, especially when composing\n * with another React component and not with a HTML tag name. In particular, if the components\n * being composed have opposing concerns of clashing features (e.g. they have contradicting\n * styles applied to them) things may not go well. In those cases prefer to nest them instead.\n *\n * @see PolymorphicComponent\n */\n as?: ComponentType\n}\n\n/**\n * Given a component or element type, and a set of additional props, this builds the entire set of\n * props for a polymorphic component.\n *\n * It does three things:\n *\n * 1. it merges the element type props with the `OwnProps`\n * 2. it adds the `as` prop to allow for polymorphism to happen\n * 3. it optionally obfuscates or omits the className prop if present\n *\n * @see PolymorphicProp\n * @see WithObfuscatedClassName\n */\ntype PolymorphicComponentProps<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = Merge<\n WithObfuscatedClassName<React.ComponentProps<ComponentType>, ShouldObfuscateClassName>,\n OwnProps & PolymorphicProp<ComponentType>\n>\n\ntype ElementTagNameMap = HTMLElementTagNameMap &\n Pick<SVGElementTagNameMap, Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>>\n\ntype ElementByTag<TagName extends keyof ElementTagNameMap> = ElementTagNameMap[TagName]\n\ntype ElementByTagOrAny<\n ComponentType extends React.ElementType\n> = ComponentType extends keyof ElementTagNameMap ? ElementByTag<ComponentType> : any\n\n/**\n * The function passed to React.forwardRef, but typed in a way that's prepared for polymorphism via\n * the `as` prop. It also allows to specify if the `className` prop should be obfuscated or omitted.\n *\n * @see PolymorphicComponentProps\n * @see WithObfuscatedClassName\n */\ninterface ForwardRefFunction<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> {\n (\n props: PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>,\n ref:\n | ((instance: ElementByTagOrAny<ComponentType> | null) => void)\n | React.MutableRefObject<ElementByTagOrAny<ComponentType> | null>\n | null,\n ): React.ReactElement | null\n displayName?: string\n}\n\n/**\n * A component that can customize the React element type that it renders (a.k.a. a polymorphic\n * component). This is achieved by passing a prop `as={ElementType}` or `as=\"html-tag-name\"`.\n *\n * It transparently takes care of forwarding refs, and properly sets the ref type depending on the\n * element type.\n *\n * ## Recognizing props based on the polymorphic type\n *\n * The `ComponentType` argument sets the default type for the `as` prop. Whatever the `as` prop\n * component or HTML element is, the type system will automatically allow you to pass props that are\n * not explicitly defined by you, but that are recognized as valid props to be passed to the\n * component you are rendering.\n *\n * For instance, see the following example:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor=\"field-id\">Hello</Box>\n * ```\n *\n * The `htmlFor` prop is exclusive to label elements. If you omit the `as=\"label\"` prop, the type\n * system will consider the `htmlFor` prop to be an error. The same happens if you pass a value of\n * an incorrect type to such prop. For instance, the example below will issue a type error:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor={123}>Hello</Box>\n * ```\n *\n * ## Omitting or obfuscating the `className` prop\n *\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This is to discourage customizing design system components via custom styling, while still\n * leaving the door open to do it as an escape hatch when the design system still has shortcomings\n * with respect to the product designs we want to achieve.\n *\n * The cumbersome name also serves the purpose of aiding in easily searching for the places in the\n * code where this escape hatch was needed, in order to identify areas where the design system\n * components need to improve to better match our needs.\n *\n * This behaviour can be customized via an optional second generic argument that allows to disable\n * this feature, or to omit the `className` altogether without replacing it with the obfuscated prop\n * name.\n */\ninterface PolymorphicComponent<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n> {\n <TT extends React.ElementType = ComponentType>(\n props: PolymorphicComponentProps<TT, OwnProps, ShouldObfuscateClassName>,\n ): React.ReactElement | null\n readonly $$typeof: symbol\n defaultProps?: Partial<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n propTypes?: React.WeakValidationMap<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n displayName?: string\n}\n\n/**\n * A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a\n * convenience over merely using React.forwardRef directly, and then manually forcing the resulting\n * value to be typed using `as PolymorphicComponent<…>`.\n *\n * @see PolymorphicComponent for details about what this type does\n */\nfunction polymorphicComponent<\n ComponentType extends React.ElementType = 'div',\n OwnProps = EmptyObject,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n>(render: ForwardRefFunction<ComponentType, OwnProps, ShouldObfuscateClassName>) {\n return React.forwardRef(render) as PolymorphicComponent<\n ComponentType,\n OwnProps,\n ShouldObfuscateClassName\n >\n}\n\nexport type { PolymorphicComponent }\nexport { polymorphicComponent }\n"],"names":["polymorphicComponent","render","React"],"mappings":";;AAAA;AAqMA;;;;;;;;AAOA,SAASA,oBAAT,CAIEC,MAJF;AAKI,sBAAOC,UAAA,CAAiBD,MAAjB,CAAP;AAKH;;;;"}
|
|
1
|
+
{"version":3,"file":"polymorphism.js","sources":["../../src/utils/polymorphism.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport * as React from 'react'\n\ntype Merge<P1, P2> = Omit<P1, keyof P2> & P2\n\ntype EmptyObject = {\n [K in any]: never\n}\n\ntype ObfuscateClassNameMode = 'keepClassName' | 'obfuscateClassName' | 'omitClassName'\n\ntype ObfuscatedClassName = {\n /**\n * Used internally to set the `className` prop of the main container element for this component.\n *\n * Aside from the different name, the prop behaves the same as the native `className`. The only\n * reason for the name change is to discourage applying custom CSS to the design system\n * components, which are supposed to _eventually_ provide all the styling features we may need.\n *\n * This prop is meant to be used only in certain circumstances, when you really need a escape\n * hatch to apply custom styles to a component. Before reaching for this feature, try harder to\n * see if you can solve your needs with what the design system provides.\n *\n * For instance, instead of applying layout-related styles to a non-layout component, consider\n * wrapping it inside a layout component.\n *\n * @see PolymorphicComponent\n */\n exceptionallySetClassName?: string\n}\n\n/**\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This can be customized via the second generic parameter, as there are cases where it may be\n * needed to omit this behaviour and keep the `className`. You can also instruct it to remove the\n * `className` prop while not replacing it with the `exceptionallySetClassName` one.\n *\n * @see ObfuscatedClassName['exceptionallySetClassName'] for details about this prop\n * @see PolymorphicComponent for details about this feature\n */\ntype WithObfuscatedClassName<\n Props,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = 'className' extends keyof Props\n ? ShouldObfuscateClassName extends 'obfuscateClassName'\n ? Omit<Props, 'className'> & ObfuscatedClassName\n : ShouldObfuscateClassName extends 'omitClassName'\n ? Omit<Props, 'className'>\n : ShouldObfuscateClassName extends 'keepClassName'\n ? Props\n : never\n : Props\n\ntype PolymorphicProp<ComponentType extends React.ElementType> = {\n /**\n * Used to instruct this component what React element to render as. It can be both a string\n * representing a HTML tag name, or a React component.\n *\n * When using this prop, the component you apply it to will also recognize in its props types\n * all the props from the component or HTML element you are rendering it as.\n *\n * Some uses for this feature:\n *\n * - Using some of our layout components, while at the same time being able to set them to use\n * semantic HTML elements needed for accessibility purposes (e.g. `nav`, `main`, etc).\n * - Using a design system link component, but have it internally use a client-side router link\n * implemented via a React component (e.g. react-router's `Link`).\n *\n * Keep in mind that not all compositions of this kind may work well, especially when composing\n * with another React component and not with a HTML tag name. In particular, if the components\n * being composed have opposing concerns of clashing features (e.g. they have contradicting\n * styles applied to them) things may not go well. In those cases prefer to nest them instead.\n *\n * @see PolymorphicComponent\n */\n as?: ComponentType\n}\n\n/**\n * Given a component or element type, and a set of additional props, this builds the entire set of\n * props for a polymorphic component.\n *\n * It does three things:\n *\n * 1. it merges the element type props with the `OwnProps`\n * 2. it adds the `as` prop to allow for polymorphism to happen\n * 3. it optionally obfuscates or omits the className prop if present\n *\n * @see PolymorphicProp\n * @see WithObfuscatedClassName\n */\ntype PolymorphicComponentProps<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> = Merge<\n WithObfuscatedClassName<React.ComponentProps<ComponentType>, ShouldObfuscateClassName>,\n OwnProps & PolymorphicProp<ComponentType>\n>\n\ntype ElementTagNameMap = HTMLElementTagNameMap &\n Pick<SVGElementTagNameMap, Exclude<keyof SVGElementTagNameMap, keyof HTMLElementTagNameMap>>\n\ntype ElementByTag<TagName extends keyof ElementTagNameMap> = ElementTagNameMap[TagName]\n\ntype ElementByTagOrAny<\n ComponentType extends React.ElementType\n> = ComponentType extends keyof ElementTagNameMap ? ElementByTag<ComponentType> : any\n\n/**\n * The function passed to React.forwardRef, but typed in a way that's prepared for polymorphism via\n * the `as` prop. It also allows to specify if the `className` prop should be obfuscated or omitted.\n *\n * @see PolymorphicComponentProps\n * @see WithObfuscatedClassName\n */\ninterface ForwardRefFunction<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode\n> {\n (\n props: PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>,\n ref:\n | ((instance: ElementByTagOrAny<ComponentType> | null) => void)\n | React.MutableRefObject<ElementByTagOrAny<ComponentType> | null>\n | null,\n ): React.ReactElement | null\n displayName?: string\n}\n\n/**\n * A component that can customize the React element type that it renders (a.k.a. a polymorphic\n * component). This is achieved by passing a prop `as={ElementType}` or `as=\"html-tag-name\"`.\n *\n * It transparently takes care of forwarding refs, and properly sets the ref type depending on the\n * element type.\n *\n * ## Recognizing props based on the polymorphic type\n *\n * The `ComponentType` argument sets the default type for the `as` prop. Whatever the `as` prop\n * component or HTML element is, the type system will automatically allow you to pass props that are\n * not explicitly defined by you, but that are recognized as valid props to be passed to the\n * component you are rendering.\n *\n * For instance, see the following example:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor=\"field-id\">Hello</Box>\n * ```\n *\n * The `htmlFor` prop is exclusive to label elements. If you omit the `as=\"label\"` prop, the type\n * system will consider the `htmlFor` prop to be an error. The same happens if you pass a value of\n * an incorrect type to such prop. For instance, the example below will issue a type error:\n *\n * ```jsx\n * <Box as=\"label\" htmlFor={123}>Hello</Box>\n * ```\n *\n * ## Omitting or obfuscating the `className` prop\n *\n * If a set of props include the `className` prop, we replace it with a `exceptionallySetClassName`\n * prop instead.\n *\n * This is to discourage customizing design system components via custom styling, while still\n * leaving the door open to do it as an escape hatch when the design system still has shortcomings\n * with respect to the product designs we want to achieve.\n *\n * The cumbersome name also serves the purpose of aiding in easily searching for the places in the\n * code where this escape hatch was needed, in order to identify areas where the design system\n * components need to improve to better match our needs.\n *\n * This behaviour can be customized via an optional second generic argument that allows to disable\n * this feature, or to omit the `className` altogether without replacing it with the obfuscated prop\n * name.\n */\ninterface PolymorphicComponent<\n ComponentType extends React.ElementType,\n OwnProps,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n> {\n <TT extends React.ElementType = ComponentType>(\n props: PolymorphicComponentProps<TT, OwnProps, ShouldObfuscateClassName>,\n ): React.ReactElement | null\n readonly $$typeof: symbol\n defaultProps?: Partial<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n propTypes?: React.WeakValidationMap<\n PolymorphicComponentProps<ComponentType, OwnProps, ShouldObfuscateClassName>\n >\n displayName?: string\n}\n\n/**\n * A wrapper to use React.forwardRef with polymorphic components in a type-safe manner. This is a\n * convenience over merely using React.forwardRef directly, and then manually forcing the resulting\n * value to be typed using `as PolymorphicComponent<…>`.\n *\n * @see PolymorphicComponent for details about what this type does\n */\nfunction polymorphicComponent<\n ComponentType extends React.ElementType = 'div',\n OwnProps = EmptyObject,\n ShouldObfuscateClassName extends ObfuscateClassNameMode = 'obfuscateClassName'\n>(render: ForwardRefFunction<ComponentType, OwnProps, ShouldObfuscateClassName>) {\n return React.forwardRef(render) as PolymorphicComponent<\n ComponentType,\n OwnProps,\n ShouldObfuscateClassName\n >\n}\n\nexport type { PolymorphicComponent, ObfuscatedClassName }\nexport { polymorphicComponent }\n"],"names":["polymorphicComponent","render","React"],"mappings":";;AAAA;AAqMA;;;;;;;;AAOA,SAASA,oBAAT,CAIEC,MAJF;AAKI,sBAAOC,UAAA,CAAiBD,MAAjB,CAAP;AAKH;;;;"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './button.less';
|
|
2
|
+
import './deprecated-button.less';
|
|
3
3
|
declare type NativeButtonProps = React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>;
|
|
4
|
+
/** @deprecated */
|
|
4
5
|
export declare type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link';
|
|
6
|
+
/** @deprecated */
|
|
5
7
|
export declare type ButtonSize = 'default' | 'small' | 'large';
|
|
8
|
+
/** @deprecated */
|
|
6
9
|
export declare type ButtonProps = Omit<NativeButtonProps, 'title' | 'ref'> & {
|
|
7
10
|
/**
|
|
8
11
|
* Loading style. When true it disables the button, but it also adds a visual indication of
|
|
@@ -24,6 +27,9 @@ export declare type ButtonProps = Omit<NativeButtonProps, 'title' | 'ref'> & {
|
|
|
24
27
|
*/
|
|
25
28
|
tooltip?: React.ReactNode;
|
|
26
29
|
};
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated
|
|
32
|
+
*/
|
|
27
33
|
declare const Button: React.ForwardRefExoticComponent<Pick<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | "autoFocus" | "disabled" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture"> & {
|
|
28
34
|
/**
|
|
29
35
|
* Loading style. When true it disables the button, but it also adds a visual indication of
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),i=t(require("react")),o=t(require("classnames")),a=require("../tooltip/tooltip.js"),l=i.forwardRef((function(t,l){var r=t.type,n=void 0===r?"button":r,s=t.variant,u=t.size,d=void 0===u?"default":u,c=t.loading,p=void 0!==c&&c,b=t.disabled,f=void 0!==b&&b,v=t.tooltip,_=t.onClick,g=t.children,j=e.objectWithoutPropertiesLoose(t,["type","variant","size","loading","disabled","tooltip","onClick","children"]),m=o("reactist_button",s?"reactist_button--"+s:null,"default"!==d?"reactist_button--"+d:null,{"reactist_button--loading":p},j.className),y=i.createElement("button",Object.assign({},j,{ref:l,type:n,className:m,"aria-disabled":f||p,onClick:f||p?void 0:_}),g);return v?i.createElement(a.Tooltip,{content:v},y):y}));l.displayName="Button",l.defaultProps={size:"default",loading:!1,disabled:!1},exports.Button=l;
|
|
2
|
-
//# sourceMappingURL=button.js.map
|
|
2
|
+
//# sourceMappingURL=deprecated-button.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated-button.js","sources":["../../../src/components/deprecated-button/deprecated-button.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport { Tooltip } from '../tooltip'\n\nimport './deprecated-button.less'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\n/** @deprecated */\nexport type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link'\n\n/** @deprecated */\nexport type ButtonSize = 'default' | 'small' | 'large'\n\n/** @deprecated */\nexport type ButtonProps = Omit<NativeButtonProps, 'title' | 'ref'> & {\n /**\n * Loading style. When true it disables the button, but it also adds a visual indication of\n * some in-progress operation going on.\n */\n loading?: boolean\n /**\n * Controls visually how the button shows up from a predefined set of kinds of buttons.\n */\n variant?: ButtonVariant\n /**\n * The size of the button. If not provided it shows up in a normal size.\n */\n size?: ButtonSize\n /**\n * Tooltip that is displayed on hover.\n *\n * This replaces `title` which is not supported for these buttons to avoid confusion.\n */\n tooltip?: React.ReactNode\n}\n\n/**\n * @deprecated\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n type = 'button',\n variant,\n size = 'default',\n loading = false,\n disabled = false,\n tooltip,\n onClick,\n children,\n ...props\n },\n ref,\n) {\n const className = classNames(\n 'reactist_button',\n variant ? `reactist_button--${variant}` : null,\n size !== 'default' ? `reactist_button--${size}` : null,\n { 'reactist_button--loading': loading },\n props.className,\n )\n\n const button = (\n <button\n {...props}\n ref={ref}\n type={type}\n className={className}\n aria-disabled={disabled || loading}\n onClick={disabled || loading ? undefined : onClick}\n >\n {children}\n </button>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{button}</Tooltip> : button\n})\n\nButton.displayName = 'Button'\n\nButton.defaultProps = {\n size: 'default',\n loading: false,\n disabled: false,\n}\n\nexport { Button }\n"],"names":["Button","React","forwardRef","ref","type","variant","size","loading","disabled","tooltip","onClick","children","props","className","classNames","button","undefined","Tooltip","content","displayName","defaultProps"],"mappings":"2RA4CMA,EAASC,EAAMC,YAA2C,WAY5DC,WAVIC,KAAAA,aAAO,WACPC,IAAAA,YACAC,KAAAA,aAAO,gBACPC,QAAAA,oBACAC,SAAAA,gBACAC,IAAAA,QACAC,IAAAA,QACAC,IAAAA,SACGC,kHAIDC,EAAYC,EACd,kBACAT,sBAA8BA,EAAY,KACjC,YAATC,sBAAyCA,EAAS,KAClD,4BAA8BC,GAC9BK,EAAMC,WAGJE,EACFd,0CACQW,GACJT,IAAKA,EACLC,KAAMA,EACNS,UAAWA,kBACIL,GAAYD,EAC3BG,QAASF,GAAYD,OAAUS,EAAYN,IAE1CC,UAIFF,EAAUR,gBAACgB,WAAQC,QAAST,GAAUM,GAAoBA,KAGrEf,EAAOmB,YAAc,SAErBnB,EAAOoB,aAAe,CAClBd,KAAM,UACNC,SAAS,EACTC,UAAU"}
|
package/lib/components/{button/button.test.d.ts → deprecated-button/deprecated-button.test.d.ts}
RENAMED
|
File without changes
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./deprecated-button.js");exports.default=e.Button;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import './loading.less';
|
|
2
|
+
import './deprecated-loading.less';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
/** Additional css class that is applied to Loading. */
|
|
5
5
|
className?: string;
|
|
@@ -11,6 +11,7 @@ declare type Props = {
|
|
|
11
11
|
size?: string | number;
|
|
12
12
|
'aria-label'?: string;
|
|
13
13
|
};
|
|
14
|
+
/** @deprecated */
|
|
14
15
|
declare function Loading({ className, spinnerColor, bgColor, size, 'aria-label': ariaLabel, }: Props): JSX.Element;
|
|
15
16
|
declare namespace Loading {
|
|
16
17
|
var displayName: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var a=e(require("react")),l=e(require("classnames"));function t(e){var t=e.spinnerColor,i=void 0===t?"#3F82EF":t,r=e.bgColor,n=void 0===r?"#D9E6FB":r,o=e.size,s=void 0===o?24:o,c=e["aria-label"],d=void 0===c?"Loading":c;return a.createElement("div",{className:l("reactist_loading",e.className),"aria-label":d,"aria-live":"assertive",role:"alert"},a.createElement("span",{className:"reactist_loading--spinner"},a.createElement("svg",{width:s,height:s,viewBox:"0 0 24 24"},a.createElement("g",{fill:"none",fillRule:"nonzero"},a.createElement("path",{fill:i,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"}),a.createElement("path",{fill:n,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"})))))}t.displayName="Loading",exports.Loading=t;
|
|
2
|
-
//# sourceMappingURL=loading.js.map
|
|
2
|
+
//# sourceMappingURL=deprecated-loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated-loading.js","sources":["../../../src/components/deprecated-loading/deprecated-loading.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport './deprecated-loading.less'\n\ntype Props = {\n /** Additional css class that is applied to Loading. */\n className?: string\n /** Hex code of the spinner color. */\n spinnerColor?: string\n /** Hex code of the background color. */\n bgColor?: string\n /** Circle diameter in pixels. */\n size?: string | number\n\n 'aria-label'?: string\n}\n\n/** @deprecated */\nfunction Loading({\n className,\n spinnerColor = '#3F82EF',\n bgColor = '#D9E6FB',\n size = 24,\n 'aria-label': ariaLabel = 'Loading',\n}: Props) {\n return (\n <div\n className={classNames('reactist_loading', className)}\n aria-label={ariaLabel}\n aria-live=\"assertive\"\n role=\"alert\"\n >\n <span className=\"reactist_loading--spinner\">\n <svg width={size} height={size} viewBox={'0 0 24 24'}>\n <g fill=\"none\" fillRule=\"nonzero\">\n <path\n fill={spinnerColor}\n 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\"\n />\n <path\n fill={bgColor}\n 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\"\n />\n </g>\n </svg>\n </span>\n </div>\n )\n}\n\nLoading.displayName = 'Loading'\n\nexport { Loading }\n"],"names":["Loading","spinnerColor","bgColor","size","ariaLabel","React","className","classNames","role","width","height","viewBox","fill","fillRule","d","displayName"],"mappings":"+LAmBA,SAASA,aAELC,aAAAA,aAAe,gBACfC,QAAAA,aAAU,gBACVC,KAAAA,aAAO,SACP,cAAcC,aAAY,mBAGtBC,uBACIC,UAAWC,EAAW,qBAR9BD,wBASoBF,cACF,YACVI,KAAK,SAELH,wBAAMC,UAAU,6BACZD,uBAAKI,MAAON,EAAMO,OAAQP,EAAMQ,QAAS,aACrCN,qBAAGO,KAAK,OAAOC,SAAS,WACpBR,wBACIO,KAAMX,EACNa,EAAE,iJAENT,wBACIO,KAAMV,EACNY,EAAE,kOAS9Bd,EAAQe,YAAc"}
|
package/lib/components/{loading/Loading.test.d.ts → deprecated-loading/deprecated-loading.test.d.ts}
RENAMED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loading as DeprecatedLoading } from './deprecated-loading';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import './modal.less';
|
|
2
|
+
import './deprecated-modal.less';
|
|
3
3
|
declare type Props = {
|
|
4
4
|
/** Additional css class applied to the Modal.Box. */
|
|
5
5
|
className?: string;
|
|
@@ -12,6 +12,7 @@ declare type Props = {
|
|
|
12
12
|
/** Close the Modal when clicking on the overlay. */
|
|
13
13
|
closeOnOverlayClick: boolean;
|
|
14
14
|
};
|
|
15
|
+
/** @deprecated */
|
|
15
16
|
declare class Box extends React.Component<React.PropsWithChildren<Props>> {
|
|
16
17
|
static displayName: string;
|
|
17
18
|
static defaultProps: Props;
|
|
@@ -30,6 +31,7 @@ declare type HeaderProps = {
|
|
|
30
31
|
/** Function that is called right before the Modal unmounts itself. */
|
|
31
32
|
beforeClose?: () => void;
|
|
32
33
|
};
|
|
34
|
+
/** @deprecated */
|
|
33
35
|
declare class Header extends React.Component<HeaderProps> {
|
|
34
36
|
static displayName: string;
|
|
35
37
|
static defaultProps: HeaderProps;
|
|
@@ -51,6 +53,7 @@ declare type BodyProps = {
|
|
|
51
53
|
*/
|
|
52
54
|
showCloseIcon?: boolean;
|
|
53
55
|
};
|
|
56
|
+
/** @deprecated */
|
|
54
57
|
declare class Body extends React.Component<BodyProps> {
|
|
55
58
|
static displayName: string;
|
|
56
59
|
static defaultProps: BodyProps;
|
|
@@ -68,11 +71,13 @@ declare type ActionChildrenProps = {
|
|
|
68
71
|
close?: boolean;
|
|
69
72
|
onClick?: () => void;
|
|
70
73
|
};
|
|
74
|
+
/** @deprecated */
|
|
71
75
|
declare class Actions extends React.Component<ActionProps> {
|
|
72
76
|
static displayName: string;
|
|
73
77
|
_onClick(onClick: ActionChildrenProps['onClick']): void;
|
|
74
78
|
render(): JSX.Element;
|
|
75
79
|
}
|
|
80
|
+
/** @deprecated */
|
|
76
81
|
declare type Modal = {
|
|
77
82
|
Box: Box;
|
|
78
83
|
Header: Header;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=require("../../_virtual/_rollupPluginBabelHelpers.js"),n=e(require("react")),o=e(require("classnames")),r=e(require("react-dom")),l=require("../icons/CloseIcon.svg.js"),a=function(e){function l(){var t;return(t=e.apply(this,arguments)||this)._closeModal=function(){var e=document.getElementById("modal_box");r.unmountComponentAtNode(e)},t._handleKeyDown=function(e){27===e.keyCode&&(t._closeModal(),e.preventDefault&&e.preventDefault())},t._handleOverlayClick=function(e){e.target instanceof Element&&("reactist-overlay"===e.target.id||"reactist-overlay-inner"===e.target.id)&&t._closeModal()},t}t.inheritsLoose(l,e);var a=l.prototype;return a.componentDidMount=function(){window.addEventListener("keydown",this._handleKeyDown)},a.componentWillUnmount=function(){window.removeEventListener("keydown",this._handleKeyDown)},a.render=function(){var e=this.props,t=e.style,r=e.children,l=e.closeOnOverlayClick,a=o("reactist_modal_box",{large:e.large,medium:e.medium},this.props.className);return n.createElement("div",{className:"reactist_overlay",id:"reactist-overlay",onClick:l?this._handleOverlayClick:void 0},n.createElement("div",{className:"reactist_overlay_inner",id:"reactist-overlay-inner"},n.createElement("div",{style:t,className:a},r)))},l}(n.Component);a.displayName="Modal.Box",a.defaultProps={large:!1,closeOnOverlayClick:!1};var s=function(e){function o(){return e.apply(this,arguments)||this}t.inheritsLoose(o,e);var a=o.prototype;return a._closeModal=function(e){e.preventDefault(),"function"==typeof this.props.beforeClose&&this.props.beforeClose();var t=document.getElementById("modal_box");r.unmountComponentAtNode(t)},a.render=function(){return n.createElement("div",{className:"reactist_modal_box__header"},n.createElement("p",null,this.props.title&&n.createElement("span",{className:"title"},this.props.title),this.props.subtitle&&n.createElement("span",{className:"subtitle"},this.props.subtitle),this.props.children),n.createElement("a",{className:"close",onClick:this._closeModal.bind(this),href:"#"},n.createElement(l.default,null)))},o}(n.Component);s.displayName="Modal.Header";var i=function(e){function a(){return e.apply(this,arguments)||this}t.inheritsLoose(a,e);var s=a.prototype;return s._closeModal=function(e){e.preventDefault();var t=document.getElementById("modal_box");r.unmountComponentAtNode(t)},s.render=function(){var e=this.props,t=e.icon,r=e.children,a=e.style,s=e.showCloseIcon,i=o("reactist_modal_box__body",{plain:e.plain},this.props.className);return n.createElement("div",{className:i,style:a},s&&n.createElement("a",{className:"close",onClick:this._closeModal.bind(this),href:"#"},n.createElement(l.default,null)),t?n.createElement("div",{className:"dialog"},n.createElement("div",{className:"reactist_icon"},t),n.createElement("div",{className:"content"},r)):r)},a}(n.Component);i.displayName="Modal.Body",i.defaultProps={showCloseIcon:!1};var c=function(e){function o(){return e.apply(this,arguments)||this}t.inheritsLoose(o,e);var l=o.prototype;return l._onClick=function(e){e&&e();var t=document.getElementById("modal_box");r.unmountComponentAtNode(t)},l.render=function(){var e=this,t=n.Children.map(this.props.children,(function(t){var o;return(null==t||null===(o=t.props)||void 0===o?void 0:o.close)?n.cloneElement(t,{onClick:function(){return e._onClick(t.props.onClick)}}):t?n.cloneElement(t):n.createElement(n.Fragment,null)}));return n.createElement("div",{className:"reactist_modal_box__actions"},t)},o}(n.Component);c.displayName="Modal.Actions",exports.Actions=c,exports.Body=i,exports.Box=a,exports.Header=s;
|
|
2
|
-
//# sourceMappingURL=modal.js.map
|
|
2
|
+
//# sourceMappingURL=deprecated-modal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated-modal.js","sources":["../../../src/components/deprecated-modal/deprecated-modal.tsx"],"sourcesContent":["import React from 'react'\nimport ReactDOM from 'react-dom'\nimport classnames from 'classnames'\n\nimport CloseIcon from '../icons/CloseIcon.svg'\n\nimport './deprecated-modal.less'\n\ntype Props = {\n /** Additional css class applied to the Modal.Box. */\n className?: string\n /** Sometimes a class name is not enough so you can use this to set the style directly. */\n style?: React.CSSProperties\n /** Large style. */\n large: boolean\n /** Medium size syle. */\n medium?: boolean\n /** Close the Modal when clicking on the overlay. */\n closeOnOverlayClick: boolean\n}\n\n/** @deprecated */\nclass Box extends React.Component<React.PropsWithChildren<Props>> {\n public static displayName: string\n public static defaultProps: Props\n\n componentDidMount() {\n window.addEventListener('keydown', this._handleKeyDown)\n }\n\n componentWillUnmount() {\n window.removeEventListener('keydown', this._handleKeyDown)\n }\n\n _closeModal = () => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const modalElement = document.getElementById('modal_box')!\n ReactDOM.unmountComponentAtNode(modalElement)\n }\n\n _handleKeyDown = (event: Partial<KeyboardEvent>) => {\n if (event.keyCode === 27) {\n // ESC\n this._closeModal()\n if (event.preventDefault) event.preventDefault()\n }\n }\n\n _handleOverlayClick = (event: React.MouseEvent<Element>) => {\n if (\n event.target instanceof Element &&\n (event.target.id === 'reactist-overlay' || event.target.id === 'reactist-overlay-inner')\n ) {\n this._closeModal()\n }\n }\n\n render() {\n const { large, medium, style, children, closeOnOverlayClick } = this.props\n\n const className = classnames('reactist_modal_box', { large, medium }, this.props.className)\n\n return (\n <div\n className=\"reactist_overlay\"\n id=\"reactist-overlay\"\n onClick={closeOnOverlayClick ? this._handleOverlayClick : undefined}\n >\n <div className=\"reactist_overlay_inner\" id=\"reactist-overlay-inner\">\n <div style={style} className={className}>\n {children}\n </div>\n </div>\n </div>\n )\n }\n}\nBox.displayName = 'Modal.Box'\nBox.defaultProps = {\n large: false,\n closeOnOverlayClick: false,\n}\n\ntype HeaderProps = {\n /** Title of the Modal.Header. */\n title?: string | React.ReactNode\n /** Subtitle of the Modal.Header. */\n subtitle?: string | React.ReactNode\n /** Function that is called right before the Modal unmounts itself. */\n beforeClose?: () => void\n}\n\n/** @deprecated */\nclass Header extends React.Component<HeaderProps> {\n public static displayName: string\n public static defaultProps: HeaderProps\n\n _closeModal(event: React.MouseEvent) {\n event.preventDefault()\n if (typeof this.props.beforeClose === 'function') {\n this.props.beforeClose()\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const modalElement = document.getElementById('modal_box')!\n ReactDOM.unmountComponentAtNode(modalElement)\n }\n\n render() {\n return (\n /* eslint-disable jsx-a11y/anchor-is-valid */\n <div className=\"reactist_modal_box__header\">\n <p>\n {this.props.title && <span className=\"title\">{this.props.title}</span>}\n {this.props.subtitle && <span className=\"subtitle\">{this.props.subtitle}</span>}\n {this.props.children}\n </p>\n <a className=\"close\" onClick={this._closeModal.bind(this)} href=\"#\">\n <CloseIcon />\n </a>\n </div>\n /* eslint-enable jsx-a11y/anchor-is-valid */\n )\n }\n}\nHeader.displayName = 'Modal.Header'\n\ntype BodyProps = {\n /** Display an icon (or basically any component) on the right hand side of the Modal.Body. */\n icon?: React.ReactNode\n /** Applies less styles on the body (e.g. no padding) */\n plain?: boolean\n /** Sometimes a class name is not enough so you can use this to set the style directly. */\n style?: React.CSSProperties\n /** Additionall css class applied to the Modal.Body. */\n className?: string\n /**\n * Render a close icon in the top right corner of the Modal.Body.\n * Recommended to use when no Modal.Header is used.\n */\n showCloseIcon?: boolean\n}\n\n/** @deprecated */\nclass Body extends React.Component<BodyProps> {\n public static displayName: string\n public static defaultProps: BodyProps\n\n _closeModal(event: React.MouseEvent) {\n event.preventDefault()\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const modalElement = document.getElementById('modal_box')!\n ReactDOM.unmountComponentAtNode(modalElement)\n }\n\n render() {\n const { icon, plain, children, style, showCloseIcon } = this.props\n const className = classnames('reactist_modal_box__body', { plain }, this.props.className)\n\n return (\n /* eslint-disable jsx-a11y/anchor-is-valid */\n <div className={className} style={style}>\n {showCloseIcon && (\n <a className=\"close\" onClick={this._closeModal.bind(this)} href=\"#\">\n <CloseIcon />\n </a>\n )}\n {icon ? (\n <div className=\"dialog\">\n <div className=\"reactist_icon\">{icon}</div>\n <div className=\"content\">{children}</div>\n </div>\n ) : (\n children\n )}\n </div>\n /* eslint-enable jsx-a11y/anchor-is-valid */\n )\n }\n}\nBody.displayName = 'Modal.Body'\nBody.defaultProps = {\n showCloseIcon: false,\n}\n\ntype ActionProps = {\n /**\n * Children to render inside the Modal.Actions. They can have an optional `close` property (boolean).\n * When that is supplied and set to true it will close the modal after the onClick function\n */\n children?: React.ReactNode\n}\n\ntype ActionChildrenProps = {\n close?: boolean\n onClick?: () => void\n}\n\n/** @deprecated */\nclass Actions extends React.Component<ActionProps> {\n public static displayName: string\n\n _onClick(onClick: ActionChildrenProps['onClick']) {\n if (onClick) {\n onClick()\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const modalElement = document.getElementById('modal_box')!\n ReactDOM.unmountComponentAtNode(modalElement)\n }\n\n render() {\n const children = React.Children.map(\n // see: https://github.com/microsoft/TypeScript/issues/21699\n // @ts-expect-error Children cannot be typed properly yet in React\n this.props.children,\n (child: React.ReactElement<ActionChildrenProps>) => {\n if (child?.props?.close) {\n return React.cloneElement(child, {\n onClick: () => this._onClick(child.props.onClick),\n })\n } else {\n return child ? React.cloneElement(child) : <></>\n }\n },\n )\n\n return <div className=\"reactist_modal_box__actions\">{children}</div>\n }\n}\n\nActions.displayName = 'Modal.Actions'\n\n/** @deprecated */\ntype Modal = {\n Box: Box\n Header: Header\n Body: Body\n Actions: Actions\n}\n\nexport type { Modal }\n\nexport { Box, Header, Body, Actions }\n"],"names":["Box","modalElement","document","getElementById","ReactDOM","unmountComponentAtNode","event","keyCode","_closeModal","preventDefault","target","Element","id","componentDidMount","window","addEventListener","this","_handleKeyDown","componentWillUnmount","removeEventListener","render","props","style","children","closeOnOverlayClick","className","classnames","large","medium","React","onClick","_handleOverlayClick","undefined","Component","displayName","defaultProps","Header","beforeClose","title","subtitle","bind","href","CloseIcon","Body","icon","showCloseIcon","plain","Actions","_onClick","Children","map","child","_child$props","close","cloneElement","_this2"],"mappings":"yTAsBMA,qFAYY,eAEJC,EAAeC,SAASC,eAAe,aAC7CC,EAASC,uBAAuBJ,qBAGnB,SAACK,GACQ,KAAlBA,EAAMC,YAEDC,cACDF,EAAMG,gBAAgBH,EAAMG,yCAIlB,SAACH,GAEfA,EAAMI,kBAAkBC,UACH,qBAApBL,EAAMI,OAAOE,IAAiD,2BAApBN,EAAMI,OAAOE,OAEnDJ,iEA3BbK,kBAAA,WACIC,OAAOC,iBAAiB,UAAWC,KAAKC,mBAG5CC,qBAAA,WACIJ,OAAOK,oBAAoB,UAAWH,KAAKC,mBA0B/CG,OAAA,iBACoEJ,KAAKK,MAA9CC,IAAAA,MAAOC,IAAAA,SAAUC,IAAAA,oBAElCC,EAAYC,EAAW,qBAAsB,CAAEC,QAF7CA,MAEoDC,SAF7CA,QAEuDZ,KAAKK,MAAMI,kBAG7EI,uBACIJ,UAAU,mBACVb,GAAG,mBACHkB,QAASN,EAAsBR,KAAKe,yBAAsBC,GAE1DH,uBAAKJ,UAAU,yBAAyBb,GAAG,0BACvCiB,uBAAKP,MAAOA,EAAOG,UAAWA,GACzBF,SAhDPM,EAAMI,WAuDxBjC,EAAIkC,YAAc,YAClBlC,EAAImC,aAAe,CACfR,OAAO,EACPH,qBAAqB,OAanBY,gHAIF5B,YAAA,SAAYF,GACRA,EAAMG,iBACgC,mBAA3BO,KAAKK,MAAMgB,kBACbhB,MAAMgB,kBAGTpC,EAAeC,SAASC,eAAe,aAC7CC,EAASC,uBAAuBJ,MAGpCmB,OAAA,kBAGQS,uBAAKJ,UAAU,8BACXI,yBACKb,KAAKK,MAAMiB,OAAST,wBAAMJ,UAAU,SAAST,KAAKK,MAAMiB,OACxDtB,KAAKK,MAAMkB,UAAYV,wBAAMJ,UAAU,YAAYT,KAAKK,MAAMkB,UAC9DvB,KAAKK,MAAME,UAEhBM,qBAAGJ,UAAU,QAAQK,QAASd,KAAKR,YAAYgC,KAAKxB,MAAOyB,KAAK,KAC5DZ,gBAACa,sBAxBAb,EAAMI,WA+B3BG,EAAOF,YAAc,mBAmBfS,gHAIFnC,YAAA,SAAYF,GACRA,EAAMG,qBAEAR,EAAeC,SAASC,eAAe,aAC7CC,EAASC,uBAAuBJ,MAGpCmB,OAAA,iBAC4DJ,KAAKK,MAArDuB,IAAAA,KAAarB,IAAAA,SAAUD,IAAAA,MAAOuB,IAAAA,cAChCpB,EAAYC,EAAW,2BAA4B,CAAEoB,QAD7CA,OACsD9B,KAAKK,MAAMI,kBAI3EI,uBAAKJ,UAAWA,EAAWH,MAAOA,GAC7BuB,GACGhB,qBAAGJ,UAAU,QAAQK,QAASd,KAAKR,YAAYgC,KAAKxB,MAAOyB,KAAK,KAC5DZ,gBAACa,iBAGRE,EACGf,uBAAKJ,UAAU,UACXI,uBAAKJ,UAAU,iBAAiBmB,GAChCf,uBAAKJ,UAAU,WAAWF,IAG9BA,OA7BDM,EAAMI,WAoCzBU,EAAKT,YAAc,aACnBS,EAAKR,aAAe,CAChBU,eAAe,OAiBbE,gHAGFC,SAAA,SAASlB,GACDA,GACAA,QAGE7B,EAAeC,SAASC,eAAe,aAC7CC,EAASC,uBAAuBJ,MAGpCmB,OAAA,sBACUG,EAAWM,EAAMoB,SAASC,SAGvB7B,MAAME,UACX,SAAC4B,gBACOA,MAAAA,aAAAA,EAAO9B,0BAAP+B,EAAcC,OACPxB,EAAMyB,aAAaH,EAAO,CAC7BrB,QAAS,kBAAMyB,EAAKP,SAASG,EAAM9B,MAAMS,YAGtCqB,EAAQtB,EAAMyB,aAAaH,GAAStB,2CAKhDA,uBAAKJ,UAAU,+BAA+BF,OA5BvCM,EAAMI,WAgC5Bc,EAAQb,YAAc"}
|
package/lib/components/{modal/modal.test.d.ts → deprecated-modal/deprecated-modal.test.d.ts}
RENAMED
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Box, Header, Body, Actions } from './modal';
|
|
2
|
-
import type { Modal } from './modal';
|
|
1
|
+
import { Box, Header, Body, Actions } from './deprecated-modal';
|
|
2
|
+
import type { Modal } from './deprecated-modal';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
Box: typeof Box;
|
|
5
5
|
Header: typeof Header;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/deprecated-modal/index.ts"],"sourcesContent":["import { Box, Header, Body, Actions } from './deprecated-modal'\nimport type { Modal } from './deprecated-modal'\n\nexport default { Box, Header, Body, Actions }\nexport type { Modal }\n"],"names":["Box","Header","Body","Actions"],"mappings":"2HAGe,CAAEA,IAAAA,MAAKC,OAAAA,SAAQC,KAAAA,OAAMC,QAAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),o=t(require("react")),i=t(require("classnames")),n=require("
|
|
1
|
+
"use strict";function t(t){return t&&"object"==typeof t&&"default"in t?t.default:t}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../_virtual/_rollupPluginBabelHelpers.js"),o=t(require("react")),i=t(require("classnames")),n=t(require("react-dom")),r=require("../deprecated-button/index.js"),s=function(t){function r(o,i){var r;return(r=t.call(this,o,i)||this)._handleClickOutside=function(t){var o=n.findDOMNode(e.assertThisInitialized(r));o&&!o.contains(t.target)?r._toggleShowBody():r.props.allowBodyInteractions||(r._timeout=setTimeout((function(){r.state.showBody&&r._toggleShowBody()}),100))},r._toggleShowBody=function(){r.state.showBody?(r.props.onHideBody&&r.props.onHideBody(),document.removeEventListener("click",r._handleClickOutside,!0)):(r.props.onShowBody&&r.props.onShowBody(),document.addEventListener("click",r._handleClickOutside,!0)),r.setState({showBody:!r.state.showBody})},r._setPosition=function(t){if(t){var o=document.getElementById(r.props.scrolling_parent?r.props.scrolling_parent:"");if(o){var i=n.findDOMNode(e.assertThisInitialized(r));if(!i)return;var s=n.findDOMNode(e.assertThisInitialized(r)).offsetTop,l=i.querySelector(".trigger");if(!l)return;var a=o.clientHeight+o.scrollTop-s-l.clientHeight<t.clientHeight;a!==r.state.top&&r.setState({top:a})}}},r.state={showBody:!1,top:o.top||!1},r._timeout=void 0,r}e.inheritsLoose(r,t);var s=r.prototype;return s.componentWillUnmount=function(){document.removeEventListener("click",this._handleClickOutside,!0),this._timeout&&clearTimeout(this._timeout)},s._getTriggerComponent=function(){var t,e=null===(t=this.props.children)||void 0===t?void 0:t[0];return e?o.cloneElement(e,{onClick:this._toggleShowBody}):void 0},s._getBodyComponent=function(){if(!this.state.showBody)return null;var t=this.state.top,e=this.props,n=e.right,r=e.children,s={top:t,right:void 0!==n&&n,setPosition:this._setPosition},l=i({body_wrapper:!0,with_arrow:!0,top:t,bottom:!t}),a=null==r?void 0:r[1],d="function"==typeof a?a(s):a?o.cloneElement(a,s):void 0;return o.createElement("div",{className:l,style:{position:"relative"}},d)},s.render=function(){var t=i("reactist_dropdown",this.props.className),e=this.state.top;return o.createElement("div",{style:{display:"inline-block"},className:t},e&&this._getBodyComponent(),this._getTriggerComponent(),!e&&this._getBodyComponent())},r}(o.Component);s.displayName="Dropdown.Box";var l=o.forwardRef((function(t,n){var s=t.children,l=t.onClick,a=t.tooltip,d=t.className,c=e.objectWithoutPropertiesLoose(t,["children","onClick","tooltip","className"]);return o.createElement(r.default,Object.assign({},c,{className:i("trigger",d),onClick:function(t){t.preventDefault(),t.stopPropagation(),l&&l(t)},tooltip:a,ref:n}),s)}));function a(t){var e=t.right,i=t.children,n=t.setPosition,r={position:"absolute",right:0,top:0};return t.top&&(r.top="auto",r.bottom=0),e&&(r.right="auto",r.left=0),o.createElement("div",{ref:n,style:r,className:"body",id:"reactist-dropdown-body"},i)}l.displayName="Dropdown.Trigger",a.displayName="Dropdown.Body",exports.Dropdown={Box:s,Trigger:l,Body:a};
|
|
2
2
|
//# sourceMappingURL=dropdown.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.js","sources":["../../../src/components/dropdown/dropdown.tsx"],"sourcesContent":["import React from 'react'\nimport ReactDOM from 'react-dom'\nimport classNames from 'classnames'\n\nimport Button from '../button'\n\nimport './dropdown.less'\n\ntype BoxProps = {\n onShowBody?: () => void\n onHideBody?: () => void\n allowBodyInteractions?: boolean\n top?: boolean\n right?: boolean\n scrolling_parent?: string\n children?: [\n React.ReactElement<TriggerProps>,\n React.ReactElement<BodyProps> | ((props: BodyProps) => JSX.Element),\n ]\n className?: string\n}\n\ntype BoxState = {\n top: boolean\n showBody: boolean\n}\n\nclass Box extends React.Component<React.PropsWithChildren<BoxProps>, BoxState> {\n public static displayName: string\n\n constructor(props: BoxProps, context: React.Context<unknown>) {\n super(props, context)\n this.state = {\n showBody: false,\n top: props.top || false,\n }\n\n this._timeout = undefined\n }\n\n componentWillUnmount() {\n document.removeEventListener('click', this._handleClickOutside, true)\n if (this._timeout) {\n clearTimeout(this._timeout)\n }\n }\n _timeout?: ReturnType<typeof setTimeout>\n\n _handleClickOutside = (event: MouseEvent) => {\n const dropdownDOMNode = ReactDOM.findDOMNode(this)\n\n if (dropdownDOMNode && !dropdownDOMNode.contains(event.target as Node))\n this._toggleShowBody()\n else if (!this.props.allowBodyInteractions) {\n // won't close when body interactions are allowed\n this._timeout = setTimeout(() => {\n if (this.state.showBody) {\n this._toggleShowBody()\n }\n }, 100)\n }\n }\n\n _toggleShowBody = () => {\n if (!this.state.showBody) {\n // will show\n if (this.props.onShowBody) this.props.onShowBody()\n document.addEventListener('click', this._handleClickOutside, true)\n } else {\n // will hide\n if (this.props.onHideBody) this.props.onHideBody()\n document.removeEventListener('click', this._handleClickOutside, true)\n }\n\n this.setState({\n showBody: !this.state.showBody,\n })\n }\n\n _getTriggerComponent() {\n const _trigger = this.props.children?.[0]\n return _trigger\n ? React.cloneElement(_trigger, { onClick: this._toggleShowBody })\n : undefined\n }\n\n // https://facebook.github.io/react/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components\n _setPosition = (body: HTMLElement | null) => {\n if (body) {\n const scrollingParent = document.getElementById(\n this.props.scrolling_parent ? this.props.scrolling_parent : '',\n )\n\n if (scrollingParent) {\n const dropdown = ReactDOM.findDOMNode(this)\n if (!dropdown) {\n return\n }\n const dropdownVerticalPosition = (ReactDOM.findDOMNode(this) as HTMLElement)\n .offsetTop\n const dropdownTrigger = (dropdown as Element).querySelector('.trigger')\n if (!dropdownTrigger) {\n return\n }\n const dropdownTriggerHeight = dropdownTrigger.clientHeight\n const dropdownBodyHeight = body.clientHeight\n\n const scrollingParentHeight = scrollingParent.clientHeight\n const scrollingParentOffset = scrollingParent.scrollTop\n\n const bottomOffset =\n scrollingParentHeight +\n scrollingParentOffset -\n dropdownVerticalPosition -\n dropdownTriggerHeight\n\n const top = bottomOffset < dropdownBodyHeight\n\n if (top !== this.state.top) {\n this.setState({ top })\n }\n }\n }\n }\n\n _getBodyComponent() {\n if (!this.state.showBody) {\n return null\n }\n const { top } = this.state\n const { right = false, children } = this.props\n const props = { top, right, setPosition: this._setPosition }\n\n const className = classNames({\n body_wrapper: true,\n with_arrow: true,\n top: top,\n bottom: !top,\n })\n\n const body = children?.[1]\n\n const contentMarkup =\n typeof body === 'function'\n ? body(props)\n : body\n ? React.cloneElement(body, props)\n : undefined\n return (\n <div className={className} style={{ position: 'relative' }}>\n {contentMarkup}\n </div>\n )\n }\n\n render() {\n const className = classNames('reactist_dropdown', this.props.className)\n const { top } = this.state\n\n return (\n <div style={{ display: 'inline-block' }} className={className}>\n {top && this._getBodyComponent()}\n {this._getTriggerComponent()}\n {!top && this._getBodyComponent()}\n </div>\n )\n }\n}\n\nBox.displayName = 'Dropdown.Box'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\ntype TriggerProps = Omit<NativeButtonProps, 'title'> & {\n tooltip?: React.ReactNode\n}\n\nconst Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(function Trigger(\n { children, onClick, tooltip, className, ...props },\n ref,\n) {\n function handleClick(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) {\n event.preventDefault()\n event.stopPropagation()\n if (onClick) onClick(event)\n }\n\n return (\n <Button\n {...props}\n className={classNames('trigger', className)}\n onClick={handleClick}\n tooltip={tooltip}\n ref={ref}\n >\n {children}\n </Button>\n )\n})\n\nTrigger.displayName = 'Dropdown.Trigger'\n\ntype BodyProps = {\n setPosition?: React.Ref<HTMLDivElement>\n children?: React.ReactNode\n top?: boolean\n right?: boolean\n}\n\nfunction Body({ top, right, children, setPosition }: BodyProps) {\n const style: React.CSSProperties = { position: 'absolute', right: 0, top: 0 }\n\n if (top) {\n style.top = 'auto'\n style.bottom = 0\n }\n\n if (right) {\n style.right = 'auto'\n style.left = 0\n }\n\n return (\n <div ref={setPosition} style={style} className=\"body\" id=\"reactist-dropdown-body\">\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dropdown.Body'\n\nconst Dropdown = {\n Box,\n Trigger,\n Body,\n}\n\nexport { Dropdown }\n"],"names":["Box","props","context","event","dropdownDOMNode","ReactDOM","findDOMNode","contains","target","_this","_toggleShowBody","allowBodyInteractions","_timeout","setTimeout","state","showBody","onHideBody","document","removeEventListener","_handleClickOutside","onShowBody","addEventListener","setState","body","scrollingParent","getElementById","scrolling_parent","dropdown","dropdownVerticalPosition","offsetTop","dropdownTrigger","querySelector","top","clientHeight","scrollTop","undefined","componentWillUnmount","this","clearTimeout","_getTriggerComponent","_trigger","children","_this$props$children","React","cloneElement","onClick","_getBodyComponent","right","setPosition","_setPosition","className","classNames","body_wrapper","with_arrow","bottom","contentMarkup","style","position","render","display","Component","displayName","Trigger","forwardRef","ref","tooltip","Button","preventDefault","stopPropagation","Body","left","id"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"dropdown.js","sources":["../../../src/components/dropdown/dropdown.tsx"],"sourcesContent":["import React from 'react'\nimport ReactDOM from 'react-dom'\nimport classNames from 'classnames'\n\nimport Button from '../deprecated-button'\n\nimport './dropdown.less'\n\ntype BoxProps = {\n onShowBody?: () => void\n onHideBody?: () => void\n allowBodyInteractions?: boolean\n top?: boolean\n right?: boolean\n scrolling_parent?: string\n children?: [\n React.ReactElement<TriggerProps>,\n React.ReactElement<BodyProps> | ((props: BodyProps) => JSX.Element),\n ]\n className?: string\n}\n\ntype BoxState = {\n top: boolean\n showBody: boolean\n}\n\nclass Box extends React.Component<React.PropsWithChildren<BoxProps>, BoxState> {\n public static displayName: string\n\n constructor(props: BoxProps, context: React.Context<unknown>) {\n super(props, context)\n this.state = {\n showBody: false,\n top: props.top || false,\n }\n\n this._timeout = undefined\n }\n\n componentWillUnmount() {\n document.removeEventListener('click', this._handleClickOutside, true)\n if (this._timeout) {\n clearTimeout(this._timeout)\n }\n }\n _timeout?: ReturnType<typeof setTimeout>\n\n _handleClickOutside = (event: MouseEvent) => {\n const dropdownDOMNode = ReactDOM.findDOMNode(this)\n\n if (dropdownDOMNode && !dropdownDOMNode.contains(event.target as Node))\n this._toggleShowBody()\n else if (!this.props.allowBodyInteractions) {\n // won't close when body interactions are allowed\n this._timeout = setTimeout(() => {\n if (this.state.showBody) {\n this._toggleShowBody()\n }\n }, 100)\n }\n }\n\n _toggleShowBody = () => {\n if (!this.state.showBody) {\n // will show\n if (this.props.onShowBody) this.props.onShowBody()\n document.addEventListener('click', this._handleClickOutside, true)\n } else {\n // will hide\n if (this.props.onHideBody) this.props.onHideBody()\n document.removeEventListener('click', this._handleClickOutside, true)\n }\n\n this.setState({\n showBody: !this.state.showBody,\n })\n }\n\n _getTriggerComponent() {\n const _trigger = this.props.children?.[0]\n return _trigger\n ? React.cloneElement(_trigger, { onClick: this._toggleShowBody })\n : undefined\n }\n\n // https://facebook.github.io/react/docs/refs-and-the-dom.html#exposing-dom-refs-to-parent-components\n _setPosition = (body: HTMLElement | null) => {\n if (body) {\n const scrollingParent = document.getElementById(\n this.props.scrolling_parent ? this.props.scrolling_parent : '',\n )\n\n if (scrollingParent) {\n const dropdown = ReactDOM.findDOMNode(this)\n if (!dropdown) {\n return\n }\n const dropdownVerticalPosition = (ReactDOM.findDOMNode(this) as HTMLElement)\n .offsetTop\n const dropdownTrigger = (dropdown as Element).querySelector('.trigger')\n if (!dropdownTrigger) {\n return\n }\n const dropdownTriggerHeight = dropdownTrigger.clientHeight\n const dropdownBodyHeight = body.clientHeight\n\n const scrollingParentHeight = scrollingParent.clientHeight\n const scrollingParentOffset = scrollingParent.scrollTop\n\n const bottomOffset =\n scrollingParentHeight +\n scrollingParentOffset -\n dropdownVerticalPosition -\n dropdownTriggerHeight\n\n const top = bottomOffset < dropdownBodyHeight\n\n if (top !== this.state.top) {\n this.setState({ top })\n }\n }\n }\n }\n\n _getBodyComponent() {\n if (!this.state.showBody) {\n return null\n }\n const { top } = this.state\n const { right = false, children } = this.props\n const props = { top, right, setPosition: this._setPosition }\n\n const className = classNames({\n body_wrapper: true,\n with_arrow: true,\n top: top,\n bottom: !top,\n })\n\n const body = children?.[1]\n\n const contentMarkup =\n typeof body === 'function'\n ? body(props)\n : body\n ? React.cloneElement(body, props)\n : undefined\n return (\n <div className={className} style={{ position: 'relative' }}>\n {contentMarkup}\n </div>\n )\n }\n\n render() {\n const className = classNames('reactist_dropdown', this.props.className)\n const { top } = this.state\n\n return (\n <div style={{ display: 'inline-block' }} className={className}>\n {top && this._getBodyComponent()}\n {this._getTriggerComponent()}\n {!top && this._getBodyComponent()}\n </div>\n )\n }\n}\n\nBox.displayName = 'Dropdown.Box'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\ntype TriggerProps = Omit<NativeButtonProps, 'title'> & {\n tooltip?: React.ReactNode\n}\n\nconst Trigger = React.forwardRef<HTMLButtonElement, TriggerProps>(function Trigger(\n { children, onClick, tooltip, className, ...props },\n ref,\n) {\n function handleClick(event: React.MouseEvent<HTMLButtonElement, MouseEvent>) {\n event.preventDefault()\n event.stopPropagation()\n if (onClick) onClick(event)\n }\n\n return (\n <Button\n {...props}\n className={classNames('trigger', className)}\n onClick={handleClick}\n tooltip={tooltip}\n ref={ref}\n >\n {children}\n </Button>\n )\n})\n\nTrigger.displayName = 'Dropdown.Trigger'\n\ntype BodyProps = {\n setPosition?: React.Ref<HTMLDivElement>\n children?: React.ReactNode\n top?: boolean\n right?: boolean\n}\n\nfunction Body({ top, right, children, setPosition }: BodyProps) {\n const style: React.CSSProperties = { position: 'absolute', right: 0, top: 0 }\n\n if (top) {\n style.top = 'auto'\n style.bottom = 0\n }\n\n if (right) {\n style.right = 'auto'\n style.left = 0\n }\n\n return (\n <div ref={setPosition} style={style} className=\"body\" id=\"reactist-dropdown-body\">\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dropdown.Body'\n\nconst Dropdown = {\n Box,\n Trigger,\n Body,\n}\n\nexport { Dropdown }\n"],"names":["Box","props","context","event","dropdownDOMNode","ReactDOM","findDOMNode","contains","target","_this","_toggleShowBody","allowBodyInteractions","_timeout","setTimeout","state","showBody","onHideBody","document","removeEventListener","_handleClickOutside","onShowBody","addEventListener","setState","body","scrollingParent","getElementById","scrolling_parent","dropdown","dropdownVerticalPosition","offsetTop","dropdownTrigger","querySelector","top","clientHeight","scrollTop","undefined","componentWillUnmount","this","clearTimeout","_getTriggerComponent","_trigger","children","_this$props$children","React","cloneElement","onClick","_getBodyComponent","right","setPosition","_setPosition","className","classNames","body_wrapper","with_arrow","bottom","contentMarkup","style","position","render","display","Component","displayName","Trigger","forwardRef","ref","tooltip","Button","preventDefault","stopPropagation","Body","left","id"],"mappings":"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"}
|
|
@@ -22,16 +22,16 @@ declare type MenuProps = Omit<Reakit.MenuInitialState, 'visible'> & {
|
|
|
22
22
|
* management for the menu components inside it.
|
|
23
23
|
*/
|
|
24
24
|
declare function Menu({ children, onItemSelect, ...props }: MenuProps): JSX.Element;
|
|
25
|
-
declare type MenuButtonProps = Omit<Reakit.MenuButtonProps, keyof Reakit.MenuStateReturn>;
|
|
25
|
+
declare type MenuButtonProps = Omit<Reakit.MenuButtonProps, keyof Reakit.MenuStateReturn | 'className'>;
|
|
26
26
|
/**
|
|
27
27
|
* A button to toggle a dropdown menu open or closed.
|
|
28
28
|
*/
|
|
29
|
-
declare const MenuButton: import("../../utils/polymorphism").PolymorphicComponent<"button", Pick<Reakit.MenuButtonProps, "children" | "unstable_system" | "disabled" | "focusable" | "unstable_clickOnEnter" | "unstable_clickOnSpace" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "
|
|
30
|
-
declare type MenuListProps = Omit<Reakit.MenuProps, keyof Reakit.MenuStateReturn>;
|
|
29
|
+
declare const MenuButton: import("../../utils/polymorphism").PolymorphicComponent<"button", Pick<Reakit.MenuButtonProps, "children" | "unstable_system" | "disabled" | "focusable" | "unstable_clickOnEnter" | "unstable_clickOnSpace" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ref" | "key" | "wrapElement" | "autoFocus" | "form" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "name" | "type" | "value">, "obfuscateClassName">;
|
|
30
|
+
declare type MenuListProps = Omit<Reakit.MenuProps, keyof Reakit.MenuStateReturn | 'className'>;
|
|
31
31
|
/**
|
|
32
32
|
* The dropdown menu itself, containing a list of menu items.
|
|
33
33
|
*/
|
|
34
|
-
declare const MenuList: import("../../utils/polymorphism").PolymorphicComponent<"div", Pick<Reakit.MenuProps, "children" | "unstable_system" | "disabled" | "focusable" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "
|
|
34
|
+
declare const MenuList: import("../../utils/polymorphism").PolymorphicComponent<"div", Pick<Reakit.MenuProps, "children" | "unstable_system" | "disabled" | "focusable" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "slot" | "spellCheck" | "style" | "tabIndex" | "title" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "ref" | "key" | "wrapElement" | "hideOnClickOutside" | "preventBodyScroll" | "unstable_initialFocusRef" | "unstable_finalFocusRef" | "unstable_orphan" | "unstable_autoFocusOnShow" | "unstable_autoFocusOnHide">, "obfuscateClassName">;
|
|
35
35
|
declare type MenuItemProps = {
|
|
36
36
|
/**
|
|
37
37
|
* An optional value given to this menu item. It is passed on to the parent `Menu`'s
|
|
@@ -50,10 +50,6 @@ declare type MenuItemProps = {
|
|
|
50
50
|
* @default true
|
|
51
51
|
*/
|
|
52
52
|
disabled?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
* A class name to apply to the menu item element.
|
|
55
|
-
*/
|
|
56
|
-
className?: string;
|
|
57
53
|
/**
|
|
58
54
|
* When `true` the menu will close when the menu item is selected, in addition to performing the
|
|
59
55
|
* action that the menu item is set out to do.
|
|
@@ -114,7 +110,7 @@ declare type SubMenuProps = Pick<MenuProps, 'children' | 'onItemSelect'>;
|
|
|
114
110
|
* opening a sub-menu with the menu items list below it.
|
|
115
111
|
*/
|
|
116
112
|
declare const SubMenu: React.ForwardRefExoticComponent<Pick<MenuProps, "children" | "onItemSelect"> & React.RefAttributes<HTMLButtonElement>>;
|
|
117
|
-
declare type MenuGroupProps = NativeProps<HTMLDivElement> & {
|
|
113
|
+
declare type MenuGroupProps = Omit<NativeProps<HTMLDivElement>, 'className'> & {
|
|
118
114
|
/**
|
|
119
115
|
* A label to be shown visually and also used to semantically label the group.
|
|
120
116
|
*/
|