@sentry/scraps 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/README.md +13 -21
  2. package/dist/alert/alert.d.ts +25 -0
  3. package/dist/alert/alert.js +262 -0
  4. package/dist/alert/alertLink.d.ts +32 -0
  5. package/dist/alert/alertLink.js +94 -0
  6. package/dist/alert/index.d.ts +2 -0
  7. package/dist/alert/index.js +2 -0
  8. package/dist/backdrop/backdrop.d.ts +9 -0
  9. package/dist/backdrop/backdrop.js +28 -0
  10. package/dist/backdrop/index.d.ts +1 -0
  11. package/dist/backdrop/index.js +1 -0
  12. package/dist/badge/badge.d.ts +12 -0
  13. package/dist/badge/badge.js +80 -0
  14. package/dist/badge/featureBadge.d.ts +6 -0
  15. package/dist/badge/featureBadge.js +86 -0
  16. package/dist/badge/index.d.ts +3 -0
  17. package/dist/badge/index.js +3 -0
  18. package/dist/badge/tag.d.ts +15 -0
  19. package/dist/badge/tag.js +119 -0
  20. package/dist/boundaryContext.d.ts +2 -0
  21. package/dist/boundaryContext.js +5 -0
  22. package/dist/button/button.d.ts +3 -0
  23. package/dist/button/button.js +83 -0
  24. package/dist/button/buttonBar.d.ts +10 -0
  25. package/dist/button/buttonBar.js +141 -0
  26. package/dist/button/index.d.ts +5 -0
  27. package/dist/button/index.js +4 -0
  28. package/dist/button/linkButton.d.ts +3 -0
  29. package/dist/button/linkButton.js +110 -0
  30. package/dist/button/styles.d.ts +10 -0
  31. package/dist/button/styles.js +247 -0
  32. package/dist/button/types.d.ts +77 -0
  33. package/dist/button/types.js +0 -0
  34. package/dist/button/useButtonFunctionality.d.ts +5 -0
  35. package/dist/button/useButtonFunctionality.js +9 -0
  36. package/dist/checkbox/checkbox.d.ts +20 -0
  37. package/dist/checkbox/checkbox.js +193 -0
  38. package/dist/checkbox/index.d.ts +1 -0
  39. package/dist/checkbox/index.js +1 -0
  40. package/dist/chip/chip.d.ts +128 -0
  41. package/dist/chip/chip.js +364 -0
  42. package/dist/chip/index.d.ts +1 -0
  43. package/dist/chip/index.js +1 -0
  44. package/dist/code/inlineCode.d.ts +1 -0
  45. package/dist/datetime.d.ts +39 -0
  46. package/dist/datetime.js +20 -0
  47. package/dist/descriptionList/descriptionList.d.ts +69 -0
  48. package/dist/descriptionList/descriptionList.js +76 -0
  49. package/dist/descriptionList/index.d.ts +1 -0
  50. package/dist/descriptionList/index.js +1 -0
  51. package/dist/disclosure/disclosure.d.ts +37 -0
  52. package/dist/disclosure/disclosure.js +155 -0
  53. package/dist/disclosure/index.d.ts +1 -0
  54. package/dist/disclosure/index.js +1 -0
  55. package/dist/dragHandle/dragHandle.d.ts +34 -0
  56. package/dist/dragHandle/dragHandle.js +115 -0
  57. package/dist/dragHandle/index.d.ts +4 -0
  58. package/dist/dragHandle/index.js +4 -0
  59. package/dist/dragHandle/setDocumentDragging.d.ts +9 -0
  60. package/dist/dragHandle/setDocumentDragging.js +6 -0
  61. package/dist/dragHandle/useDragMove.d.ts +244 -0
  62. package/dist/dragHandle/useDragMove.js +66 -0
  63. package/dist/dragHandle/useDragSeparator.d.ts +256 -0
  64. package/dist/dragHandle/useDragSeparator.js +36 -0
  65. package/dist/emptyState/emptyState.d.ts +10 -0
  66. package/dist/emptyState/emptyState.js +81 -0
  67. package/dist/emptyState/index.d.ts +1 -0
  68. package/dist/emptyState/index.js +1 -0
  69. package/dist/formPresentation/autoSaveContext.d.ts +23 -0
  70. package/dist/formPresentation/autoSaveContext.js +13 -0
  71. package/dist/formPresentation/base.d.ts +11 -0
  72. package/dist/formPresentation/base.js +37 -0
  73. package/dist/formPresentation/displayField.d.ts +17 -0
  74. package/dist/formPresentation/displayField.js +69 -0
  75. package/dist/formPresentation/fieldIds.d.ts +3 -0
  76. package/dist/formPresentation/fieldIds.js +14 -0
  77. package/dist/formPresentation/fieldLayout.d.ts +23 -0
  78. package/dist/formPresentation/fieldLayout.js +76 -0
  79. package/dist/formPresentation/formContext.d.ts +4 -0
  80. package/dist/formPresentation/formContext.js +6 -0
  81. package/dist/formPresentation/groupContext.d.ts +24 -0
  82. package/dist/formPresentation/groupContext.js +22 -0
  83. package/dist/formPresentation/icons.d.ts +11 -0
  84. package/dist/formPresentation/icons.js +61 -0
  85. package/dist/formPresentation/index.d.ts +8 -0
  86. package/dist/formPresentation/index.js +8 -0
  87. package/dist/formPresentation/meta.d.ts +18 -0
  88. package/dist/formPresentation/meta.js +88 -0
  89. package/dist/formPresentation/useStackedLayout.d.ts +1 -0
  90. package/dist/formPresentation/useStackedLayout.js +9 -0
  91. package/dist/hotkey/hotkey.d.ts +22 -0
  92. package/dist/hotkey/hotkey.js +41 -0
  93. package/dist/hotkey/index.d.ts +4 -0
  94. package/dist/hotkey/index.js +3 -0
  95. package/dist/hotkey/kbd.d.ts +1 -0
  96. package/dist/hotkey/keyMappings.d.ts +23 -0
  97. package/dist/hotkey/keyMappings.js +223 -0
  98. package/dist/hotkey/useHotkeys.d.ts +47 -0
  99. package/dist/hotkey/useHotkeys.js +44 -0
  100. package/dist/image/image.d.ts +21 -0
  101. package/dist/image/image.js +20 -0
  102. package/dist/image/index.d.ts +1 -0
  103. package/dist/image/index.js +1 -0
  104. package/dist/info/index.d.ts +2 -0
  105. package/dist/info/index.js +2 -0
  106. package/dist/info/infoText.d.ts +15 -0
  107. package/dist/info/infoText.js +43 -0
  108. package/dist/info/infoTip.d.ts +10 -0
  109. package/dist/info/infoTip.js +54 -0
  110. package/dist/input/index.d.ts +8 -0
  111. package/dist/input/index.js +6 -0
  112. package/dist/input/input.d.ts +19 -0
  113. package/dist/input/input.js +14 -0
  114. package/dist/input/inputGroup.d.ts +29 -0
  115. package/dist/input/inputGroup.js +167 -0
  116. package/dist/input/inputStyles.d.ts +13 -0
  117. package/dist/input/inputStyles.js +52 -0
  118. package/dist/input/numberDragInput.d.ts +20 -0
  119. package/dist/input/numberDragInput.js +97 -0
  120. package/dist/input/numberInput.d.ts +10 -0
  121. package/dist/input/numberInput.js +94 -0
  122. package/dist/input/otpInput.d.ts +28 -0
  123. package/dist/input/otpInput.js +81 -0
  124. package/dist/input/useAutosizeInput.d.ts +17 -0
  125. package/dist/input/useAutosizeInput.js +56 -0
  126. package/dist/interactionStateLayer/index.d.ts +1 -0
  127. package/dist/interactionStateLayer/index.js +1 -0
  128. package/dist/interactionStateLayer/interactionStateLayer.d.ts +23 -0
  129. package/dist/interactionStateLayer/interactionStateLayer.js +67 -0
  130. package/dist/layout/flex.d.ts +1 -0
  131. package/dist/layout/grid.d.ts +1 -0
  132. package/dist/layout/index.d.ts +1 -1
  133. package/dist/layout/index.js +1 -1
  134. package/dist/layout/stack.d.ts +1 -0
  135. package/dist/layout/styles.d.ts +1 -1
  136. package/dist/layout/surface.d.ts +1 -0
  137. package/dist/link/index.d.ts +2 -0
  138. package/dist/link/index.js +2 -0
  139. package/dist/link/link.d.ts +43 -0
  140. package/dist/link/link.js +71 -0
  141. package/dist/link/linkBehaviorContext.d.ts +14 -0
  142. package/dist/link/linkBehaviorContext.js +31 -0
  143. package/dist/loader/indeterminateLoader.d.ts +1 -0
  144. package/dist/overlay.d.ts +59 -0
  145. package/dist/overlay.js +113 -0
  146. package/dist/overlayArrow.d.ts +9 -0
  147. package/dist/overlayArrow.js +55 -0
  148. package/dist/overlayPositioning.d.ts +70 -0
  149. package/dist/overlayPositioning.js +139 -0
  150. package/dist/panelProvider.d.ts +8 -0
  151. package/dist/panelProvider.js +20 -0
  152. package/dist/quote/quote.js +1 -1
  153. package/dist/radio/index.d.ts +1 -0
  154. package/dist/radio/index.js +1 -0
  155. package/dist/radio/radio.d.ts +9 -0
  156. package/dist/radio/radio.js +77 -0
  157. package/dist/renderToString.d.ts +2 -0
  158. package/dist/renderToString.js +25 -0
  159. package/dist/revealOnHover/index.d.ts +1 -0
  160. package/dist/revealOnHover/index.js +1 -0
  161. package/dist/revealOnHover/revealOnHover.d.ts +20 -0
  162. package/dist/revealOnHover/revealOnHover.js +62 -0
  163. package/dist/segmentedControl/index.d.ts +1 -0
  164. package/dist/segmentedControl/index.js +1 -0
  165. package/dist/segmentedControl/segmentedControl.d.ts +41 -0
  166. package/dist/segmentedControl/segmentedControl.js +217 -0
  167. package/dist/separator/separator.d.ts +4 -3
  168. package/dist/separator/separator.js +1 -1
  169. package/dist/sizeContext.d.ts +9 -0
  170. package/dist/sizeContext.js +13 -0
  171. package/dist/slider/index.d.ts +1 -0
  172. package/dist/slider/index.js +1 -0
  173. package/dist/slider/slider.d.ts +41 -0
  174. package/dist/slider/slider.js +386 -0
  175. package/dist/slot/index.d.ts +1 -0
  176. package/dist/slot/index.js +1 -0
  177. package/dist/slot/knownContexts.d.ts +1 -0
  178. package/dist/slot/knownContexts.js +7 -0
  179. package/dist/slot/slot.d.ts +26 -0
  180. package/dist/slot/slot.js +274 -0
  181. package/dist/statusIndicator/index.d.ts +1 -0
  182. package/dist/statusIndicator/index.js +1 -0
  183. package/dist/statusIndicator/statusIndicator.d.ts +24 -0
  184. package/dist/statusIndicator/statusIndicator.js +130 -0
  185. package/dist/switch/index.d.ts +1 -0
  186. package/dist/switch/index.js +1 -0
  187. package/dist/switch/switch.d.ts +6 -0
  188. package/dist/switch/switch.js +172 -0
  189. package/dist/table/index.d.ts +3 -0
  190. package/dist/table/index.js +3 -0
  191. package/dist/table/sortableHeaderCell.d.ts +36 -0
  192. package/dist/table/sortableHeaderCell.js +99 -0
  193. package/dist/table/styles.d.ts +46 -0
  194. package/dist/table/styles.js +93 -0
  195. package/dist/table/table.d.ts +64 -0
  196. package/dist/table/table.js +228 -0
  197. package/dist/table/useColumnResize.d.ts +27 -0
  198. package/dist/table/useColumnResize.js +62 -0
  199. package/dist/table/useObservedColumnSize.d.ts +12 -0
  200. package/dist/table/useObservedColumnSize.js +74 -0
  201. package/dist/text/heading.d.ts +2 -1
  202. package/dist/text/index.d.ts +1 -0
  203. package/dist/text/index.js +1 -0
  204. package/dist/text/prose.d.ts +8 -0
  205. package/dist/text/prose.js +45 -0
  206. package/dist/text/text.d.ts +8 -0
  207. package/dist/text/text.js +1 -1
  208. package/dist/textarea/index.d.ts +1 -0
  209. package/dist/textarea/index.js +1 -0
  210. package/dist/textarea/textarea.d.ts +22 -0
  211. package/dist/textarea/textarea.js +77 -0
  212. package/dist/theme/dark.d.ts +129 -10
  213. package/dist/theme/dark.js +41 -13
  214. package/dist/theme/index.d.ts +3 -12
  215. package/dist/theme/index.js +2 -2
  216. package/dist/theme/light.d.ts +129 -10
  217. package/dist/theme/light.js +42 -14
  218. package/dist/theme/swatch.d.ts +27 -0
  219. package/dist/theme/swatch.js +37 -0
  220. package/dist/theme/theme.d.ts +648 -0
  221. package/dist/theme/theme.js +780 -0
  222. package/dist/theme/types.d.ts +1 -0
  223. package/dist/theme/useInvertedTheme.d.ts +1 -0
  224. package/dist/theme/useInvertedTheme.js +7 -0
  225. package/dist/tooltip/index.d.ts +2 -0
  226. package/dist/tooltip/index.js +2 -0
  227. package/dist/tooltip/tooltip.d.ts +166 -0
  228. package/dist/tooltip/tooltip.js +181 -0
  229. package/dist/tooltip/useDisabledTooltip.d.ts +22 -0
  230. package/dist/tooltip/useDisabledTooltip.js +24 -0
  231. package/dist/trackingContext.d.ts +34 -0
  232. package/dist/trackingContext.js +29 -0
  233. package/dist/translation/index.d.ts +4 -0
  234. package/dist/translation/index.js +4 -0
  235. package/dist/translation/translationContext.d.ts +6 -0
  236. package/dist/translation/translationContext.js +6 -0
  237. package/dist/translation/useTranslation.d.ts +1 -0
  238. package/dist/translation/useTranslation.js +6 -0
  239. package/dist/unreachable.d.ts +1 -0
  240. package/dist/unreachable.js +4 -0
  241. package/dist/useHoverOverlay.d.ts +113 -0
  242. package/dist/useHoverOverlay.js +370 -0
  243. package/dist/useIsInsideInteractiveElement.d.ts +6 -0
  244. package/dist/useIsInsideInteractiveElement.js +31 -0
  245. package/dist/useOverlay.d.ts +82 -0
  246. package/dist/useOverlay.js +217 -0
  247. package/dist/useScrollLock.d.ts +5 -0
  248. package/dist/useScrollLock.js +100 -0
  249. package/dist/useStableMergeRef.d.ts +9 -0
  250. package/dist/useStableMergeRef.js +18 -0
  251. package/package.json +219 -11
  252. package/dist/index.d.ts +0 -9
  253. package/dist/index.js +0 -9
