laif-ds 0.2.74 → 0.2.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/CHANGELOG.md +446 -0
- package/dist/agent-docs/adoption-report.json +615 -0
- package/dist/agent-docs/components/Accordion.md +46 -16
- package/dist/agent-docs/components/Alert.md +90 -95
- package/dist/agent-docs/components/AlertDialog.md +132 -126
- package/dist/agent-docs/components/AppEditor.md +90 -90
- package/dist/agent-docs/components/AppRadioGroup.md +18 -18
- package/dist/agent-docs/components/AppSidebar.md +129 -122
- package/dist/agent-docs/components/AppStepper.md +81 -77
- package/dist/agent-docs/components/AspectRatio.md +70 -62
- package/dist/agent-docs/components/AudioVisualizer.md +5 -5
- package/dist/agent-docs/components/Avatar.md +112 -113
- package/dist/agent-docs/components/Badge.md +123 -118
- package/dist/agent-docs/components/Breadcrumb.md +8 -1
- package/dist/agent-docs/components/Button.md +131 -129
- package/dist/agent-docs/components/Card.md +172 -147
- package/dist/agent-docs/components/Carousel.md +148 -129
- package/dist/agent-docs/components/Chat.md +121 -109
- package/dist/agent-docs/components/ChatMessage.md +72 -61
- package/dist/agent-docs/components/Checkbox.md +150 -135
- package/dist/agent-docs/components/CircularProgress.md +53 -49
- package/dist/agent-docs/components/CodeHighlighter.md +4 -4
- package/dist/agent-docs/components/Collapsible.md +114 -95
- package/dist/agent-docs/components/Command.md +141 -142
- package/dist/agent-docs/components/Confirmer.md +182 -175
- package/dist/agent-docs/components/ContextMenu.md +196 -191
- package/dist/agent-docs/components/DataCrossTable.md +114 -94
- package/dist/agent-docs/components/DataTable.md +32 -24
- package/dist/agent-docs/components/Dialog.md +130 -125
- package/dist/agent-docs/components/Drawer.md +141 -127
- package/dist/agent-docs/components/FilePreviewer.md +138 -139
- package/dist/agent-docs/components/FileUploader.md +149 -129
- package/dist/agent-docs/components/Form.md +3 -1
- package/dist/agent-docs/components/FormComposer.md +163 -137
- package/dist/agent-docs/components/GanttChart.md +125 -122
- package/dist/agent-docs/components/HoverCard.md +1 -1
- package/dist/agent-docs/components/Icon.md +98 -99
- package/dist/agent-docs/components/Input.md +173 -138
- package/dist/agent-docs/components/InputOtp.md +6 -1
- package/dist/agent-docs/components/InputSelector.md +94 -97
- package/dist/agent-docs/components/InterruptPrompt.md +4 -4
- package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
- package/dist/agent-docs/components/Menubar.md +60 -57
- package/dist/agent-docs/components/MessageInput.md +134 -131
- package/dist/agent-docs/components/MessageList.md +110 -96
- package/dist/agent-docs/components/MultipleSelector.md +147 -146
- package/dist/agent-docs/components/NavigationMenu.md +6 -2
- package/dist/agent-docs/components/Popover.md +112 -103
- package/dist/agent-docs/components/PromptSuggestions.md +5 -5
- package/dist/agent-docs/components/RadioGroup.md +97 -90
- package/dist/agent-docs/components/Resizable.md +4 -1
- package/dist/agent-docs/components/ResizePrompt.md +12 -13
- package/dist/agent-docs/components/ScrollArea.md +6 -2
- package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
- package/dist/agent-docs/components/Select.md +131 -132
- package/dist/agent-docs/components/Sheet.md +8 -1
- package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
- package/dist/agent-docs/components/Sidebar.md +94 -85
- package/dist/agent-docs/components/Slider.md +62 -58
- package/dist/agent-docs/components/Sonner.md +1 -0
- package/dist/agent-docs/components/Spinner.md +14 -14
- package/dist/agent-docs/components/Stepper.md +93 -67
- package/dist/agent-docs/components/Switch.md +41 -42
- package/dist/agent-docs/components/TableSkeleton.md +8 -8
- package/dist/agent-docs/components/Tabs.md +106 -86
- package/dist/agent-docs/components/TextArea.md +51 -52
- package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
- package/dist/agent-docs/components/Toaster.md +1 -0
- package/dist/agent-docs/components/Tooltip.md +102 -91
- package/dist/agent-docs/components/Typo.md +68 -65
- package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
- package/dist/agent-docs/components-list.md +1 -0
- package/dist/agent-docs/manifest.json +5981 -0
- package/dist/agent-docs/truncated-cell.md +342 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
- package/dist/components/ui/app-checkbox.js +1 -1
- package/dist/components/ui/app-dialog.js +70 -64
- package/dist/components/ui/app-editor.js +51 -51
- package/dist/components/ui/app-form.js +81 -81
- package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
- package/dist/components/ui/app-select.js +109 -104
- package/dist/components/ui/app-sidebar.js +41 -41
- package/dist/components/ui/app-stepper.js +1 -1
- package/dist/components/ui/app-time-picker.js +18 -18
- package/dist/components/ui/app-tooltip.js +1 -1
- package/dist/components/ui/async-select.js +5 -5
- package/dist/components/ui/audio-visualizer.js +61 -58
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chat-message.js +8 -8
- package/dist/components/ui/chat.js +86 -88
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/date-picker.js +20 -20
- package/dist/components/ui/file-preview/index.js +13 -13
- package/dist/components/ui/file-previewer.js +12 -11
- package/dist/components/ui/file-uploader.js +86 -78
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
- package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
- package/dist/components/ui/input-selector.js +1 -1
- package/dist/components/ui/input.js +23 -23
- package/dist/components/ui/kanban.js +8 -9
- package/dist/components/ui/markdown-renderer.js +41 -35
- package/dist/components/ui/message-input.js +45 -44
- package/dist/components/ui/multiple-selector.js +91 -82
- package/dist/components/ui/secure-pdf-viewer.js +19 -7
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.js +4 -4
- package/dist/components/ui/stepper.js +157 -138
- package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
- package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
- package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
- package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
- package/dist/components/ui/tables/data-table/data-table.js +258 -250
- package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
- package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/theme-switcher.js +1 -1
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/truncated-cell.js +100 -0
- package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
- package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
- package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
- package/dist/components/ui/weekly-calendar/day-column.js +16 -16
- package/dist/components/ui/weekly-calendar/time-column.js +4 -4
- package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
- package/dist/hooks/use-audio-recording.js +1 -1
- package/dist/hooks/use-auto-scroll.js +18 -18
- package/dist/hooks/use-autosize-textarea.js +12 -13
- package/dist/index.d.ts +100 -45
- package/dist/index.js +362 -360
- package/dist/lib/utils.js +6 -6
- package/dist/styles.v3.css +1 -1
- package/package.json +14 -4
|
@@ -1,67 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
# Stepper (Primitives)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Accessible stepper primitives to build multi-step flows with keyboard navigation, indicators, separators and panels. Supports horizontal and vertical layouts.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Subcomponents & Props
|
|
10
|
+
|
|
11
|
+
- **Stepper**: Root context.
|
|
12
|
+
- `defaultValue?: number` (default `1`)
|
|
13
|
+
- `value?: number`, `onValueChange?: (n:number)=>void`
|
|
14
|
+
- `orientation?: "horizontal" | "vertical"` (default `"horizontal"`)
|
|
15
|
+
- `indicators?: { active?, completed?, inactive?, loading? }`
|
|
16
|
+
- **StepperItem**: Defines a step. Props: `step` (number), `completed?`, `disabled?`, `loading?`, `orientation?`.
|
|
17
|
+
- **StepperTrigger**: Click/keyboard target to activate step. Props: `size?: "sm"|"default"|"lg"`.
|
|
18
|
+
- **StepperIndicator**: Circular indicator; accepts `size`.
|
|
19
|
+
- **StepperTitle / StepperDescription**: Labels; accept `size`.
|
|
20
|
+
- **StepperSeparator**: Visual separator between steps; respects orientation.
|
|
21
|
+
- **StepperNav**: Wraps triggers; accepts `orientation?`.
|
|
22
|
+
- **StepperPanel**: Container for contents.
|
|
23
|
+
- **StepperContent**: Conditional render area for a given `value` (step id). `forceMount?` keeps DOM mounted.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Behavior
|
|
28
|
+
|
|
29
|
+
- **Keyboard**: Arrow keys navigate between triggers; Home/End jump to first/last; Enter/Space selects.
|
|
30
|
+
- **Controlled/Uncontrolled**: Use `value/onValueChange` or `defaultValue`.
|
|
31
|
+
- **Indicators**: Provide custom nodes for states via `indicators`.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Example
|
|
36
|
+
|
|
37
|
+
```tsx
|
|
38
|
+
import {
|
|
39
|
+
Stepper,
|
|
40
|
+
StepperNav,
|
|
41
|
+
StepperItem,
|
|
42
|
+
StepperTrigger,
|
|
43
|
+
StepperIndicator,
|
|
44
|
+
StepperTitle,
|
|
45
|
+
StepperSeparator,
|
|
46
|
+
StepperPanel,
|
|
47
|
+
StepperContent,
|
|
48
|
+
} from "laif-ds";
|
|
49
|
+
|
|
50
|
+
export function BasicStepper() {
|
|
51
|
+
const [step, setStep] = React.useState(1);
|
|
52
|
+
return (
|
|
53
|
+
<Stepper value={step} onValueChange={setStep}>
|
|
54
|
+
<div className="flex w-full flex-col">
|
|
55
|
+
<StepperNav>
|
|
56
|
+
<StepperItem step={1}>
|
|
57
|
+
<StepperTrigger>
|
|
58
|
+
<StepperIndicator>1</StepperIndicator>
|
|
59
|
+
<StepperTitle>Account</StepperTitle>
|
|
60
|
+
</StepperTrigger>
|
|
61
|
+
<StepperSeparator />
|
|
62
|
+
</StepperItem>
|
|
63
|
+
<StepperItem step={2}>
|
|
64
|
+
<StepperTrigger>
|
|
65
|
+
<StepperIndicator>2</StepperIndicator>
|
|
66
|
+
<StepperTitle>Profile</StepperTitle>
|
|
67
|
+
</StepperTrigger>
|
|
68
|
+
<StepperSeparator />
|
|
69
|
+
</StepperItem>
|
|
70
|
+
<StepperItem step={3}>
|
|
71
|
+
<StepperTrigger>
|
|
72
|
+
<StepperIndicator>3</StepperIndicator>
|
|
73
|
+
<StepperTitle>Done</StepperTitle>
|
|
74
|
+
</StepperTrigger>
|
|
75
|
+
</StepperItem>
|
|
76
|
+
</StepperNav>
|
|
77
|
+
<StepperPanel className="mt-6">
|
|
78
|
+
<StepperContent value={1}>Step 1</StepperContent>
|
|
79
|
+
<StepperContent value={2}>Step 2</StepperContent>
|
|
80
|
+
<StepperContent value={3}>Step 3</StepperContent>
|
|
81
|
+
</StepperPanel>
|
|
82
|
+
</div>
|
|
83
|
+
</Stepper>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## Notes
|
|
91
|
+
|
|
92
|
+
- **Focus**: Triggers manage focus order for accessible navigation.
|
|
93
|
+
- **Layouts**: Use `orientation="vertical"` to show left rail of steps with content on the right.
|
|
@@ -1,42 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Accessible on/off toggle built on Radix Switch with DS tokens and smooth thumb slide.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
Inherits Radix Switch props:
|
|
12
|
+
|
|
13
|
+
- `checked?`, `defaultChecked?`
|
|
14
|
+
- `onCheckedChange?(checked: boolean)`
|
|
15
|
+
- `disabled?`, `required?`, `name?`, `value?`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import * as React from "react";
|
|
23
|
+
import { Switch } from "laif-ds";
|
|
24
|
+
|
|
25
|
+
export function ControlledSwitch() {
|
|
26
|
+
const [checked, setChecked] = React.useState(false);
|
|
27
|
+
return (
|
|
28
|
+
<div className="flex items-center gap-2">
|
|
29
|
+
<Switch id="wifi" checked={checked} onCheckedChange={setChecked} />
|
|
30
|
+
<label htmlFor="wifi">Wi‑Fi {checked ? "on" : "off"}</label>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Track uses `bg-d-primary` when checked and `bg-d-foreground/20` when unchecked.
|
|
41
|
+
- Thumb translation is optimized for a 32px track with 16px thumb.
|
|
@@ -8,14 +8,14 @@ Skeleton placeholder for tables. Renders a header row and a configurable number
|
|
|
8
8
|
|
|
9
9
|
## Props
|
|
10
10
|
|
|
11
|
-
| Prop
|
|
12
|
-
|
|
|
13
|
-
| `headerRow`
|
|
14
|
-
| `rowCount`
|
|
15
|
-
| `columnCount`
|
|
16
|
-
| `className`
|
|
17
|
-
| `cornerHeaderFrom` | `string`
|
|
18
|
-
| `cornerHeaderTo`
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| ------------------ | ---------- | ----------- | ------------------------------------------------ |
|
|
13
|
+
| `headerRow` | `string[]` | `[]` | Column headers. If empty, headers are skeletons |
|
|
14
|
+
| `rowCount` | `number` | `5` | Number of skeleton rows |
|
|
15
|
+
| `columnCount` | `number` | `5` | Used when `headerRow` is empty to define columns |
|
|
16
|
+
| `className` | `string` | `undefined` | Additional wrapper classes |
|
|
17
|
+
| `cornerHeaderFrom` | `string` | `undefined` | Top-left corner label (top-left) |
|
|
18
|
+
| `cornerHeaderTo` | `string` | `undefined` | Top-left corner label (bottom-right) |
|
|
19
19
|
|
|
20
20
|
---
|
|
21
21
|
|
|
@@ -1,86 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Radix Tabs with design-system styling. Provides a list of triggers and matching content panels, supporting horizontal and vertical orientations, disabled tabs, and manual/automatic activation.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Components & Props
|
|
10
|
+
|
|
11
|
+
- **Tabs** (`Root`)
|
|
12
|
+
- `defaultValue?: string`
|
|
13
|
+
- `value?: string`
|
|
14
|
+
- `onValueChange?: (value: string) => void`
|
|
15
|
+
- `orientation?: "horizontal" | "vertical"` (default `"horizontal"`)
|
|
16
|
+
- `dir?: "ltr" | "rtl"` (default `"ltr"`)
|
|
17
|
+
- `activationMode?: "automatic" | "manual"` (default `"automatic"`)
|
|
18
|
+
- `className?: string`
|
|
19
|
+
- **TabsList**: Visual container for triggers.
|
|
20
|
+
- **TabsTrigger**
|
|
21
|
+
- `value: string`
|
|
22
|
+
- `disabled?: boolean`
|
|
23
|
+
- `className?: string`
|
|
24
|
+
- **TabsContent**
|
|
25
|
+
- `value: string`
|
|
26
|
+
- `className?: string`
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Behavior
|
|
31
|
+
|
|
32
|
+
- **Activation**: `automatic` switches on focus; `manual` switches on click/Enter.
|
|
33
|
+
- **Orientation**: Vertical layout supported via `orientation="vertical"`.
|
|
34
|
+
- **Disabled**: `TabsTrigger` can be disabled and will not activate.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Examples
|
|
39
|
+
|
|
40
|
+
### Default
|
|
41
|
+
|
|
42
|
+
```tsx
|
|
43
|
+
import { Tabs, TabsList, TabsTrigger, TabsContent } from "laif-ds";
|
|
44
|
+
|
|
45
|
+
export function BasicTabs() {
|
|
46
|
+
return (
|
|
47
|
+
<Tabs defaultValue="account" className="w-[400px]">
|
|
48
|
+
<TabsList className="grid w-full grid-cols-2">
|
|
49
|
+
<TabsTrigger value="account">Account</TabsTrigger>
|
|
50
|
+
<TabsTrigger value="password">Password</TabsTrigger>
|
|
51
|
+
</TabsList>
|
|
52
|
+
<TabsContent value="account">Contenuto Account</TabsContent>
|
|
53
|
+
<TabsContent value="password">Contenuto Password</TabsContent>
|
|
54
|
+
</Tabs>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Vertical
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
export function VerticalTabs() {
|
|
63
|
+
return (
|
|
64
|
+
<Tabs defaultValue="tab1" orientation="vertical" className="flex w-[600px]">
|
|
65
|
+
<TabsList className="flex h-auto w-[200px] flex-col">
|
|
66
|
+
<TabsTrigger value="tab1" className="justify-start">
|
|
67
|
+
Profilo
|
|
68
|
+
</TabsTrigger>
|
|
69
|
+
<TabsTrigger value="tab2" className="justify-start">
|
|
70
|
+
Preferenze
|
|
71
|
+
</TabsTrigger>
|
|
72
|
+
<TabsTrigger value="tab3" className="justify-start">
|
|
73
|
+
Notifiche
|
|
74
|
+
</TabsTrigger>
|
|
75
|
+
</TabsList>
|
|
76
|
+
<div className="ml-4 flex-1">
|
|
77
|
+
<TabsContent
|
|
78
|
+
value="tab1"
|
|
79
|
+
className="border-d-border rounded-md border p-4"
|
|
80
|
+
>
|
|
81
|
+
Profilo
|
|
82
|
+
</TabsContent>
|
|
83
|
+
<TabsContent
|
|
84
|
+
value="tab2"
|
|
85
|
+
className="border-d-border rounded-md border p-4"
|
|
86
|
+
>
|
|
87
|
+
Preferenze
|
|
88
|
+
</TabsContent>
|
|
89
|
+
<TabsContent
|
|
90
|
+
value="tab3"
|
|
91
|
+
className="border-d-border rounded-md border p-4"
|
|
92
|
+
>
|
|
93
|
+
Notifiche
|
|
94
|
+
</TabsContent>
|
|
95
|
+
</div>
|
|
96
|
+
</Tabs>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Notes
|
|
104
|
+
|
|
105
|
+
- **Styling**: `TabsList` uses DS tokens for backgrounds; `TabsTrigger` highlights when active.
|
|
106
|
+
- **Accessibility**: Uses Radix semantics for roles/aria and keyboard navigation out of the box.
|
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
# TextArea
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Textarea with optional label wrapper and design-system focus/invalid styles. Accepts all native `<textarea>` props.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| ---------------- | ---------------------------------- | ----------- | -------------------------------------------------------------------- |
|
|
13
|
+
| `label` | `React.ReactNode` | `undefined` | Optional label text/node above the textarea. |
|
|
14
|
+
| `labelClassName` | `string` | `undefined` | Classes for `Label`. |
|
|
15
|
+
| `wrpClassName` | `string` | `undefined` | Wrapper classes. |
|
|
16
|
+
| `id` | `string` | `auto` | If omitted and `label` is provided, an id is generated. |
|
|
17
|
+
| `...props` | `React.ComponentProps<'textarea'>` | — | All native textarea props (e.g., `rows`, `placeholder`, `disabled`). |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Behavior
|
|
22
|
+
|
|
23
|
+
- **Auto id**: When `label` exists and `id` is not provided, an id is generated and linked via `Label htmlFor`.
|
|
24
|
+
- **Styling**: Uses DS tokens for border, focus ring, disabled, and invalid states (`aria-invalid`).
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
import { Textarea } from "laif-ds";
|
|
32
|
+
|
|
33
|
+
export function Example() {
|
|
34
|
+
return (
|
|
35
|
+
<Textarea
|
|
36
|
+
label="Descrizione"
|
|
37
|
+
placeholder="Scrivi qui..."
|
|
38
|
+
defaultValue="Testo di esempio"
|
|
39
|
+
rows={4}
|
|
40
|
+
wrpClassName="w-[500px]"
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Notes
|
|
49
|
+
|
|
50
|
+
- **Validation**: Add `aria-invalid` to reflect error state.
|
|
51
|
+
- **Resize**: Control with native CSS `resize` via `className` if needed.
|