frst-components 0.25.0 → 0.25.2

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.
Files changed (2) hide show
  1. package/dist/index.js +38 -38
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8207,9 +8207,9 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8207
8207
  current: 100,
8208
8208
  goal: 100,
8209
8209
  barRef: 'goal',
8210
- currentVariant: CurrentVariant.Normal,
8211
- message: MESSAGES.reachedGoal,
8212
- currentTextInit: MESSAGES.currentTextInit
8210
+ currentVariant: CurrentVariant?.Normal,
8211
+ message: MESSAGES?.reachedGoal,
8212
+ currentTextInit: MESSAGES?.currentTextInit
8213
8213
  };
8214
8214
  // reachedGoalDecreased
8215
8215
  if (start > goal && currentValue == goal)
@@ -8218,9 +8218,9 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8218
8218
  current: 100,
8219
8219
  goal: 100,
8220
8220
  barRef: 'goal',
8221
- currentVariant: CurrentVariant.Normal,
8222
- message: MESSAGES.reachedGoal,
8223
- currentTextInit: MESSAGES.currentTextInit
8221
+ currentVariant: CurrentVariant?.Normal,
8222
+ message: MESSAGES?.reachedGoal,
8223
+ currentTextInit: MESSAGES?.currentTextInit
8224
8224
  };
8225
8225
  // exceededTargetIncrease
8226
8226
  if (start < goal && currentValue > start && currentValue > goal)
@@ -8229,10 +8229,10 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8229
8229
  current: 100,
8230
8230
  goal: toRange(start, goal, currentValue),
8231
8231
  barRef: 'current',
8232
- currentVariant: CurrentVariant.Star,
8233
- message: MESSAGES.progressExceeded,
8234
- currenText: MESSAGES.currentTextResult,
8235
- currentTextInit: MESSAGES.currentTextInit
8232
+ currentVariant: CurrentVariant?.Star,
8233
+ message: MESSAGES?.progressExceeded,
8234
+ currenText: MESSAGES?.currentTextResult,
8235
+ currentTextInit: MESSAGES?.currentTextInit
8236
8236
  };
8237
8237
  // exceededTargetDecreased
8238
8238
  if (start > goal && currentValue < goal)
@@ -8241,10 +8241,10 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8241
8241
  current: 100,
8242
8242
  goal: toRange(start, goal, currentValue),
8243
8243
  barRef: 'current',
8244
- currentVariant: CurrentVariant.Star,
8245
- message: MESSAGES.progressExceeded,
8246
- currenText: MESSAGES.currentTextResult,
8247
- currentTextInit: MESSAGES.currentTextInit
8244
+ currentVariant: CurrentVariant?.Star,
8245
+ message: MESSAGES?.progressExceeded,
8246
+ currenText: MESSAGES?.currentTextResult,
8247
+ currentTextInit: MESSAGES?.currentTextInit
8248
8248
  };
8249
8249
  // GrowingWithoutReachingGoal
8250
8250
  if (start < goal && currentValue > start && currentValue < goal)
@@ -8253,10 +8253,10 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8253
8253
  current: toRange(start, currentValue, goal),
8254
8254
  goal: 100,
8255
8255
  barRef: 'current',
8256
- currentVariant: CurrentVariant.Normal,
8257
- message: MESSAGES.progressImproved,
8258
- currenText: MESSAGES.currentTextResult,
8259
- currentTextInit: MESSAGES.currentTextInit
8256
+ currentVariant: CurrentVariant?.Normal,
8257
+ message: MESSAGES?.progressImproved,
8258
+ currenText: MESSAGES?.currentTextResult,
8259
+ currentTextInit: MESSAGES?.currentTextInit
8260
8260
  };
8261
8261
  // DecreasingWithoutGoal
8262
8262
  if (start > goal && currentValue > goal && currentValue < start)
@@ -8265,10 +8265,10 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8265
8265
  current: toRange(start, currentValue, goal),
8266
8266
  goal: 100,
8267
8267
  barRef: 'current',
