@invopop/popui 0.1.13 → 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 +23 -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,28 +1,32 @@
1
1
  <script lang="ts">
2
+ import SeparatorHorizontal from './SeparatorHorizontal.svelte'
2
3
  import TagStatus from './TagStatus.svelte'
3
4
  import type { FeedEventsProps } from './types.js'
4
5
 
5
6
  let { events = [] }: FeedEventsProps = $props()
6
7
  </script>
7
8
 
8
- <div class="border border-neutral-100 bg-neutral-50 rounded">
9
+ <div class="border border-border bg-background-default-secondary rounded">
9
10
  {#each events as event, i (i)}
10
- <div class:border-t={i > 0} class="border-neutral-100 py-2 px-3">
11
+ {#if i > 0}
12
+ <SeparatorHorizontal />
13
+ {/if}
14
+ <div class="py-2 px-3">
11
15
  <div class="flex items-center justify-between">
12
16
  <div class="flex items-center space-x-2">
13
17
  <TagStatus status={event.status.type} label={event.status.label} />
14
18
  {#if event.code}
15
- <p class="text-sm text-neutral-500 font-mono tracking-wide">
19
+ <p class="text-sm text-foreground-default-secondary font-mono">
16
20
  {event.code}
17
21
  </p>
18
22
  {/if}
19
23
  </div>
20
- <p class="text-sm text-neutral-500 font-mono tracking-wide">
24
+ <p class="text-sm text-foreground-default-secondary font-mono">
21
25
  {event.date.toISOString()}
22
26
  </p>
23
27
  </div>
24
28
  {#if event.message}
25
- <p class="text-neutral-800 text-sm pt-2 tracking-normal break-words">{event.message}</p>
29
+ <p class="text-foreground text-sm pt-2 break-words">{event.message}</p>
26
30
  {/if}
27
31
  </div>
28
32
  {/each}
@@ -7,6 +7,6 @@
7
7
 
8
8
  <div class="relative py-0.5 mt-2">
9
9
  {#if icon}
10
- <Icon src={icon} theme={iconTheme} class="h-4 w-4 text-neutral-500" />
10
+ <Icon src={icon} theme={iconTheme} class="size-4 text-icon-default-bold" />
11
11
  {/if}
12
12
  </div>
@@ -31,7 +31,7 @@
31
31
 
32
32
  <div id={`feed-item-${slug}`} class="relative text-left w-full min-w-[344px]">
33
33
  {#if hasNext && icon}
34
- <span class="absolute bottom-[-20px] left-2 border-l border-neutral-100 w-px h-[58px]"></span>
34
+ <span class="absolute bottom-[-20px] left-2 border-l border-border w-px h-[58px]"></span>
35
35
  {/if}
36
36
  <div class="flex items-start justify-between space-x-2 py-3">
37
37
  <div class="relative">
@@ -39,17 +39,15 @@
39
39
  <FeedIconEvent {icon} />
40
40
  {/if}
41
41
  </div>
42
- <div
43
- class="flex-1 items-center justify-start pl-2.5 py-2 pr-2 rounded-lg border border-neutral-100"
44
- >
42
+ <div class="flex-1 items-center justify-start pl-2.5 py-2 pr-2 rounded-lg">
45
43
  <div
46
- class="text-base text-neutral-800 whitespace-nowrap tracking-normal font-medium flex items-center gap-1 {viewable
44
+ class="text-base text-foreground whitespace-nowrap tracking-normal font-medium flex items-center gap-1 {viewable
47
45
  ? 'max-w-[260px]'
48
46
  : 'max-w-[320px]'}"
49
47
  >
50
48
  {#if user}
51
49
  <div class="mr-0.5">
52
- <ProfileAvatar small {...user} />
50
+ <ProfileAvatar variant="sm" {...user} />
53
51
  </div>
54
52
  {/if}
55
53
  <p class="truncate" {title}>{title}</p>
@@ -59,7 +57,9 @@
59
57
  {/if}
60
58
  </div>
61
59
  <p
62
- class="mt-0.5 flex items-center space-x-2 text-sm text-neutral-500 whitespace-nowrap tabular-nums slashed-zero lining-nums tracking-normal"
60
+ class="mt-0.5 flex items-center space-x-2 text-sm text-foreground-default-secondary whitespace-nowrap tabular-nums slashed-zero lining-nums tracking-normal {user
61
+ ? 'ml-[26px]'
62
+ : ''}"
63
63
  >
64
64
  {#if date}
65
65
  <span>
@@ -78,7 +78,7 @@
78
78
  {#if viewable}
79
79
  <span class="absolute top-5 right-2">
80
80
  <BaseButton
81
- small
81
+ size="sm"
82
82
  variant="secondary"
83
83
  onclick={() => {
84
84
  onView?.(slug)
@@ -5,6 +5,8 @@
5
5
  import FeedEvents from './FeedEvents.svelte'
6
6
  import { slide } from 'svelte/transition'
7
7
  import SeparatorHorizontal from './SeparatorHorizontal.svelte'
8
+ import BaseButton from './BaseButton.svelte'
9
+ import { Close } from '@invopop/ui-icons'
8
10
 
9
11
  let {
10
12
  status = undefined,
@@ -12,29 +14,45 @@
12
14
  uuid = '',
13
15
  events = [],
14
16
  idLabel = 'ID:',
15
- onCopied
17
+ cancelable = false,
18
+ onCopied,
19
+ onCancel
16
20
  }: FeedItemDetailProps = $props()
17
21
 
18
22
  let open = $state(false)
19
23
  </script>
20
24
 
21
- <div class="w-full rounded-lg border border-neutral-100">
25
+ <div class="w-full rounded-lg border border-border">
22
26
  <div class="px-3 py-2.5 flex items-center space-x-1.5">
23
27
  {#if status}
24
28
  <FeedIconStatus {status} />
25
29
  {/if}
26
- <span class="flex-1 truncate font-medium text-neutral-800 text-base">{title}</span>
30
+ <span class="flex-1 truncate font-medium text-foreground text-base">{title}</span>
31
+ {#if cancelable}
32
+ <BaseButton
33
+ size="sm"
34
+ icon={Close}
35
+ variant="secondary"
36
+ onclick={() => {
37
+ onCancel?.()
38
+ }}
39
+ >
40
+ Cancel
41
+ </BaseButton>
42
+ {/if}
27
43
  </div>
28
44
  <SeparatorHorizontal />
29
45
  <div class="pl-3 py-1 pr-2.5 flex items-center space-x-0.5">
30
- <span class="text-sm text-neutral-500 whitespace-nowrap">{idLabel}</span>
46
+ <span class="text-sm text-foreground-default-secondary whitespace-nowrap">{idLabel}</span>
31
47
  {#if uuid}
32
48
  <UuidCopy {uuid} full small {onCopied} />
33
49
  {/if}
34
50
  </div>
35
51
  {#if events.length}
36
52
  <SeparatorHorizontal />
37
- <div class="px-3 py-2 text-sm text-neutral-500 flex items-center justify-between">
53
+ <div
54
+ class="px-3 py-2 text-sm text-foreground-default-secondary flex items-center justify-between"
55
+ >
38
56
  <span>Logs</span>
39
57
  <button
40
58
  class="cursor-pointer"
@@ -10,10 +10,14 @@
10
10
 
11
11
  let { collapsed = false, onOpen }: GlobalSearchProps = $props()
12
12
 
13
- let styles = $derived(
14
- clsx({
15
- 'space-x-1 w-full': !collapsed
16
- })
13
+ const styles = $derived(
14
+ clsx(
15
+ 'cursor-pointer flex items-center border border-border-inverse-default rounded-lg backdrop-blur-[20px]',
16
+ {
17
+ 'gap-1 px-2 py-1.5 w-full hover:bg-background-selected-inverse': !collapsed,
18
+ 'p-1.5': collapsed
19
+ }
20
+ )
17
21
  )
18
22
 
19
23
  function onKeyDown(event: KeyboardEvent) {
@@ -38,15 +42,12 @@
38
42
  })
39
43
  </script>
40
44
 
41
- <button
42
- class="cursor-pointer {styles} flex items-center border pl-1.5 py-1.5 pr-2 border-white-10 bg-neutral-800/10 rounded-md"
43
- onclick={() => onOpen?.()}
44
- >
45
- <Icon src={Search} class="w-4 h-4 text-white-70" />
45
+ <button class={styles} onclick={() => onOpen?.()}>
46
+ <Icon src={Search} class="size-4 text-foreground-inverse shrink-0" />
46
47
  {#if !collapsed}
47
- <span class="text-white-40 text-sm flex-1 text-left tracking-normal">Search</span>
48
- <ShortcutWrapper>
49
- <Icon src={Slash} class="w-3 h-3 text-white-70" />
48
+ <span class="text-foreground-inverse-secondary text-base flex-1 text-left">Search</span>
49
+ <ShortcutWrapper theme="navigation">
50
+ <Icon src={Slash} class="size-3" />
50
51
  </ShortcutWrapper>
51
52
  {/if}
52
53
  </button>
@@ -20,16 +20,13 @@
20
20
  }
21
21
  </script>
22
22
 
23
- <label
24
- for={id}
25
- class="inline-flex items-center space-x-2 cursor-pointer group text-base text-neutral-800"
26
- >
23
+ <label for={id} class="inline-flex items-center gap-2 cursor-pointer text-base text-foreground">
27
24
  <input
28
25
  {id}
29
26
  type="checkbox"
30
27
  {checked}
31
28
  {indeterminate}
32
- class="form-checkbox w-4 h-4 text-workspace-accent focus:text-workspace-accent rounded border border-neutral-200 hover:border-neutral-300 group-hover:border-neutral-300 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"
33
30
  {...rest}
34
31
  onchange={updateInput}
35
32
  {onclick}
@@ -1,17 +1,12 @@
1
1
  <script lang="ts">
2
+ import { Icon } from '@steeze-ui/svelte-icon'
3
+ import { Alert } from '@invopop/ui-icons'
2
4
  import type { InputErrorProps } from './types'
3
5
 
4
6
  let { errorText = '' }: InputErrorProps = $props()
5
7
  </script>
6
8
 
7
- <p class="mt-2 text-sm text-danger-500 flex items-center space-x-1">
8
- <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
9
- <path
10
- fill-rule="evenodd"
11
- clip-rule="evenodd"
12
- d="M8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5C4.41015 1.5 1.5 4.41015 1.5 8C1.5 11.5899 4.41015 14.5 8 14.5ZM7.99999 9.35C7.66862 9.35 7.39999 9.08137 7.39999 8.75V4.75C7.39999 4.41863 7.66862 4.15 7.99999 4.15C8.33137 4.15 8.59999 4.41863 8.59999 4.75L8.59999 8.75C8.59999 9.08137 8.33136 9.35 7.99999 9.35ZM8.75 11C8.75 11.4142 8.41421 11.75 8 11.75C7.58579 11.75 7.25 11.4142 7.25 11C7.25 10.5858 7.58579 10.25 8 10.25C8.41421 10.25 8.75 10.5858 8.75 11Z"
13
- fill="currentColor"
14
- />
15
- </svg>
9
+ <p class="flex items-center gap-1 text-xs text-foreground-critical">
10
+ <Icon src={Alert} class="size-3 shrink-0" />
16
11
  <span>{errorText}</span>
17
12
  </p>
@@ -4,4 +4,6 @@
4
4
  let { id = '', label = '', ...rest }: InputLabelProps = $props()
5
5
  </script>
6
6
 
7
- <label for={id} class="text-sm font-medium text-neutral-500 mb-2" {...rest}>{label}</label>
7
+ <label for={id} class="text-sm font-medium text-foreground-default-secondary" {...rest}>
8
+ {label}
9
+ </label>
@@ -3,8 +3,10 @@
3
3
 
4
4
  let {
5
5
  checked = false,
6
+ disabled = false,
6
7
  id = Math.random().toString(36).slice(2, 7),
7
8
  name = '',
9
+ label,
8
10
  onchange,
9
11
  ...rest
10
12
  }: InputRadioProps = $props()
@@ -19,18 +21,31 @@
19
21
 
20
22
  function updateInput(event: Event) {
21
23
  const target = event.target as HTMLInputElement
22
-
23
24
  onchange?.(target.checked)
24
25
  }
25
26
  </script>
26
27
 
27
- <input
28
- bind:this={el}
29
- type="radio"
30
- {id}
31
- {name}
32
- {checked}
33
- class="form-radio h-5 w-5 border-neutral-200 text-workspace-accent focus:ring-0 focus:ring-offset-0 cursor-pointer"
34
- {...rest}
35
- onchange={updateInput}
36
- />
28
+ {#snippet radioInput()}
29
+ <input
30
+ bind:this={el}
31
+ type="radio"
32
+ {id}
33
+ {name}
34
+ {checked}
35
+ {disabled}
36
+ class="appearance-none size-4 rounded-full border checked:border-0 checked:bg-foreground-selected cursor-pointer focus:outline-none focus:ring-0 shrink-0 disabled:cursor-not-allowed disabled:border-border-default-secondary disabled:checked:bg-border-default-secondary disabled:checked:border"
37
+ {...rest}
38
+ onchange={updateInput}
39
+ />
40
+ {/snippet}
41
+
42
+ {#if label}
43
+ <label class="flex items-center gap-2 cursor-pointer">
44
+ {@render radioInput()}
45
+ <span class="text-base text-foreground whitespace-nowrap">
46
+ {label}
47
+ </span>
48
+ </label>
49
+ {:else}
50
+ {@render radioInput()}
51
+ {/if}
@@ -2,6 +2,7 @@
2
2
  import { onMount } from 'svelte'
3
3
  import { Icon } from '@steeze-ui/svelte-icon'
4
4
  import { Search } from '@invopop/ui-icons'
5
+ import ShortcutWrapper from './ShortcutWrapper.svelte'
5
6
  import type { InputSearchProps } from './types.js'
6
7
 
7
8
  const debounce = (target: HTMLInputElement) => {
@@ -66,8 +67,8 @@
66
67
  bind:this={input}
67
68
  bind:value
68
69
  type="search"
69
- class="py-[5px] pl-7 border border-neutral-200 hover:border-neutral-300 w-full rounded-md text-neutral-800 placeholder-neutral-500 text-base outline-none tracking-tight caret-workspace-accent focus:border-workspace-accent focus:shadow-active bg-white"
70
- style:padding-right={`${shortcutKeys.length * 15 + 12}px`}
70
+ class="flex items-center gap-1 h-8 w-full px-2 py-1.5 pl-7 rounded-lg border bg-background-default-default text-base text-foreground-default-default placeholder:text-foreground-default-tertiary outline-none caret-workspace-accent focus:ring-0 border-border-default-secondary hover:border-border-default-secondary-hover focus:border-border-selected-bold focus:shadow-active"
71
+ style:padding-right={shortcut ? `${shortcutKeys.length * 20 + 12}px` : undefined}
71
72
  {placeholder}
72
73
  {...rest}
73
74
  oninput={handleInput}
@@ -75,15 +76,14 @@
75
76
  {onblur}
76
77
  {onclick}
77
78
  />
78
- <Icon src={icon} class="absolute text-neutral-500 w-4 h-4 left-2" />
79
+ <Icon src={icon} class="absolute left-2 size-4 text-foreground-default-tertiary" />
79
80
 
80
81
  {#if shortcut}
81
- <div class="absolute top-1 right-0 flex py-1.5 pr-1.5 space-x-1">
82
+ <div class="absolute right-2 flex items-center gap-1">
82
83
  {#each shortcutKeys as key}
83
- <kbd
84
- class="w-4 h-4 flex justify-center items-center rounded-md border border-neutral-200 bg-neutral-100 font-sans text-sm text-neutral-500 font-semibold"
85
- >{key}</kbd
86
- >
84
+ <ShortcutWrapper>
85
+ <span class="text-xs font-semibold">{key}</span>
86
+ </ShortcutWrapper>
87
87
  {/each}
88
88
  </div>
89
89
  {/if}
@@ -29,43 +29,44 @@
29
29
 
30
30
  function handleChange(event: Event) {
31
31
  const target = (event as PointerEvent).target as HTMLSelectElement
32
-
33
32
  onchange?.(target.value)
34
33
  }
35
34
  </script>
36
35
 
37
- {#if label}
38
- <InputLabel {id} {label} />
39
- {/if}
40
- <div class="relative">
41
- <select
42
- {id}
43
- {name}
44
- bind:value
45
- {disabled}
46
- class:pl-7={icon}
47
- class:pl-2={!icon}
48
- class="py-1.5 border border-neutral-200 hover:border-neutral-300 w-full rounded-md text-neutral-800 text-base pr-9 outline-none tracking-tight ui-select focus:border-workspace-accent focus:shadow-active"
49
- {...rest}
50
- onchange={handleChange}
51
- >
52
- <option value="" disabled={disablePlaceholder}>{placeholder}</option>
53
- {#each options as option}
54
- <option value={option.value}>{option.label}</option>
55
- {/each}
56
- </select>
57
- {#if resolvedIcon}
58
- <Icon
59
- src={resolvedIcon}
60
- theme={iconTheme}
61
- class="h-4 w-4 absolute top-2 left-2 text-neutral-500"
62
- />
36
+ <div class="flex flex-col gap-2">
37
+ {#if label}
38
+ <InputLabel {id} {label} />
63
39
  {/if}
64
- </div>
40
+ <div class="relative">
41
+ <select
42
+ {id}
43
+ {name}
44
+ bind:value
45
+ {disabled}
46
+ class="h-8 w-full px-2 py-1.5 rounded-lg border bg-background text-base outline-none focus:ring-0 border-border hover:border-border-default-secondary-hover focus:border-border-selected-bold focus:shadow-active text-foreground ui-select"
47
+ class:pl-7={resolvedIcon}
48
+ class:text-foreground-default-secondary={!value}
49
+ {...rest}
50
+ onchange={handleChange}
51
+ >
52
+ <option value="" disabled={disablePlaceholder}>{placeholder}</option>
53
+ {#each options as option}
54
+ <option value={option.value}>{option.label}</option>
55
+ {/each}
56
+ </select>
57
+ {#if resolvedIcon}
58
+ <Icon
59
+ src={resolvedIcon}
60
+ theme={iconTheme}
61
+ class="absolute left-2 top-2 size-4 text-icon pointer-events-none"
62
+ />
63
+ {/if}
64
+ </div>
65
65
 
66
- {#if errorText}
67
- <InputError {errorText} />
68
- {/if}
66
+ {#if errorText}
67
+ <InputError {errorText} />
68
+ {/if}
69
+ </div>
69
70
 
70
71
  <style>
71
72
  .ui-select {
@@ -32,13 +32,19 @@
32
32
 
33
33
  let inputStyles = $derived(
34
34
  clsx(
35
- { 'pointer-events-none bg-neutral-50': disabled },
35
+ 'h-8 w-full rounded-lg border px-2 py-1 text-base tracking-tight bg-background-default-default backdrop-blur-[2px]',
36
+ 'placeholder:text-foreground-default-tertiary',
37
+ 'outline-none focus:ring-0',
36
38
  {
37
- 'text-danger-500 border-danger-400 outline-danger-400': errorText
39
+ 'pointer-events-none bg-background-default-secondary border-border-default-default':
40
+ disabled
38
41
  },
39
42
  {
40
- 'border-neutral-200 hover:border-neutral-300 text-neutral-800 outline-none caret-workspace-accent focus:border-workspace-accent focus:shadow-active':
41
- !errorText
43
+ 'text-foreground-critical border-border-critical-bold': errorText
44
+ },
45
+ {
46
+ 'text-foreground border-border-default-secondary hover:border-border-default-secondary-hover focus:border-border-selected-bold focus:shadow-active':
47
+ !errorText && !disabled
42
48
  }
43
49
  )
44
50
  )
@@ -59,23 +65,25 @@
59
65
  })
60
66
  </script>
61
67
 
62
- {#if label}
63
- <InputLabel {id} {label} />
64
- {/if}
65
- <input
66
- {id}
67
- bind:this={inputEl}
68
- bind:value
69
- type="text"
70
- class="{inputStyles} py-1.5 px-2.5 border w-full rounded-md placeholder:text-neutral-500 text-base tracking-tight bg-white"
71
- {placeholder}
72
- readonly={disabled}
73
- {...rest}
74
- oninput={handleInput}
75
- {onfocus}
76
- {onblur}
77
- {onkeydown}
78
- />
79
- {#if errorText}
80
- <InputError {errorText} />
81
- {/if}
68
+ <div class="flex flex-col gap-2">
69
+ {#if label}
70
+ <InputLabel {id} {label} />
71
+ {/if}
72
+ <input
73
+ {id}
74
+ bind:this={inputEl}
75
+ bind:value
76
+ type="text"
77
+ class={inputStyles}
78
+ {placeholder}
79
+ readonly={disabled}
80
+ {...rest}
81
+ oninput={handleInput}
82
+ {onfocus}
83
+ {onblur}
84
+ {onkeydown}
85
+ />
86
+ {#if errorText}
87
+ <InputError {errorText} />
88
+ {/if}
89
+ </div>
@@ -18,13 +18,16 @@
18
18
 
19
19
  let inputStyles = $derived(
20
20
  clsx(
21
- { 'pointer-events-none bg-neutral-50': disabled },
21
+ 'w-full rounded-lg border px-2 py-1.5 text-base tracking-tight bg-background backdrop-blur-[2px] placeholder:text-foreground-default-tertiary outline-none focus:ring-0',
22
22
  {
23
- 'text-danger-500 border-danger-400 outline-danger-400': errorText
23
+ 'pointer-events-none bg-background-default-secondary border-border': disabled
24
24
  },
25
25
  {
26
- 'border-neutral-200 hover:border-neutral-300 text-neutral-800 outline-none caret-workspace-accent focus:border-workspace-accent focus:shadow-active':
27
- !errorText
26
+ 'text-foreground-critical border-border-critical-bold': errorText
27
+ },
28
+ {
29
+ 'text-foreground border-border hover:border-border-default-secondary-hover focus:border-border-selected-bold focus:shadow-active':
30
+ !errorText && !disabled
28
31
  }
29
32
  )
30
33
  )
@@ -35,18 +38,21 @@
35
38
  }
36
39
  </script>
37
40
 
38
- <InputLabel {id} {label} />
39
- <textarea
40
- {id}
41
- {placeholder}
42
- {value}
43
- class="{inputStyles} py-1.5 px-3 border w-full rounded placeholder-neutral-500 text-base tracking-tight bg-white"
44
- {disabled}
45
- {rows}
46
- {...rest}
47
- oninput={handleInput}
48
- ></textarea>
49
-
50
- {#if errorText}
51
- <InputError {errorText} />
52
- {/if}
41
+ <div class="flex flex-col gap-2">
42
+ {#if label}
43
+ <InputLabel {id} {label} />
44
+ {/if}
45
+ <textarea
46
+ {id}
47
+ {placeholder}
48
+ {value}
49
+ class={inputStyles}
50
+ {disabled}
51
+ {rows}
52
+ {...rest}
53
+ oninput={handleInput}
54
+ ></textarea>
55
+ {#if errorText}
56
+ <InputError {errorText} />
57
+ {/if}
58
+ </div>
@@ -15,8 +15,24 @@
15
15
  $sw.checked = checked
16
16
  })
17
17
 
18
- let togleStyles = $derived(
19
- clsx({ 'bg-gray-200': !$sw.checked }, { 'bg-workspace-accent': $sw.checked })
18
+ let toggleStyles = $derived(
19
+ clsx(
20
+ 'relative inline-flex h-5 w-[30px] shrink-0 cursor-pointer items-center rounded-md transition-colors duration-200 ease-in-out focus:outline-none focus:ring-0',
21
+ {
22
+ 'bg-background-default-tertiary': !$sw.checked,
23
+ 'bg-background-accent': $sw.checked
24
+ }
25
+ )
26
+ )
27
+
28
+ let circleStyles = $derived(
29
+ clsx(
30
+ 'pointer-events-none inline-block size-4 transform rounded bg-icon-inverse-bold transition duration-200 ease-in-out',
31
+ {
32
+ 'translate-x-[2px]': !$sw.checked,
33
+ 'translate-x-[12px]': $sw.checked
34
+ }
35
+ )
20
36
  )
21
37
 
22
38
  function handleChange() {
@@ -25,22 +41,12 @@
25
41
  }
26
42
  </script>
27
43
 
28
- <label for={id} class="flex w-full items-center justify-between space-x-2">
29
- {#if label}
30
- <span class="text-base text-neutral-500">{label}</span>
31
- {/if}
32
- <button
33
- {id}
34
- class="{togleStyles} relative inline-flex h-5 w-8 flex-shrink-0 cursor-pointer rounded-md border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-0 focus:ring-offset-0"
35
- use:sw.toggle
36
- onclick={handleChange}
37
- >
44
+ <label for={id} class="inline-flex items-center gap-2 cursor-pointer">
45
+ <button {id} class={toggleStyles} use:sw.toggle onclick={handleChange}>
38
46
  <span class="sr-only">Use setting</span>
39
- <span
40
- aria-hidden="true"
41
- class="{$sw.checked
42
- ? 'translate-x-3'
43
- : 'translate-x-0'} pointer-events-none inline-block h-4 w-4 transform rounded bg-white shadow ring-0 transition duration-200 ease-in-out"
44
- ></span>
47
+ <span aria-hidden="true" class={circleStyles}></span>
45
48
  </button>
49
+ {#if label}
50
+ <span class="text-base text-foreground">{label}</span>
51
+ {/if}
46
52
  </label>