@northlight/ui 2.35.1 → 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(
@@ -14497,7 +14557,7 @@
14497
14557
  "max",
14498
14558
  "min"
14499
14559
  ]);
14500
- var _a2;
14560
+ var _a2, _b2, _c;
14501
14561
  const { isOpen, onToggle, onClose } = react.useDisclosure();
14502
14562
  const [inputValueState, setInputValueState] = React.useState(valueProp == null ? void 0 : valueProp.input);
14503
14563
  const [selectOptionState, setselectOptionState] = React.useState(valueProp == null ? void 0 : valueProp.option);
@@ -14559,9 +14619,10 @@
14559
14619
  onChange == null ? void 0 : onChange(getNewValue(option, input));
14560
14620
  }
14561
14621
  }, [inputValue, defaultToZeroIfEmpty]);
14622
+ const buttonWidth = (_b2 = (_a2 = buttonRef.current) == null ? void 0 : _a2.offsetWidth) != null ? _b2 : 0;
14562
14623
  return /* @__PURE__ */ React.createElement(react.InputGroup, null, /* @__PURE__ */ React.createElement(
14563
14624
  FormattedNumberInput,
14564
- __spreadValues$1({
14625
+ __spreadProps(__spreadValues$1({
14565
14626
  width: "100%",
14566
14627
  onChange: (values) => handleInputChange(values.floatValue),
14567
14628
  value: inputValue,
@@ -14573,7 +14634,9 @@
14573
14634
  readOnly: isReadOnly,
14574
14635
  min,
14575
14636
  max
14576
- }, rest)
14637
+ }, rest), {
14638
+ pr: `${buttonWidth >= 0 ? buttonWidth + 10 : 0}px`
14639
+ })
14577
14640
  ), /* @__PURE__ */ React.createElement(
14578
14641
  react.InputRightElement,
14579
14642
  {
@@ -14591,7 +14654,7 @@
14591
14654
  flexShrink: "0",
14592
14655
  height: "100%"
14593
14656
  },
14594
- (_a2 = selectOption == null ? void 0 : selectOption.label) != null ? _a2 : ""
14657
+ (_c = selectOption == null ? void 0 : selectOption.label) != null ? _c : ""
14595
14658
  )
14596
14659
  ), /* @__PURE__ */ React.createElement(react.Box, { position: "absolute", width: "100%" }, /* @__PURE__ */ React.createElement(
14597
14660
  Select,