@adamjanicki/ui 1.5.4 → 1.5.6

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/components/Alert/Alert.d.ts +3 -15
  2. package/components/Alert/Alert.js +1 -1
  3. package/components/Animated/Animated.d.ts +19 -27
  4. package/components/Animated/Animated.js +54 -19
  5. package/components/Badge/Badge.d.ts +3 -16
  6. package/components/Badge/Badge.js +1 -1
  7. package/components/Banner/Banner.d.ts +3 -15
  8. package/components/Banner/Banner.js +1 -1
  9. package/components/Button/Button.d.ts +4 -8
  10. package/components/Button/Button.js +2 -2
  11. package/components/Carousel/Carousel.d.ts +56 -0
  12. package/components/Carousel/Carousel.js +87 -0
  13. package/components/Carousel/index.d.ts +2 -0
  14. package/components/Carousel/index.js +2 -0
  15. package/components/ClickOutside/ClickOutside.d.ts +4 -4
  16. package/components/ClickOutside/ClickOutside.js +14 -13
  17. package/components/Hamburger/Hamburger.d.ts +6 -5
  18. package/components/InlineCode/InlineCode.d.ts +13 -0
  19. package/components/InlineCode/InlineCode.js +50 -0
  20. package/components/InlineCode/index.d.ts +2 -0
  21. package/components/InlineCode/index.js +2 -0
  22. package/components/Input/IconInput.d.ts +2 -2
  23. package/components/Input/IconInput.js +1 -1
  24. package/components/Input/Input.d.ts +1 -1
  25. package/components/Input/Input.js +1 -1
  26. package/components/Input/TextArea.d.ts +1 -1
  27. package/components/Input/TextArea.js +1 -1
  28. package/components/Layer/Layer.d.ts +4 -11
  29. package/components/Layer/Layer.js +1 -1
  30. package/components/Link/Link.d.ts +2 -4
  31. package/components/Link/Link.js +2 -2
  32. package/components/Select/Select.d.ts +2 -13
  33. package/components/Select/Select.js +2 -3
  34. package/components/Spinner/Spinner.d.ts +2 -2
  35. package/functions/scrollToId.js +1 -1
  36. package/hooks/useFocusTrap.d.ts +1 -1
  37. package/index.d.ts +13 -9
  38. package/index.js +15 -9
  39. package/package.json +8 -28
  40. package/style.css +124 -77
  41. package/types/index.d.ts +9 -0
package/style.css CHANGED
@@ -1,13 +1,12 @@
1
1
  /* General styles */
