motile-ui 1.0.1 → 1.0.3

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 (44) hide show
  1. package/dist/components/Accordion/Accordion.css +1 -0
  2. package/dist/components/Accordion/Accordion.js +121 -0
  3. package/dist/components/Badge/Badge.css +1 -0
  4. package/dist/components/Badge/Badge.js +24 -0
  5. package/dist/components/Button/Button.css +1 -0
  6. package/dist/components/Button/Button.js +73 -0
  7. package/dist/components/Checkbox/Checkbox.css +1 -0
  8. package/dist/components/Checkbox/Checkbox.js +69 -0
  9. package/dist/components/Dock/Dock.css +1 -0
  10. package/dist/components/Dock/Dock.js +151 -0
  11. package/dist/components/Drawer/Drawer.css +1 -0
  12. package/dist/components/Drawer/Drawer.js +275 -0
  13. package/dist/components/Input/Input.css +1 -0
  14. package/dist/components/Input/Input.js +122 -0
  15. package/dist/components/Modal/Modal.css +1 -0
  16. package/dist/components/Modal/Modal.js +231 -0
  17. package/dist/components/Popover/Popover.css +1 -0
  18. package/dist/components/Popover/Popover.js +197 -0
  19. package/dist/components/Sheet/Sheet.css +1 -0
  20. package/dist/components/Sheet/Sheet.js +283 -0
  21. package/dist/components/Skeleton/Skeleton.css +1 -0
  22. package/dist/components/Skeleton/Skeleton.js +30 -0
  23. package/dist/components/SpeedDial/SpeedDial.css +1 -0
  24. package/dist/components/SpeedDial/SpeedDial.js +149 -0
  25. package/dist/components/Switch/Switch.css +1 -0
  26. package/dist/components/Switch/Switch.js +31 -0
  27. package/dist/components/Textarea/Textarea.css +1 -0
  28. package/dist/components/Textarea/Textarea.js +111 -0
  29. package/dist/components/Toast/Toast.css +1 -0
  30. package/dist/components/Toast/Toast.js +178 -0
  31. package/dist/components/Toast/useToast.js +30 -0
  32. package/dist/components/Tooltip/Tooltip.css +1 -0
  33. package/dist/components/Tooltip/Tooltip.js +321 -0
  34. package/dist/hooks/useClickOutside.js +24 -0
  35. package/dist/hooks/useEscapeKey.js +18 -0
  36. package/dist/hooks/useHistoryClose.js +42 -0
  37. package/dist/hooks/useScrollLock.js +73 -0
  38. package/dist/index.js +42 -0
  39. package/dist/utils/FloatingArrow.js +55 -0
  40. package/dist/utils/Slot.js +44 -0
  41. package/package.json +88 -6
  42. package/dist/index.css +0 -1
  43. package/dist/motile-ui.es.js +0 -2494
  44. package/dist/motile-ui.umd.js +0 -2
