storyloco 1.14.2 → 1.14.3
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.
- package/README.md +4 -1
- package/package.json +12 -9
- package/packages/asset/types.ts +55 -0
- package/packages/link/types.ts +1 -1
- package/packages/seo/types.ts +10 -0
- package/packages/shared/dist/components/ui/accordion/accordion-content.svelte +4 -4
- package/packages/shared/dist/components/ui/accordion/accordion-content.svelte.d.ts +1 -1
- package/packages/shared/dist/components/ui/accordion/accordion-item.svelte +4 -4
- package/packages/shared/dist/components/ui/accordion/accordion-item.svelte.d.ts +1 -1
- package/packages/shared/dist/components/ui/accordion/accordion-trigger.svelte +4 -4
- package/packages/shared/dist/components/ui/accordion/accordion-trigger.svelte.d.ts +1 -2
- package/packages/shared/dist/components/ui/accordion/accordion.svelte +2 -2
- package/packages/shared/dist/components/ui/accordion/accordion.svelte.d.ts +1 -1
- package/packages/shared/dist/components/ui/accordion/index.d.ts +4 -4
- package/packages/shared/dist/components/ui/accordion/index.js +4 -4
- package/packages/shared/dist/components/ui/dialog/dialog-close.svelte +7 -0
- package/packages/shared/dist/components/ui/dialog/dialog-close.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dialog/dialog-content.svelte +43 -0
- package/packages/shared/dist/components/ui/dialog/dialog-content.svelte.d.ts +11 -0
- package/packages/shared/dist/components/ui/dialog/dialog-description.svelte +17 -0
- package/packages/shared/dist/components/ui/dialog/dialog-description.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dialog/dialog-footer.svelte +23 -0
- package/packages/shared/dist/components/ui/dialog/dialog-footer.svelte.d.ts +5 -0
- package/packages/shared/dist/components/ui/dialog/dialog-header.svelte +20 -0
- package/packages/shared/dist/components/ui/dialog/dialog-header.svelte.d.ts +5 -0
- package/packages/shared/dist/components/ui/dialog/dialog-overlay.svelte +20 -0
- package/packages/shared/dist/components/ui/dialog/dialog-overlay.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dialog/dialog-title.svelte +17 -0
- package/packages/shared/dist/components/ui/dialog/dialog-title.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dialog/dialog-trigger.svelte +7 -0
- package/packages/shared/dist/components/ui/dialog/dialog-trigger.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dialog/index.d.ts +11 -0
- package/packages/shared/dist/components/ui/dialog/index.js +14 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +41 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +9 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte +27 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +7 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +8 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-group.svelte +7 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-group.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +8 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +8 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +31 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +5 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +7 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +7 -0
- package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/dropdown-menu/index.d.ts +25 -0
- package/packages/shared/dist/components/ui/dropdown-menu/index.js +17 -0
- package/packages/shared/dist/components/ui/scroll-area/index.d.ts +3 -0
- package/packages/shared/dist/components/ui/scroll-area/index.js +5 -0
- package/packages/shared/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte +31 -0
- package/packages/shared/dist/components/ui/scroll-area/scroll-area-scrollbar.svelte.d.ts +4 -0
- package/packages/shared/dist/components/ui/scroll-area/scroll-area.svelte +43 -0
- package/packages/shared/dist/components/ui/scroll-area/scroll-area.svelte.d.ts +11 -0
- package/packages/shared/dist/components/ui/sonner/index.d.ts +1 -0
- package/packages/shared/dist/components/ui/sonner/index.js +1 -0
- package/packages/shared/dist/components/ui/sonner/sonner.svelte +13 -0
- package/packages/shared/dist/components/ui/sonner/sonner.svelte.d.ts +4 -0
- package/packages/shared/dist/global.css +3 -3
- package/packages/shared/dist/index.d.ts +5 -0
- package/packages/shared/dist/index.js +5 -0
- package/packages/shared/dist/utils.d.ts +3 -3
- package/packages/shared/dist/utils.js +2 -2
package/README.md
CHANGED
|
@@ -11,6 +11,7 @@ A collection of slick Storyblok field plugins built with Svelte 5, TypeScript, a
|
|
|
11
11
|
- **📝 Heading** - Simple heading editor with level selection (H1-H6)
|
|
12
12
|
- **🎨 Theme** - Color theme selector with visual previews
|
|
13
13
|
- **🔗 Link** - Link editor with support for internal, external, email, and asset links
|
|
14
|
+
- **🔍 SEO** - SEO metadata editor with support for title, description, OG tags, and Twitter cards
|
|
14
15
|
- **🏗️ Plans** - Floor plan manager with drag-and-drop sorting for types, floors, dimensions, and rooms
|
|
15
16
|
- **📝 Input** - Comprehensive form input field with support for all HTML input types, checkboxes, radio buttons, selects, and textareas
|
|
16
17
|
- **⏰ Time** - Simple time input field with step control
|
|
@@ -51,9 +52,10 @@ import type { Heading } from 'storyloco/heading'
|
|
|
51
52
|
import type { Link } from 'storyloco/link'
|
|
52
53
|
import type { Input } from 'storyloco/input'
|
|
53
54
|
import type { Asset } from 'storyloco/asset'
|
|
55
|
+
import type { SEO } from 'storyloco/seo'
|
|
54
56
|
|
|
55
57
|
// Or import everything
|
|
56
|
-
import type { Video, Heading, Link, Input, Asset } from 'storyloco'
|
|
58
|
+
import type { Video, Heading, Link, Input, Asset, SEO } from 'storyloco'
|
|
57
59
|
```
|
|
58
60
|
|
|
59
61
|
### Use Storyblok Client
|
|
@@ -279,6 +281,7 @@ storyloco/
|
|
|
279
281
|
│ ├── heading/ # Heading editor plugin
|
|
280
282
|
│ ├── theme/ # Theme selector plugin
|
|
281
283
|
│ ├── link/ # Link editor plugin
|
|
284
|
+
│ ├── seo/ # SEO metadata editor plugin
|
|
282
285
|
│ ├── input/ # Form input field plugin
|
|
283
286
|
│ └── shared/ # UI component library
|
|
284
287
|
├── src/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "storyloco",
|
|
3
|
-
"version": "1.14.
|
|
3
|
+
"version": "1.14.3",
|
|
4
4
|
"description": "A collection of slick Storyblok field plugins built with Svelte 5, TypeScript, and Tailwind CSS",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storyblok",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"packages/vite/dist",
|
|
31
31
|
"packages/ticketsource/types.ts",
|
|
32
32
|
"packages/input/types.ts",
|
|
33
|
-
"packages/time/types.ts"
|
|
33
|
+
"packages/time/types.ts",
|
|
34
|
+
"packages/seo/types.ts"
|
|
34
35
|
],
|
|
35
36
|
"exports": {
|
|
36
37
|
".": {
|
|
@@ -79,18 +80,21 @@
|
|
|
79
80
|
"./time": {
|
|
80
81
|
"types": "./packages/time/types.ts",
|
|
81
82
|
"svelte": "./packages/time/src/app.svelte.ts"
|
|
83
|
+
},
|
|
84
|
+
"./seo": {
|
|
85
|
+
"types": "./packages/seo/types.ts"
|
|
82
86
|
}
|
|
83
87
|
},
|
|
84
88
|
"devDependencies": {
|
|
85
|
-
"@types/node": "24.
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "8.46.
|
|
87
|
-
"@typescript-eslint/parser": "8.46.
|
|
88
|
-
"eslint": "9.
|
|
89
|
+
"@types/node": "24.10.0",
|
|
90
|
+
"@typescript-eslint/eslint-plugin": "8.46.3",
|
|
91
|
+
"@typescript-eslint/parser": "8.46.3",
|
|
92
|
+
"eslint": "9.39.1",
|
|
89
93
|
"eslint-plugin-prettier": "5.5.4",
|
|
90
94
|
"kitto": "1.0.0-rc.17",
|
|
91
95
|
"prettier": "3.6.2",
|
|
92
96
|
"typescript": "5.9.3",
|
|
93
|
-
"vite": "7.
|
|
97
|
+
"vite": "7.2.0"
|
|
94
98
|
},
|
|
95
99
|
"peerDependencies": {
|
|
96
100
|
"@storyblok/svelte": "^5.2.4",
|
|
@@ -109,7 +113,6 @@
|
|
|
109
113
|
],
|
|
110
114
|
"dependencies": {
|
|
111
115
|
"chalk": "5.6.2",
|
|
112
|
-
"ora": "9.0.0"
|
|
113
|
-
"storyblok-generate-ts": "^2.2.0"
|
|
116
|
+
"ora": "9.0.0"
|
|
114
117
|
}
|
|
115
118
|
}
|
package/packages/asset/types.ts
CHANGED
|
@@ -69,3 +69,58 @@ export interface Asset extends Omit<StoryblokAsset, 'id'> {
|
|
|
69
69
|
/* The name of the asset ('Description' in Storyblok UI) */
|
|
70
70
|
name?: string
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
interface BaseLink {
|
|
74
|
+
url?: string
|
|
75
|
+
text?: string
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export const link_types = ['asset', 'external', 'email', 'internal'] as const
|
|
79
|
+
export const target_options = ['_self', '_blank', '_parent', '_top', '_new'] as const
|
|
80
|
+
export const rel_options = [
|
|
81
|
+
'noopener',
|
|
82
|
+
'noreferrer',
|
|
83
|
+
'nofollow',
|
|
84
|
+
'noopener noreferrer',
|
|
85
|
+
'noopener noreferrer nofollow',
|
|
86
|
+
] as const
|
|
87
|
+
|
|
88
|
+
export type LinkType = (typeof link_types)[number]
|
|
89
|
+
export type Target = (typeof target_options)[number]
|
|
90
|
+
export type Rel = (typeof rel_options)[number]
|
|
91
|
+
|
|
92
|
+
export interface AssetLink extends BaseLink {
|
|
93
|
+
type: 'asset'
|
|
94
|
+
asset?: Asset
|
|
95
|
+
target?: Target
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface ExternalLink extends BaseLink {
|
|
99
|
+
type: 'external'
|
|
100
|
+
target?: Target
|
|
101
|
+
rel?: Rel
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface EmailLink extends BaseLink {
|
|
105
|
+
type: 'email'
|
|
106
|
+
target?: Target
|
|
107
|
+
email?: string
|
|
108
|
+
subject?: string
|
|
109
|
+
body?: string
|
|
110
|
+
cc?: string
|
|
111
|
+
bcc?: string
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface StoryLink extends BaseLink {
|
|
115
|
+
type: 'internal'
|
|
116
|
+
target?: Target
|
|
117
|
+
suffix?: string
|
|
118
|
+
story?: {
|
|
119
|
+
id: number
|
|
120
|
+
uuid: string
|
|
121
|
+
name: string
|
|
122
|
+
published_at: string | null
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type Link = AssetLink | ExternalLink | EmailLink | StoryLink
|
package/packages/link/types.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Accordion as AccordionPrimitive } from
|
|
3
|
-
import { cn, type WithoutChild } from
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
3
|
+
import { cn, type WithoutChild } from "../../../utils.js";
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
ref = $bindable(null),
|
|
7
7
|
class: className,
|
|
8
8
|
children,
|
|
9
9
|
...restProps
|
|
10
|
-
}: WithoutChild<AccordionPrimitive.ContentProps> = $props()
|
|
10
|
+
}: WithoutChild<AccordionPrimitive.ContentProps> = $props();
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<AccordionPrimitive.Content
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
class="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
|
|
17
17
|
{...restProps}
|
|
18
18
|
>
|
|
19
|
-
<div class={cn(
|
|
19
|
+
<div class={cn("pb-4 pt-0", className)}>
|
|
20
20
|
{@render children?.()}
|
|
21
21
|
</div>
|
|
22
22
|
</AccordionPrimitive.Content>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordion as AccordionPrimitive } from
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
2
|
declare const AccordionContent: import("svelte").Component<Omit<AccordionPrimitive.ContentProps, "child">, {}, "ref">;
|
|
3
3
|
type AccordionContent = ReturnType<typeof AccordionContent>;
|
|
4
4
|
export default AccordionContent;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Accordion as AccordionPrimitive } from
|
|
3
|
-
import { cn } from
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
4
|
|
|
5
5
|
let {
|
|
6
6
|
ref = $bindable(null),
|
|
7
7
|
class: className,
|
|
8
8
|
...restProps
|
|
9
|
-
}: AccordionPrimitive.ItemProps = $props()
|
|
9
|
+
}: AccordionPrimitive.ItemProps = $props();
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
<AccordionPrimitive.Item
|
|
13
13
|
bind:ref
|
|
14
14
|
data-slot="accordion-item"
|
|
15
|
-
class={cn(
|
|
15
|
+
class={cn("border-b last:border-b-0", className)}
|
|
16
16
|
{...restProps}
|
|
17
17
|
/>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordion as AccordionPrimitive } from
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
2
|
declare const AccordionItem: import("svelte").Component<AccordionPrimitive.ItemProps, {}, "ref">;
|
|
3
3
|
type AccordionItem = ReturnType<typeof AccordionItem>;
|
|
4
4
|
export default AccordionItem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { Accordion as AccordionPrimitive } from 'bits-ui'
|
|
3
3
|
import ChevronDownIcon from '@lucide/svelte/icons/chevron-down'
|
|
4
|
-
import { cn
|
|
4
|
+
import { cn } from '../../../utils.js'
|
|
5
5
|
|
|
6
6
|
let {
|
|
7
7
|
ref = $bindable(null),
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
level = 3,
|
|
10
10
|
children,
|
|
11
11
|
...restProps
|
|
12
|
-
}:
|
|
12
|
+
}: AccordionPrimitive.TriggerProps & {
|
|
13
13
|
level?: AccordionPrimitive.HeaderProps['level']
|
|
14
14
|
} = $props()
|
|
15
15
|
</script>
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
data-slot="accordion-trigger"
|
|
20
20
|
bind:ref
|
|
21
21
|
class={cn(
|
|
22
|
-
'
|
|
22
|
+
'flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',
|
|
23
23
|
className
|
|
24
24
|
)}
|
|
25
25
|
{...restProps}
|
|
26
26
|
>
|
|
27
27
|
{@render children?.()}
|
|
28
28
|
<ChevronDownIcon
|
|
29
|
-
class="
|
|
29
|
+
class="pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200"
|
|
30
30
|
/>
|
|
31
31
|
</AccordionPrimitive.Trigger>
|
|
32
32
|
</AccordionPrimitive.Header>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Accordion as AccordionPrimitive } from 'bits-ui';
|
|
2
|
-
|
|
3
|
-
type $$ComponentProps = WithoutChild<AccordionPrimitive.TriggerProps> & {
|
|
2
|
+
type $$ComponentProps = AccordionPrimitive.TriggerProps & {
|
|
4
3
|
level?: AccordionPrimitive.HeaderProps['level'];
|
|
5
4
|
};
|
|
6
5
|
declare const AccordionTrigger: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import { Accordion as AccordionPrimitive } from
|
|
2
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
3
3
|
|
|
4
4
|
let {
|
|
5
5
|
ref = $bindable(null),
|
|
6
6
|
value = $bindable(),
|
|
7
7
|
...restProps
|
|
8
|
-
}: AccordionPrimitive.RootProps = $props()
|
|
8
|
+
}: AccordionPrimitive.RootProps = $props();
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<AccordionPrimitive.Root
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Accordion as AccordionPrimitive } from
|
|
1
|
+
import { Accordion as AccordionPrimitive } from "bits-ui";
|
|
2
2
|
declare const Accordion: import("svelte").Component<AccordionPrimitive.RootProps, {}, "value" | "ref">;
|
|
3
3
|
type Accordion = ReturnType<typeof Accordion>;
|
|
4
4
|
export default Accordion;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Root from
|
|
2
|
-
import Content from
|
|
3
|
-
import Item from
|
|
4
|
-
import Trigger from
|
|
1
|
+
import Root from "./accordion.svelte";
|
|
2
|
+
import Content from "./accordion-content.svelte";
|
|
3
|
+
import Item from "./accordion-item.svelte";
|
|
4
|
+
import Trigger from "./accordion-trigger.svelte";
|
|
5
5
|
export { Root, Content, Item, Trigger, Root as Accordion, Content as AccordionContent, Item as AccordionItem, Trigger as AccordionTrigger, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import Root from
|
|
2
|
-
import Content from
|
|
3
|
-
import Item from
|
|
4
|
-
import Trigger from
|
|
1
|
+
import Root from "./accordion.svelte";
|
|
2
|
+
import Content from "./accordion-content.svelte";
|
|
3
|
+
import Item from "./accordion-item.svelte";
|
|
4
|
+
import Trigger from "./accordion-trigger.svelte";
|
|
5
5
|
export { Root, Content, Item, Trigger,
|
|
6
6
|
//
|
|
7
7
|
Root as Accordion, Content as AccordionContent, Item as AccordionItem, Trigger as AccordionTrigger, };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import XIcon from "@lucide/svelte/icons/x";
|
|
4
|
+
import type { Snippet } from "svelte";
|
|
5
|
+
import * as Dialog from "./index.js";
|
|
6
|
+
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
class: className,
|
|
11
|
+
portalProps,
|
|
12
|
+
children,
|
|
13
|
+
showCloseButton = true,
|
|
14
|
+
...restProps
|
|
15
|
+
}: WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
|
|
16
|
+
portalProps?: DialogPrimitive.PortalProps;
|
|
17
|
+
children: Snippet;
|
|
18
|
+
showCloseButton?: boolean;
|
|
19
|
+
} = $props();
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Dialog.Portal {...portalProps}>
|
|
23
|
+
<Dialog.Overlay />
|
|
24
|
+
<DialogPrimitive.Content
|
|
25
|
+
bind:ref
|
|
26
|
+
data-slot="dialog-content"
|
|
27
|
+
class={cn(
|
|
28
|
+
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed left-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
29
|
+
className
|
|
30
|
+
)}
|
|
31
|
+
{...restProps}
|
|
32
|
+
>
|
|
33
|
+
{@render children?.()}
|
|
34
|
+
{#if showCloseButton}
|
|
35
|
+
<DialogPrimitive.Close
|
|
36
|
+
class="ring-offset-background focus:ring-ring rounded-xs focus:outline-hidden absolute end-4 top-4 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 disabled:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
37
|
+
>
|
|
38
|
+
<XIcon />
|
|
39
|
+
<span class="sr-only">Close</span>
|
|
40
|
+
</DialogPrimitive.Close>
|
|
41
|
+
{/if}
|
|
42
|
+
</DialogPrimitive.Content>
|
|
43
|
+
</Dialog.Portal>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
import { type WithoutChildrenOrChild } from "shared/dist/utils.js";
|
|
4
|
+
type $$ComponentProps = WithoutChildrenOrChild<DialogPrimitive.ContentProps> & {
|
|
5
|
+
portalProps?: DialogPrimitive.PortalProps;
|
|
6
|
+
children: Snippet;
|
|
7
|
+
showCloseButton?: boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const DialogContent: import("svelte").Component<$$ComponentProps, {}, "ref">;
|
|
10
|
+
type DialogContent = ReturnType<typeof DialogContent>;
|
|
11
|
+
export default DialogContent;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DialogPrimitive.DescriptionProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DialogPrimitive.Description
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dialog-description"
|
|
15
|
+
class={cn("text-muted-foreground text-sm", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { cn, type WithElementRef } from '../../../utils.js'
|
|
3
|
+
import type { HTMLAttributes } from 'svelte/elements'
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="dialog-footer"
|
|
16
|
+
class={cn(
|
|
17
|
+
'-m-6 mt-0 flex flex-col-reverse gap-2 border-t bg-accent p-4 px-6 sm:flex-row sm:justify-end',
|
|
18
|
+
className
|
|
19
|
+
)}
|
|
20
|
+
{...restProps}
|
|
21
|
+
>
|
|
22
|
+
{@render children?.()}
|
|
23
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type WithElementRef } from 'shared/dist/utils.js';
|
|
2
|
+
import type { HTMLAttributes } from 'svelte/elements';
|
|
3
|
+
declare const DialogFooter: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type DialogFooter = ReturnType<typeof DialogFooter>;
|
|
5
|
+
export default DialogFooter;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
3
|
+
import { cn, type WithElementRef } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
children,
|
|
9
|
+
...restProps
|
|
10
|
+
}: WithElementRef<HTMLAttributes<HTMLDivElement>> = $props();
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<div
|
|
14
|
+
bind:this={ref}
|
|
15
|
+
data-slot="dialog-header"
|
|
16
|
+
class={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
17
|
+
{...restProps}
|
|
18
|
+
>
|
|
19
|
+
{@render children?.()}
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from "svelte/elements";
|
|
2
|
+
import { type WithElementRef } from "shared/dist/utils.js";
|
|
3
|
+
declare const DialogHeader: import("svelte").Component<WithElementRef<HTMLAttributes<HTMLDivElement>>, {}, "ref">;
|
|
4
|
+
type DialogHeader = ReturnType<typeof DialogHeader>;
|
|
5
|
+
export default DialogHeader;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DialogPrimitive.OverlayProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DialogPrimitive.Overlay
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dialog-overlay"
|
|
15
|
+
class={cn(
|
|
16
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
17
|
+
className
|
|
18
|
+
)}
|
|
19
|
+
{...restProps}
|
|
20
|
+
/>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
3
|
+
import { cn } from "../../../utils.js";
|
|
4
|
+
|
|
5
|
+
let {
|
|
6
|
+
ref = $bindable(null),
|
|
7
|
+
class: className,
|
|
8
|
+
...restProps
|
|
9
|
+
}: DialogPrimitive.TitleProps = $props();
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<DialogPrimitive.Title
|
|
13
|
+
bind:ref
|
|
14
|
+
data-slot="dialog-title"
|
|
15
|
+
class={cn("text-lg font-semibold leading-none", className)}
|
|
16
|
+
{...restProps}
|
|
17
|
+
/>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Title from "./dialog-title.svelte";
|
|
2
|
+
import Footer from "./dialog-footer.svelte";
|
|
3
|
+
import Header from "./dialog-header.svelte";
|
|
4
|
+
import Overlay from "./dialog-overlay.svelte";
|
|
5
|
+
import Content from "./dialog-content.svelte";
|
|
6
|
+
import Description from "./dialog-description.svelte";
|
|
7
|
+
import Trigger from "./dialog-trigger.svelte";
|
|
8
|
+
import Close from "./dialog-close.svelte";
|
|
9
|
+
declare const Root: import("svelte").Component<import("bits-ui").AlertDialogRootPropsWithoutHTML, {}, "open">;
|
|
10
|
+
declare const Portal: import("svelte").Component<import("bits-ui").PortalProps, {}, "">;
|
|
11
|
+
export { Root, Title, Portal, Footer, Header, Trigger, Overlay, Content, Description, Close, Root as Dialog, Title as DialogTitle, Portal as DialogPortal, Footer as DialogFooter, Header as DialogHeader, Trigger as DialogTrigger, Overlay as DialogOverlay, Content as DialogContent, Description as DialogDescription, Close as DialogClose, };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Dialog as DialogPrimitive } from "bits-ui";
|
|
2
|
+
import Title from "./dialog-title.svelte";
|
|
3
|
+
import Footer from "./dialog-footer.svelte";
|
|
4
|
+
import Header from "./dialog-header.svelte";
|
|
5
|
+
import Overlay from "./dialog-overlay.svelte";
|
|
6
|
+
import Content from "./dialog-content.svelte";
|
|
7
|
+
import Description from "./dialog-description.svelte";
|
|
8
|
+
import Trigger from "./dialog-trigger.svelte";
|
|
9
|
+
import Close from "./dialog-close.svelte";
|
|
10
|
+
const Root = DialogPrimitive.Root;
|
|
11
|
+
const Portal = DialogPrimitive.Portal;
|
|
12
|
+
export { Root, Title, Portal, Footer, Header, Trigger, Overlay, Content, Description, Close,
|
|
13
|
+
//
|
|
14
|
+
Root as Dialog, Title as DialogTitle, Portal as DialogPortal, Footer as DialogFooter, Header as DialogHeader, Trigger as DialogTrigger, Overlay as DialogOverlay, Content as DialogContent, Description as DialogDescription, Close as DialogClose, };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
3
|
+
import CheckIcon from "@lucide/svelte/icons/check";
|
|
4
|
+
import MinusIcon from "@lucide/svelte/icons/minus";
|
|
5
|
+
import { cn, type WithoutChildrenOrChild } from "../../../utils.js";
|
|
6
|
+
import type { Snippet } from "svelte";
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
ref = $bindable(null),
|
|
10
|
+
checked = $bindable(false),
|
|
11
|
+
indeterminate = $bindable(false),
|
|
12
|
+
class: className,
|
|
13
|
+
children: childrenProp,
|
|
14
|
+
...restProps
|
|
15
|
+
}: WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
|
|
16
|
+
children?: Snippet;
|
|
17
|
+
} = $props();
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<DropdownMenuPrimitive.CheckboxItem
|
|
21
|
+
bind:ref
|
|
22
|
+
bind:checked
|
|
23
|
+
bind:indeterminate
|
|
24
|
+
data-slot="dropdown-menu-checkbox-item"
|
|
25
|
+
class={cn(
|
|
26
|
+
"focus:bg-accent focus:text-accent-foreground outline-hidden relative flex cursor-default select-none items-center gap-2 rounded-sm py-1.5 pl-8 pr-2 text-sm data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
27
|
+
className
|
|
28
|
+
)}
|
|
29
|
+
{...restProps}
|
|
30
|
+
>
|
|
31
|
+
{#snippet children({ checked, indeterminate })}
|
|
32
|
+
<span class="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
33
|
+
{#if indeterminate}
|
|
34
|
+
<MinusIcon class="size-4" />
|
|
35
|
+
{:else}
|
|
36
|
+
<CheckIcon class={cn("size-4", !checked && "text-transparent")} />
|
|
37
|
+
{/if}
|
|
38
|
+
</span>
|
|
39
|
+
{@render childrenProp?.()}
|
|
40
|
+
{/snippet}
|
|
41
|
+
</DropdownMenuPrimitive.CheckboxItem>
|
package/packages/shared/dist/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DropdownMenu as DropdownMenuPrimitive } from "bits-ui";
|
|
2
|
+
import { type WithoutChildrenOrChild } from "../../../utils.js";
|
|
3
|
+
import type { Snippet } from "svelte";
|
|
4
|
+
type $$ComponentProps = WithoutChildrenOrChild<DropdownMenuPrimitive.CheckboxItemProps> & {
|
|
5
|
+
children?: Snippet;
|
|
6
|
+
};
|
|
7
|
+
declare const DropdownMenuCheckboxItem: import("svelte").Component<$$ComponentProps, {}, "ref" | "checked" | "indeterminate">;
|
|
8
|
+
type DropdownMenuCheckboxItem = ReturnType<typeof DropdownMenuCheckboxItem>;
|
|
9
|
+
export default DropdownMenuCheckboxItem;
|