@zeyolabs/ui 0.0.0-stage → 2026.11.5

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 (138) hide show
  1. package/README.md +43 -2
  2. package/back-button/BackButton.svelte +26 -0
  3. package/badge/Badge.svelte +73 -0
  4. package/badge/PromoBadge.svelte +319 -0
  5. package/badge/color.ts +10 -0
  6. package/bar/Bar.svelte +63 -0
  7. package/base.css +47 -0
  8. package/boundary/Boundary.svelte +59 -0
  9. package/boundary/BoundaryFailed.svelte +40 -0
  10. package/boundary/PendingTracker.svelte +14 -0
  11. package/boundary/pending-context.ts +15 -0
  12. package/boundary/pending-flag.svelte.ts +33 -0
  13. package/boundary/report-boundary-error.ts +13 -0
  14. package/card/Card.svelte +239 -0
  15. package/card/CardBody.svelte +41 -0
  16. package/card/CardFooter.svelte +36 -0
  17. package/card/CardHeader.svelte +36 -0
  18. package/copy/CopyArea.svelte +37 -0
  19. package/copy/CopyButton.svelte +59 -0
  20. package/copy/copy-state.svelte.ts +23 -0
  21. package/copy/types.ts +1 -0
  22. package/dialog/ConfirmDialog.svelte +61 -0
  23. package/dialog/Dialog.svelte +31 -0
  24. package/dialog/DialogBody.svelte +88 -0
  25. package/dialog/DialogCloseButton.svelte +26 -0
  26. package/dialog/DialogFooter.svelte +23 -0
  27. package/dialog/DialogTrigger.svelte +15 -0
  28. package/distribution-bar/DistributionBar.svelte +37 -0
  29. package/drawer/Drawer.svelte +31 -0
  30. package/drawer/DrawerBody.svelte +61 -0
  31. package/empty-state/EmptyState.svelte +74 -0
  32. package/error/ErrorPage.svelte +54 -0
  33. package/eyebrow/Eyebrow.svelte +10 -0
  34. package/faq/FAQList.svelte +89 -0
  35. package/filter/FilterChipGroup.svelte +78 -0
  36. package/filter/FilterOptionList.svelte +188 -0
  37. package/filter/FilterPopover.svelte +122 -0
  38. package/filter/filter-draft.svelte.ts +25 -0
  39. package/form/Button.svelte +73 -0
  40. package/form/Field.svelte +111 -0
  41. package/form/FieldLabel.svelte +19 -0
  42. package/form/Form.svelte +133 -0
  43. package/form/PhoneField.svelte +214 -0
  44. package/form/UnsavedBar.svelte +22 -0
  45. package/form/field-view.svelte.ts +213 -0
  46. package/form/fields/CheckboxField.svelte +85 -0
  47. package/form/fields/Combobox.svelte +327 -0
  48. package/form/fields/ComboboxAction.svelte +16 -0
  49. package/form/fields/DateField.svelte +31 -0
  50. package/form/fields/DateRangeField.svelte +188 -0
  51. package/form/fields/DateRangePresetField.svelte +119 -0
  52. package/form/fields/EmailField.svelte +63 -0
  53. package/form/fields/FileField.svelte +145 -0
  54. package/form/fields/HexColorField.svelte +83 -0
  55. package/form/fields/IntervalField.svelte +100 -0
  56. package/form/fields/MessageField.svelte +99 -0
  57. package/form/fields/NumberField.svelte +64 -0
  58. package/form/fields/Option.svelte +48 -0
  59. package/form/fields/OptionRegistrar.svelte +15 -0
  60. package/form/fields/PasswordField.svelte +44 -0
  61. package/form/fields/RadioField.svelte +60 -0
  62. package/form/fields/RichTextField.svelte +221 -0
  63. package/form/fields/SelectField.svelte +216 -0
  64. package/form/fields/SliderField.svelte +182 -0
  65. package/form/fields/SwitchField.svelte +102 -0
  66. package/form/fields/TextField.svelte +72 -0
  67. package/form/fields/TimeField.svelte +31 -0
  68. package/form/fields/index.ts +19 -0
  69. package/form/fields/select-field-context.ts +21 -0
  70. package/form/index.ts +21 -0
  71. package/form/primitives/Checkbox.svelte +103 -0
  72. package/form/primitives/DateInput.svelte +51 -0
  73. package/form/primitives/IconInputWrapper.svelte +40 -0
  74. package/form/primitives/Input.svelte +47 -0
  75. package/form/primitives/SearchBar.svelte +37 -0
  76. package/form/primitives/Select.svelte +139 -0
  77. package/form/primitives/TextArea.svelte +51 -0
  78. package/form/primitives/index.ts +6 -0
  79. package/gallery/ImageGallery.svelte +133 -0
  80. package/gallery/flickity-fullscreen.d.ts +2 -0
  81. package/grouped-grid/GroupedGrid.svelte +143 -0
  82. package/grouped-grid/types.ts +25 -0
  83. package/layout/Cluster.svelte +92 -0
  84. package/layout/Container.svelte +9 -0
  85. package/layout/Grid.svelte +131 -0
  86. package/layout/Section.svelte +146 -0
  87. package/layout/Shell.svelte +32 -0
  88. package/layout/SplitShell.svelte +47 -0
  89. package/layout/Stack.svelte +78 -0
  90. package/list-row/ListRow.svelte +77 -0
  91. package/menu/MenuButton.svelte +101 -0
  92. package/mini-stat/MiniStat.svelte +13 -0
  93. package/package.json +169 -5
  94. package/page-hero/PageHero.svelte +35 -0
  95. package/pagination/Pagination.svelte +44 -0
  96. package/pagination/finder-pagination.svelte.ts +55 -0
  97. package/pagination/finder-search.svelte.ts +292 -0
  98. package/percentage-ring/PercentageRing.svelte +76 -0
  99. package/percentage-ring/types.ts +1 -0
  100. package/popover/InfoTip.svelte +36 -0
  101. package/popover/Popover.svelte +157 -0
  102. package/query-state/QueryState.svelte +42 -0
  103. package/schema.ts +20 -0
  104. package/skeleton/Skeleton.svelte +86 -0
  105. package/skeleton/SkeletonButton.svelte +27 -0
  106. package/skeleton/SkeletonCard.svelte +49 -0
  107. package/skeleton/SkeletonCircle.svelte +25 -0
  108. package/skeleton/SkeletonField.svelte +19 -0
  109. package/skeleton/SkeletonRow.svelte +47 -0
  110. package/skeleton/SkeletonText.svelte +46 -0
  111. package/skeleton/TableSkeleton.svelte +60 -0
  112. package/spacing.css +32 -0
  113. package/stat/NextPayoutCountdown.svelte +52 -0
  114. package/stat/Stat.svelte +103 -0
  115. package/stat/ValueBox.svelte +38 -0
  116. package/status-row/StatusRow.svelte +176 -0
  117. package/status-row/types.ts +5 -0
  118. package/table/SelectAllCell.svelte +34 -0
  119. package/table/SelectAllTableCell.svelte +25 -0
  120. package/table/SelectRowCell.svelte +31 -0
  121. package/table/SelectRowTableCell.svelte +25 -0
  122. package/table/SelectionBar.svelte +68 -0
  123. package/table/SelectionOverlay.svelte +83 -0
  124. package/table/Table.svelte +64 -0
  125. package/table/TableCell.svelte +185 -0
  126. package/table/TableRow.svelte +86 -0
  127. package/table/index.ts +9 -0
  128. package/table/selection.svelte.ts +79 -0
  129. package/tabs/TabBlock.svelte +56 -0
  130. package/tabs/TabButton.svelte +33 -0
  131. package/template.css +1393 -0
  132. package/text/Span.svelte +83 -0
  133. package/text/Text.svelte +94 -0
  134. package/text/Title.svelte +75 -0
  135. package/text/color.ts +41 -0
  136. package/theme/theme.svelte.ts +33 -0
  137. package/tokens.css +62 -0
  138. package/typography.css +164 -0