2
2
  :root {
3
3
  /* General colors */
4
- --ajui-light-gray: #eee;
5
4
  --ajui-moon-gray: #ccc;
6
5
  --ajui-dark-gray: #555;
7
6
  --ajui-darkest-gray: #333;
8
7
  --ajui-obsidian: #121212;
9
8
  --ajui-focus-ring-color: #b2dbfa;
10
- --ajui-default-color: #111;
9
+ --ajui-default-text-color: #111;
11
10
  --ajui-default-background: white;
12
11
  --ajui-default-border: var(--ajui-moon-gray);
13
12
  /* General values */
@@ -16,22 +15,12 @@
16
15
  --ajui-default-opacity-dim: 0.75;
17
16
  /* Corners */
18
17
  --ajui-sharp-radius: 0;
19
- --ajui-rounded-radius: 0.5rem;
18
+ --ajui-rounded-radius: 8px;
20
19
  --ajui-pill-radius: 9999px;
21
- --ajui-circle-radius: 50%;
22
20
  /* Buttons */
23
21
  --ajui-button-primary-background: black;
24
22
  --ajui-button-primary-color: white;
25
- --ajui-button-secondary-background: white;
26
- --ajui-button-secondary-color: #111;
27
- --ajui-button-secondary-border: var(--ajui-moon-gray);
28
- --ajui-button-transparent-background: transparent;
29
23
  --ajui-button-secondary-border-hover: var(--ajui-darkest-gray);
30
- /* Input */
31
- --ajui-input-selection-color: var(--ajui-focus-ring-color);
32
- --ajui-input-border: var(--ajui-default-border);
33
- /* Select */
34
- --ajui-select-border: var(--ajui-moon-gray);
35
24
  /* Content types */
36
25
  --ajui-success-background: #dff2e1;
37
26
  --ajui-success-color: #1b5e20;
@@ -50,8 +39,6 @@
50
39
  --ajui-info-border: #90caf9;
51
40
 
52
41
  --ajui-static-background: #e8e8e8;
53
- --ajui-static-color: var(--ajui-default-color);
54
- --ajui-static-border: var(--ajui-default-border);
55
42
  /* Layer */
56
43
  --ajui-layer-backdrop-background: rgba(200, 200, 200, 0.7);
57
44
  /* Link */
@@ -61,22 +48,13 @@
61
48
  [data-theme="dark"] {
62
49
  /* General colors */
63
50
  --ajui-focus-ring-color: #6699cc;
64
- --ajui-default-color: white;
51
+ --ajui-default-text-color: white;
65
52
  --ajui-default-background: var(--ajui-obsidian);
66
53
  --ajui-default-border: var(--ajui-dark-gray);
67
54
  /* Buttons */
68
55
  --ajui-button-primary-background: white;
69
56
  --ajui-button-primary-color: var(--ajui-obsidian);
70
- --ajui-button-secondary-background: var(--ajui-obsidian);
71
- --ajui-button-secondary-color: white;
72
- --ajui-button-secondary-border: var(--ajui-dark-gray);
73
- --ajui-button-transparent-background: transparent;
74
57
  --ajui-button-secondary-border-hover: var(--ajui-moon-gray);
75
- /* Input */
76
- --ajui-input-selection-color: var(--ajui-focus-ring-color);
77
- --ajui-input-border: var(--ajui-dark-gray);
78
- /* Select */
79
- --ajui-select-border: var(--ajui-dark-gray);
80
58
  /* Content types */
81
59
  --ajui-success-background: #2a5733;
82
60
  --ajui-success-color: #d9efd8;
@@ -95,74 +73,63 @@
95
73
  --ajui-info-border: #1d8ea4;
96
74
 
97
75
  --ajui-static-background: var(--ajui-darkest-gray);
98
- --ajui-static-color: var(--ajui-default-color);
99
- --ajui-static-border: var(--ajui-default-border);
100
76
  /* Layer */
101
77
  --ajui-layer-backdrop-background: rgba(55, 55, 55, 0.7);
102
78
  /* Link */
103
79
  --ajui-link-color: #009ef3;
104
80
  }
105
81
 
106
- a:focus:not(:focus-visible) {
107
- outline: none;
108
- }
109
-
110
- a,
111
- button {
112
- outline-color: var(--ajui-link-color);
113
- }
114
-
115
82
  .ajui-input-default:not([disabled]):focus-within,
116
83
  .ajui-select-container:not([disabled]):focus-within {
117
84
  outline: 3px solid var(--ajui-focus-ring-color);
118
85
  outline-offset: 0;
119
86
  }
120
87
 
121
- .corners--rounded {
88
+ .ajui-corners--rounded {
122
89
  border-radius: var(--ajui-rounded-radius);
123
90
  }
124
91
 
125
- .corners--pill {
92
+ .ajui-corners--pill {
126
93
  border-radius: var(--ajui-pill-radius);
127
94
  }
128
95
 
129
- .corners--sharp {
96
+ .ajui-corners--sharp {
130
97
  border-radius: var(--ajui-sharp-radius);
131
98
  }
132
99
 
133
- .content--success {
100
+ .ajui-content--success {
134
101
  background-color: var(--ajui-success-background);
135
102
  color: var(--ajui-success-color);
136
103
  border-color: var(--ajui-success-border);
137
104
  }
138
105
 
139
- .content--warning {
106
+ .ajui-content--warning {
140
107
  background-color: var(--ajui-warning-background);
141
108
  color: var(--ajui-warning-color);
142
109
  border-color: var(--ajui-warning-border);
143
110
  }
144
111
 
145
- .content--error {
112
+ .ajui-content--error {
146
113
  background-color: var(--ajui-error-background);
147
114
  color: var(--ajui-error-color);
148
115
  border-color: var(--ajui-error-border);
149
116
  }
150
117
 
151
- .content--info {
118
+ .ajui-content--info {
152
119
  background-color: var(--ajui-info-background);
153
120
  color: var(--ajui-info-color);
154
121
  border-color: var(--ajui-info-border);
155
122
  }
156
123
 
157
- .content--static {
124
+ .ajui-content--static {
158
125
  background-color: var(--ajui-static-background);
159
- color: var(--ajui-static-color);
160
- border-color: var(--ajui-static-border);
126
+ color: var(--ajui-default-text-color);
127
+ border-color: var(--ajui-default-border);
161
128
  }
162
129
 
163
130
  /* Alert */
164
131
  .ajui-alert {
165
- padding: 1rem;
132
+ padding: 16px;
166
133
  border-style: solid;
167
134
  border-width: 1px;
168
135
  font-weight: 400;
@@ -180,17 +147,22 @@ button {
180
147
 
181
148
  /* Banner */
182
149
  .ajui-banner {
183
- padding: 1.5rem 2rem;
150
+ padding: 24px 32px;
184
151
  border: none;
185
152
  font-weight: 400;
186
- width: 100vw;
153
+ width: 100%;
187
154
  }
188
155
 
189
- /* Link */
190
- a {
156
+ /* Action (link/button) */
157
+ .ajui-action {
191
158
  color: inherit;
192
159
  text-decoration: none;
193
160
  cursor: pointer;
161
+ outline-color: var(--ajui-link-color);
162
+ }
163
+
164
+ .ajui-action:focus:not(:focus-visible) {
165
+ outline: none;
194
166
  }
195
167
 
196
168
  /* Button */
@@ -199,13 +171,12 @@ a {
199
171
  color: inherit;
200
172
  border: none;
201
173
  padding: 0;
202
- cursor: pointer;
203
- font-size: 1rem;
204
- font-weight: 500;
174
+ font-size: 16px;
205
175
  }
206
176
 
207
177
  .ajui-button-size--regular {
208
- padding: 0.5rem 1rem;
178
+ padding: 8px 16px;
179
+ font-weight: 600;
209
180
  }
210
181
 
211
182
  .ajui-button-size--small {
@@ -219,11 +190,11 @@ a {
219
190
  justify-content: center;
220
191
  align-items: center;
221
192
  transition: opacity var(--ajui-default-transition);
222
- padding: 0.25rem;
193
+ padding: 4px;
223
194
  }
224
195
 
225
196
  .ajui-button-base:disabled {
226
- cursor: not-allowed !important;
197
+ cursor: default !important;
227
198
  opacity: var(--ajui-disabled-opacity);
228
199
  }
229
200
 
@@ -233,17 +204,17 @@ a {
233
204
  transition: opacity var(--ajui-default-transition);
234
205
  }
235
206
 
236
- .ajui-button--transparent,
237
207
  .ajui-button--secondary {
238
- box-shadow: inset 0 0 0 1px var(--ajui-button-secondary-border);
208
+ box-shadow: inset 0 0 0 1px var(--ajui-default-border);
239
209
  transition: box-shadow var(--ajui-default-transition);
240
210
  }
241
211
 
242
212
  .ajui-button--secondary {
243
- background-color: var(--ajui-button-secondary-background);
213
+ background-color: var(--ajui-default-background);
244
214
  }
245
215
 
246
216
  .ajui-link-default {
217
+ font-weight: 600;
247
218
  color: var(--ajui-link-color);
248
219
  transition: opacity var(--ajui-default-transition);
249
220
  }
@@ -255,7 +226,6 @@ a {
255
226
  opacity: var(--ajui-default-opacity-dim);
256
227
  }
257
228
 
258
- .ajui-button--transparent:not([disabled]):hover,
259
229
  .ajui-button--secondary:not([disabled]):hover {
260
230
  box-shadow: inset 0 0 0 1px var(--ajui-button-secondary-border-hover);
261
231
  }
@@ -267,13 +237,13 @@ a {
267
237
  border: none;
268
238
  background-color: inherit;
269
239
  color: inherit;
270
- padding: 0.75rem 0.5rem;
271
- font-size: 1rem;
240
+ padding: 12px 8px;
241
+ font-size: 16px;
272
242
  font-weight: 400;
273
243
  }
274
244
 
275
245
  .ajui-input-base::selection {
276
- background-color: var(--ajui-input-selection-color);
246
+ background-color: var(--ajui-focus-ring-color);
277
247
  }
278
248
 
279
249
  .ajui-icon-input {
@@ -292,11 +262,12 @@ a {
292
262
  transition: outline var(--ajui-default-transition);
293
263
  outline: 0px solid transparent;
294
264
  box-shadow: inset 0 0 0 1px var(--ajui-default-border);
265
+ background-color: var(--ajui-default-background);
295
266
  }
296
267
 
297
268
  .ajui-input-default:disabled {
298
269
  opacity: var(--ajui-disabled-opacity);
299
- cursor: not-allowed;
270
+ cursor: default;
300
271
  }
301
272
 
302
273
  /* Select */
@@ -306,13 +277,8 @@ a {
306
277
  width: fit-content;
307
278
  transition: outline var(--ajui-default-transition);
308
279
  outline: 0px solid transparent;
309
- box-shadow: inset 0 0 0 1px var(--ajui-select-border);
310
- background-color: inherit;
311
- }
312
-
313
- .ajui-select-disabled {
314
- opacity: var(--ajui-disabled-opacity);
315
- cursor: not-allowed !important;
280
+ box-shadow: inset 0 0 0 1px var(--ajui-default-border);
281
+ background-color: var(--ajui-default-background);
316
282
  }
317
283
 
318
284
  .ajui-select-base {
@@ -323,22 +289,27 @@ a {
323
289
  box-shadow: none;
324
290
  cursor: pointer;
325
291
  background-color: transparent;
326
- padding: 0.75rem 1.75rem 0.75rem 0.5rem;
327
- font-size: 1rem;
292
+ padding: 12px 28px 12px 8px;
293
+ font-size: 16px;
328
294
  font-weight: 400;
329
295
  appearance: none;
330
296
  -webkit-appearance: none;
331
297
  -moz-appearance: none;
332
298
  }
333
299
 
300
+ .ajui-select-disabled * {
301
+ opacity: var(--ajui-disabled-opacity);
302
+ cursor: default;
303
+ }
304
+
334
305
  .ajui-select-triangle {
335
- --size: 0.75rem;
306
+ --size: 12px;
336
307
  width: var(--size);
337
308
  height: var(--size);
338
309
  position: absolute;
339
310
  top: 50%;
340
311
  transform: translateY(-50%);
341
- right: calc(var(--size) - 0.25rem);
312
+ right: calc(var(--size) - 4px);
342
313
  pointer-events: none;
343
314
  }
344
315
 
@@ -360,7 +331,7 @@ a {
360
331
  .ajui-spinner {
361
332
  animation: ajui-spinner-animation 1s linear infinite;
362
333
  transform-origin: center;
363
- height: 1.5rem;
334
+ height: 24px;
364
335
  }
365
336
 
366
337
  @keyframes ajui-spinner-animation {
@@ -371,3 +342,79 @@ a {
371
342
  transform: rotate(360deg);
372
343
  }
373
344
  }
345
+
346
+ /* Inline Code */
347
+ .ajui-inline-code {
348
+ background-color: var(--ajui-default-border);
349
+ color: var(--ajui-default-text-color);
350
+ border-radius: var(--ajui-rounded-radius);
351
+ transition: background-color var(--ajui-default-transition);
352
+ word-wrap: break-word;
353
+ }
354
+
355
+ .ajui-copy-cursor {
356
+ cursor: copy;
357
+ }
358
+
359
+ .ajui-inline-code-copied {
360
+ background-color: var(--ajui-success-background);
361
+ }
362
+
363
+ /* Carousel */
364
+ .ajui-carousel {
365
+ max-width: 100%;
366
+ position: relative;
367
+ overflow: hidden;
368
+ min-height: 64px;
369
+ min-width: 64px;
370
+ width: fit-content;
371
+ }
372
+
373
+ .ajui-carousel-slider {
374
+ width: 100%;
375
+ height: 100%;
376
+ display: flex;
377
+ }
378
+
379
+ .ajui-carousel-item {
380
+ flex: 0 0 100%;
381
+ width: 100%;
382
+ height: 100%;
383
+ }
384
+
385
+ .ajui-carousel-arrow-prev,
386
+ .ajui-carousel-arrow-next {
387
+ display: flex;
388
+ justify-content: center;
389
+ align-items: center;
390
+ position: absolute;
391
+ top: 50%;
392
+ transform: translateY(-50%);
393
+ width: 24px;
394
+ height: 24px;
395
+ padding: 0;
396
+ font-weight: 800;
397
+ }
398
+
399
+ .ajui-carousel-arrow-prev {
400
+ left: 8px;
401
+ }
402
+ .ajui-carousel-arrow-next {
403
+ right: 8px;
404
+ }
405
+
406
+ .ajui-carousel-dots {
407
+ position: absolute;
408
+ display: flex;
409
+ align-items: center;
410
+ bottom: 8px;
411
+ transform: translateX(-50%);
412
+ left: 50%;
413
+ }
414
+
415
+ .ajui-carousel-dot {
416
+ width: 16px;
417
+ height: 8px;
418
+ padding: 0;
419
+ margin: 0 2px;
420
+ }
package/types/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  /**
2
3
  * The type of corner to display, controlling the border radius property.
3
4
  */
@@ -6,3 +7,11 @@ export type CornerType = "pill" | "rounded" | "sharp";
6
7
  * The type of message associated with a piece of content.
7
8
  */
8
9
  export type ContentType = "success" | "warning" | "error" | "info" | "static";
10
+ /**
11
+ * Standard style object to apply inline styling to components.
12
+ */
13
+ export type Style = React.CSSProperties;
14
+ /**
15
+ * Default props for a div element
16
+ */
17
+ export type DivProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>;