@editora/ui-react 0.1.23 → 0.1.25
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 +249 -144
- package/dist/Accordion.cjs.js +1 -1
- package/dist/Accordion.esm.js +15 -14
- package/dist/Alert.cjs.js +1 -1
- package/dist/Alert.esm.js +16 -15
- package/dist/AlertDialog.cjs.js +1 -1
- package/dist/AlertDialog.esm.js +1 -1
- package/dist/AlertDialogProvider.cjs.js +1 -1
- package/dist/AlertDialogProvider.esm.js +27 -25
- package/dist/Anchor-DYDUf-vd.js +1 -0
- package/dist/Anchor-Dmad4hOW.mjs +9 -0
- package/dist/Anchor.cjs.js +2 -1
- package/dist/Anchor.esm.js +4 -8
- package/dist/AnimatedBeam.cjs.js +1 -1
- package/dist/AnimatedBeam.esm.js +5 -4
- package/dist/AnimatedList.cjs.js +1 -1
- package/dist/AnimatedList.esm.js +5 -4
- package/dist/AnimatedNumber.cjs.js +1 -1
- package/dist/AnimatedNumber.esm.js +21 -20
- package/dist/AnimatedText.cjs.js +1 -1
- package/dist/AnimatedText.esm.js +21 -20
- package/dist/AppHeader.cjs.js +2 -2
- package/dist/AppHeader.esm.js +1 -1
- package/dist/AspectRatio-DOW0K9DW.mjs +30 -0
- package/dist/AspectRatio-DQt_KLQj.js +1 -0
- package/dist/AspectRatio.cjs.js +2 -1
- package/dist/AspectRatio.esm.js +4 -29
- package/dist/Avatar.cjs.js +1 -1
- package/dist/Avatar.esm.js +20 -19
- package/dist/Badge.cjs.js +1 -1
- package/dist/Badge.esm.js +8 -7
- package/dist/BlockControls.cjs.js +1 -1
- package/dist/BlockControls.esm.js +9 -8
- package/dist/Box-CmgDDa83.mjs +155 -0
- package/dist/Box-qAZUOniK.js +1 -0
- package/dist/Box.cjs.js +2 -1
- package/dist/Box.esm.js +4 -154
- package/dist/Breadcrumb.cjs.js +1 -1
- package/dist/Breadcrumb.esm.js +15 -14
- package/dist/Button.cjs.js +1 -1
- package/dist/Button.esm.js +20 -19
- package/dist/Calendar.cjs.js +1 -1
- package/dist/Calendar.esm.js +26 -25
- package/dist/Card.cjs.js +2 -2
- package/dist/Card.esm.js +10 -9
- package/dist/Chart.cjs.js +1 -1
- package/dist/Chart.esm.js +12 -11
- package/dist/Checkbox.cjs.js +1 -1
- package/dist/Checkbox.esm.js +22 -21
- package/dist/CodeBlock-S-3gFHpZ.js +2 -0
- package/dist/CodeBlock-uWN9x1FM.mjs +129 -0
- package/dist/CodeBlock.cjs.js +1 -2
- package/dist/CodeBlock.esm.js +3 -128
- package/dist/CodeSnippet-BUOcw0RW.js +1 -0
- package/dist/CodeSnippet-WYiG4t0-.mjs +54 -0
- package/dist/CodeSnippet.cjs.js +1 -1
- package/dist/CodeSnippet.esm.js +3 -53
- package/dist/Collapsible.cjs.js +1 -1
- package/dist/Collapsible.esm.js +5 -4
- package/dist/Collection.cjs.js +1 -1
- package/dist/Collection.esm.js +1 -1
- package/dist/ColorPicker.cjs.js +1 -1
- package/dist/ColorPicker.esm.js +21 -20
- package/dist/Combobox.cjs.js +1 -1
- package/dist/Combobox.esm.js +1 -1
- package/dist/Command.cjs.js +1 -1
- package/dist/Command.esm.js +24 -23
- package/dist/CommandPalette.cjs.js +1 -1
- package/dist/CommandPalette.esm.js +24 -23
- package/dist/Container-CgcnKscE.mjs +10 -0
- package/dist/Container-TuJNiwt_.js +1 -0
- package/dist/Container.cjs.js +2 -1
- package/dist/Container.esm.js +4 -9
- package/dist/ContextMenu.cjs.js +1 -1
- package/dist/ContextMenu.esm.js +2 -1
- package/dist/DataTable.cjs.js +1 -1
- package/dist/DataTable.esm.js +11 -10
- package/dist/DateField.cjs.js +1 -1
- package/dist/DateField.esm.js +14 -12
- package/dist/DatePicker.cjs.js +1 -1
- package/dist/DatePicker.esm.js +17 -16
- package/dist/DateRangePicker.cjs.js +1 -1
- package/dist/DateRangePicker.esm.js +18 -17
- package/dist/DateRangeTimePicker.cjs.js +1 -1
- package/dist/DateRangeTimePicker.esm.js +14 -13
- package/dist/DateTimePicker.cjs.js +1 -1
- package/dist/DateTimePicker.esm.js +15 -14
- package/dist/Dialog.cjs.js +1 -1
- package/dist/Dialog.esm.js +12 -11
- package/dist/DialogProvider.cjs.js +1 -1
- package/dist/DialogProvider.esm.js +13 -13
- package/dist/DirectionProvider-CP7395p2.js +1 -0
- package/dist/DirectionProvider-DitcZgQK.mjs +9 -0
- package/dist/DirectionProvider.cjs.js +2 -1
- package/dist/DirectionProvider.esm.js +3 -7
- package/dist/DismissableLayer.cjs.js +1 -1
- package/dist/DismissableLayer.esm.js +1 -1
- package/dist/Dock.cjs.js +1 -1
- package/dist/Dock.esm.js +5 -4
- package/dist/Drawer.cjs.js +1 -1
- package/dist/Drawer.esm.js +1 -1
- package/dist/Dropdown.cjs.js +1 -1
- package/dist/Dropdown.esm.js +1 -1
- package/dist/EmptyState.cjs.js +1 -1
- package/dist/EmptyState.esm.js +6 -5
- package/dist/Field-BOKrz04B.mjs +44 -0
- package/dist/Field-Bxrq-dmE.js +1 -0
- package/dist/Field.cjs.js +2 -1
- package/dist/Field.esm.js +4 -43
- package/dist/FieldSemantics.cjs.js +1 -1
- package/dist/FieldSemantics.esm.js +27 -23
- package/dist/FileUpload.cjs.js +1 -1
- package/dist/FileUpload.esm.js +2 -1
- package/dist/Flex-B6bWJGFR.mjs +47 -0
- package/dist/Flex-YHOdBQA9.js +1 -0
- package/dist/Flex.cjs.js +2 -1
- package/dist/Flex.esm.js +4 -46
- package/dist/FloatingToolbar.cjs.js +1 -1
- package/dist/FloatingToolbar.esm.js +12 -11
- package/dist/FocusScope.cjs.js +1 -1
- package/dist/FocusScope.esm.js +1 -1
- package/dist/Form.cjs.js +1 -1
- package/dist/Form.esm.js +1 -1
- package/dist/Gantt.cjs.js +1 -1
- package/dist/Gantt.esm.js +1 -1
- package/dist/Grid-Chwqb4KF.mjs +61 -0
- package/dist/Grid-CtKqo9Kf.js +1 -0
- package/dist/Grid.cjs.js +2 -1
- package/dist/Grid.esm.js +4 -60
- package/dist/HoverCard.cjs.js +1 -1
- package/dist/HoverCard.esm.js +9 -8
- package/dist/Icon-BkYZeKmv.js +1 -0
- package/dist/Icon-fbuKtiCJ.mjs +58 -0
- package/dist/Icon.cjs.js +2 -1
- package/dist/Icon.esm.js +4 -57
- package/dist/IconCloud.cjs.js +1 -1
- package/dist/IconCloud.esm.js +15 -14
- package/dist/InlineEdit.cjs.js +1 -1
- package/dist/InlineEdit.esm.js +1 -1
- package/dist/Input.cjs.js +1 -1
- package/dist/Input.esm.js +18 -17
- package/dist/Kbd-Cq34MzH2.mjs +94 -0
- package/dist/Kbd-nWiM8GCl.js +1 -0
- package/dist/Kbd.cjs.js +1 -1
- package/dist/Kbd.esm.js +3 -93
- package/dist/Label-BPW98NVT.mjs +53 -0
- package/dist/Label-VWEMFkaF.js +1 -0
- package/dist/Label.cjs.js +2 -1
- package/dist/Label.esm.js +4 -52
- package/dist/Layout.cjs.js +1 -1
- package/dist/Layout.esm.js +1 -1
- package/dist/Listbox.cjs.js +1 -1
- package/dist/Listbox.esm.js +1 -1
- package/dist/Marquee.cjs.js +1 -1
- package/dist/Marquee.esm.js +15 -14
- package/dist/MasonryGrid.cjs.js +1 -1
- package/dist/MasonryGrid.esm.js +14 -13
- package/dist/Menu.cjs.js +1 -1
- package/dist/Menu.esm.js +1 -1
- package/dist/Menubar.cjs.js +1 -1
- package/dist/Menubar.esm.js +5 -4
- package/dist/Meter.cjs.js +1 -1
- package/dist/Meter.esm.js +13 -12
- package/dist/MetricCard-C8ySlu48.mjs +9 -0
- package/dist/MetricCard-CFETJ9pn.js +1 -0
- package/dist/MetricCard.cjs.js +1 -1
- package/dist/MetricCard.esm.js +3 -8
- package/dist/MultiSelect.cjs.js +1 -1
- package/dist/MultiSelect.esm.js +1 -1
- package/dist/NavigationMenu.cjs.js +1 -1
- package/dist/NavigationMenu.esm.js +5 -4
- package/dist/NumberField.cjs.js +1 -1
- package/dist/NumberField.esm.js +7 -6
- package/dist/NumberTicker.cjs.js +1 -1
- package/dist/NumberTicker.esm.js +20 -19
- package/dist/Orbiter.cjs.js +1 -1
- package/dist/Orbiter.esm.js +21 -20
- package/dist/Pagination.cjs.js +1 -1
- package/dist/Pagination.esm.js +24 -24
- package/dist/PanelGroup.cjs.js +1 -1
- package/dist/PanelGroup.esm.js +1 -1
- package/dist/PasswordField.cjs.js +1 -1
- package/dist/PasswordField.esm.js +18 -17
- package/dist/PinInput.cjs.js +1 -1
- package/dist/PinInput.esm.js +13 -12
- package/dist/PlacementGrid.cjs.js +1 -1
- package/dist/PlacementGrid.esm.js +13 -12
- package/dist/PluginPanel.cjs.js +1 -1
- package/dist/PluginPanel.esm.js +19 -18
- package/dist/Popover.cjs.js +1 -1
- package/dist/Popover.esm.js +27 -26
- package/dist/Portal.cjs.js +1 -1
- package/dist/Portal.esm.js +1 -1
- package/dist/Positioner.cjs.js +1 -1
- package/dist/Positioner.esm.js +1 -1
- package/dist/Presence.cjs.js +1 -1
- package/dist/Presence.esm.js +1 -1
- package/dist/Progress.cjs.js +1 -1
- package/dist/Progress.esm.js +7 -6
- package/dist/QuickActions.cjs.js +1 -1
- package/dist/QuickActions.esm.js +15 -14
- package/dist/Radio.cjs.js +1 -1
- package/dist/Radio.esm.js +18 -17
- package/dist/RadioGroup.cjs.js +1 -1
- package/dist/RadioGroup.esm.js +8 -7
- package/dist/Rating.cjs.js +1 -1
- package/dist/Rating.esm.js +1 -1
- package/dist/RovingFocusGroup.cjs.js +1 -1
- package/dist/RovingFocusGroup.esm.js +1 -1
- package/dist/ScrollArea.cjs.js +1 -1
- package/dist/ScrollArea.esm.js +1 -1
- package/dist/Section-BAx7Vtwp.js +1 -0
- package/dist/Section-tAObgCir.mjs +28 -0
- package/dist/Section.cjs.js +2 -1
- package/dist/Section.esm.js +4 -27
- package/dist/Select.cjs.js +1 -1
- package/dist/Select.esm.js +10 -9
- package/dist/SelectionPopup.cjs.js +1 -1
- package/dist/SelectionPopup.esm.js +5 -4
- package/dist/Separator-BJWaiJVJ.js +1 -0
- package/dist/Separator-DamzuUt4.mjs +9 -0
- package/dist/Separator.cjs.js +2 -1
- package/dist/Separator.esm.js +3 -7
- package/dist/Shortcut-BjgCfrVs.js +1 -0
- package/dist/Shortcut-gI41BcV2.mjs +9 -0
- package/dist/Shortcut.cjs.js +1 -1
- package/dist/Shortcut.esm.js +3 -8
- package/dist/Sidebar.cjs.js +1 -1
- package/dist/Sidebar.esm.js +1 -1
- package/dist/Skeleton.cjs.js +1 -1
- package/dist/Skeleton.esm.js +10 -9
- package/dist/Slider.cjs.js +1 -1
- package/dist/Slider.esm.js +22 -21
- package/dist/Slot.cjs.js +1 -1
- package/dist/Slot.esm.js +1 -1
- package/dist/Sortable.cjs.js +1 -1
- package/dist/Sortable.esm.js +142 -125
- package/dist/SpinningText.cjs.js +1 -1
- package/dist/SpinningText.esm.js +10 -9
- package/dist/Stat-B0QsSb0W.mjs +74 -0
- package/dist/Stat-DVx13Sjb.js +1 -0
- package/dist/Stat.cjs.js +1 -1
- package/dist/Stat.esm.js +3 -73
- package/dist/Stepper.cjs.js +1 -1
- package/dist/Stepper.esm.js +16 -15
- package/dist/Switch.cjs.js +1 -1
- package/dist/Switch.esm.js +17 -16
- package/dist/Table.cjs.js +1 -1
- package/dist/Table.esm.js +2 -1
- package/dist/Tabs.cjs.js +1 -1
- package/dist/Tabs.esm.js +1 -1
- package/dist/TagsInput.cjs.js +1 -1
- package/dist/TagsInput.esm.js +11 -10
- package/dist/Textarea.cjs.js +1 -1
- package/dist/Textarea.esm.js +19 -18
- package/dist/TimePicker.cjs.js +1 -1
- package/dist/TimePicker.esm.js +7 -6
- package/dist/Timeline.cjs.js +1 -1
- package/dist/Timeline.esm.js +1 -1
- package/dist/Toggle.cjs.js +1 -1
- package/dist/Toggle.esm.js +6 -5
- package/dist/ToggleGroup.cjs.js +1 -1
- package/dist/ToggleGroup.esm.js +1 -1
- package/dist/Toolbar.cjs.js +1 -1
- package/dist/Toolbar.esm.js +1 -1
- package/dist/Tooltip.cjs.js +1 -1
- package/dist/Tooltip.esm.js +1 -1
- package/dist/TransferList.cjs.js +1 -1
- package/dist/TransferList.esm.js +18 -17
- package/dist/Tree.cjs.js +1 -1
- package/dist/Tree.esm.js +1 -1
- package/dist/VisuallyHidden-6GmAYRMl.js +1 -0
- package/dist/VisuallyHidden-B-kgh_YW.mjs +9 -0
- package/dist/VisuallyHidden.cjs.js +2 -1
- package/dist/VisuallyHidden.esm.js +3 -7
- package/dist/Wizard.cjs.js +1 -1
- package/dist/Wizard.esm.js +1 -1
- package/dist/_createElement-DC52GmgH.js +1 -0
- package/dist/_createElement-DheOwG2B.mjs +10 -0
- package/dist/_internals-C6EP1OPI.js +1 -0
- package/dist/_internals-DnSIpvQ-.mjs +89 -0
- package/dist/client.cjs.js +1 -1
- package/dist/client.esm.js +140 -127
- package/dist/components/Accordion.cjs.js +1 -1
- package/dist/components/Accordion.esm.js +6 -5
- package/dist/components/Alert.cjs.js +1 -1
- package/dist/components/Alert.esm.js +9 -8
- package/dist/components/AlertDialog.cjs.js +1 -1
- package/dist/components/AlertDialog.d.ts +1 -1
- package/dist/components/AlertDialog.d.ts.map +1 -1
- package/dist/components/AlertDialog.esm.js +1 -1
- package/dist/components/AlertDialogProvider.d.ts.map +1 -1
- package/dist/components/Anchor.cjs.js +2 -1
- package/dist/components/Anchor.d.ts +2 -8
- package/dist/components/Anchor.d.ts.map +1 -1
- package/dist/components/Anchor.esm.js +4 -5
- package/dist/components/AnimatedBeam.cjs.js +1 -1
- package/dist/components/AnimatedBeam.esm.js +5 -4
- package/dist/components/AnimatedList.cjs.js +1 -1
- package/dist/components/AnimatedList.esm.js +2 -1
- package/dist/components/AnimatedNumber.cjs.js +1 -1
- package/dist/components/AnimatedNumber.esm.js +5 -4
- package/dist/components/AnimatedText.cjs.js +1 -1
- package/dist/components/AnimatedText.esm.js +4 -3
- package/dist/components/AppHeader.cjs.js +1 -1
- package/dist/components/AppHeader.esm.js +1 -1
- package/dist/components/AspectRatio.cjs.js +2 -1
- package/dist/components/AspectRatio.d.ts +2 -15
- package/dist/components/AspectRatio.d.ts.map +1 -1
- package/dist/components/AspectRatio.esm.js +4 -5
- package/dist/components/Avatar.cjs.js +1 -1
- package/dist/components/Avatar.esm.js +4 -3
- package/dist/components/Badge.cjs.js +1 -1
- package/dist/components/Badge.esm.js +5 -4
- package/dist/components/BlockControls.cjs.js +1 -1
- package/dist/components/BlockControls.esm.js +5 -4
- package/dist/components/Box.cjs.js +2 -1
- package/dist/components/Box.d.ts +2 -139
- package/dist/components/Box.d.ts.map +1 -1
- package/dist/components/Box.esm.js +4 -5
- package/dist/components/Breadcrumb.cjs.js +1 -1
- package/dist/components/Breadcrumb.esm.js +5 -4
- package/dist/components/Button.cjs.js +1 -1
- package/dist/components/Button.esm.js +5 -4
- package/dist/components/Calendar.cjs.js +1 -1
- package/dist/components/Calendar.esm.js +5 -4
- package/dist/components/Card.cjs.js +1 -1
- package/dist/components/Card.esm.js +4 -3
- package/dist/components/Chart.cjs.js +1 -1
- package/dist/components/Chart.esm.js +8 -7
- package/dist/components/Checkbox.cjs.js +1 -1
- package/dist/components/Checkbox.esm.js +4 -3
- package/dist/components/CodeBlock.cjs.js +1 -1
- package/dist/components/CodeBlock.d.ts +2 -26
- package/dist/components/CodeBlock.d.ts.map +1 -1
- package/dist/components/CodeBlock.esm.js +3 -4
- package/dist/components/CodeSnippet.cjs.js +1 -1
- package/dist/components/CodeSnippet.d.ts +2 -72
- package/dist/components/CodeSnippet.d.ts.map +1 -1
- package/dist/components/CodeSnippet.esm.js +3 -4
- package/dist/components/Collapsible.cjs.js +1 -1
- package/dist/components/Collapsible.esm.js +7 -6
- package/dist/components/Collection.cjs.js +1 -1
- package/dist/components/Collection.esm.js +1 -1
- package/dist/components/ColorPicker.cjs.js +1 -1
- package/dist/components/ColorPicker.esm.js +5 -4
- package/dist/components/Combobox.cjs.js +1 -1
- package/dist/components/Combobox.esm.js +1 -1
- package/dist/components/Command.cjs.js +1 -1
- package/dist/components/Command.esm.js +4 -3
- package/dist/components/CommandPalette.cjs.js +1 -1
- package/dist/components/CommandPalette.esm.js +5 -4
- package/dist/components/Container.cjs.js +2 -1
- package/dist/components/Container.d.ts +2 -5
- package/dist/components/Container.d.ts.map +1 -1
- package/dist/components/Container.esm.js +4 -5
- package/dist/components/ContextMenu.cjs.js +1 -1
- package/dist/components/ContextMenu.esm.js +5 -4
- package/dist/components/DataTable.cjs.js +1 -1
- package/dist/components/DataTable.esm.js +5 -4
- package/dist/components/DateField.cjs.js +1 -1
- package/dist/components/DateField.d.ts +1 -0
- package/dist/components/DateField.d.ts.map +1 -1
- package/dist/components/DateField.esm.js +7 -5
- package/dist/components/DatePicker.cjs.js +1 -1
- package/dist/components/DatePicker.esm.js +5 -4
- package/dist/components/DateRangePicker.cjs.js +1 -1
- package/dist/components/DateRangePicker.esm.js +5 -4
- package/dist/components/DateRangeTimePicker.cjs.js +1 -1
- package/dist/components/DateRangeTimePicker.esm.js +5 -4
- package/dist/components/DateTimePicker.cjs.js +1 -1
- package/dist/components/DateTimePicker.esm.js +4 -3
- package/dist/components/Dialog.cjs.js +1 -1
- package/dist/components/Dialog.d.ts +1 -1
- package/dist/components/Dialog.d.ts.map +1 -1
- package/dist/components/Dialog.esm.js +5 -4
- package/dist/components/DialogProvider.d.ts.map +1 -1
- package/dist/components/DirectionProvider.cjs.js +2 -1
- package/dist/components/DirectionProvider.d.ts +1 -2
- package/dist/components/DirectionProvider.d.ts.map +1 -1
- package/dist/components/DirectionProvider.esm.js +3 -4
- package/dist/components/DismissableLayer.cjs.js +1 -1
- package/dist/components/DismissableLayer.esm.js +1 -1
- package/dist/components/Dock.cjs.js +1 -1
- package/dist/components/Dock.esm.js +5 -4
- package/dist/components/Drawer.cjs.js +1 -1
- package/dist/components/Drawer.esm.js +1 -1
- package/dist/components/Dropdown.cjs.js +1 -1
- package/dist/components/Dropdown.esm.js +1 -1
- package/dist/components/EmptyState.cjs.js +1 -1
- package/dist/components/EmptyState.esm.js +5 -4
- package/dist/components/Field.cjs.js +2 -1
- package/dist/components/Field.d.ts +2 -36
- package/dist/components/Field.d.ts.map +1 -1
- package/dist/components/Field.esm.js +4 -5
- package/dist/components/FieldSemantics.cjs.js +1 -1
- package/dist/components/FieldSemantics.d.ts +4 -0
- package/dist/components/FieldSemantics.d.ts.map +1 -1
- package/dist/components/FieldSemantics.esm.js +11 -7
- package/dist/components/FileUpload.cjs.js +1 -1
- package/dist/components/FileUpload.d.ts +1 -0
- package/dist/components/FileUpload.d.ts.map +1 -1
- package/dist/components/FileUpload.esm.js +4 -3
- package/dist/components/Flex.cjs.js +2 -1
- package/dist/components/Flex.d.ts +2 -16
- package/dist/components/Flex.d.ts.map +1 -1
- package/dist/components/Flex.esm.js +4 -5
- package/dist/components/FloatingToolbar.cjs.js +1 -1
- package/dist/components/FloatingToolbar.esm.js +6 -5
- package/dist/components/FocusScope.cjs.js +1 -1
- package/dist/components/FocusScope.esm.js +1 -1
- package/dist/components/Form.cjs.js +1 -1
- package/dist/components/Form.esm.js +1 -1
- package/dist/components/Gantt.cjs.js +1 -1
- package/dist/components/Gantt.esm.js +1 -1
- package/dist/components/Grid.cjs.js +2 -1
- package/dist/components/Grid.d.ts +2 -23
- package/dist/components/Grid.d.ts.map +1 -1
- package/dist/components/Grid.esm.js +4 -5
- package/dist/components/HoverCard.cjs.js +1 -1
- package/dist/components/HoverCard.esm.js +5 -4
- package/dist/components/Icon.cjs.js +2 -1
- package/dist/components/Icon.d.ts +2 -50
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/Icon.esm.js +4 -5
- package/dist/components/IconCloud.cjs.js +1 -1
- package/dist/components/IconCloud.esm.js +4 -3
- package/dist/components/InlineEdit.cjs.js +1 -1
- package/dist/components/InlineEdit.esm.js +1 -1
- package/dist/components/Input.cjs.js +1 -1
- package/dist/components/Input.esm.js +5 -4
- package/dist/components/Kbd.cjs.js +1 -1
- package/dist/components/Kbd.d.ts +2 -70
- package/dist/components/Kbd.d.ts.map +1 -1
- package/dist/components/Kbd.esm.js +3 -4
- package/dist/components/Label.cjs.js +2 -1
- package/dist/components/Label.d.ts +2 -35
- package/dist/components/Label.d.ts.map +1 -1
- package/dist/components/Label.esm.js +4 -5
- package/dist/components/Layout.cjs.js +1 -1
- package/dist/components/Layout.esm.js +1 -1
- package/dist/components/Listbox.cjs.js +1 -1
- package/dist/components/Listbox.esm.js +1 -1
- package/dist/components/Marquee.cjs.js +1 -1
- package/dist/components/Marquee.esm.js +5 -4
- package/dist/components/MasonryGrid.cjs.js +1 -1
- package/dist/components/MasonryGrid.esm.js +5 -4
- package/dist/components/Menu.cjs.js +1 -1
- package/dist/components/Menu.esm.js +1 -1
- package/dist/components/Menubar.cjs.js +1 -1
- package/dist/components/Menubar.esm.js +5 -4
- package/dist/components/Meter.cjs.js +1 -1
- package/dist/components/Meter.esm.js +5 -4
- package/dist/components/MetricCard.cjs.js +1 -1
- package/dist/components/MetricCard.d.ts +2 -5
- package/dist/components/MetricCard.d.ts.map +1 -1
- package/dist/components/MetricCard.esm.js +3 -5
- package/dist/components/MultiSelect.cjs.js +1 -1
- package/dist/components/MultiSelect.esm.js +1 -1
- package/dist/components/NavigationMenu.cjs.js +1 -1
- package/dist/components/NavigationMenu.esm.js +10 -9
- package/dist/components/NumberField.cjs.js +1 -1
- package/dist/components/NumberField.esm.js +5 -4
- package/dist/components/NumberTicker.cjs.js +1 -1
- package/dist/components/NumberTicker.esm.js +5 -4
- package/dist/components/Orbiter.cjs.js +1 -1
- package/dist/components/Orbiter.esm.js +5 -4
- package/dist/components/Pagination.cjs.js +1 -1
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.esm.js +1 -1
- package/dist/components/PanelGroup.cjs.js +1 -1
- package/dist/components/PanelGroup.esm.js +1 -1
- package/dist/components/PasswordField.cjs.js +1 -1
- package/dist/components/PasswordField.esm.js +5 -4
- package/dist/components/PinInput.cjs.js +1 -1
- package/dist/components/PinInput.esm.js +6 -5
- package/dist/components/PlacementGrid.cjs.js +1 -1
- package/dist/components/PlacementGrid.esm.js +4 -3
- package/dist/components/PluginPanel.cjs.js +1 -1
- package/dist/components/PluginPanel.esm.js +5 -4
- package/dist/components/Popover.cjs.js +1 -1
- package/dist/components/Popover.esm.js +5 -4
- package/dist/components/Portal.cjs.js +1 -1
- package/dist/components/Portal.esm.js +1 -1
- package/dist/components/Positioner.cjs.js +1 -1
- package/dist/components/Positioner.esm.js +1 -1
- package/dist/components/Presence.cjs.js +1 -1
- package/dist/components/Presence.esm.js +1 -1
- package/dist/components/Progress.cjs.js +1 -1
- package/dist/components/Progress.esm.js +4 -3
- package/dist/components/QuickActions.cjs.js +1 -1
- package/dist/components/QuickActions.esm.js +5 -4
- package/dist/components/Radio.cjs.js +1 -1
- package/dist/components/Radio.esm.js +4 -3
- package/dist/components/RadioGroup.cjs.js +1 -1
- package/dist/components/RadioGroup.esm.js +4 -3
- package/dist/components/Rating.cjs.js +1 -1
- package/dist/components/Rating.esm.js +1 -1
- package/dist/components/RovingFocusGroup.cjs.js +1 -1
- package/dist/components/RovingFocusGroup.esm.js +1 -1
- package/dist/components/ScrollArea.cjs.js +1 -1
- package/dist/components/ScrollArea.esm.js +1 -1
- package/dist/components/Section.cjs.js +2 -1
- package/dist/components/Section.d.ts +2 -10
- package/dist/components/Section.d.ts.map +1 -1
- package/dist/components/Section.esm.js +4 -5
- package/dist/components/Select.cjs.js +1 -1
- package/dist/components/Select.esm.js +5 -4
- package/dist/components/SelectionPopup.cjs.js +1 -1
- package/dist/components/SelectionPopup.esm.js +5 -4
- package/dist/components/Separator.cjs.js +2 -1
- package/dist/components/Separator.d.ts +1 -21
- package/dist/components/Separator.d.ts.map +1 -1
- package/dist/components/Separator.esm.js +3 -4
- package/dist/components/Shortcut.cjs.js +1 -1
- package/dist/components/Shortcut.d.ts +2 -11
- package/dist/components/Shortcut.d.ts.map +1 -1
- package/dist/components/Shortcut.esm.js +3 -5
- package/dist/components/Sidebar.cjs.js +1 -1
- package/dist/components/Sidebar.esm.js +1 -1
- package/dist/components/Skeleton.cjs.js +1 -1
- package/dist/components/Skeleton.esm.js +5 -4
- package/dist/components/Slider.cjs.js +1 -1
- package/dist/components/Slider.esm.js +5 -4
- package/dist/components/Slot.cjs.js +1 -1
- package/dist/components/Slot.esm.js +1 -1
- package/dist/components/Sortable.cjs.js +1 -1
- package/dist/components/Sortable.d.ts +78 -1
- package/dist/components/Sortable.d.ts.map +1 -1
- package/dist/components/Sortable.esm.js +6 -4
- package/dist/components/SpinningText.cjs.js +1 -1
- package/dist/components/SpinningText.esm.js +4 -3
- package/dist/components/Stat.cjs.js +1 -1
- package/dist/components/Stat.d.ts +2 -60
- package/dist/components/Stat.d.ts.map +1 -1
- package/dist/components/Stat.esm.js +2 -3
- package/dist/components/Stepper.cjs.js +1 -1
- package/dist/components/Stepper.esm.js +5 -4
- package/dist/components/Switch.cjs.js +1 -1
- package/dist/components/Switch.esm.js +5 -4
- package/dist/components/Table.cjs.js +1 -1
- package/dist/components/Table.esm.js +5 -4
- package/dist/components/Tabs.cjs.js +1 -1
- package/dist/components/Tabs.esm.js +1 -1
- package/dist/components/TagsInput.cjs.js +1 -1
- package/dist/components/TagsInput.esm.js +5 -4
- package/dist/components/Textarea.cjs.js +1 -1
- package/dist/components/Textarea.esm.js +5 -4
- package/dist/components/TimePicker.cjs.js +1 -1
- package/dist/components/TimePicker.esm.js +5 -4
- package/dist/components/Timeline.cjs.js +1 -1
- package/dist/components/Timeline.esm.js +1 -1
- package/dist/components/Toggle.cjs.js +1 -1
- package/dist/components/Toggle.esm.js +5 -4
- package/dist/components/ToggleGroup.cjs.js +1 -1
- package/dist/components/ToggleGroup.esm.js +1 -1
- package/dist/components/Toolbar.cjs.js +1 -1
- package/dist/components/Toolbar.esm.js +1 -1
- package/dist/components/Tooltip.cjs.js +1 -1
- package/dist/components/Tooltip.esm.js +1 -1
- package/dist/components/TransferList.cjs.js +1 -1
- package/dist/components/TransferList.esm.js +5 -4
- package/dist/components/Tree.cjs.js +1 -1
- package/dist/components/Tree.esm.js +1 -1
- package/dist/components/VisuallyHidden.cjs.js +2 -1
- package/dist/components/VisuallyHidden.d.ts +1 -2
- package/dist/components/VisuallyHidden.d.ts.map +1 -1
- package/dist/components/VisuallyHidden.esm.js +3 -4
- package/dist/components/Wizard.cjs.js +1 -1
- package/dist/components/Wizard.esm.js +1 -1
- package/dist/components/_createElement.d.ts +12 -0
- package/dist/components/_createElement.d.ts.map +1 -0
- package/dist/components/_internals.d.ts +7 -10
- package/dist/components/_internals.d.ts.map +1 -1
- package/dist/components/server/Anchor.d.ts +9 -0
- package/dist/components/server/Anchor.d.ts.map +1 -0
- package/dist/components/server/AspectRatio.d.ts +16 -0
- package/dist/components/server/AspectRatio.d.ts.map +1 -0
- package/dist/components/server/Box.d.ts +140 -0
- package/dist/components/server/Box.d.ts.map +1 -0
- package/dist/components/server/CodeBlock.d.ts +27 -0
- package/dist/components/server/CodeBlock.d.ts.map +1 -0
- package/dist/components/server/CodeSnippet.d.ts +73 -0
- package/dist/components/server/CodeSnippet.d.ts.map +1 -0
- package/dist/components/server/Container.d.ts +6 -0
- package/dist/components/server/Container.d.ts.map +1 -0
- package/dist/components/server/DirectionProvider.d.ts +3 -0
- package/dist/components/server/DirectionProvider.d.ts.map +1 -0
- package/dist/components/server/Field.d.ts +37 -0
- package/dist/components/server/Field.d.ts.map +1 -0
- package/dist/components/server/Flex.d.ts +17 -0
- package/dist/components/server/Flex.d.ts.map +1 -0
- package/dist/components/server/Grid.d.ts +24 -0
- package/dist/components/server/Grid.d.ts.map +1 -0
- package/dist/components/server/Icon.d.ts +51 -0
- package/dist/components/server/Icon.d.ts.map +1 -0
- package/dist/components/server/Kbd.d.ts +71 -0
- package/dist/components/server/Kbd.d.ts.map +1 -0
- package/dist/components/server/Label.d.ts +36 -0
- package/dist/components/server/Label.d.ts.map +1 -0
- package/dist/components/server/MetricCard.d.ts +6 -0
- package/dist/components/server/MetricCard.d.ts.map +1 -0
- package/dist/components/server/Section.d.ts +11 -0
- package/dist/components/server/Section.d.ts.map +1 -0
- package/dist/components/server/Separator.d.ts +22 -0
- package/dist/components/server/Separator.d.ts.map +1 -0
- package/dist/components/server/Shortcut.d.ts +12 -0
- package/dist/components/server/Shortcut.d.ts.map +1 -0
- package/dist/components/server/Stat.d.ts +61 -0
- package/dist/components/server/Stat.d.ts.map +1 -0
- package/dist/components/server/VisuallyHidden.d.ts +3 -0
- package/dist/components/server/VisuallyHidden.d.ts.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +455 -442
- package/dist/server.cjs.js +1 -1
- package/dist/server.d.ts +19 -19
- package/dist/server.d.ts.map +1 -1
- package/dist/server.esm.js +35 -35
- package/package.json +3 -3
- package/dist/_internals-BIT_j6Nr.js +0 -1
- package/dist/_internals-CEeSSGD-.mjs +0 -122
- package/dist/core-registration.d.ts +0 -3
- package/dist/core-registration.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
1
|
+
<h1 align="center">@editora/ui-react</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
React components for building application UIs: forms, data tables, dialogs, pickers, charts and a Gantt planner. Typed
|
|
5
|
+
props, typed event details, and hooks for forms, dialogs, themes and floating layers. Built on
|
|
6
|
+
<a href="https://www.npmjs.com/package/@editora/ui-core"><code>@editora/ui-core</code></a>.
|
|
7
|
+
</p>
|
|
8
|
+
|
|
9
|
+
<p align="center">
|
|
10
|
+
<a href="https://www.npmjs.com/package/@editora/ui-react"><img src="https://img.shields.io/npm/v/@editora/ui-react.svg" alt="npm version"></a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@editora/ui-react"><img src="https://img.shields.io/npm/dm/@editora/ui-react.svg" alt="npm downloads"></a>
|
|
12
|
+
<a href="https://github.com/ajaykr089/Editora/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@editora/ui-react.svg" alt="license"></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/@editora/ui-react"><img src="https://img.shields.io/npm/types/@editora/ui-react.svg" alt="TypeScript types included"></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://editora-ecosystem.netlify.app/">Component catalog</a> ·
|
|
18
|
+
<a href="https://editora-ecosystem-storybook.netlify.app/">Storybook</a> ·
|
|
19
|
+
<a href="https://codesandbox.io/p/github/ajaykr089/editora-codesandbox/main">CodeSandbox</a> ·
|
|
20
|
+
<a href="https://github.com/ajaykr089/Editora">GitHub</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-react/docs/images/components.png" alt="A set of React components: a labelled text field, buttons, badges and avatars, a warning alert, a switch, a checkbox, a progress bar and a date picker" width="900">
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
## Features
|
|
28
|
+
|
|
29
|
+
- **A broad catalog**: inputs and forms, pickers, tables, tabs, menus, dialogs, drawers, charts, a calendar and a Gantt
|
|
30
|
+
planner. [The full list](#components).
|
|
31
|
+
- **Typed props and events.** Callbacks receive a typed `detail`, not a raw DOM event.
|
|
32
|
+
- **Forms that validate**: `<Form>` collects the values of the controls inside it, and `useForm()` drives it.
|
|
33
|
+
- **Promise dialogs**: `await dialog.confirm({...})`, with providers that work in React `StrictMode`.
|
|
34
|
+
- **Theming** with design tokens, persisted if you want.
|
|
35
|
+
- **Floating layers**: hooks for popovers, menus and tooltips with flip, shift and focus management.
|
|
36
|
+
- Wrappers for [`@editora/ui-core`](https://www.npmjs.com/package/@editora/ui-core), so the components are standard
|
|
37
|
+
custom elements underneath.
|
|
38
|
+
|
|
39
|
+
## Install
|
|
23
40
|
|
|
24
41
|
```bash
|
|
25
|
-
npm install @editora/ui-react
|
|
42
|
+
npm install @editora/ui-react
|
|
26
43
|
```
|
|
27
44
|
|
|
28
|
-
|
|
45
|
+
`@editora/ui-core` comes with the package. It is tested with React 18 and 19 (the peer range is React 16.8 to 20). These components render custom elements, which are
|
|
46
|
+
defined in the browser only: see [Server rendering](#server-rendering).
|
|
29
47
|
|
|
30
|
-
|
|
31
|
-
npm install @editora/ui-sortable
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
And for the standalone React wrapper only:
|
|
35
|
-
|
|
36
|
-
```tsx
|
|
37
|
-
import { Sortable } from '@editora/ui-sortable/react';
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Peer dependencies:
|
|
41
|
-
- `react`
|
|
42
|
-
- `react-dom`
|
|
43
|
-
|
|
44
|
-
## Quick Start
|
|
45
|
-
|
|
46
|
-
Import from package root. This also registers all custom elements (`import '@editora/ui-core'`) internally.
|
|
48
|
+
## Quick start
|
|
47
49
|
|
|
48
50
|
```tsx
|
|
49
51
|
import { Button, Input, ThemeProvider } from '@editora/ui-react';
|
|
50
52
|
|
|
51
|
-
export function App() {
|
|
53
|
+
export default function App() {
|
|
52
54
|
return (
|
|
53
55
|
<ThemeProvider>
|
|
54
56
|
<div style={{ display: 'grid', gap: 12, maxWidth: 360 }}>
|
|
@@ -60,34 +62,95 @@ export function App() {
|
|
|
60
62
|
}
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
The picture at the top of this page is made of these components:
|
|
64
66
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
even if you only use a couple of them:
|
|
67
|
+
```tsx
|
|
68
|
+
import { Alert, Avatar, Badge, Button, Checkbox, DatePicker, Input, Progress, Switch } from '@editora/ui-react';
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
export default function Gallery() {
|
|
71
|
+
return (
|
|
72
|
+
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 24, alignItems: 'start' }}>
|
|
73
|
+
<div style={{ display: 'grid', gap: 16 }}>
|
|
74
|
+
<Input label="Project name" description="Shown in the sidebar" placeholder="Untitled" clearable />
|
|
75
|
+
|
|
76
|
+
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap' }}>
|
|
77
|
+
<Button variant="primary">Save</Button>
|
|
78
|
+
<Button variant="secondary">Cancel</Button>
|
|
79
|
+
<Button variant="ghost">Skip</Button>
|
|
80
|
+
<Button variant="danger">Delete</Button>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div style={{ display: 'flex', gap: 8, alignItems: 'center' }}>
|
|
84
|
+
<Badge tone="success" text="Live" />
|
|
85
|
+
<Badge tone="warning" text="Review" />
|
|
86
|
+
<Badge tone="danger" text="Failed" />
|
|
87
|
+
<Avatar initials="AM" />
|
|
88
|
+
<Avatar initials="JK" />
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<Alert title="Heads up" description="Your trial ends in 3 days." tone="warning" />
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div style={{ display: 'grid', gap: 16 }}>
|
|
95
|
+
<Switch checked label="Email notifications" description="A summary every Monday" />
|
|
96
|
+
<Checkbox checked>Remember me</Checkbox>
|
|
97
|
+
<Progress value={64} />
|
|
98
|
+
<DatePicker label="Start date" clearable />
|
|
99
|
+
</div>
|
|
100
|
+
</div>
|
|
101
|
+
);
|
|
102
|
+
}
|
|
71
103
|
```
|
|
72
104
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
105
|
+
## Import from the package or from one component
|
|
106
|
+
|
|
107
|
+
Importing from the package root is the simplest, and it is the heaviest: every wrapper and every component's custom
|
|
108
|
+
element is in the bundle, and the bundler cannot drop the ones you do not use. Each component also has its own entry:
|
|
76
109
|
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
import
|
|
110
|
+
```tsx
|
|
111
|
+
// Everything from the package root: the simplest, and the heaviest.
|
|
112
|
+
import { Button, Input } from '@editora/ui-react';
|
|
113
|
+
// One component per entry: a lighter first load.
|
|
114
|
+
import ButtonOnly from '@editora/ui-react/Button';
|
|
115
|
+
import InputOnly from '@editora/ui-react/Input';
|
|
116
|
+
|
|
117
|
+
export default function Imports() {
|
|
118
|
+
return (
|
|
119
|
+
<div style={{ display: 'grid', gap: 12, maxWidth: 360 }}>
|
|
120
|
+
<Input label="From the root" />
|
|
121
|
+
<InputOnly label="From its own entry" />
|
|
122
|
+
<Button>Root</Button>
|
|
123
|
+
<ButtonOnly>Own entry</ButtonOnly>
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
}
|
|
80
127
|
```
|
|
81
128
|
|
|
82
|
-
|
|
129
|
+
Measured with esbuild, minified, with code splitting, importing one component and leaving React out. This is everything
|
|
130
|
+
the import needs:
|
|
131
|
+
|
|
132
|
+
| Import | Gzipped |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| `import { Button } from '@editora/ui-react'` | 1 MB |
|
|
135
|
+
| `import Button from '@editora/ui-react/Button'` | 55 KB |
|
|
136
|
+
| `import Input from '@editora/ui-react/Input'` | 8 KB |
|
|
137
|
+
| `import DataTable from '@editora/ui-react/DataTable'` | 14 KB |
|
|
138
|
+
|
|
139
|
+
Each entry registers only the custom elements its component renders, so nothing else is fetched later. The package root
|
|
140
|
+
registers the whole catalog on purpose, which is why it is the heavy one.
|
|
83
141
|
|
|
84
|
-
|
|
142
|
+
## Forms
|
|
143
|
+
|
|
144
|
+
`<Form>` finds the `name`d controls inside it. `useForm()` gives you its methods; `onDirtyChange` tells you when the
|
|
145
|
+
values differ from the starting ones:
|
|
85
146
|
|
|
86
147
|
```tsx
|
|
148
|
+
import { useState } from 'react';
|
|
87
149
|
import { Form, Field, Input, Button, useForm } from '@editora/ui-react';
|
|
88
150
|
|
|
89
|
-
export function ProfileForm() {
|
|
90
|
-
const { ref, submit, validate, getValues, reset
|
|
151
|
+
export default function ProfileForm() {
|
|
152
|
+
const { ref, submit, validate, getValues, reset } = useForm();
|
|
153
|
+
const [dirty, setDirty] = useState(false);
|
|
91
154
|
|
|
92
155
|
return (
|
|
93
156
|
<Form
|
|
@@ -96,6 +159,7 @@ export function ProfileForm() {
|
|
|
96
159
|
guardUnsaved
|
|
97
160
|
onSubmit={(values) => console.log('submit', values)}
|
|
98
161
|
onInvalid={(errors) => console.log('invalid', errors)}
|
|
162
|
+
onDirtyChange={(isDirty) => setDirty(isDirty)}
|
|
99
163
|
style={{ display: 'grid', gap: 12, maxWidth: 520 }}
|
|
100
164
|
>
|
|
101
165
|
<Field label="Full name" required>
|
|
@@ -110,14 +174,24 @@ export function ProfileForm() {
|
|
|
110
174
|
<Button variant="secondary" onClick={() => validate()}>Validate</Button>
|
|
111
175
|
<Button variant="secondary" onClick={() => console.log(getValues())}>Values</Button>
|
|
112
176
|
<Button variant="secondary" onClick={() => reset()}>Reset</Button>
|
|
113
|
-
<Button onClick={() => submit()} disabled={!
|
|
177
|
+
<Button onClick={() => submit()} disabled={!dirty}>Submit</Button>
|
|
114
178
|
</div>
|
|
115
179
|
</Form>
|
|
116
180
|
);
|
|
117
181
|
}
|
|
118
182
|
```
|
|
119
183
|
|
|
120
|
-
|
|
184
|
+
<p align="center">
|
|
185
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-react/docs/images/form.png" alt="The form after pressing Validate with both required fields empty: each field shows the message Please fill out this field." width="900">
|
|
186
|
+
</p>
|
|
187
|
+
|
|
188
|
+
`useForm()` returns `ref`, `submit()`, `validate()`, `getValues()`, `reset(values?)`, `isDirty()` and `markClean()`.
|
|
189
|
+
`autosave` reports the values through `onAutosave` after they stop changing, and `guardUnsaved` warns before the page is
|
|
190
|
+
left with unsaved changes.
|
|
191
|
+
|
|
192
|
+
## Promise dialogs
|
|
193
|
+
|
|
194
|
+
Wrap your app in the providers, then `await` the answer from anywhere inside:
|
|
121
195
|
|
|
122
196
|
```tsx
|
|
123
197
|
import { DialogProvider, useDialog, AlertDialogProvider, useAlertDialog, Button } from '@editora/ui-react';
|
|
@@ -157,7 +231,7 @@ function Actions() {
|
|
|
157
231
|
);
|
|
158
232
|
}
|
|
159
233
|
|
|
160
|
-
export function DialogExample() {
|
|
234
|
+
export default function DialogExample() {
|
|
161
235
|
return (
|
|
162
236
|
<DialogProvider>
|
|
163
237
|
<AlertDialogProvider>
|
|
@@ -168,13 +242,23 @@ export function DialogExample() {
|
|
|
168
242
|
}
|
|
169
243
|
```
|
|
170
244
|
|
|
171
|
-
|
|
245
|
+
<p align="center">
|
|
246
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-react/docs/images/dialog.png" alt="A confirm dialog titled Archive project? with the text You can restore it later, and Cancel and Archive buttons, over a dimmed page" width="700">
|
|
247
|
+
</p>
|
|
248
|
+
|
|
249
|
+
`useDialog()` has `open()` and `confirm()`. `useAlertDialog()` is for confirmations and prompts that need an answer.
|
|
250
|
+
Both resolve with an object whose `action` says what the user did. The providers work in `StrictMode`.
|
|
251
|
+
|
|
252
|
+
## Data tables
|
|
253
|
+
|
|
254
|
+
`DataTable` gives a table sorting, selection, column resizing and paging. Link a `Pagination` to it with
|
|
255
|
+
`paginationId`:
|
|
172
256
|
|
|
173
257
|
```tsx
|
|
174
258
|
import { DataTable, Pagination } from '@editora/ui-react';
|
|
175
259
|
import { useState } from 'react';
|
|
176
260
|
|
|
177
|
-
export function UsersTable() {
|
|
261
|
+
export default function UsersTable() {
|
|
178
262
|
const [page, setPage] = useState(1);
|
|
179
263
|
|
|
180
264
|
return (
|
|
@@ -185,7 +269,7 @@ export function UsersTable() {
|
|
|
185
269
|
resizableColumns
|
|
186
270
|
draggableColumns
|
|
187
271
|
page={page}
|
|
188
|
-
pageSize={
|
|
272
|
+
pageSize={2}
|
|
189
273
|
paginationId="users-pager"
|
|
190
274
|
onPageChange={(d) => setPage(d.page)}
|
|
191
275
|
onSortChange={(d) => console.log('sort', d)}
|
|
@@ -202,22 +286,28 @@ export function UsersTable() {
|
|
|
202
286
|
<tbody>
|
|
203
287
|
<tr><td>1</td><td>Asha</td><td>Admin</td></tr>
|
|
204
288
|
<tr><td>2</td><td>Marco</td><td>Editor</td></tr>
|
|
289
|
+
<tr><td>3</td><td>Lena</td><td>Viewer</td></tr>
|
|
290
|
+
<tr><td>4</td><td>Tariq</td><td>Editor</td></tr>
|
|
205
291
|
</tbody>
|
|
206
292
|
</table>
|
|
207
293
|
</DataTable>
|
|
208
294
|
|
|
209
|
-
<Pagination id="users-pager" page={
|
|
295
|
+
<Pagination id="users-pager" page={page} />
|
|
210
296
|
</div>
|
|
211
297
|
);
|
|
212
298
|
}
|
|
213
299
|
```
|
|
214
300
|
|
|
215
|
-
|
|
301
|
+
<p align="center">
|
|
302
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-react/docs/images/data-table.png" alt="A table with sortable ID, Name and Role columns showing two rows, and a pager with two pages that reads Showing 1-2 of 4" width="900">
|
|
303
|
+
</p>
|
|
304
|
+
|
|
305
|
+
## Pickers
|
|
216
306
|
|
|
217
307
|
```tsx
|
|
218
308
|
import { DatePicker, DateRangePicker, DateTimePicker, ColorPicker } from '@editora/ui-react';
|
|
219
309
|
|
|
220
|
-
export function PickersDemo() {
|
|
310
|
+
export default function PickersDemo() {
|
|
221
311
|
return (
|
|
222
312
|
<div style={{ display: 'grid', gap: 12, maxWidth: 420 }}>
|
|
223
313
|
<DatePicker label="Start date" clearable onValueChange={(v) => console.log(v)} />
|
|
@@ -229,27 +319,37 @@ export function PickersDemo() {
|
|
|
229
319
|
}
|
|
230
320
|
```
|
|
231
321
|
|
|
322
|
+
<p align="center">
|
|
323
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-react/docs/images/pickers.png" alt="A date picker, a date range picker, a date and time picker and a colour picker" width="900">
|
|
324
|
+
</p>
|
|
325
|
+
|
|
232
326
|
## Theming
|
|
233
327
|
|
|
234
|
-
`ThemeProvider` applies `@editora/ui-core`
|
|
328
|
+
`ThemeProvider` applies the design tokens of `@editora/ui-core` as CSS variables. With `storageKey` it remembers the
|
|
329
|
+
theme in `localStorage`:
|
|
235
330
|
|
|
236
331
|
```tsx
|
|
237
|
-
import { ThemeProvider } from '@editora/ui-react';
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
332
|
+
import { Button, ThemeProvider } from '@editora/ui-react';
|
|
333
|
+
|
|
334
|
+
export default function Themed() {
|
|
335
|
+
return (
|
|
336
|
+
<ThemeProvider
|
|
337
|
+
tokens={{
|
|
338
|
+
colors: { primary: '#0f766e', text: '#0f172a', background: '#ffffff' },
|
|
339
|
+
radius: '10px'
|
|
340
|
+
}}
|
|
341
|
+
storageKey="my-app.theme"
|
|
342
|
+
>
|
|
343
|
+
<Button variant="primary">Save</Button>
|
|
344
|
+
</ThemeProvider>
|
|
345
|
+
);
|
|
346
|
+
}
|
|
248
347
|
```
|
|
249
348
|
|
|
250
|
-
## Gantt
|
|
349
|
+
## Gantt planner
|
|
251
350
|
|
|
252
|
-
`Gantt` is
|
|
351
|
+
`Gantt` is a planning timeline: tasks, summary rows and milestones, dependencies, baselines, critical tasks, drag and
|
|
352
|
+
resize, keyboard selection and a toolbar for zoom, filter and sort.
|
|
253
353
|
|
|
254
354
|
```tsx
|
|
255
355
|
import { Gantt, type GanttLink, type GanttTask } from '@editora/ui-react';
|
|
@@ -279,7 +379,7 @@ const links: GanttLink[] = [
|
|
|
279
379
|
{ id: 'foundation-handoff', source: 'foundation', target: 'handoff', type: 'e2s' }
|
|
280
380
|
];
|
|
281
381
|
|
|
282
|
-
export function PlanningDemo() {
|
|
382
|
+
export default function PlanningDemo() {
|
|
283
383
|
const [tasks, setTasks] = useState(initialTasks);
|
|
284
384
|
|
|
285
385
|
return (
|
|
@@ -299,48 +399,19 @@ export function PlanningDemo() {
|
|
|
299
399
|
}
|
|
300
400
|
```
|
|
301
401
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
- Bar designs: `solid`, `soft`, `striped`, `outline`, and `glass`.
|
|
306
|
-
- Planning data: baselines, critical tasks, milestones, parent/child summaries, assignees, progress, and split segments.
|
|
307
|
-
- Interaction: drag, resize, keyboard task selection, delete events, toolbar zoom/filter/sort, and readonly mode.
|
|
308
|
-
- Scale: row virtualization turns on automatically for large task sets; pass `virtualized={false}` only for small custom layouts.
|
|
309
|
-
|
|
310
|
-
## Component Catalog
|
|
311
|
-
|
|
312
|
-
### Form and inputs
|
|
313
|
-
- `Form`, `Field`, `Label`, `Input`, `Textarea`, `Select`, `Combobox`
|
|
314
|
-
- `Checkbox`, `Radio`, `RadioGroup`, `Switch`, `Slider`
|
|
315
|
-
- `DatePicker`, `DateRangePicker`, `TimePicker`, `DateTimePicker`, `DateRangeTimePicker`
|
|
316
|
-
- `ColorPicker`
|
|
317
|
-
|
|
318
|
-
### Data and display
|
|
319
|
-
- `Table`, `DataTable`, `Pagination`
|
|
320
|
-
- `Calendar`, `Chart`, `Timeline`, `Gantt`
|
|
321
|
-
- `Badge`, `Alert`, `Skeleton`, `EmptyState`, `Progress`, `Avatar`, `AspectRatio`
|
|
322
|
-
|
|
323
|
-
### Overlay and interaction
|
|
324
|
-
- `Tooltip`, `HoverCard`, `Popover`, `Dropdown`, `Menu`, `Menubar`, `ContextMenu`
|
|
325
|
-
- `Dialog`, `AlertDialog`, `Drawer`, `Portal`, `Presence`
|
|
326
|
-
- `CommandPalette`, `QuickActions`, `Toolbar`, `FloatingToolbar`, `BlockControls`, `SelectionPopup`, `PluginPanel`
|
|
327
|
-
|
|
328
|
-
### Navigation and layout
|
|
329
|
-
- `Layout`, `Sidebar`, `AppHeader`, `Breadcrumb`, `NavigationMenu`, `Tabs`
|
|
330
|
-
- `Box`, `Flex`, `Grid`, `Section`, `Container`, `Separator`, `Slot`, `VisuallyHidden`
|
|
331
|
-
- `Accordion`, `Collapsible`, `Stepper`, `Wizard`, `DirectionProvider`
|
|
332
|
-
|
|
333
|
-
### APIs and hooks
|
|
334
|
-
- `DialogProvider`, `useDialog`
|
|
335
|
-
- `AlertDialogProvider`, `useAlertDialog`
|
|
336
|
-
- `ThemeProvider`, `useTheme`
|
|
337
|
-
- `useForm`, `useFloating`
|
|
402
|
+
<p align="center">
|
|
403
|
+
<img src="https://raw.githubusercontent.com/ajaykr089/Editora/main/packages/ui-react/docs/images/gantt.png" alt="A Gantt chart with a task bar for Foundation, a baseline under it, and an arrow to the Handoff milestone" width="900">
|
|
404
|
+
</p>
|
|
338
405
|
|
|
339
|
-
|
|
406
|
+
- Dependency types: `e2s`, `s2s`, `e2e` and `s2e`. Bar designs: `solid`, `soft`, `striped`, `outline` and `glass`.
|
|
407
|
+
- Also in the data: baselines, critical tasks, milestones, parent and child summaries, assignees, progress and split
|
|
408
|
+
segments. Row virtualization turns on for large task sets; pass `virtualized={false}` for small custom layouts.
|
|
409
|
+
- The types `GanttTask`, `GanttLink`, `GanttTaskChangeDetail` and `GanttLinkSelectDetail` are exported.
|
|
340
410
|
|
|
341
|
-
|
|
411
|
+
## Floating layers
|
|
342
412
|
|
|
343
|
-
|
|
413
|
+
`useFloating()` positions a layer next to its anchor; `useInteractions()` combines the interaction hooks. This is the
|
|
414
|
+
layer the menus, popovers and tooltips are built on:
|
|
344
415
|
|
|
345
416
|
```tsx
|
|
346
417
|
import {
|
|
@@ -353,13 +424,14 @@ import {
|
|
|
353
424
|
useInteractions
|
|
354
425
|
} from '@editora/ui-react';
|
|
355
426
|
|
|
356
|
-
function Example() {
|
|
427
|
+
export default function Example() {
|
|
357
428
|
const floating = useFloating({
|
|
358
429
|
placement: 'bottom-start',
|
|
359
430
|
offset: 10,
|
|
360
431
|
flip: true,
|
|
361
432
|
shift: true,
|
|
362
|
-
fitViewport: true
|
|
433
|
+
fitViewport: true,
|
|
434
|
+
strategy: 'fixed'
|
|
363
435
|
});
|
|
364
436
|
|
|
365
437
|
const interactions = useInteractions([
|
|
@@ -380,7 +452,7 @@ function Example() {
|
|
|
380
452
|
ref={floating.floatingRef}
|
|
381
453
|
{...interactions.getFloatingProps({
|
|
382
454
|
style: {
|
|
383
|
-
position:
|
|
455
|
+
position: 'fixed',
|
|
384
456
|
top: floating.coords.top,
|
|
385
457
|
left: floating.coords.left
|
|
386
458
|
}
|
|
@@ -397,34 +469,67 @@ function Example() {
|
|
|
397
469
|
}
|
|
398
470
|
```
|
|
399
471
|
|
|
400
|
-
|
|
472
|
+
More hooks: `useHover`, `useFocus`, `useRole`, `useListNavigation` and `useTypeahead`. More helpers: `FloatingOverlay`,
|
|
473
|
+
`FloatingTree`, `FloatingList` and `FloatingDelayGroup`. For the same engine without React, see `createPositioner` in
|
|
474
|
+
[`@editora/ui-core`](https://www.npmjs.com/package/@editora/ui-core#floating-positioning).
|
|
401
475
|
|
|
402
|
-
|
|
403
|
-
- helpers: `FloatingArrow`, `FloatingPortal`, `FloatingOverlay`, `FloatingFocusManager`, `FloatingTree`, `FloatingList`, `FloatingDelayGroup`, `Composite`
|
|
476
|
+
## Components
|
|
404
477
|
|
|
405
|
-
|
|
478
|
+
**Forms and inputs:**
|
|
479
|
+
`Form`, `Field`, `Label`, `Input`, `Textarea`, `Select`, `Combobox`,
|
|
480
|
+
`Checkbox`, `Radio`, `RadioGroup`, `Switch`, `Slider`,
|
|
481
|
+
`DatePicker`, `DateRangePicker`, `TimePicker`, `DateTimePicker`, `DateRangeTimePicker`, `ColorPicker`
|
|
406
482
|
|
|
407
|
-
|
|
483
|
+
**Data and display:**
|
|
484
|
+
`Table`, `DataTable`, `Pagination`, `Calendar`, `Chart`, `Timeline`, `Gantt`,
|
|
485
|
+
`Badge`, `Alert`, `Skeleton`, `EmptyState`, `Progress`, `Avatar`, `AspectRatio`
|
|
408
486
|
|
|
409
|
-
|
|
487
|
+
**Overlays and interaction:**
|
|
488
|
+
`Tooltip`, `HoverCard`, `Popover`, `Dropdown`, `Menu`, `Menubar`, `ContextMenu`,
|
|
489
|
+
`Dialog`, `AlertDialog`, `Drawer`, `Portal`, `Presence`,
|
|
490
|
+
`CommandPalette`, `QuickActions`, `Toolbar`, `FloatingToolbar`, `BlockControls`, `SelectionPopup`, `PluginPanel`
|
|
410
491
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
492
|
+
**Navigation and layout:**
|
|
493
|
+
`Layout`, `Sidebar`, `AppHeader`, `Breadcrumb`, `NavigationMenu`, `Tabs`,
|
|
494
|
+
`Box`, `Flex`, `Grid`, `Section`, `Container`, `Separator`, `Slot`, `VisuallyHidden`,
|
|
495
|
+
`Accordion`, `Collapsible`, `Stepper`, `Wizard`, `DirectionProvider`
|
|
414
496
|
|
|
415
|
-
|
|
497
|
+
**Providers and hooks:**
|
|
498
|
+
`DialogProvider`, `useDialog`, `AlertDialogProvider`, `useAlertDialog`, `ThemeProvider`, `useTheme`, `useForm`, `useFloating`
|
|
416
499
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
500
|
+
## Server rendering
|
|
501
|
+
|
|
502
|
+
The package can be imported on the server: loading a module does not touch the DOM, and the custom elements are defined
|
|
503
|
+
only in the browser. A `'use client'` file that uses these components is still rendered on the server first (Next.js
|
|
504
|
+
does this), and that HTML carries the `<ui-*>` tags, which upgrade once the browser has loaded the package.
|
|
505
|
+
|
|
506
|
+
In React Server Components import from `@editora/ui-react/server`. It has no hooks, so a server component can load it,
|
|
507
|
+
and it holds the components that need none: `Box`, `Flex`, `Grid`, `Container`, `Section`, `Separator`, `Anchor`,
|
|
508
|
+
`AspectRatio`, `Field`, `Label`, `Icon`, `Kbd`, `Shortcut`, `Stat`, `MetricCard`, `CodeBlock`, `CodeSnippet`,
|
|
509
|
+
`DirectionProvider` and `VisuallyHidden`. It only renders the markup. To define the elements, import
|
|
510
|
+
`@editora/ui-react/client` (or the package root) from a client component; a page made of server components alone never
|
|
511
|
+
loads the definitions, so its `<ui-*>` tags are not upgraded.
|
|
422
512
|
|
|
423
|
-
|
|
513
|
+
In development React can log a hydration warning for client components: the elements add their own inline styles and
|
|
514
|
+
attributes as soon as they are defined, before React hydrates. The page works. The dialog providers create their host
|
|
515
|
+
element on the client, in an effect, and clean it up when they unmount.
|
|
424
516
|
|
|
425
517
|
## Troubleshooting
|
|
426
518
|
|
|
427
|
-
-
|
|
428
|
-
|
|
429
|
-
-
|
|
430
|
-
|
|
519
|
+
- **A component renders as an empty tag, or React warns that a tag is not registered.** Import the wrapper from the
|
|
520
|
+
package root or from its own entry (`@editora/ui-react/Button`); both register the element.
|
|
521
|
+
- **A callback does not fire as expected.** Use the typed `detail` that wrapper callbacks receive, such as
|
|
522
|
+
`onPageChange={(d) => d.page}`, instead of parsing the DOM event.
|
|
523
|
+
|
|
524
|
+
## The rest of the family
|
|
525
|
+
|
|
526
|
+
| Package | |
|
|
527
|
+
| --- | --- |
|
|
528
|
+
| [`@editora/ui-core`](https://www.npmjs.com/package/@editora/ui-core) | The web components these wrap, for any framework. |
|
|
529
|
+
| [`@editora/ui-sortable`](https://www.npmjs.com/package/@editora/ui-sortable) | Sortable lists and boards, with a React wrapper. |
|
|
530
|
+
| [`@editora/toast`](https://www.npmjs.com/package/@editora/toast) | Toast notifications. |
|
|
531
|
+
| [`@editora/react`](https://www.npmjs.com/package/@editora/react) | The Editora rich text editor for React. |
|
|
532
|
+
|
|
533
|
+
## License
|
|
534
|
+
|
|
535
|
+
MIT © [Ajay Kumar](https://github.com/ajaykr089)
|
package/dist/Accordion.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const L=require("react");require("@editora/ui-core/accordion");const T=require("./_internals-C6EP1OPI.js"),q=require("./_createElement-DC52GmgH.js");function M(t){if(t&&t.__esModule)return t;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,o.get?o:{enumerable:!0,get:()=>t[e]})}}return r.default=t,Object.freeze(r)}const c=M(L),h=typeof window<"u"?c.useLayoutEffect:c.useEffect;function x(t,r,e){if(e==null){t.removeAttribute(r);return}e?t.setAttribute(r,""):t.removeAttribute(r)}function l(t,r,e){const o=t.getAttribute(r);if(e==null||e===""){o!=null&&t.removeAttribute(r);return}o!==e&&t.setAttribute(r,e)}function N(t){return t.detail?.open}const P=c.forwardRef(function({multiple:r,collapsible:e,open:o,variant:u,size:d,radius:f,tone:i,indicator:s,shape:A,elevation:g,onToggle:b,onChangeOpen:p,children:R,...O},j){const m=c.useRef(null);return c.useImperativeHandle(j,()=>m.current),c.useEffect(()=>{T.warnIfElementNotRegistered("ui-accordion","Accordion")},[]),h(()=>{const n=m.current;n&&(x(n,"multiple",r),e==null?n.removeAttribute("collapsible"):n.setAttribute("collapsible",String(!!e)),o==null?n.removeAttribute("open"):n.setAttribute("open",Array.isArray(o)?JSON.stringify(o):String(o)),l(n,"variant",u&&u!=="surface"?u:null),l(n,"size",d&&d!=="md"?d:null),l(n,"radius",f!=null?String(f):null),l(n,"tone",i&&i!=="neutral"?i:null),l(n,"indicator",s&&s!=="line"?s:null),l(n,"shape",A&&A!=="default"?A:null),l(n,"elevation",g&&g!=="default"?g:null))},[r,e,o,u,d,f,i,s,A,g]),c.useEffect(()=>{const n=m.current;if(!n||!b&&!p)return;const _=y=>{const a=N(y);a!=null&&b?.(a)},w=y=>{const a=N(y);a!=null&&p?.(a)};return n.addEventListener("toggle",_),n.addEventListener("change",w),()=>{n.removeEventListener("toggle",_),n.removeEventListener("change",w)}},[b,p]),q.createUIElement("ui-accordion",{ref:m,...O},R)});P.displayName="Accordion";const E=c.forwardRef(function({disabled:r,description:e,badge:o,children:u,...d},f){const i={ref:f,"data-ui-accordion-item":"",...d};return r&&(i.disabled=!0),e!=null&&(i["data-description"]=String(e)),o!=null&&(i["data-badge"]=String(o)),c.createElement("div",i,u)});E.displayName="AccordionItem";const S=c.forwardRef(function({type:r,children:e,...o},u){return c.createElement("button",{ref:u,type:r||"button","data-ui-accordion-trigger":"",...o},e)});S.displayName="AccordionTrigger";const v=c.forwardRef(function({children:r,...e},o){return c.createElement("div",{ref:o,"data-ui-accordion-panel":"",...e},r)});v.displayName="AccordionPanel";const I=Object.assign(P,{Item:E,Trigger:S,Panel:v});I.displayName="Accordion";exports.Accordion=I;exports.AccordionItem=E;exports.AccordionPanel=v;exports.AccordionTrigger=S;exports.default=I;
|
package/dist/Accordion.esm.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import * as i from "react";
|
|
3
3
|
import "@editora/ui-core/accordion";
|
|
4
|
-
import { w as T
|
|
4
|
+
import { w as T } from "./_internals-DnSIpvQ-.mjs";
|
|
5
|
+
import { c as h } from "./_createElement-DheOwG2B.mjs";
|
|
5
6
|
const B = typeof window < "u" ? i.useLayoutEffect : i.useEffect;
|
|
6
7
|
function j(o, r, e) {
|
|
7
8
|
if (e == null) {
|
|
@@ -21,34 +22,34 @@ function l(o, r, e) {
|
|
|
21
22
|
function I(o) {
|
|
22
23
|
return o.detail?.open;
|
|
23
24
|
}
|
|
24
|
-
const N = i.forwardRef(function({ multiple: r, collapsible: e, open: n, variant: u, size:
|
|
25
|
+
const N = i.forwardRef(function({ multiple: r, collapsible: e, open: n, variant: u, size: f, radius: d, tone: c, indicator: a, shape: A, elevation: m, onToggle: b, onChangeOpen: p, children: S, ...P }, x) {
|
|
25
26
|
const g = i.useRef(null);
|
|
26
27
|
return i.useImperativeHandle(x, () => g.current), i.useEffect(() => {
|
|
27
28
|
T("ui-accordion", "Accordion");
|
|
28
29
|
}, []), B(() => {
|
|
29
30
|
const t = g.current;
|
|
30
|
-
t && (j(t, "multiple", r), e == null ? t.removeAttribute("collapsible") : t.setAttribute("collapsible", String(!!e)), n == null ? t.removeAttribute("open") : t.setAttribute("open", Array.isArray(n) ? JSON.stringify(n) : String(n)), l(t, "variant", u && u !== "surface" ? u : null), l(t, "size",
|
|
31
|
-
}, [r, e, n, u,
|
|
31
|
+
t && (j(t, "multiple", r), e == null ? t.removeAttribute("collapsible") : t.setAttribute("collapsible", String(!!e)), n == null ? t.removeAttribute("open") : t.setAttribute("open", Array.isArray(n) ? JSON.stringify(n) : String(n)), l(t, "variant", u && u !== "surface" ? u : null), l(t, "size", f && f !== "md" ? f : null), l(t, "radius", d != null ? String(d) : null), l(t, "tone", c && c !== "neutral" ? c : null), l(t, "indicator", a && a !== "line" ? a : null), l(t, "shape", A && A !== "default" ? A : null), l(t, "elevation", m && m !== "default" ? m : null));
|
|
32
|
+
}, [r, e, n, u, f, d, c, a, A, m]), i.useEffect(() => {
|
|
32
33
|
const t = g.current;
|
|
33
|
-
if (!t || !b && !
|
|
34
|
-
const y = (
|
|
35
|
-
const s = I(
|
|
34
|
+
if (!t || !b && !p) return;
|
|
35
|
+
const y = (E) => {
|
|
36
|
+
const s = I(E);
|
|
36
37
|
s != null && b?.(s);
|
|
37
|
-
}, w = (
|
|
38
|
-
const s = I(
|
|
39
|
-
s != null &&
|
|
38
|
+
}, w = (E) => {
|
|
39
|
+
const s = I(E);
|
|
40
|
+
s != null && p?.(s);
|
|
40
41
|
};
|
|
41
42
|
return t.addEventListener("toggle", y), t.addEventListener("change", w), () => {
|
|
42
43
|
t.removeEventListener("toggle", y), t.removeEventListener("change", w);
|
|
43
44
|
};
|
|
44
|
-
}, [b,
|
|
45
|
+
}, [b, p]), h("ui-accordion", { ref: g, ...P }, S);
|
|
45
46
|
});
|
|
46
47
|
N.displayName = "Accordion";
|
|
47
|
-
const R = i.forwardRef(function({ disabled: r, description: e, badge: n, children: u, ...
|
|
48
|
+
const R = i.forwardRef(function({ disabled: r, description: e, badge: n, children: u, ...f }, d) {
|
|
48
49
|
const c = {
|
|
49
|
-
ref:
|
|
50
|
+
ref: d,
|
|
50
51
|
"data-ui-accordion-item": "",
|
|
51
|
-
...
|
|
52
|
+
...f
|
|
52
53
|
};
|
|
53
54
|
return r && (c.disabled = !0), e != null && (c["data-description"] = String(e)), n != null && (c["data-badge"] = String(n)), i.createElement("div", c, u);
|
|
54
55
|
});
|
package/dist/Alert.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
2
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const w=require("react");require("@editora/ui-core/alert");const t=require("./_internals-C6EP1OPI.js"),B=require("./_createElement-DC52GmgH.js"),M=n=>n&&n.__esModule?n:{default:n},f=M(w),E=f.default.forwardRef(function(p,u){const{title:s,description:c,tone:y,variant:d,layout:A,size:i,radius:a,elevation:l,indicator:o,dismissible:r,open:g,headless:S,onClose:v,children:h,...q}=p,m=t.useForwardedHostRef(u),_=f.default.useCallback(()=>{v?.()},[v]);return t.useElementEventListeners(m,[{type:"close",listener:_}],[_]),t.useElementAttributes(m,e=>{t.syncStringAttribute(e,"title",s??null),t.syncStringAttribute(e,"description",c??null),t.syncStringAttribute(e,"tone",y??null),t.syncStringAttribute(e,"variant",d??null),t.syncStringAttribute(e,"layout",A??null),t.syncStringAttribute(e,"size",i&&i!=="md"?i:null),t.syncStringAttribute(e,"radius",a!=null?String(a):null),t.syncStringAttribute(e,"elevation",l&&l!=="low"?l:null),t.syncStringAttribute(e,"indicator",o&&o!=="line"?o:null),t.syncBooleanAttribute(e,"dismissible",r),t.syncBooleanAttribute(e,"headless",S),t.syncBooleanAttribute(e,"hidden",typeof g=="boolean"?!g:void 0)},[s,c,y,d,A,i,a,l,o,r,g,S]),B.createUIElement("ui-alert",{ref:m,...q},h)});E.displayName="Alert";function b(n,p,u,s){const c=f.default.forwardRef(function({as:d,children:A,style:i,...a},l){const o=d||n,r={ref:l,...a};return u&&(r.slot=u),s&&(r[s]=""),i&&(r.style=i),f.default.createElement(o,r,A)});return c.displayName=p,c}const T=b("span","AlertIcon","icon","data-ui-alert-icon"),C=b("div","AlertTitle","title","data-ui-alert-title"),D=b("div","AlertDescription",void 0,"data-ui-alert-description"),I=b("div","AlertActions","actions","data-ui-alert-actions"),R=Object.assign(E,{Icon:T,Title:C,Description:D,Actions:I,displayName:"Alert"});exports.Alert=R;exports.AlertActions=I;exports.AlertDescription=D;exports.AlertIcon=T;exports.AlertTitle=C;exports.default=R;
|