@@ -0,0 +1 @@
1
+ .motile-accordion{overflow:hidden}.motile-accordion__header{width:100%;border:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;transition:background-color .2s ease;text-align:left;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;-webkit-user-select:none;user-select:none;padding:16px 20px;color:#111827;background-color:transparent;font-size:16px;font-weight:400;-webkit-text-size-adjust:100%}.motile-accordion__header:focus-visible{outline:2px solid #3b82f6;outline-offset:-2px}@media (hover: hover) and (pointer: fine){.motile-accordion__header:not(:disabled):hover{background-color:#f9fafb}}@media (hover: none) and (pointer: coarse){.motile-accordion__header:not(:disabled):active{background-color:#f3f4f6}}.motile-accordion__title{flex:1;min-width:0;text-align:left;font-size:16px;font-weight:400;color:#111827}.motile-accordion__chevron{flex-shrink:0;transition:transform .2s cubic-bezier(.4,0,.2,1);width:20px;height:20px;color:#9ca3af}.motile-accordion--expanded .motile-accordion__chevron,.motile-accordion[data-state=open] .motile-accordion__chevron{transform:rotate(180deg)}.motile-accordion__panel{overflow:hidden;height:0;transition:height .25s cubic-bezier(.4,0,.2,1)}.motile-accordion__content{line-height:1.6;opacity:0;transform:translateY(-8px);transition:opacity .25s cubic-bezier(.4,0,.2,1),transform .25s cubic-bezier(.4,0,.2,1);padding:14px 20px 20px;color:#374151;font-size:14px}.motile-accordion--expanded .motile-accordion__content,.motile-accordion[data-state=open] .motile-accordion__content{opacity:1;transform:translateY(0)}.motile-accordion--disabled,.motile-accordion[data-disabled]{cursor:not-allowed;opacity:.6}.motile-accordion--disabled .motile-accordion__header,.motile-accordion[data-disabled] .motile-accordion__header{cursor:not-allowed}.motile-accordion--outlined{border:1.5px solid #e5e7eb;border-radius:12px}.motile-accordion--outlined.motile-accordion--expanded .motile-accordion__header,.motile-accordion--outlined[data-state=open] .motile-accordion__header{border-bottom:1px solid #e5e7eb}@media (max-width: 768px){.motile-accordion__header{padding:16px 18px;font-size:16px;-webkit-text-size-adjust:100%}.motile-accordion__content{padding:14px 18px 18px;font-size:15px;-webkit-text-size-adjust:100%}.motile-accordion__title{font-size:16px}.motile-accordion__chevron{width:20px;height:20px}}@media (prefers-reduced-motion: reduce){.motile-accordion__panel,.motile-accordion__content,.motile-accordion__chevron{transition:none!important}}
@@ -0,0 +1,121 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import { forwardRef as m, useState as _, useId as j, useRef as I, useCallback as v, createContext as N, useEffect as P, useContext as k } from "react";
3
+ import { Slot as y } from "../../utils/Slot.js";
4
+ import './Accordion.css';/* empty css */
5
+ const u = "motile-accordion", w = N(null), C = () => {
6
+ const n = k(w);
7
+ if (!n)
8
+ throw new Error("AccordionHeader/Content must be used within <Accordion>");
9
+ return n;
10
+ }, $ = m(
11
+ ({
12
+ variant: n = "filled",
13
+ defaultExpanded: d = !1,
14
+ expanded: f,
15
+ onChange: o,
16
+ disabled: s = !1,
17
+ className: t,
18
+ children: h,
19
+ asChild: i = !1,
20
+ ...p
21
+ }, c) => {
22
+ const [g, e] = _(d), l = f !== void 0, a = l ? f : g, B = `accordion-panel-${j()}`, E = I(null), H = v(() => {
23
+ if (s) return;
24
+ const A = !a;
25
+ l || e(A), o == null || o(A);
26
+ }, [s, a, l, o]), x = {
27
+ ...p,
28
+ "data-state": a ? "open" : "closed",
29
+ "data-disabled": s ? "" : void 0,
30
+ "data-variant": n
31
+ }, O = [
32
+ u,
33
+ `${u}--${n}`,
34
+ a && `${u}--expanded`,
35
+ s && `${u}--disabled`,
36
+ t
37
+ ].filter(Boolean).join(" ");
38
+ return /* @__PURE__ */ r(
39
+ w.Provider,
40
+ {
41
+ value: { isOpen: a, toggle: H, disabled: s, variant: n, panelId: B, panelRef: E },
42
+ children: i ? /* @__PURE__ */ r(y, { ref: c, ...x, className: t, children: h }) : /* @__PURE__ */ r("div", { ...x, ref: c, className: O, children: h })
43
+ }
44
+ );
45
+ }
46
+ );
47
+ $.displayName = "Accordion";
48
+ const R = m(
49
+ ({ className: n, children: d, asChild: f = !1, ...o }, s) => {
50
+ const { isOpen: t, toggle: h, disabled: i, panelId: p } = C(), c = {
51
+ ...o,
52
+ onClick: (e) => {
53
+ var l;
54
+ (l = o.onClick) == null || l.call(o, e), h();
55
+ },
56
+ "aria-expanded": t,
57
+ "aria-controls": p,
58
+ "aria-disabled": i,
59
+ type: "button",
60
+ disabled: i,
61
+ "data-state": t ? "open" : "closed",
62
+ "data-disabled": i ? "" : void 0
63
+ };
64
+ if (f)
65
+ return /* @__PURE__ */ r(y, { ref: s, ...c, className: n, children: d });
66
+ const g = [`${u}__header`, n].filter(Boolean).join(" ");
67
+ return /* @__PURE__ */ r("button", { ...c, ref: s, className: g, children: d });
68
+ }
69
+ );
70
+ R.displayName = "Accordion.Header";
71
+ const b = m(
72
+ ({ className: n, children: d, asChild: f = !1, ...o }, s) => {
73
+ const { isOpen: t, panelId: h, panelRef: i } = C(), p = v(() => {
74
+ const e = i.current;
75
+ if (!e) return;
76
+ if (typeof window < "u" && window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
77
+ e.style.height = t ? "auto" : "0px";
78
+ return;
79
+ }
80
+ if (t) {
81
+ (e.style.height === "" || e.style.height === "auto") && (e.style.height = "0px"), e.getBoundingClientRect(), e.style.height = `${e.scrollHeight}px`;
82
+ const a = () => {
83
+ t && (e.style.height = "auto"), e.removeEventListener("transitionend", a);
84
+ };
85
+ e.addEventListener("transitionend", a);
86
+ } else
87
+ (e.style.height === "" || e.style.height === "auto") && (e.style.height = `${e.scrollHeight}px`), e.getBoundingClientRect(), e.style.height = "0px";
88
+ }, [t, i]);
89
+ P(() => {
90
+ const e = i.current;
91
+ if (e)
92
+ return e.style.willChange = "height", p(), () => {
93
+ e.style.willChange = "";
94
+ };
95
+ }, [p, i]);
96
+ const c = {
97
+ ...o,
98
+ "aria-hidden": !t,
99
+ "data-state": t ? "open" : "closed"
100
+ }, g = [`${u}__content`, n].filter(Boolean).join(" ");
101
+ return /* @__PURE__ */ r(
102
+ "div",
103
+ {
104
+ id: h,
105
+ ref: i,
106
+ className: `${u}__panel`,
107
+ "aria-hidden": !t,
108
+ "data-state": t ? "open" : "closed",
109
+ children: f ? /* @__PURE__ */ r(y, { ref: s, ...c, className: n, children: d }) : /* @__PURE__ */ r("div", { ...c, ref: s, className: g, children: d })
110
+ }
111
+ );
112
+ }
113
+ );
114
+ b.displayName = "Accordion.Content";
115
+ const D = Object.assign($, {
116
+ Header: R,
117
+ Content: b
118
+ });
119
+ export {
120
+ D as Accordion
121
+ };
@@ -0,0 +1 @@
1
+ .motile-badge{display:inline-flex;align-items:center;justify-content:center;font-weight:500;line-height:1.2;border-radius:9999px;white-space:nowrap;vertical-align:middle;background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff}.motile-badge--large{padding:6px 16px;font-size:1rem;min-height:32px}.motile-badge--medium{padding:5px 12px;font-size:.875rem;min-height:26px}.motile-badge--small{padding:4px 8px;font-size:.75rem;min-height:24px}.motile-badge--primary{background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff}.motile-badge--secondary{background:color-mix(in srgb,var(--motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6))) 10%,transparent);color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );border:1px solid var(--motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)))}.motile-badge--secondary.motile-badge--large{padding:5px 15px;min-height:30px}.motile-badge--secondary.motile-badge--medium{padding:4px 11px;min-height:24px}.motile-badge--secondary.motile-badge--small{padding:3px 7px;min-height:22px}.motile-badge--outlined{background-color:#fff;color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );border:1px solid var(--motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)))}.motile-badge--outlined.motile-badge--large{padding:5px 15px;min-height:30px}.motile-badge--outlined.motile-badge--medium{padding:4px 11px;min-height:24px}.motile-badge--outlined.motile-badge--small{padding:3px 7px;min-height:22px}.motile-badge--dot{background-color:transparent;padding:0;gap:6px;color:inherit}.motile-badge__dot{display:inline-block;border-radius:50%;background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) )}.motile-badge__text{line-height:1.2}.motile-badge--dot.motile-badge--large .motile-badge__dot{width:12px;height:12px}.motile-badge--dot.motile-badge--medium .motile-badge__dot{width:10px;height:10px}.motile-badge--dot.motile-badge--small .motile-badge__dot{width:8px;height:8px}.motile-badge--shimmer{background-color:var( --motile-badge-color, var(--motile-ui-badge, var(--motile-theme, #3b82f6)) );color:#fff;position:relative;overflow:hidden}.motile-badge--shimmer:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.3) 50%,transparent 100%);animation:shimmer 2s infinite}@keyframes shimmer{0%{transform:translate(0)}to{transform:translate(200%)}}@media (prefers-reduced-motion: reduce){.motile-badge--shimmer:before{animation:none}}@media (max-width: 768px){.motile-badge:active{filter:brightness(.92)}}@supports (-webkit-touch-callout: none){.motile-badge{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}}
@@ -0,0 +1,24 @@
1
+ import { jsxs as p, jsx as a } from "react/jsx-runtime";
2
+ import $ from "react";
3
+ import './Badge.css';/* empty css */
4
+ const f = $.forwardRef(
5
+ ({ variant: e, size: d = "medium", color: t, className: r, children: o, style: i, ...m }, l) => {
6
+ const s = "motile-badge", c = [
7
+ s,
8
+ `${s}--${d}`,
9
+ e && `${s}--${e}`,
10
+ r
11
+ ].filter(Boolean).join(" "), n = {
12
+ ...i,
13
+ ...t && { "--motile-badge-color": t }
14
+ };
15
+ return e === "dot" ? /* @__PURE__ */ p("span", { ref: l, className: c, style: n, ...m, children: [
16
+ /* @__PURE__ */ a("span", { className: `${s}__dot` }),
17
+ /* @__PURE__ */ a("span", { className: `${s}__text`, children: o })
18
+ ] }) : /* @__PURE__ */ a("span", { ref: l, className: c, style: n, ...m, children: o });
19
+ }
20
+ );
21
+ f.displayName = "Badge";
22
+ export {
23
+ f as Badge
24
+ };
@@ -0,0 +1 @@
1
+ .motile-btn{width:fit-content;border:none;border-radius:12px;font-weight:600;cursor:pointer;transition:all .2s cubic-bezier(.4,0,.2,1);outline:none;display:inline-flex;align-items:center;justify-content:center;position:relative;overflow:hidden;min-height:fit-content}.motile-btn:active:not(.motile-btn--disabled){filter:brightness(.95);box-shadow:0 2px 4px #0000001a}.motile-btn--primary{background:var( --motile-btn-color, var(--motile-ui-btn, var(--motile-theme, #3b82f6)) );color:#fff;box-shadow:0 1px 2px #0000000d}@media (hover: hover){.motile-btn--primary:hover:not(.motile-btn--disabled){filter:brightness(.9);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}}.motile-btn--hover-on-touch.motile-btn--primary:hover:not(.motile-btn--disabled){filter:brightness(.9);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.motile-btn--secondary{background:#fff;color:var( --motile-btn-color, var(--motile-ui-btn, var(--motile-theme, #3b82f6)) );border:1px solid var(--motile-btn-color, var(--motile-ui-btn, var(--motile-theme, #3b82f6)));box-shadow:none}@media (hover: hover){.motile-btn--secondary:hover:not(.motile-btn--disabled){background:color-mix(in srgb,var( --motile-btn-color, var(--motile-ui-btn, var(--motile-theme, #3b82f6)) ) 10%,transparent);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}}.motile-btn--hover-on-touch.motile-btn--secondary:hover:not(.motile-btn--disabled){background:color-mix(in srgb,var(--motile-btn-color, var(--motile-ui-btn, var(--motile-theme, #3b82f6))) 10%,transparent);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.motile-btn--ghost{background:transparent;border:none;color:var( --motile-btn-color, var(--motile-ui-btn, var(--motile-theme, #3b82f6)) );box-shadow:none}@media (hover: hover){.motile-btn--ghost:hover:not(.motile-btn--disabled){box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}}.motile-btn--hover-on-touch.motile-btn--ghost:hover:not(.motile-btn--disabled){box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f}.motile-btn--large{padding:0 24px;font-size:16px;height:56px;min-height:56px;line-height:1.4}.motile-btn--medium{padding:0 20px;font-size:15px;height:48px;min-height:48px;min-width:80px;line-height:1.4}.motile-btn--small{padding:0 16px;font-size:14px;height:40px;min-height:40px;min-width:64px;line-height:1.4}.motile-btn--primary.motile-btn--disabled{opacity:.5;filter:saturate(.9);cursor:not-allowed;transform:none;box-shadow:none;pointer-events:none}.motile-btn--secondary.motile-btn--disabled{background:#e5e7eb;color:#6b7280;border:none;cursor:not-allowed;transform:none;box-shadow:none;pointer-events:none}.motile-btn--ghost.motile-btn--disabled{background:#e5e7eb;color:#6b7280;cursor:not-allowed;transform:none;box-shadow:none;pointer-events:none}.motile-btn--full-width{width:100%}.motile-btn svg{flex-shrink:0;margin-right:8px}.motile-btn svg:last-child{margin-right:0;margin-left:8px}.motile-btn svg:only-child{margin:0}@media (max-width: 1024px){.motile-btn--large{padding:0 20px;font-size:15px;height:52px;min-height:52px}}@media (max-width: 768px){.motile-btn--large{padding:0 18px;font-size:14px;height:48px;min-height:48px}.motile-btn:active:not(.motile-btn--disabled){filter:brightness(.92)}}@supports (-webkit-touch-callout: none){.motile-btn{-webkit-tap-highlight-color:transparent;-webkit-user-select:none;user-select:none}}.motile-btn__wrapper{display:grid;grid-template-areas:"content";place-items:center;width:100%;height:100%}.motile-btn__content{grid-area:content;display:inline-flex;align-items:center;justify-content:center}.motile-btn__loading{grid-area:content;display:flex;align-items:center;justify-content:center}.motile-btn__dots{display:flex;gap:8px;align-items:center;height:1em}.motile-btn--large .motile-btn__dot{width:8px;height:8px}.motile-btn--medium .motile-btn__dot{width:6px;height:6px}.motile-btn--small .motile-btn__dot{width:5px;height:5px}.motile-btn__dot{border-radius:50%;background-color:#ffffffb3;animation:motile-btn-loading-bounce 1.4s ease-in-out infinite both}.motile-btn__dot:nth-child(1){animation-delay:-.32s}.motile-btn__dot:nth-child(2){animation-delay:-.16s}.motile-btn__dot:nth-child(3){animation-delay:0s}.motile-btn--primary .motile-btn__dot{background-color:#ffffffb3}.motile-btn--secondary .motile-btn__dot,.motile-btn--ghost .motile-btn__dot{background-color:#9ca3afb3}@keyframes motile-btn-loading-bounce{0%,80%,to{transform:scale(1);opacity:.4}40%{transform:scale(1.2);opacity:1}}
@@ -0,0 +1,73 @@
1
+ import { jsx as t, jsxs as $ } from "react/jsx-runtime";
2
+ import b from "react";
3
+ import { Slot as h } from "../../utils/Slot.js";
4
+ import './Button.css';/* empty css */
5
+ const j = b.forwardRef(
6
+ ({
7
+ variant: _ = "primary",
8
+ size: l = "large",
9
+ fullWidth: i,
10
+ color: e,
11
+ hoverOnTouch: u = !1,
12
+ isLoading: s = !1,
13
+ asChild: d = !1,
14
+ children: o,
15
+ className: f,
16
+ disabled: n,
17
+ style: N,
18
+ ...r
19
+ }, c) => {
20
+ const a = "motile-btn", y = i ?? l === "large", m = [
21
+ a,
22
+ `${a}--${_}`,
23
+ `${a}--${l}`,
24
+ y && `${a}--full-width`,
25
+ (n || s) && `${a}--disabled`,
26
+ s && `${a}--loading`,
27
+ u && `${a}--hover-on-touch`,
28
+ f
29
+ ].filter(Boolean).join(" "), p = {
30
+ ...N,
31
+ ...e && { "--motile-btn-color": e }
32
+ };
33
+ return d ? /* @__PURE__ */ t(h, { ref: c, className: m, style: p, ...r, children: o }) : /* @__PURE__ */ t(
34
+ "button",
35
+ {
36
+ ref: c,
37
+ type: "button",
38
+ className: m,
39
+ disabled: n || s,
40
+ "aria-busy": s || void 0,
41
+ style: p,
42
+ ...r,
43
+ children: /* @__PURE__ */ $("span", { className: `${a}__wrapper`, children: [
44
+ /* @__PURE__ */ t(
45
+ "span",
46
+ {
47
+ className: `${a}__content`,
48
+ style: { opacity: s ? 0 : 1 },
49
+ children: o
50
+ }
51
+ ),
52
+ s && /* @__PURE__ */ t(
53
+ "span",
54
+ {
55
+ className: `${a}__loading`,
56
+ role: "status",
57
+ "aria-label": "Loading",
58
+ children: /* @__PURE__ */ $("span", { className: `${a}__dots`, children: [
59
+ /* @__PURE__ */ t("span", { className: `${a}__dot` }),
60
+ /* @__PURE__ */ t("span", { className: `${a}__dot` }),
61
+ /* @__PURE__ */ t("span", { className: `${a}__dot` })
62
+ ] })
63
+ }
64
+ )
65
+ ] })
66
+ }
67
+ );
68
+ }
69
+ );
70
+ j.displayName = "Button";
71
+ export {
72
+ j as Button
73
+ };
@@ -0,0 +1 @@
1
+ .motile-checkbox-container{display:inline-flex;flex-direction:column;gap:4px}.motile-checkbox-wrapper{display:flex;align-items:center;gap:8px;cursor:pointer;position:relative;-webkit-user-select:none;user-select:none}.motile-checkbox-container--disabled .motile-checkbox-wrapper{cursor:not-allowed;opacity:.6}.motile-checkbox{position:absolute;opacity:0;width:0;height:0;margin:0;pointer-events:none}.motile-checkbox:focus{outline:none}.motile-checkbox__mark{position:relative;width:20px;height:20px;min-width:20px;min-height:20px;border:2px solid #d1d5db;border-radius:4px;background-color:#fff;transition:all .2s cubic-bezier(.4,0,.2,1);display:flex;align-items:center;justify-content:center;flex-shrink:0;box-sizing:border-box}.motile-checkbox--rounded+.motile-checkbox__mark{border-radius:50%}.motile-checkbox--square+.motile-checkbox__mark{border-radius:0}.motile-checkbox--large+.motile-checkbox__mark{width:24px;height:24px;min-width:24px;min-height:24px}.motile-checkbox--large+.motile-checkbox__mark .motile-checkbox__check-icon{width:14px;height:14px}.motile-checkbox--medium+.motile-checkbox__mark{width:20px;height:20px;min-width:20px;min-height:20px}.motile-checkbox--medium+.motile-checkbox__mark .motile-checkbox__check-icon{width:12px;height:12px}.motile-checkbox--small+.motile-checkbox__mark{width:16px;height:16px;min-width:16px;min-height:16px}.motile-checkbox--small+.motile-checkbox__mark .motile-checkbox__check-icon{width:10px;height:10px}.motile-checkbox__check-icon{width:12px;height:12px;color:#fff;flex-shrink:0;opacity:0;transform:scale(.8);transition:all .2s cubic-bezier(.4,0,.2,1)}.motile-checkbox__check-icon path{stroke-dasharray:16;stroke-dashoffset:16;transition:stroke-dashoffset .3s cubic-bezier(.65,0,.35,1) .05s}.motile-checkbox--filled+.motile-checkbox__mark{background-color:#e5e7eb;border-color:#e5e7eb}.motile-checkbox--filled+.motile-checkbox__mark .motile-checkbox__check-icon{opacity:1;transform:scale(1)}.motile-checkbox--filled+.motile-checkbox__mark .motile-checkbox__check-icon path{stroke-dashoffset:0}.motile-checkbox:checked+.motile-checkbox__mark{background-color:var( --motile-checkbox-color, var(--motile-ui-checkbox, var(--motile-theme, #3b82f6)) );border-color:var( --motile-checkbox-color, var(--motile-ui-checkbox, var(--motile-theme, #3b82f6)) );animation:checkboxBounce .4s cubic-bezier(.68,-.55,.265,1.55)}.motile-checkbox:checked+.motile-checkbox__mark .motile-checkbox__check-icon{opacity:1;transform:scale(1)}.motile-checkbox:checked+.motile-checkbox__mark .motile-checkbox__check-icon path{stroke-dashoffset:0}.motile-checkbox--filled:checked+.motile-checkbox__mark{background-color:var( --motile-checkbox-color, var(--motile-ui-checkbox, var(--motile-theme, #3b82f6)) );border-color:var( --motile-checkbox-color, var(--motile-ui-checkbox, var(--motile-theme, #3b82f6)) )}@keyframes checkboxBounce{0%{transform:scale(1)}50%{transform:scale(1.15)}to{transform:scale(1)}}.motile-checkbox-container:not(.motile-checkbox-container--filled) .motile-checkbox-wrapper:hover .motile-checkbox__mark{border-color:var( --motile-checkbox-color, var(--motile-ui-checkbox, var(--motile-theme, #3b82f6)) )}.motile-checkbox-container:not(.motile-checkbox-container--filled) .motile-checkbox:checked+.motile-checkbox__mark:hover{background-color:color-mix(in srgb,var( --motile-checkbox-color, var(--motile-ui-checkbox, var(--motile-theme, #3b82f6)) ) 90%,black);border-color:color-mix(in srgb,var( --motile-checkbox-color, var(--motile-ui-checkbox, var(--motile-theme, #3b82f6)) ) 90%,black)}.motile-checkbox:disabled+.motile-checkbox__mark{background-color:#f3f4f6;border-color:#d1d5db;cursor:not-allowed}.motile-checkbox:disabled:checked+.motile-checkbox__mark{background-color:#d1d5db;border-color:#d1d5db}.motile-checkbox__label{font-size:14px;color:#374151;cursor:pointer;margin:0;padding:0}.motile-checkbox-container--large .motile-checkbox__label{font-size:16px}.motile-checkbox-container--medium .motile-checkbox__label{font-size:14px}.motile-checkbox-container--small .motile-checkbox__label{font-size:12px}.motile-checkbox__label--disabled{color:#9ca3af;cursor:not-allowed}
@@ -0,0 +1,69 @@
1
+ import { jsx as o, jsxs as k } from "react/jsx-runtime";
2
+ import { forwardRef as b } from "react";
3
+ import './Checkbox.css';/* empty css */
4
+ const f = b(
5
+ ({
6
+ variant: s = "standard",
7
+ size: a = "medium",
8
+ label: c,
9
+ color: l,
10
+ filled: r = !1,
11
+ className: t,
12
+ disabled: n,
13
+ style: i,
14
+ ...d
15
+ }, m) => {
16
+ const e = "motile-checkbox", $ = [
17
+ `${e}-container`,
18
+ `${e}-container--${s}`,
19
+ `${e}-container--${a}`,
20
+ n && `${e}-container--disabled`,
21
+ r && `${e}-container--filled`
22
+ ].filter(Boolean).join(" "), h = [
23
+ e,
24
+ `${e}--${s}`,
25
+ `${e}--${a}`,
26
+ r && `${e}--filled`,
27
+ t
28
+ ].filter(Boolean).join(" "), p = [
29
+ `${e}__label`,
30
+ n && `${e}__label--disabled`
31
+ ].filter(Boolean).join(" ");
32
+ return /* @__PURE__ */ o("div", { className: $, style: l ? { "--motile-checkbox-color": l } : void 0, children: /* @__PURE__ */ k("label", { className: `${e}-wrapper`, children: [
33
+ /* @__PURE__ */ o(
34
+ "input",
35
+ {
36
+ ...d,
37
+ ref: m,
38
+ type: "checkbox",
39
+ className: h,
40
+ disabled: n,
41
+ style: i
42
+ }
43
+ ),
44
+ /* @__PURE__ */ o("span", { className: `${e}__mark`, children: /* @__PURE__ */ o(
45
+ "svg",
46
+ {
47
+ className: `${e}__check-icon`,
48
+ viewBox: "0 0 16 16",
49
+ fill: "none",
50
+ children: /* @__PURE__ */ o(
51
+ "path",
52
+ {
53
+ d: "M13.5 4L6 11.5L2.5 8",
54
+ stroke: "currentColor",
55
+ strokeWidth: "2",
56
+ strokeLinecap: "round",
57
+ strokeLinejoin: "round"
58
+ }
59
+ )
60
+ }
61
+ ) }),
62
+ c && /* @__PURE__ */ o("span", { className: p, children: c })
63
+ ] }) });
64
+ }
65
+ );
66
+ f.displayName = "Checkbox";
67
+ export {
68
+ f as Checkbox
69
+ };
@@ -0,0 +1 @@
1
+ .motile-dock{display:inline-flex;align-items:center;gap:12px;padding:8px 16px;background:#ffffff40;backdrop-filter:blur(20px) saturate(180%);-webkit-backdrop-filter:blur(20px) saturate(180%);border-radius:50px;border:1px solid rgba(255,255,255,.3);box-shadow:0 8px 32px #0000001a,0 2px 8px #0000000d,inset 0 0 0 1px #fff3;position:relative;-webkit-user-select:none;user-select:none;transition:all .3s cubic-bezier(.4,0,.2,1)}.motile-dock[data-position=top],.motile-dock[data-position=bottom]{flex-direction:row}.motile-dock[data-position=left],.motile-dock[data-position=right]{flex-direction:column}.motile-dock__item{position:relative;display:flex;align-items:center;justify-content:center;width:40px;height:40px;min-width:40px;min-height:40px;border:none;border-radius:10px;background:transparent;color:#374151;cursor:pointer;transition:background .2s ease;outline:none;will-change:transform;transform:translateZ(0)}.motile-dock[data-position=top] .motile-dock__item{transform-origin:center top}.motile-dock[data-position=bottom] .motile-dock__item{transform-origin:center bottom}.motile-dock[data-position=left] .motile-dock__item{transform-origin:left center}.motile-dock[data-position=right] .motile-dock__item{transform-origin:right center}.motile-dock__item:hover{background:#fff6}.motile-dock__item:active{background:#fff9;filter:brightness(.9)}.motile-dock__item:focus-visible{outline:2px solid rgba(100,116,139,.6);outline-offset:2px}.motile-dock__item>*{pointer-events:none}.motile-dock__separator{position:relative;flex-shrink:0}.motile-dock__separator[data-position=top],.motile-dock__separator[data-position=bottom]{width:1px;height:40px;margin:0 6px;background:linear-gradient(to bottom,#0000,#00000026 20%,#00000026 80%,#0000)}.motile-dock__separator[data-position=left],.motile-dock__separator[data-position=right]{height:1px;width:40px;margin:6px 0;background:linear-gradient(to right,#0000,#00000026 20%,#00000026 80%,#0000)}@media (prefers-color-scheme: dark){.motile-dock{background:#1e1e1eb3;border:1px solid rgba(255,255,255,.1);box-shadow:0 8px 32px #0006,0 2px 8px #0003,inset 0 0 0 1px #ffffff0d}.motile-dock__item{color:#e5e7eb}.motile-dock__item:hover{background:#ffffff1a}.motile-dock__item:active{background:#fff3;filter:brightness(.9)}.motile-dock__separator[data-position=top],.motile-dock__separator[data-position=bottom]{background:linear-gradient(to bottom,#fff0,#ffffff26 20%,#ffffff26 80%,#fff0)}.motile-dock__separator[data-position=left],.motile-dock__separator[data-position=right]{background:linear-gradient(to right,#fff0,#ffffff26 20%,#ffffff26 80%,#fff0)}}@media (prefers-contrast: high){.motile-dock{border:2px solid currentColor;background:#fffffff2}.motile-dock__item{border:1px solid currentColor}}@media (prefers-reduced-motion: reduce){.motile-dock,.motile-dock__item{transition:none}}@media (max-width: 768px){.motile-dock{gap:6px;padding:6px 12px;border-radius:40px}.motile-dock__item{width:36px;height:36px;min-width:36px;min-height:36px}}@media (hover: none) and (pointer: coarse){.motile-dock__item{min-width:44px;min-height:44px;transform:scale(1)!important}}.motile-dock:before{content:"";position:absolute;top:0;right:0;bottom:0;left:0;border-radius:50px;padding:1px;background:linear-gradient(135deg,#fff6,#ffffff1a);-webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);-webkit-mask-composite:xor;mask-composite:exclude;pointer-events:none}@media (prefers-color-scheme: dark){.motile-dock:before{background:linear-gradient(135deg,#fff3,#ffffff0d)}}.motile-dock__item:before{content:"";position:absolute;top:-2px;right:-2px;bottom:-2px;left:-2px;border-radius:14px;background:radial-gradient(circle at center,color-mix(in srgb,var( --motile-dock-color, var(--motile-ui-dock, var(--motile-theme, #3b82f6)) ) 30%,transparent),transparent 70%);opacity:0;transition:opacity .3s ease;pointer-events:none;z-index:-1}.motile-dock__item:hover:before{opacity:1}@media (prefers-contrast: high){.motile-dock__item:before{display:none}.motile-dock:before{display:none}}
@@ -0,0 +1,151 @@
1
+ import { jsx as s, jsxs as X } from "react/jsx-runtime";
2
+ import g, { forwardRef as N, useRef as b, useEffect as L, useState as Y, createContext as P, useContext as q } from "react";
3
+ import { Tooltip as f } from "../Tooltip/Tooltip.js";
4
+ import './Dock.css';/* empty css */
5
+ const $ = P(null), A = () => {
6
+ const o = q($);
7
+ if (!o)
8
+ throw new Error("Dock compound components must be used within Dock.Root");
9
+ return o;
10
+ }, E = N(
11
+ ({
12
+ position: o = "bottom",
13
+ zIndex: e = 1e3,
14
+ color: a,
15
+ className: p,
16
+ children: R,
17
+ style: d,
18
+ ...v
19
+ }, u) => {
20
+ const [t, h] = Y(null), [l, m] = Y(null), r = b(null), x = 1.7, n = (c) => {
21
+ h(c.clientX), m(c.clientY);
22
+ }, k = () => {
23
+ h(null), m(null);
24
+ }, y = g.useMemo(
25
+ () => ({
26
+ magnification: x,
27
+ mouseX: t,
28
+ mouseY: l,
29
+ position: o,
30
+ color: a
31
+ }),
32
+ [x, t, l, o, a]
33
+ );
34
+ return /* @__PURE__ */ s($.Provider, { value: y, children: /* @__PURE__ */ s(
35
+ "div",
36
+ {
37
+ ref: (c) => {
38
+ typeof u == "function" ? u(c) : u && (u.current = c), r.current = c;
39
+ },
40
+ className: `motile-dock ${p || ""}`,
41
+ "data-position": o,
42
+ style: { ...d, zIndex: e },
43
+ onMouseMove: n,
44
+ onMouseLeave: k,
45
+ ...v,
46
+ children: R
47
+ }
48
+ ) });
49
+ }
50
+ );
51
+ E.displayName = "Dock.Root";
52
+ const I = N(
53
+ ({ icon: o, label: e, asChild: a, color: p, className: R, children: d, style: v, ...u }, t) => {
54
+ const {
55
+ magnification: h,
56
+ mouseX: l,
57
+ mouseY: m,
58
+ position: r,
59
+ color: x
60
+ } = A(), n = b(null), k = b(), y = p || x;
61
+ L(() => {
62
+ if (!n.current || window.matchMedia(
63
+ "(hover: none) and (pointer: coarse)"
64
+ ).matches) return;
65
+ const D = () => {
66
+ if (n.current)
67
+ if (l !== null && m !== null) {
68
+ const M = n.current.getBoundingClientRect();
69
+ let w;
70
+ if (r === "top" || r === "bottom") {
71
+ const C = M.left + M.width / 2;
72
+ w = Math.abs(l - C);
73
+ } else {
74
+ const C = M.top + M.height / 2;
75
+ w = Math.abs(m - C);
76
+ }
77
+ const T = Math.max(0, 1 - w / 100), j = T * T, F = 1 + (h - 1) * j;
78
+ n.current.style.transform = `scale(${F})`;
79
+ } else
80
+ n.current.style.transform = "scale(1)";
81
+ };
82
+ return k.current = requestAnimationFrame(D), () => {
83
+ k.current && cancelAnimationFrame(k.current);
84
+ };
85
+ }, [l, m, h, r]);
86
+ const c = r === "top" ? "bottom" : r === "bottom" ? "top" : r === "left" ? "right" : "left", S = {
87
+ ...v,
88
+ ...y && { "--motile-dock-color": y }
89
+ };
90
+ if (a && g.isValidElement(d)) {
91
+ const i = g.cloneElement(d, {
92
+ ref: (D) => {
93
+ typeof t == "function" ? t(D) : t && (t.current = D), n.current = D;
94
+ },
95
+ className: `motile-dock__item ${R || ""}`,
96
+ style: S,
97
+ "aria-label": e
98
+ });
99
+ return e ? /* @__PURE__ */ X(f.Root, { position: c, showArrow: !0, children: [
100
+ /* @__PURE__ */ s(f.Trigger, { children: i }),
101
+ /* @__PURE__ */ s(f.Content, { children: e })
102
+ ] }) : i;
103
+ }
104
+ const _ = /* @__PURE__ */ s(
105
+ "button",
106
+ {
107
+ ref: (i) => {
108
+ typeof t == "function" ? t(i) : t && (t.current = i), n.current = i;
109
+ },
110
+ type: "button",
111
+ className: `motile-dock__item ${R || ""}`,
112
+ style: S,
113
+ "aria-label": e,
114
+ ...u,
115
+ children: o || d
116
+ }
117
+ );
118
+ return e ? /* @__PURE__ */ X(f.Root, { position: c, showArrow: !0, children: [
119
+ /* @__PURE__ */ s(f.Trigger, { children: _ }),
120
+ /* @__PURE__ */ s(f.Content, { children: e })
121
+ ] }) : _;
122
+ }
123
+ );
124
+ I.displayName = "Dock.Item";
125
+ const V = N(
126
+ ({ className: o, ...e }, a) => {
127
+ const { position: p } = A();
128
+ return /* @__PURE__ */ s(
129
+ "div",
130
+ {
131
+ ref: a,
132
+ className: `motile-dock__separator ${o || ""}`,
133
+ "data-position": p,
134
+ "aria-hidden": "true",
135
+ ...e
136
+ }
137
+ );
138
+ }
139
+ );
140
+ V.displayName = "Dock.Separator";
141
+ const K = {
142
+ Root: E,
143
+ Item: I,
144
+ Separator: V
145
+ };
146
+ export {
147
+ K as Dock,
148
+ I as DockItem,
149
+ E as DockRoot,
150
+ V as DockSeparator
151
+ };
@@ -0,0 +1 @@
1
+ .motile-drawer__overlay{position:fixed;top:0;right:0;bottom:0;left:0;background-color:#0000;transition:background-color .3s ease;overscroll-behavior:contain;touch-action:pan-y}.motile-drawer__overlay--visible{background-color:#0006}.motile-drawer__content{position:fixed;bottom:0;left:0;right:0;margin:0 auto;transform:translateY(100%);width:100%;max-width:var(--drawer-max-width, var(--drawer-width, 480px));height:auto;max-height:var(--drawer-max-height, 70dvh);background-color:#fff;border-radius:20px 20px 0 0;box-shadow:0 -8px 30px #00000026;display:flex;flex-direction:column;transition:transform .3s ease;will-change:transform;overscroll-behavior:contain;box-sizing:border-box}.motile-drawer__content--visible{transform:translateY(0)}@media (max-width: 768px){.motile-drawer__overlay{top:0;left:0;right:0;bottom:0;width:100%;height:100%}.motile-drawer__content{left:0;right:0;margin:0;width:100%;max-width:none;border-radius:20px 20px 0 0}}.motile-drawer__header{height:48px;display:flex;align-items:center;justify-content:center;flex-shrink:0;cursor:grab;user-select:none;-webkit-user-select:none}.motile-drawer__header:active{cursor:grabbing}.motile-drawer__handle{width:40px;height:6px;background-color:#d1d5db;border-radius:3px;transition:background-color .2s ease}.motile-drawer__header:hover .motile-drawer__handle{background-color:#9ca3af}.motile-drawer__header:active .motile-drawer__handle{background-color:#6b7280}.motile-drawer__title-wrapper{padding:0 24px 16px;flex-shrink:0;border-bottom:1px solid #e5e7eb;width:100%;box-sizing:border-box}.motile-drawer__title{margin:0;font-size:16px;font-weight:600;color:#111827;line-height:1.4}@media (max-width: 768px){.motile-drawer__title{font-size:15px}}.motile-drawer__body{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;padding:20px 24px;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;width:100%;box-sizing:border-box}.motile-drawer__body::-webkit-scrollbar{width:6px}.motile-drawer__body::-webkit-scrollbar-track{background:transparent}.motile-drawer__body::-webkit-scrollbar-thumb{background-color:#0003;border-radius:3px}.motile-drawer__body::-webkit-scrollbar-thumb:hover{background-color:#0000004d}@media (prefers-color-scheme: dark){.motile-drawer__content{background-color:#1f2937;box-shadow:0 -8px 30px #00000080}.motile-drawer__title{color:#f9fafb}.motile-drawer__title-wrapper{border-bottom-color:#374151}.motile-drawer__handle{background-color:#4b5563}.motile-drawer__header:hover .motile-drawer__handle{background-color:#6b7280}.motile-drawer__header:active .motile-drawer__handle{background-color:#9ca3af}.motile-drawer__body::-webkit-scrollbar-thumb{background-color:#fff3}.motile-drawer__body::-webkit-scrollbar-thumb:hover{background-color:#ffffff4d}}@media (prefers-reduced-motion: reduce){.motile-drawer__content,.motile-drawer__overlay{transition:none}}@media (hover: none) and (pointer: coarse){.motile-drawer__header{height:56px}.motile-drawer__handle{width:48px;height:7px}}