@aphexcms/ui 0.1.1 → 0.1.2

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 (151) hide show
  1. package/package.json +2 -2
  2. package/src/lib/components/app-sidebar.svelte +0 -171
  3. package/src/lib/components/nav-main.svelte +0 -64
  4. package/src/lib/components/nav-projects.svelte +0 -76
  5. package/src/lib/components/nav-user.svelte +0 -87
  6. package/src/lib/components/sidebar-07/+page.svelte +0 -39
  7. package/src/lib/components/team-switcher.svelte +0 -67
  8. package/src/lib/components/ui/alert/alert-description.svelte +0 -23
  9. package/src/lib/components/ui/alert/alert-title.svelte +0 -20
  10. package/src/lib/components/ui/alert/alert.svelte +0 -44
  11. package/src/lib/components/ui/alert/index.ts +0 -14
  12. package/src/lib/components/ui/alert-dialog/alert-dialog-action.svelte +0 -18
  13. package/src/lib/components/ui/alert-dialog/alert-dialog-cancel.svelte +0 -18
  14. package/src/lib/components/ui/alert-dialog/alert-dialog-content.svelte +0 -27
  15. package/src/lib/components/ui/alert-dialog/alert-dialog-description.svelte +0 -17
  16. package/src/lib/components/ui/alert-dialog/alert-dialog-footer.svelte +0 -20
  17. package/src/lib/components/ui/alert-dialog/alert-dialog-header.svelte +0 -20
  18. package/src/lib/components/ui/alert-dialog/alert-dialog-overlay.svelte +0 -20
  19. package/src/lib/components/ui/alert-dialog/alert-dialog-title.svelte +0 -17
  20. package/src/lib/components/ui/alert-dialog/alert-dialog-trigger.svelte +0 -7
  21. package/src/lib/components/ui/alert-dialog/index.ts +0 -39
  22. package/src/lib/components/ui/avatar/avatar-fallback.svelte +0 -17
  23. package/src/lib/components/ui/avatar/avatar-image.svelte +0 -17
  24. package/src/lib/components/ui/avatar/avatar.svelte +0 -19
  25. package/src/lib/components/ui/avatar/index.ts +0 -13
  26. package/src/lib/components/ui/badge/badge.svelte +0 -49
  27. package/src/lib/components/ui/badge/index.ts +0 -2
  28. package/src/lib/components/ui/breadcrumb/breadcrumb-ellipsis.svelte +0 -23
  29. package/src/lib/components/ui/breadcrumb/breadcrumb-item.svelte +0 -20
  30. package/src/lib/components/ui/breadcrumb/breadcrumb-link.svelte +0 -31
  31. package/src/lib/components/ui/breadcrumb/breadcrumb-list.svelte +0 -23
  32. package/src/lib/components/ui/breadcrumb/breadcrumb-page.svelte +0 -23
  33. package/src/lib/components/ui/breadcrumb/breadcrumb-separator.svelte +0 -27
  34. package/src/lib/components/ui/breadcrumb/breadcrumb.svelte +0 -21
  35. package/src/lib/components/ui/breadcrumb/index.ts +0 -25
  36. package/src/lib/components/ui/button/button.svelte +0 -82
  37. package/src/lib/components/ui/button/index.ts +0 -17
  38. package/src/lib/components/ui/card/card-action.svelte +0 -20
  39. package/src/lib/components/ui/card/card-content.svelte +0 -15
  40. package/src/lib/components/ui/card/card-description.svelte +0 -20
  41. package/src/lib/components/ui/card/card-footer.svelte +0 -20
  42. package/src/lib/components/ui/card/card-header.svelte +0 -23
  43. package/src/lib/components/ui/card/card-title.svelte +0 -20
  44. package/src/lib/components/ui/card/card.svelte +0 -23
  45. package/src/lib/components/ui/card/index.ts +0 -25
  46. package/src/lib/components/ui/collapsible/collapsible-content.svelte +0 -7
  47. package/src/lib/components/ui/collapsible/collapsible-trigger.svelte +0 -7
  48. package/src/lib/components/ui/collapsible/collapsible.svelte +0 -11
  49. package/src/lib/components/ui/collapsible/index.ts +0 -13
  50. package/src/lib/components/ui/command/command-dialog.svelte +0 -40
  51. package/src/lib/components/ui/command/command-empty.svelte +0 -17
  52. package/src/lib/components/ui/command/command-group.svelte +0 -30
  53. package/src/lib/components/ui/command/command-input.svelte +0 -26
  54. package/src/lib/components/ui/command/command-item.svelte +0 -20
  55. package/src/lib/components/ui/command/command-link-item.svelte +0 -20
  56. package/src/lib/components/ui/command/command-list.svelte +0 -17
  57. package/src/lib/components/ui/command/command-separator.svelte +0 -17
  58. package/src/lib/components/ui/command/command-shortcut.svelte +0 -20
  59. package/src/lib/components/ui/command/command.svelte +0 -22
  60. package/src/lib/components/ui/command/index.ts +0 -40
  61. package/src/lib/components/ui/dialog/dialog-close.svelte +0 -7
  62. package/src/lib/components/ui/dialog/dialog-content.svelte +0 -43
  63. package/src/lib/components/ui/dialog/dialog-description.svelte +0 -17
  64. package/src/lib/components/ui/dialog/dialog-footer.svelte +0 -20
  65. package/src/lib/components/ui/dialog/dialog-header.svelte +0 -20
  66. package/src/lib/components/ui/dialog/dialog-overlay.svelte +0 -20
  67. package/src/lib/components/ui/dialog/dialog-title.svelte +0 -17
  68. package/src/lib/components/ui/dialog/dialog-trigger.svelte +0 -7
  69. package/src/lib/components/ui/dialog/index.ts +0 -37
  70. package/src/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +0 -41
  71. package/src/lib/components/ui/dropdown-menu/dropdown-menu-content.svelte +0 -27
  72. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group-heading.svelte +0 -22
  73. package/src/lib/components/ui/dropdown-menu/dropdown-menu-group.svelte +0 -7
  74. package/src/lib/components/ui/dropdown-menu/dropdown-menu-item.svelte +0 -27
  75. package/src/lib/components/ui/dropdown-menu/dropdown-menu-label.svelte +0 -24
  76. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.svelte +0 -16
  77. package/src/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.svelte +0 -31
  78. package/src/lib/components/ui/dropdown-menu/dropdown-menu-separator.svelte +0 -17
  79. package/src/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.svelte +0 -20
  80. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.svelte +0 -20
  81. package/src/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +0 -29
  82. package/src/lib/components/ui/dropdown-menu/dropdown-menu-trigger.svelte +0 -7
  83. package/src/lib/components/ui/dropdown-menu/index.ts +0 -49
  84. package/src/lib/components/ui/input/index.ts +0 -7
  85. package/src/lib/components/ui/input/input.svelte +0 -52
  86. package/src/lib/components/ui/label/index.ts +0 -7
  87. package/src/lib/components/ui/label/label.svelte +0 -20
  88. package/src/lib/components/ui/popover/index.ts +0 -17
  89. package/src/lib/components/ui/popover/popover-content.svelte +0 -29
  90. package/src/lib/components/ui/popover/popover-trigger.svelte +0 -17
  91. package/src/lib/components/ui/select/index.ts +0 -37
  92. package/src/lib/components/ui/select/select-content.svelte +0 -40
  93. package/src/lib/components/ui/select/select-group-heading.svelte +0 -21
  94. package/src/lib/components/ui/select/select-group.svelte +0 -7
  95. package/src/lib/components/ui/select/select-item.svelte +0 -38
  96. package/src/lib/components/ui/select/select-label.svelte +0 -20
  97. package/src/lib/components/ui/select/select-scroll-down-button.svelte +0 -20
  98. package/src/lib/components/ui/select/select-scroll-up-button.svelte +0 -20
  99. package/src/lib/components/ui/select/select-separator.svelte +0 -18
  100. package/src/lib/components/ui/select/select-trigger.svelte +0 -29
  101. package/src/lib/components/ui/separator/index.ts +0 -7
  102. package/src/lib/components/ui/separator/separator.svelte +0 -21
  103. package/src/lib/components/ui/sheet/index.ts +0 -36
  104. package/src/lib/components/ui/sheet/sheet-close.svelte +0 -7
  105. package/src/lib/components/ui/sheet/sheet-content.svelte +0 -60
  106. package/src/lib/components/ui/sheet/sheet-description.svelte +0 -17
  107. package/src/lib/components/ui/sheet/sheet-footer.svelte +0 -20
  108. package/src/lib/components/ui/sheet/sheet-header.svelte +0 -20
  109. package/src/lib/components/ui/sheet/sheet-overlay.svelte +0 -20
  110. package/src/lib/components/ui/sheet/sheet-title.svelte +0 -17
  111. package/src/lib/components/ui/sheet/sheet-trigger.svelte +0 -7
  112. package/src/lib/components/ui/sidebar/constants.ts +0 -6
  113. package/src/lib/components/ui/sidebar/context.svelte.ts +0 -79
  114. package/src/lib/components/ui/sidebar/index.ts +0 -75
  115. package/src/lib/components/ui/sidebar/sidebar-content.svelte +0 -24
  116. package/src/lib/components/ui/sidebar/sidebar-footer.svelte +0 -21
  117. package/src/lib/components/ui/sidebar/sidebar-group-action.svelte +0 -36
  118. package/src/lib/components/ui/sidebar/sidebar-group-content.svelte +0 -21
  119. package/src/lib/components/ui/sidebar/sidebar-group-label.svelte +0 -34
  120. package/src/lib/components/ui/sidebar/sidebar-group.svelte +0 -21
  121. package/src/lib/components/ui/sidebar/sidebar-header.svelte +0 -21
  122. package/src/lib/components/ui/sidebar/sidebar-input.svelte +0 -21
  123. package/src/lib/components/ui/sidebar/sidebar-inset.svelte +0 -24
  124. package/src/lib/components/ui/sidebar/sidebar-menu-action.svelte +0 -43
  125. package/src/lib/components/ui/sidebar/sidebar-menu-badge.svelte +0 -29
  126. package/src/lib/components/ui/sidebar/sidebar-menu-button.svelte +0 -101
  127. package/src/lib/components/ui/sidebar/sidebar-menu-item.svelte +0 -21
  128. package/src/lib/components/ui/sidebar/sidebar-menu-skeleton.svelte +0 -36
  129. package/src/lib/components/ui/sidebar/sidebar-menu-sub-button.svelte +0 -43
  130. package/src/lib/components/ui/sidebar/sidebar-menu-sub-item.svelte +0 -21
  131. package/src/lib/components/ui/sidebar/sidebar-menu-sub.svelte +0 -25
  132. package/src/lib/components/ui/sidebar/sidebar-menu.svelte +0 -21
  133. package/src/lib/components/ui/sidebar/sidebar-provider.svelte +0 -53
  134. package/src/lib/components/ui/sidebar/sidebar-rail.svelte +0 -36
  135. package/src/lib/components/ui/sidebar/sidebar-separator.svelte +0 -19
  136. package/src/lib/components/ui/sidebar/sidebar-trigger.svelte +0 -35
  137. package/src/lib/components/ui/sidebar/sidebar.svelte +0 -101
  138. package/src/lib/components/ui/skeleton/index.ts +0 -7
  139. package/src/lib/components/ui/skeleton/skeleton.svelte +0 -17
  140. package/src/lib/components/ui/tabs/index.ts +0 -16
  141. package/src/lib/components/ui/tabs/tabs-content.svelte +0 -17
  142. package/src/lib/components/ui/tabs/tabs-list.svelte +0 -16
  143. package/src/lib/components/ui/tabs/tabs-trigger.svelte +0 -20
  144. package/src/lib/components/ui/tabs/tabs.svelte +0 -19
  145. package/src/lib/components/ui/textarea/index.ts +0 -7
  146. package/src/lib/components/ui/textarea/textarea.svelte +0 -22
  147. package/src/lib/components/ui/tooltip/index.ts +0 -21
  148. package/src/lib/components/ui/tooltip/tooltip-content.svelte +0 -47
  149. package/src/lib/components/ui/tooltip/tooltip-trigger.svelte +0 -7
  150. package/src/lib/hooks/is-mobile.svelte.ts +0 -9
  151. package/src/lib/utils.ts +0 -13
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aphexcms/ui",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Shared UI components for Aphex CMS (shadcn-svelte)",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "files": [
24
24
  "dist",
25
- "src"
25
+ "src/app.css"
26
26
  ],
