@crystallize/design-system 1.16.0 → 1.16.1
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/CHANGELOG.md +6 -0
- package/dist/index.css +21 -11
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
- package/src/dialog/dialog.css +5 -4
- package/src/dropdown-menu/dropdown-menu-item.tsx +7 -4
- package/src/dropdown-menu/dropdown-menu.css +10 -3
package/CHANGELOG.md
CHANGED
package/dist/index.css
CHANGED
|
@@ -1175,7 +1175,8 @@ button {
|
|
|
1175
1175
|
background-color: rgb(var(--c-color-elevate) / var(--tw-bg-opacity));
|
|
1176
1176
|
padding-left: 1rem;
|
|
1177
1177
|
padding-right: 1rem;
|
|
1178
|
-
padding-
|
|
1178
|
+
padding-bottom: 0.25rem;
|
|
1179
|
+
padding-top: 0.75rem;
|
|
1179
1180
|
font-family:
|
|
1180
1181
|
Roboto,
|
|
1181
1182
|
ui-sans-serif,
|
|
@@ -1192,8 +1193,7 @@ button {
|
|
|
1192
1193
|
"Segoe UI Emoji",
|
|
1193
1194
|
"Segoe UI Symbol",
|
|
1194
1195
|
"Noto Color Emoji";
|
|
1195
|
-
font-size:
|
|
1196
|
-
line-height: 1rem;
|
|
1196
|
+
font-size: 11px;
|
|
1197
1197
|
font-weight: 700;
|
|
1198
1198
|
--tw-text-opacity: 1;
|
|
1199
1199
|
color: rgb(var(--c-color-gray-500-400) / var(--tw-text-opacity));
|
|
@@ -1209,8 +1209,8 @@ button {
|
|
|
1209
1209
|
align-items: center;
|
|
1210
1210
|
--tw-bg-opacity: 1;
|
|
1211
1211
|
background-color: rgb(var(--c-color-elevate) / var(--tw-bg-opacity));
|
|
1212
|
-
padding-left:
|
|
1213
|
-
padding-right:
|
|
1212
|
+
padding-left: 1rem;
|
|
1213
|
+
padding-right: 1rem;
|
|
1214
1214
|
font-family:
|
|
1215
1215
|
Roboto,
|
|
1216
1216
|
ui-sans-serif,
|
|
@@ -1235,12 +1235,22 @@ button {
|
|
|
1235
1235
|
}
|
|
1236
1236
|
.c-dropdown-menu-item:hover,
|
|
1237
1237
|
.c-dropdown-menu-item:focus,
|
|
1238
|
-
.c-dropdown-menu-item:focus-visible
|
|
1238
|
+
.c-dropdown-menu-item:focus-visible,
|
|
1239
|
+
.c-dropdown-menu-item:hover.selected,
|
|
1240
|
+
.c-dropdown-menu-item:focus.selected,
|
|
1241
|
+
.c-dropdown-menu-item:focus-visible.selected {
|
|
1239
1242
|
--tw-bg-opacity: 1;
|
|
1240
1243
|
background-color: rgb(var(--c-color-gray-50-900) / var(--tw-bg-opacity));
|
|
1241
1244
|
outline: 2px solid transparent;
|
|
1242
1245
|
outline-offset: 2px;
|
|
1243
1246
|
}
|
|
1247
|
+
.c-dropdown-menu-item.selected {
|
|
1248
|
+
--tw-bg-opacity: 1;
|
|
1249
|
+
background-color: rgb(var(--c-color-gray-50-900) / var(--tw-bg-opacity));
|
|
1250
|
+
font-weight: 700;
|
|
1251
|
+
--tw-text-opacity: 1;
|
|
1252
|
+
color: rgb(var(--c-color-green-500-400) / var(--tw-text-opacity));
|
|
1253
|
+
}
|
|
1244
1254
|
.c-dropdown-menu-item:first-child {
|
|
1245
1255
|
border-top-left-radius: 0.25rem;
|
|
1246
1256
|
border-top-right-radius: 0.25rem;
|
|
@@ -1351,9 +1361,9 @@ button {
|
|
|
1351
1361
|
/* src/dialog/dialog.css */
|
|
1352
1362
|
.c-dialog {
|
|
1353
1363
|
position: fixed;
|
|
1354
|
-
top: 50%;
|
|
1355
1364
|
left: 50%;
|
|
1356
|
-
|
|
1365
|
+
top: 50%;
|
|
1366
|
+
z-index: 100;
|
|
1357
1367
|
width: auto;
|
|
1358
1368
|
min-width: 25%;
|
|
1359
1369
|
max-width: 800px;
|
|
@@ -1375,7 +1385,7 @@ button {
|
|
|
1375
1385
|
.c-dialog-overlay {
|
|
1376
1386
|
position: fixed;
|
|
1377
1387
|
inset: 0px;
|
|
1378
|
-
z-index:
|
|
1388
|
+
z-index: 100;
|
|
1379
1389
|
background-color: rgb(var(--c-color-overlay) / 0.3);
|
|
1380
1390
|
}
|
|
1381
1391
|
.c-dialog-icon {
|
|
@@ -1399,14 +1409,14 @@ button {
|
|
|
1399
1409
|
color: rgb(var(--c-color-gray));
|
|
1400
1410
|
}
|
|
1401
1411
|
.c-dialog-description {
|
|
1402
|
-
margin-top: 0.25rem;
|
|
1403
1412
|
margin-bottom: 1.25rem;
|
|
1413
|
+
margin-top: 0.25rem;
|
|
1404
1414
|
font-weight: 500;
|
|
1405
1415
|
}
|
|
1406
1416
|
.c-dialog-close-button {
|
|
1407
1417
|
position: absolute;
|
|
1408
|
-
top: 0px;
|
|
1409
1418
|
right: 0px;
|
|
1419
|
+
top: 0px;
|
|
1410
1420
|
display: inline-flex;
|
|
1411
1421
|
height: 3rem;
|
|
1412
1422
|
width: 3rem;
|
package/dist/index.d.ts
CHANGED
|
@@ -20,9 +20,10 @@ type ItemProps = HTMLAttributes<HTMLLIElement> & {
|
|
|
20
20
|
declare function Item({ children, className, onSelect }: ItemProps): JSX.Element;
|
|
21
21
|
|
|
22
22
|
type DropdownMenuItemProps = DropdownMenuPrimitive.MenuItemProps & {
|
|
23
|
-
children: ReactNode;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
isSelected?: boolean;
|
|
24
25
|
};
|
|
25
|
-
declare function DropdownMenuItem({ children, className, ...delegated }: DropdownMenuItemProps): JSX.Element;
|
|
26
|
+
declare function DropdownMenuItem({ children, className, isSelected, ...delegated }: DropdownMenuItemProps): JSX.Element;
|
|
26
27
|
|
|
27
28
|
type DropdownMenuLabelProps = {
|
|
28
29
|
children: ReactNode;
|
package/dist/index.js
CHANGED
|
@@ -261,10 +261,10 @@ var import_react_dropdown_menu = require("@radix-ui/react-dropdown-menu");
|
|
|
261
261
|
var import_class_variance_authority4 = require("class-variance-authority");
|
|
262
262
|
var DropdownMenuPrimitive = __toESM(require("@radix-ui/react-dropdown-menu"));
|
|
263
263
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
264
|
-
function DropdownMenuItem({ children, className, ...delegated }) {
|
|
264
|
+
function DropdownMenuItem({ children, className, isSelected, ...delegated }) {
|
|
265
265
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(DropdownMenuPrimitive.Item, {
|
|
266
266
|
...delegated,
|
|
267
|
-
className: (0, import_class_variance_authority4.cx)("c-dropdown-menu-item", className),
|
|
267
|
+
className: (0, import_class_variance_authority4.cx)("c-dropdown-menu-item", isSelected ? "selected" : "", className),
|
|
268
268
|
children
|
|
269
269
|
});
|
|
270
270
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -201,10 +201,10 @@ import { Portal as Portal2, Separator } from "@radix-ui/react-dropdown-menu";
|
|
|
201
201
|
import { cx as cx2 } from "class-variance-authority";
|
|
202
202
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
203
203
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
204
|
-
function DropdownMenuItem({ children, className, ...delegated }) {
|
|
204
|
+
function DropdownMenuItem({ children, className, isSelected, ...delegated }) {
|
|
205
205
|
return /* @__PURE__ */ jsx4(DropdownMenuPrimitive.Item, {
|
|
206
206
|
...delegated,
|
|
207
|
-
className: cx2("c-dropdown-menu-item", className),
|
|
207
|
+
className: cx2("c-dropdown-menu-item", isSelected ? "selected" : "", className),
|
|
208
208
|
children
|
|
209
209
|
});
|
|
210
210
|
}
|
package/package.json
CHANGED
package/src/dialog/dialog.css
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
.c-dialog {
|
|
2
|
-
@apply fixed
|
|
2
|
+
@apply fixed left-1/2 top-1/2 z-[100] w-auto min-w-[25%] max-w-[800px] rounded-lg bg-elevate p-14 leading-6 text-gray-500-400 shadow;
|
|
3
3
|
transform: translate(-50%, -50%);
|
|
4
|
+
|
|
4
5
|
&-overlay {
|
|
5
|
-
@apply fixed inset-0 z-
|
|
6
|
+
@apply fixed inset-0 z-[100] bg-overlay;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
&-icon {
|
|
@@ -14,11 +15,11 @@
|
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
&-description {
|
|
17
|
-
@apply mt-1
|
|
18
|
+
@apply mb-5 mt-1 font-medium;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
&-close-button {
|
|
21
|
-
@apply absolute
|
|
22
|
+
@apply absolute right-0 top-0 inline-flex h-12 w-12 items-center justify-center rounded-none rounded-tr-lg border !bg-transparent !p-0 !drop-shadow-none hover:!bg-gray-50-900 focus:!bg-gray-50-900;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
&-with-icon {
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
1
|
import { cx } from 'class-variance-authority';
|
|
3
2
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
4
3
|
|
|
5
4
|
type DropdownMenuItemProps = DropdownMenuPrimitive.MenuItemProps & {
|
|
6
|
-
children: ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
isSelected?: boolean;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
export function DropdownMenuItem({ children, className, ...delegated }: DropdownMenuItemProps) {
|
|
9
|
+
export function DropdownMenuItem({ children, className, isSelected, ...delegated }: DropdownMenuItemProps) {
|
|
10
10
|
return (
|
|
11
|
-
<DropdownMenuPrimitive.Item
|
|
11
|
+
<DropdownMenuPrimitive.Item
|
|
12
|
+
{...delegated}
|
|
13
|
+
className={cx('c-dropdown-menu-item', isSelected ? 'selected' : '', className)}
|
|
14
|
+
>
|
|
12
15
|
{children}
|
|
13
16
|
</DropdownMenuPrimitive.Item>
|
|
14
17
|
);
|
|
@@ -3,18 +3,25 @@
|
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.c-dropdown-menu-label {
|
|
6
|
-
@apply bg-elevate px-4 pt-
|
|
6
|
+
@apply bg-elevate px-4 pb-1 pt-3 font-sans text-[11px] font-bold text-gray-500-400;
|
|
7
7
|
@apply first:rounded-tl first:rounded-tr;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
.c-dropdown-menu-item {
|
|
11
|
-
@apply flex h-10 cursor-pointer items-center bg-elevate px-
|
|
11
|
+
@apply flex h-10 cursor-pointer items-center bg-elevate px-4 font-sans text-xs font-medium text-gray-700-200;
|
|
12
12
|
|
|
13
13
|
&:hover,
|
|
14
14
|
&:focus,
|
|
15
|
-
&:focus-visible
|
|
15
|
+
&:focus-visible,
|
|
16
|
+
&:hover.selected,
|
|
17
|
+
&:focus.selected,
|
|
18
|
+
&:focus-visible.selected {
|
|
16
19
|
@apply bg-gray-50-900 outline-none;
|
|
17
20
|
}
|
|
18
21
|
|
|
22
|
+
&.selected {
|
|
23
|
+
@apply bg-gray-50-900 font-bold text-green-500-400;
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
@apply first:rounded-tl first:rounded-tr last:rounded-bl last:rounded-br;
|
|
20
27
|
}
|