@rarui/components 1.30.1 → 1.30.3
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/CHANGELOG.md +20 -1
- package/custom-elements.json +1 -1
- package/dist/index.d.ts +43 -5
- package/dist/index.js +17 -16
- package/package.json +2 -2
- package/src/exhibition/Avatar/README.md +0 -15
- package/src/exhibition/Badge/README.md +0 -15
- package/src/exhibition/Divider/README.md +0 -15
- package/src/exhibition/Icon/README.md +0 -15
- package/src/exhibition/Label/README.md +0 -15
- package/src/exhibition/Stepper/README.md +0 -15
- package/src/exhibition/Text/README.md +0 -15
- package/src/exhibition/Title/README.md +0 -15
- package/src/exhibition/Tooltip/README.md +0 -15
- package/src/feedback/Progress/README.md +0 -15
- package/src/feedback/Skeleton/README.md +0 -15
- package/src/feedback/Status/README.md +0 -15
- package/src/input/Button/README.md +0 -15
- package/src/input/Checkbox/README.md +0 -15
- package/src/input/Chip/README.md +0 -15
- package/src/input/Dropdown/README.md +0 -15
- package/src/input/IconButton/README.md +0 -15
- package/src/input/Input/README.md +0 -44
- package/src/input/RadioButton/README.md +0 -15
- package/src/input/Select/README.md +0 -13
- package/src/input/Textarea/README.md +0 -15
- package/src/input/Toggle/README.md +0 -15
- package/src/layout/Box/README.md +0 -15
- package/src/layout/Sidebar/README.md +0 -109
- package/src/navigation/Breadcrumb/README.md +0 -56
- package/src/navigation/Link/README.md +0 -15
- package/src/navigation/Pagination/README.md +0 -15
- package/src/navigation/SideNavigation/README.md +0 -87
- package/src/navigation/Tabs/README.md +0 -9
- package/src/stylization/ThemeProvider/README.md +0 -56
- package/src/surface/Accordion/README.md +0 -93
- package/src/surface/Banner/README.md +0 -15
- package/src/surface/Card/README.md +0 -15
- package/src/surface/Modal/README.md +0 -15
- package/src/types/README.md +0 -73
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
# `@rarui/side-navigation`
|
|
2
|
-
|
|
3
|
-
The SideNavigation component provides collapsible navigation functionality with support for nested items, leading elements, and active states.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
$ yarn add @rarui/side-navigation
|
|
9
|
-
# or
|
|
10
|
-
$ npm install @rarui/side-navigation
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
### Basic SideNavigation
|
|
16
|
-
```html
|
|
17
|
-
<rarui-side-navigation name="Dashboard" description="Main dashboard">
|
|
18
|
-
<rarui-side-navigation-item>Reports</rarui-side-navigation-item>
|
|
19
|
-
<rarui-side-navigation-item>Analytics</rarui-side-navigation-item>
|
|
20
|
-
</rarui-side-navigation>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### SideNavigation with Leading Elements
|
|
24
|
-
```html
|
|
25
|
-
<rarui-side-navigation name="Settings" description="System configuration">
|
|
26
|
-
<!-- Custom icon at start -->
|
|
27
|
-
<rarui-icon slot="leading-start" name="folder-outlined" size="medium"></rarui-icon>
|
|
28
|
-
|
|
29
|
-
<!-- Custom icon at end (replaces default arrow) -->
|
|
30
|
-
<rarui-icon slot="leading-end" name="chevron-down" size="medium"></rarui-icon>
|
|
31
|
-
|
|
32
|
-
<!-- Nested items -->
|
|
33
|
-
<rarui-side-navigation-item>Profile</rarui-side-navigation-item>
|
|
34
|
-
<rarui-side-navigation-item>Permissions</rarui-side-navigation-item>
|
|
35
|
-
</rarui-side-navigation>
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### Active State
|
|
39
|
-
```html
|
|
40
|
-
<rarui-side-navigation name="Dashboard" active>
|
|
41
|
-
<rarui-side-navigation-item active>Current Page</rarui-side-navigation-item>
|
|
42
|
-
<rarui-side-navigation-item>Other Page</rarui-side-navigation-item>
|
|
43
|
-
</rarui-side-navigation>
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Multi-level Navigation
|
|
47
|
-
```html
|
|
48
|
-
<rarui-side-navigation name="Administration">
|
|
49
|
-
<rarui-side-navigation-item level="0">Users</rarui-side-navigation-item>
|
|
50
|
-
<rarui-side-navigation-item level="1">Permissions</rarui-side-navigation-item>
|
|
51
|
-
<rarui-side-navigation-item level="1">Roles</rarui-side-navigation-item>
|
|
52
|
-
</rarui-side-navigation>
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## Components
|
|
56
|
-
|
|
57
|
-
- `rarui-side-navigation` - Main navigation component with collapsible content
|
|
58
|
-
- `rarui-side-navigation-item` - Individual navigation items with support for nesting levels
|
|
59
|
-
|
|
60
|
-
## Slots
|
|
61
|
-
|
|
62
|
-
### rarui-side-navigation
|
|
63
|
-
- **Default slot**: Content for nested navigation items
|
|
64
|
-
- **leading-start**: Content to display at the start (e.g., icons)
|
|
65
|
-
- **leading-end**: Content to display at the end (e.g., custom icons)
|
|
66
|
-
|
|
67
|
-
### rarui-side-navigation-item
|
|
68
|
-
- **Default slot**: Content for the navigation item
|
|
69
|
-
|
|
70
|
-
## Behavior
|
|
71
|
-
|
|
72
|
-
### Arrow Icon
|
|
73
|
-
- Navigation items **always display an arrow icon** by default
|
|
74
|
-
- The arrow rotates between up/down states when toggling
|
|
75
|
-
- Use `leading-end` slot to provide a custom icon that replaces the default arrow
|
|
76
|
-
- Arrow shows `arrow-up` when expanded, `arrow-down` when collapsed
|
|
77
|
-
|
|
78
|
-
### Boolean Attributes
|
|
79
|
-
- Use `active` instead of `active="true"` for cleaner HTML
|
|
80
|
-
- Use `disabled` instead of `disabled="true"`
|
|
81
|
-
- Supports string values like `active="false"` for dynamic binding
|
|
82
|
-
|
|
83
|
-
## Events
|
|
84
|
-
|
|
85
|
-
- `toggle` - Fired when the navigation item is toggled (opened/closed)
|
|
86
|
-
|
|
87
|
-
View docs [here]().
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# ThemeProvider Web Component
|
|
2
|
-
|
|
3
|
-
Componente para gerenciamento global de temas na aplicação.
|
|
4
|
-
|
|
5
|
-
## Instalação
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install @rarui/theme-provider
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Uso Básico
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<rarui-theme-provider theme="dark">
|
|
15
|
-
<rarui-button>Botão com tema aplicado</rarui-button>
|
|
16
|
-
</rarui-theme-provider>
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
## API Global
|
|
20
|
-
|
|
21
|
-
```javascript
|
|
22
|
-
// Alternar tema
|
|
23
|
-
window.raruiTheme.setTheme('dark');
|
|
24
|
-
|
|
25
|
-
// Obter tema atual
|
|
26
|
-
const currentTheme = window.raruiTheme.getTheme();
|
|
27
|
-
|
|
28
|
-
// Escutar mudanças de tema
|
|
29
|
-
const unsubscribe = window.raruiTheme.subscribe((theme) => {
|
|
30
|
-
console.log('Tema mudou para:', theme);
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
// Evento global
|
|
34
|
-
document.addEventListener('rarui-theme-change', (event) => {
|
|
35
|
-
console.log('Novo tema:', event.detail.theme);
|
|
36
|
-
});
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Utilitários
|
|
40
|
-
|
|
41
|
-
```javascript
|
|
42
|
-
import { toggleTheme, isDarkTheme, onThemeChange } from '@rarui/theme-provider';
|
|
43
|
-
|
|
44
|
-
// Alternar entre temas
|
|
45
|
-
toggleTheme();
|
|
46
|
-
|
|
47
|
-
// Verificar se está no tema escuro
|
|
48
|
-
if (isDarkTheme()) {
|
|
49
|
-
console.log('Tema escuro ativo');
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
// Escutar mudanças
|
|
53
|
-
const unsubscribe = onThemeChange((theme) => {
|
|
54
|
-
console.log('Tema atual:', theme);
|
|
55
|
-
});
|
|
56
|
-
```
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Accordion
|
|
2
|
-
|
|
3
|
-
The Accordion component displays a list of expandable sections that users can toggle open or closed. It provides an organized way to present large amounts of content in a compact format.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
yarn add @rarui/accordion
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<rarui-accordion selected-default="item-1">
|
|
15
|
-
<rarui-accordion-item index="item-1">
|
|
16
|
-
<rarui-accordion-header title="First Item" size="medium">
|
|
17
|
-
</rarui-accordion-header>
|
|
18
|
-
<rarui-accordion-body padding="base">
|
|
19
|
-
Content of the first accordion item.
|
|
20
|
-
</rarui-accordion-body>
|
|
21
|
-
</rarui-accordion-item>
|
|
22
|
-
|
|
23
|
-
<rarui-accordion-item index="item-2">
|
|
24
|
-
<rarui-accordion-header title="Second Item" subtitle="With subtitle">
|
|
25
|
-
</rarui-accordion-header>
|
|
26
|
-
<rarui-accordion-body>
|
|
27
|
-
Content of the second accordion item.
|
|
28
|
-
</rarui-accordion-body>
|
|
29
|
-
</rarui-accordion-item>
|
|
30
|
-
</rarui-accordion>
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Custom Content
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<rarui-accordion>
|
|
37
|
-
<rarui-accordion-item index="custom">
|
|
38
|
-
<rarui-accordion-header>
|
|
39
|
-
<my-icon slot="icon"></my-icon>
|
|
40
|
-
Custom header content
|
|
41
|
-
</rarui-accordion-header>
|
|
42
|
-
<rarui-accordion-body>
|
|
43
|
-
Custom body content
|
|
44
|
-
</rarui-accordion-body>
|
|
45
|
-
</rarui-accordion-item>
|
|
46
|
-
</rarui-accordion>
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
## API
|
|
50
|
-
|
|
51
|
-
### rarui-accordion
|
|
52
|
-
|
|
53
|
-
| Property | Type | Default | Description |
|
|
54
|
-
|----------|------|---------|-------------|
|
|
55
|
-
| `selected-default` | `string` | `""` | Index of the item that should be open by default |
|
|
56
|
-
| `disabled` | `boolean` | `false` | Disables the entire accordion |
|
|
57
|
-
|
|
58
|
-
### rarui-accordion-item
|
|
59
|
-
|
|
60
|
-
| Property | Type | Default | Description |
|
|
61
|
-
|----------|------|---------|-------------|
|
|
62
|
-
| `index` | `string` | `""` | Unique identifier for this item |
|
|
63
|
-
|
|
64
|
-
### rarui-accordion-header
|
|
65
|
-
|
|
66
|
-
| Property | Type | Default | Description |
|
|
67
|
-
|----------|------|---------|-------------|
|
|
68
|
-
| `title` | `string` | `""` | Main title text |
|
|
69
|
-
| `subtitle` | `string` | `""` | Secondary subtitle text |
|
|
70
|
-
| `size` | `"small" \| "medium" \| "large"` | `"medium"` | Size variant |
|
|
71
|
-
| `no-icon-toggle` | `boolean` | `false` | Hide the toggle arrow icon |
|
|
72
|
-
| `disabled` | `boolean` | `false` | Disable this specific header |
|
|
73
|
-
|
|
74
|
-
#### Slots
|
|
75
|
-
- `icon` - Custom icon element
|
|
76
|
-
- `default` - Custom header content (when not using title/subtitle)
|
|
77
|
-
|
|
78
|
-
### rarui-accordion-body
|
|
79
|
-
|
|
80
|
-
| Property | Type | Default | Description |
|
|
81
|
-
|----------|------|---------|-------------|
|
|
82
|
-
| `padding` | `"none" \| "base"` | `"base"` | Internal padding of the body |
|
|
83
|
-
|
|
84
|
-
#### Slots
|
|
85
|
-
- `default` - Body content
|
|
86
|
-
|
|
87
|
-
## Events
|
|
88
|
-
|
|
89
|
-
### rarui-accordion
|
|
90
|
-
|
|
91
|
-
| Event | Detail | Description |
|
|
92
|
-
|-------|--------|-------------|
|
|
93
|
-
| `accordion-change` | `{ selected: string }` | Fired when an item is expanded or collapsed |
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# `@rarui/modal`
|
|
2
|
-
|
|
3
|
-
The modal component provides a base for popovers, suspended forms, tutorials, or any other content above the UI main surface.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
```sh
|
|
8
|
-
$ yarn add @rarui/modal
|
|
9
|
-
# or
|
|
10
|
-
$ npm install @rarui/modal
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
View docs [here]().
|
package/src/types/README.md
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
# Web Components Type Utilities
|
|
2
|
-
|
|
3
|
-
Shared TypeScript utilities for Rarui Web Components that automatically convert React component props to web component attributes with camelCase to kebab-case conversion.
|
|
4
|
-
|
|
5
|
-
## Installation
|
|
6
|
-
|
|
7
|
-
This package is part of the Rarui monorepo and is used internally by web components.
|
|
8
|
-
|
|
9
|
-
```typescript
|
|
10
|
-
import { WebComponentProperties } from "@rarui/web-components-types";
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
### Basic Usage
|
|
16
|
-
|
|
17
|
-
```typescript
|
|
18
|
-
import { SidebarProps } from "@rarui/typings";
|
|
19
|
-
import { WebComponentProperties } from "@rarui/web-components-types";
|
|
20
|
-
|
|
21
|
-
export type SidebarProperties = WebComponentProperties<
|
|
22
|
-
SidebarProps,
|
|
23
|
-
"onRemove" // Exclude callback properties
|
|
24
|
-
>;
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
### Available Types
|
|
28
|
-
|
|
29
|
-
#### `WebComponentProperties<TReactProps, TExclude>`
|
|
30
|
-
Main utility for creating web component properties from React props.
|
|
31
|
-
|
|
32
|
-
- Converts camelCase to kebab-case
|
|
33
|
-
- Excludes common React props (`children`, `className`, `style`, `ref`, `key`)
|
|
34
|
-
- Allows additional exclusions
|
|
35
|
-
|
|
36
|
-
#### `ExtendedWebComponentProperties<TReactProps, TExclude>`
|
|
37
|
-
Extended version that also automatically excludes all callback properties (`onXxx`).
|
|
38
|
-
|
|
39
|
-
#### `CamelToKebab<T>` and `CamelToKebabKeys<T>`
|
|
40
|
-
Low-level utilities for string and object key conversion.
|
|
41
|
-
|
|
42
|
-
### Conversion Examples
|
|
43
|
-
|
|
44
|
-
| React Prop (camelCase) | Web Component Attribute (kebab-case) |
|
|
45
|
-
|----------------------|-----------------------------------|
|
|
46
|
-
| `maxWidth` | `max-width` |
|
|
47
|
-
| `portalId` | `portal-id` |
|
|
48
|
-
| `backgroundColor` | `background-color` |
|
|
49
|
-
| `onRemove` | excluded (callback) |
|
|
50
|
-
| `children` | excluded (React-only) |
|
|
51
|
-
|
|
52
|
-
### Implementation Pattern
|
|
53
|
-
|
|
54
|
-
```typescript
|
|
55
|
-
// 1. Define types
|
|
56
|
-
export type ComponentProperties = WebComponentProperties<
|
|
57
|
-
ReactComponentProps,
|
|
58
|
-
"specificCallbackToExclude"
|
|
59
|
-
>;
|
|
60
|
-
|
|
61
|
-
// 2. Use in component
|
|
62
|
-
@property({ type: String, attribute: "max-width" })
|
|
63
|
-
maxWidth: ComponentProperties["max-width"] = "375px";
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Features
|
|
67
|
-
|
|
68
|
-
- ✅ **Type Safety**: Full TypeScript support with IntelliSense
|
|
69
|
-
- ✅ **Automatic Conversion**: camelCase → kebab-case
|
|
70
|
-
- ✅ **Smart Exclusions**: Removes React-only properties
|
|
71
|
-
- ✅ **Callback Handling**: Option to exclude callback properties
|
|
72
|
-
- ✅ **Inheritance**: Inherit all properties from React components
|
|
73
|
-
- ✅ **Extensible**: Easy to add custom exclusions
|