@northlight/ui 2.35.2 → 2.35.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.
@@ -7264,6 +7264,44 @@
7264
7264
  },
7265
7265
  label: "Year to Date"
7266
7266
  };
7267
+ const S1 = {
7268
+ value: {
7269
+ start: startOfMonthWithDays(
7270
+ date.startOfYear(thisDay).subtract({ years: offsetFiscalYear }),
7271
+ {
7272
+ months: fiscalStartMonth,
7273
+ days: fiscalStartDay
7274
+ }
7275
+ ),
7276
+ end: endOfMonthWithDays(
7277
+ date.startOfYear(thisDay).subtract({ years: offsetFiscalYear }),
7278
+ {
7279
+ months: fiscalStartMonth + 6,
7280
+ days: fiscalStartDay
7281
+ }
7282
+ )
7283
+ },
7284
+ label: fiscalStartMonth === 0 ? "S1" : "FS1"
7285
+ };
7286
+ const S2 = {
7287
+ value: {
7288
+ start: startOfMonthWithDays(
7289
+ date.startOfYear(thisDay).subtract({ years: offsetFiscalYear }),
7290
+ {
7291
+ months: fiscalStartMonth + 6,
7292
+ days: fiscalStartDay
7293
+ }
7294
+ ),
7295
+ end: endOfMonthWithDays(
7296
+ date.startOfYear(thisDay).subtract({ years: offsetFiscalYear }),
7297
+ {
7298
+ months: fiscalStartMonth + 12,
7299
+ days: fiscalStartDay
7300
+ }
7301
+ )
7302
+ },
7303
+ label: fiscalStartMonth === 0 ? "S2" : "FS2"
7304
+ };
7267
7305
  const F1 = {
7268
7306
  value: {
7269
7307
  start: startOfMonthWithDays(
@@ -7340,6 +7378,7 @@
7340
7378
  },
7341
7379
  label: fiscalStartMonth === 0 ? "Q4" : "FQ4"
7342
7380
  };
7381
+ const fiscalSemesters = [S1, S2];
7343
7382
  const fiscalQuarters = [F1, F2, F3, F4];
7344
7383
  const fiscalYears = fiscalStartMonth === 0 ? [] : [thisFiscalYear, lastFiscalYear];
7345
7384
  const quickDates = [
@@ -7357,7 +7396,7 @@
7357
7396
  nextYear,
7358
7397
  ...fiscalYears
7359
7398
  ];
7360
- return { quickDates, fiscalQuarters };
7399
+ return { quickDates, fiscalQuarters, fiscalSemesters };
7361
7400
  };
7362
7401
 
7363
7402
  const seperator = `1px solid ${tokens.palette.gray["100"]}`;
@@ -7368,7 +7407,7 @@
7368
7407
  locale = "",
7369
7408
  height = "17.5rem"
7370
7409
  }) => {
7371
- const { quickDates, fiscalQuarters } = React.useMemo(
7410
+ const { quickDates, fiscalQuarters, fiscalSemesters } = React.useMemo(
7372
7411
  () => getQuickSelectOptions(state, locale, fiscalStartMonth, fiscalStartDay),
7373
7412
  []
7374
7413
  );
@@ -7411,10 +7450,31 @@
7411
7450
  ), /* @__PURE__ */ React.createElement(react.Spacer, null), /* @__PURE__ */ React.createElement(
7412
7451
  react.Flex,
7413
7452
  {
7414
- justifyContent: "space-between",
7453
+ justifyContent: "space-around",
7415
7454
  w: "full",
7416
7455
  pt: "2",
7417
7456
  pr: "4",
7457
+ display: shouldShow(fiscalSemesters) ? "flex" : "none"
7458
+ },
7459
+ ramda.map(
7460
+ (semester) => validRange(semester.value, state) && /* @__PURE__ */ React.createElement(
7461
+ DateButton,
7462
+ {
7463
+ onClick: updateDate(semester.value),
7464
+ isActive: getIsActive(semester),
7465
+ key: `quick-select-${semester.label}`
7466
+ },
7467
+ semester.label
7468
+ ),
7469
+ fiscalSemesters
7470
+ )
7471
+ ), /* @__PURE__ */ React.createElement(
7472
+ react.Flex,
7473
+ {
7474
+ justifyContent: "space-around",
7475
+ w: "full",
7476
+ pt: shouldShow(fiscalSemesters) ? "0" : "2",
7477
+ pr: "4",
7418
7478
  display: shouldShow(fiscalQuarters) ? "flex" : "none"
7419
7479
  },
7420
7480
  ramda.map(