@node-core/ui-components 1.0.1-cc5c2626b0639fe2088a736f54169ea3e10ed325 → 1.0.1-e1f87bde264af01e260a8efa4fab1749a2c6bc29
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 +44 -50
- package/Common/AvatarGroup/Avatar/index.js +11 -0
- package/Common/AvatarGroup/Avatar/index.module.css +50 -30
- package/Common/AvatarGroup/Overlay/index.js +6 -0
- package/Common/AvatarGroup/Overlay/index.module.css +28 -21
- package/Common/AvatarGroup/index.js +21 -0
- package/Common/AvatarGroup/index.module.css +12 -11
- package/Common/Badge/index.js +7 -0
- package/Common/Badge/index.module.css +34 -26
- package/Common/BadgeGroup/index.js +6 -0
- package/Common/BadgeGroup/index.module.css +75 -51
- package/Common/Banner/index.js +4 -0
- package/Common/Banner/index.module.css +30 -27
- package/Common/BaseActiveLink/index.js +14 -0
- package/Common/BaseButton/index.js +10 -0
- package/Common/BaseButton/index.module.css +332 -105
- package/Common/BaseCodeBox/index.js +50 -0
- package/Common/BaseCodeBox/index.module.css +76 -58
- package/Common/BaseCrossLink/index.js +12 -0
- package/Common/BaseCrossLink/index.module.css +57 -39
- package/Common/BaseLinkTabs/index.js +5 -0
- package/Common/BaseLinkTabs/index.module.css +67 -33
- package/Common/BasePagination/Ellipsis/index.js +4 -0
- package/Common/BasePagination/Ellipsis/index.module.css +14 -8
- package/Common/BasePagination/PaginationListItem/index.js +6 -0
- package/Common/BasePagination/PaginationListItem/index.module.css +36 -21
- package/Common/BasePagination/PrevNextArrow.js +7 -0
- package/Common/BasePagination/index.js +10 -0
- package/Common/BasePagination/index.module.css +27 -26
- package/Common/BasePagination/useGetPageElements.js +77 -0
- package/Common/Blockquote/index.js +4 -0
- package/Common/Blockquote/index.module.css +44 -23
- package/Common/Breadcrumbs/BreadcrumbHomeLink/index.js +9 -0
- package/Common/Breadcrumbs/BreadcrumbHomeLink/index.module.css +3 -3
- package/Common/Breadcrumbs/BreadcrumbItem/index.js +6 -0
- package/Common/Breadcrumbs/BreadcrumbItem/index.module.css +38 -27
- package/Common/Breadcrumbs/BreadcrumbLink/index.js +5 -0
- package/Common/Breadcrumbs/BreadcrumbLink/index.module.css +26 -16
- package/Common/Breadcrumbs/BreadcrumbRoot/index.js +4 -0
- package/Common/Breadcrumbs/BreadcrumbRoot/index.module.css +8 -7
- 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 +181 -66
- package/Common/CodeTabs/index.js +5 -0
- package/Common/CodeTabs/index.module.css +47 -36
- package/Common/DataTag/index.js +18 -0
- package/Common/DataTag/index.module.css +30 -32
- package/Common/GlowingBackdrop/index.js +5 -0
- package/Common/GlowingBackdrop/index.module.css +126 -28
- package/Common/LanguageDropDown/index.js +11 -0
- package/Common/LanguageDropDown/index.module.css +140 -42
- package/Common/Modal/index.js +10 -0
- package/Common/Modal/index.module.css +217 -62
- package/Common/NodejsLogo/index.js +7 -0
- package/Common/NodejsLogo/index.module.css +3 -4
- package/Common/Notification/index.js +6 -0
- package/Common/Notification/index.module.css +101 -17
- package/Common/Preview/index.js +7 -0
- package/Common/Preview/index.module.css +269 -65
- package/Common/Select/index.js +46 -0
- package/Common/Select/index.module.css +294 -127
- package/Common/Separator/index.js +7 -0
- package/Common/Separator/index.module.css +7 -10
- package/Common/Skeleton/index.js +18 -0
- package/Common/Skeleton/index.module.css +118 -21
- package/Common/Tabs/index.js +6 -0
- package/Common/Tabs/index.module.css +58 -40
- package/Common/ThemeToggle/index.js +7 -0
- package/Common/ThemeToggle/index.module.css +18 -11
- package/Common/Tooltip/index.js +8 -0
- package/Common/Tooltip/index.module.css +119 -29
- package/Containers/Article/index.js +4 -0
- package/Containers/Article/index.module.css +127 -58
- package/Containers/DocSideBar/index.js +1 -0
- package/Containers/Footer/index.js +22 -0
- package/Containers/Footer/index.module.css +51 -36
- package/Containers/MetaBar/index.js +12 -0
- package/Containers/MetaBar/index.module.css +101 -69
- package/Containers/NavBar/NavItem/index.js +7 -0
- package/Containers/NavBar/NavItem/index.module.css +50 -36
- package/Containers/NavBar/index.js +18 -0
- package/Containers/NavBar/index.module.css +176 -96
- package/Containers/Sidebar/ProgressionIcon/index.js +3 -0
- package/Containers/Sidebar/SidebarGroup/index.js +9 -0
- package/Containers/Sidebar/SidebarGroup/index.module.css +180 -52
- package/Containers/Sidebar/SidebarItem/index.js +11 -0
- package/Containers/Sidebar/SidebarItem/index.module.css +49 -38
- package/Containers/Sidebar/index.js +15 -0
- package/Containers/Sidebar/index.module.css +42 -24
- 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 +16 -0
- package/package.json +6 -54
- package/stylelint/one-utility-class-per-line.mjs +34 -50
- package/stylelint/utils.mjs +19 -25
- package/styles/index.css +1124 -26
- package/types.js +1 -0
- package/Common/AlertBox/index.stories.tsx +0 -96
- 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 -34
- package/Common/Modal/index.tsx +0 -50
- 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
|
@@ -1,79 +1,283 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*! tailwindcss v4.1.11 | MIT License | https://tailwindcss.com */
|
|
3
2
|
.root {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
3
|
+
container-type: inline-size;
|
|
4
|
+
container-name: preview;
|
|
5
|
+
position: relative;
|
|
6
|
+
display: flex;
|
|
7
|
+
aspect-ratio: 1.90/1;
|
|
8
|
+
align-items: center;
|
|
9
|
+
border-radius: var(--radius-sm, 0.25rem);
|
|
10
|
+
border-style: var(--tw-border-style);
|
|
11
|
+
border-width: 1px;
|
|
12
|
+
border-color: var(--color-neutral-900, #2c3437);
|
|
13
|
+
background-color: var(--color-neutral-950, #0d121c);
|
|
14
|
+
&::after {
|
|
15
|
+
content: var(--tw-content);
|
|
16
|
+
position: absolute;
|
|
17
|
+
}
|
|
18
|
+
&::after {
|
|
19
|
+
content: var(--tw-content);
|
|
20
|
+
inset: calc(var(--spacing, 0.25rem)*0);
|
|
21
|
+
}
|
|
22
|
+
&::after {
|
|
23
|
+
content: var(--tw-content);
|
|
24
|
+
margin: auto;
|
|
25
|
+
}
|
|
26
|
+
&::after {
|
|
27
|
+
content: var(--tw-content);
|
|
28
|
+
aspect-ratio: 1 / 1;
|
|
29
|
+
}
|
|
30
|
+
&::after {
|
|
31
|
+
content: var(--tw-content);
|
|
32
|
+
width: 33.33333%;
|
|
33
|
+
}
|
|
34
|
+
&::after {
|
|
35
|
+
content: var(--tw-content);
|
|
36
|
+
border-radius: calc(infinity*1px);
|
|
37
|
+
}
|
|
38
|
+
&::after {
|
|
39
|
+
content: var(--tw-content);
|
|
40
|
+
background-image: radial-gradient( var(--tw-gradient-from), var(--tw-gradient-to) );
|
|
41
|
+
}
|
|
42
|
+
&::after {
|
|
43
|
+
content: var(--tw-content);
|
|
44
|
+
--tw-blur: blur(var(--blur-2xl, 40px));
|
|
45
|
+
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,);
|
|
46
|
+
}
|
|
47
|
+
&::after {
|
|
48
|
+
content: var(--tw-content);
|
|
49
|
+
--tw-content: '';
|
|
50
|
+
content: var(--tw-content);
|
|
51
|
+
}
|
|
23
52
|
&.announcements {
|
|
24
|
-
|
|
53
|
+
&::after {
|
|
54
|
+
content: var(--tw-content);
|
|
55
|
+
--tw-gradient-from: color-mix(in srgb, #2c682c 90%, transparent);
|
|
56
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
57
|
+
--tw-gradient-from: color-mix(in oklab, var(--color-green-700, #2c682c) 90%, transparent);
|
|
58
|
+
}
|
|
59
|
+
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
60
|
+
}
|
|
25
61
|
}
|
|
26
|
-
|
|
27
62
|
&.release {
|
|
28
|
-
|
|
63
|
+
&::after {
|
|
64
|
+
content: var(--tw-content);
|
|
65
|
+
--tw-gradient-from: color-mix(in srgb, #0c7bb3 90%, transparent);
|
|
66
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
67
|
+
--tw-gradient-from: color-mix(in oklab, var(--color-info-600, #0c7bb3) 90%, transparent);
|
|
68
|
+
}
|
|
69
|
+
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
70
|
+
}
|
|
29
71
|
}
|
|
30
|
-
|
|
31
72
|
&.vulnerability {
|
|
32
|
-
|
|
73
|
+
&::after {
|
|
74
|
+
content: var(--tw-content);
|
|
75
|
+
--tw-gradient-from: color-mix(in srgb, #ae5f00 90%, transparent);
|
|
76
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
77
|
+
--tw-gradient-from: color-mix(in oklab, var(--color-warning-600, #ae5f00) 90%, transparent);
|
|
78
|
+
}
|
|
79
|
+
--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));
|
|
80
|
+
}
|
|
33
81
|
}
|
|
34
|
-
|
|
35
82
|
.container {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
text-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
83
|
+
z-index: 10;
|
|
84
|
+
margin-inline: auto;
|
|
85
|
+
display: flex;
|
|
86
|
+
width: 66.66667%;
|
|
87
|
+
max-width: var(--container-xl, 36rem);
|
|
88
|
+
flex-direction: column;
|
|
89
|
+
gap: calc(var(--spacing, 0.25rem)*4);
|
|
90
|
+
text-align: center;
|
|
91
|
+
font-size: var(--text-xs, 0.75rem);
|
|
92
|
+
line-height: var(--tw-leading, var(--text-xs--line-height, 1.33333));
|
|
93
|
+
--tw-font-weight: var(--font-weight-semibold, 600);
|
|
94
|
+
font-weight: var(--font-weight-semibold, 600);
|
|
95
|
+
color: var(--color-white, #fff);
|
|
96
|
+
@container preview (width >= 24rem) {
|
|
97
|
+
font-size: var(--text-base, 1rem);
|
|
98
|
+
line-height: var(--tw-leading, var(--text-base--line-height, 1.5));
|
|
99
|
+
}
|
|
100
|
+
@container preview (width >= 28rem) {
|
|
101
|
+
gap: calc(var(--spacing, 0.25rem)*6);
|
|
102
|
+
}
|
|
103
|
+
@container preview (width >= 28rem) {
|
|
104
|
+
font-size: var(--text-lg, 1.125rem);
|
|
105
|
+
line-height: var(--tw-leading, var(--text-lg--line-height, 1.55556));
|
|
106
|
+
}
|
|
107
|
+
@container preview (width >= 32rem) {
|
|
108
|
+
gap: calc(var(--spacing, 0.25rem)*8);
|
|
109
|
+
}
|
|
110
|
+
@container preview (width >= 32rem) {
|
|
111
|
+
font-size: var(--text-xl, 1.25rem);
|
|
112
|
+
line-height: var(--tw-leading, var(--text-xl--line-height, 1.4));
|
|
113
|
+
}
|
|
114
|
+
@container preview (width >= 36rem) {
|
|
115
|
+
gap: calc(var(--spacing, 0.25rem)*12);
|
|
116
|
+
}
|
|
117
|
+
@container preview (width >= 36rem) {
|
|
118
|
+
font-size: var(--text-2xl, 1.5rem);
|
|
119
|
+
line-height: var(--tw-leading, var(--text-2xl--line-height, 1.33333));
|
|
120
|
+
}
|
|
121
|
+
@container preview (width >= 42rem) {
|
|
122
|
+
font-size: var(--text-3xl, 1.875rem);
|
|
123
|
+
line-height: var(--tw-leading, var(--text-3xl--line-height, 1.2));
|
|
124
|
+
}
|
|
56
125
|
.hexagon {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
126
|
+
position: absolute;
|
|
127
|
+
inset: calc(var(--spacing, 0.25rem)*0);
|
|
128
|
+
margin: auto;
|
|
129
|
+
width: 100%;
|
|
130
|
+
height: 100%;
|
|
131
|
+
@container preview (width >= 28rem) {
|
|
132
|
+
height: 60%;
|
|
133
|
+
}
|
|
134
|
+
@container preview (width >= 28rem) {
|
|
135
|
+
width: 60%;
|
|
136
|
+
}
|
|
137
|
+
@container preview (width >= 32rem) {
|
|
138
|
+
height: 66.66667%;
|
|
139
|
+
}
|
|
140
|
+
@container preview (width >= 32rem) {
|
|
141
|
+
width: 66.66667%;
|
|
142
|
+
}
|
|
143
|
+
@container preview (width >= 36rem) {
|
|
144
|
+
height: 60%;
|
|
145
|
+
}
|
|
146
|
+
@container preview (width >= 36rem) {
|
|
147
|
+
width: 60%;
|
|
148
|
+
}
|
|
149
|
+
@container preview (width >= 42rem) {
|
|
150
|
+
height: 66.66667%;
|
|
151
|
+
}
|
|
152
|
+
@container preview (width >= 42rem) {
|
|
153
|
+
width: 66.66667%;
|
|
154
|
+
}
|
|
69
155
|
}
|
|
70
|
-
|
|
71
156
|
.logo {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
157
|
+
margin-inline: auto;
|
|
158
|
+
width: calc(var(--spacing, 0.25rem)*6);
|
|
159
|
+
height: calc(var(--spacing, 0.25rem)*6);
|
|
160
|
+
@container preview (width >= 28rem) {
|
|
161
|
+
width: calc(var(--spacing, 0.25rem)*14);
|
|
162
|
+
height: calc(var(--spacing, 0.25rem)*14);
|
|
163
|
+
}
|
|
164
|
+
@container preview (width >= 32rem) {
|
|
165
|
+
width: calc(var(--spacing, 0.25rem)*16);
|
|
166
|
+
height: calc(var(--spacing, 0.25rem)*16);
|
|
167
|
+
}
|
|
168
|
+
@container preview (width >= 36rem) {
|
|
169
|
+
width: calc(var(--spacing, 0.25rem)*20);
|
|
170
|
+
height: calc(var(--spacing, 0.25rem)*20);
|
|
171
|
+
}
|
|
77
172
|
}
|
|
78
173
|
}
|
|
79
174
|
}
|
|
175
|
+
@property --tw-border-style {
|
|
176
|
+
syntax: "*";
|
|
177
|
+
inherits: false;
|
|
178
|
+
initial-value: solid;
|
|
179
|
+
}
|
|
180
|
+
@property --tw-content {
|
|
181
|
+
syntax: "*";
|
|
182
|
+
initial-value: "";
|
|
183
|
+
inherits: false;
|
|
184
|
+
}
|
|
185
|
+
@property --tw-blur {
|
|
186
|
+
syntax: "*";
|
|
187
|
+
inherits: false;
|
|
188
|
+
}
|
|
189
|
+
@property --tw-brightness {
|
|
190
|
+
syntax: "*";
|
|
191
|
+
inherits: false;
|
|
192
|
+
}
|
|
193
|
+
@property --tw-contrast {
|
|
194
|
+
syntax: "*";
|
|
195
|
+
inherits: false;
|
|
196
|
+
}
|
|
197
|
+
@property --tw-grayscale {
|
|
198
|
+
syntax: "*";
|
|
199
|
+
inherits: false;
|
|
200
|
+
}
|
|
201
|
+
@property --tw-hue-rotate {
|
|
202
|
+
syntax: "*";
|
|
203
|
+
inherits: false;
|
|
204
|
+
}
|
|
205
|
+
@property --tw-invert {
|
|
206
|
+
syntax: "*";
|
|
207
|
+
inherits: false;
|
|
208
|
+
}
|
|
209
|
+
@property --tw-opacity {
|
|
210
|
+
syntax: "*";
|
|
211
|
+
inherits: false;
|
|
212
|
+
}
|
|
213
|
+
@property --tw-saturate {
|
|
214
|
+
syntax: "*";
|
|
215
|
+
inherits: false;
|
|
216
|
+
}
|
|
217
|
+
@property --tw-sepia {
|
|
218
|
+
syntax: "*";
|
|
219
|
+
inherits: false;
|
|
220
|
+
}
|
|
221
|
+
@property --tw-drop-shadow {
|
|
222
|
+
syntax: "*";
|
|
223
|
+
inherits: false;
|
|
224
|
+
}
|
|
225
|
+
@property --tw-drop-shadow-color {
|
|
226
|
+
syntax: "*";
|
|
227
|
+
inherits: false;
|
|
228
|
+
}
|
|
229
|
+
@property --tw-drop-shadow-alpha {
|
|
230
|
+
syntax: "<percentage>";
|
|
231
|
+
inherits: false;
|
|
232
|
+
initial-value: 100%;
|
|
233
|
+
}
|
|
234
|
+
@property --tw-drop-shadow-size {
|
|
235
|
+
syntax: "*";
|
|
236
|
+
inherits: false;
|
|
237
|
+
}
|
|
238
|
+
@property --tw-gradient-position {
|
|
239
|
+
syntax: "*";
|
|
240
|
+
inherits: false;
|
|
241
|
+
}
|
|
242
|
+
@property --tw-gradient-from {
|
|
243
|
+
syntax: "<color>";
|
|
244
|
+
inherits: false;
|
|
245
|
+
initial-value: #0000;
|
|
246
|
+
}
|
|
247
|
+
@property --tw-gradient-via {
|
|
248
|
+
syntax: "<color>";
|
|
249
|
+
inherits: false;
|
|
250
|
+
initial-value: #0000;
|
|
251
|
+
}
|
|
252
|
+
@property --tw-gradient-to {
|
|
253
|
+
syntax: "<color>";
|
|
254
|
+
inherits: false;
|
|
255
|
+
initial-value: #0000;
|
|
256
|
+
}
|
|
257
|
+
@property --tw-gradient-stops {
|
|
258
|
+
syntax: "*";
|
|
259
|
+
inherits: false;
|
|
260
|
+
}
|
|
261
|
+
@property --tw-gradient-via-stops {
|
|
262
|
+
syntax: "*";
|
|
263
|
+
inherits: false;
|
|
264
|
+
}
|
|
265
|
+
@property --tw-gradient-from-position {
|
|
266
|
+
syntax: "<length-percentage>";
|
|
267
|
+
inherits: false;
|
|
268
|
+
initial-value: 0%;
|
|
269
|
+
}
|
|
270
|
+
@property --tw-gradient-via-position {
|
|
271
|
+
syntax: "<length-percentage>";
|
|
272
|
+
inherits: false;
|
|
273
|
+
initial-value: 50%;
|
|
274
|
+
}
|
|
275
|
+
@property --tw-gradient-to-position {
|
|
276
|
+
syntax: "<length-percentage>";
|
|
277
|
+
inherits: false;
|
|
278
|
+
initial-value: 100%;
|
|
279
|
+
}
|
|
280
|
+
@property --tw-font-weight {
|
|
281
|
+
syntax: "*";
|
|
282
|
+
inherits: false;
|
|
283
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { ChevronDownIcon, ChevronUpIcon } from '@heroicons/react/24/outline';
|
|
4
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { useEffect, useId, useMemo, useState } from 'react';
|
|
7
|
+
import Skeleton from '#ui/Common/Skeleton';
|
|
8
|
+
import styles from './index.module.css';
|
|
9
|
+
const isStringArray = (values) => Boolean(values[0] && typeof values[0] === 'string');
|
|
10
|
+
const isValuesArray = (values) => Boolean(values[0] && typeof values[0] === 'object' && 'value' in values[0]);
|
|
11
|
+
const Select = ({ values = [], defaultValue, placeholder, label, inline, onChange, className, ariaLabel, loading = false, disabled = false, }) => {
|
|
12
|
+
const id = useId();
|
|
13
|
+
const [value, setValue] = useState(defaultValue);
|
|
14
|
+
useEffect(() => setValue(defaultValue), [defaultValue]);
|
|
15
|
+
const mappedValues = useMemo(() => {
|
|
16
|
+
let mappedValues = values;
|
|
17
|
+
if (isStringArray(mappedValues)) {
|
|
18
|
+
mappedValues = mappedValues.map(value => ({ label: value, value }));
|
|
19
|
+
}
|
|
20
|
+
if (isValuesArray(mappedValues)) {
|
|
21
|
+
return [{ items: mappedValues }];
|
|
22
|
+
}
|
|
23
|
+
return mappedValues;
|
|
24
|
+
}, [values]);
|
|
25
|
+
// We render the actual item slotted to fix/prevent the issue
|
|
26
|
+
// of the tirgger flashing on the initial render
|
|
27
|
+
const currentItem = useMemo(() => mappedValues
|
|
28
|
+
.flatMap(({ items }) => items)
|
|
29
|
+
.find(item => item.value === value), [mappedValues, value]);
|
|
30
|
+
const memoizedMappedValues = useMemo(() => {
|
|
31
|
+
return mappedValues.map(({ label, items }, key) => (_jsxs(SelectPrimitive.Group, { children: [label && (_jsx(SelectPrimitive.Label, { className: classNames(styles.item, styles.label), children: label })), items.map(({ value, label, iconImage, disabled }) => (_jsx(SelectPrimitive.Item, { value: value, disabled: disabled, className: classNames(styles.item, styles.text), children: _jsxs(SelectPrimitive.ItemText, { children: [iconImage, _jsx("span", { children: label })] }) }, value)))] }, label?.toString() ?? key)));
|
|
32
|
+
// We explicitly want to recalculate these values only when the values themselves changed
|
|
33
|
+
// This is to prevent re-rendering and re-calcukating the values on every render
|
|
34
|
+
}, [JSON.stringify(values)]);
|
|
35
|
+
// Both change the internal state and emit the change event
|
|
36
|
+
const handleChange = (value) => {
|
|
37
|
+
setValue(value);
|
|
38
|
+
if (typeof onChange === 'function') {
|
|
39
|
+
onChange(value);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return (_jsx(Skeleton, { loading: loading, children: _jsxs("span", { className: classNames(styles.select, { [styles.inline]: inline }, className), children: [label && (_jsx("label", { className: styles.label, htmlFor: id, children: label })), _jsxs(SelectPrimitive.Root, { value: currentItem !== undefined ? value : undefined, onValueChange: handleChange, disabled: disabled, children: [_jsxs(SelectPrimitive.Trigger, { className: styles.trigger, "aria-label": ariaLabel, id: id, children: [_jsx(SelectPrimitive.Value, { placeholder: placeholder, children: currentItem !== undefined && (_jsxs(_Fragment, { children: [currentItem.iconImage, _jsx("span", { children: currentItem.label })] })) }), _jsx(ChevronDownIcon, { className: styles.icon })] }), _jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { position: inline ? 'popper' : 'item-aligned', className: classNames(styles.dropdown, {
|
|
43
|
+
[styles.inline]: inline,
|
|
44
|
+
}), children: [_jsx(SelectPrimitive.ScrollUpButton, { children: _jsx(ChevronUpIcon, { className: styles.scrollIcon }) }), _jsx(SelectPrimitive.Viewport, { children: memoizedMappedValues }), _jsx(SelectPrimitive.ScrollDownButton, { children: _jsx(ChevronDownIcon, { className: styles.scrollIcon }) })] }) })] })] }) }));
|
|
45
|
+
};
|
|
46
|
+
export default Select;
|