@transferwise/components 0.0.0-experimental-b77dac7 → 0.0.0-experimental-fa3aa98
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/build/Calendar/Calendar.js +94 -16
- package/build/Calendar/Calendar.js.map +1 -1
- package/build/Calendar/Calendar.messages.js +12 -0
- package/build/Calendar/Calendar.messages.js.map +1 -1
- package/build/Calendar/Calendar.messages.mjs +12 -0
- package/build/Calendar/Calendar.messages.mjs.map +1 -1
- package/build/Calendar/Calendar.mjs +95 -17
- package/build/Calendar/Calendar.mjs.map +1 -1
- package/build/Calendar/DateHeader/DateHeader.js +5 -1
- package/build/Calendar/DateHeader/DateHeader.js.map +1 -1
- package/build/Calendar/DateHeader/DateHeader.mjs +5 -1
- package/build/Calendar/DateHeader/DateHeader.mjs.map +1 -1
- package/build/Calendar/DayCalendar/DayCalendar.js +14 -0
- package/build/Calendar/DayCalendar/DayCalendar.js.map +1 -1
- package/build/Calendar/DayCalendar/DayCalendar.mjs +14 -0
- package/build/Calendar/DayCalendar/DayCalendar.mjs.map +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.js +53 -19
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs +53 -19
- package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
- package/build/Calendar/MonthCalendar/MonthCalendar.js +6 -0
- package/build/Calendar/MonthCalendar/MonthCalendar.js.map +1 -1
- package/build/Calendar/MonthCalendar/MonthCalendar.mjs +6 -0
- package/build/Calendar/MonthCalendar/MonthCalendar.mjs.map +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js +8 -3
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs +8 -3
- package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
- package/build/Calendar/{tableLink → TableLink}/TableLink.js +26 -11
- package/build/Calendar/TableLink/TableLink.js.map +1 -0
- package/build/Calendar/{tableLink → TableLink}/TableLink.mjs +26 -11
- package/build/Calendar/TableLink/TableLink.mjs.map +1 -0
- package/build/Calendar/YearCalendar/Table/YearCalendarTable.js +8 -3
- package/build/Calendar/YearCalendar/Table/YearCalendarTable.js.map +1 -1
- package/build/Calendar/YearCalendar/Table/YearCalendarTable.mjs +8 -3
- package/build/Calendar/YearCalendar/Table/YearCalendarTable.mjs.map +1 -1
- package/build/Calendar/YearCalendar/YearCalendar.js +7 -0
- package/build/Calendar/YearCalendar/YearCalendar.js.map +1 -1
- package/build/Calendar/YearCalendar/YearCalendar.mjs +7 -0
- package/build/Calendar/YearCalendar/YearCalendar.mjs.map +1 -1
- package/build/DateLookup/DateLookup.js +20 -9
- package/build/DateLookup/DateLookup.js.map +1 -1
- package/build/DateLookup/DateLookup.mjs +20 -9
- package/build/DateLookup/DateLookup.mjs.map +1 -1
- package/build/DefinitionList/DefinitionList.js +1 -2
- package/build/DefinitionList/DefinitionList.js.map +1 -1
- package/build/DefinitionList/DefinitionList.mjs +1 -2
- package/build/DefinitionList/DefinitionList.mjs.map +1 -1
- package/build/common/DateUtils/hasDisabledDatesInMonth/hasDisabledDatesInMonth.js +33 -0
- package/build/common/DateUtils/hasDisabledDatesInMonth/hasDisabledDatesInMonth.js.map +1 -0
- package/build/common/DateUtils/hasDisabledDatesInMonth/hasDisabledDatesInMonth.mjs +31 -0
- package/build/common/DateUtils/hasDisabledDatesInMonth/hasDisabledDatesInMonth.mjs.map +1 -0
- package/build/common/DateUtils/isDateDisabled/isDateDisabled.js +40 -0
- package/build/common/DateUtils/isDateDisabled/isDateDisabled.js.map +1 -0
- package/build/common/DateUtils/isDateDisabled/isDateDisabled.mjs +38 -0
- package/build/common/DateUtils/isDateDisabled/isDateDisabled.mjs.map +1 -0
- package/build/i18n/en.json +4 -0
- package/build/i18n/en.json.js +4 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +4 -0
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/main.css +123 -73
- package/build/styles/Calendar/Calendar.css +112 -37
- package/build/styles/Calendar/TableLink/TableLink.css +115 -0
- package/build/styles/DefinitionList/DefinitionList.css +0 -30
- package/build/styles/main.css +123 -73
- package/build/types/Calendar/Calendar.d.ts +16 -3
- package/build/types/Calendar/Calendar.d.ts.map +1 -1
- package/build/types/Calendar/Calendar.messages.d.ts +20 -0
- package/build/types/Calendar/Calendar.messages.d.ts.map +1 -1
- package/build/types/Calendar/Calendar.types.d.ts +32 -0
- package/build/types/Calendar/Calendar.types.d.ts.map +1 -0
- package/build/types/Calendar/DateHeader/DateHeader.d.ts +2 -0
- package/build/types/Calendar/DateHeader/DateHeader.d.ts.map +1 -1
- package/build/types/Calendar/DayCalendar/DayCalendar.d.ts +5 -1
- package/build/types/Calendar/DayCalendar/DayCalendar.d.ts.map +1 -1
- package/build/types/Calendar/DayCalendar/Table/DayCalendarTable.d.ts +4 -0
- package/build/types/Calendar/DayCalendar/Table/DayCalendarTable.d.ts.map +1 -1
- package/build/types/Calendar/MonthCalendar/MonthCalendar.d.ts +1 -0
- package/build/types/Calendar/MonthCalendar/MonthCalendar.d.ts.map +1 -1
- package/build/types/Calendar/MonthCalendar/Table/MonthCalendarTable.d.ts +2 -1
- package/build/types/Calendar/MonthCalendar/Table/MonthCalendarTable.d.ts.map +1 -1
- package/build/types/Calendar/{tableLink → TableLink}/TableLink.d.ts +3 -1
- package/build/types/Calendar/TableLink/TableLink.d.ts.map +1 -0
- package/build/types/Calendar/TableLink/index.d.ts.map +1 -0
- package/build/types/Calendar/YearCalendar/Table/YearCalendarTable.d.ts +2 -1
- package/build/types/Calendar/YearCalendar/Table/YearCalendarTable.d.ts.map +1 -1
- package/build/types/Calendar/YearCalendar/YearCalendar.d.ts +1 -0
- package/build/types/Calendar/YearCalendar/YearCalendar.d.ts.map +1 -1
- package/build/types/Calendar/index.d.ts +1 -0
- package/build/types/Calendar/index.d.ts.map +1 -1
- package/build/types/DateLookup/DateLookup.d.ts +24 -5
- package/build/types/DateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/DateLookup/index.d.ts +1 -0
- package/build/types/DateLookup/index.d.ts.map +1 -1
- package/build/types/DefinitionList/DefinitionList.d.ts.map +1 -1
- package/build/types/common/DateUtils/hasDisabledDatesInMonth/hasDisabledDatesInMonth.d.ts +3 -0
- package/build/types/common/DateUtils/hasDisabledDatesInMonth/hasDisabledDatesInMonth.d.ts.map +1 -0
- package/build/types/common/DateUtils/index.d.ts +2 -0
- package/build/types/common/DateUtils/index.d.ts.map +1 -1
- package/build/types/common/DateUtils/isDateDisabled/isDateDisabled.d.ts +3 -0
- package/build/types/common/DateUtils/isDateDisabled/isDateDisabled.d.ts.map +1 -0
- package/build/types/index.d.ts +3 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +8 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Calendar/Calendar.css +112 -37
- package/src/Calendar/Calendar.disabledDates.test.tsx +518 -0
- package/src/Calendar/Calendar.less +5 -35
- package/src/Calendar/Calendar.messages.ts +21 -0
- package/src/Calendar/Calendar.test.tsx +288 -27
- package/src/Calendar/Calendar.tsx +136 -19
- package/src/Calendar/Calendar.types.ts +35 -0
- package/src/Calendar/DateHeader/DateHeader.tsx +6 -0
- package/src/Calendar/DayCalendar/DayCalendar.tsx +33 -1
- package/src/Calendar/DayCalendar/Table/DayCalendarTable.tsx +62 -28
- package/src/Calendar/MonthCalendar/MonthCalendar.tsx +8 -0
- package/src/Calendar/MonthCalendar/Table/MonthCalendarTable.tsx +15 -3
- package/src/Calendar/TableLink/TableLink.css +115 -0
- package/src/Calendar/TableLink/TableLink.less +68 -0
- package/src/Calendar/{tableLink → TableLink}/TableLink.tsx +29 -14
- package/src/Calendar/YearCalendar/Table/YearCalendarTable.tsx +15 -3
- package/src/Calendar/YearCalendar/YearCalendar.tsx +9 -0
- package/src/Calendar/_stories/Calendar.accessibility.docs.mdx +118 -0
- package/src/Calendar/_stories/Calendar.story.tsx +138 -4
- package/src/Calendar/_stories/Calendar.test.story.tsx +74 -0
- package/src/Calendar/index.ts +7 -0
- package/src/DateLookup/DateLookup.disabledDates.test.tsx +293 -0
- package/src/DateLookup/DateLookup.test.tsx +34 -37
- package/src/DateLookup/DateLookup.tsx +37 -13
- package/src/DateLookup/_stories/DateLookup.accessibility.docs.mdx +108 -0
- package/src/DateLookup/_stories/DateLookup.story.tsx +124 -2
- package/src/DateLookup/index.ts +6 -0
- package/src/DefinitionList/DefinitionList.css +0 -30
- package/src/DefinitionList/DefinitionList.less +0 -24
- package/src/DefinitionList/DefinitionList.tsx +0 -1
- package/src/common/DateUtils/hasDisabledDatesInMonth/hasDisabledDatesInMonth.test.ts +98 -0
- package/src/common/DateUtils/hasDisabledDatesInMonth/hasDisabledDatesInMonth.ts +45 -0
- package/src/common/DateUtils/index.ts +2 -0
- package/src/common/DateUtils/isDateDisabled/isDateDisabled.test.ts +169 -0
- package/src/common/DateUtils/isDateDisabled/isDateDisabled.ts +59 -0
- package/src/i18n/en.json +4 -0
- package/src/index.ts +3 -2
- package/src/main.css +123 -73
- package/build/Calendar/tableLink/TableLink.js.map +0 -1
- package/build/Calendar/tableLink/TableLink.mjs.map +0 -1
- package/build/types/Calendar/tableLink/TableLink.d.ts.map +0 -1
- package/build/types/Calendar/tableLink/index.d.ts.map +0 -1
- package/src/DefinitionList/_stories/DefinitionList.test.story.tsx +0 -168
- /package/build/types/Calendar/{tableLink → TableLink}/index.d.ts +0 -0
- /package/src/Calendar/{tableLink → TableLink}/index.ts +0 -0
package/src/main.css
CHANGED
|
@@ -27269,46 +27269,12 @@ a[data-toggle="tooltip"] {
|
|
|
27269
27269
|
pointer-events: auto;
|
|
27270
27270
|
}
|
|
27271
27271
|
|
|
27272
|
-
.
|
|
27273
|
-
|
|
27274
|
-
|
|
27275
|
-
table-layout: fixed;
|
|
27276
|
-
border: none;
|
|
27277
|
-
background-color: inherit;
|
|
27278
|
-
}
|
|
27279
|
-
|
|
27280
|
-
.tw-date-lookup-calendar thead {
|
|
27281
|
-
background-color: transparent;
|
|
27282
|
-
background-color: initial;
|
|
27283
|
-
}
|
|
27284
|
-
|
|
27285
|
-
.tw-date-lookup-calendar > tbody > tr > td.weekend button {
|
|
27286
|
-
color: #5d7079;
|
|
27287
|
-
color: var(--color-content-secondary);
|
|
27288
|
-
}
|
|
27289
|
-
|
|
27290
|
-
.tw-date-lookup-calendar > tbody > tr > td {
|
|
27291
|
-
border: none;
|
|
27292
|
-
padding: 4px;
|
|
27293
|
-
padding: var(--size-4);
|
|
27294
|
-
}
|
|
27295
|
-
|
|
27296
|
-
@media (max-width: 320px) {
|
|
27297
|
-
.tw-date-lookup-calendar > tbody > tr > td {
|
|
27298
|
-
padding: 0;
|
|
27299
|
-
}
|
|
27300
|
-
}
|
|
27301
|
-
|
|
27302
|
-
.tw-date-lookup-calendar > tbody > tr > td:has(.tw-date-lookup-day-option) {
|
|
27303
|
-
padding: 1px;
|
|
27304
|
-
}
|
|
27305
|
-
|
|
27306
|
-
.tw-date-lookup-calendar > tbody > tr > td button {
|
|
27272
|
+
.wds-Calendar__option--day,
|
|
27273
|
+
.wds-Calendar__option--month,
|
|
27274
|
+
.wds-Calendar__option--year {
|
|
27307
27275
|
width: 100%;
|
|
27308
27276
|
padding: 4px 0;
|
|
27309
27277
|
padding: var(--size-4) 0;
|
|
27310
|
-
color: #0097c7;
|
|
27311
|
-
color: var(--color-content-accent);
|
|
27312
27278
|
border: transparent;
|
|
27313
27279
|
border-radius: 10px;
|
|
27314
27280
|
border-radius: var(--radius-small);
|
|
@@ -27320,12 +27286,92 @@ a[data-toggle="tooltip"] {
|
|
|
27320
27286
|
}
|
|
27321
27287
|
|
|
27322
27288
|
@media (max-width: 320px) {
|
|
27323
|
-
.
|
|
27289
|
+
.wds-Calendar__option--day,
|
|
27290
|
+
.wds-Calendar__option--month,
|
|
27291
|
+
.wds-Calendar__option--year {
|
|
27324
27292
|
padding: 0;
|
|
27325
27293
|
}
|
|
27326
27294
|
}
|
|
27327
27295
|
|
|
27328
|
-
.
|
|
27296
|
+
.wds-Calendar__option--day:focus,
|
|
27297
|
+
.wds-Calendar__option--month:focus,
|
|
27298
|
+
.wds-Calendar__option--year:focus {
|
|
27299
|
+
background-color: var(--color-background-screen-hover);
|
|
27300
|
+
}
|
|
27301
|
+
|
|
27302
|
+
.wds-Calendar__option--day.disabled,
|
|
27303
|
+
.wds-Calendar__option--month.disabled,
|
|
27304
|
+
.wds-Calendar__option--year.disabled,
|
|
27305
|
+
.wds-Calendar__option--day[aria-disabled="true"],
|
|
27306
|
+
.wds-Calendar__option--month[aria-disabled="true"],
|
|
27307
|
+
.wds-Calendar__option--year[aria-disabled="true"] {
|
|
27308
|
+
--ring-outline-color: var(--color-sentiment-content-primary);
|
|
27309
|
+
color: #768e9c;
|
|
27310
|
+
color: var(--color-content-tertiary);
|
|
27311
|
+
cursor: not-allowed;
|
|
27312
|
+
}
|
|
27313
|
+
|
|
27314
|
+
.wds-Calendar__option--day.disabled:hover,
|
|
27315
|
+
.wds-Calendar__option--month.disabled:hover,
|
|
27316
|
+
.wds-Calendar__option--year.disabled:hover,
|
|
27317
|
+
.wds-Calendar__option--day[aria-disabled="true"]:hover,
|
|
27318
|
+
.wds-Calendar__option--month[aria-disabled="true"]:hover,
|
|
27319
|
+
.wds-Calendar__option--year[aria-disabled="true"]:hover,
|
|
27320
|
+
.wds-Calendar__option--day.disabled:focus,
|
|
27321
|
+
.wds-Calendar__option--month.disabled:focus,
|
|
27322
|
+
.wds-Calendar__option--year.disabled:focus,
|
|
27323
|
+
.wds-Calendar__option--day[aria-disabled="true"]:focus,
|
|
27324
|
+
.wds-Calendar__option--month[aria-disabled="true"]:focus,
|
|
27325
|
+
.wds-Calendar__option--year[aria-disabled="true"]:focus {
|
|
27326
|
+
filter: initial;
|
|
27327
|
+
opacity: 1;
|
|
27328
|
+
opacity: initial;
|
|
27329
|
+
background-color: var(--color-sentiment-background-surface);
|
|
27330
|
+
color: var(--color-sentiment-content-primary);
|
|
27331
|
+
}
|
|
27332
|
+
|
|
27333
|
+
.wds-Calendar__option--day.disabled.active,
|
|
27334
|
+
.wds-Calendar__option--month.disabled.active,
|
|
27335
|
+
.wds-Calendar__option--year.disabled.active,
|
|
27336
|
+
.wds-Calendar__option--day[aria-disabled="true"].active,
|
|
27337
|
+
.wds-Calendar__option--month[aria-disabled="true"].active,
|
|
27338
|
+
.wds-Calendar__option--year[aria-disabled="true"].active,
|
|
27339
|
+
.wds-Calendar__option--day.disabled.active:hover,
|
|
27340
|
+
.wds-Calendar__option--month.disabled.active:hover,
|
|
27341
|
+
.wds-Calendar__option--year.disabled.active:hover,
|
|
27342
|
+
.wds-Calendar__option--day[aria-disabled="true"].active:hover,
|
|
27343
|
+
.wds-Calendar__option--month[aria-disabled="true"].active:hover,
|
|
27344
|
+
.wds-Calendar__option--year[aria-disabled="true"].active:hover,
|
|
27345
|
+
.wds-Calendar__option--day.disabled.active:active,
|
|
27346
|
+
.wds-Calendar__option--month.disabled.active:active,
|
|
27347
|
+
.wds-Calendar__option--year.disabled.active:active,
|
|
27348
|
+
.wds-Calendar__option--day[aria-disabled="true"].active:active,
|
|
27349
|
+
.wds-Calendar__option--month[aria-disabled="true"].active:active,
|
|
27350
|
+
.wds-Calendar__option--year[aria-disabled="true"].active:active,
|
|
27351
|
+
.wds-Calendar__option--day.disabled.active:focus,
|
|
27352
|
+
.wds-Calendar__option--month.disabled.active:focus,
|
|
27353
|
+
.wds-Calendar__option--year.disabled.active:focus,
|
|
27354
|
+
.wds-Calendar__option--day[aria-disabled="true"].active:focus,
|
|
27355
|
+
.wds-Calendar__option--month[aria-disabled="true"].active:focus,
|
|
27356
|
+
.wds-Calendar__option--year[aria-disabled="true"].active:focus {
|
|
27357
|
+
filter: initial;
|
|
27358
|
+
opacity: 1;
|
|
27359
|
+
opacity: initial;
|
|
27360
|
+
background-color: var(--color-sentiment-interactive-primary);
|
|
27361
|
+
color: var(--color-sentiment-interactive-secondary);
|
|
27362
|
+
}
|
|
27363
|
+
|
|
27364
|
+
.wds-Calendar__option--day.disabled.today,
|
|
27365
|
+
.wds-Calendar__option--month.disabled.today,
|
|
27366
|
+
.wds-Calendar__option--year.disabled.today,
|
|
27367
|
+
.wds-Calendar__option--day[aria-disabled="true"].today,
|
|
27368
|
+
.wds-Calendar__option--month[aria-disabled="true"].today,
|
|
27369
|
+
.wds-Calendar__option--year[aria-disabled="true"].today {
|
|
27370
|
+
text-decoration-color: #768e9c;
|
|
27371
|
+
text-decoration-color: var(--color-content-tertiary);
|
|
27372
|
+
}
|
|
27373
|
+
|
|
27374
|
+
.wds-Calendar__option--day {
|
|
27329
27375
|
height: 40px;
|
|
27330
27376
|
height: var(--size-40);
|
|
27331
27377
|
border-radius: 9999px;
|
|
@@ -27340,19 +27386,53 @@ a[data-toggle="tooltip"] {
|
|
|
27340
27386
|
justify-content: center;
|
|
27341
27387
|
}
|
|
27342
27388
|
|
|
27343
|
-
.
|
|
27389
|
+
.wds-Calendar__option--day.today {
|
|
27344
27390
|
-webkit-text-decoration: underline;
|
|
27345
27391
|
text-decoration: underline;
|
|
27346
27392
|
text-decoration-thickness: 2px;
|
|
27347
27393
|
text-underline-offset: 4px;
|
|
27348
27394
|
}
|
|
27349
27395
|
|
|
27350
|
-
.tw-date-lookup-calendar
|
|
27351
|
-
|
|
27396
|
+
.tw-date-lookup-calendar {
|
|
27397
|
+
min-width: 300px;
|
|
27398
|
+
text-align: center;
|
|
27399
|
+
table-layout: fixed;
|
|
27400
|
+
border: none;
|
|
27401
|
+
background-color: inherit;
|
|
27402
|
+
}
|
|
27403
|
+
|
|
27404
|
+
.tw-date-lookup-calendar thead {
|
|
27405
|
+
background-color: transparent;
|
|
27406
|
+
background-color: initial;
|
|
27407
|
+
}
|
|
27408
|
+
|
|
27409
|
+
.tw-date-lookup-calendar > tbody > tr > td.weekend button {
|
|
27410
|
+
color: #5d7079;
|
|
27411
|
+
color: var(--color-content-secondary);
|
|
27412
|
+
}
|
|
27413
|
+
|
|
27414
|
+
.tw-date-lookup-calendar > tbody > tr > td {
|
|
27415
|
+
border: none;
|
|
27416
|
+
padding: 4px;
|
|
27417
|
+
padding: var(--size-4);
|
|
27418
|
+
}
|
|
27419
|
+
|
|
27420
|
+
@media (max-width: 320px) {
|
|
27421
|
+
.tw-date-lookup-calendar > tbody > tr > td {
|
|
27422
|
+
padding: 0;
|
|
27423
|
+
}
|
|
27424
|
+
}
|
|
27425
|
+
|
|
27426
|
+
.tw-date-lookup-calendar > tbody > tr > td:has(.wds-Calendar__option--day) {
|
|
27427
|
+
padding: 1px;
|
|
27428
|
+
}
|
|
27429
|
+
|
|
27430
|
+
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.show-focus:not(.disabled):not([aria-disabled="true"]),
|
|
27431
|
+
.tw-date-lookup-calendar > tbody > tr > td:hover button:not(.disabled):not(:disabled):not([aria-disabled="true"]) {
|
|
27352
27432
|
background-color: var(--color-background-screen-hover);
|
|
27353
27433
|
}
|
|
27354
27434
|
|
|
27355
|
-
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.active {
|
|
27435
|
+
.tw-date-lookup-calendar > tbody > tr > td:not(.disabled):not(:disabled) button.active:not([aria-disabled="true"]) {
|
|
27356
27436
|
background-color: var(--color-interactive-primary);
|
|
27357
27437
|
color: var(--color-interactive-contrast);
|
|
27358
27438
|
}
|
|
@@ -28611,36 +28691,6 @@ button.np-option {
|
|
|
28611
28691
|
margin-bottom: 8px;
|
|
28612
28692
|
margin-bottom: var(--size-8);
|
|
28613
28693
|
}
|
|
28614
|
-
.tw-definition-list.tw-definition-list--horizontal-right-aligned {
|
|
28615
|
-
display: grid;
|
|
28616
|
-
grid-template-columns: minmax(0, max-content) minmax(0, max-content);
|
|
28617
|
-
grid-column-gap: 52px;
|
|
28618
|
-
grid-column-gap: var(--size-52);
|
|
28619
|
-
-moz-column-gap: 52px;
|
|
28620
|
-
column-gap: 52px;
|
|
28621
|
-
-moz-column-gap: var(--size-52);
|
|
28622
|
-
column-gap: var(--size-52);
|
|
28623
|
-
justify-content: space-between;
|
|
28624
|
-
}
|
|
28625
|
-
.tw-definition-list.tw-definition-list--horizontal-right-aligned .tw-definition-list__item {
|
|
28626
|
-
display: grid;
|
|
28627
|
-
grid-template-columns: subgrid;
|
|
28628
|
-
grid-column: 1 / -1;
|
|
28629
|
-
}
|
|
28630
|
-
.tw-definition-list.tw-definition-list--horizontal-right-aligned .tw-definition-list__item dt {
|
|
28631
|
-
max-width: none;
|
|
28632
|
-
min-width: 0;
|
|
28633
|
-
word-wrap: anywhere;
|
|
28634
|
-
margin-right: 0;
|
|
28635
|
-
}
|
|
28636
|
-
[dir="rtl"] .tw-definition-list.tw-definition-list--horizontal-right-aligned .tw-definition-list__item dt {
|
|
28637
|
-
margin-left: 0;
|
|
28638
|
-
margin-right: 0;
|
|
28639
|
-
margin-right: initial;
|
|
28640
|
-
}
|
|
28641
|
-
.tw-definition-list.tw-definition-list--horizontal-right-aligned .tw-definition-list__item dd {
|
|
28642
|
-
min-width: 0;
|
|
28643
|
-
}
|
|
28644
28694
|
}
|
|
28645
28695
|
|
|
28646
28696
|
.np-theme-personal .tw-definition-list dt {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableLink.js","sources":["../../../src/Calendar/tableLink/TableLink.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport messages from '../Calendar.messages';\n\ninterface TableLinkProps {\n item: number;\n type: 'day' | 'month' | 'year';\n title?: string;\n longTitle?: string;\n active: boolean;\n disabled: boolean;\n today: boolean;\n autofocus?: boolean;\n onClick: (item: number) => void;\n}\n\nconst TableLink = ({\n item,\n type,\n title,\n longTitle,\n active,\n disabled,\n today,\n autofocus,\n onClick,\n}: TableLinkProps) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n const intl = useIntl();\n\n useEffect(() => {\n if (autofocus) {\n setTimeout(() => {\n buttonRef.current?.focus();\n }, 0);\n }\n }, [autofocus]);\n\n const onCalendarClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n if (!disabled) {\n onClick(item);\n }\n };\n\n const calculateAriaLabel = () => {\n if (active) {\n return `${longTitle || title || ''}, ${intl.formatMessage(\n messages.selected,\n )} ${intl.formatMessage(messages[type])}`;\n }\n return longTitle || title;\n };\n\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n className={clsx(\n `tw-date-lookup-${type}-option np-text-body-default-bold`,\n { active: !!active },\n { today: !!today },\n )}\n disabled={disabled}\n tabIndex={autofocus ? 0 : -1}\n aria-label={calculateAriaLabel()}\n aria-pressed={active}\n onClick={onCalendarClick}\n >\n {title || item}\n </button>\n );\n};\n\nexport default TableLink;\n"],"names":["TableLink","item","type","title","longTitle","active","disabled","today","autofocus","onClick","buttonRef","useRef","intl","useIntl","useEffect","setTimeout","current","focus","onCalendarClick","event","preventDefault","calculateAriaLabel","formatMessage","messages","selected","_jsx","ref","className","clsx","tabIndex","children"],"mappings":";;;;;;;;;;AAkBA,MAAMA,SAAS,GAAGA,CAAC;EACjBC,IAAI;EACJC,IAAI;EACJC,KAAK;EACLC,SAAS;EACTC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,SAAS;AACTC,EAAAA;AAAO,CACQ,KAAI;AACnB,EAAA,MAAMC,SAAS,GAAGC,YAAM,CAAoB,IAAI,CAAC;AACjD,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;AAEtBC,EAAAA,eAAS,CAAC,MAAK;AACb,IAAA,IAAIN,SAAS,EAAE;AACbO,MAAAA,UAAU,CAAC,MAAK;AACdL,QAAAA,SAAS,CAACM,OAAO,EAAEC,KAAK,EAAE;MAC5B,CAAC,EAAE,CAAC,CAAC;AACP,IAAA;AACF,EAAA,CAAC,EAAE,CAACT,SAAS,CAAC,CAAC;EAEf,MAAMU,eAAe,GAAIC,KAA0C,IAAI;IACrEA,KAAK,CAACC,cAAc,EAAE;IACtB,IAAI,CAACd,QAAQ,EAAE;MACbG,OAAO,CAACR,IAAI,CAAC;AACf,IAAA;EACF,CAAC;EAED,MAAMoB,kBAAkB,GAAGA,MAAK;AAC9B,IAAA,IAAIhB,MAAM,EAAE;MACV,OAAO,CAAA,EAAGD,SAAS,IAAID,KAAK,IAAI,EAAE,CAAA,EAAA,EAAKS,IAAI,CAACU,aAAa,CACvDC,yBAAQ,CAACC,QAAQ,CAClB,CAAA,CAAA,EAAIZ,IAAI,CAACU,aAAa,CAACC,yBAAQ,CAACrB,IAAI,CAAC,CAAC,CAAA,CAAE;AAC3C,IAAA;IACA,OAAOE,SAAS,IAAID,KAAK;EAC3B,CAAC;AAED,EAAA,oBACEsB,cAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,GAAG,EAAEhB,SAAU;AACfR,IAAAA,IAAI,EAAC,QAAQ;AACbyB,IAAAA,SAAS,EAAEC,SAAI,CACb,CAAA,eAAA,EAAkB1B,IAAI,mCAAmC,EACzD;MAAEG,MAAM,EAAE,CAAC,CAACA;AAAM,KAAE,EACpB;MAAEE,KAAK,EAAE,CAAC,CAACA;KAAO,CAClB;AACFD,IAAAA,QAAQ,EAAEA,QAAS;AACnBuB,IAAAA,QAAQ,EAAErB,SAAS,GAAG,CAAC,GAAG,EAAG;IAC7B,YAAA,EAAYa,kBAAkB,EAAG;AACjC,IAAA,cAAA,EAAchB,MAAO;AACrBI,IAAAA,OAAO,EAAES,eAAgB;IAAAY,QAAA,EAExB3B,KAAK,IAAIF;AAAI,GACR,CAAC;AAEb;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableLink.mjs","sources":["../../../src/Calendar/tableLink/TableLink.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useEffect, useRef } from 'react';\nimport { useIntl } from 'react-intl';\n\nimport messages from '../Calendar.messages';\n\ninterface TableLinkProps {\n item: number;\n type: 'day' | 'month' | 'year';\n title?: string;\n longTitle?: string;\n active: boolean;\n disabled: boolean;\n today: boolean;\n autofocus?: boolean;\n onClick: (item: number) => void;\n}\n\nconst TableLink = ({\n item,\n type,\n title,\n longTitle,\n active,\n disabled,\n today,\n autofocus,\n onClick,\n}: TableLinkProps) => {\n const buttonRef = useRef<HTMLButtonElement>(null);\n const intl = useIntl();\n\n useEffect(() => {\n if (autofocus) {\n setTimeout(() => {\n buttonRef.current?.focus();\n }, 0);\n }\n }, [autofocus]);\n\n const onCalendarClick = (event: React.MouseEvent<HTMLButtonElement>) => {\n event.preventDefault();\n if (!disabled) {\n onClick(item);\n }\n };\n\n const calculateAriaLabel = () => {\n if (active) {\n return `${longTitle || title || ''}, ${intl.formatMessage(\n messages.selected,\n )} ${intl.formatMessage(messages[type])}`;\n }\n return longTitle || title;\n };\n\n return (\n <button\n ref={buttonRef}\n type=\"button\"\n className={clsx(\n `tw-date-lookup-${type}-option np-text-body-default-bold`,\n { active: !!active },\n { today: !!today },\n )}\n disabled={disabled}\n tabIndex={autofocus ? 0 : -1}\n aria-label={calculateAriaLabel()}\n aria-pressed={active}\n onClick={onCalendarClick}\n >\n {title || item}\n </button>\n );\n};\n\nexport default TableLink;\n"],"names":["TableLink","item","type","title","longTitle","active","disabled","today","autofocus","onClick","buttonRef","useRef","intl","useIntl","useEffect","setTimeout","current","focus","onCalendarClick","event","preventDefault","calculateAriaLabel","formatMessage","messages","selected","_jsx","ref","className","clsx","tabIndex","children"],"mappings":";;;;;;AAkBA,MAAMA,SAAS,GAAGA,CAAC;EACjBC,IAAI;EACJC,IAAI;EACJC,KAAK;EACLC,SAAS;EACTC,MAAM;EACNC,QAAQ;EACRC,KAAK;EACLC,SAAS;AACTC,EAAAA;AAAO,CACQ,KAAI;AACnB,EAAA,MAAMC,SAAS,GAAGC,MAAM,CAAoB,IAAI,CAAC;AACjD,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;AAEtBC,EAAAA,SAAS,CAAC,MAAK;AACb,IAAA,IAAIN,SAAS,EAAE;AACbO,MAAAA,UAAU,CAAC,MAAK;AACdL,QAAAA,SAAS,CAACM,OAAO,EAAEC,KAAK,EAAE;MAC5B,CAAC,EAAE,CAAC,CAAC;AACP,IAAA;AACF,EAAA,CAAC,EAAE,CAACT,SAAS,CAAC,CAAC;EAEf,MAAMU,eAAe,GAAIC,KAA0C,IAAI;IACrEA,KAAK,CAACC,cAAc,EAAE;IACtB,IAAI,CAACd,QAAQ,EAAE;MACbG,OAAO,CAACR,IAAI,CAAC;AACf,IAAA;EACF,CAAC;EAED,MAAMoB,kBAAkB,GAAGA,MAAK;AAC9B,IAAA,IAAIhB,MAAM,EAAE;MACV,OAAO,CAAA,EAAGD,SAAS,IAAID,KAAK,IAAI,EAAE,CAAA,EAAA,EAAKS,IAAI,CAACU,aAAa,CACvDC,QAAQ,CAACC,QAAQ,CAClB,CAAA,CAAA,EAAIZ,IAAI,CAACU,aAAa,CAACC,QAAQ,CAACrB,IAAI,CAAC,CAAC,CAAA,CAAE;AAC3C,IAAA;IACA,OAAOE,SAAS,IAAID,KAAK;EAC3B,CAAC;AAED,EAAA,oBACEsB,GAAA,CAAA,QAAA,EAAA;AACEC,IAAAA,GAAG,EAAEhB,SAAU;AACfR,IAAAA,IAAI,EAAC,QAAQ;AACbyB,IAAAA,SAAS,EAAEC,IAAI,CACb,CAAA,eAAA,EAAkB1B,IAAI,mCAAmC,EACzD;MAAEG,MAAM,EAAE,CAAC,CAACA;AAAM,KAAE,EACpB;MAAEE,KAAK,EAAE,CAAC,CAACA;KAAO,CAClB;AACFD,IAAAA,QAAQ,EAAEA,QAAS;AACnBuB,IAAAA,QAAQ,EAAErB,SAAS,GAAG,CAAC,GAAG,EAAG;IAC7B,YAAA,EAAYa,kBAAkB,EAAG;AACjC,IAAA,cAAA,EAAchB,MAAO;AACrBI,IAAAA,OAAO,EAAES,eAAgB;IAAAY,QAAA,EAExB3B,KAAK,IAAIF;AAAI,GACR,CAAC;AAEb;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableLink.d.ts","sourceRoot":"","sources":["../../../../src/Calendar/tableLink/TableLink.tsx"],"names":[],"mappings":"AAMA,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC;AAED,QAAA,MAAM,SAAS,GAAI,gFAUhB,cAAc,gCA8ChB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Calendar/tableLink/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
2
|
-
import { expect } from 'storybook/test';
|
|
3
|
-
|
|
4
|
-
import { Layout } from '../../common';
|
|
5
|
-
|
|
6
|
-
import DefinitionList, { type DefinitionListDefinition } from '..';
|
|
7
|
-
|
|
8
|
-
const longValues = {
|
|
9
|
-
amount: '1,234,567.89 GBP from your Wise Business account ending in 4821',
|
|
10
|
-
arrival: 'Tuesday, 14 July 2026 at 18:30 Eastern European Summer Time',
|
|
11
|
-
method: 'Business account ending in 4821 · Manual bank transfer',
|
|
12
|
-
recipients: 'Thirty-two recipients across twelve destination currencies',
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const longTitles = {
|
|
16
|
-
amount: "Total amount we'll convert before sending this batch payment",
|
|
17
|
-
arrival: 'Estimated arrival time for all recipients in this batch',
|
|
18
|
-
method: 'Payment method used to fund this batch transfer',
|
|
19
|
-
recipients: 'Number of recipients included in this batch payment',
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const longTitlesLongValues: DefinitionListDefinition[] = [
|
|
23
|
-
{ key: 'amount', title: longTitles.amount, value: longValues.amount },
|
|
24
|
-
{ key: 'arrival', title: longTitles.arrival, value: longValues.arrival },
|
|
25
|
-
{ key: 'method', title: longTitles.method, value: longValues.method },
|
|
26
|
-
{ key: 'recipients', title: longTitles.recipients, value: longValues.recipients },
|
|
27
|
-
];
|
|
28
|
-
|
|
29
|
-
const longTitlesShortValues: DefinitionListDefinition[] = [
|
|
30
|
-
{ key: 'amount', title: longTitles.amount, value: '1,234.56 GBP' },
|
|
31
|
-
{ key: 'arrival', title: longTitles.arrival, value: 'Today' },
|
|
32
|
-
{ key: 'method', title: longTitles.method, value: 'Bank transfer' },
|
|
33
|
-
{ key: 'recipients', title: longTitles.recipients, value: '32' },
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
const shortTitlesLongValues: DefinitionListDefinition[] = [
|
|
37
|
-
{ key: 'amount', title: 'Amount', value: longValues.amount },
|
|
38
|
-
{ key: 'arrival', title: 'Arrival', value: longValues.arrival },
|
|
39
|
-
{ key: 'method', title: 'Method', value: longValues.method },
|
|
40
|
-
{ key: 'recipients', title: 'Recipients', value: longValues.recipients },
|
|
41
|
-
];
|
|
42
|
-
|
|
43
|
-
const mixedContentLengths: DefinitionListDefinition[] = [
|
|
44
|
-
{ key: 'ticket-regression', title: "Total amount we'll convert", value: '1,234.56 GBP' },
|
|
45
|
-
{ key: 'short-short', title: 'Fees', value: '12.34 GBP' },
|
|
46
|
-
{ key: 'long-short', title: longTitles.arrival, value: 'Today' },
|
|
47
|
-
{ key: 'short-long', title: 'Method', value: longValues.method },
|
|
48
|
-
{ key: 'long-long', title: longTitles.recipients, value: longValues.recipients },
|
|
49
|
-
{
|
|
50
|
-
key: 'styled-content',
|
|
51
|
-
title: <strong>Current available balance before this payment</strong>,
|
|
52
|
-
value: <strong>98,765.43 GBP</strong>,
|
|
53
|
-
},
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
type TestCaseProps = {
|
|
57
|
-
definitions: DefinitionListDefinition[];
|
|
58
|
-
label: string;
|
|
59
|
-
width?: number;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const TestCase = ({ definitions, label, width = 640 }: TestCaseProps) => (
|
|
63
|
-
<section style={{ maxWidth: '100%', width }}>
|
|
64
|
-
<h2 style={{ fontSize: 16, margin: '0 0 var(--size-16)' }}>{label}</h2>
|
|
65
|
-
<DefinitionList definitions={definitions} layout={Layout.HORIZONTAL_RIGHT_ALIGNED} />
|
|
66
|
-
</section>
|
|
67
|
-
);
|
|
68
|
-
|
|
69
|
-
const meta = {
|
|
70
|
-
component: DefinitionList,
|
|
71
|
-
parameters: { controls: { disable: true } },
|
|
72
|
-
tags: ['!autodocs', '!manifest'],
|
|
73
|
-
title: 'Typography/DefinitionList/Tests',
|
|
74
|
-
} satisfies Meta<typeof DefinitionList>;
|
|
75
|
-
|
|
76
|
-
export default meta;
|
|
77
|
-
|
|
78
|
-
type Story = StoryObj<typeof meta>;
|
|
79
|
-
|
|
80
|
-
const assertSharedColumnBoundary = async (canvasElement: HTMLElement) => {
|
|
81
|
-
const lists = [
|
|
82
|
-
...canvasElement.querySelectorAll<HTMLElement>('.tw-definition-list--horizontal-right-aligned'),
|
|
83
|
-
];
|
|
84
|
-
|
|
85
|
-
await expect(lists.length).toBeGreaterThan(0);
|
|
86
|
-
|
|
87
|
-
for (const list of lists) {
|
|
88
|
-
const rows = [...list.querySelectorAll<HTMLElement>('.tw-definition-list__item')];
|
|
89
|
-
const columns = rows.map((row) => ({
|
|
90
|
-
row,
|
|
91
|
-
title: row.querySelector<HTMLElement>('dt'),
|
|
92
|
-
value: row.querySelector<HTMLElement>('dd'),
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
await expect(columns.every(({ title, value }) => title && value)).toBe(true);
|
|
96
|
-
|
|
97
|
-
const horizontalColumns = columns.filter(({ row }) =>
|
|
98
|
-
['flex', 'grid'].includes(getComputedStyle(row).display),
|
|
99
|
-
);
|
|
100
|
-
|
|
101
|
-
if (horizontalColumns.length > 0) {
|
|
102
|
-
const titleRects = horizontalColumns.map(({ title }) => title?.getBoundingClientRect());
|
|
103
|
-
const valueRects = horizontalColumns.map(({ value }) => value?.getBoundingClientRect());
|
|
104
|
-
const isRtl = getComputedStyle(list).direction === 'rtl';
|
|
105
|
-
|
|
106
|
-
if (isRtl) {
|
|
107
|
-
const valueColumnEnd = Math.max(...valueRects.map((rect) => rect?.right ?? 0));
|
|
108
|
-
const titleColumnStart = Math.min(
|
|
109
|
-
...titleRects.map((rect) => rect?.left ?? Number.POSITIVE_INFINITY),
|
|
110
|
-
);
|
|
111
|
-
|
|
112
|
-
await expect(valueColumnEnd).toBeLessThanOrEqual(titleColumnStart + 1);
|
|
113
|
-
await expect(titleColumnStart - valueColumnEnd).toBeGreaterThanOrEqual(51);
|
|
114
|
-
} else {
|
|
115
|
-
const titleColumnEnd = Math.max(...titleRects.map((rect) => rect?.right ?? 0));
|
|
116
|
-
const valueColumnStart = Math.min(
|
|
117
|
-
...valueRects.map((rect) => rect?.left ?? Number.POSITIVE_INFINITY),
|
|
118
|
-
);
|
|
119
|
-
|
|
120
|
-
await expect(titleColumnEnd).toBeLessThanOrEqual(valueColumnStart + 1);
|
|
121
|
-
await expect(valueColumnStart - titleColumnEnd).toBeGreaterThanOrEqual(51);
|
|
122
|
-
}
|
|
123
|
-
} else {
|
|
124
|
-
for (const { title, value } of columns) {
|
|
125
|
-
if (title && value) {
|
|
126
|
-
const titleEnd = title.getBoundingClientRect().bottom;
|
|
127
|
-
const valueStart = value.getBoundingClientRect().top;
|
|
128
|
-
|
|
129
|
-
await expect(titleEnd).toBeLessThanOrEqual(valueStart + 1);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
for (const { title, value } of columns) {
|
|
135
|
-
if (title && value) {
|
|
136
|
-
await expect(title.scrollWidth).toBeLessThanOrEqual(title.clientWidth);
|
|
137
|
-
await expect(value.scrollWidth).toBeLessThanOrEqual(value.clientWidth);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
|
-
const verifySharedColumnBoundary: NonNullable<Story['play']> = async ({ canvasElement, step }) => {
|
|
144
|
-
await step('titles and values stay inside separate shared columns', async () => {
|
|
145
|
-
await assertSharedColumnBoundary(canvasElement);
|
|
146
|
-
});
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export const HORIZONTAL_RIGHT_ALIGNED: Story = {
|
|
150
|
-
name: 'HORIZONTAL_RIGHT_ALIGNED',
|
|
151
|
-
render: () => (
|
|
152
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: 'var(--size-48)' }}>
|
|
153
|
-
<TestCase
|
|
154
|
-
definitions={longTitlesLongValues}
|
|
155
|
-
label="Long titles with long values"
|
|
156
|
-
width={720}
|
|
157
|
-
/>
|
|
158
|
-
<TestCase definitions={shortTitlesLongValues} label="All short titles with long values" />
|
|
159
|
-
<TestCase definitions={longTitlesShortValues} label="All long titles with short values" />
|
|
160
|
-
<TestCase
|
|
161
|
-
definitions={mixedContentLengths}
|
|
162
|
-
label="Mixed title and value lengths"
|
|
163
|
-
width={520}
|
|
164
|
-
/>
|
|
165
|
-
</div>
|
|
166
|
-
),
|
|
167
|
-
play: verifySharedColumnBoundary,
|
|
168
|
-
};
|
|
File without changes
|
|
File without changes
|