@@ -0,0 +1,74 @@
1
+ import { useCallback, useLayoutEffect, useMemo, useState } from "react";
2
+ import { useResizeObserver } from "@react-aria/utils";
3
+ const NO_ANCESTORS = {
4
+ cell: null,
5
+ table: null
6
+ };
7
+ function setProperty(element, property, value) {
8
+ if (element.style.getPropertyValue(property) !== value) element.style.setProperty(property, value);
9
+ }
10
+ function measureColumn(element, cell, table) {
11
+ setProperty(element, '--column-resizer-height', `${table.clientHeight}px`);
12
+ setProperty(element, '--drag-separator-target-length', `${cell.offsetHeight}px`);
13
+ return {
14
+ max: Math.max(table.clientWidth, cell.offsetWidth),
15
+ width: cell.offsetWidth
16
+ };
17
+ }
18
+ function useObservedColumnSize(elementRef) {
19
+ const [measurements, setMeasurements] = useState({
20
+ max: 0,
21
+ width: 0
22
+ });
23
+ const [{ cell, table }, setAncestors] = useState(NO_ANCESTORS);
24
+ const measure = useCallback((element, target, grid)=>{
25
+ const next = measureColumn(element, target, grid);
26
+ setMeasurements((current)=>current.max === next.max && current.width === next.width ? current : next);
27
+ }, []);
28
+ useLayoutEffect(()=>{
29
+ const element = elementRef.current;
30
+ const foundCell = element?.closest('th') ?? null;
31
+ const foundTable = foundCell?.closest('table') ?? null;
32
+ setAncestors({
33
+ cell: foundCell,
34
+ table: foundTable
35
+ });
36
+ if (element && foundCell && foundTable) measure(element, foundCell, foundTable);
37
+ }, [
38
+ elementRef,
39
+ measure
40
+ ]);
41
+ const cellRef = useMemo(()=>({
42
+ current: cell
43
+ }), [
44
+ cell
45
+ ]);
46
+ const tableRef = useMemo(()=>({
47
+ current: table
48
+ }), [
49
+ table
50
+ ]);
51
+ const onResize = useCallback(()=>{
52
+ const element = elementRef.current;
53
+ if (!element || !cell || !table) return;
54
+ measure(element, cell, table);
55
+ }, [
56
+ cell,
57
+ elementRef,
58
+ measure,
59
+ table
60
+ ]);
61
+ useResizeObserver({
62
+ ref: cellRef,
63
+ onResize
64
+ });
65
+ useResizeObserver({
66
+ ref: tableRef,
67
+ onResize
68
+ });
69
+ return {
70
+ cell,
71
+ ...measurements
72
+ };
73
+ }
74
+ export { useObservedColumnSize };
@@ -1,7 +1,8 @@
1
+ import type * as React from 'react';
1
2
  import { type Responsive } from '../layout/index.js';
