@texturehq/edges 1.1.1 → 1.2.1

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/index.css ADDED
@@ -0,0 +1,2 @@
1
+ .mapboxgl-ctrl-attrib,.mapboxgl-ctrl-logo{display:none!important}
2
+ /*# sourceMappingURL=index.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Maps/mapbox-overrides.css"],"sourcesContent":["/* Hide Mapbox attribution */\n.mapboxgl-ctrl-attrib {\n display: none !important;\n}\n\n/* Hide Mapbox logo */\n.mapboxgl-ctrl-logo {\n display: none !important;\n}\n"],"mappings":"AACA,CAAC,qBAKD,CAAC,mBAJC,QAAS,cACX","names":[]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { I as Icon, B as BaseDataPoint, Y as YFormatType, T as TooltipData, a as IconName$2 } from './server-DkP8PI1p.cjs';
2
- export { A as ActionItem, c as ActionMenu, b as ActionMenuProps, e as AppShell, d as AppShellProps, g as Avatar, f as AvatarProps, i as Badge, h as BadgeProps, k as Card, C as CardProps, j as CardVariant, V as ChartContext, X as ChartMargin, o as CodeEditor, l as CodeEditorProps, m as CodeLanguage, n as CodeTheme, p as DateField, D as DateFieldProps, q as FileUpload, F as FileUploadProps, H as Heading, t as InteractiveMap, s as InteractiveMapProps, L as Loader, r as Logo, u as MAPBOX_THEMES, M as MapPoint, x as Meter, w as MeterProps, y as RichTextEditor, R as RichTextEditorProps, E as SegmentOption, G as SegmentedControl, z as SegmentedControlProps, N as SideNav, J as SideNavItem, K as SideNavProps, v as StaticMap, S as StaticMapProps, O as TextLink, U as TooltipSeries, Q as TopNav, P as TopNavProps, a1 as YFormatSettings, a2 as clearColorCache, a3 as createCategoryColorMap, Z as createXScale, _ as createYScale, $ as defaultMargin, a4 as getContrastingTextColor, a5 as getDefaultChartColor, a6 as getDefaultColors, a7 as getResolvedColor, a8 as getThemeCategoricalColors, a0 as getYFormatSettings, a9 as isLightColor, W as useChartContext } from './server-DkP8PI1p.cjs';
1
+ import { I as Icon, B as BaseDataPoint, Y as YFormatType, T as TooltipData, a as IconName$2 } from './server-C1hypeJ9.cjs';
2
+ export { A as ActionItem, c as ActionMenu, b as ActionMenuProps, e as AppShell, d as AppShellProps, g as Avatar, f as AvatarProps, i as Badge, h as BadgeProps, k as Card, C as CardProps, j as CardVariant, V as ChartContext, X as ChartMargin, o as CodeEditor, l as CodeEditorProps, m as CodeLanguage, n as CodeTheme, p as DateField, D as DateFieldProps, q as FileUpload, F as FileUploadProps, H as Heading, t as InteractiveMap, s as InteractiveMapProps, L as Loader, r as Logo, u as MAPBOX_THEMES, M as MapPoint, x as Meter, w as MeterProps, y as RichTextEditor, R as RichTextEditorProps, E as SegmentOption, G as SegmentedControl, z as SegmentedControlProps, N as SideNav, J as SideNavItem, K as SideNavProps, v as StaticMap, S as StaticMapProps, O as TextLink, U as TooltipSeries, Q as TopNav, P as TopNavProps, a1 as YFormatSettings, a2 as clearColorCache, a3 as createCategoryColorMap, Z as createXScale, _ as createYScale, $ as defaultMargin, a4 as getContrastingTextColor, a5 as getDefaultChartColor, a6 as getDefaultColors, a7 as getResolvedColor, a8 as getThemeCategoricalColors, a0 as getYFormatSettings, a9 as isLightColor, W as useChartContext } from './server-C1hypeJ9.cjs';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as React$1 from 'react';
5
5
  import React__default, { ComponentProps, ReactNode, ComponentType, Component, ErrorInfo } from 'react';
@@ -264,11 +264,34 @@ declare const toKA: (value: number | null | undefined, decimals?: number) => str
264
264
  */
265
265
 
