@lablup/ui-common 0.1.0-alpha.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 +202 -0
- package/NOTICE +10 -0
- package/README.md +145 -0
- package/dist/assets/components/Badge/Badge.css +1 -0
- package/dist/assets/components/BaseCard/BaseCard.css +1 -0
- package/dist/assets/components/Button/Button.css +1 -0
- package/dist/assets/components/DataTable/DataTable.css +1 -0
- package/dist/assets/components/Drawer/Drawer.css +1 -0
- package/dist/assets/components/EmptyState/EmptyState.css +1 -0
- package/dist/assets/components/ErrorState/ErrorState.css +1 -0
- package/dist/assets/components/PageHeader/PageHeader.css +1 -0
- package/dist/assets/components/PageLayout/PageLayout.css +1 -0
- package/dist/assets/components/ProgressBar/ProgressBar.css +1 -0
- package/dist/assets/components/Skeleton/Skeleton.css +1 -0
- package/dist/assets/components/Skeleton/SkeletonCard.css +1 -0
- package/dist/assets/components/Skeleton/SkeletonChart.css +1 -0
- package/dist/assets/components/Skeleton/SkeletonRow.css +1 -0
- package/dist/assets/components/Skeleton/SkeletonText.css +1 -0
- package/dist/assets/components/SmoothHeight/SmoothHeight.css +1 -0
- package/dist/assets/components/StatCard/StatCard.css +1 -0
- package/dist/assets/components/StatusTag/StatusTag.css +1 -0
- package/dist/assets/components/Tabs/Tabs.css +1 -0
- package/dist/assets/components/Tooltip/Tooltip.css +1 -0
- package/dist/components/Badge/Badge.d.ts +7 -0
- package/dist/components/Badge/Badge2.js +19 -0
- package/dist/components/Badge/Badge2.js.map +1 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/BaseCard/BaseCard.d.ts +57 -0
- package/dist/components/BaseCard/BaseCard2.js +36 -0
- package/dist/components/BaseCard/BaseCard2.js.map +1 -0
- package/dist/components/BaseCard/index.d.ts +2 -0
- package/dist/components/BaseCard/index.js +2 -0
- package/dist/components/Button/Button.d.ts +54 -0
- package/dist/components/Button/Button2.js +74 -0
- package/dist/components/Button/Button2.js.map +1 -0
- package/dist/components/Button/index.d.ts +5 -0
- package/dist/components/Button/index.js +2 -0
- package/dist/components/DataTable/DataTable.d.ts +133 -0
- package/dist/components/DataTable/DataTable2.js +276 -0
- package/dist/components/DataTable/DataTable2.js.map +1 -0
- package/dist/components/DataTable/index.d.ts +2 -0
- package/dist/components/DataTable/index.js +2 -0
- package/dist/components/Drawer/Drawer.d.ts +25 -0
- package/dist/components/Drawer/Drawer2.js +106 -0
- package/dist/components/Drawer/Drawer2.js.map +1 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/Drawer/index.js +2 -0
- package/dist/components/EmptyState/EmptyState.d.ts +45 -0
- package/dist/components/EmptyState/EmptyState.example.d.ts +8 -0
- package/dist/components/EmptyState/EmptyState2.js +78 -0
- package/dist/components/EmptyState/EmptyState2.js.map +1 -0
- package/dist/components/EmptyState/illustrations.d.ts +51 -0
- package/dist/components/EmptyState/illustrations.js +571 -0
- package/dist/components/EmptyState/illustrations.js.map +1 -0
- package/dist/components/EmptyState/index.d.ts +5 -0
- package/dist/components/EmptyState/index.js +2 -0
- package/dist/components/ErrorState/ErrorState.d.ts +25 -0
- package/dist/components/ErrorState/ErrorState.example.d.ts +46 -0
- package/dist/components/ErrorState/ErrorState2.js +58 -0
- package/dist/components/ErrorState/ErrorState2.js.map +1 -0
- package/dist/components/ErrorState/index.d.ts +5 -0
- package/dist/components/ErrorState/index.js +2 -0
- package/dist/components/PageHeader/PageHeader.d.ts +18 -0
- package/dist/components/PageHeader/PageHeader2.js +42 -0
- package/dist/components/PageHeader/PageHeader2.js.map +1 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/PageHeader/index.js +2 -0
- package/dist/components/PageLayout/PageLayout.d.ts +11 -0
- package/dist/components/PageLayout/PageLayout2.js +19 -0
- package/dist/components/PageLayout/PageLayout2.js.map +1 -0
- package/dist/components/PageLayout/index.d.ts +2 -0
- package/dist/components/PageLayout/index.js +2 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +22 -0
- package/dist/components/ProgressBar/ProgressBar2.js +36 -0
- package/dist/components/ProgressBar/ProgressBar2.js.map +1 -0
- package/dist/components/ProgressBar/index.d.ts +2 -0
- package/dist/components/ProgressBar/index.js +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +25 -0
- package/dist/components/Skeleton/Skeleton2.js +26 -0
- package/dist/components/Skeleton/Skeleton2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonCard.d.ts +18 -0
- package/dist/components/Skeleton/SkeletonCard2.js +73 -0
- package/dist/components/Skeleton/SkeletonCard2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonChart.d.ts +23 -0
- package/dist/components/Skeleton/SkeletonChart2.js +66 -0
- package/dist/components/Skeleton/SkeletonChart2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonRow.d.ts +22 -0
- package/dist/components/Skeleton/SkeletonRow2.js +47 -0
- package/dist/components/Skeleton/SkeletonRow2.js.map +1 -0
- package/dist/components/Skeleton/SkeletonText.d.ts +20 -0
- package/dist/components/Skeleton/SkeletonText2.js +26 -0
- package/dist/components/Skeleton/SkeletonText2.js.map +1 -0
- package/dist/components/Skeleton/index.d.ts +15 -0
- package/dist/components/Skeleton/index.js +6 -0
- package/dist/components/SmoothHeight/SmoothHeight.d.ts +9 -0
- package/dist/components/SmoothHeight/SmoothHeight2.js +38 -0
- package/dist/components/SmoothHeight/SmoothHeight2.js.map +1 -0
- package/dist/components/SmoothHeight/index.d.ts +2 -0
- package/dist/components/SmoothHeight/index.js +2 -0
- package/dist/components/StatCard/StatCard.d.ts +59 -0
- package/dist/components/StatCard/StatCard2.js +111 -0
- package/dist/components/StatCard/StatCard2.js.map +1 -0
- package/dist/components/StatCard/formatters.d.ts +12 -0
- package/dist/components/StatCard/formatters.js +8 -0
- package/dist/components/StatCard/formatters.js.map +1 -0
- package/dist/components/StatCard/index.d.ts +3 -0
- package/dist/components/StatCard/index.js +3 -0
- package/dist/components/StatusTag/StatusTag.d.ts +38 -0
- package/dist/components/StatusTag/StatusTag2.js +44 -0
- package/dist/components/StatusTag/StatusTag2.js.map +1 -0
- package/dist/components/StatusTag/index.d.ts +2 -0
- package/dist/components/StatusTag/index.js +2 -0
- package/dist/components/Tabs/Tabs.d.ts +107 -0
- package/dist/components/Tabs/Tabs2.js +430 -0
- package/dist/components/Tabs/Tabs2.js.map +1 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Tabs/index.js +3 -0
- package/dist/components/Tabs/tabTags.d.ts +9 -0
- package/dist/components/Tabs/tabTags.js +11 -0
- package/dist/components/Tabs/tabTags.js.map +1 -0
- package/dist/components/Tooltip/Tooltip.d.ts +16 -0
- package/dist/components/Tooltip/Tooltip2.js +67 -0
- package/dist/components/Tooltip/Tooltip2.js.map +1 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/usePrefersReducedMotion.d.ts +12 -0
- package/dist/hooks/usePrefersReducedMotion.js +22 -0
- package/dist/hooks/usePrefersReducedMotion.js.map +1 -0
- package/dist/icons/AlertCircleIcon.d.ts +11 -0
- package/dist/icons/AlertCircleIcon.js +26 -0
- package/dist/icons/AlertCircleIcon.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.js +24 -0
- package/dist/styles/base.css +169 -0
- package/dist/styles/themes/bliss-dark.css +123 -0
- package/dist/styles/themes/bliss-light.css +123 -0
- package/dist/styles/themes/glass-dark.css +124 -0
- package/dist/styles/themes/glass-light.css +125 -0
- package/dist/styles/themes/orange-dark.css +70 -0
- package/dist/styles/themes/orange-light.css +70 -0
- package/dist/styles/themes/reverie-dark.css +104 -0
- package/dist/styles/themes/reverie-light.css +104 -0
- package/dist/styles/themes/stained-dark.css +80 -0
- package/dist/styles/themes/stained-light.css +80 -0
- package/package.json +87 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BadgeProps } from '../Badge';
|
|
2
|
+
/** Guide tag types — displayed as a small badge after the label */
|
|
3
|
+
export type TabTagType = "required" | "recommended" | "beta" | "experimental";
|
|
4
|
+
/** English default label for every {@link TabTagType}. */
|
|
5
|
+
export type TabTagLabels = Record<TabTagType, string>;
|
|
6
|
+
/** Mapping of tag type to badge variant */
|
|
7
|
+
export declare const TAG_CONFIG: Record<TabTagType, {
|
|
8
|
+
variant: BadgeProps["variant"];
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//#region src/components/Tabs/tabTags.ts
|
|
2
|
+
var e = {
|
|
3
|
+
required: { variant: "warning" },
|
|
4
|
+
recommended: { variant: "primary" },
|
|
5
|
+
beta: { variant: "info" },
|
|
6
|
+
experimental: { variant: "warning" }
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { e as TAG_CONFIG };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=tabTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tabTags.js","names":[],"sources":["../../../src/components/Tabs/tabTags.ts"],"sourcesContent":["/**\n * Tag label types and badge-variant configuration for the Tabs component.\n *\n * Used to display guide badge labels (Beta, Experimental, Required, Recommended)\n * next to tab labels. The label text itself is supplied by the consumer via\n * `Tabs`' `tagLabels` prop (see `TabTagLabels`) — this module only carries the\n * presentation mapping from tag type to badge variant.\n */\n\nimport type { BadgeProps } from \"../Badge\";\n\n/** Guide tag types — displayed as a small badge after the label */\nexport type TabTagType = \"required\" | \"recommended\" | \"beta\" | \"experimental\";\n\n/** English default label for every {@link TabTagType}. */\nexport type TabTagLabels = Record<TabTagType, string>;\n\n/** Mapping of tag type to badge variant */\nexport const TAG_CONFIG: Record<TabTagType, { variant: BadgeProps[\"variant\"] }> = {\n required: { variant: \"warning\" },\n recommended: { variant: \"primary\" },\n beta: { variant: \"info\" },\n experimental: { variant: \"warning\" },\n};\n"],"mappings":";AAkBA,IAAa,IAAqE;CAChF,UAAU,EAAE,SAAS,UAAU;CAC/B,aAAa,EAAE,SAAS,UAAU;CAClC,MAAM,EAAE,SAAS,OAAO;CACxB,cAAc,EAAE,SAAS,UAAU;AACrC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
/** Tooltip content - can be string or ReactNode */
|
|
4
|
+
content: ReactNode;
|
|
5
|
+
/** Children to wrap with tooltip (trigger element) */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Additional class name for the wrapper */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Additional class name for the tooltip content */
|
|
10
|
+
contentClassName?: string;
|
|
11
|
+
/** Custom ID for the tooltip (for aria-describedby association) */
|
|
12
|
+
tooltipId?: string;
|
|
13
|
+
/** Tab index for the wrapper. Use -1 when wrapping already-focusable elements like buttons. Defaults to 0. */
|
|
14
|
+
tabIndex?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function Tooltip({ content, children, className, contentClassName, tooltipId, tabIndex, }: TooltipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import { useCallback as e, useEffect as t, useId as n, useRef as r, useState as i } from "react";
|
|
3
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
4
|
+
import { createPortal as s } from "react-dom";
|
|
5
|
+
//#region src/components/Tooltip/Tooltip.tsx
|
|
6
|
+
function c({ content: c, children: l, className: u, contentClassName: d, tooltipId: f, tabIndex: p = 0 }) {
|
|
7
|
+
let [m, h] = i(!1), [g, _] = i(null), v = r(null), y = r(null), b = r(!0), x = n(), S = f ?? `tooltip-${x}`;
|
|
8
|
+
t(() => (b.current = !0, () => {
|
|
9
|
+
b.current = !1;
|
|
10
|
+
}), []), t(() => {
|
|
11
|
+
let e = y.current;
|
|
12
|
+
if (!e) return;
|
|
13
|
+
let t = () => {
|
|
14
|
+
b.current && h(!0);
|
|
15
|
+
}, n = () => {
|
|
16
|
+
b.current && (h(!1), _(null));
|
|
17
|
+
};
|
|
18
|
+
return e.addEventListener("focusin", t), e.addEventListener("focusout", n), () => {
|
|
19
|
+
e.removeEventListener("focusin", t), e.removeEventListener("focusout", n);
|
|
20
|
+
};
|
|
21
|
+
}, []), t(() => {
|
|
22
|
+
if (!m || !y.current || !b.current) return;
|
|
23
|
+
let e = y.current.getBoundingClientRect();
|
|
24
|
+
requestAnimationFrame(() => {
|
|
25
|
+
if (!b.current || !v.current) return;
|
|
26
|
+
let t = v.current.getBoundingClientRect(), n = e.top, r = window.innerHeight - e.bottom, i = t.height, a = n < i + 10 && r > n ? "bottom" : "top", o = e.left + e.width / 2, s = t.width, c = o - s / 2, l = window.innerWidth;
|
|
27
|
+
c + s > l - 16 && (c = l - s - 16), c < 16 && (c = 16);
|
|
28
|
+
let u;
|
|
29
|
+
u = a === "top" ? e.top - i - 8 : e.bottom + 8, _({
|
|
30
|
+
top: u,
|
|
31
|
+
left: c,
|
|
32
|
+
placement: a
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
}, [m]);
|
|
36
|
+
let C = e(() => {
|
|
37
|
+
h(!0);
|
|
38
|
+
}, []), w = e(() => {
|
|
39
|
+
h(!1), _(null);
|
|
40
|
+
}, []), T = m && /* @__PURE__ */ a("div", {
|
|
41
|
+
ref: v,
|
|
42
|
+
id: S,
|
|
43
|
+
className: `tooltip__content tooltip__content--${g?.placement ?? "top"} ${d ?? ""}`,
|
|
44
|
+
style: g ? {
|
|
45
|
+
top: `${String(g.top)}px`,
|
|
46
|
+
left: `${String(g.left)}px`
|
|
47
|
+
} : { visibility: "hidden" },
|
|
48
|
+
role: "tooltip",
|
|
49
|
+
children: typeof c == "string" ? /* @__PURE__ */ a("p", {
|
|
50
|
+
className: "tooltip__text",
|
|
51
|
+
children: c
|
|
52
|
+
}) : c
|
|
53
|
+
});
|
|
54
|
+
return /* @__PURE__ */ o("div", {
|
|
55
|
+
ref: y,
|
|
56
|
+
className: `tooltip__wrapper ${u ?? ""}`,
|
|
57
|
+
onMouseEnter: C,
|
|
58
|
+
onMouseLeave: w,
|
|
59
|
+
tabIndex: p,
|
|
60
|
+
"aria-describedby": m ? S : void 0,
|
|
61
|
+
children: [l, T && s(T, document.body)]
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
export { c as Tooltip };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=Tooltip2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tooltip2.js","names":[],"sources":["../../../src/components/Tooltip/Tooltip.tsx"],"sourcesContent":["/**\n * Tooltip Component\n *\n * A reusable tooltip component that displays content on hover.\n * Supports both simple text and complex ReactNode content.\n *\n * Accessibility:\n * - Shows on mouse hover and keyboard focus (WCAG 1.4.13)\n * - Uses role=\"tooltip\" for screen readers\n * - Accessible via keyboard navigation\n */\n\nimport { useState, useRef, useEffect, useCallback, useId, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport \"./Tooltip.css\";\n\nexport interface TooltipProps {\n /** Tooltip content - can be string or ReactNode */\n content: ReactNode;\n /** Children to wrap with tooltip (trigger element) */\n children: ReactNode;\n /** Additional class name for the wrapper */\n className?: string;\n /** Additional class name for the tooltip content */\n contentClassName?: string;\n /** Custom ID for the tooltip (for aria-describedby association) */\n tooltipId?: string;\n /** Tab index for the wrapper. Use -1 when wrapping already-focusable elements like buttons. Defaults to 0. */\n tabIndex?: number;\n}\n\ninterface TooltipPosition {\n top: number;\n left: number;\n placement: \"top\" | \"bottom\";\n}\n\nexport function Tooltip({\n content,\n children,\n className,\n contentClassName,\n tooltipId,\n tabIndex = 0,\n}: TooltipProps) {\n const [isVisible, setIsVisible] = useState(false);\n const [tooltipPosition, setTooltipPosition] = useState<TooltipPosition | null>(null);\n const tooltipRef = useRef<HTMLDivElement>(null);\n const wrapperRef = useRef<HTMLDivElement>(null);\n const isMountedRef = useRef(true);\n const generatedId = useId();\n const effectiveTooltipId = tooltipId ?? `tooltip-${generatedId}`;\n\n // Track mount state\n useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n\n // Handle focus events using focusin/focusout which bubble from child elements\n // This ensures tooltips show when keyboard focus moves to children (WCAG 1.4.13)\n useEffect(() => {\n const wrapper = wrapperRef.current;\n if (!wrapper) return;\n\n // focusin/focusout bubble from child elements, unlike focus/blur\n const handleFocusIn = () => {\n if (isMountedRef.current) {\n setIsVisible(true);\n }\n };\n\n const handleFocusOut = () => {\n if (isMountedRef.current) {\n setIsVisible(false);\n setTooltipPosition(null);\n }\n };\n\n wrapper.addEventListener(\"focusin\", handleFocusIn);\n wrapper.addEventListener(\"focusout\", handleFocusOut);\n\n return () => {\n wrapper.removeEventListener(\"focusin\", handleFocusIn);\n wrapper.removeEventListener(\"focusout\", handleFocusOut);\n };\n }, []);\n\n // Calculate tooltip position based on available space using fixed positioning\n useEffect(() => {\n if (!isVisible || !wrapperRef.current) return;\n if (!isMountedRef.current) return;\n\n const wrapperRect = wrapperRef.current.getBoundingClientRect();\n\n // Use requestAnimationFrame to ensure DOM is updated\n requestAnimationFrame(() => {\n if (!isMountedRef.current || !tooltipRef.current) return;\n\n const tooltipRect = tooltipRef.current.getBoundingClientRect();\n const spaceAbove = wrapperRect.top;\n const spaceBelow = window.innerHeight - wrapperRect.bottom;\n\n const tooltipHeight = tooltipRect.height;\n const margin = 10;\n\n // Determine placement\n const placement: \"top\" | \"bottom\" =\n spaceAbove < tooltipHeight + margin && spaceBelow > spaceAbove\n ? \"bottom\"\n : \"top\";\n\n // Calculate left position (center on wrapper, but ensure it stays within viewport)\n const wrapperCenter = wrapperRect.left + wrapperRect.width / 2;\n const tooltipWidth = tooltipRect.width;\n let left = wrapperCenter - tooltipWidth / 2;\n const viewportWidth = window.innerWidth;\n\n // Keep tooltip within viewport bounds\n if (left + tooltipWidth > viewportWidth - 16) {\n left = viewportWidth - tooltipWidth - 16;\n }\n if (left < 16) {\n left = 16;\n }\n\n // Calculate top position\n let top: number;\n if (placement === \"top\") {\n top = wrapperRect.top - tooltipHeight - 8;\n } else {\n top = wrapperRect.bottom + 8;\n }\n\n setTooltipPosition({ top, left, placement });\n });\n }, [isVisible]);\n\n const handleShow = useCallback(() => {\n setIsVisible(true);\n }, []);\n\n const handleHide = useCallback(() => {\n setIsVisible(false);\n setTooltipPosition(null);\n }, []);\n\n const tooltipElement = isVisible && (\n <div\n ref={tooltipRef}\n id={effectiveTooltipId}\n className={`tooltip__content tooltip__content--${tooltipPosition?.placement ?? \"top\"} ${contentClassName ?? \"\"}`}\n style={\n tooltipPosition\n ? {\n top: `${String(tooltipPosition.top)}px`,\n left: `${String(tooltipPosition.left)}px`,\n }\n : { visibility: \"hidden\" }\n }\n role=\"tooltip\"\n >\n {typeof content === \"string\" ? (\n <p className=\"tooltip__text\">{content}</p>\n ) : (\n content\n )}\n </div>\n );\n\n return (\n <div\n ref={wrapperRef}\n className={`tooltip__wrapper ${className ?? \"\"}`}\n onMouseEnter={handleShow}\n onMouseLeave={handleHide}\n tabIndex={tabIndex}\n aria-describedby={isVisible ? effectiveTooltipId : undefined}\n >\n {children}\n {tooltipElement && createPortal(tooltipElement, document.body)}\n </div>\n );\n}\n"],"mappings":";;;;;AAqCA,SAAgB,EAAQ,EACtB,YACA,aACA,cACA,qBACA,cACA,cAAW,KACI;CACf,IAAM,CAAC,GAAW,KAAgB,EAAS,EAAK,GAC1C,CAAC,GAAiB,KAAsB,EAAiC,IAAI,GAC7E,IAAa,EAAuB,IAAI,GACxC,IAAa,EAAuB,IAAI,GACxC,IAAe,EAAO,EAAI,GAC1B,IAAc,EAAM,GACpB,IAAqB,KAAa,WAAW;CAwCnD,AArCA,SACE,EAAa,UAAU,UACV;EACX,EAAa,UAAU;CACzB,IACC,CAAC,CAAC,GAIL,QAAgB;EACd,IAAM,IAAU,EAAW;EAC3B,IAAI,CAAC,GAAS;EAGd,IAAM,UAAsB;GAC1B,AAAI,EAAa,WACf,EAAa,EAAI;EAErB,GAEM,UAAuB;GAC3B,AAAI,EAAa,YACf,EAAa,EAAK,GAClB,EAAmB,IAAI;EAE3B;EAKA,OAHA,EAAQ,iBAAiB,WAAW,CAAa,GACjD,EAAQ,iBAAiB,YAAY,CAAc,SAEtC;GAEX,AADA,EAAQ,oBAAoB,WAAW,CAAa,GACpD,EAAQ,oBAAoB,YAAY,CAAc;EACxD;CACF,GAAG,CAAC,CAAC,GAGL,QAAgB;EAEd,IADI,CAAC,KAAa,CAAC,EAAW,WAC1B,CAAC,EAAa,SAAS;EAE3B,IAAM,IAAc,EAAW,QAAQ,sBAAsB;EAG7D,4BAA4B;GAC1B,IAAI,CAAC,EAAa,WAAW,CAAC,EAAW,SAAS;GAElD,IAAM,IAAc,EAAW,QAAQ,sBAAsB,GACvD,IAAa,EAAY,KACzB,IAAa,OAAO,cAAc,EAAY,QAE9C,IAAgB,EAAY,QAI5B,IACJ,IAAa,IAAgB,MAAU,IAAa,IAChD,WACA,OAGA,IAAgB,EAAY,OAAO,EAAY,QAAQ,GACvD,IAAe,EAAY,OAC7B,IAAO,IAAgB,IAAe,GACpC,IAAgB,OAAO;GAM7B,AAHI,IAAO,IAAe,IAAgB,OACxC,IAAO,IAAgB,IAAe,KAEpC,IAAO,OACT,IAAO;GAIT,IAAI;GAOJ,AANA,AAGE,IAHE,MAAc,QACV,EAAY,MAAM,IAAgB,IAElC,EAAY,SAAS,GAG7B,EAAmB;IAAE;IAAK;IAAM;GAAU,CAAC;EAC7C,CAAC;CACH,GAAG,CAAC,CAAS,CAAC;CAEd,IAAM,IAAa,QAAkB;EACnC,EAAa,EAAI;CACnB,GAAG,CAAC,CAAC,GAEC,IAAa,QAAkB;EAEnC,AADA,EAAa,EAAK,GAClB,EAAmB,IAAI;CACzB,GAAG,CAAC,CAAC,GAEC,IAAiB,KACrB,kBAAC,OAAD;EACE,KAAK;EACL,IAAI;EACJ,WAAW,sCAAsC,GAAiB,aAAa,MAAM,GAAG,KAAoB;EAC5G,OACE,IACI;GACE,KAAK,GAAG,OAAO,EAAgB,GAAG,EAAE;GACpC,MAAM,GAAG,OAAO,EAAgB,IAAI,EAAE;EACxC,IACA,EAAE,YAAY,SAAS;EAE7B,MAAK;EAEJ,UAAA,OAAO,KAAY,WAClB,kBAAC,KAAD;GAAG,WAAU;GAAiB,UAAA;EAAW,CAAA,IAEzC;CAEC,CAAA;CAGP,OACE,kBAAC,OAAD;EACE,KAAK;EACL,WAAW,oBAAoB,KAAa;EAC5C,cAAc;EACd,cAAc;EACJ;EACV,oBAAkB,IAAY,IAAqB,KAAA;EANrD,UAAA,CAQG,GACA,KAAkB,EAAa,GAAgB,SAAS,IAAI,CAC1D;;AAET"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { usePrefersReducedMotion } from './usePrefersReducedMotion';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* usePrefersReducedMotion Hook
|
|
3
|
+
*
|
|
4
|
+
* Reactive subscription to the `prefers-reduced-motion: reduce` media
|
|
5
|
+
* query. Returns true when the user has asked the OS to minimize
|
|
6
|
+
* non-essential motion; components should disable decorative animation
|
|
7
|
+
* (typewriter reveals, entrance transitions, pulses) in that case.
|
|
8
|
+
*
|
|
9
|
+
* Safe in non-browser/test environments: returns false when
|
|
10
|
+
* `window.matchMedia` is unavailable.
|
|
11
|
+
*/
|
|
12
|
+
export declare function usePrefersReducedMotion(): boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
//#region src/hooks/usePrefersReducedMotion.ts
|
|
3
|
+
var n = "(prefers-reduced-motion: reduce)";
|
|
4
|
+
function r() {
|
|
5
|
+
return typeof window > "u" || typeof window.matchMedia != "function" ? !1 : window.matchMedia(n).matches;
|
|
6
|
+
}
|
|
7
|
+
function i() {
|
|
8
|
+
let [i, a] = t(r);
|
|
9
|
+
return e(() => {
|
|
10
|
+
if (typeof window > "u" || typeof window.matchMedia != "function") return;
|
|
11
|
+
let e = window.matchMedia(n), t = (e) => {
|
|
12
|
+
a(e.matches);
|
|
13
|
+
};
|
|
14
|
+
return e.addEventListener("change", t), () => {
|
|
15
|
+
e.removeEventListener("change", t);
|
|
16
|
+
};
|
|
17
|
+
}, []), i;
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i as usePrefersReducedMotion };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=usePrefersReducedMotion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"usePrefersReducedMotion.js","names":[],"sources":["../../src/hooks/usePrefersReducedMotion.ts"],"sourcesContent":["/**\n * usePrefersReducedMotion Hook\n *\n * Reactive subscription to the `prefers-reduced-motion: reduce` media\n * query. Returns true when the user has asked the OS to minimize\n * non-essential motion; components should disable decorative animation\n * (typewriter reveals, entrance transitions, pulses) in that case.\n *\n * Safe in non-browser/test environments: returns false when\n * `window.matchMedia` is unavailable.\n */\n\nimport { useState, useEffect } from \"react\";\n\nconst QUERY = \"(prefers-reduced-motion: reduce)\";\n\nfunction getInitialValue(): boolean {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return false;\n }\n return window.matchMedia(QUERY).matches;\n}\n\nexport function usePrefersReducedMotion(): boolean {\n const [prefersReducedMotion, setPrefersReducedMotion] = useState(getInitialValue);\n\n useEffect(() => {\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") {\n return;\n }\n\n const mediaQuery = window.matchMedia(QUERY);\n const handleChange = (event: MediaQueryListEvent) => {\n setPrefersReducedMotion(event.matches);\n };\n\n mediaQuery.addEventListener(\"change\", handleChange);\n return () => {\n mediaQuery.removeEventListener(\"change\", handleChange);\n };\n }, []);\n\n return prefersReducedMotion;\n}\n"],"mappings":";;AAcA,IAAM,IAAQ;AAEd,SAAS,IAA2B;CAIlC,OAHI,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,aACzD,KAEF,OAAO,WAAW,CAAK,CAAC,CAAC;AAClC;AAEA,SAAgB,IAAmC;CACjD,IAAM,CAAC,GAAsB,KAA2B,EAAS,CAAe;CAkBhF,OAhBA,QAAgB;EACd,IAAI,OAAO,SAAW,OAAe,OAAO,OAAO,cAAe,YAChE;EAGF,IAAM,IAAa,OAAO,WAAW,CAAK,GACpC,KAAgB,MAA+B;GACnD,EAAwB,EAAM,OAAO;EACvC;EAGA,OADA,EAAW,iBAAiB,UAAU,CAAY,SACrC;GACX,EAAW,oBAAoB,UAAU,CAAY;EACvD;CACF,GAAG,CAAC,CAAC,GAEE;AACT"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alert Circle Icon
|
|
3
|
+
* Used for warnings and info alerts
|
|
4
|
+
*/
|
|
5
|
+
interface IconProps {
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
size?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function AlertCircleIcon({ className, style, size }: IconProps): import("react").JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
//#region src/icons/AlertCircleIcon.tsx
|
|
3
|
+
function t({ className: t, style: n, size: r }) {
|
|
4
|
+
let i = r ?? "1em";
|
|
5
|
+
return /* @__PURE__ */ e("svg", {
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
width: i,
|
|
8
|
+
height: i,
|
|
9
|
+
fill: "none",
|
|
10
|
+
viewBox: "0 0 24 24",
|
|
11
|
+
strokeWidth: 1.5,
|
|
12
|
+
stroke: "currentColor",
|
|
13
|
+
className: t,
|
|
14
|
+
style: n,
|
|
15
|
+
"aria-hidden": "true",
|
|
16
|
+
children: /* @__PURE__ */ e("path", {
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round",
|
|
19
|
+
d: "M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
export { t as AlertCircleIcon };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=AlertCircleIcon.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertCircleIcon.js","names":[],"sources":["../../src/icons/AlertCircleIcon.tsx"],"sourcesContent":["/**\n * Alert Circle Icon\n * Used for warnings and info alerts\n */\n\ninterface IconProps {\n className?: string;\n style?: React.CSSProperties;\n size?: number;\n}\n\nexport function AlertCircleIcon({ className, style, size }: IconProps) {\n const sizeValue = size ?? \"1em\";\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width={sizeValue}\n height={sizeValue}\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n strokeWidth={1.5}\n stroke=\"currentColor\"\n className={className}\n style={style}\n aria-hidden=\"true\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n d=\"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z\"\n />\n </svg>\n );\n}\n"],"mappings":";;AAWA,SAAgB,EAAgB,EAAE,cAAW,UAAO,WAAmB;CACrE,IAAM,IAAY,KAAQ;CAC1B,OACE,kBAAC,OAAD;EACE,OAAM;EACN,OAAO;EACP,QAAQ;EACR,MAAK;EACL,SAAQ;EACR,aAAa;EACb,QAAO;EACI;EACJ;EACP,eAAY;EAEZ,UAAA,kBAAC,QAAD;GACE,eAAc;GACd,gBAAe;GACf,GAAE;EACH,CAAA;CACE,CAAA;AAET"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @lablup/ui-common
|
|
3
|
+
*
|
|
4
|
+
* Product-neutral UI components and design tokens shared across Lablup
|
|
5
|
+
* products. Import from here for the full surface, or from
|
|
6
|
+
* `@lablup/ui-common/components/<Name>` when you want the smallest
|
|
7
|
+
* possible graph (see the component subpath exports in package.json).
|
|
8
|
+
*
|
|
9
|
+
* Styling is opt-in and lives in a separate entry point:
|
|
10
|
+
* `@lablup/ui-common/styles/base.css` (required) plus at most one
|
|
11
|
+
* `@lablup/ui-common/styles/themes/<theme>.css` (optional).
|
|
12
|
+
*/
|
|
13
|
+
export * from './components/BaseCard';
|
|
14
|
+
export * from './components/Badge';
|
|
15
|
+
export * from './components/Button';
|
|
16
|
+
export * from './components/DataTable';
|
|
17
|
+
export * from './components/Drawer';
|
|
18
|
+
export * from './components/EmptyState';
|
|
19
|
+
export * from './components/ErrorState';
|
|
20
|
+
export * from './components/PageHeader';
|
|
21
|
+
export * from './components/PageLayout';
|
|
22
|
+
export * from './components/ProgressBar';
|
|
23
|
+
export * from './components/Skeleton';
|
|
24
|
+
export * from './components/SmoothHeight';
|
|
25
|
+
export * from './components/StatCard';
|
|
26
|
+
export * from './components/StatusTag';
|
|
27
|
+
export * from './components/Tabs';
|
|
28
|
+
export * from './components/Tooltip';
|
|
29
|
+
export * from './hooks';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseCard as e } from "./components/BaseCard/BaseCard2.js";
|
|
2
|
+
import { Badge as t } from "./components/Badge/Badge2.js";
|
|
3
|
+
import { Button as n } from "./components/Button/Button2.js";
|
|
4
|
+
import { DataTable as r } from "./components/DataTable/DataTable2.js";
|
|
5
|
+
import { Drawer as i } from "./components/Drawer/Drawer2.js";
|
|
6
|
+
import { EmptyState as a } from "./components/EmptyState/EmptyState2.js";
|
|
7
|
+
import { ErrorState as o } from "./components/ErrorState/ErrorState2.js";
|
|
8
|
+
import { PageHeader as s } from "./components/PageHeader/PageHeader2.js";
|
|
9
|
+
import { PageLayout as c } from "./components/PageLayout/PageLayout2.js";
|
|
10
|
+
import { ProgressBar as l } from "./components/ProgressBar/ProgressBar2.js";
|
|
11
|
+
import { Skeleton as u } from "./components/Skeleton/Skeleton2.js";
|
|
12
|
+
import { SkeletonCard as d } from "./components/Skeleton/SkeletonCard2.js";
|
|
13
|
+
import { SkeletonText as f } from "./components/Skeleton/SkeletonText2.js";
|
|
14
|
+
import { SkeletonChart as p } from "./components/Skeleton/SkeletonChart2.js";
|
|
15
|
+
import { SkeletonRow as m } from "./components/Skeleton/SkeletonRow2.js";
|
|
16
|
+
import { SmoothHeight as h } from "./components/SmoothHeight/SmoothHeight2.js";
|
|
17
|
+
import { usePrefersReducedMotion as g } from "./hooks/usePrefersReducedMotion.js";
|
|
18
|
+
import { StatCard as _ } from "./components/StatCard/StatCard2.js";
|
|
19
|
+
import { formatCompactNumber as v } from "./components/StatCard/formatters.js";
|
|
20
|
+
import { StatusTag as y } from "./components/StatusTag/StatusTag2.js";
|
|
21
|
+
import { TAG_CONFIG as b } from "./components/Tabs/tabTags.js";
|
|
22
|
+
import { Tabs as x } from "./components/Tabs/Tabs2.js";
|
|
23
|
+
import { Tooltip as S } from "./components/Tooltip/Tooltip2.js";
|
|
24
|
+
export { t as Badge, e as BaseCard, n as Button, r as DataTable, i as Drawer, a as EmptyState, o as ErrorState, s as PageHeader, c as PageLayout, l as ProgressBar, u as Skeleton, d as SkeletonCard, p as SkeletonChart, m as SkeletonRow, f as SkeletonText, h as SmoothHeight, _ as StatCard, y as StatusTag, b as TAG_CONFIG, x as Tabs, S as Tooltip, v as formatCompactNumber, g as usePrefersReducedMotion };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @lablup/ui-common design tokens
|
|
3
|
+
*
|
|
4
|
+
* The 113 `--token-*` custom properties every component in this package
|
|
5
|
+
* reads. This file is the token contract: renaming or removing an entry is
|
|
6
|
+
* a breaking change, exactly like renaming a prop (see CONTRIBUTING.md).
|
|
7
|
+
*
|
|
8
|
+
* Values are the resolved defaults of the source product's default theme
|
|
9
|
+
* (theme family "stained", color scheme "light"), taken from that product's
|
|
10
|
+
* `src/themes/base.css` (structural tokens: spacing, radius, motion, type
|
|
11
|
+
* scale, focus ring, z-index) and `src/themes/tokens/stained-light.css`
|
|
12
|
+
* (color and button tokens). A handful of tokens that no source theme
|
|
13
|
+
* ever defines (e.g. `--token-colorTextQuaternary`, `--token-marginXXS`)
|
|
14
|
+
* are given the same literal fallback value the component CSS already
|
|
15
|
+
* carries at its call site.
|
|
16
|
+
*
|
|
17
|
+
* Every component also gives every token reference here its own inline
|
|
18
|
+
* fallback, so a consumer that imports a component without this stylesheet
|
|
19
|
+
* still gets a rendered (unthemed) result.
|
|
20
|
+
*
|
|
21
|
+
* Those inline fallbacks are NOT all equal to the values above. Roughly 143
|
|
22
|
+
* of them were inherited verbatim from the source product, where they predate
|
|
23
|
+
* current theme and were already dead code (the token is always defined, so
|
|
24
|
+
* the fallback never applies). The most visible divergence is
|
|
25
|
+
* `--token-colorPrimary`, whose call-site fallback is the older orange
|
|
26
|
+
* `#ff7a00` rather than the current `#8b5cf6`.
|
|
27
|
+
*
|
|
28
|
+
* Consequence: importing a component WITHOUT this stylesheet renders, but not
|
|
29
|
+
* in the documented default palette. Import `styles/base.css`. Aligning the
|
|
30
|
+
* fallbacks is a deliberate visual change and was left out of the extraction,
|
|
31
|
+
* which was required to preserve current rendering exactly.
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
:root {
|
|
35
|
+
--token-borderRadius: 0.375rem;
|
|
36
|
+
--token-borderRadiusLG: 0.5rem;
|
|
37
|
+
--token-borderRadiusSM: 0.25rem;
|
|
38
|
+
--token-borderRadiusXL: 0.75rem;
|
|
39
|
+
--token-boxShadow:
|
|
40
|
+
0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02),
|
|
41
|
+
0 2px 4px 0 rgba(0, 0, 0, 0.02);
|
|
42
|
+
--token-boxShadowSecondary:
|
|
43
|
+
0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12),
|
|
44
|
+
0 9px 28px 8px rgba(0, 0, 0, 0.05);
|
|
45
|
+
--token-boxShadowTertiary: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
46
|
+
--token-buttonActiveTransform: scale(0.97);
|
|
47
|
+
--token-buttonBorderRadius: 0.375rem;
|
|
48
|
+
--token-buttonHoverTransform: translateY(-1px);
|
|
49
|
+
--token-buttonDangerBg: transparent;
|
|
50
|
+
--token-buttonDangerBgActive: rgba(255, 77, 79, 0.2);
|
|
51
|
+
--token-buttonDangerBgHover: rgba(255, 77, 79, 0.1);
|
|
52
|
+
--token-buttonDangerBorder: 1px solid #c82333;
|
|
53
|
+
--token-buttonDangerShadow: none;
|
|
54
|
+
--token-buttonDangerText: #c82333;
|
|
55
|
+
--token-buttonGhostBackdrop: none;
|
|
56
|
+
--token-buttonGhostBg: transparent;
|
|
57
|
+
--token-buttonGhostBgActive: #f5f5f5;
|
|
58
|
+
--token-buttonGhostBgHover: rgba(139, 92, 246, 0.06);
|
|
59
|
+
--token-buttonGhostBorder: 1px solid transparent;
|
|
60
|
+
--token-buttonGhostBorderHover: 1px solid transparent;
|
|
61
|
+
--token-buttonGhostShadow: none;
|
|
62
|
+
--token-buttonGhostShadowHover: none;
|
|
63
|
+
--token-buttonPrimaryBackdrop: none;
|
|
64
|
+
--token-buttonPrimaryBg:
|
|
65
|
+
linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%), #8b5cf6;
|
|
66
|
+
--token-buttonPrimaryBgHover:
|
|
67
|
+
linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 50%), #7c3aed;
|
|
68
|
+
--token-buttonPrimaryBorder: none;
|
|
69
|
+
--token-buttonPrimaryShadow:
|
|
70
|
+
0 2px 6px rgba(139, 92, 246, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
|
|
71
|
+
--token-buttonPrimaryShadowHover:
|
|
72
|
+
0 4px 10px rgba(139, 92, 246, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.25);
|
|
73
|
+
--token-buttonSecondaryBackdrop: none;
|
|
74
|
+
--token-buttonSecondaryBg: rgba(139, 92, 246, 0.04);
|
|
75
|
+
--token-buttonSecondaryBgActive: #f5f5f5;
|
|
76
|
+
--token-buttonSecondaryBgHover: rgba(139, 92, 246, 0.08);
|
|
77
|
+
--token-buttonSecondaryBorder: 1px solid rgba(139, 92, 246, 0.2);
|
|
78
|
+
--token-buttonSecondaryBorderHover: 1px solid rgba(139, 92, 246, 0.3);
|
|
79
|
+
--token-buttonSecondaryShadow:
|
|
80
|
+
0 1px 3px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
|
81
|
+
--token-buttonSuccessBackdrop: none;
|
|
82
|
+
--token-buttonSuccessBg:
|
|
83
|
+
linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%), #007a63;
|
|
84
|
+
--token-buttonSuccessBgHover:
|
|
85
|
+
linear-gradient(180deg, rgba(255, 255, 255, 0.25) 0%, transparent 50%), #006654;
|
|
86
|
+
--token-buttonSuccessBorder: none;
|
|
87
|
+
--token-buttonSuccessShadow:
|
|
88
|
+
0 2px 6px rgba(0, 189, 155, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.2);
|
|
89
|
+
--token-colorBgContainer: #ffffff;
|
|
90
|
+
--token-colorBgElevated: #ffffff;
|
|
91
|
+
--token-colorBgLayout: #f5f5f5;
|
|
92
|
+
--token-colorBgMask: rgba(0, 0, 0, 0.45);
|
|
93
|
+
--token-colorBgTextActive: rgba(0, 0, 0, 0.08);
|
|
94
|
+
--token-colorBgTextHover: rgba(0, 0, 0, 0.04);
|
|
95
|
+
--token-colorBorder: #d9d9d9;
|
|
96
|
+
--token-colorBorderSecondary: #e5e7eb;
|
|
97
|
+
--token-colorFillQuaternary: #fafafa;
|
|
98
|
+
--token-colorFillSecondary: #f3f4f6;
|
|
99
|
+
--token-colorFillTertiary: #f9fafb;
|
|
100
|
+
--token-colorError: #c82333;
|
|
101
|
+
--token-colorInfo: #0066cc;
|
|
102
|
+
--token-colorLink: #8b5cf6;
|
|
103
|
+
--token-colorLinkHover: #7c3aed;
|
|
104
|
+
--token-colorPrimary: #8b5cf6;
|
|
105
|
+
--token-colorPrimaryActive: #6d28d9;
|
|
106
|
+
--token-colorPrimaryBg: rgba(139, 92, 246, 0.1);
|
|
107
|
+
--token-colorPrimaryBorder: rgba(139, 92, 246, 0.2);
|
|
108
|
+
--token-colorSuccess: #007a63;
|
|
109
|
+
--token-colorSuccessActive: #005244;
|
|
110
|
+
--token-colorSuccessBg: rgba(0, 189, 155, 0.05);
|
|
111
|
+
--token-colorSuccessBorder: rgba(0, 189, 155, 0.4);
|
|
112
|
+
--token-colorSuccessBorderHover: rgba(0, 189, 155, 0.6);
|
|
113
|
+
--token-colorSuccessBoxShadow: 0 4px 12px rgba(0, 189, 155, 0.15);
|
|
114
|
+
--token-colorWarning: #9a5d00;
|
|
115
|
+
--token-colorText: #141414;
|
|
116
|
+
--token-colorTextQuaternary: #bfbfbf;
|
|
117
|
+
--token-colorTextSecondary: #595959;
|
|
118
|
+
--token-colorTextTertiary: #737373;
|
|
119
|
+
--token-focusRingColor: #8b5cf6;
|
|
120
|
+
--token-focusRingOffset: 2px;
|
|
121
|
+
--token-focusRingStyle: solid;
|
|
122
|
+
--token-focusRingWidth: 2px;
|
|
123
|
+
--token-fontFamily:
|
|
124
|
+
"Ubuntu Sans", "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Segoe UI",
|
|
125
|
+
Roboto, sans-serif;
|
|
126
|
+
--token-fontSize: 0.875rem;
|
|
127
|
+
--token-fontSizeLG: 1rem;
|
|
128
|
+
--token-fontSizeSM: 0.75rem;
|
|
129
|
+
--token-fontSizeXL: 1.25rem;
|
|
130
|
+
--token-fontSizeXXS: 0.5rem;
|
|
131
|
+
--token-marginXXS: 4px;
|
|
132
|
+
--token-padding: 0.75rem;
|
|
133
|
+
--token-paddingLG: 1.5rem;
|
|
134
|
+
--token-paddingMD: 1rem;
|
|
135
|
+
--token-paddingSM: 0.5rem;
|
|
136
|
+
--token-paddingXL: 2rem;
|
|
137
|
+
--token-paddingXS: 0.25rem;
|
|
138
|
+
--token-paddingXXS: 0.125rem;
|
|
139
|
+
--token-motionDurationFast: 0.1s;
|
|
140
|
+
--token-motionDurationMid: 0.2s;
|
|
141
|
+
--token-motionDurationSlow: 0.3s;
|
|
142
|
+
--token-themeTransitionDuration: 0.25s;
|
|
143
|
+
--token-themeTransitionTiming: ease-in-out;
|
|
144
|
+
--token-tabActiveBg: rgba(139, 92, 246, 0.1);
|
|
145
|
+
--token-tabFocusShadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
|
|
146
|
+
--token-tabHoverBg: #f3f4f6;
|
|
147
|
+
--token-zIndexDrawer: 1100;
|
|
148
|
+
--token-zIndexDrawerContent: 1101;
|
|
149
|
+
--token-zIndexPopover: 1150;
|
|
150
|
+
--token-zIndexTooltip: 1300;
|
|
151
|
+
|
|
152
|
+
/* Type scale (source `src/themes/base.css` :root, which wins over the
|
|
153
|
+
call-site fallback in the source product today). */
|
|
154
|
+
--token-fontSizeHeading1: 2rem;
|
|
155
|
+
--token-fontSizeHeading2: 1.5rem;
|
|
156
|
+
--token-fontSizeHeading3: 1.25rem;
|
|
157
|
+
--token-fontSizeHeading4: 1rem;
|
|
158
|
+
--token-fontSizeDisplay4: 1.75rem;
|
|
159
|
+
|
|
160
|
+
/* Referenced by components but defined by no source theme, so the
|
|
161
|
+
call-site fallback is what renders today and is carried here verbatim. */
|
|
162
|
+
--token-boxShadowDrawerRight: -4px 0 20px rgba(0, 0, 0, 0.15);
|
|
163
|
+
--token-buttonPrimaryBgActive: var(--token-colorPrimaryActive);
|
|
164
|
+
--token-buttonSuccessBgActive: var(--token-colorSuccessActive);
|
|
165
|
+
--token-buttonDangerShadowHover: var(--token-buttonDangerShadow);
|
|
166
|
+
--token-buttonSuccessShadowHover: var(--token-buttonSuccessShadow);
|
|
167
|
+
--token-buttonSecondaryShadowHover:
|
|
168
|
+
0 2px 6px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
|
|
169
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @lablup/ui-common theme tokens: bliss-dark
|
|
3
|
+
*
|
|
4
|
+
* Overrides for the subset of the 104-token contract (see
|
|
5
|
+
* ../base.css) that this theme customizes. Import at most one
|
|
6
|
+
* theme file alongside base.css; components never import a
|
|
7
|
+
* theme file themselves.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
[data-theme="bliss-dark"] {
|
|
11
|
+
--token-boxShadow: 0 1px 3px rgba(0, 0, 0, 0.3);
|
|
12
|
+
--token-boxShadowSecondary: 0 2px 10px rgba(0, 0, 0, 0.4);
|
|
13
|
+
--token-buttonActiveTransform: translateY(1px);
|
|
14
|
+
--token-buttonBorderRadius: 3px;
|
|
15
|
+
--token-buttonDangerBg: linear-gradient(
|
|
16
|
+
180deg,
|
|
17
|
+
#ff7070 0%,
|
|
18
|
+
#ff5c5c 45%,
|
|
19
|
+
#e04040 100%
|
|
20
|
+
);
|
|
21
|
+
--token-buttonDangerBgActive: #cc3333;
|
|
22
|
+
--token-buttonDangerBgHover: linear-gradient(
|
|
23
|
+
180deg,
|
|
24
|
+
#ff8585 0%,
|
|
25
|
+
#ff7070 45%,
|
|
26
|
+
#ff5c5c 100%
|
|
27
|
+
);
|
|
28
|
+
--token-buttonDangerBorder: 1px solid #b52828;
|
|
29
|
+
--token-buttonDangerShadow:
|
|
30
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.4);
|
|
31
|
+
--token-buttonDangerText: white;
|
|
32
|
+
--token-buttonGhostBackdrop: none;
|
|
33
|
+
--token-buttonGhostBg: transparent;
|
|
34
|
+
--token-buttonGhostBgActive: rgba(255, 255, 255, 0.1);
|
|
35
|
+
--token-buttonGhostBgHover: rgba(255, 255, 255, 0.06);
|
|
36
|
+
--token-buttonGhostBorder: 1px solid transparent;
|
|
37
|
+
--token-buttonGhostBorderHover: 1px solid rgba(255, 255, 255, 0.1);
|
|
38
|
+
--token-buttonGhostShadow: none;
|
|
39
|
+
--token-buttonGhostShadowHover: none;
|
|
40
|
+
--token-buttonHoverTransform: none;
|
|
41
|
+
--token-buttonPrimaryBg: linear-gradient(
|
|
42
|
+
180deg,
|
|
43
|
+
#5a96f7 0%,
|
|
44
|
+
#4b8bf5 45%,
|
|
45
|
+
#3570d4 100%
|
|
46
|
+
);
|
|
47
|
+
--token-buttonPrimaryBgHover: linear-gradient(
|
|
48
|
+
180deg,
|
|
49
|
+
#6ba3f5 0%,
|
|
50
|
+
#5a96f7 45%,
|
|
51
|
+
#4b8bf5 100%
|
|
52
|
+
);
|
|
53
|
+
--token-buttonPrimaryBorder: 1px solid #1b4aaf;
|
|
54
|
+
--token-buttonPrimaryShadow:
|
|
55
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.4);
|
|
56
|
+
--token-buttonPrimaryShadowHover:
|
|
57
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 4px rgba(0, 0, 0, 0.45);
|
|
58
|
+
--token-buttonSecondaryBackdrop: none;
|
|
59
|
+
--token-buttonSecondaryBg: linear-gradient(180deg, #3a3e48 0%, #2e323c 100%);
|
|
60
|
+
--token-buttonSecondaryBgActive: linear-gradient(
|
|
61
|
+
180deg,
|
|
62
|
+
#1e2228 0%,
|
|
63
|
+
#262a32 8%,
|
|
64
|
+
#282c34 94%,
|
|
65
|
+
#2e323c 100%
|
|
66
|
+
);
|
|
67
|
+
--token-buttonSecondaryBgHover: linear-gradient(180deg, #444854 0%, #3a3e48 100%);
|
|
68
|
+
--token-buttonSecondaryBorder: 1px solid #4a4e58;
|
|
69
|
+
--token-buttonSecondaryBorderHover: 1px solid #5a5e68;
|
|
70
|
+
--token-buttonSecondaryShadow:
|
|
71
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -1px 0 rgba(0, 0, 0, 0.15),
|
|
72
|
+
0 1px 2px rgba(0, 0, 0, 0.3);
|
|
73
|
+
--token-buttonSuccessBg: linear-gradient(
|
|
74
|
+
180deg,
|
|
75
|
+
#5cbf60 0%,
|
|
76
|
+
#4caf50 45%,
|
|
77
|
+
#43a047 100%
|
|
78
|
+
);
|
|
79
|
+
--token-buttonSuccessBgHover: linear-gradient(
|
|
80
|
+
180deg,
|
|
81
|
+
#6dcd70 0%,
|
|
82
|
+
#5cbf60 45%,
|
|
83
|
+
#4caf50 100%
|
|
84
|
+
);
|
|
85
|
+
--token-buttonSuccessBorder: 1px solid #2e7d32;
|
|
86
|
+
--token-buttonSuccessShadow:
|
|
87
|
+
inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 3px rgba(0, 0, 0, 0.4);
|
|
88
|
+
--token-colorBgContainer: #22262e;
|
|
89
|
+
--token-colorBgElevated: #2a2e38;
|
|
90
|
+
--token-colorBgLayout: #1a1d24;
|
|
91
|
+
--token-colorBorder: #3a3e48;
|
|
92
|
+
--token-colorBorderSecondary: #2e323c;
|
|
93
|
+
--token-colorError: #ff5c5c;
|
|
94
|
+
--token-colorFillQuaternary: rgba(255, 255, 255, 0.02);
|
|
95
|
+
--token-colorFillSecondary: rgba(255, 255, 255, 0.06);
|
|
96
|
+
--token-colorFillTertiary: rgba(255, 255, 255, 0.04);
|
|
97
|
+
--token-colorInfo: #4b8bf5;
|
|
98
|
+
--token-colorLink: #4b8bf5;
|
|
99
|
+
--token-colorPrimary: #4b8bf5;
|
|
100
|
+
--token-colorPrimaryActive: #245edc;
|
|
101
|
+
--token-colorPrimaryBg: rgba(75, 139, 245, 0.12);
|
|
102
|
+
--token-colorPrimaryBorder: rgba(75, 139, 245, 0.3);
|
|
103
|
+
--token-colorSuccess: #4caf50;
|
|
104
|
+
--token-colorSuccessActive: #43a047;
|
|
105
|
+
--token-colorSuccessBg: rgba(76, 175, 80, 0.12);
|
|
106
|
+
--token-colorSuccessBorder: rgba(76, 175, 80, 0.4);
|
|
107
|
+
--token-colorSuccessBorderHover: rgba(76, 175, 80, 0.6);
|
|
108
|
+
--token-colorSuccessBoxShadow: 0 2px 6px rgba(76, 175, 80, 0.2);
|
|
109
|
+
--token-colorText: #e8e6e0;
|
|
110
|
+
--token-colorTextSecondary: #b5b3ac;
|
|
111
|
+
--token-colorTextTertiary: #908e88;
|
|
112
|
+
--token-colorWarning: #ffb74d;
|
|
113
|
+
--token-focusRingColor: #4b8bf5;
|
|
114
|
+
--token-focusRingOffset: 2px;
|
|
115
|
+
--token-focusRingStyle: solid;
|
|
116
|
+
--token-focusRingWidth: 2px;
|
|
117
|
+
--token-fontFamily:
|
|
118
|
+
"Tahoma", "Gulim", system-ui, -apple-system, BlinkMacSystemFont, "Ubuntu Sans",
|
|
119
|
+
"Pretendard Variable", "Segoe UI", Roboto, sans-serif;
|
|
120
|
+
--token-tabActiveBg: rgba(75, 139, 245, 0.1);
|
|
121
|
+
--token-tabFocusShadow: 0 0 0 2px rgba(75, 139, 245, 0.2);
|
|
122
|
+
--token-tabHoverBg: rgba(255, 255, 255, 0.06);
|
|
123
|
+
}
|