@rovula/ui 0.1.7 → 0.1.8
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/cjs/bundle.css +281 -124
- package/dist/cjs/bundle.js +1545 -1545
- package/dist/cjs/bundle.js.map +1 -1
- package/dist/cjs/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
- package/dist/cjs/types/components/Dialog/Dialog.d.ts +7 -1
- package/dist/cjs/types/components/Dialog/Dialog.stories.d.ts +3 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/cjs/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
- package/dist/cjs/types/components/Form/Field.d.ts +26 -0
- package/dist/cjs/types/components/Form/FieldMessage.d.ts +7 -0
- package/dist/cjs/types/components/Form/Form.d.ts +49 -11
- package/dist/cjs/types/components/Form/Form.stories.d.ts +23 -0
- package/dist/cjs/types/components/Form/ValidationHintList.d.ts +17 -0
- package/dist/cjs/types/components/Form/ValidationHintList.stories.d.ts +9 -0
- package/dist/cjs/types/components/Form/index.d.ts +10 -0
- package/dist/cjs/types/components/Form/useOptionBridge.d.ts +17 -0
- package/dist/cjs/types/components/OtpInput/OtpInput.d.ts +17 -0
- package/dist/cjs/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
- package/dist/cjs/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
- package/dist/cjs/types/components/OtpInput/index.d.ts +5 -0
- package/dist/cjs/types/components/TextInput/TextInput.styles.d.ts +3 -0
- package/dist/cjs/types/index.d.ts +5 -0
- package/dist/cjs/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
- package/dist/cjs/types/utils/colors.d.ts +84 -0
- package/dist/components/ActionButton/ActionButton.stories.js +2 -2
- package/dist/components/ActionButton/ActionButton.styles.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +6 -6
- package/dist/components/AlertDialog/AlertDialog.stories.js +3 -0
- package/dist/components/Avatar/Avatar.stories.js +1 -1
- package/dist/components/Avatar/Avatar.styles.js +1 -1
- package/dist/components/Avatar/AvatarBase.js +1 -1
- package/dist/components/Avatar/AvatarGroup.stories.js +1 -1
- package/dist/components/Button/Buttons.stories.js +2 -2
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.js +17 -7
- package/dist/components/Collapsible/Collapsible.styles.js +1 -1
- package/dist/components/DataTable/DataTable.js +2 -2
- package/dist/components/Dialog/Dialog.js +12 -7
- package/dist/components/Dialog/Dialog.stories.js +90 -2
- package/dist/components/Dropdown/Dropdown.js +2 -2
- package/dist/components/DropdownMenu/DropdownMenu.js +3 -3
- package/dist/components/FocusedScrollView/FocusedScrollView.stories.js +6 -6
- package/dist/components/Form/Field.js +60 -0
- package/dist/components/Form/FieldMessage.js +24 -0
- package/dist/components/Form/Form.js +73 -41
- package/dist/components/Form/Form.stories.js +221 -0
- package/dist/components/Form/ValidationHintList.js +30 -0
- package/dist/components/Form/ValidationHintList.stories.js +50 -0
- package/dist/components/Form/index.js +5 -0
- package/dist/components/Form/useOptionBridge.js +27 -0
- package/dist/components/InputFilter/InputFilter.js +5 -4
- package/dist/components/InputFilter/InputFilter.stories.js +1 -1
- package/dist/components/InputFilter/InputFilter.styles.js +14 -1
- package/dist/components/Label/Label.styles.js +1 -1
- package/dist/components/Menu/Menu.js +2 -2
- package/dist/components/NumberInput/NumberInput.stories.js +1 -1
- package/dist/components/OtpInput/OtpInput.js +118 -0
- package/dist/components/OtpInput/OtpInput.stories.js +60 -0
- package/dist/components/OtpInput/OtpInputGroup.js +23 -0
- package/dist/components/OtpInput/index.js +3 -0
- package/dist/components/PasswordInput/PasswordInput.stories.js +1 -1
- package/dist/components/Popover/Popover.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.stories.js +2 -2
- package/dist/components/Search/Search.js +13 -1
- package/dist/components/Search/Search.stories.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Slider/Slider.stories.js +5 -5
- package/dist/components/Switch/Switch.stories.js +2 -2
- package/dist/components/Table/Table.js +5 -5
- package/dist/components/Tabs/Tabs.js +12 -9
- package/dist/components/Tabs/Tabs.stories.js +1 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/components/Text/Text.stories.js +1 -1
- package/dist/components/TextArea/TextArea.stories.js +1 -1
- package/dist/components/TextArea/TextArea.styles.js +3 -3
- package/dist/components/TextInput/TextInput.js +3 -2
- package/dist/components/TextInput/TextInput.stories.js +3 -3
- package/dist/components/TextInput/TextInput.styles.js +41 -19
- package/dist/components/Toast/Toast.js +4 -2
- package/dist/components/Toast/Toast.stories.js +1 -1
- package/dist/components/Toast/Toast.styles.js +4 -4
- package/dist/components/Toast/Toaster.js +2 -2
- package/dist/components/Tree/Tree.stories.js +1 -1
- package/dist/components/Tree/TreeItem.js +1 -1
- package/dist/esm/bundle.css +281 -124
- package/dist/esm/bundle.js +1545 -1545
- package/dist/esm/bundle.js.map +1 -1
- package/dist/esm/types/components/AlertDialog/AlertDialog.stories.d.ts +3 -0
- package/dist/esm/types/components/Dialog/Dialog.d.ts +7 -1
- package/dist/esm/types/components/Dialog/Dialog.stories.d.ts +3 -0
- package/dist/esm/types/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/esm/types/components/Dropdown/Dropdown.stories.d.ts +2 -0
- package/dist/esm/types/components/Form/Field.d.ts +26 -0
- package/dist/esm/types/components/Form/FieldMessage.d.ts +7 -0
- package/dist/esm/types/components/Form/Form.d.ts +49 -11
- package/dist/esm/types/components/Form/Form.stories.d.ts +23 -0
- package/dist/esm/types/components/Form/ValidationHintList.d.ts +17 -0
- package/dist/esm/types/components/Form/ValidationHintList.stories.d.ts +9 -0
- package/dist/esm/types/components/Form/index.d.ts +10 -0
- package/dist/esm/types/components/Form/useOptionBridge.d.ts +17 -0
- package/dist/esm/types/components/OtpInput/OtpInput.d.ts +17 -0
- package/dist/esm/types/components/OtpInput/OtpInput.stories.d.ts +15 -0
- package/dist/esm/types/components/OtpInput/OtpInputGroup.d.ts +25 -0
- package/dist/esm/types/components/OtpInput/index.d.ts +5 -0
- package/dist/esm/types/components/TextInput/TextInput.styles.d.ts +3 -0
- package/dist/esm/types/index.d.ts +5 -0
- package/dist/esm/types/theme/ThemeColorCoverageRuntime.stories.d.ts +10 -0
- package/dist/esm/types/utils/colors.d.ts +84 -0
- package/dist/index.d.ts +245 -2
- package/dist/index.js +3 -0
- package/dist/src/theme/global.css +351 -149
- package/dist/theme/ThemeColorCoverageRuntime.stories.js +91 -0
- package/dist/utils/colors.js +92 -0
- package/package.json +4 -2
- package/src/components/ActionButton/ActionButton.stories.tsx +6 -6
- package/src/components/ActionButton/ActionButton.styles.ts +1 -1
- package/src/components/AlertDialog/AlertDialog.stories.tsx +22 -0
- package/src/components/AlertDialog/AlertDialog.tsx +6 -6
- package/src/components/Avatar/Avatar.stories.tsx +1 -1
- package/src/components/Avatar/Avatar.styles.ts +1 -1
- package/src/components/Avatar/AvatarBase.tsx +1 -1
- package/src/components/Avatar/AvatarGroup.stories.tsx +1 -1
- package/src/components/Button/Buttons.stories.tsx +10 -10
- package/src/components/Calendar/Calendar.tsx +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +35 -12
- package/src/components/Checkbox/Checkbox.tsx +7 -5
- package/src/components/Collapsible/Collapsible.styles.ts +1 -1
- package/src/components/DataTable/DataTable.tsx +2 -2
- package/src/components/Dialog/Dialog.stories.tsx +173 -0
- package/src/components/Dialog/Dialog.tsx +32 -15
- package/src/components/Dropdown/Dropdown.styles.ts +1 -1
- package/src/components/Dropdown/Dropdown.tsx +16 -14
- package/src/components/DropdownMenu/DropdownMenu.tsx +3 -3
- package/src/components/FocusedScrollView/FocusedScrollView.stories.tsx +10 -10
- package/src/components/Form/Field.tsx +160 -0
- package/src/components/Form/FieldMessage.tsx +38 -0
- package/src/components/Form/Form.docs.mdx +67 -0
- package/src/components/Form/Form.stories.tsx +490 -0
- package/src/components/Form/Form.tsx +185 -87
- package/src/components/Form/README.md +284 -0
- package/src/components/Form/ValidationHintList.stories.tsx +118 -0
- package/src/components/Form/ValidationHintList.tsx +82 -0
- package/src/components/Form/index.ts +28 -0
- package/src/components/Form/useOptionBridge.ts +55 -0
- package/src/components/InputFilter/InputFilter.stories.tsx +1 -1
- package/src/components/InputFilter/InputFilter.styles.ts +14 -1
- package/src/components/InputFilter/InputFilter.tsx +33 -28
- package/src/components/Label/Label.styles.ts +2 -2
- package/src/components/Label/Label.tsx +1 -1
- package/src/components/Menu/Menu.tsx +12 -12
- package/src/components/NumberInput/NumberInput.stories.tsx +1 -1
- package/src/components/OtpInput/OtpInput.stories.tsx +168 -0
- package/src/components/OtpInput/OtpInput.tsx +210 -0
- package/src/components/OtpInput/OtpInputGroup.tsx +74 -0
- package/src/components/OtpInput/index.ts +5 -0
- package/src/components/PasswordInput/PasswordInput.stories.tsx +1 -1
- package/src/components/Popover/Popover.tsx +1 -1
- package/src/components/RadioGroup/RadioGroup.stories.tsx +4 -4
- package/src/components/RadioGroup/RadioGroup.tsx +2 -1
- package/src/components/Search/Search.stories.tsx +1 -1
- package/src/components/Search/Search.tsx +6 -2
- package/src/components/Slider/Slider.stories.tsx +7 -7
- package/src/components/Slider/Slider.tsx +1 -1
- package/src/components/Switch/Switch.stories.tsx +4 -4
- package/src/components/Table/Table.tsx +5 -5
- package/src/components/Tabs/Tabs.stories.tsx +1 -1
- package/src/components/Tabs/Tabs.tsx +29 -18
- package/src/components/Text/Text.stories.tsx +1 -1
- package/src/components/Text/Text.tsx +1 -1
- package/src/components/TextArea/TextArea.stories.tsx +1 -1
- package/src/components/TextArea/TextArea.styles.ts +3 -3
- package/src/components/TextInput/TextInput.stories.tsx +7 -7
- package/src/components/TextInput/TextInput.styles.ts +42 -19
- package/src/components/TextInput/TextInput.tsx +3 -1
- package/src/components/Toast/Toast.stories.tsx +1 -1
- package/src/components/Toast/Toast.styles.tsx +7 -7
- package/src/components/Toast/Toast.tsx +5 -4
- package/src/components/Toast/Toaster.tsx +17 -20
- package/src/components/Tree/Tree.stories.tsx +1 -1
- package/src/components/Tree/TreeItem.tsx +1 -1
- package/src/index.ts +5 -0
- package/src/theme/ThemeColorCoverageRuntime.stories.tsx +236 -0
- package/src/theme/direct-token-migration-plan.md +121 -0
- package/src/theme/figma-mcp-check-report.md +225 -0
- package/src/theme/figma-mcp-component-checklist.json +1250 -0
- package/src/theme/presets/colors.js +155 -44
- package/src/theme/themes/xspector/components/loading.css +2 -2
- package/src/theme/tokens/color.css +3 -3
- package/src/theme/tokens/components/action-button.css +1 -1
- package/src/theme/tokens/components/dropdown-menu.css +3 -3
- package/src/theme/tokens/components/loading.css +2 -2
- package/src/theme/tokens/components/switch.css +1 -1
- package/src/theme/utils.js +164 -25
- package/src/utils/colors.ts +92 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { THEME_COLOR_KEYS, getThemeColor } from "../utils/colors";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Theme/Color Coverage Runtime",
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "fullscreen",
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
const DEPRECATED_KEYS = new Set([
|
|
12
|
+
"text-dark",
|
|
13
|
+
"text-medium",
|
|
14
|
+
"text-light",
|
|
15
|
+
"text-grey-dark",
|
|
16
|
+
"text-grey-medium",
|
|
17
|
+
"text-grey-light",
|
|
18
|
+
"base-bg",
|
|
19
|
+
"base-bg2",
|
|
20
|
+
"base-bg3",
|
|
21
|
+
"base-workspace-stroke",
|
|
22
|
+
"base-guideline-stroke",
|
|
23
|
+
"base-popup",
|
|
24
|
+
"base-popup-highlight",
|
|
25
|
+
"base-popup-curtain",
|
|
26
|
+
"base-popup-foreground",
|
|
27
|
+
"background",
|
|
28
|
+
"foreground",
|
|
29
|
+
"surface",
|
|
30
|
+
"surface-foreground",
|
|
31
|
+
"primary-foreground",
|
|
32
|
+
"secondary-foreground",
|
|
33
|
+
"tertiary-foreground",
|
|
34
|
+
"info-foreground",
|
|
35
|
+
"success-foreground",
|
|
36
|
+
"warning-foreground",
|
|
37
|
+
"error-foreground",
|
|
38
|
+
"grey-foreground",
|
|
39
|
+
"grey2-foreground",
|
|
40
|
+
"function-default-outline",
|
|
41
|
+
]);
|
|
42
|
+
const RuntimeCoveragePanel = () => {
|
|
43
|
+
const rows = useMemo(() => {
|
|
44
|
+
const baseRows = Object.entries(THEME_COLOR_KEYS)
|
|
45
|
+
.map(([key, variableName]) => {
|
|
46
|
+
const runtimeValue = getThemeColor(variableName);
|
|
47
|
+
const hasRuntimeValue = runtimeValue.length > 0;
|
|
48
|
+
const canonicalKey = variableName.replace(/^--/, "");
|
|
49
|
+
return {
|
|
50
|
+
key,
|
|
51
|
+
variableName,
|
|
52
|
+
runtimeValue,
|
|
53
|
+
hasRuntimeValue,
|
|
54
|
+
canonicalKey,
|
|
55
|
+
isMappedAlias: key !== canonicalKey,
|
|
56
|
+
isDeprecated: DEPRECATED_KEYS.has(key),
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
.sort((a, b) => a.key.localeCompare(b.key));
|
|
60
|
+
const existingKeys = new Set(baseRows.map((row) => row.key));
|
|
61
|
+
const generatedDirectRows = baseRows
|
|
62
|
+
.filter((row) => row.isMappedAlias)
|
|
63
|
+
.map((row) => {
|
|
64
|
+
return {
|
|
65
|
+
key: row.canonicalKey,
|
|
66
|
+
variableName: row.variableName,
|
|
67
|
+
runtimeValue: row.runtimeValue,
|
|
68
|
+
hasRuntimeValue: row.hasRuntimeValue,
|
|
69
|
+
canonicalKey: row.canonicalKey,
|
|
70
|
+
isMappedAlias: false,
|
|
71
|
+
isDeprecated: false,
|
|
72
|
+
};
|
|
73
|
+
})
|
|
74
|
+
.filter((row) => !existingKeys.has(row.key));
|
|
75
|
+
return [...baseRows, ...generatedDirectRows].sort((a, b) => a.key.localeCompare(b.key));
|
|
76
|
+
}, []);
|
|
77
|
+
const activeRows = rows.filter((row) => !row.isDeprecated && !row.isMappedAlias);
|
|
78
|
+
const mappedRows = rows.filter((row) => !row.isDeprecated && row.isMappedAlias);
|
|
79
|
+
const deprecatedRows = rows.filter((row) => row.isDeprecated);
|
|
80
|
+
const missingRuntimeValue = rows.filter((row) => !row.hasRuntimeValue);
|
|
81
|
+
const activeMissingRuntimeValue = activeRows.filter((row) => !row.hasRuntimeValue);
|
|
82
|
+
const mappedMissingRuntimeValue = mappedRows.filter((row) => !row.hasRuntimeValue);
|
|
83
|
+
const deprecatedMissingRuntimeValue = deprecatedRows.filter((row) => !row.hasRuntimeValue);
|
|
84
|
+
const stateRows = rows.filter((row) => row.variableName.startsWith("--state-"));
|
|
85
|
+
const stateRuntimeMissing = stateRows.filter((row) => !row.hasRuntimeValue);
|
|
86
|
+
const renderTable = (tableRows) => (_jsx("div", { className: "rounded-md border border-bg-stroke2 bg-bg-bg2 overflow-auto", children: _jsxs("table", { className: "w-full text-small3", children: [_jsx("thead", { className: "sticky top-0 bg-bg-bg3", children: _jsxs("tr", { children: [_jsx("th", { className: "text-left p-2", children: "Key" }), _jsx("th", { className: "text-left p-2", children: "CSS Variable" }), _jsx("th", { className: "text-left p-2", children: "Runtime" }), _jsx("th", { className: "text-left p-2", children: "Preview" })] }) }), _jsx("tbody", { children: tableRows.map((row) => (_jsxs("tr", { className: "border-t border-bg-stroke2", children: [_jsx("td", { className: "p-2", children: row.key }), _jsx("td", { className: "p-2", children: row.variableName }), _jsx("td", { className: "p-2", children: row.hasRuntimeValue ? row.runtimeValue : "missing" }), _jsx("td", { className: "p-2", children: row.hasRuntimeValue ? (_jsx("span", { className: "inline-block w-6 h-4 rounded border border-bg-stroke2", style: { backgroundColor: `var(${row.variableName})` } })) : ("-") })] }, row.key))) })] }) }));
|
|
87
|
+
return (_jsxs("div", { className: "p-6 space-y-4 bg-bg-bg2 text-text-g-contrast-high min-h-screen text-text-black", children: [_jsx("h2", { className: "text-h5", children: "Theme Color Runtime Coverage" }), _jsxs("div", { className: "grid grid-cols-2 gap-3 max-w-3xl", children: [_jsxs("div", { className: "rounded-md border border-bg-stroke2 p-3 bg-bg-bg2", children: [_jsx("div", { className: "text-small3", children: "Total keys" }), _jsx("div", { className: "text-h6", children: rows.length })] }), _jsxs("div", { className: "rounded-md border border-bg-stroke2 p-3 bg-bg-bg2", children: [_jsx("div", { className: "text-small3", children: "Missing runtime values" }), _jsx("div", { className: "text-h6", children: missingRuntimeValue.length })] }), _jsxs("div", { className: "rounded-md border border-bg-stroke2 p-3 bg-bg-bg2", children: [_jsx("div", { className: "text-small3", children: "State runtime coverage" }), _jsxs("div", { className: "text-h6", children: [stateRows.length - stateRuntimeMissing.length, "/", stateRows.length] })] }), _jsxs("div", { className: "rounded-md border border-bg-stroke2 p-3 bg-bg-bg2", children: [_jsx("div", { className: "text-small3", children: "Runtime coverage" }), _jsxs("div", { className: "text-h6", children: [rows.length - missingRuntimeValue.length, "/", rows.length] })] })] }), _jsxs("div", { className: "grid grid-cols-3 gap-3 max-w-4xl", children: [_jsxs("div", { className: "rounded-md border border-bg-stroke2 p-3 bg-bg-bg2", children: [_jsx("div", { className: "text-small3", children: "Active keys" }), _jsxs("div", { className: "text-h6", children: [activeRows.length - activeMissingRuntimeValue.length, "/", activeRows.length] })] }), _jsxs("div", { className: "rounded-md border border-bg-stroke2 p-3 bg-bg-bg2", children: [_jsx("div", { className: "text-small3", children: "Mapped keys (alias to canonical)" }), _jsxs("div", { className: "text-h6", children: [mappedRows.length - mappedMissingRuntimeValue.length, "/", mappedRows.length] })] }), _jsxs("div", { className: "rounded-md border border-bg-stroke2 p-3 bg-bg-bg2", children: [_jsx("div", { className: "text-small3", children: "Deprecated keys" }), _jsxs("div", { className: "text-h6", children: [deprecatedRows.length - deprecatedMissingRuntimeValue.length, "/", deprecatedRows.length] })] })] }), missingRuntimeValue.length > 0 ? (_jsxs("div", { className: "rounded-md border border-warning p-3 bg-warning-transparent-8", children: [_jsx("div", { className: "text-small2 text-warning", children: "Missing runtime values" }), _jsx("div", { className: "text-small3 mt-1", children: missingRuntimeValue.map((item) => item.variableName).join(", ") })] })) : null, _jsxs("div", { className: "space-y-2", children: [_jsx("h3", { className: "text-subtitle3", children: "Active Tokens" }), renderTable(activeRows)] }), _jsxs("div", { className: "space-y-2", children: [_jsx("h3", { className: "text-subtitle3", children: "Mapped Tokens (Alias)" }), renderTable(mappedRows)] }), _jsxs("div", { className: "space-y-2", children: [_jsx("h3", { className: "text-subtitle3", children: "Deprecated Aliases" }), renderTable(deprecatedRows)] })] }));
|
|
88
|
+
};
|
|
89
|
+
export const RuntimeCoverage = {
|
|
90
|
+
render: () => _jsx(RuntimeCoveragePanel, {}),
|
|
91
|
+
};
|
package/dist/utils/colors.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
/** CSS variable names for theme colors (resolved by data-theme) */
|
|
2
2
|
export const THEME_COLOR_KEYS = {
|
|
3
|
+
/* ----- Main / Brand core ----- */
|
|
4
|
+
"main-primary": "--main-primary",
|
|
5
|
+
"main-secondary": "--main-secondary",
|
|
6
|
+
"main-tertiary": "--main-tertiary",
|
|
7
|
+
"brand-midnight-blue": "--brand-midnight-blue",
|
|
8
|
+
"brand-columbia-blue": "--brand-columbia-blue",
|
|
9
|
+
"brand-background": "--brand-background",
|
|
10
|
+
"brand-lemon-glacier": "--brand-lemon-glacier",
|
|
3
11
|
/* ----- Palette: Primary ----- */
|
|
4
12
|
"primary-5": "--ramps-primary-5",
|
|
5
13
|
"primary-10": "--ramps-primary-10",
|
|
@@ -207,6 +215,14 @@ export const THEME_COLOR_KEYS = {
|
|
|
207
215
|
"disable-outline": "--state-disable-outline",
|
|
208
216
|
/* ----- Text ----- */
|
|
209
217
|
"text-black": "--text-black",
|
|
218
|
+
"text-contrast-low": "--text-contrast-low",
|
|
219
|
+
"text-contrast-medium": "--text-contrast-medium",
|
|
220
|
+
"text-contrast-high": "--text-contrast-high",
|
|
221
|
+
"text-contrast-max": "--text-contrast-max",
|
|
222
|
+
"text-g-contrast-low": "--text-g-contrast-low",
|
|
223
|
+
"text-g-contrast-medium": "--text-g-contrast-medium",
|
|
224
|
+
"text-g-contrast-high": "--text-g-contrast-high",
|
|
225
|
+
/* ----- Deprecated text aliases ----- */
|
|
210
226
|
"text-dark": "--text-dark",
|
|
211
227
|
"text-medium": "--text-medium",
|
|
212
228
|
"text-light": "--text-light",
|
|
@@ -236,7 +252,31 @@ export const THEME_COLOR_KEYS = {
|
|
|
236
252
|
"function-active-hover-bg": "--function-active-hover-bg",
|
|
237
253
|
"function-active-stroke": "--function-active-stroke",
|
|
238
254
|
"function-active-icon": "--function-active-icon",
|
|
255
|
+
/* ----- Direct modal/background tokens ----- */
|
|
256
|
+
"modal-surface": "--modal-surface",
|
|
257
|
+
"modal-highlight": "--modal-highlight",
|
|
258
|
+
"modal-overlay": "--modal-overlay",
|
|
259
|
+
"bg-bg1": "--bg-bg1",
|
|
260
|
+
"bg-bg2": "--bg-bg2",
|
|
261
|
+
"bg-bg3": "--bg-bg3",
|
|
262
|
+
"bg-stroke1": "--bg-stroke1",
|
|
263
|
+
"bg-stroke2": "--bg-stroke2",
|
|
264
|
+
"state-primary-text-solid": "--state-primary-text-solid",
|
|
265
|
+
"state-primary-text-hover": "--state-primary-text-hover",
|
|
266
|
+
"state-secondary-text-solid": "--state-secondary-text-solid",
|
|
267
|
+
"state-secondary-text-hover": "--state-secondary-text-hover",
|
|
268
|
+
"state-tertiary-text-solid": "--state-tertiary-text-solid",
|
|
269
|
+
"state-tertiary-text-hover": "--state-tertiary-text-hover",
|
|
270
|
+
"state-info-text-solid": "--state-info-text-solid",
|
|
271
|
+
"state-info-text-hover": "--state-info-text-hover",
|
|
272
|
+
"state-success-text-solid": "--state-success-text-solid",
|
|
273
|
+
"state-success-text-hover": "--state-success-text-hover",
|
|
274
|
+
"state-warning-text-solid": "--state-warning-text-solid",
|
|
275
|
+
"state-warning-text-hover": "--state-warning-text-hover",
|
|
276
|
+
"state-error-text-solid": "--state-error-text-solid",
|
|
277
|
+
"state-error-text-hover": "--state-error-text-hover",
|
|
239
278
|
/* ----- Base ----- */
|
|
279
|
+
/* ----- Deprecated base aliases ----- */
|
|
240
280
|
"base-bg": "--base-color-bg",
|
|
241
281
|
"base-bg2": "--base-color-bg2",
|
|
242
282
|
"base-bg3": "--base-color-bg3",
|
|
@@ -249,7 +289,59 @@ export const THEME_COLOR_KEYS = {
|
|
|
249
289
|
/* ----- Common ----- */
|
|
250
290
|
"common-white": "--common-white",
|
|
251
291
|
"common-black": "--common-black",
|
|
292
|
+
"brand-rvl-yellow": "--brand-rvl-yellow",
|
|
293
|
+
"brand-rvl-grey": "--brand-rvl-grey",
|
|
294
|
+
/* ----- Others ----- */
|
|
295
|
+
"others-1": "--others-1",
|
|
296
|
+
"others-2": "--others-2",
|
|
297
|
+
"others-3": "--others-3",
|
|
298
|
+
"others-4": "--others-4",
|
|
299
|
+
"others-5": "--others-5",
|
|
300
|
+
"others-6": "--others-6",
|
|
301
|
+
"others-7": "--others-7",
|
|
302
|
+
"others-8": "--others-8",
|
|
303
|
+
"others-9": "--others-9",
|
|
304
|
+
"others-10": "--others-10",
|
|
305
|
+
"others-11": "--others-11",
|
|
306
|
+
"others-12": "--others-12",
|
|
307
|
+
"others-13": "--others-13",
|
|
308
|
+
"others-14": "--others-14",
|
|
309
|
+
"others-15": "--others-15",
|
|
310
|
+
"others-16": "--others-16",
|
|
311
|
+
"others-17": "--others-17",
|
|
312
|
+
"others-18": "--others-18",
|
|
313
|
+
"others-19": "--others-19",
|
|
314
|
+
"others-20": "--others-20",
|
|
315
|
+
"others-21": "--others-21",
|
|
316
|
+
"others-22": "--others-22",
|
|
317
|
+
"others-23": "--others-23",
|
|
318
|
+
"others-24": "--others-24",
|
|
319
|
+
"others-25": "--others-25",
|
|
320
|
+
"others-26": "--others-26",
|
|
321
|
+
"others-27": "--others-27",
|
|
322
|
+
"others-28": "--others-28",
|
|
323
|
+
"others-29": "--others-29",
|
|
324
|
+
"others-30": "--others-30",
|
|
325
|
+
"others-31": "--others-31",
|
|
326
|
+
"others-32": "--others-32",
|
|
327
|
+
"others-33": "--others-33",
|
|
328
|
+
"others-34": "--others-34",
|
|
329
|
+
"others-35": "--others-35",
|
|
330
|
+
/* ----- Page background ----- */
|
|
331
|
+
"page-bg-main": "--page-bg-main",
|
|
332
|
+
"page-bg-circle-top-g-in": "--page-bg-circle-top-g-in",
|
|
333
|
+
"page-bg-circle-top-g-out": "--page-bg-circle-top-g-out",
|
|
334
|
+
"page-bg-circle-bottom-g-in": "--page-bg-circle-bottom-g-in",
|
|
335
|
+
"page-bg-circle-bottom-g-out": "--page-bg-circle-bottom-g-out",
|
|
336
|
+
/* ----- Extra surface/background ----- */
|
|
337
|
+
"modal-line": "--modal-line",
|
|
338
|
+
"bg-bg4": "--bg-bg4",
|
|
339
|
+
"bg-bg5": "--bg-bg5",
|
|
340
|
+
"bg-stroke3": "--bg-stroke3",
|
|
341
|
+
"bg-stroke4": "--bg-stroke4",
|
|
342
|
+
"bg-stroke5": "--bg-stroke5",
|
|
252
343
|
/* ----- Semantic ----- */
|
|
344
|
+
/* ----- Deprecated semantic aliases ----- */
|
|
253
345
|
background: "--background",
|
|
254
346
|
foreground: "--foreground",
|
|
255
347
|
surface: "--surface",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rovula/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"main": "dist/cjs/bundle.js",
|
|
5
5
|
"module": "dist/esm/bundle.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@headlessui/react": "^2.0.3",
|
|
79
79
|
"@heroicons/react": "^2.1.3",
|
|
80
|
-
"
|
|
80
|
+
"@hookform/resolvers": "^5.2.2",
|
|
81
81
|
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
82
82
|
"@radix-ui/react-avatar": "^1.1.0",
|
|
83
83
|
"@radix-ui/react-checkbox": "^1.0.4",
|
|
@@ -99,9 +99,11 @@
|
|
|
99
99
|
"class-variance-authority": "^0.7.0",
|
|
100
100
|
"clsx": "^2.1.1",
|
|
101
101
|
"date-fns": "^3.6.0",
|
|
102
|
+
"lucide-react": "^0.460.0",
|
|
102
103
|
"react": "^17.0.0 || ^18.0.0",
|
|
103
104
|
"react-day-picker": "^9.0.7",
|
|
104
105
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
106
|
+
"react-hook-form": "^7.71.2",
|
|
105
107
|
"tailwind-merge": "^2.3.0",
|
|
106
108
|
"tailwindcss-animate": "^1.0.7",
|
|
107
109
|
"yup": "^1.4.0"
|
|
@@ -20,7 +20,7 @@ const meta = {
|
|
|
20
20
|
},
|
|
21
21
|
decorators: [
|
|
22
22
|
(Story) => (
|
|
23
|
-
<div className="p-5 bg-
|
|
23
|
+
<div className="p-5 bg-bg-bg2">
|
|
24
24
|
<Story />
|
|
25
25
|
</div>
|
|
26
26
|
),
|
|
@@ -99,23 +99,23 @@ const forcedStateClassName: Record<
|
|
|
99
99
|
const icon = <ArrowsUpDownIcon />;
|
|
100
100
|
|
|
101
101
|
const renderPreview = (shape: "round" | "capsule") => (
|
|
102
|
-
<div className="bg-
|
|
102
|
+
<div className="bg-bg-bg2 p-8 min-h-screen">
|
|
103
103
|
<div className="flex flex-col gap-6">
|
|
104
|
-
<h3 className="text-xl font-semibold tracking-wide text-text-
|
|
104
|
+
<h3 className="text-xl font-semibold tracking-wide text-text-contrast-max">Function button</h3>
|
|
105
105
|
|
|
106
106
|
{previewStates.map((state) => (
|
|
107
107
|
<div
|
|
108
108
|
key={state.key}
|
|
109
109
|
className="grid grid-cols-[120px_repeat(3,minmax(0,1fr))] items-stretch gap-4"
|
|
110
110
|
>
|
|
111
|
-
<span className="pt-3 text-sm font-semibold text-text-
|
|
111
|
+
<span className="pt-3 text-sm font-semibold text-text-contrast-max">{state.label}</span>
|
|
112
112
|
|
|
113
113
|
{previewVariants.map((previewVariant) => (
|
|
114
114
|
<div
|
|
115
115
|
key={previewVariant.variant}
|
|
116
|
-
className="h-full rounded-lg border border-
|
|
116
|
+
className="h-full rounded-lg border border-bg-stroke1 bg-bg-bg1 p-3"
|
|
117
117
|
>
|
|
118
|
-
<span className="text-xs font-semibold tracking-wide text-text-
|
|
118
|
+
<span className="text-xs font-semibold tracking-wide text-text-contrast-max uppercase">
|
|
119
119
|
{previewVariant.label}
|
|
120
120
|
</span>
|
|
121
121
|
|
|
@@ -105,3 +105,25 @@ export const CustomStyle = {
|
|
|
105
105
|
);
|
|
106
106
|
},
|
|
107
107
|
} satisfies StoryObj;
|
|
108
|
+
|
|
109
|
+
export const FigmaFail = {
|
|
110
|
+
render: () => (
|
|
111
|
+
<div className="flex w-full">
|
|
112
|
+
<AlertDialog defaultOpen>
|
|
113
|
+
<AlertDialogContent>
|
|
114
|
+
<AlertDialogHeader>
|
|
115
|
+
<AlertDialogTitle>Infomation update failed</AlertDialogTitle>
|
|
116
|
+
<AlertDialogDescription>
|
|
117
|
+
Please login again and complete your profile to activate your account.
|
|
118
|
+
</AlertDialogDescription>
|
|
119
|
+
</AlertDialogHeader>
|
|
120
|
+
<AlertDialogFooter>
|
|
121
|
+
<AlertDialogAction className="w-[140px] justify-center">
|
|
122
|
+
Try again
|
|
123
|
+
</AlertDialogAction>
|
|
124
|
+
</AlertDialogFooter>
|
|
125
|
+
</AlertDialogContent>
|
|
126
|
+
</AlertDialog>
|
|
127
|
+
</div>
|
|
128
|
+
),
|
|
129
|
+
} satisfies StoryObj;
|
|
@@ -18,7 +18,7 @@ const AlertDialogOverlay = React.forwardRef<
|
|
|
18
18
|
>(({ className, ...props }, ref) => (
|
|
19
19
|
<AlertDialogPrimitive.Overlay
|
|
20
20
|
className={cn(
|
|
21
|
-
"fixed inset-0 bg-
|
|
21
|
+
"fixed inset-0 bg-modal-overlay z-50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
22
22
|
className
|
|
23
23
|
)}
|
|
24
24
|
{...props}
|
|
@@ -37,7 +37,7 @@ const AlertDialogContent = React.forwardRef<
|
|
|
37
37
|
<AlertDialogPrimitive.Content
|
|
38
38
|
ref={ref}
|
|
39
39
|
className={cn(
|
|
40
|
-
"fixed
|
|
40
|
+
"fixed left-[50%] top-[50%] z-50 grid w-[calc(100%-32px)] max-w-[460px] translate-x-[-50%] translate-y-[-50%] gap-8 rounded-md bg-modal-surface px-6 py-8 text-text-contrast-max shadow-[0px_12px_24px_-4px_rgba(0,0,0,0.12)] duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
|
|
41
41
|
className
|
|
42
42
|
)}
|
|
43
43
|
{...props}
|
|
@@ -52,7 +52,7 @@ const AlertDialogHeader = ({
|
|
|
52
52
|
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
53
53
|
<div
|
|
54
54
|
className={cn(
|
|
55
|
-
"flex flex-col
|
|
55
|
+
"flex flex-col items-center gap-2 text-center",
|
|
56
56
|
className
|
|
57
57
|
)}
|
|
58
58
|
{...props}
|
|
@@ -66,7 +66,7 @@ const AlertDialogFooter = ({
|
|
|
66
66
|
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
67
67
|
<div
|
|
68
68
|
className={cn(
|
|
69
|
-
"flex flex-col-reverse sm:flex-row sm:
|
|
69
|
+
"flex flex-col-reverse items-center justify-center gap-3 sm:flex-row sm:gap-4",
|
|
70
70
|
className
|
|
71
71
|
)}
|
|
72
72
|
{...props}
|
|
@@ -80,7 +80,7 @@ const AlertDialogTitle = React.forwardRef<
|
|
|
80
80
|
>(({ className, ...props }, ref) => (
|
|
81
81
|
<AlertDialogPrimitive.Title
|
|
82
82
|
ref={ref}
|
|
83
|
-
className={cn("typography-
|
|
83
|
+
className={cn("typography-subtitle3 text-text-contrast-max", className)}
|
|
84
84
|
{...props}
|
|
85
85
|
/>
|
|
86
86
|
));
|
|
@@ -92,7 +92,7 @@ const AlertDialogDescription = React.forwardRef<
|
|
|
92
92
|
>(({ className, ...props }, ref) => (
|
|
93
93
|
<AlertDialogPrimitive.Description
|
|
94
94
|
ref={ref}
|
|
95
|
-
className={cn("text-
|
|
95
|
+
className={cn("typography-small1 text-text-contrast-max", className)}
|
|
96
96
|
{...props}
|
|
97
97
|
/>
|
|
98
98
|
));
|
|
@@ -52,7 +52,7 @@ export const Preview = {
|
|
|
52
52
|
const BORDER: AvatarProps["rounded"][] = ["full", "normal", "none"];
|
|
53
53
|
|
|
54
54
|
return (
|
|
55
|
-
<div className="flex flex-col gap-2 w-full
|
|
55
|
+
<div className="flex flex-col gap-2 w-full bg-bg-bg2 p-20">
|
|
56
56
|
{BORDER.map((rounded) => (
|
|
57
57
|
<div key={rounded} className="flex flex-row items-center gap-3">
|
|
58
58
|
<Avatar
|
|
@@ -2,7 +2,7 @@ import { cva } from "class-variance-authority";
|
|
|
2
2
|
|
|
3
3
|
export const avatarVariants = cva(
|
|
4
4
|
[
|
|
5
|
-
"flex items-center justify-center bg-grey2-700 text-
|
|
5
|
+
"flex items-center justify-center bg-grey2-700 text-common-black typography-subtitle2 truncate",
|
|
6
6
|
],
|
|
7
7
|
{
|
|
8
8
|
variants: {
|
|
@@ -39,7 +39,7 @@ const AvatarFallback = React.forwardRef<
|
|
|
39
39
|
<AvatarPrimitive.Fallback
|
|
40
40
|
ref={ref}
|
|
41
41
|
className={cn(
|
|
42
|
-
"flex h-full w-full items-center justify-center rounded-full bg-
|
|
42
|
+
"flex h-full w-full items-center justify-center rounded-full bg-inherit text-inherit",
|
|
43
43
|
className
|
|
44
44
|
)}
|
|
45
45
|
{...props}
|
|
@@ -55,7 +55,7 @@ export const Preview = {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
|
-
<div className="flex flex-col gap-2 w-full
|
|
58
|
+
<div className="flex flex-col gap-2 w-full bg-bg-bg2 p-20">
|
|
59
59
|
<div className="flex flex-row items-center gap-3">
|
|
60
60
|
<AvatarGroup>
|
|
61
61
|
<Avatar size="lg" rounded="full" type="text" text="AS" />
|
|
@@ -221,11 +221,11 @@ const previewStates = [
|
|
|
221
221
|
|
|
222
222
|
export const FigmaPreview = {
|
|
223
223
|
render: () => (
|
|
224
|
-
<div className="bg-
|
|
224
|
+
<div className="bg-bg-bg2 p-8 min-h-screen">
|
|
225
225
|
<div className="flex flex-col gap-10">
|
|
226
226
|
{previewColors.map((color) => (
|
|
227
227
|
<div key={color} className="flex flex-col gap-2">
|
|
228
|
-
<h3 className="text-xl font-semibold tracking-wide text-text-
|
|
228
|
+
<h3 className="text-xl font-semibold tracking-wide text-text-contrast-max capitalize">
|
|
229
229
|
{color} btn
|
|
230
230
|
</h3>
|
|
231
231
|
|
|
@@ -234,16 +234,16 @@ export const FigmaPreview = {
|
|
|
234
234
|
key={state.label}
|
|
235
235
|
className="grid grid-cols-[repeat(3,minmax(0,1fr))] items-stretch gap-2"
|
|
236
236
|
>
|
|
237
|
-
{/* <span className="pt-3 text-sm font-semibold text-text-
|
|
237
|
+
{/* <span className="pt-3 text-sm font-semibold text-text-contrast-max">
|
|
238
238
|
{state.label}
|
|
239
239
|
</span> */}
|
|
240
240
|
|
|
241
241
|
{previewStyles.map((style) => (
|
|
242
242
|
<div
|
|
243
243
|
key={style.label}
|
|
244
|
-
className="h-full rounded-lg border border-
|
|
244
|
+
className="h-full rounded-lg border border-bg-stroke1 bg-bg-bg1 p-3"
|
|
245
245
|
>
|
|
246
|
-
<span className="text-xs font-semibold tracking-wide text-text-
|
|
246
|
+
<span className="text-xs font-semibold tracking-wide text-text-contrast-max uppercase">
|
|
247
247
|
{style.label} ({state.label})
|
|
248
248
|
</span>
|
|
249
249
|
|
|
@@ -295,11 +295,11 @@ export const FigmaPreview = {
|
|
|
295
295
|
|
|
296
296
|
export const FigmaPreviewCapsule = {
|
|
297
297
|
render: () => (
|
|
298
|
-
<div className="bg-
|
|
298
|
+
<div className="bg-bg-bg2 p-8 min-h-screen">
|
|
299
299
|
<div className="flex flex-col gap-10">
|
|
300
300
|
{previewColors.map((color) => (
|
|
301
301
|
<div key={color} className="flex flex-col gap-4">
|
|
302
|
-
<h3 className="text-xl font-semibold tracking-wide text-text-
|
|
302
|
+
<h3 className="text-xl font-semibold tracking-wide text-text-contrast-max capitalize">
|
|
303
303
|
{color} btn
|
|
304
304
|
</h3>
|
|
305
305
|
|
|
@@ -308,16 +308,16 @@ export const FigmaPreviewCapsule = {
|
|
|
308
308
|
key={state.label}
|
|
309
309
|
className="grid grid-cols-[repeat(3,minmax(0,1fr))] items-stretch gap-4"
|
|
310
310
|
>
|
|
311
|
-
{/* <span className="pt-3 text-sm font-semibold text-text-
|
|
311
|
+
{/* <span className="pt-3 text-sm font-semibold text-text-contrast-max">
|
|
312
312
|
{state.label}
|
|
313
313
|
</span> */}
|
|
314
314
|
|
|
315
315
|
{previewStyles.map((style) => (
|
|
316
316
|
<div
|
|
317
317
|
key={style.label}
|
|
318
|
-
className="h-full rounded-lg border border-
|
|
318
|
+
className="h-full rounded-lg border border-bg-stroke1 bg-bg-bg1 p-3"
|
|
319
319
|
>
|
|
320
|
-
<span className="text-xs font-semibold tracking-wide text-text-
|
|
320
|
+
<span className="text-xs font-semibold tracking-wide text-text-contrast-max uppercase">
|
|
321
321
|
{style.label} ({state.label})
|
|
322
322
|
</span>
|
|
323
323
|
|
|
@@ -22,7 +22,7 @@ function Calendar({
|
|
|
22
22
|
captionLayout="dropdown-years"
|
|
23
23
|
{...props}
|
|
24
24
|
className={cn(
|
|
25
|
-
"bg-
|
|
25
|
+
"bg-bg-bg1 text-common-black border-bg-bg1",
|
|
26
26
|
className
|
|
27
27
|
)}
|
|
28
28
|
classNames={{
|
|
@@ -30,8 +30,8 @@ function Calendar({
|
|
|
30
30
|
day_button: cn(defaultClassNames.day_button, "size-9"),
|
|
31
31
|
day: "typography-subtitle1 ",
|
|
32
32
|
today:
|
|
33
|
-
"text-bold text-
|
|
34
|
-
selected: "bg-primary !text-primary-
|
|
33
|
+
"text-bold text-common-black [&_button]:rounded-full [&_button]:!border-primary [&_button]:!border [&_button]:!border-solid",
|
|
34
|
+
selected: "bg-primary !text-state-primary-text-solid rounded-full ",
|
|
35
35
|
weekdays: "text-gray-400",
|
|
36
36
|
month_caption: cn(defaultClassNames.month_caption, "h-[54px]"),
|
|
37
37
|
outside: "text-gray-400",
|
|
@@ -12,7 +12,7 @@ const meta = {
|
|
|
12
12
|
},
|
|
13
13
|
decorators: [
|
|
14
14
|
(Story) => (
|
|
15
|
-
<div className="p-5 flex w-full bg-
|
|
15
|
+
<div className="p-5 flex w-full bg-bg-bg2">
|
|
16
16
|
<Story />
|
|
17
17
|
</div>
|
|
18
18
|
),
|
|
@@ -37,7 +37,7 @@ export const Default = {
|
|
|
37
37
|
<Checkbox id="terms" {...props} />
|
|
38
38
|
<label
|
|
39
39
|
htmlFor="terms"
|
|
40
|
-
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:
|
|
40
|
+
className="text-sm font-medium leading-none text-text-contrast-max peer-disabled:cursor-not-allowed peer-disabled:text-state-disable-outline"
|
|
41
41
|
>
|
|
42
42
|
Accept terms and conditions
|
|
43
43
|
</label>
|
|
@@ -59,11 +59,11 @@ export const WithText = {
|
|
|
59
59
|
<div className="grid gap-1.5 leading-none">
|
|
60
60
|
<label
|
|
61
61
|
htmlFor="terms1"
|
|
62
|
-
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:
|
|
62
|
+
className="text-sm font-medium leading-none text-text-contrast-max peer-disabled:cursor-not-allowed peer-disabled:text-state-disable-outline"
|
|
63
63
|
>
|
|
64
64
|
Accept terms and conditions
|
|
65
65
|
</label>
|
|
66
|
-
<p className="text-sm text-
|
|
66
|
+
<p className="text-sm text-text-g-contrast-medium">
|
|
67
67
|
You agree to our Terms of Service and Privacy Policy.
|
|
68
68
|
</p>
|
|
69
69
|
</div>
|
|
@@ -83,7 +83,7 @@ export const Disabled = {
|
|
|
83
83
|
<Checkbox id="terms2" disabled />
|
|
84
84
|
<label
|
|
85
85
|
htmlFor="terms2"
|
|
86
|
-
className="text-sm font-medium leading-none peer-disabled:cursor-not-allowed
|
|
86
|
+
className="text-sm font-medium leading-none text-state-disable-outline peer-disabled:cursor-not-allowed"
|
|
87
87
|
>
|
|
88
88
|
Accept terms and conditions
|
|
89
89
|
</label>
|
|
@@ -101,7 +101,11 @@ type CheckboxPreviewRow = {
|
|
|
101
101
|
|
|
102
102
|
const checkboxPreviewRows: CheckboxPreviewRow[] = [
|
|
103
103
|
{ label: "Default", checked: false },
|
|
104
|
-
{
|
|
104
|
+
{
|
|
105
|
+
label: "Hover",
|
|
106
|
+
checked: false,
|
|
107
|
+
className: "!border-function-default-hover",
|
|
108
|
+
},
|
|
105
109
|
{ label: "Disable", checked: false, disabled: true },
|
|
106
110
|
{ label: "Checked", checked: true },
|
|
107
111
|
{
|
|
@@ -118,17 +122,36 @@ const checkboxPreviewRows: CheckboxPreviewRow[] = [
|
|
|
118
122
|
className:
|
|
119
123
|
"!data-[state=indeterminate]:border-function-active-hover !data-[state=indeterminate]:bg-function-active-hover",
|
|
120
124
|
},
|
|
121
|
-
{
|
|
125
|
+
{
|
|
126
|
+
label: "Indeterminate - Disable",
|
|
127
|
+
checked: "indeterminate",
|
|
128
|
+
disabled: true,
|
|
129
|
+
},
|
|
122
130
|
];
|
|
123
131
|
|
|
124
132
|
export const FigmaPreview = {
|
|
125
133
|
render: () => (
|
|
126
|
-
<div className="bg-
|
|
127
|
-
<div className="mx-auto flex w-full max-w-[360px] flex-col gap-4 rounded-lg border border-
|
|
134
|
+
<div className="bg-bg-bg2 p-8 min-h-screen">
|
|
135
|
+
<div className="mx-auto flex w-full max-w-[360px] flex-col gap-4 rounded-lg border border-bg-stroke1 bg-bg-bg1 p-6">
|
|
128
136
|
{checkboxPreviewRows.map((row) => (
|
|
129
|
-
<div
|
|
130
|
-
|
|
131
|
-
|
|
137
|
+
<div
|
|
138
|
+
key={row.label}
|
|
139
|
+
className="grid grid-cols-[160px_16px] items-center gap-4"
|
|
140
|
+
>
|
|
141
|
+
<span
|
|
142
|
+
className={`text-sm font-medium ${
|
|
143
|
+
row.disabled
|
|
144
|
+
? "text-state-disable-outline"
|
|
145
|
+
: "text-text-contrast-max"
|
|
146
|
+
}`}
|
|
147
|
+
>
|
|
148
|
+
{row.label}
|
|
149
|
+
</span>
|
|
150
|
+
<Checkbox
|
|
151
|
+
checked={row.checked}
|
|
152
|
+
disabled={row.disabled}
|
|
153
|
+
className={row.className}
|
|
154
|
+
/>
|
|
132
155
|
</div>
|
|
133
156
|
))}
|
|
134
157
|
</div>
|
|
@@ -14,17 +14,19 @@ const Checkbox = React.forwardRef<
|
|
|
14
14
|
<CheckboxPrimitive.Root
|
|
15
15
|
ref={ref}
|
|
16
16
|
className={cn(
|
|
17
|
-
"peer size-4 shrink-0 cursor-pointer rounded-[var(--spacing-spacing-xxs,2px)] border border-function-default-solid ring-offset-
|
|
17
|
+
"peer size-4 shrink-0 cursor-pointer rounded-[var(--spacing-spacing-xxs,2px)] border border-function-default-solid ring-offset-bg-bg1",
|
|
18
18
|
"hover:border-function-default-hover",
|
|
19
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-
|
|
20
|
-
"disabled:cursor-not-allowed disabled:border-state-disable-
|
|
19
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-input-active-stroke focus-visible:ring-offset-2",
|
|
20
|
+
"disabled:cursor-not-allowed disabled:border-state-disable-outline disabled:text-state-disable-outline",
|
|
21
|
+
"disabled:data-[state=checked]:border-state-disable-solid disabled:data-[state=checked]:bg-state-disable-solid",
|
|
22
|
+
"disabled:data-[state=indeterminate]:border-state-disable-solid disabled:data-[state=indeterminate]:bg-state-disable-solid",
|
|
21
23
|
{
|
|
22
24
|
"data-[state=checked]:border-function-active-solid data-[state=checked]:bg-function-active-solid data-[state=checked]:text-function-active-icon data-[state=indeterminate]:border-function-active-solid data-[state=indeterminate]:bg-function-active-solid data-[state=indeterminate]:text-function-active-icon":
|
|
23
25
|
!props.disabled,
|
|
24
26
|
"hover:data-[state=checked]:border-function-active-hover hover:data-[state=checked]:bg-function-active-hover hover:data-[state=indeterminate]:border-function-active-hover hover:data-[state=indeterminate]:bg-function-active-hover":
|
|
25
27
|
!props.disabled,
|
|
26
28
|
},
|
|
27
|
-
className
|
|
29
|
+
className,
|
|
28
30
|
)}
|
|
29
31
|
{...props}
|
|
30
32
|
>
|
|
@@ -32,7 +34,7 @@ const Checkbox = React.forwardRef<
|
|
|
32
34
|
className={cn(
|
|
33
35
|
"flex size-[14px] items-center justify-center text-current",
|
|
34
36
|
"[&[data-state=checked]_.checkbox-check-icon]:block",
|
|
35
|
-
"[&[data-state=indeterminate]_.checkbox-minus-icon]:block"
|
|
37
|
+
"[&[data-state=indeterminate]_.checkbox-minus-icon]:block",
|
|
36
38
|
)}
|
|
37
39
|
>
|
|
38
40
|
<CheckIcon className="checkbox-check-icon hidden size-[14px]" />
|
|
@@ -2,7 +2,7 @@ import { cva } from "class-variance-authority";
|
|
|
2
2
|
|
|
3
3
|
export const collapseButtonVariants = cva(
|
|
4
4
|
[
|
|
5
|
-
"flex flex-1 bg-secondary-default hover:bg-secondary-hover text-secondary-
|
|
5
|
+
"flex flex-1 bg-secondary-default hover:bg-secondary-hover text-state-secondary-text-solid",
|
|
6
6
|
"focus:outline-none focus-visible:ring focus-visible:ring-gray-500 focus-visible:ring-opacity-75",
|
|
7
7
|
],
|
|
8
8
|
{
|