266
266
  /**
267
- * Format date to string with various options
267
+ * Format date to a localized string with optional time and timezone.
268
+ *
269
+ * @param value - Date value (string, Date object, or timestamp)
270
+ * @param showTime - Whether to include time in the output (default: false)
271
+ * @param timezone - Optional timezone for display (e.g., "America/New_York")
272
+ * @returns Formatted date string or null
273
+ *
274
+ * @example
275
+ * ```typescript
276
+ * toDateString(new Date()); // "12/25/2023"
277
+ * toDateString(new Date(), true); // "12/25/2023, 3:30 PM"
278
+ * toDateString("2023-12-25T15:30:00Z", true, "America/New_York"); // "12/25/2023, 10:30 AM"
279
+ * ```
268
280
  */
269
281
  declare const toDateString: (value: string | Date | number | null | undefined, showTime?: boolean, timezone?: string) => string | null;
270
282
  /**
271
- * Format date to relative time (e.g., "2 hours ago")
283
+ * Format date to relative time (e.g., "2 hours ago", "in 3 days").
284
+ * Automatically chooses the most appropriate unit.
285
+ *
286
+ * @param value - Date value (string, Date object, or timestamp)
287
+ * @returns Relative time string or null
288
+ *
289
+ * @example
290
+ * ```typescript
291
+ * toRelativeTime(new Date(Date.now() - 3600000)); // "1 hour ago"
292
+ * toRelativeTime(new Date(Date.now() + 86400000)); // "in 1 day"
293
+ * toRelativeTime(new Date()); // "now"
294
+ * ```
272
295
  */
273
296
  declare const toRelativeTime: (value: string | Date | number | null | undefined) => string | null;
274
297
  /**
@@ -638,11 +661,32 @@ declare const toUpperCase: (text: string | null | undefined) => string;
638
661
  */
639
662
  declare const toLowerCase: (text: string | null | undefined) => string;
640
663
  /**
641
- * Convert text to sentence case
664
+ * Convert text to sentence case (first letter capitalized, rest lowercase).
665
+ *
666
+ * @param text - Text to convert
667
+ * @returns Sentence-cased text
668
+ *
669
+ * @example
670
+ * ```typescript
671
+ * toSentenceCase("HELLO WORLD"); // "Hello world"
672
+ * toSentenceCase("hello world"); // "Hello world"
673
+ * ```
642
674
  */
643
675
  declare const toSentenceCase: (text: string | null | undefined) => string;
644
676
  /**
645
- * Convert text to title case
677
+ * Convert text to title case with proper handling of articles and prepositions.
678
+ * Capitalizes the first letter of each word except common articles/prepositions
679
+ * (unless they're the first word).
680
+ *
681
+ * @param text - Text to convert
682
+ * @returns Title-cased text
683
+ *
684
+ * @example
685
+ * ```typescript
686
+ * toTitleCase("the quick brown fox"); // "The Quick Brown Fox"
687
+ * toTitleCase("war and peace"); // "War and Peace"
688
+ * toTitleCase("to be or not to be"); // "To Be or Not to Be"
689
+ * ```
646
690
  */
647
691
  declare const toTitleCase: (text: string | null | undefined) => string;
648
692
  /**
@@ -983,6 +1027,12 @@ interface AreaSeriesProps {
983
1027
  label?: string;
984
1028
  categoryColors?: Record<string, string>;
985
1029
  }
1030
+ /**
1031
+ * AreaSeries
1032
+ *
1033
+ * Chart component for rendering area charts with gradient fill.
1034
+ * Displays data as a filled area with optional line path, supporting animations and custom colors.
1035
+ */
986
1036
  declare const AreaSeries: React__default.FC<AreaSeriesProps>;
987
1037
 
