@invopop/popui 0.1.19 → 0.1.20

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.
@@ -15,7 +15,7 @@
15
15
  </script>
16
16
 
17
17
  <button
18
- class="flex flex-col gap-4 p-3 w-[298px] bg-background border border-border rounded-xl cursor-pointer text-left transition-colors hover:border-border-default-secondary disabled:bg-background-default-secondary disabled:cursor-not-allowed disabled:pointer-events-none"
18
+ class="flex flex-col gap-4 p-3 min-w-[298px] bg-background border border-border rounded-xl cursor-pointer text-left transition-colors hover:border-border-default-secondary disabled:bg-background-default-secondary disabled:cursor-not-allowed disabled:pointer-events-none"
19
19
  disabled={type === 'soon'}
20
20
  {...rest}
21
21
  {onclick}
@@ -258,7 +258,7 @@
258
258
  <TableRow>
259
259
  {#if selectable}
260
260
  <!-- if table is selectable we need to add an extra header with a checkbox -->
261
- <TableHead class="bg-white sticky top-0 z-10 p-0 h-9">
261
+ <TableHead class="bg-background sticky top-0 z-10 p-0 h-9">
262
262
  {#if !hideSelectAll}
263
263
  <BaseTableCheckbox
264
264
  {indeterminate}
@@ -273,7 +273,7 @@
273
273
  {/if}
274
274
  {#each fields as field, i (i)}
275
275
  <TableHead
276
- class="bg-white group sticky z-10 top-0 py-0 {i === 0 && !selectable
276
+ class="bg-background group sticky z-10 top-0 py-0 {i === 0 && !selectable
277
277
  ? 'pl-3'
278
278
  : 'pl-0'} {i === fields.length - 1 && !addExtraCell ? 'pr-3' : 'pr-0'}"
279
279
  >
@@ -282,7 +282,7 @@
282
282
  {/each}
283
283
  {#if addExtraCell}
284
284
  <!-- if table has actions cell we need to add an extra header -->
285
- <th scope="col" class="bg-white sticky top-0 z-10 rounded-tr-md"> </th>
285
+ <th scope="col" class="bg-background sticky top-0 z-10 rounded-tr-md"> </th>
286
286
  {/if}
287
287
  </TableRow>
288
288
  </TableHeader>
@@ -293,10 +293,10 @@
293
293
  <th
294
294
  scope="colgroup"
295
295
  colspan={fields.length + (selectable ? 2 : 1)}
296
- class="bg-white text-left text-base font-normal text-foreground-default-secondary sticky top-9 tracking-normal h-8 z-10"
296
+ class="bg-background text-left text-base font-normal text-foreground-default-secondary sticky top-9 tracking-normal h-8 z-10"
297
297
  >
298
298
  <span
299
- class:pl-13={selectable}
299
+ class:pl-16={selectable}
300
300
  class:pl-6={!selectable}
301
301
  class="flex items-center space-x-1 box-border border-b border-border h-9"
302
302
  >
@@ -361,7 +361,7 @@
361
361
  {#each group.rows as row}
362
362
  <button
363
363
  class:cursor-default={disableRowClick}
364
- class="w-full text-left border border-neutral-20 rounded"
364
+ class="w-full text-left border border-border rounded"
365
365
  onclick={() => {
366
366
  if (disableRowClick) return
367
367
 
@@ -44,7 +44,7 @@
44
44
  {#if icons}
45
45
  <span class:ml-2={!!data} class="flex items-center gap-1 shrink-0">
46
46
  {#each icons as icon}
47
- <div class="border border-neutral-20 rounded-md p-px">
47
+ <div class="border border-border rounded-md p-px">
48
48
  {#if typeof icon === 'string'}
49
49
  <img alt="icon" src={icon} class="h-4 w-4" />
50
50
  {:else}
@@ -15,7 +15,7 @@
15
15
 
16
16
  let headerStyles = $derived(
17
17
  clsx({
18
- 'hover:bg-neutral-5 focus:bg-neutral-10': field.sortable
18
+ 'hover:bg-background-default-secondary focus:bg-background-default-tertiary': field.sortable
19
19
  })
20
20
  )
21
21
 
@@ -38,7 +38,7 @@
38
38
  fill="none"
39
39
  xmlns="http://www.w3.org/2000/svg"
40
40
  class:rotate-180={sortDirection === 'asc'}
41
- class="mt-px text-neutral-40 h-3 w-3"
41
+ class="mt-px text-icon h-3 w-3"
42
42
  >
43
43
  <path
44
44
  fill-rule="evenodd"
@@ -10,7 +10,7 @@
10
10
  title = '',
11
11
  description = '',
12
12
  accentText = '',
13
- checked = false,
13
+ checked = $bindable(false),
14
14
  disabled = false,
15
15
  icon = undefined,
16
16
  hideRadio = false,
@@ -19,44 +19,51 @@
19
19
  }: CardCheckboxProps = $props()
20
20
 
21
21
  let containerStyles = $derived(
22
- clsx('border gap-3 flex items-start', {
22
+ clsx('border gap-3', {
23
23
  'border-foreground-selected': checked,
24
24
  'border-border': !checked,
25
25
  'bg-background-default-secondary': disabled,
26
- 'px-2 py-1.5 rounded-lg': hideRadio,
27
- 'py-2 pr-2 pl-3 rounded-xl': !hideRadio
26
+ 'rounded-lg': hideRadio,
27
+ 'rounded-xl': !hideRadio
28
+ })
29
+ )
30
+
31
+ let headerStyles = $derived(
32
+ clsx('flex items-start', {
33
+ 'px-2 py-1.5': hideRadio,
34
+ 'py-2 pr-2 pl-3': !hideRadio
28
35
  })
29
36
  )
30
37
  </script>
31
38
 
32
39
  <label for={id} class="cursor-pointer">
33
40
  <div class={containerStyles}>
34
- <div class="flex grow items-start gap-1 min-w-0">
35
- {#if icon}
36
- <Icon src={icon} class="size-4 text-icon shrink-0 mt-0.5" />
37
- {/if}
38
- <div class="flex flex-col gap-1 min-w-0">
39
- <span class="text-base font-medium text-foreground">
40
- {title}
41
- </span>
42
- {#if description}
43
- <span class="text-sm text-foreground-default-secondary">
44
- {#if accentText}
45
- <span class="font-medium text-foreground-accent">{accentText}</span>
46
- {' · '}
47
- {/if}
48
- {description}
49
- </span>
41
+ <div class={headerStyles}>
42
+ <div class="flex grow items-start gap-1 min-w-0">
43
+ {#if icon}
44
+ <Icon src={icon} class="size-4 text-icon shrink-0 mt-0.5" />
50
45
  {/if}
46
+ <div class="flex flex-col gap-1 min-w-0">
47
+ <span class="text-base font-medium text-foreground">
48
+ {title}
49
+ </span>
50
+ {#if description}
51
+ <span class="text-sm text-foreground-default-secondary">
52
+ {#if accentText}
53
+ <span class="font-medium text-foreground-accent">{accentText}</span>
54
+ {' · '}
55
+ {/if}
56
+ {description}
57
+ </span>
58
+ {/if}
59
+ </div>
51
60
  </div>
52
- </div>
53
- {#if !hideRadio}
54
- <div class="flex items-center p-px">
55
- <InputRadio {id} {name} {checked} {disabled} {onchange} />
61
+ <div class={clsx('flex items-center p-px', { 'sr-only': hideRadio })}>
62
+ <InputRadio {id} {name} bind:checked {disabled} {onchange} />
56
63
  </div>
57
- {/if}
64
+ </div>
58
65
  {#if footer}
59
- <div class="px-3 pb-3 pt-2">
66
+ <div class="pl-3 pr-2 pb-3 pt-2">
60
67
  {@render footer?.()}
61
68
  </div>
62
69
  {/if}
@@ -1,4 +1,4 @@
1
1
  import type { CardCheckboxProps } from './types';
2
- declare const CardCheckbox: import("svelte").Component<CardCheckboxProps, {}, "">;
2
+ declare const CardCheckbox: import("svelte").Component<CardCheckboxProps, {}, "checked">;
3
3
  type CardCheckbox = ReturnType<typeof CardCheckbox>;
4
4
  export default CardCheckbox;
@@ -124,7 +124,7 @@
124
124
  let styles = $derived(
125
125
  clsx({
126
126
  'border-border-selected-bold shadow-active': isOpen,
127
- 'border-border hover:border-border-default-secondary-hover': !isOpen
127
+ 'border-border-secondary hover:border-border-default-secondary-hover': !isOpen
128
128
  })
129
129
  )
130
130
  let selectedLabel = $state(label)
@@ -209,7 +209,7 @@
209
209
  <div
210
210
  class:left-0={position === 'left'}
211
211
  class:right-0={position === 'right'}
212
- class="bg-white inline-flex flex-col shadow-lg rounded-xl absolute right-0 top-2 z-40 border border-border"
212
+ class="bg-background inline-flex flex-col shadow-lg rounded-xl absolute right-0 top-2 z-40 border border-border"
213
213
  use:clickOutside
214
214
  onclick_outside={() => {
215
215
  if (!isOpen) return
@@ -79,7 +79,7 @@
79
79
  {/snippet}
80
80
 
81
81
  <div
82
- class="{widthClass} border border-border rounded-2xl shadow-lg bg-white flex flex-col py-1 max-h-[480px] list-none"
82
+ class="{widthClass} border border-border rounded-2xl shadow-lg bg-background flex flex-col py-1 max-h-[480px] list-none"
83
83
  >
84
84
  {@render children?.()}
85
85
 
@@ -41,7 +41,7 @@
41
41
  let selectedColor = $derived(!multiple && items.find((i) => i.selected)?.color)
42
42
  let selectedIcon = $derived(!multiple && items.find((i) => i.selected)?.icon)
43
43
  let selectedIconColor = $derived(
44
- (!multiple && items.find((i) => i.selected)?.iconClass) || 'text-neutral-500'
44
+ (!multiple && items.find((i) => i.selected)?.iconClass) || 'text-foreground-default-secondary'
45
45
  )
46
46
  let selectedLabel = $derived(
47
47
  `${selectedItems[0]?.label || ''}${selectedItems.length > 1 ? ' and more' : ''}` || placeholder
@@ -50,7 +50,7 @@
50
50
  let styles = $derived(
51
51
  clsx('border backdrop-blur-sm backdrop-filter', {
52
52
  'border-border-selected-bold shadow-active': isOpen,
53
- 'border-border hover:border-border-default-secondary-hover': !isOpen
53
+ 'border-border-default-secondary hover:border-border-default-secondary-hover': !isOpen
54
54
  })
55
55
  )
56
56
 
@@ -27,5 +27,5 @@
27
27
  <Icon src={iconStatus} class="h-4 w-4 shrink-0 text-icon" />
28
28
  </div>
29
29
  {:else}
30
- <div class="w-4 h-4 shrink-0 bg-neutral-200 rounded-full"></div>
30
+ <div class="w-4 h-4 shrink-0 bg-background-default-secondary rounded-full"></div>
31
31
  {/if}
@@ -2,7 +2,7 @@
2
2
  import type { InputRadioProps } from './types'
3
3
 
4
4
  let {
5
- checked = false,
5
+ checked = $bindable(false),
6
6
  disabled = false,
7
7
  id = Math.random().toString(36).slice(2, 7),
8
8
  name = '',
@@ -21,7 +21,8 @@
21
21
 
22
22
  function updateInput(event: Event) {
23
23
  const target = event.target as HTMLInputElement
24
- onchange?.(target.checked)
24
+ checked = target.checked
25
+ onchange?.(checked)
25
26
  }
26
27
  </script>
27
28
 
@@ -1,4 +1,4 @@
1
1
  import type { InputRadioProps } from './types';
2
- declare const InputRadio: import("svelte").Component<InputRadioProps, {}, "">;
2
+ declare const InputRadio: import("svelte").Component<InputRadioProps, {}, "checked">;
3
3
  type InputRadio = ReturnType<typeof InputRadio>;
4
4
  export default InputRadio;
@@ -2,6 +2,6 @@
2
2
  let { percentage = 0 }: { percentage?: number } = $props()
3
3
  </script>
4
4
 
5
- <div class="w-full h-1 shrink-0 rounded-full bg-neutral-200">
6
- <div class="rounded-full h-1 bg-workspace-accent" style="width: {percentage}%;"></div>
5
+ <div class="w-full h-1 shrink-0 rounded-full bg-background-default-secondary">
6
+ <div class="rounded-full h-1 bg-foreground-accent" style="width: {percentage}%;"></div>
7
7
  </div>
@@ -20,15 +20,15 @@
20
20
  <span
21
21
  class:pl-2={icon}
22
22
  class:pl-3={!icon}
23
- class="border rounded pr-1.5 text-sm inline-flex items-center border-workspace-accent-100 bg-workspace-accent-50"
23
+ class="border rounded pr-1.5 text-sm inline-flex items-center border-border-selected bg-background-selected"
24
24
  >
25
25
  {#if resolvedIcon}
26
- <Icon src={resolvedIcon} theme={iconTheme} class="h-4 w-4 mr-1 text-workspace-accent" />
26
+ <Icon src={resolvedIcon} theme={iconTheme} class="h-4 w-4 mr-1 text-foreground-selected" />
27
27
  {/if}
28
- <span class="py-1 pr-2 text-workspace-accent tracking-normal">{label}</span>
28
+ <span class="py-1 pr-2 text-foreground-selected tracking-normal">{label}</span>
29
29
  <button
30
30
  aria-label="Clear"
31
- class="cursor-pointer py-1 border-l border-workspace-accent-100 pl-1 text-neutral-500"
31
+ class="cursor-pointer py-1 border-l border-border-selected pl-1 text-foreground-default-secondary"
32
32
  onclick={handleClear}
33
33
  >
34
34
  <svg
@@ -8,7 +8,7 @@
8
8
  bind:ref
9
9
  data-slot="alert-dialog-overlay"
10
10
  class={cn(
11
- 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-neutral-800/30 fixed inset-0 z-[1001]',
11
+ 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 bg-neutral-80/30 fixed inset-0 z-[1001]',
12
12
  className
13
13
  )}
14
14
  />
@@ -5,7 +5,7 @@
5
5
  import type { IconSource } from '@steeze-ui/svelte-icon'
6
6
 
7
7
  export const buttonVariants = tv({
8
- base: 'inline-flex items-center justify-center font-medium text-base whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-workspace-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-30 relative overflow-hidden box-border cursor-pointer',
8
+ base: 'inline-flex items-center justify-center font-medium text-base whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-selected focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-30 relative overflow-hidden box-border cursor-pointer',
9
9
  variants: {
10
10
  variant: {
11
11
  primary:
@@ -26,7 +26,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
26
26
  true: string;
27
27
  false: string;
28
28
  };
29
- }, undefined, "inline-flex items-center justify-center font-medium text-base whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-workspace-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-30 relative overflow-hidden box-border cursor-pointer", {
29
+ }, undefined, "inline-flex items-center justify-center font-medium text-base whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-selected focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-30 relative overflow-hidden box-border cursor-pointer", {
30
30
  variant: {
31
31
  primary: string;
32
32
  warning: string;
@@ -74,7 +74,7 @@ export declare const buttonVariants: import("tailwind-variants").TVReturnType<{
74
74
  true: string;
75
75
  false: string;
76
76
  };
77
- }, undefined, "inline-flex items-center justify-center font-medium text-base whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-workspace-accent focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-30 relative overflow-hidden box-border cursor-pointer", unknown, unknown, undefined>>;
77
+ }, undefined, "inline-flex items-center justify-center font-medium text-base whitespace-nowrap focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-selected focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-30 relative overflow-hidden box-border cursor-pointer", unknown, unknown, undefined>>;
78
78
  export type ButtonVariant = VariantProps<typeof buttonVariants>['variant'];
79
79
  export type ButtonSize = VariantProps<typeof buttonVariants>['size'];
80
80
  export type ButtonProps = WithElementRef<HTMLButtonAttributes> & WithElementRef<HTMLAnchorAttributes> & {
@@ -44,7 +44,7 @@
44
44
  {weekdayFormat}
45
45
  {disableDaysOutsideMonth}
46
46
  class={cn(
47
- 'bg-white group/calendar px-3 pb-2 pt-1 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',
47
+ 'bg-background group/calendar px-3 pb-2 pt-1 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent',
48
48
  className
49
49
  )}
50
50
  {locale}
@@ -8,6 +8,10 @@
8
8
  }: WithElementRef<HTMLAttributes<HTMLTableSectionElement>> = $props()
9
9
  </script>
10
10
 
11
- <tbody bind:this={ref} data-slot="table-body" class={cn('[&_tr:hover]:bg-neutral-5', className)}>
11
+ <tbody
12
+ bind:this={ref}
13
+ data-slot="table-body"
14
+ class={cn('[&_tr:hover]:bg-background-default-secondary', className)}
15
+ >
12
16
  {@render children?.()}
13
17
  </tbody>
@@ -15,7 +15,7 @@
15
15
  <thead
16
16
  bind:this={ref}
17
17
  data-slot="table-header"
18
- class={cn('[&_tr]:border-b [&_tr]:border-border bg-white', className)}
18
+ class={cn('[&_tr]:border-b [&_tr]:border-border bg-background', className)}
19
19
  onclick={bubble('click')}
20
20
  onkeydown={bubble('keydown')}
21
21
  >
@@ -18,7 +18,7 @@
18
18
  bind:this={ref}
19
19
  data-slot="table-row"
20
20
  class={cn(
21
- 'data-[state=selected]:bg-neutral-5 data-[state=checked]:bg-workspace-accent-50 transition-colors border-b border-border h-10',
21
+ 'data-[state=selected]:bg-background-default-secondary data-[state=checked]:bg-background-selected transition-colors border-b border-border h-10',
22
22
  className
23
23
  )}
24
24
  {oncontextmenu}
@@ -15,7 +15,7 @@
15
15
  {value}
16
16
  data-slot="tabs-trigger"
17
17
  class={cn(
18
- 'data-[state=active]:bg-white inline-flex items-center justify-center whitespace-nowrap px-3 py-0.5 text-base font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm w-full cursor-pointer h-full',
18
+ 'data-[state=active]:bg-background inline-flex items-center justify-center whitespace-nowrap px-3 py-0.5 text-base font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm w-full cursor-pointer h-full',
19
19
  variant === 'lg' ? 'rounded-md' : 'rounded',
20
20
  className
21
21
  )}
package/dist/types.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { IconSource } from '@steeze-ui/svelte-icon';
3
3
  import type { Snippet } from 'svelte';
4
4
  export type IconTheme = 'default' | 'solid' | 'mini';
5
5
  export type IconPosition = 'right' | 'left';
6
- export type ButtonVariant = 'warning' | 'primary' | 'secondary' | 'danger' | 'dark' | 'outline' | 'ghost';
6
+ export type ButtonVariant = 'warning' | 'primary' | 'secondary' | 'danger' | 'dark' | 'outline' | 'ghost' | 'dark-ghost';
7
7
  export type StatusType = 'grey' | 'green' | 'yellow' | 'red' | 'orange' | 'blue' | 'purple' | 'olive' | 'teal' | 'crimson' | 'blueViolet' | 'steelBlue' | 'empty';
8
8
  export type AnyProp = string | number | object | boolean;
9
9
  export type SidebarIcon = {
@@ -363,11 +363,6 @@ export interface DrawerContextItemProps {
363
363
  onclick?: (value: AnyProp) => void;
364
364
  onchange?: (item: DrawerOption) => void;
365
365
  }
366
- export interface DrawerContextWorkspaceProps {
367
- items?: DrawerOption[];
368
- multiple?: boolean;
369
- onclick?: (value: AnyProp) => void;
370
- }
371
366
  export interface DropdownSelectProps {
372
367
  value?: AnyProp;
373
368
  icon?: IconSource | string | undefined;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@invopop/popui",
3
3
  "license": "MIT",
4
- "version": "0.1.19",
4
+ "version": "0.1.20",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "dev:clean": "npm run clean && vite dev",
@@ -1,126 +0,0 @@
1
- <script lang="ts">
2
- import type { DrawerContextWorkspaceProps } from './types.ts'
3
- import DrawerContextItem from './DrawerContextItem.svelte'
4
- import { Icon } from '@steeze-ui/svelte-icon'
5
- import { AddCircle, ExternalLink, Workspace } from '@invopop/ui-icons'
6
- import BaseCounter from './BaseCounter.svelte'
7
- import EmptyState from './EmptyState.svelte'
8
- import { slide } from 'svelte/transition'
9
- import { ChevronRight } from '@steeze-ui/heroicons'
10
-
11
- let { items = [], multiple = false, onclick }: DrawerContextWorkspaceProps = $props()
12
- let liveOpen = $state(false)
13
- let sandboxOpen = $state(false)
14
- let liveItems = $derived(items.filter((i) => !i.sandbox))
15
- let sandboxItems = $derived(items.filter((i) => i.sandbox))
16
- let selectedItem = $derived(items.find((i) => i.selected))
17
-
18
- $effect(() => {
19
- if (selectedItem) {
20
- if (selectedItem.sandbox) {
21
- sandboxOpen = true
22
- } else {
23
- liveOpen = true
24
- }
25
- }
26
- })
27
- </script>
28
-
29
- <div class="w-[300px] border border-neutral-200 rounded-md shadow-lg bg-white">
30
- <div class="max-h-[550px] overflow-hidden rounded-t-md">
31
- <button
32
- class="cursor-pointer flex items-center justify-between bg-neutral-50 border-b border-neutral-200 rounded-t-sm h-9 py-2 pl-2.5 pr-3 text-base font-medium text-neutral-800 w-full"
33
- onclick={() => {
34
- if (liveOpen) return
35
- liveOpen = true
36
- sandboxOpen = false
37
- }}
38
- >
39
- <div class="flex items-center space-x-1.5">
40
- <Icon
41
- src={ChevronRight}
42
- class="h-4 w-4 text-neutral-500 transition-all transform {liveOpen ? 'rotate-90' : ''}"
43
- />
44
- <span>Live</span>
45
- </div>
46
- {#if liveItems.length}
47
- <BaseCounter value={liveItems.length} />
48
- {/if}
49
- </button>
50
- {#if liveOpen}
51
- <div transition:slide class="max-h-[475px] overflow-auto">
52
- {#if !liveItems.length}
53
- <div class="h-[182px] overflow-x-hidden">
54
- <EmptyState
55
- iconSource={Workspace}
56
- title="No workspaces here"
57
- description="Create a workspace to start"
58
- />
59
- </div>
60
- {/if}
61
- <ul class="p-1 space-y-1">
62
- {#each liveItems as item}
63
- <DrawerContextItem {item} {multiple} workspace {onclick} />
64
- {/each}
65
- </ul>
66
- </div>
67
- {/if}
68
- <button
69
- class="cursor-pointer flex items-center justify-between bg-neutral-50 border-b border-neutral-200 h-9 py-2 pl-2.5 pr-3 text-base font-medium text-neutral-800 w-full"
70
- class:border-t={liveOpen}
71
- onclick={() => {
72
- if (sandboxOpen) return
73
- sandboxOpen = true
74
- liveOpen = false
75
- }}
76
- >
77
- <div class="flex items-center space-x-1.5">
78
- <Icon
79
- src={ChevronRight}
80
- class="h-4 w-4 text-neutral-500 transition-all transform {sandboxOpen ? 'rotate-90' : ''}"
81
- />
82
- <span>Sandbox</span>
83
- </div>
84
- {#if sandboxItems.length}
85
- <BaseCounter value={sandboxItems.length} />
86
- {/if}
87
- </button>
88
- {#if sandboxOpen}
89
- <div transition:slide class="max-h-[475px] overflow-auto">
90
- {#if !sandboxItems.length}
91
- <div class="h-[182px] overflow-x-hidden">
92
- <EmptyState
93
- iconSource={Workspace}
94
- title="No workspaces here"
95
- description="Create a workspace to start"
96
- />
97
- </div>
98
- {/if}
99
- <ul class="p-1 space-y-1">
100
- {#each sandboxItems as item}
101
- <DrawerContextItem {item} {multiple} workspace {onclick} />
102
- {/each}
103
- </ul>
104
- </div>
105
- {/if}
106
- </div>
107
-
108
- <ul class="px-1 space-y-1 bg-neutral-50 rounded-b border-t border-neutral-100 py-1">
109
- <li class="pl-1.5 py-1.5 pr-2 hover:bg-neutral-100 rounded-sm">
110
- <button
111
- class="cursor-pointer flex items-center justify-between w-full"
112
- onclick={() => {
113
- onclick?.('add')
114
- }}
115
- >
116
- <div class="flex items-center space-x-1.5">
117
- <Icon src={AddCircle} class="w-4 h-4 text-neutral-800 shrink-0" />
118
- <span class="text-neutral-800 tracking-tight text-base font-medium">Create workspace</span
119
- >
120
- </div>
121
-
122
- <Icon src={ExternalLink} class="w-4 h-4 text-neutral-400 shrink-0" />
123
- </button>
124
- </li>
125
- </ul>
126
- </div>
@@ -1,4 +0,0 @@
1
- import type { DrawerContextWorkspaceProps } from './types.ts';
2
- declare const DrawerContextWorkspace: import("svelte").Component<DrawerContextWorkspaceProps, {}, "">;
3
- type DrawerContextWorkspace = ReturnType<typeof DrawerContextWorkspace>;
4
- export default DrawerContextWorkspace;
@@ -1,73 +0,0 @@
1
- <script lang="ts">
2
- import type { EmptyStateIcon, EmptyStateIllustrationProps } from './types.js'
3
- import BgPattern from './svg/BgPattern.svelte'
4
- import IconContact from './svg/IconContact.svelte'
5
- import IconInvoice from './svg/IconInvoice.svelte'
6
- import IconProduct from './svg/IconProduct.svelte'
7
- import IconFile from './svg/IconFile.svelte'
8
- import IconPdf from './svg/IconPdf.svelte'
9
- import IconNoResults from './svg/IconNoResults.svelte'
10
- import type { SvelteComponent } from 'svelte'
11
- import IconDelivery from './svg/IconDelivery.svelte'
12
- import IconOrder from './svg/IconOrder.svelte'
13
- import IconPayment from './svg/IconPayment.svelte'
14
-
15
- let {
16
- icon = undefined,
17
- title = '',
18
- description = '',
19
- children
20
- }: EmptyStateIllustrationProps = $props()
21
-
22
- function getComponent(icon: EmptyStateIcon | undefined) {
23
- if (!icon) return undefined
24
-
25
- const icons: Record<EmptyStateIcon, unknown> = {
26
- invoices: IconInvoice,
27
- contacts: IconContact,
28
- parties: IconContact,
29
- products: IconProduct,
30
- deliveries: IconDelivery,
31
- orders: IconOrder,
32
- payments: IconPayment,
33
- file: IconFile,
34
- pdf: IconPdf,
35
- 'no-results': IconNoResults
36
- }
37
-
38
- return icons[icon] as typeof SvelteComponent
39
- }
40
- let iconComponent = $derived(getComponent(icon))
41
- </script>
42
-
43
- <div
44
- class="flex flex-col text-center items-center justify-center h-full font-sans gap-1"
45
- aria-label={title}
46
- >
47
- {#if iconComponent}
48
- {@const SvelteComponent_1 = iconComponent}
49
- {@const SvelteComponent_2 = iconComponent}
50
- {@const SvelteComponent_3 = iconComponent}
51
- <div class="relative h-[120px] w-full max-w-sm">
52
- <div class="absolute top-0 left-0">
53
- <BgPattern />
54
- </div>
55
- <SvelteComponent_1
56
- classes="text-neutral-400/40 absolute left-[50%] translate-x-[-50%] top-[50%] translate-y-[-50%] -ml-[40px] rotate-[-8deg] mt-0.5 z-20 w-[86px] h-[104px]"
57
- />
58
- <SvelteComponent_2
59
- classes="{icon === 'no-results'
60
- ? 'text-neutral-400'
61
- : 'text-workspace-accent'} absolute left-[50%] translate-x-[-50%] top-[50%] translate-y-[-50%] z-30 w-[97px] h-[117px]"
62
- />
63
- <SvelteComponent_3
64
- classes="text-neutral-400/40 absolute left-[50%] translate-x-[-50%] top-[50%] translate-y-[-50%] ml-[40px] rotate-[8deg] mt-0.5 z-20 w-[86px] h-[104px]"
65
- />
66
- </div>
67
- {/if}
68
- <div class="space-y-0.5">
69
- <h4 class="font-medium text-neutral-800 text-base tracking-tight">{title}</h4>
70
- <p class="max-w-xs text-base text-neutral-500 tracking-normal">{description}</p>
71
- <p>{@render children?.()}</p>
72
- </div>
73
- </div>
@@ -1,3 +0,0 @@
1
- declare const EmptyStateIllustration: import("svelte").Component<EmptyStateIllustrationProps, {}, "">;
2
- type EmptyStateIllustration = ReturnType<typeof EmptyStateIllustration>;
3
- export default EmptyStateIllustration;