@invopop/popui 0.1.19 → 0.1.21

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.
Files changed (39) hide show
  1. package/dist/BaseCard.svelte +2 -2
  2. package/dist/BaseTable.svelte +6 -6
  3. package/dist/BaseTableCellContent.svelte +1 -1
  4. package/dist/BaseTableHeaderContent.svelte +2 -2
  5. package/dist/CardCheckbox.svelte +33 -26
  6. package/dist/CardCheckbox.svelte.d.ts +1 -1
  7. package/dist/DatePicker.svelte +3 -3
  8. package/dist/DrawerContext.svelte +1 -1
  9. package/dist/DropdownSelect.svelte +2 -2
  10. package/dist/EmptyState.svelte +1 -1
  11. package/dist/FeedIconEvent.svelte +1 -1
  12. package/dist/FeedIconStatus.svelte +1 -1
  13. package/dist/FeedViewer.svelte +1 -1
  14. package/dist/InputCheckbox.svelte +1 -1
  15. package/dist/InputRadio.svelte +4 -3
  16. package/dist/InputRadio.svelte.d.ts +1 -1
  17. package/dist/ProfileAvatar.svelte +1 -1
  18. package/dist/ProgressBar.svelte +2 -2
  19. package/dist/ShortcutWrapper.svelte +1 -1
  20. package/dist/TagSearch.svelte +4 -4
  21. package/dist/alert-dialog/alert-dialog-overlay.svelte +1 -1
  22. package/dist/button/button.svelte +1 -1
  23. package/dist/button/button.svelte.d.ts +2 -2
  24. package/dist/range-calendar/range-calendar-day.svelte +3 -3
  25. package/dist/range-calendar/range-calendar-header.svelte +1 -1
  26. package/dist/range-calendar/range-calendar-month-select.svelte +1 -1
  27. package/dist/range-calendar/range-calendar.svelte +1 -1
  28. package/dist/svg/IconEmpty.svelte +79 -59
  29. package/dist/table/table-body.svelte +5 -1
  30. package/dist/table/table-header.svelte +1 -1
  31. package/dist/table/table-row.svelte +1 -1
  32. package/dist/tabs/tabs-trigger.svelte +1 -1
  33. package/dist/tailwind.theme.css +11 -9
  34. package/dist/types.d.ts +1 -6
  35. package/package.json +1 -1
  36. package/dist/DrawerContextWorkspace.svelte +0 -126
  37. package/dist/DrawerContextWorkspace.svelte.d.ts +0 -4
  38. package/dist/EmptyStateIllustration.svelte +0 -73
  39. package/dist/EmptyStateIllustration.svelte.d.ts +0 -3
@@ -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}
@@ -45,7 +45,7 @@
45
45
  </div>
46
46
  {/if}
47
47
  </div>
48
- <div class="flex flex-col gap-0.5 w-full">
48
+ <div class="flex flex-col gap-0.5 w-full flex-1">
49
49
  <h3 class="font-medium text-sm leading-5 tracking-[-0.07px] text-foreground w-full">
50
50
  {title}
51
51
  </h3>
@@ -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)
@@ -188,7 +188,7 @@
188
188
  onclick={() => {
189
189
  isOpen = !isOpen
190
190
  }}
191
- class="{styles} datepicker-trigger w-full py-1.25 pl-7 pr-8 border rounded-lg text-foreground placeholder-foreground text-base cursor-pointer"
191
+ class="{styles} datepicker-trigger w-full py-1.25 pl-7 pr-8 border border-border-default-secondary rounded-lg text-foreground placeholder-foreground text-base cursor-pointer"
192
192
  >
193
193
  {selectedLabel}
194
194
  </button>
@@ -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
 
@@ -23,7 +23,7 @@
23
23
  <div class="relative h-[120px] w-[352px] max-w-sm">
24
24
  <IconEmpty />
25
25
  <div class="absolute left-1/2 -translate-x-1/2 top-1/2 -translate-y-1/2">
