From 3a5759f1bfeff32c8927f93fb683e7922ed7b028 Mon Sep 17 00:00:00 2001 From: Ashley Echols Date: Thu, 8 Aug 2024 11:27:43 -0500 Subject: [PATCH 1/2] chore: adds scope prop to address spec failures --- .../lib/sage_rails/app/sage_components/sage_empty_state.rb | 1 + packages/sage-react/lib/EmptyState/EmptyState.jsx | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/docs/lib/sage_rails/app/sage_components/sage_empty_state.rb b/docs/lib/sage_rails/app/sage_components/sage_empty_state.rb index 6c29f7d92d..51347b9654 100644 --- a/docs/lib/sage_rails/app/sage_components/sage_empty_state.rb +++ b/docs/lib/sage_rails/app/sage_components/sage_empty_state.rb @@ -4,6 +4,7 @@ class SageEmptyState < SageComponent graphic: [:optional, NilClass, String], icon: [:optional, NilClass, String], icon_background: [:optional, NilClass, String], + scope: [:optional, NilClass, Set.new(["page", "compact", nil])] size: [:optional, NilClass, Set.new(["compact", nil])], text: [:optional, NilClass, String], title: [:optional, NilClass, String], diff --git a/packages/sage-react/lib/EmptyState/EmptyState.jsx b/packages/sage-react/lib/EmptyState/EmptyState.jsx index eb56246d4b..9e2ac7347a 100644 --- a/packages/sage-react/lib/EmptyState/EmptyState.jsx +++ b/packages/sage-react/lib/EmptyState/EmptyState.jsx @@ -13,6 +13,7 @@ export const EmptyState = ({ graphic, icon, backgroundColor, + scope, size, text, title, @@ -92,6 +93,7 @@ export const EmptyState = ({ }; EmptyState.SIZES = EMPTY_STATE_SIZES; +EmptyState.SCOPES = EMPTY_STATE_SIZES; EmptyState.defaultProps = { actions: null, @@ -100,6 +102,7 @@ EmptyState.defaultProps = { graphic: null, icon: null, backgroundColor: null, + scope: EmptyState.SIZES.DEFAULT, size: EmptyState.SIZES.DEFAULT, text: null, title: null, @@ -132,6 +135,10 @@ EmptyState.propTypes = { * Sets the background color of the icon container. Defaults to Mercury 30 */ backgroundColor: PropTypes.string, + /** + * Sets the scope for the Empty State. Deprecated. + */ + scope: PropTypes.oneOf(Object.values(EmptyState.SIZES)), /** * The size and context of the Empty State. */ From f14fad7b5b1e13b40a0816f7e8404805fbf9a4c7 Mon Sep 17 00:00:00 2001 From: Ashley Echols Date: Thu, 8 Aug 2024 11:33:39 -0500 Subject: [PATCH 2/2] chore: fixes syntax error --- docs/lib/sage_rails/app/sage_components/sage_empty_state.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/lib/sage_rails/app/sage_components/sage_empty_state.rb b/docs/lib/sage_rails/app/sage_components/sage_empty_state.rb index 51347b9654..9b8b2af6dd 100644 --- a/docs/lib/sage_rails/app/sage_components/sage_empty_state.rb +++ b/docs/lib/sage_rails/app/sage_components/sage_empty_state.rb @@ -4,7 +4,7 @@ class SageEmptyState < SageComponent graphic: [:optional, NilClass, String], icon: [:optional, NilClass, String], icon_background: [:optional, NilClass, String], - scope: [:optional, NilClass, Set.new(["page", "compact", nil])] + scope: [:optional, NilClass, Set.new(["page", "compact", nil])], size: [:optional, NilClass, Set.new(["compact", nil])], text: [:optional, NilClass, String], title: [:optional, NilClass, String],