@jetbrains/ring-ui-built 7.0.31 → 7.0.32
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/components/_helpers/_rollupPluginBabelHelpers.js +8 -1
- package/components/_helpers/avatar-info.js +1 -1
- package/components/avatar/avatar-info.d.ts +1 -0
- package/components/avatar/avatar-info.js +1 -1
- package/components/avatar/avatar.figma.js +40 -44
- package/components/avatar-stack/avatar-stack.js +13 -6
- package/components/button/button.figma.js +77 -107
- package/components/select/select.js +1 -1
- package/components/style.css +1 -1
- package/components/table/table.d.ts +1 -0
- package/components/table/table.js +3 -2
- package/package.json +1 -1
- package/components/avatar/avatar.figma.d.ts +0 -1
- package/components/button/button.figma.d.ts +0 -1
- package/components/button-group/button-group.figma.d.ts +0 -1
- package/components/button-group/button-group.figma.js +0 -73
@@ -47,6 +47,13 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
47
47
|
}
|
48
48
|
return t;
|
49
49
|
}
|
50
|
+
function _taggedTemplateLiteral(e, t) {
|
51
|
+
return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {
|
52
|
+
raw: {
|
53
|
+
value: Object.freeze(t)
|
54
|
+
}
|
55
|
+
}));
|
56
|
+
}
|
50
57
|
function _toPrimitive(t, r) {
|
51
58
|
if ("object" != typeof t || !t) return t;
|
52
59
|
var e = t[Symbol.toPrimitive];
|
@@ -62,4 +69,4 @@ function _toPropertyKey(t) {
|
|
62
69
|
return "symbol" == typeof i ? i : i + "";
|
63
70
|
}
|
64
71
|
|
65
|
-
export { _defineProperty as _, _objectWithoutProperties as a, _objectSpread2 as b,
|
72
|
+
export { _defineProperty as _, _objectWithoutProperties as a, _objectSpread2 as b, _taggedTemplateLiteral as c, _toPropertyKey as d };
|
@@ -1,45 +1,41 @@
|
|
1
|
-
import {
|
2
|
-
import
|
3
|
-
import figma from '@figma/code-connect';
|
4
|
-
import Avatar from './avatar.js';
|
5
|
-
import { Size } from './avatar-size.js';
|
6
|
-
import 'core-js/modules/es.string.includes.js';
|
7
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
8
|
-
import 'react';
|
9
|
-
import 'classnames';
|
10
|
-
import 'util-deprecate';
|
11
|
-
import '../global/url.js';
|
12
|
-
import 'core-js/modules/es.regexp.exec.js';
|
13
|
-
import 'core-js/modules/es.string.match.js';
|
14
|
-
import 'core-js/modules/es.string.replace.js';
|
15
|
-
import '../global/dom.js';
|
16
|
-
import 'core-js/modules/es.object.assign.js';
|
17
|
-
import 'core-js/modules/es.string.split.js';
|
18
|
-
import '../global/memoize.js';
|
19
|
-
import 'core-js/modules/es.weak-map.js';
|
20
|
-
import '../_helpers/avatar-info.js';
|
21
|
-
import './fallback-avatar.js';
|
22
|
-
import '../global/get-uid.js';
|
23
|
-
import 'core-js/modules/es.regexp.to-string.js';
|
1
|
+
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
|
+
import 'core-js/modules/es.parse-int.js';
|
24
3
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
4
|
+
var _templateObject;
|
5
|
+
// url=https://www.figma.com/design/HY6d4uE1xxaQXCMG9fe6Y2/RingUI?node-id=5990-522
|
6
|
+
const figma = require('figma');
|
7
|
+
const instance = figma.selectedInstance;
|
8
|
+
const round = instance.getBoolean('Round');
|
9
|
+
const size = parseInt(instance.getString('Size'), 10);
|
10
|
+
const content = instance.getString('Content');
|
11
|
+
const props = [];
|
12
|
+
const DEFAULT_SIZE = 20;
|
13
|
+
const isDefaultSize = size === DEFAULT_SIZE;
|
14
|
+
const imports = ["import Avatar".concat(isDefaultSize ? '' : ', {Size}', " from '@jetbrains/ring-ui/components/avatar/avatar'")];
|
15
|
+
if (!isDefaultSize) {
|
16
|
+
props.push("size={Size.Size".concat(size, "}"));
|
17
|
+
}
|
18
|
+
switch (content) {
|
19
|
+
case 'color/image':
|
20
|
+
props.push('url="avatar.png"');
|
21
|
+
break;
|
22
|
+
case 'name':
|
23
|
+
props.push('username="Samuel Morse"');
|
24
|
+
break;
|
25
|
+
case 'label':
|
26
|
+
props.push('info="5"');
|
27
|
+
break;
|
28
|
+
case 'icon':
|
29
|
+
imports.push("import Icon from '@jetbrains/ring-ui/components/icon/icon'", "import warningIcon from '@jetbrains/icons/warning.svg'");
|
30
|
+
props.push('info={<Icon glyph={warningIcon} />}');
|
31
|
+
break;
|
32
|
+
}
|
33
|
+
if (round) {
|
34
|
+
props.push('round');
|
35
|
+
}
|
36
|
+
var avatar_figma = {
|
37
|
+
id: 'avatar',
|
38
|
+
example: figma.code(_templateObject || (_templateObject = _taggedTemplateLiteral(["", "\n\n<Avatar ", "/>"])), imports.join('\n'), props.map(prop => "".concat(prop, " ")).join(''))
|
39
|
+
};
|
40
|
+
|
41
|
+
export { avatar_figma as default };
|
@@ -4,7 +4,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
4
4
|
import { useState, Children } from 'react';
|
5
5
|
import classNames from 'classnames';
|
6
6
|
import DropdownMenu from '../dropdown-menu/dropdown-menu.js';
|
7
|
-
import '../avatar/avatar.js';
|
7
|
+
import Avatar from '../avatar/avatar.js';
|
8
|
+
import { f as fontSizes } from '../_helpers/avatar-info.js';
|
8
9
|
import { Size } from '../avatar/avatar-size.js';
|
9
10
|
import 'core-js/modules/es.object.assign.js';
|
10
11
|
import '../list/list.js';
|
@@ -50,7 +51,6 @@ import '../_helpers/list.js';
|
|
50
51
|
import '../list/consts.js';
|
51
52
|
import '../list/list__classes.js';
|
52
53
|
import '../global/url.js';
|
53
|
-
import '../_helpers/avatar-info.js';
|
54
54
|
import '../avatar/fallback-avatar.js';
|
55
55
|
import '../list/list__custom.js';
|
56
56
|
import '../global/get-event-key.js';
|
@@ -75,7 +75,7 @@ import 'core-js/modules/es.array.sort.js';
|
|
75
75
|
import '../popup/popup.consts.js';
|
76
76
|
import '../popup/popup.target.js';
|
77
77
|
|
78
|
-
var styles = {"avatarStack":"avatarStack_rui_9a0c","extraText":"extraText_rui_9a0c
|
78
|
+
var styles = {"avatarStack":"avatarStack_rui_9a0c","extraText":"extraText_rui_9a0c","item":"item_rui_9a0c","size20":"size20_rui_9a0c","size24":"size24_rui_9a0c","size28":"size28_rui_9a0c","size32":"size32_rui_9a0c","size40":"size40_rui_9a0c","size56":"size56_rui_9a0c","hovered":"hovered_rui_9a0c","extra":"extra_rui_9a0c item_rui_9a0c","extraButton":"extraButton_rui_9a0c resetButton_rui_8bff"};
|
79
79
|
|
80
80
|
const _excluded = ["children", "className", "size", "extraItems", "dropdownMenuProps"];
|
81
81
|
function AvatarStack(_ref) {
|
@@ -108,12 +108,19 @@ function AvatarStack(_ref) {
|
|
108
108
|
style: {
|
109
109
|
width: size,
|
110
110
|
height: size,
|
111
|
-
'--ring-avatar-stack-index': Children.count(children)
|
111
|
+
'--ring-avatar-stack-index': Children.count(children),
|
112
|
+
fontSize: fontSizes[size]
|
112
113
|
},
|
113
114
|
anchor: jsx("button", {
|
114
115
|
type: "button",
|
115
|
-
className: styles.
|
116
|
-
children:
|
116
|
+
className: styles.extraButton,
|
117
|
+
children: jsx(Avatar, {
|
118
|
+
size: size,
|
119
|
+
info: jsx("span", {
|
120
|
+
className: styles.extraText,
|
121
|
+
children: "+".concat(extraItems.length)
|
122
|
+
})
|
123
|
+
})
|
117
124
|
}),
|
118
125
|
data: extraItems,
|
119
126
|
menuProps: _objectSpread2({
|
@@ -1,108 +1,78 @@
|
|
1
|
-
import {
|
2
|
-
import { jsx } from 'react/jsx-runtime';
|
3
|
-
import figma from '@figma/code-connect';
|
4
|
-
import addIcon from '@jetbrains/icons/add';
|
5
|
-
import add12pxIcon from '@jetbrains/icons/add-12px';
|
6
|
-
import downloadIcon from '@jetbrains/icons/download';
|
7
|
-
import download12pxIcon from '@jetbrains/icons/download-12px';
|
8
|
-
import { ControlsHeight } from '../global/controls-height.js';
|
9
|
-
import { Button } from './button.js';
|
10
|
-
import 'react';
|
11
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
12
|
-
import 'classnames';
|
13
|
-
import '@jetbrains/icons/chevron-down';
|
14
|
-
import '@jetbrains/icons/chevron-12px-down';
|
15
|
-
import 'util-deprecate';
|
16
|
-
import '../icon/icon.js';
|
17
|
-
import '../icon/icon__constants.js';
|
18
|
-
import '../_helpers/icon__svg.js';
|
19
|
-
import 'core-js/modules/es.regexp.exec.js';
|
20
|
-
import 'core-js/modules/es.string.replace.js';
|
21
|
-
import 'core-js/modules/es.string.starts-with.js';
|
22
|
-
import '../global/memoize.js';
|
23
|
-
import 'core-js/modules/es.weak-map.js';
|
24
|
-
import '../link/clickableLink.js';
|
25
|
-
import '../_helpers/button__classes.js';
|
1
|
+
import { c as _taggedTemplateLiteral } from '../_helpers/_rollupPluginBabelHelpers.js';
|
26
2
|
|
27
|
-
|
28
|
-
figma
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
return jsx(Button, _objectSpread2(_objectSpread2({}, restProps), {}, {
|
104
|
-
children: children
|
105
|
-
}));
|
106
|
-
},
|
107
|
-
imports: ['import Button from "@jetbrains/ring-ui/components/button/button"', 'import {ControlsHeight} from "@jetbrains/ring-ui/components/global/controls-height"', 'import addIcon from "@jetbrains/icons/add"', 'import add12pxIcon from "@jetbrains/icons/add-12px"', 'import downloadIcon from "@jetbrains/icons/download"', 'import download12pxIcon from "@jetbrains/icons/download-12px"']
|
108
|
-
});
|
3
|
+
var _templateObject;
|
4
|
+
const figma = require('figma');
|
5
|
+
const instance = figma.selectedInstance;
|
6
|
+
const size = instance.getString('Size');
|
7
|
+
const type = instance.getString('Type');
|
8
|
+
const state = instance.getString('State');
|
9
|
+
const variant = instance.getString('Variant');
|
10
|
+
const imports = ["import Button from '@jetbrains/ring-ui/components/button/button'"];
|
11
|
+
const props = [];
|
12
|
+
const DEFAULT_SIZE = 'M';
|
13
|
+
const isDefaultSize = size === DEFAULT_SIZE;
|
14
|
+
if (!isDefaultSize) {
|
15
|
+
imports.push("import {ControlsHeight} from '@jetbrains/ring-ui/components/global/controls-height'");
|
16
|
+
props.push("height={ControlsHeight.".concat(size, "}"));
|
17
|
+
}
|
18
|
+
switch (variant) {
|
19
|
+
case 'Red outlined':
|
20
|
+
props.push('danger');
|
21
|
+
break;
|
22
|
+
case 'Main':
|
23
|
+
props.push('primary');
|
24
|
+
break;
|
25
|
+
case 'Green':
|
26
|
+
props.push('success');
|
27
|
+
break;
|
28
|
+
case 'Red solid':
|
29
|
+
props.push('error');
|
30
|
+
break;
|
31
|
+
case 'Gray':
|
32
|
+
props.push('secondary');
|
33
|
+
break;
|
34
|
+
case 'Ghost':
|
35
|
+
props.push('ghost');
|
36
|
+
break;
|
37
|
+
case 'Text':
|
38
|
+
props.push('inline');
|
39
|
+
break;
|
40
|
+
}
|
41
|
+
let children = 'Button';
|
42
|
+
const use12pxIcon = size === 'S' && variant !== 'Text';
|
43
|
+
let useButtonGroup = false;
|
44
|
+
switch (type) {
|
45
|
+
case 'R-Icon-Label':
|
46
|
+
props.push('dropdown');
|
47
|
+
break;
|
48
|
+
case 'L-Icon-Label':
|
49
|
+
imports.push("import downloadIcon from '@jetbrains/icons/download".concat(use12pxIcon ? '-12px' : '', "'"));
|
50
|
+
props.push('icon={downloadIcon}');
|
51
|
+
break;
|
52
|
+
case 'Icon':
|
53
|
+
children = null;
|
54
|
+
imports.push("import addIcon from '@jetbrains/icons/add".concat(use12pxIcon ? '-12px' : '', "'"));
|
55
|
+
props.push('icon={addIcon}');
|
56
|
+
break;
|
57
|
+
case 'Split':
|
58
|
+
imports.push("import ButtonGroup from '@jetbrains/ring-ui/components/button-group/button-group'");
|
59
|
+
imports.push("import chevronDownIcon from '@jetbrains/icons/chevron-down".concat(use12pxIcon ? '-12px' : '', "'"));
|
60
|
+
useButtonGroup = true;
|
61
|
+
break;
|
62
|
+
}
|
63
|
+
switch (state) {
|
64
|
+
case 'Disabled':
|
65
|
+
props.push('disabled');
|
66
|
+
break;
|
67
|
+
}
|
68
|
+
const joinedProps = props.map(prop => "".concat(prop, " ")).join('');
|
69
|
+
// prettier-ignore
|
70
|
+
const button = children ? "<Button ".concat(joinedProps, ">\n ").concat(children, "\n</Button>") : "<Button ".concat(joinedProps, "/>");
|
71
|
+
var button_figma = {
|
72
|
+
id: 'button',
|
73
|
+
example: figma.code(_templateObject || (_templateObject = _taggedTemplateLiteral(["", "\n\n", ""])), imports.join('\n'),
|
74
|
+
// prettier-ignore
|
75
|
+
useButtonGroup ? "<ButtonGroup>\n ".concat(button, "\n <Button ").concat(joinedProps, " icon={chevronDownIcon} />\n</ButtonGroup>") : button)
|
76
|
+
};
|
77
|
+
|
78
|
+
export { button_figma as default };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { _ as _defineProperty, b as _objectSpread2, a as _objectWithoutProperties,
|
1
|
+
import { _ as _defineProperty, b as _objectSpread2, a as _objectWithoutProperties, d as _toPropertyKey } from '../_helpers/_rollupPluginBabelHelpers.js';
|
2
2
|
import 'core-js/modules/es.object.assign.js';
|
3
3
|
import 'core-js/modules/es.regexp.exec.js';
|
4
4
|
import 'core-js/modules/es.string.replace.js';
|