26
- <Icon src={iconSource} class="size-10 text-foreground-accent" />
26
+ <Icon src={iconSource} class="size-10 text-icon-accent" />
27
27
  {#if check}
28
28
  <CheckBadge />
29
29
  {/if}
@@ -5,7 +5,7 @@
5
5
  let { icon = undefined, iconTheme = 'default' }: FeedIconEventProps = $props()
6
6
  </script>
7
7
 
8
- <div class="relative py-0.5 mt-2">
8
+ <div class="relative py-0.5 mt-2 bg-background">
9
9
  {#if icon}
10
10
  <Icon src={icon} theme={iconTheme} class="size-4 text-icon-default-bold" />
11
11
  {/if}
@@ -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}
@@ -5,7 +5,7 @@
5
5
  let { items = [], onView }: FeedViewerProps = $props()
6
6
  </script>
7
7
 
8
- <div>
8
+ <div class="space-y-1">
9
9
  {#each items as item, i (i)}
10
10
  <FeedItem {...item} hasNext={i < items.length - 1} {onView} />
11
11
  {/each}
@@ -26,7 +26,7 @@
26
26
  type="checkbox"
27
27
  {checked}
28
28
  {indeterminate}
29
- class="form-checkbox size-4 text-background-accent rounded border border-border-default-secondary hover:border-border-default-primary focus:ring-0 focus:ring-offset-0"
29
+ class="form-checkbox size-4 text-background-accent rounded border border-border-default-secondary hover:border-border-default-primary focus:ring-0 focus:ring-offset-0 bg-background"
30
30
  {...rest}
31
31
  onchange={updateInput}
32
32
  {onclick}
@@ -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
 
@@ -33,7 +34,7 @@
33
34
  {name}
34
35
  {checked}
35
36
  {disabled}
36
- class="appearance-none size-4 rounded-full border checked:border-0 checked:bg-background-accent checked:border-0 checked:bg-background-accent cursor-pointer focus:outline-none focus:ring-0 shrink-0 disabled:cursor-not-allowed border-border-default-secondary disabled:checked:bg-border-default-secondary disabled:checked:border"
37
+ class="appearance-none size-4 rounded-full border checked:border-0 checked:bg-background-accent cursor-pointer focus:outline-none focus:ring-0 shrink-0 disabled:cursor-not-allowed border-border-default-secondary disabled:checked:bg-border-default-secondary disabled:checked:border bg-background"
37
38
  {...rest}
38
39
  onchange={updateInput}
39
40
  />
@@ -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;
@@ -24,7 +24,7 @@
24
24
  {
25
25
  'bg-background after:shadow-avatar': !dark
26
26
  },
27
- { 'border-border-inverse after:shadow-avatar-inverse': dark }
27
+ { 'bg-background-inverse after:shadow-avatar-inverse': dark }
28
28
  )
29
29
  )
30
30
 
