@makolabs/ripple 0.0.1-dev.66 → 0.0.1-dev.67
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.
|
@@ -208,6 +208,8 @@
|
|
|
208
208
|
{disabled}
|
|
209
209
|
aria-expanded={open}
|
|
210
210
|
onclick={handleToggle}
|
|
211
|
+
class="absolute inset-0 w-full h-full opacity-0 cursor-pointer"
|
|
212
|
+
tabindex={disabled ? -1 : 0}
|
|
211
213
|
></button>
|
|
212
214
|
<span class="flex min-h-[1.5rem] flex-1 flex-wrap items-center gap-1 overflow-hidden">
|
|
213
215
|
{#if multiple && selectedItems.length > 0}
|
|
@@ -3,10 +3,10 @@ import { Size } from '../../variants.js';
|
|
|
3
3
|
export const selectTV = tv({
|
|
4
4
|
slots: {
|
|
5
5
|
base: '',
|
|
6
|
-
trigger: `flex items-center justify-between w-full text-left bg-white border
|
|
7
|
-
border-default-
|
|
6
|
+
trigger: `relative flex items-center justify-between w-full text-left bg-white border
|
|
7
|
+
border-default-300 text-sm focus-within:outline-none focus-within:ring-2 focus-within:ring-offset-2 focus-within:border-primary-500 focus-within:ring-primary-500 rounded-lg shadow-xs cursor-pointer transition-colors hover:border-default-400`,
|
|
8
8
|
triggerIcon: 'transition-transform duration-200 text-default-500',
|
|
9
|
-
container: 'absolute z-50 w-full mt-1 bg-white overflow-clip border border-default-200 rounded-md shadow-
|
|
9
|
+
container: 'absolute z-50 w-full mt-1 bg-white overflow-clip border border-default-200 rounded-md shadow-sm origin-top-left top-full left-0 mt-2',
|
|
10
10
|
searchInput: 'flex items-center gap-x-3 w-full outline-none px-2 h-10 border-b border-b-default-200',
|
|
11
11
|
list: 'py-1 max-h-60 overflow-x-clip overflow-y-auto h-full',
|
|
12
12
|
item: `w-full px-3 py-2 text-sm text-left
|
|
@@ -26,21 +26,21 @@ export const selectTV = tv({
|
|
|
26
26
|
base: 'w-24'
|
|
27
27
|
},
|
|
28
28
|
[Size.SM]: {
|
|
29
|
-
trigger: 'h-8 px-
|
|
29
|
+
trigger: 'h-8 px-3 py-2 text-sm gap-1.5',
|
|
30
30
|
triggerIcon: 'h-3.5 w-3.5',
|
|
31
31
|
container: 'max-h-48',
|
|
32
32
|
item: 'px-2.5 py-1.5 text-xs',
|
|
33
33
|
base: 'w-32'
|
|
34
34
|
},
|
|
35
35
|
[Size.BASE]: {
|
|
36
|
-
trigger: 'h-10 px-3 py-2 text-
|
|
36
|
+
trigger: 'h-10 px-3 py-2 text-base gap-2',
|
|
37
37
|
triggerIcon: 'h-4 w-4',
|
|
38
38
|
container: 'max-h-60',
|
|
39
39
|
item: 'px-3 py-2 text-sm',
|
|
40
40
|
base: 'w-40'
|
|
41
41
|
},
|
|
42
42
|
[Size.LG]: {
|
|
43
|
-
trigger: 'h-
|
|
43
|
+
trigger: 'h-12 px-3 py-2 text-lg gap-2.5',
|
|
44
44
|
triggerIcon: 'h-5 w-5',
|
|
45
45
|
container: 'max-h-72',
|
|
46
46
|
item: 'px-4 py-2.5 text-base',
|
|
@@ -63,7 +63,7 @@ export const selectTV = tv({
|
|
|
63
63
|
},
|
|
64
64
|
disabled: {
|
|
65
65
|
true: {
|
|
66
|
-
trigger: 'opacity-50 cursor-not-allowed hover:border-default-
|
|
66
|
+
trigger: 'opacity-50 cursor-not-allowed hover:border-default-300',
|
|
67
67
|
container: 'pointer-events-none',
|
|
68
68
|
item: 'disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:bg-transparent'
|
|
69
69
|
}
|
package/dist/forms/Input.svelte
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
cn(
|
|
23
23
|
'transition-colors',
|
|
24
24
|
{
|
|
25
|
-
'border rounded-lg shadow-
|
|
25
|
+
'border rounded-lg shadow-xs w-full bg-white px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-offset-2':
|
|
26
26
|
BASIC_TYPES.includes(type),
|
|
27
27
|
'w-full bg-white px-3 py-2 text-sm resize-y min-h-[100px]': type === 'textarea',
|
|
28
28
|
'border-red-300 focus:border-red-500 focus:ring-red-500': errors.length,
|
package/dist/index.d.ts
CHANGED
|
@@ -2,58 +2,60 @@
|
|
|
2
2
|
import { cn } from '../../helper/cls.js';
|
|
3
3
|
import { metricCard } from './metric-card.js';
|
|
4
4
|
import type { MetricCardProps } from '../../index.js';
|
|
5
|
+
import Progress from '../../elements/progress/Progress.svelte';
|
|
6
|
+
import { Size, Color } from '../../variants.js';
|
|
5
7
|
|
|
6
|
-
let {
|
|
7
|
-
title,
|
|
8
|
-
value,
|
|
9
|
-
details = [],
|
|
8
|
+
let {
|
|
9
|
+
title,
|
|
10
|
+
value,
|
|
11
|
+
details = [],
|
|
10
12
|
percent,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
segments,
|
|
14
|
+
primaryColor = 'primary',
|
|
15
|
+
secondaryColor = 'default',
|
|
13
16
|
class: className = ''
|
|
14
17
|
}: MetricCardProps = $props();
|
|
15
18
|
|
|
16
|
-
// Get the first two details for the breakdown display
|
|
17
|
-
const primaryDetail = $derived(details[0]);
|
|
18
|
-
const secondaryDetail = $derived(details[1]);
|
|
19
|
-
|
|
20
19
|
const { base, title: titleSlot, value: valueSlot, detail: detailSlot, progress: progressSlot } = $derived(
|
|
21
20
|
metricCard()
|
|
22
21
|
);
|
|
23
22
|
|
|
24
|
-
const
|
|
23
|
+
const baseClass = $derived(cn(base(), className));
|
|
25
24
|
</script>
|
|
26
25
|
|
|
27
|
-
<div class={
|
|
28
|
-
<
|
|
29
|
-
<div class={valueSlot()}>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
<div class={baseClass}>
|
|
27
|
+
<h3 class={titleSlot()}>{title}</h3>
|
|
28
|
+
<div class={valueSlot()}>{value}</div>
|
|
29
|
+
|
|
30
|
+
{#if details.length > 0}
|
|
31
|
+
<div class={detailSlot()}>
|
|
32
|
+
{#each details as detail}
|
|
33
|
+
<div class="flex items-center justify-between">
|
|
34
|
+
<span class="text-sm text-default-600">{detail.label}</span>
|
|
35
|
+
<span class="text-sm font-medium">{detail.value}</span>
|
|
36
|
+
</div>
|
|
37
|
+
{/each}
|
|
39
38
|
</div>
|
|
40
39
|
{/if}
|
|
41
|
-
|
|
42
|
-
{#if
|
|
43
|
-
<div class={
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
{
|
|
47
|
-
|
|
40
|
+
|
|
41
|
+
{#if segments}
|
|
42
|
+
<div class={progressSlot()}>
|
|
43
|
+
<Progress
|
|
44
|
+
value={0}
|
|
45
|
+
{segments}
|
|
46
|
+
size={Size.SM}
|
|
47
|
+
showLabels={true}
|
|
48
|
+
showValues={true}
|
|
49
|
+
/>
|
|
48
50
|
</div>
|
|
49
|
-
{
|
|
50
|
-
|
|
51
|
-
{#if percent !== undefined}
|
|
51
|
+
{:else if percent !== undefined}
|
|
52
52
|
<div class={progressSlot()}>
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
<Progress
|
|
54
|
+
value={percent}
|
|
55
|
+
size={Size.SM}
|
|
56
|
+
color={Color.SUCCESS}
|
|
57
|
+
showLabel={false}
|
|
58
|
+
/>
|
|
57
59
|
</div>
|
|
58
60
|
{/if}
|
|
59
61
|
</div>
|