@node-core/ui-components 1.0.1-c0bc4dd7eb49f97f35ce0983849d17702404c76a → 1.0.1-da75492230302b0f459aab323d2f6fdac6269a06
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/Common/AlertBox/index.js +5 -0
- package/Common/AlertBox/index.module.css +2 -76
- package/Common/AvatarGroup/Avatar/index.js +11 -0
- package/Common/AvatarGroup/Avatar/index.module.css +2 -40
- package/Common/AvatarGroup/Overlay/index.js +6 -0
- package/Common/AvatarGroup/Overlay/index.module.css +2 -31
- package/Common/AvatarGroup/index.js +21 -0
- package/Common/AvatarGroup/index.module.css +2 -21
- package/Common/Badge/index.js +5 -0
- package/Common/Badge/index.module.css +2 -38
- package/Common/BadgeGroup/index.js +6 -0
- package/Common/BadgeGroup/index.module.css +2 -77
- package/Common/Banner/index.js +4 -0
- package/Common/Banner/index.module.css +2 -42
- package/Common/BaseActiveLink/index.js +14 -0
- package/Common/BaseButton/index.js +10 -0
- package/Common/BaseButton/index.module.css +2 -142
- package/Common/BaseCodeBox/index.js +50 -0
- package/Common/BaseCodeBox/index.module.css +2 -78
- package/Common/BaseCrossLink/index.js +12 -0
- package/Common/BaseCrossLink/index.module.css +2 -51
- package/Common/BaseLinkTabs/index.js +5 -0
- package/Common/BaseLinkTabs/index.module.css +2 -43
- package/Common/BasePagination/Ellipsis/index.js +4 -0
- package/Common/BasePagination/Ellipsis/index.module.css +2 -10
- package/Common/BasePagination/PaginationListItem/index.js +6 -0
- package/Common/BasePagination/PaginationListItem/index.module.css +2 -27
- package/Common/BasePagination/PrevNextArrow.js +7 -0
- package/Common/BasePagination/index.js +10 -0
- package/Common/BasePagination/index.module.css +2 -39
- package/Common/BasePagination/useGetPageElements.js +77 -0
- package/Common/Blockquote/index.js +4 -0
- package/Common/Blockquote/index.module.css +2 -29
- package/Common/Breadcrumbs/BreadcrumbHomeLink/index.js +9 -0
- package/Common/Breadcrumbs/BreadcrumbHomeLink/index.module.css +2 -5
- package/Common/Breadcrumbs/BreadcrumbItem/index.js +6 -0
- package/Common/Breadcrumbs/BreadcrumbItem/index.module.css +2 -41
- package/Common/Breadcrumbs/BreadcrumbLink/index.js +5 -0
- package/Common/Breadcrumbs/BreadcrumbLink/index.module.css +2 -22
- package/Common/Breadcrumbs/BreadcrumbRoot/index.js +4 -0
- package/Common/Breadcrumbs/BreadcrumbRoot/index.module.css +2 -9
- package/Common/Breadcrumbs/BreadcrumbTruncatedItem/index.js +4 -0
- package/Common/Breadcrumbs/index.js +22 -0
- package/Common/ChangeHistory/index.js +9 -0
- package/Common/ChangeHistory/index.module.css +2 -83
- package/Common/CodeTabs/index.js +5 -0
- package/Common/CodeTabs/index.module.css +2 -56
- package/Common/DataTag/index.js +18 -0
- package/Common/DataTag/index.module.css +2 -56
- package/Common/GlowingBackdrop/index.js +5 -0
- package/Common/GlowingBackdrop/index.module.css +2 -32
- package/Common/LanguageDropDown/index.js +11 -0
- package/Common/LanguageDropDown/index.module.css +2 -53
- package/Common/Modal/index.js +10 -0
- package/Common/Modal/index.module.css +2 -79
- package/Common/NodejsLogo/index.js +7 -0
- package/Common/NodejsLogo/index.module.css +2 -6
- package/Common/Notification/index.js +6 -0
- package/Common/Notification/index.module.css +2 -20
- package/Common/Preview/index.js +7 -0
- package/Common/Preview/index.module.css +2 -79
- package/Common/Select/index.js +47 -0
- package/Common/Select/index.module.css +2 -161
- package/Common/Separator/index.js +7 -0
- package/Common/Separator/index.module.css +2 -16
- package/Common/Skeleton/index.js +18 -0
- package/Common/Skeleton/index.module.css +2 -30
- package/Common/Tabs/index.js +6 -0
- package/Common/Tabs/index.module.css +2 -54
- package/Common/ThemeToggle/index.js +7 -0
- package/Common/ThemeToggle/index.module.css +2 -15
- package/Common/Tooltip/index.js +8 -0
- package/Common/Tooltip/index.module.css +2 -43
- package/Containers/Article/index.js +4 -0
- package/Containers/Article/index.module.css +2 -70
- package/Containers/Footer/index.js +21 -0
- package/Containers/Footer/index.module.css +2 -46
- package/Containers/MetaBar/index.js +12 -0
- package/Containers/MetaBar/index.module.css +2 -91
- package/Containers/NavBar/NavItem/index.js +7 -0
- package/Containers/NavBar/NavItem/index.module.css +2 -60
- package/Containers/NavBar/index.js +18 -0
- package/Containers/NavBar/index.module.css +2 -125
- package/Containers/Sidebar/ProgressionIcon/index.js +3 -0
- package/Containers/Sidebar/SidebarGroup/index.js +9 -0
- package/Containers/Sidebar/SidebarGroup/index.module.css +2 -64
- package/Containers/Sidebar/SidebarItem/index.js +11 -0
- package/Containers/Sidebar/SidebarItem/index.module.css +2 -56
- package/Containers/Sidebar/index.js +15 -0
- package/Containers/Sidebar/index.module.css +2 -30
- package/Icons/HexagonGrid.js +3 -0
- package/Icons/InstallationMethod/Choco.js +3 -0
- package/Icons/InstallationMethod/Devbox.js +3 -0
- package/Icons/InstallationMethod/Docker.js +3 -0
- package/Icons/InstallationMethod/FNM.js +3 -0
- package/Icons/InstallationMethod/Homebrew.js +3 -0
- package/Icons/InstallationMethod/N.js +5 -0
- package/Icons/InstallationMethod/NVM.js +3 -0
- package/Icons/InstallationMethod/Volta.js +3 -0
- package/Icons/InstallationMethod/{index.ts → index.js} +0 -1
- package/Icons/Logos/JsWhite.js +3 -0
- package/Icons/Logos/Nodejs.js +12 -0
- package/Icons/Logos/index.js +3 -0
- package/Icons/OperatingSystem/AIX.js +3 -0
- package/Icons/OperatingSystem/Apple.js +3 -0
- package/Icons/OperatingSystem/Linux.js +3 -0
- package/Icons/OperatingSystem/Microsoft.js +3 -0
- package/Icons/OperatingSystem/{index.ts → index.js} +0 -1
- package/Icons/PackageManager/Npm.js +3 -0
- package/Icons/PackageManager/Pnpm.js +3 -0
- package/Icons/PackageManager/Yarn.js +3 -0
- package/Icons/PackageManager/{index.ts → index.js} +0 -1
- package/Icons/Social/Bluesky.js +3 -0
- package/Icons/Social/Discord.js +3 -0
- package/Icons/Social/GitHub.js +3 -0
- package/Icons/Social/LinkedIn.js +3 -0
- package/Icons/Social/Mastodon.js +3 -0
- package/Icons/Social/Slack.js +3 -0
- package/Icons/Social/X.js +3 -0
- package/Icons/Social/{index.ts → index.js} +0 -1
- package/MDX/CodeTabs.js +25 -0
- package/Providers/NotificationProvider/index.js +16 -0
- package/Providers/NotificationProvider/index.module.css +2 -0
- package/package.json +6 -51
- package/stylelint/one-utility-class-per-line.mjs +34 -50
- package/stylelint/utils.mjs +19 -25
- package/styles/index.css +2 -38
- package/types.js +1 -0
- package/Common/AlertBox/index.stories.tsx +0 -73
- package/Common/AlertBox/index.tsx +0 -24
- package/Common/AvatarGroup/Avatar/index.stories.tsx +0 -22
- package/Common/AvatarGroup/Avatar/index.tsx +0 -67
- package/Common/AvatarGroup/Overlay/index.stories.tsx +0 -33
- package/Common/AvatarGroup/Overlay/index.tsx +0 -37
- package/Common/AvatarGroup/__tests__/index.test.jsx +0 -55
- package/Common/AvatarGroup/index.stories.tsx +0 -56
- package/Common/AvatarGroup/index.tsx +0 -83
- package/Common/Badge/index.stories.tsx +0 -38
- package/Common/Badge/index.tsx +0 -35
- package/Common/BadgeGroup/index.stories.tsx +0 -35
- package/Common/BadgeGroup/index.tsx +0 -35
- package/Common/Banner/index.stories.tsx +0 -29
- package/Common/Banner/index.tsx +0 -18
- package/Common/BaseActiveLink/__tests__/index.test.jsx +0 -52
- package/Common/BaseActiveLink/index.tsx +0 -34
- package/Common/BaseButton/index.stories.tsx +0 -67
- package/Common/BaseButton/index.tsx +0 -59
- package/Common/BaseCodeBox/index.stories.tsx +0 -39
- package/Common/BaseCodeBox/index.tsx +0 -122
- package/Common/BaseCrossLink/index.stories.tsx +0 -38
- package/Common/BaseCrossLink/index.tsx +0 -46
- package/Common/BaseLinkTabs/index.stories.tsx +0 -34
- package/Common/BaseLinkTabs/index.tsx +0 -53
- package/Common/BasePagination/Ellipsis/index.stories.tsx +0 -10
- package/Common/BasePagination/Ellipsis/index.tsx +0 -11
- package/Common/BasePagination/PaginationListItem/__tests__/index.test.jsx +0 -58
- package/Common/BasePagination/PaginationListItem/index.stories.tsx +0 -40
- package/Common/BasePagination/PaginationListItem/index.tsx +0 -39
- package/Common/BasePagination/PrevNextArrow.tsx +0 -15
- package/Common/BasePagination/__tests__/index.test.jsx +0 -180
- package/Common/BasePagination/index.stories.tsx +0 -67
- package/Common/BasePagination/index.tsx +0 -77
- package/Common/BasePagination/useGetPageElements.tsx +0 -132
- package/Common/Blockquote/index.stories.tsx +0 -45
- package/Common/Blockquote/index.tsx +0 -11
- package/Common/Breadcrumbs/BreadcrumbHomeLink/index.tsx +0 -30
- package/Common/Breadcrumbs/BreadcrumbItem/index.tsx +0 -42
- package/Common/Breadcrumbs/BreadcrumbLink/index.tsx +0 -37
- package/Common/Breadcrumbs/BreadcrumbRoot/index.tsx +0 -20
- package/Common/Breadcrumbs/BreadcrumbTruncatedItem/index.tsx +0 -9
- package/Common/Breadcrumbs/index.stories.tsx +0 -94
- package/Common/Breadcrumbs/index.tsx +0 -81
- package/Common/ChangeHistory/index.stories.tsx +0 -130
- package/Common/ChangeHistory/index.tsx +0 -67
- package/Common/CodeTabs/index.stories.tsx +0 -73
- package/Common/CodeTabs/index.tsx +0 -16
- package/Common/DataTag/index.stories.tsx +0 -40
- package/Common/DataTag/index.tsx +0 -39
- package/Common/GlowingBackdrop/index.stories.tsx +0 -10
- package/Common/GlowingBackdrop/index.tsx +0 -13
- package/Common/LanguageDropDown/index.stories.tsx +0 -19
- package/Common/LanguageDropDown/index.tsx +0 -56
- package/Common/Modal/index.stories.tsx +0 -32
- package/Common/Modal/index.tsx +0 -48
- package/Common/NodejsLogo/index.stories.tsx +0 -14
- package/Common/NodejsLogo/index.tsx +0 -26
- package/Common/Notification/index.stories.tsx +0 -36
- package/Common/Notification/index.tsx +0 -34
- package/Common/Preview/index.stories.tsx +0 -44
- package/Common/Preview/index.tsx +0 -25
- package/Common/Select/__tests__/index.test.jsx +0 -67
- package/Common/Select/index.stories.tsx +0 -111
- package/Common/Select/index.tsx +0 -187
- package/Common/Separator/index.stories.tsx +0 -32
- package/Common/Separator/index.tsx +0 -27
- package/Common/Skeleton/index.tsx +0 -39
- package/Common/Tabs/__tests__/index.test.jsx +0 -52
- package/Common/Tabs/index.stories.tsx +0 -50
- package/Common/Tabs/index.tsx +0 -54
- package/Common/ThemeToggle/__tests__/index.test.jsx +0 -35
- package/Common/ThemeToggle/index.stories.tsx +0 -10
- package/Common/ThemeToggle/index.tsx +0 -15
- package/Common/Tooltip/index.stories.tsx +0 -73
- package/Common/Tooltip/index.tsx +0 -48
- package/Containers/Article/index.stories.tsx +0 -39
- package/Containers/Article/index.tsx +0 -9
- package/Containers/DocSideBar/index.tsx +0 -0
- package/Containers/Footer/index.stories.tsx +0 -27
- package/Containers/Footer/index.tsx +0 -95
- package/Containers/MetaBar/__tests__/index.test.jsx +0 -63
- package/Containers/MetaBar/index.stories.tsx +0 -80
- package/Containers/MetaBar/index.tsx +0 -72
- package/Containers/NavBar/NavItem/index.stories.tsx +0 -38
- package/Containers/NavBar/NavItem/index.tsx +0 -44
- package/Containers/NavBar/index.stories.tsx +0 -45
- package/Containers/NavBar/index.tsx +0 -94
- package/Containers/Sidebar/ProgressionIcon/index.tsx +0 -16
- package/Containers/Sidebar/SidebarGroup/index.stories.tsx +0 -36
- package/Containers/Sidebar/SidebarGroup/index.tsx +0 -49
- package/Containers/Sidebar/SidebarItem/index.stories.tsx +0 -15
- package/Containers/Sidebar/SidebarItem/index.tsx +0 -43
- package/Containers/Sidebar/index.stories.tsx +0 -88
- package/Containers/Sidebar/index.tsx +0 -70
- package/Icons/HexagonGrid.stories.tsx +0 -10
- package/Icons/HexagonGrid.tsx +0 -1434
- package/Icons/InstallationMethod/Choco.tsx +0 -78
- package/Icons/InstallationMethod/Devbox.tsx +0 -21
- package/Icons/InstallationMethod/Docker.tsx +0 -20
- package/Icons/InstallationMethod/FNM.tsx +0 -132
- package/Icons/InstallationMethod/Homebrew.tsx +0 -69
- package/Icons/InstallationMethod/N.tsx +0 -32
- package/Icons/InstallationMethod/NVM.tsx +0 -63
- package/Icons/InstallationMethod/Volta.tsx +0 -34
- package/Icons/Logos/JsGreen.tsx +0 -24
- package/Icons/Logos/JsWhite.tsx +0 -37
- package/Icons/Logos/Nodejs.tsx +0 -372
- package/Icons/Logos/NodejsStackedBlack.tsx +0 -98
- package/Icons/Logos/NodejsStackedDark.tsx +0 -124
- package/Icons/Logos/NodejsStackedLight.tsx +0 -123
- package/Icons/Logos/NodejsStackedWhite.tsx +0 -98
- package/Icons/Logos/index.ts +0 -17
- package/Icons/OperatingSystem/AIX.tsx +0 -46
- package/Icons/OperatingSystem/Apple.tsx +0 -23
- package/Icons/OperatingSystem/Linux.tsx +0 -969
- package/Icons/OperatingSystem/Microsoft.tsx +0 -19
- package/Icons/PackageManager/Npm.tsx +0 -21
- package/Icons/PackageManager/Pnpm.tsx +0 -22
- package/Icons/PackageManager/Yarn.tsx +0 -22
- package/Icons/Social/Bluesky.tsx +0 -19
- package/Icons/Social/Discord.tsx +0 -20
- package/Icons/Social/GitHub.tsx +0 -16
- package/Icons/Social/LinkedIn.tsx +0 -16
- package/Icons/Social/Mastodon.tsx +0 -36
- package/Icons/Social/Slack.tsx +0 -31
- package/Icons/Social/X.tsx +0 -16
- package/MDX/CodeTabs.tsx +0 -47
- package/stylelint/__tests__/index.test.mjs +0 -80
- package/styles/animations.css +0 -47
- package/styles/base.css +0 -17
- package/styles/effects.css +0 -12
- package/styles/markdown.css +0 -173
- package/styles/theme.css +0 -175
- package/types.ts +0 -25
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as Toast from '@radix-ui/react-toast';
|
|
3
|
+
import { createContext, useContext, useEffect, useState } from 'react';
|
|
4
|
+
import Notification from '#ui/Common/Notification';
|
|
5
|
+
import styles from './index.module.css';
|
|
6
|
+
const NotificationContext = createContext(null);
|
|
7
|
+
export const NotificationDispatch = createContext(() => { });
|
|
8
|
+
export const useNotification = () => useContext(NotificationDispatch);
|
|
9
|
+
export const NotificationProvider = ({ children }) => {
|
|
10
|
+
const [notification, dispatch] = useState(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
const timeout = setTimeout(() => dispatch(null), notification?.duration);
|
|
13
|
+
return () => clearTimeout(timeout);
|
|
14
|
+
}, [notification]);
|
|
15
|
+
return (_jsx(NotificationContext.Provider, { value: notification, children: _jsx(NotificationDispatch.Provider, { value: dispatch, children: _jsxs(Toast.Provider, { children: [children, notification && (_jsx(Notification, { duration: notification.duration, children: notification.message })), _jsx(Toast.Viewport, { className: styles.viewport })] }) }) }));
|
|
16
|
+
};
|
package/package.json
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node-core/ui-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"exports": {
|
|
5
|
-
"./*": [
|
|
6
|
-
"./*",
|
|
7
|
-
"./*.tsx",
|
|
8
|
-
"./*/index.tsx",
|
|
9
|
-
"./*.ts",
|
|
10
|
-
"./*/index.ts"
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
"files": [
|
|
14
|
-
"Common",
|
|
15
|
-
"Containers",
|
|
16
|
-
"Icons",
|
|
17
|
-
"MDX",
|
|
18
|
-
"stylelint",
|
|
19
|
-
"styles",
|
|
20
|
-
"types.ts"
|
|
21
|
-
],
|
|
22
4
|
"dependencies": {
|
|
23
5
|
"@heroicons/react": "^2.2.0",
|
|
24
6
|
"@radix-ui/react-avatar": "^1.1.10",
|
|
@@ -30,52 +12,25 @@
|
|
|
30
12
|
"@radix-ui/react-tabs": "~1.1.12",
|
|
31
13
|
"@radix-ui/react-toast": "~1.2.14",
|
|
32
14
|
"@radix-ui/react-tooltip": "~1.2.7",
|
|
33
|
-
"@tailwindcss/postcss": "~4.1.
|
|
15
|
+
"@tailwindcss/postcss": "~4.1.11",
|
|
34
16
|
"@vcarl/remark-headings": "~0.1.0",
|
|
35
17
|
"classnames": "~2.5.1",
|
|
36
18
|
"postcss-calc": "^10.1.1",
|
|
37
19
|
"tailwindcss": "~4.0.17"
|
|
38
20
|
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"@storybook/addon-styling-webpack": "^1.0.1",
|
|
41
|
-
"@storybook/addon-themes": "^9.0.3",
|
|
42
|
-
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
|
43
|
-
"@storybook/react": "^9.0.3",
|
|
44
|
-
"@storybook/react-webpack5": "^9.0.3",
|
|
45
|
-
"@testing-library/user-event": "~14.6.1",
|
|
46
|
-
"@types/node": "22.15.3",
|
|
47
|
-
"@types/react": "^19.1.6",
|
|
48
|
-
"cross-env": "^7.0.3",
|
|
49
|
-
"css-loader": "~7.1.2",
|
|
50
|
-
"eslint-plugin-react": "~7.37.4",
|
|
51
|
-
"eslint-plugin-storybook": "~9.0.3",
|
|
52
|
-
"global-jsdom": "^26.0.0",
|
|
53
|
-
"postcss-loader": "~8.1.1",
|
|
54
|
-
"react": "^19.1.0",
|
|
55
|
-
"storybook": "^9.0.3",
|
|
56
|
-
"style-loader": "~4.0.0",
|
|
57
|
-
"stylelint": "^16.20.0",
|
|
58
|
-
"stylelint-config-standard": "^38.0.0",
|
|
59
|
-
"stylelint-order": "7.0.0",
|
|
60
|
-
"stylelint-selector-bem-pattern": "4.0.1",
|
|
61
|
-
"tsx": "^4.19.3",
|
|
62
|
-
"typescript": "~5.8.2",
|
|
63
|
-
"typescript-eslint": "~8.33.1"
|
|
64
|
-
},
|
|
65
21
|
"imports": {
|
|
66
22
|
"#ui/*": [
|
|
67
|
-
"./*"
|
|
68
|
-
"./*.tsx",
|
|
69
|
-
"./*/index.tsx",
|
|
70
|
-
"./*.ts",
|
|
71
|
-
"./*/index.ts"
|
|
23
|
+
"./*"
|
|
72
24
|
]
|
|
73
25
|
},
|
|
74
26
|
"engines": {
|
|
75
27
|
"node": ">=20"
|
|
76
28
|
},
|
|
77
|
-
"version": "1.0.1-
|
|
29
|
+
"version": "1.0.1-da75492230302b0f459aab323d2f6fdac6269a06",
|
|
78
30
|
"scripts": {
|
|
31
|
+
"compile:ts": "tsc",
|
|
32
|
+
"compile:css": "postcss --dir dist --base src \"src/**/*.module.css\" src/styles/index.css",
|
|
33
|
+
"compile": "node --run compile:ts && node --run compile:css",
|
|
79
34
|
"lint": "turbo run lint:js lint:css",
|
|
80
35
|
"lint:css": "stylelint \"**/*.css\" --allow-empty-input --cache --cache-strategy=content --cache-location=.stylelintcache",
|
|
81
36
|
"lint:fix": "node --run lint -- -- --fix",
|
|
@@ -1,64 +1,48 @@
|
|
|
1
1
|
import stylelint from 'stylelint';
|
|
2
|
-
|
|
3
2
|
import { indentClassNames } from './utils.mjs';
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
createPlugin,
|
|
7
|
-
utils: { report, ruleMessages },
|
|
8
|
-
} = stylelint;
|
|
9
|
-
|
|
3
|
+
const { createPlugin, utils: { report, ruleMessages }, } = stylelint;
|
|
10
4
|
const name = 'nodejs/one-utility-class-per-line';
|
|
11
|
-
|
|
12
5
|
const messages = ruleMessages(name, {
|
|
13
|
-
|
|
14
|
-
`Each
|
|
15
|
-
spacing: classNames =>
|
|
16
|
-
`Each utility class used with @apply should be indented by 2 spaces on a new line; ${classNames}`,
|
|
6
|
+
className: classNames => `Each line should contain only one Tailwind utility class; "${classNames}"`,
|
|
7
|
+
spacing: classNames => `Each utility class used with @apply should be indented by 2 spaces on a new line; ${classNames}`,
|
|
17
8
|
});
|
|
18
|
-
|
|
19
9
|
const meta = {
|
|
20
|
-
|
|
21
|
-
|
|
10
|
+
url: 'https://github.com/nodejs/nodejs.org/blob/main/COLLABORATOR_GUIDE.md#styling-a-component',
|
|
11
|
+
fixable: true,
|
|
22
12
|
};
|
|
23
|
-
|
|
24
13
|
/** @type {import('stylelint').Rule} */
|
|
25
14
|
const rule = () => (root, result) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
});
|
|
15
|
+
root.walkAtRules('apply', rule => {
|
|
16
|
+
if (!rule.params.includes(' ')) {
|
|
17
|
+
// If there are no spaces in the params, we don't need to check anything
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
// Since we use 2 spaces for indentation, each line in the apply rule
|
|
21
|
+
// should be indented with two extra whitespaces.
|
|
22
|
+
const classes = rule.params.split(`${rule.raws.before} `);
|
|
23
|
+
const classNames = classes.join('');
|
|
24
|
+
// Check if the params contain any spaces
|
|
25
|
+
if (classNames.includes(' ')) {
|
|
26
|
+
if (classNames.includes('\n')) {
|
|
27
|
+
return report({
|
|
28
|
+
ruleName: name,
|
|
29
|
+
result: result,
|
|
30
|
+
message: messages.spacing(JSON.stringify(rule.params)),
|
|
31
|
+
node: rule,
|
|
32
|
+
fix: indentClassNames(rule),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return report({
|
|
36
|
+
ruleName: name,
|
|
37
|
+
result: result,
|
|
38
|
+
message: messages.className(rule.params),
|
|
39
|
+
node: rule,
|
|
40
|
+
fix: indentClassNames(rule),
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
58
44
|
};
|
|
59
|
-
|
|
60
45
|
rule.ruleName = name;
|
|
61
46
|
rule.messages = messages;
|
|
62
47
|
rule.meta = meta;
|
|
63
|
-
|
|
64
48
|
export default createPlugin(name, rule);
|
package/stylelint/utils.mjs
CHANGED
|
@@ -8,22 +8,17 @@
|
|
|
8
8
|
* @returns {Object|null} The modified rule with properly formatted class names, or null if the rule is invalid.
|
|
9
9
|
*/
|
|
10
10
|
export const indentClassNames = rule => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// Apply the indentation and join the class names back together
|
|
22
|
-
rule.params = applyIndentation(cleanedClasses, indent);
|
|
23
|
-
|
|
24
|
-
return rule;
|
|
11
|
+
// Ensure that the rule contains necessary properties
|
|
12
|
+
if (!rule || !rule.params || !rule.raws || !rule.raws.before) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const indent = ' '.repeat(rule.raws.before.length + 1);
|
|
16
|
+
// Clean and split the class names
|
|
17
|
+
const cleanedClasses = cleanClassNames(rule.params);
|
|
18
|
+
// Apply the indentation and join the class names back together
|
|
19
|
+
rule.params = applyIndentation(cleanedClasses, indent);
|
|
20
|
+
return rule;
|
|
25
21
|
};
|
|
26
|
-
|
|
27
22
|
/**
|
|
28
23
|
* Cleans the input string by removing unnecessary whitespace and newlines.
|
|
29
24
|
*
|
|
@@ -31,12 +26,11 @@ export const indentClassNames = rule => {
|
|
|
31
26
|
* @returns {string} The cleaned class names string.
|
|
32
27
|
*/
|
|
33
28
|
export const cleanClassNames = params => {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
return params
|
|
30
|
+
.replace(/[\n\r]+/g, '') // Remove new lines
|
|
31
|
+
.replace(/\s+/g, ' ') // Replace multiple spaces with a single space
|
|
32
|
+
.trim(); // Trim leading/trailing spaces
|
|
38
33
|
};
|
|
39
|
-
|
|
40
34
|
/**
|
|
41
35
|
* Applies the correct indentation to each class name in the string.
|
|
42
36
|
*
|
|
@@ -45,9 +39,9 @@ export const cleanClassNames = params => {
|
|
|
45
39
|
* @returns {string} The class names string with applied indentation.
|
|
46
40
|
*/
|
|
47
41
|
export const applyIndentation = (classes, indent) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
42
|
+
return classes
|
|
43
|
+
.split(' ') // Split into an array of class names
|
|
44
|
+
.map(className => indent + className) // Add indentation to each class
|
|
45
|
+
.join('\n') // Join with new lines
|
|
46
|
+
.trim(); // Remove extra space at the end
|
|
53
47
|
};
|
package/styles/index.css
CHANGED
|
@@ -1,38 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* IDE Support
|
|
4
|
-
* We recommend Stylelint and Tailwind Extensions for better IDE support.
|
|
5
|
-
* @see https://marketplace.visualstudio.com/items?itemName=bradlc.vscode-tailwindcss
|
|
6
|
-
* @see https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
@import 'tailwindcss';
|
|
10
|
-
@import './theme.css';
|
|
11
|
-
@import './animations.css';
|
|
12
|
-
@import './effects.css';
|
|
13
|
-
@import './base.css' layer(utilities);
|
|
14
|
-
@import './markdown.css' layer(utilities);
|
|
15
|
-
|
|
16
|
-
/*
|
|
17
|
-
The default border color has changed to `currentColor` in Tailwind CSS v4,
|
|
18
|
-
so we've added these compatibility styles to make sure everything still
|
|
19
|
-
looks the same as it did with Tailwind CSS v3.
|
|
20
|
-
|
|
21
|
-
If we ever want to remove these styles, we need to add an explicit border
|
|
22
|
-
color utility to any element that depends on these defaults.
|
|
23
|
-
*/
|
|
24
|
-
@layer base {
|
|
25
|
-
:root {
|
|
26
|
-
--header-height: calc(var(--spacing, 0.25rem) * 16);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
*,
|
|
30
|
-
::after,
|
|
31
|
-
::before,
|
|
32
|
-
::backdrop,
|
|
33
|
-
::file-selector-button {
|
|
34
|
-
border-color: var(--color-gray-200, currentColor);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@custom-variant aria-current (&[aria-current="page"]);
|
|
1
|
+
/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
|
|
2
|
+
@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-font-weight:initial;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-leading:initial;--tw-tracking:initial;--tw-border-style:solid;--tw-border-spacing-x:0;--tw-border-spacing-y:0}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-green-100:#edf2eb;--color-green-200:#c5e5b4;--color-green-300:#99cc7d;--color-green-400:#84ba64;--color-green-600:#417e38;--color-green-700:#2c682c;--color-green-800:#2c682c;--color-green-900:#1a3f1d;--color-gray-200:oklch(92.8% .006 264.531);--color-neutral-100:#f6f7f9;--color-neutral-200:#e9edf0;--color-neutral-300:#d9e1e4;--color-neutral-400:#cbd4d9;--color-neutral-600:#929fa5;--color-neutral-700:#6e7b83;--color-neutral-800:#556066;--color-neutral-900:#2c3437;--color-neutral-950:#0d121c;--color-white:#fff;--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:1.33333;--text-sm:.875rem;--text-sm--line-height:1.42857;--text-base:1rem;--text-base--line-height:1.5;--text-lg:1.125rem;--text-lg--line-height:1.55556;--text-xl:1.25rem;--text-xl--line-height:1.4;--text-2xl:1.5rem;--text-2xl--line-height:1.33333;--text-3xl:1.875rem;--text-3xl--line-height:1.2;--text-4xl:2.25rem;--text-4xl--line-height:1.11111;--text-5xl:3rem;--text-5xl--line-height:1;--text-6xl:3.75rem;--text-6xl--line-height:1;--text-7xl:4.5rem;--text-7xl--line-height:1;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--radius-xs:.125rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono);--color-danger-100:#fbf1f0;--color-danger-200:#fad3d4;--color-danger-300:#fab6b7;--color-danger-400:#fa8e8e;--color-danger-600:#de1a1b;--color-danger-700:#b80c0c;--color-danger-800:#900e0e;--color-danger-900:#661514;--color-warning-100:#fdf3e7;--color-warning-200:#fad9b0;--color-warning-300:#f5bc75;--color-warning-400:#e99c40;--color-warning-600:#ae5f00;--color-warning-700:#8b4d04;--color-warning-800:#683d08;--color-warning-900:#4d2f0b;--color-info-100:#e9f4fa;--color-info-200:#bce6fc;--color-info-300:#8ed4f8;--color-info-400:#52baed;--color-info-600:#0c7bb3;--color-info-700:#066291;--color-info-800:#074d71;--color-info-900:#0a3953;--color-accent1-100:#f7f1fb;--color-accent1-200:#ead9fb;--color-accent1-300:#dbbdf9;--color-accent1-400:#c79bf2;--color-accent1-600:#9756d6;--color-accent1-700:#7d3cbe;--color-accent1-800:#642b9e;--color-accent1-900:#361b52;--color-accent2-100:#fbf0f4;--color-accent2-200:#fbd4e6;--color-accent2-300:#fbb4d2;--color-accent2-400:#f68bb7;--color-accent2-600:#d6246e;--color-accent2-700:#b01356;--color-accent2-800:#8b1245;--color-accent2-900:#411526;--color-pulse-100:#0000330f;--color-pulse-200:#00002d17;--color-pulse-300:#ddeaf814;--color-pulse-400:#d3edf81d;--color-shadow:#101828;--font-open-sans:var(--font-open-sans);--font-ibm-plex-mono:var(--font-ibm-plex-mono);--font-weight-regular:400}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab,currentColor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}:root{--header-height:calc(var(--spacing,.25rem)*16)}*,:after,:before,::backdrop{border-color:var(--color-gray-200,currentColor)}::file-selector-button{border-color:var(--color-gray-200,currentColor)}:is(button,[role=button]):not(:disabled){cursor:pointer}}@layer components;@layer utilities{.pointer-events-none{pointer-events:none}.visible{visibility:visible}.relative{position:relative}.right-0{right:calc(var(--spacing)*0)}.container{width:100%}@media (min-width:670px){.container{max-width:670px}}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.mx-1\.5{margin-inline:calc(var(--spacing)*1.5)}.mt-4{margin-top:calc(var(--spacing)*4)}.mb-2{margin-bottom:calc(var(--spacing)*2)}.block{display:block}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.table{display:table}.size-3{width:calc(var(--spacing)*3);height:calc(var(--spacing)*3)}.size-4{width:calc(var(--spacing)*4);height:calc(var(--spacing)*4)}.size-32{width:calc(var(--spacing)*32);height:calc(var(--spacing)*32)}.h-4{height:calc(var(--spacing)*4)}.h-20{height:calc(var(--spacing)*20)}.h-72{height:calc(var(--spacing)*72)}.h-full{height:100%}.w-4{width:calc(var(--spacing)*4)}.w-20{width:calc(var(--spacing)*20)}.w-72{width:calc(var(--spacing)*72)}.w-200{width:calc(var(--spacing)*200)}.w-\[150px\]{width:150px}.w-\[305px\]{width:305px}.w-\[600px\]{width:600px}.w-full{width:100%}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-pointer{cursor:pointer}.list-none{list-style-type:none}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.justify-start{justify-content:flex-start}.gap-1{gap:calc(var(--spacing)*1)}.gap-3{gap:calc(var(--spacing)*3)}.gap-4{gap:calc(var(--spacing)*4)}.gap-6{gap:calc(var(--spacing)*6)}.bg-accent1-100{background-color:var(--color-accent1-100)}.bg-accent1-200{background-color:var(--color-accent1-200)}.bg-accent1-300{background-color:var(--color-accent1-300)}.bg-accent1-400{background-color:var(--color-accent1-400)}.bg-accent1-600{background-color:var(--color-accent1-600)}.bg-accent1-700{background-color:var(--color-accent1-700)}.bg-accent1-800{background-color:var(--color-accent1-800)}.bg-accent1-900{background-color:var(--color-accent1-900)}.bg-accent2-100{background-color:var(--color-accent2-100)}.bg-accent2-200{background-color:var(--color-accent2-200)}.bg-accent2-300{background-color:var(--color-accent2-300)}.bg-accent2-400{background-color:var(--color-accent2-400)}.bg-accent2-600{background-color:var(--color-accent2-600)}.bg-accent2-700{background-color:var(--color-accent2-700)}.bg-accent2-800{background-color:var(--color-accent2-800)}.bg-accent2-900{background-color:var(--color-accent2-900)}.bg-danger-100{background-color:var(--color-danger-100)}.bg-danger-200{background-color:var(--color-danger-200)}.bg-danger-300{background-color:var(--color-danger-300)}.bg-danger-400{background-color:var(--color-danger-400)}.bg-danger-600{background-color:var(--color-danger-600)}.bg-danger-700{background-color:var(--color-danger-700)}.bg-danger-800{background-color:var(--color-danger-800)}.bg-danger-900{background-color:var(--color-danger-900)}.bg-green-100{background-color:var(--color-green-100)}.bg-green-200{background-color:var(--color-green-200)}.bg-green-300{background-color:var(--color-green-300)}.bg-green-400{background-color:var(--color-green-400)}.bg-green-600{background-color:var(--color-green-600)}.bg-green-700{background-color:var(--color-green-700)}.bg-green-800{background-color:var(--color-green-800)}.bg-green-900{background-color:var(--color-green-900)}.bg-info-100{background-color:var(--color-info-100)}.bg-info-200{background-color:var(--color-info-200)}.bg-info-300{background-color:var(--color-info-300)}.bg-info-400{background-color:var(--color-info-400)}.bg-info-600{background-color:var(--color-info-600)}.bg-info-700{background-color:var(--color-info-700)}.bg-info-800{background-color:var(--color-info-800)}.bg-info-900{background-color:var(--color-info-900)}.bg-neutral-100{background-color:var(--color-neutral-100)}.bg-neutral-200{background-color:var(--color-neutral-200)}.bg-neutral-300{background-color:var(--color-neutral-300)}.bg-neutral-400{background-color:var(--color-neutral-400)}.bg-neutral-600{background-color:var(--color-neutral-600)}.bg-neutral-700{background-color:var(--color-neutral-700)}.bg-neutral-800{background-color:var(--color-neutral-800)}.bg-neutral-900{background-color:var(--color-neutral-900)}.bg-warning-100{background-color:var(--color-warning-100)}.bg-warning-200{background-color:var(--color-warning-200)}.bg-warning-300{background-color:var(--color-warning-300)}.bg-warning-400{background-color:var(--color-warning-400)}.bg-warning-600{background-color:var(--color-warning-600)}.bg-warning-700{background-color:var(--color-warning-700)}.bg-warning-800{background-color:var(--color-warning-800)}.bg-warning-900{background-color:var(--color-warning-900)}.fill-\[\#333333\]{fill:#333}.fill-neutral-700{fill:var(--color-neutral-700)}.p-3{padding:calc(var(--spacing)*3)}.p-4{padding:calc(var(--spacing)*4)}.p-6{padding:calc(var(--spacing)*6)}.pl-2{padding-left:calc(var(--spacing)*2)}.pl-4{padding-left:calc(var(--spacing)*4)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height))}.text-5xl{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height))}.text-6xl{font-size:var(--text-6xl);line-height:var(--tw-leading,var(--text-6xl--line-height))}.text-7xl{font-size:var(--text-7xl);line-height:var(--tw-leading,var(--text-7xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-regular{--tw-font-weight:var(--font-weight-regular);font-weight:var(--font-weight-regular)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.opacity-70{opacity:.7}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,)var(--tw-brightness,)var(--tw-contrast,)var(--tw-grayscale,)var(--tw-hue-rotate,)var(--tw-invert,)var(--tw-saturate,)var(--tw-sepia,)var(--tw-drop-shadow,)}.group-open\:rotate-180:is(:where(.group):is([open],:popover-open,:open) *){rotate:180deg}.peer-checked\:flex:is(:where(.peer):checked~*){display:flex}@media (prefers-reduced-motion:no-preference){.motion-safe\:transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}}.dark\:block:where([data-theme=dark],[data-theme=dark] *){display:block}.dark\:hidden:where([data-theme=dark],[data-theme=dark] *){display:none}.dark\:fill-neutral-100:where([data-theme=dark],[data-theme=dark] *){fill:var(--color-neutral-100)}.dark\:fill-white:where([data-theme=dark],[data-theme=dark] *){fill:var(--color-white)}*{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}html,body{height:100%}body{background-color:var(--color-white);font-family:var(--font-open-sans);color:var(--color-neutral-950)}@media (prefers-reduced-motion:no-preference){body{scroll-behavior:smooth}}body:where([data-theme=dark],[data-theme=dark] *){background-color:var(--color-neutral-950);color:var(--color-white)}main{gap:calc(var(--spacing)*6);flex-direction:column;width:100%;display:flex}main hr{border-top-style:var(--tw-border-style);border-top-width:1px;border-top-color:var(--color-neutral-200);background-color:var(--color-white);width:100%}main hr:where([data-theme=dark],[data-theme=dark] *){border-top-color:var(--color-neutral-900);background-color:var(--color-neutral-950)}main h1{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}main h2{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}main h3{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}main h4{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}main h5,main h6{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}main h1,main h2,main h3,main h4,main h5,main h6{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-neutral-900)}:is(main h1,main h2,main h3,main h4,main h5,main h6):where([data-theme=dark],[data-theme=dark] *){color:var(--color-white)}:is(main h1,main h2,main h3,main h4,main h5,main h6)[id] a{color:var(--color-neutral-900)}:is(main h1,main h2,main h3,main h4,main h5,main h6)[id] a:where([data-theme=dark],[data-theme=dark] *){color:var(--color-white)}main strong{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}main code{border-radius:var(--radius-xs);background-color:var(--color-neutral-100);padding-inline:calc(var(--spacing)*1);font-family:var(--font-ibm-plex-mono);font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height));--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold);color:var(--color-neutral-900)}main code:where([data-theme=dark],[data-theme=dark] *){background-color:var(--color-neutral-900);color:var(--color-white)}main p{color:var(--color-neutral-900)}main p:where([data-theme=dark],[data-theme=dark] *){color:var(--color-white)}main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor{color:var(--color-green-600)}@media not all and (min-width:670px){main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}}:is(main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor):where([data-theme=dark],[data-theme=dark] *){color:var(--color-green-400)}:is(main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor):hover{color:var(--color-green-900)}:is(main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor):hover:where([data-theme=dark],[data-theme=dark] *){color:var(--color-green-200)}@media not all and (min-width:670px){:is(main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor)[role=button]{--tw-font-weight:var(--font-weight-regular);font-weight:var(--font-weight-regular)}:is(main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor):has(code){-webkit-text-decoration-color:var(--color-neutral-800);-webkit-text-decoration-color:var(--color-neutral-800);text-decoration-color:var(--color-neutral-800)}:is(main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor):has(code):where([data-theme=dark],[data-theme=dark] *){-webkit-text-decoration-color:var(--color-neutral-200);-webkit-text-decoration-color:var(--color-neutral-200);text-decoration-color:var(--color-neutral-200)}}:is(main a:not(h1>a):not(h2>a):not(h3>a):not(h4>a):not(h5>a):not(h6>a),main .anchor):has(code) code{color:inherit}main ul{padding-right:calc(var(--spacing)*5);padding-left:calc(var(--spacing)*9);--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6);color:var(--color-neutral-900);list-style-type:disc}main ul:where([data-theme=dark],[data-theme=dark] *){color:var(--color-white)}main ul li div:has(>pre){margin-block:calc(var(--spacing)*1)!important}main ol{padding-inline:calc(var(--spacing)*5);--tw-leading:calc(var(--spacing)*6);line-height:calc(var(--spacing)*6);color:var(--color-neutral-900);list-style-type:decimal}main ol:where([data-theme=dark],[data-theme=dark] *){color:var(--color-white)}main ol li div:has(>pre){margin-block:calc(var(--spacing)*1)!important}main table{margin-bottom:calc(var(--spacing)*1);border-collapse:separate;--tw-border-spacing-x:calc(var(--spacing)*0);--tw-border-spacing-y:calc(var(--spacing)*0);width:100%;border-spacing:var(--tw-border-spacing-x)var(--tw-border-spacing-y);border-radius:var(--radius-xs);border-style:var(--tw-border-style);border-width:1px;border-color:var(--color-neutral-200);text-align:left;font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}main table:where([data-theme=dark],[data-theme=dark] *){border-color:var(--color-neutral-800)}main table th,main table td{border-style:var(--tw-border-style);border-width:1px;border-top-style:var(--tw-border-style);border-top-width:0;border-right-style:var(--tw-border-style);border-right-width:0;border-color:var(--color-neutral-200);padding-inline:calc(var(--spacing)*4);padding-block:calc(var(--spacing)*2);color:var(--color-neutral-900)}@media not all and (min-width:670px){main table th,main table td{border-left-style:var(--tw-border-style);border-left-width:0;display:block}}:is(main table th,main table td):where([data-theme=dark],[data-theme=dark] *){border-color:var(--color-neutral-800);color:var(--color-white)}:is(main table th,main table td)>a{padding-right:calc(var(--spacing)*2)}main table th{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}@media (min-width:40rem){main table tr:last-child>td{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@media not all and (min-width:670px){main table tr:last-child>td:last-child{border-bottom-style:var(--tw-border-style);border-bottom-width:0}}@media (min-width:40rem){main table td:first-child,main table th:first-child{border-left-style:var(--tw-border-style);border-left-width:0}}}h1.special{background-image:linear-gradient(180deg,var(--color-neutral-900)0%,#2c3437cc 100%)}@supports (color:color-mix(in lab, red, red)){h1.special{background-image:linear-gradient(180deg,var(--color-neutral-900)0%,color-mix(in oklab,var(--color-neutral-900)80%,transparent)100%)}}h1.special{font-size:var(--text-4xl);line-height:var(--tw-leading,var(--text-4xl--line-height));--tw-leading:3rem;--tw-tracking:-0.045rem;letter-spacing:-.045rem;-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;line-height:3rem}@media (min-width:48rem){h1.special{font-size:var(--text-5xl);line-height:var(--tw-leading,var(--text-5xl--line-height));--tw-leading:4rem;--tw-tracking:-0.06rem;letter-spacing:-.06rem;line-height:4rem}}h1.special:where([data-theme=dark],[data-theme=dark] *){background-image:linear-gradient(180deg,var(--color-white)0%,#fffc 100%)}@supports (color:color-mix(in lab, red, red)){h1.special:where([data-theme=dark],[data-theme=dark] *){background-image:linear-gradient(180deg,var(--color-white)0%,color-mix(in oklab,var(--color-white)80%,transparent)100%)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-leading{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-border-spacing-x{syntax:"<length>";inherits:false;initial-value:0}@property --tw-border-spacing-y{syntax:"<length>";inherits:false;initial-value:0}
|
package/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { ExclamationCircleIcon } from '@heroicons/react/24/solid';
|
|
2
|
-
import type { Meta as MetaObj, StoryObj } from '@storybook/react';
|
|
3
|
-
|
|
4
|
-
import AlertBox from '#ui/Common/AlertBox';
|
|
5
|
-
|
|
6
|
-
type Story = StoryObj<typeof AlertBox>;
|
|
7
|
-
type Meta = MetaObj<typeof AlertBox>;
|
|
8
|
-
|
|
9
|
-
export const Info: Story = {
|
|
10
|
-
args: {
|
|
11
|
-
level: 'info',
|
|
12
|
-
title: '3',
|
|
13
|
-
children:
|
|
14
|
-
'Legacy. Although this feature is unlikely to be removed and is still covered by semantic versioning guarantees, it is no longer actively maintained, and other alternatives are available.',
|
|
15
|
-
size: 'default',
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const Success: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
level: 'success',
|
|
22
|
-
title: '2',
|
|
23
|
-
children:
|
|
24
|
-
'Stable. Compatibility with the npm ecosystem is a high priority.',
|
|
25
|
-
size: 'default',
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const Warning: Story = {
|
|
30
|
-
args: {
|
|
31
|
-
level: 'warning',
|
|
32
|
-
title: '1',
|
|
33
|
-
children:
|
|
34
|
-
'Experimental. The feature is not subject to semantic versioning rules. Non-backward compatible changes or removal may occur in any future release. Use of the feature is not recommended in production environments. Experimental features are subdivided into stages:',
|
|
35
|
-
size: 'default',
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Danger: Story = {
|
|
40
|
-
args: {
|
|
41
|
-
level: 'danger',
|
|
42
|
-
title: '0',
|
|
43
|
-
children:
|
|
44
|
-
'Deprecated. The feature may emit warnings. Backward compatibility is not guaranteed.',
|
|
45
|
-
size: 'default',
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export const WithIcon: Story = {
|
|
50
|
-
args: {
|
|
51
|
-
level: 'info',
|
|
52
|
-
title: '3',
|
|
53
|
-
children: (
|
|
54
|
-
<p>
|
|
55
|
-
Lorem ipsum dolor sit amet <ExclamationCircleIcon /> consectetur
|
|
56
|
-
adipisicing elit. Inventore, quasi doloremque. Totam, earum velit, sunt
|
|
57
|
-
voluptates fugiat beatae praesentium quis magni explicabo repudiandae
|
|
58
|
-
nam aut molestias ex ad sequi eum!
|
|
59
|
-
</p>
|
|
60
|
-
),
|
|
61
|
-
size: 'default',
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export default {
|
|
66
|
-
component: AlertBox,
|
|
67
|
-
argTypes: {
|
|
68
|
-
size: {
|
|
69
|
-
options: ['default', 'small'],
|
|
70
|
-
control: { type: 'radio' },
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
} as Meta;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import type { FC, PropsWithChildren } from 'react';
|
|
3
|
-
|
|
4
|
-
import styles from './index.module.css';
|
|
5
|
-
|
|
6
|
-
type AlertBoxProps = PropsWithChildren<{
|
|
7
|
-
level: 'info' | 'success' | 'warning' | 'danger';
|
|
8
|
-
title: string;
|
|
9
|
-
size?: 'default' | 'small';
|
|
10
|
-
}>;
|
|
11
|
-
|
|
12
|
-
const AlertBox: FC<AlertBoxProps> = ({
|
|
13
|
-
level,
|
|
14
|
-
title,
|
|
15
|
-
children,
|
|
16
|
-
size = 'default',
|
|
17
|
-
}) => (
|
|
18
|
-
<div className={classNames(styles.alertBox, styles[level], styles[size])}>
|
|
19
|
-
<span className={styles.title}>{title}</span>
|
|
20
|
-
<span>{children}</span>
|
|
21
|
-
</div>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export default AlertBox;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Meta as MetaObj, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import Avatar from '#ui/Common/AvatarGroup/Avatar';
|
|
4
|
-
|
|
5
|
-
type Story = StoryObj<typeof Avatar>;
|
|
6
|
-
type Meta = MetaObj<typeof Avatar>;
|
|
7
|
-
|
|
8
|
-
export const Default: Story = {
|
|
9
|
-
args: {
|
|
10
|
-
image: 'https://avatars.githubusercontent.com/ghost',
|
|
11
|
-
nickname: 'ghost',
|
|
12
|
-
},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const NoSquare: Story = {
|
|
16
|
-
args: {
|
|
17
|
-
image: '/static/images/logo-hexagon-card.png',
|
|
18
|
-
nickname: 'SD',
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export default { component: Avatar } as Meta;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import * as RadixAvatar from '@radix-ui/react-avatar';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import type { HTMLAttributes } from 'react';
|
|
4
|
-
import { forwardRef } from 'react';
|
|
5
|
-
|
|
6
|
-
import type { LinkLike } from '#ui/types';
|
|
7
|
-
|
|
8
|
-
import styles from './index.module.css';
|
|
9
|
-
|
|
10
|
-
export type AvatarProps = {
|
|
11
|
-
image?: string;
|
|
12
|
-
name?: string;
|
|
13
|
-
nickname: string;
|
|
14
|
-
fallback?: string;
|
|
15
|
-
size?: 'small' | 'medium';
|
|
16
|
-
url?: string;
|
|
17
|
-
as?: LinkLike | 'div';
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const Avatar = forwardRef<
|
|
21
|
-
HTMLSpanElement,
|
|
22
|
-
HTMLAttributes<HTMLSpanElement> & AvatarProps
|
|
23
|
-
>(
|
|
24
|
-
(
|
|
25
|
-
{
|
|
26
|
-
image,
|
|
27
|
-
nickname,
|
|
28
|
-
name,
|
|
29
|
-
fallback,
|
|
30
|
-
url,
|
|
31
|
-
size = 'small',
|
|
32
|
-
as: Component = 'a',
|
|
33
|
-
...props
|
|
34
|
-
},
|
|
35
|
-
ref
|
|
36
|
-
) => {
|
|
37
|
-
if (!url) Component = 'div';
|
|
38
|
-
return (
|
|
39
|
-
<RadixAvatar.Root
|
|
40
|
-
{...props}
|
|
41
|
-
ref={ref}
|
|
42
|
-
className={classNames(styles.avatar, styles[size], props.className)}
|
|
43
|
-
>
|
|
44
|
-
<Component
|
|
45
|
-
href={url || undefined}
|
|
46
|
-
target={url ? '_blank' : undefined}
|
|
47
|
-
className={styles.wrapper}
|
|
48
|
-
>
|
|
49
|
-
<RadixAvatar.Image
|
|
50
|
-
loading="lazy"
|
|
51
|
-
decoding="async"
|
|
52
|
-
src={image}
|
|
53
|
-
alt={name || nickname}
|
|
54
|
-
className={styles.item}
|
|
55
|
-
/>
|
|
56
|
-
<RadixAvatar.Fallback
|
|
57
|
-
className={classNames(styles.item, styles[size])}
|
|
58
|
-
>
|
|
59
|
-
{fallback}
|
|
60
|
-
</RadixAvatar.Fallback>
|
|
61
|
-
</Component>
|
|
62
|
-
</RadixAvatar.Root>
|
|
63
|
-
);
|
|
64
|
-
}
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
export default Avatar;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Meta as MetaObj, StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import AvatarOverlay from '#ui/Common/AvatarGroup/Overlay';
|
|
4
|
-
|
|
5
|
-
type Story = StoryObj<typeof AvatarOverlay>;
|
|
6
|
-
type Meta = MetaObj<typeof AvatarOverlay>;
|
|
7
|
-
|
|
8
|
-
const author = {
|
|
9
|
-
image: 'https://avatars.githubusercontent.com/ghost',
|
|
10
|
-
name: 'Ghost User',
|
|
11
|
-
nickname: 'ghost',
|
|
12
|
-
fallback: 'GU',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export const Default: Story = {
|
|
16
|
-
args: author,
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const FallBack: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
nickname: author.nickname,
|
|
22
|
-
fallback: author.fallback,
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export const WithoutName: Story = {
|
|
27
|
-
args: {
|
|
28
|
-
...author,
|
|
29
|
-
name: undefined,
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default { component: AvatarOverlay } as Meta;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { ArrowUpRightIcon } from '@heroicons/react/24/solid';
|
|
2
|
-
import type { ComponentProps, FC } from 'react';
|
|
3
|
-
|
|
4
|
-
import Avatar from '#ui/Common/AvatarGroup/Avatar';
|
|
5
|
-
|
|
6
|
-
import styles from './index.module.css';
|
|
7
|
-
|
|
8
|
-
export type AvatarOverlayProps = ComponentProps<typeof Avatar> & {
|
|
9
|
-
url?: string;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const AvatarOverlay: FC<AvatarOverlayProps> = ({
|
|
13
|
-
image,
|
|
14
|
-
name,
|
|
15
|
-
nickname,
|
|
16
|
-
fallback,
|
|
17
|
-
url,
|
|
18
|
-
as: Component = 'a',
|
|
19
|
-
}) => (
|
|
20
|
-
<Component className={styles.overlay} href={url} target="_blank">
|
|
21
|
-
<Avatar
|
|
22
|
-
image={image}
|
|
23
|
-
name={name}
|
|
24
|
-
nickname={nickname}
|
|
25
|
-
fallback={fallback}
|
|
26
|
-
size="medium"
|
|
27
|
-
/>
|
|
28
|
-
|
|
29
|
-
<div className={styles.user}>
|
|
30
|
-
{name && <div className={styles.name}>{name}</div>}
|
|
31
|
-
{nickname && <div className={styles.nickname}>{nickname}</div>}
|
|
32
|
-
</div>
|
|
33
|
-
<ArrowUpRightIcon className={styles.arrow} />
|
|
34
|
-
</Component>
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
export default AvatarOverlay;
|