@invopop/popui 0.1.14 → 0.1.15

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 (93) hide show
  1. package/dist/BaseButton.svelte +25 -103
  2. package/dist/BaseCard.svelte +35 -30
  3. package/dist/BaseCounter.svelte +11 -8
  4. package/dist/BaseTable.svelte +6 -8
  5. package/dist/BaseTableActions.svelte +2 -2
  6. package/dist/BaseTableCellContent.svelte +2 -2
  7. package/dist/BaseTableHeaderContent.svelte +2 -2
  8. package/dist/Breadcrumb.svelte +40 -0
  9. package/dist/Breadcrumb.svelte.d.ts +4 -0
  10. package/dist/Breadcrumbs.svelte +5 -30
  11. package/dist/ButtonFile.svelte +35 -30
  12. package/dist/ButtonUuidCopy.svelte +2 -2
  13. package/dist/CardCheckbox.svelte +25 -21
  14. package/dist/CardRelation.svelte +12 -16
  15. package/dist/CompanySelector.svelte +35 -7
  16. package/dist/DataListItem.svelte +14 -10
  17. package/dist/DatePicker.svelte +9 -9
  18. package/dist/DrawerContext.svelte +112 -10
  19. package/dist/DrawerContextItem.svelte +19 -29
  20. package/dist/DrawerContextSeparator.svelte +1 -1
  21. package/dist/DrawerContextWorkspace.svelte +7 -7
  22. package/dist/DropdownSelect.svelte +40 -14
  23. package/dist/EmptyState.svelte +40 -0
  24. package/dist/EmptyState.svelte.d.ts +4 -0
  25. package/dist/EmptyStateIllustration.svelte.d.ts +0 -1
  26. package/dist/FeedEvents.svelte +9 -5
  27. package/dist/FeedIconEvent.svelte +1 -1
  28. package/dist/FeedItem.svelte +8 -8
  29. package/dist/FeedItemDetail.svelte +7 -5
  30. package/dist/GlobalSearch.svelte +13 -12
  31. package/dist/InputCheckbox.svelte +2 -5
  32. package/dist/InputError.svelte +4 -9
  33. package/dist/InputLabel.svelte +3 -1
  34. package/dist/InputRadio.svelte +26 -11
  35. package/dist/InputSearch.svelte +8 -8
  36. package/dist/InputSelect.svelte +32 -31
  37. package/dist/InputText.svelte +32 -24
  38. package/dist/InputTextarea.svelte +25 -19
  39. package/dist/InputToggle.svelte +24 -18
  40. package/dist/Notification.svelte +55 -24
  41. package/dist/ProfileAvatar.svelte +41 -14
  42. package/dist/SeparatorHorizontal.svelte +2 -2
  43. package/dist/ShortcutWrapper.svelte +14 -5
  44. package/dist/StatusLabel.svelte +4 -5
  45. package/dist/StepIconList.svelte +7 -9
  46. package/dist/TagBeta.svelte +26 -14
  47. package/dist/TagStatus.svelte +33 -48
  48. package/dist/TitleMain.svelte +1 -1
  49. package/dist/TitleSection.svelte +1 -1
  50. package/dist/UuidCopy.svelte +4 -4
  51. package/dist/alert-dialog/alert-dialog-action.svelte +5 -3
  52. package/dist/alert-dialog/alert-dialog-cancel.svelte +4 -2
  53. package/dist/alert-dialog/alert-dialog-content.svelte +1 -1
  54. package/dist/alert-dialog/alert-dialog-description.svelte +1 -1
  55. package/dist/alert-dialog/alert-dialog-footer.svelte +1 -1
  56. package/dist/alert-dialog/alert-dialog-header.svelte +1 -1
  57. package/dist/alert-dialog/alert-dialog-title.svelte +1 -1
  58. package/dist/button/button.svelte +183 -24
  59. package/dist/button/button.svelte.d.ts +48 -26
  60. package/dist/index.d.ts +2 -7
  61. package/dist/index.js +2 -12
  62. package/dist/range-calendar/range-calendar-cell.svelte +1 -1
  63. package/dist/range-calendar/range-calendar-day.svelte +10 -8
  64. package/dist/range-calendar/range-calendar-head-cell.svelte +1 -1
  65. package/dist/range-calendar/range-calendar-next-button.svelte +3 -3
  66. package/dist/range-calendar/range-calendar-prev-button.svelte +3 -3
  67. package/dist/range-calendar/range-calendar.svelte +1 -1
  68. package/dist/svg/CheckBadge.svelte +18 -0
  69. package/dist/svg/CheckBadge.svelte.d.ts +26 -0
  70. package/dist/svg/IconEmpty.svelte +78 -106
  71. package/dist/table/table-body.svelte +1 -1
  72. package/dist/table/table-cell.svelte +1 -1
  73. package/dist/table/table-footer.svelte +1 -1
  74. package/dist/table/table-head.svelte +1 -1
  75. package/dist/table/table-header.svelte +1 -1
  76. package/dist/table/table-row.svelte +1 -1
  77. package/dist/tabs/tabs-list.svelte +1 -1
  78. package/dist/tailwind.theme.css +969 -0
  79. package/dist/tooltip/tooltip-content.svelte +2 -2
  80. package/dist/types.d.ts +36 -42
  81. package/package.json +2 -2
  82. package/dist/CounterWorkflow.svelte +0 -19
  83. package/dist/CounterWorkflow.svelte.d.ts +0 -4
  84. package/dist/EmptyStateIcon.svelte +0 -52
  85. package/dist/EmptyStateIcon.svelte.d.ts +0 -4
  86. package/dist/FormLayoutModal.svelte +0 -14
  87. package/dist/FormLayoutModal.svelte.d.ts +0 -4
  88. package/dist/ProfileSelector.svelte +0 -41
  89. package/dist/ProfileSelector.svelte.d.ts +0 -4
  90. package/dist/SectionLayout.svelte +0 -13
  91. package/dist/SectionLayout.svelte.d.ts +0 -4
  92. package/dist/tw.theme.d.ts +0 -171
  93. package/dist/tw.theme.js +0 -188