27
27
  "publishConfig": {
28
28
  "exports": {
@@ -1,171 +0,0 @@
1
- <script lang="ts" module>
2
- import AudioWaveformIcon from '@lucide/svelte/icons/audio-waveform';
3
- import BookOpenIcon from '@lucide/svelte/icons/book-open';
4
- import BotIcon from '@lucide/svelte/icons/bot';
5
- import ChartPieIcon from '@lucide/svelte/icons/chart-pie';
6
- import CommandIcon from '@lucide/svelte/icons/command';
7
- import FrameIcon from '@lucide/svelte/icons/frame';
8
- import GalleryVerticalEndIcon from '@lucide/svelte/icons/gallery-vertical-end';
9
- import MapIcon from '@lucide/svelte/icons/map';
10
- import Settings2Icon from '@lucide/svelte/icons/settings-2';
11
- import SquareTerminalIcon from '@lucide/svelte/icons/square-terminal';
12
-
13
- // This is sample data.
14
- const data = {
15
- user: {
16
- name: 'shadcn',
17
- email: 'm@example.com',
18
- avatar: '/avatars/shadcn.jpg'
19
- },
20
- teams: [
21
- {
22
- name: 'Acme Inc',
23
- logo: GalleryVerticalEndIcon,
24
- plan: 'Enterprise'
25
- },
26
- {
27
- name: 'Acme Corp.',
28
- logo: AudioWaveformIcon,
29
- plan: 'Startup'
30
- },
31
- {
32
- name: 'Evil Corp.',
33
- logo: CommandIcon,
34
- plan: 'Free'
35
- }
36
- ],
37
- navMain: [
38
- {
39
- title: 'Playground',
40
- url: '#',
41
- icon: SquareTerminalIcon,
42
- isActive: true,
43
- items: [
44
- {
45
- title: 'History',
46
- url: '#'
47
- },
48
- {
49
- title: 'Starred',
50
- url: '#'
51
- },
52
- {
53
- title: 'Settings',
54
- url: '#'
55
- }
56
- ]
57
- },
58
- {
59
- title: 'Models',
60
- url: '#',
61
- icon: BotIcon,
62
- items: [
63
- {
64
- title: 'Genesis',
65
- url: '#'
66
- },
67
- {
68
- title: 'Explorer',
69
- url: '#'
70
- },
71
- {
72
- title: 'Quantum',
73
- url: '#'
74
- }
75
- ]
76
- },
77
- {
78
- title: 'Documentation',
79
- url: '#',
80
- icon: BookOpenIcon,
81
- items: [
82
- {
83
- title: 'Introduction',
84
- url: '#'
85
- },
86
- {
87
- title: 'Get Started',
88
- url: '#'
89
- },
90
- {
91
- title: 'Tutorials',
92
- url: '#'
93
- },
94
- {
95
- title: 'Changelog',
96
- url: '#'
97
- }
98
- ]
99
- },
100
- {
101
- title: 'Settings',
102
- url: '#',
103
- icon: Settings2Icon,
104
- items: [
105
- {
106
- title: 'General',
107
- url: '#'
108
- },
109
- {
110
- title: 'Team',
111
- url: '#'
112
- },
113
- {
114
- title: 'Billing',
115
- url: '#'
116
- },
117
- {
118
- title: 'Limits',
119
- url: '#'
120
- }
121
- ]
122
- }
123
- ],
124
- projects: [
125
- {
126
- name: 'Design Engineering',
127
- url: '#',
128
- icon: FrameIcon
129
- },
130
- {
131
- name: 'Sales & Marketing',
132
- url: '#',
133
- icon: ChartPieIcon
134
- },
135
- {
136
- name: 'Travel',
137
- url: '#',
138
- icon: MapIcon
139
- }
140
- ]
141
- };
142
- </script>
143
-
144
- <script lang="ts">
145
- import NavMain from './nav-main.svelte';
146
- import NavProjects from './nav-projects.svelte';
147
- import NavUser from './nav-user.svelte';
148
- import TeamSwitcher from './team-switcher.svelte';
149
- import * as Sidebar from '@lib/components/ui/sidebar/index.js';
150
- import type { ComponentProps } from 'svelte';
151
-
152
- let {
153
- ref = $bindable(null),
154
- collapsible = 'icon',
155
- ...restProps
156
- }: ComponentProps<typeof Sidebar.Root> = $props();
157
- </script>
158
-
159
- <Sidebar.Root {collapsible} {...restProps}>
160
- <Sidebar.Header>
161
- <TeamSwitcher teams={data.teams} />
162
- </Sidebar.Header>
163
- <Sidebar.Content>
164
- <NavMain items={data.navMain} />
165
- <NavProjects projects={data.projects} />
166
- </Sidebar.Content>
167
- <Sidebar.Footer>
168
- <NavUser user={data.user} />
169
- </Sidebar.Footer>
170
- <Sidebar.Rail />
171
- </Sidebar.Root>
@@ -1,64 +0,0 @@
1
- <script lang="ts">
2
- import * as Collapsible from '@lib/components/ui/collapsible/index.js';
3
- import * as Sidebar from '@lib/components/ui/sidebar/index.js';
4
- import ChevronRightIcon from '@lucide/svelte/icons/chevron-right';
5
-
6
- let {
7
- items
8
- }: {
9
- items: {
10
- title: string;
11
- url: string;
12
- // this should be `Component` after @lucide/svelte updates types
13
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
- icon?: any;
15
- isActive?: boolean;
16
- items?: {
17
- title: string;
18
- url: string;
19
- }[];
20
- }[];
21
- } = $props();
22
- </script>
23
-
24
- <Sidebar.Group>
25
- <Sidebar.GroupLabel>Platform</Sidebar.GroupLabel>
26
- <Sidebar.Menu>
27
- {#each items as item (item.title)}
28
- <Collapsible.Root open={item.isActive} class="group/collapsible">
29
- {#snippet child({ props })}
30
- <Sidebar.MenuItem {...props}>
31
- <Collapsible.Trigger>
32
- {#snippet child({ props })}
33
- <Sidebar.MenuButton {...props} tooltipContent={item.title}>
34
- {#if item.icon}
35
- <item.icon />
36
- {/if}
37
- <span>{item.title}</span>
38
- <ChevronRightIcon
39
- class="ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"
40
- />
41
- </Sidebar.MenuButton>
42
- {/snippet}
43
- </Collapsible.Trigger>
44
- <Collapsible.Content>
45
- <Sidebar.MenuSub>
46
- {#each item.items ?? [] as subItem (subItem.title)}
47
- <Sidebar.MenuSubItem>
48
- <Sidebar.MenuSubButton>
49
- {#snippet child({ props })}
50
- <a href={subItem.url} {...props}>
51
- <span>{subItem.title}</span>
52
- </a>
53
- {/snippet}
54
- </Sidebar.MenuSubButton>
55
- </Sidebar.MenuSubItem>
56
- {/each}
57
- </Sidebar.MenuSub>
58
- </Collapsible.Content>
59
- </Sidebar.MenuItem>
60
- {/snippet}
61
- </Collapsible.Root>
62
- {/each}
63
- </Sidebar.Menu>
64
- </Sidebar.Group>
@@ -1,76 +0,0 @@
1
- <script lang="ts">
2
- import * as DropdownMenu from '@lib/components/ui/dropdown-menu/index.js';
3
- import { useSidebar } from '@lib/components/ui/sidebar/context.svelte.js';
4
- import * as Sidebar from '@lib/components/ui/sidebar/index.js';
5
- import EllipsisIcon from '@lucide/svelte/icons/ellipsis';
6
- import FolderIcon from '@lucide/svelte/icons/folder';
7
- import ForwardIcon from '@lucide/svelte/icons/forward';
8
- import Trash2Icon from '@lucide/svelte/icons/trash-2';
9
-
10
- let {
11
- projects
12
- }: {
13
- projects: {
14
- name: string;
15
- url: string;
16
- // This should be `Component` after @lucide/svelte updates types
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
- icon: any;
19
- }[];
20
- } = $props();
21
-
22
- const sidebar = useSidebar();
23
- </script>
24
-
25
- <Sidebar.Group class="group-data-[collapsible=icon]:hidden">
26
- <Sidebar.GroupLabel>Projects</Sidebar.GroupLabel>
27
- <Sidebar.Menu>
28
- {#each projects as item (item.name)}
29
- <Sidebar.MenuItem>
30
- <Sidebar.MenuButton>
31
- {#snippet child({ props })}
32
- <a href={item.url} {...props}>
33
- <item.icon />
34
- <span>{item.name}</span>
35
- </a>
36
- {/snippet}
37
- </Sidebar.MenuButton>
38
- <DropdownMenu.Root>
39
- <DropdownMenu.Trigger>
40
- {#snippet child({ props })}
41
- <Sidebar.MenuAction showOnHover {...props}>
42
- <EllipsisIcon />
43
- <span class="sr-only">More</span>
44
- </Sidebar.MenuAction>
45
- {/snippet}
46
- </DropdownMenu.Trigger>
47
- <DropdownMenu.Content
48
- class="w-48 rounded-lg"
49
- side={sidebar.isMobile ? 'bottom' : 'right'}
50
- align={sidebar.isMobile ? 'end' : 'start'}
51
- >
52
- <DropdownMenu.Item>
53
- <FolderIcon class="text-muted-foreground" />
54
- <span>View Project</span>
55
- </DropdownMenu.Item>
56
- <DropdownMenu.Item>
57
- <ForwardIcon class="text-muted-foreground" />
58
- <span>Share Project</span>
59
- </DropdownMenu.Item>
60
- <DropdownMenu.Separator />
61
- <DropdownMenu.Item>
62
- <Trash2Icon class="text-muted-foreground" />
63
- <span>Delete Project</span>
64
- </DropdownMenu.Item>
65
- </DropdownMenu.Content>
66
- </DropdownMenu.Root>
67
- </Sidebar.MenuItem>
68
- {/each}
69
- <Sidebar.MenuItem>
70
- <Sidebar.MenuButton class="text-sidebar-foreground/70">
71
- <EllipsisIcon class="text-sidebar-foreground/70" />
72
- <span>More</span>
73
- </Sidebar.MenuButton>
74
- </Sidebar.MenuItem>
75
- </Sidebar.Menu>
76
- </Sidebar.Group>
@@ -1,87 +0,0 @@
1
- <script lang="ts">
2
- import * as Avatar from '@lib/components/ui/avatar/index.js';
3
- import * as DropdownMenu from '@lib/components/ui/dropdown-menu/index.js';
4
- import * as Sidebar from '@lib/components/ui/sidebar/index.js';
5
- import { useSidebar } from '@lib/components/ui/sidebar/index.js';
6
- import BadgeCheckIcon from '@lucide/svelte/icons/badge-check';
7
- import BellIcon from '@lucide/svelte/icons/bell';
8
- import ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';
9
- import CreditCardIcon from '@lucide/svelte/icons/credit-card';
10
- import LogOutIcon from '@lucide/svelte/icons/log-out';
11
- import SparklesIcon from '@lucide/svelte/icons/sparkles';
12
-
13
- let { user }: { user: { name: string; email: string; avatar: string } } = $props();
14
- const sidebar = useSidebar();
15
- </script>
16
-
17
- <Sidebar.Menu>
18
- <Sidebar.MenuItem>
19
- <DropdownMenu.Root>
20
- <DropdownMenu.Trigger>
21
- {#snippet child({ props })}
22
- <Sidebar.MenuButton
23
- size="lg"
24
- class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
25
- {...props}
26
- >
27
- <Avatar.Root class="size-8 rounded-lg">
28
- <Avatar.Image src={user.avatar} alt={user.name} />
29
- <Avatar.Fallback class="rounded-lg">CN</Avatar.Fallback>
30
- </Avatar.Root>
31
- <div class="grid flex-1 text-left text-sm leading-tight">
32
- <span class="truncate font-medium">{user.name}</span>
33
- <span class="truncate text-xs">{user.email}</span>
34
- </div>
35
- <ChevronsUpDownIcon class="ml-auto size-4" />
36
- </Sidebar.MenuButton>
37
- {/snippet}
38
- </DropdownMenu.Trigger>
39
- <DropdownMenu.Content
40
- class="w-(--bits-dropdown-menu-anchor-width) min-w-56 rounded-lg"
41
- side={sidebar.isMobile ? 'bottom' : 'right'}
42
- align="end"
43
- sideOffset={4}
44
- >
45
- <DropdownMenu.Label class="p-0 font-normal">
46
- <div class="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
47
- <Avatar.Root class="size-8 rounded-lg">
48
- <Avatar.Image src={user.avatar} alt={user.name} />
49
- <Avatar.Fallback class="rounded-lg">CN</Avatar.Fallback>
50
- </Avatar.Root>
51
- <div class="grid flex-1 text-left text-sm leading-tight">
52
- <span class="truncate font-medium">{user.name}</span>
53
- <span class="truncate text-xs">{user.email}</span>
54
- </div>
55
- </div>
56
- </DropdownMenu.Label>
57
- <DropdownMenu.Separator />
58
- <DropdownMenu.Group>
59
- <DropdownMenu.Item>
60
- <SparklesIcon />
61
- Upgrade to Pro
62
- </DropdownMenu.Item>
63
- </DropdownMenu.Group>
64
- <DropdownMenu.Separator />
65
- <DropdownMenu.Group>
66
- <DropdownMenu.Item>
67
- <BadgeCheckIcon />
68
- Account
69
- </DropdownMenu.Item>
70
- <DropdownMenu.Item>
71
- <CreditCardIcon />
72
- Billing
73
- </DropdownMenu.Item>
74
- <DropdownMenu.Item>
75
- <BellIcon />
76
- Notifications
77
- </DropdownMenu.Item>
78
- </DropdownMenu.Group>
79
- <DropdownMenu.Separator />
80
- <DropdownMenu.Item>
81
- <LogOutIcon />
82
- Log out
83
- </DropdownMenu.Item>
84
- </DropdownMenu.Content>
85
- </DropdownMenu.Root>
86
- </Sidebar.MenuItem>
87
- </Sidebar.Menu>
@@ -1,39 +0,0 @@
1
- <script lang="ts">
2
- import AppSidebar from '@lib/components/app-sidebar.svelte';
3
- import * as Breadcrumb from '@lib/components/ui/breadcrumb/index.js';
4
- import { Separator } from '@lib/components/ui/separator/index.js';
5
- import * as Sidebar from '@lib/components/ui/sidebar/index.js';
6
- </script>
7
-
8
- <Sidebar.Provider>
9
- <AppSidebar />
10
- <Sidebar.Inset>
11
- <header
12
- class="group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear"
13
- >
14
- <div class="flex items-center gap-2 px-4">
15
- <Sidebar.Trigger class="-ml-1" />
16
- <Separator orientation="vertical" class="mr-2 data-[orientation=vertical]:h-4" />
17
- <Breadcrumb.Root>
18
- <Breadcrumb.List>
19
- <Breadcrumb.Item class="hidden md:block">
20
- <Breadcrumb.Link href="#">Building Your Application</Breadcrumb.Link>
21
- </Breadcrumb.Item>
22
- <Breadcrumb.Separator class="hidden md:block" />
23
- <Breadcrumb.Item>
24
- <Breadcrumb.Page>Data Fetching</Breadcrumb.Page>
25
- </Breadcrumb.Item>
26
- </Breadcrumb.List>
27
- </Breadcrumb.Root>
28
- </div>
29
- </header>
30
- <div class="flex flex-1 flex-col gap-4 p-4 pt-0">
31
- <div class="grid auto-rows-min gap-4 md:grid-cols-3">
32
- <div class="bg-muted/50 aspect-video rounded-xl"></div>
33
- <div class="bg-muted/50 aspect-video rounded-xl"></div>
34
- <div class="bg-muted/50 aspect-video rounded-xl"></div>
35
- </div>
36
- <div class="bg-muted/50 min-h-[100vh] flex-1 rounded-xl md:min-h-min"></div>
37
- </div>
38
- </Sidebar.Inset>
39
- </Sidebar.Provider>
@@ -1,67 +0,0 @@
1
- <script lang="ts">
2
- import * as DropdownMenu from '@lib/components/ui/dropdown-menu/index.js';
3
- import * as Sidebar from '@lib/components/ui/sidebar/index.js';
4
- import { useSidebar } from '@lib/components/ui/sidebar/index.js';
5
- import ChevronsUpDownIcon from '@lucide/svelte/icons/chevrons-up-down';
6
- import PlusIcon from '@lucide/svelte/icons/plus';
7
-
8
- // This should be `Component` after @lucide/svelte updates types
9
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10
- let { teams }: { teams: { name: string; logo: any; plan: string }[] } = $props();
11
- const sidebar = useSidebar();
12
-
13
- let activeTeam = $state(teams[0]);
14
- </script>
15
-
16
- <Sidebar.Menu>
17
- <Sidebar.MenuItem>
18
- <DropdownMenu.Root>
19
- <DropdownMenu.Trigger>
20
- {#snippet child({ props })}
21
- <Sidebar.MenuButton
22
- {...props}
23
- size="lg"
24
- class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
25
- >
26
- <div
27
- class="bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg"
28
- >
29
- <activeTeam.logo class="size-4" />
30
- </div>
31
- <div class="grid flex-1 text-left text-sm leading-tight">
32
- <span class="truncate font-medium">
33
- {activeTeam.name}
34
- </span>
35
- <span class="truncate text-xs">{activeTeam.plan}</span>
36
- </div>
37
- <ChevronsUpDownIcon class="ml-auto" />
38
- </Sidebar.MenuButton>
39
- {/snippet}
40
- </DropdownMenu.Trigger>
41
- <DropdownMenu.Content
42
- class="w-(--bits-dropdown-menu-anchor-width) min-w-56 rounded-lg"
43
- align="start"
44
- side={sidebar.isMobile ? 'bottom' : 'right'}
45
- sideOffset={4}
46
- >
47
- <DropdownMenu.Label class="text-muted-foreground text-xs">Teams</DropdownMenu.Label>
48
- {#each teams as team, index (team.name)}
49
- <DropdownMenu.Item onSelect={() => (activeTeam = team)} class="gap-2 p-2">
50
- <div class="flex size-6 items-center justify-center rounded-md border">
51
- <team.logo class="size-3.5 shrink-0" />
52
- </div>
53
- {team.name}
54
- <DropdownMenu.Shortcut>⌘{index + 1}</DropdownMenu.Shortcut>
55
- </DropdownMenu.Item>
56
- {/each}
57
- <DropdownMenu.Separator />
58
- <DropdownMenu.Item class="gap-2 p-2">
59
- <div class="flex size-6 items-center justify-center rounded-md border bg-transparent">
60
- <PlusIcon class="size-4" />
61
- </div>
62
- <div class="text-muted-foreground font-medium">Add team</div>
63
- </DropdownMenu.Item>
64
- </DropdownMenu.Content>
65
- </DropdownMenu.Root>
66
- </Sidebar.MenuItem>
67
- </Sidebar.Menu>
@@ -1,23 +0,0 @@
1
- <script lang="ts">
2
- import type { HTMLAttributes } from 'svelte/elements';
3
- import { cn, type WithElementRef } from '@lib/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="alert-description"
16
- class={cn(
17
- 'text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',
18
- className
19
- )}
20
- {...restProps}
21
- >
22
- {@render children?.()}
23
- </div>
@@ -1,20 +0,0 @@
1
- <script lang="ts">
2
- import type { HTMLAttributes } from 'svelte/elements';
3
- import { cn, type WithElementRef } from '@lib/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="alert-title"
16
- class={cn('col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight', className)}
17
- {...restProps}
18
- >
19
- {@render children?.()}
20
- </div>
@@ -1,44 +0,0 @@
1
- <script lang="ts" module>
2
- import { type VariantProps, tv } from 'tailwind-variants';
3
-
4
- export const alertVariants = tv({
5
- base: 'relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',
6
- variants: {
7
- variant: {
8
- default: 'bg-card text-card-foreground',
9
- destructive:
10
- 'text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current'
11
- }
12
- },
13
- defaultVariants: {
14
- variant: 'default'
15
- }
16
- });
17
-
18
- export type AlertVariant = VariantProps<typeof alertVariants>['variant'];
19
- </script>
20
-
21
- <script lang="ts">
22
- import type { HTMLAttributes } from 'svelte/elements';
23
- import { cn, type WithElementRef } from '@lib/utils.js';
24
-
25
- let {
26
- ref = $bindable(null),
27
- class: className,
28
- variant = 'default',
29
- children,
30
- ...restProps
31
- }: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
32
- variant?: AlertVariant;
33
- } = $props();
34
- </script>
35
-
36
- <div
37
- bind:this={ref}
38
- data-slot="alert"
39
- class={cn(alertVariants({ variant }), className)}
40
- {...restProps}
41
- role="alert"
42
- >
43
- {@render children?.()}
44
- </div>
@@ -1,14 +0,0 @@
1
- import Root from './alert.svelte';
2
- import Description from './alert-description.svelte';
3
- import Title from './alert-title.svelte';
4
- export { alertVariants, type AlertVariant } from './alert.svelte';
5
-
6
- export {
7
- Root,
8
- Description,
9
- Title,
10
- //
11
- Root as Alert,
12
- Description as AlertDescription,
13
- Title as AlertTitle
14
- };
@@ -1,18 +0,0 @@
1
- <script lang="ts">
2
- import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
- import { buttonVariants } from '@lib/components/ui/button/index.js';
4
- import { cn } from '@lib/utils.js';
5
-
6
- let {
7
- ref = $bindable(null),
8
- class: className,
9
- ...restProps
10
- }: AlertDialogPrimitive.ActionProps = $props();
11
- </script>
12
-
13
- <AlertDialogPrimitive.Action
14
- bind:ref
15
- data-slot="alert-dialog-action"
16
- class={cn(buttonVariants(), className)}
17
- {...restProps}
18
- />
@@ -1,18 +0,0 @@
1
- <script lang="ts">
2
- import { AlertDialog as AlertDialogPrimitive } from 'bits-ui';
3
- import { buttonVariants } from '@lib/components/ui/button/index.js';
4
- import { cn } from '@lib/utils.js';
5
-
6
- let {
7
- ref = $bindable(null),
8
- class: className,
9
- ...restProps
10
- }: AlertDialogPrimitive.CancelProps = $props();
11
- </script>
12
-
13
- <AlertDialogPrimitive.Cancel
14
- bind:ref
15
- data-slot="alert-dialog-cancel"
16
- class={cn(buttonVariants({ variant: 'outline' }), className)}
17
- {...restProps}
18
- />