2
3
  import type { HeadingSize } from '../theme/index.js';
3
4
  import { type BaseTextProps } from './text.js';
4
- type BaseHeadingProps = Omit<BaseTextProps, 'bold' | 'uppercase'>;
5
+ type BaseHeadingProps = Omit<BaseTextProps, 'bold' | 'uppercase' | 'trim'>;
5
6
  type ExclusiveHeadingEllipsisProps = {
6
7
  ellipsis?: true;
7
8
  wrap?: never;
@@ -1,2 +1,3 @@
1
1
  export { Text, type TextProps, type TextPropsWithRenderFunction } from './text.js';
2
2
  export { Heading, type HeadingProps } from './heading.js';
3
+ export { Prose } from './prose.js';
@@ -1,2 +1,3 @@
1
1
  export { Text } from "./text.js";
2
2
  export { Heading } from "./heading.js";
3
+ export { Prose } from "./prose.js";
@@ -0,0 +1,8 @@
1
+ import type * as React from 'react';
2
+ export declare const Prose: import("@emotion/styled").StyledComponent<{
3
+ as?: keyof HTMLElementTagNameMap | undefined;
4
+ children?: React.ReactNode;
5
+ ref?: React.Ref<HTMLDivElement | HTMLElement | HTMLObjectElement | HTMLDialogElement | HTMLProgressElement | HTMLStyleElement | HTMLLinkElement | HTMLMapElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLSlotElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLSpanElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement | null> | undefined;
6
+ } & React.HTMLAttributes<HTMLDivElement | HTMLElement | HTMLObjectElement | HTMLDialogElement | HTMLProgressElement | HTMLStyleElement | HTMLLinkElement | HTMLMapElement | HTMLAnchorElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBodyElement | HTMLBRElement | HTMLButtonElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLFormElement | HTMLHeadingElement | HTMLHeadElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLImageElement | HTMLInputElement | HTMLLabelElement | HTMLLegendElement | HTMLLIElement | HTMLMetaElement | HTMLMeterElement | HTMLOListElement | HTMLOptGroupElement | HTMLOptionElement | HTMLOutputElement | HTMLParagraphElement | HTMLPreElement | HTMLSlotElement | HTMLScriptElement | HTMLSelectElement | HTMLSourceElement | HTMLSpanElement | HTMLTableElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTextAreaElement | HTMLTimeElement | HTMLTitleElement | HTMLTableRowElement | HTMLTrackElement | HTMLUListElement | HTMLVideoElement | HTMLTableCaptionElement | HTMLMenuElement | HTMLPictureElement> & {
7
+ theme?: import("@emotion/react").Theme;
8
+ }, {}, {}>;
@@ -0,0 +1,45 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import styled from "@emotion/styled";
3
+ import { inlineCodeStyles } from "../code/inlineCode.js";
4
+ import { kbdStyles } from "../hotkey/kbd.js";
5
+ const Prose = styled(({ children, as = 'article', ...rest })=>{
6
+ const Component = as;
7
+ return /*#__PURE__*/ jsx(Component, {
8
+ ...rest,
9
+ children: children
10
+ });
11
+ })`
12
+ /* stylelint-disable no-descending-specificity */
13
+ h1,
14
+ h2,
15
+ h3,
16
+ h4,
17
+ h5,
18
+ h6,
19
+ p,
20
+ /* Exclude ol/ul elements inside interactive selectors/menus */
21
+ ul:not([role='listbox'], [role='grid'], [role='menu']),
22
+ ol:not([role='listbox'], [role='grid'], [role='menu']),
23
+ table,
24
+ dl,
25
+ blockquote,
26
+ form,
27
+ pre,
28
+ .auto-select-text,
29
+ .section,
30
+ [class^='highlight-'] {
31
+ margin-bottom: ${(p)=>p.theme.space['2xl']};
32
+
33
+ &:last-child {
34
+ margin-bottom: 0;
35
+ }
36
+ }
37
+ code:not(pre code) {
38
+ ${(p)=>inlineCodeStyles(p.theme)};
39
+ }
40
+ kbd {
41
+ ${(p)=>kbdStyles(p.theme)};
42
+ }
43
+ /* stylelint-enable */
44
+ `;
45
+ export { Prose };
@@ -1,3 +1,4 @@
1
+ import type * as React from 'react';
1
2
  import { type Responsive } from '../layout/index.js';
2
3
  import type { ContentVariant, TextSize, Theme } from '../theme/index.js';
3
4
  export interface BaseTextProps {
@@ -55,6 +56,13 @@ export interface BaseTextProps {
55
56
  * @default undefined
56
57
  */
57
58
  textWrap?: 'wrap' | 'nowrap' | 'balance' | 'pretty' | 'stable';
59
+ /**
60
+ * Trims the text box to the glyph bounds with `text-box-trim`. Set to false when
61
+ * the content is taller than a line of text, such as a tag or pill, so it isn't
62
+ * clipped when combined with `ellipsis`.
63
+ * @default true
64
+ */
65
+ trim?: boolean;
58
66
  /**
59
67
  * Determines how text should be underlined.
60
68
  * @default undefined
package/dist/text/text.js CHANGED
@@ -49,7 +49,7 @@ const getTextStyles = (p)=>css`
49
49
  text-transform: ${p.uppercase ? 'uppercase' : void 0};
50
50
 
51
51
  text-box-edge: text text;
52
- text-box-trim: trim-both;
52
+ text-box-trim: ${false === p.trim ? 'none' : 'trim-both'};
53
53
  `;
54
54
  const Text = styled((props)=>{
55
55
  if ('function' == typeof props.children) return props.children({
@@ -0,0 +1 @@
1
+ export { TextArea, type TextAreaProps } from './textarea.js';
@@ -0,0 +1 @@
1
+ export { TextArea } from "./textarea.js";
@@ -0,0 +1,22 @@
1
+ import type * as React from 'react';
2
+ import { type TextareaAutosizeProps } from 'react-textarea-autosize';
3
+ import { type InputStylesProps } from '../input/inputStyles.js';
4
+ export interface TextAreaProps extends Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'css' | 'onResize' | 'style'>, InputStylesProps {
5
+ /**
6
+ * Enable autosizing of the textarea.
7
+ */
8
+ autosize?: boolean;
9
+ /**
10
+ * Max number of rows to default to.
11
+ */
12
+ maxRows?: number;
13
+ ref?: React.Ref<HTMLTextAreaElement>;
14
+ /**
15
+ * Number of rows to default to.
16
+ */
17
+ rows?: number;
18
+ style?: TextareaAutosizeProps['style'];
19
+ }
20
+ export declare const TextArea: import("@emotion/styled").StyledComponent<TextAreaProps & {
21
+ theme?: import("@emotion/react").Theme;
22
+ }, {}, {}>;
@@ -0,0 +1,77 @@
1
+ import { jsx } from "@emotion/react/jsx-runtime";
2
+ import { useCallback, useMemo, useState } from "react";
3
+ import react_textarea_autosize from "react-textarea-autosize";
4
+ import is_prop_valid from "@emotion/is-prop-valid";
5
+ import { css } from "@emotion/react";
6
+ import styled from "@emotion/styled";
7
+ import { mergeRefs } from "@react-aria/utils";
8
+ import { inputStyles } from "../input/inputStyles.js";
9
+ function TextAreaControl({ ref, autosize, rows = 3, maxRows, size: _size, ...p }) {
10
+ return autosize ? /*#__PURE__*/ jsx(AutosizeTextArea, {
11
+ ...p,
12
+ ref: ref,
13
+ rows: rows,
14
+ maxRows: maxRows
15
+ }) : /*#__PURE__*/ jsx("textarea", {
16
+ ref: ref,
17
+ ...p,
18
+ rows: rows
19
+ });
20
+ }
21
+ TextAreaControl.displayName = 'TextAreaControl';
22
+ function AutosizeTextArea({ ref, rows, maxRows, ...p }) {
23
+ 'use no memo';
24
+ const [, setWidth] = useState();
25
+ const observerRef = useCallback((node)=>{
26
+ if (!node) return;
27
+ const observer = new ResizeObserver((entries)=>{
28
+ const entry = entries[0];
29
+ const width = entry?.borderBoxSize?.[0]?.inlineSize ?? entry?.contentRect.width;
30
+ setWidth(width);
31
+ });
32
+ observer.observe(node, {
33
+ box: 'border-box'
34
+ });
35
+ return ()=>observer.disconnect();
36
+ }, []);
37
+ const mergedRef = useMemo(()=>mergeRefs(ref, observerRef), [
38
+ ref,
39
+ observerRef
40
+ ]);
41
+ return /*#__PURE__*/ jsx(react_textarea_autosize, {
42
+ ...p,
43
+ ref: mergedRef,
44
+ minRows: rows,
45
+ maxRows: maxRows
46
+ });
47
+ }
48
+ const StyledTextArea = styled(TextAreaControl, {
49
+ shouldForwardProp: (p)=>[
50
+ 'autosize',
51
+ 'maxRows'
52
+ ].includes(p) || is_prop_valid(p)
53
+ })`
54
+ ${inputStyles};
55
+ line-height: ${(p)=>p.theme.font.lineHeight.comfortable};
56
+ /** Allow react-textarea-autosize to freely control height based on props. */
57
+ ${(p)=>p.autosize && css`
58
+ height: unset;
59
+ min-height: unset;
60
+ `}
61
+ `;
62
+ const TextArea = styled(StyledTextArea)`
63
+ /* re-set height to let it be determined by the rows prop */
64
+ height: unset;
65
+ /* this calculation reduces padding to account for the line-height, which ensures text is still correctly centered. */
66
+ ${({ theme, size = 'md' })=>`padding-top: calc(
67
+ (${theme.form[size].height} -
68
+ (${theme.form[size].fontSize} * ${theme.font.lineHeight.comfortable})
69
+ ) / 2
70
+ )`};
71
+ ${({ theme, size = 'md' })=>`padding-bottom: calc(
72
+ (${theme.form[size].height} -
73
+ (${theme.form[size].fontSize} * ${theme.font.lineHeight.comfortable})
74
+ ) / 2
75
+ )`};
76
+ `;
77
+ export { TextArea };
@@ -793,6 +793,13 @@ export declare const darkTheme: {
793
793
  */
794
794
  other: string;
795
795
  };
796
+ sequential: {
797
+ magma: {
798
+ series5: readonly [string, "#7C2282", "#F0369A", "#FA6769", "#FFD00E"];
799
+ series6: readonly [string, "#7C2282", "#B0009C", "#F0369A", "#FF9838", "#FFD00E"];
800
+ series7: readonly [string, "#7C2282", "#B0009C", "#F0369A", "#FA6769", "#FF9838", string];
801
+ };
802
+ };
796
803
  };
797
804
  elevation: {
798
805
  /**
@@ -1778,22 +1785,134 @@ export declare const darkTheme: {
1778
1785
  */
1779
1786
  variable: string;
1780
1787
  ansi: {
1788
+ /**
1789
+ *
1790
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0U3RTVFQSIvPgogIDwvc3ZnPg==)
1791
+ *
1792
+ * `ansi.black` `#E7E5EA`
1793
+ *
1794
+ */
1781
1795
  black: string;
1782
- red: string;
1783
- green: string;
1784
- yellow: string;
1796
+ /**
1797
+ *
1798
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0JDQkFGRCIvPgogIDwvc3ZnPg==)
1799
+ *
1800
+ * `ansi.blue` `#BCBAFD`
1801
+ *
1802
+ */
1785
1803
  blue: string;
1786
- magenta: string;
1787
- cyan: string;
1788
- white: string;
1804
+ /**
1805
+ *
1806
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0M0QzBDQiIvPgogIDwvc3ZnPg==)
1807
+ *
1808
+ * `ansi.brightBlack` `#C4C0CB`
1809
+ *
1810
+ */
1789
1811
  brightBlack: string;
1790
- brightRed: string;
1791
- brightGreen: string;
1792
- brightYellow: string;
1812
+ /**
1813
+ *
1814
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0NGQ0VGRiIvPgogIDwvc3ZnPg==)
1815
+ *
1816
+ * `ansi.brightBlue` `#CFCEFF`
1817
+ *
1818
+ */
1793
1819
  brightBlue: string;
1794
- brightMagenta: string;
1820
+ /**
1821
+ *
1822
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iIzkxZDhkNyIvPgogIDwvc3ZnPg==)
1823
+ *
1824
+ * `ansi.brightCyan` `#91d8d7`
1825
+ *
1826
+ */
1795
1827
  brightCyan: string;
1828
+ /**
1829
+ *
1830
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0E4RTZBRiIvPgogIDwvc3ZnPg==)
1831
+ *
1832
+ * `ansi.brightGreen` `#A8E6AF`
1833
+ *
1834
+ */
1835
+ brightGreen: string;
1836
+ /**
1837
+ *
1838
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0Y4QzNEOCIvPgogIDwvc3ZnPg==)
1839
+ *
1840
+ * `ansi.brightMagenta` `#F8C3D8`
1841
+ *
1842
+ */
1843
+ brightMagenta: string;
1844
+ /**
1845
+ *
1846
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0ZGQzJCQyIvPgogIDwvc3ZnPg==)
1847
+ *
1848
+ * `ansi.brightRed` `#FFC2BC`
1849
+ *
1850
+ */
1851
+ brightRed: string;
1852
+ /**
1853
+ *
1854
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0Y5RjhGOSIvPgogIDwvc3ZnPg==)
1855
+ *
1856
+ * `ansi.brightWhite` `#F9F8F9`
1857
+ *
1858
+ */
1796
1859
  brightWhite: string;
1860
+ /**
1861
+ *
1862
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0U5RDI5MCIvPgogIDwvc3ZnPg==)
1863
+ *
1864
+ * `ansi.brightYellow` `#E9D290`
1865
+ *
1866
+ */
1867
+ brightYellow: string;
1868
+ /**
1869
+ *
1870
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iIzc3Y2VjZCIvPgogIDwvc3ZnPg==)
1871
+ *
1872
+ * `ansi.cyan` `#77cecd`
1873
+ *
1874
+ */
1875
+ cyan: string;
1876
+ /**
1877
+ *
1878
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iIzgzREE5MCIvPgogIDwvc3ZnPg==)
1879
+ *
1880
+ * `ansi.green` `#83DA90`
1881
+ *
1882
+ */
1883
+ green: string;
1884
+ /**
1885
+ *
1886
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0YxQUFDOCIvPgogIDwvc3ZnPg==)
1887
+ *
1888
+ * `ansi.magenta` `#F1AAC8`
1889
+ *
1890
+ */
1891
+ magenta: string;
1892
+ /**
1893
+ *
1894
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0ZDQUFBMiIvPgogIDwvc3ZnPg==)
1895
+ *
1896
+ * `ansi.red` `#FCAAA2`
1897
+ *
1898
+ */
1899
+ red: string;
1900
+ /**
1901
+ *
1902
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0U3RTVFQSIvPgogIDwvc3ZnPg==)
1903
+ *
1904
+ * `ansi.white` `#E7E5EA`
1905
+ *
1906
+ */
1907
+ white: string;
1908
+ /**
1909
+ *
1910
+ * ![color visualization](data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyOTQiIGhlaWdodD0iODAiIHZpZXdCb3g9IjAgMCAyOTQgODAiPgogICAgPHJlY3Qgd2lkdGg9IjI5NCIgaGVpZ2h0PSI4MCIgZmlsbD0iI0UwQzA1RSIvPgogIDwvc3ZnPg==)
1911
+ *
1912
+ * `ansi.yellow` `#E0C05E`
1913
+ *
1914
+ */
1915
+ yellow: string;
1797
1916
  };
1798
1917
  };
1799
1918
  };
