### Run Development and Production Tasks Source: https://github.com/ssagroup/ui-kit/blob/main/CONTRIBUTING.md Commands to serve or build specific dashboard examples within the monorepo. ```bash # Run in development mode pnpm --filter ./examples/fitness-dashboard serve # Build for production pnpm --filter ./examples/fitness-dashboard build ``` -------------------------------- ### Install pNPM and Project Dependencies Source: https://github.com/ssagroup/ui-kit/blob/main/CONTRIBUTING.md Commands to install the pNPM package manager globally and set up the project environment by cloning the repository and installing workspace dependencies. ```bash npm install -g pnpm git clone git@github.com:ssagroup/ui-kit.git pnpm install --frozen-lockfile ``` -------------------------------- ### Build UI Kit Packages Source: https://github.com/ssagroup/ui-kit/blob/main/CONTRIBUTING.md Instructions for building packages in dependency order to ensure changes are correctly propagated. Includes commands for individual builds, full builds, and watch mode. ```bash # Build packages in dependency order pnpm build:utils pnpm build:hooks pnpm build:core # Build all packages or specific ones pnpm build:all pnpm build:widgets # Watch mode for automatic rebuilds pnpm build:core:watch ``` -------------------------------- ### Execute Scripts with pNPM Source: https://github.com/ssagroup/ui-kit/blob/main/CONTRIBUTING.md Demonstrates how to run scripts defined in package.json files, either for the root project or specific sub-packages using the --filter flag. ```bash pnpm test pnpm --filter ./packages/core build ``` -------------------------------- ### Install @ssa-ui-kit/infra-dash Source: https://github.com/ssagroup/ui-kit/blob/main/packages/infra-dash/docs/index.mdx Instructions for installing the @ssa-ui-kit/infra-dash library using npm, yarn, or pnpm. Ensure @ssa-ui-kit/core is installed as a peer dependency. ```bash npm install @ssa-ui-kit/infra-dash # or yarn add @ssa-ui-kit/infra-dash # or pnpm add @ssa-ui-kit/infra-dash ``` -------------------------------- ### Build Monorepo Projects Source: https://github.com/ssagroup/ui-kit/blob/main/CONTRIBUTING.md Commands to compile all sub-projects within the monorepo workspace to ensure local development readiness. ```bash pnpm build:all ``` -------------------------------- ### Execute Release Scripts Source: https://github.com/ssagroup/ui-kit/blob/main/CONTRIBUTING.md Commands to trigger the release process with specific version increments, tags, and dry-run capabilities. ```bash # Perform a patch release pnpm release --increment patch # Perform a minor release pnpm release --increment minor # Dry run release to verify output pnpm release --increment patch --dry-run ``` -------------------------------- ### Install SSA UI Kit Dependencies Source: https://github.com/ssagroup/ui-kit/blob/main/README.md Commands to install the core library and optional hooks package using npm, yarn, or pnpm, along with required peer dependencies. ```bash # Core components npm install @ssa-ui-kit/core # or yarn add @ssa-ui-kit/core # or pnpm add @ssa-ui-kit/core # Hooks (optional, separate package) npm install @ssa-ui-kit/hooks # or yarn add @ssa-ui-kit/hooks # or pnpm add @ssa-ui-kit/hooks # Peer Dependencies npm install react@19.x react-dom@19.x @emotion/react @emotion/styled react-hook-form ``` -------------------------------- ### Manage Node.js Version with NVM Source: https://github.com/ssagroup/ui-kit/blob/main/CONTRIBUTING.md Uses the NVM tool to automatically switch to the Node.js version specified in the project's .nvmrc file. ```bash nvm use ``` -------------------------------- ### Pagination: Navigation and Row Selector Examples (React) Source: https://context7.com/ssagroup/ui-kit/llms.txt Demonstrates the Pagination component for navigating through pages. It includes examples of basic pagination, enabling page settings and rows-per-page selection, and handling disabled states. Requires a context provider for state management. ```tsx import { Pagination, PaginationContextProvider } from '@ssa-ui-kit/core'; // Basic pagination // Pagination with page setting and rows per page // First page selected // Disabled pagination ``` -------------------------------- ### Install SSA UI Kit Packages Source: https://context7.com/ssagroup/ui-kit/llms.txt Installs the core, hooks, and utility packages for the SSA UI Kit using npm or pnpm. These packages provide essential components and functionalities for your project. ```bash npm install @ssa-ui-kit/core @ssa-ui-kit/hooks @ssa-ui-kit/utils # or pnpm add @ssa-ui-kit/core @ssa-ui-kit/hooks @ssa-ui-kit/utils ``` -------------------------------- ### Implementing a Complete Form Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Form/Form.mdx A comprehensive example showing the usage of Form, FormGroup, and TextField components, including validation schemas and textarea configuration. ```javascript type Inputs = { name: string; lastname: string; address: string; }; const Sample = () => { const { register, handleSubmit, formState: { errors } } = useForm(); const onSubmit: SubmitHandler = (data) => console.log(data); return (
); } ``` -------------------------------- ### Implement Default Pagination with Context Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Pagination/Pagination.mdx Demonstrates the basic setup for the Pagination component. It requires the PaginationContextProvider to manage the current page state. ```tsx import { Pagination, PaginationContextProvider } from '@ssa-ui-kit/core'; const App = () => { return ( ); }; ``` -------------------------------- ### Manage pNPM Workspace Dependencies Source: https://github.com/ssagroup/ui-kit/blob/main/CONTRIBUTING.md Commands for adding or removing dependencies at the workspace root or within specific sub-projects using the --filter flag. ```bash # Adds a package to the pNPM workspace root pnpm add @emotion/react -w # Removes a package from the pNPM workspace root pnpm remove @emotion/react -w # Adds a dev dependency to the workspace root pnpm add webpack -w -D # Adds a dev package to a specific sub-project pnpm add @storybook/react --filter ./packages/core -D ``` -------------------------------- ### Implement Basic Popover with React Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Popover/stories/Popover.mdx Demonstrates the standard implementation of the Popover component using its compound sub-components. This setup includes a trigger, heading, description, and close action. ```tsx import { Popover, PopoverTrigger, PopoverContent, PopoverHeading, PopoverDescription, PopoverClose, } from '@ssa-ui-kit/core'; function BasicPopover() { return ( Open Popover Popover Title This is the popover content. You can include any React components here. Close ); } ``` -------------------------------- ### Implement UI Kit Components Source: https://github.com/ssagroup/ui-kit/blob/main/README.md Examples for rendering Buttons, Inputs with React Hook Form, and Tables using the @ssa-ui-kit/core library. ```tsx import { Button, Icon, Input, Table, TableHead, TableBody, TableRow, TableCell, TableCellHeader } from '@ssa-ui-kit/core'; import { useForm, FormProvider } from 'react-hook-form'; // Button Example ``` -------------------------------- ### Setup SSA UI Kit Theme Provider Source: https://context7.com/ssagroup/ui-kit/llms.txt Sets up the Emotion ThemeProvider with the main theme from SSA UI Kit. This is essential for applying consistent styling, colors, and breakpoints across your application's components. ```tsx import { ThemeProvider } from '@emotion/react'; import { mainTheme } from '@ssa-ui-kit/core'; function App() { return ( ); } ``` -------------------------------- ### Input Component with Start and End Elements Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Input/Input.mdx Demonstrates how to augment the Input component with leading ('startElement') and trailing ('endElement') elements, such as icons or custom buttons. This enhances usability and provides visual cues. ```tsx // Input with end icon } /> // Input with start icon } /> // Input with both icons } endElement={} /> // Input with custom action button console.log('Resend code')}> Resend } /> ``` -------------------------------- ### CollapsibleNavBar: Default Usage Example (React) Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/CollapsibleNavBar/stories/CollapsibleNavBar.mdx Demonstrates the basic implementation of the CollapsibleNavBar component with a list of navigation items and a custom logo. It utilizes react-router-dom for routing and logs navigation toggle events. ```tsx import { CollapsibleNavBar } from '@ssa-ui-kit/core'; import { MemoryRouter } from 'react-router-dom'; function BasicNavigation() { const navigationItems = [ { path: '', iconName: 'home', iconSize: 20, title: 'Dashboard' }, { path: 'users', iconName: 'user', iconSize: 20, title: 'Users' }, { path: 'settings', iconName: 'settings', iconSize: 20, title: 'Settings' }, { prefix: 'reports/', iconName: 'chart', iconSize: 22, title: 'Reports', items: [ { path: 'analytics', title: 'Analytics' }, { path: 'sales', title: 'Sales' }, { path: 'performance', title: 'Performance' }, ], }, { path: 'notifications', iconName: 'notification', iconSize: 24, title: 'Notifications', }, ]; const Logo = () => ( Company Logo ); return ( } onChange={(isOpen) => console.log('Navigation toggled:', isOpen)} /> ); } ``` -------------------------------- ### Display Color Themes for Progress Bars (React) Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Progress/Progress.mdx Demonstrates how to use different color themes for progress bars by mapping an array of color objects. Each object specifies a color name and a percentage. This example utilizes React and JSX. ```tsx function ColorThemeExamples() { const colors = [ { name: 'blue', percentage: 90 }, { name: 'green', percentage: 75 }, { name: 'yellow', percentage: 60 }, { name: 'pink', percentage: 45 }, { name: 'purple', percentage: 30 }, { name: 'turquoise', percentage: 85 }, { name: 'blueLight', percentage: 55 }, ]; return (
{colors.map((color) => (
{color.name} {color.percentage}%
))}
); } ``` -------------------------------- ### Implement SSA UI Kit Components in React Source: https://github.com/ssagroup/ui-kit/blob/main/README.md A complete example demonstrating the integration of Card, Input, Table, and Button components within a React application using React Hook Form and Emotion ThemeProvider. ```tsx import { ThemeProvider } from '@emotion/react'; import { FormProvider, useForm } from 'react-hook-form'; import { Card, CardHeader, CardContent, Button, Input, Typography, Table, TableHead, TableBody, TableRow, TableCell, TableCellHeader, mainTheme, Theme as T } from '@ssa-ui-kit/core'; declare module '@emotion/react' { export interface Theme extends T {} } function App() { const methods = useForm(); const users = [ { id: 1, name: 'John Doe', email: 'john@example.com' }, { id: 2, name: 'Jane Smith', email: 'jane@example.com' }, ]; return ( User Management Name Email Actions {users.map((user) => ( {user.name} {user.email}
); } ``` -------------------------------- ### Initialize Theme Provider Source: https://github.com/ssagroup/ui-kit/blob/main/README.md Wraps the application with Emotion's ThemeProvider and augments TypeScript types to support the UI kit's mainTheme. ```tsx import { ThemeProvider } from '@emotion/react'; import { mainTheme, Theme as T } from '@ssa-ui-kit/core'; declare module '@emotion/react' { export interface Theme extends T {} } function App() { return ( {/* Your app components */} ); } ``` -------------------------------- ### Customize Dropdown Placeholder Text Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Dropdown/Dropdown.mdx Sets custom placeholder text for the Dropdown component when no item is selected. This is achieved by passing a `placeholder` prop to the `Dropdown` component. The example demonstrates how to provide a default message to guide user selection. ```tsx {items.map((item) => ( {item.value} ))} ``` -------------------------------- ### Implement Basic Drawer with Hook API Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Drawer/Drawer.mdx Demonstrates the standard implementation of a Drawer using the useDrawer hook and component composition. It shows how to trigger the drawer state and structure the content within the Root, Portal, and Overlay components. ```tsx import { Drawer, useDrawer, Button } from '@ssa-ui-kit/core'; function BasicDrawer() { const drawer = useDrawer({ title: 'Settings', withCloseButton: true, }); return ( <>

Drawer Content

This is the drawer content area where you can place any components.

); } ``` -------------------------------- ### CollapsibleNavBar: Nested Navigation Example (React) Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/CollapsibleNavBar/stories/CollapsibleNavBar.mdx Shows how to implement hierarchical navigation structures with expandable submenus within the CollapsibleNavBar. This example includes multiple levels of nested items and customizes the submenu width. ```tsx function NestedNavigation() { const items = [ { path: '', iconName: 'home', iconSize: 20, title: 'Dashboard' }, { prefix: 'ecommerce/', iconName: 'shopping-cart', iconSize: 22, title: 'E-commerce', items: [ { path: 'products', title: 'Products' }, { path: 'orders', title: 'Orders' }, { path: 'customers', title: 'Customers' }, { path: 'inventory', title: 'Inventory' }, { path: 'analytics', title: 'Analytics' }, ], }, { prefix: 'content/', iconName: 'document', iconSize: 20, title: 'Content Management', items: [ { path: 'posts', title: 'Blog Posts' }, { path: 'pages', title: 'Static Pages' }, { path: 'media', title: 'Media Library' }, { path: 'categories', title: 'Categories' }, ], }, { prefix: 'admin/', iconName: 'settings', iconSize: 20, title: 'Administration', items: [ { path: 'users', title: 'User Management' }, { path: 'roles', title: 'Roles & Permissions' }, { path: 'system', title: 'System Settings' }, { path: 'logs', title: 'Activity Logs' }, ], }, ]; return ( 📱 CMS} subMenuMaxWidth={220} onChange={(isOpen) => console.log('Navigation state:', isOpen)} /> ); } ``` -------------------------------- ### Toggle Portal vs Container Rendering Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Drawer/Drawer.mdx Illustrates the difference between rendering a drawer as a global overlay via Portal or inline within a specific container. ```tsx // Portal rendering (overlay mode) Content overlays the page // Container rendering (inline mode)
Content pushes other content
``` -------------------------------- ### Display Content in Indicator Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Indicator/Indicator.mdx Examples of rendering text, numeric values, or custom JSX elements within the indicator badge. ```tsx // Simple text // Numeric content // JSX Element content +2100}> ``` -------------------------------- ### Basic Dashboard Display with DashboardViewer Source: https://github.com/ssagroup/ui-kit/blob/main/packages/infra-dash/docs/index.mdx A simple example of how to use the DashboardViewer component to display a specific dashboard by its ID. ```tsx import { DashboardViewer } from '@ssa-ui-kit/infra-dash'; function MyDashboard() { return ; } ``` -------------------------------- ### Integrate Radio in forms Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Radio/Radio.mdx Provides an example of using Radio buttons within a standard HTML form structure with fieldset and legend for accessibility. ```tsx
Select your preferred contact method:
``` -------------------------------- ### Modal Component Examples - React Source: https://context7.com/ssagroup/ui-kit/llms.txt Demonstrates the usage of the Modal component for displaying dialogs. It covers basic, custom content, and controlled modal patterns using React and @ssa-ui-kit/core. Dependencies include React hooks and various UI primitives from the kit. ```tsx import { Modal, ModalContent, ModalOpenButton, ModalDismissButton, Button, Typography, Icon, } from '@ssa-ui-kit/core'; import { useState } from 'react'; // Basic modal with trigger button ); } ``` -------------------------------- ### Default Dropdown Usage with Options Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Dropdown/Dropdown.mdx Demonstrates the basic implementation of the Dropdown component, including how to define options and handle selection changes. Requires '@ssa-ui-kit/core' for Dropdown and DropdownOption components. ```tsx import { Dropdown, DropdownOption } from '@ssa-ui-kit/core'; function BasicDropdown() { const items = [ { id: 1, value: 'Option One', subText: 'Description 1' }, { id: 2, value: 'Option Two', subText: 'Description 2' }, { id: 3, value: 'Option Three', subText: 'Description 3' }, ]; const handleChange = (selectedItem) => { console.log('Selected:', selectedItem); }; return ( {items.map((item) => ( {item.value} ))} ); } ``` -------------------------------- ### Drawer Component Examples - React Source: https://context7.com/ssagroup/ui-kit/llms.txt Illustrates the use of the Drawer component for slide-in panels. It showcases different positions (left, right, bottom) and configurations like headers and dismissable options using React and @ssa-ui-kit/core. Requires React hooks and UI primitives from the kit. ```tsx import { Drawer, Button, Wrapper } from '@ssa-ui-kit/core'; import { useDrawer } from '@ssa-ui-kit/core'; // Basic drawer from left (default) function LeftDrawer() { const drawer = useDrawer(); return ( <>

Drawer content here

); } // Right-side drawer with header function RightDrawerWithHeader() { const drawer = useDrawer({ position: 'right', dismissable: true }); return ( <> Settings

