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,132 +1,131 @@
|
|
|
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
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
1
|
+
# Select (Deprecated)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Single-selection dropdown built on Radix Select.
|
|
6
|
+
|
|
7
|
+
- ⚠️ This component is deprecated. Prefer `AppSelect` for new code.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Subcomponents & Props
|
|
12
|
+
|
|
13
|
+
- **Select**: Root container with optional label
|
|
14
|
+
- `size`: `"sm" | "default" | "lg"` (default `"default"`)
|
|
15
|
+
- `label`: `string | React.ReactNode`
|
|
16
|
+
- `className`, `labelClassName`
|
|
17
|
+
- **SelectTrigger**: Button that opens the list
|
|
18
|
+
- `size?`: optional override of context size
|
|
19
|
+
- **SelectContent**: Floating list panel (Radix Content props)
|
|
20
|
+
- **SelectGroup**: Group wrapper
|
|
21
|
+
- **SelectItem**: Option row
|
|
22
|
+
- **SelectLabel**: Group label
|
|
23
|
+
- **SelectSeparator**: Separator line
|
|
24
|
+
- **SelectValue**: Selected value placeholder/slot
|
|
25
|
+
- **SelectScrollUpButton / SelectScrollDownButton**: Scroll affordances
|
|
26
|
+
|
|
27
|
+
Root also exposes typical controlled props from Radix (`value`, `defaultValue`, `onValueChange`, `disabled`, `required`, `name`).
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## Behavior
|
|
32
|
+
|
|
33
|
+
- **Sizes**: `size` controls trigger height and font size.
|
|
34
|
+
- **Keyboard**: Typeahead, arrow navigation, Enter/Space to select.
|
|
35
|
+
- **Accessibility**: Labels via `Label` + `htmlFor`/`id`.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
### Interactive
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { useState } from "react";
|
|
45
|
+
import { Label } from "laif-ds";
|
|
46
|
+
import {
|
|
47
|
+
Select,
|
|
48
|
+
SelectTrigger,
|
|
49
|
+
SelectValue,
|
|
50
|
+
SelectContent,
|
|
51
|
+
SelectGroup,
|
|
52
|
+
SelectLabel,
|
|
53
|
+
SelectItem,
|
|
54
|
+
SelectSeparator,
|
|
55
|
+
} from "laif-ds";
|
|
56
|
+
|
|
57
|
+
export function InteractiveSelect() {
|
|
58
|
+
const [value, setValue] = useState("");
|
|
59
|
+
return (
|
|
60
|
+
<div className="w-full max-w-sm space-y-6">
|
|
61
|
+
<div className="space-y-2">
|
|
62
|
+
<Label htmlFor="framework">Framework</Label>
|
|
63
|
+
<Select value={value} onValueChange={setValue}>
|
|
64
|
+
<SelectTrigger id="framework" className="w-full">
|
|
65
|
+
<SelectValue placeholder="Seleziona un framework" />
|
|
66
|
+
</SelectTrigger>
|
|
67
|
+
<SelectContent>
|
|
68
|
+
<SelectGroup>
|
|
69
|
+
<SelectLabel>Frontend</SelectLabel>
|
|
70
|
+
<SelectItem value="react">React</SelectItem>
|
|
71
|
+
<SelectItem value="vue">Vue</SelectItem>
|
|
72
|
+
<SelectItem value="angular">Angular</SelectItem>
|
|
73
|
+
</SelectGroup>
|
|
74
|
+
<SelectSeparator />
|
|
75
|
+
<SelectGroup>
|
|
76
|
+
<SelectLabel>Backend</SelectLabel>
|
|
77
|
+
<SelectItem value="node">Node.js</SelectItem>
|
|
78
|
+
<SelectItem value="django">Django</SelectItem>
|
|
79
|
+
</SelectGroup>
|
|
80
|
+
</SelectContent>
|
|
81
|
+
</Select>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Sizes
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import {
|
|
92
|
+
Select,
|
|
93
|
+
SelectTrigger,
|
|
94
|
+
SelectValue,
|
|
95
|
+
SelectContent,
|
|
96
|
+
SelectItem,
|
|
97
|
+
} from "laif-ds";
|
|
98
|
+
|
|
99
|
+
export function SelectSizes() {
|
|
100
|
+
return (
|
|
101
|
+
<div className="flex flex-col space-y-4">
|
|
102
|
+
<Select>
|
|
103
|
+
<SelectTrigger size="sm" className="w-[180px]">
|
|
104
|
+
<SelectValue placeholder="Small" />
|
|
105
|
+
</SelectTrigger>
|
|
106
|
+
<SelectContent>
|
|
107
|
+
<SelectItem value="1">Opzione 1</SelectItem>
|
|
108
|
+
<SelectItem value="2">Opzione 2</SelectItem>
|
|
109
|
+
</SelectContent>
|
|
110
|
+
</Select>
|
|
111
|
+
|
|
112
|
+
<Select>
|
|
113
|
+
<SelectTrigger className="w-[180px]">
|
|
114
|
+
<SelectValue placeholder="Default" />
|
|
115
|
+
</SelectTrigger>
|
|
116
|
+
<SelectContent>
|
|
117
|
+
<SelectItem value="1">Opzione 1</SelectItem>
|
|
118
|
+
<SelectItem value="2">Opzione 2</SelectItem>
|
|
119
|
+
</SelectContent>
|
|
120
|
+
</Select>
|
|
121
|
+
</div>
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## Notes
|
|
129
|
+
|
|
130
|
+
- **Use AppSelect**: Prefer `AppSelect` for production features (search, multiselect, async, etc.).
|
|
131
|
+
- **A11y**: Keep labels synchronized with triggers using `id` and `htmlFor`.
|
|
@@ -18,7 +18,14 @@ Side sheet/dialog component with overlay, animated content, header/footer and cl
|
|
|
18
18
|
## Example
|
|
19
19
|
|
|
20
20
|
```tsx
|
|
21
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
Sheet,
|
|
23
|
+
SheetTrigger,
|
|
24
|
+
SheetContent,
|
|
25
|
+
SheetHeader,
|
|
26
|
+
SheetTitle,
|
|
27
|
+
SheetDescription,
|
|
28
|
+
} from "laif-ds";
|
|
22
29
|
import { Button } from "laif-ds";
|
|
23
30
|
|
|
24
31
|
export function FiltersSheet() {
|
|
@@ -8,11 +8,11 @@ Client-side code highlighter using Shiki tokens. Falls back to plain `<pre><code
|
|
|
8
8
|
|
|
9
9
|
## Props
|
|
10
10
|
|
|
11
|
-
| Prop
|
|
12
|
-
|
|
|
13
|
-
| `children`
|
|
14
|
-
| `language`
|
|
15
|
-
| `className` | `string` | Optional classes for `<pre>`
|
|
11
|
+
| Prop | Type | Description |
|
|
12
|
+
| ----------- | -------- | ------------------------------- |
|
|
13
|
+
| `children` | `string` | Code string to highlight |
|
|
14
|
+
| `language` | `string` | Language key supported by Shiki |
|
|
15
|
+
| `className` | `string` | Optional classes for `<pre>` |
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
@@ -1,85 +1,94 @@
|
|
|
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
|
-
|
|
1
|
+
# Sidebar (Primitives)
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Low-level primitives to build responsive sidebars with desktop/offcanvas modes, collapsible icon mode, floating/inset variants, groups, menus, badges, actions and a keyboard shortcut (⌘/Ctrl + B) to toggle.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Main Components
|
|
10
|
+
|
|
11
|
+
- **SidebarProvider**: Context provider. Props: `defaultOpen?`, `open?`, `onOpenChange?`.
|
|
12
|
+
- **Sidebar**: Shell. Props: `side="left|right"`, `variant="sidebar|floating|inset"`, `collapsible="offcanvas|icon|none"`.
|
|
13
|
+
- **SidebarTrigger**: Button to toggle (uses provider).
|
|
14
|
+
- **SidebarRail**: Thin draggable/toggle rail.
|
|
15
|
+
- **SidebarInset**: Main content wrapper that adapts to inset variant.
|
|
16
|
+
- **SidebarHeader / SidebarFooter**: Top/bottom containers.
|
|
17
|
+
- **SidebarContent**: Scrollable body.
|
|
18
|
+
- **SidebarGroup / SidebarGroupLabel / SidebarGroupAction / SidebarGroupContent**: Labeled groups with optional action.
|
|
19
|
+
- **SidebarMenu / SidebarMenuItem / SidebarMenuButton / SidebarMenuAction / SidebarMenuBadge**: Menu building blocks.
|
|
20
|
+
- **SidebarMenuSub / SidebarMenuSubItem / SidebarMenuSubButton**: Nested menus.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Behavior
|
|
25
|
+
|
|
26
|
+
- **Mobile**: Offcanvas via `Sheet` when on mobile; desktop uses fixed panel.
|
|
27
|
+
- **Collapsible**: `icon` mode shows only icons and tooltips; `offcanvas` moves panel off-screen.
|
|
28
|
+
- **Keyboard**: Toggle with ⌘/Ctrl + B.
|
|
29
|
+
- **Tooltips**: Menu buttons show tooltips only when collapsed on desktop.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Example
|
|
34
|
+
|
|
35
|
+
```tsx
|
|
36
|
+
import {
|
|
37
|
+
SidebarProvider,
|
|
38
|
+
Sidebar,
|
|
39
|
+
SidebarHeader,
|
|
40
|
+
SidebarContent,
|
|
41
|
+
SidebarFooter,
|
|
42
|
+
SidebarMenu,
|
|
43
|
+
SidebarMenuItem,
|
|
44
|
+
SidebarMenuButton,
|
|
45
|
+
SidebarMenuBadge,
|
|
46
|
+
SidebarGroup,
|
|
47
|
+
SidebarGroupLabel,
|
|
48
|
+
SidebarGroupContent,
|
|
49
|
+
SidebarTrigger,
|
|
50
|
+
} from "laif-ds";
|
|
51
|
+
|
|
52
|
+
export function Shell() {
|
|
53
|
+
return (
|
|
54
|
+
<SidebarProvider>
|
|
55
|
+
<div className="flex h-[100vh] overflow-hidden">
|
|
56
|
+
<Sidebar>
|
|
57
|
+
<SidebarHeader>Header</SidebarHeader>
|
|
58
|
+
<SidebarContent>
|
|
59
|
+
<SidebarMenu>
|
|
60
|
+
<SidebarMenuItem>
|
|
61
|
+
<SidebarMenuButton isActive>
|
|
62
|
+
<span>Dashboard</span>
|
|
63
|
+
</SidebarMenuButton>
|
|
64
|
+
<SidebarMenuBadge>3</SidebarMenuBadge>
|
|
65
|
+
</SidebarMenuItem>
|
|
66
|
+
</SidebarMenu>
|
|
67
|
+
<SidebarGroup>
|
|
68
|
+
<SidebarGroupLabel>Section</SidebarGroupLabel>
|
|
69
|
+
<SidebarGroupContent>
|
|
70
|
+
<SidebarMenu>
|
|
71
|
+
<SidebarMenuItem>
|
|
72
|
+
<SidebarMenuButton>Item</SidebarMenuButton>
|
|
73
|
+
</SidebarMenuItem>
|
|
74
|
+
</SidebarMenu>
|
|
75
|
+
</SidebarGroupContent>
|
|
76
|
+
</SidebarGroup>
|
|
77
|
+
</SidebarContent>
|
|
78
|
+
<SidebarFooter>Footer</SidebarFooter>
|
|
79
|
+
</Sidebar>
|
|
80
|
+
<div className="flex-1 overflow-auto p-4">
|
|
81
|
+
<SidebarTrigger />
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</SidebarProvider>
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Notes
|
|
92
|
+
|
|
93
|
+
- **Icons**: Use `laif-ds` `Icon` component inside buttons.
|
|
94
|
+
- **A11y**: Focus management, ARIA attributes and tooltips included in primitives.
|
|
@@ -1,58 +1,62 @@
|
|
|
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
|
-
|
|
1
|
+
# Slider
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Radix-based slider with DS styling, optional value labels, sticky labels on thumbs, predefined step snapping, and center-offset fill.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| ------------------- | --------------------------- | ----------- | ------------------------------------------------------ | -------- | ------------------- |
|
|
13
|
+
| `value` | `number[]` | `undefined` | Controlled value (single `[n]` or range `[a,b]`). |
|
|
14
|
+
| `defaultValue` | `number[]` | `undefined` | Uncontrolled initial value. |
|
|
15
|
+
| `min` | `number` | `0` | Minimum. |
|
|
16
|
+
| `max` | `number` | `100` | Maximum. |
|
|
17
|
+
| `step` | `number` | `1` | Increment. |
|
|
18
|
+
| `size` | `"base" | "medium" | "large"` | `"base"` | Track/thumb sizing. |
|
|
19
|
+
| `formatValue` | `(value: number) => string` | `undefined` | Formatter for labels. |
|
|
20
|
+
| `showValues` | `boolean` | `false` | Show min/current (and max for single-value). |
|
|
21
|
+
| `showStickyLabel` | `boolean` | `false` | Show a `Badge` over the thumb with current value. |
|
|
22
|
+
| `stickyLabelSuffix` | `string` | `""` | Suffix for sticky label. |
|
|
23
|
+
| `fillOffset` | `boolean` | `false` | Fill track from center/`offsetValue` to current value. |
|
|
24
|
+
| `offsetValue` | `number` | `undefined` | Center reference for `fillOffset`. |
|
|
25
|
+
| `steps` | `number[]` | `undefined` | Predefined snapping steps. |
|
|
26
|
+
| `showStepMarkers` | `boolean` | `false` | Visual markers for `steps`. |
|
|
27
|
+
|
|
28
|
+
Inherits other Radix `Slider` props.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Examples
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import * as React from "react";
|
|
36
|
+
import { Slider } from "laif-ds";
|
|
37
|
+
|
|
38
|
+
export function Controlled() {
|
|
39
|
+
const [value, setValue] = React.useState([25]);
|
|
40
|
+
return <Slider value={value} onValueChange={setValue} size="medium" />;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function WithSteps() {
|
|
44
|
+
const [val, setVal] = React.useState([50]);
|
|
45
|
+
return (
|
|
46
|
+
<Slider
|
|
47
|
+
value={val}
|
|
48
|
+
onValueChange={setVal}
|
|
49
|
+
steps={[0, 25, 50, 75, 100]}
|
|
50
|
+
showStepMarkers
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Notes
|
|
59
|
+
|
|
60
|
+
- **Snapping**: When `steps` provided, values snap to nearest step.
|
|
61
|
+
- **Range**: Provide two values like `[min, max]` to enable a range slider.
|
|
62
|
+
- **Theming**: Uses DS tokens for track, range and thumb states.
|
|
@@ -8,25 +8,25 @@ Animated loading spinner component with multiple size and color variants. Provid
|
|
|
8
8
|
|
|
9
9
|
## Props
|
|
10
10
|
|
|
11
|
-
| Prop
|
|
12
|
-
|
|
|
13
|
-
| `size`
|
|
14
|
-
| `variant`
|
|
15
|
-
| `className
|
|
11
|
+
| Prop | Type | Default | Description |
|
|
12
|
+
| ----------- | ------------------------------------------------------------------ | ----------- | ----------------------------------------- |
|
|
13
|
+
| `size` | `"xxs" \| "xs" \| "sm" \| "md" \| "lg" \| "xl" \| "xxl" \| number` | `"md"` | Size of the spinner (preset or custom px) |
|
|
14
|
+
| `variant` | `"default" \| "destructive" \| "primary" \| "secondary"` | `"default"` | Color variant of the spinner |
|
|
15
|
+
| `className` | `string` | `""` | Additional Tailwind classes |
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
## Size Mapping
|
|
20
20
|
|
|
21
|
-
| Size
|
|
22
|
-
|
|
|
23
|
-
| `xxs`
|
|
24
|
-
| `xs`
|
|
25
|
-
| `sm`
|
|
26
|
-
| `md`
|
|
27
|
-
| `lg`
|
|
28
|
-
| `xl`
|
|
29
|
-
| `xxl`
|
|
21
|
+
| Size | Pixels |
|
|
22
|
+
| ----- | ------ |
|
|
23
|
+
| `xxs` | 12px |
|
|
24
|
+
| `xs` | 14px |
|
|
25
|
+
| `sm` | 16px |
|
|
26
|
+
| `md` | 20px |
|
|
27
|
+
| `lg` | 24px |
|
|
28
|
+
| `xl` | 28px |
|
|
29
|
+
| `xxl` | 36px |
|
|
30
30
|
|
|
31
31
|
You can also provide a custom number for precise pixel sizing.
|
|
32
32
|
|