@licklist/design 0.78.44 → 0.78.46

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.
Files changed (113) hide show
  1. package/dist/custom-fields/constants.d.ts +9 -8
  2. package/dist/custom-fields/constants.d.ts.map +1 -1
  3. package/dist/events/event-venue-map/utils/index.d.ts +1 -1
  4. package/dist/events/event-venue-map/utils/index.d.ts.map +1 -1
  5. package/dist/iframe/event/event-venue-map/IframeEventVenueMap.d.ts +3 -3
  6. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts +1 -1
  7. package/dist/iframe/order-process/components/BookingSummary/utils/index.d.ts.map +1 -1
  8. package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts +5 -15
  9. package/dist/iframe/payment/order-items-table/hooks/useTableData.d.ts.map +1 -1
  10. package/dist/iframe/payment/order-items-table/utils/index.d.ts +4 -4
  11. package/dist/iframe/payment/order-items-table/utils/index.d.ts.map +1 -1
  12. package/dist/index.d.ts +2 -0
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +4 -0
  15. package/dist/product-set/form/SelectCategoryModal.d.ts +5 -5
  16. package/dist/product-set/utils/index.d.ts +12 -12
  17. package/dist/sales/coupon/utils/index.d.ts +2 -2
  18. package/dist/v2/components/PeriodCard/PeriodCard.d.ts +66 -0
  19. package/dist/v2/components/PeriodCard/PeriodCard.d.ts.map +1 -0
  20. package/dist/v2/components/PeriodCard/PeriodCard.js +351 -0
  21. package/dist/v2/components/PeriodCard/PeriodCard.scss.js +6 -0
  22. package/dist/v2/components/PeriodCard/index.d.ts +3 -0
  23. package/dist/v2/components/PeriodCard/index.d.ts.map +1 -0
  24. package/dist/v2/components/ReorderRow/ReorderRow.d.ts +24 -0
  25. package/dist/v2/components/ReorderRow/ReorderRow.d.ts.map +1 -0
  26. package/dist/v2/components/ReorderRow/ReorderRow.js +109 -0
  27. package/dist/v2/components/ReorderRow/ReorderRow.scss.js +6 -0
  28. package/dist/v2/components/ReorderRow/index.d.ts +3 -0
  29. package/dist/v2/components/ReorderRow/index.d.ts.map +1 -0
  30. package/dist/v2/components/index.d.ts +4 -0
  31. package/dist/v2/components/index.d.ts.map +1 -1
  32. package/dist/v2/icons/index.d.ts +10 -0
  33. package/dist/v2/icons/index.d.ts.map +1 -1
  34. package/dist/v2/index.d.ts +8 -0
  35. package/dist/v2/index.d.ts.map +1 -1
  36. package/dist/v2/pages/DeleteEntity/DeleteEntityPage.d.ts +29 -0
  37. package/dist/v2/pages/DeleteEntity/DeleteEntityPage.d.ts.map +1 -0
  38. package/dist/v2/pages/DeleteEntity/DeleteEntityPage.js +294 -0
  39. package/dist/v2/pages/DeleteEntity/DeleteEntityPage.scss.js +6 -0
  40. package/dist/v2/pages/DeleteEntity/index.d.ts +3 -0
  41. package/dist/v2/pages/DeleteEntity/index.d.ts.map +1 -0
  42. package/dist/v2/pages/Settings/components/SidebarCustomisation.js +2 -0
  43. package/dist/v2/pages/Settings/components/SidebarNavItem.js +2 -0
  44. package/dist/v2/pages/SettingsSubPage/SettingsSubPage.d.ts +12 -0
  45. package/dist/v2/pages/SettingsSubPage/SettingsSubPage.d.ts.map +1 -0
  46. package/dist/v2/pages/SettingsSubPage/SettingsSubPage.js +47 -0
  47. package/dist/v2/pages/SettingsSubPage/SettingsSubPage.scss.js +6 -0
  48. package/dist/v2/pages/SettingsSubPage/index.d.ts +3 -0
  49. package/dist/v2/pages/SettingsSubPage/index.d.ts.map +1 -0
  50. package/dist/v2/pages/auth/AuthLayout/AuthLayout.d.ts +14 -0
  51. package/dist/v2/pages/auth/AuthLayout/AuthLayout.d.ts.map +1 -0
  52. package/dist/v2/pages/auth/AuthLayout/index.d.ts +3 -0
  53. package/dist/v2/pages/auth/AuthLayout/index.d.ts.map +1 -0
  54. package/dist/v2/pages/auth/CreatePassword/CreatePasswordPage.d.ts +10 -0
  55. package/dist/v2/pages/auth/CreatePassword/CreatePasswordPage.d.ts.map +1 -0
  56. package/dist/v2/pages/auth/CreatePassword/index.d.ts +3 -0
  57. package/dist/v2/pages/auth/CreatePassword/index.d.ts.map +1 -0
  58. package/dist/v2/pages/auth/Login/LoginPage.d.ts +11 -0
  59. package/dist/v2/pages/auth/Login/LoginPage.d.ts.map +1 -0
  60. package/dist/v2/pages/auth/Login/index.d.ts +3 -0
  61. package/dist/v2/pages/auth/Login/index.d.ts.map +1 -0
  62. package/dist/v2/pages/auth/ResetPassword/ResetPasswordPage.d.ts +12 -0
  63. package/dist/v2/pages/auth/ResetPassword/ResetPasswordPage.d.ts.map +1 -0
  64. package/dist/v2/pages/auth/ResetPassword/index.d.ts +3 -0
  65. package/dist/v2/pages/auth/ResetPassword/index.d.ts.map +1 -0
  66. package/dist/v2/pages/auth/VerifyEmail/VerifyEmailPage.d.ts +9 -0
  67. package/dist/v2/pages/auth/VerifyEmail/VerifyEmailPage.d.ts.map +1 -0
  68. package/dist/v2/pages/auth/VerifyEmail/index.d.ts +3 -0
  69. package/dist/v2/pages/auth/VerifyEmail/index.d.ts.map +1 -0
  70. package/dist/v2/pages/auth/index.d.ts +11 -0
  71. package/dist/v2/pages/auth/index.d.ts.map +1 -0
  72. package/package.json +3 -3
  73. package/rollup.config.js +1 -0
  74. package/src/auth/Authorizer.tsx +1 -1
  75. package/src/index.ts +2 -0
  76. package/src/v2/components/PeriodCard/PeriodCard.scss +157 -0
  77. package/src/v2/components/PeriodCard/PeriodCard.stories.tsx +245 -0
  78. package/src/v2/components/PeriodCard/PeriodCard.tsx +350 -0
  79. package/src/v2/components/PeriodCard/index.ts +8 -0
  80. package/src/v2/components/ReorderRow/ReorderRow.scss +68 -0
  81. package/src/v2/components/ReorderRow/ReorderRow.stories.tsx +124 -0
  82. package/src/v2/components/ReorderRow/ReorderRow.tsx +88 -0
  83. package/src/v2/components/ReorderRow/index.ts +2 -0
  84. package/src/v2/components/index.ts +6 -0
  85. package/src/v2/icons/Icons.stories.tsx +253 -0
  86. package/src/v2/icons/index.tsx +14 -0
  87. package/src/v2/index.ts +17 -0
  88. package/src/v2/pages/DeleteEntity/DeleteEntityPage.scss +96 -0
  89. package/src/v2/pages/DeleteEntity/DeleteEntityPage.stories.tsx +83 -0
  90. package/src/v2/pages/DeleteEntity/DeleteEntityPage.tsx +120 -0
  91. package/src/v2/pages/DeleteEntity/index.ts +2 -0
  92. package/src/v2/pages/SettingsSubPage/SettingsSubPage.tsx +49 -0
  93. package/src/v2/pages/SettingsSubPage/index.ts +2 -0
  94. package/src/v2/pages/auth/AuthLayout/AuthLayout.scss +140 -0
  95. package/src/v2/pages/auth/AuthLayout/AuthLayout.tsx +61 -0
  96. package/src/v2/pages/auth/AuthLayout/index.ts +2 -0
  97. package/src/v2/pages/auth/CreatePassword/CreatePasswordPage.scss +149 -0
  98. package/src/v2/pages/auth/CreatePassword/CreatePasswordPage.stories.tsx +45 -0
  99. package/src/v2/pages/auth/CreatePassword/CreatePasswordPage.tsx +179 -0
  100. package/src/v2/pages/auth/CreatePassword/index.ts +2 -0
  101. package/src/v2/pages/auth/Login/LoginPage.scss +49 -0
  102. package/src/v2/pages/auth/Login/LoginPage.stories.tsx +45 -0
  103. package/src/v2/pages/auth/Login/LoginPage.tsx +98 -0
  104. package/src/v2/pages/auth/Login/index.ts +2 -0
  105. package/src/v2/pages/auth/ResetPassword/ResetPasswordPage.scss +84 -0
  106. package/src/v2/pages/auth/ResetPassword/ResetPasswordPage.stories.tsx +53 -0
  107. package/src/v2/pages/auth/ResetPassword/ResetPasswordPage.tsx +109 -0
  108. package/src/v2/pages/auth/ResetPassword/index.ts +2 -0
  109. package/src/v2/pages/auth/VerifyEmail/VerifyEmailPage.scss +72 -0
  110. package/src/v2/pages/auth/VerifyEmail/VerifyEmailPage.stories.tsx +41 -0
  111. package/src/v2/pages/auth/VerifyEmail/VerifyEmailPage.tsx +110 -0
  112. package/src/v2/pages/auth/VerifyEmail/index.ts +2 -0
  113. package/src/v2/pages/auth/index.ts +14 -0
