@vendure/dashboard 3.5.0-minor-202510161257 → 3.5.0

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 (57) hide show
  1. package/dist/vite/types.d.ts +39 -0
  2. package/dist/vite/utils/plugin-discovery.js +15 -4
  3. package/dist/vite/vite-plugin-ui-config.d.ts +27 -0
  4. package/dist/vite/vite-plugin-vendure-dashboard.d.ts +18 -1
  5. package/dist/vite/vite-plugin-vendure-dashboard.js +19 -7
  6. package/lingui.config.js +1 -0
  7. package/package.json +172 -172
  8. package/src/app/routes/_authenticated/_collections/components/collection-contents-preview-table.tsx +88 -61
  9. package/src/app/routes/_authenticated/_collections/components/move-collections-dialog.tsx +46 -47
  10. package/src/app/routes/_authenticated/_orders/orders.tsx +2 -0
  11. package/src/app/routes/_authenticated/_product-variants/product-variants.tsx +14 -1
  12. package/src/app/routes/_authenticated/_product-variants/product-variants_.$id.tsx +12 -7
  13. package/src/app/routes/_authenticated/_products/products.tsx +13 -1
  14. package/src/app/routes/_authenticated/_shipping-methods/shipping-methods_.$id.tsx +8 -2
  15. package/src/app/routes/_authenticated/_tax-categories/tax-categories_.$id.tsx +1 -0
  16. package/src/i18n/locales/ar.po +214 -186
  17. package/src/i18n/locales/cs.po +214 -186
  18. package/src/i18n/locales/de.po +214 -186
  19. package/src/i18n/locales/en.po +214 -186
  20. package/src/i18n/locales/es.po +214 -186
  21. package/src/i18n/locales/fa.po +214 -186
  22. package/src/i18n/locales/fr.po +214 -186
  23. package/src/i18n/locales/he.po +214 -186
  24. package/src/i18n/locales/hr.po +214 -186
  25. package/src/i18n/locales/it.po +214 -186
  26. package/src/i18n/locales/ja.po +214 -186
  27. package/src/i18n/locales/nb.po +214 -186
  28. package/src/i18n/locales/ne.po +214 -186
  29. package/src/i18n/locales/pl.po +214 -186
  30. package/src/i18n/locales/pt_BR.po +214 -186
  31. package/src/i18n/locales/pt_PT.po +214 -186
  32. package/src/i18n/locales/ru.po +214 -186
  33. package/src/i18n/locales/sv.po +214 -186
  34. package/src/i18n/locales/tr.po +214 -186
  35. package/src/i18n/locales/uk.po +214 -186
  36. package/src/i18n/locales/zh_Hans.po +214 -186
  37. package/src/i18n/locales/zh_Hant.po +214 -186
  38. package/src/lib/components/data-input/{password-input.stories.tsx → password-form-input.stories.tsx} +9 -9
  39. package/src/lib/components/data-input/{password-input.tsx → password-form-input.tsx} +1 -1
  40. package/src/lib/components/data-table/data-table-pagination.tsx +4 -4
  41. package/src/lib/components/data-table/data-table.stories.tsx +1 -1
  42. package/src/lib/components/data-table/data-table.tsx +1 -1
  43. package/src/lib/components/data-table/use-generated-columns.tsx +5 -1
  44. package/src/lib/components/layout/app-layout.tsx +0 -2
  45. package/src/lib/components/shared/asset/asset-gallery.stories.tsx +1 -1
  46. package/src/lib/components/shared/asset/asset-picker-dialog.stories.tsx +1 -1
  47. package/src/lib/components/shared/detail-page-button.stories.tsx +1 -1
  48. package/src/lib/components/shared/facet-value-selector.stories.tsx +1 -1
  49. package/src/lib/components/shared/paginated-list-data-table.stories.tsx +1 -1
  50. package/src/lib/components/shared/permission-guard.stories.tsx +1 -1
  51. package/src/lib/components/shared/vendure-image.stories.tsx +1 -1
  52. package/src/lib/components/ui/password-input.tsx +3 -7
  53. package/src/lib/framework/alert/alert-item.tsx +2 -2
  54. package/src/lib/framework/extension-api/input-component-extensions.tsx +2 -2
  55. package/src/lib/hooks/use-alerts.ts +2 -2
  56. package/src/lib/index.ts +13 -8
  57. package/src/lib/components/layout/prerelease-popup.tsx +0 -34
