@molecule/app-ui-react 4.3.1 → 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 +139 -246
- 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 +5 -2
- 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 +5 -3
- 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 +7 -2
- 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 +6 -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 +6 -2
- 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 +23 -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 +7 -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 +39 -200
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/PageHeader.d.ts.map +1 -1
- package/dist/components/PageHeader.js +5 -2
- package/dist/components/PageHeader.js.map +1 -1
- package/dist/components/PageShell.d.ts.map +1 -1
- package/dist/components/PageShell.js +7 -3
- 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 +7 -43
- package/dist/components/Switch.js.map +1 -1
- package/dist/components/Table.d.ts.map +1 -1
- package/dist/components/Table.js +12 -9
- 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 +39 -63
- 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 @@
|
|
|
1
|
+
{"version":3,"file":"Image.js","sourceRoot":"","sources":["../../src/elements/Image.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;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAgC;IACnE,OAAO,aAAa,CAAC,KAAK,EAAE;QAC1B,GAAG,oBAAoB,CAAC,KAAK,CAAC;QAC9B,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC;KACxB,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Link: an in-app or external link.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import type { ElementLinkProps } from '@molecule/app-ui';
|
|
8
|
+
import type { ElementNode, ElementRefProps } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* A link: renders exactly the `<a>` of `@molecule/app-react/link`, which navigates in-app through
|
|
11
|
+
* the router for an app path. On React Native it is a `Pressable` with the link role.
|
|
12
|
+
*
|
|
13
|
+
* @param props - See {@link ElementLinkProps}.
|
|
14
|
+
* @returns The element.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Link({ children, ref, ...props }: ElementLinkProps<ElementNode> & ElementRefProps): ReactElement;
|
|
17
|
+
//# sourceMappingURL=Link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/elements/Link.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAIxD,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAE9D;;;;;;GAMG;AACH,wBAAgB,IAAI,CAAC,EACnB,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,gBAAgB,CAAC,WAAW,CAAC,GAAG,eAAe,GAAG,YAAY,CAMhE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Link as RouterLink } from '@molecule/app-react/link';
|
|
3
|
+
import { useElementRef } from './ref.js';
|
|
4
|
+
import { webElementAttributes } from './style.js';
|
|
5
|
+
/**
|
|
6
|
+
* A link: renders exactly the `<a>` of `@molecule/app-react/link`, which navigates in-app through
|
|
7
|
+
* the router for an app path. On React Native it is a `Pressable` with the link role.
|
|
8
|
+
*
|
|
9
|
+
* @param props - See {@link ElementLinkProps}.
|
|
10
|
+
* @returns The element.
|
|
11
|
+
*/
|
|
12
|
+
export function Link({ children, ref, ...props }) {
|
|
13
|
+
return (_jsx(RouterLink, { ...webElementAttributes(props), ref: useElementRef(ref), children: children }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/elements/Link.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAG7D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGjD;;;;;;GAMG;AACH,MAAM,UAAU,IAAI,CAAC,EACnB,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACwC;IAChD,OAAO,CACL,KAAC,UAAU,OAAK,oBAAoB,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,CAAoB,GAAG,CAAC,YACpF,QAAQ,GACE,CACd,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pressable: an element the user activates.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementHandle, PressableProps } from '@molecule/app-ui';
|
|
7
|
+
/**
|
|
8
|
+
* Something the user activates: renders exactly its `as` tag (`<Pressable as="button"
|
|
9
|
+
* type="button">`) with its handlers. On React Native it is a `Pressable`; `onClick` fires on press
|
|
10
|
+
* and a string child is drawn in a `Text`.
|
|
11
|
+
*
|
|
12
|
+
* @param props - See {@link PressableProps}.
|
|
13
|
+
* @param ref - The element rendered by `as`.
|
|
14
|
+
* @returns The element.
|
|
15
|
+
*/
|
|
16
|
+
export declare const Pressable: import("react").ForwardRefExoticComponent<PressableProps<import("react").ReactNode> & import("react").RefAttributes<ElementHandle>>;
|
|
17
|
+
//# sourceMappingURL=Pressable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pressable.d.ts","sourceRoot":"","sources":["../../src/elements/Pressable.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAiB,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAQpF;;;;;;;;GAQG;AACH,eAAO,MAAM,SAAS,qIA6BpB,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pressable: an element the user activates.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement, forwardRef, useCallback } from 'react';
|
|
7
|
+
import { markPressTarget } from '@molecule/app-pointer-events-dom';
|
|
8
|
+
import { useWebDrag } from './drag.js';
|
|
9
|
+
import { useWebHover } from './hover.js';
|
|
10
|
+
import { useElementRef } from './ref.js';
|
|
11
|
+
import { webElementAttributes } from './style.js';
|
|
12
|
+
/**
|
|
13
|
+
* Something the user activates: renders exactly its `as` tag (`<Pressable as="button"
|
|
14
|
+
* type="button">`) with its handlers. On React Native it is a `Pressable`; `onClick` fires on press
|
|
15
|
+
* and a string child is drawn in a `Text`.
|
|
16
|
+
*
|
|
17
|
+
* @param props - See {@link PressableProps}.
|
|
18
|
+
* @param ref - The element rendered by `as`.
|
|
19
|
+
* @returns The element.
|
|
20
|
+
*/
|
|
21
|
+
export const Pressable = forwardRef(function Pressable({ as, children, drag, secondaryAction, ...props }, ref) {
|
|
22
|
+
const forward = useElementRef(ref);
|
|
23
|
+
const setNode = useCallback((element) => {
|
|
24
|
+
if (element)
|
|
25
|
+
markPressTarget(element);
|
|
26
|
+
forward?.(element);
|
|
27
|
+
}, [forward]);
|
|
28
|
+
const onPointerDown = useWebDrag(props.disabled ? undefined : drag, as);
|
|
29
|
+
const hover = useWebHover(props);
|
|
30
|
+
return createElement(as, webElementAttributes(props, {
|
|
31
|
+
...hover,
|
|
32
|
+
ref: setNode,
|
|
33
|
+
onPointerDown,
|
|
34
|
+
onDoubleClick: secondaryAction
|
|
35
|
+
? (event) => {
|
|
36
|
+
props.onDoubleClick?.(event);
|
|
37
|
+
if (!props.disabled && !event.defaultPrevented)
|
|
38
|
+
secondaryAction.run();
|
|
39
|
+
}
|
|
40
|
+
: props.onDoubleClick,
|
|
41
|
+
}), children);
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=Pressable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pressable.js","sourceRoot":"","sources":["../../src/elements/Pressable.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAqB,WAAW,EAAE,MAAM,OAAO,CAAA;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAA;AAGlE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGjD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,UAAU,CAA6C,SAAS,SAAS,CAChG,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,KAAK,EAAE,EACjD,GAAG;IAEH,MAAM,OAAO,GAAG,aAAa,CAAc,GAAG,CAAC,CAAA;IAC/C,MAAM,OAAO,GAAG,WAAW,CACzB,CAAC,OAA2B,EAAQ,EAAE;QACpC,IAAI,OAAO;YAAE,eAAe,CAAC,OAAO,CAAC,CAAA;QACrC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAA;IACpB,CAAC,EACD,CAAC,OAAO,CAAC,CACV,CAAA;IACD,MAAM,aAAa,GAAG,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACvE,MAAM,KAAK,GAAG,WAAW,CAAc,KAAK,CAAC,CAAA;IAC7C,OAAO,aAAa,CAClB,EAAE,EACF,oBAAoB,CAAC,KAAK,EAAE;QAC1B,GAAG,KAAK;QACR,GAAG,EAAE,OAAO;QACZ,aAAa;QACb,aAAa,EAAE,eAAe;YAC5B,CAAC,CAAC,CAAC,KAAoB,EAAQ,EAAE;gBAC7B,KAAK,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,CAAA;gBAC5B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,gBAAgB;oBAAE,eAAe,CAAC,GAAG,EAAE,CAAA;YACvE,CAAC;YACH,CAAC,CAAC,KAAK,CAAC,aAAa;KACxB,CAAC,EACF,QAAQ,CACT,CAAA;AACH,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PulseDots: decorative typing activity paint.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactElement } from 'react';
|
|
7
|
+
import { type PulseDotsProps } from '@molecule/app-ui';
|
|
8
|
+
/**
|
|
9
|
+
* Draws three dots in the surrounding text colour. The caller supplies layout and status semantics.
|
|
10
|
+
*
|
|
11
|
+
* @param props - See {@link PulseDotsProps}.
|
|
12
|
+
* @returns The inline motion stylesheet followed by three decorative spans.
|
|
13
|
+
*/
|
|
14
|
+
export declare function PulseDots({ size, durationMs }: PulseDotsProps): ReactElement;
|
|
15
|
+
//# sourceMappingURL=PulseDots.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PulseDots.d.ts","sourceRoot":"","sources":["../../src/elements/PulseDots.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAEzC,OAAO,EAAqC,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAIzF;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,cAAc,GAAG,YAAY,CAwC5E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DEFAULT_TYPING_PULSE, getClassMap } from '@molecule/app-ui';
|
|
3
|
+
const STANDARD_KEYFRAMES = 'molecule-typing-pulse';
|
|
4
|
+
/**
|
|
5
|
+
* Draws three dots in the surrounding text colour. The caller supplies layout and status semantics.
|
|
6
|
+
*
|
|
7
|
+
* @param props - See {@link PulseDotsProps}.
|
|
8
|
+
* @returns The inline motion stylesheet followed by three decorative spans.
|
|
9
|
+
*/
|
|
10
|
+
export function PulseDots({ size, durationMs }) {
|
|
11
|
+
const { peakAt, restAt, stagger, dimOpacity, dimScale } = getClassMap().typingPulse ?? DEFAULT_TYPING_PULSE;
|
|
12
|
+
// Keyframes are document-wide. A custom curve must coexist with a mounted standard pulse.
|
|
13
|
+
const keyName = peakAt === DEFAULT_TYPING_PULSE.peakAt &&
|
|
14
|
+
restAt === DEFAULT_TYPING_PULSE.restAt &&
|
|
15
|
+
dimOpacity === DEFAULT_TYPING_PULSE.dimOpacity &&
|
|
16
|
+
dimScale === DEFAULT_TYPING_PULSE.dimScale
|
|
17
|
+
? STANDARD_KEYFRAMES
|
|
18
|
+
: `${STANDARD_KEYFRAMES}-${[peakAt, restAt, dimOpacity, dimScale].join('-').replaceAll('.', '_')}`;
|
|
19
|
+
// Disabling the animation also removes the stagger delays under reduced motion.
|
|
20
|
+
const css = `@keyframes ${keyName} { 0%, ${restAt * 100}%, 100% { opacity: ${dimOpacity}; transform: scale(${dimScale}); } ${peakAt * 100}% { opacity: 1; transform: scale(1); } } @media (prefers-reduced-motion: reduce) { [data-typing-dot] { animation: none !important; } }`;
|
|
21
|
+
return (_jsxs(_Fragment, { children: [_jsx("style", { children: css }), [0, 1, 2].map((index) => {
|
|
22
|
+
// The original division preserves the exact serialized delay for fractional values.
|
|
23
|
+
const elapsed = index * durationMs;
|
|
24
|
+
const delay = stagger === DEFAULT_TYPING_PULSE.stagger ? elapsed / 6 : elapsed * stagger;
|
|
25
|
+
return (_jsx("span", { "aria-hidden": true, "data-typing-dot": "", style: {
|
|
26
|
+
display: 'inline-block',
|
|
27
|
+
width: size,
|
|
28
|
+
height: size,
|
|
29
|
+
borderRadius: '50%',
|
|
30
|
+
background: 'currentColor',
|
|
31
|
+
// Updating a single shorthand keeps duration and delay in sync.
|
|
32
|
+
animation: `${keyName} ${durationMs}ms ease-in-out ${delay}ms infinite`,
|
|
33
|
+
} }, index));
|
|
34
|
+
})] }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=PulseDots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PulseDots.js","sourceRoot":"","sources":["../../src/elements/PulseDots.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAuB,MAAM,kBAAkB,CAAA;AAEzF,MAAM,kBAAkB,GAAG,uBAAuB,CAAA;AAElD;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,EAAE,IAAI,EAAE,UAAU,EAAkB;IAC5D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,GACrD,WAAW,EAAE,CAAC,WAAW,IAAI,oBAAoB,CAAA;IACnD,0FAA0F;IAC1F,MAAM,OAAO,GACX,MAAM,KAAK,oBAAoB,CAAC,MAAM;QACtC,MAAM,KAAK,oBAAoB,CAAC,MA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6
|
+
import type { ElementHandle, RangeFieldProps } from '@molecule/app-ui';
|
|
7
|
+
/**
|
|
8
|
+
* Renders one browser range input and reports its numeric value on each edit.
|
|
9
|
+
*/
|
|
10
|
+
export declare const RangeField: import("react").ForwardRefExoticComponent<RangeFieldProps & import("react").RefAttributes<ElementHandle>>;
|
|
11
|
+
//# sourceMappingURL=RangeField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeField.d.ts","sourceRoot":"","sources":["../../src/elements/RangeField.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAKtE;;GAEG;AACH,eAAO,MAAM,UAAU,2GAqBtB,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RangeField: a platform numeric slider.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement, forwardRef } from 'react';
|
|
7
|
+
import { useElementRef } from './ref.js';
|
|
8
|
+
import { webElementAttributes } from './style.js';
|
|
9
|
+
/**
|
|
10
|
+
* Renders one browser range input and reports its numeric value on each edit.
|
|
11
|
+
*/
|
|
12
|
+
export const RangeField = forwardRef(function RangeField(props, ref) {
|
|
13
|
+
const { onValueChange } = props;
|
|
14
|
+
return createElement('input', webElementAttributes(props, {
|
|
15
|
+
type: 'range',
|
|
16
|
+
ref: useElementRef(ref),
|
|
17
|
+
onChange: onValueChange || props.value !== undefined
|
|
18
|
+
? (event) => {
|
|
19
|
+
onValueChange?.(event.currentTarget.valueAsNumber);
|
|
20
|
+
}
|
|
21
|
+
: undefined,
|
|
22
|
+
}, { onValueChange: 'onChange' }));
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=RangeField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RangeField.js","sourceRoot":"","sources":["../../src/elements/RangeField.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAoB,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAInE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,UAAU,CAClC,SAAS,UAAU,CAAC,KAAK,EAAE,GAAG;IAC5B,MAAM,EAAE,aAAa,EAAE,GAAG,KAAK,CAAA;IAC/B,OAAO,aAAa,CAClB,OAAO,EACP,oBAAoB,CAClB,KAAK,EACL;QACE,IAAI,EAAE,OAAO;QACb,GAAG,EAAE,aAAa,CAAmB,GAAG,CAAC;QACzC,QAAQ,EACN,aAAa,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;YACxC,CAAC,CAAC,CAAC,KAAoC,EAAQ,EAAE;gBAC7C,aAAa,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC,CAAA;YACpD,CAAC;YACH,CAAC,CAAC,SAAS;KAChB,EACD,EAAE,aAAa,EAAE,UAAU,EAAE,CAC9B,CACF,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rich catalog text, with a DOM compatibility path for trusted custom catalogs.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { type ReactElement } from 'react';
|
|
7
|
+
import type { RichNode } from '@molecule/app-i18n';
|
|
8
|
+
/** Props for {@link RichText}. */
|
|
9
|
+
export interface RichTextProps {
|
|
10
|
+
/** Result of a rich translation read. */
|
|
11
|
+
nodes: readonly RichNode[];
|
|
12
|
+
/** Classes on the surrounding container. */
|
|
13
|
+
className?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Renders portable rich translations as elements. The legacy result for a
|
|
17
|
+
* trusted custom catalog uses the web renderer's HTML compatibility path.
|
|
18
|
+
*
|
|
19
|
+
* @param props - The rich translation and container classes.
|
|
20
|
+
* @returns The rich text inside its container.
|
|
21
|
+
*/
|
|
22
|
+
export declare function RichText({ nodes, className }: RichTextProps): ReactElement;
|
|
23
|
+
//# sourceMappingURL=RichText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichText.d.ts","sourceRoot":"","sources":["../../src/elements/RichText.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAiB,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AAExE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAKlD,kCAAkC;AAClC,MAAM,WAAW,aAAa;IAC5B,yCAAyC;IACzC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAA;IAC1B,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,aAAa,GAAG,YAAY,CAM1E"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Rich catalog text, with a DOM compatibility path for trusted custom catalogs.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { createElement } from 'react';
|
|
8
|
+
import { Box } from './Box.js';
|
|
9
|
+
import { Text } from './Text.js';
|
|
10
|
+
/**
|
|
11
|
+
* Renders portable rich translations as elements. The legacy result for a
|
|
12
|
+
* trusted custom catalog uses the web renderer's HTML compatibility path.
|
|
13
|
+
*
|
|
14
|
+
* @param props - The rich translation and container classes.
|
|
15
|
+
* @returns The rich text inside its container.
|
|
16
|
+
*/
|
|
17
|
+
export function RichText({ nodes, className }) {
|
|
18
|
+
const legacy = nodes.find((node) => node.kind === 'legacy-html');
|
|
19
|
+
if (legacy) {
|
|
20
|
+
return createElement('div', { className, dangerouslySetInnerHTML: { __html: legacy.html } });
|
|
21
|
+
}
|
|
22
|
+
return createElement('div', { className }, renderNodes(nodes));
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Renders portable nodes with their original tag and text boundaries.
|
|
26
|
+
*
|
|
27
|
+
* @param nodes - The nodes at this level.
|
|
28
|
+
* @returns Their text or React elements.
|
|
29
|
+
*/
|
|
30
|
+
function renderNodes(nodes) {
|
|
31
|
+
return nodes.map((node, index) => {
|
|
32
|
+
if (node.kind === 'text')
|
|
33
|
+
return node.text;
|
|
34
|
+
if (node.kind === 'legacy-html')
|
|
35
|
+
return null;
|
|
36
|
+
const children = renderNodes(node.children);
|
|
37
|
+
return node.tag === 'ul' || node.tag === 'li' ? (_jsx(Box, { as: node.tag, children: children }, index)) : (_jsx(Text, { as: node.tag, children: children }, index));
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=RichText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichText.js","sourceRoot":"","sources":["../../src/elements/RichText.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAqC,MAAM,OAAO,CAAA;AAIxE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAUhC;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,SAAS,EAAiB;IAC1D,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,CAAA;IAChE,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IAC9F,CAAC;IACD,OAAO,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAA;AAChE,CAAC;AAED;;;;;GAKG;AACH,SAAS,WAAW,CAAC,KAA0B;IAC7C,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAC/B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM;YAAE,OAAO,IAAI,CAAC,IAAI,CAAA;QAC1C,IAAI,IAAI,CAAC,IAAI,KAAK,aAAa;YAAE,OAAO,IAAI,CAAA;QAC5C,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC3C,OAAO,IAAI,CAAC,GAAG,KAAK,IAAI,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAC9C,KAAC,GAAG,IAAC,EAAE,EAAE,IAAI,CAAC,GAAG,YACd,QAAQ,IADa,KAAK,CAEvB,CACP,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,IAAC,EAAE,EAAE,IAAI,CAAC,GAAG,YACf,QAAQ,IADc,KAAK,CAEvB,CACR,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rule: a horizontal thematic break.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementHandle, RuleProps } from '@molecule/app-ui';
|
|
7
|
+
/** Renders the literal void element with the supplied attributes and styles. */
|
|
8
|
+
export declare const Rule: import("react").ForwardRefExoticComponent<RuleProps & import("react").RefAttributes<ElementHandle>>;
|
|
9
|
+
//# sourceMappingURL=Rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rule.d.ts","sourceRoot":"","sources":["../../src/elements/Rule.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAKhE,gFAAgF;AAChF,eAAO,MAAM,IAAI,qGAQf,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rule: a horizontal thematic break.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement, forwardRef } from 'react';
|
|
7
|
+
import { useElementRef } from './ref.js';
|
|
8
|
+
import { webElementAttributes } from './style.js';
|
|
9
|
+
/** Renders the literal void element with the supplied attributes and styles. */
|
|
10
|
+
export const Rule = forwardRef(function Rule({ as, children: _children, ...props }, ref) {
|
|
11
|
+
return createElement(as, {
|
|
12
|
+
...webElementAttributes(props),
|
|
13
|
+
ref: useElementRef(ref),
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=Rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rule.js","sourceRoot":"","sources":["../../src/elements/Rule.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAA;AAIpE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,gFAAgF;AAChF,MAAM,CAAC,MAAM,IAAI,GAAG,UAAU,CAA2B,SAAS,IAAI,CACpE,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EACrC,GAAG;IAEH,OAAO,aAAa,CAAC,EAAE,EAAE;QACvB,GAAG,oBAAoB,CAAC,KAAK,CAAC;QAC9B,GAAG,EAAE,aAAa,CAAgB,GAAG,CAAC;KACvC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScrollArea: a container that scrolls.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementHandle, ScrollAreaProps } from '@molecule/app-ui';
|
|
7
|
+
/**
|
|
8
|
+
* A scrolling container: renders exactly its `as` tag. Its web scrolling comes from its ClassMap
|
|
9
|
+
* classes and styles. On React Native it scrolls in the supplied `direction`.
|
|
10
|
+
*
|
|
11
|
+
* @param props - See {@link ScrollAreaProps}.
|
|
12
|
+
* @param ref - The scroll frame rendered by `as`.
|
|
13
|
+
* @returns The element.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ScrollArea: import("react").ForwardRefExoticComponent<ScrollAreaProps<import("react").ReactNode> & import("react").RefAttributes<ElementHandle>>;
|
|
16
|
+
//# sourceMappingURL=ScrollArea.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.d.ts","sourceRoot":"","sources":["../../src/elements/ScrollArea.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAgB,MAAM,kBAAkB,CAAA;AAMpF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,sIAwBtB,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScrollArea: a container that scrolls.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement, forwardRef, useRef } from 'react';
|
|
7
|
+
import { useElementRef } from './ref.js';
|
|
8
|
+
import { webElementAttributes } from './style.js';
|
|
9
|
+
/**
|
|
10
|
+
* A scrolling container: renders exactly its `as` tag. Its web scrolling comes from its ClassMap
|
|
11
|
+
* classes and styles. On React Native it scrolls in the supplied `direction`.
|
|
12
|
+
*
|
|
13
|
+
* @param props - See {@link ScrollAreaProps}.
|
|
14
|
+
* @param ref - The scroll frame rendered by `as`.
|
|
15
|
+
* @returns The element.
|
|
16
|
+
*/
|
|
17
|
+
export const ScrollArea = forwardRef(function ScrollArea({ as, direction: _direction, children, ...props }, ref) {
|
|
18
|
+
const { onScroll } = props;
|
|
19
|
+
const last = useRef(null);
|
|
20
|
+
const handleScroll = (event) => {
|
|
21
|
+
const host = event.currentTarget;
|
|
22
|
+
if (event.target !== host)
|
|
23
|
+
return;
|
|
24
|
+
const maxX = Math.max(0, host.scrollWidth - host.clientWidth);
|
|
25
|
+
const maxY = Math.max(0, host.scrollHeight - host.clientHeight);
|
|
26
|
+
const rtl = host.ownerDocument.defaultView?.getComputedStyle(host).direction === 'rtl';
|
|
27
|
+
const offset = {
|
|
28
|
+
x: clampOffset(rtl ? maxX + host.scrollLeft : host.scrollLeft, host.clientWidth, maxX),
|
|
29
|
+
y: clampOffset(host.scrollTop, host.clientHeight, maxY),
|
|
30
|
+
};
|
|
31
|
+
if (last.current?.x === offset.x && last.current.y === offset.y)
|
|
32
|
+
return;
|
|
33
|
+
last.current = offset;
|
|
34
|
+
onScroll?.(offset);
|
|
35
|
+
};
|
|
36
|
+
return createElement(as, webElementAttributes(props, { ref: useElementRef(ref), onScroll: onScroll && handleScroll }), children);
|
|
37
|
+
});
|
|
38
|
+
/** Excludes browser bounce, using the scroll extent when the host has layout. */
|
|
39
|
+
function clampOffset(value, viewport, max) {
|
|
40
|
+
return Math.max(0, viewport > 0 ? Math.min(value, max) : value);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=ScrollArea.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScrollArea.js","sourceRoot":"","sources":["../../src/elements/ScrollArea.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAmC,MAAM,EAAE,MAAM,OAAO,CAAA;AAI1F,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAGjD;;;;;;;GAOG;AAC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,EAAE,CAAC,MAAM,CAAC,CAAA;IACpB,CAAC,CAAA;IACD,OAAO,aAAa,CAClB,EAAE,EACF,oBAAoB,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,aAAa,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,QAAQ,IAAI,YAAY,EAAE,CAAC,EAC5F,QAAQ,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,iFAAiF;AACjF,SAAS,WAAW,CAAC,KAAa,EAAE,QAAgB,EAAE,GAAW;IAC/D,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;AACjE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectField: an ordered choice field.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { ElementHandle, SelectFieldProps } from '@molecule/app-ui';
|
|
7
|
+
/**
|
|
8
|
+
* Renders one browser select and forwards the actual select and change event.
|
|
9
|
+
*/
|
|
10
|
+
export declare const SelectField: import("react").ForwardRefExoticComponent<SelectFieldProps & import("react").RefAttributes<ElementHandle>>;
|
|
11
|
+
//# sourceMappingURL=SelectField.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectField.d.ts","sourceRoot":"","sources":["../../src/elements/SelectField.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAKvE;;GAEG;AACH,eAAO,MAAM,WAAW,4GA6BvB,CAAA"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SelectField: an ordered choice field.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { createElement, forwardRef } from 'react';
|
|
7
|
+
import { useElementRef } from './ref.js';
|
|
8
|
+
import { webElementAttributes } from './style.js';
|
|
9
|
+
/**
|
|
10
|
+
* Renders one browser select and forwards the actual select and change event.
|
|
11
|
+
*/
|
|
12
|
+
export const SelectField = forwardRef(function SelectField(field, ref) {
|
|
13
|
+
const { as, options, ...attributes } = field;
|
|
14
|
+
const { onChange, onValueChange } = attributes;
|
|
15
|
+
return createElement(as, webElementAttributes(attributes, {
|
|
16
|
+
ref: useElementRef(ref),
|
|
17
|
+
onChange: onChange || onValueChange || field.value !== undefined
|
|
18
|
+
? (event) => {
|
|
19
|
+
onChange?.(event);
|
|
20
|
+
if (field.multiple) {
|
|
21
|
+
field.onValueChange?.(Array.from(event.currentTarget.selectedOptions, (option) => option.value));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
field.onValueChange?.(event.currentTarget.value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
: undefined,
|
|
28
|
+
}, { onValueChange: 'onChange' }), renderOptions(options));
|
|
29
|
+
});
|
|
30
|
+
/** Keeps option nodes stable by value, including when the displayed language changes. */
|
|
31
|
+
function renderOptions(options) {
|
|
32
|
+
const valueCounts = new Map();
|
|
33
|
+
for (const option of options) {
|
|
34
|
+
if (!('options' in option))
|
|
35
|
+
valueCounts.set(option.value, (valueCounts.get(option.value) ?? 0) + 1);
|
|
36
|
+
}
|
|
37
|
+
const occurrences = new Map();
|
|
38
|
+
return options.map((option) => {
|
|
39
|
+
const identity = 'options' in option
|
|
40
|
+
? JSON.stringify(['group', option.label])
|
|
41
|
+
: JSON.stringify([
|
|
42
|
+
'option',
|
|
43
|
+
option.value,
|
|
44
|
+
(valueCounts.get(option.value) ?? 0) > 1 ? option.label : null,
|
|
45
|
+
]);
|
|
46
|
+
const occurrence = occurrences.get(identity) ?? 0;
|
|
47
|
+
occurrences.set(identity, occurrence + 1);
|
|
48
|
+
const key = `${identity}:${occurrence}`;
|
|
49
|
+
return 'options' in option
|
|
50
|
+
? createElement('optgroup', { key, label: option.label }, renderOptions(option.options))
|
|
51
|
+
: createElement('option', {
|
|
52
|
+
key,
|
|
53
|
+
value: option.value,
|
|
54
|
+
disabled: option.disabled,
|
|
55
|
+
ref: option.webDefaultSelected ? reflectDefaultSelected : undefined,
|
|
56
|
+
}, option.label);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** Preserves the browser reset attribute without changing the select's live value. */
|
|
60
|
+
function reflectDefaultSelected(option) {
|
|
61
|
+
if (option?.selected)
|
|
62
|
+
option.defaultSelected = true;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=SelectField.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SelectField.js","sourceRoot":"","sources":["../../src/elements/SelectField.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAoB,aAAa,EAAE,UAAU,EAAqB,MAAM,OAAO,CAAA;AAItF,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,UAAU,CACnC,SAAS,WAAW,CAAC,KAAK,EAAE,GAAG;IAC7B,MAAM,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,CAAA;IAC5C,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,UAAU,CAAA;IAC9C,OAAO,aAAa,CAClB,EAAE,EACF,oBAAoB,CAClB,UAAU,EACV;QACE,GAAG,EAAE,aAAa,CAAoB,GAAG,CAAC;QAC1C,QAAQ,EACN,QAAQ,IAAI,aAAa,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;YACpD,CAAC,CAAC,CAAC,KAAqC,EAAQ,EAAE;gBAC9C,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAA;gBACjB,IAAI,KA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CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;aAC/D,CAAC,CAAA;QACR,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;QACjD,WAAW,CAAC,GAAG,CAAC,QAAQ,EAAE,UAAU,GAAG,CAAC,CAAC,CAAA;QACzC,MAAM,GAAG,GAAG,GAAG,QAAQ,IAAI,UAAU,EAAE,CAAA;QACvC,OAAO,SAAS,IAAI,MAAM;YACxB,CAAC,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,EAAE,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YACxF,CAAC,CAAC,aAAa,CACX,QAAQ,EACR;gBACE,GAAG;gBACH,KAAK,EAAE,MAAM,CAAC,KAAK;gBACnB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,GAAG,EAAE,MAAM,CAAC,kBAAkB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,SAAS;aACpE,EACD,MAAM,CAAC,KAAK,CACb,CAAA;IACP,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,sFAAsF;AACtF,SAAS,sBAAsB,CAAC,MAAgC;IAC9D,IAAI,MAAM,EAAE,QAAQ;QAAE,MAAM,CAAC,eAAe,GAAG,IAAI,CAAA;AACrD,CAAC"}
|
|
@@ -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,CA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