@embeddable.com/remarkable-ui 2.0.16 → 2.0.18

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.
@@ -203,6 +203,14 @@
203
203
  align-items: center;
204
204
  gap: var(--rdp-dropdown-gap);
205
205
  }
206
+
207
+ .rdp-dropdowns span {
208
+ color: var(--em-daterangepicker-label-color, #212129);
209
+ font-family: var(--em-daterangepicker-label-font-family, sans-serif);
210
+ font-size: var(--em-daterangepicker-label-font-size, 0.875rem);
211
+ font-weight: var(--em-daterangepicker-label-font-weight, 500);
212
+ }
213
+
206
214
  .rdp-dropdown {
207
215
  z-index: 2;
208
216
 
@@ -24,3 +24,15 @@
24
24
  .chevron:active {
25
25
  background: var(--em-daterangepicker-chevron--active, #ededf1);
26
26
  }
27
+
28
+ .chevron.small {
29
+ background: unset;
30
+ width: calc(var(--em-daterangepicker-chevron-size, 2rem) / 2);
31
+ height: calc(var(--em-daterangepicker-chevron-size, 2rem) / 2);
32
+ padding: calc(var(--em-daterangepicker-chevron-padding, 0.5rem) / 2);
33
+ }
34
+
35
+ .chevron.small svg {
36
+ width: calc(var(--em-daterangepicker-chevron-icon-size, 1rem) / 2);
37
+ height: calc(var(--em-daterangepicker-chevron-icon-size, 1rem) / 2);
38
+ }
package/dist/index.d.ts CHANGED
@@ -472,11 +472,13 @@ type UseTableGetRowsPerPageProps = {
472
472
  };
473
473
  declare const useTableGetRowsPerPage: ({ availableHeight, headerHeight, rowHeight, footerHeight, }: UseTableGetRowsPerPageProps) => number;
474
474
 
475
- declare const getTableTotalPages: (total: number | undefined, pageSize: number) => number | undefined;
476
-
477
475
  declare const getChartColors: () => string[];
478
476
  declare const getChartContrastColors: () => string[];
479
477
 
478
+ type TablePaginationProps = Pick<TablePaginatedProps<unknown>, 'page' | 'pageSize' | 'paginationLabel' | 'total' | 'onPageChange'>;
479
+ declare const getTableTotalPages: (total: number | undefined, pageSize: number) => number | undefined;
480
+ declare const TablePagination: FC<TablePaginationProps>;
481
+
480
482
  declare const getChartjsAxisOptionsPlugins: () => Partial<ChartOptions["plugins"]>;
481
483
  declare const getChartjsAxisOptionsScalesTicksDefault: () => Partial<CartesianTickOptions>;
482
484
  declare const getChartjsAxisOptionsScalesTicksMuted: () => Partial<CartesianTickOptions>;
@@ -494,6 +496,8 @@ declare const isSameDate: (a?: Date, b?: Date) => boolean;
494
496
  declare const isSameDateRange: (a?: DateRange, b?: DateRange) => boolean;
495
497
  declare const endOfDayUTC: (date: Date) => Date;
496
498
 
499
+ declare const shallowEqual: (object1: any, object2: any) => boolean;
500
+
497
501
  declare function useDebounce<T extends (...args: any[]) => void>(fn: T, delay?: number): (...args: Parameters<T>) => void;
498
502
 
499
503
  type Size = {
@@ -502,4 +506,4 @@ type Size = {
502
506
  };
503
507
  declare const useResizeObserver: <T extends HTMLElement>(elRef: React.RefObject<T | null>, timeout?: number) => Size;
504
508
 
505
- export { ActionIcon, BarChart, type BarChartProps, Button, ButtonIcon, Card, CardContent, CardFeedback, CardHeader, type CssSize, DateRangePicker, DateRangePickerField, type DateRangePickerProps, DonutChart, type DonutLabelChartProps, Dropdown, type DropdownProps, FieldFeedback, type FieldFeedbackProps, FieldHeader, type FieldHeaderProps, GhostButton, HeatMap, type HeatMapProps, type HeatMapPropsDimension, type HeatMapPropsMeasure, type HeatMapPropsThreshold, KpiChart, LineChart, type LineChartProps, MultiSelectField, type MultiSelectFieldProps, NumberField, Overlay, PieChart, type PieChartProps, PivotTable, type PivotTableProps, type PivotTablePropsColumnDimension, type PivotTablePropsMeasure, type PivotTablePropsRowDimension, SelectFieldCategory, SelectFieldContent, SelectFieldContentList, SelectFieldTrigger, SelectListOption, type SelectListOptionProps, type SelectListOptionPropsWithCategory, SingleSelectField, type SingleSelectFieldProps, Skeleton, StylesKeys, Switch, TableHeaderAlign, type TableHeaderCell, type TableHeaderItem, type TableHeaderItemAlign, TablePaginated, type TablePaginatedProps, type TableSort, TableSortDirection, TextField, Typography, chartjsAxisOptionsLayoutPadding, endOfDayUTC, getBarChartData, getBarChartOptions, getChartColors, getChartContrastColors, getChartjsAxisOptions, getChartjsAxisOptionsPlugins, getChartjsAxisOptionsScales, getChartjsAxisOptionsScalesGrid, getChartjsAxisOptionsScalesGridColor, getChartjsAxisOptionsScalesTicksDefault, getChartjsAxisOptionsScalesTicksMuted, getChartjsAxisOptionsScalesTitle, getDonutChartOptions, getLineChartData, getLineChartOptions, getPieChartData, getPieChartOptions, getStyle, getStyleNumber, getTableTotalPages, isSameDate, isSameDateRange, useDebounce, useResizeObserver, useTableGetRowsPerPage };
509
+ export { ActionIcon, BarChart, type BarChartProps, Button, ButtonIcon, Card, CardContent, CardFeedback, CardHeader, type CssSize, DateRangePicker, DateRangePickerField, type DateRangePickerProps, DonutChart, type DonutLabelChartProps, Dropdown, type DropdownProps, FieldFeedback, type FieldFeedbackProps, FieldHeader, type FieldHeaderProps, GhostButton, HeatMap, type HeatMapProps, type HeatMapPropsDimension, type HeatMapPropsMeasure, type HeatMapPropsThreshold, KpiChart, LineChart, type LineChartProps, MultiSelectField, type MultiSelectFieldProps, NumberField, Overlay, PieChart, type PieChartProps, PivotTable, type PivotTableProps, type PivotTablePropsColumnDimension, type PivotTablePropsMeasure, type PivotTablePropsRowDimension, SelectFieldCategory, SelectFieldContent, SelectFieldContentList, SelectFieldTrigger, SelectListOption, type SelectListOptionProps, type SelectListOptionPropsWithCategory, SingleSelectField, type SingleSelectFieldProps, Skeleton, StylesKeys, Switch, TableHeaderAlign, type TableHeaderCell, type TableHeaderItem, type TableHeaderItemAlign, TablePaginated, type TablePaginatedProps, TablePagination, type TablePaginationProps, type TableSort, TableSortDirection, TextField, Typography, chartjsAxisOptionsLayoutPadding, endOfDayUTC, getBarChartData, getBarChartOptions, getChartColors, getChartContrastColors, getChartjsAxisOptions, getChartjsAxisOptionsPlugins, getChartjsAxisOptionsScales, getChartjsAxisOptionsScalesGrid, getChartjsAxisOptionsScalesGridColor, getChartjsAxisOptionsScalesTicksDefault, getChartjsAxisOptionsScalesTicksMuted, getChartjsAxisOptionsScalesTitle, getDonutChartOptions, getLineChartData, getLineChartOptions, getPieChartData, getPieChartOptions, getStyle, getStyleNumber, getTableTotalPages, isSameDate, isSameDateRange, shallowEqual, useDebounce, useResizeObserver, useTableGetRowsPerPage };
package/dist/index.js CHANGED
@@ -860,20 +860,24 @@ NumberField.displayName = "NumberField";
860
860
  // src/components/editors/dates/DateRangePicker/DateRangePicker.tsx
861
861
  import { useState as useState3 } from "react";
862
862
  import { DayPicker } from "react-day-picker";
863
- import "./DateRangePicker-E7WV7TPK.css";
863
+ import "./DateRangePicker-PLOUUN7Q.css";
864
864
 
865
865
  // src/components/editors/dates/DateRangePicker/DateRangePickerChevron.tsx
866
866
  import { IconCaretDownFilled as IconCaretDownFilled2 } from "@tabler/icons-react";
867
- import styles21 from "./DateRangePickerChevron.module-DWIFI5J2.module.css";
867
+ import styles21 from "./DateRangePickerChevron.module-XDPDMPIS.module.css";
868
+ import clsx16 from "clsx";
868
869
  import { jsx as jsx23 } from "react/jsx-runtime";
870
+ var SMALL_SIZE = 18;
869
871
  var DateRangePickerChevron = ({
870
- orientation
872
+ orientation,
873
+ size
871
874
  }) => {
872
875
  const rotation = orientation === "left" ? "rotate(90deg)" : orientation === "right" ? "rotate(-90deg)" : void 0;
876
+ const isSmallChevron = size === SMALL_SIZE;
873
877
  return /* @__PURE__ */ jsx23(
874
878
  "button",
875
879
  {
876
- className: styles21.chevron,
880
+ className: clsx16(styles21.chevron, isSmallChevron && styles21.small),
877
881
  style: {
878
882
  transform: rotation
879
883
  },
@@ -907,6 +911,8 @@ var DateRangePicker = ({
907
911
  }
908
912
  onChange(range);
909
913
  };
914
+ const now = /* @__PURE__ */ new Date();
915
+ const endMonth = new Date(now.getFullYear() + 2, now.getMonth());
910
916
  return /* @__PURE__ */ jsx24(
911
917
  DayPicker,
912
918
  {
@@ -920,7 +926,10 @@ var DateRangePicker = ({
920
926
  onSelect: handleChange,
921
927
  selected: value,
922
928
  timeZone: "UTC",
923
- showOutsideDays: true
929
+ showOutsideDays: true,
930
+ captionLayout: "dropdown-years",
931
+ endMonth,
932
+ animate: true
924
933
  }
925
934
  );
926
935
  };
@@ -930,8 +939,8 @@ import { useState as useState4 } from "react";
930
939
  import styles22 from "./DateRangePickerField.module-CURG3KIS.module.css";
931
940
  import { jsx as jsx25, jsxs as jsxs14 } from "react/jsx-runtime";
932
941
  var getDateRangePickerLabel = (dateRange, displayValue) => {
933
- if (dateRange === void 0) return void 0;
934
- if (displayValue) return displayValue;
942
+ if (!dateRange) return void 0;
943
+ if (displayValue || displayValue === "") return displayValue;
935
944
  const { from, to } = dateRange;
936
945
  if (!from || !to) return void 0;
937
946
  return `${from ? from.toLocaleDateString() : ""} - ${to ? to.toLocaleDateString() : ""}`;
@@ -1635,7 +1644,7 @@ import styles26 from "./KpiChart.module-2LUIN66C.module.css";
1635
1644
 
1636
1645
  // src/components/charts/kpis/components/KpiChartChange.tsx
1637
1646
  import styles25 from "./KpiChartChange.module-BAW7YCOW.module.css";
1638
- import clsx16 from "clsx";
1647
+ import clsx17 from "clsx";
1639
1648
  import { IconTrendingDown, IconTrendingUp } from "@tabler/icons-react";
1640
1649
  import { Fragment as Fragment4, jsx as jsx28, jsxs as jsxs15 } from "react/jsx-runtime";
1641
1650
  var getChangeClass = (isPositive, invertChangeColors) => {
@@ -1667,11 +1676,11 @@ var KpiChartChange = ({
1667
1676
  const Icon = isPositive ? IconTrendingUp : IconTrendingDown;
1668
1677
  const showNoPreviousData = showChangeAsPercentage && Number(comparisonValue) === 0;
1669
1678
  return /* @__PURE__ */ jsxs15("div", { className: styles25.kpiChangeContainerSizeGuide, children: [
1670
- /* @__PURE__ */ jsxs15("div", { className: clsx16(styles25.kpiChartChangeContainer, styles25.hidden), children: [
1679
+ /* @__PURE__ */ jsxs15("div", { className: clsx17(styles25.kpiChartChangeContainer, styles25.hidden), children: [
1671
1680
  /* @__PURE__ */ jsxs15(
1672
1681
  "span",
1673
1682
  {
1674
- className: clsx16(styles25.kpiChangeBadge, getChangeClass(isPositive, invertChangeColors)),
1683
+ className: clsx17(styles25.kpiChangeBadge, getChangeClass(isPositive, invertChangeColors)),
1675
1684
  children: [
1676
1685
  /* @__PURE__ */ jsx28(Icon, {}),
1677
1686
  /* @__PURE__ */ jsx28("span", { children: displayValue })
@@ -1684,7 +1693,7 @@ var KpiChartChange = ({
1684
1693
  !equalComparison && /* @__PURE__ */ jsxs15(
1685
1694
  "span",
1686
1695
  {
1687
- className: clsx16(
1696
+ className: clsx17(
1688
1697
  styles25.kpiChangeBadge,
1689
1698
  getChangeClass(isPositive, invertChangeColors)
1690
1699
  ),
@@ -1958,7 +1967,7 @@ var PieChart = ({
1958
1967
  // src/components/charts/tables/Table/TablePaginated.tsx
1959
1968
  import * as React3 from "react";
1960
1969
  import styles32 from "./tables.module-GNDYDW3Z.module.css";
1961
- import clsx19 from "clsx";
1970
+ import clsx20 from "clsx";
1962
1971
 
1963
1972
  // src/components/charts/tables/Table/components/TablePagination/TablePagination.tsx
1964
1973
  import {
@@ -2056,7 +2065,7 @@ var TableHeaderAlign = {
2056
2065
 
2057
2066
  // src/components/charts/tables/Table/components/TableHeader/TableHeader.tsx
2058
2067
  import tableStyles from "./tables.module-GNDYDW3Z.module.css";
2059
- import clsx17 from "clsx";
2068
+ import clsx18 from "clsx";
2060
2069
  import { jsx as jsx34, jsxs as jsxs18 } from "react/jsx-runtime";
2061
2070
  var getHeaderAriaSort = (sort, header) => {
2062
2071
  return sort?.id === header.id ? sort.direction === "asc" ? "ascending" : "descending" : "none";
@@ -2098,7 +2107,7 @@ var TableHeader = ({
2098
2107
  }
2099
2108
  };
2100
2109
  return /* @__PURE__ */ jsx34("thead", { className: styles30.tableHeader, children: /* @__PURE__ */ jsxs18("tr", { children: [
2101
- showIndex && /* @__PURE__ */ jsx34("th", { className: clsx17(tableStyles.mutedCell, tableStyles.stickyFirstColumn), children: "#" }),
2110
+ showIndex && /* @__PURE__ */ jsx34("th", { className: clsx18(tableStyles.mutedCell, tableStyles.stickyFirstColumn), children: "#" }),
2102
2111
  headers.map((header) => /* @__PURE__ */ jsx34(
2103
2112
  "th",
2104
2113
  {
@@ -2125,7 +2134,7 @@ var TableHeader = ({
2125
2134
 
2126
2135
  // src/components/charts/tables/Table/components/TableBody/TableBody.tsx
2127
2136
  import styles31 from "./TableBody.module-ARNVVKDL.module.css";
2128
- import clsx18 from "clsx";
2137
+ import clsx19 from "clsx";
2129
2138
  import { IconCopy, IconCopyCheckFilled } from "@tabler/icons-react";
2130
2139
  import { useState as useState6 } from "react";
2131
2140
  import tableStyles2 from "./tables.module-GNDYDW3Z.module.css";
@@ -2142,9 +2151,9 @@ var TableBody = ({
2142
2151
  "tr",
2143
2152
  {
2144
2153
  onClick: () => onRowIndexClick?.(rowIndex),
2145
- className: clsx18(rowIndex === rows.length - 1 && tableStyles2.tableLastRow),
2154
+ className: clsx19(rowIndex === rows.length - 1 && tableStyles2.tableLastRow),
2146
2155
  children: [
2147
- showIndex && /* @__PURE__ */ jsx35("td", { className: clsx18(tableStyles2.mutedCell, tableStyles2.stickyFirstColumn), children: pageSize * page + rowIndex + 1 }),
2156
+ showIndex && /* @__PURE__ */ jsx35("td", { className: clsx19(tableStyles2.mutedCell, tableStyles2.stickyFirstColumn), children: pageSize * page + rowIndex + 1 }),
2148
2157
  headers.map((header, cellIndex) => /* @__PURE__ */ jsx35(
2149
2158
  TableBodyCell,
2150
2159
  {
@@ -2188,7 +2197,7 @@ var TableBodyCell = ({ header, row, rowIndex, cellIndex }) => {
2188
2197
  title: `Copy: ${String(value)}`,
2189
2198
  onMouseDown: handleCopy,
2190
2199
  icon: isPressedCopy ? IconCopyCheckFilled : IconCopy,
2191
- className: clsx18(
2200
+ className: clsx19(
2192
2201
  styles31.copyButton,
2193
2202
  header.align === TableHeaderAlign.RIGHT && styles31.leftAlign
2194
2203
  ),
@@ -2221,7 +2230,7 @@ var TablePaginated = React3.forwardRef(
2221
2230
  onPageChange,
2222
2231
  onSortChange
2223
2232
  } = props;
2224
- return /* @__PURE__ */ jsxs20("div", { ref, className: clsx19(styles32.tableContainer, className), children: [
2233
+ return /* @__PURE__ */ jsxs20("div", { ref, className: clsx20(styles32.tableContainer, className), children: [
2225
2234
  /* @__PURE__ */ jsx36("div", { className: styles32.tableContainerScroll, children: /* @__PURE__ */ jsxs20("table", { className: styles32.table, children: [
2226
2235
  /* @__PURE__ */ jsx36(
2227
2236
  TableHeader,
@@ -2262,7 +2271,7 @@ TablePaginated.displayName = "TablePaginated";
2262
2271
  // src/components/charts/tables/PivotTable/PivotTable.tsx
2263
2272
  import { useEffect as useEffect6, useMemo as useMemo3, useState as useState7 } from "react";
2264
2273
  import tableStyles3 from "./tables.module-GNDYDW3Z.module.css";
2265
- import clsx20 from "clsx";
2274
+ import clsx21 from "clsx";
2266
2275
 
2267
2276
  // src/components/charts/tables/tables.utils.ts
2268
2277
  var getTableCellWidthStyle = (width) => {
@@ -2393,10 +2402,10 @@ var PivotTable = ({
2393
2402
  };
2394
2403
  }, [progressive, batchSize, batchDelayMs, rowValues.length, data]);
2395
2404
  const visibleRows = progressive ? rowValues.slice(0, visibleCount) : rowValues;
2396
- return /* @__PURE__ */ jsx37("div", { className: clsx20(tableStyles3.tableFullContainer, className), children: /* @__PURE__ */ jsx37(
2405
+ return /* @__PURE__ */ jsx37("div", { className: clsx21(tableStyles3.tableFullContainer, className), children: /* @__PURE__ */ jsx37(
2397
2406
  "div",
2398
2407
  {
2399
- className: clsx20(
2408
+ className: clsx21(
2400
2409
  tableStyles3.tableAdjustedContainer,
2401
2410
  (!columnWidth || !firstColumnWidth) && tableStyles3.fullWidth
2402
2411
  ),
@@ -2538,7 +2547,7 @@ var PivotTable = ({
2538
2547
  "th",
2539
2548
  {
2540
2549
  scope: "row",
2541
- className: clsx20(tableStyles3.stickyFirstColumn, tableStyles3.boltCell),
2550
+ className: clsx21(tableStyles3.stickyFirstColumn, tableStyles3.boltCell),
2542
2551
  title: totalLabel,
2543
2552
  children: totalLabel
2544
2553
  }
@@ -2590,7 +2599,7 @@ var PivotTable = ({
2590
2599
  // src/components/charts/tables/HeatMap/HeatMap.tsx
2591
2600
  import { useMemo as useMemo4, useCallback } from "react";
2592
2601
  import tableStyles4 from "./tables.module-GNDYDW3Z.module.css";
2593
- import clsx21 from "clsx";
2602
+ import clsx22 from "clsx";
2594
2603
 
2595
2604
  // src/components/charts/tables/HeatMap/HeatMap.utils.ts
2596
2605
  var clamp01 = (x) => x < 0 ? 0 : x > 1 ? 1 : x;
@@ -2812,10 +2821,10 @@ var HeatMap = ({
2812
2821
  },
2813
2822
  [domainMin, domainMax, rawMin, rawMax, minColor, midColor, maxColor]
2814
2823
  );
2815
- return /* @__PURE__ */ jsx38("div", { className: clsx21(tableStyles4.tableFullContainer, className), children: /* @__PURE__ */ jsx38(
2824
+ return /* @__PURE__ */ jsx38("div", { className: clsx22(tableStyles4.tableFullContainer, className), children: /* @__PURE__ */ jsx38(
2816
2825
  "div",
2817
2826
  {
2818
- className: clsx21(
2827
+ className: clsx22(
2819
2828
  tableStyles4.tableAdjustedContainer,
2820
2829
  (!columnWidth || !firstColumnWidth) && tableStyles4.fullWidth
2821
2830
  ),
@@ -2881,6 +2890,21 @@ var useTableGetRowsPerPage = ({
2881
2890
  return Math.max(0, rows);
2882
2891
  }, [availableHeight, headerHeight, rowHeight, footerHeight]);
2883
2892
 
2893
+ // src/utils/object.utils.ts
2894
+ var shallowEqual = (object1, object2) => {
2895
+ const keys1 = Object.keys(object1 ?? {});
2896
+ const keys2 = Object.keys(object2 ?? {});
2897
+ if (keys1.length !== keys2.length) {
2898
+ return false;
2899
+ }
2900
+ for (const key of keys1) {
2901
+ if (object1[key]?.toString() !== object2[key]?.toString()) {
2902
+ return false;
2903
+ }
2904
+ }
2905
+ return true;
2906
+ };
2907
+
2884
2908
  // src/hooks/useDebounce.hook.ts
2885
2909
  import { useRef as useRef9, useEffect as useEffect7, useCallback as useCallback2 } from "react";
2886
2910
  function useDebounce(fn, delay = 300) {
@@ -2941,6 +2965,7 @@ export {
2941
2965
  Switch,
2942
2966
  TableHeaderAlign,
2943
2967
  TablePaginated,
2968
+ TablePagination,
2944
2969
  TableSortDirection,
2945
2970
  TextField,
2946
2971
  Typography,
@@ -2968,6 +2993,7 @@ export {
2968
2993
  getTableTotalPages,
2969
2994
  isSameDate,
2970
2995
  isSameDateRange,
2996
+ shallowEqual,
2971
2997
  styles,
2972
2998
  useDebounce,
2973
2999
  useResizeObserver,