@@ -1,12 +1,12 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { useForm } from 'react-hook-form';
3
3
  import { withDescription } from '../../../.storybook/with-description.js';
4
- import { PasswordInput } from './password-input.js';
4
+ import { PasswordFormInput } from './password-form-input.js';
5
5
 
6
6
  const meta = {
7
- title: 'Form Inputs/PasswordInput',
8
- component: PasswordInput,
9
- ...withDescription(import.meta.url, './password-input.js'),
7
+ title: 'Form Inputs/PasswordFormInput',
8
+ component: PasswordFormInput,
9
+ ...withDescription(import.meta.url, './password-form-input.js'),
10
10
  parameters: {
11
11
  layout: 'centered',
12
12
  },
@@ -21,7 +21,7 @@ const meta = {
21
21
  description: 'Whether the input is disabled',
22
22
  },
23
23
  },
24
- } satisfies Meta<typeof PasswordInput>;
24
+ } satisfies Meta<typeof PasswordFormInput>;
25
25
 
26
26
  export default meta;
27
27
  type Story = StoryObj<typeof meta>;
@@ -36,7 +36,7 @@ export const Playground: Story = {
36
36
  const field = register('password');
37
37
  return (
38
38
  <div className="w-[300px]">
39
- <PasswordInput {...field} {...args} />
39
+ <PasswordFormInput {...field} {...args} />
40
40
  </div>
41
41
  );
42
42
  },
@@ -49,15 +49,15 @@ export const ChangePassword: Story = {
49
49
  <div className="w-[300px] space-y-4">
50
50
  <div className="space-y-2">
51
51
  <label className="text-sm font-medium">Current Password</label>
52
- <PasswordInput {...register('currentPassword')} />
52
+ <PasswordFormInput {...register('currentPassword')} />
53
53
  </div>
54
54
  <div className="space-y-2">
55
55
  <label className="text-sm font-medium">New Password</label>
56
- <PasswordInput {...register('newPassword')} />
56
+ <PasswordFormInput {...register('newPassword')} />
57
57
  </div>
58
58
  <div className="space-y-2">
59
59
  <label className="text-sm font-medium">Confirm New Password</label>
60
- <PasswordInput {...register('confirmPassword')} />
60
+ <PasswordFormInput {...register('confirmPassword')} />
61
61
  </div>
62
62
  </div>
63
63
  );
@@ -9,7 +9,7 @@ import { Input } from '../ui/input.js';
9
9
  * @docsCategory form-components
10
10
  * @docsPage PasswordInput
11
11
  */
