@monimesl/dot-renderer-react 0.1.0-alpha.4 → 0.1.0-alpha.40

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.
Files changed (267) hide show
  1. package/README.md +43 -1
  2. package/dist/LICENSE-PHOSPHOR +21 -0
  3. package/dist/_virtual/_rolldown/runtime.js +14 -0
  4. package/dist/_virtual/builtin_esm-external-require-react.js +9 -0
  5. package/dist/color.js +94 -0
  6. package/dist/components/amount-input.d.ts +6 -0
  7. package/dist/components/amount-input.js +111 -0
  8. package/dist/components/avatar.d.ts +6 -0
  9. package/dist/components/avatar.js +68 -0
  10. package/dist/components/box.js +56 -0
  11. package/dist/components/button.d.ts +6 -0
  12. package/dist/components/button.js +42 -0
  13. package/dist/components/carousel.d.ts +6 -0
  14. package/dist/components/carousel.js +258 -0
  15. package/dist/components/chip.d.ts +6 -0
  16. package/dist/components/chip.js +41 -0
  17. package/dist/components/code-input.d.ts +6 -0
  18. package/dist/components/code-input.js +96 -0
  19. package/dist/components/detail-row.d.ts +6 -0
  20. package/dist/components/detail-row.js +40 -0
  21. package/dist/components/disclosure.d.ts +6 -0
  22. package/dist/components/disclosure.js +76 -0
  23. package/dist/components/divider.d.ts +6 -0
  24. package/dist/components/divider.js +18 -0
  25. package/dist/components/empty-state.d.ts +6 -0
  26. package/dist/components/empty-state.js +64 -0
  27. package/dist/components/feedback.d.ts +8 -0
  28. package/dist/components/feedback.js +101 -0
  29. package/dist/components/field-box.js +44 -0
  30. package/dist/components/field.js +43 -0
  31. package/dist/components/footer.d.ts +6 -0
  32. package/dist/components/footer.js +25 -0
  33. package/dist/components/grid.d.ts +7 -0
  34. package/dist/components/grid.js +97 -0
  35. package/dist/components/https.js +11 -0
  36. package/dist/components/icon-artwork.js +143 -0
  37. package/dist/components/icon-button.js +28 -0
  38. package/dist/components/icon-svg.js +27 -0
  39. package/dist/components/icon.d.ts +6 -0
  40. package/dist/components/icon.js +25 -0
  41. package/dist/components/image.d.ts +6 -0
  42. package/dist/components/image.js +40 -0
  43. package/dist/components/index.d.ts +38 -0
  44. package/dist/components/index.js +92 -0
  45. package/dist/components/input.d.ts +6 -0
  46. package/dist/components/input.js +108 -0
  47. package/dist/components/link.d.ts +6 -0
  48. package/dist/components/link.js +32 -0
  49. package/dist/components/list.d.ts +7 -0
  50. package/dist/components/list.js +143 -0
  51. package/dist/components/numbers.js +9 -0
  52. package/dist/components/option-place.js +9 -0
  53. package/dist/components/option.d.ts +6 -0
  54. package/dist/components/option.js +44 -0
  55. package/dist/components/padding.d.ts +2 -0
  56. package/dist/components/padding.js +38 -0
  57. package/dist/components/pressable.js +17 -0
  58. package/dist/components/prose-context.js +5 -0
  59. package/dist/components/prose.d.ts +9 -0
  60. package/dist/components/prose.js +67 -0
  61. package/dist/components/qr-code.d.ts +6 -0
  62. package/dist/components/qr-code.js +58 -0
  63. package/dist/components/rich-text.d.ts +6 -0
  64. package/dist/components/rich-text.js +73 -0
  65. package/dist/components/scroll.d.ts +6 -0
  66. package/dist/components/scroll.js +57 -0
  67. package/dist/components/select.d.ts +6 -0
  68. package/dist/components/select.js +93 -0
  69. package/dist/components/sheet.d.ts +8 -0
  70. package/dist/components/sheet.js +106 -0
  71. package/dist/components/skeleton.d.ts +6 -0
  72. package/dist/components/skeleton.js +55 -0
  73. package/dist/components/slider.d.ts +6 -0
  74. package/dist/components/slider.js +57 -0
  75. package/dist/components/spinner.d.ts +6 -0
  76. package/dist/components/spinner.js +48 -0
  77. package/dist/components/stack.d.ts +6 -0
  78. package/dist/components/stack.js +25 -0
  79. package/dist/components/stepper.d.ts +6 -0
  80. package/dist/components/stepper.js +92 -0
  81. package/dist/components/steps.d.ts +7 -0
  82. package/dist/components/steps.js +110 -0
  83. package/dist/components/tabs.d.ts +7 -0
  84. package/dist/components/tabs.js +95 -0
  85. package/dist/components/text-area.d.ts +6 -0
  86. package/dist/components/text-area.js +42 -0
  87. package/dist/components/text.d.ts +6 -0
  88. package/dist/components/text.js +107 -0
  89. package/dist/components/toast.d.ts +6 -0
  90. package/dist/components/toast.js +56 -0
  91. package/dist/components/toggles.d.ts +9 -0
  92. package/dist/components/toggles.js +148 -0
  93. package/dist/components/tokens.js +49 -0
  94. package/dist/components/tones.js +30 -0
  95. package/dist/components/typed-text.js +28 -0
  96. package/dist/components/view.d.ts +6 -0
  97. package/dist/components/view.js +61 -0
  98. package/dist/index.d.ts +43 -48
  99. package/dist/index.js +40 -2086
  100. package/dist/markdown.js +255 -0
  101. package/dist/page-root.d.ts +2 -0
  102. package/dist/page-root.js +20 -0
  103. package/dist/portal.js +8 -0
  104. package/dist/pull-to-refresh.js +120 -0
  105. package/dist/react-host/19.3.0/react-dom.js +3 -0
  106. package/dist/react-host/19.3.0/react-host.js +6 -6
  107. package/dist/renderer.d.ts +17 -0
  108. package/dist/renderer.js +33 -0
  109. package/dist/root.d.ts +10 -0
  110. package/dist/root.js +71 -0
  111. package/dist/styles.css +1 -0
  112. package/dist/theme.d.ts +26 -0
  113. package/dist/theme.js +129 -0
  114. package/dist/types.d.ts +7 -0
  115. package/dist/vendor/@base-ui/react/checkbox/indicator/CheckboxIndicator.js +51 -0
  116. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRoot.js +265 -0
  117. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRootContext.js +13 -0
  118. package/dist/vendor/@base-ui/react/checkbox/root/CheckboxRootDataAttributes.js +11 -0
  119. package/dist/vendor/@base-ui/react/checkbox/utils/getCheckboxStateAttributesMapping.js +15 -0
  120. package/dist/vendor/@base-ui/react/checkbox-group/CheckboxGroupContext.js +10 -0
  121. package/dist/vendor/@base-ui/react/dialog/backdrop/DialogBackdrop.js +40 -0
  122. package/dist/vendor/@base-ui/react/dialog/close/DialogClose.js +39 -0
  123. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopup.js +92 -0
  124. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopupCssVars.js +8 -0
  125. package/dist/vendor/@base-ui/react/dialog/popup/DialogPopupDataAttributes.js +7 -0
  126. package/dist/vendor/@base-ui/react/dialog/portal/DialogPortal.js +38 -0
  127. package/dist/vendor/@base-ui/react/dialog/portal/DialogPortalContext.js +13 -0
  128. package/dist/vendor/@base-ui/react/dialog/root/DialogRoot.js +16 -0
  129. package/dist/vendor/@base-ui/react/dialog/root/DialogRootContext.js +13 -0
  130. package/dist/vendor/@base-ui/react/dialog/root/useDialogRoot.js +77 -0
  131. package/dist/vendor/@base-ui/react/dialog/root/useRenderDialogRoot.js +65 -0
  132. package/dist/vendor/@base-ui/react/dialog/store/DialogStore.js +70 -0
  133. package/dist/vendor/@base-ui/react/dialog/title/DialogTitle.js +25 -0
  134. package/dist/vendor/@base-ui/react/dialog/utils/stateAttributesMapping.js +17 -0
  135. package/dist/vendor/@base-ui/react/field/control/FieldControlDataAttributes.js +11 -0
  136. package/dist/vendor/@base-ui/react/field/item/FieldItemContext.js +10 -0
  137. package/dist/vendor/@base-ui/react/field/root/useFieldValidation.js +18 -0
  138. package/dist/vendor/@base-ui/react/fieldset/root/FieldsetRootContext.js +13 -0
  139. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingFocusManager.js +477 -0
  140. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingPortal.js +165 -0
  141. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingRootStore.js +65 -0
  142. package/dist/vendor/@base-ui/react/floating-ui-react/components/FloatingTree.js +22 -0
  143. package/dist/vendor/@base-ui/react/floating-ui-react/hooks/useDismiss.js +373 -0
  144. package/dist/vendor/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.js +58 -0
  145. package/dist/vendor/@base-ui/react/floating-ui-react/utils/composite.js +40 -0
  146. package/dist/vendor/@base-ui/react/floating-ui-react/utils/constants.js +5 -0
  147. package/dist/vendor/@base-ui/react/floating-ui-react/utils/createAttribute.js +6 -0
  148. package/dist/vendor/@base-ui/react/floating-ui-react/utils/createEventEmitter.js +18 -0
  149. package/dist/vendor/@base-ui/react/floating-ui-react/utils/element.js +26 -0
  150. package/dist/vendor/@base-ui/react/floating-ui-react/utils/enqueueFocus.js +25 -0
  151. package/dist/vendor/@base-ui/react/floating-ui-react/utils/event.js +25 -0
  152. package/dist/vendor/@base-ui/react/floating-ui-react/utils/markOthers.js +116 -0
  153. package/dist/vendor/@base-ui/react/floating-ui-react/utils/nodes.js +16 -0
  154. package/dist/vendor/@base-ui/react/floating-ui-react/utils/tabbable.js +135 -0
  155. package/dist/vendor/@base-ui/react/internals/TransitionStatusDataAttributes.js +11 -0
  156. package/dist/vendor/@base-ui/react/internals/composite/composite.js +89 -0
  157. package/dist/vendor/@base-ui/react/internals/composite/constants.js +4 -0
  158. package/dist/vendor/@base-ui/react/internals/composite/item/CompositeItem.js +21 -0
  159. package/dist/vendor/@base-ui/react/internals/composite/item/useCompositeItem.js +31 -0
  160. package/dist/vendor/@base-ui/react/internals/composite/list/CompositeList.js +180 -0
  161. package/dist/vendor/@base-ui/react/internals/composite/list/CompositeListContext.js +15 -0
  162. package/dist/vendor/@base-ui/react/internals/composite/list/useCompositeListItem.js +54 -0
  163. package/dist/vendor/@base-ui/react/internals/composite/root/CompositeRoot.js +62 -0
  164. package/dist/vendor/@base-ui/react/internals/composite/root/CompositeRootContext.js +13 -0
  165. package/dist/vendor/@base-ui/react/internals/composite/root/useCompositeRoot.js +170 -0
  166. package/dist/vendor/@base-ui/react/internals/constants.js +18 -0
  167. package/dist/vendor/@base-ui/react/internals/createBaseUIEventDetails.js +40 -0
  168. package/dist/vendor/@base-ui/react/internals/direction-context/DirectionContext.js +10 -0
  169. package/dist/vendor/@base-ui/react/internals/field-constants/constants.js +33 -0
  170. package/dist/vendor/@base-ui/react/internals/field-register-control/useRegisterFieldControl.js +40 -0
  171. package/dist/vendor/@base-ui/react/internals/field-root-context/FieldRootContext.js +45 -0
  172. package/dist/vendor/@base-ui/react/internals/form-context/FormContext.js +18 -0
  173. package/dist/vendor/@base-ui/react/internals/getStateAttributesProps.js +17 -0
  174. package/dist/vendor/@base-ui/react/internals/labelable-provider/LabelableContext.js +24 -0
  175. package/dist/vendor/@base-ui/react/internals/labelable-provider/useAriaLabelledBy.js +35 -0
  176. package/dist/vendor/@base-ui/react/internals/labelable-provider/useLabelableId.js +57 -0
  177. package/dist/vendor/@base-ui/react/internals/reason-parts.js +14 -0
  178. package/dist/vendor/@base-ui/react/internals/serializeValue.js +12 -0
  179. package/dist/vendor/@base-ui/react/internals/stateAttributesMapping.js +11 -0
  180. package/dist/vendor/@base-ui/react/internals/use-button/useButton.js +137 -0
  181. package/dist/vendor/@base-ui/react/internals/useAnimationsFinished.js +94 -0
  182. package/dist/vendor/@base-ui/react/internals/useBaseUiId.js +13 -0
  183. package/dist/vendor/@base-ui/react/internals/useOpenChangeComplete.js +28 -0
  184. package/dist/vendor/@base-ui/react/internals/useRenderElement.js +109 -0
  185. package/dist/vendor/@base-ui/react/internals/useTransitionStatus.js +70 -0
  186. package/dist/vendor/@base-ui/react/internals/useValueChanged.js +15 -0
  187. package/dist/vendor/@base-ui/react/merge-props/mergeProps.js +153 -0
  188. package/dist/vendor/@base-ui/react/radio/indicator/RadioIndicator.js +46 -0
  189. package/dist/vendor/@base-ui/react/radio/root/RadioRoot.js +179 -0
  190. package/dist/vendor/@base-ui/react/radio/root/RadioRootContext.js +13 -0
  191. package/dist/vendor/@base-ui/react/radio/root/RadioRootDataAttributes.js +11 -0
  192. package/dist/vendor/@base-ui/react/radio/utils/stateAttributesMapping.js +14 -0
  193. package/dist/vendor/@base-ui/react/radio-group/RadioGroup.js +170 -0
  194. package/dist/vendor/@base-ui/react/radio-group/RadioGroupContext.js +10 -0
  195. package/dist/vendor/@base-ui/react/switch/root/SwitchRoot.js +170 -0
  196. package/dist/vendor/@base-ui/react/switch/root/SwitchRootContext.js +13 -0
  197. package/dist/vendor/@base-ui/react/switch/root/SwitchRootDataAttributes.js +11 -0
  198. package/dist/vendor/@base-ui/react/switch/stateAttributesMapping.js +12 -0
  199. package/dist/vendor/@base-ui/react/switch/thumb/SwitchThumb.js +25 -0
  200. package/dist/vendor/@base-ui/react/tabs/list/TabsList.js +98 -0
  201. package/dist/vendor/@base-ui/react/tabs/list/TabsListContext.js +13 -0
  202. package/dist/vendor/@base-ui/react/tabs/root/TabsRoot.js +213 -0
  203. package/dist/vendor/@base-ui/react/tabs/root/TabsRootContext.js +16 -0
  204. package/dist/vendor/@base-ui/react/tabs/root/TabsRootDataAttributes.js +8 -0
  205. package/dist/vendor/@base-ui/react/tabs/root/stateAttributesMapping.js +5 -0
  206. package/dist/vendor/@base-ui/react/tabs/tab/TabsTab.js +137 -0
  207. package/dist/vendor/@base-ui/react/utils/CommonPopupDataAttributes.js +24 -0
  208. package/dist/vendor/@base-ui/react/utils/CommonTriggerDataAttributes.js +11 -0
  209. package/dist/vendor/@base-ui/react/utils/FocusGuard.js +32 -0
  210. package/dist/vendor/@base-ui/react/utils/InternalBackdrop.js +30 -0
  211. package/dist/vendor/@base-ui/react/utils/dispatchClickWithModifiers.js +25 -0
  212. package/dist/vendor/@base-ui/react/utils/popupStateMapping.js +22 -0
  213. package/dist/vendor/@base-ui/react/utils/popups/popupStoreUtils.js +247 -0
  214. package/dist/vendor/@base-ui/react/utils/popups/popupTriggerMap.js +96 -0
  215. package/dist/vendor/@base-ui/react/utils/popups/store.js +94 -0
  216. package/dist/vendor/@base-ui/react/utils/resolveClassName.js +13 -0
  217. package/dist/vendor/@base-ui/react/utils/resolveRef.js +11 -0
  218. package/dist/vendor/@base-ui/react/utils/resolveStyle.js +13 -0
  219. package/dist/vendor/@base-ui/react/utils/useFocusableWhenDisabled.js +30 -0
  220. package/dist/vendor/@base-ui/utils/addEventListener.js +12 -0
  221. package/dist/vendor/@base-ui/utils/createLogOnce.js +20 -0
  222. package/dist/vendor/@base-ui/utils/empty.js +6 -0
  223. package/dist/vendor/@base-ui/utils/error.js +5 -0
  224. package/dist/vendor/@base-ui/utils/fastHooks.js +68 -0
  225. package/dist/vendor/@base-ui/utils/formatErrorMessage.js +27 -0
  226. package/dist/vendor/@base-ui/utils/getDefaultFormSubmitter.js +25 -0
  227. package/dist/vendor/@base-ui/utils/getReactElementRef.js +14 -0
  228. package/dist/vendor/@base-ui/utils/inertValue.js +8 -0
  229. package/dist/vendor/@base-ui/utils/isElementDisabled.js +6 -0
  230. package/dist/vendor/@base-ui/utils/mergeCleanups.js +14 -0
  231. package/dist/vendor/@base-ui/utils/mergeObjects.js +11 -0
  232. package/dist/vendor/@base-ui/utils/owner.js +7 -0
  233. package/dist/vendor/@base-ui/utils/platform/engine.js +8 -0
  234. package/dist/vendor/@base-ui/utils/platform/env.js +6 -0
  235. package/dist/vendor/@base-ui/utils/platform/os.js +15 -0
  236. package/dist/vendor/@base-ui/utils/platform/screen-reader.js +9 -0
  237. package/dist/vendor/@base-ui/utils/platform/shared.js +36 -0
  238. package/dist/vendor/@base-ui/utils/reactVersion.js +8 -0
  239. package/dist/vendor/@base-ui/utils/safeReact.js +13 -0
  240. package/dist/vendor/@base-ui/utils/shadowDom.js +26 -0
  241. package/dist/vendor/@base-ui/utils/store/ReactStore.js +181 -0
  242. package/dist/vendor/@base-ui/utils/store/Store.js +102 -0
  243. package/dist/vendor/@base-ui/utils/store/useStore.js +97 -0
  244. package/dist/vendor/@base-ui/utils/useAnimationFrame.js +87 -0
  245. package/dist/vendor/@base-ui/utils/useControlled.js +52 -0
  246. package/dist/vendor/@base-ui/utils/useId.js +32 -0
  247. package/dist/vendor/@base-ui/utils/useIsoLayoutEffect.js +7 -0
  248. package/dist/vendor/@base-ui/utils/useMergedRefs.js +87 -0
  249. package/dist/vendor/@base-ui/utils/useOnMount.js +12 -0
  250. package/dist/vendor/@base-ui/utils/useRefWithInit.js +18 -0
  251. package/dist/vendor/@base-ui/utils/useScrollLock.js +206 -0
  252. package/dist/vendor/@base-ui/utils/useStableCallback.js +38 -0
  253. package/dist/vendor/@base-ui/utils/useTimeout.js +43 -0
  254. package/dist/vendor/@base-ui/utils/useValueAsRef.js +27 -0
  255. package/dist/vendor/@base-ui/utils/visuallyHidden.js +23 -0
  256. package/dist/vendor/@base-ui/utils/warn.js +5 -0
  257. package/dist/vendor/@floating-ui/utils/dist/floating-ui.utils.dom.js +49 -0
  258. package/dist/vendor/uqr/dist/index.js +858 -0
  259. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +74 -0
  260. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +77 -0
  261. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +69 -0
  262. package/dist/vendor/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +64 -0
  263. package/dist/vendor/use-sync-external-store/shim/index.js +11 -0
  264. package/dist/vendor/use-sync-external-store/shim/with-selector.js +11 -0
  265. package/package.json +14 -9
  266. package/dist/index.d.ts.map +0 -1
  267. package/dist/index.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ import { ReactComponent } from "../types.js";
