@makolabs/ripple 3.0.6 → 3.0.8

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.
@@ -117,7 +117,7 @@
117
117
  <h3 class={cn(styles.title(), titleClass)}>{title}</h3>
118
118
  {/if}
119
119
  {#if description}
120
- <p class="text-default-500 text-xs whitespace-nowrap">{description}</p>
120
+ <p class="text-default-500 text-xs font-normal">{description}</p>
121
121
  {/if}
122
122
  </div>
123
123
  </div>
@@ -3,52 +3,52 @@ export declare const accordion: import("tailwind-variants").TVReturnType<{
3
3
  default: {
4
4
  base: string;
5
5
  header: string;
6
- body: string;
6
+ title: string;
7
7
  };
8
8
  primary: {
9
9
  base: string;
10
10
  header: string;
11
+ body: string;
11
12
  title: string;
12
13
  };
13
14
  secondary: {
14
15
  base: string;
15
16
  header: string;
17
+ body: string;
16
18
  title: string;
17
19
  };
18
20
  success: {
19
21
  base: string;
20
22
  header: string;
23
+ body: string;
21
24
  title: string;
22
25
  };
23
26
  warning: {
24
27
  base: string;
25
28
  header: string;
29
+ body: string;
26
30
  title: string;
27
31
  };
28
32
  danger: {
29
33
  base: string;
30
34
  header: string;
35
+ body: string;
31
36
  title: string;
32
37
  };
33
38
  info: {
34
39
  base: string;
35
40
  header: string;
41
+ body: string;
36
42
  title: string;
37
43
  };
38
44
  };
39
45
  open: {
40
- true: {
41
- base: string;
42
- title: string;
43
- };
44
- false: {
45
- base: string;
46
- };
46
+ true: {};
47
+ false: {};
47
48
  };
48
49
  bordered: {
49
50
  true: {
50
51
  base: string;
51
- body: string;
52
52
  };
53
53
  false: {
54
54
  base: string;
@@ -56,11 +56,9 @@ export declare const accordion: import("tailwind-variants").TVReturnType<{
56
56
  };
57
57
  hasChildren: {
58
58
  true: {
59
- base: string;
60
59
  header: string;
61
60
  };
62
61
  false: {
63
- base: string;
64
62
  header: string;
65
63
  };
66
64
  };
@@ -78,52 +76,52 @@ export declare const accordion: import("tailwind-variants").TVReturnType<{
78
76
  default: {
79
77
  base: string;
80
78
  header: string;
81
- body: string;
79
+ title: string;
82
80
  };
83
81
  primary: {
84
82
  base: string;
85
83
  header: string;
84
+ body: string;
86
85
  title: string;
87
86
  };
88
87
  secondary: {
89
88
  base: string;
90
89
  header: string;
90
+ body: string;
91
91
  title: string;
92
92
  };
93
93
  success: {
94
94
  base: string;
95
95
  header: string;
96
+ body: string;
96
97
  title: string;
97
98
  };
98
99
  warning: {
99
100
  base: string;
100
101
  header: string;
102
+ body: string;
101
103
  title: string;
102
104
  };
103
105
  danger: {
104
106
  base: string;
105
107
  header: string;
108
+ body: string;
106
109
  title: string;
107
110
  };
108
111
  info: {
109
112
  base: string;
110
113
  header: string;
114
+ body: string;
111
115
  title: string;
112
116
  };
113
117
  };
114
118
  open: {
115
- true: {
116
- base: string;
117
- title: string;
118
- };
119
- false: {
120
- base: string;
121
- };
119
+ true: {};
120
+ false: {};
122
121
  };
123
122
  bordered: {
124
123
  true: {
125
124
  base: string;
126
- body: string;
127
125
  };
128
126
  false: {
129
127
  base: string;
@@ -131,11 +129,9 @@ export declare const accordion: import("tailwind-variants").TVReturnType<{
131
129
  };
132
130
  hasChildren: {
133
131
  true: {
134
- base: string;
135
132
  header: string;
136
133
  };
137
134
  false: {
138
- base: string;
139
135
  header: string;
140
136
  };
141
137
  };
@@ -153,52 +149,52 @@ export declare const accordion: import("tailwind-variants").TVReturnType<{
153
149
  default: {
154
150
  base: string;
155
151
  header: string;
156
- body: string;
152
+ title: string;
157
153
  };
158
154
  primary: {
159
155
  base: string;
160
156
  header: string;
157
+ body: string;
161
158
  title: string;
162
159
  };
163
160
  secondary: {
164
161
  base: string;
165
162
  header: string;
163
+ body: string;
166
164
  title: string;
167
165
  };
168
166
  success: {
169
167
  base: string;
170
168
  header: string;
169
+ body: string;
171
170
  title: string;
172
171
  };
173
172
  warning: {
174
173
  base: string;
175
174
  header: string;
175
+ body: string;
176
176
  title: string;
177
177
  };
178
178
  danger: {
179
179
  base: string;
180
180
  header: string;
181
+ body: string;
181
182
  title: string;
182
183
  };
183
184
  info: {
184
185
  base: string;
185
186
  header: string;
187
+ body: string;
186
188
  title: string;
187
189
  };
188
190
  };
189
191
  open: {
190
- true: {
191
- base: string;
192
- title: string;
193
- };
194
- false: {
195
- base: string;
196
- };
192
+ true: {};
193
+ false: {};
197
194
  };
198
195
  bordered: {
199
196
  true: {
200
197
  base: string;
201
- body: string;
202
198
  };
203
199
  false: {
204
200
  base: string;
@@ -206,11 +202,9 @@ export declare const accordion: import("tailwind-variants").TVReturnType<{
206
202
  };
207
203
  hasChildren: {
208
204
  true: {
209
- base: string;
210
205
  header: string;
211
206
  };
212
207
  false: {
213
- base: string;
214
208
  header: string;
215
209
  };
216
210
  };
@@ -1,77 +1,71 @@
1
1
  import { tv } from '../../helper/cls.js';
2
2
  import { Color } from '../../variants.js';
3
+ // Visual language mirrors <Card> at md size: rounded-lg, border, shadow-sm,
4
+ // translucent header tint over a white body, hairline separator. Differs from
5
+ // Card in two ways: (1) the header is a clickable button with a hover state,
6
+ // and (2) the body slides open/closed instead of being always-visible.
3
7
  export const accordion = tv({
4
8
  slots: {
5
- base: 'w-full relative overflow-hidden rounded-xl transition-all duration-200 bg-white border border-default-200',
6
- header: 'w-full flex cursor-pointer items-center justify-between p-4 transition-colors duration-200',
7
- title: 'flex text-default-900 text-lg font-medium leading-tight',
8
- body: 'w-full border-t border-default-200 p-4 pt-3 transition-all'
9
+ base: 'w-full relative overflow-hidden rounded-lg bg-white border border-default-200 shadow-sm transition-all duration-200',
10
+ header: 'w-full flex items-center justify-between px-4 py-2.5 transition-colors duration-200 bg-default-100/50',
11
+ title: 'text-default-900 text-sm font-semibold leading-tight',
12
+ body: 'w-full border-t border-default-200 p-4 transition-all'
9
13
  },
10
14
  variants: {
11
15
  color: {
12
16
  [Color.DEFAULT]: {
13
- base: 'bg-white hover:border-default-300',
14
- header: '',
15
- body: ''
17
+ base: 'bg-white',
18
+ header: 'bg-default-100/50',
19
+ title: 'text-default-900'
16
20
  },
17
21
  [Color.PRIMARY]: {
18
- base: 'bg-primary-50/50 hover:border-primary-300',
19
- header: 'text-primary-700',
20
- title: 'text-primary-700'
22
+ base: 'bg-primary-50/30 border-primary-200',
23
+ header: 'bg-primary-100/40 border-primary-200',
24
+ body: 'border-primary-200',
25
+ title: 'text-primary-900'
21
26
  },
22
27
  [Color.SECONDARY]: {
23
- base: 'bg-secondary-50/50 hover:border-secondary-300',
24
- header: 'text-secondary-700',
25
- title: 'text-secondary-700'
28
+ base: 'bg-secondary-50/30 border-secondary-200',
29
+ header: 'bg-secondary-100/40 border-secondary-200',
30
+ body: 'border-secondary-200',
31
+ title: 'text-secondary-900'
26
32
  },
27
33
  [Color.SUCCESS]: {
28
- base: 'bg-success-50/50 hover:border-success-300',
29
- header: 'text-success-700',
30
- title: 'text-success-700'
34
+ base: 'bg-success-50/30 border-success-200',
35
+ header: 'bg-success-100/40 border-success-200',
36
+ body: 'border-success-200',
37
+ title: 'text-success-900'
31
38
  },
32
39
  [Color.WARNING]: {
33
- base: 'bg-warning-50/50 hover:border-warning-300',
34
- header: 'text-warning-700',
35
- title: 'text-warning-700'
40
+ base: 'bg-warning-50/30 border-warning-200',
41
+ header: 'bg-warning-100/40 border-warning-200',
42
+ body: 'border-warning-200',
43
+ title: 'text-warning-900'
36
44
  },
37
45
  [Color.DANGER]: {
38
- base: 'bg-danger-50/50 hover:border-danger-300',
39
- header: 'text-danger-700',
40
- title: 'text-danger-700'
46
+ base: 'bg-danger-50/30 border-danger-200',
47
+ header: 'bg-danger-100/40 border-danger-200',
48
+ body: 'border-danger-200',
49
+ title: 'text-danger-900'
41
50
  },
42
51
  [Color.INFO]: {
43
- base: 'bg-info-50/50 hover:border-info-300',
44
- header: 'text-info-700',
45
- title: 'text-info-700'
52
+ base: 'bg-info-50/30 border-info-200',
53
+ header: 'bg-info-100/40 border-info-200',
54
+ body: 'border-info-200',
55
+ title: 'text-info-900'
46
56
  }
47
57
  },
48
58
  open: {
49
- true: {
50
- base: 'shadow-sm',
51
- title: 'text-default-900'
52
- },
53
- false: {
54
- base: ''
55
- }
59
+ true: {},
60
+ false: {}
56
61
  },
57
62
  bordered: {
58
- true: {
59
- base: 'border border-default-200',
60
- body: 'border-t'
61
- },
62
- false: {
63
- base: 'shadow-sm'
64
- }
63
+ true: { base: 'border' },
64
+ false: { base: 'border-0' }
65
65
  },
66
66
  hasChildren: {
67
- true: {
68
- base: 'hover:shadow-md',
69
- header: 'hover:bg-default-50'
70
- },
71
- false: {
72
- base: 'hover:shadow-none',
73
- header: 'cursor-default'
74
- }
67
+ true: { header: 'cursor-pointer' },
68
+ false: { header: 'cursor-default' }
75
69
  },
76
70
  iconPosition: {
77
71
  start: {},
@@ -79,54 +73,14 @@ export const accordion = tv({
79
73
  }
80
74
  },
81
75
  compoundVariants: [
82
- {
83
- open: true,
84
- class: {
85
- header: 'border-b-0'
86
- }
87
- },
88
- {
89
- hasChildren: true,
90
- color: Color.PRIMARY,
91
- class: {
92
- header: 'hover:bg-primary-50'
93
- }
94
- },
95
- {
96
- hasChildren: true,
97
- color: Color.SECONDARY,
98
- class: {
99
- header: 'hover:bg-secondary-50'
100
- }
101
- },
102
- {
103
- hasChildren: true,
104
- color: Color.SUCCESS,
105
- class: {
106
- header: 'hover:bg-success-50'
107
- }
108
- },
109
- {
110
- hasChildren: true,
111
- color: Color.WARNING,
112
- class: {
113
- header: 'hover:bg-warning-50'
114
- }
115
- },
116
- {
117
- hasChildren: true,
118
- color: Color.DANGER,
119
- class: {
120
- header: 'hover:bg-danger-50'
121
- }
122
- },
123
- {
124
- hasChildren: true,
125
- color: Color.INFO,
126
- class: {
127
- header: 'hover:bg-info-50'
128
- }
129
- }
76
+ // Hover states only when the header is interactive.
77
+ { hasChildren: true, color: Color.DEFAULT, class: { header: 'hover:bg-default-100/80' } },
78
+ { hasChildren: true, color: Color.PRIMARY, class: { header: 'hover:bg-primary-100/70' } },
79
+ { hasChildren: true, color: Color.SECONDARY, class: { header: 'hover:bg-secondary-100/70' } },
80
+ { hasChildren: true, color: Color.SUCCESS, class: { header: 'hover:bg-success-100/70' } },
81
+ { hasChildren: true, color: Color.WARNING, class: { header: 'hover:bg-warning-100/70' } },
82
+ { hasChildren: true, color: Color.DANGER, class: { header: 'hover:bg-danger-100/70' } },
83
+ { hasChildren: true, color: Color.INFO, class: { header: 'hover:bg-info-100/70' } }
130
84
  ],
131
85
  defaultVariants: {
132
86
  color: Color.DEFAULT,
@@ -180,7 +180,7 @@
180
180
  oninput={handleInput}
181
181
  onfocus={openMenu}
182
182
  onkeydown={handleKey}
183
- class="flex-1 bg-transparent outline-none"
183
+ class="min-w-0 flex-1 bg-transparent outline-none"
184
184
  data-testid={buildTestId('combobox', undefined, testId)}
185
185
  />
186
186
  {#if clearable && value && !disabled}
@@ -47,6 +47,11 @@
47
47
 
48
48
  const useSheet = $derived(isMobile && trigger !== 'hover');
49
49
 
50
+ // Manual triggers are used by form controls (MonthPicker, DatePicker, ComboBox)
51
+ // that need to fill their parent's width. Click/hover triggers stay inline so
52
+ // tooltips and menus from buttons/icons size to content.
53
+ const triggerWrapperClass = $derived(trigger === 'manual' ? 'flex w-full' : 'inline-flex');
54
+
50
55
  function show() {
51
56
  if (disabled) return;
52
57
  clearTimeout(showTimer);
@@ -183,7 +188,7 @@
183
188
 
184
189
  <span
185
190
  bind:this={wrapper}
186
- class={cn('relative inline-flex', className)}
191
+ class={cn('relative', triggerWrapperClass, className)}
187
192
  data-testid={buildTestId('popover', undefined, testId)}
188
193
  >
189
194
  {#if trigger === 'click'}
@@ -204,7 +209,7 @@
204
209
  {@render children()}
205
210
  </span>
206
211
  {:else}
207
- <span class="inline-flex">{@render children()}</span>
212
+ <span class={triggerWrapperClass}>{@render children()}</span>
208
213
  {/if}
209
214
  </span>
210
215
 
@@ -6,7 +6,11 @@
6
6
  import { segmentedLabelClasses, segmentedTrack, segmentClasses } from './segmented-control.js';
7
7
  import type { SegmentedControlProps, VariantColors, VariantSizes } from '../index.js';
8
8
 
9
- const groupId = `seg-${Math.random().toString(36).slice(2, 11)}`;
9
+ // Stable ID across SSR and CSR — using Math.random() here would mismatch
10
+ // between the server-rendered HTML and client hydration, triggering Svelte
11
+ // hydration warnings and (in some cases) DOM re-claim.
12
+ const instanceId = $props.id();
13
+ const groupId = `seg-${instanceId}`;
10
14
 
11
15
  let {
12
16
  options = [],
@@ -91,7 +91,12 @@
91
91
  )}
92
92
  data-testid={buildTestId('date-picker', undefined, testId)}
93
93
  >
94
- <span class={cn('flex-1 text-left', !display && 'text-default-400')}>
94
+ <span
95
+ class={cn(
96
+ 'min-w-0 flex-1 truncate text-left whitespace-nowrap',
97
+ !display && 'text-default-400'
98
+ )}
99
+ >
95
100
  {display || placeholder}
96
101
  </span>
97
102
  {#if clearable && value && !disabled && !readonly}
@@ -177,7 +177,12 @@
177
177
  )}
178
178
  data-testid={buildTestId('month-picker', undefined, testId)}
179
179
  >
180
- <span class={cn('flex-1 text-left', !display && 'text-default-400')}>
180
+ <span
181
+ class={cn(
182
+ 'min-w-0 flex-1 truncate text-left whitespace-nowrap',
183
+ !display && 'text-default-400'
184
+ )}
185
+ >
181
186
  {display || placeholder}
182
187
  </span>
183
188
  {#if clearable && value && !disabled}
package/dist/index.d.ts CHANGED
@@ -29,7 +29,6 @@ export type { ConfirmDialogProps } from './modal/confirm-dialog-types.js';
29
29
  export type { DrawerProps } from './drawer/drawer-types.js';
30
30
  export type { DropdownItem, DropSection, DropHeaderConfig, DropdownMenuProps, SelectItem, SelectProps } from './elements/dropdown/dropdown-types.js';
31
31
  export type { CardProps, AlertProps, MetricDetail, MetricCardProps } from './layout/card/card-types.js';
32
- export type { RankedCardProps, RankedCardItem, RankedCardMetric } from './layout/card/ranked-card.js';
33
32
  export type { DataRow, KeyType, StatusType, TableColumn, SortDirection, SortState, TableProps } from './layout/table/table-types.js';
34
33
  export type { BreadcrumbItem, BreadcrumbsProps, PageHeaderProps } from './header/header-types.js';
35
34
  export type { TabItem, TabProps, TabsGroupProps, TabContentProps } from './layout/tabs/tabs-types.js';
@@ -79,7 +78,6 @@ export { default as Dropdown } from './elements/dropdown/Dropdown.svelte';
79
78
  export { default as Select } from './elements/dropdown/Select.svelte';
80
79
  export { default as Card } from './layout/card/Card.svelte';
81
80
  export { default as MetricCard } from './layout/card/MetricCard.svelte';
82
- export { default as RankedCard } from './layout/card/RankedCard.svelte';
83
81
  export { default as Alert } from './elements/alert/Alert.svelte';
84
82
  export { default as Pagination } from './elements/pagination/Pagination.svelte';
85
83
  export type { PaginationProps } from './elements/pagination/Pagination.svelte';
@@ -138,7 +136,6 @@ export { drawer } from './drawer/drawer.js';
138
136
  export { selectTV } from './elements/dropdown/select.js';
139
137
  export { breadcrumbs } from './header/breadcrumbs.js';
140
138
  export { metricCard } from './layout/card/metric-card.js';
141
- export { rankedCard } from './layout/card/ranked-card.js';
142
139
  export { activityList } from './layout/activity-list/activity-list.js';
143
140
  export { slider } from './forms/slider.js';
144
141
  export type { SegmentAppearance } from './forms/segmented-control.js';
package/dist/index.js CHANGED
@@ -42,7 +42,6 @@ export { default as Select } from './elements/dropdown/Select.svelte';
42
42
  // Elements - Card
43
43
  export { default as Card } from './layout/card/Card.svelte';
44
44
  export { default as MetricCard } from './layout/card/MetricCard.svelte';
45
- export { default as RankedCard } from './layout/card/RankedCard.svelte';
46
45
  // Elements - Alert
47
46
  export { default as Alert } from './elements/alert/Alert.svelte';
48
47
  export { default as Pagination } from './elements/pagination/Pagination.svelte';
@@ -128,7 +127,6 @@ export { drawer } from './drawer/drawer.js';
128
127
  export { selectTV } from './elements/dropdown/select.js';
129
128
  export { breadcrumbs } from './header/breadcrumbs.js';
130
129
  export { metricCard } from './layout/card/metric-card.js';
131
- export { rankedCard } from './layout/card/ranked-card.js';
132
130
  export { activityList } from './layout/activity-list/activity-list.js';
133
131
  export { slider } from './forms/slider.js';
134
132
  export { segmentedTrack, segmentClasses, segmentedLabelClasses } from './forms/segmented-control.js';
@@ -8,6 +8,7 @@
8
8
  highlightedRowClasses,
9
9
  highlightedRingClasses
10
10
  } from './activity-list.js';
11
+ import Card from '../card/Card.svelte';
11
12
  import Badge from '../../elements/badge/Badge.svelte';
12
13
  import Button from '../../button/Button.svelte';
13
14
  import { Color, Size } from '../../variants.js';
@@ -20,7 +21,6 @@
20
21
  size = 'md',
21
22
  timeline = false,
22
23
  class: className = '',
23
- headerClass = '',
24
24
  titleClass = '',
25
25
  contentClass = '',
26
26
  itemClass = '',
@@ -31,9 +31,6 @@
31
31
  }: ActivityListProps = $props();
32
32
 
33
33
  const {
34
- base,
35
- header,
36
- title: titleSlot,
37
34
  content,
38
35
  item,
39
36
  accentBar,
@@ -48,21 +45,15 @@
48
45
  itemSubtitle,
49
46
  itemTimestamp,
50
47
  itemActions
51
- } = $derived(activityList({ color, size }));
48
+ } = $derived(activityList({ size }));
52
49
 
53
- const baseClass = $derived(cn(base(), className));
54
- const headerClasses = $derived(cn(header(), headerClass));
55
- const titleClasses = $derived(cn(titleSlot(), titleClass));
56
50
  const contentClasses = $derived(cn(content(), contentClass, timeline && 'relative divide-y-0'));
51
+ // ActivityList's `md` size maps to Card's `md`; sm to sm. Items handle their
52
+ // own padding (px-6 py-4 / px-4 py-2.5), so we strip Card's body padding.
53
+ const cardSize = $derived(size === 'sm' ? Size.SM : Size.MD);
57
54
  </script>
58
55
 
59
- <div class={baseClass} data-testid={buildTestId('activity-list', undefined, testId)}>
60
- {#if title}
61
- <div class={headerClasses}>
62
- <h2 class={titleClasses}>{title}</h2>
63
- </div>
64
- {/if}
65
-
56
+ <Card {title} {color} size={cardSize} class={className} {titleClass} bodyClass="p-0" {testId}>
66
57
  <div class={contentClasses}>
67
58
  {#if children}
68
59
  {@render children()}
@@ -244,4 +235,4 @@
244
235
  {/each}
245
236
  {/if}
246
237
  </div>
247
- </div>
238
+ </Card>
@@ -143,7 +143,6 @@ export type ActivityListProps = {
143
143
  */
144
144
  timeline?: boolean;
145
145
  class?: ClassValue;
146
- headerClass?: ClassValue;
147
146
  titleClass?: ClassValue;
148
147
  contentClass?: ClassValue;
149
148
  itemClass?: ClassValue;