@makolabs/ripple 2.1.0 → 2.2.0

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.
package/dist/index.d.ts CHANGED
@@ -43,7 +43,6 @@ export type { CollapsibleProps } from './elements/collapsible/collapsible-types.
43
43
  export type { TooltipProps, TooltipPlacement } from './elements/tooltip/tooltip-types.js';
44
44
  export type { ComboboxItem, ComboboxProps } from './elements/combobox/combobox-types.js';
45
45
  export type { AccordionProps } from './elements/accordion/accordion-types.js';
46
- export type { TimelineItem } from './elements/timeline/timeline-types.js';
47
46
  export type { FilterTab, FilterGroup, CompactFiltersProps } from './filters/filter-types.js';
48
47
  export type { ActivityItemBadge, ActivityItemAction, ActivityItem, ActivityListProps, ActivityListSize } from './layout/activity-list/activity-list-types.js';
49
48
  export type { FileUploadProps, FileUploadSize, FilePreviewProps, UploadedFile, StagedFile } from './elements/file-upload/file-upload-types.js';
@@ -88,7 +87,6 @@ export { default as Collapsible } from './elements/collapsible/Collapsible.svelt
88
87
  export { default as Tooltip } from './elements/tooltip/Tooltip.svelte';
89
88
  export { default as Combobox } from './elements/combobox/Combobox.svelte';
90
89
  export { default as Accordion } from './elements/accordion/Accordion.svelte';
91
- export { default as Timeline } from './elements/timeline/Timeline.svelte';
92
90
  export { default as Chart } from './charts/Chart.svelte';
93
91
  export { default as FileUpload } from './elements/file-upload/FileUpload.svelte';
94
92
  export { default as FilesPreview } from './elements/file-upload/FilesPreview.svelte';
package/dist/index.js CHANGED
@@ -75,8 +75,6 @@ export { default as Tooltip } from './elements/tooltip/Tooltip.svelte';
75
75
  export { default as Combobox } from './elements/combobox/Combobox.svelte';
76
76
  // Elements - Accordion
77
77
  export { default as Accordion } from './elements/accordion/Accordion.svelte';
78
- // Elements - Timeline
79
- export { default as Timeline } from './elements/timeline/Timeline.svelte';
80
78
  // Chart
81
79
  export { default as Chart } from './charts/Chart.svelte';
82
80
  // File Upload
@@ -105,6 +105,61 @@
105
105
  <div class="min-w-0 flex-1" data-activity-custom="">
106
106
  {@render customContent?.(activityItem, index)}
107
107
  </div>
