canny-ui 2.0.0 → 4.0.0

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,111 @@
1
+ @use '../tokens/primitives' as *;
2
+
3
+ // FileUploader — responsive drag-and-drop dropzone.
4
+
5
+ .cny-uploader {
6
+ display: flex;
7
+ flex-direction: column;
8
+ align-items: center;
9
+ justify-content: center;
10
+ gap: $space-3;
11
+ width: 100%;
12
+ box-sizing: border-box;
13
+ // fluid padding: comfortable on desktop, tight on small screens
14
+ padding: clamp(#{$space-4}, 4vw, #{$space-8}) clamp(#{$space-3}, 3vw, #{$space-6});
15
+ text-align: center;
16
+ border: 1.5px dashed var(--border-color-strong);
17
+ border-radius: $radius-lg;
18
+ background: var(--bg-surface-low);
19
+ color: var(--text-secondary);
20
+ font-family: var(--font-body);
21
+ cursor: pointer;
22
+ transition:
23
+ border-color 140ms ease,
24
+ background-color 140ms ease,
25
+ color 140ms ease;
26
+
27
+ &:hover:not(.is-disabled) {
28
+ border-color: var(--color-primary);
29
+ color: var(--text-primary);
30
+ }
31
+
32
+ &:focus-visible {
33
+ outline: 2px solid var(--color-primary);
34
+ outline-offset: 2px;
35
+ }
36
+
37
+ &.is-dragging {
38
+ border-color: var(--color-primary);
39
+ border-style: solid;
40
+ background: var(--color-primary-soft);
41
+ color: var(--color-primary);
42
+ }
43
+
44
+ &.is-disabled {
45
+ cursor: not-allowed;
46
+ opacity: 0.55;
47
+ }
48
+
49
+ // roomier preset
50
+ &-md {
51
+ min-height: 150px;
52
+ }
53
+
54
+ // compact preset — collapses to a single inline row on wider screens
55
+ &-sm {
56
+ gap: $space-2;
57
+ padding: clamp(#{$space-3}, 2.5vw, #{$space-4});
58
+ min-height: 0;
59
+ }
60
+ }
61
+
62
+ .cny-uploader-icon {
63
+ display: inline-flex;
64
+ align-items: center;
65
+ justify-content: center;
66
+ color: var(--color-primary);
67
+
68
+ svg {
69
+ width: clamp(24px, 6vw, 34px);
70
+ height: clamp(24px, 6vw, 34px);
71
+ }
72
+ }
73
+
74
+ .cny-uploader-sm .cny-uploader-icon svg {
75
+ width: 22px;
76
+ height: 22px;
77
+ }
78
+
79
+ .cny-uploader-text {
80
+ display: flex;
81
+ flex-direction: column;
82
+ gap: 2px;
83
+ min-width: 0;
84
+ }
85
+
86
+ .cny-uploader-label {
87
+ font-size: clamp(0.8125rem, 2.5vw, 0.9375rem);
88
+ font-weight: 550;
89
+ line-height: 1.35;
90
+ color: var(--text-primary);
91
+ text-wrap: balance;
92
+ }
93
+
94
+ .cny-uploader-hint {
95
+ font-size: clamp(0.6875rem, 2vw, 0.8125rem);
96
+ color: var(--text-muted);
97
+ text-wrap: balance;
98
+ }
99
+
100
+ // stack the icon beside the text on the compact preset once there's room
101
+ @media (min-width: 420px) {
102
+ .cny-uploader-sm {
103
+ flex-direction: row;
104
+ justify-content: center;
105
+ text-align: start;
106
+ }
107
+
108
+ .cny-uploader-sm .cny-uploader-text {
109
+ align-items: flex-start;
110
+ }
111
+ }