datocms-react-ui 3.0.0-alpha.0 → 3.1.0-next.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 +125 -9
- package/dist/ApiKey.d.ts +2 -0
- package/dist/ApiKey.js +2 -0
- package/dist/Aside.d.ts +2 -0
- package/dist/Aside.js +2 -0
- package/dist/AutosizeInput.d.ts +2 -0
- package/dist/AutosizeInput.js +2 -0
- package/dist/Avatar.d.ts +2 -0
- package/dist/Avatar.js +2 -0
- package/dist/BlankSlate.d.ts +2 -0
- package/dist/BlankSlate.js +2 -0
- package/dist/Button.d.ts +2 -0
- package/dist/Button.js +2 -0
- package/dist/Callout.d.ts +2 -0
- package/dist/Callout.js +2 -0
- package/dist/Canvas.d.ts +2 -0
- package/dist/Canvas.js +3 -0
- package/dist/CardList.d.ts +2 -0
- package/dist/CardList.js +2 -0
- package/dist/Chevron.d.ts +1 -0
- package/dist/Chevron.js +2 -0
- package/dist/CodeSnippet.d.ts +2 -0
- package/dist/CodeSnippet.js +2 -0
- package/dist/ContextInspector.d.ts +2 -0
- package/dist/ContextInspector.js +2 -0
- package/dist/CopyButton.d.ts +2 -0
- package/dist/CopyButton.js +2 -0
- package/dist/CopyableId.d.ts +2 -0
- package/dist/CopyableId.js +2 -0
- package/dist/CopyableValue.d.ts +2 -0
- package/dist/CopyableValue.js +2 -0
- package/dist/DateSettings.d.ts +1 -0
- package/dist/DateSettings.js +2 -0
- package/dist/DebouncedTextInput.d.ts +2 -0
- package/dist/DebouncedTextInput.js +2 -0
- package/dist/Dropdown/triggers/ButtonTrigger.d.ts +2 -0
- package/dist/Dropdown/triggers/ButtonTrigger.js +2 -0
- package/dist/Dropdown/triggers/DropdownTriggerButton.d.ts +2 -0
- package/dist/Dropdown/triggers/DropdownTriggerButton.js +2 -0
- package/dist/Dropdown/triggers/IconTrigger.d.ts +2 -0
- package/dist/Dropdown/triggers/IconTrigger.js +2 -0
- package/dist/Dropdown/triggers/PillTrigger.d.ts +2 -0
- package/dist/Dropdown/triggers/PillTrigger.js +2 -0
- package/dist/Dropdown/triggers/TextualTrigger.d.ts +2 -0
- package/dist/Dropdown/triggers/TextualTrigger.js +2 -0
- package/dist/Dropdown/triggers/types.d.ts +1 -0
- package/dist/Dropdown.d.ts +1 -0
- package/dist/Dropdown.js +4 -0
- package/dist/EditorToolbar.d.ts +1 -0
- package/dist/EditorToolbar.js +3 -0
- package/dist/EmptySlot.d.ts +2 -0
- package/dist/EmptySlot.js +2 -0
- package/dist/EntityRow.d.ts +2 -0
- package/dist/EntityRow.js +2 -0
- package/dist/EntitySummary.d.ts +2 -0
- package/dist/EntitySummary.js +2 -0
- package/dist/FeedbackDot.d.ts +2 -0
- package/dist/FeedbackDot.js +2 -0
- package/dist/FieldHint.d.ts +2 -0
- package/dist/FieldHint.js +2 -0
- package/dist/FieldWrapper.d.ts +2 -0
- package/dist/FieldWrapper.js +2 -0
- package/dist/FramedImage.d.ts +2 -0
- package/dist/FramedImage.js +2 -0
- package/dist/FullscreenModal.d.ts +2 -0
- package/dist/FullscreenModal.js +2 -0
- package/dist/Heading.d.ts +2 -0
- package/dist/Heading.js +2 -0
- package/dist/HotKey.d.ts +1 -0
- package/dist/HotKey.js +2 -0
- package/dist/HoverCard.d.ts +2 -0
- package/dist/HoverCard.js +2 -0
- package/dist/IdText.d.ts +2 -0
- package/dist/IdText.js +2 -0
- package/dist/InfoList.d.ts +2 -0
- package/dist/InfoList.js +2 -0
- package/dist/InitialsAvatar.d.ts +2 -0
- package/dist/InitialsAvatar.js +2 -0
- package/dist/InputGroup.d.ts +2 -0
- package/dist/InputGroup.js +2 -0
- package/dist/InsertGap.d.ts +2 -0
- package/dist/InsertGap.js +2 -0
- package/dist/KeyValueList.d.ts +2 -0
- package/dist/KeyValueList.js +2 -0
- package/dist/Label.d.ts +2 -0
- package/dist/Label.js +2 -0
- package/dist/Link.d.ts +2 -0
- package/dist/Link.js +2 -0
- package/dist/ListArea.d.ts +2 -0
- package/dist/ListArea.js +2 -0
- package/dist/ListDetail.d.ts +1 -0
- package/dist/ListDetail.js +5 -0
- package/dist/ListFormPage.d.ts +2 -0
- package/dist/ListFormPage.js +2 -0
- package/dist/ListOrOverview.d.ts +2 -0
- package/dist/ListOrOverview.js +2 -0
- package/dist/Main.d.ts +2 -0
- package/dist/Main.js +2 -0
- package/dist/MediaCard.d.ts +2 -0
- package/dist/MediaCard.js +2 -0
- package/dist/Message.d.ts +1 -0
- package/dist/Message.js +2 -0
- package/dist/Modal.d.ts +2 -0
- package/dist/Modal.js +2 -0
- package/dist/MultipleSelectionActionBar.d.ts +2 -0
- package/dist/MultipleSelectionActionBar.js +2 -0
- package/dist/Nav.d.ts +2 -0
- package/dist/Nav.js +2 -0
- package/dist/NavList.d.ts +2 -0
- package/dist/NavList.js +2 -0
- package/dist/NewZIndex.d.ts +2 -0
- package/dist/NewZIndex.js +2 -0
- package/dist/NumberInput.d.ts +2 -0
- package/dist/NumberInput.js +2 -0
- package/dist/Page.d.ts +1 -0
- package/dist/Page.js +2 -0
- package/dist/Pane.d.ts +2 -0
- package/dist/Pane.js +4 -0
- package/dist/PasswordInput.d.ts +2 -0
- package/dist/PasswordInput.js +2 -0
- package/dist/Pill.d.ts +2 -0
- package/dist/Pill.js +2 -0
- package/dist/Popover.d.ts +2 -0
- package/dist/Popover.js +2 -0
- package/dist/Portal.d.ts +2 -0
- package/dist/Portal.js +2 -0
- package/dist/ProgressBar.d.ts +2 -0
- package/dist/ProgressBar.js +2 -0
- package/dist/RadioGroupInput.d.ts +2 -0
- package/dist/RadioGroupInput.js +2 -0
- package/dist/RawButton.d.ts +2 -0
- package/dist/RawButton.js +2 -0
- package/dist/RowList.d.ts +2 -0
- package/dist/RowList.js +2 -0
- package/dist/Search.d.ts +2 -0
- package/dist/Search.js +2 -0
- package/dist/SegmentedControl.d.ts +2 -0
- package/dist/SegmentedControl.js +2 -0
- package/dist/SelectInput.d.ts +2 -0
- package/dist/SelectInput.js +3 -0
- package/dist/SettingsList.d.ts +2 -0
- package/dist/SettingsList.js +2 -0
- package/dist/SettingsMenu.d.ts +2 -0
- package/dist/SettingsMenu.js +2 -0
- package/dist/SidebarPanel.d.ts +2 -0
- package/dist/SidebarPanel.js +3 -0
- package/dist/SidebarTree.d.ts +1 -0
- package/dist/SidebarTree.js +3 -0
- package/dist/SmartDate.d.ts +2 -0
- package/dist/SmartDate.js +2 -0
- package/dist/Spinner.d.ts +2 -0
- package/dist/Spinner.js +2 -0
- package/dist/SplitButton.d.ts +2 -0
- package/dist/SplitButton.js +2 -0
- package/dist/SplitPane.d.ts +2 -0
- package/dist/SplitPane.js +2 -0
- package/dist/StringInput.d.ts +2 -0
- package/dist/StringInput.js +2 -0
- package/dist/SwitchInput.d.ts +2 -0
- package/dist/SwitchInput.js +2 -0
- package/dist/SwitchList.d.ts +2 -0
- package/dist/SwitchList.js +2 -0
- package/dist/Table/cells/IconCell.d.ts +2 -0
- package/dist/Table/cells/IconCell.js +2 -0
- package/dist/Table/cells/LinkCell.d.ts +2 -0
- package/dist/Table/cells/LinkCell.js +2 -0
- package/dist/Table/cells/StatusCell.d.ts +2 -0
- package/dist/Table/cells/StatusCell.js +2 -0
- package/dist/Table/cells/TimeCell.d.ts +2 -0
- package/dist/Table/cells/TimeCell.js +2 -0
- package/dist/Table.d.ts +1 -0
- package/dist/Table.js +5 -0
- package/dist/TableList.d.ts +2 -0
- package/dist/TableList.js +2 -0
- package/dist/Tabs.d.ts +1 -0
- package/dist/Tabs.js +2 -0
- package/dist/TextareaInput.d.ts +2 -0
- package/dist/TextareaInput.js +2 -0
- package/dist/Toolbar.d.ts +2 -0
- package/dist/Toolbar.js +3 -0
- package/dist/Tooltip.d.ts +2 -0
- package/dist/Tooltip.js +2 -0
- package/dist/UploadThreatTriangle.d.ts +2 -0
- package/dist/UploadThreatTriangle.js +2 -0
- package/dist/UsageMeter.d.ts +1 -0
- package/dist/UsageMeter.js +2 -0
- package/dist/ValidityTriangles.d.ts +1 -0
- package/dist/ValidityTriangles.js +2 -0
- package/dist/dnd.d.ts +1 -0
- package/dist/dnd.js +17 -0
- package/dist/hooks/useAsyncSelectOptions.d.ts +1 -0
- package/dist/hooks/useAsyncSelectOptions.js +2 -0
- package/dist/hooks/useClickOutside.d.ts +1 -0
- package/dist/hooks/useClickOutside.js +2 -0
- package/dist/hooks/useCopyToClipboard.d.ts +1 -0
- package/dist/hooks/useCopyToClipboard.js +2 -0
- package/dist/hooks/useDebounceOnBoolean.d.ts +1 -0
- package/dist/hooks/useDebounceOnBoolean.js +2 -0
- package/dist/hooks/useDebouncedCallback.d.ts +1 -0
- package/dist/hooks/useDebouncedCallback.js +2 -0
- package/dist/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/hooks/useDebouncedValue.js +2 -0
- package/dist/hooks/useDeepCompareEffect.d.ts +1 -0
- package/dist/hooks/useDeepCompareEffect.js +2 -0
- package/dist/hooks/useDidUpdateEffect.d.ts +1 -0
- package/dist/hooks/useDidUpdateEffect.js +2 -0
- package/dist/hooks/useElementLayout.d.ts +1 -0
- package/dist/hooks/useElementLayout.js +2 -0
- package/dist/hooks/useMediaQuery.d.ts +1 -0
- package/dist/hooks/useMediaQuery.js +2 -0
- package/dist/hooks/useRovingKeyDown.d.ts +1 -0
- package/dist/hooks/useRovingKeyDown.js +2 -0
- package/dist/hooks/useShallowEqual.d.ts +1 -0
- package/dist/hooks/useShallowEqual.js +2 -0
- package/dist/hooks/useSmartRowClick.d.ts +1 -0
- package/dist/hooks/useSmartRowClick.js +2 -0
- package/dist/internal/BundledTexts.d.ts +2 -0
- package/dist/internal/BundledTexts.js +2 -0
- package/dist/internal/DateSettings.d.ts +1 -0
- package/dist/internal/DateSettings.js +2 -0
- package/dist/internal/NavigationProvider.d.ts +2 -0
- package/dist/internal/NavigationProvider.js +2 -0
- package/dist/internal/TextsProvider.d.ts +2 -0
- package/dist/internal/TextsProvider.js +2 -0
- package/dist/react-ui/locales/en.js +12 -0
- package/dist/react-ui/src/Canvas.d.ts +50 -0
- package/dist/react-ui/src/Canvas.js +146 -0
- package/dist/react-ui/src/ContextInspector.d.ts +16 -0
- package/dist/react-ui/src/ContextInspector.js +147 -0
- package/dist/react-ui/src/ctx.d.ts +18 -0
- package/dist/react-ui/src/ctx.js +25 -0
- package/dist/react-ui/src/ctxDateSettings.js +24 -0
- package/dist/react-ui/src/ctxHostServices.js +60 -0
- package/dist/react-ui/src/ctxNavigation.js +37 -0
- package/dist/react-ui/src/messageText.js +36 -0
- package/dist/styles.css +8485 -0
- package/dist/ui/icons/brands/markdown.js +15 -0
- package/dist/ui/icons/custom/color_d_icon.js +20 -0
- package/dist/ui/icons/custom/fieldgroup-boolean.js +18 -0
- package/dist/ui/icons/custom/fieldgroup-color.js +18 -0
- package/dist/ui/icons/custom/fieldgroup-datetime.js +49 -0
- package/dist/ui/icons/custom/fieldgroup-json.js +18 -0
- package/dist/ui/icons/custom/fieldgroup-location.js +19 -0
- package/dist/ui/icons/custom/fieldgroup-media.js +18 -0
- package/dist/ui/icons/custom/fieldgroup-number.js +18 -0
- package/dist/ui/icons/custom/fieldgroup-reference.js +18 -0
- package/dist/ui/icons/custom/fieldgroup-rich_text.js +18 -0
- package/dist/ui/icons/custom/fieldgroup-seo.js +22 -0
- package/dist/ui/icons/custom/fieldgroup-structured_text.js +61 -0
- package/dist/ui/icons/custom/language.js +16 -0
- package/dist/ui/icons/custom/masonry.js +21 -0
- package/dist/ui/icons/custom/netlify.js +55 -0
- package/dist/ui/icons/custom/twitter-verified.js +18 -0
- package/dist/ui/icons/custom/vercel.js +18 -0
- package/dist/ui/icons/index.js +391 -0
- package/dist/ui/icons/light/eye-slash.js +16 -0
- package/dist/ui/icons/light/eye.js +16 -0
- package/dist/ui/icons/regular/align-left.js +15 -0
- package/dist/ui/icons/regular/arrow-down-a-z.js +16 -0
- package/dist/ui/icons/regular/arrow-down-to-line.js +15 -0
- package/dist/ui/icons/regular/arrow-down.js +16 -0
- package/dist/ui/icons/regular/arrow-left.js +16 -0
- package/dist/ui/icons/regular/arrow-right-arrow-left.js +16 -0
- package/dist/ui/icons/regular/arrow-right-from-bracket.js +16 -0
- package/dist/ui/icons/regular/arrow-right.js +16 -0
- package/dist/ui/icons/regular/arrow-rotate-left.js +15 -0
- package/dist/ui/icons/regular/arrow-rotate-right.js +16 -0
- package/dist/ui/icons/regular/arrow-turn-up.js +16 -0
- package/dist/ui/icons/regular/arrow-up-arrow-down.js +16 -0
- package/dist/ui/icons/regular/arrow-up-right-from-square.js +16 -0
- package/dist/ui/icons/regular/arrow-up-to-line.js +15 -0
- package/dist/ui/icons/regular/arrow-up.js +16 -0
- package/dist/ui/icons/regular/arrows-from-line.js +16 -0
- package/dist/ui/icons/regular/arrows-rotate.js +16 -0
- package/dist/ui/icons/regular/arrows-to-line.js +16 -0
- package/dist/ui/icons/regular/arrows-turn-to-dots.js +15 -0
- package/dist/ui/icons/regular/badge-check.js +15 -0
- package/dist/ui/icons/regular/ballot-check.js +15 -0
- package/dist/ui/icons/regular/ban.js +16 -0
- package/dist/ui/icons/regular/bars.js +16 -0
- package/dist/ui/icons/regular/bold.js +15 -0
- package/dist/ui/icons/regular/bolt.js +15 -0
- package/dist/ui/icons/regular/book.js +16 -0
- package/dist/ui/icons/regular/bookmark.js +16 -0
- package/dist/ui/icons/regular/brackets-curly.js +15 -0
- package/dist/ui/icons/regular/browser.js +16 -0
- package/dist/ui/icons/regular/calendar-clock.js +15 -0
- package/dist/ui/icons/regular/calendar.js +16 -0
- package/dist/ui/icons/regular/chart-area.js +15 -0
- package/dist/ui/icons/regular/check.js +16 -0
- package/dist/ui/icons/regular/chevron-down.js +16 -0
- package/dist/ui/icons/regular/chevron-left.js +16 -0
- package/dist/ui/icons/regular/chevron-right.js +16 -0
- package/dist/ui/icons/regular/chevrons-down.js +16 -0
- package/dist/ui/icons/regular/chevrons-left.js +16 -0
- package/dist/ui/icons/regular/chevrons-right.js +16 -0
- package/dist/ui/icons/regular/circle-arrow-up.js +16 -0
- package/dist/ui/icons/regular/circle-check.js +16 -0
- package/dist/ui/icons/regular/circle-dot.js +16 -0
- package/dist/ui/icons/regular/circle-exclamation.js +16 -0
- package/dist/ui/icons/regular/circle-info.js +16 -0
- package/dist/ui/icons/regular/circle-question.js +16 -0
- package/dist/ui/icons/regular/clapperboard-play.js +15 -0
- package/dist/ui/icons/regular/clipboard.js +15 -0
- package/dist/ui/icons/regular/clock-rotate-left.js +16 -0
- package/dist/ui/icons/regular/clock.js +16 -0
- package/dist/ui/icons/regular/clone.js +16 -0
- package/dist/ui/icons/regular/cloud-arrow-down.js +15 -0
- package/dist/ui/icons/regular/code-branch.js +16 -0
- package/dist/ui/icons/regular/code-fork.js +16 -0
- package/dist/ui/icons/regular/comments.js +16 -0
- package/dist/ui/icons/regular/copy.js +16 -0
- package/dist/ui/icons/regular/cube.js +15 -0
- package/dist/ui/icons/regular/cubes.js +15 -0
- package/dist/ui/icons/regular/dash.js +16 -0
- package/dist/ui/icons/regular/database.js +15 -0
- package/dist/ui/icons/regular/diamond.js +15 -0
- package/dist/ui/icons/regular/down.js +16 -0
- package/dist/ui/icons/regular/download.js +16 -0
- package/dist/ui/icons/regular/earth-europe.js +16 -0
- package/dist/ui/icons/regular/ellipsis-vertical.js +16 -0
- package/dist/ui/icons/regular/ellipsis.js +16 -0
- package/dist/ui/icons/regular/envelope.js +16 -0
- package/dist/ui/icons/regular/expand.js +16 -0
- package/dist/ui/icons/regular/eye-dropper.js +16 -0
- package/dist/ui/icons/regular/file-export.js +16 -0
- package/dist/ui/icons/regular/file-lines.js +15 -0
- package/dist/ui/icons/regular/file-shield.js +15 -0
- package/dist/ui/icons/regular/file.js +15 -0
- package/dist/ui/icons/regular/filter.js +16 -0
- package/dist/ui/icons/regular/fire-flame-curved.js +15 -0
- package/dist/ui/icons/regular/flask-gear.js +15 -0
- package/dist/ui/icons/regular/flask.js +15 -0
- package/dist/ui/icons/regular/folder-gear.js +15 -0
- package/dist/ui/icons/regular/folder-magnifying-glass.js +15 -0
- package/dist/ui/icons/regular/folder-open.js +16 -0
- package/dist/ui/icons/regular/folder-plus.js +16 -0
- package/dist/ui/icons/regular/folder.js +16 -0
- package/dist/ui/icons/regular/folders.js +16 -0
- package/dist/ui/icons/regular/gear.js +16 -0
- package/dist/ui/icons/regular/gift.js +16 -0
- package/dist/ui/icons/regular/globe.js +16 -0
- package/dist/ui/icons/regular/grid-2.js +16 -0
- package/dist/ui/icons/regular/grip-dots-vertical.js +16 -0
- package/dist/ui/icons/regular/hand.js +16 -0
- package/dist/ui/icons/regular/hourglass-clock.js +16 -0
- package/dist/ui/icons/regular/house.js +16 -0
- package/dist/ui/icons/regular/images.js +15 -0
- package/dist/ui/icons/regular/input-numeric.js +15 -0
- package/dist/ui/icons/regular/input-text.js +15 -0
- package/dist/ui/icons/regular/layer-group.js +15 -0
- package/dist/ui/icons/regular/life-ring.js +16 -0
- package/dist/ui/icons/regular/link-simple.js +15 -0
- package/dist/ui/icons/regular/link.js +16 -0
- package/dist/ui/icons/regular/list-tree.js +15 -0
- package/dist/ui/icons/regular/list.js +15 -0
- package/dist/ui/icons/regular/magnifying-glass-chart.js +15 -0
- package/dist/ui/icons/regular/magnifying-glass.js +16 -0
- package/dist/ui/icons/regular/map-location-dot.js +16 -0
- package/dist/ui/icons/regular/memo.js +15 -0
- package/dist/ui/icons/regular/octagon-exclamation.js +16 -0
- package/dist/ui/icons/regular/palette.js +16 -0
- package/dist/ui/icons/regular/paper-plane.js +16 -0
- package/dist/ui/icons/regular/paragraph.js +15 -0
- package/dist/ui/icons/regular/paste.js +15 -0
- package/dist/ui/icons/regular/pause.js +16 -0
- package/dist/ui/icons/regular/pen-paintbrush.js +15 -0
- package/dist/ui/icons/regular/pen-to-square.js +15 -0
- package/dist/ui/icons/regular/pen.js +16 -0
- package/dist/ui/icons/regular/people-arrows.js +16 -0
- package/dist/ui/icons/regular/photo-film.js +15 -0
- package/dist/ui/icons/regular/play.js +16 -0
- package/dist/ui/icons/regular/puzzle-piece.js +15 -0
- package/dist/ui/icons/regular/receipt.js +16 -0
- package/dist/ui/icons/regular/rectangle-barcode.js +15 -0
- package/dist/ui/icons/regular/rectangle-list.js +15 -0
- package/dist/ui/icons/regular/right-left.js +15 -0
- package/dist/ui/icons/regular/rotate-left.js +16 -0
- package/dist/ui/icons/regular/shield.js +15 -0
- package/dist/ui/icons/regular/sidebar-flip.js +16 -0
- package/dist/ui/icons/regular/sidebar.js +16 -0
- package/dist/ui/icons/regular/sliders.js +16 -0
- package/dist/ui/icons/regular/sparkles.js +15 -0
- package/dist/ui/icons/regular/square-caret-down.js +15 -0
- package/dist/ui/icons/regular/square-check.js +15 -0
- package/dist/ui/icons/regular/square-dashed.js +15 -0
- package/dist/ui/icons/regular/square-left.js +16 -0
- package/dist/ui/icons/regular/square-terminal.js +16 -0
- package/dist/ui/icons/regular/square-up-right.js +16 -0
- package/dist/ui/icons/regular/store.js +16 -0
- package/dist/ui/icons/regular/swap-arrows.js +15 -0
- package/dist/ui/icons/regular/table.js +16 -0
- package/dist/ui/icons/regular/tag.js +16 -0
- package/dist/ui/icons/regular/toggle-on.js +15 -0
- package/dist/ui/icons/regular/toolbox.js +16 -0
- package/dist/ui/icons/regular/trash-undo.js +15 -0
- package/dist/ui/icons/regular/trash.js +16 -0
- package/dist/ui/icons/regular/triangle-exclamation.js +16 -0
- package/dist/ui/icons/regular/turn-up.js +16 -0
- package/dist/ui/icons/regular/user-group.js +15 -0
- package/dist/ui/icons/regular/user-helmet-safety.js +16 -0
- package/dist/ui/icons/regular/user-lock.js +16 -0
- package/dist/ui/icons/regular/user-minus.js +16 -0
- package/dist/ui/icons/regular/user-tie.js +15 -0
- package/dist/ui/icons/regular/user.js +16 -0
- package/dist/ui/icons/regular/users.js +15 -0
- package/dist/ui/icons/regular/video.js +15 -0
- package/dist/ui/icons/regular/webhook.js +15 -0
- package/dist/ui/icons/regular/wrench.js +15 -0
- package/dist/ui/icons/regular/xmark.js +16 -0
- package/dist/ui/icons/solid/align-center.js +16 -0
- package/dist/ui/icons/solid/align-justify.js +16 -0
- package/dist/ui/icons/solid/align-left.js +16 -0
- package/dist/ui/icons/solid/align-right.js +16 -0
- package/dist/ui/icons/solid/arrow-rotate-left.js +16 -0
- package/dist/ui/icons/solid/arrow-rotate-right.js +16 -0
- package/dist/ui/icons/solid/bold.js +16 -0
- package/dist/ui/icons/solid/circle-exclamation.js +16 -0
- package/dist/ui/icons/solid/closed-captioning.js +15 -0
- package/dist/ui/icons/solid/code.js +16 -0
- package/dist/ui/icons/solid/compress.js +16 -0
- package/dist/ui/icons/solid/download.js +15 -0
- package/dist/ui/icons/solid/expand.js +16 -0
- package/dist/ui/icons/solid/file-arrow-down.js +15 -0
- package/dist/ui/icons/solid/file-code.js +16 -0
- package/dist/ui/icons/solid/grid-2.js +16 -0
- package/dist/ui/icons/solid/h1.js +16 -0
- package/dist/ui/icons/solid/h2.js +16 -0
- package/dist/ui/icons/solid/h3.js +16 -0
- package/dist/ui/icons/solid/h4.js +16 -0
- package/dist/ui/icons/solid/h5.js +16 -0
- package/dist/ui/icons/solid/h6.js +16 -0
- package/dist/ui/icons/solid/highlighter.js +16 -0
- package/dist/ui/icons/solid/horizontal-rule.js +16 -0
- package/dist/ui/icons/solid/image.js +16 -0
- package/dist/ui/icons/solid/indent.js +16 -0
- package/dist/ui/icons/solid/italic.js +16 -0
- package/dist/ui/icons/solid/link.js +16 -0
- package/dist/ui/icons/solid/list-ol.js +16 -0
- package/dist/ui/icons/solid/list-ul.js +16 -0
- package/dist/ui/icons/solid/location-dot.js +16 -0
- package/dist/ui/icons/solid/music.js +15 -0
- package/dist/ui/icons/solid/outdent.js +16 -0
- package/dist/ui/icons/solid/paragraph.js +16 -0
- package/dist/ui/icons/solid/plus.js +16 -0
- package/dist/ui/icons/solid/quote-right.js +16 -0
- package/dist/ui/icons/solid/rectangle-code.js +16 -0
- package/dist/ui/icons/solid/square-plus.js +16 -0
- package/dist/ui/icons/solid/strikethrough.js +16 -0
- package/dist/ui/icons/solid/subtitles.js +15 -0
- package/dist/ui/icons/solid/table.js +16 -0
- package/dist/ui/icons/solid/triangle-exclamation.js +16 -0
- package/dist/ui/icons/solid/underline.js +16 -0
- package/dist/ui/locales/en.js +99 -0
- package/dist/ui/src/BundledTexts.d.ts +26 -0
- package/dist/ui/src/BundledTexts.js +57 -0
- package/dist/ui/src/HostServicesProvider.js +26 -0
- package/dist/ui/src/Message.d.ts +29 -0
- package/dist/ui/src/Message.js +9 -0
- package/dist/ui/src/TextsProvider.d.ts +32 -0
- package/dist/ui/src/TextsProvider.js +22 -0
- package/dist/ui/src/UiTextKey.d.ts +2 -0
- package/dist/ui/src/actions/Button.d.ts +190 -0
- package/dist/ui/src/actions/Button.js +163 -0
- package/dist/ui/src/actions/Dropdown/DropdownContext.js +11 -0
- package/dist/ui/src/actions/Dropdown/Footer.d.ts +15 -0
- package/dist/ui/src/actions/Dropdown/Footer.js +14 -0
- package/dist/ui/src/actions/Dropdown/Group.d.ts +26 -0
- package/dist/ui/src/actions/Dropdown/Group.js +19 -0
- package/dist/ui/src/actions/Dropdown/Menu.d.ts +46 -0
- package/dist/ui/src/actions/Dropdown/Menu.js +99 -0
- package/dist/ui/src/actions/Dropdown/MenuContent.d.ts +21 -0
- package/dist/ui/src/actions/Dropdown/MenuContent.js +140 -0
- package/dist/ui/src/actions/Dropdown/MenuContext.d.ts +9 -0
- package/dist/ui/src/actions/Dropdown/MenuContext.js +12 -0
- package/dist/ui/src/actions/Dropdown/MenuParts.d.ts +36 -0
- package/dist/ui/src/actions/Dropdown/MenuParts.js +77 -0
- package/dist/ui/src/actions/Dropdown/MenuSheet.js +26 -0
- package/dist/ui/src/actions/Dropdown/Option.d.ts +140 -0
- package/dist/ui/src/actions/Dropdown/Option.js +177 -0
- package/dist/ui/src/actions/Dropdown/OptionAction.d.ts +24 -0
- package/dist/ui/src/actions/Dropdown/OptionAction.js +31 -0
- package/dist/ui/src/actions/Dropdown/Separator.js +15 -0
- package/dist/ui/src/actions/Dropdown/Submenu.d.ts +16 -0
- package/dist/ui/src/actions/Dropdown/Submenu.js +92 -0
- package/dist/ui/src/actions/Dropdown/Text.js +12 -0
- package/dist/ui/src/actions/Dropdown/index.d.ts +68 -0
- package/dist/ui/src/actions/Dropdown/index.js +115 -0
- package/dist/ui/src/actions/Dropdown/placementStyle.js +18 -0
- package/dist/ui/src/actions/Dropdown/triggers/ButtonTrigger.d.ts +57 -0
- package/dist/ui/src/actions/Dropdown/triggers/ButtonTrigger.js +52 -0
- package/dist/ui/src/actions/Dropdown/triggers/DropdownTriggerButton.d.ts +18 -0
- package/dist/ui/src/actions/Dropdown/triggers/DropdownTriggerButton.js +40 -0
- package/dist/ui/src/actions/Dropdown/triggers/IconTrigger.d.ts +35 -0
- package/dist/ui/src/actions/Dropdown/triggers/IconTrigger.js +27 -0
- package/dist/ui/src/actions/Dropdown/triggers/PillTrigger.d.ts +20 -0
- package/dist/ui/src/actions/Dropdown/triggers/PillTrigger.js +28 -0
- package/dist/ui/src/actions/Dropdown/triggers/TextualTrigger.d.ts +16 -0
- package/dist/ui/src/actions/Dropdown/triggers/TextualTrigger.js +26 -0
- package/dist/ui/src/actions/Dropdown/triggers/handleDropdownTriggerKeyDown.js +12 -0
- package/dist/ui/src/actions/Dropdown/triggers/types.d.ts +7 -0
- package/dist/ui/src/actions/Dropdown/useCloseMenu.d.ts +7 -0
- package/dist/ui/src/actions/Dropdown/useCloseMenu.js +14 -0
- package/dist/ui/src/actions/Dropdown/useDropdownRegistry.js +15 -0
- package/dist/ui/src/actions/Dropdown/useTriggerLang.js +14 -0
- package/dist/ui/src/actions/EditorToolbar/Button.d.ts +36 -0
- package/dist/ui/src/actions/EditorToolbar/Button.js +42 -0
- package/dist/ui/src/actions/EditorToolbar/Buttons.d.ts +23 -0
- package/dist/ui/src/actions/EditorToolbar/Buttons.js +138 -0
- package/dist/ui/src/actions/EditorToolbar/Group.js +11 -0
- package/dist/ui/src/actions/EditorToolbar/hooks.d.ts +15 -0
- package/dist/ui/src/actions/EditorToolbar/hooks.js +48 -0
- package/dist/ui/src/actions/EditorToolbar/index.d.ts +67 -0
- package/dist/ui/src/actions/EditorToolbar/index.js +147 -0
- package/dist/ui/src/actions/HotKey.d.ts +98 -0
- package/dist/ui/src/actions/HotKey.js +270 -0
- package/dist/ui/src/actions/MultipleSelectionActionBar.d.ts +75 -0
- package/dist/ui/src/actions/MultipleSelectionActionBar.js +105 -0
- package/dist/ui/src/actions/SplitButton/Caret.js +29 -0
- package/dist/ui/src/actions/SplitButton/index.d.ts +52 -0
- package/dist/ui/src/actions/SplitButton/index.js +38 -0
- package/dist/ui/src/actions/disabledReason.d.ts +28 -0
- package/dist/ui/src/actions/disabledReason.js +30 -0
- package/dist/ui/src/actions/hotKeyContext.d.ts +32 -0
- package/dist/ui/src/actions/hotKeyContext.js +15 -0
- package/dist/ui/src/color/generateColorMapper.js +6 -0
- package/dist/ui/src/color/oklch.js +9 -0
- package/dist/ui/src/color/utils.js +15 -0
- package/dist/ui/src/content/ApiKey.d.ts +8 -0
- package/dist/ui/src/content/ApiKey.js +12 -0
- package/dist/ui/src/content/Avatar.d.ts +55 -0
- package/dist/ui/src/content/Avatar.js +54 -0
- package/dist/ui/src/content/CodeSnippet.d.ts +26 -0
- package/dist/ui/src/content/CodeSnippet.js +27 -0
- package/dist/ui/src/content/CopyButton.d.ts +8 -0
- package/dist/ui/src/content/CopyButton.js +22 -0
- package/dist/ui/src/content/CopyableId.d.ts +8 -0
- package/dist/ui/src/content/CopyableId.js +30 -0
- package/dist/ui/src/content/CopyableValue.d.ts +36 -0
- package/dist/ui/src/content/CopyableValue.js +58 -0
- package/dist/ui/src/content/DateSettings.d.ts +20 -0
- package/dist/ui/src/content/DateSettings.js +26 -0
- package/dist/ui/src/content/FeedbackDot.d.ts +19 -0
- package/dist/ui/src/content/FeedbackDot.js +25 -0
- package/dist/ui/src/content/FramedImage.d.ts +22 -0
- package/dist/ui/src/content/FramedImage.js +44 -0
- package/dist/ui/src/content/IdText.d.ts +14 -0
- package/dist/ui/src/content/IdText.js +30 -0
- package/dist/ui/src/content/InitialsAvatar.d.ts +42 -0
- package/dist/ui/src/content/InitialsAvatar.js +70 -0
- package/dist/ui/src/content/Pill.d.ts +47 -0
- package/dist/ui/src/content/Pill.js +40 -0
- package/dist/ui/src/content/SmartDate.d.ts +34 -0
- package/dist/ui/src/content/SmartDate.js +24 -0
- package/dist/ui/src/content/UploadThreatTriangle.d.ts +8 -0
- package/dist/ui/src/content/UploadThreatTriangle.js +25 -0
- package/dist/ui/src/content/UsageMeter.d.ts +35 -0
- package/dist/ui/src/content/UsageMeter.js +66 -0
- package/dist/ui/src/content/ValidityTriangles.d.ts +38 -0
- package/dist/ui/src/content/ValidityTriangles.js +56 -0
- package/dist/ui/src/content/pillClassName.js +15 -0
- package/dist/ui/src/feedback/BlankSlate.d.ts +93 -0
- package/dist/ui/src/feedback/BlankSlate.js +93 -0
- package/dist/ui/src/feedback/Callout.d.ts +35 -0
- package/dist/ui/src/feedback/Callout.js +33 -0
- package/dist/ui/src/feedback/ProgressBar.d.ts +35 -0
- package/dist/ui/src/feedback/ProgressBar.js +28 -0
- package/dist/ui/src/feedback/Spinner.d.ts +66 -0
- package/dist/ui/src/feedback/Spinner.js +77 -0
- package/dist/ui/src/form/AutosizeInput.d.ts +22 -0
- package/dist/ui/src/form/AutosizeInput.js +14 -0
- package/dist/ui/src/form/DebouncedTextInput.d.ts +13 -0
- package/dist/ui/src/form/DebouncedTextInput.js +52 -0
- package/dist/ui/src/form/FieldHint.d.ts +28 -0
- package/dist/ui/src/form/FieldHint.js +56 -0
- package/dist/ui/src/form/FieldWrapper.d.ts +332 -0
- package/dist/ui/src/form/FieldWrapper.js +115 -0
- package/dist/ui/src/form/FormAppContext.js +9 -0
- package/dist/ui/src/form/InputGroup.d.ts +78 -0
- package/dist/ui/src/form/InputGroup.js +98 -0
- package/dist/ui/src/form/KeyValueList.d.ts +60 -0
- package/dist/ui/src/form/KeyValueList.js +80 -0
- package/dist/ui/src/form/Label.d.ts +45 -0
- package/dist/ui/src/form/Label.js +46 -0
- package/dist/ui/src/form/NumberInput.d.ts +23 -0
- package/dist/ui/src/form/NumberInput.js +54 -0
- package/dist/ui/src/form/PasswordInput.d.ts +16 -0
- package/dist/ui/src/form/PasswordInput.js +54 -0
- package/dist/ui/src/form/RadioGroupInput.d.ts +42 -0
- package/dist/ui/src/form/RadioGroupInput.js +85 -0
- package/dist/ui/src/form/SelectInput/Context.js +8 -0
- package/dist/ui/src/form/SelectInput/SelectClearIndicator.js +17 -0
- package/dist/ui/src/form/SelectInput/SelectDropdownIndicator.js +14 -0
- package/dist/ui/src/form/SelectInput/SelectEmpty.js +10 -0
- package/dist/ui/src/form/SelectInput/SelectGroup.js +13 -0
- package/dist/ui/src/form/SelectInput/SelectInputElement.js +15 -0
- package/dist/ui/src/form/SelectInput/SelectMenu.d.ts +46 -0
- package/dist/ui/src/form/SelectInput/SelectMenu.js +89 -0
- package/dist/ui/src/form/SelectInput/SelectMultiValueRemove.js +20 -0
- package/dist/ui/src/form/SelectInput/SelectOption.js +22 -0
- package/dist/ui/src/form/SelectInput/SortableMultiValue.js +30 -0
- package/dist/ui/src/form/SelectInput/SortableValueContainer.js +19 -0
- package/dist/ui/src/form/SelectInput/index.d.ts +112 -0
- package/dist/ui/src/form/SelectInput/index.js +181 -0
- package/dist/ui/src/form/SelectInput/useSelectClassNames.js +63 -0
- package/dist/ui/src/form/SelectInput/useSelectValueAdapter.js +48 -0
- package/dist/ui/src/form/StringInput.d.ts +23 -0
- package/dist/ui/src/form/StringInput.js +29 -0
- package/dist/ui/src/form/SwitchInput.d.ts +33 -0
- package/dist/ui/src/form/SwitchInput.js +83 -0
- package/dist/ui/src/form/SwitchList.d.ts +16 -0
- package/dist/ui/src/form/SwitchList.js +25 -0
- package/dist/ui/src/form/TableList.d.ts +206 -0
- package/dist/ui/src/form/TableList.js +273 -0
- package/dist/ui/src/form/TextareaInput.d.ts +35 -0
- package/dist/ui/src/form/TextareaInput.js +73 -0
- package/dist/ui/src/form/getEditState.js +12 -0
- package/dist/ui/src/form/inputProps.d.ts +119 -0
- package/dist/ui/src/form/useTextInputHandlers.js +37 -0
- package/dist/ui/src/hooks/useAsyncSelectOptions.d.ts +52 -0
- package/dist/ui/src/hooks/useAsyncSelectOptions.js +85 -0
- package/dist/ui/src/hooks/useAutoincrementIntegerId.js +11 -0
- package/dist/ui/src/hooks/useClickOutside.d.ts +1 -0
- package/dist/ui/src/hooks/useClickOutside.js +21 -0
- package/dist/ui/src/hooks/useCopyToClipboard.d.ts +4 -0
- package/dist/ui/src/hooks/useCopyToClipboard.js +22 -0
- package/dist/ui/src/hooks/useDebounceOnBoolean.d.ts +1 -0
- package/dist/ui/src/hooks/useDebounceOnBoolean.js +26 -0
- package/dist/ui/src/hooks/useDebouncedCallback.d.ts +1 -0
- package/dist/ui/src/hooks/useDebouncedCallback.js +12 -0
- package/dist/ui/src/hooks/useDebouncedValue.d.ts +6 -0
- package/dist/ui/src/hooks/useDebouncedValue.js +17 -0
- package/dist/ui/src/hooks/useDeepCompareEffect.d.ts +2 -0
- package/dist/ui/src/hooks/useDeepCompareEffect.js +14 -0
- package/dist/ui/src/hooks/useDidUpdateEffect.d.ts +2 -0
- package/dist/ui/src/hooks/useDidUpdateEffect.js +13 -0
- package/dist/ui/src/hooks/useElementLayout.d.ts +8 -0
- package/dist/ui/src/hooks/useElementLayout.js +56 -0
- package/dist/ui/src/hooks/useMediaQuery.d.ts +13 -0
- package/dist/ui/src/hooks/useMediaQuery.js +52 -0
- package/dist/ui/src/hooks/useRovingKeyDown.d.ts +9 -0
- package/dist/ui/src/hooks/useRovingKeyDown.js +55 -0
- package/dist/ui/src/hooks/useShallowEqual.d.ts +2 -0
- package/dist/ui/src/hooks/useShallowEqual.js +15 -0
- package/dist/ui/src/hooks/useSmartRowClick.d.ts +16 -0
- package/dist/ui/src/hooks/useSmartRowClick.js +31 -0
- package/dist/ui/src/i18n.js +84 -0
- package/dist/ui/src/layout/ListOrOverview.d.ts +49 -0
- package/dist/ui/src/layout/ListOrOverview.js +26 -0
- package/dist/ui/src/layout/Page/Page.d.ts +21 -0
- package/dist/ui/src/layout/Page/Page.js +20 -0
- package/dist/ui/src/layout/Page/PageContent.d.ts +7 -0
- package/dist/ui/src/layout/Page/PageContent.js +13 -0
- package/dist/ui/src/layout/Page/PageGroup.d.ts +74 -0
- package/dist/ui/src/layout/Page/PageGroup.js +62 -0
- package/dist/ui/src/layout/Page/PageSection.d.ts +47 -0
- package/dist/ui/src/layout/Page/PageSection.js +48 -0
- package/dist/ui/src/layout/Page/index.d.ts +16 -0
- package/dist/ui/src/layout/Page/index.js +15 -0
- package/dist/ui/src/layout/Pagination.d.ts +27 -0
- package/dist/ui/src/layout/Pagination.js +64 -0
- package/dist/ui/src/layout/Pane/FormHeader.d.ts +72 -0
- package/dist/ui/src/layout/Pane/FormHeader.js +69 -0
- package/dist/ui/src/layout/Pane/ListFilter.d.ts +48 -0
- package/dist/ui/src/layout/Pane/ListFilter.js +112 -0
- package/dist/ui/src/layout/Pane/ListPresets.d.ts +45 -0
- package/dist/ui/src/layout/Pane/ListPresets.js +35 -0
- package/dist/ui/src/layout/Pane/PaneAriaLabel.d.ts +2 -0
- package/dist/ui/src/layout/Pane/PaneAriaLabel.js +9 -0
- package/dist/ui/src/layout/Pane/PaneHeader.d.ts +64 -0
- package/dist/ui/src/layout/Pane/PaneHeader.js +111 -0
- package/dist/ui/src/layout/Pane/PaneTitleId.js +9 -0
- package/dist/ui/src/layout/Pane/index.d.ts +166 -0
- package/dist/ui/src/layout/Pane/index.js +100 -0
- package/dist/ui/src/layout/SidebarPanel.d.ts +96 -0
- package/dist/ui/src/layout/SidebarPanel.js +81 -0
- package/dist/ui/src/layout/SplitPane.d.ts +74 -0
- package/dist/ui/src/layout/SplitPane.js +277 -0
- package/dist/ui/src/layout/SplitView/SashActionButton.js +50 -0
- package/dist/ui/src/layout/SplitView/SplitView.js +197 -0
- package/dist/ui/src/layout/SplitView/SplitViewPane.js +12 -0
- package/dist/ui/src/layout/SplitView/SplitViewSash.js +55 -0
- package/dist/ui/src/layout/Toolbar/AddNewButton.d.ts +37 -0
- package/dist/ui/src/layout/Toolbar/AddNewButton.js +56 -0
- package/dist/ui/src/layout/Toolbar/Button.js +17 -0
- package/dist/ui/src/layout/Toolbar/DotsDropdown.d.ts +13 -0
- package/dist/ui/src/layout/Toolbar/DotsDropdown.js +24 -0
- package/dist/ui/src/layout/Toolbar/Fill.d.ts +13 -0
- package/dist/ui/src/layout/Toolbar/Fill.js +16 -0
- package/dist/ui/src/layout/Toolbar/FilterInput.d.ts +34 -0
- package/dist/ui/src/layout/Toolbar/FilterInput.js +67 -0
- package/dist/ui/src/layout/Toolbar/FilterToggle.d.ts +31 -0
- package/dist/ui/src/layout/Toolbar/FilterToggle.js +62 -0
- package/dist/ui/src/layout/Toolbar/GoBack.d.ts +27 -0
- package/dist/ui/src/layout/Toolbar/GoBack.js +26 -0
- package/dist/ui/src/layout/Toolbar/Group.d.ts +18 -0
- package/dist/ui/src/layout/Toolbar/Group.js +17 -0
- package/dist/ui/src/layout/Toolbar/Help.d.ts +29 -0
- package/dist/ui/src/layout/Toolbar/Help.js +55 -0
- package/dist/ui/src/layout/Toolbar/Note.d.ts +10 -0
- package/dist/ui/src/layout/Toolbar/Note.js +16 -0
- package/dist/ui/src/layout/Toolbar/Pagination.d.ts +31 -0
- package/dist/ui/src/layout/Toolbar/Pagination.js +53 -0
- package/dist/ui/src/layout/Toolbar/PresetsTitle.d.ts +38 -0
- package/dist/ui/src/layout/Toolbar/PresetsTitle.js +48 -0
- package/dist/ui/src/layout/Toolbar/PrimaryButton.d.ts +53 -0
- package/dist/ui/src/layout/Toolbar/PrimaryButton.js +57 -0
- package/dist/ui/src/layout/Toolbar/Root.d.ts +25 -0
- package/dist/ui/src/layout/Toolbar/Root.js +24 -0
- package/dist/ui/src/layout/Toolbar/Search.d.ts +19 -0
- package/dist/ui/src/layout/Toolbar/Search.js +22 -0
- package/dist/ui/src/layout/Toolbar/Space.d.ts +4 -0
- package/dist/ui/src/layout/Toolbar/Space.js +9 -0
- package/dist/ui/src/layout/Toolbar/Spinner.d.ts +8 -0
- package/dist/ui/src/layout/Toolbar/Spinner.js +13 -0
- package/dist/ui/src/layout/Toolbar/Subtitle.d.ts +10 -0
- package/dist/ui/src/layout/Toolbar/Subtitle.js +12 -0
- package/dist/ui/src/layout/Toolbar/TextualDropdown.d.ts +13 -0
- package/dist/ui/src/layout/Toolbar/TextualDropdown.js +20 -0
- package/dist/ui/src/layout/Toolbar/Title.d.ts +23 -0
- package/dist/ui/src/layout/Toolbar/Title.js +43 -0
- package/dist/ui/src/layout/Toolbar/ToolbarTitleTrigger.js +23 -0
- package/dist/ui/src/layout/Toolbar/context.js +9 -0
- package/dist/ui/src/layout/Toolbar/index.d.ts +46 -0
- package/dist/ui/src/layout/Toolbar/index.js +49 -0
- package/dist/ui/src/layout/sidebarPanelStorage.d.ts +6 -0
- package/dist/ui/src/layout/sidebarPanelStorage.js +33 -0
- package/dist/ui/src/lists/ActionOrMenu.d.ts +34 -0
- package/dist/ui/src/lists/CardList.d.ts +115 -0
- package/dist/ui/src/lists/CardList.js +137 -0
- package/dist/ui/src/lists/EmptySlot.d.ts +35 -0
- package/dist/ui/src/lists/EmptySlot.js +54 -0
- package/dist/ui/src/lists/EntityRow.d.ts +57 -0
- package/dist/ui/src/lists/EntityRow.js +48 -0
- package/dist/ui/src/lists/EntitySummary.d.ts +16 -0
- package/dist/ui/src/lists/EntitySummary.js +27 -0
- package/dist/ui/src/lists/InfoList.d.ts +45 -0
- package/dist/ui/src/lists/InfoList.js +53 -0
- package/dist/ui/src/lists/InsertGap.d.ts +41 -0
- package/dist/ui/src/lists/InsertGap.js +74 -0
- package/dist/ui/src/lists/ListArea.d.ts +17 -0
- package/dist/ui/src/lists/ListArea.js +18 -0
- package/dist/ui/src/lists/MediaCard.d.ts +129 -0
- package/dist/ui/src/lists/MediaCard.js +139 -0
- package/dist/ui/src/lists/RowList.d.ts +63 -0
- package/dist/ui/src/lists/RowList.js +72 -0
- package/dist/ui/src/lists/SettingsList.d.ts +40 -0
- package/dist/ui/src/lists/SettingsList.js +47 -0
- package/dist/ui/src/lists/Table/Body.d.ts +21 -0
- package/dist/ui/src/lists/Table/Body.js +47 -0
- package/dist/ui/src/lists/Table/Cell.d.ts +47 -0
- package/dist/ui/src/lists/Table/Cell.js +42 -0
- package/dist/ui/src/lists/Table/ColumnsMenu.js +48 -0
- package/dist/ui/src/lists/Table/Header.d.ts +22 -0
- package/dist/ui/src/lists/Table/Header.js +134 -0
- package/dist/ui/src/lists/Table/HeaderCell.js +67 -0
- package/dist/ui/src/lists/Table/Row.d.ts +133 -0
- package/dist/ui/src/lists/Table/Row.js +207 -0
- package/dist/ui/src/lists/Table/Table.d.ts +61 -0
- package/dist/ui/src/lists/Table/Table.js +100 -0
- package/dist/ui/src/lists/Table/TableContext.js +17 -0
- package/dist/ui/src/lists/Table/TreeToggle.d.ts +34 -0
- package/dist/ui/src/lists/Table/TreeToggle.js +49 -0
- package/dist/ui/src/lists/Table/cells/IconCell.d.ts +11 -0
- package/dist/ui/src/lists/Table/cells/IconCell.js +17 -0
- package/dist/ui/src/lists/Table/cells/LinkCell.d.ts +11 -0
- package/dist/ui/src/lists/Table/cells/LinkCell.js +15 -0
- package/dist/ui/src/lists/Table/cells/StatusCell.d.ts +12 -0
- package/dist/ui/src/lists/Table/cells/StatusCell.js +14 -0
- package/dist/ui/src/lists/Table/cells/TimeCell.d.ts +9 -0
- package/dist/ui/src/lists/Table/cells/TimeCell.js +18 -0
- package/dist/ui/src/lists/Table/index.d.ts +17 -0
- package/dist/ui/src/lists/Table/index.js +18 -0
- package/dist/ui/src/lists/Table/layout.d.ts +18 -0
- package/dist/ui/src/lists/Table/layout.js +102 -0
- package/dist/ui/src/lists/Table/storage.d.ts +7 -0
- package/dist/ui/src/lists/Table/storage.js +26 -0
- package/dist/ui/src/lists/Table/types.d.ts +55 -0
- package/dist/ui/src/lists/Table/useClientSort.d.ts +14 -0
- package/dist/ui/src/lists/Table/useClientSort.js +31 -0
- package/dist/ui/src/lists/dnd/DragHandle.d.ts +19 -0
- package/dist/ui/src/lists/dnd/DragHandle.js +19 -0
- package/dist/ui/src/lists/dnd/DropIndicator.d.ts +21 -0
- package/dist/ui/src/lists/dnd/DropIndicator.js +18 -0
- package/dist/ui/src/lists/dnd/SortableList.d.ts +101 -0
- package/dist/ui/src/lists/dnd/SortableList.js +238 -0
- package/dist/ui/src/lists/dnd/autoScroll.js +53 -0
- package/dist/ui/src/lists/dnd/dropTargetClassName.d.ts +25 -0
- package/dist/ui/src/lists/dnd/dropTargetClassName.js +18 -0
- package/dist/ui/src/lists/dnd/getGapTo.js +14 -0
- package/dist/ui/src/lists/dnd/index.d.ts +16 -0
- package/dist/ui/src/lists/dnd/index.js +16 -0
- package/dist/ui/src/lists/dnd/reorder.d.ts +7 -0
- package/dist/ui/src/lists/dnd/reorder.js +16 -0
- package/dist/ui/src/lists/dnd/tree/SortableTree.d.ts +69 -0
- package/dist/ui/src/lists/dnd/tree/SortableTree.js +331 -0
- package/dist/ui/src/lists/dnd/tree/TreeRowContext.d.ts +8 -0
- package/dist/ui/src/lists/dnd/tree/TreeRowContext.js +10 -0
- package/dist/ui/src/lists/dnd/tree/types.d.ts +53 -0
- package/dist/ui/src/lists/dnd/tree/useTreeKeyboardNavigation.js +59 -0
- package/dist/ui/src/lists/dnd/tree/utils.d.ts +8 -0
- package/dist/ui/src/lists/dnd/tree/utils.js +96 -0
- package/dist/ui/src/lists/dnd/types.d.ts +7 -0
- package/dist/ui/src/lists/dnd/types.js +6 -0
- package/dist/ui/src/lists/dnd/useDragMonitor.d.ts +11 -0
- package/dist/ui/src/lists/dnd/useDragMonitor.js +40 -0
- package/dist/ui/src/lists/dnd/useDraggable.d.ts +17 -0
- package/dist/ui/src/lists/dnd/useDraggable.js +66 -0
- package/dist/ui/src/lists/dnd/useDropTarget.d.ts +19 -0
- package/dist/ui/src/lists/dnd/useDropTarget.js +53 -0
- package/dist/ui/src/lists/dnd/useFileDropTarget.d.ts +20 -0
- package/dist/ui/src/lists/dnd/useFileDropTarget.js +53 -0
- package/dist/ui/src/lists/dnd/useFilePicker.d.ts +15 -0
- package/dist/ui/src/lists/dnd/useFilePicker.js +28 -0
- package/dist/ui/src/lists/dnd/useIsFileDragActive.d.ts +1 -0
- package/dist/ui/src/lists/dnd/useIsFileDragActive.js +28 -0
- package/dist/ui/src/navigation/Chevron.d.ts +40 -0
- package/dist/ui/src/navigation/Chevron.js +56 -0
- package/dist/ui/src/navigation/Link.d.ts +58 -0
- package/dist/ui/src/navigation/Link.js +40 -0
- package/dist/ui/src/navigation/NavList.d.ts +29 -0
- package/dist/ui/src/navigation/NavList.js +31 -0
- package/dist/ui/src/navigation/NavigationProvider.d.ts +61 -0
- package/dist/ui/src/navigation/NavigationProvider.js +55 -0
- package/dist/ui/src/navigation/SegmentedControl.d.ts +51 -0
- package/dist/ui/src/navigation/SegmentedControl.js +40 -0
- package/dist/ui/src/navigation/SettingsMenu.d.ts +107 -0
- package/dist/ui/src/navigation/SettingsMenu.js +91 -0
- package/dist/ui/src/navigation/SidebarTree/SidebarTreeNode.d.ts +114 -0
- package/dist/ui/src/navigation/SidebarTree/SidebarTreeNode.js +173 -0
- package/dist/ui/src/navigation/SidebarTree/SidebarTreeNodeActions.d.ts +30 -0
- package/dist/ui/src/navigation/SidebarTree/SidebarTreeNodeActions.js +62 -0
- package/dist/ui/src/navigation/SidebarTree/index.d.ts +6 -0
- package/dist/ui/src/navigation/SidebarTree/index.js +9 -0
- package/dist/ui/src/navigation/Tabs.d.ts +125 -0
- package/dist/ui/src/navigation/Tabs.js +151 -0
- package/dist/ui/src/overlays/FullscreenModal.d.ts +41 -0
- package/dist/ui/src/overlays/FullscreenModal.js +86 -0
- package/dist/ui/src/overlays/HoverCard.d.ts +55 -0
- package/dist/ui/src/overlays/HoverCard.js +70 -0
- package/dist/ui/src/overlays/Modal.d.ts +49 -0
- package/dist/ui/src/overlays/Modal.js +136 -0
- package/dist/ui/src/overlays/NewZIndex.d.ts +14 -0
- package/dist/ui/src/overlays/NewZIndex.js +19 -0
- package/dist/ui/src/overlays/Popover.d.ts +47 -0
- package/dist/ui/src/overlays/Popover.js +72 -0
- package/dist/ui/src/overlays/Portal.d.ts +12 -0
- package/dist/ui/src/overlays/Portal.js +33 -0
- package/dist/ui/src/overlays/PortalWrapper.js +22 -0
- package/dist/ui/src/overlays/Tooltip.d.ts +55 -0
- package/dist/ui/src/overlays/Tooltip.js +77 -0
- package/dist/ui/src/overlays/confirmQuestion.js +61 -0
- package/dist/ui/src/overlays/floatingTrigger.d.ts +3 -0
- package/dist/ui/src/overlays/floatingTrigger.js +13 -0
- package/dist/ui/src/overlays/useModalClose.js +129 -0
- package/dist/ui/src/patterns/ListDetail/Overview.js +16 -0
- package/dist/ui/src/patterns/ListDetail/Page.d.ts +109 -0
- package/dist/ui/src/patterns/ListDetail/Page.js +125 -0
- package/dist/ui/src/patterns/ListDetail/Panel.d.ts +62 -0
- package/dist/ui/src/patterns/ListDetail/Panel.js +70 -0
- package/dist/ui/src/patterns/ListDetail/Split.d.ts +32 -0
- package/dist/ui/src/patterns/ListDetail/Split.js +156 -0
- package/dist/ui/src/patterns/ListDetail/Widths.d.ts +13 -0
- package/dist/ui/src/patterns/ListDetail/Widths.js +21 -0
- package/dist/ui/src/patterns/ListDetail/index.d.ts +12 -0
- package/dist/ui/src/patterns/ListDetail/index.js +14 -0
- package/dist/ui/src/patterns/ListFormPage.d.ts +38 -0
- package/dist/ui/src/patterns/ListFormPage.js +29 -0
- package/dist/ui/src/semantic/Aside.d.ts +28 -0
- package/dist/ui/src/semantic/Aside.js +19 -0
- package/dist/ui/src/semantic/Heading.d.ts +22 -0
- package/dist/ui/src/semantic/Heading.js +26 -0
- package/dist/ui/src/semantic/Main.d.ts +9 -0
- package/dist/ui/src/semantic/Main.js +17 -0
- package/dist/ui/src/semantic/Nav.d.ts +24 -0
- package/dist/ui/src/semantic/Nav.js +20 -0
- package/dist/ui/src/semantic/RawButton.d.ts +91 -0
- package/dist/ui/src/semantic/RawButton.js +57 -0
- package/dist/ui/src/semantic/Search.d.ts +26 -0
- package/dist/ui/src/semantic/Search.js +20 -0
- package/dist/ui/src/utils/escapeHtml.js +6 -0
- package/dist/ui/src/utils/events.js +6 -0
- package/dist/ui/src/utils/formatDate.d.ts +62 -0
- package/dist/ui/src/utils/formatDate.js +95 -0
- package/dist/ui/src/utils/isDefined.js +6 -0
- package/dist/ui/src/utils/localeDirection.js +11 -0
- package/dist/ui/src/utils/mouseHoverProps.js +13 -0
- package/dist/ui/src/utils/pointerNearGap.d.ts +5 -0
- package/dist/ui/src/utils/pointerNearGap.js +56 -0
- package/dist/ui/src/utils/randomKey.js +10 -0
- package/dist/ui/src/utils/times.js +6 -0
- package/dist/ui/src/utils/types.d.ts +11 -0
- package/dist/utils/formatDate.d.ts +1 -0
- package/dist/utils/formatDate.js +2 -0
- package/package.json +71 -43
- package/LICENSE.md +0 -21
- package/dist/cjs/Button/index.js +0 -94
- package/dist/cjs/Button/index.js.map +0 -1
- package/dist/cjs/Button/styles.module.css.json +0 -1
- package/dist/cjs/ButtonGroup/Button/index.js +0 -19
- package/dist/cjs/ButtonGroup/Button/index.js.map +0 -1
- package/dist/cjs/ButtonGroup/Button/styles.module.css.json +0 -1
- package/dist/cjs/ButtonGroup/Group/index.js +0 -29
- package/dist/cjs/ButtonGroup/Group/index.js.map +0 -1
- package/dist/cjs/ButtonGroup/Group/styles.module.css.json +0 -1
- package/dist/cjs/ButtonGroup/index.js +0 -8
- package/dist/cjs/ButtonGroup/index.js.map +0 -1
- package/dist/cjs/Canvas/index.js +0 -356
- package/dist/cjs/Canvas/index.js.map +0 -1
- package/dist/cjs/Canvas/styles.module.css.json +0 -1
- package/dist/cjs/ContextInspector/index.js +0 -142
- package/dist/cjs/ContextInspector/index.js.map +0 -1
- package/dist/cjs/ContextInspector/styles.module.css.json +0 -1
- package/dist/cjs/Dropdown/Dropdown.js +0 -135
- package/dist/cjs/Dropdown/Dropdown.js.map +0 -1
- package/dist/cjs/Dropdown/DropdownContext.js +0 -9
- package/dist/cjs/Dropdown/DropdownContext.js.map +0 -1
- package/dist/cjs/Dropdown/Group.js +0 -16
- package/dist/cjs/Dropdown/Group.js.map +0 -1
- package/dist/cjs/Dropdown/Menu.js +0 -248
- package/dist/cjs/Dropdown/Menu.js.map +0 -1
- package/dist/cjs/Dropdown/MenuContext.js +0 -12
- package/dist/cjs/Dropdown/MenuContext.js.map +0 -1
- package/dist/cjs/Dropdown/Option.js +0 -104
- package/dist/cjs/Dropdown/Option.js.map +0 -1
- package/dist/cjs/Dropdown/OptionAction.js +0 -29
- package/dist/cjs/Dropdown/OptionAction.js.map +0 -1
- package/dist/cjs/Dropdown/Portal.js +0 -35
- package/dist/cjs/Dropdown/Portal.js.map +0 -1
- package/dist/cjs/Dropdown/Separator.js +0 -41
- package/dist/cjs/Dropdown/Separator.js.map +0 -1
- package/dist/cjs/Dropdown/Text.js +0 -14
- package/dist/cjs/Dropdown/Text.js.map +0 -1
- package/dist/cjs/Dropdown/index.js +0 -18
- package/dist/cjs/Dropdown/index.js.map +0 -1
- package/dist/cjs/Dropdown/styles.module.css.json +0 -1
- package/dist/cjs/FieldError/index.js +0 -14
- package/dist/cjs/FieldError/index.js.map +0 -1
- package/dist/cjs/FieldError/styles.module.css.json +0 -1
- package/dist/cjs/FieldGroup/index.js +0 -40
- package/dist/cjs/FieldGroup/index.js.map +0 -1
- package/dist/cjs/FieldGroup/styles.module.css.json +0 -1
- package/dist/cjs/FieldHint/index.js +0 -14
- package/dist/cjs/FieldHint/index.js.map +0 -1
- package/dist/cjs/FieldHint/styles.module.css.json +0 -1
- package/dist/cjs/FieldWrapper/index.js +0 -29
- package/dist/cjs/FieldWrapper/index.js.map +0 -1
- package/dist/cjs/Form/index.js +0 -173
- package/dist/cjs/Form/index.js.map +0 -1
- package/dist/cjs/Form/styles.module.css.json +0 -1
- package/dist/cjs/FormLabel/index.js +0 -45
- package/dist/cjs/FormLabel/index.js.map +0 -1
- package/dist/cjs/FormLabel/styles.module.css.json +0 -1
- package/dist/cjs/HotKey/index.js +0 -105
- package/dist/cjs/HotKey/index.js.map +0 -1
- package/dist/cjs/HotKey/styles.module.css.json +0 -1
- package/dist/cjs/Section/index.js +0 -70
- package/dist/cjs/Section/index.js.map +0 -1
- package/dist/cjs/Section/styles.module.css.json +0 -1
- package/dist/cjs/SelectField/index.js +0 -44
- package/dist/cjs/SelectField/index.js.map +0 -1
- package/dist/cjs/SelectInput/index.js +0 -155
- package/dist/cjs/SelectInput/index.js.map +0 -1
- package/dist/cjs/SidebarPanel/index.js +0 -85
- package/dist/cjs/SidebarPanel/index.js.map +0 -1
- package/dist/cjs/SidebarPanel/styles.module.css.json +0 -1
- package/dist/cjs/Spinner/index.js +0 -64
- package/dist/cjs/Spinner/index.js.map +0 -1
- package/dist/cjs/Spinner/styles.module.css.json +0 -1
- package/dist/cjs/SplitView/SplitViewPane/index.js +0 -14
- package/dist/cjs/SplitView/SplitViewPane/index.js.map +0 -1
- package/dist/cjs/SplitView/SplitViewPane/styles.module.css.json +0 -1
- package/dist/cjs/SplitView/SplitViewSash/index.js +0 -76
- package/dist/cjs/SplitView/SplitViewSash/index.js.map +0 -1
- package/dist/cjs/SplitView/SplitViewSash/styles.module.css.json +0 -1
- package/dist/cjs/SplitView/index.js +0 -206
- package/dist/cjs/SplitView/index.js.map +0 -1
- package/dist/cjs/SplitView/styles.module.css.json +0 -1
- package/dist/cjs/SplitView/types.js +0 -3
- package/dist/cjs/SplitView/types.js.map +0 -1
- package/dist/cjs/SwitchField/index.js +0 -34
- package/dist/cjs/SwitchField/index.js.map +0 -1
- package/dist/cjs/SwitchField/styles.module.css.json +0 -1
- package/dist/cjs/SwitchInput/index.js +0 -61
- package/dist/cjs/SwitchInput/index.js.map +0 -1
- package/dist/cjs/SwitchInput/styles.module.css.json +0 -1
- package/dist/cjs/TextField/index.js +0 -26
- package/dist/cjs/TextField/index.js.map +0 -1
- package/dist/cjs/TextInput/index.js +0 -49
- package/dist/cjs/TextInput/index.js.map +0 -1
- package/dist/cjs/TextInput/styles.module.css.json +0 -1
- package/dist/cjs/TextareaField/index.js +0 -26
- package/dist/cjs/TextareaField/index.js.map +0 -1
- package/dist/cjs/TextareaInput/index.js +0 -49
- package/dist/cjs/TextareaInput/index.js.map +0 -1
- package/dist/cjs/TextareaInput/styles.module.css.json +0 -1
- package/dist/cjs/Toolbar/Button/index.js +0 -15
- package/dist/cjs/Toolbar/Button/index.js.map +0 -1
- package/dist/cjs/Toolbar/Button/styles.module.css.json +0 -1
- package/dist/cjs/Toolbar/Stack/index.js +0 -19
- package/dist/cjs/Toolbar/Stack/index.js.map +0 -1
- package/dist/cjs/Toolbar/Stack/styles.module.css.json +0 -1
- package/dist/cjs/Toolbar/Title/index.js +0 -15
- package/dist/cjs/Toolbar/Title/index.js.map +0 -1
- package/dist/cjs/Toolbar/Title/styles.module.css.json +0 -1
- package/dist/cjs/Toolbar/Toolbar/index.js +0 -99
- package/dist/cjs/Toolbar/Toolbar/index.js.map +0 -1
- package/dist/cjs/Toolbar/Toolbar/styles.module.css.json +0 -1
- package/dist/cjs/Toolbar/index.js +0 -12
- package/dist/cjs/Toolbar/index.js.map +0 -1
- package/dist/cjs/Tooltip/Tooltip/index.js +0 -116
- package/dist/cjs/Tooltip/Tooltip/index.js.map +0 -1
- package/dist/cjs/Tooltip/TooltipContent/index.js +0 -147
- package/dist/cjs/Tooltip/TooltipContent/index.js.map +0 -1
- package/dist/cjs/Tooltip/TooltipContent/styles.module.css.json +0 -1
- package/dist/cjs/Tooltip/TooltipDelayGroup/index.js +0 -140
- package/dist/cjs/Tooltip/TooltipDelayGroup/index.js.map +0 -1
- package/dist/cjs/Tooltip/TooltipTrigger/index.js +0 -102
- package/dist/cjs/Tooltip/TooltipTrigger/index.js.map +0 -1
- package/dist/cjs/Tooltip/index.js +0 -12
- package/dist/cjs/Tooltip/index.js.map +0 -1
- package/dist/cjs/Tooltip/utils.js +0 -165
- package/dist/cjs/Tooltip/utils.js.map +0 -1
- package/dist/cjs/VerticalSplit/index.js +0 -337
- package/dist/cjs/VerticalSplit/index.js.map +0 -1
- package/dist/cjs/VerticalSplit/styles.module.css.json +0 -1
- package/dist/cjs/generateStyleFromCtx/index.js +0 -169
- package/dist/cjs/generateStyleFromCtx/index.js.map +0 -1
- package/dist/cjs/icons.js +0 -56
- package/dist/cjs/icons.js.map +0 -1
- package/dist/cjs/index.js +0 -47
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/mergeRefs/index.js +0 -20
- package/dist/cjs/mergeRefs/index.js.map +0 -1
- package/dist/cjs/useClickOutside/index.js +0 -25
- package/dist/cjs/useClickOutside/index.js.map +0 -1
- package/dist/cjs/useMediaQuery/index.js +0 -158
- package/dist/cjs/useMediaQuery/index.js.map +0 -1
- package/dist/esm/Button/index.d.ts +0 -91
- package/dist/esm/Button/index.js +0 -86
- package/dist/esm/Button/index.js.map +0 -1
- package/dist/esm/Button/styles.module.css.json +0 -1
- package/dist/esm/ButtonGroup/Button/index.d.ts +0 -10
- package/dist/esm/ButtonGroup/Button/index.js +0 -12
- package/dist/esm/ButtonGroup/Button/index.js.map +0 -1
- package/dist/esm/ButtonGroup/Button/styles.module.css.json +0 -1
- package/dist/esm/ButtonGroup/Group/index.d.ts +0 -21
- package/dist/esm/ButtonGroup/Group/index.js +0 -22
- package/dist/esm/ButtonGroup/Group/index.js.map +0 -1
- package/dist/esm/ButtonGroup/Group/styles.module.css.json +0 -1
- package/dist/esm/ButtonGroup/index.d.ts +0 -4
- package/dist/esm/ButtonGroup/index.js +0 -3
- package/dist/esm/ButtonGroup/index.js.map +0 -1
- package/dist/esm/Canvas/index.d.ts +0 -306
- package/dist/esm/Canvas/index.js +0 -325
- package/dist/esm/Canvas/index.js.map +0 -1
- package/dist/esm/Canvas/styles.module.css.json +0 -1
- package/dist/esm/ContextInspector/index.d.ts +0 -6
- package/dist/esm/ContextInspector/index.js +0 -111
- package/dist/esm/ContextInspector/index.js.map +0 -1
- package/dist/esm/ContextInspector/styles.module.css.json +0 -1
- package/dist/esm/Dropdown/Dropdown.d.ts +0 -113
- package/dist/esm/Dropdown/Dropdown.js +0 -128
- package/dist/esm/Dropdown/Dropdown.js.map +0 -1
- package/dist/esm/Dropdown/DropdownContext.d.ts +0 -6
- package/dist/esm/Dropdown/DropdownContext.js +0 -6
- package/dist/esm/Dropdown/DropdownContext.js.map +0 -1
- package/dist/esm/Dropdown/Group.d.ts +0 -7
- package/dist/esm/Dropdown/Group.js +0 -9
- package/dist/esm/Dropdown/Group.js.map +0 -1
- package/dist/esm/Dropdown/Menu.d.ts +0 -6
- package/dist/esm/Dropdown/Menu.js +0 -218
- package/dist/esm/Dropdown/Menu.js.map +0 -1
- package/dist/esm/Dropdown/MenuContext.d.ts +0 -8
- package/dist/esm/Dropdown/MenuContext.js +0 -9
- package/dist/esm/Dropdown/MenuContext.js.map +0 -1
- package/dist/esm/Dropdown/Option.d.ts +0 -13
- package/dist/esm/Dropdown/Option.js +0 -74
- package/dist/esm/Dropdown/Option.js.map +0 -1
- package/dist/esm/Dropdown/OptionAction.d.ts +0 -12
- package/dist/esm/Dropdown/OptionAction.js +0 -22
- package/dist/esm/Dropdown/OptionAction.js.map +0 -1
- package/dist/esm/Dropdown/Portal.d.ts +0 -5
- package/dist/esm/Dropdown/Portal.js +0 -28
- package/dist/esm/Dropdown/Portal.js.map +0 -1
- package/dist/esm/Dropdown/Separator.d.ts +0 -2
- package/dist/esm/Dropdown/Separator.js +0 -11
- package/dist/esm/Dropdown/Separator.js.map +0 -1
- package/dist/esm/Dropdown/Text.d.ts +0 -5
- package/dist/esm/Dropdown/Text.js +0 -7
- package/dist/esm/Dropdown/Text.js.map +0 -1
- package/dist/esm/Dropdown/index.d.ts +0 -9
- package/dist/esm/Dropdown/index.js +0 -9
- package/dist/esm/Dropdown/index.js.map +0 -1
- package/dist/esm/Dropdown/styles.module.css.json +0 -1
- package/dist/esm/FieldError/index.d.ts +0 -6
- package/dist/esm/FieldError/index.js +0 -7
- package/dist/esm/FieldError/index.js.map +0 -1
- package/dist/esm/FieldError/styles.module.css.json +0 -1
- package/dist/esm/FieldGroup/index.d.ts +0 -7
- package/dist/esm/FieldGroup/index.js +0 -33
- package/dist/esm/FieldGroup/index.js.map +0 -1
- package/dist/esm/FieldGroup/styles.module.css.json +0 -1
- package/dist/esm/FieldHint/index.d.ts +0 -6
- package/dist/esm/FieldHint/index.js +0 -7
- package/dist/esm/FieldHint/index.js.map +0 -1
- package/dist/esm/FieldHint/styles.module.css.json +0 -1
- package/dist/esm/FieldWrapper/index.d.ts +0 -13
- package/dist/esm/FieldWrapper/index.js +0 -22
- package/dist/esm/FieldWrapper/index.js.map +0 -1
- package/dist/esm/Form/index.d.ts +0 -109
- package/dist/esm/Form/index.js +0 -143
- package/dist/esm/Form/index.js.map +0 -1
- package/dist/esm/Form/styles.module.css.json +0 -1
- package/dist/esm/FormLabel/index.d.ts +0 -10
- package/dist/esm/FormLabel/index.js +0 -38
- package/dist/esm/FormLabel/index.js.map +0 -1
- package/dist/esm/FormLabel/styles.module.css.json +0 -1
- package/dist/esm/HotKey/index.d.ts +0 -70
- package/dist/esm/HotKey/index.js +0 -75
- package/dist/esm/HotKey/index.js.map +0 -1
- package/dist/esm/HotKey/styles.module.css.json +0 -1
- package/dist/esm/Section/index.d.ts +0 -63
- package/dist/esm/Section/index.js +0 -63
- package/dist/esm/Section/index.js.map +0 -1
- package/dist/esm/Section/styles.module.css.json +0 -1
- package/dist/esm/SelectField/index.d.ts +0 -60
- package/dist/esm/SelectField/index.js +0 -34
- package/dist/esm/SelectField/index.js.map +0 -1
- package/dist/esm/SelectInput/index.d.ts +0 -17
- package/dist/esm/SelectInput/index.js +0 -122
- package/dist/esm/SelectInput/index.js.map +0 -1
- package/dist/esm/SidebarPanel/index.d.ts +0 -43
- package/dist/esm/SidebarPanel/index.js +0 -55
- package/dist/esm/SidebarPanel/index.js.map +0 -1
- package/dist/esm/SidebarPanel/styles.module.css.json +0 -1
- package/dist/esm/Spinner/index.d.ts +0 -27
- package/dist/esm/Spinner/index.js +0 -57
- package/dist/esm/Spinner/index.js.map +0 -1
- package/dist/esm/Spinner/styles.module.css.json +0 -1
- package/dist/esm/SplitView/SplitViewPane/index.d.ts +0 -7
- package/dist/esm/SplitView/SplitViewPane/index.js +0 -7
- package/dist/esm/SplitView/SplitViewPane/index.js.map +0 -1
- package/dist/esm/SplitView/SplitViewPane/styles.module.css.json +0 -1
- package/dist/esm/SplitView/SplitViewSash/index.d.ts +0 -17
- package/dist/esm/SplitView/SplitViewSash/index.js +0 -46
- package/dist/esm/SplitView/SplitViewSash/index.js.map +0 -1
- package/dist/esm/SplitView/SplitViewSash/styles.module.css.json +0 -1
- package/dist/esm/SplitView/index.d.ts +0 -16
- package/dist/esm/SplitView/index.js +0 -176
- package/dist/esm/SplitView/index.js.map +0 -1
- package/dist/esm/SplitView/styles.module.css.json +0 -1
- package/dist/esm/SplitView/types.d.ts +0 -8
- package/dist/esm/SplitView/types.js +0 -2
- package/dist/esm/SplitView/types.js.map +0 -1
- package/dist/esm/SwitchField/index.d.ts +0 -16
- package/dist/esm/SwitchField/index.js +0 -27
- package/dist/esm/SwitchField/index.js.map +0 -1
- package/dist/esm/SwitchField/styles.module.css.json +0 -1
- package/dist/esm/SwitchInput/index.d.ts +0 -10
- package/dist/esm/SwitchInput/index.js +0 -54
- package/dist/esm/SwitchInput/index.js.map +0 -1
- package/dist/esm/SwitchInput/styles.module.css.json +0 -1
- package/dist/esm/TextField/index.d.ts +0 -17
- package/dist/esm/TextField/index.js +0 -19
- package/dist/esm/TextField/index.js.map +0 -1
- package/dist/esm/TextInput/index.d.ts +0 -15
- package/dist/esm/TextInput/index.js +0 -42
- package/dist/esm/TextInput/index.js.map +0 -1
- package/dist/esm/TextInput/styles.module.css.json +0 -1
- package/dist/esm/TextareaField/index.d.ts +0 -17
- package/dist/esm/TextareaField/index.js +0 -19
- package/dist/esm/TextareaField/index.js.map +0 -1
- package/dist/esm/TextareaInput/index.d.ts +0 -14
- package/dist/esm/TextareaInput/index.js +0 -42
- package/dist/esm/TextareaInput/index.js.map +0 -1
- package/dist/esm/TextareaInput/styles.module.css.json +0 -1
- package/dist/esm/Toolbar/Button/index.d.ts +0 -8
- package/dist/esm/Toolbar/Button/index.js +0 -8
- package/dist/esm/Toolbar/Button/index.js.map +0 -1
- package/dist/esm/Toolbar/Button/styles.module.css.json +0 -1
- package/dist/esm/Toolbar/Stack/index.d.ts +0 -8
- package/dist/esm/Toolbar/Stack/index.js +0 -12
- package/dist/esm/Toolbar/Stack/index.js.map +0 -1
- package/dist/esm/Toolbar/Stack/styles.module.css.json +0 -1
- package/dist/esm/Toolbar/Title/index.d.ts +0 -7
- package/dist/esm/Toolbar/Title/index.js +0 -8
- package/dist/esm/Toolbar/Title/index.js.map +0 -1
- package/dist/esm/Toolbar/Title/styles.module.css.json +0 -1
- package/dist/esm/Toolbar/Toolbar/index.d.ts +0 -91
- package/dist/esm/Toolbar/Toolbar/index.js +0 -92
- package/dist/esm/Toolbar/Toolbar/index.js.map +0 -1
- package/dist/esm/Toolbar/Toolbar/styles.module.css.json +0 -1
- package/dist/esm/Toolbar/index.d.ts +0 -8
- package/dist/esm/Toolbar/index.js +0 -5
- package/dist/esm/Toolbar/index.js.map +0 -1
- package/dist/esm/Tooltip/Tooltip/index.d.ts +0 -74
- package/dist/esm/Tooltip/Tooltip/index.js +0 -89
- package/dist/esm/Tooltip/Tooltip/index.js.map +0 -1
- package/dist/esm/Tooltip/TooltipContent/index.d.ts +0 -68
- package/dist/esm/Tooltip/TooltipContent/index.js +0 -118
- package/dist/esm/Tooltip/TooltipContent/index.js.map +0 -1
- package/dist/esm/Tooltip/TooltipContent/styles.module.css.json +0 -1
- package/dist/esm/Tooltip/TooltipDelayGroup/index.d.ts +0 -118
- package/dist/esm/Tooltip/TooltipDelayGroup/index.js +0 -113
- package/dist/esm/Tooltip/TooltipDelayGroup/index.js.map +0 -1
- package/dist/esm/Tooltip/TooltipTrigger/index.d.ts +0 -45
- package/dist/esm/Tooltip/TooltipTrigger/index.js +0 -76
- package/dist/esm/Tooltip/TooltipTrigger/index.js.map +0 -1
- package/dist/esm/Tooltip/index.d.ts +0 -8
- package/dist/esm/Tooltip/index.js +0 -5
- package/dist/esm/Tooltip/index.js.map +0 -1
- package/dist/esm/Tooltip/utils.d.ts +0 -166
- package/dist/esm/Tooltip/utils.js +0 -135
- package/dist/esm/Tooltip/utils.js.map +0 -1
- package/dist/esm/VerticalSplit/index.d.ts +0 -238
- package/dist/esm/VerticalSplit/index.js +0 -307
- package/dist/esm/VerticalSplit/index.js.map +0 -1
- package/dist/esm/VerticalSplit/styles.module.css.json +0 -1
- package/dist/esm/generateStyleFromCtx/index.d.ts +0 -3
- package/dist/esm/generateStyleFromCtx/index.js +0 -165
- package/dist/esm/generateStyleFromCtx/index.js.map +0 -1
- package/dist/esm/icons.d.ts +0 -15
- package/dist/esm/icons.js +0 -42
- package/dist/esm/icons.js.map +0 -1
- package/dist/esm/index.d.ts +0 -30
- package/dist/esm/index.js +0 -31
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/mergeRefs/index.d.ts +0 -2
- package/dist/esm/mergeRefs/index.js +0 -16
- package/dist/esm/mergeRefs/index.js.map +0 -1
- package/dist/esm/useClickOutside/index.d.ts +0 -2
- package/dist/esm/useClickOutside/index.js +0 -21
- package/dist/esm/useClickOutside/index.js.map +0 -1
- package/dist/esm/useMediaQuery/index.d.ts +0 -8
- package/dist/esm/useMediaQuery/index.js +0 -149
- package/dist/esm/useMediaQuery/index.js.map +0 -1
- package/dist/types/Button/index.d.ts +0 -91
- package/dist/types/ButtonGroup/Button/index.d.ts +0 -10
- package/dist/types/ButtonGroup/Group/index.d.ts +0 -21
- package/dist/types/ButtonGroup/index.d.ts +0 -4
- package/dist/types/Canvas/index.d.ts +0 -306
- package/dist/types/ContextInspector/index.d.ts +0 -6
- package/dist/types/Dropdown/Dropdown.d.ts +0 -113
- package/dist/types/Dropdown/DropdownContext.d.ts +0 -6
- package/dist/types/Dropdown/Group.d.ts +0 -7
- package/dist/types/Dropdown/Menu.d.ts +0 -6
- package/dist/types/Dropdown/MenuContext.d.ts +0 -8
- package/dist/types/Dropdown/Option.d.ts +0 -13
- package/dist/types/Dropdown/OptionAction.d.ts +0 -12
- package/dist/types/Dropdown/Portal.d.ts +0 -5
- package/dist/types/Dropdown/Separator.d.ts +0 -2
- package/dist/types/Dropdown/Text.d.ts +0 -5
- package/dist/types/Dropdown/index.d.ts +0 -9
- package/dist/types/FieldError/index.d.ts +0 -6
- package/dist/types/FieldGroup/index.d.ts +0 -7
- package/dist/types/FieldHint/index.d.ts +0 -6
- package/dist/types/FieldWrapper/index.d.ts +0 -13
- package/dist/types/Form/index.d.ts +0 -109
- package/dist/types/FormLabel/index.d.ts +0 -10
- package/dist/types/HotKey/index.d.ts +0 -70
- package/dist/types/Section/index.d.ts +0 -63
- package/dist/types/SelectField/index.d.ts +0 -60
- package/dist/types/SelectInput/index.d.ts +0 -17
- package/dist/types/SidebarPanel/index.d.ts +0 -43
- package/dist/types/Spinner/index.d.ts +0 -27
- package/dist/types/SplitView/SplitViewPane/index.d.ts +0 -7
- package/dist/types/SplitView/SplitViewSash/index.d.ts +0 -17
- package/dist/types/SplitView/index.d.ts +0 -16
- package/dist/types/SplitView/types.d.ts +0 -8
- package/dist/types/SwitchField/index.d.ts +0 -16
- package/dist/types/SwitchInput/index.d.ts +0 -10
- package/dist/types/TextField/index.d.ts +0 -17
- package/dist/types/TextInput/index.d.ts +0 -15
- package/dist/types/TextareaField/index.d.ts +0 -17
- package/dist/types/TextareaInput/index.d.ts +0 -14
- package/dist/types/Toolbar/Button/index.d.ts +0 -8
- package/dist/types/Toolbar/Stack/index.d.ts +0 -8
- package/dist/types/Toolbar/Title/index.d.ts +0 -7
- package/dist/types/Toolbar/Toolbar/index.d.ts +0 -91
- package/dist/types/Toolbar/index.d.ts +0 -8
- package/dist/types/Tooltip/Tooltip/index.d.ts +0 -74
- package/dist/types/Tooltip/TooltipContent/index.d.ts +0 -68
- package/dist/types/Tooltip/TooltipDelayGroup/index.d.ts +0 -118
- package/dist/types/Tooltip/TooltipTrigger/index.d.ts +0 -45
- package/dist/types/Tooltip/index.d.ts +0 -8
- package/dist/types/Tooltip/utils.d.ts +0 -166
- package/dist/types/VerticalSplit/index.d.ts +0 -238
- package/dist/types/generateStyleFromCtx/index.d.ts +0 -3
- package/dist/types/icons.d.ts +0 -15
- package/dist/types/index.d.ts +0 -30
- package/dist/types/mergeRefs/index.d.ts +0 -2
- package/dist/types/useClickOutside/index.d.ts +0 -2
- package/dist/types/useMediaQuery/index.d.ts +0 -8
- package/src/Button/index.tsx +0 -170
- package/src/Button/styles.module.css +0 -149
- package/src/Button/styles.module.css.json +0 -1
- package/src/ButtonGroup/Button/index.tsx +0 -44
- package/src/ButtonGroup/Button/styles.module.css +0 -70
- package/src/ButtonGroup/Button/styles.module.css.json +0 -1
- package/src/ButtonGroup/Group/index.tsx +0 -31
- package/src/ButtonGroup/Group/styles.module.css +0 -6
- package/src/ButtonGroup/Group/styles.module.css.json +0 -1
- package/src/ButtonGroup/index.ts +0 -4
- package/src/Canvas/index.tsx +0 -362
- package/src/Canvas/styles.module.css +0 -136
- package/src/Canvas/styles.module.css.json +0 -1
- package/src/ContextInspector/index.tsx +0 -211
- package/src/ContextInspector/styles.module.css +0 -90
- package/src/ContextInspector/styles.module.css.json +0 -1
- package/src/Dropdown/Dropdown.tsx +0 -152
- package/src/Dropdown/DropdownContext.tsx +0 -10
- package/src/Dropdown/Group.tsx +0 -17
- package/src/Dropdown/Menu.tsx +0 -341
- package/src/Dropdown/MenuContext.tsx +0 -18
- package/src/Dropdown/Option.tsx +0 -147
- package/src/Dropdown/OptionAction.tsx +0 -43
- package/src/Dropdown/Portal.tsx +0 -47
- package/src/Dropdown/Separator.tsx +0 -13
- package/src/Dropdown/Text.tsx +0 -8
- package/src/Dropdown/index.tsx +0 -26
- package/src/Dropdown/styles.module.css +0 -258
- package/src/Dropdown/styles.module.css.json +0 -1
- package/src/FieldError/index.tsx +0 -10
- package/src/FieldError/styles.module.css +0 -6
- package/src/FieldError/styles.module.css.json +0 -1
- package/src/FieldGroup/index.tsx +0 -27
- package/src/FieldGroup/styles.module.css +0 -12
- package/src/FieldGroup/styles.module.css.json +0 -1
- package/src/FieldHint/index.tsx +0 -10
- package/src/FieldHint/styles.module.css +0 -14
- package/src/FieldHint/styles.module.css.json +0 -1
- package/src/FieldWrapper/index.tsx +0 -38
- package/src/Form/index.tsx +0 -154
- package/src/Form/styles.module.css +0 -19
- package/src/Form/styles.module.css.json +0 -1
- package/src/FormLabel/index.tsx +0 -36
- package/src/FormLabel/styles.module.css +0 -31
- package/src/FormLabel/styles.module.css.json +0 -1
- package/src/HotKey/index.tsx +0 -95
- package/src/HotKey/styles.module.css +0 -22
- package/src/HotKey/styles.module.css.json +0 -1
- package/src/Section/index.tsx +0 -104
- package/src/Section/styles.module.css +0 -100
- package/src/Section/styles.module.css.json +0 -1
- package/src/SelectField/index.tsx +0 -242
- package/src/SelectInput/index.tsx +0 -257
- package/src/SidebarPanel/index.tsx +0 -85
- package/src/SidebarPanel/styles.module.css +0 -49
- package/src/SidebarPanel/styles.module.css.json +0 -1
- package/src/Spinner/index.tsx +0 -68
- package/src/Spinner/styles.module.css +0 -31
- package/src/Spinner/styles.module.css.json +0 -1
- package/src/SplitView/SplitViewPane/index.tsx +0 -19
- package/src/SplitView/SplitViewPane/styles.module.css +0 -6
- package/src/SplitView/SplitViewPane/styles.module.css.json +0 -1
- package/src/SplitView/SplitViewSash/index.tsx +0 -99
- package/src/SplitView/SplitViewSash/styles.module.css +0 -68
- package/src/SplitView/SplitViewSash/styles.module.css.json +0 -1
- package/src/SplitView/index.tsx +0 -256
- package/src/SplitView/styles.module.css +0 -22
- package/src/SplitView/styles.module.css.json +0 -1
- package/src/SplitView/types.ts +0 -9
- package/src/SwitchField/index.tsx +0 -67
- package/src/SwitchField/styles.module.css +0 -25
- package/src/SwitchField/styles.module.css.json +0 -1
- package/src/SwitchInput/index.tsx +0 -74
- package/src/SwitchInput/styles.module.css +0 -103
- package/src/SwitchInput/styles.module.css.json +0 -1
- package/src/TextField/index.tsx +0 -56
- package/src/TextField/styles.module.css.json +0 -1
- package/src/TextInput/index.tsx +0 -82
- package/src/TextInput/styles.module.css +0 -54
- package/src/TextInput/styles.module.css.json +0 -1
- package/src/TextareaField/index.tsx +0 -56
- package/src/TextareaField/styles.module.css +0 -0
- package/src/TextareaField/styles.module.css.json +0 -1
- package/src/TextareaInput/index.tsx +0 -71
- package/src/TextareaInput/styles.module.css +0 -54
- package/src/TextareaInput/styles.module.css.json +0 -1
- package/src/Toolbar/Button/index.tsx +0 -36
- package/src/Toolbar/Button/styles.module.css +0 -43
- package/src/Toolbar/Button/styles.module.css.json +0 -1
- package/src/Toolbar/Stack/index.tsx +0 -33
- package/src/Toolbar/Stack/styles.module.css +0 -18
- package/src/Toolbar/Stack/styles.module.css.json +0 -1
- package/src/Toolbar/Title/index.tsx +0 -17
- package/src/Toolbar/Title/styles.module.css +0 -12
- package/src/Toolbar/Title/styles.module.css.json +0 -1
- package/src/Toolbar/Toolbar/index.tsx +0 -112
- package/src/Toolbar/Toolbar/styles.module.css +0 -15
- package/src/Toolbar/Toolbar/styles.module.css.json +0 -1
- package/src/Toolbar/index.ts +0 -8
- package/src/Tooltip/Tooltip/index.tsx +0 -85
- package/src/Tooltip/TooltipContent/index.tsx +0 -145
- package/src/Tooltip/TooltipContent/styles.module.css +0 -10
- package/src/Tooltip/TooltipContent/styles.module.css.json +0 -1
- package/src/Tooltip/TooltipDelayGroup/index.tsx +0 -128
- package/src/Tooltip/TooltipTrigger/index.tsx +0 -71
- package/src/Tooltip/index.ts +0 -8
- package/src/Tooltip/utils.ts +0 -176
- package/src/VerticalSplit/index.tsx +0 -401
- package/src/VerticalSplit/styles.module.css +0 -99
- package/src/VerticalSplit/styles.module.css.json +0 -1
- package/src/base.css +0 -89
- package/src/generateStyleFromCtx/index.ts +0 -182
- package/src/global.css +0 -31
- package/src/icons.tsx +0 -176
- package/src/index.ts +0 -30
- package/src/mergeRefs/index.ts +0 -9
- package/src/useClickOutside/index.ts +0 -30
- package/src/useMediaQuery/index.ts +0 -187
- package/styles.css +0 -29
- package/types.json +0 -25860
- /package/{src/TextField/styles.module.css → dist/Dropdown/triggers/types.js} +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { reorder } from "../dnd/reorder.js";
|
|
2
|
+
//#region ../ui/src/lists/Table/layout.ts
|
|
3
|
+
var MIN_COLUMN_WIDTH = .05;
|
|
4
|
+
var NEW_COLUMN_WIDTH = .15;
|
|
5
|
+
function resolveTableLayout(columns, layout) {
|
|
6
|
+
const existing = layout.columns.filter(({ name }) => columns.some((column) => column.name === name));
|
|
7
|
+
const total = existing.reduce((sum, column) => sum + column.width, 0);
|
|
8
|
+
const widths = existing.map((column) => column.width / total);
|
|
9
|
+
if (widths.length > 0) widths[widths.length - 1] += 1 - widths.reduce((sum, width) => sum + width, 0);
|
|
10
|
+
return {
|
|
11
|
+
columnNames: existing.map((column) => column.name),
|
|
12
|
+
widths
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function toLayoutColumns({ columnNames, widths }) {
|
|
16
|
+
return columnNames.map((name, index) => ({
|
|
17
|
+
name,
|
|
18
|
+
width: widths[index]
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
var DEFAULT_MIN_COLUMN_PIXELS = 120;
|
|
22
|
+
function fitTableLayout(resolved, columnsByName, availableWidth) {
|
|
23
|
+
if (availableWidth === void 0) return resolved;
|
|
24
|
+
const minWidth = (name) => columnsByName.get(name)?.minWidth ?? DEFAULT_MIN_COLUMN_PIXELS;
|
|
25
|
+
const priority = (name) => columnsByName.get(name)?.priority ?? 0;
|
|
26
|
+
const names = [...resolved.columnNames];
|
|
27
|
+
let total = names.reduce((sum, name) => sum + minWidth(name), 0);
|
|
28
|
+
while (names.length > 1 && total > availableWidth) {
|
|
29
|
+
let dropIndex = names.length - 1;
|
|
30
|
+
for (let index = names.length - 2; index >= 1; index -= 1) if (priority(names[index]) < priority(names[dropIndex])) dropIndex = index;
|
|
31
|
+
total -= minWidth(names[dropIndex]);
|
|
32
|
+
names.splice(dropIndex, 1);
|
|
33
|
+
}
|
|
34
|
+
if (names.length === resolved.columnNames.length) return resolved;
|
|
35
|
+
const widths = names.map((name) => resolved.widths[resolved.columnNames.indexOf(name)]);
|
|
36
|
+
const sum = widths.reduce((acc, width) => acc + width, 0);
|
|
37
|
+
return {
|
|
38
|
+
columnNames: names,
|
|
39
|
+
widths: widths.map((width) => width / sum)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function withHiddenColumns(resolved, shown, layout) {
|
|
43
|
+
if (shown === resolved) return layout;
|
|
44
|
+
const shownSum = shown.columnNames.reduce((sum, name) => sum + resolved.widths[resolved.columnNames.indexOf(name)], 0);
|
|
45
|
+
const changed = new Map(layout.columns.map((column) => [column.name, column.width * shownSum]));
|
|
46
|
+
const order = layout.columns.map((column) => column.name);
|
|
47
|
+
let next = 0;
|
|
48
|
+
return { columns: resolved.columnNames.map((name) => changed.has(name) ? order[next++] : name).map((name) => ({
|
|
49
|
+
name,
|
|
50
|
+
width: changed.get(name) ?? resolved.widths[resolved.columnNames.indexOf(name)]
|
|
51
|
+
})) };
|
|
52
|
+
}
|
|
53
|
+
function toggleColumn(resolved, columnName) {
|
|
54
|
+
const columns = toLayoutColumns(resolved);
|
|
55
|
+
const existing = columns.find((column) => column.name === columnName);
|
|
56
|
+
if (existing) {
|
|
57
|
+
const rest = columns.filter((column) => column.name !== columnName);
|
|
58
|
+
return { columns: rest.map((column) => ({
|
|
59
|
+
...column,
|
|
60
|
+
width: column.width + existing.width / rest.length
|
|
61
|
+
})) };
|
|
62
|
+
}
|
|
63
|
+
return { columns: [...columns.map((column) => ({
|
|
64
|
+
...column,
|
|
65
|
+
width: column.width * .85
|
|
66
|
+
})), {
|
|
67
|
+
name: columnName,
|
|
68
|
+
width: NEW_COLUMN_WIDTH
|
|
69
|
+
}] };
|
|
70
|
+
}
|
|
71
|
+
function moveColumn(resolved, dropResult) {
|
|
72
|
+
return { columns: reorder(toLayoutColumns(resolved), dropResult) };
|
|
73
|
+
}
|
|
74
|
+
function resizeColumn(resolved, index, amount) {
|
|
75
|
+
return { columns: toLayoutColumns(resolved).map((column, columnIndex) => {
|
|
76
|
+
if (columnIndex === index) return {
|
|
77
|
+
...column,
|
|
78
|
+
width: column.width - amount
|
|
79
|
+
};
|
|
80
|
+
if (columnIndex === index + 1) return {
|
|
81
|
+
...column,
|
|
82
|
+
width: column.width + amount
|
|
83
|
+
};
|
|
84
|
+
return column;
|
|
85
|
+
}) };
|
|
86
|
+
}
|
|
87
|
+
function columnWidthVariable(index) {
|
|
88
|
+
return `--Table-col-${index}`;
|
|
89
|
+
}
|
|
90
|
+
function toPercentage(width) {
|
|
91
|
+
return `${width * 100}%`;
|
|
92
|
+
}
|
|
93
|
+
function columnWidthsStyle(widths) {
|
|
94
|
+
return Object.fromEntries(widths.map((width, index) => [columnWidthVariable(index), toPercentage(width)]));
|
|
95
|
+
}
|
|
96
|
+
var cellStyles = [];
|
|
97
|
+
function columnCellStyle(index) {
|
|
98
|
+
if (!cellStyles[index]) cellStyles[index] = { width: `var(${columnWidthVariable(index)})` };
|
|
99
|
+
return cellStyles[index];
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
export { MIN_COLUMN_WIDTH, columnCellStyle, columnWidthVariable, columnWidthsStyle, fitTableLayout, moveColumn, resizeColumn, resolveTableLayout, toPercentage, toggleColumn, withHiddenColumns };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TableLayout } from './types.js';
|
|
2
|
+
export type TableLayoutStorage = [
|
|
3
|
+
layout: TableLayout,
|
|
4
|
+
setLayout: (layout: TableLayout) => void
|
|
5
|
+
];
|
|
6
|
+
export declare function useInMemoryTableLayout(defaultLayout: TableLayout): TableLayoutStorage;
|
|
7
|
+
export declare function useLocalStorageTableLayout(key: string, defaultLayout: TableLayout): TableLayoutStorage;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
//#region ../ui/src/lists/Table/storage.ts
|
|
3
|
+
function useInMemoryTableLayout(defaultLayout) {
|
|
4
|
+
return useState(defaultLayout);
|
|
5
|
+
}
|
|
6
|
+
function readStoredLayout(key) {
|
|
7
|
+
try {
|
|
8
|
+
const value = window.localStorage.getItem(key);
|
|
9
|
+
if (!value) return;
|
|
10
|
+
const parsed = JSON.parse(value);
|
|
11
|
+
return Array.isArray(parsed?.columns) ? parsed : void 0;
|
|
12
|
+
} catch {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
function useLocalStorageTableLayout(key, defaultLayout) {
|
|
17
|
+
const [layout, setStateLayout] = useState(() => readStoredLayout(key) ?? defaultLayout);
|
|
18
|
+
return [layout, useCallback((newLayout) => {
|
|
19
|
+
setStateLayout(newLayout);
|
|
20
|
+
try {
|
|
21
|
+
window.localStorage.setItem(key, JSON.stringify(newLayout));
|
|
22
|
+
} catch {}
|
|
23
|
+
}, [key])];
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { useInMemoryTableLayout, useLocalStorageTableLayout };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Message } from '../../Message.js';
|
|
3
|
+
export type TableColumn<R = any> = {
|
|
4
|
+
/** The identifier of the column. The layout keeps it. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** The label in the header and in the columns menu */
|
|
7
|
+
label: Message;
|
|
8
|
+
/** The user can sort the rows by this column (with `sort.onChange` on the table) */
|
|
9
|
+
sortable?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* The cell shows its content on one line, and a long text stops at the width
|
|
12
|
+
* of the column with an ellipsis. It overrides the `truncate` prop of the
|
|
13
|
+
* table (true by default). Set it to false for a cell with a layout of its
|
|
14
|
+
* own (images, lists, more lines).
|
|
15
|
+
*/
|
|
16
|
+
truncate?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* The smallest width of the column in pixels, with the padding of the cell.
|
|
19
|
+
* When the visible columns do not fit at their smallest width, the table
|
|
20
|
+
* hides the columns with the lowest `priority` (see fitTableLayout).
|
|
21
|
+
*/
|
|
22
|
+
minWidth?: number;
|
|
23
|
+
/**
|
|
24
|
+
* On a narrow table, the columns with a lower priority go first (the default
|
|
25
|
+
* is 0). The first visible column always stays.
|
|
26
|
+
*/
|
|
27
|
+
priority?: number;
|
|
28
|
+
/**
|
|
29
|
+
* The content of the cell of this column for a row. A row with its own
|
|
30
|
+
* children does not use it.
|
|
31
|
+
*/
|
|
32
|
+
renderCell?: (row: R) => ReactNode;
|
|
33
|
+
};
|
|
34
|
+
export type TableLayoutColumn = {
|
|
35
|
+
name: string;
|
|
36
|
+
width: number;
|
|
37
|
+
};
|
|
38
|
+
export type TableLayout = {
|
|
39
|
+
columns: TableLayoutColumn[];
|
|
40
|
+
};
|
|
41
|
+
export type SortDirection = 'asc' | 'desc';
|
|
42
|
+
export type TableSort = {
|
|
43
|
+
columnName: string;
|
|
44
|
+
direction: SortDirection;
|
|
45
|
+
};
|
|
46
|
+
/** The order of the rows of a table, and the function that changes it */
|
|
47
|
+
export type TableSortState = {
|
|
48
|
+
/** The column and the direction of the order, or null for no order */
|
|
49
|
+
value: TableSort | null;
|
|
50
|
+
/**
|
|
51
|
+
* Runs when the user clicks the header of a sortable column. Without it,
|
|
52
|
+
* the header shows the order, but the user cannot change it.
|
|
53
|
+
*/
|
|
54
|
+
onChange?: (sort: TableSort | null) => void;
|
|
55
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TableColumn, TableSort, TableSortState } from './types.js';
|
|
2
|
+
export type ClientSortColumn<R> = TableColumn<R> & {
|
|
3
|
+
compare?: (a: R, b: R) => number;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Sorts the rows in the browser with the `compare` function of the sorted
|
|
7
|
+
* column. Give `rows` to the table and `sort` to its `sort` prop. Without a
|
|
8
|
+
* sort, the rows keep their order. `initialSort` is the sort
|
|
9
|
+
* of the first render.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useClientSort<R>(rows: R[], columns: ClientSortColumn<R>[], initialSort?: TableSort | null): {
|
|
12
|
+
rows: R[];
|
|
13
|
+
sort: TableSortState;
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
//#region ../ui/src/lists/Table/useClientSort.ts
|
|
3
|
+
/**
|
|
4
|
+
* Sorts the rows in the browser with the `compare` function of the sorted
|
|
5
|
+
* column. Give `rows` to the table and `sort` to its `sort` prop. Without a
|
|
6
|
+
* sort, the rows keep their order. `initialSort` is the sort
|
|
7
|
+
* of the first render.
|
|
8
|
+
*/
|
|
9
|
+
function useClientSort(rows, columns, initialSort = null) {
|
|
10
|
+
const [value, onChange] = useState(initialSort);
|
|
11
|
+
const sort = useMemo(() => ({
|
|
12
|
+
value,
|
|
13
|
+
onChange
|
|
14
|
+
}), [value]);
|
|
15
|
+
return {
|
|
16
|
+
rows: useMemo(() => {
|
|
17
|
+
if (!value) return rows;
|
|
18
|
+
const compare = columns.find((c) => c.name === value.columnName)?.compare;
|
|
19
|
+
if (!compare) return rows;
|
|
20
|
+
const direction = value.direction === "asc" ? 1 : -1;
|
|
21
|
+
return [...rows].sort((a, b) => compare(a, b) * direction);
|
|
22
|
+
}, [
|
|
23
|
+
rows,
|
|
24
|
+
value,
|
|
25
|
+
columns
|
|
26
|
+
]),
|
|
27
|
+
sort
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { useClientSort };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type DragHandleProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Puts the handle in the gutter at the left of the item, out of its
|
|
5
|
+
* content. "wide" is a wider gutter, for a table row. The item must have a
|
|
6
|
+
* CSS `position`. Without it, the handle stays in the flow, and its place
|
|
7
|
+
* comes from `className`.
|
|
8
|
+
*/
|
|
9
|
+
gutter?: 'normal' | 'wide';
|
|
10
|
+
/** A class for the place of the handle in its block */
|
|
11
|
+
className?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* The grip that the user drags to move an item. Give it the `handleRef` of
|
|
15
|
+
* SortableItem (or of useDraggable) as `ref`. It shows when the pointer is
|
|
16
|
+
* on the item.
|
|
17
|
+
*/
|
|
18
|
+
declare const DragHandle: React.ForwardRefExoticComponent<DragHandleProps & React.RefAttributes<HTMLSpanElement>>;
|
|
19
|
+
export default DragHandle;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Generic } from "../../../icons/index.js";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
//#region ../ui/src/lists/dnd/DragHandle.tsx
|
|
6
|
+
/**
|
|
7
|
+
* The grip that the user drags to move an item. Give it the `handleRef` of
|
|
8
|
+
* SortableItem (or of useDraggable) as `ref`. It shows when the pointer is
|
|
9
|
+
* on the item.
|
|
10
|
+
*/
|
|
11
|
+
var DragHandle = forwardRef(function DragHandle({ gutter, className }, ref) {
|
|
12
|
+
return /* @__PURE__ */ jsx("span", {
|
|
13
|
+
ref,
|
|
14
|
+
className: classNames("DragHandle", gutter && "DragHandle--gutter", gutter === "wide" && "DragHandle--gutter-wide", className),
|
|
15
|
+
children: /* @__PURE__ */ jsx(Generic.DragGripIcon, {})
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
//#endregion
|
|
19
|
+
export { DragHandle as default };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type DropIndicatorProps = {
|
|
4
|
+
/** The edge of the element where the dragged item goes. */
|
|
5
|
+
edge: Edge;
|
|
6
|
+
/**
|
|
7
|
+
* The space between the element and its sibling on the side of the edge,
|
|
8
|
+
* as a CSS length. The line goes in the middle of the space.
|
|
9
|
+
* @default '0px'
|
|
10
|
+
*/
|
|
11
|
+
gap?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Moves the start of the line to the right (or down), as a CSS length.
|
|
14
|
+
* Use it to indent the line.
|
|
15
|
+
* @default '0px'
|
|
16
|
+
*/
|
|
17
|
+
inset?: string;
|
|
18
|
+
};
|
|
19
|
+
declare function DropIndicator({ edge, gap, inset, }: DropIndicatorProps): React.JSX.Element;
|
|
20
|
+
declare const _default: React.MemoExoticComponent<typeof DropIndicator>;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
//#region ../ui/src/lists/dnd/DropIndicator.tsx
|
|
5
|
+
function DropIndicator({ edge, gap = "0px", inset = "0px" }) {
|
|
6
|
+
const style = useMemo(() => ({
|
|
7
|
+
"--DropIndicator-gap": gap,
|
|
8
|
+
"--DropIndicator-inset": inset
|
|
9
|
+
}), [gap, inset]);
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: classNames("DropIndicator", `DropIndicator--${edge}`),
|
|
12
|
+
style,
|
|
13
|
+
"aria-hidden": "true"
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
var DropIndicator_default = React.memo(DropIndicator);
|
|
17
|
+
//#endregion
|
|
18
|
+
export { DropIndicator_default as default };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';
|
|
2
|
+
import React, { type ReactNode } from 'react';
|
|
3
|
+
import { type DragData, type RefCallback } from './types.js';
|
|
4
|
+
import { type DragPreview } from './useDraggable.js';
|
|
5
|
+
export type SortableAxis = 'vertical' | 'horizontal';
|
|
6
|
+
export declare const ROOT_CONTAINER_ID = "root";
|
|
7
|
+
export type SortableLocation = {
|
|
8
|
+
index: number;
|
|
9
|
+
containerId: string;
|
|
10
|
+
};
|
|
11
|
+
export type SortableDropResult = {
|
|
12
|
+
draggableId: string;
|
|
13
|
+
source: SortableLocation;
|
|
14
|
+
destination: SortableLocation;
|
|
15
|
+
};
|
|
16
|
+
export type SortableItemData = DragData & {
|
|
17
|
+
kind: 'sortable-item';
|
|
18
|
+
instanceId: string;
|
|
19
|
+
id: string;
|
|
20
|
+
index: number;
|
|
21
|
+
containerId: string;
|
|
22
|
+
};
|
|
23
|
+
export type SortableListProps = {
|
|
24
|
+
/** The `SortableItem` elements, in any structure. */
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* The direction of the list. Use `horizontal` for a row of items, such as
|
|
28
|
+
* table columns or the pictures of a gallery.
|
|
29
|
+
* @default 'vertical'
|
|
30
|
+
*/
|
|
31
|
+
axis?: SortableAxis;
|
|
32
|
+
/**
|
|
33
|
+
* Stops the user from dragging the items.
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Runs when the user drops an item at a new place. Use the indexes to
|
|
39
|
+
* change your data. A drop that does not move the item does not run it.
|
|
40
|
+
*/
|
|
41
|
+
onDrop: (result: SortableDropResult) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Tells if an item can go in a container. By default, all the items can
|
|
44
|
+
* go in all the containers. For example, a fieldset cannot go in another
|
|
45
|
+
* fieldset.
|
|
46
|
+
*/
|
|
47
|
+
canDropInto?: (source: SortableItemData, containerId: string) => boolean;
|
|
48
|
+
};
|
|
49
|
+
export declare function SortableList({ children, axis, disabled, onDrop, canDropInto, }: SortableListProps): React.JSX.Element;
|
|
50
|
+
export declare function useSortableListState(): {
|
|
51
|
+
isDragging: boolean;
|
|
52
|
+
disabled: boolean;
|
|
53
|
+
};
|
|
54
|
+
export type SortableContainerProps = {
|
|
55
|
+
/** The name of the container. Use `ROOT_CONTAINER_ID` for the first level. */
|
|
56
|
+
id: string;
|
|
57
|
+
/**
|
|
58
|
+
* The number of items in the container. A drop on the container itself
|
|
59
|
+
* (not on one of its items) puts the element after the last item.
|
|
60
|
+
*/
|
|
61
|
+
itemCount: number;
|
|
62
|
+
/** Gets `ref` for the element that holds the items. */
|
|
63
|
+
children: (api: {
|
|
64
|
+
ref: RefCallback;
|
|
65
|
+
isOver: boolean;
|
|
66
|
+
}) => ReactNode;
|
|
67
|
+
};
|
|
68
|
+
export declare function SortableContainer({ id, itemCount, children, }: SortableContainerProps): React.JSX.Element;
|
|
69
|
+
export type SortableItemApi = {
|
|
70
|
+
ref: RefCallback;
|
|
71
|
+
handleRef: RefCallback;
|
|
72
|
+
isDragging: boolean;
|
|
73
|
+
closestEdge: Edge | null;
|
|
74
|
+
dropIndicator: ReactNode;
|
|
75
|
+
};
|
|
76
|
+
export type SortableItemProps = {
|
|
77
|
+
/** A name that stays the same when the item moves. It is `draggableId` in the drop result. */
|
|
78
|
+
id: string;
|
|
79
|
+
/** The position of the item in its list. */
|
|
80
|
+
index: number;
|
|
81
|
+
/**
|
|
82
|
+
* Stops the user from dragging this item.
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
disabled?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* When `true`, the user drags the item only from its handle: give
|
|
88
|
+
* `handleRef` to the grip.
|
|
89
|
+
* @default false
|
|
90
|
+
*/
|
|
91
|
+
handle?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The picture that the browser shows during the drag. Use `none` when the
|
|
94
|
+
* element itself shows the drag.
|
|
95
|
+
* @default 'element'
|
|
96
|
+
*/
|
|
97
|
+
preview?: DragPreview;
|
|
98
|
+
/** Gets the `ref` of the item and the drop line, and renders the item. */
|
|
99
|
+
children: (api: SortableItemApi) => ReactNode;
|
|
100
|
+
};
|
|
101
|
+
export declare function SortableItem({ id, index, disabled, handle, preview, children, }: SortableItemProps): React.JSX.Element;
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import DropIndicator_default from "./DropIndicator.js";
|
|
2
|
+
import { getGapTo, isAfterEdge } from "./getGapTo.js";
|
|
3
|
+
import { getDragData } from "./types.js";
|
|
4
|
+
import { useDraggable } from "./useDraggable.js";
|
|
5
|
+
import { useDragMonitor } from "./useDragMonitor.js";
|
|
6
|
+
import { useDropTarget } from "./useDropTarget.js";
|
|
7
|
+
import { createContext, useCallback, useContext, useMemo, useRef, useState } from "react";
|
|
8
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
9
|
+
import { attachClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge/attach-closest-edge";
|
|
10
|
+
import { extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge/extract-closest-edge";
|
|
11
|
+
import { getReorderDestinationIndex } from "@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index";
|
|
12
|
+
//#region ../ui/src/lists/dnd/SortableList.tsx
|
|
13
|
+
var ROOT_CONTAINER_ID = "root";
|
|
14
|
+
var ListContext = createContext(null);
|
|
15
|
+
function useListContext(componentName) {
|
|
16
|
+
const context = useContext(ListContext);
|
|
17
|
+
if (!context) throw new Error(`<${componentName}> must be in a <SortableList>`);
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
var instanceCounter = 0;
|
|
21
|
+
var ALLOWED_EDGES = {
|
|
22
|
+
vertical: ["top", "bottom"],
|
|
23
|
+
horizontal: ["left", "right"]
|
|
24
|
+
};
|
|
25
|
+
function SortableList({ children, axis = "vertical", disabled = false, onDrop, canDropInto }) {
|
|
26
|
+
const instanceId = useMemo(() => `sortable-list-${instanceCounter++}`, []);
|
|
27
|
+
const [active, setActive] = useState(null);
|
|
28
|
+
const latest = useRef({
|
|
29
|
+
onDrop,
|
|
30
|
+
canDropInto
|
|
31
|
+
});
|
|
32
|
+
latest.current = {
|
|
33
|
+
onDrop,
|
|
34
|
+
canDropInto
|
|
35
|
+
};
|
|
36
|
+
useDragMonitor({
|
|
37
|
+
canMonitor: (source) => getDragData(source).kind === "sortable-item" && getDragData(source).instanceId === instanceId,
|
|
38
|
+
onDragStart: ({ source }) => {
|
|
39
|
+
setActive(getDragData(source));
|
|
40
|
+
},
|
|
41
|
+
onDrop: ({ source, location }) => {
|
|
42
|
+
setActive(null);
|
|
43
|
+
const sourceData = getDragData(source);
|
|
44
|
+
const target = location.current.dropTargets.find((dropTarget) => dropTarget.data.instanceId === instanceId);
|
|
45
|
+
if (!target) return;
|
|
46
|
+
const targetData = target.data;
|
|
47
|
+
const from = {
|
|
48
|
+
index: sourceData.index,
|
|
49
|
+
containerId: sourceData.containerId
|
|
50
|
+
};
|
|
51
|
+
let to;
|
|
52
|
+
if (targetData.role === "container") {
|
|
53
|
+
if (targetData.containerId === from.containerId) return;
|
|
54
|
+
to = {
|
|
55
|
+
index: targetData.itemCount ?? 0,
|
|
56
|
+
containerId: targetData.containerId
|
|
57
|
+
};
|
|
58
|
+
} else {
|
|
59
|
+
const edge = extractClosestEdge(target.data);
|
|
60
|
+
const indexOfTarget = targetData.index ?? 0;
|
|
61
|
+
if (targetData.containerId === from.containerId) {
|
|
62
|
+
const index = getReorderDestinationIndex({
|
|
63
|
+
startIndex: from.index,
|
|
64
|
+
indexOfTarget,
|
|
65
|
+
closestEdgeOfTarget: edge,
|
|
66
|
+
axis
|
|
67
|
+
});
|
|
68
|
+
if (index === from.index) return;
|
|
69
|
+
to = {
|
|
70
|
+
index,
|
|
71
|
+
containerId: from.containerId
|
|
72
|
+
};
|
|
73
|
+
} else to = {
|
|
74
|
+
index: indexOfTarget + (isAfterEdge(edge) ? 1 : 0),
|
|
75
|
+
containerId: targetData.containerId
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
latest.current.onDrop({
|
|
79
|
+
draggableId: sourceData.id,
|
|
80
|
+
source: from,
|
|
81
|
+
destination: to
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const stableCanDropInto = useCallback((source, containerId) => latest.current.canDropInto?.(source, containerId) ?? true, []);
|
|
86
|
+
const value = useMemo(() => ({
|
|
87
|
+
instanceId,
|
|
88
|
+
axis,
|
|
89
|
+
disabled,
|
|
90
|
+
active,
|
|
91
|
+
canDropInto: stableCanDropInto
|
|
92
|
+
}), [
|
|
93
|
+
instanceId,
|
|
94
|
+
axis,
|
|
95
|
+
disabled,
|
|
96
|
+
active,
|
|
97
|
+
stableCanDropInto
|
|
98
|
+
]);
|
|
99
|
+
return /* @__PURE__ */ jsx(ListContext.Provider, {
|
|
100
|
+
value,
|
|
101
|
+
children
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
function useSortableListState() {
|
|
105
|
+
const { active, disabled } = useListContext("useSortableListState");
|
|
106
|
+
return {
|
|
107
|
+
isDragging: active !== null,
|
|
108
|
+
disabled
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
var ContainerContext = createContext(ROOT_CONTAINER_ID);
|
|
112
|
+
function SortableContainer({ id, itemCount, children }) {
|
|
113
|
+
const { instanceId, canDropInto, active } = useListContext("SortableContainer");
|
|
114
|
+
const canDrop = useCallback((source) => {
|
|
115
|
+
const data = getDragData(source);
|
|
116
|
+
return data.kind === "sortable-item" && data.instanceId === instanceId && canDropInto(data, id);
|
|
117
|
+
}, [
|
|
118
|
+
instanceId,
|
|
119
|
+
canDropInto,
|
|
120
|
+
id
|
|
121
|
+
]);
|
|
122
|
+
const getData = useCallback(() => ({
|
|
123
|
+
instanceId,
|
|
124
|
+
role: "container",
|
|
125
|
+
containerId: id,
|
|
126
|
+
itemCount
|
|
127
|
+
}), [
|
|
128
|
+
instanceId,
|
|
129
|
+
id,
|
|
130
|
+
itemCount
|
|
131
|
+
]);
|
|
132
|
+
const { ref, isOver } = useDropTarget({
|
|
133
|
+
canDrop,
|
|
134
|
+
getData
|
|
135
|
+
});
|
|
136
|
+
const isOverAndCanDrop = isOver && !!active && canDropInto(active, id);
|
|
137
|
+
return /* @__PURE__ */ jsx(ContainerContext.Provider, {
|
|
138
|
+
value: id,
|
|
139
|
+
children: children({
|
|
140
|
+
ref,
|
|
141
|
+
isOver: isOverAndCanDrop
|
|
142
|
+
})
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
function SortableItem({ id, index, disabled = false, handle = false, preview, children }) {
|
|
146
|
+
const { instanceId, axis, disabled: listDisabled, canDropInto } = useListContext("SortableItem");
|
|
147
|
+
const containerId = useContext(ContainerContext);
|
|
148
|
+
const [target, setTarget] = useState(null);
|
|
149
|
+
const getData = useCallback(() => ({
|
|
150
|
+
kind: "sortable-item",
|
|
151
|
+
instanceId,
|
|
152
|
+
id,
|
|
153
|
+
index,
|
|
154
|
+
containerId
|
|
155
|
+
}), [
|
|
156
|
+
instanceId,
|
|
157
|
+
id,
|
|
158
|
+
index,
|
|
159
|
+
containerId
|
|
160
|
+
]);
|
|
161
|
+
const { ref: draggableRef, handleRef, isDragging } = useDraggable({
|
|
162
|
+
getData,
|
|
163
|
+
disabled: disabled || listDisabled,
|
|
164
|
+
handle,
|
|
165
|
+
preview
|
|
166
|
+
});
|
|
167
|
+
const canDrop = useCallback((source) => {
|
|
168
|
+
const data = getDragData(source);
|
|
169
|
+
return data.kind === "sortable-item" && data.instanceId === instanceId && canDropInto(data, containerId);
|
|
170
|
+
}, [
|
|
171
|
+
instanceId,
|
|
172
|
+
canDropInto,
|
|
173
|
+
containerId
|
|
174
|
+
]);
|
|
175
|
+
const getTargetData = useCallback(({ input, element }) => attachClosestEdge({
|
|
176
|
+
instanceId,
|
|
177
|
+
role: "item",
|
|
178
|
+
id,
|
|
179
|
+
index,
|
|
180
|
+
containerId
|
|
181
|
+
}, {
|
|
182
|
+
input,
|
|
183
|
+
element,
|
|
184
|
+
allowedEdges: ALLOWED_EDGES[axis]
|
|
185
|
+
}), [
|
|
186
|
+
instanceId,
|
|
187
|
+
id,
|
|
188
|
+
index,
|
|
189
|
+
containerId,
|
|
190
|
+
axis
|
|
191
|
+
]);
|
|
192
|
+
const updateEdge = useCallback(({ self, source, location }) => {
|
|
193
|
+
if (location.current.dropTargets.find((dropTarget) => dropTarget.data.instanceId === instanceId)?.element !== self.element) {
|
|
194
|
+
setTarget(null);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const data = getDragData(source);
|
|
198
|
+
const edge = extractClosestEdge(self.data);
|
|
199
|
+
const next = data.containerId === containerId && (data.index === index || data.index === index - 1 && !isAfterEdge(edge) || data.index === index + 1 && isAfterEdge(edge)) || !edge ? null : {
|
|
200
|
+
edge,
|
|
201
|
+
gap: getGapTo(self.element, isAfterEdge(edge) ? self.element.nextElementSibling : self.element.previousElementSibling, edge)
|
|
202
|
+
};
|
|
203
|
+
setTarget((current) => current?.edge === next?.edge && current?.gap === next?.gap ? current : next);
|
|
204
|
+
}, [
|
|
205
|
+
instanceId,
|
|
206
|
+
containerId,
|
|
207
|
+
index,
|
|
208
|
+
axis
|
|
209
|
+
]);
|
|
210
|
+
const clearEdge = useCallback(() => setTarget(null), []);
|
|
211
|
+
const { ref: dropTargetRef } = useDropTarget({
|
|
212
|
+
canDrop,
|
|
213
|
+
getData: getTargetData,
|
|
214
|
+
disabled: listDisabled,
|
|
215
|
+
sticky: true,
|
|
216
|
+
onDragEnter: updateEdge,
|
|
217
|
+
onDrag: updateEdge,
|
|
218
|
+
onDragLeave: clearEdge,
|
|
219
|
+
onDrop: clearEdge
|
|
220
|
+
});
|
|
221
|
+
const ref = useCallback((node) => {
|
|
222
|
+
draggableRef(node);
|
|
223
|
+
dropTargetRef(node);
|
|
224
|
+
}, [draggableRef, dropTargetRef]);
|
|
225
|
+
const dropIndicator = target ? /* @__PURE__ */ jsx(DropIndicator_default, {
|
|
226
|
+
edge: target.edge,
|
|
227
|
+
gap: `${target.gap}px`
|
|
228
|
+
}) : null;
|
|
229
|
+
return /* @__PURE__ */ jsx(Fragment, { children: children({
|
|
230
|
+
ref,
|
|
231
|
+
handleRef,
|
|
232
|
+
isDragging,
|
|
233
|
+
closestEdge: target?.edge ?? null,
|
|
234
|
+
dropIndicator
|
|
235
|
+
}) });
|
|
236
|
+
}
|
|
237
|
+
//#endregion
|
|
238
|
+
export { ROOT_CONTAINER_ID, SortableContainer, SortableItem, SortableList, useSortableListState };
|