@@ -1,8 +1,7 @@
1
1
  <script lang="ts">
2
- import clsx from 'clsx'
3
2
  import type { BaseButtonProps } from './types.ts'
4
- import { Icon } from '@steeze-ui/svelte-icon'
5
- import ShortcutWrapper from './ShortcutWrapper.svelte'
3
+ import Button from './button/button.svelte'
4
+ import type { ButtonSize } from './button/button.svelte'
6
5
 
7
6
  let {
8
7
  icon,
@@ -11,114 +10,37 @@
11
10
  type = 'button',
12
11
  variant = 'default',
13
12
  disabled = false,
14
- small = false,
15
- big = false,
13
+ size = 'md',
16
14
  dangerIcon = false,
17
15
  shortcut = false,
18
16
  fullwidth = false,
19
17
  notification = false,
20
18
  children,
21
19
  onclick,
20
+ class: className,
22
21
  ...rest
23
22
  }: BaseButtonProps = $props()
24
23
 
25
- let buttonStyles = $derived(
26
- clsx(
27
- { 'w-full': fullwidth },
28
- { 'opacity-30 pointer-events-none': disabled },
29
- { 'flex-row-reverse space-x-reverse': iconPosition === 'right' },
30
- { 'bg-white': variant === 'default' },
31
- { 'bg-workspace-accent': variant === 'primary' },
32
- { 'bg-neutral-100 hover:bg-neutral-200 active:bg-neutral-300': variant === 'secondary' },
33
- { 'bg-danger-500': variant === 'danger' },
34
- { 'bg-warning-500': variant === 'warning' },
35
- { 'text-sm rounded': small },
36
- { 'text-base rounded-md': !small },
37
- { 'p-1': small && !children },
38
- { 'p-1.5': !small && !big && !children },
39
- { 'p-2': big && !children },
40
- { 'px-3': big && children && !icon },
41
- { 'px-2': !big && children && !icon },
42
- { 'pl-2 pr-2.5': big && children && icon && iconPosition === 'left' },
43
- { 'pl-2.5 pr-2': big && children && icon && iconPosition === 'right' },
44
- { 'pl-1.5 pr-2': !big && children && icon && iconPosition === 'left' },
45
- { 'pl-2 pr-1.5': !big && children && icon && iconPosition === 'right' },
46
- { 'py-1.5': big && children },
47
- { 'py-1': !big && children },
48
- { 'text-white': ['primary', 'danger', 'dark', 'warning'].includes(variant) },
49
- { 'text-neutral-800': ['default', 'secondary', 'outline'].includes(variant) },
50
- { 'border border-white-10 hover:border-white-20 active:border-white-40': variant === 'dark' },
51
- {
52
- 'border border-neutral-200 hover:bg-neutral-100 active:border-neutral-300 active:bg-neutral-200':
53
- variant === 'default'
54
- },
55
- {
56
- 'border border-neutral-800/10 hover:bg-neutral-800/5 active:border-neutral-800/20 active:bg-neutral-800/10':
57
- variant === 'outline'
58
- },
59
- { 'gap-1': icon && children }
60
- )
61
- )
62
-
63
- let iconStyles = $derived(
64
- clsx(
65
- {
66
- 'text-neutral-500': ['default', 'secondary'].includes(variant) && children && !dangerIcon
67
- },
68
- {
69
- 'text-neutral-800': ['default', 'secondary'].includes(variant) && !children && !dangerIcon
70
- },
71
- {
72
- 'text-white-70': !['default', 'secondary'].includes(variant) && children && !dangerIcon
73
- },
74
- {
75
- 'text-white': !['default', 'secondary'].includes(variant) && !children && !dangerIcon
76
- },
77
- { 'text-danger-500': dangerIcon }
78
- )
79
- )
80
-
81
- let overlayClasses = $derived(
82
- clsx({
83
- 'rounded-md': !small,
84
- rounded: small,
85
- 'group-hover:bg-black/[.16] group-active:bg-black/[.32]': [
86
- 'primary',
87
- 'danger',
88
- 'warning'
89
- ].includes(variant)
90
- })
91
- )
92
-
93
- function handleClick(event: MouseEvent) {
94
- event.stopPropagation()
95
- onclick?.(event)
96
- }
24
+ let iconClass = $derived(dangerIcon ? 'text-icon-critical' : '')
25
+ let fullWidthClass = $derived(fullwidth ? 'w-full' : '')
26
+ let buttonProps = $derived({
27
+ variant,
28
+ size,
29
+ icon,
30
+ iconPosition,
31
+ iconClass,
32
+ type,
33
+ disabled,
34
+ onclick,
35
+ class: `${fullWidthClass} ${className || ''}`,
36
+ ...rest
37
+ })
97
38
  </script>
