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,60 +0,0 @@
|
|
|
1
|
-
declare module "@editorjs/checklist" {
|
|
2
|
-
import { BlockToolConstructable } from "@editorjs/editorjs";
|
|
3
|
-
const Checklist: BlockToolConstructable;
|
|
4
|
-
export default Checklist;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
declare module "@editorjs/embed" {
|
|
8
|
-
import { BlockToolConstructable } from "@editorjs/editorjs";
|
|
9
|
-
const Embed: BlockToolConstructable;
|
|
10
|
-
export default Embed;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
declare module "@editorjs/link" {
|
|
14
|
-
import { BlockToolConstructable } from "@editorjs/editorjs";
|
|
15
|
-
const LinkTool: BlockToolConstructable;
|
|
16
|
-
export default LinkTool;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
declare module "@editorjs/simple-image" {
|
|
20
|
-
import { BlockToolConstructable } from "@editorjs/editorjs";
|
|
21
|
-
const SimpleImage: BlockToolConstructable;
|
|
22
|
-
export default SimpleImage;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare module "@editorjs/raw" {
|
|
26
|
-
import { BlockToolConstructable } from "@editorjs/editorjs";
|
|
27
|
-
const RawTool: BlockToolConstructable;
|
|
28
|
-
export default RawTool;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
declare module "@editorjs/marker" {
|
|
32
|
-
import { InlineToolConstructable } from "@editorjs/editorjs";
|
|
33
|
-
const Marker: InlineToolConstructable;
|
|
34
|
-
export default Marker;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare module "@editorjs/text-variant-tune" {
|
|
38
|
-
import { BlockTuneConstructable } from "@editorjs/editorjs";
|
|
39
|
-
const TextVariantTune: BlockTuneConstructable;
|
|
40
|
-
export default TextVariantTune;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
declare module "editorjs-undo" {
|
|
44
|
-
import EditorJS from "@editorjs/editorjs";
|
|
45
|
-
interface UndoConfig {
|
|
46
|
-
editor: EditorJS;
|
|
47
|
-
config?: { debounceTimer?: number; shortcuts?: { undo?: string; redo?: string } };
|
|
48
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
-
onUpdate?: () => void;
|
|
50
|
-
}
|
|
51
|
-
export default class Undo {
|
|
52
|
-
constructor(options: UndoConfig);
|
|
53
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
-
initialize(data: any): void;
|
|
55
|
-
undo(): void;
|
|
56
|
-
redo(): void;
|
|
57
|
-
clear(): void;
|
|
58
|
-
setReadOnly(readOnly: boolean): void;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export { TextEditor } from "./TextEditor";
|
|
2
|
-
export type { TextEditorRef, TextEditorProps, OutputData } from "./TextEditor";
|
|
3
|
-
export { RichTextField } from "./RichTextField";
|
|
4
|
-
export type { RichTextFieldProps } from "./RichTextField";
|
|
5
|
-
export { default as ChartBlockTool, type ChartBlockData } from "./ChartBlockTool";
|
|
6
|
-
export { default as createTableDnDClass } from "./TableDnDWrapper";
|
|
7
|
-
export { TextEditorToolbar } from "./TextEditorToolbar";
|
|
@@ -1,346 +0,0 @@
|
|
|
1
|
-
// ─── Markdown → Editor.js Block Parser ───────────────────────────────────────
|
|
2
|
-
// Parses pasted markdown text into Editor.js-compatible block data.
|
|
3
|
-
|
|
4
|
-
export interface EditorBlock {
|
|
5
|
-
type: string;
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
-
data: Record<string, any>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// ─── Markdown Detection ──────────────────────────────────────────────────────
|
|
11
|
-
|
|
12
|
-
const MD_PATTERNS = {
|
|
13
|
-
header: /^#{1,6}\s+\S/m,
|
|
14
|
-
unorderedList: /^[\t ]*[-*+]\s+\S/m,
|
|
15
|
-
orderedList: /^[\t ]*\d+\.\s+\S/m,
|
|
16
|
-
checklist: /^[\t ]*-\s+\[[ xX]\]\s/m,
|
|
17
|
-
codeBlock: /^```/m,
|
|
18
|
-
blockquote: /^>\s/m,
|
|
19
|
-
horizontalRule: /^(---+|___+|\*\*\*+)\s*$/m,
|
|
20
|
-
table: /^\|(.+\|)+\s*$/m,
|
|
21
|
-
image: /^!\[.*\]\(.+\)/m,
|
|
22
|
-
link: /\[.+\]\(.+\)/,
|
|
23
|
-
bold: /\*\*[^*]+\*\*/,
|
|
24
|
-
italic: /(?<!\*)\*[^*]+\*(?!\*)/,
|
|
25
|
-
inlineCode: /`[^`]+`/,
|
|
26
|
-
strikethrough: /~~[^~]+~~/,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Heuristic: determines whether the given text is likely markdown.
|
|
31
|
-
* Returns true if the text matches enough markdown-specific patterns.
|
|
32
|
-
*/
|
|
33
|
-
export function isMarkdown(text: string): boolean {
|
|
34
|
-
if (!text || text.trim().length === 0) return false;
|
|
35
|
-
|
|
36
|
-
const lines = text.split("\n");
|
|
37
|
-
// Single short line without strong indicators → probably not markdown
|
|
38
|
-
if (lines.length === 1 && text.length < 80) {
|
|
39
|
-
// Only if it has a very strong indicator on a single line
|
|
40
|
-
return MD_PATTERNS.header.test(text) || MD_PATTERNS.image.test(text);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
let score = 0;
|
|
44
|
-
const strongIndicators = [
|
|
45
|
-
"header",
|
|
46
|
-
"codeBlock",
|
|
47
|
-
"table",
|
|
48
|
-
"horizontalRule",
|
|
49
|
-
"checklist",
|
|
50
|
-
"image",
|
|
51
|
-
] as const;
|
|
52
|
-
const weakIndicators = [
|
|
53
|
-
"unorderedList",
|
|
54
|
-
"orderedList",
|
|
55
|
-
"blockquote",
|
|
56
|
-
"bold",
|
|
57
|
-
"italic",
|
|
58
|
-
"inlineCode",
|
|
59
|
-
"strikethrough",
|
|
60
|
-
"link",
|
|
61
|
-
] as const;
|
|
62
|
-
|
|
63
|
-
for (const key of strongIndicators) {
|
|
64
|
-
if (MD_PATTERNS[key].test(text)) score += 2;
|
|
65
|
-
}
|
|
66
|
-
for (const key of weakIndicators) {
|
|
67
|
-
if (MD_PATTERNS[key].test(text)) score += 1;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Need at least score 2 (one strong indicator or two weak ones)
|
|
71
|
-
return score >= 2;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// ─── Inline Markdown → HTML ──────────────────────────────────────────────────
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Converts inline markdown syntax to HTML tags understood by Editor.js.
|
|
78
|
-
* Order matters — bold before italic to handle ** vs *.
|
|
79
|
-
*/
|
|
80
|
-
export function convertInlineMarkdown(text: string): string {
|
|
81
|
-
let result = text;
|
|
82
|
-
|
|
83
|
-
// Images inline (rare in inline context but handle gracefully)
|
|
84
|
-
result = result.replace(/!\[([^\]]*)\]\(([^)]+)\)/g, '<img src="$2" alt="$1">');
|
|
85
|
-
|
|
86
|
-
// Links: [text](url)
|
|
87
|
-
result = result.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '<a href="$2">$1</a>');
|
|
88
|
-
|
|
89
|
-
// Bold: **text** or __text__
|
|
90
|
-
result = result.replace(/\*\*(.+?)\*\*/g, "<b>$1</b>");
|
|
91
|
-
result = result.replace(/__(.+?)__/g, "<b>$1</b>");
|
|
92
|
-
|
|
93
|
-
// Italic: *text* or _text_ (not inside bold)
|
|
94
|
-
result = result.replace(/(?<![*_])\*([^*]+?)\*(?![*_])/g, "<i>$1</i>");
|
|
95
|
-
result = result.replace(/(?<![*_])_([^_]+?)_(?![*_])/g, "<i>$1</i>");
|
|
96
|
-
|
|
97
|
-
// Strikethrough: ~~text~~
|
|
98
|
-
result = result.replace(/~~(.+?)~~/g, "<s>$1</s>");
|
|
99
|
-
|
|
100
|
-
// Inline code: `text`
|
|
101
|
-
result = result.replace(/`([^`]+)`/g, "<code>$1</code>");
|
|
102
|
-
|
|
103
|
-
// Highlight / mark: ==text==
|
|
104
|
-
result = result.replace(/==(.+?)==/g, "<mark>$1</mark>");
|
|
105
|
-
|
|
106
|
-
return result;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// ─── Block Parser ────────────────────────────────────────────────────────────
|
|
110
|
-
|
|
111
|
-
type ParserState = "normal" | "code" | "table";
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Parses a markdown string into an array of Editor.js block objects.
|
|
115
|
-
*/
|
|
116
|
-
export function parseMarkdownToBlocks(md: string): EditorBlock[] {
|
|
117
|
-
const lines = md.split("\n");
|
|
118
|
-
const blocks: EditorBlock[] = [];
|
|
119
|
-
|
|
120
|
-
let state: ParserState = "normal";
|
|
121
|
-
let codeBuffer: string[] = [];
|
|
122
|
-
let codeLang = "";
|
|
123
|
-
let tableRows: string[][] = [];
|
|
124
|
-
let listBuffer: { text: string; checked?: boolean }[] = [];
|
|
125
|
-
let listType: "ordered" | "unordered" | "checklist" | null = null;
|
|
126
|
-
let quoteBuffer: string[] = [];
|
|
127
|
-
|
|
128
|
-
function flushList() {
|
|
129
|
-
if (listBuffer.length === 0 || !listType) return;
|
|
130
|
-
|
|
131
|
-
if (listType === "checklist") {
|
|
132
|
-
blocks.push({
|
|
133
|
-
type: "checklist",
|
|
134
|
-
data: {
|
|
135
|
-
items: listBuffer.map((item) => ({
|
|
136
|
-
text: convertInlineMarkdown(item.text),
|
|
137
|
-
checked: item.checked ?? false,
|
|
138
|
-
})),
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
} else {
|
|
142
|
-
blocks.push({
|
|
143
|
-
type: "list",
|
|
144
|
-
data: {
|
|
145
|
-
style: listType,
|
|
146
|
-
items: listBuffer.map((item) => convertInlineMarkdown(item.text)),
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
listBuffer = [];
|
|
151
|
-
listType = null;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
function flushQuote() {
|
|
155
|
-
if (quoteBuffer.length === 0) return;
|
|
156
|
-
blocks.push({
|
|
157
|
-
type: "quote",
|
|
158
|
-
data: {
|
|
159
|
-
text: convertInlineMarkdown(quoteBuffer.join("<br>")),
|
|
160
|
-
caption: "",
|
|
161
|
-
alignment: "left",
|
|
162
|
-
},
|
|
163
|
-
});
|
|
164
|
-
quoteBuffer = [];
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
function flushTable() {
|
|
168
|
-
if (tableRows.length === 0) return;
|
|
169
|
-
blocks.push({
|
|
170
|
-
type: "table",
|
|
171
|
-
data: {
|
|
172
|
-
withHeadings: tableRows.length > 1,
|
|
173
|
-
content: tableRows.map((row) => row.map((cell) => convertInlineMarkdown(cell.trim()))),
|
|
174
|
-
},
|
|
175
|
-
});
|
|
176
|
-
tableRows = [];
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
function flushAll() {
|
|
180
|
-
flushList();
|
|
181
|
-
flushQuote();
|
|
182
|
-
flushTable();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
for (let i = 0; i < lines.length; i++) {
|
|
186
|
-
const line = lines[i];
|
|
187
|
-
const trimmed = line.trimEnd();
|
|
188
|
-
|
|
189
|
-
// ── Code block state ──
|
|
190
|
-
if (state === "code") {
|
|
191
|
-
if (trimmed.startsWith("```")) {
|
|
192
|
-
blocks.push({
|
|
193
|
-
type: "code",
|
|
194
|
-
data: { code: codeBuffer.join("\n"), ...(codeLang && { language: codeLang }) },
|
|
195
|
-
});
|
|
196
|
-
codeBuffer = [];
|
|
197
|
-
codeLang = "";
|
|
198
|
-
state = "normal";
|
|
199
|
-
} else {
|
|
200
|
-
codeBuffer.push(line);
|
|
201
|
-
}
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// ── Table state ──
|
|
206
|
-
if (state === "table") {
|
|
207
|
-
const tableMatch = trimmed.match(/^\|(.+)\|$/);
|
|
208
|
-
if (tableMatch) {
|
|
209
|
-
const cells = tableMatch[1].split("|").map((c) => c.trim());
|
|
210
|
-
// Skip separator rows (|---|---|)
|
|
211
|
-
if (cells.every((c) => /^[-:]+$/.test(c))) continue;
|
|
212
|
-
tableRows.push(cells);
|
|
213
|
-
continue;
|
|
214
|
-
} else {
|
|
215
|
-
flushTable();
|
|
216
|
-
state = "normal";
|
|
217
|
-
// Fall through to process this line normally
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
// ── Normal state ──
|
|
222
|
-
|
|
223
|
-
// Code block opening
|
|
224
|
-
if (trimmed.startsWith("```")) {
|
|
225
|
-
flushAll();
|
|
226
|
-
codeLang = trimmed.slice(3).trim();
|
|
227
|
-
state = "code";
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// Empty line — flush accumulators
|
|
232
|
-
if (trimmed === "") {
|
|
233
|
-
flushAll();
|
|
234
|
-
continue;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Horizontal rule
|
|
238
|
-
if (/^(---+|___+|\*\*\*+)\s*$/.test(trimmed)) {
|
|
239
|
-
flushAll();
|
|
240
|
-
blocks.push({ type: "delimiter", data: {} });
|
|
241
|
-
continue;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// Header
|
|
245
|
-
const headerMatch = trimmed.match(/^(#{1,6})\s+(.+)$/);
|
|
246
|
-
if (headerMatch) {
|
|
247
|
-
flushAll();
|
|
248
|
-
blocks.push({
|
|
249
|
-
type: "header",
|
|
250
|
-
data: {
|
|
251
|
-
text: convertInlineMarkdown(headerMatch[2]),
|
|
252
|
-
level: headerMatch[1].length,
|
|
253
|
-
},
|
|
254
|
-
});
|
|
255
|
-
continue;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
// Image (standalone line)
|
|
259
|
-
const imageMatch = trimmed.match(/^!\[([^\]]*)\]\(([^)]+)\)$/);
|
|
260
|
-
if (imageMatch) {
|
|
261
|
-
flushAll();
|
|
262
|
-
blocks.push({
|
|
263
|
-
type: "image",
|
|
264
|
-
data: {
|
|
265
|
-
url: imageMatch[2],
|
|
266
|
-
caption: imageMatch[1],
|
|
267
|
-
withBorder: false,
|
|
268
|
-
withBackground: false,
|
|
269
|
-
stretched: false,
|
|
270
|
-
},
|
|
271
|
-
});
|
|
272
|
-
continue;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// Checklist item: - [ ] or - [x]
|
|
276
|
-
const checklistMatch = trimmed.match(/^[-*+]\s+\[([ xX])\]\s+(.+)$/);
|
|
277
|
-
if (checklistMatch) {
|
|
278
|
-
if (listType && listType !== "checklist") flushList();
|
|
279
|
-
listType = "checklist";
|
|
280
|
-
listBuffer.push({
|
|
281
|
-
text: checklistMatch[2],
|
|
282
|
-
checked: checklistMatch[1].toLowerCase() === "x",
|
|
283
|
-
});
|
|
284
|
-
continue;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
// Unordered list item: - item, * item, + item
|
|
288
|
-
const ulMatch = trimmed.match(/^[-*+]\s+(.+)$/);
|
|
289
|
-
if (ulMatch) {
|
|
290
|
-
if (listType && listType !== "unordered") flushList();
|
|
291
|
-
if (quoteBuffer.length) flushQuote();
|
|
292
|
-
listType = "unordered";
|
|
293
|
-
listBuffer.push({ text: ulMatch[1] });
|
|
294
|
-
continue;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// Ordered list item: 1. item
|
|
298
|
-
const olMatch = trimmed.match(/^\d+\.\s+(.+)$/);
|
|
299
|
-
if (olMatch) {
|
|
300
|
-
if (listType && listType !== "ordered") flushList();
|
|
301
|
-
if (quoteBuffer.length) flushQuote();
|
|
302
|
-
listType = "ordered";
|
|
303
|
-
listBuffer.push({ text: olMatch[1] });
|
|
304
|
-
continue;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
// Blockquote: > text
|
|
308
|
-
const quoteMatch = trimmed.match(/^>\s?(.*)$/);
|
|
309
|
-
if (quoteMatch) {
|
|
310
|
-
if (listBuffer.length) flushList();
|
|
311
|
-
quoteBuffer.push(quoteMatch[1]);
|
|
312
|
-
continue;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
// Table start: | col1 | col2 |
|
|
316
|
-
const tableStartMatch = trimmed.match(/^\|(.+)\|$/);
|
|
317
|
-
if (tableStartMatch) {
|
|
318
|
-
flushAll();
|
|
319
|
-
const cells = tableStartMatch[1].split("|").map((c) => c.trim());
|
|
320
|
-
if (!cells.every((c) => /^[-:]+$/.test(c))) {
|
|
321
|
-
tableRows.push(cells);
|
|
322
|
-
}
|
|
323
|
-
state = "table";
|
|
324
|
-
continue;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
// Warning block: > ⚠️ title \n > message (special blockquote variant)
|
|
328
|
-
// Already handled by blockquote — this could be extended later
|
|
329
|
-
|
|
330
|
-
// Regular paragraph
|
|
331
|
-
flushAll();
|
|
332
|
-
blocks.push({
|
|
333
|
-
type: "paragraph",
|
|
334
|
-
data: { text: convertInlineMarkdown(trimmed) },
|
|
335
|
-
});
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
// Flush remaining accumulators
|
|
339
|
-
if (state === "code" && codeBuffer.length > 0) {
|
|
340
|
-
// Unterminated code block — still emit it
|
|
341
|
-
blocks.push({ type: "code", data: { code: codeBuffer.join("\n") } });
|
|
342
|
-
}
|
|
343
|
-
flushAll();
|
|
344
|
-
|
|
345
|
-
return blocks;
|
|
346
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cn } from "../utils/cn";
|
|
3
|
-
import { Label } from "./Label";
|
|
4
|
-
import { cva, VariantProps } from "class-variance-authority";
|
|
5
|
-
|
|
6
|
-
// Define the styles for the textarea using cva
|
|
7
|
-
const textareaStyles = cva(
|
|
8
|
-
[
|
|
9
|
-
"border",
|
|
10
|
-
// `radius/xl` (12px). Figma's TextArea-Field has two sizes — S is `radius/lg` (8px) and M is
|
|
11
|
-
// `radius/xl` — and this component has no size variant: it renders its `Label` wrapper at
|
|
12
|
-
// `size="M"` below, so M is the size it actually is. Supporting S properly needs a real `size`
|
|
13
|
-
// prop, which is an API change rather than a radius one.
|
|
14
|
-
"rounded-radius-xl",
|
|
15
|
-
"px-[8px]",
|
|
16
|
-
"py-[12px]",
|
|
17
|
-
"outline-none",
|
|
18
|
-
"typography-body-large-regular",
|
|
19
|
-
// A floor for the empty field — without one, `field-sizing: content` collapses it to a single
|
|
20
|
-
// 50px line. No `!` — twMerge does not dedupe an important class against a plain one, so `!`
|
|
21
|
-
// here would make the height impossible to override from a caller's `className`.
|
|
22
|
-
"min-h-[200px]",
|
|
23
|
-
"transition-[border,background-color,color,caret-color,box-shadow]",
|
|
24
|
-
"ease-in-out",
|
|
25
|
-
"duration-150",
|
|
26
|
-
"text-content-presentation-action-light-primary",
|
|
27
|
-
"caret-border-presentation-state-focus",
|
|
28
|
-
"border-border-presentation-action-primary",
|
|
29
|
-
"bg-background-presentation-form-field-primary",
|
|
30
|
-
"hover:border-border-presentation-action-hover",
|
|
31
|
-
"hover:bg-background-presentation-form-field-hover",
|
|
32
|
-
"focus:border-border-presentation-state-focus",
|
|
33
|
-
"hover:shadow-[0px_1px_6px_0px_rgba(0,0,0,0.30)]",
|
|
34
|
-
"disabled:border-border-presentation-action-disabled",
|
|
35
|
-
"disabled:bg-background-presentation-action-disabled",
|
|
36
|
-
"disabled:text-border-presentation-action-disabled",
|
|
37
|
-
"disabled:cursor-not-allowed",
|
|
38
|
-
"disabled:placeholder-border-presentation-action-disabled",
|
|
39
|
-
"w-full min-w-[100px] max-w-[100%]",
|
|
40
|
-
],
|
|
41
|
-
{
|
|
42
|
-
variants: {
|
|
43
|
-
state: {
|
|
44
|
-
negative: [
|
|
45
|
-
"border-border-presentation-state-negative",
|
|
46
|
-
"caret-border-presentation-state-negative",
|
|
47
|
-
"hover:border-border-presentation-state-negative",
|
|
48
|
-
"focus:border-border-presentation-state-negative",
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
},
|
|
52
|
-
defaultVariants: {},
|
|
53
|
-
},
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
// Define the prop types for the Textarea component
|
|
57
|
-
interface TextareaProps
|
|
58
|
-
extends React.TextareaHTMLAttributes<HTMLTextAreaElement>, VariantProps<typeof textareaStyles> {
|
|
59
|
-
label?: string; // Optional label text
|
|
60
|
-
requiredLabel?: string; // Text for required field indicator
|
|
61
|
-
secondaryLabel?: string; // Additional label text
|
|
62
|
-
direction?: "row" | "column";
|
|
63
|
-
theme?: "dark" | "light" | "default";
|
|
64
|
-
/**
|
|
65
|
-
* Grow the field to fit its content as the user types, instead of scrolling inside a fixed box.
|
|
66
|
-
* On by default, via CSS `field-sizing: content`. Set a `max-h-*` on the field to cap the growth —
|
|
67
|
-
* past the cap it scrolls. Note `rows` has no effect while this is on: the browser sizes the field
|
|
68
|
-
* from its content, so an empty field starts at one line. Pass `autoResize={false}` for the old
|
|
69
|
-
* fixed-height box with a drag handle.
|
|
70
|
-
*/
|
|
71
|
-
autoResize?: boolean;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Textarea component definition
|
|
75
|
-
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
76
|
-
(
|
|
77
|
-
{
|
|
78
|
-
className,
|
|
79
|
-
state, // Default state for textarea
|
|
80
|
-
label,
|
|
81
|
-
requiredLabel,
|
|
82
|
-
secondaryLabel,
|
|
83
|
-
direction = "row",
|
|
84
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
85
|
-
theme, // excluded from ...props spread
|
|
86
|
-
autoResize = true,
|
|
87
|
-
...props
|
|
88
|
-
},
|
|
89
|
-
ref,
|
|
90
|
-
) => {
|
|
91
|
-
return (
|
|
92
|
-
<Label
|
|
93
|
-
label={label}
|
|
94
|
-
requiredLabel={requiredLabel}
|
|
95
|
-
secondaryLabel={secondaryLabel}
|
|
96
|
-
labelDirections={direction === "row" ? "vertical" : "horizontal"}
|
|
97
|
-
childrenDirections={direction === "row" ? "horizontal" : "vertical"}
|
|
98
|
-
size={"M"}
|
|
99
|
-
className={cn(className)}
|
|
100
|
-
>
|
|
101
|
-
<textarea
|
|
102
|
-
// Auto-grow is pure CSS. Written as an arbitrary *property* rather than as
|
|
103
|
-
// `field-sizing-content`: that utility only exists in Tailwind v4 and this project is on
|
|
104
|
-
// v3, where it compiled to no rule at all and left the computed `field-sizing` at `fixed`.
|
|
105
|
-
// The drag handle goes away with it — the height is content-driven, and a manual drag
|
|
106
|
-
// would pin it and silently stop the growing.
|
|
107
|
-
className={cn(textareaStyles({ state }), autoResize && "[field-sizing:content] resize-none")}
|
|
108
|
-
ref={ref}
|
|
109
|
-
{...props}
|
|
110
|
-
/>
|
|
111
|
-
</Label>
|
|
112
|
-
);
|
|
113
|
-
},
|
|
114
|
-
);
|
|
115
|
-
Textarea.displayName = "Textarea";
|
|
116
|
-
|
|
117
|
-
export { Textarea };
|