@@ -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>
@@ -8,7 +8,7 @@
8
8
  clsx('inline-flex items-center justify-center border', {
9
9
  'size-4 rounded': size === 'sm',
10
10
  'size-5 rounded-md': size === 'md',
11
- 'bg-background-default-secondary border-border-default-secondary shadow-[0px_1px_0px_#DFE0E6] text-foreground-default-secondary':
11
+ 'bg-background-default-secondary border-border-default-secondary shadow-shortcut text-foreground-default-secondary':
12
12
  theme === 'light',
13
13
  'bg-background-inverse-secondary border-border-inverse-secondary shadow-[0px_1px_0px_rgba(255,255,255,0.20)] text-foreground-inverse-secondary':
14
14
  theme === 'navigation'
@@ -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> & {
@@ -13,15 +13,15 @@
13
13
  bind:ref
14
14
  class={cn(
15
15
  buttonVariants({ variant: 'ghost' }),
16
- 'size-(--cell-size) flex select-none flex-col items-center justify-center gap-1 whitespace-nowrap p-0 font-medium leading-none rounded-lg',
16
+ 'size-(--cell-size) flex select-none flex-col items-center justify-center gap-1 whitespace-nowrap p-0 font-medium leading-none rounded-lg text-foreground!',
17
17
  // today
18
18
  '[&[data-today]:not([data-selected]):not([data-outside-month])]:border-b [&[data-today]:not([data-selected]):not([data-outside-month])]:border-background-accent [&[data-today]:not([data-selected]):not([data-outside-month])]:rounded-none',
19
19
  // range Start
20
- 'data-[range-start]:bg-background-accent data-[range-start]:text-white data-[range-start]:font-semibold data-[range-start]:shadow-[0px_0px_0px_2px_rgba(22,153,88,0.12)]',
20
+ 'data-[range-start]:bg-background-accent data-[range-start]:text-foreground-inverse! data-[range-start]:font-semibold data-[range-start]:shadow-[0px_0px_0px_2px_rgba(22,153,88,0.12)]',
21
21
  // range middle
22
22
  'data-[range-middle]:rounded-none data-[range-middle]:bg-background-default-secondary',
23
23
  // range End
24
- 'data-[range-end]:bg-background-accent data-[range-end]:text-white data-[range-end]:font-semibold data-[range-end]:shadow-[0px_0px_0px_2px_rgba(22,153,88,0.12)]',
24
+ 'data-[range-end]:bg-background-accent data-[range-end]:text-foreground-inverse! data-[range-end]:font-semibold data-[range-end]:shadow-[0px_0px_0px_2px_rgba(22,153,88,0.12)]',
25
25
  // Outside months - must come after range styles to override
26
26
  '[&[data-outside-month]]:!text-transparent [&[data-outside-month]]:!bg-transparent [&[data-outside-month]]:!shadow-none [&[data-outside-month]:not([data-selected])]:pointer-events-none',
27
27
  // Disabled
@@ -11,7 +11,7 @@
11
11
  <RangeCalendarPrimitive.Header
12
12
  bind:ref
13
13
  class={cn(
14
- 'h-11 flex w-full items-center justify-center gap-1.5 text-base font-medium pt-2 pb-3',
14
+ 'h-11 flex w-full items-center justify-center gap-1.5 text-base font-medium pt-2 pb-3 text-foreground',
15
15
  className
16
16
  )}
17
17
  {...restProps}
@@ -33,7 +33,7 @@
33
33
  {/each}
34
34
  </select>
35
35
  <span
36
- class="[&>svg]:text-muted-foreground flex h-8 select-none items-center gap-1 rounded-md pl-2 pr-1 text-sm font-medium [&>svg]:size-3.5"
36
+ class="[&>svg]:text-foreground flex h-8 select-none items-center gap-1 rounded-md pl-2 pr-1 text-sm font-medium [&>svg]:size-3.5"
37
37
  aria-hidden="true"
38
38
  >
39
39
  {monthItems.find((item) => item.value === value)?.label || selectedMonthItem.label}
@@ -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}
@@ -1,12 +1,7 @@
1
- <svg
2
- fill="none"
3
- xmlns="http://www.w3.org/2000/svg"
4
- viewBox="0 0 352 120"
5
- class="text-foreground-accent"
6
- >
7
- <g clip-path="url(#a99)">
1
+ <svg width="352" height="120" viewBox="0 0 352 120" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_1410_923)">
8
3
  <mask
9
- id="b98"
4
+ id="mask0_1410_923"
10
5
  style="mask-type:alpha"
11
6
  maskUnits="userSpaceOnUse"
12
7
  x="0"
@@ -15,31 +10,33 @@
15
10
  height="121"
16
11
  >
17
12
  <path
18
- d="M0-1h353v121H0V-1Zm78 47a6 6 0 0 1 6-6h30a6 6 0 0 1 6 6v30a6 6 0 0 1-6 6H84a6 6 0 0 1-6-6V46Zm167-6a6 6 0 0 0-6 6v30a6 6 0 0 0 6 6h30a6 6 0 0 0 6-6V46a6 6 0 0 0-6-6h-30Z"
19
- fill-rule="evenodd"
20
- clip-rule="evenodd"
21
- fill="#D9D9D9"
13
+ d="M353 120H0V-1H353V120ZM84 40C80.6863 40 78 42.6863 78 46V76C78 79.3137 80.6863 82 84 82H114C117.314 82 120 79.3137 120 76V46C120 42.6863 117.314 40 114 40H84ZM245 40C241.686 40 239 42.6863 239 46V76C239 79.3137 241.686 82 245 82H275C278.314 82 281 79.3137 281 76V46C281 42.6863 278.314 40 275 40H245Z"
14
+ fill="black"
22
15
  />
23
16
  </mask>
24
- <g mask="url(#b98)">
17
+ <g mask="url(#mask0_1410_923)">
25
18
  <path
26
- d="M35.6 12.4H.4m35.2 0v-48.6m0 48.6 17.5 24.4M.4 61l-35.1-48.6H.4M.4 61v48.5M.3 61h70.2M.3 109.5h-35l35 48.6h35m-35-48.6h35m-35 0 35 48.6m70.4 0 17.5 24.5v-48.8m-17.5 24.3H70.5m35.2 0-17.5-24.3m17.5 24.3v-48.6m17.5 24.3 17.6 24.3H176l-35.2-48.6m-17.6 24.3-17.5-24.3m35.1 0H176m-35.2 0-35-48.5m35 48.5h-35.1m70.3 0 35 48.6h35.2M176 109.5h70.3m-70.3 0L140.8 61h-35"
27
- stroke="url(#c97)"
28
- stroke-width=".6"
19
+ d="M35.6124 12.398H0.445778M35.6124 12.398V-36.2311M35.6124 12.398L53.126 36.7825M0.445778 61.0272L-34.7209 12.398H0.445778M0.445778 61.0272L0.306227 109.517M0.445778 61.0272H70.6396M0.306227 109.517H-34.7209L0.306227 158.146H35.3333M0.306227 109.517H35.3333M0.306227 109.517L35.3333 158.146M105.667 158.146L123.25 182.6V133.831M105.667 158.146H70.5M105.667 158.146L88.1531 133.831M105.667 158.146V109.517M123.25 133.831L140.833 158.146H175.954L140.833 109.517M123.25 133.831L105.667 109.517M140.833 109.517H176M140.833 109.517L105.806 61.0272M140.833 109.517H105.667M176 109.517L211.027 158.146H246.194M176 109.517H246.333M176 109.517L140.833 61.0272H105.806M316.527 158.146L334.11 182.6V133.971M316.527 158.146L316.574 109.656M316.527 158.146H281.36M316.527 158.146L281.5 109.517M334.11 133.971L351.554 158.146H386.721L351.694 109.656M334.11 133.971L316.574 109.656M351.694 109.656H386.86L351.694 61.0272H316.667M351.694 109.656L316.667 61.0272M351.694 109.656H316.574M316.667 61.0272V-36.2311H351.833V12.398H281.5M316.667 61.0272H281.5M281.5 12.398V61.0272M281.5 12.398C281.5 -6.59284 281.5 -17.2403 281.5 -36.2311L263.917 -60.6156M281.5 12.398L246.333 -36.2311M281.5 61.0272L246.333 12.2583M281.5 61.0272H246.333M281.5 61.0272V109.517M281.5 61.0272L299.037 85.3417M211.167 61.0272L176 12.2583H211.167M211.167 61.0272H246.333M211.167 61.0272V109.517L246.194 158.146M246.333 12.2583V-36.2311M246.333 12.2583H211.167M246.333 -36.2311V-85L263.917 -60.6156M246.333 -36.2311H211.167V12.2583M263.917 -60.6156V36.6427M211.167 12.2583L246.333 61.0272M246.333 61.0272V109.517M316.574 109.656L299.037 85.3417M246.194 158.146H281.36M281.5 109.517H246.333M246.333 109.517L281.36 158.146M299.037 85.3417V133.831M0.445778 12.398V-36.2311H35.6124M0.445778 12.398L35.3333 61.0272V109.517M35.6124 -36.2311V-84.8603L53.126 -60.4758M35.6124 -36.2311L70.6396 12.5378M70.6396 12.5378V-36.0914L53.126 -60.4758M70.6396 12.5378H140.973V-36.0914H105.806V61.0272M70.6396 12.5378V61.0272M70.6396 61.0272L53.126 36.7825M70.6396 61.0272H105.806M70.6396 61.0272V109.517M70.6396 61.0272L88.1531 85.2719M53.126 -60.4758V36.7825M105.667 109.517L88.1531 85.2719M70.6396 109.517H35.3333M70.6396 109.517L88.1531 133.831M35.3333 109.517L70.5 158.146M35.3333 158.146H70.5M88.1531 85.2719V133.831"
20
+ stroke="url(#paint0_radial_1410_923)"
21
+ stroke-width="0.6"
29
22
  />
30
23
  </g>
31
- <g filter="url(#d96)">
32
- <rect x="144" y="28" width="64" height="64" rx="12" fill="white" />
33
- <rect x="144" y="28" width="64" height="64" rx="12" />
24
+ <foreignObject x="124" y="8" width="104" height="106"
25
+ ><div
26
+ xmlns="http://www.w3.org/1999/xhtml"
27
+ style="backdrop-filter:blur(10px);clip-path:url(#bgblur_1_1410_923_clip_path);height:100%;width:100%"
28
+ ></div></foreignObject
29
+ ><g filter="url(#filter0_d_1410_923)" data-figma-bg-blur-radius="20">
30
+ <rect x="144" y="28" width="64" height="64" rx="12" fill="var(--color-background)" />
34
31
  <rect
35
32
  x="144.4"
36
33
  y="28.4"
37
34
  width="63.2"
38
35
  height="63.2"
39
36
  rx="11.6"
40
- stroke="currentColor"
41
- stroke-opacity=".6"
42
- stroke-width="1"
37
+ class="stroke-border-selected-bold"
38
+ stroke-opacity="0.6"
39
+ stroke-width="0.8"
43
40
  />
44
41
  <rect
45
42
  x="148.3"
@@ -47,50 +44,53 @@
47
44
  width="55.4"
48
45
  height="55.4"
49
46
  rx="7.7"
50
- stroke="currentColor"
51
- stroke-opacity=".4"
52
- stroke-width=".6"
47
+ class="stroke-border-selected-bold"
48
+ stroke-opacity="0.4"
49
+ stroke-width="0.6"
53
50
  />
54
51
  </g>
55
52
  <rect
56
- x="238.3"
57
- y="39.3"
58
- width="43.3"
59
- height="43.3"
60
- rx="7.7"
61
- stroke="#030712"
62
- stroke-opacity=".1"
63
- stroke-width=".7"
53
+ x="238.344"
54
+ y="39.3438"
55
+ width="43.3125"
56
+ height="43.3125"
57
+ rx="7.65625"
58
+ class="stroke-border-default-secondary"
59
+ stroke-width="0.6875"
64
60
  stroke-dasharray="2 3"
65
61
  />
66
62
  <rect
67
- x="80"
68
- y="42"
69
- width="38.1"
70
- height="38.1"
71
- rx="5.3"
72
- stroke="#030712"
73
- stroke-opacity=".1"
74
- stroke-width=".4"
63
+ x="79.9563"
64
+ y="41.9563"
65
+ width="38.0875"
66
+ height="38.0875"
67
+ rx="5.29375"
68
+ class="stroke-border-default-secondary"
69
+ stroke-width="0.4125"
70
+ />
71
+ <rect
72
+ x="240.956"
73
+ y="41.9563"
74
+ width="38.0875"
75
+ height="38.0875"
76
+ rx="5.29375"
77
+ class="stroke-border-default-secondary"
78
+ stroke-width="0.4125"
79
+ />
80
+ <rect
81
+ x="77.3438"
82
+ y="39.3438"
83
+ width="43.3125"
84
+ height="43.3125"
85
+ rx="7.65625"
86
+ class="stroke-border-default-secondary"
87
+ stroke-width="0.6875"
88
+ stroke-dasharray="2 3"
75
89
  />
76
90
  </g>
77
91
  <defs>
78
- <radialGradient
79
- id="c97"
80
- cx="0"
81
- cy="0"
82
- r="1"
83
- gradientUnits="userSpaceOnUse"
84
- gradientTransform="matrix(.06967 120.59998 -345.06394 .19934 176 62)"
85
- >
86
- <stop stop-color="#D1D5DB" stop-opacity=".6" />
87
- <stop offset=".5" stop-color="#D1D5DB" stop-opacity="0" />
88
- </radialGradient>
89
- <clipPath id="a99">
90
- <path fill="#fff" d="M0 0h352v120H0z" />
91
- </clipPath>
92
92
  <filter
93
- id="d96"
93
+ id="filter0_d_1410_923"
94
94
  x="124"
95
95
  y="8"
96
96
  width="104"
@@ -101,15 +101,35 @@
101
101
  <feFlood flood-opacity="0" result="BackgroundImageFix" />
102
102
  <feColorMatrix
103
103
  in="SourceAlpha"
104
+ type="matrix"
104
105
  values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
105
106
  result="hardAlpha"
106
107
  />
107
108
  <feOffset dy="2" />
108
109
  <feGaussianBlur stdDeviation="10" />
109
110
  <feComposite in2="hardAlpha" operator="out" />
110
- <feColorMatrix values="0 0 0 0 0.0392157 0 0 0 0 0.0392157 0 0 0 0 0.0392157 0 0 0 0.04 0" />
111
- <feBlend in2="BackgroundImageFix" result="effect1_dropShadow_280_210" />
112
- <feBlend in="SourceGraphic" in2="effect1_dropShadow_280_210" result="shape" />
111
+ <feColorMatrix
112
+ type="matrix"
113
+ values="0 0 0 0 0.0392157 0 0 0 0 0.0392157 0 0 0 0 0.0392157 0 0 0 0.04 0"
114
+ />
115
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1410_923" />
116
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1410_923" result="shape" />
113
117
  </filter>
118
+ <clipPath id="bgblur_1_1410_923_clip_path" transform="translate(-124 -8)"
119
+ ><rect x="144" y="28" width="64" height="64" rx="12" />
120
+ </clipPath><radialGradient
121
+ id="paint0_radial_1410_923"
122
+ cx="0"
123
+ cy="0"
124
+ r="1"
125
+ gradientUnits="userSpaceOnUse"
126
+ gradientTransform="translate(176 62) rotate(89.9669) scale(120.6 345.064)"
127
+ >
128
+ <stop stop-opacity="0.1" />
129
+ <stop stop-color="var(--color-border-default-secondary)" offset="0.537503" stop-opacity="0" />
130
+ </radialGradient>
131
+ <clipPath id="clip0_1410_923">
132
+ <rect width="352" height="120" fill="var(--color-background)" />
133
+ </clipPath>
114
134
  </defs>
115
135
  </svg>
@@ -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
  )}
@@ -673,6 +673,7 @@
673
673
  --color-icon-inverse-bold: var(--color-neutral-white-alpha-100);
674
674
 
675
675
  --color-icon-selected-default: var(--color-positive-50);
676
+ --color-icon-accent-default: var(--color-accent-50);
676
677
 
677
678
  --color-icon-success-default: var(--color-positive-50);
678
679
 
@@ -758,7 +759,7 @@
758
759
  --color-icon: var(--color-icon-default-default);
759
760
 
760
761
  --color-icon-inverse: var(--color-icon-inverse-default);
761
-
762
+ --color-icon-accent: var(--color-icon-accent-default);
762
763
  --color-icon-selected: var(--color-icon-selected-default);
763
764
  --color-icon-success: var(--color-icon-success-default);
764
765
  --color-icon-info: var(--color-icon-info-default);
@@ -780,13 +781,14 @@
780
781
  --shadow-lg: 0 8px 30px 0 rgba(10, 10, 10, 0.12);
781
782
  --shadow-xl: 0 8px 28px -6px rgba(10, 10, 10, 0.12), 0 18px 88px -4px rgba(10, 10, 10, 0.14);
782
783
  --shadow-active: 0px 0px 0px 2px color-mix(in lab, transparent 88%, var(--color-background-accent-default, var(--color-positive-50)));
783
- --shadow-warning: 0px 0px 0px 2px rgba(215, 135, 0, 0.12);
784
784
  --shadow-button-default: 0 2px 6px -1px rgba(11, 11, 16, 0.04), 0 -2px 4px 0 rgba(11, 11, 16, 0.04) inset;
785
785
  --shadow-button-primary: 0 -4px 4px 0 rgba(11, 11, 16, 0.12) inset, 0 1px 1.5px 0 rgba(255, 255, 255, 0.16) inset, 0 2px 4px -1px rgba(11, 11, 16, 0.08);
786
786
  --shadow-button-pressed: 0 2px 6px 0 rgba(11, 11, 16, 0.16) inset, 0 -2px 5px -2px rgba(255, 255, 255, 0.25) inset;
787
787
  --shadow-button-dark-pressed: 0 4px 4px -1px rgba(11, 11, 16, 0.16) inset;
788
- --shadow-avatar: 0 0 0 1px rgba(5, 5, 36, 0.06) inset;
789
- --shadow-avatar-inverse: 0 0 0 1px rgba(255, 255, 255, 0.10) inset;
788
+ --shadow-avatar: 0 0 0 1px var(--color-border-default-default) inset;
789
+ --shadow-avatar-inverse: 0 0 0 1px var(--color-border-inverse-default) inset;
790
+ --shadow-shortcut: 0 1px 0 0 var(--color-border-default-secondary);
791
+ --shadow-shortcut-inverse: 0 1px 0 0 var(--color-border-inverse-secondary);
790
792
 
791
793
  /* Letter Spacing (tracking) */
792
794
  --tracking-tightest: -0.29px; /* -1.2% (text-2xl) */
@@ -829,7 +831,7 @@
829
831
  --color-foreground-default-tertiary: var(--color-neutral-white-alpha-40);
830
832
 
831
833
  --color-foreground-inverse-default: var(--color-white);
832
- --color-foreground-inverse-secondary: var(--color-neutral-alpha-70);
834
+ --color-foreground-inverse-secondary: var(--color-neutral-white-alpha-70);
833
835
 
834
836
  --color-foreground-accent-default: var(--color-accent-60);
835
837
  --color-foreground-accent-default-hover: var(--color-accent-70);
@@ -877,9 +879,9 @@
877
879
  --color-background-selected-default: var(--color-accent-alpha-20);
878
880
  --color-background-selected-default-hover: var(--color-accent-alpha-30);
879
881
  --color-background-selected-default-press: var(--color-accent-alpha-40);
880
- --color-background-selected-inverse: var(--color-neutral-alpha-10);
881
- --color-background-selected-inverse-hover: var(--color-neutral-alpha-20);
882
- --color-background-selected-inverse-press: var(--color-neutral-alpha-30);
882
+ --color-background-selected-inverse: var(--color-white-10);
883
+ --color-background-selected-inverse-hover: var(--color-nwhite-20);
884
+ --color-background-selected-inverse-press: var(--color-white-30);
883
885
 
884
886
  --color-background-accent-default: var(--color-accent-60);
885
887
  --color-background-accent-default-hover: var(--color-accent-70);
@@ -949,7 +951,7 @@
949
951
  --color-icon-inverse-bold: var(--color-neutral-white-alpha-100);
950
952
 
951
953
  --color-icon-selected-default: var(--color-positive-50);
952
-
954
+ --color-icon-accent-default: var(--color-white);
953
955
  --color-icon-success-default: var(--color-positive-50);
954
956
 
955
957
  --color-icon-info-default: var(--color-info-50);
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.21",
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;