@justin_evo/evo-ui 1.2.0 → 1.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 (77) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +70 -70
  3. package/dist/declarations.d.ts +6 -6
  4. package/package.json +52 -52
  5. package/src/Alert/Alert.tsx +49 -49
  6. package/src/AutoComplete/AutoComplete.tsx +810 -810
  7. package/src/Badge/Badge.tsx +53 -53
  8. package/src/Breadcrumb/Breadcrumb.tsx +53 -53
  9. package/src/Button/Button.tsx +125 -125
  10. package/src/Card/Card.tsx +257 -257
  11. package/src/Checkbox/Checkbox.tsx +59 -59
  12. package/src/CommandPalette/CommandPalette.tsx +185 -185
  13. package/src/Container/Container.tsx +31 -31
  14. package/src/Divider/Divider.tsx +31 -31
  15. package/src/Form/Form.tsx +185 -185
  16. package/src/Grid/Grid.tsx +66 -66
  17. package/src/ImageCropper/ImageCropper.tsx +911 -911
  18. package/src/Input/Input.tsx +74 -74
  19. package/src/Modal/Modal.tsx +77 -77
  20. package/src/Nav/Nav.tsx +708 -708
  21. package/src/Notification/Notification.tsx +1503 -1503
  22. package/src/Pagination/Pagination.tsx +76 -76
  23. package/src/Radio/Radio.tsx +69 -69
  24. package/src/RichTextArea/RichTextArea.tsx +886 -886
  25. package/src/Select/Select.tsx +515 -515
  26. package/src/Skeleton/Skeleton.tsx +70 -70
  27. package/src/Stack/Stack.tsx +52 -52
  28. package/src/Table/Table.tsx +335 -335
  29. package/src/Tabs/Tabs.tsx +90 -90
  30. package/src/Theme/ThemeProvider.tsx +253 -253
  31. package/src/Theme/ThemeToggle.tsx +79 -79
  32. package/src/Toggle/Toggle.tsx +48 -48
  33. package/src/Tooltip/Tooltip.tsx +38 -38
  34. package/src/TopNav/TopNav.tsx +1163 -1163
  35. package/src/TreeSelect/TreeSelect.tsx +825 -825
  36. package/src/css/alert.module.scss +93 -93
  37. package/src/css/autocomplete.module.scss +416 -416
  38. package/src/css/badge.module.scss +82 -82
  39. package/src/css/base/_color.scss +159 -159
  40. package/src/css/base/_theme.scss +237 -237
  41. package/src/css/base/_variables.scss +161 -161
  42. package/src/css/breadcrumb.module.scss +50 -50
  43. package/src/css/button.module.scss +385 -385
  44. package/src/css/card.module.scss +217 -217
  45. package/src/css/checkbox.module.scss +123 -123
  46. package/src/css/commandpalette.module.scss +211 -211
  47. package/src/css/container.module.scss +18 -18
  48. package/src/css/divider.module.scss +41 -41
  49. package/src/css/form.module.scss +245 -245
  50. package/src/css/imagecropper.module.scss +397 -397
  51. package/src/css/input.module.scss +89 -89
  52. package/src/css/modal.module.scss +105 -105
  53. package/src/css/nav.module.scss +494 -494
  54. package/src/css/notification.module.scss +691 -691
  55. package/src/css/pagination.module.scss +63 -63
  56. package/src/css/radio.module.scss +89 -89
  57. package/src/css/richtextarea.module.scss +307 -307
  58. package/src/css/select.module.scss +525 -525
  59. package/src/css/skeleton.module.scss +30 -30
  60. package/src/css/table.module.scss +386 -386
  61. package/src/css/tabs.module.scss +63 -63
  62. package/src/css/theme-toggle.module.scss +83 -83
  63. package/src/css/toggle.module.scss +54 -54
  64. package/src/css/tooltip.module.scss +97 -97
  65. package/src/css/topnav.module.scss +568 -568
  66. package/src/css/treeselect.module.scss +558 -558
  67. package/src/css/utilities/_borders.scss +111 -111
  68. package/src/css/utilities/_colors.scss +66 -66
  69. package/src/css/utilities/_effects.scss +216 -216
  70. package/src/css/utilities/_layout.scss +181 -181
  71. package/src/css/utilities/_position.scss +75 -75
  72. package/src/css/utilities/_sizing.scss +138 -138
  73. package/src/css/utilities/_spacing.scss +99 -99
  74. package/src/css/utilities/_typography.scss +121 -121
  75. package/src/css/utilities/index.scss +24 -24
  76. package/src/declarations.d.ts +6 -6
  77. package/src/index.ts +60 -60
