@dvcol/neo-svelte 0.1.9 → 0.1.11
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 +54 -0
- package/README.md +34 -19
- package/dist/buttons/NeoArrowButton.svelte +48 -0
- package/dist/buttons/NeoArrowButton.svelte.d.ts +4 -0
- package/dist/buttons/NeoButton.svelte +46 -21
- package/dist/buttons/NeoButton.svelte.d.ts +1 -1
- package/dist/buttons/NeoButtonGroup.svelte +16 -1
- package/dist/buttons/NeoCheckboxButton.svelte +1 -0
- package/dist/buttons/NeoCheckboxButton.svelte.d.ts +1 -1
- package/dist/buttons/NeoRadioButton.svelte +1 -0
- package/dist/buttons/NeoSwitchButton.svelte +1 -0
- package/dist/buttons/index.d.ts +2 -0
- package/dist/buttons/index.js +1 -0
- package/dist/buttons/neo-arrow-button.model.d.ts +16 -0
- package/dist/buttons/neo-arrow-button.model.js +1 -0
- package/dist/buttons/neo-button-group.model.d.ts +10 -1
- package/dist/buttons/neo-button.model.d.ts +46 -34
- package/dist/cards/neo-card.model.d.ts +1 -1
- package/dist/collapse/NeoAccordion.svelte +171 -0
- package/dist/collapse/NeoAccordion.svelte.d.ts +4 -0
- package/dist/collapse/NeoCollapse.svelte +229 -0
- package/dist/collapse/NeoCollapse.svelte.d.ts +4 -0
- package/dist/collapse/NeoCollapseGroup.svelte +43 -0
- package/dist/collapse/NeoCollapseGroup.svelte.d.ts +4 -0
- package/dist/collapse/index.d.ts +6 -0
- package/dist/collapse/index.js +3 -0
- package/dist/collapse/neo-accordion.model.d.ts +101 -0
- package/dist/collapse/neo-accordion.model.js +1 -0
- package/dist/collapse/neo-collapse-context.svelte.d.ts +47 -0
- package/dist/collapse/neo-collapse-context.svelte.js +122 -0
- package/dist/collapse/neo-collapse-group.model.d.ts +43 -0
- package/dist/collapse/neo-collapse-group.model.js +1 -0
- package/dist/collapse/neo-collapse.model.d.ts +100 -0
- package/dist/collapse/neo-collapse.model.js +1 -0
- package/dist/containers/NeoTransitionContainer.svelte +8 -1
- package/dist/containers/neo-transition-container.model.d.ts +4 -0
- package/dist/divider/NeoDivider.svelte +3 -1
- package/dist/divider/neo-divider.model.d.ts +4 -0
- package/dist/form/NeoFieldSet.svelte +83 -0
- package/dist/form/NeoFieldSet.svelte.d.ts +4 -0
- package/dist/form/NeoForm.svelte +77 -0
- package/dist/form/NeoForm.svelte.d.ts +4 -0
- package/dist/form/index.d.ts +4 -0
- package/dist/form/index.js +2 -0
- package/dist/form/neo-fieldset.model.d.ts +30 -0
- package/dist/form/neo-fieldset.model.js +1 -0
- package/dist/form/neo-form-context.svelte.d.ts +40 -0
- package/dist/form/neo-form-context.svelte.js +88 -0
- package/dist/form/neo-form.model.d.ts +42 -0
- package/dist/form/neo-form.model.js +1 -0
- package/dist/icons/IconAccount.svelte +58 -26
- package/dist/icons/IconAccount.svelte.d.ts +3 -25
- package/dist/icons/IconAddress.svelte +80 -0
- package/dist/icons/IconAddress.svelte.d.ts +4 -0
- package/dist/icons/IconArrow.svelte +135 -0
- package/dist/icons/IconArrow.svelte.d.ts +4 -0
- package/dist/icons/IconBouncingDots.svelte +5 -2
- package/dist/icons/IconBouncingDots.svelte.d.ts +2 -6
- package/dist/icons/IconCheckbox.svelte +3 -42
- package/dist/icons/IconCheckbox.svelte.d.ts +2 -43
- package/dist/icons/IconCircleLoading.svelte +4 -2
- package/dist/icons/IconCircleLoading.svelte.d.ts +1276 -12
- package/dist/icons/IconListSmall.svelte +112 -0
- package/dist/icons/IconListSmall.svelte.d.ts +4 -0
- package/dist/icons/IconPlayPause.svelte +3 -1
- package/dist/icons/IconPlayPause.svelte.d.ts +2 -7
- package/dist/icons/IconRadio.svelte +4 -2
- package/dist/icons/IconRadio.svelte.d.ts +2 -7
- package/dist/icons/IconSunMoon.svelte +3 -1
- package/dist/icons/IconSunMoon.svelte.d.ts +2 -7
- package/dist/icons/icon.model.d.ts +85 -0
- package/dist/icons/icon.model.js +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/inputs/NeoCheckbox.svelte +39 -6
- package/dist/inputs/NeoCheckbox.svelte.d.ts +1 -1
- package/dist/inputs/NeoColorPicker.svelte +4 -4
- package/dist/inputs/NeoColorPicker.svelte.d.ts +1 -1
- package/dist/inputs/NeoColorPickerSelector.svelte.d.ts +1 -1
- package/dist/inputs/NeoDateTime.svelte +8 -5
- package/dist/inputs/NeoDateTime.svelte.d.ts +1 -1
- package/dist/inputs/NeoFilePicker.svelte +48 -14
- package/dist/inputs/NeoFilePicker.svelte.d.ts +1 -1
- package/dist/inputs/NeoFilePickerCard.svelte +3 -3
- package/dist/inputs/NeoNativeSelect.svelte +4 -4
- package/dist/inputs/NeoNativeSelect.svelte.d.ts +1 -1
- package/dist/inputs/NeoNumberStep.svelte +10 -7
- package/dist/inputs/NeoNumberStep.svelte.d.ts +1 -1
- package/dist/inputs/NeoPassword.svelte +3 -3
- package/dist/inputs/NeoPassword.svelte.d.ts +1 -1
- package/dist/inputs/NeoPin.svelte +53 -12
- package/dist/inputs/NeoPin.svelte.d.ts +1 -1
- package/dist/inputs/NeoRadio.svelte +17 -1
- package/dist/inputs/NeoRadio.svelte.d.ts +1 -1
- package/dist/inputs/NeoRange.svelte +71 -37
- package/dist/inputs/NeoRange.svelte.d.ts +1 -1
- package/dist/inputs/NeoSelect.svelte +55 -16
- package/dist/inputs/NeoSelect.svelte.d.ts +1 -1
- package/dist/inputs/NeoSwitch.svelte +39 -6
- package/dist/inputs/NeoSwitch.svelte.d.ts +1 -1
- package/dist/inputs/NeoTextarea.svelte +89 -47
- package/dist/inputs/NeoTextarea.svelte.d.ts +1 -1
- package/dist/inputs/common/NeoAffix.svelte +1 -1
- package/dist/inputs/common/NeoBaseInput.svelte +20 -6
- package/dist/inputs/common/NeoBaseInput.svelte.d.ts +1 -1
- package/dist/inputs/common/NeoInput.svelte +65 -31
- package/dist/inputs/common/NeoInput.svelte.d.ts +1 -1
- package/dist/inputs/common/NeoInputValidation.svelte +20 -13
- package/dist/inputs/common/NeoLabel.svelte +6 -4
- package/dist/inputs/common/NeoValidation.svelte +66 -36
- package/dist/inputs/common/neo-input-validation.model.d.ts +9 -0
- package/dist/inputs/common/neo-input.model.d.ts +30 -6
- package/dist/inputs/common/neo-label.model.d.ts +18 -10
- package/dist/inputs/common/neo-validation.model.d.ts +17 -0
- package/dist/inputs/index.d.ts +1 -0
- package/dist/inputs/index.js +1 -0
- package/dist/inputs/neo-checkbox.model.d.ts +1 -1
- package/dist/inputs/neo-pin.model.d.ts +4 -0
- package/dist/inputs/neo-radio.model.d.ts +1 -1
- package/dist/inputs/neo-range.model.d.ts +35 -12
- package/dist/inputs/neo-select.model.d.ts +16 -3
- package/dist/inputs/neo-switch.model.d.ts +1 -1
- package/dist/list/NeoList.svelte +17 -34
- package/dist/list/NeoListBaseItem.svelte +3 -3
- package/dist/list/NeoListSearch.svelte.d.ts +1 -1
- package/dist/list/neo-list-base-loader.model.d.ts +1 -1
- package/dist/list/neo-list.model.d.ts +19 -4
- package/dist/list/neo-list.model.js +47 -0
- package/dist/nav/NeoTab.svelte +1 -1
- package/dist/nav/NeoTabPanel.svelte +17 -6
- package/dist/nav/NeoTabs.svelte +3 -4
- package/dist/nav/NeoTabs.svelte.d.ts +1 -1
- package/dist/nav/NeoTabsCard.svelte +1 -1
- package/dist/nav/neo-tab-panel.model.d.ts +2 -1
- package/dist/nav/neo-tabs-context.svelte.js +3 -0
- package/dist/pill/NeoPill.svelte +1 -1
- package/dist/progress/NeoProgress.svelte +20 -9
- package/dist/progress/NeoProgress.svelte.d.ts +1 -1
- package/dist/progress/NeoProgressBar.svelte +52 -16
- package/dist/progress/NeoProgressBar.svelte.d.ts +1 -1
- package/dist/progress/NeoProgressMark.svelte +13 -6
- package/dist/progress/NeoProgressMark.svelte.d.ts +1 -1
- package/dist/progress/neo-progress-bar.model.d.ts +13 -9
- package/dist/progress/neo-progress-mark.model.d.ts +13 -1
- package/dist/progress/neo-progress.model.d.ts +14 -6
- package/dist/providers/neo-theme-provider.scss +2 -2
- package/dist/skeletons/NeoSkeletonContainer.svelte +2 -0
- package/dist/skeletons/NeoSkeletonMedia.svelte +1 -1
- package/dist/skeletons/NeoSkeletonText.svelte +1 -1
- package/dist/skeletons/neo-skeleton-container.model.d.ts +4 -0
- package/dist/stepper/NeoStepper.svelte +443 -0
- package/dist/stepper/NeoStepper.svelte.d.ts +4 -0
- package/dist/stepper/index.d.ts +3 -0
- package/dist/stepper/index.js +2 -0
- package/dist/stepper/neo-stepper.model.d.ts +326 -0
- package/dist/stepper/neo-stepper.model.js +10 -0
- package/dist/styles/common/colors.scss +5 -0
- package/dist/styles/common/spacing.scss +3 -3
- package/dist/styles/reset.scss +2 -5
- package/dist/text/NeoScrollShadow.svelte +2 -0
- package/dist/text/neo-scroll-shadow.model.d.ts +4 -0
- package/dist/tooltips/NeoPopConfirm.svelte +236 -0
- package/dist/tooltips/NeoPopConfirm.svelte.d.ts +4 -0
- package/dist/tooltips/NeoPopSelect.svelte +13 -2
- package/dist/tooltips/NeoPopSelect.svelte.d.ts +1 -1
- package/dist/tooltips/NeoTooltip.svelte +46 -89
- package/dist/tooltips/NeoTooltip.svelte.d.ts +1 -1
- package/dist/tooltips/neo-pop-confirm.model.d.ts +166 -0
- package/dist/tooltips/neo-pop-confirm.model.js +1 -0
- package/dist/tooltips/neo-pop-select.model.d.ts +24 -5
- package/dist/tooltips/neo-tooltip.model.d.ts +33 -11
- package/dist/tooltips/neo-tooltip.model.js +5 -0
- package/dist/utils/action.utils.js +1 -0
- package/dist/utils/colors.utils.d.ts +2 -0
- package/dist/utils/colors.utils.js +2 -0
- package/dist/utils/error.utils.d.ts +18 -0
- package/dist/utils/error.utils.js +28 -0
- package/dist/utils/shadow.utils.d.ts +10 -1
- package/dist/utils/shadow.utils.js +14 -3
- package/dist/utils/transition.utils.js +1 -1
- package/package.json +34 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,60 @@
|
|
|
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.11](https://github.com/dvcol/neo-svelte/compare/v0.1.10...v0.1.11) (2025-03-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **accordion:** adds accordion styling for collapse ([ef3ae15](https://github.com/dvcol/neo-svelte/commit/ef3ae155ee55c1b3b801fc5e5fe68d47db5ec223))
|
|
11
|
+
* **collapse:** adds base neo-collapse ([7038e5d](https://github.com/dvcol/neo-svelte/commit/7038e5d07f89bcebc33bd692db26124908942eee))
|
|
12
|
+
* **collapse:** adds collapse-groups ([2cb2844](https://github.com/dvcol/neo-svelte/commit/2cb28440a3a55272e34bdad8047bd8a411be978b))
|
|
13
|
+
* **collapse:** adds min/max strategy ([0d91033](https://github.com/dvcol/neo-svelte/commit/0d91033ac5f9304b7a79cd0fce62b834fb09928d))
|
|
14
|
+
* **collapse:** style base collapse ([b3a1b99](https://github.com/dvcol/neo-svelte/commit/b3a1b99f3af34fc2d7f47d7a11625ff5683d158c))
|
|
15
|
+
* **form:** adds neo-form & neo-fieldset ([527eeb9](https://github.com/dvcol/neo-svelte/commit/527eeb91039686a698ae2c87489176d6a1be6f2d))
|
|
16
|
+
* **form:** support form name and registration opt-out ([ec854bb](https://github.com/dvcol/neo-svelte/commit/ec854bb379e8fb7f734e6b35289b9ecc64a2d099))
|
|
17
|
+
* **stepper:** adds arrow button & exports ([dce7eef](https://github.com/dvcol/neo-svelte/commit/dce7eefe151f69424a52caf4e7e7654c03d4be12))
|
|
18
|
+
* **stepper:** adds simple stepper component ([389b16d](https://github.com/dvcol/neo-svelte/commit/389b16d400a6ada7c5f18f9f10f2591f7aa0c238))
|
|
19
|
+
* **stepper:** adds support for async step transiitons ([7c7dfc9](https://github.com/dvcol/neo-svelte/commit/7c7dfc9f57c66ab4aa7c45be783e2a362b1dace8))
|
|
20
|
+
* **stepper:** adds touch support ([a9f98ee](https://github.com/dvcol/neo-svelte/commit/a9f98eee7f09e81ffafe829da89e94ec9ad3b1e8))
|
|
21
|
+
* **tooltip:** adds popconfirm ([8f69873](https://github.com/dvcol/neo-svelte/commit/8f69873532d9d76c1fc66ca69b09166a9c652e44))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Bug Fixes
|
|
25
|
+
|
|
26
|
+
* **accordion:** adds sizing props ([fe2ccec](https://github.com/dvcol/neo-svelte/commit/fe2ccec2eaafdb1ac1c76eb3d0f478016af1542b))
|
|
27
|
+
* **accordion:** adjust collapse border to prevent content shift ([b260a7c](https://github.com/dvcol/neo-svelte/commit/b260a7c53f681897af275ffa47e3aa4436620ef9))
|
|
28
|
+
* **arrow:** disable line on mobile ([3cf3970](https://github.com/dvcol/neo-svelte/commit/3cf3970d586aaba5f2bcdd87426a5af3056645b9))
|
|
29
|
+
* **button:** adds button context to snippets ([d6b88ee](https://github.com/dvcol/neo-svelte/commit/d6b88eed0e340f37edba435ea1d4a8ab5b6c41e9))
|
|
30
|
+
* **button:** rework readonly mode (to be disabled without styling) ([e53561f](https://github.com/dvcol/neo-svelte/commit/e53561f3579d62ed7b4471e4ebef2fa8b40cc858))
|
|
31
|
+
* **buttons:** adds checked state when loading ([da4a571](https://github.com/dvcol/neo-svelte/commit/da4a57177e8e50885653539220996184cee4ff57))
|
|
32
|
+
* **buttons:** adds sizing to button groups ([9f1ceb1](https://github.com/dvcol/neo-svelte/commit/9f1ceb194d05cfaf135a180931cbdb8c35c56059))
|
|
33
|
+
* **buttons:** set type to button to prevent form submit ([025f412](https://github.com/dvcol/neo-svelte/commit/025f4127d3e8e0e1d5f49bfec8d613bad7363070))
|
|
34
|
+
* **form:** adds validate method ([582d0be](https://github.com/dvcol/neo-svelte/commit/582d0beb594fe02370538fba5d0f8bb646ea82a0))
|
|
35
|
+
* **input:** adjust styling & support nullable select ([b4884c0](https://github.com/dvcol/neo-svelte/commit/b4884c0fab593f48504ebe48f7d9568988aed3e1))
|
|
36
|
+
* **input:** fix auto-complete in chrome ([95e5c3d](https://github.com/dvcol/neo-svelte/commit/95e5c3d770e14009093fb49093a7ec6734c00d2c))
|
|
37
|
+
* **input:** fix textarea default binding & fix stepper vertical css ([1e406e5](https://github.com/dvcol/neo-svelte/commit/1e406e57c74bd5db82d650468bdf2cf907165a76))
|
|
38
|
+
* **input:** remove infinite resize hooks ([a5af533](https://github.com/dvcol/neo-svelte/commit/a5af53348be20db9b4aedb379df294390f71026e))
|
|
39
|
+
* **inputs:** corrects autofill styling for webkit ([9db7aeb](https://github.com/dvcol/neo-svelte/commit/9db7aeb03af791de194245dabb55f56ec5657ff3))
|
|
40
|
+
* **progress:** adds track disable & fix css ([3ab6cee](https://github.com/dvcol/neo-svelte/commit/3ab6cee677836091d21bf6656668dd0d11c43494))
|
|
41
|
+
* **progress:** adjust bar sizing ([8da6764](https://github.com/dvcol/neo-svelte/commit/8da67648457b476532591f83b6de2151a18ee308))
|
|
42
|
+
* **progress:** dynamically size margin to fit inner marks ([32af1fe](https://github.com/dvcol/neo-svelte/commit/32af1feb27f2c3fb5665c8d57b3ce6770dc21762))
|
|
43
|
+
* **reactivity:** remove ref binding to reduce unnecessary effects ([aa2a454](https://github.com/dvcol/neo-svelte/commit/aa2a454fe15c5d7772cf2fd2e586c527aac52e3d))
|
|
44
|
+
* **select:** auto-select if value set but not selected ([c431b50](https://github.com/dvcol/neo-svelte/commit/c431b50c18ecc625c61109fc2212f94098bd6c72))
|
|
45
|
+
* **select:** transform items before processing ([89b77e7](https://github.com/dvcol/neo-svelte/commit/89b77e77a625029da3f5a0b4bf3684a3974e69b0))
|
|
46
|
+
* **sizing:** adds sizing binding for various inputs ([afe52f1](https://github.com/dvcol/neo-svelte/commit/afe52f114e274cc3dfeedcac66ea838e5f0e2b8e))
|
|
47
|
+
* **sizing:** adjust sizing options & add flex prop ([ecb37de](https://github.com/dvcol/neo-svelte/commit/ecb37deb3f1af2cd5ba5167e2a39821248c1cbad))
|
|
48
|
+
* **sizing:** move progress to custom sizing props ([e0cfa36](https://github.com/dvcol/neo-svelte/commit/e0cfa367c0388042fb4fe8e1c690c33d1c0c3920))
|
|
49
|
+
* **stepper:** adds debounce to loading state ([cc2a20a](https://github.com/dvcol/neo-svelte/commit/cc2a20a9273c5e96d8f25e5a9d70a66bf7496fe1))
|
|
50
|
+
* **stepper:** adjust margin to align with first and last refs ([4522547](https://github.com/dvcol/neo-svelte/commit/452254779d93b496883ea64c8ff72c792f5e61a8))
|
|
51
|
+
* **textarea:** adjust padding when overflow is set ([e5241b3](https://github.com/dvcol/neo-svelte/commit/e5241b3d07ae1ea0816eb45a2605bac0b6e942fa))
|
|
52
|
+
* **tooltip:** adjust auto-sizing ([bee11b2](https://github.com/dvcol/neo-svelte/commit/bee11b2f0adcab9c2409849d2d15636423f48319))
|
|
53
|
+
* **transition:** adds keys to transition container ([f2a82ed](https://github.com/dvcol/neo-svelte/commit/f2a82eda98269461a8e17f314c0ee6696f76cfc1))
|
|
54
|
+
* **validation:** simplify input validation ([4fa7811](https://github.com/dvcol/neo-svelte/commit/4fa7811a8470a05dd517d0705e91b643096a74c4))
|
|
55
|
+
* **various:** fix textarea default size, account draw animation, ... ([19dc238](https://github.com/dvcol/neo-svelte/commit/19dc238effb950dfd25d29d6a589e92181520ec4))
|
|
56
|
+
|
|
57
|
+
### [0.1.10](https://github.com/dvcol/neo-svelte/compare/v0.1.9...v0.1.10) (2025-02-19)
|
|
58
|
+
|
|
5
59
|
### [0.1.9](https://github.com/dvcol/neo-svelte/compare/v0.1.8...v0.1.9) (2025-02-19)
|
|
6
60
|
|
|
7
61
|
|
package/README.md
CHANGED
|
@@ -18,6 +18,12 @@
|
|
|
18
18
|
</a>
|
|
19
19
|
</p>
|
|
20
20
|
|
|
21
|
+
## Description
|
|
22
|
+
|
|
23
|
+
Neo Svelte is a modern UI library for Svelte 5, designed to bring a sleek, soft, and futuristic look to web applications with neumorphism and glassmorphism design elements.
|
|
24
|
+
|
|
25
|
+
It provides a collection of pre-styled, accessible, and highly customizable components that make it easy to build visually appealing UIs with minimal effort.
|
|
26
|
+
|
|
21
27
|
## Prerequisites
|
|
22
28
|
|
|
23
29
|
Note: Svelte Simple Router is a svelte 5 native library, and will not work with prior versions of svelte.
|
|
@@ -89,12 +95,9 @@ See examples in the demo (code [here](https://github.com/dvcol/neo-svelte/tree/f
|
|
|
89
95
|
- [x] select
|
|
90
96
|
- [x] native
|
|
91
97
|
- [x] custom
|
|
92
|
-
- [x]
|
|
93
|
-
- [
|
|
94
|
-
- [x]
|
|
95
|
-
- [ ] menu
|
|
96
|
-
- [ ] nested menus
|
|
97
|
-
- [ ] menu pane (multi column)
|
|
98
|
+
- [x] form
|
|
99
|
+
- [x] validation
|
|
100
|
+
- [x] fieldset
|
|
98
101
|
|
|
99
102
|
- [x] list
|
|
100
103
|
- [x] select
|
|
@@ -123,14 +126,26 @@ See examples in the demo (code [here](https://github.com/dvcol/neo-svelte/tree/f
|
|
|
123
126
|
- [x] duration/timeout
|
|
124
127
|
- [x] start/stop/cancel/finish/reset
|
|
125
128
|
|
|
126
|
-
- [
|
|
127
|
-
- [
|
|
128
|
-
- [
|
|
129
|
+
- [x] collapse
|
|
130
|
+
- [x] description
|
|
131
|
+
- [x] vertical
|
|
132
|
+
- [x] accordion
|
|
133
|
+
- [x] controlled (min, max, toggle)
|
|
129
134
|
|
|
130
|
-
- [
|
|
131
|
-
- [
|
|
132
|
-
- [ ]
|
|
133
|
-
- [
|
|
135
|
+
- [x] stepper
|
|
136
|
+
- [x] vertical
|
|
137
|
+
- [ ] collapse
|
|
138
|
+
- [x] progress/dots
|
|
139
|
+
- [x] controls (cancel, next, prev, finish)
|
|
140
|
+
- [x] touch swipe
|
|
141
|
+
|
|
142
|
+
- [x] tooltip
|
|
143
|
+
- [x] popconfirm
|
|
144
|
+
- [x] popselect
|
|
145
|
+
- [ ] popstepper
|
|
146
|
+
- [ ] menu
|
|
147
|
+
- [ ] nested menus
|
|
148
|
+
- [ ] menu pane (multi column)
|
|
134
149
|
|
|
135
150
|
- [ ] Modal/dialog
|
|
136
151
|
- [ ] HTML Dialog
|
|
@@ -185,12 +200,12 @@ See examples in the demo (code [here](https://github.com/dvcol/neo-svelte/tree/f
|
|
|
185
200
|
- [ ] carousel
|
|
186
201
|
- [ ] parallax
|
|
187
202
|
- [ ] avatar
|
|
188
|
-
- [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
- [ ]
|
|
192
|
-
- [ ]
|
|
193
|
-
- [ ]
|
|
203
|
+
- [x] badge
|
|
204
|
+
|
|
205
|
+
- [ ] PointerTracker (Pointer Events)
|
|
206
|
+
- [ ] track cursor
|
|
207
|
+
- [ ] grow to tabindex targets
|
|
208
|
+
- [ ] height, twist, tilt & pressure support
|
|
194
209
|
|
|
195
210
|
- [ ] text
|
|
196
211
|
- [ ] elevation
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { PointerEventHandler } from 'svelte/elements';
|
|
3
|
+
|
|
4
|
+
import type { NeoArrowButtonProps } from './neo-arrow-button.model.js';
|
|
5
|
+
|
|
6
|
+
import NeoButton from './NeoButton.svelte';
|
|
7
|
+
import IconArrow from '../icons/IconArrow.svelte';
|
|
8
|
+
import { IconArrowDirection } from '../icons/icon.model.js';
|
|
9
|
+
|
|
10
|
+
/* eslint-disable prefer-const -- necessary for binding checked */
|
|
11
|
+
let {
|
|
12
|
+
// State
|
|
13
|
+
hovered = $bindable(false),
|
|
14
|
+
direction = IconArrowDirection.Right,
|
|
15
|
+
|
|
16
|
+
// Button props
|
|
17
|
+
checked = $bindable(false),
|
|
18
|
+
disabled,
|
|
19
|
+
readonly,
|
|
20
|
+
|
|
21
|
+
// Events
|
|
22
|
+
onpointerenter,
|
|
23
|
+
onpointerleave,
|
|
24
|
+
|
|
25
|
+
// Other Props
|
|
26
|
+
arrowProps,
|
|
27
|
+
...rest
|
|
28
|
+
}: NeoArrowButtonProps = $props();
|
|
29
|
+
/* eslint-enable prefer-const */
|
|
30
|
+
|
|
31
|
+
const reverse = $derived(direction === 'right');
|
|
32
|
+
|
|
33
|
+
const onPointerEnter: PointerEventHandler<HTMLButtonElement> = e => {
|
|
34
|
+
hovered = true;
|
|
35
|
+
onpointerenter?.(e);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const onPointerLeave: PointerEventHandler<HTMLButtonElement> = e => {
|
|
39
|
+
hovered = false;
|
|
40
|
+
onpointerleave?.(e);
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
{#snippet icon()}
|
|
45
|
+
<IconArrow {direction} expanded={(checked || hovered) && !disabled && !readonly} {...arrowProps} />
|
|
46
|
+
{/snippet}
|
|
47
|
+
|
|
48
|
+
<NeoButton bind:checked {icon} {reverse} {disabled} {readonly} {...rest} onpointerenter={onPointerEnter} onpointerleave={onPointerLeave} />
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { width } from '@dvcol/svelte-utils/transition';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type { KeyboardEventHandler, MouseEventHandler } from 'svelte/elements';
|
|
5
|
+
|
|
6
|
+
import { type NeoButtonContext, type NeoButtonProps, NeoTextButton } from './neo-button.model.js';
|
|
5
7
|
|
|
6
8
|
import IconCircleLoading from '../icons/IconCircleLoading.svelte';
|
|
7
9
|
import { toAction, toActionProps, toTransition, toTransitionProps } from '../utils/action.utils.js';
|
|
@@ -126,10 +128,11 @@
|
|
|
126
128
|
}, 150);
|
|
127
129
|
};
|
|
128
130
|
|
|
129
|
-
const onClick:
|
|
131
|
+
const onClick: MouseEventHandler<HTMLButtonElement> = e => {
|
|
130
132
|
if (loading || disabled) return;
|
|
133
|
+
if (readonly) return onActive();
|
|
131
134
|
if (toggle) {
|
|
132
|
-
|
|
135
|
+
checked = !checked;
|
|
133
136
|
onchecked?.(checked);
|
|
134
137
|
onclick?.(e, checked);
|
|
135
138
|
return;
|
|
@@ -139,15 +142,15 @@
|
|
|
139
142
|
onActive();
|
|
140
143
|
};
|
|
141
144
|
|
|
142
|
-
const onKeydownEnter:
|
|
143
|
-
if (loading || disabled) return;
|
|
145
|
+
const onKeydownEnter: KeyboardEventHandler<HTMLButtonElement> = e => {
|
|
146
|
+
if (loading || disabled || readonly) return;
|
|
144
147
|
if (e.key === 'Enter') enter = true;
|
|
145
148
|
onkeydown?.(e);
|
|
146
149
|
};
|
|
147
150
|
|
|
148
|
-
const onKeyUpEnter:
|
|
151
|
+
const onKeyUpEnter: KeyboardEventHandler<HTMLButtonElement> = e => {
|
|
149
152
|
if (e.key === 'Enter') enter = false;
|
|
150
|
-
if (loading || disabled) return;
|
|
153
|
+
if (loading || disabled || readonly) return;
|
|
151
154
|
onkeyup?.(e);
|
|
152
155
|
};
|
|
153
156
|
|
|
@@ -158,7 +161,27 @@
|
|
|
158
161
|
|
|
159
162
|
const element = $derived(tag ?? (href ? 'a' : 'button'));
|
|
160
163
|
const role = $derived(!['button', 'a'].includes(element) ? 'button' : undefined);
|
|
161
|
-
const
|
|
164
|
+
const type = $derived(element === 'button' ? 'button' : undefined);
|
|
165
|
+
const tabindex = $derived.by(() => {
|
|
166
|
+
if (readonly) return -1;
|
|
167
|
+
if (!disabled && role) return 0;
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const context = $derived<NeoButtonContext>({
|
|
171
|
+
ref,
|
|
172
|
+
href,
|
|
173
|
+
|
|
174
|
+
loading,
|
|
175
|
+
disabled,
|
|
176
|
+
readonly,
|
|
177
|
+
skeleton,
|
|
178
|
+
|
|
179
|
+
empty,
|
|
180
|
+
toggle,
|
|
181
|
+
|
|
182
|
+
checked,
|
|
183
|
+
pressed,
|
|
184
|
+
});
|
|
162
185
|
|
|
163
186
|
const inFn = $derived(toTransition(inAction ?? transitionAction));
|
|
164
187
|
const inProps = $derived(toTransitionProps(inAction ?? transitionAction));
|
|
@@ -172,10 +195,13 @@
|
|
|
172
195
|
<svelte:element
|
|
173
196
|
this={element}
|
|
174
197
|
bind:this={ref}
|
|
175
|
-
href={loading || disabled ? undefined : href}
|
|
198
|
+
href={loading || disabled || readonly ? undefined : href}
|
|
199
|
+
aria-disabled={readonly && !disabled}
|
|
200
|
+
{type}
|
|
176
201
|
{role}
|
|
177
202
|
{tabindex}
|
|
178
203
|
class:neo-button={true}
|
|
204
|
+
class:neo-readonly={readonly}
|
|
179
205
|
class:neo-pulse={pulse}
|
|
180
206
|
class:neo-coalesce={coalesce}
|
|
181
207
|
class:neo-pressed={pressed}
|
|
@@ -223,17 +249,17 @@
|
|
|
223
249
|
{#if loading}
|
|
224
250
|
<IconCircleLoading />
|
|
225
251
|
{:else}
|
|
226
|
-
{@render icon?.()}
|
|
252
|
+
{@render icon?.(context)}
|
|
227
253
|
{/if}
|
|
228
254
|
</span>
|
|
229
255
|
{/if}
|
|
230
256
|
{#if !empty}
|
|
231
257
|
{#if typeof label === 'function'}
|
|
232
|
-
{@render label?.()}
|
|
258
|
+
{@render label?.(context)}
|
|
233
259
|
{:else if label !== undefined}
|
|
234
260
|
{label}
|
|
235
261
|
{/if}
|
|
236
|
-
{@render children?.()}
|
|
262
|
+
{@render children?.(context)}
|
|
237
263
|
{/if}
|
|
238
264
|
</div>
|
|
239
265
|
</svelte:element>
|
|
@@ -269,7 +295,7 @@
|
|
|
269
295
|
border-radius: var(--neo-btn-border-radius, var(--neo-border-radius));
|
|
270
296
|
box-shadow: var(--neo-btn-box-shadow, var(--neo-box-shadow-raised-3));
|
|
271
297
|
cursor: pointer;
|
|
272
|
-
transition: opacity 0.3s ease, color 0.
|
|
298
|
+
transition: opacity 0.3s ease, color 0.15s ease, background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease-out;
|
|
273
299
|
appearance: none;
|
|
274
300
|
}
|
|
275
301
|
.neo-button.neo-loading {
|
|
@@ -286,20 +312,20 @@
|
|
|
286
312
|
width: 100%;
|
|
287
313
|
height: 100%;
|
|
288
314
|
backface-visibility: hidden;
|
|
289
|
-
transition: color 0.
|
|
315
|
+
transition: color 0.15s ease, scale 0.3s ease;
|
|
290
316
|
will-change: scale, color;
|
|
291
317
|
scale: 1;
|
|
292
318
|
}
|
|
293
319
|
.neo-button .neo-content .neo-icon:not(.neo-only) {
|
|
294
|
-
margin-right: var(--neo-btn-icon-gap, 0.
|
|
295
|
-
margin-left: var(--neo-btn-icon-offset, calc(0
|
|
320
|
+
margin-right: var(--neo-btn-icon-gap, 0.3125rem);
|
|
321
|
+
margin-left: var(--neo-btn-icon-offset, calc(0% - var(--neo-btn-icon-gap, 0.3125rem)));
|
|
296
322
|
}
|
|
297
323
|
.neo-button .neo-content.neo-reverse {
|
|
298
324
|
flex-direction: row-reverse;
|
|
299
325
|
}
|
|
300
326
|
.neo-button .neo-content.neo-reverse .neo-icon:not(.neo-only) {
|
|
301
|
-
margin-right: var(--neo-btn-icon-offset, calc(0
|
|
302
|
-
margin-left: var(--neo-btn-icon-gap, 0.
|
|
327
|
+
margin-right: var(--neo-btn-icon-offset, calc(0% - var(--neo-btn-icon-gap, 0.3125rem)));
|
|
328
|
+
margin-left: var(--neo-btn-icon-gap, 0.3125rem);
|
|
303
329
|
}
|
|
304
330
|
.neo-button.neo-ghost {
|
|
305
331
|
justify-content: unset;
|
|
@@ -326,7 +352,7 @@
|
|
|
326
352
|
}
|
|
327
353
|
.neo-button.neo-pressed, .neo-button:active:not(.neo-loading, :disabled) {
|
|
328
354
|
box-shadow: var(--neo-btn-box-shadow-active, var(--neo-box-shadow-pressed-2));
|
|
329
|
-
transition: opacity 0.3s ease, color 0.
|
|
355
|
+
transition: opacity 0.3s ease, color 0.15s ease, background-color 0.3s ease, border-color 0.3s ease, backdrop-filter 0.3s ease, border-radius 0.3s ease, box-shadow 0.15s ease-out;
|
|
330
356
|
}
|
|
331
357
|
.neo-button.neo-pressed.neo-scale .neo-content, .neo-button:active:not(.neo-loading, :disabled).neo-scale .neo-content {
|
|
332
358
|
color: var(--neo-btn-text-color-active, var(--neo-text-color-active));
|
|
@@ -381,9 +407,8 @@
|
|
|
381
407
|
}
|
|
382
408
|
.neo-button:disabled, .neo-button[disabled]:not([disabled=false]) {
|
|
383
409
|
cursor: not-allowed;
|
|
384
|
-
opacity: var(--neo-btn-opacity-disabled, var(--neo-opacity-disabled));
|
|
385
410
|
}
|
|
386
|
-
.neo-button:disabled:not(.neo-pressed), .neo-button[disabled]:not([disabled=false]):not(.neo-pressed) {
|
|
411
|
+
.neo-button:disabled:not(.neo-pressed, .neo-readonly), .neo-button[disabled]:not([disabled=false]):not(.neo-pressed, .neo-readonly) {
|
|
387
412
|
border-color: var(--neo-btn-border-color-disabled, var(--neo-border-color-disabled));
|
|
388
413
|
box-shadow: var(--neo-box-shadow-flat);
|
|
389
414
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { type NeoButtonProps } from './neo-button.model.js';
|
|
2
|
-
declare const NeoButton: import("svelte").Component<NeoButtonProps, {}, "
|
|
2
|
+
declare const NeoButton: import("svelte").Component<NeoButtonProps, {}, "ref" | "checked">;
|
|
3
3
|
type NeoButton = ReturnType<typeof NeoButton>;
|
|
4
4
|
export default NeoButton;
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
isShadowFlat,
|
|
14
14
|
parseBlur,
|
|
15
15
|
} from '../utils/shadow.utils.js';
|
|
16
|
+
import { toSize } from '../utils/style.utils.js';
|
|
16
17
|
|
|
17
18
|
/* eslint-disable prefer-const -- necessary for binding checked */
|
|
18
19
|
let {
|
|
@@ -49,6 +50,10 @@
|
|
|
49
50
|
align,
|
|
50
51
|
flex,
|
|
51
52
|
|
|
53
|
+
// Size
|
|
54
|
+
width: _width,
|
|
55
|
+
height: _height,
|
|
56
|
+
|
|
52
57
|
// Transition
|
|
53
58
|
in: inAction,
|
|
54
59
|
out: outAction,
|
|
@@ -107,6 +112,9 @@
|
|
|
107
112
|
vertical,
|
|
108
113
|
start,
|
|
109
114
|
});
|
|
115
|
+
|
|
116
|
+
const width = $derived(toSize(_width));
|
|
117
|
+
const height = $derived(toSize(_height));
|
|
110
118
|
</script>
|
|
111
119
|
|
|
112
120
|
<svelte:element
|
|
@@ -139,6 +147,12 @@
|
|
|
139
147
|
style:justify-content={justify}
|
|
140
148
|
style:align-items={align}
|
|
141
149
|
style:flex
|
|
150
|
+
style:width={width?.absolute}
|
|
151
|
+
style:min-width={width?.min}
|
|
152
|
+
style:max-width={width?.max}
|
|
153
|
+
style:height={height?.absolute}
|
|
154
|
+
style:min-height={height?.min}
|
|
155
|
+
style:max-height={height?.max}
|
|
142
156
|
use:useFn={useProps}
|
|
143
157
|
out:outFn={outProps}
|
|
144
158
|
in:inFn={inProps}
|
|
@@ -177,7 +191,7 @@
|
|
|
177
191
|
border: var(--neo-border-width, 1px) var(--neo-btn-group-border-color, transparent) solid;
|
|
178
192
|
border-radius: calc(var(--neo-btn-group-border-radius, var(--neo-border-radius)) + 0.25rem);
|
|
179
193
|
box-shadow: var(--neo-btn-group-box-shadow, var(--neo-box-shadow-flat));
|
|
180
|
-
transition: color 0.
|
|
194
|
+
transition: color 0.15s ease, border-color 0.3s linear, background-color 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease-out;
|
|
181
195
|
}
|
|
182
196
|
.neo-button-group.neo-nowrap {
|
|
183
197
|
flex-wrap: nowrap;
|
|
@@ -344,6 +358,7 @@
|
|
|
344
358
|
}
|
|
345
359
|
.neo-button-group.neo-vertical {
|
|
346
360
|
flex-direction: column;
|
|
361
|
+
min-width: max-content;
|
|
347
362
|
--neo-btn-group-scale-x: 1.75;
|
|
348
363
|
--neo-btn-group-scale-y: 1.5;
|
|
349
364
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NeoCheckboxButtonProps } from './neo-checkbox-button.model.js';
|
|
2
|
-
declare const NeoCheckboxButton: import("svelte").Component<NeoCheckboxButtonProps, {}, "checked" | "
|
|
2
|
+
declare const NeoCheckboxButton: import("svelte").Component<NeoCheckboxButtonProps, {}, "checked" | "touched" | "indeterminate">;
|
|
3
3
|
type NeoCheckboxButton = ReturnType<typeof NeoCheckboxButton>;
|
|
4
4
|
export default NeoCheckboxButton;
|
package/dist/buttons/index.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ export { default as NeoButtonGroup } from './NeoButtonGroup.svelte';
|
|
|
3
3
|
export { default as NeoCheckboxButton } from './NeoCheckboxButton.svelte';
|
|
4
4
|
export { default as NeoRadioButton } from './NeoRadioButton.svelte';
|
|
5
5
|
export { default as NeoSwitchButton } from './NeoSwitchButton.svelte';
|
|
6
|
+
export { default as NeoArrowButton } from './NeoArrowButton.svelte';
|
|
6
7
|
export type * from './neo-button.model.js';
|
|
7
8
|
export type * from './neo-button-group.model.js';
|
|
8
9
|
export type * from './neo-checkbox-button.model.js';
|
|
9
10
|
export type * from './neo-radio-button.model.js';
|
|
10
11
|
export type * from './neo-switch-button.model.js';
|
|
12
|
+
export type * from './neo-arrow-button.model.js';
|
package/dist/buttons/index.js
CHANGED
|
@@ -3,3 +3,4 @@ export { default as NeoButtonGroup } from './NeoButtonGroup.svelte';
|
|
|
3
3
|
export { default as NeoCheckboxButton } from './NeoCheckboxButton.svelte';
|
|
4
4
|
export { default as NeoRadioButton } from './NeoRadioButton.svelte';
|
|
5
5
|
export { default as NeoSwitchButton } from './NeoSwitchButton.svelte';
|
|
6
|
+
export { default as NeoArrowButton } from './NeoArrowButton.svelte';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { NeoButtonProps } from './neo-button.model.js';
|
|
2
|
+
import type { IconArrowProps } from '../icons/icon.model.js';
|
|
3
|
+
export type NeoArrowButtonProps = NeoButtonProps & {
|
|
4
|
+
/**
|
|
5
|
+
* The hover state of the button (controls the arrow expand animation).
|
|
6
|
+
*/
|
|
7
|
+
hovered?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Optional arrow properties.
|
|
10
|
+
*/
|
|
11
|
+
arrowProps?: IconArrowProps;
|
|
12
|
+
/**
|
|
13
|
+
* Arrow direction.
|
|
14
|
+
*/
|
|
15
|
+
direction?: IconArrowProps['direction'];
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,6 +4,7 @@ import type { HTMLActionProps } from '../utils/action.utils.js';
|
|
|
4
4
|
import type { Color } from '../utils/colors.utils.js';
|
|
5
5
|
import type { HTMLFlexProps, HTMLNeoBaseElement, HTMLRefProps } from '../utils/html-element.utils.js';
|
|
6
6
|
import type { ShadowElevation, ShadowElevationString } from '../utils/shadow.utils.js';
|
|
7
|
+
import type { SizeInput } from '../utils/style.utils.js';
|
|
7
8
|
export type NeoButtonGroupElevation = ShadowElevation | ShadowElevationString;
|
|
8
9
|
export type NeoButtonGroupContext = {
|
|
9
10
|
/**
|
|
@@ -45,7 +46,7 @@ export type NeoButtonGroupContext = {
|
|
|
45
46
|
*/
|
|
46
47
|
active?: NeoButtonActiveElevation;
|
|
47
48
|
/**
|
|
48
|
-
*
|
|
49
|
+
* Whether the pressed state should be displayed as recessed or pressed.
|
|
49
50
|
*
|
|
50
51
|
* @default true if `elevation` + `hover` > 0 && `active` < 0
|
|
51
52
|
*/
|
|
@@ -113,4 +114,12 @@ export type NeoButtonGroupProps<Tag extends keyof HTMLElementTagNameMap = 'div'>
|
|
|
113
114
|
* If true, the buttons will not wrap to the next line.
|
|
114
115
|
*/
|
|
115
116
|
nowrap?: boolean;
|
|
117
|
+
/**
|
|
118
|
+
* Optional width constraints.
|
|
119
|
+
*/
|
|
120
|
+
width?: SizeInput<'width'>;
|
|
121
|
+
/**
|
|
122
|
+
* Optional height constraints.
|
|
123
|
+
*/
|
|
124
|
+
height?: SizeInput<'height'>;
|
|
116
125
|
} & NeoButtonGroupContext & HTMLFlexProps & HTMLNeoBaseElement<HTMLElementTagNameMap[Tag]> & HTMLActionProps & HTMLRefProps;
|