@splendidlabz/svelte 3.0.0-alpha.3 → 3.0.0-beta.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/actions/index.js +2 -0
  3. package/actions/sync.svelte.js +21 -0
  4. package/actions/use-actions.js +27 -0
  5. package/{components/_shared/use-actions.js → actions/use-transition.js} +1 -0
  6. package/components/Accordion/Accordion.svelte +3 -3
  7. package/components/Disclosure/Disclosure/DisclosureCloseButton.svelte +37 -0
  8. package/components/Disclosure/Disclosure/DisclosureContent.svelte +97 -0
  9. package/components/Disclosure/Disclosure/DisclosureTrigger.svelte +51 -0
  10. package/components/Disclosure/Disclosure/disclosure-popover.svelte.js +7 -0
  11. package/components/Disclosure/Disclosure/disclosure.svelte.js +461 -0
  12. package/components/Disclosure/Disclosure/index.js +4 -0
  13. package/components/Disclosure/DisclosureNew/DisclosureCloseButton.svelte +38 -0
  14. package/components/Disclosure/DisclosureNew/DisclosureContent.svelte +53 -0
  15. package/components/Disclosure/DisclosureNew/DisclosureTrigger.svelte +79 -0
  16. package/components/Disclosure/DisclosureNew/disclosures.svelte.js +55 -0
  17. package/components/Disclosure/DisclosureNew/index.js +5 -0
  18. package/components/Disclosure/Drawer/Drawer.svelte +18 -22
  19. package/components/Disclosure/Drawer/DrawerCloseButton.svelte +2 -2
  20. package/components/Disclosure/Drawer/DrawerContent.svelte +41 -77
  21. package/components/Disclosure/Drawer/DrawerNew.svelte +0 -0
  22. package/components/Disclosure/Drawer/DrawerTrigger.svelte +7 -46
  23. package/components/Disclosure/Drawer/drawer.js +2 -70
  24. package/components/Disclosure/DrawerNew/Drawer.svelte +39 -0
  25. package/components/Disclosure/DrawerNew/DrawerClose.svelte +0 -0
  26. package/components/Disclosure/DrawerNew/DrawerTrigger.svelte +16 -0
  27. package/components/Disclosure/DrawerNew/drawer.js +44 -0
  28. package/components/Disclosure/DrawerNew/index.js +5 -0
  29. package/components/Disclosure/Modal/Modal.svelte +30 -0
  30. package/components/Disclosure/Modal/ModalCloseButton.svelte +7 -0
  31. package/components/Disclosure/Modal/ModalContent.svelte +40 -1
  32. package/components/Disclosure/Modal/ModalTrigger.svelte +7 -29
  33. package/components/Disclosure/Modal/index.js +5 -0
  34. package/components/Disclosure/Modal/modal.js +3 -12
  35. package/components/Disclosure/ModalNew/Modal.svelte +110 -0
  36. package/components/Disclosure/ModalNew/ModalClose.svelte +42 -0
  37. package/components/Disclosure/ModalNew/ModalTrigger.svelte +68 -0
  38. package/components/Disclosure/ModalNew/index.js +5 -0
  39. package/components/Disclosure/Popover/PopoverContent.svelte +2 -2
  40. package/components/Disclosure/Popover/PopoverTrigger.svelte +1 -1
  41. package/components/Disclosure/PopoverNew/Popover.svelte +105 -0
  42. package/components/Disclosure/PopoverNew/PopoverClose.svelte +38 -0
  43. package/components/Disclosure/PopoverNew/PopoverTrigger.svelte +67 -0
  44. package/components/Disclosure/PopoverNew/floating.js +329 -0
  45. package/components/Disclosure/PopoverNew/index.js +5 -0
  46. package/components/Disclosure/disclosure.js +1 -1
  47. package/components/Disclosure/disclosure.svelte.js +3 -3
  48. package/components/Disclosure/index.js +7 -3
  49. package/components/Disclosure/shared.js +9 -0
  50. package/components/Form/Checkbox.svelte +72 -57
  51. package/components/Form/Checkboxes.svelte +42 -24
  52. package/components/Form/HiddenInput.svelte +1 -1
  53. package/components/Form/Radio.svelte +62 -45
  54. package/components/Form/Radios.svelte +42 -24
  55. package/components/Form/Select.svelte +125 -77
  56. package/components/Form/SelectOld2.svelte +127 -0
  57. package/components/Form/TextInput.svelte +1 -1
  58. package/components/Form/Textarea.svelte +1 -1
  59. package/components/Icon/IconSnippet.svelte +7 -0
  60. package/components/Portal.svelte +8 -5
  61. package/eslint.config.js +2 -0
  62. package/package.json +6 -6
  63. package/svelte.config.js +5 -0
  64. package/utils/merge-opts.js +9 -1
  65. package/utils/transitions.js +75 -4
  66. package/.eslintrc.cjs +0 -3
  67. package/components/_shared/accessibility.js +0 -10
