@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.
- package/README.md +13 -21
- package/dist/alert/alert.d.ts +25 -0
- package/dist/alert/alert.js +262 -0
- package/dist/alert/alertLink.d.ts +32 -0
- package/dist/alert/alertLink.js +94 -0
- package/dist/alert/index.d.ts +2 -0
- package/dist/alert/index.js +2 -0
- package/dist/backdrop/backdrop.d.ts +9 -0
- package/dist/backdrop/backdrop.js +28 -0
- package/dist/backdrop/index.d.ts +1 -0
- package/dist/backdrop/index.js +1 -0
- package/dist/badge/badge.d.ts +12 -0
- package/dist/badge/badge.js +80 -0
- package/dist/badge/featureBadge.d.ts +6 -0
- package/dist/badge/featureBadge.js +86 -0
- package/dist/badge/index.d.ts +3 -0
- package/dist/badge/index.js +3 -0
- package/dist/badge/tag.d.ts +15 -0
- package/dist/badge/tag.js +119 -0
- package/dist/boundaryContext.d.ts +2 -0
- package/dist/boundaryContext.js +5 -0
- package/dist/button/button.d.ts +3 -0
- package/dist/button/button.js +83 -0
- package/dist/button/buttonBar.d.ts +10 -0
- package/dist/button/buttonBar.js +141 -0
- package/dist/button/index.d.ts +5 -0
- package/dist/button/index.js +4 -0
- package/dist/button/linkButton.d.ts +3 -0
- package/dist/button/linkButton.js +110 -0
- package/dist/button/styles.d.ts +10 -0
- package/dist/button/styles.js +247 -0
- package/dist/button/types.d.ts +77 -0
- package/dist/button/types.js +0 -0
- package/dist/button/useButtonFunctionality.d.ts +5 -0
- package/dist/button/useButtonFunctionality.js +9 -0
- package/dist/checkbox/checkbox.d.ts +20 -0
- package/dist/checkbox/checkbox.js +193 -0
- package/dist/checkbox/index.d.ts +1 -0
- package/dist/checkbox/index.js +1 -0
- package/dist/chip/chip.d.ts +128 -0
- package/dist/chip/chip.js +364 -0
- package/dist/chip/index.d.ts +1 -0
- package/dist/chip/index.js +1 -0
- package/dist/code/inlineCode.d.ts +1 -0
- package/dist/datetime.d.ts +39 -0
- package/dist/datetime.js +20 -0
- package/dist/descriptionList/descriptionList.d.ts +69 -0
- package/dist/descriptionList/descriptionList.js +76 -0
- package/dist/descriptionList/index.d.ts +1 -0
- package/dist/descriptionList/index.js +1 -0
- package/dist/disclosure/disclosure.d.ts +37 -0
- package/dist/disclosure/disclosure.js +155 -0
- package/dist/disclosure/index.d.ts +1 -0
- package/dist/disclosure/index.js +1 -0
- package/dist/dragHandle/dragHandle.d.ts +34 -0
- package/dist/dragHandle/dragHandle.js +115 -0
- package/dist/dragHandle/index.d.ts +4 -0
- package/dist/dragHandle/index.js +4 -0
- package/dist/dragHandle/setDocumentDragging.d.ts +9 -0
- package/dist/dragHandle/setDocumentDragging.js +6 -0
- package/dist/dragHandle/useDragMove.d.ts +244 -0
- package/dist/dragHandle/useDragMove.js +66 -0
- package/dist/dragHandle/useDragSeparator.d.ts +256 -0
- package/dist/dragHandle/useDragSeparator.js +36 -0
- package/dist/emptyState/emptyState.d.ts +10 -0
- package/dist/emptyState/emptyState.js +81 -0
- package/dist/emptyState/index.d.ts +1 -0
- package/dist/emptyState/index.js +1 -0
- package/dist/formPresentation/autoSaveContext.d.ts +23 -0
- package/dist/formPresentation/autoSaveContext.js +13 -0
- package/dist/formPresentation/base.d.ts +11 -0
- package/dist/formPresentation/base.js +37 -0
- package/dist/formPresentation/displayField.d.ts +17 -0
- package/dist/formPresentation/displayField.js +69 -0
- package/dist/formPresentation/fieldIds.d.ts +3 -0
- package/dist/formPresentation/fieldIds.js +14 -0
- package/dist/formPresentation/fieldLayout.d.ts +23 -0
- package/dist/formPresentation/fieldLayout.js +76 -0
- package/dist/formPresentation/formContext.d.ts +4 -0
- package/dist/formPresentation/formContext.js +6 -0
- package/dist/formPresentation/groupContext.d.ts +24 -0
- package/dist/formPresentation/groupContext.js +22 -0
- package/dist/formPresentation/icons.d.ts +11 -0
- package/dist/formPresentation/icons.js +61 -0
- package/dist/formPresentation/index.d.ts +8 -0
- package/dist/formPresentation/index.js +8 -0
- package/dist/formPresentation/meta.d.ts +18 -0
- package/dist/formPresentation/meta.js +88 -0
- package/dist/formPresentation/useStackedLayout.d.ts +1 -0
- package/dist/formPresentation/useStackedLayout.js +9 -0
- package/dist/hotkey/hotkey.d.ts +22 -0
- package/dist/hotkey/hotkey.js +41 -0
- package/dist/hotkey/index.d.ts +4 -0
- package/dist/hotkey/index.js +3 -0
- package/dist/hotkey/kbd.d.ts +1 -0
- package/dist/hotkey/keyMappings.d.ts +23 -0
- package/dist/hotkey/keyMappings.js +223 -0
- package/dist/hotkey/useHotkeys.d.ts +47 -0
- package/dist/hotkey/useHotkeys.js +44 -0
- package/dist/image/image.d.ts +21 -0
- package/dist/image/image.js +20 -0
- package/dist/image/index.d.ts +1 -0
- package/dist/image/index.js +1 -0
- package/dist/info/index.d.ts +2 -0
- package/dist/info/index.js +2 -0
- package/dist/info/infoText.d.ts +15 -0
- package/dist/info/infoText.js +43 -0
- package/dist/info/infoTip.d.ts +10 -0
- package/dist/info/infoTip.js +54 -0
- package/dist/input/index.d.ts +8 -0
- package/dist/input/index.js +6 -0
- package/dist/input/input.d.ts +19 -0
- package/dist/input/input.js +14 -0
- package/dist/input/inputGroup.d.ts +29 -0
- package/dist/input/inputGroup.js +167 -0
- package/dist/input/inputStyles.d.ts +13 -0
- package/dist/input/inputStyles.js +52 -0
- package/dist/input/numberDragInput.d.ts +20 -0
- package/dist/input/numberDragInput.js +97 -0
- package/dist/input/numberInput.d.ts +10 -0
- package/dist/input/numberInput.js +94 -0
- package/dist/input/otpInput.d.ts +28 -0
- package/dist/input/otpInput.js +81 -0
- package/dist/input/useAutosizeInput.d.ts +17 -0
- package/dist/input/useAutosizeInput.js +56 -0
- package/dist/interactionStateLayer/index.d.ts +1 -0
- package/dist/interactionStateLayer/index.js +1 -0
- package/dist/interactionStateLayer/interactionStateLayer.d.ts +23 -0
- package/dist/interactionStateLayer/interactionStateLayer.js +67 -0
- package/dist/layout/flex.d.ts +1 -0
- package/dist/layout/grid.d.ts +1 -0
- package/dist/layout/index.d.ts +1 -1
- package/dist/layout/index.js +1 -1
- package/dist/layout/stack.d.ts +1 -0
- package/dist/layout/styles.d.ts +1 -1
- package/dist/layout/surface.d.ts +1 -0
- package/dist/link/index.d.ts +2 -0
- package/dist/link/index.js +2 -0
- package/dist/link/link.d.ts +43 -0
- package/dist/link/link.js +71 -0
- package/dist/link/linkBehaviorContext.d.ts +14 -0
- package/dist/link/linkBehaviorContext.js +31 -0
- package/dist/loader/indeterminateLoader.d.ts +1 -0
- package/dist/overlay.d.ts +59 -0
- package/dist/overlay.js +113 -0
- package/dist/overlayArrow.d.ts +9 -0
- package/dist/overlayArrow.js +55 -0
- package/dist/overlayPositioning.d.ts +70 -0
- package/dist/overlayPositioning.js +139 -0
- package/dist/panelProvider.d.ts +8 -0
- package/dist/panelProvider.js +20 -0
- package/dist/quote/quote.js +1 -1
- package/dist/radio/index.d.ts +1 -0
- package/dist/radio/index.js +1 -0
- package/dist/radio/radio.d.ts +9 -0
- package/dist/radio/radio.js +77 -0
- package/dist/renderToString.d.ts +2 -0
- package/dist/renderToString.js +25 -0
- package/dist/revealOnHover/index.d.ts +1 -0
- package/dist/revealOnHover/index.js +1 -0
- package/dist/revealOnHover/revealOnHover.d.ts +20 -0
- package/dist/revealOnHover/revealOnHover.js +62 -0
- package/dist/segmentedControl/index.d.ts +1 -0
- package/dist/segmentedControl/index.js +1 -0
- package/dist/segmentedControl/segmentedControl.d.ts +41 -0
- package/dist/segmentedControl/segmentedControl.js +217 -0
- package/dist/separator/separator.d.ts +4 -3
- package/dist/separator/separator.js +1 -1
- package/dist/sizeContext.d.ts +9 -0
- package/dist/sizeContext.js +13 -0
- package/dist/slider/index.d.ts +1 -0
- package/dist/slider/index.js +1 -0
- package/dist/slider/slider.d.ts +41 -0
- package/dist/slider/slider.js +386 -0
- package/dist/slot/index.d.ts +1 -0
- package/dist/slot/index.js +1 -0
- package/dist/slot/knownContexts.d.ts +1 -0
- package/dist/slot/knownContexts.js +7 -0
- package/dist/slot/slot.d.ts +26 -0
- package/dist/slot/slot.js +274 -0
- package/dist/statusIndicator/index.d.ts +1 -0
- package/dist/statusIndicator/index.js +1 -0
- package/dist/statusIndicator/statusIndicator.d.ts +24 -0
- package/dist/statusIndicator/statusIndicator.js +130 -0
- package/dist/switch/index.d.ts +1 -0
- package/dist/switch/index.js +1 -0
- package/dist/switch/switch.d.ts +6 -0
- package/dist/switch/switch.js +172 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/index.js +3 -0
- package/dist/table/sortableHeaderCell.d.ts +36 -0
- package/dist/table/sortableHeaderCell.js +99 -0
- package/dist/table/styles.d.ts +46 -0
- package/dist/table/styles.js +93 -0
- package/dist/table/table.d.ts +64 -0
- package/dist/table/table.js +228 -0
- package/dist/table/useColumnResize.d.ts +27 -0
- package/dist/table/useColumnResize.js +62 -0
- package/dist/table/useObservedColumnSize.d.ts +12 -0
- package/dist/table/useObservedColumnSize.js +74 -0
- package/dist/text/heading.d.ts +2 -1
- package/dist/text/index.d.ts +1 -0
- package/dist/text/index.js +1 -0
- package/dist/text/prose.d.ts +8 -0
- package/dist/text/prose.js +45 -0
- package/dist/text/text.d.ts +8 -0
- package/dist/text/text.js +1 -1
- package/dist/textarea/index.d.ts +1 -0
- package/dist/textarea/index.js +1 -0
- package/dist/textarea/textarea.d.ts +22 -0
- package/dist/textarea/textarea.js +77 -0
- package/dist/theme/dark.d.ts +129 -10
- package/dist/theme/dark.js +41 -13
- package/dist/theme/index.d.ts +3 -12
- package/dist/theme/index.js +2 -2
- package/dist/theme/light.d.ts +129 -10
- package/dist/theme/light.js +42 -14
- package/dist/theme/swatch.d.ts +27 -0
- package/dist/theme/swatch.js +37 -0
- package/dist/theme/theme.d.ts +648 -0
- package/dist/theme/theme.js +780 -0
- package/dist/theme/types.d.ts +1 -0
- package/dist/theme/useInvertedTheme.d.ts +1 -0
- package/dist/theme/useInvertedTheme.js +7 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tooltip/tooltip.d.ts +166 -0
- package/dist/tooltip/tooltip.js +181 -0
- package/dist/tooltip/useDisabledTooltip.d.ts +22 -0
- package/dist/tooltip/useDisabledTooltip.js +24 -0
- package/dist/trackingContext.d.ts +34 -0
- package/dist/trackingContext.js +29 -0
- package/dist/translation/index.d.ts +4 -0
- package/dist/translation/index.js +4 -0
- package/dist/translation/translationContext.d.ts +6 -0
- package/dist/translation/translationContext.js +6 -0
- package/dist/translation/useTranslation.d.ts +1 -0
- package/dist/translation/useTranslation.js +6 -0
- package/dist/unreachable.d.ts +1 -0
- package/dist/unreachable.js +4 -0
- package/dist/useHoverOverlay.d.ts +113 -0
- package/dist/useHoverOverlay.js +370 -0
- package/dist/useIsInsideInteractiveElement.d.ts +6 -0
- package/dist/useIsInsideInteractiveElement.js +31 -0
- package/dist/useOverlay.d.ts +82 -0
- package/dist/useOverlay.js +217 -0
- package/dist/useScrollLock.d.ts +5 -0
- package/dist/useScrollLock.js +100 -0
- package/dist/useStableMergeRef.d.ts +9 -0
- package/dist/useStableMergeRef.js +18 -0
- package/package.json +219 -11
- package/dist/index.d.ts +0 -9
- 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 };
|
package/dist/text/heading.d.ts
CHANGED
|
@@ -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;
|
package/dist/text/index.d.ts
CHANGED
package/dist/text/index.js
CHANGED
|
@@ -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 };
|
package/dist/text/text.d.ts
CHANGED
|
@@ -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 };
|
package/dist/theme/dark.d.ts
CHANGED
|
@@ -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
|
+
* 
|
|
1791
|
+
*
|
|
1792
|
+
* `ansi.black` `#E7E5EA`
|
|
1793
|
+
*
|
|
1794
|
+
*/
|
|
1781
1795
|
black: string;
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1796
|
+
/**
|
|
1797
|
+
*
|
|
1798
|
+
* 
|
|
1799
|
+
*
|
|
1800
|
+
* `ansi.blue` `#BCBAFD`
|
|
1801
|
+
*
|
|
1802
|
+
*/
|
|
1785
1803
|
blue: string;
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1804
|
+
/**
|
|
1805
|
+
*
|
|
1806
|
+
* 
|
|
1807
|
+
*
|
|
1808
|
+
* `ansi.brightBlack` `#C4C0CB`
|
|
1809
|
+
*
|
|
1810
|
+
*/
|
|
1789
1811
|
brightBlack: string;
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1812
|
+
/**
|
|
1813
|
+
*
|
|
1814
|
+
* 
|
|
1815
|
+
*
|
|
1816
|
+
* `ansi.brightBlue` `#CFCEFF`
|
|
1817
|
+
*
|
|
1818
|
+
*/
|
|
1793
1819
|
brightBlue: string;
|
|
1794
|
-
|
|
1820
|
+
/**
|
|
1821
|
+
*
|
|
1822
|
+
* 
|
|
1823
|
+
*
|
|
1824
|
+
* `ansi.brightCyan` `#91d8d7`
|
|
1825
|
+
*
|
|
1826
|
+
*/
|
|
1795
1827
|
brightCyan: string;
|
|
1828
|
+
/**
|
|
1829
|
+
*
|
|
1830
|
+
* 
|
|
1831
|
+
*
|
|
1832
|
+
* `ansi.brightGreen` `#A8E6AF`
|
|
1833
|
+
*
|
|
1834
|
+
*/
|
|
1835
|
+
brightGreen: string;
|
|
1836
|
+
/**
|
|
1837
|
+
*
|
|
1838
|
+
* 
|
|
1839
|
+
*
|
|
1840
|
+
* `ansi.brightMagenta` `#F8C3D8`
|
|
1841
|
+
*
|
|
1842
|
+
*/
|
|
1843
|
+
brightMagenta: string;
|
|
1844
|
+
/**
|
|
1845
|
+
*
|
|
1846
|
+
* 
|
|
1847
|
+
*
|
|
1848
|
+
* `ansi.brightRed` `#FFC2BC`
|
|
1849
|
+
*
|
|
1850
|
+
*/
|
|
1851
|
+
brightRed: string;
|
|
1852
|
+
/**
|
|
1853
|
+
*
|
|
1854
|
+
* 
|
|
1855
|
+
*
|
|
1856
|
+
* `ansi.brightWhite` `#F9F8F9`
|
|
1857
|
+
*
|
|
1858
|
+
*/
|
|
1796
1859
|
brightWhite: string;
|
|
1860
|
+
/**
|
|
1861
|
+
*
|
|
1862
|
+
* 
|
|
1863
|
+
*
|
|
1864
|
+
* `ansi.brightYellow` `#E9D290`
|
|
1865
|
+
*
|
|
1866
|
+
*/
|
|
1867
|
+
brightYellow: string;
|
|
1868
|
+
/**
|
|
1869
|
+
*
|
|
1870
|
+
* 
|
|
1871
|
+
*
|
|
1872
|
+
* `ansi.cyan` `#77cecd`
|
|
1873
|
+
*
|
|
1874
|
+
*/
|
|
1875
|
+
cyan: string;
|
|
1876
|
+
/**
|
|
1877
|
+
*
|
|
1878
|
+
* 
|
|
1879
|
+
*
|
|
1880
|
+
* `ansi.green` `#83DA90`
|
|
1881
|
+
*
|
|
1882
|
+
*/
|
|
1883
|
+
green: string;
|
|
1884
|
+
/**
|
|
1885
|
+
*
|
|
1886
|
+
* 
|
|
1887
|
+
*
|
|
1888
|
+
* `ansi.magenta` `#F1AAC8`
|
|
1889
|
+
*
|
|
1890
|
+
*/
|
|
1891
|
+
magenta: string;
|
|
1892
|
+
/**
|
|
1893
|
+
*
|
|
1894
|
+
* 
|
|
1895
|
+
*
|
|
1896
|
+
* `ansi.red` `#FCAAA2`
|
|
1897
|
+
*
|
|
1898
|
+
*/
|
|
1899
|
+
red: string;
|
|
1900
|
+
/**
|
|
1901
|
+
*
|
|
1902
|
+
* 
|
|
1903
|
+
*
|
|
1904
|
+
* `ansi.white` `#E7E5EA`
|
|
1905
|
+
*
|
|
1906
|
+
*/
|
|
1907
|
+
white: string;
|
|
1908
|
+
/**
|
|
1909
|
+
*
|
|
1910
|
+
* 
|
|
1911
|
+
*
|
|
1912
|
+
* `ansi.yellow` `#E0C05E`
|
|
1913
|
+
*
|
|
1914
|
+
*/
|
|
1915
|
+
yellow: string;
|
|
1797
1916
|
};
|
|
1798
1917
|
};
|
|
1799
1918
|
};
|
package/dist/theme/dark.js
CHANGED
|
@@ -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
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
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
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
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 = {
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
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';
|
package/dist/theme/index.js
CHANGED