8268
- currentVariant: CurrentVariant.Normal,
8269
- message: MESSAGES.progressImproved,
8270
- currenText: MESSAGES.currentTextResult,
8271
- currentTextInit: MESSAGES.currentTextInit
8268
+ currentVariant: CurrentVariant?.Normal,
8269
+ message: MESSAGES?.progressImproved,
8270
+ currenText: MESSAGES?.currentTextResult,
8271
+ currentTextInit: MESSAGES?.currentTextInit
8272
8272
  };
8273
8273
  // noResultsIncrease
8274
8274
  if (start < goal && currentValue == start)
@@ -8277,9 +8277,9 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8277
8277
  current: 0,
8278
8278
  goal: 100,
8279
8279
  barRef: 'current',
8280
- currentVariant: CurrentVariant.Warning,
8281
- message: MESSAGES.progressNoResults,
8282
- currenText: MESSAGES.currentTextInitAndResult
8280
+ currentVariant: CurrentVariant?.Warning,
8281
+ message: MESSAGES?.progressNoResults,
8282
+ currenText: MESSAGES?.currentTextInitAndResult
8283
8283
  };
8284
8284
  // noResultsDecreased
8285
8285
  if (start > goal && currentValue == start)
@@ -8288,9 +8288,9 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8288
8288
  current: 0,
8289
8289
  goal: 100,
8290
8290
  bar: 'current',
8291
- currentVariant: CurrentVariant.Warning,
8292
- message: MESSAGES.progressNoResults,
8293
- currenText: MESSAGES.currentTextInitAndResult
8291
+ currentVariant: CurrentVariant?.Warning,
8292
+ message: MESSAGES?.progressNoResults,
8293
+ currenText: MESSAGES?.currentTextInitAndResult
8294
8294
  };
8295
8295
  // noGoalIncrease
8296
8296
  if (start < goal && currentValue < start)
@@ -8299,10 +8299,10 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8299
8299
  current: 0,
8300
8300
  goal: 100,
8301
8301
  barRef: 'start',
8302
- currentVariant: CurrentVariant.Warning,
8303
- message: MESSAGES.progressNoGoal,
8304
- currenText: MESSAGES.currentTextResult,
8305
- currentTextInit: MESSAGES.currentTextInit
8302
+ currentVariant: CurrentVariant?.Warning,
8303
+ message: MESSAGES?.progressNoGoal,
8304
+ currenText: MESSAGES?.currentTextResult,
8305
+ currentTextInit: MESSAGES?.currentTextInit
8306
8306
  };
8307
8307
  // noGoalDecreased
8308
8308
  if (start > goal && currentValue > start)
@@ -8311,13 +8311,13 @@ const useProgressGoalBar = ({ start, current, goal }) => {
8311
8311
  current: 0,
8312
8312
  goal: 100,
8313
8313
  barRef: 'start',
8314
- currentVariant: CurrentVariant.Warning,
8315
- message: MESSAGES.progressNoGoal,
8316
- currenText: MESSAGES.currentTextResult,
8317
- currentTextInit: MESSAGES.currentTextInit
8314
+ currentVariant: CurrentVariant?.Warning,
8315
+ message: MESSAGES?.progressNoGoal,
8316
+ currenText: MESSAGES?.currentTextResult,
8317
+ currentTextInit: MESSAGES?.currentTextInit
8318
8318
  };
8319
8319
  }, []);
8320
- const isGoalExceeded = React.useMemo(() => positions.currentVariant == CurrentVariant.Star, [positions]);
8320
+ const isGoalExceeded = React.useMemo(() => positions?.currentVariant == CurrentVariant?.Star, [positions]);
8321
8321
  return {
8322
8322
  progressPercentage,
8323
8323
  currentValue,
@@ -8499,7 +8499,7 @@ const ProgressGoalBar = ({ start, current, goal, isVisibleMessage = true }) => {
8499
8499
  current,
8500
8500
  goal
8501
8501
  });