108
+ {:else if timeline && activityItem.subtitle}
109
+ <div class="min-w-0 flex-1">
110
+ <div class="flex items-start justify-between gap-3">
111
+ <div
112
+ class="ring-default-200 flex-1 rounded-md bg-white p-3 ring-1"
113
+ data-activity-comment=""
114
+ >
115
+ <div class="mb-1 flex justify-between gap-x-4">
116
+ <div class="flex flex-wrap items-center gap-2">
117
+ <button
118
+ class="text-default-900 text-sm font-medium"
119
+ onclick={() => onItemClick?.(activityItem, index)}
120
+ >
121
+ {activityItem.title}
122
+ </button>
123
+ {#if activityItem.badges}
124
+ {#each activityItem.badges as badge (badge.text)}
125
+ {#if badge.color}
126
+ <Badge color={badge.color} size={Size.SM}>{badge.text}</Badge>
127
+ {:else if badge.class}
128
+ <span
129
+ class="inline-flex rounded-full px-2 py-1 text-xs font-medium {badge.class}"
130
+ >
131
+ {badge.text}
132
+ </span>
133
+ {:else}
134
+ <Badge size={Size.SM}>{badge.text}</Badge>
135
+ {/if}
136
+ {/each}
137
+ {/if}
138
+ </div>
139
+ {#if activityItem.timestamp}
140
+ <div class={itemTimestamp()} data-activity-timestamp="">
141
+ {activityItem.timestamp}
142
+ </div>
143
+ {/if}
144
+ </div>
145
+ <p class="text-default-500 text-sm">{activityItem.subtitle}</p>
146
+ </div>
147
+ </div>
148
+ {#if activityItem.actions}
149
+ <div class={cn(itemActions(), 'mt-2')}>
150
+ {#each activityItem.actions as action (action.label)}
151
+ <Button
152
+ size={Size.XS}
153
+ variant={action.variant ?? 'outline'}
154
+ color={action.color ?? Color.DEFAULT}
155
+ onclick={() => action.onClick?.()}
156
+ >
157
+ {action.label}
158
+ </Button>
159
+ {/each}
160
+ </div>
161
+ {/if}
162
+ </div>
108
163
  {:else}
109
164
  <div class={itemContent()}>
110
165
  <div class={itemMain()}>
@@ -117,7 +172,6 @@
117
172
  {#if badge.color}
118
173
  <Badge color={badge.color} size={Size.SM}>{badge.text}</Badge>
119
174
  {:else if badge.class}
120
- <!-- Legacy class-based badge — kept for backward compat -->
121
175
  <span
122
176
  class="inline-flex rounded-full px-2 py-1 text-xs font-medium {badge.class}"
123
177
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@makolabs/ripple",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Simple Svelte 5 powered component library ✨",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -1,95 +0,0 @@
1
- <script lang="ts">
2
- import { cn } from '../../helper/cls.js';
3
- import type { TimelineItem } from '../../index.js';
4
- import { formatDateTime, getRelativeTime } from '../../helper/date.js';
5
- import { resolve } from '$app/paths';
6
-
7
- let { items = [] as TimelineItem[], class: className = '' } = $props();
8
- </script>
9
-
10
- <div class={cn('flow-root', className)}>
11
- <ul role="list" class="-mb-8">
12
- {#each items as item, index (item.title + index)}
13
- <li>
14
- <div class="relative pb-8">
15
- {#if index !== items.length - 1}
16
- <span class="bg-default-200 absolute top-4 left-4 -ml-px h-full w-1" aria-hidden="true"
17
- ></span>
18
- {/if}
19
-
20
- {@render ItemWrap({ item })}
21
- </div>
22
- </li>
23
- {/each}
24
- </ul>
25
- </div>
26
-
27
- {#snippet ItemWrap({ item }: { item: TimelineItem })}
28
- <div class="relative flex gap-x-3" class:items-center={!item.details}>
29
- <div class="relative ml-0.5 flex-shrink-0">
30
- {@render TimelineIcon(item)}
31
- </div>
32
- {#if item.details}
33
- {@render CommentItem({ item })}
34
- {:else}
35
- {@render StandardItem({ item })}
36
- {/if}
37
- </div>
38
- {/snippet}
39
-
40
- {#snippet StandardItem({ item }: { item: TimelineItem })}
41
- <div class="min-w-0 flex-1">
42
- <div class="flex items-center justify-between">
43
- <p class="text-default-500 text-sm">
44
- {item.title}
45
- {#if item.link}
46
- <a href={resolve(item.link.url as `/`)} class="text-default-900 font-medium"
47
- >{item.link.text}</a
48
- >
49
- {/if}
50
- </p>
51
- {@render TimeStamp(item.time)}
52
- </div>
53
- </div>
54
- {/snippet}
55
-
56
- {#snippet CommentItem({ item }: { item: TimelineItem })}
57
- <div class="ring-default-200 w-full flex-grow rounded-md bg-white p-3 ring-1">
58
- <div class="mb-1 flex justify-between gap-x-4">
59
- <div class="text-default-900 text-sm font-medium">{item.title}</div>
60
- {@render TimeStamp(item.time)}
61
- </div>
62
- <p class="text-default-500 text-sm">{item.details}</p>
63
- </div>
64
- {/snippet}
65
-
66
- {#snippet TimeStamp(time: Date | string)}
67
- <time
68
- datetime={time instanceof Date ? time.toISOString() : time}
69
- class="text-default-500 text-right text-sm whitespace-nowrap"
70
- title={formatDateTime(time)}
71
- >
72
- {getRelativeTime(time)}
73
- </time>
74
- {/snippet}
75
-
76
- {#snippet TimelineIcon(item: TimelineItem, classes = 'size-7 shrink-0')}
77
- {#if item.Icon}
78
- {@const Icon = item.Icon}
79
- <Icon class={classes} />
80
- {:else}
81
- <svg
82
- xmlns="http://www.w3.org/2000/svg"
83
- width="16"
84
- height="16"
85
- viewBox="0 0 16 16"
86
- class={classes}
87
- >
88
- <circle cx="8" cy="8" r="7" fill="white" />
89
- <path
90
- fill="currentColor"
91
- d="M1 8a7 7 0 1 1 14 0A7 7 0 0 1 1 8m9.854-1.146a.5.5 0 0 0-.708-.708L7.25 9.043L5.854 7.646a.5.5 0 1 0-.708.708l1.75 1.75a.5.5 0 0 0 .708 0z"
92
- />
93
- </svg>
94
- {/if}
95
- {/snippet}
@@ -1,7 +0,0 @@
1
- import type { TimelineItem } from '../../index.js';
2
- declare const Timeline: import("svelte").Component<{
3
- items?: TimelineItem[];
4
- class?: string;
5
- }, {}, "">;
6
- type Timeline = ReturnType<typeof Timeline>;
7
- export default Timeline;
@@ -1,11 +0,0 @@
1
- import type { Component } from 'svelte';
2
- export interface TimelineItem {
3
- title: string;
4
- time: Date | string;
5
- link?: {
6
- text: string;
7
- url: string;
8
- };
9
- Icon?: Component;
10
- details?: string;
11
- }
@@ -1 +0,0 @@
1
- export {};