react-material-design 0.0.0-stage → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +12 -2
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/components/Button/context.cjs +1 -0
- package/dist/components/Button/context.d.ts +29 -0
- package/dist/components/Button/context.js +41 -0
- package/dist/components/Button/default/index.cjs +1 -0
- package/dist/components/Button/default/index.d.ts +26 -0
- package/dist/components/Button/default/index.js +22 -0
- package/dist/components/Button/default/render.cjs +1 -0
- package/dist/components/Button/default/render.d.ts +3 -0
- package/dist/components/Button/default/render.js +203 -0
- package/dist/components/Button/default/style.css +1 -0
- package/dist/components/Button/group/index.cjs +1 -0
- package/dist/components/Button/group/index.d.ts +2 -0
- package/dist/components/Button/group/index.js +1 -0
- package/dist/components/Button/group/render.cjs +1 -0
- package/dist/components/Button/group/render.d.ts +49 -0
- package/dist/components/Button/group/render.js +100 -0
- package/dist/components/Button/group/style.css +1 -0
- package/dist/components/Button/icon/index.cjs +1 -0
- package/dist/components/Button/icon/index.d.ts +22 -0
- package/dist/components/Button/icon/index.js +23 -0
- package/dist/components/Button/icon/render.cjs +1 -0
- package/dist/components/Button/icon/render.d.ts +4 -0
- package/dist/components/Button/icon/render.js +178 -0
- package/dist/components/Button/icon/style.css +1 -0
- package/dist/components/Button/index.cjs +1 -0
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.js +55 -0
- package/dist/components/Button/split/index.cjs +1 -0
- package/dist/components/Button/split/index.d.ts +6 -0
- package/dist/components/Button/split/index.js +33 -0
- package/dist/components/Button/split/style.css +1 -0
- package/dist/components/Button/types.d.ts +19 -0
- package/dist/components/Card/index.d.ts +1 -0
- package/dist/components/Chip/index.cjs +1 -0
- package/dist/components/Chip/index.d.ts +50 -0
- package/dist/components/Chip/index.js +156 -0
- package/dist/components/Chip/style.css +1 -0
- package/dist/components/ContextMenu/index.cjs +1 -0
- package/dist/components/ContextMenu/index.d.ts +2 -0
- package/dist/components/ContextMenu/index.js +19 -0
- package/dist/components/ContextMenu/render.cjs +1 -0
- package/dist/components/ContextMenu/render.d.ts +4 -0
- package/dist/components/ContextMenu/render.js +59 -0
- package/dist/components/Dialog/Dialog.cjs +1 -0
- package/dist/components/Dialog/Dialog.d.ts +23 -0
- package/dist/components/Dialog/Dialog.js +182 -0
- package/dist/components/Dialog/DialogActions.cjs +1 -0
- package/dist/components/Dialog/DialogActions.d.ts +3 -0
- package/dist/components/Dialog/DialogActions.js +17 -0
- package/dist/components/Dialog/index.cjs +1 -0
- package/dist/components/Dialog/index.d.ts +4 -0
- package/dist/components/Dialog/index.js +3 -0
- package/dist/components/Dialog/style.css +1 -0
- package/dist/components/Divider/index.cjs +1 -0
- package/dist/components/Divider/index.d.ts +6 -0
- package/dist/components/Divider/index.js +29 -0
- package/dist/components/Divider/style.css +1 -0
- package/dist/components/Font/index.d.ts +9 -0
- package/dist/components/Icon/Icon.cjs +1 -0
- package/dist/components/Icon/Icon.d.ts +18 -0
- package/dist/components/Icon/Icon.js +47 -0
- package/dist/components/Icon/index.cjs +1 -0
- package/dist/components/Icon/index.d.ts +2 -0
- package/dist/components/Icon/index.js +1 -0
- package/dist/components/Icon/style.css +1 -0
- package/dist/components/Menu/Menu.cjs +1 -0
- package/dist/components/Menu/Menu.d.ts +4 -0
- package/dist/components/Menu/Menu.js +10 -0
- package/dist/components/Menu/Menu.render.cjs +1 -0
- package/dist/components/Menu/Menu.render.d.ts +15 -0
- package/dist/components/Menu/Menu.render.js +55 -0
- package/dist/components/Menu/MenuContainer.cjs +1 -0
- package/dist/components/Menu/MenuContainer.d.ts +7 -0
- package/dist/components/Menu/MenuContainer.js +46 -0
- package/dist/components/Menu/MenuGroup.cjs +1 -0
- package/dist/components/Menu/MenuGroup.d.ts +11 -0
- package/dist/components/Menu/MenuGroup.js +34 -0
- package/dist/components/Menu/MenuGroup.render.cjs +1 -0
- package/dist/components/Menu/MenuGroup.render.d.ts +6 -0
- package/dist/components/Menu/MenuGroup.render.js +31 -0
- package/dist/components/Menu/MenuItem.cjs +1 -0
- package/dist/components/Menu/MenuItem.d.ts +19 -0
- package/dist/components/Menu/MenuItem.js +30 -0
- package/dist/components/Menu/MenuItem.render.cjs +1 -0
- package/dist/components/Menu/MenuItem.render.d.ts +7 -0
- package/dist/components/Menu/MenuItem.render.js +75 -0
- package/dist/components/Menu/index.cjs +1 -0
- package/dist/components/Menu/index.d.ts +3 -0
- package/dist/components/Menu/index.js +4 -0
- package/dist/components/Menu/style.css +1 -0
- package/dist/components/Menubar/MenuSection.d.ts +8 -0
- package/dist/components/Menubar/index.cjs +1 -0
- package/dist/components/Menubar/index.d.ts +2 -0
- package/dist/components/Menubar/index.js +19 -0
- package/dist/components/Menubar/render.cjs +1 -0
- package/dist/components/Menubar/render.d.ts +3 -0
- package/dist/components/Menubar/render.js +58 -0
- package/dist/components/Menubar/style.css +1 -0
- package/dist/components/NumberField/NumberField.cjs +1 -0
- package/dist/components/NumberField/NumberField.d.ts +2 -0
- package/dist/components/NumberField/NumberField.js +19 -0
- package/dist/components/NumberField/NumberField.render.cjs +1 -0
- package/dist/components/NumberField/NumberField.render.d.ts +10 -0
- package/dist/components/NumberField/NumberField.render.js +268 -0
- package/dist/components/NumberField/index.cjs +1 -0
- package/dist/components/NumberField/index.d.ts +2 -0
- package/dist/components/NumberField/index.js +1 -0
- package/dist/components/NumberField/style.css +1 -0
- package/dist/components/ProgressIndicator/index.d.ts +9 -0
- package/dist/components/Select/Option.cjs +1 -0
- package/dist/components/Select/Option.d.ts +10 -0
- package/dist/components/Select/Option.js +24 -0
- package/dist/components/Select/Select.cjs +1 -0
- package/dist/components/Select/Select.d.ts +32 -0
- package/dist/components/Select/Select.js +265 -0
- package/dist/components/Select/index.cjs +1 -0
- package/dist/components/Select/index.d.ts +4 -0
- package/dist/components/Select/index.js +3 -0
- package/dist/components/Select/style.css +1 -0
- package/dist/components/Slider/Slider.cjs +1 -0
- package/dist/components/Slider/Slider.d.ts +26 -0
- package/dist/components/Slider/Slider.js +342 -0
- package/dist/components/Slider/index.cjs +1 -0
- package/dist/components/Slider/index.d.ts +1 -0
- package/dist/components/Slider/index.js +1 -0
- package/dist/components/Slider/style.css +1 -0
- package/dist/components/TextField/TextField.cjs +1 -0
- package/dist/components/TextField/TextField.d.ts +2 -0
- package/dist/components/TextField/TextField.js +19 -0
- package/dist/components/TextField/TextField.render.cjs +1 -0
- package/dist/components/TextField/TextField.render.d.ts +19 -0
- package/dist/components/TextField/TextField.render.js +159 -0
- package/dist/components/TextField/index.cjs +1 -0
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/TextField/index.js +1 -0
- package/dist/components/TextField/style.css +1 -0
- package/dist/components/Theme/Theme.cjs +4 -0
- package/dist/components/Theme/Theme.d.ts +14 -0
- package/dist/components/Theme/Theme.js +183 -0
- package/dist/components/Theme/index.cjs +1 -0
- package/dist/components/Theme/index.d.ts +1 -0
- package/dist/components/Theme/index.js +1 -0
- package/dist/components/Theme/style.css +1 -0
- package/dist/components/Theme/types.d.ts +29 -0
- package/dist/components/Toolbar/Toolbar.cjs +1 -0
- package/dist/components/Toolbar/Toolbar.d.ts +3 -0
- package/dist/components/Toolbar/Toolbar.js +19 -0
- package/dist/components/Toolbar/Toolbar.render.cjs +1 -0
- package/dist/components/Toolbar/Toolbar.render.d.ts +14 -0
- package/dist/components/Toolbar/Toolbar.render.js +64 -0
- package/dist/components/Toolbar/index.cjs +1 -0
- package/dist/components/Toolbar/index.d.ts +2 -0
- package/dist/components/Toolbar/index.js +1 -0
- package/dist/components/Toolbar/style.css +1 -0
- package/dist/components/Tooltip/Tooltip.cjs +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +12 -0
- package/dist/components/Tooltip/Tooltip.js +52 -0
- package/dist/components/Tooltip/index.cjs +1 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +1 -0
- package/dist/components/Tooltip/style.css +1 -0
- package/dist/components/containers/FilledField/index.cjs +1 -0
- package/dist/components/containers/FilledField/index.d.ts +9 -0
- package/dist/components/containers/FilledField/index.js +40 -0
- package/dist/components/containers/FilledField/style.css +1 -0
- package/dist/components/containers/OutlinedField/index.cjs +1 -0
- package/dist/components/containers/OutlinedField/index.d.ts +9 -0
- package/dist/components/containers/OutlinedField/index.js +59 -0
- package/dist/components/containers/OutlinedField/style.css +1 -0
- package/dist/components/misc/FloatingElement/index.cjs +1 -0
- package/dist/components/misc/FloatingElement/index.d.ts +17 -0
- package/dist/components/misc/FloatingElement/index.js +106 -0
- package/dist/components/misc/FloatingElement/style.css +1 -0
- package/dist/components/misc/OrderedCollection/index.cjs +1 -0
- package/dist/components/misc/OrderedCollection/index.d.ts +27 -0
- package/dist/components/misc/OrderedCollection/index.js +98 -0
- package/dist/components/misc/OrderedCollection/style.css +1 -0
- package/dist/components/misc/Polymorphic.cjs +1 -0
- package/dist/components/misc/Polymorphic.d.ts +15 -0
- package/dist/components/misc/Polymorphic.js +51 -0
- package/dist/components/misc/StateLayer/index.cjs +1 -0
- package/dist/components/misc/StateLayer/index.d.ts +7 -0
- package/dist/components/misc/StateLayer/index.js +67 -0
- package/dist/components/misc/StateLayer/style.css +1 -0
- package/dist/components/misc/Transitionable/index.cjs +1 -0
- package/dist/components/misc/Transitionable/index.d.ts +6 -0
- package/dist/components/misc/Transitionable/index.js +54 -0
- package/dist/components/misc/Transitionable/style.css +1 -0
- package/dist/components/types.cjs +1 -0
- package/dist/components/types.d.ts +20 -0
- package/dist/components/types.js +13 -0
- package/dist/hooks/useFloating/autoUpdate.cjs +1 -0
- package/dist/hooks/useFloating/autoUpdate.d.ts +9 -0
- package/dist/hooks/useFloating/autoUpdate.js +64 -0
- package/dist/hooks/useFloating/index.cjs +1 -0
- package/dist/hooks/useFloating/index.d.ts +30 -0
- package/dist/hooks/useFloating/index.js +97 -0
- package/dist/hooks/useFloating/middleware/flip.cjs +1 -0
- package/dist/hooks/useFloating/middleware/flip.d.ts +2 -0
- package/dist/hooks/useFloating/middleware/flip.js +88 -0
- package/dist/hooks/useFloating/middleware/offset.cjs +1 -0
- package/dist/hooks/useFloating/middleware/offset.d.ts +2 -0
- package/dist/hooks/useFloating/middleware/offset.js +42 -0
- package/dist/hooks/useFloating/middleware/shift.cjs +1 -0
- package/dist/hooks/useFloating/middleware/shift.d.ts +2 -0
- package/dist/hooks/useFloating/middleware/shift.js +11 -0
- package/dist/hooks/useFloating/middleware/size.cjs +1 -0
- package/dist/hooks/useFloating/middleware/size.d.ts +6 -0
- package/dist/hooks/useFloating/middleware/size.js +7 -0
- package/dist/hooks/useFloating/utils.cjs +1 -0
- package/dist/hooks/useFloating/utils.d.ts +22 -0
- package/dist/hooks/useFloating/utils.js +145 -0
- package/dist/layouts/Content.cjs +1 -0
- package/dist/layouts/Content.d.ts +3 -0
- package/dist/layouts/Content.js +17 -0
- package/dist/layouts/Page/index.cjs +1 -0
- package/dist/layouts/Page/index.d.ts +7 -0
- package/dist/layouts/Page/index.js +135 -0
- package/dist/layouts/Page/style.css +1 -0
- package/dist/layouts/Panes/Pane.cjs +1 -0
- package/dist/layouts/Panes/Pane.d.ts +11 -0
- package/dist/layouts/Panes/Pane.js +27 -0
- package/dist/layouts/Panes/Pane.render.cjs +1 -0
- package/dist/layouts/Panes/Pane.render.d.ts +6 -0
- package/dist/layouts/Panes/Pane.render.js +36 -0
- package/dist/layouts/Panes/Panes.cjs +1 -0
- package/dist/layouts/Panes/Panes.d.ts +28 -0
- package/dist/layouts/Panes/Panes.js +182 -0
- package/dist/layouts/Panes/index.cjs +1 -0
- package/dist/layouts/Panes/index.d.ts +2 -0
- package/dist/layouts/Panes/index.js +3 -0
- package/dist/layouts/Panes/style.css +1 -0
- package/dist/layouts/Tabs/Tab.d.ts +13 -0
- package/dist/layouts/Tabs/Tabs.d.ts +9 -0
- package/dist/layouts/Tabs/index.cjs +1 -0
- package/dist/layouts/Tabs/index.d.ts +1 -0
- package/dist/layouts/Tabs/index.js +0 -0
- package/dist/layouts/Toolbox/index.cjs +1 -0
- package/dist/layouts/Toolbox/index.d.ts +5 -0
- package/dist/layouts/Toolbox/index.js +129 -0
- package/dist/layouts/Toolbox/style.css +1 -0
- package/dist/style/motions.d.ts +37 -0
- package/dist/style/shapes/12_sided_cookie.d.ts +3 -0
- package/dist/style/shapes/4_leaf_clover.d.ts +3 -0
- package/dist/style/shapes/4_sided_cookie.d.ts +3 -0
- package/dist/style/shapes/6_sided_cookie.d.ts +3 -0
- package/dist/style/shapes/7_sided_cookie.d.ts +3 -0
- package/dist/style/shapes/8_leaf_clover.d.ts +3 -0
- package/dist/style/shapes/9_sided_cookie.d.ts +3 -0
- package/dist/style/shapes/arch.d.ts +3 -0
- package/dist/style/shapes/arrow.d.ts +3 -0
- package/dist/style/shapes/boom.d.ts +3 -0
- package/dist/style/shapes/bun.d.ts +3 -0
- package/dist/style/shapes/burst.d.ts +3 -0
- package/dist/style/shapes/circle.d.ts +3 -0
- package/dist/style/shapes/clamshell.d.ts +3 -0
- package/dist/style/shapes/diamond.d.ts +3 -0
- package/dist/style/shapes/fan.d.ts +3 -0
- package/dist/style/shapes/flower.d.ts +3 -0
- package/dist/style/shapes/gem.d.ts +3 -0
- package/dist/style/shapes/ghost_ish.d.ts +3 -0
- package/dist/style/shapes/heart.d.ts +3 -0
- package/dist/style/shapes/index.d.ts +109 -0
- package/dist/style/shapes/oval.d.ts +3 -0
- package/dist/style/shapes/pentagon.d.ts +3 -0
- package/dist/style/shapes/pill.d.ts +3 -0
- package/dist/style/shapes/pixel_circle.d.ts +3 -0
- package/dist/style/shapes/pixel_triangle.d.ts +3 -0
- package/dist/style/shapes/puffy.d.ts +3 -0
- package/dist/style/shapes/puffy_diamond.d.ts +3 -0
- package/dist/style/shapes/semicircle.d.ts +3 -0
- package/dist/style/shapes/slanted.d.ts +3 -0
- package/dist/style/shapes/soft_boom.d.ts +3 -0
- package/dist/style/shapes/soft_burst.d.ts +3 -0
- package/dist/style/shapes/square.d.ts +3 -0
- package/dist/style/shapes/sunny.d.ts +3 -0
- package/dist/style/shapes/triangle.d.ts +3 -0
- package/dist/style/shapes/very_sunny.d.ts +3 -0
- package/dist/style/symbols.d.ts +2 -0
- package/dist/utils/dom.cjs +1 -0
- package/dist/utils/dom.d.ts +2 -0
- package/dist/utils/dom.js +53 -0
- package/dist/utils/hooks.cjs +1 -0
- package/dist/utils/hooks.d.ts +17 -0
- package/dist/utils/hooks.js +9 -0
- package/dist/utils/index.cjs +1 -0
- package/dist/utils/index.d.ts +44 -0
- package/dist/utils/index.js +74 -0
- package/package.json +169 -4
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import e, { convertIconDefinition as t } from "../Icon/Icon.js";
|
|
2
|
+
import { getMaxWords as n } from "../../utils/index.js";
|
|
3
|
+
import r from "../Button/icon/index.js";
|
|
4
|
+
import "../Icon/index.js";
|
|
5
|
+
import i from "../containers/FilledField/index.js";
|
|
6
|
+
import a from "../containers/OutlinedField/index.js";
|
|
7
|
+
import './style.css';/* empty css */
|
|
8
|
+
import o from "classnames";
|
|
9
|
+
import { useCallback as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
10
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
11
|
+
//#region lib/components/TextField/TextField.render.tsx
|
|
12
|
+
function m(m) {
|
|
13
|
+
let { shape: h, label: g, onValueChange: _, onChange: v, onInvalid: y, value: b, supportingText: x, counter: S = !0, clearable: C, leadingIcon: w, trailingIcon: T, prefix: E, suffix: D, ...O } = m, k = l(null), [A, j] = u(b ?? m.defaultValue ?? ""), M = b ?? A, N = !!M.length, [P, F] = u(!1), [I, L] = u(!1), R = g ? g + (m.required ? "*" : "") : void 0, [z, B] = u(), [V, H] = u(0), U = z ?? x, W = s((e) => {
|
|
14
|
+
let t;
|
|
15
|
+
m.maxLength && S === "word" ? (t = e.match(/\b\w+\b/g)?.length ?? 0, t >= m.maxLength && (e = n(e, m.maxLength)), H(t)) : m.maxLength && (e = e.slice(0, m.maxLength), H(e.length)), b === void 0 && j(e), B(void 0), _?.(e);
|
|
16
|
+
}, [
|
|
17
|
+
b,
|
|
18
|
+
S,
|
|
19
|
+
_,
|
|
20
|
+
m.maxLength
|
|
21
|
+
]), G = s((e) => {
|
|
22
|
+
e.preventDefault(), W("");
|
|
23
|
+
}, [W]), K = c(() => m.type === "password" ? /* @__PURE__ */ f(r, {
|
|
24
|
+
selectable: !0,
|
|
25
|
+
selected: I,
|
|
26
|
+
icon: (e) => T ?? (e ? "visibility_off" : "visibility"),
|
|
27
|
+
color: "standard",
|
|
28
|
+
onClick: () => L(!I),
|
|
29
|
+
className: "trailing"
|
|
30
|
+
}) : C ? /* @__PURE__ */ f(r, {
|
|
31
|
+
icon: T ?? "close",
|
|
32
|
+
color: "standard",
|
|
33
|
+
onClick: G,
|
|
34
|
+
className: "trailing"
|
|
35
|
+
}) : z ? /* @__PURE__ */ f(e, {
|
|
36
|
+
name: "error",
|
|
37
|
+
fill: !0,
|
|
38
|
+
className: "error"
|
|
39
|
+
}) : t(T), [
|
|
40
|
+
m.type,
|
|
41
|
+
I,
|
|
42
|
+
C,
|
|
43
|
+
T,
|
|
44
|
+
G,
|
|
45
|
+
z
|
|
46
|
+
]), q = c(() => /* @__PURE__ */ f("input", {
|
|
47
|
+
...O,
|
|
48
|
+
ref: k,
|
|
49
|
+
type: m.type === "password" ? I ? "text" : "password" : m.type,
|
|
50
|
+
required: m.required,
|
|
51
|
+
onFocus: () => F(!0),
|
|
52
|
+
onBlur: () => F(!1),
|
|
53
|
+
value: M,
|
|
54
|
+
onChange: (e) => {
|
|
55
|
+
W(e.target.value), v?.(e);
|
|
56
|
+
},
|
|
57
|
+
maxLength: m.maxLength && S === "word" ? void 0 : m.maxLength,
|
|
58
|
+
onInvalid: (e) => {
|
|
59
|
+
e.preventDefault(), B(e.currentTarget.validationMessage), y?.(e), e.currentTarget.focus();
|
|
60
|
+
},
|
|
61
|
+
title: ""
|
|
62
|
+
}), [
|
|
63
|
+
O,
|
|
64
|
+
m.type,
|
|
65
|
+
m.required,
|
|
66
|
+
m.maxLength,
|
|
67
|
+
I,
|
|
68
|
+
M,
|
|
69
|
+
S,
|
|
70
|
+
W,
|
|
71
|
+
v,
|
|
72
|
+
y
|
|
73
|
+
]), J = c(() => h === "filled" ? /* @__PURE__ */ p(d, { children: [
|
|
74
|
+
t(w),
|
|
75
|
+
/* @__PURE__ */ p("div", {
|
|
76
|
+
className: "container",
|
|
77
|
+
onMouseDown: () => requestAnimationFrame(() => k.current?.focus()),
|
|
78
|
+
children: [g && /* @__PURE__ */ f("span", {
|
|
79
|
+
className: "label",
|
|
80
|
+
children: R
|
|
81
|
+
}), /* @__PURE__ */ p("div", {
|
|
82
|
+
className: o("content", {
|
|
83
|
+
prefix: E,
|
|
84
|
+
suffix: D
|
|
85
|
+
}),
|
|
86
|
+
children: [
|
|
87
|
+
E && /* @__PURE__ */ f("span", {
|
|
88
|
+
className: "prefix",
|
|
89
|
+
children: E
|
|
90
|
+
}),
|
|
91
|
+
q,
|
|
92
|
+
D && /* @__PURE__ */ f("span", {
|
|
93
|
+
className: "suffix",
|
|
94
|
+
children: D
|
|
95
|
+
})
|
|
96
|
+
]
|
|
97
|
+
})]
|
|
98
|
+
}),
|
|
99
|
+
K
|
|
100
|
+
] }) : /* @__PURE__ */ p(d, { children: [
|
|
101
|
+
t(w),
|
|
102
|
+
/* @__PURE__ */ p("div", {
|
|
103
|
+
className: o("content", {
|
|
104
|
+
prefix: E,
|
|
105
|
+
suffix: D
|
|
106
|
+
}),
|
|
107
|
+
children: [
|
|
108
|
+
E && /* @__PURE__ */ f("span", {
|
|
109
|
+
className: "prefix",
|
|
110
|
+
children: E
|
|
111
|
+
}),
|
|
112
|
+
q,
|
|
113
|
+
D && /* @__PURE__ */ f("span", {
|
|
114
|
+
className: "suffix",
|
|
115
|
+
children: D
|
|
116
|
+
})
|
|
117
|
+
]
|
|
118
|
+
}),
|
|
119
|
+
K
|
|
120
|
+
] }), [
|
|
121
|
+
R,
|
|
122
|
+
q,
|
|
123
|
+
g,
|
|
124
|
+
w,
|
|
125
|
+
E,
|
|
126
|
+
h,
|
|
127
|
+
D,
|
|
128
|
+
K
|
|
129
|
+
]);
|
|
130
|
+
return /* @__PURE__ */ p("div", {
|
|
131
|
+
className: o("TextField", m.type, { error: z }),
|
|
132
|
+
children: [f(h === "filled" ? i : a, {
|
|
133
|
+
label: R,
|
|
134
|
+
filled: N || !!m.prefix,
|
|
135
|
+
focus: P,
|
|
136
|
+
error: !!z,
|
|
137
|
+
className: o({
|
|
138
|
+
leadingIcon: w,
|
|
139
|
+
trailingIcon: K
|
|
140
|
+
}),
|
|
141
|
+
children: J
|
|
142
|
+
}), (U || m.maxLength && S) && /* @__PURE__ */ p("div", {
|
|
143
|
+
className: "support",
|
|
144
|
+
children: [/* @__PURE__ */ f("div", {
|
|
145
|
+
className: "message",
|
|
146
|
+
children: U
|
|
147
|
+
}), m.maxLength && S && /* @__PURE__ */ p("div", {
|
|
148
|
+
className: "counter",
|
|
149
|
+
children: [
|
|
150
|
+
V,
|
|
151
|
+
" / ",
|
|
152
|
+
m.maxLength
|
|
153
|
+
]
|
|
154
|
+
})]
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
export { m as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./TextField.cjs");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./TextField.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.TextField{vertical-align:top;min-width:240px;display:inline-block}.TextField>.Field{box-sizing:border-box;align-items:center;gap:12px;min-width:100%;max-width:100%;padding-inline:12px;display:flex}.TextField>.FilledField.leadingIcon{--filled-field-label-position-inline-offset:36px}.TextField>.FilledField>.Icon{--icon-size:24px}.TextField>.FilledField>.Icon:not(.error){color:var(--md-sys-color-on-surface-variant)}.TextField>.FilledField>.Icon.error{color:var(--md-sys-color-error)}.TextField>.FilledField>.container{flex-direction:column;flex:1 1 fit-content;box-sizing:border-box;cursor:text;width:0;min-height:56px;padding-block:8px;padding-inline:4px;display:flex}.TextField>.FilledField>.container>.label{font-family:var(--md-sys-typescale-body-small-font);font-weight:var(--md-sys-typescale-body-small-weight);font-size:var(--md-sys-typescale-body-small-size);letter-spacing:var(--md-sys-typescale-body-small-tracking);line-height:var(--md-sys-typescale-body-small-line-height);font-variation-settings:"wght" var(--md-sys-typescale-body-small-wght), "GRAD" var(--md-sys-typescale-body-small-grad), "wdth" var(--md-sys-typescale-body-small-wdth), "ROND" var(--md-sys-typescale-body-small-rond), "opsz" var(--md-sys-typescale-body-small-opsz), "CRSV" var(--md-sys-typescale-body-small-crsv), "slnt" var(--md-sys-typescale-body-small-slnt), "FILL" var(--md-sys-typescale-body-small-fill), "HEXP" var(--md-sys-typescale-body-small-hexp);text-align:left;opacity:0}.TextField>.FilledField>.container>.content{flex:1 1 fit-content;align-items:center;gap:2px;display:flex}.TextField>.FilledField>.container>.content.suffix>input{text-align:right}.TextField>.FilledField>.container>.content>.prefix,.TextField>.FilledField>.container>.content>.suffix{font-family:var(--md-sys-typescale-body-large-font);font-weight:var(--md-sys-typescale-body-large-weight);font-size:var(--md-sys-typescale-body-large-size);letter-spacing:var(--md-sys-typescale-body-large-tracking);line-height:var(--md-sys-typescale-body-large-line-height);font-variation-settings:"wght" var(--md-sys-typescale-body-large-wght), "GRAD" var(--md-sys-typescale-body-large-grad), "wdth" var(--md-sys-typescale-body-large-wdth), "ROND" var(--md-sys-typescale-body-large-rond), "opsz" var(--md-sys-typescale-body-large-opsz), "CRSV" var(--md-sys-typescale-body-large-crsv), "slnt" var(--md-sys-typescale-body-large-slnt), "FILL" var(--md-sys-typescale-body-large-fill), "HEXP" var(--md-sys-typescale-body-large-hexp);color:var(--md-sys-color-on-surface-variant)}.TextField>.FilledField>.container>.content>input{font-family:var(--md-sys-typescale-body-large-font);font-weight:var(--md-sys-typescale-body-large-weight);font-size:var(--md-sys-typescale-body-large-size);letter-spacing:var(--md-sys-typescale-body-large-tracking);line-height:var(--md-sys-typescale-body-large-line-height);font-variation-settings:"wght" var(--md-sys-typescale-body-large-wght), "GRAD" var(--md-sys-typescale-body-large-grad), "wdth" var(--md-sys-typescale-body-large-wdth), "ROND" var(--md-sys-typescale-body-large-rond), "opsz" var(--md-sys-typescale-body-large-opsz), "CRSV" var(--md-sys-typescale-body-large-crsv), "slnt" var(--md-sys-typescale-body-large-slnt), "FILL" var(--md-sys-typescale-body-large-fill), "HEXP" var(--md-sys-typescale-body-large-hexp);color:var(--md-sys-color-on-surface);box-sizing:border-box;width:0;height:100%;caret-color:var(--md-sys-color-primary);appearance:textfield;background:0 0;border:none;outline:none;flex:1;padding:0}.TextField>.FilledField>.container>.content>input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.TextField>.FilledField>.container>.content>input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.TextField>.OutlinedField.leadingIcon{--outlined-field-label-position-inline-offset:36px}.TextField>.OutlinedField>.Icon{--icon-size:24px}.TextField>.OutlinedField>.Icon:not(.error){color:var(--md-sys-color-on-surface-variant)}.TextField>.OutlinedField>.Icon.error{color:var(--md-sys-color-error)}.TextField>.OutlinedField>.IconButton{margin-inline:-4px}.TextField>.OutlinedField>.content{flex:1 1 fit-content;align-items:center;gap:2px;width:0;padding-inline:4px;display:flex}.TextField>.OutlinedField>.content.suffix>input{text-align:right}.TextField>.OutlinedField>.content>.prefix,.TextField>.OutlinedField>.content>.suffix{font-family:var(--md-sys-typescale-body-large-font);font-weight:var(--md-sys-typescale-body-large-weight);font-size:var(--md-sys-typescale-body-large-size);letter-spacing:var(--md-sys-typescale-body-large-tracking);line-height:var(--md-sys-typescale-body-large-line-height);font-variation-settings:"wght" var(--md-sys-typescale-body-large-wght), "GRAD" var(--md-sys-typescale-body-large-grad), "wdth" var(--md-sys-typescale-body-large-wdth), "ROND" var(--md-sys-typescale-body-large-rond), "opsz" var(--md-sys-typescale-body-large-opsz), "CRSV" var(--md-sys-typescale-body-large-crsv), "slnt" var(--md-sys-typescale-body-large-slnt), "FILL" var(--md-sys-typescale-body-large-fill), "HEXP" var(--md-sys-typescale-body-large-hexp);color:var(--md-sys-color-on-surface-variant)}.TextField>.OutlinedField>.content>input{font-family:var(--md-sys-typescale-body-large-font);font-weight:var(--md-sys-typescale-body-large-weight);font-size:var(--md-sys-typescale-body-large-size);letter-spacing:var(--md-sys-typescale-body-large-tracking);line-height:var(--md-sys-typescale-body-large-line-height);font-variation-settings:"wght" var(--md-sys-typescale-body-large-wght), "GRAD" var(--md-sys-typescale-body-large-grad), "wdth" var(--md-sys-typescale-body-large-wdth), "ROND" var(--md-sys-typescale-body-large-rond), "opsz" var(--md-sys-typescale-body-large-opsz), "CRSV" var(--md-sys-typescale-body-large-crsv), "slnt" var(--md-sys-typescale-body-large-slnt), "FILL" var(--md-sys-typescale-body-large-fill), "HEXP" var(--md-sys-typescale-body-large-hexp);color:var(--md-sys-color-on-surface);box-sizing:border-box;width:0;min-height:56px;caret-color:var(--md-sys-color-primary);appearance:textfield;background:0 0;border:none;outline:none;flex:1;padding:0}.TextField>.OutlinedField>.content>input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.TextField>.OutlinedField>.content>input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.TextField>.support{font-family:var(--md-sys-typescale-body-large-font);font-weight:var(--md-sys-typescale-body-large-weight);font-size:var(--md-sys-typescale-body-large-size);letter-spacing:var(--md-sys-typescale-body-large-tracking);line-height:var(--md-sys-typescale-body-large-line-height);font-variation-settings:"wght" var(--md-sys-typescale-body-large-wght), "GRAD" var(--md-sys-typescale-body-large-grad), "wdth" var(--md-sys-typescale-body-large-wdth), "ROND" var(--md-sys-typescale-body-large-rond), "opsz" var(--md-sys-typescale-body-large-opsz), "CRSV" var(--md-sys-typescale-body-large-crsv), "slnt" var(--md-sys-typescale-body-large-slnt), "FILL" var(--md-sys-typescale-body-large-fill), "HEXP" var(--md-sys-typescale-body-large-hexp);color:var(--md-sys-color-on-surface-variant);text-align:left;padding-top:4px;box-sizing:border-box;gap:16px;width:min-content;min-width:100%;padding-inline:16px;display:flex}.TextField>.support>.message{flex:1}.TextField.error>.OutlinedField>.content>input{caret-color:var(--md-sys-color-error)}.TextField.error>.support{color:var(--md-sys-color-error)}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
require('./style.css');const e=require("../../_virtual/_rolldown/runtime.cjs");;/* empty css */let t=require("react/compiler-runtime"),n=require("@material/material-color-utilities"),r=require("classnames");r=e.__toESM(r,1);let i=require("react");require("@fontsource/roboto/index.css"),require("@fontsource/roboto-flex/index.css"),require("@fontsource/roboto-mono/index.css");let a=require("react/jsx-runtime");function o(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null}function s(e,t=!1,r,i){let a=(0,n.argbFromHex)(e),s=`background.onBackground.surface.surfaceDim.surfaceBright.surfaceContainerLowest.surfaceContainerLow.surfaceContainer.surfaceContainerHigh.surfaceContainerHighest.onSurface.surfaceVariant.onSurfaceVariant.inverseSurface.inverseOnSurface.outline.outlineVariant.shadow.scrim.surfaceTint.primary.onPrimary.primaryContainer.onPrimaryContainer.inversePrimary.secondary.onSecondary.secondaryContainer.onSecondaryContainer.tertiary.onTertiary.tertiaryContainer.onTertiaryContainer.error.onError.errorContainer.onErrorContainer.primaryFixed.primaryFixedDim.onPrimaryFixed.onPrimaryFixedVariant.secondaryFixed.secondaryFixedDim.onSecondaryFixed.onSecondaryFixedVariant.tertiaryFixed.tertiaryFixedDim.onTertiaryFixed.onTertiaryFixedVariant`.split(`.`),c=[`color`,`colorContainer`,`onColor`,`onColorContainer`],l=new n.SchemeTonalSpot(n.Hct.fromInt(a),t,r??0,`2025`),u=[],d=(e,t)=>{let n=e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase();return t&&(n=n.replace(`color`,t)),`--md-sys-color-${n}`},f,p,m;for(let e of s)p=(0,n.hexFromArgb)(l[e]),m=o(p),u.push(`${d(e)}: ${p};`),u.push(`${d(e)}-rgb: ${m?.r}, ${m?.g}, ${m?.b};`);for(let e in i)for(let r of c)f=(0,n.customColor)(a,{name:e,value:typeof i[e].color==`string`?(0,n.argbFromHex)(i[e].color):i[e].color,blend:i[e].blend}),u.push(`${d(r,e)}: ${(0,n.hexFromArgb)(f[t?`dark`:`light`][r])};`);return u.join(`
|
|
2
|
+
`)}var c=(0,i.createContext)(null);function l(e){let t=(0,i.useContext)(c);if(e&&!t)throw Error(`${e} must be used in <Theme> component`);return t}function u(e){let n=(0,t.c)(97),o,u,f,p,m,h,g;n[0]===e?(o=n[1],u=n[2],f=n[3],p=n[4],m=n[5],h=n[6],g=n[7]):({theme:g,scrollable:m,children:o,noDefaultStyle:p,className:u,style:h,...f}=e,n[0]=e,n[1]=o,n[2]=u,n[3]=f,n[4]=p,n[5]=m,n[6]=h,n[7]=g);let ee=g===void 0?`auto`:g,_=(0,i.useRef)(null),[te,ne]=(0,i.useState)(null),[re,ie]=(0,i.useState)(null),[ae,oe]=(0,i.useState)(null),se=(0,i.useId)(),v=e.id??se,y=(0,i.useRef)(null),b;n[8]===Symbol.for(`react.memo_cache_sentinel`)?(b={},n[8]=b):b=n[8];let x=(0,i.useRef)(b),S=(0,i.useRef)(null),[C,w]=(0,i.useState)(),T=l(),E;n[9]===T?E=n[10]:(E=()=>{let e=T;if(!e)return null;for(;e?.context;)e=e.context;return e},n[9]=T,n[10]=E);let D=E,O=T?.tooltipsContainer??te,k=T?.dialogsContainer??re,A=T?.popoversContainer??ae,j;n[11]!==D||n[12]!==C?(j=D()?.tooltip??C,n[11]=D,n[12]=C,n[13]=j):j=n[13];let M;n[14]!==f||n[15]!==T||n[16]!==O||n[17]!==k||n[18]!==A||n[19]!==j?(M={ref:_,tooltipsContainer:O,dialogsContainer:k,popoversContainer:A,config:f,tooltip:j,setTooltip(e){typeof S.current==`number`&&(S.current=window.clearTimeout(S.current)??null),e?w(e):S.current=window.setTimeout(()=>w(void 0),1500),T?.setTooltip(e)},setDialogState(e,t){x.current[e]=t,Object.values(x.current).some(d)?document.documentElement.style.setProperty(`overflow`,`hidden`):document.documentElement.style.removeProperty(`overflow`)},context:T},n[14]=f,n[15]=T,n[16]=O,n[17]=k,n[18]=A,n[19]=j,n[20]=M):M=n[20];let N=M,P;n[21]===Symbol.for(`react.memo_cache_sentinel`)?(P={color:`#257f00`,blend:!0},n[21]=P):P=n[21];let F;n[22]===e.customColors?F=n[23]:(F={success:P,...e.customColors},n[22]=e.customColors,n[23]=F);let I=F,L;bb0:{if(!T){let t;n[24]!==I||n[25]!==e.contrast||n[26]!==e.primaryColor?(t=s(e.primaryColor,!1,e.contrast,I),n[24]=I,n[25]=e.contrast,n[26]=e.primaryColor,n[27]=t):t=n[27];let r=`:root:not(:has(.Theme.light), :has(.Theme.dark)) {${t}}`,i;n[28]!==I||n[29]!==e.contrast||n[30]!==e.primaryColor?(i=s(e.primaryColor,!0,e.contrast,I),n[28]=I,n[29]=e.contrast,n[30]=e.primaryColor,n[31]=i):i=n[31];let a=`@media (prefers-color-scheme: dark) {:root:not(:has(.Theme.light), :has(.Theme.dark)) {${i}}}`,o;n[32]!==I||n[33]!==e.contrast||n[34]!==e.primaryColor?(o=s(e.primaryColor,!1,e.contrast,I),n[32]=I,n[33]=e.contrast,n[34]=e.primaryColor,n[35]=o):o=n[35];let c=`:root:has(.Theme.light) {${o}}`,l;n[36]!==I||n[37]!==e.contrast||n[38]!==e.primaryColor?(l=s(e.primaryColor,!0,e.contrast,I),n[36]=I,n[37]=e.contrast,n[38]=e.primaryColor,n[39]=l):l=n[39];let u=`:root:has(.Theme.dark) {${l}}`,d;n[40]!==r||n[41]!==a||n[42]!==c||n[43]!==u?(d=[r,a,c,u],n[40]=r,n[41]=a,n[42]=c,n[43]=u,n[44]=d):d=n[44],L=d.join(`
|
|
3
|
+
`);break bb0}let t;n[45]!==I||n[46]!==e.contrast||n[47]!==e.primaryColor?(t=s(e.primaryColor,!1,e.contrast,I),n[45]=I,n[46]=e.contrast,n[47]=e.primaryColor,n[48]=t):t=n[48];let r=`:root:not(:has(.Theme.light), :has(.Theme.dark)) .Theme#${v} {${t}}`,i;n[49]!==I||n[50]!==e.contrast||n[51]!==e.primaryColor?(i=s(e.primaryColor,!0,e.contrast,I),n[49]=I,n[50]=e.contrast,n[51]=e.primaryColor,n[52]=i):i=n[52];let a=`@media (prefers-color-scheme: dark) {:root:not(:has(.Theme.light), :has(.Theme.dark)) .Theme#${v} {${i}}}`,o;n[53]!==I||n[54]!==e.contrast||n[55]!==e.primaryColor?(o=s(e.primaryColor,!1,e.contrast,I),n[53]=I,n[54]=e.contrast,n[55]=e.primaryColor,n[56]=o):o=n[56];let c=`:root:has(.Theme.light) .Theme#${v} {${o}}`,l;n[57]!==I||n[58]!==e.contrast||n[59]!==e.primaryColor?(l=s(e.primaryColor,!0,e.contrast,I),n[57]=I,n[58]=e.contrast,n[59]=e.primaryColor,n[60]=l):l=n[60];let u=`:root:has(.Theme.dark) .Theme#${v} {${l}}`,d;n[61]!==r||n[62]!==a||n[63]!==c||n[64]!==u?(d=[r,a,c,u],n[61]=r,n[62]=a,n[63]=c,n[64]=u,n[65]=d):d=n[65],L=d.join(`
|
|
4
|
+
`)}let R=L,z=!T&&ee===`light`,B=!T&&ee===`dark`,V=!p&&!T,H=!T||m,U;n[66]!==z||n[67]!==B||n[68]!==V||n[69]!==H?(U={Theme:!0,light:z,dark:B,base:V,scrollable:H},n[66]=z,n[67]=B,n[68]=V,n[69]=H,n[70]=U):U=n[70];let W=U,G,K;n[71]===R?(G=n[72],K=n[73]):(G=()=>{y.current&&(y.current.innerHTML=R)},K=[R],n[71]=R,n[72]=G,n[73]=K),(0,i.useLayoutEffect)(G,K);let q;n[74]!==p||n[75]!==T||n[76]!==v?(q=!p&&!T&&(0,a.jsx)(`style`,{href:`theme_base_${v}`,precedence:`theme_base`,children:`body {margin: 0px}`}),n[74]=p,n[75]=T,n[76]=v,n[77]=q):q=n[77];let J=`theme_${v}`,Y;n[78]!==R||n[79]!==J?(Y=(0,a.jsx)(`style`,{ref:y,href:J,precedence:`theme`,children:R}),n[78]=R,n[79]=J,n[80]=Y):Y=n[80];let X;n[81]!==W||n[82]!==u?(X=(0,r.default)(W,u),n[81]=W,n[82]=u,n[83]=X):X=n[83];let Z;n[84]===T?Z=n[85]:(Z=!T&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(`div`,{ref:ne,className:`portals toolips-container`}),(0,a.jsx)(`div`,{ref:ie,className:`portals dialogs-container`}),(0,a.jsx)(`div`,{ref:oe,className:`portals popovers-container`})]}),n[84]=T,n[85]=Z);let Q;n[86]!==o||n[87]!==v||n[88]!==h||n[89]!==X||n[90]!==Z?(Q=(0,a.jsxs)(`div`,{ref:_,id:v,className:X,style:h,children:[o,Z]}),n[86]=o,n[87]=v,n[88]=h,n[89]=X,n[90]=Z,n[91]=Q):Q=n[91];let $;return n[92]!==N||n[93]!==q||n[94]!==Y||n[95]!==Q?($=(0,a.jsxs)(c,{value:N,children:[q,Y,Q]}),n[92]=N,n[93]=q,n[94]=Y,n[95]=Q,n[96]=$):$=n[96],$}function d(e){return e}exports.default=u,exports.useTheme=l;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ThemeConfig, ThemeContext } from './types';
|
|
2
|
+
declare const ThemeContext: import('react').Context<ThemeContext | null>;
|
|
3
|
+
export declare function useTheme(): ThemeContext | null;
|
|
4
|
+
export declare function useTheme(required: string): ThemeContext;
|
|
5
|
+
export interface ThemeProps extends React.PropsWithChildren<ThemeConfig> {
|
|
6
|
+
id?: string;
|
|
7
|
+
theme?: "light" | "dark" | "auto";
|
|
8
|
+
scrollable?: boolean;
|
|
9
|
+
noDefaultStyle?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
export default function Theme(props: ThemeProps): import('react').JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import './style.css';/* empty css */
|
|
2
|
+
import { c as e } from "react/compiler-runtime";
|
|
3
|
+
import { Hct as t, SchemeTonalSpot as n, argbFromHex as r, customColor as i, hexFromArgb as a } from "@material/material-color-utilities";
|
|
4
|
+
import o from "classnames";
|
|
5
|
+
import { createContext as s, useContext as c, useId as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
|
|
6
|
+
import "@fontsource/roboto/index.css";
|
|
7
|
+
import "@fontsource/roboto-flex/index.css";
|
|
8
|
+
import "@fontsource/roboto-mono/index.css";
|
|
9
|
+
import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
10
|
+
//#region lib/components/Theme/Theme.tsx
|
|
11
|
+
function g(e) {
|
|
12
|
+
let t = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);
|
|
13
|
+
return t ? {
|
|
14
|
+
r: parseInt(t[1], 16),
|
|
15
|
+
g: parseInt(t[2], 16),
|
|
16
|
+
b: parseInt(t[3], 16)
|
|
17
|
+
} : null;
|
|
18
|
+
}
|
|
19
|
+
function _(e, o = !1, s, c) {
|
|
20
|
+
let l = r(e), u = /* @__PURE__ */ "background.onBackground.surface.surfaceDim.surfaceBright.surfaceContainerLowest.surfaceContainerLow.surfaceContainer.surfaceContainerHigh.surfaceContainerHighest.onSurface.surfaceVariant.onSurfaceVariant.inverseSurface.inverseOnSurface.outline.outlineVariant.shadow.scrim.surfaceTint.primary.onPrimary.primaryContainer.onPrimaryContainer.inversePrimary.secondary.onSecondary.secondaryContainer.onSecondaryContainer.tertiary.onTertiary.tertiaryContainer.onTertiaryContainer.error.onError.errorContainer.onErrorContainer.primaryFixed.primaryFixedDim.onPrimaryFixed.onPrimaryFixedVariant.secondaryFixed.secondaryFixedDim.onSecondaryFixed.onSecondaryFixedVariant.tertiaryFixed.tertiaryFixedDim.onTertiaryFixed.onTertiaryFixedVariant".split("."), d = [
|
|
21
|
+
"color",
|
|
22
|
+
"colorContainer",
|
|
23
|
+
"onColor",
|
|
24
|
+
"onColorContainer"
|
|
25
|
+
], f = new n(t.fromInt(l), o, s ?? 0, "2025"), p = [], m = (e, t) => {
|
|
26
|
+
let n = e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
|
|
27
|
+
return t && (n = n.replace("color", t)), `--md-sys-color-${n}`;
|
|
28
|
+
}, h, _, v;
|
|
29
|
+
for (let e of u) _ = a(f[e]), v = g(_), p.push(`${m(e)}: ${_};`), p.push(`${m(e)}-rgb: ${v?.r}, ${v?.g}, ${v?.b};`);
|
|
30
|
+
for (let e in c) for (let t of d) h = i(l, {
|
|
31
|
+
name: e,
|
|
32
|
+
value: typeof c[e].color == "string" ? r(c[e].color) : c[e].color,
|
|
33
|
+
blend: c[e].blend
|
|
34
|
+
}), p.push(`${m(t, e)}: ${a(h[o ? "dark" : "light"][t])};`);
|
|
35
|
+
return p.join("\n");
|
|
36
|
+
}
|
|
37
|
+
var v = s(null);
|
|
38
|
+
function ee(e) {
|
|
39
|
+
let t = c(v);
|
|
40
|
+
if (e && !t) throw Error(`${e} must be used in <Theme> component`);
|
|
41
|
+
return t;
|
|
42
|
+
}
|
|
43
|
+
function y(t) {
|
|
44
|
+
let n = e(97), r, i, a, s, c, g, y;
|
|
45
|
+
n[0] === t ? (r = n[1], i = n[2], a = n[3], s = n[4], c = n[5], g = n[6], y = n[7]) : ({theme: y, scrollable: c, children: r, noDefaultStyle: s, className: i, style: g, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = s, n[5] = c, n[6] = g, n[7] = y);
|
|
46
|
+
let ne = y === void 0 ? "auto" : y, re = d(null), [ie, ae] = f(null), [oe, se] = f(null), [ce, le] = f(null), ue = l(), b = t.id ?? ue, x = d(null), S;
|
|
47
|
+
n[8] === Symbol.for("react.memo_cache_sentinel") ? (S = {}, n[8] = S) : S = n[8];
|
|
48
|
+
let de = d(S), C = d(null), [w, fe] = f(), T = ee(), E;
|
|
49
|
+
n[9] === T ? E = n[10] : (E = () => {
|
|
50
|
+
let e = T;
|
|
51
|
+
if (!e) return null;
|
|
52
|
+
for (; e?.context;) e = e.context;
|
|
53
|
+
return e;
|
|
54
|
+
}, n[9] = T, n[10] = E);
|
|
55
|
+
let D = E, O = T?.tooltipsContainer ?? ie, k = T?.dialogsContainer ?? oe, A = T?.popoversContainer ?? ce, j;
|
|
56
|
+
n[11] !== D || n[12] !== w ? (j = D()?.tooltip ?? w, n[11] = D, n[12] = w, n[13] = j) : j = n[13];
|
|
57
|
+
let M;
|
|
58
|
+
n[14] !== a || n[15] !== T || n[16] !== O || n[17] !== k || n[18] !== A || n[19] !== j ? (M = {
|
|
59
|
+
ref: re,
|
|
60
|
+
tooltipsContainer: O,
|
|
61
|
+
dialogsContainer: k,
|
|
62
|
+
popoversContainer: A,
|
|
63
|
+
config: a,
|
|
64
|
+
tooltip: j,
|
|
65
|
+
setTooltip(e) {
|
|
66
|
+
typeof C.current == "number" && (C.current = window.clearTimeout(C.current) ?? null), e ? fe(e) : C.current = window.setTimeout(() => fe(void 0), 1500), T?.setTooltip(e);
|
|
67
|
+
},
|
|
68
|
+
setDialogState(e, t) {
|
|
69
|
+
de.current[e] = t, Object.values(de.current).some(te) ? document.documentElement.style.setProperty("overflow", "hidden") : document.documentElement.style.removeProperty("overflow");
|
|
70
|
+
},
|
|
71
|
+
context: T
|
|
72
|
+
}, n[14] = a, n[15] = T, n[16] = O, n[17] = k, n[18] = A, n[19] = j, n[20] = M) : M = n[20];
|
|
73
|
+
let N = M, P;
|
|
74
|
+
n[21] === Symbol.for("react.memo_cache_sentinel") ? (P = {
|
|
75
|
+
color: "#257f00",
|
|
76
|
+
blend: !0
|
|
77
|
+
}, n[21] = P) : P = n[21];
|
|
78
|
+
let F;
|
|
79
|
+
n[22] === t.customColors ? F = n[23] : (F = {
|
|
80
|
+
success: P,
|
|
81
|
+
...t.customColors
|
|
82
|
+
}, n[22] = t.customColors, n[23] = F);
|
|
83
|
+
let I = F, L;
|
|
84
|
+
bb0: {
|
|
85
|
+
if (!T) {
|
|
86
|
+
let e;
|
|
87
|
+
n[24] !== I || n[25] !== t.contrast || n[26] !== t.primaryColor ? (e = _(t.primaryColor, !1, t.contrast, I), n[24] = I, n[25] = t.contrast, n[26] = t.primaryColor, n[27] = e) : e = n[27];
|
|
88
|
+
let r = `:root:not(:has(.Theme.light), :has(.Theme.dark)) {${e}}`, i;
|
|
89
|
+
n[28] !== I || n[29] !== t.contrast || n[30] !== t.primaryColor ? (i = _(t.primaryColor, !0, t.contrast, I), n[28] = I, n[29] = t.contrast, n[30] = t.primaryColor, n[31] = i) : i = n[31];
|
|
90
|
+
let a = `@media (prefers-color-scheme: dark) {:root:not(:has(.Theme.light), :has(.Theme.dark)) {${i}}}`, o;
|
|
91
|
+
n[32] !== I || n[33] !== t.contrast || n[34] !== t.primaryColor ? (o = _(t.primaryColor, !1, t.contrast, I), n[32] = I, n[33] = t.contrast, n[34] = t.primaryColor, n[35] = o) : o = n[35];
|
|
92
|
+
let s = `:root:has(.Theme.light) {${o}}`, c;
|
|
93
|
+
n[36] !== I || n[37] !== t.contrast || n[38] !== t.primaryColor ? (c = _(t.primaryColor, !0, t.contrast, I), n[36] = I, n[37] = t.contrast, n[38] = t.primaryColor, n[39] = c) : c = n[39];
|
|
94
|
+
let l = `:root:has(.Theme.dark) {${c}}`, u;
|
|
95
|
+
n[40] !== r || n[41] !== a || n[42] !== s || n[43] !== l ? (u = [
|
|
96
|
+
r,
|
|
97
|
+
a,
|
|
98
|
+
s,
|
|
99
|
+
l
|
|
100
|
+
], n[40] = r, n[41] = a, n[42] = s, n[43] = l, n[44] = u) : u = n[44], L = u.join("\n");
|
|
101
|
+
break bb0;
|
|
102
|
+
}
|
|
103
|
+
let e;
|
|
104
|
+
n[45] !== I || n[46] !== t.contrast || n[47] !== t.primaryColor ? (e = _(t.primaryColor, !1, t.contrast, I), n[45] = I, n[46] = t.contrast, n[47] = t.primaryColor, n[48] = e) : e = n[48];
|
|
105
|
+
let r = `:root:not(:has(.Theme.light), :has(.Theme.dark)) .Theme#${b} {${e}}`, i;
|
|
106
|
+
n[49] !== I || n[50] !== t.contrast || n[51] !== t.primaryColor ? (i = _(t.primaryColor, !0, t.contrast, I), n[49] = I, n[50] = t.contrast, n[51] = t.primaryColor, n[52] = i) : i = n[52];
|
|
107
|
+
let a = `@media (prefers-color-scheme: dark) {:root:not(:has(.Theme.light), :has(.Theme.dark)) .Theme#${b} {${i}}}`, o;
|
|
108
|
+
n[53] !== I || n[54] !== t.contrast || n[55] !== t.primaryColor ? (o = _(t.primaryColor, !1, t.contrast, I), n[53] = I, n[54] = t.contrast, n[55] = t.primaryColor, n[56] = o) : o = n[56];
|
|
109
|
+
let s = `:root:has(.Theme.light) .Theme#${b} {${o}}`, c;
|
|
110
|
+
n[57] !== I || n[58] !== t.contrast || n[59] !== t.primaryColor ? (c = _(t.primaryColor, !0, t.contrast, I), n[57] = I, n[58] = t.contrast, n[59] = t.primaryColor, n[60] = c) : c = n[60];
|
|
111
|
+
let l = `:root:has(.Theme.dark) .Theme#${b} {${c}}`, u;
|
|
112
|
+
n[61] !== r || n[62] !== a || n[63] !== s || n[64] !== l ? (u = [
|
|
113
|
+
r,
|
|
114
|
+
a,
|
|
115
|
+
s,
|
|
116
|
+
l
|
|
117
|
+
], n[61] = r, n[62] = a, n[63] = s, n[64] = l, n[65] = u) : u = n[65], L = u.join("\n");
|
|
118
|
+
}
|
|
119
|
+
let R = L, z = !T && ne === "light", B = !T && ne === "dark", V = !s && !T, H = !T || c, U;
|
|
120
|
+
n[66] !== z || n[67] !== B || n[68] !== V || n[69] !== H ? (U = {
|
|
121
|
+
Theme: !0,
|
|
122
|
+
light: z,
|
|
123
|
+
dark: B,
|
|
124
|
+
base: V,
|
|
125
|
+
scrollable: H
|
|
126
|
+
}, n[66] = z, n[67] = B, n[68] = V, n[69] = H, n[70] = U) : U = n[70];
|
|
127
|
+
let W = U, G, K;
|
|
128
|
+
n[71] === R ? (G = n[72], K = n[73]) : (G = () => {
|
|
129
|
+
x.current && (x.current.innerHTML = R);
|
|
130
|
+
}, K = [R], n[71] = R, n[72] = G, n[73] = K), u(G, K);
|
|
131
|
+
let q;
|
|
132
|
+
n[74] !== s || n[75] !== T || n[76] !== b ? (q = !s && !T && /* @__PURE__ */ m("style", {
|
|
133
|
+
href: `theme_base_${b}`,
|
|
134
|
+
precedence: "theme_base",
|
|
135
|
+
children: "body {margin: 0px}"
|
|
136
|
+
}), n[74] = s, n[75] = T, n[76] = b, n[77] = q) : q = n[77];
|
|
137
|
+
let J = `theme_${b}`, Y;
|
|
138
|
+
n[78] !== R || n[79] !== J ? (Y = /* @__PURE__ */ m("style", {
|
|
139
|
+
ref: x,
|
|
140
|
+
href: J,
|
|
141
|
+
precedence: "theme",
|
|
142
|
+
children: R
|
|
143
|
+
}), n[78] = R, n[79] = J, n[80] = Y) : Y = n[80];
|
|
144
|
+
let X;
|
|
145
|
+
n[81] !== W || n[82] !== i ? (X = o(W, i), n[81] = W, n[82] = i, n[83] = X) : X = n[83];
|
|
146
|
+
let Z;
|
|
147
|
+
n[84] === T ? Z = n[85] : (Z = !T && /* @__PURE__ */ h(p, { children: [
|
|
148
|
+
/* @__PURE__ */ m("div", {
|
|
149
|
+
ref: ae,
|
|
150
|
+
className: "portals toolips-container"
|
|
151
|
+
}),
|
|
152
|
+
/* @__PURE__ */ m("div", {
|
|
153
|
+
ref: se,
|
|
154
|
+
className: "portals dialogs-container"
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ m("div", {
|
|
157
|
+
ref: le,
|
|
158
|
+
className: "portals popovers-container"
|
|
159
|
+
})
|
|
160
|
+
] }), n[84] = T, n[85] = Z);
|
|
161
|
+
let Q;
|
|
162
|
+
n[86] !== r || n[87] !== b || n[88] !== g || n[89] !== X || n[90] !== Z ? (Q = /* @__PURE__ */ h("div", {
|
|
163
|
+
ref: re,
|
|
164
|
+
id: b,
|
|
165
|
+
className: X,
|
|
166
|
+
style: g,
|
|
167
|
+
children: [r, Z]
|
|
168
|
+
}), n[86] = r, n[87] = b, n[88] = g, n[89] = X, n[90] = Z, n[91] = Q) : Q = n[91];
|
|
169
|
+
let $;
|
|
170
|
+
return n[92] !== N || n[93] !== q || n[94] !== Y || n[95] !== Q ? ($ = /* @__PURE__ */ h(v, {
|
|
171
|
+
value: N,
|
|
172
|
+
children: [
|
|
173
|
+
q,
|
|
174
|
+
Y,
|
|
175
|
+
Q
|
|
176
|
+
]
|
|
177
|
+
}), n[92] = N, n[93] = q, n[94] = Y, n[95] = Q, n[96] = $) : $ = n[96], $;
|
|
178
|
+
}
|
|
179
|
+
function te(e) {
|
|
180
|
+
return e;
|
|
181
|
+
}
|
|
182
|
+
//#endregion
|
|
183
|
+
export { y as default, ee as useTheme };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./Theme.cjs");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default, type ThemeProps } from './Theme';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./Theme.js";
|