@@ -225,6 +225,34 @@ const dataviz = {
225
225
  bad: color.red.dark.opaque900,
226
226
  release: color.neutral.dark.opaque1100,
227
227
  other: color.neutral.dark.opaque800
228
+ },
229
+ sequential: {
230
+ magma: {
231
+ series5: [
232
+ color.blue.dark.opaque700,
233
+ color.categorical.dark.plum,
234
+ color.categorical.light.pink,
235
+ color.categorical.dark.salmon,
236
+ color.categorical.dark.yellow
237
+ ],
238
+ series6: [
239
+ color.blue.dark.opaque700,
240
+ color.categorical.dark.plum,
241
+ color.categorical.dark.magenta,
242
+ color.categorical.dark.pink,
243
+ color.categorical.dark.orange,
244
+ color.categorical.dark.yellow
245
+ ],
246
+ series7: [
247
+ color.blue.dark.opaque700,
248
+ color.categorical.dark.plum,
249
+ color.categorical.dark.magenta,
250
+ color.categorical.dark.pink,
251
+ color.categorical.dark.salmon,
252
+ color.categorical.dark.orange,
253
+ color.yellow.dark.opaque1200
254
+ ]
255
+ }
228
256
  }
229
257
  };
230
258
  const elevation = {
@@ -390,21 +418,21 @@ const syntax = {
390
418
  variable: content.primary,
391
419
  ansi: {
392
420
  black: color.neutral.dark.opaque1500,
393
- red: color.red.dark.opaque1200,
394
- green: color.green.dark.opaque1300,
395
- yellow: color.yellow.dark.opaque1300,
396
- blue: color.blue.dark.opaque1200,
397
- magenta: color.pink.dark.opaque1200,
398
- cyan: color.blue.dark.opaque1100,
399
- white: color.neutral.dark.opaque1500,
400
- brightBlack: color.neutral.dark.opaque1200,
401
- brightRed: color.red.dark.opaque1300,
421
+ blue: color.blue.dark.opaque1300,
422
+ brightBlack: color.neutral.dark.opaque1300,
423
+ brightBlue: color.blue.dark.opaque1400,
424
+ brightCyan: '#91d8d7',
402
425
  brightGreen: color.green.dark.opaque1400,
426
+ brightMagenta: color.pink.dark.opaque1400,
427
+ brightRed: color.red.dark.opaque1400,
428
+ brightWhite: color.neutral.dark.opaque1600,
403
429
  brightYellow: color.yellow.dark.opaque1400,
404
- brightBlue: color.blue.dark.opaque1300,
405
- brightMagenta: color.pink.dark.opaque1300,
406
- brightCyan: color.blue.dark.opaque1100,
407
- brightWhite: color.neutral.dark.opaque1500
430
+ cyan: '#77cecd',
431
+ green: color.green.dark.opaque1300,
432
+ magenta: color.pink.dark.opaque1300,
433
+ red: color.red.dark.opaque1300,
434
+ white: color.neutral.dark.opaque1500,
435
+ yellow: color.yellow.dark.opaque1300
408
436
  }
409
437
  };
410
438
  const shadow = {
@@ -1,14 +1,5 @@
1
- import type { darkTheme } from './dark.js';
2
- import type { lightTheme } from './light.js';
3
- export { lightTheme } from './light.js';
4
- export { darkTheme } from './dark.js';
1
+ export { lightTheme, darkTheme } from './theme.js';
2
+ export type { SentryTheme as Theme, StrictCSSObject } from './theme.js';
5
3
  export { baseTheme } from './base.js';
6
4
  export type * from './types.js';
7
- export type Theme = {
8
- [Key in keyof typeof lightTheme]: (typeof lightTheme)[Key] | (typeof darkTheme)[Key];
9
- };
10
- type ScrapsTheme = Theme;
11
- declare module '@emotion/react' {
12
- interface Theme extends ScrapsTheme {
13
- }
14
- }
5
+ export { useInvertedTheme } from './useInvertedTheme.js';
@@ -1,3 +1,3 @@
1
- export { lightTheme } from "./light.js";
2
- export { darkTheme } from "./dark.js";
1
+ export { darkTheme, lightTheme } from "./theme.js";
3
2
  export { baseTheme } from "./base.js";
3
+ export { useInvertedTheme } from "./useInvertedTheme.js";