@@ -1,68 +1,85 @@
1
1
  <script>
2
- import { toTitle } from '@splendidlabz/utils'
2
+ import { toSentence } from '@splendidlabz/utils'
3
3
  import { randomString } from '@splendidlabz/utils/dom'
4
4
  import SVG from '../Icon/Icon.svelte'
5
5
  import TextInput from './TextInput.svelte'
6
6
 
7
- let klass = ''
8
- export { klass as class }
7
+ let {
8
+ label = null,
9
+ group = $bindable(null),
10
+ ref = $bindable(null),
11
+ checked = $bindable(false),
12
+ ...p
13
+ } = $props()
9
14
 
10
- export let labelClass = ''
11
- export let fieldClass = ''
12
- export let icon = null
13
- export let iconClass = ''
15
+ const {
16
+ class: klass = '',
17
+ icon = null,
18
+ iconClass = null,
19
+ fieldClass = '',
20
+ labelClass = '',
14
21
 
15
- export let id = null
16
- export let name
17
- export let label = null
18
- export let value = null
19
- export let checked = false
20
- export let readonly = null
21
- export let disabled = null
22
- export let ref = null
23
- export let group = null
24
- export let hasInput = false
22
+ id = randomString(8),
23
+ name,
24
+ value = null,
25
+ readonly = null,
26
+ disabled = null,
27
+ hasInput = false,
25
28
 
26
- id = id || randomString(8)
29
+ // Event listeners
30
+ onchange = null,
31
+
32
+ ...rest
33
+ } = p
27
34
 
28
35
  if (!name) throw new Error('Radio requires a name')
29
36
  if (!value) throw new Error('Radio requires a value')
30
37
 
31
38
  // Create label if not provided
32
- if (!label && label !== '') label = toTitle(value)
39
+ if (!label && label !== '') label = toSentence(value)
40
+
41
+ // Sends the checked value upwards
42
+ function handleChange(event) {
43
+ checked = ref.checked
44
+ if (onchange) onchange(event)
45
+ }
33
46
  </script>
34
47
 
35
- <div class="Radio {klass}" class:checked class:disabled class:readonly>
36
- <div class="Radiomark">
37
- <input
38
- class="input {fieldClass}"
39
- type="radio"
40
- {id}
41
- {name}
42
- {checked}
43
- disabled={disabled || readonly}
44
- {value}
45
- bind:group
46
- bind:this={ref}
47
- on:change
48
- {...$$restProps}
49
- />
48
+ <div class="radio {klass}" class:checked class:disabled class:readonly>
49
+ <div class="group">
50
+ <div class="radiomark-container">
51
+ <input
52
+ {...rest}
53
+ class="input {fieldClass}"
54
+ type="radio"
55
+ {id}
56
+ {name}
57
+ {checked}
58
+ disabled={disabled || readonly}
59
+ {value}
60
+ bind:group
61
+ bind:this={ref}
62
+ onchange={handleChange}
63
+ />
50
64
 
