@licklist/design 0.78.5-dev.110 → 0.78.5-dev.112
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/Maintenance/Maintenance.scss.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/v2/components/AccountManagerCard/AccountManagerCard.scss.js +1 -1
- package/dist/v2/components/ActionMenu/ActionMenu.scss.js +1 -1
- package/dist/v2/components/Alert/Alert.scss.js +1 -1
- package/dist/v2/components/AvatarUpload/AvatarUpload.scss.js +1 -1
- package/dist/v2/components/Badge/Badge.scss.js +1 -1
- package/dist/v2/components/Button/Button.scss.js +1 -1
- package/dist/v2/components/Button/GhostButton.scss.js +1 -1
- package/dist/v2/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/v2/components/Checkbox/Checkbox.js +10 -50
- package/dist/v2/components/Checkbox/Checkbox.scss.js +1 -1
- package/dist/v2/components/ColorPicker/ColorPicker.d.ts +15 -0
- package/dist/v2/components/ColorPicker/ColorPicker.d.ts.map +1 -0
- package/dist/v2/components/ColorPicker/ColorPicker.js +40 -0
- package/dist/v2/components/ColorPicker/ColorPicker.scss.js +6 -0
- package/dist/v2/components/ColorPicker/index.d.ts +2 -0
- package/dist/v2/components/ColorPicker/index.d.ts.map +1 -0
- package/dist/v2/components/DataTable/DataTable.scss.js +1 -1
- package/dist/v2/components/EmptyState/EmptyState.scss.js +1 -1
- package/dist/v2/components/FeatureCard/FeatureCard.d.ts +11 -0
- package/dist/v2/components/FeatureCard/FeatureCard.d.ts.map +1 -0
- package/dist/v2/components/FeatureCard/FeatureCard.js +40 -0
- package/dist/v2/components/FeatureCard/FeatureCard.scss.js +6 -0
- package/dist/v2/components/FeatureCard/index.d.ts +3 -0
- package/dist/v2/components/FeatureCard/index.d.ts.map +1 -0
- package/dist/v2/components/FeatureToggle/FeatureToggle.scss.js +1 -1
- package/dist/v2/components/FormField/FormField.scss.js +1 -1
- package/dist/v2/components/IconButton/IconButton.d.ts +5 -1
- package/dist/v2/components/IconButton/IconButton.d.ts.map +1 -1
- package/dist/v2/components/IconButton/IconButton.js +28 -3
- package/dist/v2/components/IconButton/IconButton.scss.js +1 -1
- package/dist/v2/components/InfoGrid/InfoGrid.scss.js +1 -1
- package/dist/v2/components/Modal/DeleteModal.scss.js +1 -1
- package/dist/v2/components/NPSScore/NPSScore.scss.js +1 -1
- package/dist/v2/components/NewTabs/NewTabs.scss.js +1 -1
- package/dist/v2/components/NotificationBanner/NotificationBanner.scss.js +1 -1
- package/dist/v2/components/PeriodCard/PeriodCard.d.ts +18 -4
- package/dist/v2/components/PeriodCard/PeriodCard.d.ts.map +1 -1
- package/dist/v2/components/PeriodCard/PeriodCard.js +46 -6
- package/dist/v2/components/Select/Select.scss.js +1 -1
- package/dist/v2/components/StatusBadge/StatusBadge.scss.js +1 -1
- package/dist/v2/components/StepIndicator/StepIndicator.scss.js +1 -1
- package/dist/v2/components/TableControls/TableControls.scss.js +1 -1
- package/dist/v2/components/Tabs/Tabs.scss.js +1 -1
- package/dist/v2/components/Tooltip/Tooltip.scss.js +1 -1
- package/dist/v2/components/UserAvatar/UserAvatar.scss.js +1 -1
- package/dist/v2/components/UserPanel/UserPanel.scss.js +1 -1
- package/dist/v2/components/WYSIWYGEditor/WYSIWYGEditor.scss.js +1 -1
- package/dist/v2/components/ZoneCard/ZoneCard.scss.js +1 -1
- package/dist/v2/components/index.d.ts +4 -0
- package/dist/v2/components/index.d.ts.map +1 -1
- package/dist/v2/dashboard-analytics/chart/Chart.scss.js +1 -1
- package/dist/v2/dashboard-analytics/metric-card/MetricCard.scss.js +1 -1
- package/dist/v2/dashboard-analytics/venue-card/VenueCard.scss.js +1 -1
- package/dist/v2/dashboard-analytics/venue-closed-card/VenueClosedCard.scss.js +1 -1
- package/dist/v2/icons/index.d.ts +19 -2
- package/dist/v2/icons/index.d.ts.map +1 -1
- package/dist/v2/icons/index.js +21 -4
- package/dist/v2/navigation/DashboardLayout/AdminSidebar.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/DashboardLayout.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/ProviderSidebar.scss.js +1 -1
- package/dist/v2/navigation/DashboardLayout/TopNavigation.scss.js +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/SettingsPage.scss.js +1 -1
- package/dist/v2/pages/Settings/SettingsTabs.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarCustomisation.js +2 -0
- package/dist/v2/pages/Settings/components/SidebarCustomisation.scss.js +1 -1
- package/dist/v2/pages/Settings/components/SidebarNavItem.js +2 -0
- package/dist/v2/pages/Settings/components/SidebarNavItem.scss.js +1 -1
- package/dist/v2/pages/SettingsSubPage/SettingsSubPage.d.ts +1 -0
- package/dist/v2/pages/SettingsSubPage/SettingsSubPage.d.ts.map +1 -1
- package/dist/v2/pages/SettingsSubPage/SettingsSubPage.js +2 -2
- package/dist/v2/pages/SettingsSubPage/SettingsSubPage.scss.js +1 -1
- package/dist/v2/pages/auth/AuthLayout/AuthLayout.scss.js +1 -1
- package/dist/v2/shadcn/components/ui/switch.scss.js +1 -1
- package/dist/v2/styles/form/NewInput.scss.js +1 -1
- package/dist/v2/styles/tokens/_colors.scss +19 -0
- package/dist/v2/utils/colourPicker/colors.d.ts +8 -0
- package/dist/v2/utils/colourPicker/colors.d.ts.map +1 -0
- package/dist/v2/utils/timeFormat/formatTime.d.ts +14 -0
- package/dist/v2/utils/timeFormat/formatTime.d.ts.map +1 -0
- package/package.json +3 -3
- package/src/index.ts +1 -0
- package/src/v2/components/Badge/Badge.scss +1 -2
- package/src/v2/components/Checkbox/Checkbox.scss +37 -57
- package/src/v2/components/Checkbox/Checkbox.tsx +6 -44
- package/src/v2/components/ColorPicker/ColorPicker.scss +96 -0
- package/src/v2/components/ColorPicker/ColorPicker.stories.tsx +68 -0
- package/src/v2/components/ColorPicker/ColorPicker.tsx +49 -0
- package/src/v2/components/ColorPicker/index.ts +1 -0
- package/src/v2/components/FeatureCard/FeatureCard.scss +65 -0
- package/src/v2/components/FeatureCard/FeatureCard.stories.tsx +42 -0
- package/src/v2/components/FeatureCard/FeatureCard.tsx +37 -0
- package/src/v2/components/FeatureCard/index.ts +2 -0
- package/src/v2/components/IconButton/IconButton.scss +1 -1
- package/src/v2/components/IconButton/IconButton.tsx +41 -2
- package/src/v2/components/PeriodCard/PeriodCard.tsx +76 -13
- package/src/v2/components/index.ts +6 -0
- package/src/v2/icons/index.tsx +29 -4
- 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/pages/SettingsSubPage/SettingsSubPage.scss +4 -4
- package/src/v2/pages/SettingsSubPage/SettingsSubPage.tsx +3 -1
- package/src/v2/styles/tokens/_colors.scss +19 -0
- package/src/v2/utils/colourPicker/colors.ts +17 -0
- package/src/v2/utils/timeFormat/formatTime.ts +18 -0
|
@@ -2,16 +2,18 @@ import React from 'react'
|
|
|
2
2
|
import { NewInput } from '../NewInput'
|
|
3
3
|
import { Checkbox } from '../Checkbox'
|
|
4
4
|
import { IconButton } from '../IconButton'
|
|
5
|
-
import { ClockIcon
|
|
5
|
+
import { ClockIcon, } from '../../icons'
|
|
6
6
|
import './PeriodCard.scss'
|
|
7
7
|
|
|
8
8
|
export interface PeriodCardValue {
|
|
9
|
-
days
|
|
9
|
+
days?: string[]
|
|
10
10
|
is24Hours: boolean
|
|
11
11
|
startTime?: string
|
|
12
12
|
endTime?: string
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
startDate?: string
|
|
14
|
+
endDate?: string
|
|
15
|
+
maxCapacity?: number
|
|
16
|
+
minCapacity?: number | null
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export interface PeriodCardLabels {
|
|
@@ -24,6 +26,8 @@ export interface PeriodCardLabels {
|
|
|
24
26
|
alignToggle?: string
|
|
25
27
|
startTime?: string
|
|
26
28
|
endTime?: string
|
|
29
|
+
startDate?: string
|
|
30
|
+
endDate?: string
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
const DEFAULT_LABELS: Required<PeriodCardLabels> = {
|
|
@@ -36,6 +40,8 @@ const DEFAULT_LABELS: Required<PeriodCardLabels> = {
|
|
|
36
40
|
alignToggle: 'Align with Opening Hours',
|
|
37
41
|
startTime: 'Start Time',
|
|
38
42
|
endTime: 'End Time',
|
|
43
|
+
startDate: 'Start Date',
|
|
44
|
+
endDate: 'End Date',
|
|
39
45
|
}
|
|
40
46
|
|
|
41
47
|
const DAY_OPTIONS = [
|
|
@@ -68,8 +74,18 @@ export interface PeriodCardProps {
|
|
|
68
74
|
hideTime?: boolean
|
|
69
75
|
/** Make the min value field optional (shows "(optional)" label) */
|
|
70
76
|
minOptional?: boolean
|
|
71
|
-
/** Custom icon for the badge. Defaults to ClockIcon */
|
|
77
|
+
/** Custom icon for the badge. Defaults to ClockIcon or CalendarIcon based on props */
|
|
72
78
|
badgeIcon?: React.ReactNode
|
|
79
|
+
/** Type of the period card, determines the default badge icon */
|
|
80
|
+
type?: 'date_time' | 'range'
|
|
81
|
+
/** Background color for the delete icon button */
|
|
82
|
+
deleteBackgroundColor?: string
|
|
83
|
+
/** Border color for the delete icon button */
|
|
84
|
+
deleteBorderColor?: string
|
|
85
|
+
/** Hover background color for the delete icon button */
|
|
86
|
+
deleteHoverBackgroundColor?: string
|
|
87
|
+
/** Hover border color for the delete icon button */
|
|
88
|
+
deleteHoverBorderColor?: string
|
|
73
89
|
/** Custom content. When provided, built-in sections (capacity, days, time) are not rendered. */
|
|
74
90
|
children?: React.ReactNode
|
|
75
91
|
className?: string
|
|
@@ -88,6 +104,11 @@ export const PeriodCard: React.FC<PeriodCardProps> = ({
|
|
|
88
104
|
hideTime = false,
|
|
89
105
|
minOptional = true,
|
|
90
106
|
badgeIcon,
|
|
107
|
+
type,
|
|
108
|
+
deleteBackgroundColor,
|
|
109
|
+
deleteBorderColor,
|
|
110
|
+
deleteHoverBackgroundColor,
|
|
111
|
+
deleteHoverBorderColor,
|
|
91
112
|
children,
|
|
92
113
|
className = '',
|
|
93
114
|
}) => {
|
|
@@ -127,7 +148,17 @@ export const PeriodCard: React.FC<PeriodCardProps> = ({
|
|
|
127
148
|
{title && (
|
|
128
149
|
<div className="period-card__title-row">
|
|
129
150
|
<span className="period-card__title">{title}</span>
|
|
130
|
-
{onDelete &&
|
|
151
|
+
{onDelete && (
|
|
152
|
+
<IconButton
|
|
153
|
+
icon="delete"
|
|
154
|
+
variant="danger"
|
|
155
|
+
backgroundColor={deleteBackgroundColor}
|
|
156
|
+
borderColor={deleteBorderColor}
|
|
157
|
+
hoverBackgroundColor={deleteHoverBackgroundColor}
|
|
158
|
+
hoverBorderColor={deleteHoverBorderColor}
|
|
159
|
+
onClick={onDelete}
|
|
160
|
+
/>
|
|
161
|
+
)}
|
|
131
162
|
</div>
|
|
132
163
|
)}
|
|
133
164
|
|
|
@@ -139,7 +170,15 @@ export const PeriodCard: React.FC<PeriodCardProps> = ({
|
|
|
139
170
|
<span className="period-card__badge">{labels.badge}</span>
|
|
140
171
|
</div>
|
|
141
172
|
{onDelete && (
|
|
142
|
-
<IconButton
|
|
173
|
+
<IconButton
|
|
174
|
+
icon="delete"
|
|
175
|
+
variant="danger"
|
|
176
|
+
backgroundColor={deleteBackgroundColor}
|
|
177
|
+
borderColor={deleteBorderColor}
|
|
178
|
+
hoverBackgroundColor={deleteHoverBackgroundColor}
|
|
179
|
+
hoverBorderColor={deleteHoverBorderColor}
|
|
180
|
+
onClick={onDelete}
|
|
181
|
+
/>
|
|
143
182
|
)}
|
|
144
183
|
</div>
|
|
145
184
|
)}
|
|
@@ -162,7 +201,7 @@ export const PeriodCard: React.FC<PeriodCardProps> = ({
|
|
|
162
201
|
type="number"
|
|
163
202
|
min={0}
|
|
164
203
|
value={
|
|
165
|
-
value.minCapacity === null || value.minCapacity === 0
|
|
204
|
+
value.minCapacity === null || value.minCapacity === undefined || value.minCapacity === 0
|
|
166
205
|
? ''
|
|
167
206
|
: value.minCapacity
|
|
168
207
|
}
|
|
@@ -179,7 +218,7 @@ export const PeriodCard: React.FC<PeriodCardProps> = ({
|
|
|
179
218
|
label={labels.maxValue}
|
|
180
219
|
type="number"
|
|
181
220
|
min={1}
|
|
182
|
-
value={value.maxCapacity === 0 ? '' : value.maxCapacity}
|
|
221
|
+
value={value.maxCapacity === 0 || value.maxCapacity === undefined ? '' : value.maxCapacity}
|
|
183
222
|
onChange={(e) =>
|
|
184
223
|
updateField({
|
|
185
224
|
maxCapacity:
|
|
@@ -193,6 +232,30 @@ export const PeriodCard: React.FC<PeriodCardProps> = ({
|
|
|
193
232
|
</div>
|
|
194
233
|
)}
|
|
195
234
|
|
|
235
|
+
{/* Date Range */}
|
|
236
|
+
{type === 'range' && value && (
|
|
237
|
+
<div className="period-card__section">
|
|
238
|
+
<div className="period-card__row">
|
|
239
|
+
<NewInput
|
|
240
|
+
label={labels.startDate}
|
|
241
|
+
type="date"
|
|
242
|
+
value={value.startDate || ''}
|
|
243
|
+
onChange={(e) =>
|
|
244
|
+
updateField({ startDate: (e.target as HTMLInputElement).value })
|
|
245
|
+
}
|
|
246
|
+
/>
|
|
247
|
+
<NewInput
|
|
248
|
+
label={labels.endDate}
|
|
249
|
+
type="date"
|
|
250
|
+
value={value.endDate || ''}
|
|
251
|
+
onChange={(e) =>
|
|
252
|
+
updateField({ endDate: (e.target as HTMLInputElement).value })
|
|
253
|
+
}
|
|
254
|
+
/>
|
|
255
|
+
</div>
|
|
256
|
+
</div>
|
|
257
|
+
)}
|
|
258
|
+
|
|
196
259
|
{/* Days */}
|
|
197
260
|
{!hideDays && value && (
|
|
198
261
|
<div className="period-card__section">
|
|
@@ -240,16 +303,16 @@ export const PeriodCard: React.FC<PeriodCardProps> = ({
|
|
|
240
303
|
<NewInput
|
|
241
304
|
label={labels.startTime}
|
|
242
305
|
type="time"
|
|
243
|
-
value={value.startTime || '
|
|
244
|
-
onChange={(e) =>
|
|
306
|
+
value={value.startTime || ''}
|
|
307
|
+
onChange={(e: { target: HTMLInputElement }) =>
|
|
245
308
|
updateField({ startTime: (e.target as HTMLInputElement).value })
|
|
246
309
|
}
|
|
247
310
|
/>
|
|
248
311
|
<NewInput
|
|
249
312
|
label={labels.endTime}
|
|
250
313
|
type="time"
|
|
251
|
-
value={value.endTime || '
|
|
252
|
-
onChange={(e) =>
|
|
314
|
+
value={value.endTime || ''}
|
|
315
|
+
onChange={(e: { target: HTMLInputElement }) =>
|
|
253
316
|
updateField({ endTime: (e.target as HTMLInputElement).value })
|
|
254
317
|
}
|
|
255
318
|
/>
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export { ColorPicker } from './ColorPicker'
|
|
2
|
+
export type { ColorPickerProps, ColorOption } from './ColorPicker'
|
|
3
|
+
|
|
1
4
|
export { IconButton } from './IconButton'
|
|
2
5
|
export type { IconButtonProps } from './IconButton'
|
|
3
6
|
|
|
@@ -19,6 +22,9 @@ export type { TableControlsProps, TableSearchConfig, TableFilterConfig, TableHea
|
|
|
19
22
|
export { EmptyState } from './EmptyState'
|
|
20
23
|
export type { EmptyStateProps } from './EmptyState'
|
|
21
24
|
|
|
25
|
+
export { FeatureCard } from './FeatureCard'
|
|
26
|
+
export type { FeatureCardProps } from './FeatureCard'
|
|
27
|
+
|
|
22
28
|
|
|
23
29
|
export { Tabs } from './Tabs'
|
|
24
30
|
export type { TabsProps, TabItem } from './Tabs'
|
package/src/v2/icons/index.tsx
CHANGED
|
@@ -82,8 +82,8 @@ export const WaiversIcon = ({ width = 24, height = 24, className = '' }: { width
|
|
|
82
82
|
</svg>
|
|
83
83
|
)
|
|
84
84
|
|
|
85
|
-
export const CalendarIcon = () => (
|
|
86
|
-
<svg width=
|
|
85
|
+
export const CalendarIcon = ({ width = 24, height = 24 }: { width?: number; height?: number } = {}) => (
|
|
86
|
+
<svg width={width} height={height} viewBox="0 0 32 32" fill="none">
|
|
87
87
|
<path d="M13 6V8H19V6H21V8H25C25.5523 8 26 8.44772 26 9V25C26 25.5523 25.5523 26 25 26H7C6.44772 26 6 25.5523 6 25V9C6 8.44772 6.44772 8 7 8H11V6H13ZM24 16H8V24H24V16ZM15 18V22H10V18H15ZM11 10H8V14H24V10H21V12H19V10H13V12H11V10Z" fill="currentColor" />
|
|
88
88
|
</svg>
|
|
89
89
|
)
|
|
@@ -108,6 +108,15 @@ export const EditIcon = () => (
|
|
|
108
108
|
</svg>
|
|
109
109
|
)
|
|
110
110
|
|
|
111
|
+
export const NoRulesIcon = ({ width = 24, height = 24, className = '' }: { width?: number; height?: number; className?: string } = {}) => (
|
|
112
|
+
<svg width={width} height={height} viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" className={className}>
|
|
113
|
+
<path d="M24 6C25.6569 6 27 7.34315 27 9V11H25V23C25 24.6569 23.6569 26 22 26H8C6.34315 26 5 24.6569 5 23V21H21V23C21 23.5128 21.386 23.9355 21.8834 23.9933L22 24C22.5128 24 22.9355 23.614 22.9933 23.1166L23 23V8H10C9.48716 8 9.06449 8.38604 9.00673 8.88338L9 9V19H7V9C7 7.34315 8.34315 6 10 6H24Z" fill="black"/>
|
|
114
|
+
<path d="M11 11C11 10.4477 11.4477 10 12 10H20C20.5523 10 21 10.4477 21 11C21 11.5523 20.5523 12 20 12H12C11.4477 12 11 11.5523 11 11Z" fill="black" fill-opacity="0.25"/>
|
|
115
|
+
<path d="M11 15C11 14.4477 11.4477 14 12 14H20C20.5523 14 21 14.4477 21 15C21 15.5523 20.5523 16 20 16H12C11.4477 16 11 15.5523 11 15Z" fill="black" fill-opacity="0.25"/>
|
|
116
|
+
<path d="M11 19C11 18.4477 11.4477 18 12 18H20C20.5523 18 21 18.4477 21 19C21 19.5523 20.5523 20 20 20H12C11.4477 20 11 19.5523 11 19Z" fill="black" fill-opacity="0.25"/>
|
|
117
|
+
</svg>
|
|
118
|
+
)
|
|
119
|
+
|
|
111
120
|
export const CalendarSmallIcon = () => (
|
|
112
121
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 22 22" fill="none">
|
|
113
122
|
<path d="M8.9375 4.125V5.5H13.0625V4.125H14.4375V5.5H17.1875C17.5672 5.5 17.875 5.80781 17.875 6.1875V17.1875C17.875 17.5672 17.5672 17.875 17.1875 17.875H4.8125C4.43281 17.875 4.125 17.5672 4.125 17.1875V6.1875C4.125 5.80781 4.43281 5.5 4.8125 5.5H7.5625V4.125H8.9375ZM16.5 11H5.5V16.5H16.5V11ZM10.3125 12.375V15.125H6.875V12.375H10.3125ZM7.5625 6.875H5.5V9.625H16.5V6.875H14.4375V8.25H13.0625V6.875H8.9375V8.25H7.5625V6.875Z" fill="#626A90"/>
|
|
@@ -582,8 +591,21 @@ export const ReportsEmptyIcon = () => (
|
|
|
582
591
|
</svg>
|
|
583
592
|
)
|
|
584
593
|
|
|
585
|
-
export const CurrencyPoundIcon = ({
|
|
586
|
-
|
|
594
|
+
export const CurrencyPoundIcon = ({
|
|
595
|
+
size = 28,
|
|
596
|
+
className = '',
|
|
597
|
+
}: {
|
|
598
|
+
size?: number
|
|
599
|
+
className?: string
|
|
600
|
+
} = {}) => (
|
|
601
|
+
<svg
|
|
602
|
+
width={size}
|
|
603
|
+
height={size}
|
|
604
|
+
viewBox="0 0 32 32"
|
|
605
|
+
fill="none"
|
|
606
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
607
|
+
className={className}
|
|
608
|
+
>
|
|
587
609
|
<path d="M16.0049 26.0028C10.482 26.0028 6.00488 21.5257 6.00488 16.0028C6.00488 10.48 10.482 6.00281 16.0049 6.00281C21.5277 6.00281 26.0049 10.48 26.0049 16.0028C26.0049 21.5257 21.5277 26.0028 16.0049 26.0028ZM16.0049 24.0028C20.4232 24.0028 24.0049 20.4211 24.0049 16.0028C24.0049 11.5845 20.4232 8.00281 16.0049 8.00281C11.5866 8.00281 8.00488 11.5845 8.00488 16.0028C8.00488 20.4211 11.5866 24.0028 16.0049 24.0028ZM13.0049 17.0028H12.0049V15.0028H13.0049V14.0028C13.0049 12.0698 14.5719 10.5028 16.5049 10.5028C17.9741 10.5028 19.2319 11.4081 19.7509 12.6913L17.7644 13.1879C17.4971 12.7756 17.0329 12.5028 16.5049 12.5028C15.6765 12.5028 15.0049 13.1744 15.0049 14.0028V15.0028H18.0049V17.0028H15.0049V19.0028H20.0049V21.0028H12.0049V19.0028H13.0049V17.0028Z" fill="currentColor"/>
|
|
588
610
|
</svg>
|
|
589
611
|
)
|
|
@@ -734,6 +756,9 @@ export const IconGripVertical: React.FC<ShadcnIconProps> = ({ className = '', si
|
|
|
734
756
|
</svg>
|
|
735
757
|
)
|
|
736
758
|
|
|
759
|
+
export const IconPlus = PlusIcon
|
|
760
|
+
export const IconPlusThick = PlusIcon
|
|
761
|
+
|
|
737
762
|
// ── Sandbox icon aliases (used by shadcn ui components) ─────────────────────
|
|
738
763
|
export const IconArrowLeft = ArrowLeftIcon
|
|
739
764
|
export const IconArrowRight = ArrowRightIcon
|
|
@@ -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
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
align-self: stretch;
|
|
5
5
|
|
|
6
6
|
&__back {
|
|
7
|
-
padding: 24px
|
|
7
|
+
padding: 24px 0 0 0;
|
|
8
8
|
align-self: flex-start;
|
|
9
9
|
|
|
10
10
|
.ghost-button {
|
|
@@ -23,15 +23,15 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
@media (max-width: 768px) {
|
|
26
|
-
padding: 16px
|
|
26
|
+
padding: 16px 0 0 0;
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
&__content {
|
|
31
|
-
padding:
|
|
31
|
+
padding: 0;
|
|
32
32
|
|
|
33
33
|
@media (max-width: 768px) {
|
|
34
|
-
padding: 0;
|
|
34
|
+
padding: 16px 0;
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -11,6 +11,7 @@ export interface SettingsSubPageProps {
|
|
|
11
11
|
actionLabel?: string
|
|
12
12
|
onAction?: () => void
|
|
13
13
|
children?: React.ReactNode
|
|
14
|
+
showDivider?: boolean
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export const SettingsSubPage: React.FC<SettingsSubPageProps> = ({
|
|
@@ -20,6 +21,7 @@ export const SettingsSubPage: React.FC<SettingsSubPageProps> = ({
|
|
|
20
21
|
actionLabel,
|
|
21
22
|
onAction,
|
|
22
23
|
children,
|
|
24
|
+
showDivider = true,
|
|
23
25
|
}) => {
|
|
24
26
|
return (
|
|
25
27
|
<div className="settings-sub-page">
|
|
@@ -32,7 +34,7 @@ export const SettingsSubPage: React.FC<SettingsSubPageProps> = ({
|
|
|
32
34
|
)}
|
|
33
35
|
<NewPageHeader
|
|
34
36
|
title={title}
|
|
35
|
-
showDivider
|
|
37
|
+
showDivider={showDivider}
|
|
36
38
|
/>
|
|
37
39
|
<div className="settings-sub-page__content">
|
|
38
40
|
{onAction && actionLabel && (
|
|
@@ -116,6 +116,16 @@
|
|
|
116
116
|
--pink-800: #80224D;
|
|
117
117
|
--pink-900: #611A3B;
|
|
118
118
|
|
|
119
|
+
--grey-100: #F8F8FA;
|
|
120
|
+
--grey-200: #E8E9EF;
|
|
121
|
+
--grey-300: #D2D5E3;
|
|
122
|
+
--grey-400: #B6BACC;
|
|
123
|
+
--grey-500: #9399B3;
|
|
124
|
+
--grey-600: #626A90;
|
|
125
|
+
--grey-700: #433D7B;
|
|
126
|
+
--grey-800: #14215A;
|
|
127
|
+
--grey-900: #0B1232;
|
|
128
|
+
|
|
119
129
|
/* Teals */
|
|
120
130
|
--teal-50: #E9FAF7;
|
|
121
131
|
--teal-100: #BAF0E7;
|
|
@@ -218,6 +228,15 @@
|
|
|
218
228
|
--pink-darker: var(--pink-700);
|
|
219
229
|
--pink-darkest: var(--pink-800);
|
|
220
230
|
|
|
231
|
+
/* Grey Scale */
|
|
232
|
+
--grey-lightest: var(--grey-50);
|
|
233
|
+
--grey-lighter: var(--grey-100);
|
|
234
|
+
--grey-light: var(--grey-300);
|
|
235
|
+
--grey-regular: var(--grey-500);
|
|
236
|
+
--grey-dark: var(--grey-600);
|
|
237
|
+
--grey-darker: var(--grey-700);
|
|
238
|
+
--grey-darkest: var(--grey-800);
|
|
239
|
+
|
|
221
240
|
/* Green Scale */
|
|
222
241
|
--green-lightest: var(--green-50);
|
|
223
242
|
--green-lighter: var(--green-100);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standard color palette for pricing periods and other color picker components
|
|
3
|
+
*/
|
|
4
|
+
export const COLORS = [
|
|
5
|
+
{ name: 'red', hex: '#E0423A' },
|
|
6
|
+
{ name: 'orange', hex: '#FD7E14' },
|
|
7
|
+
{ name: 'yellow', hex: '#FBB912' },
|
|
8
|
+
{ name: 'green', hex: '#52C22B' },
|
|
9
|
+
{ name: 'teal', hex: '#22CEB1' },
|
|
10
|
+
{ name: 'cyan', hex: '#2BD9FF' },
|
|
11
|
+
{ name: 'blue', hex: '#0E8CE2' },
|
|
12
|
+
{ name: 'indigo', hex: '#5D5BF4' },
|
|
13
|
+
{ name: 'purple', hex: '#6200EE' },
|
|
14
|
+
{ name: 'pink', hex: '#EC1479' },
|
|
15
|
+
{ name: 'grey', hex: '#9399B3' },
|
|
16
|
+
]
|
|
17
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats time from "HH:mm:ss" to "HH:mm" format
|
|
3
|
+
* Useful for converting HTML time input values to backend-compatible format
|
|
4
|
+
*
|
|
5
|
+
* @param time - Time string in "HH:mm:ss" or "HH:mm" format
|
|
6
|
+
* @returns Time string in "HH:mm" format, or undefined if input is undefined
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* formatTimeToHHMM("09:00:00") // returns "09:00"
|
|
10
|
+
* formatTimeToHHMM("17:30") // returns "17:30"
|
|
11
|
+
* formatTimeToHHMM(undefined) // returns undefined
|
|
12
|
+
*/
|
|
13
|
+
export const formatTimeToHHMM = (time?: string): string | undefined => {
|
|
14
|
+
if (!time) return undefined
|
|
15
|
+
// Extract HH:mm from HH:mm:ss (or return as-is if already HH:mm)
|
|
16
|
+
return time.substring(0, 5)
|
|
17
|
+
}
|
|
18
|
+
|