@cratis/components 3.3.4 → 3.5.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 +322 -197
- package/dist/esm/Canvas/Canvas.d.ts +64 -0
- package/dist/esm/Canvas/Canvas.d.ts.map +1 -0
- package/dist/esm/Canvas/Canvas.js +767 -0
- package/dist/esm/Canvas/Canvas.js.map +1 -0
- package/dist/esm/Canvas/CanvasControls.d.ts +32 -0
- package/dist/esm/Canvas/CanvasControls.d.ts.map +1 -0
- package/dist/esm/Canvas/CanvasControls.js +34 -0
- package/dist/esm/Canvas/CanvasControls.js.map +1 -0
- package/dist/esm/Canvas/CanvasItem.d.ts +10 -0
- package/dist/esm/Canvas/CanvasItem.d.ts.map +1 -0
- package/dist/esm/Canvas/CanvasItem.js +51 -0
- package/dist/esm/Canvas/CanvasItem.js.map +1 -0
- package/dist/esm/Canvas/CanvasMinimap.d.ts +25 -0
- package/dist/esm/Canvas/CanvasMinimap.d.ts.map +1 -0
- package/dist/esm/Canvas/CanvasMinimap.js +102 -0
- package/dist/esm/Canvas/CanvasMinimap.js.map +1 -0
- package/dist/esm/Canvas/CanvasOverlay.d.ts +6 -0
- package/dist/esm/Canvas/CanvasOverlay.d.ts.map +1 -0
- package/dist/esm/Canvas/CanvasOverlay.js +8 -0
- package/dist/esm/Canvas/CanvasOverlay.js.map +1 -0
- package/dist/esm/Canvas/canvasGesture.d.ts +8 -0
- package/dist/esm/Canvas/canvasGesture.d.ts.map +1 -0
- package/dist/esm/Canvas/canvasGesture.js +32 -0
- package/dist/esm/Canvas/canvasGesture.js.map +1 -0
- package/dist/esm/Canvas/canvasTransformActivity.d.ts +7 -0
- package/dist/esm/Canvas/canvasTransformActivity.d.ts.map +1 -0
- package/dist/esm/Canvas/canvasTransformActivity.js +22 -0
- package/dist/esm/Canvas/canvasTransformActivity.js.map +1 -0
- package/dist/esm/Canvas/glassAttributes.d.ts +4 -0
- package/dist/esm/Canvas/glassAttributes.d.ts.map +1 -0
- package/dist/esm/Canvas/glassAttributes.js +25 -0
- package/dist/esm/Canvas/glassAttributes.js.map +1 -0
- package/dist/esm/Canvas/index.d.ts +18 -0
- package/dist/esm/Canvas/index.d.ts.map +1 -0
- package/dist/esm/Canvas/index.js +38 -0
- package/dist/esm/Canvas/index.js.map +1 -0
- package/dist/esm/Canvas/isBackgroundPointerTarget.d.ts +2 -0
- package/dist/esm/Canvas/isBackgroundPointerTarget.d.ts.map +1 -0
- package/dist/esm/Canvas/isBackgroundPointerTarget.js +17 -0
- package/dist/esm/Canvas/isBackgroundPointerTarget.js.map +1 -0
- package/dist/esm/Canvas/isWithinScrollableContent.d.ts +11 -0
- package/dist/esm/Canvas/isWithinScrollableContent.d.ts.map +1 -0
- package/dist/esm/Canvas/isWithinScrollableContent.js +38 -0
- package/dist/esm/Canvas/isWithinScrollableContent.js.map +1 -0
- package/dist/esm/Canvas/panMomentum.d.ts +13 -0
- package/dist/esm/Canvas/panMomentum.d.ts.map +1 -0
- package/dist/esm/Canvas/panMomentum.js +41 -0
- package/dist/esm/Canvas/panMomentum.js.map +1 -0
- package/dist/esm/Canvas/pinchGesture.d.ts +16 -0
- package/dist/esm/Canvas/pinchGesture.d.ts.map +1 -0
- package/dist/esm/Canvas/pinchGesture.js +30 -0
- package/dist/esm/Canvas/pinchGesture.js.map +1 -0
- package/dist/esm/Canvas/selfSuspendingFrameLoop.d.ts +10 -0
- package/dist/esm/Canvas/selfSuspendingFrameLoop.d.ts.map +1 -0
- package/dist/esm/Canvas/selfSuspendingFrameLoop.js +33 -0
- package/dist/esm/Canvas/selfSuspendingFrameLoop.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/AnchoredOverlay.d.ts +13 -0
- package/dist/esm/Canvas/shapes/ChatBubble/AnchoredOverlay.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/AnchoredOverlay.js +61 -0
- package/dist/esm/Canvas/shapes/ChatBubble/AnchoredOverlay.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/PersonAvatarCircle.d.ts +20 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/PersonAvatarCircle.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/PersonAvatarCircle.js +27 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/PersonAvatarCircle.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/getAvatarColor.d.ts +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/getAvatarColor.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/getAvatarColor.js +20 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/getAvatarColor.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/getInitials.d.ts +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/getInitials.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/getInitials.js +11 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/getInitials.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/index.d.ts +5 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/index.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/index.js +4 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Avatar/index.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Chat.d.ts +41 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Chat.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Chat.js +76 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Chat.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatAuthorKind.d.ts +5 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatAuthorKind.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatAuthorKind.js +14 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatAuthorKind.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatBubble.d.ts +18 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatBubble.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatBubble.js +89 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatBubble.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatComposer.d.ts +23 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatComposer.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatComposer.js +107 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatComposer.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessage.d.ts +17 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessage.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessage.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessage.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageBubble.d.ts +25 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageBubble.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageBubble.js +31 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageBubble.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageReaction.d.ts +6 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageReaction.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageReaction.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageReaction.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageReactionUser.d.ts +7 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageReactionUser.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageReactionUser.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatMessageReactionUser.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatOwnReaction.d.ts +6 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatOwnReaction.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatOwnReaction.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatOwnReaction.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatTypingAuthor.d.ts +8 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatTypingAuthor.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatTypingAuthor.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatTypingAuthor.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatVariant.d.ts +5 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatVariant.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatVariant.js +15 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ChatVariant.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiCategory.d.ts +6 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiCategory.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiCategory.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiCategory.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiCategoryKey.d.ts +12 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiCategoryKey.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiCategoryKey.js +18 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiCategoryKey.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiMemory.d.ts +5 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiMemory.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiMemory.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiMemory.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiPicker.d.ts +14 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiPicker.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiPicker.js +51 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/EmojiPicker.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/emojiCatalog.d.ts +3 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/emojiCatalog.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/emojiCatalog.js +155 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/emojiCatalog.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/index.d.ts +7 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/index.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/index.js +7 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/index.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/recentEmojis.d.ts +6 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/recentEmojis.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/recentEmojis.js +59 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Emoji/recentEmojis.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/FailedReply.d.ts +23 -0
- package/dist/esm/Canvas/shapes/ChatBubble/FailedReply.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/FailedReply.js +28 -0
- package/dist/esm/Canvas/shapes/ChatBubble/FailedReply.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionCandidate.d.ts +9 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionCandidate.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionCandidate.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionCandidate.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionQuery.d.ts +5 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionQuery.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionQuery.js +2 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionQuery.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionSuggestions.d.ts +11 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionSuggestions.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionSuggestions.js +14 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/MentionSuggestions.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/activeMentionQuery.d.ts +3 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/activeMentionQuery.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/activeMentionQuery.js +34 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/activeMentionQuery.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/applyMention.d.ts +7 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/applyMention.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/applyMention.js +23 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/applyMention.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/index.d.ts +7 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/index.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/index.js +7 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/index.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/matchCandidates.d.ts +3 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/matchCandidates.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/matchCandidates.js +24 -0
- package/dist/esm/Canvas/shapes/ChatBubble/Mentions/matchCandidates.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/MessageReactions.d.ts +6 -0
- package/dist/esm/Canvas/shapes/ChatBubble/MessageReactions.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/MessageReactions.js +28 -0
- package/dist/esm/Canvas/shapes/ChatBubble/MessageReactions.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ReactionPicker.d.ts +20 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ReactionPicker.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ReactionPicker.js +50 -0
- package/dist/esm/Canvas/shapes/ChatBubble/ReactionPicker.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/TypingIndicator.d.ts +9 -0
- package/dist/esm/Canvas/shapes/ChatBubble/TypingIndicator.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/TypingIndicator.js +18 -0
- package/dist/esm/Canvas/shapes/ChatBubble/TypingIndicator.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/findOwnReaction.d.ts +5 -0
- package/dist/esm/Canvas/shapes/ChatBubble/findOwnReaction.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/findOwnReaction.js +19 -0
- package/dist/esm/Canvas/shapes/ChatBubble/findOwnReaction.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/index.d.ts +31 -0
- package/dist/esm/Canvas/shapes/ChatBubble/index.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/index.js +17 -0
- package/dist/esm/Canvas/shapes/ChatBubble/index.js.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/reactionsExcludingUser.d.ts +4 -0
- package/dist/esm/Canvas/shapes/ChatBubble/reactionsExcludingUser.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/ChatBubble/reactionsExcludingUser.js +16 -0
- package/dist/esm/Canvas/shapes/ChatBubble/reactionsExcludingUser.js.map +1 -0
- package/dist/esm/Canvas/shapes/Note/Note.d.ts +22 -0
- package/dist/esm/Canvas/shapes/Note/Note.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/Note/Note.js +237 -0
- package/dist/esm/Canvas/shapes/Note/Note.js.map +1 -0
- package/dist/esm/Canvas/shapes/Note/index.d.ts +3 -0
- package/dist/esm/Canvas/shapes/Note/index.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/Note/index.js +2 -0
- package/dist/esm/Canvas/shapes/Note/index.js.map +1 -0
- package/dist/esm/Canvas/shapes/Note/noteFont.d.ts +2 -0
- package/dist/esm/Canvas/shapes/Note/noteFont.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/Note/noteFont.js +26 -0
- package/dist/esm/Canvas/shapes/Note/noteFont.js.map +1 -0
- package/dist/esm/Canvas/shapes/Region/Region.d.ts +22 -0
- package/dist/esm/Canvas/shapes/Region/Region.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/Region/Region.js +150 -0
- package/dist/esm/Canvas/shapes/Region/Region.js.map +1 -0
- package/dist/esm/Canvas/shapes/Region/index.d.ts +3 -0
- package/dist/esm/Canvas/shapes/Region/index.d.ts.map +1 -0
- package/dist/esm/Canvas/shapes/Region/index.js +2 -0
- package/dist/esm/Canvas/shapes/Region/index.js.map +1 -0
- package/dist/esm/Canvas/useDragSelectionGuard.d.ts +2 -0
- package/dist/esm/Canvas/useDragSelectionGuard.d.ts.map +1 -0
- package/dist/esm/Canvas/useDragSelectionGuard.js +59 -0
- package/dist/esm/Canvas/useDragSelectionGuard.js.map +1 -0
- package/dist/esm/Canvas/zoomMechanism.d.ts +4 -0
- package/dist/esm/Canvas/zoomMechanism.d.ts.map +1 -0
- package/dist/esm/Canvas/zoomMechanism.js +58 -0
- package/dist/esm/Canvas/zoomMechanism.js.map +1 -0
- package/dist/esm/CommandDialog/CommandDialog.d.ts +3 -6
- package/dist/esm/CommandDialog/CommandDialog.d.ts.map +1 -1
- package/dist/esm/CommandDialog/CommandDialog.js +3 -2
- package/dist/esm/CommandDialog/CommandDialog.js.map +1 -1
- package/dist/esm/CommandDialog/CommandStepper.d.ts.map +1 -1
- package/dist/esm/CommandDialog/CommandStepper.js +3 -2
- package/dist/esm/CommandDialog/CommandStepper.js.map +1 -1
- package/dist/esm/CommandForm/commandFormMarkers.d.ts +12 -0
- package/dist/esm/CommandForm/commandFormMarkers.d.ts.map +1 -0
- package/dist/esm/CommandForm/commandFormMarkers.js +69 -0
- package/dist/esm/CommandForm/commandFormMarkers.js.map +1 -0
- package/dist/esm/CommandForm/fields/CalendarField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/CalendarField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/CheckboxField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/CheckboxField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/ChipsField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/ChipsField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/ColorPickerField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/ColorPickerField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/DropdownField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/DropdownField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/InputTextField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/InputTextField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/MultiSelectField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/MultiSelectField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/NumberField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/NumberField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/PasswordField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/PasswordField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/RadioButtonField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/RadioButtonField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/RadioGroupField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/RadioGroupField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/RatingField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/RatingField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/SliderField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/SliderField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/TextAreaField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/TextAreaField.d.ts.map +1 -1
- package/dist/esm/CommandForm/fields/ToggleSwitchField.d.ts +1 -1
- package/dist/esm/CommandForm/fields/ToggleSwitchField.d.ts.map +1 -1
- package/dist/esm/CommandForm/index.d.ts +1 -0
- package/dist/esm/CommandForm/index.d.ts.map +1 -1
- package/dist/esm/CommandForm/index.js +1 -0
- package/dist/esm/CommandForm/index.js.map +1 -1
- package/dist/esm/Common/CratisComponentsProvider.d.ts.map +1 -1
- package/dist/esm/Common/CratisComponentsProvider.js +6 -3
- package/dist/esm/Common/CratisComponentsProvider.js.map +1 -1
- package/dist/esm/Common/DatePickerInput.d.ts +11 -4
- package/dist/esm/Common/DatePickerInput.d.ts.map +1 -1
- package/dist/esm/Common/DatePickerInput.js +18 -2
- package/dist/esm/Common/DatePickerInput.js.map +1 -1
- package/dist/esm/Common/ErrorBoundary.d.ts +1 -1
- package/dist/esm/Compatibility/PrimeReact11PassThroughComponent.d.ts +3 -0
- package/dist/esm/Compatibility/PrimeReact11PassThroughComponent.d.ts.map +1 -0
- package/dist/esm/Compatibility/PrimeReact11PassThroughComponent.js +2 -0
- package/dist/esm/Compatibility/PrimeReact11PassThroughComponent.js.map +1 -0
- package/dist/esm/Compatibility/assertPrimeReact11PassThroughCompatibility.d.ts +3 -0
- package/dist/esm/Compatibility/assertPrimeReact11PassThroughCompatibility.d.ts.map +1 -0
- package/dist/esm/Compatibility/assertPrimeReact11PassThroughCompatibility.js +49 -0
- package/dist/esm/Compatibility/assertPrimeReact11PassThroughCompatibility.js.map +1 -0
- package/dist/esm/Compatibility/components3PrimeReact11PassThroughContract.d.ts +369 -0
- package/dist/esm/Compatibility/components3PrimeReact11PassThroughContract.d.ts.map +1 -0
- package/dist/esm/Compatibility/components3PrimeReact11PassThroughContract.js +271 -0
- package/dist/esm/Compatibility/components3PrimeReact11PassThroughContract.js.map +1 -0
- package/dist/esm/Compatibility/index.d.ts +5 -0
- package/dist/esm/Compatibility/index.d.ts.map +1 -0
- package/dist/esm/Compatibility/index.js +7 -0
- package/dist/esm/Compatibility/index.js.map +1 -0
- package/dist/esm/Compatibility/primeReact11PassThroughSentinelPreset.d.ts +8 -0
- package/dist/esm/Compatibility/primeReact11PassThroughSentinelPreset.d.ts.map +1 -0
- package/dist/esm/Compatibility/primeReact11PassThroughSentinelPreset.js +48 -0
- package/dist/esm/Compatibility/primeReact11PassThroughSentinelPreset.js.map +1 -0
- package/dist/esm/DataPage/DataPage.d.ts +4 -4
- package/dist/esm/DataPage/DataPage.d.ts.map +1 -1
- package/dist/esm/DataPage/DataPage.js +6 -10
- package/dist/esm/DataPage/DataPage.js.map +1 -1
- package/dist/esm/DataTables/Column.d.ts +3 -1
- package/dist/esm/DataTables/Column.d.ts.map +1 -1
- package/dist/esm/DataTables/Column.js.map +1 -1
- package/dist/esm/DataTables/ColumnFilterMenu.d.ts +22 -2
- package/dist/esm/DataTables/ColumnFilterMenu.d.ts.map +1 -1
- package/dist/esm/DataTables/ColumnFilterMenu.js +50 -13
- package/dist/esm/DataTables/ColumnFilterMenu.js.map +1 -1
- package/dist/esm/DataTables/DataTableCore.d.ts.map +1 -1
- package/dist/esm/DataTables/DataTableCore.js +22 -3
- package/dist/esm/DataTables/DataTableCore.js.map +1 -1
- package/dist/esm/DataTables/DataTableFilterMatcherRegistry.d.ts +14 -0
- package/dist/esm/DataTables/DataTableFilterMatcherRegistry.d.ts.map +1 -0
- package/dist/esm/DataTables/DataTableFilterMatcherRegistry.js +67 -0
- package/dist/esm/DataTables/DataTableFilterMatcherRegistry.js.map +1 -0
- package/dist/esm/DataTables/DataTableFilterMeta.d.ts +26 -1
- package/dist/esm/DataTables/DataTableFilterMeta.d.ts.map +1 -1
- package/dist/esm/DataTables/DataTableFilterMeta.js +24 -2
- package/dist/esm/DataTables/DataTableFilterMeta.js.map +1 -1
- package/dist/esm/DataTables/DataTableForObservableQuery.d.ts +3 -3
- package/dist/esm/DataTables/DataTableForObservableQuery.d.ts.map +1 -1
- package/dist/esm/DataTables/DataTableForObservableQuery.js +9 -3
- package/dist/esm/DataTables/DataTableForObservableQuery.js.map +1 -1
- package/dist/esm/DataTables/DataTableForQuery.d.ts +3 -3
- package/dist/esm/DataTables/DataTableForQuery.d.ts.map +1 -1
- package/dist/esm/DataTables/DataTableForQuery.js +8 -2
- package/dist/esm/DataTables/DataTableForQuery.js.map +1 -1
- package/dist/esm/DataTables/TablePaginator.d.ts +1 -1
- package/dist/esm/DataTables/TablePaginator.d.ts.map +1 -1
- package/dist/esm/DataTables/TablePaginator.js +13 -4
- package/dist/esm/DataTables/TablePaginator.js.map +1 -1
- package/dist/esm/DataTables/index.d.ts +1 -0
- package/dist/esm/DataTables/index.d.ts.map +1 -1
- package/dist/esm/DataTables/index.js +3 -1
- package/dist/esm/DataTables/index.js.map +1 -1
- package/dist/esm/Dialogs/Dialog.d.ts +2 -2
- package/dist/esm/Dialogs/Dialog.d.ts.map +1 -1
- package/dist/esm/Dialogs/Dialog.js +16 -18
- package/dist/esm/Dialogs/Dialog.js.map +1 -1
- package/dist/esm/Display/Message.d.ts +2 -1
- package/dist/esm/Display/Message.d.ts.map +1 -1
- package/dist/esm/Display/Message.js +14 -2
- package/dist/esm/Display/Message.js.map +1 -1
- package/dist/esm/Dropdown/Dropdown.d.ts +4 -2
- package/dist/esm/Dropdown/Dropdown.d.ts.map +1 -1
- package/dist/esm/Dropdown/Dropdown.js +17 -2
- package/dist/esm/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/Filter/FilterPanel.d.ts.map +1 -1
- package/dist/esm/Filter/FilterPanel.js +1 -1
- package/dist/esm/Filter/FilterPanel.js.map +1 -1
- package/dist/esm/Filter/RangeHistogramFilter.d.ts +4 -3
- package/dist/esm/Filter/RangeHistogramFilter.d.ts.map +1 -1
- package/dist/esm/Filter/RangeHistogramFilter.js +4 -23
- package/dist/esm/Filter/RangeHistogramFilter.js.map +1 -1
- package/dist/esm/Filter/index.d.ts +3 -2
- package/dist/esm/Filter/index.d.ts.map +1 -1
- package/dist/esm/Filter/index.js +1 -1
- package/dist/esm/Filter/types.d.ts +7 -1
- package/dist/esm/Filter/types.d.ts.map +1 -1
- package/dist/esm/Filter/utils.d.ts +5 -1
- package/dist/esm/Filter/utils.d.ts.map +1 -1
- package/dist/esm/Filter/utils.js +33 -1
- package/dist/esm/Filter/utils.js.map +1 -1
- package/dist/esm/Notifications/Toaster.d.ts +8 -1
- package/dist/esm/Notifications/Toaster.d.ts.map +1 -1
- package/dist/esm/Notifications/Toaster.js +16 -10
- package/dist/esm/Notifications/Toaster.js.map +1 -1
- package/dist/esm/Notifications/index.js +1 -1
- package/dist/esm/Notifications/toast.d.ts +52 -2
- package/dist/esm/Notifications/toast.d.ts.map +1 -1
- package/dist/esm/Notifications/toast.js +100 -2
- package/dist/esm/Notifications/toast.js.map +1 -1
- package/dist/esm/Notifications/toastCommandResult.js +2 -2
- package/dist/esm/Notifications/toastCommandResult.js.map +1 -1
- package/dist/esm/PatrickHand-latin-ext.woff2 +0 -0
- package/dist/esm/PatrickHand-latin.woff2 +0 -0
- package/dist/esm/PatrickHand-vietnamese.woff2 +0 -0
- package/dist/esm/Styled/CratisPreset.d.ts +2 -0
- package/dist/esm/Styled/CratisPreset.d.ts.map +1 -0
- package/dist/esm/Styled/CratisPreset.js +80 -0
- package/dist/esm/Styled/CratisPreset.js.map +1 -0
- package/dist/esm/Styled/index.d.ts +4 -0
- package/dist/esm/Styled/index.d.ts.map +1 -0
- package/dist/esm/Styled/index.js +4 -0
- package/dist/esm/Styled/index.js.map +1 -0
- package/dist/esm/Styled/primeReactStyles.d.ts +3 -0
- package/dist/esm/Styled/primeReactStyles.d.ts.map +1 -0
- package/dist/esm/Styled/primeReactStyles.js +202 -0
- package/dist/esm/Styled/primeReactStyles.js.map +1 -0
- package/dist/esm/Styled/styledMode.d.ts +12 -0
- package/dist/esm/Styled/styledMode.d.ts.map +1 -0
- package/dist/esm/Styled/styledMode.js +68 -0
- package/dist/esm/Styled/styledMode.js.map +1 -0
- package/dist/esm/index.d.ts +4 -1
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +42 -35
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/primereact-v10-palette.css +242 -0
- package/dist/esm/styles.css +1287 -5
- package/dist/esm/theme.css +30 -4
- package/dist/esm/tokens.css +18 -11
- package/package.json +31 -7
package/README.md
CHANGED
|
@@ -25,9 +25,9 @@ there is no `require()` entry.
|
|
|
25
25
|
## Installation
|
|
26
26
|
|
|
27
27
|
```bash
|
|
28
|
-
npm install @cratis/components primereact @primereact/core @primereact/headless primeicons
|
|
28
|
+
npm install @cratis/components primereact @primereact/core @primereact/headless @primereact/hooks primeicons
|
|
29
29
|
# or
|
|
30
|
-
yarn add @cratis/components primereact @primereact/core @primereact/headless primeicons
|
|
30
|
+
yarn add @cratis/components primereact @primereact/core @primereact/headless @primereact/hooks primeicons
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
**PrimeReact is a peer dependency** as of 3.0.0. You install it; the library uses
|
|
@@ -39,18 +39,18 @@ Nothing errors; overlays just stack wrongly and `pt` / `unstyled` silently fail
|
|
|
39
39
|
apply. If your app carries a `resolutions` / `overrides` pin to collapse PrimeReact
|
|
40
40
|
into one copy, you can now delete it.
|
|
41
41
|
|
|
42
|
-
`primereact` pins `@primereact/core` and `@primereact/
|
|
42
|
+
`primereact` pins `@primereact/core`, `@primereact/headless` and `@primereact/hooks` to its own exact
|
|
43
43
|
version, so one `primereact@11.x` install gives you matching copies of all three;
|
|
44
44
|
declaring them is what makes a strict installer (pnpm, Yarn PnP) resolve them for the
|
|
45
45
|
library too. `@primereact/types` is an **optional** peer — needed only if your own
|
|
46
46
|
code imports the prop types the wrappers re-export.
|
|
47
47
|
|
|
48
48
|
The other **peer dependencies** you provide are `react` / `react-dom` (**19+**), the
|
|
49
|
-
`@cratis/arc*` packages (`>=20.3.1 <
|
|
49
|
+
`@cratis/arc*` packages (`>=20.3.1 <23` — Arc 20, 21 and 22 work), `reflect-metadata`
|
|
50
50
|
and `tsyringe`; you typically already have these in a Cratis app. `pixi.js`,
|
|
51
51
|
`framer-motion`, `allotment` and `react-icons` remain regular dependencies and are
|
|
52
|
-
installed for you.
|
|
53
|
-
|
|
52
|
+
installed for you. `@primereact/styles` and `@primeuix/themes` are **optional** peers,
|
|
53
|
+
needed only for PrimeReact's styled mode (see [Styling](#styling)).
|
|
54
54
|
|
|
55
55
|
### Stylesheets
|
|
56
56
|
|
|
@@ -58,9 +58,9 @@ Component CSS is no longer imported by the JavaScript — import it once in your
|
|
|
58
58
|
entry point, in this order:
|
|
59
59
|
|
|
60
60
|
```ts
|
|
61
|
-
import '@cratis/components/tokens';
|
|
62
|
-
import '@cratis/components/styles';
|
|
63
|
-
import '@cratis/components/theme';
|
|
61
|
+
import '@cratis/components/tokens'; // the --cratis-* token layer
|
|
62
|
+
import '@cratis/components/styles'; // every component stylesheet, in one file
|
|
63
|
+
import '@cratis/components/theme'; // optional — the Cratis baseline look (MIT CSS)
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
`./styles` also vendors `allotment/dist/style.css`, which `DataPage` needs for its
|
|
@@ -72,23 +72,24 @@ split view, so you do not have to import that yourself.
|
|
|
72
72
|
was; PrimeReact 11 is part of PrimeTek's commercial **PrimeUI** family, and so are the
|
|
73
73
|
packages it brings with it.
|
|
74
74
|
|
|
75
|
-
| Package
|
|
76
|
-
|
|
77
|
-
| `primereact`
|
|
78
|
-
| `primeicons`
|
|
79
|
-
| `@primereact/core`, `@primereact/headless` | —
|
|
80
|
-
| `@primeuix/themes`, `@primeuix/styled`
|
|
75
|
+
| Package | v10 | v11 |
|
|
76
|
+
| ------------------------------------------------------------------------------------- | --------- | ------------------------ |
|
|
77
|
+
| `primereact` | MIT | PrimeUI commercial |
|
|
78
|
+
| `primeicons` | MIT (7.x) | PrimeUI commercial (8.x) |
|
|
79
|
+
| `@primereact/core`, `@primereact/headless`, `@primereact/hooks`, `@primereact/styles` | — | PrimeUI commercial |
|
|
80
|
+
| `@primeuix/themes`, `@primeuix/styled` | — | PrimeUI commercial |
|
|
81
81
|
|
|
82
82
|
`@cratis/components` itself remains **MIT**. The change is in what it depends on, and it is
|
|
83
83
|
yours to satisfy: PrimeReact is a peer dependency, so you install it and its license terms
|
|
84
|
-
apply to you directly.
|
|
84
|
+
apply to you directly. `@primereact/styles` and `@primeuix/themes` — the two styled mode
|
|
85
|
+
adds — are PrimeUI-licensed too.
|
|
85
86
|
|
|
86
87
|
### A key is required regardless of how you style
|
|
87
88
|
|
|
88
89
|
PrimeReact 11 verifies a license key when `PrimeReactProvider` mounts. The check is not
|
|
89
90
|
conditional on `unstyled`, on whether a theme preset is applied, or on `NODE_ENV` — so
|
|
90
91
|
every styling setup in [Styling](#styling) reaches it. Without a valid key you get a
|
|
91
|
-
console warning and a fixed
|
|
92
|
+
console warning and a fixed _"Invalid PrimeUI License"_ banner, in development **and**
|
|
92
93
|
production.
|
|
93
94
|
|
|
94
95
|
Supply your key through the provider:
|
|
@@ -105,7 +106,7 @@ PrimeReact 11, which needs a key.
|
|
|
105
106
|
|
|
106
107
|
- **[Community License](https://primeui.dev/licenses/community)** — free. Covers
|
|
107
108
|
individuals, students, non-profits and non-commercial open source outright. For an
|
|
108
|
-
organization it requires
|
|
109
|
+
organization it requires _all_ of: under $1M USD annual gross revenue, fewer than 5
|
|
109
110
|
developers, fewer than 10 employees, and under $3M USD in outside funding. Supports up to
|
|
110
111
|
4 developers and is renewed annually by confirming continued eligibility.
|
|
111
112
|
- **[Commercial License](https://primeui.dev/licenses/commercial)** — for everyone else.
|
|
@@ -113,9 +114,9 @@ PrimeReact 11, which needs a key.
|
|
|
113
114
|
|
|
114
115
|
### If you redistribute
|
|
115
116
|
|
|
116
|
-
PrimeReact 11's terms state:
|
|
117
|
+
PrimeReact 11's terms state: _"You may not … redistribute it as a component library or
|
|
117
118
|
development tool … Redistributing the software so that third parties can develop with it
|
|
118
|
-
requires a separate OEM License."
|
|
119
|
+
requires a separate OEM License."_
|
|
119
120
|
|
|
120
121
|
If you are building an application, that clause is not aimed at you. If you are publishing
|
|
121
122
|
a library or tool that others build with, read it and check your position with PrimeTek.
|
|
@@ -161,20 +162,22 @@ Components:
|
|
|
161
162
|
- `@cratis/components/Dialogs`
|
|
162
163
|
- `@cratis/components/Display` — `Tag`, `Badge`, `Chip`, `Skeleton`, `Avatar`, `ProgressBar`
|
|
163
164
|
- `@cratis/components/Dropdown`
|
|
164
|
-
- `@cratis/components/Notifications` — `Toaster`, `toast`, `toastCommandResult`
|
|
165
|
+
- `@cratis/components/Notifications` — `Toaster`, Cratis-owned `toast` / `ToastDispatch`, `toastCommandResult`
|
|
165
166
|
- `@cratis/components/ObjectContentEditor`
|
|
166
167
|
- `@cratis/components/ObjectNavigationalBar`
|
|
167
168
|
- `@cratis/components/PivotViewer`
|
|
168
169
|
- `@cratis/components/SchemaEditor`
|
|
169
170
|
- `@cratis/components/TimeMachine`
|
|
170
171
|
- `@cratis/components/Toolbar`
|
|
172
|
+
- `@cratis/components/styled` — `styledMode`, `CratisPreset`, `primeReactStyles`, `primeReactCssLayer`, `primeReactCssLayerOrder`, `cratisDarkModeSelector`: PrimeReact's styled mode, wired for the provider (needs `@primereact/styles` + `@primeuix/themes`)
|
|
171
173
|
- `@cratis/components/types`
|
|
172
174
|
|
|
173
175
|
Stylesheets:
|
|
174
176
|
|
|
175
|
-
- `@cratis/components/theme` — the **Cratis baseline theme** (light + dark, Cratis-authored MIT CSS, no `@primeuix/themes` dependency); import it and add `class="cratis-theme"` to skin every component from the token layer
|
|
177
|
+
- `@cratis/components/theme` — the **Cratis baseline theme** (light + dark, Cratis-authored MIT CSS, no `@primereact/styles` / `@primeuix/themes` dependency); import it and add `class="cratis-theme"` to skin every component from the token layer
|
|
176
178
|
- `@cratis/components/styles` — **required**: every component stylesheet, the Tailwind utilities used inside the package, and the `allotment` rules `DataPage` needs, in one file
|
|
177
179
|
- `@cratis/components/tokens` — **required**: the `--cratis-*` CSS variable tokens every component reads from
|
|
180
|
+
- `@cratis/components/primereact-v10-palette` — the PrimeReact 10 theme variables (`--surface-*`, `--text-color`, `--primary-color`, the color scales, …) restored with the lara-blue values, for CSS already written against them
|
|
178
181
|
|
|
179
182
|
## Styling
|
|
180
183
|
|
|
@@ -184,9 +187,9 @@ much control you want, and the other layers stay invisible.
|
|
|
184
187
|
|
|
185
188
|
> **Tip — see each setup live:** every Storybook story includes a **Styling**
|
|
186
189
|
> toolbar (paintbrush icon) that flips between the modes demonstrating the
|
|
187
|
-
> setups below:
|
|
188
|
-
> preset),
|
|
189
|
-
> (bare structure)
|
|
190
|
+
> setups below: _Aura Dark_ and _Aura Light_ (an `@primeuix/themes`
|
|
191
|
+
> preset), _Cratis baseline theme_ (light and dark), _Unstyled
|
|
192
|
+
> (bare structure)_, and _Unstyled + Tailwind pt_. Open any story (`yarn dev`)
|
|
190
193
|
> and switch modes to see the same component under each setup.
|
|
191
194
|
|
|
192
195
|
### TL;DR — choose a styling setup
|
|
@@ -195,27 +198,34 @@ much control you want, and the other layers stay invisible.
|
|
|
195
198
|
> The styling choice changes how it looks and whether you additionally pull in
|
|
196
199
|
> `@primeuix/themes`; it does not change whether you need a key.
|
|
197
200
|
|
|
198
|
-
| Setup
|
|
199
|
-
|
|
200
|
-
| **Cratis baseline theme**
|
|
201
|
-
| **
|
|
202
|
-
| **A custom palette over a
|
|
203
|
-
| **Fully unstyled**
|
|
201
|
+
| Setup | When | Effort | Extra dependency | What you write |
|
|
202
|
+
| --------------------------------- | ---------------------------------------------------------------------------------------------------- | ------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
203
|
+
| **Cratis baseline theme** | You want a polished default look without adding a theme package. | Lowest | None | `unstyled` + `import '@cratis/components/theme'` + `class="cratis-theme"` |
|
|
204
|
+
| **PrimeReact's styled mode** | You want PrimeReact's own look — a `@primeuix/themes` preset painting PrimeReact's component styles. | Low | `@primereact/styles` + `@primeuix/themes` | `value={{ license, ...styledMode() }}` with `styledMode` from `@cratis/components/styled` |
|
|
205
|
+
| **A custom palette over a theme** | You want the theme's structure but your own colors. | Low | As above, or none | `--cratis-*` overrides on the baseline theme, or `styledMode({ preset: definePreset(CratisPreset, …) })` |
|
|
206
|
+
| **Fully unstyled** | You're integrating into a tightly controlled design system. | Highest | None | `unstyled: true` + a `pt` preset in CSS or Tailwind |
|
|
204
207
|
|
|
205
208
|
> **Why you need a theme, a baseline stylesheet, or a `pt` preset**
|
|
206
209
|
>
|
|
207
|
-
> PrimeReact 11 is **unstyled-first**: the
|
|
208
|
-
>
|
|
209
|
-
>
|
|
210
|
-
>
|
|
211
|
-
>
|
|
210
|
+
> PrimeReact 11 is **unstyled-first**: the `primereact` package is primitives
|
|
211
|
+
> that render structural markup with `data-scope` / `data-part` attributes,
|
|
212
|
+
> no built-in visuals and **no `p-*` class names**. The class names and the
|
|
213
|
+
> CSS behind them live in `@primereact/styles`; PrimeReact's own styled
|
|
214
|
+
> components (`@primereact/ui`) are just the primitives with those styles
|
|
215
|
+
> preset, and this library builds on the primitives. So a look comes from one
|
|
216
|
+
> of three sources — PrimeReact's styled mode (`styledMode()`: a
|
|
217
|
+
> `@primeuix/themes` preset **plus** PrimeReact's component styles), the
|
|
218
|
+
> Cratis baseline theme (`@cratis/components/theme`), or your own `pt`/CSS.
|
|
219
|
+
> Load none of them and the components render as their raw HTML primitives.
|
|
220
|
+
> **A preset alone is not one of the three** — `theme: { preset }` by itself
|
|
221
|
+
> emits `--p-*` tokens but styles nothing rendered here.
|
|
212
222
|
>
|
|
213
223
|
> The `--cratis-*` token layer is an **additive Cratis-scoped tint** for
|
|
214
|
-
> surfaces
|
|
224
|
+
> surfaces _our_ wrappers own (validation error text, the FormElement addon,
|
|
215
225
|
> breadcrumb borders, etc.). It is not, by itself, enough to skin the
|
|
216
|
-
> PrimeReact widgets — pair it with the baseline theme,
|
|
217
|
-
> preset.
|
|
218
|
-
> you want the whole UI in your palette.
|
|
226
|
+
> PrimeReact widgets — pair it with the baseline theme, styled mode, or a `pt`
|
|
227
|
+
> preset. Derive the preset (styled mode) or override the `--cratis-*` tokens
|
|
228
|
+
> (baseline theme) when you want the whole UI in your palette.
|
|
219
229
|
|
|
220
230
|
All setups share the same one-line provider setup. You can change direction
|
|
221
231
|
later because the same provider, tokens, and `pt` hooks stay available.
|
|
@@ -245,7 +255,7 @@ export const App = () => (
|
|
|
245
255
|
required, not optional.
|
|
246
256
|
- `CratisComponentsProvider` is a thin wrapper over `@primereact/core`'s
|
|
247
257
|
`PrimeReactProvider` so Cratis has one place to layer in defaults (including
|
|
248
|
-
the optional `
|
|
258
|
+
the optional `...styledMode()` styled layer). Drop in the raw
|
|
249
259
|
`PrimeReactProvider` from `@primereact/core` if you'd rather.
|
|
250
260
|
|
|
251
261
|
The setups below differ only in **what else** you load on top of this
|
|
@@ -253,66 +263,67 @@ provider setup.
|
|
|
253
263
|
|
|
254
264
|
---
|
|
255
265
|
|
|
256
|
-
### Use
|
|
266
|
+
### Use PrimeReact's styled mode
|
|
257
267
|
|
|
258
268
|
PrimeReact 11 dropped the v10 `primereact/resources/themes/*/theme.css`
|
|
259
|
-
stylesheets
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
269
|
+
stylesheets. A theme is now handed to the provider at runtime, in two halves: a
|
|
270
|
+
`@primeuix/themes` **preset** (a token object `@primeuix/styled` turns into
|
|
271
|
+
`--p-*` custom properties) and PrimeReact's **component styles**
|
|
272
|
+
(`@primereact/styles` — the `p-*` class names and the CSS the tokens drive).
|
|
273
|
+
`styledMode()` from `@cratis/components/styled` returns both as
|
|
274
|
+
`{ theme, defaults }`; spread it into the provider `value` next to your
|
|
275
|
+
license key. The `defaults` are `primeReactStyles`, PrimeReact's component
|
|
276
|
+
styles keyed by primitive name, which the provider applies to **every**
|
|
277
|
+
primitive rendered under it — the ones this library renders and the ones your
|
|
278
|
+
app renders itself. That is what puts the `p-*` class names on the elements and
|
|
279
|
+
lets the preset paint them; the `--cratis-*` tokens follow the preset's `--p-*`
|
|
280
|
+
so Cratis-scoped surfaces stay in sync.
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
npm install @primereact/styles @primeuix/themes # optional peers, styled mode only
|
|
284
|
+
```
|
|
264
285
|
|
|
265
286
|
```tsx
|
|
266
|
-
import Aura from '@primeuix/themes/aura'; // or lara / nora / material
|
|
267
287
|
import 'primeicons/primeicons.css';
|
|
288
|
+
import '@cratis/components/tokens';
|
|
268
289
|
import '@cratis/components/styles';
|
|
269
|
-
|
|
270
290
|
import { CratisComponentsProvider } from '@cratis/components';
|
|
291
|
+
import { styledMode } from '@cratis/components/styled';
|
|
271
292
|
|
|
272
293
|
export const App = () => (
|
|
273
|
-
<CratisComponentsProvider value={{
|
|
294
|
+
<CratisComponentsProvider value={{ license: 'YOUR-PRIMEUI-KEY', ...styledMode() }}>
|
|
274
295
|
<YourApp />
|
|
275
296
|
</CratisComponentsProvider>
|
|
276
297
|
);
|
|
277
298
|
```
|
|
278
299
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
export const App = () => (
|
|
295
|
-
<CratisComponentsProvider value={{ unstyled: true }}>
|
|
296
|
-
<div className="cratis-theme"> {/* scope: put on <body>, app root, or a subtree */}
|
|
297
|
-
<YourApp />
|
|
298
|
-
</div>
|
|
299
|
-
</CratisComponentsProvider>
|
|
300
|
-
);
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Add `cratis-dark` to an ancestor for the dark palette. The theme defers to a
|
|
304
|
-
`@primeuix/themes` preset's `--p-*` tokens when one is present, so you can layer
|
|
305
|
-
it under a preset too, and every rule is overridable via your own CSS or `pt`.
|
|
300
|
+
The default preset is `CratisPreset` — Lara with the blue primary and gray
|
|
301
|
+
surfaces of PrimeReact 10's `lara-light-blue` / `lara-dark-blue`, with the dark
|
|
302
|
+
surface scale one step lighter so content sits above the page as it did there,
|
|
303
|
+
both color schemes.
|
|
304
|
+
Options: `preset` (any `@primeuix/themes` preset — Aura, Lara, Nora, Material —
|
|
305
|
+
or a `definePreset` result), `darkModeSelector` (default `.cratis-dark`, the
|
|
306
|
+
class the baseline theme uses too; `'system'` follows `prefers-color-scheme`),
|
|
307
|
+
`cssLayer` (default the `primereact` layer ordered between Tailwind's `base`
|
|
308
|
+
and `components`; `false` emits the theme unlayered).
|
|
309
|
+
|
|
310
|
+
> **A preset alone styles nothing.** `value={{ theme: { preset } }}` without the
|
|
311
|
+
> `defaults` emits the `--p-*` tokens, but the primitives keep rendering with no
|
|
312
|
+
> `p-*` class, so nothing rendered by this library is painted. Use
|
|
313
|
+
> `styledMode()`.
|
|
306
314
|
|
|
307
315
|
#### Override a single component with CSS
|
|
308
316
|
|
|
309
|
-
Plain CSS works fine on top of the theme.
|
|
310
|
-
names
|
|
317
|
+
Plain CSS works fine on top of the theme. In styled mode PrimeReact's elements
|
|
318
|
+
carry their `p-*` class names, and the theme is emitted into the `primereact`
|
|
319
|
+
cascade layer, so a plain unlayered rule in your own stylesheet wins — exactly
|
|
320
|
+
as it did against PrimeReact 10's `@layer primereact` stylesheets. Or target
|
|
321
|
+
your own `className`:
|
|
311
322
|
|
|
312
323
|
```css
|
|
313
324
|
/* yourApp.css */
|
|
314
325
|
.p-button {
|
|
315
|
-
border-radius: 999px;
|
|
326
|
+
border-radius: 999px; /* pill buttons everywhere */
|
|
316
327
|
}
|
|
317
328
|
|
|
318
329
|
.dangerous-button {
|
|
@@ -322,7 +333,7 @@ names or your own `className`:
|
|
|
322
333
|
```
|
|
323
334
|
|
|
324
335
|
```tsx
|
|
325
|
-
<Button
|
|
336
|
+
<Button className='dangerous-button'>Delete</Button>
|
|
326
337
|
```
|
|
327
338
|
|
|
328
339
|
#### Override a single component with Tailwind
|
|
@@ -338,78 +349,136 @@ Pass Tailwind utility classes through the wrapper's `className` prop:
|
|
|
338
349
|
</Dialog>
|
|
339
350
|
```
|
|
340
351
|
|
|
341
|
-
**Use this setup when:** you're prototyping, building internal tools,
|
|
342
|
-
happy with one of the prebuilt
|
|
352
|
+
**Use this setup when:** you're prototyping, building internal tools, want the
|
|
353
|
+
look Cratis apps had on PrimeReact 10, or are happy with one of the prebuilt
|
|
354
|
+
PrimeReact design systems.
|
|
355
|
+
|
|
356
|
+
### Use the Cratis baseline theme
|
|
357
|
+
|
|
358
|
+
Want a polished default look **without adding `@primereact/styles` and
|
|
359
|
+
`@primeuix/themes`**? Ship the components unstyled and import the Cratis baseline
|
|
360
|
+
theme — Cratis-authored MIT CSS that styles every component from the `--cratis-*`
|
|
361
|
+
layer. (You still need a PrimeUI key to run PrimeReact itself — see
|
|
362
|
+
[Licensing](#licensing).)
|
|
363
|
+
|
|
364
|
+
```tsx
|
|
365
|
+
import 'primeicons/primeicons.css';
|
|
366
|
+
import '@cratis/components/theme'; // the baseline theme
|
|
367
|
+
|
|
368
|
+
export const App = () => (
|
|
369
|
+
<CratisComponentsProvider value={{ unstyled: true }}>
|
|
370
|
+
<div className='cratis-theme'>
|
|
371
|
+
{' '}
|
|
372
|
+
{/* scope: put on <body>, app root, or a subtree */}
|
|
373
|
+
<YourApp />
|
|
374
|
+
</div>
|
|
375
|
+
</CratisComponentsProvider>
|
|
376
|
+
);
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
Add `cratis-dark` to an ancestor for the dark palette. The theme defers to a
|
|
380
|
+
`@primeuix/themes` preset's `--p-*` tokens when one is present, so you can layer
|
|
381
|
+
it under styled mode too, and every rule is overridable via your own CSS or `pt`.
|
|
382
|
+
The baseline theme styles the unstyled primitives through their `[data-scope]`
|
|
383
|
+
attributes — there are no `p-*` class names outside styled mode — so target
|
|
384
|
+
those, or your own `className`, or the `--cratis-*` tokens:
|
|
385
|
+
|
|
386
|
+
```css
|
|
387
|
+
.cratis-theme [data-scope='button'] {
|
|
388
|
+
border-radius: 999px;
|
|
389
|
+
} /* pill buttons */
|
|
390
|
+
.dangerous {
|
|
391
|
+
background: var(--cratis-red-500);
|
|
392
|
+
color: white;
|
|
393
|
+
}
|
|
394
|
+
```
|
|
343
395
|
|
|
344
396
|
---
|
|
345
397
|
|
|
346
398
|
### Use a custom palette on top of a PrimeReact theme
|
|
347
399
|
|
|
348
|
-
Keep a
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
colors. The `--cratis-*` tokens follow along through tokens.css's cascade, so
|
|
352
|
-
Cratis-scoped surfaces stay in sync — and you can override the Cratis tokens
|
|
353
|
-
independently if you want Cratis surfaces to differ from PrimeReact widgets.
|
|
400
|
+
Keep a theme as your **structural baseline** (so every widget gets its
|
|
401
|
+
padding, dialog frame, button shape, focus ring, etc.) and repaint it with your
|
|
402
|
+
own colors. Which knob you turn depends on the theme:
|
|
354
403
|
|
|
355
|
-
|
|
404
|
+
- **Cratis baseline theme** — override the `--cratis-*` tokens in CSS; the
|
|
405
|
+
theme paints the widgets from them, so one override repaints widgets and
|
|
406
|
+
Cratis-scoped surfaces alike.
|
|
407
|
+
- **PrimeReact's styled mode** — derive your own preset with `definePreset` and
|
|
408
|
+
hand it to `styledMode({ preset })`; the widgets read the preset's `--p-*`
|
|
409
|
+
tokens, and the `--cratis-*` tokens follow.
|
|
410
|
+
|
|
411
|
+
#### Baseline theme, plain CSS
|
|
356
412
|
|
|
357
413
|
```css
|
|
358
|
-
/* palette.override.css — imported once, after @cratis/components/
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
--surface-
|
|
362
|
-
--surface-
|
|
363
|
-
--surface-
|
|
364
|
-
--surface-
|
|
365
|
-
|
|
366
|
-
--
|
|
367
|
-
--
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
--
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
--
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
--highlight-bg: #1e40af;
|
|
377
|
-
--highlight-text-color: #ffffff;
|
|
378
|
-
|
|
379
|
-
--border-radius: 10px;
|
|
380
|
-
|
|
381
|
-
/* --cratis-* tokens default to var(--surface-*) etc. via tokens.css, so
|
|
382
|
-
the overrides above flow through automatically. Set these explicitly
|
|
383
|
-
only if you want Cratis-scoped surfaces tinted differently. */
|
|
384
|
-
--cratis-red-500: #ef4444;
|
|
385
|
-
--cratis-green-500: #22c55e;
|
|
414
|
+
/* palette.override.css — imported once, after @cratis/components/theme */
|
|
415
|
+
.cratis-theme {
|
|
416
|
+
--cratis-surface-section: #0f172a;
|
|
417
|
+
--cratis-surface-card: #1e293b;
|
|
418
|
+
--cratis-surface-overlay: #1e293b;
|
|
419
|
+
--cratis-surface-hover: #334155;
|
|
420
|
+
--cratis-surface-border: #334155;
|
|
421
|
+
|
|
422
|
+
--cratis-text-color: #f8fafc;
|
|
423
|
+
--cratis-text-color-secondary: #94a3b8;
|
|
424
|
+
|
|
425
|
+
--cratis-primary-color: #38bdf8;
|
|
426
|
+
--cratis-primary-color-text: #0b1220;
|
|
427
|
+
|
|
428
|
+
--cratis-highlight-bg: #1e40af;
|
|
429
|
+
--cratis-highlight-text-color: #ffffff;
|
|
430
|
+
|
|
431
|
+
--cratis-border-radius: 10px;
|
|
386
432
|
}
|
|
387
433
|
```
|
|
388
434
|
|
|
435
|
+
#### Styled mode, `definePreset`
|
|
436
|
+
|
|
437
|
+
```ts
|
|
438
|
+
// brand-preset.ts
|
|
439
|
+
import { definePreset } from '@primeuix/themes';
|
|
440
|
+
import { CratisPreset } from '@cratis/components/styled';
|
|
441
|
+
|
|
442
|
+
export const BrandPreset = definePreset(CratisPreset, {
|
|
443
|
+
semantic: {
|
|
444
|
+
primary: {
|
|
445
|
+
50: '{sky.50}',
|
|
446
|
+
100: '{sky.100}',
|
|
447
|
+
200: '{sky.200}',
|
|
448
|
+
300: '{sky.300}',
|
|
449
|
+
400: '{sky.400}',
|
|
450
|
+
500: '{sky.500}',
|
|
451
|
+
600: '{sky.600}',
|
|
452
|
+
700: '{sky.700}',
|
|
453
|
+
800: '{sky.800}',
|
|
454
|
+
900: '{sky.900}',
|
|
455
|
+
950: '{sky.950}',
|
|
456
|
+
},
|
|
457
|
+
},
|
|
458
|
+
});
|
|
459
|
+
```
|
|
460
|
+
|
|
389
461
|
```tsx
|
|
390
|
-
|
|
391
|
-
import 'primeicons/primeicons.css';
|
|
392
|
-
import '@cratis/components/styles';
|
|
393
|
-
// 2. Your palette overrides — must come after the styles so they win.
|
|
394
|
-
import './palette.override.css';
|
|
462
|
+
<CratisComponentsProvider value={{ license, ...styledMode({ preset: BrandPreset }) }}>
|
|
395
463
|
```
|
|
396
464
|
|
|
397
465
|
#### Scoped (dark-on-light, light-on-dark, etc.)
|
|
398
466
|
|
|
399
|
-
|
|
400
|
-
|
|
467
|
+
`--cratis-*` tokens cascade like any other CSS variable, so an ancestor scope
|
|
468
|
+
works under the baseline theme (in styled mode, region-scoped widget colors come
|
|
469
|
+
from the preset; the `--cratis-*` overrides still retint Cratis-scoped surfaces):
|
|
401
470
|
|
|
402
471
|
```css
|
|
403
472
|
.dark-zone {
|
|
404
|
-
--surface-card: #0b1220;
|
|
405
|
-
--text-color:
|
|
406
|
-
--primary-color: #60a5fa;
|
|
473
|
+
--cratis-surface-card: #0b1220;
|
|
474
|
+
--cratis-text-color: #f8fafc;
|
|
475
|
+
--cratis-primary-color: #60a5fa;
|
|
407
476
|
}
|
|
408
477
|
```
|
|
409
478
|
|
|
410
479
|
```tsx
|
|
411
|
-
<div className=
|
|
412
|
-
<Dialog title=
|
|
480
|
+
<div className='dark-zone'>
|
|
481
|
+
<Dialog title='Always dark'>…</Dialog>
|
|
413
482
|
</div>
|
|
414
483
|
```
|
|
415
484
|
|
|
@@ -420,53 +489,71 @@ Tailwind handles cascade and dark mode:
|
|
|
420
489
|
|
|
421
490
|
```css
|
|
422
491
|
/* app.css */
|
|
423
|
-
@import
|
|
424
|
-
@import
|
|
492
|
+
@import 'tailwindcss';
|
|
493
|
+
@import '@cratis/components/tokens';
|
|
494
|
+
@import '@cratis/components/styles';
|
|
425
495
|
|
|
426
496
|
@layer base {
|
|
427
497
|
:root {
|
|
428
|
-
--surface-card:
|
|
429
|
-
--surface-border: theme('colors.slate.700');
|
|
430
|
-
--text-color:
|
|
431
|
-
--primary-color:
|
|
498
|
+
--cratis-surface-card: theme('colors.slate.800');
|
|
499
|
+
--cratis-surface-border: theme('colors.slate.700');
|
|
500
|
+
--cratis-text-color: theme('colors.slate.50');
|
|
501
|
+
--cratis-primary-color: theme('colors.sky.400');
|
|
432
502
|
--cratis-red-500: theme('colors.red.500');
|
|
433
503
|
}
|
|
434
504
|
|
|
435
|
-
.dark {
|
|
436
|
-
--surface-card: theme('colors.slate.900');
|
|
437
|
-
--text-color:
|
|
505
|
+
.cratis-dark {
|
|
506
|
+
--cratis-surface-card: theme('colors.slate.900');
|
|
507
|
+
--cratis-text-color: theme('colors.slate.100');
|
|
438
508
|
}
|
|
439
509
|
}
|
|
440
510
|
```
|
|
441
511
|
|
|
512
|
+
#### CSS written against PrimeReact 10's variables
|
|
513
|
+
|
|
514
|
+
If your stylesheets still use the names a v10 theme published on `:root` —
|
|
515
|
+
`--surface-ground`, `--surface-card`, `--surface-border`, `--text-color`,
|
|
516
|
+
`--primary-color`, the `--surface-0…900` and color scales — import
|
|
517
|
+
`@cratis/components/primereact-v10-palette` after `tokens` and `styles`. It
|
|
518
|
+
restores every one of them with the `lara-light-blue` / `lara-dark-blue`
|
|
519
|
+
values: the semantic names follow the active preset's `--p-*` tokens where
|
|
520
|
+
v11 has an equivalent (Lara as the fallback), the numbered scales are the
|
|
521
|
+
lara-blue values verbatim (the v10 dark surface scale was inverted, so
|
|
522
|
+
`--p-surface-*` cannot stand in for it), and light/dark switch through
|
|
523
|
+
`light-dark()` keyed off `.cratis-dark`. It exists so what is already written
|
|
524
|
+
keeps working — write nothing new against those names; use `--cratis-*` (or
|
|
525
|
+
`--p-*`).
|
|
526
|
+
|
|
442
527
|
#### What `--cratis-*` tokens are for
|
|
443
528
|
|
|
444
|
-
PrimeReact widgets read
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
529
|
+
In styled mode PrimeReact widgets read the preset's `--p-*` design tokens
|
|
530
|
+
directly. Cratis wrappers add some surfaces of their own (inline validation
|
|
531
|
+
error text, the FormElement addon background, the breadcrumb bottom border,
|
|
532
|
+
etc.) — those use a parallel set of `--cratis-*` tokens that resolve the v11
|
|
533
|
+
token first and fall back to the v10 variable, via the cascade defined in
|
|
534
|
+
`tokens.css`. Under the baseline theme the widgets read the `--cratis-*` tokens
|
|
535
|
+
too.
|
|
450
536
|
|
|
451
537
|
The upshot:
|
|
452
538
|
|
|
453
|
-
-
|
|
454
|
-
- Override **`--cratis-*` tokens** when you specifically want Cratis surfaces to differ from PrimeReact widgets.
|
|
539
|
+
- Repaint the whole UI by deriving the **preset** (styled mode) or overriding the **`--cratis-*` tokens** (baseline theme).
|
|
540
|
+
- Override **`--cratis-*` tokens** in styled mode when you specifically want Cratis surfaces to differ from PrimeReact widgets.
|
|
455
541
|
|
|
456
542
|
#### `--cratis-*` token reference (Cratis-scoped surfaces)
|
|
457
543
|
|
|
458
|
-
| Group
|
|
459
|
-
|
|
460
|
-
| Surfaces
|
|
461
|
-
| Text
|
|
462
|
-
| Brand
|
|
463
|
-
| Selection | `--cratis-highlight-bg`, `--cratis-highlight-text-color`
|
|
464
|
-
| Semantic
|
|
465
|
-
| Geometry
|
|
466
|
-
| Effects
|
|
544
|
+
| Group | Tokens |
|
|
545
|
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
546
|
+
| Surfaces | `--cratis-surface-0`, `--cratis-surface-100`, `--cratis-surface-ground`, `--cratis-surface-section`, `--cratis-surface-card`, `--cratis-surface-overlay`, `--cratis-surface-hover`, `--cratis-surface-border` |
|
|
547
|
+
| Text | `--cratis-text-color`, `--cratis-text-color-secondary` |
|
|
548
|
+
| Brand | `--cratis-primary-color`, `--cratis-primary-color-text`, `--cratis-primary-300`, `--cratis-primary-400`, `--cratis-primary-500`, `--cratis-primary-600` |
|
|
549
|
+
| Selection | `--cratis-highlight-bg`, `--cratis-highlight-text-color` |
|
|
550
|
+
| Semantic | `--cratis-green-500`, `--cratis-orange-500`, `--cratis-red-500` |
|
|
551
|
+
| Geometry | `--cratis-border-radius` |
|
|
552
|
+
| Effects | `--cratis-focus-ring`, `--cratis-maskbg` |
|
|
467
553
|
|
|
468
|
-
Each
|
|
469
|
-
`--cratis-` prefix (e.g. `--cratis-surface-card`
|
|
554
|
+
Each resolves the v11 design token first and falls back to the v10 variable
|
|
555
|
+
with the same name minus the `--cratis-` prefix (e.g. `--cratis-surface-card`
|
|
556
|
+
→ `var(--p-content-background, var(--surface-card))`).
|
|
470
557
|
|
|
471
558
|
**Use this setup when:** you want a custom look without writing a PrimeReact
|
|
472
559
|
theme from scratch, you're shipping multiple palette variants (light/dark/
|
|
@@ -482,7 +569,7 @@ through PrimeReact's `pt` (pass-through) mechanism, your own CSS, or both.
|
|
|
482
569
|
Components render structurally only and become a blank canvas.
|
|
483
570
|
|
|
484
571
|
```tsx
|
|
485
|
-
import '@cratis/components/styles';
|
|
572
|
+
import '@cratis/components/styles'; // component rules + Tailwind utilities, still needed when unstyled
|
|
486
573
|
import { CratisComponentsProvider } from '@cratis/components';
|
|
487
574
|
|
|
488
575
|
export const App = () => (
|
|
@@ -492,6 +579,12 @@ export const App = () => (
|
|
|
492
579
|
);
|
|
493
580
|
```
|
|
494
581
|
|
|
582
|
+
#### Verify pass-through compatibility
|
|
583
|
+
|
|
584
|
+
Components 3 publishes its PrimeReact 11 slot and rendered-marker contract from `@cratis/components/compatibility`. In a DOM test, apply `primeReact11PassThroughSentinelPreset`, render the surfaces your application uses, and call `assertPrimeReact11PassThroughCompatibility(root, components)`. Additions pass; a missing or renamed contracted slot or marker produces an actionable error. The contract is major-version scoped and does not preserve PrimeReact 10 names.
|
|
585
|
+
|
|
586
|
+
The machine-readable `components3PrimeReact11PassThroughContract` is the source of truth. Contract revision 1 covers the parts rendered by Components 3's supported compositions on PrimeReact 11, rather than every optional part an application could compose directly. See the [pass-through contract documentation](https://cratis.io/Components/styling/pass-through.html) for the supported component and slot list.
|
|
587
|
+
|
|
495
588
|
#### A `pt` preset in plain CSS
|
|
496
589
|
|
|
497
590
|
Attach a `className` from your own stylesheet via a global preset:
|
|
@@ -503,9 +596,11 @@ export const globalPt = {
|
|
|
503
596
|
root: { className: 'my-btn' },
|
|
504
597
|
},
|
|
505
598
|
dialog: {
|
|
506
|
-
root: {
|
|
507
|
-
|
|
508
|
-
|
|
599
|
+
root: {
|
|
600
|
+
popup: { className: 'my-dialog' },
|
|
601
|
+
header: { className: 'my-dialog__header' },
|
|
602
|
+
content: { className: 'my-dialog__body' },
|
|
603
|
+
},
|
|
509
604
|
},
|
|
510
605
|
inputtext: {
|
|
511
606
|
root: { className: 'my-input' },
|
|
@@ -542,15 +637,26 @@ Same shape, Tailwind utilities as the class strings:
|
|
|
542
637
|
// pt-preset.ts
|
|
543
638
|
export const globalPt = {
|
|
544
639
|
button: {
|
|
545
|
-
root: {
|
|
640
|
+
root: {
|
|
641
|
+
className:
|
|
642
|
+
'inline-flex items-center px-4 py-2 rounded-lg bg-sky-700 text-white hover:bg-sky-600 disabled:opacity-50',
|
|
643
|
+
},
|
|
546
644
|
},
|
|
547
645
|
dialog: {
|
|
548
|
-
root:
|
|
549
|
-
|
|
550
|
-
|
|
646
|
+
root: {
|
|
647
|
+
popup: { className: 'rounded-2xl shadow-2xl overflow-hidden' },
|
|
648
|
+
header: {
|
|
649
|
+
className:
|
|
650
|
+
'px-5 py-3 bg-slate-800 text-slate-50 font-semibold border-b border-slate-700',
|
|
651
|
+
},
|
|
652
|
+
content: { className: 'p-5 bg-slate-900 text-slate-100' },
|
|
653
|
+
},
|
|
551
654
|
},
|
|
552
655
|
inputtext: {
|
|
553
|
-
root: {
|
|
656
|
+
root: {
|
|
657
|
+
className:
|
|
658
|
+
'w-full px-3 py-2 rounded-md bg-slate-800 text-slate-50 border border-slate-700 focus:border-sky-400 focus:outline-none',
|
|
659
|
+
},
|
|
554
660
|
},
|
|
555
661
|
} as const;
|
|
556
662
|
```
|
|
@@ -611,23 +717,31 @@ The styling options compose, so you don't have to choose one for the whole app:
|
|
|
611
717
|
|
|
612
718
|
- **Themed with one unstyled component** — keep the PrimeReact theme and pass
|
|
613
719
|
`unstyled` per-component to opt that one widget out:
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
720
|
+
|
|
721
|
+
```tsx
|
|
722
|
+
<Dialog title='Custom' unstyled pt={brandDialogPt}>
|
|
723
|
+
…
|
|
724
|
+
</Dialog>
|
|
725
|
+
```
|
|
726
|
+
|
|
727
|
+
- **Unstyled with one themed island** — the baseline theme's rules are scoped
|
|
728
|
+
under `.cratis-theme`, so wrapping one element in the class themes just that
|
|
729
|
+
subtree:
|
|
730
|
+
|
|
731
|
+
```tsx
|
|
732
|
+
<CratisComponentsProvider value={{ unstyled: true, pt: globalPt }}>
|
|
733
|
+
<App />
|
|
734
|
+
<div className='cratis-theme'>
|
|
735
|
+
<BaselineThemedSubtree />
|
|
736
|
+
</div>
|
|
737
|
+
</CratisComponentsProvider>
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
- **Dark mode** — toggle `cratis-dark` on the root element: the baseline
|
|
741
|
+
theme's dark palette, `styledMode()`'s dark scheme (its default
|
|
742
|
+
`darkModeSelector`) and the v10 palette all key off it, so PrimeReact widgets
|
|
743
|
+
and Cratis surfaces follow together. Scope any `--cratis-*` tokens you want
|
|
744
|
+
to diverge to `.cratis-dark` as well.
|
|
631
745
|
|
|
632
746
|
### Per-component `pt` cheat sheet
|
|
633
747
|
|
|
@@ -638,21 +752,32 @@ Three patterns, depending on how much PrimeReact a wrapper composes:
|
|
|
638
752
|
`className` straight to their inner PrimeReact component.
|
|
639
753
|
2. **Multi-slot composites** — `StepperCommandDialog` (`pt` for Stepper,
|
|
640
754
|
`dialogPt` for Dialog), `DataPage` (`tablePt` for DataTable, `menubarPt`
|
|
641
|
-
for
|
|
642
|
-
(`pt` for DataTable
|
|
643
|
-
|
|
755
|
+
for the action toolbar's buttons), and `DataTableForQuery` /
|
|
756
|
+
`DataTableForObservableQuery` (`pt` for DataTable plus
|
|
757
|
+
`paginatorClassName` / `paginatorAriaLabels` for the Cratis paginator).
|
|
644
758
|
3. **Large composites** — `ObjectContentEditor`, `ObjectNavigationalBar`,
|
|
645
759
|
`SchemaEditor` expose `className` only; restyle internals via the global
|
|
646
760
|
`pt` preset.
|
|
647
761
|
|
|
648
|
-
|
|
762
|
+
`Dropdown` routes `id`, `tabIndex`, `aria-label`, `aria-labelledby` and `aria-describedby` to its focusable `role="combobox"` trigger. The outer Select root remains a layout wrapper and does not duplicate the control id. For filterable dropdowns, `filterPlaceholder` can differ from the closed trigger's `placeholder` and defaults to it when omitted.
|
|
649
763
|
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
`
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
764
|
+
Filtered data-table columns accept partial `filterLabels` overrides for trigger, action and boolean-option text, plus a `filterElement` render callback that replaces the built-in value editor while keeping draft/apply behavior. `DataTableFilterMatchMode` supplies the Cratis-owned built-in vocabulary, and `registerDataTableFilterMatcher()` adds custom modes without importing the active rendering adapter.
|
|
765
|
+
|
|
766
|
+
`DatePickerInput` exposes `id`, `disabled`, `readOnly` and `showButtonBar` directly. Use its runtime `input` slot only for additional attributes; the public type intentionally rejects PrimeReact 11's stale `pcInputText` declaration, which the runtime never emits. The wrapper translates `invalid` to accepted `aria-invalid` and `data-invalid` input attributes instead of forwarding a rejected `invalid` DOM attribute:
|
|
767
|
+
|
|
768
|
+
```tsx
|
|
769
|
+
<DatePickerInput
|
|
770
|
+
id='appointment-date'
|
|
771
|
+
value={selectedDate}
|
|
772
|
+
onChange={setSelectedDate}
|
|
773
|
+
disabled={isDisabled}
|
|
774
|
+
readOnly={isReadOnly}
|
|
775
|
+
showButtonBar
|
|
776
|
+
pt={{ input: { 'aria-label': 'Appointment date' } }}
|
|
777
|
+
/>
|
|
778
|
+
```
|
|
779
|
+
|
|
780
|
+
### What is _not_ fully pass-through
|
|
656
781
|
|
|
657
782
|
`BusyIndicatorDialog` only honors the global `pt` set via
|
|
658
783
|
`CratisComponentsProvider`; it does not accept per-instance `pt` because its
|
|
@@ -674,9 +799,9 @@ If using TypeScript 4.7+, try updating your `tsconfig.json`:
|
|
|
674
799
|
|
|
675
800
|
```json
|
|
676
801
|
{
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
802
|
+
"compilerOptions": {
|
|
803
|
+
"moduleResolution": "bundler" // or "node16" / "nodenext"
|
|
804
|
+
}
|
|
680
805
|
}
|
|
681
806
|
```
|
|
682
807
|
|