torch-glare 2.5.6 → 2.6.0
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/README.md +4 -3
- package/dist/bin/index.js +9 -24
- package/dist/bin/index.js.map +1 -1
- package/dist/src/commands/add.d.ts +2 -2
- package/dist/src/commands/add.d.ts.map +1 -1
- package/dist/src/commands/add.js +4 -70
- package/dist/src/commands/add.js.map +1 -1
- package/dist/src/commands/hook.d.ts +5 -4
- package/dist/src/commands/hook.d.ts.map +1 -1
- package/dist/src/commands/hook.js +7 -75
- package/dist/src/commands/hook.js.map +1 -1
- package/dist/src/commands/init.js +1 -1
- package/dist/src/commands/init.js.map +1 -1
- package/dist/src/commands/layout.d.ts +5 -4
- package/dist/src/commands/layout.d.ts.map +1 -1
- package/dist/src/commands/layout.js +7 -75
- package/dist/src/commands/layout.js.map +1 -1
- package/dist/src/commands/provider.d.ts +5 -4
- package/dist/src/commands/provider.d.ts.map +1 -1
- package/dist/src/commands/provider.js +7 -75
- package/dist/src/commands/provider.js.map +1 -1
- package/dist/src/commands/update.d.ts.map +1 -1
- package/dist/src/commands/update.js +78 -43
- package/dist/src/commands/update.js.map +1 -1
- package/dist/src/commands/utils.d.ts +5 -4
- package/dist/src/commands/utils.d.ts.map +1 -1
- package/dist/src/commands/utils.js +7 -80
- package/dist/src/commands/utils.js.map +1 -1
- package/dist/src/shared/addFromRegistry.d.ts +16 -0
- package/dist/src/shared/addFromRegistry.d.ts.map +1 -0
- package/dist/src/shared/addFromRegistry.js +88 -0
- package/dist/src/shared/addFromRegistry.js.map +1 -0
- package/dist/src/shared/getInstallCommand.d.ts.map +1 -1
- package/dist/src/shared/getInstallCommand.js +5 -0
- package/dist/src/shared/getInstallCommand.js.map +1 -1
- package/dist/src/shared/installDependencies.d.ts +0 -10
- package/dist/src/shared/installDependencies.d.ts.map +1 -1
- package/dist/src/shared/installDependencies.js +0 -17
- package/dist/src/shared/installDependencies.js.map +1 -1
- package/dist/src/shared/installFromPlan.d.ts +7 -5
- package/dist/src/shared/installFromPlan.d.ts.map +1 -1
- package/dist/src/shared/installFromPlan.js +103 -36
- package/dist/src/shared/installFromPlan.js.map +1 -1
- package/dist/src/shared/loadRegistry.d.ts +12 -3
- package/dist/src/shared/loadRegistry.d.ts.map +1 -1
- package/dist/src/shared/loadRegistry.js +19 -20
- package/dist/src/shared/loadRegistry.js.map +1 -1
- package/dist/src/shared/registryClient.d.ts +19 -0
- package/dist/src/shared/registryClient.d.ts.map +1 -0
- package/dist/src/shared/registryClient.js +128 -0
- package/dist/src/shared/registryClient.js.map +1 -0
- package/dist/src/shared/resolveEntry.d.ts +10 -7
- package/dist/src/shared/resolveEntry.d.ts.map +1 -1
- package/dist/src/shared/resolveEntry.js +18 -13
- package/dist/src/shared/resolveEntry.js.map +1 -1
- package/dist/src/shared/suggestOtherCommand.d.ts +7 -1
- package/dist/src/shared/suggestOtherCommand.d.ts.map +1 -1
- package/dist/src/shared/suggestOtherCommand.js +29 -23
- package/dist/src/shared/suggestOtherCommand.js.map +1 -1
- package/dist/src/types/main.d.ts +31 -2
- package/dist/src/types/main.d.ts.map +1 -1
- package/package.json +6 -11
- package/apps/lib/components/ActionButton.tsx +0 -93
- package/apps/lib/components/ActionsGroup.tsx +0 -27
- package/apps/lib/components/AlertDialog.tsx +0 -204
- package/apps/lib/components/Avatar.tsx +0 -46
- package/apps/lib/components/Badge.tsx +0 -250
- package/apps/lib/components/BadgeField.tsx +0 -403
- package/apps/lib/components/Breadcrumb.tsx +0 -280
- package/apps/lib/components/Button.tsx +0 -325
- package/apps/lib/components/ButtonGroup.tsx +0 -190
- package/apps/lib/components/Calendar.tsx +0 -115
- package/apps/lib/components/Card.tsx +0 -95
- package/apps/lib/components/Checkbox.tsx +0 -42
- package/apps/lib/components/ColorPicker.tsx +0 -441
- package/apps/lib/components/ConclusionHeader.tsx +0 -148
- package/apps/lib/components/ContextMenu.tsx +0 -571
- package/apps/lib/components/CountBadge.tsx +0 -52
- package/apps/lib/components/DataTable.tsx +0 -213
- package/apps/lib/components/DataViews/badge.ts +0 -49
- package/apps/lib/components/DataViews/cell.tsx +0 -324
- package/apps/lib/components/DataViews/context.ts +0 -144
- package/apps/lib/components/DataViews/data-views.tsx +0 -395
- package/apps/lib/components/DataViews/filters/children.tsx +0 -98
- package/apps/lib/components/DataViews/filters/custom.tsx +0 -34
- package/apps/lib/components/DataViews/filters/filters.tsx +0 -157
- package/apps/lib/components/DataViews/filters/index.ts +0 -4
- package/apps/lib/components/DataViews/filters/labelled.tsx +0 -20
- package/apps/lib/components/DataViews/filters/presets.tsx +0 -65
- package/apps/lib/components/DataViews/filters/sync.tsx +0 -35
- package/apps/lib/components/DataViews/filters/values.ts +0 -173
- package/apps/lib/components/DataViews/header.tsx +0 -220
- package/apps/lib/components/DataViews/hooks/index.ts +0 -5
- package/apps/lib/components/DataViews/hooks/useActiveRow.ts +0 -22
- package/apps/lib/components/DataViews/hooks/useControllable.ts +0 -52
- package/apps/lib/components/DataViews/index.ts +0 -88
- package/apps/lib/components/DataViews/panel/columns.tsx +0 -153
- package/apps/lib/components/DataViews/panel/controls.tsx +0 -106
- package/apps/lib/components/DataViews/panel/index.ts +0 -3
- package/apps/lib/components/DataViews/panel/panel.tsx +0 -164
- package/apps/lib/components/DataViews/panel/saved-views.tsx +0 -67
- package/apps/lib/components/DataViews/panel/section.tsx +0 -81
- package/apps/lib/components/DataViews/panel/sort.tsx +0 -42
- package/apps/lib/components/DataViews/panel/tab.tsx +0 -31
- package/apps/lib/components/DataViews/slots.ts +0 -72
- package/apps/lib/components/DataViews/states.tsx +0 -73
- package/apps/lib/components/DataViews/types.ts +0 -510
- package/apps/lib/components/DataViews/views/board-view.tsx +0 -381
- package/apps/lib/components/DataViews/views/card-rows.tsx +0 -36
- package/apps/lib/components/DataViews/views/inbox-view.tsx +0 -260
- package/apps/lib/components/DataViews/views/pane-views.tsx +0 -196
- package/apps/lib/components/DataViews/views/table-view.tsx +0 -493
- package/apps/lib/components/DataViews/views/tree-view.tsx +0 -367
- package/apps/lib/components/DatePicker.tsx +0 -232
- package/apps/lib/components/Dialog.tsx +0 -116
- package/apps/lib/components/Divider.tsx +0 -28
- package/apps/lib/components/Drawer.tsx +0 -451
- package/apps/lib/components/DropdownMenu.tsx +0 -554
- package/apps/lib/components/FieldHint.tsx +0 -69
- package/apps/lib/components/Form.tsx +0 -182
- package/apps/lib/components/FormBuilder/context.ts +0 -85
- package/apps/lib/components/FormBuilder/field-kind.ts +0 -28
- package/apps/lib/components/FormBuilder/fields/ChoiceFields.tsx +0 -60
- package/apps/lib/components/FormBuilder/fields/ColorField.tsx +0 -59
- package/apps/lib/components/FormBuilder/fields/CustomField.tsx +0 -11
- package/apps/lib/components/FormBuilder/fields/DateField.tsx +0 -32
- package/apps/lib/components/FormBuilder/fields/FieldArray.tsx +0 -74
- package/apps/lib/components/FormBuilder/fields/FieldShell.tsx +0 -168
- package/apps/lib/components/FormBuilder/fields/FileField.tsx +0 -39
- package/apps/lib/components/FormBuilder/fields/OptionListFields.tsx +0 -132
- package/apps/lib/components/FormBuilder/fields/OtpField.tsx +0 -31
- package/apps/lib/components/FormBuilder/fields/PhoneField.tsx +0 -109
- package/apps/lib/components/FormBuilder/fields/RichTextEditorField.tsx +0 -31
- package/apps/lib/components/FormBuilder/fields/SelectField.tsx +0 -114
- package/apps/lib/components/FormBuilder/fields/SignatureField.tsx +0 -157
- package/apps/lib/components/FormBuilder/fields/SliderField.tsx +0 -67
- package/apps/lib/components/FormBuilder/fields/SwitchBoxField.tsx +0 -41
- package/apps/lib/components/FormBuilder/fields/TableField.tsx +0 -336
- package/apps/lib/components/FormBuilder/fields/TextField.tsx +0 -213
- package/apps/lib/components/FormBuilder/fields/TreeSelectField.tsx +0 -43
- package/apps/lib/components/FormBuilder/fields/countries.ts +0 -303
- package/apps/lib/components/FormBuilder/fields/index.ts +0 -25
- package/apps/lib/components/FormBuilder/form-builder.tsx +0 -198
- package/apps/lib/components/FormBuilder/index.ts +0 -31
- package/apps/lib/components/FormBuilder/numberFormat.ts +0 -16
- package/apps/lib/components/FormBuilder/submit.tsx +0 -67
- package/apps/lib/components/FormBuilder/types.ts +0 -316
- package/apps/lib/components/FormRenderer/FormDrawer.tsx +0 -250
- package/apps/lib/components/FormRenderer/detail.tsx +0 -256
- package/apps/lib/components/FormRenderer/form-renderer.tsx +0 -358
- package/apps/lib/components/FormRenderer/header.tsx +0 -88
- package/apps/lib/components/FormRenderer/index.ts +0 -17
- package/apps/lib/components/FormRenderer/notch-action.tsx +0 -64
- package/apps/lib/components/FormRenderer/section.tsx +0 -39
- package/apps/lib/components/FormRenderer/stepper.tsx +0 -393
- package/apps/lib/components/FormRenderer/types.ts +0 -115
- package/apps/lib/components/FormSummary.tsx +0 -282
- package/apps/lib/components/HeaderBar.tsx +0 -117
- package/apps/lib/components/ImageAttachment.tsx +0 -209
- package/apps/lib/components/InnerLabelField.tsx +0 -154
- package/apps/lib/components/Input.tsx +0 -224
- package/apps/lib/components/InputField.tsx +0 -147
- package/apps/lib/components/InputOTP.tsx +0 -84
- package/apps/lib/components/Label.tsx +0 -129
- package/apps/lib/components/LabelField.tsx +0 -76
- package/apps/lib/components/LabeledCheckBox.tsx +0 -51
- package/apps/lib/components/LabeledRadio.tsx +0 -51
- package/apps/lib/components/LinkButton.tsx +0 -94
- package/apps/lib/components/LoginButton.tsx +0 -51
- package/apps/lib/components/PasswordLevel.tsx +0 -58
- package/apps/lib/components/Popover.tsx +0 -312
- package/apps/lib/components/ProfileMenu.tsx +0 -85
- package/apps/lib/components/Radio.tsx +0 -59
- package/apps/lib/components/RadioCard.tsx +0 -50
- package/apps/lib/components/ScrollArea.tsx +0 -54
- package/apps/lib/components/SearchField.tsx +0 -62
- package/apps/lib/components/SearchableSelect.tsx +0 -318
- package/apps/lib/components/SearchableTable.tsx +0 -344
- package/apps/lib/components/SearchableTree.tsx +0 -485
- package/apps/lib/components/SearchableTreeDialog.tsx +0 -502
- package/apps/lib/components/SectionBlock.tsx +0 -168
- package/apps/lib/components/Select.tsx +0 -347
- package/apps/lib/components/SimpleSelect.tsx +0 -225
- package/apps/lib/components/Skeleton.tsx +0 -12
- package/apps/lib/components/SlideDatePicker.tsx +0 -255
- package/apps/lib/components/SpinLoading.tsx +0 -174
- package/apps/lib/components/Stepper.tsx +0 -480
- package/apps/lib/components/Switch.tsx +0 -82
- package/apps/lib/components/TabFormItem.tsx +0 -153
- package/apps/lib/components/TabSwitch.tsx +0 -172
- package/apps/lib/components/Table.tsx +0 -597
- package/apps/lib/components/TextEditor/ChartBlockTool.ts +0 -676
- package/apps/lib/components/TextEditor/RichTextField.tsx +0 -46
- package/apps/lib/components/TextEditor/TableDnDWrapper.ts +0 -462
- package/apps/lib/components/TextEditor/TextEditor.tsx +0 -1164
- package/apps/lib/components/TextEditor/TextEditorToolbar.tsx +0 -429
- package/apps/lib/components/TextEditor/editor-tools/AlignmentTune.ts +0 -70
- package/apps/lib/components/TextEditor/editor-tools/ColorInlineTool.ts +0 -50
- package/apps/lib/components/TextEditor/editor-tools/StrikethroughInlineTool.ts +0 -48
- package/apps/lib/components/TextEditor/editor-tools/inlineFormat.ts +0 -98
- package/apps/lib/components/TextEditor/editorjs.d.ts +0 -60
- package/apps/lib/components/TextEditor/index.ts +0 -7
- package/apps/lib/components/TextEditor/markdownParser.ts +0 -346
- package/apps/lib/components/Textarea.tsx +0 -117
- package/apps/lib/components/Timeline.tsx +0 -263
- package/apps/lib/components/Toast.tsx +0 -87
- package/apps/lib/components/Toggle.tsx +0 -125
- package/apps/lib/components/ToggleButton.tsx +0 -140
- package/apps/lib/components/Tooltip.tsx +0 -116
- package/apps/lib/components/TransparentLabel.tsx +0 -71
- package/apps/lib/components/TreeDropDown.tsx +0 -115
- package/apps/lib/components/TreeFolder/TreeFolder.tsx +0 -380
- package/apps/lib/components/TreeFolder/TreeFolderBreadcrumb.tsx +0 -75
- package/apps/lib/components/TreeFolder/TreeFolderRow.tsx +0 -354
- package/apps/lib/components/TreeFolder/TreeFolderStyles.tsx +0 -60
- package/apps/lib/components/TreeFolder/icons.tsx +0 -60
- package/apps/lib/components/TreeFolder/index.ts +0 -24
- package/apps/lib/components/TreeFolder/treeFolderUtils.ts +0 -109
- package/apps/lib/components/TreeFolder/types.ts +0 -77
- package/apps/lib/components/TreeFolder/useTreeFolderDnD.ts +0 -118
- package/apps/lib/hooks/useActiveTreeItem.ts +0 -61
- package/apps/lib/hooks/useClickOutside.ts +0 -27
- package/apps/lib/hooks/useDragDrop.tsx +0 -365
- package/apps/lib/hooks/useHtmlDir.ts +0 -31
- package/apps/lib/hooks/useInfiniteScroll.ts +0 -108
- package/apps/lib/hooks/useIsMobile.ts +0 -21
- package/apps/lib/hooks/useResize.ts +0 -67
- package/apps/lib/hooks/useTagSelection.ts +0 -300
- package/apps/lib/layouts/CNLayout.tsx +0 -372
- package/apps/lib/layouts/DataViewCard.tsx +0 -62
- package/apps/lib/layouts/FieldSection.tsx +0 -91
- package/apps/lib/layouts/TreeSubLayout.tsx +0 -173
- package/apps/lib/providers/ThemeProvider.tsx +0 -84
- package/apps/lib/registry.json +0 -1217
- package/apps/lib/tsconfig.json +0 -9
- package/apps/lib/tsconfig.tsbuildinfo +0 -1
- package/apps/lib/utils/cn.ts +0 -6
- package/apps/lib/utils/color.ts +0 -175
- package/apps/lib/utils/dataViews/path.ts +0 -67
- package/apps/lib/utils/dataViews/query.ts +0 -73
- package/apps/lib/utils/dataViews/types.ts +0 -187
- package/apps/lib/utils/dateFormat.ts +0 -108
- package/apps/lib/utils/resize.ts +0 -31
- package/apps/lib/utils/scroller.ts +0 -26
- package/apps/lib/utils/types.ts +0 -16
- package/docs/BLOCKS.md +0 -129
- package/docs/CHANGELOG-1.1.16.md +0 -108
- package/docs/Cover.png +0 -0
- package/docs/README.md +0 -215
- package/docs/components/action-button.md +0 -638
- package/docs/components/actions-group.md +0 -708
- package/docs/components/alert-dialog.md +0 -920
- package/docs/components/avatar.md +0 -709
- package/docs/components/badge-field.md +0 -738
- package/docs/components/badge.md +0 -301
- package/docs/components/breadcrumb.md +0 -930
- package/docs/components/button-group.md +0 -650
- package/docs/components/button.md +0 -639
- package/docs/components/calendar.md +0 -555
- package/docs/components/card.md +0 -622
- package/docs/components/chart-block-tool.md +0 -129
- package/docs/components/checkbox.md +0 -699
- package/docs/components/cn-layout.md +0 -854
- package/docs/components/color-picker.md +0 -101
- package/docs/components/conclusion-header.md +0 -80
- package/docs/components/context-menu.md +0 -483
- package/docs/components/count-badge.md +0 -560
- package/docs/components/data-table.md +0 -854
- package/docs/components/data-views/backend-response.md +0 -324
- package/docs/components/data-views/examples/a11y-rtl.md +0 -250
- package/docs/components/data-views/examples/api-orders-route.md +0 -130
- package/docs/components/data-views/examples/fields.md +0 -362
- package/docs/components/data-views/examples/filters.md +0 -307
- package/docs/components/data-views/examples/inbox-routing.md +0 -218
- package/docs/components/data-views/examples/index.md +0 -29
- package/docs/components/data-views/examples/overview.md +0 -244
- package/docs/components/data-views/examples/panel.md +0 -212
- package/docs/components/data-views/examples/scale.md +0 -231
- package/docs/components/data-views/examples/server-side.md +0 -210
- package/docs/components/data-views/examples/state.md +0 -250
- package/docs/components/data-views/examples/tree-custom.md +0 -388
- package/docs/components/data-views/examples/view-registry.md +0 -313
- package/docs/components/data-views/examples/views.md +0 -534
- package/docs/components/data-views/guide.md +0 -405
- package/docs/components/data-views/index.md +0 -1521
- package/docs/components/data-views/migration.md +0 -81
- package/docs/components/date-picker.md +0 -857
- package/docs/components/dialog.md +0 -929
- package/docs/components/divider.md +0 -766
- package/docs/components/drawer.md +0 -654
- package/docs/components/dropdown-menu.md +0 -668
- package/docs/components/field-hint.md +0 -898
- package/docs/components/field-section.md +0 -781
- package/docs/components/form-builder.md +0 -284
- package/docs/components/form-renderer.md +0 -396
- package/docs/components/form-summary.md +0 -138
- package/docs/components/form.md +0 -785
- package/docs/components/header-bar.md +0 -188
- package/docs/components/image-attachment.md +0 -906
- package/docs/components/inner-label-field.md +0 -819
- package/docs/components/input-field.md +0 -623
- package/docs/components/input-otp.md +0 -756
- package/docs/components/input.md +0 -634
- package/docs/components/label-field.md +0 -770
- package/docs/components/label.md +0 -761
- package/docs/components/labeled-check-box.md +0 -642
- package/docs/components/labeled-radio.md +0 -796
- package/docs/components/link-button.md +0 -685
- package/docs/components/login-button.md +0 -872
- package/docs/components/password-level.md +0 -803
- package/docs/components/popover.md +0 -649
- package/docs/components/profile-menu.md +0 -656
- package/docs/components/radio-card.md +0 -801
- package/docs/components/radio.md +0 -735
- package/docs/components/scroll-area.md +0 -691
- package/docs/components/search-field.md +0 -702
- package/docs/components/searchable-select.md +0 -368
- package/docs/components/searchable-table.md +0 -438
- package/docs/components/searchable-tree-dialog.md +0 -190
- package/docs/components/searchable-tree.md +0 -200
- package/docs/components/section-block.md +0 -483
- package/docs/components/select.md +0 -709
- package/docs/components/simple-select.md +0 -741
- package/docs/components/skeleton.md +0 -706
- package/docs/components/slide-date-picker.md +0 -837
- package/docs/components/spin-loading.md +0 -696
- package/docs/components/stepper.md +0 -316
- package/docs/components/switch.md +0 -770
- package/docs/components/tab-form-item.md +0 -773
- package/docs/components/tab-switch.md +0 -170
- package/docs/components/table-dnd-wrapper.md +0 -107
- package/docs/components/table.md +0 -1088
- package/docs/components/text-editor.md +0 -735
- package/docs/components/textarea.md +0 -681
- package/docs/components/timeline.md +0 -254
- package/docs/components/toast.md +0 -773
- package/docs/components/toggle-button.md +0 -643
- package/docs/components/toggle.md +0 -882
- package/docs/components/tooltip.md +0 -513
- package/docs/components/transparent-label.md +0 -721
- package/docs/components/tree-drop-down.md +0 -740
- package/docs/components/tree-folder.md +0 -110
- package/docs/components/tree-sub-layout.md +0 -707
- package/docs/explanation/architecture.md +0 -54
- package/docs/explanation/design-system.md +0 -52
- package/docs/how-to/form-and-list-recipes.md +0 -386
- package/docs/how-to/forms-with-form-builder.md +0 -472
- package/docs/how-to/guides.md +0 -1027
- package/docs/migration/changelog.md +0 -60
- package/docs/migration/form-builder-2.5.2.md +0 -113
- package/docs/reference/cli.md +0 -112
- package/docs/reference/components.md +0 -572
- package/docs/reference/hooks.md +0 -1523
- package/docs/reference/providers.md +0 -866
- package/docs/reference/tailwind-plugins.md +0 -942
- package/docs/reference/theme.md +0 -85
- package/docs/reference/types.md +0 -1016
- package/docs/reference/utilities.md +0 -726
- package/docs/tutorials/building-first-form.md +0 -846
- package/docs/tutorials/component-composition.md +0 -882
- package/docs/tutorials/getting-started.md +0 -302
- package/docs/tutorials/theming-basics.md +0 -785
|
@@ -1,708 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: ActionsGroup
|
|
3
|
-
description: Container component for grouping action buttons with optional dividers.
|
|
4
|
-
component: true
|
|
5
|
-
group: Layout & Containers
|
|
6
|
-
keywords: [actions, buttons, group, container, toolbar, divider]
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# ActionsGroup
|
|
10
|
-
|
|
11
|
-
A flexible container component for grouping action buttons and controls with optional decorative dividers. Perfect for creating organized toolbars, button groups, and action panels.
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
TORCH Glare is a copy-in library: the CLI copies this component's source into your project
|
|
16
|
-
(you do **not** install it from the npm package). Run `init` once, then `add`:
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npx torch-glare@latest init
|
|
20
|
-
npx torch-glare@latest add ActionsGroup
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
`add` also copies any components, hooks, and utilities that `ActionsGroup` depends on.
|
|
24
|
-
|
|
25
|
-
## Imports
|
|
26
|
-
|
|
27
|
-
```typescript
|
|
28
|
-
import ActionsGroup from '@/components/ActionsGroup'
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
## Basic Usage
|
|
32
|
-
|
|
33
|
-
```tsx
|
|
34
|
-
import ActionsGroup from '@/components/ActionsGroup'
|
|
35
|
-
import { Button } from '@/components/Button'
|
|
36
|
-
|
|
37
|
-
export function BasicActionsGroup() {
|
|
38
|
-
return (
|
|
39
|
-
<ActionsGroup>
|
|
40
|
-
<Button variant="PrimeStyle">Save</Button>
|
|
41
|
-
<Button variant="BluSecStyle">Cancel</Button>
|
|
42
|
-
</ActionsGroup>
|
|
43
|
-
)
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## Examples
|
|
48
|
-
|
|
49
|
-
### With Dividers
|
|
50
|
-
|
|
51
|
-
Add decorative dividers on both sides of the action group.
|
|
52
|
-
|
|
53
|
-
```tsx
|
|
54
|
-
export function ActionsWithDividers() {
|
|
55
|
-
return (
|
|
56
|
-
<div className="p-6 border rounded-lg">
|
|
57
|
-
<h2 className="text-xl font-bold mb-4">Document Settings</h2>
|
|
58
|
-
<p className="mb-6">Configure your document preferences below.</p>
|
|
59
|
-
|
|
60
|
-
<ActionsGroup withDivider>
|
|
61
|
-
<Button variant="PrimeStyle" size="M">
|
|
62
|
-
<i className="ri-save-line mr-2"></i>
|
|
63
|
-
Save Changes
|
|
64
|
-
</Button>
|
|
65
|
-
<Button variant="BluSecStyle" size="M">
|
|
66
|
-
<i className="ri-close-line mr-2"></i>
|
|
67
|
-
Discard
|
|
68
|
-
</Button>
|
|
69
|
-
</ActionsGroup>
|
|
70
|
-
</div>
|
|
71
|
-
)
|
|
72
|
-
}
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### Form Actions
|
|
76
|
-
|
|
77
|
-
Standard form submit and cancel actions.
|
|
78
|
-
|
|
79
|
-
```tsx
|
|
80
|
-
export function FormActions() {
|
|
81
|
-
return (
|
|
82
|
-
<form className="space-y-4 max-w-2xl">
|
|
83
|
-
<div>
|
|
84
|
-
<label className="block mb-2">Project Name</label>
|
|
85
|
-
<InputField placeholder="Enter project name" className="w-full" />
|
|
86
|
-
</div>
|
|
87
|
-
|
|
88
|
-
<div>
|
|
89
|
-
<label className="block mb-2">Description</label>
|
|
90
|
-
<TextAreaInput
|
|
91
|
-
placeholder="Enter description"
|
|
92
|
-
rows={4}
|
|
93
|
-
className="w-full"
|
|
94
|
-
/>
|
|
95
|
-
</div>
|
|
96
|
-
|
|
97
|
-
<ActionsGroup className="justify-end">
|
|
98
|
-
<Button variant="BluSecStyle" type="button">
|
|
99
|
-
Cancel
|
|
100
|
-
</Button>
|
|
101
|
-
<Button variant="PrimeStyle" type="submit">
|
|
102
|
-
Create Project
|
|
103
|
-
</Button>
|
|
104
|
-
</ActionsGroup>
|
|
105
|
-
</form>
|
|
106
|
-
)
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### Modal Footer Actions
|
|
111
|
-
|
|
112
|
-
Actions in modal or dialog footers.
|
|
113
|
-
|
|
114
|
-
```tsx
|
|
115
|
-
export function ModalFooterActions() {
|
|
116
|
-
return (
|
|
117
|
-
<div className="max-w-lg border rounded-lg shadow-lg">
|
|
118
|
-
{/* Modal Header */}
|
|
119
|
-
<div className="p-6 border-b">
|
|
120
|
-
<h3 className="text-xl font-bold">Delete Confirmation</h3>
|
|
121
|
-
</div>
|
|
122
|
-
|
|
123
|
-
{/* Modal Content */}
|
|
124
|
-
<div className="p-6">
|
|
125
|
-
<p>
|
|
126
|
-
Are you sure you want to delete this item? This action cannot be undone.
|
|
127
|
-
</p>
|
|
128
|
-
</div>
|
|
129
|
-
|
|
130
|
-
{/* Modal Footer */}
|
|
131
|
-
<ActionsGroup withDivider className="p-6 justify-end">
|
|
132
|
-
<Button variant="BluSecStyle">
|
|
133
|
-
Cancel
|
|
134
|
-
</Button>
|
|
135
|
-
<Button variant="RedSecStyle">
|
|
136
|
-
<i className="ri-delete-bin-line mr-2"></i>
|
|
137
|
-
Delete
|
|
138
|
-
</Button>
|
|
139
|
-
</ActionsGroup>
|
|
140
|
-
</div>
|
|
141
|
-
)
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Multi-Action Groups
|
|
146
|
-
|
|
147
|
-
Multiple action groups with different purposes.
|
|
148
|
-
|
|
149
|
-
```tsx
|
|
150
|
-
export function MultiActionGroups() {
|
|
151
|
-
return (
|
|
152
|
-
<div className="border rounded-lg">
|
|
153
|
-
<div className="p-4 border-b">
|
|
154
|
-
<h3 className="font-semibold">Document Editor</h3>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
<div className="p-4 space-y-4">
|
|
158
|
-
{/* Primary Actions */}
|
|
159
|
-
<ActionsGroup className="justify-between">
|
|
160
|
-
<div className="flex gap-2">
|
|
161
|
-
<Button variant="PrimeStyle" size="S">
|
|
162
|
-
<i className="ri-save-line mr-2"></i>
|
|
163
|
-
Save
|
|
164
|
-
</Button>
|
|
165
|
-
<Button variant="BluSecStyle" size="S">
|
|
166
|
-
<i className="ri-file-copy-line mr-2"></i>
|
|
167
|
-
Duplicate
|
|
168
|
-
</Button>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<Button variant="BluSecStyle" size="S">
|
|
172
|
-
<i className="ri-more-2-fill"></i>
|
|
173
|
-
</Button>
|
|
174
|
-
</ActionsGroup>
|
|
175
|
-
|
|
176
|
-
{/* Secondary Actions */}
|
|
177
|
-
<ActionsGroup withDivider>
|
|
178
|
-
<Button variant="BluSecStyle" size="S">
|
|
179
|
-
<i className="ri-share-line mr-2"></i>
|
|
180
|
-
Share
|
|
181
|
-
</Button>
|
|
182
|
-
<Button variant="BluSecStyle" size="S">
|
|
183
|
-
<i className="ri-download-line mr-2"></i>
|
|
184
|
-
Export
|
|
185
|
-
</Button>
|
|
186
|
-
<Button variant="BluSecStyle" size="S">
|
|
187
|
-
<i className="ri-printer-line mr-2"></i>
|
|
188
|
-
Print
|
|
189
|
-
</Button>
|
|
190
|
-
</ActionsGroup>
|
|
191
|
-
|
|
192
|
-
{/* Danger Zone */}
|
|
193
|
-
<ActionsGroup withDivider>
|
|
194
|
-
<Button variant="RedSecStyle" size="S" className="w-full">
|
|
195
|
-
<i className="ri-delete-bin-line mr-2"></i>
|
|
196
|
-
Delete Document
|
|
197
|
-
</Button>
|
|
198
|
-
</ActionsGroup>
|
|
199
|
-
</div>
|
|
200
|
-
</div>
|
|
201
|
-
)
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### Card Actions
|
|
206
|
-
|
|
207
|
-
Action buttons within cards.
|
|
208
|
-
|
|
209
|
-
```tsx
|
|
210
|
-
export function CardActions() {
|
|
211
|
-
return (
|
|
212
|
-
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
213
|
-
{[1, 2, 3, 4].map(id => (
|
|
214
|
-
<div key={id} className="border rounded-lg overflow-hidden">
|
|
215
|
-
<div className="aspect-video bg-gradient-to-br from-blue-400 to-purple-500"></div>
|
|
216
|
-
|
|
217
|
-
<div className="p-4">
|
|
218
|
-
<h3 className="font-bold text-lg mb-2">Project {id}</h3>
|
|
219
|
-
<p className="text-sm text-content-presentation-global-secondary mb-4">
|
|
220
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
221
|
-
</p>
|
|
222
|
-
|
|
223
|
-
<ActionsGroup className="justify-end">
|
|
224
|
-
<Button variant="BluSecStyle" size="S">
|
|
225
|
-
View
|
|
226
|
-
</Button>
|
|
227
|
-
<Button variant="PrimeStyle" size="S">
|
|
228
|
-
Edit
|
|
229
|
-
</Button>
|
|
230
|
-
</ActionsGroup>
|
|
231
|
-
</div>
|
|
232
|
-
</div>
|
|
233
|
-
))}
|
|
234
|
-
</div>
|
|
235
|
-
)
|
|
236
|
-
}
|
|
237
|
-
```
|
|
238
|
-
|
|
239
|
-
### Toolbar Actions
|
|
240
|
-
|
|
241
|
-
Grouped toolbar controls.
|
|
242
|
-
|
|
243
|
-
```tsx
|
|
244
|
-
export function ToolbarActions() {
|
|
245
|
-
return (
|
|
246
|
-
<div className="border rounded-lg p-2 bg-background-system-body-secondary">
|
|
247
|
-
<div className="flex items-center gap-2">
|
|
248
|
-
{/* Text Formatting Group */}
|
|
249
|
-
<ActionsGroup>
|
|
250
|
-
<ActionButton size="S" title="Bold">
|
|
251
|
-
<i className="ri-bold"></i>
|
|
252
|
-
</ActionButton>
|
|
253
|
-
<ActionButton size="S" title="Italic">
|
|
254
|
-
<i className="ri-italic"></i>
|
|
255
|
-
</ActionButton>
|
|
256
|
-
<ActionButton size="S" title="Underline">
|
|
257
|
-
<i className="ri-underline"></i>
|
|
258
|
-
</ActionButton>
|
|
259
|
-
</ActionsGroup>
|
|
260
|
-
|
|
261
|
-
<Divider orientation="vertical" className="h-6" />
|
|
262
|
-
|
|
263
|
-
{/* Alignment Group */}
|
|
264
|
-
<ActionsGroup>
|
|
265
|
-
<ActionButton size="S" title="Align Left">
|
|
266
|
-
<i className="ri-align-left"></i>
|
|
267
|
-
</ActionButton>
|
|
268
|
-
<ActionButton size="S" title="Align Center">
|
|
269
|
-
<i className="ri-align-center"></i>
|
|
270
|
-
</ActionButton>
|
|
271
|
-
<ActionButton size="S" title="Align Right">
|
|
272
|
-
<i className="ri-align-right"></i>
|
|
273
|
-
</ActionButton>
|
|
274
|
-
</ActionsGroup>
|
|
275
|
-
|
|
276
|
-
<Divider orientation="vertical" className="h-6" />
|
|
277
|
-
|
|
278
|
-
{/* List Group */}
|
|
279
|
-
<ActionsGroup>
|
|
280
|
-
<ActionButton size="S" title="Bullet List">
|
|
281
|
-
<i className="ri-list-unordered"></i>
|
|
282
|
-
</ActionButton>
|
|
283
|
-
<ActionButton size="S" title="Numbered List">
|
|
284
|
-
<i className="ri-list-ordered"></i>
|
|
285
|
-
</ActionButton>
|
|
286
|
-
</ActionsGroup>
|
|
287
|
-
|
|
288
|
-
<div className="flex-1" />
|
|
289
|
-
|
|
290
|
-
{/* Save Group */}
|
|
291
|
-
<ActionsGroup>
|
|
292
|
-
<Button variant="BluSecStyle" size="S">
|
|
293
|
-
Preview
|
|
294
|
-
</Button>
|
|
295
|
-
<Button variant="PrimeStyle" size="S">
|
|
296
|
-
Publish
|
|
297
|
-
</Button>
|
|
298
|
-
</ActionsGroup>
|
|
299
|
-
</div>
|
|
300
|
-
</div>
|
|
301
|
-
)
|
|
302
|
-
}
|
|
303
|
-
```
|
|
304
|
-
|
|
305
|
-
### Wizard Navigation
|
|
306
|
-
|
|
307
|
-
Multi-step form navigation.
|
|
308
|
-
|
|
309
|
-
```tsx
|
|
310
|
-
export function WizardNavigation() {
|
|
311
|
-
const [currentStep, setCurrentStep] = useState(1)
|
|
312
|
-
const totalSteps = 3
|
|
313
|
-
|
|
314
|
-
return (
|
|
315
|
-
<div className="max-w-2xl">
|
|
316
|
-
{/* Step Content */}
|
|
317
|
-
<div className="border rounded-lg p-6 mb-4">
|
|
318
|
-
<h2 className="text-xl font-bold mb-4">Step {currentStep} of {totalSteps}</h2>
|
|
319
|
-
|
|
320
|
-
{currentStep === 1 && (
|
|
321
|
-
<div>
|
|
322
|
-
<h3 className="font-semibold mb-2">Personal Information</h3>
|
|
323
|
-
{/* Form fields */}
|
|
324
|
-
</div>
|
|
325
|
-
)}
|
|
326
|
-
|
|
327
|
-
{currentStep === 2 && (
|
|
328
|
-
<div>
|
|
329
|
-
<h3 className="font-semibold mb-2">Contact Details</h3>
|
|
330
|
-
{/* Form fields */}
|
|
331
|
-
</div>
|
|
332
|
-
)}
|
|
333
|
-
|
|
334
|
-
{currentStep === 3 && (
|
|
335
|
-
<div>
|
|
336
|
-
<h3 className="font-semibold mb-2">Review & Submit</h3>
|
|
337
|
-
{/* Review content */}
|
|
338
|
-
</div>
|
|
339
|
-
)}
|
|
340
|
-
</div>
|
|
341
|
-
|
|
342
|
-
{/* Navigation Actions */}
|
|
343
|
-
<ActionsGroup className="justify-between">
|
|
344
|
-
<Button
|
|
345
|
-
variant="BluSecStyle"
|
|
346
|
-
disabled={currentStep === 1}
|
|
347
|
-
onClick={() => setCurrentStep(currentStep - 1)}
|
|
348
|
-
>
|
|
349
|
-
<i className="ri-arrow-left-line mr-2"></i>
|
|
350
|
-
Previous
|
|
351
|
-
</Button>
|
|
352
|
-
|
|
353
|
-
{currentStep < totalSteps ? (
|
|
354
|
-
<Button
|
|
355
|
-
variant="PrimeStyle"
|
|
356
|
-
onClick={() => setCurrentStep(currentStep + 1)}
|
|
357
|
-
>
|
|
358
|
-
Next
|
|
359
|
-
<i className="ri-arrow-right-line ml-2"></i>
|
|
360
|
-
</Button>
|
|
361
|
-
) : (
|
|
362
|
-
<Button variant="PrimeStyle">
|
|
363
|
-
<i className="ri-check-line mr-2"></i>
|
|
364
|
-
Submit
|
|
365
|
-
</Button>
|
|
366
|
-
)}
|
|
367
|
-
</ActionsGroup>
|
|
368
|
-
</div>
|
|
369
|
-
)
|
|
370
|
-
}
|
|
371
|
-
```
|
|
372
|
-
|
|
373
|
-
### Confirmation Dialog
|
|
374
|
-
|
|
375
|
-
Confirmation actions with clear primary/secondary hierarchy.
|
|
376
|
-
|
|
377
|
-
```tsx
|
|
378
|
-
export function ConfirmationDialog({ title, message, onConfirm, onCancel }) {
|
|
379
|
-
return (
|
|
380
|
-
<div className="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4">
|
|
381
|
-
<div className="bg-white rounded-lg max-w-md w-full">
|
|
382
|
-
<div className="p-6">
|
|
383
|
-
<div className="flex items-start gap-4 mb-4">
|
|
384
|
-
<div className="w-12 h-12 rounded-full bg-yellow-100 flex items-center justify-center flex-shrink-0">
|
|
385
|
-
<i className="ri-alert-line text-2xl text-yellow-600"></i>
|
|
386
|
-
</div>
|
|
387
|
-
<div>
|
|
388
|
-
<h3 className="font-bold text-lg mb-2">{title}</h3>
|
|
389
|
-
<p className="text-content-presentation-global-secondary">
|
|
390
|
-
{message}
|
|
391
|
-
</p>
|
|
392
|
-
</div>
|
|
393
|
-
</div>
|
|
394
|
-
</div>
|
|
395
|
-
|
|
396
|
-
<ActionsGroup withDivider className="p-6 justify-end gap-3">
|
|
397
|
-
<Button variant="BluSecStyle" onClick={onCancel}>
|
|
398
|
-
Cancel
|
|
399
|
-
</Button>
|
|
400
|
-
<Button variant="RedSecStyle" onClick={onConfirm}>
|
|
401
|
-
Confirm
|
|
402
|
-
</Button>
|
|
403
|
-
</ActionsGroup>
|
|
404
|
-
</div>
|
|
405
|
-
</div>
|
|
406
|
-
)
|
|
407
|
-
}
|
|
408
|
-
```
|
|
409
|
-
|
|
410
|
-
### Table Row Actions
|
|
411
|
-
|
|
412
|
-
Inline actions for table rows.
|
|
413
|
-
|
|
414
|
-
```tsx
|
|
415
|
-
export function TableRowActions() {
|
|
416
|
-
const users = [
|
|
417
|
-
{ id: 1, name: 'John Doe', email: 'john@example.com', role: 'Admin' },
|
|
418
|
-
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', role: 'User' },
|
|
419
|
-
// ... more users
|
|
420
|
-
]
|
|
421
|
-
|
|
422
|
-
return (
|
|
423
|
-
<div className="border rounded-lg overflow-hidden">
|
|
424
|
-
<table className="w-full">
|
|
425
|
-
<thead className="bg-background-presentation-global-secondary">
|
|
426
|
-
<tr>
|
|
427
|
-
<th className="p-3 text-left">Name</th>
|
|
428
|
-
<th className="p-3 text-left">Email</th>
|
|
429
|
-
<th className="p-3 text-left">Role</th>
|
|
430
|
-
<th className="p-3 text-right">Actions</th>
|
|
431
|
-
</tr>
|
|
432
|
-
</thead>
|
|
433
|
-
<tbody>
|
|
434
|
-
{users.map(user => (
|
|
435
|
-
<tr key={user.id} className="border-t">
|
|
436
|
-
<td className="p-3">{user.name}</td>
|
|
437
|
-
<td className="p-3">{user.email}</td>
|
|
438
|
-
<td className="p-3">{user.role}</td>
|
|
439
|
-
<td className="p-3">
|
|
440
|
-
<ActionsGroup className="justify-end">
|
|
441
|
-
<ActionButton size="XS" title="Edit">
|
|
442
|
-
<i className="ri-pencil-line"></i>
|
|
443
|
-
</ActionButton>
|
|
444
|
-
<ActionButton size="XS" title="Delete">
|
|
445
|
-
<i className="ri-delete-bin-line"></i>
|
|
446
|
-
</ActionButton>
|
|
447
|
-
</ActionsGroup>
|
|
448
|
-
</td>
|
|
449
|
-
</tr>
|
|
450
|
-
))}
|
|
451
|
-
</tbody>
|
|
452
|
-
</table>
|
|
453
|
-
</div>
|
|
454
|
-
)
|
|
455
|
-
}
|
|
456
|
-
```
|
|
457
|
-
|
|
458
|
-
### Loading States
|
|
459
|
-
|
|
460
|
-
Action groups with loading indicators.
|
|
461
|
-
|
|
462
|
-
```tsx
|
|
463
|
-
export function LoadingActions() {
|
|
464
|
-
const [isLoading, setIsLoading] = useState(false)
|
|
465
|
-
|
|
466
|
-
const handleSave = async () => {
|
|
467
|
-
setIsLoading(true)
|
|
468
|
-
await saveData()
|
|
469
|
-
setIsLoading(false)
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
return (
|
|
473
|
-
<ActionsGroup className="justify-end">
|
|
474
|
-
<Button
|
|
475
|
-
variant="BluSecStyle"
|
|
476
|
-
disabled={isLoading}
|
|
477
|
-
>
|
|
478
|
-
Cancel
|
|
479
|
-
</Button>
|
|
480
|
-
<Button
|
|
481
|
-
variant="PrimeStyle"
|
|
482
|
-
onClick={handleSave}
|
|
483
|
-
disabled={isLoading}
|
|
484
|
-
>
|
|
485
|
-
{isLoading ? (
|
|
486
|
-
<>
|
|
487
|
-
<i className="ri-loader-4-line animate-spin mr-2"></i>
|
|
488
|
-
Saving...
|
|
489
|
-
</>
|
|
490
|
-
) : (
|
|
491
|
-
<>
|
|
492
|
-
<i className="ri-save-line mr-2"></i>
|
|
493
|
-
Save
|
|
494
|
-
</>
|
|
495
|
-
)}
|
|
496
|
-
</Button>
|
|
497
|
-
</ActionsGroup>
|
|
498
|
-
)
|
|
499
|
-
}
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
## API Reference
|
|
503
|
-
|
|
504
|
-
### ActionsGroup Props
|
|
505
|
-
|
|
506
|
-
Extends all HTML div element props.
|
|
507
|
-
|
|
508
|
-
| Prop | Type | Default | Description |
|
|
509
|
-
|------|------|---------|-------------|
|
|
510
|
-
| withDivider | `boolean` | `false` | Show dividers on both sides |
|
|
511
|
-
| theme | `Themes` | - | Theme override |
|
|
512
|
-
| className | `string` | - | Additional CSS classes |
|
|
513
|
-
| children | `ReactNode` | - | Action buttons and controls |
|
|
514
|
-
|
|
515
|
-
## Styling
|
|
516
|
-
|
|
517
|
-
### Default Styles
|
|
518
|
-
|
|
519
|
-
- **Display**: Flex container
|
|
520
|
-
- **Alignment**: Items centered
|
|
521
|
-
- **Gap**: 8px (0.5rem) between children
|
|
522
|
-
- **Width**: Full width by default
|
|
523
|
-
|
|
524
|
-
### Common Customizations
|
|
525
|
-
|
|
526
|
-
```tsx
|
|
527
|
-
// Right-aligned actions
|
|
528
|
-
<ActionsGroup className="justify-end" />
|
|
529
|
-
|
|
530
|
-
// Spaced between
|
|
531
|
-
<ActionsGroup className="justify-between" />
|
|
532
|
-
|
|
533
|
-
// Centered actions
|
|
534
|
-
<ActionsGroup className="justify-center" />
|
|
535
|
-
|
|
536
|
-
// Custom gap
|
|
537
|
-
<ActionsGroup className="gap-4" />
|
|
538
|
-
|
|
539
|
-
// Vertical stacking (mobile)
|
|
540
|
-
<ActionsGroup className="flex-col md:flex-row" />
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
## TypeScript Types
|
|
544
|
-
|
|
545
|
-
```typescript
|
|
546
|
-
interface ActionsGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
547
|
-
withDivider?: boolean
|
|
548
|
-
theme?: Themes
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
type Themes = 'light' | 'dark' | 'default'
|
|
552
|
-
```
|
|
553
|
-
|
|
554
|
-
## Common Patterns
|
|
555
|
-
|
|
556
|
-
### Responsive Actions
|
|
557
|
-
|
|
558
|
-
```tsx
|
|
559
|
-
function ResponsiveActions() {
|
|
560
|
-
return (
|
|
561
|
-
<ActionsGroup className="flex-col sm:flex-row justify-end">
|
|
562
|
-
<Button variant="BluSecStyle" className="w-full sm:w-auto">
|
|
563
|
-
Cancel
|
|
564
|
-
</Button>
|
|
565
|
-
<Button variant="PrimeStyle" className="w-full sm:w-auto">
|
|
566
|
-
Save
|
|
567
|
-
</Button>
|
|
568
|
-
</ActionsGroup>
|
|
569
|
-
)
|
|
570
|
-
}
|
|
571
|
-
```
|
|
572
|
-
|
|
573
|
-
### Grouped with Spacing
|
|
574
|
-
|
|
575
|
-
```tsx
|
|
576
|
-
function GroupedActions() {
|
|
577
|
-
return (
|
|
578
|
-
<div className="space-y-4">
|
|
579
|
-
<ActionsGroup withDivider>
|
|
580
|
-
<Button>Action 1</Button>
|
|
581
|
-
<Button>Action 2</Button>
|
|
582
|
-
</ActionsGroup>
|
|
583
|
-
|
|
584
|
-
<ActionsGroup withDivider>
|
|
585
|
-
<Button variant="RedSecStyle" className="w-full">
|
|
586
|
-
Dangerous Action
|
|
587
|
-
</Button>
|
|
588
|
-
</ActionsGroup>
|
|
589
|
-
</div>
|
|
590
|
-
)
|
|
591
|
-
}
|
|
592
|
-
```
|
|
593
|
-
|
|
594
|
-
## Testing
|
|
595
|
-
|
|
596
|
-
```typescript
|
|
597
|
-
import { render, screen, fireEvent } from '@testing-library/react'
|
|
598
|
-
import ActionsGroup from '@/components/ActionsGroup'
|
|
599
|
-
import { Button } from '@/components/Button'
|
|
600
|
-
|
|
601
|
-
describe('ActionsGroup', () => {
|
|
602
|
-
it('renders children correctly', () => {
|
|
603
|
-
render(
|
|
604
|
-
<ActionsGroup>
|
|
605
|
-
<Button>Save</Button>
|
|
606
|
-
<Button>Cancel</Button>
|
|
607
|
-
</ActionsGroup>
|
|
608
|
-
)
|
|
609
|
-
|
|
610
|
-
expect(screen.getByText('Save')).toBeInTheDocument()
|
|
611
|
-
expect(screen.getByText('Cancel')).toBeInTheDocument()
|
|
612
|
-
})
|
|
613
|
-
|
|
614
|
-
it('shows dividers when withDivider is true', () => {
|
|
615
|
-
const { container } = render(
|
|
616
|
-
<ActionsGroup withDivider>
|
|
617
|
-
<Button>Action</Button>
|
|
618
|
-
</ActionsGroup>
|
|
619
|
-
)
|
|
620
|
-
|
|
621
|
-
const dividers = container.querySelectorAll('[role="none"]')
|
|
622
|
-
expect(dividers).toHaveLength(2)
|
|
623
|
-
})
|
|
624
|
-
|
|
625
|
-
it('applies custom className', () => {
|
|
626
|
-
const { container } = render(
|
|
627
|
-
<ActionsGroup className="justify-end">
|
|
628
|
-
<Button>Action</Button>
|
|
629
|
-
</ActionsGroup>
|
|
630
|
-
)
|
|
631
|
-
|
|
632
|
-
expect(container.firstChild).toHaveClass('justify-end')
|
|
633
|
-
})
|
|
634
|
-
|
|
635
|
-
it('handles button clicks', () => {
|
|
636
|
-
const handleClick = jest.fn()
|
|
637
|
-
|
|
638
|
-
render(
|
|
639
|
-
<ActionsGroup>
|
|
640
|
-
<Button onClick={handleClick}>Click Me</Button>
|
|
641
|
-
</ActionsGroup>
|
|
642
|
-
)
|
|
643
|
-
|
|
644
|
-
fireEvent.click(screen.getByText('Click Me'))
|
|
645
|
-
expect(handleClick).toHaveBeenCalledTimes(1)
|
|
646
|
-
})
|
|
647
|
-
})
|
|
648
|
-
```
|
|
649
|
-
|
|
650
|
-
## Accessibility
|
|
651
|
-
|
|
652
|
-
- **Semantic HTML**: Uses section element
|
|
653
|
-
- **Keyboard Navigation**: All buttons are keyboard accessible
|
|
654
|
-
- **Focus Management**: Proper tab order through actions
|
|
655
|
-
- **Screen Reader**: Actions are announced correctly
|
|
656
|
-
- **Visual Hierarchy**: Clear primary/secondary action distinction
|
|
657
|
-
|
|
658
|
-
## Performance
|
|
659
|
-
|
|
660
|
-
- **Lightweight**: Minimal overhead (simple flex container)
|
|
661
|
-
- **No Re-renders**: Static container, children control their own state
|
|
662
|
-
- **Bundle Size**: ~0.2 KB gzipped
|
|
663
|
-
- **CSS-Only Layout**: Uses flexbox for efficient layout
|
|
664
|
-
|
|
665
|
-
## Migration Guide
|
|
666
|
-
|
|
667
|
-
### From Custom Container
|
|
668
|
-
|
|
669
|
-
```tsx
|
|
670
|
-
// Before: Custom div
|
|
671
|
-
<div className="flex items-center gap-2">
|
|
672
|
-
<button>Save</button>
|
|
673
|
-
<button>Cancel</button>
|
|
674
|
-
</div>
|
|
675
|
-
|
|
676
|
-
// After: ActionsGroup
|
|
677
|
-
<ActionsGroup>
|
|
678
|
-
<Button>Save</Button>
|
|
679
|
-
<Button>Cancel</Button>
|
|
680
|
-
</ActionsGroup>
|
|
681
|
-
```
|
|
682
|
-
|
|
683
|
-
### From Other Libraries
|
|
684
|
-
|
|
685
|
-
```tsx
|
|
686
|
-
// Before: Material-UI DialogActions
|
|
687
|
-
<DialogActions>
|
|
688
|
-
<Button>Cancel</Button>
|
|
689
|
-
<Button>Save</Button>
|
|
690
|
-
</DialogActions>
|
|
691
|
-
|
|
692
|
-
// After: ActionsGroup
|
|
693
|
-
<ActionsGroup className="justify-end">
|
|
694
|
-
<Button>Cancel</Button>
|
|
695
|
-
<Button>Save</Button>
|
|
696
|
-
</ActionsGroup>
|
|
697
|
-
```
|
|
698
|
-
|
|
699
|
-
## Best Practices
|
|
700
|
-
|
|
701
|
-
1. **Consistent Alignment**: Use `justify-end` for form actions
|
|
702
|
-
2. **Primary Action Last**: Place primary action on the right (or bottom on mobile)
|
|
703
|
-
3. **Limit Actions**: Keep 2-4 actions per group for clarity
|
|
704
|
-
4. **Clear Hierarchy**: Use variant styling to indicate primary vs secondary
|
|
705
|
-
5. **Loading States**: Disable all actions during async operations
|
|
706
|
-
6. **Responsive Design**: Stack vertically on mobile if needed
|
|
707
|
-
7. **Dividers**: Use `withDivider` sparingly for emphasis
|
|
708
|
-
8. **Icon Usage**: Add icons to clarify action purpose
|