@bigbinary/neeto-editor 0.2.0 → 0.2.1

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.
Files changed (41) hide show
  1. package/index.js +27 -6
  2. package/package.json +7 -4
  3. package/src/Common/Button.js +95 -0
  4. package/src/Common/Description.js +1 -5
  5. package/src/Common/Dropdown/index.js +6 -2
  6. package/src/Common/Input.js +70 -0
  7. package/src/Common/Label.js +45 -0
  8. package/src/Common/Modal.js +91 -0
  9. package/src/Common/Tab.js +79 -0
  10. package/src/Common/ToolTip.js +37 -0
  11. package/src/Editor/CustomExtensions/BubbleMenu/index.js +2 -2
  12. package/src/Editor/CustomExtensions/FixedMenu/FontSizeOption.js +3 -3
  13. package/src/Editor/CustomExtensions/FixedMenu/TextColorOption.js +1 -1
  14. package/src/Editor/CustomExtensions/FixedMenu/index.js +7 -10
  15. package/src/Editor/CustomExtensions/Image/LinkUploader/URLForm.js +39 -0
  16. package/src/Editor/CustomExtensions/Image/LocalUploader.js +21 -0
  17. package/src/Editor/CustomExtensions/Image/ProgressBar.js +34 -0
  18. package/src/Editor/CustomExtensions/Image/Uploader.js +72 -31
  19. package/src/Editor/CustomExtensions/Image/constants.js +5 -0
  20. package/src/Editor/CustomExtensions/Mention/ExtensionConfig.js +0 -1
  21. package/src/Editor/CustomExtensions/Mention/MentionList.js +1 -1
  22. package/src/Editor/CustomExtensions/SlashCommands/ExtensionConfig.js +180 -176
  23. package/src/Editor/CustomExtensions/Variable/index.js +3 -3
  24. package/src/Editor/CustomExtensions/useCustomExtensions.js +2 -1
  25. package/src/Editor/index.js +17 -5
  26. package/src/constants/regexp.js +1 -0
  27. package/src/examples/constants.js +1 -1
  28. package/src/examples/index.js +25 -25
  29. package/src/hooks/useTabBar.js +9 -0
  30. package/src/index.scss +5 -0
  31. package/src/styles/abstracts/_neeto-ui-variables.scss +80 -9
  32. package/src/styles/abstracts/_variables.scss +4 -1
  33. package/src/styles/components/_button.scss +161 -0
  34. package/src/styles/components/_editor.scss +4 -0
  35. package/src/styles/components/_fixed-menu.scss +4 -0
  36. package/src/styles/components/_image-uploader.scss +109 -0
  37. package/src/styles/components/_input.scss +165 -0
  38. package/src/styles/components/_tab.scss +74 -0
  39. package/src/styles/components/_tooltip.scss +152 -0
  40. package/webpack.config.js +7 -0
  41. package/webpack.dev.config.js +7 -0
@@ -1,10 +1,10 @@
1
1
  import React, { useRef } from "react";
2
2
 
3
- import CodeBlock from "../Common/CodeBlock";
4
- import Description from "../Common/Description";
5
- import Heading from "../Common/Heading";
6
- import HighlightText from "../Common/HighlightText";
7
- import ListItems from "../Common/ListItems";
3
+ import CodeBlock from "common/CodeBlock";
4
+ import Description from "common/Description";
5
+ import Heading from "common/Heading";
6
+ import HighlightText from "common/HighlightText";
7
+ import ListItems from "common/ListItems";
8
8
  import Editor from "../Editor";