2
+ import { Stack } from "@monimesl/dot-core";
3
+ //#region src/components/stack.d.ts
4
+ declare const Stack$1: ReactComponent<typeof Stack>;
5
+ //#endregion
6
+ export { Stack$1 as Stack };
@@ -0,0 +1,25 @@
1
+ import { useTheme } from "../theme.js";
2
+ import { boxStyle } from "./box.js";
3
+ import { Children } from "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/stack.tsx
6
+ const Stack = (props) => {
7
+ const theme = useTheme();
8
+ return /* @__PURE__ */ jsx("div", {
9
+ className: "dot-stack",
10
+ style: {
11
+ display: "grid",
12
+ ...boxStyle(props, theme)
13
+ },
14
+ children: Children.map(props.children, (child) => /* @__PURE__ */ jsx("div", {
15
+ style: {
16
+ gridArea: "1 / 1",
17
+ display: "grid",
18
+ minWidth: 0
19
+ },
20
+ children: child
21
+ }))
22
+ });
23
+ };
24
+ //#endregion
25
+ export { Stack };
@@ -0,0 +1,6 @@
1
+ import { ReactComponent } from "../types.js";
2
+ import { Stepper } from "@monimesl/dot-core";
3
+ //#region src/components/stepper.d.ts
4
+ declare const Stepper$1: ReactComponent<typeof Stepper>;
5
+ //#endregion
6
+ export { Stepper$1 as Stepper };
@@ -0,0 +1,92 @@
1
+ import { useTheme } from "../theme.js";
2
+ import { CENTERED, DISABLED_OPACITY, FONT_SIZE, ICON_SIZE, WEIGHTS } from "./tokens.js";
3
+ import { Field } from "./field.js";
4
+ import { useFieldNote } from "./field-box.js";
5
+ import { useTypedText } from "./typed-text.js";
6
+ import { IconGraphic } from "./icon.js";
7
+ import { createEvent } from "@monimesl/dot-core";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/components/stepper.tsx
10
+ const Stepper$1 = ({ value, min, max, step = 1, label, hint, disabled, onChange }) => {
11
+ const { colors } = useTheme();
12
+ const [shownText, showText] = useTypedText(value === void 0 ? void 0 : String(value), onChange !== void 0);
13
+ const { noteId, controlAttributes } = useFieldNote(hint, void 0);
14
+ const current = shownText === "" ? min ?? 0 : Number(shownText);
15
+ const moveTo = (next) => {
16
+ showText(String(next));
17
+ onChange?.(createEvent("change", { value: next }));
18
+ };
19
+ const atMin = min !== void 0 && current - step < min;
20
+ const atMax = max !== void 0 && current + step > max;
21
+ return /* @__PURE__ */ jsx(Field, {
22
+ label,
23
+ hint,
24
+ error: void 0,
25
+ noteId,
26
+ children: /* @__PURE__ */ jsxs("span", {
27
+ className: "dot-stepper",
28
+ role: "group",
29
+ "aria-label": label,
30
+ ...controlAttributes,
31
+ style: {
32
+ display: "flex",
33
+ alignItems: "center",
34
+ gap: 12,
35
+ width: "fit-content"
36
+ },
37
+ children: [
38
+ /* @__PURE__ */ jsx(StepButton, {
39
+ icon: "minus",
40
+ label: "Less",
41
+ disabled: disabled || atMin,
42
+ onPress: () => moveTo(current - step)
43
+ }),
44
+ /* @__PURE__ */ jsx("span", {
45
+ "aria-live": "polite",
46
+ style: {
47
+ minWidth: 32,
48
+ textAlign: "center",
49
+ fontSize: FONT_SIZE.subtitle,
50
+ fontWeight: WEIGHTS.bold,
51
+ fontVariantNumeric: "tabular-nums",
52
+ color: colors.text
53
+ },
54
+ children: current
55
+ }),
56
+ /* @__PURE__ */ jsx(StepButton, {
57
+ icon: "plus",
58
+ label: "More",
59
+ disabled: disabled || atMax,
60
+ onPress: () => moveTo(current + step)
61
+ })
62
+ ]
63
+ })
64
+ });
65
+ };
66
+ function StepButton({ icon, label, disabled, onPress }) {
67
+ const { colors, radius } = useTheme();
68
+ return /* @__PURE__ */ jsx("button", {
69
+ type: "button",
70
+ "aria-label": label,
71
+ disabled,
72
+ onClick: onPress,
73
+ style: {
74
+ ...CENTERED,
75
+ width: 40,
76
+ height: 40,
77
+ border: "none",
78
+ borderRadius: radius,
79
+ background: colors.muted,
80
+ color: colors.text,
81
+ opacity: disabled ? DISABLED_OPACITY : 1,
82
+ cursor: disabled ? "default" : "pointer"
83
+ },
84
+ children: /* @__PURE__ */ jsx(IconGraphic, {
85
+ name: icon,
86
+ size: ICON_SIZE.medium,
87
+ color: "currentColor"
88
+ })
89
+ });
90
+ }
91
+ //#endregion
92
+ export { Stepper$1 as Stepper };
@@ -0,0 +1,7 @@
1
+ import { ReactComponent } from "../types.js";
2
+ import { Step, Steps } from "@monimesl/dot-core";
3
+ //#region src/components/steps.d.ts
4
+ declare const Steps$1: ReactComponent<typeof Steps>;
5
+ declare const Step$1: ReactComponent<typeof Step>;
6
+ //#endregion
7
+ export { Step$1 as Step, Steps$1 as Steps };
@@ -0,0 +1,110 @@
1
+ import { useTheme } from "../theme.js";
2
+ import { CENTERED, FONT_SIZE, WEIGHTS } from "./tokens.js";
3
+ import { paddingStyle } from "./padding.js";
4
+ import { IconGraphic } from "./icon.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/components/steps.tsx
7
+ const MARK_SIZE = 24;
8
+ const Steps = ({ children, ...padding }) => /* @__PURE__ */ jsx("ol", {
9
+ className: "dot-steps",
10
+ style: {
11
+ display: "flex",
12
+ flexDirection: "column",
13
+ margin: 0,
14
+ ...paddingStyle(padding)
15
+ },
16
+ children
17
+ });
18
+ function stepMark(colors, status) {
19
+ switch (status) {
20
+ case "done": return {
21
+ background: colors.success,
22
+ border: colors.success,
23
+ icon: "check"
24
+ };
25
+ case "failed": return {
26
+ background: colors.danger,
27
+ border: colors.danger,
28
+ icon: "close"
29
+ };
30
+ case "current": return {
31
+ background: colors.primary,
32
+ border: colors.primary,
33
+ icon: void 0
34
+ };
35
+ case "upcoming": return {
36
+ background: "transparent",
37
+ border: colors.subtle,
38
+ icon: void 0
39
+ };
40
+ }
41
+ }
42
+ const Step = ({ title, text, status = "upcoming" }) => {
43
+ const { colors } = useTheme();
44
+ const { background, border, icon } = stepMark(colors, status);
45
+ return /* @__PURE__ */ jsxs("li", {
46
+ className: "dot-step",
47
+ "aria-current": status === "current" ? "step" : void 0,
48
+ style: {
49
+ display: "flex",
50
+ gap: 12,
51
+ listStyle: "none"
52
+ },
53
+ children: [/* @__PURE__ */ jsxs("span", {
54
+ style: {
55
+ display: "flex",
56
+ flexDirection: "column",
57
+ alignItems: "center"
58
+ },
59
+ children: [/* @__PURE__ */ jsx("span", {
60
+ style: {
61
+ ...CENTERED,
62
+ flexShrink: 0,
63
+ width: MARK_SIZE,
64
+ height: MARK_SIZE,
65
+ boxSizing: "border-box",
66
+ borderRadius: "50%",
67
+ border: `2px solid ${border}`,
68
+ background
69
+ },
70
+ children: icon ? /* @__PURE__ */ jsx(IconGraphic, {
71
+ name: icon,
72
+ size: 14,
73
+ color: "#ffffff"
74
+ }) : null
75
+ }), /* @__PURE__ */ jsx("span", {
76
+ className: "dot-step-line",
77
+ style: {
78
+ flex: 1,
79
+ width: 2,
80
+ minHeight: 12,
81
+ background: colors.border
82
+ }
83
+ })]
84
+ }), /* @__PURE__ */ jsxs("span", {
85
+ style: {
86
+ display: "flex",
87
+ flexDirection: "column",
88
+ gap: 2,
89
+ paddingBottom: 16
90
+ },
91
+ children: [/* @__PURE__ */ jsx("span", {
92
+ style: {
93
+ fontSize: FONT_SIZE.body,
94
+ fontWeight: status === "current" ? WEIGHTS.bold : WEIGHTS.medium,
95
+ color: status === "upcoming" ? colors.subtle : colors.text,
96
+ lineHeight: `${MARK_SIZE}px`
97
+ },
98
+ children: title
99
+ }), text ? /* @__PURE__ */ jsx("span", {
100
+ style: {
101
+ fontSize: FONT_SIZE.caption,
102
+ color: colors.subtle
103
+ },
104
+ children: text
105
+ }) : null]
106
+ })]
107
+ });
108
+ };
109
+ //#endregion
110
+ export { Step, Steps };
@@ -0,0 +1,7 @@
1
+ import { ReactComponent } from "../types.js";
2
+ import { Tab, Tabs } from "@monimesl/dot-core";
3
+ //#region src/components/tabs.d.ts
4
+ declare const Tabs$1: ReactComponent<typeof Tabs>;
5
+ declare const Tab$1: ReactComponent<typeof Tab>;
6
+ //#endregion
7
+ export { Tab$1 as Tab, Tabs$1 as Tabs };
@@ -0,0 +1,95 @@
1
+ import { useTheme } from "../theme.js";
2
+ import { CENTERED, FONT_SIZE, PILL_STYLE, WEIGHTS } from "./tokens.js";
3
+ import { paddingStyle } from "./padding.js";
4
+ import { TabsRoot } from "../vendor/@base-ui/react/tabs/root/TabsRoot.js";
5
+ import { TabsTab } from "../vendor/@base-ui/react/tabs/tab/TabsTab.js";
6
+ import { TabsList } from "../vendor/@base-ui/react/tabs/list/TabsList.js";
7
+ import { createEvent } from "@monimesl/dot-core";
8
+ import { createContext, useContext } from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/components/tabs.tsx
11
+ const TabsContext = createContext({
12
+ value: void 0,
13
+ segmented: false
14
+ });
15
+ const Tabs$1 = ({ value, variant = "underline", onChange, children, ...padding }) => {
16
+ const { colors, radius } = useTheme();
17
+ const segmented = variant === "segmented";
18
+ let variantStyle;
19
+ if (segmented) variantStyle = {
20
+ gap: 2,
21
+ padding: 3,
22
+ borderRadius: radius,
23
+ background: colors.muted
24
+ };
25
+ else variantStyle = { borderBottom: `1px solid ${colors.border}` };
26
+ return /* @__PURE__ */ jsx(TabsRoot, {
27
+ value: value ?? null,
28
+ onValueChange: (next) => {
29
+ if (next !== null && next !== value) onChange?.(createEvent("change", { value: next }));
30
+ },
31
+ style: paddingStyle(padding),
32
+ children: /* @__PURE__ */ jsx(TabsList, {
33
+ className: "dot-tabs",
34
+ style: {
35
+ display: "flex",
36
+ overflowX: "auto",
37
+ ...variantStyle
38
+ },
39
+ children: /* @__PURE__ */ jsx(TabsContext.Provider, {
40
+ value: {
41
+ value,
42
+ segmented
43
+ },
44
+ children
45
+ })
46
+ })
47
+ });
48
+ };
49
+ const Tab$1 = ({ value, label, badge }) => {
50
+ const { colors, radius } = useTheme();
51
+ const { value: chosen, segmented } = useContext(TabsContext);
52
+ if (value === void 0) return null;
53
+ const selected = value === chosen;
54
+ let color = colors.subtle;
55
+ if (selected) color = segmented ? colors.text : colors.primary;
56
+ let variantStyle;
57
+ if (segmented) variantStyle = {
58
+ borderRadius: Math.max(radius - 2, 0),
59
+ background: selected ? colors.surface : "transparent",
60
+ boxShadow: selected ? "0 1px 3px rgba(0, 0, 0, 0.15)" : "none"
61
+ };
62
+ else variantStyle = {
63
+ marginBottom: -1,
64
+ background: "transparent",
65
+ borderBottom: `2px solid ${selected ? colors.primary : "transparent"}`
66
+ };
67
+ return /* @__PURE__ */ jsxs(TabsTab, {
68
+ className: "dot-tab",
69
+ value,
70
+ style: {
71
+ ...CENTERED,
72
+ gap: 6,
73
+ flex: "1 0 auto",
74
+ minHeight: segmented ? 36 : 44,
75
+ padding: "0 12px",
76
+ border: "none",
77
+ fontSize: FONT_SIZE.body,
78
+ fontWeight: selected ? WEIGHTS.bold : WEIGHTS.medium,
79
+ whiteSpace: "nowrap",
80
+ color,
81
+ cursor: "pointer",
82
+ ...variantStyle
83
+ },
84
+ children: [label, badge ? /* @__PURE__ */ jsx("span", {
85
+ style: {
86
+ ...PILL_STYLE,
87
+ background: colors.primary,
88
+ color: colors.onPrimary
89
+ },
90
+ children: badge
91
+ }) : null]
92
+ });
93
+ };
94
+ //#endregion
95
+ export { Tab$1 as Tab, Tabs$1 as Tabs };
@@ -0,0 +1,6 @@
1
+ import { ReactComponent } from "../types.js";
2
+ import { TextArea } from "@monimesl/dot-core";
3
+ //#region src/components/text-area.d.ts
4
+ declare const TextArea$1: ReactComponent<typeof TextArea>;
5
+ //#endregion
6
+ export { TextArea$1 as TextArea };
@@ -0,0 +1,42 @@
1
+ import { Field } from "./field.js";
2
+ import { useFieldBox, useFieldNote } from "./field-box.js";
3
+ import { useTypedText } from "./typed-text.js";
4
+ import { createEvent } from "@monimesl/dot-core";
5
+ import { jsx } from "react/jsx-runtime";
6
+ //#region src/components/text-area.tsx
7
+ const TextArea$1 = ({ value, placeholder, label, hint, error, rows = 3, maxLength, disabled, onChange }) => {
8
+ const [text, typeText] = useTypedText(value, onChange !== void 0);
9
+ const box = useFieldBox(error, disabled);
10
+ const { noteId, controlAttributes } = useFieldNote(hint, error);
11
+ return /* @__PURE__ */ jsx(Field, {
12
+ label,
13
+ hint,
14
+ error,
15
+ noteId,
16
+ children: /* @__PURE__ */ jsx("textarea", {
17
+ className: "dot-text-area",
18
+ value: text,
19
+ placeholder,
20
+ rows,
21
+ maxLength,
22
+ disabled,
23
+ ...controlAttributes,
24
+ onFocus: box.onFocus,
25
+ onBlur: box.onBlur,
26
+ onChange: (event) => {
27
+ const next = event.currentTarget.value;
28
+ typeText(next);
29
+ onChange?.(createEvent("change", { value: next }));
30
+ },
31
+ style: {
32
+ ...box.style,
33
+ width: "100%",
34
+ padding: "12px 14px",
35
+ outline: "none",
36
+ resize: "none"
37
+ }
38
+ })
39
+ });
40
+ };
41
+ //#endregion
42
+ export { TextArea$1 as TextArea };
@@ -0,0 +1,6 @@
1
+ import { ReactComponent } from "../types.js";
2
+ import { Text } from "@monimesl/dot-core";
3
+ //#region src/components/text.d.ts
4
+ declare const Text$1: ReactComponent<typeof Text>;
5
+ //#endregion
6
+ export { Text$1 as Text };
@@ -0,0 +1,107 @@
1
+ import { useTheme } from "../theme.js";
2
+ import { FONT_SIZE, SELECTABLE, WEIGHTS } from "./tokens.js";
3
+ import { paddingStyle } from "./padding.js";
4
+ import { isTone, toneColor } from "./tones.js";
5
+ import { InsideProse } from "./prose-context.js";
6
+ import { customColor } from "./box.js";
7
+ import { createContext, useContext } from "react";
8
+ import { jsx } from "react/jsx-runtime";
9
+ //#region src/components/text.tsx
10
+ const InsideText = createContext(false);
11
+ const VARIANTS = {
12
+ display: {
13
+ weight: "bold",
14
+ lineHeight: 1.15,
15
+ heading: true
16
+ },
17
+ title: {
18
+ weight: "bold",
19
+ lineHeight: 1.25,
20
+ heading: true
21
+ },
22
+ subtitle: {
23
+ weight: "medium",
24
+ lineHeight: 1.35,
25
+ heading: true
26
+ },
27
+ lead: {
28
+ weight: "regular",
29
+ lineHeight: 1.5,
30
+ heading: false
31
+ },
32
+ body: {
33
+ weight: "regular",
34
+ lineHeight: 1.5,
35
+ heading: false
36
+ },
37
+ caption: {
38
+ weight: "regular",
39
+ lineHeight: 1.4,
40
+ heading: false
41
+ }
42
+ };
43
+ const LEADING_CHANGE = {
44
+ tight: -.1,
45
+ normal: 0,
46
+ relaxed: .2
47
+ };
48
+ const DECORATION = {
49
+ none: "none",
50
+ underline: "underline",
51
+ strikethrough: "line-through"
52
+ };
53
+ const Text = ({ variant = "body", tone, weight, align, maxLines, decoration, numeric, leading, italic, selectable, children, ...padding }) => {
54
+ const theme = useTheme();
55
+ const insideText = useContext(InsideText);
56
+ const inProse = useContext(InsideProse);
57
+ const { heading, lineHeight, weight: defaultWeight } = VARIANTS[variant];
58
+ const defaultLeading = inProse && !heading ? "relaxed" : "normal";
59
+ const style = {
60
+ display: insideText ? "inline" : "block",
61
+ marginInline: 0,
62
+ marginBlockEnd: 0,
63
+ marginBlockStart: inProse && heading ? void 0 : 0,
64
+ fontSize: FONT_SIZE[variant],
65
+ fontWeight: WEIGHTS[weight ?? defaultWeight],
66
+ fontStyle: italic ? "italic" : void 0,
67
+ letterSpacing: variant === "display" ? "-0.02em" : "normal",
68
+ color: tone ? textColor(tone, theme) : "inherit",
69
+ textAlign: align,
70
+ textDecorationLine: decoration ? DECORATION[decoration] : void 0,
71
+ fontVariantNumeric: numeric ? "tabular-nums" : void 0,
72
+ ...selectable ? SELECTABLE : void 0,
73
+ ...paddingStyle(padding)
74
+ };
75
+ if (!insideText) {
76
+ style.lineHeight = lineHeight + LEADING_CHANGE[leading ?? defaultLeading];
77
+ style.textWrap = heading ? "balance" : "pretty";
78
+ style.overflowWrap = "anywhere";
79
+ }
80
+ if (maxLines) {
81
+ style.display = "-webkit-box";
82
+ style.WebkitLineClamp = maxLines;
83
+ style.WebkitBoxOrient = "vertical";
84
+ style.overflow = "hidden";
85
+ }
86
+ const content = /* @__PURE__ */ jsx(InsideText.Provider, {
87
+ value: true,
88
+ children
89
+ });
90
+ if ((variant === "title" || variant === "subtitle") && !insideText) return /* @__PURE__ */ jsx(variant === "title" ? "h2" : "h3", {
91
+ className: "dot-text dot-heading",
92
+ style,
93
+ children: content
94
+ });
95
+ return /* @__PURE__ */ jsx("span", {
96
+ className: "dot-text",
97
+ style,
98
+ children: content
99
+ });
100
+ };
101
+ function textColor(tone, theme) {
102
+ if (isTone(tone)) return toneColor(theme.colors, tone);
103
+ if (tone === "onPrimary") return theme.colors.onPrimary;
104
+ return customColor(tone, theme);
105
+ }
106
+ //#endregion
107
+ export { Text };
@@ -0,0 +1,6 @@
1
+ import { ReactComponent } from "../types.js";
2
+ import { Toast } from "@monimesl/dot-core";
3
+ //#region src/components/toast.d.ts
4
+ declare const Toast$1: ReactComponent<typeof Toast>;
5
+ //#endregion
6
+ export { Toast$1 as Toast };
@@ -0,0 +1,56 @@
1
+ import { useTheme } from "../theme.js";
2
+ import { FONT_SIZE, ICON_SIZE, SPACE } from "./tokens.js";
3
+ import { IconSvg } from "./icon-svg.js";
4
+ import { STATUS_ARTWORK } from "./tones.js";
5
+ import { createEvent } from "@monimesl/dot-core";
6
+ import { useEffect, useEffectEvent, useState } from "react";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/components/toast.tsx
9
+ const Toast$1 = ({ message, tone = "default", duration = 2500, onHide }) => {
10
+ const { colors, radius } = useTheme();
11
+ const [hidden, setHidden] = useState(false);
12
+ const [previousMessage, setPreviousMessage] = useState(message);
13
+ if (message !== previousMessage) {
14
+ setPreviousMessage(message);
15
+ setHidden(false);
16
+ }
17
+ const hide = useEffectEvent(() => {
18
+ setHidden(true);
19
+ onHide?.(createEvent("hide"));
20
+ });
21
+ useEffect(() => {
22
+ if (!message) return;
23
+ const timer = setTimeout(hide, duration);
24
+ return () => clearTimeout(timer);
25
+ }, [message, duration]);
26
+ if (!message || hidden) return null;
27
+ return /* @__PURE__ */ jsxs("div", {
28
+ className: "dot-toast",
29
+ role: "status",
30
+ style: {
31
+ position: "fixed",
32
+ top: SPACE.large,
33
+ left: "50%",
34
+ transform: "translateX(-50%)",
35
+ zIndex: 110,
36
+ display: "flex",
37
+ alignItems: "center",
38
+ gap: SPACE.medium,
39
+ maxWidth: "calc(100% - 32px)",
40
+ width: "max-content",
41
+ padding: "10px 16px",
42
+ borderRadius: radius,
43
+ background: colors.primary,
44
+ color: colors.onPrimary,
45
+ fontSize: FONT_SIZE.body,
46
+ boxShadow: "0 4px 16px rgba(0, 0, 0, 0.2)"
47
+ },
48
+ children: [tone === "default" ? null : /* @__PURE__ */ jsx(IconSvg, {
49
+ artwork: STATUS_ARTWORK[tone],
50
+ size: ICON_SIZE.medium,
51
+ color: colors.onPrimary
52
+ }), /* @__PURE__ */ jsx("span", { children: message })]
53
+ });
54
+ };
55
+ //#endregion
56
+ export { Toast$1 as Toast };
@@ -0,0 +1,9 @@
1
+ import { ReactComponent } from "../types.js";
2
+ import { Checkbox, Radio, RadioGroup, Switch } from "@monimesl/dot-core";
3
+ //#region src/components/toggles.d.ts
4
+ declare const Switch$1: ReactComponent<typeof Switch>;
5
+ declare const Checkbox$1: ReactComponent<typeof Checkbox>;
6
+ declare const RadioGroup$1: ReactComponent<typeof RadioGroup>;
7
+ declare const Radio$1: ReactComponent<typeof Radio>;
8
+ //#endregion
9
+ export { Checkbox$1 as Checkbox, Radio$1 as Radio, RadioGroup$1 as RadioGroup, Switch$1 as Switch };