8502
- return (jsxRuntime.jsxs(WrapperProgressGoalBar, { children: [isVisibleMessage && jsxRuntime.jsx(TextUP, { children: positions.message }), jsxRuntime.jsxs(ProgressGoalBarContainer, { children: [jsxRuntime.jsx(StartIndicator, { position: positions.start, children: jsxRuntime.jsx(LocalizationIcon, {}) }), jsxRuntime.jsx(IndicatorText, { noResult: noResult, position: positions.start, isGoalReached: isGoalReached, isGoalExceeded: isGoalExceeded, resultEvolved: resultEvolved, start: positions.start, children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Number$1, { children: start }), jsxRuntime.jsx(TypeProgressText, { children: noResult ? positions.currenText : positions.currentTextInit })] }) }), !isGoalReached && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(CurrentIndicator, { status: positions.currentVariant, position: positions.current, children: isGoalExceeded ? jsxRuntime.jsx(StarIcon$1, { color: 'white', width: 14, height: 13 }) : jsxRuntime.jsx(ExclamationIcon, {}) }), jsxRuntime.jsx(IndicatorTextCurrent, { position: positions.current, noGoal: noGoal, noResult: noResult, children: !noResult && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Number$1, { children: current }), jsxRuntime.jsx(TypeProgressText, { children: positions.currenText })] })) })] })), jsxRuntime.jsx(EndIndicator, { position: positions.goal, isGoalExceeded: isGoalExceeded, isGoalReached: isGoalReached, children: jsxRuntime.jsx(GoalIcon, {}) }), jsxRuntime.jsxs(IndicatorText, { position: positions.goal, children: [jsxRuntime.jsx(Number$1, { children: goal }), jsxRuntime.jsx(TypeProgressText, { children: "META" })] }), jsxRuntime.jsx(ProgressBarColor, { isGoalExceeded: isGoalExceeded, width: positions[positions.barRef], hasRegressed: noGoal })] })] }));
8502
+ return (jsxRuntime.jsxs(WrapperProgressGoalBar, { children: [isVisibleMessage && jsxRuntime.jsx(TextUP, { children: positions?.message }), jsxRuntime.jsxs(ProgressGoalBarContainer, { children: [jsxRuntime.jsx(StartIndicator, { position: positions?.start, children: jsxRuntime.jsx(LocalizationIcon, {}) }), jsxRuntime.jsx(IndicatorText, { noResult: noResult, position: positions?.start, isGoalReached: isGoalReached, isGoalExceeded: isGoalExceeded, resultEvolved: resultEvolved, start: positions?.start, children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Number$1, { children: start }), jsxRuntime.jsx(TypeProgressText, { children: noResult ? positions?.currenText : positions?.currentTextInit })] }) }), !isGoalReached && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(CurrentIndicator, { status: positions?.currentVariant, position: positions?.current, children: isGoalExceeded ? jsxRuntime.jsx(StarIcon$1, { color: 'white', width: 14, height: 13 }) : jsxRuntime.jsx(ExclamationIcon, {}) }), jsxRuntime.jsx(IndicatorTextCurrent, { position: positions.current, noGoal: noGoal, noResult: noResult, children: !noResult && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Number$1, { children: current }), jsxRuntime.jsx(TypeProgressText, { children: positions?.currenText })] })) })] })), jsxRuntime.jsx(EndIndicator, { position: positions.goal, isGoalExceeded: isGoalExceeded, isGoalReached: isGoalReached, children: jsxRuntime.jsx(GoalIcon, {}) }), jsxRuntime.jsxs(IndicatorText, { position: positions?.goal, children: [jsxRuntime.jsx(Number$1, { children: goal }), jsxRuntime.jsx(TypeProgressText, { children: "META" })] }), jsxRuntime.jsx(ProgressBarColor, { isGoalExceeded: isGoalExceeded, width: positions[positions?.barRef], hasRegressed: noGoal })] })] }));
8503
8503
  };
8504
8504
 
8505
8505
  const ModalContainer = styled__default["default"].div `
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "frst-components",
3
3
  "homepage": "http://FRST-Falconi.github.io/storybook.frstfalconi.com",
4
- "version": "0.25.00",
4
+ "version": "0.25.02",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",