@dvcol/neo-svelte 0.1.1

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.
Files changed (163) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/LICENSE +21 -0
  3. package/README.md +89 -0
  4. package/dist/assets/neo-icon-resizer-bottom-right.svg +5 -0
  5. package/dist/buttons/NeoButton.svelte +466 -0
  6. package/dist/buttons/NeoButton.svelte.d.ts +19 -0
  7. package/dist/buttons/NeoButtonGroup.svelte +369 -0
  8. package/dist/buttons/NeoButtonGroup.svelte.d.ts +19 -0
  9. package/dist/buttons/index.d.ts +4 -0
  10. package/dist/buttons/index.js +2 -0
  11. package/dist/buttons/neo-button-group.model.d.ts +71 -0
  12. package/dist/buttons/neo-button-group.model.js +1 -0
  13. package/dist/buttons/neo-button.model.d.ts +110 -0
  14. package/dist/buttons/neo-button.model.js +1 -0
  15. package/dist/cards/NeoCard.svelte +413 -0
  16. package/dist/cards/NeoCard.svelte.d.ts +19 -0
  17. package/dist/cards/index.d.ts +2 -0
  18. package/dist/cards/index.js +1 -0
  19. package/dist/cards/neo-card.model.d.ts +129 -0
  20. package/dist/cards/neo-card.model.js +1 -0
  21. package/dist/containers/NeoTransitionContainer.svelte +34 -0
  22. package/dist/containers/NeoTransitionContainer.svelte.d.ts +19 -0
  23. package/dist/containers/index.d.ts +2 -0
  24. package/dist/containers/index.js +1 -0
  25. package/dist/containers/neo-transition-container.model.d.ts +25 -0
  26. package/dist/containers/neo-transition-container.model.js +1 -0
  27. package/dist/divider/NeoDivider.svelte +47 -0
  28. package/dist/divider/NeoDivider.svelte.d.ts +19 -0
  29. package/dist/divider/index.d.ts +2 -0
  30. package/dist/divider/index.js +1 -0
  31. package/dist/divider/neo-divider.model.d.ts +7 -0
  32. package/dist/divider/neo-divider.model.js +1 -0
  33. package/dist/icons/IconAccount.svelte +10 -0
  34. package/dist/icons/IconAccount.svelte.d.ts +26 -0
  35. package/dist/icons/IconAdd.svelte +10 -0
  36. package/dist/icons/IconAdd.svelte.d.ts +26 -0
  37. package/dist/icons/IconAlert.svelte +14 -0
  38. package/dist/icons/IconAlert.svelte.d.ts +26 -0
  39. package/dist/icons/IconCircleLoading.svelte +16 -0
  40. package/dist/icons/IconCircleLoading.svelte.d.ts +26 -0
  41. package/dist/icons/IconClear.svelte +10 -0
  42. package/dist/icons/IconClear.svelte.d.ts +26 -0
  43. package/dist/icons/IconClose.svelte +14 -0
  44. package/dist/icons/IconClose.svelte.d.ts +26 -0
  45. package/dist/icons/IconConfirm.svelte +10 -0
  46. package/dist/icons/IconConfirm.svelte.d.ts +26 -0
  47. package/dist/icons/IconEmpty.svelte +10 -0
  48. package/dist/icons/IconEmpty.svelte.d.ts +26 -0
  49. package/dist/icons/IconFileUpload.svelte +18 -0
  50. package/dist/icons/IconFileUpload.svelte.d.ts +26 -0
  51. package/dist/icons/IconGithub.svelte +29 -0
  52. package/dist/icons/IconGithub.svelte.d.ts +26 -0
  53. package/dist/icons/IconImage.svelte +18 -0
  54. package/dist/icons/IconImage.svelte.d.ts +26 -0
  55. package/dist/icons/IconMinus.svelte +14 -0
  56. package/dist/icons/IconMinus.svelte.d.ts +26 -0
  57. package/dist/icons/IconMoon.svelte +64 -0
  58. package/dist/icons/IconMoon.svelte.d.ts +26 -0
  59. package/dist/icons/IconSave.svelte +15 -0
  60. package/dist/icons/IconSave.svelte.d.ts +26 -0
  61. package/dist/icons/IconSaveOff.svelte +19 -0
  62. package/dist/icons/IconSaveOff.svelte.d.ts +26 -0
  63. package/dist/icons/IconSearch.svelte +14 -0
  64. package/dist/icons/IconSearch.svelte.d.ts +26 -0
  65. package/dist/icons/IconSun.svelte +54 -0
  66. package/dist/icons/IconSun.svelte.d.ts +26 -0
  67. package/dist/icons/IconSunrise.svelte +24 -0
  68. package/dist/icons/IconSunrise.svelte.d.ts +26 -0
  69. package/dist/icons/IconVideo.svelte +15 -0
  70. package/dist/icons/IconVideo.svelte.d.ts +26 -0
  71. package/dist/icons/IconWatch.svelte +21 -0
  72. package/dist/icons/IconWatch.svelte.d.ts +26 -0
  73. package/dist/icons/IconWatchOff.svelte +26 -0
  74. package/dist/icons/IconWatchOff.svelte.d.ts +26 -0
  75. package/dist/index.d.ts +8 -0
  76. package/dist/index.js +8 -0
  77. package/dist/inputs/NeoInput.svelte +750 -0
  78. package/dist/inputs/NeoInput.svelte.d.ts +27 -0
  79. package/dist/inputs/NeoPassword.svelte +31 -0
  80. package/dist/inputs/NeoPassword.svelte.d.ts +19 -0
  81. package/dist/inputs/NeoTextarea.svelte +768 -0
  82. package/dist/inputs/NeoTextarea.svelte.d.ts +27 -0
  83. package/dist/inputs/NeoValidation.svelte +106 -0
  84. package/dist/inputs/NeoValidation.svelte.d.ts +22 -0
  85. package/dist/inputs/index.d.ts +4 -0
  86. package/dist/inputs/index.js +3 -0
  87. package/dist/inputs/neo-input.model.d.ts +234 -0
  88. package/dist/inputs/neo-input.model.js +10 -0
  89. package/dist/inputs/neo-validation.model.d.ts +40 -0
  90. package/dist/inputs/neo-validation.model.js +1 -0
  91. package/dist/nav/NeoTab.svelte +170 -0
  92. package/dist/nav/NeoTab.svelte.d.ts +19 -0
  93. package/dist/nav/NeoTabPanel.svelte +75 -0
  94. package/dist/nav/NeoTabPanel.svelte.d.ts +19 -0
  95. package/dist/nav/NeoTabs.svelte +288 -0
  96. package/dist/nav/NeoTabs.svelte.d.ts +19 -0
  97. package/dist/nav/NeoTabsCard.svelte +47 -0
  98. package/dist/nav/NeoTabsCard.svelte.d.ts +19 -0
  99. package/dist/nav/index.d.ts +8 -0
  100. package/dist/nav/index.js +4 -0
  101. package/dist/nav/neo-tab-panel.model.d.ts +30 -0
  102. package/dist/nav/neo-tab-panel.model.js +1 -0
  103. package/dist/nav/neo-tab.model.d.ts +43 -0
  104. package/dist/nav/neo-tab.model.js +1 -0
  105. package/dist/nav/neo-tabs-card.model.d.ts +25 -0
  106. package/dist/nav/neo-tabs-card.model.js +5 -0
  107. package/dist/nav/neo-tabs-context.svelte.d.ts +82 -0
  108. package/dist/nav/neo-tabs-context.svelte.js +163 -0
  109. package/dist/nav/neo-tabs.model.d.ts +60 -0
  110. package/dist/nav/neo-tabs.model.js +1 -0
  111. package/dist/providers/NeoThemeProvider.svelte +28 -0
  112. package/dist/providers/NeoThemeProvider.svelte.d.ts +21 -0
  113. package/dist/providers/NeoThemeSelector.svelte +79 -0
  114. package/dist/providers/NeoThemeSelector.svelte.d.ts +19 -0
  115. package/dist/providers/index.d.ts +5 -0
  116. package/dist/providers/index.js +3 -0
  117. package/dist/providers/neo-theme-provider-context.svelte.d.ts +26 -0
  118. package/dist/providers/neo-theme-provider-context.svelte.js +78 -0
  119. package/dist/providers/neo-theme-provider.model.d.ts +35 -0
  120. package/dist/providers/neo-theme-provider.model.js +20 -0
  121. package/dist/providers/neo-theme-selector.model.d.ts +6 -0
  122. package/dist/providers/neo-theme-selector.model.js +1 -0
  123. package/dist/skeletons/NeoSkeletonContainer.svelte +48 -0
  124. package/dist/skeletons/NeoSkeletonContainer.svelte.d.ts +19 -0
  125. package/dist/skeletons/NeoSkeletonMedia.svelte +146 -0
  126. package/dist/skeletons/NeoSkeletonMedia.svelte.d.ts +19 -0
  127. package/dist/skeletons/NeoSkeletonText.svelte +170 -0
  128. package/dist/skeletons/NeoSkeletonText.svelte.d.ts +19 -0
  129. package/dist/skeletons/index.d.ts +4 -0
  130. package/dist/skeletons/index.js +2 -0
  131. package/dist/skeletons/neo-skeleton-container.model.d.ts +29 -0
  132. package/dist/skeletons/neo-skeleton-container.model.js +1 -0
  133. package/dist/skeletons/neo-skeleton-media.model.d.ts +40 -0
  134. package/dist/skeletons/neo-skeleton-media.model.js +1 -0
  135. package/dist/skeletons/neo-skeleton-text.model.d.ts +45 -0
  136. package/dist/skeletons/neo-skeleton-text.model.js +1 -0
  137. package/dist/styles/animation.scss +75 -0
  138. package/dist/styles/common/colors.scss +217 -0
  139. package/dist/styles/common/flex.scss +26 -0
  140. package/dist/styles/common/properties.css +23 -0
  141. package/dist/styles/common/shadows.scss +305 -0
  142. package/dist/styles/common/spacing.scss +27 -0
  143. package/dist/styles/common/typography.scss +13 -0
  144. package/dist/styles/common/utils.scss +8 -0
  145. package/dist/styles/common/z-index.scss +12 -0
  146. package/dist/styles/mixin.scss +225 -0
  147. package/dist/styles/reset.scss +81 -0
  148. package/dist/styles/theme.scss +22 -0
  149. package/dist/utils/action.utils.d.ts +52 -0
  150. package/dist/utils/action.utils.js +30 -0
  151. package/dist/utils/error.utils.d.ts +25 -0
  152. package/dist/utils/error.utils.js +35 -0
  153. package/dist/utils/html-element.utils.d.ts +22 -0
  154. package/dist/utils/html-element.utils.js +1 -0
  155. package/dist/utils/logger.utils.d.ts +14 -0
  156. package/dist/utils/logger.utils.js +31 -0
  157. package/dist/utils/shadow.utils.d.ts +8 -0
  158. package/dist/utils/shadow.utils.js +26 -0
  159. package/dist/utils/timeout.util.d.ts +5 -0
  160. package/dist/utils/timeout.util.js +15 -0
  161. package/dist/utils/transition.utils.d.ts +5 -0
  162. package/dist/utils/transition.utils.js +8 -0
  163. package/package.json +180 -0