@@ -0,0 +1,88 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ import { X } from '@lucide/svelte';
5
+ import { getContext } from 'svelte';
6
+
7
+ let {
8
+ canClose = () => true,
9
+ children,
10
+ description,
11
+ padded = true,
12
+ size = 'md',
13
+ title,
14
+ }: {
15
+ canClose?: () => boolean;
16
+ children: Snippet;
17
+ description?: string;
18
+ /** Wrap children in standard body padding. Set false for full-bleed/custom-scroll content. */
19
+ padded?: boolean;
20
+ size?: 'lg' | 'md' | 'sm' | 'xl';
21
+ title?: string;
22
+ } = $props();
23
+
24
+ const ctx = getContext<{ close: () => void; isOpen: boolean }>('dialog');
25
+
26
+ function close() {
27
+ if (!canClose()) return;
28
+ ctx.close();
29
+ }
30
+
31
+ const widthClass = $derived(
32
+ size === 'sm'
33
+ ? 'w-[380px]'
34
+ : size === 'lg'
35
+ ? 'w-[600px]'
36
+ : size === 'xl'
37
+ ? 'w-[760px]'
38
+ : 'w-[420px]'
39
+ );
40
+ const tallSizes = $derived(size === 'lg' || size === 'xl');
41
+ </script>
42
+
43
+ {#if ctx.isOpen}
44
+ <div
45
+ class="fixed inset-0 z-9999 flex items-center justify-center bg-[rgba(20,18,24,0.42)] backdrop-blur-sm"
46
+ aria-label="Close dialog"
47
+ onclick={close}
48
+ onkeydown={(e) => e.key === 'Escape' && close()}
49
+ role="button"
50
+ tabindex="-1"
51
+ >
52
+ <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
53
+ <div
54
+ class="max-w-[92vw] bg-(--bg) text-(--tx) border border-(--bd) rounded-lg overflow-hidden shadow-[0_24px_64px_-12px_rgba(20,18,24,0.22),0_8px_24px_rgba(20,18,24,0.08)] {widthClass} {tallSizes
55
+ ? 'max-h-[85vh] flex flex-col'
56
+ : ''}"
57
+ aria-modal="true"
58
+ onclick={(e) => e.stopPropagation()}
59
+ onkeydown={(e) => e.stopPropagation()}
60
+ role="dialog"
61
+ tabindex="-1"
62
+ >
63
+ {#if title}
64
+ <div class="relative px-5.5 pt-5 pb-4 border-b border-(--bds) text-center">
65
+ <h6 class="mx-auto max-w-full">
66
+ {title}
67
+ </h6>
68
+ {#if description}<p class="small text-(--txs) mt-1">{description}</p>{/if}
69
+ <button
70
+ class="absolute top-3 right-3 inline-flex items-center justify-center w-6.5 h-6.5 bg-transparent border border-transparent rounded-md text-(--txs) cursor-pointer shrink-0 transition-[background,border-color,color] duration-120 hover:bg-(--sf) hover:border-(--bd) hover:text-(--tx)"
71
+ aria-label="Close"
72
+ onclick={close}
73
+ type="button"
74
+ >
75
+ <X size={13} />
76
+ </button>
77
+ </div>
78
+ {/if}
79
+ {#if padded}
80
+ <div class="px-5.5 pt-4.5 pb-5.5 {tallSizes ? 'flex-1 min-h-0 overflow-y-auto' : ''}">
81
+ {@render children()}
82
+ </div>
83
+ {:else}
84
+ {@render children()}
85
+ {/if}
86
+ </div>
87
+ </div>
88
+ {/if}
@@ -0,0 +1,26 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ import { Button } from '@zeyolabs/ui/form';
5
+ import { getContext } from 'svelte';
6
+
7
+ type Variant = 'default' | 'destructive' | 'ghost' | 'ghost-destructive';
8
+
9
+ let {
10
+ children,
11
+ class: className = '',
12
+ disabled = false,
13
+ variant = 'ghost',
14
+ }: {
15
+ children?: Snippet;
16
+ class?: string;
17
+ disabled?: boolean;
18
+ variant?: Variant;
19
+ } = $props();
20
+
21
+ const ctx = getContext<undefined | { close: () => void }>('dialog');
22
+ </script>
23
+
24
+ <Button class={className} {disabled} onclick={() => ctx?.close()} {variant}>
25
+ {@render children?.()}
26
+ </Button>
@@ -0,0 +1,23 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ let {
5
+ border = false,
6
+ children,
7
+ class: className = '',
8
+ }: {
9
+ /** Full-bleed bordered footer — use with <DialogBody padded={false}>. */
10
+ border?: boolean;
11
+ children: Snippet;
12
+ class?: string;
13
+ } = $props();
14
+ </script>
15
+
16
+ <!-- Buttons always stretch to equal full width across the footer. -->
17
+ <div
18
+ class="flex gap-2 *:flex-1 {border
19
+ ? 'px-5.5 py-3.5 border-t border-(--bds)'
20
+ : 'mt-5'} {className}"
21
+ >
22
+ {@render children()}
23
+ </div>
@@ -0,0 +1,15 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ import { getContext } from 'svelte';
5
+
6
+ let { children }: { children?: Snippet } = $props();
7
+
8
+ const ctx = getContext<undefined | { open: () => void }>('dialog');
9
+ </script>
10
+
11
+ <!-- svelte-ignore a11y_click_events_have_key_events -->
12
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
13
+ <span style="display: contents" onclick={() => ctx?.open()}>
14
+ {@render children?.()}
15
+ </span>
@@ -0,0 +1,37 @@
1
+ <script lang="ts">
2
+ import Bar from '@zeyolabs/ui/bar/Bar.svelte';
3
+ import MiniStat from '@zeyolabs/ui/mini-stat/MiniStat.svelte';
4
+ import Span from '@zeyolabs/ui/text/Span.svelte';
5
+
6
+ let {
7
+ class: className = '',
8
+ emptyLabel = 'No data',
9
+ segments,
10
+ total,
11
+ }: {
12
+ class?: string;
13
+ /** Shown instead of the bar when every segment is zero (e.g. nothing verified yet). */
14
+ emptyLabel?: string;
15
+ segments: { color: string; label: string; value: number }[];
16
+ /** Forwarded to Bar — omit to size segments against their own sum (a full breakdown); pass
17
+ * an explicit total larger than the sum to read as a partial-progress bar instead. */
18
+ total?: number;
19
+ } = $props();
20
+
21
+ const visible = $derived(segments.filter((s) => s.value > 0));
22
+ </script>
23
+
24
+ {#if visible.length > 0}
25
+ <div class="w-full min-w-[220px] max-w-[380px] {className}">
26
+ <Bar segments={visible.map((s) => ({ color: s.color, value: s.value }))} {total} />
27
+ <div class="mt-1 flex flex-nowrap gap-x-3 whitespace-nowrap">
28
+ {#each visible as seg (seg.label)}
29
+ <MiniStat dot={seg.color} label={seg.label} value={seg.value.toLocaleString()} />
30
+ {/each}
31
+ </div>
32
+ </div>
33
+ {:else}
34
+ <div class="w-full min-w-[220px] max-w-[380px] {className}">
35
+ <Span color="secondary" size="sm">{emptyLabel}</Span>
36
+ </div>
37
+ {/if}
@@ -0,0 +1,31 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ import { setContext } from 'svelte';
5
+
6
+ let {
7
+ children,
8
+ onClose,
9
+ open = $bindable(false),
10
+ }: {
11
+ children: Snippet;
12
+ /** Fired when the drawer is closed via X / Esc / backdrop / close(). */
13
+ onClose?: () => void;
14
+ open?: boolean;
15
+ } = $props();
16
+
17
+ setContext('drawer', {
18
+ close: () => {
19
+ open = false;
20
+ onClose?.();
21
+ },
22
+ get isOpen() {
23
+ return open;
24
+ },
25
+ open: () => {
26
+ open = true;
27
+ },
28
+ });
29
+ </script>
30
+
31
+ {@render children()}
@@ -0,0 +1,61 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ import { getContext } from 'svelte';
5
+ import { fade, fly } from 'svelte/transition';
6
+
7
+ let {
8
+ canClose = () => true,
9
+ children,
10
+ side = 'right',
11
+ size = 'md',
12
+ }: {
13
+ canClose?: () => boolean;
14
+ children: Snippet;
15
+ side?: 'left' | 'right';
16
+ /** 360px / 420px / 560px, capped at 92vw. */
17
+ size?: 'lg' | 'md' | 'sm';
18
+ } = $props();
19
+
20
+ const ctx = getContext<{ close: () => void; isOpen: boolean }>('drawer');
21
+
22
+ function close() {
23
+ if (canClose()) ctx.close();
24
+ }
25
+
26
+ const widthClass = $derived(
27
+ size === 'sm'
28
+ ? 'w-[min(360px,92vw)]'
29
+ : size === 'lg'
30
+ ? 'w-[min(560px,92vw)]'
31
+ : 'w-[min(420px,92vw)]'
32
+ );
33
+ </script>
34
+
35
+ {#if ctx.isOpen}
36
+ <div
37
+ class="fixed inset-0 z-9000 bg-(--ov)"
38
+ aria-label="Close"
39
+ onclick={close}
40
+ onkeydown={(e) => e.key === 'Escape' && close()}
41
+ role="button"
42
+ tabindex="-1"
43
+ transition:fade={{ duration: 120 }}
44
+ ></div>
45
+
46
+ <!-- svelte-ignore a11y_no_noninteractive_element_interactions -->
47
+ <div
48
+ class="fixed inset-y-0 {side === 'right'
49
+ ? 'right-0'
50
+ : 'left-0'} z-9001 {widthClass} bg-(--bg) border-(--bd) {side === 'right'
51
+ ? 'border-l'
52
+ : 'border-r'} shadow-[0_16px_48px_-16px_rgba(20,18,24,0.2)] flex flex-col"
53
+ aria-modal="true"
54
+ onkeydown={(e) => e.key === 'Escape' && close()}
55
+ role="dialog"
56
+ tabindex="-1"
57
+ transition:fly={{ duration: 180, x: side === 'right' ? 40 : -40 }}
58
+ >
59
+ {@render children()}
60
+ </div>
61
+ {/if}
@@ -0,0 +1,74 @@
1
+ <script lang="ts">
2
+ import type { Component, Snippet } from 'svelte';
3
+
4
+ /**
5
+ * Centered placeholder for a table/list/panel with zero rows — title + optional
6
+ * description + optional action (a <Button> passed as children). Drop it inside a
7
+ * <td colspan={N}> to fill a table body, or standalone above/instead of the table.
8
+ */
9
+ let {
10
+ children,
11
+ description,
12
+ fill = false,
13
+ icon: Icon,
14
+ title,
15
+ }: {
16
+ /** Typically a single <Button>, e.g. "Clear filters" or "Create list". */
17
+ children?: Snippet;
18
+ description?: string;
19
+ /** Grow to fill a flex-column parent and centre vertically — for an empty pane. */
20
+ fill?: boolean;
21
+ icon?: Component;
22
+ title: string;
23
+ } = $props();
24
+ </script>
25
+
26
+ <div class="empty-state" class:fill>
27
+ {#if Icon}
28
+ <Icon class="empty-state-icon" size={22} />
29
+ {/if}
30
+ <p class="empty-state-title">{title}</p>
31
+ {#if description}
32
+ <p class="empty-state-description">{description}</p>
33
+ {/if}
34
+ {#if children}
35
+ <div class="empty-state-actions">
36
+ {@render children()}
37
+ </div>
38
+ {/if}
39
+ </div>
40
+
41
+ <style>
42
+ .empty-state {
43
+ display: flex;
44
+ flex-direction: column;
45
+ align-items: center;
46
+ padding: 56px 32px;
47
+ text-align: center;
48
+ }
49
+ .empty-state.fill {
50
+ flex: 1;
51
+ justify-content: center;
52
+ }
53
+ :global(.empty-state-icon) {
54
+ color: var(--txt);
55
+ margin-bottom: 10px;
56
+ }
57
+ .empty-state-title {
58
+ margin: 0;
59
+ font-size: 15px;
60
+ font-weight: 400;
61
+ color: var(--tx);
62
+ letter-spacing: -0.01em;
63
+ }
64
+ .empty-state-description {
65
+ margin: 8px 0 0;
66
+ max-width: 420px;
67
+ font-size: 13px;
68
+ line-height: 1.6;
69
+ color: var(--txs);
70
+ }
71
+ .empty-state-actions {
72
+ margin-top: 16px;
73
+ }
74
+ </style>
@@ -0,0 +1,54 @@
1
+ <script lang="ts" module>
2
+ const DEFAULT_MESSAGE: Record<number, string> = {
3
+ 403: 'You do not have access to this page.',
4
+ 404: 'This page could not be found.',
5
+ 500: 'Something went wrong on our end.',
6
+ };
7
+ </script>
8
+
9
+ <script lang="ts">
10
+ import type { Page } from '@sveltejs/kit';
11
+ import type { Snippet } from 'svelte';
12
+
13
+ import { House } from '@lucide/svelte';
14
+ import { Button } from '@zeyolabs/ui/form';
15
+
16
+ let {
17
+ children,
18
+ home,
19
+ page,
20
+ }: {
21
+ /** Extra action(s) rendered beside the home button. */
22
+ children?: Snippet;
23
+ /** Primary action; omit to render no button. */
24
+ home?: { href: string; label: string };
25
+ /** SvelteKit's `page` from `$app/state` — status + error message come from here. */
26
+ page: Page;
27
+ } = $props();
28
+
29
+ const status = $derived(page.status);
30
+ const message = $derived(page.error?.message);
31
+ </script>
32
+
33
+ <svelte:head><title>{status}</title></svelte:head>
34
+
35
+ <div
36
+ style="background: var(--bg); color: var(--tx);"
37
+ class="flex min-h-svh items-center justify-center px-6 py-12"
38
+ >
39
+ <div class="w-full max-w-md text-center">
40
+ <h1 class="text-9xl">{status}</h1>
41
+ <div style="background: var(--bd);" class="my-6 mx-auto h-px w-24"></div>
42
+ <p style="color: var(--txs);" class="text-xl">
43
+ {message ?? DEFAULT_MESSAGE[status] ?? 'An error occurred.'}
44
+ </p>
45
+ {#if home || children}
46
+ <div class="mt-8 flex flex-col items-center gap-3 sm:flex-row sm:justify-center">
47
+ {#if home}
48
+ <Button href={home.href}><House size={18} /> {home.label}</Button>
49
+ {/if}
50
+ {@render children?.()}
51
+ </div>
52
+ {/if}
53
+ </div>
54
+ </div>
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import type { Snippet } from 'svelte';
3
+
4
+ /** A small uppercase kicker label that sits above a heading (e.g. "SUPPORT TICKET"). */
5
+ let { children }: { children: Snippet } = $props();
6
+ </script>
7
+
8
+ <p class="sm tracking-wider uppercase mb-1 text-(--txs)">
9
+ {@render children()}
10
+ </p>
@@ -0,0 +1,89 @@
1
+ <script lang="ts">
2
+ import { ChevronDown } from '@lucide/svelte';
3
+
4
+ import Text from '../text/Text.svelte';
5
+
6
+ let { items }: { items: { answer: string; question: string }[] } = $props();
7
+
8
+ const id = $props.id();
9
+ let openIdx = $state<null | number>(null);
10
+ </script>
11
+
12
+ <div class="faq-list">
13
+ {#each items as item, i (item.question)}
14
+ {@const open = openIdx === i}
15
+ <div class="faq-item" class:faq-open={open}>
16
+ <button
17
+ class="faq-q"
18
+ aria-controls="{id}-a-{i}"
19
+ aria-expanded={open}
20
+ onclick={() => (openIdx = open ? null : i)}
21
+ type="button"
22
+ >
23
+ <span>{item.question}</span>
24
+ <ChevronDown class="faq-chev" size={20} />
25
+ </button>
26
+ {#if open}
27
+ <div id="{id}-a-{i}" class="faq-a">
28
+ <Text color="secondary" size="lg">{item.answer}</Text>
29
+ </div>
30
+ {/if}
31
+ </div>
32
+ {/each}
33
+ </div>
34
+
35
+ <style>
36
+ .faq-list {
37
+ display: flex;
38
+ flex-direction: column;
39
+ }
40
+ .faq-item {
41
+ padding: var(--spacing-md) 0;
42
+ border-top: 1px solid var(--bd);
43
+ }
44
+ .faq-item:last-child {
45
+ border-bottom: 1px solid var(--bd);
46
+ }
47
+ .faq-q {
48
+ display: flex;
49
+ justify-content: space-between;
50
+ align-items: center;
51
+ gap: 16px;
52
+ width: 100%;
53
+ text-align: left;
54
+ cursor: pointer;
55
+ -webkit-tap-highlight-color: transparent;
56
+ font-family: var(--font-heading);
57
+ font-size: 18px;
58
+ font-weight: 400;
59
+ color: var(--tx);
60
+ letter-spacing: -0.01em;
61
+ }
62
+ .faq-q :global(.faq-chev) {
63
+ color: var(--txt);
64
+ flex-shrink: 0;
65
+ transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
66
+ }
67
+ .faq-open .faq-q :global(.faq-chev) {
68
+ transform: rotate(180deg);
69
+ }
70
+ .faq-a {
71
+ margin-top: var(--spacing-sm);
72
+ padding-right: 36px;
73
+ }
74
+ .faq-a :global(p) {
75
+ line-height: 1.7;
76
+ }
77
+
78
+ @media (max-width: 640px) {
79
+ .faq-q {
80
+ font-size: 18px;
81
+ }
82
+ .faq-a {
83
+ padding-right: 24px;
84
+ }
85
+ .faq-a :global(p) {
86
+ font-size: 15px;
87
+ }
88
+ }
89
+ </style>
@@ -0,0 +1,78 @@
1
+ <script lang="ts">
2
+ import { X } from '@lucide/svelte';
3
+
4
+ let {
5
+ chips,
6
+ label,
7
+ onToggle,
8
+ removable = false,
9
+ selected = [],
10
+ }: {
11
+ chips: { label: string; value: string }[];
12
+ label?: string;
13
+ onToggle: (value: string) => void;
14
+ removable?: boolean;
15
+ selected?: string[];
16
+ } = $props();
17
+ </script>
18
+
19
+ {#if chips.length > 0}
20
+ <div class="group">
21
+ {#if label}<div class="label">{label}</div>{/if}
22
+ <div class="chips">
23
+ {#each chips as chip (chip.value)}
24
+ {@const on = selected.includes(chip.value)}
25
+ <button
26
+ class="chip"
27
+ class:on
28
+ aria-pressed={on}
29
+ onclick={() => onToggle(chip.value)}
30
+ type="button"
31
+ >
32
+ {chip.label}
33
+ {#if removable}<X size={11} />{/if}
34
+ </button>
35
+ {/each}
36
+ </div>
37
+ </div>
38
+ {/if}
39
+
40
+ <style>
41
+ .group {
42
+ display: flex;
43
+ flex-direction: column;
44
+ gap: 6px;
45
+ }
46
+ .label {
47
+ font-size: 10px;
48
+ font-weight: 600;
49
+ letter-spacing: 0.06em;
50
+ text-transform: uppercase;
51
+ color: var(--txs);
52
+ }
53
+ .chips {
54
+ display: flex;
55
+ flex-wrap: wrap;
56
+ gap: 6px;
57
+ }
58
+ .chip {
59
+ display: inline-flex;
60
+ align-items: center;
61
+ gap: 4px;
62
+ padding: 3px 10px;
63
+ font-size: 12px;
64
+ color: var(--tx);
65
+ background: var(--bg);
66
+ border: 1px solid var(--bd);
67
+ border-radius: var(--radius-full);
68
+ cursor: pointer;
69
+ }
70
+ .chip:hover {
71
+ background: var(--sf);
72
+ }
73
+ .chip.on {
74
+ color: var(--bg);
75
+ background: var(--tx);
76
+ border-color: var(--tx);
77
+ }
78
+ </style>