@map-colonies/react-components 3.7.3 → 3.7.4

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.
@@ -0,0 +1,25 @@
1
+ .react-autocomplete-input {
2
+ background-clip: padding-box;
3
+ background-color: #fff;
4
+ bottom: auto;
5
+ box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
6
+ display: block;
7
+ font-size: 14px;
8
+ list-style: none;
9
+ padding: 1px;
10
+ position: absolute;
11
+ z-index: 20000;
12
+ margin-block-start: unset;
13
+ margin-block-end: unset;
14
+ }
15
+
16
+ .react-autocomplete-input > li {
17
+ cursor: pointer;
18
+ padding: 10px;
19
+ min-width: 100px;
20
+ }
21
+
22
+ .react-autocomplete-input > li.active {
23
+ background-color: #337ab7;
24
+ color: #fff;
25
+ }
@@ -0,0 +1,101 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/prefer-regexp-exec, @typescript-eslint/no-magic-numbers*/
2
+ import React from 'react';
3
+ import { Story } from '@storybook/react/types-6-0';
4
+ import { TextField } from '@map-colonies/react-core';
5
+ import { CSFStory } from '../utils/story';
6
+
7
+ import Autocomplete from './autocomplete';
8
+
9
+ export default {
10
+ title: 'Autocomplete',
11
+ component: Autocomplete,
12
+ };
13
+
14
+ export const AutocpmleteTextArea: CSFStory<JSX.Element> = () => (
15
+ <>
16
+ <h1>Autocpmlete with native HTML TEXTAREA</h1>
17
+ <Autocomplete
18
+ {...{
19
+ options: ['apple', 'apricot', 'banana', 'bounty'],
20
+ }}
21
+ />
22
+ </>
23
+ );
24
+ AutocpmleteTextArea.story = {
25
+ name: 'Autocpmlete with TEXTAREA HTML',
26
+ };
27
+
28
+ export const AutocpmleteTextField: Story = (args: unknown) => {
29
+ return (
30
+ <>
31
+ <h1>Autocpmlete with TEXTFIELD react-core component</h1>
32
+ <Autocomplete
33
+ {...{
34
+ Component: <TextField />,
35
+ ComponentProps: {
36
+ name: 'autocomplete',
37
+ },
38
+ options: ['apple', 'apricot', 'banana', 'bounty'],
39
+ }}
40
+ {...args}
41
+ />
42
+ </>
43
+ );
44
+ };
45
+ AutocpmleteTextField.storyName = 'Autocpmlete with TEXTFIELD component';
46
+ AutocpmleteTextField.argTypes = {
47
+ disabled: {
48
+ defaultValue: false,
49
+ control: {
50
+ type: 'boolean',
51
+ },
52
+ },
53
+ trigger: {
54
+ defaultValue: '@',
55
+ control: {
56
+ type: 'text',
57
+ },
58
+ },
59
+ spacer: {
60
+ defaultValue: ' ',
61
+ control: {
62
+ type: 'text',
63
+ },
64
+ },
65
+ };
66
+
67
+ export const AutocpmleteInComplitionModeEN: Story = (args: unknown) => {
68
+ return (
69
+ <>
70
+ <h1>Autocpmlete with TEXTFIELD in AUTOCOMPLETE mode in English (LTR)</h1>
71
+ <Autocomplete
72
+ {...{
73
+ Component: <TextField />,
74
+ mode: 'autocomplete',
75
+ options: ['apple', 'apricot', 'banana', 'bounty'],
76
+ }}
77
+ {...args}
78
+ />
79
+ </>
80
+ );
81
+ };
82
+ AutocpmleteInComplitionModeEN.storyName =
83
+ 'Autocpmlete in autocomplete MODE RTL';
84
+
85
+ export const AutocpmleteInComplitionModeHEB: Story = (args: unknown) => {
86
+ return (
87
+ <div style={{ direction: 'rtl' }}>
88
+ <h1>Autocpmlete with TEXTFIELD in AUTOCOMPLETE mode in Hebrew (RTL)</h1>
89
+ <Autocomplete
90
+ {...{
91
+ Component: <TextField />,
92
+ mode: 'autocomplete',
93
+ options: ['אגוזאגוז', 'תפוח', 'אפרסק', 'בננה', 'אגוז'],
94
+ }}
95
+ {...args}
96
+ />
97
+ </div>
98
+ );
99
+ };
100
+ AutocpmleteInComplitionModeHEB.storyName =
101
+ 'Autocpmlete in autocomplete MODE LTR';