@accelint/design-toolkit 9.0.0 → 9.1.0

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.
Files changed (211) hide show
  1. package/catalog-info.yaml +5 -5
  2. package/dist/components/accordion/context.d.ts +2 -2
  3. package/dist/components/accordion/group.d.ts +2 -2
  4. package/dist/components/accordion/header.d.ts +2 -2
  5. package/dist/components/accordion/index.d.ts +2 -2
  6. package/dist/components/accordion/panel.d.ts +2 -2
  7. package/dist/components/accordion/trigger.d.ts +2 -2
  8. package/dist/components/action-bar/index.d.ts +2 -2
  9. package/dist/components/avatar/context.d.ts +4 -4
  10. package/dist/components/avatar/index.d.ts +2 -2
  11. package/dist/components/badge/context.d.ts +4 -4
  12. package/dist/components/badge/index.d.ts +2 -2
  13. package/dist/components/breadcrumbs/index.d.ts +2 -2
  14. package/dist/components/breadcrumbs/item.d.ts +2 -2
  15. package/dist/components/button/context.d.ts +8 -8
  16. package/dist/components/button/index.d.ts +2 -2
  17. package/dist/components/button/link.d.ts +2 -2
  18. package/dist/components/button/toggle.d.ts +2 -2
  19. package/dist/components/checkbox/context.d.ts +3 -3
  20. package/dist/components/checkbox/group.d.ts +2 -2
  21. package/dist/components/checkbox/index.d.ts +2 -2
  22. package/dist/components/chip/context.d.ts +4 -4
  23. package/dist/components/chip/deletable.d.ts +2 -2
  24. package/dist/components/chip/index.d.ts +2 -2
  25. package/dist/components/chip/list.d.ts +4 -4
  26. package/dist/components/chip/selectable.d.ts +2 -2
  27. package/dist/components/classification-badge/context.d.ts +4 -4
  28. package/dist/components/classification-badge/index.d.ts +2 -2
  29. package/dist/components/classification-banner/context.d.ts +4 -4
  30. package/dist/components/classification-banner/index.d.ts +2 -2
  31. package/dist/components/clock/index.d.ts +2 -2
  32. package/dist/components/color-picker/index.d.ts +2 -2
  33. package/dist/components/combobox-field/context.d.ts +4 -4
  34. package/dist/components/combobox-field/index.d.ts +2 -2
  35. package/dist/components/coordinate-field/context.d.ts +6 -6
  36. package/dist/components/coordinate-field/coordinate-utils.js +1 -1
  37. package/dist/components/coordinate-field/coordinate-utils.js.map +1 -1
  38. package/dist/components/coordinate-field/index.d.ts +2 -2
  39. package/dist/components/coordinate-field/index.js +27 -14
  40. package/dist/components/coordinate-field/index.js.map +1 -1
  41. package/dist/components/coordinate-field/segment-configs.d.ts +3 -1
  42. package/dist/components/coordinate-field/segment-configs.js +16 -14
  43. package/dist/components/coordinate-field/segment-configs.js.map +1 -1
  44. package/dist/components/coordinate-field/segment.d.ts +2 -2
  45. package/dist/components/coordinate-field/styles.module.css +21 -3
  46. package/dist/components/coordinate-field/types.d.ts +7 -0
  47. package/dist/components/coordinate-field/types.js.map +1 -1
  48. package/dist/components/coordinate-field/width-utils.d.ts +4 -3
  49. package/dist/components/coordinate-field/width-utils.js +4 -3
  50. package/dist/components/coordinate-field/width-utils.js.map +1 -1
  51. package/dist/components/date-field/index.d.ts +2 -2
  52. package/dist/components/details-list/context.d.ts +4 -4
  53. package/dist/components/details-list/index.d.ts +2 -2
  54. package/dist/components/details-list/label.d.ts +2 -2
  55. package/dist/components/details-list/value.d.ts +2 -2
  56. package/dist/components/dialog/content.d.ts +2 -2
  57. package/dist/components/dialog/context.d.ts +2 -2
  58. package/dist/components/dialog/footer.d.ts +2 -2
  59. package/dist/components/dialog/index.d.ts +2 -2
  60. package/dist/components/dialog/title.d.ts +2 -2
  61. package/dist/components/divider/context.d.ts +4 -4
  62. package/dist/components/divider/index.d.ts +2 -2
  63. package/dist/components/drawer/back.d.ts +2 -2
  64. package/dist/components/drawer/close.d.ts +2 -2
  65. package/dist/components/drawer/content.d.ts +2 -2
  66. package/dist/components/drawer/context.d.ts +2 -2
  67. package/dist/components/drawer/footer.d.ts +2 -2
  68. package/dist/components/drawer/header-title.d.ts +2 -2
  69. package/dist/components/drawer/header.d.ts +2 -2
  70. package/dist/components/drawer/index.d.ts +2 -2
  71. package/dist/components/drawer/layout-main.d.ts +2 -2
  72. package/dist/components/drawer/layout.d.ts +2 -2
  73. package/dist/components/drawer/menu-item.d.ts +2 -2
  74. package/dist/components/drawer/menu.d.ts +2 -2
  75. package/dist/components/drawer/panel.d.ts +2 -2
  76. package/dist/components/drawer/trigger.d.ts +2 -2
  77. package/dist/components/drawer/view.d.ts +2 -2
  78. package/dist/components/flashcard/index.d.ts +9 -9
  79. package/dist/components/hero/context.d.ts +2 -2
  80. package/dist/components/hero/index.d.ts +2 -2
  81. package/dist/components/hero/subtitle.d.ts +2 -2
  82. package/dist/components/hero/title.d.ts +2 -2
  83. package/dist/components/hotkey/context.d.ts +4 -4
  84. package/dist/components/hotkey/index.d.ts +2 -2
  85. package/dist/components/hotkey/set.d.ts +2 -2
  86. package/dist/components/icon/context.d.ts +4 -4
  87. package/dist/components/icon/index.d.ts +2 -2
  88. package/dist/components/input/context.d.ts +2 -2
  89. package/dist/components/input/index.d.ts +2 -2
  90. package/dist/components/kanban/card-body.d.ts +2 -2
  91. package/dist/components/kanban/card-header-actions.d.ts +2 -2
  92. package/dist/components/kanban/card-header-title.d.ts +2 -2
  93. package/dist/components/kanban/card-header.d.ts +2 -2
  94. package/dist/components/kanban/card.d.ts +2 -2
  95. package/dist/components/kanban/column-actions.d.ts +2 -2
  96. package/dist/components/kanban/column-container.d.ts +2 -2
  97. package/dist/components/kanban/column-content.d.ts +2 -2
  98. package/dist/components/kanban/column-header-actions.d.ts +2 -2
  99. package/dist/components/kanban/column-header-drag-handle.d.ts +2 -2
  100. package/dist/components/kanban/column-header-title.d.ts +2 -2
  101. package/dist/components/kanban/column.d.ts +2 -2
  102. package/dist/components/kanban/context.d.ts +2 -2
  103. package/dist/components/kanban/header-actions.d.ts +2 -2
  104. package/dist/components/kanban/header-search.d.ts +2 -2
  105. package/dist/components/kanban/header-title.d.ts +2 -2
  106. package/dist/components/kanban/header.d.ts +2 -2
  107. package/dist/components/kanban/kanban.d.ts +4 -4
  108. package/dist/components/label/context.d.ts +4 -4
  109. package/dist/components/label/index.d.ts +2 -2
  110. package/dist/components/lines/index.d.ts +2 -2
  111. package/dist/components/link/context.d.ts +2 -2
  112. package/dist/components/link/index.d.ts +2 -2
  113. package/dist/components/menu/context.d.ts +2 -2
  114. package/dist/components/menu/index.d.ts +2 -2
  115. package/dist/components/menu/item-description.d.ts +2 -2
  116. package/dist/components/menu/item-label.d.ts +2 -2
  117. package/dist/components/menu/item.d.ts +2 -2
  118. package/dist/components/menu/section.d.ts +2 -2
  119. package/dist/components/menu/separator.d.ts +2 -2
  120. package/dist/components/menu/submenu.d.ts +2 -2
  121. package/dist/components/notice/index.d.ts +2 -2
  122. package/dist/components/notice/list.d.ts +2 -2
  123. package/dist/components/notice/notice-icon.d.ts +2 -2
  124. package/dist/components/options/context.d.ts +2 -2
  125. package/dist/components/options/index.d.ts +2 -2
  126. package/dist/components/options/item-content.d.ts +2 -2
  127. package/dist/components/options/item-description.d.ts +2 -2
  128. package/dist/components/options/item-label.d.ts +2 -2
  129. package/dist/components/options/item.d.ts +2 -2
  130. package/dist/components/options/section.d.ts +2 -2
  131. package/dist/components/pagination/context.d.ts +2 -2
  132. package/dist/components/pagination/index.d.ts +2 -2
  133. package/dist/components/pagination/next.d.ts +2 -2
  134. package/dist/components/pagination/pages.d.ts +2 -2
  135. package/dist/components/pagination/prev.d.ts +2 -2
  136. package/dist/components/popover/content.d.ts +2 -2
  137. package/dist/components/popover/footer.d.ts +2 -2
  138. package/dist/components/popover/index.d.ts +2 -2
  139. package/dist/components/popover/title.d.ts +2 -2
  140. package/dist/components/popover/trigger.d.ts +2 -2
  141. package/dist/components/query-builder/action-element.d.ts +2 -2
  142. package/dist/components/query-builder/actions.d.ts +4 -4
  143. package/dist/components/query-builder/combinator-selector.d.ts +2 -2
  144. package/dist/components/query-builder/index.d.ts +2 -2
  145. package/dist/components/query-builder/rule-group.d.ts +4 -4
  146. package/dist/components/query-builder/rule.d.ts +2 -2
  147. package/dist/components/query-builder/value-editor.d.ts +2 -2
  148. package/dist/components/query-builder/value-selector.d.ts +2 -2
  149. package/dist/components/radio/context.d.ts +2 -2
  150. package/dist/components/radio/group.d.ts +2 -2
  151. package/dist/components/radio/index.d.ts +2 -2
  152. package/dist/components/search-field/context.d.ts +4 -4
  153. package/dist/components/search-field/index.d.ts +2 -2
  154. package/dist/components/search-field/styles.module.css +1 -1
  155. package/dist/components/select-field/context.d.ts +4 -4
  156. package/dist/components/select-field/index.d.ts +2 -2
  157. package/dist/components/sidenav/avatar.d.ts +2 -2
  158. package/dist/components/sidenav/content.d.ts +2 -2
  159. package/dist/components/sidenav/context.d.ts +2 -2
  160. package/dist/components/sidenav/footer.d.ts +2 -2
  161. package/dist/components/sidenav/header.d.ts +2 -2
  162. package/dist/components/sidenav/index.d.ts +2 -2
  163. package/dist/components/sidenav/item.d.ts +2 -2
  164. package/dist/components/sidenav/link.d.ts +2 -2
  165. package/dist/components/sidenav/menu-item.d.ts +2 -2
  166. package/dist/components/sidenav/menu.d.ts +2 -2
  167. package/dist/components/sidenav/trigger.d.ts +2 -2
  168. package/dist/components/skeleton/index.d.ts +2 -2
  169. package/dist/components/slider/index.d.ts +2 -2
  170. package/dist/components/switch/context.d.ts +4 -4
  171. package/dist/components/switch/index.d.ts +2 -2
  172. package/dist/components/table/body.d.ts +2 -2
  173. package/dist/components/table/cell.d.ts +2 -2
  174. package/dist/components/table/context.d.ts +2 -2
  175. package/dist/components/table/header-cell.d.ts +2 -2
  176. package/dist/components/table/header.d.ts +2 -2
  177. package/dist/components/table/index.d.ts +2 -2
  178. package/dist/components/table/row.d.ts +2 -2
  179. package/dist/components/tabs/context.d.ts +4 -4
  180. package/dist/components/tabs/index.d.ts +2 -2
  181. package/dist/components/tabs/list.d.ts +2 -2
  182. package/dist/components/tabs/panel.d.ts +2 -2
  183. package/dist/components/tabs/tab.d.ts +2 -2
  184. package/dist/components/text-area-field/context.d.ts +4 -4
  185. package/dist/components/text-area-field/index.d.ts +2 -2
  186. package/dist/components/text-field/context.d.ts +4 -4
  187. package/dist/components/text-field/index.d.ts +2 -2
  188. package/dist/components/time-field/index.d.ts +2 -2
  189. package/dist/components/tooltip/context.d.ts +2 -2
  190. package/dist/components/tooltip/index.d.ts +2 -2
  191. package/dist/components/tooltip/trigger.d.ts +2 -2
  192. package/dist/components/tree/context.d.ts +3 -3
  193. package/dist/components/tree/index.d.ts +2 -2
  194. package/dist/components/tree/item-actions.d.ts +2 -2
  195. package/dist/components/tree/item-content.d.ts +2 -2
  196. package/dist/components/tree/item-description.d.ts +2 -2
  197. package/dist/components/tree/item-label.d.ts +2 -2
  198. package/dist/components/tree/item-prefix-icon.d.ts +2 -2
  199. package/dist/components/tree/item.d.ts +2 -2
  200. package/dist/components/tree/lines.d.ts +2 -2
  201. package/dist/components/view-stack/context.d.ts +2 -2
  202. package/dist/components/view-stack/index.d.ts +2 -2
  203. package/dist/components/view-stack/trigger.d.ts +2 -2
  204. package/dist/components/view-stack/view.d.ts +2 -2
  205. package/dist/hooks/coordinate-field/use-coordinate-field-state.js +1 -1
  206. package/dist/hooks/coordinate-field/use-coordinate-field-state.js.map +1 -1
  207. package/dist/index.d.ts +2 -3
  208. package/dist/index.js +2 -3
  209. package/dist/providers/portal.d.ts +2 -2
  210. package/dist/providers/theme-provider.d.ts +2 -2
  211. package/package.json +30 -34
@@ -16,6 +16,8 @@
16
16
  const NUMERIC_PAD = .25;
17
17
  /** Larger padding for final segment to account for container edge (0.5ch ≈ half character) */
18
18
  const LAST_PAD = .5;
19
+ /** The separator used for the logical field groups. */
20
+ const GROUP_SEPARATOR = ", ";
19
21
  /**
20
22
  * DD (Decimal Degrees) Segment Configuration
21
23
  *
@@ -38,7 +40,7 @@ const ddSegmentConfigs = [
38
40
  },
39
41
  {
40
42
  type: "literal",
41
- value: ", "
43
+ value: GROUP_SEPARATOR
42
44
  },
43
45
  {
44
46
  type: "numeric",
@@ -74,7 +76,7 @@ const ddmSegmentConfigs = [
74
76
  },
75
77
  {
76
78
  type: "literal",
77
- value: "° "
79
+ value: "°"
78
80
  },
79
81
  {
80
82
  type: "numeric",
@@ -85,7 +87,7 @@ const ddmSegmentConfigs = [
85
87
  },
86
88
  {
87
89
  type: "literal",
88
- value: "' "
90
+ value: "'"
89
91
  },
90
92
  {
91
93
  type: "directional",
@@ -96,7 +98,7 @@ const ddmSegmentConfigs = [
96
98
  },
97
99
  {
98
100
  type: "literal",
99
- value: ", "
101
+ value: GROUP_SEPARATOR
100
102
  },
101
103
  {
102
104
  type: "numeric",
@@ -107,7 +109,7 @@ const ddmSegmentConfigs = [
107
109
  },
108
110
  {
109
111
  type: "literal",
110
- value: "° "
112
+ value: "°"
111
113
  },
112
114
  {
113
115
  type: "numeric",
@@ -118,7 +120,7 @@ const ddmSegmentConfigs = [
118
120
  },
119
121
  {
120
122
  type: "literal",
121
- value: "' "
123
+ value: "'"
122
124
  },
123
125
  {
124
126
  type: "directional",
@@ -156,7 +158,7 @@ const dmsSegmentConfigs = [
156
158
  },
157
159
  {
158
160
  type: "literal",
159
- value: "° "
161
+ value: "°"
160
162
  },
161
163
  {
162
164
  type: "numeric",
@@ -167,7 +169,7 @@ const dmsSegmentConfigs = [
167
169
  },
168
170
  {
169
171
  type: "literal",
170
- value: "' "
172
+ value: "'"
171
173
  },
172
174
  {
173
175
  type: "numeric",
@@ -178,7 +180,7 @@ const dmsSegmentConfigs = [
178
180
  },
179
181
  {
180
182
  type: "literal",
181
- value: "\" "
183
+ value: "\""
182
184
  },
183
185
  {
184
186
  type: "directional",
@@ -189,7 +191,7 @@ const dmsSegmentConfigs = [
189
191
  },
190
192
  {
191
193
  type: "literal",
192
- value: ", "
194
+ value: GROUP_SEPARATOR
193
195
  },
194
196
  {
195
197
  type: "numeric",
@@ -200,7 +202,7 @@ const dmsSegmentConfigs = [
200
202
  },
201
203
  {
202
204
  type: "literal",
203
- value: "° "
205
+ value: "°"
204
206
  },
205
207
  {
206
208
  type: "numeric",
@@ -211,7 +213,7 @@ const dmsSegmentConfigs = [
211
213
  },
212
214
  {
213
215
  type: "literal",
214
- value: "' "
216
+ value: "'"
215
217
  },
216
218
  {
217
219
  type: "numeric",
@@ -222,7 +224,7 @@ const dmsSegmentConfigs = [
222
224
  },
223
225
  {
224
226
  type: "literal",
225
- value: "\" "
227
+ value: "\""
226
228
  },
227
229
  {
228
230
  type: "directional",
@@ -471,5 +473,5 @@ function getSegmentLabel(format, editableIndex) {
471
473
  }
472
474
 
473
475
  //#endregion
474
- export { EXPECTED_SEGMENT_COUNTS, ddSegmentConfigs, ddmSegmentConfigs, dmsSegmentConfigs, getEditableSegmentCount, getFormatDescription, getSegmentConfigs, getSegmentLabel, mgrsSegmentConfigs, utmSegmentConfigs };
476
+ export { EXPECTED_SEGMENT_COUNTS, GROUP_SEPARATOR, ddSegmentConfigs, ddmSegmentConfigs, dmsSegmentConfigs, getEditableSegmentCount, getFormatDescription, getSegmentConfigs, getSegmentLabel, mgrsSegmentConfigs, utmSegmentConfigs };
475
477
  //# sourceMappingURL=segment-configs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segment-configs.js","names":["ddSegmentConfigs: SegmentConfig[]","ddmSegmentConfigs: SegmentConfig[]","dmsSegmentConfigs: SegmentConfig[]","mgrsSegmentConfigs: SegmentConfig[]","utmSegmentConfigs: SegmentConfig[]","EXPECTED_SEGMENT_COUNTS: Record<CoordinateSystem, number>"],"sources":["../../../src/components/coordinate-field/segment-configs.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Coordinate Field Segment Configurations\n *\n * This file defines the segment layouts for each supported coordinate system format.\n * Each configuration specifies the editable segments and literal separators that make up\n * the coordinate input for that format.\n *\n * Supported formats:\n * - DD (Decimal Degrees) - 2 editable segments\n * - DDM (Degrees Decimal Minutes) - 6 editable segments\n * - DMS (Degrees Minutes Seconds) - 8 editable segments\n * - MGRS (Military Grid Reference System) - 5 editable segments\n * - UTM (Universal Transverse Mercator) - 4 editable segments\n *\n * References:\n * - DD parser: /packages/geo/src/coordinates/latlon/decimal-degrees/parser.ts\n * - DDM parser: /packages/geo/src/coordinates/latlon/degrees-decimal-minutes/parser.ts\n * - DMS parser: /packages/geo/src/coordinates/latlon/degrees-minutes-seconds/parser.ts\n * - MGRS parser: /packages/geo/src/coordinates/mgrs/parser.ts\n * - UTM parser: /packages/geo/src/coordinates/utm/parser.ts\n */\n\nimport type { CoordinateSystem, SegmentConfig } from './types';\n\n/** Padding for numeric segments (0.25ch ≈ quarter character width for visual spacing) */\nconst NUMERIC_PAD = 0.25;\n\n/** Larger padding for final segment to account for container edge (0.5ch ≈ half character) */\nconst LAST_PAD = 0.5;\n\n/**\n * DD (Decimal Degrees) Segment Configuration\n *\n * Format: [lat_deg], [lon_deg]\n * Example: 89.765432, -123.456789\n *\n * Segments:\n * - Latitude degrees: -90 to 90, allows negative sign, decimals, 0-9\n * - Longitude degrees: -180 to 180, allows negative sign, decimals, 0-9\n *\n * Total segments: 2 editable\n */\nexport const ddSegmentConfigs: SegmentConfig[] = [\n {\n type: 'numeric',\n placeholder: '00.000000',\n allowedChars: '[0-9\\\\-\\\\.]',\n maxLength: 10, // Max: -90.123456\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: ', ',\n },\n {\n type: 'numeric',\n placeholder: '-000.000000',\n allowedChars: '[0-9\\\\-\\\\.]',\n maxLength: 11, // Max: -180.123456\n pad: LAST_PAD,\n },\n];\n\n/**\n * DDM (Degrees Decimal Minutes) Segment Configuration\n *\n * Format: [lat_deg]° [lat_min]' [lat_dir], [lon_deg]° [lon_min]' [lon_dir]\n * Example: 89° 45.9259' N, 123° 27.4073' W\n *\n * Segments:\n * - Latitude degrees: 0-90, whole number only (no decimals)\n * - Latitude minutes: 0-59.9999, decimals allowed\n * - Latitude direction: N or S\n * - Longitude degrees: 0-180, whole number only (no decimals)\n * - Longitude minutes: 0-59.9999, decimals allowed\n * - Longitude direction: E or W\n *\n * Total segments: 6 editable\n */\nexport const ddmSegmentConfigs: SegmentConfig[] = [\n // Latitude degrees\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 90\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '° ',\n },\n // Latitude minutes (decimal minutes)\n {\n type: 'numeric',\n placeholder: '00.0000',\n allowedChars: '[0-9\\\\.]',\n maxLength: 7, // Max: 59.9999\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: \"' \",\n },\n // Latitude direction\n {\n type: 'directional',\n placeholder: 'N',\n allowedChars: '[NS]',\n maxLength: 1,\n pad: 0,\n },\n {\n type: 'literal',\n value: ', ',\n },\n // Longitude degrees\n {\n type: 'numeric',\n placeholder: '000',\n allowedChars: '[0-9]',\n maxLength: 3, // Max: 180\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '° ',\n },\n // Longitude minutes (decimal minutes)\n {\n type: 'numeric',\n placeholder: '00.0000',\n allowedChars: '[0-9\\\\.]',\n maxLength: 7, // Max: 59.9999\n pad: LAST_PAD,\n },\n {\n type: 'literal',\n value: \"' \",\n },\n // Longitude direction\n {\n type: 'directional',\n placeholder: 'W',\n allowedChars: '[EW]',\n maxLength: 1,\n pad: 0,\n },\n];\n\n/**\n * DMS (Degrees Minutes Seconds) Segment Configuration\n *\n * Format: [lat_deg]° [lat_min]' [lat_sec]\" [lat_dir], [lon_deg]° [lon_min]' [lon_sec]\" [lon_dir]\n * Example: 89° 45' 55.56\" N, 123° 27' 24.44\" W\n *\n * Segments:\n * - Latitude degrees: 0-90, whole number only (no decimals)\n * - Latitude minutes: 0-59, whole number only (no decimals)\n * - Latitude seconds: 0-59.999, decimals allowed\n * - Latitude direction: N or S\n * - Longitude degrees: 0-180, whole number only (no decimals)\n * - Longitude minutes: 0-59, whole number only (no decimals)\n * - Longitude seconds: 0-59.999, decimals allowed\n * - Longitude direction: E or W\n *\n * Total segments: 8 editable\n */\nexport const dmsSegmentConfigs: SegmentConfig[] = [\n // Latitude degrees\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 90\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '° ',\n },\n // Latitude minutes (whole number)\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 59\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: \"' \",\n },\n // Latitude seconds (decimal seconds)\n {\n type: 'numeric',\n placeholder: '00.00',\n allowedChars: '[0-9\\\\.]',\n maxLength: 5, // Max: 59.99\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '\" ',\n },\n // Latitude direction\n {\n type: 'directional',\n placeholder: 'N',\n allowedChars: '[NS]',\n maxLength: 1,\n pad: 0,\n },\n {\n type: 'literal',\n value: ', ',\n },\n // Longitude degrees\n {\n type: 'numeric',\n placeholder: '000',\n allowedChars: '[0-9]',\n maxLength: 3, // Max: 180\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '° ',\n },\n // Longitude minutes (whole number)\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 59\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: \"' \",\n },\n // Longitude seconds (decimal seconds)\n {\n type: 'numeric',\n placeholder: '00.00',\n allowedChars: '[0-9\\\\.]',\n maxLength: 5, // Max: 59.99\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '\" ',\n },\n // Longitude direction\n {\n type: 'directional',\n placeholder: 'W',\n allowedChars: '[EW]',\n maxLength: 1,\n pad: 0,\n },\n];\n\n/**\n * MGRS (Military Grid Reference System) Segment Configuration\n *\n * Format: [zone][band] [grid_100km] [easting] [northing]\n * Example: 18T WM 12345 67890\n *\n * Segments:\n * - Zone: 1-60, 2 digits\n * - Band: C-X (excluding I and O), 1 letter\n * - Grid 100km: 2 letters (A-Z excluding I and O)\n * - Easting: 5 digits (can be 1-5 based on precision)\n * - Northing: 5 digits (can be 1-5 based on precision)\n *\n * Total segments: 5 editable\n *\n * Reference: /packages/geo/src/coordinates/mgrs/parser.ts\n * Pattern: /^((?:..?)?)(\\w?)\\s*((?:\\w{2})?)\\s*(?:(\\d+(?:\\.\\d*)?)?)\\s*(?:(\\d+(?:\\.\\d*)?)?)$/i\n */\nexport const mgrsSegmentConfigs: SegmentConfig[] = [\n // Zone (1-60)\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 60\n pad: NUMERIC_PAD,\n },\n // Band (C-X, excluding I and O)\n {\n type: 'alphanumeric',\n placeholder: 'T',\n allowedChars: '[C-HJ-NP-X]', // Excludes I and O\n maxLength: 1,\n pad: 0,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Grid 100km identifier (2 letters, A-Z excluding I and O)\n {\n type: 'alphanumeric',\n placeholder: 'WM',\n allowedChars: '[A-HJ-NP-Z]', // Excludes I and O\n maxLength: 2,\n pad: 0,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Easting (5 digits, can be 1-5 based on precision)\n {\n type: 'numeric',\n placeholder: '00000',\n allowedChars: '[0-9]',\n maxLength: 5,\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Northing (5 digits, can be 1-5 based on precision)\n {\n type: 'numeric',\n placeholder: '00000',\n allowedChars: '[0-9]',\n maxLength: 5,\n pad: LAST_PAD,\n },\n];\n\n/**\n * UTM (Universal Transverse Mercator) Segment Configuration\n *\n * Format: [zone][hemisphere] [easting] [northing]\n * Example: 18N 585628 4511644\n *\n * Segments:\n * - Zone: 1-60, 2 digits\n * - Hemisphere: N or S, 1 letter\n * - Easting: 6-7 digits\n * - Northing: 7 digits\n *\n * Total segments: 4 editable\n *\n * Reference: /packages/geo/src/coordinates/utm/parser.ts\n * Pattern: /^((?:..)?)\\s*(\\w?)\\s*(?:(\\d+(?:\\.\\d*)?)?)\\s*(?:(\\d+(?:\\.\\d*)?)?)$/i\n */\nexport const utmSegmentConfigs: SegmentConfig[] = [\n // Zone (1-60)\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 60\n pad: NUMERIC_PAD,\n },\n // Hemisphere (N or S)\n {\n type: 'directional',\n placeholder: 'N',\n allowedChars: '[NS]',\n maxLength: 1,\n pad: 0,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Easting (6-7 digits)\n {\n type: 'numeric',\n placeholder: '000000',\n allowedChars: '[0-9]',\n maxLength: 7,\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Northing (7 digits)\n {\n type: 'numeric',\n placeholder: '0000000',\n allowedChars: '[0-9]',\n maxLength: 7,\n pad: LAST_PAD,\n },\n];\n\n/**\n * Get segment configurations for a specific coordinate system\n *\n * @param format - The coordinate system format\n * @returns Array of segment configurations for the specified format\n */\nexport function getSegmentConfigs(format: CoordinateSystem): SegmentConfig[] {\n switch (format) {\n case 'dd':\n return ddSegmentConfigs;\n case 'ddm':\n return ddmSegmentConfigs;\n case 'dms':\n return dmsSegmentConfigs;\n case 'mgrs':\n return mgrsSegmentConfigs;\n case 'utm':\n return utmSegmentConfigs;\n default:\n // Default to DD format if unknown format provided\n return ddSegmentConfigs;\n }\n}\n\n/**\n * Get format description with example\n *\n * Provides a user-friendly description of the coordinate format with an example value.\n * These descriptions can be used as helper text to guide users on the expected format.\n *\n * @param format - The coordinate system format\n * @returns Description string with format example\n */\nexport function getFormatDescription(format: CoordinateSystem): string {\n switch (format) {\n case 'dd':\n return 'Example: 40.7128, -74.0060 (New York City)';\n case 'ddm':\n return \"Example: 40° 42.768' N, 74° 0.360' W (New York City)\";\n case 'dms':\n return 'Example: 40° 42\\' 46.08\" N, 74° 0\\' 21.60\" W (New York City)';\n case 'mgrs':\n return 'Example: 18T WL 80654 06346 (New York City)';\n case 'utm':\n return 'Example: 18N 585628 4511644 (New York City)';\n default:\n return '';\n }\n}\n\n/**\n * Get editable segment count for a format\n *\n * Returns the number of editable segments (excluding literal separators) for each format.\n * This is useful for initializing segment values and validation.\n *\n * @param format - The coordinate system format\n * @returns Number of editable segments\n */\nexport function getEditableSegmentCount(format: CoordinateSystem): number {\n const configs = getSegmentConfigs(format);\n return configs.filter((config) => config.type !== 'literal').length;\n}\n\n/**\n * Validate segment count for each format\n *\n * Expected editable segment counts:\n * - DD: 2 segments (lat, lon)\n * - DDM: 6 segments (lat_deg, lat_min, lat_dir, lon_deg, lon_min, lon_dir)\n * - DMS: 8 segments (lat_deg, lat_min, lat_sec, lat_dir, lon_deg, lon_min, lon_sec, lon_dir)\n * - MGRS: 5 segments (zone, band, grid, easting, northing)\n * - UTM: 4 segments (zone, hemisphere, easting, northing)\n */\nexport const EXPECTED_SEGMENT_COUNTS: Record<CoordinateSystem, number> = {\n dd: 2,\n ddm: 6,\n dms: 8,\n mgrs: 5,\n utm: 4,\n};\n\n/**\n * Get semantic accessibility label for a segment based on format and editable index\n *\n * Provides descriptive labels for screen readers (e.g., \"Latitude degrees\", \"Longitude minutes\")\n * to improve accessibility beyond generic \"Coordinate segment 1\" announcements.\n *\n * @param format - The coordinate system format\n * @param editableIndex - The index of the editable segment (0-based, excluding literals)\n * @returns Semantic label string for the segment\n */\nexport function getSegmentLabel(\n format: CoordinateSystem,\n editableIndex: number,\n): string {\n switch (format) {\n case 'dd':\n // DD: [lat, lon]\n return editableIndex === 0 ? 'Latitude' : 'Longitude';\n\n case 'ddm':\n // DDM: [lat_deg, lat_min, lat_dir, lon_deg, lon_min, lon_dir]\n switch (editableIndex) {\n case 0:\n return 'Latitude degrees';\n case 1:\n return 'Latitude minutes';\n case 2:\n return 'Latitude direction';\n case 3:\n return 'Longitude degrees';\n case 4:\n return 'Longitude minutes';\n case 5:\n return 'Longitude direction';\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n\n case 'dms':\n // DMS: [lat_deg, lat_min, lat_sec, lat_dir, lon_deg, lon_min, lon_sec, lon_dir]\n switch (editableIndex) {\n case 0:\n return 'Latitude degrees';\n case 1:\n return 'Latitude minutes';\n case 2:\n return 'Latitude seconds';\n case 3:\n return 'Latitude direction';\n case 4:\n return 'Longitude degrees';\n case 5:\n return 'Longitude minutes';\n case 6:\n return 'Longitude seconds';\n case 7:\n return 'Longitude direction';\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n\n case 'mgrs':\n // MGRS: [zone, band, grid, easting, northing]\n switch (editableIndex) {\n case 0:\n return 'MGRS zone';\n case 1:\n return 'MGRS band';\n case 2:\n return 'MGRS grid square';\n case 3:\n return 'MGRS easting';\n case 4:\n return 'MGRS northing';\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n\n case 'utm':\n // UTM: [zone, hemisphere, easting, northing]\n switch (editableIndex) {\n case 0:\n return 'UTM zone';\n case 1:\n return 'UTM hemisphere';\n case 2:\n return 'UTM easting';\n case 3:\n return 'UTM northing';\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,MAAM,cAAc;;AAGpB,MAAM,WAAW;;;;;;;;;;;;;AAcjB,MAAaA,mBAAoC;CAC/C;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CACD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;;;;;;;;;;;AAkBD,MAAaC,oBAAqC;CAEhD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;;;;;;;;;;;;;AAoBD,MAAaC,oBAAqC;CAEhD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;;;;;;;;;;;;;AAoBD,MAAaC,qBAAsC;CAEjD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;;;;;;;;;;;;AAmBD,MAAaC,oBAAqC;CAEhD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;AAQD,SAAgB,kBAAkB,QAA2C;AAC3E,SAAQ,QAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,QAEE,QAAO;;;;;;;;;;;;AAab,SAAgB,qBAAqB,QAAkC;AACrE,SAAQ,QAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,QACE,QAAO;;;;;;;;;;;;AAab,SAAgB,wBAAwB,QAAkC;AAExE,QADgB,kBAAkB,OAAO,CAC1B,QAAQ,WAAW,OAAO,SAAS,UAAU,CAAC;;;;;;;;;;;;AAa/D,MAAaC,0BAA4D;CACvE,IAAI;CACJ,KAAK;CACL,KAAK;CACL,MAAM;CACN,KAAK;CACN;;;;;;;;;;;AAYD,SAAgB,gBACd,QACA,eACQ;AACR,SAAQ,QAAR;EACE,KAAK,KAEH,QAAO,kBAAkB,IAAI,aAAa;EAE5C,KAAK,MAEH,SAAQ,eAAR;GACE,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,QACE,QAAO,sBAAsB,gBAAgB;;EAGnD,KAAK,MAEH,SAAQ,eAAR;GACE,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,QACE,QAAO,sBAAsB,gBAAgB;;EAGnD,KAAK,OAEH,SAAQ,eAAR;GACE,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,QACE,QAAO,sBAAsB,gBAAgB;;EAGnD,KAAK,MAEH,SAAQ,eAAR;GACE,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,QACE,QAAO,sBAAsB,gBAAgB;;EAGnD,QACE,QAAO,sBAAsB,gBAAgB"}
1
+ {"version":3,"file":"segment-configs.js","names":["ddSegmentConfigs: SegmentConfig[]","ddmSegmentConfigs: SegmentConfig[]","dmsSegmentConfigs: SegmentConfig[]","mgrsSegmentConfigs: SegmentConfig[]","utmSegmentConfigs: SegmentConfig[]","EXPECTED_SEGMENT_COUNTS: Record<CoordinateSystem, number>"],"sources":["../../../src/components/coordinate-field/segment-configs.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/**\n * Coordinate Field Segment Configurations\n *\n * This file defines the segment layouts for each supported coordinate system format.\n * Each configuration specifies the editable segments and literal separators that make up\n * the coordinate input for that format.\n *\n * Supported formats:\n * - DD (Decimal Degrees) - 2 editable segments\n * - DDM (Degrees Decimal Minutes) - 6 editable segments\n * - DMS (Degrees Minutes Seconds) - 8 editable segments\n * - MGRS (Military Grid Reference System) - 5 editable segments\n * - UTM (Universal Transverse Mercator) - 4 editable segments\n *\n * References:\n * - DD parser: /packages/geo/src/coordinates/latlon/decimal-degrees/parser.ts\n * - DDM parser: /packages/geo/src/coordinates/latlon/degrees-decimal-minutes/parser.ts\n * - DMS parser: /packages/geo/src/coordinates/latlon/degrees-minutes-seconds/parser.ts\n * - MGRS parser: /packages/geo/src/coordinates/mgrs/parser.ts\n * - UTM parser: /packages/geo/src/coordinates/utm/parser.ts\n */\n\nimport type { CoordinateSystem, SegmentConfig } from './types';\n\n/** Padding for numeric segments (0.25ch ≈ quarter character width for visual spacing) */\nconst NUMERIC_PAD = 0.25;\n\n/** Larger padding for final segment to account for container edge (0.5ch ≈ half character) */\nconst LAST_PAD = 0.5;\n\n/** The separator used for the logical field groups. */\nexport const GROUP_SEPARATOR = ', ';\n\n/**\n * DD (Decimal Degrees) Segment Configuration\n *\n * Format: [lat_deg], [lon_deg]\n * Example: 89.765432, -123.456789\n *\n * Segments:\n * - Latitude degrees: -90 to 90, allows negative sign, decimals, 0-9\n * - Longitude degrees: -180 to 180, allows negative sign, decimals, 0-9\n *\n * Total segments: 2 editable\n */\nexport const ddSegmentConfigs: SegmentConfig[] = [\n {\n type: 'numeric',\n placeholder: '00.000000',\n allowedChars: '[0-9\\\\-\\\\.]',\n maxLength: 10, // Max: -90.123456\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: GROUP_SEPARATOR,\n },\n {\n type: 'numeric',\n placeholder: '-000.000000',\n allowedChars: '[0-9\\\\-\\\\.]',\n maxLength: 11, // Max: -180.123456\n pad: LAST_PAD,\n },\n];\n\n/**\n * DDM (Degrees Decimal Minutes) Segment Configuration\n *\n * Format: [lat_deg]° [lat_min]' [lat_dir], [lon_deg]° [lon_min]' [lon_dir]\n * Example: 89° 45.9259' N, 123° 27.4073' W\n *\n * Segments:\n * - Latitude degrees: 0-90, whole number only (no decimals)\n * - Latitude minutes: 0-59.9999, decimals allowed\n * - Latitude direction: N or S\n * - Longitude degrees: 0-180, whole number only (no decimals)\n * - Longitude minutes: 0-59.9999, decimals allowed\n * - Longitude direction: E or W\n *\n * Total segments: 6 editable\n */\nexport const ddmSegmentConfigs: SegmentConfig[] = [\n // Latitude degrees\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 90\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '°',\n },\n // Latitude minutes (decimal minutes)\n {\n type: 'numeric',\n placeholder: '00.0000',\n allowedChars: '[0-9\\\\.]',\n maxLength: 7, // Max: 59.9999\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: \"'\",\n },\n // Latitude direction\n {\n type: 'directional',\n placeholder: 'N',\n allowedChars: '[NS]',\n maxLength: 1,\n pad: 0,\n },\n {\n type: 'literal',\n value: GROUP_SEPARATOR,\n },\n // Longitude degrees\n {\n type: 'numeric',\n placeholder: '000',\n allowedChars: '[0-9]',\n maxLength: 3, // Max: 180\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '°',\n },\n // Longitude minutes (decimal minutes)\n {\n type: 'numeric',\n placeholder: '00.0000',\n allowedChars: '[0-9\\\\.]',\n maxLength: 7, // Max: 59.9999\n pad: LAST_PAD,\n },\n {\n type: 'literal',\n value: \"'\",\n },\n // Longitude direction\n {\n type: 'directional',\n placeholder: 'W',\n allowedChars: '[EW]',\n maxLength: 1,\n pad: 0,\n },\n];\n\n/**\n * DMS (Degrees Minutes Seconds) Segment Configuration\n *\n * Format: [lat_deg]° [lat_min]' [lat_sec]\" [lat_dir], [lon_deg]° [lon_min]' [lon_sec]\" [lon_dir]\n * Example: 89° 45' 55.56\" N, 123° 27' 24.44\" W\n *\n * Segments:\n * - Latitude degrees: 0-90, whole number only (no decimals)\n * - Latitude minutes: 0-59, whole number only (no decimals)\n * - Latitude seconds: 0-59.999, decimals allowed\n * - Latitude direction: N or S\n * - Longitude degrees: 0-180, whole number only (no decimals)\n * - Longitude minutes: 0-59, whole number only (no decimals)\n * - Longitude seconds: 0-59.999, decimals allowed\n * - Longitude direction: E or W\n *\n * Total segments: 8 editable\n */\nexport const dmsSegmentConfigs: SegmentConfig[] = [\n // Latitude degrees\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 90\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '°',\n },\n // Latitude minutes (whole number)\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 59\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: \"'\",\n },\n // Latitude seconds (decimal seconds)\n {\n type: 'numeric',\n placeholder: '00.00',\n allowedChars: '[0-9\\\\.]',\n maxLength: 5, // Max: 59.99\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '\"',\n },\n // Latitude direction\n {\n type: 'directional',\n placeholder: 'N',\n allowedChars: '[NS]',\n maxLength: 1,\n pad: 0,\n },\n {\n type: 'literal',\n value: GROUP_SEPARATOR,\n },\n // Longitude degrees\n {\n type: 'numeric',\n placeholder: '000',\n allowedChars: '[0-9]',\n maxLength: 3, // Max: 180\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '°',\n },\n // Longitude minutes (whole number)\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 59\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: \"'\",\n },\n // Longitude seconds (decimal seconds)\n {\n type: 'numeric',\n placeholder: '00.00',\n allowedChars: '[0-9\\\\.]',\n maxLength: 5, // Max: 59.99\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: '\"',\n },\n // Longitude direction\n {\n type: 'directional',\n placeholder: 'W',\n allowedChars: '[EW]',\n maxLength: 1,\n pad: 0,\n },\n];\n\n/**\n * MGRS (Military Grid Reference System) Segment Configuration\n *\n * Format: [zone][band] [grid_100km] [easting] [northing]\n * Example: 18T WM 12345 67890\n *\n * Segments:\n * - Zone: 1-60, 2 digits\n * - Band: C-X (excluding I and O), 1 letter\n * - Grid 100km: 2 letters (A-Z excluding I and O)\n * - Easting: 5 digits (can be 1-5 based on precision)\n * - Northing: 5 digits (can be 1-5 based on precision)\n *\n * Total segments: 5 editable\n *\n * Reference: /packages/geo/src/coordinates/mgrs/parser.ts\n * Pattern: /^((?:..?)?)(\\w?)\\s*((?:\\w{2})?)\\s*(?:(\\d+(?:\\.\\d*)?)?)\\s*(?:(\\d+(?:\\.\\d*)?)?)$/i\n */\nexport const mgrsSegmentConfigs: SegmentConfig[] = [\n // Zone (1-60)\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 60\n pad: NUMERIC_PAD,\n },\n // Band (C-X, excluding I and O)\n {\n type: 'alphanumeric',\n placeholder: 'T',\n allowedChars: '[C-HJ-NP-X]', // Excludes I and O\n maxLength: 1,\n pad: 0,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Grid 100km identifier (2 letters, A-Z excluding I and O)\n {\n type: 'alphanumeric',\n placeholder: 'WM',\n allowedChars: '[A-HJ-NP-Z]', // Excludes I and O\n maxLength: 2,\n pad: 0,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Easting (5 digits, can be 1-5 based on precision)\n {\n type: 'numeric',\n placeholder: '00000',\n allowedChars: '[0-9]',\n maxLength: 5,\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Northing (5 digits, can be 1-5 based on precision)\n {\n type: 'numeric',\n placeholder: '00000',\n allowedChars: '[0-9]',\n maxLength: 5,\n pad: LAST_PAD,\n },\n];\n\n/**\n * UTM (Universal Transverse Mercator) Segment Configuration\n *\n * Format: [zone][hemisphere] [easting] [northing]\n * Example: 18N 585628 4511644\n *\n * Segments:\n * - Zone: 1-60, 2 digits\n * - Hemisphere: N or S, 1 letter\n * - Easting: 6-7 digits\n * - Northing: 7 digits\n *\n * Total segments: 4 editable\n *\n * Reference: /packages/geo/src/coordinates/utm/parser.ts\n * Pattern: /^((?:..)?)\\s*(\\w?)\\s*(?:(\\d+(?:\\.\\d*)?)?)\\s*(?:(\\d+(?:\\.\\d*)?)?)$/i\n */\nexport const utmSegmentConfigs: SegmentConfig[] = [\n // Zone (1-60)\n {\n type: 'numeric',\n placeholder: '00',\n allowedChars: '[0-9]',\n maxLength: 2, // Max: 60\n pad: NUMERIC_PAD,\n },\n // Hemisphere (N or S)\n {\n type: 'directional',\n placeholder: 'N',\n allowedChars: '[NS]',\n maxLength: 1,\n pad: 0,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Easting (6-7 digits)\n {\n type: 'numeric',\n placeholder: '000000',\n allowedChars: '[0-9]',\n maxLength: 7,\n pad: NUMERIC_PAD,\n },\n {\n type: 'literal',\n value: ' ',\n },\n // Northing (7 digits)\n {\n type: 'numeric',\n placeholder: '0000000',\n allowedChars: '[0-9]',\n maxLength: 7,\n pad: LAST_PAD,\n },\n];\n\n/**\n * Get segment configurations for a specific coordinate system\n *\n * @param format - The coordinate system format\n * @returns Array of segment configurations for the specified format\n */\nexport function getSegmentConfigs(format: CoordinateSystem): SegmentConfig[] {\n switch (format) {\n case 'dd':\n return ddSegmentConfigs;\n case 'ddm':\n return ddmSegmentConfigs;\n case 'dms':\n return dmsSegmentConfigs;\n case 'mgrs':\n return mgrsSegmentConfigs;\n case 'utm':\n return utmSegmentConfigs;\n default:\n // Default to DD format if unknown format provided\n return ddSegmentConfigs;\n }\n}\n\n/**\n * Get format description with example\n *\n * Provides a user-friendly description of the coordinate format with an example value.\n * These descriptions can be used as helper text to guide users on the expected format.\n *\n * @param format - The coordinate system format\n * @returns Description string with format example\n */\nexport function getFormatDescription(format: CoordinateSystem): string {\n switch (format) {\n case 'dd':\n return 'Example: 40.7128, -74.0060 (New York City)';\n case 'ddm':\n return \"Example: 40° 42.768' N, 74° 0.360' W (New York City)\";\n case 'dms':\n return 'Example: 40° 42\\' 46.08\" N, 74° 0\\' 21.60\" W (New York City)';\n case 'mgrs':\n return 'Example: 18T WL 80654 06346 (New York City)';\n case 'utm':\n return 'Example: 18N 585628 4511644 (New York City)';\n default:\n return '';\n }\n}\n\n/**\n * Get editable segment count for a format\n *\n * Returns the number of editable segments (excluding literal separators) for each format.\n * This is useful for initializing segment values and validation.\n *\n * @param format - The coordinate system format\n * @returns Number of editable segments\n */\nexport function getEditableSegmentCount(format: CoordinateSystem): number {\n const configs = getSegmentConfigs(format);\n return configs.filter((config) => config.type !== 'literal').length;\n}\n\n/**\n * Validate segment count for each format\n *\n * Expected editable segment counts:\n * - DD: 2 segments (lat, lon)\n * - DDM: 6 segments (lat_deg, lat_min, lat_dir, lon_deg, lon_min, lon_dir)\n * - DMS: 8 segments (lat_deg, lat_min, lat_sec, lat_dir, lon_deg, lon_min, lon_sec, lon_dir)\n * - MGRS: 5 segments (zone, band, grid, easting, northing)\n * - UTM: 4 segments (zone, hemisphere, easting, northing)\n */\nexport const EXPECTED_SEGMENT_COUNTS: Record<CoordinateSystem, number> = {\n dd: 2,\n ddm: 6,\n dms: 8,\n mgrs: 5,\n utm: 4,\n};\n\n/**\n * Get semantic accessibility label for a segment based on format and editable index\n *\n * Provides descriptive labels for screen readers (e.g., \"Latitude degrees\", \"Longitude minutes\")\n * to improve accessibility beyond generic \"Coordinate segment 1\" announcements.\n *\n * @param format - The coordinate system format\n * @param editableIndex - The index of the editable segment (0-based, excluding literals)\n * @returns Semantic label string for the segment\n */\nexport function getSegmentLabel(\n format: CoordinateSystem,\n editableIndex: number,\n): string {\n switch (format) {\n case 'dd':\n // DD: [lat, lon]\n return editableIndex === 0 ? 'Latitude' : 'Longitude';\n\n case 'ddm':\n // DDM: [lat_deg, lat_min, lat_dir, lon_deg, lon_min, lon_dir]\n switch (editableIndex) {\n case 0:\n return 'Latitude degrees';\n case 1:\n return 'Latitude minutes';\n case 2:\n return 'Latitude direction';\n case 3:\n return 'Longitude degrees';\n case 4:\n return 'Longitude minutes';\n case 5:\n return 'Longitude direction';\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n\n case 'dms':\n // DMS: [lat_deg, lat_min, lat_sec, lat_dir, lon_deg, lon_min, lon_sec, lon_dir]\n switch (editableIndex) {\n case 0:\n return 'Latitude degrees';\n case 1:\n return 'Latitude minutes';\n case 2:\n return 'Latitude seconds';\n case 3:\n return 'Latitude direction';\n case 4:\n return 'Longitude degrees';\n case 5:\n return 'Longitude minutes';\n case 6:\n return 'Longitude seconds';\n case 7:\n return 'Longitude direction';\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n\n case 'mgrs':\n // MGRS: [zone, band, grid, easting, northing]\n switch (editableIndex) {\n case 0:\n return 'MGRS zone';\n case 1:\n return 'MGRS band';\n case 2:\n return 'MGRS grid square';\n case 3:\n return 'MGRS easting';\n case 4:\n return 'MGRS northing';\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n\n case 'utm':\n // UTM: [zone, hemisphere, easting, northing]\n switch (editableIndex) {\n case 0:\n return 'UTM zone';\n case 1:\n return 'UTM hemisphere';\n case 2:\n return 'UTM easting';\n case 3:\n return 'UTM northing';\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n\n default:\n return `Coordinate segment ${editableIndex + 1}`;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,MAAM,cAAc;;AAGpB,MAAM,WAAW;;AAGjB,MAAa,kBAAkB;;;;;;;;;;;;;AAc/B,MAAaA,mBAAoC;CAC/C;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CACD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;;;;;;;;;;;AAkBD,MAAaC,oBAAqC;CAEhD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;;;;;;;;;;;;;AAoBD,MAAaC,oBAAqC;CAEhD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;;;;;;;;;;;;;AAoBD,MAAaC,qBAAsC;CAEjD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;;;;;;;;;;;;AAmBD,MAAaC,oBAAqC;CAEhD;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACD;EACE,MAAM;EACN,OAAO;EACR;CAED;EACE,MAAM;EACN,aAAa;EACb,cAAc;EACd,WAAW;EACX,KAAK;EACN;CACF;;;;;;;AAQD,SAAgB,kBAAkB,QAA2C;AAC3E,SAAQ,QAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,QAEE,QAAO;;;;;;;;;;;;AAab,SAAgB,qBAAqB,QAAkC;AACrE,SAAQ,QAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,KAAK,OACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,QACE,QAAO;;;;;;;;;;;;AAab,SAAgB,wBAAwB,QAAkC;AAExE,QADgB,kBAAkB,OAAO,CAC1B,QAAQ,WAAW,OAAO,SAAS,UAAU,CAAC;;;;;;;;;;;;AAa/D,MAAaC,0BAA4D;CACvE,IAAI;CACJ,KAAK;CACL,KAAK;CACL,MAAM;CACN,KAAK;CACN;;;;;;;;;;;AAYD,SAAgB,gBACd,QACA,eACQ;AACR,SAAQ,QAAR;EACE,KAAK,KAEH,QAAO,kBAAkB,IAAI,aAAa;EAE5C,KAAK,MAEH,SAAQ,eAAR;GACE,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,QACE,QAAO,sBAAsB,gBAAgB;;EAGnD,KAAK,MAEH,SAAQ,eAAR;GACE,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,QACE,QAAO,sBAAsB,gBAAgB;;EAGnD,KAAK,OAEH,SAAQ,eAAR;GACE,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,QACE,QAAO,sBAAsB,gBAAgB;;EAGnD,KAAK,MAEH,SAAQ,eAAR;GACE,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,KAAK,EACH,QAAO;GACT,QACE,QAAO,sBAAsB,gBAAgB;;EAGnD,QACE,QAAO,sBAAsB,gBAAgB"}
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { CoordinateSegmentProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime31 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime61 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/coordinate-field/segment.d.ts
18
18
 
@@ -65,7 +65,7 @@ declare function CoordinateSegment({
65
65
  onAutoRetreat,
66
66
  pad,
67
67
  ariaLabel
68
- }: CoordinateSegmentProps): react_jsx_runtime31.JSX.Element;
68
+ }: CoordinateSegmentProps): react_jsx_runtime61.JSX.Element;
69
69
  //#endregion
70
70
  export { CoordinateSegment };
71
71
  //# sourceMappingURL=segment.d.ts.map
@@ -18,7 +18,9 @@
18
18
  }
19
19
 
20
20
  .control {
21
- @apply fg-primary-bold gap-m rounded-medium px-s py-xs font-display outline-interactive flex w-fit items-center outline;
21
+ @apply fg-primary-bold gap-m rounded-medium px-s py-xs font-display outline-interactive flex w-full items-center outline;
22
+
23
+ min-width: var(--min-width, unset);
22
24
 
23
25
  @variant group-size-medium/coordinate-field {
24
26
  @apply text-body-m;
@@ -42,11 +44,19 @@
42
44
  }
43
45
 
44
46
  .input {
45
- @apply gap-xs flex flex-1 items-center;
47
+ @apply flex items-center;
48
+
49
+ &.inline {
50
+ @apply w-full flex-row;
51
+ }
52
+
53
+ &.stacked {
54
+ @apply w-full flex-col items-end;
55
+ }
46
56
  }
47
57
 
48
58
  .literal {
49
- @apply fg-primary-muted;
59
+ @apply fg-primary-muted pr-xs;
50
60
  }
51
61
 
52
62
  .segment {
@@ -65,6 +75,14 @@
65
75
  }
66
76
  }
67
77
 
78
+ .segmentGroup {
79
+ @apply w-full;
80
+
81
+ &.stacked {
82
+ @apply w-full text-right;
83
+ }
84
+ }
85
+
68
86
  .description {
69
87
  @apply fg-primary-muted text-body-xs;
70
88
 
@@ -90,6 +90,8 @@ type CoordinateFieldState = {
90
90
  isRequired: boolean;
91
91
  /** Size variant of the field */
92
92
  size: CoordinateFieldProps['size'];
93
+ /** Whether or not the logical coordinate fields are inlined or stacked */
94
+ variant: CoordinateFieldProps['variant'];
93
95
  /** Function to register timeouts for cleanup on unmount */
94
96
  registerTimeout: (timeoutId: NodeJS.Timeout) => void;
95
97
  };
@@ -185,6 +187,11 @@ type CoordinateFieldProps = Omit<TextFieldProps, 'children' | 'className' | 'pla
185
187
  * - CoordinateValue: controlled mode with valid value
186
188
  */
187
189
  value?: CoordinateValue | null;
190
+ /**
191
+ * Whether or not the input is stacked or inline
192
+ * @default 'inline'
193
+ */
194
+ variant?: 'inline' | 'stacked';
188
195
  /**
189
196
  * Default uncontrolled value in Decimal Degrees format
190
197
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":["COORDINATE_FORMAT_LABELS: Record<CoordinateSystem, string>","COORDINATE_FORMAT_NAMES: Record<CoordinateSystem, string>","COORDINATE_SYSTEMS: readonly CoordinateSystem[]"],"sources":["../../../src/components/coordinate-field/types.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {\n Dispatch,\n KeyboardEvent,\n RefAttributes,\n SetStateAction,\n} from 'react';\nimport type {\n TextFieldProps as AriaTextFieldProps,\n FieldErrorProps,\n LabelProps,\n} from 'react-aria-components';\n\n/**\n * Supported coordinate systems for display and input\n */\nexport type CoordinateSystem = 'dd' | 'ddm' | 'dms' | 'mgrs' | 'utm';\n\n/**\n * Short labels for coordinate formats (used in popover)\n */\nexport const COORDINATE_FORMAT_LABELS: Record<CoordinateSystem, string> = {\n dd: 'DD',\n ddm: 'DDM',\n dms: 'DMS',\n mgrs: 'MGRS',\n utm: 'UTM',\n};\n\n/**\n * Full names for coordinate formats (used in popover titles/descriptions)\n */\nexport const COORDINATE_FORMAT_NAMES: Record<CoordinateSystem, string> = {\n dd: 'Decimal Degrees',\n ddm: 'Degrees Decimal Minutes',\n dms: 'Degrees Minutes Seconds',\n mgrs: 'Military Grid Reference System',\n utm: 'Universal Transverse Mercator',\n};\n\n/**\n * All supported coordinate systems\n * Use this constant instead of hardcoding the array in multiple places\n */\nexport const COORDINATE_SYSTEMS: readonly CoordinateSystem[] = [\n 'dd',\n 'dms',\n 'ddm',\n 'mgrs',\n 'utm',\n] as const;\n\n/**\n * Coordinate value in Decimal Degrees format (internal representation)\n * All coordinate values are normalized to this format internally\n */\nexport type CoordinateValue = {\n lat: number; // Latitude in decimal degrees (-90 to 90)\n lon: number; // Longitude in decimal degrees (-180 to 180)\n};\n\n/**\n * Types of segments in a coordinate input\n */\nexport type SegmentType =\n | 'numeric'\n | 'directional'\n | 'literal'\n | 'alphanumeric';\n\n/**\n * Configuration for a single coordinate segment\n */\nexport type SegmentConfig = {\n type: SegmentType;\n /** Placeholder text shown when segment is empty */\n placeholder?: string;\n /** Maximum character length for the segment */\n maxLength?: number;\n /** Regex pattern for allowed characters */\n allowedChars?: string;\n /** Fixed value for literal segments (e.g., \", \" or \"º\") */\n value?: string;\n /** Padding in CSS 'ch' units to add to the segment width (defaults to 0.5 if not specified) */\n pad?: number;\n};\n\n/**\n * Result of parsing a pasted coordinate string\n */\nexport type ParsedCoordinateMatch = {\n /** The coordinate system format that matched */\n format: CoordinateSystem;\n /** The coordinate value in DD format */\n value: CoordinateValue;\n /** Display string in the matched format */\n displayString: string;\n};\n\n/**\n * State shared with child components through context\n */\nexport type CoordinateFieldState = {\n segmentValues: string[];\n format: CoordinateFieldProps['format'];\n /**\n * Current coordinate value in DD format\n * - undefined: uncontrolled mode with no default value\n * - null: controlled mode with empty/invalid value\n * - CoordinateValue: valid coordinate\n */\n currentValue?: CoordinateValue | null;\n /** Validation errors from @accelint/geo */\n validationErrors: string[];\n isDisabled: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n /** Size variant of the field */\n size: CoordinateFieldProps['size'];\n /** Function to register timeouts for cleanup on unmount */\n registerTimeout: (timeoutId: NodeJS.Timeout) => void;\n};\n\n/**\n * Props for the CoordinateSegment component\n */\nexport type CoordinateSegmentProps = {\n /** Current value of the segment */\n value: string;\n /** Callback when the segment value changes */\n onChange: (value: string) => void;\n /** Callback when the segment receives focus */\n onFocus?: () => void;\n /** Callback when the segment loses focus */\n onBlur?: () => void;\n /** Callback for keyboard events (used for navigation between segments) */\n onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;\n /** Placeholder text to display when segment is empty */\n placeholder?: string;\n /** Maximum character length for the segment */\n maxLength?: number;\n /** Custom className for styling */\n className?: string;\n /** Whether the segment is disabled */\n isDisabled?: boolean;\n /** Regex pattern for allowed characters (e.g., \"[0-9\\\\-\\\\.]\" for numeric, \"[NSEW]\" for directional) */\n allowedChars?: string;\n /** Ref to the input element for programmatic focus management */\n segmentRef?: React.RefObject<HTMLInputElement>;\n /** Index of this segment in the parent field (for accessibility) */\n segmentIndex?: number;\n /** Total number of segments (for accessibility) */\n totalSegments?: number;\n /** Callback to trigger auto-advance to next segment */\n onAutoAdvance?: () => void;\n /** Callback to trigger auto-retreat to previous segment */\n onAutoRetreat?: () => void;\n /** Padding in CSS 'ch' units to add to the segment width (defaults to 0.5 if not specified) */\n pad?: number;\n /** Semantic accessibility label for the segment (e.g., \"Latitude degrees\") */\n ariaLabel?: string;\n};\n\n/**\n * Props for the CoordinateField component\n *\n * Extends AriaTextFieldProps to inherit standard form field props (id, isDisabled, isRequired, etc.)\n */\nexport type CoordinateFieldProps = Omit<\n AriaTextFieldProps,\n | 'children'\n | 'className'\n | 'placeholder'\n | 'type'\n | 'pattern'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'name' // Not applicable to multi-segment fields\n> &\n RefAttributes<HTMLDivElement> & {\n /**\n * Custom class names for component slots\n */\n classNames?: {\n field?: string;\n label?: LabelProps['className'];\n control?: string;\n input?: string;\n segment?: string;\n description?: string;\n error?: FieldErrorProps['className'];\n formatButton?: string;\n };\n\n /**\n * Label text displayed above the input (medium size only)\n */\n label?: string;\n\n /**\n * Helper text displayed below the input\n */\n description?: string;\n\n /**\n * Error message to display when the field is invalid\n */\n errorMessage?: string;\n\n /**\n * Display format for coordinate input\n * @default 'dd' (Decimal Degrees)\n */\n format?: CoordinateSystem;\n\n /**\n * Size variant of the field\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n\n /**\n * Whether to show the format button for copying coordinates in different formats\n * @default true\n */\n showFormatButton?: boolean;\n\n /**\n * Controlled value in Decimal Degrees format\n * - undefined: uncontrolled mode\n * - null: controlled mode with no/invalid value\n * - CoordinateValue: controlled mode with valid value\n */\n value?: CoordinateValue | null;\n\n /**\n * Default uncontrolled value in Decimal Degrees format\n */\n defaultValue?: CoordinateValue;\n\n /**\n * Callback fired when the coordinate value changes\n * @param value - The new coordinate value in DD format, or null if invalid\n */\n onChange?:\n | Dispatch<SetStateAction<CoordinateValue | null>>\n | ((value: CoordinateValue | null) => void);\n\n /**\n * Callback fired when validation or paste errors occur\n * @param message - Error message (\"Invalid coordinate value\" for validation errors, \"Invalid coordinate format\" for paste errors)\n * @param context - Additional context about the error:\n * - Validation errors: `{ errors: string[], format: string, segments: string[] }`\n * - Paste errors: `{ pastedText: string }`\n */\n onError?: (message: string, context?: Record<string, unknown>) => void;\n };\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAaA,2BAA6D;CACxE,IAAI;CACJ,KAAK;CACL,KAAK;CACL,MAAM;CACN,KAAK;CACN;;;;AAKD,MAAaC,0BAA4D;CACvE,IAAI;CACJ,KAAK;CACL,KAAK;CACL,MAAM;CACN,KAAK;CACN;;;;;AAMD,MAAaC,qBAAkD;CAC7D;CACA;CACA;CACA;CACA;CACD"}
1
+ {"version":3,"file":"types.js","names":["COORDINATE_FORMAT_LABELS: Record<CoordinateSystem, string>","COORDINATE_FORMAT_NAMES: Record<CoordinateSystem, string>","COORDINATE_SYSTEMS: readonly CoordinateSystem[]"],"sources":["../../../src/components/coordinate-field/types.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type {\n Dispatch,\n KeyboardEvent,\n RefAttributes,\n SetStateAction,\n} from 'react';\nimport type {\n TextFieldProps as AriaTextFieldProps,\n FieldErrorProps,\n LabelProps,\n} from 'react-aria-components';\n\n/**\n * Supported coordinate systems for display and input\n */\nexport type CoordinateSystem = 'dd' | 'ddm' | 'dms' | 'mgrs' | 'utm';\n\n/**\n * Short labels for coordinate formats (used in popover)\n */\nexport const COORDINATE_FORMAT_LABELS: Record<CoordinateSystem, string> = {\n dd: 'DD',\n ddm: 'DDM',\n dms: 'DMS',\n mgrs: 'MGRS',\n utm: 'UTM',\n};\n\n/**\n * Full names for coordinate formats (used in popover titles/descriptions)\n */\nexport const COORDINATE_FORMAT_NAMES: Record<CoordinateSystem, string> = {\n dd: 'Decimal Degrees',\n ddm: 'Degrees Decimal Minutes',\n dms: 'Degrees Minutes Seconds',\n mgrs: 'Military Grid Reference System',\n utm: 'Universal Transverse Mercator',\n};\n\n/**\n * All supported coordinate systems\n * Use this constant instead of hardcoding the array in multiple places\n */\nexport const COORDINATE_SYSTEMS: readonly CoordinateSystem[] = [\n 'dd',\n 'dms',\n 'ddm',\n 'mgrs',\n 'utm',\n] as const;\n\n/**\n * Coordinate value in Decimal Degrees format (internal representation)\n * All coordinate values are normalized to this format internally\n */\nexport type CoordinateValue = {\n lat: number; // Latitude in decimal degrees (-90 to 90)\n lon: number; // Longitude in decimal degrees (-180 to 180)\n};\n\n/**\n * Types of segments in a coordinate input\n */\nexport type SegmentType =\n | 'numeric'\n | 'directional'\n | 'literal'\n | 'alphanumeric';\n\n/**\n * Configuration for a single coordinate segment\n */\nexport type SegmentConfig = {\n type: SegmentType;\n /** Placeholder text shown when segment is empty */\n placeholder?: string;\n /** Maximum character length for the segment */\n maxLength?: number;\n /** Regex pattern for allowed characters */\n allowedChars?: string;\n /** Fixed value for literal segments (e.g., \", \" or \"º\") */\n value?: string;\n /** Padding in CSS 'ch' units to add to the segment width (defaults to 0.5 if not specified) */\n pad?: number;\n};\n\n/**\n * Result of parsing a pasted coordinate string\n */\nexport type ParsedCoordinateMatch = {\n /** The coordinate system format that matched */\n format: CoordinateSystem;\n /** The coordinate value in DD format */\n value: CoordinateValue;\n /** Display string in the matched format */\n displayString: string;\n};\n\n/**\n * State shared with child components through context\n */\nexport type CoordinateFieldState = {\n segmentValues: string[];\n format: CoordinateFieldProps['format'];\n /**\n * Current coordinate value in DD format\n * - undefined: uncontrolled mode with no default value\n * - null: controlled mode with empty/invalid value\n * - CoordinateValue: valid coordinate\n */\n currentValue?: CoordinateValue | null;\n /** Validation errors from @accelint/geo */\n validationErrors: string[];\n isDisabled: boolean;\n isInvalid: boolean;\n isRequired: boolean;\n /** Size variant of the field */\n size: CoordinateFieldProps['size'];\n /** Whether or not the logical coordinate fields are inlined or stacked */\n variant: CoordinateFieldProps['variant'];\n /** Function to register timeouts for cleanup on unmount */\n registerTimeout: (timeoutId: NodeJS.Timeout) => void;\n};\n\n/**\n * Props for the CoordinateSegment component\n */\nexport type CoordinateSegmentProps = {\n /** Current value of the segment */\n value: string;\n /** Callback when the segment value changes */\n onChange: (value: string) => void;\n /** Callback when the segment receives focus */\n onFocus?: () => void;\n /** Callback when the segment loses focus */\n onBlur?: () => void;\n /** Callback for keyboard events (used for navigation between segments) */\n onKeyDown?: (e: KeyboardEvent<HTMLInputElement>) => void;\n /** Placeholder text to display when segment is empty */\n placeholder?: string;\n /** Maximum character length for the segment */\n maxLength?: number;\n /** Custom className for styling */\n className?: string;\n /** Whether the segment is disabled */\n isDisabled?: boolean;\n /** Regex pattern for allowed characters (e.g., \"[0-9\\\\-\\\\.]\" for numeric, \"[NSEW]\" for directional) */\n allowedChars?: string;\n /** Ref to the input element for programmatic focus management */\n segmentRef?: React.RefObject<HTMLInputElement>;\n /** Index of this segment in the parent field (for accessibility) */\n segmentIndex?: number;\n /** Total number of segments (for accessibility) */\n totalSegments?: number;\n /** Callback to trigger auto-advance to next segment */\n onAutoAdvance?: () => void;\n /** Callback to trigger auto-retreat to previous segment */\n onAutoRetreat?: () => void;\n /** Padding in CSS 'ch' units to add to the segment width (defaults to 0.5 if not specified) */\n pad?: number;\n /** Semantic accessibility label for the segment (e.g., \"Latitude degrees\") */\n ariaLabel?: string;\n};\n\n/**\n * Props for the CoordinateField component\n *\n * Extends AriaTextFieldProps to inherit standard form field props (id, isDisabled, isRequired, etc.)\n */\nexport type CoordinateFieldProps = Omit<\n AriaTextFieldProps,\n | 'children'\n | 'className'\n | 'placeholder'\n | 'type'\n | 'pattern'\n | 'value'\n | 'defaultValue'\n | 'onChange'\n | 'name' // Not applicable to multi-segment fields\n> &\n RefAttributes<HTMLDivElement> & {\n /**\n * Custom class names for component slots\n */\n classNames?: {\n field?: string;\n label?: LabelProps['className'];\n control?: string;\n input?: string;\n segment?: string;\n description?: string;\n error?: FieldErrorProps['className'];\n formatButton?: string;\n };\n\n /**\n * Label text displayed above the input (medium size only)\n */\n label?: string;\n\n /**\n * Helper text displayed below the input\n */\n description?: string;\n\n /**\n * Error message to display when the field is invalid\n */\n errorMessage?: string;\n\n /**\n * Display format for coordinate input\n * @default 'dd' (Decimal Degrees)\n */\n format?: CoordinateSystem;\n\n /**\n * Size variant of the field\n * @default 'medium'\n */\n size?: 'small' | 'medium';\n\n /**\n * Whether to show the format button for copying coordinates in different formats\n * @default true\n */\n showFormatButton?: boolean;\n\n /**\n * Controlled value in Decimal Degrees format\n * - undefined: uncontrolled mode\n * - null: controlled mode with no/invalid value\n * - CoordinateValue: controlled mode with valid value\n */\n value?: CoordinateValue | null;\n\n /**\n * Whether or not the input is stacked or inline\n * @default 'inline'\n */\n variant?: 'inline' | 'stacked';\n\n /**\n * Default uncontrolled value in Decimal Degrees format\n */\n defaultValue?: CoordinateValue;\n\n /**\n * Callback fired when the coordinate value changes\n * @param value - The new coordinate value in DD format, or null if invalid\n */\n onChange?:\n | Dispatch<SetStateAction<CoordinateValue | null>>\n | ((value: CoordinateValue | null) => void);\n\n /**\n * Callback fired when validation or paste errors occur\n * @param message - Error message (\"Invalid coordinate value\" for validation errors, \"Invalid coordinate format\" for paste errors)\n * @param context - Additional context about the error:\n * - Validation errors: `{ errors: string[], format: string, segments: string[] }`\n * - Paste errors: `{ pastedText: string }`\n */\n onError?: (message: string, context?: Record<string, unknown>) => void;\n };\n"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAaA,2BAA6D;CACxE,IAAI;CACJ,KAAK;CACL,KAAK;CACL,MAAM;CACN,KAAK;CACN;;;;AAKD,MAAaC,0BAA4D;CACvE,IAAI;CACJ,KAAK;CACL,KAAK;CACL,MAAM;CACN,KAAK;CACN;;;;;AAMD,MAAaC,qBAAkD;CAC7D;CACA;CACA;CACA;CACA;CACD"}
@@ -27,15 +27,16 @@ declare const FORMAT_BUTTON_WIDTH = 3.5;
27
27
  /** Gap between input and button (gap-m = 1rem = ~1ch) */
28
28
  declare const INPUT_BUTTON_GAP = 1.5;
29
29
  /**
30
- * Calculates the maximum width needed for the coordinate field control container.
30
+ * Calculates the minimum width needed for the coordinate field control container.
31
31
  * This keeps the outlined container at a fixed width while segments animate.
32
32
  *
33
+ * @private
33
34
  * @param editableSegmentConfigs - Array of editable segment configurations
34
35
  * @param segmentConfigs - Array of all segment configurations (including literals)
35
36
  * @param showFormatButton - Whether the format button is displayed
36
37
  * @returns The calculated width as a CSS string (e.g., "25ch")
37
38
  */
38
- declare function calculateMaxControlWidth(editableSegmentConfigs: SegmentConfig[], segmentConfigs: SegmentConfig[], showFormatButton: boolean): string;
39
+ declare function calculateMinControlWidth(editableSegmentConfigs: SegmentConfig[], segmentConfigs: SegmentConfig[], showFormatButton: boolean): string;
39
40
  //#endregion
40
- export { CONTAINER_PADDING_WIDTH, FORMAT_BUTTON_WIDTH, INPUT_BUTTON_GAP, SEGMENT_GAP_WIDTH, calculateMaxControlWidth };
41
+ export { CONTAINER_PADDING_WIDTH, FORMAT_BUTTON_WIDTH, INPUT_BUTTON_GAP, SEGMENT_GAP_WIDTH, calculateMinControlWidth };
41
42
  //# sourceMappingURL=width-utils.d.ts.map
@@ -26,15 +26,16 @@ const FORMAT_BUTTON_WIDTH = 3.5;
26
26
  /** Gap between input and button (gap-m = 1rem = ~1ch) */
27
27
  const INPUT_BUTTON_GAP = 1.5;
28
28
  /**
29
- * Calculates the maximum width needed for the coordinate field control container.
29
+ * Calculates the minimum width needed for the coordinate field control container.
30
30
  * This keeps the outlined container at a fixed width while segments animate.
31
31
  *
32
+ * @private
32
33
  * @param editableSegmentConfigs - Array of editable segment configurations
33
34
  * @param segmentConfigs - Array of all segment configurations (including literals)
34
35
  * @param showFormatButton - Whether the format button is displayed
35
36
  * @returns The calculated width as a CSS string (e.g., "25ch")
36
37
  */
37
- function calculateMaxControlWidth(editableSegmentConfigs, segmentConfigs, showFormatButton) {
38
+ function calculateMinControlWidth(editableSegmentConfigs, segmentConfigs, showFormatButton) {
38
39
  const segmentWidth = editableSegmentConfigs.reduce((sum, config) => {
39
40
  const maxLen = config.maxLength || 0;
40
41
  const padding = config.pad ?? .5;
@@ -49,5 +50,5 @@ function calculateMaxControlWidth(editableSegmentConfigs, segmentConfigs, showFo
49
50
  }
50
51
 
51
52
  //#endregion
52
- export { CONTAINER_PADDING_WIDTH, FORMAT_BUTTON_WIDTH, INPUT_BUTTON_GAP, SEGMENT_GAP_WIDTH, calculateMaxControlWidth };
53
+ export { CONTAINER_PADDING_WIDTH, FORMAT_BUTTON_WIDTH, INPUT_BUTTON_GAP, SEGMENT_GAP_WIDTH, calculateMinControlWidth };
53
54
  //# sourceMappingURL=width-utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"width-utils.js","names":[],"sources":["../../../src/components/coordinate-field/width-utils.ts"],"sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { SegmentConfig } from './types';\n\n/**\n * Layout spacing constants for coordinate field width calculations.\n * All values are in character widths (ch units) to ensure consistent sizing\n * with monospace coordinate values.\n */\n\n/** Gap spacing between segments (0.5rem = ~0.5ch per gap) */\nexport const SEGMENT_GAP_WIDTH = 0.5;\n\n/** Container padding (px-s = 0.5rem on each side = ~1ch total) */\nexport const CONTAINER_PADDING_WIDTH = 2;\n\n/** Format button width (icon button is roughly 2.5-3ch) */\nexport const FORMAT_BUTTON_WIDTH = 3.5;\n\n/** Gap between input and button (gap-m = 1rem = ~1ch) */\nexport const INPUT_BUTTON_GAP = 1.5;\n\n/**\n * Calculates the maximum width needed for the coordinate field control container.\n * This keeps the outlined container at a fixed width while segments animate.\n *\n * @param editableSegmentConfigs - Array of editable segment configurations\n * @param segmentConfigs - Array of all segment configurations (including literals)\n * @param showFormatButton - Whether the format button is displayed\n * @returns The calculated width as a CSS string (e.g., \"25ch\")\n */\nexport function calculateMaxControlWidth(\n editableSegmentConfigs: SegmentConfig[],\n segmentConfigs: SegmentConfig[],\n showFormatButton: boolean,\n): string {\n // Sum all editable segment max widths with their padding\n const segmentWidth = editableSegmentConfigs.reduce((sum, config) => {\n const maxLen = config.maxLength || 0;\n const padding = config.pad ?? 0.5;\n return sum + maxLen + padding;\n }, 0);\n\n // Calculate width of literal characters (colons, spaces, etc.)\n const literalWidth = segmentConfigs\n .filter((c) => c.type === 'literal')\n .reduce((sum, c) => sum + (c.value?.length || 0), 0);\n\n // Add gap spacing between segments\n // Number of gaps = number of segments - 1 (minimum 0)\n const gapCount = Math.max(0, segmentConfigs.length - 1);\n const gapWidth = gapCount * SEGMENT_GAP_WIDTH;\n\n // Add container padding\n const paddingWidth = CONTAINER_PADDING_WIDTH;\n\n // Add format button width if shown\n const buttonWidth = showFormatButton ? FORMAT_BUTTON_WIDTH : 0;\n\n // Add gap between input and button if button is shown\n const inputButtonGap = showFormatButton ? INPUT_BUTTON_GAP : 0;\n\n return `${segmentWidth + literalWidth + gapWidth + paddingWidth + buttonWidth + inputButtonGap}ch`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqBA,MAAa,oBAAoB;;AAGjC,MAAa,0BAA0B;;AAGvC,MAAa,sBAAsB;;AAGnC,MAAa,mBAAmB;;;;;;;;;;AAWhC,SAAgB,yBACd,wBACA,gBACA,kBACQ;CAER,MAAM,eAAe,uBAAuB,QAAQ,KAAK,WAAW;EAClE,MAAM,SAAS,OAAO,aAAa;EACnC,MAAM,UAAU,OAAO,OAAO;AAC9B,SAAO,MAAM,SAAS;IACrB,EAAE;CAGL,MAAM,eAAe,eAClB,QAAQ,MAAM,EAAE,SAAS,UAAU,CACnC,QAAQ,KAAK,MAAM,OAAO,EAAE,OAAO,UAAU,IAAI,EAAE;CAKtD,MAAM,WADW,KAAK,IAAI,GAAG,eAAe,SAAS,EAAE,GAC3B;CAG5B,MAAM,eAAe;CAGrB,MAAM,cAAc,mBAAmB,sBAAsB;CAG7D,MAAM,iBAAiB,mBAAmB,mBAAmB;AAE7D,QAAO,GAAG,eAAe,eAAe,WAAW,eAAe,cAAc,eAAe"}
1
+ {"version":3,"file":"width-utils.js","names":[],"sources":["../../../src/components/coordinate-field/width-utils.ts"],"sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { SegmentConfig } from './types';\n\n/**\n * Layout spacing constants for coordinate field width calculations.\n * All values are in character widths (ch units) to ensure consistent sizing\n * with monospace coordinate values.\n */\n\n/** Gap spacing between segments (0.5rem = ~0.5ch per gap) */\nexport const SEGMENT_GAP_WIDTH = 0.5;\n\n/** Container padding (px-s = 0.5rem on each side = ~1ch total) */\nexport const CONTAINER_PADDING_WIDTH = 2;\n\n/** Format button width (icon button is roughly 2.5-3ch) */\nexport const FORMAT_BUTTON_WIDTH = 3.5;\n\n/** Gap between input and button (gap-m = 1rem = ~1ch) */\nexport const INPUT_BUTTON_GAP = 1.5;\n\n/**\n * Calculates the minimum width needed for the coordinate field control container.\n * This keeps the outlined container at a fixed width while segments animate.\n *\n * @private\n * @param editableSegmentConfigs - Array of editable segment configurations\n * @param segmentConfigs - Array of all segment configurations (including literals)\n * @param showFormatButton - Whether the format button is displayed\n * @returns The calculated width as a CSS string (e.g., \"25ch\")\n */\nexport function calculateMinControlWidth(\n editableSegmentConfigs: SegmentConfig[],\n segmentConfigs: SegmentConfig[],\n showFormatButton: boolean,\n): string {\n // Sum all editable segment max widths with their padding\n const segmentWidth = editableSegmentConfigs.reduce((sum, config) => {\n const maxLen = config.maxLength || 0;\n const padding = config.pad ?? 0.5;\n return sum + maxLen + padding;\n }, 0);\n\n // Calculate width of literal characters (colons, spaces, etc.)\n const literalWidth = segmentConfigs\n .filter((c) => c.type === 'literal')\n .reduce((sum, c) => sum + (c.value?.length || 0), 0);\n\n // Add gap spacing between segments\n // Number of gaps = number of segments - 1 (minimum 0)\n const gapCount = Math.max(0, segmentConfigs.length - 1);\n const gapWidth = gapCount * SEGMENT_GAP_WIDTH;\n\n // Add container padding\n const paddingWidth = CONTAINER_PADDING_WIDTH;\n\n // Add format button width if shown\n const buttonWidth = showFormatButton ? FORMAT_BUTTON_WIDTH : 0;\n\n // Add gap between input and button if button is shown\n const inputButtonGap = showFormatButton ? INPUT_BUTTON_GAP : 0;\n\n return `${segmentWidth + literalWidth + gapWidth + paddingWidth + buttonWidth + inputButtonGap}ch`;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,oBAAoB;;AAGjC,MAAa,0BAA0B;;AAGvC,MAAa,sBAAsB;;AAGnC,MAAa,mBAAmB;;;;;;;;;;;AAYhC,SAAgB,yBACd,wBACA,gBACA,kBACQ;CAER,MAAM,eAAe,uBAAuB,QAAQ,KAAK,WAAW;EAClE,MAAM,SAAS,OAAO,aAAa;EACnC,MAAM,UAAU,OAAO,OAAO;AAC9B,SAAO,MAAM,SAAS;IACrB,EAAE;CAGL,MAAM,eAAe,eAClB,QAAQ,MAAM,EAAE,SAAS,UAAU,CACnC,QAAQ,KAAK,MAAM,OAAO,EAAE,OAAO,UAAU,IAAI,EAAE;CAKtD,MAAM,WADW,KAAK,IAAI,GAAG,eAAe,SAAS,EAAE,GAC3B;CAG5B,MAAM,eAAe;CAGrB,MAAM,cAAc,mBAAmB,sBAAsB;CAG7D,MAAM,iBAAiB,mBAAmB,mBAAmB;AAE7D,QAAO,GAAG,eAAe,eAAe,WAAW,eAAe,cAAc,eAAe"}
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { DateFieldProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime33 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime26 from "react/jsx-runtime";
16
16
  import { DateValue } from "@internationalized/date";
17
17
 
18
18
  //#region src/components/date-field/index.d.ts
@@ -74,7 +74,7 @@ declare function DateField<T extends DateValue>({
74
74
  isInvalid: isInvalidProp,
75
75
  isRequired,
76
76
  ...rest
77
- }: DateFieldProps<T>): react_jsx_runtime33.JSX.Element;
77
+ }: DateFieldProps<T>): react_jsx_runtime26.JSX.Element;
78
78
  //#endregion
79
79
  export { DateField };
80
80
  //# sourceMappingURL=index.d.ts.map
@@ -13,16 +13,16 @@
13
13
  import { ProviderProps } from "../../lib/types.js";
14
14
  import { DetailsListProps } from "./types.js";
15
15
  import "client-only";
16
- import * as react13 from "react";
16
+ import * as react1 from "react";
17
17
  import { ContextValue } from "react-aria-components";
18
- import * as react_jsx_runtime32 from "react/jsx-runtime";
18
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
19
19
 
20
20
  //#region src/components/details-list/context.d.ts
21
- declare const DetailsListContext: react13.Context<ContextValue<DetailsListProps, HTMLDListElement>>;
21
+ declare const DetailsListContext: react1.Context<ContextValue<DetailsListProps, HTMLDListElement>>;
22
22
  declare function DetailsListProvider({
23
23
  children,
24
24
  ...props
25
- }: ProviderProps<DetailsListProps>): react_jsx_runtime32.JSX.Element;
25
+ }: ProviderProps<DetailsListProps>): react_jsx_runtime8.JSX.Element;
26
26
  //#endregion
27
27
  export { DetailsListContext, DetailsListProvider };
28
28
  //# sourceMappingURL=context.d.ts.map
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { DetailsListProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime34 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/details-list/index.d.ts
18
18
 
@@ -48,7 +48,7 @@ import * as react_jsx_runtime34 from "react/jsx-runtime";
48
48
  declare function DetailsList({
49
49
  ref,
50
50
  ...props
51
- }: DetailsListProps): react_jsx_runtime34.JSX.Element;
51
+ }: DetailsListProps): react_jsx_runtime9.JSX.Element;
52
52
  //#endregion
53
53
  export { DetailsList };
54
54
  //# sourceMappingURL=index.d.ts.map
@@ -12,10 +12,10 @@
12
12
 
13
13
  import { DetailsListLabelProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime35 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/details-list/label.d.ts
18
- declare function DetailsListLabel(props: DetailsListLabelProps): react_jsx_runtime35.JSX.Element;
18
+ declare function DetailsListLabel(props: DetailsListLabelProps): react_jsx_runtime10.JSX.Element;
19
19
  //#endregion
20
20
  export { DetailsListLabel };
21
21
  //# sourceMappingURL=label.d.ts.map
@@ -12,10 +12,10 @@
12
12
 
13
13
  import { DetailsListValueProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime15 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/details-list/value.d.ts
18
- declare function DetailsListValue(props: DetailsListValueProps): react_jsx_runtime15.JSX.Element;
18
+ declare function DetailsListValue(props: DetailsListValueProps): react_jsx_runtime11.JSX.Element;
19
19
  //#endregion
20
20
  export { DetailsListValue };
21
21
  //# sourceMappingURL=value.d.ts.map
@@ -12,13 +12,13 @@
12
12
 
13
13
  import "client-only";
14
14
  import { ComponentProps } from "react";
15
- import * as react_jsx_runtime40 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/dialog/content.d.ts
18
18
  declare function DialogContent({
19
19
  children,
20
20
  className
21
- }: ComponentProps<'div'>): react_jsx_runtime40.JSX.Element;
21
+ }: ComponentProps<'div'>): react_jsx_runtime12.JSX.Element;
22
22
  //#endregion
23
23
  export { DialogContent };
24
24
  //# sourceMappingURL=content.d.ts.map
@@ -12,11 +12,11 @@
12
12
 
13
13
  import { DialogProps as DialogProps$1 } from "./types.js";
14
14
  import "client-only";
15
- import * as react16 from "react";
15
+ import * as react2 from "react";
16
16
  import { ContextValue } from "react-aria-components";
17
17
 
18
18
  //#region src/components/dialog/context.d.ts
19
- declare const DialogContext: react16.Context<ContextValue<DialogProps$1, HTMLDivElement>>;
19
+ declare const DialogContext: react2.Context<ContextValue<DialogProps$1, HTMLDivElement>>;
20
20
  //#endregion
21
21
  export { DialogContext };
22
22
  //# sourceMappingURL=context.d.ts.map
@@ -12,13 +12,13 @@
12
12
 
13
13
  import "client-only";
14
14
  import { ComponentProps } from "react";
15
- import * as react_jsx_runtime36 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/dialog/footer.d.ts
18
18
  declare function DialogFooter({
19
19
  children,
20
20
  className
21
- }: ComponentProps<'footer'>): react_jsx_runtime36.JSX.Element;
21
+ }: ComponentProps<'footer'>): react_jsx_runtime13.JSX.Element;
22
22
  //#endregion
23
23
  export { DialogFooter };
24
24
  //# sourceMappingURL=footer.d.ts.map
@@ -12,7 +12,7 @@
12
12
 
13
13
  import { DialogProps } from "./types.js";
14
14
  import "client-only";
15
- import * as react_jsx_runtime38 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/dialog/index.d.ts
18
18
 
@@ -43,7 +43,7 @@ import * as react_jsx_runtime38 from "react/jsx-runtime";
43
43
  declare function Dialog({
44
44
  ref,
45
45
  ...props
46
- }: DialogProps): react_jsx_runtime38.JSX.Element;
46
+ }: DialogProps): react_jsx_runtime14.JSX.Element;
47
47
  //#endregion
48
48
  export { Dialog };
49
49
  //# sourceMappingURL=index.d.ts.map
@@ -12,13 +12,13 @@
12
12
 
13
13
  import "client-only";
14
14
  import { HeadingProps } from "react-aria-components";
15
- import * as react_jsx_runtime39 from "react/jsx-runtime";
15
+ import * as react_jsx_runtime18 from "react/jsx-runtime";
16
16
 
17
17
  //#region src/components/dialog/title.d.ts
18
18
  declare function DialogTitle({
19
19
  children,
20
20
  className
21
- }: HeadingProps): react_jsx_runtime39.JSX.Element;
21
+ }: HeadingProps): react_jsx_runtime18.JSX.Element;
22
22
  //#endregion
23
23
  export { DialogTitle };
24
24
  //# sourceMappingURL=title.d.ts.map
@@ -13,16 +13,16 @@
13
13
  import { ProviderProps } from "../../lib/types.js";
14
14
  import { DividerProps } from "./types.js";
15
15
  import "client-only";
16
- import * as react9 from "react";
16
+ import * as react5 from "react";
17
17
  import { ContextValue } from "react-aria-components";
18
- import * as react_jsx_runtime24 from "react/jsx-runtime";
18
+ import * as react_jsx_runtime20 from "react/jsx-runtime";
19
19
 
20
20
  //#region src/components/divider/context.d.ts
21
- declare const DividerContext: react9.Context<ContextValue<DividerProps, HTMLHRElement>>;
21
+ declare const DividerContext: react5.Context<ContextValue<DividerProps, HTMLHRElement>>;
22
22
  declare function DividerProvider({
23
23
  children,
24
24
  ...props
25
- }: ProviderProps<DividerProps>): react_jsx_runtime24.JSX.Element;
25
+ }: ProviderProps<DividerProps>): react_jsx_runtime20.JSX.Element;
26
26
  //#endregion
27
27
  export { DividerContext, DividerProvider };
28
28
  //# sourceMappingURL=context.d.ts.map