@monimesl/dot-renderer-react 0.1.0-alpha.8 → 1.0.0-beta.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 +43 -1
- package/dist/LICENSE-PHOSPHOR +21 -21
- package/dist/_virtual/_rolldown/runtime.js +14 -0
- package/dist/_virtual/builtin_esm-external-require-react.js +9 -0
- package/dist/color.js +94 -0
- package/dist/components/amount-input.d.ts +6 -0
- package/dist/components/amount-input.js +111 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.js +68 -0
- package/dist/components/box.js +56 -0
- package/dist/components/button.d.ts +6 -0
- package/dist/components/button.js +42 -0
- package/dist/components/carousel.d.ts +6 -0
- package/dist/components/carousel.js +258 -0
- package/dist/components/chip.d.ts +6 -0
- package/dist/components/chip.js +41 -0
- package/dist/components/code-input.d.ts +6 -0
- package/dist/components/code-input.js +96 -0
- package/dist/components/detail-row.d.ts +6 -0
- package/dist/components/detail-row.js +40 -0
- package/dist/components/disclosure.d.ts +6 -0
- package/dist/components/disclosure.js +76 -0
- package/dist/components/divider.d.ts +6 -0
- package/dist/components/divider.js +18 -0
- package/dist/components/empty-state.d.ts +6 -0
- package/dist/components/empty-state.js +64 -0
- package/dist/components/feedback.d.ts +8 -0
- package/dist/components/feedback.js +101 -0
- package/dist/components/field-box.js +44 -0
- package/dist/components/field.js +43 -0
- package/dist/components/footer.d.ts +6 -0
- package/dist/components/footer.js +25 -0
- package/dist/components/grid.d.ts +7 -0
- package/dist/components/grid.js +97 -0
- package/dist/components/https.js +11 -0
- package/dist/components/icon-artwork.js +143 -0
- package/dist/components/icon-button.js +28 -0
- package/dist/components/icon-svg.js +27 -0
- package/dist/components/icon.d.ts +6 -0
- package/dist/components/icon.js +25 -0
- package/dist/components/image.d.ts +6 -0
- package/dist/components/image.js +40 -0
- package/dist/components/index.d.ts +38 -0
- package/dist/components/index.js +92 -0
- package/dist/components/input.d.ts +6 -0
- package/dist/components/input.js +108 -0
- package/dist/components/link.d.ts +6 -0
- package/dist/components/link.js +32 -0
- package/dist/components/list.d.ts +7 -0
- package/dist/components/list.js +143 -0
- package/dist/components/numbers.js +9 -0
- package/dist/components/option-place.js +9 -0
- package/dist/components/option.d.ts +6 -0
- package/dist/components/option.js +44 -0
- package/dist/components/padding.d.ts +2 -0
- package/dist/components/padding.js +38 -0
- package/dist/components/pressable.js +17 -0
- package/dist/components/prose-context.js +5 -0
- package/dist/components/prose.d.ts +9 -0
- package/dist/components/prose.js +67 -0
- package/dist/components/qr-code.d.ts +6 -0
- package/dist/components/qr-code.js +58 -0
- package/dist/components/rich-text.d.ts +6 -0
- package/dist/components/rich-text.js +73 -0
- package/dist/components/scroll.d.ts +6 -0
- package/dist/components/scroll.js +57 -0
- package/dist/components/select.d.ts +6 -0
- package/dist/components/select.js +93 -0
- package/dist/components/sheet.d.ts +8 -0
- package/dist/components/sheet.js +106 -0
- package/dist/components/skeleton.d.ts +6 -0
- package/dist/components/skeleton.js +55 -0
- package/dist/components/slider.d.ts +6 -0
- package/dist/components/slider.js +57 -0
- package/dist/components/spinner.d.ts +6 -0
- package/dist/components/spinner.js +48 -0
- package/dist/components/stack.d.ts +6 -0
- package/dist/components/stack.js +25 -0
- package/dist/components/stepper.d.ts +6 -0
- package/dist/components/stepper.js +92 -0
- package/dist/components/steps.d.ts +7 -0
- package/dist/components/steps.js +110 -0
- package/dist/components/tabs.d.ts +7 -0
- package/dist/components/tabs.js +95 -0
- package/dist/components/text-area.d.ts +6 -0
- package/dist/components/text-area.js +42 -0
- package/dist/components/text.d.ts +6 -0
- package/dist/components/text.js +107 -0
- package/dist/components/toast.d.ts +6 -0
- package/dist/components/toast.js +56 -0
- package/dist/components/toggles.d.ts +9 -0
- package/dist/components/toggles.js +148 -0
- package/dist/components/tokens.js +49 -0
- package/dist/components/tones.js +30 -0
- package/dist/components/typed-text.js +28 -0
- package/dist/components/view.d.ts +6 -0
- package/dist/components/view.js +61 -0
- package/dist/index.d.ts +43 -64
- package/dist/index.js +40 -22636
- package/dist/markdown.js +255 -0
- package/dist/page-root.d.ts +2 -0
- package/dist/page-root.js +20 -0
- package/dist/portal.js +8 -0
- package/dist/pull-to-refresh.js +120 -0
- package/dist/renderer.d.ts +17 -0
- package/dist/renderer.js +33 -0
- package/dist/root.d.ts +10 -0
- package/dist/root.js +71 -0
- package/dist/styles.css +1 -1
- package/dist/theme.d.ts +26 -0
- package/dist/theme.js +129 -0
- package/dist/types.d.ts +7 -0
- package/dist/vendor/@base-ui/react/checkbox/indicator/CheckboxIndicator.js +51 -0
- package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRoot.js +265 -0
- package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRootContext.js +13 -0
- package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRootDataAttributes.js +11 -0
- package/dist/vendor/@base-ui/react/checkbox/utils/getCheckboxStateAttributesMapping.js +15 -0
- package/dist/vendor/@base-ui/react/checkbox-group/CheckboxGroupContext.js +10 -0
- package/dist/vendor/@base-ui/react/dialog/backdrop/DialogBackdrop.js +40 -0
- package/dist/vendor/@base-ui/react/dialog/close/DialogClose.js +39 -0
- package/dist/vendor/@base-ui/react/dialog/popup/DialogPopup.js +92 -0
- package/dist/vendor/@base-ui/react/dialog/popup/DialogPopupCssVars.js +8 -0
- package/dist/vendor/@base-ui/react/dialog/popup/DialogPopupDataAttributes.js +7 -0
- package/dist/vendor/@base-ui/react/dialog/portal/DialogPortal.js +38 -0
- package/dist/vendor/@base-ui/react/dialog/portal/DialogPortalContext.js +13 -0
- package/dist/vendor/@base-ui/react/dialog/root/DialogRoot.js +16 -0
- package/dist/vendor/@base-ui/react/dialog/root/DialogRootContext.js +13 -0
- package/dist/vendor/@base-ui/react/dialog/root/useDialogRoot.js +77 -0
- package/dist/vendor/@base-ui/react/dialog/root/useRenderDialogRoot.js +65 -0
- package/dist/vendor/@base-ui/react/dialog/store/DialogStore.js +70 -0
- package/dist/vendor/@base-ui/react/dialog/title/DialogTitle.js +25 -0
- package/dist/vendor/@base-ui/react/dialog/utils/stateAttributesMapping.js +17 -0
- package/dist/vendor/@base-ui/react/field/control/FieldControlDataAttributes.js +11 -0
- package/dist/vendor/@base-ui/react/field/item/FieldItemContext.js +10 -0
- package/dist/vendor/@base-ui/react/field/root/useFieldValidation.js +18 -0
- package/dist/vendor/@base-ui/react/fieldset/root/FieldsetRootContext.js +13 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingFocusManager.js +477 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingPortal.js +165 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingRootStore.js +65 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingTree.js +22 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/hooks/useDismiss.js +373 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.js +58 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/composite.js +40 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/constants.js +5 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/createAttribute.js +6 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/createEventEmitter.js +18 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/element.js +26 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/enqueueFocus.js +25 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/event.js +25 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/markOthers.js +116 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/nodes.js +16 -0
- package/dist/vendor/@base-ui/react/floating-ui-react/utils/tabbable.js +135 -0
- package/dist/vendor/@base-ui/react/internals/TransitionStatusDataAttributes.js +11 -0
- package/dist/vendor/@base-ui/react/internals/composite/composite.js +89 -0
- package/dist/vendor/@base-ui/react/internals/composite/constants.js +4 -0
- package/dist/vendor/@base-ui/react/internals/composite/item/CompositeItem.js +21 -0
- package/dist/vendor/@base-ui/react/internals/composite/item/useCompositeItem.js +31 -0
- package/dist/vendor/@base-ui/react/internals/composite/list/CompositeList.js +180 -0
- package/dist/vendor/@base-ui/react/internals/composite/list/CompositeListContext.js +15 -0
- package/dist/vendor/@base-ui/react/internals/composite/list/useCompositeListItem.js +54 -0
- package/dist/vendor/@base-ui/react/internals/composite/root/CompositeRoot.js +62 -0
- package/dist/vendor/@base-ui/react/internals/composite/root/CompositeRootContext.js +13 -0
- package/dist/vendor/@base-ui/react/internals/composite/root/useCompositeRoot.js +170 -0
- package/dist/vendor/@base-ui/react/internals/constants.js +18 -0
- package/dist/vendor/@base-ui/react/internals/createBaseUIEventDetails.js +40 -0
- package/dist/vendor/@base-ui/react/internals/direction-context/DirectionContext.js +10 -0
- package/dist/vendor/@base-ui/react/internals/field-constants/constants.js +33 -0
- package/dist/vendor/@base-ui/react/internals/field-register-control/useRegisterFieldControl.js +40 -0
- package/dist/vendor/@base-ui/react/internals/field-root-context/FieldRootContext.js +45 -0
- package/dist/vendor/@base-ui/react/internals/form-context/FormContext.js +18 -0
- package/dist/vendor/@base-ui/react/internals/getStateAttributesProps.js +17 -0
- package/dist/vendor/@base-ui/react/internals/labelable-provider/LabelableContext.js +24 -0
- package/dist/vendor/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.js +35 -0
- package/dist/vendor/@base-ui/react/internals/labelable-provider/useLabelableId.js +57 -0
- package/dist/vendor/@base-ui/react/internals/reason-parts.js +14 -0
- package/dist/vendor/@base-ui/react/internals/serializeValue.js +12 -0
- package/dist/vendor/@base-ui/react/internals/stateAttributesMapping.js +11 -0
- package/dist/vendor/@base-ui/react/internals/use-button/useButton.js +137 -0
- package/dist/vendor/@base-ui/react/internals/useAnimationsFinished.js +94 -0
- package/dist/vendor/@base-ui/react/internals/useBaseUiId.js +13 -0
- package/dist/vendor/@base-ui/react/internals/useOpenChangeComplete.js +28 -0
- package/dist/vendor/@base-ui/react/internals/useRenderElement.js +109 -0
- package/dist/vendor/@base-ui/react/internals/useTransitionStatus.js +70 -0
- package/dist/vendor/@base-ui/react/internals/useValueChanged.js +15 -0
- package/dist/vendor/@base-ui/react/merge-props/mergeProps.js +153 -0
- package/dist/vendor/@base-ui/react/radio/indicator/RadioIndicator.js +46 -0
- package/dist/vendor/@base-ui/react/radio/root/RadioRoot.js +179 -0
- package/dist/vendor/@base-ui/react/radio/root/RadioRootContext.js +13 -0
- package/dist/vendor/@base-ui/react/radio/root/RadioRootDataAttributes.js +11 -0
- package/dist/vendor/@base-ui/react/radio/utils/stateAttributesMapping.js +14 -0
- package/dist/vendor/@base-ui/react/radio-group/RadioGroup.js +170 -0
- package/dist/vendor/@base-ui/react/radio-group/RadioGroupContext.js +10 -0
- package/dist/vendor/@base-ui/react/switch/root/SwitchRoot.js +170 -0
- package/dist/vendor/@base-ui/react/switch/root/SwitchRootContext.js +13 -0
- package/dist/vendor/@base-ui/react/switch/root/SwitchRootDataAttributes.js +11 -0
- package/dist/vendor/@base-ui/react/switch/stateAttributesMapping.js +12 -0
- package/dist/vendor/@base-ui/react/switch/thumb/SwitchThumb.js +25 -0
- package/dist/vendor/@base-ui/react/tabs/list/TabsList.js +98 -0
- package/dist/vendor/@base-ui/react/tabs/list/TabsListContext.js +13 -0
- package/dist/vendor/@base-ui/react/tabs/root/TabsRoot.js +213 -0
- package/dist/vendor/@base-ui/react/tabs/root/TabsRootContext.js +16 -0
- package/dist/vendor/@base-ui/react/tabs/root/TabsRootDataAttributes.js +8 -0
- package/dist/vendor/@base-ui/react/tabs/root/stateAttributesMapping.js +5 -0
- package/dist/vendor/@base-ui/react/tabs/tab/TabsTab.js +137 -0
- package/dist/vendor/@base-ui/react/utils/CommonPopupDataAttributes.js +24 -0
- package/dist/vendor/@base-ui/react/utils/CommonTriggerDataAttributes.js +11 -0
- package/dist/vendor/@base-ui/react/utils/FocusGuard.js +32 -0
- package/dist/vendor/@base-ui/react/utils/InternalBackdrop.js +30 -0
- package/dist/vendor/@base-ui/react/utils/dispatchClickWithModifiers.js +25 -0
- package/dist/vendor/@base-ui/react/utils/popupStateMapping.js +22 -0
- package/dist/vendor/@base-ui/react/utils/popups/popupStoreUtils.js +247 -0
- package/dist/vendor/@base-ui/react/utils/popups/popupTriggerMap.js +96 -0
- package/dist/vendor/@base-ui/react/utils/popups/store.js +94 -0
- package/dist/vendor/@base-ui/react/utils/resolveClassName.js +13 -0
- package/dist/vendor/@base-ui/react/utils/resolveRef.js +11 -0
- package/dist/vendor/@base-ui/react/utils/resolveStyle.js +13 -0
- package/dist/vendor/@base-ui/react/utils/useFocusableWhenDisabled.js +30 -0
- package/dist/vendor/@base-ui/utils/addEventListener.js +12 -0
- package/dist/vendor/@base-ui/utils/createLogOnce.js +20 -0
- package/dist/vendor/@base-ui/utils/empty.js +6 -0
- package/dist/vendor/@base-ui/utils/error.js +5 -0
- package/dist/vendor/@base-ui/utils/fastHooks.js +68 -0
- package/dist/vendor/@base-ui/utils/formatErrorMessage.js +27 -0
- package/dist/vendor/@base-ui/utils/getDefaultFormSubmitter.js +25 -0
- package/dist/vendor/@base-ui/utils/getReactElementRef.js +14 -0
- package/dist/vendor/@base-ui/utils/inertValue.js +8 -0
- package/dist/vendor/@base-ui/utils/isElementDisabled.js +6 -0
- package/dist/vendor/@base-ui/utils/mergeCleanups.js +14 -0
- package/dist/vendor/@base-ui/utils/mergeObjects.js +11 -0
- package/dist/vendor/@base-ui/utils/owner.js +7 -0
- package/dist/vendor/@base-ui/utils/platform/engine.js +8 -0
- package/dist/vendor/@base-ui/utils/platform/env.js +6 -0
- package/dist/vendor/@base-ui/utils/platform/os.js +15 -0
- package/dist/vendor/@base-ui/utils/platform/screen-reader.js +9 -0
- package/dist/vendor/@base-ui/utils/platform/shared.js +36 -0
- package/dist/vendor/@base-ui/utils/reactVersion.js +8 -0
- package/dist/vendor/@base-ui/utils/safeReact.js +13 -0
- package/dist/vendor/@base-ui/utils/shadowDom.js +26 -0
- package/dist/vendor/@base-ui/utils/store/ReactStore.js +181 -0
- package/dist/vendor/@base-ui/utils/store/Store.js +102 -0
- package/dist/vendor/@base-ui/utils/store/useStore.js +97 -0
- package/dist/vendor/@base-ui/utils/useAnimationFrame.js +87 -0
- package/dist/vendor/@base-ui/utils/useControlled.js +52 -0
- package/dist/vendor/@base-ui/utils/useId.js +32 -0
- package/dist/vendor/@base-ui/utils/useIsoLayoutEffect.js +7 -0
- package/dist/vendor/@base-ui/utils/useMergedRefs.js +87 -0
- package/dist/vendor/@base-ui/utils/useOnMount.js +12 -0
- package/dist/vendor/@base-ui/utils/useRefWithInit.js +18 -0
- package/dist/vendor/@base-ui/utils/useScrollLock.js +206 -0
- package/dist/vendor/@base-ui/utils/useStableCallback.js +38 -0
- package/dist/vendor/@base-ui/utils/useTimeout.js +43 -0
- package/dist/vendor/@base-ui/utils/useValueAsRef.js +27 -0
- package/dist/vendor/@base-ui/utils/visuallyHidden.js +23 -0
- package/dist/vendor/@base-ui/utils/warn.js +5 -0
- package/dist/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js +49 -0
- package/dist/vendor/uqr/dist/index.js +858 -0
- package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +74 -0
- package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +77 -0
- package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +69 -0
- package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +64 -0
- package/dist/vendor/use-sync-external-store/shim/index.js +11 -0
- package/dist/vendor/use-sync-external-store/shim/with-selector.js +11 -0
- package/package.json +10 -15
- package/dist/garra-versions.json +0 -7
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { createEvent } from "@monimesl/dot-core";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/image.tsx
|
|
5
|
+
const SHAPE_RADIUS = {
|
|
6
|
+
square: 0,
|
|
7
|
+
circle: "50%"
|
|
8
|
+
};
|
|
9
|
+
const Image$1 = ({ src, alt, width, height, fit = "cover", shape = "rounded", aspect, onLoad, onError }) => {
|
|
10
|
+
const { radius } = useTheme();
|
|
11
|
+
const handleLoad = onLoad ? (event) => {
|
|
12
|
+
const { naturalWidth, naturalHeight } = event.currentTarget;
|
|
13
|
+
onLoad(createEvent("load", {
|
|
14
|
+
width: naturalWidth,
|
|
15
|
+
height: naturalHeight
|
|
16
|
+
}));
|
|
17
|
+
} : void 0;
|
|
18
|
+
const handleError = onError ? () => onError(createEvent("error", { message: `Failed to load ${src}` })) : void 0;
|
|
19
|
+
const style = {
|
|
20
|
+
objectFit: fit,
|
|
21
|
+
borderRadius: SHAPE_RADIUS[shape] ?? radius
|
|
22
|
+
};
|
|
23
|
+
if (aspect) {
|
|
24
|
+
style.width = width ?? "100%";
|
|
25
|
+
style.height = "auto";
|
|
26
|
+
style.aspectRatio = aspect.replace(":", " / ");
|
|
27
|
+
}
|
|
28
|
+
return /* @__PURE__ */ jsx("img", {
|
|
29
|
+
className: "dot-image",
|
|
30
|
+
src,
|
|
31
|
+
alt: alt ?? "",
|
|
32
|
+
width,
|
|
33
|
+
height: aspect ? void 0 : height,
|
|
34
|
+
style,
|
|
35
|
+
onLoad: handleLoad,
|
|
36
|
+
onError: handleError
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { Image$1 as Image };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { AmountInput } from "./amount-input.js";
|
|
2
|
+
import { Avatar } from "./avatar.js";
|
|
3
|
+
import { Button } from "./button.js";
|
|
4
|
+
import { Carousel } from "./carousel.js";
|
|
5
|
+
import { Chip } from "./chip.js";
|
|
6
|
+
import { CodeInput } from "./code-input.js";
|
|
7
|
+
import { DetailRow } from "./detail-row.js";
|
|
8
|
+
import { Disclosure } from "./disclosure.js";
|
|
9
|
+
import { Divider } from "./divider.js";
|
|
10
|
+
import { EmptyState } from "./empty-state.js";
|
|
11
|
+
import { Badge, Notice, ProgressBar } from "./feedback.js";
|
|
12
|
+
import { Footer } from "./footer.js";
|
|
13
|
+
import { Grid, GridItem } from "./grid.js";
|
|
14
|
+
import { Icon } from "./icon.js";
|
|
15
|
+
import { Image } from "./image.js";
|
|
16
|
+
import { Input } from "./input.js";
|
|
17
|
+
import { Link } from "./link.js";
|
|
18
|
+
import { List, ListItem } from "./list.js";
|
|
19
|
+
import { Option } from "./option.js";
|
|
20
|
+
import { Bullet, BulletList, Prose, Quote } from "./prose.js";
|
|
21
|
+
import { QRCode } from "./qr-code.js";
|
|
22
|
+
import { RichText } from "./rich-text.js";
|
|
23
|
+
import { Scroll } from "./scroll.js";
|
|
24
|
+
import { Select } from "./select.js";
|
|
25
|
+
import { Sheet } from "./sheet.js";
|
|
26
|
+
import { Skeleton } from "./skeleton.js";
|
|
27
|
+
import { Slider } from "./slider.js";
|
|
28
|
+
import { Spinner } from "./spinner.js";
|
|
29
|
+
import { Stack } from "./stack.js";
|
|
30
|
+
import { Step, Steps } from "./steps.js";
|
|
31
|
+
import { Stepper } from "./stepper.js";
|
|
32
|
+
import { Tab, Tabs } from "./tabs.js";
|
|
33
|
+
import { Text } from "./text.js";
|
|
34
|
+
import { TextArea } from "./text-area.js";
|
|
35
|
+
import { Toast } from "./toast.js";
|
|
36
|
+
import { Checkbox, Radio, RadioGroup, Switch } from "./toggles.js";
|
|
37
|
+
import { View } from "./view.js";
|
|
38
|
+
export { AmountInput, Avatar, Badge, Bullet, BulletList, Button, Carousel, Checkbox, Chip, CodeInput, DetailRow, Disclosure, Divider, EmptyState, Footer, Grid, GridItem, Icon, Image, Input, Link, List, ListItem, Notice, Option, ProgressBar, Prose, QRCode, Quote, Radio, RadioGroup, RichText, Scroll, Select, Sheet, Skeleton, Slider, Spinner, Stack, Step, Stepper, Steps, Switch, Tab, Tabs, Text, TextArea, Toast, View };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { AmountInput } from "./amount-input.js";
|
|
3
|
+
import { Avatar } from "./avatar.js";
|
|
4
|
+
import { Spinner } from "./spinner.js";
|
|
5
|
+
import { Button } from "./button.js";
|
|
6
|
+
import { Carousel } from "./carousel.js";
|
|
7
|
+
import { Icon } from "./icon.js";
|
|
8
|
+
import { Chip } from "./chip.js";
|
|
9
|
+
import { CodeInput } from "./code-input.js";
|
|
10
|
+
import { DetailRow } from "./detail-row.js";
|
|
11
|
+
import { Disclosure } from "./disclosure.js";
|
|
12
|
+
import { Divider } from "./divider.js";
|
|
13
|
+
import { EmptyState } from "./empty-state.js";
|
|
14
|
+
import { Badge, Notice, ProgressBar } from "./feedback.js";
|
|
15
|
+
import { Footer } from "./footer.js";
|
|
16
|
+
import { Grid, GridItem } from "./grid.js";
|
|
17
|
+
import { Image } from "./image.js";
|
|
18
|
+
import { Input } from "./input.js";
|
|
19
|
+
import { Link } from "./link.js";
|
|
20
|
+
import { List, ListItem } from "./list.js";
|
|
21
|
+
import { Option } from "./option.js";
|
|
22
|
+
import { Bullet, BulletList, Prose, Quote } from "./prose.js";
|
|
23
|
+
import { QRCode } from "./qr-code.js";
|
|
24
|
+
import { Text } from "./text.js";
|
|
25
|
+
import { RichText } from "./rich-text.js";
|
|
26
|
+
import { Scroll } from "./scroll.js";
|
|
27
|
+
import { Sheet } from "./sheet.js";
|
|
28
|
+
import { Select } from "./select.js";
|
|
29
|
+
import { Skeleton } from "./skeleton.js";
|
|
30
|
+
import { Slider } from "./slider.js";
|
|
31
|
+
import { Stack } from "./stack.js";
|
|
32
|
+
import { Step, Steps } from "./steps.js";
|
|
33
|
+
import { Stepper } from "./stepper.js";
|
|
34
|
+
import { Tab, Tabs } from "./tabs.js";
|
|
35
|
+
import { TextArea } from "./text-area.js";
|
|
36
|
+
import { Toast } from "./toast.js";
|
|
37
|
+
import { Checkbox, Radio, RadioGroup, Switch } from "./toggles.js";
|
|
38
|
+
import { View } from "./view.js";
|
|
39
|
+
//#region src/components/index.ts
|
|
40
|
+
var components_exports = /* @__PURE__ */ __exportAll({
|
|
41
|
+
AmountInput: () => AmountInput,
|
|
42
|
+
Avatar: () => Avatar,
|
|
43
|
+
Badge: () => Badge,
|
|
44
|
+
Bullet: () => Bullet,
|
|
45
|
+
BulletList: () => BulletList,
|
|
46
|
+
Button: () => Button,
|
|
47
|
+
Carousel: () => Carousel,
|
|
48
|
+
Checkbox: () => Checkbox,
|
|
49
|
+
Chip: () => Chip,
|
|
50
|
+
CodeInput: () => CodeInput,
|
|
51
|
+
DetailRow: () => DetailRow,
|
|
52
|
+
Disclosure: () => Disclosure,
|
|
53
|
+
Divider: () => Divider,
|
|
54
|
+
EmptyState: () => EmptyState,
|
|
55
|
+
Footer: () => Footer,
|
|
56
|
+
Grid: () => Grid,
|
|
57
|
+
GridItem: () => GridItem,
|
|
58
|
+
Icon: () => Icon,
|
|
59
|
+
Image: () => Image,
|
|
60
|
+
Input: () => Input,
|
|
61
|
+
Link: () => Link,
|
|
62
|
+
List: () => List,
|
|
63
|
+
ListItem: () => ListItem,
|
|
64
|
+
Notice: () => Notice,
|
|
65
|
+
Option: () => Option,
|
|
66
|
+
ProgressBar: () => ProgressBar,
|
|
67
|
+
Prose: () => Prose,
|
|
68
|
+
QRCode: () => QRCode,
|
|
69
|
+
Quote: () => Quote,
|
|
70
|
+
Radio: () => Radio,
|
|
71
|
+
RadioGroup: () => RadioGroup,
|
|
72
|
+
RichText: () => RichText,
|
|
73
|
+
Scroll: () => Scroll,
|
|
74
|
+
Select: () => Select,
|
|
75
|
+
Sheet: () => Sheet,
|
|
76
|
+
Skeleton: () => Skeleton,
|
|
77
|
+
Slider: () => Slider,
|
|
78
|
+
Spinner: () => Spinner,
|
|
79
|
+
Stack: () => Stack,
|
|
80
|
+
Step: () => Step,
|
|
81
|
+
Stepper: () => Stepper,
|
|
82
|
+
Steps: () => Steps,
|
|
83
|
+
Switch: () => Switch,
|
|
84
|
+
Tab: () => Tab,
|
|
85
|
+
Tabs: () => Tabs,
|
|
86
|
+
Text: () => Text,
|
|
87
|
+
TextArea: () => TextArea,
|
|
88
|
+
Toast: () => Toast,
|
|
89
|
+
View: () => View
|
|
90
|
+
});
|
|
91
|
+
//#endregion
|
|
92
|
+
export { AmountInput, Avatar, Badge, Bullet, BulletList, Button, Carousel, Checkbox, Chip, CodeInput, DetailRow, Disclosure, Divider, EmptyState, Footer, Grid, GridItem, Icon, Image, Input, Link, List, ListItem, Notice, Option, ProgressBar, Prose, QRCode, Quote, Radio, RadioGroup, RichText, Scroll, Select, Sheet, Skeleton, Slider, Spinner, Stack, Step, Stepper, Steps, Switch, Tab, Tabs, Text, TextArea, Toast, View, components_exports };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { ICON_SIZE, SPACE } from "./tokens.js";
|
|
3
|
+
import { Field } from "./field.js";
|
|
4
|
+
import { BARE_INPUT_STYLE, useFieldBox, useFieldNote } from "./field-box.js";
|
|
5
|
+
import { useTypedText } from "./typed-text.js";
|
|
6
|
+
import { CLOSE_ARTWORK, SEARCH_ARTWORK } from "./icon-artwork.js";
|
|
7
|
+
import { IconSvg } from "./icon-svg.js";
|
|
8
|
+
import { IconButton } from "./icon-button.js";
|
|
9
|
+
import { createEvent } from "@monimesl/dot-core";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/components/input.tsx
|
|
12
|
+
const HTML_TYPES = {
|
|
13
|
+
text: {
|
|
14
|
+
type: "text",
|
|
15
|
+
inputMode: "text"
|
|
16
|
+
},
|
|
17
|
+
number: {
|
|
18
|
+
type: "text",
|
|
19
|
+
inputMode: "decimal"
|
|
20
|
+
},
|
|
21
|
+
email: {
|
|
22
|
+
type: "email",
|
|
23
|
+
inputMode: "email"
|
|
24
|
+
},
|
|
25
|
+
phone: {
|
|
26
|
+
type: "tel",
|
|
27
|
+
inputMode: "tel"
|
|
28
|
+
},
|
|
29
|
+
password: {
|
|
30
|
+
type: "password",
|
|
31
|
+
inputMode: "text"
|
|
32
|
+
},
|
|
33
|
+
search: {
|
|
34
|
+
type: "search",
|
|
35
|
+
inputMode: "search"
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const Input$1 = ({ value, placeholder, label, hint, error, prefix, suffix, type = "text", maxLength, clearable, disabled, onChange, onSubmit }) => {
|
|
39
|
+
const { colors } = useTheme();
|
|
40
|
+
const [text, typeText] = useTypedText(value, onChange !== void 0);
|
|
41
|
+
const box = useFieldBox(error, disabled);
|
|
42
|
+
const { noteId, controlAttributes } = useFieldNote(hint, error);
|
|
43
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
44
|
+
label,
|
|
45
|
+
hint,
|
|
46
|
+
error,
|
|
47
|
+
noteId,
|
|
48
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
49
|
+
className: "dot-input",
|
|
50
|
+
style: {
|
|
51
|
+
...box.style,
|
|
52
|
+
display: "flex",
|
|
53
|
+
alignItems: "center",
|
|
54
|
+
gap: SPACE.medium,
|
|
55
|
+
padding: "0 14px"
|
|
56
|
+
},
|
|
57
|
+
children: [
|
|
58
|
+
type === "search" && !prefix ? /* @__PURE__ */ jsx(IconSvg, {
|
|
59
|
+
artwork: SEARCH_ARTWORK,
|
|
60
|
+
size: ICON_SIZE.medium,
|
|
61
|
+
color: colors.subtle
|
|
62
|
+
}) : null,
|
|
63
|
+
prefix ? /* @__PURE__ */ jsx("span", {
|
|
64
|
+
style: { color: colors.subtle },
|
|
65
|
+
children: prefix
|
|
66
|
+
}) : null,
|
|
67
|
+
/* @__PURE__ */ jsx("input", {
|
|
68
|
+
...HTML_TYPES[type],
|
|
69
|
+
value: text,
|
|
70
|
+
placeholder,
|
|
71
|
+
maxLength,
|
|
72
|
+
disabled,
|
|
73
|
+
...controlAttributes,
|
|
74
|
+
onFocus: box.onFocus,
|
|
75
|
+
onBlur: box.onBlur,
|
|
76
|
+
onChange: (event) => {
|
|
77
|
+
const next = event.currentTarget.value;
|
|
78
|
+
typeText(next);
|
|
79
|
+
onChange?.(createEvent("change", { value: next }));
|
|
80
|
+
},
|
|
81
|
+
onKeyDown: (event) => {
|
|
82
|
+
if (event.key === "Enter" && onSubmit) onSubmit(createEvent("submit", { value: text }));
|
|
83
|
+
},
|
|
84
|
+
enterKeyHint: type === "search" ? "search" : void 0,
|
|
85
|
+
style: {
|
|
86
|
+
...BARE_INPUT_STYLE,
|
|
87
|
+
padding: "12px 0"
|
|
88
|
+
}
|
|
89
|
+
}),
|
|
90
|
+
clearable && text && !disabled ? /* @__PURE__ */ jsx(IconButton, {
|
|
91
|
+
artwork: CLOSE_ARTWORK,
|
|
92
|
+
label: "Clear",
|
|
93
|
+
size: ICON_SIZE.small,
|
|
94
|
+
onPress: () => {
|
|
95
|
+
typeText("");
|
|
96
|
+
onChange?.(createEvent("change", { value: "" }));
|
|
97
|
+
}
|
|
98
|
+
}) : null,
|
|
99
|
+
suffix ? /* @__PURE__ */ jsx("span", {
|
|
100
|
+
style: { color: colors.subtle },
|
|
101
|
+
children: suffix
|
|
102
|
+
}) : null
|
|
103
|
+
]
|
|
104
|
+
})
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
//#endregion
|
|
108
|
+
export { Input$1 as Input };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { toneColor } from "./tones.js";
|
|
3
|
+
import { pressable } from "./pressable.js";
|
|
4
|
+
import { isHttps } from "./https.js";
|
|
5
|
+
import { createEvent } from "@monimesl/dot-core";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/link.tsx
|
|
8
|
+
const Link$1 = ({ href, tone, onTap, children }) => {
|
|
9
|
+
const { colors } = useTheme();
|
|
10
|
+
const style = {
|
|
11
|
+
color: tone ? toneColor(colors, tone) : colors.primary,
|
|
12
|
+
textDecorationLine: "underline",
|
|
13
|
+
textUnderlineOffset: "2px",
|
|
14
|
+
cursor: "pointer"
|
|
15
|
+
};
|
|
16
|
+
if (isHttps(href)) return /* @__PURE__ */ jsx("a", {
|
|
17
|
+
className: "dot-link",
|
|
18
|
+
href,
|
|
19
|
+
target: "_blank",
|
|
20
|
+
rel: "noopener noreferrer",
|
|
21
|
+
style,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
return /* @__PURE__ */ jsx("a", {
|
|
25
|
+
className: "dot-link",
|
|
26
|
+
style,
|
|
27
|
+
...pressable(() => onTap?.(createEvent("tap"))),
|
|
28
|
+
children
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { Link$1 as Link };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ReactComponent } from "../types.js";
|
|
2
|
+
import { List, ListItem } from "@monimesl/dot-core";
|
|
3
|
+
//#region src/components/list.d.ts
|
|
4
|
+
declare const List$1: ReactComponent<typeof List>;
|
|
5
|
+
declare const ListItem$1: ReactComponent<typeof ListItem>;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { List$1 as List, ListItem$1 as ListItem };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { CARD_RADIUS_SCALE, CENTERED, FONT_SIZE, ICON_SIZE, WEIGHTS } from "./tokens.js";
|
|
3
|
+
import { CHEVRON_RIGHT_ARTWORK } from "./icon-artwork.js";
|
|
4
|
+
import { IconSvg } from "./icon-svg.js";
|
|
5
|
+
import { insets, paddingStyle } from "./padding.js";
|
|
6
|
+
import { IconGraphic } from "./icon.js";
|
|
7
|
+
import { createEvent } from "@monimesl/dot-core";
|
|
8
|
+
import { useEffect, useRef } from "react";
|
|
9
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
//#region src/components/list.tsx
|
|
11
|
+
const END_MARGIN = "0px 0px 200px 0px";
|
|
12
|
+
const List$1 = ({ onEndReached, children, ...padding }) => {
|
|
13
|
+
const { colors, radius } = useTheme();
|
|
14
|
+
const listRef = useRef(null);
|
|
15
|
+
const lastRowReached = useRef(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
const lastRow = listRef.current?.lastElementChild;
|
|
18
|
+
if (!onEndReached || !lastRow || typeof IntersectionObserver === "undefined") return;
|
|
19
|
+
const observer = new IntersectionObserver((entries) => {
|
|
20
|
+
if (entries.some((entry) => entry.isIntersecting) && lastRowReached.current !== lastRow) {
|
|
21
|
+
lastRowReached.current = lastRow;
|
|
22
|
+
onEndReached(createEvent("endReached"));
|
|
23
|
+
}
|
|
24
|
+
}, { rootMargin: END_MARGIN });
|
|
25
|
+
observer.observe(lastRow);
|
|
26
|
+
return () => observer.disconnect();
|
|
27
|
+
});
|
|
28
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
29
|
+
ref: listRef,
|
|
30
|
+
className: "dot-list",
|
|
31
|
+
style: {
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexDirection: "column",
|
|
34
|
+
margin: 0,
|
|
35
|
+
...paddingStyle(padding),
|
|
36
|
+
overflow: "hidden",
|
|
37
|
+
listStyle: "none",
|
|
38
|
+
borderRadius: radius * CARD_RADIUS_SCALE,
|
|
39
|
+
border: `1px solid ${colors.border}`,
|
|
40
|
+
background: colors.surface,
|
|
41
|
+
"--dot-list-divider": colors.border
|
|
42
|
+
},
|
|
43
|
+
children
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
const ListItem$1 = ({ title, subtitle, value, icon, image, onTap, children, ...padding }) => {
|
|
47
|
+
const { colors, radius } = useTheme();
|
|
48
|
+
let leading = null;
|
|
49
|
+
if (image) leading = /* @__PURE__ */ jsx("img", {
|
|
50
|
+
src: image,
|
|
51
|
+
alt: "",
|
|
52
|
+
width: 40,
|
|
53
|
+
height: 40,
|
|
54
|
+
style: {
|
|
55
|
+
borderRadius: radius,
|
|
56
|
+
objectFit: "cover",
|
|
57
|
+
flexShrink: 0
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
else if (icon) leading = /* @__PURE__ */ jsx("span", {
|
|
61
|
+
style: {
|
|
62
|
+
...CENTERED,
|
|
63
|
+
width: 36,
|
|
64
|
+
height: 36,
|
|
65
|
+
borderRadius: "50%",
|
|
66
|
+
background: colors.muted,
|
|
67
|
+
flexShrink: 0
|
|
68
|
+
},
|
|
69
|
+
children: /* @__PURE__ */ jsx(IconGraphic, {
|
|
70
|
+
name: icon,
|
|
71
|
+
size: ICON_SIZE.medium,
|
|
72
|
+
color: colors.text
|
|
73
|
+
})
|
|
74
|
+
});
|
|
75
|
+
const trailing = children || value;
|
|
76
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
77
|
+
leading,
|
|
78
|
+
/* @__PURE__ */ jsxs("div", {
|
|
79
|
+
style: {
|
|
80
|
+
display: "flex",
|
|
81
|
+
flexDirection: "column",
|
|
82
|
+
flexGrow: 1,
|
|
83
|
+
minWidth: 0,
|
|
84
|
+
overflowWrap: "anywhere"
|
|
85
|
+
},
|
|
86
|
+
children: [title ? /* @__PURE__ */ jsx("span", {
|
|
87
|
+
style: {
|
|
88
|
+
lineHeight: "normal",
|
|
89
|
+
fontWeight: WEIGHTS.medium
|
|
90
|
+
},
|
|
91
|
+
children: title
|
|
92
|
+
}) : null, subtitle ? /* @__PURE__ */ jsx("span", {
|
|
93
|
+
style: {
|
|
94
|
+
fontSize: FONT_SIZE.caption,
|
|
95
|
+
lineHeight: "normal",
|
|
96
|
+
color: colors.subtle
|
|
97
|
+
},
|
|
98
|
+
children: subtitle
|
|
99
|
+
}) : null]
|
|
100
|
+
}),
|
|
101
|
+
trailing || onTap ? /* @__PURE__ */ jsxs("div", {
|
|
102
|
+
style: {
|
|
103
|
+
display: "flex",
|
|
104
|
+
alignItems: "center",
|
|
105
|
+
gap: 4,
|
|
106
|
+
flexShrink: 0,
|
|
107
|
+
color: colors.subtle
|
|
108
|
+
},
|
|
109
|
+
children: [trailing, onTap ? /* @__PURE__ */ jsx(IconSvg, {
|
|
110
|
+
artwork: CHEVRON_RIGHT_ARTWORK,
|
|
111
|
+
size: ICON_SIZE.small,
|
|
112
|
+
color: colors.subtle
|
|
113
|
+
}) : null]
|
|
114
|
+
}) : null
|
|
115
|
+
] });
|
|
116
|
+
const rowStyle = {
|
|
117
|
+
display: "flex",
|
|
118
|
+
alignItems: "center",
|
|
119
|
+
gap: 12,
|
|
120
|
+
...paddingStyle(padding, insets(12, 16)),
|
|
121
|
+
width: "100%",
|
|
122
|
+
background: colors.surface,
|
|
123
|
+
color: colors.text,
|
|
124
|
+
fontSize: FONT_SIZE.body,
|
|
125
|
+
textAlign: "start"
|
|
126
|
+
};
|
|
127
|
+
return /* @__PURE__ */ jsx("li", {
|
|
128
|
+
className: "dot-list-item",
|
|
129
|
+
style: onTap ? { background: colors.surface } : rowStyle,
|
|
130
|
+
children: onTap ? /* @__PURE__ */ jsx("button", {
|
|
131
|
+
type: "button",
|
|
132
|
+
onClick: () => onTap(createEvent("tap")),
|
|
133
|
+
style: {
|
|
134
|
+
...rowStyle,
|
|
135
|
+
border: "none",
|
|
136
|
+
cursor: "pointer"
|
|
137
|
+
},
|
|
138
|
+
children: content
|
|
139
|
+
}) : content
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
export { List$1 as List, ListItem$1 as ListItem };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { FONT_SIZE, ICON_SIZE, WEIGHTS } from "./tokens.js";
|
|
3
|
+
import { CHECK_ARTWORK } from "./icon-artwork.js";
|
|
4
|
+
import { IconSvg } from "./icon-svg.js";
|
|
5
|
+
import { OptionPlaceContext } from "./option-place.js";
|
|
6
|
+
import { useContext } from "react";
|
|
7
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/option.tsx
|
|
9
|
+
const Option = ({ value, label }) => {
|
|
10
|
+
const { colors } = useTheme();
|
|
11
|
+
const place = useContext(OptionPlaceContext);
|
|
12
|
+
const chosen = value !== void 0 && value === place.value;
|
|
13
|
+
if (place.inField) return chosen ? /* @__PURE__ */ jsx(Fragment$1, { children: label }) : null;
|
|
14
|
+
const { choose } = place;
|
|
15
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
16
|
+
type: "button",
|
|
17
|
+
className: "dot-option",
|
|
18
|
+
role: "option",
|
|
19
|
+
"aria-selected": chosen,
|
|
20
|
+
onClick: choose && value !== void 0 ? () => choose(value) : void 0,
|
|
21
|
+
style: {
|
|
22
|
+
display: "flex",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
justifyContent: "space-between",
|
|
25
|
+
minHeight: 52,
|
|
26
|
+
padding: "16px 12px",
|
|
27
|
+
border: "none",
|
|
28
|
+
borderBottom: `1px solid ${colors.border}`,
|
|
29
|
+
background: "transparent",
|
|
30
|
+
color: colors.text,
|
|
31
|
+
fontSize: FONT_SIZE.body,
|
|
32
|
+
fontWeight: chosen ? WEIGHTS.bold : WEIGHTS.regular,
|
|
33
|
+
textAlign: "start",
|
|
34
|
+
cursor: "pointer"
|
|
35
|
+
},
|
|
36
|
+
children: [/* @__PURE__ */ jsx("span", { children: label }), chosen ? /* @__PURE__ */ jsx(IconSvg, {
|
|
37
|
+
artwork: CHECK_ARTWORK,
|
|
38
|
+
size: ICON_SIZE.medium,
|
|
39
|
+
color: colors.primary
|
|
40
|
+
}) : null]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { Option };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { SPACE } from "./tokens.js";
|
|
2
|
+
//#region src/components/padding.ts
|
|
3
|
+
const NO_INSETS = {
|
|
4
|
+
top: 0,
|
|
5
|
+
start: 0,
|
|
6
|
+
end: 0,
|
|
7
|
+
bottom: 0
|
|
8
|
+
};
|
|
9
|
+
function insets(block, inline = block) {
|
|
10
|
+
return {
|
|
11
|
+
top: block,
|
|
12
|
+
start: inline,
|
|
13
|
+
end: inline,
|
|
14
|
+
bottom: block
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function paddingStyle(props, ownInsets = NO_INSETS) {
|
|
18
|
+
return {
|
|
19
|
+
paddingTop: sidePadding(props.paddingTop ?? props.padding, ownInsets.top),
|
|
20
|
+
paddingInlineStart: sidePadding(props.paddingStart ?? props.padding, ownInsets.start),
|
|
21
|
+
paddingInlineEnd: sidePadding(props.paddingEnd ?? props.padding, ownInsets.end),
|
|
22
|
+
paddingBottom: sidePadding(props.paddingBottom ?? props.padding, ownInsets.bottom)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function sidePadding(pageSpace, ownPixels) {
|
|
26
|
+
if (pageSpace === void 0) return ownPixels;
|
|
27
|
+
return SPACE[pageSpace];
|
|
28
|
+
}
|
|
29
|
+
const HOME_INDICATOR = "env(safe-area-inset-bottom, 0px)";
|
|
30
|
+
function pinnedPaddingStyle(props, ownInsets) {
|
|
31
|
+
const style = paddingStyle(props, ownInsets);
|
|
32
|
+
return {
|
|
33
|
+
...style,
|
|
34
|
+
paddingBottom: `calc(${style.paddingBottom}px + ${HOME_INDICATOR})`
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
//#endregion
|
|
38
|
+
export { HOME_INDICATOR, insets, paddingStyle, pinnedPaddingStyle };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region src/components/pressable.ts
|
|
2
|
+
function pressable(press) {
|
|
3
|
+
return {
|
|
4
|
+
role: "button",
|
|
5
|
+
tabIndex: 0,
|
|
6
|
+
onClick: press,
|
|
7
|
+
onKeyDown: (event) => {
|
|
8
|
+
if (event.target !== event.currentTarget) return;
|
|
9
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
10
|
+
event.preventDefault();
|
|
11
|
+
press();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { pressable };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactComponent } from "../types.js";
|
|
2
|
+
import { Bullet, BulletList, Prose, Quote } from "@monimesl/dot-core";
|
|
3
|
+
//#region src/components/prose.d.ts
|
|
4
|
+
declare const Prose$1: ReactComponent<typeof Prose>;
|
|
5
|
+
declare const Quote$1: ReactComponent<typeof Quote>;
|
|
6
|
+
declare const BulletList$1: ReactComponent<typeof BulletList>;
|
|
7
|
+
declare const Bullet$1: ReactComponent<typeof Bullet>;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Bullet$1 as Bullet, BulletList$1 as BulletList, Prose$1 as Prose, Quote$1 as Quote };
|