@jetbrains/ring-ui-built 7.0.74 → 7.0.76

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.
@@ -1,63 +0,0 @@
1
- import figma from '@figma/code-connect';
2
-
3
- const instance = figma.selectedInstance;
4
- const size = instance.getString('Size');
5
- const state = instance.getString('State');
6
- const formVariant = instance.getBoolean('Form variant');
7
- const icon = instance.getBoolean('Icon');
8
- const clearable = instance.getBoolean('Clearable');
9
- const hasLabel = instance.getBoolean('Label');
10
- const label = instance.findText('Label').textContent;
11
- const hasHelpText = instance.getBoolean('Help text');
12
- const helpText = instance.findText('Help text').textContent;
13
- const hasText = instance.getBoolean('Text');
14
- const text = instance.findText('Text').textContent;
15
- const hasPlaceholder = instance.getBoolean('Placeholder');
16
- const placeholder = instance.findText('Placeholder').textContent;
17
- const imports = ["import Input from '@jetbrains/ring-ui/components/input/input'"];
18
- const props = [];
19
- const DEFAULT_SIZE = 'M';
20
- const isDefaultSize = size === DEFAULT_SIZE;
21
- if (!isDefaultSize) {
22
- imports.push("import {ControlsHeight} from '@jetbrains/ring-ui/components/global/controls-height'");
23
- props.push(`height={ControlsHeight.${size}}`);
24
- }
25
- switch (state) {
26
- case 'disabled':
27
- props.push('disabled');
28
- break;
29
- case 'error':
30
- props.push('error=""');
31
- break;
32
- }
33
- if (formVariant) {
34
- imports.push("import {LabelType} from '../control-label/control-label'");
35
- props.push('labelType={LabelType.FORM}');
36
- }
37
- if (icon) {
38
- imports.push("import searchIcon from '@jetbrains/icons/search'");
39
- props.push('icon={searchIcon}');
40
- }
41
- if (clearable) {
42
- props.push('onClear={() => {}}');
43
- }
44
- if (hasLabel) {
45
- props.push(`label="${label}"`);
46
- }
47
- if (hasHelpText) {
48
- props.push(`help="${helpText}"`);
49
- }
50
- if (hasText) {
51
- props.push(`defaultValue="${text}"`);
52
- }
53
- if (hasPlaceholder) {
54
- props.push(`placeholder="${placeholder}"`);
55
- }
56
- var input_figma = {
57
- id: 'input',
58
- example: figma.code`${imports.join('\n')}
59
-
60
- <Input ${props.map(prop => `${prop} `).join('')}/>`
61
- };
62
-
63
- export { input_figma as default };