@licklist/design 0.78.45 → 0.78.47
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/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/v2/components/Button/Button.d.ts +1 -1
- package/dist/v2/components/Button/Button.d.ts.map +1 -1
- package/dist/v2/components/Button/Button.scss.js +1 -1
- package/dist/v2/components/PeriodCard/PeriodCard.d.ts +66 -0
- package/dist/v2/components/PeriodCard/PeriodCard.d.ts.map +1 -0
- package/dist/v2/components/PeriodCard/PeriodCard.js +351 -0
- package/dist/v2/components/PeriodCard/PeriodCard.scss.js +6 -0
- package/dist/v2/components/PeriodCard/index.d.ts +3 -0
- package/dist/v2/components/PeriodCard/index.d.ts.map +1 -0
- package/dist/v2/components/ReorderRow/ReorderRow.d.ts +24 -0
- package/dist/v2/components/ReorderRow/ReorderRow.d.ts.map +1 -0
- package/dist/v2/components/ReorderRow/ReorderRow.js +109 -0
- package/dist/v2/components/ReorderRow/ReorderRow.scss.js +6 -0
- package/dist/v2/components/ReorderRow/index.d.ts +3 -0
- package/dist/v2/components/ReorderRow/index.d.ts.map +1 -0
- package/dist/v2/components/index.d.ts +4 -0
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/index.d.ts +6 -0
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/pages/DeleteEntity/DeleteEntityPage.d.ts +29 -0
- package/dist/v2/pages/DeleteEntity/DeleteEntityPage.d.ts.map +1 -0
- package/dist/v2/pages/DeleteEntity/DeleteEntityPage.js +294 -0
- package/dist/v2/pages/DeleteEntity/DeleteEntityPage.scss.js +6 -0
- package/dist/v2/pages/DeleteEntity/index.d.ts +3 -0
- package/dist/v2/pages/DeleteEntity/index.d.ts.map +1 -0
- package/dist/v2/pages/Settings/components/SidebarCustomisation.js +2 -0
- package/dist/v2/pages/Settings/components/SidebarNavItem.js +2 -0
- package/dist/v2/pages/SettingsSubPage/SettingsSubPage.js +47 -0
- package/dist/v2/pages/SettingsSubPage/SettingsSubPage.scss.js +6 -0
- package/dist/v2/styles/components/Button.scss +27 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/v2/components/Button/Button.tsx +1 -0
- package/src/v2/components/PeriodCard/PeriodCard.scss +157 -0
- package/src/v2/components/PeriodCard/PeriodCard.stories.tsx +245 -0
- package/src/v2/components/PeriodCard/PeriodCard.tsx +350 -0
- package/src/v2/components/PeriodCard/index.ts +8 -0
- package/src/v2/components/ReorderRow/ReorderRow.scss +68 -0
- package/src/v2/components/ReorderRow/ReorderRow.stories.tsx +124 -0
- package/src/v2/components/ReorderRow/ReorderRow.tsx +88 -0
- package/src/v2/components/ReorderRow/index.ts +2 -0
- package/src/v2/components/index.ts +6 -0
- package/src/v2/index.ts +13 -0
- package/src/v2/pages/DeleteEntity/DeleteEntityPage.scss +96 -0
- package/src/v2/pages/DeleteEntity/DeleteEntityPage.stories.tsx +83 -0
- package/src/v2/pages/DeleteEntity/DeleteEntityPage.tsx +120 -0
- package/src/v2/pages/DeleteEntity/index.ts +2 -0
- package/src/v2/styles/components/Button.scss +27 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
.delete-entity-page {
|
|
2
|
+
padding: 0;
|
|
3
|
+
|
|
4
|
+
&__content {
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
padding: 48px 32px;
|
|
9
|
+
|
|
10
|
+
@media (max-width: 768px) {
|
|
11
|
+
padding: 24px 16px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
&__inner {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
gap: 24px;
|
|
19
|
+
width: 100%;
|
|
20
|
+
max-width: 672px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&__entity-name {
|
|
24
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
25
|
+
font-size: 20px;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
line-height: 28px;
|
|
28
|
+
color: var(--label-primary, #121e52);
|
|
29
|
+
margin: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&__warning-card {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
gap: 16px;
|
|
36
|
+
padding: 24px;
|
|
37
|
+
background: var(--surface-secondary, #f8f8fa);
|
|
38
|
+
border: 1px solid var(--border-primary, #e8e9ef);
|
|
39
|
+
border-radius: 8px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&__warning-text {
|
|
43
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
44
|
+
font-size: 14px;
|
|
45
|
+
font-weight: 600;
|
|
46
|
+
color: var(--label-status-error, #ef4444);
|
|
47
|
+
margin: 0;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&__warning-description {
|
|
51
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
color: var(--label-secondary, #626a90);
|
|
54
|
+
margin: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__consequences {
|
|
58
|
+
list-style: disc;
|
|
59
|
+
padding-left: 20px;
|
|
60
|
+
margin: 0;
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
gap: 4px;
|
|
64
|
+
|
|
65
|
+
li {
|
|
66
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
67
|
+
font-size: 14px;
|
|
68
|
+
color: var(--label-secondary, #626a90);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&__confirm-field {
|
|
73
|
+
display: flex;
|
|
74
|
+
flex-direction: column;
|
|
75
|
+
gap: var(--spacing-xs, 2px);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&__confirm-label {
|
|
79
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
80
|
+
font-size: 14px;
|
|
81
|
+
font-weight: 500;
|
|
82
|
+
line-height: 20px;
|
|
83
|
+
color: var(--label-primary, #121e52);
|
|
84
|
+
margin: 0;
|
|
85
|
+
|
|
86
|
+
strong {
|
|
87
|
+
font-weight: 700;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&__confirm-error {
|
|
92
|
+
font-family: var(--font-family-sans, 'Geist', sans-serif);
|
|
93
|
+
font-size: 11px;
|
|
94
|
+
color: var(--label-status-error, #ef4444);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react'
|
|
3
|
+
import { DeleteEntityPage } from './DeleteEntityPage'
|
|
4
|
+
|
|
5
|
+
const meta: Meta<typeof DeleteEntityPage> = {
|
|
6
|
+
title: 'v2/Pages/DeleteEntity',
|
|
7
|
+
component: DeleteEntityPage,
|
|
8
|
+
parameters: { layout: 'fullscreen' },
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default meta
|
|
12
|
+
type Story = StoryObj<typeof DeleteEntityPage>
|
|
13
|
+
|
|
14
|
+
const baseArgs = {
|
|
15
|
+
confirmWord: 'DELETE',
|
|
16
|
+
warningTitle: 'This action cannot be undone',
|
|
17
|
+
confirmLabelPrefix: 'Type',
|
|
18
|
+
confirmLabelSuffix: 'to confirm deletion',
|
|
19
|
+
confirmErrorMessage: 'Please type DELETE to confirm.',
|
|
20
|
+
isDeleting: false,
|
|
21
|
+
onDelete: () => console.log('Delete confirmed'),
|
|
22
|
+
onCancel: () => console.log('Cancel'),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* **Delete Zone** — confirmation page for deleting a zone.
|
|
27
|
+
*
|
|
28
|
+
* Lists the consequences of the action and requires the user to type
|
|
29
|
+
* the confirmation word before the destructive button is enabled.
|
|
30
|
+
*/
|
|
31
|
+
export const DeleteZone: Story = {
|
|
32
|
+
name: 'Delete Zone',
|
|
33
|
+
args: {
|
|
34
|
+
...baseArgs,
|
|
35
|
+
title: 'Delete Zone',
|
|
36
|
+
entityName: 'Main Hall',
|
|
37
|
+
deleteButtonLabel: 'Delete Zone',
|
|
38
|
+
warningDescription:
|
|
39
|
+
'You are about to permanently delete the zone "Main Hall". This will:',
|
|
40
|
+
consequences: [
|
|
41
|
+
'Remove the zone from your venue layout',
|
|
42
|
+
'Delete all resources assigned to this zone',
|
|
43
|
+
'Cancel any future bookings linked to this zone',
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* **Delete Special Hours** — confirmation page for removing a special hours schedule.
|
|
50
|
+
*/
|
|
51
|
+
export const DeleteSpecialHours: Story = {
|
|
52
|
+
name: 'Delete Special Hours',
|
|
53
|
+
args: {
|
|
54
|
+
...baseArgs,
|
|
55
|
+
title: 'Delete Special Hours',
|
|
56
|
+
entityName: 'Christmas Closure',
|
|
57
|
+
deleteButtonLabel: 'Delete Schedule',
|
|
58
|
+
warningDescription:
|
|
59
|
+
'You are about to permanently delete the special hours schedule "Christmas Closure". This will:',
|
|
60
|
+
consequences: [
|
|
61
|
+
'Remove all date-specific overrides from this schedule',
|
|
62
|
+
'Restore your default opening hours for the affected dates',
|
|
63
|
+
],
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* **Deleting** — destructive button shown in its loading state while the
|
|
69
|
+
* delete request is in flight.
|
|
70
|
+
*/
|
|
71
|
+
export const Deleting: Story = {
|
|
72
|
+
name: 'Deleting',
|
|
73
|
+
args: {
|
|
74
|
+
...baseArgs,
|
|
75
|
+
title: 'Delete Zone',
|
|
76
|
+
entityName: 'Main Hall',
|
|
77
|
+
deleteButtonLabel: 'Delete Zone',
|
|
78
|
+
warningDescription:
|
|
79
|
+
'You are about to permanently delete the zone "Main Hall". This will:',
|
|
80
|
+
consequences: ['Remove the zone from your venue layout'],
|
|
81
|
+
isDeleting: true,
|
|
82
|
+
},
|
|
83
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { useState } from 'react'
|
|
2
|
+
import { NewPageHeader } from '../../components/NewPageHeader'
|
|
3
|
+
import { Button } from '../../components/Button/Button'
|
|
4
|
+
import { NewInput } from '../../components/NewInput/NewInput'
|
|
5
|
+
import './DeleteEntityPage.scss'
|
|
6
|
+
|
|
7
|
+
export interface DeleteEntityPageProps {
|
|
8
|
+
/** Page title shown in the header (e.g. "Delete Zone") */
|
|
9
|
+
title: string
|
|
10
|
+
/** Name of the entity being deleted, displayed prominently */
|
|
11
|
+
entityName: string
|
|
12
|
+
/** Bullet list of consequences shown inside the warning card */
|
|
13
|
+
consequences: string[]
|
|
14
|
+
/** Label for the destructive action button */
|
|
15
|
+
deleteButtonLabel: string
|
|
16
|
+
/** Whether the delete request is in flight */
|
|
17
|
+
isDeleting: boolean
|
|
18
|
+
/** Word the user must type to confirm deletion (e.g. "DELETE") */
|
|
19
|
+
confirmWord: string
|
|
20
|
+
/** Heading inside the warning card (e.g. "This action cannot be undone") */
|
|
21
|
+
warningTitle: string
|
|
22
|
+
/** Description below the warning title */
|
|
23
|
+
warningDescription: string
|
|
24
|
+
/** Label above the confirmation input — `confirmWord` is rendered as <strong> */
|
|
25
|
+
confirmLabelPrefix: string
|
|
26
|
+
confirmLabelSuffix: string
|
|
27
|
+
/** Error message shown when the typed value does not match `confirmWord` */
|
|
28
|
+
confirmErrorMessage: string
|
|
29
|
+
onDelete: () => void | Promise<void>
|
|
30
|
+
onCancel: () => void
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function DeleteEntityPage({
|
|
34
|
+
title,
|
|
35
|
+
entityName,
|
|
36
|
+
consequences,
|
|
37
|
+
deleteButtonLabel,
|
|
38
|
+
isDeleting,
|
|
39
|
+
confirmWord,
|
|
40
|
+
warningTitle,
|
|
41
|
+
warningDescription,
|
|
42
|
+
confirmLabelPrefix,
|
|
43
|
+
confirmLabelSuffix,
|
|
44
|
+
confirmErrorMessage,
|
|
45
|
+
onDelete,
|
|
46
|
+
onCancel,
|
|
47
|
+
}: DeleteEntityPageProps) {
|
|
48
|
+
const [confirmationInput, setConfirmationInput] = useState('')
|
|
49
|
+
const [confirmationError, setConfirmationError] = useState(false)
|
|
50
|
+
|
|
51
|
+
const handleDelete = async () => {
|
|
52
|
+
if (confirmationInput.toLowerCase() !== confirmWord.toLowerCase()) {
|
|
53
|
+
setConfirmationError(true)
|
|
54
|
+
return
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
await onDelete()
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div className="delete-entity-page">
|
|
62
|
+
<NewPageHeader title={title} onCancel={onCancel} />
|
|
63
|
+
<div className="delete-entity-page__content">
|
|
64
|
+
<div className="delete-entity-page__inner">
|
|
65
|
+
<h2 className="delete-entity-page__entity-name">{entityName}</h2>
|
|
66
|
+
|
|
67
|
+
<div className="delete-entity-page__warning-card">
|
|
68
|
+
<p className="delete-entity-page__warning-text">{warningTitle}</p>
|
|
69
|
+
<p className="delete-entity-page__warning-description">
|
|
70
|
+
{warningDescription}
|
|
71
|
+
</p>
|
|
72
|
+
<ul className="delete-entity-page__consequences">
|
|
73
|
+
{consequences.map((item, i) => (
|
|
74
|
+
<li key={i}>{item}</li>
|
|
75
|
+
))}
|
|
76
|
+
</ul>
|
|
77
|
+
|
|
78
|
+
<div className="delete-entity-page__confirm-field">
|
|
79
|
+
<p className="delete-entity-page__confirm-label">
|
|
80
|
+
{confirmLabelPrefix} <strong>{confirmWord}</strong>{' '}
|
|
81
|
+
{confirmLabelSuffix}
|
|
82
|
+
</p>
|
|
83
|
+
{confirmationError && (
|
|
84
|
+
<span className="delete-entity-page__confirm-error">
|
|
85
|
+
{confirmErrorMessage}
|
|
86
|
+
</span>
|
|
87
|
+
)}
|
|
88
|
+
<NewInput
|
|
89
|
+
value={confirmationInput}
|
|
90
|
+
onChange={(e) => {
|
|
91
|
+
setConfirmationInput(
|
|
92
|
+
(e.target as HTMLInputElement).value,
|
|
93
|
+
)
|
|
94
|
+
setConfirmationError(false)
|
|
95
|
+
}}
|
|
96
|
+
error={confirmationError ? ' ' : undefined}
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div>
|
|
102
|
+
<Button
|
|
103
|
+
variant="destructive-strong"
|
|
104
|
+
onClick={handleDelete}
|
|
105
|
+
disabled={isDeleting}
|
|
106
|
+
isLoading={isDeleting}
|
|
107
|
+
style={{
|
|
108
|
+
background: 'var(--fills-main-fill-danger, #cc3c35)',
|
|
109
|
+
}}
|
|
110
|
+
>
|
|
111
|
+
{deleteButtonLabel}
|
|
112
|
+
</Button>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export default DeleteEntityPage
|
|
@@ -47,6 +47,33 @@
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
// Neutral Outline (border-primary border, label-primary text)
|
|
51
|
+
&--outline {
|
|
52
|
+
border: 1px solid var(--border-primary, #e8e9ef);
|
|
53
|
+
background-color: var(--surface-primary, #ffffff);
|
|
54
|
+
color: var(--label-primary, #121e52);
|
|
55
|
+
font-weight: 500;
|
|
56
|
+
min-height: 40px;
|
|
57
|
+
padding: 8px 16px 8px 12px;
|
|
58
|
+
border-radius: 6px;
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
line-height: 20px;
|
|
61
|
+
|
|
62
|
+
svg {
|
|
63
|
+
fill: currentColor;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&:hover {
|
|
68
|
+
background-color: var(--surface-secondary, #f8f8fa);
|
|
69
|
+
border-color: var(--border-secondary, #d0d3e3);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
&:active {
|
|
73
|
+
background-color: var(--surface-tertiary, #f0f0f5);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
50
77
|
// Primary - Outline
|
|
51
78
|
&--primary-outline {
|
|
52
79
|
border: 2px solid var(--fills-main-fill-action, #6200ee);
|