noph-ui 0.32.8 → 0.33.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 +3 -3
- package/dist/button/IconButton.svelte +2 -2
- package/dist/chip/AssistChip.svelte +8 -8
- package/dist/chip/FilterChip.svelte +53 -7
- package/dist/chip/InputChip.svelte +11 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/navigation-drawer/NavigationDrawer.svelte +3 -3
- package/dist/snackbar/Snackbar.svelte +2 -2
- package/dist/switch/Switch.svelte +3 -3
- package/dist/tabs/Tab.svelte +30 -19
- package/dist/tabs/Tabs.svelte +8 -10
- package/dist/tabs/types.d.ts +1 -1
- package/dist/text-field/TextField.svelte +3 -5
- package/dist/themes/defaultTheme.css +21 -0
- package/dist/tooltip/Tooltip.svelte +3 -3
- package/dist/types.d.ts +0 -1
- package/dist/types.js +0 -1
- package/package.json +2 -2
- package/dist/slider/Slider.svelte +0 -26
- package/dist/slider/Slider.svelte.d.ts +0 -4
- package/dist/slider/index.d.ts +0 -1
- package/dist/slider/index.js +0 -1
- package/dist/slider/types.d.ts +0 -11
- package/dist/slider/types.js +0 -1
|
@@ -168,9 +168,9 @@
|
|
|
168
168
|
text-decoration: none;
|
|
169
169
|
--np-icon-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
170
170
|
transition:
|
|
171
|
-
background-color
|
|
172
|
-
border-radius
|
|
173
|
-
box-shadow
|
|
171
|
+
background-color var(--np-motion-expressive-default-effects),
|
|
172
|
+
border-radius var(--np-motion-expressive-default-effects),
|
|
173
|
+
box-shadow var(--np-motion-expressive-default-effects);
|
|
174
174
|
}
|
|
175
175
|
.xs {
|
|
176
176
|
font-size: 0.875rem;
|
|
@@ -143,8 +143,8 @@
|
|
|
143
143
|
justify-content: center;
|
|
144
144
|
--np-icon-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
|
|
145
145
|
transition:
|
|
146
|
-
background-color
|
|
147
|
-
border-radius
|
|
146
|
+
background-color var(--np-motion-expressive-default-effects),
|
|
147
|
+
border-radius var(--np-motion-expressive-default-effects);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
:global(.np-icon-button svg) {
|
|
@@ -15,22 +15,22 @@
|
|
|
15
15
|
<Button
|
|
16
16
|
size="xs"
|
|
17
17
|
shape="square"
|
|
18
|
-
--np-elevated-button-label-text-color="var(--np-assist-chip-label-text-color, var(--np-color-on-surface
|
|
19
|
-
--np-outlined-button-label-text-color="var(--np-assist-chip-label-text-color, var(--np-color-on-surface
|
|
18
|
+
--np-elevated-button-label-text-color="var(--np-assist-chip-label-text-color, var(--np-color-on-surface))"
|
|
19
|
+
--np-outlined-button-label-text-color="var(--np-assist-chip-label-text-color, var(--np-color-on-surface))"
|
|
20
20
|
--np-outlined-button-outline-color="var(--np-assist-chip-outline-color, var(--np-color-outline-variant))"
|
|
21
21
|
--np-button-icon-size="1.125rem"
|
|
22
|
-
--np-button-padding=
|
|
22
|
+
--np-button-padding={icon ? '0.5rem 1rem' : '1rem'}
|
|
23
23
|
--np-button-gap="0.5rem"
|
|
24
24
|
--np-button-shape="0.5rem"
|
|
25
|
-
--np-button-icon-color=
|
|
26
|
-
|
|
25
|
+
--np-button-icon-color={disabled
|
|
26
|
+
? 'color-mix(in srgb, var(--np-color-on-surface) 38%, transparent)'
|
|
27
|
+
: 'var(--np-color-primary)'}
|
|
28
|
+
style="letter-spacing: 0.006rem"
|
|
27
29
|
bind:element
|
|
28
30
|
variant={elevated ? 'elevated' : 'outlined'}
|
|
29
31
|
{disabled}
|
|
30
32
|
{...attributes}
|
|
33
|
+
start={icon}
|
|
31
34
|
>
|
|
32
|
-
{#snippet start()}
|
|
33
|
-
{@render icon?.()}
|
|
34
|
-
{/snippet}
|
|
35
35
|
{label}
|
|
36
36
|
</Button>
|
|
@@ -23,6 +23,16 @@
|
|
|
23
23
|
}: FilterChipProps = $props()
|
|
24
24
|
|
|
25
25
|
let chipLabel: HTMLLabelElement | undefined = $state()
|
|
26
|
+
let pressed = $state(false)
|
|
27
|
+
|
|
28
|
+
const handlePointerDown = () => {
|
|
29
|
+
if (disabled) return
|
|
30
|
+
pressed = true
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const handlePointerUp = () => {
|
|
34
|
+
pressed = false
|
|
35
|
+
}
|
|
26
36
|
|
|
27
37
|
$effect(() => {
|
|
28
38
|
if (!group || !value) return
|
|
@@ -46,10 +56,17 @@
|
|
|
46
56
|
icon ? 'np-filter-chip-icon' : '',
|
|
47
57
|
removable ? 'np-filter-chip-removable' : '',
|
|
48
58
|
disabled ? 'np-filter-chip-disabled' : '',
|
|
59
|
+
pressed && 'np-filter-chip-pressed',
|
|
49
60
|
attributes.class,
|
|
50
61
|
]}
|
|
51
62
|
>
|
|
52
|
-
<label
|
|
63
|
+
<label
|
|
64
|
+
bind:this={chipLabel}
|
|
65
|
+
class="np-filter-chip-label"
|
|
66
|
+
onpointerdown={handlePointerDown}
|
|
67
|
+
onpointerup={handlePointerUp}
|
|
68
|
+
onpointerleave={handlePointerUp}
|
|
69
|
+
>
|
|
53
70
|
{#if icon}
|
|
54
71
|
<div class="np-chip-icon">
|
|
55
72
|
{@render icon()}
|
|
@@ -94,7 +111,9 @@
|
|
|
94
111
|
border-radius: var(--np-filter-chip-container-shape, var(--np-shape-corner-small));
|
|
95
112
|
--np-icon-button-icon-color: var(--np-color-on-surface-variant);
|
|
96
113
|
--np-icon-size: 1.125rem;
|
|
114
|
+
--np-ripple-pressed-opacity: 0.1;
|
|
97
115
|
min-width: 0;
|
|
116
|
+
transition: box-shadow var(--np-motion-expressive-slow-effects);
|
|
98
117
|
}
|
|
99
118
|
.np-filter-chip-label input {
|
|
100
119
|
opacity: 0;
|
|
@@ -113,12 +132,24 @@
|
|
|
113
132
|
z-index: 1;
|
|
114
133
|
padding-inline: 1rem;
|
|
115
134
|
overflow: hidden;
|
|
135
|
+
transition: padding var(--np-motion-expressive-default-effects);
|
|
116
136
|
}
|
|
117
137
|
.np-chip-icon-checked {
|
|
118
|
-
display:
|
|
138
|
+
display: flex;
|
|
139
|
+
width: 0;
|
|
140
|
+
min-width: 0;
|
|
141
|
+
margin-inline-end: -0.5rem;
|
|
142
|
+
overflow: hidden;
|
|
143
|
+
transition:
|
|
144
|
+
width var(--np-motion-expressive-default-effects),
|
|
145
|
+
margin var(--np-motion-expressive-default-effects);
|
|
119
146
|
}
|
|
120
147
|
.np-filter-chip:has(input:checked) .np-chip-icon-checked {
|
|
121
|
-
|
|
148
|
+
width: 18px;
|
|
149
|
+
margin-inline-end: 0;
|
|
150
|
+
}
|
|
151
|
+
.np-filter-chip-icon .np-chip-icon-checked {
|
|
152
|
+
transition: none;
|
|
122
153
|
}
|
|
123
154
|
.np-filter-chip:has(input:checked) .np-chip-icon {
|
|
124
155
|
display: none;
|
|
@@ -145,6 +176,7 @@
|
|
|
145
176
|
line-height: 1.25rem;
|
|
146
177
|
font-size: 0.875rem;
|
|
147
178
|
font-weight: 500;
|
|
179
|
+
letter-spacing: 0.006rem;
|
|
148
180
|
white-space: pre;
|
|
149
181
|
overflow: hidden;
|
|
150
182
|
text-overflow: ellipsis;
|
|
@@ -155,6 +187,9 @@
|
|
|
155
187
|
inset: 0;
|
|
156
188
|
border-radius: inherit;
|
|
157
189
|
pointer-events: none;
|
|
190
|
+
transition:
|
|
191
|
+
background-color 150ms linear,
|
|
192
|
+
outline-color 150ms linear;
|
|
158
193
|
}
|
|
159
194
|
.np-filter-chip-default::before {
|
|
160
195
|
outline-style: solid;
|
|
@@ -163,7 +198,7 @@
|
|
|
163
198
|
outline-offset: -1px;
|
|
164
199
|
}
|
|
165
200
|
.np-filter-chip:has(input:checked)::before {
|
|
166
|
-
outline-
|
|
201
|
+
outline-color: transparent;
|
|
167
202
|
background-color: var(--np-color-secondary-container);
|
|
168
203
|
}
|
|
169
204
|
.np-filter-chip-elevated {
|
|
@@ -172,6 +207,20 @@
|
|
|
172
207
|
.np-filter-chip-elevated::before {
|
|
173
208
|
background-color: var(--np-color-surface-container-low);
|
|
174
209
|
}
|
|
210
|
+
@media (hover: hover) {
|
|
211
|
+
.np-filter-chip-elevated:not(.np-filter-chip-disabled):hover {
|
|
212
|
+
box-shadow: var(--np-elevation-2);
|
|
213
|
+
}
|
|
214
|
+
.np-filter-chip-default:not(.np-filter-chip-disabled):has(input:checked):hover {
|
|
215
|
+
box-shadow: var(--np-elevation-1);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
.np-filter-chip-elevated:not(.np-filter-chip-disabled).np-filter-chip-pressed {
|
|
219
|
+
box-shadow: var(--np-elevation-1);
|
|
220
|
+
}
|
|
221
|
+
.np-filter-chip-default:not(.np-filter-chip-disabled):has(input:checked).np-filter-chip-pressed {
|
|
222
|
+
box-shadow: none;
|
|
223
|
+
}
|
|
175
224
|
.np-filter-chip:has(input:checked) {
|
|
176
225
|
--np-icon-button-icon-color: var(--np-color-on-secondary-container);
|
|
177
226
|
}
|
|
@@ -208,9 +257,6 @@
|
|
|
208
257
|
.np-filter-chip-disabled.np-filter-chip-elevated {
|
|
209
258
|
box-shadow: none;
|
|
210
259
|
}
|
|
211
|
-
.np-filter-chip-disabled:has(input:checked)::before {
|
|
212
|
-
opacity: 0.12;
|
|
213
|
-
}
|
|
214
260
|
.np-filter-chip-disabled:has(input:not(:checked)).np-filter-chip-default::after {
|
|
215
261
|
content: '';
|
|
216
262
|
position: absolute;
|
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
border-radius: var(--np-input-chip-container-shape, var(--np-shape-corner-small));
|
|
68
68
|
--np-icon-button-icon-color: var(--np-color-on-surface-variant);
|
|
69
69
|
--np-icon-size: 1.125rem;
|
|
70
|
+
--np-ripple-pressed-opacity: 0.1;
|
|
70
71
|
padding-inline-end: 1px;
|
|
71
72
|
min-width: 0;
|
|
72
73
|
}
|
|
@@ -85,13 +86,16 @@
|
|
|
85
86
|
fill: currentColor;
|
|
86
87
|
gap: 0.5rem;
|
|
87
88
|
z-index: 1;
|
|
88
|
-
padding-inline-start:
|
|
89
|
+
padding-inline-start: 0.75rem;
|
|
89
90
|
overflow: hidden;
|
|
90
91
|
}
|
|
91
92
|
.np-chip-icon {
|
|
92
|
-
color: var(--np-color-
|
|
93
|
+
color: var(--np-color-on-surface-variant);
|
|
93
94
|
display: flex;
|
|
94
95
|
}
|
|
96
|
+
.np-input-chip-selected .np-chip-icon {
|
|
97
|
+
color: var(--np-color-primary);
|
|
98
|
+
}
|
|
95
99
|
.np-input-chip-icon .np-input-chip-label {
|
|
96
100
|
padding-inline-start: 0.5rem;
|
|
97
101
|
}
|
|
@@ -99,6 +103,7 @@
|
|
|
99
103
|
line-height: 1.25rem;
|
|
100
104
|
font-size: 0.875rem;
|
|
101
105
|
font-weight: 500;
|
|
106
|
+
letter-spacing: 0.006rem;
|
|
102
107
|
padding-inline-end: 1px;
|
|
103
108
|
white-space: pre;
|
|
104
109
|
overflow: hidden;
|
|
@@ -114,9 +119,12 @@
|
|
|
114
119
|
outline-color: var(--np-input-chip-outline-color, var(--np-color-outline-variant));
|
|
115
120
|
outline-width: 1px;
|
|
116
121
|
outline-offset: -1px;
|
|
122
|
+
transition:
|
|
123
|
+
background-color 150ms linear,
|
|
124
|
+
outline-color 150ms linear;
|
|
117
125
|
}
|
|
118
126
|
.np-input-chip-selected::before {
|
|
119
|
-
outline-
|
|
127
|
+
outline-color: transparent;
|
|
120
128
|
background-color: var(--np-color-secondary-container);
|
|
121
129
|
}
|
|
122
130
|
.np-input-chip-selected {
|
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export * from './progress/index.js';
|
|
|
13
13
|
export * from './radio/index.js';
|
|
14
14
|
export * from './ripple/index.js';
|
|
15
15
|
export * from './select/index.js';
|
|
16
|
-
export * from './slider/index.js';
|
|
17
16
|
export * from './snackbar/index.js';
|
|
18
17
|
export * from './switch/index.js';
|
|
19
18
|
export * from './tabs/index.js';
|
package/dist/index.js
CHANGED
|
@@ -13,7 +13,6 @@ export * from './progress/index.js';
|
|
|
13
13
|
export * from './radio/index.js';
|
|
14
14
|
export * from './ripple/index.js';
|
|
15
15
|
export * from './select/index.js';
|
|
16
|
-
export * from './slider/index.js';
|
|
17
16
|
export * from './snackbar/index.js';
|
|
18
17
|
export * from './switch/index.js';
|
|
19
18
|
export * from './tabs/index.js';
|
|
@@ -64,13 +64,13 @@
|
|
|
64
64
|
|
|
65
65
|
.np-navigation-drawer-container[popover] .np-navigation-wrapper {
|
|
66
66
|
transform: var(--np-navigation-drawer-start, translateX(-100%));
|
|
67
|
-
transition: transform
|
|
67
|
+
transition: transform var(--np-motion-expressive-slow-effects);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
.np-navigation-drawer-container[popover] {
|
|
71
71
|
transition:
|
|
72
|
-
overlay 0.
|
|
73
|
-
display 0.
|
|
72
|
+
overlay 0.3s allow-discrete,
|
|
73
|
+
display 0.3s allow-discrete;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
.np-navigation-drawer-container:popover-open .np-navigation-wrapper {
|
|
@@ -123,13 +123,13 @@
|
|
|
123
123
|
transition:
|
|
124
124
|
overlay 0.2s allow-discrete,
|
|
125
125
|
display 0.2s allow-discrete,
|
|
126
|
-
opacity
|
|
126
|
+
opacity var(--np-motion-expressive-default-effects);
|
|
127
127
|
opacity: 0;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
.np-snackbar:popover-open {
|
|
131
131
|
opacity: 1;
|
|
132
|
-
animation: slideIn
|
|
132
|
+
animation: slideIn var(--np-motion-expressive-default-spatial);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
@keyframes slideIn {
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
height: 1rem;
|
|
99
99
|
margin: 0.5rem;
|
|
100
100
|
transition:
|
|
101
|
-
transform
|
|
102
|
-
background-color
|
|
101
|
+
transform var(--np-motion-expressive-fast-spatial),
|
|
102
|
+
background-color var(--np-motion-expressive-default-effects);
|
|
103
103
|
background-color: var(--np-comp-switch-unselected-handle-color, var(--np-color-outline));
|
|
104
104
|
border-radius: var(--np-comp-switch-handle-shape, var(--np-shape-corner-full));
|
|
105
105
|
}
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
height: var(--np-comp-switch-state-layer-size, 2.5rem);
|
|
115
115
|
margin-block-start: -0.25rem;
|
|
116
116
|
margin-inline-start: -0.25rem;
|
|
117
|
-
transition:
|
|
117
|
+
transition: var(--np-motion-expressive-fast-spatial);
|
|
118
118
|
border-radius: var(--np-comp-switch-state-layer-shape, var(--np-shape-corner-full));
|
|
119
119
|
}
|
|
120
120
|
|
package/dist/tabs/Tab.svelte
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import Ripple from '../ripple/Ripple.svelte'
|
|
3
|
-
import { onMount } from 'svelte'
|
|
4
|
-
import type { TabProps } from './types.ts'
|
|
5
2
|
import Badge from '../badge/Badge.svelte'
|
|
3
|
+
import Ripple from '../ripple/Ripple.svelte'
|
|
4
|
+
import { onMount, tick } from 'svelte'
|
|
6
5
|
import { getTabsContext } from './context.js'
|
|
6
|
+
import type { TabProps } from './types.ts'
|
|
7
7
|
|
|
8
8
|
let {
|
|
9
9
|
children,
|
|
@@ -22,20 +22,17 @@
|
|
|
22
22
|
const tabsContext = getTabsContext()
|
|
23
23
|
let fallbackIndicator = $state(false)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
tabsContext.value
|
|
27
|
-
|
|
28
|
-
onclick(event)
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
const handleKeyDown = (event: KeyboardEvent & { currentTarget: EventTarget & HTMLElement }) => {
|
|
32
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
33
|
-
tabsContext.value = value
|
|
34
|
-
}
|
|
35
|
-
if (onkeydown) {
|
|
36
|
-
onkeydown(event)
|
|
25
|
+
$effect(() => {
|
|
26
|
+
if (tabsContext.value === value) {
|
|
27
|
+
tabsContext.indicatorValue = value
|
|
37
28
|
}
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const setIndicatorValue = async () => {
|
|
32
|
+
await tick()
|
|
33
|
+
tabsContext.indicatorValue = value
|
|
38
34
|
}
|
|
35
|
+
|
|
39
36
|
onMount(() => {
|
|
40
37
|
if (!('anchorName' in document.documentElement.style)) {
|
|
41
38
|
fallbackIndicator = true
|
|
@@ -69,11 +66,15 @@
|
|
|
69
66
|
{@render children?.()}
|
|
70
67
|
{/if}
|
|
71
68
|
{#if tabsContext.variant === 'primary'}
|
|
72
|
-
<div
|
|
69
|
+
<div
|
|
70
|
+
class={['np-indicator', tabsContext.indicatorValue === value && 'np-indicator-anchor']}
|
|
71
|
+
></div>
|
|
73
72
|
{/if}
|
|
74
73
|
</div>
|
|
75
74
|
{#if tabsContext.variant === 'secondary'}
|
|
76
|
-
<div
|
|
75
|
+
<div
|
|
76
|
+
class={['np-indicator', tabsContext.indicatorValue === value && 'np-indicator-anchor']}
|
|
77
|
+
></div>
|
|
77
78
|
{/if}
|
|
78
79
|
</div>
|
|
79
80
|
<div class="focus-area"></div>
|
|
@@ -112,8 +113,18 @@
|
|
|
112
113
|
tabsContext.variant === 'primary' ? 'primary' : 'secondary',
|
|
113
114
|
attributes.class,
|
|
114
115
|
]}
|
|
115
|
-
onclick={
|
|
116
|
-
|
|
116
|
+
onclick={(event) => {
|
|
117
|
+
tabsContext.value = value
|
|
118
|
+
setIndicatorValue()
|
|
119
|
+
onclick?.(event)
|
|
120
|
+
}}
|
|
121
|
+
onkeydown={(event) => {
|
|
122
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
123
|
+
tabsContext.value = value
|
|
124
|
+
setIndicatorValue()
|
|
125
|
+
}
|
|
126
|
+
onkeydown?.(event)
|
|
127
|
+
}}
|
|
117
128
|
>
|
|
118
129
|
{@render content()}
|
|
119
130
|
</button>
|
package/dist/tabs/Tabs.svelte
CHANGED
|
@@ -11,13 +11,11 @@
|
|
|
11
11
|
...attributes
|
|
12
12
|
}: TabsProps = $props()
|
|
13
13
|
|
|
14
|
-
let uid = $props.id()
|
|
15
|
-
|
|
16
14
|
// svelte-ignore state_referenced_locally
|
|
17
15
|
let tabsContext = $state<TabsContext>({
|
|
18
16
|
value,
|
|
17
|
+
indicatorValue: value,
|
|
19
18
|
variant,
|
|
20
|
-
id: uid,
|
|
21
19
|
})
|
|
22
20
|
$effect(() => {
|
|
23
21
|
value = tabsContext.value
|
|
@@ -29,6 +27,10 @@
|
|
|
29
27
|
})
|
|
30
28
|
setTabsContext(tabsContext)
|
|
31
29
|
|
|
30
|
+
const secondaryStyle = $derived(
|
|
31
|
+
tabsContext.variant === 'secondary' ? '--np-indicator-radius: 0;--_indicator-gap: 0' : '',
|
|
32
|
+
)
|
|
33
|
+
|
|
32
34
|
const handleKeydown = (
|
|
33
35
|
event: KeyboardEvent & {
|
|
34
36
|
currentTarget: EventTarget & HTMLDivElement
|
|
@@ -47,11 +49,7 @@
|
|
|
47
49
|
}
|
|
48
50
|
</script>
|
|
49
51
|
|
|
50
|
-
<nav
|
|
51
|
-
{...attributes}
|
|
52
|
-
bind:this={element}
|
|
53
|
-
style={tabsContext.variant === 'secondary' ? '--np-indicator-radius: 0;--_indicator-gap: 0' : ''}
|
|
54
|
-
>
|
|
52
|
+
<nav {...attributes} bind:this={element} style={secondaryStyle}>
|
|
55
53
|
<div
|
|
56
54
|
class={['np-tabs']}
|
|
57
55
|
role="tablist"
|
|
@@ -65,7 +63,7 @@
|
|
|
65
63
|
</nav>
|
|
66
64
|
|
|
67
65
|
<style>
|
|
68
|
-
:global(.np-tabs .np-
|
|
66
|
+
:global(.np-tabs .np-indicator-anchor) {
|
|
69
67
|
anchor-name: --np-tab-indicator;
|
|
70
68
|
}
|
|
71
69
|
.np-tabs {
|
|
@@ -92,7 +90,7 @@
|
|
|
92
90
|
border-start-start-radius: var(--np-indicator-radius, var(--np-shape-corner-full));
|
|
93
91
|
border-start-end-radius: var(--np-indicator-radius, var(--np-shape-corner-full));
|
|
94
92
|
position-anchor: --np-tab-indicator;
|
|
95
|
-
transition:
|
|
93
|
+
transition: var(--np-motion-expressive-fast-spatial);
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
96
|
</style>
|
package/dist/tabs/types.d.ts
CHANGED
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
}
|
|
172
172
|
.active-indicator::after {
|
|
173
173
|
opacity: 0;
|
|
174
|
-
transition: opacity
|
|
174
|
+
transition: opacity var(--np-motion-expressive-fast-effects);
|
|
175
175
|
}
|
|
176
176
|
.active-indicator::before,
|
|
177
177
|
.active-indicator::after {
|
|
@@ -572,9 +572,7 @@
|
|
|
572
572
|
inset-inline-start: var(--floating-label-inline-start, 0);
|
|
573
573
|
}
|
|
574
574
|
.label {
|
|
575
|
-
transition
|
|
576
|
-
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
577
|
-
transition-duration: 150ms;
|
|
575
|
+
transition: all var(--np-motion-expressive-fast-effects);
|
|
578
576
|
box-sizing: border-box;
|
|
579
577
|
color: var(--np-color-on-surface-variant);
|
|
580
578
|
overflow: hidden;
|
|
@@ -737,7 +735,7 @@
|
|
|
737
735
|
.outline-end::after,
|
|
738
736
|
.outline-notch::after {
|
|
739
737
|
opacity: 0;
|
|
740
|
-
transition: opacity
|
|
738
|
+
transition: opacity var(--np-motion-expressive-fast-effects);
|
|
741
739
|
}
|
|
742
740
|
.field:has(input:focus-visible) .outline-start::after,
|
|
743
741
|
.field:has(input:focus-visible) .outline-end::after,
|
|
@@ -63,6 +63,27 @@
|
|
|
63
63
|
--np-elevation-3:
|
|
64
64
|
rgba(0, 0, 0, 0.2) 0px 5px 5px -3px, rgba(0, 0, 0, 0.14) 0px 8px 10px 1px,
|
|
65
65
|
rgba(0, 0, 0, 0.12) 0px 3px 14px 2px;
|
|
66
|
+
|
|
67
|
+
/* Motion: Expressive spatial */
|
|
68
|
+
--np-motion-expressive-fast-spatial: 350ms cubic-bezier(0.42, 1.67, 0.21, 0.9);
|
|
69
|
+
--np-motion-expressive-default-spatial: 500ms cubic-bezier(0.38, 1.21, 0.22, 1);
|
|
70
|
+
--np-motion-expressive-slow-spatial: 650ms cubic-bezier(0.39, 1.29, 0.35, 0.98);
|
|
71
|
+
|
|
72
|
+
/* Motion: Expressive effects */
|
|
73
|
+
--np-motion-expressive-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1);
|
|
74
|
+
--np-motion-expressive-default-effects: 200ms cubic-bezier(0.34, 0.8, 0.34, 1);
|
|
75
|
+
--np-motion-expressive-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1);
|
|
76
|
+
|
|
77
|
+
/* Motion: Standard spatial */
|
|
78
|
+
--np-motion-standard-fast-spatial: 350ms cubic-bezier(0.27, 1.06, 0.18, 1);
|
|
79
|
+
--np-motion-standard-default-spatial: 500ms cubic-bezier(0.27, 1.06, 0.18, 1);
|
|
80
|
+
--np-motion-standard-slow-spatial: 750ms cubic-bezier(0.27, 1.06, 0.18, 1);
|
|
81
|
+
|
|
82
|
+
/* Motion: Standard effects */
|
|
83
|
+
--np-motion-standard-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1);
|
|
84
|
+
--np-motion-standard-default-effects: 200ms cubic-bezier(0.34, 0.8, 0.34, 1);
|
|
85
|
+
--np-motion-standard-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1);
|
|
86
|
+
|
|
66
87
|
--np-shape-corner-full: 9999px;
|
|
67
88
|
--np-shape-corner-extra-small: 0.25rem;
|
|
68
89
|
--np-shape-corner-small: 0.5rem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { TooltipProps } from './types.ts'
|
|
3
|
-
import { MediaQuery } from 'svelte/reactivity'
|
|
4
2
|
import { on } from 'svelte/events'
|
|
3
|
+
import { MediaQuery } from 'svelte/reactivity'
|
|
4
|
+
import type { TooltipProps } from './types.ts'
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
7
|
children,
|
|
@@ -127,7 +127,7 @@
|
|
|
127
127
|
}
|
|
128
128
|
.np-tooltip:popover-open {
|
|
129
129
|
opacity: 1;
|
|
130
|
-
animation: scaleIn
|
|
130
|
+
animation: scaleIn var(--np-motion-expressive-fast-spatial);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
@keyframes scaleIn {
|
package/dist/types.d.ts
CHANGED
|
@@ -13,7 +13,6 @@ export * from './progress/types.ts';
|
|
|
13
13
|
export * from './radio/types.ts';
|
|
14
14
|
export * from './ripple/types.ts';
|
|
15
15
|
export * from './select/types.ts';
|
|
16
|
-
export * from './slider/types.ts';
|
|
17
16
|
export * from './snackbar/types.ts';
|
|
18
17
|
export * from './switch/types.ts';
|
|
19
18
|
export * from './text-field/types.ts';
|
package/dist/types.js
CHANGED
|
@@ -13,7 +13,6 @@ export * from './progress/types.ts';
|
|
|
13
13
|
export * from './radio/types.ts';
|
|
14
14
|
export * from './ripple/types.ts';
|
|
15
15
|
export * from './select/types.ts';
|
|
16
|
-
export * from './slider/types.ts';
|
|
17
16
|
export * from './snackbar/types.ts';
|
|
18
17
|
export * from './switch/types.ts';
|
|
19
18
|
export * from './text-field/types.ts';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "noph-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"homepage": "https://noph.dev",
|
|
6
6
|
"repository": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"prettier": "^3.8.1",
|
|
84
84
|
"prettier-plugin-svelte": "^3.5.1",
|
|
85
85
|
"publint": "^0.3.18",
|
|
86
|
-
"svelte": "^5.55.
|
|
86
|
+
"svelte": "^5.55.1",
|
|
87
87
|
"svelte-check": "^4.4.5",
|
|
88
88
|
"typescript": "^6.0.2",
|
|
89
89
|
"typescript-eslint": "^8.57.2",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<script lang="ts">
|
|
2
|
-
import type { SliderProps } from './types.ts'
|
|
3
|
-
|
|
4
|
-
let {
|
|
5
|
-
type = 'standard',
|
|
6
|
-
orientation = 'horizontal',
|
|
7
|
-
size = 'sm',
|
|
8
|
-
stops = false,
|
|
9
|
-
value = $bindable(0),
|
|
10
|
-
min = 0,
|
|
11
|
-
max = 100,
|
|
12
|
-
step = 1,
|
|
13
|
-
element = $bindable(),
|
|
14
|
-
inputElement = $bindable(),
|
|
15
|
-
...attributes
|
|
16
|
-
}: SliderProps = $props()
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<input class={[orientation]} bind:this={inputElement} type="range" />
|
|
20
|
-
|
|
21
|
-
<style>
|
|
22
|
-
.vertical {
|
|
23
|
-
writing-mode: vertical-lr;
|
|
24
|
-
direction: rtl;
|
|
25
|
-
}
|
|
26
|
-
</style>
|
package/dist/slider/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Slider } from './Slider.svelte';
|
package/dist/slider/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Slider } from './Slider.svelte';
|
package/dist/slider/types.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Snippet } from 'svelte';
|
|
2
|
-
import type { HTMLInputAttributes } from 'svelte/elements';
|
|
3
|
-
export interface SliderProps extends Omit<HTMLInputAttributes, 'type' | 'role' | 'checked' | 'indeterminate' | 'size'> {
|
|
4
|
-
type?: 'standard' | 'centered' | 'range';
|
|
5
|
-
orientation?: 'horizontal' | 'vertical';
|
|
6
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
-
stops?: boolean;
|
|
8
|
-
insetIcon?: Snippet;
|
|
9
|
-
inputElement?: HTMLInputElement;
|
|
10
|
-
element?: HTMLDivElement;
|
|
11
|
-
}
|
package/dist/slider/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|