@dvcol/neo-svelte 0.1.4 → 0.1.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.
- package/CHANGELOG.md +28 -0
- package/README.md +71 -11
- package/dist/buttons/NeoButton.svelte +1 -0
- package/dist/cards/NeoCard.svelte +9 -9
- package/dist/inputs/NeoPin.svelte +7 -7
- package/dist/inputs/NeoRange.svelte +328 -171
- package/dist/inputs/NeoRange.svelte.d.ts +3 -2
- package/dist/inputs/NeoTextarea.svelte +8 -7
- package/dist/inputs/common/NeoBaseInput.svelte +36 -12
- package/dist/inputs/common/NeoInput.svelte +18 -10
- package/dist/inputs/common/NeoInput.svelte.d.ts +2 -2
- package/dist/inputs/common/neo-input.model.d.ts +17 -10
- package/dist/inputs/index.d.ts +19 -0
- package/dist/inputs/index.js +19 -0
- package/dist/inputs/neo-checkbox.model.d.ts +8 -1
- package/dist/inputs/neo-radio.model.d.ts +8 -1
- package/dist/inputs/neo-range.model.d.ts +149 -0
- package/dist/inputs/neo-range.model.js +1 -0
- package/dist/inputs/neo-switch.model.d.ts +8 -1
- package/dist/providers/NeoThemeProvider.svelte +64 -13
- package/dist/styles/common/media.scss +10 -0
- package/dist/styles/common/spacing.scss +0 -6
- package/dist/styles/common/typography.scss +50 -0
- package/dist/styles/common/utils.scss +31 -0
- package/dist/styles/theme.scss +18 -5
- package/dist/utils/math.utils.d.ts +1 -0
- package/dist/utils/math.utils.js +7 -0
- package/package.json +1 -1
- package/dist/styles/common/filters.scss +0 -17
- package/dist/styles/common/z-index.scss +0 -12
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.6](https://github.com/dvcol/neo-svelte/compare/v0.1.5...v0.1.6) (2025-01-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **style:** adds typography for headings ([d02ff78](https://github.com/dvcol/neo-svelte/commit/d02ff78e251fbb7dd7343bde29858d80336f6925))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* **input:** adjust text-area sizing & fix typing ([c54d607](https://github.com/dvcol/neo-svelte/commit/c54d607dc707a819c7d29b814993719b2520fbce))
|
|
16
|
+
|
|
17
|
+
### [0.1.5](https://github.com/dvcol/neo-svelte/compare/v0.1.4...v0.1.5) (2025-01-10)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **input:** adds basic select support ([f0a7973](https://github.com/dvcol/neo-svelte/commit/f0a797395a67017a437e9f32229d0ccc578b47a4))
|
|
23
|
+
* **input:** adds range prefix & suffix ([1c6ab9c](https://github.com/dvcol/neo-svelte/commit/1c6ab9c731a9964dc921e6f11f77a0c45a7bfaf7))
|
|
24
|
+
* **input:** adds range slider drag support ([f9c6275](https://github.com/dvcol/neo-svelte/commit/f9c6275ff0bf3cb717de94cbe75190237ca143be))
|
|
25
|
+
* **input:** adds styling to labels ([7823b84](https://github.com/dvcol/neo-svelte/commit/7823b845e58762e51dae6eba36cc42f73b3349f2))
|
|
26
|
+
* **input:** range switch to variable value ([41e491d](https://github.com/dvcol/neo-svelte/commit/41e491dd10ef6992c3e1b679edf4846c037f9e4c))
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* **input:** adjust range spacing ([d68bd8f](https://github.com/dvcol/neo-svelte/commit/d68bd8f2d7ebfd3c27b1d8f87aa15748eebd98be))
|
|
32
|
+
|
|
5
33
|
### [0.1.4](https://github.com/dvcol/neo-svelte/compare/v0.1.3...v0.1.4) (2024-12-31)
|
|
6
34
|
|
|
7
35
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
<h1 align="center">Welcome to <i>Neo Svelte</i></h1>
|
|
2
|
+
<h3 align="center">A neo-morphic ui library for svelte 5</h3>
|
|
3
|
+
|
|
4
|
+
<p>
|
|
5
|
+
<img src="https://img.shields.io/badge/pnpm-%3E%3D8.0.0-blue.svg" />
|
|
6
|
+
<img src="https://img.shields.io/badge/node-%3E%3D20.0.0-blue.svg" />
|
|
7
|
+
<a href="https://github.com/dvcol/neo-svelte#readme" target="_blank">
|
|
8
|
+
<img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
|
|
9
|
+
</a>
|
|
10
|
+
<a href="https://github.com/dvcol/neo-svelte/graphs/commit-activity" target="_blank">
|
|
11
|
+
<img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://github.com/dvcol/neo-svelte/blob/master/LICENSE" target="_blank">
|
|
14
|
+
<img alt="License: MIT" src="https://img.shields.io/github/license/dvcol/neo-svelte" />
|
|
15
|
+
</a>
|
|
16
|
+
<a href="https://paypal.me/dvcol/5" target="_blank">
|
|
17
|
+
<img alt="donate" src="https://img.shields.io/badge/Donate%20€-PayPal-brightgreen.svg" />
|
|
18
|
+
</a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
## Prerequisites
|
|
22
|
+
|
|
23
|
+
Note: Svelte Simple Router is a svelte 5 native library, and will not work with prior versions of svelte.
|
|
24
|
+
|
|
25
|
+
- svelte >= 5.0.0
|
|
26
|
+
|
|
27
|
+
## Install
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
pnpm add @dvcol/neo-svelte
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Getting Started
|
|
34
|
+
|
|
35
|
+
Wrap any component inside the style provider
|
|
36
|
+
|
|
37
|
+
```svelte
|
|
38
|
+
<script lang="ts">
|
|
39
|
+
import { NeoThemeProvider } from '@dvcol/neo-svelte';
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<NeoThemeProvider>
|
|
43
|
+
...
|
|
44
|
+
</NeoThemeProvider>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Then import any of the components you want to use.
|
|
48
|
+
|
|
49
|
+
See examples in the demo (code [here](https://github.com/dvcol/neo-svelte/tree/fed1b3f42e863e18968c77256527a837957b3304/demo/components), live demo [here](https://dvcol.github.io/neo-svelte/#/inputs)).
|
|
3
50
|
|
|
4
51
|
## TODO
|
|
5
52
|
- [ ] @media any-pointer:coarse any-hover:none
|
|
@@ -19,20 +66,18 @@ Neomorphic ui library for svelte 5
|
|
|
19
66
|
- [x] multiple
|
|
20
67
|
- [x] numbers
|
|
21
68
|
- [x] digits
|
|
22
|
-
- [ ] range
|
|
23
69
|
- [ ] phone
|
|
24
70
|
- [ ] credit card
|
|
25
71
|
- [x] pin
|
|
26
72
|
- [x] time/date/week
|
|
27
73
|
- [ ] range
|
|
28
74
|
- [x] switch
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [ ]
|
|
35
|
-
- [ ] labels
|
|
75
|
+
- [x] slider
|
|
76
|
+
- [X] range
|
|
77
|
+
- [X] inset
|
|
78
|
+
- [x] custom before-after
|
|
79
|
+
- [x] steps
|
|
80
|
+
- [ ] vertical
|
|
36
81
|
- [ ] select
|
|
37
82
|
- [ ] table
|
|
38
83
|
- [ ] pagination
|
|
@@ -83,6 +128,21 @@ Neomorphic ui library for svelte 5
|
|
|
83
128
|
- [ ] grid
|
|
84
129
|
- [ ] masonry ?
|
|
85
130
|
|
|
131
|
+
## Author
|
|
132
|
+
|
|
133
|
+
* Github: [@dvcol](https://github.com/dvcol)
|
|
134
|
+
|
|
135
|
+
## Show your support
|
|
136
|
+
|
|
137
|
+
Give a ⭐️ if this project helped you!
|
|
138
|
+
|
|
139
|
+
<a href="https://paypal.me/dvcol/5" target="_blank">
|
|
140
|
+
<img alt="donate" src="https://img.shields.io/badge/Donate%20€-PayPal-brightgreen.svg" />
|
|
141
|
+
</a>
|
|
142
|
+
|
|
143
|
+
## 📝 License
|
|
86
144
|
|
|
87
|
-
|
|
145
|
+
This project is [MIT](https://github.com/dvcol/neo-svelte/blob/master/LICENSE) licensed.
|
|
88
146
|
|
|
147
|
+
***
|
|
148
|
+
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { FocusEventHandler,
|
|
2
|
+
import type { FocusEventHandler, PointerEventHandler } from 'svelte/elements';
|
|
3
3
|
import type { NeoCardContext, NeoCardProps } from './neo-card.model.js';
|
|
4
4
|
|
|
5
5
|
import NeoButton from '../buttons/NeoButton.svelte';
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
onClose,
|
|
63
63
|
onfocusin,
|
|
64
64
|
onfocusout,
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
onpointerenter,
|
|
66
|
+
onpointerleave,
|
|
67
67
|
|
|
68
68
|
// Other props
|
|
69
69
|
contentTag = 'div',
|
|
@@ -92,14 +92,14 @@
|
|
|
92
92
|
|
|
93
93
|
const segments = $derived([content, header, action, footer, media, close].filter(Boolean).length > 1);
|
|
94
94
|
|
|
95
|
-
const
|
|
95
|
+
const onPointerEnter: PointerEventHandler<HTMLDivElement> = e => {
|
|
96
96
|
hovered = true;
|
|
97
|
-
|
|
97
|
+
onpointerenter?.(e);
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
const
|
|
100
|
+
const onPointerLeave: PointerEventHandler<HTMLDivElement> = e => {
|
|
101
101
|
hovered = false;
|
|
102
|
-
|
|
102
|
+
onpointerleave?.(e);
|
|
103
103
|
};
|
|
104
104
|
|
|
105
105
|
const onFocusIn: FocusEventHandler<HTMLInputElement> = e => {
|
|
@@ -192,8 +192,8 @@
|
|
|
192
192
|
out:outFn={outProps}
|
|
193
193
|
in:inFn={inProps}
|
|
194
194
|
{...rest}
|
|
195
|
-
|
|
196
|
-
|
|
195
|
+
onpointerenter={onPointerEnter}
|
|
196
|
+
onpointerleave={onPointerLeave}
|
|
197
197
|
onfocusin={onFocusIn}
|
|
198
198
|
onfocusout={onFocusOut}
|
|
199
199
|
>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import type { EventHandler, FocusEventHandler,
|
|
2
|
+
import type { EventHandler, FocusEventHandler, PointerEventHandler } from 'svelte/elements';
|
|
3
3
|
import type { NeoInputHTMLElement } from './common/neo-input.model.js';
|
|
4
4
|
import type { NeoPinContext, NeoPinProps } from './neo-pin.model.js';
|
|
5
5
|
import type { SvelteEvent } from '../utils/html-element.utils.js';
|
|
@@ -297,13 +297,13 @@
|
|
|
297
297
|
oninvalid?.(e);
|
|
298
298
|
};
|
|
299
299
|
|
|
300
|
-
const
|
|
300
|
+
const onPointerEnter: PointerEventHandler<HTMLDivElement> = e => {
|
|
301
301
|
hovered = true;
|
|
302
|
-
containerProps?.
|
|
302
|
+
containerProps?.onpointerenter?.(e);
|
|
303
303
|
};
|
|
304
|
-
const
|
|
304
|
+
const onPointerLeave: PointerEventHandler<HTMLDivElement> = e => {
|
|
305
305
|
hovered = false;
|
|
306
|
-
containerProps?.
|
|
306
|
+
containerProps?.onpointerleave?.(e);
|
|
307
307
|
};
|
|
308
308
|
|
|
309
309
|
const affix = $derived(clearable || loading !== undefined || validation);
|
|
@@ -359,8 +359,8 @@
|
|
|
359
359
|
{...containerProps}
|
|
360
360
|
onfocusin={onFocusIn}
|
|
361
361
|
onfocusout={onFocusOut}
|
|
362
|
-
|
|
363
|
-
|
|
362
|
+
onpointerenter={onPointerEnter}
|
|
363
|
+
onpointerleave={onPointerLeave}
|
|
364
364
|
>
|
|
365
365
|
{#if before}
|
|
366
366
|
<svelte:element this={beforeTag} class:neo-pin-before={true} class:neo-vertical={vertical} {...beforeProps}>
|