@sproutsocial/seeds-react-data-viz 0.1.1 → 0.2.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/dist/esm/index.js CHANGED
@@ -4570,6 +4570,7 @@ var PartnerLogo = ({
4570
4570
  const logo = whichLogo({ backgroundType, logoType, partnerName }, mode);
4571
4571
  const logoViewBox = ViewBoxes[logo];
4572
4572
  const viewBoxCoordinates = logoViewBox?.split(" ") || [];
4573
+ const defaultSize = logoType === "symbol" ? "small" : void 0;
4573
4574
  const defaultWidth = viewBoxCoordinates[2];
4574
4575
  const defaultHeight = viewBoxCoordinates[3];
4575
4576
  return /* @__PURE__ */ jsx9(
@@ -4577,7 +4578,7 @@ var PartnerLogo = ({
4577
4578
  {
4578
4579
  height: height2 ? height2 : defaultHeight + "px",
4579
4580
  width: width2 ? width2 : defaultWidth + "px",
4580
- logoSize: size2,
4581
+ logoSize: size2 ?? defaultSize,
4581
4582
  className: "logo",
4582
4583
  role: "img",
4583
4584
  "aria-label": ariaLabel,
@@ -5128,7 +5129,9 @@ var xAxisLabelFormatter = ({
5128
5129
  textLocale,
5129
5130
  tickPositions = [],
5130
5131
  unitName,
5131
- value
5132
+ value,
5133
+ // optional
5134
+ timeFormat = "12"
5132
5135
  }) => {
5133
5136
  const tickIndex = tickPositions.indexOf(value);
5134
5137
  const isFirst = tickIndex === 0;
@@ -5139,7 +5142,7 @@ var xAxisLabelFormatter = ({
5139
5142
  let secondPartOptions = {};
5140
5143
  switch (unitName) {
5141
5144
  case "hour":
5142
- firstPartOptions = { hour: "numeric" };
5145
+ firstPartOptions = timeFormat === "24" ? { hour: "numeric", minute: "numeric", hour12: false } : { hour: "numeric" };
5143
5146
  if (isFirst || valueDate.getUTCDate() !== previousValueDate.getUTCDate()) {
5144
5147
  secondPartOptions = { day: "numeric", month: "short" };
5145
5148
  }
@@ -5330,7 +5333,8 @@ var useTimeSeriesChartOptions = ({
5330
5333
  currency = "USD",
5331
5334
  numberFormat = "decimal",
5332
5335
  yAxisLabelFormatter: yAxisLabelFormatter2,
5333
- onClick
5336
+ onClick,
5337
+ timeFormat = "12"
5334
5338
  }) => {
5335
5339
  const [options, setOptions] = useState2(
5336
5340
  seriesType === "areaspline" ? areaChartOptions : lineChartOptions
@@ -5392,6 +5396,7 @@ var useTimeSeriesChartOptions = ({
5392
5396
  return xAxisLabelFormatter({
5393
5397
  textLocale,
5394
5398
  tickPositions: this.axis.tickPositions || [],
5399
+ timeFormat,
5395
5400
  unitName: this.tickPositionInfo.unitName,
5396
5401
  value: this.value
5397
5402
  });
@@ -5424,6 +5429,7 @@ var useTimeSeriesChartOptions = ({
5424
5429
  onClick,
5425
5430
  seriesType,
5426
5431
  textLocale,
5432
+ timeFormat,
5427
5433
  yAxisLabelFormatter2
5428
5434
  ]);
5429
5435
  return { options, chart, callback };
@@ -5582,7 +5588,8 @@ var AreaChartWithData = memo13(function AreaChartWithData2({
5582
5588
  tooltip,
5583
5589
  yAxisLabelFormatter: yAxisLabelFormatter2,
5584
5590
  onClick,
5585
- tooltipClickLabel
5591
+ tooltipClickLabel,
5592
+ timeFormat = "12"
5586
5593
  }) {
5587
5594
  const { options, chart, callback } = useTimeSeriesChartOptions({
5588
5595
  currency,
@@ -5592,7 +5599,8 @@ var AreaChartWithData = memo13(function AreaChartWithData2({
5592
5599
  seriesType: "areaspline",
5593
5600
  textLocale,
5594
5601
  yAxisLabelFormatter: yAxisLabelFormatter2,
5595
- onClick
5602
+ onClick,
5603
+ timeFormat
5596
5604
  });
5597
5605
  const colors3 = data.map(
5598
5606
  (series, index) => series.styles?.color ?? theme_default.colors.DATAVIZ_COLORS_LIST[index]
@@ -6030,7 +6038,8 @@ var LineChartWithData = memo20(function LineChartWithData2({
6030
6038
  tooltip,
6031
6039
  yAxisLabelFormatter: yAxisLabelFormatter2,
6032
6040
  onClick,
6033
- tooltipClickLabel
6041
+ tooltipClickLabel,
6042
+ timeFormat = "12"
6034
6043
  }) {
6035
6044
  const { options, chart, callback } = useTimeSeriesChartOptions({
6036
6045
  currency,
@@ -6040,7 +6049,8 @@ var LineChartWithData = memo20(function LineChartWithData2({
6040
6049
  seriesType: "spline",
6041
6050
  textLocale,
6042
6051
  yAxisLabelFormatter: yAxisLabelFormatter2,
6043
- onClick
6052
+ onClick,
6053
+ timeFormat
6044
6054
  });
6045
6055
  const { colors: colors3, patterns } = data.reduce(
6046
6056
  (acc, item, index) => {