@hyphen/hyphen-components 4.1.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/css/utilities.css +1 -1
- package/dist/css/variables.css +2 -2
- package/dist/hyphen-components.cjs.development.js +1 -1
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +1 -1
- package/dist/hyphen-components.esm.js.map +1 -1
- package/dist/lib/tokens.d.ts +1 -1
- package/package.json +2 -2
- package/src/components/DropdownMenu/DropdownMenu.stories.tsx +4 -0
- package/src/components/DropdownMenu/DropdownMenu.tsx +16 -11
package/dist/lib/tokens.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BorderRadiusSize, Breakpoint, BreakpointSizeWithBase } from '../types';
|
|
2
|
-
export declare const ICON_NAMES: ("add" | "alarm-disable" | "alarm" | "analytics" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "arrows-maximize" | "at" | "ban" | "block" | "blocks" | "book-open" | "c-add" | "c-check" | "c-delete" | "c-in-progress" | "c-info" | "c-question" | "c-remove" | "c-warning" | "calendar-create" | "calendar" | "camera" | "caret-down" | "caret-left" | "caret-right" | "caret-sm-down" | "caret-sm-left" | "caret-sm-right" | "caret-sm-up" | "caret-up-down" | "caret-up" | "chart-bar" | "chart-line" | "chat" | "check" | "checkbox-btn-checked" | "checkbox-btn-indeterminate" | "checkbox-btn" | "circle-filled" | "circle" | "clipboard" | "cloud" | "contact" | "copy-document" | "dashboard" | "database" | "dock-left" | "document" | "dots" | "download" | "electricity-bolt" | "exclamation-mark" | "eye-slash" | "eye" | "filter" | "flag" | "gear" | "grab" | "hash-mark" | "heart-o" | "heart" | "home" | "info" | "integrations" | "key" | "launch-app" | "lightbulb" | "link" | "list" | "lock" | "logo-env" | "logo-link" | "logo-toggle" | "logout" | "mail" | "menu" | "minus" | "moon" | "paperclip" | "path-intersect" | "pause" | "pc" | "pencil" | "phone" | "photo" | "play" | "radio-btn-checked" | "radio-btn-unchecked" | "refresh" | "remove" | "rewind" | "search" | "send" | "settings" | "skip" | "stack" | "star-o" | "star" | "stopwatch" | "subtract" | "sun" | "t-warning" | "tag" | "terminal" | "time-alarm" | "time-clock" | "trash" | "unlocked" | "upload" | "user-create" | "user" | "users" | "wifi-off" | "wifi" | "zoom-in" | "zoom-out")[];
|
|
2
|
+
export declare const ICON_NAMES: ("add" | "alarm-disable" | "alarm" | "analytics" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "arrows-maximize" | "at" | "ban" | "block" | "blocks" | "book-open" | "c-add" | "c-check" | "c-delete" | "c-in-progress" | "c-info" | "c-question" | "c-remove" | "c-warning" | "calendar-create" | "calendar" | "camera" | "caret-down" | "caret-left" | "caret-right" | "caret-sm-down" | "caret-sm-left" | "caret-sm-right" | "caret-sm-up" | "caret-up-down" | "caret-up" | "chart-bar" | "chart-line" | "chat" | "check" | "checkbox-btn-checked" | "checkbox-btn-indeterminate" | "checkbox-btn" | "circle-filled" | "circle" | "clipboard" | "cloud" | "contact" | "copy-document" | "dashboard" | "database" | "dock-left" | "document" | "dots" | "download" | "electricity-bolt" | "exclamation-mark" | "eye-slash" | "eye" | "filter" | "flag" | "folder" | "gear" | "grab" | "hash-mark" | "heart-o" | "heart" | "home" | "info" | "integrations" | "key" | "launch-app" | "lightbulb" | "link" | "list" | "lock" | "logo-env" | "logo-link" | "logo-toggle" | "logout" | "mail" | "menu" | "minus" | "moon" | "paperclip" | "path-intersect" | "pause" | "pc" | "pencil" | "phone" | "photo" | "play" | "radio-btn-checked" | "radio-btn-unchecked" | "refresh" | "remove" | "rewind" | "search" | "send" | "settings" | "skip" | "stack" | "star-o" | "star" | "stopwatch" | "subtract" | "sun" | "t-warning" | "tag" | "terminal" | "time-alarm" | "time-clock" | "trash" | "unlocked" | "upload" | "user-create" | "user" | "users" | "wifi-off" | "wifi" | "zoom-in" | "zoom-out")[];
|
|
3
3
|
export declare const BORDER_RADIUS_OPTIONS: BorderRadiusSize[];
|
|
4
4
|
export declare const BORDER_SIZE_OPTIONS: ("0" | "sm" | "md" | "lg")[];
|
|
5
5
|
export declare const BREAKPOINT_OPTIONS: BreakpointSizeWithBase[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyphen/hyphen-components",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "@hyphen"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
}
|
|
62
62
|
],
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@hyphen/hyphen-design-tokens": "^4.
|
|
64
|
+
"@hyphen/hyphen-design-tokens": "^4.20.0",
|
|
65
65
|
"@popperjs/core": "^2.11.8",
|
|
66
66
|
"@radix-ui/react-collapsible": "^1.1.1",
|
|
67
67
|
"@radix-ui/react-dropdown-menu": "^2.1.2",
|
|
@@ -51,6 +51,9 @@ export const Uncontrolled = () => (
|
|
|
51
51
|
<span>Settings</span>
|
|
52
52
|
<DropdownMenuShortcut>⌘S</DropdownMenuShortcut>
|
|
53
53
|
</DropdownMenuItem>
|
|
54
|
+
<DropdownMenuItem disabled>
|
|
55
|
+
<span>Disabled</span>
|
|
56
|
+
</DropdownMenuItem>
|
|
54
57
|
<DropdownMenuItem>
|
|
55
58
|
<span>Keyboard shortcuts</span>
|
|
56
59
|
<DropdownMenuShortcut>⌘K</DropdownMenuShortcut>
|
|
@@ -133,6 +136,7 @@ export const Controlled = () => {
|
|
|
133
136
|
<span>Keyboard shortcuts</span>
|
|
134
137
|
<DropdownMenuShortcut>⌘K</DropdownMenuShortcut>
|
|
135
138
|
</DropdownMenuItem>
|
|
139
|
+
<DropdownMenuItem disabled>Disabled</DropdownMenuItem>
|
|
136
140
|
</DropdownMenuContent>
|
|
137
141
|
</DropdownMenu>
|
|
138
142
|
</div>
|
|
@@ -21,17 +21,22 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
21
21
|
React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
|
|
22
22
|
inset?: boolean;
|
|
23
23
|
}
|
|
24
|
-
>(({ className, inset, ...props }, ref) =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
>(({ className, inset, ...props }, ref) => {
|
|
25
|
+
return (
|
|
26
|
+
<DropdownMenuPrimitive.Item
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={classNames(
|
|
29
|
+
'font-size-sm position-relative cursor-default display-flex br-sm align-items-center p-sm g-sm outline-none',
|
|
30
|
+
inset && 'p-left-md',
|
|
31
|
+
!props.disabled &&
|
|
32
|
+
'hover:background-color-secondary focus:background-color-secondary',
|
|
33
|
+
props.disabled && 'cursor-not-allowed font-color-disabled',
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
);
|
|
39
|
+
});
|
|
35
40
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
36
41
|
|
|
37
42
|
const DropdownMenuContent = React.forwardRef<
|