@jmruthers/pace-core 0.5.75 → 0.5.76
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/dist/{DataTable-HWZQGASI.js → DataTable-4GAVPIEG.js} +48 -30
- package/dist/{PublicLoadingSpinner-BKNBT6b6.d.ts → PublicLoadingSpinner-BiNER8F5.d.ts} +28 -17
- package/dist/{chunk-33PHABLB.js → chunk-AFGTSUAD.js} +10 -127
- package/dist/chunk-AFGTSUAD.js.map +1 -0
- package/dist/{chunk-2DFZ432F.js → chunk-K34IM5CT.js} +3 -5
- package/dist/{chunk-2DFZ432F.js.map → chunk-K34IM5CT.js.map} +1 -1
- package/dist/{chunk-2CHATWBF.js → chunk-KHJS6VIA.js} +199 -35
- package/dist/chunk-KHJS6VIA.js.map +1 -0
- package/dist/{chunk-ZTT2AXMX.js → chunk-KK73ZB4E.js} +2 -2
- package/dist/{chunk-CY3AHGO4.js → chunk-M5IWZRBT.js} +1750 -2815
- package/dist/chunk-M5IWZRBT.js.map +1 -0
- package/dist/{chunk-DAXLNIDY.js → chunk-Y6TXWPJO.js} +6 -4
- package/dist/{chunk-DAXLNIDY.js.map → chunk-Y6TXWPJO.js.map} +1 -1
- package/dist/{chunk-YNUBMSMV.js → chunk-YCKPEMJA.js} +186 -263
- package/dist/chunk-YCKPEMJA.js.map +1 -0
- package/dist/components.d.ts +1 -1
- package/dist/components.js +7 -6
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +17 -40
- package/dist/hooks.js +6 -6
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/rbac/index.d.ts +54 -1
- package/dist/rbac/index.js +5 -4
- package/dist/utils.js +1 -1
- package/docs/TERMINOLOGY.md +231 -0
- package/docs/api/classes/ColumnFactory.md +1 -1
- package/docs/api/classes/ErrorBoundary.md +1 -1
- package/docs/api/classes/InvalidScopeError.md +1 -1
- package/docs/api/classes/MissingUserContextError.md +1 -1
- package/docs/api/classes/OrganisationContextRequiredError.md +1 -1
- package/docs/api/classes/PermissionDeniedError.md +1 -1
- package/docs/api/classes/PublicErrorBoundary.md +1 -1
- package/docs/api/classes/RBACAuditManager.md +1 -1
- package/docs/api/classes/RBACCache.md +1 -1
- package/docs/api/classes/RBACEngine.md +1 -1
- package/docs/api/classes/RBACError.md +1 -1
- package/docs/api/classes/RBACNotInitializedError.md +1 -1
- package/docs/api/classes/SecureSupabaseClient.md +1 -1
- package/docs/api/classes/StorageUtils.md +1 -1
- package/docs/api/enums/FileCategory.md +1 -1
- package/docs/api/interfaces/AggregateConfig.md +1 -1
- package/docs/api/interfaces/ButtonProps.md +1 -1
- package/docs/api/interfaces/CardProps.md +1 -1
- package/docs/api/interfaces/ColorPalette.md +1 -1
- package/docs/api/interfaces/ColorShade.md +1 -1
- package/docs/api/interfaces/DataAccessRecord.md +1 -1
- package/docs/api/interfaces/DataTableAction.md +1 -1
- package/docs/api/interfaces/DataTableColumn.md +1 -1
- package/docs/api/interfaces/DataTableProps.md +1 -1
- package/docs/api/interfaces/DataTableToolbarButton.md +1 -1
- package/docs/api/interfaces/EmptyStateConfig.md +1 -1
- package/docs/api/interfaces/EnhancedNavigationMenuProps.md +1 -1
- package/docs/api/interfaces/EventLogoProps.md +1 -1
- package/docs/api/interfaces/FileDisplayProps.md +1 -1
- package/docs/api/interfaces/FileMetadata.md +1 -1
- package/docs/api/interfaces/FileReference.md +1 -1
- package/docs/api/interfaces/FileSizeLimits.md +1 -1
- package/docs/api/interfaces/FileUploadOptions.md +1 -1
- package/docs/api/interfaces/FileUploadProps.md +1 -1
- package/docs/api/interfaces/FooterProps.md +1 -1
- package/docs/api/interfaces/InactivityWarningModalProps.md +1 -1
- package/docs/api/interfaces/InputProps.md +1 -1
- package/docs/api/interfaces/LabelProps.md +1 -1
- package/docs/api/interfaces/LoginFormProps.md +1 -1
- package/docs/api/interfaces/NavigationAccessRecord.md +1 -1
- package/docs/api/interfaces/NavigationContextType.md +1 -1
- package/docs/api/interfaces/NavigationGuardProps.md +1 -1
- package/docs/api/interfaces/NavigationItem.md +1 -1
- package/docs/api/interfaces/NavigationMenuProps.md +1 -1
- package/docs/api/interfaces/NavigationProviderProps.md +1 -1
- package/docs/api/interfaces/Organisation.md +1 -1
- package/docs/api/interfaces/OrganisationContextType.md +1 -1
- package/docs/api/interfaces/OrganisationMembership.md +1 -1
- package/docs/api/interfaces/OrganisationProviderProps.md +1 -1
- package/docs/api/interfaces/OrganisationSecurityError.md +1 -1
- package/docs/api/interfaces/PaceAppLayoutProps.md +1 -1
- package/docs/api/interfaces/PaceLoginPageProps.md +1 -1
- package/docs/api/interfaces/PageAccessRecord.md +1 -1
- package/docs/api/interfaces/PagePermissionContextType.md +1 -1
- package/docs/api/interfaces/PagePermissionGuardProps.md +1 -1
- package/docs/api/interfaces/PagePermissionProviderProps.md +1 -1
- package/docs/api/interfaces/PaletteData.md +1 -1
- package/docs/api/interfaces/PermissionEnforcerProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryProps.md +1 -1
- package/docs/api/interfaces/PublicErrorBoundaryState.md +1 -1
- package/docs/api/interfaces/PublicLoadingSpinnerProps.md +1 -1
- package/docs/api/interfaces/PublicPageFooterProps.md +1 -1
- package/docs/api/interfaces/PublicPageHeaderProps.md +1 -1
- package/docs/api/interfaces/PublicPageLayoutProps.md +1 -1
- package/docs/api/interfaces/RBACConfig.md +1 -1
- package/docs/api/interfaces/RBACContextType.md +1 -1
- package/docs/api/interfaces/RBACLogger.md +1 -1
- package/docs/api/interfaces/RBACProviderProps.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterContextType.md +1 -1
- package/docs/api/interfaces/RoleBasedRouterProps.md +1 -1
- package/docs/api/interfaces/RouteAccessRecord.md +1 -1
- package/docs/api/interfaces/RouteConfig.md +1 -1
- package/docs/api/interfaces/SecureDataContextType.md +1 -1
- package/docs/api/interfaces/SecureDataProviderProps.md +1 -1
- package/docs/api/interfaces/StorageConfig.md +1 -1
- package/docs/api/interfaces/StorageFileInfo.md +1 -1
- package/docs/api/interfaces/StorageFileMetadata.md +1 -1
- package/docs/api/interfaces/StorageListOptions.md +1 -1
- package/docs/api/interfaces/StorageListResult.md +1 -1
- package/docs/api/interfaces/StorageUploadOptions.md +1 -1
- package/docs/api/interfaces/StorageUploadResult.md +1 -1
- package/docs/api/interfaces/StorageUrlOptions.md +1 -1
- package/docs/api/interfaces/StyleImport.md +1 -1
- package/docs/api/interfaces/SwitchProps.md +1 -1
- package/docs/api/interfaces/ToastActionElement.md +1 -1
- package/docs/api/interfaces/ToastProps.md +1 -1
- package/docs/api/interfaces/UnifiedAuthContextType.md +1 -1
- package/docs/api/interfaces/UnifiedAuthProviderProps.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerOptions.md +1 -1
- package/docs/api/interfaces/UseInactivityTrackerReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventLogoReturn.md +1 -1
- package/docs/api/interfaces/UsePublicEventOptions.md +1 -1
- package/docs/api/interfaces/UsePublicEventReturn.md +1 -1
- package/docs/api/interfaces/UsePublicRouteParamsReturn.md +1 -1
- package/docs/api/interfaces/UseResolvedScopeOptions.md +47 -0
- package/docs/api/interfaces/UseResolvedScopeReturn.md +47 -0
- package/docs/api/interfaces/UserEventAccess.md +1 -1
- package/docs/api/interfaces/UserMenuProps.md +1 -1
- package/docs/api/interfaces/UserProfile.md +1 -1
- package/docs/api/modules.md +57 -11
- package/docs/api-reference/providers.md +26 -7
- package/docs/best-practices/README.md +20 -0
- package/docs/best-practices/accessibility.md +566 -0
- package/docs/best-practices/performance-expansion.md +473 -0
- package/docs/core-concepts/authentication.md +15 -7
- package/docs/documentation-index.md +1 -1
- package/docs/documentation-templates.md +539 -0
- package/docs/getting-started/quick-start.md +16 -66
- package/docs/implementation-guides/component-styling.md +410 -0
- package/docs/implementation-guides/data-tables.md +1 -1
- package/docs/style-guide.md +39 -0
- package/package.json +1 -1
- package/src/__tests__/TEST_GUIDE_CURSOR.md +290 -0
- package/src/__tests__/helpers/supabaseMock.ts +48 -2
- package/src/components/DataTable/__tests__/DataTable.default-state.test.tsx +17 -6
- package/src/components/DataTable/__tests__/DataTableCore.test.tsx +73 -9
- package/src/components/DataTable/components/DataTableCore.tsx +280 -475
- package/src/components/DataTable/components/UnifiedTableBody.tsx +120 -153
- package/src/components/DataTable/components/index.ts +1 -2
- package/src/components/DataTable/context/__tests__/DataTableContext.test.tsx +208 -275
- package/src/components/DataTable/core/index.ts +1 -8
- package/src/components/DataTable/hooks/__tests__/useColumnOrderPersistence.test.ts +525 -0
- package/src/components/DataTable/hooks/__tests__/useColumnReordering.test.ts +570 -0
- package/src/components/DataTable/hooks/__tests__/useHierarchicalState.test.ts +214 -0
- package/src/components/DataTable/hooks/__tests__/useTableColumns.test.ts +224 -0
- package/src/components/DataTable/hooks/index.ts +6 -0
- package/src/components/DataTable/hooks/useColumnReordering.ts +1 -0
- package/src/components/DataTable/hooks/useDataTablePermissions.ts +149 -0
- package/src/components/DataTable/hooks/useDataTableState.ts +12 -6
- package/src/components/DataTable/hooks/useHierarchicalState.ts +26 -8
- package/src/components/DataTable/hooks/useTableColumns.ts +153 -0
- package/src/components/DataTable/index.ts +1 -9
- package/src/components/DataTable/utils/__tests__/COVERAGE_NOTE.md +89 -0
- package/src/components/DataTable/utils/__tests__/exportUtils.test.ts +3 -6
- package/src/components/DataTable/utils/__tests__/flexibleImport.test.ts +462 -0
- package/src/components/DataTable/utils/__tests__/hierarchicalSorting.test.ts +247 -0
- package/src/components/DataTable/utils/__tests__/hierarchicalUtils.test.ts +8 -6
- package/src/components/DataTable/utils/__tests__/performanceUtils.test.ts +466 -0
- package/src/components/DataTable/utils/__tests__/rowUtils.test.ts +265 -0
- package/src/components/DataTable/utils/errorHandling.ts +52 -460
- package/src/components/DataTable/utils/exportUtils.ts +46 -15
- package/src/components/DataTable/utils/hierarchicalSorting.ts +50 -3
- package/src/components/DataTable/utils/hierarchicalUtils.ts +167 -34
- package/src/components/DataTable/utils/index.ts +5 -0
- package/src/components/DataTable/utils/rowUtils.ts +68 -0
- package/src/components/EventSelector/EventSelector.test.tsx +672 -0
- package/src/components/Label/__tests__/Label.test.tsx +434 -0
- package/src/components/PublicLayout/__tests__/PublicPageContextChecker.test.tsx +190 -0
- package/src/components/PublicLayout/__tests__/PublicPageDebugger.test.tsx +185 -0
- package/src/components/PublicLayout/__tests__/PublicPageProvider.test.tsx +313 -0
- package/src/components/Select/Select.test.tsx +143 -120
- package/src/components/Select/Select.tsx +47 -212
- package/src/components/Select/hooks.ts +36 -1
- package/src/components/Select/index.ts +2 -1
- package/src/hooks/services/__tests__/useServiceHooks.test.tsx +137 -0
- package/src/hooks/useSecureDataAccess.test.ts +32 -29
- package/src/providers/__tests__/ProviderLifecycle.test.tsx +341 -0
- package/src/rbac/hooks/__tests__/usePermissions.integration.test.ts +437 -0
- package/src/rbac/hooks/index.ts +2 -0
- package/src/rbac/hooks/useResolvedScope.ts +232 -0
- package/src/services/__tests__/InactivityService.lifecycle.test.ts +411 -0
- package/src/services/__tests__/OrganisationService.pagination.test.ts +375 -0
- package/src/types/__tests__/README.md +114 -0
- package/src/types/__tests__/validation.test.ts +731 -0
- package/src/utils/__tests__/file-reference.test.ts +383 -0
- package/src/utils/__tests__/performanceBenchmark.test.ts +175 -0
- package/src/utils/appNameResolver.test.ts +54 -0
- package/src/validation/__tests__/csrf.unit.test.ts +63 -0
- package/src/validation/__tests__/passwordSchema.unit.test.ts +105 -0
- package/dist/chunk-2CHATWBF.js.map +0 -1
- package/dist/chunk-33PHABLB.js.map +0 -1
- package/dist/chunk-CY3AHGO4.js.map +0 -1
- package/dist/chunk-TYHR5X4W.js +0 -33
- package/dist/chunk-TYHR5X4W.js.map +0 -1
- package/dist/chunk-YNUBMSMV.js.map +0 -1
- package/dist/eventContext-BBA42P6G.js +0 -14
- package/dist/eventContext-BBA42P6G.js.map +0 -1
- package/docs/documentation-style-checklist.md +0 -294
- package/src/components/DataTable/components/DataTableBody.tsx +0 -488
- package/src/components/DataTable/components/DraggableColumnHeader.tsx +0 -144
- package/src/components/DataTable/components/VirtualizedDataTable.tsx +0 -515
- package/src/components/DataTable/core/ActionManager.ts +0 -235
- package/src/components/DataTable/core/ColumnManager.ts +0 -215
- package/src/components/DataTable/core/DataManager.ts +0 -188
- package/src/components/DataTable/core/DataTableContext.tsx +0 -181
- package/src/components/DataTable/core/LocalDataAdapter.ts +0 -264
- package/src/components/DataTable/core/PluginRegistry.ts +0 -229
- package/src/components/DataTable/core/StateManager.ts +0 -311
- package/src/components/DataTable/core/__tests__/ActionManager.test.ts +0 -634
- package/src/components/DataTable/core/__tests__/ColumnManager.test.ts +0 -193
- package/src/components/DataTable/core/__tests__/DataManager.test.ts +0 -519
- package/src/components/DataTable/core/__tests__/StateManager.test.ts +0 -714
- package/src/components/DataTable/core/interfaces.ts +0 -338
- package/src/components/DataTable/utils/debugTools.ts +0 -583
- package/src/components/Select/Select.bug-test.tsx +0 -69
- package/src/components/Select/Select.refactored.tsx +0 -497
- /package/dist/{DataTable-HWZQGASI.js.map → DataTable-4GAVPIEG.js.map} +0 -0
- /package/dist/{chunk-ZTT2AXMX.js.map → chunk-KK73ZB4E.js.map} +0 -0
|
@@ -0,0 +1,410 @@
|
|
|
1
|
+
# Component Styling Guide
|
|
2
|
+
|
|
3
|
+
> **📚 Implementation Guide**: Component Customization | [← Back](../README.md) | [Styling Overview](../styles/README.md)
|
|
4
|
+
|
|
5
|
+
Complete guide to customizing and styling PACE Core components.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Last Updated**: 2025-02-08 | **Version**: v0.5.65+
|
|
10
|
+
|
|
11
|
+
## Overview
|
|
12
|
+
|
|
13
|
+
PACE Core components are fully customizable while maintaining design system consistency. This guide shows you how to:
|
|
14
|
+
|
|
15
|
+
- Customize component appearance
|
|
16
|
+
- Create custom themes
|
|
17
|
+
- Override component styles
|
|
18
|
+
- Maintain design system consistency
|
|
19
|
+
- Build custom components using design tokens
|
|
20
|
+
|
|
21
|
+
## Customizing Component Styles
|
|
22
|
+
|
|
23
|
+
### 1. Using className Prop
|
|
24
|
+
|
|
25
|
+
All PACE Core components accept a `className` prop for styling:
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
import { Button, Card, Input } from '@jmruthers/pace-core';
|
|
29
|
+
|
|
30
|
+
function CustomButton() {
|
|
31
|
+
return (
|
|
32
|
+
<Button
|
|
33
|
+
className="bg-main-600 text-main-50 hover:bg-main-700 px-6"
|
|
34
|
+
>
|
|
35
|
+
Custom Styled Button
|
|
36
|
+
</Button>
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function CustomCard() {
|
|
41
|
+
return (
|
|
42
|
+
<Card className="border-2 border-main-300 shadow-lg">
|
|
43
|
+
<p>Custom styled card</p>
|
|
44
|
+
</Card>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 2. Overriding Default Styles
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
// Override specific styles while keeping defaults
|
|
53
|
+
<Button
|
|
54
|
+
variant="primary"
|
|
55
|
+
className="!bg-acc-500 hover:!bg-acc-600"
|
|
56
|
+
>
|
|
57
|
+
Accent Colored Button
|
|
58
|
+
</Button>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 3. Responsive Styling
|
|
62
|
+
|
|
63
|
+
```tsx
|
|
64
|
+
<Card className="p-4 md:p-6 lg:p-8">
|
|
65
|
+
<h2 className="text-lg md:text-xl lg:text-2xl">Responsive Title</h2>
|
|
66
|
+
</Card>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
## Creating Custom Themes
|
|
72
|
+
|
|
73
|
+
### 1. Define Theme Variables
|
|
74
|
+
|
|
75
|
+
Create a custom theme file:
|
|
76
|
+
|
|
77
|
+
```css
|
|
78
|
+
/* src/themes/my-theme.css */
|
|
79
|
+
@theme {
|
|
80
|
+
/* Override design tokens */
|
|
81
|
+
--radius-sm: 4px;
|
|
82
|
+
--radius-md: 8px;
|
|
83
|
+
--radius-lg: 12px;
|
|
84
|
+
|
|
85
|
+
--spacing-unit: 4px;
|
|
86
|
+
|
|
87
|
+
/* Custom colors if needed */
|
|
88
|
+
--color-brand: oklch(0.58 0.23 300);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### 2. Apply Theme
|
|
93
|
+
|
|
94
|
+
```tsx
|
|
95
|
+
import './themes/my-theme.css';
|
|
96
|
+
import '@jmruthers/pace-core/src/styles/core.css';
|
|
97
|
+
|
|
98
|
+
function App() {
|
|
99
|
+
return <YourApp />;
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Design Token Usage
|
|
106
|
+
|
|
107
|
+
### Spacing
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
<div className="p-4 md:p-6 lg:p-8">
|
|
111
|
+
{/* Padding: 16px, 24px, 32px on md, lg */}
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div className="mt-2 mb-4 mx-auto">
|
|
115
|
+
{/* Using spacing tokens */}
|
|
116
|
+
</div>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Typography
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
// Use semantic typography
|
|
123
|
+
<h1 className="text-3xl font-bold">Heading</h1>
|
|
124
|
+
<p className="text-base font-sans">Body text</p>
|
|
125
|
+
<code className="text-sm font-mono">Code snippet</code>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Colors
|
|
129
|
+
|
|
130
|
+
```tsx
|
|
131
|
+
// Use semantic color tokens
|
|
132
|
+
<div className="bg-background text-foreground">
|
|
133
|
+
<h2 className="text-primary">Primary Text</h2>
|
|
134
|
+
<p className="text-muted-foreground">Muted Text</p>
|
|
135
|
+
<button className="bg-accent hover:bg-accent/80">
|
|
136
|
+
Accent Button
|
|
137
|
+
</button>
|
|
138
|
+
</div>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Radius
|
|
142
|
+
|
|
143
|
+
```tsx
|
|
144
|
+
<Button className="rounded-lg">Rounded Button</Button>
|
|
145
|
+
<Card className="rounded-xl">Extra Rounded Card</Card>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
## Custom Component Patterns
|
|
151
|
+
|
|
152
|
+
### 1. Reusable Styled Components
|
|
153
|
+
|
|
154
|
+
```tsx
|
|
155
|
+
// Create your own styled components
|
|
156
|
+
import { Button } from '@jmruthers/pace-core';
|
|
157
|
+
|
|
158
|
+
interface PrimaryButtonProps {
|
|
159
|
+
children: React.ReactNode;
|
|
160
|
+
onClick?: () => void;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function PrimaryButton({ children, onClick }: PrimaryButtonProps) {
|
|
164
|
+
return (
|
|
165
|
+
<Button
|
|
166
|
+
className="bg-main-600 hover:bg-main-700 text-main-50 px-6 py-2 rounded-lg font-semibold"
|
|
167
|
+
onClick={onClick}
|
|
168
|
+
>
|
|
169
|
+
{children}
|
|
170
|
+
</Button>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Usage
|
|
175
|
+
<PrimaryButton onClick={() => console.log('Clicked')}>
|
|
176
|
+
Submit Form
|
|
177
|
+
</PrimaryButton>
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### 2. Custom DataTable Styling
|
|
181
|
+
|
|
182
|
+
```tsx
|
|
183
|
+
import { DataTable } from '@jmruthers/pace-core';
|
|
184
|
+
|
|
185
|
+
function StyledDataTable({ data, columns }) {
|
|
186
|
+
return (
|
|
187
|
+
<DataTable
|
|
188
|
+
data={data}
|
|
189
|
+
columns={columns}
|
|
190
|
+
className="rounded-lg shadow-md border border-main-200"
|
|
191
|
+
features={{
|
|
192
|
+
search: true,
|
|
193
|
+
pagination: true,
|
|
194
|
+
}}
|
|
195
|
+
/>
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Style Override Patterns
|
|
203
|
+
|
|
204
|
+
### Pattern 1: Component-Level Overrides
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
// Override specific component without affecting others
|
|
208
|
+
<Button className="!text-acc-600 !border-acc-600">
|
|
209
|
+
Custom Button
|
|
210
|
+
</Button>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Pattern 2: Global Overrides (Not Recommended)
|
|
214
|
+
|
|
215
|
+
```css
|
|
216
|
+
/* ❌ Avoid global overrides when possible */
|
|
217
|
+
@layer components {
|
|
218
|
+
.pace-btn {
|
|
219
|
+
/* This affects ALL buttons globally */
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Pattern 3: Scoped Overrides
|
|
225
|
+
|
|
226
|
+
```tsx
|
|
227
|
+
function CustomSection() {
|
|
228
|
+
return (
|
|
229
|
+
<div className="custom-section">
|
|
230
|
+
<style jsx>{`
|
|
231
|
+
.custom-section :global(.pace-btn) {
|
|
232
|
+
/* Only affects buttons inside this section */
|
|
233
|
+
}
|
|
234
|
+
`}</style>
|
|
235
|
+
<Button>Scoped Button</Button>
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Advanced Customization
|
|
244
|
+
|
|
245
|
+
### 1. Custom Design Tokens
|
|
246
|
+
|
|
247
|
+
```css
|
|
248
|
+
/* src/app.css */
|
|
249
|
+
@theme {
|
|
250
|
+
/* Custom spacing scale */
|
|
251
|
+
--spacing-05: calc(var(--spacing-unit) * 0.5);
|
|
252
|
+
--spacing-1: var(--spacing-unit);
|
|
253
|
+
--spacing-2: calc(var(--spacing-unit) * 2);
|
|
254
|
+
--spacing-3: calc(var(--spacing-unit) * 3);
|
|
255
|
+
|
|
256
|
+
/* Custom colors */
|
|
257
|
+
--color-success: oklch(0.6 0.2 150);
|
|
258
|
+
--color-warning: oklch(0.7 0.2 50);
|
|
259
|
+
--color-error: oklch(0.6 0.3 0);
|
|
260
|
+
}
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### 2. Custom Animations
|
|
264
|
+
|
|
265
|
+
```css
|
|
266
|
+
/* src/app.css */
|
|
267
|
+
@keyframes slideIn {
|
|
268
|
+
from {
|
|
269
|
+
transform: translateX(-100%);
|
|
270
|
+
opacity: 0;
|
|
271
|
+
}
|
|
272
|
+
to {
|
|
273
|
+
transform: translateX(0);
|
|
274
|
+
opacity: 1;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.animate-slide-in {
|
|
279
|
+
animation: slideIn 0.3s ease-out;
|
|
280
|
+
}
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### 3. Component Composition
|
|
284
|
+
|
|
285
|
+
```tsx
|
|
286
|
+
import { Card, CardHeader, CardTitle, CardContent } from '@jmruthers/pace-core';
|
|
287
|
+
|
|
288
|
+
function CustomDashboardCard({ title, children }) {
|
|
289
|
+
return (
|
|
290
|
+
<Card className="bg-gradient-to-br from-main-50 to-sec-50 border-main-300">
|
|
291
|
+
<CardHeader className="border-b border-main-200 pb-4">
|
|
292
|
+
<CardTitle className="text-main-900 text-xl">{title}</CardTitle>
|
|
293
|
+
</CardHeader>
|
|
294
|
+
<CardContent className="p-6">
|
|
295
|
+
{children}
|
|
296
|
+
</CardContent>
|
|
297
|
+
</Card>
|
|
298
|
+
);
|
|
299
|
+
}
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
---
|
|
303
|
+
|
|
304
|
+
## Best Practices
|
|
305
|
+
|
|
306
|
+
### ✅ Do
|
|
307
|
+
|
|
308
|
+
1. **Use semantic tokens** for consistency
|
|
309
|
+
```tsx
|
|
310
|
+
<div className="bg-primary text-primary-foreground">
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
2. **Extend components with className**
|
|
314
|
+
```tsx
|
|
315
|
+
<Button className="custom-extra-styles">
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
3. **Create reusable styled components**
|
|
319
|
+
```tsx
|
|
320
|
+
function PrimaryButton() { /* ... */ }
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
4. **Use responsive utilities**
|
|
324
|
+
```tsx
|
|
325
|
+
<div className="p-4 md:p-6 lg:p-8">
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### ❌ Don't
|
|
329
|
+
|
|
330
|
+
1. **Don't use arbitrary values unnecessarily**
|
|
331
|
+
```tsx
|
|
332
|
+
// ❌ Bad
|
|
333
|
+
<div className="bg-[oklch(0.5 0.2 200)]">
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
2. **Don't override design tokens globally**
|
|
337
|
+
```css
|
|
338
|
+
/* ❌ Bad - affects entire app */
|
|
339
|
+
--color-primary: red;
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
3. **Don't use inline styles**
|
|
343
|
+
```tsx
|
|
344
|
+
// ❌ Bad
|
|
345
|
+
<div style={{ color: 'red' }}>
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
---
|
|
349
|
+
|
|
350
|
+
## Common Customizations
|
|
351
|
+
|
|
352
|
+
### Custom Button Variants
|
|
353
|
+
|
|
354
|
+
```tsx
|
|
355
|
+
function GradientButton({ children, onClick }) {
|
|
356
|
+
return (
|
|
357
|
+
<Button
|
|
358
|
+
className="bg-gradient-to-r from-main-600 to-sec-600 hover:from-main-700 hover:to-sec-700 text-main-50"
|
|
359
|
+
onClick={onClick}
|
|
360
|
+
>
|
|
361
|
+
{children}
|
|
362
|
+
</Button>
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
### Custom Input Styling
|
|
368
|
+
|
|
369
|
+
```tsx
|
|
370
|
+
function StyledInput({ label, ...props }) {
|
|
371
|
+
return (
|
|
372
|
+
<div className="space-y-2">
|
|
373
|
+
<Label className="text-main-900 font-semibold">{label}</Label>
|
|
374
|
+
<Input
|
|
375
|
+
className="border-main-300 focus:border-main-500 focus:ring-main-500"
|
|
376
|
+
{...props}
|
|
377
|
+
/>
|
|
378
|
+
</div>
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Custom Card Styles
|
|
384
|
+
|
|
385
|
+
```tsx
|
|
386
|
+
function DashboardCard({ title, children }) {
|
|
387
|
+
return (
|
|
388
|
+
<Card className="hover:shadow-lg transition-shadow">
|
|
389
|
+
<CardHeader className="bg-main-600 text-main-50 rounded-t-lg">
|
|
390
|
+
<CardTitle>{title}</CardTitle>
|
|
391
|
+
</CardHeader>
|
|
392
|
+
<CardContent className="p-6">
|
|
393
|
+
{children}
|
|
394
|
+
</CardContent>
|
|
395
|
+
</Card>
|
|
396
|
+
);
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## Related Documentation
|
|
403
|
+
|
|
404
|
+
- [Styling Overview](../styles/README.md) - Complete styling system
|
|
405
|
+
- [Performance Guide](../best-practices/performance.md) - Performance optimization
|
|
406
|
+
- [Component API Reference](../api-reference/components.md) - Component props
|
|
407
|
+
|
|
408
|
+
---
|
|
409
|
+
|
|
410
|
+
**Next Steps**: Start customizing components to match your brand while maintaining design system consistency.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Data Tables
|
|
2
2
|
|
|
3
|
-
> **📚 Implementation
|
|
3
|
+
> **📚 Implementation Guide**: Data Management | [← Back](../README.md) | [Forms](./forms.md) | [RBAC Usage](./datatable-rbac-usage.md)
|
|
4
4
|
|
|
5
5
|
This guide covers implementing data tables with PACE Core's DataTable component, including basic usage, advanced features, and best practices.
|
|
6
6
|
|
package/docs/style-guide.md
CHANGED
|
@@ -819,6 +819,45 @@ Every guide should include:
|
|
|
819
819
|
4. **Troubleshooting** - Common issues and solutions
|
|
820
820
|
5. **Next Steps** - Links to related documentation
|
|
821
821
|
|
|
822
|
+
## 📋 Pre-Publishing Checklist
|
|
823
|
+
|
|
824
|
+
Before publishing any documentation, verify:
|
|
825
|
+
|
|
826
|
+
### Content Quality
|
|
827
|
+
- [ ] **Completeness**: All necessary information included
|
|
828
|
+
- [ ] **Accuracy**: Information is current and correct
|
|
829
|
+
- [ ] **Clarity**: Language is clear and accessible
|
|
830
|
+
- [ ] **Consistency**: Follows style guide and conventions
|
|
831
|
+
|
|
832
|
+
### Code Examples
|
|
833
|
+
- [ ] **Complete Examples** - All code examples are runnable and complete
|
|
834
|
+
- [ ] **Error Handling** - Examples include proper error handling
|
|
835
|
+
- [ ] **TypeScript** - All examples use TypeScript with proper types
|
|
836
|
+
- [ ] **Imports** - All necessary imports are shown
|
|
837
|
+
- [ ] **Comments** - Complex logic is explained with comments
|
|
838
|
+
- [ ] **Best Practices** - Examples follow PACE Core best practices
|
|
839
|
+
|
|
840
|
+
### Navigation & Cross-References
|
|
841
|
+
- [ ] **Navigation**: Proper breadcrumbs and cross-references
|
|
842
|
+
- [ ] **Version Metadata**: Up-to-date version information
|
|
843
|
+
- [ ] **Links**: All internal and external links verified
|
|
844
|
+
- [ ] **Headings**: Proper heading hierarchy (H1 → H2 → H3)
|
|
845
|
+
|
|
846
|
+
### Formatting & Structure
|
|
847
|
+
- [ ] **Headings**: Use proper heading hierarchy
|
|
848
|
+
- [ ] **Lists**: Use consistent list formatting
|
|
849
|
+
- [ ] **Code Blocks**: Use proper language tags
|
|
850
|
+
- [ ] **Tables**: Use proper table formatting
|
|
851
|
+
- [ ] **Accessibility**: Proper formatting for screen readers
|
|
852
|
+
|
|
853
|
+
### Review Process
|
|
854
|
+
- [ ] **Self-Review**: Read aloud for clarity, test all examples
|
|
855
|
+
- [ ] **Link Check**: Verify all links work
|
|
856
|
+
- [ ] **Spell Check**: Use spell check tools
|
|
857
|
+
- [ ] **Grammar Check**: Use grammar check tools
|
|
858
|
+
|
|
859
|
+
---
|
|
860
|
+
|
|
822
861
|
## 🔄 Maintenance Procedures
|
|
823
862
|
|
|
824
863
|
### When to Update Documentation
|