@molecule/app-ui-react 4.3.2 → 4.11.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 +137 -244
- package/dist/components/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion.js +4 -3
- package/dist/components/Accordion.js.map +1 -1
- package/dist/components/Alert.d.ts.map +1 -1
- package/dist/components/Alert.js +2 -1
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/AuthGuard.d.ts.map +1 -1
- package/dist/components/AuthGuard.js +2 -1
- package/dist/components/AuthGuard.js.map +1 -1
- package/dist/components/Avatar.d.ts.map +1 -1
- package/dist/components/Avatar.js +2 -2
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Badge.d.ts.map +1 -1
- package/dist/components/Badge.js +4 -1
- package/dist/components/Badge.js.map +1 -1
- package/dist/components/Button.d.ts.map +1 -1
- package/dist/components/Button.js +3 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.d.ts +6 -6
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/Card.js +43 -17
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Checkbox.d.ts.map +1 -1
- package/dist/components/Checkbox.js +4 -20
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/ConfirmButton.d.ts +4 -4
- package/dist/components/ConfirmButton.d.ts.map +1 -1
- package/dist/components/ConfirmButton.js +18 -13
- package/dist/components/ConfirmButton.js.map +1 -1
- package/dist/components/ConfirmButton.native.d.ts +8 -0
- package/dist/components/ConfirmButton.native.d.ts.map +1 -0
- package/dist/components/ConfirmButton.native.js +4 -0
- package/dist/components/ConfirmButton.native.js.map +1 -0
- package/dist/components/ConfirmButton.web.d.ts +6 -0
- package/dist/components/ConfirmButton.web.d.ts.map +1 -0
- package/dist/components/ConfirmButton.web.js +4 -0
- package/dist/components/ConfirmButton.web.js.map +1 -0
- package/dist/components/ConfirmDialog.d.ts.map +1 -1
- package/dist/components/ConfirmDialog.js +2 -1
- package/dist/components/ConfirmDialog.js.map +1 -1
- package/dist/components/Dropdown.d.ts +7 -7
- package/dist/components/Dropdown.d.ts.map +1 -1
- package/dist/components/Dropdown.js +66 -125
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Dropdown.native.d.ts +15 -0
- package/dist/components/Dropdown.native.d.ts.map +1 -0
- package/dist/components/Dropdown.native.js +9 -0
- package/dist/components/Dropdown.native.js.map +1 -0
- package/dist/components/Dropdown.web.d.ts +15 -0
- package/dist/components/Dropdown.web.d.ts.map +1 -0
- package/dist/components/Dropdown.web.js +9 -0
- package/dist/components/Dropdown.web.js.map +1 -0
- package/dist/components/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState.js +2 -1
- package/dist/components/EmptyState.js.map +1 -1
- package/dist/components/FloatingInput.d.ts +6 -2
- package/dist/components/FloatingInput.d.ts.map +1 -1
- package/dist/components/FloatingInput.js +13 -8
- package/dist/components/FloatingInput.js.map +1 -1
- package/dist/components/Form.d.ts +11 -2
- package/dist/components/Form.d.ts.map +1 -1
- package/dist/components/Form.js +17 -10
- package/dist/components/Form.js.map +1 -1
- package/dist/components/Icon.d.ts +15 -23
- package/dist/components/Icon.d.ts.map +1 -1
- package/dist/components/Icon.js +14 -20
- package/dist/components/Icon.js.map +1 -1
- package/dist/components/Input.d.ts.map +1 -1
- package/dist/components/Input.js +20 -3
- package/dist/components/Input.js.map +1 -1
- package/dist/components/LanguagePicker.d.ts +5 -4
- package/dist/components/LanguagePicker.d.ts.map +1 -1
- package/dist/components/LanguagePicker.js +5 -3
- package/dist/components/LanguagePicker.js.map +1 -1
- package/dist/components/Layout.d.ts.map +1 -1
- package/dist/components/Layout.js +7 -4
- package/dist/components/Layout.js.map +1 -1
- package/dist/components/LoadErrorBanner.d.ts +4 -3
- package/dist/components/LoadErrorBanner.d.ts.map +1 -1
- package/dist/components/LoadErrorBanner.js +4 -2
- package/dist/components/LoadErrorBanner.js.map +1 -1
- package/dist/components/Modal.d.ts +5 -23
- package/dist/components/Modal.d.ts.map +1 -1
- package/dist/components/Modal.js +38 -201
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/PageHeader.d.ts.map +1 -1
- package/dist/components/PageHeader.js +2 -1
- package/dist/components/PageHeader.js.map +1 -1
- package/dist/components/PageShell.d.ts.map +1 -1
- package/dist/components/PageShell.js +3 -2
- package/dist/components/PageShell.js.map +1 -1
- package/dist/components/Pagination.d.ts.map +1 -1
- package/dist/components/Pagination.js +7 -6
- package/dist/components/Pagination.js.map +1 -1
- package/dist/components/Progress.d.ts.map +1 -1
- package/dist/components/Progress.js +2 -1
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/PromptDialog.d.ts.map +1 -1
- package/dist/components/PromptDialog.js +18 -21
- package/dist/components/PromptDialog.js.map +1 -1
- package/dist/components/RadioGroup.d.ts.map +1 -1
- package/dist/components/RadioGroup.js +4 -3
- package/dist/components/RadioGroup.js.map +1 -1
- package/dist/components/ResponsiveAppShell.d.ts.map +1 -1
- package/dist/components/ResponsiveAppShell.js +29 -136
- package/dist/components/ResponsiveAppShell.js.map +1 -1
- package/dist/components/Select.d.ts +21 -6
- package/dist/components/Select.d.ts.map +1 -1
- package/dist/components/Select.js +50 -37
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Separator.d.ts.map +1 -1
- package/dist/components/Separator.js +2 -1
- package/dist/components/Separator.js.map +1 -1
- package/dist/components/SidebarUserCard.d.ts +5 -4
- package/dist/components/SidebarUserCard.d.ts.map +1 -1
- package/dist/components/SidebarUserCard.js +4 -3
- package/dist/components/SidebarUserCard.js.map +1 -1
- package/dist/components/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton.js +3 -2
- package/dist/components/Skeleton.js.map +1 -1
- package/dist/components/Spinner.d.ts.map +1 -1
- package/dist/components/Spinner.js +2 -1
- package/dist/components/Spinner.js.map +1 -1
- package/dist/components/Switch.d.ts.map +1 -1
- package/dist/components/Switch.js +5 -43
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Table.js +9 -8
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Tabs.d.ts.map +1 -1
- package/dist/components/Tabs.js +5 -4
- package/dist/components/Tabs.js.map +1 -1
- package/dist/components/Textarea.d.ts +1 -2
- package/dist/components/Textarea.d.ts.map +1 -1
- package/dist/components/Textarea.js +8 -47
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/ThemeToggle.d.ts +5 -4
- package/dist/components/ThemeToggle.d.ts.map +1 -1
- package/dist/components/ThemeToggle.js +6 -2
- package/dist/components/ThemeToggle.js.map +1 -1
- package/dist/components/Toast.d.ts +14 -12
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +38 -64
- package/dist/components/Toast.js.map +1 -1
- package/dist/components/Toast.native.d.ts +17 -0
- package/dist/components/Toast.native.d.ts.map +1 -0
- package/dist/components/Toast.native.js +14 -0
- package/dist/components/Toast.native.js.map +1 -0
- package/dist/components/Toast.web.d.ts +16 -0
- package/dist/components/Toast.web.d.ts.map +1 -0
- package/dist/components/Toast.web.js +14 -0
- package/dist/components/Toast.web.js.map +1 -0
- package/dist/components/Tooltip.d.ts +5 -3
- package/dist/components/Tooltip.d.ts.map +1 -1
- package/dist/components/Tooltip.js +81 -209
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Tooltip.native.d.ts +11 -0
- package/dist/components/Tooltip.native.d.ts.map +1 -0
- package/dist/components/Tooltip.native.js +9 -0
- package/dist/components/Tooltip.native.js.map +1 -0
- package/dist/components/Tooltip.web.d.ts +10 -0
- package/dist/components/Tooltip.web.d.ts.map +1 -0
- package/dist/components/Tooltip.web.js +9 -0
- package/dist/components/Tooltip.web.js.map +1 -0
- package/dist/components/UserMenuPopover.d.ts.map +1 -1
- package/dist/components/UserMenuPopover.js +19 -33
- package/dist/components/UserMenuPopover.js.map +1 -1
- package/dist/components/index.d.ts +4 -4
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -4
- package/dist/components/index.js.map +1 -1
- package/dist/elements/Anchor.d.ts +14 -0
- package/dist/elements/Anchor.d.ts.map +1 -0
- package/dist/elements/Anchor.js +17 -0
- package/dist/elements/Anchor.js.map +1 -0
- package/dist/elements/Box.d.ts +16 -0
- package/dist/elements/Box.d.ts.map +1 -0
- package/dist/elements/Box.js +57 -0
- package/dist/elements/Box.js.map +1 -0
- package/dist/elements/CheckField.d.ts +17 -0
- package/dist/elements/CheckField.d.ts.map +1 -0
- package/dist/elements/CheckField.js +53 -0
- package/dist/elements/CheckField.js.map +1 -0
- package/dist/elements/Disclosure.d.ts +12 -0
- package/dist/elements/Disclosure.d.ts.map +1 -0
- package/dist/elements/Disclosure.js +25 -0
- package/dist/elements/Disclosure.js.map +1 -0
- package/dist/elements/Fieldset.d.ts +16 -0
- package/dist/elements/Fieldset.d.ts.map +1 -0
- package/dist/elements/Fieldset.js +18 -0
- package/dist/elements/Fieldset.js.map +1 -0
- package/dist/elements/FileField.d.ts +15 -0
- package/dist/elements/FileField.d.ts.map +1 -0
- package/dist/elements/FileField.js +28 -0
- package/dist/elements/FileField.js.map +1 -0
- package/dist/elements/FormArea.d.ts +18 -0
- package/dist/elements/FormArea.d.ts.map +1 -0
- package/dist/elements/FormArea.js +26 -0
- package/dist/elements/FormArea.js.map +1 -0
- package/dist/elements/GlyphIcon.d.ts +17 -0
- package/dist/elements/GlyphIcon.d.ts.map +1 -0
- package/dist/elements/GlyphIcon.js +29 -0
- package/dist/elements/GlyphIcon.js.map +1 -0
- package/dist/elements/Image.d.ts +17 -0
- package/dist/elements/Image.d.ts.map +1 -0
- package/dist/elements/Image.js +22 -0
- package/dist/elements/Image.js.map +1 -0
- package/dist/elements/Link.d.ts +17 -0
- package/dist/elements/Link.d.ts.map +1 -0
- package/dist/elements/Link.js +15 -0
- package/dist/elements/Link.js.map +1 -0
- package/dist/elements/Pressable.d.ts +17 -0
- package/dist/elements/Pressable.d.ts.map +1 -0
- package/dist/elements/Pressable.js +43 -0
- package/dist/elements/Pressable.js.map +1 -0
- package/dist/elements/PulseDots.d.ts +15 -0
- package/dist/elements/PulseDots.d.ts.map +1 -0
- package/dist/elements/PulseDots.js +36 -0
- package/dist/elements/PulseDots.js.map +1 -0
- package/dist/elements/RangeField.d.ts +11 -0
- package/dist/elements/RangeField.d.ts.map +1 -0
- package/dist/elements/RangeField.js +24 -0
- package/dist/elements/RangeField.js.map +1 -0
- package/dist/elements/RichText.d.ts +23 -0
- package/dist/elements/RichText.d.ts.map +1 -0
- package/dist/elements/RichText.js +40 -0
- package/dist/elements/RichText.js.map +1 -0
- package/dist/elements/Rule.d.ts +9 -0
- package/dist/elements/Rule.d.ts.map +1 -0
- package/dist/elements/Rule.js +16 -0
- package/dist/elements/Rule.js.map +1 -0
- package/dist/elements/ScrollArea.d.ts +16 -0
- package/dist/elements/ScrollArea.d.ts.map +1 -0
- package/dist/elements/ScrollArea.js +42 -0
- package/dist/elements/ScrollArea.js.map +1 -0
- package/dist/elements/SelectField.d.ts +11 -0
- package/dist/elements/SelectField.d.ts.map +1 -0
- package/dist/elements/SelectField.js +64 -0
- package/dist/elements/SelectField.js.map +1 -0
- package/dist/elements/Svg.d.ts +124 -0
- package/dist/elements/Svg.d.ts.map +1 -0
- package/dist/elements/Svg.js +178 -0
- package/dist/elements/Svg.js.map +1 -0
- package/dist/elements/TableBox.d.ts +16 -0
- package/dist/elements/TableBox.d.ts.map +1 -0
- package/dist/elements/TableBox.js +18 -0
- package/dist/elements/TableBox.js.map +1 -0
- package/dist/elements/TableCell.d.ts +16 -0
- package/dist/elements/TableCell.d.ts.map +1 -0
- package/dist/elements/TableCell.js +18 -0
- package/dist/elements/TableCell.js.map +1 -0
- package/dist/elements/Text.d.ts +18 -0
- package/dist/elements/Text.d.ts.map +1 -0
- package/dist/elements/Text.js +20 -0
- package/dist/elements/Text.js.map +1 -0
- package/dist/elements/TextField.d.ts +18 -0
- package/dist/elements/TextField.d.ts.map +1 -0
- package/dist/elements/TextField.js +105 -0
- package/dist/elements/TextField.js.map +1 -0
- package/dist/elements/drag.d.ts +11 -0
- package/dist/elements/drag.d.ts.map +1 -0
- package/dist/elements/drag.js +22 -0
- package/dist/elements/drag.js.map +1 -0
- package/dist/elements/flow.d.ts +17 -0
- package/dist/elements/flow.d.ts.map +1 -0
- package/dist/elements/flow.js +18 -0
- package/dist/elements/flow.js.map +1 -0
- package/dist/elements/hover.d.ts +10 -0
- package/dist/elements/hover.d.ts.map +1 -0
- package/dist/elements/hover.js +23 -0
- package/dist/elements/hover.js.map +1 -0
- package/dist/elements/index.d.ts +45 -0
- package/dist/elements/index.d.ts.map +1 -0
- package/dist/elements/index.js +45 -0
- package/dist/elements/index.js.map +1 -0
- package/dist/elements/measure.d.ts +25 -0
- package/dist/elements/measure.d.ts.map +1 -0
- package/dist/elements/measure.js +20 -0
- package/dist/elements/measure.js.map +1 -0
- package/dist/elements/paste.d.ts +5 -0
- package/dist/elements/paste.d.ts.map +1 -0
- package/dist/elements/paste.js +15 -0
- package/dist/elements/paste.js.map +1 -0
- package/dist/elements/ref.d.ts +16 -0
- package/dist/elements/ref.d.ts.map +1 -0
- package/dist/elements/ref.js +18 -0
- package/dist/elements/ref.js.map +1 -0
- package/dist/elements/reveal.d.ts +8 -0
- package/dist/elements/reveal.d.ts.map +1 -0
- package/dist/elements/reveal.js +14 -0
- package/dist/elements/reveal.js.map +1 -0
- package/dist/elements/style.d.ts +35 -0
- package/dist/elements/style.d.ts.map +1 -0
- package/dist/elements/style.js +34 -0
- package/dist/elements/style.js.map +1 -0
- package/dist/elements/types.d.ts +23 -0
- package/dist/elements/types.d.ts.map +1 -0
- package/dist/elements/types.js +7 -0
- package/dist/elements/types.js.map +1 -0
- package/dist/elements/viewport.d.ts +53 -0
- package/dist/elements/viewport.d.ts.map +1 -0
- package/dist/elements/viewport.js +104 -0
- package/dist/elements/viewport.js.map +1 -0
- package/dist/elements/wheelZoom.d.ts +12 -0
- package/dist/elements/wheelZoom.d.ts.map +1 -0
- package/dist/elements/wheelZoom.js +18 -0
- package/dist/elements/wheelZoom.js.map +1 -0
- package/dist/index.web.d.ts +13 -0
- package/dist/index.web.d.ts.map +1 -0
- package/dist/index.web.js +12 -0
- package/dist/index.web.js.map +1 -0
- package/dist/platform/arrow.d.ts +5 -0
- package/dist/platform/arrow.d.ts.map +1 -0
- package/dist/platform/arrow.js +49 -0
- package/dist/platform/arrow.js.map +1 -0
- package/dist/platform/index.d.ts +29 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +180 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/types.d.ts +19 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utilities/isReactNode.d.ts +16 -0
- package/dist/utilities/isReactNode.d.ts.map +1 -0
- package/dist/utilities/isReactNode.js +27 -0
- package/dist/utilities/isReactNode.js.map +1 -0
- package/dist/utilities/mergeRefs.d.ts +7 -3
- package/dist/utilities/mergeRefs.d.ts.map +1 -1
- package/dist/utilities/mergeRefs.js +22 -11
- package/dist/utilities/mergeRefs.js.map +1 -1
- package/dist/utilities/renderIcon.d.ts +3 -2
- package/dist/utilities/renderIcon.d.ts.map +1 -1
- package/dist/utilities/renderIcon.js +9 -14
- package/dist/utilities/renderIcon.js.map +1 -1
- package/package.json +39 -14
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Svg and its shapes.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactElement } from 'react';
|
|
7
|
+
import type { ElementHandle, SvgCircleProps, SvgClipPathProps, SvgDefsProps, SvgEllipseProps, SvgGroupProps, SvgImageProps, SvgLinearGradientProps, SvgLineProps, SvgMarkupProps, SvgPathProps, SvgPatternProps, SvgPolyProps, SvgProps, SvgRectProps, SvgTextProps } from '@molecule/app-ui';
|
|
8
|
+
import type { ElementNode, ShapeNode } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* An SVG canvas: renders exactly an `<svg>`. On React Native it is react-native-svg's `Svg`.
|
|
11
|
+
*
|
|
12
|
+
* @param props - See {@link SvgProps}.
|
|
13
|
+
* @param ref - The literal SVG viewport.
|
|
14
|
+
* @returns The element.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Svg: import("react").ForwardRefExoticComponent<SvgProps<ShapeNode> & import("react").RefAttributes<ElementHandle>>;
|
|
17
|
+
/**
|
|
18
|
+
* An SVG canvas drawn from inner markup: an `<svg>` holding exactly that markup. On React Native it
|
|
19
|
+
* is react-native-svg's `SvgXml`.
|
|
20
|
+
*
|
|
21
|
+
* @param props - See {@link SvgMarkupProps}.
|
|
22
|
+
* @param ref - The literal SVG viewport.
|
|
23
|
+
* @returns The element.
|
|
24
|
+
*/
|
|
25
|
+
export declare const SvgMarkup: import("react").ForwardRefExoticComponent<SvgMarkupProps & import("react").RefAttributes<ElementHandle>>;
|
|
26
|
+
/**
|
|
27
|
+
* An SVG `<path>`.
|
|
28
|
+
*
|
|
29
|
+
* @param props - See {@link SvgPathProps}.
|
|
30
|
+
* @returns The element.
|
|
31
|
+
*/
|
|
32
|
+
export declare function Path(props: SvgPathProps): ReactElement;
|
|
33
|
+
/**
|
|
34
|
+
* An SVG `<rect>`.
|
|
35
|
+
*
|
|
36
|
+
* @param props - See {@link SvgRectProps}.
|
|
37
|
+
* @returns The element.
|
|
38
|
+
*/
|
|
39
|
+
export declare function Rect({ metadata, ...props }: SvgRectProps): ReactElement;
|
|
40
|
+
/**
|
|
41
|
+
* An SVG `<circle>`.
|
|
42
|
+
*
|
|
43
|
+
* @param props - See {@link SvgCircleProps}.
|
|
44
|
+
* @returns The element.
|
|
45
|
+
*/
|
|
46
|
+
export declare function Circle(props: SvgCircleProps): ReactElement;
|
|
47
|
+
/**
|
|
48
|
+
* An SVG `<ellipse>`.
|
|
49
|
+
*
|
|
50
|
+
* @param props - See {@link SvgEllipseProps}.
|
|
51
|
+
* @returns The element.
|
|
52
|
+
*/
|
|
53
|
+
export declare function Ellipse(props: SvgEllipseProps): ReactElement;
|
|
54
|
+
/**
|
|
55
|
+
* An SVG `<line>`.
|
|
56
|
+
*
|
|
57
|
+
* @param props - See {@link SvgLineProps}.
|
|
58
|
+
* @returns The element.
|
|
59
|
+
*/
|
|
60
|
+
export declare function Line(props: SvgLineProps): ReactElement;
|
|
61
|
+
/**
|
|
62
|
+
* An SVG `<polyline>`.
|
|
63
|
+
*
|
|
64
|
+
* @param props - See {@link SvgPolyProps}.
|
|
65
|
+
* @returns The element.
|
|
66
|
+
*/
|
|
67
|
+
export declare function Polyline(props: SvgPolyProps): ReactElement;
|
|
68
|
+
/**
|
|
69
|
+
* An SVG `<polygon>`.
|
|
70
|
+
*
|
|
71
|
+
* @param props - See {@link SvgPolyProps}.
|
|
72
|
+
* @returns The element.
|
|
73
|
+
*/
|
|
74
|
+
export declare function Polygon(props: SvgPolyProps): ReactElement;
|
|
75
|
+
/**
|
|
76
|
+
* An SVG group, `<g>`.
|
|
77
|
+
*
|
|
78
|
+
* @param props - See {@link SvgGroupProps}.
|
|
79
|
+
* @returns The element.
|
|
80
|
+
*/
|
|
81
|
+
export declare function G({ drag, ...props }: SvgGroupProps<ShapeNode>): ReactElement;
|
|
82
|
+
/**
|
|
83
|
+
* SVG `<text>`.
|
|
84
|
+
*
|
|
85
|
+
* @param props - See {@link SvgTextProps}.
|
|
86
|
+
* @returns The element.
|
|
87
|
+
*/
|
|
88
|
+
export declare function SvgText(props: SvgTextProps<ElementNode>): ReactElement;
|
|
89
|
+
/**
|
|
90
|
+
* An SVG `<defs>` containing named drawing definitions.
|
|
91
|
+
*
|
|
92
|
+
* @param props - See {@link SvgDefsProps}.
|
|
93
|
+
* @returns The element.
|
|
94
|
+
*/
|
|
95
|
+
export declare function SvgDefs(props: SvgDefsProps<ShapeNode>): ReactElement;
|
|
96
|
+
/**
|
|
97
|
+
* An SVG `<clipPath>` containing geometry for a local clipping reference.
|
|
98
|
+
*
|
|
99
|
+
* @param props - See {@link SvgClipPathProps}.
|
|
100
|
+
* @returns The element.
|
|
101
|
+
*/
|
|
102
|
+
export declare function SvgClipPath(props: SvgClipPathProps<ShapeNode>): ReactElement;
|
|
103
|
+
/**
|
|
104
|
+
* An SVG `<linearGradient>` with literal stops in input order.
|
|
105
|
+
*
|
|
106
|
+
* @param props - See {@link SvgLinearGradientProps}.
|
|
107
|
+
* @returns The element.
|
|
108
|
+
*/
|
|
109
|
+
export declare function SvgLinearGradient({ stops, ...props }: SvgLinearGradientProps): ReactElement;
|
|
110
|
+
/**
|
|
111
|
+
* An SVG `<pattern>` whose children draw a repeating tile.
|
|
112
|
+
*
|
|
113
|
+
* @param props - See {@link SvgPatternProps}.
|
|
114
|
+
* @returns The element.
|
|
115
|
+
*/
|
|
116
|
+
export declare function SvgPattern(props: SvgPatternProps<ShapeNode>): ReactElement;
|
|
117
|
+
/**
|
|
118
|
+
* An SVG `<image>` positioned in the drawing's coordinate system.
|
|
119
|
+
*
|
|
120
|
+
* @param props - See {@link SvgImageProps}.
|
|
121
|
+
* @returns The element.
|
|
122
|
+
*/
|
|
123
|
+
export declare function SvgImage(props: SvgImageProps): ReactElement;
|
|
124
|
+
//# sourceMappingURL=Svg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Svg.d.ts","sourceRoot":"","sources":["../../src/elements/Svg.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA6B,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAEpF,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,YAAY,EAEZ,eAAe,EACf,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,YAAY,EACZ,cAAc,EAEd,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,YAAY,EACb,MAAM,kBAAkB,CAAA;AAKzB,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAExD;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,+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E,eAAe,CAAC,SAAS,CAAC,GAAG,YAAY,CAE1E;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,CAE3D"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Svg and its shapes.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement, forwardRef } from 'react';
|
|
7
|
+
import { useWebDrag } from './drag.js';
|
|
8
|
+
import { useElementRef } from './ref.js';
|
|
9
|
+
import { webElementAttributes } from './style.js';
|
|
10
|
+
/**
|
|
11
|
+
* An SVG canvas: renders exactly an `<svg>`. On React Native it is react-native-svg's `Svg`.
|
|
12
|
+
*
|
|
13
|
+
* @param props - See {@link SvgProps}.
|
|
14
|
+
* @param ref - The literal SVG viewport.
|
|
15
|
+
* @returns The element.
|
|
16
|
+
*/
|
|
17
|
+
export const Svg = forwardRef(function Svg({ drag, metadata, children, ...props }, ref) {
|
|
18
|
+
return createElement('svg', webElementAttributes(props, {
|
|
19
|
+
ref: useElementRef(ref),
|
|
20
|
+
onPointerDown: useWebDrag(drag),
|
|
21
|
+
}, { webShapeRendering: 'shapeRendering' }), ...metadataChildren(metadata), children);
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* An SVG canvas drawn from inner markup: an `<svg>` holding exactly that markup. On React Native it
|
|
25
|
+
* is react-native-svg's `SvgXml`.
|
|
26
|
+
*
|
|
27
|
+
* @param props - See {@link SvgMarkupProps}.
|
|
28
|
+
* @param ref - The literal SVG viewport.
|
|
29
|
+
* @returns The element.
|
|
30
|
+
*/
|
|
31
|
+
export const SvgMarkup = forwardRef(function SvgMarkup({ markup, ...props }, ref) {
|
|
32
|
+
return createElement('svg', webElementAttributes(props, {
|
|
33
|
+
ref: useElementRef(ref),
|
|
34
|
+
dangerouslySetInnerHTML: { __html: markup },
|
|
35
|
+
}, { webShapeRendering: 'shapeRendering' }));
|
|
36
|
+
});
|
|
37
|
+
/** Applies the CSS escape hatch without introducing an extra node or attribute. */
|
|
38
|
+
function shape(tag, props, ...children) {
|
|
39
|
+
return createElement(tag, webElementAttributes(props), ...children);
|
|
40
|
+
}
|
|
41
|
+
/** Emits descriptive children first, only when supplied by the owner. */
|
|
42
|
+
function metadataChildren(metadata) {
|
|
43
|
+
const children = [];
|
|
44
|
+
if (metadata?.title !== undefined)
|
|
45
|
+
children.push(createElement('title', null, metadata.title));
|
|
46
|
+
const description = metadata?.description;
|
|
47
|
+
if (description)
|
|
48
|
+
children.push(createElement('desc', { id: description.id }, description.text));
|
|
49
|
+
return children;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* An SVG `<path>`.
|
|
53
|
+
*
|
|
54
|
+
* @param props - See {@link SvgPathProps}.
|
|
55
|
+
* @returns The element.
|
|
56
|
+
*/
|
|
57
|
+
export function Path(props) {
|
|
58
|
+
return shape('path', props);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* An SVG `<rect>`.
|
|
62
|
+
*
|
|
63
|
+
* @param props - See {@link SvgRectProps}.
|
|
64
|
+
* @returns The element.
|
|
65
|
+
*/
|
|
66
|
+
export function Rect({ metadata, ...props }) {
|
|
67
|
+
return shape('rect', props, ...metadataChildren(metadata));
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* An SVG `<circle>`.
|
|
71
|
+
*
|
|
72
|
+
* @param props - See {@link SvgCircleProps}.
|
|
73
|
+
* @returns The element.
|
|
74
|
+
*/
|
|
75
|
+
export function Circle(props) {
|
|
76
|
+
return shape('circle', props);
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* An SVG `<ellipse>`.
|
|
80
|
+
*
|
|
81
|
+
* @param props - See {@link SvgEllipseProps}.
|
|
82
|
+
* @returns The element.
|
|
83
|
+
*/
|
|
84
|
+
export function Ellipse(props) {
|
|
85
|
+
return shape('ellipse', props);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* An SVG `<line>`.
|
|
89
|
+
*
|
|
90
|
+
* @param props - See {@link SvgLineProps}.
|
|
91
|
+
* @returns The element.
|
|
92
|
+
*/
|
|
93
|
+
export function Line(props) {
|
|
94
|
+
return shape('line', props);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* An SVG `<polyline>`.
|
|
98
|
+
*
|
|
99
|
+
* @param props - See {@link SvgPolyProps}.
|
|
100
|
+
* @returns The element.
|
|
101
|
+
*/
|
|
102
|
+
export function Polyline(props) {
|
|
103
|
+
return shape('polyline', props);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* An SVG `<polygon>`.
|
|
107
|
+
*
|
|
108
|
+
* @param props - See {@link SvgPolyProps}.
|
|
109
|
+
* @returns The element.
|
|
110
|
+
*/
|
|
111
|
+
export function Polygon(props) {
|
|
112
|
+
return shape('polygon', props);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* An SVG group, `<g>`.
|
|
116
|
+
*
|
|
117
|
+
* @param props - See {@link SvgGroupProps}.
|
|
118
|
+
* @returns The element.
|
|
119
|
+
*/
|
|
120
|
+
export function G({ drag, ...props }) {
|
|
121
|
+
const onPointerDown = useWebDrag(drag);
|
|
122
|
+
return shape('g', { ...props, onPointerDown });
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* SVG `<text>`.
|
|
126
|
+
*
|
|
127
|
+
* @param props - See {@link SvgTextProps}.
|
|
128
|
+
* @returns The element.
|
|
129
|
+
*/
|
|
130
|
+
export function SvgText(props) {
|
|
131
|
+
return shape('text', props);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* An SVG `<defs>` containing named drawing definitions.
|
|
135
|
+
*
|
|
136
|
+
* @param props - See {@link SvgDefsProps}.
|
|
137
|
+
* @returns The element.
|
|
138
|
+
*/
|
|
139
|
+
export function SvgDefs(props) {
|
|
140
|
+
return createElement('defs', props);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* An SVG `<clipPath>` containing geometry for a local clipping reference.
|
|
144
|
+
*
|
|
145
|
+
* @param props - See {@link SvgClipPathProps}.
|
|
146
|
+
* @returns The element.
|
|
147
|
+
*/
|
|
148
|
+
export function SvgClipPath(props) {
|
|
149
|
+
return createElement('clipPath', props);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* An SVG `<linearGradient>` with literal stops in input order.
|
|
153
|
+
*
|
|
154
|
+
* @param props - See {@link SvgLinearGradientProps}.
|
|
155
|
+
* @returns The element.
|
|
156
|
+
*/
|
|
157
|
+
export function SvgLinearGradient({ stops, ...props }) {
|
|
158
|
+
return createElement('linearGradient', props, ...stops.map((stop) => createElement('stop', stop)));
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* An SVG `<pattern>` whose children draw a repeating tile.
|
|
162
|
+
*
|
|
163
|
+
* @param props - See {@link SvgPatternProps}.
|
|
164
|
+
* @returns The element.
|
|
165
|
+
*/
|
|
166
|
+
export function SvgPattern(props) {
|
|
167
|
+
return createElement('pattern', props);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* An SVG `<image>` positioned in the drawing's coordinate system.
|
|
171
|
+
*
|
|
172
|
+
* @param props - See {@link SvgImageProps}.
|
|
173
|
+
* @returns The element.
|
|
174
|
+
*/
|
|
175
|
+
export function SvgImage(props) {
|
|
176
|
+
return shape('image', props);
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=Svg.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Svg.js","sourceRoot":"","sources":["../../src/elements/Svg.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAqC,MAAM,OAAO,CAAA;AAuBpF,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YA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AAK,EAA4B;IAC5D,MAAM,aAAa,GAAG,UAAU,CAAc,IAAI,CAAC,CAAA;IACnD,OAAO,KAAK,CAAC,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,aAAa,EAAE,CAAC,CAAA;AAChD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,KAAgC;IACtD,OAAO,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AAC7B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,KAA8B;IACpD,OAAO,aAAa,CAAC,MAAM,EAAE,KAAK,CAAC,CAAA;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAkC;IAC5D,OAAO,aAAa,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACzC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAA0B;IAC3E,OAAO,aAAa,CAAC,gBAAgB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;AACpG,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAiC;IAC1D,OAAO,aAAa,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;AACxC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,KAAoB;IAC3C,OAAO,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;AAC9B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableBox: table, row group and row elements.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactElement } from 'react';
|
|
7
|
+
import type { TableBoxProps } from '@molecule/app-ui';
|
|
8
|
+
import type { ElementNode, ElementRefProps } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Renders the requested table, row group or row tag with no wrapper.
|
|
11
|
+
*
|
|
12
|
+
* @param props - The table part's props and ref.
|
|
13
|
+
* @returns The table part.
|
|
14
|
+
*/
|
|
15
|
+
export declare function TableBox({ as, children, ref, ...props }: TableBoxProps<ElementNode> & ElementRefProps): ReactElement;
|
|
16
|
+
//# sourceMappingURL=TableBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableBox.d.ts","sourceRoot":"","sources":["../../src/elements/TableBox.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAIrD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE9D;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,EACvB,EAAE,EACF,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,aAAa,CAAC,WAAW,CAAC,GAAG,eAAe,GAAG,YAAY,CAE7D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableBox: table, row group and row elements.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement } from 'react';
|
|
7
|
+
import { useElementRef } from './ref.js';
|
|
8
|
+
import { webElementAttributes } from './style.js';
|
|
9
|
+
/**
|
|
10
|
+
* Renders the requested table, row group or row tag with no wrapper.
|
|
11
|
+
*
|
|
12
|
+
* @param props - The table part's props and ref.
|
|
13
|
+
* @returns The table part.
|
|
14
|
+
*/
|
|
15
|
+
export function TableBox({ as, children, ref, ...props }) {
|
|
16
|
+
return createElement(as, { ...webElementAttributes(props), ref: useElementRef(ref) }, children);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=TableBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableBox.js","sourceRoot":"","sources":["../../src/elements/TableBox.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAA;AAIxD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGjD;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,EACvB,EAAE,EACF,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACqC;IAC7C,OAAO,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,oBAAoB,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;AACjG,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableCell: a table data or header cell.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactElement } from 'react';
|
|
7
|
+
import type { TableCellProps } from '@molecule/app-ui';
|
|
8
|
+
import type { ElementNode, ElementRefProps } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Renders the requested data or header cell with its span, scope and handlers.
|
|
11
|
+
*
|
|
12
|
+
* @param props - The cell's props and ref.
|
|
13
|
+
* @returns The table cell.
|
|
14
|
+
*/
|
|
15
|
+
export declare function TableCell({ as, children, ref, ...props }: TableCellProps<ElementNode> & ElementRefProps): ReactElement;
|
|
16
|
+
//# sourceMappingURL=TableCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../src/elements/TableCell.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAItD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE9D;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG,eAAe,GAAG,YAAY,CAM9D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableCell: a table data or header cell.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement } from 'react';
|
|
7
|
+
import { useElementRef } from './ref.js';
|
|
8
|
+
import { webElementAttributes } from './style.js';
|
|
9
|
+
/**
|
|
10
|
+
* Renders the requested data or header cell with its span, scope and handlers.
|
|
11
|
+
*
|
|
12
|
+
* @param props - The cell's props and ref.
|
|
13
|
+
* @returns The table cell.
|
|
14
|
+
*/
|
|
15
|
+
export function TableCell({ as, children, ref, ...props }) {
|
|
16
|
+
return createElement(as, { ...webElementAttributes(props), ref: useElementRef(ref) }, children);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=TableCell.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TableCell.js","sourceRoot":"","sources":["../../src/elements/TableCell.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAA;AAIxD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGjD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,EAAE,EACF,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACsC;IAC9C,OAAO,aAAa,CAClB,EAAE,EACF,EAAE,GAAG,oBAAoB,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,CAAuB,GAAG,CAAC,EAAE,EACjF,QAAQ,CACT,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text: an element that holds text.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactElement } from 'react';
|
|
7
|
+
import type { TextProps } from '@molecule/app-ui';
|
|
8
|
+
import type { ElementNode, ElementRefProps } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Text: renders exactly its `as` tag (`<Text as="h2">` is an `<h2>`). On React Native it is a
|
|
11
|
+
* `Text`, a heading for `h1`–`h6`. Text styles (`cm.textMuted`, a font size) belong on this
|
|
12
|
+
* element: native text does not inherit them from a container.
|
|
13
|
+
*
|
|
14
|
+
* @param props - See {@link TextProps}.
|
|
15
|
+
* @returns The element.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Text({ as, children, ref, ...props }: TextProps<ElementNode> & ElementRefProps): ReactElement;
|
|
18
|
+
//# sourceMappingURL=Text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/elements/Text.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,OAAO,CAAA;AAExD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAIjD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE9D;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAAC,EACnB,EAAE,EACF,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,CAAC,WAAW,CAAC,GAAG,eAAe,GAAG,YAAY,CAEzD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Text: an element that holds text.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement } from 'react';
|
|
7
|
+
import { useElementRef } from './ref.js';
|
|
8
|
+
import { webElementAttributes } from './style.js';
|
|
9
|
+
/**
|
|
10
|
+
* Text: renders exactly its `as` tag (`<Text as="h2">` is an `<h2>`). On React Native it is a
|
|
11
|
+
* `Text`, a heading for `h1`–`h6`. Text styles (`cm.textMuted`, a font size) belong on this
|
|
12
|
+
* element: native text does not inherit them from a container.
|
|
13
|
+
*
|
|
14
|
+
* @param props - See {@link TextProps}.
|
|
15
|
+
* @returns The element.
|
|
16
|
+
*/
|
|
17
|
+
export function Text({ as, children, ref, ...props }) {
|
|
18
|
+
return createElement(as, { ...webElementAttributes(props), ref: useElementRef(ref) }, children);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.js","sourceRoot":"","sources":["../../src/elements/Text.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAqB,MAAM,OAAO,CAAA;AAIxD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGjD;;;;;;;GAOG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,EAAE,EACF,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACiC;IACzC,OAAO,aAAa,CAAC,EAAE,EAAE,EAAE,GAAG,oBAAoB,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;AACjG,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextField: a text input or text area.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactElement } from 'react';
|
|
7
|
+
import type { TextFieldProps } from '@molecule/app-ui';
|
|
8
|
+
import type { ElementRefProps } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* A text field: renders exactly an `<input>` or `<textarea>` with the props given. On React
|
|
11
|
+
* Native it is a `TextInput` (multi-line for `textarea`). `onValueChange` receives the new text on
|
|
12
|
+
* both renderers; `onChange` receives the web event.
|
|
13
|
+
*
|
|
14
|
+
* @param props - See {@link TextFieldProps}.
|
|
15
|
+
* @returns The element.
|
|
16
|
+
*/
|
|
17
|
+
export declare function TextField({ as, autoGrow, selectTextOnFocus, ref, ...props }: TextFieldProps & ElementRefProps): ReactElement;
|
|
18
|
+
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../src/elements/TextField.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAKL,KAAK,YAAY,EAKlB,MAAM,OAAO,CAAA;AAEd,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAKtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,GAAG,EACH,GAAG,KAAK,EACT,EAAE,cAAc,GAAG,eAAe,GAAG,YAAY,CA6DjD"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TextField: a text input or text area.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement, useCallback, useEffect, useRef, } from 'react';
|
|
7
|
+
import { pasteHandler } from './paste.js';
|
|
8
|
+
import { useElementRef } from './ref.js';
|
|
9
|
+
import { webElementAttributes, webElementStyle } from './style.js';
|
|
10
|
+
/**
|
|
11
|
+
* A text field: renders exactly an `<input>` or `<textarea>` with the props given. On React
|
|
12
|
+
* Native it is a `TextInput` (multi-line for `textarea`). `onValueChange` receives the new text on
|
|
13
|
+
* both renderers; `onChange` receives the web event.
|
|
14
|
+
*
|
|
15
|
+
* @param props - See {@link TextFieldProps}.
|
|
16
|
+
* @returns The element.
|
|
17
|
+
*/
|
|
18
|
+
export function TextField({ as, autoGrow, selectTextOnFocus, ref, ...props }) {
|
|
19
|
+
const { type, style, webStyle, onChange, onValueChange, onFocus, onKeyDown, onPasteText } = props;
|
|
20
|
+
// The raw DOM handle provides select() and preserves the field's identity for measurement.
|
|
21
|
+
const forward = useElementRef(ref);
|
|
22
|
+
const node = useRef(null);
|
|
23
|
+
const setNode = useCallback((element) => {
|
|
24
|
+
node.current = element;
|
|
25
|
+
forward?.(element);
|
|
26
|
+
}, [forward]);
|
|
27
|
+
const grow = as === 'textarea' ? autoGrow : undefined;
|
|
28
|
+
const bounded = as === 'input' && (type === 'number' || type === 'date');
|
|
29
|
+
useAutoGrow(node, grow?.minRows, grow?.maxRows, props.value);
|
|
30
|
+
const handleChange = onChange || onValueChange
|
|
31
|
+
? (event) => {
|
|
32
|
+
onChange?.(event);
|
|
33
|
+
onValueChange?.(event.target.value);
|
|
34
|
+
}
|
|
35
|
+
: undefined;
|
|
36
|
+
return createElement(as, webElementAttributes(props, {
|
|
37
|
+
...(bounded ? {} : { min: undefined, max: undefined, step: undefined }),
|
|
38
|
+
...(as === 'input'
|
|
39
|
+
? { rows: undefined, cols: undefined, wrap: undefined }
|
|
40
|
+
: { type: undefined }),
|
|
41
|
+
onChange: handleChange,
|
|
42
|
+
onFocus: selectTextOnFocus
|
|
43
|
+
? (event) => {
|
|
44
|
+
event.currentTarget.select();
|
|
45
|
+
onFocus?.(event);
|
|
46
|
+
}
|
|
47
|
+
: onFocus,
|
|
48
|
+
onKeyDown: onKeyDown
|
|
49
|
+
? (event) => {
|
|
50
|
+
const composing = event.nativeEvent.isComposing;
|
|
51
|
+
const legacyComposition = event.keyCode === 229;
|
|
52
|
+
// The legacy confirmation can arrive with isComposing already false.
|
|
53
|
+
// Cancel its implicit submit while leaving current composition to the IME.
|
|
54
|
+
if (!composing && legacyComposition && event.key === 'Enter')
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
onKeyDown(Object.assign(event, { isComposing: composing || legacyComposition }));
|
|
57
|
+
}
|
|
58
|
+
: undefined,
|
|
59
|
+
onPaste: pasteHandler(onPasteText),
|
|
60
|
+
ref: setNode,
|
|
61
|
+
...(grow && {
|
|
62
|
+
style: {
|
|
63
|
+
...webElementStyle(style, webStyle),
|
|
64
|
+
minHeight: `${Math.min(grow.minRows, grow.maxRows ?? Infinity)}lh`,
|
|
65
|
+
...(grow.maxRows === undefined ? {} : { maxHeight: `${grow.maxRows}lh` }),
|
|
66
|
+
},
|
|
67
|
+
}),
|
|
68
|
+
}, { onPasteText: 'onPaste', onValueChange: 'onChange' }));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Sizes a text area to its text between line counts: on each change of `value` (a field the
|
|
72
|
+
* caller holds) and on each `input` event (one it does not), the height becomes the text's
|
|
73
|
+
* height, at least `minRows` and at most `maxRows` lines.
|
|
74
|
+
*
|
|
75
|
+
* @param node - The text area.
|
|
76
|
+
* @param minRows - The fewest lines, or `undefined` for a field that does not grow.
|
|
77
|
+
* @param maxRows - The most lines, or `undefined` for no limit.
|
|
78
|
+
* @param value - The text the caller holds, if any.
|
|
79
|
+
*/
|
|
80
|
+
function useAutoGrow(node, minRows, maxRows, value) {
|
|
81
|
+
const resize = useCallback(() => {
|
|
82
|
+
const element = node.current;
|
|
83
|
+
if (minRows === undefined || !element)
|
|
84
|
+
return;
|
|
85
|
+
element.style.height = 'auto';
|
|
86
|
+
element.style.height = `${element.scrollHeight}px`;
|
|
87
|
+
}, [node, minRows]);
|
|
88
|
+
// Remeasure on controlled value or row changes after React applies the bounds.
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
resize();
|
|
91
|
+
}, [value, maxRows, resize]);
|
|
92
|
+
// A field the caller does not hold never changes `value`: its own `input` events (typing,
|
|
93
|
+
// paste, IME composition) say it changed.
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
const element = node.current;
|
|
96
|
+
if (minRows === undefined || !element)
|
|
97
|
+
return;
|
|
98
|
+
element.addEventListener('input', resize);
|
|
99
|
+
return () => {
|
|
100
|
+
element.removeEventListener('input', resize);
|
|
101
|
+
element.style.height = '';
|
|
102
|
+
};
|
|
103
|
+
}, [node, minRows, maxRows, resize]);
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=TextField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextField.js","sourceRoot":"","sources":["../../src/elements/TextField.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAEL,aAAa,EAKb,WAAW,EACX,SAAS,EACT,MAAM,GACP,MAAM,OAAO,CAAA;AAId,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAGlE;;;;;;;GAOG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,EAAE,EACF,QAAQ,EACR,iBAAiB,EACjB,GAAG,EACH,GAAG,KAAK,EACyB;IACjC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,KAAK,CAAA;IACjG,2FAA2F;IAC3F,MAAM,OAAO,GAAG,aAAa,CAAyC,GAAG,CAAC,CAAA;IAC1E,MAAM,IAAI,GAAG,MAAM,CAAgD,IAAI,CAAC,CAAA;IACxE,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,OAAsD,EAAQ,EAAE;QAC/D,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,OAAO,EAAE,CAAC,OAAO,CAAC,CAAA;IACpB,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAA;IACD,MAAM,IAAI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AK,CAAC,MAAM,GAAG,MAAM,CAAA;QAC7B,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG,OAAO,CAAC,YAAY,IAAI,CAAA;IACpD,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;IACnB,+EAA+E;IAC/E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,EAAE,CAAA;IACV,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;IAC5B,0FAA0F;IAC1F,0CAA0C;IAC1C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC5B,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,OAAO;YAAE,OAAM;QAC7C,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QACzC,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,mBAAmB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;YAC5C,OAAO,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAA;QAC3B,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;AACtC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type PointerEventHandler } from 'react';
|
|
2
|
+
import type { ElementDrag } from '@molecule/app-ui';
|
|
3
|
+
/**
|
|
4
|
+
* Offers a React element's press to the web kits' shared drag gesture.
|
|
5
|
+
*
|
|
6
|
+
* @param drag - The current drag handlers.
|
|
7
|
+
* @param hostTag - Changes when a polymorphic element replaces its host.
|
|
8
|
+
* @returns The down handler for the existing DOM host.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useWebDrag<T extends HTMLElement | SVGElement>(drag: ElementDrag | undefined, hostTag?: string): PointerEventHandler<T> | undefined;
|
|
11
|
+
//# sourceMappingURL=drag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag.d.ts","sourceRoot":"","sources":["../../src/elements/drag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,mBAAmB,EAAwC,MAAM,OAAO,CAAA;AAGtF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAInD;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,CAAC,SAAS,WAAW,GAAG,UAAU,EAC3D,IAAI,EAAE,WAAW,GAAG,SAAS,EAC7B,OAAO,CAAC,EAAE,MAAM,GACf,mBAAmB,CAAC,CAAC,CAAC,GAAG,SAAS,CAWpC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect, useState } from 'react';
|
|
2
|
+
import { createWebDrag } from '@molecule/app-pointer-events-dom';
|
|
3
|
+
const useIsomorphicLayoutEffect = typeof window === 'undefined' ? useEffect : useLayoutEffect;
|
|
4
|
+
/**
|
|
5
|
+
* Offers a React element's press to the web kits' shared drag gesture.
|
|
6
|
+
*
|
|
7
|
+
* @param drag - The current drag handlers.
|
|
8
|
+
* @param hostTag - Changes when a polymorphic element replaces its host.
|
|
9
|
+
* @returns The down handler for the existing DOM host.
|
|
10
|
+
*/
|
|
11
|
+
export function useWebDrag(drag, hostTag) {
|
|
12
|
+
const [gesture] = useState(() => createWebDrag(drag));
|
|
13
|
+
const enabled = Boolean(drag);
|
|
14
|
+
useIsomorphicLayoutEffect(() => {
|
|
15
|
+
gesture.update(drag);
|
|
16
|
+
});
|
|
17
|
+
useIsomorphicLayoutEffect(() => gesture.cancel, [gesture, enabled, hostTag]);
|
|
18
|
+
if (!drag)
|
|
19
|
+
return undefined;
|
|
20
|
+
return (event) => gesture.start(event.currentTarget, event.nativeEvent, drag, event.target);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=drag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag.js","sourceRoot":"","sources":["../../src/elements/drag.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEtF,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAGhE,MAAM,yBAAyB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,eAAe,CAAA;AAE7F;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CACxB,IAA6B,EAC7B,OAAgB;IAEhB,MAAM,CAAC,OAAO,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAA;IACrD,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE7B,yBAAyB,CAAC,GAAG,EAAE;QAC7B,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACtB,CAAC,CAAC,CAAA;IACF,yBAAyB,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IAE5E,IAAI,CAAC,IAAI;QAAE,OAAO,SAAS,CAAA;IAC3B,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC,WAAW,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;AAC7F,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How components flow in a line: the web reads it from CSS; the native kit is told.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { InlineKind } from '@molecule/app-ui';
|
|
7
|
+
/**
|
|
8
|
+
* Registers how a component flows inside a container that is not a flex container (see
|
|
9
|
+
* {@link InlineKind}). A component that renders an inline element at its root (a button, a badge,
|
|
10
|
+
* an icon) registers, so React Native puts it in the line beside text as the web does. The browser
|
|
11
|
+
* lays inline content out from CSS, so on the web this does nothing.
|
|
12
|
+
*
|
|
13
|
+
* @param _component - The component.
|
|
14
|
+
* @param _kind - Its kind for given props.
|
|
15
|
+
*/
|
|
16
|
+
export declare function registerInline(_component: unknown, _kind: (props: Record<string, unknown>) => InlineKind): void;
|
|
17
|
+
//# sourceMappingURL=flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../src/elements/flow.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,UAAU,EAAE,OAAO,EACnB,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,UAAU,GACpD,IAAI,CAEN"}
|