@monimesl/dot-renderer-react 0.1.0-alpha.2 → 0.1.0-alpha.21
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 +41 -1
- package/dist/LICENSE-PHOSPHOR +21 -0
- package/dist/_virtual/_rolldown/runtime.js +14 -0
- package/dist/_virtual/builtin_esm-external-require-react.js +9 -0
- package/dist/color.js +107 -0
- package/dist/components/amount-input.d.ts +6 -0
- package/dist/components/amount-input.js +109 -0
- package/dist/components/avatar.d.ts +6 -0
- package/dist/components/avatar.js +63 -0
- package/dist/components/box.js +58 -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 +254 -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 +97 -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 +66 -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 +24 -0
- package/dist/components/grid.d.ts +7 -0
- package/dist/components/grid.js +98 -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 +145 -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 +27 -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 +55 -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 +94 -0
- package/dist/components/steps.d.ts +7 -0
- package/dist/components/steps.js +112 -0
- package/dist/components/tabs.d.ts +7 -0
- package/dist/components/tabs.js +91 -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 +106 -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 +150 -0
- package/dist/components/tokens.js +44 -0
- package/dist/components/tones.js +30 -0
- package/dist/components/typed-text.js +28 -0
- package/dist/components/utils.js +6 -0
- package/dist/components/view.d.ts +6 -0
- package/dist/components/view.js +54 -0
- package/dist/index.d.ts +43 -44
- package/dist/index.js +40 -318
- package/dist/markdown.js +226 -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 +118 -0
- package/dist/react-host/19.3.0/react-dom.js +3 -0
- package/dist/react-host/19.3.0/react-host.js +6 -6
- package/dist/renderer.d.ts +17 -0
- package/dist/renderer.js +33 -0
- package/dist/root.d.ts +10 -0
- package/dist/root.js +55 -0
- package/dist/styles.css +1 -0
- package/dist/theme.d.ts +26 -0
- package/dist/theme.js +93 -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 +13 -6
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { SPACE } from "./tokens.js";
|
|
3
|
+
import { paddingStyle } from "./padding.js";
|
|
4
|
+
import { clamp } from "./utils.js";
|
|
5
|
+
import { createEvent } from "@monimesl/dot-core";
|
|
6
|
+
import { Children, Fragment, isValidElement, useEffect, useEffectEvent, useRef, useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/carousel.tsx
|
|
9
|
+
const SLIDE_DURATION = 350;
|
|
10
|
+
const SLIDE_EASING = "cubic-bezier(0.22, 0.61, 0.36, 1)";
|
|
11
|
+
const SWIPE_DISTANCE = .2;
|
|
12
|
+
const SWIPE_SPEED = .4;
|
|
13
|
+
const EDGE_RESISTANCE = .3;
|
|
14
|
+
const TAP_SLOP = 6;
|
|
15
|
+
const Carousel$1 = ({ autoplay = false, interval = 4e3, loop = false, indicator = "dots", gap = "none", effect = "slide", index, onChange, children, ...padding }) => {
|
|
16
|
+
const { colors } = useTheme();
|
|
17
|
+
const slides = slidesOf(children);
|
|
18
|
+
const count = slides.length;
|
|
19
|
+
const looping = loop && count > 1;
|
|
20
|
+
const first = looping ? 1 : 0;
|
|
21
|
+
const last = looping ? count + 1 : count - 1;
|
|
22
|
+
const [position, setPosition] = useState(() => first + slideIndex(index ?? 0, count));
|
|
23
|
+
const [animated, setAnimated] = useState(true);
|
|
24
|
+
const [drag, setDrag] = useState(0);
|
|
25
|
+
const [dragging, setDragging] = useState(false);
|
|
26
|
+
const [width, setWidth] = useState(0);
|
|
27
|
+
const [previousIndex, setPreviousIndex] = useState(index);
|
|
28
|
+
const viewport = useRef(null);
|
|
29
|
+
const gesture = useRef(null);
|
|
30
|
+
const swiped = useRef(false);
|
|
31
|
+
if (index !== previousIndex) {
|
|
32
|
+
setPreviousIndex(index);
|
|
33
|
+
if (index !== void 0) {
|
|
34
|
+
setAnimated(true);
|
|
35
|
+
setPosition(first + slideIndex(index, count));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const shown = clamp(position, 0, last);
|
|
39
|
+
const current = count === 0 ? 0 : wrap(shown - first, count);
|
|
40
|
+
const moveTo = (target) => {
|
|
41
|
+
const next = clamp(target, 0, last);
|
|
42
|
+
setAnimated(true);
|
|
43
|
+
setPosition(next);
|
|
44
|
+
const nextIndex = wrap(next - first, count);
|
|
45
|
+
if (nextIndex !== current) onChange?.(createEvent("change", { index: nextIndex }));
|
|
46
|
+
};
|
|
47
|
+
const step = (direction) => {
|
|
48
|
+
const beyondEnd = current + direction < 0 || current + direction >= count;
|
|
49
|
+
if (!looping && beyondEnd) moveTo(shown);
|
|
50
|
+
else moveTo(shown + direction);
|
|
51
|
+
};
|
|
52
|
+
const advance = useEffectEvent(() => {
|
|
53
|
+
if (!looping && current === count - 1) moveTo(first);
|
|
54
|
+
else moveTo(shown + 1);
|
|
55
|
+
});
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
if (!autoplay || count < 2 || dragging) return;
|
|
58
|
+
const timer = setTimeout(advance, interval);
|
|
59
|
+
return () => clearTimeout(timer);
|
|
60
|
+
}, [
|
|
61
|
+
autoplay,
|
|
62
|
+
count,
|
|
63
|
+
dragging,
|
|
64
|
+
interval,
|
|
65
|
+
current
|
|
66
|
+
]);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (!looping || position !== 0 && position !== count + 1) return;
|
|
69
|
+
const timer = setTimeout(() => {
|
|
70
|
+
setAnimated(false);
|
|
71
|
+
setPosition(position === 0 ? count : 1);
|
|
72
|
+
}, SLIDE_DURATION);
|
|
73
|
+
return () => clearTimeout(timer);
|
|
74
|
+
}, [
|
|
75
|
+
looping,
|
|
76
|
+
position,
|
|
77
|
+
count
|
|
78
|
+
]);
|
|
79
|
+
const gestureOf = (event) => {
|
|
80
|
+
const inProgress = gesture.current;
|
|
81
|
+
return inProgress?.pointerId === event.pointerId ? inProgress : null;
|
|
82
|
+
};
|
|
83
|
+
const endGesture = () => {
|
|
84
|
+
gesture.current = null;
|
|
85
|
+
setDragging(false);
|
|
86
|
+
setDrag(0);
|
|
87
|
+
setAnimated(true);
|
|
88
|
+
};
|
|
89
|
+
const onPointerDown = (event) => {
|
|
90
|
+
if (count < 2 || !event.isPrimary) return;
|
|
91
|
+
gesture.current = {
|
|
92
|
+
pointerId: event.pointerId,
|
|
93
|
+
startX: event.clientX,
|
|
94
|
+
startY: event.clientY,
|
|
95
|
+
startTime: event.timeStamp,
|
|
96
|
+
swiping: false
|
|
97
|
+
};
|
|
98
|
+
swiped.current = false;
|
|
99
|
+
setDragging(true);
|
|
100
|
+
setWidth(viewport.current?.clientWidth ?? 0);
|
|
101
|
+
};
|
|
102
|
+
const onPointerMove = (event) => {
|
|
103
|
+
const swipe = gestureOf(event);
|
|
104
|
+
if (!swipe) return;
|
|
105
|
+
const movedX = event.clientX - swipe.startX;
|
|
106
|
+
const movedY = event.clientY - swipe.startY;
|
|
107
|
+
if (!swipe.swiping) {
|
|
108
|
+
if (Math.abs(movedX) < TAP_SLOP && Math.abs(movedY) < TAP_SLOP) return;
|
|
109
|
+
if (Math.abs(movedY) > Math.abs(movedX)) {
|
|
110
|
+
endGesture();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
swipe.swiping = true;
|
|
114
|
+
swiped.current = true;
|
|
115
|
+
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
116
|
+
setAnimated(false);
|
|
117
|
+
}
|
|
118
|
+
const beforeFirst = current === 0 && movedX > 0;
|
|
119
|
+
const afterLast = current === count - 1 && movedX < 0;
|
|
120
|
+
setDrag(!looping && (beforeFirst || afterLast) ? movedX * EDGE_RESISTANCE : movedX);
|
|
121
|
+
};
|
|
122
|
+
const onPointerUp = (event) => {
|
|
123
|
+
const swipe = gestureOf(event);
|
|
124
|
+
if (!swipe) return;
|
|
125
|
+
endGesture();
|
|
126
|
+
if (!swipe.swiping) return;
|
|
127
|
+
const movedX = event.clientX - swipe.startX;
|
|
128
|
+
const speed = Math.abs(movedX) / Math.max(1, event.timeStamp - swipe.startTime);
|
|
129
|
+
if (Math.abs(movedX) > width * SWIPE_DISTANCE || speed > SWIPE_SPEED) step(movedX < 0 ? 1 : -1);
|
|
130
|
+
else moveTo(shown);
|
|
131
|
+
};
|
|
132
|
+
const gapWidth = SPACE[gap];
|
|
133
|
+
const transition = animated ? `transform ${SLIDE_DURATION}ms ${SLIDE_EASING}` : "none";
|
|
134
|
+
const swipedSlides = width > 0 ? drag / (width + gapWidth) : 0;
|
|
135
|
+
const track = looping ? [
|
|
136
|
+
{
|
|
137
|
+
...slides[count - 1],
|
|
138
|
+
key: "copy-of-last"
|
|
139
|
+
},
|
|
140
|
+
...slides,
|
|
141
|
+
{
|
|
142
|
+
...slides[0],
|
|
143
|
+
key: "copy-of-first"
|
|
144
|
+
}
|
|
145
|
+
] : slides;
|
|
146
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
147
|
+
className: "dot-carousel",
|
|
148
|
+
role: "region",
|
|
149
|
+
"aria-roledescription": "carousel",
|
|
150
|
+
style: {
|
|
151
|
+
display: "flex",
|
|
152
|
+
flexDirection: "column",
|
|
153
|
+
gap: SPACE.medium,
|
|
154
|
+
minWidth: 0,
|
|
155
|
+
...paddingStyle(padding)
|
|
156
|
+
},
|
|
157
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
158
|
+
ref: viewport,
|
|
159
|
+
onPointerDown,
|
|
160
|
+
onPointerMove,
|
|
161
|
+
onPointerUp,
|
|
162
|
+
onPointerCancel: endGesture,
|
|
163
|
+
onDragStart: (event) => event.preventDefault(),
|
|
164
|
+
onClickCapture: (event) => {
|
|
165
|
+
if (swiped.current) {
|
|
166
|
+
swiped.current = false;
|
|
167
|
+
event.stopPropagation();
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
style: {
|
|
171
|
+
overflow: "hidden",
|
|
172
|
+
touchAction: "pan-y",
|
|
173
|
+
userSelect: dragging ? "none" : void 0
|
|
174
|
+
},
|
|
175
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
176
|
+
style: {
|
|
177
|
+
display: "flex",
|
|
178
|
+
gap: gapWidth,
|
|
179
|
+
transform: `translateX(calc(${-shown} * (100% + ${gapWidth}px) + ${drag}px))`,
|
|
180
|
+
transition
|
|
181
|
+
},
|
|
182
|
+
children: track.map((slide, trackPosition) => {
|
|
183
|
+
const visible = trackPosition === shown;
|
|
184
|
+
const distance = Math.abs(trackPosition - shown + swipedSlides);
|
|
185
|
+
const scale = 1 - Math.min(distance, 1) * .15000000000000002;
|
|
186
|
+
return /* @__PURE__ */ jsx("div", {
|
|
187
|
+
role: "group",
|
|
188
|
+
"aria-roledescription": "slide",
|
|
189
|
+
"aria-label": `${wrap(trackPosition - first, count) + 1} of ${count}`,
|
|
190
|
+
"aria-hidden": !visible,
|
|
191
|
+
inert: !visible,
|
|
192
|
+
style: {
|
|
193
|
+
display: "grid",
|
|
194
|
+
flex: "0 0 100%",
|
|
195
|
+
minWidth: 0,
|
|
196
|
+
transform: effect === "scale" ? `scale(${scale})` : void 0,
|
|
197
|
+
transition: effect === "scale" ? transition : void 0
|
|
198
|
+
},
|
|
199
|
+
children: slide.node
|
|
200
|
+
}, slide.key);
|
|
201
|
+
})
|
|
202
|
+
})
|
|
203
|
+
}), indicator === "dots" && count > 1 ? /* @__PURE__ */ jsx("div", {
|
|
204
|
+
style: {
|
|
205
|
+
display: "flex",
|
|
206
|
+
justifyContent: "center"
|
|
207
|
+
},
|
|
208
|
+
children: slides.map((slide, slideIndex) => {
|
|
209
|
+
const active = slideIndex === current;
|
|
210
|
+
return /* @__PURE__ */ jsx("button", {
|
|
211
|
+
type: "button",
|
|
212
|
+
"aria-label": `Slide ${slideIndex + 1} of ${count}`,
|
|
213
|
+
"aria-current": active,
|
|
214
|
+
onClick: () => moveTo(first + slideIndex),
|
|
215
|
+
style: {
|
|
216
|
+
padding: "6px 3px",
|
|
217
|
+
border: "none",
|
|
218
|
+
background: "none",
|
|
219
|
+
cursor: "pointer"
|
|
220
|
+
},
|
|
221
|
+
children: /* @__PURE__ */ jsx("span", { style: {
|
|
222
|
+
display: "block",
|
|
223
|
+
width: active ? 18 : 6,
|
|
224
|
+
height: 6,
|
|
225
|
+
borderRadius: 3,
|
|
226
|
+
background: active ? colors.primary : colors.subtle,
|
|
227
|
+
transition: "width 0.3s, background 0.3s"
|
|
228
|
+
} })
|
|
229
|
+
}, slide.key);
|
|
230
|
+
})
|
|
231
|
+
}) : null]
|
|
232
|
+
});
|
|
233
|
+
};
|
|
234
|
+
function slidesOf(children, keyPrefix = "") {
|
|
235
|
+
const slides = [];
|
|
236
|
+
for (const child of Children.toArray(children)) {
|
|
237
|
+
if (!isValidElement(child)) continue;
|
|
238
|
+
const key = `${keyPrefix}${String(child.key)}`;
|
|
239
|
+
if (child.type === Fragment) slides.push(...slidesOf(child.props.children, `${key}/`));
|
|
240
|
+
else slides.push({
|
|
241
|
+
key,
|
|
242
|
+
node: child
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
return slides;
|
|
246
|
+
}
|
|
247
|
+
function slideIndex(index, count) {
|
|
248
|
+
return clamp(Math.round(index), 0, count - 1);
|
|
249
|
+
}
|
|
250
|
+
function wrap(value, count) {
|
|
251
|
+
return (value % count + count) % count;
|
|
252
|
+
}
|
|
253
|
+
//#endregion
|
|
254
|
+
export { Carousel$1 as Carousel };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { DISABLED_OPACITY, FONT_SIZE, ICON_SIZE, WEIGHTS } from "./tokens.js";
|
|
3
|
+
import { IconGraphic } from "./icon.js";
|
|
4
|
+
import { createEvent } from "@monimesl/dot-core";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/chip.tsx
|
|
7
|
+
const Chip$1 = ({ label, icon, selected = false, disabled, onTap }) => {
|
|
8
|
+
const { colors } = useTheme();
|
|
9
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
10
|
+
type: "button",
|
|
11
|
+
className: "dot-chip",
|
|
12
|
+
"aria-pressed": selected,
|
|
13
|
+
disabled,
|
|
14
|
+
onClick: onTap ? () => onTap(createEvent("tap")) : void 0,
|
|
15
|
+
style: {
|
|
16
|
+
display: "inline-flex",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
gap: 6,
|
|
19
|
+
flexShrink: 0,
|
|
20
|
+
minHeight: 34,
|
|
21
|
+
padding: "0 14px",
|
|
22
|
+
borderRadius: 17,
|
|
23
|
+
border: `1px solid ${selected ? colors.primary : colors.border}`,
|
|
24
|
+
background: selected ? colors.primary : colors.surface,
|
|
25
|
+
color: selected ? colors.onPrimary : colors.text,
|
|
26
|
+
fontSize: FONT_SIZE.caption,
|
|
27
|
+
fontWeight: WEIGHTS.medium,
|
|
28
|
+
lineHeight: "normal",
|
|
29
|
+
whiteSpace: "nowrap",
|
|
30
|
+
opacity: disabled ? DISABLED_OPACITY : 1,
|
|
31
|
+
cursor: disabled ? "default" : "pointer"
|
|
32
|
+
},
|
|
33
|
+
children: [icon ? /* @__PURE__ */ jsx(IconGraphic, {
|
|
34
|
+
name: icon,
|
|
35
|
+
size: ICON_SIZE.small,
|
|
36
|
+
color: "currentColor"
|
|
37
|
+
}) : null, label]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { Chip$1 as Chip };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { DISABLED_OPACITY, SPACE, WEIGHTS } from "./tokens.js";
|
|
3
|
+
import { Field } from "./field.js";
|
|
4
|
+
import { fieldBorderColor, useFieldNote } from "./field-box.js";
|
|
5
|
+
import { useTypedText } from "./typed-text.js";
|
|
6
|
+
import { createEvent } from "@monimesl/dot-core";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
//#region src/components/code-input.tsx
|
|
10
|
+
const CodeInput$1 = ({ value, length = 6, label, hint, error, secure, disabled, onChange, onComplete }) => {
|
|
11
|
+
const { colors, radius } = useTheme();
|
|
12
|
+
const [text, typeText] = useTypedText(value, onChange !== void 0);
|
|
13
|
+
const [focused, setFocused] = useState(false);
|
|
14
|
+
const { noteId, controlAttributes } = useFieldNote(hint, error);
|
|
15
|
+
const count = Math.max(1, Math.round(length));
|
|
16
|
+
const digits = text.slice(0, count);
|
|
17
|
+
const next = Math.min(digits.length, count - 1);
|
|
18
|
+
const boxes = Array.from({ length: count }, (_, index) => {
|
|
19
|
+
const digit = digits[index];
|
|
20
|
+
const borderColor = fieldBorderColor(colors, error, focused && index === next);
|
|
21
|
+
return /* @__PURE__ */ jsx("span", {
|
|
22
|
+
style: {
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
justifyContent: "center",
|
|
26
|
+
flex: "1 1 0",
|
|
27
|
+
maxWidth: 52,
|
|
28
|
+
height: 52,
|
|
29
|
+
border: `1.5px solid ${borderColor}`,
|
|
30
|
+
borderRadius: radius,
|
|
31
|
+
background: colors.surface,
|
|
32
|
+
fontSize: 22,
|
|
33
|
+
fontWeight: WEIGHTS.bold
|
|
34
|
+
},
|
|
35
|
+
children: digit !== void 0 && secure ? /* @__PURE__ */ jsx("span", {
|
|
36
|
+
"aria-hidden": "true",
|
|
37
|
+
style: {
|
|
38
|
+
width: 12,
|
|
39
|
+
height: 12,
|
|
40
|
+
borderRadius: "50%",
|
|
41
|
+
background: colors.text
|
|
42
|
+
}
|
|
43
|
+
}) : digit
|
|
44
|
+
}, index);
|
|
45
|
+
});
|
|
46
|
+
return /* @__PURE__ */ jsx(Field, {
|
|
47
|
+
label,
|
|
48
|
+
hint,
|
|
49
|
+
error,
|
|
50
|
+
noteId,
|
|
51
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
52
|
+
className: "dot-code-input",
|
|
53
|
+
style: {
|
|
54
|
+
position: "relative",
|
|
55
|
+
display: "flex",
|
|
56
|
+
gap: SPACE.medium,
|
|
57
|
+
color: colors.text,
|
|
58
|
+
opacity: disabled ? DISABLED_OPACITY : 1
|
|
59
|
+
},
|
|
60
|
+
children: [boxes, /* @__PURE__ */ jsx("input", {
|
|
61
|
+
value: digits,
|
|
62
|
+
inputMode: "numeric",
|
|
63
|
+
autoComplete: "one-time-code",
|
|
64
|
+
maxLength: count,
|
|
65
|
+
disabled,
|
|
66
|
+
...controlAttributes,
|
|
67
|
+
onFocus: () => setFocused(true),
|
|
68
|
+
onBlur: () => setFocused(false),
|
|
69
|
+
onSelect: (event) => {
|
|
70
|
+
const input = event.currentTarget;
|
|
71
|
+
const end = input.value.length;
|
|
72
|
+
if (input.selectionStart !== end || input.selectionEnd !== end) input.setSelectionRange(end, end);
|
|
73
|
+
},
|
|
74
|
+
onChange: (event) => {
|
|
75
|
+
const typed = event.currentTarget.value.replace(/\D/g, "").slice(0, count);
|
|
76
|
+
if (typed === digits) return;
|
|
77
|
+
typeText(typed);
|
|
78
|
+
onChange?.(createEvent("change", { value: typed }));
|
|
79
|
+
if (typed.length === count) onComplete?.(createEvent("complete", { value: typed }));
|
|
80
|
+
},
|
|
81
|
+
style: {
|
|
82
|
+
position: "absolute",
|
|
83
|
+
inset: 0,
|
|
84
|
+
width: "100%",
|
|
85
|
+
height: "100%",
|
|
86
|
+
padding: 0,
|
|
87
|
+
border: "none",
|
|
88
|
+
opacity: 0,
|
|
89
|
+
fontSize: 16,
|
|
90
|
+
cursor: disabled ? "default" : "text"
|
|
91
|
+
}
|
|
92
|
+
})]
|
|
93
|
+
})
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
//#endregion
|
|
97
|
+
export { CodeInput$1 as CodeInput };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { FONT_SIZE, WEIGHTS } from "./tokens.js";
|
|
3
|
+
import { insets, paddingStyle } from "./padding.js";
|
|
4
|
+
import { toneColor } from "./tones.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/detail-row.tsx
|
|
7
|
+
const DetailRow = ({ label, value, tone, weight = "regular", ...padding }) => {
|
|
8
|
+
const { colors } = useTheme();
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "dot-detail-row",
|
|
11
|
+
style: {
|
|
12
|
+
display: "flex",
|
|
13
|
+
alignItems: "baseline",
|
|
14
|
+
justifyContent: "space-between",
|
|
15
|
+
gap: 16,
|
|
16
|
+
...paddingStyle(padding, insets(6, 0)),
|
|
17
|
+
fontSize: FONT_SIZE.body,
|
|
18
|
+
lineHeight: "normal"
|
|
19
|
+
},
|
|
20
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
21
|
+
style: {
|
|
22
|
+
flexShrink: 0,
|
|
23
|
+
maxWidth: "50%",
|
|
24
|
+
color: colors.subtle
|
|
25
|
+
},
|
|
26
|
+
children: label
|
|
27
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
28
|
+
style: {
|
|
29
|
+
minWidth: 0,
|
|
30
|
+
textAlign: "end",
|
|
31
|
+
overflowWrap: "anywhere",
|
|
32
|
+
color: toneColor(colors, tone ?? "default"),
|
|
33
|
+
fontWeight: WEIGHTS[weight]
|
|
34
|
+
},
|
|
35
|
+
children: value
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { DetailRow };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { FONT_SIZE, ICON_SIZE, SPACE, WEIGHTS } from "./tokens.js";
|
|
3
|
+
import { CHEVRON_DOWN_ARTWORK } from "./icon-artwork.js";
|
|
4
|
+
import { IconSvg } from "./icon-svg.js";
|
|
5
|
+
import { createEvent } from "@monimesl/dot-core";
|
|
6
|
+
import { useState } from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/components/disclosure.tsx
|
|
9
|
+
const Disclosure$1 = ({ title, subtitle, open: startsOpen = false, children, onToggle }) => {
|
|
10
|
+
const { colors } = useTheme();
|
|
11
|
+
const [open, setOpen] = useState(startsOpen);
|
|
12
|
+
return /* @__PURE__ */ jsxs("details", {
|
|
13
|
+
className: "dot-disclosure",
|
|
14
|
+
open,
|
|
15
|
+
onToggle: (event) => {
|
|
16
|
+
const next = event.currentTarget.open;
|
|
17
|
+
if (next !== open) {
|
|
18
|
+
setOpen(next);
|
|
19
|
+
onToggle?.(createEvent("toggle", { open: next }));
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
style: { color: colors.text },
|
|
23
|
+
children: [/* @__PURE__ */ jsxs("summary", {
|
|
24
|
+
style: {
|
|
25
|
+
display: "flex",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
gap: SPACE.medium,
|
|
28
|
+
padding: "12px 0",
|
|
29
|
+
cursor: "pointer"
|
|
30
|
+
},
|
|
31
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
32
|
+
style: {
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexDirection: "column",
|
|
35
|
+
gap: 2,
|
|
36
|
+
flex: 1,
|
|
37
|
+
minWidth: 0
|
|
38
|
+
},
|
|
39
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
40
|
+
style: {
|
|
41
|
+
fontSize: FONT_SIZE.body,
|
|
42
|
+
fontWeight: WEIGHTS.medium
|
|
43
|
+
},
|
|
44
|
+
children: title
|
|
45
|
+
}), subtitle ? /* @__PURE__ */ jsx("span", {
|
|
46
|
+
style: {
|
|
47
|
+
fontSize: FONT_SIZE.caption,
|
|
48
|
+
color: colors.subtle
|
|
49
|
+
},
|
|
50
|
+
children: subtitle
|
|
51
|
+
}) : null]
|
|
52
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
53
|
+
style: {
|
|
54
|
+
display: "flex",
|
|
55
|
+
transform: open ? "rotate(180deg)" : "none",
|
|
56
|
+
transition: "transform 0.2s"
|
|
57
|
+
},
|
|
58
|
+
children: /* @__PURE__ */ jsx(IconSvg, {
|
|
59
|
+
artwork: CHEVRON_DOWN_ARTWORK,
|
|
60
|
+
size: ICON_SIZE.medium,
|
|
61
|
+
color: colors.subtle
|
|
62
|
+
})
|
|
63
|
+
})]
|
|
64
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
65
|
+
style: {
|
|
66
|
+
display: "flex",
|
|
67
|
+
flexDirection: "column",
|
|
68
|
+
gap: SPACE.medium,
|
|
69
|
+
paddingBottom: 12
|
|
70
|
+
},
|
|
71
|
+
children
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
//#endregion
|
|
76
|
+
export { Disclosure$1 as Disclosure };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/divider.tsx
|
|
4
|
+
const Divider = () => {
|
|
5
|
+
const { colors } = useTheme();
|
|
6
|
+
return /* @__PURE__ */ jsx("div", {
|
|
7
|
+
className: "dot-divider",
|
|
8
|
+
role: "separator",
|
|
9
|
+
style: {
|
|
10
|
+
alignSelf: "stretch",
|
|
11
|
+
flexShrink: 0,
|
|
12
|
+
height: 1,
|
|
13
|
+
background: colors.border
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Divider };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useTheme } from "../theme.js";
|
|
2
|
+
import { FONT_SIZE, ICON_SIZE, SPACE, WEIGHTS } from "./tokens.js";
|
|
3
|
+
import { insets, paddingStyle } from "./padding.js";
|
|
4
|
+
import { IconGraphic } from "./icon.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/empty-state.tsx
|
|
7
|
+
const EmptyState = ({ icon, title, text, children, ...padding }) => {
|
|
8
|
+
const { colors } = useTheme();
|
|
9
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
10
|
+
className: "dot-empty-state",
|
|
11
|
+
style: {
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
gap: SPACE.medium,
|
|
16
|
+
...paddingStyle(padding, insets(32, 16)),
|
|
17
|
+
textAlign: "center",
|
|
18
|
+
color: colors.text
|
|
19
|
+
},
|
|
20
|
+
children: [
|
|
21
|
+
icon ? /* @__PURE__ */ jsx("span", {
|
|
22
|
+
style: {
|
|
23
|
+
display: "flex",
|
|
24
|
+
alignItems: "center",
|
|
25
|
+
justifyContent: "center",
|
|
26
|
+
width: 64,
|
|
27
|
+
height: 64,
|
|
28
|
+
borderRadius: "50%",
|
|
29
|
+
background: colors.muted
|
|
30
|
+
},
|
|
31
|
+
children: /* @__PURE__ */ jsx(IconGraphic, {
|
|
32
|
+
name: icon,
|
|
33
|
+
size: ICON_SIZE.large,
|
|
34
|
+
color: colors.subtle
|
|
35
|
+
})
|
|
36
|
+
}) : null,
|
|
37
|
+
title ? /* @__PURE__ */ jsx("span", {
|
|
38
|
+
style: {
|
|
39
|
+
fontSize: 17,
|
|
40
|
+
fontWeight: WEIGHTS.bold,
|
|
41
|
+
lineHeight: "normal"
|
|
42
|
+
},
|
|
43
|
+
children: title
|
|
44
|
+
}) : null,
|
|
45
|
+
text ? /* @__PURE__ */ jsx("span", {
|
|
46
|
+
style: {
|
|
47
|
+
maxWidth: 300,
|
|
48
|
+
fontSize: FONT_SIZE.body,
|
|
49
|
+
lineHeight: "normal",
|
|
50
|
+
color: colors.subtle
|
|
51
|
+
},
|
|
52
|
+
children: text
|
|
53
|
+
}) : null,
|
|
54
|
+
children ? /* @__PURE__ */ jsx("div", {
|
|
55
|
+
style: {
|
|
56
|
+
display: "flex",
|
|
57
|
+
gap: SPACE.medium,
|
|
58
|
+
paddingTop: SPACE.small
|
|
59
|
+
},
|
|
60
|
+
children
|
|
61
|
+
}) : null
|
|
62
|
+
]
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
//#endregion
|
|
66
|
+
export { EmptyState };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactComponent } from "../types.js";
|
|
2
|
+
import { Badge, Notice, ProgressBar } from "@monimesl/dot-core";
|
|
3
|
+
//#region src/components/feedback.d.ts
|
|
4
|
+
declare const ProgressBar$1: ReactComponent<typeof ProgressBar>;
|
|
5
|
+
declare const Notice$1: ReactComponent<typeof Notice>;
|
|
6
|
+
declare const Badge$1: ReactComponent<typeof Badge>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { Badge$1 as Badge, Notice$1 as Notice, ProgressBar$1 as ProgressBar };
|