diff --git a/changelog.md b/changelog.md index ff5a4a7..c88c40a 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Changelog +## 2025-04-11 - 1.5.1 - fix(readme) +Update readme with comprehensive reference documentation: add a usage snippet for components like DeesButton, introduce a detailed overview table of all component categories, and enhance documentation sections for each component group. + +- Added a code example showing how to import and use DeesButton. +- Introduced a components overview table that categorizes Core UI, Forms, Layout, Data Display, Visualization, Dialogs & Overlays, Navigation, and Development components. +- Expanded detailed documentation with usage examples for each component type. +- Reorganized content to improve clarity and ease of navigation for developers. + ## 2025-04-11 - 1.5.0 - feat(badge) Add dees-badge component with demo file and update packageManager field in package.json diff --git a/readme.md b/readme.md index 53b8fac..a185c70 100644 --- a/readme.md +++ b/readme.md @@ -9,191 +9,215 @@ npm install @design.estate/dees-catalog ``` ## Usage - -### Overview - -The `@design.estate/dees-catalog` is a powerful library that offers a suite of dynamic components designed for building sophisticated web applications. This library leverages modern web standards such as Web Components, and programming languages like JavaScript and TypeScript to provide developers with modular and reusable components. These components enhance the development workflow by offering ready-to-use solutions for UI design and interactivity, enabling developers to create intricate and functional applications efficiently. - -Below, we will explore the diverse range of components available, demonstrating their integration and usage thoroughly within real-world scenarios. Each example will be crafted in TypeScript to ensure type safety and maintainable code. Let's navigate through the components by examining their setups, features, and potential applications in a comprehensive manner. - -### Getting Started with Components - -To use these components, you first need to import them into your project. Depending on your development environment, you might be using a module bundler that supports ES modules. In such cases, importing components is straightforward as demonstrated below: - -```typescript -import { - DeesButton, - DeesModal, - DeesTable, - DeesAppuiBase, - DeesForm, - DeesInputText, - DeesAppuiMainmenu, - DeesAppuiMainselector -} from '@design.estate/dees-catalog'; -``` - -### Button Component: `DeesButton` - -`DeesButton` is a versatile button component that can be configured for various UI needs such as form submissions, navigation actions, or interactive interfaces. It supports multiple styles including normal, highlighted, discreet, and status-based variations (e.g., pending, success, error). - -#### Example Usage +To use the components provided by `@design.estate/dees-catalog`, you need to import them into your project. Here's an example of how to import and use the `DeesButton` component: ```typescript import { DeesButton } from '@design.estate/dees-catalog'; -// Create a simple button -const submitButton = document.createElement('dees-button'); -submitButton.text = 'Submit'; -submitButton.type = 'highlighted'; +const button = document.createElement('dees-button'); +button.text = 'Click me'; +button.type = 'highlighted'; // Options: normal, highlighted, discreet +button.status = 'pending'; // Options: normal, pending, success, error -// Add functionality -submitButton.addEventListener('clicked', () => { - console.log('Submit button clicked!'); -}); -document.body.appendChild(submitButton); - -// Handling status change -async function handleFormSubmission() { - submitButton.status = 'pending'; - try { - await simulateNetworkRequest(); - submitButton.status = 'success'; - } catch { - submitButton.status = 'error'; - } -} - -function simulateNetworkRequest() { - return new Promise(resolve => setTimeout(resolve, 2000)); -} - -submitButton.addEventListener('clicked', handleFormSubmission); +document.body.appendChild(button); ``` -### Modal Component: `DeesModal` +## Components Overview -The `DeesModal` component is used to display content in an overlay. It is suitable for scenarios like alerts, dialog boxes, or interactive user forms. The modal can be highly customized with different header, content, and footer components. +Below is a comprehensive list of all available components: -#### Example Usage +| Category | Components | +|----------|------------| +| Core UI | `DeesButton`, `DeesBadge`, `DeesChips`, `DeesIcon`, `DeesLabel`, `DeesSpinner`, `DeesToast` | +| Forms | `DeesForm`, `DeesInputText`, `DeesInputCheckbox`, `DeesInputDropdown`, `DeesInputRadio`, `DeesInputFileupload`, `DeesInputIban`, `DeesInputPhone`, `DeesInputQuantitySelector`, `DeesInputMultitoggle`, `DeesFormSubmit` | +| Layout | `DeesAppuiBase`, `DeesAppuiMainmenu`, `DeesAppuiMainselector`, `DeesAppuiMaincontent`, `DeesAppuiAppbar`, `DeesMobileNavigation` | +| Data Display | `DeesTable`, `DeesDataviewCodebox`, `DeesDataviewStatusobject`, `DeesPdf` | +| Visualization | `DeesChartArea`, `DeesChartLog` | +| Dialogs & Overlays | `DeesModal`, `DeesContextmenu`, `DeesSpeechbubble`, `DeesWindowlayer` | +| Navigation | `DeesStepper`, `DeesProgressbar` | +| Development | `DeesEditor`, `DeesEditorMarkdown`, `DeesTerminal`, `DeesUpdater` | + +## Detailed Component Documentation + +### Core UI Components + +#### `DeesButton` +A versatile button component supporting multiple styles and states. ```typescript -import { DeesModal } from '@design.estate/dees-catalog'; -import { html } from '@design.estate/dees-element'; +const button = document.createElement('dees-button'); +button.text = 'Click me'; +button.type = 'highlighted'; // Options: normal, highlighted, discreet +button.status = 'pending'; // Options: normal, pending, success, error +``` -// Creating a modal -const modalContent = html`
Welcome to our platform
`; -const modal = DeesModal.createAndShow({ - heading: 'Welcome', - content: modalContent, +#### `DeesBadge` +Display status indicators or counts with customizable styles. + +```typescript +Are you sure?
`, menuOptions: [ - { name: 'Close', action: () => modal.destroy() }, - { name: 'Proceed', action: () => console.log('Proceeding') } + { name: 'Cancel', action: () => modal.destroy() }, + { name: 'Confirm', action: () => handleConfirm() } ] }); ``` -### Form Handling With `DeesForm` +### Development Components -The `DeesForm` and its related input elements simplify form creation and handling. The form component integrates validation, submission, and data collection functions. - -#### Creating a Form +#### `DeesEditor` +Code editor component based on Monaco Editor. ```typescript -import { - DeesForm, - DeesInputText, - DeesFormSubmit, - DeesInputDropdown -} from '@design.estate/dees-catalog'; - -const registrationForm = document.createElement('dees-form'); - -const nameInput = document.createElement('dees-input-text'); -nameInput.label = 'Name'; -nameInput.required = true; - -const roleSelect = document.createElement('dees-input-dropdown'); -roleSelect.label = 'Role'; -roleSelect.options = [ - { option: 'Admin', key: 'admin' }, - { option: 'Editor', key: 'editor' } -]; - -const submitButton = document.createElement('dees-form-submit'); -submitButton.text = 'Register'; - -registrationForm.appendChild(nameInput); -registrationForm.appendChild(roleSelect); -registrationForm.appendChild(submitButton); - -registrationForm.addEventListener('formData', event => { - console.log('Form Data:', event.detail.data); -}); - -document.body.appendChild(registrationForm); +