poe-svelte-ui-lib 1.0.13 → 1.0.15

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.
@@ -21,6 +21,20 @@
21
21
 
22
22
  let showInfo = $state(false)
23
23
 
24
+ const svgSize = $derived(() => {
25
+ const widthClass = twMerge(
26
+ wrapperClass.split(' ').find((cls: string) => cls.startsWith('w-')),
27
+ componentClass.split(' ').find((cls: string) => cls.startsWith('w-')),
28
+ )
29
+ const heightClass = twMerge(
30
+ wrapperClass.split(' ').find((cls: string) => cls.startsWith('h-')),
31
+ componentClass.split(' ').find((cls: string) => cls.startsWith('h-')),
32
+ )
33
+ console.log(widthClass)
34
+
35
+ return `${widthClass} ${heightClass}`
36
+ })
37
+
24
38
  /* Обработчик клика */
25
39
  const handleClick = () => {
26
40
  if (disabled || !onClick) return
@@ -59,7 +73,7 @@
59
73
  class="{twMerge(
60
74
  `relative m-0 inline-block w-full items-center rounded-2xl
61
75
  px-2 py-1 font-semibold transition duration-200 select-none
62
- ${content.icon && !content.name ? 'bg-transparent p-0' : 'border border-[var(--bg-color)] '}
76
+ ${content.icon && !content.name ? 'bg-transparent p-0' : 'bg-blue border border-[var(--bg-color)] '}
63
77
  ${disabled ? 'cursor-not-allowed opacity-50' : 'cursor-pointer active:scale-97'} `,
64
78
  componentClass,
65
79
  )} bg-[var(--bg-color)]"
@@ -77,7 +91,7 @@
77
91
  {#if content?.icon}
78
92
  <span
79
93
  class={`flex items-center justify-center overflow-visible
80
- ${content.name ? 'h-8 w-8' : `${wrapperClass}`} [&_svg]:h-full [&_svg]:max-h-full [&_svg]:w-full [&_svg]:max-w-full`}
94
+ ${content.name ? 'h-8 w-8' : `${svgSize()}`} [&_svg]:h-full [&_svg]:max-h-full [&_svg]:w-full [&_svg]:max-w-full`}
81
95
  >
82
96
  {#if content?.icon}
83
97
  {@const IconComponent = content?.icon}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poe-svelte-ui-lib",
3
- "version": "1.0.13",
3
+ "version": "1.0.15",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {