@accelint/design-toolkit 9.4.0 → 9.5.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.
- package/catalog-info.yaml +2 -2
- package/dist/components/accordion/group.d.ts +2 -2
- package/dist/components/accordion/header.d.ts +2 -2
- package/dist/components/accordion/index.d.ts +2 -2
- package/dist/components/accordion/panel.d.ts +2 -2
- package/dist/components/accordion/styles.module.css +1 -1
- package/dist/components/accordion/trigger.d.ts +2 -2
- package/dist/components/action-bar/index.d.ts +2 -2
- package/dist/components/audio/index.d.ts +104 -0
- package/dist/components/audio/index.js +242 -0
- package/dist/components/audio/index.js.map +1 -0
- package/dist/components/audio/styles.module.css +77 -0
- package/dist/components/audio/types.d.ts +45 -0
- package/dist/components/audio/types.js +12 -0
- package/dist/components/avatar/context.d.ts +4 -4
- package/dist/components/avatar/index.d.ts +2 -2
- package/dist/components/badge/context.d.ts +4 -4
- package/dist/components/badge/index.d.ts +2 -2
- package/dist/components/breadcrumbs/index.d.ts +2 -2
- package/dist/components/breadcrumbs/item.d.ts +2 -2
- package/dist/components/breadcrumbs/styles.module.css +1 -0
- package/dist/components/button/__internal__/clear.js +42 -0
- package/dist/components/button/__internal__/clear.js.map +1 -0
- package/dist/components/button/__internal__/styles.module.css +23 -0
- package/dist/components/button/context.d.ts +8 -8
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/button/link.d.ts +2 -2
- package/dist/components/button/styles.module.css +1 -1
- package/dist/components/button/toggle.d.ts +2 -2
- package/dist/components/checkbox/context.d.ts +3 -3
- package/dist/components/checkbox/group.d.ts +2 -2
- package/dist/components/checkbox/index.d.ts +2 -2
- package/dist/components/chip/context.d.ts +4 -4
- package/dist/components/chip/deletable.d.ts +2 -2
- package/dist/components/chip/index.d.ts +2 -2
- package/dist/components/chip/list.d.ts +4 -4
- package/dist/components/chip/selectable.d.ts +2 -2
- package/dist/components/chip/styles.module.css +2 -2
- package/dist/components/classification-badge/context.d.ts +4 -4
- package/dist/components/classification-badge/index.d.ts +2 -2
- package/dist/components/classification-banner/context.d.ts +4 -4
- package/dist/components/classification-banner/index.d.ts +2 -2
- package/dist/components/clock/index.d.ts +2 -2
- package/dist/components/clock/index.js +1 -0
- package/dist/components/clock/index.js.map +1 -1
- package/dist/components/color-picker/index.d.ts +2 -2
- package/dist/components/combobox-field/context.d.ts +4 -4
- package/dist/components/combobox-field/index.d.ts +2 -2
- package/dist/components/combobox-field/index.js +42 -14
- package/dist/components/combobox-field/index.js.map +1 -1
- package/dist/components/combobox-field/styles.module.css +15 -3
- package/dist/components/combobox-field/types.d.ts +4 -0
- package/dist/components/coordinate-field/context.d.ts +6 -6
- package/dist/components/coordinate-field/index.d.ts +2 -2
- package/dist/components/coordinate-field/index.js +2 -2
- package/dist/components/coordinate-field/index.js.map +1 -1
- package/dist/components/coordinate-field/segment-configs.js +1 -1
- package/dist/components/coordinate-field/segment-configs.js.map +1 -1
- package/dist/components/coordinate-field/segment.d.ts +2 -2
- package/dist/components/coordinate-field/segment.js +8 -8
- package/dist/components/coordinate-field/segment.js.map +1 -1
- package/dist/components/coordinate-field/styles.module.css +7 -3
- package/dist/components/date-field/index.d.ts +2 -2
- package/dist/components/deferred-collection/index.d.ts +2 -2
- package/dist/components/details-list/context.d.ts +4 -4
- package/dist/components/details-list/index.d.ts +2 -2
- package/dist/components/details-list/label.d.ts +2 -2
- package/dist/components/details-list/value.d.ts +2 -2
- package/dist/components/dialog/content.d.ts +2 -2
- package/dist/components/dialog/context.d.ts +2 -2
- package/dist/components/dialog/footer.d.ts +2 -2
- package/dist/components/dialog/index.d.ts +2 -2
- package/dist/components/dialog/title.d.ts +2 -2
- package/dist/components/divider/context.d.ts +4 -4
- package/dist/components/divider/index.d.ts +2 -2
- package/dist/components/drawer/back.d.ts +2 -2
- package/dist/components/drawer/close.d.ts +2 -2
- package/dist/components/drawer/content.d.ts +2 -2
- package/dist/components/drawer/context.d.ts +2 -2
- package/dist/components/drawer/footer.d.ts +2 -2
- package/dist/components/drawer/header-title.d.ts +2 -2
- package/dist/components/drawer/header.d.ts +2 -2
- package/dist/components/drawer/header.js +1 -1
- package/dist/components/drawer/index.d.ts +2 -2
- package/dist/components/drawer/layout-main.d.ts +2 -2
- package/dist/components/drawer/layout.d.ts +2 -2
- package/dist/components/drawer/menu-item.d.ts +2 -2
- package/dist/components/drawer/menu.d.ts +2 -2
- package/dist/components/drawer/panel.d.ts +2 -2
- package/dist/components/drawer/trigger.d.ts +2 -2
- package/dist/components/drawer/view.d.ts +2 -2
- package/dist/components/flashcard/index.d.ts +9 -9
- package/dist/components/hero/context.d.ts +2 -2
- package/dist/components/hero/index.d.ts +2 -2
- package/dist/components/hero/subtitle.d.ts +2 -2
- package/dist/components/hero/title.d.ts +2 -2
- package/dist/components/hotkey/context.d.ts +4 -4
- package/dist/components/hotkey/index.d.ts +2 -2
- package/dist/components/hotkey/set.d.ts +2 -2
- package/dist/components/icon/context.d.ts +4 -4
- package/dist/components/icon/index.d.ts +2 -2
- package/dist/components/input/context.d.ts +2 -2
- package/dist/components/input/index.d.ts +2 -2
- package/dist/components/input/index.js +10 -14
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/kanban/card-body.d.ts +2 -2
- package/dist/components/kanban/card-header-actions.d.ts +2 -2
- package/dist/components/kanban/card-header-title.d.ts +2 -2
- package/dist/components/kanban/card-header.d.ts +2 -2
- package/dist/components/kanban/card.d.ts +2 -2
- package/dist/components/kanban/column-actions.d.ts +2 -2
- package/dist/components/kanban/column-container.d.ts +2 -2
- package/dist/components/kanban/column-content.d.ts +2 -2
- package/dist/components/kanban/column-header-actions.d.ts +2 -2
- package/dist/components/kanban/column-header-drag-handle.d.ts +2 -2
- package/dist/components/kanban/column-header-title.d.ts +2 -2
- package/dist/components/kanban/column-header.d.ts +2 -2
- package/dist/components/kanban/column.d.ts +2 -2
- package/dist/components/kanban/context.d.ts +2 -2
- package/dist/components/kanban/header-actions.d.ts +2 -2
- package/dist/components/kanban/header-search.d.ts +2 -2
- package/dist/components/kanban/header-title.d.ts +2 -2
- package/dist/components/kanban/header.d.ts +2 -2
- package/dist/components/kanban/kanban.d.ts +4 -4
- package/dist/components/kanban/styles.module.css +1 -1
- package/dist/components/label/context.d.ts +4 -4
- package/dist/components/label/index.d.ts +2 -2
- package/dist/components/lines/index.d.ts +2 -2
- package/dist/components/link/context.d.ts +2 -2
- package/dist/components/link/index.d.ts +2 -2
- package/dist/components/list/context.d.ts +2 -2
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/item-content.d.ts +2 -2
- package/dist/components/list/item-description.d.ts +2 -2
- package/dist/components/list/item-title.d.ts +2 -2
- package/dist/components/list/item.d.ts +2 -2
- package/dist/components/list/styles.module.css +1 -1
- package/dist/components/media-controls/context.d.ts +66 -0
- package/dist/components/media-controls/context.js +77 -0
- package/dist/components/media-controls/context.js.map +1 -0
- package/dist/components/media-controls/index.d.ts +68 -0
- package/dist/components/media-controls/index.js +78 -0
- package/dist/components/media-controls/index.js.map +1 -0
- package/dist/components/media-controls/mute-button.d.ts +47 -0
- package/dist/components/media-controls/mute-button.js +73 -0
- package/dist/components/media-controls/mute-button.js.map +1 -0
- package/dist/components/media-controls/play-button.d.ts +47 -0
- package/dist/components/media-controls/play-button.js +71 -0
- package/dist/components/media-controls/play-button.js.map +1 -0
- package/dist/components/media-controls/playback-rate.d.ts +58 -0
- package/dist/components/media-controls/playback-rate.js +114 -0
- package/dist/components/media-controls/playback-rate.js.map +1 -0
- package/dist/components/media-controls/seek-button.d.ts +60 -0
- package/dist/components/media-controls/seek-button.js +116 -0
- package/dist/components/media-controls/seek-button.js.map +1 -0
- package/dist/components/media-controls/styles.module.css +145 -0
- package/dist/components/media-controls/time-display.d.ts +69 -0
- package/dist/components/media-controls/time-display.js +95 -0
- package/dist/components/media-controls/time-display.js.map +1 -0
- package/dist/components/media-controls/time-range.d.ts +46 -0
- package/dist/components/media-controls/time-range.js +63 -0
- package/dist/components/media-controls/time-range.js.map +1 -0
- package/dist/components/media-controls/types.d.ts +122 -0
- package/dist/components/media-controls/types.js +12 -0
- package/dist/components/media-controls/volume-slider.d.ts +54 -0
- package/dist/components/media-controls/volume-slider.js +70 -0
- package/dist/components/media-controls/volume-slider.js.map +1 -0
- package/dist/components/menu/context.d.ts +2 -2
- package/dist/components/menu/index.d.ts +2 -2
- package/dist/components/menu/item-description.d.ts +2 -2
- package/dist/components/menu/item-label.d.ts +2 -2
- package/dist/components/menu/item.d.ts +2 -2
- package/dist/components/menu/section.d.ts +2 -2
- package/dist/components/menu/separator.d.ts +2 -2
- package/dist/components/menu/styles.module.css +1 -1
- package/dist/components/menu/submenu.d.ts +2 -2
- package/dist/components/notice/index.d.ts +2 -2
- package/dist/components/notice/list.d.ts +2 -2
- package/dist/components/notice/notice-icon.d.ts +2 -2
- package/dist/components/options/context.d.ts +2 -2
- package/dist/components/options/index.d.ts +2 -2
- package/dist/components/options/item-content.d.ts +2 -2
- package/dist/components/options/item-description.d.ts +2 -2
- package/dist/components/options/item-label.d.ts +2 -2
- package/dist/components/options/item.d.ts +2 -2
- package/dist/components/options/section.d.ts +2 -2
- package/dist/components/options/styles.module.css +1 -1
- package/dist/components/pagination/context.d.ts +2 -2
- package/dist/components/pagination/index.d.ts +2 -2
- package/dist/components/pagination/next.d.ts +2 -2
- package/dist/components/pagination/pages.d.ts +2 -2
- package/dist/components/pagination/prev.d.ts +2 -2
- package/dist/components/popover/content.d.ts +2 -2
- package/dist/components/popover/footer.d.ts +2 -2
- package/dist/components/popover/index.d.ts +2 -2
- package/dist/components/popover/title.d.ts +2 -2
- package/dist/components/popover/trigger.d.ts +2 -2
- package/dist/components/query-builder/action-element.d.ts +2 -2
- package/dist/components/query-builder/actions.d.ts +4 -4
- package/dist/components/query-builder/combinator-selector.d.ts +2 -2
- package/dist/components/query-builder/combinator-selector.js +5 -4
- package/dist/components/query-builder/combinator-selector.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +2 -2
- package/dist/components/query-builder/rule-group.d.ts +4 -4
- package/dist/components/query-builder/rule.d.ts +2 -2
- package/dist/components/query-builder/value-editor.d.ts +2 -2
- package/dist/components/query-builder/value-selector.d.ts +2 -2
- package/dist/components/radio/context.d.ts +2 -2
- package/dist/components/radio/group.d.ts +2 -2
- package/dist/components/radio/index.d.ts +2 -2
- package/dist/components/search-field/context.d.ts +4 -4
- package/dist/components/search-field/index.d.ts +2 -2
- package/dist/components/select-field/context.d.ts +4 -4
- package/dist/components/select-field/index.d.ts +2 -2
- package/dist/components/sidenav/avatar.d.ts +2 -2
- package/dist/components/sidenav/content.d.ts +2 -2
- package/dist/components/sidenav/context.d.ts +2 -2
- package/dist/components/sidenav/footer.d.ts +2 -2
- package/dist/components/sidenav/header.d.ts +2 -2
- package/dist/components/sidenav/index.d.ts +2 -2
- package/dist/components/sidenav/item.d.ts +2 -2
- package/dist/components/sidenav/link.d.ts +2 -2
- package/dist/components/sidenav/menu-item.d.ts +2 -2
- package/dist/components/sidenav/menu.d.ts +2 -2
- package/dist/components/sidenav/trigger.d.ts +2 -2
- package/dist/components/skeleton/index.d.ts +2 -2
- package/dist/components/slider/index.d.ts +2 -2
- package/dist/components/status-indicator/index.d.ts +41 -0
- package/dist/components/status-indicator/index.js +49 -0
- package/dist/components/status-indicator/index.js.map +1 -0
- package/dist/components/status-indicator/styles.module.css +34 -0
- package/dist/components/status-indicator/types.d.ts +21 -0
- package/dist/components/status-indicator/types.js +12 -0
- package/dist/components/switch/context.d.ts +2 -2
- package/dist/components/switch/index.d.ts +2 -2
- package/dist/components/table/body.d.ts +2 -2
- package/dist/components/table/cell.d.ts +2 -2
- package/dist/components/table/context.d.ts +2 -2
- package/dist/components/table/header-cell.d.ts +2 -2
- package/dist/components/table/header.d.ts +2 -2
- package/dist/components/table/index.d.ts +2 -2
- package/dist/components/table/row.d.ts +2 -2
- package/dist/components/tabs/context.d.ts +4 -4
- package/dist/components/tabs/index.d.ts +2 -2
- package/dist/components/tabs/list.d.ts +2 -2
- package/dist/components/tabs/panel.d.ts +2 -2
- package/dist/components/tabs/tab.d.ts +2 -2
- package/dist/components/text-area-field/context.d.ts +4 -4
- package/dist/components/text-area-field/index.d.ts +2 -2
- package/dist/components/text-field/context.d.ts +4 -4
- package/dist/components/text-field/index.d.ts +2 -2
- package/dist/components/time-field/index.d.ts +2 -2
- package/dist/components/tooltip/context.d.ts +2 -2
- package/dist/components/tooltip/index.d.ts +2 -2
- package/dist/components/tooltip/styles.module.css +1 -1
- package/dist/components/tooltip/trigger.d.ts +2 -2
- package/dist/components/tree/context.d.ts +3 -3
- package/dist/components/tree/index.d.ts +2 -2
- package/dist/components/tree/item-actions.d.ts +2 -2
- package/dist/components/tree/item-content.d.ts +2 -2
- package/dist/components/tree/item-description.d.ts +2 -2
- package/dist/components/tree/item-label.d.ts +2 -2
- package/dist/components/tree/item-prefix-icon.d.ts +2 -2
- package/dist/components/tree/item.d.ts +2 -2
- package/dist/components/tree/lines.d.ts +2 -2
- package/dist/components/tree/styles.module.css +1 -1
- package/dist/components/view-stack/context.d.ts +2 -2
- package/dist/components/view-stack/index.d.ts +2 -2
- package/dist/components/view-stack/trigger.d.ts +2 -2
- package/dist/components/view-stack/view.d.ts +2 -2
- package/dist/index.d.ts +15 -1
- package/dist/index.js +12 -1
- package/dist/providers/portal.d.ts +2 -2
- package/dist/providers/theme-provider.d.ts +2 -2
- package/package.json +20 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/clock/index.tsx"],"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'use client';\n\nimport { setClockInterval } from '@accelint/temporal';\nimport 'client-only';\nimport { useCallback, useEffect, useState } from 'react';\nimport type { ClockProps } from './types';\n\nconst DEFAULT_FORMATTER = new Intl.DateTimeFormat('en-US', {\n timeStyle: 'long',\n timeZone: 'UTC',\n hour12: false,\n});\n\n/**\n * Clock - An auto-updating UTC time component.\n *\n * Uses a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat|DateTimeFormat} configured with `'en-US', { timeStyle: 'long, timeZone: 'UTC', hour12: false }` by default,\n * but can be overridden with the `formatter` prop.\n *\n * NOTE: This component comes **unstyled by default**.\n *\n * @param props - The clock props.\n * @param props.formatter - Custom DateTimeFormat for time display.\n * @returns The clock component displaying current time.\n *\n * @example\n * ```tsx\n * // Standard Clock\n * <Clock /> // <time>15:54:14 UTC</time>\n * ```\n *\n * @example\n * ```tsx\n * // Styled\n * <Clock className=\"fg-accent-primary-bold\" />\n * ```\n *\n * @example\n * ```tsx\n * // Custom Format\n * const formatter = new Intl.DateTimeFormat('en-US', {\n * dateStyle: \"short\",\n * timeStyle: 'long',\n * timeZone: 'UTC',\n * hour12: false\n * });\n *\n * <Clock formatter={formatter} /> // <time>9/30/25, 15:54:14 UTC</time>\n * ```\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat| DateTimeFormat MDN}\n */\nexport function Clock({ formatter = DEFAULT_FORMATTER, ...rest }: ClockProps) {\n const now = useCallback(() => formatter.format(Date.now()), [formatter]);\n\n const [time, setTime] = useState<string>(now());\n\n useEffect(() => setClockInterval(() => setTime(now()), 1000), [now]);\n\n return <time {...rest}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../../src/components/clock/index.tsx"],"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'use client';\n\nimport { setClockInterval } from '@accelint/temporal';\nimport 'client-only';\nimport { useCallback, useEffect, useState } from 'react';\nimport type { ClockProps } from './types';\n\nconst DEFAULT_FORMATTER = new Intl.DateTimeFormat('en-US', {\n timeStyle: 'long',\n timeZone: 'UTC',\n hour12: false,\n});\n\n/**\n * Clock - An auto-updating UTC time component.\n *\n * Uses a {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat|DateTimeFormat} configured with `'en-US', { timeStyle: 'long, timeZone: 'UTC', hour12: false }` by default,\n * but can be overridden with the `formatter` prop.\n *\n * NOTE: This component comes **unstyled by default**.\n *\n * @param props - The clock props.\n * @param props.formatter - Custom DateTimeFormat for time display.\n * @returns The clock component displaying current time.\n *\n * @example\n * ```tsx\n * // Standard Clock\n * <Clock /> // <time>15:54:14 UTC</time>\n * ```\n *\n * @example\n * ```tsx\n * // Styled\n * <Clock className=\"fg-accent-primary-bold\" />\n * ```\n *\n * @example\n * ```tsx\n * // Custom Format\n * const formatter = new Intl.DateTimeFormat('en-US', {\n * dateStyle: \"short\",\n * timeStyle: 'long',\n * timeZone: 'UTC',\n * hour12: false\n * });\n *\n * <Clock formatter={formatter} /> // <time>9/30/25, 15:54:14 UTC</time>\n * ```\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat| DateTimeFormat MDN}\n */\nexport function Clock({ formatter = DEFAULT_FORMATTER, ...rest }: ClockProps) {\n const now = useCallback(() => formatter.format(Date.now()), [formatter]);\n\n const [time, setTime] = useState<string>(now());\n\n useEffect(() => setClockInterval(() => setTime(now()), 1000), [now]);\n\n return (\n <time suppressHydrationWarning {...rest}>\n {time}\n </time>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,oBAAoB,IAAI,KAAK,eAAe,SAAS;CACzD,WAAW;CACX,UAAU;CACV,QAAQ;CACT,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCF,SAAgB,MAAM,EAAE,YAAY,mBAAmB,GAAG,QAAoB;CAC5E,MAAM,MAAM,kBAAkB,UAAU,OAAO,KAAK,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC;CAExE,MAAM,CAAC,MAAM,WAAW,SAAiB,KAAK,CAAC;AAE/C,iBAAgB,uBAAuB,QAAQ,KAAK,CAAC,EAAE,IAAK,EAAE,CAAC,IAAI,CAAC;AAEpE,QACE,oBAAC;EAAK;EAAyB,GAAI;YAChC;GACI"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { ColorPickerProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime89 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/color-picker/index.d.ts
|
|
18
18
|
|
|
@@ -62,7 +62,7 @@ declare function ColorPicker({
|
|
|
62
62
|
classNames,
|
|
63
63
|
items,
|
|
64
64
|
...rest
|
|
65
|
-
}: ColorPickerProps):
|
|
65
|
+
}: ColorPickerProps): react_jsx_runtime89.JSX.Element;
|
|
66
66
|
//#endregion
|
|
67
67
|
export { ColorPicker };
|
|
68
68
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -14,13 +14,13 @@ import { ProviderProps } from "../../lib/types.js";
|
|
|
14
14
|
import { OptionsDataItem } from "../options/types.js";
|
|
15
15
|
import { ComboBoxFieldProps } from "./types.js";
|
|
16
16
|
import "client-only";
|
|
17
|
-
import * as
|
|
17
|
+
import * as react19 from "react";
|
|
18
18
|
import { ContextValue } from "react-aria-components";
|
|
19
|
-
import * as
|
|
19
|
+
import * as react_jsx_runtime90 from "react/jsx-runtime";
|
|
20
20
|
|
|
21
21
|
//#region src/components/combobox-field/context.d.ts
|
|
22
22
|
/** React context for sharing ComboBoxField configuration across components. */
|
|
23
|
-
declare const ComboBoxFieldContext:
|
|
23
|
+
declare const ComboBoxFieldContext: react19.Context<ContextValue<ComboBoxFieldProps<any>, HTMLDivElement>>;
|
|
24
24
|
/**
|
|
25
25
|
* Context provider for setting default props across multiple ComboBoxField components.
|
|
26
26
|
*
|
|
@@ -39,7 +39,7 @@ declare const ComboBoxFieldContext: react13.Context<ContextValue<ComboBoxFieldPr
|
|
|
39
39
|
declare function ComboBoxFieldProvider<T extends OptionsDataItem>({
|
|
40
40
|
children,
|
|
41
41
|
...props
|
|
42
|
-
}: ProviderProps<ComboBoxFieldProps<T>>):
|
|
42
|
+
}: ProviderProps<ComboBoxFieldProps<T>>): react_jsx_runtime90.JSX.Element;
|
|
43
43
|
//#endregion
|
|
44
44
|
export { ComboBoxFieldContext, ComboBoxFieldProvider };
|
|
45
45
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import { OptionsDataItem } from "../options/types.js";
|
|
14
14
|
import { ComboBoxFieldProps } from "./types.js";
|
|
15
15
|
import "client-only";
|
|
16
|
-
import * as
|
|
16
|
+
import * as react_jsx_runtime92 from "react/jsx-runtime";
|
|
17
17
|
|
|
18
18
|
//#region src/components/combobox-field/index.d.ts
|
|
19
19
|
|
|
@@ -43,7 +43,7 @@ import * as react_jsx_runtime32 from "react/jsx-runtime";
|
|
|
43
43
|
declare function ComboBoxField<T extends OptionsDataItem>({
|
|
44
44
|
ref,
|
|
45
45
|
...props
|
|
46
|
-
}: ComboBoxFieldProps<T>):
|
|
46
|
+
}: ComboBoxFieldProps<T>): react_jsx_runtime92.JSX.Element;
|
|
47
47
|
//#endregion
|
|
48
48
|
export { ComboBoxField };
|
|
49
49
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -16,12 +16,15 @@
|
|
|
16
16
|
import { Icon } from "../icon/index.js";
|
|
17
17
|
import { Label as Label$1 } from "../label/index.js";
|
|
18
18
|
import { ComboBoxFieldContext } from "./context.js";
|
|
19
|
+
import { ClearButton } from "../button/__internal__/clear.js";
|
|
19
20
|
import { Options } from "../options/index.js";
|
|
20
21
|
import "client-only";
|
|
22
|
+
import { useCallback } from "react";
|
|
21
23
|
import { clsx } from "@accelint/design-foundation/lib/utils";
|
|
22
24
|
import { Button, ComboBox, FieldError, Input, ListLayout, Popover, Text, Virtualizer, composeRenderProps, useContextProps } from "react-aria-components";
|
|
23
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
25
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
24
26
|
import ChevronDown from "@accelint/icons/chevron-down";
|
|
27
|
+
import { useControlledState } from "@react-stately/utils";
|
|
25
28
|
import styles from "./styles.module.css";
|
|
26
29
|
|
|
27
30
|
//#region src/components/combobox-field/index.tsx
|
|
@@ -50,9 +53,22 @@ import styles from "./styles.module.css";
|
|
|
50
53
|
*/
|
|
51
54
|
function ComboBoxField({ ref, ...props }) {
|
|
52
55
|
[props, ref] = useContextProps(props, ref ?? null, ComboBoxFieldContext);
|
|
53
|
-
const { children, classNames, description: descriptionProp, errorMessage: errorMessageProp, inputProps, label: labelProp, layoutOptions, menuTrigger = "focus", size = "medium", isInvalid: isInvalidProp, isReadOnly = false, ...rest } = props;
|
|
56
|
+
const { children, classNames, description: descriptionProp, errorMessage: errorMessageProp, inputProps, inputValue: inputValueProp, defaultInputValue = "", label: labelProp, layoutOptions, menuTrigger = "focus", size = "medium", isInvalid: isInvalidProp, isReadOnly = false, isClearable = true, onInputChange, onKeyDown, ...rest } = props;
|
|
57
|
+
const [inputValue, setInputValue] = useControlledState(inputValueProp, defaultInputValue, onInputChange);
|
|
54
58
|
const errorMessage = errorMessageProp || null;
|
|
55
59
|
const isSmall = size === "small";
|
|
60
|
+
const handleClear = useCallback(() => {
|
|
61
|
+
setInputValue("");
|
|
62
|
+
}, [setInputValue]);
|
|
63
|
+
const handleKeyDown = useCallback((event) => {
|
|
64
|
+
onKeyDown?.(event);
|
|
65
|
+
if (isClearable && event.key === "Escape" && inputValue) handleClear();
|
|
66
|
+
}, [
|
|
67
|
+
onKeyDown,
|
|
68
|
+
isClearable,
|
|
69
|
+
handleClear,
|
|
70
|
+
inputValue
|
|
71
|
+
]);
|
|
56
72
|
return /* @__PURE__ */ jsx(ComboBox, {
|
|
57
73
|
...rest,
|
|
58
74
|
ref,
|
|
@@ -60,10 +76,14 @@ function ComboBoxField({ ref, ...props }) {
|
|
|
60
76
|
menuTrigger,
|
|
61
77
|
isInvalid: isInvalidProp || (errorMessage ? true : void 0),
|
|
62
78
|
isReadOnly,
|
|
79
|
+
inputValue,
|
|
80
|
+
onInputChange: setInputValue,
|
|
81
|
+
onKeyDown: handleKeyDown,
|
|
63
82
|
"data-size": size,
|
|
83
|
+
"data-empty": !inputValue || null,
|
|
64
84
|
children: ({ isDisabled, isInvalid, isRequired }) => {
|
|
65
85
|
const shouldShowDescription = !isReadOnly && !!descriptionProp && !(isSmall || isInvalid);
|
|
66
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
86
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
67
87
|
!!labelProp && !isSmall && /* @__PURE__ */ jsx(Label$1, {
|
|
68
88
|
className: clsx(styles.label, classNames?.label),
|
|
69
89
|
isDisabled,
|
|
@@ -73,18 +93,26 @@ function ComboBoxField({ ref, ...props }) {
|
|
|
73
93
|
/* @__PURE__ */ jsxs("div", {
|
|
74
94
|
className: clsx(styles.control, classNames?.control),
|
|
75
95
|
"data-readonly": isReadOnly || null,
|
|
76
|
-
children: [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
96
|
+
children: [
|
|
97
|
+
/* @__PURE__ */ jsx(Input, {
|
|
98
|
+
...inputProps,
|
|
99
|
+
tabIndex: isReadOnly ? -1 : 0,
|
|
100
|
+
className: composeRenderProps(classNames?.input, (className) => clsx(styles.input, className)),
|
|
101
|
+
title: inputProps?.value ? String(inputProps?.value) : ""
|
|
102
|
+
}),
|
|
103
|
+
!isReadOnly && isClearable && /* @__PURE__ */ jsx(ClearButton, {
|
|
104
|
+
className: composeRenderProps(classNames?.clear, (className) => clsx(styles.clear, className)),
|
|
105
|
+
isDisabled,
|
|
106
|
+
onPress: handleClear
|
|
107
|
+
}),
|
|
108
|
+
!isReadOnly && /* @__PURE__ */ jsx(Button, {
|
|
109
|
+
className: composeRenderProps(classNames?.trigger, (className) => clsx(styles.trigger, className)),
|
|
110
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
111
|
+
size: "small",
|
|
112
|
+
children: /* @__PURE__ */ jsx(ChevronDown, {})
|
|
113
|
+
})
|
|
86
114
|
})
|
|
87
|
-
|
|
115
|
+
]
|
|
88
116
|
}),
|
|
89
117
|
shouldShowDescription && /* @__PURE__ */ jsx(Text, {
|
|
90
118
|
className: clsx(styles.description, classNames?.description),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Label"],"sources":["../../../src/components/combobox-field/index.tsx"],"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'use client';\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport ChevronDown from '@accelint/icons/chevron-down';\nimport {\n Button,\n ComboBox,\n composeRenderProps,\n FieldError,\n Input,\n ListLayout,\n Popover,\n Text,\n useContextProps,\n Virtualizer,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Options } from '../options';\nimport { ComboBoxFieldContext } from './context';\nimport styles from './styles.module.css';\nimport type { OptionsDataItem } from '../options/types';\nimport type { ComboBoxFieldProps } from './types';\n\n/**\n * ComboBoxField - Accessible searchable combobox with dropdown options\n *\n * A combobox field that provides a searchable input with virtualized dropdown\n * options and support for sections, icons, and rich content.\n *\n * @param props - The combobox field props.\n * @param props.ref - Reference to the field element.\n * @param props.children - Render function for options.\n * @param props.classNames - Custom class names for sub-elements.\n * @param props.label - Label text displayed above the field.\n * @param props.description - Helper text displayed below the field.\n * @param props.errorMessage - Error message displayed when invalid.\n * @param props.size - Size variant of the field.\n * @returns The combobox field component.\n *\n * @example\n * ```tsx\n * <ComboBoxField defaultItems={items}>\n * {(item) => <OptionsItem key={item.id} textValue={item.name}>{item.name}</OptionsItem>}\n * </ComboBoxField>\n * ```\n */\nexport function ComboBoxField<T extends OptionsDataItem>({\n ref,\n ...props\n}: ComboBoxFieldProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, ComboBoxFieldContext);\n\n const {\n children,\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n inputProps,\n label: labelProp,\n layoutOptions,\n menuTrigger = 'focus',\n size = 'medium',\n isInvalid: isInvalidProp,\n isReadOnly = false,\n ...rest\n } = props;\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <ComboBox<T>\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n clsx('group/combobox-field', styles.field, className),\n )}\n menuTrigger={menuTrigger}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n isReadOnly={isReadOnly}\n data-size={size}\n >\n {(
|
|
1
|
+
{"version":3,"file":"index.js","names":["Label"],"sources":["../../../src/components/combobox-field/index.tsx"],"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'use client';\nimport 'client-only';\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport ChevronDown from '@accelint/icons/chevron-down';\nimport { useControlledState } from '@react-stately/utils';\nimport { useCallback } from 'react';\nimport {\n Button,\n ComboBox,\n type ComboBoxProps,\n composeRenderProps,\n FieldError,\n Input,\n ListLayout,\n Popover,\n Text,\n useContextProps,\n Virtualizer,\n} from 'react-aria-components';\nimport { ClearButton } from '../button/__internal__/clear';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Options } from '../options';\nimport { ComboBoxFieldContext } from './context';\nimport styles from './styles.module.css';\nimport type { OptionsDataItem } from '../options/types';\nimport type { ComboBoxFieldProps } from './types';\n\n/**\n * ComboBoxField - Accessible searchable combobox with dropdown options\n *\n * A combobox field that provides a searchable input with virtualized dropdown\n * options and support for sections, icons, and rich content.\n *\n * @param props - The combobox field props.\n * @param props.ref - Reference to the field element.\n * @param props.children - Render function for options.\n * @param props.classNames - Custom class names for sub-elements.\n * @param props.label - Label text displayed above the field.\n * @param props.description - Helper text displayed below the field.\n * @param props.errorMessage - Error message displayed when invalid.\n * @param props.size - Size variant of the field.\n * @returns The combobox field component.\n *\n * @example\n * ```tsx\n * <ComboBoxField defaultItems={items}>\n * {(item) => <OptionsItem key={item.id} textValue={item.name}>{item.name}</OptionsItem>}\n * </ComboBoxField>\n * ```\n */\nexport function ComboBoxField<T extends OptionsDataItem>({\n ref,\n ...props\n}: ComboBoxFieldProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, ComboBoxFieldContext);\n\n const {\n children,\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n inputProps,\n inputValue: inputValueProp,\n defaultInputValue = '',\n label: labelProp,\n layoutOptions,\n menuTrigger = 'focus',\n size = 'medium',\n isInvalid: isInvalidProp,\n isReadOnly = false,\n isClearable = true,\n onInputChange,\n onKeyDown,\n ...rest\n } = props;\n\n const [inputValue, setInputValue] = useControlledState(\n inputValueProp,\n defaultInputValue,\n onInputChange,\n );\n\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n const handleClear = useCallback(() => {\n setInputValue('');\n }, [setInputValue]);\n\n const handleKeyDown = useCallback<Required<ComboBoxProps<T>>['onKeyDown']>(\n (event) => {\n onKeyDown?.(event);\n if (isClearable && event.key === 'Escape' && inputValue) {\n handleClear();\n }\n },\n [onKeyDown, isClearable, handleClear, inputValue],\n );\n\n return (\n <ComboBox<T>\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n clsx('group/combobox-field', styles.field, className),\n )}\n menuTrigger={menuTrigger}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n isReadOnly={isReadOnly}\n inputValue={inputValue}\n onInputChange={setInputValue}\n onKeyDown={handleKeyDown}\n data-size={size}\n data-empty={!inputValue || null}\n >\n {({ isDisabled, isInvalid, isRequired }) => {\n const shouldShowDescription =\n !isReadOnly && !!descriptionProp && !(isSmall || isInvalid);\n\n return (\n <>\n {!!labelProp && !isSmall && (\n <Label\n className={clsx(styles.label, classNames?.label)}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <div\n className={clsx(styles.control, classNames?.control)}\n data-readonly={isReadOnly || null}\n >\n <Input\n {...inputProps}\n tabIndex={isReadOnly ? -1 : 0}\n className={composeRenderProps(classNames?.input, (className) =>\n clsx(styles.input, className),\n )}\n title={inputProps?.value ? String(inputProps?.value) : ''}\n />\n {!isReadOnly && isClearable && (\n <ClearButton\n className={composeRenderProps(\n classNames?.clear,\n (className) => clsx(styles.clear, className),\n )}\n isDisabled={isDisabled}\n onPress={handleClear}\n />\n )}\n {!isReadOnly && (\n <Button\n className={composeRenderProps(\n classNames?.trigger,\n (className) => clsx(styles.trigger, className),\n )}\n >\n <Icon size='small'>\n <ChevronDown />\n </Icon>\n </Button>\n )}\n </div>\n {shouldShowDescription && (\n <Text\n className={clsx(styles.description, classNames?.description)}\n slot='description'\n >\n {descriptionProp}\n </Text>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n clsx(styles.error, className),\n )}\n >\n {errorMessage}\n </FieldError>\n <Popover\n className={composeRenderProps(classNames?.popover, (className) =>\n clsx(styles.popover, className),\n )}\n >\n <Virtualizer layout={ListLayout} layoutOptions={layoutOptions}>\n <Options>{children}</Options>\n </Virtualizer>\n </Popover>\n </>\n );\n }}\n </ComboBox>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,SAAgB,cAAyC,EACvD,KACA,GAAG,SACqB;AACxB,EAAC,OAAO,OAAO,gBAAgB,OAAO,OAAO,MAAM,qBAAqB;CAExE,MAAM,EACJ,UACA,YACA,aAAa,iBACb,cAAc,kBACd,YACA,YAAY,gBACZ,oBAAoB,IACpB,OAAO,WACP,eACA,cAAc,SACd,OAAO,UACP,WAAW,eACX,aAAa,OACb,cAAc,MACd,eACA,WACA,GAAG,SACD;CAEJ,MAAM,CAAC,YAAY,iBAAiB,mBAClC,gBACA,mBACA,cACD;CAED,MAAM,eAAe,oBAAoB;CACzC,MAAM,UAAU,SAAS;CAEzB,MAAM,cAAc,kBAAkB;AACpC,gBAAc,GAAG;IAChB,CAAC,cAAc,CAAC;CAEnB,MAAM,gBAAgB,aACnB,UAAU;AACT,cAAY,MAAM;AAClB,MAAI,eAAe,MAAM,QAAQ,YAAY,WAC3C,cAAa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S,UAAU,CAChC;eAED,oBAAC;MAAY,QAAQ;MAA2B;gBAC9C,oBAAC,WAAS,WAAmB;OACjB;MACN;OACT;;GAGE"}
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
|
|
15
15
|
@layer components.l1 {
|
|
16
16
|
.field {
|
|
17
|
-
@apply gap-xs flex flex-col;
|
|
17
|
+
@apply gap-xs flex flex-col select-none;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
.control {
|
|
21
|
-
@apply rounded-medium px-s py-xs fg-primary-bold outline-interactive flex items-center outline;
|
|
21
|
+
@apply rounded-medium px-s py-xs fg-primary-bold outline-interactive gap-xs flex items-center outline;
|
|
22
22
|
|
|
23
23
|
@variant placeholder {
|
|
24
24
|
@apply fg-primary-muted;
|
|
@@ -99,7 +99,19 @@
|
|
|
99
99
|
|
|
100
100
|
.popover {
|
|
101
101
|
--trigger-width: initial; /* is inlined by react aria components on render */
|
|
102
|
-
@apply -ml-s;
|
|
102
|
+
@apply -ml-s select-none;
|
|
103
103
|
min-width: calc(var(--trigger-width) + (var(--spacing-s) * 2));
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
|
|
107
|
+
@layer components.l2 {
|
|
108
|
+
.clear {
|
|
109
|
+
@apply invisible;
|
|
110
|
+
|
|
111
|
+
@variant group-focus-within/combobox-field {
|
|
112
|
+
@variant group-not-data-empty/combobox-field {
|
|
113
|
+
@apply visible;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
@@ -32,6 +32,8 @@ type ComboBoxFieldProps<T extends OptionsDataItem> = Omit<ComboBoxProps<T>, 'chi
|
|
|
32
32
|
control?: string;
|
|
33
33
|
/** Class name for the input element. */
|
|
34
34
|
input?: InputProps['className'];
|
|
35
|
+
/** Class name for the clear button. */
|
|
36
|
+
clear?: ButtonProps$1['className'];
|
|
35
37
|
/** Class name for the trigger button. */
|
|
36
38
|
trigger?: ButtonProps$1['className'];
|
|
37
39
|
/** Class name for the description text. */
|
|
@@ -51,6 +53,8 @@ type ComboBoxFieldProps<T extends OptionsDataItem> = Omit<ComboBoxProps<T>, 'chi
|
|
|
51
53
|
errorMessage?: string;
|
|
52
54
|
/** Size variant of the field. */
|
|
53
55
|
size?: 'small' | 'medium';
|
|
56
|
+
/** Whether the field shows a clear button. Will not show if the field is read-only. */
|
|
57
|
+
isClearable?: boolean;
|
|
54
58
|
};
|
|
55
59
|
//#endregion
|
|
56
60
|
export { ComboBoxFieldProps };
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
|
|
13
13
|
import { ProviderProps } from "../../lib/types.js";
|
|
14
14
|
import { CoordinateFieldProps, CoordinateFieldState } from "./types.js";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react21 from "react";
|
|
16
16
|
import { ContextValue } from "react-aria-components";
|
|
17
|
-
import * as
|
|
17
|
+
import * as react_jsx_runtime94 from "react/jsx-runtime";
|
|
18
18
|
|
|
19
19
|
//#region src/components/coordinate-field/context.d.ts
|
|
20
20
|
|
|
@@ -48,7 +48,7 @@ import * as react_jsx_runtime34 from "react/jsx-runtime";
|
|
|
48
48
|
*
|
|
49
49
|
* @see CoordinateFieldStateContext for internal runtime state
|
|
50
50
|
*/
|
|
51
|
-
declare const CoordinateFieldContext:
|
|
51
|
+
declare const CoordinateFieldContext: react21.Context<ContextValue<CoordinateFieldProps, HTMLDivElement>>;
|
|
52
52
|
/**
|
|
53
53
|
* State Context for CoordinateField component.
|
|
54
54
|
*
|
|
@@ -66,7 +66,7 @@ declare const CoordinateFieldContext: react14.Context<ContextValue<CoordinateFie
|
|
|
66
66
|
* const state = useCoordinateFieldStateContext();
|
|
67
67
|
* const { segmentValues, isDisabled, registerTimeout } = state;
|
|
68
68
|
*/
|
|
69
|
-
declare const CoordinateFieldStateContext:
|
|
69
|
+
declare const CoordinateFieldStateContext: react21.Context<CoordinateFieldState | null>;
|
|
70
70
|
/**
|
|
71
71
|
* Provider component for CoordinateField context
|
|
72
72
|
* Wraps children with CoordinateFieldContext
|
|
@@ -78,7 +78,7 @@ declare const CoordinateFieldStateContext: react14.Context<CoordinateFieldState
|
|
|
78
78
|
declare function CoordinateFieldProvider({
|
|
79
79
|
children,
|
|
80
80
|
...props
|
|
81
|
-
}: ProviderProps<CoordinateFieldProps>):
|
|
81
|
+
}: ProviderProps<CoordinateFieldProps>): react_jsx_runtime94.JSX.Element;
|
|
82
82
|
/**
|
|
83
83
|
* Provider component for CoordinateField state context
|
|
84
84
|
* Wraps children with CoordinateFieldStateContext
|
|
@@ -94,7 +94,7 @@ declare function CoordinateFieldStateProvider({
|
|
|
94
94
|
}: {
|
|
95
95
|
children: React.ReactNode;
|
|
96
96
|
value: CoordinateFieldState;
|
|
97
|
-
}):
|
|
97
|
+
}): react_jsx_runtime94.JSX.Element;
|
|
98
98
|
/**
|
|
99
99
|
* Hook to access CoordinateField state context
|
|
100
100
|
* Must be used within a CoordinateField component
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { CoordinateFieldProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime4 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/coordinate-field/index.d.ts
|
|
18
18
|
|
|
@@ -104,7 +104,7 @@ import * as react_jsx_runtime37 from "react/jsx-runtime";
|
|
|
104
104
|
declare function CoordinateField({
|
|
105
105
|
ref,
|
|
106
106
|
...props
|
|
107
|
-
}: CoordinateFieldProps):
|
|
107
|
+
}: CoordinateFieldProps): react_jsx_runtime4.JSX.Element;
|
|
108
108
|
//#endregion
|
|
109
109
|
export { CoordinateField };
|
|
110
110
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -240,9 +240,9 @@ function CoordinateField({ ref, ...props }) {
|
|
|
240
240
|
onOpenChange: handlePopoverOpenChange,
|
|
241
241
|
children: [/* @__PURE__ */ jsx(Button$1, {
|
|
242
242
|
variant: "icon",
|
|
243
|
-
size,
|
|
243
|
+
size: "small",
|
|
244
244
|
color: "mono-bold",
|
|
245
|
-
className: classNames?.formatButton,
|
|
245
|
+
className: clsx(styles.formatButton, classNames?.formatButton),
|
|
246
246
|
"aria-label": "View coordinate in all formats",
|
|
247
247
|
isDisabled: !copy.isFormatButtonEnabled,
|
|
248
248
|
children: /* @__PURE__ */ jsx(Icon, { children: /* @__PURE__ */ jsx(GlobalShare, {}) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["Label","DialogTrigger","Button","Popover","AriaText","Dialog","RadioGroup","Radio"],"sources":["../../../src/components/coordinate-field/index.tsx"],"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'use client';\n\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport Check from '@accelint/icons/check';\nimport CopyToClipboard from '@accelint/icons/copy-to-clipboard';\nimport GlobalShare from '@accelint/icons/global-share';\nimport { filterDOMProps } from '@react-aria/utils';\nimport 'client-only';\nimport {\n type CSSProperties,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport {\n Text as AriaText,\n composeRenderProps,\n FieldError,\n FieldErrorContext,\n GroupContext,\n LabelContext,\n Provider,\n TextContext,\n useContextProps,\n} from 'react-aria-components';\nimport { useCoordinateField } from '../../hooks/coordinate-field';\nimport { Button } from '../button';\nimport { Dialog } from '../dialog';\nimport { DialogContent } from '../dialog/content';\nimport { DialogFooter } from '../dialog/footer';\nimport { DialogTitle } from '../dialog/title';\nimport { DialogTrigger } from '../dialog/trigger';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Popover } from '../popover';\nimport { PopoverContent } from '../popover/content';\nimport { PopoverTitle } from '../popover/title';\nimport { Radio } from '../radio';\nimport { RadioGroup } from '../radio/group';\nimport { CoordinateFieldContext, CoordinateFieldStateContext } from './context';\nimport {\n type CoordinateFormatResult,\n getAllCoordinateFormats,\n} from './coordinate-utils';\nimport { CoordinateSegment } from './segment';\nimport { GROUP_SEPARATOR, getSegmentLabel } from './segment-configs';\nimport styles from './styles.module.css';\nimport {\n COORDINATE_FORMAT_LABELS,\n COORDINATE_FORMAT_NAMES,\n COORDINATE_SYSTEMS,\n type CoordinateSystem,\n} from './types';\nimport { calculateMinControlWidth } from './width-utils';\nimport type { CoordinateFieldProps } from './types';\n\n/**\n * CoordinateField - A comprehensive coordinate input component with multiple format support\n *\n * Provides accessible coordinate input functionality with support for multiple coordinate\n * systems (DD, DDM, DMS, MGRS, UTM). All values are normalized to Decimal Degrees internally\n * for consistency.\n *\n * @param props - The coordinate field props.\n * @param props.ref - Reference to the coordinate field element.\n * @param props.classNames - Custom class names for sub-elements.\n * @param props.description - Description text displayed below the field.\n * @param props.label - Label text for the coordinate field.\n * @param props.format - Coordinate format to use (dd, ddm, dms, mgrs, utm).\n * @param props.size - Size variant of the field.\n * @param props.variant - Layout variant (inline or stacked).\n * @param props.showFormatButton - Whether to show the format conversion button.\n * @param props.isDisabled - Whether the field is disabled.\n * @param props.isInvalid - Whether the field is in an invalid state.\n * @param props.isRequired - Whether the field is required.\n * @param props.isReadOnly - Whether the field is read-only.\n * @returns The coordinate field component.\n *\n * @example\n * ```tsx\n * // Basic coordinate field\n * <CoordinateField label=\"Location\" />\n * ```\n *\n * @example\n * ```tsx\n * // Coordinate field with validation\n * <CoordinateField\n * label=\"Target Coordinates\"\n * isRequired\n * isInvalid={hasError}\n * errorMessage=\"Please enter a valid coordinate\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Coordinate field with specific format\n * <CoordinateField\n * label=\"Position\"\n * format=\"dms\"\n * description=\"Enter coordinates in Degrees Minutes Seconds format\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Compact coordinate field\n * <CoordinateField\n * label=\"Coordinates\"\n * size=\"small\"\n * format=\"dd\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Controlled coordinate field\n * <CoordinateField\n * label=\"Selected Location\"\n * value={coordinates}\n * onChange={setCoordinates}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Coordinate field with error handling\n * <CoordinateField\n * label=\"Target Coordinates\"\n * onError={(message, context) => {\n * // message will be \"Invalid coordinate value\" for validation errors\n * // or \"Invalid coordinate format\" for paste errors\n * setErrorMessage(message);\n * console.error(message, context);\n * }}\n * isInvalid={!!errorMessage}\n * errorMessage={errorMessage}\n * />\n * ```\n */\nexport function CoordinateField({ ref, ...props }: CoordinateFieldProps) {\n [props, ref] = useContextProps(props, ref, CoordinateFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n label: labelProp,\n format = 'dd',\n size = 'medium',\n variant = 'inline',\n showFormatButton = true,\n isDisabled = false,\n isInvalid: isInvalidProp = false,\n isRequired = false,\n isReadOnly = false,\n ...rest\n } = props;\n\n const isSmall = size === 'small';\n\n const DOMProps = filterDOMProps(rest, { global: true });\n\n // When size is small and label is hidden, use aria-label instead of aria-labelledby\n // to ensure screen readers have an accessible name\n const ariaLabelForSmallSize =\n isSmall && labelProp ? labelProp : rest['aria-label'];\n\n const {\n state,\n focus,\n paste,\n copy,\n registerTimeout,\n fieldProps,\n labelProps,\n descriptionProps,\n errorProps,\n validation,\n effectiveErrorMessage,\n isInvalid,\n } = useCoordinateField(\n props,\n ariaLabelForSmallSize,\n rest['aria-describedby'],\n rest['aria-details'],\n );\n\n const componentState = {\n segmentValues: state.segmentValues,\n format,\n currentValue: state.currentValue,\n validationErrors: state.validationErrors,\n isDisabled,\n isInvalid,\n isRequired,\n size,\n variant,\n registerTimeout,\n };\n\n // Store all coordinate formats, calculated only when popover opens\n const [allCoordinateFormats, setAllCoordinateFormats] = useState<Record<\n CoordinateSystem,\n CoordinateFormatResult\n > | null>(null);\n\n const handlePopoverOpenChange = useCallback(\n (isOpen: boolean) => {\n if (isOpen) {\n setAllCoordinateFormats(getAllCoordinateFormats(state.currentValue));\n }\n },\n [state.currentValue],\n );\n\n // Calculate the minimum width needed for the control container\n // This keeps the outlined container at a fixed width while segments animate\n const minControlWidth = useMemo(\n () =>\n calculateMinControlWidth(\n state.editableSegmentConfigs,\n state.segmentConfigs,\n showFormatButton,\n ),\n [state.editableSegmentConfigs, state.segmentConfigs, showFormatButton],\n );\n\n return (\n <Provider\n values={[\n [CoordinateFieldContext, props],\n [CoordinateFieldStateContext, componentState],\n [GroupContext, fieldProps],\n [LabelContext, labelProps],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorProps,\n },\n },\n ],\n [FieldErrorContext, validation],\n ]}\n >\n <div\n {...DOMProps}\n {...fieldProps}\n ref={ref}\n className={clsx(\n 'group/coordinate-field',\n styles.field,\n classNames?.field,\n )}\n data-size={size}\n data-disabled={isDisabled || null}\n data-invalid={isInvalid || null}\n >\n {!isSmall && labelProp && (\n <Label\n className={classNames?.label}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n\n <div\n style={\n {\n '--min-width': variant === 'stacked' ? 'unset' : minControlWidth,\n } as CSSProperties\n }\n className={clsx(styles.control, classNames?.control)}\n data-readonly={isReadOnly || null}\n >\n <div\n className={clsx(styles.input, styles[variant], classNames?.input)}\n onPasteCapture={paste.handleInputPaste}\n data-input-container\n >\n {state.segmentConfigs\n .reduce<ReactNode[][]>(\n (acc, config, configIndex) => {\n const currentGroupIndex = acc.length - 1;\n\n if (\n config.value === GROUP_SEPARATOR &&\n variant === 'stacked'\n ) {\n acc.push([]);\n\n return acc;\n }\n\n if (config.type === 'literal') {\n acc[currentGroupIndex]?.push(\n <span\n key={`${format}-literal-${configIndex}-${config.value}`}\n className={styles.literal}\n >\n {config.value}\n </span>,\n );\n\n return acc;\n }\n\n const editableIndex = state.segmentConfigs\n .slice(0, configIndex)\n .filter((c) => c.type !== 'literal').length;\n\n acc[currentGroupIndex]?.push(\n <CoordinateSegment\n key={`${format}-segment-${editableIndex}`}\n value={state.segmentValues[editableIndex] || ''}\n onChange={(newValue) =>\n state.handleSegmentChange(editableIndex, newValue)\n }\n onFocus={() =>\n focus.setFocusedSegmentIndex(editableIndex)\n }\n onBlur={() => {\n focus.setFocusedSegmentIndex(-1);\n state.flushPendingValidation();\n }}\n onKeyDown={(e) =>\n focus.handleSegmentKeyDown(editableIndex, e)\n }\n onAutoAdvance={() =>\n focus.focusNextSegment(editableIndex)\n }\n onAutoRetreat={() =>\n focus.focusPreviousSegment(editableIndex)\n }\n placeholder={config.placeholder}\n maxLength={config.maxLength}\n pad={config.pad}\n className={clsx(styles.segment, classNames?.segment)}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n allowedChars={config.allowedChars}\n segmentRef={focus.segmentRefs[editableIndex]}\n segmentIndex={editableIndex}\n totalSegments={state.editableSegmentConfigs.length}\n ariaLabel={getSegmentLabel(format, editableIndex)}\n />,\n );\n\n return acc;\n },\n [[]],\n )\n .map((group, groupIndex) => (\n <div\n className={clsx(styles.segmentGroup, styles[variant])}\n key={`${format}-group-${\n // biome-ignore lint/suspicious/noArrayIndexKey: intentional\n groupIndex\n }`}\n >\n {group}\n </div>\n ))}\n </div>\n\n {showFormatButton && (\n <DialogTrigger onOpenChange={handlePopoverOpenChange}>\n <Button\n variant='icon'\n size={size}\n color='mono-bold'\n className={classNames?.formatButton}\n aria-label='View coordinate in all formats'\n isDisabled={!copy.isFormatButtonEnabled}\n >\n <Icon>\n <GlobalShare />\n </Icon>\n </Button>\n <Popover classNames={{ popover: styles.popover }}>\n <PopoverTitle className={styles.popoverTitle}>\n Copy Coordinates\n </PopoverTitle>\n <PopoverContent>\n {allCoordinateFormats &&\n COORDINATE_SYSTEMS.map((formatKey) => {\n const formatResult = allCoordinateFormats[formatKey];\n const isCopied = copy.copiedFormat === formatKey;\n\n return (\n <div key={formatKey} className={styles.formatRow}>\n <div className={styles.formatLabels}>\n <span className={styles.formatLabel}>\n {COORDINATE_FORMAT_LABELS[formatKey]}\n </span>\n <span\n className={styles.formatValue}\n title={formatResult.value}\n >\n {formatResult.value}\n </span>\n </div>\n <Button\n variant='icon'\n color='mono-bold'\n aria-label={`Copy ${COORDINATE_FORMAT_LABELS[formatKey]} format`}\n onClick={() => copy.handleCopyFormat(formatKey)}\n isDisabled={!formatResult.isValid}\n >\n <Icon>\n {isCopied ? <Check /> : <CopyToClipboard />}\n </Icon>\n </Button>\n </div>\n );\n })}\n </PopoverContent>\n </Popover>\n </DialogTrigger>\n )}\n </div>\n\n {/* Description is hidden when field is invalid (unless disabled) to make room for error message */}\n {descriptionProp && !isSmall && (!isInvalid || isDisabled) && (\n <AriaText\n className={clsx(styles.description, classNames?.description)}\n slot='description'\n >\n {descriptionProp}\n </AriaText>\n )}\n\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n clsx(styles.error, className),\n )}\n >\n {effectiveErrorMessage}\n </FieldError>\n\n <DialogTrigger\n isOpen={paste.showDisambiguationModal}\n onOpenChange={paste.setShowDisambiguationModal}\n >\n <Button className={styles.hiddenTrigger}>Hidden Trigger</Button>\n <Dialog size='small'>\n <DialogTitle className={styles.modalTitle}>\n Select Coordinate Format\n </DialogTitle>\n <DialogContent>\n <p className={styles.modalDescription}>\n The pasted value matches multiple coordinate formats. Please\n select the correct interpretation:\n </p>\n\n <RadioGroup\n classNames={{ group: styles.formatOptions }}\n value={paste.selectedDisambiguationFormat}\n onChange={(value) =>\n paste.setSelectedDisambiguationFormat(\n value as CoordinateSystem,\n )\n }\n >\n {paste.disambiguationMatches.map((match) => (\n <Radio key={match.format} value={match.format}>\n <div className={styles.modalOptionContent}>\n <span className={styles.formatOptionLabel}>\n {COORDINATE_FORMAT_NAMES[match.format]}\n </span>\n <span className={styles.formatOptionValue}>\n {match.displayString}\n </span>\n </div>\n </Radio>\n ))}\n </RadioGroup>\n </DialogContent>\n <DialogFooter className={styles.modalActions}>\n <Button\n variant='flat'\n onPress={() => paste.setShowDisambiguationModal(false)}\n >\n Cancel\n </Button>\n <Button onPress={paste.handleDisambiguationSelect}>\n Apply Selected\n </Button>\n </DialogFooter>\n </Dialog>\n </DialogTrigger>\n </div>\n </Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0JA,SAAgB,gBAAgB,EAAE,KAAK,GAAG,SAA+B;AACvE,EAAC,OAAO,OAAO,gBAAgB,OAAO,KAAK,uBAAuB;CAElE,MAAM,EACJ,YACA,aAAa,iBACb,OAAO,WACP,SAAS,MACT,OAAO,UACP,UAAU,UACV,mBAAmB,MACnB,aAAa,OACb,WAAW,gBAAgB,OAC3B,aAAa,OACb,aAAa,OACb,GAAG,SACD;CAEJ,MAAM,UAAU,SAAS;CAEzB,MAAM,WAAW,eAAe,MAAM,EAAE,QAAQ,MAAM,CAAC;CAIvD,MAAM,wBACJ,WAAW,YAAY,YAAY,KAAK;CAE1C,MAAM,EACJ,OACA,OACA,OACA,MACA,iBACA,YACA,YACA,kBACA,YACA,YACA,uBACA,cACE,mBACF,OACA,uBACA,KAAK,qBACL,KAAK,gBACN;CAED,MAAM,iBAAiB;EACrB,eAAe,MAAM;EACrB;EACA,cAAc,MAAM;EACpB,kBAAkB,MAAM;EACxB;EACA;EACA;EACA;EACA;EACA;EACD;CAGD,MAAM,CAAC,sBAAsB,2BAA2B,SAG9C,KAAK;CAEf,MAAM,0BAA0B,aAC7B,WAAoB;AACnB,MAAI,OACF,yBAAwB,wBAAwB,MAAM,aAAa,CAAC;IAGxE,CAAC,MAAM,aAAa,CACrB;CAID,MAAM,kBAAkB,cAEpB,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["Label","DialogTrigger","Button","Popover","AriaText","Dialog","RadioGroup","Radio"],"sources":["../../../src/components/coordinate-field/index.tsx"],"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'use client';\n\nimport { clsx } from '@accelint/design-foundation/lib/utils';\nimport Check from '@accelint/icons/check';\nimport CopyToClipboard from '@accelint/icons/copy-to-clipboard';\nimport GlobalShare from '@accelint/icons/global-share';\nimport { filterDOMProps } from '@react-aria/utils';\nimport 'client-only';\nimport {\n type CSSProperties,\n type ReactNode,\n useCallback,\n useMemo,\n useState,\n} from 'react';\nimport {\n Text as AriaText,\n composeRenderProps,\n FieldError,\n FieldErrorContext,\n GroupContext,\n LabelContext,\n Provider,\n TextContext,\n useContextProps,\n} from 'react-aria-components';\nimport { useCoordinateField } from '../../hooks/coordinate-field';\nimport { Button } from '../button';\nimport { Dialog } from '../dialog';\nimport { DialogContent } from '../dialog/content';\nimport { DialogFooter } from '../dialog/footer';\nimport { DialogTitle } from '../dialog/title';\nimport { DialogTrigger } from '../dialog/trigger';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Popover } from '../popover';\nimport { PopoverContent } from '../popover/content';\nimport { PopoverTitle } from '../popover/title';\nimport { Radio } from '../radio';\nimport { RadioGroup } from '../radio/group';\nimport { CoordinateFieldContext, CoordinateFieldStateContext } from './context';\nimport {\n type CoordinateFormatResult,\n getAllCoordinateFormats,\n} from './coordinate-utils';\nimport { CoordinateSegment } from './segment';\nimport { GROUP_SEPARATOR, getSegmentLabel } from './segment-configs';\nimport styles from './styles.module.css';\nimport {\n COORDINATE_FORMAT_LABELS,\n COORDINATE_FORMAT_NAMES,\n COORDINATE_SYSTEMS,\n type CoordinateSystem,\n} from './types';\nimport { calculateMinControlWidth } from './width-utils';\nimport type { CoordinateFieldProps } from './types';\n\n/**\n * CoordinateField - A comprehensive coordinate input component with multiple format support\n *\n * Provides accessible coordinate input functionality with support for multiple coordinate\n * systems (DD, DDM, DMS, MGRS, UTM). All values are normalized to Decimal Degrees internally\n * for consistency.\n *\n * @param props - The coordinate field props.\n * @param props.ref - Reference to the coordinate field element.\n * @param props.classNames - Custom class names for sub-elements.\n * @param props.description - Description text displayed below the field.\n * @param props.label - Label text for the coordinate field.\n * @param props.format - Coordinate format to use (dd, ddm, dms, mgrs, utm).\n * @param props.size - Size variant of the field.\n * @param props.variant - Layout variant (inline or stacked).\n * @param props.showFormatButton - Whether to show the format conversion button.\n * @param props.isDisabled - Whether the field is disabled.\n * @param props.isInvalid - Whether the field is in an invalid state.\n * @param props.isRequired - Whether the field is required.\n * @param props.isReadOnly - Whether the field is read-only.\n * @returns The coordinate field component.\n *\n * @example\n * ```tsx\n * // Basic coordinate field\n * <CoordinateField label=\"Location\" />\n * ```\n *\n * @example\n * ```tsx\n * // Coordinate field with validation\n * <CoordinateField\n * label=\"Target Coordinates\"\n * isRequired\n * isInvalid={hasError}\n * errorMessage=\"Please enter a valid coordinate\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Coordinate field with specific format\n * <CoordinateField\n * label=\"Position\"\n * format=\"dms\"\n * description=\"Enter coordinates in Degrees Minutes Seconds format\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Compact coordinate field\n * <CoordinateField\n * label=\"Coordinates\"\n * size=\"small\"\n * format=\"dd\"\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Controlled coordinate field\n * <CoordinateField\n * label=\"Selected Location\"\n * value={coordinates}\n * onChange={setCoordinates}\n * />\n * ```\n *\n * @example\n * ```tsx\n * // Coordinate field with error handling\n * <CoordinateField\n * label=\"Target Coordinates\"\n * onError={(message, context) => {\n * // message will be \"Invalid coordinate value\" for validation errors\n * // or \"Invalid coordinate format\" for paste errors\n * setErrorMessage(message);\n * console.error(message, context);\n * }}\n * isInvalid={!!errorMessage}\n * errorMessage={errorMessage}\n * />\n * ```\n */\nexport function CoordinateField({ ref, ...props }: CoordinateFieldProps) {\n [props, ref] = useContextProps(props, ref, CoordinateFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n label: labelProp,\n format = 'dd',\n size = 'medium',\n variant = 'inline',\n showFormatButton = true,\n isDisabled = false,\n isInvalid: isInvalidProp = false,\n isRequired = false,\n isReadOnly = false,\n ...rest\n } = props;\n\n const isSmall = size === 'small';\n\n const DOMProps = filterDOMProps(rest, { global: true });\n\n // When size is small and label is hidden, use aria-label instead of aria-labelledby\n // to ensure screen readers have an accessible name\n const ariaLabelForSmallSize =\n isSmall && labelProp ? labelProp : rest['aria-label'];\n\n const {\n state,\n focus,\n paste,\n copy,\n registerTimeout,\n fieldProps,\n labelProps,\n descriptionProps,\n errorProps,\n validation,\n effectiveErrorMessage,\n isInvalid,\n } = useCoordinateField(\n props,\n ariaLabelForSmallSize,\n rest['aria-describedby'],\n rest['aria-details'],\n );\n\n const componentState = {\n segmentValues: state.segmentValues,\n format,\n currentValue: state.currentValue,\n validationErrors: state.validationErrors,\n isDisabled,\n isInvalid,\n isRequired,\n size,\n variant,\n registerTimeout,\n };\n\n // Store all coordinate formats, calculated only when popover opens\n const [allCoordinateFormats, setAllCoordinateFormats] = useState<Record<\n CoordinateSystem,\n CoordinateFormatResult\n > | null>(null);\n\n const handlePopoverOpenChange = useCallback(\n (isOpen: boolean) => {\n if (isOpen) {\n setAllCoordinateFormats(getAllCoordinateFormats(state.currentValue));\n }\n },\n [state.currentValue],\n );\n\n // Calculate the minimum width needed for the control container\n // This keeps the outlined container at a fixed width while segments animate\n const minControlWidth = useMemo(\n () =>\n calculateMinControlWidth(\n state.editableSegmentConfigs,\n state.segmentConfigs,\n showFormatButton,\n ),\n [state.editableSegmentConfigs, state.segmentConfigs, showFormatButton],\n );\n\n return (\n <Provider\n values={[\n [CoordinateFieldContext, props],\n [CoordinateFieldStateContext, componentState],\n [GroupContext, fieldProps],\n [LabelContext, labelProps],\n [\n TextContext,\n {\n slots: {\n description: descriptionProps,\n errorMessage: errorProps,\n },\n },\n ],\n [FieldErrorContext, validation],\n ]}\n >\n <div\n {...DOMProps}\n {...fieldProps}\n ref={ref}\n className={clsx(\n 'group/coordinate-field',\n styles.field,\n classNames?.field,\n )}\n data-size={size}\n data-disabled={isDisabled || null}\n data-invalid={isInvalid || null}\n >\n {!isSmall && labelProp && (\n <Label\n className={classNames?.label}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n\n <div\n style={\n {\n '--min-width': variant === 'stacked' ? 'unset' : minControlWidth,\n } as CSSProperties\n }\n className={clsx(styles.control, classNames?.control)}\n data-readonly={isReadOnly || null}\n >\n <div\n className={clsx(styles.input, styles[variant], classNames?.input)}\n onPasteCapture={paste.handleInputPaste}\n data-input-container\n >\n {state.segmentConfigs\n .reduce<ReactNode[][]>(\n (acc, config, configIndex) => {\n const currentGroupIndex = acc.length - 1;\n\n if (\n config.value === GROUP_SEPARATOR &&\n variant === 'stacked'\n ) {\n acc.push([]);\n\n return acc;\n }\n\n if (config.type === 'literal') {\n acc[currentGroupIndex]?.push(\n <span\n key={`${format}-literal-${configIndex}-${config.value}`}\n className={styles.literal}\n >\n {config.value}\n </span>,\n );\n\n return acc;\n }\n\n const editableIndex = state.segmentConfigs\n .slice(0, configIndex)\n .filter((c) => c.type !== 'literal').length;\n\n acc[currentGroupIndex]?.push(\n <CoordinateSegment\n key={`${format}-segment-${editableIndex}`}\n value={state.segmentValues[editableIndex] || ''}\n onChange={(newValue) =>\n state.handleSegmentChange(editableIndex, newValue)\n }\n onFocus={() =>\n focus.setFocusedSegmentIndex(editableIndex)\n }\n onBlur={() => {\n focus.setFocusedSegmentIndex(-1);\n state.flushPendingValidation();\n }}\n onKeyDown={(e) =>\n focus.handleSegmentKeyDown(editableIndex, e)\n }\n onAutoAdvance={() =>\n focus.focusNextSegment(editableIndex)\n }\n onAutoRetreat={() =>\n focus.focusPreviousSegment(editableIndex)\n }\n placeholder={config.placeholder}\n maxLength={config.maxLength}\n pad={config.pad}\n className={clsx(styles.segment, classNames?.segment)}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n allowedChars={config.allowedChars}\n segmentRef={focus.segmentRefs[editableIndex]}\n segmentIndex={editableIndex}\n totalSegments={state.editableSegmentConfigs.length}\n ariaLabel={getSegmentLabel(format, editableIndex)}\n />,\n );\n\n return acc;\n },\n [[]],\n )\n .map((group, groupIndex) => (\n <div\n className={clsx(styles.segmentGroup, styles[variant])}\n key={`${format}-group-${\n // biome-ignore lint/suspicious/noArrayIndexKey: intentional\n groupIndex\n }`}\n >\n {group}\n </div>\n ))}\n </div>\n\n {showFormatButton && (\n <DialogTrigger onOpenChange={handlePopoverOpenChange}>\n <Button\n variant='icon'\n size='small'\n color='mono-bold'\n className={clsx(styles.formatButton, classNames?.formatButton)}\n aria-label='View coordinate in all formats'\n isDisabled={!copy.isFormatButtonEnabled}\n >\n <Icon>\n <GlobalShare />\n </Icon>\n </Button>\n <Popover classNames={{ popover: styles.popover }}>\n <PopoverTitle className={styles.popoverTitle}>\n Copy Coordinates\n </PopoverTitle>\n <PopoverContent>\n {allCoordinateFormats &&\n COORDINATE_SYSTEMS.map((formatKey) => {\n const formatResult = allCoordinateFormats[formatKey];\n const isCopied = copy.copiedFormat === formatKey;\n\n return (\n <div key={formatKey} className={styles.formatRow}>\n <div className={styles.formatLabels}>\n <span className={styles.formatLabel}>\n {COORDINATE_FORMAT_LABELS[formatKey]}\n </span>\n <span\n className={styles.formatValue}\n title={formatResult.value}\n >\n {formatResult.value}\n </span>\n </div>\n <Button\n variant='icon'\n color='mono-bold'\n aria-label={`Copy ${COORDINATE_FORMAT_LABELS[formatKey]} format`}\n onClick={() => copy.handleCopyFormat(formatKey)}\n isDisabled={!formatResult.isValid}\n >\n <Icon>\n {isCopied ? <Check /> : <CopyToClipboard />}\n </Icon>\n </Button>\n </div>\n );\n })}\n </PopoverContent>\n </Popover>\n </DialogTrigger>\n )}\n </div>\n\n {/* Description is hidden when field is invalid (unless disabled) to make room for error message */}\n {descriptionProp && !isSmall && (!isInvalid || isDisabled) && (\n <AriaText\n className={clsx(styles.description, classNames?.description)}\n slot='description'\n >\n {descriptionProp}\n </AriaText>\n )}\n\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n clsx(styles.error, className),\n )}\n >\n {effectiveErrorMessage}\n </FieldError>\n\n <DialogTrigger\n isOpen={paste.showDisambiguationModal}\n onOpenChange={paste.setShowDisambiguationModal}\n >\n <Button className={styles.hiddenTrigger}>Hidden Trigger</Button>\n <Dialog size='small'>\n <DialogTitle className={styles.modalTitle}>\n Select Coordinate Format\n </DialogTitle>\n <DialogContent>\n <p className={styles.modalDescription}>\n The pasted value matches multiple coordinate formats. Please\n select the correct interpretation:\n </p>\n\n <RadioGroup\n classNames={{ group: styles.formatOptions }}\n value={paste.selectedDisambiguationFormat}\n onChange={(value) =>\n paste.setSelectedDisambiguationFormat(\n value as CoordinateSystem,\n )\n }\n >\n {paste.disambiguationMatches.map((match) => (\n <Radio key={match.format} value={match.format}>\n <div className={styles.modalOptionContent}>\n <span className={styles.formatOptionLabel}>\n {COORDINATE_FORMAT_NAMES[match.format]}\n </span>\n <span className={styles.formatOptionValue}>\n {match.displayString}\n </span>\n </div>\n </Radio>\n ))}\n </RadioGroup>\n </DialogContent>\n <DialogFooter className={styles.modalActions}>\n <Button\n variant='flat'\n onPress={() => paste.setShowDisambiguationModal(false)}\n >\n Cancel\n </Button>\n <Button onPress={paste.handleDisambiguationSelect}>\n Apply Selected\n </Button>\n </DialogFooter>\n </Dialog>\n </DialogTrigger>\n </div>\n </Provider>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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Y,CAAC,aAAa,eAC7C,oBAACE;KACC,WAAW,KAAK,OAAO,aAAa,YAAY,YAAY;KAC5D,MAAK;eAEJ;MACQ;IAGb,oBAAC;KACC,WAAW,mBAAmB,YAAY,QAAQ,cAChD,KAAK,OAAO,OAAO,UAAU,CAC9B;eAEA;MACU;IAEb,qBAACH;KACC,QAAQ,MAAM;KACd,cAAc,MAAM;gBAEpB,oBAACC;MAAO,WAAW,OAAO;gBAAe;OAAuB,EAChE,qBAACG;MAAO,MAAK;;OACX,oBAAC;QAAY,WAAW,OAAO;kBAAY;SAE7B;OACd,qBAAC,4BACC,oBAAC;QAAE,WAAW,OAAO;kBAAkB;SAGnC,EAEJ,oBAACC;QACC,YAAY,EAAE,OAAO,OAAO,eAAe;QAC3C,OAAO,MAAM;QACb,WAAW,UACT,MAAM,gCACJ,MACD;kBAGF,MAAM,sBAAsB,KAAK,UAChC,oBAACC;SAAyB,OAAO,MAAM;mBACrC,qBAAC;UAAI,WAAW,OAAO;qBACrB,oBAAC;WAAK,WAAW,OAAO;qBACrB,wBAAwB,MAAM;YAC1B,EACP,oBAAC;WAAK,WAAW,OAAO;qBACrB,MAAM;YACF;WACH;WARI,MAAM,OASV,CACR;SACS,IACC;OAChB,qBAAC;QAAa,WAAW,OAAO;mBAC9B,oBAACL;SACC,SAAQ;SACR,eAAe,MAAM,2BAA2B,MAAM;mBACvD;UAEQ,EACT,oBAACA;SAAO,SAAS,MAAM;mBAA4B;UAE1C;SACI;;OACR;MACK;;IACZ;GACG"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
/** Padding for numeric segments (0.25ch ≈ quarter character width for visual spacing) */
|
|
16
16
|
const NUMERIC_PAD = .25;
|
|
17
17
|
/** Larger padding for final segment to account for container edge (0.5ch ≈ half character) */
|
|
18
|
-
const LAST_PAD = .
|
|
18
|
+
const LAST_PAD = .8;
|
|
19
19
|
/** The separator used for the logical field groups. */
|
|
20
20
|
const GROUP_SEPARATOR = ", ";
|
|
21
21
|
/**
|
|
@@ -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/** 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,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E,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.8;\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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gB"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { CoordinateSegmentProps } from "./types.js";
|
|
14
14
|
import "client-only";
|
|
15
|
-
import * as
|
|
15
|
+
import * as react_jsx_runtime5 from "react/jsx-runtime";
|
|
16
16
|
|
|
17
17
|
//#region src/components/coordinate-field/segment.d.ts
|
|
18
18
|
|
|
@@ -91,7 +91,7 @@ declare function CoordinateSegment({
|
|
|
91
91
|
onAutoRetreat,
|
|
92
92
|
pad,
|
|
93
93
|
ariaLabel
|
|
94
|
-
}: CoordinateSegmentProps):
|
|
94
|
+
}: CoordinateSegmentProps): react_jsx_runtime5.JSX.Element;
|
|
95
95
|
//#endregion
|
|
96
96
|
export { CoordinateSegment };
|
|
97
97
|
//# sourceMappingURL=segment.d.ts.map
|