988
1038
  interface BarSeriesProps {
@@ -992,6 +1042,12 @@ interface BarSeriesProps {
992
1042
  opacity?: number;
993
1043
  categoryColors?: Record<string, string>;
994
1044
  }
1045
+ /**
1046
+ * BarSeries
1047
+ *
1048
+ * Chart component for rendering bar/column charts.
1049
+ * Displays data as vertical bars with customizable colors, opacity, and category-based coloring.
1050
+ */
995
1051
  declare const BarSeries: React__default.FC<BarSeriesProps>;
996
1052
 
997
1053
  interface AxisBottomProps {
@@ -1004,6 +1060,12 @@ interface AxisLeftProps {
1004
1060
  scale: ScaleLinear<number, number>;
1005
1061
  yFormatType: YFormatType;
1006
1062
  }
1063
+ /**
1064
+ * ChartAxis
1065
+ *
1066
+ * Chart axis components for rendering X and Y axes.
1067
+ * Provides formatted bottom (time) and left (numeric) axes with customizable tick formatting.
1068
+ */
1007
1069
  declare const ChartAxis: {
1008
1070
  Bottom: React__default.FC<AxisBottomProps>;
1009
1071
  Left: React__default.FC<AxisLeftProps>;
@@ -1023,7 +1085,30 @@ interface ChartExportMetadata {
1023
1085
  timestamp?: boolean;
1024
1086
  }
1025
1087
  /**
1026
- * Main export function that handles all export types
1088
+ * Main export function that handles all chart export types.
1089
+ * Supports CSV, SVG, and PNG formats with automatic filename generation.
1090
+ *
1091
+ * @param type - Export format: "csv", "svg", or "png"
1092
+ * @param datasets - Chart data as single array or array of arrays for multi-series
1093
+ * @param metadata - Export metadata including labels and filename options
1094
+ * @param svgRef - Reference to the chart's SVG element
1095
+ * @returns Promise that resolves when export is complete
1096
+ *
1097
+ * @example
1098
+ * ```typescript
1099
+ * // Export single series as CSV
1100
+ * await exportChart("csv", data, {
1101
+ * xLabel: "Date",
1102
+ * yLabel: "Value",
1103
+ * filename: "sales-data"
1104
+ * }, svgRef);
1105
+ *
1106
+ * // Export multi-series chart as PNG
1107
+ * await exportChart("png", [series1, series2], {
1108
+ * seriesLabels: ["Revenue", "Profit"],
1109
+ * timestamp: false
1110
+ * }, svgRef);
1111
+ * ```
1027
1112
  */
1028
1113
  declare function exportChart(type: ExportType, datasets: BaseDataPoint[][] | BaseDataPoint[], metadata: ChartExportMetadata | undefined, svgRef: React__default.RefObject<SVGSVGElement>): Promise<void>;
1029
1114
  /**
@@ -1043,6 +1128,12 @@ interface ChartBottomBarProps {
1043
1128
  items: LegendItem[];
1044
1129
  onExport: (type: ExportType) => void | Promise<void>;
1045
1130
  }
1131
+ /**
1132
+ * ChartBottomBar
1133
+ *
1134
+ * Chart footer component with legend and export functionality.
1135
+ * Displays color-coded legend items and provides export options for CSV, SVG, and PNG formats.
1136
+ */
1046
1137
  declare const ChartBottomBar: React__default.FC<ChartBottomBarProps>;
1047
1138
 
1048
1139
  interface ChartContainerProps {
@@ -1052,12 +1143,24 @@ interface ChartContainerProps {
1052
1143
  yFormatType?: YFormatType;
1053
1144
  isLoading?: boolean;
1054
1145
  }
1146
+ /**
1147
+ * ChartContainer
1148
+ *
1149
+ * Main chart wrapper component that provides context and layout for chart visualizations.
1150
+ * Handles scaling, tooltips, axes, and data management for area, line, and bar charts.
1151
+ */
1055
1152
  declare const ChartContainer: React__default.FC<Omit<ChartContainerProps, "parentWidth" | "parentHeight">>;
1056
1153
 
1057
1154
  interface ChartTooltipProps {
1058
1155
  data: TooltipData | null;
1059
1156
  formatType: YFormatType;
1060
1157
  }
1158
+ /**
1159
+ * ChartTooltip
1160
+ *
1161
+ * Interactive tooltip component for charts.
1162
+ * Displays formatted data values at hover position with automatic positioning and animations.
1163
+ */
1061
1164
  declare const ChartTooltip: React__default.FC<ChartTooltipProps>;
1062
1165
 
1063
1166
  interface LineSeriesProps {
@@ -1069,6 +1172,12 @@ interface LineSeriesProps {
1069
1172
  strokeDasharray?: string;
1070
1173
  categoryColors?: Record<string, string>;
1071
1174
  }
1175
+ /**
1176
+ * LineSeries
1177
+ *
1178
+ * Chart component for rendering line charts.
1179
+ * Displays data as a continuous line with customizable stroke width, color, and dash patterns.
1180
+ */
1072
1181
  declare const LineSeries: React__default.FC<LineSeriesProps>;
1073
1182
 
1074
1183
  type SortDirection = "asc" | "desc";
@@ -1142,6 +1251,9 @@ interface DataTableProps<T> {
1142
1251
  "aria-label"?: string;
1143
1252
  }
1144
1253
 
1254
+ /**
1255
+ * Action configuration for ActionCell
1256
+ */
1145
1257
  interface Action<T = any> {
1146
1258
  id: string;
1147
1259
  label?: string;
@@ -1156,6 +1268,12 @@ interface ActionCellProps<T = any> extends CellComponentProps<T> {
1156
1268
  align?: "left" | "center" | "right";
1157
1269
  size?: "sm" | "md" | "lg";
1158
1270
  }
1271
+ /**
1272
+ * ActionCell
1273
+ *
1274
+ * DataTable cell component for rendering action buttons within table rows.
1275
+ * Supports multiple actions with icons, labels, and conditional visibility/disabled states.
1276
+ */
1159
1277
  declare function ActionCell<T = any>({ row, context, actions, align, size, }: ActionCellProps<T>): react_jsx_runtime.JSX.Element | null;
1160
1278
 
1161
1279
  interface BooleanCellProps<T = any> extends CellComponentProps<T> {
@@ -1168,6 +1286,12 @@ interface BooleanCellProps<T = any> extends CellComponentProps<T> {
1168
1286
  align?: "left" | "center" | "right";
1169
1287
  emphasis?: CellEmphasis;
1170
1288
  }
1289
+ /**
1290
+ * BooleanCell
1291
+ *
1292
+ * DataTable cell component for displaying boolean values.
1293
+ * Supports multiple display formats including icons, text, or badges with customizable true/false representations.
1294
+ */
1171
1295
  declare function BooleanCell<T = any>({ value, context, format, trueText, falseText, trueIcon, falseIcon, showFalse, align, emphasis, }: BooleanCellProps<T>): react_jsx_runtime.JSX.Element | null;
1172
1296
 
1173
1297
  /**
@@ -1226,6 +1350,12 @@ interface DateCellProps<T = any> extends CellComponentProps<T> {
1226
1350
  href?: string | ((row: T) => string);
1227
1351
  linkBehavior?: LinkBehavior;
1228
1352
  }
1353
+ /**
1354
+ * DateCell
1355
+ *
1356
+ * DataTable cell component for displaying date and time values.
1357
+ * Supports multiple formats including relative time, with optional linking capabilities.
1358
+ */
1229
1359
  declare function DateCell<T = any>({ value, row, context, format, customFormat, emptyText, align, emphasis, href, linkBehavior, }: DateCellProps<T>): react_jsx_runtime.JSX.Element;
1230
1360
 
1231
1361
  interface NumberCellProps<T = any> extends CellComponentProps<T> {
@@ -1241,6 +1371,12 @@ interface NumberCellProps<T = any> extends CellComponentProps<T> {
1241
1371
  showPositiveSign?: boolean;
1242
1372
  colorCode?: boolean;
1243
1373
  }
1374
+ /**
1375
+ * NumberCell
1376
+ *
1377
+ * DataTable cell component for displaying numeric values.
1378
+ * Supports currency, percentage, and compact formatting with optional color coding for positive/negative values.
1379
+ */
1244
1380
  declare function NumberCell<T = any>({ value, row, context, format, decimals, prefix, suffix, emptyText, align, emphasis, href, linkBehavior, showPositiveSign, colorCode, }: NumberCellProps<T>): react_jsx_runtime.JSX.Element;
1245
1381
 
1246
1382
  interface SelectCellProps<T = any> extends CellComponentProps<T> {
@@ -1249,6 +1385,12 @@ interface SelectCellProps<T = any> extends CellComponentProps<T> {
1249
1385
  isDisabled?: boolean | ((row: T) => boolean);
1250
1386
  align?: "left" | "center" | "right";
1251
1387
  }
1388
+ /**
1389
+ * SelectCell
1390
+ *
1391
+ * DataTable cell component for row selection.
1392
+ * Renders a checkbox that allows users to select individual rows in the table.
1393
+ */
1252
1394
  declare function SelectCell<T = any>({ row, context, isSelected, onSelect, isDisabled, align, }: SelectCellProps<T>): react_jsx_runtime.JSX.Element;
1253
1395
 
1254
1396
  interface TextCellProps<T = any> extends CellComponentProps<T> {
@@ -1261,8 +1403,20 @@ interface TextCellProps<T = any> extends CellComponentProps<T> {
1261
1403
  truncate?: boolean;
1262
1404
  align?: "left" | "center" | "right";
1263
1405
  }
1406
+ /**
1407
+ * TextCell
1408
+ *
1409
+ * DataTable cell component for displaying text content.
1410
+ * Supports prefixes, suffixes, truncation, and optional linking with customizable emphasis levels.
1411
+ */
1264
1412
  declare function TextCell<T = any>({ value, row, context, prefix, suffix, emptyText, href, linkBehavior, emphasis, truncate, align, }: TextCellProps<T>): react_jsx_runtime.JSX.Element;
1265
1413
 
1414
+ /**
1415
+ * DataTable
1416
+ *
1417
+ * Advanced table component with sorting, filtering, pagination, and mobile-responsive views.
1418
+ * Supports custom cell renderers, column configurations, and multiple display densities.
1419
+ */
1266
1420
  declare function DataTable<T extends Record<string, unknown>>({ columns, data, className, density, width, height, maxHeight, layout, mobileRenderer, customMobileRowRender, mobileBreakpoint, isLoading, loadingRowCount, stickyHeader, onRowClick, getRowId, hideHeader, onSort, "aria-label": ariaLabel, }: DataTableProps<T>): react_jsx_runtime.JSX.Element;
1267
1421
 
1268
1422
  interface MobileRowProps<T> {
@@ -1365,6 +1519,12 @@ interface State {
1365
1519
  hasError: boolean;
1366
1520
  error?: Error;
1367
1521
  }
1522
+ /**
1523
+ * ErrorBoundary
1524
+ *
1525
+ * React error boundary component for graceful error handling.
1526
+ * Catches JavaScript errors in child components and displays a fallback UI with retry option.
1527
+ */
1368
1528
  declare class ErrorBoundary extends Component<Props, State> {
1369
1529
  state: State;
1370
1530
  static getDerivedStateFromError(error: Error): State;
@@ -2228,6 +2388,12 @@ interface SkeletonProps {
2228
2388
  className?: string;
2229
2389
  "data-testid"?: string;
2230
2390
  }
2391
+ /**
2392
+ * Skeleton
2393
+ *
2394
+ * Loading placeholder component that mimics content structure.
2395
+ * Supports various shapes, animations, and responsive configurations for skeleton screens.
2396
+ */
2231
2397
  declare const Skeleton: React__default.FC<SkeletonProps>;
2232
2398
 
2233
2399
  interface SliderProps {
@@ -2369,6 +2535,12 @@ declare function StatList({ items, layout, dense, valueAlign, showDividers, skel
2369
2535
  interface SwitchProps extends Omit<SwitchProps$1, "children"> {
2370
2536
  children: React__default.ReactNode;
2371
2537
  }
2538
+ /**
2539
+ * Switch
2540
+ *
2541
+ * Toggle switch component for binary on/off states.
2542
+ * Provides an accessible alternative to checkboxes for settings and preferences.
2543
+ */
2372
2544
  declare function Switch({ children, ...props }: SwitchProps): react_jsx_runtime.JSX.Element;
2373
2545
 
2374
2546
  type TabVariant = "default" | "accent";
@@ -2449,6 +2621,12 @@ interface TextAreaWithChipsProps extends Omit<React__default.TextareaHTMLAttribu
2449
2621
  chipVariant?: "default" | "primary" | "secondary";
2450
2622
  chipSize?: Size;
2451
2623
  }
2624
+ /**
2625
+ * TextAreaWithChips
2626
+ *
2627
+ * Enhanced textarea component with chip/tag support.
2628
+ * Enables rich text input with embedded chips for mentions, tags, or structured data entry.
2629
+ */
2452
2630
  declare function TextAreaWithChips({ label, description, errorMessage, size, tooltip, required, transparent, isInvalid, isDisabled, className, validationResult, value, onChange, chips, onChipsChange, triggerPattern, onTriggerDetected, onTriggerDismissed, renderChip, chipVariant, chipSize, ...props }: TextAreaWithChipsProps): react_jsx_runtime.JSX.Element;
2453
2631
 
2454
2632
  /**