Browse Source

chore(dashboard): Fix index exports

Michael Bromley 3 months ago
parent
commit
f22224bc9b

+ 2 - 1
packages/dashboard/scripts/generate-index.js

@@ -22,7 +22,8 @@ function getAllFiles(dir, fileList = []) {
             file.match(/\.(ts|tsx|js|jsx)$/) &&
             !file.startsWith('index.') && // Exclude index files
             !file.endsWith('.d.ts') &&
-            !file.endsWith('.spec.ts')
+            !file.endsWith('.spec.ts') &&
+            !file.endsWith('.stories.tsx')
         ) {
             fileList.push(filePath);
         }

+ 9 - 9
packages/dashboard/src/lib/components/data-input/password-input.stories.tsx → packages/dashboard/src/lib/components/data-input/password-form-input.stories.tsx

@@ -1,12 +1,12 @@
 import type { Meta, StoryObj } from '@storybook/react-vite';
 import { useForm } from 'react-hook-form';
 import { withDescription } from '../../../.storybook/with-description.js';
-import { PasswordInput } from './password-input.js';
+import { PasswordFormInput } from './password-form-input.js';
 
 const meta = {
-    title: 'Form Inputs/PasswordInput',
-    component: PasswordInput,
-    ...withDescription(import.meta.url, './password-input.js'),
+    title: 'Form Inputs/PasswordFormInput',
+    component: PasswordFormInput,
+    ...withDescription(import.meta.url, './password-form-input.js'),
     parameters: {
         layout: 'centered',
     },
@@ -21,7 +21,7 @@ const meta = {
             description: 'Whether the input is disabled',
         },
     },
-} satisfies Meta<typeof PasswordInput>;
+} satisfies Meta<typeof PasswordFormInput>;
 
 export default meta;
 type Story = StoryObj<typeof meta>;
@@ -36,7 +36,7 @@ export const Playground: Story = {
         const field = register('password');
         return (
             <div className="w-[300px]">
-                <PasswordInput {...field} {...args} />
+                <PasswordFormInput {...field} {...args} />
             </div>
         );
     },
@@ -49,15 +49,15 @@ export const ChangePassword: Story = {
             <div className="w-[300px] space-y-4">
                 <div className="space-y-2">
                     <label className="text-sm font-medium">Current Password</label>
-                    <PasswordInput {...register('currentPassword')} />
+                    <PasswordFormInput {...register('currentPassword')} />
                 </div>
                 <div className="space-y-2">
                     <label className="text-sm font-medium">New Password</label>
-                    <PasswordInput {...register('newPassword')} />
+                    <PasswordFormInput {...register('newPassword')} />
                 </div>
                 <div className="space-y-2">
                     <label className="text-sm font-medium">Confirm New Password</label>
-                    <PasswordInput {...register('confirmPassword')} />
+                    <PasswordFormInput {...register('confirmPassword')} />
                 </div>
             </div>
         );

+ 1 - 1
packages/dashboard/src/lib/components/data-input/password-input.tsx → packages/dashboard/src/lib/components/data-input/password-form-input.tsx

@@ -9,7 +9,7 @@ import { Input } from '../ui/input.js';
  * @docsCategory form-components
  * @docsPage PasswordInput
  */
