@react-md/core 6.1.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/RootHtml.d.ts +1 -1
  2. package/dist/RootHtml.js.map +1 -1
  3. package/dist/_base.scss +1 -0
  4. package/dist/autocomplete/defaults.d.ts +1 -0
  5. package/dist/autocomplete/defaults.js +2 -6
  6. package/dist/autocomplete/defaults.js.map +1 -1
  7. package/dist/autocomplete/types.d.ts +9 -9
  8. package/dist/autocomplete/types.js.map +1 -1
  9. package/dist/avatar/Avatar.d.ts +1 -1
  10. package/dist/avatar/Avatar.js +1 -1
  11. package/dist/avatar/Avatar.js.map +1 -1
  12. package/dist/avatar/styles.d.ts +29 -1
  13. package/dist/avatar/styles.js.map +1 -1
  14. package/dist/box/styles.d.ts +26 -3
  15. package/dist/box/styles.js.map +1 -1
  16. package/dist/button/AsyncButton.d.ts +2 -2
  17. package/dist/button/AsyncButton.js.map +1 -1
  18. package/dist/button/Button.d.ts +1 -1
  19. package/dist/button/Button.js.map +1 -1
  20. package/dist/card/CardHeader.d.ts +1 -1
  21. package/dist/card/CardHeader.js.map +1 -1
  22. package/dist/chip/Chip.d.ts +1 -1
  23. package/dist/chip/Chip.js.map +1 -1
  24. package/dist/dialog/Dialog.d.ts +1 -1
  25. package/dist/dialog/Dialog.js.map +1 -1
  26. package/dist/expansion-panel/ExpansionPanel.d.ts +1 -1
  27. package/dist/expansion-panel/ExpansionPanel.js.map +1 -1
  28. package/dist/expansion-panel/ExpansionPanelHeader.d.ts +1 -1
  29. package/dist/expansion-panel/ExpansionPanelHeader.js.map +1 -1
  30. package/dist/files/FileInput.d.ts +1 -1
  31. package/dist/files/FileInput.js.map +1 -1
  32. package/dist/form/FormMessageContainer.d.ts +1 -1
  33. package/dist/form/FormMessageContainer.js.map +1 -1
  34. package/dist/form/InputToggle.d.ts +2 -2
  35. package/dist/form/InputToggle.js.map +1 -1
  36. package/dist/form/NativeSelect.d.ts +1 -1
  37. package/dist/form/NativeSelect.js.map +1 -1
  38. package/dist/form/OptGroup.d.ts +1 -1
  39. package/dist/form/OptGroup.js.map +1 -1
  40. package/dist/form/Password.d.ts +1 -1
  41. package/dist/form/Password.js.map +1 -1
  42. package/dist/form/Select.d.ts +2 -2
  43. package/dist/form/Select.js.map +1 -1
  44. package/dist/form/Slider.d.ts +1 -1
  45. package/dist/form/Slider.js.map +1 -1
  46. package/dist/form/Switch.d.ts +3 -3
  47. package/dist/form/Switch.js.map +1 -1
  48. package/dist/form/SwitchTrack.d.ts +1 -1
  49. package/dist/form/SwitchTrack.js.map +1 -1
  50. package/dist/form/TextArea.d.ts +2 -2
  51. package/dist/form/TextArea.js.map +1 -1
  52. package/dist/form/TextField.d.ts +1 -1
  53. package/dist/form/TextField.js.map +1 -1
  54. package/dist/form/_select.scss +1 -1
  55. package/dist/form/_slider.scss +1 -1
  56. package/dist/form/types.d.ts +5 -5
  57. package/dist/form/types.js.map +1 -1
  58. package/dist/layout/LayoutAppBar.d.ts +1 -1
  59. package/dist/layout/LayoutAppBar.js.map +1 -1
  60. package/dist/list/ListItemLink.d.ts +1 -1
  61. package/dist/list/ListItemLink.js.map +1 -1
  62. package/dist/list/ListItemText.d.ts +1 -1
  63. package/dist/list/ListItemText.js.map +1 -1
  64. package/dist/list/ListSubheader.d.ts +1 -1
  65. package/dist/list/ListSubheader.js.map +1 -1
  66. package/dist/list/types.d.ts +2 -2
  67. package/dist/list/types.js.map +1 -1
  68. package/dist/menu/Menu.d.ts +3 -3
  69. package/dist/menu/Menu.js.map +1 -1
  70. package/dist/menu/MenuItemInputToggle.d.ts +2 -2
  71. package/dist/menu/MenuItemInputToggle.js.map +1 -1
  72. package/dist/menu/MenuItemTextField.d.ts +1 -1
  73. package/dist/menu/MenuItemTextField.js.map +1 -1
  74. package/dist/menu/MenuSheet.d.ts +1 -1
  75. package/dist/menu/MenuSheet.js.map +1 -1
  76. package/dist/navigation/CollapsibleNavGroup.d.ts +2 -2
  77. package/dist/navigation/CollapsibleNavGroup.js.map +1 -1
  78. package/dist/navigation/NavItemLink.d.ts +1 -1
  79. package/dist/navigation/NavItemLink.js.map +1 -1
  80. package/dist/progress/CircularProgress.d.ts +2 -17
  81. package/dist/progress/CircularProgress.js +19 -23
  82. package/dist/progress/CircularProgress.js.map +1 -1
  83. package/dist/progress/LinearProgress.d.ts +5 -1
  84. package/dist/progress/LinearProgress.js +13 -25
  85. package/dist/progress/LinearProgress.js.map +1 -1
  86. package/dist/progress/circularProgressStyles.d.ts +62 -0
  87. package/dist/progress/circularProgressStyles.js +38 -0
  88. package/dist/progress/circularProgressStyles.js.map +1 -0
  89. package/dist/progress/linearProgressStyles.d.ts +38 -0
  90. package/dist/progress/linearProgressStyles.js +38 -0
  91. package/dist/progress/linearProgressStyles.js.map +1 -0
  92. package/dist/searching/caseInsensitive.d.ts +20 -4
  93. package/dist/searching/caseInsensitive.js +5 -1
  94. package/dist/searching/caseInsensitive.js.map +1 -1
  95. package/dist/searching/fuzzy.d.ts +3 -3
  96. package/dist/searching/fuzzy.js +5 -1
  97. package/dist/searching/fuzzy.js.map +1 -1
  98. package/dist/searching/utils.d.ts +2 -1
  99. package/dist/searching/utils.js +11 -2
  100. package/dist/searching/utils.js.map +1 -1
  101. package/dist/snackbar/Toast.d.ts +1 -1
  102. package/dist/snackbar/Toast.js.map +1 -1
  103. package/dist/table/TableCell.d.ts +1 -1
  104. package/dist/table/TableCell.js.map +1 -1
  105. package/dist/table/TableCheckbox.d.ts +1 -1
  106. package/dist/table/TableCheckbox.js.map +1 -1
  107. package/dist/table/TableRadio.d.ts +1 -1
  108. package/dist/table/TableRadio.js.map +1 -1
  109. package/dist/tabs/TabListScrollButton.d.ts +1 -1
  110. package/dist/tabs/TabListScrollButton.js.map +1 -1
  111. package/dist/tree/TreeItem.d.ts +2 -2
  112. package/dist/tree/TreeItem.js.map +1 -1
  113. package/dist/tree/_tree.scss +1 -1
  114. package/dist/types.d.ts +29 -2
  115. package/dist/types.js +1 -1
  116. package/dist/types.js.map +1 -1
  117. package/dist/utils/alphaNumericSort.d.ts +9 -9
  118. package/dist/utils/alphaNumericSort.js +5 -1
  119. package/dist/utils/alphaNumericSort.js.map +1 -1
  120. package/dist/window-splitter/_window-splitter.scss +1 -1
  121. package/package.json +6 -6
  122. package/src/RootHtml.tsx +1 -1
  123. package/src/autocomplete/defaults.ts +5 -12
  124. package/src/autocomplete/types.ts +9 -12
  125. package/src/avatar/Avatar.tsx +2 -2
  126. package/src/avatar/styles.ts +53 -1
  127. package/src/box/styles.ts +34 -13
  128. package/src/button/AsyncButton.tsx +2 -2
  129. package/src/button/Button.tsx +1 -1
  130. package/src/card/CardHeader.tsx +1 -1
  131. package/src/chip/Chip.tsx +1 -1
  132. package/src/dialog/Dialog.tsx +1 -4
  133. package/src/expansion-panel/ExpansionPanel.tsx +1 -1
  134. package/src/expansion-panel/ExpansionPanelHeader.tsx +1 -1
  135. package/src/files/FileInput.tsx +1 -4
  136. package/src/form/FormMessageContainer.tsx +1 -1
  137. package/src/form/InputToggle.tsx +2 -5
  138. package/src/form/NativeSelect.tsx +1 -1
  139. package/src/form/OptGroup.tsx +1 -4
  140. package/src/form/Password.tsx +1 -1
  141. package/src/form/Select.tsx +2 -3
  142. package/src/form/Slider.tsx +1 -1
  143. package/src/form/Switch.tsx +3 -3
  144. package/src/form/SwitchTrack.tsx +1 -1
  145. package/src/form/TextArea.tsx +2 -5
  146. package/src/form/TextField.tsx +1 -1
  147. package/src/form/types.ts +5 -15
  148. package/src/layout/LayoutAppBar.tsx +1 -1
  149. package/src/list/ListItemLink.tsx +1 -1
  150. package/src/list/ListItemText.tsx +1 -4
  151. package/src/list/ListSubheader.tsx +1 -1
  152. package/src/list/types.ts +2 -5
  153. package/src/menu/Menu.tsx +3 -4
  154. package/src/menu/MenuItemInputToggle.tsx +2 -2
  155. package/src/menu/MenuItemTextField.tsx +1 -1
  156. package/src/menu/MenuSheet.tsx +1 -1
  157. package/src/navigation/CollapsibleNavGroup.tsx +2 -2
  158. package/src/navigation/NavItemLink.tsx +1 -1
  159. package/src/progress/CircularProgress.tsx +31 -53
  160. package/src/progress/LinearProgress.tsx +27 -40
  161. package/src/progress/circularProgressStyles.ts +114 -0
  162. package/src/progress/linearProgressStyles.ts +90 -0
  163. package/src/searching/caseInsensitive.ts +29 -7
  164. package/src/searching/fuzzy.ts +12 -6
  165. package/src/searching/utils.ts +13 -2
  166. package/src/snackbar/Toast.tsx +1 -1
  167. package/src/table/TableCell.tsx +1 -4
  168. package/src/table/TableCheckbox.tsx +1 -1
  169. package/src/table/TableRadio.tsx +1 -1
  170. package/src/tabs/TabListScrollButton.tsx +1 -1
  171. package/src/tree/TreeItem.tsx +2 -2
  172. package/src/types.ts +44 -2
  173. package/src/utils/alphaNumericSort.ts +17 -11
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/TextArea.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type TextareaHTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { ResizingTextAreaWrapper } from \"./ResizingTextAreaWrapper.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { textArea, textAreaContainer } from \"./textAreaStyles.js\";\nimport { type FormFieldOptions } from \"./types.js\";\nimport {\n type TextAreaResize,\n useResizingTextArea,\n} from \"./useResizingTextArea.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-text-area-height\"?: string | number;\n \"--rmd-text-area-padding\"?: string | number;\n }\n}\n\n/**\n * @since 6.0.0 Added `containerProps`.\n */\nexport interface TextAreaProps\n extends FormFieldOptions,\n TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** @defaultValue `\"text-area-\" + useId()` */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Set this to `true` if the auto resizing textarea should not animate for new\n * height changes.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * An optional style to apply to the textarea element. The base `style` prop\n * is applied to the surrounding `div` instead.\n */\n areaStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the textarea element. The base `style`\n * prop is applied to the surrounding `div` instead.\n */\n areaClassName?: string;\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n * @defaultValue `2`\n */\n rows?: number;\n\n /**\n * The maximum number of rows a textarea can expand to before showing a\n * scrollbar. When this is set to `-1`, there will be no limit.\n *\n * @defaultValue `-1`\n */\n maxRows?: number;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * When the {@link resize} prop is set to `\"auto\"`, an additional `<div>` is\n * added along with a hidden `<textarea>` mask. This prop can be used to add\n * any additional styling or props to that div.\n *\n * This will only be applied when {@link resize} is set to `\"auto\"`.\n */\n resizeContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { TextArea } from \"@react-md/core/form/TextArea\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextArea\n * label=\"Label\"\n * placeholder=\"Placeholder\"\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}\n */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(props, ref) {\n const {\n id: propId,\n style,\n className,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n areaStyle,\n areaClassName,\n resizeContainerProps,\n resize = \"auto\",\n dense,\n error,\n active,\n inline: propInline,\n leftAddon,\n rightAddon,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n rows = 2,\n maxRows = -1,\n onChange: propOnChange,\n disableTransition: propDisableTransition,\n ...remaining\n } = props;\n const { disabled = false, readOnly = false, value, defaultValue } = props;\n const id = useEnsuredId(propId, \"text-area\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const [areaRef, areaRefCallback] = useEnsuredRef(ref);\n\n const {\n maskRef,\n containerRef,\n height,\n onChange,\n scrollable,\n disableTransition,\n } = useResizingTextArea({\n maxRows,\n resize,\n onChange: propOnChange,\n containerRef: containerProps?.ref,\n disableTransition: propDisableTransition,\n });\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n // have to force it inline or else you won't be able to resize\n // it horizontally.\n const inline = resize === \"horizontal\" || resize === \"both\" || propInline;\n\n const area = (\n <textarea\n {...remaining}\n id={id}\n ref={areaRefCallback}\n rows={rows}\n disabled={disabled}\n onChange={onChange}\n placeholder={placeholder}\n style={areaStyle}\n className={textArea({\n resize,\n scrollable,\n className: areaClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n );\n\n const labelNode = label && (\n <Label\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n >\n {label}\n </Label>\n );\n\n let children = (\n <>\n {area}\n {labelNode}\n </>\n );\n\n if (resize === \"auto\") {\n children = (\n <ResizingTextAreaWrapper\n {...resizeContainerProps}\n maskId={`${id}-mask`}\n maskRef={maskRef}\n rows={rows}\n areaStyle={areaStyle}\n areaClassName={areaClassName}\n defaultValue={value ?? defaultValue}\n disableTransition={disableTransition}\n >\n {children}\n </ResizingTextAreaWrapper>\n );\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <TextFieldContainer\n {...containerProps}\n ref={containerRef}\n style={{\n ...style,\n \"--rmd-text-area-height\": height,\n }}\n className={textAreaContainer({\n animate: !disableTransition && resize === \"auto\",\n disabled,\n height: !!height,\n underlineLabelled:\n !!label && (theme === \"underline\" || theme === \"filled\"),\n className,\n })}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n onClick={(event) => {\n // The textarea container adds padding-top when there is a label so\n // that the label does not cover the text so this makes it so you\n // can still click anywhere in the \"box\" to focus the textarea.\n if (!disabled && event.target === event.currentTarget) {\n areaRef.current?.focus();\n }\n }}\n >\n {children}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","useEnsuredRef","FormMessageContainer","Label","ResizingTextAreaWrapper","TextFieldContainer","getFormConfig","textArea","textAreaContainer","useResizingTextArea","TextArea","props","ref","id","propId","style","className","label","labelProps","labelStyle","labelClassName","areaStyle","areaClassName","resizeContainerProps","resize","dense","error","active","inline","propInline","leftAddon","rightAddon","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","rows","maxRows","onChange","propOnChange","disableTransition","propDisableTransition","remaining","disabled","readOnly","value","defaultValue","areaRef","areaRefCallback","maskRef","containerRef","height","scrollable","placeholder","area","textarea","placeholderHidden","labelNode","htmlFor","floating","children","maskId","animate","underlineLabelled","onClick","event","target","currentTarget","current","focus"],"mappings":"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"}
1
+ {"version":3,"sources":["../../src/form/TextArea.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type CSSProperties,\n type HTMLAttributes,\n type TextareaHTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useEnsuredRef } from \"../useEnsuredRef.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { ResizingTextAreaWrapper } from \"./ResizingTextAreaWrapper.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { getFormConfig } from \"./formConfig.js\";\nimport { textArea, textAreaContainer } from \"./textAreaStyles.js\";\nimport { type FormFieldOptions } from \"./types.js\";\nimport {\n type TextAreaResize,\n useResizingTextArea,\n} from \"./useResizingTextArea.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-text-area-height\"?: string | number;\n \"--rmd-text-area-padding\"?: string | number;\n }\n}\n\n/**\n * @since 6.0.0 Added `containerProps`.\n */\nexport interface TextAreaProps\n extends FormFieldOptions,\n TextareaHTMLAttributes<HTMLTextAreaElement> {\n /** @defaultValue `\"text-area-\" + useId()` */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Set this to `true` if the auto resizing textarea should not animate for new\n * height changes.\n *\n * @defaultValue `false`\n */\n disableTransition?: boolean;\n\n /**\n * An optional style to apply to the textarea element. The base `style` prop\n * is applied to the surrounding `div` instead.\n */\n areaStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the textarea element. The base `style`\n * prop is applied to the surrounding `div` instead.\n */\n areaClassName?: string;\n\n /**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea#attr-rows\n * @defaultValue `2`\n */\n rows?: number;\n\n /**\n * The maximum number of rows a textarea can expand to before showing a\n * scrollbar. When this is set to `-1`, there will be no limit.\n *\n * @defaultValue `-1`\n */\n maxRows?: number;\n\n /**\n * @see {@link TextAreaResize}\n * @defaultValue `\"auto\"`\n */\n resize?: TextAreaResize;\n\n /**\n * When the {@link resize} prop is set to `\"auto\"`, an additional `<div>` is\n * added along with a hidden `<textarea>` mask. This prop can be used to add\n * any additional styling or props to that div.\n *\n * This will only be applied when {@link resize} is set to `\"auto\"`.\n */\n resizeContainerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\n}\n\n/**\n * **Client Component**\n *\n * @example Simple Example\n * ```tsx\n * import { TextArea } from \"@react-md/core/form/TextArea\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextArea\n * label=\"Label\"\n * placeholder=\"Placeholder\"\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/text-field#simple-textarea | TextArea Demos}\n */\nexport const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(\n function TextArea(props, ref) {\n const {\n id: propId,\n style,\n className,\n label,\n labelProps,\n labelStyle,\n labelClassName,\n areaStyle,\n areaClassName,\n resizeContainerProps,\n resize = \"auto\",\n dense,\n error,\n active,\n inline: propInline,\n leftAddon,\n rightAddon,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n theme: propTheme,\n underlineDirection: propUnderlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n rows = 2,\n maxRows = -1,\n onChange: propOnChange,\n disableTransition: propDisableTransition,\n ...remaining\n } = props;\n const { disabled = false, readOnly = false, value, defaultValue } = props;\n const id = useEnsuredId(propId, \"text-area\");\n const theme = getFormConfig(\"theme\", propTheme);\n const underlineDirection = getFormConfig(\n \"underlineDirection\",\n propUnderlineDirection\n );\n const [areaRef, areaRefCallback] = useEnsuredRef(ref);\n\n const {\n maskRef,\n containerRef,\n height,\n onChange,\n scrollable,\n disableTransition,\n } = useResizingTextArea({\n maxRows,\n resize,\n onChange: propOnChange,\n containerRef: containerProps?.ref,\n disableTransition: propDisableTransition,\n });\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n // have to force it inline or else you won't be able to resize\n // it horizontally.\n const inline = resize === \"horizontal\" || resize === \"both\" || propInline;\n\n const area = (\n <textarea\n {...remaining}\n id={id}\n ref={areaRefCallback}\n rows={rows}\n disabled={disabled}\n onChange={onChange}\n placeholder={placeholder}\n style={areaStyle}\n className={textArea({\n resize,\n scrollable,\n className: areaClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n );\n\n const labelNode = label && (\n <Label\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n >\n {label}\n </Label>\n );\n\n let children = (\n <>\n {area}\n {labelNode}\n </>\n );\n\n if (resize === \"auto\") {\n children = (\n <ResizingTextAreaWrapper\n {...resizeContainerProps}\n maskId={`${id}-mask`}\n maskRef={maskRef}\n rows={rows}\n areaStyle={areaStyle}\n areaClassName={areaClassName}\n defaultValue={value ?? defaultValue}\n disableTransition={disableTransition}\n >\n {children}\n </ResizingTextAreaWrapper>\n );\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={messageProps}\n >\n <TextFieldContainer\n {...containerProps}\n ref={containerRef}\n style={{\n ...style,\n \"--rmd-text-area-height\": height,\n }}\n className={textAreaContainer({\n animate: !disableTransition && resize === \"auto\",\n disabled,\n height: !!height,\n underlineLabelled:\n !!label && (theme === \"underline\" || theme === \"filled\"),\n className,\n })}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n rightAddon={rightAddon}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n onClick={(event) => {\n // The textarea container adds padding-top when there is a label so\n // that the label does not cover the text so this makes it so you\n // can still click anywhere in the \"box\" to focus the textarea.\n if (!disabled && event.target === event.currentTarget) {\n areaRef.current?.focus();\n }\n }}\n >\n {children}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","useEnsuredRef","FormMessageContainer","Label","ResizingTextAreaWrapper","TextFieldContainer","getFormConfig","textArea","textAreaContainer","useResizingTextArea","TextArea","props","ref","id","propId","style","className","label","labelProps","labelStyle","labelClassName","areaStyle","areaClassName","resizeContainerProps","resize","dense","error","active","inline","propInline","leftAddon","rightAddon","disableLeftAddonStyles","disableRightAddonStyles","theme","propTheme","underlineDirection","propUnderlineDirection","messageProps","messageContainerProps","containerProps","rows","maxRows","onChange","propOnChange","disableTransition","propDisableTransition","remaining","disabled","readOnly","value","defaultValue","areaRef","areaRefCallback","maskRef","containerRef","height","scrollable","placeholder","area","textarea","placeholderHidden","labelNode","htmlFor","floating","children","maskId","animate","underlineLabelled","onClick","event","target","currentTarget","current","focus"],"mappings":"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"}
@@ -49,7 +49,7 @@ export interface TextFieldProps extends TextFieldInputAttributes, UserAgentAutoc
49
49
  * There probably isn't any real use for this prop other than if you need to
50
50
  * add a `ref` for some DOM behavior.
51
51
  */
52
- containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
52
+ containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;
53
53
  }
54
54
  /**
55
55
  * The structure for this component is:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/TextField.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { textField } from \"./textFieldStyles.js\";\nimport {\n type FormFieldOptions,\n type UserAgentAutocompleteProps,\n} from \"./types.js\";\n\n/**\n * These are all the \"supported\" input types for react-md so that they at least\n * render reasonably well by default. There is no built-in validation or\n * anything adding onto existing browser functionality for these types.\n *\n * @since 2.5.0 - `\"search\"` was added\n * @since 6.0.0 Dropped support for `\"week\"` and `\"month\"` input types since\n * they are not available in Firefox and Safari at this time.\n */\nexport type SupportedInputTypes =\n | \"text\"\n | \"password\"\n | \"number\"\n | \"tel\"\n | \"email\"\n | \"date\"\n | \"time\"\n | \"datetime-local\"\n | \"url\"\n | \"color\"\n | \"search\";\n\n/**\n * @since 6.0.0 Renamed from `TextFieldAttributes` to\n * `TextFieldInputAttributes`\n */\nexport type TextFieldInputAttributes = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\"\n>;\n\n/**\n * @since 6.0.0 Removed the `containerRef` prop.\n */\nexport interface TextFieldProps\n extends TextFieldInputAttributes,\n UserAgentAutocompleteProps,\n FormFieldOptions {\n /**\n * @defaultValue `\"text-field-\" + useId()`\n */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Any optional inline styles to set on the input.\n */\n inputStyle?: CSSProperties;\n\n /**\n * An optional `className` to add to the input.\n */\n inputClassName?: string;\n\n /**\n * The text field type.\n *\n * @defaultValue `\"text\"`\n */\n type?: SupportedInputTypes;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;\n}\n\n/**\n * The structure for this component is:\n * @example Component Structure\n * ```tsx\n * <FormMessageContainer {...messageContainerProps}>\n * <TextFieldContainer {...containerProps}>\n * <input {...props} />\n * <Label {...labelProps} />\n * </TextFieldContainer>\n * </FormMessageContainer>\n * ```\n *\n * @example Simple Example\n * ```tsx\n * import { TextField } from \"@react-md/core/form/TextField\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextField\n * label=\"Name\"\n * placeholder=\"Bob\"\n * defaultValue=\"\"\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/textfield | TextField Demos}\n */\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(props, ref) {\n const {\n id: propId,\n style,\n className,\n type = \"text\",\n label,\n labelProps,\n labelStyle,\n labelClassName,\n autoCompleteValue,\n autoComplete = autoCompleteValue,\n name = autoCompleteValue,\n dense,\n error,\n active,\n inline,\n leftAddon,\n leftAddonProps,\n rightAddon,\n rightAddonProps,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n inputStyle,\n inputClassName,\n theme,\n underlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n ...remaining\n } = props;\n const { disabled, readOnly } = props;\n const id = useEnsuredId(propId, \"text-field\");\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={\n messageProps && {\n error,\n theme,\n ...messageProps,\n }\n }\n >\n <TextFieldContainer\n {...containerProps}\n style={style}\n className={className}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n leftAddonProps={leftAddonProps}\n rightAddon={rightAddon}\n rightAddonProps={rightAddonProps}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n >\n <input\n {...remaining}\n id={id}\n ref={ref}\n type={type}\n name={name}\n disabled={disabled}\n placeholder={placeholder}\n autoComplete={autoComplete}\n style={inputStyle}\n className={textField({\n className: inputClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n {label && (\n <Label\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n >\n {label}\n </Label>\n )}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","FormMessageContainer","Label","TextFieldContainer","textField","TextField","props","ref","id","propId","style","className","type","label","labelProps","labelStyle","labelClassName","autoCompleteValue","autoComplete","name","dense","error","active","inline","leftAddon","leftAddonProps","rightAddon","rightAddonProps","disableLeftAddonStyles","disableRightAddonStyles","inputStyle","inputClassName","theme","underlineDirection","messageProps","messageContainerProps","containerProps","remaining","disabled","readOnly","placeholder","input","placeholderHidden","floating","htmlFor"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAGf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,SAAS,QAAQ,uBAAuB;AAiFjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAAS,EACTC,OAAO,MAAM,EACbC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,eAAeD,iBAAiB,EAChCE,OAAOF,iBAAiB,EACxBG,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,sBAAsB,EACtBC,uBAAuB,EACvBC,UAAU,EACVC,cAAc,EACdC,KAAK,EACLC,kBAAkB,EAClBC,YAAY,EACZC,qBAAqB,EACrBC,cAAc,EACd,GAAGC,WACJ,GAAG/B;IACJ,MAAM,EAAEgC,QAAQ,EAAEC,QAAQ,EAAE,GAAGjC;IAC/B,MAAME,KAAKR,aAAaS,QAAQ;IAEhC,IAAI,EAAE+B,cAAc,EAAE,EAAE,GAAGlC;IAC3B,IAAIO,SAAS,CAAC2B,aAAa;QACzB,+DAA+D;QAC/DA,cAAc;IAChB;IAEA,qBACE,KAACvC;QACE,GAAGkC,qBAAqB;QACzBD,cACEA,gBAAgB;YACdb;YACAW;YACA,GAAGE,YAAY;QACjB;kBAGF,cAAA,MAAC/B;YACE,GAAGiC,cAAc;YAClB1B,OAAOA;YACPC,WAAWA;YACXqB,OAAOA;YACPnB,OAAO,CAAC,CAACA;YACTQ,OAAOA;YACPD,OAAOA;YACPG,QAAQA;YACRD,QAAQA;YACRiB,UAAUA;YACVD,UAAUA;YACVd,WAAWA;YACXC,gBAAgBA;YAChBC,YAAYA;YACZC,iBAAiBA;YACjBM,oBAAoBA;YACpBL,wBAAwBA;YACxBC,yBAAyBA;;8BAEzB,KAACY;oBACE,GAAGJ,SAAS;oBACb7B,IAAIA;oBACJD,KAAKA;oBACLK,MAAMA;oBACNO,MAAMA;oBACNmB,UAAUA;oBACVE,aAAaA;oBACbtB,cAAcA;oBACdR,OAAOoB;oBACPnB,WAAWP,UAAU;wBACnBO,WAAWoB;wBACXW,mBAAmB,CAAC,CAAC7B,SAAS,CAACS;oBACjC;;gBAEDT,uBACC,KAACX;oBACCyC,QAAQ;oBACRvB,OAAOA;oBACPC,OAAOA;oBACPC,QAAQA;oBACRgB,UAAUA;oBACT,GAAGxB,UAAU;oBACd8B,SAASpC;oBACTE,OAAOI,YAAYJ,SAASK;oBAC5BJ,WAAWG,YAAYH,aAAaK;8BAEnCH;;;;;AAMb,GACA"}
1
+ {"version":3,"sources":["../../src/form/TextField.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { FormMessageContainer } from \"./FormMessageContainer.js\";\nimport { Label } from \"./Label.js\";\nimport { TextFieldContainer } from \"./TextFieldContainer.js\";\nimport { textField } from \"./textFieldStyles.js\";\nimport {\n type FormFieldOptions,\n type UserAgentAutocompleteProps,\n} from \"./types.js\";\n\n/**\n * These are all the \"supported\" input types for react-md so that they at least\n * render reasonably well by default. There is no built-in validation or\n * anything adding onto existing browser functionality for these types.\n *\n * @since 2.5.0 - `\"search\"` was added\n * @since 6.0.0 Dropped support for `\"week\"` and `\"month\"` input types since\n * they are not available in Firefox and Safari at this time.\n */\nexport type SupportedInputTypes =\n | \"text\"\n | \"password\"\n | \"number\"\n | \"tel\"\n | \"email\"\n | \"date\"\n | \"time\"\n | \"datetime-local\"\n | \"url\"\n | \"color\"\n | \"search\";\n\n/**\n * @since 6.0.0 Renamed from `TextFieldAttributes` to\n * `TextFieldInputAttributes`\n */\nexport type TextFieldInputAttributes = Omit<\n InputHTMLAttributes<HTMLInputElement>,\n \"type\"\n>;\n\n/**\n * @since 6.0.0 Removed the `containerRef` prop.\n */\nexport interface TextFieldProps\n extends TextFieldInputAttributes,\n UserAgentAutocompleteProps,\n FormFieldOptions {\n /**\n * @defaultValue `\"text-field-\" + useId()`\n */\n id?: string;\n\n /**\n * Optional placeholder text to display in the text field.\n *\n * @defaultValue `label ? \" \" : \"\"`\n */\n placeholder?: string;\n\n /**\n * Any optional inline styles to set on the input.\n */\n inputStyle?: CSSProperties;\n\n /**\n * An optional `className` to add to the input.\n */\n inputClassName?: string;\n\n /**\n * The text field type.\n *\n * @defaultValue `\"text\"`\n */\n type?: SupportedInputTypes;\n\n /**\n * Optional props to provide to the {@link TextFieldContainer} component.\n * There probably isn't any real use for this prop other than if you need to\n * add a `ref` for some DOM behavior.\n */\n containerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\n}\n\n/**\n * The structure for this component is:\n * @example Component Structure\n * ```tsx\n * <FormMessageContainer {...messageContainerProps}>\n * <TextFieldContainer {...containerProps}>\n * <input {...props} />\n * <Label {...labelProps} />\n * </TextFieldContainer>\n * </FormMessageContainer>\n * ```\n *\n * @example Simple Example\n * ```tsx\n * import { TextField } from \"@react-md/core/form/TextField\";\n * import type { ReactElement } from \"react\";\n *\n * function Example(): ReactElement {\n * return (\n * <TextField\n * label=\"Name\"\n * placeholder=\"Bob\"\n * defaultValue=\"\"\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/textfield | TextField Demos}\n */\nexport const TextField = forwardRef<HTMLInputElement, TextFieldProps>(\n function TextField(props, ref) {\n const {\n id: propId,\n style,\n className,\n type = \"text\",\n label,\n labelProps,\n labelStyle,\n labelClassName,\n autoCompleteValue,\n autoComplete = autoCompleteValue,\n name = autoCompleteValue,\n dense,\n error,\n active,\n inline,\n leftAddon,\n leftAddonProps,\n rightAddon,\n rightAddonProps,\n disableLeftAddonStyles,\n disableRightAddonStyles,\n inputStyle,\n inputClassName,\n theme,\n underlineDirection,\n messageProps,\n messageContainerProps,\n containerProps,\n ...remaining\n } = props;\n const { disabled, readOnly } = props;\n const id = useEnsuredId(propId, \"text-field\");\n\n let { placeholder = \"\" } = props;\n if (label && !placeholder) {\n // See the placeholder type definition comments for information\n placeholder = \" \";\n }\n\n return (\n <FormMessageContainer\n {...messageContainerProps}\n messageProps={\n messageProps && {\n error,\n theme,\n ...messageProps,\n }\n }\n >\n <TextFieldContainer\n {...containerProps}\n style={style}\n className={className}\n theme={theme}\n label={!!label}\n error={error}\n dense={dense}\n inline={inline}\n active={active}\n readOnly={readOnly}\n disabled={disabled}\n leftAddon={leftAddon}\n leftAddonProps={leftAddonProps}\n rightAddon={rightAddon}\n rightAddonProps={rightAddonProps}\n underlineDirection={underlineDirection}\n disableLeftAddonStyles={disableLeftAddonStyles}\n disableRightAddonStyles={disableRightAddonStyles}\n >\n <input\n {...remaining}\n id={id}\n ref={ref}\n type={type}\n name={name}\n disabled={disabled}\n placeholder={placeholder}\n autoComplete={autoComplete}\n style={inputStyle}\n className={textField({\n className: inputClassName,\n placeholderHidden: !!label && !active,\n })}\n />\n {label && (\n <Label\n floating\n dense={dense}\n error={error}\n active={active}\n disabled={disabled}\n {...labelProps}\n htmlFor={id}\n style={labelProps?.style ?? labelStyle}\n className={labelProps?.className ?? labelClassName}\n >\n {label}\n </Label>\n )}\n </TextFieldContainer>\n </FormMessageContainer>\n );\n }\n);\n"],"names":["forwardRef","useEnsuredId","FormMessageContainer","Label","TextFieldContainer","textField","TextField","props","ref","id","propId","style","className","type","label","labelProps","labelStyle","labelClassName","autoCompleteValue","autoComplete","name","dense","error","active","inline","leftAddon","leftAddonProps","rightAddon","rightAddonProps","disableLeftAddonStyles","disableRightAddonStyles","inputStyle","inputClassName","theme","underlineDirection","messageProps","messageContainerProps","containerProps","remaining","disabled","readOnly","placeholder","input","placeholderHidden","floating","htmlFor"],"mappings":";AAAA,SAIEA,UAAU,QACL,QAAQ;AAGf,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,oBAAoB,QAAQ,4BAA4B;AACjE,SAASC,KAAK,QAAQ,aAAa;AACnC,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,SAAS,QAAQ,uBAAuB;AAiFjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BC,GACD,OAAO,MAAMC,0BAAYN,WACvB,SAASM,UAAUC,KAAK,EAAEC,GAAG;IAC3B,MAAM,EACJC,IAAIC,MAAM,EACVC,KAAK,EACLC,SAAS,EACTC,OAAO,MAAM,EACbC,KAAK,EACLC,UAAU,EACVC,UAAU,EACVC,cAAc,EACdC,iBAAiB,EACjBC,eAAeD,iBAAiB,EAChCE,OAAOF,iBAAiB,EACxBG,KAAK,EACLC,KAAK,EACLC,MAAM,EACNC,MAAM,EACNC,SAAS,EACTC,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,sBAAsB,EACtBC,uBAAuB,EACvBC,UAAU,EACVC,cAAc,EACdC,KAAK,EACLC,kBAAkB,EAClBC,YAAY,EACZC,qBAAqB,EACrBC,cAAc,EACd,GAAGC,WACJ,GAAG/B;IACJ,MAAM,EAAEgC,QAAQ,EAAEC,QAAQ,EAAE,GAAGjC;IAC/B,MAAME,KAAKR,aAAaS,QAAQ;IAEhC,IAAI,EAAE+B,cAAc,EAAE,EAAE,GAAGlC;IAC3B,IAAIO,SAAS,CAAC2B,aAAa;QACzB,+DAA+D;QAC/DA,cAAc;IAChB;IAEA,qBACE,KAACvC;QACE,GAAGkC,qBAAqB;QACzBD,cACEA,gBAAgB;YACdb;YACAW;YACA,GAAGE,YAAY;QACjB;kBAGF,cAAA,MAAC/B;YACE,GAAGiC,cAAc;YAClB1B,OAAOA;YACPC,WAAWA;YACXqB,OAAOA;YACPnB,OAAO,CAAC,CAACA;YACTQ,OAAOA;YACPD,OAAOA;YACPG,QAAQA;YACRD,QAAQA;YACRiB,UAAUA;YACVD,UAAUA;YACVd,WAAWA;YACXC,gBAAgBA;YAChBC,YAAYA;YACZC,iBAAiBA;YACjBM,oBAAoBA;YACpBL,wBAAwBA;YACxBC,yBAAyBA;;8BAEzB,KAACY;oBACE,GAAGJ,SAAS;oBACb7B,IAAIA;oBACJD,KAAKA;oBACLK,MAAMA;oBACNO,MAAMA;oBACNmB,UAAUA;oBACVE,aAAaA;oBACbtB,cAAcA;oBACdR,OAAOoB;oBACPnB,WAAWP,UAAU;wBACnBO,WAAWoB;wBACXW,mBAAmB,CAAC,CAAC7B,SAAS,CAACS;oBACjC;;gBAEDT,uBACC,KAACX;oBACCyC,QAAQ;oBACRvB,OAAOA;oBACPC,OAAOA;oBACPC,QAAQA;oBACRgB,UAAUA;oBACT,GAAGxB,UAAU;oBACd8B,SAASpC;oBACTE,OAAOI,YAAYJ,SAASK;oBAC5BJ,WAAWG,YAAYH,aAAaK;8BAEnCH;;;;;AAMb,GACA"}
@@ -161,7 +161,7 @@ $option-selected-icon-spacing: $option-padding-left !default;
161
161
  @mixin select-styles($disable-layer: false) {
162
162
  @include utils.optional-layer(select, $disable-layer) {
163
163
  .rmd-select-container {
164
- outline-style: none;
164
+ outline: 0;
165
165
  }
166
166
 
167
167
  .rmd-selected-option {
@@ -642,7 +642,7 @@ $variables: (
642
642
 
643
643
  border-radius: $thumb-border-radius;
644
644
  height: $thumb-size;
645
- outline-style: none;
645
+ outline: 0;
646
646
  position: absolute;
647
647
  width: $thumb-size;
648
648
  z-index: $thumb-z-index;
@@ -242,7 +242,7 @@ export interface FormMessageContainerExtension {
242
242
  * component, these props are optional. It kind of eliminates the whole
243
243
  * purpose of this component though.
244
244
  */
245
- messageProps?: PropsWithRef<FormMessageProps & Partial<FormMessageInputLengthCounterProps>, HTMLDivElement>;
245
+ messageProps?: PropsWithRef<FormMessageProps & Partial<FormMessageInputLengthCounterProps>>;
246
246
  /**
247
247
  * Any props (and an optional ref) to provide to the `<div>` surrounding the
248
248
  * children and `FormMessage` component.
@@ -250,7 +250,7 @@ export interface FormMessageContainerExtension {
250
250
  * Note: This will not be used if the `messageProps` are not provided since
251
251
  * only the `children` will be returned without the container.
252
252
  */
253
- messageContainerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
253
+ messageContainerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;
254
254
  }
255
255
  /** @since 6.0.0 */
256
256
  export interface LabelClassNameOptions {
@@ -385,7 +385,7 @@ export interface TextFieldContainerOptions extends FormThemeOptions, FormCompone
385
385
  *
386
386
  * @since 6.0.0
387
387
  */
388
- leftAddonProps?: PropsWithRef<ConfigurableTextFieldAddonProps, HTMLSpanElement>;
388
+ leftAddonProps?: PropsWithRef<ConfigurableTextFieldAddonProps>;
389
389
  /**
390
390
  * @see {@link TextFieldAddonProps.disabled}
391
391
  *
@@ -402,7 +402,7 @@ export interface TextFieldContainerOptions extends FormThemeOptions, FormCompone
402
402
  *
403
403
  * @since 6.0.0
404
404
  */
405
- rightAddonProps?: PropsWithRef<ConfigurableTextFieldAddonProps, HTMLSpanElement>;
405
+ rightAddonProps?: PropsWithRef<ConfigurableTextFieldAddonProps>;
406
406
  /**
407
407
  * @see {@link TextFieldAddonProps.disabled}
408
408
  *
@@ -433,7 +433,7 @@ export interface FormFieldOptions extends TextFieldContainerOptions, FormMessage
433
433
  * }}
434
434
  * ```
435
435
  */
436
- labelProps?: PropsWithRef<LabelProps, HTMLLabelElement>;
436
+ labelProps?: PropsWithRef<LabelProps>;
437
437
  /**
438
438
  * A convenience prop to apply a custom style to a label. This is equivalent
439
439
  * to:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/form/types.ts"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-form-active-color\"?: string;\n \"--rmd-form-focus-color\"?: string;\n }\n}\n\n/**\n * The supported themes for the `TextField`, `TextArea`, and `Select`\n * components.\n *\n * - \"none\" - display as an unstyled text field without any border or background\n * colors.\n * - \"underline\" - display with only an underline that gains the form active\n * color and animates from the left or right to the other side when the field\n * is focused.\n * - \"filled\" - an extension of the `\"underline\"` state that will also have a\n * slightly dark background applied.\n * - \"outline\" - outlines the entire text field in a border and applies the\n * active color as box shadow when the field is focused.\n */\nexport type FormTheme = \"none\" | \"underline\" | \"filled\" | \"outline\";\n\n/**\n * The direction that the underline should appear from when the theme is\n * `\"underline\"` or `\"filled\"`.\n */\nexport type FormUnderlineDirection = \"left\" | \"center\" | \"right\";\n\nexport interface FormThemeOptions {\n /**\n * The current theme type.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n\n /**\n * The current underline direction.\n *\n * @defaultValue `\"left\"`\n */\n underlineDirection?: FormUnderlineDirection;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface FormConfiguration extends Required<FormThemeOptions> {\n /**\n * Set this to `false` if the `$disable-uncontrolled-input-toggles` variable\n * is set to `true` in the Sass configuration.\n *\n * Since the `checked` state only changes for the radio that has been clicked,\n * the previously checked radio would also be shown as checked with no way of\n * fixing it without controlling the radio component. When this flag is\n * enabled, the checked icons and state are handled through css instead of\n * `useState`.\n *\n * @defaultValue `true`\n */\n uncontrolledToggles: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface FormComponentStates {\n /** @defaultValue `false` */\n error?: boolean;\n\n /** @defaultValue `false` */\n active?: boolean;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n readOnly?: boolean;\n}\n\n/**\n * @since 6.0.0\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\nexport type AutocompleteAttributeValue =\n | \"off\"\n | \"on\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level1\"\n | \"address-level2\"\n | \"address-level3\"\n | \"address-level4\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tek-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\n/**\n * @since 6.0.0\n */\nexport interface UserAgentAutocompleteProps {\n /**\n * Set this to enable additional autocompletion suggestions for a user for\n * different form fields. Using this prop will update the\n * {@link UserAgentAutocompleteProps.name} and {@link autoComplete} to default to\n * this value.\n *\n * @example\n * ```tsx\n * <Form>\n * <TextField\n * label=\"Enter your credit card number\"\n * autoCompleteValue=\"cc-number\"\n * {...creditCardProps}\n * inputMode=\"number\"\n * />\n * <TextField\n * label=\"Name on card\"\n * autoCompleteValue=\"cc-name\"\n * {...creditCardNameProps}\n * />\n * <TextField\n * label=\"Security code\"\n * autoCompleteValue=\"cc-csc\"\n * {...securityCodeProps}\n * inputMode=\"number\"\n * />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n * @see {@link AutocompleteAttributeValue}\n * @see {@link autoComplete}\n * @see {@link UserAgentAutocompleteProps.name}\n */\n autoCompleteValue?: AutocompleteAttributeValue;\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n autoComplete?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n name?: string;\n}\n\nexport interface FormMessageClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the message should gain the error state which changes the text\n * color to `red` by default.\n *\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * The current theme for the related text field. This is really only used to\n * match the current horizontal padding of the text field.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\nexport interface FormMessageProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"minLength\" | \"maxLength\">,\n FormMessageClassNameOptions {\n /**\n * If this component is acting as a form-level error message handler, the role\n * should be updated to be `\"alert\"` for additional accessibility.\n *\n * Note: when creating a form-level error message handler, the messages should\n * no longer appear as the user types and instead once the user tries to\n * submit the form. Having an alert role disrupts normal screen reader\n * behavior by immediately reading changes in this element.\n *\n * @defaultValue `undefined`\n */\n role?: \"alert\";\n\n /**\n * Boolean if the children should no longer be wrapped in a `<p>` tag. This\n * should normally only be disabled if using a custom error message wrapper or\n * the counter behavior is not being used. To get correct alignments of the\n * message and counter, the `children` must be wrapped in some element and\n * cannot be plain test.\n *\n * Note: this will always be considered `true` if the `role` is set to\n * `\"alert\"`.\n *\n * @defaultValue `false`\n */\n disableWrap?: boolean;\n\n /**\n * An optional style to apply to the `<p>` tag that surrounds the `children`.\n * This will not be used if `role=\"alert\"` or `disableWrap={true}`.\n */\n messageStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the `<p>` tag that surrounds the\n * `children`. This will not be used if `role=\"alert\"` or\n * `disableWrap={true}`.\n */\n messageClassName?: string;\n}\n\n/**\n * Props that are used to automatically add a counter for the remaining letters\n * available for the text field. The counter will always be created to the right\n * of the optional message.\n *\n * The counter is really a simple string of: `${length} / ${maxLength}`.\n *\n * If you need additional customization, it is recommended to create your own\n * implementation such as:\n *\n * ```tsx\n * <FormMessage>\n * {errorMessage}\n * <MyCounter {...props} />\n * </FormMessage>\n * ```\n *\n * Note: this should not be used alongside form-level messages.\n *\n * @since 2.9.0 Renamed from `FormMessageCounterProps` to\n * `FormMessageInputLengthCounterProps` since a `FormMessageCounter` component\n * was added\n */\nexport interface FormMessageInputLengthCounterProps {\n /**\n * The current length of the value in the related text field.\n */\n length: number;\n\n /**\n * The max length allowed for the value in the related text field.\n */\n maxLength: number;\n\n /**\n * An optional style to apply to the counter wrapper element.\n */\n counterStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the counter wrapper element.\n */\n counterClassName?: string;\n}\n\nexport interface FormMessageWithCounterProps\n extends FormMessageProps,\n FormMessageInputLengthCounterProps {}\n\n/**\n * @since 6.0.0\n */\nexport interface FormMessageWithoutCounterProps extends FormMessageProps {\n length?: never;\n maxLength?: never;\n counterStyle?: never;\n counterClassName?: never;\n}\n\nexport interface FormMessageContainerExtension {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>,\n HTMLDivElement\n >;\n\n /**\n * Any props (and an optional ref) to provide to the `<div>` surrounding the\n * children and `FormMessage` component.\n *\n * Note: This will not be used if the `messageProps` are not provided since\n * only the `children` will be returned without the container.\n */\n messageContainerProps?: PropsWithRef<\n HTMLAttributes<HTMLDivElement>,\n HTMLDivElement\n >;\n}\n\n/** @since 6.0.0 */\nexport interface LabelClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to remove the `gap` style from the label.\n *\n * @see `$label-gap`\n * @defaultValue `false`\n */\n gap?: boolean;\n\n /**\n * Set this to `true` when the parent `TextFieldContainer` has the `dense`\n * spec enabled. This updates the floating styles to match the smaller height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the error color.\n *\n * @see `$error-color`\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the active color.\n *\n * @see `$active-color`\n * @defaultValue `false`\n */\n active?: boolean;\n\n /**\n * Set this to `true` if the label should gain `flex-direction: column`\n * styling.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Set this to `true` to update the label's color to be the disabled color.\n *\n * @see `$disabled-color`\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Set this to true when label can floating above an input, textarea, or\n * select inside of a `TextFieldContainer`.\n *\n * @defaultValue `false`\n */\n floating?: boolean;\n\n /**\n * Set this to true when label is currently floating above an input,\n * textarea, or selected inside of a `TextFieldContainer`.\n *\n * @see {@link active}\n * @defaultValue `active`\n */\n floatingActive?: boolean;\n\n /**\n * Set this to `true` to gain `flex-direction: row-reversed` styling. If the\n * {@link stacked} prop is also `true`, `flex-direction: column-reversed` will\n * be applied.\n *\n * @defaultValue `false`\n */\n reversed?: boolean;\n\n /**\n * @defaultValue `false`\n */\n inactive?: boolean;\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n LabelClassNameOptions {}\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableTextFieldAddonProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Boolean if the addon should be presentational only and prevent pointer\n * events.\n *\n * @defaultValue `false`\n */\n pointerEvents?: boolean;\n}\n\n/**\n * @since 6.0.0 Split props into `ConfigurableTextFieldAddonProps`\n */\nexport interface TextFieldAddonProps extends ConfigurableTextFieldAddonProps {\n /**\n * @defaultValue `false`\n */\n after?: boolean;\n\n /**\n * Set this to `true` if the addon should not be wrapped in a `<span>` with some\n * additional styles.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/**\n * @since 6.0.0 Renamed the `leftChildren` / `rightChildren` props to\n * `leftAddon` / `rightAddon`. Renamed `isLeftAddon` / `isRightAddon` to\n * `disableLeftAddonStyles` / `disableRightAddonStyles`. Added\n * `leftAddonProps` / `rightAddonProps`. Removed `stretch`\n */\nexport interface TextFieldContainerOptions\n extends FormThemeOptions,\n FormComponentStates {\n /**\n * Set this to `true` to enable the dense spec which reduces the height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to change the style from `display: flex` to\n * `display: inline-flex`.\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed before the\n * `TextField` or `TextArea`.\n */\n leftAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link leftAddon}.\n *\n * @since 6.0.0\n */\n leftAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableLeftAddonStyles?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed after the\n * `TextField` or `TextArea`.\n */\n rightAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link rightAddon}.\n *\n * @since 6.0.0\n */\n rightAddonProps?: PropsWithRef<\n ConfigurableTextFieldAddonProps,\n HTMLSpanElement\n >;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableRightAddonStyles?: boolean;\n}\n\nexport interface FormFieldOptions\n extends TextFieldContainerOptions,\n FormMessageContainerExtension {\n /**\n * An optional floating label to use with the text field. A label is generally\n * recommended for accessibility, but can be omitted if an `aria-label` or\n * `aria-labelledby` is provided.\n */\n label?: ReactNode;\n\n /**\n * Any additional props and/or ref that should be passed to the `<label>`\n * element when a {@link label} is provided.\n *\n * @example\n * ```tsx\n * labelProps={{\n * ref: labelRef,\n * style: {},\n * className: \"some-custom-class-name\",\n * onClick: (event) => {\n * // do something\n * }\n * }}\n * ```\n */\n labelProps?: PropsWithRef<LabelProps, HTMLLabelElement>;\n\n /**\n * A convenience prop to apply a custom style to a label. This is equivalent\n * to:\n *\n * ```ts\n * labelProps={{\n * style: // some style here\n * }}\n * ```\n */\n labelStyle?: CSSProperties;\n\n /**\n * A convenience prop to apply a custom className to a label. This is\n * equivalent to:\n *\n * ```ts\n * labelProps={{\n * className: \"some-class-name\",\n * }}\n * ```\n */\n labelClassName?: string;\n}\n"],"names":[],"mappings":"AAiiBA,WAmDC"}
1
+ {"version":3,"sources":["../../src/form/types.ts"],"sourcesContent":["import {\n type CSSProperties,\n type HTMLAttributes,\n type InputHTMLAttributes,\n type LabelHTMLAttributes,\n type ReactNode,\n} from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\n\ndeclare module \"react\" {\n interface CSSProperties {\n \"--rmd-form-active-color\"?: string;\n \"--rmd-form-focus-color\"?: string;\n }\n}\n\n/**\n * The supported themes for the `TextField`, `TextArea`, and `Select`\n * components.\n *\n * - \"none\" - display as an unstyled text field without any border or background\n * colors.\n * - \"underline\" - display with only an underline that gains the form active\n * color and animates from the left or right to the other side when the field\n * is focused.\n * - \"filled\" - an extension of the `\"underline\"` state that will also have a\n * slightly dark background applied.\n * - \"outline\" - outlines the entire text field in a border and applies the\n * active color as box shadow when the field is focused.\n */\nexport type FormTheme = \"none\" | \"underline\" | \"filled\" | \"outline\";\n\n/**\n * The direction that the underline should appear from when the theme is\n * `\"underline\"` or `\"filled\"`.\n */\nexport type FormUnderlineDirection = \"left\" | \"center\" | \"right\";\n\nexport interface FormThemeOptions {\n /**\n * The current theme type.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n\n /**\n * The current underline direction.\n *\n * @defaultValue `\"left\"`\n */\n underlineDirection?: FormUnderlineDirection;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface FormConfiguration extends Required<FormThemeOptions> {\n /**\n * Set this to `false` if the `$disable-uncontrolled-input-toggles` variable\n * is set to `true` in the Sass configuration.\n *\n * Since the `checked` state only changes for the radio that has been clicked,\n * the previously checked radio would also be shown as checked with no way of\n * fixing it without controlling the radio component. When this flag is\n * enabled, the checked icons and state are handled through css instead of\n * `useState`.\n *\n * @defaultValue `true`\n */\n uncontrolledToggles: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport interface FormComponentStates {\n /** @defaultValue `false` */\n error?: boolean;\n\n /** @defaultValue `false` */\n active?: boolean;\n\n /** @defaultValue `false` */\n disabled?: boolean;\n\n /** @defaultValue `false` */\n readOnly?: boolean;\n}\n\n/**\n * @since 6.0.0\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n */\nexport type AutocompleteAttributeValue =\n | \"off\"\n | \"on\"\n | \"name\"\n | \"honorific-prefix\"\n | \"given-name\"\n | \"additional-name\"\n | \"family-name\"\n | \"honorific-suffix\"\n | \"nickname\"\n | \"email\"\n | \"username\"\n | \"new-password\"\n | \"current-password\"\n | \"one-time-code\"\n | \"organization-title\"\n | \"organization\"\n | \"street-address\"\n | \"address-line1\"\n | \"address-line2\"\n | \"address-line3\"\n | \"address-level1\"\n | \"address-level2\"\n | \"address-level3\"\n | \"address-level4\"\n | \"country\"\n | \"country-name\"\n | \"postal-code\"\n | \"cc-name\"\n | \"cc-given-name\"\n | \"cc-additional-name\"\n | \"cc-family-name\"\n | \"cc-number\"\n | \"cc-exp\"\n | \"cc-exp-month\"\n | \"cc-exp-year\"\n | \"cc-csc\"\n | \"cc-type\"\n | \"transaction-currency\"\n | \"transaction-amount\"\n | \"language\"\n | \"bday\"\n | \"bday-day\"\n | \"bday-month\"\n | \"bday-year\"\n | \"sex\"\n | \"tel\"\n | \"tel-country-code\"\n | \"tel-national\"\n | \"tek-area-code\"\n | \"tel-local\"\n | \"tel-extension\"\n | \"impp\"\n | \"url\"\n | \"photo\";\n\n/**\n * @since 6.0.0\n */\nexport interface UserAgentAutocompleteProps {\n /**\n * Set this to enable additional autocompletion suggestions for a user for\n * different form fields. Using this prop will update the\n * {@link UserAgentAutocompleteProps.name} and {@link autoComplete} to default to\n * this value.\n *\n * @example\n * ```tsx\n * <Form>\n * <TextField\n * label=\"Enter your credit card number\"\n * autoCompleteValue=\"cc-number\"\n * {...creditCardProps}\n * inputMode=\"number\"\n * />\n * <TextField\n * label=\"Name on card\"\n * autoCompleteValue=\"cc-name\"\n * {...creditCardNameProps}\n * />\n * <TextField\n * label=\"Security code\"\n * autoCompleteValue=\"cc-csc\"\n * {...securityCodeProps}\n * inputMode=\"number\"\n * />\n * <Button type=\"submit\">Submit</Button>\n * </Form>\n * ```\n *\n * @see https://html.spec.whatwg.org/multipage/forms.html#autofill\n * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete#values\n * @see {@link AutocompleteAttributeValue}\n * @see {@link autoComplete}\n * @see {@link UserAgentAutocompleteProps.name}\n */\n autoCompleteValue?: AutocompleteAttributeValue;\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n autoComplete?: InputHTMLAttributes<HTMLInputElement>[\"autoComplete\"];\n\n /**\n * @see {@link autoCompleteValue}\n * @defaultValue `autoCompleteValue`\n */\n name?: string;\n}\n\nexport interface FormMessageClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the message should gain the error state which changes the text\n * color to `red` by default.\n *\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * The current theme for the related text field. This is really only used to\n * match the current horizontal padding of the text field.\n *\n * @defaultValue `\"outline\"`\n */\n theme?: FormTheme;\n}\n\nexport interface FormMessageProps\n extends Omit<HTMLAttributes<HTMLDivElement>, \"minLength\" | \"maxLength\">,\n FormMessageClassNameOptions {\n /**\n * If this component is acting as a form-level error message handler, the role\n * should be updated to be `\"alert\"` for additional accessibility.\n *\n * Note: when creating a form-level error message handler, the messages should\n * no longer appear as the user types and instead once the user tries to\n * submit the form. Having an alert role disrupts normal screen reader\n * behavior by immediately reading changes in this element.\n *\n * @defaultValue `undefined`\n */\n role?: \"alert\";\n\n /**\n * Boolean if the children should no longer be wrapped in a `<p>` tag. This\n * should normally only be disabled if using a custom error message wrapper or\n * the counter behavior is not being used. To get correct alignments of the\n * message and counter, the `children` must be wrapped in some element and\n * cannot be plain test.\n *\n * Note: this will always be considered `true` if the `role` is set to\n * `\"alert\"`.\n *\n * @defaultValue `false`\n */\n disableWrap?: boolean;\n\n /**\n * An optional style to apply to the `<p>` tag that surrounds the `children`.\n * This will not be used if `role=\"alert\"` or `disableWrap={true}`.\n */\n messageStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the `<p>` tag that surrounds the\n * `children`. This will not be used if `role=\"alert\"` or\n * `disableWrap={true}`.\n */\n messageClassName?: string;\n}\n\n/**\n * Props that are used to automatically add a counter for the remaining letters\n * available for the text field. The counter will always be created to the right\n * of the optional message.\n *\n * The counter is really a simple string of: `${length} / ${maxLength}`.\n *\n * If you need additional customization, it is recommended to create your own\n * implementation such as:\n *\n * ```tsx\n * <FormMessage>\n * {errorMessage}\n * <MyCounter {...props} />\n * </FormMessage>\n * ```\n *\n * Note: this should not be used alongside form-level messages.\n *\n * @since 2.9.0 Renamed from `FormMessageCounterProps` to\n * `FormMessageInputLengthCounterProps` since a `FormMessageCounter` component\n * was added\n */\nexport interface FormMessageInputLengthCounterProps {\n /**\n * The current length of the value in the related text field.\n */\n length: number;\n\n /**\n * The max length allowed for the value in the related text field.\n */\n maxLength: number;\n\n /**\n * An optional style to apply to the counter wrapper element.\n */\n counterStyle?: CSSProperties;\n\n /**\n * An optional className to apply to the counter wrapper element.\n */\n counterClassName?: string;\n}\n\nexport interface FormMessageWithCounterProps\n extends FormMessageProps,\n FormMessageInputLengthCounterProps {}\n\n/**\n * @since 6.0.0\n */\nexport interface FormMessageWithoutCounterProps extends FormMessageProps {\n length?: never;\n maxLength?: never;\n counterStyle?: never;\n counterClassName?: never;\n}\n\nexport interface FormMessageContainerExtension {\n /**\n * If the extension doesn't actually want to render the `FormMessage`\n * component, these props are optional. It kind of eliminates the whole\n * purpose of this component though.\n */\n messageProps?: PropsWithRef<\n FormMessageProps & Partial<FormMessageInputLengthCounterProps>\n >;\n\n /**\n * Any props (and an optional ref) to provide to the `<div>` surrounding the\n * children and `FormMessage` component.\n *\n * Note: This will not be used if the `messageProps` are not provided since\n * only the `children` will be returned without the container.\n */\n messageContainerProps?: PropsWithRef<HTMLAttributes<HTMLDivElement>>;\n}\n\n/** @since 6.0.0 */\nexport interface LabelClassNameOptions {\n className?: string;\n\n /**\n * Set this to `true` to remove the `gap` style from the label.\n *\n * @see `$label-gap`\n * @defaultValue `false`\n */\n gap?: boolean;\n\n /**\n * Set this to `true` when the parent `TextFieldContainer` has the `dense`\n * spec enabled. This updates the floating styles to match the smaller height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the error color.\n *\n * @see `$error-color`\n * @defaultValue `false`\n */\n error?: boolean;\n\n /**\n * Set this to `true` to update the label's color to the active color.\n *\n * @see `$active-color`\n * @defaultValue `false`\n */\n active?: boolean;\n\n /**\n * Set this to `true` if the label should gain `flex-direction: column`\n * styling.\n *\n * @defaultValue `false`\n */\n stacked?: boolean;\n\n /**\n * Set this to `true` to update the label's color to be the disabled color.\n *\n * @see `$disabled-color`\n * @defaultValue `false`\n */\n disabled?: boolean;\n\n /**\n * Set this to true when label can floating above an input, textarea, or\n * select inside of a `TextFieldContainer`.\n *\n * @defaultValue `false`\n */\n floating?: boolean;\n\n /**\n * Set this to true when label is currently floating above an input,\n * textarea, or selected inside of a `TextFieldContainer`.\n *\n * @see {@link active}\n * @defaultValue `active`\n */\n floatingActive?: boolean;\n\n /**\n * Set this to `true` to gain `flex-direction: row-reversed` styling. If the\n * {@link stacked} prop is also `true`, `flex-direction: column-reversed` will\n * be applied.\n *\n * @defaultValue `false`\n */\n reversed?: boolean;\n\n /**\n * @defaultValue `false`\n */\n inactive?: boolean;\n}\n\nexport interface LabelProps\n extends LabelHTMLAttributes<HTMLLabelElement>,\n LabelClassNameOptions {}\n\n/**\n * @since 6.0.0\n */\nexport interface ConfigurableTextFieldAddonProps\n extends HTMLAttributes<HTMLSpanElement> {\n /**\n * Boolean if the addon should be presentational only and prevent pointer\n * events.\n *\n * @defaultValue `false`\n */\n pointerEvents?: boolean;\n}\n\n/**\n * @since 6.0.0 Split props into `ConfigurableTextFieldAddonProps`\n */\nexport interface TextFieldAddonProps extends ConfigurableTextFieldAddonProps {\n /**\n * @defaultValue `false`\n */\n after?: boolean;\n\n /**\n * Set this to `true` if the addon should not be wrapped in a `<span>` with some\n * additional styles.\n *\n * @defaultValue `false`\n */\n disabled?: boolean;\n}\n\n/**\n * @since 6.0.0 Renamed the `leftChildren` / `rightChildren` props to\n * `leftAddon` / `rightAddon`. Renamed `isLeftAddon` / `isRightAddon` to\n * `disableLeftAddonStyles` / `disableRightAddonStyles`. Added\n * `leftAddonProps` / `rightAddonProps`. Removed `stretch`\n */\nexport interface TextFieldContainerOptions\n extends FormThemeOptions,\n FormComponentStates {\n /**\n * Set this to `true` to enable the dense spec which reduces the height.\n *\n * @defaultValue `false`\n */\n dense?: boolean;\n\n /**\n * Set this to `true` to change the style from `display: flex` to\n * `display: inline-flex`.\n *\n * @defaultValue `false`\n */\n inline?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed before the\n * `TextField` or `TextArea`.\n */\n leftAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link leftAddon}.\n *\n * @since 6.0.0\n */\n leftAddonProps?: PropsWithRef<ConfigurableTextFieldAddonProps>;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableLeftAddonStyles?: boolean;\n\n /**\n * This should generally be an icon or a button that will be placed after the\n * `TextField` or `TextArea`.\n */\n rightAddon?: ReactNode;\n\n /**\n * Any additional props to pass to the `<span>` surrounding the {@link rightAddon}.\n *\n * @since 6.0.0\n */\n rightAddonProps?: PropsWithRef<ConfigurableTextFieldAddonProps>;\n\n /**\n * @see {@link TextFieldAddonProps.disabled}\n *\n * @defaultValue `false`\n */\n disableRightAddonStyles?: boolean;\n}\n\nexport interface FormFieldOptions\n extends TextFieldContainerOptions,\n FormMessageContainerExtension {\n /**\n * An optional floating label to use with the text field. A label is generally\n * recommended for accessibility, but can be omitted if an `aria-label` or\n * `aria-labelledby` is provided.\n */\n label?: ReactNode;\n\n /**\n * Any additional props and/or ref that should be passed to the `<label>`\n * element when a {@link label} is provided.\n *\n * @example\n * ```tsx\n * labelProps={{\n * ref: labelRef,\n * style: {},\n * className: \"some-custom-class-name\",\n * onClick: (event) => {\n * // do something\n * }\n * }}\n * ```\n */\n labelProps?: PropsWithRef<LabelProps>;\n\n /**\n * A convenience prop to apply a custom style to a label. This is equivalent\n * to:\n *\n * ```ts\n * labelProps={{\n * style: // some style here\n * }}\n * ```\n */\n labelStyle?: CSSProperties;\n\n /**\n * A convenience prop to apply a custom className to a label. This is\n * equivalent to:\n *\n * ```ts\n * labelProps={{\n * className: \"some-class-name\",\n * }}\n * ```\n */\n labelClassName?: string;\n}\n"],"names":[],"mappings":"AAuhBA,WAmDC"}
@@ -12,7 +12,7 @@ export interface LayoutAppBarProps extends AppBarProps {
12
12
  /**
13
13
  * Any additional props to pass to the {@link SkipToMainContent} component.
14
14
  */
15
- skipProps?: PropsWithRef<SkipToMainContentProps, HTMLAnchorElement>;
15
+ skipProps?: PropsWithRef<SkipToMainContentProps>;
16
16
  }
17
17
  /**
18
18
  * **Client Component**
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/layout/LayoutAppBar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\n\nimport {\n AppBar,\n type AppBarProps,\n type CustomAppBarComponent,\n} from \"../app-bar/AppBar.js\";\nimport {\n SkipToMainContent,\n type SkipToMainContentProps,\n} from \"../link/SkipToMainContent.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport { type CssPosition, type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useLayoutAppBarHeight } from \"./useLayoutAppBarHeight.js\";\n\n/**\n * @since 6.0.0 Only supports `AppBar` + `SkipToMainContent` props\n */\nexport interface LayoutAppBarProps extends AppBarProps {\n /** @defaultValue `\"header\"` */\n as?: CustomAppBarComponent;\n\n /** @defaultValue `\"fixed\"` */\n position?: CssPosition;\n\n /**\n * Any additional props to pass to the {@link SkipToMainContent} component.\n */\n skipProps?: PropsWithRef<SkipToMainContentProps, HTMLAnchorElement>;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to dynamically update the `--rmd-layout-header-offset`\n * based on the current height of this app bar. If you are concerned about\n * javascript bundle size, it is recommended to configure this variable in SCSS\n * instead.\n *\n * @example Static Height\n * ```scss\n * @use \"everything\";\n *\n * :root {\n * @include everything.layout-set-var(header-height, everything.$app-bar-height);\n * }\n * ```\n *\n * @example Media Query Height Changes\n * ```scss\n * @use \"everything\";\n *\n * :root {\n * @include everything.layout-set-var(header-height, everything.$app-bar-height);\n * @include everything.tablet-media {\n * @include everything.layout-set-var(header-height, everything.$app-bar-dense-height);\n * }\n * }\n * ```\n *\n * @see {@link https://react-md.dev/getting-started/layout | Layout Demos}\n * @since 6.0.0 This component no longer renders the `LayoutNavToggle` and\n * `LayoutAppBarTitle` since they no longer exist. The only purpose of this\n * component is to dynamically set the `--rmd-layout-header-height` variable.\n */\nexport const LayoutAppBar = forwardRef<HTMLDivElement, LayoutAppBarProps>(\n function LayoutAppBar(props, ref) {\n const {\n as = \"header\",\n id: propId,\n position = \"fixed\",\n skipProps,\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"layout-header\");\n const { appBarRef, variables } = useLayoutAppBarHeight(ref);\n useCSSVariables(variables);\n\n return (\n <AppBar\n {...remaining}\n id={id}\n as={as}\n ref={appBarRef}\n position={position}\n >\n <SkipToMainContent {...skipProps} />\n {children}\n </AppBar>\n );\n }\n);\n"],"names":["forwardRef","AppBar","SkipToMainContent","useCSSVariables","useEnsuredId","useLayoutAppBarHeight","LayoutAppBar","props","ref","as","id","propId","position","skipProps","children","remaining","appBarRef","variables"],"mappings":"AAAA;;AAEA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SACEC,MAAM,QAGD,uBAAuB;AAC9B,SACEC,iBAAiB,QAEZ,+BAA+B;AACtC,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,qBAAqB,QAAQ,6BAA6B;AAkBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,MAAMC,6BAAeN,WAC1B,SAASM,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,KAAK,QAAQ,EACbC,IAAIC,MAAM,EACVC,WAAW,OAAO,EAClBC,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IACJ,MAAMG,KAAKN,aAAaO,QAAQ;IAChC,MAAM,EAAEK,SAAS,EAAEC,SAAS,EAAE,GAAGZ,sBAAsBG;IACvDL,gBAAgBc;IAEhB,qBACE,MAAChB;QACE,GAAGc,SAAS;QACbL,IAAIA;QACJD,IAAIA;QACJD,KAAKQ;QACLJ,UAAUA;;0BAEV,KAACV;gBAAmB,GAAGW,SAAS;;YAC/BC;;;AAGP,GACA"}
1
+ {"version":3,"sources":["../../src/layout/LayoutAppBar.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef } from \"react\";\n\nimport {\n AppBar,\n type AppBarProps,\n type CustomAppBarComponent,\n} from \"../app-bar/AppBar.js\";\nimport {\n SkipToMainContent,\n type SkipToMainContentProps,\n} from \"../link/SkipToMainContent.js\";\nimport { useCSSVariables } from \"../theme/useCSSVariables.js\";\nimport { type CssPosition, type PropsWithRef } from \"../types.js\";\nimport { useEnsuredId } from \"../useEnsuredId.js\";\nimport { useLayoutAppBarHeight } from \"./useLayoutAppBarHeight.js\";\n\n/**\n * @since 6.0.0 Only supports `AppBar` + `SkipToMainContent` props\n */\nexport interface LayoutAppBarProps extends AppBarProps {\n /** @defaultValue `\"header\"` */\n as?: CustomAppBarComponent;\n\n /** @defaultValue `\"fixed\"` */\n position?: CssPosition;\n\n /**\n * Any additional props to pass to the {@link SkipToMainContent} component.\n */\n skipProps?: PropsWithRef<SkipToMainContentProps>;\n}\n\n/**\n * **Client Component**\n *\n * This component is used to dynamically update the `--rmd-layout-header-offset`\n * based on the current height of this app bar. If you are concerned about\n * javascript bundle size, it is recommended to configure this variable in SCSS\n * instead.\n *\n * @example Static Height\n * ```scss\n * @use \"everything\";\n *\n * :root {\n * @include everything.layout-set-var(header-height, everything.$app-bar-height);\n * }\n * ```\n *\n * @example Media Query Height Changes\n * ```scss\n * @use \"everything\";\n *\n * :root {\n * @include everything.layout-set-var(header-height, everything.$app-bar-height);\n * @include everything.tablet-media {\n * @include everything.layout-set-var(header-height, everything.$app-bar-dense-height);\n * }\n * }\n * ```\n *\n * @see {@link https://react-md.dev/getting-started/layout | Layout Demos}\n * @since 6.0.0 This component no longer renders the `LayoutNavToggle` and\n * `LayoutAppBarTitle` since they no longer exist. The only purpose of this\n * component is to dynamically set the `--rmd-layout-header-height` variable.\n */\nexport const LayoutAppBar = forwardRef<HTMLDivElement, LayoutAppBarProps>(\n function LayoutAppBar(props, ref) {\n const {\n as = \"header\",\n id: propId,\n position = \"fixed\",\n skipProps,\n children,\n ...remaining\n } = props;\n const id = useEnsuredId(propId, \"layout-header\");\n const { appBarRef, variables } = useLayoutAppBarHeight(ref);\n useCSSVariables(variables);\n\n return (\n <AppBar\n {...remaining}\n id={id}\n as={as}\n ref={appBarRef}\n position={position}\n >\n <SkipToMainContent {...skipProps} />\n {children}\n </AppBar>\n );\n }\n);\n"],"names":["forwardRef","AppBar","SkipToMainContent","useCSSVariables","useEnsuredId","useLayoutAppBarHeight","LayoutAppBar","props","ref","as","id","propId","position","skipProps","children","remaining","appBarRef","variables"],"mappings":"AAAA;;AAEA,SAASA,UAAU,QAAQ,QAAQ;AAEnC,SACEC,MAAM,QAGD,uBAAuB;AAC9B,SACEC,iBAAiB,QAEZ,+BAA+B;AACtC,SAASC,eAAe,QAAQ,8BAA8B;AAE9D,SAASC,YAAY,QAAQ,qBAAqB;AAClD,SAASC,qBAAqB,QAAQ,6BAA6B;AAkBnE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCC,GACD,OAAO,MAAMC,6BAAeN,WAC1B,SAASM,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,KAAK,QAAQ,EACbC,IAAIC,MAAM,EACVC,WAAW,OAAO,EAClBC,SAAS,EACTC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IACJ,MAAMG,KAAKN,aAAaO,QAAQ;IAChC,MAAM,EAAEK,SAAS,EAAEC,SAAS,EAAE,GAAGZ,sBAAsBG;IACvDL,gBAAgBc;IAEhB,qBACE,MAAChB;QACE,GAAGc,SAAS;QACbL,IAAIA;QACJD,IAAIA;QACJD,KAAKQ;QACLJ,UAAUA;;0BAEV,KAACV;gBAAmB,GAAGW,SAAS;;YAC/BC;;;AAGP,GACA"}
@@ -20,7 +20,7 @@ export interface ListItemLinkProps extends AnchorHTMLAttributes<HTMLAnchorElemen
20
20
  * Any additional props to provide the wrapping `<li>` element such as
21
21
  * `style`, `className`, and `ref`.
22
22
  */
23
- liProps?: PropsWithRef<HTMLAttributes<HTMLLIElement>, HTMLLIElement>;
23
+ liProps?: PropsWithRef<HTMLAttributes<HTMLLIElement>>;
24
24
  /**
25
25
  * @defaultValue `disabled ? -1 : undefined`
26
26
  */
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/list/ListItemLink.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { type ComponentWithRippleProps } from \"../interaction/types.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { useHigherContrastChildren } from \"../interaction/useHigherContrastChildren.js\";\nimport { type CustomLinkComponent } from \"../link/Link.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { ListItemChildren } from \"./ListItemChildren.js\";\nimport { getListItemHeight } from \"./getListItemHeight.js\";\nimport { type ListItemClassNameOptions, listItem } from \"./listItemStyles.js\";\nimport { type ListItemChildrenProps } from \"./types.js\";\n\nexport interface ListItemLinkProps\n extends AnchorHTMLAttributes<HTMLAnchorElement>,\n ListItemClassNameOptions,\n ListItemChildrenProps,\n ComponentWithRippleProps {\n /** @defaultValue `\"a\"` */\n as?: CustomLinkComponent;\n\n /**\n * This should only be used if the {@link as} {@link CustomLinkComponent}\n * accepts a `to` prop instead of {@link href}.\n */\n to?: string;\n\n /**\n * The link's href. Either this or the {@link to} prop **should** be provided.\n */\n href?: string;\n\n /**\n * Any additional props to provide the wrapping `<li>` element such as\n * `style`, `className`, and `ref`.\n */\n liProps?: PropsWithRef<HTMLAttributes<HTMLLIElement>, HTMLLIElement>;\n\n /**\n * @defaultValue `disabled ? -1 : undefined`\n */\n tabIndex?: number;\n}\n\n/**\n * **Client Component**\n *\n * The `ListItemLink` should be used to render links within the `List`, `Menu`,\n * or `DropdownMenu` components.\n *\n * @example Simple Example\n * ```tsx\n * import { List } from \"@react-md/core/list/list\";\n * import { ListItemLink } from \"@react-md/core/list/ListItemLink\";\n *\n * function Example() {\n * return (\n * <List>\n * <ListItemLink href=\"#\">Some Link</ListItemLink>\n * </List>\n * );\n * }\n * ```\n *\n * @example In Menus\n * ```tsx\n * import { ListItemLink } from \"@react-md/core/list/ListItemLink\";\n * import { DropdownMenu } from \"@react-md/core/menu/DropdownMenu\";\n *\n * function Example() {\n * return (\n * <DropdownMenu buttonChildren=\"Hello\">\n * <ListItemLink role=\"menuitem\" href=\"#\">Some Link</ListItemLink>\n * </List>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/list | List Demos}\n */\nexport const ListItemLink = forwardRef<HTMLAnchorElement, ListItemLinkProps>(\n function ListItemLink(props, ref) {\n const {\n as: Link = \"a\",\n to,\n href,\n className,\n liProps,\n textProps,\n textClassName,\n secondaryTextClassName,\n primaryText,\n secondaryText,\n secondaryTextProps,\n disableTextChildren = false,\n height: propHeight,\n leftAddon,\n leftAddonType = \"icon\",\n leftAddonPosition = \"middle\",\n leftAddonClassName,\n leftAddonForceWrap,\n rightAddon,\n rightAddonType = \"icon\",\n rightAddonPosition = \"middle\",\n rightAddonClassName,\n rightAddonForceWrap,\n disableLeftAddonCenteredMedia = false,\n disableRightAddonCenteredMedia = false,\n multiline = false,\n disabled = false,\n disabledOpacity = false,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n role,\n tabIndex = disabled || role === \"menuitem\" ? -1 : undefined,\n children: propChildren,\n disableRipple,\n ...remaining\n } = props;\n\n const { pressedClassName, ripples, handlers } = useElementInteraction({\n mode: disableRipple ? \"none\" : undefined,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n disabled,\n });\n const children = useHigherContrastChildren(\n propChildren,\n !disableTextChildren\n );\n\n const height = getListItemHeight({\n height: propHeight,\n leftAddon,\n leftAddonType,\n rightAddon,\n rightAddonType,\n secondaryText,\n });\n\n return (\n <li {...liProps} role=\"none\">\n <Link\n ref={ref}\n {...remaining}\n {...handlers}\n role={role}\n className={listItem({\n className,\n link: true,\n height,\n disabled,\n disabledOpacity,\n multiline,\n pressedClassName,\n })}\n // TODO: Figure out a better type for the CustomLinkComponent to fix this\n to={to as string}\n href={href as string}\n tabIndex={tabIndex}\n >\n <ListItemChildren\n multiline={multiline}\n textClassName={textClassName}\n secondaryTextClassName={secondaryTextClassName}\n disableTextChildren={disableTextChildren}\n primaryText={primaryText}\n textProps={textProps}\n secondaryText={secondaryText}\n secondaryTextProps={secondaryTextProps}\n leftAddon={leftAddon}\n leftAddonType={leftAddonType}\n leftAddonPosition={leftAddonPosition}\n leftAddonClassName={leftAddonClassName}\n leftAddonForceWrap={leftAddonForceWrap}\n rightAddon={rightAddon}\n rightAddonType={rightAddonType}\n rightAddonPosition={rightAddonPosition}\n rightAddonClassName={rightAddonClassName}\n rightAddonForceWrap={rightAddonForceWrap}\n disableLeftAddonCenteredMedia={disableLeftAddonCenteredMedia}\n disableRightAddonCenteredMedia={disableRightAddonCenteredMedia}\n >\n {children}\n </ListItemChildren>\n {ripples}\n </Link>\n </li>\n );\n }\n);\n"],"names":["forwardRef","useElementInteraction","useHigherContrastChildren","ListItemChildren","getListItemHeight","listItem","ListItemLink","props","ref","as","Link","to","href","className","liProps","textProps","textClassName","secondaryTextClassName","primaryText","secondaryText","secondaryTextProps","disableTextChildren","height","propHeight","leftAddon","leftAddonType","leftAddonPosition","leftAddonClassName","leftAddonForceWrap","rightAddon","rightAddonType","rightAddonPosition","rightAddonClassName","rightAddonForceWrap","disableLeftAddonCenteredMedia","disableRightAddonCenteredMedia","multiline","disabled","disabledOpacity","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onMouseLeave","onDragStart","onTouchStart","onTouchEnd","onTouchMove","role","tabIndex","undefined","children","propChildren","disableRipple","remaining","pressedClassName","ripples","handlers","mode","li","link"],"mappings":"AAAA;;AAEA,SAGEA,UAAU,QACL,QAAQ;AAGf,SAASC,qBAAqB,QAAQ,0CAA0C;AAChF,SAASC,yBAAyB,QAAQ,8CAA8C;AAGxF,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAAwCC,QAAQ,QAAQ,sBAAsB;AAkC9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,GACD,OAAO,MAAMC,6BAAeN,WAC1B,SAASM,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,IAAIC,OAAO,GAAG,EACdC,EAAE,EACFC,IAAI,EACJC,SAAS,EACTC,OAAO,EACPC,SAAS,EACTC,aAAa,EACbC,sBAAsB,EACtBC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,sBAAsB,KAAK,EAC3BC,QAAQC,UAAU,EAClBC,SAAS,EACTC,gBAAgB,MAAM,EACtBC,oBAAoB,QAAQ,EAC5BC,kBAAkB,EAClBC,kBAAkB,EAClBC,UAAU,EACVC,iBAAiB,MAAM,EACvBC,qBAAqB,QAAQ,EAC7BC,mBAAmB,EACnBC,mBAAmB,EACnBC,gCAAgC,KAAK,EACrCC,iCAAiC,KAAK,EACtCC,YAAY,KAAK,EACjBC,WAAW,KAAK,EAChBC,kBAAkB,KAAK,EACvBC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,IAAI,EACJC,WAAWd,YAAYa,SAAS,aAAa,CAAC,IAAIE,SAAS,EAC3DC,UAAUC,YAAY,EACtBC,aAAa,EACb,GAAGC,WACJ,GAAGjD;IAEJ,MAAM,EAAEkD,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAG1D,sBAAsB;QACpE2D,MAAML,gBAAgB,SAASH;QAC/Bb;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAZ;IACF;IACA,MAAMgB,WAAWnD,0BACfoD,cACA,CAACjC;IAGH,MAAMC,SAASlB,kBAAkB;QAC/BkB,QAAQC;QACRC;QACAC;QACAI;QACAC;QACAX;IACF;IAEA,qBACE,KAAC0C;QAAI,GAAG/C,OAAO;QAAEoC,MAAK;kBACpB,cAAA,MAACxC;YACCF,KAAKA;YACJ,GAAGgD,SAAS;YACZ,GAAGG,QAAQ;YACZT,MAAMA;YACNrC,WAAWR,SAAS;gBAClBQ;gBACAiD,MAAM;gBACNxC;gBACAe;gBACAC;gBACAF;gBACAqB;YACF;YACA,yEAAyE;YACzE9C,IAAIA;YACJC,MAAMA;YACNuC,UAAUA;;8BAEV,KAAChD;oBACCiC,WAAWA;oBACXpB,eAAeA;oBACfC,wBAAwBA;oBACxBI,qBAAqBA;oBACrBH,aAAaA;oBACbH,WAAWA;oBACXI,eAAeA;oBACfC,oBAAoBA;oBACpBI,WAAWA;oBACXC,eAAeA;oBACfC,mBAAmBA;oBACnBC,oBAAoBA;oBACpBC,oBAAoBA;oBACpBC,YAAYA;oBACZC,gBAAgBA;oBAChBC,oBAAoBA;oBACpBC,qBAAqBA;oBACrBC,qBAAqBA;oBACrBC,+BAA+BA;oBAC/BC,gCAAgCA;8BAE/BkB;;gBAEFK;;;;AAIT,GACA"}
1
+ {"version":3,"sources":["../../src/list/ListItemLink.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n type AnchorHTMLAttributes,\n type HTMLAttributes,\n forwardRef,\n} from \"react\";\n\nimport { type ComponentWithRippleProps } from \"../interaction/types.js\";\nimport { useElementInteraction } from \"../interaction/useElementInteraction.js\";\nimport { useHigherContrastChildren } from \"../interaction/useHigherContrastChildren.js\";\nimport { type CustomLinkComponent } from \"../link/Link.js\";\nimport { type PropsWithRef } from \"../types.js\";\nimport { ListItemChildren } from \"./ListItemChildren.js\";\nimport { getListItemHeight } from \"./getListItemHeight.js\";\nimport { type ListItemClassNameOptions, listItem } from \"./listItemStyles.js\";\nimport { type ListItemChildrenProps } from \"./types.js\";\n\nexport interface ListItemLinkProps\n extends AnchorHTMLAttributes<HTMLAnchorElement>,\n ListItemClassNameOptions,\n ListItemChildrenProps,\n ComponentWithRippleProps {\n /** @defaultValue `\"a\"` */\n as?: CustomLinkComponent;\n\n /**\n * This should only be used if the {@link as} {@link CustomLinkComponent}\n * accepts a `to` prop instead of {@link href}.\n */\n to?: string;\n\n /**\n * The link's href. Either this or the {@link to} prop **should** be provided.\n */\n href?: string;\n\n /**\n * Any additional props to provide the wrapping `<li>` element such as\n * `style`, `className`, and `ref`.\n */\n liProps?: PropsWithRef<HTMLAttributes<HTMLLIElement>>;\n\n /**\n * @defaultValue `disabled ? -1 : undefined`\n */\n tabIndex?: number;\n}\n\n/**\n * **Client Component**\n *\n * The `ListItemLink` should be used to render links within the `List`, `Menu`,\n * or `DropdownMenu` components.\n *\n * @example Simple Example\n * ```tsx\n * import { List } from \"@react-md/core/list/list\";\n * import { ListItemLink } from \"@react-md/core/list/ListItemLink\";\n *\n * function Example() {\n * return (\n * <List>\n * <ListItemLink href=\"#\">Some Link</ListItemLink>\n * </List>\n * );\n * }\n * ```\n *\n * @example In Menus\n * ```tsx\n * import { ListItemLink } from \"@react-md/core/list/ListItemLink\";\n * import { DropdownMenu } from \"@react-md/core/menu/DropdownMenu\";\n *\n * function Example() {\n * return (\n * <DropdownMenu buttonChildren=\"Hello\">\n * <ListItemLink role=\"menuitem\" href=\"#\">Some Link</ListItemLink>\n * </List>\n * );\n * }\n * ```\n *\n * @see {@link https://react-md.dev/components/list | List Demos}\n */\nexport const ListItemLink = forwardRef<HTMLAnchorElement, ListItemLinkProps>(\n function ListItemLink(props, ref) {\n const {\n as: Link = \"a\",\n to,\n href,\n className,\n liProps,\n textProps,\n textClassName,\n secondaryTextClassName,\n primaryText,\n secondaryText,\n secondaryTextProps,\n disableTextChildren = false,\n height: propHeight,\n leftAddon,\n leftAddonType = \"icon\",\n leftAddonPosition = \"middle\",\n leftAddonClassName,\n leftAddonForceWrap,\n rightAddon,\n rightAddonType = \"icon\",\n rightAddonPosition = \"middle\",\n rightAddonClassName,\n rightAddonForceWrap,\n disableLeftAddonCenteredMedia = false,\n disableRightAddonCenteredMedia = false,\n multiline = false,\n disabled = false,\n disabledOpacity = false,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n role,\n tabIndex = disabled || role === \"menuitem\" ? -1 : undefined,\n children: propChildren,\n disableRipple,\n ...remaining\n } = props;\n\n const { pressedClassName, ripples, handlers } = useElementInteraction({\n mode: disableRipple ? \"none\" : undefined,\n onBlur,\n onClick,\n onKeyDown,\n onKeyUp,\n onMouseDown,\n onMouseUp,\n onMouseLeave,\n onDragStart,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n disabled,\n });\n const children = useHigherContrastChildren(\n propChildren,\n !disableTextChildren\n );\n\n const height = getListItemHeight({\n height: propHeight,\n leftAddon,\n leftAddonType,\n rightAddon,\n rightAddonType,\n secondaryText,\n });\n\n return (\n <li {...liProps} role=\"none\">\n <Link\n ref={ref}\n {...remaining}\n {...handlers}\n role={role}\n className={listItem({\n className,\n link: true,\n height,\n disabled,\n disabledOpacity,\n multiline,\n pressedClassName,\n })}\n // TODO: Figure out a better type for the CustomLinkComponent to fix this\n to={to as string}\n href={href as string}\n tabIndex={tabIndex}\n >\n <ListItemChildren\n multiline={multiline}\n textClassName={textClassName}\n secondaryTextClassName={secondaryTextClassName}\n disableTextChildren={disableTextChildren}\n primaryText={primaryText}\n textProps={textProps}\n secondaryText={secondaryText}\n secondaryTextProps={secondaryTextProps}\n leftAddon={leftAddon}\n leftAddonType={leftAddonType}\n leftAddonPosition={leftAddonPosition}\n leftAddonClassName={leftAddonClassName}\n leftAddonForceWrap={leftAddonForceWrap}\n rightAddon={rightAddon}\n rightAddonType={rightAddonType}\n rightAddonPosition={rightAddonPosition}\n rightAddonClassName={rightAddonClassName}\n rightAddonForceWrap={rightAddonForceWrap}\n disableLeftAddonCenteredMedia={disableLeftAddonCenteredMedia}\n disableRightAddonCenteredMedia={disableRightAddonCenteredMedia}\n >\n {children}\n </ListItemChildren>\n {ripples}\n </Link>\n </li>\n );\n }\n);\n"],"names":["forwardRef","useElementInteraction","useHigherContrastChildren","ListItemChildren","getListItemHeight","listItem","ListItemLink","props","ref","as","Link","to","href","className","liProps","textProps","textClassName","secondaryTextClassName","primaryText","secondaryText","secondaryTextProps","disableTextChildren","height","propHeight","leftAddon","leftAddonType","leftAddonPosition","leftAddonClassName","leftAddonForceWrap","rightAddon","rightAddonType","rightAddonPosition","rightAddonClassName","rightAddonForceWrap","disableLeftAddonCenteredMedia","disableRightAddonCenteredMedia","multiline","disabled","disabledOpacity","onBlur","onClick","onKeyDown","onKeyUp","onMouseDown","onMouseUp","onMouseLeave","onDragStart","onTouchStart","onTouchEnd","onTouchMove","role","tabIndex","undefined","children","propChildren","disableRipple","remaining","pressedClassName","ripples","handlers","mode","li","link"],"mappings":"AAAA;;AAEA,SAGEA,UAAU,QACL,QAAQ;AAGf,SAASC,qBAAqB,QAAQ,0CAA0C;AAChF,SAASC,yBAAyB,QAAQ,8CAA8C;AAGxF,SAASC,gBAAgB,QAAQ,wBAAwB;AACzD,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAAwCC,QAAQ,QAAQ,sBAAsB;AAkC9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmCC,GACD,OAAO,MAAMC,6BAAeN,WAC1B,SAASM,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,IAAIC,OAAO,GAAG,EACdC,EAAE,EACFC,IAAI,EACJC,SAAS,EACTC,OAAO,EACPC,SAAS,EACTC,aAAa,EACbC,sBAAsB,EACtBC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,sBAAsB,KAAK,EAC3BC,QAAQC,UAAU,EAClBC,SAAS,EACTC,gBAAgB,MAAM,EACtBC,oBAAoB,QAAQ,EAC5BC,kBAAkB,EAClBC,kBAAkB,EAClBC,UAAU,EACVC,iBAAiB,MAAM,EACvBC,qBAAqB,QAAQ,EAC7BC,mBAAmB,EACnBC,mBAAmB,EACnBC,gCAAgC,KAAK,EACrCC,iCAAiC,KAAK,EACtCC,YAAY,KAAK,EACjBC,WAAW,KAAK,EAChBC,kBAAkB,KAAK,EACvBC,MAAM,EACNC,OAAO,EACPC,SAAS,EACTC,OAAO,EACPC,WAAW,EACXC,SAAS,EACTC,YAAY,EACZC,WAAW,EACXC,YAAY,EACZC,UAAU,EACVC,WAAW,EACXC,IAAI,EACJC,WAAWd,YAAYa,SAAS,aAAa,CAAC,IAAIE,SAAS,EAC3DC,UAAUC,YAAY,EACtBC,aAAa,EACb,GAAGC,WACJ,GAAGjD;IAEJ,MAAM,EAAEkD,gBAAgB,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAG1D,sBAAsB;QACpE2D,MAAML,gBAAgB,SAASH;QAC/Bb;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAC;QACAZ;IACF;IACA,MAAMgB,WAAWnD,0BACfoD,cACA,CAACjC;IAGH,MAAMC,SAASlB,kBAAkB;QAC/BkB,QAAQC;QACRC;QACAC;QACAI;QACAC;QACAX;IACF;IAEA,qBACE,KAAC0C;QAAI,GAAG/C,OAAO;QAAEoC,MAAK;kBACpB,cAAA,MAACxC;YACCF,KAAKA;YACJ,GAAGgD,SAAS;YACZ,GAAGG,QAAQ;YACZT,MAAMA;YACNrC,WAAWR,SAAS;gBAClBQ;gBACAiD,MAAM;gBACNxC;gBACAe;gBACAC;gBACAF;gBACAqB;YACF;YACA,yEAAyE;YACzE9C,IAAIA;YACJC,MAAMA;YACNuC,UAAUA;;8BAEV,KAAChD;oBACCiC,WAAWA;oBACXpB,eAAeA;oBACfC,wBAAwBA;oBACxBI,qBAAqBA;oBACrBH,aAAaA;oBACbH,WAAWA;oBACXI,eAAeA;oBACfC,oBAAoBA;oBACpBI,WAAWA;oBACXC,eAAeA;oBACfC,mBAAmBA;oBACnBC,oBAAoBA;oBACpBC,oBAAoBA;oBACpBC,YAAYA;oBACZC,gBAAgBA;oBAChBC,oBAAoBA;oBACpBC,qBAAqBA;oBACrBC,qBAAqBA;oBACrBC,+BAA+BA;oBAC/BC,gCAAgCA;8BAE/BkB;;gBAEFK;;;;AAIT,GACA"}
@@ -5,7 +5,7 @@ import { type PropsWithRef } from "../types.js";
5
5
  */
6
6
  export interface ListItemTextProps extends HTMLAttributes<HTMLSpanElement> {
7
7
  secondaryText?: ReactNode;
8
- secondaryTextProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
8
+ secondaryTextProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;
9
9
  /** @defaultValue `false` */
10
10
  secondaryTextClamped?: boolean;
11
11
  secondaryTextClassName?: string;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/list/ListItemText.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { listItemText } from \"./listItemStyles.js\";\n\n/**\n * @internal\n */\nexport interface ListItemTextProps extends HTMLAttributes<HTMLSpanElement> {\n secondaryText?: ReactNode;\n secondaryTextProps?: PropsWithRef<\n HTMLAttributes<HTMLSpanElement>,\n HTMLSpanElement\n >;\n\n /** @defaultValue `false` */\n secondaryTextClamped?: boolean;\n secondaryTextClassName?: string;\n}\n\n/**\n * This is mostly an internal component that can conditionally render secondary\n * text within list items.\n *\n * @internal\n */\nexport const ListItemText = forwardRef<HTMLSpanElement, ListItemTextProps>(\n function ListItemText(props, ref) {\n const {\n className,\n secondaryText,\n secondaryTextProps,\n secondaryTextClamped = false,\n secondaryTextClassName,\n children,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={listItemText({\n className,\n })}\n >\n {children}\n {secondaryText && (\n <span\n {...secondaryTextProps}\n className={listItemText({\n clamped: secondaryTextClamped,\n className: secondaryTextClassName,\n secondary: true,\n })}\n >\n {secondaryText}\n </span>\n )}\n </span>\n );\n }\n);\n"],"names":["forwardRef","listItemText","ListItemText","props","ref","className","secondaryText","secondaryTextProps","secondaryTextClamped","secondaryTextClassName","children","remaining","span","clamped","secondary"],"mappings":";AAAA,SAA8CA,UAAU,QAAQ,QAAQ;AAGxE,SAASC,YAAY,QAAQ,sBAAsB;AAiBnD;;;;;CAKC,GACD,OAAO,MAAMC,6BAAeF,WAC1B,SAASE,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,SAAS,EACTC,aAAa,EACbC,kBAAkB,EAClBC,uBAAuB,KAAK,EAC5BC,sBAAsB,EACtBC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IAEJ,qBACE,MAACS;QACE,GAAGD,SAAS;QACbP,KAAKA;QACLC,WAAWJ,aAAa;YACtBI;QACF;;YAECK;YACAJ,+BACC,KAACM;gBACE,GAAGL,kBAAkB;gBACtBF,WAAWJ,aAAa;oBACtBY,SAASL;oBACTH,WAAWI;oBACXK,WAAW;gBACb;0BAECR;;;;AAKX,GACA"}
1
+ {"version":3,"sources":["../../src/list/ListItemText.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, forwardRef } from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { listItemText } from \"./listItemStyles.js\";\n\n/**\n * @internal\n */\nexport interface ListItemTextProps extends HTMLAttributes<HTMLSpanElement> {\n secondaryText?: ReactNode;\n secondaryTextProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;\n\n /** @defaultValue `false` */\n secondaryTextClamped?: boolean;\n secondaryTextClassName?: string;\n}\n\n/**\n * This is mostly an internal component that can conditionally render secondary\n * text within list items.\n *\n * @internal\n */\nexport const ListItemText = forwardRef<HTMLSpanElement, ListItemTextProps>(\n function ListItemText(props, ref) {\n const {\n className,\n secondaryText,\n secondaryTextProps,\n secondaryTextClamped = false,\n secondaryTextClassName,\n children,\n ...remaining\n } = props;\n\n return (\n <span\n {...remaining}\n ref={ref}\n className={listItemText({\n className,\n })}\n >\n {children}\n {secondaryText && (\n <span\n {...secondaryTextProps}\n className={listItemText({\n clamped: secondaryTextClamped,\n className: secondaryTextClassName,\n secondary: true,\n })}\n >\n {secondaryText}\n </span>\n )}\n </span>\n );\n }\n);\n"],"names":["forwardRef","listItemText","ListItemText","props","ref","className","secondaryText","secondaryTextProps","secondaryTextClamped","secondaryTextClassName","children","remaining","span","clamped","secondary"],"mappings":";AAAA,SAA8CA,UAAU,QAAQ,QAAQ;AAGxE,SAASC,YAAY,QAAQ,sBAAsB;AAcnD;;;;;CAKC,GACD,OAAO,MAAMC,6BAAeF,WAC1B,SAASE,aAAaC,KAAK,EAAEC,GAAG;IAC9B,MAAM,EACJC,SAAS,EACTC,aAAa,EACbC,kBAAkB,EAClBC,uBAAuB,KAAK,EAC5BC,sBAAsB,EACtBC,QAAQ,EACR,GAAGC,WACJ,GAAGR;IAEJ,qBACE,MAACS;QACE,GAAGD,SAAS;QACbP,KAAKA;QACLC,WAAWJ,aAAa;YACtBI;QACF;;YAECK;YACAJ,+BACC,KAACM;gBACE,GAAGL,kBAAkB;gBACtBF,WAAWJ,aAAa;oBACtBY,SAASL;oBACTH,WAAWI;oBACXK,WAAW;gBACb;0BAECR;;;;AAKX,GACA"}
@@ -26,7 +26,7 @@ export interface ListSubheaderProps extends HTMLAttributes<HTMLLIElement>, ListS
26
26
  /**
27
27
  * @since 6.0.0
28
28
  */
29
- textProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
29
+ textProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;
30
30
  }
31
31
  /**
32
32
  * The `ListSubheader` is a wrapper for the `<li>` element to apply subheader
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/list/ListSubheader.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { ListItemText } from \"./ListItemText.js\";\n\nconst styles = bem(\"rmd-list-subheader\");\n\n/** @since 6.0.0 */\nexport interface ListSubheaderClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the subheader should be inset to match the `ListItem` text\n * keyline.\n *\n * @defaultValue `false`\n */\n inset?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function listSubheader(\n options: ListSubheaderClassNameOptions = {}\n): string {\n const { inset = false, className } = options;\n\n return cnb(styles({ inset }), className);\n}\n\n/**\n * @since 6.0.0 The `role` prop defaults to `\"presentation\"`\n */\nexport interface ListSubheaderProps\n extends HTMLAttributes<HTMLLIElement>,\n ListSubheaderClassNameOptions {\n /**\n * @defaultValue `\"presentation\"`\n */\n role?: HTMLAttributes<HTMLLIElement>[\"role\"];\n\n /**\n * @since 6.0.0\n */\n textProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;\n}\n\n/**\n * The `ListSubheader` is a wrapper for the `<li>` element to apply subheader\n * typography styles and {@link ListItemText} layout.\n *\n * @see {@link https://react-md.dev/components/list | List Demos}\n */\nexport const ListSubheader = forwardRef<HTMLLIElement, ListSubheaderProps>(\n function ListSubheader(props, ref) {\n const {\n role = \"presentation\",\n inset = false,\n className,\n children,\n textProps,\n ...remaining\n } = props;\n\n return (\n <li\n {...remaining}\n ref={ref}\n role={role}\n className={listSubheader({\n inset,\n className,\n })}\n >\n <ListItemText {...textProps}>{children}</ListItemText>\n </li>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","ListItemText","styles","listSubheader","options","inset","className","ListSubheader","props","ref","role","children","textProps","remaining","li"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAA8BC,UAAU,QAAQ,QAAQ;AAGxD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,MAAMC,SAASF,IAAI;AAenB;;CAEC,GACD,OAAO,SAASG,cACdC,UAAyC,CAAC,CAAC;IAE3C,MAAM,EAAEC,QAAQ,KAAK,EAAEC,SAAS,EAAE,GAAGF;IAErC,OAAON,IAAII,OAAO;QAAEG;IAAM,IAAIC;AAChC;AAmBA;;;;;CAKC,GACD,OAAO,MAAMC,8BAAgBR,WAC3B,SAASQ,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EACJC,OAAO,cAAc,EACrBL,QAAQ,KAAK,EACbC,SAAS,EACTK,QAAQ,EACRC,SAAS,EACT,GAAGC,WACJ,GAAGL;IAEJ,qBACE,KAACM;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,MAAMA;QACNJ,WAAWH,cAAc;YACvBE;YACAC;QACF;kBAEA,cAAA,KAACL;YAAc,GAAGW,SAAS;sBAAGD;;;AAGpC,GACA"}
1
+ {"version":3,"sources":["../../src/list/ListSubheader.tsx"],"sourcesContent":["import { cnb } from \"cnbuilder\";\nimport { type HTMLAttributes, forwardRef } from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\nimport { bem } from \"../utils/bem.js\";\nimport { ListItemText } from \"./ListItemText.js\";\n\nconst styles = bem(\"rmd-list-subheader\");\n\n/** @since 6.0.0 */\nexport interface ListSubheaderClassNameOptions {\n className?: string;\n\n /**\n * Boolean if the subheader should be inset to match the `ListItem` text\n * keyline.\n *\n * @defaultValue `false`\n */\n inset?: boolean;\n}\n\n/**\n * @since 6.0.0\n */\nexport function listSubheader(\n options: ListSubheaderClassNameOptions = {}\n): string {\n const { inset = false, className } = options;\n\n return cnb(styles({ inset }), className);\n}\n\n/**\n * @since 6.0.0 The `role` prop defaults to `\"presentation\"`\n */\nexport interface ListSubheaderProps\n extends HTMLAttributes<HTMLLIElement>,\n ListSubheaderClassNameOptions {\n /**\n * @defaultValue `\"presentation\"`\n */\n role?: HTMLAttributes<HTMLLIElement>[\"role\"];\n\n /**\n * @since 6.0.0\n */\n textProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;\n}\n\n/**\n * The `ListSubheader` is a wrapper for the `<li>` element to apply subheader\n * typography styles and {@link ListItemText} layout.\n *\n * @see {@link https://react-md.dev/components/list | List Demos}\n */\nexport const ListSubheader = forwardRef<HTMLLIElement, ListSubheaderProps>(\n function ListSubheader(props, ref) {\n const {\n role = \"presentation\",\n inset = false,\n className,\n children,\n textProps,\n ...remaining\n } = props;\n\n return (\n <li\n {...remaining}\n ref={ref}\n role={role}\n className={listSubheader({\n inset,\n className,\n })}\n >\n <ListItemText {...textProps}>{children}</ListItemText>\n </li>\n );\n }\n);\n"],"names":["cnb","forwardRef","bem","ListItemText","styles","listSubheader","options","inset","className","ListSubheader","props","ref","role","children","textProps","remaining","li"],"mappings":";AAAA,SAASA,GAAG,QAAQ,YAAY;AAChC,SAA8BC,UAAU,QAAQ,QAAQ;AAGxD,SAASC,GAAG,QAAQ,kBAAkB;AACtC,SAASC,YAAY,QAAQ,oBAAoB;AAEjD,MAAMC,SAASF,IAAI;AAenB;;CAEC,GACD,OAAO,SAASG,cACdC,UAAyC,CAAC,CAAC;IAE3C,MAAM,EAAEC,QAAQ,KAAK,EAAEC,SAAS,EAAE,GAAGF;IAErC,OAAON,IAAII,OAAO;QAAEG;IAAM,IAAIC;AAChC;AAmBA;;;;;CAKC,GACD,OAAO,MAAMC,8BAAgBR,WAC3B,SAASQ,cAAcC,KAAK,EAAEC,GAAG;IAC/B,MAAM,EACJC,OAAO,cAAc,EACrBL,QAAQ,KAAK,EACbC,SAAS,EACTK,QAAQ,EACRC,SAAS,EACT,GAAGC,WACJ,GAAGL;IAEJ,qBACE,KAACM;QACE,GAAGD,SAAS;QACbJ,KAAKA;QACLC,MAAMA;QACNJ,WAAWH,cAAc;YACvBE;YACAC;QACF;kBAEA,cAAA,KAACL;YAAc,GAAGW,SAAS;sBAAGD;;;AAGpC,GACA"}
@@ -137,7 +137,7 @@ export interface ListItemChildrenTextProps {
137
137
  *
138
138
  * @since 6.0.0
139
139
  */
140
- textProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
140
+ textProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;
141
141
  /**
142
142
  * An optional className to apply to the `<span>` that surrounds the
143
143
  * `primaryText` and optionally `secondaryText` within the list item.
@@ -177,7 +177,7 @@ export interface ListItemChildrenTextProps {
177
177
  *
178
178
  * @since 6.0.0
179
179
  */
180
- secondaryTextProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;
180
+ secondaryTextProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;
181
181
  /**
182
182
  * Set this to `true` to allow the {@link secondaryText} to span multiple
183
183
  * lines and use the CSS clamp after two lines of text are visible. The number
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/list/types.ts"],"sourcesContent":["import { type HTMLAttributes, type ReactNode } from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\n\n/**\n * The height to apply to the list item.\n *\n * Conversions:\n *\n * - height !== undefined && height !== \"auto\" -&gt; height\n * - secondaryText or left/right addon is media/media-large -&gt; \"extra-large\"\n * - left/right addon is avatar -&gt; \"large\"\n * - left/right addon is icon -&gt; \"medium\"\n * - no addons and no secondary text -&gt; \"normal\"\n */\nexport type ListItemHeight =\n | \"auto\"\n | \"normal\"\n | \"medium\"\n | \"large\"\n | \"extra-large\";\n\nexport type ListItemAddonPosition = \"top\" | \"middle\" | \"bottom\";\nexport type ListItemAddonType = \"icon\" | \"avatar\" | \"media\" | \"large-media\";\n\n/** @since 6.0.0 */\nexport interface ListItemChildrenAddonProps {\n /**\n * An optional addon to display to the left of the `primaryText` or\n * `children` and should be used with the `leftAddonType` prop to adjust\n * spacing.\n */\n leftAddon?: ReactNode;\n\n /**\n * The type of the addon that appears to the left of the `primaryText` or\n * `children`.\n *\n * @defaultValue `\"icon\"`\n */\n leftAddonType?: ListItemAddonType;\n\n /**\n * The vertical position the left icon, avatar, media, or large media\n * should be placed.\n *\n * @defaultValue `\"middle\"`\n */\n leftAddonPosition?: ListItemAddonPosition;\n\n /**\n * @since 6.0.0\n */\n leftAddonClassName?: string;\n\n /**\n * Set this to `true` if your addon does not accept a `className` prop to\n * apply the correct styling.\n *\n * @defaultValue `leftAddonType === \"media\" || leftAddonType === \"large-media\"`\n * @since 6.0.0\n */\n leftAddonForceWrap?: boolean;\n\n /**\n * Set this to `true` to disable the additional spacing applied to the addons\n * that appear before the `children` and the normal `--rmd-text-icon-spacing`\n * value is used instead.\n *\n * @defaultValue `false`\n */\n disableLeftAddonSpacing?: boolean;\n\n /**\n * An optional addon to display to the right of the `primaryText` or\n * `children` and should be used with the `rightAddonType` prop to adjust\n * spacing.\n */\n rightAddon?: ReactNode;\n\n /**\n * The type of the addon that appears to the right of the `primaryText` or\n * `children`.\n *\n * @defaultValue `\"icon\"`\n */\n rightAddonType?: ListItemAddonType;\n\n /**\n * The vertical position the right icon, avatar, media, or large media\n * should be placed.\n *\n * @defaultValue `\"middle\"`\n */\n rightAddonPosition?: ListItemAddonPosition;\n\n /**\n * @since 6.0.0\n */\n rightAddonClassName?: string;\n\n /**\n * Set this to `true` if your addon does not accept a `className` prop to\n * apply the correct styling.\n *\n * @defaultValue `rightAddonType === \"media\" || rightAddonType === \"large-media\"`\n * @since 6.0.0\n */\n rightAddonForceWrap?: boolean;\n\n /**\n * The media items are centered by default using:\n * ```scss\n * align-items: center;\n * display: flex;\n * justify-content: center;\n * ```\n *\n * When this is set to `true`, the flex styles will not be applied.\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n disableLeftAddonCenteredMedia?: boolean;\n\n /**\n * The media items are centered by default using:\n * ```scss\n * align-items: center;\n * display: flex;\n * justify-content: center;\n * ```\n *\n * When this is set to `true`, the flex styles will not be applied.\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n disableRightAddonCenteredMedia?: boolean;\n}\n\n/**\n * Note: This interface was added since there are components that replace the\n * {@link ListItemChildrenAddonProps} with renamed versions but should still\n * support everything for rendering text.\n *\n * @since 6.0.0\n */\nexport interface ListItemChildrenTextProps {\n /**\n * The main content to display that defaults to being wrapped in the\n * `ListItemText` component. Enable the {@link disableTextChildren} prop to\n * render without the additional `ListItemText` wrapper.\n */\n children?: ReactNode;\n\n /**\n * Any additional props that should be passed to the `<span>` surrounding\n * the {@link children}, {@link primaryText}, and {@link secondaryText}.\n *\n * @since 6.0.0\n */\n textProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>;\n\n /**\n * An optional className to apply to the `<span>` that surrounds the\n * `primaryText` and optionally `secondaryText` within the list item.\n */\n textClassName?: string;\n\n /**\n * An optional className to apply to the `<span>` that surrounds the\n * `secondaryText` within the list item.\n */\n secondaryTextClassName?: string;\n\n /**\n * Set this to `true` if the {@link children} should not automatically be\n * wrapped in the `ListItemText` component.\n *\n * @since 6.0.0 Renamed from `textChildren` since it was defaulted on.\n * @defaultValue `false`\n */\n disableTextChildren?: boolean;\n\n /**\n * An optional element that should be rendered as the `primaryText` within the\n * list item. It is most likely easier to use the `children` prop instead, but\n * this allows you to create more complex components with the `ListItem` since\n * you can provided `children` and have the styles for the `primaryText` still\n * applied. By default, this will only allow one line of text and add ellipsis\n * for any text overflow.\n */\n primaryText?: ReactNode;\n\n /**\n * An optional element that should be rendered as the `secondaryText` within\n * the list item. By default, this will only span one line and add ellipsis\n * for overflow.\n */\n secondaryText?: ReactNode;\n\n /**\n * Any additional props that should be passed to the `<span>` surrounding\n * the {@link secondaryText}.\n *\n * @since 6.0.0\n */\n secondaryTextProps?: PropsWithRef<\n HTMLAttributes<HTMLSpanElement>,\n HTMLSpanElement\n >;\n\n /**\n * Set this to `true` to allow the {@link secondaryText} to span multiple\n * lines and use the CSS clamp after two lines of text are visible. The number\n * of lines can be configured by `core.$list-item-multiline-clamp` or\n * `@include core.list-set-var(item-multiline-clamp, $new-value)`.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-line-clamp}\n * @defaultValue `false`\n */\n multiline?: boolean;\n}\n\n/**\n * @since 6.0.0 Extends the `ListItemChildrenTextProps` and\n * `ListItemChildrenAddonProps` interfaces.\n * @since 6.0.0 Added `textProps` and `secondaryTextClassName`\n * @since 6.0.0 Renamed `textChildren` to `disableTextChildren`\n */\nexport interface ListItemChildrenProps\n extends ListItemChildrenTextProps,\n ListItemChildrenAddonProps {}\n"],"names":[],"mappings":"AAiOA;;;;;CAKC,GACD,WAEiC"}
1
+ {"version":3,"sources":["../../src/list/types.ts"],"sourcesContent":["import { type HTMLAttributes, type ReactNode } from \"react\";\n\nimport { type PropsWithRef } from \"../types.js\";\n\n/**\n * The height to apply to the list item.\n *\n * Conversions:\n *\n * - height !== undefined && height !== \"auto\" -&gt; height\n * - secondaryText or left/right addon is media/media-large -&gt; \"extra-large\"\n * - left/right addon is avatar -&gt; \"large\"\n * - left/right addon is icon -&gt; \"medium\"\n * - no addons and no secondary text -&gt; \"normal\"\n */\nexport type ListItemHeight =\n | \"auto\"\n | \"normal\"\n | \"medium\"\n | \"large\"\n | \"extra-large\";\n\nexport type ListItemAddonPosition = \"top\" | \"middle\" | \"bottom\";\nexport type ListItemAddonType = \"icon\" | \"avatar\" | \"media\" | \"large-media\";\n\n/** @since 6.0.0 */\nexport interface ListItemChildrenAddonProps {\n /**\n * An optional addon to display to the left of the `primaryText` or\n * `children` and should be used with the `leftAddonType` prop to adjust\n * spacing.\n */\n leftAddon?: ReactNode;\n\n /**\n * The type of the addon that appears to the left of the `primaryText` or\n * `children`.\n *\n * @defaultValue `\"icon\"`\n */\n leftAddonType?: ListItemAddonType;\n\n /**\n * The vertical position the left icon, avatar, media, or large media\n * should be placed.\n *\n * @defaultValue `\"middle\"`\n */\n leftAddonPosition?: ListItemAddonPosition;\n\n /**\n * @since 6.0.0\n */\n leftAddonClassName?: string;\n\n /**\n * Set this to `true` if your addon does not accept a `className` prop to\n * apply the correct styling.\n *\n * @defaultValue `leftAddonType === \"media\" || leftAddonType === \"large-media\"`\n * @since 6.0.0\n */\n leftAddonForceWrap?: boolean;\n\n /**\n * Set this to `true` to disable the additional spacing applied to the addons\n * that appear before the `children` and the normal `--rmd-text-icon-spacing`\n * value is used instead.\n *\n * @defaultValue `false`\n */\n disableLeftAddonSpacing?: boolean;\n\n /**\n * An optional addon to display to the right of the `primaryText` or\n * `children` and should be used with the `rightAddonType` prop to adjust\n * spacing.\n */\n rightAddon?: ReactNode;\n\n /**\n * The type of the addon that appears to the right of the `primaryText` or\n * `children`.\n *\n * @defaultValue `\"icon\"`\n */\n rightAddonType?: ListItemAddonType;\n\n /**\n * The vertical position the right icon, avatar, media, or large media\n * should be placed.\n *\n * @defaultValue `\"middle\"`\n */\n rightAddonPosition?: ListItemAddonPosition;\n\n /**\n * @since 6.0.0\n */\n rightAddonClassName?: string;\n\n /**\n * Set this to `true` if your addon does not accept a `className` prop to\n * apply the correct styling.\n *\n * @defaultValue `rightAddonType === \"media\" || rightAddonType === \"large-media\"`\n * @since 6.0.0\n */\n rightAddonForceWrap?: boolean;\n\n /**\n * The media items are centered by default using:\n * ```scss\n * align-items: center;\n * display: flex;\n * justify-content: center;\n * ```\n *\n * When this is set to `true`, the flex styles will not be applied.\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n disableLeftAddonCenteredMedia?: boolean;\n\n /**\n * The media items are centered by default using:\n * ```scss\n * align-items: center;\n * display: flex;\n * justify-content: center;\n * ```\n *\n * When this is set to `true`, the flex styles will not be applied.\n *\n * @defaultValue `false`\n * @since 6.0.0\n */\n disableRightAddonCenteredMedia?: boolean;\n}\n\n/**\n * Note: This interface was added since there are components that replace the\n * {@link ListItemChildrenAddonProps} with renamed versions but should still\n * support everything for rendering text.\n *\n * @since 6.0.0\n */\nexport interface ListItemChildrenTextProps {\n /**\n * The main content to display that defaults to being wrapped in the\n * `ListItemText` component. Enable the {@link disableTextChildren} prop to\n * render without the additional `ListItemText` wrapper.\n */\n children?: ReactNode;\n\n /**\n * Any additional props that should be passed to the `<span>` surrounding\n * the {@link children}, {@link primaryText}, and {@link secondaryText}.\n *\n * @since 6.0.0\n */\n textProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;\n\n /**\n * An optional className to apply to the `<span>` that surrounds the\n * `primaryText` and optionally `secondaryText` within the list item.\n */\n textClassName?: string;\n\n /**\n * An optional className to apply to the `<span>` that surrounds the\n * `secondaryText` within the list item.\n */\n secondaryTextClassName?: string;\n\n /**\n * Set this to `true` if the {@link children} should not automatically be\n * wrapped in the `ListItemText` component.\n *\n * @since 6.0.0 Renamed from `textChildren` since it was defaulted on.\n * @defaultValue `false`\n */\n disableTextChildren?: boolean;\n\n /**\n * An optional element that should be rendered as the `primaryText` within the\n * list item. It is most likely easier to use the `children` prop instead, but\n * this allows you to create more complex components with the `ListItem` since\n * you can provided `children` and have the styles for the `primaryText` still\n * applied. By default, this will only allow one line of text and add ellipsis\n * for any text overflow.\n */\n primaryText?: ReactNode;\n\n /**\n * An optional element that should be rendered as the `secondaryText` within\n * the list item. By default, this will only span one line and add ellipsis\n * for overflow.\n */\n secondaryText?: ReactNode;\n\n /**\n * Any additional props that should be passed to the `<span>` surrounding\n * the {@link secondaryText}.\n *\n * @since 6.0.0\n */\n secondaryTextProps?: PropsWithRef<HTMLAttributes<HTMLSpanElement>>;\n\n /**\n * Set this to `true` to allow the {@link secondaryText} to span multiple\n * lines and use the CSS clamp after two lines of text are visible. The number\n * of lines can be configured by `core.$list-item-multiline-clamp` or\n * `@include core.list-set-var(item-multiline-clamp, $new-value)`.\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-line-clamp}\n * @defaultValue `false`\n */\n multiline?: boolean;\n}\n\n/**\n * @since 6.0.0 Extends the `ListItemChildrenTextProps` and\n * `ListItemChildrenAddonProps` interfaces.\n * @since 6.0.0 Added `textProps` and `secondaryTextClassName`\n * @since 6.0.0 Renamed `textChildren` to `disableTextChildren`\n */\nexport interface ListItemChildrenProps\n extends ListItemChildrenTextProps,\n ListItemChildrenAddonProps {}\n"],"names":[],"mappings":"AA8NA;;;;;CAKC,GACD,WAEiC"}
@@ -1,6 +1,6 @@
1
1
  import { type CSSProperties, type HTMLAttributes } from "react";
2
2
  import { type FloatingActionButtonPosition } from "../button/FloatingActionButton.js";
3
- import { type ListElement, type ListProps } from "../list/List.js";
3
+ import { type ListProps } from "../list/List.js";
4
4
  import { type GetDefaultFocusedIndex } from "../movement/types.js";
5
5
  import { type CalculateFixedPositionOptions } from "../positioning/types.js";
6
6
  import { type FixedPositioningOptions } from "../positioning/useFixedPositioning.js";
@@ -96,7 +96,7 @@ export interface MenuListConvenienceProps {
96
96
  * Any additional props to pass to the `List` component that surrounds the
97
97
  * `Menu`'s `MenuItem`s.
98
98
  */
99
- listProps?: PropsWithRef<Omit<ListProps, "horizontal">, ListElement>;
99
+ listProps?: PropsWithRef<Omit<ListProps, "horizontal">>;
100
100
  }
101
101
  /**
102
102
  * @since 6.0.0
@@ -124,7 +124,7 @@ export interface MenuConvenienceProps extends MenuConfigurationProps {
124
124
  * />
125
125
  * ```
126
126
  */
127
- menuProps?: PropsWithRef<Omit<MenuProps, "children" | "fixedTo" | "visible" | "onRequestClose" | "getDefaultFocusedIndex">, HTMLDivElement>;
127
+ menuProps?: PropsWithRef<Omit<MenuProps, "children" | "fixedTo" | "visible" | "onRequestClose" | "getDefaultFocusedIndex">>;
128
128
  /**
129
129
  * Convenience prop to apply custom style to the `Menu` component.
130
130
  */