9
9
  import {
10
10
  EDITOR_FEATURES,
@@ -37,7 +37,7 @@ const Example = () => {
37
37
  </button>
38
38
  </div>
39
39
  <hr className="my-2 border-gray-100" />
40
- <Editor ref={ref} variables={SAMPLE_VARIABLES} />
40
+ <Editor ref={ref} />
41
41
  <Heading type="sub">Features</Heading>
42
42
  <ListItems items={EDITOR_FEATURES} ordered />
43
43
 
@@ -127,26 +127,26 @@ const Example = () => {
127
127
  <Description>
128
128
  The editor can have placeholder texts for different nodes. These value
129
129
  is accepted as <HighlightText>placeholder</HighlightText> prop.
130
- <ul className="list-disc list-inside">
131
- <li>
132
- Value as object: Each type of node can have corresponding
133
- placeholder, in which case the value should be of type{" "}
134
- <HighlightText>{"{node_name: placeholder_text}"}</HighlightText>.
135
- </li>
136
- <li>
137
- Value as string: When plain string is provided as value for
138
- placeholder, all the nodes will be using the same placeholder text
139
- irrespective of their type in which case the value should be of type{" "}
140
- </li>
141
- <li>
142
- Value as function: the <HighlightText>placeholder</HighlightText>{" "}
143
- prop can also accepts a function. For each node in the document, the
144
- function receives node as argument and return the corresponding
145
- placeholder string. eg:{" "}
146
- <HighlightText>{"({node}) => placeholder_text"}</HighlightText>
147
- </li>
148
- </ul>
149
130
  </Description>
131
+ <ul className="list-disc list-inside">
132
+ <li>
133
+ Value as object: Each type of node can have corresponding placeholder,
134
+ in which case the value should be of type{" "}
135
+ <HighlightText>{"{node_name: placeholder_text}"}</HighlightText>.
136
+ </li>
137
+ <li>
138
+ Value as string: When plain string is provided as value for
139
+ placeholder, all the nodes will be using the same placeholder text
140
+ irrespective of their type in which case the value should be of type{" "}
141
+ </li>
142
+ <li>
143
+ Value as function: the <HighlightText>placeholder</HighlightText> prop
144
+ can also accepts a function. For each node in the document, the
145
+ function receives node as argument and return the corresponding
146
+ placeholder string. eg:{" "}
147
+ <HighlightText>{"({node}) => placeholder_text"}</HighlightText>
148
+ </li>
149
+ </ul>
150
150
 
151
151
  <div className="flex">
152
152
  <CodeBlock>{STRINGS.placeholderSampleCode}</CodeBlock>
@@ -0,0 +1,9 @@
1
+ import { useState } from "react";
2
+
3
+ const useTabBar = (options) => {
4
+ const [activeTab, setActiveTab] = useState(options[0]?.key);
5
+
6
+ return [activeTab, (option) => setActiveTab(option.key)];
7
+ };
8
+
9
+ export default useTabBar;
package/src/index.scss CHANGED
@@ -13,6 +13,11 @@
13
13
  @import "./styles/components/editor";
14
14
  @import "./styles/components/avatar";
15
15
  @import "./styles/components/fixed-menu";
16
+ @import "./styles/components/image-uploader";
17
+ @import "./styles/components/tab";
18
+ @import "./styles/components/button";
19
+ @import "./styles/components/tooltip";
20
+ @import "./styles/components/input";
16
21
 
17
22
  body {
18
23
  margin: 0;
@@ -1,36 +1,107 @@
1
+ // Color palette
2
+
3
+ // primary
1
4
  $neeto-ui-white: #ffffff;
2
5
  $neeto-ui-black: #1b1f23;
3
-
6
+ // content
4
7
  $neeto-ui-gray-800: #2f3941;
5
8
  $neeto-ui-gray-700: #49545c;
6
9
  $neeto-ui-gray-600: #68737d;
7
10
  $neeto-ui-gray-500: #87929d;
11
+ $neeto-ui-gray-400: #c2c8cc;
8
12
  $neeto-ui-gray-300: #d8dcde;
9
13
  $neeto-ui-gray-200: #e9ebed;
10
14
  $neeto-ui-gray-100: #f8f9f9;
11
15
  // states
12
16
  $neeto-ui-success: #00ba88;
17
+ $neeto-ui-info: #276ef1;
13
18
  $neeto-ui-warning: #f3cd82;
19
+ $neeto-ui-error: #f56a58;
20
+ // pastel
21
+ $neeto-ui-pastel-blue: #eaf3fc;
22
+ $neeto-ui-pastel-green: #ebf5ec;
23
+ $neeto-ui-pastel-yellow: #fff2d7;
24
+ $neeto-ui-pastel-red: #ffefed;
25
+ $neeto-ui-pastel-teal: #98f3f4;
26
+ // secondary
27
+ $neeto-ui-secondary-indigo: #5e5ce6;
28
+ $neeto-ui-secondary-green: #00ba88;
29
+ $neeto-ui-secondary-teal: #64d2ff;
30
+
31
+ // Font Weights
32
+ $neeto-ui-font-thin: 100;
33
+ $neeto-ui-font-extralight: 200;
34
+ $neeto-ui-font-light: 300;
35
+ $neeto-ui-font-normal: 400;
36
+ $neeto-ui-font-medium: 500;
37
+ $neeto-ui-font-semibold: 600;
38
+ $neeto-ui-font-bold: 700;
39
+ $neeto-ui-font-extrabold: 800;
40
+ $neeto-ui-font-black: 900;
14
41
 
15
42
  // Font Sizes
16
43
  $neeto-ui-text-xxs: 10px;
17
44
  $neeto-ui-text-xs: 12px;
18
45
  $neeto-ui-text-sm: 14px;
46
+ $neeto-ui-text-base: 16px;
19
47
  $neeto-ui-text-lg: 18px;
48
+ $neeto-ui-text-xl: 20px;
20
49
  $neeto-ui-text-2xl: 24px;
50
+ $neeto-ui-text-3xl: 32px;
51
+ $neeto-ui-text-4xl: 48px;
21
52
 
22
- // Shadow
23
- $box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0px 10px 20px rgba(0, 0, 0, 0.1);
24
- $neeto-ui-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
25
- 0 2px 4px -1px rgba(0, 0, 0, 0.06);
53
+ // Line Heights
54
+ $neeto-ui-leading-none: 1;
55
+ $neeto-ui-leading-tight: 1.25;
56
+ $neeto-ui-leading-snug: 1.375;
57
+ $neeto-ui-leading-normal: 1.5;
58
+ $neeto-ui-leading-relaxed: 1.625;
59
+ $neeto-ui-leading-loose: 2;
60
+
61
+ // Text-transform
62
+ $neeto-ui-text-transform-none: none;
63
+ $neeto-ui-text-transform-capitalize: capitalize;
64
+ $neeto-ui-text-transform-uppercase: uppercase;
65
+ $neeto-ui-text-transform-lowercase: lowercase;
66
+ $neeto-ui-text-transform-fullwidth: full-width;
67
+ $neeto-ui-text-transform-inherit: inherit;
68
+ $neeto-ui-text-transform-initial: initial;
69
+ $neeto-ui-text-transform-revert: revert;
70
+ $neeto-ui-text-transform-unset: unset;
26
71
 
27
72
  // Border Radius
73
+ $neeto-ui-rounded-none: 0;
28
74
  $neeto-ui-rounded-sm: 2px;
75
+ $neeto-ui-rounded: 4px;
76
+ $neeto-ui-rounded-md: 6px;
77
+ $neeto-ui-rounded-lg: 8px;
78
+ $neeto-ui-rounded-xl: 10px;
29
79
  $neeto-ui-rounded-full: 999px;
30
80
 
31
- // Font Weights
32
- $neeto-ui-font-normal: 400;
33
- $neeto-ui-font-semibold: 600;
34
-
35
81
  // Transition
36
82
  $neeto-ui-transition: all 0.3s ease-in-out;
83
+
84
+ // Shadows
85
+ $neeto-ui-shadow: 0px 0px 0px 3px $neeto-ui-gray-200;
86
+ $neeto-ui-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
87
+ 0 2px 4px -1px rgba(0, 0, 0, 0.06);
88
+
89
+ // Box Shadows
90
+ $neeto-ui-shadow-xs: 0px 1px 4px -1px rgba(28, 48, 74, 0.12);
91
+ $neeto-ui-shadow-s: 0px 3px 12px -1px rgba(28, 52, 84, 0.12),
92
+ 0px 2px 4px -1px rgba(28, 55, 90, 0.08);
93
+ $neeto-ui-shadow-m: 0px 8px 24px -4px rgba(28, 50, 79, 0.12),
94
+ 0px 2px 6px -1px rgba(28, 55, 90, 0.08);
95
+ $neeto-ui-shadow-l: 0px 12px 48px -6px rgba(28, 50, 79, 0.12),
96
+ 0px 3px 18px -2px rgba(28, 55, 90, 0.08);
97
+ $neeto-ui-shadow-xl: 0px 18px 64px -8px rgba(28, 50, 79, 0.12),
98
+ 0px 4px 24px -3px rgba(28, 55, 90, 0.08);
99
+
100
+ // neeto-ui-shadows-map
101
+ $neeto-ui-shadows: (
102
+ "xs": $neeto-ui-shadow-xs,
103
+ "s": $neeto-ui-shadow-s,
104
+ "m": $neeto-ui-shadow-m,
105
+ "l": $neeto-ui-shadow-l,
106
+ "xl": $neeto-ui-shadow-xl,
107
+ );
@@ -1,10 +1,13 @@
1
1
  // Colors
2
2
  $color-steel-blue: steelblue;
3
+ $color-link-blue: #1053f9;
3
4
  $color-solid-white: #fff;
4
5
  $color-solid-black: #000000;
5
6
  $color-translucent-black: #00000010;
6
7
  $color-aqua-blue: #68cef8;
8
+ $color-indigo: #5e5ce6;
7
9
  $color-dark-green: #00ffaa40;
8
10
 
11
+ // Font Sizes
9
12
 
10
-
13
+ $font-size-lg: 16px;
@@ -0,0 +1,161 @@
1
+ .neeto-ui-btn {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ font-size: $neeto-ui-text-sm;
5
+ font-weight: $neeto-ui-font-medium;
6
+ border-radius: $neeto-ui-rounded-sm;
7
+ line-height: 1.2;
8
+ transition: $neeto-ui-transition;
9
+ position: relative;
10
+ border: none;
11
+ cursor: pointer;
12
+ padding: 0;
13
+ user-select: none;
14
+ padding: 4px 8px;
15
+ min-height: 28px;
16
+ letter-spacing: -0.15px;
17
+ outline: none;
18
+
19
+ &--icon-only {
20
+ padding-left: 6px;
21
+ padding-right: 6px;
22
+ }
23
+
24
+ &:focus,
25
+ &:focus-visible {
26
+ outline: none;
27
+ }
28
+
29
+ &:hover {
30
+ text-decoration: none;
31
+ }
32
+
33
+ &.disabled {
34
+ cursor: not-allowed;
35
+ opacity: 0.4;
36
+ }
37
+
38
+ .neeto-ui-btn__icon:last-child:not(:first-child),
39
+ .neeto-ui-btn__spinner:last-child:not(:first-child) {
40
+ margin-left: 8px;
41
+ }
42
+ }
43
+
44
+ .neeto-ui-btn--icon-left {
45
+ flex-direction: row-reverse;
46
+ .neeto-ui-btn__icon:last-child:not(:first-child),
47
+ .neeto-ui-btn__spinner:last-child:not(:first-child) {
48
+ margin-right: 8px;
49
+ margin-left: 0;
50
+ }
51
+ }
52
+
53
+ .neeto-ui-btn__icon,
54
+ .neeto-ui-btn__spinner,
55
+ .neeto-ui-btn__spinner-wrapper {
56
+ color: inherit;
57
+ svg {
58
+ color: inherit !important;
59
+ }
60
+ }
61
+
62
+ // width
63
+ .neeto-ui-btn--width-full {
64
+ width: 100% !important;
65
+ justify-content: center;
66
+ }
67
+
68
+ // size
69
+ .neeto-ui-btn--size-large {
70
+ font-size: $neeto-ui-text-base;
71
+ padding: 6px 12px;
72
+ min-height: 32px;
73
+
74
+ &.neeto-ui-btn--icon-only {
75
+ padding-left: 8px;
76
+ padding-right: 8px;
77
+ }
78
+ }
79
+
80
+ // styles
81
+ .neeto-ui-btn--style {
82
+ &-primary {
83
+ color: $neeto-ui-white;
84
+ background-color: $neeto-ui-gray-800;
85
+
86
+ &:hover:not(:disabled),
87
+ &:active {
88
+ color: $neeto-ui-white;
89
+ background-color: $neeto-ui-gray-700;
90
+ }
91
+
92
+ &:focus-visible {
93
+ color: $neeto-ui-white;
94
+ box-shadow: 0 0 0 3px #e5e5e5;
95
+ }
96
+ }
97
+
98
+ &-secondary {
99
+ color: $neeto-ui-gray-800;
100
+ background-color: $neeto-ui-gray-200;
101
+
102
+ &:hover:not(:disabled),
103
+ &:active {
104
+ color: $neeto-ui-gray-800;
105
+ background-color: $neeto-ui-gray-400;
106
+ }
107
+
108
+ &:focus-visible {
109
+ color: $neeto-ui-gray-800;
110
+ box-shadow: 0 0 0 3px #e5e5e5;
111
+ }
112
+ }
113
+
114
+ &-text {
115
+ color: $neeto-ui-gray-800;
116
+
117
+ &:hover:not(:disabled),
118
+ &:active {
119
+ color: $neeto-ui-gray-800;
120
+ background-color: $neeto-ui-gray-200;
121
+ }
122
+
123
+ &:focus-visible {
124
+ color: $neeto-ui-gray-800;
125
+ box-shadow: 0 0 0 3px #e5e5e5;
126
+ }
127
+ }
128
+
129
+ &-link {
130
+ color: $neeto-ui-secondary-indigo;
131
+ min-height: initial;
132
+ padding: 0;
133
+
134
+ &:hover:not(:disabled),
135
+ &:active,
136
+ &:focus {
137
+ opacity: 0.8;
138
+ color: $neeto-ui-secondary-indigo;
139
+ }
140
+
141
+ &:focus-visible {
142
+ color: darken($neeto-ui-secondary-indigo, 25%);
143
+ }
144
+ }
145
+
146
+ &-danger {
147
+ color: $neeto-ui-error;
148
+ background-color: $neeto-ui-pastel-red;
149
+
150
+ &:hover:not(:disabled),
151
+ &:active {
152
+ color: $neeto-ui-error;
153
+ background-color: darken($neeto-ui-pastel-red, 2.5%);
154
+ }
155
+
156
+ &:focus-visible {
157
+ color: $neeto-ui-error;
158
+ box-shadow: 0 0 0 3px darken($neeto-ui-pastel-red, 2.5%);
159
+ }
160
+ }
161
+ }
@@ -72,6 +72,10 @@ $list-item-color: #1a141f;
72
72
  font-family: "JetBrains Mono", monospace;
73
73
  }
74
74
 
75
+ .prose a[href] {
76
+ color: $color-link-blue;
77
+ }
78
+
75
79
  .prose {
76
80
  max-width: 100% !important;
77
81
  }
@@ -5,6 +5,10 @@
5
5
  border-radius: $neeto-ui-rounded-sm $neeto-ui-rounded-sm 0px 0px;
6
6
  background: $neeto-ui-gray-200;
7
7
 
8
+ button {
9
+ outline: none;
10
+ }
11
+
8
12
  .editor-fixed-menu--item {
9
13
  &:hover {
10
14
  background: $neeto-ui-gray-300;
@@ -0,0 +1,109 @@
1
+ .image-uploader__root {
2
+ $color-primary: $color-indigo;
3
+
4
+ .label--primary {
5
+ color: $neeto-ui-gray-700;
6
+ display: block;
7
+ margin-bottom: 5px;
8
+ font-size: $neeto-ui-text-sm;
9
+ }
10
+
11
+ .label--secondary {
12
+ color: $neeto-ui-gray-400;
13
+ font-size: $neeto-ui-text-xs;
14
+ }
15
+
16
+ margin: 8px;
17
+ display: flex;
18
+ flex-direction: column;
19
+ min-height: 176px;
20
+ width: 488px;
21
+
22
+ .image-uploader__content {
23
+ flex: 1;
24
+ display: flex;
25
+ margin-top: 10px;
26
+ }
27
+
28
+ // ProgressBar
29
+ .progress-bar__root {
30
+ width: 100%;
31
+ max-width: 256px;
32
+ margin-top: 11px;
33
+ .progress-bar__indicator {
34
+ position: relative;
35
+ width: 100%;
36
+ height: 6px;
37
+ border-radius: 100px;
38
+ overflow: hidden;
39
+ background: rgba($color-primary, 0.2);
40
+ margin-top: 5px;
41
+ }
42
+
43
+ .progress-bar__indicator-inner {
44
+ background: $color-primary;
45
+ }
46
+
47
+ .progress-bar__percent-text {
48
+ font-size: $neeto-ui-text-xs;
49
+ color: $neeto-ui-gray-800;
50
+ }
51
+ }
52
+
53
+ // Local upload component related styles
54
+ .local-upload__root {
55
+ display: flex;
56
+ flex: 1;
57
+ border: 1px dashed $neeto-ui-gray-400;
58
+ box-sizing: border-box;
59
+ border-radius: 2px;
60
+
61
+ // DragDrop
62
+ .uppy-DragDrop-container {
63
+ width: 100%;
64
+ height: 100%;
65
+ background-color: $color-solid-white;
66
+ cursor: pointer;
67
+
68
+ // firefox fix: removes thin dotted outline
69
+ &::-moz-focus-inner {
70
+ border: 0;
71
+ }
72
+ }
73
+
74
+ .uppy-DragDrop-inner {
75
+ display: flex;
76
+ flex-direction: column;
77
+ justify-content: center;
78
+ margin: 0;
79
+ line-height: 1.4;
80
+ text-align: center;
81
+ font-weight: $neeto-ui-font-normal;
82
+ }
83
+
84
+ .uppy-DragDrop-arrow {
85
+ visibility: hidden;
86
+ display: none;
87
+ }
88
+
89
+ .uppy-DragDrop--isDraggingOver {
90
+ background: $neeto-ui-gray-200;
91
+ border: 2px dashed $color-primary;
92
+ }
93
+
94
+ .uppy-DragDrop-label {
95
+ @extend .label--primary;
96
+ }
97
+
98
+ .uppy-DragDrop-browse {
99
+ color: $color-primary;
100
+ font-size: $font-size-lg;
101
+ font-weight: $neeto-ui-font-semibold;
102
+ cursor: pointer;
103
+ }
104
+
105
+ .uppy-DragDrop-note {
106
+ @extend .label--secondary;
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,165 @@
1
+ .neeto-ui-input__wrapper {
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: flex-start;
5
+ align-items: flex-start;
6
+ flex-grow: 1;
7
+
8
+ .neeto-ui-label {
9
+ margin-bottom: 4px;
10
+ }
11
+
12
+ .neeto-ui-input {
13
+ width: 100%;
14
+ display: flex;
15
+ flex-direction: row;
16
+ justify-content: flex-start;
17
+ align-items: center;
18
+ font-size: $neeto-ui-text-sm;
19
+ line-height: 1.6;
20
+ transition: $neeto-ui-transition;
21
+ border-radius: $neeto-ui-rounded-sm;
22
+ border: thin solid $neeto-ui-gray-400;
23
+ background-color: $neeto-ui-white;
24
+ color: $neeto-ui-gray-800;
25
+ overflow: hidden;
26
+
27
+ &.neeto-ui-input--textarea {
28
+ padding: 8px;
29
+ }
30
+
31
+ input,
32
+ textarea {
33
+ width: 100%;
34
+ background-color: transparent;
35
+ color: inherit;
36
+ border: none;
37
+ font-size: inherit;
38
+ line-height: inherit;
39
+ box-shadow: none;
40
+ outline: none;
41
+
42
+ &::placeholder {
43
+ color: $neeto-ui-gray-400;
44
+ }
45
+
46
+ &:focus {
47
+ outline-color: transparent;
48
+ }
49
+ }
50
+
51
+ input {
52
+ padding: 8px;
53
+ }
54
+
55
+ textarea {
56
+ padding: 0;
57
+ max-height: 224px;
58
+ overflow-y: auto;
59
+ }
60
+
61
+ &:focus-within:not(.neeto-ui-input--naked, .neeto-ui-input--error) {
62
+ border-color: $neeto-ui-gray-800;
63
+ box-shadow: $neeto-ui-shadow;
64
+ }
65
+
66
+ &:hover:not(.neeto-ui-input--naked, .neeto-ui-input--error, .neeto-ui-input--disabled) {
67
+ border-color: $neeto-ui-gray-700;
68
+ }
69
+
70
+ &.neeto-ui-input--error {
71
+ border-color: $neeto-ui-error;
72
+
73
+ &:focus-within:not(.neeto-ui-input--naked) {
74
+ box-shadow: 0 0 0 3px $neeto-ui-pastel-red;
75
+ }
76
+
77
+ textarea {
78
+ resize: none;
79
+ }
80
+ }
81
+
82
+ &.neeto-ui-input--disabled {
83
+ background-color: $neeto-ui-gray-100;
84
+ cursor: not-allowed;
85
+
86
+ input {
87
+ cursor: not-allowed;
88
+ }
89
+
90
+ textarea {
91
+ cursor: not-allowed;
92
+ }
93
+ }
94
+
95
+ &.neeto-ui-input--small {
96
+ input {
97
+ padding: 6px 8px;
98
+ line-height: 1.3;
99
+ }
100
+ }
101
+
102
+ &.neeto-ui-input--naked {
103
+ padding: 0;
104
+ border: none;
105
+ box-shadow: none;
106
+
107
+ .neeto-ui-input__prefix {
108
+ margin-left: 0;
109
+ }
110
+
111
+ .neeto-ui-input__suffix {
112
+ margin-right: 0;
113
+ }
114
+ }
115
+ }
116
+
117
+ .neeto-ui-input__prefix,
118
+ .neeto-ui-input__suffix {
119
+ display: flex;
120
+ flex-direction: row;
121
+ justify-content: flex-start;
122
+ align-items: center;
123
+ font-size: 14px;
124
+ color: $neeto-ui-gray-600;
125
+ svg {
126
+ width: 16px;
127
+ height: 16px;
128
+ }
129
+ }
130
+
131
+ .neeto-ui-input__prefix {
132
+ margin-left: 10px;
133
+ }
134
+ .neeto-ui-input__suffix {
135
+ margin-right: 10px;
136
+ }
137
+
138
+ .neeto-ui-input--block-add-on {
139
+ .neeto-ui-input__prefix,
140
+ .neeto-ui-input__suffix {
141
+ margin: 0;
142
+ padding: 8px 10px;
143
+ background-color: $neeto-ui-gray-100;
144
+ }
145
+ .neeto-ui-input__prefix {
146
+ border-right: thin solid $neeto-ui-gray-300;
147
+ }
148
+ .neeto-ui-input__suffix {
149
+ border-left: thin solid $neeto-ui-gray-300;
150
+ }
151
+ }
152
+ }
153
+
154
+ .neeto-ui-input__help-text {
155
+ margin-top: 8px;
156
+ font-size: $neeto-ui-text-xs;
157
+ color: $neeto-ui-gray-500;
158
+ line-height: 1.6;
159
+ }
160
+
161
+ .neeto-ui-input__error {
162
+ margin-top: 4px;
163
+ font-size: $neeto-ui-text-xs;
164
+ color: $neeto-ui-error;
165
+ }