98
39
 
99
- <button
100
- {type}
101
- {disabled}
102
- class="{buttonStyles} flex items-center justify-center font-medium font-sans relative group tracking-tight cursor-pointer"
103
- {...rest}
104
- onclick={handleClick}
105
- >
106
- <span class="{overlayClasses} absolute inset-0"></span>
107
- {#if icon}
108
- <div class="relative">
109
- {#if shortcut}
110
- <ShortcutWrapper>
111
- <Icon src={icon} theme={iconTheme} class="{iconStyles} h-3 w-3 z-10" />
112
- </ShortcutWrapper>
113
- {:else}
114
- <Icon src={icon} theme={iconTheme} class="{iconStyles} h-4 w-4 z-10" />
115
- {/if}
116
- {#if notification}
117
- <span class="absolute top-0 right-0 w-1.5 h-1.5 bg-danger-500 rounded-full z-20"></span>
118
- {/if}
119
- </div>
120
- {/if}
121
- {#if children}
122
- <span class="z-10">{@render children?.()}</span>
123
- {/if}
124
- </button>
40
+ {#if children}
41
+ <Button {...buttonProps}>
42
+ {@render children()}
43
+ </Button>
44
+ {:else}
45
+ <Button {...buttonProps} />
46
+ {/if}
@@ -8,7 +8,6 @@
8
8
  title = '',
9
9
  description = '',
10
10
  type = 'default',
11
- enabled = false,
12
11
  footer,
13
12
  onclick,
14
13
  ...rest
@@ -16,43 +15,49 @@
16
15
  </script>
17
16
 
18
17
  <button
19
- class="cursor-pointer rounded-lg bg-white hover:bg-neutral-100 focus:bg-neutral-200 disabled:bg-neutral-50 disabled:pointer-events-none border border-neutral-100 p-3 flex flex-col min-w-[298px] min-h-[126px] text-left"
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"
20
19
  disabled={type === 'soon'}
21
20
  {...rest}
22
21
  {onclick}
23
22
  >
24
- <div class="flex flex-col items-start justify-center space-y-2 w-full">
25
- <div class="flex items-center justify-between w-full">
26
- <div class="rounded-md bg-white border border-neutral-100 p-1.5">
27
- <img class="h-5 w-5 shrink-0" src={imageUrl} alt={imageAlt} />
28
- </div>
29
- <div class="flex items-center space-x-2">
30
- {#if enabled}
31
- <div
32
- class="flex items-center space-x-1 rounded bg-neutral-50 border border-neutral-100 py-0.5 pl-1.5 pr-[5px] text-sm text-neutral-500 font-medium"
33
- >
34
- <div class="bg-positive-500 h-2 w-2 rounded-full"></div>
35
- <span>Enabled</span>
36
- </div>
37
- {/if}
38
- {#if type === 'beta'}
39
- <TagBeta />
40
- {:else if type === 'soon'}
41
- <div
42
- class="flex items-center space-x-1 rounded bg-neutral-50 border border-neutral-200 py-0.5 pl-1.5 pr-[5px] text-sm text-neutral-400 font-medium"
43
- >
44
- <span>Soon</span>
45
- </div>
46
- {/if}
23
+ <div class="flex flex-col gap-2 w-full">
24
+ <div class="flex items-start justify-between w-full">
25
+ <div
26
+ class="size-8 border border-border rounded-lg overflow-hidden flex items-center justify-center shrink-0"
27
+ >
28
+ <img class="size-5 shrink-0" src={imageUrl} alt={imageAlt} />
47
29
  </div>
30
+ {#if type === 'beta' || type === 'soon'}
31
+ <div class="flex gap-2 items-start">
32
+ {#if type === 'beta'}
33
+ <TagBeta />
34
+ {:else if type === 'soon'}
35
+ <div
36
+ class="flex items-center gap-2 px-[5px] py-0.5 rounded bg-background-default-secondary border border-border"
37
+ >
38
+ <span
39
+ class="font-medium text-xs leading-4 text-foreground-default-tertiary whitespace-nowrap"
40
+ >
41
+ Soon
42
+ </span>
43
+ </div>
44
+ {/if}
45
+ </div>
46
+ {/if}
47
+ </div>
48
+ <div class="flex flex-col gap-0.5 w-full">
49
+ <h3 class="font-medium text-sm leading-5 tracking-[-0.07px] text-foreground w-full">
50
+ {title}
51
+ </h3>
52
+ <p
53
+ class="font-normal text-sm leading-5 tracking-[-0.07px] text-foreground-default-secondary w-full"
54
+ >
55
+ {description}
56
+ </p>
48
57
  </div>
49
- <h3 class="truncate text-base font-medium text-neutral-800 tracking-tight">{title}</h3>
50
58
  </div>
51
- <p class="flex mt-0.5 text-base text-neutral-500 tracking-normal flex-1">
52
- {description}
53
- </p>
54
59
  {#if footer}
55
- <div class="mt-5">
60
+ <div class="shrink-0">
56
61
  {@render footer?.()}
57
62
  </div>
58
63
  {/if}
@@ -2,19 +2,22 @@
2
2
  import clsx from 'clsx'
3
3
  import type { BaseCounterProps } from './types'
4
4
 
5
- let { content, variant = 'default' }: BaseCounterProps = $props()
5
+ let { value, theme = 'light' }: BaseCounterProps = $props()
6
6
 
7
7
  let styles = $derived(
8
8
  clsx(
9
- { 'bg-neutral-100': variant === 'light' },
10
- { 'bg-neutral-200': variant === 'default' },
11
- { 'bg-neutral-300': variant === 'dark' }
9
+ 'inline-flex items-center justify-center rounded px-[3px] pb-[1.5px] pt-[2.5px] font-mono font-medium text-xs leading-none',
10
+ {
11
+ 'bg-background-default-tertiary text-foreground': theme === 'light',
12
+ 'bg-background-accent text-foreground-inverse': theme === 'accent',
13
+ 'bg-background-selected-inverse text-foreground-inverse': theme === 'navigation'
14
+ }
12
15
  )
13
16
  )
14
17
  </script>
15
18
 
16
- <div
17
- class="{styles} inline-flex items-center justify-center rounded p-1 text-neutral-500 text-sm font-medium h-4 min-w-[16px] tracking-wide tabular-nums slashed-zero lining-nums box-border"
18
- >
19
- {content}
19
+ <div class="p-0.5">
20
+ <div class={styles}>
21
+ <p class="flex items-center justify-center min-w-2.5">{value}</p>
22
+ </div>
20
23
  </div>
@@ -241,7 +241,7 @@
241
241
  }}
242
242
  />
243
243
 
244
- <div class="h-full w-full font-sans border rounded-md border-neutral-100 overflow-auto">
244
+ <div class="h-full w-full font-sans border rounded-md border-border overflow-auto">
245
245
  <Table class="hidden md:table" {...rest}>
246
246
  <colgroup>
247
247
  {#if selectable}
@@ -282,9 +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">
286
- <div class="border-b border-neutral-100 h-9"></div>
287
- </th>
285
+ <th scope="col" class="bg-white sticky top-0 z-10 rounded-tr-md"> </th>
288
286
  {/if}
289
287
  </TableRow>
290
288
  </TableHeader>
@@ -295,17 +293,17 @@
295
293
  <th
296
294
  scope="colgroup"
297
295
  colspan={fields.length + (selectable ? 2 : 1)}
298
- class="bg-white text-left text-sm font-medium text-neutral-500 sticky top-9 tracking-normal h-8 z-10"
296
+ class="bg-white text-left text-sm font-medium text-foreground-default-secondary sticky top-9 tracking-normal h-8 z-10"
299
297
  >
300
298
  <span
301
299
  class:border-t={i > 0}
302
300
  class:pl-12={selectable}
303
301
  class:pl-3={!selectable}
304
- class="flex items-center space-x-1 box-border border-b border-neutral-100 h-8"
302
+ class="flex items-center space-x-1 box-border border-b border-border h-8"
305
303
  >
306
304
  <span>{group.label}</span>
307
305
  {#if !hideCounter}
308
- <BaseCounter content={group.rows.length} />
306
+ <BaseCounter value={group.rows.length} />
309
307
  {/if}
310
308
  </span>
311
309
  </th>
@@ -364,7 +362,7 @@
364
362
  {#each group.rows as row}
365
363
  <button
366
364
  class:cursor-default={disableRowClick}
367
- class="w-full text-left border border-neutral-200 rounded"
365
+ class="w-full text-left border border-neutral-20 rounded"
368
366
  onclick={() => {
369
367
  if (disableRowClick) return
370
368
 
@@ -23,8 +23,8 @@
23
23
 
24
24
  let overlayClasses = $derived(
25
25
  clsx({
26
- 'group-hover:bg-neutral-800/[.05]': !isOpen,
27
- 'bg-neutral-800/[.1]': isOpen
26
+ 'group-hover:bg-foreground/[.05]': !isOpen,
27
+ 'bg-foreground/[.1]': isOpen
28
28
  })
29
29
  )
30
30
 
@@ -18,7 +18,7 @@
18
18
  </script>
19
19
 
20
20
  <div class="flex flex-col">
21
- <span class="md:hidden text-sm text-neutral-600 font-normal">
21
+ <span class="md:hidden text-sm text-neutral-60 font-normal">
22
22
  {field.headerLabel}
23
23
  </span>
24
24
  <span class="flex items-center" class:justify-end={field.rightAlign}>
@@ -46,7 +46,7 @@
46
46
  {#if icons}
47
47
  <span class:ml-2={!!data} class="flex items-center gap-1 shrink-0">
48
48
  {#each icons as icon}
49
- <div class="border border-neutral-200 rounded-md p-px">
49
+ <div class="border border-neutral-20 rounded-md p-px">
50
50
  {#if typeof icon === 'string'}
51
51
  <img alt="icon" src={icon} class="h-4 w-4" />
52
52
  {:else}
@@ -15,7 +15,7 @@
15
15
 
16
16
  let headerStyles = $derived(
17
17
  clsx({
18
- 'hover:bg-neutral-50 focus:bg-neutral-100': field.sortable
18
+ 'hover:bg-neutral-5 focus:bg-neutral-10': 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-400 h-3 w-3"
41
+ class="mt-px text-neutral-40 h-3 w-3"
42
42
  >
43
43
  <path
44
44
  fill-rule="evenodd"
@@ -0,0 +1,40 @@
1
+ <script lang="ts">
2
+ import type { BreadcrumbProps } from './types.js'
3
+ import BaseFlag from './BaseFlag.svelte'
4
+ import clsx from 'clsx'
5
+
6
+ let { breadcrumb, isLast, oncopied }: BreadcrumbProps = $props()
7
+
8
+ let textStyles = $derived(
9
+ clsx('font-sans text-base leading-6 tracking-[-0.16px] whitespace-nowrap', {
10
+ 'text-foreground-default-secondary font-normal': !isLast,
11
+ 'text-foreground font-medium': isLast,
12
+ 'cursor-pointer': breadcrumb.copiable
13
+ })
14
+ )
15
+
16
+ async function handleClick(event: MouseEvent) {
17
+ event.stopPropagation()
18
+ await navigator.clipboard.writeText(breadcrumb.label)
19
+ oncopied?.(breadcrumb.label)
20
+ }
21
+ </script>
22
+
23
+ <li class="flex items-center gap-1">
24
+ {#if breadcrumb.url}
25
+ <a href={breadcrumb.url} class={textStyles}>
26
+ {breadcrumb.label}
27
+ </a>
28
+ {:else if breadcrumb.copiable}
29
+ <button class={textStyles} onclick={handleClick}>
30
+ {breadcrumb.label}
31
+ </button>
32
+ {:else}
33
+ <span class={textStyles}>
34
+ {breadcrumb.label}
35
+ </span>
36
+ {/if}
37
+ {#if breadcrumb.country}
38
+ <BaseFlag country={breadcrumb.country} width={14} />
39
+ {/if}
40
+ </li>
@@ -0,0 +1,4 @@
1
+ import type { BreadcrumbProps } from './types.js';
2
+ declare const Breadcrumb: import("svelte").Component<BreadcrumbProps, {}, "">;
3
+ type Breadcrumb = ReturnType<typeof Breadcrumb>;
4
+ export default Breadcrumb;
@@ -1,43 +1,18 @@
1
1
  <script lang="ts">
2
2
  import type { BreadcrumbsProps } from './types.js'
3
3
  import { Slash } from '@invopop/ui-icons'
4
- import BaseFlag from './BaseFlag.svelte'
4
+ import Breadcrumb from './Breadcrumb.svelte'
5
5
  import { Icon } from '@steeze-ui/svelte-icon'
6
6
 
7
7
  let { breadcrumbs = [], oncopied }: BreadcrumbsProps = $props()
8
-
9
- async function handleClick(event: MouseEvent, label: string) {
10
- event.stopPropagation()
11
- await navigator.clipboard.writeText(label)
12
- oncopied?.(label)
13
- }
14
8
  </script>
15
9
 
16
- <ul class="flex items-center justify-start text-neutral-800">
10
+ <ul class="flex items-center gap-1">
17
11
  {#each breadcrumbs as breadcrumb, i}
18
- <li class="pr-1 text-lg flex items-center space-x-1.5 text-neutral-800">
19
- {#if breadcrumb.url}
20
- <a href={breadcrumb.url}>
21
- <span class:text-neutral-400={i < breadcrumbs.length - 1}>{breadcrumb.label}</span>
22
- </a>
23
- {:else if breadcrumb.copiable}
24
- <button
25
- class="cursor-pointer {i < breadcrumbs.length - 1 ? 'text-neutral-400' : 'font-medium'}"
26
- onclick={(e) => handleClick(e, breadcrumb.label)}
27
- >
28
- {breadcrumb.label}
29
- </button>
30
- {:else}
31
- <span class={i < breadcrumbs.length - 1 ? 'text-neutral-400' : 'font-medium'}>
32
- {breadcrumb.label}
33
- </span>
34
- {/if}
35
- {#if breadcrumb.country}
36
- <BaseFlag country={breadcrumb.country} width={14} />
37
- {/if}
38
- </li>
12
+ <Breadcrumb {breadcrumb} isLast={i === breadcrumbs.length - 1} {oncopied} />
13
+
39
14
  {#if i < breadcrumbs.length - 1}
40
- <Icon src={Slash} class="w-3 h-3 text-neutral-300 pr-1" />
15
+ <Icon src={Slash} class="size-4 text-icon-default-secondary" />
41
16
  {/if}
42
17
  {/each}
43
18
  </ul>
@@ -1,32 +1,29 @@
1
1
  <script lang="ts">
2
- import { Icon } from '@steeze-ui/svelte-icon'
3
- import { Invoice, Download } from '@invopop/ui-icons'
4
- import BaseButton from './BaseButton.svelte'
2
+ import { Download } from '@invopop/ui-icons'
3
+ import Button from './button/button.svelte'
5
4
  import type { ButtonFileProps } from './types.js'
6
- import clsx from 'clsx'
5
+ import { cn } from './utils.js'
7
6
 
8
7
  let {
9
- icon = Invoice,
10
8
  name = '',
11
9
  disabled = false,
12
10
  date = '',
13
- iconColor = 'grey',
11
+ fileType = 'pdf',
14
12
  onPreview,
15
13
  onDownload,
14
+ class: className,
16
15
  ...rest
17
16
  }: ButtonFileProps = $props()
18
17
 
19
- let iconStyles = $derived(
20
- clsx({
21
- 'border-positive-100 bg-positive-50 text-positive-500': iconColor === 'green',
22
- 'border-yellow-100 bg-yellow-50 text-yellow-500': iconColor === 'yellow',
23
- 'border-red-100 bg-red-50 text-red-500': iconColor === 'red',
24
- 'border-warning-100 bg-warning-50 text-warning-500': iconColor === 'orange',
25
- 'border-blue-100 bg-blue-50 text-blue-500': iconColor === 'blue',
26
- 'border-purple-100 bg-purple-50 text-purple-500': iconColor === 'purple',
27
- 'border-dashed border-neutral-100 text-neutral-400': iconColor === 'empty',
28
- 'border-neutral-100 bg-neutral-50 text-neutral-500': iconColor === 'grey'
29
- })
18
+ let fileAvatarStyles = $derived(
19
+ cn(
20
+ 'size-8 rounded-md border border-border flex items-center justify-center text-xs font-black font-mono leading-4 uppercase',
21
+ {
22
+ 'text-foreground-document-pdf': fileType === 'pdf',
23
+ 'text-foreground-document-xml': fileType === 'xml',
24
+ 'text-foreground-document-png': fileType === 'png'
25
+ }
26
+ )
30
27
  )
31
28
 
32
29
  function handleClick(event: MouseEvent) {
@@ -36,27 +33,35 @@
36
33
  </script>
37
34
 
38
35
  <button
39
- class:opacity-40={disabled}
40
- class="border border-neutral-100 hover:bg-neutral-50 active:bg-neutral-100 hover:border-neutral-200 active:border-neutral-300 rounded-lg flex items-center space-x-3 py-1.5 pr-3 pl-2.5 w-full cursor-pointer"
36
+ class={cn(
37
+ 'flex items-center gap-3 px-2 py-1.5 rounded-[10px] w-full hover:bg-background-default-secondary',
38
+ disabled && 'opacity-30 pointer-events-none',
39
+ className
40
+ )}
41
41
  {disabled}
42
42
  {...rest}
43
43
  onclick={handleClick}
44
44
  >
45
- <span class="flex items-center justify-start space-x-2.5 flex-1">
46
- <div class="{iconStyles} p-2 border rounded">
47
- <Icon src={icon} class="w-4 h-4" />
45
+ <div class="flex items-center gap-[10px] flex-1 min-w-0">
46
+ <div class={fileAvatarStyles}>
47
+ {fileType}
48
48
  </div>
49
- <div class="flex flex-col items-start space-y-0.5">
50
- <span class="text-base font-medium text-neutral-800 tracking-tight max-w-[174px] truncate">
49
+ <div class="flex flex-col text-start min-w-0 flex-1">
50
+ <div class="text-sm font-medium text-foreground truncate w-full">
51
51
  {name}
52
- </span>
53
- <span class="text-sm text-neutral-500">{date}</span>
52
+ </div>
53
+ <div class="text-xs text-foreground-default-secondary truncate w-full">
54
+ {date}
55
+ </div>
54
56
  </div>
55
- </span>
56
- <BaseButton
57
- {disabled}
57
+ </div>
58
+ <Button
59
+ variant="secondary"
60
+ size="md"
58
61
  icon={Download}
59
- onclick={() => {
62
+ {disabled}
63
+ onclick={(e) => {
64
+ e.stopPropagation()
60
65
  onDownload?.()
61
66
  }}
62
67
  />
@@ -28,7 +28,7 @@
28
28
 
29
29
  <BaseButton
30
30
  {disabled}
31
- big
31
+ size="lg"
32
32
  icon={Duplicate}
33
33
  iconPosition="right"
34
34
  onclick={async () => {
@@ -36,5 +36,5 @@
36
36
  oncopied?.(uuid)
37
37
  }}
38
38
  >
39
- <span class="font-mono text-neutral-500">{formattedUuid}</span>
39
+ <span class="font-mono">{formattedUuid}</span>
40
40
  </BaseButton>
@@ -11,47 +11,51 @@
11
11
  description = '',
12
12
  accentText = '',
13
13
  checked = false,
14
+ disabled = false,
14
15
  icon = undefined,
15
16
  hideRadio = false,
16
17
  footer,
17
18
  onchange
18
19
  }: CardCheckboxProps = $props()
19
20
 
20
- let styles = $derived(
21
- clsx(
22
- { 'border-workspace-accent shadow-active': checked },
23
- { 'border-neutral-200 hover:border-neutral-300': !checked }
24
- )
21
+ let containerStyles = $derived(
22
+ clsx('border gap-3 py-2 pr-2 pl-3 flex items-start rounded-xl', {
23
+ 'border-foreground-selected': checked,
24
+ 'border-border': !checked,
25
+ 'bg-background-default-secondary': disabled
26
+ })
25
27
  )
26
28
  </script>
27
29
 
28
- <label for={id} class="{styles} border rounded-lg w-full text-left cursor-pointer block">
29
- <div class="py-2 pr-2 pl-3 flex items-start justify-between">
30
- <div class="flex space-x-2">
30
+ <label for={id} class="cursor-pointer">
31
+ <div class={containerStyles}>
32
+ <div class="flex grow items-start gap-1 min-w-0">
31
33
  {#if icon}
32
- <Icon src={icon} class="h-5 w-5 text-neutral-500 flex-shrink-0" />
34
+ <Icon src={icon} class="size-5 text-icon shrink-0" />
33
35
  {/if}
34
- <div class="flex flex-col space-y-0.5">
35
- <span class="text-base text-neutral-800 font-medium">{title}</span>
36
+ <div class="flex flex-col gap-1 min-w-0">
37
+ <span class="text-base font-medium text-foreground">
38
+ {title}
39
+ </span>
36
40
  {#if description}
37
- <span class="flex items-center space-x-1">
41
+ <span class="text-sm text-foreground-default-secondary">
38
42
  {#if accentText}
39
- <p class="text-workspace-accent text-sm font-bold">{accentText}</p>
43
+ <span class="font-medium text-foreground-accent">{accentText}</span>
44
+ {' · '}
40
45
  {/if}
41
- <p class="text-sm text-neutral-500" class:first-letter:uppercase={!accentText}>
42
- {description}
43
- </p>
46
+ {description}
44
47
  </span>
45
48
  {/if}
46
49
  </div>
47
50
  </div>
48
-
49
- <div class:hidden={hideRadio}>
50
- <InputRadio {id} {name} {checked} {onchange} />
51
- </div>
51
+ {#if !hideRadio}
52
+ <div class="flex items-center p-px">
53
+ <InputRadio {id} {name} {checked} {disabled} {onchange} />
54
+ </div>
55
+ {/if}
52
56
  </div>
53
57
  {#if footer}
54
- <div class="bg-neutral-50 rounded-b-lg px-3 py-2.5 border-t border-neutral-100">
58
+ <div class="border-t border-border bg-background-default-secondary rounded-b-xl px-3 pb-3 pt-2">
55
59
  {@render footer?.()}
56
60
  </div>
57
61
  {/if}