poe-svelte-ui-lib 1.3.4 → 1.4.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.
@@ -6,7 +6,6 @@
6
6
  let {
7
7
  id = crypto.randomUUID(),
8
8
  isOpen = false,
9
- outline = false,
10
9
  wrapperClass = '',
11
10
  size = { width: 1, height: 1 },
12
11
  label = { name: '', class: 'text-left', icon: null },
@@ -20,17 +19,13 @@
20
19
  <div
21
20
  id={`${id}-${crypto.randomUUID().slice(0, 6)}`}
22
21
  class={twMerge(
23
- `${outline ? 'border-none' : 'rounded-xl shadow-sm hover:shadow-md'} w-full
24
- bg-(--container-color) p-0 transition-shadow duration-250`,
22
+ `w-full rounded-xl bg-(--container-color) p-0
23
+ shadow-sm transition-shadow duration-250 hover:shadow-md`,
25
24
  wrapperClass,
26
25
  )}
27
26
  transition:slide={{ duration: 250 }}
28
27
  >
29
- <button
30
- class="flex w-full cursor-pointer items-center justify-between p-4 transition-shadow duration-250
31
- {outline ? 'border-b border-(--border-color)' : ''}"
32
- onclick={toggle}
33
- >
28
+ <button class="flex w-full cursor-pointer items-center justify-between p-4 py-3.5 transition-shadow duration-250" onclick={toggle}>
34
29
  <div class="flex w-full items-center">
35
30
  <span
36
31
  class={`flex h-7 w-7 shrink-0 items-center justify-center overflow-visible [&_svg]:h-full [&_svg]:max-h-full [&_svg]:w-full [&_svg]:max-w-full`}
@@ -45,13 +40,21 @@
45
40
  {/if}
46
41
  </span>
47
42
 
48
- <span
49
- class="{twMerge('m-0 w-full cursor-pointer px-3 text-left font-semibold', label.class)} text-lg {isOpen
50
- ? 'text-blue-500 dark:text-blue-400'
51
- : ''}"
43
+ <div
44
+ class="{twMerge(
45
+ 'flex w-full justify-start ',
46
+ label.class?.split(' ').find((cls: string) => cls.startsWith('justify-')),
47
+ )} "
52
48
  >
53
- {label?.name}
54
- </span>
49
+ <span
50
+ class="{twMerge(
51
+ `m-0 origin-top-left cursor-pointer justify-end px-3 font-semibold transition duration-200 ${isOpen ? 'scale-110' : ''}`,
52
+ label.class,
53
+ )} text-lg"
54
+ >
55
+ {label?.name}
56
+ </span>
57
+ </div>
55
58
  </div>
56
59
 
57
60
  <div class="w-10 pl-4">
@@ -76,7 +79,7 @@
76
79
 
77
80
  {#if isOpen}
78
81
  <div
79
- class="grid w-full p-4 sm:p-3 {image ? 'gap-x-2' : 'gap-2'} {outline ? '' : 'border-t border-(--border-color)'}"
82
+ class="grid w-full p-4 sm:p-3 {image ? 'gap-x-2' : 'gap-2'} inset-shadow-[0_10px_10px_-15px_rgb(0_0_0_/0.5)]"
80
83
  transition:slide={{ duration: 250 }}
81
84
  style="grid-template-columns: repeat({size.width || 10}, minmax(0, 1fr));
82
85
  grid-template-rows: repeat({size.height || 2}, {image ? 'minmax(6.5rem, auto)' : 'auto'});
@@ -24,8 +24,8 @@
24
24
  const initialType = $derived($optionsStore.ACCORDION_TYPE_OPTIONS.find((t) => t.value === component.properties.outline))
25
25
 
26
26
  const initialAlign = $derived(
27
- $optionsStore.TEXT_ALIGN_OPTIONS.find((a) =>
28
- (a.value as string).includes(component.properties.label?.class?.split(' ').find((cls: string) => cls.startsWith('text-'))),
27
+ $optionsStore.JUSTIFY_ALIGN_OPTIONS.find((a) =>
28
+ (a.value as string).includes(component.properties.label?.class?.split(' ').find((cls: string) => cls.startsWith('justify-'))),
29
29
  ),
30
30
  )
31
31
 
@@ -64,7 +64,7 @@
64
64
  label={{ name: $t('constructor.props.align') }}
65
65
  type="buttons"
66
66
  value={initialAlign}
67
- options={$optionsStore.TEXT_ALIGN_OPTIONS}
67
+ options={$optionsStore.JUSTIFY_ALIGN_OPTIONS}
68
68
  onUpdate={(option) => updateProperty('label.class', option.value as string, component, onPropertyChange)}
69
69
  />
70
70
  </div>
@@ -106,13 +106,6 @@
106
106
  />
107
107
  {/if}
108
108
  </div>
109
- <UI.Select
110
- label={{ name: $t('constructor.props.type') }}
111
- type="buttons"
112
- value={initialType}
113
- options={$optionsStore.ACCORDION_TYPE_OPTIONS}
114
- onUpdate={(item) => updateProperty('outline', item.value as boolean, component, onPropertyChange)}
115
- />
116
109
  </div>
117
110
  <div class="flex w-1/3 flex-col items-center gap-2 px-2">
118
111
  <div class="flex">
@@ -151,13 +144,6 @@
151
144
  value={$optionsStore.ACCESS_OPTION.find((o) => o.value === component.access)}
152
145
  onUpdate={(option) => onPropertyChange({ access: option.value })}
153
146
  />
154
- <UI.Select
155
- label={{ name: $t('constructor.props.type') }}
156
- type="buttons"
157
- value={initialType}
158
- options={$optionsStore.ACCORDION_TYPE_OPTIONS}
159
- onUpdate={(item) => updateProperty('outline', item.value as boolean, component, onPropertyChange)}
160
- />
161
147
  <div class="flex w-full gap-4">
162
148
  <UI.Input
163
149
  label={{ name: $t('constructor.props.size.height') }}
package/dist/types.d.ts CHANGED
@@ -70,7 +70,6 @@ export interface IButtonProps {
70
70
  export interface IAccordionProps {
71
71
  id?: string;
72
72
  isOpen?: boolean;
73
- outline?: boolean;
74
73
  wrapperClass?: string;
75
74
  size?: {
76
75
  height?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-svelte-ui-lib",
3
- "version": "1.3.4",
3
+ "version": "1.4.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {