@react-spectrum/s2 3.0.0-nightly-4baa1b08e-241029 → 3.0.0-nightly-07431f4b1-241030

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 (265) hide show
  1. package/dist/ActionButton.cjs +10 -32
  2. package/dist/ActionButton.cjs.map +1 -1
  3. package/dist/ActionButton.css +20 -60
  4. package/dist/ActionButton.css.map +1 -1
  5. package/dist/ActionButton.mjs +10 -32
  6. package/dist/ActionButton.mjs.map +1 -1
  7. package/dist/Avatar.cjs +2 -4
  8. package/dist/Avatar.cjs.map +1 -1
  9. package/dist/Avatar.css +4 -16
  10. package/dist/Avatar.css.map +1 -1
  11. package/dist/Avatar.mjs +2 -4
  12. package/dist/Avatar.mjs.map +1 -1
  13. package/dist/Badge.cjs +5 -16
  14. package/dist/Badge.cjs.map +1 -1
  15. package/dist/Badge.css +10 -30
  16. package/dist/Badge.css.map +1 -1
  17. package/dist/Badge.mjs +5 -16
  18. package/dist/Badge.mjs.map +1 -1
  19. package/dist/Breadcrumbs.cjs +12 -41
  20. package/dist/Breadcrumbs.cjs.map +1 -1
  21. package/dist/Breadcrumbs.css +38 -86
  22. package/dist/Breadcrumbs.css.map +1 -1
  23. package/dist/Breadcrumbs.mjs +12 -41
  24. package/dist/Breadcrumbs.mjs.map +1 -1
  25. package/dist/Button.cjs +19 -59
  26. package/dist/Button.cjs.map +1 -1
  27. package/dist/Button.css +37 -113
  28. package/dist/Button.css.map +1 -1
  29. package/dist/Button.mjs +19 -59
  30. package/dist/Button.mjs.map +1 -1
  31. package/dist/Card.cjs +27 -67
  32. package/dist/Card.cjs.map +1 -1
  33. package/dist/Card.css +42 -117
  34. package/dist/Card.css.map +1 -1
  35. package/dist/Card.mjs +27 -67
  36. package/dist/Card.mjs.map +1 -1
  37. package/dist/Checkbox.cjs +9 -27
  38. package/dist/Checkbox.cjs.map +1 -1
  39. package/dist/Checkbox.css +17 -49
  40. package/dist/Checkbox.css.map +1 -1
  41. package/dist/Checkbox.mjs +9 -27
  42. package/dist/Checkbox.mjs.map +1 -1
  43. package/dist/CheckboxGroup.cjs +5 -16
  44. package/dist/CheckboxGroup.cjs.map +1 -1
  45. package/dist/CheckboxGroup.css +10 -30
  46. package/dist/CheckboxGroup.css.map +1 -1
  47. package/dist/CheckboxGroup.mjs +5 -16
  48. package/dist/CheckboxGroup.mjs.map +1 -1
  49. package/dist/ClearButton.cjs +6 -17
  50. package/dist/ClearButton.cjs.map +1 -1
  51. package/dist/ClearButton.css +11 -35
  52. package/dist/ClearButton.css.map +1 -1
  53. package/dist/ClearButton.mjs +6 -17
  54. package/dist/ClearButton.mjs.map +1 -1
  55. package/dist/CloseButton.cjs +10 -32
  56. package/dist/CloseButton.cjs.map +1 -1
  57. package/dist/CloseButton.css +20 -64
  58. package/dist/CloseButton.css.map +1 -1
  59. package/dist/CloseButton.mjs +10 -32
  60. package/dist/CloseButton.mjs.map +1 -1
  61. package/dist/ColorArea.cjs +4 -16
  62. package/dist/ColorArea.cjs.map +1 -1
  63. package/dist/ColorArea.css +8 -28
  64. package/dist/ColorArea.css.map +1 -1
  65. package/dist/ColorArea.mjs +4 -16
  66. package/dist/ColorArea.mjs.map +1 -1
  67. package/dist/ColorField.cjs +5 -16
  68. package/dist/ColorField.cjs.map +1 -1
  69. package/dist/ColorField.css +10 -30
  70. package/dist/ColorField.css.map +1 -1
  71. package/dist/ColorField.mjs +5 -16
  72. package/dist/ColorField.mjs.map +1 -1
  73. package/dist/ColorHandle.cjs +5 -15
  74. package/dist/ColorHandle.cjs.map +1 -1
  75. package/dist/ColorHandle.css +10 -30
  76. package/dist/ColorHandle.css.map +1 -1
  77. package/dist/ColorHandle.mjs +5 -15
  78. package/dist/ColorHandle.mjs.map +1 -1
  79. package/dist/ColorSlider.cjs +6 -17
  80. package/dist/ColorSlider.cjs.map +1 -1
  81. package/dist/ColorSlider.css +34 -50
  82. package/dist/ColorSlider.css.map +1 -1
  83. package/dist/ColorSlider.mjs +6 -17
  84. package/dist/ColorSlider.mjs.map +1 -1
  85. package/dist/ColorSwatch.cjs +8 -26
  86. package/dist/ColorSwatch.cjs.map +1 -1
  87. package/dist/ColorSwatch.css +16 -52
  88. package/dist/ColorSwatch.css.map +1 -1
  89. package/dist/ColorSwatch.mjs +8 -26
  90. package/dist/ColorSwatch.mjs.map +1 -1
  91. package/dist/ColorSwatchPicker.cjs +6 -16
  92. package/dist/ColorSwatchPicker.cjs.map +1 -1
  93. package/dist/ColorSwatchPicker.css +8 -28
  94. package/dist/ColorSwatchPicker.css.map +1 -1
  95. package/dist/ColorSwatchPicker.mjs +6 -16
  96. package/dist/ColorSwatchPicker.mjs.map +1 -1
  97. package/dist/ComboBox.cjs +22 -71
  98. package/dist/ComboBox.cjs.map +1 -1
  99. package/dist/ComboBox.css +64 -152
  100. package/dist/ComboBox.css.map +1 -1
  101. package/dist/ComboBox.mjs +22 -71
  102. package/dist/ComboBox.mjs.map +1 -1
  103. package/dist/ContextualHelp.cjs +1 -1
  104. package/dist/ContextualHelp.css +2 -6
  105. package/dist/ContextualHelp.css.map +1 -1
  106. package/dist/ContextualHelp.mjs +1 -1
  107. package/dist/Dialog.cjs +2 -2
  108. package/dist/Dialog.css +2 -2
  109. package/dist/Dialog.mjs +2 -2
  110. package/dist/Disclosure.cjs +22 -61
  111. package/dist/Disclosure.cjs.map +1 -1
  112. package/dist/Disclosure.css +47 -91
  113. package/dist/Disclosure.css.map +1 -1
  114. package/dist/Disclosure.mjs +22 -61
  115. package/dist/Disclosure.mjs.map +1 -1
  116. package/dist/DropZone.cjs +2 -4
  117. package/dist/DropZone.cjs.map +1 -1
  118. package/dist/DropZone.css +4 -16
  119. package/dist/DropZone.css.map +1 -1
  120. package/dist/DropZone.mjs +2 -4
  121. package/dist/DropZone.mjs.map +1 -1
  122. package/dist/Field.cjs +16 -47
  123. package/dist/Field.cjs.map +1 -1
  124. package/dist/Field.css +31 -95
  125. package/dist/Field.css.map +1 -1
  126. package/dist/Field.mjs +16 -47
  127. package/dist/Field.mjs.map +1 -1
  128. package/dist/IllustratedMessage.cjs +6 -20
  129. package/dist/IllustratedMessage.cjs.map +1 -1
  130. package/dist/IllustratedMessage.css +10 -24
  131. package/dist/IllustratedMessage.css.map +1 -1
  132. package/dist/IllustratedMessage.mjs +6 -20
  133. package/dist/IllustratedMessage.mjs.map +1 -1
  134. package/dist/Image.cjs +2 -2
  135. package/dist/Image.css +2 -2
  136. package/dist/Image.mjs +2 -2
  137. package/dist/InlineAlert.cjs +2 -5
  138. package/dist/InlineAlert.cjs.map +1 -1
  139. package/dist/InlineAlert.css +11 -15
  140. package/dist/InlineAlert.css.map +1 -1
  141. package/dist/InlineAlert.mjs +2 -5
  142. package/dist/InlineAlert.mjs.map +1 -1
  143. package/dist/Menu.cjs +22 -67
  144. package/dist/Menu.cjs.map +1 -1
  145. package/dist/Menu.css +32 -96
  146. package/dist/Menu.css.map +1 -1
  147. package/dist/Menu.mjs +22 -67
  148. package/dist/Menu.mjs.map +1 -1
  149. package/dist/Meter.cjs +22 -68
  150. package/dist/Meter.cjs.map +1 -1
  151. package/dist/Meter.css +63 -139
  152. package/dist/Meter.css.map +1 -1
  153. package/dist/Meter.mjs +22 -68
  154. package/dist/Meter.mjs.map +1 -1
  155. package/dist/Modal.cjs +2 -2
  156. package/dist/Modal.css +2 -2
  157. package/dist/Modal.mjs +2 -2
  158. package/dist/NumberField.cjs +23 -71
  159. package/dist/NumberField.cjs.map +1 -1
  160. package/dist/NumberField.css +63 -146
  161. package/dist/NumberField.css.map +1 -1
  162. package/dist/NumberField.mjs +23 -71
  163. package/dist/NumberField.mjs.map +1 -1
  164. package/dist/Picker.cjs +23 -67
  165. package/dist/Picker.cjs.map +1 -1
  166. package/dist/Picker.css +50 -130
  167. package/dist/Picker.css.map +1 -1
  168. package/dist/Picker.mjs +23 -67
  169. package/dist/Picker.mjs.map +1 -1
  170. package/dist/ProgressBar.cjs +23 -69
  171. package/dist/ProgressBar.cjs.map +1 -1
  172. package/dist/ProgressBar.css +64 -140
  173. package/dist/ProgressBar.css.map +1 -1
  174. package/dist/ProgressBar.mjs +23 -69
  175. package/dist/ProgressBar.mjs.map +1 -1
  176. package/dist/ProgressCircle.cjs +6 -20
  177. package/dist/ProgressCircle.cjs.map +1 -1
  178. package/dist/ProgressCircle.css +12 -40
  179. package/dist/ProgressCircle.css.map +1 -1
  180. package/dist/ProgressCircle.mjs +6 -20
  181. package/dist/ProgressCircle.mjs.map +1 -1
  182. package/dist/Provider.css +7 -0
  183. package/dist/Provider.css.map +1 -1
  184. package/dist/Radio.cjs +8 -26
  185. package/dist/Radio.cjs.map +1 -1
  186. package/dist/Radio.css +16 -48
  187. package/dist/Radio.css.map +1 -1
  188. package/dist/Radio.mjs +8 -26
  189. package/dist/Radio.mjs.map +1 -1
  190. package/dist/RadioGroup.cjs +5 -16
  191. package/dist/RadioGroup.cjs.map +1 -1
  192. package/dist/RadioGroup.css +10 -30
  193. package/dist/RadioGroup.css.map +1 -1
  194. package/dist/RadioGroup.mjs +5 -16
  195. package/dist/RadioGroup.mjs.map +1 -1
  196. package/dist/SearchField.cjs +5 -16
  197. package/dist/SearchField.cjs.map +1 -1
  198. package/dist/SearchField.css +10 -30
  199. package/dist/SearchField.css.map +1 -1
  200. package/dist/SearchField.mjs +5 -16
  201. package/dist/SearchField.mjs.map +1 -1
  202. package/dist/SegmentedControl.cjs +8 -14
  203. package/dist/SegmentedControl.cjs.map +1 -1
  204. package/dist/SegmentedControl.css +9 -29
  205. package/dist/SegmentedControl.css.map +1 -1
  206. package/dist/SegmentedControl.mjs +8 -14
  207. package/dist/SegmentedControl.mjs.map +1 -1
  208. package/dist/Slider.cjs +63 -196
  209. package/dist/Slider.cjs.map +1 -1
  210. package/dist/Slider.css +61 -181
  211. package/dist/Slider.css.map +1 -1
  212. package/dist/Slider.mjs +63 -196
  213. package/dist/Slider.mjs.map +1 -1
  214. package/dist/StatusLight.cjs +9 -27
  215. package/dist/StatusLight.cjs.map +1 -1
  216. package/dist/StatusLight.css +17 -49
  217. package/dist/StatusLight.css.map +1 -1
  218. package/dist/StatusLight.mjs +9 -27
  219. package/dist/StatusLight.mjs.map +1 -1
  220. package/dist/Switch.cjs +6 -15
  221. package/dist/Switch.cjs.map +1 -1
  222. package/dist/Switch.css +10 -26
  223. package/dist/Switch.css.map +1 -1
  224. package/dist/Switch.mjs +6 -15
  225. package/dist/Switch.mjs.map +1 -1
  226. package/dist/TableView.cjs +42 -86
  227. package/dist/TableView.cjs.map +1 -1
  228. package/dist/TableView.css +65 -129
  229. package/dist/TableView.css.map +1 -1
  230. package/dist/TableView.mjs +42 -86
  231. package/dist/TableView.mjs.map +1 -1
  232. package/dist/Tabs.cjs +4 -15
  233. package/dist/Tabs.cjs.map +1 -1
  234. package/dist/Tabs.css +18 -34
  235. package/dist/Tabs.css.map +1 -1
  236. package/dist/Tabs.mjs +4 -15
  237. package/dist/Tabs.mjs.map +1 -1
  238. package/dist/TagGroup.cjs +14 -37
  239. package/dist/TagGroup.cjs.map +1 -1
  240. package/dist/TagGroup.css +23 -67
  241. package/dist/TagGroup.css.map +1 -1
  242. package/dist/TagGroup.mjs +14 -37
  243. package/dist/TagGroup.mjs.map +1 -1
  244. package/dist/TextField.cjs +11 -34
  245. package/dist/TextField.cjs.map +1 -1
  246. package/dist/TextField.css +22 -66
  247. package/dist/TextField.css.map +1 -1
  248. package/dist/TextField.mjs +11 -34
  249. package/dist/TextField.mjs.map +1 -1
  250. package/dist/Tooltip.cjs +2 -4
  251. package/dist/Tooltip.cjs.map +1 -1
  252. package/dist/Tooltip.css +4 -12
  253. package/dist/Tooltip.css.map +1 -1
  254. package/dist/Tooltip.mjs +2 -4
  255. package/dist/Tooltip.mjs.map +1 -1
  256. package/package.json +17 -17
  257. package/page.css +7 -0
  258. package/src/page.macro.ts +11 -0
  259. package/style/dist/spectrum-theme.cjs +2 -8
  260. package/style/dist/spectrum-theme.cjs.map +1 -1
  261. package/style/dist/spectrum-theme.mjs +2 -8
  262. package/style/dist/spectrum-theme.mjs.map +1 -1
  263. package/style/dist/types.d.ts +1 -4
  264. package/style/dist/types.d.ts.map +1 -1
  265. package/style/spectrum-theme.ts +4 -4
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAiCM,MAAM,0DAAmB,CAAA,GAAA,0BAAY,EAA8C;AAE1F,SAAS,gCAAU,KAAqB,EAAE,GAAsB;IAC9D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,qBACE,gCAAC;QACE,GAAG,KAAK;QACT,KAAK;kBACL,cAAA,gCAAC,CAAA,GAAA,+BAAI;;AAGX;AAEA;;;;CAIC,GACD,IAAI,0DAAa,CAAA,GAAA,uBAAS,EAAE;AAKrB,MAAM,0DAAkB,CAAA,GAAA,0BAAY,EAAkE;AAE7G,SAAS,+BAAS,KAAoB,EAAE,GAA2C;IACjF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,iDAAsB,EAAE,OAAO,KAAK;IACnD,qBACE,gCAAC;QACE,GAAG,KAAK;QACT,KAAK;QACL,aAAa;kBAIb,cAAA,gCAAC;;AAGP;AAEA;;;;CAIC,GACD,IAAI,0DAAY,CAAA,GAAA,uBAAS,EAAE;AAG3B,SAAS,oCAAc,KAA0E,EAAE,GAA8D;IAC/J,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAkB;IACpC,IAAI,cAAc,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,qCAAU;IACvC,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,SACF,KAAK,eACL,WAAW,gBACX,YAAY,sBACZ,kBAAkB,iBAClB,gBAAgB,mBAChB,aAAa,wBACb,aAAa,gBACb,YAAY,oBACZ,mBAAmB,IACnB,GAAG,gBACJ,GAAG;IAEJ,sCAAsC;IACtC,CAAA,GAAA,gCAAkB,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AAI,qDAAiB,CAAA,GAAA,uBAAS,EAAE;AAEhC,SAAS;IACP,8DAA8D;IAC9D,CAAA,GAAA,4CAAgB,EAAE,CAAA,GAAA,0CAAkB;IACpC,IAAI,iBAAiB,CAAC;QACpB,yDAAyD;QACzD,IAAI,OAAO;YACT,IAAI,gBAAgB,MAAM,KAAK,CAAC,SAAS;YACzC,IAAI,eAAe,MAAM,KAAK,CAAC,QAAQ;YACvC,6FAA6F;YAC7F,2EAA2E;YAC3E,mFAAmF;YACnF,IAAI,YAAY,mBAAmB,MAAM,KAAK;YAC9C,IAAI,CAAC,WACH,MAAM,KAAK,CAAC,QAAQ,GAAG;YAEzB,MAAM,KAAK,CAAC,SAAS,GAAG;YACxB,MAAM,KAAK,CAAC,MAAM,GAAG;YACrB,+DAA+D;YAC/D,MAAM,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,YAAY,GAAI,CAAA,MAAM,YAAY,GAAG,MAAM,YAAY,AAAD,EAAG,EAAE,CAAC;YAC1F,MAAM,KAAK,CAAC,QAAQ,GAAG;YACvB,MAAM,KAAK,CAAC,SAAS,GAAG;QAC1B;IACF;IAEA,qBACE,gCAAC,CAAA,GAAA,mCAAW;QACV,KAAK;QACL,mDAAmD;QACnD,iDAAiD;QACjD,aAAY;QACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN","sources":["packages/@react-spectrum/s2/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<TextFieldProps, TextFieldRef>>(null);\n\nfunction TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nlet _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, TextFieldRef<HTMLTextAreaElement>>>(null);\n\nfunction TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = forwardRef(TextArea);\nexport {_TextArea as TextArea};\n\nfunction TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {/* TODO: set GroupContext in RAC TextField */}\n <FieldGroup role=\"presentation\" isDisabled={isDisabled} isInvalid={isInvalid} size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n}\n\nlet _TextFieldBase = forwardRef(TextFieldBase);\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n\n return (\n <AriaTextArea\n ref={onHeightChange}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder=\" \"\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: 'control',\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n lineHeight: '[inherit]',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAiCM,MAAM,0D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S;YACzC,IAAI,eAAe,MAAM,KAAK,CAAC,QAAQ;YACvC,6FAA6F;YAC7F,2EAA2E;YAC3E,mFAAmF;YACnF,IAAI,YAAY,mBAAmB,MAAM,KAAK;YAC9C,IAAI,CAAC,WACH,MAAM,KAAK,CAAC,QAAQ,GAAG;YAEzB,MAAM,KAAK,CAAC,SAAS,GAAG;YACxB,MAAM,KAAK,CAAC,MAAM,GAAG;YACrB,+DAA+D;YAC/D,MAAM,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,YAAY,GAAI,CAAA,MAAM,YAAY,GAAG,MAAM,YAAY,AAAD,EAAG,EAAE,CAAC;YAC1F,MAAM,KAAK,CAAC,QAAQ,GAAG;YACvB,MAAM,KAAK,CAAC,SAAS,GAAG;QAC1B;IACF;IAEA,qBACE,gCAAC,CAAA,GAAA,mCAAW;QACV,KAAK;QACL,mDAAmD;QACnD,iDAAiD;QACjD,aAAY;QACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN","sources":["packages/@react-spectrum/s2/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<TextFieldProps, TextFieldRef>>(null);\n\nfunction TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nlet _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, TextFieldRef<HTMLTextAreaElement>>>(null);\n\nfunction TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = forwardRef(TextArea);\nexport {_TextArea as TextArea};\n\nfunction TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {/* TODO: set GroupContext in RAC TextField */}\n <FieldGroup role=\"presentation\" isDisabled={isDisabled} isInvalid={isInvalid} size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n}\n\nlet _TextFieldBase = forwardRef(TextFieldBase);\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n\n return (\n <AriaTextArea\n ref={onHeightChange}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder=\" \"\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: 'control',\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n lineHeight: '[inherit]',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.cjs.map"}
@@ -1,5 +1,5 @@
1
1
  @layer _.a {
2
- .k3 {
2
+ .kF {
3
3
  height: auto;
4
4
  }
5
5
 
@@ -74,24 +74,24 @@
74
74
  line-height: 1.3;
75
75
  }
76
76
 
77
- .-aqrvqh_k-q {
78
- --field-height: 2rem;
77
+ .-aqrvqh_k-j {
78
+ --field-height: calc(2rem * var(--s2-scale));
79
79
  }
80
80
 
81
- .-aqrvqh_k-k {
82
- --field-height: 1.25rem;
81
+ .-aqrvqh_k-g {
82
+ --field-height: calc(1.25rem * var(--s2-scale));
83
83
  }
84
84
 
85
- .-aqrvqh_k-m {
86
- --field-height: 1.5rem;
85
+ .-aqrvqh_k-h {
86
+ --field-height: calc(1.5rem * var(--s2-scale));
87
87
  }
88
88
 
89
- .-aqrvqh_k-r {
90
- --field-height: 2.5rem;
89
+ .-aqrvqh_k-l {
90
+ --field-height: calc(2.5rem * var(--s2-scale));
91
91
  }
92
92
 
93
- .-aqrvqh_k-x {
94
- --field-height: 3rem;
93
+ .-aqrvqh_k-n {
94
+ --field-height: calc(3rem * var(--s2-scale));
95
95
  }
96
96
 
97
97
  .-_1inj1bc_i--prjw07 {
@@ -161,7 +161,7 @@
161
161
  }
162
162
 
163
163
  .qa {
164
- min-width: 0;
164
+ min-width: calc(0rem * var(--s2-scale));
165
165
  }
166
166
 
167
167
  ._La {
@@ -180,24 +180,24 @@
180
180
  overflow-x: hidden;
181
181
  }
182
182
 
183
- .-_375tou_o-q {
184
- --o: 2rem;
183
+ .-_375tou_o-j {
184
+ --o: calc(2rem * var(--s2-scale));
185
185
  }
186
186
 
187
- .-_375tou_o-k {
188
- --o: 1.25rem;
187
+ .-_375tou_o-g {
188
+ --o: calc(1.25rem * var(--s2-scale));
189
189
  }
190
190
 
191
- .-_375tou_o-m {
192
- --o: 1.5rem;
191
+ .-_375tou_o-h {
192
+ --o: calc(1.5rem * var(--s2-scale));
193
193
  }
194
194
 
195
- .-_375tou_o-r {
196
- --o: 2.5rem;
195
+ .-_375tou_o-l {
196
+ --o: calc(2.5rem * var(--s2-scale));
197
197
  }
198
198
 
199
- .-_375tou_o-x {
200
- --o: 3rem;
199
+ .-_375tou_o-n {
200
+ --o: calc(3rem * var(--s2-scale));
201
201
  }
202
202
  }
203
203
 
@@ -230,50 +230,6 @@
230
230
  ._dbj {
231
231
  font-size: 1.375rem;
232
232
  }
233
-
234
- .-aqrvqh_k-br {
235
- --field-height: 2.5rem;
236
- }
237
-
238
- .-aqrvqh_k-bl {
239
- --field-height: 1.5625rem;
240
- }
241
-
242
- .-aqrvqh_k-bn {
243
- --field-height: 1.875rem;
244
- }
245
-
246
- .-aqrvqh_k-bu {
247
- --field-height: 3.125rem;
248
- }
249
-
250
- .-aqrvqh_k-by {
251
- --field-height: 3.75rem;
252
- }
253
-
254
- .qba {
255
- min-width: 0;
256
- }
257
-
258
- .-_375tou_o-br {
259
- --o: 2.5rem;
260
- }
261
-
262
- .-_375tou_o-bl {
263
- --o: 1.5625rem;
264
- }
265
-
266
- .-_375tou_o-bn {
267
- --o: 1.875rem;
268
- }
269
-
270
- .-_375tou_o-bu {
271
- --o: 3.125rem;
272
- }
273
-
274
- .-_375tou_o-by {
275
- --o: 3.75rem;
276
- }
277
233
  }
278
234
  }
279
235
 
@@ -1 +1 @@
1
- {"mappings":"AC0EqB;EAAA;;;;EAqDe;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAuEnB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA5HI;EAqDe;;;;;AArDf;;AAqDe;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAuEnB;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA","sources":["b5f6eedb906c59d7","packages/@react-spectrum/s2/src/TextField.tsx"],"sourcesContent":["@import \"ab36e6acf2667a8b\";\n@import \"67d58da798418a3e\";\n@import \"83cde29013713f83\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<TextFieldProps, TextFieldRef>>(null);\n\nfunction TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nlet _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, TextFieldRef<HTMLTextAreaElement>>>(null);\n\nfunction TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = forwardRef(TextArea);\nexport {_TextArea as TextArea};\n\nfunction TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {/* TODO: set GroupContext in RAC TextField */}\n <FieldGroup role=\"presentation\" isDisabled={isDisabled} isInvalid={isInvalid} size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n}\n\nlet _TextFieldBase = forwardRef(TextFieldBase);\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n\n return (\n <AriaTextArea\n ref={onHeightChange}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder=\" \"\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: 'control',\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n lineHeight: '[inherit]',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.css.map"}
1
+ {"mappings":"AC0EqB;EAAA;;;;EAqDe;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAuEnB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA5HI;EAqDe;;;;;AArDf;;AAqDe;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAuEnB","sources":["b5f6eedb906c59d7","packages/@react-spectrum/s2/src/TextField.tsx"],"sourcesContent":["@import \"ab36e6acf2667a8b\";\n@import \"67d58da798418a3e\";\n@import \"83cde29013713f83\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<TextFieldProps, TextFieldRef>>(null);\n\nfunction TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nlet _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, TextFieldRef<HTMLTextAreaElement>>>(null);\n\nfunction TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = forwardRef(TextArea);\nexport {_TextArea as TextArea};\n\nfunction TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {/* TODO: set GroupContext in RAC TextField */}\n <FieldGroup role=\"presentation\" isDisabled={isDisabled} isInvalid={isInvalid} size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n}\n\nlet _TextFieldBase = forwardRef(TextFieldBase);\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n\n return (\n <AriaTextArea\n ref={onHeightChange}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder=\" \"\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: 'control',\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n lineHeight: '[inherit]',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.css.map"}
@@ -46,7 +46,7 @@ function $d946f50010ba937f$var$TextArea(props, ref) {
46
46
  return /*#__PURE__*/ (0, $fsr8S$jsx)($d946f50010ba937f$var$_TextFieldBase, {
47
47
  ...props,
48
48
  ref: ref,
49
- fieldGroupCss: " . _1d k3",
49
+ fieldGroupCss: " . _1d kF",
50
50
  children: /*#__PURE__*/ (0, $fsr8S$jsx)($d946f50010ba937f$var$TextAreaInput, {})
51
51
  });
52
52
  }
@@ -122,22 +122,11 @@ function $d946f50010ba937f$var$TextFieldBase(props, ref) {
122
122
  rules += ' _1d';
123
123
  rules += ' _f-1x99dlob';
124
124
  rules += ' _fa';
125
- if (props.size === "XL") {
126
- rules += ' -aqrvqh_k-by';
127
- rules += ' -aqrvqh_k-x';
128
- } else if (props.size === "L") {
129
- rules += ' -aqrvqh_k-bu';
130
- rules += ' -aqrvqh_k-r';
131
- } else if (props.size === "S") {
132
- rules += ' -aqrvqh_k-bn';
133
- rules += ' -aqrvqh_k-m';
134
- } else if (props.size === "XS") {
135
- rules += ' -aqrvqh_k-bl';
136
- rules += ' -aqrvqh_k-k';
137
- } else {
138
- rules += ' -aqrvqh_k-br';
139
- rules += ' -aqrvqh_k-q';
140
- }
125
+ if (props.size === "XL") rules += ' -aqrvqh_k-n';
126
+ else if (props.size === "L") rules += ' -aqrvqh_k-l';
127
+ else if (props.size === "S") rules += ' -aqrvqh_k-h';
128
+ else if (props.size === "XS") rules += ' -aqrvqh_k-g';
129
+ else rules += ' -aqrvqh_k-j';
141
130
  rules += ' -_1inj1bc_i--prjw07';
142
131
  rules += ' je';
143
132
  rules += ' __R-yksgrp';
@@ -233,28 +222,16 @@ function $d946f50010ba937f$var$TextAreaInput() {
233
222
  rules += ' _e-17zqamw';
234
223
  rules += ' _f-17zqamw';
235
224
  rules += ' _9-3t1y';
236
- rules += ' qba';
237
225
  rules += ' qa';
238
226
  rules += ' _La';
239
227
  rules += ' wf';
240
228
  rules += ' __Ia';
241
229
  rules += ' __vb';
242
- if (props.size === "XL") {
243
- rules += ' -_375tou_o-by';
244
- rules += ' -_375tou_o-x';
245
- } else if (props.size === "L") {
246
- rules += ' -_375tou_o-bu';
247
- rules += ' -_375tou_o-r';
248
- } else if (props.size === "S") {
249
- rules += ' -_375tou_o-bn';
250
- rules += ' -_375tou_o-m';
251
- } else if (props.size === "XS") {
252
- rules += ' -_375tou_o-bl';
253
- rules += ' -_375tou_o-k';
254
- } else {
255
- rules += ' -_375tou_o-br';
256
- rules += ' -_375tou_o-q';
257
- }
230
+ if (props.size === "XL") rules += ' -_375tou_o-n';
231
+ else if (props.size === "L") rules += ' -_375tou_o-l';
232
+ else if (props.size === "S") rules += ' -_375tou_o-h';
233
+ else if (props.size === "XS") rules += ' -_375tou_o-g';
234
+ else rules += ' -_375tou_o-j';
258
235
  return rules;
259
236
  }
260
237
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAiCM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA8C;AAE1F,SAAS,gCAAU,KAAqB,EAAE,GAAsB;IAC9D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,qBACE,gBAAC;QACE,GAAG,KAAK;QACT,KAAK;kBACL,cAAA,gBAAC,CAAA,GAAA,yCAAI;;AAGX;AAEA;;;;CAIC,GACD,IAAI,0DAAa,CAAA,GAAA,iBAAS,EAAE;AAKrB,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAkE;AAE7G,SAAS,+BAAS,KAAoB,EAAE,GAA2C;IACjF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,qBACE,gBAAC;QACE,GAAG,KAAK;QACT,KAAK;QACL,aAAa;kBAIb,cAAA,gBAAC;;AAGP;AAEA;;;;CAIC,GACD,IAAI,0DAAY,CAAA,GA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aAAY;QACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN","sources":["packages/@react-spectrum/s2/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<TextFieldProps, TextFieldRef>>(null);\n\nfunction TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nlet _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, TextFieldRef<HTMLTextAreaElement>>>(null);\n\nfunction TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = forwardRef(TextArea);\nexport {_TextArea as TextArea};\n\nfunction TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {/* TODO: set GroupContext in RAC TextField */}\n <FieldGroup role=\"presentation\" isDisabled={isDisabled} isInvalid={isInvalid} size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n}\n\nlet _TextFieldBase = forwardRef(TextFieldBase);\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n\n return (\n <AriaTextArea\n ref={onHeightChange}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder=\" \"\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: 'control',\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n lineHeight: '[inherit]',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.mjs.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAiCM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAA8C;AAE1F,SAAS,gCAAU,KAAqB,EAAE,GAAsB;IAC9D,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,qBACE,gBAAC;QACE,GAAG,KAAK;QACT,KAAK;kBACL,cAAA,gBAAC,CAAA,GAAA,yCAAI;;AAGX;AAEA;;;;CAIC,GACD,IAAI,0DAAa,CAAA,GAAA,iBAAS,EAAE;AAKrB,MAAM,0DAAkB,CAAA,GAAA,oBAAY,EAAkE;AAE7G,SAAS,+BAAS,KAAoB,EAAE,GAA2C;IACjF,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAsB,EAAE,OAAO,KAAK;IACnD,qBACE,gBAAC;QACE,GAAG,KAAK;QACT,KAAK;QACL,aAAa;kBAIb,cAAA,gBAAC;;AAGP;AAEA;;;;CAIC,GACD,IAAI,0DAAY,CAAA,GAAA,iBAAS,EAAE;AAG3B,SAAS,oCAAc,KAA0E,EAAE,GAA8D;IAC/J,IAAI,WAAW,CAAA,GAAA,aAAK,EAAoB;IACxC,IAAI,SAAS,CAAA,GAAA,aAAK,EAAkB;IACpC,IAAI,cAAc,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAU;IACvC,QAAQ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KAAa,KAAK;wCAAS;kDAC/E;;;4BAIN,2BAAa,gBAAC,CAAA,GAAA,yCAAa;gCAAE,YAAY;;;;kCAE5C,gBAAC,CAAA,GAAA,yCAAO;wBACN,MAAM,MAAM,IAAI;wBAChB,YAAY;wBACZ,WAAW;wBACX,aAAa;kCACZ;;;;;AAKX;AAEA,IAAI,qDAAiB,CAAA,GAAA,iBAAS,EAAE;AAEhC,SAAS;IACP,8DAA8D;IAC9D,CAAA,GAAA,wBAAgB,EAAE,CAAA,GAAA,sBAAkB;IACpC,IAAI,iBAAiB,CAAC;QACpB,yDAAyD;QACzD,IAAI,OAAO;YACT,IAAI,gBAAgB,MAAM,KAAK,CAAC,SAAS;YACzC,IAAI,eAAe,MAAM,KAAK,CAAC,QAAQ;YACvC,6FAA6F;YAC7F,2EAA2E;YAC3E,mFAAmF;YACnF,IAAI,YAAY,mBAAmB,MAAM,KAAK;YAC9C,IAAI,CAAC,WACH,MAAM,KAAK,CAAC,QAAQ,GAAG;YAEzB,MAAM,KAAK,CAAC,SAAS,GAAG;YACxB,MAAM,KAAK,CAAC,MAAM,GAAG;YACrB,+DAA+D;YAC/D,MAAM,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,MAAM,YAAY,GAAI,CAAA,MAAM,YAAY,GAAG,MAAM,YAAY,AAAD,EAAG,EAAE,CAAC;YAC1F,MAAM,KAAK,CAAC,QAAQ,GAAG;YACvB,MAAM,KAAK,CAAC,SAAS,GAAG;QAC1B;IACF;IAEA,qBACE,gBAAC,CAAA,GAAA,eAAW;QACV,KAAK;QACL,mDAAmD;QACnD,iDAAiD;QACjD,aAAY;QACZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBN","sources":["packages/@react-spectrum/s2/src/TextField.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n TextArea as AriaTextArea,\n TextAreaContext as AriaTextAreaContext,\n TextField as AriaTextField,\n TextFieldProps as AriaTextFieldProps,\n composeRenderProps,\n ContextValue,\n InputContext,\n useSlottedContext\n} from 'react-aria-components';\nimport {centerPadding, field, getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {createContext, forwardRef, ReactNode, Ref, useContext, useImperativeHandle, useRef} from 'react';\nimport {createFocusableRef} from '@react-spectrum/utils';\nimport {FieldErrorIcon, FieldGroup, FieldLabel, HelpText, Input} from './Field';\nimport {FormContext, useFormProps} from './Form';\nimport {HelpTextProps, SpectrumLabelableProps} from '@react-types/shared';\nimport {mergeRefs} from '@react-aria/utils';\nimport {style} from '../style' with {type: 'macro'};\nimport {StyleString} from '../style/types';\nimport {TextFieldRef} from '@react-types/textfield';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface TextFieldProps extends Omit<AriaTextFieldProps, 'children' | 'className' | 'style'>, StyleProps, SpectrumLabelableProps, HelpTextProps {\n /**\n * The size of the text field.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L' | 'XL'\n}\n\nexport const TextFieldContext = createContext<ContextValue<TextFieldProps, TextFieldRef>>(null);\n\nfunction TextField(props: TextFieldProps, ref: Ref<TextFieldRef>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextFieldContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}>\n <Input />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextFields are text inputs that allow users to input custom text entries\n * with a keyboard. Various decorations can be displayed around the field to\n * communicate the entry requirements.\n */\nlet _TextField = forwardRef(TextField);\nexport {_TextField as TextField};\n\nexport interface TextAreaProps extends Omit<TextFieldProps, 'type' | 'pattern'> {}\n\nexport const TextAreaContext = createContext<ContextValue<TextAreaProps, TextFieldRef<HTMLTextAreaElement>>>(null);\n\nfunction TextArea(props: TextAreaProps, ref: Ref<TextFieldRef<HTMLTextAreaElement>>) {\n [props, ref] = useSpectrumContextProps(props, ref, TextAreaContext);\n return (\n <_TextFieldBase\n {...props}\n ref={ref}\n fieldGroupCss={style({\n alignItems: 'baseline',\n height: 'auto'\n })}>\n <TextAreaInput />\n </_TextFieldBase>\n );\n}\n\n/**\n * TextAreas are multiline text inputs, useful for cases where users have\n * a sizable amount of text to enter. They allow for all customizations that\n * are available to text fields.\n */\nlet _TextArea = forwardRef(TextArea);\nexport {_TextArea as TextArea};\n\nfunction TextFieldBase(props: TextFieldProps & {children: ReactNode, fieldGroupCss?: StyleString}, ref: Ref<TextFieldRef<HTMLInputElement | HTMLTextAreaElement>>) {\n let inputRef = useRef<HTMLInputElement>(null);\n let domRef = useRef<HTMLDivElement>(null);\n let formContext = useContext(FormContext);\n props = useFormProps(props);\n let {\n label,\n description,\n errorMessage,\n necessityIndicator,\n labelPosition = 'top',\n labelAlign = 'start',\n fieldGroupCss,\n UNSAFE_style,\n UNSAFE_className = '',\n ...textFieldProps\n } = props;\n\n // Expose imperative interface for ref\n useImperativeHandle(ref, () => ({\n ...createFocusableRef(domRef, inputRef),\n select() {\n if (inputRef.current) {\n inputRef.current.select();\n }\n },\n getInputElement() {\n return inputRef.current;\n }\n }));\n\n return (\n <AriaTextField\n {...textFieldProps}\n ref={domRef}\n style={UNSAFE_style}\n className={UNSAFE_className + style(field(), getAllowedOverrides())({\n size: props.size,\n labelPosition,\n isInForm: !!formContext\n }, props.styles)}>\n {composeRenderProps(props.children, (children, {isDisabled, isInvalid}) => (<>\n <FieldLabel\n isDisabled={isDisabled}\n isRequired={props.isRequired}\n size={props.size}\n labelPosition={labelPosition}\n labelAlign={labelAlign}\n necessityIndicator={necessityIndicator}\n contextualHelp={props.contextualHelp}>\n {label}\n </FieldLabel>\n {/* TODO: set GroupContext in RAC TextField */}\n <FieldGroup role=\"presentation\" isDisabled={isDisabled} isInvalid={isInvalid} size={props.size} styles={fieldGroupCss}>\n <InputContext.Consumer>\n {ctx => (\n <InputContext.Provider value={{...ctx, ref: mergeRefs((ctx as any)?.ref, inputRef)}}>\n {children}\n </InputContext.Provider>\n )}\n </InputContext.Consumer>\n {isInvalid && <FieldErrorIcon isDisabled={isDisabled} />}\n </FieldGroup>\n <HelpText\n size={props.size}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n description={description}>\n {errorMessage}\n </HelpText>\n </>))}\n </AriaTextField>\n );\n}\n\nlet _TextFieldBase = forwardRef(TextFieldBase);\n\nfunction TextAreaInput() {\n // Force re-render when value changes so we update the height.\n useSlottedContext(AriaTextAreaContext) ?? {};\n let onHeightChange = (input: HTMLTextAreaElement) => {\n // TODO: only do this if an explicit height is not given?\n if (input) {\n let prevAlignment = input.style.alignSelf;\n let prevOverflow = input.style.overflow;\n // Firefox scroll position is lost when overflow: 'hidden' is applied so we skip applying it.\n // The measure/applied height is also incorrect/reset if we turn on and off\n // overflow: hidden in Firefox https://bugzilla.mozilla.org/show_bug.cgi?id=1787062\n let isFirefox = 'MozAppearance' in input.style;\n if (!isFirefox) {\n input.style.overflow = 'hidden';\n }\n input.style.alignSelf = 'start';\n input.style.height = 'auto';\n // offsetHeight - clientHeight accounts for the border/padding.\n input.style.height = `${input.scrollHeight + (input.offsetHeight - input.clientHeight)}px`;\n input.style.overflow = prevOverflow;\n input.style.alignSelf = prevAlignment;\n }\n };\n\n return (\n <AriaTextArea\n ref={onHeightChange}\n // Workaround for baseline alignment bug in Safari.\n // https://bugs.webkit.org/show_bug.cgi?id=142968\n placeholder=\" \"\n className={style({\n paddingX: 0,\n paddingY: centerPadding(),\n minHeight: 'control',\n boxSizing: 'border-box',\n backgroundColor: 'transparent',\n color: '[inherit]',\n fontFamily: '[inherit]',\n fontSize: '[inherit]',\n fontWeight: '[inherit]',\n lineHeight: '[inherit]',\n flexGrow: 1,\n minWidth: 0,\n outlineStyle: 'none',\n borderStyle: 'none',\n resize: 'none',\n overflowX: 'hidden'\n })} />\n );\n}\n"],"names":[],"version":3,"file":"TextField.mjs.map"}
package/dist/Tooltip.cjs CHANGED
@@ -36,8 +36,7 @@ const $d3b6a84aebe66f8d$var$tooltip = function anonymous(props) {
36
36
  else rules += ' _A-10jn6wd';
37
37
  rules += ' _2d';
38
38
  rules += ' _1c';
39
- rules += ' rbM';
40
- rules += ' rJ';
39
+ rules += ' rv';
41
40
  rules += ' o-375tou';
42
41
  rules += ' __na';
43
42
  rules += ' _c-bc1l9oh';
@@ -92,8 +91,7 @@ const $d3b6a84aebe66f8d$var$tooltip = function anonymous(props) {
92
91
  else if (props.placement === "left") rules += ' -s75z34_A-a';
93
92
  else if (props.placement === "bottom") rules += ' -s75z34_A-K';
94
93
  else if (props.placement === "top") rules += ' -s75z34_A-c';
95
- rules += ' -_375tou_o-bn';
96
- rules += ' -_375tou_o-m';
94
+ rules += ' -_375tou_o-h';
97
95
  rules += ' -_375tp0_u-ab';
98
96
  rules += ' -_375tp1_v-ab';
99
97
  return rules;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoCD,MAAM;AAYN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEN,MAAM;;;;;;;;;;;;AAmBN,IAAI,oEAAgC,CAAA,GAAA,0BAAY,EAAuB,CAAC;AAExE,SAAS,8BAAQ,KAAmB,EAAE,GAA2B;IAC/D,IAAI,YAAC,QAAQ,gBAAE,YAAY,oBAAE,mBAAmB,IAAG,GAAG;IACtD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,oBACF,gBAAgB,eAChB,WAAW,UACX,MAAM,aACN,YAAY,mBACZ,UAAU,EACX,GAAG,CAAA,GAAA,uBAAS,EAAE;IACf,IAAI,cAAc,CAAA,GAA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CAEC,GACD,IAAI,0DAAW,CAAA,GAAA,uBAAS,EAAE;AAOnB,SAAS,0CAAgB,KAAgB;IAC9C,qBAAO,gCAAC;AACV","sources":["packages/@react-spectrum/s2/src/Tooltip.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Tooltip as AriaTooltip,\n TooltipProps as AriaTooltipProps,\n TooltipTrigger as AriaTooltipTrigger,\n TooltipTriggerComponentProps as AriaTooltipTriggerComponentProps,\n OverlayArrow,\n TooltipRenderProps,\n useLocale\n} from 'react-aria-components';\nimport {centerPadding, colorScheme, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ColorScheme} from '@react-types/provider';\nimport {ColorSchemeContext} from './Provider';\nimport {createContext, forwardRef, MutableRefObject, ReactNode, useCallback, useContext, useState} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\n\nexport interface TooltipTriggerProps extends Omit<AriaTooltipTriggerComponentProps, 'children' | 'closeDelay'>, Pick<AriaTooltipProps, 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /** The content of the tooltip. */\n children?: ReactNode,\n /**\n * The placement of the element with respect to its anchor element.\n *\n * @default 'top'\n */\n placement?: 'start' | 'end' | 'right' | 'left' | 'top' | 'bottom'\n}\n\nexport interface TooltipProps extends Omit<AriaTooltipProps, 'children' | 'className' | 'style' | 'triggerRef' | 'UNSTABLE_portalContainer' | 'isEntering' | 'isExiting' | 'placement' | 'containerPadding' | 'offset' | 'crossOffset' | 'shouldFlip' | 'arrowBoundaryOffset' | 'isOpen' | 'defaultOpen' | 'onOpenChange'>, UnsafeStyles {\n /** The content of the tooltip. */\n children?: ReactNode\n}\n\nconst slide = keyframes(`\n from {\n transform: translate(var(--originX), var(--originY));\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n`);\n\nconst tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light dark' | null}>({\n ...colorScheme(),\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: 160,\n minHeight: 24,\n boxSizing: 'border-box',\n font: 'ui-sm',\n color: {\n default: 'gray-25',\n forcedColors: 'ButtonText'\n },\n borderWidth: {\n forcedColors: 1\n },\n borderStyle: {\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: 'transparent'\n },\n backgroundColor: 'neutral',\n borderRadius: 'control',\n paddingX: 'edge-to-text',\n paddingY: centerPadding(),\n margin: 8,\n animation: {\n isEntering: slide,\n isExiting: slide\n },\n animationDuration: {\n isEntering: 200,\n isExiting: 200\n },\n animationDirection: {\n isEntering: 'normal',\n isExiting: 'reverse'\n },\n animationTimingFunction: {\n isExiting: 'in'\n },\n '--originX': {\n type: 'marginTop',\n value: {\n placement: {\n top: 0,\n bottom: 0,\n left: 4,\n right: -4\n }\n }\n },\n '--originY': {\n type: 'marginTop',\n value: {\n placement: {\n top: 4,\n bottom: -4,\n left: 0,\n right: -0\n }\n }\n }\n});\n\nconst arrowStyles = style<TooltipRenderProps>({\n display: 'block',\n fill: 'gray-800',\n rotate: {\n placement: {\n top: 0,\n bottom: '180deg',\n left: '-90deg',\n right: '90deg'\n }\n },\n translateX: {\n placement: {\n left: '[-25%]',\n right: '[25%]'\n }\n }\n});\n\nlet InternalTooltipTriggerContext = createContext<TooltipTriggerProps>({});\n\nfunction Tooltip(props: TooltipProps, ref: DOMRef<HTMLDivElement>) {\n let {children, UNSAFE_style, UNSAFE_className = ''} = props;\n let domRef = useDOMRef(ref);\n let {\n containerPadding,\n crossOffset,\n offset,\n placement = 'top',\n shouldFlip\n } = useContext(InternalTooltipTriggerContext);\n let colorScheme = useContext(ColorSchemeContext);\n let {locale, direction} = useLocale();\n let [borderRadius, setBorderRadius] = useState(0);\n\n // TODO: should we pass through lang and dir props in RAC?\n let tooltipRef = useCallback((el: HTMLDivElement) => {\n (domRef as MutableRefObject<HTMLDivElement>).current = el;\n if (el) {\n el.lang = locale;\n el.dir = direction;\n let spectrumBorderRadius = window.getComputedStyle(el).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [locale, direction, domRef]);\n\n return (\n <AriaTooltip\n {...props}\n arrowBoundaryOffset={borderRadius}\n containerPadding={containerPadding}\n crossOffset={crossOffset}\n offset={offset}\n placement={placement}\n shouldFlip={shouldFlip}\n ref={tooltipRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + tooltip({...renderProps, colorScheme})}>\n {renderProps => (\n <>\n <OverlayArrow>\n <svg className={arrowStyles(renderProps)} xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"5\" viewBox=\"0 0 10 5\">\n <path d=\"M4.29289 4.29289L0 0H10L5.70711 4.29289C5.31658 4.68342 4.68342 4.68342 4.29289 4.29289Z\" />\n </svg>\n </OverlayArrow>\n {children}\n </>\n )}\n </AriaTooltip>\n );\n}\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n let {\n containerPadding,\n crossOffset,\n offset,\n placement,\n shouldFlip,\n ...triggerProps\n } = props;\n\n return (\n <AriaTooltipTrigger {...triggerProps}>\n <InternalTooltipTriggerContext.Provider\n value={{\n containerPadding: containerPadding,\n crossOffset: crossOffset,\n offset: offset,\n placement: placement,\n shouldFlip: shouldFlip\n }}>\n {props.children}\n </InternalTooltipTriggerContext.Provider>\n </AriaTooltipTrigger>\n );\n}\n\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n\n\n// This is purely so that storybook generates the types for both Menu and MenuTrigger\ninterface ICombined extends Omit<TooltipProps, 'placement'>, TooltipTriggerProps {}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function CombinedTooltip(props: ICombined) {\n return <div />;\n}\n"],"names":[],"version":3,"file":"Tooltip.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoCD,MAAM;AAYN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEN,MAAM;;;;;;;;;;;;AAmBN,IAAI,oEAAgC,CAAA,GAAA,0BAAY,EAAuB,CAAC;AAExE,SAAS,8BAAQ,KAAmB,EAAE,GAA2B;IAC/D,IAAI,YAAC,QAAQ,gBAAE,YAAY,oBAAE,mBAAmB,IAAG,GAAG;IACtD,IAAI,SAAS,CAAA,GAAA,mCAAQ,EAAE;IACvB,IAAI,oBACF,gBAAgB,eAChB,WAAW,UACX,MAAM,aACN,YAAY,mBACZ,UAAU,EACX,GAAG,CAAA,GAAA,uBAAS,EAAE;IACf,IAAI,cAAc,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,4CAAiB;IAC9C,IAAI,UAAC,MAAM,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,oCAAQ;IAClC,IAAI,CAAC,cAAc,gBAAgB,GAAG,CAAA,GAAA,qBAAO,EAAE;IAE/C,0DAA0D;IAC1D,IAAI,aAAa,CAAA,GAAA,wBAAU,EAAE,CAAC;QAC3B,OAA4C,OAAO,GAAG;QACvD,IAAI,IAAI;YACN,GAAG,IAAI,GAAG;YACV,GAAG,GAAG,GAAG;YACT,IAAI,uBAAuB,OAAO,gBAAgB,CAAC,IAAI,YAAY;YACnE,IAAI,yBAAyB,IAC3B,gBAAgB,SAAS,sBAAsB;QAEnD;IACF,GAAG;QAAC;QAAQ;QAAW;KAAO;IAE9B,qBACE,gCAAC,CAAA,GAAA,kCAAU;QACR,GAAG,KAAK;QACT,qBAAqB;QACrB,kBAAkB;QAClB,aAAa;QACb,QAAQ;QACR,WAAW;QACX,YAAY;QACZ,KAAK;QACL,OAAO;QACP,WAAW,CAAA,cAAe,mBAAmB,8BAAQ;gBAAC,GAAG,WAAW;6BAAE;YAAW;kBAChF,CAAA,4BACC;;kCACE,gCAAC,CAAA,GAAA,uCAAW;kCACV,cAAA,gCAAC;4BAAI,WAAW,kCAAY;4BAAc,OAAM;4BAA6B,OAAM;4BAAK,QAAO;4BAAI,SAAQ;sCACzG,cAAA,gCAAC;gCAAK,GAAE;;;;oBAGX;;;;AAKX;AAOO,SAAS,0CAAe,KAA0B;IACvD,IAAI,oBACF,gBAAgB,eAChB,WAAW,UACX,MAAM,aACN,SAAS,cACT,UAAU,EACV,GAAG,cACJ,GAAG;IAEJ,qBACE,gCAAC,CAAA,GAAA,yCAAiB;QAAG,GAAG,YAAY;kBAClC,cAAA,gCAAC,oDAA8B,QAAQ;YACrC,OAAO;gBACL,kBAAkB;gBAClB,aAAa;gBACb,QAAQ;gBACR,WAAW;gBACX,YAAY;YACd;sBACC,MAAM,QAAQ;;;AAIvB;AAGA;;CAEC,GACD,IAAI,0DAAW,CAAA,GAAA,uBAAS,EAAE;AAOnB,SAAS,0CAAgB,KAAgB;IAC9C,qBAAO,gCAAC;AACV","sources":["packages/@react-spectrum/s2/src/Tooltip.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Tooltip as AriaTooltip,\n TooltipProps as AriaTooltipProps,\n TooltipTrigger as AriaTooltipTrigger,\n TooltipTriggerComponentProps as AriaTooltipTriggerComponentProps,\n OverlayArrow,\n TooltipRenderProps,\n useLocale\n} from 'react-aria-components';\nimport {centerPadding, colorScheme, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ColorScheme} from '@react-types/provider';\nimport {ColorSchemeContext} from './Provider';\nimport {createContext, forwardRef, MutableRefObject, ReactNode, useCallback, useContext, useState} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\n\nexport interface TooltipTriggerProps extends Omit<AriaTooltipTriggerComponentProps, 'children' | 'closeDelay'>, Pick<AriaTooltipProps, 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /** The content of the tooltip. */\n children?: ReactNode,\n /**\n * The placement of the element with respect to its anchor element.\n *\n * @default 'top'\n */\n placement?: 'start' | 'end' | 'right' | 'left' | 'top' | 'bottom'\n}\n\nexport interface TooltipProps extends Omit<AriaTooltipProps, 'children' | 'className' | 'style' | 'triggerRef' | 'UNSTABLE_portalContainer' | 'isEntering' | 'isExiting' | 'placement' | 'containerPadding' | 'offset' | 'crossOffset' | 'shouldFlip' | 'arrowBoundaryOffset' | 'isOpen' | 'defaultOpen' | 'onOpenChange'>, UnsafeStyles {\n /** The content of the tooltip. */\n children?: ReactNode\n}\n\nconst slide = keyframes(`\n from {\n transform: translate(var(--originX), var(--originY));\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n`);\n\nconst tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light dark' | null}>({\n ...colorScheme(),\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: 160,\n minHeight: 24,\n boxSizing: 'border-box',\n font: 'ui-sm',\n color: {\n default: 'gray-25',\n forcedColors: 'ButtonText'\n },\n borderWidth: {\n forcedColors: 1\n },\n borderStyle: {\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: 'transparent'\n },\n backgroundColor: 'neutral',\n borderRadius: 'control',\n paddingX: 'edge-to-text',\n paddingY: centerPadding(),\n margin: 8,\n animation: {\n isEntering: slide,\n isExiting: slide\n },\n animationDuration: {\n isEntering: 200,\n isExiting: 200\n },\n animationDirection: {\n isEntering: 'normal',\n isExiting: 'reverse'\n },\n animationTimingFunction: {\n isExiting: 'in'\n },\n '--originX': {\n type: 'marginTop',\n value: {\n placement: {\n top: 0,\n bottom: 0,\n left: 4,\n right: -4\n }\n }\n },\n '--originY': {\n type: 'marginTop',\n value: {\n placement: {\n top: 4,\n bottom: -4,\n left: 0,\n right: -0\n }\n }\n }\n});\n\nconst arrowStyles = style<TooltipRenderProps>({\n display: 'block',\n fill: 'gray-800',\n rotate: {\n placement: {\n top: 0,\n bottom: '180deg',\n left: '-90deg',\n right: '90deg'\n }\n },\n translateX: {\n placement: {\n left: '[-25%]',\n right: '[25%]'\n }\n }\n});\n\nlet InternalTooltipTriggerContext = createContext<TooltipTriggerProps>({});\n\nfunction Tooltip(props: TooltipProps, ref: DOMRef<HTMLDivElement>) {\n let {children, UNSAFE_style, UNSAFE_className = ''} = props;\n let domRef = useDOMRef(ref);\n let {\n containerPadding,\n crossOffset,\n offset,\n placement = 'top',\n shouldFlip\n } = useContext(InternalTooltipTriggerContext);\n let colorScheme = useContext(ColorSchemeContext);\n let {locale, direction} = useLocale();\n let [borderRadius, setBorderRadius] = useState(0);\n\n // TODO: should we pass through lang and dir props in RAC?\n let tooltipRef = useCallback((el: HTMLDivElement) => {\n (domRef as MutableRefObject<HTMLDivElement>).current = el;\n if (el) {\n el.lang = locale;\n el.dir = direction;\n let spectrumBorderRadius = window.getComputedStyle(el).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [locale, direction, domRef]);\n\n return (\n <AriaTooltip\n {...props}\n arrowBoundaryOffset={borderRadius}\n containerPadding={containerPadding}\n crossOffset={crossOffset}\n offset={offset}\n placement={placement}\n shouldFlip={shouldFlip}\n ref={tooltipRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + tooltip({...renderProps, colorScheme})}>\n {renderProps => (\n <>\n <OverlayArrow>\n <svg className={arrowStyles(renderProps)} xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"5\" viewBox=\"0 0 10 5\">\n <path d=\"M4.29289 4.29289L0 0H10L5.70711 4.29289C5.31658 4.68342 4.68342 4.68342 4.29289 4.29289Z\" />\n </svg>\n </OverlayArrow>\n {children}\n </>\n )}\n </AriaTooltip>\n );\n}\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n let {\n containerPadding,\n crossOffset,\n offset,\n placement,\n shouldFlip,\n ...triggerProps\n } = props;\n\n return (\n <AriaTooltipTrigger {...triggerProps}>\n <InternalTooltipTriggerContext.Provider\n value={{\n containerPadding: containerPadding,\n crossOffset: crossOffset,\n offset: offset,\n placement: placement,\n shouldFlip: shouldFlip\n }}>\n {props.children}\n </InternalTooltipTriggerContext.Provider>\n </AriaTooltipTrigger>\n );\n}\n\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n\n\n// This is purely so that storybook generates the types for both Menu and MenuTrigger\ninterface ICombined extends Omit<TooltipProps, 'placement'>, TooltipTriggerProps {}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function CombinedTooltip(props: ICombined) {\n return <div />;\n}\n"],"names":[],"version":3,"file":"Tooltip.cjs.map"}
package/dist/Tooltip.css CHANGED
@@ -48,8 +48,8 @@
48
48
  align-items: center;
49
49
  }
50
50
 
51
- .rJ {
52
- max-width: 10rem;
51
+ .rv {
52
+ max-width: calc(10rem * var(--s2-scale));
53
53
  }
54
54
 
55
55
  .o-375tou {
@@ -190,8 +190,8 @@
190
190
  --originY: 0rem;
191
191
  }
192
192
 
193
- .-_375tou_o-m {
194
- --o: 1.5rem;
193
+ .-_375tou_o-h {
194
+ --o: calc(1.5rem * var(--s2-scale));
195
195
  }
196
196
 
197
197
  ._Za {
@@ -279,17 +279,9 @@
279
279
 
280
280
  @layer _.b.b {
281
281
  @media not ((hover: hover) and (pointer: fine)) {
282
- .rbM {
283
- max-width: 12.5rem;
284
- }
285
-
286
282
  ._dbd {
287
283
  font-size: .9375rem;
288
284
  }
289
-
290
- .-_375tou_o-bn {
291
- --o: 1.875rem;
292
- }
293
285
  }
294
286
  }
295
287
 
@@ -1 +1 @@
1
- {"mappings":"AC8Cc;;;;;;;;;;;;AAYE;EAAA;;;;EAAA;;;;;;EAAA;IAAA;;;;;;EAAA;;;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiEI;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;;;AAjEJ;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAiEI","sources":["aa7688246f893a38","packages/@react-spectrum/s2/src/Tooltip.tsx"],"sourcesContent":["@import \"98a0a1b80e895d38\";\n@import \"c07030e64bc8758c\";\n@import \"1e9ed49e5bafc79c\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Tooltip as AriaTooltip,\n TooltipProps as AriaTooltipProps,\n TooltipTrigger as AriaTooltipTrigger,\n TooltipTriggerComponentProps as AriaTooltipTriggerComponentProps,\n OverlayArrow,\n TooltipRenderProps,\n useLocale\n} from 'react-aria-components';\nimport {centerPadding, colorScheme, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ColorScheme} from '@react-types/provider';\nimport {ColorSchemeContext} from './Provider';\nimport {createContext, forwardRef, MutableRefObject, ReactNode, useCallback, useContext, useState} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\n\nexport interface TooltipTriggerProps extends Omit<AriaTooltipTriggerComponentProps, 'children' | 'closeDelay'>, Pick<AriaTooltipProps, 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /** The content of the tooltip. */\n children?: ReactNode,\n /**\n * The placement of the element with respect to its anchor element.\n *\n * @default 'top'\n */\n placement?: 'start' | 'end' | 'right' | 'left' | 'top' | 'bottom'\n}\n\nexport interface TooltipProps extends Omit<AriaTooltipProps, 'children' | 'className' | 'style' | 'triggerRef' | 'UNSTABLE_portalContainer' | 'isEntering' | 'isExiting' | 'placement' | 'containerPadding' | 'offset' | 'crossOffset' | 'shouldFlip' | 'arrowBoundaryOffset' | 'isOpen' | 'defaultOpen' | 'onOpenChange'>, UnsafeStyles {\n /** The content of the tooltip. */\n children?: ReactNode\n}\n\nconst slide = keyframes(`\n from {\n transform: translate(var(--originX), var(--originY));\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n`);\n\nconst tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light dark' | null}>({\n ...colorScheme(),\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: 160,\n minHeight: 24,\n boxSizing: 'border-box',\n font: 'ui-sm',\n color: {\n default: 'gray-25',\n forcedColors: 'ButtonText'\n },\n borderWidth: {\n forcedColors: 1\n },\n borderStyle: {\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: 'transparent'\n },\n backgroundColor: 'neutral',\n borderRadius: 'control',\n paddingX: 'edge-to-text',\n paddingY: centerPadding(),\n margin: 8,\n animation: {\n isEntering: slide,\n isExiting: slide\n },\n animationDuration: {\n isEntering: 200,\n isExiting: 200\n },\n animationDirection: {\n isEntering: 'normal',\n isExiting: 'reverse'\n },\n animationTimingFunction: {\n isExiting: 'in'\n },\n '--originX': {\n type: 'marginTop',\n value: {\n placement: {\n top: 0,\n bottom: 0,\n left: 4,\n right: -4\n }\n }\n },\n '--originY': {\n type: 'marginTop',\n value: {\n placement: {\n top: 4,\n bottom: -4,\n left: 0,\n right: -0\n }\n }\n }\n});\n\nconst arrowStyles = style<TooltipRenderProps>({\n display: 'block',\n fill: 'gray-800',\n rotate: {\n placement: {\n top: 0,\n bottom: '180deg',\n left: '-90deg',\n right: '90deg'\n }\n },\n translateX: {\n placement: {\n left: '[-25%]',\n right: '[25%]'\n }\n }\n});\n\nlet InternalTooltipTriggerContext = createContext<TooltipTriggerProps>({});\n\nfunction Tooltip(props: TooltipProps, ref: DOMRef<HTMLDivElement>) {\n let {children, UNSAFE_style, UNSAFE_className = ''} = props;\n let domRef = useDOMRef(ref);\n let {\n containerPadding,\n crossOffset,\n offset,\n placement = 'top',\n shouldFlip\n } = useContext(InternalTooltipTriggerContext);\n let colorScheme = useContext(ColorSchemeContext);\n let {locale, direction} = useLocale();\n let [borderRadius, setBorderRadius] = useState(0);\n\n // TODO: should we pass through lang and dir props in RAC?\n let tooltipRef = useCallback((el: HTMLDivElement) => {\n (domRef as MutableRefObject<HTMLDivElement>).current = el;\n if (el) {\n el.lang = locale;\n el.dir = direction;\n let spectrumBorderRadius = window.getComputedStyle(el).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [locale, direction, domRef]);\n\n return (\n <AriaTooltip\n {...props}\n arrowBoundaryOffset={borderRadius}\n containerPadding={containerPadding}\n crossOffset={crossOffset}\n offset={offset}\n placement={placement}\n shouldFlip={shouldFlip}\n ref={tooltipRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + tooltip({...renderProps, colorScheme})}>\n {renderProps => (\n <>\n <OverlayArrow>\n <svg className={arrowStyles(renderProps)} xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"5\" viewBox=\"0 0 10 5\">\n <path d=\"M4.29289 4.29289L0 0H10L5.70711 4.29289C5.31658 4.68342 4.68342 4.68342 4.29289 4.29289Z\" />\n </svg>\n </OverlayArrow>\n {children}\n </>\n )}\n </AriaTooltip>\n );\n}\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n let {\n containerPadding,\n crossOffset,\n offset,\n placement,\n shouldFlip,\n ...triggerProps\n } = props;\n\n return (\n <AriaTooltipTrigger {...triggerProps}>\n <InternalTooltipTriggerContext.Provider\n value={{\n containerPadding: containerPadding,\n crossOffset: crossOffset,\n offset: offset,\n placement: placement,\n shouldFlip: shouldFlip\n }}>\n {props.children}\n </InternalTooltipTriggerContext.Provider>\n </AriaTooltipTrigger>\n );\n}\n\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n\n\n// This is purely so that storybook generates the types for both Menu and MenuTrigger\ninterface ICombined extends Omit<TooltipProps, 'placement'>, TooltipTriggerProps {}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function CombinedTooltip(props: ICombined) {\n return <div />;\n}\n"],"names":[],"version":3,"file":"Tooltip.css.map"}
1
+ {"mappings":"AC8Cc;;;;;;;;;;;;AAYE;EAAA;;;;EAAA;;;;;;EAAA;IAAA;;;;;;EAAA;;;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAiEI;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;EAAA;;;;;;AAjEJ;EAAA;;;;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;EAAA;;;;;AAAA;;AAAA;EAAA;IAAA;;;;;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAiEI","sources":["aa7688246f893a38","packages/@react-spectrum/s2/src/Tooltip.tsx"],"sourcesContent":["@import \"98a0a1b80e895d38\";\n@import \"c07030e64bc8758c\";\n@import \"1e9ed49e5bafc79c\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Tooltip as AriaTooltip,\n TooltipProps as AriaTooltipProps,\n TooltipTrigger as AriaTooltipTrigger,\n TooltipTriggerComponentProps as AriaTooltipTriggerComponentProps,\n OverlayArrow,\n TooltipRenderProps,\n useLocale\n} from 'react-aria-components';\nimport {centerPadding, colorScheme, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ColorScheme} from '@react-types/provider';\nimport {ColorSchemeContext} from './Provider';\nimport {createContext, forwardRef, MutableRefObject, ReactNode, useCallback, useContext, useState} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\n\nexport interface TooltipTriggerProps extends Omit<AriaTooltipTriggerComponentProps, 'children' | 'closeDelay'>, Pick<AriaTooltipProps, 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /** The content of the tooltip. */\n children?: ReactNode,\n /**\n * The placement of the element with respect to its anchor element.\n *\n * @default 'top'\n */\n placement?: 'start' | 'end' | 'right' | 'left' | 'top' | 'bottom'\n}\n\nexport interface TooltipProps extends Omit<AriaTooltipProps, 'children' | 'className' | 'style' | 'triggerRef' | 'UNSTABLE_portalContainer' | 'isEntering' | 'isExiting' | 'placement' | 'containerPadding' | 'offset' | 'crossOffset' | 'shouldFlip' | 'arrowBoundaryOffset' | 'isOpen' | 'defaultOpen' | 'onOpenChange'>, UnsafeStyles {\n /** The content of the tooltip. */\n children?: ReactNode\n}\n\nconst slide = keyframes(`\n from {\n transform: translate(var(--originX), var(--originY));\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n`);\n\nconst tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light dark' | null}>({\n ...colorScheme(),\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: 160,\n minHeight: 24,\n boxSizing: 'border-box',\n font: 'ui-sm',\n color: {\n default: 'gray-25',\n forcedColors: 'ButtonText'\n },\n borderWidth: {\n forcedColors: 1\n },\n borderStyle: {\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: 'transparent'\n },\n backgroundColor: 'neutral',\n borderRadius: 'control',\n paddingX: 'edge-to-text',\n paddingY: centerPadding(),\n margin: 8,\n animation: {\n isEntering: slide,\n isExiting: slide\n },\n animationDuration: {\n isEntering: 200,\n isExiting: 200\n },\n animationDirection: {\n isEntering: 'normal',\n isExiting: 'reverse'\n },\n animationTimingFunction: {\n isExiting: 'in'\n },\n '--originX': {\n type: 'marginTop',\n value: {\n placement: {\n top: 0,\n bottom: 0,\n left: 4,\n right: -4\n }\n }\n },\n '--originY': {\n type: 'marginTop',\n value: {\n placement: {\n top: 4,\n bottom: -4,\n left: 0,\n right: -0\n }\n }\n }\n});\n\nconst arrowStyles = style<TooltipRenderProps>({\n display: 'block',\n fill: 'gray-800',\n rotate: {\n placement: {\n top: 0,\n bottom: '180deg',\n left: '-90deg',\n right: '90deg'\n }\n },\n translateX: {\n placement: {\n left: '[-25%]',\n right: '[25%]'\n }\n }\n});\n\nlet InternalTooltipTriggerContext = createContext<TooltipTriggerProps>({});\n\nfunction Tooltip(props: TooltipProps, ref: DOMRef<HTMLDivElement>) {\n let {children, UNSAFE_style, UNSAFE_className = ''} = props;\n let domRef = useDOMRef(ref);\n let {\n containerPadding,\n crossOffset,\n offset,\n placement = 'top',\n shouldFlip\n } = useContext(InternalTooltipTriggerContext);\n let colorScheme = useContext(ColorSchemeContext);\n let {locale, direction} = useLocale();\n let [borderRadius, setBorderRadius] = useState(0);\n\n // TODO: should we pass through lang and dir props in RAC?\n let tooltipRef = useCallback((el: HTMLDivElement) => {\n (domRef as MutableRefObject<HTMLDivElement>).current = el;\n if (el) {\n el.lang = locale;\n el.dir = direction;\n let spectrumBorderRadius = window.getComputedStyle(el).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [locale, direction, domRef]);\n\n return (\n <AriaTooltip\n {...props}\n arrowBoundaryOffset={borderRadius}\n containerPadding={containerPadding}\n crossOffset={crossOffset}\n offset={offset}\n placement={placement}\n shouldFlip={shouldFlip}\n ref={tooltipRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + tooltip({...renderProps, colorScheme})}>\n {renderProps => (\n <>\n <OverlayArrow>\n <svg className={arrowStyles(renderProps)} xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"5\" viewBox=\"0 0 10 5\">\n <path d=\"M4.29289 4.29289L0 0H10L5.70711 4.29289C5.31658 4.68342 4.68342 4.68342 4.29289 4.29289Z\" />\n </svg>\n </OverlayArrow>\n {children}\n </>\n )}\n </AriaTooltip>\n );\n}\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n let {\n containerPadding,\n crossOffset,\n offset,\n placement,\n shouldFlip,\n ...triggerProps\n } = props;\n\n return (\n <AriaTooltipTrigger {...triggerProps}>\n <InternalTooltipTriggerContext.Provider\n value={{\n containerPadding: containerPadding,\n crossOffset: crossOffset,\n offset: offset,\n placement: placement,\n shouldFlip: shouldFlip\n }}>\n {props.children}\n </InternalTooltipTriggerContext.Provider>\n </AriaTooltipTrigger>\n );\n}\n\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n\n\n// This is purely so that storybook generates the types for both Menu and MenuTrigger\ninterface ICombined extends Omit<TooltipProps, 'placement'>, TooltipTriggerProps {}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function CombinedTooltip(props: ICombined) {\n return <div />;\n}\n"],"names":[],"version":3,"file":"Tooltip.css.map"}
package/dist/Tooltip.mjs CHANGED
@@ -29,8 +29,7 @@ const $4c20647d6e5d8fdf$var$tooltip = function anonymous(props) {
29
29
  else rules += ' _A-10jn6wd';
30
30
  rules += ' _2d';
31
31
  rules += ' _1c';
32
- rules += ' rbM';
33
- rules += ' rJ';
32
+ rules += ' rv';
34
33
  rules += ' o-375tou';
35
34
  rules += ' __na';
36
35
  rules += ' _c-bc1l9oh';
@@ -85,8 +84,7 @@ const $4c20647d6e5d8fdf$var$tooltip = function anonymous(props) {
85
84
  else if (props.placement === "left") rules += ' -s75z34_A-a';
86
85
  else if (props.placement === "bottom") rules += ' -s75z34_A-K';
87
86
  else if (props.placement === "top") rules += ' -s75z34_A-c';
88
- rules += ' -_375tou_o-bn';
89
- rules += ' -_375tou_o-m';
87
+ rules += ' -_375tou_o-h';
90
88
  rules += ' -_375tp0_u-ab';
91
89
  rules += ' -_375tp1_v-ab';
92
90
  return rules;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoCD,MAAM;AAYN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEN,MAAM;;;;;;;;;;;;AAmBN,IAAI,oEAAgC,CAAA,GAAA,oBAAY,EAAuB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BACF,gBAAgB,eAChB,WAAW,UACX,MAAM,aACN,SAAS,cACT,UAAU,EACV,GAAG,cACJ,GAAG;IAEJ,qBACE,gBAAC,CAAA,GAAA,qBAAiB;QAAG,GAAG,YAAY;kBAClC,cAAA,gBAAC,oDAA8B,QAAQ;YACrC,OAAO;gBACL,kBAAkB;gBAClB,aAAa;gBACb,QAAQ;gBACR,WAAW;gBACX,YAAY;YACd;sBACC,MAAM,QAAQ;;;AAIvB;AAGA;;CAEC,GACD,IAAI,0DAAW,CAAA,GAAA,iBAAS,EAAE;AAOnB,SAAS,0CAAgB,KAAgB;IAC9C,qBAAO,gBAAC;AACV","sources":["packages/@react-spectrum/s2/src/Tooltip.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Tooltip as AriaTooltip,\n TooltipProps as AriaTooltipProps,\n TooltipTrigger as AriaTooltipTrigger,\n TooltipTriggerComponentProps as AriaTooltipTriggerComponentProps,\n OverlayArrow,\n TooltipRenderProps,\n useLocale\n} from 'react-aria-components';\nimport {centerPadding, colorScheme, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ColorScheme} from '@react-types/provider';\nimport {ColorSchemeContext} from './Provider';\nimport {createContext, forwardRef, MutableRefObject, ReactNode, useCallback, useContext, useState} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\n\nexport interface TooltipTriggerProps extends Omit<AriaTooltipTriggerComponentProps, 'children' | 'closeDelay'>, Pick<AriaTooltipProps, 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /** The content of the tooltip. */\n children?: ReactNode,\n /**\n * The placement of the element with respect to its anchor element.\n *\n * @default 'top'\n */\n placement?: 'start' | 'end' | 'right' | 'left' | 'top' | 'bottom'\n}\n\nexport interface TooltipProps extends Omit<AriaTooltipProps, 'children' | 'className' | 'style' | 'triggerRef' | 'UNSTABLE_portalContainer' | 'isEntering' | 'isExiting' | 'placement' | 'containerPadding' | 'offset' | 'crossOffset' | 'shouldFlip' | 'arrowBoundaryOffset' | 'isOpen' | 'defaultOpen' | 'onOpenChange'>, UnsafeStyles {\n /** The content of the tooltip. */\n children?: ReactNode\n}\n\nconst slide = keyframes(`\n from {\n transform: translate(var(--originX), var(--originY));\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n`);\n\nconst tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light dark' | null}>({\n ...colorScheme(),\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: 160,\n minHeight: 24,\n boxSizing: 'border-box',\n font: 'ui-sm',\n color: {\n default: 'gray-25',\n forcedColors: 'ButtonText'\n },\n borderWidth: {\n forcedColors: 1\n },\n borderStyle: {\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: 'transparent'\n },\n backgroundColor: 'neutral',\n borderRadius: 'control',\n paddingX: 'edge-to-text',\n paddingY: centerPadding(),\n margin: 8,\n animation: {\n isEntering: slide,\n isExiting: slide\n },\n animationDuration: {\n isEntering: 200,\n isExiting: 200\n },\n animationDirection: {\n isEntering: 'normal',\n isExiting: 'reverse'\n },\n animationTimingFunction: {\n isExiting: 'in'\n },\n '--originX': {\n type: 'marginTop',\n value: {\n placement: {\n top: 0,\n bottom: 0,\n left: 4,\n right: -4\n }\n }\n },\n '--originY': {\n type: 'marginTop',\n value: {\n placement: {\n top: 4,\n bottom: -4,\n left: 0,\n right: -0\n }\n }\n }\n});\n\nconst arrowStyles = style<TooltipRenderProps>({\n display: 'block',\n fill: 'gray-800',\n rotate: {\n placement: {\n top: 0,\n bottom: '180deg',\n left: '-90deg',\n right: '90deg'\n }\n },\n translateX: {\n placement: {\n left: '[-25%]',\n right: '[25%]'\n }\n }\n});\n\nlet InternalTooltipTriggerContext = createContext<TooltipTriggerProps>({});\n\nfunction Tooltip(props: TooltipProps, ref: DOMRef<HTMLDivElement>) {\n let {children, UNSAFE_style, UNSAFE_className = ''} = props;\n let domRef = useDOMRef(ref);\n let {\n containerPadding,\n crossOffset,\n offset,\n placement = 'top',\n shouldFlip\n } = useContext(InternalTooltipTriggerContext);\n let colorScheme = useContext(ColorSchemeContext);\n let {locale, direction} = useLocale();\n let [borderRadius, setBorderRadius] = useState(0);\n\n // TODO: should we pass through lang and dir props in RAC?\n let tooltipRef = useCallback((el: HTMLDivElement) => {\n (domRef as MutableRefObject<HTMLDivElement>).current = el;\n if (el) {\n el.lang = locale;\n el.dir = direction;\n let spectrumBorderRadius = window.getComputedStyle(el).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [locale, direction, domRef]);\n\n return (\n <AriaTooltip\n {...props}\n arrowBoundaryOffset={borderRadius}\n containerPadding={containerPadding}\n crossOffset={crossOffset}\n offset={offset}\n placement={placement}\n shouldFlip={shouldFlip}\n ref={tooltipRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + tooltip({...renderProps, colorScheme})}>\n {renderProps => (\n <>\n <OverlayArrow>\n <svg className={arrowStyles(renderProps)} xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"5\" viewBox=\"0 0 10 5\">\n <path d=\"M4.29289 4.29289L0 0H10L5.70711 4.29289C5.31658 4.68342 4.68342 4.68342 4.29289 4.29289Z\" />\n </svg>\n </OverlayArrow>\n {children}\n </>\n )}\n </AriaTooltip>\n );\n}\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n let {\n containerPadding,\n crossOffset,\n offset,\n placement,\n shouldFlip,\n ...triggerProps\n } = props;\n\n return (\n <AriaTooltipTrigger {...triggerProps}>\n <InternalTooltipTriggerContext.Provider\n value={{\n containerPadding: containerPadding,\n crossOffset: crossOffset,\n offset: offset,\n placement: placement,\n shouldFlip: shouldFlip\n }}>\n {props.children}\n </InternalTooltipTriggerContext.Provider>\n </AriaTooltipTrigger>\n );\n}\n\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n\n\n// This is purely so that storybook generates the types for both Menu and MenuTrigger\ninterface ICombined extends Omit<TooltipProps, 'placement'>, TooltipTriggerProps {}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function CombinedTooltip(props: ICombined) {\n return <div />;\n}\n"],"names":[],"version":3,"file":"Tooltip.mjs.map"}
1
+ {"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAoCD,MAAM;AAYN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiEN,MAAM;;;;;;;;;;;;AAmBN,IAAI,oEAAgC,CAAA,GAAA,oBAAY,EAAuB,CAAC;AAExE,SAAS,8BAAQ,KAAmB,EAAE,GAA2B;IAC/D,IAAI,YAAC,QAAQ,gBAAE,YAAY,oBAAE,mBAAmB,IAAG,GAAG;IACtD,IAAI,SAAS,CAAA,GAAA,gBAAQ,EAAE;IACvB,IAAI,oBACF,gBAAgB,eAChB,WAAW,UACX,MAAM,aACN,YAAY,mBACZ,UAAU,EACX,GAAG,CAAA,GAAA,iBAAS,EAAE;IACf,IAAI,cAAc,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,yCAAiB;IAC9C,IAAI,UAAC,MAAM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0CAAgB,KAAgB;IAC9C,qBAAO,gBAAC;AACV","sources":["packages/@react-spectrum/s2/src/Tooltip.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n Tooltip as AriaTooltip,\n TooltipProps as AriaTooltipProps,\n TooltipTrigger as AriaTooltipTrigger,\n TooltipTriggerComponentProps as AriaTooltipTriggerComponentProps,\n OverlayArrow,\n TooltipRenderProps,\n useLocale\n} from 'react-aria-components';\nimport {centerPadding, colorScheme, UnsafeStyles} from './style-utils' with {type: 'macro'};\nimport {ColorScheme} from '@react-types/provider';\nimport {ColorSchemeContext} from './Provider';\nimport {createContext, forwardRef, MutableRefObject, ReactNode, useCallback, useContext, useState} from 'react';\nimport {DOMRef} from '@react-types/shared';\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\n\nexport interface TooltipTriggerProps extends Omit<AriaTooltipTriggerComponentProps, 'children' | 'closeDelay'>, Pick<AriaTooltipProps, 'shouldFlip' | 'containerPadding' | 'offset' | 'crossOffset'> {\n /** The content of the tooltip. */\n children?: ReactNode,\n /**\n * The placement of the element with respect to its anchor element.\n *\n * @default 'top'\n */\n placement?: 'start' | 'end' | 'right' | 'left' | 'top' | 'bottom'\n}\n\nexport interface TooltipProps extends Omit<AriaTooltipProps, 'children' | 'className' | 'style' | 'triggerRef' | 'UNSTABLE_portalContainer' | 'isEntering' | 'isExiting' | 'placement' | 'containerPadding' | 'offset' | 'crossOffset' | 'shouldFlip' | 'arrowBoundaryOffset' | 'isOpen' | 'defaultOpen' | 'onOpenChange'>, UnsafeStyles {\n /** The content of the tooltip. */\n children?: ReactNode\n}\n\nconst slide = keyframes(`\n from {\n transform: translate(var(--originX), var(--originY));\n opacity: 0;\n }\n\n to {\n transform: translateY(0);\n opacity: 1;\n }\n`);\n\nconst tooltip = style<TooltipRenderProps & {colorScheme: ColorScheme | 'light dark' | null}>({\n ...colorScheme(),\n justifyContent: 'center',\n alignItems: 'center',\n maxWidth: 160,\n minHeight: 24,\n boxSizing: 'border-box',\n font: 'ui-sm',\n color: {\n default: 'gray-25',\n forcedColors: 'ButtonText'\n },\n borderWidth: {\n forcedColors: 1\n },\n borderStyle: {\n forcedColors: 'solid'\n },\n borderColor: {\n forcedColors: 'transparent'\n },\n backgroundColor: 'neutral',\n borderRadius: 'control',\n paddingX: 'edge-to-text',\n paddingY: centerPadding(),\n margin: 8,\n animation: {\n isEntering: slide,\n isExiting: slide\n },\n animationDuration: {\n isEntering: 200,\n isExiting: 200\n },\n animationDirection: {\n isEntering: 'normal',\n isExiting: 'reverse'\n },\n animationTimingFunction: {\n isExiting: 'in'\n },\n '--originX': {\n type: 'marginTop',\n value: {\n placement: {\n top: 0,\n bottom: 0,\n left: 4,\n right: -4\n }\n }\n },\n '--originY': {\n type: 'marginTop',\n value: {\n placement: {\n top: 4,\n bottom: -4,\n left: 0,\n right: -0\n }\n }\n }\n});\n\nconst arrowStyles = style<TooltipRenderProps>({\n display: 'block',\n fill: 'gray-800',\n rotate: {\n placement: {\n top: 0,\n bottom: '180deg',\n left: '-90deg',\n right: '90deg'\n }\n },\n translateX: {\n placement: {\n left: '[-25%]',\n right: '[25%]'\n }\n }\n});\n\nlet InternalTooltipTriggerContext = createContext<TooltipTriggerProps>({});\n\nfunction Tooltip(props: TooltipProps, ref: DOMRef<HTMLDivElement>) {\n let {children, UNSAFE_style, UNSAFE_className = ''} = props;\n let domRef = useDOMRef(ref);\n let {\n containerPadding,\n crossOffset,\n offset,\n placement = 'top',\n shouldFlip\n } = useContext(InternalTooltipTriggerContext);\n let colorScheme = useContext(ColorSchemeContext);\n let {locale, direction} = useLocale();\n let [borderRadius, setBorderRadius] = useState(0);\n\n // TODO: should we pass through lang and dir props in RAC?\n let tooltipRef = useCallback((el: HTMLDivElement) => {\n (domRef as MutableRefObject<HTMLDivElement>).current = el;\n if (el) {\n el.lang = locale;\n el.dir = direction;\n let spectrumBorderRadius = window.getComputedStyle(el).borderRadius;\n if (spectrumBorderRadius !== '') {\n setBorderRadius(parseInt(spectrumBorderRadius, 10));\n }\n }\n }, [locale, direction, domRef]);\n\n return (\n <AriaTooltip\n {...props}\n arrowBoundaryOffset={borderRadius}\n containerPadding={containerPadding}\n crossOffset={crossOffset}\n offset={offset}\n placement={placement}\n shouldFlip={shouldFlip}\n ref={tooltipRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + tooltip({...renderProps, colorScheme})}>\n {renderProps => (\n <>\n <OverlayArrow>\n <svg className={arrowStyles(renderProps)} xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"5\" viewBox=\"0 0 10 5\">\n <path d=\"M4.29289 4.29289L0 0H10L5.70711 4.29289C5.31658 4.68342 4.68342 4.68342 4.29289 4.29289Z\" />\n </svg>\n </OverlayArrow>\n {children}\n </>\n )}\n </AriaTooltip>\n );\n}\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerProps) {\n let {\n containerPadding,\n crossOffset,\n offset,\n placement,\n shouldFlip,\n ...triggerProps\n } = props;\n\n return (\n <AriaTooltipTrigger {...triggerProps}>\n <InternalTooltipTriggerContext.Provider\n value={{\n containerPadding: containerPadding,\n crossOffset: crossOffset,\n offset: offset,\n placement: placement,\n shouldFlip: shouldFlip\n }}>\n {props.children}\n </InternalTooltipTriggerContext.Provider>\n </AriaTooltipTrigger>\n );\n}\n\n\n/**\n * Display container for Tooltip content. Has a directional arrow dependent on its placement.\n */\nlet _Tooltip = forwardRef(Tooltip);\nexport {_Tooltip as Tooltip};\n\n\n// This is purely so that storybook generates the types for both Menu and MenuTrigger\ninterface ICombined extends Omit<TooltipProps, 'placement'>, TooltipTriggerProps {}\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function CombinedTooltip(props: ICombined) {\n return <div />;\n}\n"],"names":[],"version":3,"file":"Tooltip.mjs.map"}