Settings content goes here

); } // Bottom drawer function BottomDrawer() { const drawer = useDrawer({ position: 'bottom' }); return ( <>

Bottom panel content

); } ``` -------------------------------- ### Implement Button Component Usage Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Button/Button.mdx Demonstrates basic implementation of the Button component with different variants and sizes. It shows how to handle click events and apply specific styling properties. ```tsx import { Button } from '@ssa-ui-kit/core'; function Demo() { return ( <> ); } ``` -------------------------------- ### Configure Responsive TreeMap Layouts Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Charts/TreeMapChart/TreeMapChart.mdx Shows how to control the aspect ratio and container styling for TreeMapChart. Includes examples for dashboard widget cards and embedded configurations without wrappers. ```jsx const fileSystemData = { name: 'Storage Usage', children: [ { name: 'Documents', children: [{ name: 'PDFs', value: 2.5 }, { name: 'Spreadsheets', value: 1.8 }, { name: 'Presentations', value: 3.2 }] }, { name: 'Media', children: [{ name: 'Photos', value: 15.6 }, { name: 'Videos', value: 45.3 }, { name: 'Audio', value: 8.9 }] }, { name: 'Applications', value: 12.4 }, { name: 'System Files', value: 8.7 }, ], }; // Square aspect ratio for dashboard widgets `${node.id}\n${node.formattedValue}GB`} labelSkipSize={12} innerPadding={2} /> // No widget card for embedded use ``` -------------------------------- ### Handle Drawer State Change Events Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Drawer/Drawer.mdx Demonstrates how to listen for drawer state transitions and identify the reason behind the change. ```tsx const drawer = useDrawer({ onOpenChange: (open, event, reason) => { console.log('Drawer state changed:', open); console.log('Reason:', reason); // 'click', 'escape-key', 'outside-press', etc. }, }); ``` -------------------------------- ### Implement Basic Tooltip with React Source: https://github.com/ssagroup/ui-kit/blob/main/packages/core/src/components/Tooltip/Tooltip.mdx Demonstrates the fundamental implementation of a Tooltip using the compound component pattern. It shows how to wrap a trigger element and content within the Tooltip provider. ```tsx import { Tooltip, TooltipTrigger, TooltipContent, Button, } from '@ssa-ui-kit/core'; function BasicTooltip() { return (