@@ -0,0 +1,140 @@
1
+ .auth-layout {
2
+ position: relative;
3
+ width: 100%;
4
+ min-height: 100vh;
5
+ display: flex;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ justify-content: flex-start;
9
+ background-color: var(--surface-secondary);
10
+ padding: 0 16px;
11
+
12
+ &__alert {
13
+ width: 846px;
14
+ max-width: 100%;
15
+ margin-top: 24px;
16
+ position: relative;
17
+ z-index: 1;
18
+ }
19
+
20
+ &__bg-decoration {
21
+ position: fixed;
22
+ top: 0;
23
+ left: 0;
24
+ width: 489px;
25
+ height: 588px;
26
+ pointer-events: none;
27
+ z-index: 0;
28
+ }
29
+
30
+ &__card {
31
+ position: relative;
32
+ z-index: 10;
33
+ width: 846px;
34
+ max-width: 100%;
35
+ min-height: 400px;
36
+ background-color: var(--surface-primary);
37
+ border-radius: 16px;
38
+ box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
39
+ overflow: hidden;
40
+ margin-top: 80px;
41
+
42
+ @media (max-width: 768px) {
43
+ margin-top: 40px;
44
+ }
45
+ }
46
+
47
+ &__alert + &__card {
48
+ margin-top: 16px;
49
+ }
50
+
51
+ &__header {
52
+ display: flex;
53
+ align-items: center;
54
+ justify-content: space-between;
55
+ padding: 16px;
56
+ border-bottom: 1px solid var(--border-primary);
57
+
58
+ .new-badge {
59
+ padding: 6px 10px;
60
+ font-size: 11px;
61
+ }
62
+ }
63
+
64
+ &__body {
65
+ padding: 42px;
66
+
67
+ @media (max-width: 768px) {
68
+ padding: 20px;
69
+ }
70
+ }
71
+
72
+ &__content {
73
+ display: flex;
74
+ width: 100%;
75
+ gap: 64px;
76
+ flex-wrap: wrap;
77
+
78
+ @media (max-width: 768px) {
79
+ gap: 32px;
80
+ }
81
+ }
82
+
83
+ &__info {
84
+ min-width: 240px;
85
+ flex: 1;
86
+ flex-shrink: 0;
87
+ flex-basis: 0;
88
+ max-width: 260px;
89
+ color: var(--label-primary);
90
+ }
91
+
92
+ &__icon {
93
+ width: 64px;
94
+ height: 64px;
95
+ color: var(--fill-primary);
96
+
97
+ svg {
98
+ width: 100%;
99
+ height: 100%;
100
+ }
101
+ }
102
+
103
+ &__title {
104
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
105
+ font-size: 32px;
106
+ font-weight: 700;
107
+ line-height: 1;
108
+ color: var(--label-primary);
109
+ margin: 8px 0 0;
110
+ padding: 0;
111
+ }
112
+
113
+ &__subtitle {
114
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
115
+ font-size: 18px;
116
+ font-weight: 400;
117
+ line-height: 1;
118
+ color: var(--label-secondary);
119
+ margin: 16px 0 0;
120
+ padding: 0;
121
+
122
+ @media (max-width: 768px) {
123
+ margin-top: 4px;
124
+ }
125
+ }
126
+
127
+ &__form-area {
128
+ display: flex;
129
+ min-width: 240px;
130
+ flex-direction: column;
131
+ align-items: stretch;
132
+ flex: 1;
133
+ flex-shrink: 0;
134
+ flex-basis: 0;
135
+
136
+ @media (max-width: 768px) {
137
+ max-width: 100%;
138
+ }
139
+ }
140
+ }
@@ -0,0 +1,61 @@
1
+ import React, { useState, useEffect } from 'react'
2
+ import './AuthLayout.scss'
3
+ import { DashboardFooter } from '../../../navigation/DashboardLayout/DashboardFooter'
4
+ import { AuthBgDecorationIcon, BookedLogo } from '../../../icons'
5
+ import { Badge } from '../../../components/Badge'
6
+ import { Alert } from '../../../components/Alert'
7
+
8
+ export interface AuthLayoutProps {
9
+ badgeLabel: string
10
+ icon: React.ReactNode
11
+ title: string
12
+ subtitle: string
13
+ children: React.ReactNode
14
+ version?: string
15
+ error?: string
16
+ successMessage?: string
17
+ }
18
+
19
+ export const AuthLayout: React.FC<AuthLayoutProps> = ({ badgeLabel, icon, title, subtitle, children, version, error, successMessage }) => {
20
+ const [dismissed, setDismissed] = useState(false)
21
+
22
+ useEffect(() => {
23
+ setDismissed(false)
24
+ }, [error, successMessage])
25
+
26
+ const showError = error && !dismissed
27
+ const showSuccess = successMessage && !dismissed
28
+
29
+ return (
30
+ <div className="auth-layout">
31
+ <AuthBgDecorationIcon />
32
+
33
+ {showError && (
34
+ <Alert variant="error" title="Error" message={error} className="auth-layout__alert" onDismiss={() => setDismissed(true)} />
35
+ )}
36
+ {showSuccess && (
37
+ <Alert variant="success" title="Success" message={successMessage} className="auth-layout__alert" onDismiss={() => setDismissed(true)} />
38
+ )}
39
+
40
+ <div className="auth-layout__card">
41
+ <div className="auth-layout__header">
42
+ <BookedLogo />
43
+ <Badge>{badgeLabel}</Badge>
44
+ </div>
45
+ <div className="auth-layout__body">
46
+ <div className="auth-layout__content">
47
+ <div className="auth-layout__info">
48
+ <div className="auth-layout__icon">{icon}</div>
49
+ <h1 className="auth-layout__title">{title}</h1>
50
+ <p className="auth-layout__subtitle">{subtitle}</p>
51
+ </div>
52
+ <div className="auth-layout__form-area">
53
+ {children}
54
+ </div>
55
+ </div>
56
+ </div>
57
+ </div>
58
+ <DashboardFooter version={version} />
59
+ </div>
60
+ )
61
+ }
@@ -0,0 +1,2 @@
1
+ export { AuthLayout } from './AuthLayout'
2
+ export type { AuthLayoutProps } from './AuthLayout'
@@ -0,0 +1,149 @@
1
+ .auth-create-password {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 0;
5
+
6
+ &__requirements {
7
+ margin-bottom: 24px;
8
+ }
9
+
10
+ &__requirements-title {
11
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
12
+ font-size: 15px;
13
+ font-weight: 600;
14
+ line-height: 1.4;
15
+ color: var(--label-primary);
16
+ margin: 0 0 8px;
17
+ padding: 0;
18
+ }
19
+
20
+ &__requirements-list {
21
+ list-style: none;
22
+ margin: 0;
23
+ padding: 0;
24
+ display: flex;
25
+ flex-direction: column;
26
+ gap: 6px;
27
+ }
28
+
29
+ &__requirement-item {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 8px;
33
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
34
+ font-size: 15px;
35
+ font-weight: 400;
36
+ line-height: 1.4;
37
+ color: var(--label-primary);
38
+ }
39
+
40
+ &__requirement-icon {
41
+ width: 16px;
42
+ height: 16px;
43
+ flex-shrink: 0;
44
+ border-radius: 50%;
45
+ display: flex;
46
+ align-items: center;
47
+ justify-content: center;
48
+
49
+ &--met {
50
+ color: var(--label-status-success);
51
+ }
52
+
53
+ &--unmet {
54
+ color: var(--label-status-error);
55
+ }
56
+
57
+ &--neutral {
58
+ color: var(--label-tertiary);
59
+ }
60
+ }
61
+
62
+ &__field {
63
+ margin-bottom: 16px;
64
+ }
65
+
66
+ &__field--last {
67
+ margin-bottom: 24px;
68
+ }
69
+
70
+ &__strength {
71
+ margin-top: 8px;
72
+ }
73
+
74
+ &__strength-header {
75
+ display: flex;
76
+ justify-content: space-between;
77
+ margin-bottom: 4px;
78
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
79
+ font-size: 12px;
80
+ color: var(--label-secondary);
81
+ }
82
+
83
+ &__strength-bar-track {
84
+ height: 4px;
85
+ background-color: var(--surface-tertiary);
86
+ border-radius: 4px;
87
+ overflow: hidden;
88
+ }
89
+
90
+ &__strength-bar-fill {
91
+ height: 100%;
92
+ border-radius: 4px;
93
+ transition: width 0.3s ease, background-color 0.3s ease;
94
+ }
95
+
96
+ &__match {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 8px;
100
+ margin-top: 8px;
101
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
102
+ font-size: 13px;
103
+
104
+ &--match {
105
+ color: var(--label-status-success);
106
+ }
107
+
108
+ &--no-match {
109
+ color: var(--label-status-error);
110
+ }
111
+ }
112
+
113
+ &__actions {
114
+ display: flex;
115
+ flex-direction: column;
116
+ gap: 12px;
117
+ align-items: flex-start;
118
+ }
119
+
120
+ &__reset-link {
121
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
122
+ font-size: 15px;
123
+ font-weight: 400;
124
+ color: var(--label-action);
125
+ text-decoration: underline;
126
+ background: none;
127
+ border: none;
128
+ padding: 0;
129
+ cursor: pointer;
130
+
131
+ &:hover {
132
+ opacity: 0.8;
133
+ }
134
+ }
135
+
136
+ &__error {
137
+ display: flex;
138
+ align-items: center;
139
+ gap: 8px;
140
+ padding: 10px 12px;
141
+ border-radius: 8px;
142
+ background-color: var(--surface-status-error);
143
+ border: 1px solid var(--border-status-error);
144
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
145
+ font-size: 13px;
146
+ color: var(--label-status-error);
147
+ margin-bottom: 16px;
148
+ }
149
+ }
@@ -0,0 +1,45 @@
1
+ import React from 'react'
2
+ import type { Meta, StoryObj } from '@storybook/react'
3
+ import { CreatePasswordPage } from './CreatePasswordPage'
4
+
5
+ const meta: Meta<typeof CreatePasswordPage> = {
6
+ title: 'v2/Pages/Auth/Create Password',
7
+ component: CreatePasswordPage,
8
+ parameters: {
9
+ layout: 'fullscreen',
10
+ },
11
+ argTypes: {
12
+ onSubmit: { action: 'submitted' },
13
+ onResetInstead: { action: 'reset-instead' },
14
+ isLoading: { control: 'boolean' },
15
+ error: { control: 'text' },
16
+ },
17
+ }
18
+
19
+ export default meta
20
+ type Story = StoryObj<typeof CreatePasswordPage>
21
+
22
+ export const Default: Story = {
23
+ args: {
24
+ onSubmit: async (password) => {
25
+ console.log('Set password:', password)
26
+ },
27
+ onResetInstead: () => {
28
+ console.log('Reset instead clicked')
29
+ },
30
+ },
31
+ }
32
+
33
+ export const Loading: Story = {
34
+ args: {
35
+ ...Default.args,
36
+ isLoading: true,
37
+ },
38
+ }
39
+
40
+ export const WithError: Story = {
41
+ args: {
42
+ ...Default.args,
43
+ error: 'Failed to update password. Please try again.',
44
+ },
45
+ }
@@ -0,0 +1,179 @@
1
+ import React from 'react'
2
+ import { useForm } from 'react-hook-form'
3
+ import { useTranslation } from 'react-i18next'
4
+ import { AuthLayout } from '../AuthLayout'
5
+ import { FormField } from '../../../components/FormField'
6
+ import { Button } from '../../../components/Button'
7
+ import { PasswordTypeIcon, PasswordRequirementIcon } from '../../../icons'
8
+ import './CreatePasswordPage.scss'
9
+
10
+ type FormValues = {
11
+ password: string
12
+ confirmPassword: string
13
+ }
14
+
15
+ export interface CreatePasswordPageProps {
16
+ onSubmit: (password: string) => Promise<void> | void
17
+ onResetInstead?: () => void
18
+ isLoading?: boolean
19
+ error?: string
20
+ }
21
+
22
+ export const CreatePasswordPage: React.FC<CreatePasswordPageProps> = ({
23
+ onSubmit,
24
+ onResetInstead,
25
+ isLoading = false,
26
+ error,
27
+ }) => {
28
+ const { t } = useTranslation(['Validation', 'User'])
29
+ const { register, handleSubmit, watch, formState: { errors } } = useForm<FormValues>({ mode: 'onChange' })
30
+
31
+ const password = watch('password', '')
32
+ const confirmPassword = watch('confirmPassword', '')
33
+
34
+ const hasNumber = /\d/.test(password)
35
+ const hasCapital = /[A-Z]/.test(password)
36
+ const hasMinLength = password.length >= 8
37
+
38
+ const criteriaCount = [hasNumber, hasCapital, hasMinLength].filter(Boolean).length
39
+
40
+ const getStrengthColor = () => {
41
+ if (password.length === 0) return 'transparent'
42
+ if (criteriaCount <= 1) return 'var(--red-600)'
43
+ if (criteriaCount === 2) return 'var(--orange-500)'
44
+ return 'var(--green-600)'
45
+ }
46
+
47
+ const getStrengthWidth = () => {
48
+ if (password.length === 0) return '0%'
49
+ if (criteriaCount <= 1) return '33%'
50
+ if (criteriaCount === 2) return '66%'
51
+ return '100%'
52
+ }
53
+
54
+ const getStrengthLabel = () => {
55
+ if (password.length === 0) return ''
56
+ if (criteriaCount <= 1) return t('User:passwordStrengthWeak')
57
+ if (criteriaCount === 2) return t('User:passwordStrengthMedium')
58
+ return t('User:passwordStrengthStrong')
59
+ }
60
+
61
+ const passwordsMatch = password === confirmPassword && confirmPassword.length > 0
62
+ const showMatchIndicator = confirmPassword.length > 0
63
+
64
+ const onFormSubmit = async (data: FormValues) => {
65
+ await onSubmit(data.password)
66
+ }
67
+
68
+ return (
69
+ <AuthLayout
70
+ badgeLabel={t('User:newPassword')}
71
+ icon={<PasswordTypeIcon />}
72
+ title={t('User:newPassword')}
73
+ subtitle={t('User:newPasswordSubtitle')}
74
+ error={error}
75
+ >
76
+ <form className="auth-create-password" onSubmit={handleSubmit(onFormSubmit)} noValidate>
77
+
78
+ <div className="auth-create-password__requirements">
79
+ <p className="auth-create-password__requirements-title">
80
+ {t('User:passwordsMustContain')}
81
+ </p>
82
+ <ul className="auth-create-password__requirements-list">
83
+ <li className="auth-create-password__requirement-item">
84
+ <PasswordRequirementIcon met={hasNumber} visible={password.length > 0} />
85
+ {t('User:passwordRequireNumber')}
86
+ </li>
87
+ <li className="auth-create-password__requirement-item">
88
+ <PasswordRequirementIcon met={hasCapital} visible={password.length > 0} />
89
+ {t('User:passwordRequireCapital')}
90
+ </li>
91
+ <li className="auth-create-password__requirement-item">
92
+ <PasswordRequirementIcon met={hasMinLength} visible={password.length > 0} />
93
+ {t('User:passwordRequireMinLength')}
94
+ </li>
95
+ </ul>
96
+ </div>
97
+
98
+ <div className="auth-create-password__field">
99
+ <FormField
100
+ label={t('User:password')}
101
+ type="password"
102
+ disabled={isLoading}
103
+ error={errors.password?.message}
104
+ {...register('password', {
105
+ required: t('Validation:fieldRequired', { attribute: t('User:password') }) as string,
106
+ minLength: {
107
+ value: 8,
108
+ message: t('Validation:fieldMinLength', { attribute: t('User:password'), min: 8 }) as string,
109
+ },
110
+ })}
111
+ />
112
+ {password.length > 0 && (
113
+ <div className="auth-create-password__strength">
114
+ <div className="auth-create-password__strength-header">
115
+ <span>{t('User:passwordStrength')}</span>
116
+ <span>{getStrengthLabel()}</span>
117
+ </div>
118
+ <div className="auth-create-password__strength-bar-track">
119
+ <div
120
+ className="auth-create-password__strength-bar-fill"
121
+ style={{
122
+ width: getStrengthWidth(),
123
+ backgroundColor: getStrengthColor(),
124
+ }}
125
+ />
126
+ </div>
127
+ </div>
128
+ )}
129
+ </div>
130
+
131
+ <div className="auth-create-password__field--last">
132
+ <FormField
133
+ label={t('User:confirmPassword')}
134
+ type="password"
135
+ disabled={isLoading}
136
+ error={errors.confirmPassword?.message}
137
+ {...register('confirmPassword', {
138
+ required: t('Validation:fieldRequired', { attribute: t('User:confirmPassword') }) as string,
139
+ validate: (value) =>
140
+ value === password ||
141
+ (t('Validation:fieldDoesntMatchField', {
142
+ field1: t('User:confirmPassword'),
143
+ field2: t('User:password'),
144
+ }) as string),
145
+ })}
146
+ />
147
+ {showMatchIndicator && (
148
+ <div className={`auth-create-password__match auth-create-password__match--${passwordsMatch ? 'match' : 'no-match'}`}>
149
+ <PasswordRequirementIcon met={passwordsMatch} />
150
+ {passwordsMatch ? t('User:passwordsMatch') : t('User:passwordsDoNotMatch')}
151
+ </div>
152
+ )}
153
+ </div>
154
+
155
+ <div className="auth-create-password__actions">
156
+ <Button
157
+ type="submit"
158
+ variant="primary"
159
+ isLoading={isLoading}
160
+ disabled={isLoading}
161
+ >
162
+ {t('User:submit')}
163
+ </Button>
164
+
165
+ {onResetInstead && (
166
+ <button
167
+ type="button"
168
+ className="auth-create-password__reset-link"
169
+ onClick={onResetInstead}
170
+ disabled={isLoading}
171
+ >
172
+ {t('User:resetPasswordInstead')}
173
+ </button>
174
+ )}
175
+ </div>
176
+ </form>
177
+ </AuthLayout>
178
+ )
179
+ }
@@ -0,0 +1,2 @@
1
+ export { CreatePasswordPage } from './CreatePasswordPage'
2
+ export type { CreatePasswordPageProps } from './CreatePasswordPage'
@@ -0,0 +1,49 @@
1
+ .auth-login {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 0;
5
+
6
+ &__field {
7
+ margin-bottom: 16px;
8
+ }
9
+
10
+ &__field--last {
11
+ margin-bottom: 24px;
12
+ }
13
+
14
+ &__forgot {
15
+ display: inline-block;
16
+ margin-top: 8px;
17
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
18
+ font-size: 15px;
19
+ font-weight: 400;
20
+ color: var(--label-action);
21
+ text-decoration: underline;
22
+ background: none;
23
+ border: none;
24
+ padding: 0;
25
+ cursor: pointer;
26
+
27
+ &:hover {
28
+ opacity: 0.8;
29
+ }
30
+ }
31
+
32
+ &__actions {
33
+ margin-bottom: 0;
34
+ }
35
+
36
+ &__error {
37
+ display: flex;
38
+ align-items: center;
39
+ gap: 8px;
40
+ padding: 10px 12px;
41
+ border-radius: 8px;
42
+ background-color: var(--surface-status-error);
43
+ border: 1px solid var(--border-status-error);
44
+ font-family: var(--font-family-sans, 'Geist', sans-serif);
45
+ font-size: 13px;
46
+ color: var(--label-status-error);
47
+ margin-bottom: 16px;
48
+ }
49
+ }
@@ -0,0 +1,45 @@
1
+ import React from 'react'
2
+ import type { Meta, StoryObj } from '@storybook/react'
3
+ import { LoginPage } from './LoginPage'
4
+
5
+ const meta: Meta<typeof LoginPage> = {
6
+ title: 'v2/Pages/Auth/Login',
7
+ component: LoginPage,
8
+ parameters: {
9
+ layout: 'fullscreen',
10
+ },
11
+ argTypes: {
12
+ onSubmit: { action: 'submitted' },
13
+ onForgotPassword: { action: 'forgot-password' },
14
+ isLoading: { control: 'boolean' },
15
+ error: { control: 'text' },
16
+ },
17
+ }
18
+
19
+ export default meta
20
+ type Story = StoryObj<typeof LoginPage>
21
+
22
+ export const Default: Story = {
23
+ args: {
24
+ onSubmit: async (email, password) => {
25
+ console.log('Login:', email, password)
26
+ },
27
+ onForgotPassword: () => {
28
+ console.log('Forgot password clicked')
29
+ },
30
+ },
31
+ }
32
+
33
+ export const Loading: Story = {
34
+ args: {
35
+ ...Default.args,
36
+ isLoading: true,
37
+ },
38
+ }
39
+
40
+ export const WithError: Story = {
41
+ args: {
42
+ ...Default.args,
43
+ error: 'Invalid email or password. Please try again.',
44
+ },
45
+ }