12
- export function PasswordInput(props: Readonly<DashboardFormComponentProps>) {
12
+ export function PasswordFormInput(props: Readonly<DashboardFormComponentProps>) {
13
13
  const readOnly = props.disabled || isReadonlyField(props.fieldDef);
14
14
  return (
15
15
  <Input
@@ -18,7 +18,7 @@ export function DataTablePagination<TData>({ table }: DataTablePaginationProps<T
18
18
  </div>
19
19
  <div className="flex items-center space-x-6 lg:space-x-8">
20
20
  <div className="flex items-center space-x-2">
21
- <p className="hidden md:block text-sm font-medium">
21
+ <p className="hidden @xl/table:block text-sm font-medium">
22
22
  <Trans>Rows per page</Trans>
23
23
  </p>
24
24
  <Select
@@ -40,7 +40,7 @@ export function DataTablePagination<TData>({ table }: DataTablePaginationProps<T
40
40
  </Select>
41
41
  </div>
42
42
  <div className=" flex items-center justify-center text-sm font-medium">
43
- <span className="hidden md:block w-[100px] ">
43
+ <span className="hidden @sm/table:block w-[100px] ">
44
44
  <Trans>
45
45
  Page {table.getState().pagination.pageIndex + 1} of {table.getPageCount() || 1}
46
46
  </Trans>
@@ -50,7 +50,7 @@ export function DataTablePagination<TData>({ table }: DataTablePaginationProps<T
50
50
  <Button
51
51
  variant="outline"
52
52
  type="button"
53
- className="hidden h-8 w-8 p-0 lg:flex"
53
+ className="hidden h-8 w-8 p-0 @lg:flex"
54
54
  onClick={() => table.setPageIndex(0)}
55
55
  disabled={!table.getCanPreviousPage()}
56
56
  >
@@ -71,7 +71,7 @@ export function DataTablePagination<TData>({ table }: DataTablePaginationProps<T
71
71
  </span>
72
72
  <ChevronLeft />
73
73
  </Button>
74
- <span className="md:hidden">{table.getState().pagination.pageIndex + 1}</span>
74
+ <span className="@md/table:hidden">{table.getState().pagination.pageIndex + 1}</span>
75
75
  <Button
76
76
  variant="outline"
77
77
  type="button"
@@ -30,7 +30,7 @@ const sampleData: Product[] = Array.from({ length: 100 }, (_, i) => ({
30
30
  }));
31
31
 
32
32
  const meta = {
33
- title: 'Components/DataTable',
33
+ title: 'Framework/DataTable',
34
34
  component: DataTable,
35
35
  ...withDescription(import.meta.url, './data-table.js'),
36
36
  parameters: {
@@ -236,7 +236,7 @@ export function DataTable<TData>({
236
236
  isLoading={isLoading}
237
237
  table={table}
238
238
  >
239
- <div className="space-y-2">
239
+ <div className="space-y-2 @container/table">
240
240
  <div className="flex items-center justify-between gap-2">
241
241
  <div className="flex items-center gap-2">
242
242
  {onSearchTermChange && (
@@ -252,7 +252,11 @@ function getRowActions(
252
252
  </DropdownMenuItem>
253
253
  ))}
254
254
  {bulkActions?.map((action, index) => (
255
- <action.component key={`bulk-action-${index}`} selection={[row]} table={table} />
255
+ <action.component
256
+ key={`bulk-action-${index}`}
257
+ selection={[row.original]}
258
+ table={table}
259
+ />
256
260
  ))}
257
261
  {deleteMutation && (
258
262
  <DeleteMutationRowAction deleteMutation={deleteMutation} row={row} />
@@ -1,7 +1,6 @@
1
1
  import { AppSidebar } from '@/vdb/components/layout/app-sidebar.js';
2
2
  import { DevModeIndicator } from '@/vdb/components/layout/dev-mode-indicator.js';
3
3
  import { GeneratedBreadcrumbs } from '@/vdb/components/layout/generated-breadcrumbs.js';
4
- import { PrereleasePopup } from '@/vdb/components/layout/prerelease-popup.js';
5
4
  import { Separator } from '@/vdb/components/ui/separator.js';
6
5
  import { SidebarInset, SidebarProvider, SidebarTrigger } from '@/vdb/components/ui/sidebar.js';
7
6
  import { useUserSettings } from '@/vdb/hooks/use-user-settings.js';
@@ -31,7 +30,6 @@ export function AppLayout() {
31
30
  <Outlet />
32
31
  </div>
33
32
  </SidebarInset>
34
- <PrereleasePopup />
35
33
  </SidebarProvider>
36
34
  );
37
35
  }
@@ -6,7 +6,7 @@ import { createDemoRoute } from '../../../../../.storybook/providers.js';
6
6
  import { withDescription } from '../../../../../.storybook/with-description.js';
7
7
 
8
8
  const meta = {
9
- title: 'Components/AssetGallery',
9
+ title: 'Framework/AssetGallery',
10
10
  component: AssetGallery,
11
11
  ...withDescription(import.meta.url, './asset-gallery.js'),
12
12
  parameters: {
@@ -7,7 +7,7 @@ import { withDescription } from '../../../../../.storybook/with-description.js';
7
7
  import { AssetPickerDialog } from './asset-picker-dialog.js';
8
8
 
9
9
  const meta = {
10
- title: 'Components/AssetPickerDialog',
10
+ title: 'Framework/AssetPickerDialog',
11
11
  component: AssetPickerDialog,
12
12
  ...withDescription(import.meta.url, './asset-picker-dialog.js'),
13
13
  parameters: {
@@ -5,7 +5,7 @@ import { withDescription } from '../../../../.storybook/with-description.js';
5
5
  import { DetailPageButton } from './detail-page-button.js';
6
6
 
7
7
  const meta = {
8
- title: 'Components/DetailPageButton',
8
+ title: 'Framework/DetailPageButton',
9
9
  component: DetailPageButton,
10
10
  ...withDescription(import.meta.url, './detail-page-button.js'),
11
11
  parameters: {
@@ -3,7 +3,7 @@ import { withDescription } from '../../../../.storybook/with-description.js';
3
3
  import { FacetValueSelector } from './facet-value-selector.js';
4
4
 
5
5
  const meta = {
6
- title: 'Components/FacetValueSelector',
6
+ title: 'Framework/FacetValueSelector',
7
7
  component: FacetValueSelector,
8
8
  ...withDescription(import.meta.url, './facet-value-selector.js'),
9
9
  parameters: {
@@ -39,7 +39,7 @@ const productsListDocument = graphql(`
39
39
  `);
40
40
 
41
41
  const meta = {
42
- title: 'Components/PaginatedListDataTable',
42
+ title: 'Framework/PaginatedListDataTable',
43
43
  component: PaginatedListDataTable,
44
44
  ...withDescription(import.meta.url, './paginated-list-data-table.js'),
45
45
  parameters: {
@@ -4,7 +4,7 @@ import { withDescription } from '../../../../.storybook/with-description.js';
4
4
  import { PermissionGuard } from './permission-guard.js';
5
5
 
6
6
  const meta = {
7
- title: 'Components/PermissionGuard',
7
+ title: 'Framework/PermissionGuard',
8
8
  component: PermissionGuard,
9
9
  ...withDescription(import.meta.url, './permission-guard.js'),
10
10
  parameters: {
@@ -18,7 +18,7 @@ const mockAssetWithFocalPoint: AssetLike = {
18
18
  };
19
19
 
20
20
  const meta = {
21
- title: 'Components/VendureImage',
21
+ title: 'Framework/VendureImage',
22
22
  component: VendureImage,
23
23
  ...withDescription(import.meta.url, './vendure-image.js'),
24
24
  parameters: {
@@ -1,18 +1,14 @@
1
- import { t } from '@lingui/react/macro';
1
+ import { useLingui } from '@lingui/react/macro';
2
2
  import { Eye, EyeOff } from 'lucide-react';
3
3
  import * as React from 'react';
4
4
 
5
- import {
6
- InputGroup,
7
- InputGroupAddon,
8
- InputGroupButton,
9
- InputGroupInput,
10
- } from './input-group.js';
5
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group.js';
11
6
 
12
7
  type PasswordInputProps = Readonly<Omit<React.ComponentProps<'input'>, 'type'>>;
13
8
 
14
9
  function PasswordInput({ ...props }: PasswordInputProps) {
15
10
  const [showPassword, setShowPassword] = React.useState(false);
11
+ const { t } = useLingui();
16
12
 
17
13
  return (
18
14
  <InputGroup>
@@ -1,10 +1,10 @@
1
1
  import { Button } from '@/vdb/components/ui/button.js';
2
- import { Alert } from '@/vdb/hooks/use-alerts.js';
2
+ import { AlertEntry } from '@/vdb/hooks/use-alerts.js';
3
3
  import { cn } from '@/vdb/lib/utils.js';
4
4
  import { ComponentProps } from 'react';
5
5
 
6
6
  interface AlertItemProps extends ComponentProps<'div'> {
7
- alert: Alert;
7
+ alert: AlertEntry;
8
8
  }
9
9
 
10
10
  export function AlertItem({ alert, className, ...props }: Readonly<AlertItemProps>) {
@@ -8,7 +8,7 @@ import {
8
8
  RichTextInput,
9
9
  SelectWithOptions,
10
10
  } from '@/vdb/components/data-input/index.js';
11
- import { PasswordInput } from '@/vdb/components/data-input/password-input.js';
11
+ import { PasswordFormInput } from '@/vdb/components/data-input/password-form-input.js';
12
12
  import { TextareaInput } from '@/vdb/components/data-input/textarea-input.js';
13
13
  import { DashboardFormComponent } from '@/vdb/framework/form-engine/form-engine-types.js';
14
14
  import { globalRegistry } from '../registry/global-registry.js';
@@ -32,7 +32,7 @@ inputComponents.set('json-editor-form-input', TextareaInput);
32
32
  inputComponents.set('textarea-form-input', TextareaInput);
33
33
  inputComponents.set('html-editor-form-input', RichTextInput);
34
34
  inputComponents.set('rich-text-form-input', RichTextInput);
35
- inputComponents.set('password-form-input', PasswordInput);
35
+ inputComponents.set('password-form-input', PasswordFormInput);
36
36
  inputComponents.set('product-selector-form-input', DefaultProductInput);
37
37
  inputComponents.set('relation-form-input', DefaultRelationInput);
38
38
  inputComponents.set('select-form-input', SelectWithOptions);
@@ -10,7 +10,7 @@ import { useMemo } from 'react';
10
10
  * @docsPage useAlerts
11
11
  * @since 3.5.0
12
12
  */
13
- export interface Alert {
13
+ export interface AlertEntry {
14
14
  definition: DashboardAlertDefinition;
15
15
  active: boolean;
16
16
  currentSeverity?: AlertSeverity;
@@ -28,7 +28,7 @@ export interface Alert {
28
28
  * @docsWeight 0
29
29
  * @since 3.5.0
30
30
  */
31
- export function useAlerts(): { alerts: Alert[]; activeCount: number; highestSeverity: AlertSeverity } {
31
+ export function useAlerts(): { alerts: AlertEntry[]; activeCount: number; highestSeverity: AlertSeverity } {
32
32
  const { alertDefs, rawResults, dismissedAlerts, setDismissedAlerts } = useAlertsContext();
33
33
 
34
34
  const alerts = useMemo(() => {
package/src/lib/index.ts CHANGED
@@ -16,7 +16,7 @@ export * from './components/data-input/default-relation-input.js';
16
16
  export * from './components/data-input/facet-value-input.js';
17
17
  export * from './components/data-input/money-input.js';
18
18
  export * from './components/data-input/number-input.js';
19
- export * from './components/data-input/password-input.js';
19
+ export * from './components/data-input/password-form-input.js';
20
20
  export * from './components/data-input/product-multi-selector-input.js';
21
21
  export * from './components/data-input/relation-input.js';
22
22
  export * from './components/data-input/relation-selector.js';
@@ -27,11 +27,13 @@ export * from './components/data-input/struct-form-input.js';
27
27
  export * from './components/data-input/text-input.js';
28
28
  export * from './components/data-input/textarea-input.js';
29
29
  export * from './components/data-table/add-filter-menu.js';
30
+ export * from './components/data-table/column-header-wrapper.js';
30
31
  export * from './components/data-table/data-table-bulk-action-item.js';
31
32
  export * from './components/data-table/data-table-bulk-actions.js';
32
33
  export * from './components/data-table/data-table-column-header.js';
33
34
  export * from './components/data-table/data-table-context.js';
34
35
  export * from './components/data-table/data-table-faceted-filter.js';
36
+ export * from './components/data-table/data-table-filter-badge-editable.js';
35
37
  export * from './components/data-table/data-table-filter-badge.js';
36
38
  export * from './components/data-table/data-table-filter-dialog.js';
37
39
  export * from './components/data-table/data-table-pagination.js';
@@ -70,7 +72,6 @@ export * from './components/layout/nav-item-wrapper.js';
70
72
  export * from './components/layout/nav-main.js';
71
73
  export * from './components/layout/nav-projects.js';
72
74
  export * from './components/layout/nav-user.js';
73
- export * from './components/layout/prerelease-popup.js';
74
75
  export * from './components/login/login-form.js';
75
76
  export * from './components/shared/alerts.js';
76
77
  export * from './components/shared/animated-number.js';
@@ -160,12 +161,14 @@ export * from './components/ui/dropdown-menu.js';
160
161
  export * from './components/ui/form.js';
161
162
  export * from './components/ui/grid-layout.js';
162
163
  export * from './components/ui/hover-card.js';
164
+ export * from './components/ui/input-group.js';
163
165
  export * from './components/ui/input-otp.js';
164
166
  export * from './components/ui/input.js';
165
167
  export * from './components/ui/label.js';
166
168
  export * from './components/ui/menubar.js';
167
169
  export * from './components/ui/navigation-menu.js';
168
170
  export * from './components/ui/pagination.js';
171
+ export * from './components/ui/password-input.js';
169
172
  export * from './components/ui/popover.js';
170
173
  export * from './components/ui/progress.js';
171
174
  export * from './components/ui/radio-group.js';
@@ -174,6 +177,7 @@ export * from './components/ui/scroll-area.js';
174
177
  export * from './components/ui/select.js';
175
178
  export * from './components/ui/separator.js';
176
179
  export * from './components/ui/sheet.js';
180
+ export * from './components/ui/sidebar-context.js';
177
181
  export * from './components/ui/sidebar.js';
178
182
  export * from './components/ui/skeleton.js';
179
183
  export * from './components/ui/slider.js';
@@ -188,6 +192,7 @@ export * from './components/ui/tooltip.js';
188
192
  export * from './framework/alert/alert-extensions.js';
189
193
  export * from './framework/alert/alert-item.js';
190
194
  export * from './framework/alert/alerts-indicator.js';
195
+ export * from './framework/alert/search-index-buffer-alert/search-index-buffer-alert.js';
191
196
  export * from './framework/component-registry/component-registry.js';
192
197
  export * from './framework/component-registry/display-component.js';
193
198
  export * from './framework/dashboard-widget/base-widget.js';
@@ -251,7 +256,6 @@ export * from './framework/layout-engine/page-provider.js';
251
256
  export * from './framework/nav-menu/nav-menu-extensions.js';
252
257
  export * from './framework/page/detail-page-route-loader.js';
253
258
  export * from './framework/page/detail-page.js';
254
- export * from './framework/page/list-page.stories.js';
255
259
  export * from './framework/page/list-page.js';
256
260
  export * from './framework/page/page-api.js';
257
261
  export * from './framework/page/page-types.js';
@@ -259,6 +263,12 @@ export * from './framework/page/use-detail-page.js';
259
263
  export * from './framework/page/use-extended-router.js';
260
264
  export * from './framework/registry/global-registry.js';
261
265
  export * from './framework/registry/registry-types.js';
266
+ export * from './graphql/api.js';
267
+ export * from './graphql/common-operations.js';
268
+ export * from './graphql/fragments.js';
269
+ export * from './graphql/graphql.js';
270
+ export * from './graphql/settings-store-operations.js';
271
+ export * from './hooks/use-alerts.js';
262
272
  export * from './hooks/use-auth.js';
263
273
  export * from './hooks/use-channel.js';
264
274
  export * from './hooks/use-custom-field-config.js';
@@ -281,8 +291,3 @@ export * from './hooks/use-user-settings.js';
281
291
  export * from './lib/load-i18n-messages.js';
282
292
  export * from './lib/trans.js';
283
293
  export * from './lib/utils.js';
284
- export * from './graphql/api.js';
285
- export * from './graphql/common-operations.js';
286
- export * from './graphql/fragments.js';
287
- export * from './graphql/graphql.js';
288
- export * from './graphql/settings-store-operations.js';
@@ -1,34 +0,0 @@
1
- import { useUserSettings } from '@/vdb/hooks/use-user-settings.js';
2
- import { useState } from 'react';
3
- import { toast } from 'sonner';
4
-
5
- export function PrereleasePopup() {
6
- const { settings, setHasSeenOnboarding } = useUserSettings();
7
- const [isOpen, setIsOpen] = useState(false);
8
- if (!settings.hasSeenOnboarding && !isOpen) {
9
- setIsOpen(true);
10
- toast('Welcome to the new Dashboard!', {
11
- description: (
12
- <div className="space-y-2">
13
- <p>
14
- This is a <span className="font-bold">beta</span> version of our new Vendure
15
- Dashboard!
16
- </p>
17
- <p>
18
- This release allows you to explore the new interface and functionality, but it's not
19
- yet ready for production use.
20
- </p>
21
- </div>
22
- ),
23
- duration: 1000 * 60,
24
- action: {
25
- label: 'Got it',
26
- onClick: () => {
27
- setHasSeenOnboarding(true);
28
- setIsOpen(false);
29
- },
30
- },
31
- });
32
- }
33
- return null;
34
- }