@@ -0,0 +1,369 @@
1
+ <script lang="ts">
2
+ import type { NeoButtonGroupProps } from './neo-button-group.model.js';
3
+
4
+ import { toAction, toActionProps, toTransition, toTransitionProps } from '../utils/action.utils.js';
5
+
6
+ /* eslint-disable prefer-const -- necessary for binding checked */
7
+ let {
8
+ // Snippets
9
+ children,
10
+
11
+ // States
12
+ ref = $bindable(),
13
+ tag = 'div',
14
+ skeleton,
15
+
16
+ // Styles
17
+ borderless,
18
+ start,
19
+ text,
20
+ flat,
21
+ glass,
22
+ inset,
23
+ shallow,
24
+ rounded,
25
+ pulse,
26
+ coalesce,
27
+ vertical,
28
+ nowrap,
29
+
30
+ // Flex
31
+ justify,
32
+ align,
33
+ flex,
34
+
35
+ // Transition
36
+ in: inAction,
37
+ out: outAction,
38
+ transition: transitionAction,
39
+
40
+ // Actions
41
+ use,
42
+
43
+ // Other props
44
+ ...rest
45
+ }: NeoButtonGroupProps = $props();
46
+ /* eslint-enable prefer-const */
47
+
48
+ const inFn = $derived(toTransition(inAction ?? transitionAction));
49
+ const inProps = $derived(toTransitionProps(inAction ?? transitionAction));
50
+ const outFn = $derived(toTransition(outAction ?? transitionAction));
51
+ const outProps = $derived(toTransitionProps(outAction ?? transitionAction));
52
+
53
+ const useFn = $derived(toAction(use));
54
+ const useProps = $derived(toActionProps(use));
55
+ </script>
56
+
57
+ <svelte:element
58
+ this={tag}
59
+ bind:this={ref}
60
+ class:neo-button-group={true}
61
+ class:borderless
62
+ class:start
63
+ class:text
64
+ class:flat
65
+ class:glass
66
+ class:shallow
67
+ class:inset
68
+ class:rounded
69
+ class:pulse
70
+ class:coalesce
71
+ class:skeleton
72
+ class:vertical
73
+ class:nowrap
74
+ style:justify-content={justify}
75
+ style:align-items={align}
76
+ style:flex
77
+ use:useFn={useProps}
78
+ out:outFn={outProps}
79
+ in:inFn={inProps}
80
+ {...rest}
81
+ >
82
+ {@render children?.({
83
+ // States
84
+ skeleton,
85
+
86
+ // styles
87
+ start,
88
+ text,
89
+ flat,
90
+ glass,
91
+ rounded,
92
+ pulse,
93
+ coalesce,
94
+ vertical,
95
+ })}
96
+ </svelte:element>
97
+
98
+ <style>.neo-button-group.pulse:not(.skeleton)::after, .neo-button-group.pulse:not(.skeleton)::before, .neo-button-group.coalesce:not(.skeleton)::after, .neo-button-group.coalesce:not(.skeleton)::before {
99
+ position: absolute;
100
+ top: 0;
101
+ left: 0;
102
+ z-index: var(--neo-z-index-behind, -1);
103
+ display: flex;
104
+ width: 100%;
105
+ height: 100%;
106
+ border-radius: inherit;
107
+ opacity: 0;
108
+ content: "";
109
+ }
110
+
111
+ .neo-button-group {
112
+ display: inline-flex;
113
+ flex: 0 1 auto;
114
+ flex-flow: row wrap;
115
+ gap: var(--neo-btn-grp-gap, 0.25rem);
116
+ align-items: center;
117
+ justify-content: center;
118
+ box-sizing: border-box;
119
+ width: fit-content;
120
+ margin: var(--neo-shadow-margin, 0.6rem);
121
+ padding: 0.25rem;
122
+ background-color: var(--neo-btn-bg-color, transparent);
123
+ border: var(--neo-border-width, 1px) var(--neo-btn-border-color, transparent) solid;
124
+ border-radius: calc(var(--neo-btn-border-radius, var(--neo-border-radius)) + 0.25rem);
125
+ transition: color 0.3s ease, background-color 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease-out;
126
+ }
127
+ .neo-button-group.nowrap {
128
+ flex-wrap: nowrap;
129
+ justify-content: flex-start;
130
+ overflow: auto;
131
+ white-space: nowrap;
132
+ }
133
+ .neo-button-group.flat {
134
+ border-color: var(--neo-btn-border-color, var(--neo-border-color));
135
+ }
136
+ .neo-button-group.borderless, .neo-button-group.text {
137
+ border-color: transparent !important;
138
+ }
139
+ .neo-button-group:not(.text, .flat, .glass) {
140
+ box-shadow: var(--neo-box-shadow-raised-3);
141
+ }
142
+ @starting-style {
143
+ .neo-button-group.start {
144
+ box-shadow: var(--neo-box-shadow-flat);
145
+ }
146
+ .neo-button-group.start:not(.text, .glass, .borderless) {
147
+ border-color: var(--neo-btn-border-color, var(--neo-border-color));
148
+ }
149
+ }
150
+ .neo-button-group.glass {
151
+ background-color: var(--neo-btn-bg-color, var(--neo-glass-background-color));
152
+ border-color: var(--neo-btn-border-color, var(--neo-glass-top-border-color) var(--neo-glass-right-border-color) var(--neo-glass-bottom-border-color) var(--neo-glass-left-border-color));
153
+ backdrop-filter: var(--neo-blur-4) var(--neo-saturate-2);
154
+ }
155
+ .neo-button-group.glass:not(.text, .flat) {
156
+ box-shadow: var(--neo-glass-box-shadow-raised-3);
157
+ }
158
+ .neo-button-group.glass :global(.neo-button) {
159
+ background-color: transparent;
160
+ backdrop-filter: none;
161
+ }
162
+ .neo-button-group.glass :global(.neo-button:not(:active, .pressed)) {
163
+ box-shadow: var(--neo-glass-box-shadow-flat);
164
+ }
165
+ .neo-button-group :global(.neo-button) {
166
+ margin: 0;
167
+ border-color: transparent !important;
168
+ }
169
+ .neo-button-group :global(.neo-button:disabled:not(.skeleton)),
170
+ .neo-button-group :global(.neo-button[disabled]:not([disabled="false"], .skeleton)) {
171
+ border-color: transparent !important;
172
+ }
173
+ .neo-button-group :global(.neo-button:disabled:not(.skeleton, .pressed)),
174
+ .neo-button-group :global(.neo-button[disabled]:not([disabled="false"], .skeleton, .pressed)) {
175
+ box-shadow: var(--neo-box-shadow-flat) !important;
176
+ }
177
+ .neo-button-group :global(.neo-button:not(:active, .pressed)) {
178
+ box-shadow: var(--neo-box-shadow-flat);
179
+ }
180
+ .neo-button-group :global(.neo-button.loading:active:not(.pressed)),
181
+ .neo-button-group :global(.neo-button:not(.flat, .text, :active, .pressed):hover) {
182
+ box-shadow: var(--neo-box-shadow-inset-2);
183
+ }
184
+ .neo-button-group :global(.neo-button.pulse::after),
185
+ .neo-button-group :global(.neo-button.pulse::before),
186
+ .neo-button-group :global(.neo-button.coalesce::after),
187
+ .neo-button-group :global(.neo-button.coalesce::before) {
188
+ animation: none;
189
+ }
190
+ .neo-button-group.pulse:not(.skeleton) {
191
+ position: relative;
192
+ }
193
+ .neo-button-group.pulse:not(.skeleton)::after, .neo-button-group.pulse:not(.skeleton)::before {
194
+ box-shadow: var(--neo-pulse-box-shadow, var(--neo-box-shadow-raised-3));
195
+ will-change: transform, opacity;
196
+ }
197
+ .neo-button-group.pulse:not(.skeleton)::before {
198
+ animation: pulse var(--neo-pulse-duration, 6s) linear var(--neo-pulse-delay, 1s) infinite;
199
+ }
200
+ .neo-button-group.pulse:not(.skeleton)::after {
201
+ animation: pulse var(--neo-pulse-duration, 6s) linear calc(var(--neo-pulse-delay, 1s) + var(--neo-pulse-interval, 3s)) infinite;
202
+ }
203
+ .neo-button-group.pulse:not(.skeleton).pressed::after, .neo-button-group.pulse:not(.skeleton).pressed::before, .neo-button-group.pulse:not(.skeleton):focus-visible::after, .neo-button-group.pulse:not(.skeleton):focus-visible::before, .neo-button-group.pulse:not(.skeleton):hover::after, .neo-button-group.pulse:not(.skeleton):hover::before, .neo-button-group.pulse:not(.skeleton):active::after, .neo-button-group.pulse:not(.skeleton):active::before {
204
+ box-shadow: var(--neo-pulse-box-shadow-reverse, var(--neo-box-shadow-raised-3));
205
+ animation-name: coalesce;
206
+ animation-timing-function: ease-out;
207
+ }
208
+ @keyframes pulse {
209
+ 0% {
210
+ transform: scaleX(1) scaleY(1);
211
+ opacity: 0;
212
+ }
213
+ 25% {
214
+ opacity: 1;
215
+ }
216
+ 100% {
217
+ transform: scaleX(var(--neo-btn-grp-scale-x, 1.2)) scaleY(var(--neo-btn-grp-scale-y, 2));
218
+ opacity: 0;
219
+ }
220
+ }
221
+ @keyframes coalesce {
222
+ 0% {
223
+ transform: scaleX(var(--neo-btn-grp-scale-x, 1.2)) scaleY(var(--neo-btn-grp-scale-y, 2));
224
+ opacity: 0;
225
+ }
226
+ 75% {
227
+ opacity: 1;
228
+ }
229
+ 100% {
230
+ transform: scale(1);
231
+ opacity: 0;
232
+ }
233
+ }
234
+ .neo-button-group.coalesce:not(.skeleton) {
235
+ position: relative;
236
+ }
237
+ .neo-button-group.coalesce:not(.skeleton)::after, .neo-button-group.coalesce:not(.skeleton)::before {
238
+ box-shadow: var(--neo-coalesce-box-shadow, var(--neo-box-shadow-raised-3));
239
+ will-change: transform, opacity;
240
+ }
241
+ .neo-button-group.coalesce:not(.skeleton)::before {
242
+ animation: coalesce var(--neo-coalesce-duration, 6s) ease-out var(--neo-coalesce-delay, 1s) infinite;
243
+ }
244
+ .neo-button-group.coalesce:not(.skeleton)::after {
245
+ animation: coalesce var(--neo-coalesce-duration, 6s) ease-out calc(var(--neo-coalesce-delay, 1s) + var(--neo-coalesce-interval, 3s)) infinite;
246
+ }
247
+ .neo-button-group.coalesce:not(.skeleton).pressed::after, .neo-button-group.coalesce:not(.skeleton).pressed::before, .neo-button-group.coalesce:not(.skeleton):focus-visible::after, .neo-button-group.coalesce:not(.skeleton):focus-visible::before, .neo-button-group.coalesce:not(.skeleton):hover::after, .neo-button-group.coalesce:not(.skeleton):hover::before, .neo-button-group.coalesce:not(.skeleton):active::after, .neo-button-group.coalesce:not(.skeleton):active::before {
248
+ box-shadow: var(--neo-coalesce-box-shadow-reverse, var(--neo-box-shadow-raised-3));
249
+ animation-name: pulse;
250
+ animation-timing-function: linear;
251
+ }
252
+ @keyframes pulse {
253
+ 0% {
254
+ transform: scaleX(1) scaleY(1);
255
+ opacity: 0;
256
+ }
257
+ 25% {
258
+ opacity: 1;
259
+ }
260
+ 100% {
261
+ transform: scaleX(var(--neo-btn-grp-scale-x, 1.2)) scaleY(var(--neo-btn-grp-scale-y, 2));
262
+ opacity: 0;
263
+ }
264
+ }
265
+ @keyframes coalesce {
266
+ 0% {
267
+ transform: scaleX(var(--neo-btn-grp-scale-x, 1.2)) scaleY(var(--neo-btn-grp-scale-y, 2));
268
+ opacity: 0;
269
+ }
270
+ 75% {
271
+ opacity: 1;
272
+ }
273
+ 100% {
274
+ transform: scale(1);
275
+ opacity: 0;
276
+ }
277
+ }
278
+ .neo-button-group.shallow:not(.inset, .skeleton) {
279
+ --neo-coalesce-box-shadow: var(--neo-box-shadow-raised-2);
280
+ --neo-pulse-box-shadow: var(--neo-box-shadow-raised-2);
281
+ --neo-coalesce-box-shadow-reverse: var(--neo-box-shadow-inset-1);
282
+ --neo-pulse-box-shadow-reverse: var(--neo-box-shadow-inset-1);
283
+ }
284
+ .neo-button-group.shallow:not(.inset, .skeleton):not(.text, .flat, .glass) {
285
+ box-shadow: var(--neo-box-shadow-raised-2);
286
+ }
287
+ .neo-button-group.shallow:not(.inset, .skeleton).glass {
288
+ box-shadow: var(--neo-glass-box-shadow-raised-2);
289
+ }
290
+ .neo-button-group.shallow:not(.inset, .skeleton) :global(.neo-button.loading:active:not(.pressed)),
291
+ .neo-button-group.shallow:not(.inset, .skeleton) :global(.neo-button:not(.flat, .text, :active, .pressed):hover) {
292
+ box-shadow: var(--neo-box-shadow-inset-1);
293
+ }
294
+ .neo-button-group.shallow:not(.inset, .skeleton) :global(.neo-button:active),
295
+ .neo-button-group.shallow:not(.inset, .skeleton) :global(.neo-button.pressed) {
296
+ box-shadow: var(--neo-box-shadow-inset-2);
297
+ }
298
+ .neo-button-group.inset:not(.skeleton) {
299
+ box-shadow: var(--neo-box-shadow-inset-3);
300
+ }
301
+ .neo-button-group.inset:not(.skeleton).shallow {
302
+ box-shadow: var(--neo-box-shadow-inset-2);
303
+ }
304
+ .neo-button-group.inset:not(.skeleton).shallow :global(.neo-button:active),
305
+ .neo-button-group.inset:not(.skeleton).shallow :global(.neo-button.pressed) {
306
+ box-shadow: var(--neo-box-shadow-inset-2);
307
+ }
308
+ .neo-button-group.rounded {
309
+ padding: 0.25rem 0.3125rem;
310
+ border-radius: var(--neo-btn-border-radius-rounded, var(--neo-border-radius-lg));
311
+ }
312
+ .neo-button-group.rounded :global(.neo-button) {
313
+ border-radius: var(--neo-btn-border-radius-rounded, var(--neo-border-radius-lg));
314
+ }
315
+ .neo-button-group.skeleton {
316
+ box-shadow: var(--neo-box-shadow-flat);
317
+ pointer-events: none;
318
+ --neo-skeleton-color-start: var(--neo-skeleton-color);
319
+ --neo-skeleton-color-end: oklch(from var(--neo-skeleton-color) calc(l - var(--neo-skeleton-color-step, 0.05)) c h);
320
+ color: var(--neo-skeleton-color-start);
321
+ background-color: var(--neo-skeleton-color-start);
322
+ border-color: var(--neo-skeleton-color-start);
323
+ transition: background-color 1s ease, color 1s ease, border-color 1s ease;
324
+ animation: skeleton 3s var(--neo-transition-skeleton) infinite;
325
+ animation-delay: 1s;
326
+ }
327
+ .neo-button-group.skeleton::before, .neo-button-group.skeleton::after,
328
+ .neo-button-group.skeleton :global(> *::before),
329
+ .neo-button-group.skeleton :global(> *::after),
330
+ .neo-button-group.skeleton :global(> *) {
331
+ visibility: hidden;
332
+ pointer-events: none;
333
+ }
334
+ @keyframes skeleton {
335
+ 0% {
336
+ color: var(--neo-skeleton-color-start);
337
+ background-color: var(--neo-skeleton-color-start);
338
+ border-color: var(--neo-skeleton-color-start);
339
+ }
340
+ 40% {
341
+ color: var(--neo-skeleton-color-end);
342
+ background-color: var(--neo-skeleton-color-end);
343
+ border-color: var(--neo-skeleton-color-end);
344
+ }
345
+ 80% {
346
+ color: var(--neo-skeleton-color-start);
347
+ background-color: var(--neo-skeleton-color-start);
348
+ border-color: var(--neo-skeleton-color-start);
349
+ }
350
+ 100% {
351
+ color: var(--neo-skeleton-color-start);
352
+ background-color: var(--neo-skeleton-color-start);
353
+ border-color: var(--neo-skeleton-color-start);
354
+ }
355
+ }
356
+ .neo-button-group.skeleton.glass {
357
+ --neo-skeleton-color: var(--neo-glass-skeleton-color);
358
+ }
359
+ .neo-button-group.vertical {
360
+ flex-direction: column;
361
+ --neo-btn-grp-scale-x: 1.75;
362
+ --neo-btn-grp-scale-y: 1.5;
363
+ }
364
+ .neo-button-group.vertical :global(.neo-button) {
365
+ width: 100%;
366
+ }
367
+ .neo-button-group.vertical.rounded {
368
+ padding: 0.5rem;
369
+ }</style>
@@ -0,0 +1,19 @@
1
+ import type { NeoButtonGroupProps } from './neo-button-group.model.js';
2
+ interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
+ new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
+ $$bindings?: Bindings;
5
+ } & Exports;
6
+ (internal: unknown, props: Props & {
7
+ $$events?: Events;
8
+ $$slots?: Slots;
9
+ }): Exports & {
10
+ $set?: any;
11
+ $on?: any;
12
+ };
13
+ z_$$bindings?: Bindings;
14
+ }
15
+ declare const NeoButtonGroup: $$__sveltets_2_IsomorphicComponent<NeoButtonGroupProps, {
16
+ [evt: string]: CustomEvent<any>;
17
+ }, {}, {}, "ref">;
18
+ type NeoButtonGroup = InstanceType<typeof NeoButtonGroup>;
19
+ export default NeoButtonGroup;
@@ -0,0 +1,4 @@
1
+ export { default as NeoButton } from './NeoButton.svelte';
2
+ export { default as NeoButtonGroup } from './NeoButtonGroup.svelte';
3
+ export type { NeoButtonProps } from './neo-button.model.js';
4
+ export type { NeoButtonGroupProps } from './neo-button-group.model.js';
@@ -0,0 +1,2 @@
1
+ export { default as NeoButton } from './NeoButton.svelte';
2
+ export { default as NeoButtonGroup } from './NeoButtonGroup.svelte';
@@ -0,0 +1,71 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLActionProps } from '../utils/action.utils.js';
3
+ import type { HTMLFlexProps, HTMLNeoBaseElement, HTMLRefProps } from '../utils/html-element.utils.js';
4
+ export type NeoButtonGroupContext = {
5
+ /**
6
+ * The HTML tag to use for the button group.
7
+ * @default 'div'
8
+ */
9
+ tag?: keyof HTMLElementTagNameMap;
10
+ /**
11
+ * If true, the button will be disabled and a loading skeleton will be displayed instead of the text.
12
+ */
13
+ skeleton?: boolean;
14
+ /**
15
+ * If `true`, the group will never display a border.
16
+ */
17
+ borderless?: boolean;
18
+ /**
19
+ * If true, the button group will start as flat on first render.
20
+ * @see [@starting-style](https://developer.mozilla.org/en-US/docs/Web/CSS/@starting-style) for browser support
21
+ */
22
+ start?: boolean;
23
+ /**
24
+ * If true, only the button group content will be displayed.
25
+ */
26
+ text?: boolean;
27
+ /**
28
+ * If true, the button group will be displayed with no elevation.
29
+ */
30
+ flat?: boolean;
31
+ /**
32
+ * If true, the buttongroup will be displayed with a glass effect.
33
+ */
34
+ glass?: boolean;
35
+ /**
36
+ * If true, the button group will have a rounded border.
37
+ */
38
+ rounded?: boolean;
39
+ /**
40
+ * If true, the button will not depress past the initial plane.
41
+ */
42
+ shallow?: boolean;
43
+ /**
44
+ * If true, the button group will be inset and the buttons flat.
45
+ */
46
+ inset?: boolean;
47
+ /**
48
+ * If true, the button group will be surrounded by expanding waves.
49
+ * The waves will reverse direction on hover or active states.
50
+ */
51
+ pulse?: boolean;
52
+ /**
53
+ * If true, the button group will be surrounded by coalescing waves.
54
+ * The waves will reverse direction on hover or active states.
55
+ */
56
+ coalesce?: boolean;
57
+ /**
58
+ * If true, the button group will be stacked vertically.
59
+ */
60
+ vertical?: boolean;
61
+ };
62
+ export type NeoButtonGroupProps = {
63
+ /**
64
+ * Snippet to display as the button content.
65
+ */
66
+ children?: Snippet<[NeoButtonGroupContext]>;
67
+ /**
68
+ * If true, the buttons will not wrap to the next line.
69
+ */
70
+ nowrap?: boolean;
71
+ } & NeoButtonGroupContext & HTMLFlexProps & HTMLNeoBaseElement & HTMLActionProps & HTMLRefProps;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,110 @@
1
+ import type { Snippet } from 'svelte';
2
+ import type { HTMLAnchorAttributes, HTMLButtonAttributes } from 'svelte/elements';
3
+ import type { HTMLActionProps } from '../utils/action.utils.js';
4
+ import type { HTMLFlexProps, HTMLRefProps } from '../utils/html-element.utils.js';
5
+ export type NeoButtonProps = {
6
+ /**
7
+ * Snippet to display as the button content.
8
+ */
9
+ children?: Snippet;
10
+ /**
11
+ * Optional icon snippet to display before the text.
12
+ */
13
+ icon?: Snippet;
14
+ /**
15
+ * The HTML tag to use for the button.
16
+ * If an `href` is provided, the tag will default to `'a'`.
17
+ * @default 'button'
18
+ */
19
+ tag?: keyof HTMLElementTagNameMap;
20
+ /**
21
+ * If true, the button will be disabled and a spinner will be displayed alongside the text.
22
+ * If an icon is provided, the spinner will replace the icon.
23
+ */
24
+ loading?: boolean;
25
+ /**
26
+ * If true, the button will be disabled and a loading skeleton will be displayed instead of the text.
27
+ */
28
+ skeleton?: boolean;
29
+ /**
30
+ * If true, only the icon (if any) will be displayed.
31
+ */
32
+ empty?: boolean;
33
+ /**
34
+ * If true, the button will act as a toggle button.
35
+ */
36
+ toggle?: boolean;
37
+ /**
38
+ * If true, the button will ignore click events for the toggle state.
39
+ */
40
+ readonly?: boolean;
41
+ /**
42
+ * Bindable value for the toggle state.
43
+ * @bindable
44
+ */
45
+ checked?: boolean;
46
+ /**
47
+ * If `true`, the button will never display a border.
48
+ */
49
+ borderless?: boolean;
50
+ /**
51
+ * If true, the button will start as flat on first render.
52
+ * @see [@starting-style](https://developer.mozilla.org/en-US/docs/Web/CSS/@starting-style) for browser support
53
+ */
54
+ start?: boolean;
55
+ /**
56
+ * If true, only the button content will be displayed.
57
+ */
58
+ text?: boolean;
59
+ /**
60
+ * If true, the button will be displayed with no elevation.
61
+ */
62
+ flat?: boolean;
63
+ /**
64
+ * If true, the button will be displayed with a glass effect.
65
+ */
66
+ glass?: boolean;
67
+ /**
68
+ * If true, the button will have a rounded border.
69
+ */
70
+ rounded?: boolean;
71
+ /**
72
+ * If true, the button will not depress past the initial plane.
73
+ */
74
+ shallow?: boolean;
75
+ /**
76
+ * If true, the flex direction of the button will be reversed.
77
+ */
78
+ reverse?: boolean;
79
+ /**
80
+ * If true, the button will be surrounded by coalescing waves.
81
+ * The waves will reverse direction on hover or active states.
82
+ */
83
+ coalesce?: boolean;
84
+ /**
85
+ * If true, the button will be surrounded by expanding waves.
86
+ * The waves will reverse direction on hover or active states.
87
+ */
88
+ pulse?: boolean;
89
+ /**
90
+ * Callback function to be called when the toggle state changes.
91
+ * @param checked
92
+ */
93
+ onchecked?: (checked: boolean) => unknown;
94
+ /**
95
+ * Callback function to be called when the button is clicked.
96
+ * @param e
97
+ * @param checked
98
+ */
99
+ onclick?: (e: MouseEvent, checked?: boolean) => unknown;
100
+ /**
101
+ * Callback function to be called when a key is pressed.
102
+ * @param e
103
+ */
104
+ onkeydown?: (e: KeyboardEvent) => unknown;
105
+ /**
106
+ * Callback function to be called when a key is released.
107
+ * @param e
108
+ */
109
+ onkeyup?: (e: KeyboardEvent) => unknown;
110
+ } & Partial<Omit<HTMLButtonAttributes, 'onclick' | 'onkeydown' | 'onkeyup'>> & Partial<Omit<HTMLAnchorAttributes, 'onclick' | 'onkeydown' | 'onkeyup'>> & HTMLFlexProps & HTMLActionProps & HTMLRefProps;
@@ -0,0 +1 @@
1
+ export {};