@neo4j-ndl/react 4.16.1 → 4.16.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/lib/cjs/accordion/Accordion.js +2 -2
  2. package/lib/cjs/accordion/Accordion.js.map +1 -1
  3. package/lib/cjs/ai/file-tag/FileTag.js +2 -2
  4. package/lib/cjs/ai/file-tag/FileTag.js.map +1 -1
  5. package/lib/cjs/ai/image-tag/ImageTag.js +2 -2
  6. package/lib/cjs/ai/image-tag/ImageTag.js.map +1 -1
  7. package/lib/cjs/ai/presence/Presence.js +2 -2
  8. package/lib/cjs/ai/presence/Presence.js.map +1 -1
  9. package/lib/cjs/ai/preview/Preview.js +3 -2
  10. package/lib/cjs/ai/preview/Preview.js.map +1 -1
  11. package/lib/cjs/ai/prompt/Prompt.js +6 -3
  12. package/lib/cjs/ai/prompt/Prompt.js.map +1 -1
  13. package/lib/cjs/ai/reasoning/Reasoning.js +2 -2
  14. package/lib/cjs/ai/reasoning/Reasoning.js.map +1 -1
  15. package/lib/cjs/ai/tool-call/ToolCall.js +2 -2
  16. package/lib/cjs/ai/tool-call/ToolCall.js.map +1 -1
  17. package/lib/cjs/avatar/Avatar.js +2 -2
  18. package/lib/cjs/avatar/Avatar.js.map +1 -1
  19. package/lib/cjs/banner/Banner.js +12 -7
  20. package/lib/cjs/banner/Banner.js.map +1 -1
  21. package/lib/cjs/breadcrumbs/Breadcrumbs.js +2 -2
  22. package/lib/cjs/breadcrumbs/Breadcrumbs.js.map +1 -1
  23. package/lib/cjs/clipboard-button/ClipboardButton.js +2 -2
  24. package/lib/cjs/clipboard-button/ClipboardButton.js.map +1 -1
  25. package/lib/cjs/code-block/CodeBlock.js +3 -2
  26. package/lib/cjs/code-block/CodeBlock.js.map +1 -1
  27. package/lib/cjs/color-picker/ColorPicker.js +2 -2
  28. package/lib/cjs/color-picker/ColorPicker.js.map +1 -1
  29. package/lib/cjs/data-grid/Components.js +18 -11
  30. package/lib/cjs/data-grid/Components.js.map +1 -1
  31. package/lib/cjs/date-picker/DatePicker.js +8 -5
  32. package/lib/cjs/date-picker/DatePicker.js.map +1 -1
  33. package/lib/cjs/dialog/Dialog.js +8 -5
  34. package/lib/cjs/dialog/Dialog.js.map +1 -1
  35. package/lib/cjs/dismissible-tag/DismissibleTag.js +2 -2
  36. package/lib/cjs/dismissible-tag/DismissibleTag.js.map +1 -1
  37. package/lib/cjs/drawer/Drawer.js +2 -2
  38. package/lib/cjs/drawer/Drawer.js.map +1 -1
  39. package/lib/cjs/dropdown-button/DropdownButton.js +2 -2
  40. package/lib/cjs/dropdown-button/DropdownButton.js.map +1 -1
  41. package/lib/cjs/dropzone/Dropzone.js +5 -3
  42. package/lib/cjs/dropzone/Dropzone.js.map +1 -1
  43. package/lib/cjs/icon-button-array/IconButtonArray.js +6 -3
  44. package/lib/cjs/icon-button-array/IconButtonArray.js.map +1 -1
  45. package/lib/cjs/inline-edit/InlineEdit.js +6 -4
  46. package/lib/cjs/inline-edit/InlineEdit.js.map +1 -1
  47. package/lib/cjs/menu/Menu.js +4 -3
  48. package/lib/cjs/menu/Menu.js.map +1 -1
  49. package/lib/cjs/next/tree-view/TreeView.js +4 -3
  50. package/lib/cjs/next/tree-view/TreeView.js.map +1 -1
  51. package/lib/cjs/select/Overrides.js +4 -3
  52. package/lib/cjs/select/Overrides.js.map +1 -1
  53. package/lib/cjs/select/Select.js +2 -2
  54. package/lib/cjs/select/Select.js.map +1 -1
  55. package/lib/cjs/select-icon-button/SelectIconButton.js +2 -2
  56. package/lib/cjs/select-icon-button/SelectIconButton.js.map +1 -1
  57. package/lib/cjs/side-navigation/SideNavigation.js +4 -3
  58. package/lib/cjs/side-navigation/SideNavigation.js.map +1 -1
  59. package/lib/cjs/status-label/StatusLabel.js +10 -7
  60. package/lib/cjs/status-label/StatusLabel.js.map +1 -1
  61. package/lib/cjs/tabs/Tabs.js +4 -3
  62. package/lib/cjs/tabs/Tabs.js.map +1 -1
  63. package/lib/cjs/tag/Tag.js +2 -2
  64. package/lib/cjs/tag/Tag.js.map +1 -1
  65. package/lib/cjs/text-area/TextArea.js +3 -2
  66. package/lib/cjs/text-area/TextArea.js.map +1 -1
  67. package/lib/cjs/text-input/TextInput.js +6 -4
  68. package/lib/cjs/text-input/TextInput.js.map +1 -1
  69. package/lib/cjs/text-link/TextLink.js +3 -2
  70. package/lib/cjs/text-link/TextLink.js.map +1 -1
  71. package/lib/cjs/time-picker/TimePicker.js +3 -2
  72. package/lib/cjs/time-picker/TimePicker.js.map +1 -1
  73. package/lib/cjs/timezone-picker/TimeZonePicker.js +2 -2
  74. package/lib/cjs/timezone-picker/TimeZonePicker.js.map +1 -1
  75. package/lib/cjs/toast/Toast.js +6 -4
  76. package/lib/cjs/toast/Toast.js.map +1 -1
  77. package/lib/cjs/tree-view/TreeItemWrapper.js +2 -2
  78. package/lib/cjs/tree-view/TreeItemWrapper.js.map +1 -1
  79. package/lib/cjs/tree-view/TreeViewTextItem.js +3 -2
  80. package/lib/cjs/tree-view/TreeViewTextItem.js.map +1 -1
  81. package/lib/esm/accordion/Accordion.js +1 -1
  82. package/lib/esm/accordion/Accordion.js.map +1 -1
  83. package/lib/esm/ai/file-tag/FileTag.js +1 -1
  84. package/lib/esm/ai/file-tag/FileTag.js.map +1 -1
  85. package/lib/esm/ai/image-tag/ImageTag.js +1 -1
  86. package/lib/esm/ai/image-tag/ImageTag.js.map +1 -1
  87. package/lib/esm/ai/presence/Presence.js +1 -1
  88. package/lib/esm/ai/presence/Presence.js.map +1 -1
  89. package/lib/esm/ai/preview/Preview.js +2 -1
  90. package/lib/esm/ai/preview/Preview.js.map +1 -1
  91. package/lib/esm/ai/prompt/Prompt.js +4 -1
  92. package/lib/esm/ai/prompt/Prompt.js.map +1 -1
  93. package/lib/esm/ai/reasoning/Reasoning.js +1 -1
  94. package/lib/esm/ai/reasoning/Reasoning.js.map +1 -1
  95. package/lib/esm/ai/tool-call/ToolCall.js +1 -1
  96. package/lib/esm/ai/tool-call/ToolCall.js.map +1 -1
  97. package/lib/esm/avatar/Avatar.js +1 -1
  98. package/lib/esm/avatar/Avatar.js.map +1 -1
  99. package/lib/esm/banner/Banner.js +6 -1
  100. package/lib/esm/banner/Banner.js.map +1 -1
  101. package/lib/esm/breadcrumbs/Breadcrumbs.js +1 -1
  102. package/lib/esm/breadcrumbs/Breadcrumbs.js.map +1 -1
  103. package/lib/esm/clipboard-button/ClipboardButton.js +1 -1
  104. package/lib/esm/clipboard-button/ClipboardButton.js.map +1 -1
  105. package/lib/esm/code-block/CodeBlock.js +2 -1
  106. package/lib/esm/code-block/CodeBlock.js.map +1 -1
  107. package/lib/esm/color-picker/ColorPicker.js +1 -1
  108. package/lib/esm/color-picker/ColorPicker.js.map +1 -1
  109. package/lib/esm/data-grid/Components.js +8 -1
  110. package/lib/esm/data-grid/Components.js.map +1 -1
  111. package/lib/esm/date-picker/DatePicker.js +4 -1
  112. package/lib/esm/date-picker/DatePicker.js.map +1 -1
  113. package/lib/esm/dialog/Dialog.js +4 -1
  114. package/lib/esm/dialog/Dialog.js.map +1 -1
  115. package/lib/esm/dismissible-tag/DismissibleTag.js +1 -1
  116. package/lib/esm/dismissible-tag/DismissibleTag.js.map +1 -1
  117. package/lib/esm/drawer/Drawer.js +1 -1
  118. package/lib/esm/drawer/Drawer.js.map +1 -1
  119. package/lib/esm/dropdown-button/DropdownButton.js +1 -1
  120. package/lib/esm/dropdown-button/DropdownButton.js.map +1 -1
  121. package/lib/esm/dropzone/Dropzone.js +3 -1
  122. package/lib/esm/dropzone/Dropzone.js.map +1 -1
  123. package/lib/esm/icon-button-array/IconButtonArray.js +4 -1
  124. package/lib/esm/icon-button-array/IconButtonArray.js.map +1 -1
  125. package/lib/esm/inline-edit/InlineEdit.js +3 -1
  126. package/lib/esm/inline-edit/InlineEdit.js.map +1 -1
  127. package/lib/esm/menu/Menu.js +2 -1
  128. package/lib/esm/menu/Menu.js.map +1 -1
  129. package/lib/esm/next/tree-view/TreeView.js +2 -1
  130. package/lib/esm/next/tree-view/TreeView.js.map +1 -1
  131. package/lib/esm/select/Overrides.js +2 -1
  132. package/lib/esm/select/Overrides.js.map +1 -1
  133. package/lib/esm/select/Select.js +1 -1
  134. package/lib/esm/select/Select.js.map +1 -1
  135. package/lib/esm/select-icon-button/SelectIconButton.js +1 -1
  136. package/lib/esm/select-icon-button/SelectIconButton.js.map +1 -1
  137. package/lib/esm/side-navigation/SideNavigation.js +2 -1
  138. package/lib/esm/side-navigation/SideNavigation.js.map +1 -1
  139. package/lib/esm/status-label/StatusLabel.js +4 -1
  140. package/lib/esm/status-label/StatusLabel.js.map +1 -1
  141. package/lib/esm/tabs/Tabs.js +2 -1
  142. package/lib/esm/tabs/Tabs.js.map +1 -1
  143. package/lib/esm/tag/Tag.js +1 -1
  144. package/lib/esm/tag/Tag.js.map +1 -1
  145. package/lib/esm/text-area/TextArea.js +2 -1
  146. package/lib/esm/text-area/TextArea.js.map +1 -1
  147. package/lib/esm/text-input/TextInput.js +3 -1
  148. package/lib/esm/text-input/TextInput.js.map +1 -1
  149. package/lib/esm/text-link/TextLink.js +2 -1
  150. package/lib/esm/text-link/TextLink.js.map +1 -1
  151. package/lib/esm/time-picker/TimePicker.js +2 -1
  152. package/lib/esm/time-picker/TimePicker.js.map +1 -1
  153. package/lib/esm/timezone-picker/TimeZonePicker.js +1 -1
  154. package/lib/esm/timezone-picker/TimeZonePicker.js.map +1 -1
  155. package/lib/esm/toast/Toast.js +3 -1
  156. package/lib/esm/toast/Toast.js.map +1 -1
  157. package/lib/esm/tree-view/TreeItemWrapper.js +1 -1
  158. package/lib/esm/tree-view/TreeItemWrapper.js.map +1 -1
  159. package/lib/esm/tree-view/TreeViewTextItem.js +2 -1
  160. package/lib/esm/tree-view/TreeViewTextItem.js.map +1 -1
  161. package/lib/types/ai/file-tag/FileTag.d.ts.map +1 -1
  162. package/lib/types/ai/image-tag/ImageTag.d.ts.map +1 -1
  163. package/lib/types/ai/presence/Presence.d.ts.map +1 -1
  164. package/lib/types/ai/preview/Preview.d.ts.map +1 -1
  165. package/lib/types/ai/prompt/Prompt.d.ts.map +1 -1
  166. package/lib/types/ai/reasoning/Reasoning.d.ts.map +1 -1
  167. package/lib/types/ai/tool-call/ToolCall.d.ts.map +1 -1
  168. package/lib/types/banner/Banner.d.ts.map +1 -1
  169. package/lib/types/breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  170. package/lib/types/code-block/CodeBlock.d.ts.map +1 -1
  171. package/lib/types/data-grid/Components.d.ts +1 -1
  172. package/lib/types/data-grid/Components.d.ts.map +1 -1
  173. package/lib/types/date-picker/DatePicker.d.ts.map +1 -1
  174. package/lib/types/dialog/Dialog.d.ts.map +1 -1
  175. package/lib/types/dropzone/Dropzone.d.ts.map +1 -1
  176. package/lib/types/icon-button-array/IconButtonArray.d.ts.map +1 -1
  177. package/lib/types/inline-edit/InlineEdit.d.ts.map +1 -1
  178. package/lib/types/menu/Menu.d.ts.map +1 -1
  179. package/lib/types/next/tree-view/TreeView.d.ts.map +1 -1
  180. package/lib/types/select/Overrides.d.ts.map +1 -1
  181. package/lib/types/side-navigation/SideNavigation.d.ts.map +1 -1
  182. package/lib/types/status-label/StatusLabel.d.ts.map +1 -1
  183. package/lib/types/tabs/Tabs.d.ts.map +1 -1
  184. package/lib/types/text-area/TextArea.d.ts.map +1 -1
  185. package/lib/types/text-input/TextInput.d.ts.map +1 -1
  186. package/lib/types/text-link/TextLink.d.ts.map +1 -1
  187. package/lib/types/time-picker/TimePicker.d.ts.map +1 -1
  188. package/lib/types/toast/Toast.d.ts.map +1 -1
  189. package/lib/types/tree-view/TreeView.d.ts.map +1 -1
  190. package/lib/types/tree-view/TreeViewTextItem.d.ts.map +1 -1
  191. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../src/text-area/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,O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* This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { type ReactNode, useId, useMemo } from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport {\n type CommonProps,\n type HtmlAttributes,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { needleWarningMessage } from '../_common/utils';\nimport {\n ExclamationCircleIconSolid,\n InformationCircleIconOutline,\n} from '../icons';\nimport { Tooltip } from '../tooltip';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype TextAreaProps = {\n /** The label displayed above the textarea */\n label?: ReactNode;\n\n /** Whether the textarea should take the full available width */\n isFluid?: boolean;\n\n /** Assistive text displayed below the textarea */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the textarea. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Size of the textarea */\n size?: 'small' | 'medium' | 'large';\n\n // TODO v5: use isRequired and showRequiredOrOptionalLabel like in TextInput\n /** Whether to display the Optional label next to the field label */\n isOptional?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether the textarea is disabled */\n isDisabled?: boolean;\n\n /** Additional HTML attributes passed to the textarea element */\n htmlAttributes?: HtmlAttributes<'textarea'>;\n\n /** Aria label for accessibility when no visible label is provided */\n ariaLabel?: string;\n\n /** Additional class names */\n className?: string;\n\n /** Additional styles applied to the root element */\n style?: React.CSSProperties;\n\n /** Whether the textarea is read-only */\n isReadOnly?: boolean;\n\n /** The current value of the textarea */\n value?: React.ComponentPropsWithoutRef<'textarea'>['value'];\n\n /** Placeholder text displayed when the textarea is empty */\n placeholder?: React.ComponentPropsWithoutRef<'textarea'>['placeholder'];\n};\n\n/**\n *\n *\n * TextArea Component\n *\n *\n */\n\nexport const TextArea = ({\n label,\n isFluid = false,\n errorText,\n helpText,\n isOptional = false,\n moreInformationText,\n size = 'medium',\n ariaLabel,\n tooltipProps,\n isDisabled = false,\n className,\n isReadOnly = false,\n style,\n value,\n placeholder,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'textarea', TextAreaProps>) => {\n const helpTextId = useId();\n const errorTextId = useId();\n const containerWrappingClasses = classNames(\n `ndl-text-area ndl-type-text`,\n className,\n {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': errorText,\n 'ndl-has-trailing-icon': errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n },\n );\n\n const hasEmptyLabelValue = !label || label === '';\n\n const labelWrappingClasses = classNames('ndl-text-area-label', {\n 'ndl-fluid': isFluid,\n 'ndl-text-area-no-label': hasEmptyLabelValue,\n });\n\n const isCustomLabel = label && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel = isCustomLabel && !ariaLabel;\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextArea without a label does not have an aria label, be sure to include an aria label for screen readers link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-large': size === 'large',\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n });\n\n const combinedAriaDescribedby = useMemo(() => {\n const ariaDescribedby = [];\n if (helpText && !errorText) {\n ariaDescribedby.push(helpTextId);\n } else if (errorText) {\n ariaDescribedby.push(errorTextId);\n }\n return ariaDescribedby.join(' ');\n }, [helpText, errorText, helpTextId, errorTextId]);\n\n return (\n <div className={containerWrappingClasses}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n <div className=\"ndl-text-area-wrapper\">\n <textarea\n disabled={isDisabled}\n ref={ref}\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n readOnly={isReadOnly}\n value={value}\n placeholder={placeholder}\n style={style}\n aria-describedby={combinedAriaDescribedby}\n {...restProps}\n {...htmlAttributes}\n />\n </div>\n {!hasEmptyLabelValue && (\n <div className=\"ndl-text-area-wrapper\">\n <span className=\"ndl-text-area-label-text\">{label}</span>\n {Boolean(moreInformationText) && (\n <Tooltip type=\"simple\" {...tooltipProps?.root}>\n <Tooltip.Trigger {...tooltipProps?.trigger}>\n <div\n className={informationIconClasses}\n data-testid=\"ndl-information-icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {isOptional && (\n <span className=\"ndl-text-area-optional\">Optional</span>\n )}\n </div>\n )}\n </label>\n {helpText && !errorText && (\n <div className=\"ndl-text-area-msg\" aria-live=\"polite\" id={helpTextId}>\n {helpText}\n </div>\n )}\n {errorText && (\n <div className=\"ndl-text-area-msg\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <div className=\"ndl-error-text\" id={errorTextId} aria-live=\"polite\">\n {errorText}\n </div>\n </div>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"TextArea.js","sourceRoot":"","sources":["../../../src/text-area/TextArea.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,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o4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\nimport { type ReactNode, useId, useMemo } from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport {\n type CommonProps,\n type HtmlAttributes,\n type TooltipObjectProps,\n} from '../_common/types';\nimport { needleWarningMessage } from '../_common/utils';\nimport { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';\nimport { InformationCircleIconOutline } from '../icons/generated/heroIcons/InformationCircleIconOutline';\nimport { Tooltip } from '../tooltip';\n\n/**\n *\n *\n * Types\n *\n *\n */\n\ntype TextAreaProps = {\n /** The label displayed above the textarea */\n label?: ReactNode;\n\n /** Whether the textarea should take the full available width */\n isFluid?: boolean;\n\n /** Assistive text displayed below the textarea */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the textarea. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Size of the textarea */\n size?: 'small' | 'medium' | 'large';\n\n // TODO v5: use isRequired and showRequiredOrOptionalLabel like in TextInput\n /** Whether to display the Optional label next to the field label */\n isOptional?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether the textarea is disabled */\n isDisabled?: boolean;\n\n /** Additional HTML attributes passed to the textarea element */\n htmlAttributes?: HtmlAttributes<'textarea'>;\n\n /** Aria label for accessibility when no visible label is provided */\n ariaLabel?: string;\n\n /** Additional class names */\n className?: string;\n\n /** Additional styles applied to the root element */\n style?: React.CSSProperties;\n\n /** Whether the textarea is read-only */\n isReadOnly?: boolean;\n\n /** The current value of the textarea */\n value?: React.ComponentPropsWithoutRef<'textarea'>['value'];\n\n /** Placeholder text displayed when the textarea is empty */\n placeholder?: React.ComponentPropsWithoutRef<'textarea'>['placeholder'];\n};\n\n/**\n *\n *\n * TextArea Component\n *\n *\n */\n\nexport const TextArea = ({\n label,\n isFluid = false,\n errorText,\n helpText,\n isOptional = false,\n moreInformationText,\n size = 'medium',\n ariaLabel,\n tooltipProps,\n isDisabled = false,\n className,\n isReadOnly = false,\n style,\n value,\n placeholder,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'textarea', TextAreaProps>) => {\n const helpTextId = useId();\n const errorTextId = useId();\n const containerWrappingClasses = classNames(\n `ndl-text-area ndl-type-text`,\n className,\n {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': errorText,\n 'ndl-has-trailing-icon': errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-small': size === 'small',\n },\n );\n\n const hasEmptyLabelValue = !label || label === '';\n\n const labelWrappingClasses = classNames('ndl-text-area-label', {\n 'ndl-fluid': isFluid,\n 'ndl-text-area-no-label': hasEmptyLabelValue,\n });\n\n const isCustomLabel = label && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel = isCustomLabel && !ariaLabel;\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextArea without a label does not have an aria label, be sure to include an aria label for screen readers link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-large': size === 'large',\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n });\n\n const combinedAriaDescribedby = useMemo(() => {\n const ariaDescribedby = [];\n if (helpText && !errorText) {\n ariaDescribedby.push(helpTextId);\n } else if (errorText) {\n ariaDescribedby.push(errorTextId);\n }\n return ariaDescribedby.join(' ');\n }, [helpText, errorText, helpTextId, errorTextId]);\n\n return (\n <div className={containerWrappingClasses}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n <div className=\"ndl-text-area-wrapper\">\n <textarea\n disabled={isDisabled}\n ref={ref}\n aria-label={ariaLabel}\n aria-invalid={Boolean(errorText)}\n readOnly={isReadOnly}\n value={value}\n placeholder={placeholder}\n style={style}\n aria-describedby={combinedAriaDescribedby}\n {...restProps}\n {...htmlAttributes}\n />\n </div>\n {!hasEmptyLabelValue && (\n <div className=\"ndl-text-area-wrapper\">\n <span className=\"ndl-text-area-label-text\">{label}</span>\n {Boolean(moreInformationText) && (\n <Tooltip type=\"simple\" {...tooltipProps?.root}>\n <Tooltip.Trigger {...tooltipProps?.trigger}>\n <div\n className={informationIconClasses}\n data-testid=\"ndl-information-icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {isOptional && (\n <span className=\"ndl-text-area-optional\">Optional</span>\n )}\n </div>\n )}\n </label>\n {helpText && !errorText && (\n <div className=\"ndl-text-area-msg\" aria-live=\"polite\" id={helpTextId}>\n {helpText}\n </div>\n )}\n {errorText && (\n <div className=\"ndl-text-area-msg\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <div className=\"ndl-error-text\" id={errorTextId} aria-live=\"polite\">\n {errorText}\n </div>\n </div>\n )}\n </div>\n );\n};\n"]}
@@ -35,7 +35,9 @@ import { useId, useMemo, } from 'react';
35
35
  import { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';
36
36
  import { useSemiControlledInput } from '../_common/use-semi-controlled-input';
37
37
  import { needleWarningMessage } from '../_common/utils';
38
- import { ExclamationCircleIconSolid, InformationCircleIconOutline, XMarkIconOutline, } from '../icons';
38
+ import { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';
39
+ import { InformationCircleIconOutline } from '../icons/generated/heroIcons/InformationCircleIconOutline';
40
+ import { XMarkIconOutline } from '../icons/generated/heroIcons/XMarkIconOutline';
39
41
  import { LoadingSpinner } from '../loading-spinner';
40
42
  import { Skeleton } from '../skeleton';
41
43
  import { Tooltip } from '../tooltip';
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAIL,KAAK,EACL,OAAO,GACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,uCAAuC,EAAE,MAAM,qBAAqB,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAoE3C;;;;;;GAMG;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EA0Ba,EAAE,EAAE;QA1BjB,EACxB,KAAK,EACL,OAAO,EACP,SAAS,EACT,QAAQ,EACR,cAAc,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,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,IAAI,CAClC,KAAC,QAAQ,IACP,YAAY,EAAC,MAAM,EACnB,KAAK,EAAC,aAAa,EACnB,SAAS,EAAE,iBAAiB,YAE5B,KAAC,UAAU,IACT,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EACxD,SAAS,EAAC,kBAAkB,EAC5B,cAAc,EAAE;wBACd,WAAW,EAAE,QAAQ;wBACrB,EAAE,EAAE,UAAU;qBACf,YAEA,QAAQ,GACE,GACJ,CACZ,EACA,OAAO,CAAC,SAAS,CAAC,IAAI;YACrB,0GAA0G;YAC1G,kGAAkG;YAClG,KAAC,QAAQ,kBACP,YAAY,EAAC,MAAM,EACnB,KAAK,EAAC,aAAa,EACnB,KAAK,EAAC,aAAa,IACf,aAAa,IACjB,SAAS,EAAE,iBAAiB,YAE5B,eAAK,SAAS,EAAC,kBAAkB,aAC/B,cAAK,SAAS,EAAC,gBAAgB,YAC7B,KAAC,0BAA0B,KAAG,GAC1B,EACN,KAAC,UAAU,IACT,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EACxD,cAAc,EAAE;gCACd,WAAW,EAAE,QAAQ;gCACrB,EAAE,EAAE,WAAW;6BAChB,YAEA,SAAS,GACC,IACT,IACG,CACZ,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport classNames from 'classnames';\nimport {\n type InputHTMLAttributes,\n type ReactElement,\n type ReactNode,\n useId,\n useMemo,\n} from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport { type CommonProps, type TooltipObjectProps } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\nimport {\n ExclamationCircleIconSolid,\n InformationCircleIconOutline,\n XMarkIconOutline,\n} from '../icons';\nimport { LoadingSpinner } from '../loading-spinner';\nimport { Skeleton } from '../skeleton';\nimport { Tooltip } from '../tooltip';\nimport { Typography } from '../typography';\n\ntype TextInputProps = {\n /** Assistive text displayed below the input */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the input. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Leading element rendered inside the input */\n leadingElement?: ReactElement;\n\n /** Trailing element rendered inside the input */\n trailingElement?: ReactElement;\n\n /** Size of the input */\n size?: 'small' | 'medium' | 'large';\n\n /** Whether the input is read-only */\n isReadOnly?: boolean;\n\n /**\n * Whether to display the Required/Optional label next to the field label.\n * Shows Required if isRequired is true, otherwise shows Optional.\n * @default false\n */\n showRequiredOrOptionalLabel?: boolean;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Whether the input is required */\n isRequired?: boolean;\n\n /** The current value of the input */\n value?: React.ComponentPropsWithoutRef<'input'>['value'];\n\n /** Placeholder text displayed when the input is empty */\n placeholder?: React.ComponentPropsWithoutRef<'input'>['placeholder'];\n\n /** Callback function triggered when the input value changes */\n onChange?: React.ComponentPropsWithoutRef<'input'>['onChange'];\n\n /** Whether the input should take the full available width */\n isFluid?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** The label displayed above the input */\n label?: string | React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether to render skeletons instead of content */\n isSkeletonLoading?: boolean;\n\n /** Additional props forwarded to the underlying Skeleton components */\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n\n /** Whether to show the clear button */\n isClearable?: boolean;\n\n /** Whether to show the loading spinner */\n isLoading?: boolean;\n};\n\n/**\n *\n *\n * TextInput Component\n *\n *\n */\n\nexport const TextInput = ({\n label,\n isFluid,\n errorText,\n helpText,\n leadingElement,\n trailingElement,\n showRequiredOrOptionalLabel = false,\n moreInformationText,\n size = 'medium',\n placeholder,\n value,\n tooltipProps,\n htmlAttributes,\n isDisabled,\n isReadOnly,\n isRequired,\n onChange,\n isClearable = false,\n className,\n style,\n isSkeletonLoading = false,\n isLoading = false,\n skeletonProps,\n ref,\n ...restProps\n}: CommonProps<'input', TextInputProps>) => {\n const [currentValue, handleChange] = useSemiControlledInput({\n inputType: 'text',\n isControlled: value !== undefined,\n onChange,\n state: value ?? '',\n });\n const hintId = useId();\n const helpTextId = useId();\n const errorTextId = useId();\n\n const containerWrappingClasses = classNames(`ndl-text-input`, className, {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': leadingElement || trailingElement || errorText,\n 'ndl-has-leading-icon': leadingElement,\n 'ndl-has-trailing-icon': trailingElement || errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n });\n\n const hasEmptyLabelValue =\n label === undefined || label === null || label === '';\n\n const labelWrappingClasses = classNames('ndl-form-item-label', {\n 'ndl-fluid': isFluid,\n 'ndl-form-item-no-label': hasEmptyLabelValue,\n });\n\n const combinedHtmlInputAttributes: InputHTMLAttributes<HTMLInputElement> = {\n ...htmlAttributes,\n className: classNames('ndl-input', htmlAttributes?.className),\n };\n const ariaLabel = combinedHtmlInputAttributes['aria-label'];\n const isCustomLabel = Boolean(label) && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel =\n isCustomLabel && (ariaLabel === undefined || ariaLabel === '');\n const shouldRenderHint = isClearable || isLoading;\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (isClearable && event.key === 'Escape' && Boolean(currentValue)) {\n event.preventDefault();\n event.stopPropagation();\n handleChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n htmlAttributes?.onKeyDown?.(event);\n };\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextInput without a label does not have an aria label, be sure to include an aria label for screen readers. Link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-large': size === 'large',\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n });\n\n const combinedAriaDescribedby = useMemo(() => {\n const ariaDescribedby = [];\n\n if (hintId && shouldRenderHint) {\n ariaDescribedby.push(hintId);\n }\n if (helpText && !errorText) {\n ariaDescribedby.push(helpTextId);\n } else if (errorText) {\n ariaDescribedby.push(errorTextId);\n }\n return ariaDescribedby.join(' ');\n }, [hintId, shouldRenderHint, helpText, errorText, helpTextId, errorTextId]);\n\n return (\n <div className={containerWrappingClasses} style={style}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n {!hasEmptyLabelValue && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-label-text-wrapper\">\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n className=\"ndl-label-text\"\n >\n {label}\n </Typography>\n {Boolean(moreInformationText) && (\n <Tooltip {...tooltipProps?.root} type=\"simple\">\n <Tooltip.Trigger\n {...tooltipProps?.trigger}\n className={informationIconClasses}\n hasButtonWrapper\n >\n <div\n tabIndex={0}\n role=\"button\"\n aria-label=\"Information icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {showRequiredOrOptionalLabel && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n className=\"ndl-form-item-optional\"\n >\n {isRequired === true ? 'Required' : 'Optional'}\n </Typography>\n )}\n </div>\n </Skeleton>\n )}\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-input-wrapper\">\n {(leadingElement || (isLoading && !trailingElement)) && (\n <div className=\"ndl-element-leading ndl-element\">\n {isLoading ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n leadingElement\n )}\n </div>\n )}\n <div\n className={classNames('ndl-input-container', {\n 'ndl-clearable': isClearable,\n })}\n >\n <input\n ref={ref}\n readOnly={isReadOnly}\n disabled={isDisabled}\n required={isRequired}\n value={currentValue}\n placeholder={placeholder}\n type=\"text\"\n onChange={handleChange}\n aria-describedby={combinedAriaDescribedby}\n aria-invalid={Boolean(errorText)}\n {...combinedHtmlInputAttributes}\n onKeyDown={handleInputKeyDown}\n {...restProps}\n />\n {shouldRenderHint && (\n <span\n id={hintId}\n className=\"ndl-text-input-hint\"\n aria-hidden={true}\n >\n {isLoading && 'Loading '}\n {isClearable && 'Press Escape to clear input.'}\n </span>\n )}\n {isClearable && Boolean(currentValue) && (\n <div className=\"ndl-element-clear ndl-element\">\n <button\n tabIndex={-1}\n aria-hidden={true}\n type=\"button\"\n title=\"Clear input (Esc)\"\n onClick={() => {\n handleChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }}\n >\n <XMarkIconOutline className=\"n-size-4\" />\n </button>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className=\"ndl-element-trailing ndl-element\">\n {isLoading && !leadingElement ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n trailingElement\n )}\n </div>\n )}\n </div>\n </Skeleton>\n </label>\n {Boolean(helpText) && !errorText && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n isLoading={isSkeletonLoading}\n >\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-form-message\"\n htmlAttributes={{\n 'aria-live': 'polite',\n id: helpTextId,\n }}\n >\n {helpText}\n </Typography>\n </Skeleton>\n )}\n {Boolean(errorText) && (\n // TODO v4: We might want to have a min width for the container for the messages to help skeleton loading.\n // Currently the message fills 100% of the width while the rest of the text input has a set width.\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n width=\"fit-content\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-form-message\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <Typography\n className=\"ndl-error-text\"\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n htmlAttributes={{\n 'aria-live': 'polite',\n id: errorTextId,\n }}\n >\n {errorText}\n </Typography>\n </div>\n </Skeleton>\n )}\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/text-input/TextInput.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAIL,KAAK,EACL,OAAO,GACR,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,uCAAuC,EAAE,MAAM,qBAA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,cAAK,SAAS,EAAC,gBAAgB,YAC7B,KAAC,0BAA0B,KAAG,GAC1B,EACN,KAAC,UAAU,IACT,SAAS,EAAC,gBAAgB,EAC1B,OAAO,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,EACxD,cAAc,EAAE;gCACd,WAAW,EAAE,QAAQ;gCACrB,EAAE,EAAE,WAAW;6BAChB,YAEA,SAAS,GACC,IACT,IACG,CACZ,IACG,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport classNames from 'classnames';\nimport {\n type InputHTMLAttributes,\n type ReactElement,\n type ReactNode,\n useId,\n useMemo,\n} from 'react';\n\nimport { customLabelAndNoAriaLabelWarningMessage } from '../_common/messages';\nimport { type CommonProps, type TooltipObjectProps } from '../_common/types';\nimport { useSemiControlledInput } from '../_common/use-semi-controlled-input';\nimport { needleWarningMessage } from '../_common/utils';\nimport { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';\nimport { InformationCircleIconOutline } from '../icons/generated/heroIcons/InformationCircleIconOutline';\nimport { XMarkIconOutline } from '../icons/generated/heroIcons/XMarkIconOutline';\nimport { LoadingSpinner } from '../loading-spinner';\nimport { Skeleton } from '../skeleton';\nimport { Tooltip } from '../tooltip';\nimport { Typography } from '../typography';\n\ntype TextInputProps = {\n /** Assistive text displayed below the input */\n helpText?: string | ReactNode;\n\n /** Error message displayed below the input. When provided, it overrides `helpText` and shows an error icon */\n errorText?: string | ReactNode;\n\n /** Leading element rendered inside the input */\n leadingElement?: ReactElement;\n\n /** Trailing element rendered inside the input */\n trailingElement?: ReactElement;\n\n /** Size of the input */\n size?: 'small' | 'medium' | 'large';\n\n /** Whether the input is read-only */\n isReadOnly?: boolean;\n\n /**\n * Whether to display the Required/Optional label next to the field label.\n * Shows Required if isRequired is true, otherwise shows Optional.\n * @default false\n */\n showRequiredOrOptionalLabel?: boolean;\n\n /** Whether the input is disabled */\n isDisabled?: boolean;\n\n /** Whether the input is required */\n isRequired?: boolean;\n\n /** The current value of the input */\n value?: React.ComponentPropsWithoutRef<'input'>['value'];\n\n /** Placeholder text displayed when the input is empty */\n placeholder?: React.ComponentPropsWithoutRef<'input'>['placeholder'];\n\n /** Callback function triggered when the input value changes */\n onChange?: React.ComponentPropsWithoutRef<'input'>['onChange'];\n\n /** Whether the input should take the full available width */\n isFluid?: boolean;\n\n /** Text displayed in the information tooltip shown next to the label */\n moreInformationText?: React.ReactNode;\n\n /** The label displayed above the input */\n label?: string | React.ReactNode;\n\n /** Props for the Tooltip component used by the information icon */\n tooltipProps?: TooltipObjectProps;\n\n /** Whether to render skeletons instead of content */\n isSkeletonLoading?: boolean;\n\n /** Additional props forwarded to the underlying Skeleton components */\n skeletonProps?: React.ComponentProps<typeof Skeleton>;\n\n /** Whether to show the clear button */\n isClearable?: boolean;\n\n /** Whether to show the loading spinner */\n isLoading?: boolean;\n};\n\n/**\n *\n *\n * TextInput Component\n *\n *\n */\n\nexport const TextInput = ({\n label,\n isFluid,\n errorText,\n helpText,\n leadingElement,\n trailingElement,\n showRequiredOrOptionalLabel = false,\n moreInformationText,\n size = 'medium',\n placeholder,\n value,\n tooltipProps,\n htmlAttributes,\n isDisabled,\n isReadOnly,\n isRequired,\n onChange,\n isClearable = false,\n className,\n style,\n isSkeletonLoading = false,\n isLoading = false,\n skeletonProps,\n ref,\n ...restProps\n}: CommonProps<'input', TextInputProps>) => {\n const [currentValue, handleChange] = useSemiControlledInput({\n inputType: 'text',\n isControlled: value !== undefined,\n onChange,\n state: value ?? '',\n });\n const hintId = useId();\n const helpTextId = useId();\n const errorTextId = useId();\n\n const containerWrappingClasses = classNames(`ndl-text-input`, className, {\n 'ndl-disabled': isDisabled,\n 'ndl-has-error': errorText,\n 'ndl-has-icon': leadingElement || trailingElement || errorText,\n 'ndl-has-leading-icon': leadingElement,\n 'ndl-has-trailing-icon': trailingElement || errorText,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n });\n\n const hasEmptyLabelValue =\n label === undefined || label === null || label === '';\n\n const labelWrappingClasses = classNames('ndl-form-item-label', {\n 'ndl-fluid': isFluid,\n 'ndl-form-item-no-label': hasEmptyLabelValue,\n });\n\n const combinedHtmlInputAttributes: InputHTMLAttributes<HTMLInputElement> = {\n ...htmlAttributes,\n className: classNames('ndl-input', htmlAttributes?.className),\n };\n const ariaLabel = combinedHtmlInputAttributes['aria-label'];\n const isCustomLabel = Boolean(label) && typeof label !== 'string';\n const hasCustomLabelAndNoAriaLabel =\n isCustomLabel && (ariaLabel === undefined || ariaLabel === '');\n const shouldRenderHint = isClearable || isLoading;\n\n const handleInputKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {\n if (isClearable && event.key === 'Escape' && Boolean(currentValue)) {\n event.preventDefault();\n event.stopPropagation();\n handleChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }\n htmlAttributes?.onKeyDown?.(event);\n };\n\n useMemo(() => {\n if (!label && !ariaLabel) {\n needleWarningMessage(\n 'A TextInput without a label does not have an aria label, be sure to include an aria label for screen readers. Link: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI',\n );\n }\n\n if (hasCustomLabelAndNoAriaLabel) {\n needleWarningMessage(customLabelAndNoAriaLabelWarningMessage);\n }\n }, [label, ariaLabel, hasCustomLabelAndNoAriaLabel]);\n\n const informationIconClasses = classNames({\n 'ndl-information-icon-large': size === 'large',\n 'ndl-information-icon-small': size === 'small' || size === 'medium',\n });\n\n const combinedAriaDescribedby = useMemo(() => {\n const ariaDescribedby = [];\n\n if (hintId && shouldRenderHint) {\n ariaDescribedby.push(hintId);\n }\n if (helpText && !errorText) {\n ariaDescribedby.push(helpTextId);\n } else if (errorText) {\n ariaDescribedby.push(errorTextId);\n }\n return ariaDescribedby.join(' ');\n }, [hintId, shouldRenderHint, helpText, errorText, helpTextId, errorTextId]);\n\n return (\n <div className={containerWrappingClasses} style={style}>\n {/* We enable implicit label wrapping */}\n {/* Source: https://dequeuniversity.com/rules/axe/4.2/label?application=axeAPI */}\n <label className={labelWrappingClasses}>\n {!hasEmptyLabelValue && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-label-text-wrapper\">\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n className=\"ndl-label-text\"\n >\n {label}\n </Typography>\n {Boolean(moreInformationText) && (\n <Tooltip {...tooltipProps?.root} type=\"simple\">\n <Tooltip.Trigger\n {...tooltipProps?.trigger}\n className={informationIconClasses}\n hasButtonWrapper\n >\n <div\n tabIndex={0}\n role=\"button\"\n aria-label=\"Information icon\"\n >\n <InformationCircleIconOutline />\n </div>\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {moreInformationText}\n </Tooltip.Content>\n </Tooltip>\n )}\n {showRequiredOrOptionalLabel && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n className=\"ndl-form-item-optional\"\n >\n {isRequired === true ? 'Required' : 'Optional'}\n </Typography>\n )}\n </div>\n </Skeleton>\n )}\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-input-wrapper\">\n {(leadingElement || (isLoading && !trailingElement)) && (\n <div className=\"ndl-element-leading ndl-element\">\n {isLoading ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n leadingElement\n )}\n </div>\n )}\n <div\n className={classNames('ndl-input-container', {\n 'ndl-clearable': isClearable,\n })}\n >\n <input\n ref={ref}\n readOnly={isReadOnly}\n disabled={isDisabled}\n required={isRequired}\n value={currentValue}\n placeholder={placeholder}\n type=\"text\"\n onChange={handleChange}\n aria-describedby={combinedAriaDescribedby}\n aria-invalid={Boolean(errorText)}\n {...combinedHtmlInputAttributes}\n onKeyDown={handleInputKeyDown}\n {...restProps}\n />\n {shouldRenderHint && (\n <span\n id={hintId}\n className=\"ndl-text-input-hint\"\n aria-hidden={true}\n >\n {isLoading && 'Loading '}\n {isClearable && 'Press Escape to clear input.'}\n </span>\n )}\n {isClearable && Boolean(currentValue) && (\n <div className=\"ndl-element-clear ndl-element\">\n <button\n tabIndex={-1}\n aria-hidden={true}\n type=\"button\"\n title=\"Clear input (Esc)\"\n onClick={() => {\n handleChange?.({\n target: { value: '' },\n } as React.ChangeEvent<HTMLInputElement>);\n }}\n >\n <XMarkIconOutline className=\"n-size-4\" />\n </button>\n </div>\n )}\n </div>\n {trailingElement && (\n <div className=\"ndl-element-trailing ndl-element\">\n {isLoading && !leadingElement ? (\n <LoadingSpinner\n size={size === 'large' ? 'medium' : 'small'}\n className={\n size === 'large'\n ? 'ndl-medium-spinner'\n : 'ndl-small-spinner'\n }\n />\n ) : (\n trailingElement\n )}\n </div>\n )}\n </div>\n </Skeleton>\n </label>\n {Boolean(helpText) && !errorText && (\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n isLoading={isSkeletonLoading}\n >\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-form-message\"\n htmlAttributes={{\n 'aria-live': 'polite',\n id: helpTextId,\n }}\n >\n {helpText}\n </Typography>\n </Skeleton>\n )}\n {Boolean(errorText) && (\n // TODO v4: We might want to have a min width for the container for the messages to help skeleton loading.\n // Currently the message fills 100% of the width while the rest of the text input has a set width.\n <Skeleton\n onBackground=\"weak\"\n shape=\"rectangular\"\n width=\"fit-content\"\n {...skeletonProps}\n isLoading={isSkeletonLoading}\n >\n <div className=\"ndl-form-message\">\n <div className=\"ndl-error-icon\">\n <ExclamationCircleIconSolid />\n </div>\n <Typography\n className=\"ndl-error-text\"\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n htmlAttributes={{\n 'aria-live': 'polite',\n id: errorTextId,\n }}\n >\n {errorText}\n </Typography>\n </div>\n </Skeleton>\n )}\n </div>\n );\n};\n"]}
@@ -31,7 +31,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
31
31
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
32
  */
33
33
  import classNames from 'classnames';
34
- import { ArrowUpRightIconOutline, ChevronRightIconOutline } from '../icons';
34
+ import { ArrowUpRightIconOutline } from '../icons/generated/heroIcons/ArrowUpRightIconOutline';
35
+ import { ChevronRightIconOutline } from '../icons/generated/heroIcons/ChevronRightIconOutline';
35
36
  export const TextLink = (_a) => {
36
37
  var { children, href, type = 'internal', as, className, target = type === 'external' || type === 'external-underline' ? '_blank' : '', style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "href", "type", "as", "className", "target", "style", "htmlAttributes", "ref"]);
37
38
  const Component = as !== null && as !== void 0 ? as : 'a';
@@ -1 +1 @@
1
- {"version":3,"file":"TextLink.js","sourceRoot":"","sources":["../../../src/text-link/TextLink.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAIpC,OAAO,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AA4C5E,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAoC,EAWjB,EAAE,EAAE;QAXa,EAC1D,QAAQ,EACR,IAAI,EACJ,IAAI,GAAG,UAAU,EACjB,EAAE,EACF,SAAS,EACT,MAAM,GAAG,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAC7E,KAAK,EACL,cAAc,EACd,GAAG,OAEsC,EADtC,SAAS,cAV8C,2FAW3D,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,GAAG,CAAC;IAE/C,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,EAAE,SAAS,EAAE;QACrD,mBAAmB,EAAE,IAAI,KAAK,UAAU;QACxC,wBAAwB,EAAE,IAAI,KAAK,oBAAoB;QACvD,mBAAmB,EAAE,IAAI,KAAK,eAAe;QAC7C,wBAAwB,EAAE,IAAI,KAAK,oBAAoB;KACxD,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,IACV,SAAS,EACT,cAAc,eAEjB,QAAQ,EACR,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,oBAAoB,CAAC,IAAI,CACzD,KAAC,uBAAuB,IAAC,SAAS,EAAC,wBAAwB,GAAG,CAC/D,EACA,IAAI,KAAK,eAAe,IAAI,CAC3B,KAAC,uBAAuB,IAAC,SAAS,EAAC,wBAAwB,GAAG,CAC/D,KACS,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ArrowUpRightIconOutline, ChevronRightIconOutline } from '../icons';\n\n/** @deprecated Use `type=\"internal\"` instead. */\ntype InternalUnderlineTextLinkType = 'internal-underline';\n\n/** @deprecated Use `type=\"external\"` instead. */\ntype ExternalUnderlineTextLinkType = 'external-underline';\n\n/** @deprecated Use `type=\"internal\"` instead and append with a chevron icon. */\ntype InternalIconTextLinkType = 'internal-icon';\n\ntype TextLinkType =\n | 'internal'\n | InternalUnderlineTextLinkType\n | InternalIconTextLinkType\n | 'external'\n | ExternalUnderlineTextLinkType;\n\ntype TextLinkProps = {\n /** The content displayed inside the link */\n children: React.ReactNode;\n\n /** The URL the link points to */\n href?: string;\n\n /**\n * The type of the text link\n * All types render with an underline and primary text color by default. Additional color styling can be applied via `className`.\n * - 'internal': A link to another page within the application\n * - 'internal-underline': Deprecated alias of 'internal'\n * - 'internal-icon': Deprecated variant with a trailing chevron icon\n * - 'external': A link to an external website. An external link icon is appended.\n * - 'external-underline': Deprecated alias of 'external'\n * @default 'internal'\n */\n type?: TextLinkType;\n\n /** Specifies where to open the linked document. If omitted and `type` is `\"external\"` it defaults to `\"_blank\"`. */\n target?: HTMLAnchorElement['target'];\n\n /** Additional class name */\n className?: string;\n};\n\nexport const TextLink = <T extends React.ElementType = 'a'>({\n children,\n href,\n type = 'internal',\n as,\n className,\n target = type === 'external' || type === 'external-underline' ? '_blank' : '',\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, TextLinkProps>) => {\n const Component: React.ElementType = as ?? 'a';\n\n const classes = classNames('ndl-text-link', className, {\n 'ndl-external-link': type === 'external',\n 'ndl-external-underline': type === 'external-underline',\n 'ndl-internal-icon': type === 'internal-icon',\n 'ndl-internal-underline': type === 'internal-underline',\n });\n\n return (\n <Component\n className={classes}\n href={href}\n ref={ref}\n style={style}\n target={target}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n {(type === 'external' || type === 'external-underline') && (\n <ArrowUpRightIconOutline className=\"ndl-external-link-icon\" />\n )}\n {type === 'internal-icon' && (\n <ChevronRightIconOutline className=\"ndl-external-link-icon\" />\n )}\n </Component>\n );\n};\n"]}
1
+ {"version":3,"file":"TextLink.js","sourceRoot":"","sources":["../../../src/text-link/TextLink.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,UAAU,MAAM,YAAY,CAAC;AAIpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AAC/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AA4C/F,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAoC,EAWjB,EAAE,EAAE;QAXa,EAC1D,QAAQ,EACR,IAAI,EACJ,IAAI,GAAG,UAAU,EACjB,EAAE,EACF,SAAS,EACT,MAAM,GAAG,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAC7E,KAAK,EACL,cAAc,EACd,GAAG,OAEsC,EADtC,SAAS,cAV8C,2FAW3D,CADa;IAEZ,MAAM,SAAS,GAAsB,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,GAAG,CAAC;IAE/C,MAAM,OAAO,GAAG,UAAU,CAAC,eAAe,EAAE,SAAS,EAAE;QACrD,mBAAmB,EAAE,IAAI,KAAK,UAAU;QACxC,wBAAwB,EAAE,IAAI,KAAK,oBAAoB;QACvD,mBAAmB,EAAE,IAAI,KAAK,eAAe;QAC7C,wBAAwB,EAAE,IAAI,KAAK,oBAAoB;KACxD,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,SAAS,kBACR,SAAS,EAAE,OAAO,EAClB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,IACV,SAAS,EACT,cAAc,eAEjB,QAAQ,EACR,CAAC,IAAI,KAAK,UAAU,IAAI,IAAI,KAAK,oBAAoB,CAAC,IAAI,CACzD,KAAC,uBAAuB,IAAC,SAAS,EAAC,wBAAwB,GAAG,CAC/D,EACA,IAAI,KAAK,eAAe,IAAI,CAC3B,KAAC,uBAAuB,IAAC,SAAS,EAAC,wBAAwB,GAAG,CAC/D,KACS,CACb,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport classNames from 'classnames';\nimport type React from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ArrowUpRightIconOutline } from '../icons/generated/heroIcons/ArrowUpRightIconOutline';\nimport { ChevronRightIconOutline } from '../icons/generated/heroIcons/ChevronRightIconOutline';\n\n/** @deprecated Use `type=\"internal\"` instead. */\ntype InternalUnderlineTextLinkType = 'internal-underline';\n\n/** @deprecated Use `type=\"external\"` instead. */\ntype ExternalUnderlineTextLinkType = 'external-underline';\n\n/** @deprecated Use `type=\"internal\"` instead and append with a chevron icon. */\ntype InternalIconTextLinkType = 'internal-icon';\n\ntype TextLinkType =\n | 'internal'\n | InternalUnderlineTextLinkType\n | InternalIconTextLinkType\n | 'external'\n | ExternalUnderlineTextLinkType;\n\ntype TextLinkProps = {\n /** The content displayed inside the link */\n children: React.ReactNode;\n\n /** The URL the link points to */\n href?: string;\n\n /**\n * The type of the text link\n * All types render with an underline and primary text color by default. Additional color styling can be applied via `className`.\n * - 'internal': A link to another page within the application\n * - 'internal-underline': Deprecated alias of 'internal'\n * - 'internal-icon': Deprecated variant with a trailing chevron icon\n * - 'external': A link to an external website. An external link icon is appended.\n * - 'external-underline': Deprecated alias of 'external'\n * @default 'internal'\n */\n type?: TextLinkType;\n\n /** Specifies where to open the linked document. If omitted and `type` is `\"external\"` it defaults to `\"_blank\"`. */\n target?: HTMLAnchorElement['target'];\n\n /** Additional class name */\n className?: string;\n};\n\nexport const TextLink = <T extends React.ElementType = 'a'>({\n children,\n href,\n type = 'internal',\n as,\n className,\n target = type === 'external' || type === 'external-underline' ? '_blank' : '',\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, TextLinkProps>) => {\n const Component: React.ElementType = as ?? 'a';\n\n const classes = classNames('ndl-text-link', className, {\n 'ndl-external-link': type === 'external',\n 'ndl-external-underline': type === 'external-underline',\n 'ndl-internal-icon': type === 'internal-icon',\n 'ndl-internal-underline': type === 'internal-underline',\n });\n\n return (\n <Component\n className={classes}\n href={href}\n ref={ref}\n style={style}\n target={target}\n {...restProps}\n {...htmlAttributes}\n >\n {children}\n {(type === 'external' || type === 'external-underline') && (\n <ArrowUpRightIconOutline className=\"ndl-external-link-icon\" />\n )}\n {type === 'internal-icon' && (\n <ChevronRightIconOutline className=\"ndl-external-link-icon\" />\n )}\n </Component>\n );\n};\n"]}
@@ -36,7 +36,8 @@ import classNames from 'classnames';
36
36
  import { useCallback, useEffect, useId, useImperativeHandle, useMemo, useRef, useState, } from 'react';
37
37
  import { ConditionalWrap } from '../conditional-wrap';
38
38
  import { useIsInsideDialog } from '../dialog/dialog-context';
39
- import { ClockIconOutline, ExclamationCircleIconSolid } from '../icons';
39
+ import { ClockIconOutline } from '../icons/generated/heroIcons/ClockIconOutline';
40
+ import { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';
40
41
  import { useNeedleTheme } from '../theme';
41
42
  import { Typography } from '../typography';
42
43
  import { generateTimeOptions } from './generate-time-options';
@@ -1 +1 @@
1
- {"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../src/time-picker/TimePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,UAAU,EACV,IAAI,EACJ,oBAAoB,EACpB,cAAc,EACd,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EACL,WAAW,EACX,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EACL,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,qBAAqB,CAAC;AAI7B,6EAA6E;AAC7E,MAAM,qBAAqB,GAA+B;IACxD,OAAO,EAAE,MAAM;IACf,UAAU,EAAE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E,EACnC,8BAA8B,CAC/B,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;oCACf,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;wCACtB,CAAC,CAAC,eAAe,EAAE,CAAC;wCACpB,aAAa,CAAC,IAAI,CAAC,CAAC;oCACtB,CAAC;gCACH,CAAC,YAEA,IAAI,IA7BA,CAAC,CA8BH,CACN,CAAC,GACC,IACD,GACe,GACP,CACnB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n shift,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { ClockIconOutline, ExclamationCircleIconSolid } from '../icons';\nimport { useNeedleTheme } from '../theme';\nimport { Typography } from '../typography';\nimport { generateTimeOptions } from './generate-time-options';\nimport { NeedleTime } from './needle-time';\nimport {\n useKeyboardNavigation,\n useTimePickerPopover,\n} from './time-picker-hooks';\n\nexport type TimeFormat = 'hh:mm' | 'hh:mm aa' | 'hh:mm:ss' | 'hh:mm:ss aa';\n\n/** Fixed input width per format (only used when the picker is not fluid). */\nconst INPUT_WIDTH_BY_FORMAT: Record<TimeFormat, string> = {\n 'hh:mm': '6rem',\n 'hh:mm aa': '9rem',\n 'hh:mm:ss': '7.5rem',\n 'hh:mm:ss aa': '11rem',\n};\n\nexport type TimePickerProps = {\n /** The value of the time picker */\n value?: NeedleTime;\n /** The format of the time picker */\n format?: TimeFormat;\n /** Whether the time picker is fluid */\n isFluid?: boolean;\n /** Whether the time picker is read only */\n isReadOnly?: boolean;\n /** Whether the time picker is required */\n isRequired?: boolean;\n /** Whether the time picker is disabled */\n isDisabled?: boolean;\n /** The time interval of the time picker, in minutes */\n timeInterval?: number;\n /** The label of the time picker */\n label?: string;\n /** The size of the time picker */\n size?: 'small' | 'medium' | 'large';\n /** Manually set the error text */\n errorText?: string;\n /** Callback function triggered when the time picker value changes */\n onChange?: (time: NeedleTime) => void;\n /** Callback function triggered when the time picker encounters an error */\n onError?: (error: string, time: NeedleTime) => void;\n /**\n * Strategy for the dropdown floating element.\n * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n * If this prop is set, no auto-detection of Dialog is done.\n */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Whether the dropdown element is rendered in a portal. */\n isPortaled?: boolean;\n};\n\nexport const TimePicker = <T extends React.ElementType = 'div'>({\n format = 'hh:mm',\n isDisabled,\n isFluid,\n isReadOnly,\n isRequired,\n value,\n timeInterval = 15,\n label,\n onChange,\n className,\n onError,\n style,\n size = 'medium',\n errorText,\n htmlAttributes,\n floatingStrategy,\n isPortaled: isPortaledProp,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, TimePickerProps>) => {\n const [editedInput, setEditedInput] = useState<NeedleTime | undefined>(value);\n\n const is24Hour = !format.includes('aa');\n const hasSeconds = format.includes('ss');\n const [inputValue, setInputValue] = useState<string>(\n value?.toString(is24Hour, hasSeconds) ?? '',\n );\n const listRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n const [lastAction, setLastAction] = useState<'type' | 'arrow'>('type');\n const [error, setError] = useState<string | undefined>(undefined);\n const errorTextId = useId();\n const listboxId = useId();\n\n const timeOptions = useMemo(\n () => generateTimeOptions(is24Hour, timeInterval, hasSeconds),\n [is24Hour, timeInterval, hasSeconds],\n );\n\n const { themeClassName } = useNeedleTheme();\n const { isPopoverOpen, setIsPopoverOpen } = useTimePickerPopover(false);\n const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n useKeyboardNavigation(listRef, timeOptions.length);\n\n const errorToShow =\n errorText !== undefined && errorText !== '' ? errorText : error;\n\n const classes = {\n 'ndl-disabled': isDisabled,\n 'ndl-error': errorToShow !== undefined,\n 'ndl-fluid': isFluid,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n };\n\n const inputWidth = isFluid === true ? '100%' : INPUT_WIDTH_BY_FORMAT[format];\n\n const isValidTime = useCallback(\n (hours: number, minutes: number, seconds: number) => {\n if (hours > 23 || hours < 0) {\n return false;\n }\n\n if (minutes > 59 || minutes < 0) {\n return false;\n }\n\n if (seconds > 59 || seconds < 0) {\n return false;\n }\n\n return true;\n },\n [],\n );\n\n useEffect(() => {\n if (error !== undefined) {\n onError?.(error, NeedleTime.fromString(inputValue));\n }\n }, [error, inputValue, onError]);\n\n useEffect(() => {\n setEditedInput(value);\n setInputValue(value?.toString(is24Hour, hasSeconds) ?? '');\n }, [is24Hour, hasSeconds, value]);\n\n useEffect(() => {\n if (isPopoverOpen) {\n setTimeout(() => {\n listRef.current?.children[focusedIndex]?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n }, 0);\n } else {\n setTimeout(() => {\n const selectedIndex =\n timeOptions.indexOf(value?.toString(is24Hour, hasSeconds) ?? '') ?? 0;\n setFocusedIndex(selectedIndex);\n }, 0);\n }\n }, [\n focusedIndex,\n is24Hour,\n hasSeconds,\n isPopoverOpen,\n value,\n setFocusedIndex,\n timeOptions,\n ]);\n\n const handleOnClick = (timeText: string) => {\n if (onChange) {\n onChange(NeedleTime.fromString(timeText));\n }\n setError(undefined);\n setInputValue(timeText);\n setEditedInput(NeedleTime.fromString(timeText));\n setIsPopoverOpen(false);\n };\n const newHandleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n scrollToTime(e.target.value);\n setInputValue(e.target.value);\n setLastAction('type');\n\n const time = NeedleTime.fromString(e.target.value);\n if (!isValidTime(time.hour, time.minute, time.second)) {\n setError('Invalid time');\n } else {\n setError(undefined);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (isReadOnly === true || isDisabled === true) {\n e.preventDefault();\n return;\n }\n\n if (e.key === 'Escape') {\n setIsPopoverOpen(false);\n }\n\n setIsPopoverOpen(true);\n\n if (e.key === 'Enter') {\n const minTypedLength = (is24Hour ? 5 : 6) + (hasSeconds ? 3 : 0);\n if (lastAction === 'type' && inputValue.length >= minTypedLength) {\n const time = NeedleTime.fromString(inputValue);\n handleOnClick(time.toString(is24Hour, hasSeconds));\n } else if (lastAction === 'type' && !inputValue.includes(':')) {\n const time = NeedleTime.fromString(inputValue);\n if (isValidTime(time.hour, time.minute, time.second)) {\n handleOnClick(time.toString(is24Hour, hasSeconds));\n }\n setIsPopoverOpen(false);\n } else {\n handleOnClick(timeOptions[focusedIndex]);\n }\n } else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n setLastAction('arrow');\n handleArrowNavigation(e.key);\n }\n };\n\n const scrollToTime = (startOfTime: string) => {\n const parsedTime = startOfTime.toLowerCase().replace(/[^0-9amp]/g, '');\n let index = -1;\n\n // Handle AM/PM input\n const isPM = parsedTime.includes('p');\n const isAM = parsedTime.includes('a');\n const timeDigits = parsedTime.replace(/[amp]/g, '');\n\n if (timeDigits.length === 1) {\n // Single digit - assume it's an hour\n const hour = `0${timeDigits}`;\n const minutes = hasSeconds ? '00:00' : '00';\n const searchTime = is24Hour\n ? `${hour}:${minutes}`\n : `${hour}:${minutes} ${isPM ? 'PM' : 'AM'}`;\n index = timeOptions.indexOf(searchTime);\n } else {\n // Find closest matching time\n const closestTime = timeOptions.find((time) => {\n const timeWithoutSpecialChars = time\n .toLowerCase()\n .replace(/[^0-9amp]/g, '');\n if (isPM || isAM) {\n // If AM/PM specified, match that specifically\n return timeWithoutSpecialChars.startsWith(parsedTime);\n } else {\n // Otherwise just match the numbers\n return timeWithoutSpecialChars\n .replace(/[amp]/g, '')\n .startsWith(timeDigits);\n }\n });\n index = closestTime !== undefined ? timeOptions.indexOf(closestTime) : -1;\n }\n\n if (index !== -1) {\n setFocusedIndex(index);\n }\n\n return index;\n };\n\n /** Custom floating ui solution */\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n const containerRef = useRef<HTMLDivElement>(null);\n const { refs, floatingStyles, context } = useFloating({\n elements: {\n reference: containerRef.current,\n },\n middleware: [\n offset(10),\n flip({\n fallbackPlacements: ['top'],\n fallbackStrategy: 'bestFit',\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open) => {\n setIsPopoverOpen(open);\n },\n open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n placement: 'bottom',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n return (\n <>\n <div\n className={classNames('ndl-time-picker', className, {\n ...classes,\n })}\n ref={mergedRef}\n {...getReferenceProps()}\n style={{\n width: isFluid === true ? '100%' : 'fit-content',\n }}\n >\n <label className=\"ndl-time-picker-label\">\n {label !== undefined && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n >\n {label}\n </Typography>\n )}\n <div\n className=\"ndl-time-picker-input-wrapper\"\n style={{\n width: inputWidth,\n ...style,\n }}\n >\n <input\n role=\"combobox\"\n aria-expanded={isPopoverOpen}\n aria-controls={listboxId}\n aria-activedescendant={\n isPopoverOpen && focusedIndex >= 0\n ? `${listboxId}-option-${focusedIndex}`\n : undefined\n }\n aria-label={label} // TODO: handle label natively\n aria-invalid={Boolean(errorToShow)}\n aria-describedby={errorToShow ? errorTextId : undefined}\n className=\"ndl-time-picker-input\"\n type=\"text\"\n ref={inputRef}\n value={inputValue}\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n onChange={newHandleInputChange}\n onKeyDown={handleKeyDown}\n onClick={() => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n setIsPopoverOpen(true);\n }}\n onBlur={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n\n if (\n e.relatedTarget?.classList.contains(\n 'ndl-time-picker-popover-item',\n ) === true\n ) {\n return;\n }\n\n if (inputValue.length < 4) {\n setError('Invalid time');\n return;\n }\n\n const time = NeedleTime.fromString(inputValue);\n\n if (time === undefined || time === null) {\n setError('Invalid time');\n return;\n }\n\n if (!isValidTime(time.hour, time.minute, time.second)) {\n setError('Invalid time');\n } else {\n setError(undefined);\n setInputValue(time.toString(is24Hour, hasSeconds));\n setEditedInput(time);\n onChange?.(time);\n }\n }}\n placeholder={format}\n // The typed value can never be longer than the format pattern.\n maxLength={format.length}\n {...restProps}\n {...htmlAttributes}\n />\n <ClockIconOutline className=\"ndl-icon-svg ndl-time-picker-icon\" />\n </div>\n </label>\n {errorToShow !== undefined && (\n <div className=\"ndl-time-picker-error-wrapper\" role=\"status\">\n <ExclamationCircleIconSolid className=\"ndl-time-picker-error-icon\" />\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-time-picker-error-text\"\n htmlAttributes={{ id: errorTextId }}\n >\n {errorToShow}\n </Typography>\n </div>\n )}\n </div>\n\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n >\n <div\n ref={refs.setFloating}\n className={classNames(themeClassName, 'ndl-time-picker-popover', {\n ...classes,\n })}\n style={{\n ...transitionStyles,\n ...floatingStyles,\n width:\n isFluid === true\n ? containerRef.current?.clientWidth\n : undefined,\n }}\n {...getFloatingProps()}\n >\n <ul ref={listRef} role=\"listbox\" id={listboxId} tabIndex={-1}>\n {timeOptions.map((time, i) => (\n <li\n id={`${listboxId}-option-${i}`}\n key={i}\n role=\"option\"\n aria-selected={\n value?.toString(is24Hour, hasSeconds) === time ||\n editedInput?.toString(is24Hour, hasSeconds) === time\n }\n value={time}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(time);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === i ? 'focused' : '',\n 'ndl-time-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(time);\n }\n }}\n >\n {time}\n </li>\n ))}\n </ul>\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../../src/time-picker/TimePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,UAAU,EACV,IAAI,EACJ,oBAAoB,EACpB,cAAc,EACd,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,mBA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,EAAE,CAAC,EAAE,EAAE,CAAC,CAC5B,aACE,EAAE,EAAE,GAAG,SAAS,WAAW,CAAC,EAAE,EAE9B,IAAI,EAAC,QAAQ,mBAEX,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAK,IAAI;oCAC9C,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,MAAK,IAAI,EAEtD,KAAK,EAAE,IAAI,EACX,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;oCACb,CAAC,CAAC,eAAe,EAAE,CAAC;oCACpB,CAAC,CAAC,cAAc,EAAE,CAAC;oCACnB,aAAa,CAAC,IAAI,CAAC,CAAC;oCACpB,gBAAgB,CAAC,KAAK,CAAC,CAAC;gCAC1B,CAAC,EACD,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;oCACjB,CAAC,CAAC,eAAe,EAAE,CAAC;oCACpB,CAAC,CAAC,cAAc,EAAE,CAAC;gCACrB,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,UAAU,CACnB,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EACnC,8BAA8B,CAC/B,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;oCACf,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;wCACtB,CAAC,CAAC,eAAe,EAAE,CAAC;wCACpB,aAAa,CAAC,IAAI,CAAC,CAAC;oCACtB,CAAC;gCACH,CAAC,YAEA,IAAI,IA7BA,CAAC,CA8BH,CACN,CAAC,GACC,IACD,GACe,GACP,CACnB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n shift,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type PolymorphicCommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { ClockIconOutline } from '../icons/generated/heroIcons/ClockIconOutline';\nimport { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';\nimport { useNeedleTheme } from '../theme';\nimport { Typography } from '../typography';\nimport { generateTimeOptions } from './generate-time-options';\nimport { NeedleTime } from './needle-time';\nimport {\n useKeyboardNavigation,\n useTimePickerPopover,\n} from './time-picker-hooks';\n\nexport type TimeFormat = 'hh:mm' | 'hh:mm aa' | 'hh:mm:ss' | 'hh:mm:ss aa';\n\n/** Fixed input width per format (only used when the picker is not fluid). */\nconst INPUT_WIDTH_BY_FORMAT: Record<TimeFormat, string> = {\n 'hh:mm': '6rem',\n 'hh:mm aa': '9rem',\n 'hh:mm:ss': '7.5rem',\n 'hh:mm:ss aa': '11rem',\n};\n\nexport type TimePickerProps = {\n /** The value of the time picker */\n value?: NeedleTime;\n /** The format of the time picker */\n format?: TimeFormat;\n /** Whether the time picker is fluid */\n isFluid?: boolean;\n /** Whether the time picker is read only */\n isReadOnly?: boolean;\n /** Whether the time picker is required */\n isRequired?: boolean;\n /** Whether the time picker is disabled */\n isDisabled?: boolean;\n /** The time interval of the time picker, in minutes */\n timeInterval?: number;\n /** The label of the time picker */\n label?: string;\n /** The size of the time picker */\n size?: 'small' | 'medium' | 'large';\n /** Manually set the error text */\n errorText?: string;\n /** Callback function triggered when the time picker value changes */\n onChange?: (time: NeedleTime) => void;\n /** Callback function triggered when the time picker encounters an error */\n onError?: (error: string, time: NeedleTime) => void;\n /**\n * Strategy for the dropdown floating element.\n * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n * If this prop is set, no auto-detection of Dialog is done.\n */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Whether the dropdown element is rendered in a portal. */\n isPortaled?: boolean;\n};\n\nexport const TimePicker = <T extends React.ElementType = 'div'>({\n format = 'hh:mm',\n isDisabled,\n isFluid,\n isReadOnly,\n isRequired,\n value,\n timeInterval = 15,\n label,\n onChange,\n className,\n onError,\n style,\n size = 'medium',\n errorText,\n htmlAttributes,\n floatingStrategy,\n isPortaled: isPortaledProp,\n ref,\n ...restProps\n}: PolymorphicCommonProps<T, TimePickerProps>) => {\n const [editedInput, setEditedInput] = useState<NeedleTime | undefined>(value);\n\n const is24Hour = !format.includes('aa');\n const hasSeconds = format.includes('ss');\n const [inputValue, setInputValue] = useState<string>(\n value?.toString(is24Hour, hasSeconds) ?? '',\n );\n const listRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n const [lastAction, setLastAction] = useState<'type' | 'arrow'>('type');\n const [error, setError] = useState<string | undefined>(undefined);\n const errorTextId = useId();\n const listboxId = useId();\n\n const timeOptions = useMemo(\n () => generateTimeOptions(is24Hour, timeInterval, hasSeconds),\n [is24Hour, timeInterval, hasSeconds],\n );\n\n const { themeClassName } = useNeedleTheme();\n const { isPopoverOpen, setIsPopoverOpen } = useTimePickerPopover(false);\n const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n useKeyboardNavigation(listRef, timeOptions.length);\n\n const errorToShow =\n errorText !== undefined && errorText !== '' ? errorText : error;\n\n const classes = {\n 'ndl-disabled': isDisabled,\n 'ndl-error': errorToShow !== undefined,\n 'ndl-fluid': isFluid,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n };\n\n const inputWidth = isFluid === true ? '100%' : INPUT_WIDTH_BY_FORMAT[format];\n\n const isValidTime = useCallback(\n (hours: number, minutes: number, seconds: number) => {\n if (hours > 23 || hours < 0) {\n return false;\n }\n\n if (minutes > 59 || minutes < 0) {\n return false;\n }\n\n if (seconds > 59 || seconds < 0) {\n return false;\n }\n\n return true;\n },\n [],\n );\n\n useEffect(() => {\n if (error !== undefined) {\n onError?.(error, NeedleTime.fromString(inputValue));\n }\n }, [error, inputValue, onError]);\n\n useEffect(() => {\n setEditedInput(value);\n setInputValue(value?.toString(is24Hour, hasSeconds) ?? '');\n }, [is24Hour, hasSeconds, value]);\n\n useEffect(() => {\n if (isPopoverOpen) {\n setTimeout(() => {\n listRef.current?.children[focusedIndex]?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n }, 0);\n } else {\n setTimeout(() => {\n const selectedIndex =\n timeOptions.indexOf(value?.toString(is24Hour, hasSeconds) ?? '') ?? 0;\n setFocusedIndex(selectedIndex);\n }, 0);\n }\n }, [\n focusedIndex,\n is24Hour,\n hasSeconds,\n isPopoverOpen,\n value,\n setFocusedIndex,\n timeOptions,\n ]);\n\n const handleOnClick = (timeText: string) => {\n if (onChange) {\n onChange(NeedleTime.fromString(timeText));\n }\n setError(undefined);\n setInputValue(timeText);\n setEditedInput(NeedleTime.fromString(timeText));\n setIsPopoverOpen(false);\n };\n const newHandleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n scrollToTime(e.target.value);\n setInputValue(e.target.value);\n setLastAction('type');\n\n const time = NeedleTime.fromString(e.target.value);\n if (!isValidTime(time.hour, time.minute, time.second)) {\n setError('Invalid time');\n } else {\n setError(undefined);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (isReadOnly === true || isDisabled === true) {\n e.preventDefault();\n return;\n }\n\n if (e.key === 'Escape') {\n setIsPopoverOpen(false);\n }\n\n setIsPopoverOpen(true);\n\n if (e.key === 'Enter') {\n const minTypedLength = (is24Hour ? 5 : 6) + (hasSeconds ? 3 : 0);\n if (lastAction === 'type' && inputValue.length >= minTypedLength) {\n const time = NeedleTime.fromString(inputValue);\n handleOnClick(time.toString(is24Hour, hasSeconds));\n } else if (lastAction === 'type' && !inputValue.includes(':')) {\n const time = NeedleTime.fromString(inputValue);\n if (isValidTime(time.hour, time.minute, time.second)) {\n handleOnClick(time.toString(is24Hour, hasSeconds));\n }\n setIsPopoverOpen(false);\n } else {\n handleOnClick(timeOptions[focusedIndex]);\n }\n } else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n setLastAction('arrow');\n handleArrowNavigation(e.key);\n }\n };\n\n const scrollToTime = (startOfTime: string) => {\n const parsedTime = startOfTime.toLowerCase().replace(/[^0-9amp]/g, '');\n let index = -1;\n\n // Handle AM/PM input\n const isPM = parsedTime.includes('p');\n const isAM = parsedTime.includes('a');\n const timeDigits = parsedTime.replace(/[amp]/g, '');\n\n if (timeDigits.length === 1) {\n // Single digit - assume it's an hour\n const hour = `0${timeDigits}`;\n const minutes = hasSeconds ? '00:00' : '00';\n const searchTime = is24Hour\n ? `${hour}:${minutes}`\n : `${hour}:${minutes} ${isPM ? 'PM' : 'AM'}`;\n index = timeOptions.indexOf(searchTime);\n } else {\n // Find closest matching time\n const closestTime = timeOptions.find((time) => {\n const timeWithoutSpecialChars = time\n .toLowerCase()\n .replace(/[^0-9amp]/g, '');\n if (isPM || isAM) {\n // If AM/PM specified, match that specifically\n return timeWithoutSpecialChars.startsWith(parsedTime);\n } else {\n // Otherwise just match the numbers\n return timeWithoutSpecialChars\n .replace(/[amp]/g, '')\n .startsWith(timeDigits);\n }\n });\n index = closestTime !== undefined ? timeOptions.indexOf(closestTime) : -1;\n }\n\n if (index !== -1) {\n setFocusedIndex(index);\n }\n\n return index;\n };\n\n /** Custom floating ui solution */\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n const containerRef = useRef<HTMLDivElement>(null);\n const { refs, floatingStyles, context } = useFloating({\n elements: {\n reference: containerRef.current,\n },\n middleware: [\n offset(10),\n flip({\n fallbackPlacements: ['top'],\n fallbackStrategy: 'bestFit',\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open) => {\n setIsPopoverOpen(open);\n },\n open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n placement: 'bottom',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n return (\n <>\n <div\n className={classNames('ndl-time-picker', className, {\n ...classes,\n })}\n ref={mergedRef}\n {...getReferenceProps()}\n style={{\n width: isFluid === true ? '100%' : 'fit-content',\n }}\n >\n <label className=\"ndl-time-picker-label\">\n {label !== undefined && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n >\n {label}\n </Typography>\n )}\n <div\n className=\"ndl-time-picker-input-wrapper\"\n style={{\n width: inputWidth,\n ...style,\n }}\n >\n <input\n role=\"combobox\"\n aria-expanded={isPopoverOpen}\n aria-controls={listboxId}\n aria-activedescendant={\n isPopoverOpen && focusedIndex >= 0\n ? `${listboxId}-option-${focusedIndex}`\n : undefined\n }\n aria-label={label} // TODO: handle label natively\n aria-invalid={Boolean(errorToShow)}\n aria-describedby={errorToShow ? errorTextId : undefined}\n className=\"ndl-time-picker-input\"\n type=\"text\"\n ref={inputRef}\n value={inputValue}\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n onChange={newHandleInputChange}\n onKeyDown={handleKeyDown}\n onClick={() => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n setIsPopoverOpen(true);\n }}\n onBlur={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n\n if (\n e.relatedTarget?.classList.contains(\n 'ndl-time-picker-popover-item',\n ) === true\n ) {\n return;\n }\n\n if (inputValue.length < 4) {\n setError('Invalid time');\n return;\n }\n\n const time = NeedleTime.fromString(inputValue);\n\n if (time === undefined || time === null) {\n setError('Invalid time');\n return;\n }\n\n if (!isValidTime(time.hour, time.minute, time.second)) {\n setError('Invalid time');\n } else {\n setError(undefined);\n setInputValue(time.toString(is24Hour, hasSeconds));\n setEditedInput(time);\n onChange?.(time);\n }\n }}\n placeholder={format}\n // The typed value can never be longer than the format pattern.\n maxLength={format.length}\n {...restProps}\n {...htmlAttributes}\n />\n <ClockIconOutline className=\"ndl-icon-svg ndl-time-picker-icon\" />\n </div>\n </label>\n {errorToShow !== undefined && (\n <div className=\"ndl-time-picker-error-wrapper\" role=\"status\">\n <ExclamationCircleIconSolid className=\"ndl-time-picker-error-icon\" />\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-time-picker-error-text\"\n htmlAttributes={{ id: errorTextId }}\n >\n {errorToShow}\n </Typography>\n </div>\n )}\n </div>\n\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n >\n <div\n ref={refs.setFloating}\n className={classNames(themeClassName, 'ndl-time-picker-popover', {\n ...classes,\n })}\n style={{\n ...transitionStyles,\n ...floatingStyles,\n width:\n isFluid === true\n ? containerRef.current?.clientWidth\n : undefined,\n }}\n {...getFloatingProps()}\n >\n <ul ref={listRef} role=\"listbox\" id={listboxId} tabIndex={-1}>\n {timeOptions.map((time, i) => (\n <li\n id={`${listboxId}-option-${i}`}\n key={i}\n role=\"option\"\n aria-selected={\n value?.toString(is24Hour, hasSeconds) === time ||\n editedInput?.toString(is24Hour, hasSeconds) === time\n }\n value={time}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(time);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === i ? 'focused' : '',\n 'ndl-time-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(time);\n }\n }}\n >\n {time}\n </li>\n ))}\n </ul>\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </>\n );\n};\n"]}
@@ -37,7 +37,7 @@ import classNames from 'classnames';
37
37
  import { useEffect, useId, useImperativeHandle, useMemo, useRef, useState, } from 'react';
38
38
  import { ConditionalWrap } from '../conditional-wrap';
39
39
  import { useIsInsideDialog } from '../dialog/dialog-context';
40
- import { ExclamationCircleIconSolid } from '../icons';
40
+ import { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';
41
41
  import { useNeedleTheme } from '../theme';
42
42
  import { Typography } from '../typography';
43
43
  import { formatTimeZone, generateTimeZoneOptions, generateUTCTimeZoneOptions, isValidUTCFormat, parseCustomUTCOffset, } from './generate-timezone-options';
@@ -1 +1 @@
1
- {"version":3,"file":"TimeZonePicker.js","sourceRoot":"","sources":["../../../src/timezone-picker/TimeZonePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,UAAU,EACV,IAAI,EACJ,oBAAoB,EACpB,cAAc,EACd,MAAM,EACN,KAAK,EACL,UAAU,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ACpB,CAAC,CAAC,cAAc,EAAE,CAAC;wCACnB,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wCAC5B,gBAAgB,CAAC,KAAK,CAAC,CAAC;oCAC1B,CAAC,EACD,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE;wCACjB,CAAC,CAAC,eAAe,EAAE,CAAC;wCACpB,CAAC,CAAC,cAAc,EAAE,CAAC;oCACrB,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EACZ,SAAS,EAAE,UAAU,CACnB,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EACnC,kCAAkC,CACnC,EACD,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;wCACf,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;4CACtB,CAAC,CAAC,eAAe,EAAE,CAAC;4CACpB,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wCAC9B,CAAC;oCACH,CAAC,YAEA,MAAM,CAAC,KAAK,IA1BR,MAAM,CAAC,KAAK,CA2Bd,CACN,CAAC,CACH,CAAC,CAAC,CAAC,CACF,aAAI,SAAS,EAAC,iEAAiE,mCAE1E,CACN,GACA,CACJ,GACE,IACD,GACe,GACP,CACnB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n shift,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { ChevronDownIcon } from '@heroicons/react/24/outline';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { ExclamationCircleIconSolid } from '../icons';\nimport { useNeedleTheme } from '../theme';\nimport { Typography } from '../typography';\nimport {\n formatTimeZone,\n generateTimeZoneOptions,\n generateUTCTimeZoneOptions,\n isValidUTCFormat,\n parseCustomUTCOffset,\n} from './generate-timezone-options';\nimport {\n useKeyboardNavigation,\n useTimeZonePickerPopover,\n} from './timezone-picker-hooks';\n\nexport type TimeZonePickerProps = {\n /** The value of the timezone picker (IANA timezone identifier) */\n value?: string;\n /** Whether the timezone picker is fluid */\n isFluid?: boolean;\n /** Whether the timezone picker is read only */\n isReadOnly?: boolean;\n /** Whether the timezone picker is required */\n isRequired?: boolean;\n /** Whether the timezone picker is disabled */\n isDisabled?: boolean;\n /** The label of the timezone picker */\n label?: string;\n /** The size of the timezone picker */\n size?: 'small' | 'medium' | 'large';\n /** Manually set the error text */\n errorText?: string;\n /** Callback function triggered when the timezone picker value changes */\n onChange?: (timezone: string) => void;\n /** Callback function triggered when the timezone picker encounters an error */\n onError?: (error: string, timezone: string) => void;\n /**\n * Strategy for the dropdown floating element.\n * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n * If this prop is set, no auto-detection of Dialog is done.\n */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Whether the dropdown element is rendered in a portal. */\n isPortaled?: boolean;\n /** Reference date for calculating timezone offsets (useful for DST-aware offset display) */\n referenceDate?: Date;\n /**\n * Display mode: 'city', 'utc', or 'both'\n * 'city' - shows city-based timezones, This should be used when the user needs to select a timezone for themselves or if they are selecting a timezone that's related to a date.\n * 'utc' - shows UTC timezones, This should be used when the user needs to select a timezone for a database entry or a technical application.\n * 'both' - shows both city-based and UTC timezones in separate sections, This should be used when the user needs to select a timezone for a database entry or a technical application, but also wants to see the city-based timezones for context for example a zoned date time.\n * @default 'city'\n * @example\n * <TimeZonePicker mode=\"city\" />\n * <TimeZonePicker mode=\"utc\" />\n * <TimeZonePicker mode=\"both\" />\n */\n mode?: 'city' | 'utc' | 'both';\n};\n\nexport const TimeZonePicker = ({\n isDisabled,\n isFluid,\n isReadOnly,\n isRequired,\n value,\n label,\n onChange,\n className,\n onError,\n style,\n size = 'medium',\n errorText,\n htmlAttributes,\n floatingStrategy,\n isPortaled: isPortaledProp,\n referenceDate,\n mode = 'city',\n ref,\n ...restProps\n}: CommonProps<'input', TimeZonePickerProps>) => {\n const [inputValue, setInputValue] = useState<string>(\n value\n ? formatTimeZone(value, referenceDate)\n : formatTimeZone(\n new Date().toISOString().split('T')[1].split('.')[0],\n referenceDate,\n ),\n );\n const [searchQuery, setSearchQuery] = useState<string>('');\n const listRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n const [error, setError] = useState<string | undefined>(undefined);\n const errorTextId = useId();\n const listboxId = useId();\n\n const timezoneOptions = useMemo(() => {\n if (mode === 'utc') {\n return generateUTCTimeZoneOptions(referenceDate);\n } else if (mode === 'city') {\n return generateTimeZoneOptions(referenceDate);\n } else {\n // 'both' mode - combine both lists, excluding UTC from city list to avoid duplication\n return [\n ...generateUTCTimeZoneOptions(referenceDate),\n ...generateTimeZoneOptions(referenceDate, true), // excludeUTC = true\n ];\n }\n }, [referenceDate, mode]);\n\n const { themeClassName } = useNeedleTheme();\n const { isPopoverOpen, setIsPopoverOpen } = useTimeZonePickerPopover(false);\n\n // Filter options based on search query\n const filteredOptions = useMemo(() => {\n if (!searchQuery) {\n return timezoneOptions;\n }\n\n const query = searchQuery.toLowerCase();\n return timezoneOptions.filter(\n (option) =>\n option.label.toLowerCase().includes(query) ||\n option.value.toLowerCase().includes(query),\n );\n }, [timezoneOptions, searchQuery]);\n\n // Split options into UTC and city-based sections for 'both' mode\n const { utcOptions, cityOptions } = useMemo(() => {\n if (mode !== 'both') {\n return { cityOptions: filteredOptions, utcOptions: [] };\n }\n\n const utc: typeof filteredOptions = [];\n const city: typeof filteredOptions = [];\n\n filteredOptions.forEach((option) => {\n // UTC options are those that start with \"UTC\" in their value or label\n if (\n option.value.toUpperCase().startsWith('UTC') ||\n option.label.toUpperCase().startsWith('UTC')\n ) {\n utc.push(option);\n } else {\n city.push(option);\n }\n });\n\n return { cityOptions: city, utcOptions: utc };\n }, [filteredOptions, mode]);\n\n const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n useKeyboardNavigation(filteredOptions.length);\n\n const errorToShow =\n errorText !== undefined && errorText !== '' ? errorText : error;\n\n const classes = {\n 'ndl-disabled': isDisabled,\n 'ndl-error': errorToShow !== undefined,\n 'ndl-fluid': isFluid,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n };\n\n const inputWidth = isFluid === true ? '100%' : '16rem';\n\n useEffect(() => {\n if (error !== undefined) {\n onError?.(error, inputValue);\n }\n }, [error, inputValue, onError]);\n\n useEffect(() => {\n setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n }, [value, referenceDate]);\n\n useEffect(() => {\n if (isPopoverOpen) {\n setTimeout(() => {\n listRef.current?.children[focusedIndex]?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n }, 0);\n } else {\n setTimeout(() => {\n inputRef.current?.blur();\n const selectedIndex =\n filteredOptions.findIndex((opt) => opt.value === value) ?? 0;\n setFocusedIndex(selectedIndex >= 0 ? selectedIndex : 0);\n setSearchQuery('');\n }, 0);\n }\n }, [focusedIndex, isPopoverOpen, value, setFocusedIndex, filteredOptions]);\n\n const handleOnClick = (timezone: string) => {\n if (onChange) {\n onChange(timezone);\n }\n setError(undefined);\n setInputValue(formatTimeZone(timezone, referenceDate));\n setIsPopoverOpen(false);\n setSearchQuery('');\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const query = e.target.value;\n setSearchQuery(query);\n setInputValue(query);\n\n // In UTC mode (utc or both), validate custom UTC input\n if (\n (mode === 'utc' || mode === 'both') &&\n query.trim().toUpperCase().startsWith('UTC')\n ) {\n if (isValidUTCFormat(query.trim())) {\n setError(undefined);\n } else {\n setError('Invalid UTC format. Use UTC+H:MM or UTC-H:MM');\n }\n return;\n }\n\n // Try to find a matching timezone\n const matchingOption = timezoneOptions.find(\n (opt) =>\n opt.label.toLowerCase().includes(query.toLowerCase()) ||\n opt.value.toLowerCase().includes(query.toLowerCase()),\n );\n\n if (matchingOption) {\n setError(undefined);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (isReadOnly === true || isDisabled === true) {\n e.preventDefault();\n return;\n }\n\n if (e.key === 'Escape') {\n setIsPopoverOpen(false);\n setSearchQuery('');\n setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n }\n\n setIsPopoverOpen(true);\n\n if (e.key === 'Enter') {\n // In UTC mode (utc or both), allow custom UTC input\n if (\n (mode === 'utc' || mode === 'both') &&\n inputValue.trim().toUpperCase().startsWith('UTC')\n ) {\n const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n if (parsedOffset) {\n handleOnClick(parsedOffset);\n return;\n }\n }\n\n if (filteredOptions.length > 0) {\n const selectedOption = filteredOptions[focusedIndex];\n if (selectedOption) {\n handleOnClick(selectedOption.value);\n }\n }\n } else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n handleArrowNavigation(e.key);\n }\n };\n\n /** Custom floating ui solution */\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n const containerRef = useRef<HTMLDivElement>(null);\n const { refs, floatingStyles, context } = useFloating({\n elements: {\n reference: containerRef.current,\n },\n middleware: [\n offset(10),\n flip({\n fallbackPlacements: ['top'],\n fallbackStrategy: 'bestFit',\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open) => {\n setIsPopoverOpen(open);\n },\n open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n placement: 'bottom',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n return (\n <>\n <div\n className={classNames('ndl-timezone-picker', className, {\n ...classes,\n })}\n ref={mergedRef}\n {...getReferenceProps()}\n style={{\n width: isFluid === true ? '100%' : 'fit-content',\n }}\n >\n <label className=\"ndl-timezone-picker-label\">\n {label !== undefined && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n >\n {label}\n </Typography>\n )}\n <div\n className=\"ndl-timezone-picker-input-wrapper\"\n style={{\n width: inputWidth,\n ...style,\n }}\n >\n <input\n role=\"combobox\"\n aria-expanded={isPopoverOpen}\n aria-controls={listboxId}\n aria-activedescendant={\n isPopoverOpen && focusedIndex >= 0\n ? `${listboxId}-option-${focusedIndex}`\n : undefined\n }\n aria-label={label}\n aria-invalid={Boolean(errorToShow)}\n aria-describedby={errorToShow ? errorTextId : undefined}\n className=\"ndl-timezone-picker-input\"\n type=\"text\"\n ref={inputRef}\n value={inputValue}\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onClick={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n setIsPopoverOpen(true);\n // Select all text on click for easy searching\n e.currentTarget.select();\n }}\n onFocus={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n // Select all text on focus for easy searching\n e.currentTarget.select();\n }}\n onBlur={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n\n if (\n e.relatedTarget?.classList.contains(\n 'ndl-timezone-picker-popover-item',\n ) === true\n ) {\n return;\n }\n\n // In UTC mode (utc or both), try to parse custom input on blur\n if (\n (mode === 'utc' || mode === 'both') &&\n inputValue.trim().toUpperCase().startsWith('UTC')\n ) {\n const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n if (parsedOffset) {\n handleOnClick(parsedOffset);\n setError(undefined);\n return;\n }\n }\n\n // Reset to the current value if no valid selection was made\n if (value) {\n setInputValue(formatTimeZone(value, referenceDate));\n } else {\n setInputValue('');\n }\n setSearchQuery('');\n setError(undefined);\n }}\n placeholder={\n mode === 'city'\n ? 'Select timezone'\n : mode === 'utc'\n ? 'Select or type UTC offset (e.g., UTC+5:30)'\n : 'Select timezone or type UTC offset'\n }\n {...htmlAttributes}\n {...restProps}\n />\n <ChevronDownIcon className=\"ndl-icon-svg ndl-timezone-picker-icon\" />\n </div>\n </label>\n {errorToShow !== undefined && (\n <div className=\"ndl-timezone-picker-error-wrapper\" role=\"status\">\n <ExclamationCircleIconSolid className=\"ndl-timezone-picker-error-icon\" />\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-timezone-picker-error-text\"\n htmlAttributes={{ id: errorTextId }}\n >\n {errorToShow}\n </Typography>\n </div>\n )}\n </div>\n\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n >\n <div\n ref={refs.setFloating}\n className={classNames(\n themeClassName,\n 'ndl-timezone-picker-popover',\n {\n ...classes,\n },\n )}\n style={{\n ...transitionStyles,\n ...floatingStyles,\n width:\n isFluid === true\n ? containerRef.current?.clientWidth\n : undefined,\n }}\n {...getFloatingProps()}\n >\n <ul ref={listRef} role=\"listbox\" id={listboxId} tabIndex={-1}>\n {mode === 'both' ? (\n <>\n {utcOptions.length > 0 && (\n <>\n <li className=\"ndl-timezone-picker-section-header\">\n UTC Offsets\n </li>\n {utcOptions.map((option, i) => (\n <li\n id={`${listboxId}-option-${i}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === i ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n ))}\n </>\n )}\n {cityOptions.length > 0 && (\n <>\n <li className=\"ndl-timezone-picker-section-header\">\n City-Based Timezones\n </li>\n {cityOptions.map((option, i) => {\n const adjustedIndex = i + utcOptions.length;\n return (\n <li\n id={`${listboxId}-option-${adjustedIndex}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === adjustedIndex ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n );\n })}\n </>\n )}\n {utcOptions.length === 0 && cityOptions.length === 0 && (\n <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n No timezones found\n </li>\n )}\n </>\n ) : (\n <>\n {filteredOptions.length > 0 ? (\n filteredOptions.map((option, i) => (\n <li\n id={`${listboxId}-option-${i}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === i ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n ))\n ) : (\n <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n No timezones found\n </li>\n )}\n </>\n )}\n </ul>\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </>\n );\n};\n"]}
1
+ {"version":3,"file":"TimeZonePicker.js","sourceRoot":"","sources":["../../../src/timezone-picker/TimeZonePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EACL,UAAU,EACV,IAAI,EACJ,oBAAoB,EACpB,cAAc,EACd,MAAM,EACN,KAAK,EACL,UAAU,EACV,WAAW,EACX,eAAe,EACf,YAAY,EACZ,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,UAAU,MAAM,YAAY,CAAC;AAEpC,OAAO,EACL,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC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,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;wCACf,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;4CACtB,CAAC,CAAC,eAAe,EAAE,CAAC;4CACpB,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;wCAC9B,CAAC;oCACH,CAAC,YAEA,MAAM,CAAC,KAAK,IA1BR,MAAM,CAAC,KAAK,CA2Bd,CACN,CAAC,CACH,CAAC,CAAC,CAAC,CACF,aAAI,SAAS,EAAC,iEAAiE,mCAE1E,CACN,GACA,CACJ,GACE,IACD,GACe,GACP,CACnB,IACA,CACJ,CAAC;AACJ,CAAC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\nimport {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n shift,\n useDismiss,\n useFloating,\n useInteractions,\n useMergeRefs,\n useTransitionStyles,\n} from '@floating-ui/react';\nimport { ChevronDownIcon } from '@heroicons/react/24/outline';\nimport { tokens } from '@neo4j-ndl/base';\nimport classNames from 'classnames';\nimport type React from 'react';\nimport {\n useEffect,\n useId,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps } from '../_common/types';\nimport { ConditionalWrap } from '../conditional-wrap';\nimport { useIsInsideDialog } from '../dialog/dialog-context';\nimport { ExclamationCircleIconSolid } from '../icons/generated/heroIcons/ExclamationCircleIconSolid';\nimport { useNeedleTheme } from '../theme';\nimport { Typography } from '../typography';\nimport {\n formatTimeZone,\n generateTimeZoneOptions,\n generateUTCTimeZoneOptions,\n isValidUTCFormat,\n parseCustomUTCOffset,\n} from './generate-timezone-options';\nimport {\n useKeyboardNavigation,\n useTimeZonePickerPopover,\n} from './timezone-picker-hooks';\n\nexport type TimeZonePickerProps = {\n /** The value of the timezone picker (IANA timezone identifier) */\n value?: string;\n /** Whether the timezone picker is fluid */\n isFluid?: boolean;\n /** Whether the timezone picker is read only */\n isReadOnly?: boolean;\n /** Whether the timezone picker is required */\n isRequired?: boolean;\n /** Whether the timezone picker is disabled */\n isDisabled?: boolean;\n /** The label of the timezone picker */\n label?: string;\n /** The size of the timezone picker */\n size?: 'small' | 'medium' | 'large';\n /** Manually set the error text */\n errorText?: string;\n /** Callback function triggered when the timezone picker value changes */\n onChange?: (timezone: string) => void;\n /** Callback function triggered when the timezone picker encounters an error */\n onError?: (error: string, timezone: string) => void;\n /**\n * Strategy for the dropdown floating element.\n * By default it is absolute, but if the component is inside of a needle Dialog, it is set to fixed.\n * If this prop is set, no auto-detection of Dialog is done.\n */\n floatingStrategy?: 'absolute' | 'fixed';\n /** Whether the dropdown element is rendered in a portal. */\n isPortaled?: boolean;\n /** Reference date for calculating timezone offsets (useful for DST-aware offset display) */\n referenceDate?: Date;\n /**\n * Display mode: 'city', 'utc', or 'both'\n * 'city' - shows city-based timezones, This should be used when the user needs to select a timezone for themselves or if they are selecting a timezone that's related to a date.\n * 'utc' - shows UTC timezones, This should be used when the user needs to select a timezone for a database entry or a technical application.\n * 'both' - shows both city-based and UTC timezones in separate sections, This should be used when the user needs to select a timezone for a database entry or a technical application, but also wants to see the city-based timezones for context for example a zoned date time.\n * @default 'city'\n * @example\n * <TimeZonePicker mode=\"city\" />\n * <TimeZonePicker mode=\"utc\" />\n * <TimeZonePicker mode=\"both\" />\n */\n mode?: 'city' | 'utc' | 'both';\n};\n\nexport const TimeZonePicker = ({\n isDisabled,\n isFluid,\n isReadOnly,\n isRequired,\n value,\n label,\n onChange,\n className,\n onError,\n style,\n size = 'medium',\n errorText,\n htmlAttributes,\n floatingStrategy,\n isPortaled: isPortaledProp,\n referenceDate,\n mode = 'city',\n ref,\n ...restProps\n}: CommonProps<'input', TimeZonePickerProps>) => {\n const [inputValue, setInputValue] = useState<string>(\n value\n ? formatTimeZone(value, referenceDate)\n : formatTimeZone(\n new Date().toISOString().split('T')[1].split('.')[0],\n referenceDate,\n ),\n );\n const [searchQuery, setSearchQuery] = useState<string>('');\n const listRef = useRef<HTMLUListElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n useImperativeHandle(ref, () => inputRef.current as HTMLInputElement, []);\n const [error, setError] = useState<string | undefined>(undefined);\n const errorTextId = useId();\n const listboxId = useId();\n\n const timezoneOptions = useMemo(() => {\n if (mode === 'utc') {\n return generateUTCTimeZoneOptions(referenceDate);\n } else if (mode === 'city') {\n return generateTimeZoneOptions(referenceDate);\n } else {\n // 'both' mode - combine both lists, excluding UTC from city list to avoid duplication\n return [\n ...generateUTCTimeZoneOptions(referenceDate),\n ...generateTimeZoneOptions(referenceDate, true), // excludeUTC = true\n ];\n }\n }, [referenceDate, mode]);\n\n const { themeClassName } = useNeedleTheme();\n const { isPopoverOpen, setIsPopoverOpen } = useTimeZonePickerPopover(false);\n\n // Filter options based on search query\n const filteredOptions = useMemo(() => {\n if (!searchQuery) {\n return timezoneOptions;\n }\n\n const query = searchQuery.toLowerCase();\n return timezoneOptions.filter(\n (option) =>\n option.label.toLowerCase().includes(query) ||\n option.value.toLowerCase().includes(query),\n );\n }, [timezoneOptions, searchQuery]);\n\n // Split options into UTC and city-based sections for 'both' mode\n const { utcOptions, cityOptions } = useMemo(() => {\n if (mode !== 'both') {\n return { cityOptions: filteredOptions, utcOptions: [] };\n }\n\n const utc: typeof filteredOptions = [];\n const city: typeof filteredOptions = [];\n\n filteredOptions.forEach((option) => {\n // UTC options are those that start with \"UTC\" in their value or label\n if (\n option.value.toUpperCase().startsWith('UTC') ||\n option.label.toUpperCase().startsWith('UTC')\n ) {\n utc.push(option);\n } else {\n city.push(option);\n }\n });\n\n return { cityOptions: city, utcOptions: utc };\n }, [filteredOptions, mode]);\n\n const { focusedIndex, setFocusedIndex, handleArrowNavigation } =\n useKeyboardNavigation(filteredOptions.length);\n\n const errorToShow =\n errorText !== undefined && errorText !== '' ? errorText : error;\n\n const classes = {\n 'ndl-disabled': isDisabled,\n 'ndl-error': errorToShow !== undefined,\n 'ndl-fluid': isFluid,\n 'ndl-large': size === 'large',\n 'ndl-medium': size === 'medium',\n 'ndl-read-only': isReadOnly,\n 'ndl-small': size === 'small',\n };\n\n const inputWidth = isFluid === true ? '100%' : '16rem';\n\n useEffect(() => {\n if (error !== undefined) {\n onError?.(error, inputValue);\n }\n }, [error, inputValue, onError]);\n\n useEffect(() => {\n setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n }, [value, referenceDate]);\n\n useEffect(() => {\n if (isPopoverOpen) {\n setTimeout(() => {\n listRef.current?.children[focusedIndex]?.scrollIntoView({\n block: 'center',\n inline: 'nearest',\n });\n }, 0);\n } else {\n setTimeout(() => {\n inputRef.current?.blur();\n const selectedIndex =\n filteredOptions.findIndex((opt) => opt.value === value) ?? 0;\n setFocusedIndex(selectedIndex >= 0 ? selectedIndex : 0);\n setSearchQuery('');\n }, 0);\n }\n }, [focusedIndex, isPopoverOpen, value, setFocusedIndex, filteredOptions]);\n\n const handleOnClick = (timezone: string) => {\n if (onChange) {\n onChange(timezone);\n }\n setError(undefined);\n setInputValue(formatTimeZone(timezone, referenceDate));\n setIsPopoverOpen(false);\n setSearchQuery('');\n };\n\n const handleInputChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n const query = e.target.value;\n setSearchQuery(query);\n setInputValue(query);\n\n // In UTC mode (utc or both), validate custom UTC input\n if (\n (mode === 'utc' || mode === 'both') &&\n query.trim().toUpperCase().startsWith('UTC')\n ) {\n if (isValidUTCFormat(query.trim())) {\n setError(undefined);\n } else {\n setError('Invalid UTC format. Use UTC+H:MM or UTC-H:MM');\n }\n return;\n }\n\n // Try to find a matching timezone\n const matchingOption = timezoneOptions.find(\n (opt) =>\n opt.label.toLowerCase().includes(query.toLowerCase()) ||\n opt.value.toLowerCase().includes(query.toLowerCase()),\n );\n\n if (matchingOption) {\n setError(undefined);\n }\n };\n\n const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (isReadOnly === true || isDisabled === true) {\n e.preventDefault();\n return;\n }\n\n if (e.key === 'Escape') {\n setIsPopoverOpen(false);\n setSearchQuery('');\n setInputValue(value ? formatTimeZone(value, referenceDate) : '');\n }\n\n setIsPopoverOpen(true);\n\n if (e.key === 'Enter') {\n // In UTC mode (utc or both), allow custom UTC input\n if (\n (mode === 'utc' || mode === 'both') &&\n inputValue.trim().toUpperCase().startsWith('UTC')\n ) {\n const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n if (parsedOffset) {\n handleOnClick(parsedOffset);\n return;\n }\n }\n\n if (filteredOptions.length > 0) {\n const selectedOption = filteredOptions[focusedIndex];\n if (selectedOption) {\n handleOnClick(selectedOption.value);\n }\n }\n } else if (e.key === 'ArrowUp' || e.key === 'ArrowDown') {\n e.preventDefault();\n handleArrowNavigation(e.key);\n }\n };\n\n /** Custom floating ui solution */\n const isInsideDialog = useIsInsideDialog();\n const isPortaled = isPortaledProp ?? !isInsideDialog;\n const containerRef = useRef<HTMLDivElement>(null);\n const { refs, floatingStyles, context } = useFloating({\n elements: {\n reference: containerRef.current,\n },\n middleware: [\n offset(10),\n flip({\n fallbackPlacements: ['top'],\n fallbackStrategy: 'bestFit',\n }),\n shift({ padding: 5 }),\n ],\n onOpenChange: (open) => {\n setIsPopoverOpen(open);\n },\n open: isDisabled !== true && isReadOnly !== true && isPopoverOpen,\n placement: 'bottom',\n strategy: floatingStrategy ?? (isInsideDialog ? 'fixed' : 'absolute'),\n whileElementsMounted: autoUpdate,\n });\n const dismiss = useDismiss(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([dismiss]);\n const { styles: transitionStyles } = useTransitionStyles(context, {\n duration: Number.parseInt(tokens.motion.duration.quick) ?? 0,\n });\n\n const mergedRef = useMergeRefs([refs.setReference, containerRef]);\n\n return (\n <>\n <div\n className={classNames('ndl-timezone-picker', className, {\n ...classes,\n })}\n ref={mergedRef}\n {...getReferenceProps()}\n style={{\n width: isFluid === true ? '100%' : 'fit-content',\n }}\n >\n <label className=\"ndl-timezone-picker-label\">\n {label !== undefined && (\n <Typography\n variant={size === 'large' ? 'body-large' : 'body-medium'}\n >\n {label}\n </Typography>\n )}\n <div\n className=\"ndl-timezone-picker-input-wrapper\"\n style={{\n width: inputWidth,\n ...style,\n }}\n >\n <input\n role=\"combobox\"\n aria-expanded={isPopoverOpen}\n aria-controls={listboxId}\n aria-activedescendant={\n isPopoverOpen && focusedIndex >= 0\n ? `${listboxId}-option-${focusedIndex}`\n : undefined\n }\n aria-label={label}\n aria-invalid={Boolean(errorToShow)}\n aria-describedby={errorToShow ? errorTextId : undefined}\n className=\"ndl-timezone-picker-input\"\n type=\"text\"\n ref={inputRef}\n value={inputValue}\n disabled={isDisabled}\n readOnly={isReadOnly}\n required={isRequired}\n onChange={handleInputChange}\n onKeyDown={handleKeyDown}\n onClick={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n setIsPopoverOpen(true);\n // Select all text on click for easy searching\n e.currentTarget.select();\n }}\n onFocus={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n // Select all text on focus for easy searching\n e.currentTarget.select();\n }}\n onBlur={(e) => {\n if (isReadOnly === true || isDisabled === true) {\n return;\n }\n\n if (\n e.relatedTarget?.classList.contains(\n 'ndl-timezone-picker-popover-item',\n ) === true\n ) {\n return;\n }\n\n // In UTC mode (utc or both), try to parse custom input on blur\n if (\n (mode === 'utc' || mode === 'both') &&\n inputValue.trim().toUpperCase().startsWith('UTC')\n ) {\n const parsedOffset = parseCustomUTCOffset(inputValue.trim());\n if (parsedOffset) {\n handleOnClick(parsedOffset);\n setError(undefined);\n return;\n }\n }\n\n // Reset to the current value if no valid selection was made\n if (value) {\n setInputValue(formatTimeZone(value, referenceDate));\n } else {\n setInputValue('');\n }\n setSearchQuery('');\n setError(undefined);\n }}\n placeholder={\n mode === 'city'\n ? 'Select timezone'\n : mode === 'utc'\n ? 'Select or type UTC offset (e.g., UTC+5:30)'\n : 'Select timezone or type UTC offset'\n }\n {...htmlAttributes}\n {...restProps}\n />\n <ChevronDownIcon className=\"ndl-icon-svg ndl-timezone-picker-icon\" />\n </div>\n </label>\n {errorToShow !== undefined && (\n <div className=\"ndl-timezone-picker-error-wrapper\" role=\"status\">\n <ExclamationCircleIconSolid className=\"ndl-timezone-picker-error-icon\" />\n <Typography\n variant={size === 'large' ? 'body-medium' : 'body-small'}\n className=\"ndl-timezone-picker-error-text\"\n htmlAttributes={{ id: errorTextId }}\n >\n {errorToShow}\n </Typography>\n </div>\n )}\n </div>\n\n {context.open && (\n <ConditionalWrap\n shouldWrap={isPortaled}\n wrap={(wrapChildren) => (\n <FloatingPortal>{wrapChildren}</FloatingPortal>\n )}\n >\n <FloatingFocusManager\n context={context}\n modal={false}\n initialFocus={-1}\n >\n <div\n ref={refs.setFloating}\n className={classNames(\n themeClassName,\n 'ndl-timezone-picker-popover',\n {\n ...classes,\n },\n )}\n style={{\n ...transitionStyles,\n ...floatingStyles,\n width:\n isFluid === true\n ? containerRef.current?.clientWidth\n : undefined,\n }}\n {...getFloatingProps()}\n >\n <ul ref={listRef} role=\"listbox\" id={listboxId} tabIndex={-1}>\n {mode === 'both' ? (\n <>\n {utcOptions.length > 0 && (\n <>\n <li className=\"ndl-timezone-picker-section-header\">\n UTC Offsets\n </li>\n {utcOptions.map((option, i) => (\n <li\n id={`${listboxId}-option-${i}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === i ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n ))}\n </>\n )}\n {cityOptions.length > 0 && (\n <>\n <li className=\"ndl-timezone-picker-section-header\">\n City-Based Timezones\n </li>\n {cityOptions.map((option, i) => {\n const adjustedIndex = i + utcOptions.length;\n return (\n <li\n id={`${listboxId}-option-${adjustedIndex}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === adjustedIndex ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n );\n })}\n </>\n )}\n {utcOptions.length === 0 && cityOptions.length === 0 && (\n <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n No timezones found\n </li>\n )}\n </>\n ) : (\n <>\n {filteredOptions.length > 0 ? (\n filteredOptions.map((option, i) => (\n <li\n id={`${listboxId}-option-${i}`}\n key={option.value}\n role=\"option\"\n aria-selected={value === option.value}\n value={option.value}\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleOnClick(option.value);\n setIsPopoverOpen(false);\n }}\n onMouseDown={(e) => {\n e.stopPropagation();\n e.preventDefault();\n }}\n tabIndex={-1}\n className={classNames(\n focusedIndex === i ? 'focused' : '',\n 'ndl-timezone-picker-popover-item',\n )}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n e.stopPropagation();\n handleOnClick(option.value);\n }\n }}\n >\n {option.label}\n </li>\n ))\n ) : (\n <li className=\"ndl-timezone-picker-popover-item ndl-timezone-picker-no-results\">\n No timezones found\n </li>\n )}\n </>\n )}\n </ul>\n </div>\n </FloatingFocusManager>\n </ConditionalWrap>\n )}\n </>\n );\n};\n"]}