@inglorious/ui 6.0.0 → 7.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.
- package/package.json +32 -12
- package/src/controls/controls.css +3 -1
- package/src/controls/file-upload/file-upload.stories.js +93 -0
- package/src/controls/file-upload/index.js +3 -0
- package/src/controls/file-upload/style.css +99 -0
- package/src/controls/file-upload/template.js +100 -0
- package/src/controls/input/input.stories.js +110 -3
- package/src/controls/textarea/index.js +3 -0
- package/src/controls/textarea/style.css +98 -0
- package/src/controls/textarea/template.js +94 -0
- package/src/controls/textarea/textarea.stories.js +158 -0
- package/src/data-display/before-after/before-after.stories.js +74 -0
- package/src/data-display/before-after/handlers.js +44 -0
- package/src/data-display/before-after/helpers.js +4 -0
- package/src/data-display/before-after/index.js +17 -0
- package/src/data-display/before-after/style.css +128 -0
- package/src/data-display/before-after/template.js +225 -0
- package/src/data-display/carousel/carousel.stories.js +166 -0
- package/src/data-display/carousel/handlers.js +78 -0
- package/src/data-display/carousel/helpers.js +54 -0
- package/src/data-display/carousel/index.js +17 -0
- package/src/data-display/carousel/style.css +233 -0
- package/src/data-display/carousel/template.js +655 -0
- package/src/data-display/data-display.css +2 -0
- package/src/examples/dashboard/app-drawer.js +12 -0
- package/src/examples/dashboard/before-after-data.js +29 -0
- package/src/examples/dashboard/primitive-content.js +220 -33
- package/src/index.js +4 -0
- package/src/layout/flex/flex.stories.js +49 -0
- package/src/layout/flex/style.css +59 -0
- package/src/layout/flex/template.js +2 -0
- package/types/controls/file-upload.d.ts +27 -0
- package/types/controls/input.d.ts +6 -0
- package/types/controls/textarea.d.ts +29 -0
- package/types/controls/upload-field.d.ts +27 -0
- package/types/data-display/before-after.d.ts +39 -0
- package/types/data-display/carousel.d.ts +72 -0
- package/types/index.d.ts +2 -0
- package/types/layout/flex.d.ts +1 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
.iw-carousel {
|
|
2
|
+
--iw-carousel-arrow-size: 2.25rem;
|
|
3
|
+
--iw-carousel-arrow-bg: var(--iw-color-surface);
|
|
4
|
+
--iw-carousel-arrow-color: var(--iw-color-text);
|
|
5
|
+
--iw-carousel-arrow-inset: var(--iw-space-2);
|
|
6
|
+
--iw-carousel-arrow-chevron: 5px;
|
|
7
|
+
--iw-carousel-indicator-size: 0.5rem;
|
|
8
|
+
--iw-carousel-indicator-color: var(--iw-color-border);
|
|
9
|
+
--iw-carousel-indicator-color-current: var(--iw-color-primary);
|
|
10
|
+
|
|
11
|
+
position: relative;
|
|
12
|
+
display: inline-block;
|
|
13
|
+
max-width: 100%;
|
|
14
|
+
|
|
15
|
+
&.iw-carousel-full-width {
|
|
16
|
+
display: block;
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/* A column stage otherwise shrink-wraps to its arrows instead of the
|
|
21
|
+
available inline size. */
|
|
22
|
+
&.iw-carousel-vertical {
|
|
23
|
+
display: block;
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* Snapping, swiping, momentum and RTL all come from the browser. */
|
|
28
|
+
.iw-carousel-viewport {
|
|
29
|
+
position: relative;
|
|
30
|
+
display: flex;
|
|
31
|
+
overflow-x: auto;
|
|
32
|
+
overflow-y: hidden;
|
|
33
|
+
scroll-snap-type: x mandatory;
|
|
34
|
+
overscroll-behavior-x: contain;
|
|
35
|
+
scrollbar-width: none;
|
|
36
|
+
outline: none;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.iw-carousel-viewport::-webkit-scrollbar {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.iw-carousel-viewport:focus-visible {
|
|
44
|
+
outline: 2px solid var(--iw-color-primary);
|
|
45
|
+
outline-offset: 2px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/* One item per view by default, so every item can reach the start of the
|
|
49
|
+
viewport and each one is exactly one page. Override
|
|
50
|
+
--iw-carousel-item-size to show several at once. */
|
|
51
|
+
.iw-carousel-item {
|
|
52
|
+
flex: 0 0 var(--iw-carousel-item-size, 100%);
|
|
53
|
+
scroll-snap-align: start;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Smooth scrolling would animate every drag step, so it is turned off while
|
|
57
|
+
dragging. Snapping stays on: the browser then lands on the nearest slide by
|
|
58
|
+
itself, and re-enabling it instead would snap back to the item it
|
|
59
|
+
remembered. Doubled up on the class so this outranks the reduced-motion
|
|
60
|
+
rule at the end of the file. */
|
|
61
|
+
.iw-carousel-viewport.iw-carousel-viewport-dragging {
|
|
62
|
+
scroll-behavior: auto;
|
|
63
|
+
scroll-snap-type: none;
|
|
64
|
+
cursor: grabbing;
|
|
65
|
+
user-select: none;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/* A vertical carousel has to be given a height, otherwise the viewport just
|
|
69
|
+
grows to fit every item and there is nothing left to scroll. Override
|
|
70
|
+
--iw-carousel-viewport-size to change it. */
|
|
71
|
+
&.iw-carousel-vertical .iw-carousel-viewport {
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
height: var(--iw-carousel-viewport-size, 20rem);
|
|
74
|
+
overflow-x: hidden;
|
|
75
|
+
overflow-y: auto;
|
|
76
|
+
scroll-snap-type: y mandatory;
|
|
77
|
+
overscroll-behavior-y: contain;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/* Gap tokens mirror Flex. */
|
|
81
|
+
&.iw-carousel-gap-sm .iw-carousel-viewport {
|
|
82
|
+
gap: var(--iw-space-2);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.iw-carousel-gap-md .iw-carousel-viewport {
|
|
86
|
+
gap: var(--iw-space-4);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&.iw-carousel-gap-lg .iw-carousel-viewport {
|
|
90
|
+
gap: var(--iw-space-6);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&.iw-carousel-gap-xl .iw-carousel-viewport {
|
|
94
|
+
gap: var(--iw-space-8);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* Off-axis alignment. */
|
|
98
|
+
&.iw-carousel-align-start .iw-carousel-viewport {
|
|
99
|
+
align-items: flex-start;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&.iw-carousel-align-center .iw-carousel-viewport {
|
|
103
|
+
align-items: center;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
&.iw-carousel-align-end .iw-carousel-viewport {
|
|
107
|
+
align-items: flex-end;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* The stage holds the viewport and its arrows, so centring ignores the dots. */
|
|
111
|
+
.iw-carousel-stage {
|
|
112
|
+
position: relative;
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
gap: var(--iw-space-2);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
&.iw-carousel-vertical .iw-carousel-stage {
|
|
119
|
+
flex-direction: column;
|
|
120
|
+
align-items: stretch;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.iw-carousel-stage .iw-carousel-viewport {
|
|
124
|
+
flex: 1 1 auto;
|
|
125
|
+
min-width: 0;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Inside: float the arrows over the slides. */
|
|
129
|
+
&.iw-carousel-arrows-inside .iw-carousel-stage {
|
|
130
|
+
gap: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&.iw-carousel-arrows-inside .iw-carousel-arrow {
|
|
134
|
+
position: absolute;
|
|
135
|
+
top: 50%;
|
|
136
|
+
z-index: 1;
|
|
137
|
+
transform: translateY(-50%);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&.iw-carousel-arrows-inside .iw-carousel-arrow-previous {
|
|
141
|
+
left: var(--iw-carousel-arrow-inset);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
&.iw-carousel-arrows-inside .iw-carousel-arrow-next {
|
|
145
|
+
right: var(--iw-carousel-arrow-inset);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.iw-carousel-vertical.iw-carousel-arrows-inside .iw-carousel-arrow {
|
|
149
|
+
top: auto;
|
|
150
|
+
right: auto;
|
|
151
|
+
left: 50%;
|
|
152
|
+
transform: translateX(-50%);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
&.iw-carousel-vertical.iw-carousel-arrows-inside .iw-carousel-arrow-previous {
|
|
156
|
+
top: var(--iw-carousel-arrow-inset);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
&.iw-carousel-vertical.iw-carousel-arrows-inside .iw-carousel-arrow-next {
|
|
160
|
+
bottom: var(--iw-carousel-arrow-inset);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/* Outside: the arrows sit beside the scrolling area, flex handles centring. */
|
|
164
|
+
&.iw-carousel-arrows-outside .iw-carousel-arrow {
|
|
165
|
+
position: static;
|
|
166
|
+
flex: 0 0 auto;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* Chevrons drawn with borders, no icon font needed. */
|
|
170
|
+
.iw-carousel-chevron {
|
|
171
|
+
display: block;
|
|
172
|
+
width: 0;
|
|
173
|
+
height: 0;
|
|
174
|
+
border-top: var(--iw-carousel-arrow-chevron) solid transparent;
|
|
175
|
+
border-bottom: var(--iw-carousel-arrow-chevron) solid transparent;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.iw-carousel-arrow-previous .iw-carousel-chevron {
|
|
179
|
+
margin-right: 2px;
|
|
180
|
+
border-right: 7px solid currentcolor;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
.iw-carousel-arrow-next .iw-carousel-chevron {
|
|
184
|
+
margin-left: 2px;
|
|
185
|
+
border-left: 7px solid currentcolor;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
&.iw-carousel-vertical .iw-carousel-chevron {
|
|
189
|
+
border-right: none;
|
|
190
|
+
border-left: none;
|
|
191
|
+
border-inline: var(--iw-carousel-arrow-chevron) solid transparent;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&.iw-carousel-vertical .iw-carousel-arrow-previous .iw-carousel-chevron {
|
|
195
|
+
margin: 0 0 2px;
|
|
196
|
+
border-top: none;
|
|
197
|
+
border-bottom: 7px solid currentcolor;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&.iw-carousel-vertical .iw-carousel-arrow-next .iw-carousel-chevron {
|
|
201
|
+
margin: 2px 0 0;
|
|
202
|
+
border-top: 7px solid currentcolor;
|
|
203
|
+
border-bottom: none;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.iw-carousel-indicators {
|
|
207
|
+
display: flex;
|
|
208
|
+
justify-content: center;
|
|
209
|
+
gap: var(--iw-space-2);
|
|
210
|
+
padding: var(--iw-space-2);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.iw-carousel-indicator {
|
|
214
|
+
width: var(--iw-carousel-indicator-size);
|
|
215
|
+
height: var(--iw-carousel-indicator-size);
|
|
216
|
+
padding: 0;
|
|
217
|
+
border: none;
|
|
218
|
+
border-radius: var(--iw-radius-full);
|
|
219
|
+
background: var(--iw-carousel-indicator-color);
|
|
220
|
+
cursor: pointer;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.iw-carousel-indicator-current {
|
|
224
|
+
background: var(--iw-carousel-indicator-color-current);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Respect reduced motion: only animate paging when the user allows it. */
|
|
229
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
230
|
+
.iw-carousel .iw-carousel-viewport {
|
|
231
|
+
scroll-behavior: smooth;
|
|
232
|
+
}
|
|
233
|
+
}
|