51
- {#if readonly && checked}
52
- <input type="hidden" {name} {value} {checked} />
53
- {/if}
65
+ {#if readonly && checked}
66
+ <input type="hidden" {name} {value} {checked} />
67
+ {/if}
54
68
 
55
- {#if icon}
56
- <SVG class={iconClass} {icon} />
57
- {:else}
58
- <div class="radio"></div>
69
+ {#if icon}
70
+ <SVG class="radiomark {iconClass}" {icon} />
71
+ {:else}
72
+ <svg class="radiomark" viewBox="0 0 24 24">
73
+ <circle cx="12" cy="12" r="5" />
74
+ </svg>
75
+ {/if}
76
+ </div>
77
+
78
+ {#if label}
79
+ <label class="label {labelClass}" for={id}> {label} </label>
59
80
  {/if}
60
81
  </div>
61
82
 
62
- {#if label}
63
- <label class="label {labelClass}" for={id}> {label} </label>
64
- {/if}
65
-
66
83
  {#if hasInput}
67
84
  <TextInput name="{name}-input" />
68
85
  {/if}
@@ -1,49 +1,67 @@
1
1
  <script>
2
2
  import Radio from './Radio.svelte'
3
3
 
4
- let klass = ''
5
- export { klass as class }
6
- export let legendClass = ''
7
- export let radiosClass = ''
8
- export let icon = null
9
- export let iconClass = ''
10
-
11
- export let legend = ''
12
- export let name // Name of the radio group
13
- export let radios // Array of objects that contain name and label
14
- export let checked = null
15
- export let disabled = null
16
- export let readonly = null
17
- export let ref = null
18
-
19
- const props = {
4
+ let {
5
+ legend = '',
6
+ legendClass = '',
7
+ label = '',
8
+ labelClass = '',
9
+ items = $bindable([]),
10
+ radios = $bindable([]),
11
+ ref = $bindable(null),
12
+ checked = $bindable(null),
13
+ ...p
14
+ } = $props()
15
+
16
+ // Let users use either items or radios
17
+ if (radios.length) items = radios
18
+ if (!items.length && !radios.length) {
19
+ console.warn('No radios or items provided to <Radios />')
20
+ }
21
+
22
+ // Let users use either label or legend
23
+ if (label) legend = label
24
+ if (labelClass) legendClass = labelClass
25
+
26
+ const {
27
+ class: klass = '',
28
+ radiosClass = '',
29
+ icon,
30
+ iconClass = '',
31
+ name,
32
+ disabled = null,
33
+ readonly = null,
34
+ ...rest
35
+ } = p
36
+
37
+ const radioProps = {
20
38
  icon,
21
39
  iconClass,
22
40
  disabled,
23
41
  readonly,
24
42
  }
25
43
 
26
- radios = radios.map(radio => {
44
+ items = items.map(radio => {
27
45
  if (typeof radio === 'string') radio = { value: radio }
28
46
  return { ref: null, ...radio }
29
47
  })
30
48
 
31
- checked = radios.find(radio => radio.checked)?.value
49
+ checked = items.find(radio => radio.checked)?.value
32
50
  </script>
33
51
 
34
- <fieldset class="fieldset {klass}" bind:this={ref} {...$$restProps}>
52
+ <fieldset {...rest} class="fieldset {klass}" bind:this={ref}>
35
53
  {#if legend}
36
- <legend class="Legend {legendClass}">{legend}</legend>
54
+ <legend class="legend {legendClass}">{legend}</legend>
37
55
  {/if}
38
56
 
39
- <div class="Radios {radiosClass}">
40
- {#each radios as radio}
57
+ <div class="radios {radiosClass}">
58
+ {#each items as radio}
41
59
  <Radio
42
- {...props}
60
+ {...radioProps}
43
61
  {...radio}
44
62
  {name}
45
- bind:ref={radio.ref}
46
63
  bind:group={checked}
64
+ bind:ref={radio.ref}
47
65
  />
48
66
  {/each}
49
67
  </div>
@@ -1,29 +1,56 @@
1
1
  <script>
2
2
  import { toTitle } from '@splendidlabz/utils'
3
3
  import { randomString } from '@splendidlabz/utils/dom'
4
- import SVG from '../Icon/Icon.svelte'
5
- import Hidden from './Hidden.svelte'
6
-
7
- let klass = ''
8
- export { klass as class }
9
- export let icon = null // tabler-selector, ph:caret-up-down
10
- export let iconClass = null
11
-
12
- export let label = ''
13
- export let id = ''
14
- export let name
15
- export let selected = null
16
- export let items = []
17
- export let required = null
18
- export let readonly = null
19
- export let disabled = null
20
- export let multiple = null
21
- export let size = 0 // Number of lines to show, useful for multiselect, 0, but show 4 lines by default.
22
- export let ref = null
23
-
24
- id = id || randomString(8)
25
-
26
- // Autofix multiple
4
+ import Icon from '../Icon/Icon.svelte'
5
+ import HiddenInput from './HiddenInput.svelte'
6
+
7
+ // TODO: Test Binding
8
+ let {
9
+ name = '',
10
+ items = $bindable([]),
11
+ options = $bindable([]),
12
+ selected = $bindable(null),
13
+ ref = $bindable(null),
14
+ ...p
15
+ } = $props()
16
+
17
+ // Allows users to use either options or items the property
18
+ if (options.length) items = options
19
+
20
+ if (!options.length && !items.length) {
21
+ console.error('Select requires items to be passed in.')
22
+ }
23
+
24
+ const {
25
+ // Classes
26
+ class: klass = '',
27
+ icon = null,
28
+ iconClass = null,
29
+ label = '',
30
+ labelClass,
31
+ labelVisible = true,
32
+ hint = null,
33
+ hintClass,
34
+ fieldClass = null,
35
+
36
+ // Options and props
37
+ id = randomString(8),
38
+ required = null,
39
+ readonly = null,
40
+ disabled = null,
41
+ multiple = null,
42
+ size = 0, // Number of lines to show, useful for multiselect, 0, but show 4 lines by default.
43
+ ...rest
44
+ } = p
45
+
46
+ const single = !multiple
47
+ const hintId = hint ? id + '-hint' : ''
48
+ const describedBy = `${hintId}`.trim() || null
49
+
50
+ // ========================================
51
+ // Some Checks & Normalizations
52
+ // ========================================
53
+ // Fixes multiple name and selected values
27
54
  if (multiple) {
28
55
  if (!name.endsWith('[]')) name = name += '[]'
29
56
  if (!Array.isArray(selected)) selected = []
@@ -39,9 +66,7 @@
39
66
  if (selected.includes(option.value)) option.selected = true
40
67
  if (option.selected && !selected.includes(option.value))
41
68
  selected.push(option.value)
42
- }
43
-
44
- if (!multiple) {
69
+ } else {
45
70
  if (option.value === selected) option.selected = true
46
71
  if (option.selected) selected = option.value
47
72
  }
@@ -50,78 +75,101 @@
50
75
  })
51
76
 
52
77
  // If none selected, preselect first item that is not disabled. (Single only)
53
- if (!multiple && !selected) {
78
+ setSelected: if (!multiple && !selected) {
54
79
  const firstNotDisabled = items.findIndex(item => !item.disabled)
80
+ if (firstNotDisabled === -1) break setSelected
55
81
  const s = items[firstNotDisabled] || items[0]
56
82
  s.selected = true
57
83
  selected = s.value
58
84
  }
59
85
 
60
- const props = {
86
+ // Properties for the select element
87
+ const properties = {
88
+ ...rest,
61
89
  id,
62
90
  name,
63
91
  required,
64
92
  size,
93
+ class: 'input ' + fieldClass,
65
94
  disabled: disabled || readonly,
66
95
  }
67
96
  </script>
68
97
 
69
- <div class="text-field Select {klass}">
70
- <label class="label" for={id}>{label}</label>
71
- <div class="input-group items-center" class:Stack={!multiple}>
72
- {#if !multiple}
73
- <select {...props} bind:value={selected} on:change {...$$restProps}>
74
- {#each items as option}
75
- {@const { label: optionLabel, ...rest } = option}
76
- <option {...rest} value={option.value}>
77
- {optionLabel}
78
- </option>
79
- {/each}
80
- </select>
98
+ {#snippet select()}
99
+ <select
100
+ {...properties}
101
+ bind:value={selected}
102
+ bind:this={ref}
103
+ aria-describedby={describedBy}
104
+ >
105
+ {#each items as option}
106
+ {@const { label: optionLabel, value, ...optionRest } = option}
107
+ <option {...optionRest} {value}>{optionLabel}</option>
108
+ {/each}
109
+ </select>
110
+ {/snippet}
111
+
112
+ <!-- Svelte requires multiple to be passed as a standard attribute for it to bind to an array value, hence the duplication here -->
113
+ {#snippet selectMultiple()}
114
+ <select
115
+ {...properties}
116
+ bind:value={selected}
117
+ bind:this={ref}
118
+ aria-describedby={describedBy}
119
+ multiple
120
+ >
121
+ {#each items as option}
122
+ {@const { label: optionLabel, value, ...optionRest } = option}
123
+ <option {...optionRest} {value}>{optionLabel}</option>
124
+ {/each}
125
+ </select>
126
+ {/snippet}
127
+
128
+ {#snippet selectIcon()}
129
+ {#if icon}
130
+ <Icon class={iconClass} {icon} />
131
+ {:else}
132
+ <svg class={iconClass} width="24" height="24" viewBox="0 0 24 24">
133
+ <path
134
+ d="M8 9L12 5L16 9M16 15L12 19L8 15"
135
+ stroke="currentcolor"
136
+ stroke-width="2"
137
+ stroke-linecap="round"
138
+ stroke-linejoin="round"
139
+ />
140
+ </svg>
141
+ {/if}
142
+ {/snippet}
143
+
144
+ <div class="input-container select {klass}">
145
+ {#if label && labelVisible}
146
+ <label class="label input-meta {labelClass}" for={id}>{label}</label>
147
+ {/if}
148
+ {#if hint}
149
+ <div id={hintId} class="hint input-meta {hintClass}">{hint}</div>
150
+ {/if}
151
+
152
+ <div class="input-group items-center stack" class:disabled class:readonly>
153
+ <!-- Single Select -->
154
+ {#if single}
155
+ {@render select()}
81
156
  {#if readonly}
82
- <Hidden {name} value={selected} />
157
+ <HiddenInput {name} value={selected} />
83
158
  {/if}
84
- {:else}
85
- <!-- Svelte requires multiple to be passed as a standard attribute for it to bind to an array value, hence the duplication here. -->
86
- <select
87
- {...props}
88
- multiple
89
- bind:value={selected}
90
- on:change
91
- bind:this={ref}
92
- {...$$restProps}
93
- >
94
- {#each items as option}
95
- {@const { label: optionLabel, ...rest } = option}
96
- <option {...rest} value={option.value}>
97
- {optionLabel}
98
- </option>
99
- {/each}
100
- </select>
101
159
 
160
+ <div class="pos-right pointer-events-none z-[3]">
161
+ {@render selectIcon()}
162
+ </div>
163
+ {/if}
164
+
165
+ <!-- Multi Select -->
166
+ {#if multiple}
167
+ {@render selectMultiple()}
102
168
  {#if readonly}
103
169
  {#each selected as item}
104
- <Hidden {name} value={item} />
170
+ <HiddenInput {name} value={item} />
105
171
  {/each}
106
172
  {/if}
107
173
  {/if}
108
-
109
- {#if !multiple}
110
- <div class="Pos-right pointer-events-none" class:disabled class:readonly>
111
- {#if icon}
112
- <SVG class={iconClass} {icon} />
113
- {:else}
114
- <svg class={iconClass} width="24" height="24" viewBox="0 0 24 24">
115
- <path
116
- d="M8 9L12 5L16 9M16 15L12 19L8 15"
117
- stroke="currentcolor"
118
- stroke-width="2"
119
- stroke-linecap="round"
120
- stroke-linejoin="round"
121
- />
122
- </svg>
123
- {/if}
124
- </div>
125
- {/if}
126
174
  </div>
127
175
  </div>
@@ -0,0 +1,127 @@
1
+ <script>
2
+ import { toTitle } from '@splendidlabz/utils'
3
+ import { randomString } from '@splendidlabz/utils/dom'
4
+ import SVG from '../Icon/Icon.svelte'
5
+ import Hidden from './Hidden.svelte'
6
+
7
+ let klass = ''
8
+ export { klass as class }
9
+ export let icon = null // tabler-selector, ph:caret-up-down
10
+ export let iconClass = null
11
+
12
+ export let label = ''
13
+ export let id = ''
14
+ export let name
15
+ export let selected = null
16
+ export let items = []
17
+ export let required = null
18
+ export let readonly = null
19
+ export let disabled = null
20
+ export let multiple = null
21
+ export let size = 0 // Number of lines to show, useful for multiselect, 0, but show 4 lines by default.
22
+ export let ref = null
23
+
24
+ id = id || randomString(8)
25
+
26
+ // Autofix multiple
27
+ if (multiple) {
28
+ if (!name.endsWith('[]')) name = name += '[]'
29
+ if (!Array.isArray(selected)) selected = []
30
+ }
31
+
32
+ // Normalize items
33
+ items = items.map(option => {
34
+ if (typeof option === 'string') option = { value: option }
35
+ if (!option.label) option.label = toTitle(option.value)
36
+
37
+ // Updated selected & item.selected
38
+ if (multiple) {
39
+ if (selected.includes(option.value)) option.selected = true
40
+ if (option.selected && !selected.includes(option.value))
41
+ selected.push(option.value)
42
+ }
43
+
44
+ if (!multiple) {
45
+ if (option.value === selected) option.selected = true
46
+ if (option.selected) selected = option.value
47
+ }
48
+
49
+ return option
50
+ })
51
+
52
+ // If none selected, preselect first item that is not disabled. (Single only)
53
+ if (!multiple && !selected) {
54
+ const firstNotDisabled = items.findIndex(item => !item.disabled)
55
+ const s = items[firstNotDisabled] || items[0]
56
+ s.selected = true
57
+ selected = s.value
58
+ }
59
+
60
+ const props = {
61
+ id,
62
+ name,
63
+ required,
64
+ size,
65
+ disabled: disabled || readonly,
66
+ }
67
+ </script>
68
+
69
+ <div class="text-field Select {klass}">
70
+ <label class="label" for={id}>{label}</label>
71
+ <div class="input-group items-center" class:Stack={!multiple}>
72
+ {#if !multiple}
73
+ <select {...props} bind:value={selected} on:change {...$$restProps}>
74
+ {#each items as option}
75
+ {@const { label: optionLabel, ...rest } = option}
76
+ <option {...rest} value={option.value}>
77
+ {optionLabel}
78
+ </option>
79
+ {/each}
80
+ </select>
81
+ {#if readonly}
82
+ <Hidden {name} value={selected} />
83
+ {/if}
84
+ {:else}
85
+ <!-- Svelte requires multiple to be passed as a standard attribute for it to bind to an array value, hence the duplication here. -->
86
+ <select
87
+ {...props}
88
+ multiple
89
+ bind:value={selected}
90
+ on:change
91
+ bind:this={ref}
92
+ {...$$restProps}
93
+ >
94
+ {#each items as option}
95
+ {@const { label: optionLabel, ...rest } = option}
96
+ <option {...rest} value={option.value}>
97
+ {optionLabel}
98
+ </option>
99
+ {/each}
100
+ </select>
101
+
102
+ {#if readonly}
103
+ {#each selected as item}
104
+ <Hidden {name} value={item} />
105
+ {/each}
106
+ {/if}
107
+ {/if}
108
+
109
+ {#if !multiple}
110
+ <div class="Pos-right pointer-events-none" class:disabled class:readonly>
111
+ {#if icon}
112
+ <SVG class={iconClass} {icon} />
113
+ {:else}
114
+ <svg class={iconClass} width="24" height="24" viewBox="0 0 24 24">
115
+ <path
116
+ d="M8 9L12 5L16 9M16 15L12 19L8 15"
117
+ stroke="currentcolor"
118
+ stroke-width="2"
119
+ stroke-linecap="round"
120
+ stroke-linejoin="round"
121
+ />
122
+ </svg>
123
+ {/if}
124
+ </div>
125
+ {/if}
126
+ </div>
127
+ </div>
@@ -1,6 +1,6 @@
1
1
  <script>
2
2
  import { randomString } from '@splendidlabz/utils/dom'
3
- import { useActions } from '../_shared/use-actions'
3
+ import { useActions } from '../../actions/use-actions'
4
4
 
5
5
  let { value = $bindable(''), ref = $bindable(null), ...p } = $props()
6
6
  const {
@@ -1,7 +1,7 @@
1
1
  <script>
2
2
  import { randomString } from '@splendidlabz/utils/dom'
3
+ import { useActions } from '../../actions/use-actions'
3
4
  import { mergeOpts } from '../../utils'
4
- import { useActions } from '../_shared/use-actions'
5
5
 
6
6
  let { value = $bindable(''), ref = $bindable(null), ...p } = $props()
7
7
  const {
@@ -0,0 +1,7 @@
1
+ <script>
2
+ export { IconSnippet }
3
+ </script>
4
+
5
+ {#snippet IconSnippet({ icon, iconClass, children })}
6
+ aoeunsthaoeusnthaoeu
7
+ {/snippet}
@@ -1,9 +1,12 @@
1
1
  <script>
2
2
  import { onDestroy, onMount } from 'svelte'
3
3
 
4
- let klass = ''
5
- export { klass as class } // Allows you to specify portal class
6
- export let target = null // CSS Selector
4
+ const {
5
+ class: klass = '', // Allows you to specify portal class
6
+ target = null, // CSS Selector
7
+ children,
8
+ ...rest
9
+ } = $props()
7
10
 
8
11
  let portal
9
12
  let portalParent
@@ -22,6 +25,6 @@
22
25
  })
23
26
  </script>
24
27
 
25
- <div class="Portal {klass}" bind:this={portal} {...$$restProps}>
26
- <slot />
28
+ <div {...rest} class="portal {klass}" bind:this={portal}>
29
+ {@render children()}
27
30
  </div>
@@ -0,0 +1,2 @@
1
+ import config from '@splendidlabz/eslint-config'
2
+ export default config
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@splendidlabz/svelte",
3
3
  "type": "module",
4
- "version": "3.0.0-alpha.3",
4
+ "version": "3.0.0-beta.6",
5
5
  "sideEffects": false,
6
6
  "scripts": {
7
7
  "lint": "eslint . --fix",
@@ -19,15 +19,15 @@
19
19
  "@floating-ui/dom": "^1.6.13",
20
20
  "@iconify/svelte": "^4.2.0",
21
21
  "@splendidlabz/layouts": "*",
22
- "@splendidlabz/styles": "3.0.0-alpha.3",
23
- "@splendidlabz/utils": "1.5.0-alpha.1",
22
+ "@splendidlabz/styles": "3.0.0-alpha.5",
23
+ "@splendidlabz/utils": "1.5.0-alpha.3",
24
24
  "autosuggest-highlight": "^3.3.4",
25
25
  "lodash-es": "^4.17.21",
26
26
  "node-html-parser": "^7.0.1"
27
27
  },
28
28
  "devDependencies": {
29
- "@splendidlabz/eslint-config": "*",
30
- "svelte": "^5.20.5",
31
- "vitest": "^3.0.7"
29
+ "@splendidlabz/eslint-config": "2.0.0-alpha.0",
30
+ "svelte": "^5.25.6",
31
+ "vitest": "^3.1.1"
32
32
  }
33
33
  }