@adsgency_npm/adsgency-ads-ui 0.1.0-alpha.30 → 0.1.0-alpha.31

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tokens/designTokens.ts"],"sourcesContent":["export const designTokens = {\n background: \"#151619\",\n foreground: \"#fdfdfd\",\n card: \"#1b1c21\",\n cardForeground: \"#fdfdfd\",\n popover: \"#2a2b2f\",\n popoverForeground: \"#fdfdfd\",\n primary: \"#844fff\",\n primaryForeground: \"#fdfdfd\",\n secondary: \"#3f4043\",\n secondaryForeground: \"#fdfdfd\",\n muted: \"#3f4043\",\n mutedForeground: \"#7e7f81\",\n accent: \"#3f4043\",\n accentForeground: \"#fdfdfd\",\n destructive: \"#dc2626\",\n destructiveForeground: \"#ff9b9b\",\n border: \"#545558\",\n input: \"#151619\",\n ring: \"#a984ff\",\n brandSecondary: \"#af41ff\",\n brandSecondaryForeground: \"#151619\",\n brandGradientFrom: \"#6859ff\",\n brandGradientTo: \"#af41ff\",\n success: \"#008e61\",\n successForeground: \"#fdfdfd\",\n warning: \"#cd6c00\",\n warningForeground: \"#fdfdfd\",\n info: \"#844fff\",\n infoForeground: \"#fdfdfd\",\n borderMuted: \"#3f4043\",\n active: \"#422880\",\n activeForeground: \"#fdfdfd\",\n labelForeground: \"#a8a9aa\",\n icon: \"#939496\",\n iconMuted: \"#545558\",\n spacing: {\n xs: \"0.25rem\",\n sm: \"0.5rem\",\n md: \"0.75rem\",\n lg: \"1rem\",\n xl: \"1.5rem\",\n \"2xl\": \"2rem\",\n },\n radius: {\n sm: \"0.25rem\",\n md: \"0.375rem\",\n lg: \"0.5rem\",\n xl: \"0.75rem\",\n full: \"9999px\",\n },\n size: {\n controlHeight: \"2.5rem\",\n modalWidth: \"42rem\",\n sidebarWidth: \"17.5rem\",\n },\n zIndex: {\n toolbar: 30,\n overlay: 40,\n modal: 50,\n toast: 60,\n },\n} as const;\n\nexport type DesignTokens = typeof designTokens;\n"],"mappings":";;;AAAO,IAAM,eAAe;AAAA,EAC1B,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,WAAW;AAAA,EACX,qBAAqB;AAAA,EACrB,OAAO;AAAA,EACP,iBAAiB;AAAA,EACjB,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,0BAA0B;AAAA,EAC1B,mBAAmB;AAAA,EACnB,iBAAiB;AAAA,EACjB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,SAAS;AAAA,EACT,mBAAmB;AAAA,EACnB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,MAAM;AAAA,EACN,WAAW;AAAA,EACX,SAAS;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,OAAO;AAAA,EACT;AAAA,EACA,QAAQ;AAAA,IACN,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,MAAM;AAAA,EACR;AAAA,EACA,MAAM;AAAA,IACJ,eAAe;AAAA,IACf,YAAY;AAAA,IACZ,cAAc;AAAA,EAChB;AAAA,EACA,QAAQ;AAAA,IACN,SAAS;AAAA,IACT,SAAS;AAAA,IACT,OAAO;AAAA,IACP,OAAO;AAAA,EACT;AACF;","names":[]}
package/dist/index.cjs CHANGED
@@ -6011,12 +6011,28 @@ var import_recharts3 = require("recharts");
6011
6011
 
6012
6012
  // src/lib/chartTooltip.ts
6013
6013
  var ISO_TIMESTAMP_PATTERN = /^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(?:\.\d+)?(?:Z|[+-]\d{2}:?\d{2})?$/;
6014
- function formatChartTooltipLabel(label) {
6014
+ var DEFAULT_DATE_FORMAT = "YYYY-MM-DD HH:mm:ss";
6015
+ function formatChartTooltipLabel(label, dateFormat = DEFAULT_DATE_FORMAT) {
6015
6016
  if (typeof label !== "string") {
6016
6017
  return String(label ?? "");
6017
6018
  }
6018
6019
  const match = label.match(ISO_TIMESTAMP_PATTERN);
6019
- return match ? `${match[1]} ${match[2]}` : label;
6020
+ if (!match) {
6021
+ return label;
6022
+ }
6023
+ const [year, month, day] = match[1].split("-");
6024
+ const [hour, minute, second] = match[2].split(":");
6025
+ return dateFormat.replace(/YYYY|MM|DD|HH|mm|ss/g, (token) => {
6026
+ const values = {
6027
+ YYYY: year,
6028
+ MM: month,
6029
+ DD: day,
6030
+ HH: hour,
6031
+ mm: minute,
6032
+ ss: second
6033
+ };
6034
+ return values[token];
6035
+ });
6020
6036
  }
6021
6037
 
6022
6038
  // src/components/AdsSparklineChart/index.tsx
@@ -6051,6 +6067,7 @@ function AdsSparklineChart({
6051
6067
  height,
6052
6068
  plotHeight,
6053
6069
  showTooltip = true,
6070
+ tooltipDateFormat,
6054
6071
  xKey
6055
6072
  }) {
6056
6073
  const chartData = data.map((datum) => ({
@@ -6082,7 +6099,7 @@ function AdsSparklineChart({
6082
6099
  {
6083
6100
  contentStyle: tooltipContentStyle2,
6084
6101
  cursor: false,
6085
- labelFormatter: formatChartTooltipLabel
6102
+ labelFormatter: (label) => formatChartTooltipLabel(label, tooltipDateFormat)
6086
6103
  }
6087
6104
  ),
6088
6105
  /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
@@ -6269,6 +6286,7 @@ function AdsBarChart({
6269
6286
  highlightIndex,
6270
6287
  hoverColor,
6271
6288
  showTooltip = true,
6289
+ tooltipDateFormat,
6272
6290
  xAxis,
6273
6291
  xKey,
6274
6292
  yAxis
@@ -6327,7 +6345,7 @@ function AdsBarChart({
6327
6345
  {
6328
6346
  contentStyle: tooltipContentStyle3,
6329
6347
  cursor: { fill: "transparent" },
6330
- labelFormatter: formatChartTooltipLabel
6348
+ labelFormatter: (label) => formatChartTooltipLabel(label, tooltipDateFormat)
6331
6349
  }
6332
6350
  ),
6333
6351
  /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(