@@ -1,307 +1,307 @@
1
- @use 'base/variables' as *;
2
- @use 'base/color' as *;
3
-
4
- // =============================================================
5
- // EvoRichTextArea
6
- // -------------------------------------------------------------
7
- // A pluggable rich-text editor. Pure DOM + Selection API,
8
- // no third-party editor framework. Theme-aware via the same
9
- // CSS variables every other component reads.
10
- // =============================================================
11
-
12
- .field {
13
- display: flex;
14
- flex-direction: column;
15
- gap: 0.375rem;
16
- font-family: $font-sans;
17
- min-width: 0;
18
- }
19
-
20
- .fullWidth { width: 100%; }
21
-
22
- .label {
23
- font-size: $text-sm;
24
- font-weight: 500;
25
- color: $color-text-primary;
26
- }
27
-
28
- // ---- Outer shell (toolbar + editor) ----
29
- .shell {
30
- position: relative;
31
- display: flex;
32
- flex-direction: column;
33
- background-color: $color-surface;
34
- border: 1px solid $color-border;
35
- border-radius: $radius-sm;
36
- overflow: hidden;
37
- transition: border-color $transition-fast, box-shadow $transition-fast;
38
-
39
- &:focus-within {
40
- border-color: $evo-primary-color;
41
- box-shadow: 0 0 0 3px color-mix(in srgb, $evo-primary-color 18%, transparent);
42
- }
43
-
44
- &.hasError {
45
- border-color: $evo-danger-color;
46
- &:focus-within {
47
- box-shadow: 0 0 0 3px color-mix(in srgb, $evo-danger-color 18%, transparent);
48
- }
49
- }
50
-
51
- &.disabled {
52
- opacity: 0.6;
53
- pointer-events: none;
54
- }
55
-
56
- &.dragOver {
57
- border-color: $evo-primary-color;
58
- border-style: dashed;
59
- }
60
- }
61
-
62
- // ---- Toolbar ----
63
- .toolbar {
64
- display: flex;
65
- flex-wrap: wrap;
66
- align-items: center;
67
- gap: 2px;
68
- padding: 6px 8px;
69
- background-color: $color-surface-sunken;
70
- border-bottom: 1px solid $color-border-subtle;
71
- // Sticky when the editor scrolls — toolbar stays visible
72
- position: sticky;
73
- top: 0;
74
- z-index: 1;
75
- }
76
-
77
- .divider {
78
- display: inline-block;
79
- width: 1px;
80
- height: 18px;
81
- margin: 0 4px;
82
- background-color: $color-border;
83
- }
84
-
85
- .toolBtn {
86
- display: inline-flex;
87
- align-items: center;
88
- justify-content: center;
89
- width: 30px;
90
- height: 30px;
91
- padding: 0;
92
- border: 1px solid transparent;
93
- border-radius: $evo-border-radius-sm;
94
- background: transparent;
95
- color: $color-text-secondary;
96
- cursor: pointer;
97
- transition: background-color $transition-fast, color $transition-fast, border-color $transition-fast;
98
- -webkit-tap-highlight-color: transparent;
99
-
100
- &:hover:not(:disabled) {
101
- background-color: $color-surface-hover;
102
- color: $color-text-primary;
103
- }
104
-
105
- &:active:not(:disabled) {
106
- background-color: $color-surface-active;
107
- }
108
-
109
- &:disabled {
110
- cursor: not-allowed;
111
- opacity: 0.45;
112
- }
113
-
114
- &:focus-visible {
115
- outline: none;
116
- border-color: $evo-primary-color;
117
- box-shadow: 0 0 0 2px color-mix(in srgb, $evo-primary-color 22%, transparent);
118
- }
119
- }
120
-
121
- .toolBtnActive {
122
- background-color: $evo-primary-soft;
123
- color: $evo-primary-color;
124
-
125
- &:hover:not(:disabled) {
126
- background-color: $evo-primary-soft;
127
- color: $evo-primary-color;
128
- }
129
- }
130
-
131
- // ---- Editor surface ----
132
- .editor {
133
- flex: 1;
134
- padding: 0.75rem 0.875rem;
135
- font-family: $font-sans;
136
- font-size: $text-sm;
137
- line-height: 1.6;
138
- color: $color-text-primary;
139
- outline: none;
140
- overflow-y: auto;
141
- word-break: break-word;
142
- -webkit-overflow-scrolling: touch;
143
-
144
- // ---- Placeholder ----
145
- &.editorEmpty::before {
146
- content: attr(data-placeholder);
147
- color: $color-text-muted;
148
- pointer-events: none;
149
- display: block;
150
- }
151
-
152
- // ---- Content typography (inside the editor only) ----
153
- & > * + * { margin-top: 0.5rem; }
154
-
155
- & p { margin: 0; }
156
-
157
- & h1, & h2, & h3 {
158
- margin: 0;
159
- font-weight: 600;
160
- line-height: 1.3;
161
- color: $color-text-primary;
162
- }
163
- & h1 { font-size: $text-2xl; }
164
- & h2 { font-size: $text-xl; }
165
- & h3 { font-size: $text-lg; }
166
-
167
- & ul, & ol {
168
- margin: 0;
169
- padding-left: 1.5rem;
170
- }
171
- & li + li { margin-top: 0.25rem; }
172
-
173
- & blockquote {
174
- margin: 0;
175
- padding: 0.25rem 0.75rem;
176
- border-left: 3px solid $color-border-strong;
177
- color: $color-text-secondary;
178
- font-style: italic;
179
- }
180
-
181
- & pre {
182
- margin: 0;
183
- padding: 0.625rem 0.75rem;
184
- background-color: $color-surface-sunken;
185
- border: 1px solid $color-border-subtle;
186
- border-radius: $evo-border-radius-sm;
187
- font-family: 'SF Mono', Menlo, Consolas, monospace;
188
- font-size: $text-xs;
189
- overflow-x: auto;
190
- }
191
-
192
- & a {
193
- color: $evo-primary-color;
194
- text-decoration: underline;
195
- text-underline-offset: 2px;
196
- }
197
-
198
- & img {
199
- max-width: 100%;
200
- height: auto;
201
- border-radius: $evo-border-radius-sm;
202
- display: block;
203
- margin: 0.25rem 0;
204
- }
205
- }
206
-
207
- // ---- Drag & drop overlay ----
208
- .dropOverlay {
209
- position: absolute;
210
- inset: 0;
211
- display: flex;
212
- align-items: center;
213
- justify-content: center;
214
- background-color: color-mix(in srgb, $evo-primary-color 10%, transparent);
215
- border: 2px dashed $evo-primary-color;
216
- border-radius: $radius-sm;
217
- pointer-events: none;
218
- font-size: $text-sm;
219
- font-weight: 500;
220
- color: $evo-primary-color;
221
- z-index: 2;
222
- }
223
-
224
- // ---- Inline link prompt ----
225
- .linkPrompt {
226
- display: flex;
227
- align-items: center;
228
- gap: 0.375rem;
229
- padding: 8px;
230
- border-top: 1px solid $color-border-subtle;
231
- background-color: $color-surface-sunken;
232
- }
233
-
234
- .linkInput {
235
- flex: 1;
236
- min-width: 0;
237
- padding: 0.375rem 0.5rem;
238
- border: 1px solid $color-border;
239
- border-radius: $evo-border-radius-sm;
240
- background-color: $color-surface;
241
- color: $color-text-primary;
242
- font-size: $text-xs;
243
- font-family: $font-sans;
244
- outline: none;
245
-
246
- &:focus {
247
- border-color: $evo-primary-color;
248
- box-shadow: 0 0 0 2px color-mix(in srgb, $evo-primary-color 18%, transparent);
249
- }
250
- }
251
-
252
- .linkBtn,
253
- .linkBtnGhost {
254
- padding: 0.375rem 0.625rem;
255
- border-radius: $evo-border-radius-sm;
256
- font-size: $text-xs;
257
- font-weight: 600;
258
- cursor: pointer;
259
- border: 1px solid transparent;
260
- font-family: $font-sans;
261
- transition: background-color $transition-fast;
262
- }
263
-
264
- .linkBtn {
265
- background-color: $evo-primary-color;
266
- color: $evo-primary-fg;
267
-
268
- &:hover { background-color: $evo-primary-hover; }
269
- }
270
-
271
- .linkBtnGhost {
272
- background-color: transparent;
273
- color: $color-text-secondary;
274
-
275
- &:hover { background-color: $color-surface-hover; }
276
- }
277
-
278
- // ---- Helper / error text ----
279
- .helperText {
280
- font-size: $text-xs;
281
- color: $color-text-muted;
282
- margin: 0;
283
- }
284
-
285
- .errorText {
286
- font-size: $text-xs;
287
- color: $evo-danger-color;
288
- margin: 0;
289
- }
290
-
291
- // ---- Mobile tuning ----
292
- @media (max-width: 480px) {
293
- .toolbar {
294
- padding: 4px 6px;
295
- }
296
- .toolBtn {
297
- width: 34px;
298
- height: 34px; // Larger tap target on touch devices
299
- }
300
- .divider {
301
- margin: 0 2px;
302
- }
303
- .editor {
304
- padding: 0.625rem 0.75rem;
305
- font-size: $text-base; // Prevents iOS zoom on focus
306
- }
307
- }
1
+ @use 'base/variables' as *;
2
+ @use 'base/color' as *;
3
+
4
+ // =============================================================
5
+ // EvoRichTextArea
6
+ // -------------------------------------------------------------
7
+ // A pluggable rich-text editor. Pure DOM + Selection API,
8
+ // no third-party editor framework. Theme-aware via the same
9
+ // CSS variables every other component reads.
10
+ // =============================================================
11
+
12
+ .field {
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 0.375rem;
16
+ font-family: $font-sans;
17
+ min-width: 0;
18
+ }
19
+
20
+ .fullWidth { width: 100%; }
21
+
22
+ .label {
23
+ font-size: $text-sm;
24
+ font-weight: 500;
25
+ color: $color-text-primary;
26
+ }
27
+
28
+ // ---- Outer shell (toolbar + editor) ----
29
+ .shell {
30
+ position: relative;
31
+ display: flex;
32
+ flex-direction: column;
33
+ background-color: $color-surface;
34
+ border: 1px solid $color-border;
35
+ border-radius: $radius-sm;
36
+ overflow: hidden;
37
+ transition: border-color $transition-fast, box-shadow $transition-fast;
38
+
39
+ &:focus-within {
40
+ border-color: $evo-primary-color;
41
+ box-shadow: 0 0 0 3px color-mix(in srgb, $evo-primary-color 18%, transparent);
42
+ }
43
+
44
+ &.hasError {
45
+ border-color: $evo-danger-color;
46
+ &:focus-within {
47
+ box-shadow: 0 0 0 3px color-mix(in srgb, $evo-danger-color 18%, transparent);
48
+ }
49
+ }
50
+
51
+ &.disabled {
52
+ opacity: 0.6;
53
+ pointer-events: none;
54
+ }
55
+
56
+ &.dragOver {
57
+ border-color: $evo-primary-color;
58
+ border-style: dashed;
59
+ }
60
+ }
61
+
62
+ // ---- Toolbar ----
63
+ .toolbar {
64
+ display: flex;
65
+ flex-wrap: wrap;
66
+ align-items: center;
67
+ gap: 2px;
68
+ padding: 6px 8px;
69
+ background-color: $color-surface-sunken;
70
+ border-bottom: 1px solid $color-border-subtle;
71
+ // Sticky when the editor scrolls — toolbar stays visible
72
+ position: sticky;
73
+ top: 0;
74
+ z-index: 1;
75
+ }
76
+
77
+ .divider {
78
+ display: inline-block;
79
+ width: 1px;
80
+ height: 18px;
81
+ margin: 0 4px;
82
+ background-color: $color-border;
83
+ }
84
+
85
+ .toolBtn {
86
+ display: inline-flex;
87
+ align-items: center;
88
+ justify-content: center;
89
+ width: 30px;
90
+ height: 30px;
91
+ padding: 0;
92
+ border: 1px solid transparent;
93
+ border-radius: $evo-border-radius-sm;
94
+ background: transparent;
95
+ color: $color-text-secondary;
96
+ cursor: pointer;
97
+ transition: background-color $transition-fast, color $transition-fast, border-color $transition-fast;
98
+ -webkit-tap-highlight-color: transparent;
99
+
100
+ &:hover:not(:disabled) {
101
+ background-color: $color-surface-hover;
102
+ color: $color-text-primary;
103
+ }
104
+
105
+ &:active:not(:disabled) {
106
+ background-color: $color-surface-active;
107
+ }
108
+
109
+ &:disabled {
110
+ cursor: not-allowed;
111
+ opacity: 0.45;
112
+ }
113
+
114
+ &:focus-visible {
115
+ outline: none;
116
+ border-color: $evo-primary-color;
117
+ box-shadow: 0 0 0 2px color-mix(in srgb, $evo-primary-color 22%, transparent);
118
+ }
119
+ }
120
+
121
+ .toolBtnActive {
122
+ background-color: $evo-primary-soft;
123
+ color: $evo-primary-color;
124
+
125
+ &:hover:not(:disabled) {
126
+ background-color: $evo-primary-soft;
127
+ color: $evo-primary-color;
128
+ }
129
+ }
130
+
131
+ // ---- Editor surface ----
132
+ .editor {
133
+ flex: 1;
134
+ padding: 0.75rem 0.875rem;
135
+ font-family: $font-sans;
136
+ font-size: $text-sm;
137
+ line-height: 1.6;
138
+ color: $color-text-primary;
139
+ outline: none;
140
+ overflow-y: auto;
141
+ word-break: break-word;
142
+ -webkit-overflow-scrolling: touch;
143
+
144
+ // ---- Placeholder ----
145
+ &.editorEmpty::before {
146
+ content: attr(data-placeholder);
147
+ color: $color-text-muted;
148
+ pointer-events: none;
149
+ display: block;
150
+ }
151
+
152
+ // ---- Content typography (inside the editor only) ----
153
+ & > * + * { margin-top: 0.5rem; }
154
+
155
+ & p { margin: 0; }
156
+
157
+ & h1, & h2, & h3 {
158
+ margin: 0;
159
+ font-weight: 600;
160
+ line-height: 1.3;
161
+ color: $color-text-primary;
162
+ }
163
+ & h1 { font-size: $text-2xl; }
164
+ & h2 { font-size: $text-xl; }
165
+ & h3 { font-size: $text-lg; }
166
+
167
+ & ul, & ol {
168
+ margin: 0;
169
+ padding-left: 1.5rem;
170
+ }
171
+ & li + li { margin-top: 0.25rem; }
172
+
173
+ & blockquote {
174
+ margin: 0;
175
+ padding: 0.25rem 0.75rem;
176
+ border-left: 3px solid $color-border-strong;
177
+ color: $color-text-secondary;
178
+ font-style: italic;
179
+ }
180
+
181
+ & pre {
182
+ margin: 0;
183
+ padding: 0.625rem 0.75rem;
184
+ background-color: $color-surface-sunken;
185
+ border: 1px solid $color-border-subtle;
186
+ border-radius: $evo-border-radius-sm;
187
+ font-family: 'SF Mono', Menlo, Consolas, monospace;
188
+ font-size: $text-xs;
189
+ overflow-x: auto;
190
+ }
191
+
192
+ & a {
193
+ color: $evo-primary-color;
194
+ text-decoration: underline;
195
+ text-underline-offset: 2px;
196
+ }
197
+
198
+ & img {
199
+ max-width: 100%;
200
+ height: auto;
201
+ border-radius: $evo-border-radius-sm;
202
+ display: block;
203
+ margin: 0.25rem 0;
204
+ }
205
+ }
206
+
207
+ // ---- Drag & drop overlay ----
208
+ .dropOverlay {
209
+ position: absolute;
210
+ inset: 0;
211
+ display: flex;
212
+ align-items: center;
213
+ justify-content: center;
214
+ background-color: color-mix(in srgb, $evo-primary-color 10%, transparent);
215
+ border: 2px dashed $evo-primary-color;
216
+ border-radius: $radius-sm;
217
+ pointer-events: none;
218
+ font-size: $text-sm;
219
+ font-weight: 500;
220
+ color: $evo-primary-color;
221
+ z-index: 2;
222
+ }
223
+
224
+ // ---- Inline link prompt ----
225
+ .linkPrompt {
226
+ display: flex;
227
+ align-items: center;
228
+ gap: 0.375rem;
229
+ padding: 8px;
230
+ border-top: 1px solid $color-border-subtle;
231
+ background-color: $color-surface-sunken;
232
+ }
233
+
234
+ .linkInput {
235
+ flex: 1;
236
+ min-width: 0;
237
+ padding: 0.375rem 0.5rem;
238
+ border: 1px solid $color-border;
239
+ border-radius: $evo-border-radius-sm;
240
+ background-color: $color-surface;
241
+ color: $color-text-primary;
242
+ font-size: $text-xs;
243
+ font-family: $font-sans;
244
+ outline: none;
245
+
246
+ &:focus {
247
+ border-color: $evo-primary-color;
248
+ box-shadow: 0 0 0 2px color-mix(in srgb, $evo-primary-color 18%, transparent);
249
+ }
250
+ }
251
+
252
+ .linkBtn,
253
+ .linkBtnGhost {
254
+ padding: 0.375rem 0.625rem;
255
+ border-radius: $evo-border-radius-sm;
256
+ font-size: $text-xs;
257
+ font-weight: 600;
258
+ cursor: pointer;
259
+ border: 1px solid transparent;
260
+ font-family: $font-sans;
261
+ transition: background-color $transition-fast;
262
+ }
263
+
264
+ .linkBtn {
265
+ background-color: $evo-primary-color;
266
+ color: $evo-primary-fg;
267
+
268
+ &:hover { background-color: $evo-primary-hover; }
269
+ }
270
+
271
+ .linkBtnGhost {
272
+ background-color: transparent;
273
+ color: $color-text-secondary;
274
+
275
+ &:hover { background-color: $color-surface-hover; }
276
+ }
277
+
278
+ // ---- Helper / error text ----
279
+ .helperText {
280
+ font-size: $text-xs;
281
+ color: $color-text-muted;
282
+ margin: 0;
283
+ }
284
+
285
+ .errorText {
286
+ font-size: $text-xs;
287
+ color: $evo-danger-color;
288
+ margin: 0;
289
+ }
290
+
291
+ // ---- Mobile tuning ----
292
+ @media (max-width: 480px) {
293
+ .toolbar {
294
+ padding: 4px 6px;
295
+ }
296
+ .toolBtn {
297
+ width: 34px;
298
+ height: 34px; // Larger tap target on touch devices
299
+ }
300
+ .divider {
301
+ margin: 0 2px;
302
+ }
303
+ .editor {
304
+ padding: 0.625rem 0.75rem;
305
+ font-size: $text-base; // Prevents iOS zoom on focus
306
+ }
307
+ }