@beydesign/storybook 0.7.2 → 0.7.3

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.
@@ -30,7 +30,7 @@ const MAX_WIDTH = 696;
30
30
  /** The face bleeds 10% of its box on every side so the heart is not clipped. */
31
31
  const FACE_BOX = { xs: 50, sm: 60 };
32
32
  const FACE_BLEED = { xs: '-5px', sm: '-6px' };
33
- export const FeedbackCard = ({ title = 'How was your call experience with this agent?', rating, onRatingChange, ratingLabels = DEFAULT_RATING_LABELS, ratingInkColor, expanded = false, detailsTitle = 'Please help us improve! What can be done better?', topics = [], selectedTopic = null, onTopicChange, comment = '', onCommentChange, commentPlaceholder = 'Your comment', contactConsent = false, onContactConsentChange, contactConsentLabel = 'You can contact me about this feedback', submitText = 'Submit Feedback', onSubmit, submitDisabled = false, submitId, errorText, surfaceColor = DEFAULT_SURFACE, itemColor = DEFAULT_ITEM, className, sx, }) => {
33
+ export const FeedbackCard = ({ title = 'How was your call experience with this agent?', rating, onRatingChange, ratingLabels = DEFAULT_RATING_LABELS, ratingInkColor, expanded = false, detailsTitle = 'Please help us improve! What can be done better?', topics = [], selectedTopic = null, onTopicChange, comment = '', onCommentChange, commentPlaceholder = 'Your comment', contactConsent = false, onContactConsentChange, contactConsentLabel = 'You can contact me about this feedback', submitText = 'Submit Feedback', onSubmit, submitDisabled = false, submitLoading = false, submitId, errorText, surfaceColor = DEFAULT_SURFACE, itemColor = DEFAULT_ITEM, className, sx, }) => {
34
34
  const handleRatingClick = (option) => {
35
35
  onRatingChange(option === rating ? null : option);
36
36
  };
@@ -86,7 +86,7 @@ export const FeedbackCard = ({ title = 'How was your call experience with this a
86
86
  '&.Mui-checked': {
87
87
  color: 'var(--color-foreground-fg-brand-primary)',
88
88
  },
89
- } }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--color-text-text-white)', children: contactConsentLabel })] })] })), _jsx(Box, { display: 'flex', justifyContent: 'center', children: _jsx(MainButton, { text: submitText, disabled: submitDisabled, onClick: onSubmit, hierarchy: ButtonHierarchy.Primary, size: ButtonSize.sm, id: submitId }) })] }));
89
+ } }), _jsx(Typography, { size: TypographySize.TextS, weight: TypographyWeight.Regular, color: 'var(--color-text-text-white)', children: contactConsentLabel })] })] })), _jsx(Box, { display: 'flex', justifyContent: 'center', children: _jsx(MainButton, { text: submitText, disabled: submitDisabled, loading: submitLoading, onClick: onSubmit, hierarchy: ButtonHierarchy.Primary, size: ButtonSize.sm, id: submitId }) })] }));
90
90
  };
91
91
  const FeedbackOption = ({ rating, label, selected, inkColor, itemColor, onClick, }) => {
92
92
  const handleClick = () => {
@@ -63,6 +63,14 @@ const meta = {
63
63
  defaultValue: { summary: 'Submit Feedback' },
64
64
  },
65
65
  },
66
+ submitLoading: {
67
+ control: 'boolean',
68
+ description: 'Whether the submit button shows its loading spinner',
69
+ table: {
70
+ type: { summary: 'boolean' },
71
+ defaultValue: { summary: 'false' },
72
+ },
73
+ },
66
74
  errorText: {
67
75
  control: 'text',
68
76
  description: 'Error message shown under the question',
@@ -112,7 +120,7 @@ export const WithError = {
112
120
  export const Submitting = {
113
121
  args: {
114
122
  ...Expanded.args,
115
- submitText: 'Submitting...',
123
+ submitLoading: true,
116
124
  submitDisabled: true,
117
125
  },
118
126
  };
@@ -72,6 +72,8 @@ export type FeedbackCardProps = {
72
72
  onSubmit: () => void;
73
73
  /** Whether the submit button is disabled */
74
74
  submitDisabled?: boolean;
75
+ /** Whether the submit button shows its loading spinner */
76
+ submitLoading?: boolean;
75
77
  /** DOM id forwarded to the submit button, for analytics hooks */
76
78
  submitId?: string;
77
79
  /** Error message shown under the question */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@beydesign/storybook",
3
3
  "private": false,
4
- "version": "0.7.2",
4
+ "version": "0.7.3",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",