-export function PasswordInput(props: Readonly<DashboardFormComponentProps>) {
+export function PasswordFormInput(props: Readonly<DashboardFormComponentProps>) {
     const readOnly = props.disabled || isReadonlyField(props.fieldDef);
     return (
         <Input

+ 3 - 7
packages/dashboard/src/lib/components/ui/password-input.tsx

@@ -1,18 +1,14 @@
-import { t } from '@lingui/react/macro';
+import { useLingui } from '@lingui/react/macro';
 import { Eye, EyeOff } from 'lucide-react';
 import * as React from 'react';
 
-import {
-    InputGroup,
-    InputGroupAddon,
-    InputGroupButton,
-    InputGroupInput,
-} from './input-group.js';
+import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from './input-group.js';
 
 type PasswordInputProps = Readonly<Omit<React.ComponentProps<'input'>, 'type'>>;
 
 function PasswordInput({ ...props }: PasswordInputProps) {
     const [showPassword, setShowPassword] = React.useState(false);
+    const { t } = useLingui();
 
     return (
         <InputGroup>

+ 2 - 2
packages/dashboard/src/lib/framework/alert/alert-item.tsx

@@ -1,10 +1,10 @@
 import { Button } from '@/vdb/components/ui/button.js';
-import { Alert } from '@/vdb/hooks/use-alerts.js';
+import { AlertEntry } from '@/vdb/hooks/use-alerts.js';
 import { cn } from '@/vdb/lib/utils.js';
 import { ComponentProps } from 'react';
 
 interface AlertItemProps extends ComponentProps<'div'> {
-    alert: Alert;
+    alert: AlertEntry;
 }
 
 export function AlertItem({ alert, className, ...props }: Readonly<AlertItemProps>) {

+ 2 - 2
packages/dashboard/src/lib/framework/extension-api/input-component-extensions.tsx

@@ -8,7 +8,7 @@ import {
     RichTextInput,
     SelectWithOptions,
 } from '@/vdb/components/data-input/index.js';
-import { PasswordInput } from '@/vdb/components/data-input/password-input.js';
+import { PasswordFormInput } from '@/vdb/components/data-input/password-form-input.js';
 import { TextareaInput } from '@/vdb/components/data-input/textarea-input.js';
 import { DashboardFormComponent } from '@/vdb/framework/form-engine/form-engine-types.js';
 import { globalRegistry } from '../registry/global-registry.js';
@@ -32,7 +32,7 @@ inputComponents.set('json-editor-form-input', TextareaInput);
 inputComponents.set('textarea-form-input', TextareaInput);
 inputComponents.set('html-editor-form-input', RichTextInput);
 inputComponents.set('rich-text-form-input', RichTextInput);
-inputComponents.set('password-form-input', PasswordInput);
+inputComponents.set('password-form-input', PasswordFormInput);
 inputComponents.set('product-selector-form-input', DefaultProductInput);
 inputComponents.set('relation-form-input', DefaultRelationInput);
 inputComponents.set('select-form-input', SelectWithOptions);

+ 2 - 2
packages/dashboard/src/lib/hooks/use-alerts.ts

@@ -10,7 +10,7 @@ import { useMemo } from 'react';
  * @docsPage useAlerts
  * @since 3.5.0
  */
-export interface Alert {
+export interface AlertEntry {
     definition: DashboardAlertDefinition;
     active: boolean;
     currentSeverity?: AlertSeverity;
@@ -28,7 +28,7 @@ export interface Alert {
  * @docsWeight 0
  * @since 3.5.0
  */
-export function useAlerts(): { alerts: Alert[]; activeCount: number; highestSeverity: AlertSeverity } {
+export function useAlerts(): { alerts: AlertEntry[]; activeCount: number; highestSeverity: AlertSeverity } {
     const { alertDefs, rawResults, dismissedAlerts, setDismissedAlerts } = useAlertsContext();
 
     const alerts = useMemo(() => {

+ 13 - 7
packages/dashboard/src/lib/index.ts

@@ -16,7 +16,7 @@ export * from './components/data-input/default-relation-input.js';
 export * from './components/data-input/facet-value-input.js';
 export * from './components/data-input/money-input.js';
 export * from './components/data-input/number-input.js';
-export * from './components/data-input/password-input.js';
+export * from './components/data-input/password-form-input.js';
 export * from './components/data-input/product-multi-selector-input.js';
 export * from './components/data-input/relation-input.js';
 export * from './components/data-input/relation-selector.js';
@@ -27,11 +27,13 @@ export * from './components/data-input/struct-form-input.js';
 export * from './components/data-input/text-input.js';
 export * from './components/data-input/textarea-input.js';
 export * from './components/data-table/add-filter-menu.js';
+export * from './components/data-table/column-header-wrapper.js';
 export * from './components/data-table/data-table-bulk-action-item.js';
 export * from './components/data-table/data-table-bulk-actions.js';
 export * from './components/data-table/data-table-column-header.js';
 export * from './components/data-table/data-table-context.js';
 export * from './components/data-table/data-table-faceted-filter.js';
+export * from './components/data-table/data-table-filter-badge-editable.js';
 export * from './components/data-table/data-table-filter-badge.js';
 export * from './components/data-table/data-table-filter-dialog.js';
 export * from './components/data-table/data-table-pagination.js';
@@ -160,12 +162,14 @@ export * from './components/ui/dropdown-menu.js';
 export * from './components/ui/form.js';
 export * from './components/ui/grid-layout.js';
 export * from './components/ui/hover-card.js';
+export * from './components/ui/input-group.js';
 export * from './components/ui/input-otp.js';
 export * from './components/ui/input.js';
 export * from './components/ui/label.js';
 export * from './components/ui/menubar.js';
 export * from './components/ui/navigation-menu.js';
 export * from './components/ui/pagination.js';
+export * from './components/ui/password-input.js';
 export * from './components/ui/popover.js';
 export * from './components/ui/progress.js';
 export * from './components/ui/radio-group.js';
@@ -174,6 +178,7 @@ export * from './components/ui/scroll-area.js';
 export * from './components/ui/select.js';
 export * from './components/ui/separator.js';
 export * from './components/ui/sheet.js';
+export * from './components/ui/sidebar-context.js';
 export * from './components/ui/sidebar.js';
 export * from './components/ui/skeleton.js';
 export * from './components/ui/slider.js';
@@ -188,6 +193,7 @@ export * from './components/ui/tooltip.js';
 export * from './framework/alert/alert-extensions.js';
 export * from './framework/alert/alert-item.js';
 export * from './framework/alert/alerts-indicator.js';
+export * from './framework/alert/search-index-buffer-alert/search-index-buffer-alert.js';
 export * from './framework/component-registry/component-registry.js';
 export * from './framework/component-registry/display-component.js';
 export * from './framework/dashboard-widget/base-widget.js';
@@ -251,7 +257,6 @@ export * from './framework/layout-engine/page-provider.js';
 export * from './framework/nav-menu/nav-menu-extensions.js';
 export * from './framework/page/detail-page-route-loader.js';
 export * from './framework/page/detail-page.js';
-export * from './framework/page/list-page.stories.js';
 export * from './framework/page/list-page.js';
 export * from './framework/page/page-api.js';
 export * from './framework/page/page-types.js';
@@ -259,6 +264,12 @@ export * from './framework/page/use-detail-page.js';
 export * from './framework/page/use-extended-router.js';
 export * from './framework/registry/global-registry.js';
 export * from './framework/registry/registry-types.js';
+export * from './graphql/api.js';
+export * from './graphql/common-operations.js';
+export * from './graphql/fragments.js';
+export * from './graphql/graphql.js';
+export * from './graphql/settings-store-operations.js';
+export * from './hooks/use-alerts.js';
 export * from './hooks/use-auth.js';
 export * from './hooks/use-channel.js';
 export * from './hooks/use-custom-field-config.js';
@@ -281,8 +292,3 @@ export * from './hooks/use-user-settings.js';
 export * from './lib/load-i18n-messages.js';
 export * from './lib/trans.js';
 export * from './lib/utils.js';
-export * from './graphql/api.js';
-export * from './graphql/common-operations.js';
-export * from './graphql/fragments.js';
-export * from './graphql/graphql.js';
-export * from './graphql/settings-store-operations.js';