@licklist/design 0.78.5-dev.62 → 0.78.5-dev.63
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/v2/components/ActionMenu/ActionMenu.d.ts.map +1 -1
- package/dist/v2/components/ActionMenu/ActionMenu.js +6 -16
- package/dist/v2/components/ActionMenu/ActionMenu.scss.js +1 -1
- package/dist/v2/components/FormField/FormField.scss.js +1 -1
- package/dist/v2/components/NewPageHeader/NewPageHeader.scss.js +1 -1
- package/dist/v2/components/ZoneCard/ResourceRow.d.ts +11 -0
- package/dist/v2/components/ZoneCard/ResourceRow.d.ts.map +1 -1
- package/dist/v2/components/ZoneCard/ResourceRow.js +61 -9
- package/dist/v2/components/ZoneCard/ZoneCard.d.ts +0 -1
- package/dist/v2/components/ZoneCard/ZoneCard.d.ts.map +1 -1
- package/dist/v2/components/ZoneCard/ZoneCard.js +1 -2
- package/dist/v2/components/ZoneCard/ZoneCard.scss.js +1 -1
- package/dist/v2/components/ZoneCard/ZoneHeader.d.ts +6 -1
- package/dist/v2/components/ZoneCard/ZoneHeader.d.ts.map +1 -1
- package/dist/v2/components/ZoneCard/ZoneHeader.js +30 -13
- package/dist/v2/components/ZoneCard/index.d.ts +1 -1
- package/dist/v2/components/ZoneCard/index.d.ts.map +1 -1
- package/dist/v2/icons/index.d.ts +8 -2
- package/dist/v2/icons/index.d.ts.map +1 -1
- package/dist/v2/icons/index.js +20 -40
- package/dist/v2/index.d.ts +1 -1
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/pages/ZonesResources/ZonesResourcesPage.d.ts.map +1 -1
- package/dist/v2/pages/ZonesResources/ZonesResourcesPage.js +20 -16
- package/dist/v2/pages/ZonesResources/ZonesResourcesPage.scss.js +1 -1
- package/package.json +1 -1
- package/src/v2/components/ActionMenu/ActionMenu.scss +7 -20
- package/src/v2/components/ActionMenu/ActionMenu.tsx +2 -5
- package/src/v2/components/FormField/FormField.scss +1 -1
- package/src/v2/components/NewPageHeader/NewPageHeader.scss +1 -5
- package/src/v2/components/ZoneCard/ResourceRow.tsx +56 -9
- package/src/v2/components/ZoneCard/ZoneCard.scss +74 -10
- package/src/v2/components/ZoneCard/ZoneCard.stories.tsx +2 -5
- package/src/v2/components/ZoneCard/ZoneCard.tsx +0 -3
- package/src/v2/components/ZoneCard/ZoneHeader.tsx +34 -11
- package/src/v2/components/ZoneCard/index.ts +1 -1
- package/src/v2/icons/index.tsx +10 -12
- package/src/v2/index.ts +1 -1
- package/src/v2/pages/ZonesResources/ZonesResourcesPage.scss +25 -0
- package/src/v2/pages/ZonesResources/ZonesResourcesPage.tsx +10 -7
|
@@ -17,7 +17,6 @@ export interface ZoneResource {
|
|
|
17
17
|
|
|
18
18
|
export interface ZoneCardProps {
|
|
19
19
|
name: string
|
|
20
|
-
status?: 'active' | 'disabled'
|
|
21
20
|
totalCapacity: number
|
|
22
21
|
resources?: ZoneResource[]
|
|
23
22
|
menuItems?: ActionMenuItem[]
|
|
@@ -31,7 +30,6 @@ export interface ZoneCardProps {
|
|
|
31
30
|
|
|
32
31
|
export const ZoneCard = React.forwardRef<HTMLDivElement, ZoneCardProps>(({
|
|
33
32
|
name,
|
|
34
|
-
status = 'active',
|
|
35
33
|
totalCapacity,
|
|
36
34
|
resources = [],
|
|
37
35
|
menuItems = [],
|
|
@@ -46,7 +44,6 @@ export const ZoneCard = React.forwardRef<HTMLDivElement, ZoneCardProps>(({
|
|
|
46
44
|
<ZoneContainer ref={ref} className={className} style={style}>
|
|
47
45
|
<ZoneHeader
|
|
48
46
|
name={name}
|
|
49
|
-
status={status}
|
|
50
47
|
totalCapacity={totalCapacity}
|
|
51
48
|
menuItems={menuItems}
|
|
52
49
|
draggable={draggable}
|
|
@@ -1,43 +1,66 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Badge } from '../Badge'
|
|
3
2
|
import { ActionMenu, ActionMenuItem } from '../ActionMenu'
|
|
4
|
-
import { GripVerticalIcon } from '../../icons'
|
|
3
|
+
import { GripVerticalIcon, ArrowUpIcon, ArrowDownIcon } from '../../icons'
|
|
5
4
|
import { DragHandleProps } from './ZoneContainer'
|
|
6
5
|
import './ZoneCard.scss'
|
|
7
6
|
|
|
8
7
|
export interface ZoneHeaderProps {
|
|
9
8
|
name: string
|
|
10
|
-
status?: 'active' | 'disabled'
|
|
11
9
|
totalCapacity: number
|
|
10
|
+
totalLabel?: string
|
|
12
11
|
menuItems?: ActionMenuItem[]
|
|
13
12
|
draggable?: boolean
|
|
14
13
|
dragHandleProps?: DragHandleProps
|
|
15
14
|
className?: string
|
|
15
|
+
isMobile?: boolean
|
|
16
|
+
isFirst?: boolean
|
|
17
|
+
isLast?: boolean
|
|
18
|
+
onMoveUp?: () => void
|
|
19
|
+
onMoveDown?: () => void
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
export const ZoneHeader: React.FC<ZoneHeaderProps> = ({
|
|
19
23
|
name,
|
|
20
|
-
status = 'active',
|
|
21
24
|
totalCapacity,
|
|
25
|
+
totalLabel = 'Total',
|
|
22
26
|
menuItems = [],
|
|
23
27
|
draggable = true,
|
|
24
28
|
dragHandleProps,
|
|
25
29
|
className = '',
|
|
30
|
+
isMobile = false,
|
|
31
|
+
isFirst = false,
|
|
32
|
+
isLast = false,
|
|
33
|
+
onMoveUp,
|
|
34
|
+
onMoveDown,
|
|
26
35
|
}) => {
|
|
27
|
-
const statusVariant = status === 'active' ? 'success' : 'neutral'
|
|
28
|
-
const statusLabel = status.charAt(0).toUpperCase() + status.slice(1)
|
|
29
|
-
|
|
30
36
|
return (
|
|
31
37
|
<div className={`zone-card__header ${className}`}>
|
|
32
|
-
{draggable && (
|
|
38
|
+
{draggable && !isMobile && (
|
|
33
39
|
<div className="zone-card__drag-handle" {...dragHandleProps}>
|
|
34
|
-
{GripVerticalIcon({ width:
|
|
40
|
+
{GripVerticalIcon({ width: 20, height: 20 })}
|
|
41
|
+
</div>
|
|
42
|
+
)}
|
|
43
|
+
{draggable && isMobile && (
|
|
44
|
+
<div className="zone-card__reorder-arrows">
|
|
45
|
+
<button
|
|
46
|
+
className="zone-card__arrow-btn"
|
|
47
|
+
disabled={isFirst}
|
|
48
|
+
onClick={(e) => { e.stopPropagation(); onMoveUp?.() }}
|
|
49
|
+
>
|
|
50
|
+
<ArrowUpIcon />
|
|
51
|
+
</button>
|
|
52
|
+
<button
|
|
53
|
+
className="zone-card__arrow-btn"
|
|
54
|
+
disabled={isLast}
|
|
55
|
+
onClick={(e) => { e.stopPropagation(); onMoveDown?.() }}
|
|
56
|
+
>
|
|
57
|
+
<ArrowDownIcon />
|
|
58
|
+
</button>
|
|
35
59
|
</div>
|
|
36
60
|
)}
|
|
37
61
|
<span className="zone-card__name">{name}</span>
|
|
38
62
|
<div className="zone-card__header-right">
|
|
39
|
-
<
|
|
40
|
-
<span className="zone-card__total">Total: {totalCapacity}</span>
|
|
63
|
+
<span className="zone-card__total">{totalLabel}: {totalCapacity}</span>
|
|
41
64
|
{menuItems.length > 0 && <ActionMenu items={menuItems} />}
|
|
42
65
|
</div>
|
|
43
66
|
</div>
|
|
@@ -8,7 +8,7 @@ export { ZoneHeader } from './ZoneHeader'
|
|
|
8
8
|
export type { ZoneHeaderProps } from './ZoneHeader'
|
|
9
9
|
|
|
10
10
|
export { ResourceRow } from './ResourceRow'
|
|
11
|
-
export type { ResourceRowProps } from './ResourceRow'
|
|
11
|
+
export type { ResourceRowProps, ResourceRowLabels } from './ResourceRow'
|
|
12
12
|
|
|
13
13
|
export { AddResourceButton } from './AddResourceButton'
|
|
14
14
|
export type { AddResourceButtonProps } from './AddResourceButton'
|
package/src/v2/icons/index.tsx
CHANGED
|
@@ -181,21 +181,21 @@ export const InfoIcon = ({ width = 16, height = 16 }: { width?: number; height?:
|
|
|
181
181
|
</svg>
|
|
182
182
|
)
|
|
183
183
|
|
|
184
|
-
export const ArrowUpIcon = () => (
|
|
185
|
-
<svg width=
|
|
186
|
-
<path d="
|
|
184
|
+
export const ArrowUpIcon = ({ width = 20, height = 20 }: { width?: number; height?: number } = {}) => (
|
|
185
|
+
<svg width={width} height={height} viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
186
|
+
<path d="M14.9999 11.8283L9.63589 17.1923L8.22168 15.7781L15.9999 7.99988L23.778 15.7781L22.3638 17.1923L16.9999 11.8283L16.9999 23.9999L14.9999 23.9999L14.9999 11.8283Z" fill="currentColor" />
|
|
187
187
|
</svg>
|
|
188
188
|
)
|
|
189
189
|
|
|
190
|
-
export const ArrowDownIcon = () => (
|
|
191
|
-
<svg width=
|
|
192
|
-
<path d="
|
|
190
|
+
export const ArrowDownIcon = ({ width = 20, height = 20 }: { width?: number; height?: number } = {}) => (
|
|
191
|
+
<svg width={width} height={height} viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
192
|
+
<path d="M16.9999 20.1715L22.3639 14.8075L23.7781 16.2217L15.9999 23.9999L8.22176 16.2217L9.63596 14.8075L14.9999 20.1715L14.9999 7.99988L16.9999 7.99988L16.9999 20.1715Z" fill="currentColor" />
|
|
193
193
|
</svg>
|
|
194
194
|
)
|
|
195
195
|
|
|
196
196
|
export const GripVerticalIcon = ({ width = 16, height = 16 }: { width?: number; height?: number } = {}) => (
|
|
197
197
|
<svg width={width} height={height} viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
198
|
-
<path d="
|
|
198
|
+
<path d="M13 20C14.1046 20 15 20.8954 15 22C15 23.1046 14.1046 24 13 24C11.8954 24 11 23.1046 11 22C11 20.8954 11.8954 20 13 20ZM19 20C20.1046 20 21 20.8954 21 22C21 23.1046 20.1046 24 19 24C17.8954 24 17 23.1046 17 22C17 20.8954 17.8954 20 19 20ZM13 14C14.1046 14 15 14.8954 15 16C15 17.1046 14.1046 18 13 18C11.8954 18 11 17.1046 11 16C11 14.8954 11.8954 14 13 14ZM19 14C20.1046 14 21 14.8954 21 16C21 17.1046 20.1046 18 19 18C17.8954 18 17 17.1046 17 16C17 14.8954 17.8954 14 19 14ZM13 8C14.1046 8 15 8.89543 15 10C15 11.1046 14.1046 12 13 12C11.8954 12 11 11.1046 11 10C11 8.89543 11.8954 8 13 8ZM19 8C20.1046 8 21 8.89543 21 10C21 11.1046 20.1046 12 19 12C17.8954 12 17 11.1046 17 10C17 8.89543 17.8954 8 19 8Z" fill="currentColor"/>
|
|
199
199
|
</svg>
|
|
200
200
|
)
|
|
201
201
|
|
|
@@ -219,11 +219,9 @@ export const CloseIcon = ({width = 24, height = 24, ...props
|
|
|
219
219
|
</svg>
|
|
220
220
|
)
|
|
221
221
|
|
|
222
|
-
export const EllipsisIcon = ({ width =
|
|
223
|
-
<svg width={width} height={height} viewBox="0 0
|
|
224
|
-
<
|
|
225
|
-
<circle cx="16" cy="16" r="3" fill={fill} />
|
|
226
|
-
<circle cx="24" cy="16" r="3" fill={fill} />
|
|
222
|
+
export const EllipsisIcon = ({ width = 18, height = 4, fill = 'currentColor', ...props }: React.SVGProps<SVGSVGElement> & { width?: number; height?: number; fill?: string } = {}) => (
|
|
223
|
+
<svg width={width} height={height} viewBox="0 0 18 4" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}>
|
|
224
|
+
<path d="M2 0C3.10457 0 4 0.895431 4 2C4 3.10457 3.10457 4 2 4C0.895431 4 0 3.10457 0 2C0 0.895431 0.895431 0 2 0ZM9 0C10.1046 0 11 0.895431 11 2C11 3.10457 10.1046 4 9 4C7.89543 4 7 3.10457 7 2C7 0.895431 7.89543 0 9 0ZM16 0C17.1046 0 18 0.895431 18 2C18 3.10457 17.1046 4 16 4C14.8954 4 14 3.10457 14 2C14 0.895431 14.8954 0 16 0Z" fill={fill} />
|
|
227
225
|
</svg>
|
|
228
226
|
)
|
|
229
227
|
|
package/src/v2/index.ts
CHANGED
|
@@ -51,7 +51,7 @@ export type { UserPanelProps } from './components/UserPanel'
|
|
|
51
51
|
|
|
52
52
|
// ZoneCard Components
|
|
53
53
|
export { ZoneCard, ZoneContainer, ZoneHeader, ResourceRow, AddResourceButton } from './components/ZoneCard'
|
|
54
|
-
export type { ZoneCardProps, ZoneResource, ZoneContainerProps, DragHandleProps, ZoneHeaderProps, ResourceRowProps, AddResourceButtonProps } from './components/ZoneCard'
|
|
54
|
+
export type { ZoneCardProps, ZoneResource, ZoneContainerProps, DragHandleProps, ZoneHeaderProps, ResourceRowProps, ResourceRowLabels, AddResourceButtonProps } from './components/ZoneCard'
|
|
55
55
|
|
|
56
56
|
// ZonesResources Page
|
|
57
57
|
export { ZonesResourcesPage } from './pages/ZonesResources'
|
|
@@ -7,6 +7,25 @@
|
|
|
7
7
|
padding: 24px 32px 0 32px;
|
|
8
8
|
align-self: flex-start;
|
|
9
9
|
|
|
10
|
+
.icon-button {
|
|
11
|
+
border-color: transparent;
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
background: var(--surface-action-soft, #F4F4FE);
|
|
15
|
+
border-color: transparent;
|
|
16
|
+
|
|
17
|
+
.icon-button__icon,
|
|
18
|
+
.icon-button__label {
|
|
19
|
+
color: var(--fill-action, #5D5BF4);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.icon-button__icon,
|
|
25
|
+
.icon-button__label {
|
|
26
|
+
color: var(--fill-action, #5D5BF4);
|
|
27
|
+
}
|
|
28
|
+
|
|
10
29
|
@media (max-width: 768px) {
|
|
11
30
|
padding: 16px 16px 0 16px;
|
|
12
31
|
}
|
|
@@ -19,4 +38,10 @@
|
|
|
19
38
|
padding: 16px;
|
|
20
39
|
}
|
|
21
40
|
}
|
|
41
|
+
|
|
42
|
+
&__action {
|
|
43
|
+
margin-bottom: 16px;
|
|
44
|
+
display: flex;
|
|
45
|
+
justify-content: flex-end;
|
|
46
|
+
}
|
|
22
47
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { IconButton } from '../../components/IconButton'
|
|
3
|
+
import { GhostButton } from '../../components/Button'
|
|
3
4
|
import { NewPageHeader } from '../../components/NewPageHeader'
|
|
4
|
-
import {
|
|
5
|
+
import { PlusIcon } from '../../icons'
|
|
5
6
|
import './ZonesResourcesPage.scss'
|
|
6
7
|
|
|
7
8
|
export interface ZonesResourcesPageProps {
|
|
@@ -17,7 +18,7 @@ export const ZonesResourcesPage: React.FC<ZonesResourcesPageProps> = ({
|
|
|
17
18
|
title = 'Zones & Resources',
|
|
18
19
|
backLabel = 'Back to Settings',
|
|
19
20
|
onBack,
|
|
20
|
-
actionLabel = '
|
|
21
|
+
actionLabel = 'Add Zone',
|
|
21
22
|
onAction,
|
|
22
23
|
children,
|
|
23
24
|
}) => {
|
|
@@ -31,13 +32,15 @@ export const ZonesResourcesPage: React.FC<ZonesResourcesPageProps> = ({
|
|
|
31
32
|
<NewPageHeader
|
|
32
33
|
title={title}
|
|
33
34
|
showDivider
|
|
34
|
-
renderRight={onAction ? () => (
|
|
35
|
-
<Button variant="primary" onClick={onAction}>
|
|
36
|
-
<ButtonText color="white">{actionLabel}</ButtonText>
|
|
37
|
-
</Button>
|
|
38
|
-
) : undefined}
|
|
39
35
|
/>
|
|
40
36
|
<div className="zones-resources-page__content">
|
|
37
|
+
{onAction && (
|
|
38
|
+
<div className="zones-resources-page__action">
|
|
39
|
+
<GhostButton onClick={onAction} icon={<PlusIcon width={16} height={16} />}>
|
|
40
|
+
{actionLabel}
|
|
41
|
+
</GhostButton>
|
|
42
|
+
</div>
|
|
43
|
+
)}
|
|
41
44
|
{children}
|
|
42
45
|
</div>
|
|
43
46
|
</div>
|