noph-ui 0.40.2 → 0.41.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/dist/button/Button.svelte +2 -12
- package/dist/button/Button.svelte.d.ts +1 -0
- package/dist/button/IconButton.svelte +2 -12
- package/dist/button/IconButton.svelte.d.ts +1 -0
- package/dist/button/SegmentedButton.svelte +9 -22
- package/dist/button/SegmentedButton.svelte.d.ts +1 -0
- package/dist/card/Card.svelte +2 -12
- package/dist/card/Card.svelte.d.ts +1 -0
- package/dist/checkbox/Checkbox.svelte +2 -12
- package/dist/checkbox/Checkbox.svelte.d.ts +1 -0
- package/dist/chip/FilterChip.svelte +2 -12
- package/dist/chip/FilterChip.svelte.d.ts +1 -0
- package/dist/chip/InputChip.svelte +2 -12
- package/dist/chip/InputChip.svelte.d.ts +1 -0
- package/dist/dialog/Dialog.svelte +3 -3
- package/dist/internal/focus-ring.css +26 -0
- package/dist/list/Item.svelte +2 -15
- package/dist/list/Item.svelte.d.ts +1 -0
- package/dist/menu/Menu.svelte +32 -4
- package/dist/navigation-drawer/NavigationDrawer.svelte +4 -4
- package/dist/navigation-drawer/NavigationDrawerItem.svelte +2 -15
- package/dist/navigation-drawer/NavigationDrawerItem.svelte.d.ts +1 -0
- package/dist/navigation-rail/NavigationRailItem.svelte +2 -12
- package/dist/navigation-rail/NavigationRailItem.svelte.d.ts +1 -0
- package/dist/progress/CircularProgress.svelte +26 -0
- package/dist/progress/LinearProgress.svelte +36 -0
- package/dist/radio/Radio.svelte +2 -12
- package/dist/radio/Radio.svelte.d.ts +1 -0
- package/dist/ripple/Ripple.svelte +2 -2
- package/dist/select/NativeSelect.svelte +6 -1
- package/dist/select/Option.svelte +2 -16
- package/dist/select/Option.svelte.d.ts +1 -0
- package/dist/select/Select.svelte +1 -7
- package/dist/switch/Switch.svelte +2 -12
- package/dist/switch/Switch.svelte.d.ts +1 -0
- package/dist/tabs/Tab.svelte +4 -16
- package/dist/tabs/Tab.svelte.d.ts +1 -0
- package/dist/tabs/Tabs.svelte +1 -1
- package/dist/text-field/TextField.svelte +12 -24
- package/dist/text-field/types.d.ts +4 -0
- package/dist/tooltip/Tooltip.svelte +10 -5
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import CircularProgress from '../progress/CircularProgress.svelte'
|
|
3
4
|
import Ripple from '../ripple/Ripple.svelte'
|
|
4
5
|
import Tooltip from '../tooltip/Tooltip.svelte'
|
|
@@ -285,18 +286,7 @@
|
|
|
285
286
|
outline-color: var(--np-color-secondary);
|
|
286
287
|
outline-width: 3px;
|
|
287
288
|
outline-offset: 2px;
|
|
288
|
-
animation: focusAnimation
|
|
289
|
-
}
|
|
290
|
-
@keyframes focusAnimation {
|
|
291
|
-
0% {
|
|
292
|
-
outline-width: 3px;
|
|
293
|
-
}
|
|
294
|
-
50% {
|
|
295
|
-
outline-width: 6px;
|
|
296
|
-
}
|
|
297
|
-
100% {
|
|
298
|
-
outline-width: 3px;
|
|
299
|
-
}
|
|
289
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
300
290
|
}
|
|
301
291
|
.text {
|
|
302
292
|
--np-ripple-hover-color: var(--np-text-button-label-text-color, var(--np-color-primary));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import CircularProgress from '../progress/CircularProgress.svelte'
|
|
3
4
|
import Ripple from '../ripple/Ripple.svelte'
|
|
4
5
|
import Tooltip from '../tooltip/Tooltip.svelte'
|
|
@@ -290,18 +291,7 @@
|
|
|
290
291
|
outline-color: var(--np-color-secondary);
|
|
291
292
|
outline-width: 3px;
|
|
292
293
|
outline-offset: 2px;
|
|
293
|
-
animation: focusAnimation
|
|
294
|
-
}
|
|
295
|
-
@keyframes focusAnimation {
|
|
296
|
-
0% {
|
|
297
|
-
outline-width: 3px;
|
|
298
|
-
}
|
|
299
|
-
50% {
|
|
300
|
-
outline-width: 6px;
|
|
301
|
-
}
|
|
302
|
-
100% {
|
|
303
|
-
outline-width: 3px;
|
|
304
|
-
}
|
|
294
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
305
295
|
}
|
|
306
296
|
.text {
|
|
307
297
|
--np-ripple-hover-color: var(--np-icon-button-icon-color, var(--np-color-on-surface-variant));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import CheckIcon from '../icons/CheckIcon.svelte'
|
|
3
4
|
import Ripple from '../ripple/Ripple.svelte'
|
|
4
5
|
import type { SegmentedButtonProps } from './types.js'
|
|
@@ -109,7 +110,7 @@
|
|
|
109
110
|
align-items: center;
|
|
110
111
|
border-inline-end: 1px solid var(--np-color-outline);
|
|
111
112
|
position: relative;
|
|
112
|
-
transition: all
|
|
113
|
+
transition: all var(--np-motion-expressive-fast-effects);
|
|
113
114
|
}
|
|
114
115
|
.np-segmented-button-icon-label {
|
|
115
116
|
display: inline-flex;
|
|
@@ -142,7 +143,7 @@
|
|
|
142
143
|
inset: 0;
|
|
143
144
|
z-index: -1;
|
|
144
145
|
opacity: 0;
|
|
145
|
-
transition: opacity
|
|
146
|
+
transition: opacity var(--np-motion-expressive-fast-effects);
|
|
146
147
|
background-color: var(--np-color-secondary-container);
|
|
147
148
|
}
|
|
148
149
|
.width-icon,
|
|
@@ -160,7 +161,7 @@
|
|
|
160
161
|
width: 0;
|
|
161
162
|
overflow: hidden;
|
|
162
163
|
fill: currentColor;
|
|
163
|
-
transition: width
|
|
164
|
+
transition: width var(--np-motion-expressive-slow-effects);
|
|
164
165
|
}
|
|
165
166
|
:global(.check-icon svg) {
|
|
166
167
|
display: block;
|
|
@@ -168,14 +169,14 @@
|
|
|
168
169
|
.check-icon-wrapper {
|
|
169
170
|
width: 0;
|
|
170
171
|
overflow: hidden;
|
|
171
|
-
transition: width
|
|
172
|
+
transition: width var(--np-motion-expressive-fast-effects);
|
|
172
173
|
}
|
|
173
174
|
.alternate-icon {
|
|
174
175
|
display: flex;
|
|
175
176
|
width: 1.5rem;
|
|
176
177
|
overflow: hidden;
|
|
177
178
|
fill: currentColor;
|
|
178
|
-
transition: width
|
|
179
|
+
transition: width var(--np-motion-expressive-slow-effects);
|
|
179
180
|
}
|
|
180
181
|
:global(.alternate-icon svg) {
|
|
181
182
|
display: block;
|
|
@@ -186,8 +187,8 @@
|
|
|
186
187
|
width: 2rem;
|
|
187
188
|
overflow: hidden;
|
|
188
189
|
transition:
|
|
189
|
-
width
|
|
190
|
-
opacity
|
|
190
|
+
width var(--np-motion-expressive-fast-effects),
|
|
191
|
+
opacity var(--np-motion-expressive-fast-effects);
|
|
191
192
|
}
|
|
192
193
|
.np-segmented-button:has(input:checked) :global(.alternate-icon-wrapper) {
|
|
193
194
|
width: 0;
|
|
@@ -212,20 +213,6 @@
|
|
|
212
213
|
outline-color: var(--np-color-secondary);
|
|
213
214
|
outline-width: 3px;
|
|
214
215
|
outline-offset: -3px;
|
|
215
|
-
animation:
|
|
216
|
-
}
|
|
217
|
-
@keyframes focusAnimation {
|
|
218
|
-
0% {
|
|
219
|
-
outline-offset: -3px;
|
|
220
|
-
outline-width: 3px;
|
|
221
|
-
}
|
|
222
|
-
50% {
|
|
223
|
-
outline-offset: -6px;
|
|
224
|
-
outline-width: 6px;
|
|
225
|
-
}
|
|
226
|
-
100% {
|
|
227
|
-
outline-offset: -3px;
|
|
228
|
-
outline-width: 3px;
|
|
229
|
-
}
|
|
216
|
+
animation: focusAnimationInset var(--np-motion-expressive-slow-effects) forwards;
|
|
230
217
|
}
|
|
231
218
|
</style>
|
package/dist/card/Card.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
4
|
import type { CardProps } from './types.js'
|
|
4
5
|
|
|
@@ -158,18 +159,7 @@
|
|
|
158
159
|
outline-color: var(--np-color-secondary);
|
|
159
160
|
outline-width: 3px;
|
|
160
161
|
outline-offset: 2px;
|
|
161
|
-
animation: focusAnimation
|
|
162
|
-
}
|
|
163
|
-
@keyframes focusAnimation {
|
|
164
|
-
0% {
|
|
165
|
-
outline-width: 3px;
|
|
166
|
-
}
|
|
167
|
-
50% {
|
|
168
|
-
outline-width: 6px;
|
|
169
|
-
}
|
|
170
|
-
100% {
|
|
171
|
-
outline-width: 3px;
|
|
172
|
-
}
|
|
162
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
173
163
|
}
|
|
174
164
|
.np-card-disabled {
|
|
175
165
|
opacity: 0.38;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
4
|
import type { CheckboxProps } from './types.js'
|
|
4
5
|
|
|
@@ -128,18 +129,7 @@
|
|
|
128
129
|
outline-color: var(--np-color-secondary);
|
|
129
130
|
outline-width: 3px;
|
|
130
131
|
outline-offset: 2px;
|
|
131
|
-
animation: focusAnimation
|
|
132
|
-
}
|
|
133
|
-
@keyframes focusAnimation {
|
|
134
|
-
0% {
|
|
135
|
-
outline-width: 3px;
|
|
136
|
-
}
|
|
137
|
-
50% {
|
|
138
|
-
outline-width: 6px;
|
|
139
|
-
}
|
|
140
|
-
100% {
|
|
141
|
-
outline-width: 3px;
|
|
142
|
-
}
|
|
132
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
143
133
|
}
|
|
144
134
|
.np-outline,
|
|
145
135
|
.np-background,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import IconButton from '../button/IconButton.svelte'
|
|
3
4
|
import CheckIcon from '../icons/CheckIcon.svelte'
|
|
4
5
|
import CloseIcon from '../icons/CloseIcon.svelte'
|
|
@@ -237,18 +238,7 @@
|
|
|
237
238
|
outline-color: var(--np-color-secondary);
|
|
238
239
|
outline-width: 3px;
|
|
239
240
|
outline-offset: 2px;
|
|
240
|
-
animation: focusAnimation
|
|
241
|
-
}
|
|
242
|
-
@keyframes focusAnimation {
|
|
243
|
-
0% {
|
|
244
|
-
outline-width: 3px;
|
|
245
|
-
}
|
|
246
|
-
50% {
|
|
247
|
-
outline-width: 6px;
|
|
248
|
-
}
|
|
249
|
-
100% {
|
|
250
|
-
outline-width: 3px;
|
|
251
|
-
}
|
|
241
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
252
242
|
}
|
|
253
243
|
|
|
254
244
|
.np-filter-chip-disabled .np-filter-chip-label {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import IconButton from '../button/IconButton.svelte'
|
|
3
4
|
import CloseIcon from '../icons/CloseIcon.svelte'
|
|
4
5
|
import Ripple from '../ripple/Ripple.svelte'
|
|
@@ -149,18 +150,7 @@
|
|
|
149
150
|
outline-color: var(--np-color-secondary);
|
|
150
151
|
outline-width: 3px;
|
|
151
152
|
outline-offset: 2px;
|
|
152
|
-
animation: focusAnimation
|
|
153
|
-
}
|
|
154
|
-
@keyframes focusAnimation {
|
|
155
|
-
0% {
|
|
156
|
-
outline-width: 3px;
|
|
157
|
-
}
|
|
158
|
-
50% {
|
|
159
|
-
outline-width: 6px;
|
|
160
|
-
}
|
|
161
|
-
100% {
|
|
162
|
-
outline-width: 3px;
|
|
163
|
-
}
|
|
153
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
164
154
|
}
|
|
165
155
|
|
|
166
156
|
.np-input-chip-disabled .np-input-chip-label {
|
|
@@ -156,9 +156,9 @@
|
|
|
156
156
|
|
|
157
157
|
.np-animate[popover] {
|
|
158
158
|
transition:
|
|
159
|
-
opacity
|
|
160
|
-
display
|
|
161
|
-
overlay
|
|
159
|
+
opacity var(--np-motion-expressive-slow-effects),
|
|
160
|
+
display var(--np-motion-expressive-slow-effects) allow-discrete,
|
|
161
|
+
overlay var(--np-motion-expressive-slow-effects) allow-discrete;
|
|
162
162
|
opacity: 0;
|
|
163
163
|
}
|
|
164
164
|
.np-animate[popover]:popover-open {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@keyframes focusAnimation {
|
|
2
|
+
0% {
|
|
3
|
+
outline-width: 3px;
|
|
4
|
+
}
|
|
5
|
+
50% {
|
|
6
|
+
outline-width: 6px;
|
|
7
|
+
}
|
|
8
|
+
100% {
|
|
9
|
+
outline-width: 3px;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
@keyframes focusAnimationInset {
|
|
14
|
+
0% {
|
|
15
|
+
outline-offset: -3px;
|
|
16
|
+
outline-width: 3px;
|
|
17
|
+
}
|
|
18
|
+
50% {
|
|
19
|
+
outline-offset: -6px;
|
|
20
|
+
outline-width: 6px;
|
|
21
|
+
}
|
|
22
|
+
100% {
|
|
23
|
+
outline-offset: -3px;
|
|
24
|
+
outline-width: 3px;
|
|
25
|
+
}
|
|
26
|
+
}
|
package/dist/list/Item.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
4
|
import type { ItemProps } from './types.js'
|
|
4
5
|
|
|
@@ -150,21 +151,7 @@
|
|
|
150
151
|
outline-width: 3px;
|
|
151
152
|
outline-offset: -3px;
|
|
152
153
|
border-radius: var(--np-shape-corner-extra-small);
|
|
153
|
-
animation:
|
|
154
|
-
}
|
|
155
|
-
@keyframes focusAnimation {
|
|
156
|
-
0% {
|
|
157
|
-
outline-offset: -3px;
|
|
158
|
-
outline-width: 3px;
|
|
159
|
-
}
|
|
160
|
-
50% {
|
|
161
|
-
outline-offset: -6px;
|
|
162
|
-
outline-width: 6px;
|
|
163
|
-
}
|
|
164
|
-
100% {
|
|
165
|
-
outline-offset: -3px;
|
|
166
|
-
outline-width: 3px;
|
|
167
|
-
}
|
|
154
|
+
animation: focusAnimationInset var(--np-motion-expressive-slow-effects) forwards;
|
|
168
155
|
}
|
|
169
156
|
|
|
170
157
|
div.np-item {
|
package/dist/menu/Menu.svelte
CHANGED
|
@@ -29,6 +29,24 @@
|
|
|
29
29
|
element?.hidePopover()
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
// CSS anchor positioning has no way to read which position-try fallback won, so the
|
|
33
|
+
// scale pivot can't be expressed declaratively (see open spec request for @position-try
|
|
34
|
+
// to set transform-origin: https://github.com/w3c/csswg-drafts/issues/11666). Until that
|
|
35
|
+
// lands, mirror Compose's calculateTransformOrigin (Menu.kt) in JS instead.
|
|
36
|
+
const calculateTransformOrigin = (anchorRect: DOMRect, menuRect: DOMRect) => {
|
|
37
|
+
const pivot = (anchorStart: number, anchorEnd: number, menuStart: number, menuEnd: number) => {
|
|
38
|
+
if (menuStart >= anchorEnd) return 0
|
|
39
|
+
if (menuEnd <= anchorStart) return 1
|
|
40
|
+
if (menuEnd === menuStart) return 0
|
|
41
|
+
const intersectionCenter =
|
|
42
|
+
(Math.max(anchorStart, menuStart) + Math.min(anchorEnd, menuEnd)) / 2
|
|
43
|
+
return (intersectionCenter - menuStart) / (menuEnd - menuStart)
|
|
44
|
+
}
|
|
45
|
+
const x = pivot(anchorRect.left, anchorRect.right, menuRect.left, menuRect.right)
|
|
46
|
+
const y = pivot(anchorRect.top, anchorRect.bottom, menuRect.top, menuRect.bottom)
|
|
47
|
+
return `${x * 100}% ${y * 100}%`
|
|
48
|
+
}
|
|
49
|
+
|
|
32
50
|
const refreshValues = () => {
|
|
33
51
|
if (element && anchor && open) {
|
|
34
52
|
const anchorRect = anchor.getBoundingClientRect()
|
|
@@ -40,6 +58,10 @@
|
|
|
40
58
|
const above = Math.max(anchorRect.top - margin, 0)
|
|
41
59
|
const overAnchor = coverAnchor && wanted > below && wanted > above && wanted <= room
|
|
42
60
|
element.style.maxHeight = `${Math.floor(overAnchor ? room : Math.max(below, above))}px`
|
|
61
|
+
element.style.transformOrigin = calculateTransformOrigin(
|
|
62
|
+
anchorRect,
|
|
63
|
+
element.getBoundingClientRect(),
|
|
64
|
+
)
|
|
43
65
|
}
|
|
44
66
|
}
|
|
45
67
|
$effect(refreshValues)
|
|
@@ -90,6 +112,7 @@
|
|
|
90
112
|
scrollbar-width: thin;
|
|
91
113
|
justify-self: var(--np-menu-justify-self, anchor-center);
|
|
92
114
|
position-area: var(--np-menu-position-area, bottom);
|
|
115
|
+
transform-origin: var(--np-menu-transform-origin, top center);
|
|
93
116
|
position-try-fallbacks:
|
|
94
117
|
flip-block,
|
|
95
118
|
flip-inline,
|
|
@@ -112,14 +135,19 @@
|
|
|
112
135
|
|
|
113
136
|
.np-menu-container:popover-open {
|
|
114
137
|
opacity: 1;
|
|
115
|
-
|
|
138
|
+
scale: 1;
|
|
139
|
+
animation:
|
|
140
|
+
fadeIn var(--np-motion-expressive-fast-effects),
|
|
141
|
+
scaleIn var(--np-motion-expressive-fast-spatial);
|
|
116
142
|
}
|
|
117
143
|
@keyframes fadeIn {
|
|
118
|
-
|
|
144
|
+
from {
|
|
119
145
|
opacity: 0;
|
|
120
146
|
}
|
|
121
|
-
|
|
122
|
-
|
|
147
|
+
}
|
|
148
|
+
@keyframes scaleIn {
|
|
149
|
+
from {
|
|
150
|
+
scale: 0.8;
|
|
123
151
|
}
|
|
124
152
|
}
|
|
125
153
|
</style>
|
|
@@ -110,13 +110,13 @@
|
|
|
110
110
|
|
|
111
111
|
.np-navigation-drawer-container[popover] .np-navigation-wrapper {
|
|
112
112
|
transform: var(--np-navigation-drawer-start, translateX(-100%));
|
|
113
|
-
transition: transform var(--np-motion-
|
|
113
|
+
transition: transform var(--np-motion-standard-slow-spatial);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
.np-navigation-drawer-container[popover] {
|
|
117
117
|
transition:
|
|
118
|
-
overlay
|
|
119
|
-
display
|
|
118
|
+
overlay var(--np-motion-standard-slow-spatial) allow-discrete,
|
|
119
|
+
display var(--np-motion-standard-slow-spatial) allow-discrete;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
.np-navigation-drawer-container:popover-open .np-navigation-wrapper {
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
position: fixed;
|
|
140
140
|
background-color: var(--np-color-scrim);
|
|
141
141
|
opacity: 0;
|
|
142
|
-
transition: opacity
|
|
142
|
+
transition: opacity var(--np-motion-expressive-slow-effects);
|
|
143
143
|
}
|
|
144
144
|
.np-navigation-drawer-backdrop[popover]:popover-open .np-backdrop {
|
|
145
145
|
opacity: 0.32;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
4
|
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
4
5
|
import type { NavigationDrawerItemProps } from './types.js'
|
|
@@ -103,21 +104,7 @@
|
|
|
103
104
|
}
|
|
104
105
|
@media (prefers-reduced-motion: no-preference) {
|
|
105
106
|
.np-navigation-drawer-item:focus-visible {
|
|
106
|
-
animation:
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
@keyframes focusAnimation {
|
|
110
|
-
0% {
|
|
111
|
-
outline-offset: -3px;
|
|
112
|
-
outline-width: 3px;
|
|
113
|
-
}
|
|
114
|
-
50% {
|
|
115
|
-
outline-offset: -6px;
|
|
116
|
-
outline-width: 6px;
|
|
117
|
-
}
|
|
118
|
-
100% {
|
|
119
|
-
outline-offset: -3px;
|
|
120
|
-
outline-width: 3px;
|
|
107
|
+
animation: focusAnimationInset var(--np-motion-expressive-slow-effects) forwards;
|
|
121
108
|
}
|
|
122
109
|
}
|
|
123
110
|
.np-navigation-drawer-item-icon {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
4
|
import type { HTMLButtonAttributes } from 'svelte/elements'
|
|
4
5
|
import type { NavigationRailItemProps } from './types.js'
|
|
@@ -60,18 +61,7 @@
|
|
|
60
61
|
}
|
|
61
62
|
@media (prefers-reduced-motion: no-preference) {
|
|
62
63
|
.np-navigation-action:focus-visible {
|
|
63
|
-
animation: focusAnimation
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
@keyframes focusAnimation {
|
|
67
|
-
0% {
|
|
68
|
-
outline-width: 3px;
|
|
69
|
-
}
|
|
70
|
-
50% {
|
|
71
|
-
outline-width: 6px;
|
|
72
|
-
}
|
|
73
|
-
100% {
|
|
74
|
-
outline-width: 3px;
|
|
64
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
75
65
|
}
|
|
76
66
|
}
|
|
77
67
|
.np-navigation-action-icon {
|
|
@@ -298,6 +298,11 @@
|
|
|
298
298
|
animation-duration: 6000ms, calc(4 * 1333ms);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
+
.four-color .spinner-track {
|
|
302
|
+
animation-name: cp-track-sweep, four-color-track;
|
|
303
|
+
animation-duration: 6000ms, calc(4 * 1333ms);
|
|
304
|
+
}
|
|
305
|
+
|
|
301
306
|
@media (forced-colors: active) {
|
|
302
307
|
.active-track {
|
|
303
308
|
stroke: CanvasText;
|
|
@@ -328,4 +333,25 @@
|
|
|
328
333
|
stroke: var(--np-color-primary);
|
|
329
334
|
}
|
|
330
335
|
}
|
|
336
|
+
@keyframes four-color-track {
|
|
337
|
+
0%,
|
|
338
|
+
15% {
|
|
339
|
+
stroke: var(--np-color-primary-container);
|
|
340
|
+
}
|
|
341
|
+
25%,
|
|
342
|
+
40% {
|
|
343
|
+
stroke: var(--np-color-primary);
|
|
344
|
+
}
|
|
345
|
+
50%,
|
|
346
|
+
65% {
|
|
347
|
+
stroke: var(--np-color-tertiary-container);
|
|
348
|
+
}
|
|
349
|
+
75%,
|
|
350
|
+
90% {
|
|
351
|
+
stroke: var(--np-color-tertiary);
|
|
352
|
+
}
|
|
353
|
+
100% {
|
|
354
|
+
stroke: var(--np-color-primary-container);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
331
357
|
</style>
|
|
@@ -378,6 +378,10 @@
|
|
|
378
378
|
border-radius: var(--np-linear-progress-track-shape, var(--np-shape-corner-full));
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
+
.indeterminate.four-color .np-lp-track {
|
|
382
|
+
animation: four-color-track calc(1750ms * 4) linear infinite;
|
|
383
|
+
}
|
|
384
|
+
|
|
381
385
|
.np-lp-track.ahead {
|
|
382
386
|
left: min(calc(var(--np-lp-h1) + var(--np-linear-progress-track-gap, 0.25rem)), 100%);
|
|
383
387
|
right: 0;
|
|
@@ -572,6 +576,38 @@
|
|
|
572
576
|
}
|
|
573
577
|
}
|
|
574
578
|
|
|
579
|
+
@keyframes four-color-track {
|
|
580
|
+
0% {
|
|
581
|
+
background: var(--np-color-primary-container);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
15% {
|
|
585
|
+
background: var(--np-color-primary-container);
|
|
586
|
+
}
|
|
587
|
+
25% {
|
|
588
|
+
background: var(--np-color-primary);
|
|
589
|
+
}
|
|
590
|
+
40% {
|
|
591
|
+
background: var(--np-color-primary);
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
50% {
|
|
595
|
+
background: var(--np-color-tertiary-container);
|
|
596
|
+
}
|
|
597
|
+
65% {
|
|
598
|
+
background: var(--np-color-tertiary-container);
|
|
599
|
+
}
|
|
600
|
+
75% {
|
|
601
|
+
background: var(--np-color-tertiary);
|
|
602
|
+
}
|
|
603
|
+
90% {
|
|
604
|
+
background: var(--np-color-tertiary);
|
|
605
|
+
}
|
|
606
|
+
100% {
|
|
607
|
+
background: var(--np-color-primary-container);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
575
611
|
@media (forced-colors: active) {
|
|
576
612
|
.np-container {
|
|
577
613
|
outline: 1px solid CanvasText;
|
package/dist/radio/Radio.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
4
|
import type { RadioProps } from './types.js'
|
|
4
5
|
|
|
@@ -127,17 +128,6 @@
|
|
|
127
128
|
outline-color: var(--np-color-secondary);
|
|
128
129
|
outline-width: 3px;
|
|
129
130
|
outline-offset: 2px;
|
|
130
|
-
animation: focusAnimation
|
|
131
|
-
}
|
|
132
|
-
@keyframes focusAnimation {
|
|
133
|
-
0% {
|
|
134
|
-
outline-width: 3px;
|
|
135
|
-
}
|
|
136
|
-
50% {
|
|
137
|
-
outline-width: 6px;
|
|
138
|
-
}
|
|
139
|
-
100% {
|
|
140
|
-
outline-width: 3px;
|
|
141
|
-
}
|
|
131
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
142
132
|
}
|
|
143
133
|
</style>
|
|
@@ -339,7 +339,7 @@
|
|
|
339
339
|
transparent 100%
|
|
340
340
|
);
|
|
341
341
|
transform-origin: center center;
|
|
342
|
-
transition: opacity
|
|
342
|
+
transition: opacity var(--np-motion-expressive-slow-effects);
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
|
|
@@ -351,6 +351,6 @@
|
|
|
351
351
|
|
|
352
352
|
.np-ripple-pressed::after {
|
|
353
353
|
opacity: var(--np-ripple-pressed-opacity, 0.1);
|
|
354
|
-
transition
|
|
354
|
+
transition: opacity var(--np-motion-expressive-fast-effects);
|
|
355
355
|
}
|
|
356
356
|
</style>
|
|
@@ -131,16 +131,21 @@
|
|
|
131
131
|
box-shadow: var(--np-elevation-2);
|
|
132
132
|
border: none;
|
|
133
133
|
opacity: 0;
|
|
134
|
+
scale: 0.8;
|
|
135
|
+
transform-origin: top center;
|
|
134
136
|
transition:
|
|
135
|
-
opacity var(--
|
|
137
|
+
opacity var(--np-motion-expressive-fast-effects),
|
|
138
|
+
scale var(--np-motion-expressive-fast-spatial),
|
|
136
139
|
display 150ms allow-discrete,
|
|
137
140
|
overlay 150ms allow-discrete;
|
|
138
141
|
}
|
|
139
142
|
|
|
140
143
|
select:open::picker(select) {
|
|
141
144
|
opacity: 1;
|
|
145
|
+
scale: 1;
|
|
142
146
|
@starting-style {
|
|
143
147
|
opacity: 0;
|
|
148
|
+
scale: 0.8;
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
4
|
import type { Snippet } from 'svelte'
|
|
4
5
|
import type { HTMLOptionAttributes } from 'svelte/elements'
|
|
@@ -58,22 +59,7 @@
|
|
|
58
59
|
outline-width: 3px;
|
|
59
60
|
outline-offset: -3px;
|
|
60
61
|
border-radius: var(--np-shape-corner-extra-small);
|
|
61
|
-
animation:
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@keyframes focusAnimation {
|
|
66
|
-
0% {
|
|
67
|
-
outline-offset: -3px;
|
|
68
|
-
outline-width: 3px;
|
|
69
|
-
}
|
|
70
|
-
50% {
|
|
71
|
-
outline-offset: -6px;
|
|
72
|
-
outline-width: 6px;
|
|
73
|
-
}
|
|
74
|
-
100% {
|
|
75
|
-
outline-offset: -3px;
|
|
76
|
-
outline-width: 3px;
|
|
62
|
+
animation: focusAnimationInset var(--np-motion-expressive-slow-effects) forwards;
|
|
77
63
|
}
|
|
78
64
|
}
|
|
79
65
|
</style>
|
|
@@ -806,15 +806,9 @@
|
|
|
806
806
|
opacity: 1;
|
|
807
807
|
}
|
|
808
808
|
|
|
809
|
-
.field:not(:has(select:is(:user-invalid, [aria-invalid='true']))).menu-open .arrow,
|
|
810
|
-
.field:not(:has(select:is(:user-invalid, [aria-invalid='true']))):focus .arrow {
|
|
811
|
-
color: var(--np-color-primary);
|
|
812
|
-
}
|
|
813
809
|
.icon .arrow {
|
|
814
810
|
display: flex;
|
|
815
|
-
transition:
|
|
816
|
-
color 75ms linear 75ms,
|
|
817
|
-
rotate 150ms cubic-bezier(0.2, 0, 0, 1);
|
|
811
|
+
transition: rotate 150ms cubic-bezier(0.2, 0, 0, 1);
|
|
818
812
|
}
|
|
819
813
|
.field.menu-open .icon .arrow {
|
|
820
814
|
rotate: 180deg;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Ripple from '../ripple/Ripple.svelte'
|
|
3
4
|
import type { SwitchProps } from './types.js'
|
|
4
5
|
|
|
@@ -193,17 +194,6 @@
|
|
|
193
194
|
outline-color: var(--np-color-secondary);
|
|
194
195
|
outline-width: 3px;
|
|
195
196
|
outline-offset: -2px;
|
|
196
|
-
animation: focusAnimation
|
|
197
|
-
}
|
|
198
|
-
@keyframes focusAnimation {
|
|
199
|
-
0% {
|
|
200
|
-
outline-width: 3px;
|
|
201
|
-
}
|
|
202
|
-
50% {
|
|
203
|
-
outline-width: 6px;
|
|
204
|
-
}
|
|
205
|
-
100% {
|
|
206
|
-
outline-width: 3px;
|
|
207
|
-
}
|
|
197
|
+
animation: focusAnimation var(--np-motion-expressive-slow-effects) forwards;
|
|
208
198
|
}
|
|
209
199
|
</style>
|
package/dist/tabs/Tab.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
+
import '../internal/focus-ring.css'
|
|
2
3
|
import Badge from '../badge/Badge.svelte'
|
|
3
4
|
import Ripple from '../ripple/Ripple.svelte'
|
|
4
5
|
import { tick } from 'svelte'
|
|
@@ -147,10 +148,11 @@
|
|
|
147
148
|
padding: 0 1rem;
|
|
148
149
|
color: var(--np-color-on-surface-variant);
|
|
149
150
|
height: 3rem;
|
|
150
|
-
transition: color
|
|
151
|
+
transition: color var(--np-motion-expressive-fast-effects);
|
|
151
152
|
}
|
|
152
153
|
.np-tab-content-active {
|
|
153
154
|
--_focus-bottom: 4px;
|
|
155
|
+
transition: color var(--np-motion-expressive-default-effects);
|
|
154
156
|
}
|
|
155
157
|
.np-tab-content-active.primary {
|
|
156
158
|
color: var(--np-color-primary);
|
|
@@ -226,20 +228,6 @@
|
|
|
226
228
|
outline-color: var(--np-color-secondary);
|
|
227
229
|
outline-width: 3px;
|
|
228
230
|
outline-offset: -3px;
|
|
229
|
-
animation:
|
|
230
|
-
}
|
|
231
|
-
@keyframes focusAnimation {
|
|
232
|
-
0% {
|
|
233
|
-
outline-offset: -3px;
|
|
234
|
-
outline-width: 3px;
|
|
235
|
-
}
|
|
236
|
-
50% {
|
|
237
|
-
outline-offset: -6px;
|
|
238
|
-
outline-width: 6px;
|
|
239
|
-
}
|
|
240
|
-
100% {
|
|
241
|
-
outline-offset: -3px;
|
|
242
|
-
outline-width: 3px;
|
|
243
|
-
}
|
|
231
|
+
animation: focusAnimationInset var(--np-motion-expressive-slow-effects) forwards;
|
|
244
232
|
}
|
|
245
233
|
</style>
|
package/dist/tabs/Tabs.svelte
CHANGED
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
border-start-start-radius: var(--np-indicator-radius, var(--np-shape-corner-full));
|
|
81
81
|
border-start-end-radius: var(--np-indicator-radius, var(--np-shape-corner-full));
|
|
82
82
|
position-anchor: --np-tab-indicator;
|
|
83
|
-
transition: var(--np-motion-expressive-
|
|
83
|
+
transition: var(--np-motion-expressive-default-spatial);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
</style>
|
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
populated = false,
|
|
19
19
|
inputElement = $bindable(),
|
|
20
20
|
placeholder = ' ',
|
|
21
|
+
minLines = 1,
|
|
22
|
+
maxLines = 4,
|
|
21
23
|
children,
|
|
22
24
|
focused = $bindable(false),
|
|
23
25
|
clientWidth = $bindable(),
|
|
@@ -31,11 +33,13 @@
|
|
|
31
33
|
|
|
32
34
|
<label
|
|
33
35
|
style={(variant === 'outlined'
|
|
34
|
-
? '--_label-text-color:var(--np-outlined-text-field-label-text-color);--top-space:1rem;--bottom-space:1rem;--floating-label-top:-0.5rem;--floating-label-inline-start:-2.25rem
|
|
36
|
+
? '--_label-text-color:var(--np-outlined-text-field-label-text-color);--top-space:1rem;--bottom-space:1rem;--floating-label-top:-0.5rem;--floating-label-inline-start:-2.25rem;'
|
|
35
37
|
: !label?.length
|
|
36
38
|
? '--_label-text-color:var(--np-filled-text-field-label-text-color);--np-input-chip-outline-color:var(--np-color-outline);--top-space:1rem;--bottom-space:1rem; '
|
|
37
39
|
: '--_label-text-color:var(--np-filled-text-field-label-text-color);--np-input-chip-outline-color:var(--np-color-outline); ' +
|
|
38
|
-
(children ? '--top-space:2rem;--bottom-space:1rem;' : '')) +
|
|
40
|
+
(children ? '--top-space:2rem;--bottom-space:1rem;' : '')) +
|
|
41
|
+
`--_min-height:calc(${minLines} * 1lh);--_max-height:${`calc(${maxLines} * 1lh)`};` +
|
|
42
|
+
style}
|
|
39
43
|
class={['text-field', attributes.class]}
|
|
40
44
|
bind:this={element}
|
|
41
45
|
bind:clientWidth
|
|
@@ -43,7 +47,6 @@
|
|
|
43
47
|
>
|
|
44
48
|
<div
|
|
45
49
|
class="field"
|
|
46
|
-
class:resizable={attributes.type === 'textarea'}
|
|
47
50
|
class:no-label={!label?.length}
|
|
48
51
|
class:with-start={start}
|
|
49
52
|
class:with-end={end}
|
|
@@ -109,8 +112,7 @@
|
|
|
109
112
|
bind:focused
|
|
110
113
|
bind:value
|
|
111
114
|
bind:this={inputElement}
|
|
112
|
-
class="input"
|
|
113
|
-
rows={attributes.rows || 2}></textarea>
|
|
115
|
+
class="input"></textarea>
|
|
114
116
|
{:else}
|
|
115
117
|
<div class="input-wrapper">
|
|
116
118
|
{#if suffixText}
|
|
@@ -272,7 +274,6 @@
|
|
|
272
274
|
}
|
|
273
275
|
.text-field {
|
|
274
276
|
display: inline-flex;
|
|
275
|
-
resize: both;
|
|
276
277
|
text-align: start;
|
|
277
278
|
}
|
|
278
279
|
:global(label) {
|
|
@@ -324,11 +325,6 @@
|
|
|
324
325
|
background: var(--np-color-on-surface);
|
|
325
326
|
opacity: 0.08;
|
|
326
327
|
}
|
|
327
|
-
.resizable .np-container > * {
|
|
328
|
-
top: var(--_focus-outline-width, 3px);
|
|
329
|
-
inset-inline-start: var(--_focus-outline-width, 0);
|
|
330
|
-
}
|
|
331
|
-
|
|
332
328
|
.content * {
|
|
333
329
|
all: unset;
|
|
334
330
|
color: currentColor;
|
|
@@ -418,6 +414,11 @@
|
|
|
418
414
|
.content textarea {
|
|
419
415
|
margin-top: var(--top-space, 1.5rem);
|
|
420
416
|
margin-bottom: var(--bottom-space, 0.5rem);
|
|
417
|
+
field-sizing: content;
|
|
418
|
+
min-inline-size: 20ch;
|
|
419
|
+
max-inline-size: 100%;
|
|
420
|
+
min-height: var(--_min-height, 1lh);
|
|
421
|
+
max-height: var(--_max-height, 4lh);
|
|
421
422
|
}
|
|
422
423
|
|
|
423
424
|
.content .input-wrapper .input,
|
|
@@ -627,10 +628,6 @@
|
|
|
627
628
|
.disabled .label:not(.np-hidden) {
|
|
628
629
|
opacity: 0.38;
|
|
629
630
|
}
|
|
630
|
-
.resizable:not(.disabled) .np-container {
|
|
631
|
-
resize: inherit;
|
|
632
|
-
overflow: hidden;
|
|
633
|
-
}
|
|
634
631
|
.disabled.no-label .content,
|
|
635
632
|
.disabled:has(input:-webkit-autofill) .content,
|
|
636
633
|
.disabled:has(input:not(:placeholder-shown)) .content,
|
|
@@ -638,15 +635,6 @@
|
|
|
638
635
|
.disabled.populated .content {
|
|
639
636
|
opacity: 0.38;
|
|
640
637
|
}
|
|
641
|
-
.field,
|
|
642
|
-
.container-overflow {
|
|
643
|
-
resize: inherit;
|
|
644
|
-
}
|
|
645
|
-
.resizable .np-container {
|
|
646
|
-
bottom: 3px;
|
|
647
|
-
inset-inline-end: var(--_focus-outline-width, 0);
|
|
648
|
-
clip-path: inset(3px 0 0 var(--_focus-outline-width));
|
|
649
|
-
}
|
|
650
638
|
.outline-start,
|
|
651
639
|
.outline-end {
|
|
652
640
|
border: inherit;
|
|
@@ -26,10 +26,14 @@ export interface InputFieldProps extends HTMLInputAttributes, FieldProps {
|
|
|
26
26
|
}
|
|
27
27
|
export interface TextAreaFieldProps extends HTMLTextareaAttributes, FieldProps {
|
|
28
28
|
type: 'textarea';
|
|
29
|
+
minLines?: number;
|
|
30
|
+
maxLines?: number;
|
|
29
31
|
}
|
|
30
32
|
export interface TextFieldProps extends HTMLAttributes<TextFieldElement>, Omit<HTMLInputAttributes, keyof HTMLAttributes<HTMLInputElement> | 'type' | 'value' | 'defaultValue' | 'defaultvalue'>, Omit<HTMLTextareaAttributes, keyof HTMLAttributes<HTMLTextAreaElement> | 'value' | 'defaultValue' | 'defaultvalue'>, FieldProps {
|
|
31
33
|
type?: TextFieldType | 'textarea';
|
|
32
34
|
value?: string | number | null;
|
|
33
35
|
defaultValue?: string | number | null;
|
|
36
|
+
minLines?: number;
|
|
37
|
+
maxLines?: number;
|
|
34
38
|
}
|
|
35
39
|
export {};
|
|
@@ -141,15 +141,20 @@
|
|
|
141
141
|
}
|
|
142
142
|
.np-tooltip:popover-open {
|
|
143
143
|
opacity: 1;
|
|
144
|
-
|
|
144
|
+
scale: 1;
|
|
145
|
+
animation:
|
|
146
|
+
fadeIn var(--np-motion-expressive-fast-effects),
|
|
147
|
+
scaleIn var(--np-motion-expressive-fast-spatial);
|
|
145
148
|
}
|
|
146
149
|
|
|
147
|
-
@keyframes
|
|
150
|
+
@keyframes fadeIn {
|
|
148
151
|
from {
|
|
149
|
-
|
|
152
|
+
opacity: 0;
|
|
150
153
|
}
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
}
|
|
155
|
+
@keyframes scaleIn {
|
|
156
|
+
from {
|
|
157
|
+
scale: 0.8;
|
|
153
158
|
}
|
|
154
159
|
}
|
|
155
160
|
</style>
|