@g4rcez/components 3.0.1 → 4.0.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/dist/CaretDown.es-Cj7klWI3.js +33 -0
- package/dist/CaretDown.es-Cj7klWI3.js.map +1 -0
- package/dist/CaretRight.es-0-M8D9y8.js +33 -0
- package/dist/CaretRight.es-0-M8D9y8.js.map +1 -0
- package/dist/CheckCircle.es-C6QWLfk_.js +33 -0
- package/dist/CheckCircle.es-C6QWLfk_.js.map +1 -0
- package/dist/File.es-CA-vuPED.js +33 -0
- package/dist/File.es-CA-vuPED.js.map +1 -0
- package/dist/IconBase.es-DJ1oCtpo.js +50 -0
- package/dist/IconBase.es-DJ1oCtpo.js.map +1 -0
- package/dist/Info.es-CrZKs4q4.js +33 -0
- package/dist/Info.es-CrZKs4q4.js.map +1 -0
- package/dist/MotionConfigContext-C7MqlSdv.js +2713 -0
- package/dist/MotionConfigContext-C7MqlSdv.js.map +1 -0
- package/dist/Warning.es-D_eI6tLe.js +39 -0
- package/dist/Warning.es-D_eI6tLe.js.map +1 -0
- package/dist/X.es-BJ1O93El.js +39 -0
- package/dist/X.es-BJ1O93El.js.map +1 -0
- package/dist/ai/docs/Alert.md +1 -1
- package/dist/ai/docs/AnimatedList.md +3 -3
- package/dist/ai/docs/Button.md +1 -1
- package/dist/ai/docs/CommandPalette.md +7 -7
- package/dist/ai/docs/Dropdown.md +4 -4
- package/dist/ai/docs/Empty.md +9 -9
- package/dist/ai/docs/Expand.md +1 -1
- package/dist/ai/docs/FileUpload.md +2 -2
- package/dist/ai/docs/Input.md +2 -2
- package/dist/ai/docs/InputField.md +2 -2
- package/dist/ai/docs/List.md +3 -3
- package/dist/ai/docs/Menu.md +3 -3
- package/dist/ai/docs/MultiSelect.md +1 -1
- package/dist/ai/docs/PageCalendar.md +1 -1
- package/dist/ai/docs/Select.md +1 -1
- package/dist/ai/docs/Slot.md +1 -1
- package/dist/ai/docs/Stats.md +11 -11
- package/dist/ai/docs/Table.md +1 -1
- package/dist/ai/docs/Tag.md +2 -2
- package/dist/ai/docs/Timeline.md +5 -5
- package/dist/ai/docs/Toolbar.md +2 -2
- package/dist/ai/docs/Tooltip.md +3 -3
- package/dist/ai/docs/TransferList.md +2 -2
- package/dist/autocomplete-Cn9Z2hLq.js +375 -0
- package/dist/autocomplete-Cn9Z2hLq.js.map +1 -0
- package/dist/calendar-B5lSd0ID.js +1747 -0
- package/dist/calendar-B5lSd0ID.js.map +1 -0
- package/dist/components/core/button.js +76 -0
- package/dist/components/core/button.js.map +1 -0
- package/dist/components/core/tag.js +67 -0
- package/dist/components/core/tag.js.map +1 -0
- package/dist/components/display/alert.js +94 -0
- package/dist/components/display/alert.js.map +1 -0
- package/dist/components/display/calendar.js +15 -0
- package/dist/components/display/calendar.js.map +1 -0
- package/dist/components/display/card.d.ts +2 -2
- package/dist/components/display/card.d.ts.map +1 -1
- package/dist/components/display/card.js +84 -0
- package/dist/components/display/card.js.map +1 -0
- package/dist/components/display/empty.d.ts +2 -2
- package/dist/components/display/empty.d.ts.map +1 -1
- package/dist/components/display/list.js +93 -0
- package/dist/components/display/list.js.map +1 -0
- package/dist/components/display/notifications.js +15 -0
- package/dist/components/display/notifications.js.map +1 -0
- package/dist/components/display/stats.js +16 -0
- package/dist/components/display/stats.js.map +1 -0
- package/dist/components/display/tabs.js +12 -0
- package/dist/components/display/tabs.js.map +1 -0
- package/dist/components/display/timeline.js +29 -0
- package/dist/components/display/timeline.js.map +1 -0
- package/dist/components/floating/command-palette.d.ts +3 -3
- package/dist/components/floating/command-palette.d.ts.map +1 -1
- package/dist/components/floating/dropdown.js +58 -0
- package/dist/components/floating/dropdown.js.map +1 -0
- package/dist/components/floating/expand.js +41 -0
- package/dist/components/floating/expand.js.map +1 -0
- package/dist/components/floating/menu.d.ts +2 -2
- package/dist/components/floating/menu.d.ts.map +1 -1
- package/dist/components/floating/menu.js +177 -0
- package/dist/components/floating/menu.js.map +1 -0
- package/dist/components/floating/modal.js +297 -0
- package/dist/components/floating/modal.js.map +1 -0
- package/dist/components/floating/tooltip.js +73 -0
- package/dist/components/floating/tooltip.js.map +1 -0
- package/dist/components/form/autocomplete.js +16 -0
- package/dist/components/form/autocomplete.js.map +1 -0
- package/dist/components/form/checkbox.js +44 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/date-picker.js +12 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/file-upload.d.ts.map +1 -1
- package/dist/components/form/file-upload.js +11 -0
- package/dist/components/form/file-upload.js.map +1 -0
- package/dist/components/form/form.js +8 -0
- package/dist/components/form/form.js.map +1 -0
- package/dist/components/form/input-field.d.ts.map +1 -1
- package/dist/components/form/input.js +5 -0
- package/dist/components/form/input.js.map +1 -0
- package/dist/components/form/radiobox.js +30 -0
- package/dist/components/form/radiobox.js.map +1 -0
- package/dist/components/form/select.js +106 -0
- package/dist/components/form/select.js.map +1 -0
- package/dist/components/form/switch.js +65 -0
- package/dist/components/form/switch.js.map +1 -0
- package/dist/components/form/task-list.js +68 -0
- package/dist/components/form/task-list.js.map +1 -0
- package/dist/components/form/transfer-list.js +55 -0
- package/dist/components/form/transfer-list.js.map +1 -0
- package/dist/components/page-calendar/calendar-header.d.ts.map +1 -1
- package/dist/components/table/table.js +10 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/config/context.d.ts +2 -0
- package/dist/config/context.d.ts.map +1 -1
- package/dist/constants-r-AHn273.js +6 -0
- package/dist/constants-r-AHn273.js.map +1 -0
- package/dist/context-BFXNJVn2.js +161 -0
- package/dist/context-BFXNJVn2.js.map +1 -0
- package/dist/date-picker-DwNo22lx.js +1626 -0
- package/dist/date-picker-DwNo22lx.js.map +1 -0
- package/dist/dom-Dl8XH0CK.js +2833 -0
- package/dist/dom-Dl8XH0CK.js.map +1 -0
- package/dist/file-upload-Brf2NkLr.js +3245 -0
- package/dist/file-upload-Brf2NkLr.js.map +1 -0
- package/dist/floating-ui.react-QNHG9W4N.js +3706 -0
- package/dist/floating-ui.react-QNHG9W4N.js.map +1 -0
- package/dist/fns-D2eyJKd5.js +33 -0
- package/dist/fns-D2eyJKd5.js.map +1 -0
- package/dist/hooks/use-components-provider.d.ts.map +1 -1
- package/dist/index-0YMC-_Lt.js +20 -0
- package/dist/index-0YMC-_Lt.js.map +1 -0
- package/dist/index-BelDtX5M.js +1821 -0
- package/dist/index-BelDtX5M.js.map +1 -0
- package/dist/index-C-PuFUZi.js +3416 -0
- package/dist/index-C-PuFUZi.js.map +1 -0
- package/dist/index-DJSMaZR4.js +35 -0
- package/dist/index-DJSMaZR4.js.map +1 -0
- package/dist/index-Z-fZHxfJ.js +335 -0
- package/dist/index-Z-fZHxfJ.js.map +1 -0
- package/dist/index-t1qLJTt5.js +351 -0
- package/dist/index-t1qLJTt5.js.map +1 -0
- package/dist/index.esm-BaIwleSE.js +343 -0
- package/dist/index.esm-BaIwleSE.js.map +1 -0
- package/dist/index.js +8125 -27
- package/dist/index.js.map +1 -1
- package/dist/input-CrGrSnUt.js +441 -0
- package/dist/input-CrGrSnUt.js.map +1 -0
- package/dist/input-field-5vYcz5tT.js +166 -0
- package/dist/input-field-5vYcz5tT.js.map +1 -0
- package/dist/notifications-cUdVPs-B.js +2786 -0
- package/dist/notifications-cUdVPs-B.js.map +1 -0
- package/dist/polymorph-B5n9fs_K.js +10 -0
- package/dist/polymorph-B5n9fs_K.js.map +1 -0
- package/dist/proxy-BZcQiBrp.js +2495 -0
- package/dist/proxy-BZcQiBrp.js.map +1 -0
- package/dist/skeleton-D75GFBV6.js +10 -0
- package/dist/skeleton-D75GFBV6.js.map +1 -0
- package/dist/slot-CRyweuj0.js +79 -0
- package/dist/slot-CRyweuj0.js.map +1 -0
- package/dist/styles/common.js +29 -0
- package/dist/styles/dark.js +214 -0
- package/dist/styles/design-tokens.js +98 -0
- package/dist/styles/light.js +214 -0
- package/dist/styles/theme.js +4 -0
- package/dist/styles/theme.types.js +1 -0
- package/dist/tabs-S00a8qq8.js +106 -0
- package/dist/tabs-S00a8qq8.js.map +1 -0
- package/dist/use-motion-value-eGwNuWuw.js +14 -0
- package/dist/use-motion-value-eGwNuWuw.js.map +1 -0
- package/dist/use-stable-ref-CYh-YkID.js +11 -0
- package/dist/use-stable-ref-CYh-YkID.js.map +1 -0
- package/dist/use-translations-BwLKTrZv.js +10 -0
- package/dist/use-translations-BwLKTrZv.js.map +1 -0
- package/package.json +4 -5
- package/dist/index.mjs +0 -37108
- package/dist/index.mjs.map +0 -1
- package/dist/index.umd.js +0 -28
- package/dist/index.umd.js.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { c as e } from "./dom-Dl8XH0CK.js";
|
|
4
|
+
import { P as m } from "./polymorph-B5n9fs_K.js";
|
|
5
|
+
const r = /* @__PURE__ */ s("div", { className: "h-6 w-10/12 animate-pulse rounded bg-muted" }), c = (a) => /* @__PURE__ */ s(m, { ...a, as: a.as || "span", className: e("block h-8 w-32 animate-pulse rounded bg-muted", a.className) });
|
|
6
|
+
export {
|
|
7
|
+
r as S,
|
|
8
|
+
c as a
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=skeleton-D75GFBV6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skeleton-D75GFBV6.js","sources":["../src/components/display/skeleton.tsx"],"sourcesContent":["import React, { CSSProperties, useRef, type ElementType } from \"react\";\nimport { css } from \"../../lib/dom\";\nimport { Polymorph } from \"../core/polymorph\";\n\nexport const SkeletonCell = <div className=\"h-6 w-10/12 animate-pulse rounded bg-muted\" />;\n\nexport const Skeleton = (props: { className?: string; as?: ElementType; style?: CSSProperties }) => (\n <Polymorph {...props} as={props.as || \"span\"} className={css(\"block h-8 w-32 animate-pulse rounded bg-muted\", props.className)} />\n);\n\nexport const SkeletonList = (props: { className?: string; rows: number }) => {\n const items = useRef(\n Array.from({ length: props.rows }).map((_, i) => {\n const rand = Math.max(100, Math.random() * 99);\n return <Skeleton key={`skeleton-${rand}-${i}`} style={{ width: `${rand}%` }} as=\"li\" />;\n })\n );\n return <ul className={css(\"flex flex-col gap-6\", props.className)}>{items.current}</ul>;\n};\n"],"names":["SkeletonCell","jsx","Skeleton","props","Polymorph","css"],"mappings":";;;;AAIO,MAAMA,IAAe,gBAAAC,EAAC,OAAA,EAAI,WAAU,6CAAA,CAA6C,GAE3EC,IAAW,CAACC,MACrB,gBAAAF,EAACG,GAAA,EAAW,GAAGD,GAAO,IAAIA,EAAM,MAAM,QAAQ,WAAWE,EAAI,iDAAiDF,EAAM,SAAS,EAAA,CAAG;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsx as y } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
const g = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
4
|
+
function d(n, e) {
|
|
5
|
+
if (typeof n == "function")
|
|
6
|
+
return n(e);
|
|
7
|
+
n != null && (n.current = e);
|
|
8
|
+
}
|
|
9
|
+
function C(...n) {
|
|
10
|
+
return (e) => {
|
|
11
|
+
let o = !1;
|
|
12
|
+
const i = n.map((t) => {
|
|
13
|
+
const r = d(t, e);
|
|
14
|
+
return !o && typeof r == "function" && (o = !0), r;
|
|
15
|
+
});
|
|
16
|
+
if (o)
|
|
17
|
+
return () => {
|
|
18
|
+
for (let t = 0; t < i.length; t++) {
|
|
19
|
+
const r = i[t];
|
|
20
|
+
typeof r == "function" ? r() : d(n[t], null);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const a = l[" use ".trim().toString()];
|
|
26
|
+
function E(n) {
|
|
27
|
+
return typeof n == "object" && n !== null && "then" in n;
|
|
28
|
+
}
|
|
29
|
+
function m(n) {
|
|
30
|
+
return n != null && typeof n == "object" && "$$typeof" in n && n.$$typeof === g && "_payload" in n && E(n._payload);
|
|
31
|
+
}
|
|
32
|
+
function h(n) {
|
|
33
|
+
const e = _(n), o = l.forwardRef((i, t) => {
|
|
34
|
+
let { children: r, ...c } = i;
|
|
35
|
+
m(r) && typeof a == "function" && (r = a(r._payload));
|
|
36
|
+
const s = l.Children.toArray(r), f = s.find(b);
|
|
37
|
+
if (f) {
|
|
38
|
+
const u = f.props.children, S = s.map((p) => p === f ? l.Children.count(u) > 1 ? l.Children.only(null) : l.isValidElement(u) ? u.props.children : null : p);
|
|
39
|
+
return /* @__PURE__ */ y(e, { ...c, ref: t, children: l.isValidElement(u) ? l.cloneElement(u, void 0, S) : null });
|
|
40
|
+
}
|
|
41
|
+
return /* @__PURE__ */ y(e, { ...c, ref: t, children: r });
|
|
42
|
+
});
|
|
43
|
+
return o.displayName = `${n}.Slot`, o;
|
|
44
|
+
}
|
|
45
|
+
const V = h("Slot");
|
|
46
|
+
function _(n) {
|
|
47
|
+
const e = l.forwardRef((o, i) => {
|
|
48
|
+
let { children: t, ...r } = o;
|
|
49
|
+
if (m(t) && typeof a == "function" && (t = a(t._payload)), l.isValidElement(t)) {
|
|
50
|
+
const c = j(t), s = P(r, t.props);
|
|
51
|
+
return t.type !== l.Fragment && (s.ref = i ? C(i, c) : c), l.cloneElement(t, s);
|
|
52
|
+
}
|
|
53
|
+
return l.Children.count(t) > 1 ? l.Children.only(null) : null;
|
|
54
|
+
});
|
|
55
|
+
return e.displayName = `${n}.SlotClone`, e;
|
|
56
|
+
}
|
|
57
|
+
const R = /* @__PURE__ */ Symbol("radix.slottable");
|
|
58
|
+
function b(n) {
|
|
59
|
+
return l.isValidElement(n) && typeof n.type == "function" && "__radixId" in n.type && n.type.__radixId === R;
|
|
60
|
+
}
|
|
61
|
+
function P(n, e) {
|
|
62
|
+
const o = { ...e };
|
|
63
|
+
for (const i in e) {
|
|
64
|
+
const t = n[i], r = e[i];
|
|
65
|
+
/^on[A-Z]/.test(i) ? t && r ? o[i] = (...s) => {
|
|
66
|
+
const f = r(...s);
|
|
67
|
+
return t(...s), f;
|
|
68
|
+
} : t && (o[i] = t) : i === "style" ? o[i] = { ...t, ...r } : i === "className" && (o[i] = [t, r].filter(Boolean).join(" "));
|
|
69
|
+
}
|
|
70
|
+
return { ...n, ...o };
|
|
71
|
+
}
|
|
72
|
+
function j(n) {
|
|
73
|
+
let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, o = e && "isReactWarning" in e && e.isReactWarning;
|
|
74
|
+
return o ? n.ref : (e = Object.getOwnPropertyDescriptor(n, "ref")?.get, o = e && "isReactWarning" in e && e.isReactWarning, o ? n.props.ref : n.props.ref || n.ref);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
V as S
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=slot-CRyweuj0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slot-CRyweuj0.js","sources":["../src/components/core/slot.tsx"],"sourcesContent":["import * as React from \"react\";\n\ntype PossibleRef<T> = React.Ref<T> | undefined;\n\nconst REACT_LAZY_TYPE = Symbol.for(\"react.lazy\");\n\nfunction setRef<T>(ref: PossibleRef<T>, value: T) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== undefined) {\n ref.current = value;\n }\n}\n\nfunction composeRefs<T>(...refs: PossibleRef<T>[]): React.RefCallback<T> {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\n\ninterface LazyReactElement extends React.ReactElement {\n $$typeof: typeof REACT_LAZY_TYPE;\n _payload: PromiseLike<Exclude<React.ReactNode, PromiseLike<any>>>;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type Usable<T> = PromiseLike<T> | React.Context<T>;\n\nconst use: typeof React.use | undefined = (React as any)[\" use \".trim().toString()];\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return typeof value === \"object\" && value !== null && \"then\" in value;\n}\n\nfunction isLazyComponent(element: React.ReactNode): element is LazyReactElement {\n return (\n element != null &&\n typeof element === \"object\" &&\n \"$$typeof\" in element &&\n element.$$typeof === REACT_LAZY_TYPE &&\n \"_payload\" in element &&\n isPromiseLike(element._payload)\n );\n}\n\nexport function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? (newElement.props as { children: React.ReactNode }).children : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement) ? React.cloneElement(newElement, undefined, newChildren) : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nexport const Slot = createSlot(\"Slot\");\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\nfunction createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === \"function\") {\n children = use(children._payload);\n }\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\nconst SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\nexport function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst Slottable = createSlottable(\"Slottable\");\n\ntype AnyProps = Record<string, any>;\n\nfunction isSlottable(child: React.ReactNode): child is React.ReactElement<SlottableProps, typeof Slottable> {\n return (\n React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER\n );\n}\n\nfunction mergeProps(slotProps: AnyProps, childProps: AnyProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args: unknown[]) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n\n return { ...slotProps, ...overrideProps };\n}\n\nfunction getElementRef(element: React.ReactElement) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element as any).ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return (element.props as { ref?: React.Ref<unknown> }).ref;\n }\n return (element.props as { ref?: React.Ref<unknown> }).ref || (element as any).ref;\n}\n"],"names":["REACT_LAZY_TYPE","setRef","ref","value","composeRefs","refs","node","hasCleanup","cleanups","cleanup","i","use","React","isPromiseLike","isLazyComponent","element","createSlot","ownerName","SlotClone","createSlotClone","Slot","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","childrenRef","getElementRef","mergeProps","SLOTTABLE_IDENTIFIER","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","getter","mayWarn"],"mappings":"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"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export var rounded = {
|
|
2
|
+
button: "0.55rem",
|
|
3
|
+
pill: "2rem",
|
|
4
|
+
card: "0.75rem",
|
|
5
|
+
full: "9999px",
|
|
6
|
+
};
|
|
7
|
+
export var spacing = {
|
|
8
|
+
base: "1rem",
|
|
9
|
+
hairline: "0.0625rem",
|
|
10
|
+
lg: "1.125rem",
|
|
11
|
+
sm: "0.75rem",
|
|
12
|
+
dialog: "20rem",
|
|
13
|
+
"field-height": "1.5rem",
|
|
14
|
+
"field-label": "0.875rem",
|
|
15
|
+
"input-height": "2.5rem",
|
|
16
|
+
"input-x": "0.5rem",
|
|
17
|
+
"input-y": "0.25rem",
|
|
18
|
+
"input-inline": "0.25rem",
|
|
19
|
+
"input-gap": "0.3rem",
|
|
20
|
+
};
|
|
21
|
+
export var zIndex = {
|
|
22
|
+
wizard: "50",
|
|
23
|
+
normal: "1",
|
|
24
|
+
navbar: "22",
|
|
25
|
+
calendar: "2",
|
|
26
|
+
overlay: "21",
|
|
27
|
+
tooltip: "20",
|
|
28
|
+
floating: "22",
|
|
29
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { rounded, spacing, zIndex } from "./common";
|
|
2
|
+
export var DARK_THEME = {
|
|
3
|
+
name: "dark",
|
|
4
|
+
zIndex: zIndex,
|
|
5
|
+
rounded: rounded,
|
|
6
|
+
spacing: spacing,
|
|
7
|
+
shadow: {
|
|
8
|
+
"shadow-notification": "1px 2px 2px 2px hsla(210, 15%, 20%, 0.15)",
|
|
9
|
+
"shadow-floating": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
10
|
+
"shadow-card": "0px 1px 1px 1px hsla(210, 25%, 20%, 0.1)",
|
|
11
|
+
"shadow-table": "0px 1px 1px 1px hsla(210, 25%, 20%, 0.1)",
|
|
12
|
+
},
|
|
13
|
+
colors: {
|
|
14
|
+
foreground: "hsla(240, 5%, 96%)",
|
|
15
|
+
background: "hsla(240, 10%, 8%)",
|
|
16
|
+
border: "hsla(240, 4%, 16%)",
|
|
17
|
+
disabled: "hsla(240, 4%, 16%)",
|
|
18
|
+
muted: {
|
|
19
|
+
DEFAULT: "hsla(240, 4%, 16%)",
|
|
20
|
+
foreground: "hsla(240, 5%, 65%)",
|
|
21
|
+
subtle: "hsla(240, 5%, 65%)",
|
|
22
|
+
hover: "hsla(240, 4%, 20%)",
|
|
23
|
+
},
|
|
24
|
+
emphasis: {
|
|
25
|
+
foreground: "hsla(199, 89%, 48%)",
|
|
26
|
+
DEFAULT: "hsla(199, 89%, 10%)",
|
|
27
|
+
subtle: "hsla(199, 89%, 15%)",
|
|
28
|
+
hover: "hsla(199, 89%, 40%)",
|
|
29
|
+
},
|
|
30
|
+
primary: {
|
|
31
|
+
foreground: "hsla(240, 6%, 10%)",
|
|
32
|
+
DEFAULT: "hsla(201,49%,54%)",
|
|
33
|
+
subtle: "hsla(201,49%,36%)",
|
|
34
|
+
hover: "hsla(201,49%,22%)",
|
|
35
|
+
},
|
|
36
|
+
secondary: {
|
|
37
|
+
DEFAULT: "hsla(240, 5%, 96%)",
|
|
38
|
+
background: "hsla(240, 4%, 16%)",
|
|
39
|
+
subtle: "hsla(240, 4%, 20%)",
|
|
40
|
+
hover: "hsla(240, 4%, 25%)",
|
|
41
|
+
foreground: "hsla(240, 5%, 96%)",
|
|
42
|
+
},
|
|
43
|
+
info: {
|
|
44
|
+
DEFAULT: "hsla(199, 89%, 48%)",
|
|
45
|
+
subtle: "hsla(199, 89%, 15%)",
|
|
46
|
+
hover: "hsla(199, 89%, 40%)",
|
|
47
|
+
foreground: "hsla(0, 0%, 100%)",
|
|
48
|
+
notification: "hsla(199, 89%, 48%)",
|
|
49
|
+
},
|
|
50
|
+
danger: {
|
|
51
|
+
DEFAULT: "hsla(0, 84%, 60%)",
|
|
52
|
+
subtle: "hsla(0, 84%, 15%)",
|
|
53
|
+
hover: "hsla(0, 84%, 50%)",
|
|
54
|
+
foreground: "hsla(0, 0%, 100%)",
|
|
55
|
+
notification: "hsla(0, 84%, 60%)",
|
|
56
|
+
},
|
|
57
|
+
warn: {
|
|
58
|
+
DEFAULT: "hsla(38, 92%, 50%)",
|
|
59
|
+
subtle: "hsla(38, 92%, 15%)",
|
|
60
|
+
hover: "hsla(38, 92%, 45%)",
|
|
61
|
+
foreground: "hsla(240, 10%, 4%)",
|
|
62
|
+
notification: "hsla(38, 92%, 50%)",
|
|
63
|
+
},
|
|
64
|
+
success: {
|
|
65
|
+
DEFAULT: "hsla(142, 71%, 45%)",
|
|
66
|
+
subtle: "hsla(142, 71%, 15%)",
|
|
67
|
+
hover: "hsla(142, 71%, 40%)",
|
|
68
|
+
foreground: "hsla(240, 10%, 4%)",
|
|
69
|
+
notification: "hsla(142, 71%, 45%)",
|
|
70
|
+
},
|
|
71
|
+
input: {
|
|
72
|
+
border: "hsla(240, 4%, 16%)",
|
|
73
|
+
placeholder: "hsla(240, 5%, 65%)",
|
|
74
|
+
"mask-error": "hsla(0, 84%, 20%)",
|
|
75
|
+
"switch-bg": "hsla(240, 4%, 16%)",
|
|
76
|
+
switch: "hsla(0, 0%, 100%)",
|
|
77
|
+
slider: "hsla(0, 0%, 100%)",
|
|
78
|
+
},
|
|
79
|
+
card: {
|
|
80
|
+
muted: "hsla(240, 4%, 10%)",
|
|
81
|
+
border: "hsla(240, 4%, 11%)",
|
|
82
|
+
background: "hsla(221, 16%, 9%)",
|
|
83
|
+
},
|
|
84
|
+
floating: {
|
|
85
|
+
foreground: "hsla(240, 5%, 96%)",
|
|
86
|
+
background: "hsla(240, 10%, 8%)",
|
|
87
|
+
hover: "hsla(240, 4%, 16%)",
|
|
88
|
+
border: "hsla(240, 4%, 16%)",
|
|
89
|
+
overlay: "hsla(0, 0%, 0%)",
|
|
90
|
+
},
|
|
91
|
+
tooltip: {
|
|
92
|
+
foreground: "hsla(240, 10%, 4%)",
|
|
93
|
+
background: "hsla(0, 0%, 100%)",
|
|
94
|
+
hover: "hsla(0, 0%, 100%)",
|
|
95
|
+
border: "hsla(0, 0%, 100%)",
|
|
96
|
+
overlay: "hsla(0, 0%, 0%)",
|
|
97
|
+
},
|
|
98
|
+
table: {
|
|
99
|
+
header: "hsla(240, 4%, 10%)",
|
|
100
|
+
border: "hsla(240, 4%, 16%)",
|
|
101
|
+
background: "hsla(240, 10%, 4%)",
|
|
102
|
+
},
|
|
103
|
+
button: {
|
|
104
|
+
primary: {
|
|
105
|
+
text: "hsla(221, 52%, 100%)",
|
|
106
|
+
bg: "hsla(201,49%,42%)",
|
|
107
|
+
},
|
|
108
|
+
warn: {
|
|
109
|
+
text: "hsla(240, 10%, 4%)",
|
|
110
|
+
bg: "hsla(38, 92%, 50%)",
|
|
111
|
+
},
|
|
112
|
+
info: {
|
|
113
|
+
text: "hsla(0, 0%, 100%)",
|
|
114
|
+
bg: "hsla(199, 89%, 48%)",
|
|
115
|
+
},
|
|
116
|
+
success: {
|
|
117
|
+
text: "hsla(240, 10%, 4%)",
|
|
118
|
+
bg: "hsla(142, 71%, 45%)",
|
|
119
|
+
},
|
|
120
|
+
danger: {
|
|
121
|
+
text: "hsla(0, 0%, 100%)",
|
|
122
|
+
bg: "hsla(0, 84%, 60%)",
|
|
123
|
+
},
|
|
124
|
+
muted: {
|
|
125
|
+
text: "hsla(240, 5%, 96%)",
|
|
126
|
+
bg: "hsla(240, 4%, 16%)",
|
|
127
|
+
},
|
|
128
|
+
neutral: {
|
|
129
|
+
text: "hsla(240, 5%, 96%)",
|
|
130
|
+
bg: "hsla(240, 4%, 16%)",
|
|
131
|
+
},
|
|
132
|
+
secondary: {
|
|
133
|
+
text: "hsla(240, 10%, 4%)",
|
|
134
|
+
bg: "hsla(0, 0%, 100%)",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
tag: {
|
|
138
|
+
primary: {
|
|
139
|
+
text: "hsla(0, 0%, 100%)",
|
|
140
|
+
bg: "hsla(240, 4%, 20%)",
|
|
141
|
+
},
|
|
142
|
+
warn: {
|
|
143
|
+
text: "hsla(38, 92%, 70%)",
|
|
144
|
+
bg: "hsla(38, 92%, 15%)",
|
|
145
|
+
},
|
|
146
|
+
info: {
|
|
147
|
+
text: "hsla(199, 89%, 70%)",
|
|
148
|
+
bg: "hsla(199, 89%, 15%)",
|
|
149
|
+
},
|
|
150
|
+
success: {
|
|
151
|
+
text: "hsla(142, 71%, 70%)",
|
|
152
|
+
bg: "hsla(142, 71%, 15%)",
|
|
153
|
+
},
|
|
154
|
+
danger: {
|
|
155
|
+
text: "hsla(0, 84%, 70%)",
|
|
156
|
+
bg: "hsla(0, 84%, 15%)",
|
|
157
|
+
},
|
|
158
|
+
neutral: {
|
|
159
|
+
text: "hsla(240, 5%, 96%)",
|
|
160
|
+
bg: "hsla(240, 4%, 16%)",
|
|
161
|
+
},
|
|
162
|
+
secondary: {
|
|
163
|
+
text: "hsla(240, 10%, 4%)",
|
|
164
|
+
bg: "hsla(0, 0%, 100%)",
|
|
165
|
+
},
|
|
166
|
+
muted: {
|
|
167
|
+
text: "hsla(240, 5%, 96%)",
|
|
168
|
+
bg: "hsla(240, 4%, 16%)",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
alert: {
|
|
172
|
+
primary: {
|
|
173
|
+
text: "hsla(199, 89%, 80%)",
|
|
174
|
+
border: "hsla(199, 89%, 25%)",
|
|
175
|
+
bg: "hsla(199, 89%, 12%)",
|
|
176
|
+
},
|
|
177
|
+
warn: {
|
|
178
|
+
bg: "hsla(38, 92%, 12%)",
|
|
179
|
+
border: "hsla(38, 92%, 25%)",
|
|
180
|
+
text: "hsla(38, 92%, 80%)",
|
|
181
|
+
},
|
|
182
|
+
info: {
|
|
183
|
+
text: "hsla(199, 89%, 80%)",
|
|
184
|
+
bg: "hsla(199, 89%, 12%)",
|
|
185
|
+
border: "hsla(199, 89%, 25%)",
|
|
186
|
+
},
|
|
187
|
+
success: {
|
|
188
|
+
text: "hsla(142, 71%, 80%)",
|
|
189
|
+
bg: "hsla(142, 71%, 12%)",
|
|
190
|
+
border: "hsla(142, 71%, 25%)",
|
|
191
|
+
},
|
|
192
|
+
danger: {
|
|
193
|
+
text: "hsla(0, 84%, 80%)",
|
|
194
|
+
bg: "hsla(0, 84%, 12%)",
|
|
195
|
+
border: "hsla(0, 84%, 25%)",
|
|
196
|
+
},
|
|
197
|
+
neutral: {
|
|
198
|
+
text: "hsla(240, 5%, 96%)",
|
|
199
|
+
bg: "hsla(240, 4%, 16%)",
|
|
200
|
+
border: "hsla(240, 4%, 20%)",
|
|
201
|
+
},
|
|
202
|
+
secondary: {
|
|
203
|
+
text: "hsla(240, 10%, 4%)",
|
|
204
|
+
bg: "hsla(0, 0%, 100%)",
|
|
205
|
+
border: "hsla(0, 0%, 100%)",
|
|
206
|
+
},
|
|
207
|
+
muted: {
|
|
208
|
+
bg: "hsla(240, 4%, 16%)",
|
|
209
|
+
border: "hsla(240, 4%, 20%)",
|
|
210
|
+
text: "hsla(240, 5%, 96%)",
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
export var parsers = {
|
|
13
|
+
hex: function (v) { return v; },
|
|
14
|
+
raw: function (v) { return v; },
|
|
15
|
+
hsl: function (v) { return "hsl(".concat(v, ")"); },
|
|
16
|
+
rgb: function (v) { return "rgb(".concat(v, ")"); },
|
|
17
|
+
z: function (_, __, k) { return "var(--z-".concat(k, ")"); },
|
|
18
|
+
hsla: function (v) { return "hsla(".concat(v, ")"); },
|
|
19
|
+
rgba: function (v) { return "rgba(".concat(v, ")"); },
|
|
20
|
+
cssVariable: function (_, __, k) { return "var(--".concat(k, ")"); },
|
|
21
|
+
formatWithVar: function (format) { return function (_, __, v) { return "".concat(format, "(var(--").concat(v, "), <alpha-value>)"); }; },
|
|
22
|
+
};
|
|
23
|
+
export var reduceTokens = function (colors, parse, prefix, append) {
|
|
24
|
+
if (prefix === void 0) { prefix = ""; }
|
|
25
|
+
if (append === void 0) { append = ""; }
|
|
26
|
+
return Object.entries(colors).reduce(function (acc, _a) {
|
|
27
|
+
var key = _a[0], value = _a[1];
|
|
28
|
+
var combine = append === "" ? "".concat(prefix).concat(key) : "".concat(append, "-").concat(key);
|
|
29
|
+
if (typeof value === "string") {
|
|
30
|
+
var k = append === "" ? "".concat(prefix).concat(key) : key;
|
|
31
|
+
return acc.concat(parse(value, k, combine));
|
|
32
|
+
}
|
|
33
|
+
return acc.concat(reduceTokens(value, parse, prefix, combine));
|
|
34
|
+
}, []);
|
|
35
|
+
};
|
|
36
|
+
export var createDesignTokens = function (colors, parse, prefix, append) {
|
|
37
|
+
if (prefix === void 0) { prefix = ""; }
|
|
38
|
+
if (append === void 0) { append = ""; }
|
|
39
|
+
return Object.entries(colors).reduce(function (acc, _a) {
|
|
40
|
+
var _b, _c;
|
|
41
|
+
var key = _a[0], value = _a[1];
|
|
42
|
+
var combine = append === "" ? "".concat(prefix).concat(key) : "".concat(append, "-").concat(key);
|
|
43
|
+
if (typeof value === "string") {
|
|
44
|
+
var k = append === "" ? "".concat(prefix).concat(key) : key;
|
|
45
|
+
return __assign(__assign({}, acc), (_b = {}, _b[k] = parse(value, key, combine), _b));
|
|
46
|
+
}
|
|
47
|
+
return __assign(__assign({}, acc), (_c = {}, _c[key] = createDesignTokens(value, parse, prefix, combine), _c));
|
|
48
|
+
}, {});
|
|
49
|
+
};
|
|
50
|
+
var modifiers = {
|
|
51
|
+
default: function (variables) { return ":root { ".concat(variables, " }"); },
|
|
52
|
+
dark: function (variables) { return "html.dark {".concat(variables, "}"); },
|
|
53
|
+
};
|
|
54
|
+
var createStyleContent = function (tokens, modifiers) {
|
|
55
|
+
var v = modifiers.value || (function (_, s) { return s; });
|
|
56
|
+
var content = tokens.map(function (token) { return "".concat(token.key, ": ").concat(v(token.key, token.value)); }).join(";");
|
|
57
|
+
return modifiers.result(content);
|
|
58
|
+
};
|
|
59
|
+
export var createStyles = {
|
|
60
|
+
default: function (tokens) { return createStyleContent(tokens, { result: modifiers.default }); },
|
|
61
|
+
dark: function (tokens) { return createStyleContent(tokens, { result: modifiers.dark }); },
|
|
62
|
+
};
|
|
63
|
+
var fn = function (p) {
|
|
64
|
+
return function (value, _, key) {
|
|
65
|
+
var r = { key: "--".concat(key), value: "".concat(value) };
|
|
66
|
+
return p ? p(r) : r;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
var zIndexParser = function (t) { return ({ key: t.key.replace(/^--/, "--z-"), value: t.value }); };
|
|
70
|
+
var createTokens = function (theme, map) {
|
|
71
|
+
var _a;
|
|
72
|
+
var colors = reduceTokens(theme.colors, fn(map === null || map === void 0 ? void 0 : map.colors));
|
|
73
|
+
var spacing = reduceTokens(theme.spacing, fn(map === null || map === void 0 ? void 0 : map.spacing));
|
|
74
|
+
var rounded = reduceTokens(theme.rounded, fn(map === null || map === void 0 ? void 0 : map.rounded));
|
|
75
|
+
var shadow = reduceTokens(theme.shadow, fn(map === null || map === void 0 ? void 0 : map.rounded));
|
|
76
|
+
var zIndex = reduceTokens(theme.zIndex, fn((_a = map === null || map === void 0 ? void 0 : map.zIndex) !== null && _a !== void 0 ? _a : zIndexParser));
|
|
77
|
+
var customTokens = theme.custom ? reduceTokens(theme.custom, fn(map === null || map === void 0 ? void 0 : map.customTokens)) : [];
|
|
78
|
+
return colors.concat(spacing, rounded, customTokens, zIndex, shadow);
|
|
79
|
+
};
|
|
80
|
+
export var createTheme = function (theme, name) {
|
|
81
|
+
return createStyleContent(createTokens(theme), {
|
|
82
|
+
result: function (variables) { return "html".concat(name ? ".".concat(name) : "", " {").concat(variables, "}"); },
|
|
83
|
+
value: function (_, v) { return v.replace("hsla(", "").replace(")", ""); },
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
export var createCssProperties = function (theme, map) {
|
|
87
|
+
var tokens = createTokens(theme, map);
|
|
88
|
+
return tokens.reduce(function (acc, el) {
|
|
89
|
+
var _a;
|
|
90
|
+
return (__assign(__assign({}, acc), (_a = {}, _a[el.key] = el.value, _a)));
|
|
91
|
+
}, {});
|
|
92
|
+
};
|
|
93
|
+
export var createTokenStyles = function (theme, map) {
|
|
94
|
+
return createStyleContent(createTokens(theme, map), {
|
|
95
|
+
result: function (variables) { return "html".concat((map === null || map === void 0 ? void 0 : map.name) ? ".".concat(map.name) : "", " {").concat(variables, "}"); },
|
|
96
|
+
value: function (_, v) { return v; },
|
|
97
|
+
});
|
|
98
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { rounded, spacing, zIndex } from "./common";
|
|
2
|
+
export var LIGHT_THEME = {
|
|
3
|
+
rounded: rounded,
|
|
4
|
+
spacing: spacing,
|
|
5
|
+
name: "light",
|
|
6
|
+
shadow: {
|
|
7
|
+
"shadow-notification": "1px 2px 2px 2px hsla(210, 25%, 40%, 0.15)",
|
|
8
|
+
"shadow-floating": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
9
|
+
"shadow-card": "0px 1px 2px 1px hsla(210, 25%, 20%, 0.1)",
|
|
10
|
+
"shadow-table": "0px 1px 1px 1px hsla(210, 0%, 0%, 0.1)",
|
|
11
|
+
},
|
|
12
|
+
zIndex: zIndex,
|
|
13
|
+
colors: {
|
|
14
|
+
foreground: "hsla(221, 15%, 23%)",
|
|
15
|
+
background: "hsla(0, 0%, 100%)",
|
|
16
|
+
border: "hsla(240, 6%, 90%)",
|
|
17
|
+
muted: {
|
|
18
|
+
DEFAULT: "hsla(240, 5%, 96%)",
|
|
19
|
+
foreground: "hsla(240, 4%, 46%)",
|
|
20
|
+
subtle: "hsla(240, 4%, 46%)",
|
|
21
|
+
hover: "hsla(240, 5%, 96%)",
|
|
22
|
+
},
|
|
23
|
+
disabled: "hsla(240, 5%, 96%)",
|
|
24
|
+
emphasis: {
|
|
25
|
+
foreground: "hsla(199, 89%, 48%)",
|
|
26
|
+
DEFAULT: "hsla(199, 89%, 96%)",
|
|
27
|
+
subtle: "hsla(199, 89%, 92%)",
|
|
28
|
+
hover: "hsla(199, 89%, 40%)",
|
|
29
|
+
},
|
|
30
|
+
primary: {
|
|
31
|
+
foreground: "hsla(240, 6%, 10%)",
|
|
32
|
+
DEFAULT: "hsla(201,49%,54%)",
|
|
33
|
+
subtle: "hsla(201,49%,36%)",
|
|
34
|
+
hover: "hsla(201,49%,22%)",
|
|
35
|
+
},
|
|
36
|
+
secondary: {
|
|
37
|
+
background: "hsla(240, 5%, 96%)",
|
|
38
|
+
DEFAULT: "hsla(240, 6%, 10%)",
|
|
39
|
+
subtle: "hsla(240, 5%, 96%)",
|
|
40
|
+
hover: "hsla(240, 6%, 15%)",
|
|
41
|
+
foreground: "hsla(0, 0%, 100%)",
|
|
42
|
+
},
|
|
43
|
+
info: {
|
|
44
|
+
DEFAULT: "hsla(199, 89%, 48%)",
|
|
45
|
+
subtle: "hsla(199, 89%, 96%)",
|
|
46
|
+
hover: "hsla(199, 89%, 40%)",
|
|
47
|
+
foreground: "hsla(0, 0%, 100%)",
|
|
48
|
+
notification: "hsla(199, 89%, 48%)",
|
|
49
|
+
},
|
|
50
|
+
danger: {
|
|
51
|
+
DEFAULT: "hsla(0, 84%, 60%)",
|
|
52
|
+
subtle: "hsla(0, 84%, 96%)",
|
|
53
|
+
hover: "hsla(0, 84%, 50%)",
|
|
54
|
+
foreground: "hsla(0, 0%, 100%)",
|
|
55
|
+
notification: "hsla(0, 84%, 60%)",
|
|
56
|
+
},
|
|
57
|
+
warn: {
|
|
58
|
+
DEFAULT: "hsla(38, 92%, 50%)",
|
|
59
|
+
subtle: "hsla(38, 92%, 96%)",
|
|
60
|
+
hover: "hsla(38, 92%, 45%)",
|
|
61
|
+
foreground: "hsla(0, 0%, 100%)",
|
|
62
|
+
notification: "hsla(38, 92%, 50%)",
|
|
63
|
+
},
|
|
64
|
+
success: {
|
|
65
|
+
DEFAULT: "hsla(142, 71%, 45%)",
|
|
66
|
+
subtle: "hsla(142, 71%, 96%)",
|
|
67
|
+
hover: "hsla(142, 71%, 40%)",
|
|
68
|
+
foreground: "hsla(0, 0%, 100%)",
|
|
69
|
+
notification: "hsla(142, 71%, 45%)",
|
|
70
|
+
},
|
|
71
|
+
input: {
|
|
72
|
+
border: "hsla(240, 6%, 90%)",
|
|
73
|
+
placeholder: "hsla(240, 4%, 46%)",
|
|
74
|
+
"mask-error": "hsla(0, 84%, 96%)",
|
|
75
|
+
"switch-bg": "hsla(240, 6%, 90%)",
|
|
76
|
+
switch: "hsla(0, 0%, 100%)",
|
|
77
|
+
slider: "hsla(199, 89%, 48%)",
|
|
78
|
+
},
|
|
79
|
+
card: {
|
|
80
|
+
muted: "hsla(240, 5%, 96%)",
|
|
81
|
+
border: "hsla(240, 6%, 90%)",
|
|
82
|
+
background: "hsla(0, 0%, 100%)",
|
|
83
|
+
},
|
|
84
|
+
floating: {
|
|
85
|
+
foreground: "hsla(240, 10%, 4%)",
|
|
86
|
+
background: "hsla(0, 0%, 100%)",
|
|
87
|
+
hover: "hsla(240, 5%, 96%)",
|
|
88
|
+
border: "hsla(240, 6%, 90%)",
|
|
89
|
+
overlay: "hsla(240, 10%, 4%)",
|
|
90
|
+
},
|
|
91
|
+
tooltip: {
|
|
92
|
+
foreground: "hsla(0, 0%, 100%)",
|
|
93
|
+
background: "hsla(240, 10%, 4%)",
|
|
94
|
+
hover: "hsla(240, 10%, 4%)",
|
|
95
|
+
border: "hsla(240, 10%, 4%)",
|
|
96
|
+
overlay: "hsla(0, 0%, 0%)",
|
|
97
|
+
},
|
|
98
|
+
table: {
|
|
99
|
+
header: "hsla(240, 5%, 96%)",
|
|
100
|
+
background: "hsla(0, 0%, 100%)",
|
|
101
|
+
border: "hsla(240, 6%, 90%)",
|
|
102
|
+
},
|
|
103
|
+
button: {
|
|
104
|
+
muted: {
|
|
105
|
+
bg: "hsla(240, 5%, 96%)",
|
|
106
|
+
text: "hsla(240, 6%, 10%)",
|
|
107
|
+
},
|
|
108
|
+
primary: {
|
|
109
|
+
text: "hsla(0, 0%, 100%)",
|
|
110
|
+
bg: "hsla(201,49%,54%)",
|
|
111
|
+
},
|
|
112
|
+
warn: {
|
|
113
|
+
bg: "hsla(38, 92%, 50%)",
|
|
114
|
+
text: "hsla(0, 0%, 100%)",
|
|
115
|
+
},
|
|
116
|
+
info: {
|
|
117
|
+
text: "hsla(0, 0%, 100%)",
|
|
118
|
+
bg: "hsla(199, 89%, 48%)",
|
|
119
|
+
},
|
|
120
|
+
success: {
|
|
121
|
+
text: "hsla(0, 0%, 100%)",
|
|
122
|
+
bg: "hsla(142, 71%, 45%)",
|
|
123
|
+
},
|
|
124
|
+
danger: {
|
|
125
|
+
text: "hsla(0, 0%, 100%)",
|
|
126
|
+
bg: "hsla(0, 84%, 60%)",
|
|
127
|
+
},
|
|
128
|
+
neutral: {
|
|
129
|
+
text: "hsla(240, 6%, 10%)",
|
|
130
|
+
bg: "hsla(240, 5%, 96%)",
|
|
131
|
+
},
|
|
132
|
+
secondary: {
|
|
133
|
+
text: "hsla(0, 0%, 100%)",
|
|
134
|
+
bg: "hsla(240, 6%, 10%)",
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
tag: {
|
|
138
|
+
muted: {
|
|
139
|
+
bg: "hsla(240, 5%, 96%)",
|
|
140
|
+
text: "hsla(240, 4%, 46%)",
|
|
141
|
+
},
|
|
142
|
+
primary: {
|
|
143
|
+
text: "hsla(199, 89%, 48%)",
|
|
144
|
+
bg: "hsla(199, 89%, 96%)",
|
|
145
|
+
},
|
|
146
|
+
warn: {
|
|
147
|
+
bg: "hsla(38, 92%, 96%)",
|
|
148
|
+
text: "hsla(38, 92%, 40%)",
|
|
149
|
+
},
|
|
150
|
+
info: {
|
|
151
|
+
text: "hsla(199, 89%, 40%)",
|
|
152
|
+
bg: "hsla(199, 89%, 96%)",
|
|
153
|
+
},
|
|
154
|
+
success: {
|
|
155
|
+
text: "hsla(142, 71%, 35%)",
|
|
156
|
+
bg: "hsla(142, 71%, 96%)",
|
|
157
|
+
},
|
|
158
|
+
danger: {
|
|
159
|
+
text: "hsla(0, 84%, 45%)",
|
|
160
|
+
bg: "hsla(0, 84%, 96%)",
|
|
161
|
+
},
|
|
162
|
+
neutral: {
|
|
163
|
+
text: "hsla(240, 6%, 10%)",
|
|
164
|
+
bg: "hsla(240, 5%, 96%)",
|
|
165
|
+
},
|
|
166
|
+
secondary: {
|
|
167
|
+
text: "hsla(0, 0%, 100%)",
|
|
168
|
+
bg: "hsla(240, 6%, 10%)",
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
alert: {
|
|
172
|
+
muted: {
|
|
173
|
+
bg: "hsla(240, 5%, 96%)",
|
|
174
|
+
text: "hsla(240, 6%, 10%)",
|
|
175
|
+
border: "hsla(240, 6%, 90%)",
|
|
176
|
+
},
|
|
177
|
+
primary: {
|
|
178
|
+
text: "hsla(199, 89%, 40%)",
|
|
179
|
+
border: "hsla(199, 89%, 90%)",
|
|
180
|
+
bg: "hsla(199, 89%, 98%)",
|
|
181
|
+
},
|
|
182
|
+
warn: {
|
|
183
|
+
bg: "hsla(38, 92%, 98%)",
|
|
184
|
+
text: "hsla(38, 92%, 35%)",
|
|
185
|
+
border: "hsla(38, 92%, 90%)",
|
|
186
|
+
},
|
|
187
|
+
info: {
|
|
188
|
+
text: "hsla(199, 89%, 35%)",
|
|
189
|
+
bg: "hsla(199, 89%, 98%)",
|
|
190
|
+
border: "hsla(199, 89%, 90%)",
|
|
191
|
+
},
|
|
192
|
+
success: {
|
|
193
|
+
text: "hsla(142, 71%, 30%)",
|
|
194
|
+
bg: "hsla(142, 71%, 98%)",
|
|
195
|
+
border: "hsla(142, 71%, 90%)",
|
|
196
|
+
},
|
|
197
|
+
danger: {
|
|
198
|
+
text: "hsla(0, 84%, 40%)",
|
|
199
|
+
bg: "hsla(0, 84%, 98%)",
|
|
200
|
+
border: "hsla(0, 84%, 90%)",
|
|
201
|
+
},
|
|
202
|
+
neutral: {
|
|
203
|
+
text: "hsla(240, 6%, 10%)",
|
|
204
|
+
bg: "hsla(240, 5%, 96%)",
|
|
205
|
+
border: "hsla(240, 6%, 90%)",
|
|
206
|
+
},
|
|
207
|
+
secondary: {
|
|
208
|
+
text: "hsla(0, 0%, 100%)",
|
|
209
|
+
bg: "hsla(240, 6%, 10%)",
|
|
210
|
+
border: "hsla(240, 6%, 10%)",
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
};
|