pika-ux 1.0.2 → 1.1.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/package.json +1 -1
- package/src/app.css +45 -0
- package/src/pika/expandable-container/expandable-container.svelte +4 -4
- package/src/pika/permanent-toast/permanent-toast.svelte +11 -11
- package/src/pika/pika-badge/pika-badge.svelte +1 -1
- package/src/pika/pika-table/pika-table-column-header.svelte +1 -1
- package/src/pika/pika-table/pika-table.svelte +1 -1
- package/src/pika/pika-tabs/tabs-trigger.svelte +27 -6
package/package.json
CHANGED
package/src/app.css
CHANGED
|
@@ -108,6 +108,21 @@
|
|
|
108
108
|
--sidebar-border: oklch(0.873 0.115 95.71);
|
|
109
109
|
--sidebar-ring: oklch(0.623 0.188 259.803);
|
|
110
110
|
|
|
111
|
+
/* Extended semantic colors for status/feedback */
|
|
112
|
+
--success: oklch(0.55 0.16 142);
|
|
113
|
+
--success-foreground: oklch(0.985 0 0);
|
|
114
|
+
--success-bg: oklch(0.95 0.05 142);
|
|
115
|
+
--warning: oklch(0.75 0.15 75);
|
|
116
|
+
--warning-foreground: oklch(0.20 0.02 45);
|
|
117
|
+
--warning-bg: oklch(0.95 0.05 75);
|
|
118
|
+
--info: oklch(0.55 0.15 250);
|
|
119
|
+
--info-foreground: oklch(0.985 0 0);
|
|
120
|
+
--info-bg: oklch(0.93 0.05 250);
|
|
121
|
+
--ai: oklch(0.55 0.2 280);
|
|
122
|
+
--ai-foreground: oklch(0.985 0 0);
|
|
123
|
+
--ai-bg: oklch(0.93 0.05 280);
|
|
124
|
+
--danger-bg: oklch(0.95 0.08 25);
|
|
125
|
+
|
|
111
126
|
--prominent-50: oklch(0.984 0.018 96.452);
|
|
112
127
|
--prominent-100: oklch(0.959 0.043 96.701);
|
|
113
128
|
--prominent-200: oklch(0.926 0.075 96.972);
|
|
@@ -166,6 +181,21 @@
|
|
|
166
181
|
--sidebar-border: oklch(0.712 0.141 92.714);
|
|
167
182
|
--sidebar-ring: oklch(0.623 0.188 259.803);
|
|
168
183
|
|
|
184
|
+
/* Extended semantic colors for status/feedback (dark mode) */
|
|
185
|
+
--success: oklch(0.65 0.18 142);
|
|
186
|
+
--success-foreground: oklch(0.15 0.02 142);
|
|
187
|
+
--success-bg: oklch(0.25 0.08 142);
|
|
188
|
+
--warning: oklch(0.70 0.15 75);
|
|
189
|
+
--warning-foreground: oklch(0.15 0.02 75);
|
|
190
|
+
--warning-bg: oklch(0.25 0.08 75);
|
|
191
|
+
--info: oklch(0.60 0.16 250);
|
|
192
|
+
--info-foreground: oklch(0.15 0.02 250);
|
|
193
|
+
--info-bg: oklch(0.25 0.08 250);
|
|
194
|
+
--ai: oklch(0.60 0.22 280);
|
|
195
|
+
--ai-foreground: oklch(0.15 0.02 280);
|
|
196
|
+
--ai-bg: oklch(0.25 0.08 280);
|
|
197
|
+
--danger-bg: oklch(0.25 0.10 25);
|
|
198
|
+
|
|
169
199
|
/* Dark mode gray colors */
|
|
170
200
|
--gray-50: oklch(0.221 0.022 256.975);
|
|
171
201
|
--gray-100: oklch(0.313 0.032 256.627);
|
|
@@ -218,6 +248,21 @@
|
|
|
218
248
|
--color-sidebar-border: var(--sidebar-border);
|
|
219
249
|
--color-sidebar-ring: var(--sidebar-ring);
|
|
220
250
|
|
|
251
|
+
/* Extended semantic colors for status/feedback */
|
|
252
|
+
--color-success: var(--success);
|
|
253
|
+
--color-success-foreground: var(--success-foreground);
|
|
254
|
+
--color-success-bg: var(--success-bg);
|
|
255
|
+
--color-warning: var(--warning);
|
|
256
|
+
--color-warning-foreground: var(--warning-foreground);
|
|
257
|
+
--color-warning-bg: var(--warning-bg);
|
|
258
|
+
--color-info: var(--info);
|
|
259
|
+
--color-info-foreground: var(--info-foreground);
|
|
260
|
+
--color-info-bg: var(--info-bg);
|
|
261
|
+
--color-ai: var(--ai);
|
|
262
|
+
--color-ai-foreground: var(--ai-foreground);
|
|
263
|
+
--color-ai-bg: var(--ai-bg);
|
|
264
|
+
--color-danger-bg: var(--danger-bg);
|
|
265
|
+
|
|
221
266
|
/* Custom color palettes */
|
|
222
267
|
--color-gold-50: var(--gold-50);
|
|
223
268
|
--color-gold-100: var(--gold-100);
|
|
@@ -80,18 +80,18 @@ Props:
|
|
|
80
80
|
const firstStepNotDone = stepsInProcess.steps.find((step) => !step.done);
|
|
81
81
|
if (currentStep?.done) {
|
|
82
82
|
// This step is done
|
|
83
|
-
return { iconColor: 'text-
|
|
83
|
+
return { iconColor: 'text-success', textColor: 'text-muted-foreground', icon: Check, titleIcon: undefined };
|
|
84
84
|
} else if (firstStepNotDone?.stepId === currentStep?.stepId) {
|
|
85
85
|
// This is the first step that hasn't been done
|
|
86
86
|
return {
|
|
87
|
-
iconColor: 'text-
|
|
88
|
-
textColor: 'text-
|
|
87
|
+
iconColor: 'text-ai',
|
|
88
|
+
textColor: 'text-muted-foreground',
|
|
89
89
|
icon: Circle,
|
|
90
90
|
titleIcon: ArrowBigRight
|
|
91
91
|
};
|
|
92
92
|
} else {
|
|
93
93
|
// You can't do this step yet since it's after the current step
|
|
94
|
-
return { iconColor: 'text-
|
|
94
|
+
return { iconColor: 'text-warning', textColor: 'text-muted-foreground/60', icon: Minus, titleIcon: undefined };
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
const typeConfig = {
|
|
15
15
|
info: {
|
|
16
16
|
icon: Info,
|
|
17
|
-
bgColor: 'bg-
|
|
18
|
-
iconColor: 'text-
|
|
19
|
-
borderColor: 'border-
|
|
17
|
+
bgColor: 'bg-info-bg',
|
|
18
|
+
iconColor: 'text-info',
|
|
19
|
+
borderColor: 'border-info/20'
|
|
20
20
|
},
|
|
21
21
|
warning: {
|
|
22
22
|
icon: TriangleAlert,
|
|
23
|
-
bgColor: 'bg-
|
|
24
|
-
iconColor: 'text-
|
|
25
|
-
borderColor: 'border-
|
|
23
|
+
bgColor: 'bg-warning-bg',
|
|
24
|
+
iconColor: 'text-warning',
|
|
25
|
+
borderColor: 'border-warning/20'
|
|
26
26
|
},
|
|
27
27
|
error: {
|
|
28
28
|
icon: CircleAlert,
|
|
29
|
-
bgColor: 'bg-
|
|
30
|
-
iconColor: 'text-
|
|
31
|
-
borderColor: 'border-
|
|
32
|
-
}
|
|
29
|
+
bgColor: 'bg-danger-bg',
|
|
30
|
+
iconColor: 'text-destructive',
|
|
31
|
+
borderColor: 'border-destructive/20'
|
|
32
|
+
}
|
|
33
33
|
} as const;
|
|
34
34
|
|
|
35
35
|
const config = typeConfig[type];
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
{#if config.icon}
|
|
41
41
|
<config.icon class="w-5 h-5 {config.iconColor}" />
|
|
42
42
|
{/if}
|
|
43
|
-
<div class="text-sm text-
|
|
43
|
+
<div class="text-sm text-foreground">
|
|
44
44
|
{@render children?.()}
|
|
45
45
|
</div>
|
|
46
46
|
</div>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
default: 'bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow',
|
|
8
8
|
secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent',
|
|
9
9
|
destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow',
|
|
10
|
-
success: 'bg-
|
|
10
|
+
success: 'bg-success text-success-foreground hover:bg-success/90 border-transparent shadow',
|
|
11
11
|
outline: 'text-foreground'
|
|
12
12
|
}
|
|
13
13
|
},
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
<DropdownMenu.Root bind:open={dropdownOpen}>
|
|
59
59
|
<DropdownMenu.Trigger>
|
|
60
60
|
{#snippet child({ props })}
|
|
61
|
-
<Button {...props} variant="ghost" size="icon" class="data-[state=open]:bg-
|
|
61
|
+
<Button {...props} variant="ghost" size="icon" class="data-[state=open]:bg-accent h-8 w-8 p-0 hover:bg-accent {dropdownOpen ? 'bg-accent' : ''} ">
|
|
62
62
|
<EllipsisVertical class="text-muted-foreground/70 size-3.5" />
|
|
63
63
|
</Button>
|
|
64
64
|
{/snippet}
|
|
@@ -302,7 +302,7 @@ PikaTable - A reusable table component with server-side pagination, sorting, and
|
|
|
302
302
|
<Table.Root class="h-full">
|
|
303
303
|
<Table.Header>
|
|
304
304
|
{#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
|
|
305
|
-
<Table.Row class="sticky top-0 bg-
|
|
305
|
+
<Table.Row class="sticky top-0 bg-muted shadow-[inset_0_-1px_0_var(--border)]">
|
|
306
306
|
{#each headerGroup.headers as header (header.id)}
|
|
307
307
|
<Table.Head colspan={header.colSpan}>
|
|
308
308
|
{#if !header.isPlaceholder}
|
|
@@ -5,19 +5,40 @@
|
|
|
5
5
|
let { ref = $bindable(null), class: className, value, ...restProps }: TabsPrimitive.TriggerProps = $props();
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
|
-
<!--
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
<!--
|
|
9
|
+
Uses explicit CSS for styling because Tailwind v4's @tailwindcss/vite plugin only generates
|
|
10
|
+
CSS for classes found in the consuming app's src/ directory. Classes unique to external
|
|
11
|
+
packages (like this one) won't have CSS generated unless they're also used in the main app.
|
|
12
|
+
|
|
13
|
+
This means Tailwind utility classes from this component only work if the same class is
|
|
14
|
+
already used somewhere in apps/pika-chat/src/. The CSS block below ensures consistent
|
|
15
|
+
styling regardless of what classes the consuming app happens to use.
|
|
13
16
|
-->
|
|
14
17
|
|
|
15
18
|
<TabsPrimitive.Trigger
|
|
16
19
|
bind:ref
|
|
17
20
|
class={cn(
|
|
18
|
-
'ring-offset-background focus-visible:ring-ring
|
|
21
|
+
'pika-tab-trigger ring-offset-background focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
19
22
|
className
|
|
20
23
|
)}
|
|
21
24
|
{value}
|
|
22
25
|
{...restProps}
|
|
23
26
|
/>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
:global(.pika-tab-trigger[data-state='active']) {
|
|
30
|
+
background-color: var(--card);
|
|
31
|
+
color: var(--foreground);
|
|
32
|
+
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
33
|
+
border-bottom: 2px solid var(--primary);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
:global(.pika-tab-trigger[data-state='inactive']) {
|
|
37
|
+
color: var(--muted-foreground);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:global(.pika-tab-trigger[data-state='inactive']:hover) {
|
|
41
|
+
color: var(--primary);
|
|
42
|
+
background-color: color-mix(in oklch, var(--foreground) 5%, transparent);
|
|
43
|
+
}
|
|
44
|
+
</style>
|